kaizenai 0.9.0 → 0.10.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.
- package/dist/client/assets/{FeatureOverviewPage-Kbb6kM_H.js → FeatureOverviewPage-Cfbx0OpA.js} +1 -1
- package/dist/client/assets/FeatureOverviewPage-Cfbx0OpA.js.br +0 -0
- package/dist/client/assets/FeatureOverviewPage-Cfbx0OpA.js.gz +0 -0
- package/dist/client/assets/{LocalProjectsPage-C56Q0ZrY.js → LocalProjectsPage-BZU2Y-UV.js} +1 -1
- package/dist/client/assets/LocalProjectsPage-BZU2Y-UV.js.br +0 -0
- package/dist/client/assets/LocalProjectsPage-BZU2Y-UV.js.gz +0 -0
- package/dist/client/assets/SettingsPage-CTLgxsTe.js +56 -0
- package/dist/client/assets/SettingsPage-CTLgxsTe.js.br +0 -0
- package/dist/client/assets/SettingsPage-CTLgxsTe.js.gz +0 -0
- package/dist/client/assets/{eye-CgKgBPK8.js → eye-CuKkbaPZ.js} +1 -1
- package/dist/client/assets/eye-CuKkbaPZ.js.br +0 -0
- package/dist/client/assets/eye-CuKkbaPZ.js.gz +0 -0
- package/dist/client/assets/{index-BpFB-KP0.js → index-CmRBcifs.js} +165 -165
- package/dist/client/assets/index-CmRBcifs.js.br +0 -0
- package/dist/client/assets/index-CmRBcifs.js.gz +0 -0
- package/dist/client/assets/index-WWAgyWQF.css +32 -0
- package/dist/client/assets/index-WWAgyWQF.css.br +0 -0
- package/dist/client/assets/index-WWAgyWQF.css.gz +0 -0
- package/dist/client/index.html +2 -2
- package/dist/server/build-target.json +1 -1
- package/dist/server/cli-supervisor.js +1 -1
- package/dist/server/cli.js +1539 -98
- package/package.json +1 -1
- package/dist/client/assets/FeatureOverviewPage-Kbb6kM_H.js.br +0 -0
- package/dist/client/assets/FeatureOverviewPage-Kbb6kM_H.js.gz +0 -0
- package/dist/client/assets/LocalProjectsPage-C56Q0ZrY.js.br +0 -0
- package/dist/client/assets/LocalProjectsPage-C56Q0ZrY.js.gz +0 -0
- package/dist/client/assets/SettingsPage-B1f0yrfy.js +0 -51
- package/dist/client/assets/SettingsPage-B1f0yrfy.js.br +0 -0
- package/dist/client/assets/SettingsPage-B1f0yrfy.js.gz +0 -0
- package/dist/client/assets/eye-CgKgBPK8.js.br +0 -0
- package/dist/client/assets/eye-CgKgBPK8.js.gz +0 -0
- package/dist/client/assets/index-BpFB-KP0.js.br +0 -0
- package/dist/client/assets/index-BpFB-KP0.js.gz +0 -0
- package/dist/client/assets/index-C5XCCHyf.css +0 -32
- package/dist/client/assets/index-C5XCCHyf.css.br +0 -0
- package/dist/client/assets/index-C5XCCHyf.css.gz +0 -0
package/dist/client/assets/{FeatureOverviewPage-Kbb6kM_H.js → FeatureOverviewPage-Cfbx0OpA.js}
RENAMED
|
@@ -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-
|
|
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-CmRBcifs.js";import{E as Me}from"./eye-CuKkbaPZ.js";/**
|
|
2
2
|
* @license lucide-react v0.562.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as U,a as $,i as O,k as t,r as b,D as fe,s as je,t as pe,v as ge,w as be,x as Ne,I as se,B as A,S as ve,L as T,y as we,z as de,F as Pe,A as ye,G as S,H as D,J as Ce,K as ke,m as V,g as F,N as Se,O as Le,h as ne,Q as Ee,U as re,V as $e,W as Ie,X as He,Y as Oe,Z as Ae,_ as Re,b as Te,e as Fe,$ as _e,a0 as De}from"./index-
|
|
1
|
+
import{c as U,a as $,i as O,k as t,r as b,D as fe,s as je,t as pe,v as ge,w as be,x as Ne,I as se,B as A,S as ve,L as T,y as we,z as de,F as Pe,A as ye,G as S,H as D,J as Ce,K as ke,m as V,g as F,N as Se,O as Le,h as ne,Q as Ee,U as re,V as $e,W as Ie,X as He,Y as Oe,Z as Ae,_ as Re,b as Te,e as Fe,$ as _e,a0 as De}from"./index-CmRBcifs.js";/**
|
|
2
2
|
* @license lucide-react v0.562.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import{c as Ne,a as Ce,i as be,a1 as _a,k as s,d as Os,a2 as wa,a3 as Ct,a4 as ka,a5 as Bn,I as Re,a6 as q,a7 as W,a8 as Y,a9 as H,aa as Er,B as se,Y as Ar,ab as j,ac as st,ad as Sr,K as Ir,ae as tt,af as Pr,ag as Ms,T as Vn,u as ja,b as Na,r as y,g as we,h as ke,m as je,ah as Or,ai as Ca,aj as Ra,L as ge,ak as ks,al as Mr,am as js,an as Ns,ao as Dr,ap as Lr,e as Ur,$ as $r,a0 as zr,aq as Br,N as Vr,ar as De,as as Le,at as Ue,O as he,au as $e,av as Zn,aw as Zr,ax as Fr,ay as ps,az as Kr,aA as qr,aB as te,G as Fn,aC as Ta,aD as Kn,E as Wr,X as Hr,V as Gr,W as Qr,aE as xs,aF as vs,aG as bs,aH as Yr,aI as ys,aJ as qn,aK as Wn,aL as Jr,aM as Hn,aN as Gn,aO as Xr,aP as Zt,aQ as Ft,aR as ei,aS as ft,aT as ti,aU as Cs,aV as ze,aW as si,aX as Qn,aY as Yn,aZ as ni,a_ as ai,a$ as ri,b0 as Jn}from"./index-CmRBcifs.js";import{E as Xn}from"./eye-CuKkbaPZ.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 ii=[["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"}]],li=Ne("bell",ii);/**
|
|
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 oi=[["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"}]],Ea=Ne("chart-column",oi);/**
|
|
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 di=[["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"}]],Aa=Ne("cloud-download",di);/**
|
|
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 ci=[["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"}]],ui=Ne("command",ci);/**
|
|
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 mi=[["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"}]],ea=Ne("eye-off",mi);/**
|
|
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 fi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],hi=Ne("info",fi);/**
|
|
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 gi=[["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"}]],pi=Ne("message-square-quote",gi);/**
|
|
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 xi=[["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"}]],vi=Ne("palette",xi);/**
|
|
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 bi=[["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"}]],Sa=Ne("rotate-ccw",bi);/**
|
|
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 yi=[["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"}]],_i=Ne("settings-2",yi);/**
|
|
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 wi=[["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"}]],ki=Ne("shield",wi),ji="https://kaizenai.codes";function Ni(t){return ji}function Ci(t){return Ni()}function Ri(t,e){return`${((t==null?void 0:t.trim())||Ci()).replace(/\/+$/,"")}/dashboard`}function Be(t){const e=Ce.c(18);let n,a,i,l,d,o;e[0]!==t?({children:n,className:a,icon:i,type:d,variant:o,...l}=t,e[0]=t,e[1]=n,e[2]=a,e[3]=i,e[4]=l,e[5]=d,e[6]=o):(n=e[1],a=e[2],i=e[3],l=e[4],d=e[5],o=e[6]);const c=d===void 0?"button":d,u=o===void 0?"outline":o;let x;e[7]!==a||e[8]!==u?(x=be(_a({variant:u,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",a),e[7]=a,e[8]=u,e[9]=x):x=e[9];let _;e[10]!==n?(_=n?s.jsx("span",{children:n}):null,e[10]=n,e[11]=_):_=e[11];let R;return e[12]!==i||e[13]!==l||e[14]!==x||e[15]!==_||e[16]!==c?(R=s.jsxs("button",{type:c,className:x,...l,children:[i,_]}),e[12]=i,e[13]=l,e[14]=x,e[15]=_,e[16]=c,e[17]=R):R=e[17],R}var $;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const d of i)l[d]=d;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),d={};for(const o of l)d[o]=i[o];return t.objectValues(d)},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 d in i)Object.prototype.hasOwnProperty.call(i,d)&&l.push(d);return l},t.find=(i,l)=>{for(const d of i)if(l(d))return d},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function a(i,l=" | "){return i.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=a,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})($||($={}));var ta;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ta||(ta={}));const v=$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ze=t=>{switch(typeof t){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(t)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(t)?v.array:t===null?v.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?v.promise:typeof Map<"u"&&t instanceof Map?v.map:typeof Set<"u"&&t instanceof Set?v.set:typeof Date<"u"&&t instanceof Date?v.date:v.object;default:return v.unknown}},h=$.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 Ie extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(l){return l.message},a={_errors:[]},i=l=>{for(const d of l.issues)if(d.code==="invalid_union")d.unionErrors.map(i);else if(d.code==="invalid_return_type")i(d.returnTypeError);else if(d.code==="invalid_arguments")i(d.argumentsError);else if(d.path.length===0)a._errors.push(n(d));else{let o=a,c=0;for(;c<d.path.length;){const u=d.path[c];c===d.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(d))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return i(this),a}static assert(e){if(!(e instanceof Ie))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},a=[];for(const i of this.issues)if(i.path.length>0){const l=i.path[0];n[l]=n[l]||[],n[l].push(e(i))}else a.push(e(i));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}Ie.create=t=>new Ie(t);const Rs=(t,e)=>{let n;switch(t.code){case h.invalid_type:t.received===v.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,$.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:n=`Unrecognized key(s) in object: ${$.joinValues(t.keys,", ")}`;break;case h.invalid_union:n="Invalid input";break;case h.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${$.joinValues(t.options)}`;break;case h.invalid_enum_value:n=`Invalid enum value. Expected ${$.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:n="Invalid function arguments";break;case h.invalid_return_type:n="Invalid function return type";break;case h.invalid_date:n="Invalid date";break;case h.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:$.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case h.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case h.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case h.custom:n="Invalid input";break;case h.invalid_intersection_types:n="Intersection results could not be merged";break;case h.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:n="Number must be finite";break;default:n=e.defaultError,$.assertNever(t)}return{message:n}};let Ti=Rs;function Ei(){return Ti}const Ai=t=>{const{data:e,path:n,errorMaps:a,issueData:i}=t,l=[...n,...i.path||[]],d={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let o="";const c=a.filter(u=>!!u).slice().reverse();for(const u of c)o=u(d,{data:e,defaultError:o}).message;return{...i,path:l,message:o}};function p(t,e){const n=Ei(),a=Ai({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Rs?void 0:Rs].filter(i=>!!i)});t.common.issues.push(a)}class pe{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const a=[];for(const i of n){if(i.status==="aborted")return N;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,n){const a=[];for(const i of n){const l=await i.key,d=await i.value;a.push({key:l,value:d})}return pe.mergeObjectSync(e,a)}static mergeObjectSync(e,n){const a={};for(const i of n){const{key:l,value:d}=i;if(l.status==="aborted"||d.status==="aborted")return N;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||i.alwaysSet)&&(a[l.value]=d.value)}return{status:e.value,value:a}}}const N=Object.freeze({status:"aborted"}),Tt=t=>({status:"dirty",value:t}),ye=t=>({status:"valid",value:t}),sa=t=>t.status==="aborted",na=t=>t.status==="dirty",pt=t=>t.status==="valid",qt=t=>typeof Promise<"u"&&t instanceof Promise;var b;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));class qe{constructor(e,n,a,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=a,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 aa=(t,e)=>{if(pt(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 n=new Ie(t.common.issues);return this._error=n,this._error}}};function E(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:a,description:i}=t;if(e&&(n||a))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:(d,o)=>{const{message:c}=t;return d.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??a??o.defaultError}:d.code!=="invalid_type"?{message:o.defaultError}:{message:c??n??o.defaultError}},description:i}}class U{get description(){return this._def.description}_getType(e){return Ze(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ze(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pe,ctx:{common:e.parent.common,data:e.data,parsedType:Ze(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(qt(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const a=this.safeParse(e,n);if(a.success)return a.data;throw a.error}safeParse(e,n){const a={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)},i=this._parseSync({data:e,path:a.path,parent:a});return aa(a,i)}"~validate"(e){var a,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)};if(!this["~standard"].async)try{const l=this._parseSync({data:e,path:[],parent:n});return pt(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(i=(a=l==null?void 0:l.message)==null?void 0:a.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(l=>pt(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(e,n){const a=await this.safeParseAsync(e,n);if(a.success)return a.data;throw a.error}async safeParseAsync(e,n){const a={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)},i=this._parse({data:e,path:a.path,parent:a}),l=await(qt(i)?i:Promise.resolve(i));return aa(a,l)}refine(e,n){const a=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const d=e(i),o=()=>l.addIssue({code:h.custom,...a(i)});return typeof Promise<"u"&&d instanceof Promise?d.then(c=>c?!0:(o(),!1)):d?!0:(o(),!1)})}refinement(e,n){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof n=="function"?n(a,i):n),!1))}_refinement(e){return new vt({schema:this,typeName:C.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:n=>this["~validate"](n)}}optional(){return Ke.create(this,this._def)}nullable(){return bt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Te.create(this)}promise(){return Qt.create(this,this._def)}or(e){return Ht.create([this,e],this._def)}and(e){return Gt.create(this,e,this._def)}transform(e){return new vt({...E(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new As({...E(this._def),innerType:this,defaultValue:n,typeName:C.ZodDefault})}brand(){return new Xi({typeName:C.ZodBranded,type:this,...E(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ss({...E(this._def),innerType:this,catchValue:n,typeName:C.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ds.create(this,e)}readonly(){return Is.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Si=/^c[^\s-]{8,}$/i,Ii=/^[0-9a-z]+$/,Pi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Oi=/^[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,Mi=/^[a-z0-9_-]{21}$/i,Di=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Li=/^[-+]?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)?)??$/,Ui=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$i="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _s;const zi=/^(?:(?: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])$/,Bi=/^(?:(?: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])$/,Vi=/^(([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]))$/,Zi=/^(([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])$/,Fi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ki=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ia="((\\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])))",qi=new RegExp(`^${Ia}$`);function Pa(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Wi(t){return new RegExp(`^${Pa(t)}$`)}function Hi(t){let e=`${Ia}T${Pa(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Gi(t,e){return!!((e==="v4"||!e)&&zi.test(t)||(e==="v6"||!e)&&Vi.test(t))}function Qi(t,e){if(!Di.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(a));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 Yi(t,e){return!!((e==="v4"||!e)&&Bi.test(t)||(e==="v6"||!e)&&Zi.test(t))}class Fe extends U{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){const l=this._getOrReturnCtx(e);return p(l,{code:h.invalid_type,expected:v.string,received:l.parsedType}),N}const a=new pe;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:h.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),a.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:h.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),a.dirty());else if(l.kind==="length"){const d=e.data.length>l.value,o=e.data.length<l.value;(d||o)&&(i=this._getOrReturnCtx(e,i),d?p(i,{code:h.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):o&&p(i,{code:h.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),a.dirty())}else if(l.kind==="email")Ui.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"email",code:h.invalid_string,message:l.message}),a.dirty());else if(l.kind==="emoji")_s||(_s=new RegExp($i,"u")),_s.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"emoji",code:h.invalid_string,message:l.message}),a.dirty());else if(l.kind==="uuid")Oi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"uuid",code:h.invalid_string,message:l.message}),a.dirty());else if(l.kind==="nanoid")Mi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"nanoid",code:h.invalid_string,message:l.message}),a.dirty());else if(l.kind==="cuid")Si.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid",code:h.invalid_string,message:l.message}),a.dirty());else if(l.kind==="cuid2")Ii.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid2",code:h.invalid_string,message:l.message}),a.dirty());else if(l.kind==="ulid")Pi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ulid",code:h.invalid_string,message:l.message}),a.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),p(i,{validation:"url",code:h.invalid_string,message:l.message}),a.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"regex",code:h.invalid_string,message:l.message}),a.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),p(i,{code:h.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),a.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),p(i,{code:h.invalid_string,validation:{startsWith:l.value},message:l.message}),a.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:h.invalid_string,validation:{endsWith:l.value},message:l.message}),a.dirty()):l.kind==="datetime"?Hi(l).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:h.invalid_string,validation:"datetime",message:l.message}),a.dirty()):l.kind==="date"?qi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:h.invalid_string,validation:"date",message:l.message}),a.dirty()):l.kind==="time"?Wi(l).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:h.invalid_string,validation:"time",message:l.message}),a.dirty()):l.kind==="duration"?Li.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"duration",code:h.invalid_string,message:l.message}),a.dirty()):l.kind==="ip"?Gi(e.data,l.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ip",code:h.invalid_string,message:l.message}),a.dirty()):l.kind==="jwt"?Qi(e.data,l.alg)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"jwt",code:h.invalid_string,message:l.message}),a.dirty()):l.kind==="cidr"?Yi(e.data,l.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cidr",code:h.invalid_string,message:l.message}),a.dirty()):l.kind==="base64"?Fi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64",code:h.invalid_string,message:l.message}),a.dirty()):l.kind==="base64url"?Ki.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64url",code:h.invalid_string,message:l.message}),a.dirty()):$.assertNever(l);return{status:a.value,value:e.data}}_regex(e,n,a){return this.refinement(i=>e.test(i),{validation:n,code:h.invalid_string,...b.errToObj(a)})}_addCheck(e){return new Fe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.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,...b.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,...b.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...b.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...b.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...b.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...b.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...b.errToObj(n)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new Fe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fe({...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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Fe.create=t=>new Fe({checks:[],typeName:C.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...E(t)});function Ji(t,e){const n=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=n>a?n:a,l=Number.parseInt(t.toFixed(i).replace(".","")),d=Number.parseInt(e.toFixed(i).replace(".",""));return l%d/10**i}class At extends U{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)!==v.number){const l=this._getOrReturnCtx(e);return p(l,{code:h.invalid_type,expected:v.number,received:l.parsedType}),N}let a;const i=new pe;for(const l of this._def.checks)l.kind==="int"?$.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{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)&&(a=this._getOrReturnCtx(e,a),p(a,{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)&&(a=this._getOrReturnCtx(e,a),p(a,{code:h.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?Ji(e.data,l.value)!==0&&(a=this._getOrReturnCtx(e,a),p(a,{code:h.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:h.not_finite,message:l.message}),i.dirty()):$.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,b.toString(n))}gt(e,n){return this.setLimit("min",e,!1,b.toString(n))}lte(e,n){return this.setLimit("max",e,!0,b.toString(n))}lt(e,n){return this.setLimit("max",e,!1,b.toString(n))}setLimit(e,n,a,i){return new At({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:b.toString(i)}]})}_addCheck(e){return new At({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&$.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(n)&&Number.isFinite(e)}}At.create=t=>new At({checks:[],typeName:C.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...E(t)});class St extends U{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)!==v.bigint)return this._getInvalidInput(e);let a;const i=new pe;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(a=this._getOrReturnCtx(e,a),p(a,{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)&&(a=this._getOrReturnCtx(e,a),p(a,{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)&&(a=this._getOrReturnCtx(e,a),p(a,{code:h.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):$.assertNever(l);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return p(n,{code:h.invalid_type,expected:v.bigint,received:n.parsedType}),N}gte(e,n){return this.setLimit("min",e,!0,b.toString(n))}gt(e,n){return this.setLimit("min",e,!1,b.toString(n))}lte(e,n){return this.setLimit("max",e,!0,b.toString(n))}lt(e,n){return this.setLimit("max",e,!1,b.toString(n))}setLimit(e,n,a,i){return new St({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:b.toString(i)}]})}_addCheck(e){return new St({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}St.create=t=>new St({checks:[],typeName:C.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...E(t)});class Ts extends U{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){const a=this._getOrReturnCtx(e);return p(a,{code:h.invalid_type,expected:v.boolean,received:a.parsedType}),N}return ye(e.data)}}Ts.create=t=>new Ts({typeName:C.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...E(t)});class Wt extends U{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){const l=this._getOrReturnCtx(e);return p(l,{code:h.invalid_type,expected:v.date,received:l.parsedType}),N}if(Number.isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return p(l,{code:h.invalid_date}),N}const a=new pe;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:h.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),a.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:h.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),a.dirty()):$.assertNever(l);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Wt.create=t=>new Wt({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:C.ZodDate,...E(t)});class ra extends U{_parse(e){if(this._getType(e)!==v.symbol){const a=this._getOrReturnCtx(e);return p(a,{code:h.invalid_type,expected:v.symbol,received:a.parsedType}),N}return ye(e.data)}}ra.create=t=>new ra({typeName:C.ZodSymbol,...E(t)});class ia extends U{_parse(e){if(this._getType(e)!==v.undefined){const a=this._getOrReturnCtx(e);return p(a,{code:h.invalid_type,expected:v.undefined,received:a.parsedType}),N}return ye(e.data)}}ia.create=t=>new ia({typeName:C.ZodUndefined,...E(t)});class la extends U{_parse(e){if(this._getType(e)!==v.null){const a=this._getOrReturnCtx(e);return p(a,{code:h.invalid_type,expected:v.null,received:a.parsedType}),N}return ye(e.data)}}la.create=t=>new la({typeName:C.ZodNull,...E(t)});class oa extends U{constructor(){super(...arguments),this._any=!0}_parse(e){return ye(e.data)}}oa.create=t=>new oa({typeName:C.ZodAny,...E(t)});class da extends U{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ye(e.data)}}da.create=t=>new da({typeName:C.ZodUnknown,...E(t)});class We extends U{_parse(e){const n=this._getOrReturnCtx(e);return p(n,{code:h.invalid_type,expected:v.never,received:n.parsedType}),N}}We.create=t=>new We({typeName:C.ZodNever,...E(t)});class ca extends U{_parse(e){if(this._getType(e)!==v.undefined){const a=this._getOrReturnCtx(e);return p(a,{code:h.invalid_type,expected:v.void,received:a.parsedType}),N}return ye(e.data)}}ca.create=t=>new ca({typeName:C.ZodVoid,...E(t)});class Te extends U{_parse(e){const{ctx:n,status:a}=this._processInputParams(e),i=this._def;if(n.parsedType!==v.array)return p(n,{code:h.invalid_type,expected:v.array,received:n.parsedType}),N;if(i.exactLength!==null){const d=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(d||o)&&(p(n,{code:d?h.too_big:h.too_small,minimum:o?i.exactLength.value:void 0,maximum:d?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(p(n,{code:h.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(p(n,{code:h.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((d,o)=>i.type._parseAsync(new qe(n,d,n.path,o)))).then(d=>pe.mergeArray(a,d));const l=[...n.data].map((d,o)=>i.type._parseSync(new qe(n,d,n.path,o)));return pe.mergeArray(a,l)}get element(){return this._def.type}min(e,n){return new Te({...this._def,minLength:{value:e,message:b.toString(n)}})}max(e,n){return new Te({...this._def,maxLength:{value:e,message:b.toString(n)}})}length(e,n){return new Te({...this._def,exactLength:{value:e,message:b.toString(n)}})}nonempty(e){return this.min(1,e)}}Te.create=(t,e)=>new Te({type:t,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...E(e)});function gt(t){if(t instanceof ae){const e={};for(const n in t.shape){const a=t.shape[n];e[n]=Ke.create(gt(a))}return new ae({...t._def,shape:()=>e})}else return t instanceof Te?new Te({...t._def,type:gt(t.element)}):t instanceof Ke?Ke.create(gt(t.unwrap())):t instanceof bt?bt.create(gt(t.unwrap())):t instanceof at?at.create(t.items.map(e=>gt(e))):t}class ae extends U{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(),n=$.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==v.object){const u=this._getOrReturnCtx(e);return p(u,{code:h.invalid_type,expected:v.object,received:u.parsedType}),N}const{status:a,ctx:i}=this._processInputParams(e),{shape:l,keys:d}=this._getCached(),o=[];if(!(this._def.catchall instanceof We&&this._def.unknownKeys==="strip"))for(const u in i.data)d.includes(u)||o.push(u);const c=[];for(const u of d){const x=l[u],_=i.data[u];c.push({key:{status:"valid",value:u},value:x._parse(new qe(i,_,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof We){const u=this._def.unknownKeys;if(u==="passthrough")for(const x of o)c.push({key:{status:"valid",value:x},value:{status:"valid",value:i.data[x]}});else if(u==="strict")o.length>0&&(p(i,{code:h.unrecognized_keys,keys:o}),a.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const x of o){const _=i.data[x];c.push({key:{status:"valid",value:x},value:u._parse(new qe(i,_,i.path,x)),alwaysSet:x in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const x of c){const _=await x.key,R=await x.value;u.push({key:_,value:R,alwaysSet:x.alwaysSet})}return u}).then(u=>pe.mergeObjectSync(a,u)):pe.mergeObjectSync(a,c)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,a)=>{var l,d;const i=((d=(l=this._def).errorMap)==null?void 0:d.call(l,n,a).message)??a.defaultError;return n.code==="unrecognized_keys"?{message:b.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:C.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const n={};for(const a of $.objectKeys(e))e[a]&&this.shape[a]&&(n[a]=this.shape[a]);return new ae({...this._def,shape:()=>n})}omit(e){const n={};for(const a of $.objectKeys(this.shape))e[a]||(n[a]=this.shape[a]);return new ae({...this._def,shape:()=>n})}deepPartial(){return gt(this)}partial(e){const n={};for(const a of $.objectKeys(this.shape)){const i=this.shape[a];e&&!e[a]?n[a]=i:n[a]=i.optional()}return new ae({...this._def,shape:()=>n})}required(e){const n={};for(const a of $.objectKeys(this.shape))if(e&&!e[a])n[a]=this.shape[a];else{let l=this.shape[a];for(;l instanceof Ke;)l=l._def.innerType;n[a]=l}return new ae({...this._def,shape:()=>n})}keyof(){return Oa($.objectKeys(this.shape))}}ae.create=(t,e)=>new ae({shape:()=>t,unknownKeys:"strip",catchall:We.create(),typeName:C.ZodObject,...E(e)});ae.strictCreate=(t,e)=>new ae({shape:()=>t,unknownKeys:"strict",catchall:We.create(),typeName:C.ZodObject,...E(e)});ae.lazycreate=(t,e)=>new ae({shape:t,unknownKeys:"strip",catchall:We.create(),typeName:C.ZodObject,...E(e)});class Ht extends U{_parse(e){const{ctx:n}=this._processInputParams(e),a=this._def.options;function i(l){for(const o of l)if(o.result.status==="valid")return o.result;for(const o of l)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const d=l.map(o=>new Ie(o.ctx.common.issues));return p(n,{code:h.invalid_union,unionErrors:d}),N}if(n.common.async)return Promise.all(a.map(async l=>{const d={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:d}),ctx:d}})).then(i);{let l;const d=[];for(const c of a){const u={...n,common:{...n.common,issues:[]},parent:null},x=c._parseSync({data:n.data,path:n.path,parent:u});if(x.status==="valid")return x;x.status==="dirty"&&!l&&(l={result:x,ctx:u}),u.common.issues.length&&d.push(u.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const o=d.map(c=>new Ie(c));return p(n,{code:h.invalid_union,unionErrors:o}),N}}get options(){return this._def.options}}Ht.create=(t,e)=>new Ht({options:t,typeName:C.ZodUnion,...E(e)});function Es(t,e){const n=Ze(t),a=Ze(e);if(t===e)return{valid:!0,data:t};if(n===v.object&&a===v.object){const i=$.objectKeys(e),l=$.objectKeys(t).filter(o=>i.indexOf(o)!==-1),d={...t,...e};for(const o of l){const c=Es(t[o],e[o]);if(!c.valid)return{valid:!1};d[o]=c.data}return{valid:!0,data:d}}else if(n===v.array&&a===v.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const d=t[l],o=e[l],c=Es(d,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===v.date&&a===v.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Gt extends U{_parse(e){const{status:n,ctx:a}=this._processInputParams(e),i=(l,d)=>{if(sa(l)||sa(d))return N;const o=Es(l.value,d.value);return o.valid?((na(l)||na(d))&&n.dirty(),{status:n.value,value:o.data}):(p(a,{code:h.invalid_intersection_types}),N)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([l,d])=>i(l,d)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Gt.create=(t,e,n)=>new Gt({left:t,right:e,typeName:C.ZodIntersection,...E(n)});class at extends U{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==v.array)return p(a,{code:h.invalid_type,expected:v.array,received:a.parsedType}),N;if(a.data.length<this._def.items.length)return p(a,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&a.data.length>this._def.items.length&&(p(a,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...a.data].map((d,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new qe(a,d,a.path,o)):null}).filter(d=>!!d);return a.common.async?Promise.all(l).then(d=>pe.mergeArray(n,d)):pe.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new at({...this._def,rest:e})}}at.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new at({items:t,typeName:C.ZodTuple,rest:null,...E(e)})};class ua extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==v.map)return p(a,{code:h.invalid_type,expected:v.map,received:a.parsedType}),N;const i=this._def.keyType,l=this._def.valueType,d=[...a.data.entries()].map(([o,c],u)=>({key:i._parse(new qe(a,o,a.path,[u,"key"])),value:l._parse(new qe(a,c,a.path,[u,"value"]))}));if(a.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of d){const u=await c.key,x=await c.value;if(u.status==="aborted"||x.status==="aborted")return N;(u.status==="dirty"||x.status==="dirty")&&n.dirty(),o.set(u.value,x.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const c of d){const u=c.key,x=c.value;if(u.status==="aborted"||x.status==="aborted")return N;(u.status==="dirty"||x.status==="dirty")&&n.dirty(),o.set(u.value,x.value)}return{status:n.value,value:o}}}}ua.create=(t,e,n)=>new ua({valueType:e,keyType:t,typeName:C.ZodMap,...E(n)});class It extends U{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==v.set)return p(a,{code:h.invalid_type,expected:v.set,received:a.parsedType}),N;const i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(p(a,{code:h.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(p(a,{code:h.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function d(c){const u=new Set;for(const x of c){if(x.status==="aborted")return N;x.status==="dirty"&&n.dirty(),u.add(x.value)}return{status:n.value,value:u}}const o=[...a.data.values()].map((c,u)=>l._parse(new qe(a,c,a.path,u)));return a.common.async?Promise.all(o).then(c=>d(c)):d(o)}min(e,n){return new It({...this._def,minSize:{value:e,message:b.toString(n)}})}max(e,n){return new It({...this._def,maxSize:{value:e,message:b.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}It.create=(t,e)=>new It({valueType:t,minSize:null,maxSize:null,typeName:C.ZodSet,...E(e)});class ma extends U{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ma.create=(t,e)=>new ma({getter:t,typeName:C.ZodLazy,...E(e)});class fa extends U{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:h.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}}fa.create=(t,e)=>new fa({value:t,typeName:C.ZodLiteral,...E(e)});function Oa(t,e){return new xt({values:t,typeName:C.ZodEnum,...E(e)})}class xt extends U{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),a=this._def.values;return p(n,{expected:$.joinValues(a),received:n.parsedType,code:h.invalid_type}),N}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),a=this._def.values;return p(n,{received:n.data,code:h.invalid_enum_value,options:a}),N}return ye(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return xt.create(e,{...this._def,...n})}exclude(e,n=this._def){return xt.create(this.options.filter(a=>!e.includes(a)),{...this._def,...n})}}xt.create=Oa;class ha extends U{_parse(e){const n=$.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==v.string&&a.parsedType!==v.number){const i=$.objectValues(n);return p(a,{expected:$.joinValues(i),received:a.parsedType,code:h.invalid_type}),N}if(this._cache||(this._cache=new Set($.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=$.objectValues(n);return p(a,{received:a.data,code:h.invalid_enum_value,options:i}),N}return ye(e.data)}get enum(){return this._def.values}}ha.create=(t,e)=>new ha({values:t,typeName:C.ZodNativeEnum,...E(e)});class Qt extends U{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==v.promise&&n.common.async===!1)return p(n,{code:h.invalid_type,expected:v.promise,received:n.parsedType}),N;const a=n.parsedType===v.promise?n.data:Promise.resolve(n.data);return ye(a.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Qt.create=(t,e)=>new Qt({type:t,typeName:C.ZodPromise,...E(e)});class vt extends U{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:a}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:d=>{p(a,d),d.fatal?n.abort():n.dirty()},get path(){return a.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const d=i.transform(a.data,l);if(a.common.async)return Promise.resolve(d).then(async o=>{if(n.value==="aborted")return N;const c=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return c.status==="aborted"?N:c.status==="dirty"||n.value==="dirty"?Tt(c.value):c});{if(n.value==="aborted")return N;const o=this._def.schema._parseSync({data:d,path:a.path,parent:a});return o.status==="aborted"?N:o.status==="dirty"||n.value==="dirty"?Tt(o.value):o}}if(i.type==="refinement"){const d=o=>{const c=i.refinement(o,l);if(a.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?N:(o.status==="dirty"&&n.dirty(),d(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?N:(o.status==="dirty"&&n.dirty(),d(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(a.common.async===!1){const d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!pt(d))return N;const o=i.transform(d.value,l);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>pt(d)?Promise.resolve(i.transform(d.value,l)).then(o=>({status:n.value,value:o})):N);$.assertNever(i)}}vt.create=(t,e,n)=>new vt({schema:t,typeName:C.ZodEffects,effect:e,...E(n)});vt.createWithPreprocess=(t,e,n)=>new vt({schema:e,effect:{type:"preprocess",transform:t},typeName:C.ZodEffects,...E(n)});class Ke extends U{_parse(e){return this._getType(e)===v.undefined?ye(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ke.create=(t,e)=>new Ke({innerType:t,typeName:C.ZodOptional,...E(e)});class bt extends U{_parse(e){return this._getType(e)===v.null?ye(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}bt.create=(t,e)=>new bt({innerType:t,typeName:C.ZodNullable,...E(e)});class As extends U{_parse(e){const{ctx:n}=this._processInputParams(e);let a=n.data;return n.parsedType===v.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}As.create=(t,e)=>new As({innerType:t,typeName:C.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...E(e)});class Ss extends U{_parse(e){const{ctx:n}=this._processInputParams(e),a={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return qt(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ie(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ie(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Ss.create=(t,e)=>new Ss({innerType:t,typeName:C.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...E(e)});class ga extends U{_parse(e){if(this._getType(e)!==v.nan){const a=this._getOrReturnCtx(e);return p(a,{code:h.invalid_type,expected:v.nan,received:a.parsedType}),N}return{status:"valid",value:e.data}}}ga.create=t=>new ga({typeName:C.ZodNaN,...E(t)});class Xi extends U{_parse(e){const{ctx:n}=this._processInputParams(e),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ds extends U{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return l.status==="aborted"?N:l.status==="dirty"?(n.dirty(),Tt(l.value)):this._def.out._parseAsync({data:l.value,path:a.path,parent:a})})();{const i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?N:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,n){return new Ds({in:e,out:n,typeName:C.ZodPipeline})}}class Is extends U{_parse(e){const n=this._def.innerType._parse(e),a=i=>(pt(i)&&(i.value=Object.freeze(i.value)),i);return qt(n)?n.then(i=>a(i)):a(n)}unwrap(){return this._def.innerType}}Is.create=(t,e)=>new Is({innerType:t,typeName:C.ZodReadonly,...E(e)});var C;(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"})(C||(C={}));const nt=Fe.create,Ma=Ts.create;We.create;const Da=Te.create,Ls=ae.create;Ht.create;Gt.create;at.create;const el=xt.create;Qt.create;Ke.create;bt.create;const tl=/^\d{4}-\d{2}-\d{2}$/,sl=Ls({title:nt().min(1),items:Da(nt().min(1)).min(1)}),nl=Ls({version:nt().min(1),publishedAt:nt().regex(tl,"Expected YYYY-MM-DD"),title:nt().min(1),sections:Da(sl).min(1),prerelease:Ma().optional()});Ls({changeType:el(["feature","improvement","fix","internal","docs"]),title:nt().min(1),summary:nt().min(1),public:Ma()});const al=[{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 pa(t){return new Date(`${t}T00:00:00.000Z`).getTime()}function rl(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 il(t){return[...t].sort((e,n)=>{const a=pa(n.publishedAt)-pa(e.publishedAt);return a!==0?a:n.version.localeCompare(e.version,void 0,{numeric:!0,sensitivity:"base"})})}const ll=Object.freeze(il(al.map(t=>nl.parse(t))));function ol(t){const e=Ce.c(5),{entries:n}=t;if(n.length===0){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.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 a;e[1]!==n?(a=n.map(dl),e[1]=n,e[2]=a):a=e[2];let i;return e[3]!==a?(i=s.jsx("div",{className:"space-y-4",children:a}),e[3]=a,e[4]=i):i=e[4],i}function dl(t){return s.jsxs("article",{className:"rounded-2xl border border-border bg-card/60 p-5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{className:"text-base font-semibold text-foreground",children:t.title}),s.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?s.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]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Published ",rl(t.publishedAt)]}),s.jsx("div",{className:"mt-4 space-y-4 text-sm text-foreground",children:t.sections.map(cl)})]},`${t.version}-${t.publishedAt}`)}function cl(t){return s.jsxs("section",{className:"space-y-2",children:[s.jsx("h4",{className:"text-sm font-semibold text-foreground",children:t.title}),s.jsx("ul",{className:"list-disc space-y-2 pl-5 text-muted-foreground",children:t.items.map(ul)})]},t.title)}function ul(t){return s.jsx("li",{children:t},t)}function ml(){const t=Ce.c(28),{remoteAuth:e,providerCatalog:n,providerSettings:a}=Os();let i;t[0]!==e?(i=wa(e),t[0]=e,t[1]=i):i=t[1];const d=i.features.handoff.enabled,o=Ct(bl),c=Ct(vl),u=Ct(xl),x=Ct(pl),_=Ct(gl);let R;if(t[2]!==c||t[3]!==o||t[4]!==d||t[5]!==n||t[6]!==a||t[7]!==x||t[8]!==_||t[9]!==u){const z=ka({providerCatalog:n,providerSettings:a});let B;t[11]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("div",{className:"max-w-2xl",children:"Hand Off entries are reusable handoff shortcuts for plan mode. The selected provider starts a fresh chat in the same feature and receives the approved plan as its first message."}),t[11]=B):B=t[11];let P;t[12]!==d?(P=d?null:s.jsx(st,{level:"account"}),t[12]=d,t[13]=P):P=t[13];const O=!d;let S;t[14]!==c?(S=()=>c(Sr()),t[14]=c,t[15]=S):S=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ir,{className:"mr-1.5 h-4 w-4"}),t[16]=D):D=t[16];let K;t[17]!==O||t[18]!==S?(K=s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"rounded-full",disabled:O,onClick:S,children:[D,"Add Hand Off"]}),t[17]=O,t[18]=S,t[19]=K):K=t[19];const J=!d;let Z;t[20]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(Sa,{className:"mr-1.5 h-4 w-4"}),t[20]=Z):Z=t[20];let V;t[21]!==_||t[22]!==J?(V=s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"rounded-full",disabled:J,onClick:_,children:[Z,"Reset Defaults"]}),t[21]=_,t[22]=J,t[23]=V):V=t[23];let G;t[24]!==V||t[25]!==P||t[26]!==K?(G=s.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:[B,s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[P,K,V]})]}),t[24]=V,t[25]=P,t[26]=K,t[27]=G):G=t[27],R=s.jsxs("div",{className:"border-b border-border",children:[G,o.length===0?s.jsx("div",{className:"py-8 text-sm text-muted-foreground",children:"No Hand Off entries configured."}):o.map((k,Q)=>{const f=Bn(k.provider,n),I=f.models.some(X=>X.id===k.model)?k.model:f.defaultModel;return s.jsxs("div",{className:`grid gap-4 py-5 md:grid-cols-[minmax(0,1.1fr)_160px_200px_minmax(0,1.2fr)_auto] ${Q===0?"":"border-t border-border"}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Label"}),s.jsx(Re,{value:k.label,disabled:!d,onChange:X=>u(k.id,{label:X.target.value}),placeholder:"Claude Opus"})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Provider"}),s.jsxs(q,{value:k.provider,disabled:!d,onValueChange:X=>{const M=X,re=Bn(M,n);u(k.id,{provider:M,model:re.defaultModel,modelOptions:re.defaultModelOptions})},children:[s.jsx(W,{children:s.jsx(Y,{})}),s.jsx(H,{children:z.map(hl)})]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Model"}),s.jsxs(q,{value:I,disabled:!d,onValueChange:X=>u(k.id,{model:X}),children:[s.jsx(W,{children:s.jsx(Y,{})}),s.jsx(H,{children:f.models.map(fl)})]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Base Prompt"}),s.jsx(Re,{value:k.basePrompt,disabled:!d,onChange:X=>u(k.id,{basePrompt:X.target.value}),placeholder:Er})]}),s.jsx("div",{className:"flex items-end",children:s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"rounded-full","aria-label":`Remove ${k.label}`,title:`Remove ${k.label}`,disabled:!d,onClick:()=>x(k.id),children:s.jsx(Ar,{className:"h-4 w-4"})})})]},k.id)})]}),t[2]=c,t[3]=o,t[4]=d,t[5]=n,t[6]=a,t[7]=x,t[8]=_,t[9]=u,t[10]=R}else R=t[10];return R}function fl(t){return s.jsx(j,{value:t.id,children:t.label},t.id)}function hl(t){return s.jsx(j,{value:t.id,children:t.label},t.id)}function gl(t){return t.resetToDefaults}function pl(t){return t.removeEntry}function xl(t){return t.updateEntry}function vl(t){return t.addEntry}function bl(t){return t.entries}function yl(){const t=Ce.c(51),{providerCatalog:e,providerSettings:n}=Os(),a=tt(Tl),i=tt(Rl),l=tt(Cl),d=tt(Nl),o=tt(jl),c=tt(kl),u=tt(wl);let x,_,R,z,B,P,O;if(t[0]!==e||t[1]!==n||t[2]!==l||t[3]!==u||t[4]!==c){const X=ka({providerCatalog:e,providerSettings:n});P="border-b border-border";let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"max-w-2xl",children:"Slash commands can run Kaizen-local actions or send saved prompt templates. Pull request commands only appear when the current chat provider is enabled below."}),t[12]=M):M=t[12];let re;t[13]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(Sa,{className:"mr-1.5 h-4 w-4"}),t[13]=re):re=t[13],t[14]!==u?(O=s.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:[M,s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"rounded-full",onClick:u,children:[re,"Reset Defaults"]})]}),t[14]=u,t[15]=O):O=t[15],B="grid gap-5 py-5",t[16]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Pull Request Providers"}),t[16]=R):R=t[16],t[17]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsxs("div",{className:"mb-3 text-sm text-muted-foreground",children:["Show PR slash commands only when one of these providers is active in the composer. Default:"," ",Pr.map(_l).join(", "),"."]}),t[17]=z):z=t[17],x="flex flex-wrap gap-2";let ce;t[18]!==l||t[19]!==c?(ce=le=>{const xe=l.includes(le.id);return s.jsx(se,{type:"button","aria-pressed":xe,variant:xe?"default":"outline",className:be("rounded-full",!xe&&"text-muted-foreground"),onClick:()=>c(le.id),children:le.label},le.id)},t[18]=l,t[19]=c,t[20]=ce):ce=t[20],_=X.map(ce),t[0]=e,t[1]=n,t[2]=l,t[3]=u,t[4]=c,t[5]=x,t[6]=_,t[7]=R,t[8]=z,t[9]=B,t[10]=P,t[11]=O}else x=t[5],_=t[6],R=t[7],z=t[8],B=t[9],P=t[10],O=t[11];let S;t[21]!==x||t[22]!==_?(S=s.jsx("div",{className:x,children:_}),t[21]=x,t[22]=_,t[23]=S):S=t[23];let D;t[24]!==R||t[25]!==z||t[26]!==S?(D=s.jsxs("div",{children:[R,z,S]}),t[24]=R,t[25]=z,t[26]=S,t[27]=D):D=t[27];let K,J;t[28]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"`/pr` Base Prompt"}),K=s.jsx("div",{className:"mb-3 text-sm text-muted-foreground",children:"Sent when you run `/pr` with no extra text. If you add text after the command, Kaizen appends it as extra instructions."}),t[28]=K,t[29]=J):(K=t[28],J=t[29]);let Z;t[30]!==d?(Z=X=>d(X.target.value),t[30]=d,t[31]=Z):Z=t[31];let V;t[32]!==a||t[33]!==Z?(V=s.jsxs("div",{className:"border-t border-border pt-5",children:[J,K,s.jsx(Vn,{value:a,onChange:Z,rows:5,className:"min-h-28"})]}),t[32]=a,t[33]=Z,t[34]=V):V=t[34];let G,k;t[35]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"`/pr-update` Base Prompt"}),k=s.jsx("div",{className:"mb-3 text-sm text-muted-foreground",children:"Sent when you run `/pr-update` with no extra text. Extra text is appended as additional instructions."}),t[35]=G,t[36]=k):(G=t[35],k=t[36]);let Q;t[37]!==o?(Q=X=>o(X.target.value),t[37]=o,t[38]=Q):Q=t[38];let f;t[39]!==i||t[40]!==Q?(f=s.jsxs("div",{className:"border-t border-border pt-5",children:[G,k,s.jsx(Vn,{value:i,onChange:Q,rows:5,className:"min-h-28"})]}),t[39]=i,t[40]=Q,t[41]=f):f=t[41];let F;t[42]!==V||t[43]!==f||t[44]!==B||t[45]!==D?(F=s.jsxs("div",{className:B,children:[D,V,f]}),t[42]=V,t[43]=f,t[44]=B,t[45]=D,t[46]=F):F=t[46];let I;return t[47]!==F||t[48]!==P||t[49]!==O?(I=s.jsxs("div",{className:P,children:[O,F]}),t[47]=F,t[48]=P,t[49]=O,t[50]=I):I=t[50],I}function _l(t){return Ms(t).label}function wl(t){return t.resetToDefaults}function kl(t){return t.togglePullRequestProvider}function jl(t){return t.setPullRequestUpdatePrompt}function Nl(t){return t.setPullRequestPrompt}function Cl(t){return t.pullRequestProviders}function Rl(t){return t.pullRequestUpdatePrompt}function Tl(t){return t.pullRequestPrompt}const El=[{id:"codex",label:"Codex"},{id:"claude",label:"Claude"}];function Ve(t){return new Intl.NumberFormat().format(t)}function xa(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 Al(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 Sl(t){return t?t.totals.reasoningTokens>0||t.days.some(e=>e.reasoningTokens>0):!1}function Il(t){const e=Ce.c(60),{access:n,provider:a,window:i,report:l,error:d,isLoading:o,onProviderChange:c,onWindowChange:u,onRefresh:x,onOpenAccount:_}=t;if(!n.features.providerUsage.enabled){const M=n.features.providerUsage.level;let re;e[0]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-2xl border border-border bg-background/80",children:s.jsx(Ea,{className:"h-5 w-5"})}),e[0]=re):re=e[0];let ce;e[1]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx("span",{children:"Usage analytics"}),e[1]=ce):ce=e[1];let le;e[2]!==M?(le=M==="free"?null:s.jsx(st,{level:M}),e[2]=M,e[3]=le):le=e[3];let xe;e[4]!==le?(xe=s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[ce,le]}),e[4]=le,e[5]=xe):xe=e[5];let Ee;e[6]!==M?(Ee=Ra("Provider Usage",M),e[6]=M,e[7]=Ee):Ee=e[7];let Pe;e[8]!==Ee?(Pe=s.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:Ee}),e[8]=Ee,e[9]=Pe):Pe=e[9];let Oe;e[10]!==xe||e[11]!==Pe?(Oe=s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[re,s.jsxs("div",{className:"min-w-0 flex-1",children:[xe,Pe]})]}),e[10]=xe,e[11]=Pe,e[12]=Oe):Oe=e[12];let Me;e[13]!==_?(Me=s.jsx("div",{className:"mt-4",children:s.jsx(se,{type:"button",onClick:_,children:"Open account settings"})}),e[13]=_,e[14]=Me):Me=e[14];let rt;return e[15]!==Oe||e[16]!==Me?(rt=s.jsxs("div",{className:"rounded-3xl border border-border bg-card/40 p-6",children:[Oe,Me]}),e[15]=Oe,e[16]=Me,e[17]=rt):rt=e[17],rt}let R;e[18]!==l?(R=Sl(l),e[18]=l,e[19]=R):R=e[19];const z=R;let B;e[20]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-foreground",children:"Usage analytics"}),s.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"Daily usage is aggregated on the server from local Codex and Claude logs. Other providers are not available here yet."})]}),e[20]=B):B=e[20];let P;e[21]!==c?(P=M=>c(M),e[21]=c,e[22]=P):P=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(W,{className:"min-w-[160px]",children:s.jsx(Y,{})}),e[23]=O):O=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(H,{children:El.map(Pl)}),e[24]=S):S=e[24];let D;e[25]!==a||e[26]!==P?(D=s.jsxs(q,{value:a,onValueChange:P,children:[O,S]}),e[25]=a,e[26]=P,e[27]=D):D=e[27];let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=["week","month"],e[28]=K):K=e[28];let J;e[29]!==u||e[30]!==i?(J=s.jsx("div",{className:"inline-flex rounded-xl border border-border bg-background/80 p-1",children:K.map(M=>s.jsx("button",{type:"button",onClick:()=>u(M),className:be("rounded-lg px-3 py-1.5 text-sm transition-colors",M===i?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:M==="week"?"Week":"Month"},M))}),e[29]=u,e[30]=i,e[31]=J):J=e[31];let Z;e[32]!==o?(Z=o?s.jsx(ge,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(ks,{className:"mr-2 h-4 w-4"}),e[32]=o,e[33]=Z):Z=e[33];let V;e[34]!==o||e[35]!==x||e[36]!==Z?(V=s.jsxs(se,{type:"button",variant:"outline",onClick:x,disabled:o,children:[Z,"Refresh"]}),e[34]=o,e[35]=x,e[36]=Z,e[37]=V):V=e[37];let G;e[38]!==V||e[39]!==D||e[40]!==J?(G=s.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[B,s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[D,J,V]})]}),e[38]=V,e[39]=D,e[40]=J,e[41]=G):G=e[41];let k;e[42]!==l?(k=l?s.jsxs("div",{className:"mt-3 text-xs text-muted-foreground",children:["Window ",l.windowStart," to ",l.windowEnd,". Day boundaries use local time. Scanned ",l.scannedFiles," files in"," ",l.durationMs,"ms."]}):null,e[42]=l,e[43]=k):k=e[43];let Q;e[44]!==G||e[45]!==k?(Q=s.jsxs("div",{className:"rounded-3xl border border-border bg-card/40 p-5",children:[G,k]}),e[44]=G,e[45]=k,e[46]=Q):Q=e[46];let f;e[47]!==d?(f=d?s.jsx("div",{className:"rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:d}):null,e[47]=d,e[48]=f):f=e[48];let F;e[49]!==l?(F=l!=null&&l.warnings.length?s.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[49]=l,e[50]=F):F=e[50];let I;e[51]!==o||e[52]!==l||e[53]!==z?(I=!l&&o?s.jsx("div",{className:"rounded-3xl border border-border bg-card/30 p-6 text-sm text-muted-foreground",children:"Loading usage analytics..."}):l?s.jsx("div",{className:"overflow-hidden rounded-3xl border border-border bg-card/30",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full text-sm",children:[s.jsx("thead",{className:"bg-background/70 text-left text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-3 font-medium",children:"Date"}),s.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Input"}),s.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Output"}),s.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Cache"}),z?s.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Reasoning"}):null,s.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Est. cost"})]})}),s.jsx("tbody",{children:l.days.map(M=>s.jsxs("tr",{className:"border-t border-border/70",children:[s.jsx("td",{className:"px-4 py-3 text-foreground",children:Al(M.date)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Ve(M.inputTokens)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Ve(M.outputTokens)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Ve(M.cacheTokens)}),z?s.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:Ve(M.reasoningTokens)}):null,s.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:xa(M.estimatedUsd)})]},M.date))}),s.jsx("tfoot",{className:"border-t border-border bg-background/60",children:s.jsxs("tr",{children:[s.jsx("td",{className:"px-4 py-3 font-medium text-foreground",children:"Total"}),s.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Ve(l.totals.inputTokens)}),s.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Ve(l.totals.outputTokens)}),s.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Ve(l.totals.cacheTokens)}),z?s.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:Ve(l.totals.reasoningTokens)}):null,s.jsx("td",{className:"px-4 py-3 text-right font-medium tabular-nums",children:xa(l.totals.estimatedUsd)})]})})]})})}):s.jsx("div",{className:"rounded-3xl border border-border bg-card/30 p-6 text-sm text-muted-foreground",children:"No usage was found for this window."}),e[51]=o,e[52]=l,e[53]=z,e[54]=I):I=e[54];let X;return e[55]!==Q||e[56]!==f||e[57]!==F||e[58]!==I?(X=s.jsxs("div",{className:"space-y-4",children:[Q,f,F,I]}),e[55]=Q,e[56]=f,e[57]=F,e[58]=I,e[59]=X):X=e[59],X}function Pl(t){return s.jsx(j,{value:t.id,children:t.label},t.id)}function Ol(t){const e=Ce.c(29),{access:n}=t,a=ja(),{socket:i}=Na(),[l,d]=y.useState("codex"),[o,c]=y.useState("week"),[u,x]=y.useState(null),[_,R]=y.useState(null),z=y.useRef(0);let B;e[0]!==l||e[1]!==o?(B=we.settingsUsage(l,o),e[0]=l,e[1]=o,e[2]=B):B=e[2];const P=B,O=ke(P);let S;e[3]!==n.features.providerUsage.enabled||e[4]!==P||e[5]!==l||e[6]!==i||e[7]!==o?(S=function(Q){if(!n.features.providerUsage.enabled)return Promise.resolve();const f=z.current=z.current+1;return Q==="auto"&&x(null),R(null),je(P,()=>i.command({type:"usage.analyticsReport",provider:l,window:o}),{statusLabel:Q==="refresh"?"Refreshing usage analytics...":"Loading usage analytics...",dedupe:Q!=="refresh"}).then(F=>{f===z.current&&x(F)}).catch(F=>{if(f!==z.current)return;const I=F instanceof Error?F.message:String(F);R(I),Q==="refresh"&&Or.error(I)})},e[3]=n.features.providerUsage.enabled,e[4]=P,e[5]=l,e[6]=i,e[7]=o,e[8]=S):S=e[8];const D=S;let K;e[9]!==D?(K=()=>{D("auto")},e[9]=D,e[10]=K):K=e[10];let J;e[11]!==n.features.providerUsage.enabled||e[12]!==l||e[13]!==i||e[14]!==o?(J=[n.features.providerUsage.enabled,l,i,o],e[11]=n.features.providerUsage.enabled,e[12]=l,e[13]=i,e[14]=o,e[15]=J):J=e[15],y.useEffect(K,J);let Z;e[16]!==D?(Z=()=>{D("refresh")},e[16]=D,e[17]=Z):Z=e[17];let V;e[18]!==a?(V=()=>a(Ca),e[18]=a,e[19]=V):V=e[19];let G;return e[20]!==n||e[21]!==_||e[22]!==O||e[23]!==l||e[24]!==u||e[25]!==Z||e[26]!==V||e[27]!==o?(G=s.jsx(Il,{access:n,provider:l,window:o,report:u,error:_,isLoading:O,onProviderChange:d,onWindowChange:c,onRefresh:Z,onOpenAccount:V}),e[20]=n,e[21]=_,e[22]=O,e[23]=l,e[24]=u,e[25]=Z,e[26]=V,e[27]=o,e[28]=G):G=e[28],G}function Ml(t){var e;return s.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 Et=[{id:"account",label:"Account",icon:ki,subtitle:"Sign in, review account access, and unlock Kaizen features."},{id:"general",label:"General",icon:_i,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"changelog",label:"Release Notes",icon:Aa,subtitle:"Review shipped changes included in the npm release history."},{id:"quick-chats",label:"Hand Off",icon:Mr,subtitle:"Configure handoff shortcuts for plan mode."},{id:"slash-commands",label:"/ commands",icon:js,subtitle:"Configure Kaizen slash command prompts and which providers expose them."},{id:"usage",label:"Usage",icon:Ea,subtitle:"Review daily token usage and cost estimates from local Codex and Claude logs."},{id:"providers",label:"Providers",icon:pi,subtitle:"Manage the default chat provider and saved model defaults for Claude, Codex, Gemini, Cursor, and OpenRouter."},{id:"keybindings",label:"Keybindings",icon:ui,subtitle:"Edit global app shortcuts stored in the active keybindings file."}],ws=30*6e4,va=15e3;function ba(t){return t&&Et.some(e=>e.id===t)?t:null}const Dl=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],Jt=Object.keys(Cs);function Ll(t){return`Edit global app shortcuts stored in ${t}.`}function Kt(t){return Object.fromEntries(Jt.map(e=>[e,Ns(t[e])]))}function Yt(t,e){return Jt.every(n=>(t[n]??"")===(e[n]??""))}function Ul(t,e,n){const a={...t};for(const i of Jt)(t[i]??"")===(e[i]??"")&&(a[i]=n[i]??"");return a}function $l(t,e,n){return e&&Yt(n,e)?{changed:!1,nextCurrent:t,nextLoaded:e,nextSaved:e}:{changed:!0,nextCurrent:!e||Yt(t,e)?n:t,nextLoaded:n,nextSaved:n}}function zl(t){const e=(t==null?void 0:t.status)==="checking",n=(t==null?void 0:t.status)==="updating"||(t==null?void 0:t.status)==="restart_pending";return t!=null&&t.updateAvailable?{disabled:n,kind:"update",label:"Update",variant:"default"}:{disabled:e||n,kind:"check",label:"Check for updates",spinning:e,variant:"outline"}}function ht(t,e,n){const a=Ms(n,t),i=(e==null?void 0:e.settings[n])??te[n];return a.systemActive?i.active?"Active.":"Inactive.":ri(n,e==null?void 0:e.settings,t)??"Inactive."}function Bl(t){return t&&typeof t=="object"&&"idx"in t&&typeof t.idx=="number"&&t.idx>0?"back":"home"}function ya({themePreference:t,nextBackgroundImage:e,backgroundOpacity:n}){const a=typeof e=="string"&&e.trim()!=="";return t!=="custom"||!a||n!==1?{}:{backgroundOpacity:.85,backgroundBlur:6}}function A(t){const e=Ce.c(19),{title:n,description:a,children:i,badge:l,bordered:d,alignStart:o}=t,c=d===void 0?!0:d,u=o===void 0?!1:o,x=c?"border-t border-border":void 0,_=`flex flex-col sm:flex-row sm:justify-between gap-3 sm:gap-8 py-5 ${u?"sm:items-start":"sm:items-center"}`;let R;e[0]!==n?(R=s.jsx("span",{children:n}),e[0]=n,e[1]=R):R=e[1];let z;e[2]!==l||e[3]!==R?(z=s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[R,l]}),e[2]=l,e[3]=R,e[4]=z):z=e[4];let B;e[5]!==a?(B=s.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:a}),e[5]=a,e[6]=B):B=e[6];let P;e[7]!==z||e[8]!==B?(P=s.jsxs("div",{className:"min-w-0 max-w-xl",children:[z,B]}),e[7]=z,e[8]=B,e[9]=P):P=e[9];let O;e[10]!==i?(O=s.jsx("div",{className:"flex w-full items-center sm:w-auto sm:shrink-0",children:i}),e[10]=i,e[11]=O):O=e[11];let S;e[12]!==_||e[13]!==P||e[14]!==O?(S=s.jsxs("div",{className:_,children:[P,O]}),e[12]=_,e[13]=P,e[14]=O,e[15]=S):S=e[15];let D;return e[16]!==S||e[17]!==x?(D=s.jsx("div",{className:x,children:S}),e[16]=S,e[17]=x,e[18]=D):D=e[18],D}function Ps(t){if(!t)return"—";const e=Date.parse(t);return Number.isNaN(e)?t:new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(e)}function Rt(t){return(t/1024).toFixed(3).replace(/(\.\d*?[1-9])0+$/u,"$1").replace(/\.0+$/u,"")}function Vl(t){const e=Ce.c(3),{url:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Ta("/api/qrcode"),e[0]=a):a=e[0];const i=`${a}?value=${encodeURIComponent(n)}`;let l;return e[1]!==i?(l=s.jsx("div",{className:"rounded-2xl border border-border bg-background/80 p-3",children:s.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 Zl(t){switch(t){case"signed_in":return"Connected to Kaizen";case"signed_out":return"Not connected";case"pending_sign_in":return"Finish signing in…";case"error":return"Connection error";default:return t}}function Fl(t){const e=Ce.c(10),{access:n}=t,a=n.signedIn?"OpenRouter, Provider Usage, and Hand Off are unlocked.":"Sign in to unlock OpenRouter, Provider Usage, and Hand Off.";let i;e[0]!==a?(i={label:"Account features",body:a},e[0]=a,e[1]=i):i=e[1];const l=n.paid?"Remote relay, browser notifications, install flows, and sync surfaces are unlocked.":"Upgrade to unlock remote relay, browser notifications, install flows, and sync surfaces.";let d;e[2]!==l?(d={label:"Paid features",body:l},e[2]=l,e[3]=d):d=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={label:"Account destination",body:`Locked features send you back to ${Ca}.`},e[4]=o):o=e[4];let c;e[5]!==i||e[6]!==d?(c=[i,d,o],e[5]=i,e[6]=d,e[7]=c):c=e[7];const u=c;let x;return e[8]!==u?(x=s.jsx("dl",{className:"w-full min-w-0 space-y-3.5 text-left sm:max-w-[420px]",children:u.map(Kl)}),e[8]=u,e[9]=x):x=e[9],x}function Kl(t){return s.jsxs("div",{children:[s.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t.label}),s.jsx("dd",{className:"mt-1 text-sm leading-snug text-foreground",children:t.body})]},t.label)}function ql(t){const e=Ce.c(9),{access:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Account access"}),e[0]=a):a=e[0];const i=n.signedIn?"Unlocked":"Locked";let l;e[1]!==i?(l=s.jsxs("div",{children:[a,s.jsx("dd",{className:"mt-1 tabular-nums text-sm text-foreground",children:i})]}),e[1]=i,e[2]=l):l=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Paid access"}),e[3]=d):d=e[3];const o=n.paid?"Unlocked":"Locked";let c;e[4]!==o?(c=s.jsxs("div",{children:[d,s.jsx("dd",{className:"mt-1 tabular-nums text-sm text-foreground",children:o})]}),e[4]=o,e[5]=c):c=e[5];let u;return e[6]!==l||e[7]!==c?(u=s.jsxs("dl",{className:"mt-4 grid gap-3 sm:grid-cols-2 sm:gap-x-6",children:[l,c]}),e[6]=l,e[7]=c,e[8]=u):u=e[8],u}function Wl(t){const e=Ce.c(20),{snapshot:n,redactMachineId:a}=t,i=a===void 0?!1:a;if(!n)return null;let l;if(e[0]!==i||e[1]!==n.connectedAt||e[2]!==n.lastHeartbeatAt||e[3]!==n.machineDisplayName||e[4]!==n.machineId){if(l=[],n.machineDisplayName&&!i){let o;e[6]!==n.machineDisplayName?(o={label:"Machine",value:n.machineDisplayName},e[6]=n.machineDisplayName,e[7]=o):o=e[7],l.push(o)}else if(n.machineId&&!i){let o;e[8]!==n.machineId?(o={label:"Machine ID",value:n.machineId},e[8]=n.machineId,e[9]=o):o=e[9],l.push(o)}if(n.connectedAt){let o;e[10]!==n.connectedAt?(o=Ps(n.connectedAt),e[10]=n.connectedAt,e[11]=o):o=e[11];let c;e[12]!==o?(c={label:"Connected",value:o},e[12]=o,e[13]=c):c=e[13],l.push(c)}if(n.lastHeartbeatAt){let o;e[14]!==n.lastHeartbeatAt?(o=Ps(n.lastHeartbeatAt),e[14]=n.lastHeartbeatAt,e[15]=o):o=e[15];let c;e[16]!==o?(c={label:"Last heartbeat",value:o},e[16]=o,e[17]=c):c=e[17],l.push(c)}e[0]=i,e[1]=n.connectedAt,e[2]=n.lastHeartbeatAt,e[3]=n.machineDisplayName,e[4]=n.machineId,e[5]=l}else l=e[5];if(l.length===0)return null;let d;return e[18]!==l?(d=s.jsx("dl",{className:"mt-3 space-y-2 text-sm",children:l.map(Hl)}),e[18]=l,e[19]=d):d=e[19],d}function Hl(t){return s.jsxs("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:justify-between sm:gap-4",children:[s.jsx("dt",{className:"text-muted-foreground",children:t.label}),s.jsx("dd",{className:"min-w-0 break-all text-right tabular-nums text-foreground sm:text-left",children:t.value})]},t.label)}function Xl(){var Un,$n,zn;const t=ja(),e=Dr(),{sectionId:n}=Lr(),a=Na(),i=Os(),l=Ur(),d=$r(),o=zr(),c=y.useMemo(()=>({...a,...i,...l,...d,...o}),[d,a,i,l,o]),{theme:u,setTheme:x}=Br(),_=ba(n)??"general",R=c.connectionStatus==="connecting",z=((Un=c.localProjects)==null?void 0:Un.machine.displayName)??"Unavailable",B=(($n=c.localProjects)==null?void 0:$n.projects.length)??0,P=Vr.split("/")[1]??"unknown",O=De(r=>r.scrollbackLines),S=De(r=>r.minColumnWidth),D=De(r=>r.editorPreset),K=De(r=>r.editorCommandTemplate),J=De(r=>r.setScrollbackLines),Z=De(r=>r.setMinColumnWidth),V=De(r=>r.setEditorPreset),G=De(r=>r.setEditorCommandTemplate),k=c.generalSettings,Q=c.keybindings,f=c.providerSettings,F=Le(r=>r.defaultProvider),I=Le(r=>r.providerDefaults),X=Le(r=>r.showProviderIconsInSideTray),M=Le(r=>r.setDefaultProvider),re=Le(r=>r.setProviderDefaultModel),ce=Le(r=>r.setProviderDefaultModelOptions),le=Le(r=>r.setProviderDefaultPlanMode),xe=Le(r=>r.setShowProviderIconsInSideTray),Ee=Ue(r=>r.folderGroupsEnabled),Pe=Ue(r=>r.showFeatureOverviewInSidebar),Oe=Ue(r=>r.kanbanStatusesEnabled),Me=Ue(r=>r.commitProjectMetadataDirectory),rt=Ue(r=>r.setFolderGroupsEnabled),La=Ue(r=>r.setShowFeatureOverviewInSidebar),Ua=Ue(r=>r.setKanbanStatusesEnabled),$a=Ue(r=>r.setCommitProjectMetadataDirectory),Us=he(r=>r.themeId),$s=he(r=>r.customAppearance),it=he(r=>r.backgroundImage),He=he(r=>r.backgroundOpacity),yt=he(r=>r.backgroundBlur),zs=he(r=>r.showProjectIconsInSidebar),za=he(r=>r.availableThemes),Ba=he(r=>r.setThemeId),Va=he(r=>r.setCustomAppearance),Xt=he(r=>r.setBackgroundImage),es=he(r=>r.setBackgroundOpacity),ts=he(r=>r.setBackgroundBlur),Za=he(r=>r.setShowProjectIconsInSidebar),Fa=$e(r=>r.browserNotificationsEnabled),Bs=$e(r=>r.soundEnabled),Vs=$e(r=>r.vibrationEnabled),Zs=$e(r=>r.lastPermissionState),Pt=$e(r=>r.setBrowserNotificationsEnabled),Ka=$e(r=>r.setSoundEnabled),qa=$e(r=>r.setVibrationEnabled),Fs=$e(r=>r.setLastPermissionState),Ge=y.useMemo(()=>Zn(Q),[Q]),Ks=Ge.filePathDisplay||Zr(),Wa=(k==null?void 0:k.filePathDisplay)||Fr(),Ot=y.useMemo(()=>Kt(Ge.bindings),[Ge.bindings]),[qs,ss]=y.useState(String(O)),[Ws,_t]=y.useState(Rt((k==null?void 0:k.settings.sendChunkSizeBytes)??ps.sendChunkSizeBytes)),[Hs,ns]=y.useState(String(S)),[as,Gs]=y.useState(K),[Qe,Mt]=y.useState(it??""),[Qs,rs]=y.useState(String(He)),[Ys,is]=y.useState(String(yt)),[Ye,wt]=y.useState(()=>Kt(Ge.bindings)),[ls,Js]=y.useState(()=>Kt(Ge.bindings)),[Xs,Dt]=y.useState(null),[Lt,en]=y.useState(!1),[tn,kt]=y.useState(null),[sn,nn]=y.useState(!1),os=y.useRef(Ot),an=y.useRef(Ot),[rn,ds]=y.useState(null),[Ql,Ha]=y.useState(""),[jt,ve]=y.useState(null),[Je,lt]=y.useState(null),[ln,ot]=y.useState(null),[on,cs]=y.useState(!1),[Ga,dn]=y.useState(!1),[Nt,cn]=y.useState(!1),un=y.useRef(null),[dt,mn]=y.useState(null),[Ut,$t]=y.useState(null),oe=y.useMemo(()=>Kr.map(r=>{var g;return((g=c.providerCatalog)==null?void 0:g.find(L=>L.id===r.id))??r}),[c.providerCatalog]),Qa=y.useMemo(()=>new Map(oe.map(r=>[r.id,r])),[oe]),zt=y.useMemo(()=>qr(oe,(f==null?void 0:f.settings)??te),[oe,f==null?void 0:f.settings]),ie=r=>Qa.get(r)??Ms(r),Ya=F==="last_used"||zt.some(r=>r.id===F)?F:"last_used",[fn,Ja]=y.useState([]),T=c.updateSnapshot,hn=we.settingsUpdate("check"),gn=we.settingsUpdate("install"),Xa=we.settingsRemoteAuth("save"),us=we.settingsRemoteAuth("sign_in"),ct=we.settingsRemoteAuth("refresh"),pn=we.settingsRemoteAuth("sign_out"),xn=we.settingsRemoteAuth("streamer_mode"),vn=we.settingsTheme("refresh"),bn=we.settingsTheme("open_editor"),yn=we.settingsTheme("open_folder"),_n=ke(hn),wn=ke(gn);ke(Xa);const kn=ke(us),er=ke(ct),tr=ke(pn),jn=ke(xn),Ae=jt!==null||jn,sr=ke(vn),nr=ke(bn),ar=ke(yn),m=c.remoteAuth,ee=wa(m),ms=ni({browserNotificationsEnabled:Fa,signedIn:ee.signedIn}),me=c.themeSettings,fs=Qn(Zs),rr=si(),ir=Yr(fs),Nn=fs!=="unsupported",Cn=y.useRef(e.pathname),lr=typeof navigator<"u"&&typeof navigator.vibrate=="function",Xe=zl({...T,status:wn?"updating":_n?"checking":T==null?void 0:T.status}),or=_n||(T==null?void 0:T.status)==="checking"?"Checking for updates…":wn||(T==null?void 0:T.status)==="updating"?"Installing update…":(T==null?void 0:T.status)==="restart_pending"?`Restarting ${Fn}…`:(T==null?void 0:T.status)==="available"?`Update available${T.latestVersion?`: ${T.latestVersion}`:""}`:(T==null?void 0:T.status)==="up_to_date"?"Up to date":(T==null?void 0:T.status)==="error"?"Update check failed":"Not checked yet";y.useEffect(()=>{fetch(Ta("/api/backgrounds")).then(r=>r.json()).then(r=>Ja(r)).catch(r=>console.error("Failed to load system backgrounds",r))},[]),y.useEffect(()=>{Cn.current=e.pathname},[e.pathname]),y.useEffect(()=>{ss(String(O))},[O]),y.useEffect(()=>{_t(Rt((k==null?void 0:k.settings.sendChunkSizeBytes)??ps.sendChunkSizeBytes))},[k==null?void 0:k.settings.sendChunkSizeBytes]),y.useEffect(()=>{ns(String(S))},[S]),y.useEffect(()=>{Gs(K)},[K]),y.useEffect(()=>{Mt(it??"")},[it]),y.useEffect(()=>{rs(String(He))},[He]),y.useEffect(()=>{is(String(yt))},[yt]),y.useEffect(()=>{const r=Ot,g=os.current,L=$l(Ye,g,r);L.changed&&(os.current=L.nextLoaded,Js(L.nextSaved),wt(L.nextCurrent))},[Ye,Ot]),y.useEffect(()=>{an.current=Ye},[Ye]),y.useEffect(()=>{n&&(ba(n)||t("/settings/general",{replace:!0}))},[t,n]);function Rn(){const r=Number(qs);if(!Number.isFinite(r)){ss(String(O));return}J(r)}function Tn(){const r=Number(Hs);if(!Number.isFinite(r)){ns(String(S));return}Z(r)}async function dr(){const r=(k==null?void 0:k.settings.sendChunkSizeBytes)??ps.sendChunkSizeBytes,g=Number(Ws);if(!Number.isFinite(g)){kt("Chat chunk size must be a number."),_t(Rt(r));return}const L=Math.round(g*1024);if(L<Ft||L>Zt){kt(`Chat chunk size must stay between ${Ft/1024} KB and ${Zt/1024} KB.`);return}if(L===r){kt(null),_t(Rt(r));return}try{nn(!0),kt(null);const de=await c.socket.command({type:"settings.writeGeneralSettings",settings:{sendChunkSizeBytes:L}});_t(Rt(de.settings.sendChunkSizeBytes))}catch(de){kt(de instanceof Error?de.message:"Unable to save general settings.")}finally{nn(!1)}}function En(){const r=Qe.trim()===""?null:Qe.trim(),g=ya({themePreference:u,nextBackgroundImage:r,backgroundOpacity:He});Xt(r),g.backgroundOpacity!==void 0&&es(g.backgroundOpacity),g.backgroundBlur!==void 0&&ts(g.backgroundBlur),Se({backgroundImage:r,...g})}function An(){const r=Number(Qs);if(!Number.isFinite(r)||r<0||r>1){rs(String(He));return}es(r),Se({backgroundOpacity:r})}function Sn(){const r=Number(Ys);if(!Number.isFinite(r)||r<0){is(String(yt));return}ts(r),Se({backgroundBlur:r})}function Bt(r,g){r.key==="Enter"&&(g(),r.currentTarget.blur())}function In(r,g){r.key==="Enter"&&(g(),r.currentTarget.blur())}function Pn(){G(as)}async function cr(r=an.current){try{en(!0),Dt(null);const g={...r},L=await c.socket.command({type:"settings.writeKeybindings",bindings:Gl(g)}),de=Kt(Zn(L).bindings);os.current=de,Js(de),wt(_e=>Ul(_e,g,de))}catch(g){Dt(g instanceof Error?g.message:"Unable to save keybindings.")}finally{en(!1)}}async function Se(r){try{await c.socket.command({type:"settings.writeThemeSettings",settings:{themePreference:(r==null?void 0:r.themePreference)??u,themeId:(r==null?void 0:r.themeId)??Us,customAppearance:(r==null?void 0:r.customAppearance)??$s,backgroundImage:(r==null?void 0:r.backgroundImage)!==void 0?r.backgroundImage:it,backgroundOpacity:(r==null?void 0:r.backgroundOpacity)??He,backgroundBlur:(r==null?void 0:r.backgroundBlur)??yt,showProjectIconsInSidebar:(r==null?void 0:r.showProjectIconsInSidebar)??zs}})}catch(g){console.error("Failed to save theme settings:",g)}}async function hs(r,g){mn(r);try{await je(r==="refresh"?vn:r==="open_editor"?bn:yn,g,{statusLabel:r==="refresh"?"Refreshing themes...":r==="open_editor"?"Opening theme files...":"Opening theme folder..."})}finally{mn(L=>L===r?null:L)}}async function On(){if(ee.features.browserNotifications.enabled){$t("requesting");try{const r=await Yn();Fs(r),Pt(r==="granted")}finally{$t(r=>r==="requesting"?null:r)}}}async function ur(){if(ee.features.browserNotifications.enabled){$t("testing");try{let r=Qn(Zs);ms&&r==="default"&&Nn&&(r=await Yn(),Fs(r),r!=="granted"&&Pt(!1)),await ai({event:{chatId:c.activeChatId??"settings-test",chatTitle:"Test notification",kind:"needs_input",projectTitle:"Settings"},onBrowserNotificationClick:()=>{t("/settings/general",{replace:Cn.current.startsWith("/settings")})},preferences:{browserNotificationsEnabled:ms&&r==="granted",soundEnabled:Bs,vibrationEnabled:Vs}})}finally{$t(r=>r==="testing"?null:r)}}}async function ut(r){const g=(f==null?void 0:f.settings)??te,L=r.openrouter.active&&!g.openrouter.active&&!ee.features.openrouter.enabled,de=ee.features.openrouter.enabled?r:{...r,openrouter:{...r.openrouter,active:!1}};L&&ds(Ra("OpenRouter","account"));try{L||ds(null),await c.socket.command({type:"settings.writeProviderSettings",settings:de})}catch(_e){ds(_e instanceof Error?_e.message:"Unable to save provider settings.")}}function mr(r){Dt(null),wt(g=>({...g,[r]:Ns(Jn[r])}))}function fr(){Dt(null),wt(ls)}async function hr(r){lt(r?"enable":"disable");try{ot(null),await c.socket.command({type:"remoteRelay.setEnabled",enabled:r})}catch(g){ot(g instanceof Error?g.message:String(g))}finally{lt(g=>g===(r?"enable":"disable")?null:g)}}async function gr(){lt("reconnect");try{ot(null),await c.socket.command({type:"remoteRelay.setEnabled",enabled:!0})}catch(r){ot(r instanceof Error?r.message:String(r))}finally{lt(r=>r==="reconnect"?null:r)}}async function pr(){lt("rotate");try{ot(null),await c.socket.command({type:"remoteRelay.rotateUrlKey"})}catch(r){ot(r instanceof Error?r.message:String(r))}finally{lt(r=>r==="rotate"?null:r)}}const xr=as.replaceAll("{path}","/Users/jake/Projects/kaizen/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),Mn=Et.find(r=>r.id===_)??Et[0],vr=_==="keybindings"?Ll(Ks):Mn.subtitle,br=ee.features.openrouter.enabled?zt:[...zt,...zt.some(r=>r.id==="openrouter")?[]:[ie("openrouter")]];y.useEffect(()=>{F==="openrouter"&&(ee.features.openrouter.enabled||M("last_used"))},[ee.features.openrouter.enabled,F,M]);const w=c.remoteRelay,fe=(m==null?void 0:m.status)==="signed_in",yr=((zn=m==null?void 0:m.entitlements)==null?void 0:zn["remote.relay"])===!0,_r=(w==null?void 0:w.status)==="unauthorized",gs=fe&&yr&&!_r,mt=(w==null?void 0:w.relayEnabled)??!0,wr=(w==null?void 0:w.status)==="idle_disconnected"&&mt,kr=!ee.features.openrouter.enabled,jr=!ee.features.remoteRelay.enabled,ue=!fe||(m==null?void 0:m.streamerModeEnabled)!==!1,Vt=fe&&(m==null?void 0:m.streamerModeEnabled)!==!1,Nr=y.useMemo(()=>(m==null?void 0:m.status)==="signed_in"?ue?`Kaizen checks account state and relay availability every ${va/1e3} seconds, and falls back to a full auth reload every ${ws/6e4} minutes.`:`Account connected as ${m.userId??"your account"}. Kaizen checks account state and relay availability every ${va/1e3} seconds, and falls back to a full auth reload every ${ws/6e4} minutes. The current access token is valid until ${Ps(m.accessTokenExpiresAt)}.`:(m==null?void 0:m.status)==="pending_sign_in"?"Complete account sign-in in the browser tab that opened. If nothing opened, use the continue link below.":m!=null&&m.error?m.error:"Link this app to your Kaizen account to unlock account-only features.",[m==null?void 0:m.status,m==null?void 0:m.userId,m==null?void 0:m.accessTokenExpiresAt,m==null?void 0:m.error,ue]),Cr=y.useMemo(()=>fe?gs?mt?(w==null?void 0:w.status)==="idle_disconnected"?"Hosted relay disconnected after 30 minutes without browser-driven activity. It will reconnect automatically when a wake request arrives.":w!=null&&w.publicUrl&&!ue?`Remote access is published at ${w.publicUrl}.`:"Relay state for this machine.":"Hosted relay is manually disabled on this machine. Wake requests are ignored until you turn it back on here.":"Hosted relay access is controlled by your Kaizen account state and refreshed from the web app automatically.":"Sign in from the account page to unlock remote access.",[fe,gs,mt,w==null?void 0:w.status,w==null?void 0:w.publicUrl,ue]);y.useEffect(()=>{ue&&(cs(!1),dn(!1),cn(!1))},[ue,m==null?void 0:m.status,c.lastRemoteAuthUrl,w==null?void 0:w.publicUrl]);const Dn=!R,Rr=_==="keybindings"?s.jsxs(s.Fragment,{children:[s.jsx(Be,{"data-testid":"keybindings-cancel-button",onClick:fr,disabled:Lt||Yt(Ye,ls),children:"Cancel"}),s.jsx(Be,{"data-testid":"keybindings-save-button",variant:"default",onClick:()=>{cr()},disabled:Lt||Yt(Ye,ls),icon:Lt?s.jsx(ge,{className:"h-4 w-4 animate-spin"}):void 0,children:Lt?"Saving...":"Save"}),s.jsxs(Be,{onClick:()=>{c.handleOpenExternalPath("open_editor",Ks)},icon:s.jsx(js,{className:"h-4 w-4"}),children:["Open in ",c.editorLabel]})]}):_==="general"?s.jsx(Be,{variant:Xe.variant,onClick:()=>{if(Xe.kind==="update"){je(gn,()=>c.handleInstallUpdate(),{statusLabel:"Installing update..."});return}je(hn,()=>c.handleCheckForUpdates({force:!0}),{statusLabel:"Checking for updates..."})},disabled:Xe.disabled,icon:Xe.kind==="check"?s.jsx(ks,{className:be("size-3.5",Xe.spinning&&"animate-spin")}):Xe.kind==="update"?s.jsx(Aa,{className:be("size-3.5")}):void 0,children:Xe.label}):null;function Ln(){if(Bl(window.history.state)==="back"){t(-1);return}t("/",{replace:!0})}return y.useEffect(()=>{Ha((m==null?void 0:m.baseUrl)??"")},[m==null?void 0:m.baseUrl]),y.useEffect(()=>{const r=c.handleReloadRemoteAuth,g=_==="account"&&un.current!=="account";un.current=_,g&&(Ae||(m==null?void 0:m.status)!=="signed_in"&&(m==null?void 0:m.status)!=="error"||(ve("refresh"),je(ct,r,{statusLabel:"Refreshing account state..."}).finally(()=>{ve(L=>L==="refresh"?null:L)})))},[ct,Ae,m==null?void 0:m.status,_,c.handleReloadRemoteAuth]),y.useEffect(()=>{const r=c.handleReloadRemoteAuth;if(_!=="account"||(m==null?void 0:m.status)!=="signed_in"&&(m==null?void 0:m.status)!=="error")return;const g=()=>{Ae||(ve("refresh"),je(ct,r,{statusLabel:"Refreshing account state..."}).finally(()=>{ve(_e=>_e==="refresh"?null:_e)}))},L=()=>{document.visibilityState==="visible"&&g()};window.addEventListener("focus",g),document.addEventListener("visibilitychange",L);const de=window.setInterval(g,ws);return()=>{window.removeEventListener("focus",g),document.removeEventListener("visibilitychange",L),window.clearInterval(de)}},[ct,Ae,m==null?void 0:m.status,_,c.handleReloadRemoteAuth]),s.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[s.jsxs("div",{className:"flex min-w-0 flex-1",children:[s.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${Dn?"pb-[89px]":""}`,children:s.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[s.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),Et.map(r=>s.jsx("button",{type:"button",onClick:()=>t(`/settings/${r.id}`,{replace:!0}),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${r.id===_?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(r.icon,{className:"h-4 w-4 shrink-0"}),s.jsx("span",{children:r.label})]})},r.label))]})}),s.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto",children:[s.jsx("div",{className:"md:hidden sticky top-0 z-10 bg-background border-b border-border px-4 py-2 backdrop-blur-md",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-hide",children:Et.map(r=>s.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===_?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:[s.jsx(r.icon,{className:"h-3.5 w-3.5 shrink-0"}),s.jsx("span",{children:r.label})]},r.id))}),s.jsx("button",{type:"button","aria-label":"Close settings",onClick:Ln,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:s.jsx(Kn,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"w-full px-6 pt-8 md:pt-16 pb-32",children:[R?s.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:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ge,{className:"h-4 w-4 animate-spin"}),s.jsx("span",{children:"Loading machine settings…"})]})}):s.jsxs("div",{className:"mx-auto max-w-4xl",children:[s.jsxs("div",{className:"pb-6",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4 min-h-[34px]",children:[s.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:Mn.label}),s.jsxs("div",{className:"flex items-center gap-2",children:[Rr,s.jsx(Be,{"aria-label":"Close settings",title:"Close settings",onClick:Ln,icon:s.jsx(Kn,{className:"h-4 w-4"}),className:"hidden md:flex"})]})]}),s.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:vr})]}),_==="account"?s.jsxs("div",{className:"border-b border-border",children:[s.jsx(A,{title:"Web dashboard",description:"Opens your Kaizen account dashboard in a new browser tab.",alignStart:!0,bordered:!1,children:s.jsxs("a",{href:Ri(m==null?void 0:m.baseUrl),target:"_blank",rel:"noopener noreferrer",className:be(_a({variant:"outline"}),"inline-flex gap-2 no-underline"),children:[s.jsx(Wr,{className:"h-4 w-4 shrink-0"}),"Open Dashboard"]})}),s.jsx(A,{title:"Streamer mode",description:fe?"Stores on your Kaizen account. When on (default), email, token timing, relay links, and sign-in URLs stay hidden — synced with the web dashboard.":"Sign in to sync privacy mode from your Kaizen account. Until then, sensitive fields stay hidden locally.",alignStart:!0,bordered:!1,children:s.jsxs(se,{type:"button",variant:Vt?"default":"outline","aria-pressed":Vt,className:"min-w-[72px]",disabled:!fe||Ae,onClick:()=>{je(xn,()=>c.handleSetStreamerMode(!Vt),{statusLabel:"Updating privacy setting..."})},children:[jn?s.jsx(ge,{className:"mr-2 h-4 w-4 animate-spin"}):null,Vt?"On":"Off"]})}),s.jsx(A,{title:"Email",description:fe?ue?"Hidden while streamer mode is on. Use the eye to reveal on this device.":"Address for your Kaizen account.":"Sign in to link an account and show your email here.",alignStart:!0,children:s.jsxs("div",{className:"flex min-w-0 max-w-full items-center gap-2 sm:max-w-[360px]",children:[s.jsx("div",{className:"min-w-0 flex-1 text-sm text-foreground",children:fe?ue&&!Nt?s.jsx("span",{className:"text-muted-foreground",children:"—"}):m!=null&&m.email?s.jsx("span",{className:"break-all",children:m.email}):s.jsx("span",{className:"text-muted-foreground",children:"Not synced yet"}):s.jsx("span",{className:"text-muted-foreground",children:"—"})}),fe&&ue?s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-9 w-9 shrink-0 p-0","aria-pressed":Nt,"aria-label":Nt?"Hide email":"Show email",title:Nt?"Hide email":"Show email",onClick:()=>cn(r=>!r),children:Nt?s.jsx(ea,{className:"h-4 w-4"}):s.jsx(Xn,{className:"h-4 w-4"})}):null]})}),s.jsx(A,{title:"Kaizen account",badge:fe?null:s.jsx(st,{level:"account"}),description:Nr,bordered:!1,alignStart:!0,children:s.jsxs("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[360px]",children:[Ml({remoteAuthSnapshot:m}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[(m==null?void 0:m.status)==="signed_out"||(m==null?void 0:m.status)==="error"?s.jsxs(s.Fragment,{children:[s.jsxs(se,{type:"button",variant:"outline",disabled:Ae,onClick:()=>{ve("sign_in"),je(us,()=>c.handleStartRemoteAuthSignIn("sign_up"),{statusLabel:"Starting sign-up..."}).finally(()=>ve(null))},children:[jt==="sign_in"||kn?s.jsx(ge,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Sign up"]}),s.jsxs(se,{type:"button",disabled:Ae,onClick:()=>{ve("sign_in"),je(us,()=>c.handleStartRemoteAuthSignIn("sign_in"),{statusLabel:"Starting sign-in..."}).finally(()=>ve(null))},children:[jt==="sign_in"||kn?s.jsx(ge,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Sign in"]})]}):null,(m==null?void 0:m.status)!=="signed_out"?s.jsxs(se,{type:"button",variant:"outline",disabled:Ae,onClick:()=>{ve("refresh"),je(ct,()=>c.handleReloadRemoteAuth(),{statusLabel:"Refreshing account state..."}).finally(()=>ve(null))},children:[jt==="refresh"||er?s.jsx(ge,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Refresh"]}):null,(m==null?void 0:m.status)!=="signed_out"?s.jsxs(se,{type:"button",variant:"outline",disabled:Ae,onClick:()=>{ve("sign_out"),je(pn,()=>c.handleSignOutRemoteAuth(),{statusLabel:"Signing out..."}).finally(()=>ve(null))},children:[jt==="sign_out"||tr?s.jsx(ge,{className:"mr-2 h-4 w-4 animate-spin"}):null,(m==null?void 0:m.status)==="pending_sign_in"?"Cancel sign-in":"Sign out"]}):null]}),(m==null?void 0:m.status)==="pending_sign_in"&&c.lastRemoteAuthUrl?s.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:[s.jsx("div",{className:"font-medium text-foreground",children:"Continue sign-in"}),ue&&!Ga?s.jsx(se,{type:"button",variant:"outline",className:"mt-2",onClick:()=>dn(!0),children:"Show sign-in link"}):s.jsx("a",{href:c.lastRemoteAuthUrl,target:"_self",rel:"noreferrer",className:"mt-1 block break-all text-primary underline underline-offset-2",children:c.lastRemoteAuthUrl})]}):null]})}),fe?s.jsxs(s.Fragment,{children:[s.jsx(A,{title:"Unlocked Features",description:"Current account state and what it unlocks in this app.",alignStart:!0,children:s.jsxs("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[420px]",children:[s.jsx(Fl,{access:ee}),s.jsx(ql,{access:ee})]})}),s.jsx(A,{title:"Saved sign-in data",description:ue?"Sign-in credentials are cached on this machine so you do not have to log in every launch.":`Sign-in is cached on this machine at ${(m==null?void 0:m.filePathDisplay)??"~/.kaizen/remote-auth.json"} so you do not have to log in every launch.`,alignStart:!0,children:s.jsx("div",{className:"text-sm text-foreground",children:Zl((m==null?void 0:m.status)??"signed_out")})})]}):null,s.jsx(A,{title:"Remote relay",badge:jr?s.jsx(st,{level:"paid"}):null,description:Cr,alignStart:!0,children:s.jsx("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[420px]",children:ee.features.remoteRelay.enabled?gs?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"text-sm text-foreground",children:["Status:"," ",(w==null?void 0:w.status)??"disabled"]}),s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[w!=null&&w.publicUrl&&ue?on?s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>cs(!1),children:[s.jsx(ea,{className:"h-4 w-4 shrink-0"}),"Hide"]}):s.jsxs(Hr,{children:[s.jsx(Gr,{asChild:!0,children:s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>cs(!0),children:[s.jsx(Xn,{className:"h-4 w-4 shrink-0"}),"View"]})}),s.jsx(Qr,{side:"bottom",className:"max-w-xs text-left",children:"Relay URL and QR are hidden while streamer mode is on."})]}):null,s.jsx(se,{type:"button",variant:mt?"outline":"default",disabled:Je!==null,onClick:()=>{hr(!mt)},children:Je==="enable"?"Enabling…":Je==="disable"?"Disabling…":mt?"Disable relay":"Enable relay"}),s.jsx(se,{type:"button",variant:"outline",disabled:Je!==null||!(w!=null&&w.publicUrl),onClick:()=>{pr()},children:Je==="rotate"?"Rotating URL...":"Rotate URL key"})]})]}),(w==null?void 0:w.status)==="manually_disabled"?s.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"Relay is manually disabled. Kaizen will not keep a tunnel open, will not poll for wake requests, and will ignore wake requests until you re-enable it here."}):null,(w==null?void 0:w.status)==="idle_disconnected"?s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"Relay is idle-disconnected. The tunnel is down, but Kaizen is polling for wake requests every 15 seconds."}),s.jsx(se,{type:"button",variant:"outline",disabled:Je!==null||!wr,onClick:()=>{gr()},children:Je==="reconnect"?"Reconnecting…":"Reconnect now"})]}):null,w!=null&&w.publicUrl&&(!ue||on)?s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:"Scan this from a phone to open the relay URL quickly."}),s.jsx(Vl,{url:w.publicUrl}),s.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,ln||w!=null&&w.error?s.jsx("div",{className:"text-sm text-red-500",children:ln??(w==null?void 0:w.error)}):null,s.jsx(Wl,{snapshot:w,redactMachineId:ue})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-sm text-foreground",children:"Status: unauthorized"}),s.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"Remote access is not enabled for this account. Refresh account state or ask an admin to review your relay access if you expected it to work."})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:fe?"Remote relay access is controlled by your Kaizen account state on the web app.":"Sign in from the account page to unlock remote relay."})})})]}):_==="general"?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"border-b border-border",children:[s.jsx(A,{title:"Application Update",description:s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:[or,"."]}),T!=null&&T.lastCheckedAt?s.jsxs("span",{children:[" ","Last checked"," ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(T.lastCheckedAt),"."]}):null,T!=null&&T.error?s.jsxs("span",{children:[" ",T.error]}):null]}),bordered:!1,children:s.jsxs("div",{className:"text-right text-sm text-foreground",children:[s.jsxs("div",{children:["Current:"," ",(T==null?void 0:T.currentVersion)??P]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(T==null?void 0:T.latestVersion)??"Unknown"]})]})}),s.jsx(A,{title:"Theme",description:"Choose between light, dark, system, or custom appearance",children:s.jsxs(q,{value:u,onValueChange:r=>{x(r),Se({themePreference:r})},children:[s.jsx(W,{className:"w-[150px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"light",children:"Light"}),s.jsx(j,{value:"dark",children:"Dark"}),s.jsx(j,{value:"system",children:"System"}),s.jsx(j,{value:"custom",children:"Custom"})]})]})}),u==="custom"?s.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[s.jsx(A,{title:"Appearance",description:"Choose light, dark, or system mode for your custom theme",bordered:!1,children:s.jsxs(q,{value:$s,onValueChange:r=>{Va(r),Se({customAppearance:r})},children:[s.jsx(W,{className:"w-[150px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"light",children:"Light"}),s.jsx(j,{value:"dark",children:"Dark"}),s.jsx(j,{value:"system",children:"System"})]})]})}),s.jsx(A,{title:"Color Theme",description:`Choose a color palette for the interface. Custom JSON themes live in ${(me==null?void 0:me.themesDirectoryDisplay)??"~/.kaizen/themes"}. Read ${(me==null?void 0:me.themesReadmeFileDisplay)??"~/.kaizen/themes/THEME_README.md"} for authoring guidance.`,alignStart:!0,bordered:!1,children:s.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(q,{value:Us,onValueChange:r=>{Ba(r),Se({themeId:r})},children:[s.jsx(W,{className:"min-w-[180px]",children:s.jsx(Y,{})}),s.jsx(H,{children:s.jsx(xs,{children:za.map(r=>s.jsx(j,{value:r.id,children:r.label},r.id))})})]}),s.jsx(Be,{variant:"outline","aria-label":"Refresh themes",title:"Refresh themes",className:"px-2.5",disabled:dt!==null,onClick:()=>{hs("refresh",()=>c.handleRefreshThemeSettings())},icon:dt==="refresh"||sr?s.jsx(ge,{className:"size-3.5 animate-spin"}):s.jsx(ks,{className:"size-3.5"})})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Be,{disabled:dt!==null,onClick:()=>{hs("open_editor",()=>c.handleOpenCustomThemes())},icon:dt==="open_editor"||nr?s.jsx(ge,{className:"size-3.5 animate-spin"}):s.jsx(vi,{className:"size-3.5"}),children:["Open in ",c.editorLabel]}),s.jsx(Be,{variant:"outline",disabled:dt!==null,onClick:()=>{hs("open_folder",()=>c.handleOpenExternalPath("open_finder",(me==null?void 0:me.themesDirectoryDisplay)??"~/.kaizen/themes"))},icon:dt==="open_folder"||ar?s.jsx(ge,{className:"size-3.5 animate-spin"}):s.jsx(js,{className:"size-3.5"}),children:"Open folder"})]}),me!=null&&me.customThemeWarnings.length?s.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:me.customThemeWarnings.join(" ")}):null]})}),s.jsx(A,{title:"Background Image",description:"Choose a background or enter a custom URL",alignStart:!0,bordered:!1,children:(()=>{const r=fn.find(ne=>ne.url===Qe),g=!Qe,L=!!Qe&&!r,de=g?"__none__":L?"__custom__":Qe,_e=g?"None":L?"Custom URL":(r==null?void 0:r.name)??"Unknown";return s.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[s.jsxs(q,{value:de,onValueChange:ne=>{if(ne==="__none__")Mt(""),Xt(null),Se({backgroundImage:null});else{const et=ya({themePreference:u,nextBackgroundImage:ne,backgroundOpacity:He});Mt(ne),Xt(ne),et.backgroundOpacity!==void 0&&es(et.backgroundOpacity),et.backgroundBlur!==void 0&&ts(et.backgroundBlur),Se({backgroundImage:ne,...et})}},children:[s.jsx(W,{className:"w-full",children:s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[g?null:s.jsx("img",{src:vs(it??null)??void 0,alt:"",className:"h-5 w-9 shrink-0 rounded object-cover"}),s.jsx("span",{className:"truncate",children:_e})]})}),s.jsxs(H,{children:[s.jsx(bs,{value:"__none__",children:"None"}),fn.map(ne=>s.jsx(bs,{value:ne.url,thumbnail:vs(ne.url)??ne.url,thumbnailAlt:ne.name,children:ne.name},ne.id)),L?s.jsx(bs,{value:"__custom__",thumbnail:vs(it??null)??void 0,thumbnailAlt:"Custom",children:"Custom URL"}):null]})]}),s.jsx(Re,{type:"text",placeholder:"Or enter a custom URL...",value:Qe,onChange:ne=>Mt(ne.target.value),onBlur:En,onKeyDown:ne=>In(ne,En),className:"w-full"})]})})()}),s.jsx(A,{title:"Background Opacity",description:"Opacity of the interface layered over the background (0 to 1)",bordered:!1,children:s.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:s.jsx(Re,{type:"number",min:0,max:1,step:.05,value:Qs,onChange:r=>rs(r.target.value),onBlur:An,onKeyDown:r=>Bt(r,An),className:"hide-number-steppers w-28 text-right font-mono"})})}),s.jsx(A,{title:"Background Blur",description:"Blur applied to the background image (in pixels)",bordered:!1,children:s.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:s.jsx(Re,{type:"number",min:0,max:50,step:1,value:Ys,onChange:r=>is(r.target.value),onBlur:Sn,onKeyDown:r=>Bt(r,Sn),className:"hide-number-steppers w-28 text-right font-mono"})})})]}):null,rr?s.jsxs(s.Fragment,{children:[s.jsx(A,{title:"Browser Notifications",badge:ee.features.browserNotifications.enabled?null:s.jsx(st,{level:"paid"}),description:"Show desktop or PWA notifications when a background chat needs input or completes.",children:s.jsxs(q,{value:ms?"enabled":"disabled",onValueChange:r=>{if(r==="enabled"){if(!ee.features.browserNotifications.enabled)return;fs==="granted"?Pt(!0):On();return}Pt(!1)},disabled:!ee.features.browserNotifications.enabled,children:[s.jsx(W,{className:"w-[100px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"disabled",children:"Off"}),s.jsx(j,{value:"enabled",children:"On"})]})]})}),ee.features.browserNotifications.enabled?s.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[s.jsx(A,{title:"Permission",description:"Permission is only requested when you explicitly enable notifications from here.",bordered:!1,alignStart:!0,children:s.jsxs("div",{className:"flex w-full flex-col items-end gap-2 text-right sm:w-auto",children:[s.jsxs("div",{className:"flex items-center justify-end gap-2 text-sm text-foreground",children:[s.jsx(li,{className:"size-4 text-muted-foreground"}),s.jsx("span",{children:ir})]}),s.jsx("div",{className:"flex w-full flex-wrap justify-end gap-2 sm:w-auto",children:s.jsxs(se,{type:"button",variant:"outline",disabled:!Nn||Ut!==null,onClick:()=>{On()},children:[Ut==="requesting"?s.jsx(ge,{className:"mr-2 size-4 animate-spin"}):null,"Enable notifications"]})})]})}),s.jsx(A,{title:"Notification Sound",description:"Play a local alert cue for background chat notifications.",bordered:!1,children:s.jsxs(q,{value:Bs?"enabled":"disabled",onValueChange:r=>{Ka(r==="enabled")},children:[s.jsx(W,{className:"ml-auto w-[100px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"disabled",children:"Off"}),s.jsx(j,{value:"enabled",children:"On"})]})]})}),lr?s.jsx(A,{title:"Vibration",description:"Use device vibration when supported by the browser.",bordered:!1,children:s.jsxs(q,{value:Vs?"enabled":"disabled",onValueChange:r=>{qa(r==="enabled")},children:[s.jsx(W,{className:"ml-auto w-[100px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"disabled",children:"Off"}),s.jsx(j,{value:"enabled",children:"On"})]})]})}):null,s.jsx(A,{title:"Test Notification",description:"Send a local test notification using your current notification settings.",bordered:!1,children:s.jsx("div",{className:"flex flex-wrap justify-end gap-2",children:s.jsxs(se,{type:"button",variant:"outline",disabled:Ut!==null,onClick:()=>{ur()},children:[Ut==="testing"?s.jsx(ge,{className:"mr-2 size-4 animate-spin"}):null,"Test notification"]})})})]}):null]}):null,s.jsx(A,{title:"Project Icons",description:"Show detected project icons in the sidebar and open-project list.",children:s.jsxs(q,{value:zs?"enabled":"disabled",onValueChange:r=>{const g=r==="enabled";Za(g),Se({showProjectIconsInSidebar:g})},children:[s.jsx(W,{className:"w-[100px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"disabled",children:"Off"}),s.jsx(j,{value:"enabled",children:"On"})]})]})}),s.jsx(A,{title:"Folder Groups",description:"Show or hide feature folder grouping in the sidebar. Turning this off keeps the existing feature state, but flattens chats into a direct list and hides the new-folder button.",children:s.jsxs(q,{value:Ee?"enabled":"disabled",onValueChange:r=>rt(r==="enabled"),children:[s.jsx(W,{className:"w-[100px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"disabled",children:"Off"}),s.jsx(j,{value:"enabled",children:"On"})]})]})}),Ee?s.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[s.jsx(A,{title:"Feature Overview",description:"Generate and show an `overview.md` file for feature folders. Turning this off stops creating new overview files and hides existing overview rows from the sidebar.",bordered:!1,children:s.jsxs(q,{value:Pe?"enabled":"disabled",onValueChange:r=>La(r==="enabled"),children:[s.jsx(W,{className:"w-[100px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"disabled",children:"Off"}),s.jsx(j,{value:"enabled",children:"On"})]})]})}),s.jsx(A,{title:"Kanban Status",description:"Show or hide feature status controls like Idea, Todo, Progress, Testing, and Done.",bordered:!1,children:s.jsxs(q,{value:Oe?"enabled":"disabled",onValueChange:r=>Ua(r==="enabled"),children:[s.jsx(W,{className:"w-[100px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"disabled",children:"Off"}),s.jsx(j,{value:"enabled",children:"On"})]})]})}),s.jsx(A,{title:`${ys} In Git`,description:`Control whether ${Fn} keeps the project ${ys} directory tracked in git or adds it to .gitignore for currently loaded projects and future opens. This is best suited to solo developers working across multiple machines. For team repos, we recommend ignoring \`${ys}\`.`,bordered:!1,children:s.jsxs(q,{value:Me?"commit":"ignore",onValueChange:r=>{const g=r==="commit";$a(g),c.handleSetCommitProjectMetadataDirectory(g)},children:[s.jsx(W,{className:"w-[120px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"commit",children:"Commit"}),s.jsx(j,{value:"ignore",children:"Ignore"})]})]})})]}):null,s.jsx(A,{title:"Provider Icons In Side Tray",description:"Show provider badges next to chats in the left sidebar side tray.",children:s.jsxs(q,{value:X?"enabled":"disabled",onValueChange:r=>xe(r==="enabled"),children:[s.jsx(W,{className:"w-[100px]",children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"disabled",children:"Off"}),s.jsx(j,{value:"enabled",children:"On"})]})]})}),s.jsx(A,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:s.jsxs(q,{value:D,onValueChange:r=>V(r),children:[s.jsx(W,{className:"min-w-[180px]",children:s.jsx(Y,{})}),s.jsx(H,{children:s.jsx(xs,{children:Dl.map(r=>s.jsx(j,{value:r.value,children:r.label},r.value))})})]})}),D==="custom"?s.jsx("div",{className:"border-t border-border",children:s.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[s.jsxs("div",{className:"min-w-0 max-w-xl",children:[s.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),s.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and"," ","{column}"," in your command."]})]}),s.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[s.jsx(Re,{type:"text",value:as,onChange:r=>Gs(r.target.value),onBlur:Pn,onKeyDown:r=>In(r,Pn),className:"font-mono"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview:"," ",s.jsx("span",{className:"font-mono",children:xr})]})]})]})}):null,s.jsx(A,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:s.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[s.jsx(Re,{type:"number",min:Wn,max:qn,step:100,value:qs,onChange:r=>ss(r.target.value),onBlur:Rn,onKeyDown:r=>Bt(r,Rn),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),s.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[Wn,"-",qn," ","lines",O===Jr?" (default)":""]})]})}),s.jsx(A,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:s.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[s.jsx(Re,{type:"number",min:Gn,max:Hn,step:10,value:Hs,onChange:r=>ns(r.target.value),onBlur:Tn,onKeyDown:r=>Bt(r,Tn),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),s.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[Gn,"-",Hn," px",S===Xr?" (default)":""]})]})}),s.jsx(A,{title:"Chat Chunk Size",description:s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{children:"Max transcript payload sent per chat snapshot and load-more request. Smaller chunks reduce network payload size but increase the number of fetches."}),s.jsxs("div",{children:["Stored in ",Wa,". Range"," ",Ft/1024,"-",Zt/1024," KB. Default"," ",ei/1024," KB."]}),k!=null&&k.warning?s.jsx("div",{className:"text-amber-700 dark:text-amber-300",children:k.warning}):null,tn?s.jsx("div",{className:"text-red-500",children:tn}):null]}),children:s.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[s.jsx(Re,{type:"number",min:Ft/1024,max:Zt/1024,step:16,value:Ws,onChange:r=>_t(r.target.value),onBlur:()=>{dr()},onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),r.currentTarget.blur())},disabled:sn,className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),s.jsx("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:sn?"Saving...":"Kilobytes per chunk"})]})})]})}):_==="changelog"?s.jsx(ol,{entries:ll}):_==="quick-chats"?s.jsx(ml,{}):_==="slash-commands"?s.jsx(yl,{}):_==="usage"?s.jsx(Ol,{access:ee}):_==="providers"?s.jsxs("div",{className:"border-b border-border",children:[s.jsx(A,{title:"Default Provider",badge:kr?s.jsx(st,{level:"account"}):null,description:"The default harness used for new chats before a provider is locked by an existing session.",bordered:!1,children:s.jsxs(q,{value:Ya,onValueChange:r=>M(r),children:[s.jsx(W,{className:"min-w-[180px]",children:s.jsx(Y,{})}),s.jsx(H,{children:s.jsxs(xs,{children:[s.jsx(j,{value:"last_used",children:"Last Used"}),br.map(r=>s.jsx(j,{value:r.id,disabled:r.id==="openrouter"&&!ee.features.openrouter.enabled,children:r.label},r.id))]})})]})}),rn?s.jsx("div",{className:"border-t border-border px-0 py-3 text-sm text-destructive",children:rn}):null,s.jsx(A,{title:"Claude Code Defaults",description:`Saved defaults when using Claude Code. ${ht(oe,f,"claude")}`,alignStart:!0,children:s.jsxs("div",{className:be("max-w-[420px]",!ie("claude").systemActive&&"opacity-50"),children:[s.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:s.jsxs(q,{value:((f==null?void 0:f.settings.claude)??te.claude).active?"active":"inactive",onValueChange:r=>{ut({...(f==null?void 0:f.settings)??te,claude:{...(f==null?void 0:f.settings.claude)??te.claude,active:r==="active"}})},children:[s.jsx(W,{className:"min-w-[140px]",disabled:!ie("claude").systemActive,children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"active",children:"Active"}),s.jsx(j,{value:"inactive",children:"Inactive"})]})]})}),s.jsx(ft,{availableProviders:oe,selectedProvider:"claude",disabled:!ie("claude").systemActive,showProviderPicker:!1,providerLocked:!0,model:I.claude.model,modelOptions:I.claude.modelOptions,onModelChange:(r,g)=>{re("claude",g)},onClaudeReasoningEffortChange:r=>{ce("claude",{reasoningEffort:r})},onClaudeContextWindowChange:r=>{ce("claude",{contextWindow:r})},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:I.claude.planMode,onPlanModeChange:r=>le("claude",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),s.jsx(A,{title:"Codex Defaults",description:`Saved defaults when using Codex. ${ht(oe,f,"codex")}`,alignStart:!0,children:s.jsxs("div",{className:be("max-w-[420px]",!ie("codex").systemActive&&"opacity-50"),children:[s.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:s.jsxs(q,{value:((f==null?void 0:f.settings.codex)??te.codex).active?"active":"inactive",onValueChange:r=>{ut({...(f==null?void 0:f.settings)??te,codex:{...(f==null?void 0:f.settings.codex)??te.codex,active:r==="active"}})},children:[s.jsx(W,{className:"min-w-[140px]",disabled:!ie("codex").systemActive,children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"active",children:"Active"}),s.jsx(j,{value:"inactive",children:"Inactive"})]})]})}),s.jsx(ft,{availableProviders:oe,selectedProvider:"codex",disabled:!ie("codex").systemActive,showProviderPicker:!1,providerLocked:!0,model:I.codex.model,modelOptions:I.codex.modelOptions,onModelChange:(r,g)=>{re("codex",g),ce("codex",{reasoningEffort:ti(g,I.codex.modelOptions.reasoningEffort,oe)})},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:r=>{ce("codex",{reasoningEffort:r})},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:r=>{ce("codex",{fastMode:r})},planMode:I.codex.planMode,onPlanModeChange:r=>le("codex",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),s.jsx(A,{title:"Gemini Defaults",description:`Saved defaults when using Gemini. ${ht(oe,f,"gemini")}`,alignStart:!0,children:s.jsxs("div",{className:be("max-w-[420px]",!ie("gemini").systemActive&&"opacity-50"),children:[s.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:s.jsxs(q,{value:((f==null?void 0:f.settings.gemini)??te.gemini).active?"active":"inactive",onValueChange:r=>{ut({...(f==null?void 0:f.settings)??te,gemini:{...(f==null?void 0:f.settings.gemini)??te.gemini,active:r==="active"}})},children:[s.jsx(W,{className:"min-w-[140px]",disabled:!ie("gemini").systemActive,children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"active",children:"Active"}),s.jsx(j,{value:"inactive",children:"Inactive"})]})]})}),s.jsx(ft,{availableProviders:oe,selectedProvider:"gemini",disabled:!ie("gemini").systemActive,showProviderPicker:!1,providerLocked:!0,model:I.gemini.model,modelOptions:I.gemini.modelOptions,onModelChange:(r,g)=>{re("gemini",g)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:r=>{ce("gemini",{thinkingMode:r})},onCodexFastModeChange:()=>{},planMode:I.gemini.planMode,onPlanModeChange:r=>le("gemini",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),s.jsx(A,{title:"Cursor Defaults",description:`Saved defaults when using Cursor. ${ht(oe,f,"cursor")}`,alignStart:!0,children:s.jsxs("div",{className:be("max-w-[420px]",!ie("cursor").systemActive&&"opacity-50"),children:[s.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:s.jsxs(q,{value:((f==null?void 0:f.settings.cursor)??te.cursor).active?"active":"inactive",onValueChange:r=>{ut({...(f==null?void 0:f.settings)??te,cursor:{...(f==null?void 0:f.settings.cursor)??te.cursor,active:r==="active"}})},children:[s.jsx(W,{className:"min-w-[140px]",disabled:!ie("cursor").systemActive,children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"active",children:"Active"}),s.jsx(j,{value:"inactive",children:"Inactive"})]})]})}),s.jsx(ft,{availableProviders:oe,selectedProvider:"cursor",disabled:!ie("cursor").systemActive,showProviderPicker:!1,providerLocked:!0,model:I.cursor.model,modelOptions:I.cursor.modelOptions,onModelChange:(r,g)=>{re("cursor",g)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:I.cursor.planMode,onPlanModeChange:r=>le("cursor",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),s.jsx(A,{title:"Qwen Defaults",description:`Saved defaults when using Qwen. ${ht(oe,f,"qwen")}`,alignStart:!0,children:s.jsxs("div",{className:be("max-w-[420px]",!ie("qwen").systemActive&&"opacity-50"),children:[s.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:s.jsxs(q,{value:((f==null?void 0:f.settings.qwen)??te.qwen).active?"active":"inactive",onValueChange:r=>{ut({...(f==null?void 0:f.settings)??te,qwen:{...(f==null?void 0:f.settings.qwen)??te.qwen,active:r==="active"}})},children:[s.jsx(W,{className:"min-w-[140px]",disabled:!ie("qwen").systemActive,children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"active",children:"Active"}),s.jsx(j,{value:"inactive",children:"Inactive"})]})]})}),s.jsx(ft,{availableProviders:oe,selectedProvider:"qwen",disabled:!ie("qwen").systemActive,showProviderPicker:!1,providerLocked:!0,model:I.qwen.model,modelOptions:I.qwen.modelOptions,onModelChange:(r,g)=>{re("qwen",g)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:I.qwen.planMode,onPlanModeChange:r=>le("qwen",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),s.jsx(A,{title:"OpenRouter Defaults",badge:ee.features.openrouter.enabled?null:s.jsx(st,{level:"account"}),description:`Saved defaults when using OpenRouter via openCode. ${ht(oe,f,"openrouter")}`,alignStart:!0,children:s.jsxs("div",{className:be("max-w-[420px]",!ie("openrouter").systemActive&&"opacity-50"),children:[s.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:s.jsxs(q,{value:((f==null?void 0:f.settings.openrouter)??te.openrouter).active?"active":"inactive",onValueChange:r=>{ut({...(f==null?void 0:f.settings)??te,openrouter:{...(f==null?void 0:f.settings.openrouter)??te.openrouter,active:r==="active"}})},children:[s.jsx(W,{className:"min-w-[140px]",disabled:!ie("openrouter").systemActive||!ee.features.openrouter.enabled,children:s.jsx(Y,{})}),s.jsxs(H,{children:[s.jsx(j,{value:"active",children:"Active"}),s.jsx(j,{value:"inactive",children:"Inactive"})]})]})}),s.jsx(ft,{availableProviders:oe,selectedProvider:"openrouter",disabled:!ie("openrouter").systemActive||!ee.features.openrouter.enabled,showProviderPicker:!1,providerLocked:!0,model:I.openrouter.model,modelOptions:I.openrouter.modelOptions,onModelChange:(r,g)=>{re("openrouter",g)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:I.openrouter.planMode,onPlanModeChange:r=>le("openrouter",r),includePlanMode:!0,className:"justify-start flex-wrap"})]})})]}):_==="keybindings"?s.jsxs("div",{className:"border-b border-border",children:[Xs?s.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:Xs}):null,Ge.warning?s.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:Ge.warning}):null,Jt.map((r,g)=>{const L=Ns(Jn[r]),de=Ye[r]??"",_e=de!==L;return s.jsx(A,{title:Cs[r],description:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Comma-separated shortcuts."}),_e?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:" "}),s.jsxs("button",{type:"button",onClick:()=>{mr(r)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",L]})]}):null]}),bordered:g!==0,children:s.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:s.jsx(Re,{type:"text",value:de,"aria-label":Cs[r],onChange:ne=>{const et=ne.target.value;wt(Tr=>({...Tr,[r]:et}))},className:"font-mono"})})},r)})]}):null]}),c.commandError?s.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:[s.jsx(hi,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),s.jsx("span",{children:c.commandError})]}):null]})]})]}),Dn?s.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:s.jsx("div",{className:"px-6 py-[14.25px]",children:s.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:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[s.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Machine"}),s.jsx("div",{className:"truncate text-foreground/80",children:ue?"Hidden":z})]})}),s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[s.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Connection"}),s.jsx("div",{className:"truncate text-foreground/80",children:c.connectionStatus})]})}),s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[s.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Projects"}),s.jsx("div",{className:"truncate text-foreground/80",children:B})]})}),s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[s.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Version"}),s.jsx("div",{className:"truncate text-foreground/80",children:P})]})})]})})}):null]})}function Gl(t){return{submitChatMessage:ze(t.submitChatMessage??""),toggleQuickPrompts:ze(t.toggleQuickPrompts??""),toggleProjectsSidebar:ze(t.toggleProjectsSidebar??""),toggleEmbeddedTerminal:ze(t.toggleEmbeddedTerminal??""),toggleRightSidebar:ze(t.toggleRightSidebar??""),openInFinder:ze(t.openInFinder??""),openInEditor:ze(t.openInEditor??""),addSplitTerminal:ze(t.addSplitTerminal??"")}}export{Xl as SettingsPage,Gl as buildKeybindingPayload,Kt as createKeybindingDrafts,Rt as formatChunkSizeKilobytes,ya as getBackgroundSelectionAdjustments,zl as getGeneralHeaderAction,Ll as getKeybindingsSubtitle,Bl as getSettingsCloseTarget,Yt as keybindingDraftsEqual,Ul as mergeSavedKeybindingDrafts,$l as reconcileLoadedKeybindingDrafts,ba as resolveSettingsSectionId};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|