import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-090d31ca.js';
import { s as sanitizeVegaComponent } from './component-7d906393.js';
import { c as MapToComponentField, M as MapToComponentMethod, V as VegaSlimmer, I as InjectVegaSlimmer } from './global-slimmer-registry-17c4efd4.js';
import { V as VegaComponentUsageRuntimeMetricsSlimmer, I as InjectVegaGlobalSlimmer } from './component-usage-runtime-metrics-4b1afd04.js';
import { c as createSubStateNotifySlimmer } from './sub-state-notify-slimmer-80ac7dee.js';
import { c as createEventEmitSlimmer } from './event-emit-slimmer-697ad0b7.js';
import { a as VegaClick, V as VegaDropdownClick } from './vega-event-id-578c6c6d.js';
import { C as ChildNodesEventPreventSlimmer } from './child-nodes-event-prevent-slimmer-0a406a71.js';
import { D as DomNodeSubjectObserverFactory, d as domNodeSubjectFactory } from './dom-node-subject-observer-factory-3897e95b.js';
import { E as VegaInternalButtonGroupClick } from './vega-internal-event-id-913e8be6.js';
import { M as MutationObserverSlimmer } from './mutation-observer-slimmer-58ebc13c.js';
import { a as TagNameAndAttributeMutationFilter } from './mutation-observer-filters-1a054fb0.js';
import { S as SubStateObserverSlimmer } from './sub-state-observer-slimmer-81538a8c.js';
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
import { f as findParent } from './ui-64815a12.js';
import './dynamic-slimmer-90b8af32.js';
import './observer-3959f9dd.js';
import './internal-vega-event-manager-1ac5ee9a.js';
import './try-get-document-bef0f526.js';
import './vega-env-manager-8f8dc473.js';
import './feature-flag-controller-5ebc0cec.js';
import './index-9c9865c0.js';
import './array-7888f339.js';
import './number-4398f2e1.js';

var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/** The `VegaButtonGroupClickController` class is responsible for adding and removing observers for button group click events in a Vega component. */
class VegaButtonGroupClickController extends VegaSlimmer {
  /**
   * Add group node subject observer
   */
  registerGroupClickObserver() {
    DomNodeSubjectObserverFactory.addUniqueObserverToNode(this.host, VegaInternalButtonGroupClick, (payload) => {
      this.clickEventEmitter.emit(payload.detail);
    });
  }
  /**
   * Remove the group node subject observer
   */
  unregisterGroupClickObserver() {
    DomNodeSubjectObserverFactory.removeUniqueObserverFromNode(this.host, VegaInternalButtonGroupClick);
  }
}
__decorate$5([
  MapToComponentField()
], VegaButtonGroupClickController.prototype, "host", void 0);
__decorate$5([
  MapToComponentField()
], VegaButtonGroupClickController.prototype, "clickEventEmitter", void 0);
__decorate$5([
  MapToComponentMethod('connectedCallback')
], VegaButtonGroupClickController.prototype, "registerGroupClickObserver", null);
__decorate$5([
  MapToComponentMethod('disconnectedCallback')
], VegaButtonGroupClickController.prototype, "unregisterGroupClickObserver", null);

var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/** The `VegaButtonGroupAllItemsDisabledController` class monitors child button group items' disabled state and computes whether all items are disabled. */
class VegaButtonGroupAllItemsDisabledController extends VegaSlimmer {
  constructor() {
    super(...arguments);
    this.mutationObserver = new MutationObserverSlimmer({
      // eslint-disable-next-line jsdoc/require-jsdoc
      target: /* istanbul ignore next */ () => this.host,
      options: {
        childList: true,
        subtree: true,
        attributes: true,
        attributeFilter: ['disabled'],
      },
      mutationFilter: TagNameAndAttributeMutationFilter('VEGA-BUTTON-GROUP-ITEM'),
      // eslint-disable-next-line jsdoc/require-jsdoc
      callback: /* istanbul ignore next */ () => this.updateAllItemsDisabledState(),
    });
  }
  /**
   * Component lifecycle - [disconnectedCallback]
   */
  disconnectedCallback() {
  }
  /**
   * Component lifecycle - [componentWillLoad]
   */
  componentWillLoad() {
    this.updateAllItemsDisabledState();
  }
  /**
   * Check if all button group items are disabled and update the state.
   */
  updateAllItemsDisabledState() {
    const items = this.host.querySelectorAll('vega-button-group-item');
    this.allItemsDisabled =
      items.length > 0 &&
        Array.from(items).every((item) => item.disabled);
  }
}
__decorate$4([
  MapToComponentField()
], VegaButtonGroupAllItemsDisabledController.prototype, "host", void 0);
__decorate$4([
  MapToComponentField({ writable: true })
], VegaButtonGroupAllItemsDisabledController.prototype, "allItemsDisabled", void 0);
__decorate$4([
  InjectVegaSlimmer()
], VegaButtonGroupAllItemsDisabledController.prototype, "mutationObserver", void 0);
__decorate$4([
  MapToComponentMethod('disconnectedCallback')
], VegaButtonGroupAllItemsDisabledController.prototype, "disconnectedCallback", null);
__decorate$4([
  MapToComponentMethod('componentWillLoad')
], VegaButtonGroupAllItemsDisabledController.prototype, "componentWillLoad", null);

const VegaButtonGroupRuntimeMetricsPayloadDefinition = [
  {
    payloadKey: 'VARIANT_IS_PRIMARY',
    payloadDescription: 'Specifies the visual style and prominence of the button group. It determines how the button group will be presented to the user.',
    /**
     * The function checks if the `variant` property of the `host` element is equal to 'primary'.
     * If it is, the function will return `true`.
     *
     * @param {HTMLElement} host - The element to check.
     * @returns {boolean} A boolean value
     */
    payloadValue: (host) => host.variant === 'primary',
  },
  {
    payloadKey: 'VARIANT_IS_SECONDARY',
    payloadDescription: 'Specifies the visual style and prominence of the button group. It determines how the button group will be presented to the user.',
    /**
     * The function checks if the `variant` property of the `host` element is equal to 'secondary'.
     * If it is, the function will return `true`.
     *
     * @param {HTMLElement} host - The element to check
     * @returns {boolean} A boolean value
     */
    payloadValue: (host) => host.variant === 'secondary',
  },
  {
    payloadKey: 'VARIANT_IS_TERTIARY',
    payloadDescription: 'Specifies the visual style and prominence of the button group. It determines how the button group will be presented to the user.',
    /**
     * The function checks if the `variant` property of the `host` element is equal to 'tertiary'.
     * If it is, the function will return `true`.
     *
     * @param {HTMLElement} host - The element to check
     * @returns {boolean} A boolean value
     */
    payloadValue: (host) => host.variant === 'tertiary',
  },
];

const vegaButtonGroupCss = ":host{display:inline-block;border-radius:9999px}.vega-button-group-primary{gap:6px}.vega-button-group-container:not(.vega-button-group-tertiary){border-radius:9999px}.vega-button-group-container:not(.vega-button-group-tertiary)>::slotted(.vega-button-group-item:first-child){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.vega-button-group-container:not(.vega-button-group-tertiary)>::slotted(.vega-button-group-item:last-child){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.vega-button-group-tertiary>::slotted(.vega-button-group-item){border-color:rgba(var(--v-border-color-divider-secondary, 199, 217, 229, 1));border-left-width:1px;border-top-width:0px;border-bottom-width:0px;border-right-width:0px;border-style:solid}.vega-button-group-tertiary>::slotted(.vega-button-group-item:first-child){border-left-width:0px}";

var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
    r = Reflect.decorate(decorators, target, key, desc);
  else
    for (var i = decorators.length - 1; i >= 0; i--)
      if (d = decorators[i])
        r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
const VegaButtonGroup = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.vegaClick = createEvent(this, "vegaClick", 7);
    this.click = createEvent(this, "click", 7);
    this.globalSlimmers = {};
    this.clickEventEmitter = createEventEmitSlimmer(VegaButtonGroup, VegaClick);
    this.clickEventPrevent = new ChildNodesEventPreventSlimmer([VegaClick], () => this.flexContainer);
    this.buttonGroupClickController = new VegaButtonGroupClickController();
    this.variantNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'variant', 'watchVariant');
    this.sizeNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'size', 'watchSize');
    this.iconAlignNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'iconAlign', 'watchIconAlign');
    this.disabledNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'disabled', 'watchDisabled');
    this.allItemsDisabledNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'allItemsDisabled', 'watchAllItemsDisabled');
    this.allItemsDisabledController = new VegaButtonGroupAllItemsDisabledController();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer(VegaButtonGroupRuntimeMetricsPayloadDefinition);
    this.allItemsDisabled = false;
    /**
     * Specifies the visual style and prominence of the button group.
     *
     * It determines how the button group will be presented to the user.
     *
     * @vegaVersion 2.5.0
     */
    this.variant = 'primary';
    /**
     * Specifies the size of the button group.
     *
     * @vegaVersion 2.5.0
     */
    this.size = 'default';
    /**
     * Specifies the placement of the icon in relation to the button's label.
     *
     * @vegaVersion 2.5.0
     */
    this.iconAlign = 'left';
    /**
     * Specifies whether the button elements are disabled.
     *
     * @vegaVersion 2.72.0
     */
    this.disabled = false;
  }
  watchAllItemsDisabled() {
  }
  watchVariant() {
  }
  watchSize() {
  }
  watchIconAlign() {
  }
  watchDisabled() {
  }
  render() {
    const containerClasses = `vega-button-group-container vega-button-group-${this.variant}`;
    return sanitizeVegaComponent(h(Host, null, h("vega-flex", { class: containerClasses, direction: "row", alignItems: this.variant === 'tertiary' ? 'center' : 'stretch', gap: this.variant !== 'tertiary' ? 'size-2' : '0', ref: (node) => (this.flexContainer = node) }, h("slot", null))), this.host);
  }
  get host() { return getElement(this); }
  static get watchers() { return {
    "allItemsDisabled": ["watchAllItemsDisabled"],
    "variant": ["watchVariant"],
    "size": ["watchSize"],
    "iconAlign": ["watchIconAlign"],
    "disabled": ["watchDisabled"]
  }; }
};
__decorate$3([
  InjectVegaGlobalSlimmer()
], VegaButtonGroup.prototype, "globalSlimmers", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "clickEventEmitter", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "clickEventPrevent", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "buttonGroupClickController", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "variantNotifySlimmer", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "sizeNotifySlimmer", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "iconAlignNotifySlimmer", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "disabledNotifySlimmer", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "allItemsDisabledNotifySlimmer", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "allItemsDisabledController", void 0);
__decorate$3([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
VegaButtonGroup.style = vegaButtonGroupCss;

var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/** The class `VegaButtonGroupItemSubStateController` is a TypeScript class that observes and manages sub-states for a button group item component. */
class VegaButtonGroupItemSubStateController extends SubStateObserverSlimmer {
  /**
   * The constructor function initializes a button group with specified subStates in TypeScript.
   */
  constructor() {
    super({
      parent: 'vega-button-group',
      subStates: [
        {
          subStateName: 'variant',
          parentStateName: 'variant',
        },
        {
          subStateName: 'size',
          parentStateName: 'size',
        },
        {
          subStateName: 'iconAlign',
          parentStateName: 'iconAlign',
        },
        {
          subStateName: 'parentDisabled',
          parentStateName: 'disabled',
        },
        {
          subStateName: 'allItemsDisabled',
          parentStateName: 'allItemsDisabled',
        },
      ],
    });
  }
}
__decorate$2([
  MapToComponentField({ writable: true })
], VegaButtonGroupItemSubStateController.prototype, "size", void 0);
__decorate$2([
  MapToComponentField({ writable: true })
], VegaButtonGroupItemSubStateController.prototype, "variant", void 0);
__decorate$2([
  MapToComponentField({ writable: true })
], VegaButtonGroupItemSubStateController.prototype, "iconAlign", void 0);
__decorate$2([
  MapToComponentField({ writable: true })
], VegaButtonGroupItemSubStateController.prototype, "parentDisabled", void 0);
__decorate$2([
  MapToComponentField({ writable: true })
], VegaButtonGroupItemSubStateController.prototype, "allItemsDisabled", void 0);

var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/** The `VegaButtonGroupItemRenderer` class is a TypeScript React component used to render button group items with optional dropdown functionality. */
class VegaButtonGroupItemRenderer extends VegaSlimmer {
  constructor() {
    super(...arguments);
    /**
     * Handle the button item click event
     */
    this.buttonItemClickHandle = () => {
      this.notifyParentGroup(this.itemKey);
    };
    /**
     * Handle the more button dropdown item click event
     */
    this.moreDropdownItemClickHandle = (payload) => {
      this.notifyParentGroup(payload.detail);
    };
    /**
     * Determines whether the button group item is disabled.
     *
     * The button group item is considered disabled if either:
     * - the item itself is disabled, or
     * - the parent is disabled (which forces all children to be disabled,
     *   regardless of their individual disabled state).
     */
    this.isDisabled = () => {
      return this.disabled || this.parentDisabled;
    };
  }
  /**
   * This function conditionally renders a Vega dropdown component with specified props and a click event handler if there is dropdown source data available, otherwise it renders a button item.
   *
   * @returns {HTMLElement} An HTMLElement is being returned. If the `dropdownSource` exists and has a length greater
   * than 0, a `<vega-dropdown>` element is returned with specified attributes and a reference to a node
   * with an observer attached. If `dropdownSource` does not exist or has a length of 0, the result of
   * `renderButtonItem()` is returned.
   */
  render() {
    var _a, _b, _c;
    if (this.dropdownSource && this.dropdownSource.length) {
      const dropdownProps = Object.assign(Object.assign({}, this.dropdownProps), { trigger: this.isDisabled() ? 'none' : (_b = (_a = this.dropdownProps) === null || _a === void 0 ? void 0 : _a.trigger) !== null && _b !== void 0 ? _b : 'click' });
      if (this.isDisabled() && ((_c = this.dropdownProps) === null || _c === void 0 ? void 0 : _c.trigger)) {
        this.dropdownProps.trigger = 'none';
      }
      return (h("vega-dropdown", Object.assign({ source: this.dropdownSource }, dropdownProps, { ref: (node) => {
          DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, VegaDropdownClick, this.moreDropdownItemClickHandle);
        } }), this.renderButtonItemWithTooltip()));
    }
    else {
      return this.renderButtonItemWithTooltip();
    }
  }
  /**
   * The function `renderButtonItemWithTooltip` conditionally renders a button item with a tooltip based on the presence of label and iconOnly properties.
   *
   * @returns {HTMLElement} render the button item or button item with a tooltip
   */
  renderButtonItemWithTooltip() {
    if (this.iconOnly && this.label) {
      return (h("vega-tooltip", { placement: "top", text: this.label }, this.renderButtonItem()));
    }
    else {
      return this.renderButtonItem();
    }
  }
  /**
   * The function `renderButtonItem` in TypeScript React conditionally renders a button component based on the variant type.
   *
   * @returns {HTMLElement} The `renderButtonItem` method returns an HTMLElement, which is either a
   * `<vega-button-link>` element if the variant is 'tertiary', or a `<vega-button>` element with
   * specific class and variant attributes if the variant is not 'tertiary'.
   */
  renderButtonItem() {
    const buttonProps = this.getButtonProps();
    const allDisabledClass = this.parentDisabled || this.allItemsDisabled ? ' button-group-all-disabled' : '';
    if (this.variant === 'tertiary') {
      return (h("vega-button-link", Object.assign({ class: `button-group-item-button-${this.variant}${allDisabledClass}` }, buttonProps)));
    }
    else {
      return (h("vega-button", Object.assign({ class: `button-group-item-button-${this.variant}${allDisabledClass}`, variant: this.variant }, buttonProps)));
    }
  }
  /**
   * The function `notifyParentGroup` notifies the parent group component with a specific detail.
   *
   * @param {string} detail - The `detail` parameter in the `notifyParentGroup` function is a string
   * that contains additional information or details that will be passed along when notifying the parent
   * group. It is used to provide context or specific data related to the event or action that triggered
   * the notification.
   */
  notifyParentGroup(detail) {
    const itemGroup = findParent(this.host, 'vega-button-group');
    if (itemGroup) {
      ChangeManager.notify(domNodeSubjectFactory.getSubject(itemGroup, VegaInternalButtonGroupClick), {
        host: this.host,
        detail,
      });
    }
  }
  /**
   * The function `getButtonProps` returns an object with properties related to a button component.
   *
   * @returns An object with properties `size`, `icon`, `label`, and `iconAlign` is being returned.
   */
  getButtonProps() {
    return {
      size: this.size,
      icon: this.icon,
      label: this.iconOnly ? '' : this.getDefaultLabel(),
      iconAlign: this.iconAlign,
      disabled: this.isDisabled(),
      // eslint-disable-next-line jsdoc/require-jsdoc
      ref: (node) => {
        DomNodeSubjectObserverFactory.addUniqueObserverToNode(node, VegaClick, this.buttonItemClickHandle);
      },
    };
  }
  /**
   * If the item is a more action item and the props label/icon are both empty, return a default label
   *
   * @returns {string} label string
   */
  getDefaultLabel() {
    return !this.icon && !this.label && this.dropdownSource && this.dropdownSource.length
      ? 'More'
      : this.label;
  }
}
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "host", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "size", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "icon", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "label", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "iconAlign", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "disabled", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "parentDisabled", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "allItemsDisabled", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "iconOnly", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "variant", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "itemKey", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "dropdownSource", void 0);
__decorate$1([
  MapToComponentField()
], VegaButtonGroupItemRenderer.prototype, "dropdownProps", void 0);

const vegaButtonGroupItemCss = ":host{display:inline-block}:host>vega-tooltip,:host>vega-dropdown{height:100%}:host>vega-tooltip>vega-tooltip,:host>vega-dropdown>vega-tooltip{height:100%}:host vega-button{height:100%}:host vega-button::part(button):focus-visible{position:relative;outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border-radius:4px;box-shadow:0px 0px 0px 6px rgba(var(--v-bg-primary, 252, 252, 252, 1));z-index:1}:host vega-button-link::part(link){padding-left:12px;padding-right:12px;box-sizing:border-box}:host vega-button-link::part(link):focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}:host vega-button-link::part(label-container){text-decoration:none}:host vega-button-link:hover::part(label-container){text-decoration:underline}:host vega-button::part(button){margin-right:-4px}:host(:first-child) vega-tooltip:has(vega-button),:host(:first-child) vega-dropdown:has(vega-button){border-top-left-radius:9999px;border-bottom-left-radius:9999px}:host(:first-child) vega-button::part(button){border-top-left-radius:9999px;border-bottom-left-radius:9999px}:host(:first-child) vega-button::part(button):focus-visible{margin-left:0}:host(:last-child) vega-tooltip:has(vega-button),:host(:last-child) vega-dropdown:has(vega-button){border-top-right-radius:9999px;border-bottom-right-radius:9999px}:host(:last-child) vega-button::part(button){border-top-right-radius:9999px;border-bottom-right-radius:9999px}:host(:last-child) vega-button::part(button){margin-right:0}vega-button::part(button){border-top-left-radius:0px;border-bottom-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;height:100%}";

var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
    r = Reflect.decorate(decorators, target, key, desc);
  else
    for (var i = decorators.length - 1; i >= 0; i--)
      if (d = decorators[i])
        r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
const VegaButtonGroupItem = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.globalSlimmers = {};
    this.subStateObserverSlimmer = new VegaButtonGroupItemSubStateController();
    this.buttonGroupItemRenderer = new VegaButtonGroupItemRenderer();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    this.variant = 'primary';
    this.size = 'default';
    this.iconAlign = 'left';
    this.parentDisabled = false;
    this.allItemsDisabled = false;
    /**
     * Specifies whether to display the icon only.
     *
     * @vegaVersion 2.5.0
     */
    this.iconOnly = false;
    /**
     * Specifies whether the button group item is disabled.
     *
     * @vegaVersion 2.72.0
     */
    this.disabled = false;
  }
  render() {
    return sanitizeVegaComponent(h(Host, { class: "vega-button-group-item" }, this.buttonGroupItemRenderer.render()), this.host);
  }
  get host() { return getElement(this); }
};
__decorate([
  InjectVegaGlobalSlimmer()
], VegaButtonGroupItem.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroupItem.prototype, "subStateObserverSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroupItem.prototype, "buttonGroupItemRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroupItem.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
VegaButtonGroupItem.style = vegaButtonGroupItemCss;

export { VegaButtonGroup as vega_button_group, VegaButtonGroupItem as vega_button_group_item };
