import{p as e,H as t,h as s,t as l}from"./p-BHHBMN0G.js";import{d as c}from"./p-Dq2r_Sid.js";import{d as i}from"./p-C1DHlsEo.js";import{d as n}from"./p-Bmv0DoO8.js";const a=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.external=!1,this.current=!1,this.hasChildren=!1,this.child=!1}getClass(){let e=["ecl-menu__item","sc-ecl-menu-"+this.theme,this.styleClass];return this.current&&e.push("ecl-menu__item--current"),this.child&&(e=["ecl-menu__subitem","sc-ecl-menu-"+this.theme,this.styleClass],this.current&&e.push("ecl-menu__subitem--current")),e.join(" ")}getAttrs(){let e={"data-ecl-menu-item":!0,"aria-expanded":"false"};return this.hasChildren&&(e["data-ecl-has-children"]=!0),this.child&&(delete e["data-ecl-menu-item"],e["data-ecl-menu-subitem"]=!0),e}getLinkClass(){let e=["ecl-menu__link","ecl-link--standalone","sc-ecl-link-"+this.theme,"sc-ecl-menu-"+this.theme];return this.child&&(e=["ecl-menu__sublink","ecl-link--standalone","sc-ecl-link-"+this.theme,"sc-ecl-menu-"+this.theme],this.current&&e.push("ecl-menu__sublink--current"),this.external&&e.push("ecl-link--icon-after")),e.join(" ")}componentWillLoad(){var e;this.theme=null!==(e=document.documentElement.getAttribute("data-ecl-theme"))&&void 0!==e?e:this.theme||"ec"}render(){const e=this.hasChildren?{"data-ecl-menu-caret":!0}:{};return s("li",Object.assign({key:"2a078bedbe74eda693b08dc999aca73bcc45e6a8",class:this.getClass()},this.getAttrs()),s("a",{key:"5fef3c4572a1f0c7c92d7f98c6dfd18038f3cab4",href:this.link,class:this.getLinkClass(),"data-ecl-menu-link":!0},s("slot",{key:"9ecf355491a2938e279740cd2bf188ea79715137"}),this.external?s("ecl-icon",{icon:"external",size:"xs",styleClass:`sc-ecl-icon-${this.theme} sc-ecl-menu-${this.theme} ecl-menu__link-icon--external ${this.child?"ecl-menu__sublink-icon":"ecl-menu__link-icon"}`}):""),this.hasChildren?s("ecl-button",Object.assign({styleClass:"ecl-menu__button-caret sc-ecl-menu-"+this.theme,type:"button",size:"m",theme:this.theme,variant:"tertiary",buttonStyle:"neutral",hideLabel:!0},e),s("ecl-icon",{icon:"corner-arrow",size:"xs",rotate:"180",slot:"icon-after",styleClass:`sc-ecl-icon-${this.theme} sc-ecl-menu-${this.theme}`})):"",this.hasChildren?s("div",{class:"ecl-menu__mega sc-ecl-menu-"+this.theme,"data-ecl-menu-mega":!0},s("ul",{class:"ecl-menu__sublist sc-ecl-menu-"+this.theme},s("slot",{name:"sublist"}))):"")}get el(){return this}static get style(){return"ecl-menu-item{display:flex;flex-grow:1}ecl-menu-item>*{flex-grow:1}@media (width >= 1140px){ecl-menu-item{flex-grow:0}ecl-menu-item>*{display:flex;flex-grow:0}}"}},[260,"ecl-menu-item",{theme:[1025],styleClass:[1,"style-class"],external:[4],current:[4],hasChildren:[4,"has-children"],child:[4],link:[1],triggerAriaLabel:[1,"trigger-aria-label"]}]),m=a,r=function(){"undefined"!=typeof customElements&&["ecl-menu-item","ecl-button","ecl-icon","ecl-indicator"].forEach((e=>{switch(e){case"ecl-menu-item":customElements.get(l(e))||customElements.define(l(e),a);break;case"ecl-button":customElements.get(l(e))||c();break;case"ecl-icon":customElements.get(l(e))||i();break;case"ecl-indicator":customElements.get(l(e))||n()}}))};export{m as EclMenuItem,r as defineCustomElement}