1"use strict";(self["webpackChunkclient"]=self["webpackChunkclient"]||[]).push([[4115,7233],{4115:function(e,t,i){i.r(t),i.d(t,{default:function(){return ie}});var s=i(20641),o=i(90033),r=i(53751);const n={key:0,class:"onboard-container"},a={class:"onboard-intro ml-1"},l={class:"onboard-title-row"},u={class:"onboard-title"},p={class:"onboard-logo"},d={key:0,class:"onboard-subtitle mb-5-half"},c={key:1,class:"onboard-subtitle mb-5-half"},h={key:0,class:"onboard-steps"},g={key:1,class:""},f={class:"card"},m={class:"has-text-weight-semibold has-text-dark mb-5"},b={class:"mb-3"},w={class:"onboard-note mt-5"},v={key:2,class:""},y={class:"card p-5 pb-5-half"},k={class:"onboard-note mt-5"},L={key:3,class:""},C={class:"onboard-note mt-5"},$={key:4,class:"card"},F={key:0},S={class:"has-text-weight-semibold has-text-dark"},G={class:"mt-5"},_={class:"tag is-rounded is-warning is-medium"},A={key:1,class:"timezone-buttons"},E=["disabled"],M=["disabled"],U={class:"mt-4"},T={class:"timezone-buttons mt-5"},x=["disabled"],X=["disabled"],N={key:5,class:"contracts-list"},Q={key:6},I={class:"card"},R={class:"has-text-weight-semibold has-text-dark mb-4"},z={class:"onboard-note mt-5"},O={key:7,class:"onboard-sticky-footer"},P=["disabled"];function J(e,t,i,J,B,W){const D=(0,s.g2)("b-loading"),V=(0,s.g2)("OrgoLogo"),j=(0,s.g2)("font-awesome-icon"),q=(0,s.g2)("Form"),K=(0,s.g2)("FormPrivacy"),H=(0,s.g2)("FormNotification"),Y=(0,s.g2)("TimezoneSelect"),Z=(0,s.g2)("Contract"),ee=(0,s.g2)("GroupBrowse");return e.user&&e.user.id?((0,s.uX)(),(0,s.CE)("div",n,[(0,s.bF)(D,{modelValue:B.isLoading,"onUpdate:modelValue":t[0]||(t[0]=e=>B.isLoading=e),"is-full-page":!1},null,8,["modelValue"]),(0,s.Lk)("div",a,[(0,s.Lk)("div",l,[(0,s.Lk)("h1",u,(0,o.v_)(e.$t("Welcome, %%!").replace("%%",e.user.firstName))+" ð",1),(0,s.Lk)("div",p,[(0,s.bF)(V)])]),"contracts"!==B.openedStep?((0,s.uX)(),(0,s.CE)("p",d,(0,o.v_)(e.$t("Just a few things to set up your account better.")),1)):(0,s.Q3)("",!0),"contracts"===B.openedStep?((0,s.uX)(),(0,s.CE)("p",c,(0,o.v_)(e.$t("You need to sign the following document in order to access the community platform"))+". ",1)):(0,s.Q3)("",!0)]),W.isMoreThanOneStepAvailable?((0,s.uX)(),(0,s.CE)("div",h,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(W.availableStepsList,(e,t)=>((0,s.uX)(),(0,s.CE)(s.FK,{key:e.key},[(0,s.Lk)("span",{class:(0,o.C4)(["onboard-step",{"is-active":B.openedStep===e.key,"is-completed":B.completedSteps[e.key],"is-pending":W.isStepDisabled(e.key)}])},(0,o.v_)(e.label),3),t<W.availableStepsList.length-1?((0,s.uX)(),(0,s.Wv)(j,{key:0,icon:"fa-light fa-chevron-right",class:"onboard-step-separator"})):(0,s.Q3)("",!0)],64))),128))])):(0,s.Q3)("",!0),"profile"===B.openedStep&&B.stepsAvailable.profile?((0,s.uX)(),(0,s.CE)("div",g,[(0,s.Lk)("div",f,[(0,s.Lk)("p",m,(0,o.v_)(e.$t("To continue, please complete your profile.")),1),(0,s.Lk)("div",b,[(0,s.bF)(q,{ref:"form",item:B.profile,save:W.saveProfile,"on-boarding":!0,onFocusMandatoryField:W.focusMandatoryField,onFocusMandatoryCustomField:W.focusMandatoryCustomField},null,8,["item","save","onFocusMandatoryField","onFocusMandatoryCustomField"])])]),(0,s.Lk)("p",w,(0,o.v_)(e.$t("You can change these settings also later from your account settings"))+".",1)])):(0,s.Q3)("",!0),"privacy"===B.openedStep&&B.stepsAvailable.privacy?((0,s.uX)(),(0,s.CE)("div",v,[(0,s.Lk)("div",y,[(0,s.bF)(K,{item:e.user,"is-onboarding":!0,save:W.autoSavePrivacy},null,8,["item","save"])]),(0,s.Lk)("p",k,(0,o.v_)(e.$t("You can change these settings also later from your account settings"))+".",1)])):(0,s.Q3)("",!0),"notification"===B.openedStep&&B.stepsAvailable.notification?((0,s.uX)(),(0,s.CE)("div",L,[(0,s.bF)(H,{item:e.user,"is-onboarding":!0},null,8,["item"]),(0,s.Lk)("p",C,(0,o.v_)(e.$t("You can change these settings also later from your account settings"))+".",1)])):(0,s.Q3)("",!0),"timezone"===B.openedStep&&B.stepsAvailable.timezone?((0,s.uX)(),(0,s.CE)("div",$,[B.timezoneEditing?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",F,[(0,s.Lk)("p",S,(0,o.v_)(e.$t("We have set the timezone for your account")),1),(0,s.Lk)("p",G,[(0,s.Lk)("span",_,(0,o.v_)(e.user.timezone),1)]),t[8]||(t[8]=(0,s.Lk)("hr",null,null,-1))])),B.timezoneEditing?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",A,[(0,s.Lk)("button",{class:(0,o.C4)(["button is-primary is-rounded is-fullwidth",{"is-loading":e.$store.state.isLoadingButton}]),type:"submit",disabled:e.$store.state.isLoadingButton,onClick:t[1]||(t[1]=(...e)=>W.saveTimezone&&W.saveTimezone(...e))},(0,o.v_)(e.$t("Yes, it's good")),11,E),(0,s.Lk)("button",{class:(0,o.C4)(["button is-rounded is-fullwidth",{"is-loading":e.$store.state.isLoadingButton}]),type:"submit",disabled:e.$store.state.isLoadingButton,onClick:t[2]||(t[2]=e=>B.timezoneEditing=!0)},(0,o.v_)(e.$t("modify")),11,M)])),(0,s.bo)((0,s.Lk)("div",U,[(0,s.bF)(Y,{modelValue:B.newTimezone,"onUpdate:modelValue":[t[3]||(t[3]=e=>B.newTimezone=e),t[4]||(t[4]=t=>e.user.timezone=B.newTimezone)],"init-value":e.user.timezone},null,8,["modelValue","init-value"]),(0,s.Lk)("div",T,[(0,s.Lk)("button",{class:(0,o.C4)(["button is-primary is-rounded is-fullwidth",{"is-loading":e.$store.state.isLoadingButton}]),type:"submit",disabled:e.$store.state.isLoadingButton,onClick:t[5]||(t[5]=(...e)=>W.saveTimezone&&W.saveTimezone(...e))},(0,o.v_)(e.$t("save")),11,x),(0,s.Lk)("button",{class:(0,o.C4)(["button is-rounded is-fullwidth",{"is-loading":e.$store.state.isLoadingButton}]),type:"submit",disabled:e.$store.state.isLoadingButton,onClick:t[6]||(t[6]=e=>B.timezoneEditing=!1)},(0,o.v_)(e.$t("cancel")),11,X)])],512),[[r.aG,B.timezoneEditing]])])):(0,s.Q3)("",!0),"contracts"===B.openedStep&&B.stepsAvailable.contracts?((0,s.uX)(),(0,s.CE)("div",N,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(B.requiredContracts,t=>((0,s.uX)(),(0,s.Wv)(Z,{key:t.id,class:"card mb-4",item:e.user,"user-contract":t},null,8,["item","user-contract"]))),128))])):(0,s.Q3)("",!0),"groups"===B.openedStep&&B.stepsAvailable.groups?((0,s.uX)(),(0,s.CE)("div",Q,[(0,s.Lk)("div",I,[(0,s.Lk)("p",R,(0,o.v_)(e.$t("Choose which groups you want to re
1ceive notification from")),1),(0,s.bF)(ee,{"hide-filter":!0,class:"mt-4"})]),(0,s.Lk)("p",z,(0,o.v_)(e.$t("You can change these settings also later from your account settings"))+".",1)])):(0,s.Q3)("",!0),B.openedStep&&"contracts"!==B.openedStep&&"timezone"!==B.openedStep?((0,s.uX)(),(0,s.CE)("div",O,[(0,s.Lk)("button",{class:(0,o.C4)(["button is-primary is-rounded is-fullwidth",{"is-loading":e.$store.state.isLoadingButton||B.isLoading}]),type:"button",disabled:e.$store.state.isLoadingButton||B.isLoading,onClick:t[7]||(t[7]=(...e)=>W.saveCurrentStep&&W.saveCurrentStep(...e))},(0,o.v_)(e.$t("Save preferences")),11,P)])):(0,s.Q3)("",!0)])):(0,s.Q3)("",!0)}i(44114),i(18111),i(22489),i(20116),i(61701);var B=i(71537),W=i(40834),D=i(76446),V=i(90957),j=i(1521),q=i(17233),K=i(86851),H=i(44917);i(84743);const Y={first_name:"firstNameInput",middle_name:"middleNameInput",last_name:"lastNameInput",birthday:"dateBirthField",phoneNumber:"phoneNumberInput",gender:"genderField",town_current:"townCurrentInput",town_from:"townFromInput",address:"addressInput",postal_code:"postalCodeInput",website:"socialProfileInput",facebook:"facebookInput",twitter:"twitterInput",linkedin:"linkedinInput",instagram:"instagramInput",telegram:"telegramInput",tiktok:"tiktokInput",signal:"signalInput",bsky:"bskyInput"};var Z={data(){return{stepsAvailable:{},completedSteps:{},openedStep:null,isLoading:!1,newTimezone:null,timezoneEditing:!1,profile:null,requiredContracts:[]}},created(){this.stepsAvailable={privacy:this.isPrivacyUnset,notification:!this.user.notificationSettings||!this.user.notificationSettings.pNotificationRead,groups:!this.user.notificationSettings||!this.user.notificationSettings.pGroups,timezone:!this.user.notificationSettings||!this.user.notificationSettings.pTimezoneRead,profile:!1,contracts:!1},this.newTimezone=this.user.timezone,this.profile=this.user,this.profileStepAvailable(),this.checkRequiredContracts(),this.setOpenedStep()},mounted(){},methods:{isStepDisabled(e){if(e===this.openedStep)return!1;if(this.completedSteps[e])return!1;const t=this.stepsOrder.indexOf(this.openedStep),i=this.stepsOrder.indexOf(e);return!(i<t)},saveCurrentStep(){switch(this.openedStep){case"profile":this.$refs.form.submitForm();break;case"privacy":this.savePrivacy();break;case"notification":this.saveNotification();break;case"groups":this.saveGroups();break}},profileStepAvailable(){let e=this.checkMandatoryProfileFields();this.stepsAvailable.profile=e.fields.length>0||e.customFields.length>0},checkRequiredContracts(){this.userTypeEligibleForFee(this.user)&&!this.isGranted("HR_TENANT")&&(this.isLoading=!0,this.$http.plain.get(`/contracts-get-required-and-unsigned/${this.user.id}`).then(e=>{200===e.status?(this.requiredContracts=e.data,this.stepsAvailable.contracts=!0):204===e.status&&(this.user.hasUnsignedRequiredDocuments=!1)}).catch(e=>{console.error(e)}).finally(()=>{this.isLoading=!1,this.setOpenedStep()}))},saveTimezone(){let e=this.user.notificationSettings?{...this.user.notificationSettings}:{};e.pTimezoneRead=!0,this.isLoading=!0,this.$http.plain.patch("/profile-update/"+this.user.id,{timezone:this.newTimezone,notificationSettings:e}).then(e=>{this.completedSteps.timezone=!0,this.stepsAvailable.timezone=!1,this.saveSuccess(e),this.setOpenedStep()}).catch(e=>this.showSaveError(e)).finally(()=>{this.isLoading=!1})},getPrivacyPayload(){let e=this.user.privacy||{};return{name:e.name??!1,email:e.email??!1,phone:e.phone??!1,age:e.age??!1,image:e.image??!1,town:e.town??!1,social:e.social??!1,profession:e.profession??!1,profile:e.profile??!1}},autoSavePrivacy(){this.$http.plain.patch("/profile-update/"+this.user.id,{privacy:this.getPrivacyPayload()}).then(e=>{this.$store.commit("setCurrentUser",e.data)}).catch(e=>console.error(e))},savePrivacy(){let e=this.user.notificationSettings?{...this.user.notificationSettings}:{};e.pPrivacyRead=!0,this.isLoading=!0,this.$http.plain.patch("/profile-update/"+this.user.id,{privacy:this.getPrivacyPayload(),notificationSettings:e}).then(e=>{this.completedSteps.privacy=!0,this.stepsAvailable.privacy=!1,this.saveSuccess(e),this.setOpenedStep()}).catch(e=>this.showSaveError(e)).finally(()=>this.isLoading=!1)},saveNotification(){let e=this.user.notificationSettings?{...this.user.notificationSettings}:{};e.pNotificationRead=!0,this.isLoading=!0,this.$http.plain.patch("/profile-update/"+this.user.id,{notificationSettings:e}).then(e=>{this.completedSteps.notification=!0,this.stepsAvailable.notification=!1,this.saveSuccess(e),this.setOpenedStep()}).catch(e=>this.showSaveError(e)).finally(()=>this.isLoading=!1)},saveGroups(){let e=this.user.notificationSettings?{...this.user.notificationSettings}:{};e.pGroups=!0,this.isLoading=!0,this.$http.plain.patch("/profile-update/"+this.user.id,{notificationSettings:e}).then(e=>{this.completedSteps.groups=!0,this.stepsAvailable.groups=!1,this.saveSuccess(e),this.setOpenedStep()}).catch(e=>this.showSaveError(e)).finally(()=>this.isLoading=!1)},setOpenedStep(){if(this.stepsAvailable.profile)this.openedStep="profile";else if(this.stepsAvailable.privacy)this.openedStep="privacy";else if(this.stepsAvailable.notification)this.openedStep="notification";else if(this.stepsAvailable.timezone)this.openedStep="timezone";else if(this.stepsAvailable.groups)this.openedStep="groups";else{if(!this.stepsAvailable.contracts)return this.isGranted("ADMIN_TENANT")&&!this.tenant.onboarding?.isComplete?this.$router.push({name:"OnBoardingTenant"}):this.$router.push({name:"Dashboard"});this.openedStep="contracts"}},saveProfile(){let e={};e.rawUserCustomFieldsValues=this.$refs.form.customFieldValues,e.townFrom=this.profile.townFrom?this.profile.townFrom["@i
1d"]:null,e.townCurrent=this.profile.townCurrent?this.profile.townCurrent["@id"]:null,e.phoneNumber=this.profile.phoneLocalNumber?this.profile.phoneLocalNumber:null,e.phoneLocalNumber=this.profile.phoneLocalNumber?this.profile.phoneLocalNumber:null,e.phoneCountry=this.profile.phoneCountry?this.profile.phoneCountry:null,e.dateBirth=this.profile.dateBirth,e.firstName=this.profile.firstName,e.address=this.profile.address,e.postalCode=this.profile.postalCode,e.lastName=this.profile.lastName,e.professionHeadline=this.profile.professionHeadline,e.professionSector=this.profile.professionSector,e.professionIndustry=this.profile.professionIndustry?this.profile.professionIndustry["@id"]:null,e.gender=this.profile.gender?this.profile.gender:null,e.profileTiktok=this.profile.profileTiktok,e.profileLinkedin=this.profile.profileLinkedin,e.profileFacebook=this.profile.profileFacebook,e.website=this.profile.website,e.profileInstagram=this.profile.profileInstagram,e.profileTelegram=this.profile.profileTelegram,e.profileTwitter=this.profile.profileTwitter,"NaN/NaN/NaN"===this.profile.dateBirth&&delete e.dateBirth,this.isLoading=!0,this.$http.plain.patch("/profile-update/"+this.user.id,e).then(e=>{this.saveSuccess(e),this.profileStepAvailable(),this.stepsAvailable.profile||(this.completedSteps.profile=!0),this.setOpenedStep()}).catch(e=>this.showSaveError(e)).finally(()=>this.isLoading=!1)},showSaveError(e){console.error(e);let t=e.response?.data?.detail||e.response?.data?.["hydra:description"]||this.$t("Something went wrong. Please try again.");this.$buefy.toast.open({type:"is-danger",message:t,duration:6e3})},saveSuccess(e){return this.$store.commit("setCurrentUser",e.data),this.profile=e.data,this.$buefy.toast.open({type:"is-success",message:this.$t("updatedSuccessfully")})},getMandatoryFieldLabel(e){const t={first_name:this.$t("First name"),last_name:this.$t("Last name"),birthday:this.$t("Date of birth"),phoneNumber:this.$t("Phone number"),gender:this.$t("Gender"),town_current:this.$t("Location"),town_from:this.$t("Town from"),address:this.$t("Address"),postal_code:this.$t("Postal code"),website:this.$t("Website"),facebook:this.$t("Facebook"),twitter:this.$t("Twitter"),linkedin:this.$t("LinkedIn"),instagram:this.$t("Instagram"),telegram:this.$t("Telegram"),tiktok:this.$t("TikTok"),signal:this.$t("Signal"),bsky:this.$t("Bluesky")};return t[e]||e},getCustomFieldLabel(e){if(!this.tenant?.customFields)return e;const t=this.tenant.customFields.find(t=>t.id===e);return t?.name||e},focusMandatoryField(e){const t=Y[e];if(!t||!this.$refs.form)return;let i=this.$refs.form.$refs[t];if(Array.isArray(i)&&(i=i[0]),!i)return;const s=i.$el||i;if(!s)return;const o=1===s.nodeType?s:s.nextElementSibling||s.parentElement;if(!o)return;const r=o.closest(".field")||o.closest(".b-field")||o.parentElement;r&&r.classList.add("highlight-focus-field"),o.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{if(i.focus)i.focus();else{const e=o.querySelector("input, textarea, select");e&&e.focus()}setTimeout(()=>{r&&r.classList.remove("highlight-focus-field")},1e3)},600)},focusMandatoryCustomField(e){if(!this.$refs.form)return;const t=`customField_${e}`;let i=this.$refs.form.$refs[t];if(!i)return;if(Array.isArray(i)&&(i=i[0]),!i)return;const s=i.$el||i;if(!s)return;const o=1===s.nodeType?s:s.nextElementSibling||s.parentElement;if(!o)return;const r=o.closest(".field")||o.closest(".b-field")||o.parentElement;r&&r.classList.add("highlight-focus-field"),o.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{if(i.focus)i.focus();else{const e=o.querySelector("input, textarea, select");e&&e.focus()}setTimeout(()=>{r&&r.classList.remove("highlight-focus-field")},1e3)},600)}},computed:{...(0,W.L8)(["tenant","user","isPrivacyUnset","checkMandatoryProfileFields","userTypeEligibleForFee","isGranted"]),missingMandatoryFields(){const e=this.checkMandatoryProfileFields();return e.fields||[]},missingMandatoryCustomFields(){const e=this.checkMandatoryProfileFields();return e.customFields||[]},isMoreThanOneStepAvailable(){let e=0;for(let t of Object.values(this.stepsAvailable))if(t&&(e++,e>1))return!0;return!1}
1,stepsOrder(){return["profile","privacy","notification","timezone","groups","contracts"]},availableStepsList(){const e={profile:this.$t("profile"),privacy:this.$t("Privacy"),notification:this.$t("Notifications"),timezone:this.$t("Timezone"),groups:this.$t("groups"),contracts:this.$t("e-Documents")};return this.stepsOrder.filter(e=>this.stepsAvailable[e]).map(t=>({key:t,label:e[t]}))}},components:{Form:K.A,GroupBrowse:q["default"],FormNotification:j.A,TimezoneSelect:V.A,FormPrivacy:D.A,OrgoLogo:B.A,Contract:H.A}},ee=i(66262);const te=(0,ee.A)(Z,[["render",J],["__scopeId","data-v-cf83ff8a"]]);var ie=te},17233:function(e,t,i){i.r(t),i.d(t,{default:function(){return Pe}});var s=i(20641),o=i(90033),r=i(53751);const n={class:"o-minwidth groups-browse"},a=["aria-label"],l={class:"icon"},u={class:"icon"},p={key:2,class:"grouplist-header-bar"},d={class:"has-text-weight-semibold is-size-4 has-text-dark"},c={class:"grouplist-header-actions"},h={class:"icon-text"},g={class:"icon is-small"},f={id:"new_group",class:"button is-small is-rounded is-primary"},m={class:"icon-text"},b={class:"icon is-small"},w={class:"icon-text"},v={class:"icon is-small"},y={class:"icon-text"},k={class:"icon is-small"},L={key:3,class:"grouplist-filter-bar"},C={class:"tabs-pill"},$={class:"tabs"},F={key:0,class:"grouplist-search"},S={class:"icon is-small grouplist-search-icon"},G=["placeholder"],_={key:4,class:"grouplist-search grouplist-search--mobile"},A={class:"icon is-small grouplist-search-icon"},E=["placeholder"],M={key:5,class:"grouplist-card is-tenant"},U={key:6,class:"grouplist-card"},T={class:"grouplist-section-header"},x={class:"section-title"},X={class:"section-count"},N={class:"grouplist-card"},Q=["title","onClick"],I={class:"icon is-small"},R={class:"grouplist-section-header"},z={class:"section-title"},O={class:"section-count"},P={key:0,class:"grouplist-card"},J={class:"grouplist-section-header"},B={class:"section-title"},W={class:"section-count"},D={class:"grouplist-card"},V={class:"grouplist-section-header"},j={class:"section-title"},q={class:"section-count"},K={class:"grouplist-card"},H={class:"grouplist-section-header"},Y={class:"section-title"},Z={class:"section-count"},ee={class:"grouplist-card"},te={class:"grouplist-section-header"},ie={class:"grouplist-card"},se={class:"group-skeleton-lines"},oe={key:13,class:"grouplist-empty"},re={class:"icon is-large"};function ne(e,t,i,ne,ae,le){const ue=(0,s.g2)("b-loading"),pe=(0,s.g2)("font-awesome-icon"),de=(0,s.g2)("MobileViewHeader"),ce=(0,s.g2)("router-link"),he=(0,s.g2)("b-dropdown-item"),ge=(0,s.g2)("b-dropdown"),fe=(0,s.g2)("GroupListRow"),me=(0,s.g2)("b-skeleton");return(0,s.uX)(),(0,s.CE)("div",n,[!le.showSkeleton&&ae.isLoadingGroups?((0,s.uX)(),(0,s.Wv)(ue,{key:0,modelValue:ae.isLoadingGroups,"onUpdate:modelValue":t[0]||(t[0]=e=>ae.isLoadingGroups=e),"is-full-page":!1},null,8,["modelValue"])):(0,s.Q3)("",!0),"OnBoardingUser"!==e.$route.name?((0,s.uX)(),(0,s.Wv)(de,{key:1,title:e.$t("groups"),"back-route":"Dashboard"},{actions:(0,s.k6)(()=>[(0,s.Lk)("button",{class:"groups-header-icon-btn","aria-label":e.$t("Search"),onClick:t[1]||(t[1]=(...e)=>le.toggleMobileSearch&&le.toggleMobileSearch(...e))},[(0,s.Lk)("span",l,[(0,s.bF)(pe,{icon:"fa-light fa-magnifying-glass"})])],8,a),le.hasNewGroupButton?((0,s.uX)(),(0,s.CE)("button",{key:0,id:"new_group_mobile",class:"button is-small is-rounded is-primary",onClick:t[2]||(t[2]=e=>le.openCreateGroup())},[(0,s.Lk)("span",u,[(0,s.bF)(pe,{icon:"fa-light fa-plus"})])])):(0,s.Q3)("",!0)]),_:1},8,["title"])):(0,s.Q3)("",!0),"OnBoardingUser"===e.$route.name||e.$isMobile()?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",p,[(0,s.Lk)("div",d,(0,o.v_)(e.$t("groups")),1),(0,s.Lk)("div",c,[e.isGranted("ADMIN_TENANT")?((0,s.uX)(),(0,s.Wv)(ce,{key:0,to:{name:"ModuleGroupsConfig"},class:"button is-small is-rounded is-white"},{default:(0,s.k6)(()=>[(0,s.Lk)("span",h,[(0,s.Lk)("span",g,[(0,s.bF)(pe,{icon:"fa-light fa-gear"})]),(0,s.Lk)("span",null,(0,o.v_)(e.$t("Settings")),1)])]),_:1})):(0,s.Q3)("",!0),le.hasNewGroupButton?((0,s.uX)(),(0,s.Wv)(ge,{key:1,triggers:["click"],position:"is-bottom-left","aria-role":"list"},{trigger:(0,s.k6)(()=>[(0,s.Lk)("button",f,[(0,s.Lk)("span",m,[(0,s.Lk)("span",b,[(0,s.bF)(pe,{icon:"fa-light fa-plus"})]),(0,s.Lk)("span",null,(0,o.v_)(e.$t("Create group")),1)])])]),default:(0,s.k6)(()=>[(0,s.bF)(he,{"aria-role":"listitem",onClick:t[3]||(t[3]=e=>le.openCreateGroup())},{default:(0,s.k6)(()=>[(0,s.Lk)("span",w,[(0,s.Lk)("span",v,[(0,s.bF)(pe,{icon:"fa-light fa-users"})]),(0,s.Lk)("span",null,(0,o.v_)(e.$t("Create group")),1)])]),_:1}),le.canCreateRoleGroup?((0,s.uX)(),(0,s.Wv)(he,{key:0,"aria-role":"listitem",onClick:t[4]||(t[4]=e=>le.openCreateRoleGroup())},{default:(0,s.k6)(()=>[(0,s.Lk)("span",y,[(0,s.Lk)("span",k,[(0,s.bF)(pe,{icon:"fa-light fa-user-shield"})]),(0,s.Lk)("span",null,(0,o.v_)(e.$t("Create role group")),1)])]),_:1})):(0,s.Q3)("",!0)]),_:1})):(0,s.Q3)("",!0)])])),"OnBoardingUser"===e.$route.name||i.hideFilter?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",L,[(0,s.Lk)("div",C,[(0,s.Lk)("nav",$,[(0,s.Lk)("ul",null,[(0,s.Lk)("li",{class:(0,o.C4)({"is-active":"all"===ae.filterFollow}),onClick:t[5]||(t[5]=e=>le.setFilter("all"))},[(0,s.Lk)("a",null,[(0,s.eW)((0,o.v_)(e.$t("all"))+" ",1),le.groupCounts.all>0?((0,s.uX)(),(0,s.CE)("span",{key:0,class:(0,o.C4)(["group-tab-badge",{"is-active":"all"===ae.filterFollow}])},(0,o.v_)(le.groupCounts.all),3)):(0,s.Q3)("",!0)])],2),(0,s.Lk)("li",{class:(0,o.C4)({"is-active":"follow"===ae.filterFollow}),onClick:t[6]||(t[6]=e=>le.setFilter("follow"))},[(0,s.Lk)("a",null,[(0,s.eW)((0,o.v_)(e.$t("Subscribed"))+" ",1),le.groupCounts.follow>0?((0,s.uX)(),(0,s.CE)("span",{key:0,class:(0,o.C4)(["group-tab-badge",{"is-active":"follow"===ae.filterFollow}])},(0,o.v_)(le.groupCounts.follow),3)):(0,s.Q3)("",!0)])],2),(0,s.Lk)("li",{class:(0,o.C4)({"is-active":"no_follow"===ae.filterFollow}),onClick:t[7]||(t[7]=e=>le.setFilter("no_follow"))},[(0,s.Lk)("a",null,[(0,s.eW)((0,o.v_)(e.$t("Not subscribed"))+" ",1),le.groupCounts.no_follow>0?((0,s.uX)(),(0,s.CE)("span",{key:0,class:(0,o.C4)(["group-tab-badge",{"is-active":"no_follow"===ae.filterFollow}])},(0,o.v_)(le.groupCounts.no_follow),3)):(0,s.Q3)("",!0)])],2),(0,s.Lk)("li",{class:(0,o.C4)({"is-active":"archived"===ae.filterFollow}),onClick:t[8]||(t[8]=e=>le.setFilter("archived"))},[(0,s.Lk)("a",null,[(0,s.eW)((0,o.v_)(e.$t("archived"))+" ",1),le.groupCounts.archived>0?((0,s.uX)(),(0,s.CE)("span",{key:0,class:(0,o.C4)(["group-tab-badge",{"is-active":"archived"===ae.filterFollow}])},(0,o.v_)(le.groupCounts.archived),3)):(0,s.Q3)("",!0)])],2),le.canManageRoleGroups?((0,s.uX)(),(0,s.CE)("li",{key:0,class:(0,o.C4)({"is-active":"role_groups"===ae.filterFollow}),onClick:t[9]||(t[9]=e=>le.setFilter("role_groups"))},[(0,s.Lk)("a",null,[(0,s.eW)((0,o.v_)(e.$t("Role groups"))+" ",1),le.groupCounts.role_groups>0?((0,s.uX)(),(0,s.CE)("span",{key:0,class:(0,o.C4)(["group-tab-badge",{"is-active":"role_groups"===ae.filterFollow}])},(0,o.v_)(le.groupCounts.role_groups),3)):(0,s.Q3)("",!0)])],2)):(0,s.Q3)("",!0)])])]),e.$isMobile()?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",F,[(0,s.Lk)("span",S,[(0,s.bF)(pe,{icon:"fa-light fa-magnifying-glass"})]),(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":t[10]||(t[10]=e=>ae.searchQuery=e),type:"text",class:"input is-rounded",placeholder:e.$t("Search group...")},null,8,G),[[r.Jo,ae.searchQuery]])]))])),e.$isMobile()&&ae.mobileSearchOpen?((0,s.uX)(),(0,s.CE)("div",_,[(0,s.Lk)("span",A,[(0,s.bF)(pe,{icon:"fa-light fa-magnifying-glass"})]),(0,s.bo)((0,s.Lk)("input",{ref:"mobileSearchInput","onUpdate:modelValue":t[11]||(t[11]=e=>ae.searchQuery=e),type:"text",class:"input is-rounded",placeholder:e.$t("Search group...")},null,8,E),[[r.Jo,ae.searchQuery]])])):(0,s.Q3)("",!0),!le.isRoleGroupsFilter&&le.showTenantCard&&le.tenantMatchesSearch?((0,s.uX)(),(0,s.CE)("div",M,[(0,s.bF)(fe,{row:e.tenant,groups:null,index:null,onFollowUpdate:le.updateFollow,onMuteUpdate:le.updateMute},null,8,["row","onFollowUpdate","onMuteUpdate"])])):(0,s.Q3)("",!0),!le.isRoleGroupsFilter&&le.localCenter&&le.rowMatchesSearch(le.localCenter.item)?((0,s.uX)(),(0,s.CE)("div",U,[((0,s.uX)(),(0,s.Wv)(fe,{key:"local_"+le.localCenter.item.id,row:le.localCenter.item,groups:ae.groups,index:le.localCenter.index,onFollowUpdate:le.updateFollow,onMuteUpdate:le.updateMute},null,8,["row","groups","index","onFollowUpdate","onMuteUpdate"]))])):(0,s.Q3)("",!0),le.filteredRoleGroups.length>0?((0,s.uX)(),(0,s.CE)(s.FK,{key:7},[(0,s.Lk)("div",T,[(0,s.Lk)("span",x,(0,o.v_)(le.isRoleGroupsFilter?e.$t("Role groups"):e.$t("Teams")),1),t[12]||(t[12]=(0,s.Lk)("span",{class:"section-line"},null,-1)),(0,s.Lk)("span",X,(0,o.v_)(le.filteredRoleGroups.length)+" "+(0,o.v_)(e.$t("groups")),1)]),(0,s.Lk)("div",N,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(le.filteredRoleGroups,
1({row:t,index:i})=>((0,s.uX)(),(0,s.Wv)(fe,{key:"rg_"+t.id,row:t,groups:ae.groups,index:i,onFollowUpdate:le.updateFollow,onMuteUpdate:le.updateMute},(0,s.eX)({_:2},[le.canManageRoleGroups&&!e.$isMobile()?{name:"actions",fn:(0,s.k6)(()=>[(0,s.Lk)("button",{class:"button is-small is-rounded is-white",title:e.$t("edit"),onClick:(0,r.D$)(e=>le.editRoleGroup(t),["stop"])},[(0,s.Lk)("span",I,[(0,s.bF)(pe,{icon:"fa-light fa-gear"})])],8,Q)]),key:"0"}:void 0]),1032,["row","groups","index","onFollowUpdate","onMuteUpdate"]))),128))])],64)):(0,s.Q3)("",!0),!le.isRoleGroupsFilter&&le.filteredCategoryTotal>0?((0,s.uX)(),(0,s.CE)(s.FK,{key:8},[le.filteredCategoryTotal>0?((0,s.uX)(),(0,s.CE)(s.FK,{key:0},[(0,s.Lk)("div",R,[(0,s.Lk)("span",z,(0,o.v_)(e.$t("Programs and activities")),1),t[13]||(t[13]=(0,s.Lk)("span",{class:"section-line"},null,-1)),(0,s.Lk)("span",O,(0,o.v_)(le.filteredCategoryTotal)+" "+(0,o.v_)(e.$t("groups")),1)]),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(le.renderedGroupCategories,e=>((0,s.uX)(),(0,s.CE)(s.FK,{key:e.id},[le.filteredByCategory(e.id).length>0?((0,s.uX)(),(0,s.CE)("div",P,[(0,s.Lk)("div",{class:"grouplist-category-label",style:(0,o.Tr)({color:e.color||"var(--orgo-body-text)"})},(0,o.v_)(e.name),5),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(le.filteredByCategory(e.id),({row:e,index:t})=>((0,s.uX)(),(0,s.Wv)(fe,{key:"cat_"+e.id,row:e,groups:ae.groups,index:t,onFollowUpdate:le.updateFollow,onJoinUpdate:le.joinUpdate,onMuteUpdate:le.updateMute},null,8,["row","groups","index","onFollowUpdate","onJoinUpdate","onMuteUpdate"]))),128))])):(0,s.Q3)("",!0)],64))),128))],64)):(0,s.Q3)("",!0)],64)):(0,s.Q3)("",!0),!le.isRoleGroupsFilter&&le.filteredGeneralGroups.length>0?((0,s.uX)(),(0,s.CE)(s.FK,{key:9},[(0,s.Lk)("div",J,[(0,s.Lk)("span",B,(0,o.v_)(e.$t("Community groups")),1),t[14]||(t[14]=(0,s.Lk)("span",{class:"section-line"},null,-1)),(0,s.Lk)("span",W,(0,o.v_)(le.filteredGeneralGroups.length)+" "+(0,o.v_)(e.$t("groups")),1)]),(0,s.Lk)("div",D,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(le.filteredGeneralGroups,({row:e,index:t})=>((0,s.uX)(),(0,s.Wv)(fe,{key:"gen_"+e.id,row:e,groups:ae.groups,index:t,onJoinUpdate:le.joinUpdate,onFollowUpdate:le.updateFollow,onMuteUpdate:le.updateMute},null,8,["row","groups","index","onJoinUpdate","onFollowUpdate","onMuteUpdate"]))),128))])],64)):(0,s.Q3)("",!0),!le.isRoleGroupsFilter&&le.filteredPrivateGroups.length>0?((0,s.uX)(),(0,s.CE)(s.FK,{key:10},[(0,s.Lk)("div",V,[(0,s.Lk)("span",j,(0,o.v_)(e.$t("Private groups")),1),t[15]||(t[15]=(0,s.Lk)("span",{class:"section-line"},null,-1)),(0,s.Lk)("span",q,(0,o.v_)(le.filteredPrivateGroups.length)+" "+(0,o.v_)(e.$t("groups")),1)]),(0,s.Lk)("div",K,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(le.filteredPrivateGroups,({row:e,index:t})=>((0,s.uX)(),(0,s.Wv)(fe,{key:"priv_"+e.id,row:e,groups:ae.groups,index:t,onFollowUpdate:le.updateFollow,onMuteUpdate:le.updateMute},null,8,["row","groups","index","onFollowUpdate","onMuteUpdate"]))),128))])],64)):(0,s.Q3)("",!0),"OnBoardingUser"!==e.$route.name&&("all"===ae.filterFollow||"archived"===ae.filterFollow)&&le.filteredArchivedGroups.length>0?((0,s.uX)(),(0,s.CE)(s.FK,{key:11},[(0,s.Lk)("div",H,[(0,s.Lk)("span",Y,(0,o.v_)(e.$t("Archived groups")),1),t[16]||(t[16]=(0,s.Lk)("span",{class:"section-line"},null,-1)),(0,s.Lk)("span",Z,(0,o.v_)(le.filteredArchivedGroups.length)+" "+(0,o.v_)(e.$t("groups")),1)]),(0,s.Lk)("div",ee,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(le.filteredArchivedGroups,({row:e,index:t})=>((0,s.uX)(),(0,s.Wv)(fe,{key:"archived_"+e.id,row:e,groups:ae.archivedGroups,index:t,onFollowUpdate:le.updateFollow,onUnarchived:le.handleUnarchived},null,8,["row","groups","index","onFollowUpdate","onUnarchived"]))),128))])],64)):(0,s.Q3)("",!0),le.showSkeleton?((0,s.uX)(),(0,s.CE)(s.FK,{key:12},[(0,s.Lk)("div",te,[(0,s.bF)(me,{width:"120px",height:"12px"}),t[17]||(t[17]=(0,s.Lk)("span",{class:"section-line"},null,-1))]),(0,s.Lk)("div",ie,[((0,s.uX)(),(0,s.CE)(s.FK,null,(0,s.pI)(5,e=>(0,s.Lk)("div",{key:"grp_skel_"+e,class:"group-skeleton-row"},[(0,s.bF)(me,{width:"44px",height:"44px"}),(0,s.Lk)("div",se,[(0,s.bF)(me,{width:"40%",height:"13px"}),(0,s.bF)(me,{width:"65%",height:"10px"})]),(0,s.bF)(me,{width:"80px",height:"28px"})])),64))])],64)):(0,s.Q3)("",!0),!ae.isLoadingGroups&&le.isEmpty?((0,s.uX)(),(0,s.CE)("div",oe,[(0,s.Lk)("span",re,[(0,s.bF)(pe,{icon:"fa-light fa-users-slash",size:"2x"})]),(0,s.Lk)("p",null,(0,o.v_)(ae.searchQuery?e.$t("No groups match your search"):e.$t("No groups to display")),1)])):(0,s.Q3)("",!0)])}i(44114),i(18111),i(22489),i(7588),i(61701),i(13579);const ae={key:0,class:"group-list-lock"},le={class:"group-list-initial"},ue={key:0,class:"group-list-lock"},pe={class:"group-list-info"},de={class:"group-list-title"},ce={class:"group-list-name"},he={key:0,class:"tag is-light is-small is-rounded ml-2"},ge={key:0,class:"group-list-subtitle"},fe={key:0,class:"group-list-members"},me={class:"icon is-small"},be={key:1,class:"group-list-new-badge"},we=["disabled"],ve={class:"icon is-small"},ye=["disabled"],ke={class:"icon is-small"},Le=["disabled"],Ce={class:"icon is-small"},$e=["disabled"],Fe={class:"icon is-small"},Se=["disabled"],Ge={class:"icon is-small"};function _e(e,t,i,n,a,l){const u=(0,s.g2)("font-awesome-icon");return(0,s.uX)(),(0,s.CE)("div",{class:(0,o.C4)(["group-list-row",{"is-clickable":l.isRowClickable}]),onClick:t[6]||(t[6]=(...e)=>l.openRow&&l.openRow(...e))},[l.thumbnailImage?((0,s.uX)(),(0,s.CE)("div",{key:0,class:"group-list-thumb has-image",style:(0,o.Tr)({backgroundImage:l.thumbnailImage})},[l.isLocked?((0,s.uX)(),(0,s.CE)("span",ae,[(0,s.bF)(u,{icon:"fa-light fa-lock"})])):(0,s.Q3)("",!0)],4)):((0,s.uX)(),(0,s.CE)("div",{key:1,class:"group-list-thumb",style:(0,o.Tr)({backgroundColor:l.tintBackgroun
1d,color:l.tintForeground})},[(0,s.Lk)("span",le,(0,o.v_)(l.initial),1),l.isLocked?((0,s.uX)(),(0,s.CE)("span",ue,[(0,s.bF)(u,{icon:"fa-light fa-lock"})])):(0,s.Q3)("",!0)],4)),(0,s.Lk)("div",pe,[(0,s.Lk)("div",de,[(0,s.Lk)("span",ce,(0,o.v_)(l.displayName),1),"CLOSED"===i.row.status?((0,s.uX)(),(0,s.CE)("span",he,(0,o.v_)(e.$t("archived")),1)):(0,s.Q3)("",!0)]),l.subtitle?((0,s.uX)(),(0,s.CE)("div",ge,(0,o.v_)(l.subtitle),1)):(0,s.Q3)("",!0)]),(0,s.Lk)("div",{class:"group-list-right",onClick:t[5]||(t[5]=(0,r.D$)(()=>{},["stop"]))},[!e.$isMobile()&&l.memberCountLabel?((0,s.uX)(),(0,s.CE)("span",fe,[(0,s.Lk)("span",me,[(0,s.bF)(u,{icon:"fa-light fa-user"})]),(0,s.Lk)("span",null,(0,o.v_)(l.memberCountLabel),1)])):(0,s.Q3)("",!0),i.row.newPostsCount>0?((0,s.uX)(),(0,s.CE)("span",be,(0,o.v_)(i.row.newPostsCount)+" "+(0,o.v_)(e.$t("new")),1)):(0,s.Q3)("",!0),!i.row.isJoined&&i.row.isJoinable&&"Group"===i.row["@type"]&&"CLOSED"!==i.row.status?((0,s.uX)(),(0,s.CE)("button",{key:2,class:(0,o.C4)(["button is-small is-rounded subscribe-btn",{"is-loading-state":a.isLoadingJoin===i.row.id}]),disabled:a.isLoadingJoin===i.row.id,onClick:t[0]||(t[0]=(...e)=>l.joinGroup&&l.joinGroup(...e))},[(0,s.Lk)("span",ve,[a.isLoadingJoin===i.row.id?((0,s.uX)(),(0,s.Wv)(u,{key:0,icon:"fa-light fa-spinner-third",spin:""})):((0,s.uX)(),(0,s.Wv)(u,{key:1,icon:"fa-light fa-bell"}))]),(0,s.Lk)("span",null,(0,o.v_)(e.$t("Subscribe")),1)],10,we)):(0,s.Q3)("",!0),"CLOSED"!==i.row.status&&(l.isOpenAccess&&"LocalCenter"===i.row["@type"]||i.row.includesAllMembers||"RoleGroup"===i.row["@type"])?((0,s.uX)(),(0,s.CE)("button",{key:3,class:(0,o.C4)(["button is-small is-rounded subscribe-btn",{"is-subscribed":!i.row.muted||a.showSubscribeAnimation,"is-loading-state":a.isLoadingMute}]),disabled:!!a.isLoadingMute,onClick:t[1]||(t[1]=(...e)=>l.toggleMute&&l.toggleMute(...e))},[(0,s.Lk)("span",ke,[a.isLoadingMute?((0,s.uX)(),(0,s.Wv)(u,{key:0,icon:"fa-light fa-spinner-third",spin:""})):((0,s.uX)(),(0,s.Wv)(u,{key:1,icon:!i.row.muted||a.showSubscribeAnimation?"fa-light fa-bell-ring":"fa-light fa-bell",class:(0,o.C4)({"bell-ring-animation":a.showSubscribeAnimation})},null,8,["icon","class"]))]),(0,s.Lk)("span",null,(0,o.v_)(!i.row.muted||a.showSubscribeAnimation?e.$t("Subscribed"):e.$t("Subscribe")),1)],10,ye)):i.row.isJoined||"LocalCenter"===i.row["@type"]?((0,s.uX)(),(0,s.CE)("button",{key:4,class:(0,o.C4)(["button is-small is-rounded subscribe-btn",{"is-subscribed":i.row.following||a.showSubscribeAnimation,"is-loading-state":!!a.isLoadingFollow}]),disabled:!!a.isLoadingFollow,onClick:t[2]||(t[2]=(...e)=>l.toggleFollow&&l.toggleFollow(...e))},[(0,s.Lk)("span",Ce,[a.isLoadingFollow?((0,s.uX)(),(0,s.Wv)(u,{key:0,icon:"fa-light fa-spinner-third",spin:""})):((0,s.uX)(),(0,s.Wv)(u,{key:1,icon:i.row.following||a.showSubscribeAnimation?"fa-light fa-bell-ring":"fa-light fa-bell",class:(0,o.C4)({"bell-ring-animation":a.showSubscribeAnimation})},null,8,["icon","class"]))]),(0,s.Lk)("span",null,(0,o.v_)(i.row.following||a.showSubscribeAnimation?e.$t("Subscribed"):e.$t("Subscribe")),1)],10,Le)):(0,s.Q3)("",!0),"Tenant"===i.row["@type"]?((0,s.uX)(),(0,s.CE)("button",{key:5,class:(0,o.C4)(["button is-small is-rounded subscribe-btn",{"is-subscribed":e.user.isFollowGeneralUnit||a.showSubscribeAnimation,"is-loading-state":a.isLoadingFollowGeneral}]),disabled:a.isLoadingFollowGeneral,onClick:t[3]||(t[3]=(...e)=>l.toggleGeneralUnit&&l.toggleGeneralUnit(...e))},[(0,s.Lk)("span",Fe,[a.isLoadingFollowGeneral?((0,s.uX)(),(0,s.Wv)(u,{key:0,icon:"fa-light fa-spinner-third",spin:""})):((0,s.uX)(),(0,s.Wv)(u,{key:1,icon:e.user.isFollowGeneralUnit||a.showSubscribeAnimation?"fa-light fa-bell-ring":"fa-light fa-bell",class:(0,o.C4)({"bell-ring-animation":a.showSubscribeAnimation})},null,8,["icon","class"]))]),(0,s.Lk)("span",null,(0,o.v_)(e.user.isFollowGeneralUnit||a.showSubscribeAnimation?e.$t("Subscribed"):e.$t("Subscribe")),1)],10,$e)):(0,s.Q3)("",!0),"CLOSED"===i.row.status&&e.isGranted("ADMIN_TENANT")?((0,s.uX)(),(0,s.CE)("button",{key:6,class:"button is-small is-rounded is-primary",disabled:a.isLoadingUnarchive===i.row.id,onClick:t[4]||(t[4]=(...e)=>l.confirmUnarchive&&l.confirmUnarchive(...e))},[(0,s.Lk)("span",Ge,[a.isLoadingUnarchive===i.row.id?((0,s.uX)(),(0,s.Wv)(u,{key:0,icon:"fa-light fa-spinner-third",spin:""})):((0,s.uX)(),(0,s.Wv)(u,{key:1,icon:"fa-light fa-box-open"}))]),(0,s.Lk)("span",null,(0,o.v_)(e.$t("Unarchive")),1)],8,Se)):(0,s.Q3)("",!0),(0,s.RG)(e.$slots,"actions",{},void 0,!0)])],2)}var Ae=i(40834),Ee=i(95256),Me=i(28782),Ue=i(43464),Te={name:"GroupListRow",props:{row:{type:Object,required:!0},groups:{type:Array,default:null},index:{type:Number,default:null}},emits:["follow-update","mute-update","join-update","unarchived"],data(){return{isLoadingJoin:null,isLoadingFollow:null,isLoadingFollowGeneral:!1,isLoadingMute:null,isLoadingUnarchive:null,showSubscribeAnimation:!1}},computed:{...(0,Ae.L8)(["user","tenant","isGranted"]),isOpenAccess(){return this.tenant?.settingFeatures?.localCenter?.openAccess},groupHasOnlyTasks(){return this.row.isProject&&!this.row.hasDiscussion},isLocked(){return"Group"===this.row["@type"]&&!this.row.isJoinable},displayName(){return"Tenant"===this.row["@type"]&&this.row.shortName||this.row.name},initial(){const e=this.displayName||"";return e.slice(0,1).toUpperCase()}
1,tintBackground(){if("Tenant"===this.row["@type"])return"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";if(this.row.category?.color)return this.hexToTint(this.row.category.color);const e=(0,Ee.ly)(this.displayName);return this.hexToTint(e)},tintForeground(){return"Tenant"===this.row["@type"]?"#ffffff":this.row.category?.color?this.row.category.color:(0,Ee.ly)(this.displayName)},thumbnailImage(){const e=this.row.logo||("Tenant"===this.row["@type"]?this.row.logoSquare:null);if(!e)return null;if(e.includes("demo__"))return`url(${e.replace("demo__","")})`;if("demo"===e)return`url(https://picsum.photos/id/${this.row.id%1e3+1}/200/200.jpg)`;if(e.startsWith("http://")||e.startsWith("https://"))return`url(${e})`;let t=(this.row["@type"]||"group").toLowerCase();return"rolegroup"===t&&(t="unit"),"tenant"===t?`url(${Me.hd}${Me.DJ}tenant/${e})`:`url(${Me.ze}${Me.DJ}${t}/${e})`},memberCountLabel(){return"Tenant"===this.row["@type"]||null==this.row.activeMemberCount?null:`${this.row.activeMemberCount} ${this.$t("members")}`},subtitle(){if("Tenant"===this.row["@type"]){const e=null!=this.row.activeMemberCount?`${this.row.activeMemberCount} ${this.$t("members")}`:null,t=[];return e&&t.push(e),t.push(this.$t("Main organization")),t.join(" · ")}if(this.$isMobile()){const e=[];return null!=this.row.activeMemberCount&&e.push(`${this.row.activeMemberCount} ${this.$t("members")}`),this.row.newPostsCount>0&&e.push(`${this.row.newPostsCount} ${this.$t("new posts")}`),e.join(" · ")}return null},isRowClickable(){return this.row.isJoined||"Tenant"===this.row["@type"]||this.row.isJoinable}},methods:{hexToTint(e){if(!e||"#"!==e[0])return e;let t=e.substring(1);
13===t.length&&(t=t.split("").map(e=>e+e).join(""));const i=parseInt(t.substring(0,2),16),s=parseInt(t.substring(2,4),16),o=parseInt(t.substring(4,6),16);return`rgba(${i}, ${s}, ${o}, 0.14)`},openRow(){const e=this.row;return e.isJoined?this.groupHasOnlyTasks?this.$router.push({name:"IssueList",query:{unit:e.id}}):this.$router.push({name:"DiscussList",query:{unit:e.id}}):"Tenant"===e["@type"]?this.$router.push({name:"DiscussList",query:{generalUnit:!0}}):void(e.isJoinable&&"CLOSED"!==e.status&&this.$buefy.dialog.confirm({message:this.$t("Joining")+" "+e.name,confirmText:this.$t("Join"),cancelText:this.$t("cancel"),onConfirm:()=>this.joinGroup()}))},triggerSubscribeAnimation(){this.showSubscribeAnimation=!0,setTimeout(()=>{this.showSubscribeAnimation=!1},600)},toggleMute(){this.row.muted?(this.triggerSubscribeAnimation(),this.unmuteUnit()):this.muteUnit()},toggleFollow(){this.row.following?this.unfollowUnit():(this.triggerSubscribeAnimation(),this.followUnit())},toggleGeneralUnit(){this.user.isFollowGeneralUnit||this.triggerSubscribeAnimation(),this.followGeneralUnit(!this.user.isFollowGeneralUnit)},followGeneralUnit(e){this.isLoadingFollowGeneral=!0,this.$http.plain.patch("/profile-update/"+this.user.id,{isFollowGeneralUnit:e}).then(e=>{this.user.isFollowGeneralUnit=e.data.isFollowGeneralUnit,this.$buefy.toast.open({duration:6e3,message:this.$t("updatedSuccessfully"),type:"is-success"})}).catch(e=>{console.error(e)}).finally(()=>{this.isLoadingFollowGeneral=!1})},followUnit(){this.isLoadingFollow=this.row.id,this.$http.plain.post("/user_follow_units",{unit:"/api/v1/units/"+this.row.id}).then(e=>{this.$emit("follow-update",{data:e.data.id,index:this.index}),this.$buefy.toast.open({duration:6e3,message:this.$t("updatedSuccessfully"),type:"is-success"})}).catch(e=>{console.error(e)}).finally(()=>{this.isLoadingFollow=null})},unfollowUnit(){this.isLoadingFollow=this.row.following,this.$http.plain.delete("/user_follow_units/"+this.row.following).then(()=>{this.$emit("follow-update",{data:null,index:this.index}),this.$buefy.toast.open({duration:6e3,message:this.$t("updatedSuccessfully"),type:"is-success"})}).catch(e=>{console.error(e)}).finally(()=>{this.isLoadingFollow=null})},joinGroup(){const e=this.row.id;if(!e)return this.$buefy.toast.open({duration:6e3,message:this.$t("Invalid group"),type:"is-danger"});this.isLoadingJoin!==e&&(this.isLoadingJoin=e,this.$http.plain.post("/group/join",{unit:"/api/v1/groups/"+e}).then(()=>{this.$emit("join-update",{groupId:e,index:this.index}),this.$buefy.toast.open({duration:6e3,message:this.$t("userRole.joinedGroup"),type:"is-success"}),Ue.M.commit("addGroupToMyGroups",{slug:this.tenant.slug,group:{...this.row,isJoined:!0}}),this.$http.plain.get("/me").then(e=>{Ue.M.commit("setCurrentUser",e.data),Ue.M.state.error=null,Ue.M.state.spaces[this.tenant.slug].user=e.data}),this.$router.push({name:"DiscussList",query:{unit:e}})}).catch(e=>{console.error(e)}).finally(()=>{this.isLoadingJoin=null}))},muteUnit(){this.isLoadingMute=this.row.id,this.$http.plain.post("/user_mute_units",{unit:"/api/v1/units/"+this.row.id}).then(e=>{this.$emit("mute-update",{data:e.data.id,index:this.index}),this.$buefy.toast.open({duration:6e3,message:this.$t("updatedSuccessfully"),type:"is-success"})}).catch(e=>{console.error(e)}).finally(()=>{this.isLoadingMute=null})},unmuteUnit(){this.isLoadingMute=this.row.muted,this.$http.plain.delete("/user-mute-unit-delete/"+this.row.muted).then(()=>{this.$emit("mute-update",{data:null,index:this.index}),this.$buefy.toast.open({duration:6e3,message:this.$t("updatedSuccessfully"),type:"is-success"})}).catch(e=>{console.error(e)}).finally(()=>{this.isLoadingMute=null})},confirmUnarchive(){this.$buefy.dialog.confirm({title:this.$t("Unarchive group"),message:this.$t("Are you sure you want to unarchive this group?"),confirmText:this.$t("Unarchive"),type:"is-success",onConfirm:()=>this.unarchiveGroup()})},unarchiveGroup(){this.isLoadingUnarchive=this.row.id;let e="";"RoleGroup"===this.row["@type"]?e="/role_groups/"+this.row.id:"LocalCenter"===this.row["@type"]?e="/local_centers/"+this.row.id:"Group"===this.row["@type"]&&(e="/groups/"+this.row.id),this.$http.plain.patch(e,{status:"ACTIVE"}).then(()=>{this.$buefy.snackbar.open({message:this.$t("Unarchived successfully"),type:"is-success"}),this.groups&&this.groups[this.index]&&(this.groups[this.index].status="ACTIVE"),this.$emit("unarchived",{group:this.row,index:this.index})}).catch(e=>
1{console.error(e),this.$buefy.toast.open({duration:6e3,message:this.$t("An error occurred"),type:"is-danger"})}).finally(()=>{this.isLoadingUnarchive=null})}}},xe=i(66262);const Xe=(0,xe.A)(Te,[["render",_e],["__scopeId","data-v-04c92e46"]]);var Ne=Xe,Qe=i(81084),Ie=i(28994),Re=i(61273),ze={components:{FontAwesomeIcon:Re.gc,GroupListRow:Ne,MobileViewHeader:Qe.A},mixins:[Ie.A],props:["hideFilter"],data(){return{isLoadingGroups:!1,groups:[],archivedGroups:[],groupsAll:[],filterFollow:"all",searchQuery:"",mobileSearchOpen:!1}},computed:{...(0,Ae.L8)(["user","tenant","isGranted"]),normalizedQuery(){return(this.searchQuery||"").trim().toLowerCase()},tenantMatchesSearch(){if(!this.normalizedQuery)return!0;const e=(this.tenant.shortName||this.tenant.name||"").toLowerCase();return e.includes(this.normalizedQuery)},localCenter(){if(!this.groups)return null;for(const[e,t]of this.groups.entries())if("LocalCenter"===t["@type"])return{index:e,item:t};return null},indexedGroups(){return this.groups.map((e,t)=>({row:e,index:t}))},filteredRoleGroups(){return this.indexedGroups.filter(({row:e})=>"RoleGroup"===e["@type"]&&this.rowMatchesSearch(e))},isRoleGroupsFilter(){return"role_groups"===this.filterFollow},canManageRoleGroups(){return this.isGranted("ADMIN_TENANT")&&!!this.tenant.settingFeatures.group?.hasRoleGroups},canCreateRoleGroup(){return this.canManageRoleGroups},filteredGeneralGroups(){return this.indexedGroups.filter(({row:e})=>"Group"===e["@type"]&&e.isJoinable&&!e.category&&this.rowMatchesSearch(e))},filteredPrivateGroups(){return this.indexedGroups.filter(({row:e})=>"Group"===e["@type"]&&!e.isJoinable&&!e.category&&this.rowMatchesSearch(e))},filteredArchivedGroups(){return this.archivedGroups.map((e,t)=>({row:e,index:t})).filter(({row:e})=>this.rowMatchesSearch(e))},filteredCategoryTotal(){return this.indexedGroups.filter(({row:e})=>e.category&&this.rowMatchesSearch(e)).length},renderedGroupCategories(){const e=new Map;for(const{row:s}of this.indexedGroups)s.category&&null!=s.category.id&&!e.has(s.category.id)&&e.set(s.category.id,s.category);const t=(this.tenant.groupCategories||[]).map(e=>e.id),i=e=>{const i=t.indexOf(e);return-1===i?Number.MAX_SAFE_INTEGER:i};return Array.from(e.values()).sort((e,t)=>i(e.id)-i(t.id))},hasNewGroupButton(){return!!this.isGranted(this.tenant.settingFeatures.group.whoCanCreate)&&!(this.tenant.settingFeatures.users.guestUserTypeId&&this.user.isGuest&&!this.isGranted("ADMIN_TENANT"))},showTenantCard(){return"archived"!==this.filterFollow&&("follow"===this.filterFollow?this.user.isFollowGeneralUnit:"no_follow"!==this.filterFollow||!this.user.isFollowGeneralUnit)},groupCounts(){const e=(this.groupsAll||[]).filter(e=>e&&"LocalCenter"!==e["@type"]),t=e.length,i=e.filter(e=>this.isAutoNotified(e)).length,s=e.filter(e=>!this.isAutoNotified(e)).length,o=this.archivedGroups.length,r=e.filter(e=>"RoleGroup"===e["@type"]).length;return{all:t,follow:i,no_follow:s,archived:o,role_groups:r}},isEmpty(){return 0===this.filteredRoleGroups.length&&0===this.filteredGeneralGroups.length&&0===this.filteredPrivateGroups.length&&0===this.filteredCategoryTotal&&0===this.filteredArchivedGroups.length&&!(this.showTenantCard&&this.tenantMatchesSearch)&&!(this.localCenter&&this.rowMatchesSearch(this.localCenter.item))},showSkeleton(){return this.isLoadingGroups&&0===this.groupsAll.length&&0===this.archivedGroups.length}},mounted(){"role_groups"===this.$route.query.filter&&this.canManageRoleGroups&&(this.filterFollow="role_groups"),this.getMyGroups(),"OnBoardingUser"!==this.$route.name&&this.fetchArchivedGroups()},methods:{stringToColour:Ee.ly,openCreateGroup(){return this.$router.push({name:"GroupCreate"})},toggleMobileSearch(){this.mobileSearchOpen=!this.mobileSearchOpen,this.mobileSearchOpen?this.$nextTick(()=>{this.$refs.mobileSearchInput?.focus()}):this.searchQuery=""},setFilter(e){this.filterFollow=e,this.listFilterFollow()},isAutoNotified(e){return!e.muted&&(e.following||e.includesAllMembers||"RoleGroup"===e["@type"])},rowMatchesSearch(e){if(!this.normalizedQuery)return!0;const t=(e.name||e.shortName||"").toLowerCase();return t.includes(this.normalizedQuery)},filteredByCategory(e){return this.indexedGroups.filter(({row:t})=>t.category&&t.category.id===e&&this.rowMatchesSearch(t))},listFilterFollow(){"archived"===this.filterFollow?this.groups=[]:"follow"===this.filterFollow?this.groups=this.groupsAll.filter(e=>this.isAutoNotified(e)):"no_follow"===this.filterFollow?this.groups=this.groupsAll.filter(e=>!this.isAutoNotified(e)):"role_groups"===this.filterFollow?this.groups=this.groupsAll.filter(e=>"RoleGroup"===e["@type"]):this.groups=this.groupsAll},openCreateRoleGroup(){return this.$router.push({name:"GroupCreate",query:{type:"role_group"}})},editRoleGroup(e){return this.$router.push({name:"GroupUpdate",params:{item:e.id},query:{type:"role_group"}})},updateFollow(e){null!=e.index&&(this.groups[e.index].following=e.data)},updateMute(e){null!=e.index&&(this.groups[e.index].muted=e.data)},joinUpdate(e){null!=e.index&&(this.groups[e.index].isJoined=e.groupId)},getMyGroups(){this.isLoadingGroups=!0,this.$http.plain.get("/my-groups").then(e=>{this.$store.commit("setTenantGroups",{slug:this.tenant.slug,groups:e.data["hydra:member"]}),this.getJoinableGroups()}).catch(e=>{console.error(e),this.isLoadingGroups=!1})},getJoinableGroups(){this.isLoadingGroups=!0,this.$http.plain.get("/groups?isJoinable=1&status=ACTIVE").then(e=>{let t=e.data["hydra:member"];t=t.map(e=>({...e,isJoined:this.$store.state.spaces[this.tenant.slug].myGroups.some(t=>t.id===e.id)}
1));for(const s of this.$store.state.spaces[this.tenant.slug].myGroups)"OnBoardingUser"===this.$route.name&&"CLOSED"===s.status||(s.isJoined=!0,t=[...t,s]);const i=new Map;t.forEach(e=>i.set(e.id,e)),this.groups=Array.from(i.values()),this.groupsAll=this.groups}).catch(e=>{console.error(e.message)}).finally(()=>{this.isLoadingGroups=!1})},fetchArchivedGroups(){this.isLoadingGroups=!0,Promise.all([this.$http.plain.get("/groups?status=CLOSED"),this.$http.plain.get("/role_groups?status=CLOSED")]).then(([e,t])=>{const i=e.data["hydra:member"]||[],s=t.data["hydra:member"]||[];this.archivedGroups=[...i,...s]}).catch(e=>{console.error(e)}).finally(()=>{this.isLoadingGroups=!1})},handleUnarchived(e){const t=this.archivedGroups.findIndex(t=>t.id===e.group.id);-1!==t&&this.archivedGroups.splice(t,1),this.getMyGroups()}}};const Oe=(0,xe.A)(ze,[["render",ne],["__scopeId","data-v-33b07eb9"]]);var Pe=Oe}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.