@sourcegraph/amp 0.0.1765512638-g55c240 → 0.0.1765526485-g99562d
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/main.js +12 -12
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -67,7 +67,7 @@ ${X}
|
|
|
67
67
|
|
|
68
68
|
`)}D.write("payload.value = newResult;"),D.write("return payload;");let I=D.compile();return(P,R)=>I(U,P,R)},G,V=cD,K=!g_.jitless,W=K&&P$1.value,H=Q.catchall,z;J._zod.parse=(U,D)=>{z??(z=Y.value);let M=U.value;if(!V(M))return U.issues.push({expected:"object",code:"invalid_type",input:M,inst:J}),U;if(K&&W&&D?.async===!1&&D.jitless!==!0){if(!G)G=X(Q.shape);if(U=G(U,D),!H)return U;return HH0([],M,U,D,z,J)}return Z(U,D)}});pl=B0("$ZodUnion",(J,Q)=>{Y8.init(J,Q),Z9(J._zod,"optin",()=>Q.options.some((X)=>X._zod.optin==="optional")?"optional":void 0),Z9(J._zod,"optout",()=>Q.options.some((X)=>X._zod.optout==="optional")?"optional":void 0),Z9(J._zod,"values",()=>{if(Q.options.every((X)=>X._zod.values))return new Set(Q.options.flatMap((X)=>Array.from(X._zod.values)));return}),Z9(J._zod,"pattern",()=>{if(Q.options.every((X)=>X._zod.pattern)){let X=Q.options.map((G)=>G._zod.pattern);return new RegExp(`^(${X.map((G)=>c_(G.source)).join("|")})$`)}return});let Z=Q.options.length===1,Y=Q.options[0]._zod.run;J._zod.parse=(X,G)=>{if(Z)return Y(X,G);let V=!1,K=[];for(let q of Q.options){let W=q._zod.run({value:X.value,issues:[]},G);if(W instanceof Promise)K.push(W),V=!0;else{if(W.issues.length===0)return W;K.push(W)}}if(!V)return eW0(K,X,J,G);return Promise.all(K).then((q)=>{return eW0(q,X,J,G)})}}),BV1=B0("$ZodDiscriminatedUnion",(J,Q)=>{pl.init(J,Q);let Z=J._zod.parse;Z9(J._zod,"propValues",()=>{let X={};for(let G of Q.options){let V=G._zod.propValues;if(!V||Object.keys(V).length===0)throw Error(`Invalid discriminated union option at index "${Q.options.indexOf(G)}"`);for(let[K,q]of Object.entries(V)){if(!X[K])X[K]=new Set;for(let W of q)X[K].add(W)}}return X});let Y=AE(()=>{let X=Q.options,G=new Map;for(let V of X){let K=V._zod.propValues?.[Q.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${Q.options.indexOf(V)}"`);for(let q of K){if(G.has(q))throw Error(`Duplicate discriminator value "${String(q)}"`);G.set(q,V)}}return G});J._zod.parse=(X,G)=>{let V=X.value;if(!cD(V))return X.issues.push({code:"invalid_type",expected:"object",input:V,inst:J}),X;let K=Y.value.get(V?.[Q.discriminator]);if(K)return K._zod.run(X,G);if(Q.unionFallback)return Z(X,G);return X.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:Q.discriminator,input:V,path:[Q.discriminator],inst:J}),X}}),NV1=B0("$ZodIntersection",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{let X=Z.value,G=Q.left._zod.run({value:X,issues:[]},Y),V=Q.right._zod.run({value:X,issues:[]},Y);if(G instanceof Promise||V instanceof Promise)return Promise.all([G,V]).then(([q,W])=>{return JH0(Z,q,W)});return JH0(Z,G,V)}});dl=B0("$ZodTuple",(J,Q)=>{Y8.init(J,Q);let Z=Q.items;J._zod.parse=(Y,X)=>{let G=Y.value;if(!Array.isArray(G))return Y.issues.push({input:G,inst:J,expected:"tuple",code:"invalid_type"}),Y;Y.value=[];let V=[],K=[...Z].reverse().findIndex((H)=>H._zod.optin!=="optional"),q=K===-1?0:Z.length-K;if(!Q.rest){let H=G.length>Z.length,z=G.length<q-1;if(H||z)return Y.issues.push({...H?{code:"too_big",maximum:Z.length}:{code:"too_small",minimum:Z.length},input:G,inst:J,origin:"array"}),Y}let W=-1;for(let H of Z){if(W++,W>=G.length){if(W>=q)continue}let z=H._zod.run({value:G[W],issues:[]},X);if(z instanceof Promise)V.push(z.then((U)=>vl(U,Y,W)));else vl(z,Y,W)}if(Q.rest){let H=G.slice(Z.length);for(let z of H){W++;let U=Q.rest._zod.run({value:z,issues:[]},X);if(U instanceof Promise)V.push(U.then((D)=>vl(D,Y,W)));else vl(U,Y,W)}}if(V.length)return Promise.all(V).then(()=>Y);return Y}});DV1=B0("$ZodRecord",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{let X=Z.value;if(!PF(X))return Z.issues.push({expected:"record",code:"invalid_type",input:X,inst:J}),Z;let G=[],V=Q.keyType._zod.values;if(V){Z.value={};let K=new Set;for(let W of V)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){K.add(typeof W==="number"?W.toString():W);let H=Q.valueType._zod.run({value:X[W],issues:[]},Y);if(H instanceof Promise)G.push(H.then((z)=>{if(z.issues.length)Z.issues.push(...zY(W,z.issues));Z.value[W]=z.value}));else{if(H.issues.length)Z.issues.push(...zY(W,H.issues));Z.value[W]=H.value}}let q;for(let W in X)if(!K.has(W))q=q??[],q.push(W);if(q&&q.length>0)Z.issues.push({code:"unrecognized_keys",input:X,inst:J,keys:q})}else{Z.value={};for(let K of Reflect.ownKeys(X)){if(K==="__proto__")continue;let q=Q.keyType._zod.run({value:K,issues:[]},Y);if(q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(q.issues.length){Z.issues.push({code:"invalid_key",origin:"record",issues:q.issues.map((H)=>FY(H,Y,_3())),input:K,path:[K],inst:J}),Z.value[q.value]=q.value;continue}let W=Q.valueType._zod.run({value:X[K],issues:[]},Y);if(W instanceof Promise)G.push(W.then((H)=>{if(H.issues.length)Z.issues.push(...zY(K,H.issues));Z.value[q.value]=H.value}));else{if(W.issues.length)Z.issues.push(...zY(K,W.issues));Z.value[q.value]=W.value}}}if(G.length)return Promise.all(G).then(()=>Z);return Z}}),MV1=B0("$ZodMap",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{let X=Z.value;if(!(X instanceof Map))return Z.issues.push({expected:"map",code:"invalid_type",input:X,inst:J}),Z;let G=[];Z.value=new Map;for(let[V,K]of X){let q=Q.keyType._zod.run({value:V,issues:[]},Y),W=Q.valueType._zod.run({value:K,issues:[]},Y);if(q instanceof Promise||W instanceof Promise)G.push(Promise.all([q,W]).then(([H,z])=>{QH0(H,z,Z,V,X,J,Y)}));else QH0(q,W,Z,V,X,J,Y)}if(G.length)return Promise.all(G).then(()=>Z);return Z}});LV1=B0("$ZodSet",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{let X=Z.value;if(!(X instanceof Set))return Z.issues.push({input:X,inst:J,expected:"set",code:"invalid_type"}),Z;let G=[];Z.value=new Set;for(let V of X){let K=Q.valueType._zod.run({value:V,issues:[]},Y);if(K instanceof Promise)G.push(K.then((q)=>ZH0(q,Z)));else ZH0(K,Z)}if(G.length)return Promise.all(G).then(()=>Z);return Z}});AV1=B0("$ZodEnum",(J,Q)=>{Y8.init(J,Q);let Z=d_(Q.entries),Y=new Set(Z);J._zod.values=Y,J._zod.pattern=new RegExp(`^(${Z.filter((X)=>l_.has(typeof X)).map((X)=>typeof X==="string"?vX(X):X.toString()).join("|")})$`),J._zod.parse=(X,G)=>{let V=X.value;if(Y.has(V))return X;return X.issues.push({code:"invalid_value",values:Z,input:V,inst:J}),X}}),OV1=B0("$ZodLiteral",(J,Q)=>{if(Y8.init(J,Q),Q.values.length===0)throw Error("Cannot create literal schema with no valid values");let Z=new Set(Q.values);J._zod.values=Z,J._zod.pattern=new RegExp(`^(${Q.values.map((Y)=>typeof Y==="string"?vX(Y):Y?vX(Y.toString()):String(Y)).join("|")})$`),J._zod.parse=(Y,X)=>{let G=Y.value;if(Z.has(G))return Y;return Y.issues.push({code:"invalid_value",values:Q.values,input:G,inst:J}),Y}}),wV1=B0("$ZodFile",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{let X=Z.value;if(X instanceof File)return Z;return Z.issues.push({expected:"file",code:"invalid_type",input:X,inst:J}),Z}}),EV1=B0("$ZodTransform",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward")throw new dD(J.constructor.name);let X=Q.transform(Z.value,Z);if(Y.async)return(X instanceof Promise?X:Promise.resolve(X)).then((V)=>{return Z.value=V,Z});if(X instanceof Promise)throw new DK;return Z.value=X,Z}});IV1=B0("$ZodOptional",(J,Q)=>{Y8.init(J,Q),J._zod.optin="optional",J._zod.optout="optional",Z9(J._zod,"values",()=>{return Q.innerType._zod.values?new Set([...Q.innerType._zod.values,void 0]):void 0}),Z9(J._zod,"pattern",()=>{let Z=Q.innerType._zod.pattern;return Z?new RegExp(`^(${c_(Z.source)})?$`):void 0}),J._zod.parse=(Z,Y)=>{if(Q.innerType._zod.optin==="optional"){let X=Q.innerType._zod.run(Z,Y);if(X instanceof Promise)return X.then((G)=>YH0(G,Z.value));return YH0(X,Z.value)}if(Z.value===void 0)return Z;return Q.innerType._zod.run(Z,Y)}}),PV1=B0("$ZodNullable",(J,Q)=>{Y8.init(J,Q),Z9(J._zod,"optin",()=>Q.innerType._zod.optin),Z9(J._zod,"optout",()=>Q.innerType._zod.optout),Z9(J._zod,"pattern",()=>{let Z=Q.innerType._zod.pattern;return Z?new RegExp(`^(${c_(Z.source)}|null)$`):void 0}),Z9(J._zod,"values",()=>{return Q.innerType._zod.values?new Set([...Q.innerType._zod.values,null]):void 0}),J._zod.parse=(Z,Y)=>{if(Z.value===null)return Z;return Q.innerType._zod.run(Z,Y)}}),TV1=B0("$ZodDefault",(J,Q)=>{Y8.init(J,Q),J._zod.optin="optional",Z9(J._zod,"values",()=>Q.innerType._zod.values),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward")return Q.innerType._zod.run(Z,Y);if(Z.value===void 0)return Z.value=Q.defaultValue,Z;let X=Q.innerType._zod.run(Z,Y);if(X instanceof Promise)return X.then((G)=>XH0(G,Q));return XH0(X,Q)}});RV1=B0("$ZodPrefault",(J,Q)=>{Y8.init(J,Q),J._zod.optin="optional",Z9(J._zod,"values",()=>Q.innerType._zod.values),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward")return Q.innerType._zod.run(Z,Y);if(Z.value===void 0)Z.value=Q.defaultValue;return Q.innerType._zod.run(Z,Y)}}),CV1=B0("$ZodNonOptional",(J,Q)=>{Y8.init(J,Q),Z9(J._zod,"values",()=>{let Z=Q.innerType._zod.values;return Z?new Set([...Z].filter((Y)=>Y!==void 0)):void 0}),J._zod.parse=(Z,Y)=>{let X=Q.innerType._zod.run(Z,Y);if(X instanceof Promise)return X.then((G)=>$H0(G,J));return $H0(X,J)}});jV1=B0("$ZodSuccess",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward")throw new dD("ZodSuccess");let X=Q.innerType._zod.run(Z,Y);if(X instanceof Promise)return X.then((G)=>{return Z.value=G.issues.length===0,Z});return Z.value=X.issues.length===0,Z}}),SV1=B0("$ZodCatch",(J,Q)=>{Y8.init(J,Q),Z9(J._zod,"optin",()=>Q.innerType._zod.optin),Z9(J._zod,"optout",()=>Q.innerType._zod.optout),Z9(J._zod,"values",()=>Q.innerType._zod.values),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward")return Q.innerType._zod.run(Z,Y);let X=Q.innerType._zod.run(Z,Y);if(X instanceof Promise)return X.then((G)=>{if(Z.value=G.value,G.issues.length)Z.value=Q.catchValue({...Z,error:{issues:G.issues.map((V)=>FY(V,Y,_3()))},input:Z.value}),Z.issues=[];return Z});if(Z.value=X.value,X.issues.length)Z.value=Q.catchValue({...Z,error:{issues:X.issues.map((G)=>FY(G,Y,_3()))},input:Z.value}),Z.issues=[];return Z}}),_V1=B0("$ZodNaN",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{if(typeof Z.value!=="number"||!Number.isNaN(Z.value))return Z.issues.push({input:Z.value,inst:J,expected:"nan",code:"invalid_type"}),Z;return Z}}),kV1=B0("$ZodPipe",(J,Q)=>{Y8.init(J,Q),Z9(J._zod,"values",()=>Q.in._zod.values),Z9(J._zod,"optin",()=>Q.in._zod.optin),Z9(J._zod,"optout",()=>Q.out._zod.optout),Z9(J._zod,"propValues",()=>Q.in._zod.propValues),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward"){let G=Q.out._zod.run(Z,Y);if(G instanceof Promise)return G.then((V)=>fl(V,Q.in,Y));return fl(G,Q.in,Y)}let X=Q.in._zod.run(Z,Y);if(X instanceof Promise)return X.then((G)=>fl(G,Q.out,Y));return fl(X,Q.out,Y)}});Yk=B0("$ZodCodec",(J,Q)=>{Y8.init(J,Q),Z9(J._zod,"values",()=>Q.in._zod.values),Z9(J._zod,"optin",()=>Q.in._zod.optin),Z9(J._zod,"optout",()=>Q.out._zod.optout),Z9(J._zod,"propValues",()=>Q.in._zod.propValues),J._zod.parse=(Z,Y)=>{if((Y.direction||"forward")==="forward"){let G=Q.in._zod.run(Z,Y);if(G instanceof Promise)return G.then((V)=>hl(V,Q,Y));return hl(G,Q,Y)}else{let G=Q.out._zod.run(Z,Y);if(G instanceof Promise)return G.then((V)=>hl(V,Q,Y));return hl(G,Q,Y)}}});yV1=B0("$ZodReadonly",(J,Q)=>{Y8.init(J,Q),Z9(J._zod,"propValues",()=>Q.innerType._zod.propValues),Z9(J._zod,"values",()=>Q.innerType._zod.values),Z9(J._zod,"optin",()=>Q.innerType?._zod?.optin),Z9(J._zod,"optout",()=>Q.innerType?._zod?.optout),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward")return Q.innerType._zod.run(Z,Y);let X=Q.innerType._zod.run(Z,Y);if(X instanceof Promise)return X.then(GH0);return GH0(X)}});xV1=B0("$ZodTemplateLiteral",(J,Q)=>{Y8.init(J,Q);let Z=[];for(let Y of Q.parts)if(typeof Y==="object"&&Y!==null){if(!Y._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...Y._zod.traits].shift()}`);let X=Y._zod.pattern instanceof RegExp?Y._zod.pattern.source:Y._zod.pattern;if(!X)throw Error(`Invalid template literal part: ${Y._zod.traits}`);let G=X.startsWith("^")?1:0,V=X.endsWith("$")?X.length-1:X.length;Z.push(X.slice(G,V))}else if(Y===null||R$1.has(typeof Y))Z.push(vX(`${Y}`));else throw Error(`Invalid template literal part: ${Y}`);J._zod.pattern=new RegExp(`^${Z.join("")}$`),J._zod.parse=(Y,X)=>{if(typeof Y.value!=="string")return Y.issues.push({input:Y.value,inst:J,expected:"template_literal",code:"invalid_type"}),Y;if(J._zod.pattern.lastIndex=0,!J._zod.pattern.test(Y.value))return Y.issues.push({input:Y.value,inst:J,code:"invalid_format",format:Q.format??"template_literal",pattern:J._zod.pattern.source}),Y;return Y}}),vV1=B0("$ZodFunction",(J,Q)=>{return Y8.init(J,Q),J._def=Q,J._zod.def=Q,J.implement=(Z)=>{if(typeof Z!=="function")throw Error("implement() must be called with a function");return function(...Y){let X=J._def.input?s_(J._def.input,Y):Y,G=Reflect.apply(Z,this,X);if(J._def.output)return s_(J._def.output,G);return G}},J.implementAsync=(Z)=>{if(typeof Z!=="function")throw Error("implementAsync() must be called with a function");return async function(...Y){let X=J._def.input?await t_(J._def.input,Y):Y,G=await Reflect.apply(Z,this,X);if(J._def.output)return await t_(J._def.output,G);return G}},J._zod.parse=(Z,Y)=>{if(typeof Z.value!=="function")return Z.issues.push({code:"invalid_type",expected:"function",input:Z.value,inst:J}),Z;if(J._def.output&&J._def.output._zod.def.type==="promise")Z.value=J.implementAsync(Z.value);else Z.value=J.implement(Z.value);return Z},J.input=(...Z)=>{let Y=J.constructor;if(Array.isArray(Z[0]))return new Y({type:"function",input:new dl({type:"tuple",items:Z[0],rest:Z[1]}),output:J._def.output});return new Y({type:"function",input:Z[0],output:J._def.output})},J.output=(Z)=>{return new J.constructor({type:"function",input:J._def.input,output:Z})},J}),fV1=B0("$ZodPromise",(J,Q)=>{Y8.init(J,Q),J._zod.parse=(Z,Y)=>{return Promise.resolve(Z.value).then((X)=>Q.innerType._zod.run({value:X,issues:[]},Y))}}),hV1=B0("$ZodLazy",(J,Q)=>{Y8.init(J,Q),Z9(J._zod,"innerType",()=>Q.getter()),Z9(J._zod,"pattern",()=>J._zod.innerType?._zod?.pattern),Z9(J._zod,"propValues",()=>J._zod.innerType?._zod?.propValues),Z9(J._zod,"optin",()=>J._zod.innerType?._zod?.optin??void 0),Z9(J._zod,"optout",()=>J._zod.innerType?._zod?.optout??void 0),J._zod.parse=(Z,Y)=>{return J._zod.innerType._zod.run(Z,Y)}}),bV1=B0("$ZodCustom",(J,Q)=>{T5.init(J,Q),Y8.init(J,Q),J._zod.parse=(Z,Y)=>{return Z},J._zod.check=(Z)=>{let Y=Z.value,X=Q.fn(Y);if(X instanceof Promise)return X.then((G)=>VH0(G,Z,Y,J));VH0(X,Z,Y,J);return}})});function gV1(){return{localeError:B94()}}var B94=()=>{let J={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(X)=>{switch(X.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${X.expected}، ولكن تم إدخال ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${U6(X.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return` أكبر من اللازم: يفترض أن تكون ${X.origin??"القيمة"} ${G} ${X.maximum.toString()} ${V.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${X.origin??"القيمة"} ${G} ${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`أصغر من اللازم: يفترض لـ ${X.origin} أن يكون ${G} ${X.minimum.toString()} ${V.unit}`;return`أصغر من اللازم: يفترض لـ ${X.origin} أن يكون ${G} ${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${X.prefix}"`;if(G.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${G.suffix}"`;if(G.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${G.includes}"`;if(G.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${G.pattern}`;return`${Y[G.format]??X.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${X.divisor}`;case"unrecognized_keys":return`معرف${X.keys.length>1?"ات":""} غريب${X.keys.length>1?"ة":""}: ${m0(X.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${X.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${X.origin}`;default:return"مدخل غير مقبول"}}};var FH0=B1(()=>{j4()});function uV1(){return{localeError:N94()}}var N94=()=>{let J={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(X)=>{switch(X.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${X.expected}, daxil olan ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Yanlış dəyər: gözlənilən ${U6(X.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Çox böyük: gözlənilən ${X.origin??"dəyər"} ${G}${X.maximum.toString()} ${V.unit??"element"}`;return`Çox böyük: gözlənilən ${X.origin??"dəyər"} ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Çox kiçik: gözlənilən ${X.origin} ${G}${X.minimum.toString()} ${V.unit}`;return`Çox kiçik: gözlənilən ${X.origin} ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Yanlış mətn: "${G.prefix}" ilə başlamalıdır`;if(G.format==="ends_with")return`Yanlış mətn: "${G.suffix}" ilə bitməlidir`;if(G.format==="includes")return`Yanlış mətn: "${G.includes}" daxil olmalıdır`;if(G.format==="regex")return`Yanlış mətn: ${G.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${Y[G.format]??X.format}`}case"not_multiple_of":return`Yanlış ədəd: ${X.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${X.keys.length>1?"lar":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`${X.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${X.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};var UH0=B1(()=>{j4()});function BH0(J,Q,Z,Y){let X=Math.abs(J),G=X%10,V=X%100;if(V>=11&&V<=19)return Y;if(G===1)return Q;if(G>=2&&G<=4)return Z;return Y}function pV1(){return{localeError:D94()}}var D94=()=>{let J={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"лік";case"object":{if(Array.isArray(X))return"масіў";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(X)=>{switch(X.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${X.expected}, атрымана ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Няправільны ўвод: чакалася ${U6(X.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V){let K=Number(X.maximum),q=BH0(K,V.unit.one,V.unit.few,V.unit.many);return`Занадта вялікі: чакалася, што ${X.origin??"значэнне"} павінна ${V.verb} ${G}${X.maximum.toString()} ${q}`}return`Занадта вялікі: чакалася, што ${X.origin??"значэнне"} павінна быць ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V){let K=Number(X.minimum),q=BH0(K,V.unit.one,V.unit.few,V.unit.many);return`Занадта малы: чакалася, што ${X.origin} павінна ${V.verb} ${G}${X.minimum.toString()} ${q}`}return`Занадта малы: чакалася, што ${X.origin} павінна быць ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${G.prefix}"`;if(G.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${G.suffix}"`;if(G.format==="includes")return`Няправільны радок: павінен змяшчаць "${G.includes}"`;if(G.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${G.pattern}`;return`Няправільны ${Y[G.format]??X.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${X.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${X.keys.length>1?"ключы":"ключ"}: ${m0(X.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${X.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${X.origin}`;default:return"Няправільны ўвод"}}};var NH0=B1(()=>{j4()});function dV1(){return{localeError:L94()}}var M94=(J)=>{let Q=typeof J;switch(Q){case"number":return Number.isNaN(J)?"NaN":"число";case"object":{if(Array.isArray(J))return"масив";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return Q},L94=()=>{let J={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function Q(Y){return J[Y]??null}let Z={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return(Y)=>{switch(Y.code){case"invalid_type":return`Невалиден вход: очакван ${Y.expected}, получен ${M94(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Невалиден вход: очакван ${U6(Y.values[0])}`;return`Невалидна опция: очаквано едно от ${m0(Y.values,"|")}`;case"too_big":{let X=Y.inclusive?"<=":"<",G=Q(Y.origin);if(G)return`Твърде голямо: очаква се ${Y.origin??"стойност"} да съдържа ${X}${Y.maximum.toString()} ${G.unit??"елемента"}`;return`Твърде голямо: очаква се ${Y.origin??"стойност"} да бъде ${X}${Y.maximum.toString()}`}case"too_small":{let X=Y.inclusive?">=":">",G=Q(Y.origin);if(G)return`Твърде малко: очаква се ${Y.origin} да съдържа ${X}${Y.minimum.toString()} ${G.unit}`;return`Твърде малко: очаква се ${Y.origin} да бъде ${X}${Y.minimum.toString()}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`Невалиден низ: трябва да започва с "${X.prefix}"`;if(X.format==="ends_with")return`Невалиден низ: трябва да завършва с "${X.suffix}"`;if(X.format==="includes")return`Невалиден низ: трябва да включва "${X.includes}"`;if(X.format==="regex")return`Невалиден низ: трябва да съвпада с ${X.pattern}`;let G="Невалиден";if(X.format==="emoji")G="Невалидно";if(X.format==="datetime")G="Невалидно";if(X.format==="date")G="Невалидна";if(X.format==="time")G="Невалидно";if(X.format==="duration")G="Невалидна";return`${G} ${Z[X.format]??Y.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${Y.divisor}`;case"unrecognized_keys":return`Неразпознат${Y.keys.length>1?"и":""} ключ${Y.keys.length>1?"ове":""}: ${m0(Y.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${Y.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${Y.origin}`;default:return"Невалиден вход"}}};var DH0=B1(()=>{j4()});function cV1(){return{localeError:A94()}}var A94=()=>{let J={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(X)=>{switch(X.code){case"invalid_type":return`Tipus invàlid: s'esperava ${X.expected}, s'ha rebut ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Valor invàlid: s'esperava ${U6(X.values[0])}`;return`Opció invàlida: s'esperava una de ${m0(X.values," o ")}`;case"too_big":{let G=X.inclusive?"com a màxim":"menys de",V=Q(X.origin);if(V)return`Massa gran: s'esperava que ${X.origin??"el valor"} contingués ${G} ${X.maximum.toString()} ${V.unit??"elements"}`;return`Massa gran: s'esperava que ${X.origin??"el valor"} fos ${G} ${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?"com a mínim":"més de",V=Q(X.origin);if(V)return`Massa petit: s'esperava que ${X.origin} contingués ${G} ${X.minimum.toString()} ${V.unit}`;return`Massa petit: s'esperava que ${X.origin} fos ${G} ${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Format invàlid: ha de començar amb "${G.prefix}"`;if(G.format==="ends_with")return`Format invàlid: ha d'acabar amb "${G.suffix}"`;if(G.format==="includes")return`Format invàlid: ha d'incloure "${G.includes}"`;if(G.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${G.pattern}`;return`Format invàlid per a ${Y[G.format]??X.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${X.divisor}`;case"unrecognized_keys":return`Clau${X.keys.length>1?"s":""} no reconeguda${X.keys.length>1?"s":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${X.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${X.origin}`;default:return"Entrada invàlida"}}};var MH0=B1(()=>{j4()});function lV1(){return{localeError:O94()}}var O94=()=>{let J={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(X))return"pole";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(X)=>{switch(X.code){case"invalid_type":return`Neplatný vstup: očekáváno ${X.expected}, obdrženo ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Neplatný vstup: očekáváno ${U6(X.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Hodnota je příliš velká: ${X.origin??"hodnota"} musí mít ${G}${X.maximum.toString()} ${V.unit??"prvků"}`;return`Hodnota je příliš velká: ${X.origin??"hodnota"} musí být ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Hodnota je příliš malá: ${X.origin??"hodnota"} musí mít ${G}${X.minimum.toString()} ${V.unit??"prvků"}`;return`Hodnota je příliš malá: ${X.origin??"hodnota"} musí být ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Neplatný řetězec: musí začínat na "${G.prefix}"`;if(G.format==="ends_with")return`Neplatný řetězec: musí končit na "${G.suffix}"`;if(G.format==="includes")return`Neplatný řetězec: musí obsahovat "${G.includes}"`;if(G.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${G.pattern}`;return`Neplatný formát ${Y[G.format]??X.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${X.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${m0(X.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${X.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${X.origin}`;default:return"Neplatný vstup"}}};var LH0=B1(()=>{j4()});function iV1(){return{localeError:w94()}}var w94=()=>{let J={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},Q={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function Z(V){return J[V]??null}function Y(V){return Q[V]??V}let X=(V)=>{let K=typeof V;switch(K){case"number":return Number.isNaN(V)?"NaN":"tal";case"object":{if(Array.isArray(V))return"liste";if(V===null)return"null";if(Object.getPrototypeOf(V)!==Object.prototype&&V.constructor)return V.constructor.name;return"objekt"}}return K},G={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(V)=>{switch(V.code){case"invalid_type":return`Ugyldigt input: forventede ${Y(V.expected)}, fik ${Y(X(V.input))}`;case"invalid_value":if(V.values.length===1)return`Ugyldig værdi: forventede ${U6(V.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${m0(V.values,"|")}`;case"too_big":{let K=V.inclusive?"<=":"<",q=Z(V.origin),W=Y(V.origin);if(q)return`For stor: forventede ${W??"value"} ${q.verb} ${K} ${V.maximum.toString()} ${q.unit??"elementer"}`;return`For stor: forventede ${W??"value"} havde ${K} ${V.maximum.toString()}`}case"too_small":{let K=V.inclusive?">=":">",q=Z(V.origin),W=Y(V.origin);if(q)return`For lille: forventede ${W} ${q.verb} ${K} ${V.minimum.toString()} ${q.unit}`;return`For lille: forventede ${W} havde ${K} ${V.minimum.toString()}`}case"invalid_format":{let K=V;if(K.format==="starts_with")return`Ugyldig streng: skal starte med "${K.prefix}"`;if(K.format==="ends_with")return`Ugyldig streng: skal ende med "${K.suffix}"`;if(K.format==="includes")return`Ugyldig streng: skal indeholde "${K.includes}"`;if(K.format==="regex")return`Ugyldig streng: skal matche mønsteret ${K.pattern}`;return`Ugyldig ${G[K.format]??V.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${V.divisor}`;case"unrecognized_keys":return`${V.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${m0(V.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${V.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${V.origin}`;default:return"Ugyldigt input"}}};var AH0=B1(()=>{j4()});function nV1(){return{localeError:E94()}}var E94=()=>{let J={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"Zahl";case"object":{if(Array.isArray(X))return"Array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(X)=>{switch(X.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${X.expected}, erhalten ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Ungültige Eingabe: erwartet ${U6(X.values[0])}`;return`Ungültige Option: erwartet eine von ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Zu groß: erwartet, dass ${X.origin??"Wert"} ${G}${X.maximum.toString()} ${V.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${X.origin??"Wert"} ${G}${X.maximum.toString()} ist`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Zu klein: erwartet, dass ${X.origin} ${G}${X.minimum.toString()} ${V.unit} hat`;return`Zu klein: erwartet, dass ${X.origin} ${G}${X.minimum.toString()} ist`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Ungültiger String: muss mit "${G.prefix}" beginnen`;if(G.format==="ends_with")return`Ungültiger String: muss mit "${G.suffix}" enden`;if(G.format==="includes")return`Ungültiger String: muss "${G.includes}" enthalten`;if(G.format==="regex")return`Ungültiger String: muss dem Muster ${G.pattern} entsprechen`;return`Ungültig: ${Y[G.format]??X.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${X.divisor} sein`;case"unrecognized_keys":return`${X.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${m0(X.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${X.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${X.origin}`;default:return"Ungültige Eingabe"}}};var OH0=B1(()=>{j4()});function Xk(){return{localeError:P94()}}var I94=(J)=>{let Q=typeof J;switch(Q){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return Q},P94=()=>{let J={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function Q(Y){return J[Y]??null}let Z={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(Y)=>{switch(Y.code){case"invalid_type":return`Invalid input: expected ${Y.expected}, received ${I94(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Invalid input: expected ${U6(Y.values[0])}`;return`Invalid option: expected one of ${m0(Y.values,"|")}`;case"too_big":{let X=Y.inclusive?"<=":"<",G=Q(Y.origin);if(G)return`Too big: expected ${Y.origin??"value"} to have ${X}${Y.maximum.toString()} ${G.unit??"elements"}`;return`Too big: expected ${Y.origin??"value"} to be ${X}${Y.maximum.toString()}`}case"too_small":{let X=Y.inclusive?">=":">",G=Q(Y.origin);if(G)return`Too small: expected ${Y.origin} to have ${X}${Y.minimum.toString()} ${G.unit}`;return`Too small: expected ${Y.origin} to be ${X}${Y.minimum.toString()}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`Invalid string: must start with "${X.prefix}"`;if(X.format==="ends_with")return`Invalid string: must end with "${X.suffix}"`;if(X.format==="includes")return`Invalid string: must include "${X.includes}"`;if(X.format==="regex")return`Invalid string: must match pattern ${X.pattern}`;return`Invalid ${Z[X.format]??Y.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${Y.divisor}`;case"unrecognized_keys":return`Unrecognized key${Y.keys.length>1?"s":""}: ${m0(Y.keys,", ")}`;case"invalid_key":return`Invalid key in ${Y.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${Y.origin}`;default:return"Invalid input"}}};var aV1=B1(()=>{j4()});function oV1(){return{localeError:R94()}}var T94=(J)=>{let Q=typeof J;switch(Q){case"number":return Number.isNaN(J)?"NaN":"nombro";case"object":{if(Array.isArray(J))return"tabelo";if(J===null)return"senvalora";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return Q},R94=()=>{let J={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function Q(Y){return J[Y]??null}let Z={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(Y)=>{switch(Y.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${Y.expected}, riceviĝis ${T94(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Nevalida enigo: atendiĝis ${U6(Y.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${m0(Y.values,"|")}`;case"too_big":{let X=Y.inclusive?"<=":"<",G=Q(Y.origin);if(G)return`Tro granda: atendiĝis ke ${Y.origin??"valoro"} havu ${X}${Y.maximum.toString()} ${G.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${Y.origin??"valoro"} havu ${X}${Y.maximum.toString()}`}case"too_small":{let X=Y.inclusive?">=":">",G=Q(Y.origin);if(G)return`Tro malgranda: atendiĝis ke ${Y.origin} havu ${X}${Y.minimum.toString()} ${G.unit}`;return`Tro malgranda: atendiĝis ke ${Y.origin} estu ${X}${Y.minimum.toString()}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${X.prefix}"`;if(X.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${X.suffix}"`;if(X.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${X.includes}"`;if(X.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${X.pattern}`;return`Nevalida ${Z[X.format]??Y.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${Y.divisor}`;case"unrecognized_keys":return`Nekonata${Y.keys.length>1?"j":""} ŝlosilo${Y.keys.length>1?"j":""}: ${m0(Y.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${Y.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${Y.origin}`;default:return"Nevalida enigo"}}};var wH0=B1(()=>{j4()});function rV1(){return{localeError:C94()}}var C94=()=>{let J={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},Q={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function Z(V){return J[V]??null}function Y(V){return Q[V]??V}let X=(V)=>{let K=typeof V;switch(K){case"number":return Number.isNaN(V)?"NaN":"number";case"object":{if(Array.isArray(V))return"array";if(V===null)return"null";if(Object.getPrototypeOf(V)!==Object.prototype)return V.constructor.name;return"object"}}return K},G={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(V)=>{switch(V.code){case"invalid_type":return`Entrada inválida: se esperaba ${Y(V.expected)}, recibido ${Y(X(V.input))}`;case"invalid_value":if(V.values.length===1)return`Entrada inválida: se esperaba ${U6(V.values[0])}`;return`Opción inválida: se esperaba una de ${m0(V.values,"|")}`;case"too_big":{let K=V.inclusive?"<=":"<",q=Z(V.origin),W=Y(V.origin);if(q)return`Demasiado grande: se esperaba que ${W??"valor"} tuviera ${K}${V.maximum.toString()} ${q.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${W??"valor"} fuera ${K}${V.maximum.toString()}`}case"too_small":{let K=V.inclusive?">=":">",q=Z(V.origin),W=Y(V.origin);if(q)return`Demasiado pequeño: se esperaba que ${W} tuviera ${K}${V.minimum.toString()} ${q.unit}`;return`Demasiado pequeño: se esperaba que ${W} fuera ${K}${V.minimum.toString()}`}case"invalid_format":{let K=V;if(K.format==="starts_with")return`Cadena inválida: debe comenzar con "${K.prefix}"`;if(K.format==="ends_with")return`Cadena inválida: debe terminar en "${K.suffix}"`;if(K.format==="includes")return`Cadena inválida: debe incluir "${K.includes}"`;if(K.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${K.pattern}`;return`Inválido ${G[K.format]??V.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${V.divisor}`;case"unrecognized_keys":return`Llave${V.keys.length>1?"s":""} desconocida${V.keys.length>1?"s":""}: ${m0(V.keys,", ")}`;case"invalid_key":return`Llave inválida en ${Y(V.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${Y(V.origin)}`;default:return"Entrada inválida"}}};var EH0=B1(()=>{j4()});function sV1(){return{localeError:j94()}}var j94=()=>{let J={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"عدد";case"object":{if(Array.isArray(X))return"آرایه";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(X)=>{switch(X.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${X.expected} میبود، ${Z(X.input)} دریافت شد`;case"invalid_value":if(X.values.length===1)return`ورودی نامعتبر: میبایست ${U6(X.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${m0(X.values,"|")} میبود`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`خیلی بزرگ: ${X.origin??"مقدار"} باید ${G}${X.maximum.toString()} ${V.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${X.origin??"مقدار"} باید ${G}${X.maximum.toString()} باشد`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`خیلی کوچک: ${X.origin} باید ${G}${X.minimum.toString()} ${V.unit} باشد`;return`خیلی کوچک: ${X.origin} باید ${G}${X.minimum.toString()} باشد`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`رشته نامعتبر: باید با "${G.prefix}" شروع شود`;if(G.format==="ends_with")return`رشته نامعتبر: باید با "${G.suffix}" تمام شود`;if(G.format==="includes")return`رشته نامعتبر: باید شامل "${G.includes}" باشد`;if(G.format==="regex")return`رشته نامعتبر: باید با الگوی ${G.pattern} مطابقت داشته باشد`;return`${Y[G.format]??X.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${X.divisor} باشد`;case"unrecognized_keys":return`کلید${X.keys.length>1?"های":""} ناشناس: ${m0(X.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${X.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${X.origin}`;default:return"ورودی نامعتبر"}}};var IH0=B1(()=>{j4()});function tV1(){return{localeError:S94()}}var S94=()=>{let J={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(X)=>{switch(X.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${X.expected}, oli ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Virheellinen syöte: täytyy olla ${U6(X.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Liian suuri: ${V.subject} täytyy olla ${G}${X.maximum.toString()} ${V.unit}`.trim();return`Liian suuri: arvon täytyy olla ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Liian pieni: ${V.subject} täytyy olla ${G}${X.minimum.toString()} ${V.unit}`.trim();return`Liian pieni: arvon täytyy olla ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${G.prefix}"`;if(G.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${G.suffix}"`;if(G.format==="includes")return`Virheellinen syöte: täytyy sisältää "${G.includes}"`;if(G.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${G.pattern}`;return`Virheellinen ${Y[G.format]??X.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${X.divisor} monikerta`;case"unrecognized_keys":return`${X.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${m0(X.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};var PH0=B1(()=>{j4()});function eV1(){return{localeError:_94()}}var _94=()=>{let J={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"nombre";case"object":{if(Array.isArray(X))return"tableau";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(X)=>{switch(X.code){case"invalid_type":return`Entrée invalide : ${X.expected} attendu, ${Z(X.input)} reçu`;case"invalid_value":if(X.values.length===1)return`Entrée invalide : ${U6(X.values[0])} attendu`;return`Option invalide : une valeur parmi ${m0(X.values,"|")} attendue`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Trop grand : ${X.origin??"valeur"} doit ${V.verb} ${G}${X.maximum.toString()} ${V.unit??"élément(s)"}`;return`Trop grand : ${X.origin??"valeur"} doit être ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Trop petit : ${X.origin} doit ${V.verb} ${G}${X.minimum.toString()} ${V.unit}`;return`Trop petit : ${X.origin} doit être ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Chaîne invalide : doit commencer par "${G.prefix}"`;if(G.format==="ends_with")return`Chaîne invalide : doit se terminer par "${G.suffix}"`;if(G.format==="includes")return`Chaîne invalide : doit inclure "${G.includes}"`;if(G.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${G.pattern}`;return`${Y[G.format]??X.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${X.divisor}`;case"unrecognized_keys":return`Clé${X.keys.length>1?"s":""} non reconnue${X.keys.length>1?"s":""} : ${m0(X.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${X.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${X.origin}`;default:return"Entrée invalide"}}};var TH0=B1(()=>{j4()});function JK1(){return{localeError:k94()}}var k94=()=>{let J={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(X)=>{switch(X.code){case"invalid_type":return`Entrée invalide : attendu ${X.expected}, reçu ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Entrée invalide : attendu ${U6(X.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"≤":"<",V=Q(X.origin);if(V)return`Trop grand : attendu que ${X.origin??"la valeur"} ait ${G}${X.maximum.toString()} ${V.unit}`;return`Trop grand : attendu que ${X.origin??"la valeur"} soit ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?"≥":">",V=Q(X.origin);if(V)return`Trop petit : attendu que ${X.origin} ait ${G}${X.minimum.toString()} ${V.unit}`;return`Trop petit : attendu que ${X.origin} soit ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Chaîne invalide : doit commencer par "${G.prefix}"`;if(G.format==="ends_with")return`Chaîne invalide : doit se terminer par "${G.suffix}"`;if(G.format==="includes")return`Chaîne invalide : doit inclure "${G.includes}"`;if(G.format==="regex")return`Chaîne invalide : doit correspondre au motif ${G.pattern}`;return`${Y[G.format]??X.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${X.divisor}`;case"unrecognized_keys":return`Clé${X.keys.length>1?"s":""} non reconnue${X.keys.length>1?"s":""} : ${m0(X.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${X.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${X.origin}`;default:return"Entrée invalide"}}};var RH0=B1(()=>{j4()});function QK1(){return{localeError:y94()}}var y94=()=>{let J={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},Q={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},Z=(W)=>W?J[W]:void 0,Y=(W)=>{let H=Z(W);if(H)return H.label;return W??J.unknown.label},X=(W)=>`ה${Y(W)}`,G=(W)=>{return(Z(W)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},V=(W)=>{if(!W)return null;return Q[W]??null},K=(W)=>{let H=typeof W;switch(H){case"number":return Number.isNaN(W)?"NaN":"number";case"object":{if(Array.isArray(W))return"array";if(W===null)return"null";if(Object.getPrototypeOf(W)!==Object.prototype&&W.constructor)return W.constructor.name;return"object"}default:return H}},q={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(W)=>{switch(W.code){case"invalid_type":{let H=W.expected,z=Y(H),U=K(W.input),D=J[U]?.label??U;return`קלט לא תקין: צריך להיות ${z}, התקבל ${D}`}case"invalid_value":{if(W.values.length===1)return`ערך לא תקין: הערך חייב להיות ${U6(W.values[0])}`;let H=W.values.map((D)=>U6(D));if(W.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${H[0]} או ${H[1]}`;let z=H[H.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${H.slice(0,-1).join(", ")} או ${z}`}case"too_big":{let H=V(W.origin),z=X(W.origin??"value");if(W.origin==="string")return`${H?.longLabel??"ארוך"} מדי: ${z} צריכה להכיל ${W.maximum.toString()} ${H?.unit??""} ${W.inclusive?"או פחות":"לכל היותר"}`.trim();if(W.origin==="number"){let M=W.inclusive?`קטן או שווה ל-${W.maximum}`:`קטן מ-${W.maximum}`;return`גדול מדי: ${z} צריך להיות ${M}`}if(W.origin==="array"||W.origin==="set"){let M=W.origin==="set"?"צריכה":"צריך",L=W.inclusive?`${W.maximum} ${H?.unit??""} או פחות`:`פחות מ-${W.maximum} ${H?.unit??""}`;return`גדול מדי: ${z} ${M} להכיל ${L}`.trim()}let U=W.inclusive?"<=":"<",D=G(W.origin??"value");if(H?.unit)return`${H.longLabel} מדי: ${z} ${D} ${U}${W.maximum.toString()} ${H.unit}`;return`${H?.longLabel??"גדול"} מדי: ${z} ${D} ${U}${W.maximum.toString()}`}case"too_small":{let H=V(W.origin),z=X(W.origin??"value");if(W.origin==="string")return`${H?.shortLabel??"קצר"} מדי: ${z} צריכה להכיל ${W.minimum.toString()} ${H?.unit??""} ${W.inclusive?"או יותר":"לפחות"}`.trim();if(W.origin==="number"){let M=W.inclusive?`גדול או שווה ל-${W.minimum}`:`גדול מ-${W.minimum}`;return`קטן מדי: ${z} צריך להיות ${M}`}if(W.origin==="array"||W.origin==="set"){let M=W.origin==="set"?"צריכה":"צריך";if(W.minimum===1&&W.inclusive){let A=W.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${z} ${M} להכיל ${A}`}let L=W.inclusive?`${W.minimum} ${H?.unit??""} או יותר`:`יותר מ-${W.minimum} ${H?.unit??""}`;return`קטן מדי: ${z} ${M} להכיל ${L}`.trim()}let U=W.inclusive?">=":">",D=G(W.origin??"value");if(H?.unit)return`${H.shortLabel} מדי: ${z} ${D} ${U}${W.minimum.toString()} ${H.unit}`;return`${H?.shortLabel??"קטן"} מדי: ${z} ${D} ${U}${W.minimum.toString()}`}case"invalid_format":{let H=W;if(H.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${H.prefix}"`;if(H.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${H.suffix}"`;if(H.format==="includes")return`המחרוזת חייבת לכלול "${H.includes}"`;if(H.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${H.pattern}`;let z=q[H.format],U=z?.label??H.format,M=(z?.gender??"m")==="f"?"תקינה":"תקין";return`${U} לא ${M}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${W.divisor}`;case"unrecognized_keys":return`מפתח${W.keys.length>1?"ות":""} לא מזוה${W.keys.length>1?"ים":"ה"}: ${m0(W.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${X(W.origin??"array")}`;default:return"קלט לא תקין"}}};var CH0=B1(()=>{j4()});function ZK1(){return{localeError:x94()}}var x94=()=>{let J={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"szám";case"object":{if(Array.isArray(X))return"tömb";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(X)=>{switch(X.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${X.expected}, a kapott érték ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Érvénytelen bemenet: a várt érték ${U6(X.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Túl nagy: ${X.origin??"érték"} mérete túl nagy ${G}${X.maximum.toString()} ${V.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${X.origin??"érték"} túl nagy: ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Túl kicsi: a bemeneti érték ${X.origin} mérete túl kicsi ${G}${X.minimum.toString()} ${V.unit}`;return`Túl kicsi: a bemeneti érték ${X.origin} túl kicsi ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Érvénytelen string: "${G.prefix}" értékkel kell kezdődnie`;if(G.format==="ends_with")return`Érvénytelen string: "${G.suffix}" értékkel kell végződnie`;if(G.format==="includes")return`Érvénytelen string: "${G.includes}" értéket kell tartalmaznia`;if(G.format==="regex")return`Érvénytelen string: ${G.pattern} mintának kell megfelelnie`;return`Érvénytelen ${Y[G.format]??X.format}`}case"not_multiple_of":return`Érvénytelen szám: ${X.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${X.keys.length>1?"s":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${X.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${X.origin}`;default:return"Érvénytelen bemenet"}}};var jH0=B1(()=>{j4()});function YK1(){return{localeError:v94()}}var v94=()=>{let J={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(X)=>{switch(X.code){case"invalid_type":return`Input tidak valid: diharapkan ${X.expected}, diterima ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Input tidak valid: diharapkan ${U6(X.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Terlalu besar: diharapkan ${X.origin??"value"} memiliki ${G}${X.maximum.toString()} ${V.unit??"elemen"}`;return`Terlalu besar: diharapkan ${X.origin??"value"} menjadi ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Terlalu kecil: diharapkan ${X.origin} memiliki ${G}${X.minimum.toString()} ${V.unit}`;return`Terlalu kecil: diharapkan ${X.origin} menjadi ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`String tidak valid: harus dimulai dengan "${G.prefix}"`;if(G.format==="ends_with")return`String tidak valid: harus berakhir dengan "${G.suffix}"`;if(G.format==="includes")return`String tidak valid: harus menyertakan "${G.includes}"`;if(G.format==="regex")return`String tidak valid: harus sesuai pola ${G.pattern}`;return`${Y[G.format]??X.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${X.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${X.keys.length>1?"s":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${X.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${X.origin}`;default:return"Input tidak valid"}}};var SH0=B1(()=>{j4()});function XK1(){return{localeError:h94()}}var f94=(J)=>{let Q=typeof J;switch(Q){case"number":return Number.isNaN(J)?"NaN":"númer";case"object":{if(Array.isArray(J))return"fylki";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return Q},h94=()=>{let J={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function Q(Y){return J[Y]??null}let Z={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(Y)=>{switch(Y.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${f94(Y.input)} þar sem á að vera ${Y.expected}`;case"invalid_value":if(Y.values.length===1)return`Rangt gildi: gert ráð fyrir ${U6(Y.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${m0(Y.values,"|")}`;case"too_big":{let X=Y.inclusive?"<=":"<",G=Q(Y.origin);if(G)return`Of stórt: gert er ráð fyrir að ${Y.origin??"gildi"} hafi ${X}${Y.maximum.toString()} ${G.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${Y.origin??"gildi"} sé ${X}${Y.maximum.toString()}`}case"too_small":{let X=Y.inclusive?">=":">",G=Q(Y.origin);if(G)return`Of lítið: gert er ráð fyrir að ${Y.origin} hafi ${X}${Y.minimum.toString()} ${G.unit}`;return`Of lítið: gert er ráð fyrir að ${Y.origin} sé ${X}${Y.minimum.toString()}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`Ógildur strengur: verður að byrja á "${X.prefix}"`;if(X.format==="ends_with")return`Ógildur strengur: verður að enda á "${X.suffix}"`;if(X.format==="includes")return`Ógildur strengur: verður að innihalda "${X.includes}"`;if(X.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${X.pattern}`;return`Rangt ${Z[X.format]??Y.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${Y.divisor}`;case"unrecognized_keys":return`Óþekkt ${Y.keys.length>1?"ir lyklar":"ur lykill"}: ${m0(Y.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${Y.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${Y.origin}`;default:return"Rangt gildi"}}};var _H0=B1(()=>{j4()});function $K1(){return{localeError:b94()}}var b94=()=>{let J={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"numero";case"object":{if(Array.isArray(X))return"vettore";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(X)=>{switch(X.code){case"invalid_type":return`Input non valido: atteso ${X.expected}, ricevuto ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Input non valido: atteso ${U6(X.values[0])}`;return`Opzione non valida: atteso uno tra ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Troppo grande: ${X.origin??"valore"} deve avere ${G}${X.maximum.toString()} ${V.unit??"elementi"}`;return`Troppo grande: ${X.origin??"valore"} deve essere ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Troppo piccolo: ${X.origin} deve avere ${G}${X.minimum.toString()} ${V.unit}`;return`Troppo piccolo: ${X.origin} deve essere ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Stringa non valida: deve iniziare con "${G.prefix}"`;if(G.format==="ends_with")return`Stringa non valida: deve terminare con "${G.suffix}"`;if(G.format==="includes")return`Stringa non valida: deve includere "${G.includes}"`;if(G.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${G.pattern}`;return`Invalid ${Y[G.format]??X.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${X.divisor}`;case"unrecognized_keys":return`Chiav${X.keys.length>1?"i":"e"} non riconosciut${X.keys.length>1?"e":"a"}: ${m0(X.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${X.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${X.origin}`;default:return"Input non valido"}}};var kH0=B1(()=>{j4()});function GK1(){return{localeError:m94()}}var m94=()=>{let J={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"数値";case"object":{if(Array.isArray(X))return"配列";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(X)=>{switch(X.code){case"invalid_type":return`無効な入力: ${X.expected}が期待されましたが、${Z(X.input)}が入力されました`;case"invalid_value":if(X.values.length===1)return`無効な入力: ${U6(X.values[0])}が期待されました`;return`無効な選択: ${m0(X.values,"、")}のいずれかである必要があります`;case"too_big":{let G=X.inclusive?"以下である":"より小さい",V=Q(X.origin);if(V)return`大きすぎる値: ${X.origin??"値"}は${X.maximum.toString()}${V.unit??"要素"}${G}必要があります`;return`大きすぎる値: ${X.origin??"値"}は${X.maximum.toString()}${G}必要があります`}case"too_small":{let G=X.inclusive?"以上である":"より大きい",V=Q(X.origin);if(V)return`小さすぎる値: ${X.origin}は${X.minimum.toString()}${V.unit}${G}必要があります`;return`小さすぎる値: ${X.origin}は${X.minimum.toString()}${G}必要があります`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`無効な文字列: "${G.prefix}"で始まる必要があります`;if(G.format==="ends_with")return`無効な文字列: "${G.suffix}"で終わる必要があります`;if(G.format==="includes")return`無効な文字列: "${G.includes}"を含む必要があります`;if(G.format==="regex")return`無効な文字列: パターン${G.pattern}に一致する必要があります`;return`無効な${Y[G.format]??X.format}`}case"not_multiple_of":return`無効な数値: ${X.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${X.keys.length>1?"群":""}: ${m0(X.keys,"、")}`;case"invalid_key":return`${X.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${X.origin}内の無効な値`;default:return"無効な入力"}}};var yH0=B1(()=>{j4()});function VK1(){return{localeError:u94()}}var g94=(J)=>{let Q=typeof J;switch(Q){case"number":return Number.isNaN(J)?"NaN":"რიცხვი";case"object":{if(Array.isArray(J))return"მასივი";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[Q]??Q},u94=()=>{let J={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function Q(Y){return J[Y]??null}let Z={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(Y)=>{switch(Y.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${Y.expected}, მიღებული ${g94(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${U6(Y.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${m0(Y.values,"|")}-დან`;case"too_big":{let X=Y.inclusive?"<=":"<",G=Q(Y.origin);if(G)return`ზედმეტად დიდი: მოსალოდნელი ${Y.origin??"მნიშვნელობა"} ${G.verb} ${X}${Y.maximum.toString()} ${G.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${Y.origin??"მნიშვნელობა"} იყოს ${X}${Y.maximum.toString()}`}case"too_small":{let X=Y.inclusive?">=":">",G=Q(Y.origin);if(G)return`ზედმეტად პატარა: მოსალოდნელი ${Y.origin} ${G.verb} ${X}${Y.minimum.toString()} ${G.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${Y.origin} იყოს ${X}${Y.minimum.toString()}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${X.prefix}"-ით`;if(X.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${X.suffix}"-ით`;if(X.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${X.includes}"-ს`;if(X.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${X.pattern}`;return`არასწორი ${Z[X.format]??Y.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${Y.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${Y.keys.length>1?"ები":"ი"}: ${m0(Y.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${Y.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${Y.origin}-ში`;default:return"არასწორი შეყვანა"}}};var xH0=B1(()=>{j4()});function $k(){return{localeError:p94()}}var p94=()=>{let J={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(X))return"អារេ (Array)";if(X===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(X)=>{switch(X.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${X.expected} ប៉ុន្តែទទួលបាន ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${U6(X.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`ធំពេក៖ ត្រូវការ ${X.origin??"តម្លៃ"} ${G} ${X.maximum.toString()} ${V.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${X.origin??"តម្លៃ"} ${G} ${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`តូចពេក៖ ត្រូវការ ${X.origin} ${G} ${X.minimum.toString()} ${V.unit}`;return`តូចពេក៖ ត្រូវការ ${X.origin} ${G} ${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${G.prefix}"`;if(G.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${G.suffix}"`;if(G.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${G.includes}"`;if(G.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${G.pattern}`;return`មិនត្រឹមត្រូវ៖ ${Y[G.format]??X.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${X.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${m0(X.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${X.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${X.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};var KK1=B1(()=>{j4()});function qK1(){return $k()}var vH0=B1(()=>{KK1()});function WK1(){return{localeError:d94()}}var d94=()=>{let J={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(X)=>{switch(X.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${X.expected}, 받은 타입은 ${Z(X.input)}입니다`;case"invalid_value":if(X.values.length===1)return`잘못된 입력: 값은 ${U6(X.values[0])} 이어야 합니다`;return`잘못된 옵션: ${m0(X.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let G=X.inclusive?"이하":"미만",V=G==="미만"?"이어야 합니다":"여야 합니다",K=Q(X.origin),q=K?.unit??"요소";if(K)return`${X.origin??"값"}이 너무 큽니다: ${X.maximum.toString()}${q} ${G}${V}`;return`${X.origin??"값"}이 너무 큽니다: ${X.maximum.toString()} ${G}${V}`}case"too_small":{let G=X.inclusive?"이상":"초과",V=G==="이상"?"이어야 합니다":"여야 합니다",K=Q(X.origin),q=K?.unit??"요소";if(K)return`${X.origin??"값"}이 너무 작습니다: ${X.minimum.toString()}${q} ${G}${V}`;return`${X.origin??"값"}이 너무 작습니다: ${X.minimum.toString()} ${G}${V}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`잘못된 문자열: "${G.prefix}"(으)로 시작해야 합니다`;if(G.format==="ends_with")return`잘못된 문자열: "${G.suffix}"(으)로 끝나야 합니다`;if(G.format==="includes")return`잘못된 문자열: "${G.includes}"을(를) 포함해야 합니다`;if(G.format==="regex")return`잘못된 문자열: 정규식 ${G.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${Y[G.format]??X.format}`}case"not_multiple_of":return`잘못된 숫자: ${X.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${m0(X.keys,", ")}`;case"invalid_key":return`잘못된 키: ${X.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${X.origin}`;default:return"잘못된 입력"}}};var fH0=B1(()=>{j4()});function hH0(J){let Q=Math.abs(J),Z=Q%10,Y=Q%100;if(Y>=11&&Y<=19||Z===0)return"many";if(Z===1)return"one";return"few"}function HK1(){return{localeError:l94()}}var c94=(J)=>{return Vk(typeof J,J)},Vk=(J,Q=void 0)=>{switch(J){case"number":return Number.isNaN(Q)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(Q===void 0)return"nežinomas objektas";if(Q===null)return"nulinė reikšmė";if(Array.isArray(Q))return"masyvas";if(Object.getPrototypeOf(Q)!==Object.prototype&&Q.constructor)return Q.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return J},Gk=(J)=>{return J.charAt(0).toUpperCase()+J.slice(1)},l94=()=>{let J={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function Q(Y,X,G,V){let K=J[Y]??null;if(K===null)return K;return{unit:K.unit[X],verb:K.verb[V][G?"inclusive":"notInclusive"]}}let Z={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(Y)=>{switch(Y.code){case"invalid_type":return`Gautas tipas ${c94(Y.input)}, o tikėtasi - ${Vk(Y.expected)}`;case"invalid_value":if(Y.values.length===1)return`Privalo būti ${U6(Y.values[0])}`;return`Privalo būti vienas iš ${m0(Y.values,"|")} pasirinkimų`;case"too_big":{let X=Vk(Y.origin),G=Q(Y.origin,hH0(Number(Y.maximum)),Y.inclusive??!1,"smaller");if(G?.verb)return`${Gk(X??Y.origin??"reikšmė")} ${G.verb} ${Y.maximum.toString()} ${G.unit??"elementų"}`;let V=Y.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Gk(X??Y.origin??"reikšmė")} turi būti ${V} ${Y.maximum.toString()} ${G?.unit}`}case"too_small":{let X=Vk(Y.origin),G=Q(Y.origin,hH0(Number(Y.minimum)),Y.inclusive??!1,"bigger");if(G?.verb)return`${Gk(X??Y.origin??"reikšmė")} ${G.verb} ${Y.minimum.toString()} ${G.unit??"elementų"}`;let V=Y.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Gk(X??Y.origin??"reikšmė")} turi būti ${V} ${Y.minimum.toString()} ${G?.unit}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`Eilutė privalo prasidėti "${X.prefix}"`;if(X.format==="ends_with")return`Eilutė privalo pasibaigti "${X.suffix}"`;if(X.format==="includes")return`Eilutė privalo įtraukti "${X.includes}"`;if(X.format==="regex")return`Eilutė privalo atitikti ${X.pattern}`;return`Neteisingas ${Z[X.format]??Y.format}`}case"not_multiple_of":return`Skaičius privalo būti ${Y.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${Y.keys.length>1?"i":"as"} rakt${Y.keys.length>1?"ai":"as"}: ${m0(Y.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let X=Vk(Y.origin);return`${Gk(X??Y.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};var bH0=B1(()=>{j4()});function zK1(){return{localeError:i94()}}var i94=()=>{let J={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"број";case"object":{if(Array.isArray(X))return"низа";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(X)=>{switch(X.code){case"invalid_type":return`Грешен внес: се очекува ${X.expected}, примено ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Invalid input: expected ${U6(X.values[0])}`;return`Грешана опција: се очекува една ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Премногу голем: се очекува ${X.origin??"вредноста"} да има ${G}${X.maximum.toString()} ${V.unit??"елементи"}`;return`Премногу голем: се очекува ${X.origin??"вредноста"} да биде ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Премногу мал: се очекува ${X.origin} да има ${G}${X.minimum.toString()} ${V.unit}`;return`Премногу мал: се очекува ${X.origin} да биде ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Неважечка низа: мора да започнува со "${G.prefix}"`;if(G.format==="ends_with")return`Неважечка низа: мора да завршува со "${G.suffix}"`;if(G.format==="includes")return`Неважечка низа: мора да вклучува "${G.includes}"`;if(G.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${G.pattern}`;return`Invalid ${Y[G.format]??X.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${X.divisor}`;case"unrecognized_keys":return`${X.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${m0(X.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${X.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${X.origin}`;default:return"Грешен внес"}}};var mH0=B1(()=>{j4()});function FK1(){return{localeError:n94()}}var n94=()=>{let J={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"nombor";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(X)=>{switch(X.code){case"invalid_type":return`Input tidak sah: dijangka ${X.expected}, diterima ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Input tidak sah: dijangka ${U6(X.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Terlalu besar: dijangka ${X.origin??"nilai"} ${V.verb} ${G}${X.maximum.toString()} ${V.unit??"elemen"}`;return`Terlalu besar: dijangka ${X.origin??"nilai"} adalah ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Terlalu kecil: dijangka ${X.origin} ${V.verb} ${G}${X.minimum.toString()} ${V.unit}`;return`Terlalu kecil: dijangka ${X.origin} adalah ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`String tidak sah: mesti bermula dengan "${G.prefix}"`;if(G.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${G.suffix}"`;if(G.format==="includes")return`String tidak sah: mesti mengandungi "${G.includes}"`;if(G.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${G.pattern}`;return`${Y[G.format]??X.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${X.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${m0(X.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${X.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${X.origin}`;default:return"Input tidak sah"}}};var gH0=B1(()=>{j4()});function UK1(){return{localeError:a94()}}var a94=()=>{let J={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"getal";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(X)=>{switch(X.code){case"invalid_type":return`Ongeldige invoer: verwacht ${X.expected}, ontving ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Ongeldige invoer: verwacht ${U6(X.values[0])}`;return`Ongeldige optie: verwacht één van ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Te groot: verwacht dat ${X.origin??"waarde"} ${V.verb} ${G}${X.maximum.toString()} ${V.unit??"elementen"}`;return`Te groot: verwacht dat ${X.origin??"waarde"} ${G}${X.maximum.toString()} is`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Te klein: verwacht dat ${X.origin} ${V.verb} ${G}${X.minimum.toString()} ${V.unit}`;return`Te klein: verwacht dat ${X.origin} ${G}${X.minimum.toString()} is`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Ongeldige tekst: moet met "${G.prefix}" beginnen`;if(G.format==="ends_with")return`Ongeldige tekst: moet op "${G.suffix}" eindigen`;if(G.format==="includes")return`Ongeldige tekst: moet "${G.includes}" bevatten`;if(G.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${G.pattern}`;return`Ongeldig: ${Y[G.format]??X.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${X.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${X.keys.length>1?"s":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${X.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${X.origin}`;default:return"Ongeldige invoer"}}};var uH0=B1(()=>{j4()});function BK1(){return{localeError:o94()}}var o94=()=>{let J={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"tall";case"object":{if(Array.isArray(X))return"liste";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(X)=>{switch(X.code){case"invalid_type":return`Ugyldig input: forventet ${X.expected}, fikk ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Ugyldig verdi: forventet ${U6(X.values[0])}`;return`Ugyldig valg: forventet en av ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`For stor(t): forventet ${X.origin??"value"} til å ha ${G}${X.maximum.toString()} ${V.unit??"elementer"}`;return`For stor(t): forventet ${X.origin??"value"} til å ha ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`For lite(n): forventet ${X.origin} til å ha ${G}${X.minimum.toString()} ${V.unit}`;return`For lite(n): forventet ${X.origin} til å ha ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Ugyldig streng: må starte med "${G.prefix}"`;if(G.format==="ends_with")return`Ugyldig streng: må ende med "${G.suffix}"`;if(G.format==="includes")return`Ugyldig streng: må inneholde "${G.includes}"`;if(G.format==="regex")return`Ugyldig streng: må matche mønsteret ${G.pattern}`;return`Ugyldig ${Y[G.format]??X.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${X.divisor}`;case"unrecognized_keys":return`${X.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${m0(X.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${X.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${X.origin}`;default:return"Ugyldig input"}}};var pH0=B1(()=>{j4()});function NK1(){return{localeError:r94()}}var r94=()=>{let J={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"numara";case"object":{if(Array.isArray(X))return"saf";if(X===null)return"gayb";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(X)=>{switch(X.code){case"invalid_type":return`Fâsit giren: umulan ${X.expected}, alınan ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Fâsit giren: umulan ${U6(X.values[0])}`;return`Fâsit tercih: mûteberler ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Fazla büyük: ${X.origin??"value"}, ${G}${X.maximum.toString()} ${V.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${X.origin??"value"}, ${G}${X.maximum.toString()} olmalıydı.`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Fazla küçük: ${X.origin}, ${G}${X.minimum.toString()} ${V.unit} sahip olmalıydı.`;return`Fazla küçük: ${X.origin}, ${G}${X.minimum.toString()} olmalıydı.`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Fâsit metin: "${G.prefix}" ile başlamalı.`;if(G.format==="ends_with")return`Fâsit metin: "${G.suffix}" ile bitmeli.`;if(G.format==="includes")return`Fâsit metin: "${G.includes}" ihtivâ etmeli.`;if(G.format==="regex")return`Fâsit metin: ${G.pattern} nakşına uymalı.`;return`Fâsit ${Y[G.format]??X.format}`}case"not_multiple_of":return`Fâsit sayı: ${X.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${X.keys.length>1?"s":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`${X.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${X.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};var dH0=B1(()=>{j4()});function DK1(){return{localeError:s94()}}var s94=()=>{let J={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"عدد";case"object":{if(Array.isArray(X))return"ارې";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(X)=>{switch(X.code){case"invalid_type":return`ناسم ورودي: باید ${X.expected} وای, مګر ${Z(X.input)} ترلاسه شو`;case"invalid_value":if(X.values.length===1)return`ناسم ورودي: باید ${U6(X.values[0])} وای`;return`ناسم انتخاب: باید یو له ${m0(X.values,"|")} څخه وای`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`ډیر لوی: ${X.origin??"ارزښت"} باید ${G}${X.maximum.toString()} ${V.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${X.origin??"ارزښت"} باید ${G}${X.maximum.toString()} وي`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`ډیر کوچنی: ${X.origin} باید ${G}${X.minimum.toString()} ${V.unit} ولري`;return`ډیر کوچنی: ${X.origin} باید ${G}${X.minimum.toString()} وي`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`ناسم متن: باید د "${G.prefix}" سره پیل شي`;if(G.format==="ends_with")return`ناسم متن: باید د "${G.suffix}" سره پای ته ورسيږي`;if(G.format==="includes")return`ناسم متن: باید "${G.includes}" ولري`;if(G.format==="regex")return`ناسم متن: باید د ${G.pattern} سره مطابقت ولري`;return`${Y[G.format]??X.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${X.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${X.keys.length>1?"کلیډونه":"کلیډ"}: ${m0(X.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${X.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${X.origin} کې`;default:return"ناسمه ورودي"}}};var cH0=B1(()=>{j4()});function MK1(){return{localeError:t94()}}var t94=()=>{let J={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"liczba";case"object":{if(Array.isArray(X))return"tablica";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(X)=>{switch(X.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${X.expected}, otrzymano ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${U6(X.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Za duża wartość: oczekiwano, że ${X.origin??"wartość"} będzie mieć ${G}${X.maximum.toString()} ${V.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${X.origin??"wartość"} będzie wynosić ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Za mała wartość: oczekiwano, że ${X.origin??"wartość"} będzie mieć ${G}${X.minimum.toString()} ${V.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${X.origin??"wartość"} będzie wynosić ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${G.prefix}"`;if(G.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${G.suffix}"`;if(G.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${G.includes}"`;if(G.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${G.pattern}`;return`Nieprawidłow(y/a/e) ${Y[G.format]??X.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${X.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${X.keys.length>1?"s":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${X.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${X.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};var lH0=B1(()=>{j4()});function LK1(){return{localeError:e94()}}var e94=()=>{let J={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"número";case"object":{if(Array.isArray(X))return"array";if(X===null)return"nulo";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(X)=>{switch(X.code){case"invalid_type":return`Tipo inválido: esperado ${X.expected}, recebido ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Entrada inválida: esperado ${U6(X.values[0])}`;return`Opção inválida: esperada uma das ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Muito grande: esperado que ${X.origin??"valor"} tivesse ${G}${X.maximum.toString()} ${V.unit??"elementos"}`;return`Muito grande: esperado que ${X.origin??"valor"} fosse ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Muito pequeno: esperado que ${X.origin} tivesse ${G}${X.minimum.toString()} ${V.unit}`;return`Muito pequeno: esperado que ${X.origin} fosse ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Texto inválido: deve começar com "${G.prefix}"`;if(G.format==="ends_with")return`Texto inválido: deve terminar com "${G.suffix}"`;if(G.format==="includes")return`Texto inválido: deve incluir "${G.includes}"`;if(G.format==="regex")return`Texto inválido: deve corresponder ao padrão ${G.pattern}`;return`${Y[G.format]??X.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${X.divisor}`;case"unrecognized_keys":return`Chave${X.keys.length>1?"s":""} desconhecida${X.keys.length>1?"s":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`Chave inválida em ${X.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${X.origin}`;default:return"Campo inválido"}}};var iH0=B1(()=>{j4()});function nH0(J,Q,Z,Y){let X=Math.abs(J),G=X%10,V=X%100;if(V>=11&&V<=19)return Y;if(G===1)return Q;if(G>=2&&G<=4)return Z;return Y}function AK1(){return{localeError:J54()}}var J54=()=>{let J={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"число";case"object":{if(Array.isArray(X))return"массив";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(X)=>{switch(X.code){case"invalid_type":return`Неверный ввод: ожидалось ${X.expected}, получено ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Неверный ввод: ожидалось ${U6(X.values[0])}`;return`Неверный вариант: ожидалось одно из ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V){let K=Number(X.maximum),q=nH0(K,V.unit.one,V.unit.few,V.unit.many);return`Слишком большое значение: ожидалось, что ${X.origin??"значение"} будет иметь ${G}${X.maximum.toString()} ${q}`}return`Слишком большое значение: ожидалось, что ${X.origin??"значение"} будет ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V){let K=Number(X.minimum),q=nH0(K,V.unit.one,V.unit.few,V.unit.many);return`Слишком маленькое значение: ожидалось, что ${X.origin} будет иметь ${G}${X.minimum.toString()} ${q}`}return`Слишком маленькое значение: ожидалось, что ${X.origin} будет ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Неверная строка: должна начинаться с "${G.prefix}"`;if(G.format==="ends_with")return`Неверная строка: должна заканчиваться на "${G.suffix}"`;if(G.format==="includes")return`Неверная строка: должна содержать "${G.includes}"`;if(G.format==="regex")return`Неверная строка: должна соответствовать шаблону ${G.pattern}`;return`Неверный ${Y[G.format]??X.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${X.divisor}`;case"unrecognized_keys":return`Нераспознанн${X.keys.length>1?"ые":"ый"} ключ${X.keys.length>1?"и":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${X.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${X.origin}`;default:return"Неверные входные данные"}}};var aH0=B1(()=>{j4()});function OK1(){return{localeError:Q54()}}var Q54=()=>{let J={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"število";case"object":{if(Array.isArray(X))return"tabela";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(X)=>{switch(X.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${X.expected}, prejeto ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Neveljaven vnos: pričakovano ${U6(X.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Preveliko: pričakovano, da bo ${X.origin??"vrednost"} imelo ${G}${X.maximum.toString()} ${V.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${X.origin??"vrednost"} ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Premajhno: pričakovano, da bo ${X.origin} imelo ${G}${X.minimum.toString()} ${V.unit}`;return`Premajhno: pričakovano, da bo ${X.origin} ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Neveljaven niz: mora se začeti z "${G.prefix}"`;if(G.format==="ends_with")return`Neveljaven niz: mora se končati z "${G.suffix}"`;if(G.format==="includes")return`Neveljaven niz: mora vsebovati "${G.includes}"`;if(G.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${G.pattern}`;return`Neveljaven ${Y[G.format]??X.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${X.divisor}`;case"unrecognized_keys":return`Neprepoznan${X.keys.length>1?"i ključi":" ključ"}: ${m0(X.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${X.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${X.origin}`;default:return"Neveljaven vnos"}}};var oH0=B1(()=>{j4()});function wK1(){return{localeError:Z54()}}var Z54=()=>{let J={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"antal";case"object":{if(Array.isArray(X))return"lista";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(X)=>{switch(X.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${X.expected}, fick ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Ogiltig inmatning: förväntat ${U6(X.values[0])}`;return`Ogiltigt val: förväntade en av ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`För stor(t): förväntade ${X.origin??"värdet"} att ha ${G}${X.maximum.toString()} ${V.unit??"element"}`;return`För stor(t): förväntat ${X.origin??"värdet"} att ha ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`För lite(t): förväntade ${X.origin??"värdet"} att ha ${G}${X.minimum.toString()} ${V.unit}`;return`För lite(t): förväntade ${X.origin??"värdet"} att ha ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Ogiltig sträng: måste börja med "${G.prefix}"`;if(G.format==="ends_with")return`Ogiltig sträng: måste sluta med "${G.suffix}"`;if(G.format==="includes")return`Ogiltig sträng: måste innehålla "${G.includes}"`;if(G.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${G.pattern}"`;return`Ogiltig(t) ${Y[G.format]??X.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${X.divisor}`;case"unrecognized_keys":return`${X.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${m0(X.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${X.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${X.origin??"värdet"}`;default:return"Ogiltig input"}}};var rH0=B1(()=>{j4()});function EK1(){return{localeError:Y54()}}var Y54=()=>{let J={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(X))return"அணி";if(X===null)return"வெறுமை";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(X)=>{switch(X.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${X.expected}, பெறப்பட்டது ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${U6(X.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${m0(X.values,"|")} இல் ஒன்று`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${X.origin??"மதிப்பு"} ${G}${X.maximum.toString()} ${V.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${X.origin??"மதிப்பு"} ${G}${X.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${X.origin} ${G}${X.minimum.toString()} ${V.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${X.origin} ${G}${X.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`தவறான சரம்: "${G.prefix}" இல் தொடங்க வேண்டும்`;if(G.format==="ends_with")return`தவறான சரம்: "${G.suffix}" இல் முடிவடைய வேண்டும்`;if(G.format==="includes")return`தவறான சரம்: "${G.includes}" ஐ உள்ளடக்க வேண்டும்`;if(G.format==="regex")return`தவறான சரம்: ${G.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${Y[G.format]??X.format}`}case"not_multiple_of":return`தவறான எண்: ${X.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${X.keys.length>1?"கள்":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`${X.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${X.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};var sH0=B1(()=>{j4()});function IK1(){return{localeError:X54()}}var X54=()=>{let J={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(X))return"อาร์เรย์ (Array)";if(X===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(X)=>{switch(X.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${X.expected} แต่ได้รับ ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${U6(X.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"ไม่เกิน":"น้อยกว่า",V=Q(X.origin);if(V)return`เกินกำหนด: ${X.origin??"ค่า"} ควรมี${G} ${X.maximum.toString()} ${V.unit??"รายการ"}`;return`เกินกำหนด: ${X.origin??"ค่า"} ควรมี${G} ${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?"อย่างน้อย":"มากกว่า",V=Q(X.origin);if(V)return`น้อยกว่ากำหนด: ${X.origin} ควรมี${G} ${X.minimum.toString()} ${V.unit}`;return`น้อยกว่ากำหนด: ${X.origin} ควรมี${G} ${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${G.prefix}"`;if(G.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${G.suffix}"`;if(G.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${G.includes}" อยู่ในข้อความ`;if(G.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${G.pattern}`;return`รูปแบบไม่ถูกต้อง: ${Y[G.format]??X.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${X.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${m0(X.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${X.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${X.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};var tH0=B1(()=>{j4()});function PK1(){return{localeError:G54()}}var $54=(J)=>{let Q=typeof J;switch(Q){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return Q},G54=()=>{let J={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function Q(Y){return J[Y]??null}let Z={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(Y)=>{switch(Y.code){case"invalid_type":return`Geçersiz değer: beklenen ${Y.expected}, alınan ${$54(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Geçersiz değer: beklenen ${U6(Y.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${m0(Y.values,"|")}`;case"too_big":{let X=Y.inclusive?"<=":"<",G=Q(Y.origin);if(G)return`Çok büyük: beklenen ${Y.origin??"değer"} ${X}${Y.maximum.toString()} ${G.unit??"öğe"}`;return`Çok büyük: beklenen ${Y.origin??"değer"} ${X}${Y.maximum.toString()}`}case"too_small":{let X=Y.inclusive?">=":">",G=Q(Y.origin);if(G)return`Çok küçük: beklenen ${Y.origin} ${X}${Y.minimum.toString()} ${G.unit}`;return`Çok küçük: beklenen ${Y.origin} ${X}${Y.minimum.toString()}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`Geçersiz metin: "${X.prefix}" ile başlamalı`;if(X.format==="ends_with")return`Geçersiz metin: "${X.suffix}" ile bitmeli`;if(X.format==="includes")return`Geçersiz metin: "${X.includes}" içermeli`;if(X.format==="regex")return`Geçersiz metin: ${X.pattern} desenine uymalı`;return`Geçersiz ${Z[X.format]??Y.format}`}case"not_multiple_of":return`Geçersiz sayı: ${Y.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${Y.keys.length>1?"lar":""}: ${m0(Y.keys,", ")}`;case"invalid_key":return`${Y.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${Y.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};var eH0=B1(()=>{j4()});function Kk(){return{localeError:V54()}}var V54=()=>{let J={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"число";case"object":{if(Array.isArray(X))return"масив";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(X)=>{switch(X.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${X.expected}, отримано ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Неправильні вхідні дані: очікується ${U6(X.values[0])}`;return`Неправильна опція: очікується одне з ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Занадто велике: очікується, що ${X.origin??"значення"} ${V.verb} ${G}${X.maximum.toString()} ${V.unit??"елементів"}`;return`Занадто велике: очікується, що ${X.origin??"значення"} буде ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Занадто мале: очікується, що ${X.origin} ${V.verb} ${G}${X.minimum.toString()} ${V.unit}`;return`Занадто мале: очікується, що ${X.origin} буде ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Неправильний рядок: повинен починатися з "${G.prefix}"`;if(G.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${G.suffix}"`;if(G.format==="includes")return`Неправильний рядок: повинен містити "${G.includes}"`;if(G.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${G.pattern}`;return`Неправильний ${Y[G.format]??X.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${X.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${X.keys.length>1?"і":""}: ${m0(X.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${X.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${X.origin}`;default:return"Неправильні вхідні дані"}}};var TK1=B1(()=>{j4()});function RK1(){return Kk()}var Jz0=B1(()=>{TK1()});function CK1(){return{localeError:K54()}}var K54=()=>{let J={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"نمبر";case"object":{if(Array.isArray(X))return"آرے";if(X===null)return"نل";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(X)=>{switch(X.code){case"invalid_type":return`غلط ان پٹ: ${X.expected} متوقع تھا، ${Z(X.input)} موصول ہوا`;case"invalid_value":if(X.values.length===1)return`غلط ان پٹ: ${U6(X.values[0])} متوقع تھا`;return`غلط آپشن: ${m0(X.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`بہت بڑا: ${X.origin??"ویلیو"} کے ${G}${X.maximum.toString()} ${V.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${X.origin??"ویلیو"} کا ${G}${X.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`بہت چھوٹا: ${X.origin} کے ${G}${X.minimum.toString()} ${V.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${X.origin} کا ${G}${X.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`غلط سٹرنگ: "${G.prefix}" سے شروع ہونا چاہیے`;if(G.format==="ends_with")return`غلط سٹرنگ: "${G.suffix}" پر ختم ہونا چاہیے`;if(G.format==="includes")return`غلط سٹرنگ: "${G.includes}" شامل ہونا چاہیے`;if(G.format==="regex")return`غلط سٹرنگ: پیٹرن ${G.pattern} سے میچ ہونا چاہیے`;return`غلط ${Y[G.format]??X.format}`}case"not_multiple_of":return`غلط نمبر: ${X.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${X.keys.length>1?"ز":""}: ${m0(X.keys,"، ")}`;case"invalid_key":return`${X.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${X.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};var Qz0=B1(()=>{j4()});function jK1(){return{localeError:q54()}}var q54=()=>{let J={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"số";case"object":{if(Array.isArray(X))return"mảng";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(X)=>{switch(X.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${X.expected}, nhận được ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${U6(X.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Quá lớn: mong đợi ${X.origin??"giá trị"} ${V.verb} ${G}${X.maximum.toString()} ${V.unit??"phần tử"}`;return`Quá lớn: mong đợi ${X.origin??"giá trị"} ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Quá nhỏ: mong đợi ${X.origin} ${V.verb} ${G}${X.minimum.toString()} ${V.unit}`;return`Quá nhỏ: mong đợi ${X.origin} ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${G.prefix}"`;if(G.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${G.suffix}"`;if(G.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${G.includes}"`;if(G.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${G.pattern}`;return`${Y[G.format]??X.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${X.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${m0(X.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${X.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${X.origin}`;default:return"Đầu vào không hợp lệ"}}};var Zz0=B1(()=>{j4()});function SK1(){return{localeError:W54()}}var W54=()=>{let J={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(X))return"数组";if(X===null)return"空值(null)";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(X)=>{switch(X.code){case"invalid_type":return`无效输入:期望 ${X.expected},实际接收 ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`无效输入:期望 ${U6(X.values[0])}`;return`无效选项:期望以下之一 ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`数值过大:期望 ${X.origin??"值"} ${G}${X.maximum.toString()} ${V.unit??"个元素"}`;return`数值过大:期望 ${X.origin??"值"} ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`数值过小:期望 ${X.origin} ${G}${X.minimum.toString()} ${V.unit}`;return`数值过小:期望 ${X.origin} ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`无效字符串:必须以 "${G.prefix}" 开头`;if(G.format==="ends_with")return`无效字符串:必须以 "${G.suffix}" 结尾`;if(G.format==="includes")return`无效字符串:必须包含 "${G.includes}"`;if(G.format==="regex")return`无效字符串:必须满足正则表达式 ${G.pattern}`;return`无效${Y[G.format]??X.format}`}case"not_multiple_of":return`无效数字:必须是 ${X.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${m0(X.keys,", ")}`;case"invalid_key":return`${X.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${X.origin} 中包含无效值(value)`;default:return"无效输入"}}};var Yz0=B1(()=>{j4()});function _K1(){return{localeError:H54()}}var H54=()=>{let J={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(X)=>{switch(X.code){case"invalid_type":return`無效的輸入值:預期為 ${X.expected},但收到 ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`無效的輸入值:預期為 ${U6(X.values[0])}`;return`無效的選項:預期為以下其中之一 ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`數值過大:預期 ${X.origin??"值"} 應為 ${G}${X.maximum.toString()} ${V.unit??"個元素"}`;return`數值過大:預期 ${X.origin??"值"} 應為 ${G}${X.maximum.toString()}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`數值過小:預期 ${X.origin} 應為 ${G}${X.minimum.toString()} ${V.unit}`;return`數值過小:預期 ${X.origin} 應為 ${G}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`無效的字串:必須以 "${G.prefix}" 開頭`;if(G.format==="ends_with")return`無效的字串:必須以 "${G.suffix}" 結尾`;if(G.format==="includes")return`無效的字串:必須包含 "${G.includes}"`;if(G.format==="regex")return`無效的字串:必須符合格式 ${G.pattern}`;return`無效的 ${Y[G.format]??X.format}`}case"not_multiple_of":return`無效的數字:必須為 ${X.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${X.keys.length>1?"們":""}:${m0(X.keys,"、")}`;case"invalid_key":return`${X.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${X.origin} 中有無效的值`;default:return"無效的輸入值"}}};var Xz0=B1(()=>{j4()});function kK1(){return{localeError:z54()}}var z54=()=>{let J={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function Q(X){return J[X]??null}let Z=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(X))return"akopọ";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return G},Y={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(X)=>{switch(X.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${X.expected}, àmọ̀ a rí ${Z(X.input)}`;case"invalid_value":if(X.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${U6(X.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${m0(X.values,"|")}`;case"too_big":{let G=X.inclusive?"<=":"<",V=Q(X.origin);if(V)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${X.origin??"iye"} ${V.verb} ${G}${X.maximum} ${V.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${G}${X.maximum}`}case"too_small":{let G=X.inclusive?">=":">",V=Q(X.origin);if(V)return`Kéré ju: a ní láti jẹ́ pé ${X.origin} ${V.verb} ${G}${X.minimum} ${V.unit}`;return`Kéré ju: a ní láti jẹ́ ${G}${X.minimum}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${G.prefix}"`;if(G.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${G.suffix}"`;if(G.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${G.includes}"`;if(G.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${G.pattern}`;return`Aṣìṣe: ${Y[G.format]??X.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${X.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${m0(X.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${X.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${X.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};var $z0=B1(()=>{j4()});var qk={};Q9(qk,{zhTW:()=>_K1,zhCN:()=>SK1,yo:()=>kK1,vi:()=>jK1,ur:()=>CK1,uk:()=>Kk,ua:()=>RK1,tr:()=>PK1,th:()=>IK1,ta:()=>EK1,sv:()=>wK1,sl:()=>OK1,ru:()=>AK1,pt:()=>LK1,ps:()=>DK1,pl:()=>MK1,ota:()=>NK1,no:()=>BK1,nl:()=>UK1,ms:()=>FK1,mk:()=>zK1,lt:()=>HK1,ko:()=>WK1,km:()=>$k,kh:()=>qK1,ka:()=>VK1,ja:()=>GK1,it:()=>$K1,is:()=>XK1,id:()=>YK1,hu:()=>ZK1,he:()=>QK1,frCA:()=>JK1,fr:()=>eV1,fi:()=>tV1,fa:()=>sV1,es:()=>rV1,eo:()=>oV1,en:()=>Xk,de:()=>nV1,da:()=>iV1,cs:()=>lV1,ca:()=>cV1,bg:()=>dV1,be:()=>pV1,az:()=>uV1,ar:()=>gV1});var yK1=B1(()=>{FH0();UH0();NH0();DH0();MH0();LH0();AH0();OH0();aV1();wH0();EH0();IH0();PH0();TH0();RH0();CH0();jH0();SH0();_H0();kH0();yH0();xH0();vH0();KK1();fH0();bH0();mH0();gH0();uH0();pH0();dH0();cH0();lH0();iH0();aH0();oH0();rH0();sH0();tH0();eH0();Jz0();TK1();Qz0();Zz0();Yz0();Xz0();$z0()});class Wk{constructor(){this._map=new WeakMap,this._idmap=new Map}add(J,...Q){let Z=Q[0];if(this._map.set(J,Z),Z&&typeof Z==="object"&&"id"in Z){if(this._idmap.has(Z.id))throw Error(`ID ${Z.id} already exists in the registry`);this._idmap.set(Z.id,J)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(J){let Q=this._map.get(J);if(Q&&typeof Q==="object"&&"id"in Q)this._idmap.delete(Q.id);return this._map.delete(J),this}get(J){let Q=J._zod.parent;if(Q){let Z={...this.get(Q)??{}};delete Z.id;let Y={...Z,...this._map.get(J)};return Object.keys(Y).length?Y:void 0}return this._map.get(J)}has(J){return this._map.has(J)}}function cl(){return new Wk}var Gz0,xK1,vK1,IQ;var ll=B1(()=>{xK1=Symbol("ZodOutput"),vK1=Symbol("ZodInput");(Gz0=globalThis).__zod_globalRegistry??(Gz0.__zod_globalRegistry=cl());IQ=globalThis.__zod_globalRegistry});function fK1(J,Q){return new J({type:"string",...M6(Q)})}function hK1(J,Q){return new J({type:"string",coerce:!0,...M6(Q)})}function il(J,Q){return new J({type:"string",format:"email",check:"string_format",abort:!1,...M6(Q)})}function Hk(J,Q){return new J({type:"string",format:"guid",check:"string_format",abort:!1,...M6(Q)})}function nl(J,Q){return new J({type:"string",format:"uuid",check:"string_format",abort:!1,...M6(Q)})}function al(J,Q){return new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...M6(Q)})}function ol(J,Q){return new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...M6(Q)})}function rl(J,Q){return new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...M6(Q)})}function zk(J,Q){return new J({type:"string",format:"url",check:"string_format",abort:!1,...M6(Q)})}function sl(J,Q){return new J({type:"string",format:"emoji",check:"string_format",abort:!1,...M6(Q)})}function tl(J,Q){return new J({type:"string",format:"nanoid",check:"string_format",abort:!1,...M6(Q)})}function el(J,Q){return new J({type:"string",format:"cuid",check:"string_format",abort:!1,...M6(Q)})}function Ji(J,Q){return new J({type:"string",format:"cuid2",check:"string_format",abort:!1,...M6(Q)})}function Qi(J,Q){return new J({type:"string",format:"ulid",check:"string_format",abort:!1,...M6(Q)})}function Zi(J,Q){return new J({type:"string",format:"xid",check:"string_format",abort:!1,...M6(Q)})}function Yi(J,Q){return new J({type:"string",format:"ksuid",check:"string_format",abort:!1,...M6(Q)})}function Xi(J,Q){return new J({type:"string",format:"ipv4",check:"string_format",abort:!1,...M6(Q)})}function $i(J,Q){return new J({type:"string",format:"ipv6",check:"string_format",abort:!1,...M6(Q)})}function bK1(J,Q){return new J({type:"string",format:"mac",check:"string_format",abort:!1,...M6(Q)})}function Gi(J,Q){return new J({type:"string",format:"cidrv4",check:"string_format",abort:!1,...M6(Q)})}function Vi(J,Q){return new J({type:"string",format:"cidrv6",check:"string_format",abort:!1,...M6(Q)})}function Ki(J,Q){return new J({type:"string",format:"base64",check:"string_format",abort:!1,...M6(Q)})}function qi(J,Q){return new J({type:"string",format:"base64url",check:"string_format",abort:!1,...M6(Q)})}function Wi(J,Q){return new J({type:"string",format:"e164",check:"string_format",abort:!1,...M6(Q)})}function Hi(J,Q){return new J({type:"string",format:"jwt",check:"string_format",abort:!1,...M6(Q)})}function gK1(J,Q){return new J({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...M6(Q)})}function uK1(J,Q){return new J({type:"string",format:"date",check:"string_format",...M6(Q)})}function pK1(J,Q){return new J({type:"string",format:"time",check:"string_format",precision:null,...M6(Q)})}function dK1(J,Q){return new J({type:"string",format:"duration",check:"string_format",...M6(Q)})}function cK1(J,Q){return new J({type:"number",checks:[],...M6(Q)})}function lK1(J,Q){return new J({type:"number",coerce:!0,checks:[],...M6(Q)})}function iK1(J,Q){return new J({type:"number",check:"number_format",abort:!1,format:"safeint",...M6(Q)})}function nK1(J,Q){return new J({type:"number",check:"number_format",abort:!1,format:"float32",...M6(Q)})}function aK1(J,Q){return new J({type:"number",check:"number_format",abort:!1,format:"float64",...M6(Q)})}function oK1(J,Q){return new J({type:"number",check:"number_format",abort:!1,format:"int32",...M6(Q)})}function rK1(J,Q){return new J({type:"number",check:"number_format",abort:!1,format:"uint32",...M6(Q)})}function sK1(J,Q){return new J({type:"boolean",...M6(Q)})}function tK1(J,Q){return new J({type:"boolean",coerce:!0,...M6(Q)})}function eK1(J,Q){return new J({type:"bigint",...M6(Q)})}function Jq1(J,Q){return new J({type:"bigint",coerce:!0,...M6(Q)})}function Qq1(J,Q){return new J({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...M6(Q)})}function Zq1(J,Q){return new J({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...M6(Q)})}function Yq1(J,Q){return new J({type:"symbol",...M6(Q)})}function Xq1(J,Q){return new J({type:"undefined",...M6(Q)})}function $q1(J,Q){return new J({type:"null",...M6(Q)})}function Gq1(J){return new J({type:"any"})}function Vq1(J){return new J({type:"unknown"})}function Kq1(J,Q){return new J({type:"never",...M6(Q)})}function qq1(J,Q){return new J({type:"void",...M6(Q)})}function Wq1(J,Q){return new J({type:"date",...M6(Q)})}function Hq1(J,Q){return new J({type:"date",coerce:!0,...M6(Q)})}function zq1(J,Q){return new J({type:"nan",...M6(Q)})}function kW(J,Q){return new _l({check:"less_than",...M6(Q),value:J,inclusive:!1})}function hX(J,Q){return new _l({check:"less_than",...M6(Q),value:J,inclusive:!0})}function yW(J,Q){return new kl({check:"greater_than",...M6(Q),value:J,inclusive:!1})}function UZ(J,Q){return new kl({check:"greater_than",...M6(Q),value:J,inclusive:!0})}function Fq1(J){return yW(0,J)}function Uq1(J){return kW(0,J)}function Bq1(J){return hX(0,J)}function Nq1(J){return UZ(0,J)}function nD(J,Q){return new WG1({check:"multiple_of",...M6(Q),value:J})}function CE(J,Q){return new FG1({check:"max_size",...M6(Q),maximum:J})}function aD(J,Q){return new UG1({check:"min_size",...M6(Q),minimum:J})}function Fk(J,Q){return new BG1({check:"size_equals",...M6(Q),size:J})}function jE(J,Q){return new NG1({check:"max_length",...M6(Q),maximum:J})}function RF(J,Q){return new DG1({check:"min_length",...M6(Q),minimum:J})}function SE(J,Q){return new MG1({check:"length_equals",...M6(Q),length:J})}function Uk(J,Q){return new LG1({check:"string_format",format:"regex",...M6(Q),pattern:J})}function Bk(J){return new AG1({check:"string_format",format:"lowercase",...M6(J)})}function Nk(J){return new OG1({check:"string_format",format:"uppercase",...M6(J)})}function Dk(J,Q){return new wG1({check:"string_format",format:"includes",...M6(Q),includes:J})}function Mk(J,Q){return new EG1({check:"string_format",format:"starts_with",...M6(Q),prefix:J})}function Lk(J,Q){return new IG1({check:"string_format",format:"ends_with",...M6(Q),suffix:J})}function Dq1(J,Q,Z){return new PG1({check:"property",property:J,schema:Q,...M6(Z)})}function Ak(J,Q){return new TG1({check:"mime_type",mime:J,...M6(Q)})}function MK(J){return new RG1({check:"overwrite",tx:J})}function Ok(J){return MK((Q)=>Q.normalize(J))}function wk(){return MK((J)=>J.trim())}function Ek(){return MK((J)=>J.toLowerCase())}function Ik(){return MK((J)=>J.toUpperCase())}function Pk(){return MK((J)=>I$1(J))}function Mq1(J,Q,Z){return new J({type:"array",element:Q,...M6(Z)})}function U54(J,Q,Z){return new J({type:"union",options:Q,...M6(Z)})}function B54(J,Q,Z,Y){return new J({type:"union",options:Z,discriminator:Q,...M6(Y)})}function N54(J,Q,Z){return new J({type:"intersection",left:Q,right:Z})}function D54(J,Q,Z,Y){let X=Z instanceof Y8;return new J({type:"tuple",items:Q,rest:X?Z:null,...M6(X?Y:Z)})}function M54(J,Q,Z,Y){return new J({type:"record",keyType:Q,valueType:Z,...M6(Y)})}function L54(J,Q,Z,Y){return new J({type:"map",keyType:Q,valueType:Z,...M6(Y)})}function A54(J,Q,Z){return new J({type:"set",valueType:Q,...M6(Z)})}function O54(J,Q,Z){let Y=Array.isArray(Q)?Object.fromEntries(Q.map((X)=>[X,X])):Q;return new J({type:"enum",entries:Y,...M6(Z)})}function w54(J,Q,Z){return new J({type:"enum",entries:Q,...M6(Z)})}function E54(J,Q,Z){return new J({type:"literal",values:Array.isArray(Q)?Q:[Q],...M6(Z)})}function Lq1(J,Q){return new J({type:"file",...M6(Q)})}function I54(J,Q){return new J({type:"transform",transform:Q})}function P54(J,Q){return new J({type:"optional",innerType:Q})}function T54(J,Q){return new J({type:"nullable",innerType:Q})}function R54(J,Q,Z){return new J({type:"default",innerType:Q,get defaultValue(){return typeof Z==="function"?Z():T$1(Z)}})}function C54(J,Q,Z){return new J({type:"nonoptional",innerType:Q,...M6(Z)})}function j54(J,Q){return new J({type:"success",innerType:Q})}function S54(J,Q,Z){return new J({type:"catch",innerType:Q,catchValue:typeof Z==="function"?Z:()=>Z})}function _54(J,Q,Z){return new J({type:"pipe",in:Q,out:Z})}function k54(J,Q){return new J({type:"readonly",innerType:Q})}function y54(J,Q,Z){return new J({type:"template_literal",parts:Q,...M6(Z)})}function x54(J,Q){return new J({type:"lazy",getter:Q})}function v54(J,Q){return new J({type:"promise",innerType:Q})}function Aq1(J,Q,Z){let Y=M6(Z);return Y.abort??(Y.abort=!0),new J({type:"custom",check:"custom",fn:Q,...Y})}function Oq1(J,Q,Z){return new J({type:"custom",check:"custom",fn:Q,...M6(Z)})}function wq1(J){let Q=Vz0((Z)=>{return Z.addIssue=(Y)=>{if(typeof Y==="string")Z.issues.push(OE(Y,Z.value,Q._zod.def));else{let X=Y;if(X.fatal)X.continue=!1;X.code??(X.code="custom"),X.input??(X.input=Z.value),X.inst??(X.inst=Q),X.continue??(X.continue=!Q._zod.def.abort),Z.issues.push(OE(X))}},J(Z.value,Z)});return Q}function Vz0(J,Q){let Z=new T5({check:"custom",...M6(Q)});return Z._zod.check=J,Z}function Eq1(J){let Q=new T5({check:"describe"});return Q._zod.onattach=[(Z)=>{let Y=IQ.get(Z)??{};IQ.add(Z,{...Y,description:J})}],Q._zod.check=()=>{},Q}function Iq1(J){let Q=new T5({check:"meta"});return Q._zod.onattach=[(Z)=>{let Y=IQ.get(Z)??{};IQ.add(Z,{...Y,...J})}],Q._zod.check=()=>{},Q}function Pq1(J,Q){let Z=M6(Q),Y=Z.truthy??["true","1","yes","on","y","enabled"],X=Z.falsy??["false","0","no","off","n","disabled"];if(Z.case!=="sensitive")Y=Y.map((D)=>typeof D==="string"?D.toLowerCase():D),X=X.map((D)=>typeof D==="string"?D.toLowerCase():D);let G=new Set(Y),V=new Set(X),K=J.Codec??Yk,q=J.Boolean??Zk,H=new(J.String??iD)({type:"string",error:Z.error}),z=new q({type:"boolean",error:Z.error}),U=new K({type:"pipe",in:H,out:z,transform:(D,M)=>{let L=D;if(Z.case!=="sensitive")L=L.toLowerCase();if(G.has(L))return!0;else if(V.has(L))return!1;else return M.issues.push({code:"invalid_value",expected:"stringbool",values:[...G,...V],input:M.value,inst:U,continue:!1}),{}},reverseTransform:(D,M)=>{if(D===!0)return Y[0]||"true";else return X[0]||"false"},error:Z.error});return U}function _E(J,Q,Z,Y={}){let X=M6(Y),G={...M6(Y),check:"string_format",type:"string",format:Q,fn:typeof Z==="function"?Z:(K)=>Z.test(K),...X};if(Z instanceof RegExp)G.pattern=Z;return new J(G)}var mK1;var Kz0=B1(()=>{yl();ll();mV1();j4();mK1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});class zi{constructor(J){this.counter=0,this.metadataRegistry=J?.metadata??IQ,this.target=J?.target??"draft-2020-12",this.unrepresentable=J?.unrepresentable??"throw",this.override=J?.override??(()=>{}),this.io=J?.io??"output",this.seen=new Map}process(J,Q={path:[],schemaPath:[]}){var Z;let Y=J._zod.def,X={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},G=this.seen.get(J);if(G){if(G.count++,Q.schemaPath.includes(J))G.cycle=Q.path;return G.schema}let V={schema:{},count:1,cycle:void 0,path:Q.path};this.seen.set(J,V);let K=J._zod.toJSONSchema?.();if(K)V.schema=K;else{let H={...Q,schemaPath:[...Q.schemaPath,J],path:Q.path},z=J._zod.parent;if(z)V.ref=z,this.process(z,H),this.seen.get(z).isParent=!0;else{let U=V.schema;switch(Y.type){case"string":{let D=U;D.type="string";let{minimum:M,maximum:L,format:A,patterns:E,contentEncoding:I}=J._zod.bag;if(typeof M==="number")D.minLength=M;if(typeof L==="number")D.maxLength=L;if(A){if(D.format=X[A]??A,D.format==="")delete D.format}if(I)D.contentEncoding=I;if(E&&E.size>0){let P=[...E];if(P.length===1)D.pattern=P[0].source;else if(P.length>1)V.schema.allOf=[...P.map((R)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:R.source}))]}break}case"number":{let D=U,{minimum:M,maximum:L,format:A,multipleOf:E,exclusiveMaximum:I,exclusiveMinimum:P}=J._zod.bag;if(typeof A==="string"&&A.includes("int"))D.type="integer";else D.type="number";if(typeof P==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")D.minimum=P,D.exclusiveMinimum=!0;else D.exclusiveMinimum=P;if(typeof M==="number"){if(D.minimum=M,typeof P==="number"&&this.target!=="draft-4")if(P>=M)delete D.minimum;else delete D.exclusiveMinimum}if(typeof I==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")D.maximum=I,D.exclusiveMaximum=!0;else D.exclusiveMaximum=I;if(typeof L==="number"){if(D.maximum=L,typeof I==="number"&&this.target!=="draft-4")if(I<=L)delete D.maximum;else delete D.exclusiveMaximum}if(typeof E==="number")D.multipleOf=E;break}case"boolean":{let D=U;D.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{U.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let D=U,{minimum:M,maximum:L}=J._zod.bag;if(typeof M==="number")D.minItems=M;if(typeof L==="number")D.maxItems=L;D.type="array",D.items=this.process(Y.element,{...H,path:[...H.path,"items"]});break}case"object":{let D=U;D.type="object",D.properties={};let M=Y.shape;for(let E in M)D.properties[E]=this.process(M[E],{...H,path:[...H.path,"properties",E]});let L=new Set(Object.keys(M)),A=new Set([...L].filter((E)=>{let I=Y.shape[E]._zod;if(this.io==="input")return I.optin===void 0;else return I.optout===void 0}));if(A.size>0)D.required=Array.from(A);if(Y.catchall?._zod.def.type==="never")D.additionalProperties=!1;else if(!Y.catchall){if(this.io==="output")D.additionalProperties=!1}else if(Y.catchall)D.additionalProperties=this.process(Y.catchall,{...H,path:[...H.path,"additionalProperties"]});break}case"union":{let D=U,M=Y.discriminator!==void 0,L=Y.options.map((A,E)=>this.process(A,{...H,path:[...H.path,M?"oneOf":"anyOf",E]}));if(M)D.oneOf=L;else D.anyOf=L;break}case"intersection":{let D=U,M=this.process(Y.left,{...H,path:[...H.path,"allOf",0]}),L=this.process(Y.right,{...H,path:[...H.path,"allOf",1]}),A=(I)=>("allOf"in I)&&Object.keys(I).length===1,E=[...A(M)?M.allOf:[M],...A(L)?L.allOf:[L]];D.allOf=E;break}case"tuple":{let D=U;D.type="array";let M=this.target==="draft-2020-12"?"prefixItems":"items",L=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",A=Y.items.map((R,y)=>this.process(R,{...H,path:[...H.path,M,y]})),E=Y.rest?this.process(Y.rest,{...H,path:[...H.path,L,...this.target==="openapi-3.0"?[Y.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(D.prefixItems=A,E)D.items=E}else if(this.target==="openapi-3.0"){if(D.items={anyOf:A},E)D.items.anyOf.push(E);if(D.minItems=A.length,!E)D.maxItems=A.length}else if(D.items=A,E)D.additionalItems=E;let{minimum:I,maximum:P}=J._zod.bag;if(typeof I==="number")D.minItems=I;if(typeof P==="number")D.maxItems=P;break}case"record":{let D=U;if(D.type="object",this.target==="draft-7"||this.target==="draft-2020-12")D.propertyNames=this.process(Y.keyType,{...H,path:[...H.path,"propertyNames"]});D.additionalProperties=this.process(Y.valueType,{...H,path:[...H.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let D=U,M=d_(Y.entries);if(M.every((L)=>typeof L==="number"))D.type="number";if(M.every((L)=>typeof L==="string"))D.type="string";D.enum=M;break}case"literal":{let D=U,M=[];for(let L of Y.values)if(L===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof L==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else M.push(Number(L));else M.push(L);if(M.length===0);else if(M.length===1){let L=M[0];if(D.type=L===null?"null":typeof L,this.target==="draft-4"||this.target==="openapi-3.0")D.enum=[L];else D.const=L}else{if(M.every((L)=>typeof L==="number"))D.type="number";if(M.every((L)=>typeof L==="string"))D.type="string";if(M.every((L)=>typeof L==="boolean"))D.type="string";if(M.every((L)=>L===null))D.type="null";D.enum=M}break}case"file":{let D=U,M={type:"string",format:"binary",contentEncoding:"binary"},{minimum:L,maximum:A,mime:E}=J._zod.bag;if(L!==void 0)M.minLength=L;if(A!==void 0)M.maxLength=A;if(E)if(E.length===1)M.contentMediaType=E[0],Object.assign(D,M);else D.anyOf=E.map((I)=>{return{...M,contentMediaType:I}});else Object.assign(D,M);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let D=this.process(Y.innerType,H);if(this.target==="openapi-3.0")V.ref=Y.innerType,U.nullable=!0;else U.anyOf=[D,{type:"null"}];break}case"nonoptional":{this.process(Y.innerType,H),V.ref=Y.innerType;break}case"success":{let D=U;D.type="boolean";break}case"default":{this.process(Y.innerType,H),V.ref=Y.innerType,U.default=JSON.parse(JSON.stringify(Y.defaultValue));break}case"prefault":{if(this.process(Y.innerType,H),V.ref=Y.innerType,this.io==="input")U._prefault=JSON.parse(JSON.stringify(Y.defaultValue));break}case"catch":{this.process(Y.innerType,H),V.ref=Y.innerType;let D;try{D=Y.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=D;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let D=U,M=J._zod.pattern;if(!M)throw Error("Pattern not found in template literal");D.type="string",D.pattern=M.source;break}case"pipe":{let D=this.io==="input"?Y.in._zod.def.type==="transform"?Y.out:Y.in:Y.out;this.process(D,H),V.ref=D;break}case"readonly":{this.process(Y.innerType,H),V.ref=Y.innerType,U.readOnly=!0;break}case"promise":{this.process(Y.innerType,H),V.ref=Y.innerType;break}case"optional":{this.process(Y.innerType,H),V.ref=Y.innerType;break}case"lazy":{let D=J._zod.innerType;this.process(D,H),V.ref=D;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let q=this.metadataRegistry.get(J);if(q)Object.assign(V.schema,q);if(this.io==="input"&&PQ(J))delete V.schema.examples,delete V.schema.default;if(this.io==="input"&&V.schema._prefault)(Z=V.schema).default??(Z.default=V.schema._prefault);return delete V.schema._prefault,this.seen.get(J).schema}emit(J,Q){let Z={cycles:Q?.cycles??"ref",reused:Q?.reused??"inline",external:Q?.external??void 0},Y=this.seen.get(J);if(!Y)throw Error("Unprocessed schema. This is a bug in Zod.");let X=(W)=>{let H=this.target==="draft-2020-12"?"$defs":"definitions";if(Z.external){let M=Z.external.registry.get(W[0])?.id,L=Z.external.uri??((E)=>E);if(M)return{ref:L(M)};let A=W[1].defId??W[1].schema.id??`schema${this.counter++}`;return W[1].defId=A,{defId:A,ref:`${L("__shared")}#/${H}/${A}`}}if(W[1]===Y)return{ref:"#"};let U=`${"#"}/${H}/`,D=W[1].schema.id??`__schema${this.counter++}`;return{defId:D,ref:U+D}},G=(W)=>{if(W[1].schema.$ref)return;let H=W[1],{ref:z,defId:U}=X(W);if(H.def={...H.schema},U)H.defId=U;let D=H.schema;for(let M in D)delete D[M];D.$ref=z};if(Z.cycles==="throw")for(let W of this.seen.entries()){let H=W[1];if(H.cycle)throw Error(`Cycle detected: #/${H.cycle?.join("/")}/<root>
|
|
69
69
|
|
|
70
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let W of this.seen.entries()){let H=W[1];if(J===W[0]){G(W);continue}if(Z.external){let U=Z.external.registry.get(W[0])?.id;if(J!==W[0]&&U){G(W);continue}}if(this.metadataRegistry.get(W[0])?.id){G(W);continue}if(H.cycle){G(W);continue}if(H.count>1){if(Z.reused==="ref"){G(W);continue}}}let V=(W,H)=>{let z=this.seen.get(W),U=z.def??z.schema,D={...U};if(z.ref===null)return;let M=z.ref;if(z.ref=null,M){V(M,H);let L=this.seen.get(M).schema;if(L.$ref&&(H.target==="draft-7"||H.target==="draft-4"||H.target==="openapi-3.0"))U.allOf=U.allOf??[],U.allOf.push(L);else Object.assign(U,L),Object.assign(U,D)}if(!z.isParent)this.override({zodSchema:W,jsonSchema:U,path:z.path??[]})};for(let W of[...this.seen.entries()].reverse())V(W[0],{target:this.target});let K={};if(this.target==="draft-2020-12")K.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")K.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")K.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(Z.external?.uri){let W=Z.external.registry.get(J)?.id;if(!W)throw Error("Schema is missing an `id` property");K.$id=Z.external.uri(W)}Object.assign(K,Y.def);let q=Z.external?.defs??{};for(let W of this.seen.entries()){let H=W[1];if(H.def&&H.defId)q[H.defId]=H.def}if(Z.external);else if(Object.keys(q).length>0)if(this.target==="draft-2020-12")K.$defs=q;else K.definitions=q;try{return JSON.parse(JSON.stringify(K))}catch(W){throw Error("Error converting schema to JSON.")}}}function Tq1(J,Q){if(J instanceof Wk){let Y=new zi(Q),X={};for(let K of J._idmap.entries()){let[q,W]=K;Y.process(W)}let G={},V={registry:J,uri:Q?.uri,defs:X};for(let K of J._idmap.entries()){let[q,W]=K;G[q]=Y.emit(W,{...Q,external:V})}if(Object.keys(X).length>0){let K=Y.target==="draft-2020-12"?"$defs":"definitions";G.__shared={[K]:X}}return{schemas:G}}let Z=new zi(Q);return Z.process(J),Z.emit(J,Q)}function PQ(J,Q){let Z=Q??{seen:new Set};if(Z.seen.has(J))return!1;Z.seen.add(J);let Y=J._zod.def;if(Y.type==="transform")return!0;if(Y.type==="array")return PQ(Y.element,Z);if(Y.type==="set")return PQ(Y.valueType,Z);if(Y.type==="lazy")return PQ(Y.getter(),Z);if(Y.type==="promise"||Y.type==="optional"||Y.type==="nonoptional"||Y.type==="nullable"||Y.type==="readonly"||Y.type==="default"||Y.type==="prefault")return PQ(Y.innerType,Z);if(Y.type==="intersection")return PQ(Y.left,Z)||PQ(Y.right,Z);if(Y.type==="record"||Y.type==="map")return PQ(Y.keyType,Z)||PQ(Y.valueType,Z);if(Y.type==="pipe")return PQ(Y.in,Z)||PQ(Y.out,Z);if(Y.type==="object"){for(let X in Y.shape)if(PQ(Y.shape[X],Z))return!0;return!1}if(Y.type==="union"){for(let X of Y.options)if(PQ(X,Z))return!0;return!1}if(Y.type==="tuple"){for(let X of Y.items)if(PQ(X,Z))return!0;if(Y.rest&&PQ(Y.rest,Z))return!0;return!1}return!1}var qz0=B1(()=>{ll();j4()});var Wz0={};var Hz0=()=>{};var xW={};Q9(xW,{version:()=>CG1,util:()=>L6,treeifyError:()=>_$1,toJSONSchema:()=>Tq1,toDotPath:()=>hW0,safeParseAsync:()=>e_,safeParse:()=>PE,safeEncodeAsync:()=>cW0,safeEncode:()=>pW0,safeDecodeAsync:()=>lW0,safeDecode:()=>dW0,registry:()=>cl,regexes:()=>fX,prettifyError:()=>k$1,parseAsync:()=>t_,parse:()=>s_,meta:()=>Iq1,locales:()=>qk,isValidJWT:()=>qH0,isValidBase64URL:()=>KH0,isValidBase64:()=>sG1,globalRegistry:()=>IQ,globalConfig:()=>g_,formatError:()=>r_,flattenError:()=>o_,encodeAsync:()=>gW0,encode:()=>bW0,describe:()=>Eq1,decodeAsync:()=>uW0,decode:()=>mW0,config:()=>_3,clone:()=>EQ,_xid:()=>Zi,_void:()=>qq1,_uuidv7:()=>rl,_uuidv6:()=>ol,_uuidv4:()=>al,_uuid:()=>nl,_url:()=>zk,_uppercase:()=>Nk,_unknown:()=>Vq1,_union:()=>U54,_undefined:()=>Xq1,_ulid:()=>Qi,_uint64:()=>Zq1,_uint32:()=>rK1,_tuple:()=>D54,_trim:()=>wk,_transform:()=>I54,_toUpperCase:()=>Ik,_toLowerCase:()=>Ek,_templateLiteral:()=>y54,_symbol:()=>Yq1,_superRefine:()=>wq1,_success:()=>j54,_stringbool:()=>Pq1,_stringFormat:()=>_E,_string:()=>fK1,_startsWith:()=>Mk,_slugify:()=>Pk,_size:()=>Fk,_set:()=>A54,_safeParseAsync:()=>TE,_safeParse:()=>IE,_safeEncodeAsync:()=>Rl,_safeEncode:()=>Pl,_safeDecodeAsync:()=>Cl,_safeDecode:()=>Tl,_regex:()=>Uk,_refine:()=>Oq1,_record:()=>M54,_readonly:()=>k54,_property:()=>Dq1,_promise:()=>v54,_positive:()=>Fq1,_pipe:()=>_54,_parseAsync:()=>EE,_parse:()=>wE,_overwrite:()=>MK,_optional:()=>P54,_number:()=>cK1,_nullable:()=>T54,_null:()=>$q1,_normalize:()=>Ok,_nonpositive:()=>Bq1,_nonoptional:()=>C54,_nonnegative:()=>Nq1,_never:()=>Kq1,_negative:()=>Uq1,_nativeEnum:()=>w54,_nanoid:()=>tl,_nan:()=>zq1,_multipleOf:()=>nD,_minSize:()=>aD,_minLength:()=>RF,_min:()=>UZ,_mime:()=>Ak,_maxSize:()=>CE,_maxLength:()=>jE,_max:()=>hX,_map:()=>L54,_mac:()=>bK1,_lte:()=>hX,_lt:()=>kW,_lowercase:()=>Bk,_literal:()=>E54,_length:()=>SE,_lazy:()=>x54,_ksuid:()=>Yi,_jwt:()=>Hi,_isoTime:()=>pK1,_isoDuration:()=>dK1,_isoDateTime:()=>gK1,_isoDate:()=>uK1,_ipv6:()=>$i,_ipv4:()=>Xi,_intersection:()=>N54,_int64:()=>Qq1,_int32:()=>oK1,_int:()=>iK1,_includes:()=>Dk,_guid:()=>Hk,_gte:()=>UZ,_gt:()=>yW,_float64:()=>aK1,_float32:()=>nK1,_file:()=>Lq1,_enum:()=>O54,_endsWith:()=>Lk,_encodeAsync:()=>El,_encode:()=>Ol,_emoji:()=>sl,_email:()=>il,_e164:()=>Wi,_discriminatedUnion:()=>B54,_default:()=>R54,_decodeAsync:()=>Il,_decode:()=>wl,_date:()=>Wq1,_custom:()=>Aq1,_cuid2:()=>Ji,_cuid:()=>el,_coercedString:()=>hK1,_coercedNumber:()=>lK1,_coercedDate:()=>Hq1,_coercedBoolean:()=>tK1,_coercedBigint:()=>Jq1,_cidrv6:()=>Vi,_cidrv4:()=>Gi,_check:()=>Vz0,_catch:()=>S54,_boolean:()=>sK1,_bigint:()=>eK1,_base64url:()=>qi,_base64:()=>Ki,_array:()=>Mq1,_any:()=>Gq1,TimePrecision:()=>mK1,NEVER:()=>u_,JSONSchemaGenerator:()=>zi,JSONSchema:()=>Wz0,Doc:()=>xl,$output:()=>xK1,$input:()=>vK1,$constructor:()=>B0,$brand:()=>O$1,$ZodXID:()=>gG1,$ZodVoid:()=>HV1,$ZodUnknown:()=>qV1,$ZodUnion:()=>pl,$ZodUndefined:()=>GV1,$ZodUUID:()=>kG1,$ZodURL:()=>xG1,$ZodULID:()=>mG1,$ZodType:()=>Y8,$ZodTuple:()=>dl,$ZodTransform:()=>EV1,$ZodTemplateLiteral:()=>xV1,$ZodSymbol:()=>$V1,$ZodSuccess:()=>jV1,$ZodStringFormat:()=>D5,$ZodString:()=>iD,$ZodSet:()=>LV1,$ZodRegistry:()=>Wk,$ZodRecord:()=>DV1,$ZodRealError:()=>FZ,$ZodReadonly:()=>yV1,$ZodPromise:()=>fV1,$ZodPrefault:()=>RV1,$ZodPipe:()=>kV1,$ZodOptional:()=>IV1,$ZodObjectJIT:()=>UV1,$ZodObject:()=>zH0,$ZodNumberFormat:()=>YV1,$ZodNumber:()=>gl,$ZodNullable:()=>PV1,$ZodNull:()=>VV1,$ZodNonOptional:()=>CV1,$ZodNever:()=>WV1,$ZodNanoID:()=>fG1,$ZodNaN:()=>_V1,$ZodMap:()=>MV1,$ZodMAC:()=>aG1,$ZodLiteral:()=>OV1,$ZodLazy:()=>hV1,$ZodKSUID:()=>uG1,$ZodJWT:()=>QV1,$ZodIntersection:()=>NV1,$ZodISOTime:()=>cG1,$ZodISODuration:()=>lG1,$ZodISODateTime:()=>pG1,$ZodISODate:()=>dG1,$ZodIPv6:()=>nG1,$ZodIPv4:()=>iG1,$ZodGUID:()=>_G1,$ZodFunction:()=>vV1,$ZodFile:()=>wV1,$ZodError:()=>a_,$ZodEnum:()=>AV1,$ZodEncodeError:()=>dD,$ZodEmoji:()=>vG1,$ZodEmail:()=>yG1,$ZodE164:()=>JV1,$ZodDiscriminatedUnion:()=>BV1,$ZodDefault:()=>TV1,$ZodDate:()=>zV1,$ZodCustomStringFormat:()=>ZV1,$ZodCustom:()=>bV1,$ZodCodec:()=>Yk,$ZodCheckUpperCase:()=>OG1,$ZodCheckStringFormat:()=>RE,$ZodCheckStartsWith:()=>EG1,$ZodCheckSizeEquals:()=>BG1,$ZodCheckRegex:()=>LG1,$ZodCheckProperty:()=>PG1,$ZodCheckOverwrite:()=>RG1,$ZodCheckNumberFormat:()=>HG1,$ZodCheckMultipleOf:()=>WG1,$ZodCheckMinSize:()=>UG1,$ZodCheckMinLength:()=>DG1,$ZodCheckMimeType:()=>TG1,$ZodCheckMaxSize:()=>FG1,$ZodCheckMaxLength:()=>NG1,$ZodCheckLowerCase:()=>AG1,$ZodCheckLessThan:()=>_l,$ZodCheckLengthEquals:()=>MG1,$ZodCheckIncludes:()=>wG1,$ZodCheckGreaterThan:()=>kl,$ZodCheckEndsWith:()=>IG1,$ZodCheckBigIntFormat:()=>zG1,$ZodCheck:()=>T5,$ZodCatch:()=>SV1,$ZodCUID2:()=>bG1,$ZodCUID:()=>hG1,$ZodCIDRv6:()=>rG1,$ZodCIDRv4:()=>oG1,$ZodBoolean:()=>Zk,$ZodBigIntFormat:()=>XV1,$ZodBigInt:()=>ul,$ZodBase64URL:()=>eG1,$ZodBase64:()=>tG1,$ZodAsyncError:()=>DK,$ZodArray:()=>FV1,$ZodAny:()=>KV1});var BZ=B1(()=>{j4();Sl();yK1();Hz0();ME();x$1();y$1();mV1();yl();jG1();ll();Kz0();qz0()});var Rq1=B1(()=>{BZ()});var Di={};Q9(Di,{time:()=>Sq1,duration:()=>_q1,datetime:()=>Cq1,date:()=>jq1,ZodISOTime:()=>Bi,ZodISODuration:()=>Ni,ZodISODateTime:()=>Fi,ZodISODate:()=>Ui});function Cq1(J){return gK1(Fi,J)}function jq1(J){return uK1(Ui,J)}function Sq1(J){return pK1(Bi,J)}function _q1(J){return dK1(Ni,J)}var Fi,Ui,Bi,Ni;var Mi=B1(()=>{BZ();Li();Fi=B0("ZodISODateTime",(J,Q)=>{pG1.init(J,Q),R5.init(J,Q)});Ui=B0("ZodISODate",(J,Q)=>{dG1.init(J,Q),R5.init(J,Q)});Bi=B0("ZodISOTime",(J,Q)=>{cG1.init(J,Q),R5.init(J,Q)});Ni=B0("ZodISODuration",(J,Q)=>{lG1.init(J,Q),R5.init(J,Q)})});var Fz0=(J,Q)=>{a_.init(J,Q),J.name="ZodError",Object.defineProperties(J,{format:{value:(Z)=>r_(J,Z)},flatten:{value:(Z)=>o_(J,Z)},addIssue:{value:(Z)=>{J.issues.push(Z),J.message=JSON.stringify(J.issues,LE,2)}},addIssues:{value:(Z)=>{J.issues.push(...Z),J.message=JSON.stringify(J.issues,LE,2)}},isEmpty:{get(){return J.issues.length===0}}})},h54,NZ;var kq1=B1(()=>{BZ();BZ();j4();h54=B0("ZodError",Fz0),NZ=B0("ZodError",Fz0,{Parent:Error})});var yq1,xq1,vq1,fq1,hq1,bq1,mq1,gq1,uq1,pq1,dq1,cq1;var lq1=B1(()=>{BZ();kq1();yq1=wE(NZ),xq1=EE(NZ),vq1=IE(NZ),fq1=TE(NZ),hq1=Ol(NZ),bq1=wl(NZ),mq1=El(NZ),gq1=Il(NZ),uq1=Pl(NZ),pq1=Tl(NZ),dq1=Rl(NZ),cq1=Cl(NZ)});function Z0(J){return fK1(Rk,J)}function m54(J){return il(aq1,J)}function g54(J){return Hk(Ai,J)}function u54(J){return nl(vW,J)}function p54(J){return al(vW,J)}function d54(J){return ol(vW,J)}function c54(J){return rl(vW,J)}function oq1(J){return zk(Ei,J)}function l54(J){return zk(Ei,{protocol:/^https?$/,hostname:fX.domain,...L6.normalizeParams(J)})}function i54(J){return sl(rq1,J)}function n54(J){return tl(sq1,J)}function a54(J){return el(tq1,J)}function o54(J){return Ji(eq1,J)}function r54(J){return Qi(JW1,J)}function s54(J){return Zi(QW1,J)}function t54(J){return Yi(ZW1,J)}function e54(J){return Xi(YW1,J)}function J74(J){return bK1(Uz0,J)}function Q74(J){return $i(XW1,J)}function Z74(J){return Gi($W1,J)}function Y74(J){return Vi(GW1,J)}function X74(J){return Ki(VW1,J)}function $74(J){return qi(KW1,J)}function G74(J){return Wi(qW1,J)}function V74(J){return Hi(WW1,J)}function K74(J,Q,Z={}){return _E(Ck,J,Q,Z)}function q74(J){return _E(Ck,"hostname",fX.hostname,J)}function W74(J){return _E(Ck,"hex",fX.hex,J)}function H74(J,Q){let Z=Q?.enc??"hex",Y=`${J}_${Z}`,X=fX[Y];if(!X)throw Error(`Unrecognized hash format: ${Y}`);return _E(Ck,Y,X,Q)}function c9(J){return cK1(jk,J)}function iq1(J){return iK1(kE,J)}function z74(J){return nK1(kE,J)}function F74(J){return aK1(kE,J)}function U74(J){return oK1(kE,J)}function B74(J){return rK1(kE,J)}function M5(J){return sK1(Sk,J)}function N74(J){return eK1(_k,J)}function D74(J){return Qq1(HW1,J)}function M74(J){return Zq1(HW1,J)}function L74(J){return Yq1(Bz0,J)}function A74(J){return Xq1(Nz0,J)}function kk(J){return $q1(Dz0,J)}function zW1(){return Gq1(Mz0)}function P7(){return Vq1(Lz0)}function FW1(J){return Kq1(Az0,J)}function O74(J){return qq1(Oz0,J)}function w74(J){return Wq1(Ii,J)}function v6(J,Q){return Mq1(wz0,J,Q)}function E74(J){let Q=J._zod.def.shape;return M2(Object.keys(Q))}function D6(J,Q){let Z={type:"object",shape:J??{},...L6.normalizeParams(Q)};return new Pi(Z)}function I74(J,Q){return new Pi({type:"object",shape:J,catchall:FW1(),...L6.normalizeParams(Q)})}function a2(J,Q){return new Pi({type:"object",shape:J,catchall:P7(),...L6.normalizeParams(Q)})}function C5(J,Q){return new UW1({type:"union",options:J,...L6.normalizeParams(Q)})}function Ti(J,Q,Z){return new Ez0({type:"union",options:Q,discriminator:J,...L6.normalizeParams(Z)})}function yk(J,Q){return new Iz0({type:"intersection",left:J,right:Q})}function Tz0(J,Q,Z){let Y=Q instanceof Y8,X=Y?Z:Q;return new Pz0({type:"tuple",items:J,rest:Y?Q:null,...L6.normalizeParams(X)})}function f7(J,Q,Z){return new BW1({type:"record",keyType:J,valueType:Q,...L6.normalizeParams(Z)})}function P74(J,Q,Z){let Y=EQ(J);return Y._zod.values=void 0,new BW1({type:"record",keyType:Y,valueType:Q,...L6.normalizeParams(Z)})}function T74(J,Q,Z){return new Rz0({type:"map",keyType:J,valueType:Q,...L6.normalizeParams(Z)})}function R74(J,Q){return new Cz0({type:"set",valueType:J,...L6.normalizeParams(Q)})}function M2(J,Q){let Z=Array.isArray(J)?Object.fromEntries(J.map((Y)=>[Y,Y])):J;return new Tk({type:"enum",entries:Z,...L6.normalizeParams(Q)})}function C74(J,Q){return new Tk({type:"enum",entries:J,...L6.normalizeParams(Q)})}function N4(J,Q){return new jz0({type:"literal",values:Array.isArray(J)?J:[J],...L6.normalizeParams(Q)})}function j74(J){return Lq1(Sz0,J)}function NW1(J){return new _z0({type:"transform",transform:J})}function L4(J){return new DW1({type:"optional",innerType:J})}function Oi(J){return new kz0({type:"nullable",innerType:J})}function S74(J){return L4(Oi(J))}function xz0(J,Q){return new yz0({type:"default",innerType:J,get defaultValue(){return typeof Q==="function"?Q():L6.shallowClone(Q)}})}function fz0(J,Q){return new vz0({type:"prefault",innerType:J,get defaultValue(){return typeof Q==="function"?Q():L6.shallowClone(Q)}})}function hz0(J,Q){return new MW1({type:"nonoptional",innerType:J,...L6.normalizeParams(Q)})}function _74(J){return new bz0({type:"success",innerType:J})}function gz0(J,Q){return new mz0({type:"catch",innerType:J,catchValue:typeof Q==="function"?Q:()=>Q})}function k74(J){return zq1(uz0,J)}function wi(J,Q){return new LW1({type:"pipe",in:J,out:Q})}function y74(J,Q,Z){return new AW1({type:"pipe",in:J,out:Q,transform:Z.decode,reverseTransform:Z.encode})}function dz0(J){return new pz0({type:"readonly",innerType:J})}function x74(J,Q){return new cz0({type:"template_literal",parts:J,...L6.normalizeParams(Q)})}function iz0(J){return new lz0({type:"lazy",getter:J})}function v74(J){return new nz0({type:"promise",innerType:J})}function f74(J){return new az0({type:"function",input:Array.isArray(J?.input)?Tz0(J?.input):J?.input??v6(P7()),output:J?.output??P7()})}function h74(J){let Q=new T5({check:"custom"});return Q._zod.check=J,Q}function OW1(J,Q){return Aq1(Ri,J??(()=>!0),Q)}function oz0(J,Q={}){return Oq1(Ri,J,Q)}function rz0(J){return wq1(J)}function g74(J,Q={error:`Input not instance of ${J.name}`}){let Z=new Ri({type:"custom",check:"custom",fn:(Y)=>Y instanceof J,abort:!0,...L6.normalizeParams(Q)});return Z._zod.bag.Class=J,Z}function p74(J){let Q=iz0(()=>{return C5([Z0(J),c9(),M5(),kk(),v6(Q),f7(Z0(),Q)])});return Q}function Ci(J,Q){return wi(NW1(J),Q)}var x8,nq1,Rk,R5,aq1,Ai,vW,Ei,rq1,sq1,tq1,eq1,JW1,QW1,ZW1,YW1,Uz0,XW1,$W1,GW1,VW1,KW1,qW1,WW1,Ck,jk,kE,Sk,_k,HW1,Bz0,Nz0,Dz0,Mz0,Lz0,Az0,Oz0,Ii,wz0,Pi,UW1,Ez0,Iz0,Pz0,BW1,Rz0,Cz0,Tk,jz0,Sz0,_z0,DW1,kz0,yz0,vz0,MW1,bz0,mz0,uz0,LW1,AW1,pz0,cz0,lz0,nz0,az0,Ri,b74,m74,u74=(...J)=>Pq1({Codec:AW1,Boolean:Sk,String:Rk},...J);var Li=B1(()=>{BZ();BZ();Rq1();Mi();lq1();x8=B0("ZodType",(J,Q)=>{return Y8.init(J,Q),J.def=Q,J.type=Q.type,Object.defineProperty(J,"_def",{value:Q}),J.check=(...Z)=>{return J.clone(L6.mergeDefs(Q,{checks:[...Q.checks??[],...Z.map((Y)=>typeof Y==="function"?{_zod:{check:Y,def:{check:"custom"},onattach:[]}}:Y)]}))},J.clone=(Z,Y)=>EQ(J,Z,Y),J.brand=()=>J,J.register=(Z,Y)=>{return Z.add(J,Y),J},J.parse=(Z,Y)=>yq1(J,Z,Y,{callee:J.parse}),J.safeParse=(Z,Y)=>vq1(J,Z,Y),J.parseAsync=async(Z,Y)=>xq1(J,Z,Y,{callee:J.parseAsync}),J.safeParseAsync=async(Z,Y)=>fq1(J,Z,Y),J.spa=J.safeParseAsync,J.encode=(Z,Y)=>hq1(J,Z,Y),J.decode=(Z,Y)=>bq1(J,Z,Y),J.encodeAsync=async(Z,Y)=>mq1(J,Z,Y),J.decodeAsync=async(Z,Y)=>gq1(J,Z,Y),J.safeEncode=(Z,Y)=>uq1(J,Z,Y),J.safeDecode=(Z,Y)=>pq1(J,Z,Y),J.safeEncodeAsync=async(Z,Y)=>dq1(J,Z,Y),J.safeDecodeAsync=async(Z,Y)=>cq1(J,Z,Y),J.refine=(Z,Y)=>J.check(oz0(Z,Y)),J.superRefine=(Z)=>J.check(rz0(Z)),J.overwrite=(Z)=>J.check(MK(Z)),J.optional=()=>L4(J),J.nullable=()=>Oi(J),J.nullish=()=>L4(Oi(J)),J.nonoptional=(Z)=>hz0(J,Z),J.array=()=>v6(J),J.or=(Z)=>C5([J,Z]),J.and=(Z)=>yk(J,Z),J.transform=(Z)=>wi(J,NW1(Z)),J.default=(Z)=>xz0(J,Z),J.prefault=(Z)=>fz0(J,Z),J.catch=(Z)=>gz0(J,Z),J.pipe=(Z)=>wi(J,Z),J.readonly=()=>dz0(J),J.describe=(Z)=>{let Y=J.clone();return IQ.add(Y,{description:Z}),Y},Object.defineProperty(J,"description",{get(){return IQ.get(J)?.description},configurable:!0}),J.meta=(...Z)=>{if(Z.length===0)return IQ.get(J);let Y=J.clone();return IQ.add(Y,Z[0]),Y},J.isOptional=()=>J.safeParse(void 0).success,J.isNullable=()=>J.safeParse(null).success,J}),nq1=B0("_ZodString",(J,Q)=>{iD.init(J,Q),x8.init(J,Q);let Z=J._zod.bag;J.format=Z.format??null,J.minLength=Z.minimum??null,J.maxLength=Z.maximum??null,J.regex=(...Y)=>J.check(Uk(...Y)),J.includes=(...Y)=>J.check(Dk(...Y)),J.startsWith=(...Y)=>J.check(Mk(...Y)),J.endsWith=(...Y)=>J.check(Lk(...Y)),J.min=(...Y)=>J.check(RF(...Y)),J.max=(...Y)=>J.check(jE(...Y)),J.length=(...Y)=>J.check(SE(...Y)),J.nonempty=(...Y)=>J.check(RF(1,...Y)),J.lowercase=(Y)=>J.check(Bk(Y)),J.uppercase=(Y)=>J.check(Nk(Y)),J.trim=()=>J.check(wk()),J.normalize=(...Y)=>J.check(Ok(...Y)),J.toLowerCase=()=>J.check(Ek()),J.toUpperCase=()=>J.check(Ik()),J.slugify=()=>J.check(Pk())}),Rk=B0("ZodString",(J,Q)=>{iD.init(J,Q),nq1.init(J,Q),J.email=(Z)=>J.check(il(aq1,Z)),J.url=(Z)=>J.check(zk(Ei,Z)),J.jwt=(Z)=>J.check(Hi(WW1,Z)),J.emoji=(Z)=>J.check(sl(rq1,Z)),J.guid=(Z)=>J.check(Hk(Ai,Z)),J.uuid=(Z)=>J.check(nl(vW,Z)),J.uuidv4=(Z)=>J.check(al(vW,Z)),J.uuidv6=(Z)=>J.check(ol(vW,Z)),J.uuidv7=(Z)=>J.check(rl(vW,Z)),J.nanoid=(Z)=>J.check(tl(sq1,Z)),J.guid=(Z)=>J.check(Hk(Ai,Z)),J.cuid=(Z)=>J.check(el(tq1,Z)),J.cuid2=(Z)=>J.check(Ji(eq1,Z)),J.ulid=(Z)=>J.check(Qi(JW1,Z)),J.base64=(Z)=>J.check(Ki(VW1,Z)),J.base64url=(Z)=>J.check(qi(KW1,Z)),J.xid=(Z)=>J.check(Zi(QW1,Z)),J.ksuid=(Z)=>J.check(Yi(ZW1,Z)),J.ipv4=(Z)=>J.check(Xi(YW1,Z)),J.ipv6=(Z)=>J.check($i(XW1,Z)),J.cidrv4=(Z)=>J.check(Gi($W1,Z)),J.cidrv6=(Z)=>J.check(Vi(GW1,Z)),J.e164=(Z)=>J.check(Wi(qW1,Z)),J.datetime=(Z)=>J.check(Cq1(Z)),J.date=(Z)=>J.check(jq1(Z)),J.time=(Z)=>J.check(Sq1(Z)),J.duration=(Z)=>J.check(_q1(Z))});R5=B0("ZodStringFormat",(J,Q)=>{D5.init(J,Q),nq1.init(J,Q)}),aq1=B0("ZodEmail",(J,Q)=>{yG1.init(J,Q),R5.init(J,Q)});Ai=B0("ZodGUID",(J,Q)=>{_G1.init(J,Q),R5.init(J,Q)});vW=B0("ZodUUID",(J,Q)=>{kG1.init(J,Q),R5.init(J,Q)});Ei=B0("ZodURL",(J,Q)=>{xG1.init(J,Q),R5.init(J,Q)});rq1=B0("ZodEmoji",(J,Q)=>{vG1.init(J,Q),R5.init(J,Q)});sq1=B0("ZodNanoID",(J,Q)=>{fG1.init(J,Q),R5.init(J,Q)});tq1=B0("ZodCUID",(J,Q)=>{hG1.init(J,Q),R5.init(J,Q)});eq1=B0("ZodCUID2",(J,Q)=>{bG1.init(J,Q),R5.init(J,Q)});JW1=B0("ZodULID",(J,Q)=>{mG1.init(J,Q),R5.init(J,Q)});QW1=B0("ZodXID",(J,Q)=>{gG1.init(J,Q),R5.init(J,Q)});ZW1=B0("ZodKSUID",(J,Q)=>{uG1.init(J,Q),R5.init(J,Q)});YW1=B0("ZodIPv4",(J,Q)=>{iG1.init(J,Q),R5.init(J,Q)});Uz0=B0("ZodMAC",(J,Q)=>{aG1.init(J,Q),R5.init(J,Q)});XW1=B0("ZodIPv6",(J,Q)=>{nG1.init(J,Q),R5.init(J,Q)});$W1=B0("ZodCIDRv4",(J,Q)=>{oG1.init(J,Q),R5.init(J,Q)});GW1=B0("ZodCIDRv6",(J,Q)=>{rG1.init(J,Q),R5.init(J,Q)});VW1=B0("ZodBase64",(J,Q)=>{tG1.init(J,Q),R5.init(J,Q)});KW1=B0("ZodBase64URL",(J,Q)=>{eG1.init(J,Q),R5.init(J,Q)});qW1=B0("ZodE164",(J,Q)=>{JV1.init(J,Q),R5.init(J,Q)});WW1=B0("ZodJWT",(J,Q)=>{QV1.init(J,Q),R5.init(J,Q)});Ck=B0("ZodCustomStringFormat",(J,Q)=>{ZV1.init(J,Q),R5.init(J,Q)});jk=B0("ZodNumber",(J,Q)=>{gl.init(J,Q),x8.init(J,Q),J.gt=(Y,X)=>J.check(yW(Y,X)),J.gte=(Y,X)=>J.check(UZ(Y,X)),J.min=(Y,X)=>J.check(UZ(Y,X)),J.lt=(Y,X)=>J.check(kW(Y,X)),J.lte=(Y,X)=>J.check(hX(Y,X)),J.max=(Y,X)=>J.check(hX(Y,X)),J.int=(Y)=>J.check(iq1(Y)),J.safe=(Y)=>J.check(iq1(Y)),J.positive=(Y)=>J.check(yW(0,Y)),J.nonnegative=(Y)=>J.check(UZ(0,Y)),J.negative=(Y)=>J.check(kW(0,Y)),J.nonpositive=(Y)=>J.check(hX(0,Y)),J.multipleOf=(Y,X)=>J.check(nD(Y,X)),J.step=(Y,X)=>J.check(nD(Y,X)),J.finite=()=>J;let Z=J._zod.bag;J.minValue=Math.max(Z.minimum??Number.NEGATIVE_INFINITY,Z.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,J.maxValue=Math.min(Z.maximum??Number.POSITIVE_INFINITY,Z.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,J.isInt=(Z.format??"").includes("int")||Number.isSafeInteger(Z.multipleOf??0.5),J.isFinite=!0,J.format=Z.format??null});kE=B0("ZodNumberFormat",(J,Q)=>{YV1.init(J,Q),jk.init(J,Q)});Sk=B0("ZodBoolean",(J,Q)=>{Zk.init(J,Q),x8.init(J,Q)});_k=B0("ZodBigInt",(J,Q)=>{ul.init(J,Q),x8.init(J,Q),J.gte=(Y,X)=>J.check(UZ(Y,X)),J.min=(Y,X)=>J.check(UZ(Y,X)),J.gt=(Y,X)=>J.check(yW(Y,X)),J.gte=(Y,X)=>J.check(UZ(Y,X)),J.min=(Y,X)=>J.check(UZ(Y,X)),J.lt=(Y,X)=>J.check(kW(Y,X)),J.lte=(Y,X)=>J.check(hX(Y,X)),J.max=(Y,X)=>J.check(hX(Y,X)),J.positive=(Y)=>J.check(yW(BigInt(0),Y)),J.negative=(Y)=>J.check(kW(BigInt(0),Y)),J.nonpositive=(Y)=>J.check(hX(BigInt(0),Y)),J.nonnegative=(Y)=>J.check(UZ(BigInt(0),Y)),J.multipleOf=(Y,X)=>J.check(nD(Y,X));let Z=J._zod.bag;J.minValue=Z.minimum??null,J.maxValue=Z.maximum??null,J.format=Z.format??null});HW1=B0("ZodBigIntFormat",(J,Q)=>{XV1.init(J,Q),_k.init(J,Q)});Bz0=B0("ZodSymbol",(J,Q)=>{$V1.init(J,Q),x8.init(J,Q)});Nz0=B0("ZodUndefined",(J,Q)=>{GV1.init(J,Q),x8.init(J,Q)});Dz0=B0("ZodNull",(J,Q)=>{VV1.init(J,Q),x8.init(J,Q)});Mz0=B0("ZodAny",(J,Q)=>{KV1.init(J,Q),x8.init(J,Q)});Lz0=B0("ZodUnknown",(J,Q)=>{qV1.init(J,Q),x8.init(J,Q)});Az0=B0("ZodNever",(J,Q)=>{WV1.init(J,Q),x8.init(J,Q)});Oz0=B0("ZodVoid",(J,Q)=>{HV1.init(J,Q),x8.init(J,Q)});Ii=B0("ZodDate",(J,Q)=>{zV1.init(J,Q),x8.init(J,Q),J.min=(Y,X)=>J.check(UZ(Y,X)),J.max=(Y,X)=>J.check(hX(Y,X));let Z=J._zod.bag;J.minDate=Z.minimum?new Date(Z.minimum):null,J.maxDate=Z.maximum?new Date(Z.maximum):null});wz0=B0("ZodArray",(J,Q)=>{FV1.init(J,Q),x8.init(J,Q),J.element=Q.element,J.min=(Z,Y)=>J.check(RF(Z,Y)),J.nonempty=(Z)=>J.check(RF(1,Z)),J.max=(Z,Y)=>J.check(jE(Z,Y)),J.length=(Z,Y)=>J.check(SE(Z,Y)),J.unwrap=()=>J.element});Pi=B0("ZodObject",(J,Q)=>{UV1.init(J,Q),x8.init(J,Q),L6.defineLazy(J,"shape",()=>{return Q.shape}),J.keyof=()=>M2(Object.keys(J._zod.def.shape)),J.catchall=(Z)=>J.clone({...J._zod.def,catchall:Z}),J.passthrough=()=>J.clone({...J._zod.def,catchall:P7()}),J.loose=()=>J.clone({...J._zod.def,catchall:P7()}),J.strict=()=>J.clone({...J._zod.def,catchall:FW1()}),J.strip=()=>J.clone({...J._zod.def,catchall:void 0}),J.extend=(Z)=>{return L6.extend(J,Z)},J.safeExtend=(Z)=>{return L6.safeExtend(J,Z)},J.merge=(Z)=>L6.merge(J,Z),J.pick=(Z)=>L6.pick(J,Z),J.omit=(Z)=>L6.omit(J,Z),J.partial=(...Z)=>L6.partial(DW1,J,Z[0]),J.required=(...Z)=>L6.required(MW1,J,Z[0])});UW1=B0("ZodUnion",(J,Q)=>{pl.init(J,Q),x8.init(J,Q),J.options=Q.options});Ez0=B0("ZodDiscriminatedUnion",(J,Q)=>{UW1.init(J,Q),BV1.init(J,Q)});Iz0=B0("ZodIntersection",(J,Q)=>{NV1.init(J,Q),x8.init(J,Q)});Pz0=B0("ZodTuple",(J,Q)=>{dl.init(J,Q),x8.init(J,Q),J.rest=(Z)=>J.clone({...J._zod.def,rest:Z})});BW1=B0("ZodRecord",(J,Q)=>{DV1.init(J,Q),x8.init(J,Q),J.keyType=Q.keyType,J.valueType=Q.valueType});Rz0=B0("ZodMap",(J,Q)=>{MV1.init(J,Q),x8.init(J,Q),J.keyType=Q.keyType,J.valueType=Q.valueType});Cz0=B0("ZodSet",(J,Q)=>{LV1.init(J,Q),x8.init(J,Q),J.min=(...Z)=>J.check(aD(...Z)),J.nonempty=(Z)=>J.check(aD(1,Z)),J.max=(...Z)=>J.check(CE(...Z)),J.size=(...Z)=>J.check(Fk(...Z))});Tk=B0("ZodEnum",(J,Q)=>{AV1.init(J,Q),x8.init(J,Q),J.enum=Q.entries,J.options=Object.values(Q.entries);let Z=new Set(Object.keys(Q.entries));J.extract=(Y,X)=>{let G={};for(let V of Y)if(Z.has(V))G[V]=Q.entries[V];else throw Error(`Key ${V} not found in enum`);return new Tk({...Q,checks:[],...L6.normalizeParams(X),entries:G})},J.exclude=(Y,X)=>{let G={...Q.entries};for(let V of Y)if(Z.has(V))delete G[V];else throw Error(`Key ${V} not found in enum`);return new Tk({...Q,checks:[],...L6.normalizeParams(X),entries:G})}});jz0=B0("ZodLiteral",(J,Q)=>{OV1.init(J,Q),x8.init(J,Q),J.values=new Set(Q.values),Object.defineProperty(J,"value",{get(){if(Q.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return Q.values[0]}})});Sz0=B0("ZodFile",(J,Q)=>{wV1.init(J,Q),x8.init(J,Q),J.min=(Z,Y)=>J.check(aD(Z,Y)),J.max=(Z,Y)=>J.check(CE(Z,Y)),J.mime=(Z,Y)=>J.check(Ak(Array.isArray(Z)?Z:[Z],Y))});_z0=B0("ZodTransform",(J,Q)=>{EV1.init(J,Q),x8.init(J,Q),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward")throw new dD(J.constructor.name);Z.addIssue=(G)=>{if(typeof G==="string")Z.issues.push(L6.issue(G,Z.value,Q));else{let V=G;if(V.fatal)V.continue=!1;V.code??(V.code="custom"),V.input??(V.input=Z.value),V.inst??(V.inst=J),Z.issues.push(L6.issue(V))}};let X=Q.transform(Z.value,Z);if(X instanceof Promise)return X.then((G)=>{return Z.value=G,Z});return Z.value=X,Z}});DW1=B0("ZodOptional",(J,Q)=>{IV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});kz0=B0("ZodNullable",(J,Q)=>{PV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});yz0=B0("ZodDefault",(J,Q)=>{TV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType,J.removeDefault=J.unwrap});vz0=B0("ZodPrefault",(J,Q)=>{RV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});MW1=B0("ZodNonOptional",(J,Q)=>{CV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});bz0=B0("ZodSuccess",(J,Q)=>{jV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});mz0=B0("ZodCatch",(J,Q)=>{SV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType,J.removeCatch=J.unwrap});uz0=B0("ZodNaN",(J,Q)=>{_V1.init(J,Q),x8.init(J,Q)});LW1=B0("ZodPipe",(J,Q)=>{kV1.init(J,Q),x8.init(J,Q),J.in=Q.in,J.out=Q.out});AW1=B0("ZodCodec",(J,Q)=>{LW1.init(J,Q),Yk.init(J,Q)});pz0=B0("ZodReadonly",(J,Q)=>{yV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});cz0=B0("ZodTemplateLiteral",(J,Q)=>{xV1.init(J,Q),x8.init(J,Q)});lz0=B0("ZodLazy",(J,Q)=>{hV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.getter()});nz0=B0("ZodPromise",(J,Q)=>{fV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});az0=B0("ZodFunction",(J,Q)=>{vV1.init(J,Q),x8.init(J,Q)});Ri=B0("ZodCustom",(J,Q)=>{bV1.init(J,Q),x8.init(J,Q)});b74=Eq1,m74=Iq1});function d74(J){_3({customError:J})}function c74(){return _3().customError}var EW1,wW1;var sz0=B1(()=>{BZ();EW1={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function(J){})(wW1||(wW1={}))});var xk={};Q9(xk,{string:()=>l74,number:()=>i74,date:()=>o74,boolean:()=>n74,bigint:()=>a74});function l74(J){return hK1(Rk,J)}function i74(J){return lK1(jk,J)}function n74(J){return tK1(Sk,J)}function a74(J){return Jq1(_k,J)}function o74(J){return Hq1(Ii,J)}var tz0=B1(()=>{BZ();Li()});var V0={};Q9(V0,{xid:()=>s54,void:()=>O74,uuidv7:()=>c54,uuidv6:()=>d54,uuidv4:()=>p54,uuid:()=>u54,util:()=>L6,url:()=>oq1,uppercase:()=>Nk,unknown:()=>P7,union:()=>C5,undefined:()=>A74,ulid:()=>r54,uint64:()=>M74,uint32:()=>B74,tuple:()=>Tz0,trim:()=>wk,treeifyError:()=>_$1,transform:()=>NW1,toUpperCase:()=>Ik,toLowerCase:()=>Ek,toJSONSchema:()=>Tq1,templateLiteral:()=>x74,symbol:()=>L74,superRefine:()=>rz0,success:()=>_74,stringbool:()=>u74,stringFormat:()=>K74,string:()=>Z0,strictObject:()=>I74,startsWith:()=>Mk,slugify:()=>Pk,size:()=>Fk,setErrorMap:()=>d74,set:()=>R74,safeParseAsync:()=>fq1,safeParse:()=>vq1,safeEncodeAsync:()=>dq1,safeEncode:()=>uq1,safeDecodeAsync:()=>cq1,safeDecode:()=>pq1,registry:()=>cl,regexes:()=>fX,regex:()=>Uk,refine:()=>oz0,record:()=>f7,readonly:()=>dz0,property:()=>Dq1,promise:()=>v74,prettifyError:()=>k$1,preprocess:()=>Ci,prefault:()=>fz0,positive:()=>Fq1,pipe:()=>wi,partialRecord:()=>P74,parseAsync:()=>xq1,parse:()=>yq1,overwrite:()=>MK,optional:()=>L4,object:()=>D6,number:()=>c9,nullish:()=>S74,nullable:()=>Oi,null:()=>kk,normalize:()=>Ok,nonpositive:()=>Bq1,nonoptional:()=>hz0,nonnegative:()=>Nq1,never:()=>FW1,negative:()=>Uq1,nativeEnum:()=>C74,nanoid:()=>n54,nan:()=>k74,multipleOf:()=>nD,minSize:()=>aD,minLength:()=>RF,mime:()=>Ak,meta:()=>m74,maxSize:()=>CE,maxLength:()=>jE,map:()=>T74,mac:()=>J74,lte:()=>hX,lt:()=>kW,lowercase:()=>Bk,looseObject:()=>a2,locales:()=>qk,literal:()=>N4,length:()=>SE,lazy:()=>iz0,ksuid:()=>t54,keyof:()=>E74,jwt:()=>V74,json:()=>p74,iso:()=>Di,ipv6:()=>Q74,ipv4:()=>e54,intersection:()=>yk,int64:()=>D74,int32:()=>U74,int:()=>iq1,instanceof:()=>g74,includes:()=>Dk,httpUrl:()=>l54,hostname:()=>q74,hex:()=>W74,hash:()=>H74,guid:()=>g54,gte:()=>UZ,gt:()=>yW,globalRegistry:()=>IQ,getErrorMap:()=>c74,function:()=>f74,formatError:()=>r_,float64:()=>F74,float32:()=>z74,flattenError:()=>o_,file:()=>j74,enum:()=>M2,endsWith:()=>Lk,encodeAsync:()=>mq1,encode:()=>hq1,emoji:()=>i54,email:()=>m54,e164:()=>G74,discriminatedUnion:()=>Ti,describe:()=>b74,decodeAsync:()=>gq1,decode:()=>bq1,date:()=>w74,custom:()=>OW1,cuid2:()=>o54,cuid:()=>a54,core:()=>xW,config:()=>_3,coerce:()=>xk,codec:()=>y74,clone:()=>EQ,cidrv6:()=>Y74,cidrv4:()=>Z74,check:()=>h74,catch:()=>gz0,boolean:()=>M5,bigint:()=>N74,base64url:()=>$74,base64:()=>X74,array:()=>v6,any:()=>zW1,_function:()=>f74,_default:()=>xz0,_ZodString:()=>nq1,ZodXID:()=>QW1,ZodVoid:()=>Oz0,ZodUnknown:()=>Lz0,ZodUnion:()=>UW1,ZodUndefined:()=>Nz0,ZodUUID:()=>vW,ZodURL:()=>Ei,ZodULID:()=>JW1,ZodType:()=>x8,ZodTuple:()=>Pz0,ZodTransform:()=>_z0,ZodTemplateLiteral:()=>cz0,ZodSymbol:()=>Bz0,ZodSuccess:()=>bz0,ZodStringFormat:()=>R5,ZodString:()=>Rk,ZodSet:()=>Cz0,ZodRecord:()=>BW1,ZodRealError:()=>NZ,ZodReadonly:()=>pz0,ZodPromise:()=>nz0,ZodPrefault:()=>vz0,ZodPipe:()=>LW1,ZodOptional:()=>DW1,ZodObject:()=>Pi,ZodNumberFormat:()=>kE,ZodNumber:()=>jk,ZodNullable:()=>kz0,ZodNull:()=>Dz0,ZodNonOptional:()=>MW1,ZodNever:()=>Az0,ZodNanoID:()=>sq1,ZodNaN:()=>uz0,ZodMap:()=>Rz0,ZodMAC:()=>Uz0,ZodLiteral:()=>jz0,ZodLazy:()=>lz0,ZodKSUID:()=>ZW1,ZodJWT:()=>WW1,ZodIssueCode:()=>EW1,ZodIntersection:()=>Iz0,ZodISOTime:()=>Bi,ZodISODuration:()=>Ni,ZodISODateTime:()=>Fi,ZodISODate:()=>Ui,ZodIPv6:()=>XW1,ZodIPv4:()=>YW1,ZodGUID:()=>Ai,ZodFunction:()=>az0,ZodFirstPartyTypeKind:()=>wW1,ZodFile:()=>Sz0,ZodError:()=>h54,ZodEnum:()=>Tk,ZodEmoji:()=>rq1,ZodEmail:()=>aq1,ZodE164:()=>qW1,ZodDiscriminatedUnion:()=>Ez0,ZodDefault:()=>yz0,ZodDate:()=>Ii,ZodCustomStringFormat:()=>Ck,ZodCustom:()=>Ri,ZodCodec:()=>AW1,ZodCatch:()=>mz0,ZodCUID2:()=>eq1,ZodCUID:()=>tq1,ZodCIDRv6:()=>GW1,ZodCIDRv4:()=>$W1,ZodBoolean:()=>Sk,ZodBigIntFormat:()=>HW1,ZodBigInt:()=>_k,ZodBase64URL:()=>KW1,ZodBase64:()=>VW1,ZodArray:()=>wz0,ZodAny:()=>Mz0,TimePrecision:()=>mK1,NEVER:()=>u_,$output:()=>xK1,$input:()=>vK1,$brand:()=>O$1});var vk=B1(()=>{BZ();BZ();aV1();BZ();yK1();Mi();Mi();tz0();Li();Rq1();kq1();lq1();sz0();_3(Xk())});var IW1=B1(()=>{vk();vk()});function L2(J,Q){let Z=t74(J,Q);return typeof Z==="string"?Z:Z.toString()}function t74(J,Q,Z=!0){if(!Q)Q=e74();let{workspaceFolders:Y,isWindows:X,homeDir:G}=Q,V=typeof J==="string"?h0.parse(J):h0.from(J);if(Y)for(let K of Y){let q=m4(K);if(n0.hasPrefix(V,q)){let W=q.path.endsWith("/")?q.path.slice(0,-1):q.path,z=Z&&Y&&Y.length>=2?mD(q.path)+(X?"\\":"/"):"";return TW1(z+V.path.slice(W.length+1),X,V.scheme)}}if(V?.scheme==="file"){if(G){let K=m4(G);if(n0.hasPrefix(V,K)){let q=K.path.endsWith("/")?K.path.slice(0,-1):K.path,W=V.path.slice(q.length+1);return TW1("~"+(X?"\\":"/")+W,X,V.scheme)}}return TW1(V.fsPath,X,V.scheme)}return V}function TW1(J,Q,Z){return Q&&Z==="file"?J.replaceAll("/","\\"):J}function Si(J){let Q=ji;return ji=J,Q}function e74(){if(ji)return ji;throw Error("must call setDisplayPathEnvInfo before calling displayPath() and related functions")}var ji=null;var LK=B1(()=>{n6();HE();Kl()});var J34=(J)=>{let Q=0,Z=[];while(Q<J.length){let Y=J[Q];if(Y==="\\"){Q++;continue}if(Y==="{"){Z.push({type:"brace",value:"{"}),Q++;continue}if(Y==="}"){Z.push({type:"brace",value:"}"}),Q++;continue}if(Y==="["){Z.push({type:"paren",value:"["}),Q++;continue}if(Y==="]"){Z.push({type:"paren",value:"]"}),Q++;continue}if(Y===":"){Z.push({type:"separator",value:":"}),Q++;continue}if(Y===","){Z.push({type:"delimiter",value:","}),Q++;continue}if(Y==='"'){let K="",q=!1;Y=J[++Q];while(Y!=='"'){if(Q===J.length){q=!0;break}if(Y==="\\"){if(Q++,Q===J.length){q=!0;break}K+=Y+J[Q],Y=J[++Q]}else K+=Y,Y=J[++Q]}if(Y=J[++Q],!q)Z.push({type:"string",value:K});continue}if(Y&&/\s/.test(Y)){Q++;continue}let G=/[0-9]/;if(Y&&G.test(Y)||Y==="-"||Y==="."){let K="";if(Y==="-")K+=Y,Y=J[++Q];while(Y&&G.test(Y)||Y===".")K+=Y,Y=J[++Q];Z.push({type:"number",value:K});continue}let V=/[a-z]/i;if(Y&&V.test(Y)){let K="";while(Y&&V.test(Y)){if(Q===J.length)break;K+=Y,Y=J[++Q]}if(K=="true"||K=="false"||K==="null")Z.push({type:"name",value:K});else{Q++;continue}continue}Q++}return Z},xE=(J)=>{if(J.length===0)return J;let Q=J[J.length-1];switch(Q.type){case"separator":return J=J.slice(0,J.length-1),xE(J);break;case"number":let Z=Q.value[Q.value.length-1];if(Z==="."||Z==="-")return J=J.slice(0,J.length-1),xE(J);case"string":let Y=J[J.length-2];if(Y?.type==="delimiter")return J=J.slice(0,J.length-1),xE(J);else if(Y?.type==="brace"&&Y.value==="{")return J=J.slice(0,J.length-1),xE(J);break;case"delimiter":return J=J.slice(0,J.length-1),xE(J);break}return J},Q34=(J)=>{let Q=[];if(J.map((Z)=>{if(Z.type==="brace")if(Z.value==="{")Q.push("}");else Q.splice(Q.lastIndexOf("}"),1);if(Z.type==="paren")if(Z.value==="[")Q.push("]");else Q.splice(Q.lastIndexOf("]"),1)}),Q.length>0)Q.reverse().map((Z)=>{if(Z==="}")J.push({type:"brace",value:"}"});else if(Z==="]")J.push({type:"paren",value:"]"})});return J},Z34=(J)=>{let Q="";return J.map((Z)=>{switch(Z.type){case"string":Q+='"'+Z.value+'"';break;default:Q+=Z.value;break}}),Q},bX=(J)=>JSON.parse(Z34(Q34(xE(J34(J)))));var oD=()=>{};function gJ(J,...Q){throw Error(`[Immer] minified error nr: ${J}. Full error at: https://bit.ly/3cXEKWf`)}function tD(J){return!!J&&!!J[UY]}function jF(J){if(!J)return!1;return XF0(J)||Array.isArray(J)||!!J[fk]||!!J.constructor?.[fk]||uk(J)||pk(J)}function XF0(J){if(!J||typeof J!=="object")return!1;let Q=sD(J);if(Q===null)return!0;let Z=Object.hasOwnProperty.call(Q,"constructor")&&Q.constructor;if(Z===Object)return!0;return typeof Z=="function"&&Function.toString.call(Z)===Y34}function hk(J,Q){if(eD(J)===0)Reflect.ownKeys(J).forEach((Z)=>{Q(Z,J[Z],J)});else J.forEach((Z,Y)=>Q(Y,Z,J))}function eD(J){let Q=J[UY];return Q?Q.type_:Array.isArray(J)?1:uk(J)?2:pk(J)?3:0}function bk(J,Q){return eD(J)===2?J.has(Q):Object.prototype.hasOwnProperty.call(J,Q)}function RW1(J,Q){return eD(J)===2?J.get(Q):J[Q]}function $F0(J,Q,Z){let Y=eD(J);if(Y===2)J.set(Q,Z);else if(Y===3)J.add(Z);else J[Q]=Z}function X34(J,Q){if(J===Q)return J!==0||1/J===1/Q;else return J!==J&&Q!==Q}function uk(J){return J instanceof Map}function pk(J){return J instanceof Set}function rD(J){return J.copy_||J.base_}function SW1(J,Q){if(uk(J))return new Map(J);if(pk(J))return new Set(J);if(Array.isArray(J))return Array.prototype.slice.call(J);let Z=XF0(J);if(Q===!0||Q==="class_only"&&!Z){let Y=Object.getOwnPropertyDescriptors(J);delete Y[UY];let X=Reflect.ownKeys(Y);for(let G=0;G<X.length;G++){let V=X[G],K=Y[V];if(K.writable===!1)K.writable=!0,K.configurable=!0;if(K.get||K.set)Y[V]={configurable:!0,writable:!0,enumerable:K.enumerable,value:J[V]}}return Object.create(sD(J),Y)}else{let Y=sD(J);if(Y!==null&&Z)return{...J};let X=Object.create(Y);return Object.assign(X,J)}}function NY(J,Q=!1){if(yi(J)||tD(J)||!jF(J))return J;if(eD(J)>1)J.set=J.add=J.clear=J.delete=$34;if(Object.freeze(J),Q)Object.entries(J).forEach(([Z,Y])=>NY(Y,!0));return J}function $34(){gJ(2)}function yi(J){return Object.isFrozen(J)}function JM(J){let Q=_W1[J];if(!Q)gJ(0,J);return Q}function G34(J,Q){if(!_W1[J])_W1[J]=Q}function GF0(){return mk}function V34(J,Q){return{drafts_:[],parent_:J,immer_:Q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function JF0(J,Q){if(Q)JM("Patches"),J.patches_=[],J.inversePatches_=[],J.patchListener_=Q}function kW1(J){yW1(J),J.drafts_.forEach(K34),J.drafts_=null}function yW1(J){if(J===mk)mk=J.parent_}function QF0(J){return mk=V34(mk,J)}function K34(J){let Q=J[UY];if(Q.type_===0||Q.type_===1)Q.revoke_();else Q.revoked_=!0}function ZF0(J,Q){Q.unfinalizedDrafts_=Q.drafts_.length;let Z=Q.drafts_[0];if(J!==void 0&&J!==Z){if(Z[UY].modified_)kW1(Q),gJ(4);if(jF(J)){if(J=_i(Q,J),!Q.parent_)ki(Q,J)}if(Q.patches_)JM("Patches").generateReplacementPatches_(Z[UY].base_,J,Q.patches_,Q.inversePatches_)}else J=_i(Q,Z,[]);if(kW1(Q),Q.patches_)Q.patchListener_(Q.patches_,Q.inversePatches_);return J!==fW1?J:void 0}function _i(J,Q,Z){if(yi(Q))return Q;let Y=Q[UY];if(!Y)return hk(Q,(X,G)=>YF0(J,Y,Q,X,G,Z)),Q;if(Y.scope_!==J)return Q;if(!Y.modified_)return ki(J,Y.base_,!0),Y.base_;if(!Y.finalized_){Y.finalized_=!0,Y.scope_.unfinalizedDrafts_--;let X=Y.copy_,G=X,V=!1;if(Y.type_===3)G=new Set(X),X.clear(),V=!0;if(hk(G,(K,q)=>YF0(J,Y,X,K,q,Z,V)),ki(J,X,!1),Z&&J.patches_)JM("Patches").generatePatches_(Y,Z,J.patches_,J.inversePatches_)}return Y.copy_}function YF0(J,Q,Z,Y,X,G,V){if(tD(X)){let K=G&&Q&&Q.type_!==3&&!bk(Q.assigned_,Y)?G.concat(Y):void 0,q=_i(J,X,K);if($F0(Z,Y,q),tD(q))J.canAutoFreeze_=!1;else return}else if(V)Z.add(X);if(jF(X)&&!yi(X)){if(!J.immer_.autoFreeze_&&J.unfinalizedDrafts_<1)return;if(_i(J,X),(!Q||!Q.scope_.parent_)&&typeof Y!=="symbol"&&Object.prototype.propertyIsEnumerable.call(Z,Y))ki(J,X)}}function ki(J,Q,Z=!1){if(!J.parent_&&J.immer_.autoFreeze_&&J.canAutoFreeze_)NY(Q,Z)}function q34(J,Q){let Z=Array.isArray(J),Y={type_:Z?1:0,scope_:Q?Q.scope_:GF0(),modified_:!1,finalized_:!1,assigned_:{},parent_:Q,base_:J,draft_:null,copy_:null,revoke_:null,isManual_:!1},X=Y,G=hW1;if(Z)X=[Y],G=gk;let{revoke:V,proxy:K}=Proxy.revocable(X,G);return Y.draft_=K,Y.revoke_=V,K}function CW1(J,Q){let Z=J[UY];return(Z?rD(Z):J)[Q]}function W34(J,Q,Z){let Y=VF0(Q,Z);return Y?"value"in Y?Y.value:Y.get?.call(J.draft_):void 0}function VF0(J,Q){if(!(Q in J))return;let Z=sD(J);while(Z){let Y=Object.getOwnPropertyDescriptor(Z,Q);if(Y)return Y;Z=sD(Z)}return}function xW1(J){if(!J.modified_){if(J.modified_=!0,J.parent_)xW1(J.parent_)}}function jW1(J){if(!J.copy_)J.copy_=SW1(J.base_,J.scope_.immer_.useStrictShallowCopy_)}function vW1(J,Q){let Z=uk(J)?JM("MapSet").proxyMap_(J,Q):pk(J)?JM("MapSet").proxySet_(J,Q):q34(J,Q);return(Q?Q.scope_:GF0()).drafts_.push(Z),Z}function z34(J){if(!tD(J))gJ(10,J);return KF0(J)}function KF0(J){if(!jF(J)||yi(J))return J;let Q=J[UY],Z;if(Q){if(!Q.modified_)return Q.base_;Q.finalized_=!0,Z=SW1(J,Q.scope_.immer_.useStrictShallowCopy_)}else Z=SW1(J,!0);if(hk(Z,(Y,X)=>{$F0(Z,Y,KF0(X))}),Q)Q.finalized_=!1;return Z}function xi(){let Q="replace",Z="add",Y="remove";function X(U,D,M,L){switch(U.type_){case 0:case 2:return V(U,D,M,L);case 1:return G(U,D,M,L);case 3:return K(U,D,M,L)}}function G(U,D,M,L){let{base_:A,assigned_:E}=U,I=U.copy_;if(I.length<A.length)[A,I]=[I,A],[M,L]=[L,M];for(let P=0;P<A.length;P++)if(E[P]&&I[P]!==A[P]){let R=D.concat([P]);M.push({op:Q,path:R,value:z(I[P])}),L.push({op:Q,path:R,value:z(A[P])})}for(let P=A.length;P<I.length;P++){let R=D.concat([P]);M.push({op:Z,path:R,value:z(I[P])})}for(let P=I.length-1;A.length<=P;--P){let R=D.concat([P]);L.push({op:Y,path:R})}}function V(U,D,M,L){let{base_:A,copy_:E}=U;hk(U.assigned_,(I,P)=>{let R=RW1(A,I),y=RW1(E,I),k=!P?Y:bk(A,I)?Q:Z;if(R===y&&k===Q)return;let v=D.concat(I);M.push(k===Y?{op:k,path:v}:{op:k,path:v,value:y}),L.push(k===Z?{op:Y,path:v}:k===Y?{op:Z,path:v,value:z(R)}:{op:Q,path:v,value:z(R)})})}function K(U,D,M,L){let{base_:A,copy_:E}=U,I=0;A.forEach((P)=>{if(!E.has(P)){let R=D.concat([I]);M.push({op:Y,path:R,value:P}),L.unshift({op:Z,path:R,value:P})}I++}),I=0,E.forEach((P)=>{if(!A.has(P)){let R=D.concat([I]);M.push({op:Z,path:R,value:P}),L.unshift({op:Y,path:R,value:P})}I++})}function q(U,D,M,L){M.push({op:Q,path:[],value:D===fW1?void 0:D}),L.push({op:Q,path:[],value:U})}function W(U,D){return D.forEach((M)=>{let{path:L,op:A}=M,E=U;for(let y=0;y<L.length-1;y++){let k=eD(E),v=L[y];if(typeof v!=="string"&&typeof v!=="number")v=""+v;if((k===0||k===1)&&(v==="__proto__"||v==="constructor"))gJ(19);if(typeof E==="function"&&v==="prototype")gJ(19);if(E=RW1(E,v),typeof E!=="object")gJ(18,L.join("/"))}let I=eD(E),P=H(M.value),R=L[L.length-1];switch(A){case Q:switch(I){case 2:return E.set(R,P);case 3:gJ(16);default:return E[R]=P}case Z:switch(I){case 1:return R==="-"?E.push(P):E.splice(R,0,P);case 2:return E.set(R,P);case 3:return E.add(P);default:return E[R]=P}case Y:switch(I){case 1:return E.splice(R,1);case 2:return E.delete(R);case 3:return E.delete(M.value);default:return delete E[R]}default:gJ(17,A)}}),U}function H(U){if(!jF(U))return U;if(Array.isArray(U))return U.map(H);if(uk(U))return new Map(Array.from(U.entries()).map(([M,L])=>[M,H(L)]));if(pk(U))return new Set(Array.from(U).map(H));let D=Object.create(sD(U));for(let M in U)D[M]=H(U[M]);if(bk(U,fk))D[fk]=U[fk];return D}function z(U){if(tD(U))return H(U);else return U}G34("Patches",{applyPatches_:W,generatePatches_:X,generateReplacementPatches_:q})}function v8(J){return J}var fW1,fk,UY,sD,Y34,_W1,mk,hW1,gk,H34=class{constructor(J){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(Q,Z,Y)=>{if(typeof Q==="function"&&typeof Z!=="function"){let G=Z;Z=Q;let V=this;return function(q=G,...W){return V.produce(q,(H)=>Z.call(this,H,...W))}}if(typeof Z!=="function")gJ(6);if(Y!==void 0&&typeof Y!=="function")gJ(7);let X;if(jF(Q)){let G=QF0(this),V=vW1(Q,void 0),K=!0;try{X=Z(V),K=!1}finally{if(K)kW1(G);else yW1(G)}return JF0(G,Y),ZF0(X,G)}else if(!Q||typeof Q!=="object"){if(X=Z(Q),X===void 0)X=Q;if(X===fW1)X=void 0;if(this.autoFreeze_)NY(X,!0);if(Y){let G=[],V=[];JM("Patches").generateReplacementPatches_(Q,X,G,V),Y(G,V)}return X}else gJ(1,Q)},this.produceWithPatches=(Q,Z)=>{if(typeof Q==="function")return(V,...K)=>this.produceWithPatches(V,(q)=>Q(q,...K));let Y,X;return[this.produce(Q,Z,(V,K)=>{Y=V,X=K}),Y,X]},typeof J?.autoFreeze==="boolean")this.setAutoFreeze(J.autoFreeze);if(typeof J?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(J.useStrictShallowCopy)}createDraft(J){if(!jF(J))gJ(8);if(tD(J))J=z34(J);let Q=QF0(this),Z=vW1(J,void 0);return Z[UY].isManual_=!0,yW1(Q),Z}finishDraft(J,Q){let Z=J&&J[UY];if(!Z||!Z.isManual_)gJ(9);let{scope_:Y}=Z;return JF0(Y,Q),ZF0(void 0,Y)}setAutoFreeze(J){this.autoFreeze_=J}setUseStrictShallowCopy(J){this.useStrictShallowCopy_=J}applyPatches(J,Q){let Z;for(Z=Q.length-1;Z>=0;Z--){let X=Q[Z];if(X.path.length===0&&X.op==="replace"){J=X.value;break}}if(Z>-1)Q=Q.slice(Z+1);let Y=JM("Patches").applyPatches_;if(tD(J))return Y(J,Q);return this.produce(J,(X)=>Y(X,Q))}},BY,SF,QM,dv8,cv8,qF0,lv8,iv8;var TQ=B1(()=>{fW1=Symbol.for("immer-nothing"),fk=Symbol.for("immer-draftable"),UY=Symbol.for("immer-state");sD=Object.getPrototypeOf;Y34=Object.prototype.constructor.toString();_W1={};hW1={get(J,Q){if(Q===UY)return J;let Z=rD(J);if(!bk(Z,Q))return W34(J,Z,Q);let Y=Z[Q];if(J.finalized_||!jF(Y))return Y;if(Y===CW1(J.base_,Q))return jW1(J),J.copy_[Q]=vW1(Y,J);return Y},has(J,Q){return Q in rD(J)},ownKeys(J){return Reflect.ownKeys(rD(J))},set(J,Q,Z){let Y=VF0(rD(J),Q);if(Y?.set)return Y.set.call(J.draft_,Z),!0;if(!J.modified_){let X=CW1(rD(J),Q),G=X?.[UY];if(G&&G.base_===Z)return J.copy_[Q]=Z,J.assigned_[Q]=!1,!0;if(X34(Z,X)&&(Z!==void 0||bk(J.base_,Q)))return!0;jW1(J),xW1(J)}if(J.copy_[Q]===Z&&(Z!==void 0||(Q in J.copy_))||Number.isNaN(Z)&&Number.isNaN(J.copy_[Q]))return!0;return J.copy_[Q]=Z,J.assigned_[Q]=!0,!0},deleteProperty(J,Q){if(CW1(J.base_,Q)!==void 0||Q in J.base_)J.assigned_[Q]=!1,jW1(J),xW1(J);else delete J.assigned_[Q];if(J.copy_)delete J.copy_[Q];return!0},getOwnPropertyDescriptor(J,Q){let Z=rD(J),Y=Reflect.getOwnPropertyDescriptor(Z,Q);if(!Y)return Y;return{writable:!0,configurable:J.type_!==1||Q!=="length",enumerable:Y.enumerable,value:Z[Q]}},defineProperty(){gJ(11)},getPrototypeOf(J){return sD(J.base_)},setPrototypeOf(){gJ(12)}},gk={};hk(hW1,(J,Q)=>{gk[J]=function(){return arguments[0]=arguments[0][0],Q.apply(this,arguments)}});gk.deleteProperty=function(J,Q){return gk.set.call(this,J,Q,void 0)};gk.set=function(J,Q,Z){return hW1.set.call(this,J[0],Q,Z,J[0])};BY=new H34,SF=BY.produce,QM=BY.produceWithPatches.bind(BY),dv8=BY.setAutoFreeze.bind(BY),cv8=BY.setUseStrictShallowCopy.bind(BY),qF0=BY.applyPatches.bind(BY),lv8=BY.createDraft.bind(BY),iv8=BY.finishDraft.bind(BY)});function WF0(J,Q=0){return(o2[J[Q+0]]+o2[J[Q+1]]+o2[J[Q+2]]+o2[J[Q+3]]+"-"+o2[J[Q+4]]+o2[J[Q+5]]+"-"+o2[J[Q+6]]+o2[J[Q+7]]+"-"+o2[J[Q+8]]+o2[J[Q+9]]+"-"+o2[J[Q+10]]+o2[J[Q+11]]+o2[J[Q+12]]+o2[J[Q+13]]+o2[J[Q+14]]+o2[J[Q+15]]).toLowerCase()}var o2;var HF0=B1(()=>{o2=[];for(let J=0;J<256;++J)o2.push((J+256).toString(16).slice(1))});import{randomFillSync as F34}from"crypto";function hi(){if(vi>fi.length-16)F34(fi),vi=0;return fi.slice(vi,vi+=16)}var fi,vi;var zF0=B1(()=>{fi=new Uint8Array(256),vi=fi.length});function U34(J,Q,Z){let Y;if(J)Y=FF0(J.random??J.rng?.()??hi(),J.msecs,J.seq,Q,Z);else{let X=Date.now(),G=hi();B34(bW1,X,G),Y=FF0(G,bW1.msecs,bW1.seq,Q,Z)}return Q??WF0(Y)}function B34(J,Q,Z){if(J.msecs??=-1/0,J.seq??=0,Q>J.msecs)J.seq=Z[6]<<23|Z[7]<<16|Z[8]<<8|Z[9],J.msecs=Q;else if(J.seq=J.seq+1|0,J.seq===0)J.msecs++;return J}function FF0(J,Q,Z,Y,X=0){if(J.length<16)throw Error("Random bytes length must be >= 16");if(!Y)Y=new Uint8Array(16),X=0;else if(X<0||X+16>Y.length)throw RangeError(`UUID byte range ${X}:${X+15} is out of buffer bounds`);return Q??=Date.now(),Z??=J[6]*127<<24|J[7]<<16|J[8]<<8|J[9],Y[X++]=Q/1099511627776&255,Y[X++]=Q/4294967296&255,Y[X++]=Q/16777216&255,Y[X++]=Q/65536&255,Y[X++]=Q/256&255,Y[X++]=Q&255,Y[X++]=112|Z>>>28&15,Y[X++]=Z>>>20&255,Y[X++]=128|Z>>>14&63,Y[X++]=Z>>>6&255,Y[X++]=Z<<2&255|J[10]&3,Y[X++]=J[11],Y[X++]=J[12],Y[X++]=J[13],Y[X++]=J[14],Y[X++]=J[15],Y}var bW1,mW1;var UF0=B1(()=>{zF0();HF0();bW1={};mW1=U34});var BF0=B1(()=>{UF0()});function gW1({onlyFirst:J=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,J?void 0:"g")}function vE(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(N34,"")}var N34;var bi=B1(()=>{N34=gW1()});var DF0=h((Gf8,uW1)=>{var _F={};if(typeof uW1>"u")window.eastasianwidth=_F;else uW1.exports=_F;_F.eastAsianWidth=function(J){var Q=J.charCodeAt(0),Z=J.length==2?J.charCodeAt(1):0,Y=Q;if(55296<=Q&&Q<=56319&&(56320<=Z&&Z<=57343))Q&=1023,Z&=1023,Y=Q<<10|Z,Y+=65536;if(Y==12288||65281<=Y&&Y<=65376||65504<=Y&&Y<=65510)return"F";if(Y==8361||65377<=Y&&Y<=65470||65474<=Y&&Y<=65479||65482<=Y&&Y<=65487||65490<=Y&&Y<=65495||65498<=Y&&Y<=65500||65512<=Y&&Y<=65518)return"H";if(4352<=Y&&Y<=4447||4515<=Y&&Y<=4519||4602<=Y&&Y<=4607||9001<=Y&&Y<=9002||11904<=Y&&Y<=11929||11931<=Y&&Y<=12019||12032<=Y&&Y<=12245||12272<=Y&&Y<=12283||12289<=Y&&Y<=12350||12353<=Y&&Y<=12438||12441<=Y&&Y<=12543||12549<=Y&&Y<=12589||12593<=Y&&Y<=12686||12688<=Y&&Y<=12730||12736<=Y&&Y<=12771||12784<=Y&&Y<=12830||12832<=Y&&Y<=12871||12880<=Y&&Y<=13054||13056<=Y&&Y<=19903||19968<=Y&&Y<=42124||42128<=Y&&Y<=42182||43360<=Y&&Y<=43388||44032<=Y&&Y<=55203||55216<=Y&&Y<=55238||55243<=Y&&Y<=55291||63744<=Y&&Y<=64255||65040<=Y&&Y<=65049||65072<=Y&&Y<=65106||65108<=Y&&Y<=65126||65128<=Y&&Y<=65131||110592<=Y&&Y<=110593||127488<=Y&&Y<=127490||127504<=Y&&Y<=127546||127552<=Y&&Y<=127560||127568<=Y&&Y<=127569||131072<=Y&&Y<=194367||177984<=Y&&Y<=196605||196608<=Y&&Y<=262141)return"W";if(32<=Y&&Y<=126||162<=Y&&Y<=163||165<=Y&&Y<=166||Y==172||Y==175||10214<=Y&&Y<=10221||10629<=Y&&Y<=10630)return"Na";if(Y==161||Y==164||167<=Y&&Y<=168||Y==170||173<=Y&&Y<=174||176<=Y&&Y<=180||182<=Y&&Y<=186||188<=Y&&Y<=191||Y==198||Y==208||215<=Y&&Y<=216||222<=Y&&Y<=225||Y==230||232<=Y&&Y<=234||236<=Y&&Y<=237||Y==240||242<=Y&&Y<=243||247<=Y&&Y<=250||Y==252||Y==254||Y==257||Y==273||Y==275||Y==283||294<=Y&&Y<=295||Y==299||305<=Y&&Y<=307||Y==312||319<=Y&&Y<=322||Y==324||328<=Y&&Y<=331||Y==333||338<=Y&&Y<=339||358<=Y&&Y<=359||Y==363||Y==462||Y==464||Y==466||Y==468||Y==470||Y==472||Y==474||Y==476||Y==593||Y==609||Y==708||Y==711||713<=Y&&Y<=715||Y==717||Y==720||728<=Y&&Y<=731||Y==733||Y==735||768<=Y&&Y<=879||913<=Y&&Y<=929||931<=Y&&Y<=937||945<=Y&&Y<=961||963<=Y&&Y<=969||Y==1025||1040<=Y&&Y<=1103||Y==1105||Y==8208||8211<=Y&&Y<=8214||8216<=Y&&Y<=8217||8220<=Y&&Y<=8221||8224<=Y&&Y<=8226||8228<=Y&&Y<=8231||Y==8240||8242<=Y&&Y<=8243||Y==8245||Y==8251||Y==8254||Y==8308||Y==8319||8321<=Y&&Y<=8324||Y==8364||Y==8451||Y==8453||Y==8457||Y==8467||Y==8470||8481<=Y&&Y<=8482||Y==8486||Y==8491||8531<=Y&&Y<=8532||8539<=Y&&Y<=8542||8544<=Y&&Y<=8555||8560<=Y&&Y<=8569||Y==8585||8592<=Y&&Y<=8601||8632<=Y&&Y<=8633||Y==8658||Y==8660||Y==8679||Y==8704||8706<=Y&&Y<=8707||8711<=Y&&Y<=8712||Y==8715||Y==8719||Y==8721||Y==8725||Y==8730||8733<=Y&&Y<=8736||Y==8739||Y==8741||8743<=Y&&Y<=8748||Y==8750||8756<=Y&&Y<=8759||8764<=Y&&Y<=8765||Y==8776||Y==8780||Y==8786||8800<=Y&&Y<=8801||8804<=Y&&Y<=8807||8810<=Y&&Y<=8811||8814<=Y&&Y<=8815||8834<=Y&&Y<=8835||8838<=Y&&Y<=8839||Y==8853||Y==8857||Y==8869||Y==8895||Y==8978||9312<=Y&&Y<=9449||9451<=Y&&Y<=9547||9552<=Y&&Y<=9587||9600<=Y&&Y<=9615||9618<=Y&&Y<=9621||9632<=Y&&Y<=9633||9635<=Y&&Y<=9641||9650<=Y&&Y<=9651||9654<=Y&&Y<=9655||9660<=Y&&Y<=9661||9664<=Y&&Y<=9665||9670<=Y&&Y<=9672||Y==9675||9678<=Y&&Y<=9681||9698<=Y&&Y<=9701||Y==9711||9733<=Y&&Y<=9734||Y==9737||9742<=Y&&Y<=9743||9748<=Y&&Y<=9749||Y==9756||Y==9758||Y==9792||Y==9794||9824<=Y&&Y<=9825||9827<=Y&&Y<=9829||9831<=Y&&Y<=9834||9836<=Y&&Y<=9837||Y==9839||9886<=Y&&Y<=9887||9918<=Y&&Y<=9919||9924<=Y&&Y<=9933||9935<=Y&&Y<=9953||Y==9955||9960<=Y&&Y<=9983||Y==10045||Y==10071||10102<=Y&&Y<=10111||11093<=Y&&Y<=11097||12872<=Y&&Y<=12879||57344<=Y&&Y<=63743||65024<=Y&&Y<=65039||Y==65533||127232<=Y&&Y<=127242||127248<=Y&&Y<=127277||127280<=Y&&Y<=127337||127344<=Y&&Y<=127386||917760<=Y&&Y<=917999||983040<=Y&&Y<=1048573||1048576<=Y&&Y<=1114109)return"A";return"N"};_F.characterLength=function(J){var Q=this.eastAsianWidth(J);if(Q=="F"||Q=="W"||Q=="A")return 2;else return 1};function NF0(J){return J.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}_F.length=function(J){var Q=NF0(J),Z=0;for(var Y=0;Y<Q.length;Y++)Z=Z+this.characterLength(Q[Y]);return Z};_F.slice=function(J,Q,Z){if(textLen=_F.length(J),Q=Q?Q:0,Z=Z?Z:1,Q<0)Q=textLen+Q;if(Z<0)Z=textLen+Z;var Y="",X=0,G=NF0(J);for(var V=0;V<G.length;V++){var K=G[V],q=_F.length(K);if(X>=Q-(q==2?1:0))if(X+q<=Z)Y+=K;else break;X+=q}return Y}});var pW1=h((Vf8,MF0)=>{MF0.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var D34,M34;var LF0=B1(()=>{bi();D34=q6(DF0(),1),M34=q6(pW1(),1)});function mi(J,Q,Z="..."){if(J.length<=Q)return J;return J.slice(0,Math.max(0,Q-Z.length))+Z}var dW1=B1(()=>{LF0()});var AF0="run_terminal_command",cW1="read_file",A2="Task",a8="finder",DZ="get_diagnostics",L5="Bash",A5="oracle",OF0="painter",mX="mermaid",AK="todo_read",t5="todo_write",k3="read_web_page",kF="read_thread",fE="find_thread",j5="create_file",n3="glob",gi="undo_edit",ui="read_mcp_resource",a6="Read",K7="edit_file",hE="format_file",O2="web_search",C8="Grep",ZM="Check",DY="librarian",pi="kraken",wF0="look_at",EF0="read_artifact",IF0="edit_artifact",di="read_plan",bE="edit_plan",ci="read_github",li="search_github",ii="commit_search",ni="list_directory_github",ai="list_repositories",oi="glob_github",ri="diff",PF0="bookkeeper",TF0="describe_workbook",RF0="execute_query",dk="skill",CF0="tool_search",jF0="load_tool",SF0;var W4=B1(()=>{SF0=["Task","finder","get_diagnostics","Bash","oracle","painter","mermaid","todo_read","todo_write","read_web_page","create_file","glob","Glob","undo_edit","Read","edit_file","delete_file","format_file","web_search","Grep","search_documents","get_document","Check","code_review","kraken","look_at","librarian","bookkeeper","read_thread","find_thread","read_artifact","edit_artifact","read_plan","edit_plan","skill","tool_search","load_tool"]});var ck=h((Uf8,kF0)=>{var _F0={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},L34={..._F0,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},A34={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};kF0.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:A34,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(J){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${J.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(J){return J===!0?L34:_F0}}});var lk=h((P34)=>{var{REGEX_BACKSLASH:O34,REGEX_REMOVE_BACKSLASH:w34,REGEX_SPECIAL_CHARS:E34,REGEX_SPECIAL_CHARS_GLOBAL:I34}=ck();P34.isObject=(J)=>J!==null&&typeof J==="object"&&!Array.isArray(J);P34.hasRegexChars=(J)=>E34.test(J);P34.isRegexChar=(J)=>J.length===1&&P34.hasRegexChars(J);P34.escapeRegex=(J)=>J.replace(I34,"\\$1");P34.toPosixSlashes=(J)=>J.replace(O34,"/");P34.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let J=navigator.platform.toLowerCase();return J==="win32"||J==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};P34.removeBackslashes=(J)=>{return J.replace(w34,(Q)=>{return Q==="\\"?"":Q})};P34.escapeLast=(J,Q,Z)=>{let Y=J.lastIndexOf(Q,Z);if(Y===-1)return J;if(J[Y-1]==="\\")return P34.escapeLast(J,Q,Y-1);return`${J.slice(0,Y)}\\${J.slice(Y)}`};P34.removePrefix=(J,Q={})=>{let Z=J;if(Z.startsWith("./"))Z=Z.slice(2),Q.prefix="./";return Z};P34.wrapOutput=(J,Q={},Z={})=>{let Y=Z.contains?"":"^",X=Z.contains?"":"$",G=`${Y}(?:${J})${X}`;if(Q.negated===!0)G=`(?:^(?!${G}).*$)`;return G};P34.basename=(J,{windows:Q}={})=>{let Z=J.split(Q?/[\\/]/:"/"),Y=Z[Z.length-1];if(Y==="")return Z[Z.length-2];return Y}});var pF0=h((Nf8,uF0)=>{var vF0=lk(),{CHAR_ASTERISK:lW1,CHAR_AT:v34,CHAR_BACKWARD_SLASH:ik,CHAR_COMMA:f34,CHAR_DOT:iW1,CHAR_EXCLAMATION_MARK:nW1,CHAR_FORWARD_SLASH:gF0,CHAR_LEFT_CURLY_BRACE:aW1,CHAR_LEFT_PARENTHESES:oW1,CHAR_LEFT_SQUARE_BRACKET:h34,CHAR_PLUS:b34,CHAR_QUESTION_MARK:fF0,CHAR_RIGHT_CURLY_BRACE:m34,CHAR_RIGHT_PARENTHESES:hF0,CHAR_RIGHT_SQUARE_BRACKET:g34}=ck(),bF0=(J)=>{return J===gF0||J===ik},mF0=(J)=>{if(J.isPrefix!==!0)J.depth=J.isGlobstar?1/0:1},u34=(J,Q)=>{let Z=Q||{},Y=J.length-1,X=Z.parts===!0||Z.scanToEnd===!0,G=[],V=[],K=[],q=J,W=-1,H=0,z=0,U=!1,D=!1,M=!1,L=!1,A=!1,E=!1,I=!1,P=!1,R=!1,y=!1,k=0,v,g,d={value:"",depth:0,isGlob:!1},b=()=>W>=Y,a=()=>q.charCodeAt(W+1),G1=()=>{return v=g,q.charCodeAt(++W)};while(W<Y){g=G1();let L1;if(g===ik){if(I=d.backslashes=!0,g=G1(),g===aW1)E=!0;continue}if(E===!0||g===aW1){k++;while(b()!==!0&&(g=G1())){if(g===ik){I=d.backslashes=!0,G1();continue}if(g===aW1){k++;continue}if(E!==!0&&g===iW1&&(g=G1())===iW1){if(U=d.isBrace=!0,M=d.isGlob=!0,y=!0,X===!0)continue;break}if(E!==!0&&g===f34){if(U=d.isBrace=!0,M=d.isGlob=!0,y=!0,X===!0)continue;break}if(g===m34){if(k--,k===0){E=!1,U=d.isBrace=!0,y=!0;break}}}if(X===!0)continue;break}if(g===gF0){if(G.push(W),V.push(d),d={value:"",depth:0,isGlob:!1},y===!0)continue;if(v===iW1&&W===H+1){H+=2;continue}z=W+1;continue}if(Z.noext!==!0){if((g===b34||g===v34||g===lW1||g===fF0||g===nW1)===!0&&a()===oW1){if(M=d.isGlob=!0,L=d.isExtglob=!0,y=!0,g===nW1&&W===H)R=!0;if(X===!0){while(b()!==!0&&(g=G1())){if(g===ik){I=d.backslashes=!0,g=G1();continue}if(g===hF0){M=d.isGlob=!0,y=!0;break}}continue}break}}if(g===lW1){if(v===lW1)A=d.isGlobstar=!0;if(M=d.isGlob=!0,y=!0,X===!0)continue;break}if(g===fF0){if(M=d.isGlob=!0,y=!0,X===!0)continue;break}if(g===h34){while(b()!==!0&&(L1=G1())){if(L1===ik){I=d.backslashes=!0,G1();continue}if(L1===g34){D=d.isBracket=!0,M=d.isGlob=!0,y=!0;break}}if(X===!0)continue;break}if(Z.nonegate!==!0&&g===nW1&&W===H){P=d.negated=!0,H++;continue}if(Z.noparen!==!0&&g===oW1){if(M=d.isGlob=!0,X===!0){while(b()!==!0&&(g=G1())){if(g===oW1){I=d.backslashes=!0,g=G1();continue}if(g===hF0){y=!0;break}}continue}break}if(M===!0){if(y=!0,X===!0)continue;break}}if(Z.noext===!0)L=!1,M=!1;let t=q,c="",J1="";if(H>0)c=q.slice(0,H),q=q.slice(H),z-=H;if(t&&M===!0&&z>0)t=q.slice(0,z),J1=q.slice(z);else if(M===!0)t="",J1=q;else t=q;if(t&&t!==""&&t!=="/"&&t!==q){if(bF0(t.charCodeAt(t.length-1)))t=t.slice(0,-1)}if(Z.unescape===!0){if(J1)J1=vF0.removeBackslashes(J1);if(t&&I===!0)t=vF0.removeBackslashes(t)}let q1={prefix:c,input:J,start:H,base:t,glob:J1,isBrace:U,isBracket:D,isGlob:M,isExtglob:L,isGlobstar:A,negated:P,negatedExtglob:R};if(Z.tokens===!0){if(q1.maxDepth=0,!bF0(g))V.push(d);q1.tokens=V}if(Z.parts===!0||Z.tokens===!0){let L1;for(let s=0;s<G.length;s++){let o=L1?L1+1:H,i=G[s],z1=J.slice(o,i);if(Z.tokens){if(s===0&&H!==0)V[s].isPrefix=!0,V[s].value=c;else V[s].value=z1;mF0(V[s]),q1.maxDepth+=V[s].depth}if(s!==0||z1!=="")K.push(z1);L1=i}if(L1&&L1+1<J.length){let s=J.slice(L1+1);if(K.push(s),Z.tokens)V[V.length-1].value=s,mF0(V[V.length-1]),q1.maxDepth+=V[V.length-1].depth}q1.slashes=G,q1.parts=K}return q1};uF0.exports=u34});var lF0=h((Df8,cF0)=>{var si=ck(),OK=lk(),{MAX_LENGTH:ti,POSIX_REGEX_SOURCE:p34,REGEX_NON_SPECIAL_CHARS:d34,REGEX_SPECIAL_CHARS_BACKREF:c34,REPLACEMENTS:dF0}=si,l34=(J,Q)=>{if(typeof Q.expandRange==="function")return Q.expandRange(...J,Q);J.sort();let Z=`[${J.join("-")}]`;try{new RegExp(Z)}catch(Y){return J.map((X)=>OK.escapeRegex(X)).join("..")}return Z},mE=(J,Q)=>{return`Missing ${J}: "${Q}" - use "\\\\${Q}" to match literal characters`},rW1=(J,Q)=>{if(typeof J!=="string")throw TypeError("Expected a string");J=dF0[J]||J;let Z={...Q},Y=typeof Z.maxLength==="number"?Math.min(ti,Z.maxLength):ti,X=J.length;if(X>Y)throw SyntaxError(`Input length: ${X}, exceeds maximum allowed length: ${Y}`);let G={type:"bos",value:"",output:Z.prepend||""},V=[G],K=Z.capture?"":"?:",q=si.globChars(Z.windows),W=si.extglobChars(q),{DOT_LITERAL:H,PLUS_LITERAL:z,SLASH_LITERAL:U,ONE_CHAR:D,DOTS_SLASH:M,NO_DOT:L,NO_DOT_SLASH:A,NO_DOTS_SLASH:E,QMARK:I,QMARK_NO_DOT:P,STAR:R,START_ANCHOR:y}=q,k=(o1)=>{return`(${K}(?:(?!${y}${o1.dot?M:H}).)*?)`},v=Z.dot?"":L,g=Z.dot?I:P,d=Z.bash===!0?k(Z):R;if(Z.capture)d=`(${d})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let b={input:J,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};J=OK.removePrefix(J,b),X=J.length;let a=[],G1=[],t=[],c=G,J1,q1=()=>b.index===X-1,L1=b.peek=(o1=1)=>J[b.index+o1],s=b.advance=()=>J[++b.index]||"",o=()=>J.slice(b.index+1),i=(o1="",F1=0)=>{b.consumed+=o1,b.index+=F1},z1=(o1)=>{b.output+=o1.output!=null?o1.output:o1.value,i(o1.value)},k1=()=>{let o1=1;while(L1()==="!"&&(L1(2)!=="("||L1(3)==="?"))s(),b.start++,o1++;if(o1%2===0)return!1;return b.negated=!0,b.start++,!0},e=(o1)=>{b[o1]++,t.push(o1)},f1=(o1)=>{b[o1]--,t.pop()},P1=(o1)=>{if(c.type==="globstar"){let F1=b.braces>0&&(o1.type==="comma"||o1.type==="brace"),Y1=o1.extglob===!0||a.length&&(o1.type==="pipe"||o1.type==="paren");if(o1.type!=="slash"&&o1.type!=="paren"&&!F1&&!Y1)b.output=b.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=d,b.output+=c.output}if(a.length&&o1.type!=="paren")a[a.length-1].inner+=o1.value;if(o1.value||o1.output)z1(o1);if(c&&c.type==="text"&&o1.type==="text"){c.output=(c.output||c.value)+o1.value,c.value+=o1.value;return}o1.prev=c,V.push(o1),c=o1},I0=(o1,F1)=>{let Y1={...W[F1],conditions:1,inner:""};Y1.prev=c,Y1.parens=b.parens,Y1.output=b.output;let w1=(Z.capture?"(":"")+Y1.open;e("parens"),P1({type:o1,value:F1,output:b.output?"":D}),P1({type:"paren",extglob:!0,value:s(),output:w1}),a.push(Y1)},_1=(o1)=>{let F1=o1.close+(Z.capture?")":""),Y1;if(o1.type==="negate"){let w1=d;if(o1.inner&&o1.inner.length>1&&o1.inner.includes("/"))w1=k(Z);if(w1!==d||q1()||/^\)+$/.test(o()))F1=o1.close=`)$))${w1}`;if(o1.inner.includes("*")&&(Y1=o())&&/^\.[^\\/.]+$/.test(Y1)){let A1=rW1(Y1,{...Q,fastpaths:!1}).output;F1=o1.close=`)${A1})${w1})`}if(o1.prev.type==="bos")b.negatedExtglob=!0}P1({type:"paren",extglob:!0,value:J1,output:F1}),f1("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(J)){let o1=!1,F1=J.replace(c34,(Y1,w1,A1,R1,j1,d1)=>{if(R1==="\\")return o1=!0,Y1;if(R1==="?"){if(w1)return w1+R1+(j1?I.repeat(j1.length):"");if(d1===0)return g+(j1?I.repeat(j1.length):"");return I.repeat(A1.length)}if(R1===".")return H.repeat(A1.length);if(R1==="*"){if(w1)return w1+R1+(j1?d:"");return d}return w1?Y1:`\\${Y1}`});if(o1===!0)if(Z.unescape===!0)F1=F1.replace(/\\/g,"");else F1=F1.replace(/\\+/g,(Y1)=>{return Y1.length%2===0?"\\\\":Y1?"\\":""});if(F1===J&&Z.contains===!0)return b.output=J,b;return b.output=OK.wrapOutput(F1,b,Q),b}while(!q1()){if(J1=s(),J1==="\x00")continue;if(J1==="\\"){let Y1=L1();if(Y1==="/"&&Z.bash!==!0)continue;if(Y1==="."||Y1===";")continue;if(!Y1){J1+="\\",P1({type:"text",value:J1});continue}let w1=/^\\+/.exec(o()),A1=0;if(w1&&w1[0].length>2){if(A1=w1[0].length,b.index+=A1,A1%2!==0)J1+="\\"}if(Z.unescape===!0)J1=s();else J1+=s();if(b.brackets===0){P1({type:"text",value:J1});continue}}if(b.brackets>0&&(J1!=="]"||c.value==="["||c.value==="[^")){if(Z.posix!==!1&&J1===":"){let Y1=c.value.slice(1);if(Y1.includes("[")){if(c.posix=!0,Y1.includes(":")){let w1=c.value.lastIndexOf("["),A1=c.value.slice(0,w1),R1=c.value.slice(w1+2),j1=p34[R1];if(j1){if(c.value=A1+j1,b.backtrack=!0,s(),!G.output&&V.indexOf(c)===1)G.output=D;continue}}}}if(J1==="["&&L1()!==":"||J1==="-"&&L1()==="]")J1=`\\${J1}`;if(J1==="]"&&(c.value==="["||c.value==="[^"))J1=`\\${J1}`;if(Z.posix===!0&&J1==="!"&&c.value==="[")J1="^";c.value+=J1,z1({value:J1});continue}if(b.quotes===1&&J1!=='"'){J1=OK.escapeRegex(J1),c.value+=J1,z1({value:J1});continue}if(J1==='"'){if(b.quotes=b.quotes===1?0:1,Z.keepQuotes===!0)P1({type:"text",value:J1});continue}if(J1==="("){e("parens"),P1({type:"paren",value:J1});continue}if(J1===")"){if(b.parens===0&&Z.strictBrackets===!0)throw SyntaxError(mE("opening","("));let Y1=a[a.length-1];if(Y1&&b.parens===Y1.parens+1){_1(a.pop());continue}P1({type:"paren",value:J1,output:b.parens?")":"\\)"}),f1("parens");continue}if(J1==="["){if(Z.nobracket===!0||!o().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(mE("closing","]"));J1=`\\${J1}`}else e("brackets");P1({type:"bracket",value:J1});continue}if(J1==="]"){if(Z.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){P1({type:"text",value:J1,output:`\\${J1}`});continue}if(b.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(mE("opening","["));P1({type:"text",value:J1,output:`\\${J1}`});continue}f1("brackets");let Y1=c.value.slice(1);if(c.posix!==!0&&Y1[0]==="^"&&!Y1.includes("/"))J1=`/${J1}`;if(c.value+=J1,z1({value:J1}),Z.literalBrackets===!1||OK.hasRegexChars(Y1))continue;let w1=OK.escapeRegex(c.value);if(b.output=b.output.slice(0,-c.value.length),Z.literalBrackets===!0){b.output+=w1,c.value=w1;continue}c.value=`(${K}${w1}|${c.value})`,b.output+=c.value;continue}if(J1==="{"&&Z.nobrace!==!0){e("braces");let Y1={type:"brace",value:J1,output:"(",outputIndex:b.output.length,tokensIndex:b.tokens.length};G1.push(Y1),P1(Y1);continue}if(J1==="}"){let Y1=G1[G1.length-1];if(Z.nobrace===!0||!Y1){P1({type:"text",value:J1,output:J1});continue}let w1=")";if(Y1.dots===!0){let A1=V.slice(),R1=[];for(let j1=A1.length-1;j1>=0;j1--){if(V.pop(),A1[j1].type==="brace")break;if(A1[j1].type!=="dots")R1.unshift(A1[j1].value)}w1=l34(R1,Z),b.backtrack=!0}if(Y1.comma!==!0&&Y1.dots!==!0){let A1=b.output.slice(0,Y1.outputIndex),R1=b.tokens.slice(Y1.tokensIndex);Y1.value=Y1.output="\\{",J1=w1="\\}",b.output=A1;for(let j1 of R1)b.output+=j1.output||j1.value}P1({type:"brace",value:J1,output:w1}),f1("braces"),G1.pop();continue}if(J1==="|"){if(a.length>0)a[a.length-1].conditions++;P1({type:"text",value:J1});continue}if(J1===","){let Y1=J1,w1=G1[G1.length-1];if(w1&&t[t.length-1]==="braces")w1.comma=!0,Y1="|";P1({type:"comma",value:J1,output:Y1});continue}if(J1==="/"){if(c.type==="dot"&&b.index===b.start+1){b.start=b.index+1,b.consumed="",b.output="",V.pop(),c=G;continue}P1({type:"slash",value:J1,output:U});continue}if(J1==="."){if(b.braces>0&&c.type==="dot"){if(c.value===".")c.output=H;let Y1=G1[G1.length-1];c.type="dots",c.output+=J1,c.value+=J1,Y1.dots=!0;continue}if(b.braces+b.parens===0&&c.type!=="bos"&&c.type!=="slash"){P1({type:"text",value:J1,output:H});continue}P1({type:"dot",value:J1,output:H});continue}if(J1==="?"){if(!(c&&c.value==="(")&&Z.noextglob!==!0&&L1()==="("&&L1(2)!=="?"){I0("qmark",J1);continue}if(c&&c.type==="paren"){let w1=L1(),A1=J1;if(c.value==="("&&!/[!=<:]/.test(w1)||w1==="<"&&!/<([!=]|\w+>)/.test(o()))A1=`\\${J1}`;P1({type:"text",value:J1,output:A1});continue}if(Z.dot!==!0&&(c.type==="slash"||c.type==="bos")){P1({type:"qmark",value:J1,output:P});continue}P1({type:"qmark",value:J1,output:I});continue}if(J1==="!"){if(Z.noextglob!==!0&&L1()==="("){if(L1(2)!=="?"||!/[!=<:]/.test(L1(3))){I0("negate",J1);continue}}if(Z.nonegate!==!0&&b.index===0){k1();continue}}if(J1==="+"){if(Z.noextglob!==!0&&L1()==="("&&L1(2)!=="?"){I0("plus",J1);continue}if(c&&c.value==="("||Z.regex===!1){P1({type:"plus",value:J1,output:z});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||b.parens>0){P1({type:"plus",value:J1});continue}P1({type:"plus",value:z});continue}if(J1==="@"){if(Z.noextglob!==!0&&L1()==="("&&L1(2)!=="?"){P1({type:"at",extglob:!0,value:J1,output:""});continue}P1({type:"text",value:J1});continue}if(J1!=="*"){if(J1==="$"||J1==="^")J1=`\\${J1}`;let Y1=d34.exec(o());if(Y1)J1+=Y1[0],b.index+=Y1[0].length;P1({type:"text",value:J1});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=J1,c.output=d,b.backtrack=!0,b.globstar=!0,i(J1);continue}let o1=o();if(Z.noextglob!==!0&&/^\([^?]/.test(o1)){I0("star",J1);continue}if(c.type==="star"){if(Z.noglobstar===!0){i(J1);continue}let Y1=c.prev,w1=Y1.prev,A1=Y1.type==="slash"||Y1.type==="bos",R1=w1&&(w1.type==="star"||w1.type==="globstar");if(Z.bash===!0&&(!A1||o1[0]&&o1[0]!=="/")){P1({type:"star",value:J1,output:""});continue}let j1=b.braces>0&&(Y1.type==="comma"||Y1.type==="brace"),d1=a.length&&(Y1.type==="pipe"||Y1.type==="paren");if(!A1&&Y1.type!=="paren"&&!j1&&!d1){P1({type:"star",value:J1,output:""});continue}while(o1.slice(0,3)==="/**"){let m1=J[b.index+4];if(m1&&m1!=="/")break;o1=o1.slice(3),i("/**",3)}if(Y1.type==="bos"&&q1()){c.type="globstar",c.value+=J1,c.output=k(Z),b.output=c.output,b.globstar=!0,i(J1);continue}if(Y1.type==="slash"&&Y1.prev.type!=="bos"&&!R1&&q1()){b.output=b.output.slice(0,-(Y1.output+c.output).length),Y1.output=`(?:${Y1.output}`,c.type="globstar",c.output=k(Z)+(Z.strictSlashes?")":"|$)"),c.value+=J1,b.globstar=!0,b.output+=Y1.output+c.output,i(J1);continue}if(Y1.type==="slash"&&Y1.prev.type!=="bos"&&o1[0]==="/"){let m1=o1[1]!==void 0?"|$":"";b.output=b.output.slice(0,-(Y1.output+c.output).length),Y1.output=`(?:${Y1.output}`,c.type="globstar",c.output=`${k(Z)}${U}|${U}${m1})`,c.value+=J1,b.output+=Y1.output+c.output,b.globstar=!0,i(J1+s()),P1({type:"slash",value:"/",output:""});continue}if(Y1.type==="bos"&&o1[0]==="/"){c.type="globstar",c.value+=J1,c.output=`(?:^|${U}|${k(Z)}${U})`,b.output=c.output,b.globstar=!0,i(J1+s()),P1({type:"slash",value:"/",output:""});continue}b.output=b.output.slice(0,-c.output.length),c.type="globstar",c.output=k(Z),c.value+=J1,b.output+=c.output,b.globstar=!0,i(J1);continue}let F1={type:"star",value:J1,output:d};if(Z.bash===!0){if(F1.output=".*?",c.type==="bos"||c.type==="slash")F1.output=v+F1.output;P1(F1);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&Z.regex===!0){F1.output=J1,P1(F1);continue}if(b.index===b.start||c.type==="slash"||c.type==="dot"){if(c.type==="dot")b.output+=A,c.output+=A;else if(Z.dot===!0)b.output+=E,c.output+=E;else b.output+=v,c.output+=v;if(L1()!=="*")b.output+=D,c.output+=D}P1(F1)}while(b.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(mE("closing","]"));b.output=OK.escapeLast(b.output,"["),f1("brackets")}while(b.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(mE("closing",")"));b.output=OK.escapeLast(b.output,"("),f1("parens")}while(b.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(mE("closing","}"));b.output=OK.escapeLast(b.output,"{"),f1("braces")}if(Z.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket"))P1({type:"maybe_slash",value:"",output:`${U}?`});if(b.backtrack===!0){b.output="";for(let o1 of b.tokens)if(b.output+=o1.output!=null?o1.output:o1.value,o1.suffix)b.output+=o1.suffix}return b};rW1.fastpaths=(J,Q)=>{let Z={...Q},Y=typeof Z.maxLength==="number"?Math.min(ti,Z.maxLength):ti,X=J.length;if(X>Y)throw SyntaxError(`Input length: ${X}, exceeds maximum allowed length: ${Y}`);J=dF0[J]||J;let{DOT_LITERAL:G,SLASH_LITERAL:V,ONE_CHAR:K,DOTS_SLASH:q,NO_DOT:W,NO_DOTS:H,NO_DOTS_SLASH:z,STAR:U,START_ANCHOR:D}=si.globChars(Z.windows),M=Z.dot?H:W,L=Z.dot?z:W,A=Z.capture?"":"?:",E={negated:!1,prefix:""},I=Z.bash===!0?".*?":U;if(Z.capture)I=`(${I})`;let P=(v)=>{if(v.noglobstar===!0)return I;return`(${A}(?:(?!${D}${v.dot?q:G}).)*?)`},R=(v)=>{switch(v){case"*":return`${M}${K}${I}`;case".*":return`${G}${K}${I}`;case"*.*":return`${M}${I}${G}${K}${I}`;case"*/*":return`${M}${I}${V}${K}${L}${I}`;case"**":return M+P(Z);case"**/*":return`(?:${M}${P(Z)}${V})?${L}${K}${I}`;case"**/*.*":return`(?:${M}${P(Z)}${V})?${L}${I}${G}${K}${I}`;case"**/.*":return`(?:${M}${P(Z)}${V})?${G}${K}${I}`;default:{let g=/^(.*?)\.(\w+)$/.exec(v);if(!g)return;let d=R(g[1]);if(!d)return;return d+G+g[2]}}},y=OK.removePrefix(J,E),k=R(y);if(k&&Z.strictSlashes!==!0)k+=`${V}?`;return k};cF0.exports=rW1});var nk=h((Mf8,nF0)=>{var i34=pF0(),sW1=lF0(),iF0=lk(),n34=ck(),a34=(J)=>J&&typeof J==="object"&&!Array.isArray(J),V3=(J,Q,Z=!1)=>{if(Array.isArray(J)){let H=J.map((U)=>V3(U,Q,Z));return(U)=>{for(let D of H){let M=D(U);if(M)return M}return!1}}let Y=a34(J)&&J.tokens&&J.input;if(J===""||typeof J!=="string"&&!Y)throw TypeError("Expected pattern to be a non-empty string");let X=Q||{},G=X.windows,V=Y?V3.compileRe(J,Q):V3.makeRe(J,Q,!1,!0),K=V.state;delete V.state;let q=()=>!1;if(X.ignore){let H={...Q,ignore:null,onMatch:null,onResult:null};q=V3(X.ignore,H,Z)}let W=(H,z=!1)=>{let{isMatch:U,match:D,output:M}=V3.test(H,V,Q,{glob:J,posix:G}),L={glob:J,state:K,regex:V,posix:G,input:H,output:M,match:D,isMatch:U};if(typeof X.onResult==="function")X.onResult(L);if(U===!1)return L.isMatch=!1,z?L:!1;if(q(H)){if(typeof X.onIgnore==="function")X.onIgnore(L);return L.isMatch=!1,z?L:!1}if(typeof X.onMatch==="function")X.onMatch(L);return z?L:!0};if(Z)W.state=K;return W};V3.test=(J,Q,Z,{glob:Y,posix:X}={})=>{if(typeof J!=="string")throw TypeError("Expected input to be a string");if(J==="")return{isMatch:!1,output:""};let G=Z||{},V=G.format||(X?iF0.toPosixSlashes:null),K=J===Y,q=K&&V?V(J):J;if(K===!1)q=V?V(J):J,K=q===Y;if(K===!1||G.capture===!0)if(G.matchBase===!0||G.basename===!0)K=V3.matchBase(J,Q,Z,X);else K=Q.exec(q);return{isMatch:Boolean(K),match:K,output:q}};V3.matchBase=(J,Q,Z)=>{return(Q instanceof RegExp?Q:V3.makeRe(Q,Z)).test(iF0.basename(J))};V3.isMatch=(J,Q,Z)=>V3(Q,Z)(J);V3.parse=(J,Q)=>{if(Array.isArray(J))return J.map((Z)=>V3.parse(Z,Q));return sW1(J,{...Q,fastpaths:!1})};V3.scan=(J,Q)=>i34(J,Q);V3.compileRe=(J,Q,Z=!1,Y=!1)=>{if(Z===!0)return J.output;let X=Q||{},G=X.contains?"":"^",V=X.contains?"":"$",K=`${G}(?:${J.output})${V}`;if(J&&J.negated===!0)K=`^(?!${K}).*$`;let q=V3.toRegex(K,Q);if(Y===!0)q.state=J;return q};V3.makeRe=(J,Q={},Z=!1,Y=!1)=>{if(!J||typeof J!=="string")throw TypeError("Expected a non-empty string");let X={negated:!1,fastpaths:!0};if(Q.fastpaths!==!1&&(J[0]==="."||J[0]==="*"))X.output=sW1.fastpaths(J,Q);if(!X.output)X=sW1(J,Q);return V3.compileRe(X,Q,Z,Y)};V3.toRegex=(J,Q)=>{try{let Z=Q||{};return new RegExp(J,Z.flags||(Z.nocase?"i":""))}catch(Z){if(Q&&Q.debug===!0)throw Z;return/$^/}};V3.constants=n34;nF0.exports=V3});var fW=h((Lf8,rF0)=>{var aF0=nk(),o34=lk();function oF0(J,Q,Z=!1){if(Q&&(Q.windows===null||Q.windows===void 0))Q={...Q,windows:o34.isWindows()};return aF0(J,Q,Z)}Object.assign(oF0,aF0);rF0.exports=oF0});var gE;var tW1=B1(()=>{gE={name:"amp",description:"The frontier coding agent, with a highly capable `smart` mode and a fast `free` mode. ",private:!0,displayName:"Amp (Research Preview)",version:"0.0.0-dev",publisher:"sourcegraph",license:"Apache-2.0",categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["sourcegraph","amp","amp code","ampcode","ai","assistant","llm","Claude","Claude Sonnet 4.5","GPT-5","agent","free","Claude Sonnet"],icon:"./resources/amp-icon.png",scripts:{dev:"pnpm run -s dev:desktop","dev:insiders":"pnpm run -s dev:desktop:insiders","dev:watch":"NODE_ENV=development bun run scripts/watch.ts","start:dev:desktop":"node scripts/start-dev.js","start:dev:desktop:insiders":"node scripts/start-dev.js --insiders","dev:desktop":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop","dev:desktop:insiders":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop:insiders","build:dev:desktop":"NODE_ENV=development bun run scripts/build.ts",build:"pnpm run -s _build:extension && pnpm run -s _build:web","build:production":"pnpm run -s _build:extension:production && pnpm run -s _build:web:production","_build:extension":"NODE_ENV=development bun run scripts/build.ts","_build:extension:production":"NODE_ENV=production bun run scripts/build.ts","_build:web":"pnpm -C ../web run build && cp -R ../web/build dist/web-build","_build:web:production":"pnpm -C ../web run build:production && cp -R ../web/build dist/web-build","build:icon-font":"npx -y svgtofont --sources ./icon-font/svg --output ./icon-font/build && cp ./icon-font/build/amp-icons.woff ./resources","dev:forks":"pnpm dev:vsix && cursor --install-extension dist/amp-dev.vsix --force && windsurf --install-extension dist/amp-dev.vsix --force","dev:vsix":"pnpm run -s build && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code --install-extension dist/amp-dev.vsix --force","dev:insiders:vsix":"pnpm run -s build && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code-insiders --install-extension dist/amp-dev.vsix --force","prod:vsix":"pnpm run -s build:production && vsce package --no-dependencies --pre-release --out dist/amp-prod.vsix && code --install-extension dist/amp-prod.vsix --force","prod:vsix:test-manual":"bun run scripts/vsix-test-manual.ts","prod:vsix:test-ci":"bun run scripts/vsix-test-ci.ts",test:"vitest run","test:dev":"vitest"},homepage:"https://ampcode.com",repository:{type:"git",url:"https://github.com/sourcegraph/amp",directory:"vscode"},author:{name:"The Amp Team",email:"amp-devs@ampcode.com"},engines:{vscode:"^1.79.0",node:">=22.0.0"},main:"./dist/extension.cjs",activationEvents:["onStartupFinished"],extensionDependencies:["vscode.git"],contributes:{languages:[{id:"jsonc",filenamePatterns:["**/Library/Application Support/ampcode/managed-settings.json","**/etc/ampcode/managed-settings.json","**/ProgramData/ampcode/managed-settings.json"]}],viewsContainers:{activitybar:[{id:"sourcegraph-amp",title:"Amp",icon:"./resources/amp-mark.svg"}]},views:{"sourcegraph-amp":[{type:"webview",id:"amp.sidebarView",name:"Amp",icon:"./resources/amp-mark.svg",visibility:"visible"},{type:"webview",id:"amp.reviewPanel",name:"Review",icon:"$(compare-changes)",visibility:"visible",when:"config.amp.review.separatePanel"}]},commands:[{command:"amp.agent.newThread",title:"New Thread",category:"Amp",icon:"$(add)"},{command:"amp.agent.newWindow",title:"New Agent Window",category:"Amp",icon:"$(browser)",enablement:"amp.activated"},{command:"amp.agent.toggleVisibility",title:"Toggle Agent",category:"Amp"},{command:"amp.agent.openReview",title:"Open Amp Review",category:"Amp",icon:"$(compare-changes)",enablement:"amp.activated"},{command:"amp.agent.focusPromptEditor",title:"Focus Prompt Editor",category:"Amp"},{command:"amp.agent.addSelectionToPromptEditor",title:"Add Selection to Prompt",category:"Amp",enablement:"editorHasSelection"},{command:"amp.agent.switchAgentMode",title:"Switch Agent Mode for Current Thread",category:"Amp",enablement:"amp.hasMultipleVisibleModes"},{command:"amp.agent.findInThread",title:"Find in Thread",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.collapseAllInThread",title:"Collapse All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandAllInThread",title:"Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandToggleInThread",title:"Toggle Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.toggleThreadSwitcher",title:"Switch to Thread...",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.toggleDetailedCostsDisplay",title:"Toggle Detailed Costs",category:"Amp",enablement:"amp.isSourcegraphTeammate"},{command:"amp.agent.navigateThreadPrevious",title:"Navigate to Previous Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",title:"Navigate to Next Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.openThreadJSON",title:"Open Thread JSON",category:"Amp",enablement:"amp.isDevelopmentMode || amp.isSourcegraphTeammate"},{command:"amp.testThreadSummary",title:"Test Thread Summary",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.tab.quickPickMenu",title:"Show Tab Menu",category:"Amp",icon:"$(debug)",enablement:"amp.activated"},{command:"amp.tab.manualTrigger",title:"Tab Manual Trigger",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.enable",title:"Enable Tab",category:"Amp",enablement:"amp.activated && !config.amp.tab.enabled"},{command:"amp.tab.disable",title:"Disable Tab",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.toggleForCurrentDocument",title:"Toggle Tab for Current Document",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.debugInfo",title:"Open Tab Debug Info",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.autoAcceptChain",title:"Accept Suggestion Chain",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.mcp.restartServers",title:"Restart MCP Servers",category:"Amp"},{command:"amp.connect.reconnect",title:"Reconnect",category:"Amp",enablement:"amp.activated"},{command:"amp.agent.editUserPermissions",title:"Edit User Permissions",category:"Amp"},{command:"amp.agent.editWorkspacePermissions",title:"Edit Workspace Permissions",category:"Amp"},{command:"amp.commandPalette.show",title:"Show Amp Command Palette",category:"Amp",icon:"$(list-flat)"}],menus:{"editor/context":[{command:"amp.agent.addSelectionToPromptEditor",when:"editorHasSelection",group:"amp@1"}]},keybindings:[{command:"amp.agent.newThread",key:"ctrl+l",mac:"cmd+l",when:"amp.primaryShortcuts"},{command:"amp.agent.newThread",key:"ctrl+alt+j",mac:"cmd+alt+j",when:"!amp.primaryShortcuts"},{command:"amp.agent.newWindow",key:"ctrl+shift+l",mac:"cmd+shift+l"},{command:"amp.agent.toggleVisibility",key:"ctrl+i",mac:"cmd+i",when:"amp.primaryShortcuts"},{command:"amp.agent.toggleVisibility",key:"ctrl+alt+u",mac:"cmd+alt+u",when:"!amp.primaryShortcuts"},{command:"amp.agent.findInThread",key:"ctrl+f",mac:"cmd+f",when:"amp.agent.active"},{command:"amp.agent.toggleThreadSwitcher",key:"ctrl+k",mac:"cmd+k",when:"amp.agent.active"},{command:"amp.agent.toggleDetailedCostsDisplay",key:"ctrl+d",mac:"cmd+d",when:"amp.agent.active && amp.isSourcegraphTeammate || isWeb"},{command:"amp.agent.navigateThreadPrevious",key:"ctrl+shift+[",mac:"cmd+shift+[",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",key:"ctrl+shift+]",mac:"cmd+shift+]",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.savePermissions",key:"ctrl+s",mac:"cmd+s",enablement:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i",when:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i"},{command:"amp.agent.openReview",key:"ctrl+;",mac:"cmd+;"},{command:"-extension.vim_tab",key:"tab",when:"editorTextFocus && vim.active && vim.mode != 'Insert' && !inlineEditIsVisible && !inDebugRepl"},{command:"-vscode-neovim.send",key:"tab",when:"neovim.init && (editorTextFocus && neovim.mode != insert && editorLangId not in neovim.editorLangIdExclusions || neovim.recording)"},{command:"amp.tab.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.dismiss",key:"escape",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.discard",key:"escape",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.autoAcceptChain",key:"alt+shift+tab",when:"editorTextFocus && amp.activated && (amp.tab.active || amp.nextCursorSuggested) && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.accept",key:"tab",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.discard",key:"escape",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.commandPalette.show",key:"ctrl+shift+a",mac:"cmd+shift+a",when:"amp.activated"},{command:"amp.agent.switchAgentMode",key:"ctrl+shift+m",mac:"cmd+shift+m",when:"amp.activated && amp.hasMultipleVisibleModes"}],configuration:{type:"object",title:"Amp",properties:{"amp.url":{type:"string",examples:["https://ampcode.com/"],description:"URL to the Amp server, usually https://ampcode.com/",scope:"application"},"amp.notifications.enabled":{type:"boolean",default:!0,description:"Play notification sound when done or blocked",scope:"window"},"amp.mcpServers":{type:"object",description:"Model Context Protocol servers that expose tools",additionalProperties:{type:"object",oneOf:[{properties:{command:{type:"string"},args:{type:"array",items:{type:"string"}},env:{type:"object",additionalProperties:{type:"string"}}},required:["command"]},{properties:{url:{type:"string"},headers:{type:"object",description:"HTTP headers to send with requests to the MCP server",additionalProperties:{type:"string"}},oauth:{type:"object",description:"OAuth 2.0 configuration for MCP server authentication",properties:{clientId:{type:"string",description:"OAuth client ID"},clientSecret:{type:"string",description:"OAuth client secret (optional for public clients)"},authUrl:{type:"string",description:"OAuth authorization endpoint URL"},tokenUrl:{type:"string",description:"OAuth token endpoint URL"},scopes:{type:"array",description:"OAuth scopes to request",items:{type:"string"}},redirectUrl:{type:"string",description:"OAuth redirect URL (defaults to http://localhost:8976/oauth/callback)"}}}},required:["url"]}]}},"amp.mcpTrustedServers":{type:"array",markdownDescription:"MCP server trust decisions. **Security Note:** This setting is only read from user settings, never workspace settings, to prevent malicious repositories from auto-approving MCP servers.",scope:"application",items:{type:"object",properties:{serverName:{type:"string",description:"MCP server name"},specHash:{type:"string",description:"Hash of the server configuration"},allow:{type:"boolean",description:"Whether this server is approved"}},required:["serverName","specHash","allow"]}},"amp.workspaces":{type:"array",markdownDescription:"Workspace-level configuration. This setting is only read from user settings, never workspace settings.",scope:"application",items:{type:"object",properties:{path:{type:"string",description:"Absolute path to the workspace"},allowAllMcpServers:{type:"boolean",description:"Whether to automatically trust all MCP servers in this workspace"}},required:["path"]}},"amp.mcpPermissions":{type:"array",description:"Permissions for Model Context Protocol (MCP) servers. Controls which MCP servers can be used.",items:{type:"object",properties:{matches:{$ref:"https://static.ampcode.com/schemas/permissions.schema.json#/$defs/permissionMatchCondition"},action:{type:"string",enum:["allow","reject"],description:"Whether to allow or reject MCP servers matching the condition"}},required:["matches","action"],additionalProperties:!1},default:[],scope:"application"},"amp.permissions":{$ref:"https://static.ampcode.com/schemas/permissions.schema.json",description:"Entries checked in sequence to configure tool permissions",default:[]},"amp.experimental.promptAutocomplete.verboseLogging":{type:"boolean",default:!1,markdownDescription:"Enable verbose logging for prompt autocomplete.",scope:"application"},"amp.experimental.guidanceFilesInContext":{type:"boolean",default:!0,markdownDescription:"Deliver AGENTS.md guidance files in message context instead of system prompt for improved cache efficiency.",scope:"window"},"amp.experimental.tools":{type:"array",description:"Enable experimental tools by name. Available tools: kraken",items:{type:"string"},default:[],scope:"application"},"amp.tools.disable":{type:"array",markdownDescription:'Disable specific tools by name. Glob patterns using * are supported\n\nExamples:\n- Disable edit_file: `["builtin:edit_file"]`\n- Disable all playwright tab tools: `["mcp__playwright__browser_tab*"]`',items:{type:"string"},default:[]},"amp.toolbox.path":{type:"string",markdownDescription:"Path to the directory containing toolbox scripts. Supports colon-separated paths.",scope:"window"},"amp.dangerouslyAllowAll":{type:"boolean",description:"If true, never ask for confirmation when running commands",scope:"window",default:!1},"amp.model.sonnet":{type:"boolean",description:"Use Claude Sonnet 4.5 instead of Claude Opus 4.5",scope:"window",default:!1},"amp.guardedFiles.allowlist":{type:"array",description:"Glob patterns for files that should bypass guarded file protection. Files matching these patterns can be modified without user confirmation.",items:{type:"string"},default:[],scope:"window"},"amp.anthropic.thinking.enabled":{type:"boolean",default:!0,description:"Enable Claude's extended thinking capabilities",scope:"application"},"amp.tools.inactivityTimeout":{type:"number",default:300,minimum:1,maximum:3600,description:"How many seconds of no output to wait before canceling bash commands.",scope:"workspace"},"amp.tools.stopTimeout":{type:"number",default:300,description:"How many seconds to wait before canceling a running tool.",scope:"application"},"amp.terminal.commands.nodeSpawn.loadProfile":{type:"string",enum:["always","never","daily"],default:"always",description:"Before running commands (including MCP servers), whether to load environment variables from the user's profile (.bashrc, .zshrc, .envrc) as visible from the workspace root directory.",scope:"application"},"amp.todos.enabled":{type:"boolean",default:!0,description:"Enable TODOs tracking for managing tasks",scope:"application"},"amp.fuzzy.alwaysIncludePaths":{type:"array",items:{type:"string"},default:[],markdownDescription:"Glob patterns for paths that should always be included in fuzzy file search, even if they are gitignored. Dotfiles and directories starting with `.` are supported.\n\nExamples:\n- `dist/**`\n- `node_modules/@myorg/**`\n- `.hidden/**`",scope:"window"},"amp.guidanceFiles.specs":{type:"boolean",default:!1,description:"[Experimental] Read `*.spec.md` files adjacent to `AGENT.md` files that are read",scope:"window"},"amp.security.audit.logMcpConnections":{type:"boolean",default:!1,description:"Enable telemetry logging for remote MCP server connections (for security auditing)",scope:"application"},"amp.review.separatePanel":{type:"boolean",default:!1,description:"Show the review panel as a separate container that's independently draggable to a different sidebar location.",scope:"window"},"amp.hooks":{type:"array",scope:"window",description:"[Experimental] Hooks are event handlers that can react to specific conditions.",items:{type:"object",properties:{compatibilityDate:{type:"string",const:"2025-05-13",default:"2025-05-13",description:"The version of the hook schema that this value was written to conform to"},id:{type:"string",description:"A unique identifier for the hook",examples:["run-vitest-with-env-vars"]},description:{type:"string",description:"A description of the hook"},on:{oneOf:[{type:"object",properties:{event:{type:"string",const:"tool:pre-execute",default:"tool:pre-execute",description:"Trigger when a tool is about to be executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"},"input.contains":{oneOf:[{type:"string",description:"String pattern to match in the tool input"},{type:"array",items:{type:"string"},description:"String patterns to match in the tool input"}],description:"Trigger only when the tool input contains the given literal string or strings"}},required:["event","tool","input.contains"]},{type:"object",properties:{event:{type:"string",const:"tool:post-execute",default:"tool:post-execute",description:"Trigger after a tool has been executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"}},required:["event","tool"]}]},action:{oneOf:[{type:"object",properties:{type:{type:"string",const:"send-user-message",default:"send-user-message",description:"Send a user message to interrupt the agent and cancel the tool call in the `tool:pre-execute` trigger before it starts to run"},message:{type:"string",description:"The text of the message to send"}},required:["type","message"]},{type:"object",properties:{type:{type:"string",const:"redact-tool-input",default:"redact-tool-input",description:"Redact the tool input after execution. Only allowed with `tool:post-execute` event."},redactedInput:{type:"object",description:"The replacement input data to use instead of the original tool input (must be an object)"}},required:["type","redactedInput"]}]},if:{type:"boolean",description:"A condition that determines whether the hook should be executed",default:!0}},required:["compatibilityDate","id","on","action"]},default:[]},"amp.tab.enabled":{type:"boolean",default:!1,description:"Enable Amp Tab",scope:"application"},"amp.tab.clipboard.enabled":{type:"boolean",default:!0,description:"Enable clipboard access for Amp Tab context",scope:"application"},"amp.tab.verboseLogs":{type:"boolean",default:!1,description:"Enable verbose logging for Amp Tab",scope:"application"},"amp.debug.logReview":{type:"boolean",default:!1,description:"Enable debug logging for review git operations",scope:"application"},"amp.debugLogs":{type:"boolean",default:!1,description:"Enable debug logging in the Amp output channel",scope:"application"},"amp.tab.disabledLanguages":{type:"array",items:{type:"string"},default:[],examples:["markdown","python"],description:"List of language IDs for which Amp Tab is disabled",scope:"application"},"amp.tab.disableOnComment":{type:"boolean",default:!1,description:"Disable Amp Tab completions on comment lines",scope:"application"},"amp.tab.autoImport.enabled":{type:"boolean",default:!0,description:"Enable auto import in Amp Tab",scope:"application"},"amp.tab.dismissCommandIds":{type:"array",items:{type:"string"},default:["extension.vim_escape","vim.escape","vscode-neovim.escape","vscode-neovim.escapeKey"],description:"Command IDs to run when Escape is pressed to dismiss an Amp Tab suggestion",scope:"application"},"amp.tab.experimental.showHotStreakProgress":{type:"boolean",default:!1,description:"Experimental: Show hot streak progress in image-rendered suggestions",scope:"window"},"amp.tab.experimental.autoAccept.delayMs":{type:"number",default:0,description:"Experimental: Delay in milliseconds before auto-accepting Amp Tab suggestions",scope:"application"},"amp.tab.experimental.unobtrusiveDiffs":{type:"boolean",default:!1,description:"Experimental: Enable unobtrusive diffs mode for Amp Tab suggestions. When enabled, suggestions are shown as image overlays to avoid layout shifts and visual interference with existing code.",scope:"application"},"amp.tab.diagnosticTracking":{type:"string",enum:["disabled","same_file","multi_file"],default:"multi_file",description:"Enable diagnostic tracking for Amp Tab suggestions. 'disabled' = no tracking, 'same_file' = track diagnostics within the same file, 'multi_file' = track diagnostics across multiple files.",scope:"application"},"amp.tab.hoverDiagnosticSuggestions":{type:"boolean",default:!1,description:"Show suggestions when hovering over diagnostics.",scope:"application"},"amp.tab.experimental.displayMode":{type:"string",enum:["eager","subtle"],default:"eager",description:"Experimental: Control how Amp Tab suggestions are displayed. 'eager' = show diff immediately, 'subtle' = show 'Tab to Jump' first, then show diff after user interaction.",scope:"application"},"amp.tab.experimental.disableClientFilters":{type:"array",items:{type:"string",enum:["recentlyRejectedCodeToRewrite","recentEdits","rewriteAreaOverlap","bigModification","incompatibleWithSelectedCompletionContextItem","recentlyRejectedDiff","whiteSpaceOnlyChange","formattingOnlyChange"]},default:[],description:"Experimental: Disable specific client-side filters to observe unfiltered model behavior.",scope:"application"},"amp.ui.zoomLevel":{type:"number",default:1,description:"Zoom level for the Amp UI",scope:"application"},"amp.experimental.bookkeeper":{type:"boolean",default:!1,description:"Enable the Bookkeeper subagent for reading and querying Excel workbooks (.xlsx)",scope:"window"},"amp.experimental.planMode":{type:"boolean",default:!1,description:"Enable plan mode for collaborative planning before execution",scope:"window"},"amp.experimental.reviewSubagent":{type:"boolean",default:!1,description:"Enable the review subagent for code review",scope:"window"},"amp.experimental.courseCorrection.enabled":{type:"boolean",default:!1,description:"Enable course correction agent that monitors the thread and provides guidance when the model goes off track",scope:"window"},"amp.experimental.dojoMode":{type:"boolean",default:!1,description:"Enable dojo mode - a learning mode that guides you to discover solutions yourself",scope:"window"},"amp.git.commit.coauthor.enabled":{type:"boolean",default:!0,description:"Enable adding Amp as co-author in git commits",scope:"window"},"amp.git.commit.ampThread.enabled":{type:"boolean",default:!0,description:"Enable adding Amp-Thread trailer in git commits",scope:"window"},"amp.showCosts":{type:"boolean",default:!1,description:"Show cost information for threads",scope:"application"}}},icons:{"amp-agent-file":{description:"Amp agent file",default:{fontPath:"resources/amp-icons.woff",fontCharacter:"\\0041"}}}},capabilities:{untrustedWorkspaces:{supported:"limited",description:"Amp only uses MCP servers from trusted workspaces because they execute code.",restrictedConfigurations:["amp.mcpServers","amp.mcpPermissions","amp.url"]},virtualWorkspaces:{supported:!1,description:"Amp is not supported in virtual workspaces like GitHub.dev because Amp requires local file system access and terminal capabilities."}},dependencies:{"@anthropic-ai/sdk":"catalog:","@opentelemetry/api":"catalog:","@opentelemetry/api-logs":"catalog:","@opentelemetry/core":"catalog:","@opentelemetry/exporter-logs-otlp-http":"catalog:","@opentelemetry/exporter-metrics-otlp-http":"catalog:","@opentelemetry/exporter-trace-otlp-http":"catalog:","@opentelemetry/resources":"catalog:","@opentelemetry/sdk-logs":"catalog:","@opentelemetry/sdk-metrics":"catalog:","@opentelemetry/sdk-node":"catalog:","@opentelemetry/sdk-trace-base":"catalog:","@opentelemetry/sdk-trace-node":"catalog:","@opentelemetry/semantic-conventions":"catalog:","@sourcegraph/amp-core":"workspace:*","@sourcegraph/amp-uri":"workspace:*","@sourcegraph/observable":"workspace:*","canvaskit-wasm":"^0.40.0","detect-indent":"^7.0.1",diff:"catalog:","eventsource-parser":"catalog:","fast-json-stable-stringify":"^2.1.0","fast-myers-diff":"^3.2.0","fast-xml-parser":"^5.2.3",isbinaryfile:"^5.0.5","jsonc-parser":"^3.3.1",lodash:"^4.17.21","lru-cache":"^11.1.0","node-fetch":"^3.3.2",shiki:"3.8.1",systeminformation:"^5.27.7",uuid:"catalog:","vscode-languageserver-textdocument":"^1.0.12","wink-nlp-utils":"^2.1.0",ws:"^8.18.3",zod:"catalog:"},devDependencies:{"@secretlint/secretlint-rule-no-dotenv":"^11.2.5","@secretlint/secretlint-rule-preset-recommend":"^11.2.5","@sourcegraph/amp-web":"workspace:*","@types/bun":"^1.2.17",dedent:"catalog:","@types/diff":"catalog:","@types/jest-image-snapshot":"^6.4.0","@types/lodash":"^4.17.15","@types/node":"catalog:","@types/uuid":"^10.0.0","@types/vscode":"^1.79.0","@types/ws":"^8.18.1","@vscode/test-electron":"^2.4.1","@vscode/vsce":"^3.2.2","cross-env":"^7.0.3","crypto-browserify":"^3.12.1","jest-image-snapshot":"^6.5.0","os-browserify":"^0.3.0","path-browserify":"^1.0.1","rollup-plugin-polyfill-node":"^0.13.0",tsx:"^4.19.4"}}});function s34(J){return typeof J==="number"&&Number.isInteger(J)&&J>=1&&J<=3600}function tF0(J){let Q=J.settings["tools.inactivityTimeout"],Z=J.settings["tools.stopTimeout"],Y=Q;if(Y===void 0&&Z!==void 0)Y=Z;if(Y===void 0)Y=gE.contributes.configuration.properties["amp.tools.inactivityTimeout"].default;if(!s34(Y))return null;return Y*1000}function eF0(J){let Q=J.settings["tools.stopTimeout"],Z=gE.contributes.configuration.properties["amp.tools.stopTimeout"].default;return(Q??Z)*1000}var sF0;var ei=B1(()=>{tW1();sF0=gE.contributes.configuration.properties});function K3(J){let Q=A8[J];return`${Q.provider}/${Q.name}`}function uJ(J){let Q=J.indexOf("/");if(Q===-1)throw Error(`Invalid provider/model format: ${J}`);let Z=J.slice(0,Q),Y=J.slice(Q+1);for(let X of Object.values(A8))if(X.provider===Z&&X.name===Y)return X;switch(Z){case"anthropic":return A8.CLAUDE_SONNET_4_5;case"openai":return A8.GPT_5;case"xai":return A8.GROK_CODE_FAST_1;case"cerebras":return A8.Z_AI_GLM_4_6;case"fireworks":return A8.FIREWORKS_GLM_4P6;case"moonshotai":return A8.KIMI_K2_INSTRUCT;case"openrouter":return A8.SONOMA_SKY_ALPHA;case"groq":return A8.GPT_OSS_120B;case"vertexai":return A8.GEMINI_2_5_FLASH_PREVIEW_09_2025;default:throw Error(`Unknown provider: ${Z}`)}}function JU0(J){for(let Q of Object.values(A8))if(Q.name===J)return Q;return}function MZ(J){let Q=J.indexOf("/");if(Q===-1)return J;return J.slice(Q+1)}function wG(J,Q){let Z=uJ(J);if(Q&&Z.maxInputTokensInFreeMode)return Z.maxInputTokensInFreeMode;return Z.contextWindow-Z.maxOutputTokens}function QU0(J){return J?.pricing?.cacheTTL??300}var Y9,A8,eW1;var RQ=B1(()=>{Y9={ANTHROPIC:"anthropic",OPENAI:"openai",XAI:"xai",CEREBRAS:"cerebras",FIREWORKS:"fireworks",GROQ:"groq",MOONSHOT:"moonshotai",OPENROUTER:"openrouter",VERTEXAI:"vertexai"},A8={CLAUDE_SONNET_4:{provider:Y9.ANTHROPIC,name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",contextWindow:1e6,maxOutputTokens:32000,pricing:{input:3,output:15,cached:0.3,cacheWrite:3.75,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_SONNET_4_5:{provider:Y9.ANTHROPIC,name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",contextWindow:1e6,maxOutputTokens:32000,pricing:{input:3,output:15,cached:0.3,cacheWrite:3.75,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4:{provider:Y9.ANTHROPIC,name:"claude-opus-4-20250514",displayName:"Claude Opus 4",contextWindow:200000,maxOutputTokens:32000,pricing:{input:15,output:75,cached:1.5,cacheWrite:18.75,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4_1:{provider:Y9.ANTHROPIC,name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",contextWindow:200000,maxOutputTokens:32000,pricing:{input:15,output:75,cached:1.5,cacheWrite:18.75,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4_5:{provider:Y9.ANTHROPIC,name:"claude-opus-4-5-20251101",displayName:"Claude Opus 4.5",contextWindow:200000,maxOutputTokens:32000,pricing:{input:5,output:25,cached:0.5,cacheWrite:6.25,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_HAIKU_4_5:{provider:Y9.ANTHROPIC,name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",contextWindow:200000,maxOutputTokens:64000,pricing:{input:1,output:5,cached:0.1,cacheWrite:1.25,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0},maxInputTokensInFreeMode:120000},GPT_5:{provider:Y9.OPENAI,name:"gpt-5",displayName:"GPT-5",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_1:{provider:Y9.OPENAI,name:"gpt-5.1",displayName:"GPT-5.1",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_CODEX:{provider:Y9.OPENAI,name:"gpt-5-codex",displayName:"GPT-5 Codex",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,tools:!0}},GPT_5_1_CODEX:{provider:Y9.OPENAI,name:"gpt-5.1-codex",displayName:"GPT-5.1 Codex",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,tools:!0}},GPT_5_MINI:{provider:Y9.OPENAI,name:"gpt-5-mini",displayName:"GPT-5 Mini",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.25,output:2,cached:0.025},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_NANO:{provider:Y9.OPENAI,name:"gpt-5-nano",displayName:"GPT-5 Nano",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.05,output:0.4,cached:0.005},capabilities:{reasoning:!0,vision:!0,tools:!0}},O3:{provider:Y9.OPENAI,name:"o3",displayName:"o3",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:2,output:8,cached:0.5},capabilities:{reasoning:!0,tools:!0}},O3_MINI:{provider:Y9.OPENAI,name:"o3-mini",displayName:"o3-mini",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:1.1,output:4.4,cached:0.55},capabilities:{reasoning:!0,tools:!0}},GPT_OSS_120B:{provider:Y9.OPENAI,name:"openai/gpt-oss-120b",displayName:"GPT OSS 120B",contextWindow:128000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GROK_CODE_FAST_1:{provider:Y9.XAI,name:"grok-code-fast-1",displayName:"Grok Code Fast 1",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GEMINI_2_5_PRO:{provider:Y9.VERTEXAI,name:"gemini-2.5-pro",displayName:"Gemini 2.5 Pro",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH:{provider:Y9.VERTEXAI,name:"gemini-2.5-flash",displayName:"Gemini 2.5 Flash",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_PREVIEW_09_2025:{provider:Y9.VERTEXAI,name:"gemini-2.5-flash-preview-09-2025",displayName:"Gemini 2.5 Flash (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_LITE:{provider:Y9.VERTEXAI,name:"gemini-2.5-flash-lite",displayName:"Gemini 2.5 Flash Lite",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025:{provider:Y9.VERTEXAI,name:"gemini-2.5-flash-lite-preview-09-2025",displayName:"Gemini 2.5 Flash Lite (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_3_PRO_PREVIEW:{provider:Y9.VERTEXAI,name:"gemini-3-pro-preview",displayName:"Gemini 3 Pro Preview",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},VERTEXAI_GEMINI3_FLASH:{provider:Y9.VERTEXAI,name:"fiercefalcon",displayName:"Gemini 3 Flash",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},Z_AI_GLM_4_6:{provider:Y9.CEREBRAS,name:"zai-glm-4.6",displayName:"Z.ai GLM 4.6",contextWindow:131000,maxOutputTokens:40000,capabilities:{tools:!0}},FIREWORKS_QWEN3_CODER_480B:{provider:Y9.FIREWORKS,name:"accounts/fireworks/models/qwen3-coder-480b-a35b-instruct",displayName:"Qwen3 Coder 480B",contextWindow:230144,maxOutputTokens:32000,capabilities:{tools:!0}},FIREWORKS_KIMI_K2_INSTRUCT:{provider:Y9.FIREWORKS,name:"accounts/fireworks/models/kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:230144,maxOutputTokens:32000,capabilities:{tools:!0}},FIREWORKS_QWEN3_235B:{provider:Y9.FIREWORKS,name:"accounts/fireworks/models/qwen3-235b-a22b-instruct-2507",displayName:"Qwen3 235B",contextWindow:230144,maxOutputTokens:32000,capabilities:{tools:!0}},FIREWORKS_GLM_4P6:{provider:Y9.FIREWORKS,name:"accounts/fireworks/models/glm-4p6",displayName:"GLM 4P6",contextWindow:162752,maxOutputTokens:40000,capabilities:{tools:!0,reasoning:!0}},KIMI_K2_INSTRUCT:{provider:Y9.MOONSHOT,name:"kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0}},SONOMA_SKY_ALPHA:{provider:Y9.OPENROUTER,name:"sonoma-sky-alpha",displayName:"Sonoma Sky Alpha",contextWindow:256000,maxOutputTokens:32000,capabilities:{tools:!0}},OPENROUTER_GLM_4_6:{provider:Y9.OPENROUTER,name:"z-ai/glm-4.6",displayName:"OpenRouter GLM 4.6",contextWindow:131000,maxOutputTokens:40000,capabilities:{tools:!0}},OPENROUTER_KIMI_K2_0905:{provider:Y9.OPENROUTER,name:"moonshotai/kimi-k2-0905",displayName:"Kimi K2 0905 (OpenRouter)",contextWindow:262144,maxOutputTokens:32000,capabilities:{tools:!0}},OPENROUTER_QWEN3_CODER_480B:{provider:Y9.OPENROUTER,name:"qwen/qwen3-coder",displayName:"Qwen3 Coder 480B (OpenRouter)",contextWindow:262144,maxOutputTokens:32000,capabilities:{tools:!0}},OPENROUTER_QWEN3_235B:{provider:Y9.OPENROUTER,name:"qwen/qwen3-235b-a22b-2507",displayName:"Qwen3 235B A22B (OpenRouter)",contextWindow:262144,maxOutputTokens:32000,capabilities:{tools:!0}}};eW1={FINDER:"finder"}});function JH1(J,Q){let Z=wK(Q);if(!Z)return!1;if(t34.has(J)){let Y=Z.finder??eW1.FINDER,X=e34[Y];if(J!==X)return!1}if(Z.includeTools)return Z.includeTools.includes(J);return!0}function gX(J,Q){let Z=J?.["internal.visibleModes"]??[];return Object.values(uE).filter((Y)=>{if(Z.includes(`!${Y.key}`))return!1;if(Q===!1&&P9(Y.key))return!1;let G="visible"in Y?Y.visible:!1,V=Z.includes(Y.key),K=Y.key==="plan"&&J?.["experimental.planMode"]===!0,q=J?.["experimental.dojoMode"]===!0;if(Y.key==="free-dojo")return q&&(Q===!0||Q===void 0);if(Y.key==="dojo")return q&&(Q===!1||Q===void 0);return G||V||K}).map((Y)=>({mode:Y.key,description:"description"in Y?Y.description:void 0})).sort((Y,X)=>Y.mode.localeCompare(X.mode))}function wK(J){return Object.values(uE).find((Q)=>Q.key===J)}function YM(J){return wK(J)?.primaryModel??K3("CLAUDE_SONNET_4_5")}function ak(J){let Q=wK(J);if(!Q)return!1;return uJ(Q.primaryModel).capabilities?.vision??!1}function P9(J){return J==="free"||J.startsWith("free-")}function QH1(J,Q){return Q.find((Z)=>Z.mode===J)?.description}function ZH1(J,Q){let Y=(Q.findIndex((G)=>G.mode===J)+1)%Q.length;return Q[Y]?.mode??"smart"}var t34,e34,XU0,$U0,J24,Q24,ZU0,Z24,YU0,uE,Y24;var EG=B1(()=>{RQ();t34=new Set(["finder"]),e34={finder:"finder"},XU0={r:0,g:55,b:0},$U0={r:0,g:255,b:136},J24=["Read","Grep","glob","finder","Bash","create_file","edit_file","format_file","get_diagnostics","web_search","read_web_page","todo_read","todo_write","read_thread","find_thread","skill","tool_search","load_tool"],Q24=["Read","Grep","glob","finder","Bash","create_file","edit_file","format_file","undo_edit","get_diagnostics","web_search","read_web_page","read_mcp_resource","mermaid","read_thread","find_thread","skill","oracle","librarian","Task","kraken","look_at","tool_search","load_tool"],ZU0=["Read","Grep","glob","finder","Bash","get_diagnostics","web_search","read_web_page","mermaid","tool_search","load_tool"],Z24=["Read","Grep","glob","finder","librarian","edit_plan","read_plan","read_thread","web_search","read_web_page","tool_search","load_tool"],YU0=["Read","Grep","glob","finder","Bash","create_file","edit_file","format_file","undo_edit","get_diagnostics","web_search","read_web_page","read_mcp_resource","mermaid","todo_read","todo_write","read_thread","find_thread","skill","oracle","painter","librarian","Task","kraken","look_at","code_review","tool_search","load_tool"],uE={SMART:{key:"smart",displayName:"Smart",description:"The most capable model and set of tools",primaryModel:K3("CLAUDE_OPUS_4_5"),includeTools:YU0,visible:!0,uiHints:{labelAnimation:"glow",primaryColor:{r:0,g:55,b:20},secondaryColor:{r:0,g:255,b:136}}},FREE:{key:"free",displayName:"Free",description:"Amp Free",primaryModel:K3("CLAUDE_HAIKU_4_5"),includeTools:J24,visible:!0,uiHints:{primaryColor:{r:0,g:26,b:51},secondaryColor:{r:0,g:184,b:255}}},RUSH:{key:"rush",displayName:"Rush",description:"Faster and cheaper for small, well-defined tasks",primaryModel:K3("CLAUDE_HAIKU_4_5"),includeTools:Q24,visible:!0,uiHints:{fasterAnimation:!0,labelAnimation:"jitter",primaryColor:{r:128,g:51,b:0},secondaryColor:{r:255,g:215,b:0}}},PLAN:{key:"plan",displayName:"Plan",description:"Collaborative planning mode",primaryModel:K3("GPT_5_1_CODEX"),includeTools:Z24,visible:!1,uiHints:{primaryColor:{r:192,g:80,b:192},secondaryColor:{r:64,g:64,b:255}}},LARGE:{key:"large",displayName:"Large",description:"The biggest context window possible (Sonnet 4.5 1M tokens), for large tasks",primaryModel:K3("CLAUDE_SONNET_4_5"),includeTools:YU0,visible:!1,uiHints:{labelAnimation:"glow",primaryColor:{r:42,g:26,b:77},secondaryColor:{r:153,g:102,b:255}}},DOJO_FREE:{key:"free-dojo",displayName:"Dojo (Free)",description:"Learning mode - guides you to discover solutions yourself",primaryModel:K3("CLAUDE_HAIKU_4_5"),includeTools:ZU0,visible:!1,uiHints:{primaryColor:{r:26,g:77,b:46},secondaryColor:{r:212,g:175,b:55}}},DOJO:{key:"dojo",displayName:"Dojo",description:"Learning mode - guides you to discover solutions yourself",primaryModel:K3("CLAUDE_SONNET_4_5"),includeTools:ZU0,visible:!1,uiHints:{primaryColor:{r:26,g:77,b:46},secondaryColor:{r:212,g:175,b:55}}}},Y24=Object.values(uE).map((J)=>J.key)});function Jn(J,Q,Z){if(J.startsWith("mcp__"))return Q.allowMcp??!1;if(J.startsWith("tb__")){if(!(Q.allowToolbox??!1))return!1;let Y="subagentType"in Q?Q.subagentType:void 0;if(Y&&Z){if(!Z.subagentTypes)return!1;return Z.subagentTypes.includes("all")||Z.subagentTypes.includes(Y)}return!0}return Q.includeTools.includes(J)}var X24,$24,YH1,G24,V24,K24,q24,W24,H24,q7,Rf8;var IG=B1(()=>{RQ();X24=["read_github","search_github","commit_search","diff","list_directory_github","list_repositories","glob_github"],$24=["Grep","glob","Read"],YH1=["Read","Grep","glob","web_search","read_web_page","read_thread","find_thread"],G24=["Read","Grep","glob","Bash","edit_file","create_file","format_file","get_diagnostics","web_search","read_web_page","finder"],V24=["Grep","glob","Read","Bash","edit_file","create_file","format_file","read_web_page","get_diagnostics","web_search","finder"],K24=["Read","glob","Grep","enqueue_file_edit","fastmod"],q24=["create_file","edit_file","glob","Read","Grep","format_file","get_diagnostics"],W24=["describe_workbook","execute_query"],H24=["Read","Grep","glob","web_search","read_web_page","Bash"],q7={finder:{key:"finder",displayName:"Finder",model:K3("CLAUDE_HAIKU_4_5"),includeTools:$24,allowMcp:!1,allowToolbox:!1},oracle:{key:"oracle",displayName:"Oracle",model:K3("GPT_5_1"),includeTools:YH1,allowMcp:!1,allowToolbox:!1},painter:{key:"painter",displayName:"Painter",model:K3("GEMINI_3_PRO_PREVIEW"),includeTools:G24,allowMcp:!1,allowToolbox:!1},librarian:{key:"librarian",displayName:"Librarian",model:K3("CLAUDE_HAIKU_4_5"),includeTools:X24,allowMcp:!1,allowToolbox:!1},"task-subagent":{key:"task-subagent",displayName:"Task Subagent",model:void 0,includeTools:V24,allowMcp:!0,allowToolbox:!0},"kraken-scope":{key:"kraken-scope",displayName:"Kraken Scope",model:K3("CLAUDE_HAIKU_4_5"),includeTools:K24,allowMcp:!1,allowToolbox:!0,subagentType:"scope"},"kraken-executor":{key:"kraken-executor",displayName:"Kraken Executor",model:K3("CLAUDE_HAIKU_4_5"),includeTools:q24,allowMcp:!1,allowToolbox:!0,subagentType:"executor"},bookkeeper:{key:"bookkeeper",displayName:"Bookkeeper",model:K3("CLAUDE_HAIKU_4_5"),includeTools:W24,allowMcp:!1,allowToolbox:!1},"code-review":{key:"code-review",displayName:"Code Review",model:K3("CLAUDE_SONNET_4_5"),includeTools:H24,allowMcp:!1,allowToolbox:!1}},Rf8=Object.keys(q7)});function GU0(J,Q){return new t1((Z)=>{let Y=setTimeout(X,Q);function X(){Z.error(Error(`Tool execution timed out after ${Q/1000} seconds`))}function G(){if(Y)clearTimeout(Y);Y=setTimeout(X,Q)}let V=J.subscribe({next:(K)=>{G(),Z.next(K)},error:(K)=>{if(Y)clearTimeout(Y),Y=null;Z.error(K)},complete:()=>{if(Y)clearTimeout(Y),Y=null;Z.complete()}});return()=>{if(Y)clearTimeout(Y),Y=null;V.unsubscribe()}})}var VU0=B1(()=>{i0()});function W7(J,Q){let Z={name:Q.name,description:Q.description,inputSchema:Q.inputSchema,source:Q.source,meta:Q.meta,customizedForModel:!1},Y=Q.modelCustomizations;if(Y){for(let X of Y)if(X.modelSelector.test(J))Z={...Z,name:X.name??Z.name,description:X.description??Z.description,inputSchema:X.inputSchema??Z.inputSchema,customizedForModel:!0}}return Z}function q3(J){return["done","error","rejected-by-user","cancelled"].includes(J.status)}function WU0(J){return["done","error","cancelled"].includes(J.status)}function XH1(J){return typeof J==="object"&&"key"in J}function Qn(J){let Q=[],Z=new g4,Y;function X(V,K){let q=Q.filter((W)=>W.spec.name===V);if(q.length===0){let W=V.toLowerCase();q=Q.filter((H)=>H.spec.name.toLowerCase()===W)}for(let W of q)if(dE(W.spec,K).enabled)return W;return}function G(V,K,q){if(!V)throw Error("spec is required");let W=Q.findIndex((L)=>L.spec.name===V.name),H=W!==-1?Q[W]:void 0;if(V.source!=="builtin"&&H?.spec.source==="builtin")return x.warn("Ignoring external tool registration - builtin takes precedence",{toolName:V.name,externalSource:V.source}),{dispose:()=>{}};let D={spec:V,fn:Promise.resolve(K),preprocessArgs:q};if(H&&JSON.stringify(H.spec.source)===JSON.stringify(V.source))Q[W]=D;else Q.push(D);return Z.next(),{dispose:()=>{let L=Q.indexOf(D);if(L!==-1)Q.splice(L,1),Z.next()}}}return J.configService.config.subscribe((V)=>{Y=V}),{registerTool({spec:V,fn:K,preprocessArgs:q}){if(!K)return z24;return G(V,K,q)},tools:y8(J.configService.config,Z.pipe(L8(void 0))).pipe(Q6(([V])=>{return Q.map((K)=>({spec:K.spec,...dE(K.spec,V)})).sort((K,q)=>K.spec.name.localeCompare(q.spec.name))})),invokeTool(V,K,q){let W=performance.now(),H=()=>F24.record(performance.now()-W,{toolName:V});if(V===GH1&&K.args&&"invalid_tool_name"in K.args&&typeof K.args.invalid_tool_name==="string"){pE.add(1,{toolName:V,error:"invalid"});let D=$H1(K.args.invalid_tool_name);return new t1((M)=>{M.error(Error(D))})}let z=X(V,q.config);if(!z){let D=V.toLowerCase(),M=Q.filter((I)=>I.spec.name.toLowerCase()===D);if(M.length===0)return pE.add(1,{toolName:V,error:"not_found"}),new t1((I)=>{I.error(Error(`tool ${JSON.stringify(V)} not found`))});let L=M[0],A=dE(L.spec,q.config);pE.add(1,{toolName:V,error:"disabled"});let E=A.enabled?"unknown":A.disabledReason;return new t1((I)=>{I.error(Error(`tool ${JSON.stringify(V)} is disabled: ${E}`))})}let U=q.subagentSpec??q.agentMode;if(U&&!this.isToolAllowed(V,U)){pE.add(1,{toolName:V,error:"disabled"});let D=XH1(U)?U.displayName??U.key:`${U} mode`;return new t1((M)=>{M.error(Error(`tool ${JSON.stringify(V)} is not allowed for ${D}`))})}if(q.thread.mainThreadID&&!q.subagentSpec&&!Jn(V,q7["task-subagent"]))return pE.add(1,{toolName:V,error:"disabled"}),new t1((D)=>{D.error(Error(`tool ${JSON.stringify(V)} is not allowed for subagents`))});return pE.add(1,{toolName:V}),x6(()=>z.fn).pipe(B4((D)=>{let M=D(K,q);if(z.spec.meta?.disableTimeout)return M;return GU0(M,eF0(q.config))}),LG(()=>H()))},preprocessArgs(V,K,q){let W=X(V,q.config);if(!W||!W.preprocessArgs)return;let H=W.preprocessArgs;try{return H(K,q)}catch(z){x.error("preprocessArgs",{id:V,args:K,error:String(z)});return}},isToolAllowed(V,K){let q=Q.find((H)=>H.spec.name===V),W=q?.spec.source;if(typeof W==="object"&&(("mcp"in W)||("toolbox"in W)))return!0;if(XH1(K))return Jn(V,K,q?.spec.meta);return JH1(V,K)},getTools(V){return y8(J.configService.config,Z.pipe(L8(void 0))).pipe(Q6(([K])=>{return Q.filter((q)=>{if(XH1(V))return Jn(q.spec.name,V,q.spec.meta);let W=q.spec.source;if(typeof W==="object"&&(("mcp"in W)||("toolbox"in W)))return!0;return JH1(q.spec.name,V)}).map((q)=>({spec:q.spec,...dE(q.spec,K)})).sort((q,W)=>q.spec.name.localeCompare(W.spec.name))}))},getToolsForMode(V,K){if(K)return this.getTools(q7["task-subagent"]);return this.getTools(V)},getExecutionProfile(V){if(!Y)return;return X(V,Y)?.spec.executionProfile},dispose(){}}}function ok(J,Q){for(let Z of Q){if(Z==="")continue;if(Z.length===1){if(Z==="*")return!0;if(Z===J)return!0;continue}if(J===Z)return!0;if(Z.includes("*")||Z.includes("?")||Z.includes("[")||Z.includes("{"))try{if(qU0.default(Z,{dot:!0})(J))return!0}catch(Y){continue}}return!1}function dE(J,Q){let Z=Q.settings?.["tools.disable"]??[];if(ok(J.name,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"mcp"in J.source){let Y=U24(J.name);if(Y){if(J.source.mcp.replace(/[\s-]+/g,"_")===Y.server){if(ok(Y.tool,Z))return{enabled:!1,disabledReason:"settings"};let G=`mcp__${J.source.mcp}__${Y.tool}`;if(ok(G,Z))return{enabled:!1,disabledReason:"settings"}}}}if(J.source==="builtin"&&ok(`builtin:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"toolbox"in J.source&&ok(`toolbox:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(J.name===t5||J.name===AK){if(Q.settings?.["todos.enabled"])return{enabled:!0};return{enabled:!1,disabledReason:"feature-flag"}}return{enabled:!0}}function $H1(J){return`Invalid tool name ${JSON.stringify(J)}. Tool names must match the pattern ${rk.toString()}. Try again with a valid tool name.`}function U24(J){let[,Q,Z]=J.split(/mcp__([^ ]+)__([^ ]+)/);if(Q&&Z)return{server:Q,tool:Z};return}function Zn(J){return J.filter((Q)=>Q.source==="builtin")}function VH1(J){if(J.status==="in-progress"||J.status==="done"||J.status==="cancelled"||J.status==="error")return J.progress;return}var KU0,qU0,z24,GH1="invalid_tool",rk,HU0,pE,F24;var H7=B1(()=>{i0();U0();ei();EG();IG();VU0();W4();KU0=q6(m6(),1),qU0=q6(fW(),1);z24={dispose(){}};rk=/^[-a-zA-Z0-9_]{1,64}$/,HU0=KU0.metrics.getMeter("tool_service"),pE=HU0.createCounter("tool_service.invocation_count",{description:"Number of tool invocations"}),F24=HU0.createHistogram("tool_service.invocation_latency",{description:"Latency of tool invocations",unit:"ms"})});var DU0=h((BU0)=>{Object.defineProperty(BU0,"__esModule",{value:!0});BU0.calcSlices=BU0.applyPatch=BU0.calcPatch=BU0.lcs=BU0.diff=BU0.diff_core=void 0;function B24(J,Q){let{b:Z,eq:Y,stack_base:X}=J,{i:G,N:V,j:K,M:q,Z:W,stack_top:H}=J;for(;;)switch(Q){case 0:{J:while(V>0&&q>0){Z.fill(0,0,2*W);let z=V-q,U=V+q,D=U&1,M=G+V-1,L=K+q-1,A=(U+D)/2,E;Q:for(let I=0;I<=A;I++){let P=2*Math.max(0,I-q)-I,R=I-2*Math.max(0,I-V);for(let y=P;y<=R;y+=2){let k=Z[y-1-W*Math.floor((y-1)/W)],v=Z[y+1-W*Math.floor((y+1)/W)],g=y===-I||y!==I&&k<v?v:k+1,d=g-y,b=g,a=d;while(b<V&&a<q&&Y(G+b,K+a))b++,a++;if(Z[y-W*Math.floor(y/W)]=b,D===1&&(E=z-y)>=1-I&&E<I&&b+Z[W+E-W*Math.floor(E/W)]>=V)if(I>1||b!==g){X[H++]=G+b,X[H++]=V-b,X[H++]=K+a,X[H++]=q-a,V=g,q=d,W=2*(Math.min(V,q)+1);continue J}else break Q}for(let y=P;y<=R;y+=2){let k=Z[W+y-1-W*Math.floor((y-1)/W)],v=Z[W+y+1-W*Math.floor((y+1)/W)],g=y===-I||y!==I&&k<v?v:k+1,d=g-y,b=g,a=d;while(b<V&&a<q&&Y(M-b,L-a))b++,a++;if(Z[W+y-W*Math.floor(y/W)]=b,D===0&&(E=z-y)>=-I&&E<=I&&b+Z[E-W*Math.floor(E/W)]>=V)if(I>0||b!==g){X[H++]=G+V-g,X[H++]=g,X[H++]=K+q-d,X[H++]=d,V=V-b,q=q-a,W=2*(Math.min(V,q)+1);continue J}else break Q}}if(V===q)continue;if(q>V)G+=V,K+=V,q-=V,V=0;else G+=q,K+=q,V-=q,q=0;break}if(V+q!==0)if(J.pxe===G||J.pye===K)J.pxe=G+V,J.pye=K+q;else{let z=J.pxs;if(J.oxs=J.pxs,J.oxe=J.pxe,J.oys=J.pys,J.oye=J.pye,J.pxs=G,J.pxe=G+V,J.pys=K,J.pye=K+q,z>=0)return J.i=G,J.N=V,J.j=K,J.M=q,J.Z=W,J.stack_top=H,1}}case 1:{if(H===0)return 2;q=X[--H],K=X[--H],V=X[--H],G=X[--H],W=2*(Math.min(V,q)+1),Q=0}}}class zU0{constructor(J){this.state=J,this.c=0,this.result={value:null,done:!1}}[Symbol.iterator](){return this}next(){let{state:J,result:Q}=this;if(this.c>1)return Q.done=!0,Q.value=void 0,Q;let Z=B24(J,this.c);if(this.c=Z,Z===1)return Q.value=[J.oxs,J.oxe,J.oys,J.oye],Q;if(J.pxs>=0)return Q.value=[J.pxs,J.pxe,J.pys,J.pye],Q;return Q.done=!0,Q.value=void 0,Q}}function FU0(J,Q,Z,Y,X){let G=(Math.min(Q,Y)+1)*2,V=Q+Y,K=new(V<256?Uint8Array:V<65536?Uint16Array:Uint32Array)(2*G);return new zU0({i:J,N:Q,j:Z,M:Y,Z:G,b:K,eq:X,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}BU0.diff_core=FU0;function Yn(J,Q,Z){let[Y,X,G]=[0,J.length,Q.length];if(typeof Z==="function"){while(Y<X&&Y<G&&Z(Y,Y))Y++;if(Y===X&&Y===G)return[][Symbol.iterator]();while(Z(--X,--G)&&X>Y&&G>Y);}else{while(Y<X&&Y<G&&J[Y]===Q[Y])Y++;if(Y===X&&Y===G)return[][Symbol.iterator]();while(J[--X]===Q[--G]&&X>Y&&G>Y);Z=(V,K)=>J[V]===Q[K]}return FU0(Y,X+1-Y,Y,G+1-Y,Z)}BU0.diff=Yn;class UU0{constructor(J,Q){this.diff=J,this.N=Q,this.i=0,this.j=0}[Symbol.iterator](){return this}next(){let J=this.diff.next();if(J.done){let{i:K,j:q,N:W}=this;if(K<W)J.done=!1,J.value=[K,q,W-K],this.i=W;return J}let Q=J.value,Z=Q[0],Y=Q[1],X=Q[3],{i:G,j:V}=this;if(G!==Z)Q.length--,Q[0]=G,Q[1]=V,Q[2]=Z-G;return this.i=Y,this.j=X,J}}function N24(J,Q,Z){return new UU0(Yn(J,Q,Z),J.length)}BU0.lcs=N24;function*D24(J,Q,Z){let Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let X of Yn(J,Q,Z))X[2]=Y.call(Q,X[2],X[3]),yield X}BU0.calcPatch=D24;function*M24(J,Q){let Z=0,Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[X,G,V]of Q){if(Z<X)yield Y.call(J,Z,X);if(V.length>0)yield V;Z=G}if(Z<J.length)yield Y.call(J,Z)}BU0.applyPatch=M24;function*L24(J,Q,Z){let Y=0,X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[G,V,K,q]of Yn(J,Q,Z)){if(Y<G)yield[0,X.call(J,Y,G)];if(G<V)yield[-1,X.call(J,G,V)];if(K<q)yield[1,X.call(Q,K,q)];Y=V}if(Y<J.length)yield[0,J.slice(Y)]}BU0.calcSlices=L24});function cE(J,Q){let Z={added:0,deleted:0,changed:0};if(typeof J!=="string"||typeof Q!=="string")return Z;if(J===Q)return Z;try{let Y={added:0,deleted:0,changed:0};for(let[X,G,V,K]of MU0.diff(J.split(`
|
|
70
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let W of this.seen.entries()){let H=W[1];if(J===W[0]){G(W);continue}if(Z.external){let U=Z.external.registry.get(W[0])?.id;if(J!==W[0]&&U){G(W);continue}}if(this.metadataRegistry.get(W[0])?.id){G(W);continue}if(H.cycle){G(W);continue}if(H.count>1){if(Z.reused==="ref"){G(W);continue}}}let V=(W,H)=>{let z=this.seen.get(W),U=z.def??z.schema,D={...U};if(z.ref===null)return;let M=z.ref;if(z.ref=null,M){V(M,H);let L=this.seen.get(M).schema;if(L.$ref&&(H.target==="draft-7"||H.target==="draft-4"||H.target==="openapi-3.0"))U.allOf=U.allOf??[],U.allOf.push(L);else Object.assign(U,L),Object.assign(U,D)}if(!z.isParent)this.override({zodSchema:W,jsonSchema:U,path:z.path??[]})};for(let W of[...this.seen.entries()].reverse())V(W[0],{target:this.target});let K={};if(this.target==="draft-2020-12")K.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")K.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")K.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(Z.external?.uri){let W=Z.external.registry.get(J)?.id;if(!W)throw Error("Schema is missing an `id` property");K.$id=Z.external.uri(W)}Object.assign(K,Y.def);let q=Z.external?.defs??{};for(let W of this.seen.entries()){let H=W[1];if(H.def&&H.defId)q[H.defId]=H.def}if(Z.external);else if(Object.keys(q).length>0)if(this.target==="draft-2020-12")K.$defs=q;else K.definitions=q;try{return JSON.parse(JSON.stringify(K))}catch(W){throw Error("Error converting schema to JSON.")}}}function Tq1(J,Q){if(J instanceof Wk){let Y=new zi(Q),X={};for(let K of J._idmap.entries()){let[q,W]=K;Y.process(W)}let G={},V={registry:J,uri:Q?.uri,defs:X};for(let K of J._idmap.entries()){let[q,W]=K;G[q]=Y.emit(W,{...Q,external:V})}if(Object.keys(X).length>0){let K=Y.target==="draft-2020-12"?"$defs":"definitions";G.__shared={[K]:X}}return{schemas:G}}let Z=new zi(Q);return Z.process(J),Z.emit(J,Q)}function PQ(J,Q){let Z=Q??{seen:new Set};if(Z.seen.has(J))return!1;Z.seen.add(J);let Y=J._zod.def;if(Y.type==="transform")return!0;if(Y.type==="array")return PQ(Y.element,Z);if(Y.type==="set")return PQ(Y.valueType,Z);if(Y.type==="lazy")return PQ(Y.getter(),Z);if(Y.type==="promise"||Y.type==="optional"||Y.type==="nonoptional"||Y.type==="nullable"||Y.type==="readonly"||Y.type==="default"||Y.type==="prefault")return PQ(Y.innerType,Z);if(Y.type==="intersection")return PQ(Y.left,Z)||PQ(Y.right,Z);if(Y.type==="record"||Y.type==="map")return PQ(Y.keyType,Z)||PQ(Y.valueType,Z);if(Y.type==="pipe")return PQ(Y.in,Z)||PQ(Y.out,Z);if(Y.type==="object"){for(let X in Y.shape)if(PQ(Y.shape[X],Z))return!0;return!1}if(Y.type==="union"){for(let X of Y.options)if(PQ(X,Z))return!0;return!1}if(Y.type==="tuple"){for(let X of Y.items)if(PQ(X,Z))return!0;if(Y.rest&&PQ(Y.rest,Z))return!0;return!1}return!1}var qz0=B1(()=>{ll();j4()});var Wz0={};var Hz0=()=>{};var xW={};Q9(xW,{version:()=>CG1,util:()=>L6,treeifyError:()=>_$1,toJSONSchema:()=>Tq1,toDotPath:()=>hW0,safeParseAsync:()=>e_,safeParse:()=>PE,safeEncodeAsync:()=>cW0,safeEncode:()=>pW0,safeDecodeAsync:()=>lW0,safeDecode:()=>dW0,registry:()=>cl,regexes:()=>fX,prettifyError:()=>k$1,parseAsync:()=>t_,parse:()=>s_,meta:()=>Iq1,locales:()=>qk,isValidJWT:()=>qH0,isValidBase64URL:()=>KH0,isValidBase64:()=>sG1,globalRegistry:()=>IQ,globalConfig:()=>g_,formatError:()=>r_,flattenError:()=>o_,encodeAsync:()=>gW0,encode:()=>bW0,describe:()=>Eq1,decodeAsync:()=>uW0,decode:()=>mW0,config:()=>_3,clone:()=>EQ,_xid:()=>Zi,_void:()=>qq1,_uuidv7:()=>rl,_uuidv6:()=>ol,_uuidv4:()=>al,_uuid:()=>nl,_url:()=>zk,_uppercase:()=>Nk,_unknown:()=>Vq1,_union:()=>U54,_undefined:()=>Xq1,_ulid:()=>Qi,_uint64:()=>Zq1,_uint32:()=>rK1,_tuple:()=>D54,_trim:()=>wk,_transform:()=>I54,_toUpperCase:()=>Ik,_toLowerCase:()=>Ek,_templateLiteral:()=>y54,_symbol:()=>Yq1,_superRefine:()=>wq1,_success:()=>j54,_stringbool:()=>Pq1,_stringFormat:()=>_E,_string:()=>fK1,_startsWith:()=>Mk,_slugify:()=>Pk,_size:()=>Fk,_set:()=>A54,_safeParseAsync:()=>TE,_safeParse:()=>IE,_safeEncodeAsync:()=>Rl,_safeEncode:()=>Pl,_safeDecodeAsync:()=>Cl,_safeDecode:()=>Tl,_regex:()=>Uk,_refine:()=>Oq1,_record:()=>M54,_readonly:()=>k54,_property:()=>Dq1,_promise:()=>v54,_positive:()=>Fq1,_pipe:()=>_54,_parseAsync:()=>EE,_parse:()=>wE,_overwrite:()=>MK,_optional:()=>P54,_number:()=>cK1,_nullable:()=>T54,_null:()=>$q1,_normalize:()=>Ok,_nonpositive:()=>Bq1,_nonoptional:()=>C54,_nonnegative:()=>Nq1,_never:()=>Kq1,_negative:()=>Uq1,_nativeEnum:()=>w54,_nanoid:()=>tl,_nan:()=>zq1,_multipleOf:()=>nD,_minSize:()=>aD,_minLength:()=>RF,_min:()=>UZ,_mime:()=>Ak,_maxSize:()=>CE,_maxLength:()=>jE,_max:()=>hX,_map:()=>L54,_mac:()=>bK1,_lte:()=>hX,_lt:()=>kW,_lowercase:()=>Bk,_literal:()=>E54,_length:()=>SE,_lazy:()=>x54,_ksuid:()=>Yi,_jwt:()=>Hi,_isoTime:()=>pK1,_isoDuration:()=>dK1,_isoDateTime:()=>gK1,_isoDate:()=>uK1,_ipv6:()=>$i,_ipv4:()=>Xi,_intersection:()=>N54,_int64:()=>Qq1,_int32:()=>oK1,_int:()=>iK1,_includes:()=>Dk,_guid:()=>Hk,_gte:()=>UZ,_gt:()=>yW,_float64:()=>aK1,_float32:()=>nK1,_file:()=>Lq1,_enum:()=>O54,_endsWith:()=>Lk,_encodeAsync:()=>El,_encode:()=>Ol,_emoji:()=>sl,_email:()=>il,_e164:()=>Wi,_discriminatedUnion:()=>B54,_default:()=>R54,_decodeAsync:()=>Il,_decode:()=>wl,_date:()=>Wq1,_custom:()=>Aq1,_cuid2:()=>Ji,_cuid:()=>el,_coercedString:()=>hK1,_coercedNumber:()=>lK1,_coercedDate:()=>Hq1,_coercedBoolean:()=>tK1,_coercedBigint:()=>Jq1,_cidrv6:()=>Vi,_cidrv4:()=>Gi,_check:()=>Vz0,_catch:()=>S54,_boolean:()=>sK1,_bigint:()=>eK1,_base64url:()=>qi,_base64:()=>Ki,_array:()=>Mq1,_any:()=>Gq1,TimePrecision:()=>mK1,NEVER:()=>u_,JSONSchemaGenerator:()=>zi,JSONSchema:()=>Wz0,Doc:()=>xl,$output:()=>xK1,$input:()=>vK1,$constructor:()=>B0,$brand:()=>O$1,$ZodXID:()=>gG1,$ZodVoid:()=>HV1,$ZodUnknown:()=>qV1,$ZodUnion:()=>pl,$ZodUndefined:()=>GV1,$ZodUUID:()=>kG1,$ZodURL:()=>xG1,$ZodULID:()=>mG1,$ZodType:()=>Y8,$ZodTuple:()=>dl,$ZodTransform:()=>EV1,$ZodTemplateLiteral:()=>xV1,$ZodSymbol:()=>$V1,$ZodSuccess:()=>jV1,$ZodStringFormat:()=>D5,$ZodString:()=>iD,$ZodSet:()=>LV1,$ZodRegistry:()=>Wk,$ZodRecord:()=>DV1,$ZodRealError:()=>FZ,$ZodReadonly:()=>yV1,$ZodPromise:()=>fV1,$ZodPrefault:()=>RV1,$ZodPipe:()=>kV1,$ZodOptional:()=>IV1,$ZodObjectJIT:()=>UV1,$ZodObject:()=>zH0,$ZodNumberFormat:()=>YV1,$ZodNumber:()=>gl,$ZodNullable:()=>PV1,$ZodNull:()=>VV1,$ZodNonOptional:()=>CV1,$ZodNever:()=>WV1,$ZodNanoID:()=>fG1,$ZodNaN:()=>_V1,$ZodMap:()=>MV1,$ZodMAC:()=>aG1,$ZodLiteral:()=>OV1,$ZodLazy:()=>hV1,$ZodKSUID:()=>uG1,$ZodJWT:()=>QV1,$ZodIntersection:()=>NV1,$ZodISOTime:()=>cG1,$ZodISODuration:()=>lG1,$ZodISODateTime:()=>pG1,$ZodISODate:()=>dG1,$ZodIPv6:()=>nG1,$ZodIPv4:()=>iG1,$ZodGUID:()=>_G1,$ZodFunction:()=>vV1,$ZodFile:()=>wV1,$ZodError:()=>a_,$ZodEnum:()=>AV1,$ZodEncodeError:()=>dD,$ZodEmoji:()=>vG1,$ZodEmail:()=>yG1,$ZodE164:()=>JV1,$ZodDiscriminatedUnion:()=>BV1,$ZodDefault:()=>TV1,$ZodDate:()=>zV1,$ZodCustomStringFormat:()=>ZV1,$ZodCustom:()=>bV1,$ZodCodec:()=>Yk,$ZodCheckUpperCase:()=>OG1,$ZodCheckStringFormat:()=>RE,$ZodCheckStartsWith:()=>EG1,$ZodCheckSizeEquals:()=>BG1,$ZodCheckRegex:()=>LG1,$ZodCheckProperty:()=>PG1,$ZodCheckOverwrite:()=>RG1,$ZodCheckNumberFormat:()=>HG1,$ZodCheckMultipleOf:()=>WG1,$ZodCheckMinSize:()=>UG1,$ZodCheckMinLength:()=>DG1,$ZodCheckMimeType:()=>TG1,$ZodCheckMaxSize:()=>FG1,$ZodCheckMaxLength:()=>NG1,$ZodCheckLowerCase:()=>AG1,$ZodCheckLessThan:()=>_l,$ZodCheckLengthEquals:()=>MG1,$ZodCheckIncludes:()=>wG1,$ZodCheckGreaterThan:()=>kl,$ZodCheckEndsWith:()=>IG1,$ZodCheckBigIntFormat:()=>zG1,$ZodCheck:()=>T5,$ZodCatch:()=>SV1,$ZodCUID2:()=>bG1,$ZodCUID:()=>hG1,$ZodCIDRv6:()=>rG1,$ZodCIDRv4:()=>oG1,$ZodBoolean:()=>Zk,$ZodBigIntFormat:()=>XV1,$ZodBigInt:()=>ul,$ZodBase64URL:()=>eG1,$ZodBase64:()=>tG1,$ZodAsyncError:()=>DK,$ZodArray:()=>FV1,$ZodAny:()=>KV1});var BZ=B1(()=>{j4();Sl();yK1();Hz0();ME();x$1();y$1();mV1();yl();jG1();ll();Kz0();qz0()});var Rq1=B1(()=>{BZ()});var Di={};Q9(Di,{time:()=>Sq1,duration:()=>_q1,datetime:()=>Cq1,date:()=>jq1,ZodISOTime:()=>Bi,ZodISODuration:()=>Ni,ZodISODateTime:()=>Fi,ZodISODate:()=>Ui});function Cq1(J){return gK1(Fi,J)}function jq1(J){return uK1(Ui,J)}function Sq1(J){return pK1(Bi,J)}function _q1(J){return dK1(Ni,J)}var Fi,Ui,Bi,Ni;var Mi=B1(()=>{BZ();Li();Fi=B0("ZodISODateTime",(J,Q)=>{pG1.init(J,Q),R5.init(J,Q)});Ui=B0("ZodISODate",(J,Q)=>{dG1.init(J,Q),R5.init(J,Q)});Bi=B0("ZodISOTime",(J,Q)=>{cG1.init(J,Q),R5.init(J,Q)});Ni=B0("ZodISODuration",(J,Q)=>{lG1.init(J,Q),R5.init(J,Q)})});var Fz0=(J,Q)=>{a_.init(J,Q),J.name="ZodError",Object.defineProperties(J,{format:{value:(Z)=>r_(J,Z)},flatten:{value:(Z)=>o_(J,Z)},addIssue:{value:(Z)=>{J.issues.push(Z),J.message=JSON.stringify(J.issues,LE,2)}},addIssues:{value:(Z)=>{J.issues.push(...Z),J.message=JSON.stringify(J.issues,LE,2)}},isEmpty:{get(){return J.issues.length===0}}})},h54,NZ;var kq1=B1(()=>{BZ();BZ();j4();h54=B0("ZodError",Fz0),NZ=B0("ZodError",Fz0,{Parent:Error})});var yq1,xq1,vq1,fq1,hq1,bq1,mq1,gq1,uq1,pq1,dq1,cq1;var lq1=B1(()=>{BZ();kq1();yq1=wE(NZ),xq1=EE(NZ),vq1=IE(NZ),fq1=TE(NZ),hq1=Ol(NZ),bq1=wl(NZ),mq1=El(NZ),gq1=Il(NZ),uq1=Pl(NZ),pq1=Tl(NZ),dq1=Rl(NZ),cq1=Cl(NZ)});function Z0(J){return fK1(Rk,J)}function m54(J){return il(aq1,J)}function g54(J){return Hk(Ai,J)}function u54(J){return nl(vW,J)}function p54(J){return al(vW,J)}function d54(J){return ol(vW,J)}function c54(J){return rl(vW,J)}function oq1(J){return zk(Ei,J)}function l54(J){return zk(Ei,{protocol:/^https?$/,hostname:fX.domain,...L6.normalizeParams(J)})}function i54(J){return sl(rq1,J)}function n54(J){return tl(sq1,J)}function a54(J){return el(tq1,J)}function o54(J){return Ji(eq1,J)}function r54(J){return Qi(JW1,J)}function s54(J){return Zi(QW1,J)}function t54(J){return Yi(ZW1,J)}function e54(J){return Xi(YW1,J)}function J74(J){return bK1(Uz0,J)}function Q74(J){return $i(XW1,J)}function Z74(J){return Gi($W1,J)}function Y74(J){return Vi(GW1,J)}function X74(J){return Ki(VW1,J)}function $74(J){return qi(KW1,J)}function G74(J){return Wi(qW1,J)}function V74(J){return Hi(WW1,J)}function K74(J,Q,Z={}){return _E(Ck,J,Q,Z)}function q74(J){return _E(Ck,"hostname",fX.hostname,J)}function W74(J){return _E(Ck,"hex",fX.hex,J)}function H74(J,Q){let Z=Q?.enc??"hex",Y=`${J}_${Z}`,X=fX[Y];if(!X)throw Error(`Unrecognized hash format: ${Y}`);return _E(Ck,Y,X,Q)}function c9(J){return cK1(jk,J)}function iq1(J){return iK1(kE,J)}function z74(J){return nK1(kE,J)}function F74(J){return aK1(kE,J)}function U74(J){return oK1(kE,J)}function B74(J){return rK1(kE,J)}function M5(J){return sK1(Sk,J)}function N74(J){return eK1(_k,J)}function D74(J){return Qq1(HW1,J)}function M74(J){return Zq1(HW1,J)}function L74(J){return Yq1(Bz0,J)}function A74(J){return Xq1(Nz0,J)}function kk(J){return $q1(Dz0,J)}function zW1(){return Gq1(Mz0)}function P7(){return Vq1(Lz0)}function FW1(J){return Kq1(Az0,J)}function O74(J){return qq1(Oz0,J)}function w74(J){return Wq1(Ii,J)}function v6(J,Q){return Mq1(wz0,J,Q)}function E74(J){let Q=J._zod.def.shape;return M2(Object.keys(Q))}function D6(J,Q){let Z={type:"object",shape:J??{},...L6.normalizeParams(Q)};return new Pi(Z)}function I74(J,Q){return new Pi({type:"object",shape:J,catchall:FW1(),...L6.normalizeParams(Q)})}function a2(J,Q){return new Pi({type:"object",shape:J,catchall:P7(),...L6.normalizeParams(Q)})}function C5(J,Q){return new UW1({type:"union",options:J,...L6.normalizeParams(Q)})}function Ti(J,Q,Z){return new Ez0({type:"union",options:Q,discriminator:J,...L6.normalizeParams(Z)})}function yk(J,Q){return new Iz0({type:"intersection",left:J,right:Q})}function Tz0(J,Q,Z){let Y=Q instanceof Y8,X=Y?Z:Q;return new Pz0({type:"tuple",items:J,rest:Y?Q:null,...L6.normalizeParams(X)})}function f7(J,Q,Z){return new BW1({type:"record",keyType:J,valueType:Q,...L6.normalizeParams(Z)})}function P74(J,Q,Z){let Y=EQ(J);return Y._zod.values=void 0,new BW1({type:"record",keyType:Y,valueType:Q,...L6.normalizeParams(Z)})}function T74(J,Q,Z){return new Rz0({type:"map",keyType:J,valueType:Q,...L6.normalizeParams(Z)})}function R74(J,Q){return new Cz0({type:"set",valueType:J,...L6.normalizeParams(Q)})}function M2(J,Q){let Z=Array.isArray(J)?Object.fromEntries(J.map((Y)=>[Y,Y])):J;return new Tk({type:"enum",entries:Z,...L6.normalizeParams(Q)})}function C74(J,Q){return new Tk({type:"enum",entries:J,...L6.normalizeParams(Q)})}function N4(J,Q){return new jz0({type:"literal",values:Array.isArray(J)?J:[J],...L6.normalizeParams(Q)})}function j74(J){return Lq1(Sz0,J)}function NW1(J){return new _z0({type:"transform",transform:J})}function L4(J){return new DW1({type:"optional",innerType:J})}function Oi(J){return new kz0({type:"nullable",innerType:J})}function S74(J){return L4(Oi(J))}function xz0(J,Q){return new yz0({type:"default",innerType:J,get defaultValue(){return typeof Q==="function"?Q():L6.shallowClone(Q)}})}function fz0(J,Q){return new vz0({type:"prefault",innerType:J,get defaultValue(){return typeof Q==="function"?Q():L6.shallowClone(Q)}})}function hz0(J,Q){return new MW1({type:"nonoptional",innerType:J,...L6.normalizeParams(Q)})}function _74(J){return new bz0({type:"success",innerType:J})}function gz0(J,Q){return new mz0({type:"catch",innerType:J,catchValue:typeof Q==="function"?Q:()=>Q})}function k74(J){return zq1(uz0,J)}function wi(J,Q){return new LW1({type:"pipe",in:J,out:Q})}function y74(J,Q,Z){return new AW1({type:"pipe",in:J,out:Q,transform:Z.decode,reverseTransform:Z.encode})}function dz0(J){return new pz0({type:"readonly",innerType:J})}function x74(J,Q){return new cz0({type:"template_literal",parts:J,...L6.normalizeParams(Q)})}function iz0(J){return new lz0({type:"lazy",getter:J})}function v74(J){return new nz0({type:"promise",innerType:J})}function f74(J){return new az0({type:"function",input:Array.isArray(J?.input)?Tz0(J?.input):J?.input??v6(P7()),output:J?.output??P7()})}function h74(J){let Q=new T5({check:"custom"});return Q._zod.check=J,Q}function OW1(J,Q){return Aq1(Ri,J??(()=>!0),Q)}function oz0(J,Q={}){return Oq1(Ri,J,Q)}function rz0(J){return wq1(J)}function g74(J,Q={error:`Input not instance of ${J.name}`}){let Z=new Ri({type:"custom",check:"custom",fn:(Y)=>Y instanceof J,abort:!0,...L6.normalizeParams(Q)});return Z._zod.bag.Class=J,Z}function p74(J){let Q=iz0(()=>{return C5([Z0(J),c9(),M5(),kk(),v6(Q),f7(Z0(),Q)])});return Q}function Ci(J,Q){return wi(NW1(J),Q)}var x8,nq1,Rk,R5,aq1,Ai,vW,Ei,rq1,sq1,tq1,eq1,JW1,QW1,ZW1,YW1,Uz0,XW1,$W1,GW1,VW1,KW1,qW1,WW1,Ck,jk,kE,Sk,_k,HW1,Bz0,Nz0,Dz0,Mz0,Lz0,Az0,Oz0,Ii,wz0,Pi,UW1,Ez0,Iz0,Pz0,BW1,Rz0,Cz0,Tk,jz0,Sz0,_z0,DW1,kz0,yz0,vz0,MW1,bz0,mz0,uz0,LW1,AW1,pz0,cz0,lz0,nz0,az0,Ri,b74,m74,u74=(...J)=>Pq1({Codec:AW1,Boolean:Sk,String:Rk},...J);var Li=B1(()=>{BZ();BZ();Rq1();Mi();lq1();x8=B0("ZodType",(J,Q)=>{return Y8.init(J,Q),J.def=Q,J.type=Q.type,Object.defineProperty(J,"_def",{value:Q}),J.check=(...Z)=>{return J.clone(L6.mergeDefs(Q,{checks:[...Q.checks??[],...Z.map((Y)=>typeof Y==="function"?{_zod:{check:Y,def:{check:"custom"},onattach:[]}}:Y)]}))},J.clone=(Z,Y)=>EQ(J,Z,Y),J.brand=()=>J,J.register=(Z,Y)=>{return Z.add(J,Y),J},J.parse=(Z,Y)=>yq1(J,Z,Y,{callee:J.parse}),J.safeParse=(Z,Y)=>vq1(J,Z,Y),J.parseAsync=async(Z,Y)=>xq1(J,Z,Y,{callee:J.parseAsync}),J.safeParseAsync=async(Z,Y)=>fq1(J,Z,Y),J.spa=J.safeParseAsync,J.encode=(Z,Y)=>hq1(J,Z,Y),J.decode=(Z,Y)=>bq1(J,Z,Y),J.encodeAsync=async(Z,Y)=>mq1(J,Z,Y),J.decodeAsync=async(Z,Y)=>gq1(J,Z,Y),J.safeEncode=(Z,Y)=>uq1(J,Z,Y),J.safeDecode=(Z,Y)=>pq1(J,Z,Y),J.safeEncodeAsync=async(Z,Y)=>dq1(J,Z,Y),J.safeDecodeAsync=async(Z,Y)=>cq1(J,Z,Y),J.refine=(Z,Y)=>J.check(oz0(Z,Y)),J.superRefine=(Z)=>J.check(rz0(Z)),J.overwrite=(Z)=>J.check(MK(Z)),J.optional=()=>L4(J),J.nullable=()=>Oi(J),J.nullish=()=>L4(Oi(J)),J.nonoptional=(Z)=>hz0(J,Z),J.array=()=>v6(J),J.or=(Z)=>C5([J,Z]),J.and=(Z)=>yk(J,Z),J.transform=(Z)=>wi(J,NW1(Z)),J.default=(Z)=>xz0(J,Z),J.prefault=(Z)=>fz0(J,Z),J.catch=(Z)=>gz0(J,Z),J.pipe=(Z)=>wi(J,Z),J.readonly=()=>dz0(J),J.describe=(Z)=>{let Y=J.clone();return IQ.add(Y,{description:Z}),Y},Object.defineProperty(J,"description",{get(){return IQ.get(J)?.description},configurable:!0}),J.meta=(...Z)=>{if(Z.length===0)return IQ.get(J);let Y=J.clone();return IQ.add(Y,Z[0]),Y},J.isOptional=()=>J.safeParse(void 0).success,J.isNullable=()=>J.safeParse(null).success,J}),nq1=B0("_ZodString",(J,Q)=>{iD.init(J,Q),x8.init(J,Q);let Z=J._zod.bag;J.format=Z.format??null,J.minLength=Z.minimum??null,J.maxLength=Z.maximum??null,J.regex=(...Y)=>J.check(Uk(...Y)),J.includes=(...Y)=>J.check(Dk(...Y)),J.startsWith=(...Y)=>J.check(Mk(...Y)),J.endsWith=(...Y)=>J.check(Lk(...Y)),J.min=(...Y)=>J.check(RF(...Y)),J.max=(...Y)=>J.check(jE(...Y)),J.length=(...Y)=>J.check(SE(...Y)),J.nonempty=(...Y)=>J.check(RF(1,...Y)),J.lowercase=(Y)=>J.check(Bk(Y)),J.uppercase=(Y)=>J.check(Nk(Y)),J.trim=()=>J.check(wk()),J.normalize=(...Y)=>J.check(Ok(...Y)),J.toLowerCase=()=>J.check(Ek()),J.toUpperCase=()=>J.check(Ik()),J.slugify=()=>J.check(Pk())}),Rk=B0("ZodString",(J,Q)=>{iD.init(J,Q),nq1.init(J,Q),J.email=(Z)=>J.check(il(aq1,Z)),J.url=(Z)=>J.check(zk(Ei,Z)),J.jwt=(Z)=>J.check(Hi(WW1,Z)),J.emoji=(Z)=>J.check(sl(rq1,Z)),J.guid=(Z)=>J.check(Hk(Ai,Z)),J.uuid=(Z)=>J.check(nl(vW,Z)),J.uuidv4=(Z)=>J.check(al(vW,Z)),J.uuidv6=(Z)=>J.check(ol(vW,Z)),J.uuidv7=(Z)=>J.check(rl(vW,Z)),J.nanoid=(Z)=>J.check(tl(sq1,Z)),J.guid=(Z)=>J.check(Hk(Ai,Z)),J.cuid=(Z)=>J.check(el(tq1,Z)),J.cuid2=(Z)=>J.check(Ji(eq1,Z)),J.ulid=(Z)=>J.check(Qi(JW1,Z)),J.base64=(Z)=>J.check(Ki(VW1,Z)),J.base64url=(Z)=>J.check(qi(KW1,Z)),J.xid=(Z)=>J.check(Zi(QW1,Z)),J.ksuid=(Z)=>J.check(Yi(ZW1,Z)),J.ipv4=(Z)=>J.check(Xi(YW1,Z)),J.ipv6=(Z)=>J.check($i(XW1,Z)),J.cidrv4=(Z)=>J.check(Gi($W1,Z)),J.cidrv6=(Z)=>J.check(Vi(GW1,Z)),J.e164=(Z)=>J.check(Wi(qW1,Z)),J.datetime=(Z)=>J.check(Cq1(Z)),J.date=(Z)=>J.check(jq1(Z)),J.time=(Z)=>J.check(Sq1(Z)),J.duration=(Z)=>J.check(_q1(Z))});R5=B0("ZodStringFormat",(J,Q)=>{D5.init(J,Q),nq1.init(J,Q)}),aq1=B0("ZodEmail",(J,Q)=>{yG1.init(J,Q),R5.init(J,Q)});Ai=B0("ZodGUID",(J,Q)=>{_G1.init(J,Q),R5.init(J,Q)});vW=B0("ZodUUID",(J,Q)=>{kG1.init(J,Q),R5.init(J,Q)});Ei=B0("ZodURL",(J,Q)=>{xG1.init(J,Q),R5.init(J,Q)});rq1=B0("ZodEmoji",(J,Q)=>{vG1.init(J,Q),R5.init(J,Q)});sq1=B0("ZodNanoID",(J,Q)=>{fG1.init(J,Q),R5.init(J,Q)});tq1=B0("ZodCUID",(J,Q)=>{hG1.init(J,Q),R5.init(J,Q)});eq1=B0("ZodCUID2",(J,Q)=>{bG1.init(J,Q),R5.init(J,Q)});JW1=B0("ZodULID",(J,Q)=>{mG1.init(J,Q),R5.init(J,Q)});QW1=B0("ZodXID",(J,Q)=>{gG1.init(J,Q),R5.init(J,Q)});ZW1=B0("ZodKSUID",(J,Q)=>{uG1.init(J,Q),R5.init(J,Q)});YW1=B0("ZodIPv4",(J,Q)=>{iG1.init(J,Q),R5.init(J,Q)});Uz0=B0("ZodMAC",(J,Q)=>{aG1.init(J,Q),R5.init(J,Q)});XW1=B0("ZodIPv6",(J,Q)=>{nG1.init(J,Q),R5.init(J,Q)});$W1=B0("ZodCIDRv4",(J,Q)=>{oG1.init(J,Q),R5.init(J,Q)});GW1=B0("ZodCIDRv6",(J,Q)=>{rG1.init(J,Q),R5.init(J,Q)});VW1=B0("ZodBase64",(J,Q)=>{tG1.init(J,Q),R5.init(J,Q)});KW1=B0("ZodBase64URL",(J,Q)=>{eG1.init(J,Q),R5.init(J,Q)});qW1=B0("ZodE164",(J,Q)=>{JV1.init(J,Q),R5.init(J,Q)});WW1=B0("ZodJWT",(J,Q)=>{QV1.init(J,Q),R5.init(J,Q)});Ck=B0("ZodCustomStringFormat",(J,Q)=>{ZV1.init(J,Q),R5.init(J,Q)});jk=B0("ZodNumber",(J,Q)=>{gl.init(J,Q),x8.init(J,Q),J.gt=(Y,X)=>J.check(yW(Y,X)),J.gte=(Y,X)=>J.check(UZ(Y,X)),J.min=(Y,X)=>J.check(UZ(Y,X)),J.lt=(Y,X)=>J.check(kW(Y,X)),J.lte=(Y,X)=>J.check(hX(Y,X)),J.max=(Y,X)=>J.check(hX(Y,X)),J.int=(Y)=>J.check(iq1(Y)),J.safe=(Y)=>J.check(iq1(Y)),J.positive=(Y)=>J.check(yW(0,Y)),J.nonnegative=(Y)=>J.check(UZ(0,Y)),J.negative=(Y)=>J.check(kW(0,Y)),J.nonpositive=(Y)=>J.check(hX(0,Y)),J.multipleOf=(Y,X)=>J.check(nD(Y,X)),J.step=(Y,X)=>J.check(nD(Y,X)),J.finite=()=>J;let Z=J._zod.bag;J.minValue=Math.max(Z.minimum??Number.NEGATIVE_INFINITY,Z.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,J.maxValue=Math.min(Z.maximum??Number.POSITIVE_INFINITY,Z.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,J.isInt=(Z.format??"").includes("int")||Number.isSafeInteger(Z.multipleOf??0.5),J.isFinite=!0,J.format=Z.format??null});kE=B0("ZodNumberFormat",(J,Q)=>{YV1.init(J,Q),jk.init(J,Q)});Sk=B0("ZodBoolean",(J,Q)=>{Zk.init(J,Q),x8.init(J,Q)});_k=B0("ZodBigInt",(J,Q)=>{ul.init(J,Q),x8.init(J,Q),J.gte=(Y,X)=>J.check(UZ(Y,X)),J.min=(Y,X)=>J.check(UZ(Y,X)),J.gt=(Y,X)=>J.check(yW(Y,X)),J.gte=(Y,X)=>J.check(UZ(Y,X)),J.min=(Y,X)=>J.check(UZ(Y,X)),J.lt=(Y,X)=>J.check(kW(Y,X)),J.lte=(Y,X)=>J.check(hX(Y,X)),J.max=(Y,X)=>J.check(hX(Y,X)),J.positive=(Y)=>J.check(yW(BigInt(0),Y)),J.negative=(Y)=>J.check(kW(BigInt(0),Y)),J.nonpositive=(Y)=>J.check(hX(BigInt(0),Y)),J.nonnegative=(Y)=>J.check(UZ(BigInt(0),Y)),J.multipleOf=(Y,X)=>J.check(nD(Y,X));let Z=J._zod.bag;J.minValue=Z.minimum??null,J.maxValue=Z.maximum??null,J.format=Z.format??null});HW1=B0("ZodBigIntFormat",(J,Q)=>{XV1.init(J,Q),_k.init(J,Q)});Bz0=B0("ZodSymbol",(J,Q)=>{$V1.init(J,Q),x8.init(J,Q)});Nz0=B0("ZodUndefined",(J,Q)=>{GV1.init(J,Q),x8.init(J,Q)});Dz0=B0("ZodNull",(J,Q)=>{VV1.init(J,Q),x8.init(J,Q)});Mz0=B0("ZodAny",(J,Q)=>{KV1.init(J,Q),x8.init(J,Q)});Lz0=B0("ZodUnknown",(J,Q)=>{qV1.init(J,Q),x8.init(J,Q)});Az0=B0("ZodNever",(J,Q)=>{WV1.init(J,Q),x8.init(J,Q)});Oz0=B0("ZodVoid",(J,Q)=>{HV1.init(J,Q),x8.init(J,Q)});Ii=B0("ZodDate",(J,Q)=>{zV1.init(J,Q),x8.init(J,Q),J.min=(Y,X)=>J.check(UZ(Y,X)),J.max=(Y,X)=>J.check(hX(Y,X));let Z=J._zod.bag;J.minDate=Z.minimum?new Date(Z.minimum):null,J.maxDate=Z.maximum?new Date(Z.maximum):null});wz0=B0("ZodArray",(J,Q)=>{FV1.init(J,Q),x8.init(J,Q),J.element=Q.element,J.min=(Z,Y)=>J.check(RF(Z,Y)),J.nonempty=(Z)=>J.check(RF(1,Z)),J.max=(Z,Y)=>J.check(jE(Z,Y)),J.length=(Z,Y)=>J.check(SE(Z,Y)),J.unwrap=()=>J.element});Pi=B0("ZodObject",(J,Q)=>{UV1.init(J,Q),x8.init(J,Q),L6.defineLazy(J,"shape",()=>{return Q.shape}),J.keyof=()=>M2(Object.keys(J._zod.def.shape)),J.catchall=(Z)=>J.clone({...J._zod.def,catchall:Z}),J.passthrough=()=>J.clone({...J._zod.def,catchall:P7()}),J.loose=()=>J.clone({...J._zod.def,catchall:P7()}),J.strict=()=>J.clone({...J._zod.def,catchall:FW1()}),J.strip=()=>J.clone({...J._zod.def,catchall:void 0}),J.extend=(Z)=>{return L6.extend(J,Z)},J.safeExtend=(Z)=>{return L6.safeExtend(J,Z)},J.merge=(Z)=>L6.merge(J,Z),J.pick=(Z)=>L6.pick(J,Z),J.omit=(Z)=>L6.omit(J,Z),J.partial=(...Z)=>L6.partial(DW1,J,Z[0]),J.required=(...Z)=>L6.required(MW1,J,Z[0])});UW1=B0("ZodUnion",(J,Q)=>{pl.init(J,Q),x8.init(J,Q),J.options=Q.options});Ez0=B0("ZodDiscriminatedUnion",(J,Q)=>{UW1.init(J,Q),BV1.init(J,Q)});Iz0=B0("ZodIntersection",(J,Q)=>{NV1.init(J,Q),x8.init(J,Q)});Pz0=B0("ZodTuple",(J,Q)=>{dl.init(J,Q),x8.init(J,Q),J.rest=(Z)=>J.clone({...J._zod.def,rest:Z})});BW1=B0("ZodRecord",(J,Q)=>{DV1.init(J,Q),x8.init(J,Q),J.keyType=Q.keyType,J.valueType=Q.valueType});Rz0=B0("ZodMap",(J,Q)=>{MV1.init(J,Q),x8.init(J,Q),J.keyType=Q.keyType,J.valueType=Q.valueType});Cz0=B0("ZodSet",(J,Q)=>{LV1.init(J,Q),x8.init(J,Q),J.min=(...Z)=>J.check(aD(...Z)),J.nonempty=(Z)=>J.check(aD(1,Z)),J.max=(...Z)=>J.check(CE(...Z)),J.size=(...Z)=>J.check(Fk(...Z))});Tk=B0("ZodEnum",(J,Q)=>{AV1.init(J,Q),x8.init(J,Q),J.enum=Q.entries,J.options=Object.values(Q.entries);let Z=new Set(Object.keys(Q.entries));J.extract=(Y,X)=>{let G={};for(let V of Y)if(Z.has(V))G[V]=Q.entries[V];else throw Error(`Key ${V} not found in enum`);return new Tk({...Q,checks:[],...L6.normalizeParams(X),entries:G})},J.exclude=(Y,X)=>{let G={...Q.entries};for(let V of Y)if(Z.has(V))delete G[V];else throw Error(`Key ${V} not found in enum`);return new Tk({...Q,checks:[],...L6.normalizeParams(X),entries:G})}});jz0=B0("ZodLiteral",(J,Q)=>{OV1.init(J,Q),x8.init(J,Q),J.values=new Set(Q.values),Object.defineProperty(J,"value",{get(){if(Q.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return Q.values[0]}})});Sz0=B0("ZodFile",(J,Q)=>{wV1.init(J,Q),x8.init(J,Q),J.min=(Z,Y)=>J.check(aD(Z,Y)),J.max=(Z,Y)=>J.check(CE(Z,Y)),J.mime=(Z,Y)=>J.check(Ak(Array.isArray(Z)?Z:[Z],Y))});_z0=B0("ZodTransform",(J,Q)=>{EV1.init(J,Q),x8.init(J,Q),J._zod.parse=(Z,Y)=>{if(Y.direction==="backward")throw new dD(J.constructor.name);Z.addIssue=(G)=>{if(typeof G==="string")Z.issues.push(L6.issue(G,Z.value,Q));else{let V=G;if(V.fatal)V.continue=!1;V.code??(V.code="custom"),V.input??(V.input=Z.value),V.inst??(V.inst=J),Z.issues.push(L6.issue(V))}};let X=Q.transform(Z.value,Z);if(X instanceof Promise)return X.then((G)=>{return Z.value=G,Z});return Z.value=X,Z}});DW1=B0("ZodOptional",(J,Q)=>{IV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});kz0=B0("ZodNullable",(J,Q)=>{PV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});yz0=B0("ZodDefault",(J,Q)=>{TV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType,J.removeDefault=J.unwrap});vz0=B0("ZodPrefault",(J,Q)=>{RV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});MW1=B0("ZodNonOptional",(J,Q)=>{CV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});bz0=B0("ZodSuccess",(J,Q)=>{jV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});mz0=B0("ZodCatch",(J,Q)=>{SV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType,J.removeCatch=J.unwrap});uz0=B0("ZodNaN",(J,Q)=>{_V1.init(J,Q),x8.init(J,Q)});LW1=B0("ZodPipe",(J,Q)=>{kV1.init(J,Q),x8.init(J,Q),J.in=Q.in,J.out=Q.out});AW1=B0("ZodCodec",(J,Q)=>{LW1.init(J,Q),Yk.init(J,Q)});pz0=B0("ZodReadonly",(J,Q)=>{yV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});cz0=B0("ZodTemplateLiteral",(J,Q)=>{xV1.init(J,Q),x8.init(J,Q)});lz0=B0("ZodLazy",(J,Q)=>{hV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.getter()});nz0=B0("ZodPromise",(J,Q)=>{fV1.init(J,Q),x8.init(J,Q),J.unwrap=()=>J._zod.def.innerType});az0=B0("ZodFunction",(J,Q)=>{vV1.init(J,Q),x8.init(J,Q)});Ri=B0("ZodCustom",(J,Q)=>{bV1.init(J,Q),x8.init(J,Q)});b74=Eq1,m74=Iq1});function d74(J){_3({customError:J})}function c74(){return _3().customError}var EW1,wW1;var sz0=B1(()=>{BZ();EW1={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function(J){})(wW1||(wW1={}))});var xk={};Q9(xk,{string:()=>l74,number:()=>i74,date:()=>o74,boolean:()=>n74,bigint:()=>a74});function l74(J){return hK1(Rk,J)}function i74(J){return lK1(jk,J)}function n74(J){return tK1(Sk,J)}function a74(J){return Jq1(_k,J)}function o74(J){return Hq1(Ii,J)}var tz0=B1(()=>{BZ();Li()});var V0={};Q9(V0,{xid:()=>s54,void:()=>O74,uuidv7:()=>c54,uuidv6:()=>d54,uuidv4:()=>p54,uuid:()=>u54,util:()=>L6,url:()=>oq1,uppercase:()=>Nk,unknown:()=>P7,union:()=>C5,undefined:()=>A74,ulid:()=>r54,uint64:()=>M74,uint32:()=>B74,tuple:()=>Tz0,trim:()=>wk,treeifyError:()=>_$1,transform:()=>NW1,toUpperCase:()=>Ik,toLowerCase:()=>Ek,toJSONSchema:()=>Tq1,templateLiteral:()=>x74,symbol:()=>L74,superRefine:()=>rz0,success:()=>_74,stringbool:()=>u74,stringFormat:()=>K74,string:()=>Z0,strictObject:()=>I74,startsWith:()=>Mk,slugify:()=>Pk,size:()=>Fk,setErrorMap:()=>d74,set:()=>R74,safeParseAsync:()=>fq1,safeParse:()=>vq1,safeEncodeAsync:()=>dq1,safeEncode:()=>uq1,safeDecodeAsync:()=>cq1,safeDecode:()=>pq1,registry:()=>cl,regexes:()=>fX,regex:()=>Uk,refine:()=>oz0,record:()=>f7,readonly:()=>dz0,property:()=>Dq1,promise:()=>v74,prettifyError:()=>k$1,preprocess:()=>Ci,prefault:()=>fz0,positive:()=>Fq1,pipe:()=>wi,partialRecord:()=>P74,parseAsync:()=>xq1,parse:()=>yq1,overwrite:()=>MK,optional:()=>L4,object:()=>D6,number:()=>c9,nullish:()=>S74,nullable:()=>Oi,null:()=>kk,normalize:()=>Ok,nonpositive:()=>Bq1,nonoptional:()=>hz0,nonnegative:()=>Nq1,never:()=>FW1,negative:()=>Uq1,nativeEnum:()=>C74,nanoid:()=>n54,nan:()=>k74,multipleOf:()=>nD,minSize:()=>aD,minLength:()=>RF,mime:()=>Ak,meta:()=>m74,maxSize:()=>CE,maxLength:()=>jE,map:()=>T74,mac:()=>J74,lte:()=>hX,lt:()=>kW,lowercase:()=>Bk,looseObject:()=>a2,locales:()=>qk,literal:()=>N4,length:()=>SE,lazy:()=>iz0,ksuid:()=>t54,keyof:()=>E74,jwt:()=>V74,json:()=>p74,iso:()=>Di,ipv6:()=>Q74,ipv4:()=>e54,intersection:()=>yk,int64:()=>D74,int32:()=>U74,int:()=>iq1,instanceof:()=>g74,includes:()=>Dk,httpUrl:()=>l54,hostname:()=>q74,hex:()=>W74,hash:()=>H74,guid:()=>g54,gte:()=>UZ,gt:()=>yW,globalRegistry:()=>IQ,getErrorMap:()=>c74,function:()=>f74,formatError:()=>r_,float64:()=>F74,float32:()=>z74,flattenError:()=>o_,file:()=>j74,enum:()=>M2,endsWith:()=>Lk,encodeAsync:()=>mq1,encode:()=>hq1,emoji:()=>i54,email:()=>m54,e164:()=>G74,discriminatedUnion:()=>Ti,describe:()=>b74,decodeAsync:()=>gq1,decode:()=>bq1,date:()=>w74,custom:()=>OW1,cuid2:()=>o54,cuid:()=>a54,core:()=>xW,config:()=>_3,coerce:()=>xk,codec:()=>y74,clone:()=>EQ,cidrv6:()=>Y74,cidrv4:()=>Z74,check:()=>h74,catch:()=>gz0,boolean:()=>M5,bigint:()=>N74,base64url:()=>$74,base64:()=>X74,array:()=>v6,any:()=>zW1,_function:()=>f74,_default:()=>xz0,_ZodString:()=>nq1,ZodXID:()=>QW1,ZodVoid:()=>Oz0,ZodUnknown:()=>Lz0,ZodUnion:()=>UW1,ZodUndefined:()=>Nz0,ZodUUID:()=>vW,ZodURL:()=>Ei,ZodULID:()=>JW1,ZodType:()=>x8,ZodTuple:()=>Pz0,ZodTransform:()=>_z0,ZodTemplateLiteral:()=>cz0,ZodSymbol:()=>Bz0,ZodSuccess:()=>bz0,ZodStringFormat:()=>R5,ZodString:()=>Rk,ZodSet:()=>Cz0,ZodRecord:()=>BW1,ZodRealError:()=>NZ,ZodReadonly:()=>pz0,ZodPromise:()=>nz0,ZodPrefault:()=>vz0,ZodPipe:()=>LW1,ZodOptional:()=>DW1,ZodObject:()=>Pi,ZodNumberFormat:()=>kE,ZodNumber:()=>jk,ZodNullable:()=>kz0,ZodNull:()=>Dz0,ZodNonOptional:()=>MW1,ZodNever:()=>Az0,ZodNanoID:()=>sq1,ZodNaN:()=>uz0,ZodMap:()=>Rz0,ZodMAC:()=>Uz0,ZodLiteral:()=>jz0,ZodLazy:()=>lz0,ZodKSUID:()=>ZW1,ZodJWT:()=>WW1,ZodIssueCode:()=>EW1,ZodIntersection:()=>Iz0,ZodISOTime:()=>Bi,ZodISODuration:()=>Ni,ZodISODateTime:()=>Fi,ZodISODate:()=>Ui,ZodIPv6:()=>XW1,ZodIPv4:()=>YW1,ZodGUID:()=>Ai,ZodFunction:()=>az0,ZodFirstPartyTypeKind:()=>wW1,ZodFile:()=>Sz0,ZodError:()=>h54,ZodEnum:()=>Tk,ZodEmoji:()=>rq1,ZodEmail:()=>aq1,ZodE164:()=>qW1,ZodDiscriminatedUnion:()=>Ez0,ZodDefault:()=>yz0,ZodDate:()=>Ii,ZodCustomStringFormat:()=>Ck,ZodCustom:()=>Ri,ZodCodec:()=>AW1,ZodCatch:()=>mz0,ZodCUID2:()=>eq1,ZodCUID:()=>tq1,ZodCIDRv6:()=>GW1,ZodCIDRv4:()=>$W1,ZodBoolean:()=>Sk,ZodBigIntFormat:()=>HW1,ZodBigInt:()=>_k,ZodBase64URL:()=>KW1,ZodBase64:()=>VW1,ZodArray:()=>wz0,ZodAny:()=>Mz0,TimePrecision:()=>mK1,NEVER:()=>u_,$output:()=>xK1,$input:()=>vK1,$brand:()=>O$1});var vk=B1(()=>{BZ();BZ();aV1();BZ();yK1();Mi();Mi();tz0();Li();Rq1();kq1();lq1();sz0();_3(Xk())});var IW1=B1(()=>{vk();vk()});function L2(J,Q){let Z=t74(J,Q);return typeof Z==="string"?Z:Z.toString()}function t74(J,Q,Z=!0){if(!Q)Q=e74();let{workspaceFolders:Y,isWindows:X,homeDir:G}=Q,V=typeof J==="string"?h0.parse(J):h0.from(J);if(Y)for(let K of Y){let q=m4(K);if(n0.hasPrefix(V,q)){let W=q.path.endsWith("/")?q.path.slice(0,-1):q.path,z=Z&&Y&&Y.length>=2?mD(q.path)+(X?"\\":"/"):"";return TW1(z+V.path.slice(W.length+1),X,V.scheme)}}if(V?.scheme==="file"){if(G){let K=m4(G);if(n0.hasPrefix(V,K)){let q=K.path.endsWith("/")?K.path.slice(0,-1):K.path,W=V.path.slice(q.length+1);return TW1("~"+(X?"\\":"/")+W,X,V.scheme)}}return TW1(V.fsPath,X,V.scheme)}return V}function TW1(J,Q,Z){return Q&&Z==="file"?J.replaceAll("/","\\"):J}function Si(J){let Q=ji;return ji=J,Q}function e74(){if(ji)return ji;throw Error("must call setDisplayPathEnvInfo before calling displayPath() and related functions")}var ji=null;var LK=B1(()=>{n6();HE();Kl()});var J34=(J)=>{let Q=0,Z=[];while(Q<J.length){let Y=J[Q];if(Y==="\\"){Q++;continue}if(Y==="{"){Z.push({type:"brace",value:"{"}),Q++;continue}if(Y==="}"){Z.push({type:"brace",value:"}"}),Q++;continue}if(Y==="["){Z.push({type:"paren",value:"["}),Q++;continue}if(Y==="]"){Z.push({type:"paren",value:"]"}),Q++;continue}if(Y===":"){Z.push({type:"separator",value:":"}),Q++;continue}if(Y===","){Z.push({type:"delimiter",value:","}),Q++;continue}if(Y==='"'){let K="",q=!1;Y=J[++Q];while(Y!=='"'){if(Q===J.length){q=!0;break}if(Y==="\\"){if(Q++,Q===J.length){q=!0;break}K+=Y+J[Q],Y=J[++Q]}else K+=Y,Y=J[++Q]}if(Y=J[++Q],!q)Z.push({type:"string",value:K});continue}if(Y&&/\s/.test(Y)){Q++;continue}let G=/[0-9]/;if(Y&&G.test(Y)||Y==="-"||Y==="."){let K="";if(Y==="-")K+=Y,Y=J[++Q];while(Y&&G.test(Y)||Y===".")K+=Y,Y=J[++Q];Z.push({type:"number",value:K});continue}let V=/[a-z]/i;if(Y&&V.test(Y)){let K="";while(Y&&V.test(Y)){if(Q===J.length)break;K+=Y,Y=J[++Q]}if(K=="true"||K=="false"||K==="null")Z.push({type:"name",value:K});else{Q++;continue}continue}Q++}return Z},xE=(J)=>{if(J.length===0)return J;let Q=J[J.length-1];switch(Q.type){case"separator":return J=J.slice(0,J.length-1),xE(J);break;case"number":let Z=Q.value[Q.value.length-1];if(Z==="."||Z==="-")return J=J.slice(0,J.length-1),xE(J);case"string":let Y=J[J.length-2];if(Y?.type==="delimiter")return J=J.slice(0,J.length-1),xE(J);else if(Y?.type==="brace"&&Y.value==="{")return J=J.slice(0,J.length-1),xE(J);break;case"delimiter":return J=J.slice(0,J.length-1),xE(J);break}return J},Q34=(J)=>{let Q=[];if(J.map((Z)=>{if(Z.type==="brace")if(Z.value==="{")Q.push("}");else Q.splice(Q.lastIndexOf("}"),1);if(Z.type==="paren")if(Z.value==="[")Q.push("]");else Q.splice(Q.lastIndexOf("]"),1)}),Q.length>0)Q.reverse().map((Z)=>{if(Z==="}")J.push({type:"brace",value:"}"});else if(Z==="]")J.push({type:"paren",value:"]"})});return J},Z34=(J)=>{let Q="";return J.map((Z)=>{switch(Z.type){case"string":Q+='"'+Z.value+'"';break;default:Q+=Z.value;break}}),Q},bX=(J)=>JSON.parse(Z34(Q34(xE(J34(J)))));var oD=()=>{};function gJ(J,...Q){throw Error(`[Immer] minified error nr: ${J}. Full error at: https://bit.ly/3cXEKWf`)}function tD(J){return!!J&&!!J[UY]}function jF(J){if(!J)return!1;return XF0(J)||Array.isArray(J)||!!J[fk]||!!J.constructor?.[fk]||uk(J)||pk(J)}function XF0(J){if(!J||typeof J!=="object")return!1;let Q=sD(J);if(Q===null)return!0;let Z=Object.hasOwnProperty.call(Q,"constructor")&&Q.constructor;if(Z===Object)return!0;return typeof Z=="function"&&Function.toString.call(Z)===Y34}function hk(J,Q){if(eD(J)===0)Reflect.ownKeys(J).forEach((Z)=>{Q(Z,J[Z],J)});else J.forEach((Z,Y)=>Q(Y,Z,J))}function eD(J){let Q=J[UY];return Q?Q.type_:Array.isArray(J)?1:uk(J)?2:pk(J)?3:0}function bk(J,Q){return eD(J)===2?J.has(Q):Object.prototype.hasOwnProperty.call(J,Q)}function RW1(J,Q){return eD(J)===2?J.get(Q):J[Q]}function $F0(J,Q,Z){let Y=eD(J);if(Y===2)J.set(Q,Z);else if(Y===3)J.add(Z);else J[Q]=Z}function X34(J,Q){if(J===Q)return J!==0||1/J===1/Q;else return J!==J&&Q!==Q}function uk(J){return J instanceof Map}function pk(J){return J instanceof Set}function rD(J){return J.copy_||J.base_}function SW1(J,Q){if(uk(J))return new Map(J);if(pk(J))return new Set(J);if(Array.isArray(J))return Array.prototype.slice.call(J);let Z=XF0(J);if(Q===!0||Q==="class_only"&&!Z){let Y=Object.getOwnPropertyDescriptors(J);delete Y[UY];let X=Reflect.ownKeys(Y);for(let G=0;G<X.length;G++){let V=X[G],K=Y[V];if(K.writable===!1)K.writable=!0,K.configurable=!0;if(K.get||K.set)Y[V]={configurable:!0,writable:!0,enumerable:K.enumerable,value:J[V]}}return Object.create(sD(J),Y)}else{let Y=sD(J);if(Y!==null&&Z)return{...J};let X=Object.create(Y);return Object.assign(X,J)}}function NY(J,Q=!1){if(yi(J)||tD(J)||!jF(J))return J;if(eD(J)>1)J.set=J.add=J.clear=J.delete=$34;if(Object.freeze(J),Q)Object.entries(J).forEach(([Z,Y])=>NY(Y,!0));return J}function $34(){gJ(2)}function yi(J){return Object.isFrozen(J)}function JM(J){let Q=_W1[J];if(!Q)gJ(0,J);return Q}function G34(J,Q){if(!_W1[J])_W1[J]=Q}function GF0(){return mk}function V34(J,Q){return{drafts_:[],parent_:J,immer_:Q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function JF0(J,Q){if(Q)JM("Patches"),J.patches_=[],J.inversePatches_=[],J.patchListener_=Q}function kW1(J){yW1(J),J.drafts_.forEach(K34),J.drafts_=null}function yW1(J){if(J===mk)mk=J.parent_}function QF0(J){return mk=V34(mk,J)}function K34(J){let Q=J[UY];if(Q.type_===0||Q.type_===1)Q.revoke_();else Q.revoked_=!0}function ZF0(J,Q){Q.unfinalizedDrafts_=Q.drafts_.length;let Z=Q.drafts_[0];if(J!==void 0&&J!==Z){if(Z[UY].modified_)kW1(Q),gJ(4);if(jF(J)){if(J=_i(Q,J),!Q.parent_)ki(Q,J)}if(Q.patches_)JM("Patches").generateReplacementPatches_(Z[UY].base_,J,Q.patches_,Q.inversePatches_)}else J=_i(Q,Z,[]);if(kW1(Q),Q.patches_)Q.patchListener_(Q.patches_,Q.inversePatches_);return J!==fW1?J:void 0}function _i(J,Q,Z){if(yi(Q))return Q;let Y=Q[UY];if(!Y)return hk(Q,(X,G)=>YF0(J,Y,Q,X,G,Z)),Q;if(Y.scope_!==J)return Q;if(!Y.modified_)return ki(J,Y.base_,!0),Y.base_;if(!Y.finalized_){Y.finalized_=!0,Y.scope_.unfinalizedDrafts_--;let X=Y.copy_,G=X,V=!1;if(Y.type_===3)G=new Set(X),X.clear(),V=!0;if(hk(G,(K,q)=>YF0(J,Y,X,K,q,Z,V)),ki(J,X,!1),Z&&J.patches_)JM("Patches").generatePatches_(Y,Z,J.patches_,J.inversePatches_)}return Y.copy_}function YF0(J,Q,Z,Y,X,G,V){if(tD(X)){let K=G&&Q&&Q.type_!==3&&!bk(Q.assigned_,Y)?G.concat(Y):void 0,q=_i(J,X,K);if($F0(Z,Y,q),tD(q))J.canAutoFreeze_=!1;else return}else if(V)Z.add(X);if(jF(X)&&!yi(X)){if(!J.immer_.autoFreeze_&&J.unfinalizedDrafts_<1)return;if(_i(J,X),(!Q||!Q.scope_.parent_)&&typeof Y!=="symbol"&&Object.prototype.propertyIsEnumerable.call(Z,Y))ki(J,X)}}function ki(J,Q,Z=!1){if(!J.parent_&&J.immer_.autoFreeze_&&J.canAutoFreeze_)NY(Q,Z)}function q34(J,Q){let Z=Array.isArray(J),Y={type_:Z?1:0,scope_:Q?Q.scope_:GF0(),modified_:!1,finalized_:!1,assigned_:{},parent_:Q,base_:J,draft_:null,copy_:null,revoke_:null,isManual_:!1},X=Y,G=hW1;if(Z)X=[Y],G=gk;let{revoke:V,proxy:K}=Proxy.revocable(X,G);return Y.draft_=K,Y.revoke_=V,K}function CW1(J,Q){let Z=J[UY];return(Z?rD(Z):J)[Q]}function W34(J,Q,Z){let Y=VF0(Q,Z);return Y?"value"in Y?Y.value:Y.get?.call(J.draft_):void 0}function VF0(J,Q){if(!(Q in J))return;let Z=sD(J);while(Z){let Y=Object.getOwnPropertyDescriptor(Z,Q);if(Y)return Y;Z=sD(Z)}return}function xW1(J){if(!J.modified_){if(J.modified_=!0,J.parent_)xW1(J.parent_)}}function jW1(J){if(!J.copy_)J.copy_=SW1(J.base_,J.scope_.immer_.useStrictShallowCopy_)}function vW1(J,Q){let Z=uk(J)?JM("MapSet").proxyMap_(J,Q):pk(J)?JM("MapSet").proxySet_(J,Q):q34(J,Q);return(Q?Q.scope_:GF0()).drafts_.push(Z),Z}function z34(J){if(!tD(J))gJ(10,J);return KF0(J)}function KF0(J){if(!jF(J)||yi(J))return J;let Q=J[UY],Z;if(Q){if(!Q.modified_)return Q.base_;Q.finalized_=!0,Z=SW1(J,Q.scope_.immer_.useStrictShallowCopy_)}else Z=SW1(J,!0);if(hk(Z,(Y,X)=>{$F0(Z,Y,KF0(X))}),Q)Q.finalized_=!1;return Z}function xi(){let Q="replace",Z="add",Y="remove";function X(U,D,M,L){switch(U.type_){case 0:case 2:return V(U,D,M,L);case 1:return G(U,D,M,L);case 3:return K(U,D,M,L)}}function G(U,D,M,L){let{base_:A,assigned_:E}=U,I=U.copy_;if(I.length<A.length)[A,I]=[I,A],[M,L]=[L,M];for(let P=0;P<A.length;P++)if(E[P]&&I[P]!==A[P]){let R=D.concat([P]);M.push({op:Q,path:R,value:z(I[P])}),L.push({op:Q,path:R,value:z(A[P])})}for(let P=A.length;P<I.length;P++){let R=D.concat([P]);M.push({op:Z,path:R,value:z(I[P])})}for(let P=I.length-1;A.length<=P;--P){let R=D.concat([P]);L.push({op:Y,path:R})}}function V(U,D,M,L){let{base_:A,copy_:E}=U;hk(U.assigned_,(I,P)=>{let R=RW1(A,I),y=RW1(E,I),k=!P?Y:bk(A,I)?Q:Z;if(R===y&&k===Q)return;let v=D.concat(I);M.push(k===Y?{op:k,path:v}:{op:k,path:v,value:y}),L.push(k===Z?{op:Y,path:v}:k===Y?{op:Z,path:v,value:z(R)}:{op:Q,path:v,value:z(R)})})}function K(U,D,M,L){let{base_:A,copy_:E}=U,I=0;A.forEach((P)=>{if(!E.has(P)){let R=D.concat([I]);M.push({op:Y,path:R,value:P}),L.unshift({op:Z,path:R,value:P})}I++}),I=0,E.forEach((P)=>{if(!A.has(P)){let R=D.concat([I]);M.push({op:Z,path:R,value:P}),L.unshift({op:Y,path:R,value:P})}I++})}function q(U,D,M,L){M.push({op:Q,path:[],value:D===fW1?void 0:D}),L.push({op:Q,path:[],value:U})}function W(U,D){return D.forEach((M)=>{let{path:L,op:A}=M,E=U;for(let y=0;y<L.length-1;y++){let k=eD(E),v=L[y];if(typeof v!=="string"&&typeof v!=="number")v=""+v;if((k===0||k===1)&&(v==="__proto__"||v==="constructor"))gJ(19);if(typeof E==="function"&&v==="prototype")gJ(19);if(E=RW1(E,v),typeof E!=="object")gJ(18,L.join("/"))}let I=eD(E),P=H(M.value),R=L[L.length-1];switch(A){case Q:switch(I){case 2:return E.set(R,P);case 3:gJ(16);default:return E[R]=P}case Z:switch(I){case 1:return R==="-"?E.push(P):E.splice(R,0,P);case 2:return E.set(R,P);case 3:return E.add(P);default:return E[R]=P}case Y:switch(I){case 1:return E.splice(R,1);case 2:return E.delete(R);case 3:return E.delete(M.value);default:return delete E[R]}default:gJ(17,A)}}),U}function H(U){if(!jF(U))return U;if(Array.isArray(U))return U.map(H);if(uk(U))return new Map(Array.from(U.entries()).map(([M,L])=>[M,H(L)]));if(pk(U))return new Set(Array.from(U).map(H));let D=Object.create(sD(U));for(let M in U)D[M]=H(U[M]);if(bk(U,fk))D[fk]=U[fk];return D}function z(U){if(tD(U))return H(U);else return U}G34("Patches",{applyPatches_:W,generatePatches_:X,generateReplacementPatches_:q})}function v8(J){return J}var fW1,fk,UY,sD,Y34,_W1,mk,hW1,gk,H34=class{constructor(J){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(Q,Z,Y)=>{if(typeof Q==="function"&&typeof Z!=="function"){let G=Z;Z=Q;let V=this;return function(q=G,...W){return V.produce(q,(H)=>Z.call(this,H,...W))}}if(typeof Z!=="function")gJ(6);if(Y!==void 0&&typeof Y!=="function")gJ(7);let X;if(jF(Q)){let G=QF0(this),V=vW1(Q,void 0),K=!0;try{X=Z(V),K=!1}finally{if(K)kW1(G);else yW1(G)}return JF0(G,Y),ZF0(X,G)}else if(!Q||typeof Q!=="object"){if(X=Z(Q),X===void 0)X=Q;if(X===fW1)X=void 0;if(this.autoFreeze_)NY(X,!0);if(Y){let G=[],V=[];JM("Patches").generateReplacementPatches_(Q,X,G,V),Y(G,V)}return X}else gJ(1,Q)},this.produceWithPatches=(Q,Z)=>{if(typeof Q==="function")return(V,...K)=>this.produceWithPatches(V,(q)=>Q(q,...K));let Y,X;return[this.produce(Q,Z,(V,K)=>{Y=V,X=K}),Y,X]},typeof J?.autoFreeze==="boolean")this.setAutoFreeze(J.autoFreeze);if(typeof J?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(J.useStrictShallowCopy)}createDraft(J){if(!jF(J))gJ(8);if(tD(J))J=z34(J);let Q=QF0(this),Z=vW1(J,void 0);return Z[UY].isManual_=!0,yW1(Q),Z}finishDraft(J,Q){let Z=J&&J[UY];if(!Z||!Z.isManual_)gJ(9);let{scope_:Y}=Z;return JF0(Y,Q),ZF0(void 0,Y)}setAutoFreeze(J){this.autoFreeze_=J}setUseStrictShallowCopy(J){this.useStrictShallowCopy_=J}applyPatches(J,Q){let Z;for(Z=Q.length-1;Z>=0;Z--){let X=Q[Z];if(X.path.length===0&&X.op==="replace"){J=X.value;break}}if(Z>-1)Q=Q.slice(Z+1);let Y=JM("Patches").applyPatches_;if(tD(J))return Y(J,Q);return this.produce(J,(X)=>Y(X,Q))}},BY,SF,QM,dv8,cv8,qF0,lv8,iv8;var TQ=B1(()=>{fW1=Symbol.for("immer-nothing"),fk=Symbol.for("immer-draftable"),UY=Symbol.for("immer-state");sD=Object.getPrototypeOf;Y34=Object.prototype.constructor.toString();_W1={};hW1={get(J,Q){if(Q===UY)return J;let Z=rD(J);if(!bk(Z,Q))return W34(J,Z,Q);let Y=Z[Q];if(J.finalized_||!jF(Y))return Y;if(Y===CW1(J.base_,Q))return jW1(J),J.copy_[Q]=vW1(Y,J);return Y},has(J,Q){return Q in rD(J)},ownKeys(J){return Reflect.ownKeys(rD(J))},set(J,Q,Z){let Y=VF0(rD(J),Q);if(Y?.set)return Y.set.call(J.draft_,Z),!0;if(!J.modified_){let X=CW1(rD(J),Q),G=X?.[UY];if(G&&G.base_===Z)return J.copy_[Q]=Z,J.assigned_[Q]=!1,!0;if(X34(Z,X)&&(Z!==void 0||bk(J.base_,Q)))return!0;jW1(J),xW1(J)}if(J.copy_[Q]===Z&&(Z!==void 0||(Q in J.copy_))||Number.isNaN(Z)&&Number.isNaN(J.copy_[Q]))return!0;return J.copy_[Q]=Z,J.assigned_[Q]=!0,!0},deleteProperty(J,Q){if(CW1(J.base_,Q)!==void 0||Q in J.base_)J.assigned_[Q]=!1,jW1(J),xW1(J);else delete J.assigned_[Q];if(J.copy_)delete J.copy_[Q];return!0},getOwnPropertyDescriptor(J,Q){let Z=rD(J),Y=Reflect.getOwnPropertyDescriptor(Z,Q);if(!Y)return Y;return{writable:!0,configurable:J.type_!==1||Q!=="length",enumerable:Y.enumerable,value:Z[Q]}},defineProperty(){gJ(11)},getPrototypeOf(J){return sD(J.base_)},setPrototypeOf(){gJ(12)}},gk={};hk(hW1,(J,Q)=>{gk[J]=function(){return arguments[0]=arguments[0][0],Q.apply(this,arguments)}});gk.deleteProperty=function(J,Q){return gk.set.call(this,J,Q,void 0)};gk.set=function(J,Q,Z){return hW1.set.call(this,J[0],Q,Z,J[0])};BY=new H34,SF=BY.produce,QM=BY.produceWithPatches.bind(BY),dv8=BY.setAutoFreeze.bind(BY),cv8=BY.setUseStrictShallowCopy.bind(BY),qF0=BY.applyPatches.bind(BY),lv8=BY.createDraft.bind(BY),iv8=BY.finishDraft.bind(BY)});function WF0(J,Q=0){return(o2[J[Q+0]]+o2[J[Q+1]]+o2[J[Q+2]]+o2[J[Q+3]]+"-"+o2[J[Q+4]]+o2[J[Q+5]]+"-"+o2[J[Q+6]]+o2[J[Q+7]]+"-"+o2[J[Q+8]]+o2[J[Q+9]]+"-"+o2[J[Q+10]]+o2[J[Q+11]]+o2[J[Q+12]]+o2[J[Q+13]]+o2[J[Q+14]]+o2[J[Q+15]]).toLowerCase()}var o2;var HF0=B1(()=>{o2=[];for(let J=0;J<256;++J)o2.push((J+256).toString(16).slice(1))});import{randomFillSync as F34}from"crypto";function hi(){if(vi>fi.length-16)F34(fi),vi=0;return fi.slice(vi,vi+=16)}var fi,vi;var zF0=B1(()=>{fi=new Uint8Array(256),vi=fi.length});function U34(J,Q,Z){let Y;if(J)Y=FF0(J.random??J.rng?.()??hi(),J.msecs,J.seq,Q,Z);else{let X=Date.now(),G=hi();B34(bW1,X,G),Y=FF0(G,bW1.msecs,bW1.seq,Q,Z)}return Q??WF0(Y)}function B34(J,Q,Z){if(J.msecs??=-1/0,J.seq??=0,Q>J.msecs)J.seq=Z[6]<<23|Z[7]<<16|Z[8]<<8|Z[9],J.msecs=Q;else if(J.seq=J.seq+1|0,J.seq===0)J.msecs++;return J}function FF0(J,Q,Z,Y,X=0){if(J.length<16)throw Error("Random bytes length must be >= 16");if(!Y)Y=new Uint8Array(16),X=0;else if(X<0||X+16>Y.length)throw RangeError(`UUID byte range ${X}:${X+15} is out of buffer bounds`);return Q??=Date.now(),Z??=J[6]*127<<24|J[7]<<16|J[8]<<8|J[9],Y[X++]=Q/1099511627776&255,Y[X++]=Q/4294967296&255,Y[X++]=Q/16777216&255,Y[X++]=Q/65536&255,Y[X++]=Q/256&255,Y[X++]=Q&255,Y[X++]=112|Z>>>28&15,Y[X++]=Z>>>20&255,Y[X++]=128|Z>>>14&63,Y[X++]=Z>>>6&255,Y[X++]=Z<<2&255|J[10]&3,Y[X++]=J[11],Y[X++]=J[12],Y[X++]=J[13],Y[X++]=J[14],Y[X++]=J[15],Y}var bW1,mW1;var UF0=B1(()=>{zF0();HF0();bW1={};mW1=U34});var BF0=B1(()=>{UF0()});function gW1({onlyFirst:J=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,J?void 0:"g")}function vE(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(N34,"")}var N34;var bi=B1(()=>{N34=gW1()});var DF0=h((Gf8,uW1)=>{var _F={};if(typeof uW1>"u")window.eastasianwidth=_F;else uW1.exports=_F;_F.eastAsianWidth=function(J){var Q=J.charCodeAt(0),Z=J.length==2?J.charCodeAt(1):0,Y=Q;if(55296<=Q&&Q<=56319&&(56320<=Z&&Z<=57343))Q&=1023,Z&=1023,Y=Q<<10|Z,Y+=65536;if(Y==12288||65281<=Y&&Y<=65376||65504<=Y&&Y<=65510)return"F";if(Y==8361||65377<=Y&&Y<=65470||65474<=Y&&Y<=65479||65482<=Y&&Y<=65487||65490<=Y&&Y<=65495||65498<=Y&&Y<=65500||65512<=Y&&Y<=65518)return"H";if(4352<=Y&&Y<=4447||4515<=Y&&Y<=4519||4602<=Y&&Y<=4607||9001<=Y&&Y<=9002||11904<=Y&&Y<=11929||11931<=Y&&Y<=12019||12032<=Y&&Y<=12245||12272<=Y&&Y<=12283||12289<=Y&&Y<=12350||12353<=Y&&Y<=12438||12441<=Y&&Y<=12543||12549<=Y&&Y<=12589||12593<=Y&&Y<=12686||12688<=Y&&Y<=12730||12736<=Y&&Y<=12771||12784<=Y&&Y<=12830||12832<=Y&&Y<=12871||12880<=Y&&Y<=13054||13056<=Y&&Y<=19903||19968<=Y&&Y<=42124||42128<=Y&&Y<=42182||43360<=Y&&Y<=43388||44032<=Y&&Y<=55203||55216<=Y&&Y<=55238||55243<=Y&&Y<=55291||63744<=Y&&Y<=64255||65040<=Y&&Y<=65049||65072<=Y&&Y<=65106||65108<=Y&&Y<=65126||65128<=Y&&Y<=65131||110592<=Y&&Y<=110593||127488<=Y&&Y<=127490||127504<=Y&&Y<=127546||127552<=Y&&Y<=127560||127568<=Y&&Y<=127569||131072<=Y&&Y<=194367||177984<=Y&&Y<=196605||196608<=Y&&Y<=262141)return"W";if(32<=Y&&Y<=126||162<=Y&&Y<=163||165<=Y&&Y<=166||Y==172||Y==175||10214<=Y&&Y<=10221||10629<=Y&&Y<=10630)return"Na";if(Y==161||Y==164||167<=Y&&Y<=168||Y==170||173<=Y&&Y<=174||176<=Y&&Y<=180||182<=Y&&Y<=186||188<=Y&&Y<=191||Y==198||Y==208||215<=Y&&Y<=216||222<=Y&&Y<=225||Y==230||232<=Y&&Y<=234||236<=Y&&Y<=237||Y==240||242<=Y&&Y<=243||247<=Y&&Y<=250||Y==252||Y==254||Y==257||Y==273||Y==275||Y==283||294<=Y&&Y<=295||Y==299||305<=Y&&Y<=307||Y==312||319<=Y&&Y<=322||Y==324||328<=Y&&Y<=331||Y==333||338<=Y&&Y<=339||358<=Y&&Y<=359||Y==363||Y==462||Y==464||Y==466||Y==468||Y==470||Y==472||Y==474||Y==476||Y==593||Y==609||Y==708||Y==711||713<=Y&&Y<=715||Y==717||Y==720||728<=Y&&Y<=731||Y==733||Y==735||768<=Y&&Y<=879||913<=Y&&Y<=929||931<=Y&&Y<=937||945<=Y&&Y<=961||963<=Y&&Y<=969||Y==1025||1040<=Y&&Y<=1103||Y==1105||Y==8208||8211<=Y&&Y<=8214||8216<=Y&&Y<=8217||8220<=Y&&Y<=8221||8224<=Y&&Y<=8226||8228<=Y&&Y<=8231||Y==8240||8242<=Y&&Y<=8243||Y==8245||Y==8251||Y==8254||Y==8308||Y==8319||8321<=Y&&Y<=8324||Y==8364||Y==8451||Y==8453||Y==8457||Y==8467||Y==8470||8481<=Y&&Y<=8482||Y==8486||Y==8491||8531<=Y&&Y<=8532||8539<=Y&&Y<=8542||8544<=Y&&Y<=8555||8560<=Y&&Y<=8569||Y==8585||8592<=Y&&Y<=8601||8632<=Y&&Y<=8633||Y==8658||Y==8660||Y==8679||Y==8704||8706<=Y&&Y<=8707||8711<=Y&&Y<=8712||Y==8715||Y==8719||Y==8721||Y==8725||Y==8730||8733<=Y&&Y<=8736||Y==8739||Y==8741||8743<=Y&&Y<=8748||Y==8750||8756<=Y&&Y<=8759||8764<=Y&&Y<=8765||Y==8776||Y==8780||Y==8786||8800<=Y&&Y<=8801||8804<=Y&&Y<=8807||8810<=Y&&Y<=8811||8814<=Y&&Y<=8815||8834<=Y&&Y<=8835||8838<=Y&&Y<=8839||Y==8853||Y==8857||Y==8869||Y==8895||Y==8978||9312<=Y&&Y<=9449||9451<=Y&&Y<=9547||9552<=Y&&Y<=9587||9600<=Y&&Y<=9615||9618<=Y&&Y<=9621||9632<=Y&&Y<=9633||9635<=Y&&Y<=9641||9650<=Y&&Y<=9651||9654<=Y&&Y<=9655||9660<=Y&&Y<=9661||9664<=Y&&Y<=9665||9670<=Y&&Y<=9672||Y==9675||9678<=Y&&Y<=9681||9698<=Y&&Y<=9701||Y==9711||9733<=Y&&Y<=9734||Y==9737||9742<=Y&&Y<=9743||9748<=Y&&Y<=9749||Y==9756||Y==9758||Y==9792||Y==9794||9824<=Y&&Y<=9825||9827<=Y&&Y<=9829||9831<=Y&&Y<=9834||9836<=Y&&Y<=9837||Y==9839||9886<=Y&&Y<=9887||9918<=Y&&Y<=9919||9924<=Y&&Y<=9933||9935<=Y&&Y<=9953||Y==9955||9960<=Y&&Y<=9983||Y==10045||Y==10071||10102<=Y&&Y<=10111||11093<=Y&&Y<=11097||12872<=Y&&Y<=12879||57344<=Y&&Y<=63743||65024<=Y&&Y<=65039||Y==65533||127232<=Y&&Y<=127242||127248<=Y&&Y<=127277||127280<=Y&&Y<=127337||127344<=Y&&Y<=127386||917760<=Y&&Y<=917999||983040<=Y&&Y<=1048573||1048576<=Y&&Y<=1114109)return"A";return"N"};_F.characterLength=function(J){var Q=this.eastAsianWidth(J);if(Q=="F"||Q=="W"||Q=="A")return 2;else return 1};function NF0(J){return J.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}_F.length=function(J){var Q=NF0(J),Z=0;for(var Y=0;Y<Q.length;Y++)Z=Z+this.characterLength(Q[Y]);return Z};_F.slice=function(J,Q,Z){if(textLen=_F.length(J),Q=Q?Q:0,Z=Z?Z:1,Q<0)Q=textLen+Q;if(Z<0)Z=textLen+Z;var Y="",X=0,G=NF0(J);for(var V=0;V<G.length;V++){var K=G[V],q=_F.length(K);if(X>=Q-(q==2?1:0))if(X+q<=Z)Y+=K;else break;X+=q}return Y}});var pW1=h((Vf8,MF0)=>{MF0.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var D34,M34;var LF0=B1(()=>{bi();D34=q6(DF0(),1),M34=q6(pW1(),1)});function mi(J,Q,Z="..."){if(J.length<=Q)return J;return J.slice(0,Math.max(0,Q-Z.length))+Z}var dW1=B1(()=>{LF0()});var AF0="run_terminal_command",cW1="read_file",A2="Task",a8="finder",DZ="get_diagnostics",L5="Bash",A5="oracle",OF0="painter",mX="mermaid",AK="todo_read",t5="todo_write",k3="read_web_page",kF="read_thread",fE="find_thread",j5="create_file",n3="glob",gi="undo_edit",ui="read_mcp_resource",a6="Read",K7="edit_file",hE="format_file",O2="web_search",C8="Grep",ZM="Check",DY="librarian",pi="kraken",wF0="look_at",EF0="read_artifact",IF0="edit_artifact",di="read_plan",bE="edit_plan",ci="read_github",li="search_github",ii="commit_search",ni="list_directory_github",ai="list_repositories",oi="glob_github",ri="diff",PF0="bookkeeper",TF0="describe_workbook",RF0="execute_query",dk="skill",CF0="tool_search",jF0="load_tool",SF0;var W4=B1(()=>{SF0=["Task","finder","get_diagnostics","Bash","oracle","painter","mermaid","todo_read","todo_write","read_web_page","create_file","glob","Glob","undo_edit","Read","edit_file","delete_file","format_file","web_search","Grep","search_documents","get_document","Check","code_review","kraken","look_at","librarian","bookkeeper","read_thread","find_thread","read_artifact","edit_artifact","read_plan","edit_plan","skill","tool_search","load_tool"]});var ck=h((Uf8,kF0)=>{var _F0={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},L34={..._F0,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},A34={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};kF0.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:A34,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(J){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${J.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(J){return J===!0?L34:_F0}}});var lk=h((P34)=>{var{REGEX_BACKSLASH:O34,REGEX_REMOVE_BACKSLASH:w34,REGEX_SPECIAL_CHARS:E34,REGEX_SPECIAL_CHARS_GLOBAL:I34}=ck();P34.isObject=(J)=>J!==null&&typeof J==="object"&&!Array.isArray(J);P34.hasRegexChars=(J)=>E34.test(J);P34.isRegexChar=(J)=>J.length===1&&P34.hasRegexChars(J);P34.escapeRegex=(J)=>J.replace(I34,"\\$1");P34.toPosixSlashes=(J)=>J.replace(O34,"/");P34.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let J=navigator.platform.toLowerCase();return J==="win32"||J==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};P34.removeBackslashes=(J)=>{return J.replace(w34,(Q)=>{return Q==="\\"?"":Q})};P34.escapeLast=(J,Q,Z)=>{let Y=J.lastIndexOf(Q,Z);if(Y===-1)return J;if(J[Y-1]==="\\")return P34.escapeLast(J,Q,Y-1);return`${J.slice(0,Y)}\\${J.slice(Y)}`};P34.removePrefix=(J,Q={})=>{let Z=J;if(Z.startsWith("./"))Z=Z.slice(2),Q.prefix="./";return Z};P34.wrapOutput=(J,Q={},Z={})=>{let Y=Z.contains?"":"^",X=Z.contains?"":"$",G=`${Y}(?:${J})${X}`;if(Q.negated===!0)G=`(?:^(?!${G}).*$)`;return G};P34.basename=(J,{windows:Q}={})=>{let Z=J.split(Q?/[\\/]/:"/"),Y=Z[Z.length-1];if(Y==="")return Z[Z.length-2];return Y}});var pF0=h((Nf8,uF0)=>{var vF0=lk(),{CHAR_ASTERISK:lW1,CHAR_AT:v34,CHAR_BACKWARD_SLASH:ik,CHAR_COMMA:f34,CHAR_DOT:iW1,CHAR_EXCLAMATION_MARK:nW1,CHAR_FORWARD_SLASH:gF0,CHAR_LEFT_CURLY_BRACE:aW1,CHAR_LEFT_PARENTHESES:oW1,CHAR_LEFT_SQUARE_BRACKET:h34,CHAR_PLUS:b34,CHAR_QUESTION_MARK:fF0,CHAR_RIGHT_CURLY_BRACE:m34,CHAR_RIGHT_PARENTHESES:hF0,CHAR_RIGHT_SQUARE_BRACKET:g34}=ck(),bF0=(J)=>{return J===gF0||J===ik},mF0=(J)=>{if(J.isPrefix!==!0)J.depth=J.isGlobstar?1/0:1},u34=(J,Q)=>{let Z=Q||{},Y=J.length-1,X=Z.parts===!0||Z.scanToEnd===!0,G=[],V=[],K=[],q=J,W=-1,H=0,z=0,U=!1,D=!1,M=!1,L=!1,A=!1,E=!1,I=!1,P=!1,R=!1,y=!1,k=0,v,g,d={value:"",depth:0,isGlob:!1},b=()=>W>=Y,a=()=>q.charCodeAt(W+1),G1=()=>{return v=g,q.charCodeAt(++W)};while(W<Y){g=G1();let L1;if(g===ik){if(I=d.backslashes=!0,g=G1(),g===aW1)E=!0;continue}if(E===!0||g===aW1){k++;while(b()!==!0&&(g=G1())){if(g===ik){I=d.backslashes=!0,G1();continue}if(g===aW1){k++;continue}if(E!==!0&&g===iW1&&(g=G1())===iW1){if(U=d.isBrace=!0,M=d.isGlob=!0,y=!0,X===!0)continue;break}if(E!==!0&&g===f34){if(U=d.isBrace=!0,M=d.isGlob=!0,y=!0,X===!0)continue;break}if(g===m34){if(k--,k===0){E=!1,U=d.isBrace=!0,y=!0;break}}}if(X===!0)continue;break}if(g===gF0){if(G.push(W),V.push(d),d={value:"",depth:0,isGlob:!1},y===!0)continue;if(v===iW1&&W===H+1){H+=2;continue}z=W+1;continue}if(Z.noext!==!0){if((g===b34||g===v34||g===lW1||g===fF0||g===nW1)===!0&&a()===oW1){if(M=d.isGlob=!0,L=d.isExtglob=!0,y=!0,g===nW1&&W===H)R=!0;if(X===!0){while(b()!==!0&&(g=G1())){if(g===ik){I=d.backslashes=!0,g=G1();continue}if(g===hF0){M=d.isGlob=!0,y=!0;break}}continue}break}}if(g===lW1){if(v===lW1)A=d.isGlobstar=!0;if(M=d.isGlob=!0,y=!0,X===!0)continue;break}if(g===fF0){if(M=d.isGlob=!0,y=!0,X===!0)continue;break}if(g===h34){while(b()!==!0&&(L1=G1())){if(L1===ik){I=d.backslashes=!0,G1();continue}if(L1===g34){D=d.isBracket=!0,M=d.isGlob=!0,y=!0;break}}if(X===!0)continue;break}if(Z.nonegate!==!0&&g===nW1&&W===H){P=d.negated=!0,H++;continue}if(Z.noparen!==!0&&g===oW1){if(M=d.isGlob=!0,X===!0){while(b()!==!0&&(g=G1())){if(g===oW1){I=d.backslashes=!0,g=G1();continue}if(g===hF0){y=!0;break}}continue}break}if(M===!0){if(y=!0,X===!0)continue;break}}if(Z.noext===!0)L=!1,M=!1;let t=q,c="",J1="";if(H>0)c=q.slice(0,H),q=q.slice(H),z-=H;if(t&&M===!0&&z>0)t=q.slice(0,z),J1=q.slice(z);else if(M===!0)t="",J1=q;else t=q;if(t&&t!==""&&t!=="/"&&t!==q){if(bF0(t.charCodeAt(t.length-1)))t=t.slice(0,-1)}if(Z.unescape===!0){if(J1)J1=vF0.removeBackslashes(J1);if(t&&I===!0)t=vF0.removeBackslashes(t)}let q1={prefix:c,input:J,start:H,base:t,glob:J1,isBrace:U,isBracket:D,isGlob:M,isExtglob:L,isGlobstar:A,negated:P,negatedExtglob:R};if(Z.tokens===!0){if(q1.maxDepth=0,!bF0(g))V.push(d);q1.tokens=V}if(Z.parts===!0||Z.tokens===!0){let L1;for(let s=0;s<G.length;s++){let o=L1?L1+1:H,i=G[s],z1=J.slice(o,i);if(Z.tokens){if(s===0&&H!==0)V[s].isPrefix=!0,V[s].value=c;else V[s].value=z1;mF0(V[s]),q1.maxDepth+=V[s].depth}if(s!==0||z1!=="")K.push(z1);L1=i}if(L1&&L1+1<J.length){let s=J.slice(L1+1);if(K.push(s),Z.tokens)V[V.length-1].value=s,mF0(V[V.length-1]),q1.maxDepth+=V[V.length-1].depth}q1.slashes=G,q1.parts=K}return q1};uF0.exports=u34});var lF0=h((Df8,cF0)=>{var si=ck(),OK=lk(),{MAX_LENGTH:ti,POSIX_REGEX_SOURCE:p34,REGEX_NON_SPECIAL_CHARS:d34,REGEX_SPECIAL_CHARS_BACKREF:c34,REPLACEMENTS:dF0}=si,l34=(J,Q)=>{if(typeof Q.expandRange==="function")return Q.expandRange(...J,Q);J.sort();let Z=`[${J.join("-")}]`;try{new RegExp(Z)}catch(Y){return J.map((X)=>OK.escapeRegex(X)).join("..")}return Z},mE=(J,Q)=>{return`Missing ${J}: "${Q}" - use "\\\\${Q}" to match literal characters`},rW1=(J,Q)=>{if(typeof J!=="string")throw TypeError("Expected a string");J=dF0[J]||J;let Z={...Q},Y=typeof Z.maxLength==="number"?Math.min(ti,Z.maxLength):ti,X=J.length;if(X>Y)throw SyntaxError(`Input length: ${X}, exceeds maximum allowed length: ${Y}`);let G={type:"bos",value:"",output:Z.prepend||""},V=[G],K=Z.capture?"":"?:",q=si.globChars(Z.windows),W=si.extglobChars(q),{DOT_LITERAL:H,PLUS_LITERAL:z,SLASH_LITERAL:U,ONE_CHAR:D,DOTS_SLASH:M,NO_DOT:L,NO_DOT_SLASH:A,NO_DOTS_SLASH:E,QMARK:I,QMARK_NO_DOT:P,STAR:R,START_ANCHOR:y}=q,k=(o1)=>{return`(${K}(?:(?!${y}${o1.dot?M:H}).)*?)`},v=Z.dot?"":L,g=Z.dot?I:P,d=Z.bash===!0?k(Z):R;if(Z.capture)d=`(${d})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let b={input:J,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};J=OK.removePrefix(J,b),X=J.length;let a=[],G1=[],t=[],c=G,J1,q1=()=>b.index===X-1,L1=b.peek=(o1=1)=>J[b.index+o1],s=b.advance=()=>J[++b.index]||"",o=()=>J.slice(b.index+1),i=(o1="",F1=0)=>{b.consumed+=o1,b.index+=F1},z1=(o1)=>{b.output+=o1.output!=null?o1.output:o1.value,i(o1.value)},k1=()=>{let o1=1;while(L1()==="!"&&(L1(2)!=="("||L1(3)==="?"))s(),b.start++,o1++;if(o1%2===0)return!1;return b.negated=!0,b.start++,!0},e=(o1)=>{b[o1]++,t.push(o1)},f1=(o1)=>{b[o1]--,t.pop()},P1=(o1)=>{if(c.type==="globstar"){let F1=b.braces>0&&(o1.type==="comma"||o1.type==="brace"),Y1=o1.extglob===!0||a.length&&(o1.type==="pipe"||o1.type==="paren");if(o1.type!=="slash"&&o1.type!=="paren"&&!F1&&!Y1)b.output=b.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=d,b.output+=c.output}if(a.length&&o1.type!=="paren")a[a.length-1].inner+=o1.value;if(o1.value||o1.output)z1(o1);if(c&&c.type==="text"&&o1.type==="text"){c.output=(c.output||c.value)+o1.value,c.value+=o1.value;return}o1.prev=c,V.push(o1),c=o1},I0=(o1,F1)=>{let Y1={...W[F1],conditions:1,inner:""};Y1.prev=c,Y1.parens=b.parens,Y1.output=b.output;let w1=(Z.capture?"(":"")+Y1.open;e("parens"),P1({type:o1,value:F1,output:b.output?"":D}),P1({type:"paren",extglob:!0,value:s(),output:w1}),a.push(Y1)},_1=(o1)=>{let F1=o1.close+(Z.capture?")":""),Y1;if(o1.type==="negate"){let w1=d;if(o1.inner&&o1.inner.length>1&&o1.inner.includes("/"))w1=k(Z);if(w1!==d||q1()||/^\)+$/.test(o()))F1=o1.close=`)$))${w1}`;if(o1.inner.includes("*")&&(Y1=o())&&/^\.[^\\/.]+$/.test(Y1)){let A1=rW1(Y1,{...Q,fastpaths:!1}).output;F1=o1.close=`)${A1})${w1})`}if(o1.prev.type==="bos")b.negatedExtglob=!0}P1({type:"paren",extglob:!0,value:J1,output:F1}),f1("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(J)){let o1=!1,F1=J.replace(c34,(Y1,w1,A1,R1,j1,d1)=>{if(R1==="\\")return o1=!0,Y1;if(R1==="?"){if(w1)return w1+R1+(j1?I.repeat(j1.length):"");if(d1===0)return g+(j1?I.repeat(j1.length):"");return I.repeat(A1.length)}if(R1===".")return H.repeat(A1.length);if(R1==="*"){if(w1)return w1+R1+(j1?d:"");return d}return w1?Y1:`\\${Y1}`});if(o1===!0)if(Z.unescape===!0)F1=F1.replace(/\\/g,"");else F1=F1.replace(/\\+/g,(Y1)=>{return Y1.length%2===0?"\\\\":Y1?"\\":""});if(F1===J&&Z.contains===!0)return b.output=J,b;return b.output=OK.wrapOutput(F1,b,Q),b}while(!q1()){if(J1=s(),J1==="\x00")continue;if(J1==="\\"){let Y1=L1();if(Y1==="/"&&Z.bash!==!0)continue;if(Y1==="."||Y1===";")continue;if(!Y1){J1+="\\",P1({type:"text",value:J1});continue}let w1=/^\\+/.exec(o()),A1=0;if(w1&&w1[0].length>2){if(A1=w1[0].length,b.index+=A1,A1%2!==0)J1+="\\"}if(Z.unescape===!0)J1=s();else J1+=s();if(b.brackets===0){P1({type:"text",value:J1});continue}}if(b.brackets>0&&(J1!=="]"||c.value==="["||c.value==="[^")){if(Z.posix!==!1&&J1===":"){let Y1=c.value.slice(1);if(Y1.includes("[")){if(c.posix=!0,Y1.includes(":")){let w1=c.value.lastIndexOf("["),A1=c.value.slice(0,w1),R1=c.value.slice(w1+2),j1=p34[R1];if(j1){if(c.value=A1+j1,b.backtrack=!0,s(),!G.output&&V.indexOf(c)===1)G.output=D;continue}}}}if(J1==="["&&L1()!==":"||J1==="-"&&L1()==="]")J1=`\\${J1}`;if(J1==="]"&&(c.value==="["||c.value==="[^"))J1=`\\${J1}`;if(Z.posix===!0&&J1==="!"&&c.value==="[")J1="^";c.value+=J1,z1({value:J1});continue}if(b.quotes===1&&J1!=='"'){J1=OK.escapeRegex(J1),c.value+=J1,z1({value:J1});continue}if(J1==='"'){if(b.quotes=b.quotes===1?0:1,Z.keepQuotes===!0)P1({type:"text",value:J1});continue}if(J1==="("){e("parens"),P1({type:"paren",value:J1});continue}if(J1===")"){if(b.parens===0&&Z.strictBrackets===!0)throw SyntaxError(mE("opening","("));let Y1=a[a.length-1];if(Y1&&b.parens===Y1.parens+1){_1(a.pop());continue}P1({type:"paren",value:J1,output:b.parens?")":"\\)"}),f1("parens");continue}if(J1==="["){if(Z.nobracket===!0||!o().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(mE("closing","]"));J1=`\\${J1}`}else e("brackets");P1({type:"bracket",value:J1});continue}if(J1==="]"){if(Z.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){P1({type:"text",value:J1,output:`\\${J1}`});continue}if(b.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(mE("opening","["));P1({type:"text",value:J1,output:`\\${J1}`});continue}f1("brackets");let Y1=c.value.slice(1);if(c.posix!==!0&&Y1[0]==="^"&&!Y1.includes("/"))J1=`/${J1}`;if(c.value+=J1,z1({value:J1}),Z.literalBrackets===!1||OK.hasRegexChars(Y1))continue;let w1=OK.escapeRegex(c.value);if(b.output=b.output.slice(0,-c.value.length),Z.literalBrackets===!0){b.output+=w1,c.value=w1;continue}c.value=`(${K}${w1}|${c.value})`,b.output+=c.value;continue}if(J1==="{"&&Z.nobrace!==!0){e("braces");let Y1={type:"brace",value:J1,output:"(",outputIndex:b.output.length,tokensIndex:b.tokens.length};G1.push(Y1),P1(Y1);continue}if(J1==="}"){let Y1=G1[G1.length-1];if(Z.nobrace===!0||!Y1){P1({type:"text",value:J1,output:J1});continue}let w1=")";if(Y1.dots===!0){let A1=V.slice(),R1=[];for(let j1=A1.length-1;j1>=0;j1--){if(V.pop(),A1[j1].type==="brace")break;if(A1[j1].type!=="dots")R1.unshift(A1[j1].value)}w1=l34(R1,Z),b.backtrack=!0}if(Y1.comma!==!0&&Y1.dots!==!0){let A1=b.output.slice(0,Y1.outputIndex),R1=b.tokens.slice(Y1.tokensIndex);Y1.value=Y1.output="\\{",J1=w1="\\}",b.output=A1;for(let j1 of R1)b.output+=j1.output||j1.value}P1({type:"brace",value:J1,output:w1}),f1("braces"),G1.pop();continue}if(J1==="|"){if(a.length>0)a[a.length-1].conditions++;P1({type:"text",value:J1});continue}if(J1===","){let Y1=J1,w1=G1[G1.length-1];if(w1&&t[t.length-1]==="braces")w1.comma=!0,Y1="|";P1({type:"comma",value:J1,output:Y1});continue}if(J1==="/"){if(c.type==="dot"&&b.index===b.start+1){b.start=b.index+1,b.consumed="",b.output="",V.pop(),c=G;continue}P1({type:"slash",value:J1,output:U});continue}if(J1==="."){if(b.braces>0&&c.type==="dot"){if(c.value===".")c.output=H;let Y1=G1[G1.length-1];c.type="dots",c.output+=J1,c.value+=J1,Y1.dots=!0;continue}if(b.braces+b.parens===0&&c.type!=="bos"&&c.type!=="slash"){P1({type:"text",value:J1,output:H});continue}P1({type:"dot",value:J1,output:H});continue}if(J1==="?"){if(!(c&&c.value==="(")&&Z.noextglob!==!0&&L1()==="("&&L1(2)!=="?"){I0("qmark",J1);continue}if(c&&c.type==="paren"){let w1=L1(),A1=J1;if(c.value==="("&&!/[!=<:]/.test(w1)||w1==="<"&&!/<([!=]|\w+>)/.test(o()))A1=`\\${J1}`;P1({type:"text",value:J1,output:A1});continue}if(Z.dot!==!0&&(c.type==="slash"||c.type==="bos")){P1({type:"qmark",value:J1,output:P});continue}P1({type:"qmark",value:J1,output:I});continue}if(J1==="!"){if(Z.noextglob!==!0&&L1()==="("){if(L1(2)!=="?"||!/[!=<:]/.test(L1(3))){I0("negate",J1);continue}}if(Z.nonegate!==!0&&b.index===0){k1();continue}}if(J1==="+"){if(Z.noextglob!==!0&&L1()==="("&&L1(2)!=="?"){I0("plus",J1);continue}if(c&&c.value==="("||Z.regex===!1){P1({type:"plus",value:J1,output:z});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||b.parens>0){P1({type:"plus",value:J1});continue}P1({type:"plus",value:z});continue}if(J1==="@"){if(Z.noextglob!==!0&&L1()==="("&&L1(2)!=="?"){P1({type:"at",extglob:!0,value:J1,output:""});continue}P1({type:"text",value:J1});continue}if(J1!=="*"){if(J1==="$"||J1==="^")J1=`\\${J1}`;let Y1=d34.exec(o());if(Y1)J1+=Y1[0],b.index+=Y1[0].length;P1({type:"text",value:J1});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=J1,c.output=d,b.backtrack=!0,b.globstar=!0,i(J1);continue}let o1=o();if(Z.noextglob!==!0&&/^\([^?]/.test(o1)){I0("star",J1);continue}if(c.type==="star"){if(Z.noglobstar===!0){i(J1);continue}let Y1=c.prev,w1=Y1.prev,A1=Y1.type==="slash"||Y1.type==="bos",R1=w1&&(w1.type==="star"||w1.type==="globstar");if(Z.bash===!0&&(!A1||o1[0]&&o1[0]!=="/")){P1({type:"star",value:J1,output:""});continue}let j1=b.braces>0&&(Y1.type==="comma"||Y1.type==="brace"),d1=a.length&&(Y1.type==="pipe"||Y1.type==="paren");if(!A1&&Y1.type!=="paren"&&!j1&&!d1){P1({type:"star",value:J1,output:""});continue}while(o1.slice(0,3)==="/**"){let m1=J[b.index+4];if(m1&&m1!=="/")break;o1=o1.slice(3),i("/**",3)}if(Y1.type==="bos"&&q1()){c.type="globstar",c.value+=J1,c.output=k(Z),b.output=c.output,b.globstar=!0,i(J1);continue}if(Y1.type==="slash"&&Y1.prev.type!=="bos"&&!R1&&q1()){b.output=b.output.slice(0,-(Y1.output+c.output).length),Y1.output=`(?:${Y1.output}`,c.type="globstar",c.output=k(Z)+(Z.strictSlashes?")":"|$)"),c.value+=J1,b.globstar=!0,b.output+=Y1.output+c.output,i(J1);continue}if(Y1.type==="slash"&&Y1.prev.type!=="bos"&&o1[0]==="/"){let m1=o1[1]!==void 0?"|$":"";b.output=b.output.slice(0,-(Y1.output+c.output).length),Y1.output=`(?:${Y1.output}`,c.type="globstar",c.output=`${k(Z)}${U}|${U}${m1})`,c.value+=J1,b.output+=Y1.output+c.output,b.globstar=!0,i(J1+s()),P1({type:"slash",value:"/",output:""});continue}if(Y1.type==="bos"&&o1[0]==="/"){c.type="globstar",c.value+=J1,c.output=`(?:^|${U}|${k(Z)}${U})`,b.output=c.output,b.globstar=!0,i(J1+s()),P1({type:"slash",value:"/",output:""});continue}b.output=b.output.slice(0,-c.output.length),c.type="globstar",c.output=k(Z),c.value+=J1,b.output+=c.output,b.globstar=!0,i(J1);continue}let F1={type:"star",value:J1,output:d};if(Z.bash===!0){if(F1.output=".*?",c.type==="bos"||c.type==="slash")F1.output=v+F1.output;P1(F1);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&Z.regex===!0){F1.output=J1,P1(F1);continue}if(b.index===b.start||c.type==="slash"||c.type==="dot"){if(c.type==="dot")b.output+=A,c.output+=A;else if(Z.dot===!0)b.output+=E,c.output+=E;else b.output+=v,c.output+=v;if(L1()!=="*")b.output+=D,c.output+=D}P1(F1)}while(b.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(mE("closing","]"));b.output=OK.escapeLast(b.output,"["),f1("brackets")}while(b.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(mE("closing",")"));b.output=OK.escapeLast(b.output,"("),f1("parens")}while(b.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(mE("closing","}"));b.output=OK.escapeLast(b.output,"{"),f1("braces")}if(Z.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket"))P1({type:"maybe_slash",value:"",output:`${U}?`});if(b.backtrack===!0){b.output="";for(let o1 of b.tokens)if(b.output+=o1.output!=null?o1.output:o1.value,o1.suffix)b.output+=o1.suffix}return b};rW1.fastpaths=(J,Q)=>{let Z={...Q},Y=typeof Z.maxLength==="number"?Math.min(ti,Z.maxLength):ti,X=J.length;if(X>Y)throw SyntaxError(`Input length: ${X}, exceeds maximum allowed length: ${Y}`);J=dF0[J]||J;let{DOT_LITERAL:G,SLASH_LITERAL:V,ONE_CHAR:K,DOTS_SLASH:q,NO_DOT:W,NO_DOTS:H,NO_DOTS_SLASH:z,STAR:U,START_ANCHOR:D}=si.globChars(Z.windows),M=Z.dot?H:W,L=Z.dot?z:W,A=Z.capture?"":"?:",E={negated:!1,prefix:""},I=Z.bash===!0?".*?":U;if(Z.capture)I=`(${I})`;let P=(v)=>{if(v.noglobstar===!0)return I;return`(${A}(?:(?!${D}${v.dot?q:G}).)*?)`},R=(v)=>{switch(v){case"*":return`${M}${K}${I}`;case".*":return`${G}${K}${I}`;case"*.*":return`${M}${I}${G}${K}${I}`;case"*/*":return`${M}${I}${V}${K}${L}${I}`;case"**":return M+P(Z);case"**/*":return`(?:${M}${P(Z)}${V})?${L}${K}${I}`;case"**/*.*":return`(?:${M}${P(Z)}${V})?${L}${I}${G}${K}${I}`;case"**/.*":return`(?:${M}${P(Z)}${V})?${G}${K}${I}`;default:{let g=/^(.*?)\.(\w+)$/.exec(v);if(!g)return;let d=R(g[1]);if(!d)return;return d+G+g[2]}}},y=OK.removePrefix(J,E),k=R(y);if(k&&Z.strictSlashes!==!0)k+=`${V}?`;return k};cF0.exports=rW1});var nk=h((Mf8,nF0)=>{var i34=pF0(),sW1=lF0(),iF0=lk(),n34=ck(),a34=(J)=>J&&typeof J==="object"&&!Array.isArray(J),V3=(J,Q,Z=!1)=>{if(Array.isArray(J)){let H=J.map((U)=>V3(U,Q,Z));return(U)=>{for(let D of H){let M=D(U);if(M)return M}return!1}}let Y=a34(J)&&J.tokens&&J.input;if(J===""||typeof J!=="string"&&!Y)throw TypeError("Expected pattern to be a non-empty string");let X=Q||{},G=X.windows,V=Y?V3.compileRe(J,Q):V3.makeRe(J,Q,!1,!0),K=V.state;delete V.state;let q=()=>!1;if(X.ignore){let H={...Q,ignore:null,onMatch:null,onResult:null};q=V3(X.ignore,H,Z)}let W=(H,z=!1)=>{let{isMatch:U,match:D,output:M}=V3.test(H,V,Q,{glob:J,posix:G}),L={glob:J,state:K,regex:V,posix:G,input:H,output:M,match:D,isMatch:U};if(typeof X.onResult==="function")X.onResult(L);if(U===!1)return L.isMatch=!1,z?L:!1;if(q(H)){if(typeof X.onIgnore==="function")X.onIgnore(L);return L.isMatch=!1,z?L:!1}if(typeof X.onMatch==="function")X.onMatch(L);return z?L:!0};if(Z)W.state=K;return W};V3.test=(J,Q,Z,{glob:Y,posix:X}={})=>{if(typeof J!=="string")throw TypeError("Expected input to be a string");if(J==="")return{isMatch:!1,output:""};let G=Z||{},V=G.format||(X?iF0.toPosixSlashes:null),K=J===Y,q=K&&V?V(J):J;if(K===!1)q=V?V(J):J,K=q===Y;if(K===!1||G.capture===!0)if(G.matchBase===!0||G.basename===!0)K=V3.matchBase(J,Q,Z,X);else K=Q.exec(q);return{isMatch:Boolean(K),match:K,output:q}};V3.matchBase=(J,Q,Z)=>{return(Q instanceof RegExp?Q:V3.makeRe(Q,Z)).test(iF0.basename(J))};V3.isMatch=(J,Q,Z)=>V3(Q,Z)(J);V3.parse=(J,Q)=>{if(Array.isArray(J))return J.map((Z)=>V3.parse(Z,Q));return sW1(J,{...Q,fastpaths:!1})};V3.scan=(J,Q)=>i34(J,Q);V3.compileRe=(J,Q,Z=!1,Y=!1)=>{if(Z===!0)return J.output;let X=Q||{},G=X.contains?"":"^",V=X.contains?"":"$",K=`${G}(?:${J.output})${V}`;if(J&&J.negated===!0)K=`^(?!${K}).*$`;let q=V3.toRegex(K,Q);if(Y===!0)q.state=J;return q};V3.makeRe=(J,Q={},Z=!1,Y=!1)=>{if(!J||typeof J!=="string")throw TypeError("Expected a non-empty string");let X={negated:!1,fastpaths:!0};if(Q.fastpaths!==!1&&(J[0]==="."||J[0]==="*"))X.output=sW1.fastpaths(J,Q);if(!X.output)X=sW1(J,Q);return V3.compileRe(X,Q,Z,Y)};V3.toRegex=(J,Q)=>{try{let Z=Q||{};return new RegExp(J,Z.flags||(Z.nocase?"i":""))}catch(Z){if(Q&&Q.debug===!0)throw Z;return/$^/}};V3.constants=n34;nF0.exports=V3});var fW=h((Lf8,rF0)=>{var aF0=nk(),o34=lk();function oF0(J,Q,Z=!1){if(Q&&(Q.windows===null||Q.windows===void 0))Q={...Q,windows:o34.isWindows()};return aF0(J,Q,Z)}Object.assign(oF0,aF0);rF0.exports=oF0});var gE;var tW1=B1(()=>{gE={name:"amp",description:"The frontier coding agent, with a highly capable `smart` mode and a fast `free` mode. ",private:!0,displayName:"Amp (Research Preview)",version:"0.0.0-dev",publisher:"sourcegraph",license:"Apache-2.0",categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["sourcegraph","amp","amp code","ampcode","ai","assistant","llm","Claude","Claude Sonnet 4.5","GPT-5","agent","free","Claude Sonnet"],icon:"./resources/amp-icon.png",scripts:{dev:"pnpm run -s dev:desktop","dev:insiders":"pnpm run -s dev:desktop:insiders","dev:watch":"NODE_ENV=development bun run scripts/watch.ts","start:dev:desktop":"node scripts/start-dev.js","start:dev:desktop:insiders":"node scripts/start-dev.js --insiders","dev:desktop":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop","dev:desktop:insiders":"pnpm run -s build:dev:desktop && pnpm run start:dev:desktop:insiders","build:dev:desktop":"NODE_ENV=development bun run scripts/build.ts",build:"pnpm run -s _build:extension && pnpm run -s _build:web","build:production":"pnpm run -s _build:extension:production && pnpm run -s _build:web:production","_build:extension":"NODE_ENV=development bun run scripts/build.ts","_build:extension:production":"NODE_ENV=production bun run scripts/build.ts","_build:web":"pnpm -C ../web run build && cp -R ../web/build dist/web-build","_build:web:production":"pnpm -C ../web run build:production && cp -R ../web/build dist/web-build","build:icon-font":"npx -y svgtofont --sources ./icon-font/svg --output ./icon-font/build && cp ./icon-font/build/amp-icons.woff ./resources","dev:forks":"pnpm dev:vsix && cursor --install-extension dist/amp-dev.vsix --force && windsurf --install-extension dist/amp-dev.vsix --force","dev:vsix":"pnpm run -s build && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code --install-extension dist/amp-dev.vsix --force","dev:insiders:vsix":"pnpm run -s build && vsce package --no-dependencies --pre-release --out dist/amp-dev.vsix && code-insiders --install-extension dist/amp-dev.vsix --force","prod:vsix":"pnpm run -s build:production && vsce package --no-dependencies --pre-release --out dist/amp-prod.vsix && code --install-extension dist/amp-prod.vsix --force","prod:vsix:test-manual":"bun run scripts/vsix-test-manual.ts","prod:vsix:test-ci":"bun run scripts/vsix-test-ci.ts",test:"vitest run","test:dev":"vitest"},homepage:"https://ampcode.com",repository:{type:"git",url:"https://github.com/sourcegraph/amp",directory:"vscode"},author:{name:"The Amp Team",email:"amp-devs@ampcode.com"},engines:{vscode:"^1.79.0",node:">=22.0.0"},main:"./dist/extension.cjs",activationEvents:["onStartupFinished"],extensionDependencies:["vscode.git"],contributes:{languages:[{id:"jsonc",filenamePatterns:["**/Library/Application Support/ampcode/managed-settings.json","**/etc/ampcode/managed-settings.json","**/ProgramData/ampcode/managed-settings.json"]}],viewsContainers:{activitybar:[{id:"sourcegraph-amp",title:"Amp",icon:"./resources/amp-mark.svg"}]},views:{"sourcegraph-amp":[{type:"webview",id:"amp.sidebarView",name:"Amp",icon:"./resources/amp-mark.svg",visibility:"visible"},{type:"webview",id:"amp.reviewPanel",name:"Review",icon:"$(compare-changes)",visibility:"visible",when:"config.amp.review.separatePanel"}]},commands:[{command:"amp.agent.newThread",title:"New Thread",category:"Amp",icon:"$(add)"},{command:"amp.agent.newWindow",title:"New Agent Window",category:"Amp",icon:"$(browser)",enablement:"amp.activated"},{command:"amp.agent.toggleVisibility",title:"Toggle Agent",category:"Amp"},{command:"amp.agent.openReview",title:"Open Amp Review",category:"Amp",icon:"$(compare-changes)",enablement:"amp.activated"},{command:"amp.agent.focusPromptEditor",title:"Focus Prompt Editor",category:"Amp"},{command:"amp.agent.addSelectionToPromptEditor",title:"Add Selection to Prompt",category:"Amp",enablement:"editorHasSelection"},{command:"amp.agent.switchAgentMode",title:"Switch Agent Mode for Current Thread",category:"Amp",enablement:"amp.hasMultipleVisibleModes"},{command:"amp.agent.findInThread",title:"Find in Thread",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.collapseAllInThread",title:"Collapse All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandAllInThread",title:"Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.expandToggleInThread",title:"Toggle Expand All Blocks in Thread",category:"Amp"},{command:"amp.agent.toggleThreadSwitcher",title:"Switch to Thread...",category:"Amp",enablement:"amp.agent.active"},{command:"amp.agent.toggleDetailedCostsDisplay",title:"Toggle Detailed Costs",category:"Amp",enablement:"amp.isSourcegraphTeammate"},{command:"amp.agent.navigateThreadPrevious",title:"Navigate to Previous Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",title:"Navigate to Next Thread",category:"Amp",enablement:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.openThreadJSON",title:"Open Thread JSON",category:"Amp",enablement:"amp.isDevelopmentMode || amp.isSourcegraphTeammate"},{command:"amp.testThreadSummary",title:"Test Thread Summary",category:"Amp",enablement:"amp.isDevelopmentMode"},{command:"amp.tab.quickPickMenu",title:"Show Tab Menu",category:"Amp",icon:"$(debug)",enablement:"amp.activated"},{command:"amp.tab.manualTrigger",title:"Tab Manual Trigger",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.enable",title:"Enable Tab",category:"Amp",enablement:"amp.activated && !config.amp.tab.enabled"},{command:"amp.tab.disable",title:"Disable Tab",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.toggleForCurrentDocument",title:"Toggle Tab for Current Document",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.debugInfo",title:"Open Tab Debug Info",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.tab.autoAcceptChain",title:"Accept Suggestion Chain",category:"Amp",enablement:"amp.activated && config.amp.tab.enabled"},{command:"amp.mcp.restartServers",title:"Restart MCP Servers",category:"Amp"},{command:"amp.connect.reconnect",title:"Reconnect",category:"Amp",enablement:"amp.activated"},{command:"amp.agent.editUserPermissions",title:"Edit User Permissions",category:"Amp"},{command:"amp.agent.editWorkspacePermissions",title:"Edit Workspace Permissions",category:"Amp"},{command:"amp.commandPalette.show",title:"Show Amp Command Palette",category:"Amp",icon:"$(list-flat)"}],menus:{"editor/context":[{command:"amp.agent.addSelectionToPromptEditor",when:"editorHasSelection",group:"amp@1"}]},keybindings:[{command:"amp.agent.newThread",key:"ctrl+l",mac:"cmd+l",when:"amp.primaryShortcuts"},{command:"amp.agent.newThread",key:"ctrl+alt+j",mac:"cmd+alt+j",when:"!amp.primaryShortcuts"},{command:"amp.agent.newWindow",key:"ctrl+shift+l",mac:"cmd+shift+l"},{command:"amp.agent.toggleVisibility",key:"ctrl+i",mac:"cmd+i",when:"amp.primaryShortcuts"},{command:"amp.agent.toggleVisibility",key:"ctrl+alt+u",mac:"cmd+alt+u",when:"!amp.primaryShortcuts"},{command:"amp.agent.findInThread",key:"ctrl+f",mac:"cmd+f",when:"amp.agent.active"},{command:"amp.agent.toggleThreadSwitcher",key:"ctrl+k",mac:"cmd+k",when:"amp.agent.active"},{command:"amp.agent.toggleDetailedCostsDisplay",key:"ctrl+d",mac:"cmd+d",when:"amp.agent.active && amp.isSourcegraphTeammate || isWeb"},{command:"amp.agent.navigateThreadPrevious",key:"ctrl+shift+[",mac:"cmd+shift+[",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.navigateThreadNext",key:"ctrl+shift+]",mac:"cmd+shift+]",when:"amp.agent.active && amp.agent.activeView == 'sidebar'"},{command:"amp.agent.savePermissions",key:"ctrl+s",mac:"cmd+s",enablement:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i",when:"editorTextFocus && resourcePath =~ /[\\\\/]amp[\\\\/]permissions-.*\\.sh$/i"},{command:"amp.agent.openReview",key:"ctrl+;",mac:"cmd+;"},{command:"-extension.vim_tab",key:"tab",when:"editorTextFocus && vim.active && vim.mode != 'Insert' && !inlineEditIsVisible && !inDebugRepl"},{command:"-vscode-neovim.send",key:"tab",when:"neovim.init && (editorTextFocus && neovim.mode != insert && editorLangId not in neovim.editorLangIdExclusions || neovim.recording)"},{command:"amp.tab.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.dismiss",key:"escape",when:"editorTextFocus && amp.activated && amp.tab.active && !amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.accept",key:"tab",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.nextCursor.discard",key:"escape",when:"editorTextFocus && amp.activated && amp.nextCursorSuggested && !suggestWidgetVisible && !amp.editorHasMultipleLineSelection"},{command:"amp.tab.autoAcceptChain",key:"alt+shift+tab",when:"editorTextFocus && amp.activated && (amp.tab.active || amp.nextCursorSuggested) && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.accept",key:"tab",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.autoImport.discard",key:"escape",when:"editorTextFocus && amp.activated && config.amp.tab.enabled && amp.autoImportSuggested && !amp.editorHasMultipleLineSelection"},{command:"amp.commandPalette.show",key:"ctrl+shift+a",mac:"cmd+shift+a",when:"amp.activated"},{command:"amp.agent.switchAgentMode",key:"ctrl+shift+m",mac:"cmd+shift+m",when:"amp.activated && amp.hasMultipleVisibleModes"}],configuration:{type:"object",title:"Amp",properties:{"amp.url":{type:"string",examples:["https://ampcode.com/"],description:"URL to the Amp server, usually https://ampcode.com/",scope:"application"},"amp.notifications.enabled":{type:"boolean",default:!0,description:"Play notification sound when done or blocked",scope:"window"},"amp.mcpServers":{type:"object",description:"Model Context Protocol servers that expose tools",additionalProperties:{type:"object",oneOf:[{properties:{command:{type:"string"},args:{type:"array",items:{type:"string"}},env:{type:"object",additionalProperties:{type:"string"}}},required:["command"]},{properties:{url:{type:"string"},headers:{type:"object",description:"HTTP headers to send with requests to the MCP server",additionalProperties:{type:"string"}},oauth:{type:"object",description:"OAuth 2.0 configuration for MCP server authentication",properties:{clientId:{type:"string",description:"OAuth client ID"},clientSecret:{type:"string",description:"OAuth client secret (optional for public clients)"},authUrl:{type:"string",description:"OAuth authorization endpoint URL"},tokenUrl:{type:"string",description:"OAuth token endpoint URL"},scopes:{type:"array",description:"OAuth scopes to request",items:{type:"string"}},redirectUrl:{type:"string",description:"OAuth redirect URL (defaults to http://localhost:8976/oauth/callback)"}}}},required:["url"]}]}},"amp.mcpTrustedServers":{type:"array",markdownDescription:"MCP server trust decisions. **Security Note:** This setting is only read from user settings, never workspace settings, to prevent malicious repositories from auto-approving MCP servers.",scope:"application",items:{type:"object",properties:{serverName:{type:"string",description:"MCP server name"},specHash:{type:"string",description:"Hash of the server configuration"},allow:{type:"boolean",description:"Whether this server is approved"}},required:["serverName","specHash","allow"]}},"amp.workspaces":{type:"array",markdownDescription:"Workspace-level configuration. This setting is only read from user settings, never workspace settings.",scope:"application",items:{type:"object",properties:{path:{type:"string",description:"Absolute path to the workspace"},allowAllMcpServers:{type:"boolean",description:"Whether to automatically trust all MCP servers in this workspace"}},required:["path"]}},"amp.mcpPermissions":{type:"array",description:"Permissions for Model Context Protocol (MCP) servers. Controls which MCP servers can be used.",items:{type:"object",properties:{matches:{$ref:"https://static.ampcode.com/schemas/permissions.schema.json#/$defs/permissionMatchCondition"},action:{type:"string",enum:["allow","reject"],description:"Whether to allow or reject MCP servers matching the condition"}},required:["matches","action"],additionalProperties:!1},default:[],scope:"application"},"amp.permissions":{$ref:"https://static.ampcode.com/schemas/permissions.schema.json",description:"Entries checked in sequence to configure tool permissions",default:[]},"amp.experimental.promptAutocomplete.verboseLogging":{type:"boolean",default:!1,markdownDescription:"Enable verbose logging for prompt autocomplete.",scope:"application"},"amp.experimental.guidanceFilesInContext":{type:"boolean",default:!0,markdownDescription:"Deliver AGENTS.md guidance files in message context instead of system prompt for improved cache efficiency.",scope:"window"},"amp.experimental.tools":{type:"array",description:"Enable experimental tools by name. Available tools: kraken",items:{type:"string"},default:[],scope:"application"},"amp.tools.disable":{type:"array",markdownDescription:'Disable specific tools by name. Glob patterns using * are supported\n\nExamples:\n- Disable edit_file: `["builtin:edit_file"]`\n- Disable all playwright tab tools: `["mcp__playwright__browser_tab*"]`',items:{type:"string"},default:[]},"amp.toolbox.path":{type:"string",markdownDescription:"Path to the directory containing toolbox scripts. Supports colon-separated paths.",scope:"window"},"amp.dangerouslyAllowAll":{type:"boolean",description:"If true, never ask for confirmation when running commands",scope:"window",default:!1},"amp.model.sonnet":{type:"boolean",description:"Use Claude Sonnet 4.5 instead of Claude Opus 4.5",scope:"window",default:!1},"amp.guardedFiles.allowlist":{type:"array",description:"Glob patterns for files that should bypass guarded file protection. Files matching these patterns can be modified without user confirmation.",items:{type:"string"},default:[],scope:"window"},"amp.anthropic.thinking.enabled":{type:"boolean",default:!0,description:"Enable Claude's extended thinking capabilities",scope:"application"},"amp.tools.inactivityTimeout":{type:"number",default:300,minimum:1,maximum:3600,description:"How many seconds of no output to wait before canceling bash commands.",scope:"workspace"},"amp.tools.stopTimeout":{type:"number",default:300,description:"How many seconds to wait before canceling a running tool.",scope:"application"},"amp.terminal.commands.nodeSpawn.loadProfile":{type:"string",enum:["always","never","daily"],default:"always",description:"Before running commands (including MCP servers), whether to load environment variables from the user's profile (.bashrc, .zshrc, .envrc) as visible from the workspace root directory.",scope:"application"},"amp.todos.enabled":{type:"boolean",default:!0,description:"Enable TODOs tracking for managing tasks",scope:"application"},"amp.fuzzy.alwaysIncludePaths":{type:"array",items:{type:"string"},default:[],markdownDescription:"Glob patterns for paths that should always be included in fuzzy file search, even if they are gitignored. Dotfiles and directories starting with `.` are supported.\n\nExamples:\n- `dist/**`\n- `node_modules/@myorg/**`\n- `.hidden/**`",scope:"window"},"amp.guidanceFiles.specs":{type:"boolean",default:!1,description:"[Experimental] Read `*.spec.md` files adjacent to `AGENT.md` files that are read",scope:"window"},"amp.security.audit.logMcpConnections":{type:"boolean",default:!1,description:"Enable telemetry logging for remote MCP server connections (for security auditing)",scope:"application"},"amp.review.separatePanel":{type:"boolean",default:!1,description:"Show the review panel as a separate container that's independently draggable to a different sidebar location.",scope:"window"},"amp.hooks":{type:"array",scope:"window",description:"[Experimental] Hooks are event handlers that can react to specific conditions.",items:{type:"object",properties:{compatibilityDate:{type:"string",const:"2025-05-13",default:"2025-05-13",description:"The version of the hook schema that this value was written to conform to"},id:{type:"string",description:"A unique identifier for the hook",examples:["run-vitest-with-env-vars"]},description:{type:"string",description:"A description of the hook"},on:{oneOf:[{type:"object",properties:{event:{type:"string",const:"tool:pre-execute",default:"tool:pre-execute",description:"Trigger when a tool is about to be executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"},"input.contains":{oneOf:[{type:"string",description:"String pattern to match in the tool input"},{type:"array",items:{type:"string"},description:"String patterns to match in the tool input"}],description:"Trigger only when the tool input contains the given literal string or strings"}},required:["event","tool","input.contains"]},{type:"object",properties:{event:{type:"string",const:"tool:post-execute",default:"tool:post-execute",description:"Trigger after a tool has been executed"},tool:{oneOf:[{type:"string",description:"Tool name to match (e.g., 'edit_file')"},{type:"array",items:{type:"string"},description:"Tool names to match"}],description:"Trigger for the given tool name(s)"}},required:["event","tool"]}]},action:{oneOf:[{type:"object",properties:{type:{type:"string",const:"send-user-message",default:"send-user-message",description:"Send a user message to interrupt the agent and cancel the tool call in the `tool:pre-execute` trigger before it starts to run"},message:{type:"string",description:"The text of the message to send"}},required:["type","message"]},{type:"object",properties:{type:{type:"string",const:"redact-tool-input",default:"redact-tool-input",description:"Redact the tool input after execution. Only allowed with `tool:post-execute` event."},redactedInput:{type:"object",description:"The replacement input data to use instead of the original tool input (must be an object)"}},required:["type","redactedInput"]}]},if:{type:"boolean",description:"A condition that determines whether the hook should be executed",default:!0}},required:["compatibilityDate","id","on","action"]},default:[]},"amp.tab.enabled":{type:"boolean",default:!1,description:"Enable Amp Tab",scope:"application"},"amp.tab.clipboard.enabled":{type:"boolean",default:!0,description:"Enable clipboard access for Amp Tab context",scope:"application"},"amp.tab.verboseLogs":{type:"boolean",default:!1,description:"Enable verbose logging for Amp Tab",scope:"application"},"amp.debug.logReview":{type:"boolean",default:!1,description:"Enable debug logging for review git operations",scope:"application"},"amp.debugLogs":{type:"boolean",default:!1,description:"Enable debug logging in the Amp output channel",scope:"application"},"amp.tab.disabledLanguages":{type:"array",items:{type:"string"},default:[],examples:["markdown","python"],description:"List of language IDs for which Amp Tab is disabled",scope:"application"},"amp.tab.disableOnComment":{type:"boolean",default:!1,description:"Disable Amp Tab completions on comment lines",scope:"application"},"amp.tab.autoImport.enabled":{type:"boolean",default:!0,description:"Enable auto import in Amp Tab",scope:"application"},"amp.tab.dismissCommandIds":{type:"array",items:{type:"string"},default:["extension.vim_escape","vim.escape","vscode-neovim.escape","vscode-neovim.escapeKey"],description:"Command IDs to run when Escape is pressed to dismiss an Amp Tab suggestion",scope:"application"},"amp.tab.experimental.showHotStreakProgress":{type:"boolean",default:!1,description:"Experimental: Show hot streak progress in image-rendered suggestions",scope:"window"},"amp.tab.experimental.autoAccept.delayMs":{type:"number",default:0,description:"Experimental: Delay in milliseconds before auto-accepting Amp Tab suggestions",scope:"application"},"amp.tab.experimental.unobtrusiveDiffs":{type:"boolean",default:!1,description:"Experimental: Enable unobtrusive diffs mode for Amp Tab suggestions. When enabled, suggestions are shown as image overlays to avoid layout shifts and visual interference with existing code.",scope:"application"},"amp.tab.diagnosticTracking":{type:"string",enum:["disabled","same_file","multi_file"],default:"multi_file",description:"Enable diagnostic tracking for Amp Tab suggestions. 'disabled' = no tracking, 'same_file' = track diagnostics within the same file, 'multi_file' = track diagnostics across multiple files.",scope:"application"},"amp.tab.hoverDiagnosticSuggestions":{type:"boolean",default:!1,description:"Show suggestions when hovering over diagnostics.",scope:"application"},"amp.tab.experimental.displayMode":{type:"string",enum:["eager","subtle"],default:"eager",description:"Experimental: Control how Amp Tab suggestions are displayed. 'eager' = show diff immediately, 'subtle' = show 'Tab to Jump' first, then show diff after user interaction.",scope:"application"},"amp.tab.experimental.disableClientFilters":{type:"array",items:{type:"string",enum:["recentlyRejectedCodeToRewrite","recentEdits","rewriteAreaOverlap","bigModification","incompatibleWithSelectedCompletionContextItem","recentlyRejectedDiff","whiteSpaceOnlyChange","formattingOnlyChange"]},default:[],description:"Experimental: Disable specific client-side filters to observe unfiltered model behavior.",scope:"application"},"amp.ui.zoomLevel":{type:"number",default:1,description:"Zoom level for the Amp UI",scope:"application"},"amp.experimental.bookkeeper":{type:"boolean",default:!1,description:"Enable the Bookkeeper subagent for reading and querying Excel workbooks (.xlsx)",scope:"window"},"amp.experimental.planMode":{type:"boolean",default:!1,description:"Enable plan mode for collaborative planning before execution",scope:"window"},"amp.experimental.reviewSubagent":{type:"boolean",default:!1,description:"Enable the review subagent for code review",scope:"window"},"amp.experimental.courseCorrection.enabled":{type:"boolean",default:!1,description:"Enable course correction agent that monitors the thread and provides guidance when the model goes off track",scope:"window"},"amp.experimental.dojoMode":{type:"boolean",default:!1,description:"Enable dojo mode - a learning mode that guides you to discover solutions yourself",scope:"window"},"amp.git.commit.coauthor.enabled":{type:"boolean",default:!0,description:"Enable adding Amp as co-author in git commits",scope:"window"},"amp.git.commit.ampThread.enabled":{type:"boolean",default:!0,description:"Enable adding Amp-Thread trailer in git commits",scope:"window"},"amp.showCosts":{type:"boolean",default:!0,description:"Show cost information for threads",scope:"application"}}},icons:{"amp-agent-file":{description:"Amp agent file",default:{fontPath:"resources/amp-icons.woff",fontCharacter:"\\0041"}}}},capabilities:{untrustedWorkspaces:{supported:"limited",description:"Amp only uses MCP servers from trusted workspaces because they execute code.",restrictedConfigurations:["amp.mcpServers","amp.mcpPermissions","amp.url"]},virtualWorkspaces:{supported:!1,description:"Amp is not supported in virtual workspaces like GitHub.dev because Amp requires local file system access and terminal capabilities."}},dependencies:{"@anthropic-ai/sdk":"catalog:","@opentelemetry/api":"catalog:","@opentelemetry/api-logs":"catalog:","@opentelemetry/core":"catalog:","@opentelemetry/exporter-logs-otlp-http":"catalog:","@opentelemetry/exporter-metrics-otlp-http":"catalog:","@opentelemetry/exporter-trace-otlp-http":"catalog:","@opentelemetry/resources":"catalog:","@opentelemetry/sdk-logs":"catalog:","@opentelemetry/sdk-metrics":"catalog:","@opentelemetry/sdk-node":"catalog:","@opentelemetry/sdk-trace-base":"catalog:","@opentelemetry/sdk-trace-node":"catalog:","@opentelemetry/semantic-conventions":"catalog:","@sourcegraph/amp-core":"workspace:*","@sourcegraph/amp-uri":"workspace:*","@sourcegraph/observable":"workspace:*","canvaskit-wasm":"^0.40.0","detect-indent":"^7.0.1",diff:"catalog:","eventsource-parser":"catalog:","fast-json-stable-stringify":"^2.1.0","fast-myers-diff":"^3.2.0","fast-xml-parser":"^5.2.3",isbinaryfile:"^5.0.5","jsonc-parser":"^3.3.1",lodash:"^4.17.21","lru-cache":"^11.1.0","node-fetch":"^3.3.2",shiki:"3.8.1",systeminformation:"^5.27.7",uuid:"catalog:","vscode-languageserver-textdocument":"^1.0.12","wink-nlp-utils":"^2.1.0",ws:"^8.18.3",zod:"catalog:"},devDependencies:{"@secretlint/secretlint-rule-no-dotenv":"^11.2.5","@secretlint/secretlint-rule-preset-recommend":"^11.2.5","@sourcegraph/amp-web":"workspace:*","@types/bun":"^1.2.17",dedent:"catalog:","@types/diff":"catalog:","@types/jest-image-snapshot":"^6.4.0","@types/lodash":"^4.17.15","@types/node":"catalog:","@types/uuid":"^10.0.0","@types/vscode":"^1.79.0","@types/ws":"^8.18.1","@vscode/test-electron":"^2.4.1","@vscode/vsce":"^3.2.2","cross-env":"^7.0.3","crypto-browserify":"^3.12.1","jest-image-snapshot":"^6.5.0","os-browserify":"^0.3.0","path-browserify":"^1.0.1","rollup-plugin-polyfill-node":"^0.13.0",tsx:"^4.19.4"}}});function s34(J){return typeof J==="number"&&Number.isInteger(J)&&J>=1&&J<=3600}function tF0(J){let Q=J.settings["tools.inactivityTimeout"],Z=J.settings["tools.stopTimeout"],Y=Q;if(Y===void 0&&Z!==void 0)Y=Z;if(Y===void 0)Y=gE.contributes.configuration.properties["amp.tools.inactivityTimeout"].default;if(!s34(Y))return null;return Y*1000}function eF0(J){let Q=J.settings["tools.stopTimeout"],Z=gE.contributes.configuration.properties["amp.tools.stopTimeout"].default;return(Q??Z)*1000}var sF0;var ei=B1(()=>{tW1();sF0=gE.contributes.configuration.properties});function K3(J){let Q=A8[J];return`${Q.provider}/${Q.name}`}function uJ(J){let Q=J.indexOf("/");if(Q===-1)throw Error(`Invalid provider/model format: ${J}`);let Z=J.slice(0,Q),Y=J.slice(Q+1);for(let X of Object.values(A8))if(X.provider===Z&&X.name===Y)return X;switch(Z){case"anthropic":return A8.CLAUDE_SONNET_4_5;case"openai":return A8.GPT_5;case"xai":return A8.GROK_CODE_FAST_1;case"cerebras":return A8.Z_AI_GLM_4_6;case"fireworks":return A8.FIREWORKS_GLM_4P6;case"moonshotai":return A8.KIMI_K2_INSTRUCT;case"openrouter":return A8.SONOMA_SKY_ALPHA;case"groq":return A8.GPT_OSS_120B;case"vertexai":return A8.GEMINI_2_5_FLASH_PREVIEW_09_2025;default:throw Error(`Unknown provider: ${Z}`)}}function JU0(J){for(let Q of Object.values(A8))if(Q.name===J)return Q;return}function MZ(J){let Q=J.indexOf("/");if(Q===-1)return J;return J.slice(Q+1)}function wG(J,Q){let Z=uJ(J);if(Q&&Z.maxInputTokensInFreeMode)return Z.maxInputTokensInFreeMode;return Z.contextWindow-Z.maxOutputTokens}function QU0(J){return J?.pricing?.cacheTTL??300}var Y9,A8,eW1;var RQ=B1(()=>{Y9={ANTHROPIC:"anthropic",OPENAI:"openai",XAI:"xai",CEREBRAS:"cerebras",FIREWORKS:"fireworks",GROQ:"groq",MOONSHOT:"moonshotai",OPENROUTER:"openrouter",VERTEXAI:"vertexai"},A8={CLAUDE_SONNET_4:{provider:Y9.ANTHROPIC,name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",contextWindow:1e6,maxOutputTokens:32000,pricing:{input:3,output:15,cached:0.3,cacheWrite:3.75,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_SONNET_4_5:{provider:Y9.ANTHROPIC,name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",contextWindow:1e6,maxOutputTokens:32000,pricing:{input:3,output:15,cached:0.3,cacheWrite:3.75,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4:{provider:Y9.ANTHROPIC,name:"claude-opus-4-20250514",displayName:"Claude Opus 4",contextWindow:200000,maxOutputTokens:32000,pricing:{input:15,output:75,cached:1.5,cacheWrite:18.75,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4_1:{provider:Y9.ANTHROPIC,name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",contextWindow:200000,maxOutputTokens:32000,pricing:{input:15,output:75,cached:1.5,cacheWrite:18.75,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_OPUS_4_5:{provider:Y9.ANTHROPIC,name:"claude-opus-4-5-20251101",displayName:"Claude Opus 4.5",contextWindow:200000,maxOutputTokens:32000,pricing:{input:5,output:25,cached:0.5,cacheWrite:6.25,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0}},CLAUDE_HAIKU_4_5:{provider:Y9.ANTHROPIC,name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",contextWindow:200000,maxOutputTokens:64000,pricing:{input:1,output:5,cached:0.1,cacheWrite:1.25,cacheTTL:300},capabilities:{reasoning:!0,vision:!0,tools:!0},maxInputTokensInFreeMode:120000},GPT_5:{provider:Y9.OPENAI,name:"gpt-5",displayName:"GPT-5",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_1:{provider:Y9.OPENAI,name:"gpt-5.1",displayName:"GPT-5.1",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_CODEX:{provider:Y9.OPENAI,name:"gpt-5-codex",displayName:"GPT-5 Codex",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,tools:!0}},GPT_5_1_CODEX:{provider:Y9.OPENAI,name:"gpt-5.1-codex",displayName:"GPT-5.1 Codex",contextWindow:400000,maxOutputTokens:128000,pricing:{input:1.25,output:10,cached:0.125},capabilities:{reasoning:!0,tools:!0}},GPT_5_MINI:{provider:Y9.OPENAI,name:"gpt-5-mini",displayName:"GPT-5 Mini",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.25,output:2,cached:0.025},capabilities:{reasoning:!0,vision:!0,tools:!0}},GPT_5_NANO:{provider:Y9.OPENAI,name:"gpt-5-nano",displayName:"GPT-5 Nano",contextWindow:400000,maxOutputTokens:128000,pricing:{input:0.05,output:0.4,cached:0.005},capabilities:{reasoning:!0,vision:!0,tools:!0}},O3:{provider:Y9.OPENAI,name:"o3",displayName:"o3",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:2,output:8,cached:0.5},capabilities:{reasoning:!0,tools:!0}},O3_MINI:{provider:Y9.OPENAI,name:"o3-mini",displayName:"o3-mini",contextWindow:200000,maxOutputTokens:1e5,pricing:{input:1.1,output:4.4,cached:0.55},capabilities:{reasoning:!0,tools:!0}},GPT_OSS_120B:{provider:Y9.OPENAI,name:"openai/gpt-oss-120b",displayName:"GPT OSS 120B",contextWindow:128000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GROK_CODE_FAST_1:{provider:Y9.XAI,name:"grok-code-fast-1",displayName:"Grok Code Fast 1",contextWindow:256000,maxOutputTokens:32000,capabilities:{reasoning:!0,tools:!0}},GEMINI_2_5_PRO:{provider:Y9.VERTEXAI,name:"gemini-2.5-pro",displayName:"Gemini 2.5 Pro",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH:{provider:Y9.VERTEXAI,name:"gemini-2.5-flash",displayName:"Gemini 2.5 Flash",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_PREVIEW_09_2025:{provider:Y9.VERTEXAI,name:"gemini-2.5-flash-preview-09-2025",displayName:"Gemini 2.5 Flash (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_LITE:{provider:Y9.VERTEXAI,name:"gemini-2.5-flash-lite",displayName:"Gemini 2.5 Flash Lite",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025:{provider:Y9.VERTEXAI,name:"gemini-2.5-flash-lite-preview-09-2025",displayName:"Gemini 2.5 Flash Lite (Preview)",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},GEMINI_3_PRO_PREVIEW:{provider:Y9.VERTEXAI,name:"gemini-3-pro-preview",displayName:"Gemini 3 Pro Preview",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},VERTEXAI_GEMINI3_FLASH:{provider:Y9.VERTEXAI,name:"fiercefalcon",displayName:"Gemini 3 Flash",contextWindow:1048576,maxOutputTokens:65535,capabilities:{tools:!0,reasoning:!0,vision:!0}},Z_AI_GLM_4_6:{provider:Y9.CEREBRAS,name:"zai-glm-4.6",displayName:"Z.ai GLM 4.6",contextWindow:131000,maxOutputTokens:40000,capabilities:{tools:!0}},FIREWORKS_QWEN3_CODER_480B:{provider:Y9.FIREWORKS,name:"accounts/fireworks/models/qwen3-coder-480b-a35b-instruct",displayName:"Qwen3 Coder 480B",contextWindow:230144,maxOutputTokens:32000,capabilities:{tools:!0}},FIREWORKS_KIMI_K2_INSTRUCT:{provider:Y9.FIREWORKS,name:"accounts/fireworks/models/kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:230144,maxOutputTokens:32000,capabilities:{tools:!0}},FIREWORKS_QWEN3_235B:{provider:Y9.FIREWORKS,name:"accounts/fireworks/models/qwen3-235b-a22b-instruct-2507",displayName:"Qwen3 235B",contextWindow:230144,maxOutputTokens:32000,capabilities:{tools:!0}},FIREWORKS_GLM_4P6:{provider:Y9.FIREWORKS,name:"accounts/fireworks/models/glm-4p6",displayName:"GLM 4P6",contextWindow:162752,maxOutputTokens:40000,capabilities:{tools:!0,reasoning:!0}},KIMI_K2_INSTRUCT:{provider:Y9.MOONSHOT,name:"kimi-k2-instruct-0905",displayName:"Kimi K2 Instruct",contextWindow:1e6,maxOutputTokens:32000,capabilities:{tools:!0}},SONOMA_SKY_ALPHA:{provider:Y9.OPENROUTER,name:"sonoma-sky-alpha",displayName:"Sonoma Sky Alpha",contextWindow:256000,maxOutputTokens:32000,capabilities:{tools:!0}},OPENROUTER_GLM_4_6:{provider:Y9.OPENROUTER,name:"z-ai/glm-4.6",displayName:"OpenRouter GLM 4.6",contextWindow:131000,maxOutputTokens:40000,capabilities:{tools:!0}},OPENROUTER_KIMI_K2_0905:{provider:Y9.OPENROUTER,name:"moonshotai/kimi-k2-0905",displayName:"Kimi K2 0905 (OpenRouter)",contextWindow:262144,maxOutputTokens:32000,capabilities:{tools:!0}},OPENROUTER_QWEN3_CODER_480B:{provider:Y9.OPENROUTER,name:"qwen/qwen3-coder",displayName:"Qwen3 Coder 480B (OpenRouter)",contextWindow:262144,maxOutputTokens:32000,capabilities:{tools:!0}},OPENROUTER_QWEN3_235B:{provider:Y9.OPENROUTER,name:"qwen/qwen3-235b-a22b-2507",displayName:"Qwen3 235B A22B (OpenRouter)",contextWindow:262144,maxOutputTokens:32000,capabilities:{tools:!0}}};eW1={FINDER:"finder"}});function JH1(J,Q){let Z=wK(Q);if(!Z)return!1;if(t34.has(J)){let Y=Z.finder??eW1.FINDER,X=e34[Y];if(J!==X)return!1}if(Z.includeTools)return Z.includeTools.includes(J);return!0}function gX(J,Q){let Z=J?.["internal.visibleModes"]??[];return Object.values(uE).filter((Y)=>{if(Z.includes(`!${Y.key}`))return!1;if(Q===!1&&P9(Y.key))return!1;let G="visible"in Y?Y.visible:!1,V=Z.includes(Y.key),K=Y.key==="plan"&&J?.["experimental.planMode"]===!0,q=J?.["experimental.dojoMode"]===!0;if(Y.key==="free-dojo")return q&&(Q===!0||Q===void 0);if(Y.key==="dojo")return q&&(Q===!1||Q===void 0);return G||V||K}).map((Y)=>({mode:Y.key,description:"description"in Y?Y.description:void 0})).sort((Y,X)=>Y.mode.localeCompare(X.mode))}function wK(J){return Object.values(uE).find((Q)=>Q.key===J)}function YM(J){return wK(J)?.primaryModel??K3("CLAUDE_SONNET_4_5")}function ak(J){let Q=wK(J);if(!Q)return!1;return uJ(Q.primaryModel).capabilities?.vision??!1}function P9(J){return J==="free"||J.startsWith("free-")}function QH1(J,Q){return Q.find((Z)=>Z.mode===J)?.description}function ZH1(J,Q){let Y=(Q.findIndex((G)=>G.mode===J)+1)%Q.length;return Q[Y]?.mode??"smart"}var t34,e34,XU0,$U0,J24,Q24,ZU0,Z24,YU0,uE,Y24;var EG=B1(()=>{RQ();t34=new Set(["finder"]),e34={finder:"finder"},XU0={r:0,g:55,b:0},$U0={r:0,g:255,b:136},J24=["Read","Grep","glob","finder","Bash","create_file","edit_file","format_file","get_diagnostics","web_search","read_web_page","todo_read","todo_write","read_thread","find_thread","skill","tool_search","load_tool"],Q24=["Read","Grep","glob","finder","Bash","create_file","edit_file","format_file","undo_edit","get_diagnostics","web_search","read_web_page","read_mcp_resource","mermaid","read_thread","find_thread","skill","oracle","librarian","Task","kraken","look_at","tool_search","load_tool"],ZU0=["Read","Grep","glob","finder","Bash","get_diagnostics","web_search","read_web_page","mermaid","tool_search","load_tool"],Z24=["Read","Grep","glob","finder","librarian","edit_plan","read_plan","read_thread","web_search","read_web_page","tool_search","load_tool"],YU0=["Read","Grep","glob","finder","Bash","create_file","edit_file","format_file","undo_edit","get_diagnostics","web_search","read_web_page","read_mcp_resource","mermaid","todo_read","todo_write","read_thread","find_thread","skill","oracle","painter","librarian","Task","kraken","look_at","code_review","tool_search","load_tool"],uE={SMART:{key:"smart",displayName:"Smart",description:"The most capable model and set of tools",primaryModel:K3("CLAUDE_OPUS_4_5"),includeTools:YU0,visible:!0,uiHints:{labelAnimation:"glow",primaryColor:{r:0,g:55,b:20},secondaryColor:{r:0,g:255,b:136}}},FREE:{key:"free",displayName:"Free",description:"Amp Free",primaryModel:K3("CLAUDE_HAIKU_4_5"),includeTools:J24,visible:!0,uiHints:{primaryColor:{r:0,g:26,b:51},secondaryColor:{r:0,g:184,b:255}}},RUSH:{key:"rush",displayName:"Rush",description:"Faster and cheaper for small, well-defined tasks",primaryModel:K3("CLAUDE_HAIKU_4_5"),includeTools:Q24,visible:!0,uiHints:{fasterAnimation:!0,labelAnimation:"jitter",primaryColor:{r:128,g:51,b:0},secondaryColor:{r:255,g:215,b:0}}},PLAN:{key:"plan",displayName:"Plan",description:"Collaborative planning mode",primaryModel:K3("GPT_5_1_CODEX"),includeTools:Z24,visible:!1,uiHints:{primaryColor:{r:192,g:80,b:192},secondaryColor:{r:64,g:64,b:255}}},LARGE:{key:"large",displayName:"Large",description:"The biggest context window possible (Sonnet 4.5 1M tokens), for large tasks",primaryModel:K3("CLAUDE_SONNET_4_5"),includeTools:YU0,visible:!1,uiHints:{labelAnimation:"glow",primaryColor:{r:42,g:26,b:77},secondaryColor:{r:153,g:102,b:255}}},DOJO_FREE:{key:"free-dojo",displayName:"Dojo (Free)",description:"Learning mode - guides you to discover solutions yourself",primaryModel:K3("CLAUDE_HAIKU_4_5"),includeTools:ZU0,visible:!1,uiHints:{primaryColor:{r:26,g:77,b:46},secondaryColor:{r:212,g:175,b:55}}},DOJO:{key:"dojo",displayName:"Dojo",description:"Learning mode - guides you to discover solutions yourself",primaryModel:K3("CLAUDE_SONNET_4_5"),includeTools:ZU0,visible:!1,uiHints:{primaryColor:{r:26,g:77,b:46},secondaryColor:{r:212,g:175,b:55}}}},Y24=Object.values(uE).map((J)=>J.key)});function Jn(J,Q,Z){if(J.startsWith("mcp__"))return Q.allowMcp??!1;if(J.startsWith("tb__")){if(!(Q.allowToolbox??!1))return!1;let Y="subagentType"in Q?Q.subagentType:void 0;if(Y&&Z){if(!Z.subagentTypes)return!1;return Z.subagentTypes.includes("all")||Z.subagentTypes.includes(Y)}return!0}return Q.includeTools.includes(J)}var X24,$24,YH1,G24,V24,K24,q24,W24,H24,q7,Rf8;var IG=B1(()=>{RQ();X24=["read_github","search_github","commit_search","diff","list_directory_github","list_repositories","glob_github"],$24=["Grep","glob","Read"],YH1=["Read","Grep","glob","web_search","read_web_page","read_thread","find_thread"],G24=["Read","Grep","glob","Bash","edit_file","create_file","format_file","get_diagnostics","web_search","read_web_page","finder"],V24=["Grep","glob","Read","Bash","edit_file","create_file","format_file","read_web_page","get_diagnostics","web_search","finder"],K24=["Read","glob","Grep","enqueue_file_edit","fastmod"],q24=["create_file","edit_file","glob","Read","Grep","format_file","get_diagnostics"],W24=["describe_workbook","execute_query"],H24=["Read","Grep","glob","web_search","read_web_page","Bash"],q7={finder:{key:"finder",displayName:"Finder",model:K3("CLAUDE_HAIKU_4_5"),includeTools:$24,allowMcp:!1,allowToolbox:!1},oracle:{key:"oracle",displayName:"Oracle",model:K3("GPT_5_1"),includeTools:YH1,allowMcp:!1,allowToolbox:!1},painter:{key:"painter",displayName:"Painter",model:K3("GEMINI_3_PRO_PREVIEW"),includeTools:G24,allowMcp:!1,allowToolbox:!1},librarian:{key:"librarian",displayName:"Librarian",model:K3("CLAUDE_HAIKU_4_5"),includeTools:X24,allowMcp:!1,allowToolbox:!1},"task-subagent":{key:"task-subagent",displayName:"Task Subagent",model:void 0,includeTools:V24,allowMcp:!0,allowToolbox:!0},"kraken-scope":{key:"kraken-scope",displayName:"Kraken Scope",model:K3("CLAUDE_HAIKU_4_5"),includeTools:K24,allowMcp:!1,allowToolbox:!0,subagentType:"scope"},"kraken-executor":{key:"kraken-executor",displayName:"Kraken Executor",model:K3("CLAUDE_HAIKU_4_5"),includeTools:q24,allowMcp:!1,allowToolbox:!0,subagentType:"executor"},bookkeeper:{key:"bookkeeper",displayName:"Bookkeeper",model:K3("CLAUDE_HAIKU_4_5"),includeTools:W24,allowMcp:!1,allowToolbox:!1},"code-review":{key:"code-review",displayName:"Code Review",model:K3("CLAUDE_SONNET_4_5"),includeTools:H24,allowMcp:!1,allowToolbox:!1}},Rf8=Object.keys(q7)});function GU0(J,Q){return new t1((Z)=>{let Y=setTimeout(X,Q);function X(){Z.error(Error(`Tool execution timed out after ${Q/1000} seconds`))}function G(){if(Y)clearTimeout(Y);Y=setTimeout(X,Q)}let V=J.subscribe({next:(K)=>{G(),Z.next(K)},error:(K)=>{if(Y)clearTimeout(Y),Y=null;Z.error(K)},complete:()=>{if(Y)clearTimeout(Y),Y=null;Z.complete()}});return()=>{if(Y)clearTimeout(Y),Y=null;V.unsubscribe()}})}var VU0=B1(()=>{i0()});function W7(J,Q){let Z={name:Q.name,description:Q.description,inputSchema:Q.inputSchema,source:Q.source,meta:Q.meta,customizedForModel:!1},Y=Q.modelCustomizations;if(Y){for(let X of Y)if(X.modelSelector.test(J))Z={...Z,name:X.name??Z.name,description:X.description??Z.description,inputSchema:X.inputSchema??Z.inputSchema,customizedForModel:!0}}return Z}function q3(J){return["done","error","rejected-by-user","cancelled"].includes(J.status)}function WU0(J){return["done","error","cancelled"].includes(J.status)}function XH1(J){return typeof J==="object"&&"key"in J}function Qn(J){let Q=[],Z=new g4,Y;function X(V,K){let q=Q.filter((W)=>W.spec.name===V);if(q.length===0){let W=V.toLowerCase();q=Q.filter((H)=>H.spec.name.toLowerCase()===W)}for(let W of q)if(dE(W.spec,K).enabled)return W;return}function G(V,K,q){if(!V)throw Error("spec is required");let W=Q.findIndex((L)=>L.spec.name===V.name),H=W!==-1?Q[W]:void 0;if(V.source!=="builtin"&&H?.spec.source==="builtin")return x.warn("Ignoring external tool registration - builtin takes precedence",{toolName:V.name,externalSource:V.source}),{dispose:()=>{}};let D={spec:V,fn:Promise.resolve(K),preprocessArgs:q};if(H&&JSON.stringify(H.spec.source)===JSON.stringify(V.source))Q[W]=D;else Q.push(D);return Z.next(),{dispose:()=>{let L=Q.indexOf(D);if(L!==-1)Q.splice(L,1),Z.next()}}}return J.configService.config.subscribe((V)=>{Y=V}),{registerTool({spec:V,fn:K,preprocessArgs:q}){if(!K)return z24;return G(V,K,q)},tools:y8(J.configService.config,Z.pipe(L8(void 0))).pipe(Q6(([V])=>{return Q.map((K)=>({spec:K.spec,...dE(K.spec,V)})).sort((K,q)=>K.spec.name.localeCompare(q.spec.name))})),invokeTool(V,K,q){let W=performance.now(),H=()=>F24.record(performance.now()-W,{toolName:V});if(V===GH1&&K.args&&"invalid_tool_name"in K.args&&typeof K.args.invalid_tool_name==="string"){pE.add(1,{toolName:V,error:"invalid"});let D=$H1(K.args.invalid_tool_name);return new t1((M)=>{M.error(Error(D))})}let z=X(V,q.config);if(!z){let D=V.toLowerCase(),M=Q.filter((I)=>I.spec.name.toLowerCase()===D);if(M.length===0)return pE.add(1,{toolName:V,error:"not_found"}),new t1((I)=>{I.error(Error(`tool ${JSON.stringify(V)} not found`))});let L=M[0],A=dE(L.spec,q.config);pE.add(1,{toolName:V,error:"disabled"});let E=A.enabled?"unknown":A.disabledReason;return new t1((I)=>{I.error(Error(`tool ${JSON.stringify(V)} is disabled: ${E}`))})}let U=q.subagentSpec??q.agentMode;if(U&&!this.isToolAllowed(V,U)){pE.add(1,{toolName:V,error:"disabled"});let D=XH1(U)?U.displayName??U.key:`${U} mode`;return new t1((M)=>{M.error(Error(`tool ${JSON.stringify(V)} is not allowed for ${D}`))})}if(q.thread.mainThreadID&&!q.subagentSpec&&!Jn(V,q7["task-subagent"]))return pE.add(1,{toolName:V,error:"disabled"}),new t1((D)=>{D.error(Error(`tool ${JSON.stringify(V)} is not allowed for subagents`))});return pE.add(1,{toolName:V}),x6(()=>z.fn).pipe(B4((D)=>{let M=D(K,q);if(z.spec.meta?.disableTimeout)return M;return GU0(M,eF0(q.config))}),LG(()=>H()))},preprocessArgs(V,K,q){let W=X(V,q.config);if(!W||!W.preprocessArgs)return;let H=W.preprocessArgs;try{return H(K,q)}catch(z){x.error("preprocessArgs",{id:V,args:K,error:String(z)});return}},isToolAllowed(V,K){let q=Q.find((H)=>H.spec.name===V),W=q?.spec.source;if(typeof W==="object"&&(("mcp"in W)||("toolbox"in W)))return!0;if(XH1(K))return Jn(V,K,q?.spec.meta);return JH1(V,K)},getTools(V){return y8(J.configService.config,Z.pipe(L8(void 0))).pipe(Q6(([K])=>{return Q.filter((q)=>{if(XH1(V))return Jn(q.spec.name,V,q.spec.meta);let W=q.spec.source;if(typeof W==="object"&&(("mcp"in W)||("toolbox"in W)))return!0;return JH1(q.spec.name,V)}).map((q)=>({spec:q.spec,...dE(q.spec,K)})).sort((q,W)=>q.spec.name.localeCompare(W.spec.name))}))},getToolsForMode(V,K){if(K)return this.getTools(q7["task-subagent"]);return this.getTools(V)},getExecutionProfile(V){if(!Y)return;return X(V,Y)?.spec.executionProfile},dispose(){}}}function ok(J,Q){for(let Z of Q){if(Z==="")continue;if(Z.length===1){if(Z==="*")return!0;if(Z===J)return!0;continue}if(J===Z)return!0;if(Z.includes("*")||Z.includes("?")||Z.includes("[")||Z.includes("{"))try{if(qU0.default(Z,{dot:!0})(J))return!0}catch(Y){continue}}return!1}function dE(J,Q){let Z=Q.settings?.["tools.disable"]??[];if(ok(J.name,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"mcp"in J.source){let Y=U24(J.name);if(Y){if(J.source.mcp.replace(/[\s-]+/g,"_")===Y.server){if(ok(Y.tool,Z))return{enabled:!1,disabledReason:"settings"};let G=`mcp__${J.source.mcp}__${Y.tool}`;if(ok(G,Z))return{enabled:!1,disabledReason:"settings"}}}}if(J.source==="builtin"&&ok(`builtin:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(typeof J.source==="object"&&"toolbox"in J.source&&ok(`toolbox:${J.name}`,Z))return{enabled:!1,disabledReason:"settings"};if(J.name===t5||J.name===AK){if(Q.settings?.["todos.enabled"])return{enabled:!0};return{enabled:!1,disabledReason:"feature-flag"}}return{enabled:!0}}function $H1(J){return`Invalid tool name ${JSON.stringify(J)}. Tool names must match the pattern ${rk.toString()}. Try again with a valid tool name.`}function U24(J){let[,Q,Z]=J.split(/mcp__([^ ]+)__([^ ]+)/);if(Q&&Z)return{server:Q,tool:Z};return}function Zn(J){return J.filter((Q)=>Q.source==="builtin")}function VH1(J){if(J.status==="in-progress"||J.status==="done"||J.status==="cancelled"||J.status==="error")return J.progress;return}var KU0,qU0,z24,GH1="invalid_tool",rk,HU0,pE,F24;var H7=B1(()=>{i0();U0();ei();EG();IG();VU0();W4();KU0=q6(m6(),1),qU0=q6(fW(),1);z24={dispose(){}};rk=/^[-a-zA-Z0-9_]{1,64}$/,HU0=KU0.metrics.getMeter("tool_service"),pE=HU0.createCounter("tool_service.invocation_count",{description:"Number of tool invocations"}),F24=HU0.createHistogram("tool_service.invocation_latency",{description:"Latency of tool invocations",unit:"ms"})});var DU0=h((BU0)=>{Object.defineProperty(BU0,"__esModule",{value:!0});BU0.calcSlices=BU0.applyPatch=BU0.calcPatch=BU0.lcs=BU0.diff=BU0.diff_core=void 0;function B24(J,Q){let{b:Z,eq:Y,stack_base:X}=J,{i:G,N:V,j:K,M:q,Z:W,stack_top:H}=J;for(;;)switch(Q){case 0:{J:while(V>0&&q>0){Z.fill(0,0,2*W);let z=V-q,U=V+q,D=U&1,M=G+V-1,L=K+q-1,A=(U+D)/2,E;Q:for(let I=0;I<=A;I++){let P=2*Math.max(0,I-q)-I,R=I-2*Math.max(0,I-V);for(let y=P;y<=R;y+=2){let k=Z[y-1-W*Math.floor((y-1)/W)],v=Z[y+1-W*Math.floor((y+1)/W)],g=y===-I||y!==I&&k<v?v:k+1,d=g-y,b=g,a=d;while(b<V&&a<q&&Y(G+b,K+a))b++,a++;if(Z[y-W*Math.floor(y/W)]=b,D===1&&(E=z-y)>=1-I&&E<I&&b+Z[W+E-W*Math.floor(E/W)]>=V)if(I>1||b!==g){X[H++]=G+b,X[H++]=V-b,X[H++]=K+a,X[H++]=q-a,V=g,q=d,W=2*(Math.min(V,q)+1);continue J}else break Q}for(let y=P;y<=R;y+=2){let k=Z[W+y-1-W*Math.floor((y-1)/W)],v=Z[W+y+1-W*Math.floor((y+1)/W)],g=y===-I||y!==I&&k<v?v:k+1,d=g-y,b=g,a=d;while(b<V&&a<q&&Y(M-b,L-a))b++,a++;if(Z[W+y-W*Math.floor(y/W)]=b,D===0&&(E=z-y)>=-I&&E<=I&&b+Z[E-W*Math.floor(E/W)]>=V)if(I>0||b!==g){X[H++]=G+V-g,X[H++]=g,X[H++]=K+q-d,X[H++]=d,V=V-b,q=q-a,W=2*(Math.min(V,q)+1);continue J}else break Q}}if(V===q)continue;if(q>V)G+=V,K+=V,q-=V,V=0;else G+=q,K+=q,V-=q,q=0;break}if(V+q!==0)if(J.pxe===G||J.pye===K)J.pxe=G+V,J.pye=K+q;else{let z=J.pxs;if(J.oxs=J.pxs,J.oxe=J.pxe,J.oys=J.pys,J.oye=J.pye,J.pxs=G,J.pxe=G+V,J.pys=K,J.pye=K+q,z>=0)return J.i=G,J.N=V,J.j=K,J.M=q,J.Z=W,J.stack_top=H,1}}case 1:{if(H===0)return 2;q=X[--H],K=X[--H],V=X[--H],G=X[--H],W=2*(Math.min(V,q)+1),Q=0}}}class zU0{constructor(J){this.state=J,this.c=0,this.result={value:null,done:!1}}[Symbol.iterator](){return this}next(){let{state:J,result:Q}=this;if(this.c>1)return Q.done=!0,Q.value=void 0,Q;let Z=B24(J,this.c);if(this.c=Z,Z===1)return Q.value=[J.oxs,J.oxe,J.oys,J.oye],Q;if(J.pxs>=0)return Q.value=[J.pxs,J.pxe,J.pys,J.pye],Q;return Q.done=!0,Q.value=void 0,Q}}function FU0(J,Q,Z,Y,X){let G=(Math.min(Q,Y)+1)*2,V=Q+Y,K=new(V<256?Uint8Array:V<65536?Uint16Array:Uint32Array)(2*G);return new zU0({i:J,N:Q,j:Z,M:Y,Z:G,b:K,eq:X,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}BU0.diff_core=FU0;function Yn(J,Q,Z){let[Y,X,G]=[0,J.length,Q.length];if(typeof Z==="function"){while(Y<X&&Y<G&&Z(Y,Y))Y++;if(Y===X&&Y===G)return[][Symbol.iterator]();while(Z(--X,--G)&&X>Y&&G>Y);}else{while(Y<X&&Y<G&&J[Y]===Q[Y])Y++;if(Y===X&&Y===G)return[][Symbol.iterator]();while(J[--X]===Q[--G]&&X>Y&&G>Y);Z=(V,K)=>J[V]===Q[K]}return FU0(Y,X+1-Y,Y,G+1-Y,Z)}BU0.diff=Yn;class UU0{constructor(J,Q){this.diff=J,this.N=Q,this.i=0,this.j=0}[Symbol.iterator](){return this}next(){let J=this.diff.next();if(J.done){let{i:K,j:q,N:W}=this;if(K<W)J.done=!1,J.value=[K,q,W-K],this.i=W;return J}let Q=J.value,Z=Q[0],Y=Q[1],X=Q[3],{i:G,j:V}=this;if(G!==Z)Q.length--,Q[0]=G,Q[1]=V,Q[2]=Z-G;return this.i=Y,this.j=X,J}}function N24(J,Q,Z){return new UU0(Yn(J,Q,Z),J.length)}BU0.lcs=N24;function*D24(J,Q,Z){let Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let X of Yn(J,Q,Z))X[2]=Y.call(Q,X[2],X[3]),yield X}BU0.calcPatch=D24;function*M24(J,Q){let Z=0,Y=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[X,G,V]of Q){if(Z<X)yield Y.call(J,Z,X);if(V.length>0)yield V;Z=G}if(Z<J.length)yield Y.call(J,Z)}BU0.applyPatch=M24;function*L24(J,Q,Z){let Y=0,X=ArrayBuffer.isView(J)?Uint8Array.prototype.subarray:J.slice;for(let[G,V,K,q]of Yn(J,Q,Z)){if(Y<G)yield[0,X.call(J,Y,G)];if(G<V)yield[-1,X.call(J,G,V)];if(K<q)yield[1,X.call(Q,K,q)];Y=V}if(Y<J.length)yield[0,J.slice(Y)]}BU0.calcSlices=L24});function cE(J,Q){let Z={added:0,deleted:0,changed:0};if(typeof J!=="string"||typeof Q!=="string")return Z;if(J===Q)return Z;try{let Y={added:0,deleted:0,changed:0};for(let[X,G,V,K]of MU0.diff(J.split(`
|
|
71
71
|
`),Q.split(`
|
|
72
72
|
`)))Y.deleted+=G-X,Y.added+=K-V,Y.changed+=Math.min(G-X,K-V);return Y}catch{return Z}}function LU0(J){if(typeof J!=="string")return{added:0,deleted:0,changed:0};return{added:J.split(`
|
|
73
73
|
`).length,deleted:0,changed:0}}function KH1(J){if(!J)return{totalFiles:0,createdFiles:0,totalAdded:0,totalRemoved:0,totalModified:0,revertedFiles:0,allReverted:!1};let Q=J.files.length,Z=J.files.filter((q)=>q.created).length,Y=J.files.filter((q)=>q.reverted).length,X=Y===Q&&Q>0,G=0,V=0,K=0;for(let q of J.files){if(q.reverted)continue;G+=q.diffStat.added,V+=q.diffStat.removed,K+=q.diffStat.modified}return{totalFiles:Q,createdFiles:Z,totalAdded:G,totalRemoved:V,totalModified:K,revertedFiles:Y,allReverted:X}}var MU0;var sk=B1(()=>{MU0=q6(DU0(),1)});function PG(){return`T-${mW1()}`}function uX(J){if(!J.startsWith("T-"))return!1;let Q=J.slice(2);return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(Q)}function hW(){return`toolu_${crypto.randomUUID()}`}function lE(J,Q,Z=hW()){return{type:"tool_use",complete:!0,id:Z,name:J,input:Q}}function W3(J){if("complete"in J)return J.complete;return!("inputPartialJSON"in J)}function tk(J){return J.role==="user"&&J.source?.type==="course-correction"}function Xn(J){for(let Q=J.messages.length-1;Q>=0;Q--){let Z=J.messages[Q];if(Z?.role==="info"){let Y=Z.content[0];if(Y?.type==="summary"&&Y?.summary.type==="message")return}if(Z?.role==="assistant"&&Z.usage){if(Z.usage.totalInputTokens===0)continue;return Z.usage}}return J["~debug"]?.lastInferenceUsage}function MY(J,Q){for(let Z of J.messages){if(Z.role!=="assistant")continue;for(let Y of Z.content)if(Y.type==="tool_use"&&Y.id===Q)return Y}return}function iE(J,Q){for(let[Z,Y]of J.messages.entries()){if(Y.role!=="assistant")continue;for(let[X,G]of Y.content.entries())if(G.type==="tool_use"&&G.id===Q)return{message:Y,messageIndex:Z,block:G,blockIndex:X}}return null}function bW(J,Q){for(let Z of J.messages){if(Z.role!=="user")continue;for(let Y of Z.content)if(Y.type==="tool_result"&&Y.toolUseID===Q)return Y}return}function pJ(J){return J.messages.filter((Q)=>Q.role==="user").flatMap((Q)=>Q.content).filter((Q)=>Q.type==="tool_result").reduce((Q,Z)=>{return Q.set(Z.toolUseID,Z),Q},new Map)}function qH1(J){if(J&&typeof J==="object"&&"threadID"in J){let Q=J.threadID;if(typeof Q==="string"&&uX(Q))return Q}return}function WH1(J){let Q=[],Z=new Map;for(let Y of J)if(Y.role==="assistant"){for(let X of Y.content)if(X.type==="tool_use"&&X.name===A2)Z.set(X.id,X)}else if(Y.role==="user"){for(let X of Y.content)if(X.type==="tool_result"){let G=Z.get(X.toolUseID);if(G){let V=X.run,K=(V.status==="in-progress"||V.status==="cancelled"||V.status==="done"||V.status==="error")&&V.progress?qH1(V.progress):void 0;if(K)Q.push({toolUseID:X.toolUseID,threadID:K,toolUse:G,toolResult:X})}}}return Q}function AU0(J,Q="Untitled"){if(J.title)return mi(J.title,300);return Q}function OU0(J){if(!J)return!1;if(J.role==="assistant")return J.state?.type==="cancelled";if(J.role==="user")return J.content.some((Q)=>Q.type==="tool_result"&&Q.run.status==="cancelled");return!1}function $n(J){if(!J)return!1;if(J.role==="user")return J.content.some((Q)=>Q.type==="tool_result"&&Q.run.status==="rejected-by-user");return!1}function HH1(J){if(!J)return!1;return J.role==="info"}function nE(J){return J.role==="info"&&J.content.some((Q)=>Q.type==="manual_bash_invocation")}function Gn(J){if(J.role!=="info")return;return J.content.find((Q)=>Q.type==="manual_bash_invocation")}function P24(J){return J.replace(/u([0-9A-Fa-f]{4})(\s)/gi,(Q,Z,Y)=>{try{return String.fromCodePoint(parseInt(Z,16))+Y}catch{return`u${Z}${Y}`}})}function aE(J){for(let Q=J.messages.length-1;Q>=0;Q--){let Z=J.messages[Q];if(Z?.role==="info"){if(Z.content.some((X)=>X.type==="summary"&&X.summary.type==="message"))break}if(Z?.role!=="assistant"||!Z.state||Z.state.type!=="complete"||Z.state.stopReason!=="tool_use")continue;for(let Y of Z.content)if(Y.type==="tool_use"&&Y.name===t5&&Y.input){let X=Y.input.todos;if(Array.isArray(X))return X;let G=Y.input.content;if(typeof G==="string")return P24(G)}}return}function h7(J){return J.map((Q)=>Q.type==="text"?Q.text:null).filter((Q)=>Q!==null).join(`
|
|
@@ -4040,7 +4040,7 @@ ${z38("\t",b??"(unknown)")}
|
|
|
4040
4040
|
`).length-1});throw new R8(`Invalid JSON in settings file ${Q}`,1,`Fix the JSON syntax errors. Errors found on lines [${g.join(", ")}].`)}x.debug("readSettings",{settingsPath:Q,rawConfig:k});let v={};for(let[g,d]of Object.entries(k))if(g.startsWith("amp.")){let b=g.substring(4);v[b]=d}return K=v,v}catch(R){if(R.code==="ENOENT")return K={},K;throw x.error(`Failed to read settings: ${R}`),R}}async function M(P){await C61.acquire();try{await U(),await Em(Q,(R)=>{let y=R;for(let[k,v]of Object.entries(P)){let g=M$1(y,[`amp.${k}`],v,{formattingOptions:{tabSize:2,insertSpaces:!0}});if(g.length>0)y=L$1(y,g)}return{newContent:y}}),K=P}catch(R){throw x.error(`Failed to write settings: ${R}`),R}finally{C61.release()}}function L(){if(H)return;if(process.versions.bun){try{z=Y(Q,(P,R)=>{x.debug("Settings file change detected (fallback watcher)",{settingsPath:Q,curr:P,prev:R}),A()}),H=!0,x.debug("Started watching settings file with fallback watcher (Bun)",{settingsPath:Q})}catch(P){x.error("Failed to start fallback file watcher",{settingsPath:Q,error:P})}return}try{let P=aY.dirname(Q),R=aY.basename(Q);q=Z(P,(y,k)=>{if(k!==R)return;x.debug("Settings file change detected",{eventType:y,filename:k,settingsPath:Q}),A()}),q.on("error",(y)=>{x.debug("transient file watcher error",{error:y}),A()}),x.debug("Started watching settings directory",{dir:P,targetFilename:R})}catch(P){if(P.code==="ENOENT"){if(!z)z=Y(Q,(R,y)=>{if(R.ino===0)return;x.debug("Settings file created, starting file watcher",{settingsPath:Q}),L(),z?.close(),z=void 0})}else x.warn("Failed to start watching settings directory",{settingsPath:Q,error:P})}H=!0}function A(){if(W)clearTimeout(W);W=setTimeout(E,X)}async function E(){try{let P=K;K=void 0,await new Promise((k)=>setTimeout(k,G));let R=await D(!0),y=h16(P,R);if(y.length>0)K=void 0,V.next(y),x.info("Settings reloaded",{changedKeys:y})}catch(P){x.warn("Failed to handle settings file change",{settingsPath:Q,error:P})}}function I(){if(q)q.close(),q=void 0;if(z)z.close(),z=void 0;if(W)clearTimeout(W),W=void 0;H=!1,x.debug("Stopped watching settings directory",{settingsPath:Q})}return{async get(P){return(await D())[P]},async set(P,R,y){let k=await D();k[P]=R,await M(k),V.next([P])},async delete(P,R){await C61.acquire();try{await Em(Q,(k)=>{let v=`amp.${P}`,g=M$1(k,[v],void 0,{formattingOptions:{tabSize:2,insertSpaces:!0}});return{newContent:g.length>0?L$1(k,g):k}});let y=await D();delete y[P],K=y,V.next([P])}catch(y){throw x.error(`Failed to delete setting: ${y}`),y}finally{C61.release()}},async keys(){let P=await D();return Object.keys(P)},getSettingsFilePath(){return Q},changes:V,[Symbol.dispose](){I()}}}async function d38(J){let Q=await f16(J.settingsFile??P$,P$),Z=await b16({...J,settingsFile:Q});return{...Z,async set(Y,X){return gR(Y,"global"),Z.set(Y,X)},async delete(Y){return gR(Y,"global"),Z.delete(Y)}}}async function c38(J){let{workspaceRootPath:Q,workspaceSettingsPath:Z}=await g38(J.cwd),Y=await b16({...J,settingsFile:Z}),X=new g4,G=Y.changes.subscribe((q)=>X.next(q)),V=J.workspaceTrust?.current??!1,K=J.workspaceTrust?.changes?.subscribe(async(q)=>{let W=V;if(V=q,!W&&q){let z=(await Y.keys()).filter((U)=>Vn.includes(U));if(z.length>0)X.next(z)}});return{...Y,changes:X,getWorkspaceRootPath(){return Q},async get(q){if(!V&&Vn.includes(q))return;return Y.get(q)},async set(q,W){return gR(q,"workspace"),Y.set(q,W)},async delete(q){return gR(q,"workspace"),Y.delete(q)},async keys(){let q=await Y.keys();if(!V)return q.filter((W)=>!Vn.includes(W));return q},[Symbol.dispose](){G.unsubscribe(),K?.unsubscribe(),Y[Symbol.dispose]()}}}async function m16(J){let Q=J.getHook,Z=new g4,Y=await d38(J),X=await c38({...J,cwd:J.cwd||process.cwd()});x.info("Using settings file",{settingsPath:Y.getSettingsFilePath(),workspaceSettingsPath:X.getSettingsFilePath(),workspaceRootPath:X.getWorkspaceRootPath()});let G=Y.changes.subscribe((K)=>Z.next(K)),V=X.changes.subscribe((K)=>Z.next(K));return{async get(K,q){let W=async()=>{switch(q){case"global":return Y.get(K);case"workspace":return X.get(K);case"admin":throw Error("Cannot get admin settings from file storage");case void 0:break}let[H,z]=await Promise.all([Y.get(K),X.get(K)]);return k16(K,{global:H,workspace:z})};return Q?Q(K,W):W()},async set(K,q,W="workspace"){switch(gR(K,W),W){case"workspace":await X.set(K,q);break;case"global":await Y.set(K,q);break;default:}Z.next([K])},async delete(K,q="workspace"){switch(gR(K,q),q){case"workspace":await X.delete(K);break;case"global":await Y.delete(K);break;default:}Z.next([K])},async keys(){let K=await Y.keys(),q=await X.keys(),W=new Set([...K,...q]);return Array.from(W)},getSettingsFilePath(){return Y.getSettingsFilePath()},getWorkspaceRootPath(){return X.getWorkspaceRootPath()},getWorkspaceSettingsPath(){return X.getSettingsFilePath()},changes:Z,[Symbol.dispose](){G.unsubscribe(),V.unsubscribe(),Y[Symbol.dispose](),X[Symbol.dispose]()}}}U0();OF();import l38,{promises as j61}from"node:fs";import i38 from"node:path";import{stderr as g16,stdout as n38}from"node:process";i0();var a38="secrets.json";function u16(J){return i38.join(J.dataDir,a38)}function p16(J){let Q=new BK(x).scoped("secrets.file"),Z=new g4,Y,X=u16(J),G=new gG;async function V(){try{await j61.mkdir(J.dataDir,{recursive:!0})}catch(W){throw Q.error(`Failed to create data directory: ${W}`),W}}async function K(){if(Y)return Y;try{await V();let W=await j61.readFile(X,"utf-8");return Y=JSON.parse(W),Y}catch(W){if(W.code==="ENOENT")return Y={},Y;throw Q.error("Failed to read secrets",{secretsPath:X,error:W}),W}}async function q(W){await G.acquire();try{await V(),await Em(X,()=>({newContent:JSON.stringify(W,null,2)})),Y=W}catch(H){throw Q.error("Failed to write secrets",{secretsPath:X,error:H}),H}finally{G.release()}}return{async get(W,H){let z=await K(),U=DE(H);return z[`${W}@${U}`]},async set(W,H,z){let U=DE(z),D=`${W}@${U}`,M=await K();M[D]=H,await q(M),Z.next(D)},changes:Z}}async function d16(J,Q){let Z=new BK(x).scoped("secrets.file.migrate"),Y=u16(J);if(!l38.existsSync(Y))return;let X=await j61.readFile(Y,"utf-8"),G=JSON.parse(X);if(Object.keys(G).length===0)return;if(!J.quiet)n38.write(`Migrating secrets from file storage to native secret storage...
|
|
4041
4041
|
`);let V=[];for(let[K,q]of Object.entries(G))if(typeof q==="string"){let W=K.match(/^(.+)@(.+)$/);if(W){let[,H,z]=W;if(H&&z)try{await Q.set(H,q,z),V.push(K),Z.debug(`Successfully migrated secret: ${K}`)}catch(U){throw g16.write(`Failed to migrate secret ${K} to native secret storage
|
|
4042
4042
|
`),U}}}if(V.length>0)try{await j61.rm(Y),Z.info("Successfully migrated secrets and removed file storage",{migratedKeys:V,removed:Y})}catch(K){throw g16.write(`Failed to remove file storage after migration
|
|
4043
|
-
`),K}}U0();OF();i0();async function c16(){let J=new BK(x).scoped("secrets.native"),Q=new g4,Z={},Y=(await import("@napi-rs/keyring")).Entry;async function X(G,V){let K;try{K=new URL(V).hostname}catch{K=V}return new Y(`amp.cli.${G}`,K)}return{async get(G,V){let K=DE(V),q=`${G}@${K}`;if(q in Z)return Z[q];let W=await X(G,K);try{let z=W.getPassword()||void 0;return Z[q]=z,z}catch(H){J.warn("failed to get secret",{name:G,url:V,error:H}),Z[q]=void 0;return}},async set(G,V,K){let q=DE(K),W=await X(G,q);if(V)W.setPassword(V);else W.deleteCredential();let H=`${G}@${q}`;Z[H]=V,Q.next(H)},changes:Q}}async function QC1(J,Q){let Z={dataDir:J.dataDir||v16};if(!await Q.get("experimental.cli.nativeSecretsStorage.enabled","global"))return x.info("using file-based secrets storage",Z),p16(Z);x.info("using native secrets storage");let Y;try{Y=await c16()}catch(X){throw x.error("failed to initialize native secrets storage",{error:X,platform:process.platform}),Error("Native secret storage is not supported on this machine")}return await d16(Z,Y),Y}async function l16(J){return m16(J)}var i16={url:{value:"https://ampcode.com",visible:!1,description:"The Amp server URL to connect to"},"anthropic.thinking.enabled":{value:!1,visible:!1,description:"Enable Claude thinking process output for debugging"},"anthropic.interleavedThinking.enabled":{value:!1,visible:!1,description:"Enable interleaved thinking for Claude 4 models (allows reasoning between tool calls)"},"anthropic.temperature":{value:1,visible:!1,description:"Temperature setting for Anthropic models (0.0 = deterministic, 1.0 = creative). Note: Only takes effect when thinking is disabled. Internal use only."},"anthropic.toolSearchTool.enabled":{value:!1,visible:!1,description:"Enable Tool Search Tool for Opus 4.5, allowing on-demand tool discovery instead of loading all tool definitions upfront."},"gemini.thinkingLevel":{value:void 0,visible:!1,description:"Thinking level for Gemini models (minimal, low, medium, high, or undefined)"},"notifications.enabled":{value:!0,visible:!0,description:"Enable system sound notifications when agent completes tasks"},"notifications.system.enabled":{value:!0,visible:!0,description:"Enable system notifications when terminal is not focused"},"todos.enabled":{value:!0,visible:!1,description:"Enable TODO tracking and management features"},"agent.skipTitleGenerationIfMessageContains":{value:[],visible:!1,description:"List of strings that, if present in a message, will skip title generation"},mcpServers:{value:{filesystem:{command:"npx",args:["@modelcontextprotocol/server-filesystem","/path/to/allowed/dir"]}},visible:!0,description:"Model Context Protocol servers to connect to for additional tools"},"tools.disable":{value:["browser_navigate","builtin:edit_file"],visible:!0,description:"Array of tool names to disable. Use 'builtin:toolname' to disable only the builtin tool with that name (allowing an MCP server to provide a tool by that name)."},"tools.inactivityTimeout":{value:300,visible:!1,description:"How many seconds of no output to wait before canceling bash commands"},"tools.stopTimeout":{value:300,visible:!1,description:"Timeout for stopping tools"},permissions:{value:[{tool:"Bash",action:"ask",matches:{cmd:["git push*","git commit*"]}}],visible:!0,description:"Permission rules for tool calls. See amp permissions --help"},"guardedFiles.allowlist":{value:[],visible:!0,description:"Array of file glob patterns that are allowed to be accessed without confirmation. Takes precedence over the built-in denylist."},dangerouslyAllowAll:{value:!1,visible:!0,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},submitOnEnter:{value:!0,visible:!1,description:"Whether to submit messages on Enter (true) or require Ctrl+Enter (false)"},"terminal.commands.nodeSpawn.loadProfile":{value:"daily",visible:!1,description:"How often to load shell profile in node-spawn mode (always, daily, never)"},"terminal.animation":{value:!0,visible:!1,description:"Enable terminal animations"},"tab.enabled":{value:!0,visible:!1,description:"Enable tab completion features"},"tab.clipboard.enabled":{value:!0,visible:!1,description:"Enable clipboard access for Amp Tab context"},"tab.disabledLanguages":{value:[],visible:!1,description:"List of language IDs for which tab completion is disabled"},"tab.disableOnComment":{value:!1,visible:!1,description:"Disable tab completion on comment lines"},"tab.autoImport.enabled":{value:!1,visible:!1,description:"Enable auto-import feature for tab completion"},"tab.experimental.unobtrusiveDiffs":{value:!1,visible:!1,description:"Experimental: Enable unobtrusive diffs mode for tab suggestions to avoid layout shifts"},"tab.experimental.showHotStreakProgress":{value:!1,visible:!1,description:"Experimental: Show hot streak progress in tab suggestions"},"tab.experimental.autoAccept.delayMs":{value:0,visible:!1,description:"Experimental: Delay in milliseconds before auto-accepting tab suggestions"},"tab.experimental.disableClientFilters":{value:[],visible:!1,description:"Experimental: Disable specific client-side filters to observe unfiltered model behavior."},"tab.diagnosticTracking":{value:"multi_file",visible:!1,description:'Enable diagnostic tracking for tab suggestions. Values: "disabled" | "same_file" | "multi_file"'},"tab.hoverDiagnosticSuggestions":{value:!1,visible:!1,description:"Enable hover diagnostics for Tab suggestions"},"tab.experimental.displayMode":{value:"eager",visible:!1,description:'Control how tab suggestions are displayed. "eager" = show diff immediately, "subtle" = show "Tab to Jump" first.'},"tab.dismissCommandIds":{value:["extension.vim_escape","vim.escape","vscode-neovim.escape","vscode-neovim.escapeKey"],visible:!1,description:"Command IDs to execute when escape key is pressed in modal editors"},"tab.verboseLogs":{value:!1,visible:!1,description:"Enable verbose logging for tab completion"},debugLogs:{value:!1,visible:!1,description:"Enable debug logging output"},"guidanceFiles.specs":{value:!1,visible:!1,description:"[Experimental] Read `*.spec.md` files adjacent to `AGENT.md` files that are read"},"security.audit.logMcpConnections":{value:!1,visible:!1,description:"Enable telemetry logging for remote MCP server connections (for security auditing)"},hooks:{value:[],visible:!1,description:"Custom hooks for extending Amp functionality"},"experimental.bookkeeper":{value:!1,visible:!1,description:"Enable the Bookkeeper subagent for reading and querying Excel workbooks (.xlsx)"},"experimental.courseCorrection.enabled":{value:!1,visible:!1,description:"Enable the course correction agent that monitors progress and provides guidance when the main agent diverges from the plan"},"experimental.dojoMode":{value:!1,visible:!1,description:"Enable dojo mode - a learning mode that guides you to discover solutions yourself"},"anthropic.provider":{value:"anthropic",visible:!1,description:'Which provider to use for Anthropic Claude inference: "anthropic" or "vertex"'},"experimental.cli.nativeSecretsStorage.enabled":{value:!1,visible:!1,description:"Use native secret storage instead of the plain-text secrets configuration file"},"experimental.tools":{value:[],visible:!1,description:"Enable experimental tools by name. Available tools: kraken"},"fuzzy.alwaysIncludePaths":{value:[],visible:!0,description:"Glob patterns for paths that should always be included in fuzzy file search, even if gitignored"},"toolbox.path":{value:void 0,visible:!0,description:"Path to the directory containing toolbox scripts. Supports colon-separated paths."},"git.commit.coauthor.enabled":{value:!0,visible:!0,description:"Enable adding Amp as co-author in git commits"},"git.commit.ampThread.enabled":{value:!0,visible:!0,description:"Enable adding Amp-Thread trailer in git commits"},"jetbrains.skipInstall":{value:!1,visible:!1,description:"Skip JetBrains plugin installation"},proxy:{value:void 0,visible:!0,description:"Proxy URL used for both HTTP and HTTPS requests to the Amp server"},"updates.mode":{value:"auto",visible:!0,description:'Control update checking behavior: "warn" shows update notifications, "disabled" turns off checking, "auto" automatically runs update.'},showCosts:{value:!
|
|
4043
|
+
`),K}}U0();OF();i0();async function c16(){let J=new BK(x).scoped("secrets.native"),Q=new g4,Z={},Y=(await import("@napi-rs/keyring")).Entry;async function X(G,V){let K;try{K=new URL(V).hostname}catch{K=V}return new Y(`amp.cli.${G}`,K)}return{async get(G,V){let K=DE(V),q=`${G}@${K}`;if(q in Z)return Z[q];let W=await X(G,K);try{let z=W.getPassword()||void 0;return Z[q]=z,z}catch(H){J.warn("failed to get secret",{name:G,url:V,error:H}),Z[q]=void 0;return}},async set(G,V,K){let q=DE(K),W=await X(G,q);if(V)W.setPassword(V);else W.deleteCredential();let H=`${G}@${q}`;Z[H]=V,Q.next(H)},changes:Q}}async function QC1(J,Q){let Z={dataDir:J.dataDir||v16};if(!await Q.get("experimental.cli.nativeSecretsStorage.enabled","global"))return x.info("using file-based secrets storage",Z),p16(Z);x.info("using native secrets storage");let Y;try{Y=await c16()}catch(X){throw x.error("failed to initialize native secrets storage",{error:X,platform:process.platform}),Error("Native secret storage is not supported on this machine")}return await d16(Z,Y),Y}async function l16(J){return m16(J)}var i16={url:{value:"https://ampcode.com",visible:!1,description:"The Amp server URL to connect to"},"anthropic.thinking.enabled":{value:!1,visible:!1,description:"Enable Claude thinking process output for debugging"},"anthropic.interleavedThinking.enabled":{value:!1,visible:!1,description:"Enable interleaved thinking for Claude 4 models (allows reasoning between tool calls)"},"anthropic.temperature":{value:1,visible:!1,description:"Temperature setting for Anthropic models (0.0 = deterministic, 1.0 = creative). Note: Only takes effect when thinking is disabled. Internal use only."},"anthropic.toolSearchTool.enabled":{value:!1,visible:!1,description:"Enable Tool Search Tool for Opus 4.5, allowing on-demand tool discovery instead of loading all tool definitions upfront."},"gemini.thinkingLevel":{value:void 0,visible:!1,description:"Thinking level for Gemini models (minimal, low, medium, high, or undefined)"},"notifications.enabled":{value:!0,visible:!0,description:"Enable system sound notifications when agent completes tasks"},"notifications.system.enabled":{value:!0,visible:!0,description:"Enable system notifications when terminal is not focused"},"todos.enabled":{value:!0,visible:!1,description:"Enable TODO tracking and management features"},"agent.skipTitleGenerationIfMessageContains":{value:[],visible:!1,description:"List of strings that, if present in a message, will skip title generation"},mcpServers:{value:{filesystem:{command:"npx",args:["@modelcontextprotocol/server-filesystem","/path/to/allowed/dir"]}},visible:!0,description:"Model Context Protocol servers to connect to for additional tools"},"tools.disable":{value:["browser_navigate","builtin:edit_file"],visible:!0,description:"Array of tool names to disable. Use 'builtin:toolname' to disable only the builtin tool with that name (allowing an MCP server to provide a tool by that name)."},"tools.inactivityTimeout":{value:300,visible:!1,description:"How many seconds of no output to wait before canceling bash commands"},"tools.stopTimeout":{value:300,visible:!1,description:"Timeout for stopping tools"},permissions:{value:[{tool:"Bash",action:"ask",matches:{cmd:["git push*","git commit*"]}}],visible:!0,description:"Permission rules for tool calls. See amp permissions --help"},"guardedFiles.allowlist":{value:[],visible:!0,description:"Array of file glob patterns that are allowed to be accessed without confirmation. Takes precedence over the built-in denylist."},dangerouslyAllowAll:{value:!1,visible:!0,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},submitOnEnter:{value:!0,visible:!1,description:"Whether to submit messages on Enter (true) or require Ctrl+Enter (false)"},"terminal.commands.nodeSpawn.loadProfile":{value:"daily",visible:!1,description:"How often to load shell profile in node-spawn mode (always, daily, never)"},"terminal.animation":{value:!0,visible:!1,description:"Enable terminal animations"},"tab.enabled":{value:!0,visible:!1,description:"Enable tab completion features"},"tab.clipboard.enabled":{value:!0,visible:!1,description:"Enable clipboard access for Amp Tab context"},"tab.disabledLanguages":{value:[],visible:!1,description:"List of language IDs for which tab completion is disabled"},"tab.disableOnComment":{value:!1,visible:!1,description:"Disable tab completion on comment lines"},"tab.autoImport.enabled":{value:!1,visible:!1,description:"Enable auto-import feature for tab completion"},"tab.experimental.unobtrusiveDiffs":{value:!1,visible:!1,description:"Experimental: Enable unobtrusive diffs mode for tab suggestions to avoid layout shifts"},"tab.experimental.showHotStreakProgress":{value:!1,visible:!1,description:"Experimental: Show hot streak progress in tab suggestions"},"tab.experimental.autoAccept.delayMs":{value:0,visible:!1,description:"Experimental: Delay in milliseconds before auto-accepting tab suggestions"},"tab.experimental.disableClientFilters":{value:[],visible:!1,description:"Experimental: Disable specific client-side filters to observe unfiltered model behavior."},"tab.diagnosticTracking":{value:"multi_file",visible:!1,description:'Enable diagnostic tracking for tab suggestions. Values: "disabled" | "same_file" | "multi_file"'},"tab.hoverDiagnosticSuggestions":{value:!1,visible:!1,description:"Enable hover diagnostics for Tab suggestions"},"tab.experimental.displayMode":{value:"eager",visible:!1,description:'Control how tab suggestions are displayed. "eager" = show diff immediately, "subtle" = show "Tab to Jump" first.'},"tab.dismissCommandIds":{value:["extension.vim_escape","vim.escape","vscode-neovim.escape","vscode-neovim.escapeKey"],visible:!1,description:"Command IDs to execute when escape key is pressed in modal editors"},"tab.verboseLogs":{value:!1,visible:!1,description:"Enable verbose logging for tab completion"},debugLogs:{value:!1,visible:!1,description:"Enable debug logging output"},"guidanceFiles.specs":{value:!1,visible:!1,description:"[Experimental] Read `*.spec.md` files adjacent to `AGENT.md` files that are read"},"security.audit.logMcpConnections":{value:!1,visible:!1,description:"Enable telemetry logging for remote MCP server connections (for security auditing)"},hooks:{value:[],visible:!1,description:"Custom hooks for extending Amp functionality"},"experimental.bookkeeper":{value:!1,visible:!1,description:"Enable the Bookkeeper subagent for reading and querying Excel workbooks (.xlsx)"},"experimental.courseCorrection.enabled":{value:!1,visible:!1,description:"Enable the course correction agent that monitors progress and provides guidance when the main agent diverges from the plan"},"experimental.dojoMode":{value:!1,visible:!1,description:"Enable dojo mode - a learning mode that guides you to discover solutions yourself"},"anthropic.provider":{value:"anthropic",visible:!1,description:'Which provider to use for Anthropic Claude inference: "anthropic" or "vertex"'},"experimental.cli.nativeSecretsStorage.enabled":{value:!1,visible:!1,description:"Use native secret storage instead of the plain-text secrets configuration file"},"experimental.tools":{value:[],visible:!1,description:"Enable experimental tools by name. Available tools: kraken"},"fuzzy.alwaysIncludePaths":{value:[],visible:!0,description:"Glob patterns for paths that should always be included in fuzzy file search, even if gitignored"},"toolbox.path":{value:void 0,visible:!0,description:"Path to the directory containing toolbox scripts. Supports colon-separated paths."},"git.commit.coauthor.enabled":{value:!0,visible:!0,description:"Enable adding Amp as co-author in git commits"},"git.commit.ampThread.enabled":{value:!0,visible:!0,description:"Enable adding Amp-Thread trailer in git commits"},"jetbrains.skipInstall":{value:!1,visible:!1,description:"Skip JetBrains plugin installation"},proxy:{value:void 0,visible:!0,description:"Proxy URL used for both HTTP and HTTPS requests to the Amp server"},"updates.mode":{value:"auto",visible:!0,description:'Control update checking behavior: "warn" shows update notifications, "disabled" turns off checking, "auto" automatically runs update.'},showCosts:{value:!0,visible:!0,description:"Show cost information for threads"}},o38=Object.fromEntries(Object.entries(i16).filter(([,J])=>J.visible).map(([J,Q])=>[`amp.${J}`,Q.value])),Pm={examples:[{description:"Start an interactive session:",command:"amp"},{description:"Start an interactive session with a user message:",command:'echo "commit all my unstaged changes" | amp'},{description:"Use execute mode (--execute or -x) to send a command to an agent, have it execute it, print only the agent's last message, and then exit:",command:'amp -x "what file in this folder is in markdown format?"',output:`All Markdown files in this folder:
|
|
4044
4044
|
|
|
4045
4045
|
- README.md (root)
|
|
4046
4046
|
- AGENT.md (root)
|
|
@@ -4150,11 +4150,11 @@ Actual: ${X}`)}async function a28(J,Q,Z){let{execSync:Y}=await import("node:ch
|
|
|
4150
4150
|
${D}`;if(X==="pnpm"&&D.includes("Unable to find the global bin directory"))M+=`
|
|
4151
4151
|
|
|
4152
4152
|
Hint: Try running "pnpm setup" to configure pnpm global directory, or use npm instead:
|
|
4153
|
-
npm install -g @sourcegraph/amp`;K(Error(M))}},error:(U)=>{if(!H)H=!0,K(Error(`Failed to spawn ${X}: ${U.message}`))},complete:()=>{if(!H)H=!0,V()}})})}U0();U0();async function x61(J,Q){let Y=Q||"https://registry.npmjs.org";try{let X=new AbortController,G=setTimeout(()=>X.abort(),5000),V=await fetch(`${Y}/@sourcegraph/amp`,{signal:X.signal});if(clearTimeout(G),!V.ok)return{hasUpdate:!1,currentVersion:J,source:"npm"};let K=await V.json(),q=K["dist-tags"]?.latest;if(!q)return{hasUpdate:!1,currentVersion:J,source:"npm"};let W=e28(J,q),H=W<0,z,U;if(K.time){let D=K.time[J],M=K.time[q],L=Date.now();if(D)z=Math.floor((L-new Date(D).getTime())/3600000);if(M)U=Math.floor((L-new Date(M).getTime())/3600000)}return x.info("NPM version comparison",{currentVersion:J,latestVersion:q,compareResult:W,hasUpdate:H,currentVersionAge:z,latestVersionAge:U}),{hasUpdate:H,latestVersion:q,currentVersion:J,currentVersionAge:z,latestVersionAge:U,source:"npm"}}catch(X){return x.debug("Error checking npm version",{error:X}),{hasUpdate:!1,currentVersion:J,source:"npm"}}}function e28(J,Q){let Z=(V)=>{let[K,q]=V.split("-");return{parts:K?.split(".").map(Number)||[],label:q}},Y=Z(J),X=Z(Q),G=Math.max(Y.parts.length,X.parts.length);for(let V=0;V<G;V++){let K=Y.parts[V]||0,q=X.parts[V]||0;if(K<q)return-1;if(K>q)return 1}if(Y.label===X.label)return 0;if(!Y.label&&X.label)return 1;if(Y.label&&!X.label)return-1;if(Y.label&&X.label)return Y.label<X.label?-1:1;return 0}i0();function v61(J,Q){let Z=new g4,Y=Z.pipe(T8({shouldCountRefs:!1}));return setImmediate(async()=>{let X=new BK().scoped("update"),G=Y.subscribe({next:(V)=>{X.debug("emit new state",V)}});try{let V=process.env.AMP_TEST_UPDATE_STATUS;if(V){X.debug("using fake update status for testing",{status:V}),await UB(500),Z.next(V);return}if(process.env.AMP_SKIP_UPDATE_CHECK==="1"){X.debug("checking disabled via AMP_SKIP_UPDATE_CHECK environment variable");return}let K=await Q.get("updates.mode");if(K==="disabled"){X.debug("checking disabled");return}X.debug("checking",{currentVersion:J,mode:K});let q=bA(),W=await x61(J,q);if(!(W.latestVersion&&W.hasUpdate)){X.debug("no update available");return}let H=()=>{if(W.currentVersionAge!==void 0&&W.latestVersionAge!==void 0){let U=W.currentVersionAge-W.latestVersionAge,D=0.5;if(Math.abs(U)<0.5)return X.debug("versions too close together, suppressing update warning",{currentVersionAge:W.currentVersionAge,latestVersionAge:W.latestVersionAge,ageDifferenceHours:U}),!0}return!1},z=await y61();if(!K)K=z==="pnpm"?"warn":"auto",X.debug("no configured update mode; selected default based on package manager",{packageManager:z,mode:K});if(K==="warn"){if(!H())Z.next("update-available");return}if(!z){if(X.debug("auto-update not supported, falling back to warn mode"),!H())Z.next("update-available");return}if(z==="binary"&&process.platform==="win32"){if(X.debug("binary auto-update not supported on Windows, falling back to warn mode"),!H())Z.next("update-available");return}try{await Sm(W.latestVersion,z);let U=await SB(W.latestVersion),D={from:W.currentVersion,to:W.latestVersion,...U};if(U.status==="same")X.info("success",D),Z.next("updated");else X.warn("success with warning",D),Z.next("updated-with-warning")}catch(U){Z.next("update-error")}}catch(V){X.debug("check failed",{error:V})}finally{await UB(5000),Z.next("hidden"),G.unsubscribe(),Z.complete()}}),{state:Y}}import{stderr as Rq}from"node:process";function _06(J){let Q=new wA().name("install").description("Install required tools like ripgrep to $AMP_HOME/bin").option("--force","Force reinstallation even if already installed").option("--verbose","Show installation progress and results").action(async(Y)=>{await KC1(Y.force||!1,Y.verbose||!1,"0.0.
|
|
4153
|
+
npm install -g @sourcegraph/amp`;K(Error(M))}},error:(U)=>{if(!H)H=!0,K(Error(`Failed to spawn ${X}: ${U.message}`))},complete:()=>{if(!H)H=!0,V()}})})}U0();U0();async function x61(J,Q){let Y=Q||"https://registry.npmjs.org";try{let X=new AbortController,G=setTimeout(()=>X.abort(),5000),V=await fetch(`${Y}/@sourcegraph/amp`,{signal:X.signal});if(clearTimeout(G),!V.ok)return{hasUpdate:!1,currentVersion:J,source:"npm"};let K=await V.json(),q=K["dist-tags"]?.latest;if(!q)return{hasUpdate:!1,currentVersion:J,source:"npm"};let W=e28(J,q),H=W<0,z,U;if(K.time){let D=K.time[J],M=K.time[q],L=Date.now();if(D)z=Math.floor((L-new Date(D).getTime())/3600000);if(M)U=Math.floor((L-new Date(M).getTime())/3600000)}return x.info("NPM version comparison",{currentVersion:J,latestVersion:q,compareResult:W,hasUpdate:H,currentVersionAge:z,latestVersionAge:U}),{hasUpdate:H,latestVersion:q,currentVersion:J,currentVersionAge:z,latestVersionAge:U,source:"npm"}}catch(X){return x.debug("Error checking npm version",{error:X}),{hasUpdate:!1,currentVersion:J,source:"npm"}}}function e28(J,Q){let Z=(V)=>{let[K,q]=V.split("-");return{parts:K?.split(".").map(Number)||[],label:q}},Y=Z(J),X=Z(Q),G=Math.max(Y.parts.length,X.parts.length);for(let V=0;V<G;V++){let K=Y.parts[V]||0,q=X.parts[V]||0;if(K<q)return-1;if(K>q)return 1}if(Y.label===X.label)return 0;if(!Y.label&&X.label)return 1;if(Y.label&&!X.label)return-1;if(Y.label&&X.label)return Y.label<X.label?-1:1;return 0}i0();function v61(J,Q){let Z=new g4,Y=Z.pipe(T8({shouldCountRefs:!1}));return setImmediate(async()=>{let X=new BK().scoped("update"),G=Y.subscribe({next:(V)=>{X.debug("emit new state",V)}});try{let V=process.env.AMP_TEST_UPDATE_STATUS;if(V){X.debug("using fake update status for testing",{status:V}),await UB(500),Z.next(V);return}if(process.env.AMP_SKIP_UPDATE_CHECK==="1"){X.debug("checking disabled via AMP_SKIP_UPDATE_CHECK environment variable");return}let K=await Q.get("updates.mode");if(K==="disabled"){X.debug("checking disabled");return}X.debug("checking",{currentVersion:J,mode:K});let q=bA(),W=await x61(J,q);if(!(W.latestVersion&&W.hasUpdate)){X.debug("no update available");return}let H=()=>{if(W.currentVersionAge!==void 0&&W.latestVersionAge!==void 0){let U=W.currentVersionAge-W.latestVersionAge,D=0.5;if(Math.abs(U)<0.5)return X.debug("versions too close together, suppressing update warning",{currentVersionAge:W.currentVersionAge,latestVersionAge:W.latestVersionAge,ageDifferenceHours:U}),!0}return!1},z=await y61();if(!K)K=z==="pnpm"?"warn":"auto",X.debug("no configured update mode; selected default based on package manager",{packageManager:z,mode:K});if(K==="warn"){if(!H())Z.next("update-available");return}if(!z){if(X.debug("auto-update not supported, falling back to warn mode"),!H())Z.next("update-available");return}if(z==="binary"&&process.platform==="win32"){if(X.debug("binary auto-update not supported on Windows, falling back to warn mode"),!H())Z.next("update-available");return}try{await Sm(W.latestVersion,z);let U=await SB(W.latestVersion),D={from:W.currentVersion,to:W.latestVersion,...U};if(U.status==="same")X.info("success",D),Z.next("updated");else X.warn("success with warning",D),Z.next("updated-with-warning")}catch(U){Z.next("update-error")}}catch(V){X.debug("check failed",{error:V})}finally{await UB(5000),Z.next("hidden"),G.unsubscribe(),Z.complete()}}),{state:Y}}import{stderr as Rq}from"node:process";function _06(J){let Q=new wA().name("install").description("Install required tools like ripgrep to $AMP_HOME/bin").option("--force","Force reinstallation even if already installed").option("--verbose","Show installation progress and results").action(async(Y)=>{await KC1(Y.force||!1,Y.verbose||!1,"0.0.1765526485-g99562d"),process.exit()});J.addCommand(Q,{hidden:!0});let Z=new wA("update").summary("Update Amp CLI").description("Update Amp CLI to the latest version. You can specify a particular version to install, or leave blank to get the latest stable release.").option("--target-version <version>","Update to a specific version").allowUnknownOption(!1).action(async(Y)=>{await JJ8(Y.targetVersion)});J.addCommand(Z)}async function JJ8(J){if(process.env.AMP_SKIP_UPDATE_CHECK==="1")Rq.write(R6.yellow(`Note: AMP_SKIP_UPDATE_CHECK=1 is set, which disables automatic update checking. Manual updates will still work.
|
|
4154
4154
|
|
|
4155
4155
|
`));try{if(!J){Rq.write(R6.blue(`Checking for updates...
|
|
4156
|
-
`));let Z=bA(),{hasUpdate:Y,latestVersion:X}=await x61("0.0.
|
|
4157
|
-
`));let V=await SB("0.0.
|
|
4156
|
+
`));let Z=bA(),{hasUpdate:Y,latestVersion:X}=await x61("0.0.1765526485-g99562d",Z);if(!Y){Rq.write(R6.green(`✓ Amp CLI is already up to date: ${"0.0.1765526485-g99562d"} (${"released"} ${"2025-12-12T08:06:47.322Z"}${`, ${iI(new Date("2025-12-12T08:06:47.322Z"))} ago`})
|
|
4157
|
+
`));let V=await SB("0.0.1765526485-g99562d");if(V.warning)Rq.write(`
|
|
4158
4158
|
`+R6.yellow(V.warning)+`
|
|
4159
4159
|
`);process.exit(0)}if(!X)Rq.write(R6.yellow("[WARN] could not find latest version")),process.exit(0);J=X}Rq.write(R6.blue(`Updating to version ${J}...
|
|
4160
4160
|
`)),await Sm(J,void 0,(Z)=>{Rq.write(R6.dim(`Running: ${Z}
|
|
@@ -4765,7 +4765,7 @@ ${Z}`}async function kV8(J){try{let Q=h0.parse(J).fsPath;await _$(Q)}catch{await
|
|
|
4765
4765
|
`))}function q(D,M,L,A){let E=L.enter("tableCell"),I=L.enter("phrasing"),P=L.containerPhrasing(D,{...A,before:G,after:G});return I(),E(),P}function W(D,M){return U76(D,{align:M,alignDelimiters:Y,padding:Z,stringLength:X})}function H(D,M,L){let A=D.children,E=-1,I=[],P=M.enter("table");while(++E<A.length)I[E]=z(A[E],M,L);return P(),I}function z(D,M,L){let A=D.children,E=-1,I=[],P=M.enter("tableRow");while(++E<A.length)I[E]=q(A[E],D,M,L);return P(),I}function U(D,M,L){let A=$O.inlineCode(D,M,L);if(L.stack.includes("tableCell"))A=A.replace(/\|/g,"\\$&");return A}}function E_1(){return{exit:{taskListCheckValueChecked:N76,taskListCheckValueUnchecked:N76,paragraph:IW8}}}function I_1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:PW8}}}function N76(J){let Q=this.stack[this.stack.length-2];DJ(Q.type==="listItem"),Q.checked=J.type==="taskListCheckValueChecked"}function IW8(J){let Q=this.stack[this.stack.length-2];if(Q&&Q.type==="listItem"&&typeof Q.checked==="boolean"){let Z=this.stack[this.stack.length-1];DJ(Z.type==="paragraph");let Y=Z.children[0];if(Y&&Y.type==="text"){let X=Q.children,G=-1,V;while(++G<X.length){let K=X[G];if(K.type==="paragraph"){V=K;break}}if(V===Z){if(Y.value=Y.value.slice(1),Y.value.length===0)Z.children.shift();else if(Z.position&&Y.position&&typeof Y.position.start.offset==="number")Y.position.start.column++,Y.position.start.offset++,Z.position.start=Object.assign({},Y.position.start)}}}this.exit(J)}function PW8(J,Q,Z,Y){let X=J.children[0],G=typeof J.checked==="boolean"&&X&&X.type==="paragraph",V="["+(J.checked?"x":" ")+"] ",K=Z.createTracker(Y);if(G)K.move(V);let q=$O.listItem(J,Q,Z,{...Y,...K.current()});if(G)q=q.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,W);return q;function W(H){return H+V}}function P_1(){return[U_1(),N_1(),M_1(),O_1(),E_1()]}function T_1(J){return{extensions:[B_1(),D_1(J),L_1(),w_1(J),I_1()]}}var TW8={tokenize:_W8,partial:!0},D76={tokenize:kW8,partial:!0},M76={tokenize:yW8,partial:!0},L76={tokenize:xW8,partial:!0},RW8={tokenize:vW8,partial:!0},A76={name:"wwwAutolink",tokenize:jW8,previous:w76},O76={name:"protocolAutolink",tokenize:SW8,previous:E76},Vz={name:"emailAutolink",tokenize:CW8,previous:I76},gq={};function C_1(){return{text:gq}}var VO=48;while(VO<123)if(gq[VO]=Vz,VO++,VO===58)VO=65;else if(VO===91)VO=97;gq[43]=Vz;gq[45]=Vz;gq[46]=Vz;gq[95]=Vz;gq[72]=[Vz,O76];gq[104]=[Vz,O76];gq[87]=[Vz,A76];gq[119]=[Vz,A76];function CW8(J,Q,Z){let Y=this,X,G;return V;function V(z){if(!R_1(z)||!I76.call(Y,Y.previous)||j_1(Y.events))return Z(z);return J.enter("literalAutolink"),J.enter("literalAutolinkEmail"),K(z)}function K(z){if(R_1(z))return J.consume(z),K;if(z===64)return J.consume(z),q;return Z(z)}function q(z){if(z===46)return J.check(RW8,H,W)(z);if(z===45||z===95||V2(z))return G=!0,J.consume(z),q;return H(z)}function W(z){return J.consume(z),X=!0,q}function H(z){if(G&&X&&G2(Y.previous))return J.exit("literalAutolinkEmail"),J.exit("literalAutolink"),Q(z);return Z(z)}}function jW8(J,Q,Z){let Y=this;return X;function X(V){if(V!==87&&V!==119||!w76.call(Y,Y.previous)||j_1(Y.events))return Z(V);return J.enter("literalAutolink"),J.enter("literalAutolinkWww"),J.check(TW8,J.attempt(D76,J.attempt(M76,G),Z),Z)(V)}function G(V){return J.exit("literalAutolinkWww"),J.exit("literalAutolink"),Q(V)}}function SW8(J,Q,Z){let Y=this,X="",G=!1;return V;function V(z){if((z===72||z===104)&&E76.call(Y,Y.previous)&&!j_1(Y.events))return J.enter("literalAutolink"),J.enter("literalAutolinkHttp"),X+=String.fromCodePoint(z),J.consume(z),K;return Z(z)}function K(z){if(G2(z)&&X.length<5)return X+=String.fromCodePoint(z),J.consume(z),K;if(z===58){let U=X.toLowerCase();if(U==="http"||U==="https")return J.consume(z),q}return Z(z)}function q(z){if(z===47){if(J.consume(z),G)return W;return G=!0,q}return Z(z)}function W(z){return z===null||eA(z)||r8(z)||bq(z)||JO(z)?Z(z):J.attempt(D76,J.attempt(M76,H),Z)(z)}function H(z){return J.exit("literalAutolinkHttp"),J.exit("literalAutolink"),Q(z)}}function _W8(J,Q,Z){let Y=0;return X;function X(V){if((V===87||V===119)&&Y<3)return Y++,J.consume(V),X;if(V===46&&Y===3)return J.consume(V),G;return Z(V)}function G(V){return V===null?Z(V):Q(V)}}function kW8(J,Q,Z){let Y,X,G;return V;function V(W){if(W===46||W===95)return J.check(L76,q,K)(W);if(W===null||r8(W)||bq(W)||W!==45&&JO(W))return q(W);return G=!0,J.consume(W),V}function K(W){if(W===95)Y=!0;else X=Y,Y=void 0;return J.consume(W),V}function q(W){if(X||Y||!G)return Z(W);return Q(W)}}function yW8(J,Q){let Z=0,Y=0;return X;function X(V){if(V===40)return Z++,J.consume(V),X;if(V===41&&Y<Z)return G(V);if(V===33||V===34||V===38||V===39||V===41||V===42||V===44||V===46||V===58||V===59||V===60||V===63||V===93||V===95||V===126)return J.check(L76,Q,G)(V);if(V===null||r8(V)||bq(V))return Q(V);return J.consume(V),X}function G(V){if(V===41)Y++;return J.consume(V),X}}function xW8(J,Q,Z){return Y;function Y(K){if(K===33||K===34||K===39||K===41||K===42||K===44||K===46||K===58||K===59||K===63||K===95||K===126)return J.consume(K),Y;if(K===38)return J.consume(K),G;if(K===93)return J.consume(K),X;if(K===60||K===null||r8(K)||bq(K))return Q(K);return Z(K)}function X(K){if(K===null||K===40||K===91||r8(K)||bq(K))return Q(K);return Y(K)}function G(K){return G2(K)?V(K):Z(K)}function V(K){if(K===59)return J.consume(K),Y;if(G2(K))return J.consume(K),V;return Z(K)}}function vW8(J,Q,Z){return Y;function Y(G){return J.consume(G),X}function X(G){return V2(G)?Z(G):Q(G)}}function w76(J){return J===null||J===40||J===42||J===95||J===91||J===93||J===126||r8(J)}function E76(J){return!G2(J)}function I76(J){return!(J===47||R_1(J))}function R_1(J){return J===43||J===45||J===46||J===95||V2(J)}function j_1(J){let Q=J.length,Z=!1;while(Q--){let Y=J[Q][1];if((Y.type==="labelLink"||Y.type==="labelImage")&&!Y._balanced){Z=!0;break}if(Y._gfmAutolinkLiteralWalkedInto){Z=!1;break}}if(J.length>0&&!Z)J[J.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return Z}var fW8={tokenize:dW8,partial:!0};function S_1(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:gW8,continuation:{tokenize:uW8},exit:pW8}},text:{[91]:{name:"gfmFootnoteCall",tokenize:mW8},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hW8,resolveTo:bW8}}}}function hW8(J,Q,Z){let Y=this,X=Y.events.length,G=Y.parser.gfmFootnotes||(Y.parser.gfmFootnotes=[]),V;while(X--){let q=Y.events[X][1];if(q.type==="labelImage"){V=q;break}if(q.type==="gfmFootnoteCall"||q.type==="labelLink"||q.type==="label"||q.type==="image"||q.type==="link")break}return K;function K(q){if(!V||!V._balanced)return Z(q);let W=HQ(Y.sliceSerialize({start:V.end,end:Y.now()}));if(W.codePointAt(0)!==94||!G.includes(W.slice(1)))return Z(q);return J.enter("gfmFootnoteCallLabelMarker"),J.consume(q),J.exit("gfmFootnoteCallLabelMarker"),Q(q)}}function bW8(J,Q){let Z=J.length,Y;while(Z--)if(J[Z][1].type==="labelImage"&&J[Z][0]==="enter"){Y=J[Z][1];break}J[Z+1][1].type="data",J[Z+3][1].type="gfmFootnoteCallLabelMarker";let X={type:"gfmFootnoteCall",start:Object.assign({},J[Z+3][1].start),end:Object.assign({},J[J.length-1][1].end)},G={type:"gfmFootnoteCallMarker",start:Object.assign({},J[Z+3][1].end),end:Object.assign({},J[Z+3][1].end)};G.end.column++,G.end.offset++,G.end._bufferIndex++;let V={type:"gfmFootnoteCallString",start:Object.assign({},G.end),end:Object.assign({},J[J.length-1][1].start)},K={type:"chunkString",contentType:"string",start:Object.assign({},V.start),end:Object.assign({},V.end)},q=[J[Z+1],J[Z+2],["enter",X,Q],J[Z+3],J[Z+4],["enter",G,Q],["exit",G,Q],["enter",V,Q],["enter",K,Q],["exit",K,Q],["exit",V,Q],J[J.length-2],J[J.length-1],["exit",X,Q]];return J.splice(Z,J.length-Z+1,...q),J}function mW8(J,Q,Z){let Y=this,X=Y.parser.gfmFootnotes||(Y.parser.gfmFootnotes=[]),G=0,V;return K;function K(z){return J.enter("gfmFootnoteCall"),J.enter("gfmFootnoteCallLabelMarker"),J.consume(z),J.exit("gfmFootnoteCallLabelMarker"),q}function q(z){if(z!==94)return Z(z);return J.enter("gfmFootnoteCallMarker"),J.consume(z),J.exit("gfmFootnoteCallMarker"),J.enter("gfmFootnoteCallString"),J.enter("chunkString").contentType="string",W}function W(z){if(G>999||z===93&&!V||z===null||z===91||r8(z))return Z(z);if(z===93){J.exit("chunkString");let U=J.exit("gfmFootnoteCallString");if(!X.includes(HQ(Y.sliceSerialize(U))))return Z(z);return J.enter("gfmFootnoteCallLabelMarker"),J.consume(z),J.exit("gfmFootnoteCallLabelMarker"),J.exit("gfmFootnoteCall"),Q}if(!r8(z))V=!0;return G++,J.consume(z),z===92?H:W}function H(z){if(z===91||z===92||z===93)return J.consume(z),G++,W;return W(z)}}function gW8(J,Q,Z){let Y=this,X=Y.parser.gfmFootnotes||(Y.parser.gfmFootnotes=[]),G,V=0,K;return q;function q(M){return J.enter("gfmFootnoteDefinition")._container=!0,J.enter("gfmFootnoteDefinitionLabel"),J.enter("gfmFootnoteDefinitionLabelMarker"),J.consume(M),J.exit("gfmFootnoteDefinitionLabelMarker"),W}function W(M){if(M===94)return J.enter("gfmFootnoteDefinitionMarker"),J.consume(M),J.exit("gfmFootnoteDefinitionMarker"),J.enter("gfmFootnoteDefinitionLabelString"),J.enter("chunkString").contentType="string",H;return Z(M)}function H(M){if(V>999||M===93&&!K||M===null||M===91||r8(M))return Z(M);if(M===93){J.exit("chunkString");let L=J.exit("gfmFootnoteDefinitionLabelString");return G=HQ(Y.sliceSerialize(L)),J.enter("gfmFootnoteDefinitionLabelMarker"),J.consume(M),J.exit("gfmFootnoteDefinitionLabelMarker"),J.exit("gfmFootnoteDefinitionLabel"),U}if(!r8(M))K=!0;return V++,J.consume(M),M===92?z:H}function z(M){if(M===91||M===92||M===93)return J.consume(M),V++,H;return H(M)}function U(M){if(M===58){if(J.enter("definitionMarker"),J.consume(M),J.exit("definitionMarker"),!X.includes(G))X.push(G);return f4(J,D,"gfmFootnoteDefinitionWhitespace")}return Z(M)}function D(M){return Q(M)}}function uW8(J,Q,Z){return J.check(mq,Q,J.attempt(fW8,Q,Z))}function pW8(J){J.exit("gfmFootnoteDefinition")}function dW8(J,Q,Z){let Y=this;return f4(J,X,"gfmFootnoteDefinitionIndent",5);function X(G){let V=Y.events[Y.events.length-1];return V&&V[1].type==="gfmFootnoteDefinitionIndent"&&V[2].sliceSerialize(V[1],!0).length===4?Q(G):Z(G)}}function __1(J){let Z=(J||{}).singleTilde,Y={name:"strikethrough",tokenize:G,resolveAll:X};if(Z===null||Z===void 0)Z=!0;return{text:{[126]:Y},insideSpan:{null:[Y]},attentionMarkers:{null:[126]}};function X(V,K){let q=-1;while(++q<V.length)if(V[q][0]==="enter"&&V[q][1].type==="strikethroughSequenceTemporary"&&V[q][1]._close){let W=q;while(W--)if(V[W][0]==="exit"&&V[W][1].type==="strikethroughSequenceTemporary"&&V[W][1]._open&&V[q][1].end.offset-V[q][1].start.offset===V[W][1].end.offset-V[W][1].start.offset){V[q][1].type="strikethroughSequence",V[W][1].type="strikethroughSequence";let H={type:"strikethrough",start:Object.assign({},V[W][1].start),end:Object.assign({},V[q][1].end)},z={type:"strikethroughText",start:Object.assign({},V[W][1].end),end:Object.assign({},V[q][1].start)},U=[["enter",H,K],["enter",V[W][1],K],["exit",V[W][1],K],["enter",z,K]],D=K.parser.constructs.insideSpan.null;if(D)O3(U,U.length,0,oB(D,V.slice(W+1,q),K));O3(U,U.length,0,[["exit",z,K],["enter",V[q][1],K],["exit",V[q][1],K],["exit",H,K]]),O3(V,W-1,q-W+3,U),q=W+U.length-2;break}}q=-1;while(++q<V.length)if(V[q][1].type==="strikethroughSequenceTemporary")V[q][1].type="data";return V}function G(V,K,q){let W=this.previous,H=this.events,z=0;return U;function U(M){if(W===126&&H[H.length-1][1].type!=="characterEscape")return q(M);return V.enter("strikethroughSequenceTemporary"),D(M)}function D(M){let L=Gz(W);if(M===126){if(z>1)return q(M);return V.consume(M),z++,D}if(z<2&&!Z)return q(M);let A=V.exit("strikethroughSequenceTemporary"),E=Gz(M);return A._open=!E||E===2&&Boolean(L),A._close=!L||L===2&&Boolean(E),K(M)}}}class k_1{constructor(){this.map=[]}add(J,Q,Z){cW8(this,J,Q,Z)}consume(J){if(this.map.sort(function(X,G){return X[0]-G[0]}),this.map.length===0)return;let Q=this.map.length,Z=[];while(Q>0)Q-=1,Z.push(J.slice(this.map[Q][0]+this.map[Q][1]),this.map[Q][2]),J.length=this.map[Q][0];Z.push(J.slice()),J.length=0;let Y=Z.pop();while(Y){for(let X of Y)J.push(X);Y=Z.pop()}this.map.length=0}}function cW8(J,Q,Z,Y){let X=0;if(Z===0&&Y.length===0)return;while(X<J.map.length){if(J.map[X][0]===Q){J.map[X][1]+=Z,J.map[X][2].push(...Y);return}X+=1}J.map.push([Q,Z,Y])}function P76(J,Q){let Z=!1,Y=[];while(Q<J.length){let X=J[Q];if(Z){if(X[0]==="enter"){if(X[1].type==="tableContent")Y.push(J[Q+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(X[1].type==="tableContent"){if(J[Q-1][1].type==="tableDelimiterMarker"){let G=Y.length-1;Y[G]=Y[G]==="left"?"center":"right"}}else if(X[1].type==="tableDelimiterRow")break}else if(X[0]==="enter"&&X[1].type==="tableDelimiterRow")Z=!0;Q+=1}return Y}function y_1(){return{flow:{null:{name:"table",tokenize:lW8,resolveAll:iW8}}}}function lW8(J,Q,Z){let Y=this,X=0,G=0,V;return K;function K(b){let a=Y.events.length-1;while(a>-1){let c=Y.events[a][1].type;if(c==="lineEnding"||c==="linePrefix")a--;else break}let G1=a>-1?Y.events[a][1].type:null,t=G1==="tableHead"||G1==="tableRow"?k:q;if(t===k&&Y.parser.lazy[Y.now().line])return Z(b);return t(b)}function q(b){return J.enter("tableHead"),J.enter("tableRow"),W(b)}function W(b){if(b===124)return H(b);return V=!0,G+=1,H(b)}function H(b){if(b===null)return Z(b);if(r6(b)){if(G>1)return G=0,Y.interrupt=!0,J.exit("tableRow"),J.enter("lineEnding"),J.consume(b),J.exit("lineEnding"),D;return Z(b)}if(p4(b))return f4(J,H,"whitespace")(b);if(G+=1,V)V=!1,X+=1;if(b===124)return J.enter("tableCellDivider"),J.consume(b),J.exit("tableCellDivider"),V=!0,H;return J.enter("data"),z(b)}function z(b){if(b===null||b===124||r8(b))return J.exit("data"),H(b);return J.consume(b),b===92?U:z}function U(b){if(b===92||b===124)return J.consume(b),z;return z(b)}function D(b){if(Y.interrupt=!1,Y.parser.lazy[Y.now().line])return Z(b);if(J.enter("tableDelimiterRow"),V=!1,p4(b))return f4(J,M,"linePrefix",Y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b);return M(b)}function M(b){if(b===45||b===58)return A(b);if(b===124)return V=!0,J.enter("tableCellDivider"),J.consume(b),J.exit("tableCellDivider"),L;return y(b)}function L(b){if(p4(b))return f4(J,A,"whitespace")(b);return A(b)}function A(b){if(b===58)return G+=1,V=!0,J.enter("tableDelimiterMarker"),J.consume(b),J.exit("tableDelimiterMarker"),E;if(b===45)return G+=1,E(b);if(b===null||r6(b))return R(b);return y(b)}function E(b){if(b===45)return J.enter("tableDelimiterFiller"),I(b);return y(b)}function I(b){if(b===45)return J.consume(b),I;if(b===58)return V=!0,J.exit("tableDelimiterFiller"),J.enter("tableDelimiterMarker"),J.consume(b),J.exit("tableDelimiterMarker"),P;return J.exit("tableDelimiterFiller"),P(b)}function P(b){if(p4(b))return f4(J,R,"whitespace")(b);return R(b)}function R(b){if(b===124)return M(b);if(b===null||r6(b)){if(!V||X!==G)return y(b);return J.exit("tableDelimiterRow"),J.exit("tableHead"),Q(b)}return y(b)}function y(b){return Z(b)}function k(b){return J.enter("tableRow"),v(b)}function v(b){if(b===124)return J.enter("tableCellDivider"),J.consume(b),J.exit("tableCellDivider"),v;if(b===null||r6(b))return J.exit("tableRow"),Q(b);if(p4(b))return f4(J,v,"whitespace")(b);return J.enter("data"),g(b)}function g(b){if(b===null||b===124||r8(b))return J.exit("data"),v(b);return J.consume(b),b===92?d:g}function d(b){if(b===92||b===124)return J.consume(b),g;return g(b)}}function iW8(J,Q){let Z=-1,Y=!0,X=0,G=[0,0,0,0],V=[0,0,0,0],K=!1,q=0,W,H,z,U=new k_1;while(++Z<J.length){let D=J[Z],M=D[1];if(D[0]==="enter"){if(M.type==="tableHead"){if(K=!1,q!==0)T76(U,Q,q,W,H),H=void 0,q=0;W={type:"table",start:Object.assign({},M.start),end:Object.assign({},M.end)},U.add(Z,0,[["enter",W,Q]])}else if(M.type==="tableRow"||M.type==="tableDelimiterRow"){if(Y=!0,z=void 0,G=[0,0,0,0],V=[0,Z+1,0,0],K)K=!1,H={type:"tableBody",start:Object.assign({},M.start),end:Object.assign({},M.end)},U.add(Z,0,[["enter",H,Q]]);X=M.type==="tableDelimiterRow"?2:H?3:1}else if(X&&(M.type==="data"||M.type==="tableDelimiterMarker"||M.type==="tableDelimiterFiller")){if(Y=!1,V[2]===0){if(G[1]!==0)V[0]=V[1],z=s81(U,Q,G,X,void 0,z),G=[0,0,0,0];V[2]=Z}}else if(M.type==="tableCellDivider")if(Y)Y=!1;else{if(G[1]!==0)V[0]=V[1],z=s81(U,Q,G,X,void 0,z);G=V,V=[G[1],Z,0,0]}}else if(M.type==="tableHead")K=!0,q=Z;else if(M.type==="tableRow"||M.type==="tableDelimiterRow"){if(q=Z,G[1]!==0)V[0]=V[1],z=s81(U,Q,G,X,Z,z);else if(V[1]!==0)z=s81(U,Q,V,X,Z,z);X=0}else if(X&&(M.type==="data"||M.type==="tableDelimiterMarker"||M.type==="tableDelimiterFiller"))V[3]=Z}if(q!==0)T76(U,Q,q,W,H);U.consume(Q.events),Z=-1;while(++Z<Q.events.length){let D=Q.events[Z];if(D[0]==="enter"&&D[1].type==="table")D[1]._align=P76(Q.events,Z)}return J}function s81(J,Q,Z,Y,X,G){let V=Y===1?"tableHeader":Y===2?"tableDelimiter":"tableData",K="tableContent";if(Z[0]!==0)G.end=Object.assign({},EC(Q.events,Z[0])),J.add(Z[0],0,[["exit",G,Q]]);let q=EC(Q.events,Z[1]);if(G={type:V,start:Object.assign({},q),end:Object.assign({},q)},J.add(Z[1],0,[["enter",G,Q]]),Z[2]!==0){let W=EC(Q.events,Z[2]),H=EC(Q.events,Z[3]),z={type:"tableContent",start:Object.assign({},W),end:Object.assign({},H)};if(J.add(Z[2],0,[["enter",z,Q]]),Y!==2){let U=Q.events[Z[2]],D=Q.events[Z[3]];if(U[1].end=Object.assign({},D[1].end),U[1].type="chunkText",U[1].contentType="text",Z[3]>Z[2]+1){let M=Z[2]+1,L=Z[3]-Z[2]-1;J.add(M,L,[])}}J.add(Z[3]+1,0,[["exit",z,Q]])}if(X!==void 0)G.end=Object.assign({},EC(Q.events,X)),J.add(X,0,[["exit",G,Q]]),G=void 0;return G}function T76(J,Q,Z,Y,X){let G=[],V=EC(Q.events,Z);if(X)X.end=Object.assign({},V),G.push(["exit",X,Q]);Y.end=Object.assign({},V),G.push(["exit",Y,Q]),J.add(Z+1,0,G)}function EC(J,Q){let Z=J[Q],Y=Z[0]==="enter"?"start":"end";return Z[1][Y]}var nW8={name:"tasklistCheck",tokenize:aW8};function x_1(){return{text:{[91]:nW8}}}function aW8(J,Q,Z){let Y=this;return X;function X(q){if(Y.previous!==null||!Y._gfmTasklistFirstContentOfListItem)return Z(q);return J.enter("taskListCheck"),J.enter("taskListCheckMarker"),J.consume(q),J.exit("taskListCheckMarker"),G}function G(q){if(r8(q))return J.enter("taskListCheckValueUnchecked"),J.consume(q),J.exit("taskListCheckValueUnchecked"),V;if(q===88||q===120)return J.enter("taskListCheckValueChecked"),J.consume(q),J.exit("taskListCheckValueChecked"),V;return Z(q)}function V(q){if(q===93)return J.enter("taskListCheckMarker"),J.consume(q),J.exit("taskListCheckMarker"),J.exit("taskListCheck"),K;return Z(q)}function K(q){if(r6(q))return Q(q);if(p4(q))return J.check({tokenize:oW8},Q,Z)(q);return Z(q)}}function oW8(J,Q,Z){return f4(J,Y,"whitespace");function Y(X){return X===null?Z(X):Q(X)}}function R76(J){return R81([C_1(),S_1(),__1(J),y_1(),x_1()])}var rW8={};function t81(J){let Q=this,Z=J||rW8,Y=Q.data(),X=Y.micromarkExtensions||(Y.micromarkExtensions=[]),G=Y.fromMarkdownExtensions||(Y.fromMarkdownExtensions=[]),V=Y.toMarkdownExtensions||(Y.toMarkdownExtensions=[]);X.push(R76(Z)),G.push(P_1()),V.push(T_1(Z))}class v_1 extends lQ{rows;columnConfigs;borderColor;showBorders;cellPadding;constructor({key:J,rows:Q,columnConfigs:Z,borderColor:Y,showBorders:X=!0,cellPadding:G=H0.symmetric(1,0)}){let V=[];for(let K of Q)for(let q of K.cells){let W=new W6({padding:G,child:q.child});V.push(W)}super({key:J,children:V});this.rows=Q,this.columnConfigs=Z,this.borderColor=Y,this.showBorders=X,this.cellPadding=G}createRenderObject(){return new C76({rows:this.rows,columnConfigs:this.columnConfigs,borderColor:this.borderColor,showBorders:this.showBorders,cellPadding:this.cellPadding})}updateRenderObject(J){J.updateTable({rows:this.rows,columnConfigs:this.columnConfigs,borderColor:this.borderColor,showBorders:this.showBorders,cellPadding:this.cellPadding})}}class C76 extends D4{rows;columnConfigs;borderColor;showBorders;cellPadding;columnWidths=[];rowHeights=[];constructor({rows:J,columnConfigs:Q,borderColor:Z,showBorders:Y,cellPadding:X}){super();this.rows=J,this.columnConfigs=Q,this.borderColor=Z,this.showBorders=Y,this.cellPadding=X}updateTable({rows:J,columnConfigs:Q,borderColor:Z,showBorders:Y,cellPadding:X}){this.rows=J,this.columnConfigs=Q,this.borderColor=Z,this.showBorders=Y,this.cellPadding=X,this.markNeedsLayout()}performLayout(){let J=this._lastConstraints;if(!J)return;this.columnWidths=this.calculateColumnWidths(J),this.rowHeights=this.calculateRowHeights(),this.layoutCells();let Q=this.getTotalTableWidth(),Z=this.getTotalTableHeight();this.setSize(Q,Z)}calculateColumnWidths(J){let Q=[],Z=0,Y=0;for(let X=0;X<this.columnConfigs.length;X++){let G=this.columnConfigs[X];if(!G)continue;switch(G.widthType){case"fixed":{A4(G.fixedWidth!==void 0,`Fixed width column ${X} must have fixedWidth specified`);let V=G.fixedWidth;Q[X]=V,Z+=V;break}case"intrinsic":{let V=this.calculateIntrinsicColumnWidth(X);Q[X]=V,Z+=V;break}case"flex":Y++,Q[X]=0;break}}if(Y>0){let X=0;if(this.showBorders)X+=2,X+=Math.max(0,this.columnConfigs.length-1);let G=Math.max(0,J.maxWidth-Z-X),V=Math.floor(G/Y);for(let K=0;K<Q.length;K++)if(this.columnConfigs[K]?.widthType==="flex")Q[K]=V}return Q}calculateIntrinsicColumnWidth(J){let Q=0,Z=0;for(let Y=0;Y<this.rows.length;Y++){let X=this.rows[Y];if(!X)continue;for(let G=0;G<X.cells.length;G++){if(G===J){let V=X.cells[G],K=this.children[Z];if(V&&K){let q=K.getMaxIntrinsicWidth(Number.POSITIVE_INFINITY);Q=Math.max(Q,q)}}Z++}}return Q}calculateRowHeights(){let J=[],Q=0;for(let Z=0;Z<this.rows.length;Z++){let Y=this.rows[Z];if(!Y)continue;let X=1;for(let G=0;G<Y.cells.length;G++){let V=Y.cells[G],K=this.children[Q],q=this.columnWidths[G];if(!V||!K){Q++;continue}let W=this.measureCellHeight(K,q||0);X=Math.max(X,W),Q++}J[Z]=X}return J}layoutCells(){let J=0;for(let Q=0;Q<this.rows.length;Q++){let Z=this.rows[Q];if(!Z)continue;for(let Y=0;Y<Z.cells.length;Y++){let X=Z.cells[Y],G=this.children[J];if(!X||!G){J++;continue}let V=this.columnWidths[Y]||0,K=this.rowHeights[Q]||1,q=A6.tight(V,K);G.layout(q);let W=this.getColumnOffset(Y),H=this.getRowOffset(Q),z=W,U=H;G.setOffset(z,U),J++}}}getTotalTableWidth(){let Q=this.columnWidths.reduce((Z,Y)=>Z+Y,0);if(this.showBorders)Q+=2,Q+=Math.max(0,this.columnWidths.length-1);return Q}getTotalTableHeight(){let Q=this.rowHeights.reduce((Z,Y)=>Z+Y,0);if(this.showBorders)Q+=2,Q+=Math.max(0,this.rowHeights.length-1);return Q}getColumnOffset(J){let Q=this.showBorders?1:0;for(let Z=0;Z<J;Z++)if(Q+=this.columnWidths[Z]||0,this.showBorders)Q+=1;return Q}getRowOffset(J){let Q=this.showBorders?1:0;for(let Z=0;Z<J;Z++)if(Q+=this.rowHeights[Z]||0,this.showBorders)Q+=1;return Q}getMaxIntrinsicWidth(J){let Q=0;for(let Z=0;Z<this.columnConfigs.length;Z++){let Y=this.columnConfigs[Z];if(!Y)continue;switch(Y.widthType){case"fixed":Q+=Y.fixedWidth||0;break;case"intrinsic":{let X=this.calculateIntrinsicColumnWidth(Z);Q+=X;break}case"flex":Q+=0;break}}if(this.showBorders)Q+=2,Q+=Math.max(0,this.columnConfigs.length-1);return Q}measureCellHeight(J,Q){let Z=new A6(Q,Q,0,Number.POSITIVE_INFINITY);return J.layout(Z),J.size.height}paint(J,Q,Z){let Y=Q+this.offset.x,X=Z+this.offset.y;if(!this.showBorders){super.paint(J,Q,Z);return}this.paintTableBorders(J,Y,X),super.paint(J,Q,Z)}paintTableBorders(J,Q,Z){let Y=this.getTotalTableWidth(),X=this.getTotalTableHeight();this.drawBox(J,Q,Z,Y,X);let G=Z+1;for(let K=0;K<this.rowHeights.length-1;K++){G+=this.rowHeights[K]||0;for(let q=Q+1;q<Q+Y-1;q++)J.setCell(q,G,p8("─",{fg:this.borderColor}));J.setCell(Q,G,p8("├",{fg:this.borderColor})),J.setCell(Q+Y-1,G,p8("┤",{fg:this.borderColor})),G+=1}let V=Q+1;for(let K=0;K<this.columnWidths.length-1;K++){V+=this.columnWidths[K]||0;for(let q=Z+1;q<Z+X-1;q++)if(J.getCell(V,q)?.char==="─")J.setCell(V,q,p8("┼",{fg:this.borderColor}));else J.setCell(V,q,p8("│",{fg:this.borderColor}));J.setCell(V,Z,p8("┬",{fg:this.borderColor})),J.setCell(V,Z+X-1,p8("┴",{fg:this.borderColor})),V+=1}}drawBox(J,Q,Z,Y,X){for(let G=1;G<Y-1;G++)J.setCell(Q+G,Z,p8("─",{fg:this.borderColor}));for(let G=1;G<Y-1;G++)J.setCell(Q+G,Z+X-1,p8("─",{fg:this.borderColor}));for(let G=1;G<X-1;G++)J.setCell(Q,Z+G,p8("│",{fg:this.borderColor}));for(let G=1;G<X-1;G++)J.setCell(Q+Y-1,Z+G,p8("│",{fg:this.borderColor}));J.setCell(Q,Z,p8("╭",{fg:this.borderColor})),J.setCell(Q+Y-1,Z,p8("╮",{fg:this.borderColor})),J.setCell(Q,Z+X-1,p8("╰",{fg:this.borderColor})),J.setCell(Q+Y-1,Z+X-1,p8("╯",{fg:this.borderColor}))}}function j76(J,Q){return{child:J,alignment:Q}}function S76(J,Q=!1){return{cells:J.map((Y)=>("child"in Y)?Y:{child:Y}),isHeader:Q}}function _76(J,Q="intrinsic",Z){return{alignment:J,widthType:Q,fixedWidth:Z}}function IC(){return{text:new r({color:H1.default()}),inlineCode:new r({color:H1.yellow,bold:!0}),codeBlock:new r({color:H1.default()}),tableBorder:H1.index(8),link:new r({color:H1.blue,underline:!0}),syntaxHighlight:{keyword:H1.blue,string:H1.green,number:H1.yellow,comment:H1.index(8),function:H1.cyan,variable:H1.default(),type:H1.magenta,operator:H1.default()}}}class Y7 extends I6{markdown;textAlign;maxLines;overflow;styleScheme;constructor({key:J,markdown:Q,textAlign:Z="left",maxLines:Y,overflow:X="clip",styleScheme:G}){super(J?{key:J}:{});this.markdown=Q,this.textAlign=Z,this.maxLines=Y,this.overflow=X,this.styleScheme=G}build(J){let Q=this.key?`${this.key.toString()}-`:void 0,Z;try{let Y=K76().use(t81).parse(this.markdown);Z=this.processAstNode(J,Y,Q)}catch{let Y=this.styleScheme??IC(),X=new l(this.markdown,Y.text),G=Q?new n7(`${Q}fallback`):void 0;Z=[new S1({key:G,text:X,selectable:!0})]}return new x0({crossAxisAlignment:"start",children:Z})}get resolvedStyleScheme(){return this.styleScheme??IC()}resolveOnLinkClick(J){return(Q)=>f2(J,Q)}processAstNode(J,Q,Z,Y=0,X){let G=this.resolvedStyleScheme,V=[],K=0;switch(Q.type){case"root":{let q=Q;for(let W=0;W<q.children.length;W++){let H=q.children[W];if(H){if(V.push(...this.processAstNode(J,H,Z,Y)),W<q.children.length-1)V.push(new S1({text:new l(`
|
|
4766
4766
|
`,G.text),selectable:!0}))}}break}case"paragraph":{let q=Q,W=this.processInline(J,q.children),H=W.length===1&&W[0]?W[0]:new l(void 0,G.text,W),z=Z?new n7(`${Z}p-${K++}`):void 0;V.push(new S1({key:z,text:H,selectable:!0}));break}case"heading":{let q=Q,W=q.depth,z={1:H1.yellow,2:H1.cyan,3:H1.yellow,4:H1.cyan,5:G.text.color??H1.default(),6:G.text.color??H1.default()}[W],U=W<=2,D=G.text.copyWith({color:z,bold:U}),M=this.processInline(J,q.children,D),L=M.length===1&&M[0]?M[0]:new l(void 0,D,M),A=Z?new n7(`${Z}h${W}-${K++}`):void 0;V.push(new S1({key:A,text:L,selectable:!0}));break}case"blockquote":{let q=Q,W=[];for(let z of q.children)W.push(...this.processAstNode(J,z,Z,Y));let H=new b0({padding:H0.only({left:2,right:4}),child:new b0({padding:H0.only({left:1}),decoration:new N8(void 0,new F4(void 0,void 0,void 0,new G4(H1.default(),1))),child:new x0({crossAxisAlignment:"start",children:W})})});V.push(H);break}case"thematicBreak":{let q=new l("---",G.text);V.push(new S1({text:q,selectable:!0}));break}case"html":{let W=new l(Q.value,G.inlineCode);V.push(new S1({text:W,selectable:!0}));break}case"list":{let q=Q,W=[],H=q.start??1;for(let U=0;U<q.children.length;U++){let D=q.children[U];if(!D)continue;let M={ordered:q.ordered??!1,itemIndex:H+U};W.push(...this.processAstNode(J,D,Z,Y,M))}let z=new x0({crossAxisAlignment:"start",children:W});if(Y>0){let U=Y*2;V.push(new b0({padding:H0.only({left:U}),child:z}))}else V.push(z);break}case"listItem":{let q=Q,W;if(typeof q.checked==="boolean"){let U=q.checked?"[✓] ":"[ ] ";W=new S1({text:new l(U,G.text),selectable:!1})}else if(X?.ordered){let U=`${X.itemIndex}. `;W=new S1({text:new l(U,G.text),selectable:!1})}else W=new S1({text:new l("• ",G.text),selectable:!1});let H=[];for(let U=0;U<q.children.length;U++){let D=q.children[U];if(!D)continue;if(D.type==="paragraph"){let L=D,A=this.processInline(J,L.children),E=A.length===1&&A[0]?A[0]:new l(void 0,G.text,A);H.push(new S1({text:E,selectable:!0}))}else if(D.type==="list")H.push(...this.processAstNode(J,D,Z,Y+1));else H.push(...this.processAstNode(J,D,Z,Y));let M=q.children[U+1];if(M&&D.type!=="list"&&M.type!=="list")H.push(new S1({text:new l(`
|
|
4767
4767
|
`,G.text),selectable:!0}))}let z=new B6({crossAxisAlignment:"start",mainAxisAlignment:"start",children:[W,new c6({child:new x0({crossAxisAlignment:"start",children:H})})]});V.push(z);break}case"code":{let q=Q,W=q.lang||"",H=q.value;if(H.trim()){let z=sW8(H,W,G.syntaxHighlight,G.codeBlock.color??H1.default(),G.codeBlock),U=new l(void 0,G.codeBlock,z),D=new b0({padding:H0.only({left:4,right:4}),child:new S1({text:U,selectable:!0})});V.push(D)}break}case"table":{let q=Q,W=[],H=q.children[0],z=H?H.children.length:0,U=Array.from({length:z},(M,L)=>{let A=q.align?.[L],E=(()=>{switch(A){case"center":return"center";case"right":return"right";case"left":default:return"left"}})();return _76(E,"flex")});for(let M=0;M<q.children.length;M++){let L=q.children[M];if(!L)continue;let A=L.children.map((I,P)=>{let R=this.processInline(J,I.children),y=R.length===1&&R[0]?R[0]:new l(void 0,G.text,R),k=U[P],v=(()=>{switch(k?.alignment){case"center":return"center";case"right":return"right";case"left":default:return"left"}})(),g=new S1({text:y,selectable:!0,textAlign:v});return j76(g)}),E=M===0;W.push(S76(A,E))}let D=new v_1({rows:W,columnConfigs:U,borderColor:G.tableBorder,showBorders:!0});V.push(D);break}case"tableRow":case"tableCell":break;case"image":{let W=Q.alt||"Image",H=new S1({text:new l(`[Image: ${W}]`,G.link.copyWith({italic:!0})),selectable:!0});V.push(H);break}default:{if("children"in Q&&Array.isArray(Q.children)){let q=Q;for(let W of q.children)V.push(...this.processAstNode(J,W,Z,Y))}break}}return V}processInline(J,Q,Z){let Y=this.resolvedStyleScheme,X=this.resolveOnLinkClick(J),G=[],V=Z??Y.text;for(let K of Q)switch(K.type){case"text":{let q=K;G.push(new l(q.value,V));break}case"strong":{let q=K,W=V.copyWith({bold:!0});G.push(...this.processInline(J,q.children,W));break}case"emphasis":{let q=K,W=V.copyWith({italic:!0});G.push(...this.processInline(J,q.children,W));break}case"delete":{let q=K,W=V.copyWith({strikethrough:!0});G.push(...this.processInline(J,q.children,W));break}case"inlineCode":{let q=K,W=V.merge(Y.inlineCode);G.push(new l(q.value,W));break}case"link":{let q=K,W=V.merge(Y.link),H={uri:q.url,id:Math.random().toString(36)},z=this.processInline(J,q.children,W);for(let U of z)G.push(new l(U.text,U.style,U.children,H,()=>{X(q.url)}));break}case"break":{G.push(new l(`
|
|
4768
|
-
`,V));break}default:{if("children"in K&&Array.isArray(K.children))G.push(...this.processInline(J,K.children,Z));break}}return G}}function sW8(J,Q,Z,Y,X){let G=kB.default.languages[Q]||kB.default.languages.clike,V=X?.copyWith({color:Y})??new r({color:Y});if(!G)return[new l(J,V)];try{let K=J41(J,Z,`file.${Q}`),q=[];for(let W of K){let H=W.color??Y,z=X?.copyWith({color:H})??new r({color:H});q.push(new l(W.content,z))}return q.length>0?q:[new l(J,V)]}catch{return[new l(J,V)]}}var tW8=200;class f_1 extends p0{servers;onDismiss;constructor({servers:J,onDismiss:Q}){super();this.servers=J,this.onDismiss=Q}createState(){return new k76}}class k76 extends u0{scrollController;animationFrame=0;animationTimer=null;animationFrames=["∿","∾","∽","≋","≈","∼"];initState(){this.scrollController=new l5,this.scrollController.disableFollowMode(),this.scrollController.jumpTo(0),this.startAnimationIfNeeded()}didUpdateWidget(J){this.startAnimationIfNeeded()}dispose(){this.stopAnimation()}hasConnectingServers(){return this.widget.servers.some((J)=>J.status.type==="connecting"||J.status.type==="authenticating")}startAnimationIfNeeded(){let J=this.hasConnectingServers();if(J&&!this.animationTimer)this.animationTimer=setInterval(()=>{this.setState(()=>{this.animationFrame=(this.animationFrame+1)%this.animationFrames.length})},tW8);else if(!J&&this.animationTimer)this.stopAnimation()}stopAnimation(){if(this.animationTimer)clearInterval(this.animationTimer),this.animationTimer=null}build(J){let Z=H4.of(J).colorScheme,X=X6.of(J).app,G=S4.of(J),V=G.size.width,K=G.size.height,q=V-4,W=K-4,H=Math.max(40,Math.min(70,q)),z=this.widget.servers,U=0,D=0,M=0;for(let J1 of z)switch(J1.status.type){case"connected":U++;break;case"connecting":case"authenticating":D++;break;case"failed":case"denied":case"awaiting-approval":M++;break}let L=new r({color:Z.primary,bold:!0}),A=new r({color:Z.foreground}),E=new r({color:H1.index(10)}),I=new r({color:H1.blue}),P=new r({color:H1.index(9)}),R=new r({color:Z.foreground,dim:!0}),y=new r({color:X.keybind}),k=new r({color:Z.foreground,dim:!0}),v=[];for(let J1 of z)v.push(new y76({server:J1,animationFrame:this.animationFrame,animationFrames:this.animationFrames,serverNameStyle:A,connectedStyle:E,connectingStyle:I,failedStyle:P,errorStyle:R}));if(z.length===0)v.push(new W6({padding:H0.symmetric(2,1),child:new S1({text:new l("No MCP servers configured",new r({color:Z.foreground,dim:!0}))})}));let g=[];if(U>0)g.push(new l(`${U} connected`,E));if(D>0){if(g.length>0)g.push(new l(" · ",k));g.push(new l(`${D} connecting`,I))}if(M>0){if(g.length>0)g.push(new l(" · ",k));g.push(new l(`${M} failed`,P))}let d=new W5({autofocus:!0,controller:this.scrollController,child:new b0({constraints:new A6(H-4,H-4,0,Number.POSITIVE_INFINITY),child:new x0({crossAxisAlignment:"start",mainAxisSize:"min",children:v})})}),b=[new l("MCP Servers",L)];if(g.length>0)b.push(new l(" ",void 0)),b.push(...g);let a=new W6({padding:H0.only({left:2,right:2,top:1,bottom:1}),child:new S1({text:new l(void 0,void 0,b)})}),G1=new W6({padding:H0.horizontal(1),child:new S1({text:new l("─".repeat(H-4),new r({color:Z.foreground,dim:!0}))})}),t=new W6({padding:H0.only({left:2,right:2,bottom:1}),child:new S1({text:new l(void 0,k,[new l("Press ",k),new l("Esc",y),new l(" to close",k)])})}),c=new x0({crossAxisAlignment:"stretch",children:[a,G1,new c6({child:d}),G1,t]});return new C4({child:new b0({constraints:new A6(H,H,0,W),decoration:{color:Z.background,border:F4.all(new G4(Z.primary,1,"rounded"))},child:c})})}}class y76 extends I6{server;animationFrame;animationFrames;serverNameStyle;connectedStyle;connectingStyle;failedStyle;errorStyle;constructor(J){super();this.server=J.server,this.animationFrame=J.animationFrame,this.animationFrames=J.animationFrames,this.serverNameStyle=J.serverNameStyle,this.connectedStyle=J.connectedStyle,this.connectingStyle=J.connectingStyle,this.failedStyle=J.failedStyle,this.errorStyle=J.errorStyle}build(J){let Q=this.server.status,Z=[],Y,X,G,V;switch(Q.type){case"connected":Y="✓",X=this.connectedStyle,G="connected",V=this.connectedStyle;break;case"connecting":Y=this.animationFrames[this.animationFrame]??"∿",X=this.connectingStyle,G="connecting",V=this.connectingStyle;break;case"authenticating":Y=this.animationFrames[this.animationFrame]??"∿",X=this.connectingStyle,G="authenticating",V=this.connectingStyle;break;case"failed":Y="✗",X=this.failedStyle,G="failed",V=this.failedStyle;break;case"denied":Y="✗",X=this.failedStyle,G="denied",V=this.failedStyle;break;case"awaiting-approval":Y="?",X=new r({color:H1.yellow}),G="awaiting approval",V=new r({color:H1.yellow});break;default:Y="·",X=this.errorStyle,G="unknown",V=this.errorStyle}let K=new B6({children:[new S1({text:new l(Y,X),maxLines:1}),Q5.horizontal(2),new c6({child:new S1({text:new l(this.server.name,this.serverNameStyle),maxLines:1})}),new S1({text:new l(G,V),maxLines:1})]});if(Z.push(new W6({padding:H0.horizontal(2),child:K})),Q.type==="failed"){let q=this.formatErrorMessage(Q.error.message);Z.push(new W6({padding:H0.only({left:5,right:2}),child:new S1({text:new l(`└─ ${q}`,this.errorStyle),maxLines:2})}))}return Z.push(new Q0({height:1})),new x0({crossAxisAlignment:"stretch",mainAxisSize:"min",children:Z})}formatErrorMessage(J){let Z=J.replace(/\n/g," ").trim();if(Z.length>60)Z=Z.substring(0,57)+"...";return Z}}O8();Rt();U0();i0();var Ig=!1;class h_1 extends p0{props;constructor(J){super();this.props=J}createState(){return new x76}}class x76 extends u0{showCosts=Ig;showDetailedCosts=Ig;subscription=null;initState(){super.initState(),this.subscription=y8(l41(this.widget.props.configService).pipe(g5((J)=>J!=="pending")),this.widget.props.configService.config).pipe(Q6(([J,Q])=>{let Z=i41(J)?J.user.email:"",Y=Z.toLowerCase().endsWith("@sourcegraph.com")||Z.toLowerCase().endsWith("@ampcode.com"),X=Ig||Y,G=Q.settings.showCosts??!1,V=Q.settings["internal.showDetailedCosts"]??!1,K=G,q=X&&V;return x.debug("CostDisplayProvider computed costs",{email:Z,isTeammate:Y,isEligibleForDetailedCosts:X,showCostsSetting:G,showDetailedCostsSetting:V,computedShowCosts:K,computedShowDetailedCosts:q}),{showCosts:K,showDetailedCosts:q}}),U4((J,Q)=>J.showCosts===Q.showCosts&&J.showDetailedCosts===Q.showDetailedCosts)).subscribe((J)=>{x.debug("CostDisplayProvider setState called",{previousShowCosts:this.showCosts,previousShowDetailedCosts:this.showDetailedCosts,newShowCosts:J.showCosts,newShowDetailedCosts:J.showDetailedCosts}),this.setState(()=>{this.showCosts=J.showCosts,this.showDetailedCosts=J.showDetailedCosts})})}dispose(){this.subscription?.unsubscribe(),this.subscription=null,super.dispose()}build(J){return new e81({showCosts:this.showCosts,showDetailedCosts:this.showDetailedCosts,child:this.widget.props.child})}}class e81 extends zJ{showCosts;showDetailedCosts;constructor({showCosts:J,showDetailedCosts:Q,child:Z}){super({child:Z});this.showCosts=J,this.showDetailedCosts=Q}updateShouldNotify(J){return this.showCosts!==J.showCosts||this.showDetailedCosts!==J.showDetailedCosts}}function J91(J){let Q=J.dependOnInheritedWidgetOfExactType(e81);if(Q)return Q.widget.showCosts;return Ig}function Pg(J){let Q=J.dependOnInheritedWidgetOfExactType(e81);if(Q)return Q.widget.showDetailedCosts;return Ig}class b_1 extends p0{markdown;defaultColor;textAlign;maxLines;overflow;constructor({key:J,markdown:Q,defaultColor:Z=H1.default(),textAlign:Y="left",maxLines:X,overflow:G="clip"}){super(J?{key:J}:{});this.markdown=Q,this.defaultColor=Z,this.textAlign=Y,this.maxLines=X,this.overflow=G}createState(){return new v76}}class v76 extends u0{animationOffset=0;isAnimating=!1;intervalId;animationTimeoutId;targetPhrase="You're absolutely right";initState(){if(super.initState(),this.widget.markdown.includes(this.targetPhrase))this.intervalId=setInterval(()=>{this.startRainbowAnimation()},3000)}cleanup=()=>{if(this.intervalId)clearInterval(this.intervalId),this.intervalId=void 0;if(this.animationTimeoutId)clearTimeout(this.animationTimeoutId),this.animationTimeoutId=void 0};dispose(){this.cleanup(),super.dispose()}startRainbowAnimation(){this.isAnimating=!0,this.animationOffset=0,this.setState(()=>{});let J=60,Q=0,Z=()=>{if(Q<J)this.animationOffset=Q/J,this.setState(()=>{}),Q++,this.animationTimeoutId=setTimeout(Z,33);else this.isAnimating=!1,this.setState(()=>{})};Z()}build(J){if(this.widget.markdown.indexOf(this.targetPhrase)===-1)return new Y7({markdown:this.widget.markdown,textAlign:this.widget.textAlign,maxLines:this.widget.maxLines,overflow:this.widget.overflow});let Y=new Y7({markdown:this.widget.markdown,textAlign:this.widget.textAlign,maxLines:this.widget.maxLines,overflow:this.widget.overflow}).build(J);if(!this.isAnimating)return Y;return this.applyRainbowToWidget(Y,this.widget.defaultColor)}applyRainbowToWidget(J,Q){if(J instanceof S1){let Z=this.applyRainbowToTextSpan(J.text,Q);return new S1({text:Z,textAlign:J.textAlign,maxLines:J.maxLines,overflow:J.overflow})}if("children"in J&&Array.isArray(J.children)){let Z=J,Y=Z.children.map((G)=>this.applyRainbowToWidget(G,Q));return new J.constructor({children:Y,...Z.mainAxisAlignment!==void 0&&{mainAxisAlignment:Z.mainAxisAlignment},...Z.crossAxisAlignment!==void 0&&{crossAxisAlignment:Z.crossAxisAlignment},...Z.mainAxisSize!==void 0&&{mainAxisSize:Z.mainAxisSize},...Z.crossAxisSize!==void 0&&{crossAxisSize:Z.crossAxisSize}})}return J}applyRainbowToTextSpan(J,Q){if(J.text&&J.text.includes(this.targetPhrase))return this.createRainbowSpansForText(J,Q);if(J.children&&J.children.length>0){let Z=J.children.map((Y)=>this.applyRainbowToTextSpan(Y,Q));return new l(J.text,J.style,Z,J.hyperlink)}return J}getSpanText(J){let Q=J.text||"";if(J.children)Q+=J.children.map((Z)=>this.getSpanText(Z)).join("");return Q}createRainbowSpansForText(J,Q){let Z=J.text||"",Y=Z.indexOf(this.targetPhrase);if(Y===-1)return J;let X=Z.slice(0,Y),G=Z.slice(Y+this.targetPhrase.length),V=[];if(X)V.push(new l(X,J.style||new r({color:Q})));if(V.push(...this.createAnimatedRainbowSpans(J.style||new r({color:Q}))),G)V.push(new l(G,J.style||new r({color:Q})));return new l(void 0,J.style,V,J.hyperlink)}createAnimatedRainbowSpans(J){let Q=[H1.red,H1.yellow,H1.green,H1.cyan,H1.blue,H1.magenta],Z=8,Y=this.targetPhrase.replace(/\s/g,"").length,X=Math.floor(this.animationOffset*(Y+8))-8,G=[],V=0;for(let K=0;K<this.targetPhrase.length;K++){let q=this.targetPhrase[K];if(q!==" "&&q!=="\t"&&q!==`
|
|
4768
|
+
`,V));break}default:{if("children"in K&&Array.isArray(K.children))G.push(...this.processInline(J,K.children,Z));break}}return G}}function sW8(J,Q,Z,Y,X){let G=kB.default.languages[Q]||kB.default.languages.clike,V=X?.copyWith({color:Y})??new r({color:Y});if(!G)return[new l(J,V)];try{let K=J41(J,Z,`file.${Q}`),q=[];for(let W of K){let H=W.color??Y,z=X?.copyWith({color:H})??new r({color:H});q.push(new l(W.content,z))}return q.length>0?q:[new l(J,V)]}catch{return[new l(J,V)]}}var tW8=200;class f_1 extends p0{servers;onDismiss;constructor({servers:J,onDismiss:Q}){super();this.servers=J,this.onDismiss=Q}createState(){return new k76}}class k76 extends u0{scrollController;animationFrame=0;animationTimer=null;animationFrames=["∿","∾","∽","≋","≈","∼"];initState(){this.scrollController=new l5,this.scrollController.disableFollowMode(),this.scrollController.jumpTo(0),this.startAnimationIfNeeded()}didUpdateWidget(J){this.startAnimationIfNeeded()}dispose(){this.stopAnimation()}hasConnectingServers(){return this.widget.servers.some((J)=>J.status.type==="connecting"||J.status.type==="authenticating")}startAnimationIfNeeded(){let J=this.hasConnectingServers();if(J&&!this.animationTimer)this.animationTimer=setInterval(()=>{this.setState(()=>{this.animationFrame=(this.animationFrame+1)%this.animationFrames.length})},tW8);else if(!J&&this.animationTimer)this.stopAnimation()}stopAnimation(){if(this.animationTimer)clearInterval(this.animationTimer),this.animationTimer=null}build(J){let Z=H4.of(J).colorScheme,X=X6.of(J).app,G=S4.of(J),V=G.size.width,K=G.size.height,q=V-4,W=K-4,H=Math.max(40,Math.min(70,q)),z=this.widget.servers,U=0,D=0,M=0;for(let J1 of z)switch(J1.status.type){case"connected":U++;break;case"connecting":case"authenticating":D++;break;case"failed":case"denied":case"awaiting-approval":M++;break}let L=new r({color:Z.primary,bold:!0}),A=new r({color:Z.foreground}),E=new r({color:H1.index(10)}),I=new r({color:H1.blue}),P=new r({color:H1.index(9)}),R=new r({color:Z.foreground,dim:!0}),y=new r({color:X.keybind}),k=new r({color:Z.foreground,dim:!0}),v=[];for(let J1 of z)v.push(new y76({server:J1,animationFrame:this.animationFrame,animationFrames:this.animationFrames,serverNameStyle:A,connectedStyle:E,connectingStyle:I,failedStyle:P,errorStyle:R}));if(z.length===0)v.push(new W6({padding:H0.symmetric(2,1),child:new S1({text:new l("No MCP servers configured",new r({color:Z.foreground,dim:!0}))})}));let g=[];if(U>0)g.push(new l(`${U} connected`,E));if(D>0){if(g.length>0)g.push(new l(" · ",k));g.push(new l(`${D} connecting`,I))}if(M>0){if(g.length>0)g.push(new l(" · ",k));g.push(new l(`${M} failed`,P))}let d=new W5({autofocus:!0,controller:this.scrollController,child:new b0({constraints:new A6(H-4,H-4,0,Number.POSITIVE_INFINITY),child:new x0({crossAxisAlignment:"start",mainAxisSize:"min",children:v})})}),b=[new l("MCP Servers",L)];if(g.length>0)b.push(new l(" ",void 0)),b.push(...g);let a=new W6({padding:H0.only({left:2,right:2,top:1,bottom:1}),child:new S1({text:new l(void 0,void 0,b)})}),G1=new W6({padding:H0.horizontal(1),child:new S1({text:new l("─".repeat(H-4),new r({color:Z.foreground,dim:!0}))})}),t=new W6({padding:H0.only({left:2,right:2,bottom:1}),child:new S1({text:new l(void 0,k,[new l("Press ",k),new l("Esc",y),new l(" to close",k)])})}),c=new x0({crossAxisAlignment:"stretch",children:[a,G1,new c6({child:d}),G1,t]});return new C4({child:new b0({constraints:new A6(H,H,0,W),decoration:{color:Z.background,border:F4.all(new G4(Z.primary,1,"rounded"))},child:c})})}}class y76 extends I6{server;animationFrame;animationFrames;serverNameStyle;connectedStyle;connectingStyle;failedStyle;errorStyle;constructor(J){super();this.server=J.server,this.animationFrame=J.animationFrame,this.animationFrames=J.animationFrames,this.serverNameStyle=J.serverNameStyle,this.connectedStyle=J.connectedStyle,this.connectingStyle=J.connectingStyle,this.failedStyle=J.failedStyle,this.errorStyle=J.errorStyle}build(J){let Q=this.server.status,Z=[],Y,X,G,V;switch(Q.type){case"connected":Y="✓",X=this.connectedStyle,G="connected",V=this.connectedStyle;break;case"connecting":Y=this.animationFrames[this.animationFrame]??"∿",X=this.connectingStyle,G="connecting",V=this.connectingStyle;break;case"authenticating":Y=this.animationFrames[this.animationFrame]??"∿",X=this.connectingStyle,G="authenticating",V=this.connectingStyle;break;case"failed":Y="✗",X=this.failedStyle,G="failed",V=this.failedStyle;break;case"denied":Y="✗",X=this.failedStyle,G="denied",V=this.failedStyle;break;case"awaiting-approval":Y="?",X=new r({color:H1.yellow}),G="awaiting approval",V=new r({color:H1.yellow});break;default:Y="·",X=this.errorStyle,G="unknown",V=this.errorStyle}let K=new B6({children:[new S1({text:new l(Y,X),maxLines:1}),Q5.horizontal(2),new c6({child:new S1({text:new l(this.server.name,this.serverNameStyle),maxLines:1})}),new S1({text:new l(G,V),maxLines:1})]});if(Z.push(new W6({padding:H0.horizontal(2),child:K})),Q.type==="failed"){let q=this.formatErrorMessage(Q.error.message);Z.push(new W6({padding:H0.only({left:5,right:2}),child:new S1({text:new l(`└─ ${q}`,this.errorStyle),maxLines:2})}))}return Z.push(new Q0({height:1})),new x0({crossAxisAlignment:"stretch",mainAxisSize:"min",children:Z})}formatErrorMessage(J){let Z=J.replace(/\n/g," ").trim();if(Z.length>60)Z=Z.substring(0,57)+"...";return Z}}O8();Rt();U0();i0();var Ig=!1;class h_1 extends p0{props;constructor(J){super();this.props=J}createState(){return new x76}}class x76 extends u0{showCosts=Ig;showDetailedCosts=Ig;subscription=null;initState(){super.initState(),this.subscription=y8(l41(this.widget.props.configService).pipe(g5((J)=>J!=="pending")),this.widget.props.configService.config).pipe(Q6(([J,Q])=>{let Z=i41(J)?J.user.email:"",Y=Z.toLowerCase().endsWith("@sourcegraph.com")||Z.toLowerCase().endsWith("@ampcode.com"),X=Ig||Y,G=Q.settings.showCosts??!0,V=Q.settings["internal.showDetailedCosts"]??!1,K=G,q=X&&V;return x.debug("CostDisplayProvider computed costs",{email:Z,isTeammate:Y,isEligibleForDetailedCosts:X,showCostsSetting:G,showDetailedCostsSetting:V,computedShowCosts:K,computedShowDetailedCosts:q}),{showCosts:K,showDetailedCosts:q}}),U4((J,Q)=>J.showCosts===Q.showCosts&&J.showDetailedCosts===Q.showDetailedCosts)).subscribe((J)=>{x.debug("CostDisplayProvider setState called",{previousShowCosts:this.showCosts,previousShowDetailedCosts:this.showDetailedCosts,newShowCosts:J.showCosts,newShowDetailedCosts:J.showDetailedCosts}),this.setState(()=>{this.showCosts=J.showCosts,this.showDetailedCosts=J.showDetailedCosts})})}dispose(){this.subscription?.unsubscribe(),this.subscription=null,super.dispose()}build(J){return new e81({showCosts:this.showCosts,showDetailedCosts:this.showDetailedCosts,child:this.widget.props.child})}}class e81 extends zJ{showCosts;showDetailedCosts;constructor({showCosts:J,showDetailedCosts:Q,child:Z}){super({child:Z});this.showCosts=J,this.showDetailedCosts=Q}updateShouldNotify(J){return this.showCosts!==J.showCosts||this.showDetailedCosts!==J.showDetailedCosts}}function J91(J){let Q=J.dependOnInheritedWidgetOfExactType(e81);if(Q)return Q.widget.showCosts;return Ig}function Pg(J){let Q=J.dependOnInheritedWidgetOfExactType(e81);if(Q)return Q.widget.showDetailedCosts;return Ig}class b_1 extends p0{markdown;defaultColor;textAlign;maxLines;overflow;constructor({key:J,markdown:Q,defaultColor:Z=H1.default(),textAlign:Y="left",maxLines:X,overflow:G="clip"}){super(J?{key:J}:{});this.markdown=Q,this.defaultColor=Z,this.textAlign=Y,this.maxLines=X,this.overflow=G}createState(){return new v76}}class v76 extends u0{animationOffset=0;isAnimating=!1;intervalId;animationTimeoutId;targetPhrase="You're absolutely right";initState(){if(super.initState(),this.widget.markdown.includes(this.targetPhrase))this.intervalId=setInterval(()=>{this.startRainbowAnimation()},3000)}cleanup=()=>{if(this.intervalId)clearInterval(this.intervalId),this.intervalId=void 0;if(this.animationTimeoutId)clearTimeout(this.animationTimeoutId),this.animationTimeoutId=void 0};dispose(){this.cleanup(),super.dispose()}startRainbowAnimation(){this.isAnimating=!0,this.animationOffset=0,this.setState(()=>{});let J=60,Q=0,Z=()=>{if(Q<J)this.animationOffset=Q/J,this.setState(()=>{}),Q++,this.animationTimeoutId=setTimeout(Z,33);else this.isAnimating=!1,this.setState(()=>{})};Z()}build(J){if(this.widget.markdown.indexOf(this.targetPhrase)===-1)return new Y7({markdown:this.widget.markdown,textAlign:this.widget.textAlign,maxLines:this.widget.maxLines,overflow:this.widget.overflow});let Y=new Y7({markdown:this.widget.markdown,textAlign:this.widget.textAlign,maxLines:this.widget.maxLines,overflow:this.widget.overflow}).build(J);if(!this.isAnimating)return Y;return this.applyRainbowToWidget(Y,this.widget.defaultColor)}applyRainbowToWidget(J,Q){if(J instanceof S1){let Z=this.applyRainbowToTextSpan(J.text,Q);return new S1({text:Z,textAlign:J.textAlign,maxLines:J.maxLines,overflow:J.overflow})}if("children"in J&&Array.isArray(J.children)){let Z=J,Y=Z.children.map((G)=>this.applyRainbowToWidget(G,Q));return new J.constructor({children:Y,...Z.mainAxisAlignment!==void 0&&{mainAxisAlignment:Z.mainAxisAlignment},...Z.crossAxisAlignment!==void 0&&{crossAxisAlignment:Z.crossAxisAlignment},...Z.mainAxisSize!==void 0&&{mainAxisSize:Z.mainAxisSize},...Z.crossAxisSize!==void 0&&{crossAxisSize:Z.crossAxisSize}})}return J}applyRainbowToTextSpan(J,Q){if(J.text&&J.text.includes(this.targetPhrase))return this.createRainbowSpansForText(J,Q);if(J.children&&J.children.length>0){let Z=J.children.map((Y)=>this.applyRainbowToTextSpan(Y,Q));return new l(J.text,J.style,Z,J.hyperlink)}return J}getSpanText(J){let Q=J.text||"";if(J.children)Q+=J.children.map((Z)=>this.getSpanText(Z)).join("");return Q}createRainbowSpansForText(J,Q){let Z=J.text||"",Y=Z.indexOf(this.targetPhrase);if(Y===-1)return J;let X=Z.slice(0,Y),G=Z.slice(Y+this.targetPhrase.length),V=[];if(X)V.push(new l(X,J.style||new r({color:Q})));if(V.push(...this.createAnimatedRainbowSpans(J.style||new r({color:Q}))),G)V.push(new l(G,J.style||new r({color:Q})));return new l(void 0,J.style,V,J.hyperlink)}createAnimatedRainbowSpans(J){let Q=[H1.red,H1.yellow,H1.green,H1.cyan,H1.blue,H1.magenta],Z=8,Y=this.targetPhrase.replace(/\s/g,"").length,X=Math.floor(this.animationOffset*(Y+8))-8,G=[],V=0;for(let K=0;K<this.targetPhrase.length;K++){let q=this.targetPhrase[K];if(q!==" "&&q!=="\t"&&q!==`
|
|
4769
4769
|
`){if(V>=X&&V<X+8){let W=(V-X)%Q.length;G.push(new l(q,J.copyWith({color:Q[W]})))}else G.push(new l(q,J));V++}else G.push(new l(q,J))}return G}}class LJ extends p0{controller;getScrollInfo;thickness;trackChar;thumbChar;showTrack;thumbColor;trackColor;constructor({key:J,controller:Q,getScrollInfo:Z,thickness:Y=1,trackChar:X="█",thumbChar:G="█",showTrack:V=!0,thumbColor:K,trackColor:q}){super(J?{key:J}:{});this.controller=Q,this.getScrollInfo=Z,this.thickness=Y,this.trackChar=X,this.thumbChar=G,this.showTrack=V,this.thumbColor=K,this.trackColor=q}createState(){return new f76}}class f76 extends u0{_dragStartY=null;_dragStartOffset=null;_isOverThumb=!1;_isPositionOverThumb(J){let{totalContentHeight:Q,viewportHeight:Z}=this.widget.getScrollInfo(),X=this.context.findRenderObject()?.size.height??0;if(X===0||Q<=Z)return!1;let G=this.widget.getScrollInfo(),V=Math.min(1,Z/Q),K=Math.max(1,X*V),q=Math.max(0,Math.min(1,G.scrollOffset/(Q-Z))),W=X-K,H=Math.max(0,W*q),z=H+K;return J>=H&&J<=z}_handleHover=(J)=>{let Q=this._isOverThumb;if(this._isOverThumb=this._isPositionOverThumb(J.localPosition.y),Q!==this._isOverThumb)this.setState()};_handleDrag=(J)=>{let{totalContentHeight:Q,viewportHeight:Z,scrollOffset:Y}=this.widget.getScrollInfo(),G=this.context.findRenderObject()?.size.height??0;if(G===0||Q<=Z)return;if(this._dragStartY===null)this._dragStartY=J.localPosition.y,this._dragStartOffset=Y;let V=J.localPosition.y-this._dragStartY,K=Math.min(1,Z/Q),q=Math.max(1,G*K),W=G-q;if(W<=0)return;let H=Q-Z,z=W/H,U=V/z,D=Math.max(0,Math.min(H,this._dragStartOffset+U));this.widget.controller.jumpTo(D)};_handleRelease=()=>{this._dragStartY=null,this._dragStartOffset=null};_handleClick=(J)=>{if(J.button!=="left")return;let Q=J.localPosition.y,{totalContentHeight:Z,viewportHeight:Y,scrollOffset:X}=this.widget.getScrollInfo(),V=this.context.findRenderObject()?.size.height??0;if(V===0||Z<=Y)return;let K=Math.min(1,Y/Z),q=Math.max(1,V*K),W=Z-Y,H=V-q,z=Math.max(0,Math.min(1,X/(Z-Y))),U=Math.max(0,H*z),D=U+q;if(Q>=U&&Q<=D)return;if(Q<U)this.widget.controller.animateTo(Math.max(0,X-Y));else this.widget.controller.animateTo(Math.min(W,X+Y))};build(J){return new G8({onClick:this._handleClick,onHover:this._handleHover,onDrag:this._handleDrag,onRelease:this._handleRelease,cursor:this._isOverThumb?C9.POINTER:C9.DEFAULT,child:new h76({controller:this.widget.controller,getScrollInfo:this.widget.getScrollInfo,thickness:this.widget.thickness,trackChar:this.widget.trackChar,thumbChar:this.widget.thumbChar,showTrack:this.widget.showTrack,thumbColor:this.widget.thumbColor,trackColor:this.widget.trackColor})})}}class h76 extends nR{controller;getScrollInfo;thickness;trackChar;thumbChar;showTrack;thumbColor;trackColor;constructor({key:J,controller:Q,getScrollInfo:Z,thickness:Y=1,trackChar:X="█",thumbChar:G="█",showTrack:V=!0,thumbColor:K,trackColor:q}){super(J?{key:J}:{});this.controller=Q,this.getScrollInfo=Z,this.thickness=Y,this.trackChar=X,this.thumbChar=G,this.showTrack=V,this.thumbColor=K,this.trackColor=q}createRenderObject(){return new b76(this)}updateRenderObject(J){J.updateWidget(this)}}class b76 extends D4{_widget;constructor(J){super();this._widget=J}updateWidget(J){this._widget=J,this.markNeedsLayout()}performLayout(){let J=this._lastConstraints;A4(!!J,"performLayout called without constraints");let Q=Math.min(J.maxWidth,this._widget.thickness),Z=J.maxHeight;this.setSize(Q,Z),super.performLayout()}getMinIntrinsicWidth(J){return this._widget.thickness}getMaxIntrinsicWidth(J){return this._widget.thickness}getMinIntrinsicHeight(J){return 0}getMaxIntrinsicHeight(J){return 0}paint(J,Q,Z){let{thumbStartFloat:Y,thumbSizeFloat:X,showScrollbar:G}=this._calculateScrollbarMetrics();if(!G)return;let V=this._widget.trackColor,K=this._widget.thumbColor,q=["▁","▂","▃","▄","▅","▆","▇","█"],W=Y,H=Y+X;for(let z=0;z<this.size.height;z++){let U="█",D=!0;if(z===Math.floor(W)){let M=1-(W-z),L=Math.floor(M*8);U=q[L]||"█",D=!1}else if(z===Math.floor(H)){let M=1-(H-z),L=Math.floor(M*8);U=q[L]||"█"}else if(z>W&&z<H)D=!1;J.setChar(Q,Z+z,U,{fg:K,bg:V,reverse:D},1)}}_calculateScrollbarMetrics(){let{totalContentHeight:J,viewportHeight:Q,scrollOffset:Z}=this._widget.getScrollInfo(),Y=this.size.height;if(J<=Q||Y<=0)return{thumbStartFloat:0,thumbSizeFloat:0,showScrollbar:!1};let X=Math.max(0,Math.min(1,Z/(J-Q))),G=Math.min(1,Q/J),V=Math.max(1,Y*G),K=Y-V;return{thumbStartFloat:Math.max(0,K*X),thumbSizeFloat:V,showScrollbar:!0}}}class x${state=[!0,!1,!0,!1,!0,!1,!0,!1];previousState=[];generation=0;maxGenerations=15;neighborMap=[[1,3,4,5,7],[0,2,4,5,6],[1,3,5,6,7],[0,2,4,6,7],[0,1,3,5,7],[0,1,2,4,6],[1,2,3,5,7],[0,2,3,4,6]];step(){let J=this.state.map((G,V)=>{let K=this.neighborMap[V].filter((q)=>this.state[q]).length;if(G)return K===2||K===3;return K===3||K===6}),Q=J.every((G,V)=>G===this.state[V]),Z=this.previousState.length>0&&J.every((G,V)=>G===this.previousState[V]);this.previousState=[...this.state],this.state=J,this.generation++;let Y=J.every((G)=>!G),X=J.filter((G)=>G).length;if(Q||Z||this.generation>=this.maxGenerations||Y||X<2){let G;do G=Array.from({length:8},()=>Math.random()>0.6);while(G.filter((V)=>V).length<3);this.state=G,this.previousState=[],this.generation=0}}toBraille(){let J=[0,1,2,6,3,4,5,7],Q=10240;for(let Z=0;Z<8;Z++)if(this.state[Z])Q|=1<<J[Z];return String.fromCharCode(Q)}}var eW8=/<[^>]+>/g,JH8=/<ENCRYPTED>[\s\S]*?<\/ENCRYPTED>/g,QH8=/<ID>[\s\S]*?<\/ID>/g,ZH8=/^#+\s+(.+)$/,YH8=/^\*\*(.+)\*\*$/;function XH8(J){let Q=J.split(`
|
|
4770
4770
|
`),Z=[],Y="",X=[];for(let G of Q){let V=G.trim(),K=V.match(ZH8),q=V.match(YH8),W=K&&K[1]||q&&q[1];if(W&&W.trim()){if(Y||X.length>0)Z.push({header:Y,content:X.join(`
|
|
4771
4771
|
`).trim()});Y=W.trim(),X=[]}else X.push(G)}if(Y||X.length>0)Z.push({header:Y,content:X.join(`
|
|
@@ -4813,7 +4813,7 @@ Ctrl-X, Y, Z to unlock`;if(U){let a=W.text.replace(/`([^`]+)`/g,"$1")+`
|
|
|
4813
4813
|
`,A)])}),k];if(!q&&!U&&W.url){let b=W.url.replace(/^https?:\/\//,"");g.push(new i5({uri:W.url,text:b,style:new r({color:Z.secondary,underline:!0})}))}if(y&&!U)g.push(y);let d=new Q0({width:40,child:new x0({crossAxisAlignment:"start",mainAxisSize:"min",children:g})});return C4.child(new B6({mainAxisAlignment:"center",crossAxisAlignment:"center",mainAxisSize:"min",children:[new hj1({width:Hk1,height:zk1,agentMode:this.widget.agentMode,glow:this._glow,t:H,fps:0,shockwaves:this._shockwaves,onShockwave:P,...V==="disabled"&&{seed:42}}),new Q0({width:2}),d]}))}}U0();O8();W4();H7();O8();i0();function MH8(J,Q){return`${J}:${Q}`}class Fk1{threadService;workers=new Map;threadsMap=new Map;subthreadsMap=new Map;mainThreadSubs=new Map;subthreadsSubs=new Map;workerStatusSubs=new Map;subthreadPatchSubs=new Map;mainThreadObservable;subthreadObservable;workerStatusObservable;emitMainThread=null;emitSubthread=null;emitWorkerStatus=null;constructor(J){this.threadService=J;this.mainThreadObservable=new t1((Q)=>{return this.emitMainThread=(Z)=>Q.next(Z),()=>{this.emitMainThread=null}}),this.subthreadObservable=new t1((Q)=>{return this.emitSubthread=(Z)=>Q.next(Z),()=>{this.emitSubthread=null}}),this.workerStatusObservable=new t1((Q)=>{return this.emitWorkerStatus=(Z)=>Q.next(Z),()=>{this.emitWorkerStatus=null}})}registerWorker(J){let Q=J.thread.id;if(this.workers.has(Q))this.unregisterWorker(Q);this.threadsMap.set(Q,J.thread),this.subthreadsMap.set(Q,[]),this.workers.set(Q,{state:"initial"});let Z=this.threadService.observePatches(Q).pipe(XM()).subscribe((G)=>{this.threadsMap.set(Q,G);let V=this.subthreadsMap.get(Q)||[],K=this.workers.get(Q)||{state:"initial"};if(this.emitMainThread)this.emitMainThread({threadID:Q,mainThread:G,subthreads:V,workerStatus:K})});this.mainThreadSubs.set(Q,Z);let Y=J.status.subscribe((G)=>{if(this.workers.set(Q,G),this.emitWorkerStatus)this.emitWorkerStatus({threadID:Q,status:G})});this.workerStatusSubs.set(Q,Y);let X=J.subthreads.subscribe((G)=>{this.subthreadsMap.set(Q,G);for(let V of G){let K=MH8(Q,V.toolUse.id);if(this.subthreadPatchSubs.has(K))continue;let q=this.threadService.observePatches(V.threadID).pipe(XM()).subscribe((W)=>{if(this.emitSubthread)this.emitSubthread({threadID:Q,thread:W,subthread:V})});this.subthreadPatchSubs.set(K,q)}});this.subthreadsSubs.set(Q,X)}unregisterWorker(J){let Q=this.mainThreadSubs.get(J);if(Q)Q.unsubscribe(),this.mainThreadSubs.delete(J);let Z=this.workerStatusSubs.get(J);if(Z)Z.unsubscribe(),this.workerStatusSubs.delete(J);let Y=this.subthreadsSubs.get(J);if(Y)Y.unsubscribe(),this.subthreadsSubs.delete(J);for(let[X,G]of this.subthreadPatchSubs.entries())if(X.startsWith(`${J}:`))G.unsubscribe(),this.subthreadPatchSubs.delete(X);this.workers.delete(J),this.threadsMap.delete(J),this.subthreadsMap.delete(J)}observeThread(J){return{mainThread:new t1((Q)=>{return this.mainThreadObservable.subscribe((Z)=>{if(Z.threadID===J)Q.next(Z)})}),subthreads:new t1((Q)=>{return this.subthreadObservable.subscribe((Z)=>{if(Z.threadID===J)Q.next(Z)})}),workerStatus:new t1((Q)=>{return this.workerStatusObservable.subscribe((Z)=>{if(Z.threadID===J)Q.next(Z)})})}}get threadViewStates(){let J={};for(let[Q,Z]of this.threadsMap){let Y=this.workers.get(Q);if(Y)J[Q]=XA(Z,Y)}return J}dispose(){for(let J of this.mainThreadSubs.values())J.unsubscribe();for(let J of this.subthreadsSubs.values())J.unsubscribe();for(let J of this.workerStatusSubs.values())J.unsubscribe();for(let J of this.subthreadPatchSubs.values())J.unsubscribe();this.mainThreadSubs.clear(),this.subthreadsSubs.clear(),this.workerStatusSubs.clear(),this.subthreadPatchSubs.clear(),this.workers.clear(),this.threadsMap.clear(),this.subthreadsMap.clear()}}function LH8(J,Q){switch(Q.type){case"subthread-patch":{let{thread:Z,subthread:Y}=Q,X=J.subagents[Y.threadID];if(!X){if(X={subThreadID:Z.id,parentToolID:Y.toolUse.id,taskDescription:Y.toolUse.input.description||"Task",isCompleted:!1,agentState:{type:"idle"}},J.mainThread){let W=pJ(J.mainThread);X.isCompleted=x36(W,Y.toolUse.id)}}let G=AH8(Z,X.agentState),V=X.agentState===G?X:{...X,agentState:G},K={...J.tools},q=RC(Z).items.filter((W)=>W.type==="toolResult");for(let W of q)K[W.id]={id:W.id,subthreadID:Z.id,toolRun:W.toolResult.run,toolUse:W.toolUse};return{subagents:{...J.subagents,[Y.threadID]:V},tools:K,items:J.items,viewState:J.viewState,todosList:J.todosList,mainThread:J.mainThread}}case"main-thread-patch":{let{thread:Z,subthreads:Y,workerStatus:X}=Q,G=pJ(Z),V={...J.subagents};for(let z of Y){let U=V[z.threadID];if(!U)continue;let D=x36(G,z.toolUse.id);V[z.threadID]={...U,isCompleted:D}}let{items:K}=RC(Z),q=XA(Z,X),W=aE({messages:Z.messages}),H=Array.isArray(W)?W:[];return{...J,subagents:V,items:K,viewState:q,todosList:H,mainThread:Z}}case"worker-status-change":{if(!J.mainThread)return J;let Z=XA(J.mainThread,Q.workerStatus);if(Z===J.viewState)return J;return{...J,viewState:Z}}default:return J}}function RC(J){let Q=[],Z=new Map,Y=new Set;for(let[X,G]of J.messages.entries()){let V=`${G.role}-${X}`;switch(G.role){case"assistant":{let K=G.state.type==="streaming";for(let W of G.content)if(W.type==="tool_use"){if(Z.set(W.id,W),K)Y.add(W.id)}if(G.content.some((W)=>W.type==="text"&&W.text.trim()||W.type==="thinking"))Q.push({type:"message",id:V,message:G});for(let W of G.content)if(W.type==="tool_use"){let H=!1;for(let z=X+1;z<J.messages.length;z++){let U=J.messages[z];if(U){for(let D of U.content)if(D.type==="tool_result"&&D.toolUseID===W.id){H=!0;break}}if(H)break}if(!H)Q.push({type:"toolResult",id:W.id,toolUse:W,toolResult:{type:"tool_result",toolUseID:W.id,run:{status:K?"in-progress":"queued"}}})}break}case"info":Q.push({type:"message",id:V,message:G});break;case"user":{let K=G.content.some((q)=>q.type==="text"&&q.text.trim()||q.type==="image");for(let q of G.content)if(q.type==="tool_result"){let W=Z.get(q.toolUseID)??MY(J,q.toolUseID);if(!W)throw Error(`(bug) tool use ${q.toolUseID} not found`);Q.push({type:"toolResult",id:q.toolUseID,toolUse:W,toolResult:q})}if(K)Q.push({type:"message",id:V,message:G});break}}}return{items:Q}}function x36(J,Q){let Z=J.get(Q);return(Z&&q3(Z.run))??!1}function AH8(J,Q){let Z=J.messages.at(-1);if(Z?.content.some((X)=>X.type==="tool_result"&&X.run.status==="blocked-on-user"))return x.info("Subagent status: idle (blocked-on-user)",{threadID:J.id}),{type:"idle"};if(RC(J).items.some((X)=>X.type==="toolResult"&&X.toolResult.run.status==="in-progress")){let X=Q?.type==="running-tools"?Q.startTime:Date.now();return x.info("Subagent status: running-tools",{threadID:J.id,startTime:X,hasStartTime:!!X}),{type:"running-tools",startTime:X}}if(Z&&Z.role==="assistant"&&Z.state.type==="streaming")switch(Z.content.at(-1)?.type){case"text":return x.info("Subagent status: streaming-text",{threadID:J.id}),{type:"streaming-text"};case"thinking":return x.info("Subagent status: streaming-thinking",{threadID:J.id}),{type:"streaming-thinking"};case"tool_use":{let G=Q?.type==="running-tools"?Q.startTime:Date.now();return x.info("Subagent status: running-tools (streaming tool_use)",{threadID:J.id,startTime:G,hasStartTime:!!G}),{type:"running-tools",startTime:G}}default:return x.info("Subagent status: streaming-text (default)",{threadID:J.id}),{type:"streaming-text"}}return x.info("Subagent status: idle (default)",{threadID:J.id}),{type:"idle"}}class Uk1 extends p0{props;constructor(J){super();this.props=J}createState(){return new v36}}class v36 extends u0{state={subagents:{},tools:{},items:[],viewState:{state:"initial",interactionState:!1,toolState:{running:0,blocked:0}},todosList:[],mainThread:null};workerController;subscriptions=[];recentThreadIDs=[];currentWorker;constructor(){super();this.workerController=null,this.currentWorker=null}addToRecentThreads(J){this.setState(()=>{let Q=this.recentThreadIDs.indexOf(J);if(Q!==-1)this.recentThreadIDs.splice(Q,1);if(this.recentThreadIDs.unshift(J),this.recentThreadIDs.length>50)this.recentThreadIDs.pop()})}initState(){let{threadService:J,worker:Q}=this.widget.props;this.workerController=new Fk1(J),this.currentWorker=Q,this.setupSubscriptions(Q),this.addToRecentThreads(Q.thread.id)}dispose(){this.cleanup()}didUpdateWidget(J){if(J.props.threadService!==this.widget.props.threadService||J.props.worker!==this.widget.props.worker)this.cleanup(),this.setupSubscriptions(this.widget.props.worker)}setupSubscriptions(J){this.workerController.registerWorker(J);let Q=this.workerController.observeThread(J.thread.id),Z=Q.mainThread.subscribe((G)=>{this.dispatch({type:"main-thread-patch",thread:G.mainThread,subthreads:G.subthreads,workerStatus:G.workerStatus})});this.subscriptions.push(Z);let Y=Q.subthreads.subscribe((G)=>{this.dispatch({type:"subthread-patch",thread:G.thread,subthread:G.subthread})});this.subscriptions.push(Y);let X=Q.workerStatus.subscribe((G)=>{this.dispatch({type:"worker-status-change",workerStatus:G.status})});this.subscriptions.push(X)}cleanup(){this.subscriptions.forEach((J)=>J.unsubscribe()),this.subscriptions=[]}switchWorker(J){this.cleanup(),this.setState(()=>{this.currentWorker=J}),this.setState(()=>{this.state={subagents:{},tools:{},items:[],viewState:{state:"initial",interactionState:!1,toolState:{running:0,blocked:0}},todosList:[],mainThread:null}}),this.setupSubscriptions(J),this.addToRecentThreads(J.thread.id)}dispatch(J){this.setState(()=>{this.state=LH8(this.state,J)})}getThreadData(){let J=Object.values(this.state.tools).map((G)=>({toolUse:G.toolUse,toolRun:G.toolRun,subthreadID:G.subthreadID})),Q={};for(let G of Object.values(this.state.subagents)){let V=J.filter((K)=>K.subthreadID===G.subThreadID);Q[G.parentToolID]=V}let Z=(G)=>G===A5||G===a8||G===DY,Y=new Map;for(let G of this.state.items)if(G.type==="toolResult"&&Z(G.toolUse.name))Y.set(G.toolUse.id,{toolUseId:G.toolUse.id,toolName:G.toolUse.name,toolRun:G.toolResult.run});let X=Array.from(Y.values());for(let{toolUseId:G,toolRun:V}of X){let K=[],q;if(V.status==="in-progress"||V.status==="done"||V.status==="error"||V.status==="cancelled")q=V.progress;if(q){let W=0;for(let H of q)if(H.tool_uses)for(let z of H.tool_uses){let U=`${G}:progress:${W++}`;K.push({toolUse:lE(z.tool_name,z.input,U),toolRun:{status:z.status}})}}Q[G]=K}return{...this.state,subagents:Object.values(this.state.subagents),subagentActiveTools:J,subagentToolsByParentID:Q}}build(J){let Q=this.getThreadData();return this.widget.props.builder(J,Q,this.workerController,(Z)=>this.switchWorker(Z),()=>this.currentWorker,this.recentThreadIDs)}}class Bk1 extends p0{props;constructor(J){super({key:J.key});this.props=J}createState(){return new f36}}class f36 extends u0{build(J){let Z=X6.of(J).colors,{todos:Y,title:X="TODOs"}=this.widget.props;if(!Array.isArray(Y)||Y.length===0)return new Q0({width:0,height:0});let G=Y.map((V)=>this.buildTodoItem(V,Z));return new b0({child:new W6({padding:H0.symmetric(1,0),child:new x0({crossAxisAlignment:"stretch",mainAxisSize:"min",children:[new S1({text:new l(X,new r({bold:!0,color:Z.foreground}))}),...G]})})})}buildTodoItem(J,Q){let Z=this.getStatusIcon(J.status),Y=J.status==="completed",X=new r({bold:J.status==="in-progress",color:Q.foreground,dim:Y}),G=new r({bold:J.status==="in-progress",strikethrough:J.status==="completed",color:Q.foreground,dim:Y});return new B6({crossAxisAlignment:"start",children:[new S1({text:new l(Z,X)}),new Q0({width:1}),new c6({child:new S1({text:new l(J.content,G)})})]})}getStatusIcon(J){return J==="completed"?"✓":"•"}}class Nk1 extends I6{ad;onDismiss;onButtonClick;constructor({key:J,ad:Q,onDismiss:Z,onButtonClick:Y}){super({key:J});this.ad=Q,this.onDismiss=Z,this.onButtonClick=Y}build(J){let Q=X6.of(J),Z=Q.colors.primary,Y=Q.colors.foreground;return new b0({decoration:new N8(void 0,new F4(new G4(Z,1,"rounded"),new G4(Z,1,"rounded"),void 0,new G4(Z,1,"rounded"))),child:new W6({padding:H0.horizontal(1),child:new x0({children:[new B6({crossAxisAlignment:"start",children:[new c6({child:new S1({text:new l(this.ad.content,new r({color:Y}))})}),new Q0({width:4}),new i5({uri:"https://ampcode.com/free",text:"Ad",style:new r({color:Y,dim:!0})})]}),new B6({crossAxisAlignment:"start",children:[new aj1({text:this.ad.buttonLabel,onPressed:()=>this.onButtonClick?.(),padding:H0.horizontal(1),color:Z,reverse:!0}),new Q0({width:2}),new S1({text:new l(this.ad.destinationUrlHostname,new r({color:Y,dim:!0}))})]})]})})})}}class Dk1 extends p0{props;constructor(J){super();this.props=J}createState(){return new h36(this.props.autofocus??!0)}}class h36 extends u0{autofocus;constructor(J){super();this.autofocus=J}build(J){let Q=(K)=>{if(K.key==="Enter"&&this.widget.props.showCopyOption)return this.widget.props.onSelect("copy"),"handled";if(K.ctrlKey&&K.key==="c"||K.key==="Escape")return this.widget.props.onSelect(null),"handled";return"ignored"},Z=S4.sizeOf(J),Y=Math.min(60,Z.width-4),X=Z.height-4,G=[];if(this.widget.props.title)G.push(new S1({text:new l(this.widget.props.title,new r({bold:!0,color:H1.blue}))}),new Q0({height:1}));if(this.widget.props.message)G.push(new S1({text:new l(this.widget.props.message,void 0,void 0,{uri:this.widget.props.message,id:"ad-link"})}));if(this.widget.props.message)G.push(new Q0({height:1}));let V=[];if(this.widget.props.showCopyOption)V.push(new S1({text:new l("Enter to copy",new r({dim:!0}))}));return V.push(new S1({text:new l("Escape to close",new r({dim:!0}))})),G.push(new B6({children:V.flatMap((K,q)=>q<V.length-1?[K,new Q0({width:1}),new S1({text:new l("•",new r({dim:!0}))}),new Q0({width:1})]:[K]),mainAxisSize:"min"})),new C4({child:new b0({constraints:new A6(Y,Y,0,X),decoration:new N8(H1.default(),new F4(new G4(H1.blue,1,"rounded"),new G4(H1.blue,1,"rounded"),new G4(H1.blue,1,"rounded"),new G4(H1.blue,1,"rounded"))),padding:new H0(2,2,2,2),child:new z8({autofocus:this.autofocus,onKey:Q,child:new x0({children:G,mainAxisSize:"min"})})})})}}class D91 extends Error{constructor(J="Command timed out"){super(J);this.name="CommandTimeoutError",Object.setPrototypeOf(this,D91.prototype)}}class M91 extends Error{constructor(J){let Q=`${J.noun}: ${J.verb} command cancelled`;super(Q);this.name="CommandCancelledError",Object.setPrototypeOf(this,M91.prototype)}}function Mk1(J){let Q=J.match(/"([^"]*)"|'([^']*)'|([^\s"']+)/g);if(!Q)return[];return Q.map((Z)=>{if(Z.startsWith('"')&&Z.endsWith('"')||Z.startsWith("'")&&Z.endsWith("'"))return Z.slice(1,-1);return Z})}sW();U0();import{spawn as OH8}from"node:child_process";import{promises as wH8}from"node:fs";function b36(J){return J.kind==="executable"}function m36(J){return J.kind==="markdown"}var qz=50000,g36=300000;async function Lk1(J,Q,Z,Y={}){let{timeoutMs:X=g36,signal:G,source:V}=Y;try{let K=await Z.getCommand(J,V);if(!K)return{success:!1,output:"",error:`Command '${J}' not found`};if(!await Z.isCommandAvailable(J,V))return{success:!1,output:"",error:`Command '${J}' is not available for execution`};if(x.debug("Executing command",{commandName:J,filePath:K.filePath,args:Q}),m36(K))return await EH8(K,Q);else if(b36(K))return await IH8(K,Q,X,G);else return{success:!1,output:"",error:"Unsupported command type"}}catch(K){return x.error("Failed to execute command",{commandName:J,error:K}),{success:!1,output:"",error:K instanceof Error?K.message:"Unknown error occurred"}}}async function EH8(J,Q){try{if(Q.length>0)return{success:!1,output:"",error:"Markdown commands do not accept arguments"};let Z=await wH8.readFile(J.filePath,"utf8");return{success:!0,output:(Z.length>qz?Z.slice(0,qz)+`
|
|
4814
4814
|
... (output truncated at ${qz} characters)`:Z).trim(),exitCode:0}}catch(Z){return{success:!1,output:"",error:Z instanceof Error?Z.message:"Failed to read markdown file"}}}async function IH8(J,Q,Z=g36,Y){return new Promise((X)=>{let[G,V]=PH8(J,Q);x.debug("Spawning command",{spawnCommand:G,spawnArgs:V.slice(0,10),filePath:J.filePath,timeoutMs:Z});let K=iO0(Y),q=!1,W=setTimeout(()=>{q=!0,K.abort(),x.warn("Command execution timed out",{commandName:J.name,timeoutMs:Z})},Z),H=OH8(G,V,{stdio:["pipe","pipe","pipe"],signal:K.signal,detached:!0}),z=[],U=[],D=0;H.stdout?.on("data",(M)=>{let L=M.toString();if(D+=L.length,D<=qz)z.push(L);else{let A=qz-(D-L.length);if(A>0)z.push(L.slice(0,A))}}),H.stderr?.on("data",(M)=>{let L=M.toString();if(D+=L.length,D<=qz)U.push(L);else{let A=qz-(D-L.length);if(A>0)U.push(L.slice(0,A))}}),H.on("close",(M)=>{if(clearTimeout(W),q){X({success:!1,output:z.join(""),error:`Command timed out after ${Z}ms`,exitCode:void 0});return}if(K.signal.aborted){X({success:!1,output:z.join(""),error:"The command was aborted",exitCode:M??void 0});return}let L=M===0||M===1,A=z.join(""),E=U.join(""),I=A;if(!L&&!A.trim()&&E.trim())I=E;else if(E.trim())I+=A?`
|
|
4815
4815
|
${E}`:E;if(D>qz)I+=`
|
|
4816
|
-
... (output truncated at ${qz} characters)`;X({success:L,output:I.trim(),error:!L?E.trim()||"Command failed":void 0,exitCode:M??void 0})}),H.on("error",(M)=>{clearTimeout(W);let L=M.message;if(q)L=`Command timed out after ${Z}ms`;else if(M.message.includes("operation was aborted")||M.name==="AbortError")L="The command was aborted";X({success:!1,output:z.join(""),error:L})})})}function PH8(J,Q){let{filePath:Z,interpreter:Y,extension:X}=J;if(process.platform==="win32")return RH8(Z,Y?[...Y]:null,X,Q);else return TH8(Z,Y?[...Y]:null,X,Q)}function TH8(J,Q,Z,Y){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...Y]];else return[J,Y]}function RH8(J,Q,Z,Y){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...Y]];switch(Z.toLowerCase()){case".bat":case".cmd":return["cmd.exe",["/c",J,...Y]];case".ps1":return["powershell.exe",["-ExecutionPolicy","Bypass","-File",J,...Y]];case".exe":return[J,Y];default:return[J,Y]}}U0();EG();T7();LK();SZ();cG();tW();dK();O8();H7();j_();i0();var U26=q6(jP(),1);import{writeFile as z26}from"fs/promises";import uq from"path";U0();SZ();class Ak1{enabled;configService;commandCounts=new Map;timer=null;bufferTimeMs=1e4;constructor(J,Q){this.enabled=J;this.configService=Q;this.startTimer()}startTimer(){this.timer=setInterval(()=>{this.flushEvents()},this.bufferTimeMs)}async flushEvents(){if(this.commandCounts.size===0||!await this.enabled())return;let J=Array.from(this.commandCounts.entries()).map(([Q,Z])=>({feature:"cli.command",action:Q,source:{client:"cli",clientVersion:"0.0.1765512638-g55c240"},parameters:{metadata:{count:Z}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Ro(Q,this.configService)}catch(Q){x.error("Failed to export command telemetry events",Q)}}async submit(J){if(!await this.enabled()||this.timer===null)return;let Q=this.commandCounts.get(J)||0;this.commandCounts.set(J,Q+1)}async dispose(){if(await this.flushEvents(),this.timer!==null)clearInterval(this.timer),this.timer=null}}class HO extends p0{props;constructor(J){super();this.props=J}createState(){return new u36}}class u36 extends u0{_state;initState(){super.initState(),this._state=this.widget.props.initialState}build(J){let Q=(Z)=>{this.setState(()=>{this._state=Z(this._state)})};return this.widget.props.builder(J,Q,this._state)}}class p36 extends u0{controller=new nZ;focusNode=new $8({debugLabel:"CommandArgumentPrompt",onKey:(J)=>{if(J.key==="Escape")return this.widget.props.onDismiss(),"handled";return"ignored"}});_textListener=()=>{this.setState(()=>{})};initState(){this.focusNode.requestFocus(),this.controller.addListener(this._textListener)}dispose(){this.controller.removeListener(this._textListener),this.focusNode.dispose()}build(J){let Q=X6.of(J),{colors:Z,app:Y}=Q,X=this.widget.props.isRequiredArg??!0,G=this.controller.text.trim().length>0,V=!X||G,K=F4.all(new G4(Z.foreground,1,"solid")),q=new $z({controller:this.controller,focusNode:this.focusNode,placeholder:this.widget.props.placeholder??"Enter command argument...",onSubmitted:(D)=>{let M=D.trim();if(X&&M.length===0)return;this.widget.props.onSubmit(M)},autofocus:!0,style:{textColor:Z.foreground,border:null},maxLines:1}),W=new B6({children:[new b0({decoration:{color:H1.default()},child:new S1({text:new l(">",new r({color:Z.foreground}))})}),new c6({child:q})]}),H=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l("",void 0,[new l("Command: ",new r({color:Z.foreground})),new l(this.widget.props.commandName,new r({color:H1.yellow,bold:!0}))])})}),z=[];if(V)z.push(new l("Enter",new r({color:Y.keybind}))),z.push(new l(" to submit, ",new r({color:Z.foreground,dim:!0})));z.push(new l("Esc",new r({color:Y.keybind}))),z.push(new l(" to cancel",new r({color:Z.foreground,dim:!0})));let U=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l("",void 0,z)})});return new b0({decoration:{border:K,color:H1.default()},padding:H0.all(1),child:new x0({children:[H,new Q0({height:1}),W,new Q5,U]})})}}class Sg extends p0{props;constructor(J){super();this.props=J}createState(){return new p36}}tW();class d36 extends u0{controller=new nZ;imageAttachments=[];imagePaths=[];isConfirmingClearInput=!1;clearInputConfirmTimeout=null;focusNode=new $8({debugLabel:"CommandMultilinePrompt",onKey:(J)=>{if(J.key==="Escape"){if(this.isConfirmingClearInput){if(this.controller.clear(),this.setState(()=>{this.isConfirmingClearInput=!1,this.imageAttachments=[],this.imagePaths=[]}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;return"handled"}if(this.controller.text.trim()!==""||this.imageAttachments.length>0){if(this.setState(()=>{this.isConfirmingClearInput=!0}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout);return this.clearInputConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingClearInput=!1}),this.clearInputConfirmTimeout=null},1000),"handled"}return this.widget.props.onDismiss(),"handled"}return"ignored"}});initState(){if(this.widget.props.initialText)this.controller.text=this.widget.props.initialText;if(this.widget.props.initialImages)this.imageAttachments=[...this.widget.props.initialImages];this.focusNode.requestFocus()}_handleInsertImage=(J)=>{if(this.imageAttachments.length>=sF)return!1;let Q=HC(J);if(typeof Q==="object")return this.setState(()=>{this.imageAttachments=[...this.imageAttachments,Q],this.imagePaths=[...this.imagePaths,J]}),!1;return!1};_handlePopImage=()=>{if(this.imageAttachments.length>0)this.setState(()=>{this.imageAttachments=this.imageAttachments.slice(0,-1),this.imagePaths=this.imagePaths.slice(0,-1)})};dispose(){if(this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;this.focusNode.dispose(),this.controller.dispose()}build(J){let Q=X6.of(J),{colors:Z,app:Y}=Q,G=S4.of(J).size.height,V=Math.max(Math.floor(G*0.5),10),K=new WO({controller:this.controller,triggers:[new JN],completionBuilder:this.widget.props.completionBuilder,ampURL:this.widget.props.ampURL,onSubmitted:(D)=>{this.widget.props.onSubmit(D.trim(),this.imageAttachments)},theme:Z,placeholder:this.widget.props.placeholder||"Enter your message...",enabled:this.widget.props.enabled??!0,autofocus:!0,clipboard:h8.instance.tuiInstance.clipboard,showMenuBelow:!0,onInsertImage:this.widget.props.onInsertImage??this._handleInsertImage,imageAttachments:this.imageAttachments,popImage:this._handlePopImage}),q=new z8({focusNode:this.focusNode,child:K}),W=new b0({constraints:new A6({maxHeight:V}),padding:H0.symmetric(1,0),child:q}),H=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l("",void 0,[new l("Command: ",new r({color:Z.foreground})),new l(this.widget.props.commandName,new r({color:H1.yellow,bold:!0}))])})}),z=new b0({padding:H0.symmetric(1,0),child:new S1({text:this.isConfirmingClearInput?new l("",void 0,[new l("Esc",new r({color:Y.keybind})),new l(" again to clear input",new r({color:Z.foreground,dim:!0}))]):new l("",void 0,[new l("Press ",new r({color:Z.foreground,dim:!0})),new l("Enter",new r({color:Y.keybind})),new l(" to submit, ",new r({color:Z.foreground,dim:!0})),new l("Esc",new r({color:Y.keybind})),new l(" to clear",new r({color:Z.foreground,dim:!0}))])})}),U=[H,new Q0({height:1}),new c6({child:W}),new Q0({height:1}),z];return new b0({decoration:{border:F4.all(new G4(Z.foreground,1,"solid")),color:H1.default()},padding:H0.all(1),child:new x0({children:U})})}}class CC extends p0{props;constructor(J){super();this.props=J}createState(){return new d36}}import{isDeepStrictEqual as _H8}from"node:util";var CH8=/[\\/_ +.#"@[({&]/,jH8=/[\\/_ +.#"@[({&]/g,SH8=/[\s-]/,c36=/[\s-]/g;function A91(J,Q,Z,Y,X,G,V){if(G===Q.length){if(X===J.length)return 1;return 0.99}let K=`${X},${G}`;if(V[K]!==void 0)return V[K];let q=Y.charAt(G),W=Z.indexOf(q,X),H=0,z,U,D,M;while(W>=0){if(z=A91(J,Q,Z,Y,W+1,G+1,V),z>H){if(W===X)z*=1;else if(SH8.test(J.charAt(W-1))){if(z*=0.9,M=J.slice(X,W-1).match(c36),M&&X>0)z*=Math.pow(0.999,M.length)}else if(CH8.test(J.charAt(W-1))){if(z*=0.8,D=J.slice(X,W-1).match(jH8),D&&X>0)z*=Math.pow(0.999,D.length)}else if(z*=0.3,X>0)z*=Math.pow(0.999,W-X);if(J.charAt(W)!==Q.charAt(G))z*=0.9999}if(z<0.1&&(Z.charAt(W-1)===Y.charAt(G+1)||Y.charAt(G+1)===Y.charAt(G)&&Z.charAt(W-1)!==Y.charAt(G))){if(U=A91(J,Q,Z,Y,W+1,G+2,V),U*0.1>z)z=U*0.1}if(z>H)H=z;W=Z.indexOf(q,W+1)}return V[K]=H,H}function L91(J){return J.toLowerCase().replace(c36," ")}function l36(J,Q){let Z=A91(J,Q,L91(J),L91(Q),0,0,{}),Y=Q.trim().split(/\s+/);if(Y.length>1){let X=0,G=0;for(let K of Y){let q=A91(J,K,L91(J),L91(K),0,0,{});if(q===0)return Z;X+=q,G+=K.length}let V=X/Y.length*0.95;return Math.max(Z,V)}return Z}class jC{}class SC{}class O91{}class w91{}class i36 extends p0{child;onContext;constructor(J,Q){super();this.child=J;this.onContext=Q}createState(){return new n36}}class n36 extends u0{build(J){return this.widget.onContext(J),this.widget.child}}function kH8(J,Q){if(J==="")return{matches:!0,score:1};let Z=l36(Q,J);return{matches:Z>0.15,score:Z}}class h2 extends p0{props;debugLabel="FuzzyPicker";constructor(J){super();this.props=J}createState(){return new a36}}class a36 extends u0{controller=new nZ;focusNode;scrollController=new l5;selectedIndex=0;itemContexts=[];cachedQuery="";cachedItemsRef=null;cachedFiltered=[];initState(){this.scrollController.disableFollowMode(),this.focusNode=new $8({debugLabel:this.widget.debugLabel}),this.controller.addListener(()=>{this.selectedIndex=0,this.recomputeFilteredItems(),this.setState(),S8.instance.addPostFrameCallback(()=>{this.ensureSelectedItemVisible()});let Q=this.cachedFiltered;this.widget.props.onSelectionChange?.(Q[0]??null)}),this.recomputeFilteredItems();let J=this.cachedFiltered;this.widget.props.onSelectionChange?.(J[0]??null),this.ensureSelectedItemVisible()}didUpdateWidget(J){if(!_H8(J.props.items,this.widget.props.items)){this.recomputeFilteredItems(),this.ensureSelectedItemVisible();let Q=this.cachedFiltered;this.widget.props.onSelectionChange?.(Q[this.selectedIndex]??null)}}dispose(){this.widget.props.onSelectionChange?.(null),this.controller.dispose(),this.focusNode.dispose(),this.scrollController.dispose()}invoke=(J)=>{if(J instanceof jC){let Q=this.getFilteredItems();if(Q.length>0&&this.selectedIndex<Q.length-1)this.selectedIndex++,this.setState(),S8.instance.addPostFrameCallback(()=>{this.ensureSelectedItemVisible()}),this.widget.props.onSelectionChange?.(Q[this.selectedIndex]??null);return"handled"}if(J instanceof SC){let Q=this.getFilteredItems();if(Q.length>0&&this.selectedIndex>0)this.selectedIndex--,this.setState(),S8.instance.addPostFrameCallback(()=>{this.ensureSelectedItemVisible()}),this.widget.props.onSelectionChange?.(Q[this.selectedIndex]??null);return"handled"}if(J instanceof O91){let Q=this.getFilteredItems();if(Q.length>0&&this.selectedIndex<Q.length){let Z=Q[this.selectedIndex];if(Z){if(!(this.widget.props.isItemDisabled?.(Z)??!1))this.widget.props.onAccept(Z)}}return"handled"}if(J instanceof w91)return this.widget.props.onDismiss?.(),"handled";return"ignored"};recomputeFilteredItems(){let J=this.controller.text,Q=this.widget.props.items,Z=Q.filter((Y)=>!this.widget.props.filterItem||this.widget.props.filterItem(Y,J)).map((Y)=>({item:Y,...kH8(J,this.widget.props.getLabel(Y))})).filter((Y)=>Y.matches).sort(this.widget.props.sortItems?(Y,X)=>this.widget.props.sortItems(Y,X,J):(Y,X)=>X.score-Y.score).map((Y)=>Y.item);this.cachedQuery=J,this.cachedItemsRef=Q,this.cachedFiltered=this.widget.props.maxRenderItems?Z.slice(0,this.widget.props.maxRenderItems):Z}getFilteredItems(){let J=this.controller.text,Q=this.widget.props.items;if(this.cachedQuery===J&&this.cachedItemsRef===Q)return this.cachedFiltered;return this.recomputeFilteredItems(),this.cachedFiltered}ensureSelectedItemVisible(){let J=this.itemContexts[this.selectedIndex];if(!J)return;let Q=J.findRenderObject();if(!Q)return;let Z=0,Y=Q.size.height;N81(J,{top:Z,bottom:Y},{padding:1})}handleScroll=(J)=>{let Q=this.getFilteredItems();if(Q.length===0)return;if(J.direction==="down")if(this.selectedIndex<Q.length-1)this.selectedIndex++;else return;else if(this.selectedIndex>0)this.selectedIndex--;else return;this.setState(),S8.instance.addPostFrameCallback(()=>{this.ensureSelectedItemVisible()}),this.widget.props.onSelectionChange?.(Q[this.selectedIndex]??null)};handleItemClick=(J,Q)=>{let Z=this.getFilteredItems();if(J>=0&&J<Z.length){let Y=Z[J],X=Y?this.widget.props.isItemDisabled?.(Y)??!1:!1;if(Q===1)this.selectedIndex=J,this.setState(),this.widget.props.onSelectionChange?.(Z[this.selectedIndex]??null);else if(Q===2&&!X){if(Y)this.widget.props.onAccept(Y)}}};build(J){let Q=X6.of(J),{colors:Z}=Q,Y=this.getFilteredItems(),X=F4.all(new G4(Z.foreground,1,"solid")),G=this.widget.props.enabled??!0,V=new $z({controller:this.controller,focusNode:this.focusNode,autofocus:!0,enabled:G,style:{textColor:Z.foreground,border:null},maxLines:1}),K=new JX({shortcuts:new Map([[new X4("ArrowDown"),new jC],[new X4("ArrowUp"),new SC],[new X4("Tab"),new jC],[new X4("Tab",{shift:!0}),new SC],[new X4("n",{ctrl:!0}),new jC],[new X4("p",{ctrl:!0}),new SC],[new X4("Enter"),new O91],[new X4("Escape"),new w91]]),focusNode:this.focusNode,child:V}),q=new NJ({actions:new Map([[jC,new E8(this.invoke)],[SC,new E8(this.invoke)],[O91,new E8(this.invoke)],[w91,new E8(this.invoke)]]),child:K}),W=new B6({children:[new b0({decoration:{color:H1.default()},child:new S1({text:new l(">",new r({color:Z.foreground}))})}),new c6({child:q})]});this.itemContexts=[];let H;if(this.widget.props.isLoading){let L=this.widget.props.loadingText??"Loading...";H=new Q0({height:10,child:new C4({child:new S1({text:new l(L,new r({color:Z.foreground}))})})})}else if(Y.length===0&&this.widget.props.emptyStateText)H=new c6({child:new C4({child:new S1({text:new l(this.widget.props.emptyStateText,new r({color:Z.foreground,dim:!0}))})})});else{let L=Y.map((A,E)=>{let I=E===this.selectedIndex,P=this.widget.props.isItemDisabled?.(A)??!1,R;if(this.widget.props.renderItem)R=this.widget.props.renderItem(A,I,P,J);else{let y=I?H1.yellow:void 0,k=I?H1.black:Z.foreground;R=new b0({decoration:y?{color:y}:void 0,padding:H0.symmetric(2,0),child:new S1({text:new l(this.widget.props.getLabel(A),new r({color:k,dim:P}))})})}return new i36(new G8({onClick:(y)=>this.handleItemClick(E,y.clickCount),child:R}),(y)=>{this.itemContexts[E]=y})});H=new x0({children:L,crossAxisAlignment:"start"})}let z=new c6({child:new G8({onScroll:this.handleScroll,opaque:!1,child:new W5({controller:this.scrollController,autofocus:!1,child:H})})}),U=[];if(this.widget.props.title){let L=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l(this.widget.props.title,new r({color:H1.yellow,bold:!0}))})});U.push(L)}if(U.push(W,new Q0({height:1}),z),this.controller.text!==""){let L=Y.length>0?Y[this.selectedIndex]:void 0,A=L&&this.widget.props.buildDisabledReasonWidget?.(L);if(A)U.push(new b0({padding:H0.vertical(1),child:new C4({child:A})}));else U.push(new Q0({height:3}))}if(this.widget.props.footer)U.push(this.widget.props.footer);return new b0({decoration:{border:X,color:H1.default()},padding:H0.symmetric(1,0),child:new x0({children:U})})}}function o36(J){let Z=new Date().getTime()-J.getTime(),Y=Math.floor(Z/60000),X=Math.floor(Z/3600000),G=Math.floor(Z/86400000);if(Y<1)return"just now";if(Y<60)return`${Y}m ago`;if(X<24)return`${X}h ago`;if(G<7)return`${G}d ago`;return J.toLocaleDateString()}class Ok1 extends I6{props;debugLabel="NewsFeedPicker";constructor(J){super();this.props=J}build(J){let Q=[...this.props.entries].sort((X,G)=>G.pubDate.getTime()-X.pubDate.getTime()),Z=Math.max(0,...Q.map((X)=>o36(X.pubDate).length));return new h2({items:Q,getLabel:(X)=>X.title,onAccept:(X)=>this.props.onSelect?.(X),onDismiss:this.props.onDismiss,title:this.props.title,emptyStateText:"No news entries available",maxRenderItems:100,renderItem:(X,G,V,K)=>{let q=X6.of(K),{colors:W}=q,H=G?H1.yellow:void 0,z=G?H1.black:W.foreground,U=H1.index(8),D=(M,L)=>new Q0({width:L,child:B6.end([new S1({text:new l(M,new r({color:U}))})])});return new b0({decoration:H?{color:H}:void 0,padding:H0.symmetric(2,0),child:new B6({children:[new c6({child:new S1({text:new l(X.title,new r({color:z})),overflow:"ellipsis",maxLines:1})}),new Q0({width:2}),D(o36(X.pubDate),Z)]})})}})}}class wk1 extends p0{createState(){return new r36}}class r36 extends u0{isGreen=!0;timer;initState(){this.timer=setInterval(()=>{this.isGreen=!this.isGreen,this.setState()},700)}dispose(){if(this.timer)clearInterval(this.timer);super.dispose()}build(J){return new S1({text:new l("●",new r({color:this.isGreen?H1.green:H1.index(8),bold:!0})),maxLines:1})}}function yH8(J){let Q=new Map,Z=new Map,Y=new Map,X=[];for(let V of J)Q.set(V.id,V);for(let V of J){let K=V.parentRelationships.find((q)=>q.role==="child"&&Q.has(q.threadID)&&(q.type==="fork"||q.type==="handoff"));if(K){Y.set(V.id,K.type);let q=K.threadID,W=Z.get(q)||[];W.push(V),Z.set(q,W)}else X.push(V)}return QX.flatten(X,(V)=>Z.get(V.id)).map((V)=>({...V.item,depth:V.depth,isLast:V.isLast,ancestorsAreLast:V.ancestorsAreLast,relationshipType:Y.get(V.item.id)}))}function Ek1(J,Q,Z){return new S1({text:new l(`${J}${Q}`,new r({color:Z})),maxLines:1})}function xH8(J,Q,Z,Y){return[Ek1("+",J,Y.success),Q5.horizontal(1),Ek1("~",Q,Y.warning),Q5.horizontal(1),Ek1("-",Z,Y.destructive)]}class E91 extends I6{props;debugLabel="ThreadContinuationPicker";constructor(J){super();this.props=J}build(J){let Q=this.props.filterByWorkspace&&this.props.currentWorkspaceURI?this.props.threads.filter((z)=>z.workspaceURI===this.props.currentWorkspaceURI):this.props.threads;if(this.props.excludeCurrentThread&&this.props.currentThreadID)Q=Q.filter((z)=>z.id!==this.props.currentThreadID);let Z=this.props.recentThreadIDs||[],Y=new Set(Z),X=this.props.currentThreadID,G=[...Q].sort((z,U)=>{if(X){if(z.id===X)return-1;if(U.id===X)return 1}let D=Z.indexOf(z.id),M=Z.indexOf(U.id);if(D!==-1&&M!==-1)return D-M;if(D!==-1)return-1;if(M!==-1)return 1;return 0}),V=yH8(G),K=Math.max(0,...V.map((z)=>z.description.timeAgo.length)),q=X6.of(J),W=new W6({padding:H0.symmetric(0,1),child:new C4({child:new S1({text:new l("",new r({color:q.colors.foreground,dim:!0}),[new l("Ctrl+T",new r({color:H1.blue,dim:!0})),new l(this.props.filterByWorkspace?" for all workspaces":" to filter by workspace",new r({color:q.colors.foreground,dim:!0}))])})})});return new h2({items:V,getLabel:(z)=>z.title,onAccept:(z)=>this.props.onSelect?.(z.id),onDismiss:this.props.onDismiss,onSelectionChange:(z)=>{if(this.props.previewController){if(z)this.props.previewController.select(z.id)}},title:this.props.title,isLoading:this.props.isLoading,loadingText:"Loading threads...",emptyStateText:"No threads match your filter",maxRenderItems:200,footer:this.props.isLoading?void 0:W,renderItem:(z,U,D,M)=>{let L=X6.of(M),{colors:A}=L,E=U?H1.yellow:void 0,I=U?H1.black:A.foreground,P=H1.index(8),R=(t,c)=>new Q0({width:c,child:B6.end([new S1({text:new l(t,new r({color:P}))})])}),y=this.props.threadViewStates[z.id],k=[],v=z.relationshipType==="handoff",g=new E81;if(z.depth>0){let t=[],c=z.ancestorsAreLast.slice(1);for(let L1 of c)t.push(new l(g.getAncestorPrefix(L1),new r({color:g.connectorColor,dim:g.connectorDim})));let J1=z.isLast?g.elbow:g.tee,q1=g.getConnectorText(J1);t.push(new l(q1,new r({color:g.connectorColor,dim:g.connectorDim}))),k.push(new S1({text:new l("",void 0,t)}))}let d=[],b=X===z.id?new l("(current) ",new r({color:H1.green})):Y.has(z.id)?new l("(visited) ",new r({color:A.foreground,dim:!0})):null;if(b)d.push(new S1({text:b}));if(y){if(y.state==="active"&&(y.interactionState==="tool-running"||y.interactionState===!1))d.push(new wk1),d.push(new Q0({width:1}))}let a=z.title;if(z.relationshipType==="fork"){let t=a.match(/^Forked\((\d+)\): /);if(t)a=a.slice(t[0].length);else while(a.startsWith("Forked: "))a=a.slice(8);d.push(new S1({text:new l("[fork] ",new r({color:H1.blue}))}))}else if(v)d.push(new S1({text:new l("[handoff] ",new r({color:H1.index(208)}))}));if(z.agentMode==="plan"&&z.hasPlan)d.push(new S1({text:new l("[plan] ",new r({color:H1.magenta}))}));if(d.push(new c6({child:new S1({text:new l(a,new r({color:I})),overflow:"ellipsis",maxLines:1})})),d.push(new Q0({width:2})),z.diffStats&&(z.diffStats.added>0||z.diffStats.changed>0||z.diffStats.deleted>0)){let t=U?{success:P,warning:P,destructive:P}:A;d.push(...xH8(z.diffStats.added,z.diffStats.changed,z.diffStats.deleted,t)),d.push(new Q0({width:2}))}return d.push(R(z.description.timeAgo,K)),new b0({decoration:E?{color:E}:void 0,padding:H0.symmetric(2,0),child:new B6({children:[...k,...d]})})}})}}function s36(J){let Z=new Date().getTime()-J.getTime(),Y=Math.floor(Z/60000),X=Math.floor(Z/3600000),G=Math.floor(Z/86400000);if(Y<1)return"just now";if(Y<60)return`${Y}m ago`;if(X<24)return`${X}h ago`;if(G<7)return`${G}d ago`;return J.toLocaleDateString()}class Ik1 extends I6{props;debugLabel="ThreadFeedPicker";constructor(J){super();this.props=J}build(J){let Q=[...this.props.entries].sort((X,G)=>G.pubDate.getTime()-X.pubDate.getTime()),Z=Math.max(0,...Q.map((X)=>s36(X.pubDate).length));return new h2({items:Q,getLabel:(X)=>X.title,onAccept:(X)=>this.props.onSelect?.(X),onDismiss:this.props.onDismiss,title:this.props.title,emptyStateText:"No thread feed entries available",maxRenderItems:100,renderItem:(X,G,V,K)=>{let q=X6.of(K),{colors:W}=q,H=G?H1.yellow:void 0,z=G?H1.black:W.foreground,U=H1.index(8),D=X.authors.map((L)=>L.name).join(", ")||"Community",M=(L,A)=>new Q0({width:A,child:B6.end([new S1({text:new l(L,new r({color:U}))})])});return new b0({decoration:H?{color:H}:void 0,padding:H0.symmetric(2,0),child:new B6({children:[new c6({child:new S1({text:new l(X.title,new r({color:z})),overflow:"ellipsis",maxLines:1})}),new Q0({width:2}),new S1({text:new l(D,new r({color:U})),maxLines:1}),new Q0({width:2}),M(s36(X.pubDate),Z)]})})}})}}class Pk1 extends I6{props;constructor(J){super();this.props=J}build(){return new C4({child:new S1({text:new l("",void 0,[new l(`Forked to new thread:
|
|
4816
|
+
... (output truncated at ${qz} characters)`;X({success:L,output:I.trim(),error:!L?E.trim()||"Command failed":void 0,exitCode:M??void 0})}),H.on("error",(M)=>{clearTimeout(W);let L=M.message;if(q)L=`Command timed out after ${Z}ms`;else if(M.message.includes("operation was aborted")||M.name==="AbortError")L="The command was aborted";X({success:!1,output:z.join(""),error:L})})})}function PH8(J,Q){let{filePath:Z,interpreter:Y,extension:X}=J;if(process.platform==="win32")return RH8(Z,Y?[...Y]:null,X,Q);else return TH8(Z,Y?[...Y]:null,X,Q)}function TH8(J,Q,Z,Y){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...Y]];else return[J,Y]}function RH8(J,Q,Z,Y){if(Q&&Q.length>0&&Q[0])return[Q[0],[...Q.slice(1),J,...Y]];switch(Z.toLowerCase()){case".bat":case".cmd":return["cmd.exe",["/c",J,...Y]];case".ps1":return["powershell.exe",["-ExecutionPolicy","Bypass","-File",J,...Y]];case".exe":return[J,Y];default:return[J,Y]}}U0();EG();T7();LK();SZ();cG();tW();dK();O8();H7();j_();i0();var U26=q6(jP(),1);import{writeFile as z26}from"fs/promises";import uq from"path";U0();SZ();class Ak1{enabled;configService;commandCounts=new Map;timer=null;bufferTimeMs=1e4;constructor(J,Q){this.enabled=J;this.configService=Q;this.startTimer()}startTimer(){this.timer=setInterval(()=>{this.flushEvents()},this.bufferTimeMs)}async flushEvents(){if(this.commandCounts.size===0||!await this.enabled())return;let J=Array.from(this.commandCounts.entries()).map(([Q,Z])=>({feature:"cli.command",action:Q,source:{client:"cli",clientVersion:"0.0.1765526485-g99562d"},parameters:{metadata:{count:Z}},timestamp:Date.now()*1000}));this.commandCounts.clear();try{let Q=JSON.stringify(J);await Ro(Q,this.configService)}catch(Q){x.error("Failed to export command telemetry events",Q)}}async submit(J){if(!await this.enabled()||this.timer===null)return;let Q=this.commandCounts.get(J)||0;this.commandCounts.set(J,Q+1)}async dispose(){if(await this.flushEvents(),this.timer!==null)clearInterval(this.timer),this.timer=null}}class HO extends p0{props;constructor(J){super();this.props=J}createState(){return new u36}}class u36 extends u0{_state;initState(){super.initState(),this._state=this.widget.props.initialState}build(J){let Q=(Z)=>{this.setState(()=>{this._state=Z(this._state)})};return this.widget.props.builder(J,Q,this._state)}}class p36 extends u0{controller=new nZ;focusNode=new $8({debugLabel:"CommandArgumentPrompt",onKey:(J)=>{if(J.key==="Escape")return this.widget.props.onDismiss(),"handled";return"ignored"}});_textListener=()=>{this.setState(()=>{})};initState(){this.focusNode.requestFocus(),this.controller.addListener(this._textListener)}dispose(){this.controller.removeListener(this._textListener),this.focusNode.dispose()}build(J){let Q=X6.of(J),{colors:Z,app:Y}=Q,X=this.widget.props.isRequiredArg??!0,G=this.controller.text.trim().length>0,V=!X||G,K=F4.all(new G4(Z.foreground,1,"solid")),q=new $z({controller:this.controller,focusNode:this.focusNode,placeholder:this.widget.props.placeholder??"Enter command argument...",onSubmitted:(D)=>{let M=D.trim();if(X&&M.length===0)return;this.widget.props.onSubmit(M)},autofocus:!0,style:{textColor:Z.foreground,border:null},maxLines:1}),W=new B6({children:[new b0({decoration:{color:H1.default()},child:new S1({text:new l(">",new r({color:Z.foreground}))})}),new c6({child:q})]}),H=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l("",void 0,[new l("Command: ",new r({color:Z.foreground})),new l(this.widget.props.commandName,new r({color:H1.yellow,bold:!0}))])})}),z=[];if(V)z.push(new l("Enter",new r({color:Y.keybind}))),z.push(new l(" to submit, ",new r({color:Z.foreground,dim:!0})));z.push(new l("Esc",new r({color:Y.keybind}))),z.push(new l(" to cancel",new r({color:Z.foreground,dim:!0})));let U=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l("",void 0,z)})});return new b0({decoration:{border:K,color:H1.default()},padding:H0.all(1),child:new x0({children:[H,new Q0({height:1}),W,new Q5,U]})})}}class Sg extends p0{props;constructor(J){super();this.props=J}createState(){return new p36}}tW();class d36 extends u0{controller=new nZ;imageAttachments=[];imagePaths=[];isConfirmingClearInput=!1;clearInputConfirmTimeout=null;focusNode=new $8({debugLabel:"CommandMultilinePrompt",onKey:(J)=>{if(J.key==="Escape"){if(this.isConfirmingClearInput){if(this.controller.clear(),this.setState(()=>{this.isConfirmingClearInput=!1,this.imageAttachments=[],this.imagePaths=[]}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;return"handled"}if(this.controller.text.trim()!==""||this.imageAttachments.length>0){if(this.setState(()=>{this.isConfirmingClearInput=!0}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout);return this.clearInputConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingClearInput=!1}),this.clearInputConfirmTimeout=null},1000),"handled"}return this.widget.props.onDismiss(),"handled"}return"ignored"}});initState(){if(this.widget.props.initialText)this.controller.text=this.widget.props.initialText;if(this.widget.props.initialImages)this.imageAttachments=[...this.widget.props.initialImages];this.focusNode.requestFocus()}_handleInsertImage=(J)=>{if(this.imageAttachments.length>=sF)return!1;let Q=HC(J);if(typeof Q==="object")return this.setState(()=>{this.imageAttachments=[...this.imageAttachments,Q],this.imagePaths=[...this.imagePaths,J]}),!1;return!1};_handlePopImage=()=>{if(this.imageAttachments.length>0)this.setState(()=>{this.imageAttachments=this.imageAttachments.slice(0,-1),this.imagePaths=this.imagePaths.slice(0,-1)})};dispose(){if(this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;this.focusNode.dispose(),this.controller.dispose()}build(J){let Q=X6.of(J),{colors:Z,app:Y}=Q,G=S4.of(J).size.height,V=Math.max(Math.floor(G*0.5),10),K=new WO({controller:this.controller,triggers:[new JN],completionBuilder:this.widget.props.completionBuilder,ampURL:this.widget.props.ampURL,onSubmitted:(D)=>{this.widget.props.onSubmit(D.trim(),this.imageAttachments)},theme:Z,placeholder:this.widget.props.placeholder||"Enter your message...",enabled:this.widget.props.enabled??!0,autofocus:!0,clipboard:h8.instance.tuiInstance.clipboard,showMenuBelow:!0,onInsertImage:this.widget.props.onInsertImage??this._handleInsertImage,imageAttachments:this.imageAttachments,popImage:this._handlePopImage}),q=new z8({focusNode:this.focusNode,child:K}),W=new b0({constraints:new A6({maxHeight:V}),padding:H0.symmetric(1,0),child:q}),H=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l("",void 0,[new l("Command: ",new r({color:Z.foreground})),new l(this.widget.props.commandName,new r({color:H1.yellow,bold:!0}))])})}),z=new b0({padding:H0.symmetric(1,0),child:new S1({text:this.isConfirmingClearInput?new l("",void 0,[new l("Esc",new r({color:Y.keybind})),new l(" again to clear input",new r({color:Z.foreground,dim:!0}))]):new l("",void 0,[new l("Press ",new r({color:Z.foreground,dim:!0})),new l("Enter",new r({color:Y.keybind})),new l(" to submit, ",new r({color:Z.foreground,dim:!0})),new l("Esc",new r({color:Y.keybind})),new l(" to clear",new r({color:Z.foreground,dim:!0}))])})}),U=[H,new Q0({height:1}),new c6({child:W}),new Q0({height:1}),z];return new b0({decoration:{border:F4.all(new G4(Z.foreground,1,"solid")),color:H1.default()},padding:H0.all(1),child:new x0({children:U})})}}class CC extends p0{props;constructor(J){super();this.props=J}createState(){return new d36}}import{isDeepStrictEqual as _H8}from"node:util";var CH8=/[\\/_ +.#"@[({&]/,jH8=/[\\/_ +.#"@[({&]/g,SH8=/[\s-]/,c36=/[\s-]/g;function A91(J,Q,Z,Y,X,G,V){if(G===Q.length){if(X===J.length)return 1;return 0.99}let K=`${X},${G}`;if(V[K]!==void 0)return V[K];let q=Y.charAt(G),W=Z.indexOf(q,X),H=0,z,U,D,M;while(W>=0){if(z=A91(J,Q,Z,Y,W+1,G+1,V),z>H){if(W===X)z*=1;else if(SH8.test(J.charAt(W-1))){if(z*=0.9,M=J.slice(X,W-1).match(c36),M&&X>0)z*=Math.pow(0.999,M.length)}else if(CH8.test(J.charAt(W-1))){if(z*=0.8,D=J.slice(X,W-1).match(jH8),D&&X>0)z*=Math.pow(0.999,D.length)}else if(z*=0.3,X>0)z*=Math.pow(0.999,W-X);if(J.charAt(W)!==Q.charAt(G))z*=0.9999}if(z<0.1&&(Z.charAt(W-1)===Y.charAt(G+1)||Y.charAt(G+1)===Y.charAt(G)&&Z.charAt(W-1)!==Y.charAt(G))){if(U=A91(J,Q,Z,Y,W+1,G+2,V),U*0.1>z)z=U*0.1}if(z>H)H=z;W=Z.indexOf(q,W+1)}return V[K]=H,H}function L91(J){return J.toLowerCase().replace(c36," ")}function l36(J,Q){let Z=A91(J,Q,L91(J),L91(Q),0,0,{}),Y=Q.trim().split(/\s+/);if(Y.length>1){let X=0,G=0;for(let K of Y){let q=A91(J,K,L91(J),L91(K),0,0,{});if(q===0)return Z;X+=q,G+=K.length}let V=X/Y.length*0.95;return Math.max(Z,V)}return Z}class jC{}class SC{}class O91{}class w91{}class i36 extends p0{child;onContext;constructor(J,Q){super();this.child=J;this.onContext=Q}createState(){return new n36}}class n36 extends u0{build(J){return this.widget.onContext(J),this.widget.child}}function kH8(J,Q){if(J==="")return{matches:!0,score:1};let Z=l36(Q,J);return{matches:Z>0.15,score:Z}}class h2 extends p0{props;debugLabel="FuzzyPicker";constructor(J){super();this.props=J}createState(){return new a36}}class a36 extends u0{controller=new nZ;focusNode;scrollController=new l5;selectedIndex=0;itemContexts=[];cachedQuery="";cachedItemsRef=null;cachedFiltered=[];initState(){this.scrollController.disableFollowMode(),this.focusNode=new $8({debugLabel:this.widget.debugLabel}),this.controller.addListener(()=>{this.selectedIndex=0,this.recomputeFilteredItems(),this.setState(),S8.instance.addPostFrameCallback(()=>{this.ensureSelectedItemVisible()});let Q=this.cachedFiltered;this.widget.props.onSelectionChange?.(Q[0]??null)}),this.recomputeFilteredItems();let J=this.cachedFiltered;this.widget.props.onSelectionChange?.(J[0]??null),this.ensureSelectedItemVisible()}didUpdateWidget(J){if(!_H8(J.props.items,this.widget.props.items)){this.recomputeFilteredItems(),this.ensureSelectedItemVisible();let Q=this.cachedFiltered;this.widget.props.onSelectionChange?.(Q[this.selectedIndex]??null)}}dispose(){this.widget.props.onSelectionChange?.(null),this.controller.dispose(),this.focusNode.dispose(),this.scrollController.dispose()}invoke=(J)=>{if(J instanceof jC){let Q=this.getFilteredItems();if(Q.length>0&&this.selectedIndex<Q.length-1)this.selectedIndex++,this.setState(),S8.instance.addPostFrameCallback(()=>{this.ensureSelectedItemVisible()}),this.widget.props.onSelectionChange?.(Q[this.selectedIndex]??null);return"handled"}if(J instanceof SC){let Q=this.getFilteredItems();if(Q.length>0&&this.selectedIndex>0)this.selectedIndex--,this.setState(),S8.instance.addPostFrameCallback(()=>{this.ensureSelectedItemVisible()}),this.widget.props.onSelectionChange?.(Q[this.selectedIndex]??null);return"handled"}if(J instanceof O91){let Q=this.getFilteredItems();if(Q.length>0&&this.selectedIndex<Q.length){let Z=Q[this.selectedIndex];if(Z){if(!(this.widget.props.isItemDisabled?.(Z)??!1))this.widget.props.onAccept(Z)}}return"handled"}if(J instanceof w91)return this.widget.props.onDismiss?.(),"handled";return"ignored"};recomputeFilteredItems(){let J=this.controller.text,Q=this.widget.props.items,Z=Q.filter((Y)=>!this.widget.props.filterItem||this.widget.props.filterItem(Y,J)).map((Y)=>({item:Y,...kH8(J,this.widget.props.getLabel(Y))})).filter((Y)=>Y.matches).sort(this.widget.props.sortItems?(Y,X)=>this.widget.props.sortItems(Y,X,J):(Y,X)=>X.score-Y.score).map((Y)=>Y.item);this.cachedQuery=J,this.cachedItemsRef=Q,this.cachedFiltered=this.widget.props.maxRenderItems?Z.slice(0,this.widget.props.maxRenderItems):Z}getFilteredItems(){let J=this.controller.text,Q=this.widget.props.items;if(this.cachedQuery===J&&this.cachedItemsRef===Q)return this.cachedFiltered;return this.recomputeFilteredItems(),this.cachedFiltered}ensureSelectedItemVisible(){let J=this.itemContexts[this.selectedIndex];if(!J)return;let Q=J.findRenderObject();if(!Q)return;let Z=0,Y=Q.size.height;N81(J,{top:Z,bottom:Y},{padding:1})}handleScroll=(J)=>{let Q=this.getFilteredItems();if(Q.length===0)return;if(J.direction==="down")if(this.selectedIndex<Q.length-1)this.selectedIndex++;else return;else if(this.selectedIndex>0)this.selectedIndex--;else return;this.setState(),S8.instance.addPostFrameCallback(()=>{this.ensureSelectedItemVisible()}),this.widget.props.onSelectionChange?.(Q[this.selectedIndex]??null)};handleItemClick=(J,Q)=>{let Z=this.getFilteredItems();if(J>=0&&J<Z.length){let Y=Z[J],X=Y?this.widget.props.isItemDisabled?.(Y)??!1:!1;if(Q===1)this.selectedIndex=J,this.setState(),this.widget.props.onSelectionChange?.(Z[this.selectedIndex]??null);else if(Q===2&&!X){if(Y)this.widget.props.onAccept(Y)}}};build(J){let Q=X6.of(J),{colors:Z}=Q,Y=this.getFilteredItems(),X=F4.all(new G4(Z.foreground,1,"solid")),G=this.widget.props.enabled??!0,V=new $z({controller:this.controller,focusNode:this.focusNode,autofocus:!0,enabled:G,style:{textColor:Z.foreground,border:null},maxLines:1}),K=new JX({shortcuts:new Map([[new X4("ArrowDown"),new jC],[new X4("ArrowUp"),new SC],[new X4("Tab"),new jC],[new X4("Tab",{shift:!0}),new SC],[new X4("n",{ctrl:!0}),new jC],[new X4("p",{ctrl:!0}),new SC],[new X4("Enter"),new O91],[new X4("Escape"),new w91]]),focusNode:this.focusNode,child:V}),q=new NJ({actions:new Map([[jC,new E8(this.invoke)],[SC,new E8(this.invoke)],[O91,new E8(this.invoke)],[w91,new E8(this.invoke)]]),child:K}),W=new B6({children:[new b0({decoration:{color:H1.default()},child:new S1({text:new l(">",new r({color:Z.foreground}))})}),new c6({child:q})]});this.itemContexts=[];let H;if(this.widget.props.isLoading){let L=this.widget.props.loadingText??"Loading...";H=new Q0({height:10,child:new C4({child:new S1({text:new l(L,new r({color:Z.foreground}))})})})}else if(Y.length===0&&this.widget.props.emptyStateText)H=new c6({child:new C4({child:new S1({text:new l(this.widget.props.emptyStateText,new r({color:Z.foreground,dim:!0}))})})});else{let L=Y.map((A,E)=>{let I=E===this.selectedIndex,P=this.widget.props.isItemDisabled?.(A)??!1,R;if(this.widget.props.renderItem)R=this.widget.props.renderItem(A,I,P,J);else{let y=I?H1.yellow:void 0,k=I?H1.black:Z.foreground;R=new b0({decoration:y?{color:y}:void 0,padding:H0.symmetric(2,0),child:new S1({text:new l(this.widget.props.getLabel(A),new r({color:k,dim:P}))})})}return new i36(new G8({onClick:(y)=>this.handleItemClick(E,y.clickCount),child:R}),(y)=>{this.itemContexts[E]=y})});H=new x0({children:L,crossAxisAlignment:"start"})}let z=new c6({child:new G8({onScroll:this.handleScroll,opaque:!1,child:new W5({controller:this.scrollController,autofocus:!1,child:H})})}),U=[];if(this.widget.props.title){let L=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l(this.widget.props.title,new r({color:H1.yellow,bold:!0}))})});U.push(L)}if(U.push(W,new Q0({height:1}),z),this.controller.text!==""){let L=Y.length>0?Y[this.selectedIndex]:void 0,A=L&&this.widget.props.buildDisabledReasonWidget?.(L);if(A)U.push(new b0({padding:H0.vertical(1),child:new C4({child:A})}));else U.push(new Q0({height:3}))}if(this.widget.props.footer)U.push(this.widget.props.footer);return new b0({decoration:{border:X,color:H1.default()},padding:H0.symmetric(1,0),child:new x0({children:U})})}}function o36(J){let Z=new Date().getTime()-J.getTime(),Y=Math.floor(Z/60000),X=Math.floor(Z/3600000),G=Math.floor(Z/86400000);if(Y<1)return"just now";if(Y<60)return`${Y}m ago`;if(X<24)return`${X}h ago`;if(G<7)return`${G}d ago`;return J.toLocaleDateString()}class Ok1 extends I6{props;debugLabel="NewsFeedPicker";constructor(J){super();this.props=J}build(J){let Q=[...this.props.entries].sort((X,G)=>G.pubDate.getTime()-X.pubDate.getTime()),Z=Math.max(0,...Q.map((X)=>o36(X.pubDate).length));return new h2({items:Q,getLabel:(X)=>X.title,onAccept:(X)=>this.props.onSelect?.(X),onDismiss:this.props.onDismiss,title:this.props.title,emptyStateText:"No news entries available",maxRenderItems:100,renderItem:(X,G,V,K)=>{let q=X6.of(K),{colors:W}=q,H=G?H1.yellow:void 0,z=G?H1.black:W.foreground,U=H1.index(8),D=(M,L)=>new Q0({width:L,child:B6.end([new S1({text:new l(M,new r({color:U}))})])});return new b0({decoration:H?{color:H}:void 0,padding:H0.symmetric(2,0),child:new B6({children:[new c6({child:new S1({text:new l(X.title,new r({color:z})),overflow:"ellipsis",maxLines:1})}),new Q0({width:2}),D(o36(X.pubDate),Z)]})})}})}}class wk1 extends p0{createState(){return new r36}}class r36 extends u0{isGreen=!0;timer;initState(){this.timer=setInterval(()=>{this.isGreen=!this.isGreen,this.setState()},700)}dispose(){if(this.timer)clearInterval(this.timer);super.dispose()}build(J){return new S1({text:new l("●",new r({color:this.isGreen?H1.green:H1.index(8),bold:!0})),maxLines:1})}}function yH8(J){let Q=new Map,Z=new Map,Y=new Map,X=[];for(let V of J)Q.set(V.id,V);for(let V of J){let K=V.parentRelationships.find((q)=>q.role==="child"&&Q.has(q.threadID)&&(q.type==="fork"||q.type==="handoff"));if(K){Y.set(V.id,K.type);let q=K.threadID,W=Z.get(q)||[];W.push(V),Z.set(q,W)}else X.push(V)}return QX.flatten(X,(V)=>Z.get(V.id)).map((V)=>({...V.item,depth:V.depth,isLast:V.isLast,ancestorsAreLast:V.ancestorsAreLast,relationshipType:Y.get(V.item.id)}))}function Ek1(J,Q,Z){return new S1({text:new l(`${J}${Q}`,new r({color:Z})),maxLines:1})}function xH8(J,Q,Z,Y){return[Ek1("+",J,Y.success),Q5.horizontal(1),Ek1("~",Q,Y.warning),Q5.horizontal(1),Ek1("-",Z,Y.destructive)]}class E91 extends I6{props;debugLabel="ThreadContinuationPicker";constructor(J){super();this.props=J}build(J){let Q=this.props.filterByWorkspace&&this.props.currentWorkspaceURI?this.props.threads.filter((z)=>z.workspaceURI===this.props.currentWorkspaceURI):this.props.threads;if(this.props.excludeCurrentThread&&this.props.currentThreadID)Q=Q.filter((z)=>z.id!==this.props.currentThreadID);let Z=this.props.recentThreadIDs||[],Y=new Set(Z),X=this.props.currentThreadID,G=[...Q].sort((z,U)=>{if(X){if(z.id===X)return-1;if(U.id===X)return 1}let D=Z.indexOf(z.id),M=Z.indexOf(U.id);if(D!==-1&&M!==-1)return D-M;if(D!==-1)return-1;if(M!==-1)return 1;return 0}),V=yH8(G),K=Math.max(0,...V.map((z)=>z.description.timeAgo.length)),q=X6.of(J),W=new W6({padding:H0.symmetric(0,1),child:new C4({child:new S1({text:new l("",new r({color:q.colors.foreground,dim:!0}),[new l("Ctrl+T",new r({color:H1.blue,dim:!0})),new l(this.props.filterByWorkspace?" for all workspaces":" to filter by workspace",new r({color:q.colors.foreground,dim:!0}))])})})});return new h2({items:V,getLabel:(z)=>z.title,onAccept:(z)=>this.props.onSelect?.(z.id),onDismiss:this.props.onDismiss,onSelectionChange:(z)=>{if(this.props.previewController){if(z)this.props.previewController.select(z.id)}},title:this.props.title,isLoading:this.props.isLoading,loadingText:"Loading threads...",emptyStateText:"No threads match your filter",maxRenderItems:200,footer:this.props.isLoading?void 0:W,renderItem:(z,U,D,M)=>{let L=X6.of(M),{colors:A}=L,E=U?H1.yellow:void 0,I=U?H1.black:A.foreground,P=H1.index(8),R=(t,c)=>new Q0({width:c,child:B6.end([new S1({text:new l(t,new r({color:P}))})])}),y=this.props.threadViewStates[z.id],k=[],v=z.relationshipType==="handoff",g=new E81;if(z.depth>0){let t=[],c=z.ancestorsAreLast.slice(1);for(let L1 of c)t.push(new l(g.getAncestorPrefix(L1),new r({color:g.connectorColor,dim:g.connectorDim})));let J1=z.isLast?g.elbow:g.tee,q1=g.getConnectorText(J1);t.push(new l(q1,new r({color:g.connectorColor,dim:g.connectorDim}))),k.push(new S1({text:new l("",void 0,t)}))}let d=[],b=X===z.id?new l("(current) ",new r({color:H1.green})):Y.has(z.id)?new l("(visited) ",new r({color:A.foreground,dim:!0})):null;if(b)d.push(new S1({text:b}));if(y){if(y.state==="active"&&(y.interactionState==="tool-running"||y.interactionState===!1))d.push(new wk1),d.push(new Q0({width:1}))}let a=z.title;if(z.relationshipType==="fork"){let t=a.match(/^Forked\((\d+)\): /);if(t)a=a.slice(t[0].length);else while(a.startsWith("Forked: "))a=a.slice(8);d.push(new S1({text:new l("[fork] ",new r({color:H1.blue}))}))}else if(v)d.push(new S1({text:new l("[handoff] ",new r({color:H1.index(208)}))}));if(z.agentMode==="plan"&&z.hasPlan)d.push(new S1({text:new l("[plan] ",new r({color:H1.magenta}))}));if(d.push(new c6({child:new S1({text:new l(a,new r({color:I})),overflow:"ellipsis",maxLines:1})})),d.push(new Q0({width:2})),z.diffStats&&(z.diffStats.added>0||z.diffStats.changed>0||z.diffStats.deleted>0)){let t=U?{success:P,warning:P,destructive:P}:A;d.push(...xH8(z.diffStats.added,z.diffStats.changed,z.diffStats.deleted,t)),d.push(new Q0({width:2}))}return d.push(R(z.description.timeAgo,K)),new b0({decoration:E?{color:E}:void 0,padding:H0.symmetric(2,0),child:new B6({children:[...k,...d]})})}})}}function s36(J){let Z=new Date().getTime()-J.getTime(),Y=Math.floor(Z/60000),X=Math.floor(Z/3600000),G=Math.floor(Z/86400000);if(Y<1)return"just now";if(Y<60)return`${Y}m ago`;if(X<24)return`${X}h ago`;if(G<7)return`${G}d ago`;return J.toLocaleDateString()}class Ik1 extends I6{props;debugLabel="ThreadFeedPicker";constructor(J){super();this.props=J}build(J){let Q=[...this.props.entries].sort((X,G)=>G.pubDate.getTime()-X.pubDate.getTime()),Z=Math.max(0,...Q.map((X)=>s36(X.pubDate).length));return new h2({items:Q,getLabel:(X)=>X.title,onAccept:(X)=>this.props.onSelect?.(X),onDismiss:this.props.onDismiss,title:this.props.title,emptyStateText:"No thread feed entries available",maxRenderItems:100,renderItem:(X,G,V,K)=>{let q=X6.of(K),{colors:W}=q,H=G?H1.yellow:void 0,z=G?H1.black:W.foreground,U=H1.index(8),D=X.authors.map((L)=>L.name).join(", ")||"Community",M=(L,A)=>new Q0({width:A,child:B6.end([new S1({text:new l(L,new r({color:U}))})])});return new b0({decoration:H?{color:H}:void 0,padding:H0.symmetric(2,0),child:new B6({children:[new c6({child:new S1({text:new l(X.title,new r({color:z})),overflow:"ellipsis",maxLines:1})}),new Q0({width:2}),new S1({text:new l(D,new r({color:U})),maxLines:1}),new Q0({width:2}),M(s36(X.pubDate),Z)]})})}})}}class Pk1 extends I6{props;constructor(J){super();this.props=J}build(){return new C4({child:new S1({text:new l("",void 0,[new l(`Forked to new thread:
|
|
4817
4817
|
|
|
4818
4818
|
`,new r({color:H1.white,dim:!0})),new l(`"${this.props.newThreadTitle||"Untitled"}"`,new r({color:H1.white}))]),textAlign:"center"})})}}U0();class t36 extends u0{labels=[];isLoading=!0;currentQuery="";initState(){this.loadLabels()}async loadLabels(){try{let J=await this.widget.props.internalAPIClient.getUserLabels({query:""},{config:this.widget.props.configService});if(!J.ok){x.error("Failed to load labels",J.error),this.isLoading=!1,this.labels=[],this.setState();return}this.labels=J.result,this.isLoading=!1,this.setState()}catch(J){x.error("Failed to load labels",J),this.isLoading=!1,this.labels=[],this.setState()}}getValidationError(J){if(J.length===0)return null;if(J.length>32)return"Label name cannot exceed 32 characters";if(!/^[a-z0-9][a-z0-9-]*$/.test(J))return"Label must be lowercase alphanumeric with hyphens, starting with a letter or number";return null}isValidLabelName(J){return this.getValidationError(J)===null&&J.length>0}getAvailableLabels(){let J=this.widget.props.currentLabels||[];return this.labels.filter((Q)=>!J.includes(Q.name))}shouldShowCreateMarker(J){if(J.length===0||this.isLoading)return!1;let Q=J.trim().toLowerCase();if(!this.isValidLabelName(Q))return!1;let Z=this.widget.props.currentLabels||[],Y=this.labels.some((G)=>G.name===Q),X=Z.includes(Q);return!Y&&!X}build(J){let Q=X6.of(J),{colors:Z}=Q,Y=this.currentQuery.trim().toLowerCase(),X=Y.length>0?this.getValidationError(Y):null,G=this.getAvailableLabels(),K=[{id:"__create__",name:"__create_placeholder__",createdAt:"",__isCreateMarker:!0},...G];return new h2({title:"Add Label",items:K,getLabel:(q)=>{if("__isCreateMarker"in q)return this.currentQuery.trim().toLowerCase();return q.name},onAccept:(q)=>{if("__isCreateMarker"in q)this.widget.props.onSelect(this.currentQuery.trim().toLowerCase());else this.widget.props.onSelect(q.name)},onDismiss:this.widget.props.onDismiss,isLoading:this.isLoading,loadingText:"Loading labels...",emptyStateText:X||"Type to create a new label",renderItem:(q,W,H,z)=>{let U=W?H1.yellow:void 0,D=W?H1.black:Z.foreground;if("__isCreateMarker"in q&&q.__isCreateMarker){let L=this.currentQuery.trim().toLowerCase();return new b0({decoration:U?{color:U}:void 0,padding:H0.symmetric(2,0),child:new S1({text:new l("",void 0,[new l("Create new label: ",new r({color:D})),new l(L,new r({color:D,bold:!0}))])})})}return new b0({decoration:U?{color:U}:void 0,padding:H0.symmetric(2,0),child:new S1({text:new l(q.name,new r({color:D}))})})},filterItem:(q,W)=>{if(this.currentQuery!==W)this.currentQuery=W,setTimeout(()=>this.setState(),0);if("__isCreateMarker"in q&&q.__isCreateMarker)return this.shouldShowCreateMarker(W);let z=W.trim().toLowerCase();return z.length===0||q.name.includes(z)},sortItems:(q,W,H)=>{let z="__isCreateMarker"in q.item&&q.item.__isCreateMarker,U="__isCreateMarker"in W.item&&W.item.__isCreateMarker;if(z&&!U)return-1;if(!z&&U)return 1;return W.score-q.score}})}}class Tk1 extends p0{props;constructor(J){super();this.props=J}createState(){return new t36}}class PV extends p0{props;constructor(J){super();this.props=J}createState(){return new e36}}class e36 extends u0{_spinner=new x$;animationInterval=null;initState(){super.initState(),this.animationInterval=setInterval(()=>{this._spinner.step(),this.setState(()=>{})},100)}dispose(){if(this.animationInterval)clearInterval(this.animationInterval),this.animationInterval=null;super.dispose()}build(J){let Q=X6.of(J),{colors:Z}=Q,Y=F4.all(new G4(Z.foreground,1,"solid")),X=this._spinner.toBraille(),G=new S1({textAlign:"center",text:new l("",void 0,[new l(X,new r({color:H1.yellow})),new l(" ",void 0),new l(this.widget.props.message,new r({color:Z.foreground}))])}),K=[new c6({child:new x0({mainAxisAlignment:"center",crossAxisAlignment:"center",children:[G]})})];if(this.widget.props.onAbort)K.push(new Q0({height:2,child:new b0({padding:H0.symmetric(2,0),child:new S1({text:new l("",new r({dim:!0}),[new l("Press ",new r({color:Z.foreground})),new l("Esc",new r({color:Z.info})),new l(" to cancel",new r({color:Z.foreground}))])})})}));let q=new b0({decoration:new N8(H1.default(),Y),child:new Q0({width:60,height:7,child:new x0({mainAxisAlignment:"start",children:K})})});if(this.widget.props.onAbort)return new z8({debugLabel:"LoadingDialog",autofocus:!0,onKey:(W)=>{if(W.key==="Escape")return this.widget.props.onAbort?.(),"handled";return"ignored"},child:q});return q}}class TV extends p0{props;constructor(J){super();this.props=J}createState(){return new J26}}class J26 extends u0{dispose(){super.dispose()}isWidgetMessage(J){return J instanceof EV}build(J){let Q=this.widget.props.message,Z=(()=>{if(this.isWidgetMessage(Q))return{title:Q.title,type:Q.type};if(Q instanceof Error&&Q.name==="CommandCancelledError")return{title:"Cancelled",type:"info",description:Q.message};if(Q instanceof Error&&Q.name==="CommandTimeoutError")return{title:"Timeout",type:"error",description:Q.message};let W=L81(Q);return{title:W.title,type:W.type,description:W.description}})(),Y=Z.type==="error"?H1.red:H1.yellow,X=F4.all(new G4(H1.default(),1,"solid")),G=new b0({padding:H0.symmetric(1,0),child:new S1({text:new l(Z.title,new r({color:Y,bold:!0}))})}),V=this.isWidgetMessage(Q)?Q.widget:new S1({text:new l(Z.description,new r({color:H1.default()})),selectable:!0}),K=new c6({child:new Yz({child:new b0({padding:H0.symmetric(1,0),child:V})})}),q=new b0({padding:H0.symmetric(1,0),child:new S1({text:this.widget.props.onRetry?new l("",void 0,[new l("Press ",new r({color:H1.default(),dim:!0})),new l("R",new r({color:H1.yellow})),new l(" to retry, ",new r({color:H1.default(),dim:!0})),new l("Esc",new r({color:H1.yellow})),new l(" to cancel",new r({color:H1.default(),dim:!0}))]):new l("Press any key to close",new r({color:H1.default(),dim:!0,italic:!0}))})});return new z8({onKey:(W)=>{if(this.widget.props.onRetry&&W.key==="r")return this.widget.props.onRetry(),"handled";if(W.key==="Escape")return this.widget.props.onDismiss(),"handled";if(!this.widget.props.onRetry)return this.widget.props.onDismiss(),"handled";return"ignored"},autofocus:!0,child:new b0({decoration:{border:X,color:H1.default()},padding:H0.all(1),child:new x0({mainAxisAlignment:"center",children:[G,new Q0({height:1}),K,q]})})})}}class Rk1 extends I6{build(){return new C4({child:new S1({text:new l("",void 0,[new l(`✓ Thread Shared
|
|
4819
4819
|
|
|
@@ -4906,7 +4906,7 @@ https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_di
|
|
|
4906
4906
|
`)?`${K}...`:X,W=new r({color:H1.index(8)}),H=[new l(q,W)];if(V>0){let z=new r({color:Z.success});for(let U=1;U<=V;U++)H.push(new l(" ")),H.push(new l(`[${U}]`,z))}return new W6({padding:H0.only({bottom:0}),child:new B6({crossAxisAlignment:"start",children:[new W6({padding:H0.only({right:1}),child:new S1({text:new l("•",new r({color:H1.index(8)}))})}),new c6({child:new S1({text:new l("",void 0,H)})})]})})}}class Fy1 extends p0{createState(){return new KJ6}}class KJ6 extends u0{_animationTimer;_visible=!0;initState(){super.initState(),this._startAnimation()}dispose(){this._stopAnimation(),super.dispose()}_startAnimation(){this._animationTimer=setInterval(()=>{this.setState(()=>{this._visible=!this._visible})},500)}_stopAnimation(){if(this._animationTimer)clearInterval(this._animationTimer),this._animationTimer=void 0}build(J){let Q=new r({color:H1.red}),Z=new r({color:this._visible?H1.red:H1.transparent()});return new B6({children:[new S1({text:new l("⏺",Z)}),new Q0({width:1}),new S1({text:new l("Replay",Q)})]})}}class Uy1 extends I6{entry;width;constructor({key:J,entry:Q,width:Z}){super({key:J});this.entry=Q,this.width=Z}build(J){let Z=X6.of(J).colors.mutedForeground,Y=this.entry,X=Y.authors[0]?.name||"Community";if(X.includes("@"))X=X.split("@")[0]??X;let G=" · ",V=50,K=this.truncateToWidth(Y.title,V),q=`${G}${K}`,W=Math.max(1,this.width-q.length-2),H=Y.description.replace(/\s+/g," ").trim(),z=`@${X}: ${H}`,U=this.truncateToWidth(z,W),D=new S1({text:new l(U,new r({color:Z,dim:!0}))}),M=new S1({text:new l(q,new r({color:Z,dim:!0}))});return new G8({onClick:()=>f2(J,Y.link),cursor:"pointer",child:new Q0({width:this.width,height:1,child:new W6({padding:H0.horizontal(1),child:new B6({children:[new c6({child:new cB(new Q0({width:W,height:1,child:D}))}),M]})})})})}truncateToWidth(J,Q){if(J.length<=Q)return J;return J.slice(0,Q-1)+"…"}}i0();function tz8(J){let Z=new Date().getTime()-J.getTime(),Y=Math.floor(Z/3600000),X=Math.floor(Y/24),G=Math.floor(X/7),V=Math.floor(X/30);if(Y<1)return"Just now";if(Y<24)return`${Y}h ago`;if(X<7)return`${X}d ago`;if(G<=4)return`${G}w ago`;return`${V}mo ago`}class By1{threadHistoryService;constructor(J){this.threadHistoryService=J}async fetchThreadSummaries(J=""){try{let Q=await new Promise((Z)=>{let Y=this.threadHistoryService.observeThreadList().subscribe((X)=>{Y.unsubscribe(),Z(X)})});return{ok:!0,threads:this.formatThreadSummaries(Q,J)}}catch(Q){return{ok:!1,errorMsg:Q instanceof Error?Q.message:"An unexpected error occurred"}}}observeThreadSummaries(J=""){return this.threadHistoryService.observeHistory().pipe(Q6((Q)=>this.formatThreadSummaries(Q,J)))}formatThreadSummaries(J,Q){return J.filter((Y)=>{if(!Q.trim())return!0;let X=Y.title?.toLowerCase()||"untitled",G=Y.id.toLowerCase(),V=Q.toLowerCase();return X.includes(V)||G.includes(V)}).map((Y)=>{let X=new Date(Y.userLastInteractedAt),G=tz8(X),V=Y.id.slice(-8),K=Y.env?.initial.trees?.[0]?.uri;return{id:Y.id,title:Y.title||"Untitled",updatedAt:new Date(Y.userLastInteractedAt).toISOString(),description:{timeAgo:G,title:Y.title||"Untitled",shortThreadID:V},diffStats:Y.summaryStats?.diffStats,workspaceURI:K,parentRelationships:Y.parentRelationships,hasPlan:Y.hasPlan,agentMode:Y.agentMode}})}}U0();O8();class Ny1{currentId=null;current=null;subscribeTimer=null;subscription=null;listeners=[];threadService=null;scrollController=new l5;constructor(){}setThreadService(J){this.threadService=J}async select(J){if(!this.threadService){x.error("TUI assert failed: ThreadService used before being set");return}if(this.currentId===J)return;this.cancelTimerAndSubscription(),this.currentId=J;let Q=await this.threadService.get(J);if(Q){if(this.currentId===J)this.current=Q,this.notifyListeners()}this.subscribeTimer=setTimeout(()=>{this.subscribeLive(J)},1000)}clear(){this.cancelTimerAndSubscription(),this.currentId=null,this.current=null,this.notifyListeners()}addListener(J){this.listeners.push(J)}removeListener(J){let Q=this.listeners.indexOf(J);if(Q!==-1)this.listeners.splice(Q,1)}dispose(){this.cancelTimerAndSubscription(),this.scrollController.dispose(),this.listeners=[]}subscribeLive(J){if(!this.threadService){x.error("TUI assert failed: ThreadService used before being set");return}if(this.currentId!==J)return;this.subscription=this.threadService.observePatches(J).pipe(XM()).subscribe((Q)=>{if(this.currentId===J)this.current=Q,this.notifyListeners()})}cancelTimerAndSubscription(){if(this.subscribeTimer)clearTimeout(this.subscribeTimer),this.subscribeTimer=null;if(this.subscription)this.subscription.unsubscribe(),this.subscription=null}notifyListeners(){for(let J of this.listeners)J(this.current)}}function qJ6(J,Q){switch(J){case"update-available":return[new l("A newer Amp is available. Run ",new r({color:Q.foreground,dim:!0})),new l("amp update",new r({color:Q.warning}))];case"updated":return null;case"updated-with-warning":return[new l("Update complete, run ",new r({color:Q.foreground,dim:!0})),new l("amp update",new r({color:Q.warning})),new l(" to see warnings",new r({color:Q.foreground,dim:!0}))];case"update-error":return[new l("Update failed, run ",new r({color:Q.foreground,dim:!0})),new l("amp update",new r({color:Q.warning})),new l(" to see warnings",new r({color:Q.foreground,dim:!0}))];case"hidden":return null}}async function YF8(J){return new Promise((Q)=>{JF8("git",["branch","--show-current"],{cwd:J},(Z,Y)=>{if(Z){Q(null);return}let X=Y.trim();Q(X||null)})})}class DJ6 extends p0{dependencies;constructor(J){super();this.dependencies=J}createState(){return new o91}}class o91 extends u0{themeColors=null;themeApp=null;selectionListener=null;ideStatus=null;connectedClientsStatus=null;connectedClientsStatusExpanded=!1;randomAd=null;adSubscription=null;adReadinessTimeout=null;threadLoadSubscription=null;lastAdImpressionId=null;lastUserInteractionTime=Date.now();isConfirmingExit=!1;isExiting=!1;isConfirmingClearInput=!1;isConfirmingCancelProcessing=!1;statusMessage=null;statusMessageTimer=null;isShowingHelp=!1;isShowingConsoleOverlay=!1;isShowingMCPStatusModal=!1;isShowingConfirmationOverlay=!1;isShowingFileChangesOverlay=!1;isShowingContextDetailOverlay=!1;threadCostInfo=void 0;threadCostInfoThreadID=void 0;threadCostInfoLastUsageLedgerLength=0;lastInferenceState=void 0;confirmationOverlayContent="";exitConfirmTimeout=null;clearInputConfirmTimeout=null;cancelProcessingConfirmTimeout=null;historyIndex=-1;historyDraft=null;bashInvocations=[];dismissedEphemeralErrorKey=null;currentTitle=void 0;currentShellModeStatus=void 0;imageAttachments=[];displayMessage=null;executingCommand=null;isShowingJetBrainsInstaller=!1;isShowingIdePicker=!1;isShowingPalette=!1;paletteShowOptions=null;threadsForPicker=[];clustersForPicker=[];isLoadingThreads=!1;threadPreviewController=new Ny1;previewThread=null;planScrollController=(()=>{let J=new l5;return J.followMode=!1,J})();todoScrollController=(()=>{let J=new l5;return J.followMode=!1,J})();filterThreadPickerByWorkspace=!0;currentGitBranch=null;messageViewFocusNode=new $8({debugLabel:"MessageViewFocus"});autocompleteFocusNode=new $8({debugLabel:"AutocompleteFocus"});isTextfieldAndAutocompleteFocused=!1;submitDisabledHint=null;submitDisabledHintTimer=null;showImageUnsupportedHint=!1;imageUnsupportedHintTimer=null;adActionModal=null;threadFeedReader=null;currentThreadFeedEntry=null;threadFeedEntries=[];threadFeedSubscription=null;threadFeedRotationTimer=null;threadFeedHidden=!1;threadFeedTickerQueue=[];hasSubmittedFirstMessage=!1;currentUserInfo=null;newsFeedReader=null;newsFeedEntries=[];newsFeedSubscription=null;bottomGridUserHeight=void 0;bottomGridDragStartY=null;bottomGridDragStartHeight=null;previousThreadIdForHint=null;pendingMCPServers=[];mcpTrustSubscription=null;pendingOAuthRequest=null;mcpServers=[];mcpServersSubscription=null;cacheTimerState=null;cacheTimerSubscription=null;agentModeController=null;freeTierStatus={canUseAmpFree:!1};agentModePulseSeq=0;agentModeSlideProgress=null;agentModeSlideTimer=null;updateState="hidden";updateServiceSubscription=null;toastController=new ZS1;isMessageViewInSelectionMode=!1;threadBackStack=[];threadForwardStack=[];replayDisplayedMessages=[];replayAbortController=new AbortController;replayTypingTimer=null;mysteriousMessage=null;isShowingMysteriousMessageModal=!1;mysteriousMessageSubscription=null;mysterySequenceManager=null;mysterySequenceProgress=null;mysteryKeyInterceptorUnsubscribe=null;static MYSTERY_SEQUENCE=["ctrl+x","y","z"];userDisplayBalanceInfo=null;balanceInfoSubscription=null;async initThreadFeed(){let J=await V6(this.widget.dependencies.configService.config);if(J.settings["feed.enabled"]===!1)this.threadFeedHidden=!0;let Q=J.settings.url,Z=Q.includes("localhost")||Q.includes("127.0.0.1");try{let V=await this.widget.dependencies.internalAPIClient.getUserInfo({},{config:this.widget.dependencies.configService});if(V.ok){let K=V.result,q="user"in K?K.user:K;this.currentUserInfo={username:q.username??void 0,displayName:q.displayName??void 0};let W="ffe10a0c-6c42-41ce-a3a6-38990fd6caf8";if(!Z&&K.team?.id!==W)return}else return}catch(V){x.debug("Failed to fetch user info for thread feed filtering",V);return}let Y="/threads.rss",X=async(V,K)=>{let q=V instanceof Request?V.url:V.toString();return b7(q,K,this.widget.dependencies.configService)},G=kI1();G.get("entries").then((V)=>{if(V){let K=this.filterEntries(V);if(this.threadFeedEntries=K,K.length>0&&!this.currentThreadFeedEntry){let q=[...K].sort((H,z)=>z.pubDate.getTime()-H.pubDate.getTime());this.threadFeedTickerQueue=[...q,...this.threadFeedTickerQueue];let W=this.getNextFeedEntry();if(W)this.setState(()=>{this.currentThreadFeedEntry=W})}}}),this.threadFeedReader=new Mj1(G,X,{url:Y}),this.threadFeedSubscription=this.threadFeedReader.stream().subscribe({next:(V)=>{try{let K=this.filterEntries(V);if(K.length>0){this.threadFeedEntries=[...K,...this.threadFeedEntries];let q=[...K].sort((W,H)=>H.pubDate.getTime()-W.pubDate.getTime());if(this.threadFeedTickerQueue=[...q,...this.threadFeedTickerQueue],!this.currentThreadFeedEntry){let W=this.getNextFeedEntry();if(W)this.setState(()=>{this.currentThreadFeedEntry=W})}}}catch(K){x.error("Thread feed: error in next handler",K)}},error:(V)=>{x.error("Thread feed error:",V)}}),this.resetThreadFeedRotation()}filterEntries(J){if(!this.currentUserInfo)return J;let{username:Q,displayName:Z}=this.currentUserInfo;return J.filter((Y)=>{return!Y.authors.some((X)=>{let G=X.name;if(!G)return!1;return Q&&G===Q||Z&&G===Z||Q&&G.includes(Q)})})}rotateThreadFeed(){if(this.threadFeedRotationTimer)clearInterval(this.threadFeedRotationTimer);this.threadFeedRotationTimer=setInterval(()=>{let J=this.getNextFeedEntry();if(J)this.setState(()=>{this.currentThreadFeedEntry=J})},30000)}resetThreadFeedRotation(){this.rotateThreadFeed()}getNextFeedEntry(){if(this.threadFeedTickerQueue.length>0)return this.threadFeedTickerQueue.shift();return null}async initNewsFeed(){let J=async(Z)=>{return b7(Z,void 0,this.widget.dependencies.configService)},Q=kI1();this.newsFeedReader=new Dj1(Q,J,"/news.rss"),this.newsFeedSubscription=this.newsFeedReader.stream().subscribe({next:(Z)=>{if(Z.length>0)this.setState(()=>{this.newsFeedEntries=[...Z,...this.newsFeedEntries]})},error:(Z)=>{x.error("News feed error:",Z)}})}recordNavigation(J){this.threadBackStack.push(J),this.threadForwardStack=[]}navigateBack=async()=>{if(this.threadBackStack.length===0)return;let J=this.widget.dependencies.worker.thread.id,Q=this.threadBackStack.pop();this.threadForwardStack.push(J),await this.switchToExistingThread(Q,{recordInNavigationHistory:!1})};navigateForward=async()=>{if(this.threadForwardStack.length===0)return;let J=this.widget.dependencies.worker.thread.id,Q=this.threadForwardStack.pop();this.threadBackStack.push(J),await this.switchToExistingThread(Q,{recordInNavigationHistory:!1})};startAndSwitchToNewThread=async()=>{let J=this.widget.dependencies.worker.thread.id;this.recordNavigation(J);let Q=await this.widget.dependencies.startNewThread();return this.widget.dependencies.worker=Q,this.widget.dependencies.threadID=Q.thread.id,this.widget.dependencies.switchWorker(Q),this.setState(()=>{this.isMessageViewInSelectionMode=!1,this.previousThreadIdForHint=J}),Q};async startReplay(){let J=this.widget.dependencies.replayMode;if(!J)return;let{thread:Q,typingEnabled:Z,baseWpm:Y}=J,X=Q.messages;for(let G=0;G<X.length;G++){if(this.replayAbortController.signal.aborted)break;let V=X[G];if(!V)continue;if(G>0)await this.replaySleep(J.messageDelayMs);if(V.role==="user"&&Z){let W=V.content.filter((H)=>H.type==="text").map((H)=>H.text).join(`
|
|
4907
4907
|
`);if(W)await this.replayTypeMessage(W,Y)}if(V.role==="assistant"){let W=V.content.some((U)=>U.type==="tool_use"),H=X[G+1],z=H?.role==="user"&&H.content.some((U)=>U.type==="tool_result");if(W&&z){let U={...V,state:{type:"streaming"}};this.setState(()=>{this.replayDisplayedMessages=[...this.replayDisplayedMessages,U],this.textController.clear()});let D=J.thread.id;this.getMessageScrollController(D).scrollToBottom(),await this.replaySleep(J.toolProgressDelayMs),this.setState(()=>{this.replayDisplayedMessages=[...this.replayDisplayedMessages.slice(0,-1),V]});continue}}this.setState(()=>{this.replayDisplayedMessages=[...this.replayDisplayedMessages,V],this.textController.clear()});let K=J.thread.id;this.getMessageScrollController(K).scrollToBottom()}await this.replaySleep(J.exitDelayMs),h8.instance.stop()}async replayTypeMessage(J,Q){this.textController.clear();let Z=J.split(/(?<=\s)/),Y=60000/Q;for(let X of Z){if(this.replayAbortController.signal.aborted)break;if(this.looksLikePastedContent(X.trim())){await this.replaySleep(150),this.textController.text=this.textController.text+X,this.textController.cursorPosition=this.textController.text.length,this.setState(()=>{}),await this.replaySleep(300);continue}let G=Y/X.length;for(let V of X){this.textController.text=this.textController.text+V,this.textController.cursorPosition=this.textController.text.length,this.setState(()=>{});let K=0.8+Math.random()*0.4,q=G*K;await this.replaySleep(q)}}}looksLikePastedContent(J){if(/^[a-z][a-z0-9+.-]*:\/\//i.test(J))return!0;if(J.startsWith("/")&&J.length>10)return!0;if(/^[a-z]:\\/i.test(J))return!0;if(/^[a-f0-9]{7,40}$/i.test(J))return!0;if(/^T-[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i.test(J))return!0;return!1}replaySleep(J){return new Promise((Q)=>{this.replayTypingTimer=setTimeout(Q,J)})}getEffectiveAgentMode(){return this.agentModeController?.getEffectiveMode()??"smart"}isProcessing(){let{threadState:J}=this.widget.dependencies;if(!J.mainThread)return!1;if(J.viewState.state!=="active")return!1;if(Boolean(J.viewState.inferenceState==="running"))return!0;let Z=J.items.filter((G)=>G.type==="toolResult").filter((G)=>G.toolResult.run.status==="in-progress"||G.toolResult.run.status==="queued"),Y=J.subagentActiveTools.filter((G)=>G.toolRun.status==="in-progress"||G.toolRun.status==="queued");return[...Z,...Y].length>0}showSubmitDisabledHint(J){if(this.submitDisabledHintTimer)clearTimeout(this.submitDisabledHintTimer);this.setState(()=>{this.submitDisabledHint=J}),this.submitDisabledHintTimer=setTimeout(()=>{this.setState(()=>{this.submitDisabledHint=null}),this.submitDisabledHintTimer=null},3000)}getUIHint(){let J=this.themeColors?.colorScheme;if(!J)return null;let Q=this.themeApp;if(!Q)return null;if(this.submitDisabledHint)return new l(this.submitDisabledHint,new r({color:J.foreground,dim:!0}));if(this.isExiting)return new l("Exiting...",new r({color:J.foreground,dim:!0}));if(this.isConfirmingExit)return new l("",void 0,[new l("Ctrl+C",new r({color:Q.keybind})),new l(" again to exit",new r({color:J.foreground,dim:!0}))]);if(this.isConfirmingClearInput)return new l("",void 0,[new l("Esc",new r({color:Q.keybind})),new l(" again to clear input",new r({color:J.foreground,dim:!0}))]);if(this.isShowingHelp)return new l("",void 0,[new l("Escape",new r({color:Q.keybind})),new l(" to close help",new r({color:J.foreground,dim:!0}))]);if(this.showImageUnsupportedHint){let X=this.getEffectiveAgentMode(),G=wy1(X);return new l("",void 0,[new l("Images aren't supported in ",new r({color:J.warning,dim:!1})),new l(X,new r({color:G})),new l(" mode.",new r({color:J.warning,dim:!1}))])}if(this.isProcessing()||this.bashInvocations.length>0){if(this.isConfirmingCancelProcessing)return new l("",void 0,[new l("Esc",new r({color:Q.keybind})),new l(" again to cancel",new r({color:J.foreground,dim:!0}))]);return new l("",void 0,[new l("Esc",new r({color:Q.keybind})),new l(" to cancel",new r({color:J.foreground,dim:!0}))])}if(this.statusMessage)return new l(this.statusMessage,new r({color:J.foreground,dim:!0}));let Z=qJ6(this.updateState,J);if(Z)return new l("",void 0,Z);let Y=this.widget.dependencies.worker.thread;if(Y.agentMode==="plan"&&ZA(Y))return new l("",void 0,[new l("Use command",new r({color:J.foreground})),new l(" plan: execute",new r({color:Q.command}))]);return null}isTranscriptEmpty(){let{threadState:J}=this.widget.dependencies;return J.items.length===0}handleMessageRestoreSubmit=async(J)=>{let{threadState:Q,worker:Z}=this.widget.dependencies;if(!Q.mainThread?.id)return;let X=Q.mainThread?.messages.findIndex((G)=>G===J);if(X===void 0||X===-1)return;try{this.cancelBashInvocations(),await Z.cancel(),await Z.handle({type:"thread:truncate",fromIndex:X}),this.scrollMessageViewToBottom(),this.setState(()=>{this.imageAttachments=[]})}catch(G){x.error("Failed to edit message:",G)}};forkMessage=async(J)=>{let{threadState:Q,workerDeps:Z,threadSyncService:Y}=this.widget.dependencies,X=Q.mainThread?.id;if(!X)return;let G=Q.mainThread?.messages.findIndex((V)=>V===J);if(G===void 0||G<=0)return;try{let V=await Y2.getOrCreateForThread(Z,X),K=await zR(V,Y,G-1);await this.switchToExistingThread(K)}catch(V){x.error("Failed to fork thread:",V),this.showErrorMessage(`Failed to fork thread: ${V}`)}};handleMessageEditSubmit=async(J,Q)=>{let{threadState:Z,worker:Y}=this.widget.dependencies,X=Z.mainThread;if(!X)return;let G=X.messages.findIndex((V)=>V.messageId!==void 0&&V.messageId===J.messageId);if(G===-1)return;try{this.cancelBashInvocations(),await Y.cancel(),this.widget.dependencies.history.add(Q);let V=iB(Q);if(V)await Y.handle({type:"thread:truncate",fromIndex:G}),this.invokeBashCommand(V.cmd,{visibility:V.visibility});else{let K=[{type:"text",text:Q}];if(this.imageAttachments.length>0)K.push(...this.imageAttachments);let q={content:K,agentMode:X.agentMode},W=G===0;if(X.agentMode&&!W&&q.agentMode!==X.agentMode){x.error(`Cannot edit message: This thread uses ${X.agentMode} mode. To change mode, create a new thread.`);return}await Y.handle({type:"user:message",message:q,index:G})}this.scrollMessageViewToBottom(),this.setState(()=>{this.imageAttachments=[]})}catch(V){x.error("Failed to edit message:",V)}};getAffectedFiles=async(J)=>{let{worker:Q}=this.widget.dependencies;try{return(await Q.getFilesAffectedByTruncation(J)).map(n2)}catch(Z){return x.error("Failed to get affected files:",Z),[]}};textController=new nZ;messageScrollControllers=new Map;getMessageScrollController(J){if(!this.messageScrollControllers.has(J))this.messageScrollControllers.set(J,new l5);return this.messageScrollControllers.get(J)}scrollMessageViewToBottom(){let{threadState:J}=this.widget.dependencies,Q=J.mainThread?.id;if(!Q)return;this.getMessageScrollController(Q).scrollToBottom()}findElementByKey(J){return this.searchElementTreeByKey(this.context.element,J)}searchElementTreeByKey(J,Q){if(!J)return null;if(J?.widget?.key?.value===Q)return J;if(J?.child){let Y=this.searchElementTreeByKey(J.child,Q);if(Y)return Y}if(J?.children)for(let Y of J.children){let X=this.searchElementTreeByKey(Y,Q);if(X)return X}return null}setupSelectionListener(){let J=this.findElementByKey("message-view-selection-area");if(J?.state){let Q=J.state;if(Q?.controller&&!this.selectionListener)this.selectionListener=()=>{this.setState(()=>{})},Q.controller.addListener(this.selectionListener),Q.controller.onSelectionCopied=()=>{this.toastController.show("Selection copied to clipboard","success",2000)}}}updateTerminalTitle(){let{threadState:J}=this.widget.dependencies,Q=J.mainThread?.title;if(Q!==this.currentTitle){this.currentTitle=Q;let Z=process.cwd().replace(process.env.HOME||"","~"),Y=Q?`amp - ${Q} - ${Z}`:"";process.stdout.write(IC1(Y))}}_handleTextCopy(J){if(J&&J.length>0)this.toastController.show("Selection copied to clipboard","success",2000)}textFieldKey=new n7("text-field");ideStatusSubscription=null;ideMessageSubscription=null;ideAppendToPromptSubscription=null;connectedClientsStatusSubscription=null;paletteCommands;paletteConfig;completionBuilder=null;textChangeListener=()=>{let J=this.textController.text;if(J==="/"){this.showCommandPalette(),this.textController.clear();return}let Q=iB(J);this.currentShellModeStatus=Q?.visibility,this.setState(()=>{})};navigateHistoryPrevious=()=>{let J=this.widget.dependencies.history.previous();if(J!==null){if(this.historyIndex===-1)this.historyDraft=this.textController.text;this.historyIndex++,this.textController.text=J,this.textController.moveCursorToStart()}};navigateHistoryNext=()=>{let J=this.widget.dependencies.history.next();if(J!==null)this.historyIndex--,this.textController.text=J,this.textController.moveCursorToEnd();else if(this.historyIndex>-1)this.historyIndex=-1,this.textController.text=this.historyDraft||"",this.textController.moveCursorToEnd(),this.historyDraft=null};resetHistory=()=>{this.widget.dependencies.history.reset(),this.historyIndex=-1,this.historyDraft=null};openJetBrainsInstaller=()=>{this.setState(()=>{this.isShowingJetBrainsInstaller=!0})};dismissJetBrainsInstaller=()=>{this.setState(()=>{this.isShowingJetBrainsInstaller=!1})};openIdePicker=()=>{this.setState(()=>{this.isShowingIdePicker=!0})};dismissIdePicker=()=>{this.setState(()=>{this.isShowingIdePicker=!1}),S8.instance.addPostFrameCallback(()=>{this.autocompleteFocusNode.requestFocus()})};handleIdeSelection=async(J,Q)=>{if(this.widget.dependencies.ideClient.getSelectedConfig()?.pid===J.pid){this.dismissIdePicker();return}try{await this.connectToSelectedIde(J,Q)}catch(Z){let Y=Z instanceof Error?Z.message:String(Z);this.setState(()=>{this.displayMessage=Error(`Failed to connect to IDE: ${Y}`)})}this.widget.dependencies.ideClient.selectConfig(J),this.dismissIdePicker()};async connectToSelectedIde(J,Q){await this.widget.dependencies.ideClient.start(J,!0,Q)}previewControllerListener=(J)=>{this.setState(()=>{this.previewThread=J})};showStandaloneThreadPicker=()=>{this.showCommandPalette({type:"standalone",commandId:"continue",onSubmit:()=>{this.threadPreviewController.clear(),this.setState(()=>{this.isShowingPalette=!1,this.paletteShowOptions=null}),S8.instance.addPostFrameCallback(()=>{if(!this.isMessageViewInSelectionMode&&!this.isShowingPalette)this.autocompleteFocusNode.requestFocus()})},onCancel:()=>{this.exitApplication()}})};toggleThreadPickerWorkspaceFilter=()=>{this.setState(()=>{this.filterThreadPickerByWorkspace=!this.filterThreadPickerByWorkspace})};showCommandPalette(J){if(this.setState(()=>{this.isShowingPalette=!this.isShowingPalette,this.paletteShowOptions=J??null}),this.isShowingPalette)this.loadThreadsForPicker()}isShowingStandalonePalette(){return this.isShowingPalette&&this.paletteShowOptions?.type==="standalone"}getPaletteCommands(){if(!this.paletteCommands){if(!this.paletteConfig)throw Error("Config not yet available");this.paletteCommands=new hk1(this.widget.dependencies.configService,this.widget.dependencies.commandRegistry,(J)=>{this.setState(()=>{this.executingCommand=J})},()=>{this.setState(()=>{this.executingCommand=null})},this.widget.dependencies.isDogfooding,this.paletteConfig)}return this.paletteCommands}getCompletionBuilder(){if(!this.completionBuilder)this.completionBuilder=new gk1(this.widget.dependencies.fuzzyServer);return this.completionBuilder}dismissPalette=()=>{this.setState(()=>{this.isShowingPalette=!1,this.paletteShowOptions=null})};getCommandPaletteContext=(J)=>{let{threadState:Q,recentThreadIDs:Z}=this.widget.dependencies;if(!Q.mainThread)return null;let Y=h0.file(process.cwd()),X=N6(Y);return{recentThreadIDs:Z,currentThreadID:Q.mainThread.id,context:J,worker:this.widget.dependencies.worker,editorState:this.textController,isProcessing:this.isProcessing(),thread:Q.mainThread,ampURL:this.widget.dependencies.ampURL,threadService:this.widget.dependencies.threadService,threadSyncService:this.widget.dependencies.threadSyncService,configService:this.widget.dependencies.configService,openInEditor:this.openInEditor,takeImageAttachments:()=>{let G=this.imageAttachments;return this.setState(()=>{this.imageAttachments=[]}),G},setImageAttachments:(G)=>{this.setState(()=>{this.imageAttachments=G})},editorDispatch:(G)=>{switch(G.type){case"set-input":this.textController.clear(),this.textController.insertText(G.input);break;case"insert-text":this.textController.insertText(G.text);break;case"clear":this.textController.clear();break}},submitMessage:(G)=>{return this.proceedWithUserMessage(G)},exitApp:this.exitApplication,openHelp:()=>{this.setState(()=>{this.isShowingHelp=!0})},settingsStorage:this.widget.dependencies.settingsStorage,clientId:this.widget.dependencies.clientId,connectedClientsService:this.widget.dependencies.connectedClientsService,mcpService:this.widget.dependencies.mcpService,startNewThread:async()=>{await this.startAndSwitchToNewThread()},navigateBack:this.navigateBack,navigateForward:this.navigateForward,canNavigateBack:this.threadBackStack.length>0,canNavigateForward:this.threadForwardStack.length>0,canUseAmpFree:this.widget.dependencies.freeTierStatus.canUseAmpFree,switchToThread:async(G)=>{return await this.switchToExistingThread(G),this.setState(()=>{this.isMessageViewInSelectionMode=!1}),this.widget.dependencies.worker},generateHandoffPrompt:async(G,V,K)=>{let q=this.widget.dependencies.threadState.mainThread?.id;if(!q)throw Error("No active thread");let W=setTimeout(()=>{K.throwIfAborted()},60000);try{let H=await this.widget.dependencies.threadService.generateHandoffPrompt(q,G,V,this.widget.dependencies.configService,K);return clearTimeout(W),H}catch(H){throw clearTimeout(W),H}},handleHandoff:async(G,V)=>{let{goal:K,generatedPrompt:q,images:W}=V;if(!K&&!q)return{ok:!1,error:Error("Either goal or generatedPrompt required")};try{let H=this.widget.dependencies.threadState.mainThread?.id;if(!H)return{ok:!1,error:Error("No active thread")};let z=setTimeout(()=>G.abort(new D91("Handoff took too long and was aborted (timeout: 60s)")),60000);try{let U=await this.widget.dependencies.threadService.createHandoffThread(H,{goal:K,generatedPrompt:q,images:W},this.widget.dependencies.configService,G.signal);return clearTimeout(z),await this.switchToExistingThread(U),{ok:!0}}catch(U){if(clearTimeout(z),U instanceof Error&&(U.name==="AbortError"||U.message.includes("aborted")))throw G.signal.reason;throw U}}catch(H){return x.error("Failed to create handoff thread",H),{ok:!1,error:H instanceof Error?H:Error(String(H))}}},getGuidanceFiles:async(G)=>{if(!Q.mainThread)return[];return(await rr({filesystem:this.widget.dependencies.worker.fs.fileSystemReader(),configService:this.widget.dependencies.configService,threadService:this.widget.dependencies.threadService},Q.mainThread,G)).map((K)=>({uri:K.uri,type:K.type}))},openIdePicker:()=>{this.openIdePicker()},getAgentMode:()=>{return this.agentModeController?.getMode()??null},setAgentMode:(G)=>{this.agentModeController?.setMode(G)},toggleAgentMode:this.toggleAgentMode,getEffectiveAgentMode:()=>this.getEffectiveAgentMode(),getEditorText:()=>this.textController.text,workspace:this.widget.dependencies.workspace??null,handleExecutePlan:async()=>{try{let G=Q.mainThread?.id;if(!G){this.setState(()=>{this.displayMessage=Error("No active thread")});return}let V=await this.widget.dependencies.threadService.createPlanExecutionThread(G,"smart");await this.switchToExistingThread(V)}catch(G){x.error("Failed to execute plan",G),this.setState(()=>{this.displayMessage=Error(`Failed to execute plan: ${G instanceof Error?G.message:String(G)}`)})}},planFileManager:this.widget.dependencies.planFileManager,completionBuilder:this.getCompletionBuilder(),threads:this.threadsForPicker,clusters:this.clustersForPicker,previewController:this.threadPreviewController,isLoadingThreads:this.isLoadingThreads,filterByWorkspace:this.filterThreadPickerByWorkspace,currentWorkspace:X,threadViewStates:this.widget.dependencies.workerController.threadViewStates,currentThreadFeedEntry:this.currentThreadFeedEntry,threadFeedEntries:this.threadFeedEntries,threadFeedHidden:this.threadFeedHidden,newsFeedEntries:this.newsFeedEntries,setThreadFeedHidden:(G)=>{this.setState(()=>{this.threadFeedHidden=G})},showMCPStatusModal:()=>{this.setState(()=>{this.isShowingMCPStatusModal=!0})},internalAPIClient:this.widget.dependencies.internalAPIClient,features:this.widget.dependencies.features,showStatusMessage:(G,V=2000)=>{if(this.statusMessageTimer)clearTimeout(this.statusMessageTimer);this.setState(()=>{this.statusMessage=G}),this.statusMessageTimer=setTimeout(()=>{this.setState(()=>{this.statusMessage=null}),this.statusMessageTimer=null},V)},showToast:(G,V="success",K)=>{this.toastController.show(G,V,K)}}};loadThreadsForPicker(){if(this.threadLoadSubscription)return;this.setState(()=>{this.isLoadingThreads=!0});let J=new By1(this.widget.dependencies.threadHistoryService);this.threadLoadSubscription=J.observeThreadSummaries("").subscribe({next:(Q)=>{this.setState(()=>{this.threadsForPicker=Q,this.clustersForPicker=H26(Q),this.isLoadingThreads=!1})},error:()=>{this.setState(()=>{this.isLoadingThreads=!1})}})}updateGitBranch=async()=>{let J=await YF8(process.cwd());this.setState(()=>{this.currentGitBranch=J})};removeBashInvocation=(J)=>{this.setState(()=>{this.bashInvocations=this.bashInvocations.filter((Q)=>Q.id!==J)})};invokeBashCommand=(J,{visibility:Q})=>{let Z=Date.now(),Y=`bash-${Z}-${Math.random().toString(36).substring(7)}`,X={cmd:J},G=new AbortController;this.widget.dependencies.worker.invokeBashTool(X,G.signal,Q===lB).subscribe({next:(V)=>{this.setState(()=>{if(this.bashInvocations.find((q)=>q.id===Y))this.bashInvocations=this.bashInvocations.map((q)=>q.id===Y?{...q,toolRun:V}:q);else{let q={id:Y,args:X,toolRun:V,startTime:Z,abortController:G,hidden:Q===lB};this.bashInvocations=[...this.bashInvocations,q]}})},error:()=>this.removeBashInvocation(Y),complete:()=>this.removeBashInvocation(Y)})};cancelBashInvocations=()=>{let J=this.bashInvocations.find((Q)=>Q.toolRun.status==="in-progress");if(J)J.abortController.abort()};toggleConnectedClientsStatus=()=>{this.setState(()=>{this.connectedClientsStatusExpanded=!this.connectedClientsStatusExpanded})};showContextDetailOverlay=()=>{this.setState(()=>{this.isShowingContextDetailOverlay=!0}),this.fetchThreadCostInfo()};fetchThreadCostInfo=C46(()=>{let J=this.widget.dependencies.threadID;this.widget.dependencies.internalAPIClient.threadDisplayCostInfo({threadID:J},{config:this.widget.dependencies.configService}).then((Q)=>{if(Q.ok)this.setState(()=>{this.threadCostInfo=Q.result,this.threadCostInfoThreadID=J})}).catch(()=>{this.setState(()=>{this.threadCostInfo=void 0,this.threadCostInfoThreadID=J})})},150);maybeRefetchThreadCostInfo=(J,Q)=>{let Z=J!==this.threadCostInfoLastUsageLedgerLength,Y=Q==="idle"&&this.lastInferenceState==="running";if(this.threadCostInfoLastUsageLedgerLength=J,this.lastInferenceState=Q,Z||Y)this.fetchThreadCostInfo()};toggleAgentMode=()=>{if(!this.agentModeController)return;if(this.agentModeController.toggle())this.setState(()=>{this.showImageUnsupportedHint=!1,this.agentModePulseSeq++})};startAgentModeSlide=()=>{if(this.agentModeSlideTimer)clearInterval(this.agentModeSlideTimer);this.setState(()=>{this.agentModeSlideProgress=0});let J=800,Q=16,Z=Q/J;this.agentModeSlideTimer=setInterval(()=>{this.setState(()=>{if(this.agentModeSlideProgress!==null){if(this.agentModeSlideProgress=Math.min(1,this.agentModeSlideProgress+Z),this.agentModeSlideProgress>=1){if(this.agentModeSlideProgress=null,this.agentModeSlideTimer)clearInterval(this.agentModeSlideTimer),this.agentModeSlideTimer=null}}})},Q)};handleInsertImage=(J)=>{let Q=this.getEffectiveAgentMode();if(!ak(Q)){if(this.imageUnsupportedHintTimer)clearTimeout(this.imageUnsupportedHintTimer);return this.setState(()=>{this.showImageUnsupportedHint=!0}),this.imageUnsupportedHintTimer=setTimeout(()=>{this.setState(()=>{this.showImageUnsupportedHint=!1}),this.imageUnsupportedHintTimer=null},5000),!1}if(this.imageAttachments.length>=sF)return!1;let Z=HC(J);if(typeof Z==="object")return this.setState(()=>{this.imageAttachments=[...this.imageAttachments,Z]}),!1;return this.setState(()=>{this.displayMessage=Error(`Failed to attach image: ${Z}`)}),!1};handlePopImage=()=>{if(this.imageAttachments.length>0)this.setState(()=>{this.imageAttachments=this.imageAttachments.slice(0,-1)})};handleShowMysteryModal=()=>{if(this.mysteriousMessage)this.setState(()=>{this.isShowingMysteriousMessageModal=!0})};handleDestructMysteriousMessage=()=>{if(!this.mysteriousMessage)return;let J=this.mysteriousMessage.id;this.widget.dependencies.internalAPIClient.markAsReadMysteriousMessage({messageId:J},{config:this.widget.dependencies.configService}).then((Q)=>{if(!Q.ok)x.error("Failed to destruct mysterious message",Q.error);else this.setState(()=>{this.mysteriousMessage=null,this.isShowingMysteriousMessageModal=!1})}).catch((Q)=>{x.error("Failed to destruct mysterious message",Q)})};openInEditor=async(J)=>{let{mkdtemp:Q,readFile:Z,unlink:Y,rmdir:X,writeFile:G}=await import("node:fs/promises"),{tmpdir:V}=await import("node:os"),K=await import("node:path");try{let q=await Q(K.join(V(),"amp-edit-")),W=K.join(q,"message.amp.md");await G(W,J,"utf-8"),await _$(W);try{let H=await Z(W,"utf-8");this.textController.text=H}catch(H){if(H?.code!=="ENOENT")x.error("Failed to read temporary file",H)}try{await Y(W),await X(q)}catch(H){x.warn("Failed to clean up temporary file",H)}}catch(q){x.error("Error opening editor:",q)}};onTextSubmitted=async(J)=>{if(!J.trim())return;let Q=iB(J);if(Q)if(!Q.cmd){this.showSubmitDisabledHint("No command provided");return}else if(this.isProcessing()){this.showSubmitDisabledHint("Unable to use shell mode while agent is active");return}else{this.invokeBashCommand(Q.cmd,{visibility:Q.visibility}),this.widget.dependencies.history.add(J),this.textController.clear(),this.resetHistory();return}this.textController.clear(),this.resetHistory(),await this.updateGitBranch(),await this.sendUserMessage(J)};agentModeListener=()=>{this.setState(()=>{})};initState(){if(oY.getInstance().interceptConsole(),this.freeTierStatus=this.widget.dependencies.freeTierStatus,this.threadPreviewController.setThreadService(this.widget.dependencies.threadService),this.threadPreviewController.addListener(this.previewControllerListener),this.widget.dependencies.openThreadSwitcher)this.showStandaloneThreadPicker();h8.instance.on("key",()=>{this.lastUserInteractionTime=Date.now()}),h8.instance.on("mouse",()=>{this.lastUserInteractionTime=Date.now()}),h8.instance.on("paste",()=>{this.lastUserInteractionTime=Date.now()}),this.autocompleteFocusNode.addListener((Z)=>{S8.instance.addPostFrameCallback(()=>{this.setState(()=>{this.isTextfieldAndAutocompleteFocused=Z.hasFocus})})}),V6(this.widget.dependencies.configService.config).then((Z)=>{this.paletteConfig=Z,this.agentModeController=new Ij1({initialCliMode:this.widget.dependencies.initialAgentMode,sessionState:this.widget.dependencies.sessionState??null,freeTierStatus:this.freeTierStatus,initialSettings:Z.settings,config$:this.widget.dependencies.configService.config,getThread:()=>this.widget.dependencies.getCurrentWorker()?.thread??this.widget.dependencies.worker.thread}),this.agentModeController.addListener(this.agentModeListener)}),this.updateGitBranch(),this.balanceInfoSubscription=Q16(async()=>{let Z=await this.widget.dependencies.internalAPIClient.userDisplayBalanceInfo({},{config:this.widget.dependencies.configService});if(!Z.ok)throw Z.error;return Z.result}).subscribe({next:(Z)=>{this.setState(()=>{this.userDisplayBalanceInfo=Z})},error:(Z)=>{x.debug("Failed to fetch user balance info",Z)}}),this.scheduleAdSubscriptionWithIdeReadiness();let{mcpTrustHandler:J}=this.widget.dependencies;this.mcpTrustSubscription=J.pendingServers$.subscribe((Z)=>{this.setState(()=>{this.pendingMCPServers=Z})}),eR1((Z)=>{this.setState(()=>{this.pendingOAuthRequest=Z})}),this.mcpServersSubscription=this.widget.dependencies.mcpService.servers.subscribe((Z)=>{this.setState(()=>{this.mcpServers=Z})}),this.cacheTimerSubscription=this.widget.dependencies.worker.cacheTimer.subscribe((Z)=>{this.setState(()=>{this.cacheTimerState=Z})}),this.ideStatusSubscription=this.widget.dependencies.ideClient.status.subscribe((Z)=>{let Y=this.isIdeReadyForAdContext();if(this.setState(()=>{this.ideStatus=Z}),!Y&&this.isIdeReadyForAdContext()){if(this.adReadinessTimeout)clearTimeout(this.adReadinessTimeout),this.adReadinessTimeout=null;if(!this.adSubscription)this.subscribeToAds()}}),this.ideMessageSubscription=this.widget.dependencies.ideClient.messages.subscribe(async(Z)=>{let Y=this.widget.dependencies.getCurrentWorker();if(!Y){x.warn("No active thread worker found to handle IDE message");return}await new Promise((X)=>setTimeout(X,50)),await Y.handle({type:"user:message",message:{content:[{type:"text",text:Z}]}}),x.debug("Message sent from IDE to agent",{message:Z.slice(0,100)})}),this.ideAppendToPromptSubscription=this.widget.dependencies.ideClient.appendToPrompt.subscribe((Z)=>{this.textController.insertText(Z),x.debug("Appended text to CLI prompt from IDE",{text:Z.slice(0,100)})}),this.connectedClientsStatusSubscription=this.widget.dependencies.connectedClientsService.status.subscribe((Z)=>{this.setState(()=>{this.connectedClientsStatus=Z})}),this.updateServiceSubscription=this.widget.dependencies.updateService.state.subscribe((Z)=>{this.setState(()=>{this.updateState=Z})}),this.mysteriousMessageSubscription=l41(this.widget.dependencies.configService).pipe(g5((Z)=>Z!=="pending"),Q6((Z)=>i41(Z)?Z.mysteriousMessage??null:null),U4((Z,Y)=>Z?.id===Y?.id)).subscribe((Z)=>{this.setState(()=>{if(Z?.id!==this.mysteriousMessage?.id)this.isShowingMysteriousMessageModal=!1;if(this.mysteriousMessage=Z,Z&&!this.mysterySequenceManager)this.mysterySequenceManager=new K81(new Map([[new V81(o91.MYSTERY_SEQUENCE),new Fg]])),this.mysteryKeyInterceptorUnsubscribe=h8.instance.addKeyInterceptor((Y)=>{if(!this.mysterySequenceManager)return!1;if(this.isShowingMysteriousMessageModal)return!1;let X=this.mysterySequenceManager.handleKeyEvent(Y);if(X.consumed){if(X.intent)this.handleShowMysteryModal();return this.setState(()=>{this.mysterySequenceProgress=X.progress}),!0}else if(this.mysterySequenceProgress)this.setState(()=>{this.mysterySequenceProgress=null});return!1});else if(!Z)this.mysteryKeyInterceptorUnsubscribe?.(),this.mysteryKeyInterceptorUnsubscribe=null,this.mysterySequenceManager?.dispose(),this.mysterySequenceManager=null,this.mysterySequenceProgress=null})}),this.textController.addListener(this.textChangeListener),this.updateTerminalTitle();let Q=this.widget.dependencies.ideClient.getSelectedConfig();if(Q)this.connectToSelectedIde(Q,"auto-startup").catch((Z)=>{let Y=Z instanceof Error?Z.message:String(Z);this.setState(()=>{this.displayMessage=Error(`Failed to connect to IDE: ${Y}`)})});else if(this.widget.dependencies.showIdePicker)this.openIdePicker();else if(this.widget.dependencies.showIdePickerHint)this.toastController.show("Use /ide to connect to an IDE","success",5000);else if(this.widget.dependencies.showJetBrainsInstaller)this.openJetBrainsInstaller();if(this.widget.dependencies.replayMode)setTimeout(()=>this.startReplay(),100);this.initThreadFeed(),this.initNewsFeed()}didUpdateWidget(J){super.didUpdateWidget(J),this.setupSelectionListener();let Q=this.widget.dependencies.threadID;if(this.threadCostInfoThreadID!==void 0&&this.threadCostInfoThreadID!==Q)this.threadCostInfo=void 0,this.threadCostInfoThreadID=void 0,this.threadCostInfoLastUsageLedgerLength=0,this.fetchThreadCostInfo();let{threadState:Z}=this.widget.dependencies;this.maybeRefetchThreadCostInfo(Z.mainThread?.usageLedger?.events.length??0,Z.viewState.state==="active"?Z.viewState.inferenceState:void 0)}dispose(){if(this.replayAbortController.abort(),this.replayTypingTimer)clearTimeout(this.replayTypingTimer);if(this.ideStatusSubscription)this.ideStatusSubscription.unsubscribe();if(this.ideMessageSubscription)this.ideMessageSubscription.unsubscribe();if(this.ideAppendToPromptSubscription)this.ideAppendToPromptSubscription.unsubscribe();if(this.connectedClientsStatusSubscription)this.connectedClientsStatusSubscription.unsubscribe();if(this.updateServiceSubscription)this.updateServiceSubscription.unsubscribe();if(this.agentModeController)this.agentModeController.removeListener(this.agentModeListener),this.agentModeController.dispose();if(this.adReadinessTimeout)clearTimeout(this.adReadinessTimeout),this.adReadinessTimeout=null;if(this.adSubscription)this.adSubscription.unsubscribe();if(this.balanceInfoSubscription)this.balanceInfoSubscription.unsubscribe();if(this.mcpTrustSubscription)this.mcpTrustSubscription.unsubscribe();if(eR1(null),this.mcpServersSubscription)this.mcpServersSubscription.unsubscribe();if(this.cacheTimerSubscription)this.cacheTimerSubscription.unsubscribe();if(this.threadLoadSubscription)this.threadLoadSubscription.unsubscribe();if(this.threadFeedSubscription)this.threadFeedSubscription.unsubscribe();if(this.newsFeedSubscription)this.newsFeedSubscription.unsubscribe();if(this.threadFeedRotationTimer)clearInterval(this.threadFeedRotationTimer);if(this.agentModeSlideTimer)clearInterval(this.agentModeSlideTimer),this.agentModeSlideTimer=null;if(this.mysteriousMessageSubscription)this.mysteriousMessageSubscription.unsubscribe();if(this.mysteryKeyInterceptorUnsubscribe?.(),this.mysterySequenceManager?.dispose(),this.threadPreviewController.removeListener(this.previewControllerListener),this.threadPreviewController.dispose(),this.toastController.dispose(),this.exitConfirmTimeout)clearTimeout(this.exitConfirmTimeout),this.exitConfirmTimeout=null;if(this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;this.textController.removeListener(this.textChangeListener);for(let J of this.messageScrollControllers.values())J.dispose();if(this.messageScrollControllers.clear(),process.stdout.write(IC1("")),this.shouldUseProgressBar())process.stdout.write(j66())}getCurrentConfirmation(){let{threadState:J}=this.widget.dependencies,Y=[...J.items.filter((K)=>K.type==="toolResult").map((K)=>({toolUse:K.toolUse,toolRun:K.toolResult.run,subthreadID:void 0})),...J.subagentActiveTools].filter((K)=>K.toolRun.status==="blocked-on-user");if(Y.length===0)return null;let X=Y[0],G=X.toolRun.status==="blocked-on-user"?X.toolRun.toAllow??[]:[],V=X.toolRun.status==="blocked-on-user"?X.toolRun.reason:void 0;return{type:"tool-use",tools:[{useBlock:X.toolUse,toAllow:G}],subthreadID:X.subthreadID,reason:V}}shouldUseProgressBar(){return!1}updateProgressBar(){}static AD_READINESS_TIMEOUT_MS=1000;scheduleAdSubscriptionWithIdeReadiness(){if(this.isIdeReadyForAdContext()){this.subscribeToAds();return}this.adReadinessTimeout=setTimeout(()=>{if(this.adReadinessTimeout=null,!this.adSubscription)this.subscribeToAds()},o91.AD_READINESS_TIMEOUT_MS)}isIdeReadyForAdContext(){let J=this.ideStatus;if(!J||!J.enabled)return!1;return Boolean(J.openFile||J.visibleFiles&&J.visibleFiles.length>0)}subscribeToAds(){if(this.adSubscription)return;this.adSubscription=cC1(this.widget.dependencies.internalAPIClient,this.widget.dependencies.configService,()=>{let J=this.agentModeController?.getMode();return(J&&P9(J)||this.randomAd===null)&&dC1(this.lastUserInteractionTime)},this.widget.dependencies.codebaseContextService).subscribe({next:(J)=>{if(J){let Q=QF8(16).toString("hex");this.lastAdImpressionId=Q,Promise.resolve().then(() => (a91(),n91)).then(({recordAdEvent:Z})=>{let Y=this.widget.dependencies.worker.thread,X=Y.messages[Y.messages.length-1];Z("viewed",{adId:J.id,advertiserId:J.advertiserId,threadId:Y.id,messageId:X?.messageId,impressionId:Q,placement:"tui",matchType:J.metadata?.matchType,matchedPatterns:J.metadata?.matchedPatterns,candidateAdPoolCount:J.metadata?.candidateAdPoolCount,clientRegion:J.metadata?.clientRegion})})}this.setState(()=>{this.randomAd=J}),S8.instance.addPostFrameCallback(()=>{if(!this.isMessageViewInSelectionMode&&!this.isShowingPalette&&!this.isShowingIdePicker)this.autocompleteFocusNode.requestFocus()})}})}onConfirmationResponse=async(J)=>{let Q=this.getCurrentConfirmation();if(!Q||Q.type!=="tool-use"){x.error("No current tool confirmation found");return}let Z=Q.tools[0]?.useBlock;if(!Z){x.error("No tool use block found in confirmation");return}if(J==="allow-all-session")OG("dangerouslyAllowAll",!0);if(J==="allow-all-persistent")try{await this.widget.dependencies.settingsStorage.set("dangerouslyAllowAll",!0,"global")}catch(X){if(X&&X instanceof Error)this.setState(()=>{this.displayMessage=X});else x.error("Failed to write dangerouslyAllowAll setting:",X);return}if(J==="always-guarded"){let X=Q.tools[0]?.toAllow??[],G=await this.widget.dependencies.settingsStorage.get("guardedFiles.allowlist")||[],V=[...X,...G];await this.widget.dependencies.settingsStorage.set("guardedFiles.allowlist",V,"global")}if(J==="connect-github"){let X=new URL("/settings#code-host-connections",this.widget.dependencies.ampURL).toString();await f2(this.context,X);return}if(J==="disable-librarian"){let X=await this.widget.dependencies.settingsStorage.get("tools.disable")??[];if(!X.includes(DY))await this.widget.dependencies.settingsStorage.set("tools.disable",[...X,DY],"global")}let Y=J!==null&&["yes","allow-all-session","allow-all-persistent","always-guarded"].includes(J);try{let X={type:"user:tool-input",toolUse:Z.id,value:{accepted:Y}};if(Q.subthreadID)await(await Y2.getOrCreateForThread(this.widget.dependencies.workerDeps,Q.subthreadID)).handle(X);else await this.widget.dependencies.worker.handle(X)}catch(X){x.error("Failed to send tool confirmation:",X)}};showConfirmationOverlay=(J)=>{this.setState(()=>{this.isShowingConfirmationOverlay=!0,this.confirmationOverlayContent=J})};getErrorKey(J){return`${J.constructor.name}:${J.message}`}getCurrentEphemeralError(){let{threadState:J}=this.widget.dependencies,Q=J.viewState;if(Q.state!=="active"||!Q.ephemeralError)return null;let Z=this.getErrorKey(Q.ephemeralError);if(this.dismissedEphemeralErrorKey===Z)return null;return Q.ephemeralError}handleEphemeralErrorResponse=async(J)=>{let Q=this.getCurrentEphemeralError(),Z=this.widget.dependencies.worker;switch(J){case"retry":this.dismissedEphemeralErrorKey=null,await Z.retry();break;case"dismiss":if(Q)this.dismissedEphemeralErrorKey=this.getErrorKey(Q);break;case"new-thread":{this.setState(()=>{this.dismissedEphemeralErrorKey=null}),await this.startAndSwitchToNewThread();break}case"new-smart-thread":{this.agentModeController?.setMode("smart"),this.setState(()=>{this.dismissedEphemeralErrorKey=null}),g61({agentMode:"smart"}),await this.startAndSwitchToNewThread();break}case"handoff":{if(Q)this.dismissedEphemeralErrorKey=this.getErrorKey(Q);this.showCommandPalette({type:"normal",commandId:"handoff"});break}}this.setState(()=>{})};handleDisplayMessageDismiss=()=>{this.setState(()=>{this.displayMessage=null})};handleMCPTrustOpenSettings=async()=>{let{mcpTrustHandler:J,settingsStorage:Q}=this.widget.dependencies;await J.deny();try{await _$(Q.getSettingsFilePath())}catch(Z){let Y=Z instanceof Error?Z.message:String(Z);await this.showErrorMessage(`Failed to open settings: ${Y}`)}};cancelStreamingMessage=async()=>{await Y2.cancel(this.widget.dependencies.threadID)};markLastUserMessageAsInterrupted=async()=>{let J=this.widget.dependencies.threadState.mainThread;if(!J)return;for(let Q=J.messages.length-1;Q>=0;Q--){let Z=J.messages[Q];if(Z?.role==="user"&&!Z.interrupted){await this.widget.dependencies.worker.handle({type:"user:message:interrupt",messageIndex:Q});break}}};switchToExistingThread=async(J,Q={})=>{let{recordInNavigationHistory:Z=!0}=Q;if(Z){let Y=this.widget.dependencies.worker.thread.id;if(Y!==J)this.recordNavigation(Y)}try{x.info(`[switchToExistingThread] Switching to thread: ${J}`);let Y=await this.widget.dependencies.switchToThread(J);if(x.info(`[switchToExistingThread] Got worker for thread ${J}, thread.agentMode: ${Y.thread.agentMode}`),this.widget.dependencies.worker=Y,this.widget.dependencies.threadID=Y.thread.id,this.widget.dependencies.switchWorker(Y),x.info("[switchToExistingThread] Clearing agent mode"),this.agentModeController?.setMode(null),Y.thread.draft)if(x.info("[switchToExistingThread] Loading draft content into text controller"),this.textController.clear(),typeof Y.thread.draft==="string")this.textController.insertText(Y.thread.draft);else{let X=Y.thread.draft.filter((K)=>K.type==="text"),G=Y.thread.draft.filter((K)=>K.type==="image"),V=X.map((K)=>K.text).join(`
|
|
4908
4908
|
`);if(V)this.textController.insertText(V);if(G.length>0)this.setState(()=>{this.imageAttachments=G})}}catch(Y){throw x.error("Failed to switch to thread:",J,Y),Error(`Failed to switch to thread: ${J}`)}};sendUserMessage=async(J)=>{await this.proceedWithUserMessage(J)};proceedWithUserMessage=async(J)=>{this.cancelBashInvocations(),this.widget.dependencies.history.add(J);let Q=this.widget.dependencies.getCurrentWorker()||this.widget.dependencies.worker,Z=s2(Q.thread)===0,Y=this.getEffectiveAgentMode();if(Q.thread.agentMode&&!Z&&Y!==Q.thread.agentMode){await this.showErrorMessage(`This thread uses ${Q.thread.agentMode} mode. To change mode, edit the first message or create a new thread.`);return}let X=[{type:"text",text:J}];if(this.imageAttachments.length>0)X.push(...this.imageAttachments);if(Z)this.startAgentModeSlide();if(await Q.handle({type:"user:message",message:{content:X,agentMode:Y}}),Z)g61({agentMode:Y});this.scrollMessageViewToBottom(),this.setState(()=>{if(this.imageAttachments=[],!this.hasSubmittedFirstMessage)this.hasSubmittedFirstMessage=!0}),S8.instance.addPostFrameCallback(()=>{if(!this.isMessageViewInSelectionMode&&!this.isShowingPalette&&!this.isShowingIdePicker)this.autocompleteFocusNode.requestFocus()})};async showErrorMessage(J){this.setState(()=>{this.displayMessage=Error(J)})}exitApplication=async()=>{this.setState(()=>{this.isExiting=!0});let J=this.widget.dependencies.threadState.mainThread;if(J?.messages.length===0){if(J.relationships?.find((Y)=>Y.type==="handoff"&&Y.role==="child"))await this.widget.dependencies.threadService.discardHandoffThread(J.id).catch(()=>{})}let Q=this.getEffectiveAgentMode();g61({agentMode:Q}).catch((Z)=>{x.warn("Failed to save session state on exit:",Z)}).finally(()=>{h8.instance.stop()})};onExitPressed=()=>{if(this.isConfirmingExit){if(this.exitConfirmTimeout)clearTimeout(this.exitConfirmTimeout),this.exitConfirmTimeout=null;this.exitApplication()}else{if(this.setState(()=>{this.isConfirmingExit=!0}),this.exitConfirmTimeout)clearTimeout(this.exitConfirmTimeout);this.exitConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingExit=!1}),this.exitConfirmTimeout=null},1000)}};toHomeRelative(J){let Q=ZF8();if(J===Q)return"~";if(J.startsWith(Q+vg.sep))return"~"+J.slice(Q.length);return J}shorten(J){let Q=J.split(vg.sep).filter(Boolean);if(Q.length<=5)return J;return[Q.slice(0,2).join(vg.sep),"…",Q.slice(-2).join(vg.sep)].join(vg.sep)}build(J){let Q=S4.of(J),Z=X6.of(J),Y=Z.base;this.themeColors=Y;let{colors:X,app:G}=Z;this.themeApp=G;let V=this.widget.dependencies.getCurrentWorker()||this.widget.dependencies.worker,K=V.thread.agentMode&&P9(V.thread.agentMode),q=this.widget.dependencies.features.some((V4)=>V4.name===tC1.UBI&&V4.enabled),W=this.widget.dependencies.freeTierStatus.canUseAmpFree&&q,H=(K||W)&&this.randomAd!==null,z=!K&&this.currentThreadFeedEntry!==null&&!this.threadFeedHidden,U=Boolean(H),{threadState:D}=this.widget.dependencies;this.updateTerminalTitle(),this.updateProgressBar();let M=this.getCurrentConfirmation(),L=this.widget.dependencies.replayMode,A=Boolean(L),E=D.items,I=D.mainThread||void 0,P=D.subagentToolsByParentID,R=D.todosList;if(A){let V4={...L.thread,messages:this.replayDisplayedMessages};E=RC(V4).items,I=V4,P={};let q4=aE({messages:this.replayDisplayedMessages});R=Array.isArray(q4)?q4:[]}let y=I?.id,k=I,v=A?this.replayDisplayedMessages.length===0:this.isTranscriptEmpty(),g=(V4)=>new z91({key:new n7(`preview-message-view-${V4.id}`),items:RC(V4).items,controller:this.threadPreviewController.scrollController,autofocus:!1,thread:V4,focusNode:new $8({debugLabel:"PreviewFocus"})}),d=this.previewThread,b=d?d.messages.length>2000?new x0({mainAxisSize:"max",children:[new c6({child:new Q0}),new W6({padding:H0.all(2),child:new C4({child:new S1({text:new l("Thread too long for preview",new r({color:X.mutedForeground,dim:!0}))})})})]}):g(d):v?new N91({agentMode:this.getEffectiveAgentMode(),mysteriousMessage:this.mysteriousMessage,mysterySequenceProgress:this.mysterySequenceProgress,onShowMysteryModal:this.handleShowMysteryModal,userDisplayBalanceInfo:this.userDisplayBalanceInfo}):new z91({key:y?new n7(`message-view-${y}`):void 0,items:E,subagentToolsByParentID:P,controller:y?this.getMessageScrollController(y):new l5,autofocus:!1,onCopy:A?void 0:this._handleTextCopy.bind(this),thread:k,onMessageEditSubmit:A?void 0:this.handleMessageEditSubmit,onMessageRestoreSubmit:A?void 0:this.handleMessageRestoreSubmit,onMessageForkSubmit:A?void 0:this.forkMessage,getAffectedFiles:A?void 0:this.getAffectedFiles,focusNode:this.messageViewFocusNode,onDismissFocus:()=>{if(this.setState(()=>{this.isMessageViewInSelectionMode=!1}),!this.isShowingIdePicker)this.autocompleteFocusNode.requestFocus()},isInSelectionMode:this.isMessageViewInSelectionMode}),a=Math.max(Math.floor(Q.size.height*0.4),12),G1=this.getCurrentEphemeralError(),t=Q.size.width<40,c=D.mainThread?Xn(D.mainThread):void 0,J1=J91(J),q1=this.buildBottomWidget(G1,M,X,Z,D,R,a,U,A,c,this.cacheTimerState??void 0,Q,J1),L1=new T81({threadViewState:D.viewState,threadTokenUsage:c,threadID:y??null,thread:D.mainThread??void 0,onFileChangesClick:()=>{this.setState(()=>{this.isShowingFileChangesOverlay=!this.isShowingFileChangesOverlay})},onShowIdePicker:this.openIdePicker,ideStatus:this.ideStatus,connectedClientsStatus:this.connectedClientsStatus,mcpServers:this.mcpServers,isNarrow:t,uiHint:this.getUIHint()??void 0,waitingForConfirmation:!!M,showingEphemeralError:Boolean(D.viewState.state==="active"&&D.viewState.ephemeralError),runningBashInvocations:this.bashInvocations.length>0,executingCommand:this.executingCommand?.name??null,executingCommandNoun:this.executingCommand?.noun??null,executingCommandVerb:this.executingCommand?.verb??null,executingCommandMessage:this.executingCommand?.statusMessage??null}),s=new I81({bashInvocations:this.bashInvocations}),o=[];if(z&&this.currentThreadFeedEntry)o.push(new Uy1({entry:this.currentThreadFeedEntry,width:Q.size.width}));let i=this.getEffectiveAgentMode(),z1=this.currentShellModeStatus,k1=wy1(i),e=!z1?i.length+1:0,f1=Q.capabilities.animationSupport,P1=f1==="disabled"?0:f1==="slow"?30:60,I0=wK(i)?.uiHints?.fasterAnimation?3:1,_1=P1>0&&this.agentModePulseSeq>0?new v9({children:[q1,new v5({top:0,left:1,right:1,height:1,child:new Ky1({color:k1,trigger:this.agentModePulseSeq,fps:P1,speed:I0,leftOffset:e})})]}):q1;o.push(new c6({child:b}),s);let o1=new v9({children:[new x0({mainAxisSize:"min",children:[H?new Nk1({ad:this.randomAd,onButtonClick:async()=>{let V4=this.randomAd;if(this.lastAdImpressionId)Promise.resolve().then(() => (a91(),n91)).then(({recordAdEvent:O9})=>{let Y5=this.widget.dependencies.worker.thread,d$=Y5.messages[Y5.messages.length-1];O9("clicked",{adId:V4.id,advertiserId:V4.advertiserId,threadId:Y5.id,messageId:d$?.messageId,impressionId:this.lastAdImpressionId,placement:"tui",actionType:"link_to",matchType:V4.metadata?.matchType,matchedPatterns:V4.metadata?.matchedPatterns,candidateAdPoolCount:V4.metadata?.candidateAdPoolCount,clientRegion:V4.metadata?.clientRegion})});if(!await f2(this.context,V4.shortDestinationUrl)){let Y5=h8.instance.tuiInstance.clipboard.isOsc52Supported();this.setState(()=>{this.adActionModal={showCopyOption:Y5,url:V4.shortDestinationUrl}})}}}):new Q0({height:0}),new b0({constraints:new A6(0,Q.size.width,0,a),child:_1})]}),U?new v5({top:0,left:0,right:0,child:new AJ6({userHeight:this.bottomGridUserHeight,maxHeight:a,onInitializeHeight:(V4)=>{this.setState(()=>{this.bottomGridUserHeight=Math.min(V4,a)})},onDrag:(V4)=>{if(this.bottomGridDragStartY===null)this.bottomGridDragStartY=Math.floor(V4.localPosition.y),this.bottomGridDragStartHeight=this.bottomGridUserHeight;let q4=Math.floor(V4.localPosition.y)-this.bottomGridDragStartY,O9=Math.max(4,this.bottomGridDragStartHeight-q4),Y5=Math.min(O9,a),d$=Math.floor(Y5);if(this.bottomGridUserHeight!==d$)this.setState(()=>{this.bottomGridUserHeight=d$})},onRelease:()=>{this.bottomGridDragStartY=null,this.bottomGridDragStartHeight=null}})}):new Q0({height:0})]});o.push(o1,new Q0({height:1,child:new W6({padding:H0.horizontal(1),child:L1})}));let F1=new x0({crossAxisAlignment:"stretch",mainAxisSize:"max",children:o}),w1=A&&L?.showIndicator!==!1?new v9({children:[F1,new v5({top:0,left:0,child:new Fy1})]}):F1,A1=new E8(()=>{if(this.isShowingPalette)return this.dismissPalette(),"handled";if(this.isShowingMCPStatusModal)return this.setState(()=>{this.isShowingMCPStatusModal=!1}),"handled";if(this.pendingMCPServers.length>0)return this.widget.dependencies.mcpTrustHandler.deny(),"handled";if(this.getCurrentEphemeralError())return this.handleEphemeralErrorResponse("dismiss"),"handled";if(this.displayMessage)return this.handleDisplayMessageDismiss(),"handled";if(this.isShowingHelp)return this.setState(()=>{this.isShowingHelp=!1}),"handled";if(this.isShowingFileChangesOverlay)return this.setState(()=>{this.isShowingFileChangesOverlay=!1}),"handled";if(this.isShowingContextDetailOverlay)return this.setState(()=>{this.isShowingContextDetailOverlay=!1}),"handled";if(this.isShowingIdePicker)return this.dismissIdePicker(),"handled";if(this.isShowingJetBrainsInstaller)return this.dismissJetBrainsInstaller(),"handled";if(this.isShowingConfirmationOverlay)return this.setState(()=>{this.isShowingConfirmationOverlay=!1,this.confirmationOverlayContent=""}),"handled";if(this.isShowingConsoleOverlay)return this.setState(()=>{this.isShowingConsoleOverlay=!1}),"handled";if(this.textController.hasSelection)return this.textController.clearSelection(),"handled";if(this.isConfirmingClearInput){if(this.textController.clear(),this.setState(()=>{this.isConfirmingClearInput=!1,this.imageAttachments=[]}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout),this.clearInputConfirmTimeout=null;return"handled"}if(this.isConfirmingCancelProcessing){if(this.bashInvocations.length>0)this.cancelBashInvocations();if(this.isProcessing())this.markLastUserMessageAsInterrupted().catch((q4)=>{x.error("Failed to mark message as interrupted:",q4)}),this.cancelStreamingMessage().catch((q4)=>{x.error("Failed to cancel streaming message:",q4)});if(this.setState(()=>{this.isConfirmingCancelProcessing=!1}),this.cancelProcessingConfirmTimeout)clearTimeout(this.cancelProcessingConfirmTimeout),this.cancelProcessingConfirmTimeout=null;return"handled"}if(this.executingCommand)return x.info("Canceling executing command:",this.executingCommand.name),this.executingCommand.abortController.abort(),"handled";if(this.bashInvocations.length>0||this.isProcessing()){if(this.setState(()=>{this.isConfirmingCancelProcessing=!0}),this.cancelProcessingConfirmTimeout)clearTimeout(this.cancelProcessingConfirmTimeout);return this.cancelProcessingConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingCancelProcessing=!1}),this.cancelProcessingConfirmTimeout=null},1000),"handled"}if(this.textController.text.trim()!==""||this.imageAttachments.length>0){if(this.setState(()=>{this.isConfirmingClearInput=!0}),this.clearInputConfirmTimeout)clearTimeout(this.clearInputConfirmTimeout);return this.clearInputConfirmTimeout=setTimeout(()=>{this.setState(()=>{this.isConfirmingClearInput=!1}),this.clearInputConfirmTimeout=null},1000),"handled"}return"ignored"}),R1=new E8(()=>{return this.onExitPressed(),"handled"}),j1=new E8(()=>{return this.setState(()=>{this.isShowingConsoleOverlay=!this.isShowingConsoleOverlay}),"handled"}),d1=new E8(()=>{return this.setState(()=>{this.isShowingMCPStatusModal=!this.isShowingMCPStatusModal}),"handled"}),m1=new E8(()=>{return AJ.instance.toggleAll(),"handled"}),r1=new E8(()=>{return this.widget.dependencies.configService.getLatest().then((V4)=>{OG("internal.showDetailedCosts",!(V4.settings["internal.showDetailedCosts"]??!1))}),"handled"}),K0=new E8(()=>{return h8.instance.toggleFrameStatsOverlay(),"handled"}),q0=new E8(()=>{return h8.instance.tuiInstance.getScreen().markForRefresh(),S8.instance.requestFrame(),"handled"}),k0=new E8(()=>{return this.toggleAgentMode(),"handled"}),h6=new E8(()=>{let q4=this.isShowingPalette&&this.previewThread?this.threadPreviewController.scrollController:(()=>{let{threadState:O9}=this.widget.dependencies,Y5=O9.mainThread?.id;return Y5?this.getMessageScrollController(Y5):null})();if(q4){let O9=Math.max(Math.floor(Q.size.height*0.4),10),Y5=Q.size.height-O9;q4.animatePageUp(Y5,100)}return"handled"}),d6=new E8(()=>{let q4=this.isShowingPalette&&this.previewThread?this.threadPreviewController.scrollController:(()=>{let{threadState:O9}=this.widget.dependencies,Y5=O9.mainThread?.id;return Y5?this.getMessageScrollController(Y5):null})();if(q4){let O9=Math.max(Math.floor(Q.size.height*0.4),10),Y5=Q.size.height-O9;q4.animatePageDown(Y5,100)}return"handled"}),e4=new E8(()=>{let q4=this.isShowingPalette&&this.previewThread?this.threadPreviewController.scrollController:(()=>{let{threadState:O9}=this.widget.dependencies,Y5=O9.mainThread?.id;return Y5?this.getMessageScrollController(Y5):null})();if(q4)q4.animateTo(0,100);return"handled"}),s8=new E8(()=>{let q4=this.isShowingPalette&&this.previewThread?this.threadPreviewController.scrollController:(()=>{let{threadState:O9}=this.widget.dependencies,Y5=O9.mainThread?.id;return Y5?this.getMessageScrollController(Y5):null})();if(q4)q4.animateTo(Number.MAX_SAFE_INTEGER,100);return"handled"}),r9=new E8(()=>{if(!this.isTextfieldAndAutocompleteFocused)return"ignored";let{threadState:V4}=this.widget.dependencies;if(!V4.mainThread?.messages.some((O9)=>O9.role==="user"||nE(O9)))return"ignored";return this.setState(()=>{this.isMessageViewInSelectionMode=!0}),"handled"}),E0=new E8((V4)=>{if(V4.direction==="previous")this.navigateHistoryPrevious();else this.navigateHistoryNext();return"handled"}),a0=new E8(()=>{if(!this.isTextfieldAndAutocompleteFocused)return"ignored";return M81().then(async(V4)=>{if(V4)try{this.handleInsertImage(V4)}finally{try{let{unlink:q4}=await import("node:fs/promises");await q4(V4)}catch{}}}),"handled"}),t6=new Map([[X4.ctrl("c"),new Gg],[X4.ctrl("l"),new Hg],[X4.ctrl("o"),new U81],[X4.ctrl("v"),new Xg],[X4.alt("s"),new BC],[X4.ctrl("s"),new BC],[X4.alt("p"),new Wg],[X4.ctrl("r"),new Kg],[X4.alt("d"),new qg],[X4.ctrl("t"),new zg],[X4.key("PageUp"),new W81],[X4.key("PageDown"),new H81],[X4.key("Home"),new z81],[X4.key("End"),new F81],[X4.key("Escape"),new $g],[X4.ctrl("p"),new NC("previous")],[X4.ctrl("n"),new NC("next")],[X4.key("Tab"),new Ug]]);if(!g3())t6.set(X4.key("ArrowUp"),new Ug);if(!1)t6.set(X4.alt("c"),new Vg);let d8=new E8(()=>{if(this.isShowingStandalonePalette())return"handled";return this.showCommandPalette(),"handled"}),w7=new E8(()=>{return this.toggleThreadPickerWorkspaceFilter(),"handled"}),h5=new E8(()=>{if(this.mysteriousMessage)this.handleShowMysteryModal();return"handled"}),G7=new Map([[$g,A1],[Hg,q0],[BC,k0],[U81,d8],[Xg,a0],[Vg,j1],[X81,d1],[Kg,m1],[qg,r1],[Wg,K0],[zg,w7],[Gg,R1],[W81,h6],[H81,d6],[z81,e4],[F81,s8],[Ug,r9],[NC,E0],[Fg,h5]]),c8=[w1];if(this.isShowingConsoleOverlay)c8.push(new dk1);if(this.isShowingHelp&&this.paletteConfig)c8.push(new ik1({commands:this.getPaletteCommands().getAllCommands()}));if(this.isShowingMCPStatusModal)c8.push(new f_1({servers:this.mcpServers,onDismiss:()=>{this.setState(()=>{this.isShowingMCPStatusModal=!1})}}));if(this.isShowingMysteriousMessageModal&&this.mysteriousMessage)c8.push(new Hy1({message:this.mysteriousMessage,onDestruct:this.handleDestructMysteriousMessage}));if(this.adActionModal)c8.push(new Dk1({title:"Failed to open browser",message:this.adActionModal.url,showCopyOption:this.adActionModal.showCopyOption,onSelect:async(V4)=>{let q4=this.adActionModal.url;if(V4==="copy")try{await h8.instance.tuiInstance.clipboard.writeText(q4),this.setState(()=>{this.displayMessage=new nQ("Link copied to clipboard")})}catch(O9){x.error("Failed to copy to clipboard",{error:O9}),this.setState(()=>{this.displayMessage=Error("Failed to copy to clipboard")})}this.setState(()=>{this.adActionModal=null})}}));if(this.pendingMCPServers.length>0){let{mcpTrustHandler:V4}=this.widget.dependencies;c8.push(new qy1({servers:this.pendingMCPServers,onAlwaysTrust:V4.trustAlways.bind(V4),onTrustOnce:V4.trustOnce.bind(V4),onOpenSettings:this.handleMCPTrustOpenSettings,onDismiss:V4.deny.bind(V4)}))}if(this.pendingOAuthRequest)c8.push(new zy1({request:this.pendingOAuthRequest,onDismiss:()=>{this.setState(()=>{this.pendingOAuthRequest=null})}}));if(this.isShowingFileChangesOverlay)c8.push(new FS1({threadData:D}));if(this.isShowingContextDetailOverlay){let V4=this.threadCostInfo?.costBreakdownURL;c8.push(new ck1({thread:D.mainThread??void 0,tokenUsage:c??void 0,cacheTimerState:this.cacheTimerState??void 0,costInfo:this.threadCostInfo,onDismiss:()=>{this.setState(()=>{this.isShowingContextDetailOverlay=!1})},onOpenCostBreakdown:V4?()=>{f2(J,V4)}:void 0}))}if(this.isShowingConfirmationOverlay)c8.push(new uk1({details:this.confirmationOverlayContent}));let d9=this.getCommandPaletteContext(J);if(d9&&this.isShowingPalette&&this.paletteConfig)c8.push(new C4({child:new mk1({commandContext:d9,mainThread:D.mainThread,commands:this.getPaletteCommands(),onDismiss:this.dismissPalette,showOptions:this.paletteShowOptions??void 0})}));if(this.isShowingIdePicker)c8.push(new ak1({onCancel:this.dismissIdePicker,onSelect:this.handleIdeSelection,jetbrainsMode:this.widget.dependencies.jetbrainsMode}));let Z8=new v9({children:c8});if(this.isShowingJetBrainsInstaller)return new sA({child:new NJ({actions:G7,child:new JX({shortcuts:t6,debugLabel:"jetbrains-installer-shortcuts",child:new Vy1({configService:this.widget.dependencies.configService,ideClient:this.widget.dependencies.ideClient,onExit:()=>process.exit(0),onContinue:this.dismissJetBrainsInstaller})})})});return new Xz({controller:this.toastController,child:new sA({child:new YS1({controller:this.toastController,child:new NJ({actions:G7,child:new JX({shortcuts:t6,debugLabel:"main-app-shortcuts",child:Z8})})})})})}buildScrollableTodoList(J,Q,Z){return new MJ6({todos:J,enabled:Q,controller:this.todoScrollController,appTheme:Z})}buildBottomWidget(J,Q,Z,Y,X,G,V,K,q,W,H,z,U){if(J)return new lk1({error:J,ampURL:this.widget.dependencies.ampURL,onResponse:this.handleEphemeralErrorResponse});if(Q){if(this.displayMessage)this.handleDisplayMessageDismiss();return new pk1({confirmationRequest:Q,onResponse:this.onConfirmationResponse,onShowOverlay:this.showConfirmationOverlay})}if(this.displayMessage)return new Wy1({message:this.displayMessage,onDismiss:this.handleDisplayMessageDismiss});let D=w81(Y),M=this.agentModeController?.isInRestrictedFreeMode()??!1,L=new WO({key:this.textFieldKey,controller:this.textController,triggers:q?[]:[new JN],completionBuilder:q?void 0:this.getCompletionBuilder(),ampURL:this.widget.dependencies.ampURL,onSubmitted:q?void 0:this.onTextSubmitted,theme:Z,placeholder:q?"Press Ctrl+C to exit":M?"Amp Free is not enabled. Press Ctrl+S to switch modes.":void 0,enabled:this.isTextfieldAndAutocompleteFocused&&!M&&!this.isShowingStandalonePalette(),shellPromptRules:D,focusNode:this.autocompleteFocusNode,autofocus:!this.isMessageViewInSelectionMode&&!this.isShowingStandalonePalette()&&!this.isShowingIdePicker,clipboard:h8.instance.tuiInstance.clipboard,onCopy:this._handleTextCopy.bind(this),onInsertImage:this.handleInsertImage,imageAttachments:this.imageAttachments,popImage:this.handlePopImage,previousThreadId:this.previousThreadIdForHint&&(X.mainThread?.messages.length??0)===0?this.previousThreadIdForHint:void 0,onPreviousThreadHintAccepted:()=>{let i=this.previousThreadIdForHint;if(i)this.setState(()=>{this.previousThreadIdForHint=null}),this.textController.text=`following: @${i} `},onDoubleAtTrigger:q?void 0:()=>{let i=this.textController.text,z1=this.textController.cursorPosition,e=i.slice(0,z1).lastIndexOf("@@");this.showCommandPalette({type:"standalone",commandId:"attach-plan",onBeforeExecute:()=>{if(e!==-1){let f1=this.textController.text,P1=f1.slice(0,e)+f1.slice(e+2);this.textController.text=P1,this.textController.cursorPosition=e}},onSubmit:()=>{this.dismissPalette()},onCancel:()=>{this.dismissPalette()}})}}),A=X.mainThread?.queuedMessages??[],E=Array.isArray(G)&&G.length>0,I=Array.isArray(A)&&A.length>0,P=X.mainThread?.agentMode==="plan"&&ZA(X.mainThread),R,y;if(P){if(R=new cB(new F91({thread:X.mainThread,onExecute:async()=>{let i=this.getCommandPaletteContext();if(i)await this.getPaletteCommands().execute("execute-plan",i,void 0,new AbortController)},onEdit:async()=>{try{let i=process.env.EDITOR||process.env.VISUAL||"nano",{filePath:z1}=await this.widget.dependencies.planFileManager.ensureSync(X.mainThread.id);h8.instance.tuiInstance.suspend();let{execSync:k1}=await import("child_process");k1(`${i} "${z1}"`,{stdio:"inherit"}),h8.instance.tuiInstance.resume()}catch(i){x.error("Failed to edit plan",i),this.setState(()=>{this.displayMessage=Error("Failed to edit plan")})}},controller:this.planScrollController,appTheme:Y}),{clipBehavior:"antiAlias"}),I)y=new i91({queuedMessages:A});else if(E)y=this.buildScrollableTodoList(G,this.isTextfieldAndAutocompleteFocused&&!M,Y)}else R=I?new i91({queuedMessages:A}):void 0,y=E?this.buildScrollableTodoList(G,this.isTextfieldAndAutocompleteFocused&&!M,Y):void 0;let k=[],v=this.currentShellModeStatus;if(v)k.push({child:new S1({text:new l(v==="hidden"?"shell mode (incognito)":"shell mode",new r({color:v==="hidden"?Y.app.shellModeHidden:Y.app.shellMode}))}),position:"top-left"});let d=this.connectedClientsStatus&&this.connectedClientsStatus.enabled?this.connectedClientsStatusExpanded?(this.connectedClientsStatus?.clientID?.length??7)+3:3:0,b=this.agentModeController?.getVisibleModes()??[];if(!v&&b.length>1){let i=this.previewThread,z1=i?i.agentMode??this.getEffectiveAgentMode():this.getEffectiveAgentMode(),k1=wy1(z1),e=this.widget.dependencies.getCurrentWorker()||this.widget.dependencies.worker,f1=i??e.thread,P1=s2(f1)>0,I0=this.agentModeSlideProgress!==null,_1,o1;if(I0){_1="top-left";let Y1=z.size.width-z1.length-4-d;o1=Math.floor(this.agentModeSlideProgress*Y1)}else if(P1)_1="top-right",o1=d;else _1="top-left",o1=void 0;if(i)k.push({child:new S1({text:new l(z1,new r({color:k1}))}),position:_1,offsetX:o1});else{let F1=!P1&&!I0,Y1=new S1({text:new l(z1,new r({color:k1}))});k.push({child:F1?new G8({child:Y1,onClick:this.toggleAgentMode,cursor:"pointer"}):Y1,position:_1,offsetX:o1})}}if(this.connectedClientsStatus&&this.connectedClientsStatus.enabled){let i=this.connectedClientsStatus,z1=i.mode||"disconnected",k1=!!i.errorMessage,e=i.clientID||"unknown",f1,P1;if(k1)f1="●",P1=H1.red;else if(z1==="presence")f1="○",P1=H1.yellow;else if(z1==="connected"&&i.connected)f1="●",P1=H1.green;else f1="○",P1=H1.yellow;let I0=this.connectedClientsStatusExpanded?`${e} ${f1}`:f1;k.push({child:new G8({child:new S1({text:new l(I0,new r({color:P1}))}),onClick:this.toggleConnectedClientsStatus,cursor:"pointer"}),position:"top-right",offsetX:-2})}let a=q?this.widget.dependencies.replayMode.thread.env?.initial.trees?.[0]?.uri:X.mainThread?.env?.initial.trees?.[0]?.uri,G1;if(a)G1=h0.parse(a).fsPath;else G1=process.cwd();let t=this.toHomeRelative(G1),c=this.shorten(t),J1=!q&&this.currentGitBranch?`${c} (${this.currentGitBranch})`:c;if(k.push({child:new S1({text:new l(J1,new r({color:Z.foreground,dim:!0}))}),position:"bottom-right"}),this.previousThreadIdForHint&&(X.mainThread?.messages.length??0)===0&&this.textController.text.trim()==="")k.push({child:new S1({text:new l("",void 0,[new l("press ",new r({color:Z.foreground,dim:!0})),new l("enter",new r({color:Y.app.keybind})),new l(" to reference the previous thread",new r({color:Z.foreground,dim:!0}))])}),position:"bottom-left"});let L1=this.previewThread,s=this.widget.dependencies.getCurrentWorker()||this.widget.dependencies.worker;if(s2(s.thread)>0&&!v&&!L1){let i=[],z1=new r({color:Z.foreground,dim:!0}),k1=new l(" · ",z1);if(W){let e=W.totalInputTokens/W.maxInputTokens,f1=Math.round(e*100),P1=Math.max(0,Math.min(f1,100)),I0=P81(e,W.maxInputTokens),_1=z1;if(I0==="danger")_1=new r({color:Z.destructive});else if(I0==="warning")_1=new r({color:Z.warning});else if(I0==="recommendation")_1=new r({color:Y.app.recommendation});let o1=Math.round(W.maxInputTokens/1000);i.push(new l(`${P1}% of ${o1}k`,_1))}if(U&&this.threadCostInfo){let e=j91(this.threadCostInfo,{colors:{foreground:Z.foreground},dim:!0});if(e.length>0){if(i.length>0)i.push(k1);i.push(...e)}}if(U&&H){let e=X.viewState.state==="active"&&X.viewState.inferenceState==="idle",f1=R46(H,e);if(f1){if(i.length>0)i.push(k1);let P1=z1;if(f1.urgency==="warning")P1=new r({color:Z.warning});i.push(new l(f1.text,P1))}}if(i.length>0){let e=new S1({text:new l("",void 0,i)});k.push({child:U?new G8({child:e,onClick:this.showContextDetailOverlay,cursor:"pointer"}):e,position:"top-left"})}}return new KS1({leftChild:new c6({child:L}),rightChild1:R,rightChild2:y,maxHeight:V,overlayTexts:k,borderColor:M||!this.isTextfieldAndAutocompleteFocused?H1.index(8):void 0,hasBanner:K,userHeight:this.bottomGridUserHeight,onInitializeHeight:(i)=>{this.setState(()=>{this.bottomGridUserHeight=Math.min(i,V)})},onDrag:(i)=>{if(this.bottomGridDragStartY===null)this.bottomGridDragStartY=Math.floor(i.localPosition.y),this.bottomGridDragStartHeight=this.bottomGridUserHeight;let z1=Math.floor(i.localPosition.y)-this.bottomGridDragStartY,k1=Math.max(4,this.bottomGridDragStartHeight-z1),e=Math.min(k1,V),f1=Math.floor(e);if(this.bottomGridUserHeight!==f1)this.setState(()=>{this.bottomGridUserHeight=f1})},onDragRelease:()=>{this.bottomGridDragStartY=null,this.bottomGridDragStartHeight=null},enableResize:!K})}}async function Ey1(J){if((await J.configService.getLatest()).settings["terminal.animation"]===!1)h8.instance.tuiInstance.setOptions({queryOptions:{animationDisabled:!0}});let Y=()=>null,G=!1,V=new rH(G,1000,J.inspectorPort),K=J.features.find((A)=>A.name===tC1.AMP_CONNECT)?.enabled??!1,q=new Uk1({threadService:J.threadService,worker:J.worker,builder:(A,E,I,P,R,y)=>{if(Y=R,J.threadDependencies&&K)wj1(J.threadDependencies,J.configService,R,P,J.connectedClientsService,J.startNewThread,J.switchToThread,J.clientId).catch((g)=>{x.error("Failed to start automatic presence:",g)});let k=R(),v={...J,worker:k,threadID:k.thread.id};return new DJ6({...v,threadState:E,workerController:I,switchWorker:P,getCurrentWorker:R,recentThreadIDs:y})}}),W=new qS1({configService:J.configService,child:q}),H=new h_1({configService:J.configService,child:W}),z=new oj1(H),U=new X6({data:DC.fromBaseTheme(k$.default()),child:z});try{await mC1(U,{onRootElementMounted:(A)=>{if(x.info("TUI input ready for user interaction"),G)V.start(A)}})}finally{if(G)V.stop();if(J.threadDependencies&&K){let{stopGlobalSession:A}=await Promise.resolve().then(() => (Ej1(),b86));A()}}let M=Y()?.thread.id||J.threadID,L=await J.threadService.get(M);if(L&&L.messages.length>0){let A=`${J.ampURL.replace(/\/$/,"")}/threads/${M}`;$96(L,A,J.stdout)}}function wy1(J){let Z=wK(J)?.uiHints?.secondaryColor;if(Z)return H1.rgb(Z.r,Z.g,Z.b);return XF8(J)}class MJ6 extends p0{props;constructor(J){super();this.props=J}createState(){return new LJ6}}class LJ6 extends u0{viewportHeight=1;scrollListenerAttached=!1;initState(){if(!this.scrollListenerAttached)this.widget.props.controller.addListener(()=>{this.updateViewportHeight()}),this.scrollListenerAttached=!0}build(J){let{todos:Q,controller:Z,appTheme:Y}=this.widget.props;return new B6({crossAxisAlignment:"stretch",children:[new c6({child:new W5({controller:Z,autofocus:!1,child:new Bk1({todos:Q})})}),new LJ({controller:Z,thumbColor:Y.app.scrollbarThumb,trackColor:Y.app.scrollbarTrack,getScrollInfo:()=>{let{maxScrollExtent:X,offset:G}=Z,V=this.viewportHeight,K=X+V;return{totalContentHeight:Math.max(K,0),viewportHeight:Math.max(V,1),scrollOffset:Math.max(G,0)}}})]})}updateViewportHeight(){let J=this.getViewportHeight();if(J!==this.viewportHeight)this.viewportHeight=J}getViewportHeight(){let J=this.context.findRenderObject();if(!J)return this.viewportHeight;let Q=(Y,X=0)=>{if(Y&&"size"in Y&&"children"in Y){let G=Y.children||[];for(let V of G){if(V&&"size"in V){let q=V.size;if(typeof q?.height==="number"&&q.height>0)return q.height}let K=Q(V,X+1);if(K>0)return K}}return 0},Z=Q(J);if(Z>0)return Z;if("size"in J){let Y=J.size;if(typeof Y?.height==="number"&&Y.height>0)return Y.height}return this.viewportHeight}}class AJ6 extends I6{props;constructor(J){super();this.props=J}build(J){return new G8({child:new Q0({height:1}),cursor:C9.NS_RESIZE,onDrag:(Q)=>{if(this.props.userHeight===void 0){let Y=J.findRenderObject()?.size.height??0;if(Y>0){this.props.onInitializeHeight(Y);return}}this.props.onDrag(Q)},onRelease:this.props.onRelease})}}function XF8(J){let Q=0;for(let X=0;X<J.length;X++){let G=J.charCodeAt(X);Q=(Q<<5)-Q+G,Q=Q&Q}let Z=[9,10,11,12,13,14,15,208,209,210,211,212,213,214,215],Y=Math.abs(Q)%Z.length;return H1.index(Z[Y])}bC1();try{if(process.platform==="win32")await Promise.resolve().then(() => q6(oC(),1))}catch{}if(process.env.AMP_PWD)try{process.chdir(process.env.AMP_PWD),delete process.env.AMP_PWD}catch(J){JZ.write(`Failed to change directory to ${process.env.AMP_PWD}: ${J}
|
|
4909
|
-
`)}var tx1=sx1.join(kq0||sx1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function PD8(J){process.emitWarning=function(Q,Z,Y,X){let G=typeof Q==="string"?Q:Q.message||String(Q),V=Z||"Warning",K=!1;J.warn(G,{name:V,code:Y})}}function SV(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")OG("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("mode")==="cli")OG("experimental.agentMode",Q.mode);if(J.getOptionValueSourceWithGlobals("useSonnet")==="cli")OG("model.sonnet",Q.useSonnet)}async function Jv1(J){try{await wD8(sx1.dirname(tx1),{recursive:!0}),await ED8(tx1,J,"utf-8")}catch(Q){x.debug("Failed to save last thread ID",Q)}}async function TD8(){try{return(await nY6(tx1,"utf-8")).trim()}catch(J){return null}}function RD8(J){return!!(J&&(J.endsWith("@sourcegraph.com")||J.endsWith("@ampcode.com")||J==="auth-bypass-user@example.com"))}async function CD8(J){try{let Q=await K5.getUserInfo({},{config:J,signal:AbortSignal.timeout(5000)});if(Q.ok)return Q.result}catch(Q){x.debug("Failed to fetch user info:",Q)}return}var cY6=[{name:"notifications",long:"notifications",type:"flag",description:(J)=>`${J?"Enable":"Disable"} sound notifications (enabled by default when not in execute mode)`},{name:"color",long:"color",type:"flag",description:(J)=>`${J?"Enable":"Disable"} color output (enabled by default if stdout and stderr are sent to a TTY)`,deprecated:!0},{name:"settingsFile",long:"settings-file",type:"option",default:process.env.AMP_SETTINGS_FILE??P$,description:`Custom settings file path (overrides the default location ${P$})`},{name:"logLevel",long:"log-level",type:"option",description:`Set log level (${Object.keys(x).join(", ")})`},{name:"logFile",long:"log-file",type:"option",description:`Set log file location (overrides the default location ${xA})`},{name:"format",long:"format",type:"option",description:"output using the standard or new-ui. Options: `ui`, `new-ui`",choices:["ui","jsonl","new-ui"],hidden:!0,deprecated:!0},{name:"dangerouslyAllowAll",long:"dangerously-allow-all",type:"switch",default:!1,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},{name:"jetbrains",long:"jetbrains",type:"flag",default:g3(),description:(J)=>J?"Enable JetBrains integration. When enabled, Amp automatically includes your open JetBrains file and text selection with every message.":"Disable JetBrains integration"},{name:"ide",long:"ide",type:"flag",default:!0,description:(J)=>J?"Enable IDE connection (default). When enabled, Amp automatically includes your open IDE's file and text selection with every message.":"Disable IDE connection"},{name:"interactive",long:"interactive",type:"flag",description:(J)=>J?"Enable interactive mode. This will enable the interactive UI.":"Disable interactive mode. This will disable the interactive UI.",hidden:!0,deprecated:!0},{name:"mcpConfig",long:"mcp-config",type:"option",description:"JSON configuration or file path for MCP servers to merge with existing settings"},{name:"useSonnet",long:"use-sonnet",type:"flag",description:(J)=>J?"Use Claude Sonnet 4.5 instead of Claude Opus 4.5":"Use default model (Claude Opus 4.5)"},{name:"tryOpus",long:"try-opus",type:"switch",default:!1,description:"(deprecated) Opus 4.5 is now the default in smart mode",hidden:!0,deprecated:!0},{name:"mode",long:"mode",short:"m",type:"option",default:uE.SMART.key,description:`Set the agent mode (${gX().map((J)=>J.mode).join(", ")}) — controls the model, system prompt, and tool selection`,choices:gX().map((J)=>J.mode).concat("large")}],lY6=(J)=>("deprecated"in J)&&J.deprecated===!0,jD8=(J)=>("hidden"in J)&&J.hidden===!0,SD8=(J)=>("default"in J),_D8=(J)=>("default"in J)?J.default:void 0;function kD8(J,Q){let Z=Q.args[0],Y=Q.commands.map((G)=>G.name());if(Z&&!Z.includes(" ")&&Z.length<30&&!/[./\\]/.test(Z)){let G=Y.filter((K)=>Z.includes(K)||K.includes(Z)),V="Run amp --help for a list of available commands.";if(G.length>0)V=`Did you mean: ${G.join(", ")}? Or run amp --help for all commands.`;throw new R8(I$.unknownCommand(Z),1,V)}}var aY6=null;function QM5(){return aY6}function Xu(J){return{...J,getThreadEnvironment:U61,vfs:oE0({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new bx(J.fileSystem),generateThreadTitle:sc0,deleteThread:(Q)=>J.threadService.delete(Q)}}var Qv1=h0.file(ID8.homedir()),oY6=process.env.XDG_CONFIG_HOME?h0.file(process.env.XDG_CONFIG_HOME):n0.joinPath(Qv1,".config");async function p$(J,Q){jU0("0.0.
|
|
4909
|
+
`)}var tx1=sx1.join(kq0||sx1.join(process.env.HOME||process.cwd(),".local","state"),"amp","last-thread-id");function PD8(J){process.emitWarning=function(Q,Z,Y,X){let G=typeof Q==="string"?Q:Q.message||String(Q),V=Z||"Warning",K=!1;J.warn(G,{name:V,code:Y})}}function SV(J,Q){if(J.getOptionValueSourceWithGlobals("dangerouslyAllowAll")==="cli")OG("dangerouslyAllowAll",Q.dangerouslyAllowAll);if(J.getOptionValueSourceWithGlobals("mode")==="cli")OG("experimental.agentMode",Q.mode);if(J.getOptionValueSourceWithGlobals("useSonnet")==="cli")OG("model.sonnet",Q.useSonnet)}async function Jv1(J){try{await wD8(sx1.dirname(tx1),{recursive:!0}),await ED8(tx1,J,"utf-8")}catch(Q){x.debug("Failed to save last thread ID",Q)}}async function TD8(){try{return(await nY6(tx1,"utf-8")).trim()}catch(J){return null}}function RD8(J){return!!(J&&(J.endsWith("@sourcegraph.com")||J.endsWith("@ampcode.com")||J==="auth-bypass-user@example.com"))}async function CD8(J){try{let Q=await K5.getUserInfo({},{config:J,signal:AbortSignal.timeout(5000)});if(Q.ok)return Q.result}catch(Q){x.debug("Failed to fetch user info:",Q)}return}var cY6=[{name:"notifications",long:"notifications",type:"flag",description:(J)=>`${J?"Enable":"Disable"} sound notifications (enabled by default when not in execute mode)`},{name:"color",long:"color",type:"flag",description:(J)=>`${J?"Enable":"Disable"} color output (enabled by default if stdout and stderr are sent to a TTY)`,deprecated:!0},{name:"settingsFile",long:"settings-file",type:"option",default:process.env.AMP_SETTINGS_FILE??P$,description:`Custom settings file path (overrides the default location ${P$})`},{name:"logLevel",long:"log-level",type:"option",description:`Set log level (${Object.keys(x).join(", ")})`},{name:"logFile",long:"log-file",type:"option",description:`Set log file location (overrides the default location ${xA})`},{name:"format",long:"format",type:"option",description:"output using the standard or new-ui. Options: `ui`, `new-ui`",choices:["ui","jsonl","new-ui"],hidden:!0,deprecated:!0},{name:"dangerouslyAllowAll",long:"dangerously-allow-all",type:"switch",default:!1,description:"Disable all command confirmation prompts (agent will execute all commands without asking)"},{name:"jetbrains",long:"jetbrains",type:"flag",default:g3(),description:(J)=>J?"Enable JetBrains integration. When enabled, Amp automatically includes your open JetBrains file and text selection with every message.":"Disable JetBrains integration"},{name:"ide",long:"ide",type:"flag",default:!0,description:(J)=>J?"Enable IDE connection (default). When enabled, Amp automatically includes your open IDE's file and text selection with every message.":"Disable IDE connection"},{name:"interactive",long:"interactive",type:"flag",description:(J)=>J?"Enable interactive mode. This will enable the interactive UI.":"Disable interactive mode. This will disable the interactive UI.",hidden:!0,deprecated:!0},{name:"mcpConfig",long:"mcp-config",type:"option",description:"JSON configuration or file path for MCP servers to merge with existing settings"},{name:"useSonnet",long:"use-sonnet",type:"flag",description:(J)=>J?"Use Claude Sonnet 4.5 instead of Claude Opus 4.5":"Use default model (Claude Opus 4.5)"},{name:"tryOpus",long:"try-opus",type:"switch",default:!1,description:"(deprecated) Opus 4.5 is now the default in smart mode",hidden:!0,deprecated:!0},{name:"mode",long:"mode",short:"m",type:"option",default:uE.SMART.key,description:`Set the agent mode (${gX().map((J)=>J.mode).join(", ")}) — controls the model, system prompt, and tool selection`,choices:gX().map((J)=>J.mode).concat("large")}],lY6=(J)=>("deprecated"in J)&&J.deprecated===!0,jD8=(J)=>("hidden"in J)&&J.hidden===!0,SD8=(J)=>("default"in J),_D8=(J)=>("default"in J)?J.default:void 0;function kD8(J,Q){let Z=Q.args[0],Y=Q.commands.map((G)=>G.name());if(Z&&!Z.includes(" ")&&Z.length<30&&!/[./\\]/.test(Z)){let G=Y.filter((K)=>Z.includes(K)||K.includes(Z)),V="Run amp --help for a list of available commands.";if(G.length>0)V=`Did you mean: ${G.join(", ")}? Or run amp --help for all commands.`;throw new R8(I$.unknownCommand(Z),1,V)}}var aY6=null;function QM5(){return aY6}function Xu(J){return{...J,getThreadEnvironment:U61,vfs:oE0({os:J.fileSystem},J.configService.config),fileChangeTrackerStorage:new bx(J.fileSystem),generateThreadTitle:sc0,deleteThread:(Q)=>J.threadService.delete(Q)}}var Qv1=h0.file(ID8.homedir()),oY6=process.env.XDG_CONFIG_HOME?h0.file(process.env.XDG_CONFIG_HOME):n0.joinPath(Qv1,".config");async function p$(J,Q){jU0("0.0.1765526485-g99562d");let Z=BH1({storage:J.settings,secretStorage:J.secrets,workspaceRoots:t1.of([h0.file(process.cwd())]),defaultAmpURL:J.ampURL,homeDir:Qv1,userConfigDir:oY6}),{initializeCLITelemetry:Y}=await Promise.resolve().then(() => (a91(),n91));Y(Z);let X=await Z.getLatest();x.debug("Global configuration initialized",{settingsKeys:Object.keys(X.settings)});let{toolService:G,dispose:V}=Zo0({configService:Z}),K=new Map,q=()=>K.clear(),W=new _U1(Z,J.settings.getWorkspaceRootPath()),H=ZE0({configService:Z,trustStore:W,createOAuthProvider:async(t,c,J1)=>{let q1=`${t}:${c}`,L1=K.get(q1);if(L1)return x.debug("Reusing existing OAuth provider for server",{serverName:t,serverUrl:c}),L1;x.debug("Creating OAuth provider for server",{serverName:t,serverUrl:c});let s=(async()=>{let o=new wM(J.secrets),i=await o.getClientInfo(t,c),z1=J1?.scopes??i?.scopes,k1=_16();x.info("OAuth headless mode check",{useHeadless:k1,executeMode:J.executeMode,envVar:process.env.AMP_HEADLESS_OAUTH,isTTY:o9.isTTY});let e=void 0;if(k1)e=J.executeMode?S16():j16(t);let f1=new JU1({storage:o,serverName:t,serverUrl:c,clientId:J1?.clientId??i?.clientId,clientSecret:J1?.clientSecret??i?.clientSecret,authUrl:J1?.authUrl??i?.authUrl,tokenUrl:J1?.tokenUrl??i?.tokenUrl,scopes:z1,headlessAuthHandler:e});return x.debug("OAuth provider created",{serverName:t,serverUrl:c,hasManualClientId:!!(J1?.clientId??i?.clientId),willUseDCR:!(J1?.clientId??i?.clientId),scopes:z1,headlessMode:k1,executeMode:J.executeMode}),f1})();return K.set(q1,s),s}}),z=F01({configService:Z,filesystem:J5,spawn:FA}),{initializeToolProviders:U,startToolProviders:D}=await Promise.resolve().then(() => (dY6(),pY6)),M;if(J.executeMode){let t=await U({toolService:G,providers:[H,z],initialTimeout:15000});M=t.registrations;for(let[c,J1]of t.initErrors)x.warn(`${c} provider initialization slow or failed:`,J1)}else M=D({toolService:G,providers:[H,z]});if(Q.jetbrains)rE("JetBrains");else if(Q.ide&&W06())rE("VS Code");else if(Q.ide&&H06())rE("Neovim");if(J.executeMode)SU0(!0);let L,A=z3.status.pipe(Q6((t)=>Boolean(t.connected&&t.authenticated)),U4()).subscribe((t)=>{if(t){if(!L)L=G.registerTool(si0)}else L?.dispose(),L=void 0}),E;if(!J.executeMode){let t=await J.settings.get("fuzzy.alwaysIncludePaths")??[];E=new P61(process.cwd(),{alwaysIncludePaths:t},!0)}else E=new class extends P61{async start(){}async query(){return[]}getStats(){return{state:"unstarted",stats:[]}}dispose(){}};if(!await J.secrets.get("apiKey",J.ampURL)){if(o9.write(`No API key found. Starting login flow...
|
|
4910
4910
|
`),!await yD8(J))await vA(),process.exit(1)}let I=await TP0({isDevelopment:!1}),P=new lI1(I,Z),R=new yI1(I,{lazy:!0}),y=new uU1(P,(t,c)=>{let J1=Y2.get(t);if(J1)J1.handle(c).catch((q1)=>{x.error("Failed to apply artifact delta",q1)})}),k=Q.notifications!==void 0?Q.notifications:!J.executeMode,v=Xo0({playNotificationSound:async(t)=>{if(k){Yo0(t);let c=fC1(),J1=hC1();if((!c||J1)&&X.settings["notifications.system.enabled"]!==!1){if(t==="idle")process.stdout.write("\x1B]777;notify;Amp;Agent is ready\x1B\\");else if(t==="requires-user-input")process.stdout.write("\x1B]777;notify;Amp;Waiting for approval\x1B\\")}}},windowFocused:()=>Promise.resolve(!1),threadService:P,configService:Z});x.info("Starting Amp background services");let g=ec0({threadService:P,threadHistoryService:R,configService:Z,isExtensionDevelopment:!1}),d;z3.status.subscribe((t)=>{d=t});let b=new Q$1({workspaceRoots:[h0.file(process.cwd())],getCurrentFile:()=>{if(!d?.openFile)return;try{return h0.parse(d.openFile)}catch(t){x.warn("Failed to parse current file URI",{uri:d.openFile,error:t});return}},getOpenFiles:()=>{if(!d?.visibleFiles?.length)return[];let t=d.openFile;return d.visibleFiles.filter((c)=>c!==t).map((c)=>{try{return h0.parse(c)}catch(J1){return x.warn("Failed to parse visible file URI",{uri:c,error:J1}),null}}).filter((c)=>c!==null)}}),a=new gC1,G1={codebaseContextService:b,configService:Z,toolService:G,mcpService:H,trustStore:W,threadService:P,threadHistoryService:R,threadSyncService:g,planFileManager:y,threadStorage:I,secretStorage:J.secrets,settingsStorage:J.settings,fuzzyServer:E,notificationService:v,fileSystem:Q.jetbrains||Q.ide?iE0:J5,terminal:a};return{...G1,async asyncDispose(){if(G1.mcpService.hasAuthenticatingClients())x.info("Waiting for OAuth authentication to complete before exit..."),await G1.mcpService.waitForAuthentication();for(let t of M.values())t.dispose();await G1.mcpService.dispose(),q(),await G1.threadService.asyncDispose(),G1.configService.unsubscribe(),V(),G1.fuzzyServer.dispose(),G1.threadSyncService.dispose(),G1.settingsStorage[Symbol.dispose](),A.unsubscribe(),L?.dispose()}}}async function yD8(J){if(!J.executeMode){if(!await FC1("Would you like to log in to Amp? [(y)es, (n)o]: "))return o9.write(`Login cancelled. Run the command again to retry.
|
|
4911
4911
|
`),!1}return await rY6(J)}async function rY6(J){let Q=OD8(32).toString("hex"),Z=await zC1(J.ampURL,Q),Y=new AbortController;try{await uD(Z,Y.signal)}catch(G){x.error("Error opening browser",{error:G})}let X=await zC1(J.ampURL,Q,!1);o9.write(`If your browser does not open automatically, visit:
|
|
4912
4912
|
|
|
@@ -4916,7 +4916,7 @@ ${R6.blue.bold(X)}
|
|
|
4916
4916
|
Login successful! You can now use the Amp CLI.
|
|
4917
4917
|
`),!0}catch(G){return x.error("Login failed",{error:G}),JZ.write(`
|
|
4918
4918
|
Login failed: ${G instanceof Error?G.message:String(G)}
|
|
4919
|
-
`),!1}}function xD8(){let J=new wA().name("amp").description("AI-powered coding assistant").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").configureOutput({writeErr:()=>{}});J.exitOverride((H)=>{if(H.code==="commander.help"||H.code==="commander.version"||H.exitCode===0)yR(),process.exit(0);let z=H.originalError??H;J16(z)}),J.option("-V, --version","Print the version number and exit",()=>{let z;try{z=`, ${iI(new Date("2025-12-
|
|
4919
|
+
`),!1}}function xD8(){let J=new wA().name("amp").description("AI-powered coding assistant").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").configureOutput({writeErr:()=>{}});J.exitOverride((H)=>{if(H.code==="commander.help"||H.code==="commander.version"||H.exitCode===0)yR(),process.exit(0);let z=H.originalError??H;J16(z)}),J.option("-V, --version","Print the version number and exit",()=>{let z;try{z=`, ${iI(new Date("2025-12-12T08:06:47.322Z"))} ago`}catch{}o9.write(`0.0.1765526485-g99562d (released 2025-12-12T08:06:47.322Z${z??""})
|
|
4920
4920
|
`),process.exit(0)}),J.addHelpText("after",V06()),J.configureHelp({formatHelp:K06}),J.command("logout").description("Log out by removing stored API key").action(async(H,z)=>{let U=z.optsWithGlobals(),D=await FQ(U);await bD8(D)}),J.command("login").description("Log in to Amp").addHelpText("after","If AMP_URL is set during login, it will be persisted to global settings for future CLI invocations, though AMP_URL will continue to take precedence.").action(async(H,z)=>{let U=z.optsWithGlobals(),D=await FQ(U);await hD8(D,await QC1(U,D.settings))});let Q=async(H,z,U)=>{BH1({storage:z.settings,secretStorage:z.secrets,workspaceRoots:t1.of([h0.file(process.cwd())]),defaultAmpURL:z.ampURL,homeDir:Qv1,userConfigDir:oY6});let D={...z,executeMode:!1};await ex1(D,{...H,openThreadSwitcher:!0},U)},Z=J.command("threads").alias("t").alias("thread").summary("Manage threads").description("Thread management commands. When no subcommand is provided, defaults to listing threads.").action(async(H,z)=>{let U=z.optsWithGlobals(),D=await FQ(U);await iY6(U,D,z)});Z.command("new").alias("n").summary("Create a new thread").description("Create a new thread and print its ID. The thread will be empty. You can set the visibility using the --visibility option.").option("--visibility <visibility>","Set thread visibility (private, public, workspace, group)").action(async(H,z)=>{let U=z.optsWithGlobals(),D=await FQ(U);await lD8(U,D,z)}),Z.command("continue [threadId]").alias("c").summary("Continue an existing thread").description("Continue an existing thread by resuming the conversation. By default, shows an interactive picker with the most recently used thread at the top. Use --last to continue the last thread directly without the picker.").option("--last","Continue the last thread directly without showing the picker").option("--pick","Pick a thread interactively from a list (DEPRECATED: picker is now the default)").action(async(H,z,U)=>{let D=U.optsWithGlobals(),M=await FQ(D);if(z.pick)JZ.write(`${R6.yellow("Warning:")} The --pick flag is deprecated. The picker is now shown by default.
|
|
4921
4921
|
`);if(z.last||H||M.executeMode)await cD8(D,M,H,U);else await Q(D,M,U)}),Z.command("fork [threadId]").alias("f").summary("Fork an existing thread").description("Create a new thread by forking an existing one. This copies the conversation history up to the current point and creates a new thread where you can explore different directions. If no thread ID is provided, the most recently used thread will be forked.").action(async(H,z,U)=>{let D=U.optsWithGlobals(),M=await FQ(D);await dD8(D,M,H,U)}),Z.command("list").alias("l").alias("ls").summary("List all threads").description("List all your threads with their IDs, names, and last modified times.").action(async(H,z)=>{let U=z.optsWithGlobals(),D=await FQ(U);await iY6(U,D,z)}),Z.command("search <query>").alias("find").summary("Search threads").description(`Search for threads using a query DSL.
|
|
4922
4922
|
|
|
@@ -4932,8 +4932,8 @@ All matching is case-insensitive. File paths use partial matching.`).option("-n,
|
|
|
4932
4932
|
Or pipe via stdin: echo "your message" | amp --execute`);SV(Z,Q);let V=await p$(J,Q);aY6=V;let K=Xu(V),q=await CD8(V.configService),W=RD8(q?.email);if((J.executeMode||Q.streamJson)&&P9(Q.mode)&&!W)throw new R8(`Execute mode is not permitted with --mode '${Q.mode}'`,1);let H=async(b)=>{let a=await nY6(b,"utf-8"),G1=JSON.parse(a);if(!uX(G1.id))throw new R8(I$.invalidThreadId);return h51(V,{visibility:Y,agentMode:Q.mode,thread:G1})},z=async(b)=>{if(!uX(b))throw new R8(I$.invalidThreadId);try{let[G1,t]=await Promise.all([K5.getThreadLinkInfo({thread:b},{config:V.configService}),K5.getUserInfo({},{config:V.configService})]);if(G1.ok&&t.ok){let c=G1.result.creatorUserID,J1=t.result.id;if(c&&c!==J1&&!process.env.AMP_RESUME_OTHER_USER_THREADS_INSECURE)throw new R8(`Cannot resume thread created by another user.
|
|
4933
4933
|
|
|
4934
4934
|
This thread belongs to a different user and cannot be continued for security reasons. Set AMP_RESUME_OTHER_USER_THREADS_INSECURE=1 to bypass this check.`)}}catch(G1){if(G1 instanceof R8)throw G1;x.warn("Failed to validate thread ownership in CLI, allowing to open",{error:G1})}let a=await V.threadService.get(b)??void 0;return x.info(`[fetchAndStartThread] Loaded thread ${b}, agentMode: ${a?.agentMode??"undefined"}`),h51(V,{visibility:Y,agentMode:a?void 0:Q.mode,thread:a})},U=async()=>{try{if(Q.threadId)return z(Q.threadId);else return h51(V,{visibility:Y,agentMode:Q.mode})}catch(b){if(b instanceof R8)throw b;throw await Bm(b,Q.threadId),Error("handleError should have called process.exit()")}},D=async()=>{return h51(V,{visibility:Y,agentMode:Q.mode})};if(Q.format==="jsonl")JZ.write(`jsonl format is deprecated. Version "0.0.1752148945-gd8844f" or earlier is required to use jsonl format.
|
|
4935
|
-
`),await vA(),process.exit(1);if(J.executeMode&&Q.remote)await s06(X,G,V.configService),await V.asyncDispose(),process.exit(0);let M=await U();if(J.executeMode)d06(V.mcpService,J.settings),await B16(M,M.threadID,X,G,V,!!Q.streamJson,!!Q.streamJsonInput,!!Q.stats,J.ampURL,W,Q.mode),await V.asyncDispose(),process.exit(0);let L=!1,A=!1,E=!1;if(Q.jetbrains||Q.ide){await cU0();let b=eE({jetbrainsOnly:Q.jetbrains});if(b.length===0){if(Q.jetbrains)A=!await V.configService.get("jetbrains.skipInstall")}else if(b.length===1){let a=b[0];if(a)z3.selectConfig(a)}else E=!0}let I=v61("0.0.
|
|
4936
|
-
`);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Z=process.stdout.isTTY&&process.stderr.isTTY,Y=await l16({...J,workspaceTrust:{current:!0,changes:__},getHook:process.env.AMP_URL?(G,V)=>{if(G==="url")return Promise.resolve(process.env.AMP_URL);return V()}:void 0});if(J.mcpConfig){let G=await u06(J.mcpConfig);Y=p06(Y,G)}let X=await Y.get("url","global");if(!X)X=zZ;if(!AF(X))x.info("Targeting custom Amp server",{ampURL:X});return Y=_W0(Y),{executeMode:Q,isTTY:Z,ampURL:X,settings:Y,secrets:t06(await QC1(J,Y))}}function vD8(J){let Q={};for(let Z=0;Z<J.length;Z++){let Y=J[Z];if(Y?.startsWith("--")){let G=Y.slice(2).replace(/-([a-z])/g,(K,q)=>q.toUpperCase()),V=J[Z+1];if(V&&!V.startsWith("--"))Q[G]=V,Z++}}return Q}async function fD8(){let J=vD8(process.argv);if(le0({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),PD8(x),x.info("Starting Amp CLI.",{version:"0.0.
|
|
4935
|
+
`),await vA(),process.exit(1);if(J.executeMode&&Q.remote)await s06(X,G,V.configService),await V.asyncDispose(),process.exit(0);let M=await U();if(J.executeMode)d06(V.mcpService,J.settings),await B16(M,M.threadID,X,G,V,!!Q.streamJson,!!Q.streamJsonInput,!!Q.stats,J.ampURL,W,Q.mode),await V.asyncDispose(),process.exit(0);let L=!1,A=!1,E=!1;if(Q.jetbrains||Q.ide){await cU0();let b=eE({jetbrainsOnly:Q.jetbrains});if(b.length===0){if(Q.jetbrains)A=!await V.configService.get("jetbrains.skipInstall")}else if(b.length===1){let a=b[0];if(a)z3.selectConfig(a)}else E=!0}let I=v61("0.0.1765526485-g99562d",V.settingsStorage),P=new h11(V.threadStorage),R=t1.of([h0.file(process.cwd())]),y=W$1(void 0,R),k=new f61(V.mcpService,J.settings.getWorkspaceRootPath());if(X)M.handle({type:"user:message",message:{content:[{type:"text",text:X}]}});let g=await(async()=>{try{let b=await K5.getUserFreeTierStatus({},{config:V.configService,signal:AbortSignal.timeout(5000)});if(b.ok)return x.info("User free tier status:",b),b.result}catch(b){throw x.error("Failed to fetch free tier status:",b),b}})(),d=await Q66();x.info("Loaded session state:",d),await Ey1({codebaseContextService:V.codebaseContextService,stdout:process.stdout,history:new M61,fuzzyServer:V.fuzzyServer,settingsStorage:V.settingsStorage,threadService:V.threadService,threadHistoryService:V.threadHistoryService,threadSyncService:V.threadSyncService,planFileManager:V.planFileManager,threadID:M.threadID,threadFuzzyIndexer:P,worker:M,workerDeps:K,configService:V.configService,internalAPIClient:K5,ampURL:J.ampURL,startNewThread:D,switchToThread:z,ideClient:z3,connectedClientsService:new Wn,commandRegistry:y,mcpService:V.mcpService,mcpTrustHandler:k,showJetBrainsInstaller:A,showIdePicker:L,showIdePickerHint:E,openThreadSwitcher:Q.openThreadSwitcher,updateService:I,inspector:Q.inspector,inspectorPort:Q.inspectorPort,jetbrainsMode:Q.jetbrains,clientId:Q.clientId,sessionState:d,freeTierStatus:{canUseAmpFree:g.canUseAmpFree},workspace:q?.team??null,features:q?.features??[],isDogfooding:W,threadDependencies:V,initialAgentMode:Z.getOptionValueSourceWithGlobals("mode")==="cli"?Q.mode:void 0}),await V.asyncDispose(),process.exit(0)}async function FQ(J){if(J.interactive)JZ.write(`Warning: --interactive flag is deprecated. Interactive mode is now the default unless --execute is used or output is redirected.
|
|
4936
|
+
`);let Q=!!J.execute||!process.stdout.isTTY&&!J.streamJson,Z=process.stdout.isTTY&&process.stderr.isTTY,Y=await l16({...J,workspaceTrust:{current:!0,changes:__},getHook:process.env.AMP_URL?(G,V)=>{if(G==="url")return Promise.resolve(process.env.AMP_URL);return V()}:void 0});if(J.mcpConfig){let G=await u06(J.mcpConfig);Y=p06(Y,G)}let X=await Y.get("url","global");if(!X)X=zZ;if(!AF(X))x.info("Targeting custom Amp server",{ampURL:X});return Y=_W0(Y),{executeMode:Q,isTTY:Z,ampURL:X,settings:Y,secrets:t06(await QC1(J,Y))}}function vD8(J){let Q={};for(let Z=0;Z<J.length;Z++){let Y=J[Z];if(Y?.startsWith("--")){let G=Y.slice(2).replace(/-([a-z])/g,(K,q)=>q.toUpperCase()),V=J[Z+1];if(V&&!V.startsWith("--"))Q[G]=V,Z++}}return Q}async function fD8(){let J=vD8(process.argv);if(le0({logLevel:J.logLevel||process.env.AMP_LOG_LEVEL,logFile:J.logFile||process.env.AMP_LOG_FILE}),PD8(x),x.info("Starting Amp CLI.",{version:"0.0.1765526485-g99562d",buildTimestamp:"2025-12-12T08:06:47.322Z"}),parseInt(process.version.slice(1).split(".")[0]??"")<20)throw new R8(I$.nodeVersion(process.version),1,"Please upgrade your Node.js installation from https://nodejs.org");await xD8().parseAsync(process.argv)}wI1().startActiveSpan("main",async(J)=>{process.on("exit",()=>J.end()),await fD8().catch(Bm)});async function hD8(J,Q){if(process.env.AMP_URL)await J.settings.set("url",process.env.AMP_URL,"global"),o9.write(`Saving custom server URL to settings: ${process.env.AMP_URL}
|
|
4937
4937
|
`);else if(!AF(J.ampURL))o9.write(`Logging in to ${new URL(J.ampURL).hostname}
|
|
4938
4938
|
`);let Z=process.env.AMP_API_KEY;if(Z)o9.write(`API key found in environment variable, storing...
|
|
4939
4939
|
`),await Q.set("apiKey",Z,J.ampURL),o9.write(`API key successfully stored.
|
|
@@ -4946,7 +4946,7 @@ This thread belongs to a different user and cannot be continued for security rea
|
|
|
4946
4946
|
`);else o9.write(`Successfully logged out from ${new URL(J.ampURL).hostname}.
|
|
4947
4947
|
`);process.exit(0)}async function mD8(J,Q,Z,Y,X){SV(X,J);let G=await p$(Q,J);try{let V=b51(Z);if(!V)m51(Z);let K=V,q=Y.trim();if(q.length===0)$X("Thread name cannot be empty");if(q.length>256)$X("Thread name cannot exceed 256 characters");if(!(await rC(K,G)).messages.length)$X("Cannot rename an empty thread.");let H=Xu(G);await(await Y2.getOrCreateForThread(H,K)).handle({type:"title",value:q}),x.info("GOT HERE"),await G.threadSyncService.sync(),x.info("GOT THERE"),o9.write(R6.green(`✓ Thread ${K} renamed to "${q}"
|
|
4948
4948
|
`)),await G.asyncDispose(),process.exit(0)}catch(V){await G.asyncDispose();let K=`Failed to rename thread: ${V instanceof Error?V.message:String(V)}`;$X(K)}}async function gD8(J,Q,Z,Y){SV(Y,J);let X=await p$(Q,J);try{let G=b51(Z);if(!G)m51(Z);let K=await rC(G,X),q=qR(K);o9.write(q+`
|
|
4949
|
-
`),await X.asyncDispose(),process.exit(0)}catch(G){await X.asyncDispose();let V=`Failed to render thread as markdown: ${G instanceof Error?G.message:String(G)}`;$X(V)}}async function uD8(J,Q,Z,Y,X){SV(X,J);let G=await p$(Q,J);try{let V=await Zv1(Z),K=await rC(V,G),q=Y.typing!==!1,W=parseInt(Y.wpm||"120",10),H=parseInt(Y.messageDelay||"1000",10),z=parseInt(Y.toolProgressDelay||"800",10),U=parseInt(Y.exitDelay||"3",10)*1000,D=Y.indicator!==!1,M=Xu(G),L=K.id;await G.threadStorage.set(L,K);let A=await Y2.getOrCreateForThread(M,L);await A.resume();let E=f11.fromWorker(A),I=new h11(G.threadStorage),P=t1.of([h0.file(process.cwd())]),R=W$1(void 0,P),y=new f61(G.mcpService,Q.settings.getWorkspaceRootPath()),k=v61("0.0.
|
|
4949
|
+
`),await X.asyncDispose(),process.exit(0)}catch(G){await X.asyncDispose();let V=`Failed to render thread as markdown: ${G instanceof Error?G.message:String(G)}`;$X(V)}}async function uD8(J,Q,Z,Y,X){SV(X,J);let G=await p$(Q,J);try{let V=await Zv1(Z),K=await rC(V,G),q=Y.typing!==!1,W=parseInt(Y.wpm||"120",10),H=parseInt(Y.messageDelay||"1000",10),z=parseInt(Y.toolProgressDelay||"800",10),U=parseInt(Y.exitDelay||"3",10)*1000,D=Y.indicator!==!1,M=Xu(G),L=K.id;await G.threadStorage.set(L,K);let A=await Y2.getOrCreateForThread(M,L);await A.resume();let E=f11.fromWorker(A),I=new h11(G.threadStorage),P=t1.of([h0.file(process.cwd())]),R=W$1(void 0,P),y=new f61(G.mcpService,Q.settings.getWorkspaceRootPath()),k=v61("0.0.1765526485-g99562d",G.settingsStorage);await Ey1({codebaseContextService:G.codebaseContextService,stdout:process.stdout,history:new M61,fuzzyServer:G.fuzzyServer,settingsStorage:G.settingsStorage,threadService:G.threadService,threadHistoryService:G.threadHistoryService,threadSyncService:G.threadSyncService,planFileManager:G.planFileManager,threadID:L,threadFuzzyIndexer:I,worker:E,workerDeps:M,configService:G.configService,internalAPIClient:K5,ampURL:Q.ampURL,startNewThread:async()=>E,switchToThread:async()=>E,ideClient:z3,connectedClientsService:new Wn,commandRegistry:R,mcpService:G.mcpService,mcpTrustHandler:y,showJetBrainsInstaller:!1,updateService:k,isDogfooding:!1,replayMode:{thread:K,typingEnabled:q,baseWpm:W,messageDelayMs:H,toolProgressDelayMs:z,exitDelayMs:U,showIndicator:D},freeTierStatus:{canUseAmpFree:!0},features:[]}),await G.asyncDispose(),process.exit(0)}catch(V){await G.asyncDispose(),await Bm(V,Z)}}async function pD8(J,Q,Z,Y,X){SV(Y,J);let G=await p$(Q,J);try{let V=b51(Z);if(!V)m51(Z);let K=V,q=await K5.getUserInfo({},{config:G.configService}),W=q.ok?q.result:null,H=h61(J,W);if(!H&&!X)$X("Must specify either --visibility or --support");if(H&&X)$X("Cannot specify both --visibility and --support at the same time");if(H instanceof Error)$X(H.message);if(H)await G.threadSyncService.updateThreadMeta(K,b61(H)),o9.write(R6.green("✓ ")+`Thread ${K} visibility changed to ${H}.
|
|
4950
4950
|
`);if(X){await rC(K,G);let z=typeof X==="string"?X:void 0;await AP0(G.threadService,K,G.configService,z),o9.write(R6.green("✓ ")+`Thread ${K} has been shared with Amp support. These thread reports will be aggregated and analysed.
|
|
4951
4951
|
`)}await G.asyncDispose(),process.exit(0)}catch(V){await G.asyncDispose(),$X(`Failed to update thread: ${V instanceof Error?V.message:String(V)}`)}}async function dD8(J,Q,Z,Y){SV(Y,J);let X=await p$(Q,J),G=Xu(X);try{let V=await Zv1(Z),q=(await rC(V,X)).messages.length-1,W=await Y2.getOrCreateForThread(G,V),H=await zR(W,X.threadSyncService,q);await Promise.all([X.threadSyncService.uploadThread(V),X.threadSyncService.uploadThread(H)]),await Jv1(H),o9.write(`${H}
|
|
4952
4952
|
`),await X.asyncDispose(),process.exit(0)}catch(V){JZ.write(`Error forking thread: ${V instanceof Error?V.message:String(V)}
|