'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-ce58ddc5.js');
const dataApi = require('./dataApi-fbe22059.js');
const index$2 = require('./index-b2910095.js');
const index$1 = require('./index-4b96acc9.js');
const cookie = require('./cookie-ea977378.js');
const uye = require('./uye-39bd9aa4.js');
const env = require('./env-83ebcbc7.js');
require('./apiBase-b14a8285.js');
require('./data-transfer-field-0ce05c1a.js');
require('./BaseField-d019ade6.js');
require('./filter-d5040f65.js');
require('./kimlikApi-f4f62100.js');
require('./_commonjsHelpers-206db00d.js');
require('./utils-ac361312.js');
require('./User-e15e0b6d.js');
require('./data-model-9afb7f54.js');
require('./membership-310dd68e.js');
require('./table-config-73a193be.js');
require('./FieldModelGenerator-1af8e5c3.js');
require('./reference-field-dda66f2e.js');
require('./index-f92537c9.js');
require('./index-7e3bc620.js');
require('./date-25b104f6.js');
require('./index-9ea6c7b1.js');
require('./index-93271b8c.js');
require('./index-29b7cb16.js');
require('./index-792d710c.js');
require('./string-de672b69.js');
require('./app-config-cb7e78a4.js');
require('./spaces-4a775c20.js');
require('./ValidatorRegex-f7d85270.js');
require('./InterceptorHandler-09a1e84b.js');
require('./detail-view-config-ba51db6c.js');
require('./view-config-1c8cc7cb.js');
require('./index-fa185e3b.js');
require('./attachment-3090e25e.js');
require('./models-19fd9c92.js');
require('./ModifierTrimmer-1463d100.js');
require('./ValidatorLength-06e5c6f8.js');
require('./form-view-config-b408970d.js');
require('./actions-d7eabd95.js');
require('./instance-fba77445.js');
require('./nested-8980065f.js');
require('./index-c2c40444.js');
require('./list-fetch-state-a9e880b1.js');
require('./ValidatorEmail-4449f08a.js');
require('./table-list-view-config-f6ec7162.js');
require('./DvnDataAdapter-8f89f436.js');
require('./time-zones-5b212929.js');

let MentornityConsoleApp = class {
  constructor(hostRef) {
    index.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 (index$1.getSessionData().token) {
      defaultHeaders['Authorization'] = `Bearer ${index$1.getSessionData().token}`;
    }
    this.path = location.pathname;
    this.apiSozluk = new index$2.SozlukApi();
    this.storage = new cookie.CookieStorage();
    this.logger = new index$2.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 dataApi.DataApiImpl(env.dataApiEndpoint);
    this.apiKimlik = new uye.KimlikApiMentornity(env.mentornityApiEndpoint, defaultHeaders);
    this.apiUye = new uye.UyeApiMentornity(env.mentornityApiEndpoint, defaultHeaders);
    this.apiSozluk = new index$2.SozlukApi();
  }
  render() {
    return (index.h(index.Host, null, index.h("dvn-app-root", { apiAtama: this.apiAtama, apiData: this.apiData, apiKimlik: this.apiKimlik, apiSozluk: this.apiSozluk, apiUye: this.apiUye, navigate: this.navigate, path: this.path, logger: this.logger, storage: this.storage })));
  }
  static get assetsDirs() { return ["assets"]; }
};

exports.mentornity_console_app = MentornityConsoleApp;
