var __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)}}(),Bnet;(function(n){var t;(function(t){var i,r;(function(n){n[n.pending=0]="pending";n[n.members=1]="members";n[n.membersAdmin=2]="membersAdmin";n[n.banned=3]="banned";n[n.about=4]="about"})(i=t.GroupListenerPages||(t.GroupListenerPages={}));r=function(r){function u(){var t=r.call(this)||this;return t.selectedMembers=[],t.selectedPending=[],t.groupsLoc=Localizer.Groups,t.actionsLoc=Localizer.Actions,t.throttle=new n.GroupThrottles.Throttle,t.addBaseListeners(),t}return __extends(u,r),u.prototype.initialize=function(){},u.prototype.addListeners=function(){},u.prototype.addBaseListeners=function(){this.addAdminListenersForMemberTypePages();this.addListenersForGroupHeaderActions()},u.prototype.addAdminListenersForMemberTypePages=function(){var r=this;this.eventBinder.for("#AdminPages",".btn_ban").on("click",function(i){var s=n.GroupThrottles.GroupListenerThrottles.ban;if(!SignIn.notSignedIn()){i.preventDefault();var u=$(i.currentTarget),f=u.attr("data-membershipId"),e=u.closest(".pendingMember, .member").find(".displayName a").text(),o=u.attr("data-groupId");t.GroupAdminActions.banMember(o,Globals.BungieMembershipType.BungieNext,f,e,r.throttle)}});this.eventBinder.for("#AdminPages",".checkbox").on("click",function(n){var u=$(n.currentTarget),o=u.closest("ul"),e=u.closest("li"),f;if(u.closest("li").hasClass("selected")){if(u.closest("li").removeClass("selected"),o.data("select","false"),u.closest("#clanPendingMembers").length){for(f=0;f<r.selectedPending.length;f++)r.selectedPending[f].membershipId==u.closest("li").attr("data-membershipId")&&(r.selectedPending=r.selectedPending.filter(function(n,t){return t!=f}));t.GroupPageUtilities.updateTheSelectedMemberCount(i.pending,r.selectedPending)}}else u.closest("li").addClass("selected"),u.closest("#clanPendingMembers").length&&(r.selectedPending.push({membershipId:e.attr("data-membershipId"),displayName:e.attr("data-displayName"),groupId:e.attr("data-groupId")}),t.GroupPageUtilities.updateTheSelectedMemberCount(i.pending,r.selectedPending))});this.eventBinder.for("#AdminPages .container_pager",".btn_selectAll").on("click",function(n){n.preventDefault();var i=$(n.currentTarget),u=i.closest(".container_pager").prev("ul");u.attr("data-selectAll","true");u.children("li").find(".checkbox").closest("li").addClass("selected");t.GroupPageUtilities.updateTheSelectedCount(i,r.selectedPending,!1)});this.eventBinder.for("#AdminPages .container_pager",".btn_cancel").on("click",function(n){n.preventDefault();var i=$(n.currentTarget),u=i.closest(".container_pager").prev("ul");u.attr("data-selectAll","false");u.children("li.selected").removeClass("selected");t.GroupPageUtilities.updateTheSelectedCount(i,r.selectedPending,!0)})},u.prototype.addListenersForGroupHeaderActions=function(){var i=this;this.eventBinder.for("#groupHeader",".btn_joinGroup").on("click",function(r){if(!SignIn.notSignedIn()){r.preventDefault();var u=$(r.currentTarget),f=u.attr("data-groupId"),e=u.attr("data-membertype");u.hasClass("btn_leaveGroup")?t.GroupMemberActions.leaveGroup(f,Globals.BungieMembershipType[Globals.BungieMembershipType.BungieNext],e,i.groupsLoc.groupdeletionprompt,i.throttle):u.hasClass("btn_cancelPendingGroup")?t.GroupMemberActions.leaveGroup(f,Globals.BungieMembershipType[Globals.BungieMembershipType.BungieNext],e,i.groupsLoc.confirmcancelrequest,i.throttle):t.GroupMemberActions.joinGroup(f,Globals.BungieMembershipType[Globals.BungieMembershipType.BungieNext],n.Site.getPageData("groupName"),i.throttle)}});this.eventBinder.for("#groupHeader",".btn_reportGroupProfile").on("click",function(t){if(!SignIn.notSignedIn()){t.preventDefault();var i=$(t.currentTarget),r=i.attr("data-groupId");n.Groups.ReportGroupProfileModal.Show(r)}})},u}(n.Site.PageInitializer);t.BaseGroupPage=r})(t=n.Groups||(n.Groups={}))})(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(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.initialize=function(){var i=new t.AvatarsAndThemes;this.throttle=new n.GroupThrottles.Throttle},r.prototype.addListeners=function(){var i=this;this.eventBinder.for("#AdminPages","#textbox_clanTag").on("keypress",function(n){n.which===13&&t.Actions.addGroupTag($(n.currentTarget))});this.eventBinder.for("#AdminPages",".btn_addTag").on("click",function(n){n.preventDefault();t.Actions.addGroupTag($(n.currentTarget))});this.eventBinder.for("#AdminPages",".container_tags .tag").on("click",function(n){n.preventDefault();var t=$(n.currentTarget);(!t.closest("#groupHeader").length||t.closest("#groupHeader").length&&t.closest("#groupHeader").hasClass("isEditing"))&&t.remove()});this.eventBinder.for(".GroupSettingsForm",".btn_saveAboutSettings").on("click",function(r){var tt=n.GroupThrottles.GroupListenerThrottles.edit,e,a,o,v;if(r.preventDefault(),!SignIn.notSignedIn()){var y=$(r.currentTarget),p=y.attr("data-clanId"),u=$("#avatarList"),w=u.attr("data-newValue")!=""?u.attr("data-newValue"):u.attr("data-value"),f=$("#themeList"),b=f.attr("data-newValue")!=""?f.attr("data-newValue"):f.attr("data-value"),s=$("#textbox_clanName"),k=s.val(),h=$("#textbox_battleCry"),d=h.val(),c=$("#textarea_missionStatement"),g=c.val(),nt=$(".GroupSettingsForm #list_clanTags"),l=[];if(nt.find(".tag").each(function(){l.push($(this).text())}),e="en",a=$("select[name=chatLanguage]"),e=a.val(),o=n.Utilities.Validation.getErrors(s.add(h).add(c)),o.length){n.Utilities.Validation.renderErrors(o);return}v={name:k,callsign:null,motto:d,about:g,theme:b,tags:l.join(","),avatarImageIndex:parseInt(w,10),locale:e};t.GroupAdminActions.editGroup(v,p,i.throttle)}});this.eventBinder.for(".GroupSettingsForm",".btn_cancelClanSettings").on("click",function(n){n.preventDefault();var i=$("#select_clanChatSecurity");t.GroupPageUtilities.resetGroupEditFormCheckboxes($("#checkbox_clanChat").add("#checkbox_publicVisible").add("#checkbox_topicAdminOnly").add("#checkbox_postDefaultPublic"));i.find("[value="+i.attr("data-originalValue")+"]").prop("selected","selected").siblings().removeProp("selected")})},r}(n.Site.PageInitializer);t.About=i})(t=n.Groups||(n.Groups={}))}(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(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.initialize=function(){},t.prototype.addListeners=function(){},t}(n.Site.PageInitializer);t.GroupAdmin=i})(t=n.Groups||(n.Groups={}))}(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=/Groups(\/|\?)(?!.*(Search|MyGroups|Popular|SuggestedGroups|Chat))/i,n.EventMux.disableLogging(),r}return __extends(r,i),r.prototype.addPages=function(n){n.add("body.Groups.About",function(){return new t.About});n.add("body.Groups.Forum",function(){return new t.TopicsInit});n.add("body.Groups.Post",function(){return new t.PostsInit});n.add("body.Groups.Chat",function(){return new t.Chat});n.add("body.Groups.Search",function(){return new t.GroupsSearch});n.add("body.Groups.Members.Public",function(){return new t.GroupMembersVisitorView});n.add("body.Groups.Pending.Admin",function(){return new t.GroupPending});n.add("body.Groups.Members.Admin",function(){return new t.GroupMembersAdminView});n.add("body.Groups.Settings",function(){return new t.Settings});n.add("body.Groups.Banned",function(){return new t.GroupBanned})},r.Instance=new r("Groups"),r}(n.Site.Area);t.GroupsArea=i;n.Site.setCurrentArea(i.Instance)})(t=n.Groups||(n.Groups={}))}(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(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.initialize=function(){this.throttle=new n.GroupThrottles.Throttle},r.prototype.addListeners=function(){var n=this;this.eventBinder.for("#AdminPages",".btn_unblock").on("click",function(i){if(i.preventDefault(),!SignIn.notSignedIn()){var r=$(i.currentTarget),u=r.attr("data-membershipId"),f=r.closest(".member").find(".displayName a").text(),e=r.attr("data-groupId");t.GroupAdminActions.unbanMember(e,Globals.BungieMembershipType.BungieNext,u,f,n.throttle)}});this.eventBinder.for("#members",".container_pager [data-page]").on("click",function(t){var i;if(t.preventDefault(),i=$(t.currentTarget),!i.hasClass("disabled")){var r=i.closest(".container_pager").prev(),f=i.attr("data-page"),u="0";r.is($("#list_blocked"))&&(u=r.attr("data-groupId"),n.loadBannedMembersPage(u,parseInt(f,10)))}})},r.prototype.loadBannedMembersPage=function(i,r){var u=this;bungieNetPlatform.groupV2Service.GetBannedMembersOfGroup(i,r,function(n){var r,i;if(n.results.length){for(r=$("#list_blocked"),r.html(""),i=0;i<n.results.length;i++)u.renderBannedInList(n.results[i]);t.GroupPageUtilities.setPager(r,n)}},function(t){n.Utilities.Modals.Alert(t)})},r.prototype.renderBannedInList=function(n){var i=$("#list_blocked"),r='<li class="member" data-membershipId="'+n.bungieNetUserInfo.membershipId+'">\n\n\t\t\t\t\t'+t.GroupPageUtilities.createHtmlFromUserCard(n.bungieNetUserInfo)+'\n\n\t\t\t\t\t<p class="actions">\n\t\t\t\t\t\t<a  class="btn_unblock" data-membershipId="'+n.bungieNetUserInfo.membershipId+'" data-groupId="'+n.groupId+'">'+Localizer.Actions.unblock+"<\/a>\n\t\t\t\t\t<\/p>\n\t\t\t\t<\/li>";i.append(r)},r}(n.Site.PageInitializer);t.GroupBanned=i})(t=n.Groups||(n.Groups={}))}(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 e=function(t){function r(){return t.call(this)||this}return __extends(r,t),r.prototype.initialize=function(){n.Site.PageController.Instance.ajaxSectionRegex=/doNoTMatch/i;var t=new f;i.initialSidebarHeight=$(".container_GroupSidebar").outerHeight();$(window).off("resize.groupWall groupHeaderChanged.groupWall");$(window).on("resize.groupWall groupHeaderChanged.groupWall",function(){i.adjustWindowSize()});$(window).off("scroll.groupWall groupHeaderChanged.groupWall");$(window).on("scroll.groupWall",function(){i.adjustWindowSize()});n.Groups.GroupChatWindowHelper.adjustWindowSize();viewModels.clanChatViewModel.selfIsAdmin(clanChatSettings.selfIsAdmin);viewModels.clanChatViewModel.groupId(clanChatSettings.groupId);t.initialize();viewModels.clanChatViewModel.client().conversationId!==clanChatSettings.conversationId&&(viewModels.clanChatViewModel.client().conversationId=clanChatSettings.conversationId,t.reset());clanChatSettings.canViewChat&&t.start()},r.prototype.addListeners=function(){},r}(t.BaseGroupPage),r,u,f,i;t.Chat=e;r=function(n){function t(t,i){var r=n.call(this,t,i)||this;return r.signedInUser=t,viewModels.clanChatViewModel.client(r.viewModel),r}return __extends(t,n),t}(n.Chat.Client);t.GroupChatClient=r;u=function(n){function t(t,i){var r=n.call(this,t,i)||this;return r.client=t,r.selectors=i,r.counter=0,r}return __extends(t,n),t.prototype.setupScrolling=function(){var t=this,n=$(this.selectors.chatContainer);n.off("scroll.nextPageChat");n.on("scroll.nextPageChat",function(){t.handleScrolling()});this.counter===0?n.customScroll({forcePreventBodyScroll:!0}):n.customScroll("reset");this.counter++},t}(n.Chat.ChatUI);t.GroupChatUI=u;f=function(){function n(){this.chatUI=null;this.chatClient=null;this.started=!1}return n.prototype.initialize=function(){var n=this;viewModels.loggedInUserModelIsLoaded()?this.createChatObjects():viewModels.loggedInUserModelIsLoaded.subscribe(function(t){t&&n.createChatObjects()})},n.prototype.addListeners=function(){},n.prototype.createChatObjects=function(){if(this.chatClient===null){var n=ko.mapping.toJS(viewModels.loggedInUserModel().user);this.chatClient=new r(n,clanChatSettings.conversationId);viewModels.clanChatViewModel.chatUI().adultMode(!0);viewModels.clanChatViewModel.chatUI().loggedInMembershipId(n.membershipId);this.chatUI=new u(this.chatClient,{stableParentElement:"#container_ClanContent",chatContainer:".container_groupChatMessages",chatMessageList:".list_clanChat",submitButton:".btn_submitMessage",chatMessageEditArea:".textarea_chat",lightboxedImageTrigger:".list_clanChat .content img",showGatedButton:".gated",hideGatedButton:".btn_hideImage",newMessageBanner:".newmessage",chatMessageEditAreaContainer:".container_textarea"});this.started&&this.start()}},n.prototype.reset=function(){this.chatClient!==null&&this.chatClient.reset();this.chatUI!==null&&this.chatUI.reset();this.started=!1},n.prototype.start=function(){this.started=!0;this.chatClient!=null&&(this.chatClient.start(),this.chatUI.addListeners())},n.reportMessageActive=!1,n}();t.GroupChat=f;i=function(){function n(){}return n.adjustWindowSize=function(){var i=$(".GroupChat.onpage"),t,n;if(i.length){var r=$(".container_groupChatMessages"),u=window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight,f=$(window).scrollTop(),e=i.offset().top,o=$(".chatbar").outerHeight();this.initialSidebarHeight===null&&(this.initialSidebarHeight=$(".container_GroupSidebar").outerHeight());t=this.initialSidebarHeight;n=u-e-o+f;n>t&&(n=t);r.height(n)}},n.initialSidebarHeight=null,n}();t.GroupChatWindowHelper=i;viewModels.clanChatViewModel={client:ko.observable(new n.Chat.ChatViewModel("")),chatUI:ko.observable(new n.Chat.UIViewModel),selfIsAdmin:ko.observable(!1),groupId:ko.observable(0)};viewModels.finishRenderingChat=function(n){var t=$(n),i;t.is("li")&&(setTimeout(function(){t.removeClass("loading")},300),i=new CountUp($(n),".date",{timeUnits:{second:Localizer.Time.secondsletter,minute:Localizer.Time.minutesletter,hour:Localizer.Time.hoursletter,day:Localizer.Time.daysletter},timeSelector:".date",pluralUnits:!1,dataAttributeForDate:"time"}))}})(t=n.Groups||(n.Groups={}))}(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(){this.topics=new Topics({pageNumber:n.Site.getPageData("page"),forumType:n.Site.getPageData("forumType"),category:n.Site.getPageData("category"),sort:n.Site.getPageData("sort"),createdDate:n.Site.getPageData("dateFilter"),groupId:n.Site.getPageData("groupId"),tags:n.Site.getPageData("searchedTags"),activityOnPage:n.Site.getPageData("activityOnPage"),languages:n.Site.getPageData("languages")})},i.prototype.addListeners=function(){},i}(t.BaseGroupPage);t.TopicsInit=i})(t=n.Groups||(n.Groups={}))}(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(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.initialize=function(){console.log("hit the index one")},t.prototype.addListeners=function(){},t}(n.Site.PageInitializer);t.Index=i})(t=n.Groups||(n.Groups={}))}(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(n){var t=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.addListeners=function(){var n=this;t.prototype.addListeners.call(this);this.eventBinder.for("#members",".container_pager [data-page]").on("click",function(t){var i,e;if(t.preventDefault(),i=$(t.currentTarget),!i.hasClass("disabled")&&!i.hasClass("on")){var r=i.closest(".container_pager").prev(),f=parseInt(i.attr("data-page"),10),u="0";r.is($("#list_admins"))&&(u=r.attr("data-groupId"),n.loadMembersPage(u,f,Globals.RuntimeGroupMemberType.Admin));r.attr("id")==="list_members"&&(u=r.attr("data-groupId"),e=r.attr("data-sort"),n.loadMembersPage(u,f,Globals.RuntimeGroupMemberType.Member))}})},i.prototype.loadMembersPage=function(t,i,r){var e=this,u=$("#list_members"),f;r===Globals.RuntimeGroupMemberType.Admin&&(u=$("#list_admins"));f=r;bungieNetPlatform.groupV2Service.GetMembersOfGroup(t,i,f,"",function(t){if(t.results.length){u.html("");for(var i=0;i<t.results.length;i++)e.renderMemberInList(t.results[i],t.results[i].memberType)}n.GroupPageUtilities.setPager(u,t)},function(){})},i.prototype.renderMemberInList=function(n,t){var i="member",r=$("#list_members"),u;t===Globals.RuntimeGroupMemberType.Founder||t===Globals.RuntimeGroupMemberType.ActingFounder?(i="founder",r=$("#list_founders")):t==Globals.RuntimeGroupMemberType.Admin&&(i="admin",r=$("#list_admins"));u="";u=this.createMemberHtmlString(i,n);r.append(u)},i.prototype.createMemberHtmlString=function(t,i){var r='<li class="'+t+'" data-membershipId="'+i.bungieNetUserInfo.membershipId+'">\n\t\t\t\t\t\t'+n.GroupPageUtilities.createHtmlFromUserCard(i.bungieNetUserInfo);return viewModels.loggedInUserModel().user.membershipId()==i.bungieNetUserInfo.membershipId?r+='<p class="actions"><span>'+Localizer.Groups.thatsyou+"<\/span><\/p>":this.viewType===n.GroupListenerPages.membersAdmin&&(r+='<p class="actions">\n\t\t\t\t\t\t<a class="btn_edit" data-membershipId="'+i.bungieNetUserInfo.membershipId+'" data-groupId="'+i.groupId+'" data-memberType="'+i.memberType+'">'+(i.memberType==Globals.RuntimeGroupMemberType.Admin?Localizer.Actions.demote:Localizer.Actions.promote)+'<\/a>\n\n\t\t\t\t\t\t<a class="btn_kick" data-membershipId="'+i.bungieNetUserInfo.membershipId+'" data-groupId="'+i.groupId+'">'+Localizer.Actions.kick+'<\/a>\n\n\n\t\t\t\t\t\t<a class="btn_ban" data-membershipId="'+i.bungieNetUserInfo.membershipId+'" data-groupId="'+i.groupId+'">'+Localizer.Actions.ban+"<\/a>\n\t\t\t\t\t<\/p>"),r+"<\/li>"},i}(n.BaseGroupPage),i;n.GroupsMembers=t;i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.initialize=function(){t.prototype.initialize.call(this);this.viewType=n.GroupListenerPages.members},i}(t);n.GroupMembersVisitorView=i})(t=n.Groups||(n.Groups={}))}(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(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.initialize=function(){i.prototype.initialize.call(this);this.viewType=t.GroupListenerPages.membersAdmin},r.prototype.addListeners=function(){var r=this;i.prototype.addListeners.call(this);this.eventBinder.for("#AdminPages",".btn_kick").on("click",function(i){var s=n.GroupThrottles.GroupListenerThrottles.kick;if(!SignIn.notSignedIn()){i.preventDefault();var u=$(i.currentTarget),f=u.attr("data-membershipId"),e=u.closest(".member").find(".displayName a").text(),o=u.attr("data-groupId");t.GroupAdminActions.kickMember(o,Globals.BungieMembershipType.BungieNext,f,e,r.throttle)}});this.eventBinder.for("#AdminPages",".btn_edit").on("click",function(i){var h=n.GroupThrottles.GroupListenerThrottles.edit;if(!SignIn.notSignedIn()){i.preventDefault();var u=$(i.currentTarget),f=u.attr("data-membershipId"),e=u.closest(".member").find(".displayName a").text(),o=u.attr("data-groupId"),s=parseInt(u.attr("data-membertype"),10).toString();t.GroupAdminActions.editMemberLevel(o,Globals.BungieMembershipType.BungieNext,f,s,e,r.throttle)}})},r}(t.GroupsMembers);t.GroupMembersAdminView=i})(t=n.Groups||(n.Groups={}))}(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(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.initialize=function(){this.throttle=new n.GroupThrottles.Throttle},r.prototype.addListeners=function(){var i=this;this.eventBinder.for("#AdminPages",".list_pendingMembers .btn_deny").on("click",function(r){var u=$(r.currentTarget),s=n.GroupThrottles.GroupListenerThrottles.deny,f=u.attr("data-groupId"),e,o;$("#list_pendingMembers").find(".pendingMember.selected").length?i.denyMany(f):(e=u.attr("data-membershipId"),o=u.closest(".pendingMember").find(".displayName a").text(),t.GroupAdminActions.denyPendingMember(f,e,o,i.throttle))});this.eventBinder.for("#AdminPages .container_pager",".btn_deny").on("click",function(r){var o;if(r.preventDefault(),!SignIn.notSignedIn()){var s=n.GroupThrottles.GroupListenerThrottles.deny,u=$(r.currentTarget),f=u.closest(".container_pager").prev("ul"),e=f.attr("data-groupId");f.attr("data-selectAll")=="true"?t.GroupAdminActions.denyAllPending(e,i.throttle):parseInt(u.closest(".container_pager").find(".numOfSelected").text(),10)>0&&(o=[],t.GroupAdminActions.denyListPending(e,o,i.throttle))}});this.eventBinder.for($("#AdminPages"),"#list_pendingMembers .btn_approve").on("click",function(t){var o=n.GroupThrottles.GroupListenerThrottles.approve,r,u,f,e;SignIn.notSignedIn()||(r=$(t.currentTarget),u=r.attr("data-groupId"),$("#list_pendingMembers").find(".pendingMember.selected").length?i.approveMany(u):(f=r.attr("data-membershipId"),e=r.closest(".pendingMember").find(".displayName a").text(),n.Groups.GroupAdminActions.approvePendingMember(u,Globals.BungieMembershipType.BungieNext,f,e,i.throttle)))});this.eventBinder.for("#AdminPages .container_pager",".btn_approve").on("click",function(r){var e;if(r.preventDefault(),e=n.GroupThrottles.GroupListenerThrottles.approve,!SignIn.notSignedIn()){var o=$(r.currentTarget),u=o.closest(".container_pager").prev("ul"),f=u.attr("data-groupId");u.attr("data-selectAll")=="true"?t.GroupAdminActions.approveAllPendingMembers(f,Globals.BungieMembershipType.BungieNext,i.throttle):$("#list_pendingMembers").find(".pendingMember.selected").length&&i.approveMany(f)}});this.eventBinder.for($(document),".container_pager [data-page]").on("click",function(n){var t;if(n.preventDefault(),t=$(n.currentTarget),!t.hasClass("disabled")){var r=t.closest(".container_pager").prev(),f=t.attr("data-page"),u="0";r.is($("#list_pendingMembers"))&&(u=r.attr("data-groupId"),i.loadPendingMembersPage(u,parseInt(f,10)))}})},r.prototype.loadPendingMembersPage=function(n,i){var u=this,f=!1,r=$(".list_pendingMembers");r.attr("data-selectAll")=="true"&&(f=!0);bungieNetPlatform.groupV2Service.GetPendingMemberships(n,i,function(n){var i,f;if(n.results.length){for(r.html(""),i=0;i<n.results.length;i++)f=n.results[i],u.renderPendingMemberInList(f,r);t.GroupPageUtilities.setPager(r,n)}},function(){})},r.prototype.renderPendingMemberInList=function(n,t){t.append(this.createPendingMemberHtmlString(n,t))},r.prototype.createPendingMemberHtmlString=function(n,i){return'<li data-membershipId="'+n.bungieNetUserInfo.membershipId+'" data-displayName="'+n.bungieNetUserInfo.displayName+'" data-groupId="'+n.groupId+'" class="pendingMember '+(i.attr("data-selectAll")=="true"?" selected":"")+'">\n\t\t\t\t\t\t\t\t<a  class="checkbox"><\/a>\n\n\n\t\t\t\t\t\t\t'+t.GroupPageUtilities.createHtmlFromUserCard(n.bungieNetUserInfo)+'\n\n\n\t\t\t\t\t\t\t<p class="message">'+n.requestMessage+'<\/p>\n\t\t\t\t\t\t\t<p class="actions">\n\t\t\t\t\t\t\t\t<a  class="btn_approve" data-membershipId="'+n.bungieNetUserInfo.membershipId+'" data-groupId="'+n.groupId+'">Approve<\/a>\n\t\t\t\t\t\t\t\t<a  class="btn_deny" data-membershipId="'+n.bungieNetUserInfo.membershipId+'" data-groupId="'+n.groupId+'">Deny<\/a>\n\t\t\t\t\t\t\t\t<a  class="btn_ban" data-membershipId="'+n.bungieNetUserInfo.membershipId+'" data-groupId="'+n.groupId+'">Ban<\/a>\n\t\t\t\t\t\t\t<\/p><\/li>'},r.prototype.selectPending=function(){var n=[];return $("#list_pendingMembers").find(".pendingMember.selected").each(function(t,i){var r=$(i),u=r.attr("data-displayname"),f=r.attr("data-membershipid"),e={displayName:u,membershipId:f,membershipType:Globals.BungieMembershipType.BungieNext,bungieGlobalDisplayName:null};n.push(e)}),n},r.prototype.approveMany=function(n){t.GroupAdminActions.approveListPendingMembers(n,this.selectPending(),this.throttle)},r.prototype.denyMany=function(n){t.GroupAdminActions.denyListPending(n,this.selectPending(),this.throttle)},r}(t.BaseGroupPage);t.GroupPending=i})(t=n.Groups||(n.Groups={}))}(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(){this.posts=new Posts(n.Site.getPageData("postId"),{forumType:Globals.ForumTypeEnum.Group,isLargeThread:n.Site.getPageData("isLargeThread"),sort:n.Site.getPageData("sort"),page:n.Site.getPageData("page"),path:n.Site.getPageData("path"),hasMore:n.Site.getPageData("hasMore"),showBanned:n.Site.getPageData("showBanned"),groupId:n.Site.getPageData("groupId")})},i.prototype.addListeners=function(){},i}(t.BaseGroupPage);t.PostsInit=i})(t=n.Groups||(n.Groups={}))}(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(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.initialize=function(){this.ajaxUrl="/"+Localizer.CurrentCultureName+"/Groups/GroupsList";n.Site.PageController.Instance.ajaxSectionRegex=/doNoTMatch/i;var i=new t.AvatarsAndThemes},r.prototype.addListeners=function(){var t=this;this.addSearchListeners();n.Groups.CreateForm.addFormListeners();this.eventBinder.for(".btn_goCreateClan").on("click",function(n){if(!SignIn.notSignedIn()){n.preventDefault();$("#mainContent").addClass("createState");t.eventBinder.for(".btn_cancelClanCreation").on("click",function(n){n.preventDefault();$("#mainContent").removeClass("createState");t.eventBinder.for(".btn_cancelClanCreation").off("click")})}});this.eventBinder.for("#GroupSearchPanel",".btn_loadMoreGroups").on("click",function(n){n.preventDefault();var i=$(n.currentTarget).attr("data-page"),r=t.prepareAjaxSearch()+"&page="+i;t.doAjaxGroupSearch(r,!1)})},r.prototype.destroy=function(){},r.prototype.addSearchListeners=function(){var n=this;this.eventBinder.for("#textbox_searchForClans").on("keyup",function(t){(t.which===13||$(t.currentTarget).val()==="")&&n.doAjaxGroupSearch(n.prepareAjaxSearch(),!0)});this.eventBinder.for("#textbox_searchForClans").on("blur",function(){n.doAjaxGroupSearch(n.prepareAjaxSearch(),!0)});this.eventBinder.for(".container_searchGroups select").on("change",function(){n.doAjaxGroupSearch(n.prepareAjaxSearch(),!0)})},r.prototype.doAjaxGroupSearch=function(n,t,i){var u=this,f=this,r=$(".container_searchGroups").attr("data-type");$("#GroupSearchPanel").destinyLoader({startOnInit:!0});$.get(n,function(f){var l=n.replace("GroupsList",r);i||history.pushState({action:r},null,l);var o=$("<div>").html(f),s=o.find("#groupsPager"),e=o.find("#groups"),a=o.find(".filterBarContainer"),h=$("#groupsPager"),c=$("#groups"),v=$(".filterBarContainer");v.replaceWith(a);u.addSearchListeners();c.length===0&&e.length?($("#list_groups").replaceWith(f),$("#list_groups").siblings(".filterBarContainer").remove()):(t?e.length===0?($("#list_groups").replaceWith(f),$("#list_groups").siblings(".filterBarContainer").remove()):c.replaceWith(e):c.append(e.children("li")),s.length?h.length?h.replaceWith(s):$("#list_groups").after(s):h.remove());$("#GroupSearchPanel").destinyLoader("stop")}).fail(function(){})},r.prototype.prepareAjaxSearch=function(){var n=this.ajaxUrl,f=typeof $("#textbox_searchForClans").val()!="undefined"?$("#textbox_searchForClans").val():"",i=$("#select_searchClanCreateDate").val(),r=$("#select_searchClanLang").val(),u=$("#select_searchPlatform").val(),t=$("#select_searchGroupTags").val(),e=$(".container_searchGroups").attr("data-type");return n=n+"?search="+f.replace(/#/gi,"%23"),typeof t!="undefined"&&t!==""&&t!==null&&(n=n+"&tag="+t.replace(/#/gi,"%23")),$.isNumeric(i)&&(n=t!==undefined&&t!==""?n+"&date=0":n+"&date="+i),r!=="0"&&(n=n+"&locale="+r),$.isNumeric(u)&&(n=n+"&platform="+u),n+"&type="+e},r}(n.Site.PageInitializer);t.GroupsSearch=i})(t=n.Groups||(n.Groups={}))}(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(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.initialize=function(){this.throttle=new n.GroupThrottles.Throttle},r.prototype.addListeners=function(){var n=this;this.eventBinder.for(".btn_cancelClanSettings").on("click",function(n){n.preventDefault();t.GroupPageUtilities.resetGroupEditFormCheckboxes($("#checkbox_clanChat").add("#checkbox_publicVisible").add("#checkbox_topicAdminOnly").add("#checkbox_postDefaultPublic").add("#checkbox_invitationMessaging"));var i=$("#select_clanChatSecurity");i.find("[value="+i.attr("data-originalValue")+"]").prop("selected","selected").siblings().removeProp("selected")});this.eventBinder.for(".btn_saveClanSettings").on("click",function(i){var r,u,e;i.stopImmediatePropagation();i.preventDefault();var o=$(i.currentTarget).attr("data-clanId"),s=$("#checkbox_clanChat"),h=$("#select_clanChatSecurity"),c=$("#select_clanMembershipOption"),l=$("#select_clanHomepage"),a=$("#select_clanLanguage"),v=$("#checkbox_publicVisible"),y=$("#checkbox_topicAdminOnly"),p=$("#checkbox_postDefaultPublic"),w=$("#select_clanMembership"),b=$("#checkbox_invitationMessaging"),et=$("#textbox_clanClanName"),k=s.is(":checked"),d=h.val(),g=c.val(),nt=l.val(),tt=a.val(),it=v.is(":checked"),rt=y.is(":checked"),ut=p.is(":checked")?0:2,ot=w.val(),ft=b.is(":checked"),f=[];if(f.length){for(r=0;r<f.length;r++)u=f[r].element,e=u.attr("data-errorMessage-"+f[r].type),$(".error").filter(function(){return $(this).data("for").get(0)===u.get(0)}).length<1&&($errorMessage=$('<span class="error">'+e+"<\/span>"),u.focus().before($errorMessage),$errorMessage.data("for",u));return}t.GroupAdminActions.editGroup({name:null,about:null,avatarImageIndex:null,callsign:null,enableInvitationMessagingForAdmins:ft,motto:null,tags:null,theme:null,chatSecurity:d,allowChat:k,membershipOption:g,homepage:nt,locale:tt,isPublic:it,isPublicTopicAdminOnly:rt,defaultPublicity:ut},o,n.throttle)})},r}(n.Site.PageInitializer);t.Settings=i})(t=n.Groups||(n.Groups={}))}(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 f=function(){function t(){}return t.createGroup=function(t,i,r,u,f,e,o,s,h,c,l,a){bungieNetPlatform.groupV2Service.CreateGroup({name:t,motto:i,about:r,theme:u,tags:f.join(","),avatarImageIndex:e,isPublic:o,membershipOption:s,isPublicTopicAdminOnly:h,isDefaultPostPublic:c,allowChat:!0,locale:a,groupType:Globals.GroupType.General},function(n){window.location.href="/"+Localizer.CurrentCultureName+"/Groups?groupId="+n.groupId},function(t){var r,i;switch(t.errorCode){default:n.Utilities.Modals.Alert(t)}typeof i!="undefined"&&(i.parent().parent().find(".error.s").remove(),r=$('<span class="error s">'+t.errorMessage+" ("+t.errorCode+")<\/span>"),i.focus().parent().prepend(r),r.data("for",i))})},t.addGroupTag=function(t){var i=t.closest(".container_addTag").find("input").val();i.indexOf("#")===-1&&(i="#"+i);Utility.ValidateTags(i)?Utility.GetValidTags(i).length&&(t.closest(".container_addTag").find(".container_tags").append('<li class="tag">'+Utility.GetValidTags(i)+"<\/li>"),t.closest(".container_addTag").find("input").val("")):n.Utilities.Modals.Alert(Localizer.Messages.invalidtag)},t.reportGroup=function(t,i,r){var u=this,f={ignoredItemId:t,ignoredItemType:Globals.IgnoredItemType.GroupProfile,comment:"",reason:i,itemContextId:t,itemContextType:Globals.IgnoredItemType.GroupProfile,requestedPunishment:r,requestedBlastBan:!1};bungieNetPlatform.ignoreService.FlagItem(f,function(){n.Utilities.Modals.Alert(u.groupsLoc.thankyouforyourprofilereport)},function(t){n.Utilities.Modals.Alert(t)})},t.groupsLoc=Localizer.Groups,t}(),i,r,u;t.Actions=f;i=function(){function n(){}return n.groupsLoc=Localizer.Groups,n.dialogText=Localizer.Groups.areyousure,n.yesText=Localizer.Groups.yes,n.noText=Localizer.Groups.no,n}();t.GroupUserActions=i;r=function(t){function i(){return t.call(this)||this}return __extends(i,t),i.leaveGroup=function(t,i,r,u,f){var e=this;n.Utilities.Modals.Confirm(u,n.ConfirmationReason.Warning,function(){bungieNetPlatform.groupV2Service.RescindGroupMembership(t,Globals.BungieMembershipType[i],function(t){var i,o,u;f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.leave);Globals.RuntimeGroupMemberType[r]===Globals.RuntimeGroupMemberType[Globals.RuntimeGroupMemberType.Founder]?(i=new n.Modal("groupdeleted",e.groupsLoc.grouphasbeendeleted),i.includeCloseButton=!0,i.open(),i.afterCloseCallback=function(){var n=window.location.protocol+"//"+window.location.hostname+"/"+Localizer.CurrentCultureName+"/Groups/Search";window.location.assign(n)}):(o='<a href="/'+Localizer.CurrentCultureName+"/Groups?groupId="+t.group.groupId+'" data-groupId="'+t.group.groupId+'">'+t.group.name+"<\/a>",u=new n.Modal("success",e.groupsLoc.youhavesuccessfullycancelled),u.afterCloseCallback=function(){window.location.reload()},u.open())},function(t){f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.leave);n.Utilities.Modals.Alert(t)})},function(){f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.leave)})},i.joinGroup=function(t,i,r,u){var f=Localizer.fnStringReplace(this.groupsLoc.jointhexgroup,{groupname:r});n.Utilities.Modals.Confirm(f,n.ConfirmationReason.Warning,function(){var i={message:Localizer.Groups.requesttojoinprefill};bungieNetPlatform.groupV2Service.RequestGroupMembership(i,t,Globals.BungieMembershipType.BungieNext,function(){u.removeThrottled(n.GroupThrottles.GroupListenerThrottles.join);var i={"0":"/"+Localizer.CurrentCultureName+"/Groups?groupId="+t,"1":t,"2":r},f=Localizer.fnStringReplace(Localizer.Groups.requestedtojoinwithname,i);window.location.href="/"+Localizer.CurrentCultureName+"/Groups?groupId="+t},function(t){u.removeThrottled(n.GroupThrottles.GroupListenerThrottles.join);n.Utilities.Modals.Alert(t)})},function(){u.removeThrottled(n.GroupThrottles.GroupListenerThrottles.join)})},i}(i);t.GroupMemberActions=r;u=function(t){function i(){return t.call(this)||this}return __extends(i,t),i.approvePendingMember=function(n,t,i,r,u){this.approveListPendingMembers(n,[{membershipType:Globals.BungieMembershipType.BungieNext,membershipId:i,displayName:r,bungieGlobalDisplayName:null}],u)},i.approveListPendingMembers=function(t,i,r){var u=this.groupsLoc.approveselectedpendingprompt;i.length===1&&i[0].displayName!==""&&(u=Localizer.Format(this.groupsLoc.clanapprovalspecificprompt,{displayName:i[0].displayName}));n.Utilities.Modals.Confirm(this.groupsLoc.approveselectedpendingprompt,n.ConfirmationReason.Warning,function(){var u={memberships:i,message:""};bungieNetPlatform.groupV2Service.ApprovePendingForList(u,t,function(){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.approve);window.location.reload()},function(t){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.approve);n.Utilities.Modals.Alert(t)})},function(){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.approve)})},i.approveAllPendingMembers=function(t,i,r){n.Utilities.Modals.Confirm(Localizer.Groups.approveallpendingprompt,n.ConfirmationReason.Warning,function(){bungieNetPlatform.groupV2Service.ApproveAllPending({message:""},t,function(){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.approve);n.Site.PageController.Instance.reloadPage()},function(t){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.approve);n.Utilities.Modals.Alert(t)})},function(){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.approve)})},i.denyPendingMember=function(n,t,i,r){this.denyListPending(n,[{membershipId:t,displayName:i,membershipType:Globals.BungieMembershipType.BungieNext,bungieGlobalDisplayName:null}],r)},i.denyListPending=function(t,i,r){var u=this.groupsLoc.areyousureyouwanttodeny;i.length===1&&i[0].displayName!==""&&Localizer.Format(this.groupsLoc.memberdenialspecificprompt,{displayName:i[0].displayName});n.Utilities.Modals.Confirm(u,n.ConfirmationReason.Warning,function(){bungieNetPlatform.groupV2Service.DenyPendingForList({memberships:i,message:"This is the message for group application denial"},t,function(){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.deny);window.location.reload()},function(t){n.Utilities.Modals.Alert(t);r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.deny)})},function(){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.deny)})},i.denyAllPending=function(t,i){n.Utilities.Modals.Confirm(this.groupsLoc.denyallpendingprompt,n.ConfirmationReason.Warning,function(){bungieNetPlatform.groupV2Service.DenyAllPending({message:"All were denined"},t,function(){i.removeThrottled(n.GroupThrottles.GroupListenerThrottles.deny);window.location.reload()},function(t){n.Utilities.Modals.Alert(t);i.removeThrottled(n.GroupThrottles.GroupListenerThrottles.deny)})})},i.banMember=function(t,i,r,u,f){var e={comment:"",length:Globals.IgnoreLength.Forever};n.Utilities.Modals.Confirm(Localizer.Format(this.groupsLoc.areyousureyouwanttoban,{displayName:u}),n.ConfirmationReason.Warning,function(){bungieNetPlatform.groupV2Service.BanMember(e,t,i,r,function(){f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.ban);window.location.reload()},function(t){n.Utilities.Modals.Alert(t);f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.ban)})},function(){f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.ban)})},i.editMemberLevel=function(t,i,r,u,f,e){var o=Globals.RuntimeGroupMemberType[u]===Globals.RuntimeGroupMemberType[Globals.RuntimeGroupMemberType.Admin],s=Localizer.Format(Localizer.Groups.promotedisplayname,{displayName:f});o||(s=Localizer.Format(Localizer.Groups.demotedisplayname,{displayName:f}));n.Utilities.Modals.Confirm(Localizer.Format(s,{displayName:f}),n.ConfirmationReason.Warning,function(){bungieNetPlatform.groupV2Service.EditGroupMembership(t,i,r,Globals.RuntimeGroupMemberType[u],function(){var i=Localizer.Format(Localizer.Groups.successfullypromoteddisplayname,{displayName:f}),t;o||(i=Localizer.Format(Localizer.Groups.successfullydemoteddisplayname,{displayName:f}));t=new n.Modal("success",i);t.open();t.afterCloseCallback=function(){e.removeThrottled(n.GroupThrottles.GroupListenerThrottles.edit);window.location.reload()}},function(t){n.Utilities.Modals.Alert(t);e.removeThrottled(n.GroupThrottles.GroupListenerThrottles.edit)})})},i.kickMember=function(t,i,r,u,f){var e=this;n.Utilities.Modals.Confirm(Localizer.Format(this.groupsLoc.kickmemberprompt,{displayName:u}),n.ConfirmationReason.Warning,function(){bungieNetPlatform.groupV2Service.KickMember(t,i,r,function(){var t=new n.Modal("success",Localizer.Format(e.groupsLoc.successfullykicked0your,{0:u}));t.open();t.afterCloseCallback=function(){f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.kick);window.location.reload()}},function(t){n.Utilities.Modals.Alert(t);f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.kick)})})},i.unbanMember=function(t,i,r,u,f){var e=this;n.Utilities.Modals.Confirm(Localizer.Format(Localizer.Groups.areyousureyouwanttounban,{displayName:u}),n.ConfirmationReason.Warning,function(){bungieNetPlatform.groupV2Service.UnbanMember(t,i,r,function(){var t=new n.Modal("success",Localizer.Format(e.groupsLoc.unbansuccessmessage,{0:u}));t.open();t.afterCloseCallback=function(){f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.unban);window.location.reload()}},function(t){f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.unban);n.Utilities.Modals.Alert(t)})},function(){f.removeThrottled(n.GroupThrottles.GroupListenerThrottles.unban)})},i.editGroup=function(t,i,r){var u=this;bungieNetPlatform.groupV2Service.EditGroup(t,i,function(){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.edit);var t=new n.Modal("success",u.groupsLoc.editsuccessshort);t.open();t.afterCloseCallback=function(){window.location.reload()}},function(t){r.removeThrottled(n.GroupThrottles.GroupListenerThrottles.edit);n.Utilities.Modals.Alert(t)})},i}(i);t.GroupAdminActions=u})(t=n.Groups||(n.Groups={}))}(Bnet||(Bnet={})),function(n){var t;(function(n){var t=function(){function t(){}return t.resetGroupEditFormCheckboxes=function(n){n.length&&n.each(function(n,t){var i=$(t);i.attr("data-originalValue")==="true"?i.prop("checked","checked"):i.removeProp("checked")})},t.updateTheSelectedCount=function(t,i,r){var u=t.closest(".container_pager"),f=r?0:parseInt(u.find("#selectedCount").text(),10);u.closest("#clanPendingMembers").length&&(r,this.updateTheSelectedMemberCount(n.GroupListenerPages.pending,i,f))},t.updateTheSelectedMemberCount=function(t,i,r){if(t===n.GroupListenerPages.pending){var u={"1":typeof r!="undefined"?r:i.length},f=Localizer.Groups.selectedmembersmessage;(Localizer.CurrentCultureName=="fr"&&u["1"]==0||u["1"]==1)&&(f=Localizer.Groups.selectedmembermessage);$("#clanPendingMembers .selectMessage").html(Localizer.fnStringReplace(f,u))}},t.setPager=function(n,t){var i=n.next(".container_pager");i.find(".currentPage span").text(t.query.currentPage);t.query.currentPage>1?(i.find(".btn_firstPage, .btn_prevPage").removeClass("disabled"),i.find(".btn_prevPage").attr("data-page",t.query.currentPage-1)):(i.find(".btn_firstPage, .btn_prevPage").addClass("disabled"),i.find(".btn_prevPage").attr("data-page",0));t.hasMore?(i.find(".btn_nextPage, .btn_lastPage").removeClass("disabled"),i.find(".btn_nextPage").attr("data-page",t.query.currentPage+1)):i.find(".btn_nextPage, .btn_lastPage").addClass("disabled");i.find(".page.on[data-page]").length&&i.find(".page.on[data-page]").text(t.query.currentPage)},t.createHtmlFromUserCard=function(n){return'<a href="'+(PageUrls.profilePage+"/254/"+n.membershipId)+'" class="avatar" data-membershipId="'+n.membershipId+'">\n\t\t\t\t\t\t\t<img src="'+n.iconPath+'" alt="'+n.displayName+'">\n\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t<div class="content">\n\t\t\t\t\t\t\t<p class="displayName">\n\t\t\t\t\t\t\t\t<a href="'+(PageUrls.profilePage+"/254/"+n.membershipId)+'" data-membershipId="'+n.membershipId+'">'+n.displayName+'<\/a>\n\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t<p class="platformId"><\/p>\n\t\t\t\t\t\t<\/div>'},t}();n.GroupPageUtilities=t})(t=n.Groups||(n.Groups={}))}(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(n){function i(t,i){var r=n.call(this,"ReportGroupProfileModal",t)||this;return r.groupId=i,r.includeCloseButton=!1,r}return __extends(i,n),i.Show=function(n){var r=$("#reportGroupProfileModal-template").html(),t;r!=null&&(t=new i(r,n),t.extraModalClass.push("reportModal"),t.open(),t.addListenersForReportModal())},i.prototype.addListenersForReportModal=function(){var n=this;this.$submitButton=this.$modalContainer.find(".button.btn_msgreport");this.$cancelButton=this.$modalContainer.find(".button.btn_cancel");this.$cancelButton.on("click",function(){n.close()});this.$submitButton.on("click",function(t){n.handleSubmission(t);n.close()})},i.prototype.handleSubmission=function(){var n=this.$modalContainer.find(".js-msgreport_reason select").val(),i=this.$modalContainer.find(".js-mod_report_select select").length?this.$modalContainer.find(".js-mod_report_select select").val():Globals.ModeratorRequestedPunishment.Unknown;t.Actions.reportGroup(this.groupId,n,i)},i}(n.Modal);t.ReportGroupProfileModal=i})(t=n.Groups||(n.Groups={}))}(Bnet||(Bnet={}))