import { r as registerInstance, h, H as Host } from './index-b6f10a81.js';
import './index-ec7dc2ad.js';
import './InterceptorHandler-6474bcf4.js';
import './data-model-bb5789f5.js';
import './app-config-cf28072f.js';
import './BaseField-d94c5b14.js';
import './FieldModelGenerator-6ec60042.js';
import './date-b270be76.js';
import './index-94c1d7bf.js';
import './table-config-c0c15e50.js';
import './string-2d991277.js';
import './membership-config-856f6e58.js';
import './User-e14f1ece.js';
import './membership-093c8342.js';
import './_commonjsHelpers-63c253cd.js';
import './kimlikApi-81acfec6.js';
import './data-transfer-field-1ad95e08.js';
import './filter-cbaa3d7d.js';
import { D as DataApiImpl } from './dataApi-95bebee9.js';
import { C as CookieStorage } from './cookie-d9098150.js';
import { g as getSessionData } from './index-3a5c6fef.js';
import './models-ccfd4f3c.js';
import './index-44e741ab.js';
import './ValidatorLength-f56a7c14.js';
import './form-view-config-bb777190.js';
import './view-config-3ab16b28.js';
import './actions-b9a0f808.js';
import './list-fetch-state-8615484c.js';
import './attachment-8831acff.js';
import './instance-f50cdfd9.js';
import { L as Logger } from './utils-9344a2af.js';
import { d as dataApiEndpoint, K as KimlikApiMentornity, m as mentornityApiEndpoint, U as UyeApiMentornity } from './uye-f57c7c20.js';
import './spaces-ba2f2c63.js';
import './detail-view-config-6178fa2c.js';
import './index-47482faa.js';
import './table-list-view-config-80e66dd9.js';
import './nested-15d95467.js';

const MentornityConsoleApp = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.path = '/';
    this.navigate = (config) => {
      this.logger.debugGroup('navigate', {
        from: this.path,
        to: config.path,
      });
      this.path = config.path;
    };
  }
  componentWillLoad() {
    const defaultHeaders = {
      'Session-Token': 'NTdiMzY3NjBlNjNiY2UxZWViMDAwMDA0',
    };
    if (getSessionData().token) {
      defaultHeaders['Authorization'] = `Bearer ${getSessionData().token}`;
    }
    this.path = location.pathname;
    this.storage = new CookieStorage();
    this.logger = new Logger('MentornityConsoleApp').setLevel('debug');
    this.logger.infoGroup('componentWillLoad');
    // TODO these are also set in mentornity-console-app-context-injector. WFT? I'm too tired to refactor it now.
    // this.apiAtama = new AtamaApiImpl('', defaultHeaders);
    this.apiData = new DataApiImpl(dataApiEndpoint);
    this.apiKimlik = new KimlikApiMentornity(mentornityApiEndpoint, defaultHeaders);
    this.apiUye = new UyeApiMentornity(mentornityApiEndpoint, defaultHeaders);
  }
  render() {
    return (h(Host, null, h("dvn-app-root", { apiAtama: this.apiAtama, apiData: this.apiData, apiKimlik: this.apiKimlik, apiUye: this.apiUye, navigate: this.navigate, path: this.path, logger: this.logger, storage: this.storage })));
  }
  static get assetsDirs() { return ["assets"]; }
};

export { MentornityConsoleApp as mentornity_console_app };
