import { r as registerInstance, h, c as getElement } from './index-0a3acb15.js';

const EclBreadcrumbItem = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.theme = 'ec';
    this.styleClass = undefined;
    this.variant = undefined;
    this.path = undefined;
    this.currentPage = false;
    this.ellipsis = false;
    this.buttonAriaLabel = '';
  }
  getClass() {
    const styleClasses = [
      `ecl-breadcrumb__segment`,
      `sc-ecl-breadcrumb-${this.theme}`,
      this.styleClass
    ];
    if (this.ellipsis) {
      styleClasses.push('ecl-breadcrumb__segment--ellipsis');
    }
    if (this.currentPage) {
      styleClasses.push('ecl-breadcrumb__current-page');
    }
    return styleClasses.join(' ');
  }
  getLinkClass() {
    const linkClasses = [
      `sc-ecl-breadcrumb-${this.theme}`,
      'ecl-breadcrumb__link',
      'ecl-link--no-visited',
    ];
    if (this.el.closest('.ecl-breadcrumb--negative')) {
      linkClasses.push('ecl-link--negative');
    }
    return linkClasses.join(' ');
  }
  getLiAttrs() {
    const attrs = { 'data-ecl-breadcrumb-item': 'static' };
    if (this.ellipsis) {
      attrs['data-ecl-breadcrumb-ellipsis'] = 'data-ecl-breadcrumb-ellipsis';
    }
    return attrs;
  }
  render() {
    return (h("li", Object.assign({ class: this.getClass() }, this.getLiAttrs()), !this.currentPage && !this.ellipsis ?
      h("ecl-link", { variant: "standalone", path: this.path, "style-class": this.getLinkClass() }, h("ecl-icon", { slot: "icon-after", "style-class": `ecl-breadcrumb__icon sc-ecl-breadcrumb-${this.theme}`, icon: "corner-arrow", transform: "rotate-90", size: "2xs" }), h("slot", null)) :
      h("slot", null), this.ellipsis ?
      h("ecl-button", { "style-class": `ecl-breadcrumb__ellipsis sc-ecl-breadcrumb-${this.theme}`, variant: "ghost", "data-ecl-breadcrumb-ellipsis-button": true, "aria-label": this.buttonAriaLabel }, "...", h("ecl-icon", { "style-class": `ecl-breadcrumb__icon sc-ecl-breadcrumb-${this.theme}`, size: "2xs", transform: "rotate-90", icon: "corner-arrow", slot: "icon-after" })) : '', this.currentPage ?
      h("slot", null) : ''));
  }
  get el() { return getElement(this); }
};

export { EclBreadcrumbItem as ecl_breadcrumb_item };

//# sourceMappingURL=ecl-breadcrumb-item.entry.js.map