kaizenai 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/client/assets/{FeatureOverviewPage-Kbb6kM_H.js → FeatureOverviewPage-CfvhIYnO.js} +1 -1
  2. package/dist/client/assets/FeatureOverviewPage-CfvhIYnO.js.br +0 -0
  3. package/dist/client/assets/FeatureOverviewPage-CfvhIYnO.js.gz +0 -0
  4. package/dist/client/assets/LocalProjectsPage-BwSLvCKI.js +21 -0
  5. package/dist/client/assets/LocalProjectsPage-BwSLvCKI.js.br +0 -0
  6. package/dist/client/assets/LocalProjectsPage-BwSLvCKI.js.gz +0 -0
  7. package/dist/client/assets/SettingsPage-C92bNGPd.js +56 -0
  8. package/dist/client/assets/SettingsPage-C92bNGPd.js.br +0 -0
  9. package/dist/client/assets/SettingsPage-C92bNGPd.js.gz +0 -0
  10. package/dist/client/assets/{eye-CgKgBPK8.js → eye-BeBsJ5eR.js} +1 -1
  11. package/dist/client/assets/eye-BeBsJ5eR.js.br +0 -0
  12. package/dist/client/assets/eye-BeBsJ5eR.js.gz +0 -0
  13. package/dist/client/assets/index-BEm9Mm0C.css +32 -0
  14. package/dist/client/assets/index-BEm9Mm0C.css.br +0 -0
  15. package/dist/client/assets/index-BEm9Mm0C.css.gz +0 -0
  16. package/dist/client/assets/index-B_605KJ5.js +2502 -0
  17. package/dist/client/assets/index-B_605KJ5.js.br +0 -0
  18. package/dist/client/assets/index-B_605KJ5.js.gz +0 -0
  19. package/dist/client/index.html +2 -2
  20. package/dist/server/build-target.json +1 -1
  21. package/dist/server/cli-supervisor.js +2 -1
  22. package/dist/server/cli.js +1555 -100
  23. package/package.json +2 -1
  24. package/dist/client/assets/FeatureOverviewPage-Kbb6kM_H.js.br +0 -0
  25. package/dist/client/assets/FeatureOverviewPage-Kbb6kM_H.js.gz +0 -0
  26. package/dist/client/assets/LocalProjectsPage-C56Q0ZrY.js +0 -21
  27. package/dist/client/assets/LocalProjectsPage-C56Q0ZrY.js.br +0 -0
  28. package/dist/client/assets/LocalProjectsPage-C56Q0ZrY.js.gz +0 -0
  29. package/dist/client/assets/SettingsPage-B1f0yrfy.js +0 -51
  30. package/dist/client/assets/SettingsPage-B1f0yrfy.js.br +0 -0
  31. package/dist/client/assets/SettingsPage-B1f0yrfy.js.gz +0 -0
  32. package/dist/client/assets/eye-CgKgBPK8.js.br +0 -0
  33. package/dist/client/assets/eye-CgKgBPK8.js.gz +0 -0
  34. package/dist/client/assets/index-BpFB-KP0.js +0 -2500
  35. package/dist/client/assets/index-BpFB-KP0.js.br +0 -0
  36. package/dist/client/assets/index-BpFB-KP0.js.gz +0 -0
  37. package/dist/client/assets/index-C5XCCHyf.css +0 -32
  38. package/dist/client/assets/index-C5XCCHyf.css.br +0 -0
  39. package/dist/client/assets/index-C5XCCHyf.css.gz +0 -0
@@ -1,4 +1,4 @@
1
- import{c as Te,a as Ve,u as De,b as qe,d as Be,e as He,f as $e,r as c,g as Ge,h as Ke,i as Z,j as Qe,k as l,B as Pe,E as Je,l as We,m as Xe,n as Ye,S as Ze,M as et,T as tt,C as lt,o as st,P as Ae,R as nt,p as Ie,q as it}from"./index-BpFB-KP0.js";import{E as Me}from"./eye-CgKgBPK8.js";/**
1
+ import{c as Te,a as Ve,u as De,b as qe,d as Be,e as He,f as $e,r as c,g as Ge,h as Ke,i as Z,j as Qe,k as l,B as Pe,E as Je,l as We,m as Xe,n as Ye,S as Ze,M as et,T as tt,C as lt,o as st,P as Ae,R as nt,p as Ie,q as it}from"./index-B_605KJ5.js";import{E as Me}from"./eye-BeBsJ5eR.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,21 @@
1
+ import{c as U,a as H,i as T,k as t,s as xe,r as N,D as ge,t as je,v as be,w as Ne,x as Pe,y as ve,I as ne,B as O,S as we,L as A,z as ye,A as ue,F as Ce,G as ke,H as S,J as _,K as Se,N as Ee,m as q,g as F,O as Le,Q as Ie,h as ae,U as He,V as le,W as $e,X as Te,Y as Oe,Z as Re,_ as Ae,$ as Fe,b as De,e as _e,a0 as Me,a1 as Ue}from"./index-B_605KJ5.js";/**
2
+ * @license lucide-react v0.562.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const We=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],ze=U("arrow-left-right",We);/**
7
+ * @license lucide-react v0.562.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Be=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],re=U("code-xml",Be);/**
12
+ * @license lucide-react v0.562.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Ke=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],me=U("folder",Ke);/**
17
+ * @license lucide-react v0.562.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Ve=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],he=U("monitor",Ve);function oe(a){const e=H.c(19),{narrow:s,title:o,subtitle:x,icon:i}=a,n=s===void 0?!1:s,c=i===void 0?he:i,d=n?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10";let l;e[0]!==d?(l=T("w-full",d),e[0]=d,e[1]=l):l=e[1];const f=n&&"justify-center";let y;e[2]!==f?(y=T("flex items-center gap-1 mb-2",f),e[2]=f,e[3]=y):y=e[3];let m;e[4]!==c?(m=t.jsx("div",{className:"p-2 pl-0 rounded-lg",children:t.jsx(c,{className:"h-6 w-6 text-muted-foreground"})}),e[4]=c,e[5]=m):m=e[5];let b;e[6]!==o?(b=t.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:o}),e[6]=o,e[7]=b):b=e[7];let g;e[8]!==y||e[9]!==m||e[10]!==b?(g=t.jsxs("div",{className:y,children:[m,b]}),e[8]=y,e[9]=m,e[10]=b,e[11]=g):g=e[11];let j;e[12]!==n||e[13]!==x?(j=x&&t.jsx("p",{className:T("text-muted-foreground",n&&"mb-10 text-center"),children:x}),e[12]=n,e[13]=x,e[14]=j):j=e[14];let p;return e[15]!==j||e[16]!==l||e[17]!==g?(p=t.jsxs("div",{className:l,children:[g,j]}),e[15]=j,e[16]=l,e[17]=g,e[18]=p):p=e[18],p}function qe(a){return a.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Je(a){const e=a.split("/").filter(Boolean);return e[e.length-1]||a}function Xe({open:a,onOpenChange:e,initialDirectory:s,onListDirectories:o,onConfirm:x,isSubmitting:i=!1}){var Q;const n=xe("localProjects.newProjectModal"),[c,d]=N.useState("new"),[l,f]=N.useState(""),[y,m]=N.useState([]),[b,g]=N.useState({}),[j,p]=N.useState([]),[P,C]=N.useState(null),[v,k]=N.useState(""),[u,w]=N.useState(null),[E,L]=N.useState(null),[$,R]=N.useState(null),W=N.useRef(null);N.useEffect(()=>{a&&(d("new"),f(""),m(s?s.roots:[]),g(s?{[s.currentPath]:s.entries}:{}),p(s?[s.currentPath]:[]),C((s==null?void 0:s.currentPath)??null),k(""),w(null),L(null),R(null),setTimeout(()=>{var r;return(r=W.current)==null?void 0:r.focus()},0))},[s,a]),N.useEffect(()=>{a&&setTimeout(()=>{var r;c==="new"&&((r=W.current)==null||r.focus())},0)},[c,a]);const z=qe(l),B=z?`${ve}/${z}`:"",D=v.trim(),Y=c==="new"?!!z:!!D,K=async r=>{w(null),R(r??"__root__");try{const h=await o(r);if(!r){m(h.roots),C(h.currentPath),g({[h.currentPath]:h.entries}),p([h.currentPath]);return}y.length===0&&(m([{name:Je(h.currentPath),localPath:h.currentPath}]),C(h.currentPath)),g(I=>({...I,[h.currentPath]:h.entries})),p(I=>I.includes(h.currentPath)?I:[...I,h.currentPath])}catch(h){w(h instanceof Error?h.message:String(h))}finally{R(null)}},fe=async r=>{if(j.includes(r)){p(h=>h.filter(I=>I!==r));return}if(b[r]){p(h=>[...h,r]);return}await K(r)},Z=(r,h,I)=>{const V=j.includes(r),pe=v===r,ee=b[r]??[],te=$===r;return t.jsxs("div",{children:[t.jsxs("div",{className:T("grid grid-cols-[auto_1fr] items-center gap-2 px-3 py-2",pe?"bg-muted":"hover:bg-muted/50"),style:{paddingLeft:`${12+I*16}px`},children:[t.jsx("button",{type:"button",className:"flex h-6 w-6 items-center justify-center rounded hover:bg-background disabled:opacity-50",onClick:()=>void fe(r),disabled:te,children:te?t.jsx(A,{className:"h-4 w-4 animate-spin text-muted-foreground"}):t.jsx(ue,{className:T("h-4 w-4 text-muted-foreground transition-transform",V&&"rotate-90")})}),t.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",onClick:()=>k(r),children:[V?t.jsx(Ce,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):t.jsx(me,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",children:h})]})]}),V&&ee.length>0?ee.map(se=>Z(se.localPath,se.name,I+1)):null]},r)},G=async()=>{if(Y){L(null);try{if(c==="new")await x({mode:"new",localPath:B,title:l.trim()});else{const r=D.split("/").pop()||D;await x({mode:"existing",localPath:D,title:r})}e(!1)}catch(r){L(r instanceof Error?r.message:n("errors.addFailed"))}}};return t.jsx(ge,{open:a,onOpenChange:r=>!i&&e(r),children:t.jsxs(je,{size:"sm",children:[t.jsxs(be,{className:"space-y-4",children:[t.jsx(Ne,{children:n("title")}),t.jsx(Pe,{value:c,onValueChange:d,options:[{value:"new",label:n("tabs.new")},{value:"existing",label:n("tabs.existing")}],className:"w-full mb-2",optionClassName:"flex-1 justify-center"}),c==="new"?t.jsxs("div",{className:"space-y-2",children:[t.jsx(ne,{ref:W,type:"text",value:l,onChange:r=>f(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.nativeEvent.isComposing&&G(),r.key==="Escape"&&!r.nativeEvent.isComposing&&!i&&e(!1)},disabled:i,placeholder:n("fields.projectName")}),B&&t.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:B})]}):t.jsxs("div",{className:"space-y-2",children:[t.jsx(ne,{type:"text",value:v,onChange:r=>k(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.nativeEvent.isComposing&&K(v||void 0)},disabled:i,placeholder:n("fields.existingPathPlaceholder")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("fields.existingPathHelp")}),t.jsx("div",{className:"flex justify-end",children:t.jsx(O,{type:"button",variant:"ghost",size:"sm",onClick:()=>void K("~"),disabled:$!==null||i,children:n("actions.loadRoot")})}),y.length>0?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:n("serverFolders")}),t.jsxs(we,{className:"max-h-64 rounded-xl border border-border",children:[y.map(r=>Z(r.localPath,r.name,0)),P&&((Q=b[P])==null?void 0:Q.length)===0?t.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:n("emptySubfolders")}):null]})]}):$?t.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-border px-3 py-2 text-sm text-muted-foreground",children:[t.jsx(A,{className:"h-4 w-4 animate-spin"}),n("loadingFolders")]}):null,u?t.jsx("p",{className:"text-xs text-destructive",children:u}):null]}),E?t.jsx("p",{className:"text-xs text-destructive",children:E}):null]}),t.jsxs(ye,{children:[t.jsx(O,{type:"button",variant:"ghost",onClick:()=>e(!1),disabled:i,children:n("actions.cancel")}),t.jsxs(O,{type:"button",onClick:()=>void G(),disabled:!Y||i,children:[i?t.jsx(A,{className:"mr-2 h-4 w-4 animate-spin"}):null,n(i?"actions.adding":"actions.addProject")]})]})]})})}function Ye(a){const e=H.c(9),{text:s}=a,[o,x]=N.useState(!1);let i;e[0]!==s?(i=async function(){await navigator.clipboard.writeText(s),x(!0),setTimeout(()=>x(!1),2e3)},e[0]=s,e[1]=i):i=e[1];const n=i;let c;e[2]!==n?(c=()=>void n(),e[2]=n,e[3]=c):c=e[3];let d;e[4]!==o?(d=o?t.jsx(Ae,{className:"h-4 w-4 text-green-400"}):t.jsx(Fe,{className:"h-4 w-4"}),e[4]=o,e[5]=d):d=e[5];let l;return e[6]!==c||e[7]!==d?(l=t.jsx(O,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:c,children:d}),e[6]=c,e[7]=d,e[8]=l):l=e[8],l}function ce(a){const e=H.c(3),{children:s}=a;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ue,{className:"inline h-4 w-4 opacity-40"}),e[0]=o):o=e[0];let x;return e[1]!==s?(x=t.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center group bg-background border border-border text-foreground rounded-xl p-1.5 pl-3 font-mono text-sm",children:[t.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[o,t.jsx("code",{children:s})]}),t.jsx(Ye,{text:s})]}),e[1]=s,e[2]=x):x=e[2],x}function M(a){const e=H.c(2),{children:s}=a;let o;return e[0]!==s?(o=t.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:s}),e[0]=s,e[1]=o):o=e[1],o}function J(a){const e=H.c(2),{children:s}=a;let o;return e[0]!==s?(o=t.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:s}),e[0]=s,e[1]=o):o=e[1],o}function X(a){const e=H.c(11),{icon:s,title:o,subtitle:x,iconClassName:i}=a,n=i||"h-8 w-8 text-muted-foreground";let c;e[0]!==s||e[1]!==n?(c=t.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:t.jsx(s,{className:n})}),e[0]=s,e[1]=n,e[2]=c):c=e[2];let d;e[3]!==o?(d=t.jsx("span",{className:"text-sm font-medium",children:o}),e[3]=o,e[4]=d):d=e[4];let l;e[5]!==x?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:x}),e[5]=x,e[6]=l):l=e[6];let f;return e[7]!==c||e[8]!==d||e[9]!==l?(f=t.jsxs("div",{className:"flex flex-col items-center gap-0",children:[c,d,l]}),e[7]=c,e[8]=d,e[9]=l,e[10]=f):f=e[10],f}function ie(){const a=H.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{className:"h-4 w-4 text-muted-foreground"}),a[0]=e):e=a[0],e}function de(a){const e=H.c(12),{number:s,title:o,children:x}=a;let i;e[0]!==s?(i=t.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[s,"."]}),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==o?(n=t.jsx("h3",{className:"font-medium text-foreground mb-2",children:o}),e[2]=o,e[3]=n):n=e[3];let c;e[4]!==i||e[5]!==n?(c=t.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[i,n]}),e[4]=i,e[5]=n,e[6]=c):c=e[6];let d;e[7]!==x?(d=t.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:x}),e[7]=x,e[8]=d):d=e[8];let l;return e[9]!==c||e[10]!==d?(l=t.jsx("div",{className:"flex gap-4",children:t.jsxs("div",{className:"flex-1 min-w-0",children:[c,d]})}),e[9]=c,e[10]=d,e[11]=l):l=e[11],l}function Ze(a){const e=H.c(37),{localPath:s,iconDataUrl:o,loading:x,onClick:i,onHide:n}=a,c=Ie(Ge);let d;e[0]!==s?(d=F.localProjectOpen(s),e[0]=s,e[1]=d):d=e[1];const l=ae(d);let f;e[2]!==s?(f=F.localProjectHide(s),e[2]=s,e[3]=f):f=e[3];const y=ae(f),m=x||l||y,b=m&&"opacity-50 cursor-not-allowed";let g;e[4]!==b?(g=T("border border-border hover:border-primary/30 rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",b),e[4]=b,e[5]=g):g=e[5];let j;e[6]!==o||e[7]!==s||e[8]!==c?(j=c?t.jsx(He,{iconDataUrl:o,alt:`${le(s)} icon`,className:"h-5.5 w-5.5",fallback:t.jsx(me,{className:"h-5.5 w-5.5 text-muted-foreground flex-shrink-0"})}):null,e[6]=o,e[7]=s,e[8]=c,e[9]=j):j=e[9];let p;e[10]!==s?(p=le(s),e[10]=s,e[11]=p):p=e[11];let P;e[12]!==p?(P=t.jsx("span",{className:"font-medium text-foreground truncate flex-1 pr-10",children:p}),e[12]=p,e[13]=P):P=e[13];let C;e[14]!==m?(C=m?t.jsx(A,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):null,e[14]=m,e[15]=C):C=e[15];let v;e[16]!==m||e[17]!==i||e[18]!==g||e[19]!==j||e[20]!==P||e[21]!==C?(v=t.jsx($e,{asChild:!0,children:t.jsxs("button",{className:g,disabled:m,onClick:i,children:[j,P,C]})}),e[16]=m,e[17]=i,e[18]=g,e[19]=j,e[20]=P,e[21]=C,e[22]=v):v=e[22];let k;e[23]!==s?(k=t.jsx(Te,{children:t.jsx("p",{children:s})}),e[23]=s,e[24]=k):k=e[24];let u;e[25]!==k||e[26]!==v?(u=t.jsxs(Oe,{children:[v,k]}),e[25]=k,e[26]=v,e[27]=u):u=e[27];let w;e[28]!==n?(w=R=>{R.stopPropagation(),n()},e[28]=n,e[29]=w):w=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Re,{className:"h-4 w-4"}),e[30]=E):E=e[30];let L;e[31]!==m||e[32]!==w?(L=t.jsx(O,{variant:"ghost",size:"icon",className:"absolute right-2 top-1/2 h-7 w-7 -translate-y-1/2 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",disabled:m,onClick:w,children:E}),e[31]=m,e[32]=w,e[33]=L):L=e[33];let $;return e[34]!==u||e[35]!==L?($=t.jsxs("div",{className:"relative group",children:[u,L]}),e[34]=u,e[35]=L,e[36]=$):$=e[36],$}function Ge(a){return a.showProjectIconsInSidebar}function Qe({connectionStatus:a,ready:e,snapshot:s,startingLocalPath:o,commandError:x,onOpenProject:i,onHideProject:n,onListDirectories:c,onCreateProject:d}){const l=xe("localProjects"),[f,y]=ke(),[m,b]=N.useState(!1),[g,j]=N.useState(null),p=N.useMemo(()=>(s==null?void 0:s.projects)??[],[s==null?void 0:s.projects]),P=a==="connecting"||!e,C=a==="connected"&&e,v=f.get("newProject")==="1";N.useEffect(()=>{C&&v&&b(!0)},[C,v]);const k=u=>{if(b(u),!u&&v){const w=new URLSearchParams(f);w.delete("newProject"),y(w,{replace:!0})}};return t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[C?t.jsxs(t.Fragment,{children:[t.jsx(oe,{title:(s==null?void 0:s.machine.displayName)??l("connected.title"),subtitle:l("connected.subtitle",{appName:S})}),t.jsxs("div",{className:"w-full px-6 mb-10",children:[t.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[t.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:l("connected.projectsTitle")}),t.jsxs(O,{variant:"default",size:"sm",onClick:()=>b(!0),children:[t.jsx(Ee,{className:"h-4 w-4 mr-1.5"}),l("actions.addProject")]})]}),p.length>0?t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-4 3xl:grid-cols-5 gap-2",children:p.map(u=>t.jsx(Ze,{localPath:u.localPath,iconDataUrl:u.iconDataUrl,loading:o===u.localPath,onClick:()=>{q(F.localProjectOpen(u.localPath),()=>i(u.localPath),{statusLabel:l("actions.openingProject")})},onHide:()=>{q(F.localProjectHide(u.localPath),()=>n(u.localPath),{statusLabel:l("actions.hidingProject")})}},u.localPath))}):t.jsx(M,{children:t.jsx("p",{className:"text-sm text-muted-foreground",children:l("connected.empty")})}),x?t.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3 mt-4",children:x}):null]})]}):t.jsxs(t.Fragment,{children:[t.jsx(oe,{narrow:!0,icon:re,title:P?l("pageHeader.connectingTitle",{appName:S}):l("pageHeader.connectTitle",{appName:S}),subtitle:P?l("pageHeader.connectingSubtitle",{appName:S}):l("pageHeader.connectSubtitle",{appName:S})}),t.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[t.jsx(J,{children:l("status.title")}),t.jsx("div",{className:"mb-8",children:t.jsx(M,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(A,{className:"h-4 w-4 text-muted-foreground animate-spin"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:P?l("status.connecting",{appName:S}):t.jsx(t.Fragment,{children:l.rich("status.notConnected",{appName:S,cli:()=>t.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:_()})})})})]})})}),P?null:t.jsxs("div",{className:"mb-10",children:[t.jsx(J,{children:l("howItWorks.title")}),t.jsx(M,{children:t.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[t.jsx(X,{icon:Se,title:`${S} CLI`,subtitle:l("howItWorks.onYourMachine")}),t.jsx(ie,{}),t.jsx(X,{icon:he,title:`${S} Server`,subtitle:l("howItWorks.localWebSocket")}),t.jsx(ie,{}),t.jsx(X,{icon:re,title:`${S} UI`,subtitle:l("howItWorks.projectChat")})]})})]}),P?null:t.jsxs("div",{className:"mb-10",children:[t.jsx(J,{children:l("setup.title")}),t.jsx(M,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(de,{number:1,title:l("setup.steps.start.title",{appName:S}),children:[t.jsx("p",{children:l("setup.steps.start.description")}),t.jsx(ce,{children:_()})]}),t.jsxs(de,{number:2,title:l("setup.steps.openUi.title"),children:[t.jsx("p",{children:l("setup.steps.openUi.description",{appName:S})}),t.jsx(ce,{children:"http://localhost:3210/local"})]}),t.jsxs("div",{className:"mt-8",children:[t.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:l("setup.notesTitle")}),t.jsxs("div",{className:"space-y-3 text-sm",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:_("").trim()}),t.jsx("span",{className:"text-muted-foreground",children:l("setup.notes.currentDirectory")})]}),t.jsxs("div",{className:"flex gap-4",children:[t.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:_("--no-open")}),t.jsx("span",{className:"text-muted-foreground",children:l("setup.notes.noOpen")})]})]})]})]})})]})]})]}),t.jsx(Xe,{open:m,onOpenChange:k,initialDirectory:(s==null?void 0:s.rootDirectory)??null,onListDirectories:c,isSubmitting:g!==null,onConfirm:async u=>{const w=F.localProjectCreate(u.localPath);j(u.localPath);try{await q(w,()=>d(u),{statusLabel:l("actions.addingProject")})}finally{j(E=>E===u.localPath?null:E)}}}),t.jsx("div",{className:"py-4 text-center",children:t.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",Le.split("/")[1]]})})]})}function tt(){const a=H.c(15),e=De(),s=_e(),o=Me(),x=Ue();let i;a[0]!==o||a[1]!==e||a[2]!==s||a[3]!==x?(i={...e,...s,...o,...x},a[0]=o,a[1]=e,a[2]=s,a[3]=x,a[4]=i):i=a[4];const n=i;let c;return a[5]!==n.commandError||a[6]!==n.connectionStatus||a[7]!==n.handleCreateProject||a[8]!==n.handleHideLocalProject||a[9]!==n.handleListDirectories||a[10]!==n.handleOpenLocalProject||a[11]!==n.localProjects||a[12]!==n.localProjectsReady||a[13]!==n.startingLocalPath?(c=t.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:t.jsx(Qe,{connectionStatus:n.connectionStatus,ready:n.localProjectsReady,snapshot:n.localProjects,startingLocalPath:n.startingLocalPath,commandError:n.commandError,onOpenProject:n.handleOpenLocalProject,onHideProject:n.handleHideLocalProject,onListDirectories:n.handleListDirectories,onCreateProject:n.handleCreateProject})}),a[5]=n.commandError,a[6]=n.connectionStatus,a[7]=n.handleCreateProject,a[8]=n.handleHideLocalProject,a[9]=n.handleListDirectories,a[10]=n.handleOpenLocalProject,a[11]=n.localProjects,a[12]=n.localProjectsReady,a[13]=n.startingLocalPath,a[14]=c):c=a[14],c}export{tt as LocalProjectsPage};
@@ -0,0 +1,56 @@
1
+ import{c as De,a as Fe,i as Ae,a2 as Ma,k as n,s as nt,d as qs,a3 as La,a4 as Ut,a5 as Da,a6 as gt,a7 as Jn,I as Ue,a8 as J,a9 as X,aa as te,ab as ee,ac as zr,B as ie,Z as Br,ad as C,ae as $r,N as Vr,af as pt,ag as Zr,ah as Ws,T as Xn,u as Fa,b as Ua,r as k,g as Oe,h as Me,m as Le,ai as Kr,aj as za,ak as Rt,al as qr,L as Re,am as Ls,an as Wr,ao as Ds,ap as Fs,aq as Hr,ar as Gr,e as Qr,a0 as Yr,a1 as Jr,as as Xr,at as ns,O as ei,au as We,av as He,aw as Ge,Q as Te,ax as Qe,ay as ea,az as ti,aA as si,aB as zt,aC as ni,aD as ai,aE as re,H as ta,aF as Ba,aG as sa,E as ri,Y as ii,W as li,X as oi,aH as ci,aI as di,aJ as Is,aK as As,aL as Ps,aM as ui,aN as na,aO as aa,aP as ra,aQ as mi,aR as ia,aS as la,aT as fi,aU as as,aV as rs,aW as hi,aX as Ct,aY as pi,aZ as Ye,a_ as gi,a$ as xi,b0 as oa,b1 as ca,b2 as vi,b3 as bi,b4 as yi,b5 as da}from"./index-B_605KJ5.js";import{E as ua}from"./eye-BeBsJ5eR.js";/**
2
+ * @license lucide-react v0.562.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ki=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],ji=De("bell",ki);/**
7
+ * @license lucide-react v0.562.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const _i=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],$a=De("chart-column",_i);/**
12
+ * @license lucide-react v0.562.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const wi=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],Va=De("cloud-download",wi);/**
17
+ * @license lucide-react v0.562.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Ni=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Ci=De("command",Ni);/**
22
+ * @license lucide-react v0.562.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Ti=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ma=De("eye-off",Ti);/**
27
+ * @license lucide-react v0.562.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Ri=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Si=De("info",Ri);/**
32
+ * @license lucide-react v0.562.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Ei=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],Ii=De("message-square-quote",Ei);/**
37
+ * @license lucide-react v0.562.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const Ai=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Pi=De("palette",Ai);/**
42
+ * @license lucide-react v0.562.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Oi=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Za=De("rotate-ccw",Oi);/**
47
+ * @license lucide-react v0.562.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const Mi=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Li=De("settings-2",Mi);/**
52
+ * @license lucide-react v0.562.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const Di=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Fi=De("shield",Di),Ui="https://kaizenai.codes";function zi(t){return Ui}function Bi(t){return zi()}function $i(t,e){return`${((t==null?void 0:t.trim())||Bi()).replace(/\/+$/,"")}/dashboard`}function Je(t){const e=Fe.c(18);let a,s,i,l,o,c;e[0]!==t?({children:a,className:s,icon:i,type:o,variant:c,...l}=t,e[0]=t,e[1]=a,e[2]=s,e[3]=i,e[4]=l,e[5]=o,e[6]=c):(a=e[1],s=e[2],i=e[3],l=e[4],o=e[5],c=e[6]);const d=o===void 0?"button":o,m=c===void 0?"outline":c;let u;e[7]!==s||e[8]!==m?(u=Ae(Ma({variant:m,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",s),e[7]=s,e[8]=m,e[9]=u):u=e[9];let b;e[10]!==a?(b=a?n.jsx("span",{children:a}):null,e[10]=a,e[11]=b):b=e[11];let g;return e[12]!==i||e[13]!==l||e[14]!==u||e[15]!==b||e[16]!==d?(g=n.jsxs("button",{type:d,className:u,...l,children:[i,b]}),e[12]=i,e[13]=l,e[14]=u,e[15]=b,e[16]=d,e[17]=g):g=e[17],g}var z;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function a(i){throw new Error}t.assertNever=a,t.arrayToEnum=i=>{const l={};for(const o of i)l[o]=o;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),o={};for(const c of l)o[c]=i[c];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&l.push(o);return l},t.find=(i,l)=>{for(const o of i)if(l(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function s(i,l=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(l)}t.joinValues=s,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(z||(z={}));var fa;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(fa||(fa={}));const y=z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),et=t=>{switch(typeof t){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(t)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(t)?y.array:t===null?y.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?y.promise:typeof Map<"u"&&t instanceof Map?y.map:typeof Set<"u"&&t instanceof Set?y.set:typeof Date<"u"&&t instanceof Date?y.date:y.object;default:return y.unknown}},h=z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ve extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(l){return l.message},s={_errors:[]},i=l=>{for(const o of l.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)s._errors.push(a(o));else{let c=s,d=0;for(;d<o.path.length;){const m=o.path[d];d===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(a(o))):c[m]=c[m]||{_errors:[]},c=c[m],d++}}};return i(this),s}static assert(e){if(!(e instanceof Ve))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a={},s=[];for(const i of this.issues)if(i.path.length>0){const l=i.path[0];a[l]=a[l]||[],a[l].push(e(i))}else s.push(e(i));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}Ve.create=t=>new Ve(t);const Us=(t,e)=>{let a;switch(t.code){case h.invalid_type:t.received===y.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,z.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:a=`Unrecognized key(s) in object: ${z.joinValues(t.keys,", ")}`;break;case h.invalid_union:a="Invalid input";break;case h.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${z.joinValues(t.options)}`;break;case h.invalid_enum_value:a=`Invalid enum value. Expected ${z.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:a="Invalid function arguments";break;case h.invalid_return_type:a="Invalid function return type";break;case h.invalid_date:a="Invalid date";break;case h.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:z.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case h.too_small:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:a="Invalid input";break;case h.too_big:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?a=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:a="Invalid input";break;case h.custom:a="Invalid input";break;case h.invalid_intersection_types:a="Intersection results could not be merged";break;case h.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:a="Number must be finite";break;default:a=e.defaultError,z.assertNever(t)}return{message:a}};let Vi=Us;function Zi(){return Vi}const Ki=t=>{const{data:e,path:a,errorMaps:s,issueData:i}=t,l=[...a,...i.path||[]],o={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let c="";const d=s.filter(m=>!!m).slice().reverse();for(const m of d)c=m(o,{data:e,defaultError:c}).message;return{...i,path:l,message:c}};function v(t,e){const a=Zi(),s=Ki({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Us?void 0:Us].filter(i=>!!i)});t.common.issues.push(s)}class Se{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){const s=[];for(const i of a){if(i.status==="aborted")return T;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,a){const s=[];for(const i of a){const l=await i.key,o=await i.value;s.push({key:l,value:o})}return Se.mergeObjectSync(e,s)}static mergeObjectSync(e,a){const s={};for(const i of a){const{key:l,value:o}=i;if(l.status==="aborted"||o.status==="aborted")return T;l.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(s[l.value]=o.value)}return{status:e.value,value:s}}}const T=Object.freeze({status:"aborted"}),$t=t=>({status:"dirty",value:t}),Pe=t=>({status:"valid",value:t}),ha=t=>t.status==="aborted",pa=t=>t.status==="dirty",Et=t=>t.status==="valid",ls=t=>typeof Promise<"u"&&t instanceof Promise;var _;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(_||(_={}));class at{constructor(e,a,s,i){this._cachedPath=[],this.parent=e,this.data=a,this._path=s,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ga=(t,e)=>{if(Et(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new Ve(t.common.issues);return this._error=a,this._error}}};function O(t){if(!t)return{};const{errorMap:e,invalid_type_error:a,required_error:s,description:i}=t;if(e&&(a||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,c)=>{const{message:d}=t;return o.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:d??s??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:d??a??c.defaultError}},description:i}}class F{get description(){return this._def.description}_getType(e){return et(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:et(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Se,ctx:{common:e.parent.common,data:e.data,parsedType:et(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const a=this._parse(e);if(ls(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){const a=this._parse(e);return Promise.resolve(a)}parse(e,a){const s=this.safeParse(e,a);if(s.success)return s.data;throw s.error}safeParse(e,a){const s={common:{issues:[],async:(a==null?void 0:a.async)??!1,contextualErrorMap:a==null?void 0:a.errorMap},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},i=this._parseSync({data:e,path:s.path,parent:s});return ga(s,i)}"~validate"(e){var s,i;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)};if(!this["~standard"].async)try{const l=this._parseSync({data:e,path:[],parent:a});return Et(l)?{value:l.value}:{issues:a.common.issues}}catch(l){(i=(s=l==null?void 0:l.message)==null?void 0:s.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(l=>Et(l)?{value:l.value}:{issues:a.common.issues})}async parseAsync(e,a){const s=await this.safeParseAsync(e,a);if(s.success)return s.data;throw s.error}async safeParseAsync(e,a){const s={common:{issues:[],contextualErrorMap:a==null?void 0:a.errorMap,async:!0},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},i=this._parse({data:e,path:s.path,parent:s}),l=await(ls(i)?i:Promise.resolve(i));return ga(s,l)}refine(e,a){const s=i=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(i):a;return this._refinement((i,l)=>{const o=e(i),c=()=>l.addIssue({code:h.custom,...s(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,a){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof a=="function"?a(s,i):a),!1))}_refinement(e){return new At({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return st.create(this,this._def)}nullable(){return Pt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ze.create(this)}promise(){return us.create(this,this._def)}or(e){return cs.create([this,e],this._def)}and(e){return ds.create(this,e,this._def)}transform(e){return new At({...O(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const a=typeof e=="function"?e:()=>e;return new $s({...O(this._def),innerType:this,defaultValue:a,typeName:R.ZodDefault})}brand(){return new hl({typeName:R.ZodBranded,type:this,...O(this._def)})}catch(e){const a=typeof e=="function"?e:()=>e;return new Vs({...O(this._def),innerType:this,catchValue:a,typeName:R.ZodCatch})}describe(e){const a=this.constructor;return new a({...this._def,description:e})}pipe(e){return Hs.create(this,e)}readonly(){return Zs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const qi=/^c[^\s-]{8,}$/i,Wi=/^[0-9a-z]+$/,Hi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Gi=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Qi=/^[a-z0-9_-]{21}$/i,Yi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ji=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,el="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Os;const tl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,nl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,al=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,il=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ka="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ll=new RegExp(`^${Ka}$`);function qa(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const a=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${a}`}function ol(t){return new RegExp(`^${qa(t)}$`)}function cl(t){let e=`${Ka}T${qa(t)}`;const a=[];return a.push(t.local?"Z?":"Z"),t.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,new RegExp(`^${e}$`)}function dl(t,e){return!!((e==="v4"||!e)&&tl.test(t)||(e==="v6"||!e)&&nl.test(t))}function ul(t,e){if(!Yi.test(t))return!1;try{const[a]=t.split(".");if(!a)return!1;const s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),i=JSON.parse(atob(s));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function ml(t,e){return!!((e==="v4"||!e)&&sl.test(t)||(e==="v6"||!e)&&al.test(t))}class tt extends F{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const l=this._getOrReturnCtx(e);return v(l,{code:h.invalid_type,expected:y.string,received:l.parsedType}),T}const s=new Se;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),v(i,{code:h.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),s.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),v(i,{code:h.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),s.dirty());else if(l.kind==="length"){const o=e.data.length>l.value,c=e.data.length<l.value;(o||c)&&(i=this._getOrReturnCtx(e,i),o?v(i,{code:h.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):c&&v(i,{code:h.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),s.dirty())}else if(l.kind==="email")Xi.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"email",code:h.invalid_string,message:l.message}),s.dirty());else if(l.kind==="emoji")Os||(Os=new RegExp(el,"u")),Os.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"emoji",code:h.invalid_string,message:l.message}),s.dirty());else if(l.kind==="uuid")Gi.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"uuid",code:h.invalid_string,message:l.message}),s.dirty());else if(l.kind==="nanoid")Qi.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"nanoid",code:h.invalid_string,message:l.message}),s.dirty());else if(l.kind==="cuid")qi.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"cuid",code:h.invalid_string,message:l.message}),s.dirty());else if(l.kind==="cuid2")Wi.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"cuid2",code:h.invalid_string,message:l.message}),s.dirty());else if(l.kind==="ulid")Hi.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"ulid",code:h.invalid_string,message:l.message}),s.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),v(i,{validation:"url",code:h.invalid_string,message:l.message}),s.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"regex",code:h.invalid_string,message:l.message}),s.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),v(i,{code:h.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),s.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),v(i,{code:h.invalid_string,validation:{startsWith:l.value},message:l.message}),s.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),v(i,{code:h.invalid_string,validation:{endsWith:l.value},message:l.message}),s.dirty()):l.kind==="datetime"?cl(l).test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{code:h.invalid_string,validation:"datetime",message:l.message}),s.dirty()):l.kind==="date"?ll.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{code:h.invalid_string,validation:"date",message:l.message}),s.dirty()):l.kind==="time"?ol(l).test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{code:h.invalid_string,validation:"time",message:l.message}),s.dirty()):l.kind==="duration"?Ji.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"duration",code:h.invalid_string,message:l.message}),s.dirty()):l.kind==="ip"?dl(e.data,l.version)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"ip",code:h.invalid_string,message:l.message}),s.dirty()):l.kind==="jwt"?ul(e.data,l.alg)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"jwt",code:h.invalid_string,message:l.message}),s.dirty()):l.kind==="cidr"?ml(e.data,l.version)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"cidr",code:h.invalid_string,message:l.message}),s.dirty()):l.kind==="base64"?rl.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"base64",code:h.invalid_string,message:l.message}),s.dirty()):l.kind==="base64url"?il.test(e.data)||(i=this._getOrReturnCtx(e,i),v(i,{validation:"base64url",code:h.invalid_string,message:l.message}),s.dirty()):z.assertNever(l);return{status:s.value,value:e.data}}_regex(e,a,s){return this.refinement(i=>e.test(i),{validation:a,code:h.invalid_string,..._.errToObj(s)})}_addCheck(e){return new tt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,..._.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,..._.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",..._.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,..._.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a==null?void 0:a.position,..._.errToObj(a==null?void 0:a.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,..._.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,..._.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,..._.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,..._.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,..._.errToObj(a)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new tt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new tt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new tt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}}tt.create=t=>new tt({checks:[],typeName:R.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...O(t)});function fl(t,e){const a=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=a>s?a:s,l=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return l%o/10**i}class Vt extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==y.number){const l=this._getOrReturnCtx(e);return v(l,{code:h.invalid_type,expected:y.number,received:l.parsedType}),T}let s;const i=new Se;for(const l of this._def.checks)l.kind==="int"?z.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?fl(e.data,l.value)!==0&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),v(s,{code:h.not_finite,message:l.message}),i.dirty()):z.assertNever(l);return{status:i.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,_.toString(a))}gt(e,a){return this.setLimit("min",e,!1,_.toString(a))}lte(e,a){return this.setLimit("max",e,!0,_.toString(a))}lt(e,a){return this.setLimit("max",e,!1,_.toString(a))}setLimit(e,a,s,i){return new Vt({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:s,message:_.toString(i)}]})}_addCheck(e){return new Vt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(e)})}get minValue(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&z.isInteger(e.value))}get isFinite(){let e=null,a=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(a===null||s.value>a)&&(a=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(a)&&Number.isFinite(e)}}Vt.create=t=>new Vt({checks:[],typeName:R.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...O(t)});class Zt extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==y.bigint)return this._getInvalidInput(e);let s;const i=new Se;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),v(s,{code:h.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):z.assertNever(l);return{status:i.value,value:e.data}}_getInvalidInput(e){const a=this._getOrReturnCtx(e);return v(a,{code:h.invalid_type,expected:y.bigint,received:a.parsedType}),T}gte(e,a){return this.setLimit("min",e,!0,_.toString(a))}gt(e,a){return this.setLimit("min",e,!1,_.toString(a))}lte(e,a){return this.setLimit("max",e,!0,_.toString(a))}lt(e,a){return this.setLimit("max",e,!1,_.toString(a))}setLimit(e,a,s,i){return new Zt({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:s,message:_.toString(i)}]})}_addCheck(e){return new Zt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(a)})}get minValue(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}}Zt.create=t=>new Zt({checks:[],typeName:R.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...O(t)});class zs extends F{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const s=this._getOrReturnCtx(e);return v(s,{code:h.invalid_type,expected:y.boolean,received:s.parsedType}),T}return Pe(e.data)}}zs.create=t=>new zs({typeName:R.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...O(t)});class os extends F{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const l=this._getOrReturnCtx(e);return v(l,{code:h.invalid_type,expected:y.date,received:l.parsedType}),T}if(Number.isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return v(l,{code:h.invalid_date}),T}const s=new Se;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),v(i,{code:h.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),s.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),v(i,{code:h.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),s.dirty()):z.assertNever(l);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new os({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:_.toString(a)})}get minDate(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}}os.create=t=>new os({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:R.ZodDate,...O(t)});class xa extends F{_parse(e){if(this._getType(e)!==y.symbol){const s=this._getOrReturnCtx(e);return v(s,{code:h.invalid_type,expected:y.symbol,received:s.parsedType}),T}return Pe(e.data)}}xa.create=t=>new xa({typeName:R.ZodSymbol,...O(t)});class va extends F{_parse(e){if(this._getType(e)!==y.undefined){const s=this._getOrReturnCtx(e);return v(s,{code:h.invalid_type,expected:y.undefined,received:s.parsedType}),T}return Pe(e.data)}}va.create=t=>new va({typeName:R.ZodUndefined,...O(t)});class ba extends F{_parse(e){if(this._getType(e)!==y.null){const s=this._getOrReturnCtx(e);return v(s,{code:h.invalid_type,expected:y.null,received:s.parsedType}),T}return Pe(e.data)}}ba.create=t=>new ba({typeName:R.ZodNull,...O(t)});class ya extends F{constructor(){super(...arguments),this._any=!0}_parse(e){return Pe(e.data)}}ya.create=t=>new ya({typeName:R.ZodAny,...O(t)});class ka extends F{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Pe(e.data)}}ka.create=t=>new ka({typeName:R.ZodUnknown,...O(t)});class rt extends F{_parse(e){const a=this._getOrReturnCtx(e);return v(a,{code:h.invalid_type,expected:y.never,received:a.parsedType}),T}}rt.create=t=>new rt({typeName:R.ZodNever,...O(t)});class ja extends F{_parse(e){if(this._getType(e)!==y.undefined){const s=this._getOrReturnCtx(e);return v(s,{code:h.invalid_type,expected:y.void,received:s.parsedType}),T}return Pe(e.data)}}ja.create=t=>new ja({typeName:R.ZodVoid,...O(t)});class ze extends F{_parse(e){const{ctx:a,status:s}=this._processInputParams(e),i=this._def;if(a.parsedType!==y.array)return v(a,{code:h.invalid_type,expected:y.array,received:a.parsedType}),T;if(i.exactLength!==null){const o=a.data.length>i.exactLength.value,c=a.data.length<i.exactLength.value;(o||c)&&(v(a,{code:o?h.too_big:h.too_small,minimum:c?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&a.data.length<i.minLength.value&&(v(a,{code:h.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&a.data.length>i.maxLength.value&&(v(a,{code:h.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),a.common.async)return Promise.all([...a.data].map((o,c)=>i.type._parseAsync(new at(a,o,a.path,c)))).then(o=>Se.mergeArray(s,o));const l=[...a.data].map((o,c)=>i.type._parseSync(new at(a,o,a.path,c)));return Se.mergeArray(s,l)}get element(){return this._def.type}min(e,a){return new ze({...this._def,minLength:{value:e,message:_.toString(a)}})}max(e,a){return new ze({...this._def,maxLength:{value:e,message:_.toString(a)}})}length(e,a){return new ze({...this._def,exactLength:{value:e,message:_.toString(a)}})}nonempty(e){return this.min(1,e)}}ze.create=(t,e)=>new ze({type:t,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...O(e)});function St(t){if(t instanceof ue){const e={};for(const a in t.shape){const s=t.shape[a];e[a]=st.create(St(s))}return new ue({...t._def,shape:()=>e})}else return t instanceof ze?new ze({...t._def,type:St(t.element)}):t instanceof st?st.create(St(t.unwrap())):t instanceof Pt?Pt.create(St(t.unwrap())):t instanceof vt?vt.create(t.items.map(e=>St(e))):t}class ue extends F{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),a=z.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==y.object){const m=this._getOrReturnCtx(e);return v(m,{code:h.invalid_type,expected:y.object,received:m.parsedType}),T}const{status:s,ctx:i}=this._processInputParams(e),{shape:l,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof rt&&this._def.unknownKeys==="strip"))for(const m in i.data)o.includes(m)||c.push(m);const d=[];for(const m of o){const u=l[m],b=i.data[m];d.push({key:{status:"valid",value:m},value:u._parse(new at(i,b,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof rt){const m=this._def.unknownKeys;if(m==="passthrough")for(const u of c)d.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(m==="strict")c.length>0&&(v(i,{code:h.unrecognized_keys,keys:c}),s.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const u of c){const b=i.data[u];d.push({key:{status:"valid",value:u},value:m._parse(new at(i,b,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const m=[];for(const u of d){const b=await u.key,g=await u.value;m.push({key:b,value:g,alwaysSet:u.alwaysSet})}return m}).then(m=>Se.mergeObjectSync(s,m)):Se.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(e){return _.errToObj,new ue({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,s)=>{var l,o;const i=((o=(l=this._def).errorMap)==null?void 0:o.call(l,a,s).message)??s.defaultError;return a.code==="unrecognized_keys"?{message:_.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new ue({...this._def,unknownKeys:"strip"})}passthrough(){return new ue({...this._def,unknownKeys:"passthrough"})}extend(e){return new ue({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ue({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:R.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new ue({...this._def,catchall:e})}pick(e){const a={};for(const s of z.objectKeys(e))e[s]&&this.shape[s]&&(a[s]=this.shape[s]);return new ue({...this._def,shape:()=>a})}omit(e){const a={};for(const s of z.objectKeys(this.shape))e[s]||(a[s]=this.shape[s]);return new ue({...this._def,shape:()=>a})}deepPartial(){return St(this)}partial(e){const a={};for(const s of z.objectKeys(this.shape)){const i=this.shape[s];e&&!e[s]?a[s]=i:a[s]=i.optional()}return new ue({...this._def,shape:()=>a})}required(e){const a={};for(const s of z.objectKeys(this.shape))if(e&&!e[s])a[s]=this.shape[s];else{let l=this.shape[s];for(;l instanceof st;)l=l._def.innerType;a[s]=l}return new ue({...this._def,shape:()=>a})}keyof(){return Wa(z.objectKeys(this.shape))}}ue.create=(t,e)=>new ue({shape:()=>t,unknownKeys:"strip",catchall:rt.create(),typeName:R.ZodObject,...O(e)});ue.strictCreate=(t,e)=>new ue({shape:()=>t,unknownKeys:"strict",catchall:rt.create(),typeName:R.ZodObject,...O(e)});ue.lazycreate=(t,e)=>new ue({shape:t,unknownKeys:"strip",catchall:rt.create(),typeName:R.ZodObject,...O(e)});class cs extends F{_parse(e){const{ctx:a}=this._processInputParams(e),s=this._def.options;function i(l){for(const c of l)if(c.result.status==="valid")return c.result;for(const c of l)if(c.result.status==="dirty")return a.common.issues.push(...c.ctx.common.issues),c.result;const o=l.map(c=>new Ve(c.ctx.common.issues));return v(a,{code:h.invalid_union,unionErrors:o}),T}if(a.common.async)return Promise.all(s.map(async l=>{const o={...a,common:{...a.common,issues:[]},parent:null};return{result:await l._parseAsync({data:a.data,path:a.path,parent:o}),ctx:o}})).then(i);{let l;const o=[];for(const d of s){const m={...a,common:{...a.common,issues:[]},parent:null},u=d._parseSync({data:a.data,path:a.path,parent:m});if(u.status==="valid")return u;u.status==="dirty"&&!l&&(l={result:u,ctx:m}),m.common.issues.length&&o.push(m.common.issues)}if(l)return a.common.issues.push(...l.ctx.common.issues),l.result;const c=o.map(d=>new Ve(d));return v(a,{code:h.invalid_union,unionErrors:c}),T}}get options(){return this._def.options}}cs.create=(t,e)=>new cs({options:t,typeName:R.ZodUnion,...O(e)});function Bs(t,e){const a=et(t),s=et(e);if(t===e)return{valid:!0,data:t};if(a===y.object&&s===y.object){const i=z.objectKeys(e),l=z.objectKeys(t).filter(c=>i.indexOf(c)!==-1),o={...t,...e};for(const c of l){const d=Bs(t[c],e[c]);if(!d.valid)return{valid:!1};o[c]=d.data}return{valid:!0,data:o}}else if(a===y.array&&s===y.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const o=t[l],c=e[l],d=Bs(o,c);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return a===y.date&&s===y.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ds extends F{_parse(e){const{status:a,ctx:s}=this._processInputParams(e),i=(l,o)=>{if(ha(l)||ha(o))return T;const c=Bs(l.value,o.value);return c.valid?((pa(l)||pa(o))&&a.dirty(),{status:a.value,value:c.data}):(v(s,{code:h.invalid_intersection_types}),T)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([l,o])=>i(l,o)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ds.create=(t,e,a)=>new ds({left:t,right:e,typeName:R.ZodIntersection,...O(a)});class vt extends F{_parse(e){const{status:a,ctx:s}=this._processInputParams(e);if(s.parsedType!==y.array)return v(s,{code:h.invalid_type,expected:y.array,received:s.parsedType}),T;if(s.data.length<this._def.items.length)return v(s,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&s.data.length>this._def.items.length&&(v(s,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const l=[...s.data].map((o,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new at(s,o,s.path,c)):null}).filter(o=>!!o);return s.common.async?Promise.all(l).then(o=>Se.mergeArray(a,o)):Se.mergeArray(a,l)}get items(){return this._def.items}rest(e){return new vt({...this._def,rest:e})}}vt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vt({items:t,typeName:R.ZodTuple,rest:null,...O(e)})};class _a extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:a,ctx:s}=this._processInputParams(e);if(s.parsedType!==y.map)return v(s,{code:h.invalid_type,expected:y.map,received:s.parsedType}),T;const i=this._def.keyType,l=this._def.valueType,o=[...s.data.entries()].map(([c,d],m)=>({key:i._parse(new at(s,c,s.path,[m,"key"])),value:l._parse(new at(s,d,s.path,[m,"value"]))}));if(s.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of o){const m=await d.key,u=await d.value;if(m.status==="aborted"||u.status==="aborted")return T;(m.status==="dirty"||u.status==="dirty")&&a.dirty(),c.set(m.value,u.value)}return{status:a.value,value:c}})}else{const c=new Map;for(const d of o){const m=d.key,u=d.value;if(m.status==="aborted"||u.status==="aborted")return T;(m.status==="dirty"||u.status==="dirty")&&a.dirty(),c.set(m.value,u.value)}return{status:a.value,value:c}}}}_a.create=(t,e,a)=>new _a({valueType:e,keyType:t,typeName:R.ZodMap,...O(a)});class Kt extends F{_parse(e){const{status:a,ctx:s}=this._processInputParams(e);if(s.parsedType!==y.set)return v(s,{code:h.invalid_type,expected:y.set,received:s.parsedType}),T;const i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(v(s,{code:h.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),a.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(v(s,{code:h.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),a.dirty());const l=this._def.valueType;function o(d){const m=new Set;for(const u of d){if(u.status==="aborted")return T;u.status==="dirty"&&a.dirty(),m.add(u.value)}return{status:a.value,value:m}}const c=[...s.data.values()].map((d,m)=>l._parse(new at(s,d,s.path,m)));return s.common.async?Promise.all(c).then(d=>o(d)):o(c)}min(e,a){return new Kt({...this._def,minSize:{value:e,message:_.toString(a)}})}max(e,a){return new Kt({...this._def,maxSize:{value:e,message:_.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}}Kt.create=(t,e)=>new Kt({valueType:t,minSize:null,maxSize:null,typeName:R.ZodSet,...O(e)});class wa extends F{get schema(){return this._def.getter()}_parse(e){const{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}wa.create=(t,e)=>new wa({getter:t,typeName:R.ZodLazy,...O(e)});class Na extends F{_parse(e){if(e.data!==this._def.value){const a=this._getOrReturnCtx(e);return v(a,{received:a.data,code:h.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}}Na.create=(t,e)=>new Na({value:t,typeName:R.ZodLiteral,...O(e)});function Wa(t,e){return new It({values:t,typeName:R.ZodEnum,...O(e)})}class It extends F{_parse(e){if(typeof e.data!="string"){const a=this._getOrReturnCtx(e),s=this._def.values;return v(a,{expected:z.joinValues(s),received:a.parsedType,code:h.invalid_type}),T}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const a=this._getOrReturnCtx(e),s=this._def.values;return v(a,{received:a.data,code:h.invalid_enum_value,options:s}),T}return Pe(e.data)}get options(){return this._def.values}get enum(){const e={};for(const a of this._def.values)e[a]=a;return e}get Values(){const e={};for(const a of this._def.values)e[a]=a;return e}get Enum(){const e={};for(const a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return It.create(e,{...this._def,...a})}exclude(e,a=this._def){return It.create(this.options.filter(s=>!e.includes(s)),{...this._def,...a})}}It.create=Wa;class Ca extends F{_parse(e){const a=z.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==y.string&&s.parsedType!==y.number){const i=z.objectValues(a);return v(s,{expected:z.joinValues(i),received:s.parsedType,code:h.invalid_type}),T}if(this._cache||(this._cache=new Set(z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=z.objectValues(a);return v(s,{received:s.data,code:h.invalid_enum_value,options:i}),T}return Pe(e.data)}get enum(){return this._def.values}}Ca.create=(t,e)=>new Ca({values:t,typeName:R.ZodNativeEnum,...O(e)});class us extends F{unwrap(){return this._def.type}_parse(e){const{ctx:a}=this._processInputParams(e);if(a.parsedType!==y.promise&&a.common.async===!1)return v(a,{code:h.invalid_type,expected:y.promise,received:a.parsedType}),T;const s=a.parsedType===y.promise?a.data:Promise.resolve(a.data);return Pe(s.then(i=>this._def.type.parseAsync(i,{path:a.path,errorMap:a.common.contextualErrorMap})))}}us.create=(t,e)=>new us({type:t,typeName:R.ZodPromise,...O(e)});class At extends F{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:a,ctx:s}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:o=>{v(s,o),o.fatal?a.abort():a.dirty()},get path(){return s.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const o=i.transform(s.data,l);if(s.common.async)return Promise.resolve(o).then(async c=>{if(a.value==="aborted")return T;const d=await this._def.schema._parseAsync({data:c,path:s.path,parent:s});return d.status==="aborted"?T:d.status==="dirty"||a.value==="dirty"?$t(d.value):d});{if(a.value==="aborted")return T;const c=this._def.schema._parseSync({data:o,path:s.path,parent:s});return c.status==="aborted"?T:c.status==="dirty"||a.value==="dirty"?$t(c.value):c}}if(i.type==="refinement"){const o=c=>{const d=i.refinement(c,l);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(s.common.async===!1){const c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return c.status==="aborted"?T:(c.status==="dirty"&&a.dirty(),o(c.value),{status:a.value,value:c.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>c.status==="aborted"?T:(c.status==="dirty"&&a.dirty(),o(c.value).then(()=>({status:a.value,value:c.value}))))}if(i.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Et(o))return T;const c=i.transform(o.value,l);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:c}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Et(o)?Promise.resolve(i.transform(o.value,l)).then(c=>({status:a.value,value:c})):T);z.assertNever(i)}}At.create=(t,e,a)=>new At({schema:t,typeName:R.ZodEffects,effect:e,...O(a)});At.createWithPreprocess=(t,e,a)=>new At({schema:e,effect:{type:"preprocess",transform:t},typeName:R.ZodEffects,...O(a)});class st extends F{_parse(e){return this._getType(e)===y.undefined?Pe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}st.create=(t,e)=>new st({innerType:t,typeName:R.ZodOptional,...O(e)});class Pt extends F{_parse(e){return this._getType(e)===y.null?Pe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pt.create=(t,e)=>new Pt({innerType:t,typeName:R.ZodNullable,...O(e)});class $s extends F{_parse(e){const{ctx:a}=this._processInputParams(e);let s=a.data;return a.parsedType===y.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}$s.create=(t,e)=>new $s({innerType:t,typeName:R.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});class Vs extends F{_parse(e){const{ctx:a}=this._processInputParams(e),s={...a,common:{...a.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ls(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ve(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ve(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Vs.create=(t,e)=>new Vs({innerType:t,typeName:R.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});class Ta extends F{_parse(e){if(this._getType(e)!==y.nan){const s=this._getOrReturnCtx(e);return v(s,{code:h.invalid_type,expected:y.nan,received:s.parsedType}),T}return{status:"valid",value:e.data}}}Ta.create=t=>new Ta({typeName:R.ZodNaN,...O(t)});class hl extends F{_parse(e){const{ctx:a}=this._processInputParams(e),s=a.data;return this._def.type._parse({data:s,path:a.path,parent:a})}unwrap(){return this._def.type}}class Hs extends F{_parse(e){const{status:a,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return l.status==="aborted"?T:l.status==="dirty"?(a.dirty(),$t(l.value)):this._def.out._parseAsync({data:l.value,path:s.path,parent:s})})();{const i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?T:i.status==="dirty"?(a.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,a){return new Hs({in:e,out:a,typeName:R.ZodPipeline})}}class Zs extends F{_parse(e){const a=this._def.innerType._parse(e),s=i=>(Et(i)&&(i.value=Object.freeze(i.value)),i);return ls(a)?a.then(i=>s(i)):s(a)}unwrap(){return this._def.innerType}}Zs.create=(t,e)=>new Zs({innerType:t,typeName:R.ZodReadonly,...O(e)});var R;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(R||(R={}));const xt=tt.create,Ha=zs.create;rt.create;const Ga=ze.create,Gs=ue.create;cs.create;ds.create;vt.create;const pl=It.create;us.create;st.create;Pt.create;const gl=/^\d{4}-\d{2}-\d{2}$/,xl=Gs({title:xt().min(1),items:Ga(xt().min(1)).min(1)}),vl=Gs({version:xt().min(1),publishedAt:xt().regex(gl,"Expected YYYY-MM-DD"),title:xt().min(1),sections:Ga(xl).min(1),prerelease:Ha().optional()});Gs({changeType:pl(["feature","improvement","fix","internal","docs"]),title:xt().min(1),summary:xt().min(1),public:Ha()});const bl=[{version:"0.11.0",publishedAt:"2026-04-12",title:"Wider language support across Kaizen and the web app",sections:[{title:"New Features",items:["Expanded multilingual support: Kaizen and the web app now support English, Spanish, French, Japanese, Korean, Thai, and Chinese across the main user-facing product surfaces.","Locale-aware defaults and switching: Both apps now default to the user’s supported language when available, fall back to English otherwise, and keep the user’s explicit language choice on later visits."]},{title:"Improvements",items:["Localized web routing and SEO: The web app now serves locale-prefixed routes, localized metadata, and translated release content so public pages better match the visitor’s language.","Translation coverage and persistence polish: Language selection, settings, provider controls, chat surfaces, and release notes are more consistently translated across devices and sessions."]}]},{version:"0.10.0",publishedAt:"2026-04-11",title:"Qwen beta, OpenCode API keys, and usage tracking",sections:[{title:"New Features",items:["Qwen Code provider support (Beta): Kaizen now supports Qwen as a built-in provider with provider setup, model preferences, and UI integration across the chat workflow.","OpenCode API key provider support: OpenCode-backed providers can now run directly from your API key configuration, which makes models such as GML 5.1 available through your local OpenCode setup.","Usage tracking in Settings: The `/settings/usage` page now tracks Claude and Codex token usage with costs and daily breakdowns so account usage is easier to audit."]},{title:"Improvements",items:["General bug fixes and improvements: This release also includes provider catalog fixes, usage-bar polish, review follow-ups, and broader UI reliability improvements."]}]},{version:"0.9.0",publishedAt:"2026-04-10",title:"Live model catalogs, provider hardening, and relay URL keys",sections:[{title:"New Features",items:["Runtime-derived Codex model catalog: Codex model and reasoning controls now follow the live app-server catalog while safely falling back to Kaizen static defaults when discovery fails.","Smarter OpenRouter model selection: Kaizen now discovers the live OpenRouter model catalog from OpenCode and presents grouped model and quality choices in the chat preferences UI."]},{title:"Improvements",items:["Provider architecture and Gemini reliability improvements: Kaizen now uses provider-owned startup and catalog logic with better Gemini plan-mode handling and safer provider recovery paths.","Rotatable relay URL keys: Relay URLs are now shorter and rotatable while preserving the relay auth and wake flows.","Reduce Kaizen chat open latency: Provider-backed chats and sidebar refreshes stop triggering expensive transcript and usage scans during normal navigation.","Move chats between features: Chat organization now supports moving chats between project features with more reliable drag-and-drop handling."]}]},{version:"0.8.1",publishedAt:"2026-04-08",title:"Relay access sync and billing webhook guard",sections:[{title:"Improvements",items:["Relay access sync: Kaizen now re-checks relay authorization with the server instead of relying on stale local entitlement state, so paid relay access recovers more predictably after account changes.","Billing webhook guard: Polar customer mappings that point at a missing local user now fail cleanly with an explicit validation error instead of crashing on a database foreign-key write."]}]},{version:"0.8.0",publishedAt:"2026-04-08",title:"Project diffs, queued messages, and commit workflow",sections:[{title:"New Features",items:["Project diff sidebar and commit workflow: Kaizen can now inspect project diffs in the sidebar, tune diff viewing preferences, generate commit messages, and turn selected changes into commits from the chat workflow.","Queued outbound messages: The CLI chat flow can now queue follow-up prompts while a turn is still running, with composer controls to preview, edit, remove, and drain queued messages safely."]},{title:"Improvements",items:["Paid relay and pricing updates: Paid users now get relay access by default, pricing copy is clearer, and the dashboard shows subscription state with better post-checkout feedback.","Diff review polish and follow-up fixes: The shipped diff flow includes follow-up fixes for sidebar sizing, disclosure handling, server git behavior, and related regression coverage.","Safer queued-message handling: Attachment staging cleanup, queue drain ordering, duplicate action guards, and attachment-only queue previews are hardened for more predictable chat behavior."]}]},{version:"0.7.2",publishedAt:"2026-04-07",title:"Standalone CLI packaging fix",sections:[{title:"Improvements",items:["Standalone CLI package no longer ships workspace dependencies: Kaizen installs and self-updates no longer fail in production because the published CLI package no longer depends on monorepo workspace packages."]}]},{version:"0.7.1",publishedAt:"2026-04-07",title:"Production-safe remote auth builds",sections:[{title:"Improvements",items:["Remote auth build targets stay production-safe: Development builds can still override the remote auth URL without leaking non-production URLs or env overrides into the shipped production bundle."]}]},{version:"0.7.0",publishedAt:"2026-04-07",title:"Accounts, relay access, and faster chat workflows",sections:[{title:"New Features",items:["Kaizen Connect accounts: Sign the local Kaizen app into your web account and keep account state synced across devices.","Remote relay access and controls: Hosted relay support now includes admin approvals, machine management, an account settings flow, idle shutdown, wake-on-demand, and a dedicated Kaizen Connect landing flow.","Billing and account management: The web app now includes pricing, Polar-backed billing, account dashboards, subscription state, and expanded device management.","Expanded sign-in security: The web app now supports Google and GitHub OAuth, plus TOTP setup for password-based accounts.","Faster handoff and prompting tools: Kaizen now includes saved plan handoff quick chats, reusable quick prompts, and managed custom theme backgrounds.","Native slash commands: The chat composer now supports slash command autocomplete along with built-in PR and workflow commands.","More provider and file support: Kaizen now supports OpenRouter via openCode ACP along with Markdown and PDF chat attachments.","Feature access and privacy controls: Account-gated features now stay visible with locked states, and streamer mode can hide account details, device metadata, and relay URLs.","Broader chat recovery tools: Kaizen can recover more provider-backed chats, including stronger Cursor chat recovery and import support."]},{title:"Improvements",items:["Fix various bugs across chat recovery, waiting prompts, relay/account sync, and dashboard flows.","Fix various performance issues across chat startup, transcript rendering, sidebar updates, websocket sync, local persistence, and asset delivery.","Polish loading states, shared branding, and overall UI consistency across the CLI app and web app."]}]},{version:"0.6.1",publishedAt:"2026-03-30",title:"Background notifications and SEO updates",sections:[{title:"Improvements",items:["Background chat notifications: Kaizen can now alert you with browser notifications, sound, and vibration when background chats need input or finish responding.","SEO enhancements: Updated site metadata, robots.txt rules, and sitemap priorities to improve search engine discoverability."]},{title:"Under the Hood",items:["Added a root `tailscale:reset` script to reset local Tailscale serve configuration during setup and support workflows."]}]},{version:"0.6.0",publishedAt:"2026-03-29",title:"Remote handoff setup and QR launches",sections:[{title:"New Features",items:["Add remote handoff flow for Kaizen: Kaizen can now guide remote Tailscale setup and generate handoff links and QR codes for opening sessions on another device."]}]},{version:"0.5.0",publishedAt:"2026-03-29",title:"Bundled release history and stronger session recovery",sections:[{title:"New Features",items:["Bundled release history and stronger session recovery: Kaizen now ships in-app and web release notes while recovering chat usage and session state more reliably after reloads."]}]},{version:"0.4.0",publishedAt:"2026-03-29",title:"Branding refresh and packaged runtime updates",sections:[{title:"Highlights",items:["Refreshed the Kaizen branding and theme system across the product surface.","Published the built Kaizen runtime and added the web start command needed for the packaged flow.","Renamed the `keizen` app paths to `kaizen`, fixed review follow-ups, and aligned web builds on Node 20."]}]},{version:"0.3.0",publishedAt:"2026-03-29",title:"Feature overview workflow and release workflow baseline",sections:[{title:"Highlights",items:["Added the feature overview workflow and plan attachment support for structured project work.","Added the pull-request skill and the first pass of the npm publish and release workflow guidance."]}]},{version:"0.2.2",publishedAt:"2026-03-28",title:"UI and restart regression fixes",sections:[{title:"Highlights",items:["Fixed Kaizen UI regressions and restart issues that were blocking a stable local runtime."]}]}];function Ra(t){return new Date(`${t}T00:00:00.000Z`).getTime()}function yl(t,e="en-US"){return new Intl.DateTimeFormat(e,{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${t}T00:00:00.000Z`))}function kl(t){return[...t].sort((e,a)=>{const s=Ra(a.publishedAt)-Ra(e.publishedAt);return s!==0?s:a.version.localeCompare(e.version,void 0,{numeric:!0,sensitivity:"base"})})}const jl=Object.freeze(kl(bl.map(t=>vl.parse(t))));function _l(t){const e=Fe.c(5),{entries:a}=t;if(a.length===0){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-card/30 px-6 py-10 text-sm text-muted-foreground",children:"No release notes have been published yet."}),e[0]=l):l=e[0],l}let s;e[1]!==a?(s=a.map(wl),e[1]=a,e[2]=s):s=e[2];let i;return e[3]!==s?(i=n.jsx("div",{className:"space-y-4",children:s}),e[3]=s,e[4]=i):i=e[4],i}function wl(t){return n.jsxs("article",{className:"rounded-2xl border border-border bg-card/60 p-5",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("h3",{className:"text-base font-semibold text-foreground",children:t.title}),n.jsxs("span",{className:"rounded-full border border-border bg-muted/60 px-2.5 py-1 text-xs font-medium text-muted-foreground",children:["v",t.version]}),t.prerelease?n.jsx("span",{className:"rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300",children:"Prerelease"}):null]}),n.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Published ",yl(t.publishedAt)]}),n.jsx("div",{className:"mt-4 space-y-4 text-sm text-foreground",children:t.sections.map(Nl)})]},`${t.version}-${t.publishedAt}`)}function Nl(t){return n.jsxs("section",{className:"space-y-2",children:[n.jsx("h4",{className:"text-sm font-semibold text-foreground",children:t.title}),n.jsx("ul",{className:"list-disc space-y-2 pl-5 text-muted-foreground",children:t.items.map(Cl)})]},t.title)}function Cl(t){return n.jsx("li",{children:t},t)}function Tl(){const t=Fe.c(43),e=nt("quickChatSettings"),a=nt("featureAccess"),{remoteAuth:s,providerCatalog:i,providerSettings:l}=qs();let o;t[0]!==s?(o=La(s),t[0]=s,t[1]=o):o=t[1];const d=o.features.handoff.enabled,m=Ut(Ol),u=Ut(Pl),b=Ut(Al),g=Ut(Il),j=Ut(El);let U;if(t[2]!==u||t[3]!==m||t[4]!==a||t[5]!==d||t[6]!==i||t[7]!==l||t[8]!==g||t[9]!==j||t[10]!==e||t[11]!==b){const Z=Da({providerCatalog:i,providerSettings:l});let M;t[13]!==e?(M=e("description"),t[13]=e,t[14]=M):M=t[14];let I;t[15]!==M?(I=n.jsx("div",{className:"max-w-2xl",children:M}),t[15]=M,t[16]=I):I=t[16];let N;t[17]!==a||t[18]!==d?(N=d?null:n.jsx(gt,{level:"account",label:a("cta.account")}),t[17]=a,t[18]=d,t[19]=N):N=t[19];const H=!d;let G;t[20]!==u?(G=()=>u($r()),t[20]=u,t[21]=G):G=t[21];let Q;t[22]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx(Vr,{className:"mr-1.5 h-4 w-4"}),t[22]=Q):Q=t[22];let K;t[23]!==e?(K=e("actions.add"),t[23]=e,t[24]=K):K=t[24];let B;t[25]!==H||t[26]!==G||t[27]!==K?(B=n.jsxs(ie,{type:"button",size:"sm",variant:"outline",className:"rounded-full",disabled:H,onClick:G,children:[Q,K]}),t[25]=H,t[26]=G,t[27]=K,t[28]=B):B=t[28];const q=!d;let le;t[29]===Symbol.for("react.memo_cache_sentinel")?(le=n.jsx(Za,{className:"mr-1.5 h-4 w-4"}),t[29]=le):le=t[29];let V;t[30]!==e?(V=e("actions.reset"),t[30]=e,t[31]=V):V=t[31];let Y;t[32]!==j||t[33]!==q||t[34]!==V?(Y=n.jsxs(ie,{type:"button",size:"sm",variant:"outline",className:"rounded-full",disabled:q,onClick:j,children:[le,V]}),t[32]=j,t[33]=q,t[34]=V,t[35]=Y):Y=t[35];let W;t[36]!==Y||t[37]!==N||t[38]!==B?(W=n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[N,B,Y]}),t[36]=Y,t[37]=N,t[38]=B,t[39]=W):W=t[39];let se;t[40]!==W||t[41]!==I?(se=n.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl border border-border bg-card/30 px-4 py-4 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between",children:[I,W]}),t[40]=W,t[41]=I,t[42]=se):se=t[42],U=n.jsxs("div",{className:"border-b border-border",children:[se,m.length===0?n.jsx("div",{className:"py-8 text-sm text-muted-foreground",children:e("empty")}):m.map(($,S)=>{const oe=Jn($.provider,i),ae=oe.models.some(E=>E.id===$.model)?$.model:oe.defaultModel;return n.jsxs("div",{className:`grid gap-4 py-5 md:grid-cols-[minmax(0,1.1fr)_160px_200px_minmax(0,1.2fr)_auto] ${S===0?"":"border-t border-border"}`,children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:e("fields.label")}),n.jsx(Ue,{value:$.label,disabled:!d,onChange:E=>b($.id,{label:E.target.value}),placeholder:e("placeholders.label")})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:e("fields.provider")}),n.jsxs(J,{value:$.provider,disabled:!d,onValueChange:E=>{const pe=E,he=Jn(pe,i);b($.id,{provider:pe,model:he.defaultModel,modelOptions:he.defaultModelOptions})},children:[n.jsx(X,{children:n.jsx(te,{})}),n.jsx(ee,{children:Z.map(Sl)})]})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:e("fields.model")}),n.jsxs(J,{value:ae,disabled:!d,onValueChange:E=>b($.id,{model:E}),children:[n.jsx(X,{children:n.jsx(te,{})}),n.jsx(ee,{children:oe.models.map(Rl)})]})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:e("fields.basePrompt")}),n.jsx(Ue,{value:$.basePrompt,disabled:!d,onChange:E=>b($.id,{basePrompt:E.target.value}),placeholder:zr})]}),n.jsx("div",{className:"flex items-end",children:n.jsx(ie,{type:"button",size:"icon",variant:"outline",className:"rounded-full","aria-label":e("actions.remove",{label:$.label}),title:e("actions.remove",{label:$.label}),disabled:!d,onClick:()=>g($.id),children:n.jsx(Br,{className:"h-4 w-4"})})})]},$.id)})]}),t[2]=u,t[3]=m,t[4]=a,t[5]=d,t[6]=i,t[7]=l,t[8]=g,t[9]=j,t[10]=e,t[11]=b,t[12]=U}else U=t[12];return U}function Rl(t){return n.jsx(C,{value:t.id,children:t.label},t.id)}function Sl(t){return n.jsx(C,{value:t.id,children:t.label},t.id)}function El(t){return t.resetToDefaults}function Il(t){return t.removeEntry}function Al(t){return t.updateEntry}function Pl(t){return t.addEntry}function Ol(t){return t.entries}function Ml(){const t=Fe.c(87),e=nt("slashCommandSettings"),{providerCatalog:a,providerSettings:s}=qs(),i=pt(Vl),l=pt($l),o=pt(Bl),c=pt(zl),d=pt(Ul),m=pt(Fl),u=pt(Dl);let b,g,j,U,Z,M,I;if(t[0]!==a||t[1]!==s||t[2]!==o||t[3]!==u||t[4]!==e||t[5]!==m){const pe=Da({providerCatalog:a,providerSettings:s});M="border-b border-border";let he;t[13]!==e?(he=e("description"),t[13]=e,t[14]=he):he=t[14];let A;t[15]!==he?(A=n.jsx("div",{className:"max-w-2xl",children:he}),t[15]=he,t[16]=A):A=t[16];let xe;t[17]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx(Za,{className:"mr-1.5 h-4 w-4"}),t[17]=xe):xe=t[17];let ce;t[18]!==e?(ce=e("actions.reset"),t[18]=e,t[19]=ce):ce=t[19];let be;t[20]!==u||t[21]!==ce?(be=n.jsxs(ie,{type:"button",size:"sm",variant:"outline",className:"rounded-full",onClick:u,children:[xe,ce]}),t[20]=u,t[21]=ce,t[22]=be):be=t[22],t[23]!==be||t[24]!==A?(I=n.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl border border-border bg-card/30 px-4 py-4 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between",children:[A,be]}),t[23]=be,t[24]=A,t[25]=I):I=t[25],Z="grid gap-5 py-5";let ve;t[26]!==e?(ve=e("providers.title"),t[26]=e,t[27]=ve):ve=t[27],t[28]!==ve?(j=n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:ve}),t[28]=ve,t[29]=j):j=t[29];let ye;t[30]!==e?(ye=e("providers.description",{defaults:Zr.map(Ll).join(", ")}),t[30]=e,t[31]=ye):ye=t[31],t[32]!==ye?(U=n.jsx("div",{className:"mb-3 text-sm text-muted-foreground",children:ye}),t[32]=ye,t[33]=U):U=t[33],b="flex flex-wrap gap-2";let _e;t[34]!==o||t[35]!==m?(_e=we=>{const Ee=o.includes(we.id);return n.jsx(ie,{type:"button","aria-pressed":Ee,variant:Ee?"default":"outline",className:Ae("rounded-full",!Ee&&"text-muted-foreground"),onClick:()=>m(we.id),children:we.label},we.id)},t[34]=o,t[35]=m,t[36]=_e):_e=t[36],g=pe.map(_e),t[0]=a,t[1]=s,t[2]=o,t[3]=u,t[4]=e,t[5]=m,t[6]=b,t[7]=g,t[8]=j,t[9]=U,t[10]=Z,t[11]=M,t[12]=I}else b=t[6],g=t[7],j=t[8],U=t[9],Z=t[10],M=t[11],I=t[12];let N;t[37]!==b||t[38]!==g?(N=n.jsx("div",{className:b,children:g}),t[37]=b,t[38]=g,t[39]=N):N=t[39];let H;t[40]!==j||t[41]!==U||t[42]!==N?(H=n.jsxs("div",{children:[j,U,N]}),t[40]=j,t[41]=U,t[42]=N,t[43]=H):H=t[43];let G;t[44]!==e?(G=e("pr.title"),t[44]=e,t[45]=G):G=t[45];let Q;t[46]!==G?(Q=n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:G}),t[46]=G,t[47]=Q):Q=t[47];let K;t[48]!==e?(K=e("pr.description"),t[48]=e,t[49]=K):K=t[49];let B;t[50]!==K?(B=n.jsx("div",{className:"mb-3 text-sm text-muted-foreground",children:K}),t[50]=K,t[51]=B):B=t[51];let q;t[52]!==c?(q=pe=>c(pe.target.value),t[52]=c,t[53]=q):q=t[53];let le;t[54]!==i||t[55]!==q?(le=n.jsx(Xn,{value:i,onChange:q,rows:5,className:"min-h-28"}),t[54]=i,t[55]=q,t[56]=le):le=t[56];let V;t[57]!==Q||t[58]!==B||t[59]!==le?(V=n.jsxs("div",{className:"border-t border-border pt-5",children:[Q,B,le]}),t[57]=Q,t[58]=B,t[59]=le,t[60]=V):V=t[60];let Y;t[61]!==e?(Y=e("prUpdate.title"),t[61]=e,t[62]=Y):Y=t[62];let W;t[63]!==Y?(W=n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:Y}),t[63]=Y,t[64]=W):W=t[64];let se;t[65]!==e?(se=e("prUpdate.description"),t[65]=e,t[66]=se):se=t[66];let $;t[67]!==se?($=n.jsx("div",{className:"mb-3 text-sm text-muted-foreground",children:se}),t[67]=se,t[68]=$):$=t[68];let S;t[69]!==d?(S=pe=>d(pe.target.value),t[69]=d,t[70]=S):S=t[70];let oe;t[71]!==l||t[72]!==S?(oe=n.jsx(Xn,{value:l,onChange:S,rows:5,className:"min-h-28"}),t[71]=l,t[72]=S,t[73]=oe):oe=t[73];let p;t[74]!==W||t[75]!==$||t[76]!==oe?(p=n.jsxs("div",{className:"border-t border-border pt-5",children:[W,$,oe]}),t[74]=W,t[75]=$,t[76]=oe,t[77]=p):p=t[77];let ae;t[78]!==V||t[79]!==p||t[80]!==Z||t[81]!==H?(ae=n.jsxs("div",{className:Z,children:[H,V,p]}),t[78]=V,t[79]=p,t[80]=Z,t[81]=H,t[82]=ae):ae=t[82];let E;return t[83]!==ae||t[84]!==M||t[85]!==I?(E=n.jsxs("div",{className:M,children:[I,ae]}),t[83]=ae,t[84]=M,t[85]=I,t[86]=E):E=t[86],E}function Ll(t){return Ws(t).label}function Dl(t){return t.resetToDefaults}function Fl(t){return t.togglePullRequestProvider}function Ul(t){return t.setPullRequestUpdatePrompt}function zl(t){return t.setPullRequestPrompt}function Bl(t){return t.pullRequestProviders}function $l(t){return t.pullRequestUpdatePrompt}function Vl(t){return t.pullRequestPrompt}const Zl=[{id:"codex",label:"Codex"},{id:"claude",label:"Claude"}];function Xe(t){return new Intl.NumberFormat().format(t)}function Sa(t){return t===null?"-":new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",minimumFractionDigits:t>=1?2:4,maximumFractionDigits:t>=1?2:4}).format(t)}function Kl(t){const e=new Date(`${t}T00:00:00`);return Number.isNaN(e.getTime())?t:new Intl.DateTimeFormat(void 0,{weekday:"short",month:"short",day:"numeric"}).format(e)}function ql(t){return t?t.totals.reasoningTokens>0||t.days.some(e=>e.reasoningTokens>0):!1}function Wl(t){const e=Fe.c(91),{access:a,provider:s,window:i,report:l,error:o,isLoading:c,onProviderChange:d,onWindowChange:m,onRefresh:u,onOpenAccount:b}=t,g=nt("providerUsage"),j=nt("featureAccess");if(!a.features.providerUsage.enabled){const A=a.features.providerUsage.level;let xe;e[0]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-2xl border border-border bg-background/80",children:n.jsx($a,{className:"h-5 w-5"})}),e[0]=xe):xe=e[0];let ce;e[1]!==g?(ce=g("title"),e[1]=g,e[2]=ce):ce=e[2];let be;e[3]!==ce?(be=n.jsx("span",{children:ce}),e[3]=ce,e[4]=be):be=e[4];let ve;e[5]!==j||e[6]!==A?(ve=Rt(A,{cta:{account:j("cta.account"),paid:j("cta.paid")},denied:{account:j("denied.account",{featureName:"{featureName}"}),paid:j("denied.paid",{featureName:"{featureName}"})},deniedShort:{account:j("deniedShort.account",{featureName:"{featureName}"}),paid:j("deniedShort.paid",{featureName:"{featureName}"})}}),e[5]=j,e[6]=A,e[7]=ve):ve=e[7];let ye;e[8]!==A||e[9]!==ve?(ye=n.jsx(gt,{level:A,label:ve}),e[8]=A,e[9]=ve,e[10]=ye):ye=e[10];let _e;e[11]!==be||e[12]!==ye?(_e=n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[be,ye]}),e[11]=be,e[12]=ye,e[13]=_e):_e=e[13];let we;e[14]!==j||e[15]!==A?(we=qr("Provider Usage",A,{cta:{account:j("cta.account"),paid:j("cta.paid")},denied:{account:j("denied.account",{featureName:"{featureName}"}),paid:j("denied.paid",{featureName:"{featureName}"})},deniedShort:{account:j("deniedShort.account",{featureName:"{featureName}"}),paid:j("deniedShort.paid",{featureName:"{featureName}"})}}),e[14]=j,e[15]=A,e[16]=we):we=e[16];let Ee;e[17]!==we?(Ee=n.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:we}),e[17]=we,e[18]=Ee):Ee=e[18];let Ze;e[19]!==_e||e[20]!==Ee?(Ze=n.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[xe,n.jsxs("div",{className:"min-w-0 flex-1",children:[_e,Ee]})]}),e[19]=_e,e[20]=Ee,e[21]=Ze):Ze=e[21];let Ke;e[22]!==j?(Ke=j("actions.openAccountSettings"),e[22]=j,e[23]=Ke):Ke=e[23];let qe;e[24]!==b||e[25]!==Ke?(qe=n.jsx("div",{className:"mt-4",children:n.jsx(ie,{type:"button",onClick:b,children:Ke})}),e[24]=b,e[25]=Ke,e[26]=qe):qe=e[26];let it;return e[27]!==qe||e[28]!==Ze?(it=n.jsxs("div",{className:"rounded-3xl border border-border bg-card/40 p-6",children:[Ze,qe]}),e[27]=qe,e[28]=Ze,e[29]=it):it=e[29],it}let U;e[30]!==l?(U=ql(l),e[30]=l,e[31]=U):U=e[31];const Z=U;let M;e[32]!==g?(M=g("analytics.title"),e[32]=g,e[33]=M):M=e[33];let I;e[34]!==M?(I=n.jsx("div",{className:"text-sm font-medium text-foreground",children:M}),e[34]=M,e[35]=I):I=e[35];let N;e[36]!==g?(N=g("analytics.description"),e[36]=g,e[37]=N):N=e[37];let H;e[38]!==N?(H=n.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:N}),e[38]=N,e[39]=H):H=e[39];let G;e[40]!==I||e[41]!==H?(G=n.jsxs("div",{children:[I,H]}),e[40]=I,e[41]=H,e[42]=G):G=e[42];let Q;e[43]!==d?(Q=A=>d(A),e[43]=d,e[44]=Q):Q=e[44];let K;e[45]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(X,{className:"min-w-[160px]",children:n.jsx(te,{})}),e[45]=K):K=e[45];let B;e[46]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(ee,{children:Zl.map(Hl)}),e[46]=B):B=e[46];let q;e[47]!==s||e[48]!==Q?(q=n.jsxs(J,{value:s,onValueChange:Q,children:[K,B]}),e[47]=s,e[48]=Q,e[49]=q):q=e[49];let le;e[50]===Symbol.for("react.memo_cache_sentinel")?(le=["week","month"],e[50]=le):le=e[50];let V;e[51]!==m||e[52]!==g||e[53]!==i?(V=n.jsx("div",{className:"inline-flex rounded-xl border border-border bg-background/80 p-1",children:le.map(A=>n.jsx("button",{type:"button",onClick:()=>m(A),className:Ae("rounded-lg px-3 py-1.5 text-sm transition-colors",A===i?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:g(A==="week"?"analytics.window.week":"analytics.window.month")},A))}),e[51]=m,e[52]=g,e[53]=i,e[54]=V):V=e[54];let Y;e[55]!==c?(Y=c?n.jsx(Re,{className:"mr-2 h-4 w-4 animate-spin"}):n.jsx(Ls,{className:"mr-2 h-4 w-4"}),e[55]=c,e[56]=Y):Y=e[56];let W;e[57]!==g?(W=g("actions.refresh"),e[57]=g,e[58]=W):W=e[58];let se;e[59]!==c||e[60]!==u||e[61]!==Y||e[62]!==W?(se=n.jsxs(ie,{type:"button",variant:"outline",onClick:u,disabled:c,children:[Y,W]}),e[59]=c,e[60]=u,e[61]=Y,e[62]=W,e[63]=se):se=e[63];let $;e[64]!==q||e[65]!==V||e[66]!==se?($=n.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[q,V,se]}),e[64]=q,e[65]=V,e[66]=se,e[67]=$):$=e[67];let S;e[68]!==$||e[69]!==G?(S=n.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[G,$]}),e[68]=$,e[69]=G,e[70]=S):S=e[70];let oe;e[71]!==l||e[72]!==g?(oe=l?n.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:g("analytics.summary",{start:l.windowStart,end:l.windowEnd,scannedFiles:l.scannedFiles,durationMs:l.durationMs})}):null,e[71]=l,e[72]=g,e[73]=oe):oe=e[73];let p;e[74]!==S||e[75]!==oe?(p=n.jsxs("div",{className:"rounded-3xl border border-border bg-card/40 p-5",children:[S,oe]}),e[74]=S,e[75]=oe,e[76]=p):p=e[76];let ae;e[77]!==o?(ae=o?n.jsx("div",{className:"rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:o}):null,e[77]=o,e[78]=ae):ae=e[78];let E;e[79]!==l?(E=l!=null&&l.warnings.length?n.jsx("div",{className:"rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:l.warnings.join(" ")}):null,e[79]=l,e[80]=E):E=e[80];let pe;e[81]!==c||e[82]!==l||e[83]!==Z||e[84]!==g?(pe=!l&&c?n.jsx("div",{className:"rounded-3xl border border-border bg-card/30 p-6 text-sm text-muted-foreground",children:g("analytics.loading")}):l?n.jsx("div",{className:"overflow-hidden rounded-3xl border border-border bg-card/30",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{className:"bg-background/70 text-left text-muted-foreground",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-4 py-3 font-medium",children:g("analytics.table.date")}),n.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g("analytics.table.input")}),n.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g("analytics.table.output")}),n.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g("analytics.table.cache")}),Z?n.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g("analytics.table.reasoning")}):null,n.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g("analytics.table.estimatedCost")})]})}),n.jsx("tbody",{children:l.days.map(A=>n.jsxs("tr",{className:"border-t border-border/70",children:[n.jsx("td",{className:"px-4 py-3 text-foreground",children:Kl(A.date)}),n.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Xe(A.inputTokens)}),n.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Xe(A.outputTokens)}),n.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Xe(A.cacheTokens)}),Z?n.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Xe(A.reasoningTokens)}):null,n.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Sa(A.estimatedUsd)})]},A.date))}),n.jsx("tfoot",{className:"border-t border-border bg-background/60",children:n.jsxs("tr",{children:[n.jsx("td",{className:"px-4 py-3 font-medium text-foreground",children:g("analytics.table.total")}),n.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Xe(l.totals.inputTokens)}),n.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Xe(l.totals.outputTokens)}),n.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Xe(l.totals.cacheTokens)}),Z?n.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Xe(l.totals.reasoningTokens)}):null,n.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Sa(l.totals.estimatedUsd)})]})})]})})}):n.jsx("div",{className:"rounded-3xl border border-border bg-card/30 p-6 text-sm text-muted-foreground",children:g("analytics.empty")}),e[81]=c,e[82]=l,e[83]=Z,e[84]=g,e[85]=pe):pe=e[85];let he;return e[86]!==p||e[87]!==ae||e[88]!==E||e[89]!==pe?(he=n.jsxs("div",{className:"space-y-4",children:[p,ae,E,pe]}),e[86]=p,e[87]=ae,e[88]=E,e[89]=pe,e[90]=he):he=e[90],he}function Hl(t){return n.jsx(C,{value:t.id,children:t.label},t.id)}function Gl(t){const e=Fe.c(30),{access:a}=t,s=Fa(),{socket:i}=Ua(),l=nt("providerUsage"),[o,c]=k.useState("codex"),[d,m]=k.useState("week"),[u,b]=k.useState(null),[g,j]=k.useState(null),U=k.useRef(0);let Z;e[0]!==o||e[1]!==d?(Z=Oe.settingsUsage(o,d),e[0]=o,e[1]=d,e[2]=Z):Z=e[2];const M=Z,I=Me(M);let N;e[3]!==a.features.providerUsage.enabled||e[4]!==M||e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==d?(N=function(V){if(!a.features.providerUsage.enabled)return Promise.resolve();const Y=U.current=U.current+1;return V==="auto"&&b(null),j(null),Le(M,()=>i.command({type:"usage.analyticsReport",provider:o,window:d}),{statusLabel:l(V==="refresh"?"analytics.refreshing":"analytics.loading"),dedupe:V!=="refresh"}).then(W=>{Y===U.current&&b(W)}).catch(W=>{if(Y!==U.current)return;const se=W instanceof Error?W.message:String(W);j(se),V==="refresh"&&Kr.error(se)})},e[3]=a.features.providerUsage.enabled,e[4]=M,e[5]=o,e[6]=i,e[7]=l,e[8]=d,e[9]=N):N=e[9];const H=N;let G;e[10]!==H?(G=()=>{H("auto")},e[10]=H,e[11]=G):G=e[11];let Q;e[12]!==a.features.providerUsage.enabled||e[13]!==o||e[14]!==i||e[15]!==d?(Q=[a.features.providerUsage.enabled,o,i,d],e[12]=a.features.providerUsage.enabled,e[13]=o,e[14]=i,e[15]=d,e[16]=Q):Q=e[16],k.useEffect(G,Q);let K;e[17]!==H?(K=()=>{H("refresh")},e[17]=H,e[18]=K):K=e[18];let B;e[19]!==s?(B=()=>s(za),e[19]=s,e[20]=B):B=e[20];let q;return e[21]!==a||e[22]!==g||e[23]!==I||e[24]!==o||e[25]!==u||e[26]!==K||e[27]!==B||e[28]!==d?(q=n.jsx(Wl,{access:a,provider:o,window:d,report:u,error:g,isLoading:I,onProviderChange:c,onWindowChange:m,onRefresh:K,onOpenAccount:B}),e[21]=a,e[22]=g,e[23]=I,e[24]=o,e[25]=u,e[26]=K,e[27]=B,e[28]=d,e[29]=q):q=e[29],q}function Ql(t){var e;return n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-foreground",children:((e=t.remoteAuthSnapshot)==null?void 0:e.baseUrl)??""})}const Yl=["account","general","changelog","quick-chats","slash-commands","usage","providers","keybindings"],Ms=30*6e4,Ea=15e3;function Ia(t){return t&&Yl.some(e=>e===t)?t:null}function Jl(t){return[{id:"account",label:t("sidebar.account.label"),icon:Fi,subtitle:t("sidebar.account.subtitle")},{id:"general",label:t("sidebar.general.label"),icon:Li,subtitle:t("sidebar.general.subtitle")},{id:"changelog",label:t("sidebar.changelog.label"),icon:Va,subtitle:t("sidebar.changelog.subtitle")},{id:"quick-chats",label:t("sidebar.quickChats.label"),icon:Wr,subtitle:t("sidebar.quickChats.subtitle")},{id:"slash-commands",label:t("sidebar.slashCommands.label"),icon:Ds,subtitle:t("sidebar.slashCommands.subtitle")},{id:"usage",label:t("sidebar.usage.label"),icon:$a,subtitle:t("sidebar.usage.subtitle")},{id:"providers",label:t("sidebar.providers.label"),icon:Ii,subtitle:t("sidebar.providers.subtitle")},{id:"keybindings",label:t("sidebar.keybindings.label"),icon:Ci,subtitle:t("sidebar.keybindings.subtitle")}]}function Aa(t,e){return t(`keybindings.items.${{submitChatMessage:"submitChatMessage",toggleQuickPrompts:"toggleQuickPrompts",toggleProjectsSidebar:"toggleProjectsSidebar",toggleEmbeddedTerminal:"toggleEmbeddedTerminal",toggleRightSidebar:"toggleRightSidebar",openInFinder:"openInFinder",openInEditor:"openInEditor",addSplitTerminal:"addSplitTerminal"}[e]}.title`)}const Xl=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],fs=Object.keys(gi);function xo(t){return`Edit global app shortcuts stored in ${t}.`}function is(t){return Object.fromEntries(fs.map(e=>[e,Fs(t[e])]))}function ms(t,e){return fs.every(a=>(t[a]??"")===(e[a]??""))}function eo(t,e,a){const s={...t};for(const i of fs)(t[i]??"")===(e[i]??"")&&(s[i]=a[i]??"");return s}function to(t,e,a){return e&&ms(a,e)?{changed:!1,nextCurrent:t,nextLoaded:e,nextSaved:e}:{changed:!0,nextCurrent:!e||ms(t,e)?a:t,nextLoaded:a,nextSaved:a}}function so(t,e={update:"Update",checkForUpdates:"Check for updates"}){const a=(t==null?void 0:t.status)==="checking",s=(t==null?void 0:t.status)==="updating"||(t==null?void 0:t.status)==="restart_pending";return t!=null&&t.updateAvailable?{disabled:s,kind:"update",label:e.update,variant:"default"}:{disabled:a||s,kind:"check",label:e.checkForUpdates,spinning:a,variant:"outline"}}function Tt(t,e,a,s={active:"Active.",inactive:"Inactive."}){const i=Ws(a,t),l=(e==null?void 0:e.settings[a])??re[a];return i.systemActive?l.active?s.active:s.inactive:yi(a,e==null?void 0:e.settings,t)??s.inactive}function no(t){return t&&typeof t=="object"&&"idx"in t&&typeof t.idx=="number"&&t.idx>0?"back":"home"}function Pa({themePreference:t,nextBackgroundImage:e,backgroundOpacity:a}){const s=typeof e=="string"&&e.trim()!=="";return t!=="custom"||!s||a!==1?{}:{backgroundOpacity:.85,backgroundBlur:6}}function P(t){const e=Fe.c(19),{title:a,description:s,children:i,badge:l,bordered:o,alignStart:c}=t,d=o===void 0?!0:o,m=c===void 0?!1:c,u=d?"border-t border-border":void 0,b=`flex flex-col sm:flex-row sm:justify-between gap-3 sm:gap-8 py-5 ${m?"sm:items-start":"sm:items-center"}`;let g;e[0]!==a?(g=n.jsx("span",{children:a}),e[0]=a,e[1]=g):g=e[1];let j;e[2]!==l||e[3]!==g?(j=n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[g,l]}),e[2]=l,e[3]=g,e[4]=j):j=e[4];let U;e[5]!==s?(U=n.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:s}),e[5]=s,e[6]=U):U=e[6];let Z;e[7]!==j||e[8]!==U?(Z=n.jsxs("div",{className:"min-w-0 max-w-xl",children:[j,U]}),e[7]=j,e[8]=U,e[9]=Z):Z=e[9];let M;e[10]!==i?(M=n.jsx("div",{className:"flex w-full items-center sm:w-auto sm:shrink-0",children:i}),e[10]=i,e[11]=M):M=e[11];let I;e[12]!==b||e[13]!==Z||e[14]!==M?(I=n.jsxs("div",{className:b,children:[Z,M]}),e[12]=b,e[13]=Z,e[14]=M,e[15]=I):I=e[15];let N;return e[16]!==I||e[17]!==u?(N=n.jsx("div",{className:u,children:I}),e[16]=I,e[17]=u,e[18]=N):N=e[18],N}function Ks(t,e){if(!t)return"—";const a=Date.parse(t);return Number.isNaN(a)?t:new Intl.DateTimeFormat(e||"en",{dateStyle:"medium",timeStyle:"short"}).format(a)}function Bt(t){return(t/1024).toFixed(3).replace(/(\.\d*?[1-9])0+$/u,"$1").replace(/\.0+$/u,"")}function ao(t){const e=Fe.c(3),{url:a}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Ba("/api/qrcode"),e[0]=s):s=e[0];const i=`${s}?value=${encodeURIComponent(a)}`;let l;return e[1]!==i?(l=n.jsx("div",{className:"rounded-2xl border border-border bg-background/80 p-3",children:n.jsx("img",{src:i,alt:"QR code for relay access",className:"h-44 w-44 rounded-lg bg-white p-2"})}),e[1]=i,e[2]=l):l=e[2],l}function ro(t,e={signedIn:"Connected to Kaizen",signedOut:"Not connected",pendingSignIn:"Finish signing in…",error:"Connection error"}){switch(t){case"signed_in":return e.signedIn;case"signed_out":return e.signedOut;case"pending_sign_in":return e.pendingSignIn;case"error":return e.error;default:return t}}function io(t,e){switch(t){case"disabled":return e("account.remoteRelay.status.disabled");case"unauthorized":return e("account.remoteRelay.status.unauthorized");case"registering":return e("account.remoteRelay.status.registering");case"connecting":return e("account.remoteRelay.status.connecting");case"online":return e("account.remoteRelay.status.online");case"offline":return e("account.remoteRelay.status.offline");case"idle_disconnected":return e("account.remoteRelay.status.idleDisconnected");case"manually_disabled":return e("account.remoteRelay.status.manuallyDisabled");case"error":return e("account.remoteRelay.status.error");default:return e("account.remoteRelay.status.disabled")}}function Oa(t,e){if(!t)return null;const a=t.trim().toLowerCase();return a==="relay connection failed"?e("account.remoteRelay.errors.connectionFailed"):a==="remote relay unavailable."?e("account.remoteRelay.errors.unavailable"):a==="remote relay machine is not registered yet."?e("account.remoteRelay.errors.notRegisteredYet"):a==="failed to rotate relay url key"?e("account.remoteRelay.errors.rotateUrlFailed"):a==="unable to connect. is the computer able to access the url?"?e("account.remoteRelay.errors.unableToAccessUrl"):t}function lo(t){const e=Fe.c(15),{access:a,copy:s}=t,i=a.signedIn?s.accountFeaturesUnlocked:s.accountFeaturesLocked;let l;e[0]!==s.accountFeaturesLabel||e[1]!==i?(l={label:s.accountFeaturesLabel,body:i},e[0]=s.accountFeaturesLabel,e[1]=i,e[2]=l):l=e[2];const o=a.paid?s.paidFeaturesUnlocked:s.paidFeaturesLocked;let c;e[3]!==s.paidFeaturesLabel||e[4]!==o?(c={label:s.paidFeaturesLabel,body:o},e[3]=s.paidFeaturesLabel,e[4]=o,e[5]=c):c=e[5];let d;e[6]!==s.destinationBody||e[7]!==s.destinationLabel?(d={label:s.destinationLabel,body:s.destinationBody},e[6]=s.destinationBody,e[7]=s.destinationLabel,e[8]=d):d=e[8];let m;e[9]!==l||e[10]!==c||e[11]!==d?(m=[l,c,d],e[9]=l,e[10]=c,e[11]=d,e[12]=m):m=e[12];const u=m;let b;return e[13]!==u?(b=n.jsx("dl",{className:"w-full min-w-0 space-y-3.5 text-left sm:max-w-[420px]",children:u.map(oo)}),e[13]=u,e[14]=b):b=e[14],b}function oo(t){return n.jsxs("div",{children:[n.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t.label}),n.jsx("dd",{className:"mt-1 text-sm leading-snug text-foreground",children:t.body})]},t.label)}function co(t){const e=Fe.c(17),{access:a,copy:s}=t;let i;e[0]!==s.accountAccessLabel?(i=n.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s.accountAccessLabel}),e[0]=s.accountAccessLabel,e[1]=i):i=e[1];const l=a.signedIn?s.unlocked:s.locked;let o;e[2]!==l?(o=n.jsx("dd",{className:"mt-1 tabular-nums text-sm text-foreground",children:l}),e[2]=l,e[3]=o):o=e[3];let c;e[4]!==i||e[5]!==o?(c=n.jsxs("div",{children:[i,o]}),e[4]=i,e[5]=o,e[6]=c):c=e[6];let d;e[7]!==s.paidAccessLabel?(d=n.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s.paidAccessLabel}),e[7]=s.paidAccessLabel,e[8]=d):d=e[8];const m=a.paid?s.unlocked:s.locked;let u;e[9]!==m?(u=n.jsx("dd",{className:"mt-1 tabular-nums text-sm text-foreground",children:m}),e[9]=m,e[10]=u):u=e[10];let b;e[11]!==d||e[12]!==u?(b=n.jsxs("div",{children:[d,u]}),e[11]=d,e[12]=u,e[13]=b):b=e[13];let g;return e[14]!==c||e[15]!==b?(g=n.jsxs("dl",{className:"mt-4 grid gap-3 sm:grid-cols-2 sm:gap-x-6",children:[c,b]}),e[14]=c,e[15]=b,e[16]=g):g=e[16],g}function uo(t){const e=Fe.c(30),{snapshot:a,redactMachineId:s,locale:i,copy:l}=t,o=s===void 0?!1:s;let c;e[0]!==l?(c=l===void 0?{machine:"Machine",machineId:"Machine ID",connected:"Connected",lastHeartbeat:"Last heartbeat"}:l,e[0]=l,e[1]=c):c=e[1];const d=c;if(!a)return null;let m;if(e[2]!==d||e[3]!==i||e[4]!==o||e[5]!==a.connectedAt||e[6]!==a.lastHeartbeatAt||e[7]!==a.machineDisplayName||e[8]!==a.machineId){if(m=[],a.machineDisplayName&&!o){let b;e[10]!==d.machine||e[11]!==a.machineDisplayName?(b={label:d.machine,value:a.machineDisplayName},e[10]=d.machine,e[11]=a.machineDisplayName,e[12]=b):b=e[12],m.push(b)}else if(a.machineId&&!o){let b;e[13]!==d.machineId||e[14]!==a.machineId?(b={label:d.machineId,value:a.machineId},e[13]=d.machineId,e[14]=a.machineId,e[15]=b):b=e[15],m.push(b)}if(a.connectedAt){const b=d.connected;let g;e[16]!==i||e[17]!==a.connectedAt?(g=Ks(a.connectedAt,i),e[16]=i,e[17]=a.connectedAt,e[18]=g):g=e[18];let j;e[19]!==d.connected||e[20]!==g?(j={label:b,value:g},e[19]=d.connected,e[20]=g,e[21]=j):j=e[21],m.push(j)}if(a.lastHeartbeatAt){const b=d.lastHeartbeat;let g;e[22]!==i||e[23]!==a.lastHeartbeatAt?(g=Ks(a.lastHeartbeatAt,i),e[22]=i,e[23]=a.lastHeartbeatAt,e[24]=g):g=e[24];let j;e[25]!==d.lastHeartbeat||e[26]!==g?(j={label:b,value:g},e[25]=d.lastHeartbeat,e[26]=g,e[27]=j):j=e[27],m.push(j)}e[2]=d,e[3]=i,e[4]=o,e[5]=a.connectedAt,e[6]=a.lastHeartbeatAt,e[7]=a.machineDisplayName,e[8]=a.machineId,e[9]=m}else m=e[9];if(m.length===0)return null;let u;return e[28]!==m?(u=n.jsx("dl",{className:"mt-3 space-y-2 text-sm",children:m.map(mo)}),e[28]=m,e[29]=u):u=e[29],u}function mo(t){return n.jsxs("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:justify-between sm:gap-4",children:[n.jsx("dt",{className:"text-muted-foreground",children:t.label}),n.jsx("dd",{className:"min-w-0 break-all text-right tabular-nums text-foreground sm:text-left",children:t.value})]},t.label)}function vo(){var Gn,Qn,Yn;const t=Fa(),e=Hr(),{sectionId:a}=Gr(),s=nt("settings"),i=nt("featureAccess"),l=Ua(),o=qs(),c=Qr(),d=Yr(),m=Jr(),u=k.useMemo(()=>({...l,...o,...c,...d,...m}),[d,l,o,c,m]),{theme:b,setTheme:g}=Xr(),j=ns(r=>r.locale),U=ns(r=>r.setLocale),Z=ns(r=>r.restoreLocale),M=k.useMemo(()=>Jl(r=>s(r)),[s]),I=k.useMemo(()=>({cta:{account:i("cta.account"),paid:i("cta.paid")},denied:{account:i("denied.account",{featureName:"{featureName}"}),paid:i("denied.paid",{featureName:"{featureName}"})},deniedShort:{account:i("deniedShort.account",{featureName:"{featureName}"}),paid:i("deniedShort.paid",{featureName:"{featureName}"})}}),[i]),N=Ia(a)??"general",H=u.connectionStatus==="connecting",G=((Gn=u.localProjects)==null?void 0:Gn.machine.displayName)??s("common.unavailable"),Q=((Qn=u.localProjects)==null?void 0:Qn.projects.length)??0,K=ei.split("/")[1]??"unknown",B=We(r=>r.scrollbackLines),q=We(r=>r.minColumnWidth),le=We(r=>r.editorPreset),V=We(r=>r.editorCommandTemplate),Y=We(r=>r.setScrollbackLines),W=We(r=>r.setMinColumnWidth),se=We(r=>r.setEditorPreset),$=We(r=>r.setEditorCommandTemplate),S=u.generalSettings,oe=u.keybindings,p=u.providerSettings,ae=He(r=>r.defaultProvider),E=He(r=>r.providerDefaults),pe=He(r=>r.showProviderIconsInSideTray),he=He(r=>r.setDefaultProvider),A=He(r=>r.setProviderDefaultModel),xe=He(r=>r.setProviderDefaultModelOptions),ce=He(r=>r.setProviderDefaultPlanMode),be=He(r=>r.setShowProviderIconsInSideTray),ve=Ge(r=>r.folderGroupsEnabled),ye=Ge(r=>r.showFeatureOverviewInSidebar),_e=Ge(r=>r.kanbanStatusesEnabled),we=Ge(r=>r.commitProjectMetadataDirectory),Ee=Ge(r=>r.setFolderGroupsEnabled),Ze=Ge(r=>r.setShowFeatureOverviewInSidebar),Ke=Ge(r=>r.setKanbanStatusesEnabled),qe=Ge(r=>r.setCommitProjectMetadataDirectory),it=Te(r=>r.themeId),Qs=Te(r=>r.customAppearance),bt=Te(r=>r.backgroundImage),lt=Te(r=>r.backgroundOpacity),Ot=Te(r=>r.backgroundBlur),Ys=Te(r=>r.showProjectIconsInSidebar),Qa=Te(r=>r.availableThemes),Ya=Te(r=>r.setThemeId),Ja=Te(r=>r.setCustomAppearance),hs=Te(r=>r.setBackgroundImage),ps=Te(r=>r.setBackgroundOpacity),gs=Te(r=>r.setBackgroundBlur),Xa=Te(r=>r.setShowProjectIconsInSidebar),er=Qe(r=>r.browserNotificationsEnabled),Js=Qe(r=>r.soundEnabled),Xs=Qe(r=>r.vibrationEnabled),en=Qe(r=>r.lastPermissionState),qt=Qe(r=>r.setBrowserNotificationsEnabled),tr=Qe(r=>r.setSoundEnabled),sr=Qe(r=>r.setVibrationEnabled),tn=Qe(r=>r.setLastPermissionState),ot=k.useMemo(()=>ea(oe),[oe]),sn=ot.filePathDisplay||ti(),nr=(S==null?void 0:S.filePathDisplay)||si(),Wt=k.useMemo(()=>is(ot.bindings),[ot.bindings]),[nn,xs]=k.useState(String(B)),[an,Mt]=k.useState(Bt((S==null?void 0:S.settings.sendChunkSizeBytes)??zt.sendChunkSizeBytes)),[rn,vs]=k.useState(String(q)),[bs,ln]=k.useState(V),[ct,Ht]=k.useState(bt??""),[on,ys]=k.useState(String(lt)),[cn,ks]=k.useState(String(Ot)),[dt,Lt]=k.useState(()=>is(ot.bindings)),[js,dn]=k.useState(()=>is(ot.bindings)),[un,Gt]=k.useState(null),[Qt,mn]=k.useState(!1),[fn,ut]=k.useState(null),[hn,Yt]=k.useState(!1),_s=k.useRef(Wt),pn=k.useRef(Wt),[gn,ws]=k.useState(null),[ho,ar]=k.useState(""),[Dt,Ie]=k.useState(null),[mt,yt]=k.useState(null),[xn,kt]=k.useState(null),[vn,Ns]=k.useState(!1),[rr,bn]=k.useState(!1),[Ft,yn]=k.useState(!1),kn=k.useRef(null),[jt,jn]=k.useState(null),[Jt,Xt]=k.useState(null),ge=k.useMemo(()=>ni.map(r=>{var x;return((x=u.providerCatalog)==null?void 0:x.find(D=>D.id===r.id))??r}),[u.providerCatalog]),ir=k.useMemo(()=>new Map(ge.map(r=>[r.id,r])),[ge]),es=k.useMemo(()=>ai(ge,(p==null?void 0:p.settings)??re),[ge,p==null?void 0:p.settings]),me=r=>ir.get(r)??Ws(r),lr=ae==="last_used"||es.some(r=>r.id===ae)?ae:"last_used",[_n,or]=k.useState([]),L=u.updateSnapshot,wn=Oe.settingsUpdate("check"),Nn=Oe.settingsUpdate("install"),cr=Oe.settingsRemoteAuth("save"),Cs=Oe.settingsRemoteAuth("sign_in"),_t=Oe.settingsRemoteAuth("refresh"),Cn=Oe.settingsRemoteAuth("sign_out"),Tn=Oe.settingsRemoteAuth("streamer_mode"),Rn=Oe.settingsTheme("refresh"),Sn=Oe.settingsTheme("open_editor"),En=Oe.settingsTheme("open_folder"),In=Me(wn),An=Me(Nn);Me(cr);const Pn=Me(Cs),dr=Me(_t),ur=Me(Cn),On=Me(Tn),Be=Dt!==null||On,mr=Me(Rn),fr=Me(Sn),hr=Me(En),f=u.remoteAuth,ne=La(f),Ts=vi({browserNotificationsEnabled:er,signedIn:ne.signedIn}),Ne=u.themeSettings,Rs=oa(en),pr=xi(),gr=ui(Rs),Mn=Rs!=="unsupported",Ln=k.useRef(e.pathname),xr=typeof navigator<"u"&&typeof navigator.vibrate=="function",ft=so({...L,status:An?"updating":In?"checking":L==null?void 0:L.status},{update:s("general.header.update"),checkForUpdates:s("general.header.checkForUpdates")}),vr=In||(L==null?void 0:L.status)==="checking"?s("general.header.checkingStatus"):An||(L==null?void 0:L.status)==="updating"?s("general.header.installingStatus"):(L==null?void 0:L.status)==="restart_pending"?s("general.updateStatus.restarting",{appName:ta}):(L==null?void 0:L.status)==="available"?s("general.updateStatus.available",{version:L.latestVersion??""}):(L==null?void 0:L.status)==="up_to_date"?s("general.updateStatus.upToDate"):(L==null?void 0:L.status)==="error"?s("general.updateStatus.failed"):s("general.updateStatus.notChecked");k.useEffect(()=>{fetch(Ba("/api/backgrounds")).then(r=>r.json()).then(r=>or(r)).catch(r=>console.error("Failed to load system backgrounds",r))},[]),k.useEffect(()=>{Ln.current=e.pathname},[e.pathname]),k.useEffect(()=>{xs(String(B))},[B]),k.useEffect(()=>{Mt(Bt((S==null?void 0:S.settings.sendChunkSizeBytes)??zt.sendChunkSizeBytes))},[S==null?void 0:S.settings.sendChunkSizeBytes]),k.useEffect(()=>{vs(String(q))},[q]),k.useEffect(()=>{ln(V)},[V]),k.useEffect(()=>{Ht(bt??"")},[bt]),k.useEffect(()=>{ys(String(lt))},[lt]),k.useEffect(()=>{ks(String(Ot))},[Ot]),k.useEffect(()=>{const r=Wt,x=_s.current,D=to(dt,x,r);D.changed&&(_s.current=D.nextLoaded,dn(D.nextSaved),Lt(D.nextCurrent))},[dt,Wt]),k.useEffect(()=>{pn.current=dt},[dt]),k.useEffect(()=>{a&&(Ia(a)||t("/settings/general",{replace:!0}))},[t,a]);function Dn(){const r=Number(nn);if(!Number.isFinite(r)){xs(String(B));return}Y(r)}function Fn(){const r=Number(rn);if(!Number.isFinite(r)){vs(String(q));return}W(r)}async function Un(r){const x={sendChunkSizeBytes:(S==null?void 0:S.settings.sendChunkSizeBytes)??zt.sendChunkSizeBytes,locale:(S==null?void 0:S.settings.locale)??zt.locale,...r};return await u.socket.command({type:"settings.writeGeneralSettings",settings:x})}async function br(){const r=(S==null?void 0:S.settings.sendChunkSizeBytes)??zt.sendChunkSizeBytes,x=Number(an);if(!Number.isFinite(x)){ut(s("general.chatChunkSize.errors.notNumber")),Mt(Bt(r));return}const D=Math.round(x*1024);if(D<rs||D>as){ut(s("general.chatChunkSize.errors.outOfRange",{min:rs/1024,max:as/1024}));return}if(D===r){ut(null),Mt(Bt(r));return}try{Yt(!0),ut(null);const fe=await Un({sendChunkSizeBytes:D});Mt(Bt(fe.settings.sendChunkSizeBytes))}catch(fe){ut(fe instanceof Error?fe.message:s("general.errors.saveFailed"))}finally{Yt(!1)}}async function yr(r){const x=r,D=j,fe=ns.getState().persistedLocale;if(x!==D){U(x);try{Yt(!0),ut(null),await Un({locale:x})}catch(je){Z(D,fe),ut(je instanceof Error?je.message:s("general.errors.saveFailed"))}finally{Yt(!1)}}}function zn(){const r=ct.trim()===""?null:ct.trim(),x=Pa({themePreference:b,nextBackgroundImage:r,backgroundOpacity:lt});hs(r),x.backgroundOpacity!==void 0&&ps(x.backgroundOpacity),x.backgroundBlur!==void 0&&gs(x.backgroundBlur),$e({backgroundImage:r,...x})}function Bn(){const r=Number(on);if(!Number.isFinite(r)||r<0||r>1){ys(String(lt));return}ps(r),$e({backgroundOpacity:r})}function $n(){const r=Number(cn);if(!Number.isFinite(r)||r<0){ks(String(Ot));return}gs(r),$e({backgroundBlur:r})}function ts(r,x){r.key==="Enter"&&(x(),r.currentTarget.blur())}function Vn(r,x){r.key==="Enter"&&(x(),r.currentTarget.blur())}function Zn(){$(bs)}async function kr(r=pn.current){try{mn(!0),Gt(null);const x={...r},D=await u.socket.command({type:"settings.writeKeybindings",bindings:fo(x)}),fe=is(ea(D).bindings);_s.current=fe,dn(fe),Lt(je=>eo(je,x,fe))}catch(x){Gt(x instanceof Error?x.message:s("keybindings.errors.saveFailed"))}finally{mn(!1)}}async function $e(r){try{await u.socket.command({type:"settings.writeThemeSettings",settings:{themePreference:(r==null?void 0:r.themePreference)??b,themeId:(r==null?void 0:r.themeId)??it,customAppearance:(r==null?void 0:r.customAppearance)??Qs,backgroundImage:(r==null?void 0:r.backgroundImage)!==void 0?r.backgroundImage:bt,backgroundOpacity:(r==null?void 0:r.backgroundOpacity)??lt,backgroundBlur:(r==null?void 0:r.backgroundBlur)??Ot,showProjectIconsInSidebar:(r==null?void 0:r.showProjectIconsInSidebar)??Ys}})}catch(x){console.error("Failed to save theme settings:",x)}}async function Ss(r,x){jn(r);try{await Le(r==="refresh"?Rn:r==="open_editor"?Sn:En,x,{statusLabel:s(r==="refresh"?"general.colorTheme.refreshingStatus":r==="open_editor"?"general.colorTheme.openingFilesStatus":"general.colorTheme.openingFolderStatus")})}finally{jn(D=>D===r?null:D)}}async function Kn(){if(ne.features.browserNotifications.enabled){Xt("requesting");try{const r=await ca();tn(r),qt(r==="granted")}finally{Xt(r=>r==="requesting"?null:r)}}}async function jr(){if(ne.features.browserNotifications.enabled){Xt("testing");try{let r=oa(en);Ts&&r==="default"&&Mn&&(r=await ca(),tn(r),r!=="granted"&&qt(!1)),await bi({event:{chatId:u.activeChatId??"settings-test",chatTitle:s("general.testNotification.previewChatTitle"),kind:"needs_input",projectTitle:s("title")},onBrowserNotificationClick:()=>{t("/settings/general",{replace:Ln.current.startsWith("/settings")})},preferences:{browserNotificationsEnabled:Ts&&r==="granted",soundEnabled:Js,vibrationEnabled:Xs}})}finally{Xt(r=>r==="testing"?null:r)}}}async function wt(r){const x=(p==null?void 0:p.settings)??re,D=r.openrouter.active&&!x.openrouter.active&&!ne.features.openrouter.enabled,fe=ne.features.openrouter.enabled?r:{...r,openrouter:{...r.openrouter,active:!1}};D&&ws(s("providers.openRouterDenied"));try{D||ws(null),await u.socket.command({type:"settings.writeProviderSettings",settings:fe})}catch(je){ws(je instanceof Error?je.message:s("providers.errors.saveFailed"))}}function _r(r){Gt(null),Lt(x=>({...x,[r]:Fs(da[r])}))}function wr(){Gt(null),Lt(js)}async function Nr(r){yt(r?"enable":"disable");try{kt(null),await u.socket.command({type:"remoteRelay.setEnabled",enabled:r})}catch(x){kt(x instanceof Error?x.message:String(x))}finally{yt(x=>x===(r?"enable":"disable")?null:x)}}async function Cr(){yt("reconnect");try{kt(null),await u.socket.command({type:"remoteRelay.setEnabled",enabled:!0})}catch(r){kt(r instanceof Error?r.message:String(r))}finally{yt(r=>r==="reconnect"?null:r)}}async function Tr(){yt("rotate");try{kt(null),await u.socket.command({type:"remoteRelay.rotateUrlKey"})}catch(r){kt(r instanceof Error?r.message:String(r))}finally{yt(r=>r==="rotate"?null:r)}}const Rr=bs.replaceAll("{path}","/Users/jake/Projects/kaizen/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),qn=M.find(r=>r.id===N)??M[0],Sr=N==="keybindings"?s("keybindings.subtitle",{path:sn}):qn.subtitle,Er=ne.features.openrouter.enabled?es:[...es,...es.some(r=>r.id==="openrouter")?[]:[me("openrouter")]];k.useEffect(()=>{ae==="openrouter"&&(ne.features.openrouter.enabled||he("last_used"))},[ne.features.openrouter.enabled,ae,he]);const w=u.remoteRelay,Ce=(f==null?void 0:f.status)==="signed_in",Ir=((Yn=f==null?void 0:f.entitlements)==null?void 0:Yn["remote.relay"])===!0,Ar=(w==null?void 0:w.status)==="unauthorized",Es=Ce&&Ir&&!Ar,Nt=(w==null?void 0:w.relayEnabled)??!0,Pr=(w==null?void 0:w.status)==="idle_disconnected"&&Nt,Or=!ne.features.openrouter.enabled,Mr=!ne.features.remoteRelay.enabled,ke=!Ce||(f==null?void 0:f.streamerModeEnabled)!==!1,ss=Ce&&(f==null?void 0:f.streamerModeEnabled)!==!1,Lr=k.useMemo(()=>(f==null?void 0:f.status)==="signed_in"?ke?s("account.account.descriptionSignedInHidden",{syncSeconds:Ea/1e3,fallbackMinutes:Ms/6e4}):s("account.account.descriptionSignedInVisible",{userId:f.userId??s("account.account.yourAccount"),syncSeconds:Ea/1e3,fallbackMinutes:Ms/6e4,expiresAt:Ks(f.accessTokenExpiresAt,j)}):(f==null?void 0:f.status)==="pending_sign_in"?s("account.account.descriptionPending"):f!=null&&f.error?f.error:s("account.account.descriptionSignedOut"),[s,f==null?void 0:f.status,f==null?void 0:f.userId,f==null?void 0:f.accessTokenExpiresAt,f==null?void 0:f.error,ke]),Dr=k.useMemo(()=>Ce?Es?Nt?(w==null?void 0:w.status)==="idle_disconnected"?s("account.remoteRelay.descriptionIdleDisconnected"):w!=null&&w.publicUrl&&!ke?s("account.remoteRelay.descriptionPublished",{url:w.publicUrl}):s("account.remoteRelay.descriptionDefault"):s("account.remoteRelay.descriptionDisabled"):s("account.remoteRelay.descriptionControlled"):s("account.remoteRelay.descriptionSignedOut"),[s,Ce,Es,Nt,w==null?void 0:w.status,w==null?void 0:w.publicUrl,ke]);k.useEffect(()=>{ke&&(Ns(!1),bn(!1),yn(!1))},[ke,f==null?void 0:f.status,u.lastRemoteAuthUrl,w==null?void 0:w.publicUrl]);const Wn=!H,Fr=N==="keybindings"?n.jsxs(n.Fragment,{children:[n.jsx(Je,{"data-testid":"keybindings-cancel-button",onClick:wr,disabled:Qt||ms(dt,js),children:s("keybindings.actions.cancel")}),n.jsx(Je,{"data-testid":"keybindings-save-button",variant:"default",onClick:()=>{kr()},disabled:Qt||ms(dt,js),icon:Qt?n.jsx(Re,{className:"h-4 w-4 animate-spin"}):void 0,children:s(Qt?"actions.saving":"actions.save")}),n.jsx(Je,{onClick:()=>{u.handleOpenExternalPath("open_editor",sn)},icon:n.jsx(Ds,{className:"h-4 w-4"}),children:s("actions.openIn",{editor:u.editorLabel})})]}):N==="general"?n.jsx(Je,{variant:ft.variant,onClick:()=>{if(ft.kind==="update"){Le(Nn,()=>u.handleInstallUpdate(),{statusLabel:s("general.header.installingStatus")});return}Le(wn,()=>u.handleCheckForUpdates({force:!0}),{statusLabel:s("general.header.checkingStatus")})},disabled:ft.disabled,icon:ft.kind==="check"?n.jsx(Ls,{className:Ae("size-3.5",ft.spinning&&"animate-spin")}):ft.kind==="update"?n.jsx(Va,{className:Ae("size-3.5")}):void 0,children:ft.label}):null;function Hn(){if(no(window.history.state)==="back"){t(-1);return}t("/",{replace:!0})}return k.useEffect(()=>{ar((f==null?void 0:f.baseUrl)??"")},[f==null?void 0:f.baseUrl]),k.useEffect(()=>{const r=u.handleReloadRemoteAuth,x=N==="account"&&kn.current!=="account";kn.current=N,x&&(Be||(f==null?void 0:f.status)!=="signed_in"&&(f==null?void 0:f.status)!=="error"||(Ie("refresh"),Le(_t,r,{statusLabel:s("account.actions.refreshingStatus")}).finally(()=>{Ie(D=>D==="refresh"?null:D)})))},[_t,Be,f==null?void 0:f.status,N,u.handleReloadRemoteAuth]),k.useEffect(()=>{const r=u.handleReloadRemoteAuth;if(N!=="account"||(f==null?void 0:f.status)!=="signed_in"&&(f==null?void 0:f.status)!=="error")return;const x=()=>{Be||(Ie("refresh"),Le(_t,r,{statusLabel:s("account.actions.refreshingStatus")}).finally(()=>{Ie(je=>je==="refresh"?null:je)}))},D=()=>{document.visibilityState==="visible"&&x()};window.addEventListener("focus",x),document.addEventListener("visibilitychange",D);const fe=window.setInterval(x,Ms);return()=>{window.removeEventListener("focus",x),document.removeEventListener("visibilitychange",D),window.clearInterval(fe)}},[_t,Be,f==null?void 0:f.status,N,u.handleReloadRemoteAuth]),n.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[n.jsxs("div",{className:"flex min-w-0 flex-1",children:[n.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${Wn?"pb-[89px]":""}`,children:n.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[n.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:s("title")}),M.map(r=>n.jsx("button",{type:"button",onClick:()=>t(`/settings/${r.id}`,{replace:!0}),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${r.id===N?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx(r.icon,{className:"h-4 w-4 shrink-0"}),n.jsx("span",{children:r.label})]})},r.label))]})}),n.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto",children:[n.jsx("div",{className:"md:hidden sticky top-0 z-10 bg-background border-b border-border px-4 py-2 backdrop-blur-md",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-hide",children:M.map(r=>n.jsxs("button",{type:"button",onClick:()=>t(`/settings/${r.id}`,{replace:!0}),className:`flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors ${r.id===N?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:[n.jsx(r.icon,{className:"h-3.5 w-3.5 shrink-0"}),n.jsx("span",{children:r.label})]},r.id))}),n.jsx("button",{type:"button","aria-label":s("common.closeSettings"),onClick:Hn,className:"ml-1 flex shrink-0 items-center justify-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:n.jsx(sa,{className:"h-4 w-4"})})]})}),n.jsxs("div",{className:"w-full px-6 pt-8 md:pt-16 pb-32",children:[H?n.jsx("div",{className:"flex min-h-[240px] items-center justify-center rounded-2xl border border-border bg-card/40 px-4 py-6 text-sm text-muted-foreground",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Re,{className:"h-4 w-4 animate-spin"}),n.jsx("span",{children:s("common.loadingMachineSettings")})]})}):n.jsxs("div",{className:"mx-auto max-w-4xl",children:[n.jsxs("div",{className:"pb-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4 min-h-[34px]",children:[n.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:qn.label}),n.jsxs("div",{className:"flex items-center gap-2",children:[Fr,n.jsx(Je,{"aria-label":s("common.closeSettings"),title:s("common.closeSettings"),onClick:Hn,icon:n.jsx(sa,{className:"h-4 w-4"}),className:"hidden md:flex"})]})]}),n.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:Sr})]}),N==="account"?n.jsxs("div",{className:"border-b border-border",children:[n.jsx(P,{title:s("account.dashboard.title"),description:s("account.dashboard.description"),alignStart:!0,bordered:!1,children:n.jsxs("a",{href:$i(f==null?void 0:f.baseUrl),target:"_blank",rel:"noopener noreferrer",className:Ae(Ma({variant:"outline"}),"inline-flex gap-2 no-underline"),children:[n.jsx(ri,{className:"h-4 w-4 shrink-0"}),s("account.dashboard.open")]})}),n.jsx(P,{title:s("account.streamerMode.title"),description:s(Ce?"account.streamerMode.descriptionSignedIn":"account.streamerMode.descriptionSignedOut"),alignStart:!0,bordered:!1,children:n.jsxs(ie,{type:"button",variant:ss?"default":"outline","aria-pressed":ss,className:"min-w-[72px]",disabled:!Ce||Be,onClick:()=>{Le(Tn,()=>u.handleSetStreamerMode(!ss),{statusLabel:s("account.streamerMode.updatingStatus")})},children:[On?n.jsx(Re,{className:"mr-2 h-4 w-4 animate-spin"}):null,s(ss?"common.on":"common.off")]})}),n.jsx(P,{title:s("account.email.title"),description:s(Ce?ke?"account.email.descriptionHidden":"account.email.descriptionVisible":"account.email.descriptionSignedOut"),alignStart:!0,children:n.jsxs("div",{className:"flex min-w-0 max-w-full items-center gap-2 sm:max-w-[360px]",children:[n.jsx("div",{className:"min-w-0 flex-1 text-sm text-foreground",children:Ce?ke&&!Ft?n.jsx("span",{className:"text-muted-foreground",children:"—"}):f!=null&&f.email?n.jsx("span",{className:"break-all",children:f.email}):n.jsx("span",{className:"text-muted-foreground",children:s("account.email.notSynced")}):n.jsx("span",{className:"text-muted-foreground",children:"—"})}),Ce&&ke?n.jsx(ie,{type:"button",variant:"outline",size:"sm",className:"h-9 w-9 shrink-0 p-0","aria-pressed":Ft,"aria-label":s(Ft?"account.email.hide":"account.email.show"),title:s(Ft?"account.email.hide":"account.email.show"),onClick:()=>yn(r=>!r),children:Ft?n.jsx(ma,{className:"h-4 w-4"}):n.jsx(ua,{className:"h-4 w-4"})}):null]})}),n.jsx(P,{title:s("account.account.title"),badge:Ce?null:n.jsx(gt,{level:"account",label:Rt("account",I)}),description:Lr,bordered:!1,alignStart:!0,children:n.jsxs("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[360px]",children:[Ql({remoteAuthSnapshot:f,saveLabel:s("account.account.saveUrl")}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[(f==null?void 0:f.status)==="signed_out"||(f==null?void 0:f.status)==="error"?n.jsxs(n.Fragment,{children:[n.jsxs(ie,{type:"button",variant:"outline",disabled:Be,onClick:()=>{Ie("sign_in"),Le(Cs,()=>u.handleStartRemoteAuthSignIn("sign_up"),{statusLabel:s("account.actions.startingSignUpStatus")}).finally(()=>Ie(null))},children:[Dt==="sign_in"||Pn?n.jsx(Re,{className:"mr-2 h-4 w-4 animate-spin"}):null,s("account.actions.signUp")]}),n.jsxs(ie,{type:"button",disabled:Be,onClick:()=>{Ie("sign_in"),Le(Cs,()=>u.handleStartRemoteAuthSignIn("sign_in"),{statusLabel:s("account.actions.startingSignInStatus")}).finally(()=>Ie(null))},children:[Dt==="sign_in"||Pn?n.jsx(Re,{className:"mr-2 h-4 w-4 animate-spin"}):null,s("account.actions.signIn")]})]}):null,(f==null?void 0:f.status)!=="signed_out"?n.jsxs(ie,{type:"button",variant:"outline",disabled:Be,onClick:()=>{Ie("refresh"),Le(_t,()=>u.handleReloadRemoteAuth(),{statusLabel:s("account.actions.refreshingStatus")}).finally(()=>Ie(null))},children:[Dt==="refresh"||dr?n.jsx(Re,{className:"mr-2 h-4 w-4 animate-spin"}):null,s("account.actions.refresh")]}):null,(f==null?void 0:f.status)!=="signed_out"?n.jsxs(ie,{type:"button",variant:"outline",disabled:Be,onClick:()=>{Ie("sign_out"),Le(Cn,()=>u.handleSignOutRemoteAuth(),{statusLabel:s("account.actions.signingOutStatus")}).finally(()=>Ie(null))},children:[Dt==="sign_out"||ur?n.jsx(Re,{className:"mr-2 h-4 w-4 animate-spin"}):null,(f==null?void 0:f.status)==="pending_sign_in"?s("account.actions.cancelSignIn"):s("account.actions.signOut")]}):null]}),(f==null?void 0:f.status)==="pending_sign_in"&&u.lastRemoteAuthUrl?n.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:[n.jsx("div",{className:"font-medium text-foreground",children:s("account.account.continueSignIn")}),ke&&!rr?n.jsx(ie,{type:"button",variant:"outline",className:"mt-2",onClick:()=>bn(!0),children:s("account.account.showSignInLink")}):n.jsx("a",{href:u.lastRemoteAuthUrl,target:"_self",rel:"noreferrer",className:"mt-1 block break-all text-primary underline underline-offset-2",children:u.lastRemoteAuthUrl})]}):null]})}),Ce?n.jsxs(n.Fragment,{children:[n.jsx(P,{title:s("account.unlockedFeatures.title"),description:s("account.unlockedFeatures.description"),alignStart:!0,children:n.jsxs("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[420px]",children:[n.jsx(lo,{access:ne,copy:{accountFeaturesLabel:s("account.unlockedFeatures.accountFeaturesLabel"),accountFeaturesUnlocked:s("account.unlockedFeatures.accountFeaturesUnlocked"),accountFeaturesLocked:s("account.unlockedFeatures.accountFeaturesLocked"),paidFeaturesLabel:s("account.unlockedFeatures.paidFeaturesLabel"),paidFeaturesUnlocked:s("account.unlockedFeatures.paidFeaturesUnlocked"),paidFeaturesLocked:s("account.unlockedFeatures.paidFeaturesLocked"),destinationLabel:s("account.unlockedFeatures.destinationLabel"),destinationBody:s("account.unlockedFeatures.destinationBody",{route:za})}}),n.jsx(co,{access:ne,copy:{accountAccessLabel:s("account.unlockedFeatures.accountAccessLabel"),paidAccessLabel:s("account.unlockedFeatures.paidAccessLabel"),unlocked:s("account.unlockedFeatures.unlocked"),locked:s("account.unlockedFeatures.locked")}})]})}),n.jsx(P,{title:s("account.savedData.title"),description:ke?s("account.savedData.descriptionHidden"):s("account.savedData.descriptionVisible",{path:(f==null?void 0:f.filePathDisplay)??"~/.kaizen/remote-auth.json"}),alignStart:!0,children:n.jsx("div",{className:"text-sm text-foreground",children:ro((f==null?void 0:f.status)??"signed_out",{signedIn:s("account.connection.signedIn"),signedOut:s("account.connection.signedOut"),pendingSignIn:s("account.connection.pendingSignIn"),error:s("account.connection.error")})})})]}):null,n.jsx(P,{title:s("account.remoteRelay.title"),badge:Mr?n.jsx(gt,{level:"paid",label:Rt("paid",I)}):null,description:Dr,alignStart:!0,children:n.jsx("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[420px]",children:ne.features.remoteRelay.enabled?Es?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[n.jsxs("div",{className:"text-sm text-foreground",children:[s("account.remoteRelay.statusLabel"),":"," ",io(w==null?void 0:w.status,s)]}),n.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[w!=null&&w.publicUrl&&ke?vn?n.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>Ns(!1),children:[n.jsx(ma,{className:"h-4 w-4 shrink-0"}),s("account.remoteRelay.hide")]}):n.jsxs(ii,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>Ns(!0),children:[n.jsx(ua,{className:"h-4 w-4 shrink-0"}),s("account.remoteRelay.view")]})}),n.jsx(oi,{side:"bottom",className:"max-w-xs text-left",children:s("account.remoteRelay.hiddenTooltip")})]}):null,n.jsx(ie,{type:"button",variant:Nt?"outline":"default",disabled:mt!==null,onClick:()=>{Nr(!Nt)},children:s(mt==="enable"?"account.remoteRelay.enabling":mt==="disable"?"account.remoteRelay.disabling":Nt?"account.remoteRelay.disable":"account.remoteRelay.enable")}),n.jsx(ie,{type:"button",variant:"outline",disabled:mt!==null||!(w!=null&&w.publicUrl),onClick:()=>{Tr()},children:s(mt==="rotate"?"account.remoteRelay.rotatingUrl":"account.remoteRelay.rotateUrl")})]})]}),(w==null?void 0:w.status)==="manually_disabled"?n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:s("account.remoteRelay.manuallyDisabled")}):null,(w==null?void 0:w.status)==="idle_disconnected"?n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:s("account.remoteRelay.idleDisconnected")}),n.jsx(ie,{type:"button",variant:"outline",disabled:mt!==null||!Pr,onClick:()=>{Cr()},children:s(mt==="reconnect"?"account.remoteRelay.reconnecting":"account.remoteRelay.reconnectNow")})]}):null,w!=null&&w.publicUrl&&(!ke||vn)?n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:s("account.remoteRelay.scanHint")}),n.jsx(ao,{url:w.publicUrl}),n.jsx("div",{className:"break-all rounded-lg border border-border bg-muted/30 px-3 py-2 font-mono text-xs text-foreground",children:w.publicUrl})]}):null,Oa(xn??(w==null?void 0:w.error),s)?n.jsx("div",{className:"text-sm text-red-500",children:Oa(xn??(w==null?void 0:w.error),s)}):null,n.jsx(uo,{snapshot:w,redactMachineId:ke,locale:j,copy:{machine:s("account.remoteRelay.facts.machine"),machineId:s("account.remoteRelay.facts.machineId"),connected:s("account.remoteRelay.facts.connected"),lastHeartbeat:s("account.remoteRelay.facts.lastHeartbeat")}})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-sm text-foreground",children:[s("account.remoteRelay.statusLabel"),":"," ",s("account.remoteRelay.unauthorized")]}),n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:s("account.remoteRelay.unauthorizedDescription")})]}):n.jsx("div",{className:"text-sm text-muted-foreground",children:s(Ce?"account.remoteRelay.lockedMessage":"account.remoteRelay.signInToUnlock")})})})]}):N==="general"?n.jsx(n.Fragment,{children:n.jsxs("div",{className:"border-b border-border",children:[n.jsx(P,{title:s("general.applicationUpdate.title"),description:n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[vr,"."]}),L!=null&&L.lastCheckedAt?n.jsxs("span",{children:[" ",s("general.applicationUpdate.lastChecked",{timestamp:new Intl.DateTimeFormat(j||"en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(L.lastCheckedAt)})]}):null,L!=null&&L.error?n.jsxs("span",{children:[" ",L.error]}):null]}),bordered:!1,children:n.jsxs("div",{className:"text-right text-sm text-foreground",children:[n.jsxs("div",{children:[s("general.applicationUpdate.current"),":"," ",(L==null?void 0:L.currentVersion)??K]}),n.jsxs("div",{className:"text-xs text-muted-foreground",children:[s("general.applicationUpdate.latest"),":"," ",(L==null?void 0:L.latestVersion)??s("general.applicationUpdate.unknown")]})]})}),n.jsx(P,{title:s("general.language.title"),description:s("general.language.description"),children:n.jsxs(J,{value:j,onValueChange:r=>void yr(r),children:[n.jsx(X,{className:"w-[180px]",children:n.jsx(te,{})}),n.jsx(ee,{children:ci.map(r=>n.jsx(C,{value:r,children:di[r]},r))})]})}),n.jsx(P,{title:s("general.theme.title"),description:s("general.theme.description"),children:n.jsxs(J,{value:b,onValueChange:r=>{g(r),$e({themePreference:r})},children:[n.jsx(X,{className:"w-[150px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"light",children:s("general.theme.light")}),n.jsx(C,{value:"dark",children:s("general.theme.dark")}),n.jsx(C,{value:"system",children:s("general.theme.system")}),n.jsx(C,{value:"custom",children:s("general.theme.custom")})]})]})}),b==="custom"?n.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[n.jsx(P,{title:s("general.appearance.title"),description:s("general.appearance.description"),bordered:!1,children:n.jsxs(J,{value:Qs,onValueChange:r=>{Ja(r),$e({customAppearance:r})},children:[n.jsx(X,{className:"w-[150px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"light",children:s("general.theme.light")}),n.jsx(C,{value:"dark",children:s("general.theme.dark")}),n.jsx(C,{value:"system",children:s("general.theme.system")})]})]})}),n.jsx(P,{title:s("general.colorTheme.title"),description:s("general.colorTheme.description",{themesDirectory:(Ne==null?void 0:Ne.themesDirectoryDisplay)??"~/.kaizen/themes",themesReadme:(Ne==null?void 0:Ne.themesReadmeFileDisplay)??"~/.kaizen/themes/THEME_README.md"}),alignStart:!0,bordered:!1,children:n.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs(J,{value:it,onValueChange:r=>{Ya(r),$e({themeId:r})},children:[n.jsx(X,{className:"min-w-[180px]",children:n.jsx(te,{})}),n.jsx(ee,{children:n.jsx(Is,{children:Qa.map(r=>n.jsx(C,{value:r.id,children:r.label},r.id))})})]}),n.jsx(Je,{variant:"outline","aria-label":s("general.colorTheme.refreshThemes"),title:s("general.colorTheme.refreshThemes"),className:"px-2.5",disabled:jt!==null,onClick:()=>{Ss("refresh",()=>u.handleRefreshThemeSettings())},icon:jt==="refresh"||mr?n.jsx(Re,{className:"size-3.5 animate-spin"}):n.jsx(Ls,{className:"size-3.5"})})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(Je,{disabled:jt!==null,onClick:()=>{Ss("open_editor",()=>u.handleOpenCustomThemes())},icon:jt==="open_editor"||fr?n.jsx(Re,{className:"size-3.5 animate-spin"}):n.jsx(Pi,{className:"size-3.5"}),children:s("actions.openIn",{editor:u.editorLabel})}),n.jsx(Je,{variant:"outline",disabled:jt!==null,onClick:()=>{Ss("open_folder",()=>u.handleOpenExternalPath("open_finder",(Ne==null?void 0:Ne.themesDirectoryDisplay)??"~/.kaizen/themes"))},icon:jt==="open_folder"||hr?n.jsx(Re,{className:"size-3.5 animate-spin"}):n.jsx(Ds,{className:"size-3.5"}),children:s("general.colorTheme.openFolder")})]}),Ne!=null&&Ne.customThemeWarnings.length?n.jsx("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:Ne.customThemeWarnings.join(" ")}):null]})}),n.jsx(P,{title:s("general.backgroundImage.title"),description:s("general.backgroundImage.description"),alignStart:!0,bordered:!1,children:(()=>{const r=_n.find(de=>de.url===ct),x=!ct,D=!!ct&&!r,fe=x?"__none__":D?"__custom__":ct,je=x?s("common.none"):D?s("common.customUrl"):(r==null?void 0:r.name)??s("common.unknown");return n.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[n.jsxs(J,{value:fe,onValueChange:de=>{if(de==="__none__")Ht(""),hs(null),$e({backgroundImage:null});else{const ht=Pa({themePreference:b,nextBackgroundImage:de,backgroundOpacity:lt});Ht(de),hs(de),ht.backgroundOpacity!==void 0&&ps(ht.backgroundOpacity),ht.backgroundBlur!==void 0&&gs(ht.backgroundBlur),$e({backgroundImage:de,...ht})}},children:[n.jsx(X,{className:"w-full",children:n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[x?null:n.jsx("img",{src:As(bt??null)??void 0,alt:"",className:"h-5 w-9 shrink-0 rounded object-cover"}),n.jsx("span",{className:"truncate",children:je})]})}),n.jsxs(ee,{children:[n.jsx(Ps,{value:"__none__",children:s("common.none")}),_n.map(de=>n.jsx(Ps,{value:de.url,thumbnail:As(de.url)??de.url,thumbnailAlt:de.name,children:de.name},de.id)),D?n.jsx(Ps,{value:"__custom__",thumbnail:As(bt??null)??void 0,thumbnailAlt:"Custom",children:s("common.customUrl")}):null]})]}),n.jsx(Ue,{type:"text",placeholder:s("general.backgroundImage.placeholder"),value:ct,onChange:de=>Ht(de.target.value),onBlur:zn,onKeyDown:de=>Vn(de,zn),className:"w-full"})]})})()}),n.jsx(P,{title:s("general.backgroundOpacity.title"),description:s("general.backgroundOpacity.description"),bordered:!1,children:n.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:n.jsx(Ue,{type:"number",min:0,max:1,step:.05,value:on,onChange:r=>ys(r.target.value),onBlur:Bn,onKeyDown:r=>ts(r,Bn),className:"hide-number-steppers w-28 text-right font-mono"})})}),n.jsx(P,{title:s("general.backgroundBlur.title"),description:s("general.backgroundBlur.description"),bordered:!1,children:n.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:n.jsx(Ue,{type:"number",min:0,max:50,step:1,value:cn,onChange:r=>ks(r.target.value),onBlur:$n,onKeyDown:r=>ts(r,$n),className:"hide-number-steppers w-28 text-right font-mono"})})})]}):null,pr?n.jsxs(n.Fragment,{children:[n.jsx(P,{title:s("general.browserNotifications.title"),badge:ne.features.browserNotifications.enabled?null:n.jsx(gt,{level:"paid",label:Rt("paid",I)}),description:s("general.browserNotifications.description"),children:n.jsxs(J,{value:Ts?"enabled":"disabled",onValueChange:r=>{if(r==="enabled"){if(!ne.features.browserNotifications.enabled)return;Rs==="granted"?qt(!0):Kn();return}qt(!1)},disabled:!ne.features.browserNotifications.enabled,children:[n.jsx(X,{className:"w-[100px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"disabled",children:s("common.off")}),n.jsx(C,{value:"enabled",children:s("common.on")})]})]})}),ne.features.browserNotifications.enabled?n.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[n.jsx(P,{title:s("general.permission.title"),description:s("general.permission.description"),bordered:!1,alignStart:!0,children:n.jsxs("div",{className:"flex w-full flex-col items-end gap-2 text-right sm:w-auto",children:[n.jsxs("div",{className:"flex items-center justify-end gap-2 text-sm text-foreground",children:[n.jsx(ji,{className:"size-4 text-muted-foreground"}),n.jsx("span",{children:gr})]}),n.jsx("div",{className:"flex w-full flex-wrap justify-end gap-2 sm:w-auto",children:n.jsxs(ie,{type:"button",variant:"outline",disabled:!Mn||Jt!==null,onClick:()=>{Kn()},children:[Jt==="requesting"?n.jsx(Re,{className:"mr-2 size-4 animate-spin"}):null,s("general.permission.enable")]})})]})}),n.jsx(P,{title:s("general.notificationSound.title"),description:s("general.notificationSound.description"),bordered:!1,children:n.jsxs(J,{value:Js?"enabled":"disabled",onValueChange:r=>{tr(r==="enabled")},children:[n.jsx(X,{className:"ml-auto w-[100px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"disabled",children:s("common.off")}),n.jsx(C,{value:"enabled",children:s("common.on")})]})]})}),xr?n.jsx(P,{title:s("general.vibration.title"),description:s("general.vibration.description"),bordered:!1,children:n.jsxs(J,{value:Xs?"enabled":"disabled",onValueChange:r=>{sr(r==="enabled")},children:[n.jsx(X,{className:"ml-auto w-[100px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"disabled",children:s("common.off")}),n.jsx(C,{value:"enabled",children:s("common.on")})]})]})}):null,n.jsx(P,{title:s("general.testNotification.title"),description:s("general.testNotification.description"),bordered:!1,children:n.jsx("div",{className:"flex flex-wrap justify-end gap-2",children:n.jsxs(ie,{type:"button",variant:"outline",disabled:Jt!==null,onClick:()=>{jr()},children:[Jt==="testing"?n.jsx(Re,{className:"mr-2 size-4 animate-spin"}):null,s("general.testNotification.button")]})})})]}):null]}):null,n.jsx(P,{title:s("general.projectIcons.title"),description:s("general.projectIcons.description"),children:n.jsxs(J,{value:Ys?"enabled":"disabled",onValueChange:r=>{const x=r==="enabled";Xa(x),$e({showProjectIconsInSidebar:x})},children:[n.jsx(X,{className:"w-[100px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"disabled",children:s("common.off")}),n.jsx(C,{value:"enabled",children:s("common.on")})]})]})}),n.jsx(P,{title:s("general.folderGroups.title"),description:s("general.folderGroups.description"),children:n.jsxs(J,{value:ve?"enabled":"disabled",onValueChange:r=>Ee(r==="enabled"),children:[n.jsx(X,{className:"w-[100px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"disabled",children:s("common.off")}),n.jsx(C,{value:"enabled",children:s("common.on")})]})]})}),ve?n.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[n.jsx(P,{title:s("general.featureOverview.title"),description:s("general.featureOverview.description"),bordered:!1,children:n.jsxs(J,{value:ye?"enabled":"disabled",onValueChange:r=>Ze(r==="enabled"),children:[n.jsx(X,{className:"w-[100px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"disabled",children:s("common.off")}),n.jsx(C,{value:"enabled",children:s("common.on")})]})]})}),n.jsx(P,{title:s("general.kanbanStatus.title"),description:s("general.kanbanStatus.description"),bordered:!1,children:n.jsxs(J,{value:_e?"enabled":"disabled",onValueChange:r=>Ke(r==="enabled"),children:[n.jsx(X,{className:"w-[100px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"disabled",children:s("common.off")}),n.jsx(C,{value:"enabled",children:s("common.on")})]})]})}),n.jsx(P,{title:s("general.projectMetadata.title",{directory:na}),description:s("general.projectMetadata.description",{appName:ta,directory:na}),bordered:!1,children:n.jsxs(J,{value:we?"commit":"ignore",onValueChange:r=>{const x=r==="commit";qe(x),u.handleSetCommitProjectMetadataDirectory(x)},children:[n.jsx(X,{className:"w-[120px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"commit",children:s("general.projectMetadata.commit")}),n.jsx(C,{value:"ignore",children:s("general.projectMetadata.ignore")})]})]})})]}):null,n.jsx(P,{title:s("general.providerIcons.title"),description:s("general.providerIcons.description"),children:n.jsxs(J,{value:pe?"enabled":"disabled",onValueChange:r=>be(r==="enabled"),children:[n.jsx(X,{className:"w-[100px]",children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"disabled",children:s("common.off")}),n.jsx(C,{value:"enabled",children:s("common.on")})]})]})}),n.jsx(P,{title:s("general.defaultEditor.title"),description:s("general.defaultEditor.description"),alignStart:!0,children:n.jsxs(J,{value:le,onValueChange:r=>se(r),children:[n.jsx(X,{className:"min-w-[180px]",children:n.jsx(te,{})}),n.jsx(ee,{children:n.jsx(Is,{children:Xl.map(r=>n.jsx(C,{value:r.value,children:r.value==="custom"?s("general.defaultEditor.custom"):r.label},r.value))})})]})}),le==="custom"?n.jsx("div",{className:"border-t border-border",children:n.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[n.jsxs("div",{className:"min-w-0 max-w-xl",children:[n.jsx("div",{className:"text-sm font-medium text-foreground",children:s("general.commandTemplate.title")}),n.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:s("general.commandTemplate.description")})]}),n.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[n.jsx(Ue,{type:"text",value:bs,onChange:r=>ln(r.target.value),onBlur:Zn,onKeyDown:r=>Vn(r,Zn),className:"font-mono"}),n.jsxs("div",{className:"text-xs text-muted-foreground",children:[s("general.commandTemplate.preview")," ",n.jsx("span",{className:"font-mono",children:Rr})]})]})]})}):null,n.jsx(P,{title:s("general.terminalScrollback.title"),description:s("general.terminalScrollback.description"),children:n.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[n.jsx(Ue,{type:"number",min:ra,max:aa,step:100,value:nn,onChange:r=>xs(r.target.value),onBlur:Dn,onKeyDown:r=>ts(r,Dn),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),n.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[ra,"-",aa," ",s("general.terminalScrollback.lines"),B===mi?` ${s("common.defaultSuffix")}`:""]})]})}),n.jsx(P,{title:s("general.terminalMinColumnWidth.title"),description:s("general.terminalMinColumnWidth.description"),children:n.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[n.jsx(Ue,{type:"number",min:la,max:ia,step:10,value:rn,onChange:r=>vs(r.target.value),onBlur:Fn,onKeyDown:r=>ts(r,Fn),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),n.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[la,"-",ia," px",q===fi?` ${s("common.defaultSuffix")}`:""]})]})}),n.jsx(P,{title:s("general.chatChunkSize.title"),description:n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{children:s("general.chatChunkSize.description")}),n.jsx("div",{children:s("general.chatChunkSize.details",{path:nr,min:rs/1024,max:as/1024,default:hi/1024})}),S!=null&&S.warning?n.jsx("div",{className:"text-amber-700 dark:text-amber-300",children:S.warning}):null,fn?n.jsx("div",{className:"text-red-500",children:fn}):null]}),children:n.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[n.jsx(Ue,{type:"number",min:rs/1024,max:as/1024,step:16,value:an,onChange:r=>Mt(r.target.value),onBlur:()=>{br()},onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),r.currentTarget.blur())},disabled:hn,className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),n.jsx("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:s(hn?"actions.saving":"general.chatChunkSize.unit")})]})})]})}):N==="changelog"?n.jsx(_l,{entries:jl}):N==="quick-chats"?n.jsx(Tl,{}):N==="slash-commands"?n.jsx(Ml,{}):N==="usage"?n.jsx(Gl,{access:ne}):N==="providers"?n.jsxs("div",{className:"border-b border-border",children:[n.jsx(P,{title:s("providers.defaultProvider.title"),badge:Or?n.jsx(gt,{level:"account",label:Rt("account",I)}):null,description:s("providers.defaultProvider.description"),bordered:!1,children:n.jsxs(J,{value:lr,onValueChange:r=>he(r),children:[n.jsx(X,{className:"min-w-[180px]",children:n.jsx(te,{})}),n.jsx(ee,{children:n.jsxs(Is,{children:[n.jsx(C,{value:"last_used",children:s("providers.defaultProvider.lastUsed")}),Er.map(r=>n.jsx(C,{value:r.id,disabled:r.id==="openrouter"&&!ne.features.openrouter.enabled,children:r.label},r.id))]})})]})}),gn?n.jsx("div",{className:"border-t border-border px-0 py-3 text-sm text-destructive",children:gn}):null,n.jsx(P,{title:s("providers.sectionTitle",{provider:s("providers.names.claude")}),description:s("providers.savedDefaultsDescription",{provider:s("providers.names.claude"),status:Tt(ge,p,"claude",{active:s("providers.status.activeSentence"),inactive:s("providers.status.inactiveSentence")})}),alignStart:!0,children:n.jsxs("div",{className:Ae("max-w-[420px]",!me("claude").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(J,{value:((p==null?void 0:p.settings.claude)??re.claude).active?"active":"inactive",onValueChange:r=>{wt({...(p==null?void 0:p.settings)??re,claude:{...(p==null?void 0:p.settings.claude)??re.claude,active:r==="active"}})},children:[n.jsx(X,{className:"min-w-[140px]",disabled:!me("claude").systemActive,children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"active",children:s("providers.status.active")}),n.jsx(C,{value:"inactive",children:s("providers.status.inactive")})]})]})}),n.jsx(Ct,{availableProviders:ge,selectedProvider:"claude",disabled:!me("claude").systemActive,showProviderPicker:!1,providerLocked:!0,model:E.claude.model,modelOptions:E.claude.modelOptions,onModelChange:(r,x)=>{A("claude",x)},onClaudeReasoningEffortChange:r=>{xe("claude",{reasoningEffort:r})},onClaudeContextWindowChange:r=>{xe("claude",{contextWindow:r})},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:E.claude.planMode,onPlanModeChange:r=>ce("claude",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(P,{title:s("providers.sectionTitle",{provider:s("providers.names.codex")}),description:s("providers.savedDefaultsDescription",{provider:s("providers.names.codex"),status:Tt(ge,p,"codex",{active:s("providers.status.activeSentence"),inactive:s("providers.status.inactiveSentence")})}),alignStart:!0,children:n.jsxs("div",{className:Ae("max-w-[420px]",!me("codex").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(J,{value:((p==null?void 0:p.settings.codex)??re.codex).active?"active":"inactive",onValueChange:r=>{wt({...(p==null?void 0:p.settings)??re,codex:{...(p==null?void 0:p.settings.codex)??re.codex,active:r==="active"}})},children:[n.jsx(X,{className:"min-w-[140px]",disabled:!me("codex").systemActive,children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"active",children:s("providers.status.active")}),n.jsx(C,{value:"inactive",children:s("providers.status.inactive")})]})]})}),n.jsx(Ct,{availableProviders:ge,selectedProvider:"codex",disabled:!me("codex").systemActive,showProviderPicker:!1,providerLocked:!0,model:E.codex.model,modelOptions:E.codex.modelOptions,onModelChange:(r,x)=>{A("codex",x),xe("codex",{reasoningEffort:pi(x,E.codex.modelOptions.reasoningEffort,ge)})},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:r=>{xe("codex",{reasoningEffort:r})},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:r=>{xe("codex",{fastMode:r})},planMode:E.codex.planMode,onPlanModeChange:r=>ce("codex",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(P,{title:s("providers.sectionTitle",{provider:s("providers.names.gemini")}),description:s("providers.savedDefaultsDescription",{provider:s("providers.names.gemini"),status:Tt(ge,p,"gemini",{active:s("providers.status.activeSentence"),inactive:s("providers.status.inactiveSentence")})}),alignStart:!0,children:n.jsxs("div",{className:Ae("max-w-[420px]",!me("gemini").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(J,{value:((p==null?void 0:p.settings.gemini)??re.gemini).active?"active":"inactive",onValueChange:r=>{wt({...(p==null?void 0:p.settings)??re,gemini:{...(p==null?void 0:p.settings.gemini)??re.gemini,active:r==="active"}})},children:[n.jsx(X,{className:"min-w-[140px]",disabled:!me("gemini").systemActive,children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"active",children:s("providers.status.active")}),n.jsx(C,{value:"inactive",children:s("providers.status.inactive")})]})]})}),n.jsx(Ct,{availableProviders:ge,selectedProvider:"gemini",disabled:!me("gemini").systemActive,showProviderPicker:!1,providerLocked:!0,model:E.gemini.model,modelOptions:E.gemini.modelOptions,onModelChange:(r,x)=>{A("gemini",x)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:r=>{xe("gemini",{thinkingMode:r})},onCodexFastModeChange:()=>{},planMode:E.gemini.planMode,onPlanModeChange:r=>ce("gemini",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(P,{title:s("providers.sectionTitle",{provider:s("providers.names.cursor")}),description:s("providers.savedDefaultsDescription",{provider:s("providers.names.cursor"),status:Tt(ge,p,"cursor",{active:s("providers.status.activeSentence"),inactive:s("providers.status.inactiveSentence")})}),alignStart:!0,children:n.jsxs("div",{className:Ae("max-w-[420px]",!me("cursor").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(J,{value:((p==null?void 0:p.settings.cursor)??re.cursor).active?"active":"inactive",onValueChange:r=>{wt({...(p==null?void 0:p.settings)??re,cursor:{...(p==null?void 0:p.settings.cursor)??re.cursor,active:r==="active"}})},children:[n.jsx(X,{className:"min-w-[140px]",disabled:!me("cursor").systemActive,children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"active",children:s("providers.status.active")}),n.jsx(C,{value:"inactive",children:s("providers.status.inactive")})]})]})}),n.jsx(Ct,{availableProviders:ge,selectedProvider:"cursor",disabled:!me("cursor").systemActive,showProviderPicker:!1,providerLocked:!0,model:E.cursor.model,modelOptions:E.cursor.modelOptions,onModelChange:(r,x)=>{A("cursor",x)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:E.cursor.planMode,onPlanModeChange:r=>ce("cursor",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(P,{title:s("providers.sectionTitle",{provider:s("providers.names.qwen")}),description:s("providers.savedDefaultsDescription",{provider:s("providers.names.qwen"),status:Tt(ge,p,"qwen",{active:s("providers.status.activeSentence"),inactive:s("providers.status.inactiveSentence")})}),alignStart:!0,children:n.jsxs("div",{className:Ae("max-w-[420px]",!me("qwen").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(J,{value:((p==null?void 0:p.settings.qwen)??re.qwen).active?"active":"inactive",onValueChange:r=>{wt({...(p==null?void 0:p.settings)??re,qwen:{...(p==null?void 0:p.settings.qwen)??re.qwen,active:r==="active"}})},children:[n.jsx(X,{className:"min-w-[140px]",disabled:!me("qwen").systemActive,children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"active",children:s("providers.status.active")}),n.jsx(C,{value:"inactive",children:s("providers.status.inactive")})]})]})}),n.jsx(Ct,{availableProviders:ge,selectedProvider:"qwen",disabled:!me("qwen").systemActive,showProviderPicker:!1,providerLocked:!0,model:E.qwen.model,modelOptions:E.qwen.modelOptions,onModelChange:(r,x)=>{A("qwen",x)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:E.qwen.planMode,onPlanModeChange:r=>ce("qwen",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(P,{title:s("providers.sectionTitle",{provider:s("providers.names.openrouter")}),badge:ne.features.openrouter.enabled?null:n.jsx(gt,{level:"account",label:Rt("account",I)}),description:s("providers.savedDefaultsOpenRouterDescription",{status:Tt(ge,p,"openrouter",{active:s("providers.status.activeSentence"),inactive:s("providers.status.inactiveSentence")})}),alignStart:!0,children:n.jsxs("div",{className:Ae("max-w-[420px]",!me("openrouter").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(J,{value:((p==null?void 0:p.settings.openrouter)??re.openrouter).active?"active":"inactive",onValueChange:r=>{wt({...(p==null?void 0:p.settings)??re,openrouter:{...(p==null?void 0:p.settings.openrouter)??re.openrouter,active:r==="active"}})},children:[n.jsx(X,{className:"min-w-[140px]",disabled:!me("openrouter").systemActive||!ne.features.openrouter.enabled,children:n.jsx(te,{})}),n.jsxs(ee,{children:[n.jsx(C,{value:"active",children:s("providers.status.active")}),n.jsx(C,{value:"inactive",children:s("providers.status.inactive")})]})]})}),n.jsx(Ct,{availableProviders:ge,selectedProvider:"openrouter",disabled:!me("openrouter").systemActive||!ne.features.openrouter.enabled,showProviderPicker:!1,providerLocked:!0,model:E.openrouter.model,modelOptions:E.openrouter.modelOptions,onModelChange:(r,x)=>{A("openrouter",x)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:E.openrouter.planMode,onPlanModeChange:r=>ce("openrouter",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})})]}):N==="keybindings"?n.jsxs("div",{className:"border-b border-border",children:[un?n.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:un}):null,ot.warning?n.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:ot.warning}):null,fs.map((r,x)=>{const D=Fs(da[r]),fe=dt[r]??"",je=fe!==D;return n.jsx(P,{title:Aa(s,r),description:n.jsxs(n.Fragment,{children:[n.jsx("span",{children:s("keybindings.items.shared.description")}),je?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:" "}),n.jsx("button",{type:"button",onClick:()=>{_r(r)},className:"inline rounded text-foreground hover:text-foreground/80",children:s("keybindings.items.shared.restore",{value:D})})]}):null]}),bordered:x!==0,children:n.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:n.jsx(Ue,{type:"text",value:fe,"aria-label":Aa(s,r),onChange:de=>{const ht=de.target.value;Lt(Ur=>({...Ur,[r]:ht}))},className:"font-mono"})})},r)})]}):null]}),u.commandError?n.jsxs("div",{className:"mx-auto mt-4 flex max-w-4xl items-start gap-3 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[n.jsx(Si,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),n.jsx("span",{children:u.commandError})]}):null]})]})]}),Wn?n.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:n.jsx("div",{className:"px-6 py-[14.25px]",children:n.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-xs text-muted-foreground lg:grid-cols-4 lg:gap-3",children:[n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[n.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:s("footer.machine")}),n.jsx("div",{className:"truncate text-foreground/80",children:ke?s("common.hidden"):G})]})}),n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[n.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:s("footer.connection")}),n.jsx("div",{className:"truncate text-foreground/80",children:u.connectionStatus})]})}),n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[n.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:s("footer.projects")}),n.jsx("div",{className:"truncate text-foreground/80",children:Q})]})}),n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[n.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:s("footer.version")}),n.jsx("div",{className:"truncate text-foreground/80",children:K})]})})]})})}):null]})}function fo(t){return{submitChatMessage:Ye(t.submitChatMessage??""),toggleQuickPrompts:Ye(t.toggleQuickPrompts??""),toggleProjectsSidebar:Ye(t.toggleProjectsSidebar??""),toggleEmbeddedTerminal:Ye(t.toggleEmbeddedTerminal??""),toggleRightSidebar:Ye(t.toggleRightSidebar??""),openInFinder:Ye(t.openInFinder??""),openInEditor:Ye(t.openInEditor??""),addSplitTerminal:Ye(t.addSplitTerminal??"")}}export{vo as SettingsPage,fo as buildKeybindingPayload,is as createKeybindingDrafts,Bt as formatChunkSizeKilobytes,Pa as getBackgroundSelectionAdjustments,so as getGeneralHeaderAction,xo as getKeybindingsSubtitle,no as getSettingsCloseTarget,Jl as getSidebarItems,ms as keybindingDraftsEqual,eo as mergeSavedKeybindingDrafts,to as reconcileLoadedKeybindingDrafts,Oa as remoteRelayErrorLabel,io as remoteRelayStatusLabel,Ia as resolveSettingsSectionId};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-BpFB-KP0.js";/**
1
+ import{c}from"./index-B_605KJ5.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.