'use strict';

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

const index = require('./index-36b3af04.js');
const dataApi = require('./dataApi-4fa79a50.js');
const utils = require('./utils-d768590e.js');
const index$1 = require('./index-2efe9739.js');
const cookie = require('./cookie-370bc992.js');
const uye = require('./uye-12faf60b.js');
require('./kimlikApi-85c6d3ac.js');
require('./data-transfer-field-0ce05c1a.js');
require('./BaseField-d019ade6.js');
require('./filter-d5040f65.js');
require('./_commonjsHelpers-206db00d.js');
require('./User-286a0714.js');
require('./data-model-c51de090.js');
require('./membership-dfbf512e.js');
require('./membership-config-707b2c51.js');
require('./table-config-444a77e4.js');
require('./FieldModelGenerator-205dd99c.js');
require('./index-74a00556.js');
require('./index-a8f1783c.js');
require('./date-25b104f6.js');
require('./index-fe19a98b.js');
require('./index-ae305bae.js');
require('./string-de672b69.js');
require('./app-config-e62f5843.js');
require('./spaces-2fa9fa10.js');
require('./table-list-view-config-298c7662.js');
require('./index-d90390f1.js');
require('./attachment-3090e25e.js');
require('./InterceptorHandler-09a1e84b.js');
require('./view-config-ec5f62df.js');
require('./detail-view-config-594cc3b7.js');
require('./models-19fd9c92.js');
require('./form-view-config-51279874.js');
require('./ValidatorLength-06e5c6f8.js');
require('./actions-d7eabd95.js');
require('./instance-79d61640.js');
require('./list-fetch-state-7befe791.js');
require('./index-0cd3bcc0.js');
require('./nested-8980065f.js');
require('./time-zones-5b212929.js');

const 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.storage = new cookie.CookieStorage();
    this.logger = new utils.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(uye.dataApiEndpoint);
    this.apiKimlik = new uye.KimlikApiMentornity(uye.mentornityApiEndpoint, defaultHeaders);
    this.apiUye = new uye.UyeApiMentornity(uye.mentornityApiEndpoint, defaultHeaders);
  }
  render() {
    return (index.h(index.Host, null, index.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"]; }
};

exports.mentornity_console_app = MentornityConsoleApp;
