import{n as e}from"./rolldown-runtime-Czos8NxU.js";import{Tl as t,vl as n}from"./app-initial~app-main~worktree-init-v2-page~appgen-settings-page~page~appgen-publication-ter~fzo5ij6p-BKVLyD1q.js";import{nx as r,rx as i}from"./app-initial~app-main~new-thread-panel-page-BZHGOlMi.js";import{F as a,P as o}from"./app-initial~app-main~worktree-init-v2-page~remote-conversation-page~pull-requests-page~new-~djgpfzje-C7Uyb8hp.js";function s(e){let t=(0,l.c)(33),{tabs:n,selectedKey:i,onSelect:a,className:s,scrollable:f,tabListRef:p,variant:m,ariaLabel:h,ariaLabelledBy:g}=e,_=f===void 0?!1:f,v=d[m===void 0?`segmented`:m],y=_&&`hide-scrollbar overflow-x-auto overflow-y-hidden`,b;t[0]!==s||t[1]!==v.listClassName||t[2]!==y?(b=r(v.listClassName,y,s),t[0]=s,t[1]=v.listClassName,t[2]=y,t[3]=b):b=t[3];let x=_?c:void 0,S;if(t[4]!==a||t[5]!==v.closeButtonClassName||t[6]!==v.itemClassName||t[7]!==v.segmentedEdges||t[8]!==v.selectedClassName||t[9]!==v.selectionIndicator||t[10]!==v.tabButtonClassName||t[11]!==v.unselectedClassName||t[12]!==i||t[13]!==n){let e;t[15]!==a||t[16]!==v.closeButtonClassName||t[17]!==v.itemClassName||t[18]!==v.segmentedEdges||t[19]!==v.selectedClassName||t[20]!==v.selectionIndicator||t[21]!==v.tabButtonClassName||t[22]!==v.unselectedClassName||t[23]!==i||t[24]!==n.length?(e=(e,t)=>{let s=e.key===i,c=t===0,l=t===n.length-1;return(0,u.jsxs)(`div`,{className:r(`relative flex min-w-0 items-center`,v.itemClassName,e.onClose!=null&&`group/tab`),children:[(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-controls":e.panelId,"aria-selected":s,"aria-pressed":s,className:r(`cursor-interaction items-center text-sm font-medium`,s?`text-token-text-primary`:`text-token-text-secondary`,v.tabButtonClassName,v.segmentedEdges&&c&&`rounded-l-md`,v.segmentedEdges&&l&&`rounded-r-md`,s?v.selectedClassName:v.unselectedClassName),onClick:()=>{s||a(e.key)},children:[e.icon==null?null:(0,u.jsx)(`span`,{"aria-hidden":`true`,className:`icon-xs flex shrink-0 items-center justify-center`,children:e.icon}),e.name]}),v.selectionIndicator===`underline`&&s?(0,u.jsx)(`div`,{className:`absolute inset-x-0 bottom-[-1px] h-px bg-token-text-primary`}):null,e.onClose==null?null:(0,u.jsx)(`button`,{type:`button`,"aria-label":e.closeLabel,className:r(`cursor-interaction text-token-text-tertiary hover:text-token-text-primary`,v.closeButtonClassName),onClick:e.onClose,children:(0,u.jsx)(o,{className:`icon-2xs`})}),v.segmentedEdges&&!l?(0,u.jsx)(`div`,{className:`h-full w-px self-stretch bg-token-border`}):null]},e.key)},t[15]=a,t[16]=v.closeButtonClassName,t[17]=v.itemClassName,t[18]=v.segmentedEdges,t[19]=v.selectedClassName,t[20]=v.selectionIndicator,t[21]=v.tabButtonClassName,t[22]=v.unselectedClassName,t[23]=i,t[24]=n.length,t[25]=e):e=t[25],S=n.map(e),t[4]=a,t[5]=v.closeButtonClassName,t[6]=v.itemClassName,t[7]=v.segmentedEdges,t[8]=v.selectedClassName,t[9]=v.selectionIndicator,t[10]=v.tabButtonClassName,t[11]=v.unselectedClassName,t[12]=i,t[13]=n,t[14]=S}else S=t[14];let C;return t[26]!==h||t[27]!==g||t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==p?(C=(0,u.jsx)(`div`,{ref:p,role:`tablist`,"aria-label":h,"aria-labelledby":g,className:b,onWheel:x,children:S}),t[26]=h,t[27]=g,t[28]=b,t[29]=x,t[30]=S,t[31]=p,t[32]=C):C=t[32],C}function c(e){let t=e.deltaX||e.deltaY;t!==0&&(e.currentTarget.scrollLeft=e.currentTarget.scrollLeft+t)}var l,u,d,f=e((()=>{l=t(),i(),a(),u=n(),d={pills:{closeButtonClassName:`px-1`,itemClassName:`shrink-0`,listClassName:`flex min-w-0 items-center gap-2`,segmentedEdges:!1,selectedClassName:`bg-token-foreground/5 text-token-foreground`,selectionIndicator:null,tabButtonClassName:`flex min-w-0 gap-1.5 rounded-full px-2 py-1`,unselectedClassName:`hover:bg-token-foreground/5`},segmented:{closeButtonClassName:`px-1`,itemClassName:`flex-1`,listClassName:`bg-token-surface-secondary border-token-border flex items-center rounded-lg border`,segmentedEdges:!0,selectedClassName:`bg-token-radio-active-foreground/25 text-token-text-primary`,selectionIndicator:null,tabButtonClassName:`relative flex-1 rounded-none px-4 py-1.5`,unselectedClassName:`hover:bg-token-radio-active-foreground/5`},toolbar:{closeButtonClassName:`flex h-7 w-5 items-center justify-center`,itemClassName:`shrink-0`,listClassName:`flex min-w-0 items-center gap-0.5`,segmentedEdges:!1,selectedClassName:`bg-token-bg-primary text-token-text-primary`,selectionIndicator:null,tabButtonClassName:`flex min-w-0 gap-1.5 rounded-md px-2 py-1`,unselectedClassName:`hover:bg-token-bg-primary`},underline:{closeButtonClassName:`px-1`,itemClassName:`shrink-0 pb-2`,listClassName:`border-token-border flex min-w-0 items-start gap-8 border-b`,segmentedEdges:!1,selectedClassName:`text-token-text-primary`,selectionIndicator:`underline`,tabButtonClassName:`flex min-w-0 gap-1.5`,unselectedClassName:`hover:text-token-text-primary`}}}));export{f as n,s as t};
//# sourceMappingURL=tabs-BB43ailO.js.map