var __extends,Bnet;(function(n){var t=function(){function n(n,t,i){t===void 0&&(t=function(){});i===void 0&&(i=".image");this.$bannerEl=n;this.onScrollCallback=t;this.parallaxRatio=2/5;this.headerImageScrollBottom=0;this.$image=n.find(i)}return n.prototype.initialize=function(){Modernizr.safari||(this.positionHeader(),this.addListeners(),this.onScroll())},n.prototype.addListeners=function(){var n=this;$(window).unbind(".parallaxBanner");$(window).on("scroll.parallaxBanner",function(){n.onScroll()});$(window).on("load",function(){n.positionHeader()})},n.prototype.onScroll=function(){var n=$(window).scrollTop(),t=Math.min(1,n/this.headerImageScrollBottom),i=n*this.parallaxRatio;this.$image.css({top:i,opacity:1-t});this.onScrollCallback(t)},n.prototype.setParallaxRatio=function(n){this.parallaxRatio=n},n.prototype.positionHeader=function(){var n=this;this.$bannerEl.length&&(this.headerImageScrollBottom=this.$bannerEl.height()+this.$bannerEl.offset().top,setTimeout(function(){n.$bannerEl.addClass("on")},500))},n}();n.ParallaxBanner=t})(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(i){function r(t){var r=i.call(this,t)||this;return n.Site.PageController.Instance.ajaxSectionRegex=/(^\/$)|(\/Explore(\/|\?)(?!Detail).*)/gi,n.Site.PageController.Instance.allowSamePathname=!0,n.Site.PageController.Instance.scrollToTopOnAjaxLoad=!1,r}return __extends(r,i),r.prototype.addPages=function(n){n.add("body.Explore.Category",function(){return new t.Category});n.add("body.Explore.News",function(){return new t.News});n.add("body.Explore.Detail.DestinyItem",function(){return new t.DestinyItemDetail});n.add("body.Explore.Detail.Event",function(){return new t.EventDetail})},r.Instance=new r("Explore"),r}(n.Site.Area);t.ExploreArea=i;n.Site.setCurrentArea(i.Instance)})(t=n.Explore||(n.Explore={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(i){function r(){var n=i!==null&&i.apply(this,arguments)||this;return n.$cardItems=$(".js-explore-item"),n.$navItems=$(".js-explore-subnav a"),n.$exploreContents=$("#explore-contents"),n.$loadingContainer=$(".loading-container"),n.$parallaxCards=null,n.scrollPointerEventsTimer=0,n}return __extends(r,i),r.prototype.addListeners=function(){var n=this;this.eventBinder.for($(window)).on("statechange popstate",function(){n.exploreDetailModal&&n.exploreDetailModal.close()});this.eventBinder.for($(window)).on("scroll",function(){return n.scrollParallaxCards()});this.eventBinder.for($(".js-load-more")).on("click",function(){n.infiniteScroll.triggerLoadNextPageManually()})},r.prototype.initialize=function(){var n=this;this.$parallaxCards=$(".js-explore-item.parallax");history.scrollRestoration="manual";this.animateCards(this.$cardItems,!0);setTimeout(function(){return n.animateNav()},350);this.setupInfiniteScrolling();this.setupFeaturedParallax();$("#explore-no-more-results").length>0&&$(".js-load-more").remove();this.scrollParallaxCards()},r.prototype.destroy=function(){this.animateCards(this.$cardItems,!1)},r.prototype.setupInfiniteScrolling=function(){var n=this;this.infiniteScroll=new t.InfiniteScroll(this.eventBinder,location.pathname,function(){var n=$(".explore-section").last().children();return n.eq(n.length-4)},undefined,1,{onResponseLoaded:function(t){var r=$(t),u=r.find("#explore-contents"),i=u.find(".js-explore-item, #explore-no-more-results");n.$exploreContents.append(i);n.animateCards(i,!0);$("#explore-no-more-results").length>0&&$(".js-load-more").remove();n.$parallaxCards=$(".js-explore-item.parallax")},onLoadingStarted:function(){$(".js-load-more").removeClass("on");n.$loadingContainer.destinyLoader({startOnInit:!0,destroyOnStop:!0,background:!1})},onLoadingFinished:function(t){n.$loadingContainer.destinyLoader("stop");t&&$(".js-load-more").addClass("on")},getChildrenLoaded:function(){return $("#explore-container .explore-item").length}});this.infiniteScroll.initialize()},r.prototype.setupFeaturedParallax=function(){var t,i;Modernizr.edge||(t=$(".featured-item"),t.length>0&&(i=new n.ParallaxBanner(t),i.initialize()))},r.prototype.scrollParallaxCards=function(){clearTimeout(this.scrollPointerEventsTimer);Modernizr.edge||Modernizr.safari||Modernizr.mobile;var t=$(window).height(),n=window.scrollY||document.documentElement.scrollTop,i=t+n;this.$parallaxCards.each(function(r,u){var f=$(u),c=f.height(),e=f.offset().top,s=c+e,l=e<i&&s>n;if(l){var h=e-t,a=s-h,v=n-h,y=v/a,o=y*100-100;o=Math.round(o*10)/10;f.children(".card-background").css({transform:"translate3d(0, "+o+"%, 0)"})}})},r.prototype.animateCards=function(n,t){n.addClass("sliding");var i=new Animator;i.afterAll=function(){n.removeClass("sliding")};t?(i.delayInMs=100,i.genericDelayClass(n)):(i.delayInMs=10,i.genericDelayOffClass(n))},r.prototype.animateNav=function(){if(n.Site.loadedViaAjax)this.$navItems.addClass("force-on");else{var t=new Animator;t.genericDelayClass(this.$navItems)}},r}(n.Site.PageInitializer);t.Category=i})(t=n.Explore||(n.Explore={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.initialize=function(){var t=$(".gear-item-detail");this.gearItemDetail=new n.Gear.GearItemDetail(t);this.gearItemDetail.initialize()},i.prototype.addListeners=function(){},i}(n.Site.PageInitializer);t.DestinyItemDetail=i})(t=n.Explore||(n.Explore={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(){var n=t!==null&&t.apply(this,arguments)||this;return n.modalLinkRegex=/Explore\/Detail(.*)/i,n}return __extends(i,t),i.prototype.addListeners=function(){var n=this;this.eventBinder.for($(window)).on("statechange popstate",function(){n.exploreDetailModal&&n.exploreDetailModal.close()})},i.prototype.initialize=function(){history.scrollRestoration="manual";this.setupFeaturedParallax();this.setupVerifyEmailMessages()},i.prototype.modalLinkInterception=function(t){if(!t.href.match(this.modalLinkRegex)||n.Reactive.mobile.test())return!0;var r=t.search,i=t.href+r;return history.pushState({},null,i),this.showDetailModal(i,Globals.TrendingEntryType.News),!1},i.prototype.showDetailModal=function(t,i){if(t.indexOf("/Detail/Item")<0)this.exploreDetailModal=new n.ExploreDetailModal(t,i);else{var r=t.split("Detail/Item/")[1],u=r.split(/(\?|\/)/)[0];this.exploreDetailModal=new n.Gear.GearItemDetailModal(u,!0)}this.exploreDetailModal.open()},i.prototype.setupFeaturedParallax=function(){var t,i;Modernizr.edge||(t=$(".featured-item"),t.length>0&&(i=new n.ParallaxBanner(t),i.initialize()))},i.prototype.setupVerifyEmailMessages=function(){n.Utilities.User.isAuthenticated&&n.Site.GlobalData.getCurrentUser().then(function(){n.Utilities.LocalStorage.getItem("hideEmailMessageHomepage")||$(".bungiereward-message").addClass("show")});this.eventBinder.for(".hide-emailmessage").on("click",function(t){t.preventDefault();n.Utilities.LocalStorage.setItem("hideEmailMessageHomepage","true");var i=$(t.currentTarget);i.closest(".emailmessage").addClass("hide")})},i}(n.Site.PageInitializer);t.News=i})(t=n.Explore||(n.Explore={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.initialize=function(){},i.prototype.addListeners=function(){var n=this;this.eventBinder.for(".js-reward-item").on("click",function(t){var i=$(t.currentTarget).data("itemhash");n.showItem(i)})},i.prototype.showItem=function(t){var i=new n.Gear.GearItemDetailModal(t,!1);i.open()},i}(n.Site.PageInitializer);t.EventDetail=i})(t=n.Explore||(n.Explore={}))}(Bnet||(Bnet={})),function(n){var t;(function(t){var i=function(){function t(n,t,i,r,u,f){r===void 0&&(r=0);u===void 0&&(u=-1);this.eventBinder=n;this.baseUrl=t;this.getLastElement=i;this.firstPage=r;this.maxAutoLoads=u;this.callbacks=f;this.currentPage=this.firstPage;this.lastItemDirty=!1;this.canLoad=!0;this.autoloadCount=0;this._$lastElement=null}return Object.defineProperty(t.prototype,"$lastElement",{get:function(){return(!this._$lastElement||this.lastItemDirty)&&(this.lastItemDirty=!1,this._$lastElement=this.getLastElement()),this._$lastElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"urlToLoadNext",{get:function(){var t=n.Utilities.Url.getObjectFromQueryString(),i;return t.page=this.currentPage+1,t.lastindex=this.callbacks.getChildrenLoaded(),i=n.Utilities.Url.createQueryFromObject(t),""+this.baseUrl+i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxAutoLoadsReached",{get:function(){return this.maxAutoLoads!==-1&&this.autoloadCount>=this.maxAutoLoads},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.addListeners()},t.prototype.addListeners=function(){var n=this,t=this.eventBinder.for($(window)).on("scroll.explore_infinite_scroll",function(){if(n.maxAutoLoadsReached)t.off("scroll.explore_infinite_scroll");else{var i=n.tryLoad();i&&n.autoloadCount++}})},t.prototype.tryLoad=function(){var t=this;if(!this.canLoad)return!1;var i=$(window),r=window.scrollY||document.documentElement.scrollTop,u=r+i.height(),f=this.determineShouldLoad(u);return f?(this.callbacks.onLoadingStarted&&this.callbacks.onLoadingStarted(),this.canLoad=!1,n.Utilities.Ajax.loadUrl({url:this.urlToLoadNext},function(n){t.callbacks.onResponseLoaded(n);t.lastItemDirty=!0;t.currentPage++},function(){n.Utilities.Modals.Alert(Localizer.Explore.nextpageloaderror)},function(){if(t.callbacks.onLoadingFinished)t.callbacks.onLoadingFinished(t.maxAutoLoadsReached);t.canLoad=!0}),!0):!1},t.prototype.triggerLoadNextPageManually=function(){this.tryLoad()},t.prototype.determineShouldLoad=function(n){var t=this.$lastElement,i;return t==null||!t.offset()?!0:(i=t.offset().top+t.height(),n>=i)},t}();t.InfiniteScroll=i})(t=n.Explore||(n.Explore={}))}(Bnet||(Bnet={}))