import{r as t,h as i,H as e,g as s}from"./p-9f21f85f.js";import{C as r}from"./p-0988b316.js";import{U as o}from"./p-902ec37a.js";import{S as a}from"./p-c2c9e896.js";import"./p-e78d5616.js";import"./p-3968aca6.js";import"./p-d343a062.js";import{c as p,b as n}from"./p-a3d5ad34.js";import{M as m}from"./p-2c9430cc.js";import{h as d,i as c,j as l,s as j,g as f,k as h,a as w,c as u}from"./p-f88474bf.js";import{a as b,b as v}from"./p-c26b0b5f.js";import"./p-65eb3f89.js";import"./p-814af281.js";import"./p-42939000.js";import"./p-7737f905.js";import"./p-105f7627.js";import"./p-62d6b6a7.js";import"./p-0563ceba.js";import"./p-1e47e7bd.js";import"./p-31e77e7b.js";import"./p-825ab276.js";import"./p-6c8be41c.js";import"./p-9f31253b.js";import"./p-1187cc7c.js";import"./p-881a2bb8.js";import"./p-968ee2ec.js";import"./p-5209de98.js";import"./p-19efc983.js";import"./p-3c7a3a90.js";import"./p-0ff0ee91.js";import"./p-d27cb594.js";import"./p-e7d62c6a.js";import"./p-74e6e642.js";import"./p-84876749.js";import"./p-03b520ca.js";import"./p-e929429b.js";import"./p-67d3bdb0.js";import"./p-1ba76ce7.js";import"./p-0c34d1b7.js";import"./p-6af4d5e0.js";import"./p-efd6f539.js";import"./p-12a14b28.js";import"./p-26046226.js";import"./p-bea38b23.js";const g=class{constructor(i){t(this,i),this.weekStartDay="monday"}async componentWillLoad(){const{isZoomAuthenticated:t,language:i,timeFormat:e,dateFormat:s,timeZone:g,viewedUserRole:y,weekStartDay:k}=this;switch(r.setTimeFormat(e),r.setTimeZone(g),r.setDateFormat(s),i){case"pt-br":r.setLocale(i,l,k);break;case"tr":r.setLocale(i,c,k);break;default:r.setLocale(i,d,k)}this.apiSozluk=(new a).setLanguage(i).setContents(j);const{context:C,headers:D}=f(this.groupId);this.mentornityCookieContext=C,this.userSettings=h(e,s,g,i,t,k),this.mentornityBridgeApi=new m(w,C,D);const x=p(w,D),S=await x.get("users",C.userId).catch((t=>this.error=t));if(!S)return;this.user=o.decode(S);const A=await x.getOrganisationConfig(C.organisationId).catch((t=>this.error=t));if(!A)return;if(this.membership=u("mentee"===C.role&&"group"===A.menteeType?"group":C.role),this.guestToPassToAvailableTimePickerAsCurrentUser=this.user,"mentee"===C.role&&"group"===A.menteeType)if(C.groupId){const t=await x.getGroup(C.groupId).catch((t=>this.error=t));t&&(this.guestToPassToAvailableTimePickerAsCurrentUser=Object.assign(Object.assign({},t),{name:t.title,initials:t.title[0]}))}else this.guestToPassToAvailableTimePickerAsCurrentUser=void 0;const z=n.decode(A);this.organisationConfig=z,this.mentornityBridgeApi.organisationConfig=z,this.userCardListViewConfig=b(C,i,z,y,{mentornityBridgeApi:this.mentornityBridgeApi,apiSozluk:this.apiSozluk,guestToPassToAvailableTimePickerAsCurrentUser:this.guestToPassToAvailableTimePickerAsCurrentUser,userSettings:this.userSettings,membership:this.membership}),this.userDetailDialogViewConfig=v(C,i,z,y)}componentDidRender(){var t,i;null===(i=null===(t=this.el.querySelector("dvn-app-view-list-view-card"))||void 0===t?void 0:t.retainPosition)||void 0===i||i.call(t)}onAction(t){const i=t.detail;switch(i.name){case"view-details":this.userToViewDetails=i.params.item;break;case"go-to-profile-page":window.dispatchEvent(new CustomEvent("dvn.mentornity-user-card-list-wrapper.open-profile-page",{detail:{user:i.params.item}}));break;case"open-meeting-detail-after-creation":window.dispatchEvent(new CustomEvent("dvn.mentornity-user-card-list-wrapper.open-meeting-page",{detail:{meetingId:i.params.meetingId}}))}}render(){const{apiSozluk:t,mentornityBridgeApi:s,userCardListViewConfig:r,userToViewDetails:o,userDetailDialogViewConfig:a}=this;return r?i(e,{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"}},i("mentornity-root-wrapper",null,i("div",{style:{display:"flex",overflow:"hidden",flexDirection:"column"}},this.alertMessage&&i("dvn-alert",{tint:"warning",message:this.alertMessage,extraClass:"mt-3 ml-3 mr-3"},i("dvn-card-footer",{slot:"footer","align-right":!0},i("dvn-button",{leaned:!0,tint:"secondary",view:"flat",onClick:()=>window.dispatchEvent(new CustomEvent("dvn.mentornity-user-card-list-wrapper.alert-message-click"))},this.alertActionLabel))),i("dvn-app-view-list-view-card",{apiData:s,apiSozluk:t,view:r})),o&&i("dvn-dialog",{raw:!0,shown:!0,onDismiss:()=>this.userToViewDetails=void 0},i("dvn-app-view-detail-view-card",{apiData:s,apiSozluk:t,id:"user-page",params:{itemId:o._id},view:a})))):i("div",{class:"d-flex justify-content-center pt-3"},i("dvn-progress",{indefinite:!0}))}get el(){return s(this)}};export{g as mentornity_user_card_list_wrapper}