import { Component, Prop, h, Host } from '@stencil/core';
import { LogoVariant } from '../../types/LogoVariant';
export class TeliaLogo {
  constructor() {
    /**
     * [DEPRECATED: 2022-05-10]: Use `variant='secondary'` instead.
     */
    this.darkBackground = false;
    /**
     * The variant/appearance of the logo.
     */
    this.variant = LogoVariant.PRIMARY;
    this.componentClass = 'telia-logo';
    this.assetServer = 'https://cdn.voca.teliacompany.com/logo/';
    this.logoAsset = {
      [LogoVariant.PRIMARY]: 'Telia-primary-default-v2.svg',
      [LogoVariant.PRIMARY_SYMBOL]: 'Telia-primary-symbol-only-v2.svg',
      [LogoVariant.SECONDARY]: 'Telia-secondary-default-v2.svg',
      [LogoVariant.SECONDARY_SYMBOL]: 'Telia-secondary-symbol-only-v2.svg',
      [LogoVariant.BLACK]: 'Telia-black-default-v2.svg',
      [LogoVariant.BLACK_SYMBOL]: 'Telia-black-symbol-only-v2.svg',
    };
    /** Tracking id is used to identify and count Component usage */
    this.dataTrackingId = 'telia-logo';
  }
  getLogoSource() {
    let resource = '';
    if (this.darkBackground) {
      resource = this.logoAsset[LogoVariant.SECONDARY];
    }
    else {
      resource = this.logoAsset[this.variant];
    }
    return this.assetServer.concat(resource);
  }
  render() {
    return (h(Host, { class: this.componentClass },
      h("telia-vst", { dataTrackingId: this.dataTrackingId }),
      h("img", { alt: this.imgAlt, class: this.componentClass.concat('__image'), src: this.getLogoSource(), role: "img" })));
  }
  static get is() { return "telia-logo"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["telia-logo.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["telia-logo.css"]
  }; }
  static get properties() { return {
    "dataTestid": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Test id set for web component host"
      },
      "attribute": "data-testid",
      "reflect": false
    },
    "darkBackground": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "[DEPRECATED: 2022-05-10]: Use `variant='secondary'` instead."
      },
      "attribute": "dark-background",
      "reflect": false,
      "defaultValue": "false"
    },
    "imgAlt": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Text that describes the logo in its context\ni.e. \"Telia logotype\" or similar."
      },
      "attribute": "img-alt",
      "reflect": false
    },
    "variant": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "LogoVariantType",
        "resolved": "\"black\" | \"black-symbol\" | \"primary\" | \"primary-symbol\" | \"secondary\" | \"secondary-symbol\"",
        "references": {
          "LogoVariantType": {
            "location": "import",
            "path": "../../types/LogoVariant"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The variant/appearance of the logo."
      },
      "attribute": "variant",
      "reflect": false,
      "defaultValue": "LogoVariant.PRIMARY"
    }
  }; }
}
