var __extends=this&&this.__extends||function(){var e=function(i,t){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var t in i)if(Object.prototype.hasOwnProperty.call(i,t))e[t]=i[t]};return e(i,t)};return function(i,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(i,t);function n(){this.constructor=i}i.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();import{r as registerInstance,h,H as Host}from"./index-ecdfb761.js";import{T as TakvimAvailableTimePickerViewConfig}from"./takvim-available-time-picker-view-config-051fa55b.js";import{T as TableConfig}from"./table-config-3820fb34.js";import{D as DvnAppViewConfig}from"./view-config-2fc2ba10.js";import{g as generateCalendarConfig}from"./mentorinty-bridge-api-f70621dd.js";import{b as generateMentornitySessionContext,c as generateMembershipForRole}from"./session-a602596d.js";import"./FieldModelGenerator-03c7516c.js";import"./reference-field-a5b414d1.js";import"./BaseField-0b01dc2c.js";import"./index-61dcd269.js";import"./FieldGenerator-3ae403b2.js";import"./date-1bc489bd.js";import"./index-4e451db4.js";import"./index-32d8b974.js";import"./index-23baeeef.js";import"./index-09efdc01.js";import"./index-150b6a59.js";import"./data-model-f7ccf826.js";import"./apiBase-648a161d.js";import"./data-transfer-field-2f305919.js";import"./filter-cbaa3d7d.js";import"./index-5f14b4fc.js";import"./attachment-d13ad547.js";import"./membership-24db029a.js";import"./string-3065a411.js";import"./User-9f1f4513.js";import"./CalendarConfig-f8d4a70d.js";import"./UserSettings-27df01e6.js";import"./cookie-9f22e0fb.js";import"./kimlik-api-66e341bd.js";import"./_commonjsHelpers-27f122dd.js";import"./index-d3bd30bd.js";import"./instance-db63ecb7.js";import"./index-3bf9b308.js";import"./i18n-4dcb85fe.js";import"./i18n-73c2e20d.js";import"./calendar-470c802a.js";import"./index-a3ca021c.js";import"./moment-65eca6b3.js";var TakvimDailyCalendarViewConfig=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.decode=function(e){var t=Object.assign(Object.create(i.prototype),e);t.table=TableConfig.decode(t.table);return t};return i}(DvnAppViewConfig);var MentornityHomeMessageWrapper=function(){function e(e){registerInstance(this,e)}e.prototype.componentWillLoad=function(){var e=this;generateMentornitySessionContext(this.contextParams,{fetchConfig:true}).then((function(i){e.mentornitySessionContext=i;e.view=generateView(i);e.membership=generateMembershipForRole("admin")})).catch((function(i){return e.error=i}))};e.prototype.onViewMeeting=function(e){window.dispatchEvent(new CustomEvent("dvn.mentornity-admin-calendar-view.open-meeting-page",{detail:{meetingId:e.detail._id}}))};e.prototype.onAction=function(e){var i=e.detail;switch(i.name){case"open-meeting-detail-after-creation":window.dispatchEvent(new CustomEvent("dvn.mentornity-admin-calendar-view.open-meeting-page",{detail:{meetingId:i.params.meetingId}}));break}};e.prototype.render=function(){var e=this,i=e.error,t=e.mentornitySessionContext,n=e.view;if(!!i){return h("dvn-card",{leanedSides:true,tint:"danger"},"Failed to get data.")}if(!t){return h("div",{class:"d-flex justify-content-center pt-3"},h("dvn-progress",{indefinite:true}))}return h(Host,{class:"d-flex flex-grow-1",style:{overflow:"hidden",background:"var(--color-background-primary)"}},h("mentornity-root-wrapper",null,h("dvn-app-view-takvim-daily-calendar-view",{apiData:this.mentornitySessionContext.mentornityBridgeApi,apiSozluk:this.mentornitySessionContext.apiSozluk,apiTakvim:this.mentornitySessionContext.mentornityBridgeApi,user:this.mentornitySessionContext.user,userSettings:this.mentornitySessionContext.userSettings,membership:this.membership,view:n})))};return e}();function generateView(e){var i="mentors";var t="mentees";if(e.organisationConfig.menteeType==="group"){t="groups"}return TakvimDailyCalendarViewConfig.decode({i18nEntryId:"dailyCalendarView",table:generateCalendarConfig(e.organisationConfig),membershipConfigIdToGroupMeetings:i,membershipConfigIdToViewOnMeetings:t,availableTimePickerConfig:TakvimAvailableTimePickerViewConfig.decode({_id:"admin-calendar-page-available-time-picker-view-wrapper",i18nEntryId:"user-card-list-page-available-time-picker-view",table:generateCalendarConfig(e.organisationConfig),successNavigationAction:{type:"navigation",direction:"forward",name:"open-meeting-detail-after-creation",params:{conversionConfig:{"item._id":"meetingId"}}}})})}export{MentornityHomeMessageWrapper as mentornity_admin_calendar_view};