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