var __awaiter=this&&this.__awaiter||function(n,t,i,r){return new(i||(i=Promise))(function(u,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?u(n.value):new i(function(t){t(n.value)}).then(o,s)}e((r=r.apply(n,t||[])).next())})},__generator=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},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),s=r==="flag"?bungieNetPlatform.ignoreService.FlagItem:bungieNetPlatform.ignoreService.IgnoreItem;this.checkAclAsync(Globals.AclEnum.BNextForumNinja).then(function(i){var c=i?$("#report-item-ninja-template").html():$("#report-item-template").html(),h=new n.ConfirmationModal(r,n.ConfirmationReason.Warning,c,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());s(o,function(){t.Modals.Alert(Localizer.Community.thankyouforyourreport);e&&e()},function(n){return t.Modals.Alert(n)})});h.afterOpenCallback=function(){var n={title:u,description:f},t=new Vue({el:h.modalContentElement[0],data:n})};h.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.checkAclAsync=function(t){return __awaiter(this,void 0,void 0,function(){var i,r;return __generator(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,n.Site.GlobalData.getCurrentUser()];case 1:if(i=u.sent(),!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?[2,!0]:[2,!1];case 2:return r=u.sent(),[2,!1];case 3:return[2]}})})},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={}))