import{r as t,h as e,a,g as i}from"./p-d52b3602.js";import{c as r}from"./p-c608c6dc.js";import{s as o}from"./p-c5a89792.js";const s=class{constructor(e){t(this,e),this.collapsible=!1,this.collapsibleMediaQuery="(max-width: 30em)",this.collapsibleLabel="Menu",this.collapsed=!0,this.handleMediaQueryChange=t=>{this.collapsible=t.matches},this.toggle=()=>{this.collapsed=!this.collapsed}}componentDidLoad(){this.setNestingLevelOnChildren(),this.setMatchMedia()}disconnectedCallback(){null!=this.mq&&this.mq.removeListener(this.handleMediaQueryChange)}componentDidRender(){this.el.hasAttribute("aria-label")&&o({tag:"deprecated",message:'Property "ariaLabel" is deprecated. Please use the "ariaLabelSidebarNav" property!',type:"warn",source:this.el})}setNestingLevelOnChildren(){!function t(e,a=1){Array.from(e.children).forEach((e=>{"SCALE-SIDEBAR-NAV-COLLAPSIBLE"===e.tagName.toUpperCase()&&(t(e,a+1),e.hasAttribute("nesting-level")||e.setAttribute("nesting-level",String(a)),2!==a||e.hasAttribute("condensed")||e.setAttribute("condensed","true")),"SCALE-SIDEBAR-NAV-ITEM"===e.tagName.toUpperCase()&&(e.hasAttribute("nesting-level")||e.setAttribute("nesting-level",String(a)),3!==a||e.hasAttribute("condensed")||e.setAttribute("condensed","true"))}))}(this.el)}setMatchMedia(){this.collapsibleMediaQuery&&(this.mq=window.matchMedia(this.collapsibleMediaQuery),this.mq.addListener(this.handleMediaQueryChange),this.collapsible=this.mq.matches)}render(){const t=this.ariaLabelSidebarNav?{"aria-label":this.ariaLabelSidebarNav}:{},i=this.collapsible?{hidden:this.collapsed}:{};return e(a,null,this.styles&&e("style",null,this.styles),e("div",{part:this.getBasePartMap(),class:this.getCssClassMap()},!0===this.collapsible&&e("button",{part:"toggle-button",class:"sidebar-nav__toggle-button","aria-expanded":this.collapsed?"false":"true",onClick:this.toggle},this.collapsibleLabel,e("scale-icon-navigation-collapse-down",{part:"icon",class:"sidebar-nav__icon",size:20})),e("nav",Object.assign({part:"nav"},t,i),e("ul",{part:"list",class:"sidebar-nav__list",role:"list"},e("slot",null)))))}getBasePartMap(){return this.getCssOrBasePartMap("basePart")}getCssClassMap(){return this.getCssOrBasePartMap("css")}getCssOrBasePartMap(t){return r("sidebar-nav",this.collapsible&&("basePart"===t?"":"sidebar-nav--")+"collapsible")}get el(){return i(this)}};s.style=":host{--max-width:15rem;--spacing-indent:var(--telekom-spacing-composition-space-08);--spacing-collapsible:var(--telekom-spacing-composition-space-06);--opacity-chevron:0;--left-current-border:0;--color-hover:var(--telekom-color-text-and-icon-primary-hovered);--color-active:var(--telekom-color-text-and-icon-primary-pressed);--focus-outline:var(--telekom-line-weight-highlight) solid\n    var(--telekom-color-functional-focus-standard);--color-toggle-button:var(--telekom-color-ui-regular);--border-y-toggle-button:1px solid var(--telekom-color-ui-faint);--radius-toggle-button:var(--telekom-radius-small)}.sidebar-nav--collapsible{--max-width:none;--spacing-indent:0;--opacity-chevron:1;--left-current-border:calc(-1 * var(--spacing-collapsible));padding-right:var(--spacing-collapsible);padding-left:var(--spacing-collapsible)}.sidebar-nav__list{list-style:none;max-width:var(--max-width);padding-left:0;margin-top:0;margin-bottom:0}.sidebar-nav__toggle-button{box-sizing:border-box;appearance:none;border:0;background-color:transparent;color:var(--color-toggle-button);width:100%;display:flex;justify-content:space-between;align-items:center;text-align:left;text-decoration:none;font-family:inherit;font-size:1rem;padding-top:1rem;padding-right:calc(0.5 * var(--spacing-indent));padding-bottom:1rem;padding-left:var(--spacing-indent);border-radius:var(--radius-toggle-button);border-bottom:var(--border-y-toggle-button);border-top:var(--border-y-toggle-button);cursor:pointer}.sidebar-nav__toggle-button:hover{color:var(--color-hover)}.sidebar-nav__toggle-button:active{color:var(--color-active)}.sidebar-nav__toggle-button:focus{outline:var(--focus-outline)}[aria-expanded='true'] .sidebar-nav__icon{transform:rotate(0.5turn)}";export{s as scale_sidebar_nav}