import{o as e}from"./rolldown-runtime-C_s2cVnS.js";import{n as t}from"./layout-constants-ByGyMn3R.js";import{h as n,m as r,n as i}from"./vendor-react-nmZsNlRz.js";import{t as a}from"./utils-BRwGVQJx.js";import{t as o}from"./overlay-view-BSsbCfFj.js";import{n as s}from"./tab-dropdown-Buzc7hcg.js";var c=i(),l=e(n(),1),u=e(r(),1),d=`max-[47.5rem]:hidden`,f=`hidden max-[47.5rem]:flex`;function p(e){let t=(0,c.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=a(`grid h-full min-h-0 flex-1 grid-cols-[13rem_minmax(0,1fr)] overflow-hidden bg-transparent max-[47.5rem]:grid-cols-1 max-[47.5rem]:grid-rows-[auto_minmax(0,1fr)]`,r),t[0]=r,t[1]=i);let o;return t[2]!==n||t[3]!==i?(o=(0,u.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=o):o=t[4],o}function m(e){let t=(0,c.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=a(`flex min-h-0 flex-col gap-0.5 overflow-y-auto bg-(--ui-sidebar-surface-background) px-2.5 pb-3`,o,r),t[0]=r,t[1]=i);let s;return t[2]!==n||t[3]!==i?(s=(0,u.jsx)(`aside`,{className:i,"data-tour":`overlay-nav`,children:n}),t[2]=n,t[3]=i,t[4]=s):s=t[4],s}function h(e){let n=(0,c.c)(5),{children:r,className:i}=e,o;n[0]===i?o=n[1]:(o=a(`mx-auto flex min-h-0 w-full flex-1 flex-col overflow-hidden bg-transparent pb-2 pt-[calc((var(--titlebar-height)/2+1rem)*2/3)] max-[47.5rem]:pt-[calc(0.5rem*2/3)] px-[clamp(0.8333rem,2.6667vw,2.6667rem)]`,t,i),n[0]=i,n[1]=o);let s;return n[2]!==r||n[3]!==o?(s=(0,u.jsx)(`main`,{className:o,children:r}),n[2]=r,n[3]=o,n[4]=s):s=n[4],s}var g=(0,l.memo)(function(e){let t=(0,c.c)(17),{active:n,icon:r,id:i,label:o,nested:s,onClick:l,trailing:d}=e,f=s?n?`border-transparent bg-(--chrome-action-hover) font-medium text-foreground`:`border-transparent bg-transparent text-(--ui-text-tertiary) hover:bg-(--chrome-action-hover) hover:text-foreground`:n?`border-(--ui-stroke-tertiary) bg-(--ui-bg-tertiary) text-foreground`:`border-transparent bg-transparent text-(--ui-text-secondary) hover:bg-(--chrome-action-hover) hover:text-foreground`,p;t[0]===f?p=t[1]:(p=a(`flex h-7 w-full items-center justify-start gap-2 rounded-md border px-2 text-left text-[length:var(--conversation-text-font-size)] font-normal transition-colors`,f),t[0]=f,t[1]=p);let m=i?`nav-${i}`:void 0,h=s?`size-3.5`:`size-4`,g=n?`text-foreground/80`:`text-muted-foreground/80`,_;t[2]!==h||t[3]!==g?(_=a(`shrink-0`,h,g),t[2]=h,t[3]=g,t[4]=_):_=t[4];let v;t[5]!==r||t[6]!==_?(v=(0,u.jsx)(r,{className:_}),t[5]=r,t[6]=_,t[7]=v):v=t[7];let y;t[8]===o?y=t[9]:(y=(0,u.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o}),t[8]=o,t[9]=y);let b;return t[10]!==l||t[11]!==p||t[12]!==m||t[13]!==v||t[14]!==y||t[15]!==d?(b=(0,u.jsxs)(`button`,{className:p,"data-tour":m,onClick:l,type:`button`,children:[v,y,d]}),t[10]=l,t[11]=p,t[12]=m,t[13]=v,t[14]=y,t[15]=d,t[16]=b):b=t[16],b});function _(e){let t=(0,c.c)(20),{footer:n,groups:r}=e,i;t[0]===r?i=t[1]:(i=r.map(x),t[0]=r,t[1]=i);let o;t[2]===n?o=t[3]:(o=n&&(0,u.jsx)(`div`,{className:`mt-auto flex items-center gap-1 pt-2`,children:n}),t[2]=n,t[3]=o);let l;t[4]!==i||t[5]!==o?(l=(0,u.jsxs)(m,{className:d,children:[i,o]}),t[4]=i,t[5]=o,t[6]=l):l=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=a(`pointer-events-none relative z-20 h-[calc(var(--titlebar-height)+0.1875rem)] items-center justify-between gap-2 pl-3 pr-12`,f),t[7]=p):p=t[7];let h;t[8]===r?h=t[9]:(h=r.flatMap(v),t[8]=r,t[9]=h);let g;t[10]===h?g=t[11]:(g=(0,u.jsx)(`div`,{className:`pointer-events-auto min-w-0 [-webkit-app-region:no-drag]`,children:(0,u.jsx)(s,{align:`start`,items:h})}),t[10]=h,t[11]=g);let _;t[12]===n?_=t[13]:(_=n&&(0,u.jsx)(`div`,{className:`pointer-events-auto flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:n}),t[12]=n,t[13]=_);let y;t[14]!==g||t[15]!==_?(y=(0,u.jsxs)(`div`,{className:p,children:[g,_]}),t[14]=g,t[15]=_,t[16]=y):y=t[16];let b;return t[17]!==l||t[18]!==y?(b=(0,u.jsxs)(u.Fragment,{children:[l,y]}),t[17]=l,t[18]=y,t[19]=b):b=t[19],b}function v(e){return[{active:e.active&&!e.children?.some(b),icon:e.icon,id:e.id,label:e.label,onSelect:e.onSelect,separatorBefore:e.gapBefore},...(e.children??[]).map(y)]}function y(e){return{active:e.active,icon:e.icon,id:e.id,indent:!0,label:e.label,onSelect:e.onSelect}}function b(e){return e.active}function x(e){return(0,u.jsxs)(l.Fragment,{children:[e.gapBefore&&(0,u.jsx)(`div`,{"aria-hidden":!0,className:`h-2`}),(0,u.jsx)(g,{active:e.active,icon:e.icon,id:e.id,label:e.label,onClick:e.onSelect}),e.children&&e.active&&(0,u.jsx)(`div`,{className:`ml-3.5 flex flex-col gap-0.5 pl-1.5`,children:e.children.map(S)})]},e.id)}function S(e){return(0,u.jsx)(g,{active:e.active,icon:e.icon,id:e.id,label:e.label,nested:!0,onClick:e.onSelect},e.id)}export{_ as n,p as r,h as t};