import { r as i, c as t, h as e, H as n, a } from "./p-9b9ccd0c.js";

const o = ":host{display:grid;block-size:100%}.opacity-0{opacity:0}.gxi-hidden{display:none !important}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.overflow-auto{overflow:auto}:host(.gx-ide-component){height:100% !important;display:flex !important;flex-direction:column !important}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--font-style-regular);font-size:var(--font-size-body-m);font-family:var(--font-family-body);height:100%;display:flex;flex-direction:column;flex-grow:1;box-sizing:border-box}.buttons-container{display:flex;gap:var(--spacing-gap-m)}.giu-static-pill-icon-and-text,.giu-static-pill{background-color:var(--elevation-background-color, var(--color-accent-surface-elevation-1));padding-inline:var(--spacing-padding-m);color:var(--color-text-neutral-default);font-size:var(--font-size-body-s);line-height:var(--line-height-relaxed);font-weight:var(--font-style-regular);border-radius:4px;min-block-size:25px;display:inline-grid;align-items:center;pointer-events:none;inline-size:max-content}.giu-static-pill-icon-and-text{display:inline-grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:var(--spacing-gap-m)}.tab-full-width-buttons::part(tab-list block-start),.tab-full-width-buttons::part(tab-list block-end){grid-auto-columns:1fr}.tab-full-width-buttons::part(tab block-start){justify-content:center}.tree-view::part(item__header){--icon__system_warning_warning--disabled:var(\n    --icon__system_warning_warning--enabled\n  )}.tabular-grid{--focus-outline-width:1px}:host(.breadcrumb){display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-gap-xs);margin:0;padding-block:var(--spacing-padding-xs);padding-inline:0;list-style:none}.list{display:contents}.list-item{display:inline-flex;align-items:center;gap:var(--spacing-gap-xs);list-style:none}.separator{color:var(--color-text-neutral-subtle);padding-inline:var(--spacing-padding-xs);user-select:none;pointer-events:none;opacity:0.85}";

var s = undefined && undefined.__classPrivateFieldGet || function(i, t, e, n) {
  if (e === "a" && !n) throw new TypeError("Private accessor was defined without a getter");
  if (typeof t === "function" ? i !== t || !n : !t.has(i)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return e === "m" ? n : e === "a" ? n.call(i) : n ? n.value : t.get(i);
};

var r, l;

const d = [ "resets/box-sizing", "components/icon", "utils/link", "utils/typography", "utils/spacing" ];

const c = {
  link: {
    url: undefined
  }
};

const u = class {
  constructor(e) {
    i(this, e);
    this.hyperlinkClick = t(this, "hyperlinkClick", 7);
    this.buttonClick = t(this, "buttonClick", 7);
    r.set(this, (i => {
      var t, e, n, a, o;
      if (!this.selectedLinkIndicator) return false;
      const s = (t = this.selectedLink) !== null && t !== void 0 ? t : c;
      const r = s.id !== undefined && i.id === s.id;
      const l = ((e = s.link) === null || e === void 0 ? void 0 : e.url) !== undefined && ((n = s.link) === null || n === void 0 ? void 0 : n.url) !== "" && ((a = i.link) === null || a === void 0 ? void 0 : a.url) === ((o = s.link) === null || o === void 0 ? void 0 : o.url);
      return r || l;
    }));
    l.set(this, (i => {
      var t, e, n, a, o;
      if (this.disabled) return;
      const s = i.target;
      const r = (t = s.closest) === null || t === void 0 ? void 0 : t.call(s, "gx-ide-breadcrumb-item");
      if (!r) return;
      const l = (e = r.getAttribute) === null || e === void 0 ? void 0 : e.call(r, "data-item-id");
      const d = ((n = r.getAttribute) === null || n === void 0 ? void 0 : n.call(r, "data-has-link")) === "true";
      if (!l || !this.model) return;
      const c = this.model.find((i => i.id === l));
      if (!c) return;
      if (d) {
        i.preventDefault();
        (a = this.hyperlinkClick) === null || a === void 0 ? void 0 : a.emit(c);
        return;
      }
      (o = this.buttonClick) === null || o === void 0 ? void 0 : o.emit(c);
    }));
    this.model = undefined;
    this.accessibleName = undefined;
    this.disabled = false;
    this.separator = "›";
    this.selectedLink = c;
    this.selectedLinkIndicator = false;
    this.getImagePathCallback = undefined;
  }
  render() {
    var i, t;
    const a = (i = this.model) !== null && i !== void 0 ? i : [];
    const o = this.separator;
    const c = (t = this.accessibleName) !== null && t !== void 0 ? t : undefined;
    return e(n, {
      class: "breadcrumb",
      role: "navigation",
      "aria-label": c
    }, e("ch-theme", {
      model: d
    }), e("ol", {
      class: "list",
      onClick: s(this, l, "f")
    }, a.map(((i, t) => e("li", {
      key: i.id,
      class: "list-item",
      role: "presentation"
    }, e("gx-ide-breadcrumb-item", {
      itemId: i.id,
      model: i,
      caption: i.caption,
      accessibleName: i.accessibleName,
      disabled: this.disabled || i.disabled,
      link: i.link,
      selected: s(this, r, "f").call(this, i),
      selectedLinkIndicator: this.selectedLinkIndicator,
      startImgSrc: i.startImgSrc,
      startImgType: i.startImgType,
      getImagePathCallback: this.getImagePathCallback
    }), t < a.length - 1 && e("span", {
      class: "separator body-regular-s",
      "aria-hidden": "true"
    }, o))))));
  }
  get el() {
    return a(this);
  }
};

r = new WeakMap, l = new WeakMap;

u.style = o;

export { u as gx_ide_breadcrumb };
//# sourceMappingURL=p-7452f3e9.entry.js.map