import { Component, h, Host, Prop, State } from '@stencil/core';
const damgaProxyIPs = {
  '18.192.241.137': 'eu-central-2.damga.devingen.io',
  '52.29.141.76': 'eu-central-1a.damga.devingen.io',
};
export class DamgaDnsRecord {
  async componentWillLoad() {
    // const jwt = new CookieStorage().getAll().jwt;
    // const headers = {
    //   Authorization: jwt ? `Bearer ${new CookieStorage().getAll().jwt}` : undefined,
    // };
    // const dnsRecord = await new DamgaApi(`${services.damga}/${services.base}`, headers)
    //   .getDnsRecord(this.item.domain).catch(e => {
    //     console.log('Getting dns record failed', e);
    //   });
    // if (!dnsRecord) return;
    // this.dnsRecord = dnsRecord;
  }
  render() {
    var _a, _b;
    return (h(Host, null, damgaProxyIPs[(_a = this.dnsRecord) === null || _a === void 0 ? void 0 : _a.record] || ((_b = this.dnsRecord) === null || _b === void 0 ? void 0 : _b.record) || '-'));
  }
  static get is() { return "damga-dns-record"; }
  static get originalStyleUrls() { return {
    "$": ["damga-dns-record.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["damga-dns-record.css"]
  }; }
  static get properties() { return {
    "item": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "DataModel",
        "resolved": "DataModel",
        "references": {
          "DataModel": {
            "location": "import",
            "path": "@dvn/core/models/data-model"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
  static get states() { return {
    "dnsRecord": {}
  }; }
}
