import { r as registerInstance, h, H as Host } from './index-ecdfb761.js';
import { T as TakvimAvailabilitySettingsViewConfig } from './takvim-availability-settings-view-config-b5250074.js';
import { b as generateMentornitySessionContext } from './session-a602596d.js';
import './pair-config-1713abb7.js';
import './table-config-3820fb34.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 './view-config-2fc2ba10.js';
import './membership-24db029a.js';
import './string-3065a411.js';
import './User-9f1f4513.js';
import './UserSettings-27df01e6.js';
import './cookie-9f22e0fb.js';
import './kimlik-api-66e341bd.js';
import './apiBase-648a161d.js';
import './data-transfer-field-2f305919.js';
import './filter-cbaa3d7d.js';
import './_commonjsHelpers-27f122dd.js';
import './index-d3bd30bd.js';
import './instance-db63ecb7.js';
import './mentorinty-bridge-api-f70621dd.js';
import './index-5f14b4fc.js';
import './attachment-d13ad547.js';
import './CalendarConfig-f8d4a70d.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';

const MentornityAvailabilitySettingsWrapper = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  componentWillLoad() {
    const { contextParams, extraProps } = this;
    const contextParamsToUse = Object.assign({}, contextParams);
    if (extraProps === null || extraProps === void 0 ? void 0 : extraProps.userIdToManageAvailabilitiesOf) {
      contextParamsToUse.userId = extraProps.userIdToManageAvailabilitiesOf;
    }
    // fetch the context async to unblock the component render
    generateMentornitySessionContext(contextParamsToUse, { fetchMentorship: true })
      .then((mentornitySessionContext) => {
      this.mentornitySessionContext = mentornitySessionContext;
      this.view = TakvimAvailabilitySettingsViewConfig.decode({
        i18nEntryId: 'availability-settings-view',
      });
    })
      .catch(error => this.error = error);
  }
  render() {
    const { error, mentornitySessionContext, view } = this;
    if (!!error) {
      return (h("dvn-card", { leanedSides: true, tint: "danger" }, "Failed to get data."));
    }
    if (!mentornitySessionContext) {
      return (h("div", { class: "d-flex justify-content-center pt-3" }, h("dvn-progress", { indefinite: true })));
    }
    const { apiSozluk, mentornityBridgeApi, user, userSettings } = mentornitySessionContext;
    return (h(Host, { class: "d-flex flex-column flex-grow-1", style: { overflow: 'hidden', width: '100%' } }, h("dvn-app-view-takvim-availability-settings-view", { apiSozluk: apiSozluk, apiTakvim: mentornityBridgeApi, view: view, user: user, userSettings: userSettings })));
  }
};

export { MentornityAvailabilitySettingsWrapper as mentornity_availability_settings_wrapper };
