function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_apply_descriptor_get(receiver, descriptor) {
    if (descriptor.get) {
        return descriptor.get.call(receiver);
    }
    return descriptor.value;
}
function _class_apply_descriptor_set(receiver, descriptor, value) {
    if (descriptor.set) {
        descriptor.set.call(receiver, value);
    } else {
        if (!descriptor.writable) {
            throw new TypeError("attempted to set read only private field");
        }
        descriptor.value = value;
    }
}
function _class_extract_field_descriptor(receiver, privateMap, action) {
    if (!privateMap.has(receiver)) {
        throw new TypeError("attempted to " + action + " private field on non-instance");
    }
    return privateMap.get(receiver);
}
function _class_private_field_get(receiver, privateMap) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
    return _class_apply_descriptor_get(receiver, descriptor);
}
function _class_private_field_init(obj, privateMap, value) {
    _check_private_redeclaration(obj, privateMap);
    privateMap.set(obj, value);
}
function _class_private_field_set(receiver, privateMap, value) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
    _class_apply_descriptor_set(receiver, descriptor, value);
    return value;
}
import { clone, extend } from '../../../helpers/object.mjs';
import { BaseUI } from './_base.mjs';
var /**
   * The reference to the link element.
   *
   * @type {HTMLLinkElement}
   */ _link = /*#__PURE__*/ new WeakMap();
/**
 * @private
 * @class LinkUI
 */ export class LinkUI extends BaseUI {
    static get DEFAULTS() {
        return clone({
            href: '#',
            tagName: 'a',
            tabIndex: -1,
            role: 'button'
        });
    }
    /**
   * Build DOM structure.
   */ build() {
        super.build();
        _class_private_field_set(this, _link, this._element.firstChild);
    }
    /**
   * Update element.
   */ update() {
        if (!this.isBuilt()) {
            return;
        }
        _class_private_field_get(this, _link).textContent = this.translateIfPossible(this.options.textContent);
    }
    /**
   * Focus element.
   */ focus() {
        if (this.isBuilt()) {
            _class_private_field_get(this, _link).focus();
        }
    }
    /**
   * Activate the element.
   */ activate() {
        _class_private_field_get(this, _link).click();
    }
    constructor(hotInstance, options){
        super(hotInstance, extend(LinkUI.DEFAULTS, options)), _class_private_field_init(this, _link, {
            writable: true,
            value: void 0
        });
    }
}
