import{r as t,h as s,e,H as a}from"./p-9babd345.js";const r=class{constructor(e){t(this,e),this.selected=null,this.tabs=[],this.toTabButton=t=>{const e=t.getAttribute("tab"),a=this.selected===t;return s("button",{role:"tab","aria-selected":a?"true":"false",onClick:()=>this.select(t),class:{"Tabs-button":!0,"is-selected":a}},e)}}listenForFrameworkSelection(t){void 0!==this.listenFor&&t.detail.key===this.listenFor&&this.tabs.forEach((s=>{s.tab.toLowerCase()===t.detail.value.toLowerCase()&&this.select(s)}))}componentDidLoad(){this.tabs=Array.from(this.el.querySelectorAll("sparkle-tab")),this.select(this.tabs.find((t=>t.hasAttribute("selected")))||this.tabs[0])}select(t){null!==this.selected&&this.selected.removeAttribute("selected"),this.selected=t,this.selected.setAttribute("selected","")}hostData(){return{role:"tablist",class:{Tabs:!0}}}__stencil_render(){return[s("header",{class:"Tabs-header"},this.tabs.map(this.toTabButton)),s("slot",null)]}get el(){return e(this)}render(){return s(a,this.hostData(),this.__stencil_render())}};r.style=".Tabs,.Tabs-tab{display:block}.Tabs-tab:not([selected]){display:none}.Tabs-header{border-bottom:solid 1px rgba(0, 32, 88, 0.1);white-space:nowrap}.Tabs-button{--bg-alpha:0;appearance:none;background-color:rgba(0, 0, 0, var(--bg-alpha));border:none;color:var(--text-color--light);cursor:pointer;font-family:inherit;font-size:10px;font-weight:600;letter-spacing:0.04em;padding:1rem;text-transform:uppercase;transform:translateY(1px)}.Tabs-button:first-child{border-top-left-radius:6px}.Tabs-button:last-child{border-top-right-radius:6px}.Tabs-button:focus{outline:none}.Tabs-button:focus{--bg-alpha:0.015}@media (hover: hover){.Tabs-button:hover{--bg-alpha:0.015}}.Tabs-button:active{--bg-alpha:0.03}.Tabs-button.is-selected{border-bottom:solid 1px currentColor;color:var(--accent-color)}.Tabs-tab sparkle-code pre{margin-top:0}";export{r as sparkle_tabs}