import{r as e,c as i,h as t,H as n}from"./p-9f21f85f.js";import{a as s}from"./p-0e460503.js";const a=class{constructor(t){e(this,t),this.action=i(this,"action",7),this.meetingsByIdentifiers={}}async invalidate(e){this.fetchMeetings()}componentDidLoad(){this.fetchMeetings()}async fetchMeetings(){var e;const{pairConfig:i,userId:t,sessionUserId:n}=this,s=await this.apiTakvim.getMeetingsOfUser(null===(e=i.calendarConfig)||void 0===e?void 0:e._id,[n,t]),a={};s.results.forEach((e=>{a[e.meetingType]=e})),this.meetingsByIdentifiers=a}render(){const{shownMeetingConfig:e,size:i,userRefFieldId:a}=this;return t(n,{class:"mb-3"},i<s.Medium?this.renderList():t("dvn-card",{leaned:!0,bodyLeaned:!0,elevation:0},this.renderList()),t("dvn-dialog",{title:e?e.name:void 0,shown:!!e,onDismiss:()=>this.shownMeetingConfig=void 0},e&&t("dvn-markdown",{content:e.specifications[a].description})))}renderList(){const{i18n:e,meetingsByIdentifiers:i,pairConfig:n,size:a}=this,o=a<s.Medium?"atama-structured-pair-overview-meeting-row-intense":"atama-structured-pair-overview-meeting-row";return n.structure.meetingConfigs.map(((s,a)=>{const r=n.structure.meetingConfigs.length>a+2&&n.structure.meetingConfigs[a+1];return t(o,{i18n:e,meeting:i[s.id],meetingConfig:s,meetingOrder:a+1,nextCompleted:r&&!!i[r.id],onCreateMeeting:e=>this.action.emit({name:"create-meeting-with-config-only",data:{meetingConfig:e}}),onShowMeetingDetail:e=>{this.action.emit({name:"open-meeting-detail",data:{meeting:e}})},onShowMeetingConfigDetail:e=>{this.shownMeetingConfig=e}})}))}};a.style="atama-structured-pair-overview{display:block}";export{a as atama_structured_pair_overview}