import { Component, Prop, State, Element, Host, h } from '@stencil/core';
export class TeliaCtaLink {
  constructor() {
    /** The CTA link size */
    this.size = 'md';
    /** The CTA link variant */
    this.variant = 'primary';
    /** Set cta link full width, link will take up the full width of its container */
    this.fullWidth = false;
    /** Internal state for styling purpose of the icon */
    this.emptySlot = false;
    /** Tracking id is used to identify and count Component usage */
    this.dataTrackingId = 'telia-cta-link';
  }
  componentWillLoad() {
    this.emptySlot = this.host.innerHTML !== '';
  }
  render() {
    return (h(Host, null,
      h("a", { class: {
          'telia-cta-link': true,
          [`telia-cta-link--${this.variant}`]: !!this.variant,
          ['telia-cta-link--full-width']: this.fullWidth,
          [`telia-cta-link--${this.size}`]: true,
          [`telia-cta-link--icon-only`]: !this.emptySlot,
        }, href: this.href, target: this.target, download: this.download, "referrer-policy": this.referrerPolicy, title: this.linkTitle },
        this.emptySlot && h("slot", null),
        h("telia-icon", Object.assign({}, (this.allyLabel ? { allyTitle: this.allyLabel } : {}), { name: "arrow-right", size: "sm" }))),
      h("telia-vst", { dataTrackingId: this.dataTrackingId })));
  }
  static get is() { return "telia-cta-link"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["telia-cta-link.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["telia-cta-link.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
    },
    "href": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "GetAttributeType<'a', 'href'>",
        "resolved": "string",
        "references": {
          "GetAttributeType": {
            "location": "import",
            "path": "../../types/GetAttributeType"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Native href attribute of anchor element"
      },
      "attribute": "href",
      "reflect": false
    },
    "target": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "GetAttributeType<'a', 'target'>",
        "resolved": "string",
        "references": {
          "GetAttributeType": {
            "location": "import",
            "path": "../../types/GetAttributeType"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": "Native target attribute of anchor element"
      },
      "attribute": "target",
      "reflect": false
    },
    "download": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "GetAttributeType<'a', 'download'>",
        "resolved": "any",
        "references": {
          "GetAttributeType": {
            "location": "import",
            "path": "../../types/GetAttributeType"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": "Native download attribute of anchor element"
      },
      "attribute": "download",
      "reflect": false
    },
    "referrerPolicy": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "ReferrerPolicy",
        "resolved": "\"\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\"",
        "references": {
          "ReferrerPolicy": {
            "location": "global"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": "Native referrerPolicy attribute of anchor element"
      },
      "attribute": "referrer-policy",
      "reflect": false
    },
    "linkTitle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": "The CTA link title attribute is shown on hover"
      },
      "attribute": "link-title",
      "reflect": false
    },
    "size": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "CtaLinkSizes",
        "resolved": "\"lg\" | \"md\" | \"sm\"",
        "references": {
          "CtaLinkSizes": {
            "location": "import",
            "path": "../../types/CtaLinkSizes"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The CTA link size"
      },
      "attribute": "size",
      "reflect": false,
      "defaultValue": "'md'"
    },
    "variant": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "CtaLinkVariantType",
        "resolved": "\"expressive\" | \"expressive-white\" | \"primary\" | \"primary-white\" | \"secondary\" | \"secondary-white\"",
        "references": {
          "CtaLinkVariantType": {
            "location": "import",
            "path": "../../types/CtaLinkVariant"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The CTA link variant"
      },
      "attribute": "variant",
      "reflect": false,
      "defaultValue": "'primary'"
    },
    "allyLabel": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": "For Icon accessibility, used only the icon shown without any text"
      },
      "attribute": "ally-label",
      "reflect": false
    },
    "fullWidth": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": "Set cta link full width, link will take up the full width of its container"
      },
      "attribute": "full-width",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
  static get states() { return {
    "emptySlot": {}
  }; }
  static get elementRef() { return "host"; }
}
