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

const EclCategoryFilterItem = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.styleClass = '';
    this.theme = 'ec';
    this.label = undefined;
    this.path = undefined;
    this.level = undefined;
    this.subItems = false;
  }
  getClass() {
    return [
      `ecl-category-filter__list-item`,
      `sc-ecl-category-filter-${this.theme}`,
      this.styleClass
    ].join(' ');
  }
  getLinkClass() {
    const linkClasses = [
      `ecl-category-filter__item`,
      `sc-ecl-category-filter-${this.theme}`,
      `ecl-category-filter__item--level-${this.level}`,
      this.styleClass
    ];
    if (this.subItems) {
      linkClasses.push(`ecl-category-filter__item--has-children`);
    }
    return linkClasses.join(' ');
  }
  render() {
    const elAttrs = this.subItems ? { 'aria-expanded': "false" } : {};
    return (h("li", Object.assign({ class: this.getClass() }, elAttrs), this.path ?
      h("ecl-link", { "style-class": this.getLinkClass(), path: this.path }, this.label, this.subItems ?
        h("ecl-icon", { "style-class": `ecl-category-filter__item-icon sc-ecl-category-filter-${this.theme}`, icon: this.level === 1 ? 'corner-arrow' : 'solid-arrow', size: this.level === 1 ? 'xs' : 'm', transform: this.level === 1 ? 'rotate-180' : 'rotate-90', slot: this.level === 1 ? 'icon-after' : 'icon-before' }) : '') : '', !this.path ? this.label : '', this.subItems ?
      h("ul", { class: `ecl-category-filter__list sc-ecl-category-filter-${this.theme}` }, h("slot", null)) : ''));
  }
  get el() { return getElement(this); }
};

export { EclCategoryFilterItem as ecl_category_filter_item };

//# sourceMappingURL=ecl-category-filter-item.entry.js.map