/*!
 * Copyright (c) what3words http://what3words.com
 */
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { D as DEFAULTS } from './constants.js';
import { d as defineCustomElement$2 } from './what3words-symbol2.js';

const what3wordsAddressCss = "what3words-address{display:inline-block;font-family:\"Source Sans Pro\", sans-serif}.what3words-address{color:#333;display:-ms-inline-flexbox;display:inline-flex;text-decoration:none;-ms-flex-direction:column;flex-direction:column}.what3words-address_container{display:-ms-flexbox;display:flex}.what3words-address_text{white-space:nowrap}.what3words-tooltip-container{height:0;width:0;position:relative;-ms-flex-item-align:center;align-self:center}.what3words-tooltip{position:absolute;display:none;width:160px;background-color:#333333;border-radius:3px;bottom:10px;left:-88px;font-size:12px;padding:8px;z-index:1;color:#ffffff;-webkit-box-shadow:0 0 16px rgba(0, 0, 0, 0.5);box-shadow:0 0 16px rgba(0, 0, 0, 0.5)}.what3words-address:hover .what3words-tooltip,.what3words-address_tooltip .what3words-tooltip{display:block}.what3words-tooltip:after{bottom:-13px;left:50%;content:\"\";height:0;width:0;position:absolute;border:7px solid transparent;margin-left:-7px;border-top-color:#333333;z-index:1}.what3words-tooltip:before{content:\"\";position:absolute;width:100%;height:10px;bottom:-10px;left:0}.what3words-tooltip a{color:#ffffff}";

const What3wordsAddress$1 = /*@__PURE__*/ proxyCustomElement(class What3wordsAddress extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.words = DEFAULTS.threeWordAddress;
        this.iconColor = DEFAULTS.iconColor;
        this.textColor = DEFAULTS.textColor;
        this.size = DEFAULTS.addressSize;
        this.target = DEFAULTS.target;
        this.link = DEFAULTS.true;
        this.tooltip = DEFAULTS.true;
        this.tooltipLocation = DEFAULTS.tooltipLocation;
        this.showTooltip = DEFAULTS.false;
    }
    render() {
        const url = `https://map.what3words.com/${this.words}`;
        const attributes = this.link ? { href: url, target: this.target } : {};
        return (h("span", Object.assign({ key: 'bfac3688aa7b212890a3eb635a4ac7b2a9d9ba24' }, attributes, { class: `what3words-address notranslate ${this.showTooltip ? "what3words-address_tooltip" : ""}`, style: { fontSize: `${this.size}px` } }), this.tooltip && (h("div", { key: '9d0bbf361183a9c8a519d829e143203637f12448', class: "what3words-tooltip-container" }, h("div", { key: '7042abee0d2174efa2be057a5c9a09e8e4507c8b', class: "what3words-tooltip" }, "what3words gives every 3m x 3m in the world a unique 3 word address. This one describes the precise ", this.tooltipLocation, ".", " "))), h("div", { key: 'dfeafbe02e6f5b71d710a44e6be2af7313739ba0', class: "what3words-address_container" }, h("what3words-symbol", { key: '53b8cefadf396a90a6eeda1cfdb33a909cbf1df8', size: this.size * 1.25, color: this.iconColor }), h("span", { key: 'e2320e38511358665f9d942fd3f129bc823c8e4d', class: "what3words-address_text", style: { color: this.textColor } }, this.words))));
    }
    static get style() { return what3wordsAddressCss; }
}, [0, "what3words-address", {
        "words": [1],
        "iconColor": [1, "icon-color"],
        "textColor": [1, "text-color"],
        "size": [2],
        "target": [1],
        "link": [4],
        "tooltip": [4],
        "tooltipLocation": [1, "tooltip-location"],
        "showTooltip": [4, "show-tooltip"]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["what3words-address", "what3words-symbol"];
    components.forEach(tagName => { switch (tagName) {
        case "what3words-address":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, What3wordsAddress$1);
            }
            break;
        case "what3words-symbol":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}
defineCustomElement$1();

const What3wordsAddress = What3wordsAddress$1;
const defineCustomElement = defineCustomElement$1;

export { What3wordsAddress, defineCustomElement };
