import{t as e}from"./jsx-runtime-CiQ1k8xo.js";import{t}from"./clsx-BcPLHiun.js";import{lt as n}from"./vscode-api-DjORcpSo.js";import{t as r}from"./x-DypUcSQe.js";var i=n(),a=e();function o(e){let n=(0,i.c)(23),{tabs:o,selectedKey:c,onSelect:l,className:u,scrollable:d,tabListRef:f,variant:p,ariaLabel:m,ariaLabelledBy:h}=e,g=d===void 0?!1:d,_=p===void 0?`segmented`:p,v=_===`toolbar`,y=_===`underline`,b=`bg-token-surface-secondary border-token-border flex items-center rounded-lg border`;v&&(b=`flex min-w-0 items-center gap-0.5`),y&&(b=`border-token-border flex min-w-0 items-start gap-8 border-b`);let x=g&&`hide-scrollbar overflow-x-auto overflow-y-hidden`,S;n[0]!==u||n[1]!==x||n[2]!==b?(S=t(b,x,u),n[0]=u,n[1]=x,n[2]=b,n[3]=S):S=n[3];let C=g?s:void 0,w;if(n[4]!==v||n[5]!==y||n[6]!==l||n[7]!==c||n[8]!==o){let e;n[10]!==v||n[11]!==y||n[12]!==l||n[13]!==c||n[14]!==o.length?(e=(e,n)=>{let i=e.key===c,s=n===0,u=n===o.length-1,d=`relative flex-1 rounded-none px-4 py-1.5`,f=`bg-token-radio-active-foreground/25 text-token-text-primary`,p=`hover:bg-token-radio-active-foreground/5`;return v&&(d=`flex min-w-0 gap-1.5 rounded-md px-2 py-1`,f=`bg-token-bg-primary text-token-text-primary`,p=`hover:bg-token-bg-primary`),y&&(d=`flex min-w-0 gap-1.5`,f=`text-token-text-primary`,p=`hover:text-token-text-primary`),(0,a.jsxs)(`div`,{className:t(`relative flex min-w-0 items-center`,v||y?`shrink-0`:`flex-1`,y&&`pb-2`,e.onClose!=null&&`group/tab`),children:[(0,a.jsxs)(`button`,{type:`button`,role:`tab`,"aria-controls":e.panelId,"aria-selected":i,"aria-pressed":i,className:t(`cursor-interaction items-center text-sm font-medium`,i?`text-token-text-primary`:`text-token-text-secondary`,d,!v&&!y&&s&&`rounded-l-md`,!v&&!y&&u&&`rounded-r-md`,i&&f,!i&&p),onClick:()=>{i||l(e.key)},children:[e.icon==null?null:(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`icon-xs flex shrink-0 items-center justify-center`,children:e.icon}),e.name]}),y&&i?(0,a.jsx)(`div`,{className:`absolute inset-x-0 bottom-[-1px] h-px bg-token-text-primary`}):null,e.onClose==null?null:(0,a.jsx)(`button`,{type:`button`,"aria-label":e.closeLabel,className:t(`cursor-interaction text-token-text-tertiary hover:text-token-text-primary`,v?`flex h-7 w-5 items-center justify-center`:`px-1`),onClick:e.onClose,children:(0,a.jsx)(r,{className:`icon-2xs`})}),!v&&!y&&!u?(0,a.jsx)(`div`,{className:`h-full w-px self-stretch bg-token-border`}):null]},e.key)},n[10]=v,n[11]=y,n[12]=l,n[13]=c,n[14]=o.length,n[15]=e):e=n[15],w=o.map(e),n[4]=v,n[5]=y,n[6]=l,n[7]=c,n[8]=o,n[9]=w}else w=n[9];let T;return n[16]!==m||n[17]!==h||n[18]!==S||n[19]!==C||n[20]!==w||n[21]!==f?(T=(0,a.jsx)(`div`,{ref:f,role:`tablist`,"aria-label":m,"aria-labelledby":h,className:S,onWheel:C,children:w}),n[16]=m,n[17]=h,n[18]=S,n[19]=C,n[20]=w,n[21]=f,n[22]=T):T=n[22],T}function s(e){let t=e.deltaX||e.deltaY;t!==0&&(e.currentTarget.scrollLeft=e.currentTarget.scrollLeft+t)}export{o as t};
//# sourceMappingURL=tabs-BTeyvroI.js.map