import {
  __decorateClass,
  __privateAdd,
  __privateGet
} from "../../chunks/chunk.QU3DSPNU.js";
var _GdsLink_instances, defaultRel_get;
import { nothing, unsafeCSS } from "lit";
import { property } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
import { html as staticHtml } from "lit/static-html.js";
import { GdsElement } from "../../gds-element.js";
import { gdsCustomElement } from "../../scoping.js";
import { tokens } from "../../tokens.style.js";
import { styleExpressionProperty } from "../../utils/decorators/style-expression-property.js";
import {
  withLayoutChildProps,
  withMarginProps,
  withSizeXProps
} from "../../utils/mixins/declarative-layout-mixins.js";
import { withLinkProps } from "../../utils/mixins/props-link.js";
import LinkStyles from "./link.styles.js";
let GdsLink = class extends withMarginProps(
  withSizeXProps(withLayoutChildProps(withLinkProps(GdsElement)))
) {
  constructor() {
    super(...arguments);
    __privateAdd(this, _GdsLink_instances);
    this.label = "";
  }
  connectedCallback() {
    super.connectedCallback();
    this.setAttribute("role", "none");
  }
  render() {
    return staticHtml`
      <a
        href=${ifDefined(this.href)}
        target=${ifDefined(this.target)}
        rel=${ifDefined(this.rel || __privateGet(this, _GdsLink_instances, defaultRel_get))}
        download=${ifDefined(this.download)}
        ping=${ifDefined(this.ping)}
        aria-label=${this.label || nothing}
      >
        <slot name="lead"></slot>
        <slot></slot>
        <slot name="trail"></slot>
      </a>
    `;
  }
};
_GdsLink_instances = new WeakSet();
defaultRel_get = function() {
  return this.target === "_blank" ? "noreferrer noopener" : void 0;
};
GdsLink.styles = [tokens, unsafeCSS(LinkStyles)];
GdsLink.shadowRootOptions = {
  mode: "open",
  delegatesFocus: true
};
__decorateClass([
  property()
], GdsLink.prototype, "label", 2);
__decorateClass([
  styleExpressionProperty({
    valueTemplate: (v) => v,
    selector: "a"
  })
], GdsLink.prototype, "text-decoration", 2);
GdsLink = __decorateClass([
  gdsCustomElement("gds-link")
], GdsLink);
export {
  GdsLink
};
