import{r as e,h as i,H as t}from"./p-cb5076d4.js";import{C as a}from"./p-1c06ab51.js";import"./p-06588791.js";import"./p-944da115.js";import"./p-d343a062.js";import{e as s,c as r,f as o}from"./p-c4bbdd1e.js";import{g as n,M as p}from"./p-9043df2a.js";import{a as m,g as d,c as l,d as c,e as f,m as g}from"./p-3a5f9c0f.js";import{T as u,I as v}from"./p-5b69721c.js";import{C as w}from"./p-92f3207e.js";import"./p-b0970d03.js";import{T as b}from"./p-0db2169b.js";import{I as j}from"./p-6cf8ecf7.js";import{A as y}from"./p-a2aae1b0.js";import{D as h}from"./p-2dde605b.js";import{T as I}from"./p-4f99fb23.js";import{A as C}from"./p-27da9105.js";import{T as _}from"./p-f455c3c2.js";import{d as T,e as k}from"./p-84720732.js";import{a as E}from"./p-234c1f97.js";import"./p-b3edc8b2.js";import"./p-814af281.js";import"./p-acad969c.js";import"./p-eebad85b.js";import"./p-0e4ae084.js";import"./p-8a308033.js";import"./p-3b35e507.js";import"./p-1c5c6afa.js";import"./p-97c18602.js";import"./p-d50d0ec8.js";import"./p-ecbaf6d8.js";import"./p-c705c477.js";import"./p-d27cb594.js";import"./p-56d4255d.js";import"./p-cb860bcb.js";import"./p-73aa5f56.js";import"./p-138d8bf9.js";import"./p-e929429b.js";function A(e,i,t,a){const r=[{ui:{componentTag:"mentornity-follow-button",name:"toggle-follow"},data:{mentornityCookieContext:e}}];return("mentor"===a?[s.allMentors,s.everyone].includes(i.conversationPermissions.mentee):[s.allMentees,s.everyone].includes(i.conversationPermissions.mentor))&&r.push({ui:{label:"Send Message",name:"send-message",view:"flat"}}),y.decode({views:[h.decode({_id:"user-detail-page-summary-card-view",type:C.DetailViewCard,table:I.decode({fields:[new b("name",""),new b("initials",""),new E("imageUrl","")],roleName:a,name:`${a}-detail-view`}),ui:{cardConfig:{header:{title:{fieldId:"name",position:u.RightOfImage},image:{fieldId:"imageUrl",placeholderFieldId:"initials",position:v.BottomLeft},cover:{size:88}},footer:{actions:r}}}}),M(e,0,i,a),_.decode({_id:"user-detail-page-available-time-picker-view",type:C.TakvimAvailableTimePickerView,table:n(i),events:{success:[new j("user-detail-page-available-time-picker-view","user-detail-page-meeting-list-view")]},successNavigationAction:{type:"navigation",direction:"forward",name:"open-meeting-detail-after-creation",params:{conversionConfig:{"item._id":"meetingId"}}}}),_.decode({_id:"user-detail-page-meeting-list-view",type:C.TakvimMeetingListViewTable,table:n(i)})]})}function M(e,i,t,a){if(!t)return null;const s=T(t,a,e.role),r=k(t,a,e.role,!0,3),o=k(t,a,e.role,!0,0);return h.decode({_id:"user-detail-page-info-view",type:C.DetailViewCard,table:I.decode({fields:s,roleName:a,name:`${a}-detail-view`}),ui:{summaryCardConfig:{body:{fields:r}},cardConfig:{body:{fields:o}}}})}function N(e,i,t){return w.decode({_id:"mentornity-user-detail-page",table:{name:"mentee"===t?"mentees":"mentors"},type:C.CompositeViewLinear,params:void 0,ui:{layout:"vertical",views:[{viewId:"user-detail-page-summary-card-view"},{title:"INFO",viewId:"user-detail-page-info-view"},{title:"GET MEETING",viewId:"user-detail-page-available-time-picker-view",params:{viewedUserMembershipConfig:m(t),conversionConfig:{item:"viewedUserMembership"}}},{title:"MEETINGS",viewId:"user-detail-page-meeting-list-view",params:{guest1Id:i||e,conversionConfig:{"item.user._id":"guest2Id"}}}]}})}const U=class{constructor(i){e(this,i)}componentWillLoad(){const{isZoomAuthenticated:e,language:i,timeFormat:t,timeZone:s}=this;a.setLocale(i),a.setTimeFormat(t),a.setTimeZone(s);const{context:n,headers:m}=d(this.groupId);this.mentornityCookieContext=n,this.user=l(n.userId),this.userSettings=c(t,s,i,e),this.membership=f(n.role),this.mentornityBridgeApi=new p(g,n,m),r(g,m).getOrganisationConfig(n.organisationId).then((e=>{this.organisationConfig=o.decode(e),this.mentornityBridgeApi.organisationConfig=o.decode(e)}))}onAction(e){const i=e.detail;switch(i.name){case"send-message":window.dispatchEvent(new CustomEvent("dvn.mentornity-user-detail-wrapper.send-message",{detail:{user:i.params.item}}));break;case"open-meeting-detail-after-creation":case"open-meeting-detail-from-meeting-list":window.dispatchEvent(new CustomEvent("dvn.mentornity-user-detail-wrapper.open-meeting-detail",{detail:{meetingId:i.params.meetingId}}))}}render(){const{groupId:e,language:a,membership:s,mentornityBridgeApi:r,mentornityCookieContext:o,organisationConfig:n,user:p,userSettings:m,viewedUserId:d,viewedUserRole:l}=this;return n?i(t,null,i("mentornity-root-wrapper",null,i("dvn-app-view-composite-view-linear",{apiData:r,apiTakvim:r,appConfig:A(o,n,0,l),params:{itemId:d},user:p,userSettings:m,membership:s,view:N(p._id,e,l)}))):i("div",{class:"d-flex justify-content-center pt-3"},i("dvn-progress",{indefinite:!0}))}};U.style="mentornity-user-detail-wrapper{display:block}";export{U as mentornity_user_detail_wrapper}