var __decorate = (this && this.__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;
};
import { Component, Element, Event, Host, Prop, h } from '@stencil/core';
import { VegaBreadcrumbRenderer } from './slimmers/renderers/vega-breadcrumb-renderer';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer } from 'vega-slimmer/core';
import { VegaBreadcrumbCollapsedItemRenderer } from './slimmers/renderers/vega-breadcrumb-collapsed-item-renderer';
import { VegaBreadcrumbItemRenderer } from './slimmers/renderers/vega-breadcrumb-item-renderer';
import { sanitizeVegaComponent } from '../../utils/component';
import { ChildNodesEventPreventSlimmer } from '../../helpers/event-manager/slimmers/child-nodes-event-prevent-slimmer';
import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/event-emit-slimmer';
import { VegaClick } from '../../helpers/event-manager/event-id/vega-event-id';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
import { ComponentGlobalStyleSlimmer } from '../../helpers/slimmers/component-global-style-slimmer';
import breadcrumbGlobalCss from './vega-breadcrumb.global.css';
/**
 * @vegaVersion 1.41.0
 */
export class VegaBreadcrumb {
  constructor() {
    this.globalSlimmers = {};
    this.renderer = new VegaBreadcrumbRenderer();
    this.collapsedItemRenderer = new VegaBreadcrumbCollapsedItemRenderer();
    this.itemRenderer = new VegaBreadcrumbItemRenderer();
    this.eventsPrevent = new ChildNodesEventPreventSlimmer([VegaClick], () => this.renderer.getBreadcrumbContainerRef());
    this.clickEventEmitter = createEventEmitSlimmer(VegaBreadcrumb, VegaClick);
    this.componentGlobalStyleSlimmer = new ComponentGlobalStyleSlimmer(breadcrumbGlobalCss);
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    /**
     * Determines the maximum number of visible items in the `vega-breadcrumb` component,
     *   primarily in desktop mode.
  
     * When the number of items exceeds this limit, the component automatically
     *   collapses the center items, rendering only the first and last items visible.
  
     * If you set this value to `none`, all items will remain expanded.
  
     * The minimum allowed value for this property is 4.
     *
     * @vegaVersion 1.41.0
     */
    this.maxItems = 4;
    /**
     * Represents the individual elements within the `vega-breadcrumb` component.
     *
     * @vegaVersion 1.41.0
     */
    this.items = [];
    /**
     * Compact mode toggle for mobile viewport.
     *
     * When `true` (default), the breadcrumb displays only the last clickable
     * item on mobile devices to save horizontal space.
     * When `false`, the full multi-item layout is shown on mobile, identical to
     * desktop behavior (still subject to collapsing based on `maxItems`).
     *
     * @vegaVersion 2.66.0
     */
    this.compactOnMobile = true;
    /**
     * Determines whether the last breadcrumb item is clickable.
     *
     * When `false` (default), the last item is rendered as plain text.
     * When `true`, the last item becomes a clickable link, styled
     * the same as the other breadcrumb items.
     *
     * @vegaVersion 2.81.0
     */
    this.lastItemClickable = false;
  }
  render() {
    return sanitizeVegaComponent(h(Host, null, this.renderer.render()), this.host);
  }
  static get is() { return "vega-breadcrumb"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-breadcrumb.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-breadcrumb.css"]
  }; }
  static get properties() { return {
    "maxItems": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "VegaBreadcrumbCollapsedThresholdType",
        "resolved": "\"none\" | number",
        "references": {
          "VegaBreadcrumbCollapsedThresholdType": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.41.0"
          }],
        "text": "Determines the maximum number of visible items in the `vega-breadcrumb` component,\n   primarily in desktop mode.\n\nWhen the number of items exceeds this limit, the component automatically\n   collapses the center items, rendering only the first and last items visible.\n\nIf you set this value to `none`, all items will remain expanded.\n\nThe minimum allowed value for this property is 4."
      },
      "attribute": "max-items",
      "reflect": false,
      "defaultValue": "4"
    },
    "items": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "VegaBreadcrumbItemType[]",
        "resolved": "VegaBreadcrumbItemType[]",
        "references": {
          "VegaBreadcrumbItemType": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.41.0"
          }],
        "text": "Represents the individual elements within the `vega-breadcrumb` component."
      },
      "defaultValue": "[]"
    },
    "compactOnMobile": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.66.0"
          }],
        "text": "Compact mode toggle for mobile viewport.\n\nWhen `true` (default), the breadcrumb displays only the last clickable\nitem on mobile devices to save horizontal space.\nWhen `false`, the full multi-item layout is shown on mobile, identical to\ndesktop behavior (still subject to collapsing based on `maxItems`)."
      },
      "attribute": "compact-on-mobile",
      "reflect": false,
      "defaultValue": "true"
    },
    "lastItemClickable": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.81.0"
          }],
        "text": "Determines whether the last breadcrumb item is clickable.\n\nWhen `false` (default), the last item is rendered as plain text.\nWhen `true`, the last item becomes a clickable link, styled\nthe same as the other breadcrumb items."
      },
      "attribute": "last-item-clickable",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
  static get events() { return [{
      "method": "vegaClick",
      "name": "vegaClick",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.41.0"
          }],
        "text": "An event emitter notifying that a breadcrumb item has been clicked."
      },
      "complexType": {
        "original": "VegaBreadcrumbItemType",
        "resolved": "{ label: string; href?: string; tooltip?: string; }",
        "references": {
          "VegaBreadcrumbItemType": {
            "location": "import",
            "path": "./types"
          }
        }
      }
    }, {
      "method": "click",
      "name": "click",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.0.0"
          }],
        "text": "An event emitter notifying that a breadcrumb item has been clicked."
      },
      "complexType": {
        "original": "VegaBreadcrumbItemType",
        "resolved": "{ label: string; href?: string; tooltip?: string; }",
        "references": {
          "VegaBreadcrumbItemType": {
            "location": "import",
            "path": "./types"
          }
        }
      }
    }]; }
  static get elementRef() { return "host"; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaBreadcrumb.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBreadcrumb.prototype, "renderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBreadcrumb.prototype, "collapsedItemRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBreadcrumb.prototype, "itemRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBreadcrumb.prototype, "eventsPrevent", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBreadcrumb.prototype, "clickEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBreadcrumb.prototype, "componentGlobalStyleSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBreadcrumb.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
