import{r as e,c as t,h as i,H as s,g as a}from"./p-9f21f85f.js";import{R as n,a as r}from"./p-0e460503.js";import"./p-5209de98.js";import"./p-1e47e7bd.js";import{R as o}from"./p-0563ceba.js";import{T as m}from"./p-968ee2ec.js";import{V as d}from"./p-2e3cec45.js";import{t as l}from"./p-f3a4e693.js";import{D as p}from"./p-825ab276.js";import{a as c}from"./p-19efc983.js";import"./p-31e77e7b.js";import"./p-105f7627.js";import"./p-7737f905.js";const f=class{constructor(i){e(this,i),this.action=t(this,"action",7),this.isProgressing=!0,this.strings=l,this.scrollToFit=!1,this.onSizeChange=e=>{this.size=e}}componentWillLoad(){this.uiHelper=new n(this.el,this.onSizeChange),this.size=n.getSize(this.el.parentElement.clientWidth)}componentDidLoad(){this.fetchMeetings()}async invalidate(e){this.meetings=void 0,this.error=void 0,this.fetchMeetings()}async fetchMeetings(){const{calendarConfigId:e,guestIDs:t}=this,i=await this.apiTakvim.getMeetingsOfUser(e,t).catch((e=>{this.error=e})).finally((()=>this.isProgressing=!1));i&&(this.meetings=i.results)}render(){const{meetings:e,size:t,strings:a,userSettings:n}=this;if(!e)return i(s,{class:"d-flex flex-grow-1 justify-content-center pt-3"},i("dvn-progress",{indefinite:!0}));const o=t<r.Small;return i(s,{class:"mb-3"},0===e.length?i("dvn-card",{elevation:0,leaned:!0},i("div",{class:"empty-message-container text-centered"},a.noItemInList)):i("dvn-list-view-table",{config:g(n,o),fields:h,items:e,isEndReached:!0,isProgressing:this.isProgressing,error:this.error?a.fetchingListFailed:void 0,onRetry:()=>this.fetchMeetings(),params:{},scrollToFit:this.scrollToFit}))}get el(){return a(this)}},h=[new p("startDate","Date").setDateFormat("DD MMM YYYY"),new o("guests","Guests","name","imageUrl","users",[new c("imageUrl"),new m("name","")],!1)],g=(e,t)=>{const{timeFormat:i,dateFormat:s}=e,a="12-hour"===i?"hh:mm A":"HH:mm",n=t?"DD/MM/YYYY"===s?"DD MMM":"MMM DD":"DD/MM/YYYY"===s?"DD MMMM YYYY, ddd":"MMMM DD YYYY, ddd",r=[{fieldId:"startDate",fieldDisplay:new p("startDate","Date").setDateFormat(n),timeZone:e.timeZone},{fieldId:"startHour",fieldDisplay:new p("startDate","Start").setDateFormat(a),timeZone:e.timeZone},{fieldId:"endHour",fieldDisplay:new p("endDate","End").setDateFormat(a),timeZone:e.timeZone}];return t||r.push({fieldId:"guests",imageShape:"circle"}),{hideHeader:!0,actionsWidth:t?48:64,actions:[{ui:{name:"open-meeting-detail-from-meeting-list",label:"Open",buttonType:"icon-button",iconName:"uil uil-arrow-right",view:"flat"},data:{type:"navigation",direction:"forward",placement:d.Page,viewId:"meeting-page",params:{conversionConfig:{"item._id":"meetingId"}}}}],fields:r,columns:{startHour:t?{weight:1}:{width:100},guests:{width:120}}}};f.style="takvim-meeting-list{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;overflow:hidden}takvim-meeting-list .progress-container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding-bottom:1rem}";export{f as takvim_meeting_list}