import{r as e,c as t,h as a,a as r,g as o}from"./p-d52b3602.js";import{c as s}from"./p-c608c6dc.js";import{i}from"./p-086c9d13.js";import{s as d}from"./p-c5a89792.js";let l=0;const c=class{constructor(a){e(this,a),this.scaleSelect=t(this,"scale-select",7),this.generatedId=l++,this.disabled=!1,this.small=!1,this.size="small",this.hasFocus=!1}handleClick(e){e.stopPropagation(),this.disabled||this.scaleSelect.emit()}selectedChanged(e){this.hostElement.isConnected&&(this.disabled||(!0===e&&this.tabsHaveFocus()&&this.hostElement.focus(),this.updateSlottedIcon()))}disabledChanged(){this.disabled&&(this.selected=!1)}componentDidLoad(){this.setChildrenIconSize()}componentDidRender(){!1!==this.small&&d({tag:"deprecated",message:'Property "small" is deprecated. Please use css overwrites.',type:"warn",source:this.hostElement})}tabsHaveFocus(){const e=this.hostElement.closest(".scale-tab-nav");return!!e&&e.contains(document.activeElement)}updateSlottedIcon(){const e=Array.from(this.hostElement.childNodes).filter(i),t=this.selected?"setAttribute":"removeAttribute";e.forEach((e=>e[t]("selected","")))}setChildrenIconSize(){Array.from(this.hostElement.childNodes).filter(i).forEach((e=>{20!==e.size&&(e.size=20)}))}render(){return a(r,{id:`scale-tab-header-${this.generatedId}`,role:!this.disabled&&"tab","aria-selected":this.selected?"true":"false",tabindex:!this.disabled&&(this.selected?"0":"-1"),onFocus:()=>this.hasFocus=!0,onBlur:()=>this.hasFocus=!1},this.styles&&a("style",null,this.styles),a("span",{part:this.getBasePartMap(),class:this.getCssClassMap()},a("slot",null)))}getBasePartMap(){return this.getCssOrBasePartMap("basePart")}getCssClassMap(){return this.getCssOrBasePartMap("css")}getCssOrBasePartMap(e){const t="basePart"===e?"":"tab-header--";return s("tab-header",this.selected&&`${t}selected`,"large"===this.size&&`${t}large`,this.hasFocus&&`${t}has-focus`,this.disabled&&`${t}disabled`)}get hostElement(){return o(this)}static get watchers(){return{selected:["selectedChanged"],disabled:["disabledChanged"]}}};c.style=":host{outline:none;--font:var(--telekom-text-style-ui-bold);--color:var(--telekom-color-text-and-icon-standard);--color-hover:var(--telekom-color-text-and-icon-primary-hovered);--color-active:var(--telekom-color-text-and-icon-primary-pressed);--color-selected:var(--telekom-color-text-and-icon-primary-standard);--focus-outline:var(--telekom-line-weight-highlight) solid\n    var(--telekom-color-functional-focus-standard);--spacing-right-slotted:var(--telekom-spacing-composition-space-04);--color-disabled:var(--telekom-color-text-and-icon-disabled);--radius:var(--telekom-radius-standard);--font-size-large:var(--telekom-typography-font-size-callout)}.tab-header{color:var(--color);cursor:pointer;display:inline-flex;outline:none;position:relative;box-sizing:border-box;align-items:center;height:var(--tab-height);font:var(--font);border-radius:var(--tab-radius);padding-right:var(--tab-spacing-horizontal);padding-left:var(--tab-spacing-horizontal);padding-top:var(--tab-spacing-vertical);padding-bottom:var(--tab-spacing-vertical)}.tab-header--disabled{cursor:auto;color:var(--color-disabled)}.tab-header--disabled:after{cursor:auto;background-color:var(--telekom-color-ui-border-disabled) !important}.tab-header--disabled:active{color:var(--color-disabled)}.tab-header--disabled:hover{color:var(--color-disabled) !important}.tab-header--disabled:hover:after{background-color:var(--telekom-color-ui-border-disabled) !important}.tab-header:after{left:0;right:0;width:100%;bottom:0;content:'';display:block;position:absolute;height:var(--tab-border-size);background-color:var(--tab-border-color)}.tab-header:before{left:0;right:0;width:100%;bottom:0;height:0;content:'';display:block;position:absolute;border-top:1px solid transparent}.tab-header:hover{color:var(--color-hover)}.tab-header:hover:after{background-color:var(--color-hover)}.tab-header:active{color:var(--color-active)}.tab-header:active:after{background-color:var(--color-active)}.tab-header:active:after{background-color:var(--color-active)}.tab-header ::slotted(*){margin-right:var(--spacing-right-slotted)}.tab-header--has-focus{border-radius:var(--tab-radius);outline:var(--focus-outline);z-index:1}.tab-header--has-focus.tab-header--selected:after{border-radius:0 0 3px 3px;width:98%;margin-left:1%}.tab-header--selected{color:var(--color-selected)}.tab-header--selected:after{height:var(--tab-border-size-selected);background-color:var(--color-selected)}.tab-header--selected:before{border-top:var(--tab-border-size-selected) solid transparent}.tab-header--large{font-size:var(--font-size-large);height:var(--tab-height-large)}";export{c as scale_tab_header}