var Bnet;(function(n){var t;(function(t){var i,r;(function(n){n[n.Invalid=0]="Invalid";n[n.Expired=1]="Expired";n[n.Current=2]="Current"})(i=t.CookieConsentValidity||(t.CookieConsentValidity={}));r=function(){function r(){}return Object.defineProperty(r,"isAuthenticated",{get:function(){return this.loggedInUserBnetMembershipId!=="0"},enumerable:!0,configurable:!0}),Object.defineProperty(r,"loggedInUserBnetMembershipId",{get:function(){var n=Cookies.Get(ServerVars.WebMembershipCookieName);return n!=null?n:"0"},enumerable:!0,configurable:!0}),Object.defineProperty(r,"onPageBungieNetMembershipId",{get:function(){var t="0";return n.Site.OnPageUser.MembershipData.bungieNetUser&&(t=n.Site.OnPageUser.MembershipData.bungieNetUser.membershipId),t},enumerable:!0,configurable:!0}),r.muteUser=function(n,t){var i={ignoredItemType:Globals.IgnoredItemType.User,itemContextType:Globals.IgnoredItemType.User,ignoredItemId:n};this.flagOrIgnoreItem(i,"ignore",Localizer.Community.whymuteuser,Localizer.Helptext.usermutetext,t)},r.unmuteUser=function(n,t){var i={ignoredItemType:Globals.IgnoredItemType.User,ignoredItemId:n};this.unignoreItem(i,t)},r.reportUser=function(n,t){var i={ignoredItemType:Globals.IgnoredItemType.UserProfile,itemContextType:Globals.IgnoredItemType.UserProfile,ignoredItemId:n};this.flagOrIgnoreItem(i,"flag",Localizer.Community.whyreportuserprofile,Localizer.Helptext.userprofilereporttext,t)},r.reportMessage=function(n,t){var i={ignoredItemType:Globals.IgnoredItemType.UserPrivateMessage,itemContextType:Globals.IgnoredItemType.UserPrivateMessage,ignoredItemId:n.memberFromId,itemContextId:n.messageId};this.flagOrIgnoreItem(i,"flag",Localizer.Community.whyreportmessage,Localizer.Helptext.messagereporttext,t)},r.flagOrIgnoreItem=function(i,r,u,f,e){var o=$.extend({},{ignoredItemId:null,ignoredItemType:null,itemContextId:null,comment:null,itemContextType:null,reason:null,requestedBlastBan:null,requestedPunishment:null},i),h=r==="flag"?bungieNetPlatform.ignoreService.FlagItem:bungieNetPlatform.ignoreService.IgnoreItem,s=new n.ConfirmationModal(r,n.ConfirmationReason.Warning,$("#report-item-template").html(),function(){var r=new n.UiKit.FormKit.DropdownItem("report-item"),i;o.reason=r.val();i=new n.UiKit.FormKit.DropdownItem("mod-report-item");i.exists&&(o.requestedPunishment=i.val());h(o,function(){t.Modals.Alert(Localizer.Community.thankyouforyourreport);e&&e()},function(n){return t.Modals.Alert(n)})});s.afterOpenCallback=function(){var n={title:u,description:f},t=new Vue({el:s.modalContentElement[0],data:n})};s.open()},r.unignoreItem=function(n,i){bungieNetPlatform.ignoreService.UnignoreItem(n,function(){i&&i()},function(n){return t.Modals.Alert(n)})},r.checkAcl=function(t){var i=n.Site.GlobalData.CurrentUser;if(!i)throw"CurrentUser is not available, and must be loaded by something first";return i.userAcls&&i.userAcls.length>0&&i.userAcls.indexOf(t)>-1?!0:!1},r.SetConsentCookie=function(){if(r.ConsentCookieIsEnabled()){var t=ServerVars.Cst.name,i=ServerVars.Cst.currentVersion,u=moment().add(7,"years").toDate();Cookies.SetWithExpires(t,i,u);n.Analytics.BnetTracking.Instance.loadTrackers()}},r.ConsentCookieIsEnabled=function(){return ServerVars.Cst.enabled},r.CookieConsentValidity=function(){var r=ServerVars.Cst.currentVersion,u=ServerVars.Cst.name,n=Cookies.Get(u),t=i.Invalid;return n&&(t=n===r?i.Current:i.Expired),t},r.CookieConsentIsCurrent=function(){return this.CookieConsentValidity()===i.Current},r}();t.User=r})(t=n.Utilities||(n.Utilities={}))})(Bnet||(Bnet={})),function(n){var t;(function(t){function f(n){var t={};n!==undefined&&(t.page=n);window.ga&&window.ga("send","pageview",t)}function u(n,t,i,r,u){var f={};i!==undefined&&(f.eventLabel=i);r!==undefined&&(f.eventValue=r);u=u||{};$.extend(f,u);window.ga&&window.ga("send","event",n,t,f)}function e(n,t,i,r,f){try{if(typeof f!="undefined"&&f!=null){var e=window.location.pathname,o=f.stack;u("Errors",e,o)}ServerVars.ShowErrorsInPage&&$("body").addClass("has-js-error")}catch(s){}}var i,r;(function(n){n[n.GoogleAnalytics=0]="GoogleAnalytics"})(i||(i={}));r=function(){function t(){}return t.prototype.userHasCookieConsent=function(){return typeof n.Utilities.User!="undefined"?n.Utilities.User.ConsentCookieIsEnabled()&&n.Utilities.User.CookieConsentIsCurrent():!1},t.prototype.loadTrackers=function(){},t.prototype.trackSession=function(){var i=n.Site.getPageData("SiteTagging"),r,t;if(i.SessionTracking)if(r=i.SessionTimeoutSeconds||1800,t=n.Utilities.SessionStorage.getItem("Session"),t){var e=moment(),u=JSON.parse(t),f={sessionId:u.sessionId,refreshDate:moment(u.refreshDate)};f.refreshDate.isBefore(e.add(r*-1,"seconds"))?this.createOrUpdateSession():this.createOrUpdateSession(f.sessionId)}else this.createOrUpdateSession()},t.prototype.createOrUpdateSession=function(t){var i={sessionId:t||n.Utilities.String.GenerateGuid(),refreshDate:moment()};n.Utilities.SessionStorage.setItem("Session",JSON.stringify(i))},t.Instance=new t,t}();t.BnetTracking=r;t.trackPageview=f;t.trackEvent=u;t.onError=e;window.onerror=function(t,i,r,u,f){try{n.Analytics.onError(t,i,r,u,f)}catch(e){}}})(t=n.Analytics||(n.Analytics={}))}(Bnet||(Bnet={}))