'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('./core-859ae5a6.js');

const Link = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this.hasAnchor = false;
        /**
         * If true, displays the element as block rather than inline
         */
        this.stacked = false;
    }
    componentDidLoad() {
        this.hasAnchor = this.element.firstElementChild && this.element.firstElementChild.tagName === 'A';
    }
    onKeyUp(event) {
        if (this.hasAnchor || event.key !== 'Enter')
            return;
        this.element.click();
    }
    render() {
        return core.h(core.Host, { tabindex: this.hasAnchor ? undefined : 0 });
    }
    get element() { return core.getElement(this); }
    static get style() { return "anj-link {\n  display: inline;\n  font-size: 0.875rem;\n  font-family: var(--anj-font-family);\n  font-weight: normal;\n  line-height: 1.5;\n  outline: none;\n  cursor: pointer;\n}\nanj-link, anj-link::before, anj-link::after {\n  -webkit-box-sizing: border-box;\n  box-sizing: border-box;\n  outline: none;\n}\nanj-link:focus, anj-link:active, anj-link *:focus, anj-link *:active {\n  outline: none;\n}\nanj-link[stacked] {\n  display: block;\n}\nanj-link,\nanj-link a {\n  color: var(--anj-link);\n  text-decoration: none;\n}\nanj-link:hover, anj-link:focus,\nanj-link a:focus,\nanj-link a:hover {\n  color: var(--anj-link-hover);\n  text-decoration: underline;\n  outline: none;\n}\nanj-link:hover anj-icon, anj-link:focus anj-icon,\nanj-link a:focus anj-icon,\nanj-link a:hover anj-icon {\n  text-decoration: none !important;\n}\nanj-link:active,\nanj-link a:active {\n  text-decoration: none;\n}\nanj-link anj-icon {\n  position: relative;\n  top: -1.5px;\n  vertical-align: middle;\n}\nanj-link anj-icon[slot=start] {\n  margin-right: 0.25rem;\n}\nanj-link anj-icon[slot=end] {\n  margin-left: 0.25rem;\n}"; }
};

exports.anj_link = Link;
