import { r as registerInstance, h, H as Host } from './index-ecdfb761.js';
import { p as prod } from './services-63217112.js';
import { D as DamgaApi } from './damga-api-8617d0af.js';
import { A as APIBase } from './apiBase-6015f41f.js';
import './data-transfer-field-2f305919.js';
import './BaseField-0b01dc2c.js';
import './filter-cbaa3d7d.js';

class DasDamgaApi {
  constructor(endpoint, defaultHeaders = {}, defaultQueryParams = {}) {
    // region proxy analyses
    this.getProxyAnalyses = (domains, startDate, endDate, timeInterval) => this.api.get(`analyses`, { domains: domains.join(','), startDate, endDate, timeInterval });
    // endregion
    // region logs
    this.getLogs = (domain, startDate, endDate) => this.api.get(`logs`, { domain, startDate, endDate });
    this.api = new APIBase(endpoint, defaultHeaders);
    this.api.axios.defaults.params = defaultQueryParams;
  }
}

const DevingenProductRootDamga = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  render() {
    const { apiKimlik, product } = this;
    return (h(Host, { class: "d-flex flex-grow-1 flex-column" }, h("damga-home", { apiEndpoint: prod.damga, apiHeaders: {
        Authorization: apiKimlik.api.getDefaults().headers['Authorization'],
        'devingen-product-id': product._id,
      }, extraTabs: [
        {
          key: 'dashboard',
          label: 'Dashboard',
          render: () => h("damga-dashboard", { apiDamga: new DamgaApi(prod.damga, {
              Authorization: apiKimlik.api.getDefaults().headers['Authorization'],
              'devingen-product-id': product._id,
            }, { productId: product._id }), apiServicesDamga: new DasDamgaApi(prod.dasDamga, { Authorization: apiKimlik.api.getDefaults().headers['Authorization'] }, { productId: product._id }) })
        },
        // {
        //   key: 'logs',
        //   label: 'Logs',
        //   render: () => <damga-domain-logs
        //     apiDamga={
        //       new DamgaApi(
        //         services.damga,
        //         { Authorization: (apiKimlik as any).api.getDefaults().headers['Authorization'] },
        //         { productId: product._id },
        //       )
        //     }
        //     apiServicesDamga={
        //       new DasDamgaApi(
        //         services.dasDamga,
        //         { Authorization: (apiKimlik as any).api.getDefaults().headers['Authorization'] },
        //         { productId: product._id },
        //       )
        //     }
        //   />
        // },
      ] })));
  }
};

export { DevingenProductRootDamga as devingen_product_root_damga };
