import { Component, Prop, h, Host } from '@stencil/core';
export class TeliaFooterLegal {
  constructor() {
    /** Tracking id is used to identify and count Component usage */
    this.dataTrackingId = 'telia-footer-legal';
    this.classname = 'telia-footer-legal';
  }
  getItems() {
    if (!this.items) {
      return;
    }
    let localItems;
    if (typeof this.items === 'object') {
      localItems = this.items;
    }
    else {
      localItems = JSON.parse(this.items);
    }
    return localItems.map(item => {
      return (h("li", { class: `${this.classname}__link` },
        h("telia-link", { href: item.href, variant: "text", "dark-background": true, "disable-visited": true }, item.name)));
    });
  }
  renderCopyrightNotice() {
    if (this.copyright) {
      return (h("div", { class: `${this.classname}__copyright-notice` }, this.copyright));
    }
    return;
  }
  render() {
    return (h(Host, { class: `${this.classname}`, "data-testid": this.dataTestid },
      h("telia-grid", { class: `${this.classname}__container` },
        h("telia-row", { class: `${this.classname}__content` },
          h("telia-col", { width: 12, "width-md": 6 },
            this.renderCopyrightNotice(),
            h("slot", { name: "contacts" })),
          h("telia-col", { width: 12, "width-md": 6 },
            h("slot", { name: "additional" }),
            h("telia-list", { class: `${this.classname}__links`, "list-tag": "ul", variant: "row" }, this.getItems())))),
      h("telia-vst", { dataTrackingId: this.dataTrackingId })));
  }
  static get is() { return "telia-footer-legal"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["telia-footer-legal.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["telia-footer-legal.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
    },
    "copyright": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "A copyright notice. Displayed on its own line\nif viewport is less than medium."
      },
      "attribute": "copyright",
      "reflect": false
    },
    "items": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "Link[] | string",
        "resolved": "Link[] | string",
        "references": {
          "Link": {
            "location": "import",
            "path": "../../types/Link"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "List of items to be displayed. These will be displayed\nafter the copyright notice, if that is supplied. If passed as\nstring, must parse into an array of Link via JSON.parse()."
      },
      "attribute": "items",
      "reflect": false
    }
  }; }
}
