import{u as m,j as e,S as d,f as u,g as p,h,i,e as f,T as b,N as j,c as x,O as g}from"./index-O0BQoyzo.js";import{u as y}from"./use-memory-DbJ4pP2Z.js";import"./react-Cb2sDjhD.js";import"./useQuery-PdiC7-sY.js";function _({value:c,onChange:n,className:l}){const{t:r}=m("memory"),{data:o,isLoading:s}=y(),a=o?.users??[];return e.jsxs(d,{value:c||"__placeholder__",onValueChange:t=>n(t==="__placeholder__"?"":t),disabled:s||a.length===0,children:[e.jsx(u,{className:l??"h-9 w-72 max-w-full",children:e.jsx(p,{placeholder:r("userPicker.placeholder")})}),e.jsxs(h,{children:[e.jsx(i,{value:"__placeholder__",disabled:!0,children:r("userPicker.placeholder")}),a.map(t=>e.jsx(i,{value:t.user_key,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs",children:t.user_key}),e.jsx("span",{className:"text-text-dim text-xs",children:r("userPicker.factsLabel",{count:t.fact_count})}),t.has_persona&&e.jsxs("span",{className:"text-accent text-xs",children:["·",r("userPicker.personaTag"),"·"]})]})},t.user_key))]})]})}const v=[{to:"facts",i18nKey:"tabs.facts",mounted:!0},{to:"persona",i18nKey:"tabs.persona",mounted:!0},{to:"vector",i18nKey:"tabs.vector",mounted:!0}];function T(){const{t:c}=m("memory"),[n,l]=f(),r=n.get("user")??"";function o(s){const a=new URLSearchParams(n);s?a.set("user",s):a.delete("user"),l(a,{replace:!0})}return e.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[e.jsx(b,{}),e.jsx("div",{className:"border-b border-border bg-surface px-3 sm:px-4 py-2",children:e.jsxs("div",{className:"mx-auto flex max-w-7xl items-center gap-3",children:[e.jsx("span",{className:"text-sm text-text-dim shrink-0",children:c("userPicker.label")}),e.jsx(_,{value:r,onChange:o})]})}),e.jsx("nav",{className:x("sticky top-0 z-10","flex items-center gap-1","border-b border-border bg-surface","px-3 sm:px-4 py-1","overflow-x-auto"),"aria-label":c("pageTitle"),children:v.filter(s=>s.mounted).map(s=>e.jsx(j,{to:s.to,className:({isActive:a})=>x("shrink-0 rounded-md px-3 py-1.5 text-sm no-underline","transition-colors tap-target",a?"bg-accent-bg text-accent font-medium":"text-text-dim hover:bg-surface-hover hover:text-text"),children:c(s.i18nKey)},s.to))}),e.jsx("main",{className:"flex-1 px-3 sm:px-4 py-4 pb-safe",children:e.jsx(g,{})})]})}export{T as default};
//# sourceMappingURL=layout-CQtbOBag.js.map
