import {
  __decorateClass
} from "../../../chunks/chunk.QU3DSPNU.js";
import { property } from "lit/decorators.js";
import { GdsElement } from "../../../gds-element.js";
import { gdsCustomElement, html } from "../../../scoping.js";
import { tokens } from "../../../tokens.style.js";
import { TransitionalStyles } from "../../../transitional-styles.js";
import { withSizeXProps } from "../../../utils/mixins/declarative-layout-mixins.js";
import SegmentStyles from "./segment.styles.js";
let GdsSegment = class extends withSizeXProps(GdsElement) {
  constructor() {
    super(...arguments);
    this.selected = false;
    this.disabled = false;
    // This is deliberatly not marked as private, since we're setting it from the parent component,
    // but it is not meant to be set by the consumer.
    this._isVisible = true;
  }
  /**
   * Whether the segment is currently visible.
   */
  get isVisible() {
    return this._isVisible;
  }
  connectedCallback() {
    super.connectedCallback();
    TransitionalStyles.instance.apply(this, "gds-segmented");
    this.setAttribute("role", "listitem");
  }
  render() {
    return html`<button
      aria-current=${String(this.selected)}
      ?disabled="${this.disabled}"
    >
      <slot></slot>
    </button>`;
  }
};
GdsSegment.styles = [...tokens, SegmentStyles];
__decorateClass([
  property({ type: Boolean, reflect: true })
], GdsSegment.prototype, "selected", 2);
__decorateClass([
  property()
], GdsSegment.prototype, "value", 2);
__decorateClass([
  property({ type: Boolean, reflect: true })
], GdsSegment.prototype, "disabled", 2);
GdsSegment = __decorateClass([
  gdsCustomElement("gds-segment")
], GdsSegment);
export {
  GdsSegment
};
