@sleep2agi/agent-node 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as Rm}from"module";import{fileURLToPath as fm}from"url";import{setMaxListeners as um}from"events";import{spawn as am}from"child_process";import{createInterface as Cm}from"readline";import{homedir as yf}from"os";import{join as df}from"path";import{randomUUID as Qf}from"crypto";import{appendFile as Jf,mkdir as Yf}from"fs/promises";import{join as Sh}from"path";import{realpathSync as ch}from"fs";import{cwd as $f}from"process";import{randomUUID as aS}from"crypto";import{appendFile as Su,mkdir as cu,symlink as nu,unlink as ru}from"fs/promises";import{dirname as oS,join as xS}from"path";import*as r0 from"fs";import{mkdir as au,open as Cu,readdir as ou,readFile as rh,rename as xu,rmdir as Iu,rm as iu,stat as tu,unlink as Zu}from"fs/promises";import{execFile as Ku}from"child_process";import{promisify as Hu}from"util";var pT=Object.create,{getPrototypeOf:hT,defineProperty:qE,getOwnPropertyNames:ST}=Object,cT=Object.prototype.hasOwnProperty;function nT(E){return this[E]}var rT,TT,Ph=(E,y,p)=>{var h=E!=null&&typeof E==="object";if(h){var d=y?rT??=new WeakMap:TT??=new WeakMap,S=d.get(E);if(S)return S}p=E!=null?pT(hT(E)):{};let c=y||!E||!E.__esModule?qE(p,"default",{value:E,enumerable:!0}):p;for(let n of ST(E))if(!cT.call(c,n))qE(c,n,{get:nT.bind(E,n),enumerable:!0});if(h)d.set(E,c);return c},W=(E,y)=>()=>(y||E((y={exports:{}}).exports,y),y.exports),mT=(E)=>E;function RT(E,y){this[E]=mT.bind(null,y)}var f6=(E,y)=>{for(var p in y)qE(E,p,{get:y[p],enumerable:!0,configurable:!0,set:RT.bind(y,p)})},fT=Symbol.dispose||Symbol.for("Symbol.dispose"),uT=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),L0=(E,y,p)=>{if(y!=null){if(typeof y!=="object"&&typeof y!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var h;if(p)h=y[uT];if(h===void 0)h=y[fT];if(typeof h!=="function")throw TypeError("Object not disposable");E.push([p,h,y])}else if(p)E.push([p]);return y},j0=(E,y,p)=>{var h=typeof SuppressedError==="function"?SuppressedError:function(c,n,r,T){return T=Error(r),T.name="SuppressedError",T.error=c,T.suppressed=n,T},d=(c)=>y=p?new h(c,y,"An error was suppressed during disposal"):(p=!0,c),S=(c)=>{while(c=E.pop())try{var n=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(n).then(S,(r)=>(d(r),S()))}catch(r){d(r)}if(p)throw y};return S()},x8=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.regexpCode=E.getEsmExportName=E.getProperty=E.safeStringify=E.stringify=E.strConcat=E.addCodeArg=E.str=E._=E.nil=E._Code=E.Name=E.IDENTIFIER=E._CodeOrName=void 0;class y{}E._CodeOrName=y,E.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class p extends y{constructor(m){super();if(!E.IDENTIFIER.test(m))throw Error("CodeGen: name must be a valid identifier");this.str=m}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}E.Name=p;class h extends y{constructor(m){super();this._items=typeof m==="string"?[m]:m}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let m=this._items[0];return m===""||m==='""'}get str(){var m;return(m=this._str)!==null&&m!==void 0?m:this._str=this._items.reduce((a,R)=>`${a}${R}`,"")}get names(){var m;return(m=this._names)!==null&&m!==void 0?m:this._names=this._items.reduce((a,R)=>{if(R instanceof p)a[R.str]=(a[R.str]||0)+1;return a},{})}}E._Code=h,E.nil=new h("");function d(m,...a){let R=[m[0]],f=0;while(f<a.length)n(R,a[f]),R.push(m[++f]);return new h(R)}E._=d;var S=new h("+");function c(m,...a){let R=[i(m[0])],f=0;while(f<a.length)R.push(S),n(R,a[f]),R.push(S,i(m[++f]));return r(R),new h(R)}E.str=c;function n(m,a){if(a instanceof h)m.push(...a._items);else if(a instanceof p)m.push(a);else m.push(o(a))}E.addCodeArg=n;function r(m){let a=1;while(a<m.length-1){if(m[a]===S){let R=T(m[a-1],m[a+1]);if(R!==void 0){m.splice(a-1,3,R);continue}m[a++]="+"}a++}}function T(m,a){if(a==='""')return m;if(m==='""')return a;if(typeof m=="string"){if(a instanceof p||m[m.length-1]!=='"')return;if(typeof a!="string")return`${m.slice(0,-1)}${a}"`;if(a[0]==='"')return m.slice(0,-1)+a.slice(1);return}if(typeof a=="string"&&a[0]==='"'&&!(m instanceof p))return`"${m}${a.slice(1)}`;return}function k(m,a){return a.emptyStr()?m:m.emptyStr()?a:c`${m}${a}`}E.strConcat=k;function o(m){return typeof m=="number"||typeof m=="boolean"||m===null?m:i(Array.isArray(m)?m.join(","):m)}function u(m){return new h(i(m))}E.stringify=u;function i(m){return JSON.stringify(m).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}E.safeStringify=i;function v(m){return typeof m=="string"&&E.IDENTIFIER.test(m)?new h(`.${m}`):d`[${m}]`}E.getProperty=v;function F(m){if(typeof m=="string"&&E.IDENTIFIER.test(m))return new h(`${m}`);throw Error(`CodeGen: invalid export name: ${m}, use explicit $id name mapping`)}E.getEsmExportName=F;function t(m){return new h(m.toString())}E.regexpCode=t}),Mp=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.ValueScope=E.ValueScopeName=E.Scope=E.varKinds=E.UsedValueState=void 0;var y=x8();class p extends Error{constructor(r){super(`CodeGen: "code" for ${r} not defined`);this.value=r.value}}var h;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(h||(E.UsedValueState=h={})),E.varKinds={const:new y.Name("const"),let:new y.Name("let"),var:new y.Name("var")};class d{constructor({prefixes:r,parent:T}={}){this._names={},this._prefixes=r,this._parent=T}toName(r){return r instanceof y.Name?r:this.name(r)}name(r){return new y.Name(this._newName(r))}_newName(r){let T=this._names[r]||this._nameGroup(r);return`${r}${T.index++}`}_nameGroup(r){var T,k;if(((k=(T=this._parent)===null||T===void 0?void 0:T._prefixes)===null||k===void 0?void 0:k.has(r))||this._prefixes&&!this._prefixes.has(r))throw Error(`CodeGen: prefix "${r}" is not allowed in this scope`);return this._names[r]={prefix:r,index:0}}}E.Scope=d;class S extends y.Name{constructor(r,T){super(T);this.prefix=r}setValue(r,{property:T,itemIndex:k}){this.value=r,this.scopePath=y._`.${new y.Name(T)}[${k}]`}}E.ValueScopeName=S;var c=y._`\n`;class n extends d{constructor(r){super(r);this._values={},this._scope=r.scope,this.opts={...r,_n:r.lines?c:y.nil}}get(){return this._scope}name(r){return new S(r,this._newName(r))}value(r,T){var k;if(T.ref===void 0)throw Error("CodeGen: ref must be passed in value");let o=this.toName(r),{prefix:u}=o,i=(k=T.key)!==null&&k!==void 0?k:T.ref,v=this._values[u];if(v){let m=v.get(i);if(m)return m}else v=this._values[u]=new Map;v.set(i,o);let F=this._scope[u]||(this._scope[u]=[]),t=F.length;return F[t]=T.ref,o.setValue(T,{property:u,itemIndex:t}),o}getValue(r,T){let k=this._values[r];if(!k)return;return k.get(T)}scopeRefs(r,T=this._values){return this._reduceValues(T,(k)=>{if(k.scopePath===void 0)throw Error(`CodeGen: name "${k}" has no value`);return y._`${r}${k.scopePath}`})}scopeCode(r=this._values,T,k){return this._reduceValues(r,(o)=>{if(o.value===void 0)throw Error(`CodeGen: name "${o}" has no value`);return o.value.code},T,k)}_reduceValues(r,T,k={},o){let u=y.nil;for(let i in r){let v=r[i];if(!v)continue;let F=k[i]=k[i]||new Map;v.forEach((t)=>{if(F.has(t))return;F.set(t,h.Started);let m=T(t);if(m){let a=this.opts.es5?E.varKinds.var:E.varKinds.const;u=y._`${u}${a} ${t} = ${m};${this.opts._n}`}else if(m=o===null||o===void 0?void 0:o(t))u=y._`${u}${m}${this.opts._n}`;else throw new p(t);F.set(t,h.Completed)})}return u}}E.ValueScope=n}),u0=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.or=E.and=E.not=E.CodeGen=E.operators=E.varKinds=E.ValueScopeName=E.ValueScope=E.Scope=E.Name=E.regexpCode=E.stringify=E.getProperty=E.nil=E.strConcat=E.str=E._=void 0;var y=x8(),p=Mp(),h=x8();Object.defineProperty(E,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(E,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(E,"strConcat",{enumerable:!0,get:function(){return h.strConcat}}),Object.defineProperty(E,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(E,"getProperty",{enumerable:!0,get:function(){return h.getProperty}}),Object.defineProperty(E,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(E,"regexpCode",{enumerable:!0,get:function(){return h.regexpCode}}),Object.defineProperty(E,"Name",{enumerable:!0,get:function(){return h.Name}});var d=Mp();Object.defineProperty(E,"Scope",{enumerable:!0,get:function(){return d.Scope}}),Object.defineProperty(E,"ValueScope",{enumerable:!0,get:function(){return d.ValueScope}}),Object.defineProperty(E,"ValueScopeName",{enumerable:!0,get:function(){return d.ValueScopeName}}),Object.defineProperty(E,"varKinds",{enumerable:!0,get:function(){return d.varKinds}}),E.operators={GT:new y._Code(">"),GTE:new y._Code(">="),LT:new y._Code("<"),LTE:new y._Code("<="),EQ:new y._Code("==="),NEQ:new y._Code("!=="),NOT:new y._Code("!"),OR:new y._Code("||"),AND:new y._Code("&&"),ADD:new y._Code("+")};class S{optimizeNodes(){return this}optimizeNames(C,s){return this}}class c extends S{constructor(C,s,P){super();this.varKind=C,this.name=s,this.rhs=P}render({es5:C,_n:s}){let P=C?p.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${P} ${this.name}${X};`+s}optimizeNames(C,s){if(!C[this.name.str])return;if(this.rhs)this.rhs=z(this.rhs,C,s);return this}get names(){return this.rhs instanceof y._CodeOrName?this.rhs.names:{}}}class n extends S{constructor(C,s,P){super();this.lhs=C,this.rhs=s,this.sideEffects=P}render({_n:C}){return`${this.lhs} = ${this.rhs};`+C}optimizeNames(C,s){if(this.lhs instanceof y.Name&&!C[this.lhs.str]&&!this.sideEffects)return;return this.rhs=z(this.rhs,C,s),this}get names(){let C=this.lhs instanceof y.Name?{}:{...this.lhs.names};return O(C,this.rhs)}}class r extends n{constructor(C,s,P,X){super(C,P,X);this.op=s}render({_n:C}){return`${this.lhs} ${this.op}= ${this.rhs};`+C}}class T extends S{constructor(C){super();this.label=C,this.names={}}render({_n:C}){return`${this.label}:`+C}}class k extends S{constructor(C){super();this.label=C,this.names={}}render({_n:C}){return`break${this.label?` ${this.label}`:""};`+C}}class o extends S{constructor(C){super();this.error=C}render({_n:C}){return`throw ${this.error};`+C}get names(){return this.error.names}}class u extends S{constructor(C){super();this.code=C}render({_n:C}){return`${this.code};`+C}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(C,s){return this.code=z(this.code,C,s),this}get names(){return this.code instanceof y._CodeOrName?this.code.names:{}}}class i extends S{constructor(C=[]){super();this.nodes=C}render(C){return this.nodes.reduce((s,P)=>s+P.render(C),"")}optimizeNodes(){let{nodes:C}=this,s=C.length;while(s--){let P=C[s].optimizeNodes();if(Array.isArray(P))C.splice(s,1,...P);else if(P)C[s]=P;else C.splice(s,1)}return C.length>0?this:void 0}optimizeNames(C,s){let{nodes:P}=this,X=P.length;while(X--){let d0=P[X];if(d0.optimizeNames(C,s))continue;K(C,d0.names),P.splice(X,1)}return P.length>0?this:void 0}get names(){return this.nodes.reduce((C,s)=>N(C,s.names),{})}}class v extends i{render(C){return"{"+C._n+super.render(C)+"}"+C._n}}class F extends i{}class t extends v{}t.kind="else";class m extends v{constructor(C,s){super(s);this.condition=C}render(C){let s=`if(${this.condition})`+super.render(C);if(this.else)s+="else "+this.else.render(C);return s}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===!0)return this.nodes;let s=this.else;if(s){let P=s.optimizeNodes();s=this.else=Array.isArray(P)?new t(P):P}if(s){if(C===!1)return s instanceof m?s:s.nodes;if(this.nodes.length)return this;return new m(l0(C),s instanceof m?[s]:s.nodes)}if(C===!1||!this.nodes.length)return;return this}optimizeNames(C,s){var P;if(this.else=(P=this.else)===null||P===void 0?void 0:P.optimizeNames(C,s),!(super.optimizeNames(C,s)||this.else))return;return this.condition=z(this.condition,C,s),this}get names(){let C=super.names;if(O(C,this.condition),this.else)N(C,this.else.names);return C}}m.kind="if";class a extends v{}a.kind="for";class R extends a{constructor(C){super();this.iteration=C}render(C){return`for(${this.iteration})`+super.render(C)}optimizeNames(C,s){if(!super.optimizeNames(C,s))return;return this.iteration=z(this.iteration,C,s),this}get names(){return N(super.names,this.iteration.names)}}class f extends a{constructor(C,s,P,X){super();this.varKind=C,this.name=s,this.from=P,this.to=X}render(C){let s=C.es5?p.varKinds.var:this.varKind,{name:P,from:X,to:d0}=this;return`for(${s} ${P}=${X}; ${P}<${d0}; ${P}++)`+super.render(C)}get names(){let C=O(super.names,this.from);return O(C,this.to)}}class I extends a{constructor(C,s,P,X){super();this.loop=C,this.varKind=s,this.name=P,this.iterable=X}render(C){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(C)}optimizeNames(C,s){if(!super.optimizeNames(C,s))return;return this.iterable=z(this.iterable,C,s),this}get names(){return N(super.names,this.iterable.names)}}class x extends v{constructor(C,s,P){super();this.name=C,this.args=s,this.async=P}render(C){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(C)}}x.kind="func";class Z extends i{render(C){return"return "+super.render(C)}}Z.kind="return";class A extends v{render(C){let s="try"+super.render(C);if(this.catch)s+=this.catch.render(C);if(this.finally)s+=this.finally.render(C);return s}optimizeNodes(){var C,s;return super.optimizeNodes(),(C=this.catch)===null||C===void 0||C.optimizeNodes(),(s=this.finally)===null||s===void 0||s.optimizeNodes(),this}optimizeNames(C,s){var P,X;return super.optimizeNames(C,s),(P=this.catch)===null||P===void 0||P.optimizeNames(C,s),(X=this.finally)===null||X===void 0||X.optimizeNames(C,s),this}get names(){let C=super.names;if(this.catch)N(C,this.catch.names);if(this.finally)N(C,this.finally.names);return C}}class g extends v{constructor(C){super();this.error=C}render(C){return`catch(${this.error})`+super.render(C)}}g.kind="catch";class V extends v{render(C){return"finally"+super.render(C)}}V.kind="finally";class _{constructor(C,s={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...s,_n:s.lines?`
3
- `:""},this._extScope=C,this._scope=new p.Scope({parent:C}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(C){return this._scope.name(C)}scopeName(C){return this._extScope.name(C)}scopeValue(C,s){let P=this._extScope.value(C,s);return(this._values[P.prefix]||(this._values[P.prefix]=new Set)).add(P),P}getScopeValue(C,s){return this._extScope.getValue(C,s)}scopeRefs(C){return this._extScope.scopeRefs(C,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(C,s,P,X){let d0=this._scope.toName(s);if(P!==void 0&&X)this._constants[d0.str]=P;return this._leafNode(new c(C,d0,P)),d0}const(C,s,P){return this._def(p.varKinds.const,C,s,P)}let(C,s,P){return this._def(p.varKinds.let,C,s,P)}var(C,s,P){return this._def(p.varKinds.var,C,s,P)}assign(C,s,P){return this._leafNode(new n(C,s,P))}add(C,s){return this._leafNode(new r(C,E.operators.ADD,s))}code(C){if(typeof C=="function")C();else if(C!==y.nil)this._leafNode(new u(C));return this}object(...C){let s=["{"];for(let[P,X]of C){if(s.length>1)s.push(",");if(s.push(P),P!==X||this.opts.es5)s.push(":"),(0,y.addCodeArg)(s,X)}return s.push("}"),new y._Code(s)}if(C,s,P){if(this._blockNode(new m(C)),s&&P)this.code(s).else().code(P).endIf();else if(s)this.code(s).endIf();else if(P)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(C){return this._elseNode(new m(C))}else(){return this._elseNode(new t)}endIf(){return this._endBlockNode(m,t)}_for(C,s){if(this._blockNode(C),s)this.code(s).endFor();return this}for(C,s){return this._for(new R(C),s)}forRange(C,s,P,X,d0=this.opts.es5?p.varKinds.var:p.varKinds.let){let C0=this._scope.toName(C);return this._for(new f(d0,C0,s,P),()=>X(C0))}forOf(C,s,P,X=p.varKinds.const){let d0=this._scope.toName(C);if(this.opts.es5){let C0=s instanceof y.Name?s:this.var("_arr",s);return this.forRange("_i",0,y._`${C0}.length`,(h0)=>{this.var(d0,y._`${C0}[${h0}]`),P(d0)})}return this._for(new I("of",X,d0,s),()=>P(d0))}forIn(C,s,P,X=this.opts.es5?p.varKinds.var:p.varKinds.const){if(this.opts.ownProperties)return this.forOf(C,y._`Object.keys(${s})`,P);let d0=this._scope.toName(C);return this._for(new I("in",X,d0,s),()=>P(d0))}endFor(){return this._endBlockNode(a)}label(C){return this._leafNode(new T(C))}break(C){return this._leafNode(new k(C))}return(C){let s=new Z;if(this._blockNode(s),this.code(C),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Z)}try(C,s,P){if(!s&&!P)throw Error('CodeGen: "try" without "catch" and "finally"');let X=new A;if(this._blockNode(X),this.code(C),s){let d0=this.name("e");this._currNode=X.catch=new g(d0),s(d0)}if(P)this._currNode=X.finally=new V,this.code(P);return this._endBlockNode(g,V)}throw(C){return this._leafNode(new o(C))}block(C,s){if(this._blockStarts.push(this._nodes.length),C)this.code(C).endBlock(s);return this}endBlock(C){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let P=this._nodes.length-s;if(P<0||C!==void 0&&P!==C)throw Error(`CodeGen: wrong number of nodes: ${P} vs ${C} expected`);return this._nodes.length=s,this}func(C,s=y.nil,P,X){if(this._blockNode(new x(C,s,P)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(x)}optimize(C=1){while(C-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(C){return this._currNode.nodes.push(C),this}_blockNode(C){this._currNode.nodes.push(C),this._nodes.push(C)}_endBlockNode(C,s){let P=this._currNode;if(P instanceof C||s&&P instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${C.kind}/${s.kind}`:C.kind}"`)}_elseNode(C){let s=this._currNode;if(!(s instanceof m))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=C,this}get _root(){return this._nodes[0]}get _currNode(){let C=this._nodes;return C[C.length-1]}set _currNode(C){let s=this._nodes;s[s.length-1]=C}}E.CodeGen=_;function N(C,s){for(let P in s)C[P]=(C[P]||0)+(s[P]||0);return C}function O(C,s){return s instanceof y._CodeOrName?N(C,s.names):C}function z(C,s,P){if(C instanceof y.Name)return X(C);if(!d0(C))return C;return new y._Code(C._items.reduce((C0,h0)=>{if(h0 instanceof y.Name)h0=X(h0);if(h0 instanceof y._Code)C0.push(...h0._items);else C0.push(h0);return C0},[]));function X(C0){let h0=P[C0.str];if(h0===void 0||s[C0.str]!==1)return C0;return delete s[C0.str],h0}function d0(C0){return C0 instanceof y._Code&&C0._items.some((h0)=>h0 instanceof y.Name&&s[h0.str]===1&&P[h0.str]!==void 0)}}function K(C,s){for(let P in s)C[P]=(C[P]||0)-(s[P]||0)}function l0(C){return typeof C=="boolean"||typeof C=="number"||C===null?!C:y._`!${B(C)}`}E.not=l0;var H0=L(E.operators.AND);function O0(...C){return C.reduce(H0)}E.and=O0;var o0=L(E.operators.OR);function b(...C){return C.reduce(o0)}E.or=b;function L(C){return(s,P)=>s===y.nil?P:P===y.nil?s:y._`${B(s)} ${C} ${B(P)}`}function B(C){return C instanceof y.Name?C:y._`(${C})`}}),Z0=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.checkStrictMode=E.getErrorPath=E.Type=E.useFunc=E.setEvaluated=E.evaluatedPropsToName=E.mergeEvaluated=E.eachItem=E.unescapeJsonPointer=E.escapeJsonPointer=E.escapeFragment=E.unescapeFragment=E.schemaRefOrVal=E.schemaHasRulesButRef=E.schemaHasRules=E.checkUnknownRules=E.alwaysValidSchema=E.toHash=void 0;var y=u0(),p=x8();function h(x){let Z={};for(let A of x)Z[A]=!0;return Z}E.toHash=h;function d(x,Z){if(typeof Z=="boolean")return Z;if(Object.keys(Z).length===0)return!0;return S(x,Z),!c(Z,x.self.RULES.all)}E.alwaysValidSchema=d;function S(x,Z=x.schema){let{opts:A,self:g}=x;if(!A.strictSchema)return;if(typeof Z==="boolean")return;let V=g.RULES.keywords;for(let _ in Z)if(!V[_])I(x,`unknown keyword: "${_}"`)}E.checkUnknownRules=S;function c(x,Z){if(typeof x=="boolean")return!x;for(let A in x)if(Z[A])return!0;return!1}E.schemaHasRules=c;function n(x,Z){if(typeof x=="boolean")return!x;for(let A in x)if(A!=="$ref"&&Z.all[A])return!0;return!1}E.schemaHasRulesButRef=n;function r({topSchemaRef:x,schemaPath:Z},A,g,V){if(!V){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return y._`${A}`}return y._`${x}${Z}${(0,y.getProperty)(g)}`}E.schemaRefOrVal=r;function T(x){return u(decodeURIComponent(x))}E.unescapeFragment=T;function k(x){return encodeURIComponent(o(x))}E.escapeFragment=k;function o(x){if(typeof x=="number")return`${x}`;return x.replace(/~/g,"~0").replace(/\//g,"~1")}E.escapeJsonPointer=o;function u(x){return x.replace(/~1/g,"/").replace(/~0/g,"~")}E.unescapeJsonPointer=u;function i(x,Z){if(Array.isArray(x))for(let A of x)Z(A);else Z(x)}E.eachItem=i;function v({mergeNames:x,mergeToName:Z,mergeValues:A,resultToName:g}){return(V,_,N,O)=>{let z=N===void 0?_:N instanceof y.Name?(_ instanceof y.Name?x(V,_,N):Z(V,_,N),N):_ instanceof y.Name?(Z(V,N,_),_):A(_,N);return O===y.Name&&!(z instanceof y.Name)?g(V,z):z}}E.mergeEvaluated={props:v({mergeNames:(x,Z,A)=>x.if(y._`${A} !== true && ${Z} !== undefined`,()=>{x.if(y._`${Z} === true`,()=>x.assign(A,!0),()=>x.assign(A,y._`${A} || {}`).code(y._`Object.assign(${A}, ${Z})`))}),mergeToName:(x,Z,A)=>x.if(y._`${A} !== true`,()=>{if(Z===!0)x.assign(A,!0);else x.assign(A,y._`${A} || {}`),t(x,A,Z)}),mergeValues:(x,Z)=>x===!0?!0:{...x,...Z},resultToName:F}),items:v({mergeNames:(x,Z,A)=>x.if(y._`${A} !== true && ${Z} !== undefined`,()=>x.assign(A,y._`${Z} === true ? true : ${A} > ${Z} ? ${A} : ${Z}`)),mergeToName:(x,Z,A)=>x.if(y._`${A} !== true`,()=>x.assign(A,Z===!0?!0:y._`${A} > ${Z} ? ${A} : ${Z}`)),mergeValues:(x,Z)=>x===!0?!0:Math.max(x,Z),resultToName:(x,Z)=>x.var("items",Z)})};function F(x,Z){if(Z===!0)return x.var("props",!0);let A=x.var("props",y._`{}`);if(Z!==void 0)t(x,A,Z);return A}E.evaluatedPropsToName=F;function t(x,Z,A){Object.keys(A).forEach((g)=>x.assign(y._`${Z}${(0,y.getProperty)(g)}`,!0))}E.setEvaluated=t;var m={};function a(x,Z){return x.scopeValue("func",{ref:Z,code:m[Z.code]||(m[Z.code]=new p._Code(Z.code))})}E.useFunc=a;var R;(function(x){x[x.Num=0]="Num",x[x.Str=1]="Str"})(R||(E.Type=R={}));function f(x,Z,A){if(x instanceof y.Name){let g=Z===R.Num;return A?g?y._`"[" + ${x} + "]"`:y._`"['" + ${x} + "']"`:g?y._`"/" + ${x}`:y._`"/" + ${x}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,y.getProperty)(x).toString():"/"+o(x)}E.getErrorPath=f;function I(x,Z,A=x.opts.strictSchema){if(!A)return;if(Z=`strict mode: ${Z}`,A===!0)throw Error(Z);x.self.logger.warn(Z)}E.checkStrictMode=I}),$3=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p={data:new y.Name("data"),valCxt:new y.Name("valCxt"),instancePath:new y.Name("instancePath"),parentData:new y.Name("parentData"),parentDataProperty:new y.Name("parentDataProperty"),rootData:new y.Name("rootData"),dynamicAnchors:new y.Name("dynamicAnchors"),vErrors:new y.Name("vErrors"),errors:new y.Name("errors"),this:new y.Name("this"),self:new y.Name("self"),scope:new y.Name("scope"),json:new y.Name("json"),jsonPos:new y.Name("jsonPos"),jsonLen:new y.Name("jsonLen"),jsonPart:new y.Name("jsonPart")};E.default=p}),O8=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.extendErrors=E.resetErrorsCount=E.reportExtraError=E.reportError=E.keyword$DataError=E.keywordError=void 0;var y=u0(),p=Z0(),h=$3();E.keywordError={message:({keyword:t})=>y.str`must pass "${t}" keyword validation`},E.keyword$DataError={message:({keyword:t,schemaType:m})=>m?y.str`"${t}" keyword must be ${m} ($data)`:y.str`"${t}" keyword is invalid ($data)`};function d(t,m=E.keywordError,a,R){let{it:f}=t,{gen:I,compositeRule:x,allErrors:Z}=f,A=o(t,m,a);if(R!==null&&R!==void 0?R:x||Z)r(I,A);else T(f,y._`[${A}]`)}E.reportError=d;function S(t,m=E.keywordError,a){let{it:R}=t,{gen:f,compositeRule:I,allErrors:x}=R,Z=o(t,m,a);if(r(f,Z),!(I||x))T(R,h.default.vErrors)}E.reportExtraError=S;function c(t,m){t.assign(h.default.errors,m),t.if(y._`${h.default.vErrors} !== null`,()=>t.if(m,()=>t.assign(y._`${h.default.vErrors}.length`,m),()=>t.assign(h.default.vErrors,null)))}E.resetErrorsCount=c;function n({gen:t,keyword:m,schemaValue:a,data:R,errsCount:f,it:I}){if(f===void 0)throw Error("ajv implementation error");let x=t.name("err");t.forRange("i",f,h.default.errors,(Z)=>{if(t.const(x,y._`${h.default.vErrors}[${Z}]`),t.if(y._`${x}.instancePath === undefined`,()=>t.assign(y._`${x}.instancePath`,(0,y.strConcat)(h.default.instancePath,I.errorPath))),t.assign(y._`${x}.schemaPath`,y.str`${I.errSchemaPath}/${m}`),I.opts.verbose)t.assign(y._`${x}.schema`,a),t.assign(y._`${x}.data`,R)})}E.extendErrors=n;function r(t,m){let a=t.const("err",m);t.if(y._`${h.default.vErrors} === null`,()=>t.assign(h.default.vErrors,y._`[${a}]`),y._`${h.default.vErrors}.push(${a})`),t.code(y._`${h.default.errors}++`)}function T(t,m){let{gen:a,validateName:R,schemaEnv:f}=t;if(f.$async)a.throw(y._`new ${t.ValidationError}(${m})`);else a.assign(y._`${R}.errors`,m),a.return(!1)}var k={keyword:new y.Name("keyword"),schemaPath:new y.Name("schemaPath"),params:new y.Name("params"),propertyName:new y.Name("propertyName"),message:new y.Name("message"),schema:new y.Name("schema"),parentSchema:new y.Name("parentSchema")};function o(t,m,a){let{createErrors:R}=t.it;if(R===!1)return y._`{}`;return u(t,m,a)}function u(t,m,a={}){let{gen:R,it:f}=t,I=[i(f,a),v(t,a)];return F(t,m,I),R.object(...I)}function i({errorPath:t},{instancePath:m}){let a=m?y.str`${t}${(0,p.getErrorPath)(m,p.Type.Str)}`:t;return[h.default.instancePath,(0,y.strConcat)(h.default.instancePath,a)]}function v({keyword:t,it:{errSchemaPath:m}},{schemaPath:a,parentSchema:R}){let f=R?m:y.str`${m}/${t}`;if(a)f=y.str`${f}${(0,p.getErrorPath)(a,p.Type.Str)}`;return[k.schemaPath,f]}function F(t,{params:m,message:a},R){let{keyword:f,data:I,schemaValue:x,it:Z}=t,{opts:A,propertyName:g,topSchemaRef:V,schemaPath:_}=Z;if(R.push([k.keyword,f],[k.params,typeof m=="function"?m(t):m||y._`{}`]),A.messages)R.push([k.message,typeof a=="function"?a(t):a]);if(A.verbose)R.push([k.schema,x],[k.parentSchema,y._`${V}${_}`],[h.default.data,I]);if(g)R.push([k.propertyName,g])}}),kT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.boolOrEmptySchema=E.topBoolOrEmptySchema=void 0;var y=O8(),p=u0(),h=$3(),d={message:"boolean schema is false"};function S(r){let{gen:T,schema:k,validateName:o}=r;if(k===!1)n(r,!1);else if(typeof k=="object"&&k.$async===!0)T.return(h.default.data);else T.assign(p._`${o}.errors`,null),T.return(!0)}E.topBoolOrEmptySchema=S;function c(r,T){let{gen:k,schema:o}=r;if(o===!1)k.var(T,!1),n(r);else k.var(T,!0)}E.boolOrEmptySchema=c;function n(r,T){let{gen:k,data:o}=r,u={gen:k,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,y.reportError)(u,d,void 0,T)}}),Lh=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.getRules=E.isJSONType=void 0;var y=["string","number","integer","boolean","null","object","array"],p=new Set(y);function h(S){return typeof S=="string"&&p.has(S)}E.isJSONType=h;function d(){let S={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...S,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},S.number,S.string,S.array,S.object],post:{rules:[]},all:{},keywords:{}}}E.getRules=d}),jh=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.shouldUseRule=E.shouldUseGroup=E.schemaHasRulesForType=void 0;function y({schema:d,self:S},c){let n=S.RULES.types[c];return n&&n!==!0&&p(d,n)}E.schemaHasRulesForType=y;function p(d,S){return S.rules.some((c)=>h(d,c))}E.shouldUseGroup=p;function h(d,S){var c;return d[S.keyword]!==void 0||((c=S.definition.implements)===null||c===void 0?void 0:c.some((n)=>d[n]!==void 0))}E.shouldUseRule=h}),I8=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.reportTypeError=E.checkDataTypes=E.checkDataType=E.coerceAndCheckDataType=E.getJSONTypes=E.getSchemaTypes=E.DataType=void 0;var y=Lh(),p=jh(),h=O8(),d=u0(),S=Z0(),c;(function(R){R[R.Correct=0]="Correct",R[R.Wrong=1]="Wrong"})(c||(E.DataType=c={}));function n(R){let f=r(R.type);if(f.includes("null")){if(R.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!f.length&&R.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(R.nullable===!0)f.push("null")}return f}E.getSchemaTypes=n;function r(R){let f=Array.isArray(R)?R:R?[R]:[];if(f.every(y.isJSONType))return f;throw Error("type must be JSONType or JSONType[]: "+f.join(","))}E.getJSONTypes=r;function T(R,f){let{gen:I,data:x,opts:Z}=R,A=o(f,Z.coerceTypes),g=f.length>0&&!(A.length===0&&f.length===1&&(0,p.schemaHasRulesForType)(R,f[0]));if(g){let V=F(f,x,Z.strictNumbers,c.Wrong);I.if(V,()=>{if(A.length)u(R,f,A);else m(R)})}return g}E.coerceAndCheckDataType=T;var k=new Set(["string","number","integer","boolean","null"]);function o(R,f){return f?R.filter((I)=>k.has(I)||f==="array"&&I==="array"):[]}function u(R,f,I){let{gen:x,data:Z,opts:A}=R,g=x.let("dataType",d._`typeof ${Z}`),V=x.let("coerced",d._`undefined`);if(A.coerceTypes==="array")x.if(d._`${g} == 'object' && Array.isArray(${Z}) && ${Z}.length == 1`,()=>x.assign(Z,d._`${Z}[0]`).assign(g,d._`typeof ${Z}`).if(F(f,Z,A.strictNumbers),()=>x.assign(V,Z)));x.if(d._`${V} !== undefined`);for(let N of I)if(k.has(N)||N==="array"&&A.coerceTypes==="array")_(N);x.else(),m(R),x.endIf(),x.if(d._`${V} !== undefined`,()=>{x.assign(Z,V),i(R,V)});function _(N){switch(N){case"string":x.elseIf(d._`${g} == "number" || ${g} == "boolean"`).assign(V,d._`"" + ${Z}`).elseIf(d._`${Z} === null`).assign(V,d._`""`);return;case"number":x.elseIf(d._`${g} == "boolean" || ${Z} === null
4
- || (${g} == "string" && ${Z} && ${Z} == +${Z})`).assign(V,d._`+${Z}`);return;case"integer":x.elseIf(d._`${g} === "boolean" || ${Z} === null
5
- || (${g} === "string" && ${Z} && ${Z} == +${Z} && !(${Z} % 1))`).assign(V,d._`+${Z}`);return;case"boolean":x.elseIf(d._`${Z} === "false" || ${Z} === 0 || ${Z} === null`).assign(V,!1).elseIf(d._`${Z} === "true" || ${Z} === 1`).assign(V,!0);return;case"null":x.elseIf(d._`${Z} === "" || ${Z} === 0 || ${Z} === false`),x.assign(V,null);return;case"array":x.elseIf(d._`${g} === "string" || ${g} === "number"
6
- || ${g} === "boolean" || ${Z} === null`).assign(V,d._`[${Z}]`)}}}function i({gen:R,parentData:f,parentDataProperty:I},x){R.if(d._`${f} !== undefined`,()=>R.assign(d._`${f}[${I}]`,x))}function v(R,f,I,x=c.Correct){let Z=x===c.Correct?d.operators.EQ:d.operators.NEQ,A;switch(R){case"null":return d._`${f} ${Z} null`;case"array":A=d._`Array.isArray(${f})`;break;case"object":A=d._`${f} && typeof ${f} == "object" && !Array.isArray(${f})`;break;case"integer":A=g(d._`!(${f} % 1) && !isNaN(${f})`);break;case"number":A=g();break;default:return d._`typeof ${f} ${Z} ${R}`}return x===c.Correct?A:(0,d.not)(A);function g(V=d.nil){return(0,d.and)(d._`typeof ${f} == "number"`,V,I?d._`isFinite(${f})`:d.nil)}}E.checkDataType=v;function F(R,f,I,x){if(R.length===1)return v(R[0],f,I,x);let Z,A=(0,S.toHash)(R);if(A.array&&A.object){let g=d._`typeof ${f} != "object"`;Z=A.null?g:d._`!${f} || ${g}`,delete A.null,delete A.array,delete A.object}else Z=d.nil;if(A.number)delete A.integer;for(let g in A)Z=(0,d.and)(Z,v(g,f,I,x));return Z}E.checkDataTypes=F;var t={message:({schema:R})=>`must be ${R}`,params:({schema:R,schemaValue:f})=>typeof R=="string"?d._`{type: ${R}}`:d._`{type: ${f}}`};function m(R){let f=a(R);(0,h.reportError)(f,t)}E.reportTypeError=m;function a(R){let{gen:f,data:I,schema:x}=R,Z=(0,S.schemaRefOrVal)(R,x,"type");return{gen:f,keyword:"type",data:I,schema:x.type,schemaCode:Z,schemaValue:Z,parentSchema:x,params:{},it:R}}}),aT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.assignDefaults=void 0;var y=u0(),p=Z0();function h(S,c){let{properties:n,items:r}=S.schema;if(c==="object"&&n)for(let T in n)d(S,T,n[T].default);else if(c==="array"&&Array.isArray(r))r.forEach((T,k)=>d(S,k,T.default))}E.assignDefaults=h;function d(S,c,n){let{gen:r,compositeRule:T,data:k,opts:o}=S;if(n===void 0)return;let u=y._`${k}${(0,y.getProperty)(c)}`;if(T){(0,p.checkStrictMode)(S,`default is ignored for: ${u}`);return}let i=y._`${u} === undefined`;if(o.useDefaults==="empty")i=y._`${i} || ${u} === null || ${u} === ""`;r.if(i,y._`${u} = ${(0,y.stringify)(n)}`)}}),e3=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.validateUnion=E.validateArray=E.usePattern=E.callValidateCode=E.schemaProperties=E.allSchemaProperties=E.noPropertyInData=E.propertyInData=E.isOwnProperty=E.hasPropFunc=E.reportMissingProp=E.checkMissingProp=E.checkReportMissingProp=void 0;var y=u0(),p=Z0(),h=$3(),d=Z0();function S(R,f){let{gen:I,data:x,it:Z}=R;I.if(o(I,x,f,Z.opts.ownProperties),()=>{R.setParams({missingProperty:y._`${f}`},!0),R.error()})}E.checkReportMissingProp=S;function c({gen:R,data:f,it:{opts:I}},x,Z){return(0,y.or)(...x.map((A)=>(0,y.and)(o(R,f,A,I.ownProperties),y._`${Z} = ${A}`)))}E.checkMissingProp=c;function n(R,f){R.setParams({missingProperty:f},!0),R.error()}E.reportMissingProp=n;function r(R){return R.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:y._`Object.prototype.hasOwnProperty`})}E.hasPropFunc=r;function T(R,f,I){return y._`${r(R)}.call(${f}, ${I})`}E.isOwnProperty=T;function k(R,f,I,x){let Z=y._`${f}${(0,y.getProperty)(I)} !== undefined`;return x?y._`${Z} && ${T(R,f,I)}`:Z}E.propertyInData=k;function o(R,f,I,x){let Z=y._`${f}${(0,y.getProperty)(I)} === undefined`;return x?(0,y.or)(Z,(0,y.not)(T(R,f,I))):Z}E.noPropertyInData=o;function u(R){return R?Object.keys(R).filter((f)=>f!=="__proto__"):[]}E.allSchemaProperties=u;function i(R,f){return u(f).filter((I)=>!(0,p.alwaysValidSchema)(R,f[I]))}E.schemaProperties=i;function v({schemaCode:R,data:f,it:{gen:I,topSchemaRef:x,schemaPath:Z,errorPath:A},it:g},V,_,N){let O=N?y._`${R}, ${f}, ${x}${Z}`:f,z=[[h.default.instancePath,(0,y.strConcat)(h.default.instancePath,A)],[h.default.parentData,g.parentData],[h.default.parentDataProperty,g.parentDataProperty],[h.default.rootData,h.default.rootData]];if(g.opts.dynamicRef)z.push([h.default.dynamicAnchors,h.default.dynamicAnchors]);let K=y._`${O}, ${I.object(...z)}`;return _!==y.nil?y._`${V}.call(${_}, ${K})`:y._`${V}(${K})`}E.callValidateCode=v;var F=y._`new RegExp`;function t({gen:R,it:{opts:f}},I){let x=f.unicodeRegExp?"u":"",{regExp:Z}=f.code,A=Z(I,x);return R.scopeValue("pattern",{key:A.toString(),ref:A,code:y._`${Z.code==="new RegExp"?F:(0,d.useFunc)(R,Z)}(${I}, ${x})`})}E.usePattern=t;function m(R){let{gen:f,data:I,keyword:x,it:Z}=R,A=f.name("valid");if(Z.allErrors){let V=f.let("valid",!0);return g(()=>f.assign(V,!1)),V}return f.var(A,!0),g(()=>f.break()),A;function g(V){let _=f.const("len",y._`${I}.length`);f.forRange("i",0,_,(N)=>{R.subschema({keyword:x,dataProp:N,dataPropType:p.Type.Num},A),f.if((0,y.not)(A),V)})}}E.validateArray=m;function a(R){let{gen:f,schema:I,keyword:x,it:Z}=R;if(!Array.isArray(I))throw Error("ajv implementation error");if(I.some((V)=>(0,p.alwaysValidSchema)(Z,V))&&!Z.opts.unevaluated)return;let A=f.let("valid",!1),g=f.name("_valid");f.block(()=>I.forEach((V,_)=>{let N=R.subschema({keyword:x,schemaProp:_,compositeRule:!0},g);if(f.assign(A,y._`${A} || ${g}`),!R.mergeValidEvaluated(N,g))f.if((0,y.not)(A))})),R.result(A,()=>R.reset(),()=>R.error(!0))}E.validateUnion=a}),CT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.validateKeywordUsage=E.validSchemaType=E.funcKeywordCode=E.macroKeywordCode=void 0;var y=u0(),p=$3(),h=e3(),d=O8();function S(i,v){let{gen:F,keyword:t,schema:m,parentSchema:a,it:R}=i,f=v.macro.call(R.self,m,a,R),I=k(F,t,f);if(R.opts.validateSchema!==!1)R.self.validateSchema(f,!0);let x=F.name("valid");i.subschema({schema:f,schemaPath:y.nil,errSchemaPath:`${R.errSchemaPath}/${t}`,topSchemaRef:I,compositeRule:!0},x),i.pass(x,()=>i.error(!0))}E.macroKeywordCode=S;function c(i,v){var F;let{gen:t,keyword:m,schema:a,parentSchema:R,$data:f,it:I}=i;T(I,v);let x=!f&&v.compile?v.compile.call(I.self,a,R,I):v.validate,Z=k(t,m,x),A=t.let("valid");i.block$data(A,g),i.ok((F=v.valid)!==null&&F!==void 0?F:A);function g(){if(v.errors===!1){if(N(),v.modifying)n(i);O(()=>i.error())}else{let z=v.async?V():_();if(v.modifying)n(i);O(()=>r(i,z))}}function V(){let z=t.let("ruleErrs",null);return t.try(()=>N(y._`await `),(K)=>t.assign(A,!1).if(y._`${K} instanceof ${I.ValidationError}`,()=>t.assign(z,y._`${K}.errors`),()=>t.throw(K))),z}function _(){let z=y._`${Z}.errors`;return t.assign(z,null),N(y.nil),z}function N(z=v.async?y._`await `:y.nil){let K=I.opts.passContext?p.default.this:p.default.self,l0=!(("compile"in v)&&!f||v.schema===!1);t.assign(A,y._`${z}${(0,h.callValidateCode)(i,Z,K,l0)}`,v.modifying)}function O(z){var K;t.if((0,y.not)((K=v.valid)!==null&&K!==void 0?K:A),z)}}E.funcKeywordCode=c;function n(i){let{gen:v,data:F,it:t}=i;v.if(t.parentData,()=>v.assign(F,y._`${t.parentData}[${t.parentDataProperty}]`))}function r(i,v){let{gen:F}=i;F.if(y._`Array.isArray(${v})`,()=>{F.assign(p.default.vErrors,y._`${p.default.vErrors} === null ? ${v} : ${p.default.vErrors}.concat(${v})`).assign(p.default.errors,y._`${p.default.vErrors}.length`),(0,d.extendErrors)(i)},()=>i.error())}function T({schemaEnv:i},v){if(v.async&&!i.$async)throw Error("async keyword in sync schema")}function k(i,v,F){if(F===void 0)throw Error(`keyword "${v}" failed to compile`);return i.scopeValue("keyword",typeof F=="function"?{ref:F}:{ref:F,code:(0,y.stringify)(F)})}function o(i,v,F=!1){return!v.length||v.some((t)=>t==="array"?Array.isArray(i):t==="object"?i&&typeof i=="object"&&!Array.isArray(i):typeof i==t||F&&typeof i>"u")}E.validSchemaType=o;function u({schema:i,opts:v,self:F,errSchemaPath:t},m,a){if(Array.isArray(m.keyword)?!m.keyword.includes(a):m.keyword!==a)throw Error("ajv implementation error");let R=m.dependencies;if(R===null||R===void 0?void 0:R.some((f)=>!Object.prototype.hasOwnProperty.call(i,f)))throw Error(`parent schema must have dependencies of ${a}: ${R.join(",")}`);if(m.validateSchema){if(!m.validateSchema(i[a])){let f=`keyword "${a}" value is invalid at path "${t}": `+F.errorsText(m.validateSchema.errors);if(v.validateSchema==="log")F.logger.error(f);else throw Error(f)}}}E.validateKeywordUsage=u}),oT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.extendSubschemaMode=E.extendSubschemaData=E.getSubschema=void 0;var y=u0(),p=Z0();function h(c,{keyword:n,schemaProp:r,schema:T,schemaPath:k,errSchemaPath:o,topSchemaRef:u}){if(n!==void 0&&T!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(n!==void 0){let i=c.schema[n];return r===void 0?{schema:i,schemaPath:y._`${c.schemaPath}${(0,y.getProperty)(n)}`,errSchemaPath:`${c.errSchemaPath}/${n}`}:{schema:i[r],schemaPath:y._`${c.schemaPath}${(0,y.getProperty)(n)}${(0,y.getProperty)(r)}`,errSchemaPath:`${c.errSchemaPath}/${n}/${(0,p.escapeFragment)(r)}`}}if(T!==void 0){if(k===void 0||o===void 0||u===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:T,schemaPath:k,topSchemaRef:u,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}E.getSubschema=h;function d(c,n,{dataProp:r,dataPropType:T,data:k,dataTypes:o,propertyName:u}){if(k!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=n;if(r!==void 0){let{errorPath:F,dataPathArr:t,opts:m}=n,a=i.let("data",y._`${n.data}${(0,y.getProperty)(r)}`,!0);v(a),c.errorPath=y.str`${F}${(0,p.getErrorPath)(r,T,m.jsPropertySyntax)}`,c.parentDataProperty=y._`${r}`,c.dataPathArr=[...t,c.parentDataProperty]}if(k!==void 0){let F=k instanceof y.Name?k:i.let("data",k,!0);if(v(F),u!==void 0)c.propertyName=u}if(o)c.dataTypes=o;function v(F){c.data=F,c.dataLevel=n.dataLevel+1,c.dataTypes=[],n.definedProperties=new Set,c.parentData=n.data,c.dataNames=[...n.dataNames,F]}}E.extendSubschemaData=d;function S(c,{jtdDiscriminator:n,jtdMetadata:r,compositeRule:T,createErrors:k,allErrors:o}){if(T!==void 0)c.compositeRule=T;if(k!==void 0)c.createErrors=k;if(o!==void 0)c.allErrors=o;c.jtdDiscriminator=n,c.jtdMetadata=r}E.extendSubschemaMode=S}),qh=W((E,y)=>{y.exports=function p(h,d){if(h===d)return!0;if(h&&d&&typeof h=="object"&&typeof d=="object"){if(h.constructor!==d.constructor)return!1;var S,c,n;if(Array.isArray(h)){if(S=h.length,S!=d.length)return!1;for(c=S;c--!==0;)if(!p(h[c],d[c]))return!1;return!0}if(h.constructor===RegExp)return h.source===d.source&&h.flags===d.flags;if(h.valueOf!==Object.prototype.valueOf)return h.valueOf()===d.valueOf();if(h.toString!==Object.prototype.toString)return h.toString()===d.toString();if(n=Object.keys(h),S=n.length,S!==Object.keys(d).length)return!1;for(c=S;c--!==0;)if(!Object.prototype.hasOwnProperty.call(d,n[c]))return!1;for(c=S;c--!==0;){var r=n[c];if(!p(h[r],d[r]))return!1}return!0}return h!==h&&d!==d}}),xT=W((E,y)=>{var p=y.exports=function(S,c,n){if(typeof c=="function")n=c,c={};n=c.cb||n;var r=typeof n=="function"?n:n.pre||function(){},T=n.post||function(){};h(c,r,T,S,"",S)};p.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},p.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},p.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},p.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function h(S,c,n,r,T,k,o,u,i,v){if(r&&typeof r=="object"&&!Array.isArray(r)){c(r,T,k,o,u,i,v);for(var F in r){var t=r[F];if(Array.isArray(t)){if(F in p.arrayKeywords)for(var m=0;m<t.length;m++)h(S,c,n,t[m],T+"/"+F+"/"+m,k,T,F,r,m)}else if(F in p.propsKeywords){if(t&&typeof t=="object")for(var a in t)h(S,c,n,t[a],T+"/"+F+"/"+d(a),k,T,F,r,a)}else if(F in p.keywords||S.allKeys&&!(F in p.skipKeywords))h(S,c,n,t,T+"/"+F,k,T,F,r)}n(r,T,k,o,u,i,v)}}function d(S){return S.replace(/~/g,"~0").replace(/\//g,"~1")}}),U8=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.getSchemaRefs=E.resolveUrl=E.normalizeId=E._getFullPath=E.getFullPath=E.inlineRef=void 0;var y=Z0(),p=qh(),h=xT(),d=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function S(t,m=!0){if(typeof t=="boolean")return!0;if(m===!0)return!n(t);if(!m)return!1;return r(t)<=m}E.inlineRef=S;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function n(t){for(let m in t){if(c.has(m))return!0;let a=t[m];if(Array.isArray(a)&&a.some(n))return!0;if(typeof a=="object"&&n(a))return!0}return!1}function r(t){let m=0;for(let a in t){if(a==="$ref")return 1/0;if(m++,d.has(a))continue;if(typeof t[a]=="object")(0,y.eachItem)(t[a],(R)=>m+=r(R));if(m===1/0)return 1/0}return m}function T(t,m="",a){if(a!==!1)m=u(m);let R=t.parse(m);return k(t,R)}E.getFullPath=T;function k(t,m){return t.serialize(m).split("#")[0]+"#"}E._getFullPath=k;var o=/#\/?$/;function u(t){return t?t.replace(o,""):""}E.normalizeId=u;function i(t,m,a){return a=u(a),t.resolve(m,a)}E.resolveUrl=i;var v=/^[a-z_][-a-z0-9._]*$/i;function F(t,m){if(typeof t=="boolean")return{};let{schemaId:a,uriResolver:R}=this.opts,f=u(t[a]||m),I={"":f},x=T(R,f,!1),Z={},A=new Set;return h(t,{allKeys:!0},(_,N,O,z)=>{if(z===void 0)return;let K=x+N,l0=I[z];if(typeof _[a]=="string")l0=H0.call(this,_[a]);O0.call(this,_.$anchor),O0.call(this,_.$dynamicAnchor),I[N]=l0;function H0(o0){let b=this.opts.uriResolver.resolve;if(o0=u(l0?b(l0,o0):o0),A.has(o0))throw V(o0);A.add(o0);let L=this.refs[o0];if(typeof L=="string")L=this.refs[L];if(typeof L=="object")g(_,L.schema,o0);else if(o0!==u(K))if(o0[0]==="#")g(_,Z[o0],o0),Z[o0]=_;else this.refs[o0]=K;return o0}function O0(o0){if(typeof o0=="string"){if(!v.test(o0))throw Error(`invalid anchor "${o0}"`);H0.call(this,`#${o0}`)}}}),Z;function g(_,N,O){if(N!==void 0&&!p(_,N))throw V(O)}function V(_){return Error(`reference "${_}" resolves to more than one schema`)}}E.getSchemaRefs=F}),G8=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.getData=E.KeywordCxt=E.validateFunctionCode=void 0;var y=kT(),p=I8(),h=jh(),d=I8(),S=aT(),c=CT(),n=oT(),r=u0(),T=$3(),k=U8(),o=Z0(),u=O8();function i(M){if(x(M)){if(A(M),I(M)){m(M);return}}v(M,()=>(0,y.topBoolOrEmptySchema)(M))}E.validateFunctionCode=i;function v({gen:M,validateName:j,schema:D,schemaEnv:y0,opts:p0},f0){if(p0.code.es5)M.func(j,r._`${T.default.data}, ${T.default.valCxt}`,y0.$async,()=>{M.code(r._`"use strict"; ${R(D,p0)}`),t(M,p0),M.code(f0)});else M.func(j,r._`${T.default.data}, ${F(p0)}`,y0.$async,()=>M.code(R(D,p0)).code(f0))}function F(M){return r._`{${T.default.instancePath}="", ${T.default.parentData}, ${T.default.parentDataProperty}, ${T.default.rootData}=${T.default.data}${M.dynamicRef?r._`, ${T.default.dynamicAnchors}={}`:r.nil}}={}`}function t(M,j){M.if(T.default.valCxt,()=>{if(M.var(T.default.instancePath,r._`${T.default.valCxt}.${T.default.instancePath}`),M.var(T.default.parentData,r._`${T.default.valCxt}.${T.default.parentData}`),M.var(T.default.parentDataProperty,r._`${T.default.valCxt}.${T.default.parentDataProperty}`),M.var(T.default.rootData,r._`${T.default.valCxt}.${T.default.rootData}`),j.dynamicRef)M.var(T.default.dynamicAnchors,r._`${T.default.valCxt}.${T.default.dynamicAnchors}`)},()=>{if(M.var(T.default.instancePath,r._`""`),M.var(T.default.parentData,r._`undefined`),M.var(T.default.parentDataProperty,r._`undefined`),M.var(T.default.rootData,T.default.data),j.dynamicRef)M.var(T.default.dynamicAnchors,r._`{}`)})}function m(M){let{schema:j,opts:D,gen:y0}=M;v(M,()=>{if(D.$comment&&j.$comment)z(M);if(_(M),y0.let(T.default.vErrors,null),y0.let(T.default.errors,0),D.unevaluated)a(M);g(M),K(M)});return}function a(M){let{gen:j,validateName:D}=M;M.evaluated=j.const("evaluated",r._`${D}.evaluated`),j.if(r._`${M.evaluated}.dynamicProps`,()=>j.assign(r._`${M.evaluated}.props`,r._`undefined`)),j.if(r._`${M.evaluated}.dynamicItems`,()=>j.assign(r._`${M.evaluated}.items`,r._`undefined`))}function R(M,j){let D=typeof M=="object"&&M[j.schemaId];return D&&(j.code.source||j.code.process)?r._`/*# sourceURL=${D} */`:r.nil}function f(M,j){if(x(M)){if(A(M),I(M)){Z(M,j);return}}(0,y.boolOrEmptySchema)(M,j)}function I({schema:M,self:j}){if(typeof M=="boolean")return!M;for(let D in M)if(j.RULES.all[D])return!0;return!1}function x(M){return typeof M.schema!="boolean"}function Z(M,j){let{schema:D,gen:y0,opts:p0}=M;if(p0.$comment&&D.$comment)z(M);N(M),O(M);let f0=y0.const("_errs",T.default.errors);g(M,f0),y0.var(j,r._`${f0} === ${T.default.errors}`)}function A(M){(0,o.checkUnknownRules)(M),V(M)}function g(M,j){if(M.opts.jtd)return H0(M,[],!1,j);let D=(0,p.getSchemaTypes)(M.schema),y0=(0,p.coerceAndCheckDataType)(M,D);H0(M,D,!y0,j)}function V(M){let{schema:j,errSchemaPath:D,opts:y0,self:p0}=M;if(j.$ref&&y0.ignoreKeywordsWithRef&&(0,o.schemaHasRulesButRef)(j,p0.RULES))p0.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function _(M){let{schema:j,opts:D}=M;if(j.default!==void 0&&D.useDefaults&&D.strictSchema)(0,o.checkStrictMode)(M,"default is ignored in the schema root")}function N(M){let j=M.schema[M.opts.schemaId];if(j)M.baseId=(0,k.resolveUrl)(M.opts.uriResolver,M.baseId,j)}function O(M){if(M.schema.$async&&!M.schemaEnv.$async)throw Error("async schema in sync schema")}function z({gen:M,schemaEnv:j,schema:D,errSchemaPath:y0,opts:p0}){let f0=D.$comment;if(p0.$comment===!0)M.code(r._`${T.default.self}.logger.log(${f0})`);else if(typeof p0.$comment=="function"){let G0=r.str`${y0}/$comment`,X0=M.scopeValue("root",{ref:j.root});M.code(r._`${T.default.self}.opts.$comment(${f0}, ${G0}, ${X0}.schema)`)}}function K(M){let{gen:j,schemaEnv:D,validateName:y0,ValidationError:p0,opts:f0}=M;if(D.$async)j.if(r._`${T.default.errors} === 0`,()=>j.return(T.default.data),()=>j.throw(r._`new ${p0}(${T.default.vErrors})`));else{if(j.assign(r._`${y0}.errors`,T.default.vErrors),f0.unevaluated)l0(M);j.return(r._`${T.default.errors} === 0`)}}function l0({gen:M,evaluated:j,props:D,items:y0}){if(D instanceof r.Name)M.assign(r._`${j}.props`,D);if(y0 instanceof r.Name)M.assign(r._`${j}.items`,y0)}function H0(M,j,D,y0){let{gen:p0,schema:f0,data:G0,allErrors:X0,opts:U0,self:W0}=M,{RULES:B0}=W0;if(f0.$ref&&(U0.ignoreKeywordsWithRef||!(0,o.schemaHasRulesButRef)(f0,B0))){p0.block(()=>C0(M,"$ref",B0.all.$ref.definition));return}if(!U0.jtd)o0(M,j);p0.block(()=>{for(let E3 of B0.rules)f3(E3);f3(B0.post)});function f3(E3){if(!(0,h.shouldUseGroup)(f0,E3))return;if(E3.type){if(p0.if((0,d.checkDataType)(E3.type,G0,U0.strictNumbers)),O0(M,E3),j.length===1&&j[0]===E3.type&&D)p0.else(),(0,d.reportTypeError)(M);p0.endIf()}else O0(M,E3);if(!X0)p0.if(r._`${T.default.errors} === ${y0||0}`)}}function O0(M,j){let{gen:D,schema:y0,opts:{useDefaults:p0}}=M;if(p0)(0,S.assignDefaults)(M,j.type);D.block(()=>{for(let f0 of j.rules)if((0,h.shouldUseRule)(y0,f0))C0(M,f0.keyword,f0.definition,j.type)})}function o0(M,j){if(M.schemaEnv.meta||!M.opts.strictTypes)return;if(b(M,j),!M.opts.allowUnionTypes)L(M,j);B(M,M.dataTypes)}function b(M,j){if(!j.length)return;if(!M.dataTypes.length){M.dataTypes=j;return}j.forEach((D)=>{if(!s(M.dataTypes,D))X(M,`type "${D}" not allowed by context "${M.dataTypes.join(",")}"`)}),P(M,j)}function L(M,j){if(j.length>1&&!(j.length===2&&j.includes("null")))X(M,"use allowUnionTypes to allow union type keyword")}function B(M,j){let D=M.self.RULES.all;for(let y0 in D){let p0=D[y0];if(typeof p0=="object"&&(0,h.shouldUseRule)(M.schema,p0)){let{type:f0}=p0.definition;if(f0.length&&!f0.some((G0)=>C(j,G0)))X(M,`missing type "${f0.join(",")}" for keyword "${y0}"`)}}}function C(M,j){return M.includes(j)||j==="number"&&M.includes("integer")}function s(M,j){return M.includes(j)||j==="integer"&&M.includes("number")}function P(M,j){let D=[];for(let y0 of M.dataTypes)if(s(j,y0))D.push(y0);else if(j.includes("integer")&&y0==="number")D.push("integer");M.dataTypes=D}function X(M,j){let D=M.schemaEnv.baseId+M.errSchemaPath;j+=` at "${D}" (strictTypes)`,(0,o.checkStrictMode)(M,j,M.opts.strictTypes)}class d0{constructor(M,j,D){if((0,c.validateKeywordUsage)(M,j,D),this.gen=M.gen,this.allErrors=M.allErrors,this.keyword=D,this.data=M.data,this.schema=M.schema[D],this.$data=j.$data&&M.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,o.schemaRefOrVal)(M,this.schema,D,this.$data),this.schemaType=j.schemaType,this.parentSchema=M.schema,this.params={},this.it=M,this.def=j,this.$data)this.schemaCode=M.gen.const("vSchema",v3(this.$data,M));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,j.schemaType,j.allowUndefined))throw Error(`${D} value must be ${JSON.stringify(j.schemaType)}`);if("code"in j?j.trackErrors:j.errors!==!1)this.errsCount=M.gen.const("_errs",T.default.errors)}result(M,j,D){this.failResult((0,r.not)(M),j,D)}failResult(M,j,D){if(this.gen.if(M),D)D();else this.error();if(j){if(this.gen.else(),j(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(M,j){this.failResult((0,r.not)(M),void 0,j)}fail(M){if(M===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(M),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(M){if(!this.$data)return this.fail(M);let{schemaCode:j}=this;this.fail(r._`${j} !== undefined && (${(0,r.or)(this.invalid$data(),M)})`)}error(M,j,D){if(j){this.setParams(j),this._error(M,D),this.setParams({});return}this._error(M,D)}_error(M,j){(M?u.reportExtraError:u.reportError)(this,this.def.error,j)}$dataError(){(0,u.reportError)(this,this.def.$dataError||u.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,u.resetErrorsCount)(this.gen,this.errsCount)}ok(M){if(!this.allErrors)this.gen.if(M)}setParams(M,j){if(j)Object.assign(this.params,M);else this.params=M}block$data(M,j,D=r.nil){this.gen.block(()=>{this.check$data(M,D),j()})}check$data(M=r.nil,j=r.nil){if(!this.$data)return;let{gen:D,schemaCode:y0,schemaType:p0,def:f0}=this;if(D.if((0,r.or)(r._`${y0} === undefined`,j)),M!==r.nil)D.assign(M,!0);if(p0.length||f0.validateSchema){if(D.elseIf(this.invalid$data()),this.$dataError(),M!==r.nil)D.assign(M,!1)}D.else()}invalid$data(){let{gen:M,schemaCode:j,schemaType:D,def:y0,it:p0}=this;return(0,r.or)(f0(),G0());function f0(){if(D.length){if(!(j instanceof r.Name))throw Error("ajv implementation error");let X0=Array.isArray(D)?D:[D];return r._`${(0,d.checkDataTypes)(X0,j,p0.opts.strictNumbers,d.DataType.Wrong)}`}return r.nil}function G0(){if(y0.validateSchema){let X0=M.scopeValue("validate$data",{ref:y0.validateSchema});return r._`!${X0}(${j})`}return r.nil}}subschema(M,j){let D=(0,n.getSubschema)(this.it,M);(0,n.extendSubschemaData)(D,this.it,M),(0,n.extendSubschemaMode)(D,M);let y0={...this.it,...D,items:void 0,props:void 0};return f(y0,j),y0}mergeEvaluated(M,j){let{it:D,gen:y0}=this;if(!D.opts.unevaluated)return;if(D.props!==!0&&M.props!==void 0)D.props=o.mergeEvaluated.props(y0,M.props,D.props,j);if(D.items!==!0&&M.items!==void 0)D.items=o.mergeEvaluated.items(y0,M.items,D.items,j)}mergeValidEvaluated(M,j){let{it:D,gen:y0}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return y0.if(j,()=>this.mergeEvaluated(M,r.Name)),!0}}E.KeywordCxt=d0;function C0(M,j,D,y0){let p0=new d0(M,D,j);if("code"in D)D.code(p0,y0);else if(p0.$data&&D.validate)(0,c.funcKeywordCode)(p0,D);else if("macro"in D)(0,c.macroKeywordCode)(p0,D);else if(D.compile||D.validate)(0,c.funcKeywordCode)(p0,D)}var h0=/^\/(?:[^~]|~0|~1)*$/,P0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function v3(M,{dataLevel:j,dataNames:D,dataPathArr:y0}){let p0,f0;if(M==="")return T.default.rootData;if(M[0]==="/"){if(!h0.test(M))throw Error(`Invalid JSON-pointer: ${M}`);p0=M,f0=T.default.rootData}else{let W0=P0.exec(M);if(!W0)throw Error(`Invalid JSON-pointer: ${M}`);let B0=+W0[1];if(p0=W0[2],p0==="#"){if(B0>=j)throw Error(U0("property/index",B0));return y0[j-B0]}if(B0>j)throw Error(U0("data",B0));if(f0=D[j-B0],!p0)return f0}let G0=f0,X0=p0.split("/");for(let W0 of X0)if(W0)f0=r._`${f0}${(0,r.getProperty)((0,o.unescapeJsonPointer)(W0))}`,G0=r._`${G0} && ${f0}`;return G0;function U0(W0,B0){return`Cannot access ${W0} ${B0} levels up, current level is ${j}`}}E.getData=v3}),JE=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});class y extends Error{constructor(p){super("validation failed");this.errors=p,this.ajv=this.validation=!0}}E.default=y}),W8=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=U8();class p extends Error{constructor(h,d,S,c){super(c||`can't resolve reference ${S} from id ${d}`);this.missingRef=(0,y.resolveUrl)(h,d,S),this.missingSchema=(0,y.normalizeId)((0,y.getFullPath)(h,this.missingRef))}}E.default=p}),YE=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.resolveSchema=E.getCompilingSchema=E.resolveRef=E.compileSchema=E.SchemaEnv=void 0;var y=u0(),p=JE(),h=$3(),d=U8(),S=Z0(),c=G8();class n{constructor(m){var a;this.refs={},this.dynamicAnchors={};let R;if(typeof m.schema=="object")R=m.schema;this.schema=m.schema,this.schemaId=m.schemaId,this.root=m.root||this,this.baseId=(a=m.baseId)!==null&&a!==void 0?a:(0,d.normalizeId)(R===null||R===void 0?void 0:R[m.schemaId||"$id"]),this.schemaPath=m.schemaPath,this.localRefs=m.localRefs,this.meta=m.meta,this.$async=R===null||R===void 0?void 0:R.$async,this.refs={}}}E.SchemaEnv=n;function r(m){let a=o.call(this,m);if(a)return a;let R=(0,d.getFullPath)(this.opts.uriResolver,m.root.baseId),{es5:f,lines:I}=this.opts.code,{ownProperties:x}=this.opts,Z=new y.CodeGen(this.scope,{es5:f,lines:I,ownProperties:x}),A;if(m.$async)A=Z.scopeValue("Error",{ref:p.default,code:y._`require("ajv/dist/runtime/validation_error").default`});let g=Z.scopeName("validate");m.validateName=g;let V={gen:Z,allErrors:this.opts.allErrors,data:h.default.data,parentData:h.default.parentData,parentDataProperty:h.default.parentDataProperty,dataNames:[h.default.data],dataPathArr:[y.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:Z.scopeValue("schema",this.opts.code.source===!0?{ref:m.schema,code:(0,y.stringify)(m.schema)}:{ref:m.schema}),validateName:g,ValidationError:A,schema:m.schema,schemaEnv:m,rootId:R,baseId:m.baseId||R,schemaPath:y.nil,errSchemaPath:m.schemaPath||(this.opts.jtd?"":"#"),errorPath:y._`""`,opts:this.opts,self:this},_;try{this._compilations.add(m),(0,c.validateFunctionCode)(V),Z.optimize(this.opts.code.optimize);let N=Z.toString();if(_=`${Z.scopeRefs(h.default.scope)}return ${N}`,this.opts.code.process)_=this.opts.code.process(_,m);let O=Function(`${h.default.self}`,`${h.default.scope}`,_)(this,this.scope.get());if(this.scope.value(g,{ref:O}),O.errors=null,O.schema=m.schema,O.schemaEnv=m,m.$async)O.$async=!0;if(this.opts.code.source===!0)O.source={validateName:g,validateCode:N,scopeValues:Z._values};if(this.opts.unevaluated){let{props:z,items:K}=V;if(O.evaluated={props:z instanceof y.Name?void 0:z,items:K instanceof y.Name?void 0:K,dynamicProps:z instanceof y.Name,dynamicItems:K instanceof y.Name},O.source)O.source.evaluated=(0,y.stringify)(O.evaluated)}return m.validate=O,m}catch(N){if(delete m.validate,delete m.validateName,_)this.logger.error("Error compiling schema, function code:",_);throw N}finally{this._compilations.delete(m)}}E.compileSchema=r;function T(m,a,R){var f;R=(0,d.resolveUrl)(this.opts.uriResolver,a,R);let I=m.refs[R];if(I)return I;let x=i.call(this,m,R);if(x===void 0){let Z=(f=m.localRefs)===null||f===void 0?void 0:f[R],{schemaId:A}=this.opts;if(Z)x=new n({schema:Z,schemaId:A,root:m,baseId:a})}if(x===void 0)return;return m.refs[R]=k.call(this,x)}E.resolveRef=T;function k(m){if((0,d.inlineRef)(m.schema,this.opts.inlineRefs))return m.schema;return m.validate?m:r.call(this,m)}function o(m){for(let a of this._compilations)if(u(a,m))return a}E.getCompilingSchema=o;function u(m,a){return m.schema===a.schema&&m.root===a.root&&m.baseId===a.baseId}function i(m,a){let R;while(typeof(R=this.refs[a])=="string")a=R;return R||this.schemas[a]||v.call(this,m,a)}function v(m,a){let R=this.opts.uriResolver.parse(a),f=(0,d._getFullPath)(this.opts.uriResolver,R),I=(0,d.getFullPath)(this.opts.uriResolver,m.baseId,void 0);if(Object.keys(m.schema).length>0&&f===I)return t.call(this,R,m);let x=(0,d.normalizeId)(f),Z=this.refs[x]||this.schemas[x];if(typeof Z=="string"){let A=v.call(this,m,Z);if(typeof(A===null||A===void 0?void 0:A.schema)!=="object")return;return t.call(this,R,A)}if(typeof(Z===null||Z===void 0?void 0:Z.schema)!=="object")return;if(!Z.validate)r.call(this,Z);if(x===(0,d.normalizeId)(a)){let{schema:A}=Z,{schemaId:g}=this.opts,V=A[g];if(V)I=(0,d.resolveUrl)(this.opts.uriResolver,I,V);return new n({schema:A,schemaId:g,root:m,baseId:I})}return t.call(this,R,Z)}E.resolveSchema=v;var F=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function t(m,{baseId:a,schema:R,root:f}){var I;if(((I=m.fragment)===null||I===void 0?void 0:I[0])!=="/")return;for(let A of m.fragment.slice(1).split("/")){if(typeof R==="boolean")return;let g=R[(0,S.unescapeFragment)(A)];if(g===void 0)return;R=g;let V=typeof R==="object"&&R[this.opts.schemaId];if(!F.has(A)&&V)a=(0,d.resolveUrl)(this.opts.uriResolver,a,V)}let x;if(typeof R!="boolean"&&R.$ref&&!(0,S.schemaHasRulesButRef)(R,this.RULES)){let A=(0,d.resolveUrl)(this.opts.uriResolver,a,R.$ref);x=v.call(this,f,A)}let{schemaId:Z}=this.opts;if(x=x||new n({schema:R,schemaId:Z,root:f,baseId:a}),x.schema!==x.root.schema)return x;return}}),IT=W((E,y)=>{y.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),iT=W((E,y)=>{var p={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};y.exports={HEX:p}}),tT=W((E,y)=>{var{HEX:p}=iT(),h=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function d(m){if(T(m,".")<3)return{host:m,isIPV4:!1};let a=m.match(h)||[],[R]=a;if(R)return{host:r(R,"."),isIPV4:!0};else return{host:m,isIPV4:!1}}function S(m,a=!1){let R="",f=!0;for(let I of m){if(p[I]===void 0)return;if(I!=="0"&&f===!0)f=!1;if(!f)R+=I}if(a&&R.length===0)R="0";return R}function c(m){let a=0,R={error:!1,address:"",zone:""},f=[],I=[],x=!1,Z=!1,A=!1;function g(){if(I.length){if(x===!1){let V=S(I);if(V!==void 0)f.push(V);else return R.error=!0,!1}I.length=0}return!0}for(let V=0;V<m.length;V++){let _=m[V];if(_==="["||_==="]")continue;if(_===":"){if(Z===!0)A=!0;if(!g())break;if(a++,f.push(":"),a>7){R.error=!0;break}if(V-1>=0&&m[V-1]===":")Z=!0;continue}else if(_==="%"){if(!g())break;x=!0}else{I.push(_);continue}}if(I.length)if(x)R.zone=I.join("");else if(A)f.push(I.join(""));else f.push(S(I));return R.address=f.join(""),R}function n(m){if(T(m,":")<2)return{host:m,isIPV6:!1};let a=c(m);if(!a.error){let{address:R,address:f}=a;if(a.zone)R+="%"+a.zone,f+="%25"+a.zone;return{host:R,escapedHost:f,isIPV6:!0}}else return{host:m,isIPV6:!1}}function r(m,a){let R="",f=!0,I=m.length;for(let x=0;x<I;x++){let Z=m[x];if(Z==="0"&&f){if(x+1<=I&&m[x+1]===a||x+1===I)R+=Z,f=!1}else{if(Z===a)f=!0;else f=!1;R+=Z}}return R}function T(m,a){let R=0;for(let f=0;f<m.length;f++)if(m[f]===a)R++;return R}var k=/^\.\.?\//u,o=/^\/\.(?:\/|$)/u,u=/^\/\.\.(?:\/|$)/u,i=/^\/?(?:.|\n)*?(?=\/|$)/u;function v(m){let a=[];while(m.length)if(m.match(k))m=m.replace(k,"");else if(m.match(o))m=m.replace(o,"/");else if(m.match(u))m=m.replace(u,"/"),a.pop();else if(m==="."||m==="..")m="";else{let R=m.match(i);if(R){let f=R[0];m=m.slice(f.length),a.push(f)}else throw Error("Unexpected dot segment condition")}return a.join("")}function F(m,a){let R=a!==!0?escape:unescape;if(m.scheme!==void 0)m.scheme=R(m.scheme);if(m.userinfo!==void 0)m.userinfo=R(m.userinfo);if(m.host!==void 0)m.host=R(m.host);if(m.path!==void 0)m.path=R(m.path);if(m.query!==void 0)m.query=R(m.query);if(m.fragment!==void 0)m.fragment=R(m.fragment);return m}function t(m){let a=[];if(m.userinfo!==void 0)a.push(m.userinfo),a.push("@");if(m.host!==void 0){let R=unescape(m.host),f=d(R);if(f.isIPV4)R=f.host;else{let I=n(f.host);if(I.isIPV6===!0)R=`[${I.escapedHost}]`;else R=m.host}a.push(R)}if(typeof m.port==="number"||typeof m.port==="string")a.push(":"),a.push(String(m.port));return a.length?a.join(""):void 0}y.exports={recomposeAuthority:t,normalizeComponentEncoding:F,removeDotSegments:v,normalizeIPv4:d,normalizeIPv6:n,stringArrayToHexStripped:S}}),ZT=W((E,y)=>{var p=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,h=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function d(f){return typeof f.secure==="boolean"?f.secure:String(f.scheme).toLowerCase()==="wss"}function S(f){if(!f.host)f.error=f.error||"HTTP URIs must have a host.";return f}function c(f){let I=String(f.scheme).toLowerCase()==="https";if(f.port===(I?443:80)||f.port==="")f.port=void 0;if(!f.path)f.path="/";return f}function n(f){return f.secure=d(f),f.resourceName=(f.path||"/")+(f.query?"?"+f.query:""),f.path=void 0,f.query=void 0,f}function r(f){if(f.port===(d(f)?443:80)||f.port==="")f.port=void 0;if(typeof f.secure==="boolean")f.scheme=f.secure?"wss":"ws",f.secure=void 0;if(f.resourceName){let[I,x]=f.resourceName.split("?");f.path=I&&I!=="/"?I:void 0,f.query=x,f.resourceName=void 0}return f.fragment=void 0,f}function T(f,I){if(!f.path)return f.error="URN can not be parsed",f;let x=f.path.match(h);if(x){let Z=I.scheme||f.scheme||"urn";f.nid=x[1].toLowerCase(),f.nss=x[2];let A=`${Z}:${I.nid||f.nid}`,g=R[A];if(f.path=void 0,g)f=g.parse(f,I)}else f.error=f.error||"URN can not be parsed.";return f}function k(f,I){let x=I.scheme||f.scheme||"urn",Z=f.nid.toLowerCase(),A=`${x}:${I.nid||Z}`,g=R[A];if(g)f=g.serialize(f,I);let V=f,_=f.nss;return V.path=`${Z||I.nid}:${_}`,I.skipEscape=!0,V}function o(f,I){let x=f;if(x.uuid=x.nss,x.nss=void 0,!I.tolerant&&(!x.uuid||!p.test(x.uuid)))x.error=x.error||"UUID is not valid.";return x}function u(f){let I=f;return I.nss=(f.uuid||"").toLowerCase(),I}var i={scheme:"http",domainHost:!0,parse:S,serialize:c},v={scheme:"https",domainHost:i.domainHost,parse:S,serialize:c},F={scheme:"ws",domainHost:!0,parse:n,serialize:r},t={scheme:"wss",domainHost:F.domainHost,parse:F.parse,serialize:F.serialize},m={scheme:"urn",parse:T,serialize:k,skipNormalize:!0},a={scheme:"urn:uuid",parse:o,serialize:u,skipNormalize:!0},R={http:i,https:v,ws:F,wss:t,urn:m,"urn:uuid":a};y.exports=R}),vT=W((E,y)=>{var{normalizeIPv6:p,normalizeIPv4:h,removeDotSegments:d,recomposeAuthority:S,normalizeComponentEncoding:c}=tT(),n=ZT();function r(a,R){if(typeof a==="string")a=u(t(a,R),R);else if(typeof a==="object")a=t(u(a,R),R);return a}function T(a,R,f){let I=Object.assign({scheme:"null"},f),x=k(t(a,I),t(R,I),I,!0);return u(x,{...I,skipEscape:!0})}function k(a,R,f,I){let x={};if(!I)a=t(u(a,f),f),R=t(u(R,f),f);if(f=f||{},!f.tolerant&&R.scheme)x.scheme=R.scheme,x.userinfo=R.userinfo,x.host=R.host,x.port=R.port,x.path=d(R.path||""),x.query=R.query;else{if(R.userinfo!==void 0||R.host!==void 0||R.port!==void 0)x.userinfo=R.userinfo,x.host=R.host,x.port=R.port,x.path=d(R.path||""),x.query=R.query;else{if(!R.path)if(x.path=a.path,R.query!==void 0)x.query=R.query;else x.query=a.query;else{if(R.path.charAt(0)==="/")x.path=d(R.path);else{if((a.userinfo!==void 0||a.host!==void 0||a.port!==void 0)&&!a.path)x.path="/"+R.path;else if(!a.path)x.path=R.path;else x.path=a.path.slice(0,a.path.lastIndexOf("/")+1)+R.path;x.path=d(x.path)}x.query=R.query}x.userinfo=a.userinfo,x.host=a.host,x.port=a.port}x.scheme=a.scheme}return x.fragment=R.fragment,x}function o(a,R,f){if(typeof a==="string")a=unescape(a),a=u(c(t(a,f),!0),{...f,skipEscape:!0});else if(typeof a==="object")a=u(c(a,!0),{...f,skipEscape:!0});if(typeof R==="string")R=unescape(R),R=u(c(t(R,f),!0),{...f,skipEscape:!0});else if(typeof R==="object")R=u(c(R,!0),{...f,skipEscape:!0});return a.toLowerCase()===R.toLowerCase()}function u(a,R){let f={host:a.host,scheme:a.scheme,userinfo:a.userinfo,port:a.port,path:a.path,query:a.query,nid:a.nid,nss:a.nss,uuid:a.uuid,fragment:a.fragment,reference:a.reference,resourceName:a.resourceName,secure:a.secure,error:""},I=Object.assign({},R),x=[],Z=n[(I.scheme||f.scheme||"").toLowerCase()];if(Z&&Z.serialize)Z.serialize(f,I);if(f.path!==void 0)if(!I.skipEscape){if(f.path=escape(f.path),f.scheme!==void 0)f.path=f.path.split("%3A").join(":")}else f.path=unescape(f.path);if(I.reference!=="suffix"&&f.scheme)x.push(f.scheme,":");let A=S(f);if(A!==void 0){if(I.reference!=="suffix")x.push("//");if(x.push(A),f.path&&f.path.charAt(0)!=="/")x.push("/")}if(f.path!==void 0){let g=f.path;if(!I.absolutePath&&(!Z||!Z.absolutePath))g=d(g);if(A===void 0)g=g.replace(/^\/\//u,"/%2F");x.push(g)}if(f.query!==void 0)x.push("?",f.query);if(f.fragment!==void 0)x.push("#",f.fragment);return x.join("")}var i=Array.from({length:127},(a,R)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(R)));function v(a){let R=0;for(let f=0,I=a.length;f<I;++f)if(R=a.charCodeAt(f),R>126||i[R])return!0;return!1}var F=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function t(a,R){let f=Object.assign({},R),I={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},x=a.indexOf("%")!==-1,Z=!1;if(f.reference==="suffix")a=(f.scheme?f.scheme+":":"")+"//"+a;let A=a.match(F);if(A){if(I.scheme=A[1],I.userinfo=A[3],I.host=A[4],I.port=parseInt(A[5],10),I.path=A[6]||"",I.query=A[7],I.fragment=A[8],isNaN(I.port))I.port=A[5];if(I.host){let V=h(I.host);if(V.isIPV4===!1){let _=p(V.host);I.host=_.host.toLowerCase(),Z=_.isIPV6}else I.host=V.host,Z=!0}if(I.scheme===void 0&&I.userinfo===void 0&&I.host===void 0&&I.port===void 0&&I.query===void 0&&!I.path)I.reference="same-document";else if(I.scheme===void 0)I.reference="relative";else if(I.fragment===void 0)I.reference="absolute";else I.reference="uri";if(f.reference&&f.reference!=="suffix"&&f.reference!==I.reference)I.error=I.error||"URI is not a "+f.reference+" reference.";let g=n[(f.scheme||I.scheme||"").toLowerCase()];if(!f.unicodeSupport&&(!g||!g.unicodeSupport)){if(I.host&&(f.domainHost||g&&g.domainHost)&&Z===!1&&v(I.host))try{I.host=URL.domainToASCII(I.host.toLowerCase())}catch(V){I.error=I.error||"Host's domain name can not be converted to ASCII: "+V}}if(!g||g&&!g.skipNormalize){if(x&&I.scheme!==void 0)I.scheme=unescape(I.scheme);if(x&&I.host!==void 0)I.host=unescape(I.host);if(I.path)I.path=escape(unescape(I.path));if(I.fragment)I.fragment=encodeURI(decodeURIComponent(I.fragment))}if(g&&g.parse)g.parse(I,f)}else I.error=I.error||"URI can not be parsed.";return I}var m={SCHEMES:n,normalize:r,resolve:T,resolveComponents:k,equal:o,serialize:u,parse:t};y.exports=m,y.exports.default=m,y.exports.fastUri=m}),FT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=vT();y.code='require("ajv/dist/runtime/uri").default',E.default=y}),AT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.CodeGen=E.Name=E.nil=E.stringify=E.str=E._=E.KeywordCxt=void 0;var y=G8();Object.defineProperty(E,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var p=u0();Object.defineProperty(E,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(E,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(E,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(E,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(E,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(E,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=JE(),d=W8(),S=Lh(),c=YE(),n=u0(),r=U8(),T=I8(),k=Z0(),o=IT(),u=FT(),i=(b,L)=>new RegExp(b,L);i.code="new RegExp";var v=["removeAdditional","useDefaults","coerceTypes"],F=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),t={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},m={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},a=200;function R(b){var L,B,C,s,P,X,d0,C0,h0,P0,v3,M,j,D,y0,p0,f0,G0,X0,U0,W0,B0,f3,E3,G6;let l3=b.strict,F3=(L=b.code)===null||L===void 0?void 0:L.optimize,W6=F3===!0||F3===void 0?1:F3||0,W4=(C=(B=b.code)===null||B===void 0?void 0:B.regExp)!==null&&C!==void 0?C:i,dT=(s=b.uriResolver)!==null&&s!==void 0?s:u.default;return{strictSchema:(X=(P=b.strictSchema)!==null&&P!==void 0?P:l3)!==null&&X!==void 0?X:!0,strictNumbers:(C0=(d0=b.strictNumbers)!==null&&d0!==void 0?d0:l3)!==null&&C0!==void 0?C0:!0,strictTypes:(P0=(h0=b.strictTypes)!==null&&h0!==void 0?h0:l3)!==null&&P0!==void 0?P0:"log",strictTuples:(M=(v3=b.strictTuples)!==null&&v3!==void 0?v3:l3)!==null&&M!==void 0?M:"log",strictRequired:(D=(j=b.strictRequired)!==null&&j!==void 0?j:l3)!==null&&D!==void 0?D:!1,code:b.code?{...b.code,optimize:W6,regExp:W4}:{optimize:W6,regExp:W4},loopRequired:(y0=b.loopRequired)!==null&&y0!==void 0?y0:a,loopEnum:(p0=b.loopEnum)!==null&&p0!==void 0?p0:a,meta:(f0=b.meta)!==null&&f0!==void 0?f0:!0,messages:(G0=b.messages)!==null&&G0!==void 0?G0:!0,inlineRefs:(X0=b.inlineRefs)!==null&&X0!==void 0?X0:!0,schemaId:(U0=b.schemaId)!==null&&U0!==void 0?U0:"$id",addUsedSchema:(W0=b.addUsedSchema)!==null&&W0!==void 0?W0:!0,validateSchema:(B0=b.validateSchema)!==null&&B0!==void 0?B0:!0,validateFormats:(f3=b.validateFormats)!==null&&f3!==void 0?f3:!0,unicodeRegExp:(E3=b.unicodeRegExp)!==null&&E3!==void 0?E3:!0,int32range:(G6=b.int32range)!==null&&G6!==void 0?G6:!0,uriResolver:dT}}class f{constructor(b={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,b=this.opts={...b,...R(b)};let{es5:L,lines:B}=this.opts.code;this.scope=new n.ValueScope({scope:{},prefixes:F,es5:L,lines:B}),this.logger=N(b.logger);let C=b.validateFormats;if(b.validateFormats=!1,this.RULES=(0,S.getRules)(),I.call(this,t,b,"NOT SUPPORTED"),I.call(this,m,b,"DEPRECATED","warn"),this._metaOpts=V.call(this),b.formats)A.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),b.keywords)g.call(this,b.keywords);if(typeof b.meta=="object")this.addMetaSchema(b.meta);Z.call(this),b.validateFormats=C}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:b,meta:L,schemaId:B}=this.opts,C=o;if(B==="id")C={...o},C.id=C.$id,delete C.$id;if(L&&b)this.addMetaSchema(C,C[B],!1)}defaultMeta(){let{meta:b,schemaId:L}=this.opts;return this.opts.defaultMeta=typeof b=="object"?b[L]||b:void 0}validate(b,L){let B;if(typeof b=="string"){if(B=this.getSchema(b),!B)throw Error(`no schema with key or ref "${b}"`)}else B=this.compile(b);let C=B(L);if(!("$async"in B))this.errors=B.errors;return C}compile(b,L){let B=this._addSchema(b,L);return B.validate||this._compileSchemaEnv(B)}compileAsync(b,L){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:B}=this.opts;return C.call(this,b,L);async function C(h0,P0){await s.call(this,h0.$schema);let v3=this._addSchema(h0,P0);return v3.validate||P.call(this,v3)}async function s(h0){if(h0&&!this.getSchema(h0))await C.call(this,{$ref:h0},!0)}async function P(h0){try{return this._compileSchemaEnv(h0)}catch(P0){if(!(P0 instanceof d.default))throw P0;return X.call(this,P0),await d0.call(this,P0.missingSchema),P.call(this,h0)}}function X({missingSchema:h0,missingRef:P0}){if(this.refs[h0])throw Error(`AnySchema ${h0} is loaded but ${P0} cannot be resolved`)}async function d0(h0){let P0=await C0.call(this,h0);if(!this.refs[h0])await s.call(this,P0.$schema);if(!this.refs[h0])this.addSchema(P0,h0,L)}async function C0(h0){let P0=this._loading[h0];if(P0)return P0;try{return await(this._loading[h0]=B(h0))}finally{delete this._loading[h0]}}}addSchema(b,L,B,C=this.opts.validateSchema){if(Array.isArray(b)){for(let P of b)this.addSchema(P,void 0,B,C);return this}let s;if(typeof b==="object"){let{schemaId:P}=this.opts;if(s=b[P],s!==void 0&&typeof s!="string")throw Error(`schema ${P} must be string`)}return L=(0,r.normalizeId)(L||s),this._checkUnique(L),this.schemas[L]=this._addSchema(b,B,L,C,!0),this}addMetaSchema(b,L,B=this.opts.validateSchema){return this.addSchema(b,L,!0,B),this}validateSchema(b,L){if(typeof b=="boolean")return!0;let B;if(B=b.$schema,B!==void 0&&typeof B!="string")throw Error("$schema must be a string");if(B=B||this.opts.defaultMeta||this.defaultMeta(),!B)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let C=this.validate(B,b);if(!C&&L){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return C}getSchema(b){let L;while(typeof(L=x.call(this,b))=="string")b=L;if(L===void 0){let{schemaId:B}=this.opts,C=new c.SchemaEnv({schema:{},schemaId:B});if(L=c.resolveSchema.call(this,C,b),!L)return;this.refs[b]=L}return L.validate||this._compileSchemaEnv(L)}removeSchema(b){if(b instanceof RegExp)return this._removeAllSchemas(this.schemas,b),this._removeAllSchemas(this.refs,b),this;switch(typeof b){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let L=x.call(this,b);if(typeof L=="object")this._cache.delete(L.schema);return delete this.schemas[b],delete this.refs[b],this}case"object":{let L=b;this._cache.delete(L);let B=b[this.opts.schemaId];if(B)B=(0,r.normalizeId)(B),delete this.schemas[B],delete this.refs[B];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(b){for(let L of b)this.addKeyword(L);return this}addKeyword(b,L){let B;if(typeof b=="string"){if(B=b,typeof L=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),L.keyword=B}else if(typeof b=="object"&&L===void 0){if(L=b,B=L.keyword,Array.isArray(B)&&!B.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(z.call(this,B,L),!L)return(0,k.eachItem)(B,(s)=>K.call(this,s)),this;H0.call(this,L);let C={...L,type:(0,T.getJSONTypes)(L.type),schemaType:(0,T.getJSONTypes)(L.schemaType)};return(0,k.eachItem)(B,C.type.length===0?(s)=>K.call(this,s,C):(s)=>C.type.forEach((P)=>K.call(this,s,C,P))),this}getKeyword(b){let L=this.RULES.all[b];return typeof L=="object"?L.definition:!!L}removeKeyword(b){let{RULES:L}=this;delete L.keywords[b],delete L.all[b];for(let B of L.rules){let C=B.rules.findIndex((s)=>s.keyword===b);if(C>=0)B.rules.splice(C,1)}return this}addFormat(b,L){if(typeof L=="string")L=new RegExp(L);return this.formats[b]=L,this}errorsText(b=this.errors,{separator:L=", ",dataVar:B="data"}={}){if(!b||b.length===0)return"No errors";return b.map((C)=>`${B}${C.instancePath} ${C.message}`).reduce((C,s)=>C+L+s)}$dataMetaSchema(b,L){let B=this.RULES.all;b=JSON.parse(JSON.stringify(b));for(let C of L){let s=C.split("/").slice(1),P=b;for(let X of s)P=P[X];for(let X in B){let d0=B[X];if(typeof d0!="object")continue;let{$data:C0}=d0.definition,h0=P[X];if(C0&&h0)P[X]=o0(h0)}}return b}_removeAllSchemas(b,L){for(let B in b){let C=b[B];if(!L||L.test(B)){if(typeof C=="string")delete b[B];else if(C&&!C.meta)this._cache.delete(C.schema),delete b[B]}}}_addSchema(b,L,B,C=this.opts.validateSchema,s=this.opts.addUsedSchema){let P,{schemaId:X}=this.opts;if(typeof b=="object")P=b[X];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof b!="boolean")throw Error("schema must be object or boolean");let d0=this._cache.get(b);if(d0!==void 0)return d0;B=(0,r.normalizeId)(P||B);let C0=r.getSchemaRefs.call(this,b,B);if(d0=new c.SchemaEnv({schema:b,schemaId:X,meta:L,baseId:B,localRefs:C0}),this._cache.set(d0.schema,d0),s&&!B.startsWith("#")){if(B)this._checkUnique(B);this.refs[B]=d0}if(C)this.validateSchema(b,!0);return d0}_checkUnique(b){if(this.schemas[b]||this.refs[b])throw Error(`schema with key or id "${b}" already exists`)}_compileSchemaEnv(b){if(b.meta)this._compileMetaSchema(b);else c.compileSchema.call(this,b);if(!b.validate)throw Error("ajv implementation error");return b.validate}_compileMetaSchema(b){let L=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,b)}finally{this.opts=L}}}f.ValidationError=h.default,f.MissingRefError=d.default,E.default=f;function I(b,L,B,C="error"){for(let s in b){let P=s;if(P in L)this.logger[C](`${B}: option ${s}. ${b[P]}`)}}function x(b){return b=(0,r.normalizeId)(b),this.schemas[b]||this.refs[b]}function Z(){let b=this.opts.schemas;if(!b)return;if(Array.isArray(b))this.addSchema(b);else for(let L in b)this.addSchema(b[L],L)}function A(){for(let b in this.opts.formats){let L=this.opts.formats[b];if(L)this.addFormat(b,L)}}function g(b){if(Array.isArray(b)){this.addVocabulary(b);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let L in b){let B=b[L];if(!B.keyword)B.keyword=L;this.addKeyword(B)}}function V(){let b={...this.opts};for(let L of v)delete b[L];return b}var _={log(){},warn(){},error(){}};function N(b){if(b===!1)return _;if(b===void 0)return console;if(b.log&&b.warn&&b.error)return b;throw Error("logger must implement log, warn and error methods")}var O=/^[a-z_$][a-z0-9_$:-]*$/i;function z(b,L){let{RULES:B}=this;if((0,k.eachItem)(b,(C)=>{if(B.keywords[C])throw Error(`Keyword ${C} is already defined`);if(!O.test(C))throw Error(`Keyword ${C} has invalid name`)}),!L)return;if(L.$data&&!(("code"in L)||("validate"in L)))throw Error('$data keyword must have "code" or "validate" function')}function K(b,L,B){var C;let s=L===null||L===void 0?void 0:L.post;if(B&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:P}=this,X=s?P.post:P.rules.find(({type:C0})=>C0===B);if(!X)X={type:B,rules:[]},P.rules.push(X);if(P.keywords[b]=!0,!L)return;let d0={keyword:b,definition:{...L,type:(0,T.getJSONTypes)(L.type),schemaType:(0,T.getJSONTypes)(L.schemaType)}};if(L.before)l0.call(this,X,d0,L.before);else X.rules.push(d0);P.all[b]=d0,(C=L.implements)===null||C===void 0||C.forEach((C0)=>this.addKeyword(C0))}function l0(b,L,B){let C=b.rules.findIndex((s)=>s.keyword===B);if(C>=0)b.rules.splice(C,0,L);else b.rules.push(L),this.logger.warn(`rule ${B} is not defined`)}function H0(b){let{metaSchema:L}=b;if(L===void 0)return;if(b.$data&&this.opts.$data)L=o0(L);b.validateSchema=this.compile(L,!0)}var O0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function o0(b){return{anyOf:[b,O0]}}}),MT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};E.default=y}),sT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.callRef=E.getValidate=void 0;var y=W8(),p=e3(),h=u0(),d=$3(),S=YE(),c=Z0(),n={keyword:"$ref",schemaType:"string",code(k){let{gen:o,schema:u,it:i}=k,{baseId:v,schemaEnv:F,validateName:t,opts:m,self:a}=i,{root:R}=F;if((u==="#"||u==="#/")&&v===R.baseId)return I();let f=S.resolveRef.call(a,R,v,u);if(f===void 0)throw new y.default(i.opts.uriResolver,v,u);if(f instanceof S.SchemaEnv)return x(f);return Z(f);function I(){if(F===R)return T(k,t,F,F.$async);let A=o.scopeValue("root",{ref:R});return T(k,h._`${A}.validate`,R,R.$async)}function x(A){let g=r(k,A);T(k,g,A,A.$async)}function Z(A){let g=o.scopeValue("schema",m.code.source===!0?{ref:A,code:(0,h.stringify)(A)}:{ref:A}),V=o.name("valid"),_=k.subschema({schema:A,dataTypes:[],schemaPath:h.nil,topSchemaRef:g,errSchemaPath:u},V);k.mergeEvaluated(_),k.ok(V)}}};function r(k,o){let{gen:u}=k;return o.validate?u.scopeValue("validate",{ref:o.validate}):h._`${u.scopeValue("wrapper",{ref:o})}.validate`}E.getValidate=r;function T(k,o,u,i){let{gen:v,it:F}=k,{allErrors:t,schemaEnv:m,opts:a}=F,R=a.passContext?d.default.this:h.nil;if(i)f();else I();function f(){if(!m.$async)throw Error("async schema referenced by sync schema");let A=v.let("valid");v.try(()=>{if(v.code(h._`await ${(0,p.callValidateCode)(k,o,R)}`),Z(o),!t)v.assign(A,!0)},(g)=>{if(v.if(h._`!(${g} instanceof ${F.ValidationError})`,()=>v.throw(g)),x(g),!t)v.assign(A,!1)}),k.ok(A)}function I(){k.result((0,p.callValidateCode)(k,o,R),()=>Z(o),()=>x(o))}function x(A){let g=h._`${A}.errors`;v.assign(d.default.vErrors,h._`${d.default.vErrors} === null ? ${g} : ${d.default.vErrors}.concat(${g})`),v.assign(d.default.errors,h._`${d.default.vErrors}.length`)}function Z(A){var g;if(!F.opts.unevaluated)return;let V=(g=u===null||u===void 0?void 0:u.validate)===null||g===void 0?void 0:g.evaluated;if(F.props!==!0)if(V&&!V.dynamicProps){if(V.props!==void 0)F.props=c.mergeEvaluated.props(v,V.props,F.props)}else{let _=v.var("props",h._`${A}.evaluated.props`);F.props=c.mergeEvaluated.props(v,_,F.props,h.Name)}if(F.items!==!0)if(V&&!V.dynamicItems){if(V.items!==void 0)F.items=c.mergeEvaluated.items(v,V.items,F.items)}else{let _=v.var("items",h._`${A}.evaluated.items`);F.items=c.mergeEvaluated.items(v,_,F.items,h.Name)}}}E.callRef=T,E.default=n}),bT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=MT(),p=sT(),h=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",y.default,p.default];E.default=h}),eT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=y.operators,h={maximum:{okStr:"<=",ok:p.LTE,fail:p.GT},minimum:{okStr:">=",ok:p.GTE,fail:p.LT},exclusiveMaximum:{okStr:"<",ok:p.LT,fail:p.GTE},exclusiveMinimum:{okStr:">",ok:p.GT,fail:p.LTE}},d={message:({keyword:c,schemaCode:n})=>y.str`must be ${h[c].okStr} ${n}`,params:({keyword:c,schemaCode:n})=>y._`{comparison: ${h[c].okStr}, limit: ${n}}`},S={keyword:Object.keys(h),type:"number",schemaType:"number",$data:!0,error:d,code(c){let{keyword:n,data:r,schemaCode:T}=c;c.fail$data(y._`${r} ${h[n].fail} ${T} || isNaN(${r})`)}};E.default=S}),gT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p={message:({schemaCode:d})=>y.str`must be multiple of ${d}`,params:({schemaCode:d})=>y._`{multipleOf: ${d}}`},h={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:p,code(d){let{gen:S,data:c,schemaCode:n,it:r}=d,T=r.opts.multipleOfPrecision,k=S.let("res"),o=T?y._`Math.abs(Math.round(${k}) - ${k}) > 1e-${T}`:y._`${k} !== parseInt(${k})`;d.fail$data(y._`(${n} === 0 || (${k} = ${c}/${n}, ${o}))`)}};E.default=h}),lT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});function y(p){let h=p.length,d=0,S=0,c;while(S<h)if(d++,c=p.charCodeAt(S++),c>=55296&&c<=56319&&S<h){if(c=p.charCodeAt(S),(c&64512)===56320)S++}return d}E.default=y,y.code='require("ajv/dist/runtime/ucs2length").default'}),PT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Z0(),h=lT(),d={message({keyword:c,schemaCode:n}){let r=c==="maxLength"?"more":"fewer";return y.str`must NOT have ${r} than ${n} characters`},params:({schemaCode:c})=>y._`{limit: ${c}}`},S={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:d,code(c){let{keyword:n,data:r,schemaCode:T,it:k}=c,o=n==="maxLength"?y.operators.GT:y.operators.LT,u=k.opts.unicode===!1?y._`${r}.length`:y._`${(0,p.useFunc)(c.gen,h.default)}(${r})`;c.fail$data(y._`${u} ${o} ${T}`)}};E.default=S}),LT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=e3(),p=Z0(),h=u0(),d={message:({schemaCode:c})=>h.str`must match pattern "${c}"`,params:({schemaCode:c})=>h._`{pattern: ${c}}`},S={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:d,code(c){let{gen:n,data:r,$data:T,schema:k,schemaCode:o,it:u}=c,i=u.opts.unicodeRegExp?"u":"";if(T){let{regExp:v}=u.opts.code,F=v.code==="new RegExp"?h._`new RegExp`:(0,p.useFunc)(n,v),t=n.let("valid");n.try(()=>n.assign(t,h._`${F}(${o}, ${i}).test(${r})`),()=>n.assign(t,!1)),c.fail$data(h._`!${t}`)}else{let v=(0,y.usePattern)(c,k);c.fail$data(h._`!${v}.test(${r})`)}}};E.default=S}),jT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p={message({keyword:d,schemaCode:S}){let c=d==="maxProperties"?"more":"fewer";return y.str`must NOT have ${c} than ${S} properties`},params:({schemaCode:d})=>y._`{limit: ${d}}`},h={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:p,code(d){let{keyword:S,data:c,schemaCode:n}=d,r=S==="maxProperties"?y.operators.GT:y.operators.LT;d.fail$data(y._`Object.keys(${c}).length ${r} ${n}`)}};E.default=h}),qT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=e3(),p=u0(),h=Z0(),d={message:({params:{missingProperty:c}})=>p.str`must have required property '${c}'`,params:({params:{missingProperty:c}})=>p._`{missingProperty: ${c}}`},S={keyword:"required",type:"object",schemaType:"array",$data:!0,error:d,code(c){let{gen:n,schema:r,schemaCode:T,data:k,$data:o,it:u}=c,{opts:i}=u;if(!o&&r.length===0)return;let v=r.length>=i.loopRequired;if(u.allErrors)F();else t();if(i.strictRequired){let R=c.parentSchema.properties,{definedProperties:f}=c.it;for(let I of r)if((R===null||R===void 0?void 0:R[I])===void 0&&!f.has(I)){let x=u.schemaEnv.baseId+u.errSchemaPath,Z=`required property "${I}" is not defined at "${x}" (strictRequired)`;(0,h.checkStrictMode)(u,Z,u.opts.strictRequired)}}function F(){if(v||o)c.block$data(p.nil,m);else for(let R of r)(0,y.checkReportMissingProp)(c,R)}function t(){let R=n.let("missing");if(v||o){let f=n.let("valid",!0);c.block$data(f,()=>a(R,f)),c.ok(f)}else n.if((0,y.checkMissingProp)(c,r,R)),(0,y.reportMissingProp)(c,R),n.else()}function m(){n.forOf("prop",T,(R)=>{c.setParams({missingProperty:R}),n.if((0,y.noPropertyInData)(n,k,R,i.ownProperties),()=>c.error())})}function a(R,f){c.setParams({missingProperty:R}),n.forOf(R,T,()=>{n.assign(f,(0,y.propertyInData)(n,k,R,i.ownProperties)),n.if((0,p.not)(f),()=>{c.error(),n.break()})},p.nil)}}};E.default=S}),_T=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p={message({keyword:d,schemaCode:S}){let c=d==="maxItems"?"more":"fewer";return y.str`must NOT have ${c} than ${S} items`},params:({schemaCode:d})=>y._`{limit: ${d}}`},h={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:p,code(d){let{keyword:S,data:c,schemaCode:n}=d,r=S==="maxItems"?y.operators.GT:y.operators.LT;d.fail$data(y._`${c}.length ${r} ${n}`)}};E.default=h}),XE=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=qh();y.code='require("ajv/dist/runtime/equal").default',E.default=y}),DT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=I8(),p=u0(),h=Z0(),d=XE(),S={message:({params:{i:n,j:r}})=>p.str`must NOT have duplicate items (items ## ${r} and ${n} are identical)`,params:({params:{i:n,j:r}})=>p._`{i: ${n}, j: ${r}}`},c={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:S,code(n){let{gen:r,data:T,$data:k,schema:o,parentSchema:u,schemaCode:i,it:v}=n;if(!k&&!o)return;let F=r.let("valid"),t=u.items?(0,y.getSchemaTypes)(u.items):[];n.block$data(F,m,p._`${i} === false`),n.ok(F);function m(){let I=r.let("i",p._`${T}.length`),x=r.let("j");n.setParams({i:I,j:x}),r.assign(F,!0),r.if(p._`${I} > 1`,()=>(a()?R:f)(I,x))}function a(){return t.length>0&&!t.some((I)=>I==="object"||I==="array")}function R(I,x){let Z=r.name("item"),A=(0,y.checkDataTypes)(t,Z,v.opts.strictNumbers,y.DataType.Wrong),g=r.const("indices",p._`{}`);r.for(p._`;${I}--;`,()=>{if(r.let(Z,p._`${T}[${I}]`),r.if(A,p._`continue`),t.length>1)r.if(p._`typeof ${Z} == "string"`,p._`${Z} += "_"`);r.if(p._`typeof ${g}[${Z}] == "number"`,()=>{r.assign(x,p._`${g}[${Z}]`),n.error(),r.assign(F,!1).break()}).code(p._`${g}[${Z}] = ${I}`)})}function f(I,x){let Z=(0,h.useFunc)(r,d.default),A=r.name("outer");r.label(A).for(p._`;${I}--;`,()=>r.for(p._`${x} = ${I}; ${x}--;`,()=>r.if(p._`${Z}(${T}[${I}], ${T}[${x}])`,()=>{n.error(),r.assign(F,!1).break(A)})))}}};E.default=c}),VT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Z0(),h=XE(),d={message:"must be equal to constant",params:({schemaCode:c})=>y._`{allowedValue: ${c}}`},S={keyword:"const",$data:!0,error:d,code(c){let{gen:n,data:r,$data:T,schemaCode:k,schema:o}=c;if(T||o&&typeof o=="object")c.fail$data(y._`!${(0,p.useFunc)(n,h.default)}(${r}, ${k})`);else c.fail(y._`${o} !== ${r}`)}};E.default=S}),BT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Z0(),h=XE(),d={message:"must be equal to one of the allowed values",params:({schemaCode:c})=>y._`{allowedValues: ${c}}`},S={keyword:"enum",schemaType:"array",$data:!0,error:d,code(c){let{gen:n,data:r,$data:T,schema:k,schemaCode:o,it:u}=c;if(!T&&k.length===0)throw Error("enum must have non-empty array");let i=k.length>=u.opts.loopEnum,v,F=()=>v!==null&&v!==void 0?v:v=(0,p.useFunc)(n,h.default),t;if(i||T)t=n.let("valid"),c.block$data(t,m);else{if(!Array.isArray(k))throw Error("ajv implementation error");let R=n.const("vSchema",o);t=(0,y.or)(...k.map((f,I)=>a(R,I)))}c.pass(t);function m(){n.assign(t,!1),n.forOf("v",o,(R)=>n.if(y._`${F()}(${r}, ${R})`,()=>n.assign(t,!0).break()))}function a(R,f){let I=k[f];return typeof I==="object"&&I!==null?y._`${F()}(${r}, ${R}[${f}])`:y._`${r} === ${I}`}}};E.default=S}),NT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=eT(),p=gT(),h=PT(),d=LT(),S=jT(),c=qT(),n=_T(),r=DT(),T=VT(),k=BT(),o=[y.default,p.default,h.default,d.default,S.default,c.default,n.default,r.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},T.default,k.default];E.default=o}),_h=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.validateAdditionalItems=void 0;var y=u0(),p=Z0(),h={message:({params:{len:c}})=>y.str`must NOT have more than ${c} items`,params:({params:{len:c}})=>y._`{limit: ${c}}`},d={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:h,code(c){let{parentSchema:n,it:r}=c,{items:T}=n;if(!Array.isArray(T)){(0,p.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}S(c,T)}};function S(c,n){let{gen:r,schema:T,data:k,keyword:o,it:u}=c;u.items=!0;let i=r.const("len",y._`${k}.length`);if(T===!1)c.setParams({len:n.length}),c.pass(y._`${i} <= ${n.length}`);else if(typeof T=="object"&&!(0,p.alwaysValidSchema)(u,T)){let F=r.var("valid",y._`${i} <= ${n.length}`);r.if((0,y.not)(F),()=>v(F)),c.ok(F)}function v(F){r.forRange("i",n.length,i,(t)=>{if(c.subschema({keyword:o,dataProp:t,dataPropType:p.Type.Num},F),!u.allErrors)r.if((0,y.not)(F),()=>r.break())})}}E.validateAdditionalItems=S,E.default=d}),Dh=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.validateTuple=void 0;var y=u0(),p=Z0(),h=e3(),d={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(c){let{schema:n,it:r}=c;if(Array.isArray(n))return S(c,"additionalItems",n);if(r.items=!0,(0,p.alwaysValidSchema)(r,n))return;c.ok((0,h.validateArray)(c))}};function S(c,n,r=c.schema){let{gen:T,parentSchema:k,data:o,keyword:u,it:i}=c;if(t(k),i.opts.unevaluated&&r.length&&i.items!==!0)i.items=p.mergeEvaluated.items(T,r.length,i.items);let v=T.name("valid"),F=T.const("len",y._`${o}.length`);r.forEach((m,a)=>{if((0,p.alwaysValidSchema)(i,m))return;T.if(y._`${F} > ${a}`,()=>c.subschema({keyword:u,schemaProp:a,dataProp:a},v)),c.ok(v)});function t(m){let{opts:a,errSchemaPath:R}=i,f=r.length,I=f===m.minItems&&(f===m.maxItems||m[n]===!1);if(a.strictTuples&&!I){let x=`"${u}" is ${f}-tuple, but minItems or maxItems/${n} are not specified or different at path "${R}"`;(0,p.checkStrictMode)(i,x,a.strictTuples)}}}E.validateTuple=S,E.default=d}),wT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=Dh(),p={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(h)=>(0,y.validateTuple)(h,"items")};E.default=p}),KT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Z0(),h=e3(),d=_h(),S={message:({params:{len:n}})=>y.str`must NOT have more than ${n} items`,params:({params:{len:n}})=>y._`{limit: ${n}}`},c={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:S,code(n){let{schema:r,parentSchema:T,it:k}=n,{prefixItems:o}=T;if(k.items=!0,(0,p.alwaysValidSchema)(k,r))return;if(o)(0,d.validateAdditionalItems)(n,o);else n.ok((0,h.validateArray)(n))}};E.default=c}),HT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Z0(),h={message:({params:{min:S,max:c}})=>c===void 0?y.str`must contain at least ${S} valid item(s)`:y.str`must contain at least ${S} and no more than ${c} valid item(s)`,params:({params:{min:S,max:c}})=>c===void 0?y._`{minContains: ${S}}`:y._`{minContains: ${S}, maxContains: ${c}}`},d={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:h,code(S){let{gen:c,schema:n,parentSchema:r,data:T,it:k}=S,o,u,{minContains:i,maxContains:v}=r;if(k.opts.next)o=i===void 0?1:i,u=v;else o=1;let F=c.const("len",y._`${T}.length`);if(S.setParams({min:o,max:u}),u===void 0&&o===0){(0,p.checkStrictMode)(k,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&o>u){(0,p.checkStrictMode)(k,'"minContains" > "maxContains" is always invalid'),S.fail();return}if((0,p.alwaysValidSchema)(k,n)){let f=y._`${F} >= ${o}`;if(u!==void 0)f=y._`${f} && ${F} <= ${u}`;S.pass(f);return}k.items=!0;let t=c.name("valid");if(u===void 0&&o===1)a(t,()=>c.if(t,()=>c.break()));else if(o===0){if(c.let(t,!0),u!==void 0)c.if(y._`${T}.length > 0`,m)}else c.let(t,!1),m();S.result(t,()=>S.reset());function m(){let f=c.name("_valid"),I=c.let("count",0);a(f,()=>c.if(f,()=>R(I)))}function a(f,I){c.forRange("i",0,F,(x)=>{S.subschema({keyword:"contains",dataProp:x,dataPropType:p.Type.Num,compositeRule:!0},f),I()})}function R(f){if(c.code(y._`${f}++`),u===void 0)c.if(y._`${f} >= ${o}`,()=>c.assign(t,!0).break());else if(c.if(y._`${f} > ${u}`,()=>c.assign(t,!1).break()),o===1)c.assign(t,!0);else c.if(y._`${f} >= ${o}`,()=>c.assign(t,!0))}}};E.default=d}),OT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.validateSchemaDeps=E.validatePropertyDeps=E.error=void 0;var y=u0(),p=Z0(),h=e3();E.error={message:({params:{property:r,depsCount:T,deps:k}})=>{let o=T===1?"property":"properties";return y.str`must have ${o} ${k} when property ${r} is present`},params:({params:{property:r,depsCount:T,deps:k,missingProperty:o}})=>y._`{property: ${r},
7
- missingProperty: ${o},
8
- depsCount: ${T},
9
- deps: ${k}}`};var d={keyword:"dependencies",type:"object",schemaType:"object",error:E.error,code(r){let[T,k]=S(r);c(r,T),n(r,k)}};function S({schema:r}){let T={},k={};for(let o in r){if(o==="__proto__")continue;let u=Array.isArray(r[o])?T:k;u[o]=r[o]}return[T,k]}function c(r,T=r.schema){let{gen:k,data:o,it:u}=r;if(Object.keys(T).length===0)return;let i=k.let("missing");for(let v in T){let F=T[v];if(F.length===0)continue;let t=(0,h.propertyInData)(k,o,v,u.opts.ownProperties);if(r.setParams({property:v,depsCount:F.length,deps:F.join(", ")}),u.allErrors)k.if(t,()=>{for(let m of F)(0,h.checkReportMissingProp)(r,m)});else k.if(y._`${t} && (${(0,h.checkMissingProp)(r,F,i)})`),(0,h.reportMissingProp)(r,i),k.else()}}E.validatePropertyDeps=c;function n(r,T=r.schema){let{gen:k,data:o,keyword:u,it:i}=r,v=k.name("valid");for(let F in T){if((0,p.alwaysValidSchema)(i,T[F]))continue;k.if((0,h.propertyInData)(k,o,F,i.opts.ownProperties),()=>{let t=r.subschema({keyword:u,schemaProp:F},v);r.mergeValidEvaluated(t,v)},()=>k.var(v,!0)),r.ok(v)}}E.validateSchemaDeps=n,E.default=d}),UT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Z0(),h={message:"property name must be valid",params:({params:S})=>y._`{propertyName: ${S.propertyName}}`},d={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:h,code(S){let{gen:c,schema:n,data:r,it:T}=S;if((0,p.alwaysValidSchema)(T,n))return;let k=c.name("valid");c.forIn("key",r,(o)=>{S.setParams({propertyName:o}),S.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},k),c.if((0,y.not)(k),()=>{if(S.error(!0),!T.allErrors)c.break()})}),S.ok(k)}};E.default=d}),Vh=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=e3(),p=u0(),h=$3(),d=Z0(),S={message:"must NOT have additional properties",params:({params:n})=>p._`{additionalProperty: ${n.additionalProperty}}`},c={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:S,code(n){let{gen:r,schema:T,parentSchema:k,data:o,errsCount:u,it:i}=n;if(!u)throw Error("ajv implementation error");let{allErrors:v,opts:F}=i;if(i.props=!0,F.removeAdditional!=="all"&&(0,d.alwaysValidSchema)(i,T))return;let t=(0,y.allSchemaProperties)(k.properties),m=(0,y.allSchemaProperties)(k.patternProperties);a(),n.ok(p._`${u} === ${h.default.errors}`);function a(){r.forIn("key",o,(Z)=>{if(!t.length&&!m.length)I(Z);else r.if(R(Z),()=>I(Z))})}function R(Z){let A;if(t.length>8){let g=(0,d.schemaRefOrVal)(i,k.properties,"properties");A=(0,y.isOwnProperty)(r,g,Z)}else if(t.length)A=(0,p.or)(...t.map((g)=>p._`${Z} === ${g}`));else A=p.nil;if(m.length)A=(0,p.or)(A,...m.map((g)=>p._`${(0,y.usePattern)(n,g)}.test(${Z})`));return(0,p.not)(A)}function f(Z){r.code(p._`delete ${o}[${Z}]`)}function I(Z){if(F.removeAdditional==="all"||F.removeAdditional&&T===!1){f(Z);return}if(T===!1){if(n.setParams({additionalProperty:Z}),n.error(),!v)r.break();return}if(typeof T=="object"&&!(0,d.alwaysValidSchema)(i,T)){let A=r.name("valid");if(F.removeAdditional==="failing")x(Z,A,!1),r.if((0,p.not)(A),()=>{n.reset(),f(Z)});else if(x(Z,A),!v)r.if((0,p.not)(A),()=>r.break())}}function x(Z,A,g){let V={keyword:"additionalProperties",dataProp:Z,dataPropType:d.Type.Str};if(g===!1)Object.assign(V,{compositeRule:!0,createErrors:!1,allErrors:!1});n.subschema(V,A)}}};E.default=c}),GT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=G8(),p=e3(),h=Z0(),d=Vh(),S={keyword:"properties",type:"object",schemaType:"object",code(c){let{gen:n,schema:r,parentSchema:T,data:k,it:o}=c;if(o.opts.removeAdditional==="all"&&T.additionalProperties===void 0)d.default.code(new y.KeywordCxt(o,d.default,"additionalProperties"));let u=(0,p.allSchemaProperties)(r);for(let m of u)o.definedProperties.add(m);if(o.opts.unevaluated&&u.length&&o.props!==!0)o.props=h.mergeEvaluated.props(n,(0,h.toHash)(u),o.props);let i=u.filter((m)=>!(0,h.alwaysValidSchema)(o,r[m]));if(i.length===0)return;let v=n.name("valid");for(let m of i){if(F(m))t(m);else{if(n.if((0,p.propertyInData)(n,k,m,o.opts.ownProperties)),t(m),!o.allErrors)n.else().var(v,!0);n.endIf()}c.it.definedProperties.add(m),c.ok(v)}function F(m){return o.opts.useDefaults&&!o.compositeRule&&r[m].default!==void 0}function t(m){c.subschema({keyword:"properties",schemaProp:m,dataProp:m},v)}}};E.default=S}),WT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=e3(),p=u0(),h=Z0(),d=Z0(),S={keyword:"patternProperties",type:"object",schemaType:"object",code(c){let{gen:n,schema:r,data:T,parentSchema:k,it:o}=c,{opts:u}=o,i=(0,y.allSchemaProperties)(r),v=i.filter((I)=>(0,h.alwaysValidSchema)(o,r[I]));if(i.length===0||v.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;let F=u.strictSchema&&!u.allowMatchingProperties&&k.properties,t=n.name("valid");if(o.props!==!0&&!(o.props instanceof p.Name))o.props=(0,d.evaluatedPropsToName)(n,o.props);let{props:m}=o;a();function a(){for(let I of i){if(F)R(I);if(o.allErrors)f(I);else n.var(t,!0),f(I),n.if(t)}}function R(I){for(let x in F)if(new RegExp(I).test(x))(0,h.checkStrictMode)(o,`property ${x} matches pattern ${I} (use allowMatchingProperties)`)}function f(I){n.forIn("key",T,(x)=>{n.if(p._`${(0,y.usePattern)(c,I)}.test(${x})`,()=>{let Z=v.includes(I);if(!Z)c.subschema({keyword:"patternProperties",schemaProp:I,dataProp:x,dataPropType:d.Type.Str},t);if(o.opts.unevaluated&&m!==!0)n.assign(p._`${m}[${x}]`,!0);else if(!Z&&!o.allErrors)n.if((0,p.not)(t),()=>n.break())})})}}};E.default=S}),zT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=Z0(),p={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(h){let{gen:d,schema:S,it:c}=h;if((0,y.alwaysValidSchema)(c,S)){h.fail();return}let n=d.name("valid");h.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),h.failResult(n,()=>h.reset(),()=>h.error())},error:{message:"must NOT be valid"}};E.default=p}),QT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=e3(),p={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:y.validateUnion,error:{message:"must match a schema in anyOf"}};E.default=p}),JT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Z0(),h={message:"must match exactly one schema in oneOf",params:({params:S})=>y._`{passingSchemas: ${S.passing}}`},d={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:h,code(S){let{gen:c,schema:n,parentSchema:r,it:T}=S;if(!Array.isArray(n))throw Error("ajv implementation error");if(T.opts.discriminator&&r.discriminator)return;let k=n,o=c.let("valid",!1),u=c.let("passing",null),i=c.name("_valid");S.setParams({passing:u}),c.block(v),S.result(o,()=>S.reset(),()=>S.error(!0));function v(){k.forEach((F,t)=>{let m;if((0,p.alwaysValidSchema)(T,F))c.var(i,!0);else m=S.subschema({keyword:"oneOf",schemaProp:t,compositeRule:!0},i);if(t>0)c.if(y._`${i} && ${o}`).assign(o,!1).assign(u,y._`[${u}, ${t}]`).else();c.if(i,()=>{if(c.assign(o,!0),c.assign(u,t),m)S.mergeEvaluated(m,y.Name)})})}}};E.default=d}),YT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=Z0(),p={keyword:"allOf",schemaType:"array",code(h){let{gen:d,schema:S,it:c}=h;if(!Array.isArray(S))throw Error("ajv implementation error");let n=d.name("valid");S.forEach((r,T)=>{if((0,y.alwaysValidSchema)(c,r))return;let k=h.subschema({keyword:"allOf",schemaProp:T},n);h.ok(n),h.mergeEvaluated(k)})}};E.default=p}),XT=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Z0(),h={message:({params:c})=>y.str`must match "${c.ifClause}" schema`,params:({params:c})=>y._`{failingKeyword: ${c.ifClause}}`},d={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:h,code(c){let{gen:n,parentSchema:r,it:T}=c;if(r.then===void 0&&r.else===void 0)(0,p.checkStrictMode)(T,'"if" without "then" and "else" is ignored');let k=S(T,"then"),o=S(T,"else");if(!k&&!o)return;let u=n.let("valid",!0),i=n.name("_valid");if(v(),c.reset(),k&&o){let t=n.let("ifClause");c.setParams({ifClause:t}),n.if(i,F("then",t),F("else",t))}else if(k)n.if(i,F("then"));else n.if((0,y.not)(i),F("else"));c.pass(u,()=>c.error(!0));function v(){let t=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);c.mergeEvaluated(t)}function F(t,m){return()=>{let a=c.subschema({keyword:t},i);if(n.assign(u,i),c.mergeValidEvaluated(a,u),m)n.assign(m,y._`${t}`);else c.setParams({ifClause:t})}}}};function S(c,n){let r=c.schema[n];return r!==void 0&&!(0,p.alwaysValidSchema)(c,r)}E.default=d}),$T=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=Z0(),p={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:h,parentSchema:d,it:S}){if(d.if===void 0)(0,y.checkStrictMode)(S,`"${h}" without "if" is ignored`)}};E.default=p}),Em=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=_h(),p=wT(),h=Dh(),d=KT(),S=HT(),c=OT(),n=UT(),r=Vh(),T=GT(),k=WT(),o=zT(),u=QT(),i=JT(),v=YT(),F=XT(),t=$T();function m(a=!1){let R=[o.default,u.default,i.default,v.default,F.default,t.default,n.default,r.default,c.default,T.default,k.default];if(a)R.push(p.default,d.default);else R.push(y.default,h.default);return R.push(S.default),R}E.default=m}),ym=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p={message:({schemaCode:d})=>y.str`must match format "${d}"`,params:({schemaCode:d})=>y._`{format: ${d}}`},h={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:p,code(d,S){let{gen:c,data:n,$data:r,schema:T,schemaCode:k,it:o}=d,{opts:u,errSchemaPath:i,schemaEnv:v,self:F}=o;if(!u.validateFormats)return;if(r)t();else m();function t(){let a=c.scopeValue("formats",{ref:F.formats,code:u.code.formats}),R=c.const("fDef",y._`${a}[${k}]`),f=c.let("fType"),I=c.let("format");c.if(y._`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>c.assign(f,y._`${R}.type || "string"`).assign(I,y._`${R}.validate`),()=>c.assign(f,y._`"string"`).assign(I,R)),d.fail$data((0,y.or)(x(),Z()));function x(){if(u.strictSchema===!1)return y.nil;return y._`${k} && !${I}`}function Z(){let A=v.$async?y._`(${R}.async ? await ${I}(${n}) : ${I}(${n}))`:y._`${I}(${n})`,g=y._`(typeof ${I} == "function" ? ${A} : ${I}.test(${n}))`;return y._`${I} && ${I} !== true && ${f} === ${S} && !${g}`}}function m(){let a=F.formats[T];if(!a){x();return}if(a===!0)return;let[R,f,I]=Z(a);if(R===S)d.pass(A());function x(){if(u.strictSchema===!1){F.logger.warn(g());return}throw Error(g());function g(){return`unknown format "${T}" ignored in schema at path "${i}"`}}function Z(g){let V=g instanceof RegExp?(0,y.regexpCode)(g):u.code.formats?y._`${u.code.formats}${(0,y.getProperty)(T)}`:void 0,_=c.scopeValue("formats",{key:T,ref:g,code:V});if(typeof g=="object"&&!(g instanceof RegExp))return[g.type||"string",g.validate,y._`${_}.validate`];return["string",g,_]}function A(){if(typeof a=="object"&&!(a instanceof RegExp)&&a.async){if(!v.$async)throw Error("async format in sync schema");return y._`await ${I}(${n})`}return typeof f=="function"?y._`${I}(${n})`:y._`${I}.test(${n})`}}}};E.default=h}),dm=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=ym(),p=[y.default];E.default=p}),pm=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.contentVocabulary=E.metadataVocabulary=void 0,E.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],E.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),hm=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=bT(),p=NT(),h=Em(),d=dm(),S=pm(),c=[y.default,p.default,(0,h.default)(),d.default,S.metadataVocabulary,S.contentVocabulary];E.default=c}),Sm=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.DiscrError=void 0;var y;(function(p){p.Tag="tag",p.Mapping="mapping"})(y||(E.DiscrError=y={}))}),cm=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0});var y=u0(),p=Sm(),h=YE(),d=W8(),S=Z0(),c={message:({params:{discrError:r,tagName:T}})=>r===p.DiscrError.Tag?`tag "${T}" must be string`:`value of tag "${T}" must be in oneOf`,params:({params:{discrError:r,tag:T,tagName:k}})=>y._`{error: ${r}, tag: ${k}, tagValue: ${T}}`},n={keyword:"discriminator",type:"object",schemaType:"object",error:c,code(r){let{gen:T,data:k,schema:o,parentSchema:u,it:i}=r,{oneOf:v}=u;if(!i.opts.discriminator)throw Error("discriminator: requires discriminator option");let F=o.propertyName;if(typeof F!="string")throw Error("discriminator: requires propertyName");if(o.mapping)throw Error("discriminator: mapping is not supported");if(!v)throw Error("discriminator: requires oneOf keyword");let t=T.let("valid",!1),m=T.const("tag",y._`${k}${(0,y.getProperty)(F)}`);T.if(y._`typeof ${m} == "string"`,()=>a(),()=>r.error(!1,{discrError:p.DiscrError.Tag,tag:m,tagName:F})),r.ok(t);function a(){let I=f();T.if(!1);for(let x in I)T.elseIf(y._`${m} === ${x}`),T.assign(t,R(I[x]));T.else(),r.error(!1,{discrError:p.DiscrError.Mapping,tag:m,tagName:F}),T.endIf()}function R(I){let x=T.name("valid"),Z=r.subschema({keyword:"oneOf",schemaProp:I},x);return r.mergeEvaluated(Z,y.Name),x}function f(){var I;let x={},Z=g(u),A=!0;for(let N=0;N<v.length;N++){let O=v[N];if((O===null||O===void 0?void 0:O.$ref)&&!(0,S.schemaHasRulesButRef)(O,i.self.RULES)){let K=O.$ref;if(O=h.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,K),O instanceof h.SchemaEnv)O=O.schema;if(O===void 0)throw new d.default(i.opts.uriResolver,i.baseId,K)}let z=(I=O===null||O===void 0?void 0:O.properties)===null||I===void 0?void 0:I[F];if(typeof z!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${F}"`);A=A&&(Z||g(O)),V(z,N)}if(!A)throw Error(`discriminator: "${F}" must be required`);return x;function g({required:N}){return Array.isArray(N)&&N.includes(F)}function V(N,O){if(N.const)_(N.const,O);else if(N.enum)for(let z of N.enum)_(z,O);else throw Error(`discriminator: "properties/${F}" must have "const" or "enum"`)}function _(N,O){if(typeof N!="string"||N in x)throw Error(`discriminator: "${F}" values must be unique strings`);x[N]=O}}}};E.default=n}),nm=W((E,y)=>{y.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Bh=W((E,y)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.MissingRefError=E.ValidationError=E.CodeGen=E.Name=E.nil=E.stringify=E.str=E._=E.KeywordCxt=E.Ajv=void 0;var p=AT(),h=hm(),d=cm(),S=nm(),c=["/properties"],n="http://json-schema.org/draft-07/schema";class r extends p.default{_addVocabularies(){if(super._addVocabularies(),h.default.forEach((i)=>this.addVocabulary(i)),this.opts.discriminator)this.addKeyword(d.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let i=this.opts.$data?this.$dataMetaSchema(S,c):S;this.addMetaSchema(i,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}}E.Ajv=r,y.exports=E=r,y.exports.Ajv=r,Object.defineProperty(E,"__esModule",{value:!0}),E.default=r;var T=G8();Object.defineProperty(E,"KeywordCxt",{enumerable:!0,get:function(){return T.KeywordCxt}});var k=u0();Object.defineProperty(E,"_",{enumerable:!0,get:function(){return k._}}),Object.defineProperty(E,"str",{enumerable:!0,get:function(){return k.str}}),Object.defineProperty(E,"stringify",{enumerable:!0,get:function(){return k.stringify}}),Object.defineProperty(E,"nil",{enumerable:!0,get:function(){return k.nil}}),Object.defineProperty(E,"Name",{enumerable:!0,get:function(){return k.Name}}),Object.defineProperty(E,"CodeGen",{enumerable:!0,get:function(){return k.CodeGen}});var o=JE();Object.defineProperty(E,"ValidationError",{enumerable:!0,get:function(){return o.default}});var u=W8();Object.defineProperty(E,"MissingRefError",{enumerable:!0,get:function(){return u.default}})}),rm=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.formatNames=E.fastFormats=E.fullFormats=void 0;function y(_,N){return{validate:_,compare:N}}E.fullFormats={date:y(S,c),time:y(r(!0),T),"date-time":y(u(!0),i),"iso-time":y(r(),k),"iso-date-time":y(u(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:V,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:R,int32:{type:"number",validate:x},int64:{type:"number",validate:Z},float:{type:"number",validate:A},double:{type:"number",validate:A},password:!0,binary:!0},E.fastFormats={...E.fullFormats,date:y(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,c),time:y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,T),"date-time":y(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,i),"iso-time":y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,k),"iso-date-time":y(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},E.formatNames=Object.keys(E.fullFormats);function p(_){return _%4===0&&(_%100!==0||_%400===0)}var h=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,d=[0,31,28,31,30,31,30,31,31,30,31,30,31];function S(_){let N=h.exec(_);if(!N)return!1;let O=+N[1],z=+N[2],K=+N[3];return z>=1&&z<=12&&K>=1&&K<=(z===2&&p(O)?29:d[z])}function c(_,N){if(!(_&&N))return;if(_>N)return 1;if(_<N)return-1;return 0}var n=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function r(_){return function(N){let O=n.exec(N);if(!O)return!1;let z=+O[1],K=+O[2],l0=+O[3],H0=O[4],O0=O[5]==="-"?-1:1,o0=+(O[6]||0),b=+(O[7]||0);if(o0>23||b>59||_&&!H0)return!1;if(z<=23&&K<=59&&l0<60)return!0;let L=K-b*O0,B=z-o0*O0-(L<0?1:0);return(B===23||B===-1)&&(L===59||L===-1)&&l0<61}}function T(_,N){if(!(_&&N))return;let O=new Date("2020-01-01T"+_).valueOf(),z=new Date("2020-01-01T"+N).valueOf();if(!(O&&z))return;return O-z}function k(_,N){if(!(_&&N))return;let O=n.exec(_),z=n.exec(N);if(!(O&&z))return;if(_=O[1]+O[2]+O[3],N=z[1]+z[2]+z[3],_>N)return 1;if(_<N)return-1;return 0}var o=/t|\s/i;function u(_){let N=r(_);return function(O){let z=O.split(o);return z.length===2&&S(z[0])&&N(z[1])}}function i(_,N){if(!(_&&N))return;let O=new Date(_).valueOf(),z=new Date(N).valueOf();if(!(O&&z))return;return O-z}function v(_,N){if(!(_&&N))return;let[O,z]=_.split(o),[K,l0]=N.split(o),H0=c(O,K);if(H0===void 0)return;return H0||T(z,l0)}var F=/\/|:/,t=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function m(_){return F.test(_)&&t.test(_)}var a=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function R(_){return a.lastIndex=0,a.test(_)}var f=-2147483648,I=2147483647;function x(_){return Number.isInteger(_)&&_<=I&&_>=f}function Z(_){return Number.isInteger(_)}function A(){return!0}var g=/[^\\]\\Z/;function V(_){if(g.test(_))return!1;try{return new RegExp(_),!0}catch(N){return!1}}}),Tm=W((E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.formatLimitDefinition=void 0;var y=Bh(),p=u0(),h=p.operators,d={formatMaximum:{okStr:"<=",ok:h.LTE,fail:h.GT},formatMinimum:{okStr:">=",ok:h.GTE,fail:h.LT},formatExclusiveMaximum:{okStr:"<",ok:h.LT,fail:h.GTE},formatExclusiveMinimum:{okStr:">",ok:h.GT,fail:h.LTE}},S={message:({keyword:n,schemaCode:r})=>p.str`should be ${d[n].okStr} ${r}`,params:({keyword:n,schemaCode:r})=>p._`{comparison: ${d[n].okStr}, limit: ${r}}`};E.formatLimitDefinition={keyword:Object.keys(d),type:"string",schemaType:"string",$data:!0,error:S,code(n){let{gen:r,data:T,schemaCode:k,keyword:o,it:u}=n,{opts:i,self:v}=u;if(!i.validateFormats)return;let F=new y.KeywordCxt(u,v.RULES.all.format.definition,"format");if(F.$data)t();else m();function t(){let R=r.scopeValue("formats",{ref:v.formats,code:i.code.formats}),f=r.const("fmt",p._`${R}[${F.schemaCode}]`);n.fail$data((0,p.or)(p._`typeof ${f} != "object"`,p._`${f} instanceof RegExp`,p._`typeof ${f}.compare != "function"`,a(f)))}function m(){let R=F.schema,f=v.formats[R];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw Error(`"${o}": format "${R}" does not define "compare" function`);let I=r.scopeValue("formats",{key:R,ref:f,code:i.code.formats?p._`${i.code.formats}${(0,p.getProperty)(R)}`:void 0});n.fail$data(a(I))}function a(R){return p._`${R}.compare(${T}, ${k}) ${d[o].fail} 0`}},dependencies:["format"]};var c=(n)=>{return n.addKeyword(E.formatLimitDefinition),n};E.default=c}),mm=W((E,y)=>{Object.defineProperty(E,"__esModule",{value:!0});var p=rm(),h=Tm(),d=u0(),S=new d.Name("fullFormats"),c=new d.Name("fastFormats"),n=(T,k={keywords:!0})=>{if(Array.isArray(k))return r(T,k,p.fullFormats,S),T;let[o,u]=k.mode==="fast"?[p.fastFormats,c]:[p.fullFormats,S],i=k.formats||p.formatNames;if(r(T,i,o,u),k.keywords)(0,h.default)(T);return T};n.get=(T,k="full")=>{let o=(k==="fast"?p.fastFormats:p.fullFormats)[T];if(!o)throw Error(`Unknown format "${T}"`);return o};function r(T,k,o,u){var i,v;(i=(v=T.opts.code).formats)!==null&&i!==void 0||(v.formats=d._`require("ajv-formats/dist/formats").${u}`);for(let F of k)T.addFormat(F,o[F])}y.exports=E=n,Object.defineProperty(E,"__esModule",{value:!0}),E.default=n}),km=50;function Nh(E=km){let y=new AbortController;return um(E,y.signal),y}class P3 extends Error{}function wh(){return process.versions.bun!==void 0}var om=typeof global=="object"&&global&&global.Object===Object&&global,xm=om,Im=typeof self=="object"&&self&&self.Object===Object&&self,im=xm||Im||Function("return this")(),$E=im,tm=$E.Symbol,i8=tm,Kh=Object.prototype,Zm=Kh.hasOwnProperty,vm=Kh.toString,z6=i8?i8.toStringTag:void 0;function Fm(E){var y=Zm.call(E,z6),p=E[z6];try{E[z6]=void 0;var h=!0}catch(S){}var d=vm.call(E);if(h)if(y)E[z6]=p;else delete E[z6];return d}var Am=Fm,Mm=Object.prototype,sm=Mm.toString;function bm(E){return sm.call(E)}var em=bm,gm="[object Null]",lm="[object Undefined]",sp=i8?i8.toStringTag:void 0;function Pm(E){if(E==null)return E===void 0?lm:gm;return sp&&sp in Object(E)?Am(E):em(E)}var Lm=Pm;function jm(E){var y=typeof E;return E!=null&&(y=="object"||y=="function")}var Hh=jm,qm="[object AsyncFunction]",_m="[object Function]",Dm="[object GeneratorFunction]",Vm="[object Proxy]";function Bm(E){if(!Hh(E))return!1;var y=Lm(E);return y==_m||y==Dm||y==qm||y==Vm}var Nm=Bm,wm=$E["__core-js_shared__"],vE=wm,bp=function(){var E=/[^.]+$/.exec(vE&&vE.keys&&vE.keys.IE_PROTO||"");return E?"Symbol(src)_1."+E:""}();function Km(E){return!!bp&&bp in E}var Hm=Km,Om=Function.prototype,Um=Om.toString;function Gm(E){if(E!=null){try{return Um.call(E)}catch(y){}try{return E+""}catch(y){}}return""}var Wm=Gm,zm=/[\\^$.*+?()[\]{}|]/g,Qm=/^\[object .+?Constructor\]$/,Jm=Function.prototype,Ym=Object.prototype,Xm=Jm.toString,$m=Ym.hasOwnProperty,ER=RegExp("^"+Xm.call($m).replace(zm,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yR(E){if(!Hh(E)||Hm(E))return!1;var y=Nm(E)?ER:Qm;return y.test(Wm(E))}var dR=yR;function pR(E,y){return E==null?void 0:E[y]}var hR=pR;function SR(E,y){var p=hR(E,y);return dR(p)?p:void 0}var Oh=SR,cR=Oh(Object,"create"),o4=cR;function nR(){this.__data__=o4?o4(null):{},this.size=0}var rR=nR;function TR(E){var y=this.has(E)&&delete this.__data__[E];return this.size-=y?1:0,y}var mR=TR,RR="__lodash_hash_undefined__",fR=Object.prototype,uR=fR.hasOwnProperty;function kR(E){var y=this.__data__;if(o4){var p=y[E];return p===RR?void 0:p}return uR.call(y,E)?y[E]:void 0}var aR=kR,CR=Object.prototype,oR=CR.hasOwnProperty;function xR(E){var y=this.__data__;return o4?y[E]!==void 0:oR.call(y,E)}var IR=xR,iR="__lodash_hash_undefined__";function tR(E,y){var p=this.__data__;return this.size+=this.has(E)?0:1,p[E]=o4&&y===void 0?iR:y,this}var ZR=tR;function V6(E){var y=-1,p=E==null?0:E.length;this.clear();while(++y<p){var h=E[y];this.set(h[0],h[1])}}V6.prototype.clear=rR;V6.prototype.delete=mR;V6.prototype.get=aR;V6.prototype.has=IR;V6.prototype.set=ZR;var ep=V6;function vR(){this.__data__=[],this.size=0}var FR=vR;function AR(E,y){return E===y||E!==E&&y!==y}var MR=AR;function sR(E,y){var p=E.length;while(p--)if(MR(E[p][0],y))return p;return-1}var z8=sR,bR=Array.prototype,eR=bR.splice;function gR(E){var y=this.__data__,p=z8(y,E);if(p<0)return!1;var h=y.length-1;if(p==h)y.pop();else eR.call(y,p,1);return--this.size,!0}var lR=gR;function PR(E){var y=this.__data__,p=z8(y,E);return p<0?void 0:y[p][1]}var LR=PR;function jR(E){return z8(this.__data__,E)>-1}var qR=jR;function _R(E,y){var p=this.__data__,h=z8(p,E);if(h<0)++this.size,p.push([E,y]);else p[h][1]=y;return this}var DR=_R;function B6(E){var y=-1,p=E==null?0:E.length;this.clear();while(++y<p){var h=E[y];this.set(h[0],h[1])}}B6.prototype.clear=FR;B6.prototype.delete=lR;B6.prototype.get=LR;B6.prototype.has=qR;B6.prototype.set=DR;var VR=B6,BR=Oh($E,"Map"),NR=BR;function wR(){this.size=0,this.__data__={hash:new ep,map:new(NR||VR),string:new ep}}var KR=wR;function HR(E){var y=typeof E;return y=="string"||y=="number"||y=="symbol"||y=="boolean"?E!=="__proto__":E===null}var OR=HR;function UR(E,y){var p=E.__data__;return OR(y)?p[typeof y=="string"?"string":"hash"]:p.map}var Q8=UR;function GR(E){var y=Q8(this,E).delete(E);return this.size-=y?1:0,y}var WR=GR;function zR(E){return Q8(this,E).get(E)}var QR=zR;function JR(E){return Q8(this,E).has(E)}var YR=JR;function XR(E,y){var p=Q8(this,E),h=p.size;return p.set(E,y),this.size+=p.size==h?0:1,this}var $R=XR;function N6(E){var y=-1,p=E==null?0:E.length;this.clear();while(++y<p){var h=E[y];this.set(h[0],h[1])}}N6.prototype.clear=KR;N6.prototype.delete=WR;N6.prototype.get=QR;N6.prototype.has=YR;N6.prototype.set=$R;var Uh=N6,Ef="Expected a function";function Ey(E,y){if(typeof E!="function"||y!=null&&typeof y!="function")throw TypeError(Ef);var p=function(){var h=arguments,d=y?y.apply(this,h):h[0],S=p.cache;if(S.has(d))return S.get(d);var c=E.apply(this,h);return p.cache=S.set(d,c)||S,c};return p.cache=new(Ey.Cache||Uh),p}Ey.Cache=Uh;var E6=Ey,Gh=E6(()=>{return(process.env.CLAUDE_CONFIG_DIR??df(yf(),".claude")).normalize("NFC")},()=>process.env.CLAUDE_CONFIG_DIR);function S6(E){if(!E)return!1;if(typeof E==="boolean")return E;let y=E.toLowerCase().trim();return["1","true","yes","on"].includes(y)}function Q(E,y,p,h,d){if(h==="m")throw TypeError("Private method is not writable");if(h==="a"&&!d)throw TypeError("Private accessor was defined without a setter");if(typeof y==="function"?E!==y||!d:!y.has(E))throw TypeError("Cannot write private member to an object whose class did not declare it");return h==="a"?d.call(E,p):d?d.value=p:y.set(E,p),p}function l(E,y,p,h){if(p==="a"&&!h)throw TypeError("Private accessor was defined without a getter");if(typeof y==="function"?E!==y||!h:!y.has(E))throw TypeError("Cannot read private member from an object whose class did not declare it");return p==="m"?h:p==="a"?h.call(E):h?h.value:y.get(E)}var Wh=function(){let{crypto:E}=globalThis;if(E?.randomUUID)return Wh=E.randomUUID.bind(E),E.randomUUID();let y=new Uint8Array(1),p=E?()=>E.getRandomValues(y)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(h)=>(+h^p()&15>>+h/4).toString(16))};function x4(E){return typeof E==="object"&&E!==null&&(("name"in E)&&E.name==="AbortError"||("message"in E)&&String(E.message).includes("FetchRequestCanceledException"))}var _E=(E)=>{if(E instanceof Error)return E;if(typeof E==="object"&&E!==null){try{if(Object.prototype.toString.call(E)==="[object Error]"){let y=Error(E.message,E.cause?{cause:E.cause}:{});if(E.stack)y.stack=E.stack;if(E.cause&&!y.cause)y.cause=E.cause;if(E.name)y.name=E.name;return y}}catch{}try{return Error(JSON.stringify(E))}catch{}}return Error(E)};class n0 extends Error{}class $0 extends n0{constructor(E,y,p,h,d){super(`${$0.makeMessage(E,y,p)}`);this.status=E,this.headers=h,this.requestID=h?.get("request-id"),this.error=y,this.type=d??null}static makeMessage(E,y,p){let h=y?.message?typeof y.message==="string"?y.message:JSON.stringify(y.message):y?JSON.stringify(y):p;if(E&&h)return`${E} ${h}`;if(E)return`${E} status code (no body)`;if(h)return h;return"(no status code or body)"}static generate(E,y,p,h){if(!E||!h)return new _4({message:p,cause:_E(y)});let d=y,S=d?.error?.type;if(E===400)return new dy(E,d,p,h,S);if(E===401)return new py(E,d,p,h,S);if(E===403)return new hy(E,d,p,h,S);if(E===404)return new Sy(E,d,p,h,S);if(E===409)return new cy(E,d,p,h,S);if(E===422)return new ny(E,d,p,h,S);if(E===429)return new ry(E,d,p,h,S);if(E>=500)return new Ty(E,d,p,h,S);return new $0(E,d,p,h,S)}}class o3 extends $0{constructor({message:E}={}){super(void 0,void 0,E||"Request was aborted.",void 0)}}class _4 extends $0{constructor({message:E,cause:y}){super(void 0,void 0,E||"Connection error.",void 0);if(y)this.cause=y}}class yy extends _4{constructor({message:E}={}){super({message:E??"Request timed out."})}}class dy extends $0{}class py extends $0{}class hy extends $0{}class Sy extends $0{}class cy extends $0{}class ny extends $0{}class ry extends $0{}class Ty extends $0{}var pf=/^[a-z][a-z0-9+.-]*:/i,hf=(E)=>{return pf.test(E)},DE=(E)=>(DE=Array.isArray,DE(E)),gp=DE;function VE(E){if(typeof E!=="object")return{};return E??{}}function lp(E){if(!E)return!0;for(let y in E)return!1;return!0}function Sf(E,y){return Object.prototype.hasOwnProperty.call(E,y)}var cf=(E,y)=>{if(typeof y!=="number"||!Number.isInteger(y))throw new n0(`${E} must be an integer`);if(y<0)throw new n0(`${E} must be a positive integer`);return y},zh=(E)=>{try{return JSON.parse(E)}catch(y){return}},nf=(E)=>new Promise((y)=>setTimeout(y,E)),Z6="0.81.0",rf=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function Tf(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var mf=()=>{let E=Tf();if(E==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Z6,"X-Stainless-OS":Lp(Deno.build.os),"X-Stainless-Arch":Pp(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Z6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(E==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Z6,"X-Stainless-OS":Lp(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Pp(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let y=Rf();if(y)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Z6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${y.browser}`,"X-Stainless-Runtime-Version":y.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Z6,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function Rf(){if(typeof navigator>"u"||!navigator)return null;let E=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:y,pattern:p}of E){let h=p.exec(navigator.userAgent);if(h){let d=h[1]||0,S=h[2]||0,c=h[3]||0;return{browser:y,version:`${d}.${S}.${c}`}}}return null}var Pp=(E)=>{if(E==="x32")return"x32";if(E==="x86_64"||E==="x64")return"x64";if(E==="arm")return"arm";if(E==="aarch64"||E==="arm64")return"arm64";if(E)return`other:${E}`;return"unknown"},Lp=(E)=>{if(E=E.toLowerCase(),E.includes("ios"))return"iOS";if(E==="android")return"Android";if(E==="darwin")return"MacOS";if(E==="win32")return"Windows";if(E==="freebsd")return"FreeBSD";if(E==="openbsd")return"OpenBSD";if(E==="linux")return"Linux";if(E)return`Other:${E}`;return"Unknown"},jp,ff=()=>{return jp??(jp=mf())};function uf(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Qh(...E){let y=globalThis.ReadableStream;if(typeof y>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new y(...E)}function Jh(E){let y=Symbol.asyncIterator in E?E[Symbol.asyncIterator]():E[Symbol.iterator]();return Qh({start(){},async pull(p){let{done:h,value:d}=await y.next();if(h)p.close();else p.enqueue(d)},async cancel(){await y.return?.()}})}function my(E){if(E[Symbol.asyncIterator])return E;let y=E.getReader();return{async next(){try{let p=await y.read();if(p?.done)y.releaseLock();return p}catch(p){throw y.releaseLock(),p}},async return(){let p=y.cancel();return y.releaseLock(),await p,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function kf(E){if(E===null||typeof E!=="object")return;if(E[Symbol.asyncIterator]){await E[Symbol.asyncIterator]().return?.();return}let y=E.getReader(),p=y.cancel();y.releaseLock(),await p}var af=({headers:E,body:y})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(y)}};function Cf(E){return Object.entries(E).filter(([y,p])=>typeof p<"u").map(([y,p])=>{if(typeof p==="string"||typeof p==="number"||typeof p==="boolean")return`${encodeURIComponent(y)}=${encodeURIComponent(p)}`;if(p===null)return`${encodeURIComponent(y)}=`;throw new n0(`Cannot stringify type ${typeof p}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function of(E){let y=0;for(let d of E)y+=d.length;let p=new Uint8Array(y),h=0;for(let d of E)p.set(d,h),h+=d.length;return p}var qp;function Ry(E){let y;return(qp??(y=new globalThis.TextEncoder,qp=y.encode.bind(y)))(E)}var _p;function Dp(E){let y;return(_p??(y=new globalThis.TextDecoder,_p=y.decode.bind(y)))(E)}var r3,T3;class w6{constructor(){r3.set(this,void 0),T3.set(this,void 0),Q(this,r3,new Uint8Array,"f"),Q(this,T3,null,"f")}decode(E){if(E==null)return[];let y=E instanceof ArrayBuffer?new Uint8Array(E):typeof E==="string"?Ry(E):E;Q(this,r3,of([l(this,r3,"f"),y]),"f");let p=[],h;while((h=xf(l(this,r3,"f"),l(this,T3,"f")))!=null){if(h.carriage&&l(this,T3,"f")==null){Q(this,T3,h.index,"f");continue}if(l(this,T3,"f")!=null&&(h.index!==l(this,T3,"f")+1||h.carriage)){p.push(Dp(l(this,r3,"f").subarray(0,l(this,T3,"f")-1))),Q(this,r3,l(this,r3,"f").subarray(l(this,T3,"f")),"f"),Q(this,T3,null,"f");continue}let d=l(this,T3,"f")!==null?h.preceding-1:h.preceding,S=Dp(l(this,r3,"f").subarray(0,d));p.push(S),Q(this,r3,l(this,r3,"f").subarray(h.index),"f"),Q(this,T3,null,"f")}return p}flush(){if(!l(this,r3,"f").length)return[];return this.decode(`
10
- `)}}r3=new WeakMap,T3=new WeakMap;w6.NEWLINE_CHARS=new Set([`
11
- `,"\r"]);w6.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function xf(E,y){for(let p=y??0;p<E.length;p++){if(E[p]===10)return{preceding:p,index:p+1,carriage:!1};if(E[p]===13)return{preceding:p,index:p+1,carriage:!0}}return null}function If(E){for(let y=0;y<E.length-1;y++){if(E[y]===10&&E[y+1]===10)return y+2;if(E[y]===13&&E[y+1]===13)return y+2;if(E[y]===13&&E[y+1]===10&&y+3<E.length&&E[y+2]===13&&E[y+3]===10)return y+4}return-1}var t8={off:0,error:200,warn:300,info:400,debug:500},Vp=(E,y,p)=>{if(!E)return;if(Sf(t8,E))return E;y3(p).warn(`${y} was set to ${JSON.stringify(E)}, expected one of ${JSON.stringify(Object.keys(t8))}`);return};function R4(){}function z4(E,y,p){if(!y||t8[E]>t8[p])return R4;else return y[E].bind(y)}var tf={error:R4,warn:R4,info:R4,debug:R4},Bp=new WeakMap;function y3(E){let y=E.logger,p=E.logLevel??"off";if(!y)return tf;let h=Bp.get(y);if(h&&h[0]===p)return h[1];let d={error:z4("error",y,p),warn:z4("warn",y,p),info:z4("info",y,p),debug:z4("debug",y,p)};return Bp.set(y,[p,d]),d}var h6=(E)=>{if(E.options)E.options={...E.options},delete E.options.headers;if(E.headers)E.headers=Object.fromEntries((E.headers instanceof Headers?[...E.headers]:Object.entries(E.headers)).map(([y,p])=>[y,y.toLowerCase()==="x-api-key"||y.toLowerCase()==="authorization"||y.toLowerCase()==="cookie"||y.toLowerCase()==="set-cookie"?"***":p]));if("retryOfRequestLogID"in E){if(E.retryOfRequestLogID)E.retryOf=E.retryOfRequestLogID;delete E.retryOfRequestLogID}return E},Q6;class L3{constructor(E,y,p){this.iterator=E,Q6.set(this,void 0),this.controller=y,Q(this,Q6,p,"f")}static fromSSEResponse(E,y,p){let h=!1,d=p?y3(p):console;async function*S(){if(h)throw new n0("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");h=!0;let c=!1;try{for await(let n of Zf(E,y)){if(n.event==="completion")try{yield JSON.parse(n.data)}catch(r){throw d.error("Could not parse message into JSON:",n.data),d.error("From chunk:",n.raw),r}if(n.event==="message_start"||n.event==="message_delta"||n.event==="message_stop"||n.event==="content_block_start"||n.event==="content_block_delta"||n.event==="content_block_stop")try{yield JSON.parse(n.data)}catch(r){throw d.error("Could not parse message into JSON:",n.data),d.error("From chunk:",n.raw),r}if(n.event==="ping")continue;if(n.event==="error"){let r=zh(n.data)??n.data,T=r?.error?.type;throw new $0(void 0,r,void 0,E.headers,T)}}c=!0}catch(n){if(x4(n))return;throw n}finally{if(!c)y.abort()}}return new L3(S,y,p)}static fromReadableStream(E,y,p){let h=!1;async function*d(){let c=new w6,n=my(E);for await(let r of n)for(let T of c.decode(r))yield T;for(let r of c.flush())yield r}async function*S(){if(h)throw new n0("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");h=!0;let c=!1;try{for await(let n of d()){if(c)continue;if(n)yield JSON.parse(n)}c=!0}catch(n){if(x4(n))return;throw n}finally{if(!c)y.abort()}}return new L3(S,y,p)}[(Q6=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let E=[],y=[],p=this.iterator(),h=(d)=>{return{next:()=>{if(d.length===0){let S=p.next();E.push(S),y.push(S)}return d.shift()}}};return[new L3(()=>h(E),this.controller,l(this,Q6,"f")),new L3(()=>h(y),this.controller,l(this,Q6,"f"))]}toReadableStream(){let E=this,y;return Qh({async start(){y=E[Symbol.asyncIterator]()},async pull(p){try{let{value:h,done:d}=await y.next();if(d)return p.close();let S=Ry(JSON.stringify(h)+`
12
- `);p.enqueue(S)}catch(h){p.error(h)}},async cancel(){await y.return?.()}})}}async function*Zf(E,y){if(!E.body){if(y.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new n0("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new n0("Attempted to iterate over a response with no body")}let p=new Yh,h=new w6,d=my(E.body);for await(let S of vf(d))for(let c of h.decode(S)){let n=p.decode(c);if(n)yield n}for(let S of h.flush()){let c=p.decode(S);if(c)yield c}}async function*vf(E){let y=new Uint8Array;for await(let p of E){if(p==null)continue;let h=p instanceof ArrayBuffer?new Uint8Array(p):typeof p==="string"?Ry(p):p,d=new Uint8Array(y.length+h.length);d.set(y),d.set(h,y.length),y=d;let S;while((S=If(y))!==-1)yield y.slice(0,S),y=y.slice(S)}if(y.length>0)yield y}class Yh{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(E){if(E.endsWith("\r"))E=E.substring(0,E.length-1);if(!E){if(!this.event&&!this.data.length)return null;let d={event:this.event,data:this.data.join(`
13
- `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],d}if(this.chunks.push(E),E.startsWith(":"))return null;let[y,p,h]=Ff(E,":");if(h.startsWith(" "))h=h.substring(1);if(y==="event")this.event=h;else if(y==="data")this.data.push(h);return null}}function Ff(E,y){let p=E.indexOf(y);if(p!==-1)return[E.substring(0,p),y,E.substring(p+y.length)];return[E,"",""]}async function Xh(E,y){let{response:p,requestLogID:h,retryOfRequestLogID:d,startTime:S}=y,c=await(async()=>{if(y.options.stream){if(y3(E).debug("response",p.status,p.url,p.headers,p.body),y.options.__streamClass)return y.options.__streamClass.fromSSEResponse(p,y.controller);return L3.fromSSEResponse(p,y.controller)}if(p.status===204)return null;if(y.options.__binaryResponse)return p;let n=p.headers.get("content-type")?.split(";")[0]?.trim();if(n?.includes("application/json")||n?.endsWith("+json")){if(p.headers.get("content-length")==="0")return;let r=await p.json();return $h(r,p)}return await p.text()})();return y3(E).debug(`[${h}] response parsed`,h6({retryOfRequestLogID:d,url:p.url,status:p.status,body:c,durationMs:Date.now()-S})),c}function $h(E,y){if(!E||typeof E!=="object"||Array.isArray(E))return E;return Object.defineProperty(E,"_request_id",{value:y.headers.get("request-id"),enumerable:!1})}var f4;class J8 extends Promise{constructor(E,y,p=Xh){super((h)=>{h(null)});this.responsePromise=y,this.parseResponse=p,f4.set(this,void 0),Q(this,f4,E,"f")}_thenUnwrap(E){return new J8(l(this,f4,"f"),this.responsePromise,async(y,p)=>$h(E(await this.parseResponse(y,p),p),p.response))}asResponse(){return this.responsePromise.then((E)=>E.response)}async withResponse(){let[E,y]=await Promise.all([this.parse(),this.asResponse()]);return{data:E,response:y,request_id:y.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((E)=>this.parseResponse(l(this,f4,"f"),E));return this.parsedPromise}then(E,y){return this.parse().then(E,y)}catch(E){return this.parse().catch(E)}finally(E){return this.parse().finally(E)}}f4=new WeakMap;var Q4;class fy{constructor(E,y,p,h){Q4.set(this,void 0),Q(this,Q4,E,"f"),this.options=h,this.response=y,this.body=p}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let E=this.nextPageRequestOptions();if(!E)throw new n0("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await l(this,Q4,"f").requestAPIList(this.constructor,E)}async*iterPages(){let E=this;yield E;while(E.hasNextPage())E=await E.getNextPage(),yield E}async*[(Q4=new WeakMap,Symbol.asyncIterator)](){for await(let E of this.iterPages())for(let y of E.getPaginatedItems())yield y}}class ES extends J8{constructor(E,y,p){super(E,y,async(h,d)=>new p(h,d.response,await Xh(h,d),d.options))}async*[Symbol.asyncIterator](){let E=await this;for await(let y of E)yield y}}class K6 extends fy{constructor(E,y,p,h){super(E,y,p,h);this.data=p.data||[],this.has_more=p.has_more||!1,this.first_id=p.first_id||null,this.last_id=p.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let y=this.first_id;if(!y)return null;return{...this.options,query:{...VE(this.options.query),before_id:y}}}let E=this.last_id;if(!E)return null;return{...this.options,query:{...VE(this.options.query),after_id:E}}}}class uy extends fy{constructor(E,y,p,h){super(E,y,p,h);this.data=p.data||[],this.has_more=p.has_more||!1,this.next_page=p.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let E=this.next_page;if(!E)return null;return{...this.options,query:{...VE(this.options.query),page:E}}}}var yS=()=>{if(typeof File>"u"){let{process:E}=globalThis,y=typeof E?.versions?.node==="string"&&parseInt(E.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(y?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function s6(E,y,p){return yS(),new File(E,y??"unknown_file",p)}function u8(E,y){let p=typeof E==="object"&&E!==null&&(("name"in E)&&E.name&&String(E.name)||("url"in E)&&E.url&&String(E.url)||("filename"in E)&&E.filename&&String(E.filename)||("path"in E)&&E.path&&String(E.path))||"";return y?p.split(/[\\/]/).pop()||void 0:p}var dS=(E)=>E!=null&&typeof E==="object"&&typeof E[Symbol.asyncIterator]==="function",ky=async(E,y,p=!0)=>{return{...E,body:await Mf(E.body,y,p)}},Np=new WeakMap;function Af(E){let y=typeof E==="function"?E:E.fetch,p=Np.get(y);if(p)return p;let h=(async()=>{try{let d="Response"in y?y.Response:(await y("data:,")).constructor,S=new FormData;if(S.toString()===await new d(S).text())return!1;return!0}catch{return!0}})();return Np.set(y,h),h}var Mf=async(E,y,p=!0)=>{if(!await Af(y))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let h=new FormData;return await Promise.all(Object.entries(E||{}).map(([d,S])=>BE(h,d,S,p))),h},sf=(E)=>E instanceof Blob&&("name"in E),BE=async(E,y,p,h)=>{if(p===void 0)return;if(p==null)throw TypeError(`Received null for "${y}"; to pass null in FormData, you must use the string 'null'`);if(typeof p==="string"||typeof p==="number"||typeof p==="boolean")E.append(y,String(p));else if(p instanceof Response){let d={},S=p.headers.get("Content-Type");if(S)d={type:S};E.append(y,s6([await p.blob()],u8(p,h),d))}else if(dS(p))E.append(y,s6([await new Response(Jh(p)).blob()],u8(p,h)));else if(sf(p))E.append(y,s6([p],u8(p,h),{type:p.type}));else if(Array.isArray(p))await Promise.all(p.map((d)=>BE(E,y+"[]",d,h)));else if(typeof p==="object")await Promise.all(Object.entries(p).map(([d,S])=>BE(E,`${y}[${d}]`,S,h)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${p} instead`)},pS=(E)=>E!=null&&typeof E==="object"&&typeof E.size==="number"&&typeof E.type==="string"&&typeof E.text==="function"&&typeof E.slice==="function"&&typeof E.arrayBuffer==="function",bf=(E)=>E!=null&&typeof E==="object"&&typeof E.name==="string"&&typeof E.lastModified==="number"&&pS(E),ef=(E)=>E!=null&&typeof E==="object"&&typeof E.url==="string"&&typeof E.blob==="function";async function gf(E,y,p){if(yS(),E=await E,y||(y=u8(E,!0)),bf(E)){if(E instanceof File&&y==null&&p==null)return E;return s6([await E.arrayBuffer()],y??E.name,{type:E.type,lastModified:E.lastModified,...p})}if(ef(E)){let d=await E.blob();return y||(y=new URL(E.url).pathname.split(/[\\/]/).pop()),s6(await NE(d),y,p)}let h=await NE(E);if(!p?.type){let d=h.find((S)=>typeof S==="object"&&("type"in S)&&S.type);if(typeof d==="string")p={...p,type:d}}return s6(h,y,p)}async function NE(E){let y=[];if(typeof E==="string"||ArrayBuffer.isView(E)||E instanceof ArrayBuffer)y.push(E);else if(pS(E))y.push(E instanceof Blob?E:await E.arrayBuffer());else if(dS(E))for await(let p of E)y.push(...await NE(p));else{let p=E?.constructor?.name;throw Error(`Unexpected data type: ${typeof E}${p?`; constructor: ${p}`:""}${lf(E)}`)}return y}function lf(E){if(typeof E!=="object"||E===null)return"";return`; props: [${Object.getOwnPropertyNames(E).map((y)=>`"${y}"`).join(", ")}]`}class i3{constructor(E){this._client=E}}var hS=Symbol.for("brand.privateNullableHeaders");function*Pf(E){if(!E)return;if(hS in E){let{values:h,nulls:d}=E;yield*h.entries();for(let S of d)yield[S,null];return}let y=!1,p;if(E instanceof Headers)p=E.entries();else if(gp(E))p=E;else y=!0,p=Object.entries(E??{});for(let h of p){let d=h[0];if(typeof d!=="string")throw TypeError("expected header name to be a string");let S=gp(h[1])?h[1]:[h[1]],c=!1;for(let n of S){if(n===void 0)continue;if(y&&!c)c=!0,yield[d,null];yield[d,n]}}}var i0=(E)=>{let y=new Headers,p=new Set;for(let h of E){let d=new Set;for(let[S,c]of Pf(h)){let n=S.toLowerCase();if(!d.has(n))y.delete(S),d.add(n);if(c===null)y.delete(S),p.add(n);else y.append(S,c),p.delete(n)}}return{[hS]:!0,values:y,nulls:p}},a4=Symbol("anthropic.sdk.stainlessHelper");function k8(E){return typeof E==="object"&&E!==null&&a4 in E}function SS(E,y){let p=new Set;if(E){for(let h of E)if(k8(h))p.add(h[a4])}if(y)for(let h of y){if(k8(h))p.add(h[a4]);if(Array.isArray(h.content)){for(let d of h.content)if(k8(d))p.add(d[a4])}}return Array.from(p)}function cS(E,y){let p=SS(E,y);if(p.length===0)return{};return{"x-stainless-helper":p.join(", ")}}function Lf(E){if(k8(E))return{"x-stainless-helper":E[a4]};return{}}function nS(E){return E.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var wp=Object.freeze(Object.create(null)),jf=(E=nS)=>function(y,...p){if(y.length===1)return y[0];let h=!1,d=[],S=y.reduce((T,k,o)=>{if(/[?#]/.test(k))h=!0;let u=p[o],i=(h?encodeURIComponent:E)(""+u);if(o!==p.length&&(u==null||typeof u==="object"&&u.toString===Object.getPrototypeOf(Object.getPrototypeOf(u.hasOwnProperty??wp)??wp)?.toString))i=u+"",d.push({start:T.length+k.length,length:i.length,error:`Value of type ${Object.prototype.toString.call(u).slice(8,-1)} is not a valid path parameter`});return T+k+(o===p.length?"":i)},""),c=S.split(/[?#]/,1)[0],n=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,r;while((r=n.exec(c))!==null)d.push({start:r.index,length:r[0].length,error:`Value "${r[0]}" can't be safely passed as a path parameter`});if(d.sort((T,k)=>T.start-k.start),d.length>0){let T=0,k=d.reduce((o,u)=>{let i=" ".repeat(u.start-T),v="^".repeat(u.length);return T=u.start+u.length,o+i+v},"");throw new n0(`Path parameters result in path with invalid segments:
14
- ${d.map((o)=>o.error).join(`
2
+ import{createRequire as l8}from"module";import{fileURLToPath as p8}from"url";import{setMaxListeners as m8}from"events";import{spawn as u8}from"child_process";import{createInterface as S8}from"readline";import{homedir as ap}from"os";import{join as sp}from"path";import{randomUUID as Qp}from"crypto";import{appendFile as Jp,mkdir as Yp}from"fs/promises";import{join as hh}from"path";import{realpathSync as oh}from"fs";import{cwd as $p}from"process";import{randomUUID as fo}from"crypto";import{appendFile as nm,mkdir as im,symlink as hm,unlink as om}from"fs/promises";import{dirname as ko,join as Ro}from"path";import*as ot from"fs";import{mkdir as Em,open as um,readdir as Sm,readFile as dh,rename as fm,rmdir as Tm,rm as km,stat as Rm,unlink as xm}from"fs/promises";import{execFile as Km}from"child_process";import{promisify as Hm}from"util";var r4=Object.create,{getPrototypeOf:n4,defineProperty:qr,getOwnPropertyNames:i4}=Object,h4=Object.prototype.hasOwnProperty;function o4(t){return this[t]}var c4,d4,jh=(t,e,s)=>{var r=t!=null&&typeof t==="object";if(r){var a=e?c4??=new WeakMap:d4??=new WeakMap,n=a.get(t);if(n)return n}s=t!=null?r4(n4(t)):{};let i=e||!t||!t.__esModule?qr(s,"default",{value:t,enumerable:!0}):s;for(let h of i4(t))if(!h4.call(i,h))qr(i,h,{get:o4.bind(t,h),enumerable:!0});if(r)a.set(t,i);return i},W=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),y4=(t)=>t;function l4(t,e){this[t]=y4.bind(null,e)}var le=(t,e)=>{for(var s in e)qr(t,s,{get:e[s],enumerable:!0,configurable:!0,set:l4.bind(e,s)})},p4=Symbol.dispose||Symbol.for("Symbol.dispose"),m4=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Lt=(t,e,s)=>{if(e!=null){if(typeof e!=="object"&&typeof e!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var r;if(s)r=e[m4];if(r===void 0)r=e[p4];if(typeof r!=="function")throw TypeError("Object not disposable");t.push([s,r,e])}else if(s)t.push([s]);return e},jt=(t,e,s)=>{var r=typeof SuppressedError==="function"?SuppressedError:function(i,h,o,c){return c=Error(o),c.name="SuppressedError",c.error=i,c.suppressed=h,c},a=(i)=>e=s?new r(i,e,"An error was suppressed during disposal"):(s=!0,i),n=(i)=>{while(i=t.pop())try{var h=i[1]&&i[1].call(i[2]);if(i[0])return Promise.resolve(h).then(n,(o)=>(a(o),n()))}catch(o){a(o)}if(s)throw e};return n()},fs=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends e{constructor(d){super();if(!t.IDENTIFIER.test(d))throw Error("CodeGen: name must be a valid identifier");this.str=d}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=s;class r extends e{constructor(d){super();this._items=typeof d==="string"?[d]:d}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let d=this._items[0];return d===""||d==='""'}get str(){var d;return(d=this._str)!==null&&d!==void 0?d:this._str=this._items.reduce((E,y)=>`${E}${y}`,"")}get names(){var d;return(d=this._names)!==null&&d!==void 0?d:this._names=this._items.reduce((E,y)=>{if(y instanceof s)E[y.str]=(E[y.str]||0)+1;return E},{})}}t._Code=r,t.nil=new r("");function a(d,...E){let y=[d[0]],l=0;while(l<E.length)h(y,E[l]),y.push(d[++l]);return new r(y)}t._=a;var n=new r("+");function i(d,...E){let y=[k(d[0])],l=0;while(l<E.length)y.push(n),h(y,E[l]),y.push(n,k(d[++l]));return o(y),new r(y)}t.str=i;function h(d,E){if(E instanceof r)d.push(...E._items);else if(E instanceof s)d.push(E);else d.push(u(E))}t.addCodeArg=h;function o(d){let E=1;while(E<d.length-1){if(d[E]===n){let y=c(d[E-1],d[E+1]);if(y!==void 0){d.splice(E-1,3,y);continue}d[E++]="+"}E++}}function c(d,E){if(E==='""')return d;if(d==='""')return E;if(typeof d=="string"){if(E instanceof s||d[d.length-1]!=='"')return;if(typeof E!="string")return`${d.slice(0,-1)}${E}"`;if(E[0]==='"')return d.slice(0,-1)+E.slice(1);return}if(typeof E=="string"&&E[0]==='"'&&!(d instanceof s))return`"${d}${E.slice(1)}`;return}function m(d,E){return E.emptyStr()?d:d.emptyStr()?E:i`${d}${E}`}t.strConcat=m;function u(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:k(Array.isArray(d)?d.join(","):d)}function p(d){return new r(k(d))}t.stringify=p;function k(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=k;function C(d){return typeof d=="string"&&t.IDENTIFIER.test(d)?new r(`.${d}`):a`[${d}]`}t.getProperty=C;function I(d){if(typeof d=="string"&&t.IDENTIFIER.test(d))return new r(`${d}`);throw Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}t.getEsmExportName=I;function R(d){return new r(d.toString())}t.regexpCode=R}),Ai=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=fs();class s extends Error{constructor(o){super(`CodeGen: "code" for ${o} not defined`);this.value=o.value}}var r;(function(o){o[o.Started=0]="Started",o[o.Completed=1]="Completed"})(r||(t.UsedValueState=r={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class a{constructor({prefixes:o,parent:c}={}){this._names={},this._prefixes=o,this._parent=c}toName(o){return o instanceof e.Name?o:this.name(o)}name(o){return new e.Name(this._newName(o))}_newName(o){let c=this._names[o]||this._nameGroup(o);return`${o}${c.index++}`}_nameGroup(o){var c,m;if(((m=(c=this._parent)===null||c===void 0?void 0:c._prefixes)===null||m===void 0?void 0:m.has(o))||this._prefixes&&!this._prefixes.has(o))throw Error(`CodeGen: prefix "${o}" is not allowed in this scope`);return this._names[o]={prefix:o,index:0}}}t.Scope=a;class n extends e.Name{constructor(o,c){super(c);this.prefix=o}setValue(o,{property:c,itemIndex:m}){this.value=o,this.scopePath=e._`.${new e.Name(c)}[${m}]`}}t.ValueScopeName=n;var i=e._`\n`;class h extends a{constructor(o){super(o);this._values={},this._scope=o.scope,this.opts={...o,_n:o.lines?i:e.nil}}get(){return this._scope}name(o){return new n(o,this._newName(o))}value(o,c){var m;if(c.ref===void 0)throw Error("CodeGen: ref must be passed in value");let u=this.toName(o),{prefix:p}=u,k=(m=c.key)!==null&&m!==void 0?m:c.ref,C=this._values[p];if(C){let d=C.get(k);if(d)return d}else C=this._values[p]=new Map;C.set(k,u);let I=this._scope[p]||(this._scope[p]=[]),R=I.length;return I[R]=c.ref,u.setValue(c,{property:p,itemIndex:R}),u}getValue(o,c){let m=this._values[o];if(!m)return;return m.get(c)}scopeRefs(o,c=this._values){return this._reduceValues(c,(m)=>{if(m.scopePath===void 0)throw Error(`CodeGen: name "${m}" has no value`);return e._`${o}${m.scopePath}`})}scopeCode(o=this._values,c,m){return this._reduceValues(o,(u)=>{if(u.value===void 0)throw Error(`CodeGen: name "${u}" has no value`);return u.value.code},c,m)}_reduceValues(o,c,m={},u){let p=e.nil;for(let k in o){let C=o[k];if(!C)continue;let I=m[k]=m[k]||new Map;C.forEach((R)=>{if(I.has(R))return;I.set(R,r.Started);let d=c(R);if(d){let E=this.opts.es5?t.varKinds.var:t.varKinds.const;p=e._`${p}${E} ${R} = ${d};${this.opts._n}`}else if(d=u===null||u===void 0?void 0:u(R))p=e._`${p}${d}${this.opts._n}`;else throw new s(R);I.set(R,r.Completed)})}return p}}t.ValueScope=h}),pt=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=fs(),s=Ai(),r=fs();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var a=Ai();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class n{optimizeNodes(){return this}optimizeNames(S,b){return this}}class i extends n{constructor(S,b,P){super();this.varKind=S,this.name=b,this.rhs=P}render({es5:S,_n:b}){let P=S?s.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${P} ${this.name}${X};`+b}optimizeNames(S,b){if(!S[this.name.str])return;if(this.rhs)this.rhs=z(this.rhs,S,b);return this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class h extends n{constructor(S,b,P){super();this.lhs=S,this.rhs=b,this.sideEffects=P}render({_n:S}){return`${this.lhs} = ${this.rhs};`+S}optimizeNames(S,b){if(this.lhs instanceof e.Name&&!S[this.lhs.str]&&!this.sideEffects)return;return this.rhs=z(this.rhs,S,b),this}get names(){let S=this.lhs instanceof e.Name?{}:{...this.lhs.names};return O(S,this.rhs)}}class o extends h{constructor(S,b,P,X){super(S,P,X);this.op=b}render({_n:S}){return`${this.lhs} ${this.op}= ${this.rhs};`+S}}class c extends n{constructor(S){super();this.label=S,this.names={}}render({_n:S}){return`${this.label}:`+S}}class m extends n{constructor(S){super();this.label=S,this.names={}}render({_n:S}){return`break${this.label?` ${this.label}`:""};`+S}}class u extends n{constructor(S){super();this.error=S}render({_n:S}){return`throw ${this.error};`+S}get names(){return this.error.names}}class p extends n{constructor(S){super();this.code=S}render({_n:S}){return`${this.code};`+S}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(S,b){return this.code=z(this.code,S,b),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class k extends n{constructor(S=[]){super();this.nodes=S}render(S){return this.nodes.reduce((b,P)=>b+P.render(S),"")}optimizeNodes(){let{nodes:S}=this,b=S.length;while(b--){let P=S[b].optimizeNodes();if(Array.isArray(P))S.splice(b,1,...P);else if(P)S[b]=P;else S.splice(b,1)}return S.length>0?this:void 0}optimizeNames(S,b){let{nodes:P}=this,X=P.length;while(X--){let at=P[X];if(at.optimizeNames(S,b))continue;K(S,at.names),P.splice(X,1)}return P.length>0?this:void 0}get names(){return this.nodes.reduce((S,b)=>N(S,b.names),{})}}class C extends k{render(S){return"{"+S._n+super.render(S)+"}"+S._n}}class I extends k{}class R extends C{}R.kind="else";class d extends C{constructor(S,b){super(b);this.condition=S}render(S){let b=`if(${this.condition})`+super.render(S);if(this.else)b+="else "+this.else.render(S);return b}optimizeNodes(){super.optimizeNodes();let S=this.condition;if(S===!0)return this.nodes;let b=this.else;if(b){let P=b.optimizeNodes();b=this.else=Array.isArray(P)?new R(P):P}if(b){if(S===!1)return b instanceof d?b:b.nodes;if(this.nodes.length)return this;return new d(Mt(S),b instanceof d?[b]:b.nodes)}if(S===!1||!this.nodes.length)return;return this}optimizeNames(S,b){var P;if(this.else=(P=this.else)===null||P===void 0?void 0:P.optimizeNames(S,b),!(super.optimizeNames(S,b)||this.else))return;return this.condition=z(this.condition,S,b),this}get names(){let S=super.names;if(O(S,this.condition),this.else)N(S,this.else.names);return S}}d.kind="if";class E extends C{}E.kind="for";class y extends E{constructor(S){super();this.iteration=S}render(S){return`for(${this.iteration})`+super.render(S)}optimizeNames(S,b){if(!super.optimizeNames(S,b))return;return this.iteration=z(this.iteration,S,b),this}get names(){return N(super.names,this.iteration.names)}}class l extends E{constructor(S,b,P,X){super();this.varKind=S,this.name=b,this.from=P,this.to=X}render(S){let b=S.es5?s.varKinds.var:this.varKind,{name:P,from:X,to:at}=this;return`for(${b} ${P}=${X}; ${P}<${at}; ${P}++)`+super.render(S)}get names(){let S=O(super.names,this.from);return O(S,this.to)}}class T extends E{constructor(S,b,P,X){super();this.loop=S,this.varKind=b,this.name=P,this.iterable=X}render(S){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(S)}optimizeNames(S,b){if(!super.optimizeNames(S,b))return;return this.iterable=z(this.iterable,S,b),this}get names(){return N(super.names,this.iterable.names)}}class f extends C{constructor(S,b,P){super();this.name=S,this.args=b,this.async=P}render(S){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(S)}}f.kind="func";class x extends k{render(S){return"return "+super.render(S)}}x.kind="return";class v extends C{render(S){let b="try"+super.render(S);if(this.catch)b+=this.catch.render(S);if(this.finally)b+=this.finally.render(S);return b}optimizeNodes(){var S,b;return super.optimizeNodes(),(S=this.catch)===null||S===void 0||S.optimizeNodes(),(b=this.finally)===null||b===void 0||b.optimizeNodes(),this}optimizeNames(S,b){var P,X;return super.optimizeNames(S,b),(P=this.catch)===null||P===void 0||P.optimizeNames(S,b),(X=this.finally)===null||X===void 0||X.optimizeNames(S,b),this}get names(){let S=super.names;if(this.catch)N(S,this.catch.names);if(this.finally)N(S,this.finally.names);return S}}class F extends C{constructor(S){super();this.error=S}render(S){return`catch(${this.error})`+super.render(S)}}F.kind="catch";class B extends C{render(S){return"finally"+super.render(S)}}B.kind="finally";class _{constructor(S,b={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...b,_n:b.lines?`
3
+ `:""},this._extScope=S,this._scope=new s.Scope({parent:S}),this._nodes=[new I]}toString(){return this._root.render(this.opts)}name(S){return this._scope.name(S)}scopeName(S){return this._extScope.name(S)}scopeValue(S,b){let P=this._extScope.value(S,b);return(this._values[P.prefix]||(this._values[P.prefix]=new Set)).add(P),P}getScopeValue(S,b){return this._extScope.getValue(S,b)}scopeRefs(S){return this._extScope.scopeRefs(S,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(S,b,P,X){let at=this._scope.toName(b);if(P!==void 0&&X)this._constants[at.str]=P;return this._leafNode(new i(S,at,P)),at}const(S,b,P){return this._def(s.varKinds.const,S,b,P)}let(S,b,P){return this._def(s.varKinds.let,S,b,P)}var(S,b,P){return this._def(s.varKinds.var,S,b,P)}assign(S,b,P){return this._leafNode(new h(S,b,P))}add(S,b){return this._leafNode(new o(S,t.operators.ADD,b))}code(S){if(typeof S=="function")S();else if(S!==e.nil)this._leafNode(new p(S));return this}object(...S){let b=["{"];for(let[P,X]of S){if(b.length>1)b.push(",");if(b.push(P),P!==X||this.opts.es5)b.push(":"),(0,e.addCodeArg)(b,X)}return b.push("}"),new e._Code(b)}if(S,b,P){if(this._blockNode(new d(S)),b&&P)this.code(b).else().code(P).endIf();else if(b)this.code(b).endIf();else if(P)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(S){return this._elseNode(new d(S))}else(){return this._elseNode(new R)}endIf(){return this._endBlockNode(d,R)}_for(S,b){if(this._blockNode(S),b)this.code(b).endFor();return this}for(S,b){return this._for(new y(S),b)}forRange(S,b,P,X,at=this.opts.es5?s.varKinds.var:s.varKinds.let){let ut=this._scope.toName(S);return this._for(new l(at,ut,b,P),()=>X(ut))}forOf(S,b,P,X=s.varKinds.const){let at=this._scope.toName(S);if(this.opts.es5){let ut=b instanceof e.Name?b:this.var("_arr",b);return this.forRange("_i",0,e._`${ut}.length`,(rt)=>{this.var(at,e._`${ut}[${rt}]`),P(at)})}return this._for(new T("of",X,at,b),()=>P(at))}forIn(S,b,P,X=this.opts.es5?s.varKinds.var:s.varKinds.const){if(this.opts.ownProperties)return this.forOf(S,e._`Object.keys(${b})`,P);let at=this._scope.toName(S);return this._for(new T("in",X,at,b),()=>P(at))}endFor(){return this._endBlockNode(E)}label(S){return this._leafNode(new c(S))}break(S){return this._leafNode(new m(S))}return(S){let b=new x;if(this._blockNode(b),this.code(S),b.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(S,b,P){if(!b&&!P)throw Error('CodeGen: "try" without "catch" and "finally"');let X=new v;if(this._blockNode(X),this.code(S),b){let at=this.name("e");this._currNode=X.catch=new F(at),b(at)}if(P)this._currNode=X.finally=new B,this.code(P);return this._endBlockNode(F,B)}throw(S){return this._leafNode(new u(S))}block(S,b){if(this._blockStarts.push(this._nodes.length),S)this.code(S).endBlock(b);return this}endBlock(S){let b=this._blockStarts.pop();if(b===void 0)throw Error("CodeGen: not in self-balancing block");let P=this._nodes.length-b;if(P<0||S!==void 0&&P!==S)throw Error(`CodeGen: wrong number of nodes: ${P} vs ${S} expected`);return this._nodes.length=b,this}func(S,b=e.nil,P,X){if(this._blockNode(new f(S,b,P)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(f)}optimize(S=1){while(S-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(S){return this._currNode.nodes.push(S),this}_blockNode(S){this._currNode.nodes.push(S),this._nodes.push(S)}_endBlockNode(S,b){let P=this._currNode;if(P instanceof S||b&&P instanceof b)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${b?`${S.kind}/${b.kind}`:S.kind}"`)}_elseNode(S){let b=this._currNode;if(!(b instanceof d))throw Error('CodeGen: "else" without "if"');return this._currNode=b.else=S,this}get _root(){return this._nodes[0]}get _currNode(){let S=this._nodes;return S[S.length-1]}set _currNode(S){let b=this._nodes;b[b.length-1]=S}}t.CodeGen=_;function N(S,b){for(let P in b)S[P]=(S[P]||0)+(b[P]||0);return S}function O(S,b){return b instanceof e._CodeOrName?N(S,b.names):S}function z(S,b,P){if(S instanceof e.Name)return X(S);if(!at(S))return S;return new e._Code(S._items.reduce((ut,rt)=>{if(rt instanceof e.Name)rt=X(rt);if(rt instanceof e._Code)ut.push(...rt._items);else ut.push(rt);return ut},[]));function X(ut){let rt=P[ut.str];if(rt===void 0||b[ut.str]!==1)return ut;return delete b[ut.str],rt}function at(ut){return ut instanceof e._Code&&ut._items.some((rt)=>rt instanceof e.Name&&b[rt.str]===1&&P[rt.str]!==void 0)}}function K(S,b){for(let P in b)S[P]=(S[P]||0)-(b[P]||0)}function Mt(S){return typeof S=="boolean"||typeof S=="number"||S===null?!S:e._`!${V(S)}`}t.not=Mt;var Ht=L(t.operators.AND);function Ot(...S){return S.reduce(Ht)}t.and=Ot;var St=L(t.operators.OR);function A(...S){return S.reduce(St)}t.or=A;function L(S){return(b,P)=>b===e.nil?P:P===e.nil?b:e._`${V(b)} ${S} ${V(P)}`}function V(S){return S instanceof e.Name?S:e._`(${S})`}}),xt=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;var e=pt(),s=fs();function r(f){let x={};for(let v of f)x[v]=!0;return x}t.toHash=r;function a(f,x){if(typeof x=="boolean")return x;if(Object.keys(x).length===0)return!0;return n(f,x),!i(x,f.self.RULES.all)}t.alwaysValidSchema=a;function n(f,x=f.schema){let{opts:v,self:F}=f;if(!v.strictSchema)return;if(typeof x==="boolean")return;let B=F.RULES.keywords;for(let _ in x)if(!B[_])T(f,`unknown keyword: "${_}"`)}t.checkUnknownRules=n;function i(f,x){if(typeof f=="boolean")return!f;for(let v in f)if(x[v])return!0;return!1}t.schemaHasRules=i;function h(f,x){if(typeof f=="boolean")return!f;for(let v in f)if(v!=="$ref"&&x.all[v])return!0;return!1}t.schemaHasRulesButRef=h;function o({topSchemaRef:f,schemaPath:x},v,F,B){if(!B){if(typeof v=="number"||typeof v=="boolean")return v;if(typeof v=="string")return e._`${v}`}return e._`${f}${x}${(0,e.getProperty)(F)}`}t.schemaRefOrVal=o;function c(f){return p(decodeURIComponent(f))}t.unescapeFragment=c;function m(f){return encodeURIComponent(u(f))}t.escapeFragment=m;function u(f){if(typeof f=="number")return`${f}`;return f.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=u;function p(f){return f.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=p;function k(f,x){if(Array.isArray(f))for(let v of f)x(v);else x(f)}t.eachItem=k;function C({mergeNames:f,mergeToName:x,mergeValues:v,resultToName:F}){return(B,_,N,O)=>{let z=N===void 0?_:N instanceof e.Name?(_ instanceof e.Name?f(B,_,N):x(B,_,N),N):_ instanceof e.Name?(x(B,N,_),_):v(_,N);return O===e.Name&&!(z instanceof e.Name)?F(B,z):z}}t.mergeEvaluated={props:C({mergeNames:(f,x,v)=>f.if(e._`${v} !== true && ${x} !== undefined`,()=>{f.if(e._`${x} === true`,()=>f.assign(v,!0),()=>f.assign(v,e._`${v} || {}`).code(e._`Object.assign(${v}, ${x})`))}),mergeToName:(f,x,v)=>f.if(e._`${v} !== true`,()=>{if(x===!0)f.assign(v,!0);else f.assign(v,e._`${v} || {}`),R(f,v,x)}),mergeValues:(f,x)=>f===!0?!0:{...f,...x},resultToName:I}),items:C({mergeNames:(f,x,v)=>f.if(e._`${v} !== true && ${x} !== undefined`,()=>f.assign(v,e._`${x} === true ? true : ${v} > ${x} ? ${v} : ${x}`)),mergeToName:(f,x,v)=>f.if(e._`${v} !== true`,()=>f.assign(v,x===!0?!0:e._`${v} > ${x} ? ${v} : ${x}`)),mergeValues:(f,x)=>f===!0?!0:Math.max(f,x),resultToName:(f,x)=>f.var("items",x)})};function I(f,x){if(x===!0)return f.var("props",!0);let v=f.var("props",e._`{}`);if(x!==void 0)R(f,v,x);return v}t.evaluatedPropsToName=I;function R(f,x,v){Object.keys(v).forEach((F)=>f.assign(e._`${x}${(0,e.getProperty)(F)}`,!0))}t.setEvaluated=R;var d={};function E(f,x){return f.scopeValue("func",{ref:x,code:d[x.code]||(d[x.code]=new s._Code(x.code))})}t.useFunc=E;var y;(function(f){f[f.Num=0]="Num",f[f.Str=1]="Str"})(y||(t.Type=y={}));function l(f,x,v){if(f instanceof e.Name){let F=x===y.Num;return v?F?e._`"[" + ${f} + "]"`:e._`"['" + ${f} + "']"`:F?e._`"/" + ${f}`:e._`"/" + ${f}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return v?(0,e.getProperty)(f).toString():"/"+u(f)}t.getErrorPath=l;function T(f,x,v=f.opts.strictSchema){if(!v)return;if(x=`strict mode: ${x}`,v===!0)throw Error(x);f.self.logger.warn(x)}t.checkStrictMode=T}),$0=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=s}),Os=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=pt(),s=xt(),r=$0();t.keywordError={message:({keyword:R})=>e.str`must pass "${R}" keyword validation`},t.keyword$DataError={message:({keyword:R,schemaType:d})=>d?e.str`"${R}" keyword must be ${d} ($data)`:e.str`"${R}" keyword is invalid ($data)`};function a(R,d=t.keywordError,E,y){let{it:l}=R,{gen:T,compositeRule:f,allErrors:x}=l,v=u(R,d,E);if(y!==null&&y!==void 0?y:f||x)o(T,v);else c(l,e._`[${v}]`)}t.reportError=a;function n(R,d=t.keywordError,E){let{it:y}=R,{gen:l,compositeRule:T,allErrors:f}=y,x=u(R,d,E);if(o(l,x),!(T||f))c(y,r.default.vErrors)}t.reportExtraError=n;function i(R,d){R.assign(r.default.errors,d),R.if(e._`${r.default.vErrors} !== null`,()=>R.if(d,()=>R.assign(e._`${r.default.vErrors}.length`,d),()=>R.assign(r.default.vErrors,null)))}t.resetErrorsCount=i;function h({gen:R,keyword:d,schemaValue:E,data:y,errsCount:l,it:T}){if(l===void 0)throw Error("ajv implementation error");let f=R.name("err");R.forRange("i",l,r.default.errors,(x)=>{if(R.const(f,e._`${r.default.vErrors}[${x}]`),R.if(e._`${f}.instancePath === undefined`,()=>R.assign(e._`${f}.instancePath`,(0,e.strConcat)(r.default.instancePath,T.errorPath))),R.assign(e._`${f}.schemaPath`,e.str`${T.errSchemaPath}/${d}`),T.opts.verbose)R.assign(e._`${f}.schema`,E),R.assign(e._`${f}.data`,y)})}t.extendErrors=h;function o(R,d){let E=R.const("err",d);R.if(e._`${r.default.vErrors} === null`,()=>R.assign(r.default.vErrors,e._`[${E}]`),e._`${r.default.vErrors}.push(${E})`),R.code(e._`${r.default.errors}++`)}function c(R,d){let{gen:E,validateName:y,schemaEnv:l}=R;if(l.$async)E.throw(e._`new ${R.ValidationError}(${d})`);else E.assign(e._`${y}.errors`,d),E.return(!1)}var m={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function u(R,d,E){let{createErrors:y}=R.it;if(y===!1)return e._`{}`;return p(R,d,E)}function p(R,d,E={}){let{gen:y,it:l}=R,T=[k(l,E),C(R,E)];return I(R,d,T),y.object(...T)}function k({errorPath:R},{instancePath:d}){let E=d?e.str`${R}${(0,s.getErrorPath)(d,s.Type.Str)}`:R;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)]}function C({keyword:R,it:{errSchemaPath:d}},{schemaPath:E,parentSchema:y}){let l=y?d:e.str`${d}/${R}`;if(E)l=e.str`${l}${(0,s.getErrorPath)(E,s.Type.Str)}`;return[m.schemaPath,l]}function I(R,{params:d,message:E},y){let{keyword:l,data:T,schemaValue:f,it:x}=R,{opts:v,propertyName:F,topSchemaRef:B,schemaPath:_}=x;if(y.push([m.keyword,l],[m.params,typeof d=="function"?d(R):d||e._`{}`]),v.messages)y.push([m.message,typeof E=="function"?E(R):E]);if(v.verbose)y.push([m.schema,f],[m.parentSchema,e._`${B}${_}`],[r.default.data,T]);if(F)y.push([m.propertyName,F])}}),E4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=Os(),s=pt(),r=$0(),a={message:"boolean schema is false"};function n(o){let{gen:c,schema:m,validateName:u}=o;if(m===!1)h(o,!1);else if(typeof m=="object"&&m.$async===!0)c.return(r.default.data);else c.assign(s._`${u}.errors`,null),c.return(!0)}t.topBoolOrEmptySchema=n;function i(o,c){let{gen:m,schema:u}=o;if(u===!1)m.var(c,!1),h(o);else m.var(c,!0)}t.boolOrEmptySchema=i;function h(o,c){let{gen:m,data:u}=o,p={gen:m,keyword:"false schema",data:u,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(p,a,void 0,c)}}),qh=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;var e=["string","number","integer","boolean","null","object","array"],s=new Set(e);function r(n){return typeof n=="string"&&s.has(n)}t.isJSONType=r;function a(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=a}),_h=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:a,self:n},i){let h=n.RULES.types[i];return h&&h!==!0&&s(a,h)}t.schemaHasRulesForType=e;function s(a,n){return n.rules.some((i)=>r(a,i))}t.shouldUseGroup=s;function r(a,n){var i;return a[n.keyword]!==void 0||((i=n.definition.implements)===null||i===void 0?void 0:i.some((h)=>a[h]!==void 0))}t.shouldUseRule=r}),Ts=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;var e=qh(),s=_h(),r=Os(),a=pt(),n=xt(),i;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(i||(t.DataType=i={}));function h(y){let l=o(y.type);if(l.includes("null")){if(y.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!l.length&&y.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(y.nullable===!0)l.push("null")}return l}t.getSchemaTypes=h;function o(y){let l=Array.isArray(y)?y:y?[y]:[];if(l.every(e.isJSONType))return l;throw Error("type must be JSONType or JSONType[]: "+l.join(","))}t.getJSONTypes=o;function c(y,l){let{gen:T,data:f,opts:x}=y,v=u(l,x.coerceTypes),F=l.length>0&&!(v.length===0&&l.length===1&&(0,s.schemaHasRulesForType)(y,l[0]));if(F){let B=I(l,f,x.strictNumbers,i.Wrong);T.if(B,()=>{if(v.length)p(y,l,v);else d(y)})}return F}t.coerceAndCheckDataType=c;var m=new Set(["string","number","integer","boolean","null"]);function u(y,l){return l?y.filter((T)=>m.has(T)||l==="array"&&T==="array"):[]}function p(y,l,T){let{gen:f,data:x,opts:v}=y,F=f.let("dataType",a._`typeof ${x}`),B=f.let("coerced",a._`undefined`);if(v.coerceTypes==="array")f.if(a._`${F} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>f.assign(x,a._`${x}[0]`).assign(F,a._`typeof ${x}`).if(I(l,x,v.strictNumbers),()=>f.assign(B,x)));f.if(a._`${B} !== undefined`);for(let N of T)if(m.has(N)||N==="array"&&v.coerceTypes==="array")_(N);f.else(),d(y),f.endIf(),f.if(a._`${B} !== undefined`,()=>{f.assign(x,B),k(y,B)});function _(N){switch(N){case"string":f.elseIf(a._`${F} == "number" || ${F} == "boolean"`).assign(B,a._`"" + ${x}`).elseIf(a._`${x} === null`).assign(B,a._`""`);return;case"number":f.elseIf(a._`${F} == "boolean" || ${x} === null
4
+ || (${F} == "string" && ${x} && ${x} == +${x})`).assign(B,a._`+${x}`);return;case"integer":f.elseIf(a._`${F} === "boolean" || ${x} === null
5
+ || (${F} === "string" && ${x} && ${x} == +${x} && !(${x} % 1))`).assign(B,a._`+${x}`);return;case"boolean":f.elseIf(a._`${x} === "false" || ${x} === 0 || ${x} === null`).assign(B,!1).elseIf(a._`${x} === "true" || ${x} === 1`).assign(B,!0);return;case"null":f.elseIf(a._`${x} === "" || ${x} === 0 || ${x} === false`),f.assign(B,null);return;case"array":f.elseIf(a._`${F} === "string" || ${F} === "number"
6
+ || ${F} === "boolean" || ${x} === null`).assign(B,a._`[${x}]`)}}}function k({gen:y,parentData:l,parentDataProperty:T},f){y.if(a._`${l} !== undefined`,()=>y.assign(a._`${l}[${T}]`,f))}function C(y,l,T,f=i.Correct){let x=f===i.Correct?a.operators.EQ:a.operators.NEQ,v;switch(y){case"null":return a._`${l} ${x} null`;case"array":v=a._`Array.isArray(${l})`;break;case"object":v=a._`${l} && typeof ${l} == "object" && !Array.isArray(${l})`;break;case"integer":v=F(a._`!(${l} % 1) && !isNaN(${l})`);break;case"number":v=F();break;default:return a._`typeof ${l} ${x} ${y}`}return f===i.Correct?v:(0,a.not)(v);function F(B=a.nil){return(0,a.and)(a._`typeof ${l} == "number"`,B,T?a._`isFinite(${l})`:a.nil)}}t.checkDataType=C;function I(y,l,T,f){if(y.length===1)return C(y[0],l,T,f);let x,v=(0,n.toHash)(y);if(v.array&&v.object){let F=a._`typeof ${l} != "object"`;x=v.null?F:a._`!${l} || ${F}`,delete v.null,delete v.array,delete v.object}else x=a.nil;if(v.number)delete v.integer;for(let F in v)x=(0,a.and)(x,C(F,l,T,f));return x}t.checkDataTypes=I;var R={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:l})=>typeof y=="string"?a._`{type: ${y}}`:a._`{type: ${l}}`};function d(y){let l=E(y);(0,r.reportError)(l,R)}t.reportTypeError=d;function E(y){let{gen:l,data:T,schema:f}=y,x=(0,n.schemaRefOrVal)(y,f,"type");return{gen:l,keyword:"type",data:T,schema:f.type,schemaCode:x,schemaValue:x,parentSchema:f,params:{},it:y}}}),u4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=pt(),s=xt();function r(n,i){let{properties:h,items:o}=n.schema;if(i==="object"&&h)for(let c in h)a(n,c,h[c].default);else if(i==="array"&&Array.isArray(o))o.forEach((c,m)=>a(n,m,c.default))}t.assignDefaults=r;function a(n,i,h){let{gen:o,compositeRule:c,data:m,opts:u}=n;if(h===void 0)return;let p=e._`${m}${(0,e.getProperty)(i)}`;if(c){(0,s.checkStrictMode)(n,`default is ignored for: ${p}`);return}let k=e._`${p} === undefined`;if(u.useDefaults==="empty")k=e._`${k} || ${p} === null || ${p} === ""`;o.if(k,e._`${p} = ${(0,e.stringify)(h)}`)}}),Z0=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;var e=pt(),s=xt(),r=$0(),a=xt();function n(y,l){let{gen:T,data:f,it:x}=y;T.if(u(T,f,l,x.opts.ownProperties),()=>{y.setParams({missingProperty:e._`${l}`},!0),y.error()})}t.checkReportMissingProp=n;function i({gen:y,data:l,it:{opts:T}},f,x){return(0,e.or)(...f.map((v)=>(0,e.and)(u(y,l,v,T.ownProperties),e._`${x} = ${v}`)))}t.checkMissingProp=i;function h(y,l){y.setParams({missingProperty:l},!0),y.error()}t.reportMissingProp=h;function o(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}t.hasPropFunc=o;function c(y,l,T){return e._`${o(y)}.call(${l}, ${T})`}t.isOwnProperty=c;function m(y,l,T,f){let x=e._`${l}${(0,e.getProperty)(T)} !== undefined`;return f?e._`${x} && ${c(y,l,T)}`:x}t.propertyInData=m;function u(y,l,T,f){let x=e._`${l}${(0,e.getProperty)(T)} === undefined`;return f?(0,e.or)(x,(0,e.not)(c(y,l,T))):x}t.noPropertyInData=u;function p(y){return y?Object.keys(y).filter((l)=>l!=="__proto__"):[]}t.allSchemaProperties=p;function k(y,l){return p(l).filter((T)=>!(0,s.alwaysValidSchema)(y,l[T]))}t.schemaProperties=k;function C({schemaCode:y,data:l,it:{gen:T,topSchemaRef:f,schemaPath:x,errorPath:v},it:F},B,_,N){let O=N?e._`${y}, ${l}, ${f}${x}`:l,z=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,v)],[r.default.parentData,F.parentData],[r.default.parentDataProperty,F.parentDataProperty],[r.default.rootData,r.default.rootData]];if(F.opts.dynamicRef)z.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let K=e._`${O}, ${T.object(...z)}`;return _!==e.nil?e._`${B}.call(${_}, ${K})`:e._`${B}(${K})`}t.callValidateCode=C;var I=e._`new RegExp`;function R({gen:y,it:{opts:l}},T){let f=l.unicodeRegExp?"u":"",{regExp:x}=l.code,v=x(T,f);return y.scopeValue("pattern",{key:v.toString(),ref:v,code:e._`${x.code==="new RegExp"?I:(0,a.useFunc)(y,x)}(${T}, ${f})`})}t.usePattern=R;function d(y){let{gen:l,data:T,keyword:f,it:x}=y,v=l.name("valid");if(x.allErrors){let B=l.let("valid",!0);return F(()=>l.assign(B,!1)),B}return l.var(v,!0),F(()=>l.break()),v;function F(B){let _=l.const("len",e._`${T}.length`);l.forRange("i",0,_,(N)=>{y.subschema({keyword:f,dataProp:N,dataPropType:s.Type.Num},v),l.if((0,e.not)(v),B)})}}t.validateArray=d;function E(y){let{gen:l,schema:T,keyword:f,it:x}=y;if(!Array.isArray(T))throw Error("ajv implementation error");if(T.some((B)=>(0,s.alwaysValidSchema)(x,B))&&!x.opts.unevaluated)return;let v=l.let("valid",!1),F=l.name("_valid");l.block(()=>T.forEach((B,_)=>{let N=y.subschema({keyword:f,schemaProp:_,compositeRule:!0},F);if(l.assign(v,e._`${v} || ${F}`),!y.mergeValidEvaluated(N,F))l.if((0,e.not)(v))})),y.result(v,()=>y.reset(),()=>y.error(!0))}t.validateUnion=E}),S4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=pt(),s=$0(),r=Z0(),a=Os();function n(k,C){let{gen:I,keyword:R,schema:d,parentSchema:E,it:y}=k,l=C.macro.call(y.self,d,E,y),T=m(I,R,l);if(y.opts.validateSchema!==!1)y.self.validateSchema(l,!0);let f=I.name("valid");k.subschema({schema:l,schemaPath:e.nil,errSchemaPath:`${y.errSchemaPath}/${R}`,topSchemaRef:T,compositeRule:!0},f),k.pass(f,()=>k.error(!0))}t.macroKeywordCode=n;function i(k,C){var I;let{gen:R,keyword:d,schema:E,parentSchema:y,$data:l,it:T}=k;c(T,C);let f=!l&&C.compile?C.compile.call(T.self,E,y,T):C.validate,x=m(R,d,f),v=R.let("valid");k.block$data(v,F),k.ok((I=C.valid)!==null&&I!==void 0?I:v);function F(){if(C.errors===!1){if(N(),C.modifying)h(k);O(()=>k.error())}else{let z=C.async?B():_();if(C.modifying)h(k);O(()=>o(k,z))}}function B(){let z=R.let("ruleErrs",null);return R.try(()=>N(e._`await `),(K)=>R.assign(v,!1).if(e._`${K} instanceof ${T.ValidationError}`,()=>R.assign(z,e._`${K}.errors`),()=>R.throw(K))),z}function _(){let z=e._`${x}.errors`;return R.assign(z,null),N(e.nil),z}function N(z=C.async?e._`await `:e.nil){let K=T.opts.passContext?s.default.this:s.default.self,Mt=!(("compile"in C)&&!l||C.schema===!1);R.assign(v,e._`${z}${(0,r.callValidateCode)(k,x,K,Mt)}`,C.modifying)}function O(z){var K;R.if((0,e.not)((K=C.valid)!==null&&K!==void 0?K:v),z)}}t.funcKeywordCode=i;function h(k){let{gen:C,data:I,it:R}=k;C.if(R.parentData,()=>C.assign(I,e._`${R.parentData}[${R.parentDataProperty}]`))}function o(k,C){let{gen:I}=k;I.if(e._`Array.isArray(${C})`,()=>{I.assign(s.default.vErrors,e._`${s.default.vErrors} === null ? ${C} : ${s.default.vErrors}.concat(${C})`).assign(s.default.errors,e._`${s.default.vErrors}.length`),(0,a.extendErrors)(k)},()=>k.error())}function c({schemaEnv:k},C){if(C.async&&!k.$async)throw Error("async keyword in sync schema")}function m(k,C,I){if(I===void 0)throw Error(`keyword "${C}" failed to compile`);return k.scopeValue("keyword",typeof I=="function"?{ref:I}:{ref:I,code:(0,e.stringify)(I)})}function u(k,C,I=!1){return!C.length||C.some((R)=>R==="array"?Array.isArray(k):R==="object"?k&&typeof k=="object"&&!Array.isArray(k):typeof k==R||I&&typeof k>"u")}t.validSchemaType=u;function p({schema:k,opts:C,self:I,errSchemaPath:R},d,E){if(Array.isArray(d.keyword)?!d.keyword.includes(E):d.keyword!==E)throw Error("ajv implementation error");let y=d.dependencies;if(y===null||y===void 0?void 0:y.some((l)=>!Object.prototype.hasOwnProperty.call(k,l)))throw Error(`parent schema must have dependencies of ${E}: ${y.join(",")}`);if(d.validateSchema){if(!d.validateSchema(k[E])){let l=`keyword "${E}" value is invalid at path "${R}": `+I.errorsText(d.validateSchema.errors);if(C.validateSchema==="log")I.logger.error(l);else throw Error(l)}}}t.validateKeywordUsage=p}),f4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=pt(),s=xt();function r(i,{keyword:h,schemaProp:o,schema:c,schemaPath:m,errSchemaPath:u,topSchemaRef:p}){if(h!==void 0&&c!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(h!==void 0){let k=i.schema[h];return o===void 0?{schema:k,schemaPath:e._`${i.schemaPath}${(0,e.getProperty)(h)}`,errSchemaPath:`${i.errSchemaPath}/${h}`}:{schema:k[o],schemaPath:e._`${i.schemaPath}${(0,e.getProperty)(h)}${(0,e.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${h}/${(0,s.escapeFragment)(o)}`}}if(c!==void 0){if(m===void 0||u===void 0||p===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:m,topSchemaRef:p,errSchemaPath:u}}throw Error('either "keyword" or "schema" must be passed')}t.getSubschema=r;function a(i,h,{dataProp:o,dataPropType:c,data:m,dataTypes:u,propertyName:p}){if(m!==void 0&&o!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:k}=h;if(o!==void 0){let{errorPath:I,dataPathArr:R,opts:d}=h,E=k.let("data",e._`${h.data}${(0,e.getProperty)(o)}`,!0);C(E),i.errorPath=e.str`${I}${(0,s.getErrorPath)(o,c,d.jsPropertySyntax)}`,i.parentDataProperty=e._`${o}`,i.dataPathArr=[...R,i.parentDataProperty]}if(m!==void 0){let I=m instanceof e.Name?m:k.let("data",m,!0);if(C(I),p!==void 0)i.propertyName=p}if(u)i.dataTypes=u;function C(I){i.data=I,i.dataLevel=h.dataLevel+1,i.dataTypes=[],h.definedProperties=new Set,i.parentData=h.data,i.dataNames=[...h.dataNames,I]}}t.extendSubschemaData=a;function n(i,{jtdDiscriminator:h,jtdMetadata:o,compositeRule:c,createErrors:m,allErrors:u}){if(c!==void 0)i.compositeRule=c;if(m!==void 0)i.createErrors=m;if(u!==void 0)i.allErrors=u;i.jtdDiscriminator=h,i.jtdMetadata=o}t.extendSubschemaMode=n}),Dh=W((t,e)=>{e.exports=function s(r,a){if(r===a)return!0;if(r&&a&&typeof r=="object"&&typeof a=="object"){if(r.constructor!==a.constructor)return!1;var n,i,h;if(Array.isArray(r)){if(n=r.length,n!=a.length)return!1;for(i=n;i--!==0;)if(!s(r[i],a[i]))return!1;return!0}if(r.constructor===RegExp)return r.source===a.source&&r.flags===a.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===a.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===a.toString();if(h=Object.keys(r),n=h.length,n!==Object.keys(a).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(a,h[i]))return!1;for(i=n;i--!==0;){var o=h[i];if(!s(r[o],a[o]))return!1}return!0}return r!==r&&a!==a}}),T4=W((t,e)=>{var s=e.exports=function(n,i,h){if(typeof i=="function")h=i,i={};h=i.cb||h;var o=typeof h=="function"?h:h.pre||function(){},c=h.post||function(){};r(i,o,c,n,"",n)};s.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},s.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},s.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},s.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(n,i,h,o,c,m,u,p,k,C){if(o&&typeof o=="object"&&!Array.isArray(o)){i(o,c,m,u,p,k,C);for(var I in o){var R=o[I];if(Array.isArray(R)){if(I in s.arrayKeywords)for(var d=0;d<R.length;d++)r(n,i,h,R[d],c+"/"+I+"/"+d,m,c,I,o,d)}else if(I in s.propsKeywords){if(R&&typeof R=="object")for(var E in R)r(n,i,h,R[E],c+"/"+I+"/"+a(E),m,c,I,o,E)}else if(I in s.keywords||n.allKeys&&!(I in s.skipKeywords))r(n,i,h,R,c+"/"+I,m,c,I,o)}h(o,c,m,u,p,k,C)}}function a(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}}),Us=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=xt(),s=Dh(),r=T4(),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function n(R,d=!0){if(typeof R=="boolean")return!0;if(d===!0)return!h(R);if(!d)return!1;return o(R)<=d}t.inlineRef=n;var i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function h(R){for(let d in R){if(i.has(d))return!0;let E=R[d];if(Array.isArray(E)&&E.some(h))return!0;if(typeof E=="object"&&h(E))return!0}return!1}function o(R){let d=0;for(let E in R){if(E==="$ref")return 1/0;if(d++,a.has(E))continue;if(typeof R[E]=="object")(0,e.eachItem)(R[E],(y)=>d+=o(y));if(d===1/0)return 1/0}return d}function c(R,d="",E){if(E!==!1)d=p(d);let y=R.parse(d);return m(R,y)}t.getFullPath=c;function m(R,d){return R.serialize(d).split("#")[0]+"#"}t._getFullPath=m;var u=/#\/?$/;function p(R){return R?R.replace(u,""):""}t.normalizeId=p;function k(R,d,E){return E=p(E),R.resolve(d,E)}t.resolveUrl=k;var C=/^[a-z_][-a-z0-9._]*$/i;function I(R,d){if(typeof R=="boolean")return{};let{schemaId:E,uriResolver:y}=this.opts,l=p(R[E]||d),T={"":l},f=c(y,l,!1),x={},v=new Set;return r(R,{allKeys:!0},(_,N,O,z)=>{if(z===void 0)return;let K=f+N,Mt=T[z];if(typeof _[E]=="string")Mt=Ht.call(this,_[E]);Ot.call(this,_.$anchor),Ot.call(this,_.$dynamicAnchor),T[N]=Mt;function Ht(St){let A=this.opts.uriResolver.resolve;if(St=p(Mt?A(Mt,St):St),v.has(St))throw B(St);v.add(St);let L=this.refs[St];if(typeof L=="string")L=this.refs[L];if(typeof L=="object")F(_,L.schema,St);else if(St!==p(K))if(St[0]==="#")F(_,x[St],St),x[St]=_;else this.refs[St]=K;return St}function Ot(St){if(typeof St=="string"){if(!C.test(St))throw Error(`invalid anchor "${St}"`);Ht.call(this,`#${St}`)}}}),x;function F(_,N,O){if(N!==void 0&&!s(_,N))throw B(O)}function B(_){return Error(`reference "${_}" resolves to more than one schema`)}}t.getSchemaRefs=I}),Gs=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=E4(),s=Ts(),r=_h(),a=Ts(),n=u4(),i=S4(),h=f4(),o=pt(),c=$0(),m=Us(),u=xt(),p=Os();function k(g){if(f(g)){if(v(g),T(g)){d(g);return}}C(g,()=>(0,e.topBoolOrEmptySchema)(g))}t.validateFunctionCode=k;function C({gen:g,validateName:j,schema:D,schemaEnv:et,opts:st},lt){if(st.code.es5)g.func(j,o._`${c.default.data}, ${c.default.valCxt}`,et.$async,()=>{g.code(o._`"use strict"; ${y(D,st)}`),R(g,st),g.code(lt)});else g.func(j,o._`${c.default.data}, ${I(st)}`,et.$async,()=>g.code(y(D,st)).code(lt))}function I(g){return o._`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${g.dynamicRef?o._`, ${c.default.dynamicAnchors}={}`:o.nil}}={}`}function R(g,j){g.if(c.default.valCxt,()=>{if(g.var(c.default.instancePath,o._`${c.default.valCxt}.${c.default.instancePath}`),g.var(c.default.parentData,o._`${c.default.valCxt}.${c.default.parentData}`),g.var(c.default.parentDataProperty,o._`${c.default.valCxt}.${c.default.parentDataProperty}`),g.var(c.default.rootData,o._`${c.default.valCxt}.${c.default.rootData}`),j.dynamicRef)g.var(c.default.dynamicAnchors,o._`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{if(g.var(c.default.instancePath,o._`""`),g.var(c.default.parentData,o._`undefined`),g.var(c.default.parentDataProperty,o._`undefined`),g.var(c.default.rootData,c.default.data),j.dynamicRef)g.var(c.default.dynamicAnchors,o._`{}`)})}function d(g){let{schema:j,opts:D,gen:et}=g;C(g,()=>{if(D.$comment&&j.$comment)z(g);if(_(g),et.let(c.default.vErrors,null),et.let(c.default.errors,0),D.unevaluated)E(g);F(g),K(g)});return}function E(g){let{gen:j,validateName:D}=g;g.evaluated=j.const("evaluated",o._`${D}.evaluated`),j.if(o._`${g.evaluated}.dynamicProps`,()=>j.assign(o._`${g.evaluated}.props`,o._`undefined`)),j.if(o._`${g.evaluated}.dynamicItems`,()=>j.assign(o._`${g.evaluated}.items`,o._`undefined`))}function y(g,j){let D=typeof g=="object"&&g[j.schemaId];return D&&(j.code.source||j.code.process)?o._`/*# sourceURL=${D} */`:o.nil}function l(g,j){if(f(g)){if(v(g),T(g)){x(g,j);return}}(0,e.boolOrEmptySchema)(g,j)}function T({schema:g,self:j}){if(typeof g=="boolean")return!g;for(let D in g)if(j.RULES.all[D])return!0;return!1}function f(g){return typeof g.schema!="boolean"}function x(g,j){let{schema:D,gen:et,opts:st}=g;if(st.$comment&&D.$comment)z(g);N(g),O(g);let lt=et.const("_errs",c.default.errors);F(g,lt),et.var(j,o._`${lt} === ${c.default.errors}`)}function v(g){(0,u.checkUnknownRules)(g),B(g)}function F(g,j){if(g.opts.jtd)return Ht(g,[],!1,j);let D=(0,s.getSchemaTypes)(g.schema),et=(0,s.coerceAndCheckDataType)(g,D);Ht(g,D,!et,j)}function B(g){let{schema:j,errSchemaPath:D,opts:et,self:st}=g;if(j.$ref&&et.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(j,st.RULES))st.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function _(g){let{schema:j,opts:D}=g;if(j.default!==void 0&&D.useDefaults&&D.strictSchema)(0,u.checkStrictMode)(g,"default is ignored in the schema root")}function N(g){let j=g.schema[g.opts.schemaId];if(j)g.baseId=(0,m.resolveUrl)(g.opts.uriResolver,g.baseId,j)}function O(g){if(g.schema.$async&&!g.schemaEnv.$async)throw Error("async schema in sync schema")}function z({gen:g,schemaEnv:j,schema:D,errSchemaPath:et,opts:st}){let lt=D.$comment;if(st.$comment===!0)g.code(o._`${c.default.self}.logger.log(${lt})`);else if(typeof st.$comment=="function"){let Gt=o.str`${et}/$comment`,Xt=g.scopeValue("root",{ref:j.root});g.code(o._`${c.default.self}.opts.$comment(${lt}, ${Gt}, ${Xt}.schema)`)}}function K(g){let{gen:j,schemaEnv:D,validateName:et,ValidationError:st,opts:lt}=g;if(D.$async)j.if(o._`${c.default.errors} === 0`,()=>j.return(c.default.data),()=>j.throw(o._`new ${st}(${c.default.vErrors})`));else{if(j.assign(o._`${et}.errors`,c.default.vErrors),lt.unevaluated)Mt(g);j.return(o._`${c.default.errors} === 0`)}}function Mt({gen:g,evaluated:j,props:D,items:et}){if(D instanceof o.Name)g.assign(o._`${j}.props`,D);if(et instanceof o.Name)g.assign(o._`${j}.items`,et)}function Ht(g,j,D,et){let{gen:st,schema:lt,data:Gt,allErrors:Xt,opts:Ut,self:Wt}=g,{RULES:Vt}=Wt;if(lt.$ref&&(Ut.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(lt,Vt))){st.block(()=>ut(g,"$ref",Vt.all.$ref.definition));return}if(!Ut.jtd)St(g,j);st.block(()=>{for(let t0 of Vt.rules)l0(t0);l0(Vt.post)});function l0(t0){if(!(0,r.shouldUseGroup)(lt,t0))return;if(t0.type){if(st.if((0,a.checkDataType)(t0.type,Gt,Ut.strictNumbers)),Ot(g,t0),j.length===1&&j[0]===t0.type&&D)st.else(),(0,a.reportTypeError)(g);st.endIf()}else Ot(g,t0);if(!Xt)st.if(o._`${c.default.errors} === ${et||0}`)}}function Ot(g,j){let{gen:D,schema:et,opts:{useDefaults:st}}=g;if(st)(0,n.assignDefaults)(g,j.type);D.block(()=>{for(let lt of j.rules)if((0,r.shouldUseRule)(et,lt))ut(g,lt.keyword,lt.definition,j.type)})}function St(g,j){if(g.schemaEnv.meta||!g.opts.strictTypes)return;if(A(g,j),!g.opts.allowUnionTypes)L(g,j);V(g,g.dataTypes)}function A(g,j){if(!j.length)return;if(!g.dataTypes.length){g.dataTypes=j;return}j.forEach((D)=>{if(!b(g.dataTypes,D))X(g,`type "${D}" not allowed by context "${g.dataTypes.join(",")}"`)}),P(g,j)}function L(g,j){if(j.length>1&&!(j.length===2&&j.includes("null")))X(g,"use allowUnionTypes to allow union type keyword")}function V(g,j){let D=g.self.RULES.all;for(let et in D){let st=D[et];if(typeof st=="object"&&(0,r.shouldUseRule)(g.schema,st)){let{type:lt}=st.definition;if(lt.length&&!lt.some((Gt)=>S(j,Gt)))X(g,`missing type "${lt.join(",")}" for keyword "${et}"`)}}}function S(g,j){return g.includes(j)||j==="number"&&g.includes("integer")}function b(g,j){return g.includes(j)||j==="integer"&&g.includes("number")}function P(g,j){let D=[];for(let et of g.dataTypes)if(b(j,et))D.push(et);else if(j.includes("integer")&&et==="number")D.push("integer");g.dataTypes=D}function X(g,j){let D=g.schemaEnv.baseId+g.errSchemaPath;j+=` at "${D}" (strictTypes)`,(0,u.checkStrictMode)(g,j,g.opts.strictTypes)}class at{constructor(g,j,D){if((0,i.validateKeywordUsage)(g,j,D),this.gen=g.gen,this.allErrors=g.allErrors,this.keyword=D,this.data=g.data,this.schema=g.schema[D],this.$data=j.$data&&g.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(g,this.schema,D,this.$data),this.schemaType=j.schemaType,this.parentSchema=g.schema,this.params={},this.it=g,this.def=j,this.$data)this.schemaCode=g.gen.const("vSchema",C0(this.$data,g));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,j.schemaType,j.allowUndefined))throw Error(`${D} value must be ${JSON.stringify(j.schemaType)}`);if("code"in j?j.trackErrors:j.errors!==!1)this.errsCount=g.gen.const("_errs",c.default.errors)}result(g,j,D){this.failResult((0,o.not)(g),j,D)}failResult(g,j,D){if(this.gen.if(g),D)D();else this.error();if(j){if(this.gen.else(),j(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(g,j){this.failResult((0,o.not)(g),void 0,j)}fail(g){if(g===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(g),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(g){if(!this.$data)return this.fail(g);let{schemaCode:j}=this;this.fail(o._`${j} !== undefined && (${(0,o.or)(this.invalid$data(),g)})`)}error(g,j,D){if(j){this.setParams(j),this._error(g,D),this.setParams({});return}this._error(g,D)}_error(g,j){(g?p.reportExtraError:p.reportError)(this,this.def.error,j)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(g){if(!this.allErrors)this.gen.if(g)}setParams(g,j){if(j)Object.assign(this.params,g);else this.params=g}block$data(g,j,D=o.nil){this.gen.block(()=>{this.check$data(g,D),j()})}check$data(g=o.nil,j=o.nil){if(!this.$data)return;let{gen:D,schemaCode:et,schemaType:st,def:lt}=this;if(D.if((0,o.or)(o._`${et} === undefined`,j)),g!==o.nil)D.assign(g,!0);if(st.length||lt.validateSchema){if(D.elseIf(this.invalid$data()),this.$dataError(),g!==o.nil)D.assign(g,!1)}D.else()}invalid$data(){let{gen:g,schemaCode:j,schemaType:D,def:et,it:st}=this;return(0,o.or)(lt(),Gt());function lt(){if(D.length){if(!(j instanceof o.Name))throw Error("ajv implementation error");let Xt=Array.isArray(D)?D:[D];return o._`${(0,a.checkDataTypes)(Xt,j,st.opts.strictNumbers,a.DataType.Wrong)}`}return o.nil}function Gt(){if(et.validateSchema){let Xt=g.scopeValue("validate$data",{ref:et.validateSchema});return o._`!${Xt}(${j})`}return o.nil}}subschema(g,j){let D=(0,h.getSubschema)(this.it,g);(0,h.extendSubschemaData)(D,this.it,g),(0,h.extendSubschemaMode)(D,g);let et={...this.it,...D,items:void 0,props:void 0};return l(et,j),et}mergeEvaluated(g,j){let{it:D,gen:et}=this;if(!D.opts.unevaluated)return;if(D.props!==!0&&g.props!==void 0)D.props=u.mergeEvaluated.props(et,g.props,D.props,j);if(D.items!==!0&&g.items!==void 0)D.items=u.mergeEvaluated.items(et,g.items,D.items,j)}mergeValidEvaluated(g,j){let{it:D,gen:et}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return et.if(j,()=>this.mergeEvaluated(g,o.Name)),!0}}t.KeywordCxt=at;function ut(g,j,D,et){let st=new at(g,D,j);if("code"in D)D.code(st,et);else if(st.$data&&D.validate)(0,i.funcKeywordCode)(st,D);else if("macro"in D)(0,i.macroKeywordCode)(st,D);else if(D.compile||D.validate)(0,i.funcKeywordCode)(st,D)}var rt=/^\/(?:[^~]|~0|~1)*$/,Pt=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function C0(g,{dataLevel:j,dataNames:D,dataPathArr:et}){let st,lt;if(g==="")return c.default.rootData;if(g[0]==="/"){if(!rt.test(g))throw Error(`Invalid JSON-pointer: ${g}`);st=g,lt=c.default.rootData}else{let Wt=Pt.exec(g);if(!Wt)throw Error(`Invalid JSON-pointer: ${g}`);let Vt=+Wt[1];if(st=Wt[2],st==="#"){if(Vt>=j)throw Error(Ut("property/index",Vt));return et[j-Vt]}if(Vt>j)throw Error(Ut("data",Vt));if(lt=D[j-Vt],!st)return lt}let Gt=lt,Xt=st.split("/");for(let Wt of Xt)if(Wt)lt=o._`${lt}${(0,o.getProperty)((0,u.unescapeJsonPointer)(Wt))}`,Gt=o._`${Gt} && ${lt}`;return Gt;function Ut(Wt,Vt){return`Cannot access ${Wt} ${Vt} levels up, current level is ${j}`}}t.getData=C0}),Jr=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});class e extends Error{constructor(s){super("validation failed");this.errors=s,this.ajv=this.validation=!0}}t.default=e}),Ws=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Us();class s extends Error{constructor(r,a,n,i){super(i||`can't resolve reference ${n} from id ${a}`);this.missingRef=(0,e.resolveUrl)(r,a,n),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}t.default=s}),Yr=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=pt(),s=Jr(),r=$0(),a=Us(),n=xt(),i=Gs();class h{constructor(d){var E;this.refs={},this.dynamicAnchors={};let y;if(typeof d.schema=="object")y=d.schema;this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(E=d.baseId)!==null&&E!==void 0?E:(0,a.normalizeId)(y===null||y===void 0?void 0:y[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=y===null||y===void 0?void 0:y.$async,this.refs={}}}t.SchemaEnv=h;function o(d){let E=u.call(this,d);if(E)return E;let y=(0,a.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:l,lines:T}=this.opts.code,{ownProperties:f}=this.opts,x=new e.CodeGen(this.scope,{es5:l,lines:T,ownProperties:f}),v;if(d.$async)v=x.scopeValue("Error",{ref:s.default,code:e._`require("ajv/dist/runtime/validation_error").default`});let F=x.scopeName("validate");d.validateName=F;let B={gen:x,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",this.opts.code.source===!0?{ref:d.schema,code:(0,e.stringify)(d.schema)}:{ref:d.schema}),validateName:F,ValidationError:v,schema:d.schema,schemaEnv:d,rootId:y,baseId:d.baseId||y,schemaPath:e.nil,errSchemaPath:d.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},_;try{this._compilations.add(d),(0,i.validateFunctionCode)(B),x.optimize(this.opts.code.optimize);let N=x.toString();if(_=`${x.scopeRefs(r.default.scope)}return ${N}`,this.opts.code.process)_=this.opts.code.process(_,d);let O=Function(`${r.default.self}`,`${r.default.scope}`,_)(this,this.scope.get());if(this.scope.value(F,{ref:O}),O.errors=null,O.schema=d.schema,O.schemaEnv=d,d.$async)O.$async=!0;if(this.opts.code.source===!0)O.source={validateName:F,validateCode:N,scopeValues:x._values};if(this.opts.unevaluated){let{props:z,items:K}=B;if(O.evaluated={props:z instanceof e.Name?void 0:z,items:K instanceof e.Name?void 0:K,dynamicProps:z instanceof e.Name,dynamicItems:K instanceof e.Name},O.source)O.source.evaluated=(0,e.stringify)(O.evaluated)}return d.validate=O,d}catch(N){if(delete d.validate,delete d.validateName,_)this.logger.error("Error compiling schema, function code:",_);throw N}finally{this._compilations.delete(d)}}t.compileSchema=o;function c(d,E,y){var l;y=(0,a.resolveUrl)(this.opts.uriResolver,E,y);let T=d.refs[y];if(T)return T;let f=k.call(this,d,y);if(f===void 0){let x=(l=d.localRefs)===null||l===void 0?void 0:l[y],{schemaId:v}=this.opts;if(x)f=new h({schema:x,schemaId:v,root:d,baseId:E})}if(f===void 0)return;return d.refs[y]=m.call(this,f)}t.resolveRef=c;function m(d){if((0,a.inlineRef)(d.schema,this.opts.inlineRefs))return d.schema;return d.validate?d:o.call(this,d)}function u(d){for(let E of this._compilations)if(p(E,d))return E}t.getCompilingSchema=u;function p(d,E){return d.schema===E.schema&&d.root===E.root&&d.baseId===E.baseId}function k(d,E){let y;while(typeof(y=this.refs[E])=="string")E=y;return y||this.schemas[E]||C.call(this,d,E)}function C(d,E){let y=this.opts.uriResolver.parse(E),l=(0,a._getFullPath)(this.opts.uriResolver,y),T=(0,a.getFullPath)(this.opts.uriResolver,d.baseId,void 0);if(Object.keys(d.schema).length>0&&l===T)return R.call(this,y,d);let f=(0,a.normalizeId)(l),x=this.refs[f]||this.schemas[f];if(typeof x=="string"){let v=C.call(this,d,x);if(typeof(v===null||v===void 0?void 0:v.schema)!=="object")return;return R.call(this,y,v)}if(typeof(x===null||x===void 0?void 0:x.schema)!=="object")return;if(!x.validate)o.call(this,x);if(f===(0,a.normalizeId)(E)){let{schema:v}=x,{schemaId:F}=this.opts,B=v[F];if(B)T=(0,a.resolveUrl)(this.opts.uriResolver,T,B);return new h({schema:v,schemaId:F,root:d,baseId:T})}return R.call(this,y,x)}t.resolveSchema=C;var I=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function R(d,{baseId:E,schema:y,root:l}){var T;if(((T=d.fragment)===null||T===void 0?void 0:T[0])!=="/")return;for(let v of d.fragment.slice(1).split("/")){if(typeof y==="boolean")return;let F=y[(0,n.unescapeFragment)(v)];if(F===void 0)return;y=F;let B=typeof y==="object"&&y[this.opts.schemaId];if(!I.has(v)&&B)E=(0,a.resolveUrl)(this.opts.uriResolver,E,B)}let f;if(typeof y!="boolean"&&y.$ref&&!(0,n.schemaHasRulesButRef)(y,this.RULES)){let v=(0,a.resolveUrl)(this.opts.uriResolver,E,y.$ref);f=C.call(this,l,v)}let{schemaId:x}=this.opts;if(f=f||new h({schema:y,schemaId:x,root:l,baseId:E}),f.schema!==f.root.schema)return f;return}}),k4=W((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),R4=W((t,e)=>{var s={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};e.exports={HEX:s}}),x4=W((t,e)=>{var{HEX:s}=R4(),r=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function a(d){if(c(d,".")<3)return{host:d,isIPV4:!1};let E=d.match(r)||[],[y]=E;if(y)return{host:o(y,"."),isIPV4:!0};else return{host:d,isIPV4:!1}}function n(d,E=!1){let y="",l=!0;for(let T of d){if(s[T]===void 0)return;if(T!=="0"&&l===!0)l=!1;if(!l)y+=T}if(E&&y.length===0)y="0";return y}function i(d){let E=0,y={error:!1,address:"",zone:""},l=[],T=[],f=!1,x=!1,v=!1;function F(){if(T.length){if(f===!1){let B=n(T);if(B!==void 0)l.push(B);else return y.error=!0,!1}T.length=0}return!0}for(let B=0;B<d.length;B++){let _=d[B];if(_==="["||_==="]")continue;if(_===":"){if(x===!0)v=!0;if(!F())break;if(E++,l.push(":"),E>7){y.error=!0;break}if(B-1>=0&&d[B-1]===":")x=!0;continue}else if(_==="%"){if(!F())break;f=!0}else{T.push(_);continue}}if(T.length)if(f)y.zone=T.join("");else if(v)l.push(T.join(""));else l.push(n(T));return y.address=l.join(""),y}function h(d){if(c(d,":")<2)return{host:d,isIPV6:!1};let E=i(d);if(!E.error){let{address:y,address:l}=E;if(E.zone)y+="%"+E.zone,l+="%25"+E.zone;return{host:y,escapedHost:l,isIPV6:!0}}else return{host:d,isIPV6:!1}}function o(d,E){let y="",l=!0,T=d.length;for(let f=0;f<T;f++){let x=d[f];if(x==="0"&&l){if(f+1<=T&&d[f+1]===E||f+1===T)y+=x,l=!1}else{if(x===E)l=!0;else l=!1;y+=x}}return y}function c(d,E){let y=0;for(let l=0;l<d.length;l++)if(d[l]===E)y++;return y}var m=/^\.\.?\//u,u=/^\/\.(?:\/|$)/u,p=/^\/\.\.(?:\/|$)/u,k=/^\/?(?:.|\n)*?(?=\/|$)/u;function C(d){let E=[];while(d.length)if(d.match(m))d=d.replace(m,"");else if(d.match(u))d=d.replace(u,"/");else if(d.match(p))d=d.replace(p,"/"),E.pop();else if(d==="."||d==="..")d="";else{let y=d.match(k);if(y){let l=y[0];d=d.slice(l.length),E.push(l)}else throw Error("Unexpected dot segment condition")}return E.join("")}function I(d,E){let y=E!==!0?escape:unescape;if(d.scheme!==void 0)d.scheme=y(d.scheme);if(d.userinfo!==void 0)d.userinfo=y(d.userinfo);if(d.host!==void 0)d.host=y(d.host);if(d.path!==void 0)d.path=y(d.path);if(d.query!==void 0)d.query=y(d.query);if(d.fragment!==void 0)d.fragment=y(d.fragment);return d}function R(d){let E=[];if(d.userinfo!==void 0)E.push(d.userinfo),E.push("@");if(d.host!==void 0){let y=unescape(d.host),l=a(y);if(l.isIPV4)y=l.host;else{let T=h(l.host);if(T.isIPV6===!0)y=`[${T.escapedHost}]`;else y=d.host}E.push(y)}if(typeof d.port==="number"||typeof d.port==="string")E.push(":"),E.push(String(d.port));return E.length?E.join(""):void 0}e.exports={recomposeAuthority:R,normalizeComponentEncoding:I,removeDotSegments:C,normalizeIPv4:a,normalizeIPv6:h,stringArrayToHexStripped:n}}),C4=W((t,e)=>{var s=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function a(l){return typeof l.secure==="boolean"?l.secure:String(l.scheme).toLowerCase()==="wss"}function n(l){if(!l.host)l.error=l.error||"HTTP URIs must have a host.";return l}function i(l){let T=String(l.scheme).toLowerCase()==="https";if(l.port===(T?443:80)||l.port==="")l.port=void 0;if(!l.path)l.path="/";return l}function h(l){return l.secure=a(l),l.resourceName=(l.path||"/")+(l.query?"?"+l.query:""),l.path=void 0,l.query=void 0,l}function o(l){if(l.port===(a(l)?443:80)||l.port==="")l.port=void 0;if(typeof l.secure==="boolean")l.scheme=l.secure?"wss":"ws",l.secure=void 0;if(l.resourceName){let[T,f]=l.resourceName.split("?");l.path=T&&T!=="/"?T:void 0,l.query=f,l.resourceName=void 0}return l.fragment=void 0,l}function c(l,T){if(!l.path)return l.error="URN can not be parsed",l;let f=l.path.match(r);if(f){let x=T.scheme||l.scheme||"urn";l.nid=f[1].toLowerCase(),l.nss=f[2];let v=`${x}:${T.nid||l.nid}`,F=y[v];if(l.path=void 0,F)l=F.parse(l,T)}else l.error=l.error||"URN can not be parsed.";return l}function m(l,T){let f=T.scheme||l.scheme||"urn",x=l.nid.toLowerCase(),v=`${f}:${T.nid||x}`,F=y[v];if(F)l=F.serialize(l,T);let B=l,_=l.nss;return B.path=`${x||T.nid}:${_}`,T.skipEscape=!0,B}function u(l,T){let f=l;if(f.uuid=f.nss,f.nss=void 0,!T.tolerant&&(!f.uuid||!s.test(f.uuid)))f.error=f.error||"UUID is not valid.";return f}function p(l){let T=l;return T.nss=(l.uuid||"").toLowerCase(),T}var k={scheme:"http",domainHost:!0,parse:n,serialize:i},C={scheme:"https",domainHost:k.domainHost,parse:n,serialize:i},I={scheme:"ws",domainHost:!0,parse:h,serialize:o},R={scheme:"wss",domainHost:I.domainHost,parse:I.parse,serialize:I.serialize},d={scheme:"urn",parse:c,serialize:m,skipNormalize:!0},E={scheme:"urn:uuid",parse:u,serialize:p,skipNormalize:!0},y={http:k,https:C,ws:I,wss:R,urn:d,"urn:uuid":E};e.exports=y}),I4=W((t,e)=>{var{normalizeIPv6:s,normalizeIPv4:r,removeDotSegments:a,recomposeAuthority:n,normalizeComponentEncoding:i}=x4(),h=C4();function o(E,y){if(typeof E==="string")E=p(R(E,y),y);else if(typeof E==="object")E=R(p(E,y),y);return E}function c(E,y,l){let T=Object.assign({scheme:"null"},l),f=m(R(E,T),R(y,T),T,!0);return p(f,{...T,skipEscape:!0})}function m(E,y,l,T){let f={};if(!T)E=R(p(E,l),l),y=R(p(y,l),l);if(l=l||{},!l.tolerant&&y.scheme)f.scheme=y.scheme,f.userinfo=y.userinfo,f.host=y.host,f.port=y.port,f.path=a(y.path||""),f.query=y.query;else{if(y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)f.userinfo=y.userinfo,f.host=y.host,f.port=y.port,f.path=a(y.path||""),f.query=y.query;else{if(!y.path)if(f.path=E.path,y.query!==void 0)f.query=y.query;else f.query=E.query;else{if(y.path.charAt(0)==="/")f.path=a(y.path);else{if((E.userinfo!==void 0||E.host!==void 0||E.port!==void 0)&&!E.path)f.path="/"+y.path;else if(!E.path)f.path=y.path;else f.path=E.path.slice(0,E.path.lastIndexOf("/")+1)+y.path;f.path=a(f.path)}f.query=y.query}f.userinfo=E.userinfo,f.host=E.host,f.port=E.port}f.scheme=E.scheme}return f.fragment=y.fragment,f}function u(E,y,l){if(typeof E==="string")E=unescape(E),E=p(i(R(E,l),!0),{...l,skipEscape:!0});else if(typeof E==="object")E=p(i(E,!0),{...l,skipEscape:!0});if(typeof y==="string")y=unescape(y),y=p(i(R(y,l),!0),{...l,skipEscape:!0});else if(typeof y==="object")y=p(i(y,!0),{...l,skipEscape:!0});return E.toLowerCase()===y.toLowerCase()}function p(E,y){let l={host:E.host,scheme:E.scheme,userinfo:E.userinfo,port:E.port,path:E.path,query:E.query,nid:E.nid,nss:E.nss,uuid:E.uuid,fragment:E.fragment,reference:E.reference,resourceName:E.resourceName,secure:E.secure,error:""},T=Object.assign({},y),f=[],x=h[(T.scheme||l.scheme||"").toLowerCase()];if(x&&x.serialize)x.serialize(l,T);if(l.path!==void 0)if(!T.skipEscape){if(l.path=escape(l.path),l.scheme!==void 0)l.path=l.path.split("%3A").join(":")}else l.path=unescape(l.path);if(T.reference!=="suffix"&&l.scheme)f.push(l.scheme,":");let v=n(l);if(v!==void 0){if(T.reference!=="suffix")f.push("//");if(f.push(v),l.path&&l.path.charAt(0)!=="/")f.push("/")}if(l.path!==void 0){let F=l.path;if(!T.absolutePath&&(!x||!x.absolutePath))F=a(F);if(v===void 0)F=F.replace(/^\/\//u,"/%2F");f.push(F)}if(l.query!==void 0)f.push("?",l.query);if(l.fragment!==void 0)f.push("#",l.fragment);return f.join("")}var k=Array.from({length:127},(E,y)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(y)));function C(E){let y=0;for(let l=0,T=E.length;l<T;++l)if(y=E.charCodeAt(l),y>126||k[y])return!0;return!1}var I=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function R(E,y){let l=Object.assign({},y),T={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},f=E.indexOf("%")!==-1,x=!1;if(l.reference==="suffix")E=(l.scheme?l.scheme+":":"")+"//"+E;let v=E.match(I);if(v){if(T.scheme=v[1],T.userinfo=v[3],T.host=v[4],T.port=parseInt(v[5],10),T.path=v[6]||"",T.query=v[7],T.fragment=v[8],isNaN(T.port))T.port=v[5];if(T.host){let B=r(T.host);if(B.isIPV4===!1){let _=s(B.host);T.host=_.host.toLowerCase(),x=_.isIPV6}else T.host=B.host,x=!0}if(T.scheme===void 0&&T.userinfo===void 0&&T.host===void 0&&T.port===void 0&&T.query===void 0&&!T.path)T.reference="same-document";else if(T.scheme===void 0)T.reference="relative";else if(T.fragment===void 0)T.reference="absolute";else T.reference="uri";if(l.reference&&l.reference!=="suffix"&&l.reference!==T.reference)T.error=T.error||"URI is not a "+l.reference+" reference.";let F=h[(l.scheme||T.scheme||"").toLowerCase()];if(!l.unicodeSupport&&(!F||!F.unicodeSupport)){if(T.host&&(l.domainHost||F&&F.domainHost)&&x===!1&&C(T.host))try{T.host=URL.domainToASCII(T.host.toLowerCase())}catch(B){T.error=T.error||"Host's domain name can not be converted to ASCII: "+B}}if(!F||F&&!F.skipNormalize){if(f&&T.scheme!==void 0)T.scheme=unescape(T.scheme);if(f&&T.host!==void 0)T.host=unescape(T.host);if(T.path)T.path=escape(unescape(T.path));if(T.fragment)T.fragment=encodeURI(decodeURIComponent(T.fragment))}if(F&&F.parse)F.parse(T,l)}else T.error=T.error||"URI can not be parsed.";return T}var d={SCHEMES:h,normalize:o,resolve:c,resolveComponents:m,equal:u,serialize:p,parse:R};e.exports=d,e.exports.default=d,e.exports.fastUri=d}),v4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=I4();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),g4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Gs();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var s=pt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});var r=Jr(),a=Ws(),n=qh(),i=Yr(),h=pt(),o=Us(),c=Ts(),m=xt(),u=k4(),p=v4(),k=(A,L)=>new RegExp(A,L);k.code="new RegExp";var C=["removeAdditional","useDefaults","coerceTypes"],I=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),R={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},E=200;function y(A){var L,V,S,b,P,X,at,ut,rt,Pt,C0,g,j,D,et,st,lt,Gt,Xt,Ut,Wt,Vt,l0,t0,Ge;let M0=A.strict,I0=(L=A.code)===null||L===void 0?void 0:L.optimize,We=I0===!0||I0===void 0?1:I0||0,Wa=(S=(V=A.code)===null||V===void 0?void 0:V.regExp)!==null&&S!==void 0?S:k,s4=(b=A.uriResolver)!==null&&b!==void 0?b:p.default;return{strictSchema:(X=(P=A.strictSchema)!==null&&P!==void 0?P:M0)!==null&&X!==void 0?X:!0,strictNumbers:(ut=(at=A.strictNumbers)!==null&&at!==void 0?at:M0)!==null&&ut!==void 0?ut:!0,strictTypes:(Pt=(rt=A.strictTypes)!==null&&rt!==void 0?rt:M0)!==null&&Pt!==void 0?Pt:"log",strictTuples:(g=(C0=A.strictTuples)!==null&&C0!==void 0?C0:M0)!==null&&g!==void 0?g:"log",strictRequired:(D=(j=A.strictRequired)!==null&&j!==void 0?j:M0)!==null&&D!==void 0?D:!1,code:A.code?{...A.code,optimize:We,regExp:Wa}:{optimize:We,regExp:Wa},loopRequired:(et=A.loopRequired)!==null&&et!==void 0?et:E,loopEnum:(st=A.loopEnum)!==null&&st!==void 0?st:E,meta:(lt=A.meta)!==null&&lt!==void 0?lt:!0,messages:(Gt=A.messages)!==null&&Gt!==void 0?Gt:!0,inlineRefs:(Xt=A.inlineRefs)!==null&&Xt!==void 0?Xt:!0,schemaId:(Ut=A.schemaId)!==null&&Ut!==void 0?Ut:"$id",addUsedSchema:(Wt=A.addUsedSchema)!==null&&Wt!==void 0?Wt:!0,validateSchema:(Vt=A.validateSchema)!==null&&Vt!==void 0?Vt:!0,validateFormats:(l0=A.validateFormats)!==null&&l0!==void 0?l0:!0,unicodeRegExp:(t0=A.unicodeRegExp)!==null&&t0!==void 0?t0:!0,int32range:(Ge=A.int32range)!==null&&Ge!==void 0?Ge:!0,uriResolver:s4}}class l{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,...y(A)};let{es5:L,lines:V}=this.opts.code;this.scope=new h.ValueScope({scope:{},prefixes:I,es5:L,lines:V}),this.logger=N(A.logger);let S=A.validateFormats;if(A.validateFormats=!1,this.RULES=(0,n.getRules)(),T.call(this,R,A,"NOT SUPPORTED"),T.call(this,d,A,"DEPRECATED","warn"),this._metaOpts=B.call(this),A.formats)v.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords)F.call(this,A.keywords);if(typeof A.meta=="object")this.addMetaSchema(A.meta);x.call(this),A.validateFormats=S}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:A,meta:L,schemaId:V}=this.opts,S=u;if(V==="id")S={...u},S.id=S.$id,delete S.$id;if(L&&A)this.addMetaSchema(S,S[V],!1)}defaultMeta(){let{meta:A,schemaId:L}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[L]||A:void 0}validate(A,L){let V;if(typeof A=="string"){if(V=this.getSchema(A),!V)throw Error(`no schema with key or ref "${A}"`)}else V=this.compile(A);let S=V(L);if(!("$async"in V))this.errors=V.errors;return S}compile(A,L){let V=this._addSchema(A,L);return V.validate||this._compileSchemaEnv(V)}compileAsync(A,L){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return S.call(this,A,L);async function S(rt,Pt){await b.call(this,rt.$schema);let C0=this._addSchema(rt,Pt);return C0.validate||P.call(this,C0)}async function b(rt){if(rt&&!this.getSchema(rt))await S.call(this,{$ref:rt},!0)}async function P(rt){try{return this._compileSchemaEnv(rt)}catch(Pt){if(!(Pt instanceof a.default))throw Pt;return X.call(this,Pt),await at.call(this,Pt.missingSchema),P.call(this,rt)}}function X({missingSchema:rt,missingRef:Pt}){if(this.refs[rt])throw Error(`AnySchema ${rt} is loaded but ${Pt} cannot be resolved`)}async function at(rt){let Pt=await ut.call(this,rt);if(!this.refs[rt])await b.call(this,Pt.$schema);if(!this.refs[rt])this.addSchema(Pt,rt,L)}async function ut(rt){let Pt=this._loading[rt];if(Pt)return Pt;try{return await(this._loading[rt]=V(rt))}finally{delete this._loading[rt]}}}addSchema(A,L,V,S=this.opts.validateSchema){if(Array.isArray(A)){for(let P of A)this.addSchema(P,void 0,V,S);return this}let b;if(typeof A==="object"){let{schemaId:P}=this.opts;if(b=A[P],b!==void 0&&typeof b!="string")throw Error(`schema ${P} must be string`)}return L=(0,o.normalizeId)(L||b),this._checkUnique(L),this.schemas[L]=this._addSchema(A,V,L,S,!0),this}addMetaSchema(A,L,V=this.opts.validateSchema){return this.addSchema(A,L,!0,V),this}validateSchema(A,L){if(typeof A=="boolean")return!0;let V;if(V=A.$schema,V!==void 0&&typeof V!="string")throw Error("$schema must be a string");if(V=V||this.opts.defaultMeta||this.defaultMeta(),!V)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let S=this.validate(V,A);if(!S&&L){let b="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(b);else throw Error(b)}return S}getSchema(A){let L;while(typeof(L=f.call(this,A))=="string")A=L;if(L===void 0){let{schemaId:V}=this.opts,S=new i.SchemaEnv({schema:{},schemaId:V});if(L=i.resolveSchema.call(this,S,A),!L)return;this.refs[A]=L}return L.validate||this._compileSchemaEnv(L)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let L=f.call(this,A);if(typeof L=="object")this._cache.delete(L.schema);return delete this.schemas[A],delete this.refs[A],this}case"object":{let L=A;this._cache.delete(L);let V=A[this.opts.schemaId];if(V)V=(0,o.normalizeId)(V),delete this.schemas[V],delete this.refs[V];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(let L of A)this.addKeyword(L);return this}addKeyword(A,L){let V;if(typeof A=="string"){if(V=A,typeof L=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),L.keyword=V}else if(typeof A=="object"&&L===void 0){if(L=A,V=L.keyword,Array.isArray(V)&&!V.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(z.call(this,V,L),!L)return(0,m.eachItem)(V,(b)=>K.call(this,b)),this;Ht.call(this,L);let S={...L,type:(0,c.getJSONTypes)(L.type),schemaType:(0,c.getJSONTypes)(L.schemaType)};return(0,m.eachItem)(V,S.type.length===0?(b)=>K.call(this,b,S):(b)=>S.type.forEach((P)=>K.call(this,b,S,P))),this}getKeyword(A){let L=this.RULES.all[A];return typeof L=="object"?L.definition:!!L}removeKeyword(A){let{RULES:L}=this;delete L.keywords[A],delete L.all[A];for(let V of L.rules){let S=V.rules.findIndex((b)=>b.keyword===A);if(S>=0)V.rules.splice(S,1)}return this}addFormat(A,L){if(typeof L=="string")L=new RegExp(L);return this.formats[A]=L,this}errorsText(A=this.errors,{separator:L=", ",dataVar:V="data"}={}){if(!A||A.length===0)return"No errors";return A.map((S)=>`${V}${S.instancePath} ${S.message}`).reduce((S,b)=>S+L+b)}$dataMetaSchema(A,L){let V=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(let S of L){let b=S.split("/").slice(1),P=A;for(let X of b)P=P[X];for(let X in V){let at=V[X];if(typeof at!="object")continue;let{$data:ut}=at.definition,rt=P[X];if(ut&&rt)P[X]=St(rt)}}return A}_removeAllSchemas(A,L){for(let V in A){let S=A[V];if(!L||L.test(V)){if(typeof S=="string")delete A[V];else if(S&&!S.meta)this._cache.delete(S.schema),delete A[V]}}}_addSchema(A,L,V,S=this.opts.validateSchema,b=this.opts.addUsedSchema){let P,{schemaId:X}=this.opts;if(typeof A=="object")P=A[X];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof A!="boolean")throw Error("schema must be object or boolean");let at=this._cache.get(A);if(at!==void 0)return at;V=(0,o.normalizeId)(P||V);let ut=o.getSchemaRefs.call(this,A,V);if(at=new i.SchemaEnv({schema:A,schemaId:X,meta:L,baseId:V,localRefs:ut}),this._cache.set(at.schema,at),b&&!V.startsWith("#")){if(V)this._checkUnique(V);this.refs[V]=at}if(S)this.validateSchema(A,!0);return at}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw Error(`schema with key or id "${A}" already exists`)}_compileSchemaEnv(A){if(A.meta)this._compileMetaSchema(A);else i.compileSchema.call(this,A);if(!A.validate)throw Error("ajv implementation error");return A.validate}_compileMetaSchema(A){let L=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,A)}finally{this.opts=L}}}l.ValidationError=r.default,l.MissingRefError=a.default,t.default=l;function T(A,L,V,S="error"){for(let b in A){let P=b;if(P in L)this.logger[S](`${V}: option ${b}. ${A[P]}`)}}function f(A){return A=(0,o.normalizeId)(A),this.schemas[A]||this.refs[A]}function x(){let A=this.opts.schemas;if(!A)return;if(Array.isArray(A))this.addSchema(A);else for(let L in A)this.addSchema(A[L],L)}function v(){for(let A in this.opts.formats){let L=this.opts.formats[A];if(L)this.addFormat(A,L)}}function F(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let L in A){let V=A[L];if(!V.keyword)V.keyword=L;this.addKeyword(V)}}function B(){let A={...this.opts};for(let L of C)delete A[L];return A}var _={log(){},warn(){},error(){}};function N(A){if(A===!1)return _;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw Error("logger must implement log, warn and error methods")}var O=/^[a-z_$][a-z0-9_$:-]*$/i;function z(A,L){let{RULES:V}=this;if((0,m.eachItem)(A,(S)=>{if(V.keywords[S])throw Error(`Keyword ${S} is already defined`);if(!O.test(S))throw Error(`Keyword ${S} has invalid name`)}),!L)return;if(L.$data&&!(("code"in L)||("validate"in L)))throw Error('$data keyword must have "code" or "validate" function')}function K(A,L,V){var S;let b=L===null||L===void 0?void 0:L.post;if(V&&b)throw Error('keyword with "post" flag cannot have "type"');let{RULES:P}=this,X=b?P.post:P.rules.find(({type:ut})=>ut===V);if(!X)X={type:V,rules:[]},P.rules.push(X);if(P.keywords[A]=!0,!L)return;let at={keyword:A,definition:{...L,type:(0,c.getJSONTypes)(L.type),schemaType:(0,c.getJSONTypes)(L.schemaType)}};if(L.before)Mt.call(this,X,at,L.before);else X.rules.push(at);P.all[A]=at,(S=L.implements)===null||S===void 0||S.forEach((ut)=>this.addKeyword(ut))}function Mt(A,L,V){let S=A.rules.findIndex((b)=>b.keyword===V);if(S>=0)A.rules.splice(S,0,L);else A.rules.push(L),this.logger.warn(`rule ${V} is not defined`)}function Ht(A){let{metaSchema:L}=A;if(L===void 0)return;if(A.$data&&this.opts.$data)L=St(L);A.validateSchema=this.compile(L,!0)}var Ot={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function St(A){return{anyOf:[A,Ot]}}}),b4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e}),A4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=Ws(),s=Z0(),r=pt(),a=$0(),n=Yr(),i=xt(),h={keyword:"$ref",schemaType:"string",code(m){let{gen:u,schema:p,it:k}=m,{baseId:C,schemaEnv:I,validateName:R,opts:d,self:E}=k,{root:y}=I;if((p==="#"||p==="#/")&&C===y.baseId)return T();let l=n.resolveRef.call(E,y,C,p);if(l===void 0)throw new e.default(k.opts.uriResolver,C,p);if(l instanceof n.SchemaEnv)return f(l);return x(l);function T(){if(I===y)return c(m,R,I,I.$async);let v=u.scopeValue("root",{ref:y});return c(m,r._`${v}.validate`,y,y.$async)}function f(v){let F=o(m,v);c(m,F,v,v.$async)}function x(v){let F=u.scopeValue("schema",d.code.source===!0?{ref:v,code:(0,r.stringify)(v)}:{ref:v}),B=u.name("valid"),_=m.subschema({schema:v,dataTypes:[],schemaPath:r.nil,topSchemaRef:F,errSchemaPath:p},B);m.mergeEvaluated(_),m.ok(B)}}};function o(m,u){let{gen:p}=m;return u.validate?p.scopeValue("validate",{ref:u.validate}):r._`${p.scopeValue("wrapper",{ref:u})}.validate`}t.getValidate=o;function c(m,u,p,k){let{gen:C,it:I}=m,{allErrors:R,schemaEnv:d,opts:E}=I,y=E.passContext?a.default.this:r.nil;if(k)l();else T();function l(){if(!d.$async)throw Error("async schema referenced by sync schema");let v=C.let("valid");C.try(()=>{if(C.code(r._`await ${(0,s.callValidateCode)(m,u,y)}`),x(u),!R)C.assign(v,!0)},(F)=>{if(C.if(r._`!(${F} instanceof ${I.ValidationError})`,()=>C.throw(F)),f(F),!R)C.assign(v,!1)}),m.ok(v)}function T(){m.result((0,s.callValidateCode)(m,u,y),()=>x(u),()=>f(u))}function f(v){let F=r._`${v}.errors`;C.assign(a.default.vErrors,r._`${a.default.vErrors} === null ? ${F} : ${a.default.vErrors}.concat(${F})`),C.assign(a.default.errors,r._`${a.default.vErrors}.length`)}function x(v){var F;if(!I.opts.unevaluated)return;let B=(F=p===null||p===void 0?void 0:p.validate)===null||F===void 0?void 0:F.evaluated;if(I.props!==!0)if(B&&!B.dynamicProps){if(B.props!==void 0)I.props=i.mergeEvaluated.props(C,B.props,I.props)}else{let _=C.var("props",r._`${v}.evaluated.props`);I.props=i.mergeEvaluated.props(C,_,I.props,r.Name)}if(I.items!==!0)if(B&&!B.dynamicItems){if(B.items!==void 0)I.items=i.mergeEvaluated.items(C,B.items,I.items)}else{let _=C.var("items",r._`${v}.evaluated.items`);I.items=i.mergeEvaluated.items(C,_,I.items,r.Name)}}}t.callRef=c,t.default=h}),Z4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=b4(),s=A4(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,s.default];t.default=r}),F4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=e.operators,r={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},a={message:({keyword:i,schemaCode:h})=>e.str`must be ${r[i].okStr} ${h}`,params:({keyword:i,schemaCode:h})=>e._`{comparison: ${r[i].okStr}, limit: ${h}}`},n={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:a,code(i){let{keyword:h,data:o,schemaCode:c}=i;i.fail$data(e._`${o} ${r[h].fail} ${c} || isNaN(${o})`)}};t.default=n}),M4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s={message:({schemaCode:a})=>e.str`must be multiple of ${a}`,params:({schemaCode:a})=>e._`{multipleOf: ${a}}`},r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:s,code(a){let{gen:n,data:i,schemaCode:h,it:o}=a,c=o.opts.multipleOfPrecision,m=n.let("res"),u=c?e._`Math.abs(Math.round(${m}) - ${m}) > 1e-${c}`:e._`${m} !== parseInt(${m})`;a.fail$data(e._`(${h} === 0 || (${m} = ${i}/${h}, ${u}))`)}};t.default=r}),P4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});function e(s){let r=s.length,a=0,n=0,i;while(n<r)if(a++,i=s.charCodeAt(n++),i>=55296&&i<=56319&&n<r){if(i=s.charCodeAt(n),(i&64512)===56320)n++}return a}t.default=e,e.code='require("ajv/dist/runtime/ucs2length").default'}),L4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=xt(),r=P4(),a={message({keyword:i,schemaCode:h}){let o=i==="maxLength"?"more":"fewer";return e.str`must NOT have ${o} than ${h} characters`},params:({schemaCode:i})=>e._`{limit: ${i}}`},n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:a,code(i){let{keyword:h,data:o,schemaCode:c,it:m}=i,u=h==="maxLength"?e.operators.GT:e.operators.LT,p=m.opts.unicode===!1?e._`${o}.length`:e._`${(0,s.useFunc)(i.gen,r.default)}(${o})`;i.fail$data(e._`${p} ${u} ${c}`)}};t.default=n}),j4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Z0(),s=xt(),r=pt(),a={message:({schemaCode:i})=>r.str`must match pattern "${i}"`,params:({schemaCode:i})=>r._`{pattern: ${i}}`},n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:a,code(i){let{gen:h,data:o,$data:c,schema:m,schemaCode:u,it:p}=i,k=p.opts.unicodeRegExp?"u":"";if(c){let{regExp:C}=p.opts.code,I=C.code==="new RegExp"?r._`new RegExp`:(0,s.useFunc)(h,C),R=h.let("valid");h.try(()=>h.assign(R,r._`${I}(${u}, ${k}).test(${o})`),()=>h.assign(R,!1)),i.fail$data(r._`!${R}`)}else{let C=(0,e.usePattern)(i,m);i.fail$data(r._`!${C}.test(${o})`)}}};t.default=n}),q4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s={message({keyword:a,schemaCode:n}){let i=a==="maxProperties"?"more":"fewer";return e.str`must NOT have ${i} than ${n} properties`},params:({schemaCode:a})=>e._`{limit: ${a}}`},r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:s,code(a){let{keyword:n,data:i,schemaCode:h}=a,o=n==="maxProperties"?e.operators.GT:e.operators.LT;a.fail$data(e._`Object.keys(${i}).length ${o} ${h}`)}};t.default=r}),_4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Z0(),s=pt(),r=xt(),a={message:({params:{missingProperty:i}})=>s.str`must have required property '${i}'`,params:({params:{missingProperty:i}})=>s._`{missingProperty: ${i}}`},n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:a,code(i){let{gen:h,schema:o,schemaCode:c,data:m,$data:u,it:p}=i,{opts:k}=p;if(!u&&o.length===0)return;let C=o.length>=k.loopRequired;if(p.allErrors)I();else R();if(k.strictRequired){let y=i.parentSchema.properties,{definedProperties:l}=i.it;for(let T of o)if((y===null||y===void 0?void 0:y[T])===void 0&&!l.has(T)){let f=p.schemaEnv.baseId+p.errSchemaPath,x=`required property "${T}" is not defined at "${f}" (strictRequired)`;(0,r.checkStrictMode)(p,x,p.opts.strictRequired)}}function I(){if(C||u)i.block$data(s.nil,d);else for(let y of o)(0,e.checkReportMissingProp)(i,y)}function R(){let y=h.let("missing");if(C||u){let l=h.let("valid",!0);i.block$data(l,()=>E(y,l)),i.ok(l)}else h.if((0,e.checkMissingProp)(i,o,y)),(0,e.reportMissingProp)(i,y),h.else()}function d(){h.forOf("prop",c,(y)=>{i.setParams({missingProperty:y}),h.if((0,e.noPropertyInData)(h,m,y,k.ownProperties),()=>i.error())})}function E(y,l){i.setParams({missingProperty:y}),h.forOf(y,c,()=>{h.assign(l,(0,e.propertyInData)(h,m,y,k.ownProperties)),h.if((0,s.not)(l),()=>{i.error(),h.break()})},s.nil)}}};t.default=n}),D4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s={message({keyword:a,schemaCode:n}){let i=a==="maxItems"?"more":"fewer";return e.str`must NOT have ${i} than ${n} items`},params:({schemaCode:a})=>e._`{limit: ${a}}`},r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:s,code(a){let{keyword:n,data:i,schemaCode:h}=a,o=n==="maxItems"?e.operators.GT:e.operators.LT;a.fail$data(e._`${i}.length ${o} ${h}`)}};t.default=r}),Xr=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Dh();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),B4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ts(),s=pt(),r=xt(),a=Xr(),n={message:({params:{i:h,j:o}})=>s.str`must NOT have duplicate items (items ## ${o} and ${h} are identical)`,params:({params:{i:h,j:o}})=>s._`{i: ${h}, j: ${o}}`},i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:n,code(h){let{gen:o,data:c,$data:m,schema:u,parentSchema:p,schemaCode:k,it:C}=h;if(!m&&!u)return;let I=o.let("valid"),R=p.items?(0,e.getSchemaTypes)(p.items):[];h.block$data(I,d,s._`${k} === false`),h.ok(I);function d(){let T=o.let("i",s._`${c}.length`),f=o.let("j");h.setParams({i:T,j:f}),o.assign(I,!0),o.if(s._`${T} > 1`,()=>(E()?y:l)(T,f))}function E(){return R.length>0&&!R.some((T)=>T==="object"||T==="array")}function y(T,f){let x=o.name("item"),v=(0,e.checkDataTypes)(R,x,C.opts.strictNumbers,e.DataType.Wrong),F=o.const("indices",s._`{}`);o.for(s._`;${T}--;`,()=>{if(o.let(x,s._`${c}[${T}]`),o.if(v,s._`continue`),R.length>1)o.if(s._`typeof ${x} == "string"`,s._`${x} += "_"`);o.if(s._`typeof ${F}[${x}] == "number"`,()=>{o.assign(f,s._`${F}[${x}]`),h.error(),o.assign(I,!1).break()}).code(s._`${F}[${x}] = ${T}`)})}function l(T,f){let x=(0,r.useFunc)(o,a.default),v=o.name("outer");o.label(v).for(s._`;${T}--;`,()=>o.for(s._`${f} = ${T}; ${f}--;`,()=>o.if(s._`${x}(${c}[${T}], ${c}[${f}])`,()=>{h.error(),o.assign(I,!1).break(v)})))}}};t.default=i}),V4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=xt(),r=Xr(),a={message:"must be equal to constant",params:({schemaCode:i})=>e._`{allowedValue: ${i}}`},n={keyword:"const",$data:!0,error:a,code(i){let{gen:h,data:o,$data:c,schemaCode:m,schema:u}=i;if(c||u&&typeof u=="object")i.fail$data(e._`!${(0,s.useFunc)(h,r.default)}(${o}, ${m})`);else i.fail(e._`${u} !== ${o}`)}};t.default=n}),N4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=xt(),r=Xr(),a={message:"must be equal to one of the allowed values",params:({schemaCode:i})=>e._`{allowedValues: ${i}}`},n={keyword:"enum",schemaType:"array",$data:!0,error:a,code(i){let{gen:h,data:o,$data:c,schema:m,schemaCode:u,it:p}=i;if(!c&&m.length===0)throw Error("enum must have non-empty array");let k=m.length>=p.opts.loopEnum,C,I=()=>C!==null&&C!==void 0?C:C=(0,s.useFunc)(h,r.default),R;if(k||c)R=h.let("valid"),i.block$data(R,d);else{if(!Array.isArray(m))throw Error("ajv implementation error");let y=h.const("vSchema",u);R=(0,e.or)(...m.map((l,T)=>E(y,T)))}i.pass(R);function d(){h.assign(R,!1),h.forOf("v",u,(y)=>h.if(e._`${I()}(${o}, ${y})`,()=>h.assign(R,!0).break()))}function E(y,l){let T=m[l];return typeof T==="object"&&T!==null?e._`${I()}(${o}, ${y}[${l}])`:e._`${o} === ${T}`}}};t.default=n}),w4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=F4(),s=M4(),r=L4(),a=j4(),n=q4(),i=_4(),h=D4(),o=B4(),c=V4(),m=N4(),u=[e.default,s.default,r.default,a.default,n.default,i.default,h.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,m.default];t.default=u}),Bh=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=pt(),s=xt(),r={message:({params:{len:i}})=>e.str`must NOT have more than ${i} items`,params:({params:{len:i}})=>e._`{limit: ${i}}`},a={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:r,code(i){let{parentSchema:h,it:o}=i,{items:c}=h;if(!Array.isArray(c)){(0,s.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(i,c)}};function n(i,h){let{gen:o,schema:c,data:m,keyword:u,it:p}=i;p.items=!0;let k=o.const("len",e._`${m}.length`);if(c===!1)i.setParams({len:h.length}),i.pass(e._`${k} <= ${h.length}`);else if(typeof c=="object"&&!(0,s.alwaysValidSchema)(p,c)){let I=o.var("valid",e._`${k} <= ${h.length}`);o.if((0,e.not)(I),()=>C(I)),i.ok(I)}function C(I){o.forRange("i",h.length,k,(R)=>{if(i.subschema({keyword:u,dataProp:R,dataPropType:s.Type.Num},I),!p.allErrors)o.if((0,e.not)(I),()=>o.break())})}}t.validateAdditionalItems=n,t.default=a}),Vh=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=pt(),s=xt(),r=Z0(),a={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:h,it:o}=i;if(Array.isArray(h))return n(i,"additionalItems",h);if(o.items=!0,(0,s.alwaysValidSchema)(o,h))return;i.ok((0,r.validateArray)(i))}};function n(i,h,o=i.schema){let{gen:c,parentSchema:m,data:u,keyword:p,it:k}=i;if(R(m),k.opts.unevaluated&&o.length&&k.items!==!0)k.items=s.mergeEvaluated.items(c,o.length,k.items);let C=c.name("valid"),I=c.const("len",e._`${u}.length`);o.forEach((d,E)=>{if((0,s.alwaysValidSchema)(k,d))return;c.if(e._`${I} > ${E}`,()=>i.subschema({keyword:p,schemaProp:E,dataProp:E},C)),i.ok(C)});function R(d){let{opts:E,errSchemaPath:y}=k,l=o.length,T=l===d.minItems&&(l===d.maxItems||d[h]===!1);if(E.strictTuples&&!T){let f=`"${p}" is ${l}-tuple, but minItems or maxItems/${h} are not specified or different at path "${y}"`;(0,s.checkStrictMode)(k,f,E.strictTuples)}}}t.validateTuple=n,t.default=a}),K4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Vh(),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(r)=>(0,e.validateTuple)(r,"items")};t.default=s}),H4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=xt(),r=Z0(),a=Bh(),n={message:({params:{len:h}})=>e.str`must NOT have more than ${h} items`,params:({params:{len:h}})=>e._`{limit: ${h}}`},i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:n,code(h){let{schema:o,parentSchema:c,it:m}=h,{prefixItems:u}=c;if(m.items=!0,(0,s.alwaysValidSchema)(m,o))return;if(u)(0,a.validateAdditionalItems)(h,u);else h.ok((0,r.validateArray)(h))}};t.default=i}),O4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=xt(),r={message:({params:{min:n,max:i}})=>i===void 0?e.str`must contain at least ${n} valid item(s)`:e.str`must contain at least ${n} and no more than ${i} valid item(s)`,params:({params:{min:n,max:i}})=>i===void 0?e._`{minContains: ${n}}`:e._`{minContains: ${n}, maxContains: ${i}}`},a={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:r,code(n){let{gen:i,schema:h,parentSchema:o,data:c,it:m}=n,u,p,{minContains:k,maxContains:C}=o;if(m.opts.next)u=k===void 0?1:k,p=C;else u=1;let I=i.const("len",e._`${c}.length`);if(n.setParams({min:u,max:p}),p===void 0&&u===0){(0,s.checkStrictMode)(m,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&u>p){(0,s.checkStrictMode)(m,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,s.alwaysValidSchema)(m,h)){let l=e._`${I} >= ${u}`;if(p!==void 0)l=e._`${l} && ${I} <= ${p}`;n.pass(l);return}m.items=!0;let R=i.name("valid");if(p===void 0&&u===1)E(R,()=>i.if(R,()=>i.break()));else if(u===0){if(i.let(R,!0),p!==void 0)i.if(e._`${c}.length > 0`,d)}else i.let(R,!1),d();n.result(R,()=>n.reset());function d(){let l=i.name("_valid"),T=i.let("count",0);E(l,()=>i.if(l,()=>y(T)))}function E(l,T){i.forRange("i",0,I,(f)=>{n.subschema({keyword:"contains",dataProp:f,dataPropType:s.Type.Num,compositeRule:!0},l),T()})}function y(l){if(i.code(e._`${l}++`),p===void 0)i.if(e._`${l} >= ${u}`,()=>i.assign(R,!0).break());else if(i.if(e._`${l} > ${p}`,()=>i.assign(R,!1).break()),u===1)i.assign(R,!0);else i.if(e._`${l} >= ${u}`,()=>i.assign(R,!0))}}};t.default=a}),U4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=pt(),s=xt(),r=Z0();t.error={message:({params:{property:o,depsCount:c,deps:m}})=>{let u=c===1?"property":"properties";return e.str`must have ${u} ${m} when property ${o} is present`},params:({params:{property:o,depsCount:c,deps:m,missingProperty:u}})=>e._`{property: ${o},
7
+ missingProperty: ${u},
8
+ depsCount: ${c},
9
+ deps: ${m}}`};var a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(o){let[c,m]=n(o);i(o,c),h(o,m)}};function n({schema:o}){let c={},m={};for(let u in o){if(u==="__proto__")continue;let p=Array.isArray(o[u])?c:m;p[u]=o[u]}return[c,m]}function i(o,c=o.schema){let{gen:m,data:u,it:p}=o;if(Object.keys(c).length===0)return;let k=m.let("missing");for(let C in c){let I=c[C];if(I.length===0)continue;let R=(0,r.propertyInData)(m,u,C,p.opts.ownProperties);if(o.setParams({property:C,depsCount:I.length,deps:I.join(", ")}),p.allErrors)m.if(R,()=>{for(let d of I)(0,r.checkReportMissingProp)(o,d)});else m.if(e._`${R} && (${(0,r.checkMissingProp)(o,I,k)})`),(0,r.reportMissingProp)(o,k),m.else()}}t.validatePropertyDeps=i;function h(o,c=o.schema){let{gen:m,data:u,keyword:p,it:k}=o,C=m.name("valid");for(let I in c){if((0,s.alwaysValidSchema)(k,c[I]))continue;m.if((0,r.propertyInData)(m,u,I,k.opts.ownProperties),()=>{let R=o.subschema({keyword:p,schemaProp:I},C);o.mergeValidEvaluated(R,C)},()=>m.var(C,!0)),o.ok(C)}}t.validateSchemaDeps=h,t.default=a}),G4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=xt(),r={message:"property name must be valid",params:({params:n})=>e._`{propertyName: ${n.propertyName}}`},a={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:r,code(n){let{gen:i,schema:h,data:o,it:c}=n;if((0,s.alwaysValidSchema)(c,h))return;let m=i.name("valid");i.forIn("key",o,(u)=>{n.setParams({propertyName:u}),n.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},m),i.if((0,e.not)(m),()=>{if(n.error(!0),!c.allErrors)i.break()})}),n.ok(m)}};t.default=a}),Nh=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Z0(),s=pt(),r=$0(),a=xt(),n={message:"must NOT have additional properties",params:({params:h})=>s._`{additionalProperty: ${h.additionalProperty}}`},i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:n,code(h){let{gen:o,schema:c,parentSchema:m,data:u,errsCount:p,it:k}=h;if(!p)throw Error("ajv implementation error");let{allErrors:C,opts:I}=k;if(k.props=!0,I.removeAdditional!=="all"&&(0,a.alwaysValidSchema)(k,c))return;let R=(0,e.allSchemaProperties)(m.properties),d=(0,e.allSchemaProperties)(m.patternProperties);E(),h.ok(s._`${p} === ${r.default.errors}`);function E(){o.forIn("key",u,(x)=>{if(!R.length&&!d.length)T(x);else o.if(y(x),()=>T(x))})}function y(x){let v;if(R.length>8){let F=(0,a.schemaRefOrVal)(k,m.properties,"properties");v=(0,e.isOwnProperty)(o,F,x)}else if(R.length)v=(0,s.or)(...R.map((F)=>s._`${x} === ${F}`));else v=s.nil;if(d.length)v=(0,s.or)(v,...d.map((F)=>s._`${(0,e.usePattern)(h,F)}.test(${x})`));return(0,s.not)(v)}function l(x){o.code(s._`delete ${u}[${x}]`)}function T(x){if(I.removeAdditional==="all"||I.removeAdditional&&c===!1){l(x);return}if(c===!1){if(h.setParams({additionalProperty:x}),h.error(),!C)o.break();return}if(typeof c=="object"&&!(0,a.alwaysValidSchema)(k,c)){let v=o.name("valid");if(I.removeAdditional==="failing")f(x,v,!1),o.if((0,s.not)(v),()=>{h.reset(),l(x)});else if(f(x,v),!C)o.if((0,s.not)(v),()=>o.break())}}function f(x,v,F){let B={keyword:"additionalProperties",dataProp:x,dataPropType:a.Type.Str};if(F===!1)Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1});h.subschema(B,v)}}};t.default=i}),W4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Gs(),s=Z0(),r=xt(),a=Nh(),n={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:h,schema:o,parentSchema:c,data:m,it:u}=i;if(u.opts.removeAdditional==="all"&&c.additionalProperties===void 0)a.default.code(new e.KeywordCxt(u,a.default,"additionalProperties"));let p=(0,s.allSchemaProperties)(o);for(let d of p)u.definedProperties.add(d);if(u.opts.unevaluated&&p.length&&u.props!==!0)u.props=r.mergeEvaluated.props(h,(0,r.toHash)(p),u.props);let k=p.filter((d)=>!(0,r.alwaysValidSchema)(u,o[d]));if(k.length===0)return;let C=h.name("valid");for(let d of k){if(I(d))R(d);else{if(h.if((0,s.propertyInData)(h,m,d,u.opts.ownProperties)),R(d),!u.allErrors)h.else().var(C,!0);h.endIf()}i.it.definedProperties.add(d),i.ok(C)}function I(d){return u.opts.useDefaults&&!u.compositeRule&&o[d].default!==void 0}function R(d){i.subschema({keyword:"properties",schemaProp:d,dataProp:d},C)}}};t.default=n}),z4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Z0(),s=pt(),r=xt(),a=xt(),n={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:h,schema:o,data:c,parentSchema:m,it:u}=i,{opts:p}=u,k=(0,e.allSchemaProperties)(o),C=k.filter((T)=>(0,r.alwaysValidSchema)(u,o[T]));if(k.length===0||C.length===k.length&&(!u.opts.unevaluated||u.props===!0))return;let I=p.strictSchema&&!p.allowMatchingProperties&&m.properties,R=h.name("valid");if(u.props!==!0&&!(u.props instanceof s.Name))u.props=(0,a.evaluatedPropsToName)(h,u.props);let{props:d}=u;E();function E(){for(let T of k){if(I)y(T);if(u.allErrors)l(T);else h.var(R,!0),l(T),h.if(R)}}function y(T){for(let f in I)if(new RegExp(T).test(f))(0,r.checkStrictMode)(u,`property ${f} matches pattern ${T} (use allowMatchingProperties)`)}function l(T){h.forIn("key",c,(f)=>{h.if(s._`${(0,e.usePattern)(i,T)}.test(${f})`,()=>{let x=C.includes(T);if(!x)i.subschema({keyword:"patternProperties",schemaProp:T,dataProp:f,dataPropType:a.Type.Str},R);if(u.opts.unevaluated&&d!==!0)h.assign(s._`${d}[${f}]`,!0);else if(!x&&!u.allErrors)h.if((0,s.not)(R),()=>h.break())})})}}};t.default=n}),Q4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xt(),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:a,schema:n,it:i}=r;if((0,e.alwaysValidSchema)(i,n)){r.fail();return}let h=a.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},h),r.failResult(h,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};t.default=s}),J4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Z0(),s={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=s}),Y4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=xt(),r={message:"must match exactly one schema in oneOf",params:({params:n})=>e._`{passingSchemas: ${n.passing}}`},a={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:r,code(n){let{gen:i,schema:h,parentSchema:o,it:c}=n;if(!Array.isArray(h))throw Error("ajv implementation error");if(c.opts.discriminator&&o.discriminator)return;let m=h,u=i.let("valid",!1),p=i.let("passing",null),k=i.name("_valid");n.setParams({passing:p}),i.block(C),n.result(u,()=>n.reset(),()=>n.error(!0));function C(){m.forEach((I,R)=>{let d;if((0,s.alwaysValidSchema)(c,I))i.var(k,!0);else d=n.subschema({keyword:"oneOf",schemaProp:R,compositeRule:!0},k);if(R>0)i.if(e._`${k} && ${u}`).assign(u,!1).assign(p,e._`[${p}, ${R}]`).else();i.if(k,()=>{if(i.assign(u,!0),i.assign(p,R),d)n.mergeEvaluated(d,e.Name)})})}}};t.default=a}),X4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xt(),s={keyword:"allOf",schemaType:"array",code(r){let{gen:a,schema:n,it:i}=r;if(!Array.isArray(n))throw Error("ajv implementation error");let h=a.name("valid");n.forEach((o,c)=>{if((0,e.alwaysValidSchema)(i,o))return;let m=r.subschema({keyword:"allOf",schemaProp:c},h);r.ok(h),r.mergeEvaluated(m)})}};t.default=s}),$4=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=xt(),r={message:({params:i})=>e.str`must match "${i.ifClause}" schema`,params:({params:i})=>e._`{failingKeyword: ${i.ifClause}}`},a={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:r,code(i){let{gen:h,parentSchema:o,it:c}=i;if(o.then===void 0&&o.else===void 0)(0,s.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let m=n(c,"then"),u=n(c,"else");if(!m&&!u)return;let p=h.let("valid",!0),k=h.name("_valid");if(C(),i.reset(),m&&u){let R=h.let("ifClause");i.setParams({ifClause:R}),h.if(k,I("then",R),I("else",R))}else if(m)h.if(k,I("then"));else h.if((0,e.not)(k),I("else"));i.pass(p,()=>i.error(!0));function C(){let R=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},k);i.mergeEvaluated(R)}function I(R,d){return()=>{let E=i.subschema({keyword:R},k);if(h.assign(p,k),i.mergeValidEvaluated(E,p),d)h.assign(d,e._`${R}`);else i.setParams({ifClause:R})}}}};function n(i,h){let o=i.schema[h];return o!==void 0&&!(0,s.alwaysValidSchema)(i,o)}t.default=a}),t8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xt(),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:a,it:n}){if(a.if===void 0)(0,e.checkStrictMode)(n,`"${r}" without "if" is ignored`)}};t.default=s}),e8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Bh(),s=K4(),r=Vh(),a=H4(),n=O4(),i=U4(),h=G4(),o=Nh(),c=W4(),m=z4(),u=Q4(),p=J4(),k=Y4(),C=X4(),I=$4(),R=t8();function d(E=!1){let y=[u.default,p.default,k.default,C.default,I.default,R.default,h.default,o.default,i.default,c.default,m.default];if(E)y.push(s.default,a.default);else y.push(e.default,r.default);return y.push(n.default),y}t.default=d}),a8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s={message:({schemaCode:a})=>e.str`must match format "${a}"`,params:({schemaCode:a})=>e._`{format: ${a}}`},r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:s,code(a,n){let{gen:i,data:h,$data:o,schema:c,schemaCode:m,it:u}=a,{opts:p,errSchemaPath:k,schemaEnv:C,self:I}=u;if(!p.validateFormats)return;if(o)R();else d();function R(){let E=i.scopeValue("formats",{ref:I.formats,code:p.code.formats}),y=i.const("fDef",e._`${E}[${m}]`),l=i.let("fType"),T=i.let("format");i.if(e._`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>i.assign(l,e._`${y}.type || "string"`).assign(T,e._`${y}.validate`),()=>i.assign(l,e._`"string"`).assign(T,y)),a.fail$data((0,e.or)(f(),x()));function f(){if(p.strictSchema===!1)return e.nil;return e._`${m} && !${T}`}function x(){let v=C.$async?e._`(${y}.async ? await ${T}(${h}) : ${T}(${h}))`:e._`${T}(${h})`,F=e._`(typeof ${T} == "function" ? ${v} : ${T}.test(${h}))`;return e._`${T} && ${T} !== true && ${l} === ${n} && !${F}`}}function d(){let E=I.formats[c];if(!E){f();return}if(E===!0)return;let[y,l,T]=x(E);if(y===n)a.pass(v());function f(){if(p.strictSchema===!1){I.logger.warn(F());return}throw Error(F());function F(){return`unknown format "${c}" ignored in schema at path "${k}"`}}function x(F){let B=F instanceof RegExp?(0,e.regexpCode)(F):p.code.formats?e._`${p.code.formats}${(0,e.getProperty)(c)}`:void 0,_=i.scopeValue("formats",{key:c,ref:F,code:B});if(typeof F=="object"&&!(F instanceof RegExp))return[F.type||"string",F.validate,e._`${_}.validate`];return["string",F,_]}function v(){if(typeof E=="object"&&!(E instanceof RegExp)&&E.async){if(!C.$async)throw Error("async format in sync schema");return e._`await ${T}(${h})`}return typeof l=="function"?e._`${T}(${h})`:e._`${T}.test(${h})`}}}};t.default=r}),s8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=a8(),s=[e.default];t.default=s}),r8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),n8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Z4(),s=w4(),r=e8(),a=s8(),n=r8(),i=[e.default,s.default,(0,r.default)(),a.default,n.metadataVocabulary,n.contentVocabulary];t.default=i}),i8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0;var e;(function(s){s.Tag="tag",s.Mapping="mapping"})(e||(t.DiscrError=e={}))}),h8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pt(),s=i8(),r=Yr(),a=Ws(),n=xt(),i={message:({params:{discrError:o,tagName:c}})=>o===s.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:o,tag:c,tagName:m}})=>e._`{error: ${o}, tag: ${m}, tagValue: ${c}}`},h={keyword:"discriminator",type:"object",schemaType:"object",error:i,code(o){let{gen:c,data:m,schema:u,parentSchema:p,it:k}=o,{oneOf:C}=p;if(!k.opts.discriminator)throw Error("discriminator: requires discriminator option");let I=u.propertyName;if(typeof I!="string")throw Error("discriminator: requires propertyName");if(u.mapping)throw Error("discriminator: mapping is not supported");if(!C)throw Error("discriminator: requires oneOf keyword");let R=c.let("valid",!1),d=c.const("tag",e._`${m}${(0,e.getProperty)(I)}`);c.if(e._`typeof ${d} == "string"`,()=>E(),()=>o.error(!1,{discrError:s.DiscrError.Tag,tag:d,tagName:I})),o.ok(R);function E(){let T=l();c.if(!1);for(let f in T)c.elseIf(e._`${d} === ${f}`),c.assign(R,y(T[f]));c.else(),o.error(!1,{discrError:s.DiscrError.Mapping,tag:d,tagName:I}),c.endIf()}function y(T){let f=c.name("valid"),x=o.subschema({keyword:"oneOf",schemaProp:T},f);return o.mergeEvaluated(x,e.Name),f}function l(){var T;let f={},x=F(p),v=!0;for(let N=0;N<C.length;N++){let O=C[N];if((O===null||O===void 0?void 0:O.$ref)&&!(0,n.schemaHasRulesButRef)(O,k.self.RULES)){let K=O.$ref;if(O=r.resolveRef.call(k.self,k.schemaEnv.root,k.baseId,K),O instanceof r.SchemaEnv)O=O.schema;if(O===void 0)throw new a.default(k.opts.uriResolver,k.baseId,K)}let z=(T=O===null||O===void 0?void 0:O.properties)===null||T===void 0?void 0:T[I];if(typeof z!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${I}"`);v=v&&(x||F(O)),B(z,N)}if(!v)throw Error(`discriminator: "${I}" must be required`);return f;function F({required:N}){return Array.isArray(N)&&N.includes(I)}function B(N,O){if(N.const)_(N.const,O);else if(N.enum)for(let z of N.enum)_(z,O);else throw Error(`discriminator: "properties/${I}" must have "const" or "enum"`)}function _(N,O){if(typeof N!="string"||N in f)throw Error(`discriminator: "${I}" values must be unique strings`);f[N]=O}}}};t.default=h}),o8=W((t,e)=>{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),wh=W((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var s=g4(),r=n8(),a=h8(),n=o8(),i=["/properties"],h="http://json-schema.org/draft-07/schema";class o extends s.default{_addVocabularies(){if(super._addVocabularies(),r.default.forEach((k)=>this.addVocabulary(k)),this.opts.discriminator)this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let k=this.opts.$data?this.$dataMetaSchema(n,i):n;this.addMetaSchema(k,h,!1),this.refs["http://json-schema.org/schema"]=h}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(h)?h:void 0)}}t.Ajv=o,e.exports=t=o,e.exports.Ajv=o,Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var c=Gs();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var m=pt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var u=Jr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return u.default}});var p=Ws();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),c8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(_,N){return{validate:_,compare:N}}t.fullFormats={date:e(n,i),time:e(o(!0),c),"date-time":e(p(!0),k),"iso-time":e(o(),m),"iso-date-time":e(p(),C),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:B,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:f},int64:{type:"number",validate:x},float:{type:"number",validate:v},double:{type:"number",validate:v},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,k),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,C),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function s(_){return _%4===0&&(_%100!==0||_%400===0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n(_){let N=r.exec(_);if(!N)return!1;let O=+N[1],z=+N[2],K=+N[3];return z>=1&&z<=12&&K>=1&&K<=(z===2&&s(O)?29:a[z])}function i(_,N){if(!(_&&N))return;if(_>N)return 1;if(_<N)return-1;return 0}var h=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function o(_){return function(N){let O=h.exec(N);if(!O)return!1;let z=+O[1],K=+O[2],Mt=+O[3],Ht=O[4],Ot=O[5]==="-"?-1:1,St=+(O[6]||0),A=+(O[7]||0);if(St>23||A>59||_&&!Ht)return!1;if(z<=23&&K<=59&&Mt<60)return!0;let L=K-A*Ot,V=z-St*Ot-(L<0?1:0);return(V===23||V===-1)&&(L===59||L===-1)&&Mt<61}}function c(_,N){if(!(_&&N))return;let O=new Date("2020-01-01T"+_).valueOf(),z=new Date("2020-01-01T"+N).valueOf();if(!(O&&z))return;return O-z}function m(_,N){if(!(_&&N))return;let O=h.exec(_),z=h.exec(N);if(!(O&&z))return;if(_=O[1]+O[2]+O[3],N=z[1]+z[2]+z[3],_>N)return 1;if(_<N)return-1;return 0}var u=/t|\s/i;function p(_){let N=o(_);return function(O){let z=O.split(u);return z.length===2&&n(z[0])&&N(z[1])}}function k(_,N){if(!(_&&N))return;let O=new Date(_).valueOf(),z=new Date(N).valueOf();if(!(O&&z))return;return O-z}function C(_,N){if(!(_&&N))return;let[O,z]=_.split(u),[K,Mt]=N.split(u),Ht=i(O,K);if(Ht===void 0)return;return Ht||c(z,Mt)}var I=/\/|:/,R=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function d(_){return I.test(_)&&R.test(_)}var E=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(_){return E.lastIndex=0,E.test(_)}var l=-2147483648,T=2147483647;function f(_){return Number.isInteger(_)&&_<=T&&_>=l}function x(_){return Number.isInteger(_)}function v(){return!0}var F=/[^\\]\\Z/;function B(_){if(F.test(_))return!1;try{return new RegExp(_),!0}catch(N){return!1}}}),d8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=wh(),s=pt(),r=s.operators,a={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={message:({keyword:h,schemaCode:o})=>s.str`should be ${a[h].okStr} ${o}`,params:({keyword:h,schemaCode:o})=>s._`{comparison: ${a[h].okStr}, limit: ${o}}`};t.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:n,code(h){let{gen:o,data:c,schemaCode:m,keyword:u,it:p}=h,{opts:k,self:C}=p;if(!k.validateFormats)return;let I=new e.KeywordCxt(p,C.RULES.all.format.definition,"format");if(I.$data)R();else d();function R(){let y=o.scopeValue("formats",{ref:C.formats,code:k.code.formats}),l=o.const("fmt",s._`${y}[${I.schemaCode}]`);h.fail$data((0,s.or)(s._`typeof ${l} != "object"`,s._`${l} instanceof RegExp`,s._`typeof ${l}.compare != "function"`,E(l)))}function d(){let y=I.schema,l=C.formats[y];if(!l||l===!0)return;if(typeof l!="object"||l instanceof RegExp||typeof l.compare!="function")throw Error(`"${u}": format "${y}" does not define "compare" function`);let T=o.scopeValue("formats",{key:y,ref:l,code:k.code.formats?s._`${k.code.formats}${(0,s.getProperty)(y)}`:void 0});h.fail$data(E(T))}function E(y){return s._`${y}.compare(${c}, ${m}) ${a[u].fail} 0`}},dependencies:["format"]};var i=(h)=>{return h.addKeyword(t.formatLimitDefinition),h};t.default=i}),y8=W((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var s=c8(),r=d8(),a=pt(),n=new a.Name("fullFormats"),i=new a.Name("fastFormats"),h=(c,m={keywords:!0})=>{if(Array.isArray(m))return o(c,m,s.fullFormats,n),c;let[u,p]=m.mode==="fast"?[s.fastFormats,i]:[s.fullFormats,n],k=m.formats||s.formatNames;if(o(c,k,u,p),m.keywords)(0,r.default)(c);return c};h.get=(c,m="full")=>{let u=(m==="fast"?s.fastFormats:s.fullFormats)[c];if(!u)throw Error(`Unknown format "${c}"`);return u};function o(c,m,u,p){var k,C;(k=(C=c.opts.code).formats)!==null&&k!==void 0||(C.formats=a._`require("ajv-formats/dist/formats").${p}`);for(let I of m)c.addFormat(I,u[I])}e.exports=t=h,Object.defineProperty(t,"__esModule",{value:!0}),t.default=h}),E8=50;function Kh(t=E8){let e=new AbortController;return m8(t,e.signal),e}class P0 extends Error{}function Hh(){return process.versions.bun!==void 0}var f8=typeof global=="object"&&global&&global.Object===Object&&global,T8=f8,k8=typeof self=="object"&&self&&self.Object===Object&&self,R8=T8||k8||Function("return this")(),$r=R8,x8=$r.Symbol,ks=x8,Oh=Object.prototype,C8=Oh.hasOwnProperty,I8=Oh.toString,ze=ks?ks.toStringTag:void 0;function v8(t){var e=C8.call(t,ze),s=t[ze];try{t[ze]=void 0;var r=!0}catch(n){}var a=I8.call(t);if(r)if(e)t[ze]=s;else delete t[ze];return a}var g8=v8,b8=Object.prototype,A8=b8.toString;function Z8(t){return A8.call(t)}var F8=Z8,M8="[object Null]",P8="[object Undefined]",Zi=ks?ks.toStringTag:void 0;function L8(t){if(t==null)return t===void 0?P8:M8;return Zi&&Zi in Object(t)?g8(t):F8(t)}var j8=L8;function q8(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Uh=q8,_8="[object AsyncFunction]",D8="[object Function]",B8="[object GeneratorFunction]",V8="[object Proxy]";function N8(t){if(!Uh(t))return!1;var e=j8(t);return e==D8||e==B8||e==_8||e==V8}var w8=N8,K8=$r["__core-js_shared__"],Cr=K8,Fi=function(){var t=/[^.]+$/.exec(Cr&&Cr.keys&&Cr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function H8(t){return!!Fi&&Fi in t}var O8=H8,U8=Function.prototype,G8=U8.toString;function W8(t){if(t!=null){try{return G8.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var z8=W8,Q8=/[\\^$.*+?()[\]{}|]/g,J8=/^\[object .+?Constructor\]$/,Y8=Function.prototype,X8=Object.prototype,$8=Y8.toString,tl=X8.hasOwnProperty,el=RegExp("^"+$8.call(tl).replace(Q8,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function al(t){if(!Uh(t)||O8(t))return!1;var e=w8(t)?el:J8;return e.test(z8(t))}var sl=al;function rl(t,e){return t==null?void 0:t[e]}var nl=rl;function il(t,e){var s=nl(t,e);return sl(s)?s:void 0}var Gh=il,hl=Gh(Object,"create"),Sa=hl;function ol(){this.__data__=Sa?Sa(null):{},this.size=0}var cl=ol;function dl(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var yl=dl,ll="__lodash_hash_undefined__",pl=Object.prototype,ml=pl.hasOwnProperty;function El(t){var e=this.__data__;if(Sa){var s=e[t];return s===ll?void 0:s}return ml.call(e,t)?e[t]:void 0}var ul=El,Sl=Object.prototype,fl=Sl.hasOwnProperty;function Tl(t){var e=this.__data__;return Sa?e[t]!==void 0:fl.call(e,t)}var kl=Tl,Rl="__lodash_hash_undefined__";function xl(t,e){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=Sa&&e===void 0?Rl:e,this}var Cl=xl;function Be(t){var e=-1,s=t==null?0:t.length;this.clear();while(++e<s){var r=t[e];this.set(r[0],r[1])}}Be.prototype.clear=cl;Be.prototype.delete=yl;Be.prototype.get=ul;Be.prototype.has=kl;Be.prototype.set=Cl;var Mi=Be;function Il(){this.__data__=[],this.size=0}var vl=Il;function gl(t,e){return t===e||t!==t&&e!==e}var bl=gl;function Al(t,e){var s=t.length;while(s--)if(bl(t[s][0],e))return s;return-1}var zs=Al,Zl=Array.prototype,Fl=Zl.splice;function Ml(t){var e=this.__data__,s=zs(e,t);if(s<0)return!1;var r=e.length-1;if(s==r)e.pop();else Fl.call(e,s,1);return--this.size,!0}var Pl=Ml;function Ll(t){var e=this.__data__,s=zs(e,t);return s<0?void 0:e[s][1]}var jl=Ll;function ql(t){return zs(this.__data__,t)>-1}var _l=ql;function Dl(t,e){var s=this.__data__,r=zs(s,t);if(r<0)++this.size,s.push([t,e]);else s[r][1]=e;return this}var Bl=Dl;function Ve(t){var e=-1,s=t==null?0:t.length;this.clear();while(++e<s){var r=t[e];this.set(r[0],r[1])}}Ve.prototype.clear=vl;Ve.prototype.delete=Pl;Ve.prototype.get=jl;Ve.prototype.has=_l;Ve.prototype.set=Bl;var Vl=Ve,Nl=Gh($r,"Map"),wl=Nl;function Kl(){this.size=0,this.__data__={hash:new Mi,map:new(wl||Vl),string:new Mi}}var Hl=Kl;function Ol(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ul=Ol;function Gl(t,e){var s=t.__data__;return Ul(e)?s[typeof e=="string"?"string":"hash"]:s.map}var Qs=Gl;function Wl(t){var e=Qs(this,t).delete(t);return this.size-=e?1:0,e}var zl=Wl;function Ql(t){return Qs(this,t).get(t)}var Jl=Ql;function Yl(t){return Qs(this,t).has(t)}var Xl=Yl;function $l(t,e){var s=Qs(this,t),r=s.size;return s.set(t,e),this.size+=s.size==r?0:1,this}var tp=$l;function Ne(t){var e=-1,s=t==null?0:t.length;this.clear();while(++e<s){var r=t[e];this.set(r[0],r[1])}}Ne.prototype.clear=Hl;Ne.prototype.delete=zl;Ne.prototype.get=Jl;Ne.prototype.has=Xl;Ne.prototype.set=tp;var Wh=Ne,ep="Expected a function";function tn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(ep);var s=function(){var r=arguments,a=e?e.apply(this,r):r[0],n=s.cache;if(n.has(a))return n.get(a);var i=t.apply(this,r);return s.cache=n.set(a,i)||n,i};return s.cache=new(tn.Cache||Wh),s}tn.Cache=Wh;var te=tn,zh=te(()=>{return(process.env.CLAUDE_CONFIG_DIR??sp(ap(),".claude")).normalize("NFC")},()=>process.env.CLAUDE_CONFIG_DIR);function ne(t){if(!t)return!1;if(typeof t==="boolean")return t;let e=t.toLowerCase().trim();return["1","true","yes","on"].includes(e)}function Q(t,e,s,r,a){if(r==="m")throw TypeError("Private method is not writable");if(r==="a"&&!a)throw TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!a:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(t,s):a?a.value=s:e.set(t,s),s}function M(t,e,s,r){if(s==="a"&&!r)throw TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?r:s==="a"?r.call(t):r?r.value:e.get(t)}var Qh=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return Qh=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),s=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(r)=>(+r^s()&15>>+r/4).toString(16))};function fa(t){return typeof t==="object"&&t!==null&&(("name"in t)&&t.name==="AbortError"||("message"in t)&&String(t.message).includes("FetchRequestCanceledException"))}var _r=(t)=>{if(t instanceof Error)return t;if(typeof t==="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=Error(t.message,t.cause?{cause:t.cause}:{});if(t.stack)e.stack=t.stack;if(t.cause&&!e.cause)e.cause=t.cause;if(t.name)e.name=t.name;return e}}catch{}try{return Error(JSON.stringify(t))}catch{}}return Error(t)};class ht extends Error{}class $t extends ht{constructor(t,e,s,r,a){super(`${$t.makeMessage(t,e,s)}`);this.status=t,this.headers=r,this.requestID=r?.get("request-id"),this.error=e,this.type=a??null}static makeMessage(t,e,s){let r=e?.message?typeof e.message==="string"?e.message:JSON.stringify(e.message):e?JSON.stringify(e):s;if(t&&r)return`${t} ${r}`;if(t)return`${t} status code (no body)`;if(r)return r;return"(no status code or body)"}static generate(t,e,s,r){if(!t||!r)return new _a({message:s,cause:_r(e)});let a=e,n=a?.error?.type;if(t===400)return new an(t,a,s,r,n);if(t===401)return new sn(t,a,s,r,n);if(t===403)return new rn(t,a,s,r,n);if(t===404)return new nn(t,a,s,r,n);if(t===409)return new hn(t,a,s,r,n);if(t===422)return new on(t,a,s,r,n);if(t===429)return new cn(t,a,s,r,n);if(t>=500)return new dn(t,a,s,r,n);return new $t(t,a,s,r,n)}}class S0 extends $t{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class _a extends $t{constructor({message:t,cause:e}){super(void 0,void 0,t||"Connection error.",void 0);if(e)this.cause=e}}class en extends _a{constructor({message:t}={}){super({message:t??"Request timed out."})}}class an extends $t{}class sn extends $t{}class rn extends $t{}class nn extends $t{}class hn extends $t{}class on extends $t{}class cn extends $t{}class dn extends $t{}var rp=/^[a-z][a-z0-9+.-]*:/i,np=(t)=>{return rp.test(t)},Dr=(t)=>(Dr=Array.isArray,Dr(t)),Pi=Dr;function Br(t){if(typeof t!=="object")return{};return t??{}}function Li(t){if(!t)return!0;for(let e in t)return!1;return!0}function ip(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var hp=(t,e)=>{if(typeof e!=="number"||!Number.isInteger(e))throw new ht(`${t} must be an integer`);if(e<0)throw new ht(`${t} must be a positive integer`);return e},Jh=(t)=>{try{return JSON.parse(t)}catch(e){return}},op=(t)=>new Promise((e)=>setTimeout(e,t)),xe="0.81.0",cp=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function dp(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var yp=()=>{let t=dp();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xe,"X-Stainless-OS":qi(Deno.build.os),"X-Stainless-Arch":ji(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xe,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xe,"X-Stainless-OS":qi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":ji(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=lp();if(e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xe,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xe,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function lp(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:s}of t){let r=s.exec(navigator.userAgent);if(r){let a=r[1]||0,n=r[2]||0,i=r[3]||0;return{browser:e,version:`${a}.${n}.${i}`}}}return null}var ji=(t)=>{if(t==="x32")return"x32";if(t==="x86_64"||t==="x64")return"x64";if(t==="arm")return"arm";if(t==="aarch64"||t==="arm64")return"arm64";if(t)return`other:${t}`;return"unknown"},qi=(t)=>{if(t=t.toLowerCase(),t.includes("ios"))return"iOS";if(t==="android")return"Android";if(t==="darwin")return"MacOS";if(t==="win32")return"Windows";if(t==="freebsd")return"FreeBSD";if(t==="openbsd")return"OpenBSD";if(t==="linux")return"Linux";if(t)return`Other:${t}`;return"Unknown"},_i,pp=()=>{return _i??(_i=yp())};function mp(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Yh(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function Xh(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return Yh({start(){},async pull(s){let{done:r,value:a}=await e.next();if(r)s.close();else s.enqueue(a)},async cancel(){await e.return?.()}})}function yn(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let s=await e.read();if(s?.done)e.releaseLock();return s}catch(s){throw e.releaseLock(),s}},async return(){let s=e.cancel();return e.releaseLock(),await s,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Ep(t){if(t===null||typeof t!=="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),s=e.cancel();e.releaseLock(),await s}var up=({headers:t,body:e})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}};function Sp(t){return Object.entries(t).filter(([e,s])=>typeof s<"u").map(([e,s])=>{if(typeof s==="string"||typeof s==="number"||typeof s==="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(s)}`;if(s===null)return`${encodeURIComponent(e)}=`;throw new ht(`Cannot stringify type ${typeof s}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function fp(t){let e=0;for(let a of t)e+=a.length;let s=new Uint8Array(e),r=0;for(let a of t)s.set(a,r),r+=a.length;return s}var Di;function ln(t){let e;return(Di??(e=new globalThis.TextEncoder,Di=e.encode.bind(e)))(t)}var Bi;function Vi(t){let e;return(Bi??(e=new globalThis.TextDecoder,Bi=e.decode.bind(e)))(t)}var o0,c0;class we{constructor(){o0.set(this,void 0),c0.set(this,void 0),Q(this,o0,new Uint8Array,"f"),Q(this,c0,null,"f")}decode(t){if(t==null)return[];let e=t instanceof ArrayBuffer?new Uint8Array(t):typeof t==="string"?ln(t):t;Q(this,o0,fp([M(this,o0,"f"),e]),"f");let s=[],r;while((r=Tp(M(this,o0,"f"),M(this,c0,"f")))!=null){if(r.carriage&&M(this,c0,"f")==null){Q(this,c0,r.index,"f");continue}if(M(this,c0,"f")!=null&&(r.index!==M(this,c0,"f")+1||r.carriage)){s.push(Vi(M(this,o0,"f").subarray(0,M(this,c0,"f")-1))),Q(this,o0,M(this,o0,"f").subarray(M(this,c0,"f")),"f"),Q(this,c0,null,"f");continue}let a=M(this,c0,"f")!==null?r.preceding-1:r.preceding,n=Vi(M(this,o0,"f").subarray(0,a));s.push(n),Q(this,o0,M(this,o0,"f").subarray(r.index),"f"),Q(this,c0,null,"f")}return s}flush(){if(!M(this,o0,"f").length)return[];return this.decode(`
10
+ `)}}o0=new WeakMap,c0=new WeakMap;we.NEWLINE_CHARS=new Set([`
11
+ `,"\r"]);we.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Tp(t,e){for(let s=e??0;s<t.length;s++){if(t[s]===10)return{preceding:s,index:s+1,carriage:!1};if(t[s]===13)return{preceding:s,index:s+1,carriage:!0}}return null}function kp(t){for(let e=0;e<t.length-1;e++){if(t[e]===10&&t[e+1]===10)return e+2;if(t[e]===13&&t[e+1]===13)return e+2;if(t[e]===13&&t[e+1]===10&&e+3<t.length&&t[e+2]===13&&t[e+3]===10)return e+4}return-1}var Rs={off:0,error:200,warn:300,info:400,debug:500},Ni=(t,e,s)=>{if(!t)return;if(ip(Rs,t))return t;e0(s).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(Rs))}`);return};function ya(){}function za(t,e,s){if(!e||Rs[t]>Rs[s])return ya;else return e[t].bind(e)}var Rp={error:ya,warn:ya,info:ya,debug:ya},wi=new WeakMap;function e0(t){let e=t.logger,s=t.logLevel??"off";if(!e)return Rp;let r=wi.get(e);if(r&&r[0]===s)return r[1];let a={error:za("error",e,s),warn:za("warn",e,s),info:za("info",e,s),debug:za("debug",e,s)};return wi.set(e,[s,a]),a}var re=(t)=>{if(t.options)t.options={...t.options},delete t.options.headers;if(t.headers)t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,s])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":s]));if("retryOfRequestLogID"in t){if(t.retryOfRequestLogID)t.retryOf=t.retryOfRequestLogID;delete t.retryOfRequestLogID}return t},Qe;class L0{constructor(t,e,s){this.iterator=t,Qe.set(this,void 0),this.controller=e,Q(this,Qe,s,"f")}static fromSSEResponse(t,e,s){let r=!1,a=s?e0(s):console;async function*n(){if(r)throw new ht("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let i=!1;try{for await(let h of xp(t,e)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(o){throw a.error("Could not parse message into JSON:",h.data),a.error("From chunk:",h.raw),o}if(h.event==="message_start"||h.event==="message_delta"||h.event==="message_stop"||h.event==="content_block_start"||h.event==="content_block_delta"||h.event==="content_block_stop")try{yield JSON.parse(h.data)}catch(o){throw a.error("Could not parse message into JSON:",h.data),a.error("From chunk:",h.raw),o}if(h.event==="ping")continue;if(h.event==="error"){let o=Jh(h.data)??h.data,c=o?.error?.type;throw new $t(void 0,o,void 0,t.headers,c)}}i=!0}catch(h){if(fa(h))return;throw h}finally{if(!i)e.abort()}}return new L0(n,e,s)}static fromReadableStream(t,e,s){let r=!1;async function*a(){let i=new we,h=yn(t);for await(let o of h)for(let c of i.decode(o))yield c;for(let o of i.flush())yield o}async function*n(){if(r)throw new ht("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let i=!1;try{for await(let h of a()){if(i)continue;if(h)yield JSON.parse(h)}i=!0}catch(h){if(fa(h))return;throw h}finally{if(!i)e.abort()}}return new L0(n,e,s)}[(Qe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],e=[],s=this.iterator(),r=(a)=>{return{next:()=>{if(a.length===0){let n=s.next();t.push(n),e.push(n)}return a.shift()}}};return[new L0(()=>r(t),this.controller,M(this,Qe,"f")),new L0(()=>r(e),this.controller,M(this,Qe,"f"))]}toReadableStream(){let t=this,e;return Yh({async start(){e=t[Symbol.asyncIterator]()},async pull(s){try{let{value:r,done:a}=await e.next();if(a)return s.close();let n=ln(JSON.stringify(r)+`
12
+ `);s.enqueue(n)}catch(r){s.error(r)}},async cancel(){await e.return?.()}})}}async function*xp(t,e){if(!t.body){if(e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new ht("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ht("Attempted to iterate over a response with no body")}let s=new $h,r=new we,a=yn(t.body);for await(let n of Cp(a))for(let i of r.decode(n)){let h=s.decode(i);if(h)yield h}for(let n of r.flush()){let i=s.decode(n);if(i)yield i}}async function*Cp(t){let e=new Uint8Array;for await(let s of t){if(s==null)continue;let r=s instanceof ArrayBuffer?new Uint8Array(s):typeof s==="string"?ln(s):s,a=new Uint8Array(e.length+r.length);a.set(e),a.set(r,e.length),e=a;let n;while((n=kp(e))!==-1)yield e.slice(0,n),e=e.slice(n)}if(e.length>0)yield e}class $h{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r"))t=t.substring(0,t.length-1);if(!t){if(!this.event&&!this.data.length)return null;let a={event:this.event,data:this.data.join(`
13
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],a}if(this.chunks.push(t),t.startsWith(":"))return null;let[e,s,r]=Ip(t,":");if(r.startsWith(" "))r=r.substring(1);if(e==="event")this.event=r;else if(e==="data")this.data.push(r);return null}}function Ip(t,e){let s=t.indexOf(e);if(s!==-1)return[t.substring(0,s),e,t.substring(s+e.length)];return[t,"",""]}async function to(t,e){let{response:s,requestLogID:r,retryOfRequestLogID:a,startTime:n}=e,i=await(async()=>{if(e.options.stream){if(e0(t).debug("response",s.status,s.url,s.headers,s.body),e.options.__streamClass)return e.options.__streamClass.fromSSEResponse(s,e.controller);return L0.fromSSEResponse(s,e.controller)}if(s.status===204)return null;if(e.options.__binaryResponse)return s;let h=s.headers.get("content-type")?.split(";")[0]?.trim();if(h?.includes("application/json")||h?.endsWith("+json")){if(s.headers.get("content-length")==="0")return;let o=await s.json();return eo(o,s)}return await s.text()})();return e0(t).debug(`[${r}] response parsed`,re({retryOfRequestLogID:a,url:s.url,status:s.status,body:i,durationMs:Date.now()-n})),i}function eo(t,e){if(!t||typeof t!=="object"||Array.isArray(t))return t;return Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var la;class Js extends Promise{constructor(t,e,s=to){super((r)=>{r(null)});this.responsePromise=e,this.parseResponse=s,la.set(this,void 0),Q(this,la,t,"f")}_thenUnwrap(t){return new Js(M(this,la,"f"),this.responsePromise,async(e,s)=>eo(t(await this.parseResponse(e,s),s),s.response))}asResponse(){return this.responsePromise.then((t)=>t.response)}async withResponse(){let[t,e]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:e,request_id:e.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((t)=>this.parseResponse(M(this,la,"f"),t));return this.parsedPromise}then(t,e){return this.parse().then(t,e)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}}la=new WeakMap;var Qa;class pn{constructor(t,e,s,r){Qa.set(this,void 0),Q(this,Qa,t,"f"),this.options=r,this.response=e,this.body=s}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new ht("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await M(this,Qa,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;yield t;while(t.hasNextPage())t=await t.getNextPage(),yield t}async*[(Qa=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let e of t.getPaginatedItems())yield e}}class ao extends Js{constructor(t,e,s){super(t,e,async(r,a)=>new s(r,a.response,await to(r,a),a.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let e of t)yield e}}class Ke extends pn{constructor(t,e,s,r){super(t,e,s,r);this.data=s.data||[],this.has_more=s.has_more||!1,this.first_id=s.first_id||null,this.last_id=s.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let e=this.first_id;if(!e)return null;return{...this.options,query:{...Br(this.options.query),before_id:e}}}let t=this.last_id;if(!t)return null;return{...this.options,query:{...Br(this.options.query),after_id:t}}}}class mn extends pn{constructor(t,e,s,r){super(t,e,s,r);this.data=s.data||[],this.has_more=s.has_more||!1,this.next_page=s.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let t=this.next_page;if(!t)return null;return{...this.options,query:{...Br(this.options.query),page:t}}}}var so=()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node==="string"&&parseInt(t.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function be(t,e,s){return so(),new File(t,e??"unknown_file",s)}function ps(t,e){let s=typeof t==="object"&&t!==null&&(("name"in t)&&t.name&&String(t.name)||("url"in t)&&t.url&&String(t.url)||("filename"in t)&&t.filename&&String(t.filename)||("path"in t)&&t.path&&String(t.path))||"";return e?s.split(/[\\/]/).pop()||void 0:s}var ro=(t)=>t!=null&&typeof t==="object"&&typeof t[Symbol.asyncIterator]==="function",En=async(t,e,s=!0)=>{return{...t,body:await gp(t.body,e,s)}},Ki=new WeakMap;function vp(t){let e=typeof t==="function"?t:t.fetch,s=Ki.get(e);if(s)return s;let r=(async()=>{try{let a="Response"in e?e.Response:(await e("data:,")).constructor,n=new FormData;if(n.toString()===await new a(n).text())return!1;return!0}catch{return!0}})();return Ki.set(e,r),r}var gp=async(t,e,s=!0)=>{if(!await vp(e))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(t||{}).map(([a,n])=>Vr(r,a,n,s))),r},bp=(t)=>t instanceof Blob&&("name"in t),Vr=async(t,e,s,r)=>{if(s===void 0)return;if(s==null)throw TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof s==="string"||typeof s==="number"||typeof s==="boolean")t.append(e,String(s));else if(s instanceof Response){let a={},n=s.headers.get("Content-Type");if(n)a={type:n};t.append(e,be([await s.blob()],ps(s,r),a))}else if(ro(s))t.append(e,be([await new Response(Xh(s)).blob()],ps(s,r)));else if(bp(s))t.append(e,be([s],ps(s,r),{type:s.type}));else if(Array.isArray(s))await Promise.all(s.map((a)=>Vr(t,e+"[]",a,r)));else if(typeof s==="object")await Promise.all(Object.entries(s).map(([a,n])=>Vr(t,`${e}[${a}]`,n,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${s} instead`)},no=(t)=>t!=null&&typeof t==="object"&&typeof t.size==="number"&&typeof t.type==="string"&&typeof t.text==="function"&&typeof t.slice==="function"&&typeof t.arrayBuffer==="function",Ap=(t)=>t!=null&&typeof t==="object"&&typeof t.name==="string"&&typeof t.lastModified==="number"&&no(t),Zp=(t)=>t!=null&&typeof t==="object"&&typeof t.url==="string"&&typeof t.blob==="function";async function Fp(t,e,s){if(so(),t=await t,e||(e=ps(t,!0)),Ap(t)){if(t instanceof File&&e==null&&s==null)return t;return be([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...s})}if(Zp(t)){let a=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),be(await Nr(a),e,s)}let r=await Nr(t);if(!s?.type){let a=r.find((n)=>typeof n==="object"&&("type"in n)&&n.type);if(typeof a==="string")s={...s,type:a}}return be(r,e,s)}async function Nr(t){let e=[];if(typeof t==="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(no(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(ro(t))for await(let s of t)e.push(...await Nr(s));else{let s=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${s?`; constructor: ${s}`:""}${Mp(t)}`)}return e}function Mp(t){if(typeof t!=="object"||t===null)return"";return`; props: [${Object.getOwnPropertyNames(t).map((e)=>`"${e}"`).join(", ")}]`}class k0{constructor(t){this._client=t}}var io=Symbol.for("brand.privateNullableHeaders");function*Pp(t){if(!t)return;if(io in t){let{values:r,nulls:a}=t;yield*r.entries();for(let n of a)yield[n,null];return}let e=!1,s;if(t instanceof Headers)s=t.entries();else if(Pi(t))s=t;else e=!0,s=Object.entries(t??{});for(let r of s){let a=r[0];if(typeof a!=="string")throw TypeError("expected header name to be a string");let n=Pi(r[1])?r[1]:[r[1]],i=!1;for(let h of n){if(h===void 0)continue;if(e&&!i)i=!0,yield[a,null];yield[a,h]}}}var kt=(t)=>{let e=new Headers,s=new Set;for(let r of t){let a=new Set;for(let[n,i]of Pp(r)){let h=n.toLowerCase();if(!a.has(h))e.delete(n),a.add(h);if(i===null)e.delete(n),s.add(h);else e.append(n,i),s.delete(h)}}return{[io]:!0,values:e,nulls:s}},Ea=Symbol("anthropic.sdk.stainlessHelper");function ms(t){return typeof t==="object"&&t!==null&&Ea in t}function ho(t,e){let s=new Set;if(t){for(let r of t)if(ms(r))s.add(r[Ea])}if(e)for(let r of e){if(ms(r))s.add(r[Ea]);if(Array.isArray(r.content)){for(let a of r.content)if(ms(a))s.add(a[Ea])}}return Array.from(s)}function oo(t,e){let s=ho(t,e);if(s.length===0)return{};return{"x-stainless-helper":s.join(", ")}}function Lp(t){if(ms(t))return{"x-stainless-helper":t[Ea]};return{}}function co(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Hi=Object.freeze(Object.create(null)),jp=(t=co)=>function(e,...s){if(e.length===1)return e[0];let r=!1,a=[],n=e.reduce((c,m,u)=>{if(/[?#]/.test(m))r=!0;let p=s[u],k=(r?encodeURIComponent:t)(""+p);if(u!==s.length&&(p==null||typeof p==="object"&&p.toString===Object.getPrototypeOf(Object.getPrototypeOf(p.hasOwnProperty??Hi)??Hi)?.toString))k=p+"",a.push({start:c.length+m.length,length:k.length,error:`Value of type ${Object.prototype.toString.call(p).slice(8,-1)} is not a valid path parameter`});return c+m+(u===s.length?"":k)},""),i=n.split(/[?#]/,1)[0],h=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,o;while((o=h.exec(i))!==null)a.push({start:o.index,length:o[0].length,error:`Value "${o[0]}" can't be safely passed as a path parameter`});if(a.sort((c,m)=>c.start-m.start),a.length>0){let c=0,m=a.reduce((u,p)=>{let k=" ".repeat(p.start-c),C="^".repeat(p.length);return c=p.start+p.length,u+k+C},"");throw new ht(`Path parameters result in path with invalid segments:
14
+ ${a.map((u)=>u.error).join(`
15
15
  `)}
16
- ${S}
17
- ${k}`)}return S},z0=jf(nS);class ay extends i3{list(E={},y){let{betas:p,...h}=E??{};return this._client.getAPIList("/v1/files",K6,{query:h,...y,headers:i0([{"anthropic-beta":[...p??[],"files-api-2025-04-14"].toString()},y?.headers])})}delete(E,y={},p){let{betas:h}=y??{};return this._client.delete(z0`/v1/files/${E}`,{...p,headers:i0([{"anthropic-beta":[...h??[],"files-api-2025-04-14"].toString()},p?.headers])})}download(E,y={},p){let{betas:h}=y??{};return this._client.get(z0`/v1/files/${E}/content`,{...p,headers:i0([{"anthropic-beta":[...h??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},p?.headers]),__binaryResponse:!0})}retrieveMetadata(E,y={},p){let{betas:h}=y??{};return this._client.get(z0`/v1/files/${E}`,{...p,headers:i0([{"anthropic-beta":[...h??[],"files-api-2025-04-14"].toString()},p?.headers])})}upload(E,y){let{betas:p,...h}=E;return this._client.post("/v1/files",ky({body:h,...y,headers:i0([{"anthropic-beta":[...p??[],"files-api-2025-04-14"].toString()},Lf(h.file),y?.headers])},this._client))}}class Cy extends i3{retrieve(E,y={},p){let{betas:h}=y??{};return this._client.get(z0`/v1/models/${E}?beta=true`,{...p,headers:i0([{...h?.toString()!=null?{"anthropic-beta":h?.toString()}:void 0},p?.headers])})}list(E={},y){let{betas:p,...h}=E??{};return this._client.getAPIList("/v1/models?beta=true",K6,{query:h,...y,headers:i0([{...p?.toString()!=null?{"anthropic-beta":p?.toString()}:void 0},y?.headers])})}}var rS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function TS(E){return E?.output_format??E?.output_config?.format}function Kp(E,y,p){let h=TS(y);if(!y||!("parse"in(h??{})))return{...E,content:E.content.map((d)=>{if(d.type==="text"){let S=Object.defineProperty({...d},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(S,"parsed",{get(){return p.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return d}),parsed_output:null};return mS(E,y,p)}function mS(E,y,p){let h=null,d=E.content.map((S)=>{if(S.type==="text"){let c=qf(y,S.text);if(h===null)h=c;let n=Object.defineProperty({...S},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(n,"parsed",{get(){return p.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return S});return{...E,content:d,parsed_output:h}}function qf(E,y){let p=TS(E);if(p?.type!=="json_schema")return null;try{if("parse"in p)return p.parse(y);return JSON.parse(y)}catch(h){throw new n0(`Failed to parse structured output: ${h}`)}}var _f=(E)=>{let y=0,p=[];while(y<E.length){let h=E[y];if(h==="\\"){y++;continue}if(h==="{"){p.push({type:"brace",value:"{"}),y++;continue}if(h==="}"){p.push({type:"brace",value:"}"}),y++;continue}if(h==="["){p.push({type:"paren",value:"["}),y++;continue}if(h==="]"){p.push({type:"paren",value:"]"}),y++;continue}if(h===":"){p.push({type:"separator",value:":"}),y++;continue}if(h===","){p.push({type:"delimiter",value:","}),y++;continue}if(h==='"'){let c="",n=!1;h=E[++y];while(h!=='"'){if(y===E.length){n=!0;break}if(h==="\\"){if(y++,y===E.length){n=!0;break}c+=h+E[y],h=E[++y]}else c+=h,h=E[++y]}if(h=E[++y],!n)p.push({type:"string",value:c});continue}if(h&&/\s/.test(h)){y++;continue}let d=/[0-9]/;if(h&&d.test(h)||h==="-"||h==="."){let c="";if(h==="-")c+=h,h=E[++y];while(h&&d.test(h)||h===".")c+=h,h=E[++y];p.push({type:"number",value:c});continue}let S=/[a-z]/i;if(h&&S.test(h)){let c="";while(h&&S.test(h)){if(y===E.length)break;c+=h,h=E[++y]}if(c=="true"||c=="false"||c==="null")p.push({type:"name",value:c});else{y++;continue}continue}y++}return p},v6=(E)=>{if(E.length===0)return E;let y=E[E.length-1];switch(y.type){case"separator":return E=E.slice(0,E.length-1),v6(E);case"number":let p=y.value[y.value.length-1];if(p==="."||p==="-")return E=E.slice(0,E.length-1),v6(E);case"string":let h=E[E.length-2];if(h?.type==="delimiter")return E=E.slice(0,E.length-1),v6(E);else if(h?.type==="brace"&&h.value==="{")return E=E.slice(0,E.length-1),v6(E);break;case"delimiter":return E=E.slice(0,E.length-1),v6(E)}return E},Df=(E)=>{let y=[];if(E.map((p)=>{if(p.type==="brace")if(p.value==="{")y.push("}");else y.splice(y.lastIndexOf("}"),1);if(p.type==="paren")if(p.value==="[")y.push("]");else y.splice(y.lastIndexOf("]"),1)}),y.length>0)y.reverse().map((p)=>{if(p==="}")E.push({type:"brace",value:"}"});else if(p==="]")E.push({type:"paren",value:"]"})});return E},Vf=(E)=>{let y="";return E.map((p)=>{switch(p.type){case"string":y+='"'+p.value+'"';break;default:y+=p.value;break}}),y},RS=(E)=>JSON.parse(Vf(Df(v6(_f(E))))),u3,W3,x6,J6,J4,Y6,X6,Y4,$6,D3,E4,X4,$4,y6,E8,y8,y4,FE,Hp,d8,AE,ME,sE,Op,Up="__json_buf";function Gp(E){return E.type==="tool_use"||E.type==="server_tool_use"||E.type==="mcp_tool_use"}class Z8{constructor(E,y){u3.add(this),this.messages=[],this.receivedMessages=[],W3.set(this,void 0),x6.set(this,null),this.controller=new AbortController,J6.set(this,void 0),J4.set(this,()=>{}),Y6.set(this,()=>{}),X6.set(this,void 0),Y4.set(this,()=>{}),$6.set(this,()=>{}),D3.set(this,{}),E4.set(this,!1),X4.set(this,!1),$4.set(this,!1),y6.set(this,!1),E8.set(this,void 0),y8.set(this,void 0),y4.set(this,void 0),d8.set(this,(p)=>{if(Q(this,X4,!0,"f"),x4(p))p=new o3;if(p instanceof o3)return Q(this,$4,!0,"f"),this._emit("abort",p);if(p instanceof n0)return this._emit("error",p);if(p instanceof Error){let h=new n0(p.message);return h.cause=p,this._emit("error",h)}return this._emit("error",new n0(String(p)))}),Q(this,J6,new Promise((p,h)=>{Q(this,J4,p,"f"),Q(this,Y6,h,"f")}),"f"),Q(this,X6,new Promise((p,h)=>{Q(this,Y4,p,"f"),Q(this,$6,h,"f")}),"f"),l(this,J6,"f").catch(()=>{}),l(this,X6,"f").catch(()=>{}),Q(this,x6,E,"f"),Q(this,y4,y?.logger??console,"f")}get response(){return l(this,E8,"f")}get request_id(){return l(this,y8,"f")}async withResponse(){Q(this,y6,!0,"f");let E=await l(this,J6,"f");if(!E)throw Error("Could not resolve a `Response` object");return{data:this,response:E,request_id:E.headers.get("request-id")}}static fromReadableStream(E){let y=new Z8(null);return y._run(()=>y._fromReadableStream(E)),y}static createMessage(E,y,p,{logger:h}={}){let d=new Z8(y,{logger:h});for(let S of y.messages)d._addMessageParam(S);return Q(d,x6,{...y,stream:!0},"f"),d._run(()=>d._createMessage(E,{...y,stream:!0},{...p,headers:{...p?.headers,"X-Stainless-Helper-Method":"stream"}})),d}_run(E){E().then(()=>{this._emitFinal(),this._emit("end")},l(this,d8,"f"))}_addMessageParam(E){this.messages.push(E)}_addMessage(E,y=!0){if(this.receivedMessages.push(E),y)this._emit("message",E)}async _createMessage(E,y,p){let h=p?.signal,d;if(h){if(h.aborted)this.controller.abort();d=this.controller.abort.bind(this.controller),h.addEventListener("abort",d)}try{l(this,u3,"m",AE).call(this);let{response:S,data:c}=await E.create({...y,stream:!0},{...p,signal:this.controller.signal}).withResponse();this._connected(S);for await(let n of c)l(this,u3,"m",ME).call(this,n);if(c.controller.signal?.aborted)throw new o3;l(this,u3,"m",sE).call(this)}finally{if(h&&d)h.removeEventListener("abort",d)}}_connected(E){if(this.ended)return;Q(this,E8,E,"f"),Q(this,y8,E?.headers.get("request-id"),"f"),l(this,J4,"f").call(this,E),this._emit("connect")}get ended(){return l(this,E4,"f")}get errored(){return l(this,X4,"f")}get aborted(){return l(this,$4,"f")}abort(){this.controller.abort()}on(E,y){return(l(this,D3,"f")[E]||(l(this,D3,"f")[E]=[])).push({listener:y}),this}off(E,y){let p=l(this,D3,"f")[E];if(!p)return this;let h=p.findIndex((d)=>d.listener===y);if(h>=0)p.splice(h,1);return this}once(E,y){return(l(this,D3,"f")[E]||(l(this,D3,"f")[E]=[])).push({listener:y,once:!0}),this}emitted(E){return new Promise((y,p)=>{if(Q(this,y6,!0,"f"),E!=="error")this.once("error",p);this.once(E,y)})}async done(){Q(this,y6,!0,"f"),await l(this,X6,"f")}get currentMessage(){return l(this,W3,"f")}async finalMessage(){return await this.done(),l(this,u3,"m",FE).call(this)}async finalText(){return await this.done(),l(this,u3,"m",Hp).call(this)}_emit(E,...y){if(l(this,E4,"f"))return;if(E==="end")Q(this,E4,!0,"f"),l(this,Y4,"f").call(this);let p=l(this,D3,"f")[E];if(p)l(this,D3,"f")[E]=p.filter((h)=>!h.once),p.forEach(({listener:h})=>h(...y));if(E==="abort"){let h=y[0];if(!l(this,y6,"f")&&!p?.length)Promise.reject(h);l(this,Y6,"f").call(this,h),l(this,$6,"f").call(this,h),this._emit("end");return}if(E==="error"){let h=y[0];if(!l(this,y6,"f")&&!p?.length)Promise.reject(h);l(this,Y6,"f").call(this,h),l(this,$6,"f").call(this,h),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",l(this,u3,"m",FE).call(this))}async _fromReadableStream(E,y){let p=y?.signal,h;if(p){if(p.aborted)this.controller.abort();h=this.controller.abort.bind(this.controller),p.addEventListener("abort",h)}try{l(this,u3,"m",AE).call(this),this._connected(null);let d=L3.fromReadableStream(E,this.controller);for await(let S of d)l(this,u3,"m",ME).call(this,S);if(d.controller.signal?.aborted)throw new o3;l(this,u3,"m",sE).call(this)}finally{if(p&&h)p.removeEventListener("abort",h)}}[(W3=new WeakMap,x6=new WeakMap,J6=new WeakMap,J4=new WeakMap,Y6=new WeakMap,X6=new WeakMap,Y4=new WeakMap,$6=new WeakMap,D3=new WeakMap,E4=new WeakMap,X4=new WeakMap,$4=new WeakMap,y6=new WeakMap,E8=new WeakMap,y8=new WeakMap,y4=new WeakMap,d8=new WeakMap,u3=new WeakSet,FE=function(){if(this.receivedMessages.length===0)throw new n0("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Hp=function(){if(this.receivedMessages.length===0)throw new n0("stream ended without producing a Message with role=assistant");let E=this.receivedMessages.at(-1).content.filter((y)=>y.type==="text").map((y)=>y.text);if(E.length===0)throw new n0("stream ended without producing a content block with type=text");return E.join(" ")},AE=function(){if(this.ended)return;Q(this,W3,void 0,"f")},ME=function(E){if(this.ended)return;let y=l(this,u3,"m",Op).call(this,E);switch(this._emit("streamEvent",E,y),E.type){case"content_block_delta":{let p=y.content.at(-1);switch(E.delta.type){case"text_delta":{if(p.type==="text")this._emit("text",E.delta.text,p.text||"");break}case"citations_delta":{if(p.type==="text")this._emit("citation",E.delta.citation,p.citations??[]);break}case"input_json_delta":{if(Gp(p)&&p.input)this._emit("inputJson",E.delta.partial_json,p.input);break}case"thinking_delta":{if(p.type==="thinking")this._emit("thinking",E.delta.thinking,p.thinking);break}case"signature_delta":{if(p.type==="thinking")this._emit("signature",p.signature);break}case"compaction_delta":{if(p.type==="compaction"&&p.content)this._emit("compaction",p.content);break}default:Wp(E.delta)}break}case"message_stop":{this._addMessageParam(y),this._addMessage(Kp(y,l(this,x6,"f"),{logger:l(this,y4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",y.content.at(-1));break}case"message_start":{Q(this,W3,y,"f");break}case"content_block_start":case"message_delta":break}},sE=function(){if(this.ended)throw new n0("stream has ended, this shouldn't happen");let E=l(this,W3,"f");if(!E)throw new n0("request ended without sending any chunks");return Q(this,W3,void 0,"f"),Kp(E,l(this,x6,"f"),{logger:l(this,y4,"f")})},Op=function(E){let y=l(this,W3,"f");if(E.type==="message_start"){if(y)throw new n0(`Unexpected event order, got ${E.type} before receiving "message_stop"`);return E.message}if(!y)throw new n0(`Unexpected event order, got ${E.type} before "message_start"`);switch(E.type){case"message_stop":return y;case"message_delta":if(y.container=E.delta.container,y.stop_reason=E.delta.stop_reason,y.stop_sequence=E.delta.stop_sequence,y.usage.output_tokens=E.usage.output_tokens,y.context_management=E.context_management,E.usage.input_tokens!=null)y.usage.input_tokens=E.usage.input_tokens;if(E.usage.cache_creation_input_tokens!=null)y.usage.cache_creation_input_tokens=E.usage.cache_creation_input_tokens;if(E.usage.cache_read_input_tokens!=null)y.usage.cache_read_input_tokens=E.usage.cache_read_input_tokens;if(E.usage.server_tool_use!=null)y.usage.server_tool_use=E.usage.server_tool_use;if(E.usage.iterations!=null)y.usage.iterations=E.usage.iterations;return y;case"content_block_start":return y.content.push(E.content_block),y;case"content_block_delta":{let p=y.content.at(E.index);switch(E.delta.type){case"text_delta":{if(p?.type==="text")y.content[E.index]={...p,text:(p.text||"")+E.delta.text};break}case"citations_delta":{if(p?.type==="text")y.content[E.index]={...p,citations:[...p.citations??[],E.delta.citation]};break}case"input_json_delta":{if(p&&Gp(p)){let h=p[Up]||"";h+=E.delta.partial_json;let d={...p};if(Object.defineProperty(d,Up,{value:h,enumerable:!1,writable:!0}),h)try{d.input=RS(h)}catch(S){let c=new n0(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${S}. JSON: ${h}`);l(this,d8,"f").call(this,c)}y.content[E.index]=d}break}case"thinking_delta":{if(p?.type==="thinking")y.content[E.index]={...p,thinking:p.thinking+E.delta.thinking};break}case"signature_delta":{if(p?.type==="thinking")y.content[E.index]={...p,signature:E.delta.signature};break}case"compaction_delta":{if(p?.type==="compaction")y.content[E.index]={...p,content:(p.content||"")+E.delta.content};break}default:Wp(E.delta)}return y}case"content_block_stop":return y}},Symbol.asyncIterator)](){let E=[],y=[],p=!1;return this.on("streamEvent",(h)=>{let d=y.shift();if(d)d.resolve(h);else E.push(h)}),this.on("end",()=>{p=!0;for(let h of y)h.resolve(void 0);y.length=0}),this.on("abort",(h)=>{p=!0;for(let d of y)d.reject(h);y.length=0}),this.on("error",(h)=>{p=!0;for(let d of y)d.reject(h);y.length=0}),{next:async()=>{if(!E.length){if(p)return{value:void 0,done:!0};return new Promise((h,d)=>y.push({resolve:h,reject:d})).then((h)=>h?{value:h,done:!1}:{value:void 0,done:!0})}return{value:E.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new L3(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function Wp(E){}class oy extends Error{constructor(E){let y=typeof E==="string"?E:E.map((p)=>{if(p.type==="text")return p.text;return`[${p.type}]`}).join(" ");super(y);this.name="ToolError",this.content=E}}var Bf=1e5,Nf=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
16
+ ${n}
17
+ ${m}`)}return n},zt=jp(co);class un extends k0{list(t={},e){let{betas:s,...r}=t??{};return this._client.getAPIList("/v1/files",Ke,{query:r,...e,headers:kt([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},e?.headers])})}delete(t,e={},s){let{betas:r}=e??{};return this._client.delete(zt`/v1/files/${t}`,{...s,headers:kt([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},s?.headers])})}download(t,e={},s){let{betas:r}=e??{};return this._client.get(zt`/v1/files/${t}/content`,{...s,headers:kt([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},s?.headers]),__binaryResponse:!0})}retrieveMetadata(t,e={},s){let{betas:r}=e??{};return this._client.get(zt`/v1/files/${t}`,{...s,headers:kt([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},s?.headers])})}upload(t,e){let{betas:s,...r}=t;return this._client.post("/v1/files",En({body:r,...e,headers:kt([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},Lp(r.file),e?.headers])},this._client))}}class Sn extends k0{retrieve(t,e={},s){let{betas:r}=e??{};return this._client.get(zt`/v1/models/${t}?beta=true`,{...s,headers:kt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},s?.headers])})}list(t={},e){let{betas:s,...r}=t??{};return this._client.getAPIList("/v1/models?beta=true",Ke,{query:r,...e,headers:kt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},e?.headers])})}}var yo={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function lo(t){return t?.output_format??t?.output_config?.format}function Oi(t,e,s){let r=lo(e);if(!e||!("parse"in(r??{})))return{...t,content:t.content.map((a)=>{if(a.type==="text"){let n=Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(n,"parsed",{get(){return s.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return a}),parsed_output:null};return po(t,e,s)}function po(t,e,s){let r=null,a=t.content.map((n)=>{if(n.type==="text"){let i=qp(e,n.text);if(r===null)r=i;let h=Object.defineProperty({...n},"parsed_output",{value:i,enumerable:!1});return Object.defineProperty(h,"parsed",{get(){return s.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),i},enumerable:!1})}return n});return{...t,content:a,parsed_output:r}}function qp(t,e){let s=lo(t);if(s?.type!=="json_schema")return null;try{if("parse"in s)return s.parse(e);return JSON.parse(e)}catch(r){throw new ht(`Failed to parse structured output: ${r}`)}}var _p=(t)=>{let e=0,s=[];while(e<t.length){let r=t[e];if(r==="\\"){e++;continue}if(r==="{"){s.push({type:"brace",value:"{"}),e++;continue}if(r==="}"){s.push({type:"brace",value:"}"}),e++;continue}if(r==="["){s.push({type:"paren",value:"["}),e++;continue}if(r==="]"){s.push({type:"paren",value:"]"}),e++;continue}if(r===":"){s.push({type:"separator",value:":"}),e++;continue}if(r===","){s.push({type:"delimiter",value:","}),e++;continue}if(r==='"'){let i="",h=!1;r=t[++e];while(r!=='"'){if(e===t.length){h=!0;break}if(r==="\\"){if(e++,e===t.length){h=!0;break}i+=r+t[e],r=t[++e]}else i+=r,r=t[++e]}if(r=t[++e],!h)s.push({type:"string",value:i});continue}if(r&&/\s/.test(r)){e++;continue}let a=/[0-9]/;if(r&&a.test(r)||r==="-"||r==="."){let i="";if(r==="-")i+=r,r=t[++e];while(r&&a.test(r)||r===".")i+=r,r=t[++e];s.push({type:"number",value:i});continue}let n=/[a-z]/i;if(r&&n.test(r)){let i="";while(r&&n.test(r)){if(e===t.length)break;i+=r,r=t[++e]}if(i=="true"||i=="false"||i==="null")s.push({type:"name",value:i});else{e++;continue}continue}e++}return s},Ce=(t)=>{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),Ce(t);case"number":let s=e.value[e.value.length-1];if(s==="."||s==="-")return t=t.slice(0,t.length-1),Ce(t);case"string":let r=t[t.length-2];if(r?.type==="delimiter")return t=t.slice(0,t.length-1),Ce(t);else if(r?.type==="brace"&&r.value==="{")return t=t.slice(0,t.length-1),Ce(t);break;case"delimiter":return t=t.slice(0,t.length-1),Ce(t)}return t},Dp=(t)=>{let e=[];if(t.map((s)=>{if(s.type==="brace")if(s.value==="{")e.push("}");else e.splice(e.lastIndexOf("}"),1);if(s.type==="paren")if(s.value==="[")e.push("]");else e.splice(e.lastIndexOf("]"),1)}),e.length>0)e.reverse().map((s)=>{if(s==="}")t.push({type:"brace",value:"}"});else if(s==="]")t.push({type:"paren",value:"]"})});return t},Bp=(t)=>{let e="";return t.map((s)=>{switch(s.type){case"string":e+='"'+s.value+'"';break;default:e+=s.value;break}}),e},mo=(t)=>JSON.parse(Bp(Dp(Ce(_p(t))))),p0,W0,fe,Je,Ja,Ye,Xe,Ya,$e,V0,ta,Xa,$a,ee,ts,es,ea,Ir,Ui,as,vr,gr,br,Gi,Wi="__json_buf";function zi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}class xs{constructor(t,e){p0.add(this),this.messages=[],this.receivedMessages=[],W0.set(this,void 0),fe.set(this,null),this.controller=new AbortController,Je.set(this,void 0),Ja.set(this,()=>{}),Ye.set(this,()=>{}),Xe.set(this,void 0),Ya.set(this,()=>{}),$e.set(this,()=>{}),V0.set(this,{}),ta.set(this,!1),Xa.set(this,!1),$a.set(this,!1),ee.set(this,!1),ts.set(this,void 0),es.set(this,void 0),ea.set(this,void 0),as.set(this,(s)=>{if(Q(this,Xa,!0,"f"),fa(s))s=new S0;if(s instanceof S0)return Q(this,$a,!0,"f"),this._emit("abort",s);if(s instanceof ht)return this._emit("error",s);if(s instanceof Error){let r=new ht(s.message);return r.cause=s,this._emit("error",r)}return this._emit("error",new ht(String(s)))}),Q(this,Je,new Promise((s,r)=>{Q(this,Ja,s,"f"),Q(this,Ye,r,"f")}),"f"),Q(this,Xe,new Promise((s,r)=>{Q(this,Ya,s,"f"),Q(this,$e,r,"f")}),"f"),M(this,Je,"f").catch(()=>{}),M(this,Xe,"f").catch(()=>{}),Q(this,fe,t,"f"),Q(this,ea,e?.logger??console,"f")}get response(){return M(this,ts,"f")}get request_id(){return M(this,es,"f")}async withResponse(){Q(this,ee,!0,"f");let t=await M(this,Je,"f");if(!t)throw Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){let e=new xs(null);return e._run(()=>e._fromReadableStream(t)),e}static createMessage(t,e,s,{logger:r}={}){let a=new xs(e,{logger:r});for(let n of e.messages)a._addMessageParam(n);return Q(a,fe,{...e,stream:!0},"f"),a._run(()=>a._createMessage(t,{...e,stream:!0},{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),a}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},M(this,as,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,e=!0){if(this.receivedMessages.push(t),e)this._emit("message",t)}async _createMessage(t,e,s){let r=s?.signal,a;if(r){if(r.aborted)this.controller.abort();a=this.controller.abort.bind(this.controller),r.addEventListener("abort",a)}try{M(this,p0,"m",vr).call(this);let{response:n,data:i}=await t.create({...e,stream:!0},{...s,signal:this.controller.signal}).withResponse();this._connected(n);for await(let h of i)M(this,p0,"m",gr).call(this,h);if(i.controller.signal?.aborted)throw new S0;M(this,p0,"m",br).call(this)}finally{if(r&&a)r.removeEventListener("abort",a)}}_connected(t){if(this.ended)return;Q(this,ts,t,"f"),Q(this,es,t?.headers.get("request-id"),"f"),M(this,Ja,"f").call(this,t),this._emit("connect")}get ended(){return M(this,ta,"f")}get errored(){return M(this,Xa,"f")}get aborted(){return M(this,$a,"f")}abort(){this.controller.abort()}on(t,e){return(M(this,V0,"f")[t]||(M(this,V0,"f")[t]=[])).push({listener:e}),this}off(t,e){let s=M(this,V0,"f")[t];if(!s)return this;let r=s.findIndex((a)=>a.listener===e);if(r>=0)s.splice(r,1);return this}once(t,e){return(M(this,V0,"f")[t]||(M(this,V0,"f")[t]=[])).push({listener:e,once:!0}),this}emitted(t){return new Promise((e,s)=>{if(Q(this,ee,!0,"f"),t!=="error")this.once("error",s);this.once(t,e)})}async done(){Q(this,ee,!0,"f"),await M(this,Xe,"f")}get currentMessage(){return M(this,W0,"f")}async finalMessage(){return await this.done(),M(this,p0,"m",Ir).call(this)}async finalText(){return await this.done(),M(this,p0,"m",Ui).call(this)}_emit(t,...e){if(M(this,ta,"f"))return;if(t==="end")Q(this,ta,!0,"f"),M(this,Ya,"f").call(this);let s=M(this,V0,"f")[t];if(s)M(this,V0,"f")[t]=s.filter((r)=>!r.once),s.forEach(({listener:r})=>r(...e));if(t==="abort"){let r=e[0];if(!M(this,ee,"f")&&!s?.length)Promise.reject(r);M(this,Ye,"f").call(this,r),M(this,$e,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=e[0];if(!M(this,ee,"f")&&!s?.length)Promise.reject(r);M(this,Ye,"f").call(this,r),M(this,$e,"f").call(this,r),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,p0,"m",Ir).call(this))}async _fromReadableStream(t,e){let s=e?.signal,r;if(s){if(s.aborted)this.controller.abort();r=this.controller.abort.bind(this.controller),s.addEventListener("abort",r)}try{M(this,p0,"m",vr).call(this),this._connected(null);let a=L0.fromReadableStream(t,this.controller);for await(let n of a)M(this,p0,"m",gr).call(this,n);if(a.controller.signal?.aborted)throw new S0;M(this,p0,"m",br).call(this)}finally{if(s&&r)s.removeEventListener("abort",r)}}[(W0=new WeakMap,fe=new WeakMap,Je=new WeakMap,Ja=new WeakMap,Ye=new WeakMap,Xe=new WeakMap,Ya=new WeakMap,$e=new WeakMap,V0=new WeakMap,ta=new WeakMap,Xa=new WeakMap,$a=new WeakMap,ee=new WeakMap,ts=new WeakMap,es=new WeakMap,ea=new WeakMap,as=new WeakMap,p0=new WeakSet,Ir=function(){if(this.receivedMessages.length===0)throw new ht("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Ui=function(){if(this.receivedMessages.length===0)throw new ht("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((e)=>e.type==="text").map((e)=>e.text);if(t.length===0)throw new ht("stream ended without producing a content block with type=text");return t.join(" ")},vr=function(){if(this.ended)return;Q(this,W0,void 0,"f")},gr=function(t){if(this.ended)return;let e=M(this,p0,"m",Gi).call(this,t);switch(this._emit("streamEvent",t,e),t.type){case"content_block_delta":{let s=e.content.at(-1);switch(t.delta.type){case"text_delta":{if(s.type==="text")this._emit("text",t.delta.text,s.text||"");break}case"citations_delta":{if(s.type==="text")this._emit("citation",t.delta.citation,s.citations??[]);break}case"input_json_delta":{if(zi(s)&&s.input)this._emit("inputJson",t.delta.partial_json,s.input);break}case"thinking_delta":{if(s.type==="thinking")this._emit("thinking",t.delta.thinking,s.thinking);break}case"signature_delta":{if(s.type==="thinking")this._emit("signature",s.signature);break}case"compaction_delta":{if(s.type==="compaction"&&s.content)this._emit("compaction",s.content);break}default:Qi(t.delta)}break}case"message_stop":{this._addMessageParam(e),this._addMessage(Oi(e,M(this,fe,"f"),{logger:M(this,ea,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",e.content.at(-1));break}case"message_start":{Q(this,W0,e,"f");break}case"content_block_start":case"message_delta":break}},br=function(){if(this.ended)throw new ht("stream has ended, this shouldn't happen");let t=M(this,W0,"f");if(!t)throw new ht("request ended without sending any chunks");return Q(this,W0,void 0,"f"),Oi(t,M(this,fe,"f"),{logger:M(this,ea,"f")})},Gi=function(t){let e=M(this,W0,"f");if(t.type==="message_start"){if(e)throw new ht(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!e)throw new ht(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return e;case"message_delta":if(e.container=t.delta.container,e.stop_reason=t.delta.stop_reason,e.stop_sequence=t.delta.stop_sequence,e.usage.output_tokens=t.usage.output_tokens,e.context_management=t.context_management,t.usage.input_tokens!=null)e.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)e.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)e.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)e.usage.server_tool_use=t.usage.server_tool_use;if(t.usage.iterations!=null)e.usage.iterations=t.usage.iterations;return e;case"content_block_start":return e.content.push(t.content_block),e;case"content_block_delta":{let s=e.content.at(t.index);switch(t.delta.type){case"text_delta":{if(s?.type==="text")e.content[t.index]={...s,text:(s.text||"")+t.delta.text};break}case"citations_delta":{if(s?.type==="text")e.content[t.index]={...s,citations:[...s.citations??[],t.delta.citation]};break}case"input_json_delta":{if(s&&zi(s)){let r=s[Wi]||"";r+=t.delta.partial_json;let a={...s};if(Object.defineProperty(a,Wi,{value:r,enumerable:!1,writable:!0}),r)try{a.input=mo(r)}catch(n){let i=new ht(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${n}. JSON: ${r}`);M(this,as,"f").call(this,i)}e.content[t.index]=a}break}case"thinking_delta":{if(s?.type==="thinking")e.content[t.index]={...s,thinking:s.thinking+t.delta.thinking};break}case"signature_delta":{if(s?.type==="thinking")e.content[t.index]={...s,signature:t.delta.signature};break}case"compaction_delta":{if(s?.type==="compaction")e.content[t.index]={...s,content:(s.content||"")+t.delta.content};break}default:Qi(t.delta)}return e}case"content_block_stop":return e}},Symbol.asyncIterator)](){let t=[],e=[],s=!1;return this.on("streamEvent",(r)=>{let a=e.shift();if(a)a.resolve(r);else t.push(r)}),this.on("end",()=>{s=!0;for(let r of e)r.resolve(void 0);e.length=0}),this.on("abort",(r)=>{s=!0;for(let a of e)a.reject(r);e.length=0}),this.on("error",(r)=>{s=!0;for(let a of e)a.reject(r);e.length=0}),{next:async()=>{if(!t.length){if(s)return{value:void 0,done:!0};return new Promise((r,a)=>e.push({resolve:r,reject:a})).then((r)=>r?{value:r,done:!1}:{value:void 0,done:!0})}return{value:t.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new L0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function Qi(t){}class fn extends Error{constructor(t){let e=typeof t==="string"?t:t.map((s)=>{if(s.type==="text")return s.text;return`[${s.type}]`}).join(" ");super(e);this.name="ToolError",this.content=t}}var Vp=1e5,Np=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
18
18
  1. Task Overview
19
19
  The user's core request and success criteria
20
20
  Any clarifications or constraints they specified
@@ -36,61 +36,61 @@ User preferences or style requirements
36
36
  Domain-specific details that aren't obvious
37
37
  Any promises made to the user
38
38
  Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
39
- Wrap your summary in <summary></summary> tags.`,d4,I6,d6,N0,p4,n3,N3,z3,h4,zp,wE;function Qp(){let E,y;return{promise:new Promise((p,h)=>{E=p,y=h}),resolve:E,reject:y}}class xy{constructor(E,y,p){d4.add(this),this.client=E,I6.set(this,!1),d6.set(this,!1),N0.set(this,void 0),p4.set(this,void 0),n3.set(this,void 0),N3.set(this,void 0),z3.set(this,void 0),h4.set(this,0),Q(this,N0,{params:{...y,messages:structuredClone(y.messages)}},"f");let h=["BetaToolRunner",...SS(y.tools,y.messages)].join(", ");Q(this,p4,{...p,headers:i0([{"x-stainless-helper":h},p?.headers])},"f"),Q(this,z3,Qp(),"f")}async*[(I6=new WeakMap,d6=new WeakMap,N0=new WeakMap,p4=new WeakMap,n3=new WeakMap,N3=new WeakMap,z3=new WeakMap,h4=new WeakMap,d4=new WeakSet,zp=async function(){let E=l(this,N0,"f").params.compactionControl;if(!E||!E.enabled)return!1;let y=0;if(l(this,n3,"f")!==void 0)try{let n=await l(this,n3,"f");y=n.usage.input_tokens+(n.usage.cache_creation_input_tokens??0)+(n.usage.cache_read_input_tokens??0)+n.usage.output_tokens}catch{return!1}let p=E.contextTokenThreshold??Bf;if(y<p)return!1;let h=E.model??l(this,N0,"f").params.model,d=E.summaryPrompt??Nf,S=l(this,N0,"f").params.messages;if(S[S.length-1].role==="assistant"){let n=S[S.length-1];if(Array.isArray(n.content)){let r=n.content.filter((T)=>T.type!=="tool_use");if(r.length===0)S.pop();else n.content=r}}let c=await this.client.beta.messages.create({model:h,messages:[...S,{role:"user",content:[{type:"text",text:d}]}],max_tokens:l(this,N0,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(c.content[0]?.type!=="text")throw new n0("Expected text response for compaction");return l(this,N0,"f").params.messages=[{role:"user",content:c.content}],!0},Symbol.asyncIterator)](){var E;if(l(this,I6,"f"))throw new n0("Cannot iterate over a consumed stream");Q(this,I6,!0,"f"),Q(this,d6,!0,"f"),Q(this,N3,void 0,"f");try{while(!0){let y;try{if(l(this,N0,"f").params.max_iterations&&l(this,h4,"f")>=l(this,N0,"f").params.max_iterations)break;Q(this,d6,!1,"f"),Q(this,N3,void 0,"f"),Q(this,h4,(E=l(this,h4,"f"),E++,E),"f"),Q(this,n3,void 0,"f");let{max_iterations:p,compactionControl:h,...d}=l(this,N0,"f").params;if(d.stream)y=this.client.beta.messages.stream({...d},l(this,p4,"f")),Q(this,n3,y.finalMessage(),"f"),l(this,n3,"f").catch(()=>{}),yield y;else Q(this,n3,this.client.beta.messages.create({...d,stream:!1},l(this,p4,"f")),"f"),yield l(this,n3,"f");if(!await l(this,d4,"m",zp).call(this)){if(!l(this,d6,"f")){let{role:c,content:n}=await l(this,n3,"f");l(this,N0,"f").params.messages.push({role:c,content:n})}let S=await l(this,d4,"m",wE).call(this,l(this,N0,"f").params.messages.at(-1));if(S)l(this,N0,"f").params.messages.push(S);else if(!l(this,d6,"f"))break}}finally{if(y)y.abort()}}if(!l(this,n3,"f"))throw new n0("ToolRunner concluded without a message from the server");l(this,z3,"f").resolve(await l(this,n3,"f"))}catch(y){throw Q(this,I6,!1,"f"),l(this,z3,"f").promise.catch(()=>{}),l(this,z3,"f").reject(y),Q(this,z3,Qp(),"f"),y}}setMessagesParams(E){if(typeof E==="function")l(this,N0,"f").params=E(l(this,N0,"f").params);else l(this,N0,"f").params=E;Q(this,d6,!0,"f"),Q(this,N3,void 0,"f")}async generateToolResponse(){let E=await l(this,n3,"f")??this.params.messages.at(-1);if(!E)return null;return l(this,d4,"m",wE).call(this,E)}done(){return l(this,z3,"f").promise}async runUntilDone(){if(!l(this,I6,"f"))for await(let E of this);return this.done()}get params(){return l(this,N0,"f").params}pushMessages(...E){this.setMessagesParams((y)=>({...y,messages:[...y.messages,...E]}))}then(E,y){return this.runUntilDone().then(E,y)}}wE=async function(E){if(l(this,N3,"f")!==void 0)return l(this,N3,"f");return Q(this,N3,wf(l(this,N0,"f").params,E),"f"),l(this,N3,"f")};async function wf(E,y=E.messages.at(-1)){if(!y||y.role!=="assistant"||!y.content||typeof y.content==="string")return null;let p=y.content.filter((h)=>h.type==="tool_use");if(p.length===0)return null;return{role:"user",content:await Promise.all(p.map(async(h)=>{let d=E.tools.find((S)=>("name"in S?S.name:S.mcp_server_name)===h.name);if(!d||!("run"in d))return{type:"tool_result",tool_use_id:h.id,content:`Error: Tool '${h.name}' not found`,is_error:!0};try{let S=h.input;if("parse"in d&&d.parse)S=d.parse(S);let c=await d.run(S);return{type:"tool_result",tool_use_id:h.id,content:c}}catch(S){return{type:"tool_result",tool_use_id:h.id,content:S instanceof oy?S.content:`Error: ${S instanceof Error?S.message:String(S)}`,is_error:!0}}}))}}class Y8{constructor(E,y){this.iterator=E,this.controller=y}async*decoder(){let E=new w6;for await(let y of this.iterator)for(let p of E.decode(y))yield JSON.parse(p);for(let y of E.flush())yield JSON.parse(y)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(E,y){if(!E.body){if(y.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new n0("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new n0("Attempted to iterate over a response with no body")}return new Y8(my(E.body),y)}}class Iy extends i3{create(E,y){let{betas:p,...h}=E;return this._client.post("/v1/messages/batches?beta=true",{body:h,...y,headers:i0([{"anthropic-beta":[...p??[],"message-batches-2024-09-24"].toString()},y?.headers])})}retrieve(E,y={},p){let{betas:h}=y??{};return this._client.get(z0`/v1/messages/batches/${E}?beta=true`,{...p,headers:i0([{"anthropic-beta":[...h??[],"message-batches-2024-09-24"].toString()},p?.headers])})}list(E={},y){let{betas:p,...h}=E??{};return this._client.getAPIList("/v1/messages/batches?beta=true",K6,{query:h,...y,headers:i0([{"anthropic-beta":[...p??[],"message-batches-2024-09-24"].toString()},y?.headers])})}delete(E,y={},p){let{betas:h}=y??{};return this._client.delete(z0`/v1/messages/batches/${E}?beta=true`,{...p,headers:i0([{"anthropic-beta":[...h??[],"message-batches-2024-09-24"].toString()},p?.headers])})}cancel(E,y={},p){let{betas:h}=y??{};return this._client.post(z0`/v1/messages/batches/${E}/cancel?beta=true`,{...p,headers:i0([{"anthropic-beta":[...h??[],"message-batches-2024-09-24"].toString()},p?.headers])})}async results(E,y={},p){let h=await this.retrieve(E);if(!h.results_url)throw new n0(`No batch \`results_url\`; Has it finished processing? ${h.processing_status} - ${h.id}`);let{betas:d}=y??{};return this._client.get(h.results_url,{...p,headers:i0([{"anthropic-beta":[...d??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},p?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((S,c)=>Y8.fromResponse(c.response,c.controller))}}var Jp={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},Kf=["claude-opus-4-6"];class H6 extends i3{constructor(){super(...arguments);this.batches=new Iy(this._client)}create(E,y){let p=Yp(E),{betas:h,...d}=p;if(d.model in Jp)console.warn(`The model '${d.model}' is deprecated and will reach end-of-life on ${Jp[d.model]}
40
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(d.model in Kf&&d.thinking&&d.thinking.type==="enabled")console.warn(`Using Claude with ${d.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let S=this._client._options.timeout;if(!d.stream&&S==null){let n=rS[d.model]??void 0;S=this._client.calculateNonstreamingTimeout(d.max_tokens,n)}let c=cS(d.tools,d.messages);return this._client.post("/v1/messages?beta=true",{body:d,timeout:S??600000,...y,headers:i0([{...h?.toString()!=null?{"anthropic-beta":h?.toString()}:void 0},c,y?.headers]),stream:p.stream??!1})}parse(E,y){return y={...y,headers:i0([{"anthropic-beta":[...E.betas??[],"structured-outputs-2025-12-15"].toString()},y?.headers])},this.create(E,y).then((p)=>mS(p,E,{logger:this._client.logger??console}))}stream(E,y){return Z8.createMessage(this,E,y)}countTokens(E,y){let p=Yp(E),{betas:h,...d}=p;return this._client.post("/v1/messages/count_tokens?beta=true",{body:d,...y,headers:i0([{"anthropic-beta":[...h??[],"token-counting-2024-11-01"].toString()},y?.headers])})}toolRunner(E,y){return new xy(this._client,E,y)}}function Yp(E){if(!E.output_format)return E;if(E.output_config?.format)throw new n0("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:y,...p}=E;return{...p,output_config:{...E.output_config,format:y}}}H6.Batches=Iy;H6.BetaToolRunner=xy;H6.ToolError=oy;class iy extends i3{create(E,y={},p){let{betas:h,...d}=y??{};return this._client.post(z0`/v1/skills/${E}/versions?beta=true`,ky({body:d,...p,headers:i0([{"anthropic-beta":[...h??[],"skills-2025-10-02"].toString()},p?.headers])},this._client))}retrieve(E,y,p){let{skill_id:h,betas:d}=y;return this._client.get(z0`/v1/skills/${h}/versions/${E}?beta=true`,{...p,headers:i0([{"anthropic-beta":[...d??[],"skills-2025-10-02"].toString()},p?.headers])})}list(E,y={},p){let{betas:h,...d}=y??{};return this._client.getAPIList(z0`/v1/skills/${E}/versions?beta=true`,uy,{query:d,...p,headers:i0([{"anthropic-beta":[...h??[],"skills-2025-10-02"].toString()},p?.headers])})}delete(E,y,p){let{skill_id:h,betas:d}=y;return this._client.delete(z0`/v1/skills/${h}/versions/${E}?beta=true`,{...p,headers:i0([{"anthropic-beta":[...d??[],"skills-2025-10-02"].toString()},p?.headers])})}}class X8 extends i3{constructor(){super(...arguments);this.versions=new iy(this._client)}create(E={},y){let{betas:p,...h}=E??{};return this._client.post("/v1/skills?beta=true",ky({body:h,...y,headers:i0([{"anthropic-beta":[...p??[],"skills-2025-10-02"].toString()},y?.headers])},this._client,!1))}retrieve(E,y={},p){let{betas:h}=y??{};return this._client.get(z0`/v1/skills/${E}?beta=true`,{...p,headers:i0([{"anthropic-beta":[...h??[],"skills-2025-10-02"].toString()},p?.headers])})}list(E={},y){let{betas:p,...h}=E??{};return this._client.getAPIList("/v1/skills?beta=true",uy,{query:h,...y,headers:i0([{"anthropic-beta":[...p??[],"skills-2025-10-02"].toString()},y?.headers])})}delete(E,y={},p){let{betas:h}=y??{};return this._client.delete(z0`/v1/skills/${E}?beta=true`,{...p,headers:i0([{"anthropic-beta":[...h??[],"skills-2025-10-02"].toString()},p?.headers])})}}X8.Versions=iy;class u6 extends i3{constructor(){super(...arguments);this.models=new Cy(this._client),this.messages=new H6(this._client),this.files=new ay(this._client),this.skills=new X8(this._client)}}u6.Models=Cy;u6.Messages=H6;u6.Files=ay;u6.Skills=X8;class ty extends i3{create(E,y){let{betas:p,...h}=E;return this._client.post("/v1/complete",{body:h,timeout:this._client._options.timeout??600000,...y,headers:i0([{...p?.toString()!=null?{"anthropic-beta":p?.toString()}:void 0},y?.headers]),stream:E.stream??!1})}}function fS(E){return E?.output_config?.format}function Xp(E,y,p){let h=fS(y);if(!y||!("parse"in(h??{})))return{...E,content:E.content.map((d)=>{if(d.type==="text")return Object.defineProperty({...d},"parsed_output",{value:null,enumerable:!1});return d}),parsed_output:null};return uS(E,y,p)}function uS(E,y,p){let h=null,d=E.content.map((S)=>{if(S.type==="text"){let c=Hf(y,S.text);if(h===null)h=c;return Object.defineProperty({...S},"parsed_output",{value:c,enumerable:!1})}return S});return{...E,content:d,parsed_output:h}}function Hf(E,y){let p=fS(E);if(p?.type!=="json_schema")return null;try{if("parse"in p)return p.parse(y);return JSON.parse(y)}catch(h){throw new n0(`Failed to parse structured output: ${h}`)}}var k3,Q3,i6,S4,p8,c4,n4,h8,r4,V3,T4,S8,c8,p6,n8,r8,m4,bE,$p,eE,gE,lE,PE,Eh,yh="__json_buf";function dh(E){return E.type==="tool_use"||E.type==="server_tool_use"}class v8{constructor(E,y){k3.add(this),this.messages=[],this.receivedMessages=[],Q3.set(this,void 0),i6.set(this,null),this.controller=new AbortController,S4.set(this,void 0),p8.set(this,()=>{}),c4.set(this,()=>{}),n4.set(this,void 0),h8.set(this,()=>{}),r4.set(this,()=>{}),V3.set(this,{}),T4.set(this,!1),S8.set(this,!1),c8.set(this,!1),p6.set(this,!1),n8.set(this,void 0),r8.set(this,void 0),m4.set(this,void 0),eE.set(this,(p)=>{if(Q(this,S8,!0,"f"),x4(p))p=new o3;if(p instanceof o3)return Q(this,c8,!0,"f"),this._emit("abort",p);if(p instanceof n0)return this._emit("error",p);if(p instanceof Error){let h=new n0(p.message);return h.cause=p,this._emit("error",h)}return this._emit("error",new n0(String(p)))}),Q(this,S4,new Promise((p,h)=>{Q(this,p8,p,"f"),Q(this,c4,h,"f")}),"f"),Q(this,n4,new Promise((p,h)=>{Q(this,h8,p,"f"),Q(this,r4,h,"f")}),"f"),l(this,S4,"f").catch(()=>{}),l(this,n4,"f").catch(()=>{}),Q(this,i6,E,"f"),Q(this,m4,y?.logger??console,"f")}get response(){return l(this,n8,"f")}get request_id(){return l(this,r8,"f")}async withResponse(){Q(this,p6,!0,"f");let E=await l(this,S4,"f");if(!E)throw Error("Could not resolve a `Response` object");return{data:this,response:E,request_id:E.headers.get("request-id")}}static fromReadableStream(E){let y=new v8(null);return y._run(()=>y._fromReadableStream(E)),y}static createMessage(E,y,p,{logger:h}={}){let d=new v8(y,{logger:h});for(let S of y.messages)d._addMessageParam(S);return Q(d,i6,{...y,stream:!0},"f"),d._run(()=>d._createMessage(E,{...y,stream:!0},{...p,headers:{...p?.headers,"X-Stainless-Helper-Method":"stream"}})),d}_run(E){E().then(()=>{this._emitFinal(),this._emit("end")},l(this,eE,"f"))}_addMessageParam(E){this.messages.push(E)}_addMessage(E,y=!0){if(this.receivedMessages.push(E),y)this._emit("message",E)}async _createMessage(E,y,p){let h=p?.signal,d;if(h){if(h.aborted)this.controller.abort();d=this.controller.abort.bind(this.controller),h.addEventListener("abort",d)}try{l(this,k3,"m",gE).call(this);let{response:S,data:c}=await E.create({...y,stream:!0},{...p,signal:this.controller.signal}).withResponse();this._connected(S);for await(let n of c)l(this,k3,"m",lE).call(this,n);if(c.controller.signal?.aborted)throw new o3;l(this,k3,"m",PE).call(this)}finally{if(h&&d)h.removeEventListener("abort",d)}}_connected(E){if(this.ended)return;Q(this,n8,E,"f"),Q(this,r8,E?.headers.get("request-id"),"f"),l(this,p8,"f").call(this,E),this._emit("connect")}get ended(){return l(this,T4,"f")}get errored(){return l(this,S8,"f")}get aborted(){return l(this,c8,"f")}abort(){this.controller.abort()}on(E,y){return(l(this,V3,"f")[E]||(l(this,V3,"f")[E]=[])).push({listener:y}),this}off(E,y){let p=l(this,V3,"f")[E];if(!p)return this;let h=p.findIndex((d)=>d.listener===y);if(h>=0)p.splice(h,1);return this}once(E,y){return(l(this,V3,"f")[E]||(l(this,V3,"f")[E]=[])).push({listener:y,once:!0}),this}emitted(E){return new Promise((y,p)=>{if(Q(this,p6,!0,"f"),E!=="error")this.once("error",p);this.once(E,y)})}async done(){Q(this,p6,!0,"f"),await l(this,n4,"f")}get currentMessage(){return l(this,Q3,"f")}async finalMessage(){return await this.done(),l(this,k3,"m",bE).call(this)}async finalText(){return await this.done(),l(this,k3,"m",$p).call(this)}_emit(E,...y){if(l(this,T4,"f"))return;if(E==="end")Q(this,T4,!0,"f"),l(this,h8,"f").call(this);let p=l(this,V3,"f")[E];if(p)l(this,V3,"f")[E]=p.filter((h)=>!h.once),p.forEach(({listener:h})=>h(...y));if(E==="abort"){let h=y[0];if(!l(this,p6,"f")&&!p?.length)Promise.reject(h);l(this,c4,"f").call(this,h),l(this,r4,"f").call(this,h),this._emit("end");return}if(E==="error"){let h=y[0];if(!l(this,p6,"f")&&!p?.length)Promise.reject(h);l(this,c4,"f").call(this,h),l(this,r4,"f").call(this,h),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",l(this,k3,"m",bE).call(this))}async _fromReadableStream(E,y){let p=y?.signal,h;if(p){if(p.aborted)this.controller.abort();h=this.controller.abort.bind(this.controller),p.addEventListener("abort",h)}try{l(this,k3,"m",gE).call(this),this._connected(null);let d=L3.fromReadableStream(E,this.controller);for await(let S of d)l(this,k3,"m",lE).call(this,S);if(d.controller.signal?.aborted)throw new o3;l(this,k3,"m",PE).call(this)}finally{if(p&&h)p.removeEventListener("abort",h)}}[(Q3=new WeakMap,i6=new WeakMap,S4=new WeakMap,p8=new WeakMap,c4=new WeakMap,n4=new WeakMap,h8=new WeakMap,r4=new WeakMap,V3=new WeakMap,T4=new WeakMap,S8=new WeakMap,c8=new WeakMap,p6=new WeakMap,n8=new WeakMap,r8=new WeakMap,m4=new WeakMap,eE=new WeakMap,k3=new WeakSet,bE=function(){if(this.receivedMessages.length===0)throw new n0("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},$p=function(){if(this.receivedMessages.length===0)throw new n0("stream ended without producing a Message with role=assistant");let E=this.receivedMessages.at(-1).content.filter((y)=>y.type==="text").map((y)=>y.text);if(E.length===0)throw new n0("stream ended without producing a content block with type=text");return E.join(" ")},gE=function(){if(this.ended)return;Q(this,Q3,void 0,"f")},lE=function(E){if(this.ended)return;let y=l(this,k3,"m",Eh).call(this,E);switch(this._emit("streamEvent",E,y),E.type){case"content_block_delta":{let p=y.content.at(-1);switch(E.delta.type){case"text_delta":{if(p.type==="text")this._emit("text",E.delta.text,p.text||"");break}case"citations_delta":{if(p.type==="text")this._emit("citation",E.delta.citation,p.citations??[]);break}case"input_json_delta":{if(dh(p)&&p.input)this._emit("inputJson",E.delta.partial_json,p.input);break}case"thinking_delta":{if(p.type==="thinking")this._emit("thinking",E.delta.thinking,p.thinking);break}case"signature_delta":{if(p.type==="thinking")this._emit("signature",p.signature);break}default:ph(E.delta)}break}case"message_stop":{this._addMessageParam(y),this._addMessage(Xp(y,l(this,i6,"f"),{logger:l(this,m4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",y.content.at(-1));break}case"message_start":{Q(this,Q3,y,"f");break}case"content_block_start":case"message_delta":break}},PE=function(){if(this.ended)throw new n0("stream has ended, this shouldn't happen");let E=l(this,Q3,"f");if(!E)throw new n0("request ended without sending any chunks");return Q(this,Q3,void 0,"f"),Xp(E,l(this,i6,"f"),{logger:l(this,m4,"f")})},Eh=function(E){let y=l(this,Q3,"f");if(E.type==="message_start"){if(y)throw new n0(`Unexpected event order, got ${E.type} before receiving "message_stop"`);return E.message}if(!y)throw new n0(`Unexpected event order, got ${E.type} before "message_start"`);switch(E.type){case"message_stop":return y;case"message_delta":if(y.stop_reason=E.delta.stop_reason,y.stop_sequence=E.delta.stop_sequence,y.usage.output_tokens=E.usage.output_tokens,E.usage.input_tokens!=null)y.usage.input_tokens=E.usage.input_tokens;if(E.usage.cache_creation_input_tokens!=null)y.usage.cache_creation_input_tokens=E.usage.cache_creation_input_tokens;if(E.usage.cache_read_input_tokens!=null)y.usage.cache_read_input_tokens=E.usage.cache_read_input_tokens;if(E.usage.server_tool_use!=null)y.usage.server_tool_use=E.usage.server_tool_use;return y;case"content_block_start":return y.content.push({...E.content_block}),y;case"content_block_delta":{let p=y.content.at(E.index);switch(E.delta.type){case"text_delta":{if(p?.type==="text")y.content[E.index]={...p,text:(p.text||"")+E.delta.text};break}case"citations_delta":{if(p?.type==="text")y.content[E.index]={...p,citations:[...p.citations??[],E.delta.citation]};break}case"input_json_delta":{if(p&&dh(p)){let h=p[yh]||"";h+=E.delta.partial_json;let d={...p};if(Object.defineProperty(d,yh,{value:h,enumerable:!1,writable:!0}),h)d.input=RS(h);y.content[E.index]=d}break}case"thinking_delta":{if(p?.type==="thinking")y.content[E.index]={...p,thinking:p.thinking+E.delta.thinking};break}case"signature_delta":{if(p?.type==="thinking")y.content[E.index]={...p,signature:E.delta.signature};break}default:ph(E.delta)}return y}case"content_block_stop":return y}},Symbol.asyncIterator)](){let E=[],y=[],p=!1;return this.on("streamEvent",(h)=>{let d=y.shift();if(d)d.resolve(h);else E.push(h)}),this.on("end",()=>{p=!0;for(let h of y)h.resolve(void 0);y.length=0}),this.on("abort",(h)=>{p=!0;for(let d of y)d.reject(h);y.length=0}),this.on("error",(h)=>{p=!0;for(let d of y)d.reject(h);y.length=0}),{next:async()=>{if(!E.length){if(p)return{value:void 0,done:!0};return new Promise((h,d)=>y.push({resolve:h,reject:d})).then((h)=>h?{value:h,done:!1}:{value:void 0,done:!0})}return{value:E.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new L3(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function ph(E){}class Zy extends i3{create(E,y){return this._client.post("/v1/messages/batches",{body:E,...y})}retrieve(E,y){return this._client.get(z0`/v1/messages/batches/${E}`,y)}list(E={},y){return this._client.getAPIList("/v1/messages/batches",K6,{query:E,...y})}delete(E,y){return this._client.delete(z0`/v1/messages/batches/${E}`,y)}cancel(E,y){return this._client.post(z0`/v1/messages/batches/${E}/cancel`,y)}async results(E,y){let p=await this.retrieve(E);if(!p.results_url)throw new n0(`No batch \`results_url\`; Has it finished processing? ${p.processing_status} - ${p.id}`);return this._client.get(p.results_url,{...y,headers:i0([{Accept:"application/binary"},y?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((h,d)=>Y8.fromResponse(d.response,d.controller))}}class $8 extends i3{constructor(){super(...arguments);this.batches=new Zy(this._client)}create(E,y){if(E.model in hh)console.warn(`The model '${E.model}' is deprecated and will reach end-of-life on ${hh[E.model]}
41
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(E.model in Of&&E.thinking&&E.thinking.type==="enabled")console.warn(`Using Claude with ${E.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let p=this._client._options.timeout;if(!E.stream&&p==null){let d=rS[E.model]??void 0;p=this._client.calculateNonstreamingTimeout(E.max_tokens,d)}let h=cS(E.tools,E.messages);return this._client.post("/v1/messages",{body:E,timeout:p??600000,...y,headers:i0([h,y?.headers]),stream:E.stream??!1})}parse(E,y){return this.create(E,y).then((p)=>uS(p,E,{logger:this._client.logger??console}))}stream(E,y){return v8.createMessage(this,E,y,{logger:this._client.logger??console})}countTokens(E,y){return this._client.post("/v1/messages/count_tokens",{body:E,...y})}}var hh={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},Of=["claude-opus-4-6"];$8.Batches=Zy;class vy extends i3{retrieve(E,y={},p){let{betas:h}=y??{};return this._client.get(z0`/v1/models/${E}`,{...p,headers:i0([{...h?.toString()!=null?{"anthropic-beta":h?.toString()}:void 0},p?.headers])})}list(E={},y){let{betas:p,...h}=E??{};return this._client.getAPIList("/v1/models",K6,{query:h,...y,headers:i0([{...p?.toString()!=null?{"anthropic-beta":p?.toString()}:void 0},y?.headers])})}}var T8=(E)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[E]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(E)?.trim();return},KE,Fy,a8,kS,Uf="\\n\\nHuman:",Gf="\\n\\nAssistant:";class D0{constructor({baseURL:E=T8("ANTHROPIC_BASE_URL"),apiKey:y=T8("ANTHROPIC_API_KEY")??null,authToken:p=T8("ANTHROPIC_AUTH_TOKEN")??null,...h}={}){KE.add(this),a8.set(this,void 0);let d={apiKey:y,authToken:p,...h,baseURL:E||"https://api.anthropic.com"};if(!d.dangerouslyAllowBrowser&&rf())throw new n0(`It looks like you're running in a browser-like environment.
39
+ Wrap your summary in <summary></summary> tags.`,aa,Te,ae,Nt,sa,h0,K0,z0,ra,Ji,wr;function Yi(){let t,e;return{promise:new Promise((s,r)=>{t=s,e=r}),resolve:t,reject:e}}class Tn{constructor(t,e,s){aa.add(this),this.client=t,Te.set(this,!1),ae.set(this,!1),Nt.set(this,void 0),sa.set(this,void 0),h0.set(this,void 0),K0.set(this,void 0),z0.set(this,void 0),ra.set(this,0),Q(this,Nt,{params:{...e,messages:structuredClone(e.messages)}},"f");let r=["BetaToolRunner",...ho(e.tools,e.messages)].join(", ");Q(this,sa,{...s,headers:kt([{"x-stainless-helper":r},s?.headers])},"f"),Q(this,z0,Yi(),"f")}async*[(Te=new WeakMap,ae=new WeakMap,Nt=new WeakMap,sa=new WeakMap,h0=new WeakMap,K0=new WeakMap,z0=new WeakMap,ra=new WeakMap,aa=new WeakSet,Ji=async function(){let t=M(this,Nt,"f").params.compactionControl;if(!t||!t.enabled)return!1;let e=0;if(M(this,h0,"f")!==void 0)try{let h=await M(this,h0,"f");e=h.usage.input_tokens+(h.usage.cache_creation_input_tokens??0)+(h.usage.cache_read_input_tokens??0)+h.usage.output_tokens}catch{return!1}let s=t.contextTokenThreshold??Vp;if(e<s)return!1;let r=t.model??M(this,Nt,"f").params.model,a=t.summaryPrompt??Np,n=M(this,Nt,"f").params.messages;if(n[n.length-1].role==="assistant"){let h=n[n.length-1];if(Array.isArray(h.content)){let o=h.content.filter((c)=>c.type!=="tool_use");if(o.length===0)n.pop();else h.content=o}}let i=await this.client.beta.messages.create({model:r,messages:[...n,{role:"user",content:[{type:"text",text:a}]}],max_tokens:M(this,Nt,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(i.content[0]?.type!=="text")throw new ht("Expected text response for compaction");return M(this,Nt,"f").params.messages=[{role:"user",content:i.content}],!0},Symbol.asyncIterator)](){var t;if(M(this,Te,"f"))throw new ht("Cannot iterate over a consumed stream");Q(this,Te,!0,"f"),Q(this,ae,!0,"f"),Q(this,K0,void 0,"f");try{while(!0){let e;try{if(M(this,Nt,"f").params.max_iterations&&M(this,ra,"f")>=M(this,Nt,"f").params.max_iterations)break;Q(this,ae,!1,"f"),Q(this,K0,void 0,"f"),Q(this,ra,(t=M(this,ra,"f"),t++,t),"f"),Q(this,h0,void 0,"f");let{max_iterations:s,compactionControl:r,...a}=M(this,Nt,"f").params;if(a.stream)e=this.client.beta.messages.stream({...a},M(this,sa,"f")),Q(this,h0,e.finalMessage(),"f"),M(this,h0,"f").catch(()=>{}),yield e;else Q(this,h0,this.client.beta.messages.create({...a,stream:!1},M(this,sa,"f")),"f"),yield M(this,h0,"f");if(!await M(this,aa,"m",Ji).call(this)){if(!M(this,ae,"f")){let{role:i,content:h}=await M(this,h0,"f");M(this,Nt,"f").params.messages.push({role:i,content:h})}let n=await M(this,aa,"m",wr).call(this,M(this,Nt,"f").params.messages.at(-1));if(n)M(this,Nt,"f").params.messages.push(n);else if(!M(this,ae,"f"))break}}finally{if(e)e.abort()}}if(!M(this,h0,"f"))throw new ht("ToolRunner concluded without a message from the server");M(this,z0,"f").resolve(await M(this,h0,"f"))}catch(e){throw Q(this,Te,!1,"f"),M(this,z0,"f").promise.catch(()=>{}),M(this,z0,"f").reject(e),Q(this,z0,Yi(),"f"),e}}setMessagesParams(t){if(typeof t==="function")M(this,Nt,"f").params=t(M(this,Nt,"f").params);else M(this,Nt,"f").params=t;Q(this,ae,!0,"f"),Q(this,K0,void 0,"f")}async generateToolResponse(){let t=await M(this,h0,"f")??this.params.messages.at(-1);if(!t)return null;return M(this,aa,"m",wr).call(this,t)}done(){return M(this,z0,"f").promise}async runUntilDone(){if(!M(this,Te,"f"))for await(let t of this);return this.done()}get params(){return M(this,Nt,"f").params}pushMessages(...t){this.setMessagesParams((e)=>({...e,messages:[...e.messages,...t]}))}then(t,e){return this.runUntilDone().then(t,e)}}wr=async function(t){if(M(this,K0,"f")!==void 0)return M(this,K0,"f");return Q(this,K0,wp(M(this,Nt,"f").params,t),"f"),M(this,K0,"f")};async function wp(t,e=t.messages.at(-1)){if(!e||e.role!=="assistant"||!e.content||typeof e.content==="string")return null;let s=e.content.filter((r)=>r.type==="tool_use");if(s.length===0)return null;return{role:"user",content:await Promise.all(s.map(async(r)=>{let a=t.tools.find((n)=>("name"in n?n.name:n.mcp_server_name)===r.name);if(!a||!("run"in a))return{type:"tool_result",tool_use_id:r.id,content:`Error: Tool '${r.name}' not found`,is_error:!0};try{let n=r.input;if("parse"in a&&a.parse)n=a.parse(n);let i=await a.run(n);return{type:"tool_result",tool_use_id:r.id,content:i}}catch(n){return{type:"tool_result",tool_use_id:r.id,content:n instanceof fn?n.content:`Error: ${n instanceof Error?n.message:String(n)}`,is_error:!0}}}))}}class Ys{constructor(t,e){this.iterator=t,this.controller=e}async*decoder(){let t=new we;for await(let e of this.iterator)for(let s of t.decode(e))yield JSON.parse(s);for(let e of t.flush())yield JSON.parse(e)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,e){if(!t.body){if(e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new ht("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ht("Attempted to iterate over a response with no body")}return new Ys(yn(t.body),e)}}class kn extends k0{create(t,e){let{betas:s,...r}=t;return this._client.post("/v1/messages/batches?beta=true",{body:r,...e,headers:kt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},e?.headers])})}retrieve(t,e={},s){let{betas:r}=e??{};return this._client.get(zt`/v1/messages/batches/${t}?beta=true`,{...s,headers:kt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},s?.headers])})}list(t={},e){let{betas:s,...r}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Ke,{query:r,...e,headers:kt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},e?.headers])})}delete(t,e={},s){let{betas:r}=e??{};return this._client.delete(zt`/v1/messages/batches/${t}?beta=true`,{...s,headers:kt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},s?.headers])})}cancel(t,e={},s){let{betas:r}=e??{};return this._client.post(zt`/v1/messages/batches/${t}/cancel?beta=true`,{...s,headers:kt([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},s?.headers])})}async results(t,e={},s){let r=await this.retrieve(t);if(!r.results_url)throw new ht(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:a}=e??{};return this._client.get(r.results_url,{...s,headers:kt([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},s?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((n,i)=>Ys.fromResponse(i.response,i.controller))}}var Xi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},Kp=["claude-opus-4-6"];class He extends k0{constructor(){super(...arguments);this.batches=new kn(this._client)}create(t,e){let s=$i(t),{betas:r,...a}=s;if(a.model in Xi)console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${Xi[a.model]}
40
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(a.model in Kp&&a.thinking&&a.thinking.type==="enabled")console.warn(`Using Claude with ${a.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!a.stream&&n==null){let h=yo[a.model]??void 0;n=this._client.calculateNonstreamingTimeout(a.max_tokens,h)}let i=oo(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:n??600000,...e,headers:kt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i,e?.headers]),stream:s.stream??!1})}parse(t,e){return e={...e,headers:kt([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-12-15"].toString()},e?.headers])},this.create(t,e).then((s)=>po(s,t,{logger:this._client.logger??console}))}stream(t,e){return xs.createMessage(this,t,e)}countTokens(t,e){let s=$i(t),{betas:r,...a}=s;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...e,headers:kt([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString()},e?.headers])})}toolRunner(t,e){return new Tn(this._client,t,e)}}function $i(t){if(!t.output_format)return t;if(t.output_config?.format)throw new ht("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...s}=t;return{...s,output_config:{...t.output_config,format:e}}}He.Batches=kn;He.BetaToolRunner=Tn;He.ToolError=fn;class Rn extends k0{create(t,e={},s){let{betas:r,...a}=e??{};return this._client.post(zt`/v1/skills/${t}/versions?beta=true`,En({body:a,...s,headers:kt([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},s?.headers])},this._client))}retrieve(t,e,s){let{skill_id:r,betas:a}=e;return this._client.get(zt`/v1/skills/${r}/versions/${t}?beta=true`,{...s,headers:kt([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},s?.headers])})}list(t,e={},s){let{betas:r,...a}=e??{};return this._client.getAPIList(zt`/v1/skills/${t}/versions?beta=true`,mn,{query:a,...s,headers:kt([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},s?.headers])})}delete(t,e,s){let{skill_id:r,betas:a}=e;return this._client.delete(zt`/v1/skills/${r}/versions/${t}?beta=true`,{...s,headers:kt([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},s?.headers])})}}class Xs extends k0{constructor(){super(...arguments);this.versions=new Rn(this._client)}create(t={},e){let{betas:s,...r}=t??{};return this._client.post("/v1/skills?beta=true",En({body:r,...e,headers:kt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},e?.headers])},this._client,!1))}retrieve(t,e={},s){let{betas:r}=e??{};return this._client.get(zt`/v1/skills/${t}?beta=true`,{...s,headers:kt([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},s?.headers])})}list(t={},e){let{betas:s,...r}=t??{};return this._client.getAPIList("/v1/skills?beta=true",mn,{query:r,...e,headers:kt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},e?.headers])})}delete(t,e={},s){let{betas:r}=e??{};return this._client.delete(zt`/v1/skills/${t}?beta=true`,{...s,headers:kt([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},s?.headers])})}}Xs.Versions=Rn;class pe extends k0{constructor(){super(...arguments);this.models=new Sn(this._client),this.messages=new He(this._client),this.files=new un(this._client),this.skills=new Xs(this._client)}}pe.Models=Sn;pe.Messages=He;pe.Files=un;pe.Skills=Xs;class xn extends k0{create(t,e){let{betas:s,...r}=t;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??600000,...e,headers:kt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},e?.headers]),stream:t.stream??!1})}}function Eo(t){return t?.output_config?.format}function th(t,e,s){let r=Eo(e);if(!e||!("parse"in(r??{})))return{...t,content:t.content.map((a)=>{if(a.type==="text")return Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return a}),parsed_output:null};return uo(t,e,s)}function uo(t,e,s){let r=null,a=t.content.map((n)=>{if(n.type==="text"){let i=Hp(e,n.text);if(r===null)r=i;return Object.defineProperty({...n},"parsed_output",{value:i,enumerable:!1})}return n});return{...t,content:a,parsed_output:r}}function Hp(t,e){let s=Eo(t);if(s?.type!=="json_schema")return null;try{if("parse"in s)return s.parse(e);return JSON.parse(e)}catch(r){throw new ht(`Failed to parse structured output: ${r}`)}}var m0,Q0,ke,na,ss,ia,ha,rs,oa,N0,ca,ns,is,se,hs,os,da,Ar,eh,Zr,Fr,Mr,Pr,ah,sh="__json_buf";function rh(t){return t.type==="tool_use"||t.type==="server_tool_use"}class Cs{constructor(t,e){m0.add(this),this.messages=[],this.receivedMessages=[],Q0.set(this,void 0),ke.set(this,null),this.controller=new AbortController,na.set(this,void 0),ss.set(this,()=>{}),ia.set(this,()=>{}),ha.set(this,void 0),rs.set(this,()=>{}),oa.set(this,()=>{}),N0.set(this,{}),ca.set(this,!1),ns.set(this,!1),is.set(this,!1),se.set(this,!1),hs.set(this,void 0),os.set(this,void 0),da.set(this,void 0),Zr.set(this,(s)=>{if(Q(this,ns,!0,"f"),fa(s))s=new S0;if(s instanceof S0)return Q(this,is,!0,"f"),this._emit("abort",s);if(s instanceof ht)return this._emit("error",s);if(s instanceof Error){let r=new ht(s.message);return r.cause=s,this._emit("error",r)}return this._emit("error",new ht(String(s)))}),Q(this,na,new Promise((s,r)=>{Q(this,ss,s,"f"),Q(this,ia,r,"f")}),"f"),Q(this,ha,new Promise((s,r)=>{Q(this,rs,s,"f"),Q(this,oa,r,"f")}),"f"),M(this,na,"f").catch(()=>{}),M(this,ha,"f").catch(()=>{}),Q(this,ke,t,"f"),Q(this,da,e?.logger??console,"f")}get response(){return M(this,hs,"f")}get request_id(){return M(this,os,"f")}async withResponse(){Q(this,se,!0,"f");let t=await M(this,na,"f");if(!t)throw Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){let e=new Cs(null);return e._run(()=>e._fromReadableStream(t)),e}static createMessage(t,e,s,{logger:r}={}){let a=new Cs(e,{logger:r});for(let n of e.messages)a._addMessageParam(n);return Q(a,ke,{...e,stream:!0},"f"),a._run(()=>a._createMessage(t,{...e,stream:!0},{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),a}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},M(this,Zr,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,e=!0){if(this.receivedMessages.push(t),e)this._emit("message",t)}async _createMessage(t,e,s){let r=s?.signal,a;if(r){if(r.aborted)this.controller.abort();a=this.controller.abort.bind(this.controller),r.addEventListener("abort",a)}try{M(this,m0,"m",Fr).call(this);let{response:n,data:i}=await t.create({...e,stream:!0},{...s,signal:this.controller.signal}).withResponse();this._connected(n);for await(let h of i)M(this,m0,"m",Mr).call(this,h);if(i.controller.signal?.aborted)throw new S0;M(this,m0,"m",Pr).call(this)}finally{if(r&&a)r.removeEventListener("abort",a)}}_connected(t){if(this.ended)return;Q(this,hs,t,"f"),Q(this,os,t?.headers.get("request-id"),"f"),M(this,ss,"f").call(this,t),this._emit("connect")}get ended(){return M(this,ca,"f")}get errored(){return M(this,ns,"f")}get aborted(){return M(this,is,"f")}abort(){this.controller.abort()}on(t,e){return(M(this,N0,"f")[t]||(M(this,N0,"f")[t]=[])).push({listener:e}),this}off(t,e){let s=M(this,N0,"f")[t];if(!s)return this;let r=s.findIndex((a)=>a.listener===e);if(r>=0)s.splice(r,1);return this}once(t,e){return(M(this,N0,"f")[t]||(M(this,N0,"f")[t]=[])).push({listener:e,once:!0}),this}emitted(t){return new Promise((e,s)=>{if(Q(this,se,!0,"f"),t!=="error")this.once("error",s);this.once(t,e)})}async done(){Q(this,se,!0,"f"),await M(this,ha,"f")}get currentMessage(){return M(this,Q0,"f")}async finalMessage(){return await this.done(),M(this,m0,"m",Ar).call(this)}async finalText(){return await this.done(),M(this,m0,"m",eh).call(this)}_emit(t,...e){if(M(this,ca,"f"))return;if(t==="end")Q(this,ca,!0,"f"),M(this,rs,"f").call(this);let s=M(this,N0,"f")[t];if(s)M(this,N0,"f")[t]=s.filter((r)=>!r.once),s.forEach(({listener:r})=>r(...e));if(t==="abort"){let r=e[0];if(!M(this,se,"f")&&!s?.length)Promise.reject(r);M(this,ia,"f").call(this,r),M(this,oa,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=e[0];if(!M(this,se,"f")&&!s?.length)Promise.reject(r);M(this,ia,"f").call(this,r),M(this,oa,"f").call(this,r),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,m0,"m",Ar).call(this))}async _fromReadableStream(t,e){let s=e?.signal,r;if(s){if(s.aborted)this.controller.abort();r=this.controller.abort.bind(this.controller),s.addEventListener("abort",r)}try{M(this,m0,"m",Fr).call(this),this._connected(null);let a=L0.fromReadableStream(t,this.controller);for await(let n of a)M(this,m0,"m",Mr).call(this,n);if(a.controller.signal?.aborted)throw new S0;M(this,m0,"m",Pr).call(this)}finally{if(s&&r)s.removeEventListener("abort",r)}}[(Q0=new WeakMap,ke=new WeakMap,na=new WeakMap,ss=new WeakMap,ia=new WeakMap,ha=new WeakMap,rs=new WeakMap,oa=new WeakMap,N0=new WeakMap,ca=new WeakMap,ns=new WeakMap,is=new WeakMap,se=new WeakMap,hs=new WeakMap,os=new WeakMap,da=new WeakMap,Zr=new WeakMap,m0=new WeakSet,Ar=function(){if(this.receivedMessages.length===0)throw new ht("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},eh=function(){if(this.receivedMessages.length===0)throw new ht("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((e)=>e.type==="text").map((e)=>e.text);if(t.length===0)throw new ht("stream ended without producing a content block with type=text");return t.join(" ")},Fr=function(){if(this.ended)return;Q(this,Q0,void 0,"f")},Mr=function(t){if(this.ended)return;let e=M(this,m0,"m",ah).call(this,t);switch(this._emit("streamEvent",t,e),t.type){case"content_block_delta":{let s=e.content.at(-1);switch(t.delta.type){case"text_delta":{if(s.type==="text")this._emit("text",t.delta.text,s.text||"");break}case"citations_delta":{if(s.type==="text")this._emit("citation",t.delta.citation,s.citations??[]);break}case"input_json_delta":{if(rh(s)&&s.input)this._emit("inputJson",t.delta.partial_json,s.input);break}case"thinking_delta":{if(s.type==="thinking")this._emit("thinking",t.delta.thinking,s.thinking);break}case"signature_delta":{if(s.type==="thinking")this._emit("signature",s.signature);break}default:nh(t.delta)}break}case"message_stop":{this._addMessageParam(e),this._addMessage(th(e,M(this,ke,"f"),{logger:M(this,da,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",e.content.at(-1));break}case"message_start":{Q(this,Q0,e,"f");break}case"content_block_start":case"message_delta":break}},Pr=function(){if(this.ended)throw new ht("stream has ended, this shouldn't happen");let t=M(this,Q0,"f");if(!t)throw new ht("request ended without sending any chunks");return Q(this,Q0,void 0,"f"),th(t,M(this,ke,"f"),{logger:M(this,da,"f")})},ah=function(t){let e=M(this,Q0,"f");if(t.type==="message_start"){if(e)throw new ht(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!e)throw new ht(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return e;case"message_delta":if(e.stop_reason=t.delta.stop_reason,e.stop_sequence=t.delta.stop_sequence,e.usage.output_tokens=t.usage.output_tokens,t.usage.input_tokens!=null)e.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)e.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)e.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)e.usage.server_tool_use=t.usage.server_tool_use;return e;case"content_block_start":return e.content.push({...t.content_block}),e;case"content_block_delta":{let s=e.content.at(t.index);switch(t.delta.type){case"text_delta":{if(s?.type==="text")e.content[t.index]={...s,text:(s.text||"")+t.delta.text};break}case"citations_delta":{if(s?.type==="text")e.content[t.index]={...s,citations:[...s.citations??[],t.delta.citation]};break}case"input_json_delta":{if(s&&rh(s)){let r=s[sh]||"";r+=t.delta.partial_json;let a={...s};if(Object.defineProperty(a,sh,{value:r,enumerable:!1,writable:!0}),r)a.input=mo(r);e.content[t.index]=a}break}case"thinking_delta":{if(s?.type==="thinking")e.content[t.index]={...s,thinking:s.thinking+t.delta.thinking};break}case"signature_delta":{if(s?.type==="thinking")e.content[t.index]={...s,signature:t.delta.signature};break}default:nh(t.delta)}return e}case"content_block_stop":return e}},Symbol.asyncIterator)](){let t=[],e=[],s=!1;return this.on("streamEvent",(r)=>{let a=e.shift();if(a)a.resolve(r);else t.push(r)}),this.on("end",()=>{s=!0;for(let r of e)r.resolve(void 0);e.length=0}),this.on("abort",(r)=>{s=!0;for(let a of e)a.reject(r);e.length=0}),this.on("error",(r)=>{s=!0;for(let a of e)a.reject(r);e.length=0}),{next:async()=>{if(!t.length){if(s)return{value:void 0,done:!0};return new Promise((r,a)=>e.push({resolve:r,reject:a})).then((r)=>r?{value:r,done:!1}:{value:void 0,done:!0})}return{value:t.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new L0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function nh(t){}class Cn extends k0{create(t,e){return this._client.post("/v1/messages/batches",{body:t,...e})}retrieve(t,e){return this._client.get(zt`/v1/messages/batches/${t}`,e)}list(t={},e){return this._client.getAPIList("/v1/messages/batches",Ke,{query:t,...e})}delete(t,e){return this._client.delete(zt`/v1/messages/batches/${t}`,e)}cancel(t,e){return this._client.post(zt`/v1/messages/batches/${t}/cancel`,e)}async results(t,e){let s=await this.retrieve(t);if(!s.results_url)throw new ht(`No batch \`results_url\`; Has it finished processing? ${s.processing_status} - ${s.id}`);return this._client.get(s.results_url,{...e,headers:kt([{Accept:"application/binary"},e?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((r,a)=>Ys.fromResponse(a.response,a.controller))}}class $s extends k0{constructor(){super(...arguments);this.batches=new Cn(this._client)}create(t,e){if(t.model in ih)console.warn(`The model '${t.model}' is deprecated and will reach end-of-life on ${ih[t.model]}
41
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(t.model in Op&&t.thinking&&t.thinking.type==="enabled")console.warn(`Using Claude with ${t.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let s=this._client._options.timeout;if(!t.stream&&s==null){let a=yo[t.model]??void 0;s=this._client.calculateNonstreamingTimeout(t.max_tokens,a)}let r=oo(t.tools,t.messages);return this._client.post("/v1/messages",{body:t,timeout:s??600000,...e,headers:kt([r,e?.headers]),stream:t.stream??!1})}parse(t,e){return this.create(t,e).then((s)=>uo(s,t,{logger:this._client.logger??console}))}stream(t,e){return Cs.createMessage(this,t,e,{logger:this._client.logger??console})}countTokens(t,e){return this._client.post("/v1/messages/count_tokens",{body:t,...e})}}var ih={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},Op=["claude-opus-4-6"];$s.Batches=Cn;class In extends k0{retrieve(t,e={},s){let{betas:r}=e??{};return this._client.get(zt`/v1/models/${t}`,{...s,headers:kt([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},s?.headers])})}list(t={},e){let{betas:s,...r}=t??{};return this._client.getAPIList("/v1/models",Ke,{query:r,...e,headers:kt([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},e?.headers])})}}var cs=(t)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim();return},Kr,vn,Es,So,Up="\\n\\nHuman:",Gp="\\n\\nAssistant:";class Dt{constructor({baseURL:t=cs("ANTHROPIC_BASE_URL"),apiKey:e=cs("ANTHROPIC_API_KEY")??null,authToken:s=cs("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){Kr.add(this),Es.set(this,void 0);let a={apiKey:e,authToken:s,...r,baseURL:t||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&cp())throw new ht(`It looks like you're running in a browser-like environment.
42
42
 
43
43
  This is disabled by default, as it risks exposing your secret API credentials to attackers.
44
44
  If you understand the risks and have appropriate mitigations in place,
45
45
  you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
46
46
 
47
47
  new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
48
- `);this.baseURL=d.baseURL,this.timeout=d.timeout??Fy.DEFAULT_TIMEOUT,this.logger=d.logger??console;let S="warn";this.logLevel=S,this.logLevel=Vp(d.logLevel,"ClientOptions.logLevel",this)??Vp(T8("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??S,this.fetchOptions=d.fetchOptions,this.maxRetries=d.maxRetries??2,this.fetch=d.fetch??uf(),Q(this,a8,af,"f"),this._options=d,this.apiKey=typeof y==="string"?y:null,this.authToken=p}withOptions(E){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...E})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:E,nulls:y}){if(E.get("x-api-key")||E.get("authorization"))return;if(this.apiKey&&E.get("x-api-key"))return;if(y.has("x-api-key"))return;if(this.authToken&&E.get("authorization"))return;if(y.has("authorization"))return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(E){return i0([await this.apiKeyAuth(E),await this.bearerAuth(E)])}async apiKeyAuth(E){if(this.apiKey==null)return;return i0([{"X-Api-Key":this.apiKey}])}async bearerAuth(E){if(this.authToken==null)return;return i0([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(E){return Cf(E)}getUserAgent(){return`${this.constructor.name}/JS ${Z6}`}defaultIdempotencyKey(){return`stainless-node-retry-${Wh()}`}makeStatusError(E,y,p,h){return $0.generate(E,y,p,h)}buildURL(E,y,p){let h=!l(this,KE,"m",kS).call(this)&&p||this.baseURL,d=hf(E)?new URL(E):new URL(h+(h.endsWith("/")&&E.startsWith("/")?E.slice(1):E)),S=this.defaultQuery(),c=Object.fromEntries(d.searchParams);if(!lp(S)||!lp(c))y={...c,...S,...y};if(typeof y==="object"&&y&&!Array.isArray(y))d.search=this.stringifyQuery(y);return d.toString()}_calculateNonstreamingTimeout(E){if(3600*E/128000>600)throw new n0("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(E){}async prepareRequest(E,{url:y,options:p}){}get(E,y){return this.methodRequest("get",E,y)}post(E,y){return this.methodRequest("post",E,y)}patch(E,y){return this.methodRequest("patch",E,y)}put(E,y){return this.methodRequest("put",E,y)}delete(E,y){return this.methodRequest("delete",E,y)}methodRequest(E,y,p){return this.request(Promise.resolve(p).then((h)=>{return{method:E,path:y,...h}}))}request(E,y=null){return new J8(this,this.makeRequest(E,y,void 0))}async makeRequest(E,y,p){let h=await E,d=h.maxRetries??this.maxRetries;if(y==null)y=d;await this.prepareOptions(h);let{req:S,url:c,timeout:n}=await this.buildRequest(h,{retryCount:d-y});await this.prepareRequest(S,{url:c,options:h});let r="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),T=p===void 0?"":`, retryOf: ${p}`,k=Date.now();if(y3(this).debug(`[${r}] sending request`,h6({retryOfRequestLogID:p,method:h.method,url:c,options:h,headers:S.headers})),h.signal?.aborted)throw new o3;let o=new AbortController,u=await this.fetchWithTimeout(c,S,n,o).catch(_E),i=Date.now();if(u instanceof globalThis.Error){let t=`retrying, ${y} attempts remaining`;if(h.signal?.aborted)throw new o3;let m=x4(u)||/timed? ?out/i.test(String(u)+("cause"in u?String(u.cause):""));if(y)return y3(this).info(`[${r}] connection ${m?"timed out":"failed"} - ${t}`),y3(this).debug(`[${r}] connection ${m?"timed out":"failed"} (${t})`,h6({retryOfRequestLogID:p,url:c,durationMs:i-k,message:u.message})),this.retryRequest(h,y,p??r);if(y3(this).info(`[${r}] connection ${m?"timed out":"failed"} - error; no more retries left`),y3(this).debug(`[${r}] connection ${m?"timed out":"failed"} (error; no more retries left)`,h6({retryOfRequestLogID:p,url:c,durationMs:i-k,message:u.message})),m)throw new yy;throw new _4({cause:u})}let v=[...u.headers.entries()].filter(([t])=>t==="request-id").map(([t,m])=>", "+t+": "+JSON.stringify(m)).join(""),F=`[${r}${T}${v}] ${S.method} ${c} ${u.ok?"succeeded":"failed"} with status ${u.status} in ${i-k}ms`;if(!u.ok){let t=await this.shouldRetry(u);if(y&&t){let I=`retrying, ${y} attempts remaining`;return await kf(u.body),y3(this).info(`${F} - ${I}`),y3(this).debug(`[${r}] response error (${I})`,h6({retryOfRequestLogID:p,url:u.url,status:u.status,headers:u.headers,durationMs:i-k})),this.retryRequest(h,y,p??r,u.headers)}let m=t?"error; no more retries left":"error; not retryable";y3(this).info(`${F} - ${m}`);let a=await u.text().catch((I)=>_E(I).message),R=zh(a),f=R?void 0:a;throw y3(this).debug(`[${r}] response error (${m})`,h6({retryOfRequestLogID:p,url:u.url,status:u.status,headers:u.headers,message:f,durationMs:Date.now()-k})),this.makeStatusError(u.status,R,f,u.headers)}return y3(this).info(F),y3(this).debug(`[${r}] response start`,h6({retryOfRequestLogID:p,url:u.url,status:u.status,headers:u.headers,durationMs:i-k})),{response:u,options:h,controller:o,requestLogID:r,retryOfRequestLogID:p,startTime:k}}getAPIList(E,y,p){return this.requestAPIList(y,p&&"then"in p?p.then((h)=>({method:"get",path:E,...h})):{method:"get",path:E,...p})}requestAPIList(E,y){let p=this.makeRequest(y,null,void 0);return new ES(this,p,E)}async fetchWithTimeout(E,y,p,h){let{signal:d,method:S,...c}=y||{},n=this._makeAbort(h);if(d)d.addEventListener("abort",n,{once:!0});let r=setTimeout(n,p),T=globalThis.ReadableStream&&c.body instanceof globalThis.ReadableStream||typeof c.body==="object"&&c.body!==null&&Symbol.asyncIterator in c.body,k={signal:h.signal,...T?{duplex:"half"}:{},method:"GET",...c};if(S)k.method=S.toUpperCase();try{return await this.fetch.call(void 0,E,k)}finally{clearTimeout(r)}}async shouldRetry(E){let y=E.headers.get("x-should-retry");if(y==="true")return!0;if(y==="false")return!1;if(E.status===408)return!0;if(E.status===409)return!0;if(E.status===429)return!0;if(E.status>=500)return!0;return!1}async retryRequest(E,y,p,h){let d,S=h?.get("retry-after-ms");if(S){let n=parseFloat(S);if(!Number.isNaN(n))d=n}let c=h?.get("retry-after");if(c&&!d){let n=parseFloat(c);if(!Number.isNaN(n))d=n*1000;else d=Date.parse(c)-Date.now()}if(d===void 0){let n=E.maxRetries??this.maxRetries;d=this.calculateDefaultRetryTimeoutMillis(y,n)}return await nf(d),this.makeRequest(E,y-1,p)}calculateDefaultRetryTimeoutMillis(E,y){let p=y-E,h=Math.min(0.5*Math.pow(2,p),8),d=1-Math.random()*0.25;return h*d*1000}calculateNonstreamingTimeout(E,y){if(3600000*E/128000>600000||y!=null&&E>y)throw new n0("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(E,{retryCount:y=0}={}){let p={...E},{method:h,path:d,query:S,defaultBaseURL:c}=p,n=this.buildURL(d,S,c);if("timeout"in p)cf("timeout",p.timeout);p.timeout=p.timeout??this.timeout;let{bodyHeaders:r,body:T}=this.buildBody({options:p}),k=await this.buildHeaders({options:E,method:h,bodyHeaders:r,retryCount:y});return{req:{method:h,headers:k,...p.signal&&{signal:p.signal},...globalThis.ReadableStream&&T instanceof globalThis.ReadableStream&&{duplex:"half"},...T&&{body:T},...this.fetchOptions??{},...p.fetchOptions??{}},url:n,timeout:p.timeout}}async buildHeaders({options:E,method:y,bodyHeaders:p,retryCount:h}){let d={};if(this.idempotencyHeader&&y!=="get"){if(!E.idempotencyKey)E.idempotencyKey=this.defaultIdempotencyKey();d[this.idempotencyHeader]=E.idempotencyKey}let S=i0([d,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(h),...E.timeout?{"X-Stainless-Timeout":String(Math.trunc(E.timeout/1000))}:{},...ff(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(E),this._options.defaultHeaders,p,E.headers]);return this.validateHeaders(S),S.values}_makeAbort(E){return()=>E.abort()}buildBody({options:{body:E,headers:y}}){if(!E)return{bodyHeaders:void 0,body:void 0};let p=i0([y]);if(ArrayBuffer.isView(E)||E instanceof ArrayBuffer||E instanceof DataView||typeof E==="string"&&p.values.has("content-type")||globalThis.Blob&&E instanceof globalThis.Blob||E instanceof FormData||E instanceof URLSearchParams||globalThis.ReadableStream&&E instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:E};else if(typeof E==="object"&&((Symbol.asyncIterator in E)||(Symbol.iterator in E)&&("next"in E)&&typeof E.next==="function"))return{bodyHeaders:void 0,body:Jh(E)};else if(typeof E==="object"&&p.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(E)};else return l(this,a8,"f").call(this,{body:E,headers:p})}}Fy=D0,a8=new WeakMap,KE=new WeakSet,kS=function(){return this.baseURL!=="https://api.anthropic.com"};D0.Anthropic=Fy;D0.HUMAN_PROMPT=Uf;D0.AI_PROMPT=Gf;D0.DEFAULT_TIMEOUT=600000;D0.AnthropicError=n0;D0.APIError=$0;D0.APIConnectionError=_4;D0.APIConnectionTimeoutError=yy;D0.APIUserAbortError=o3;D0.NotFoundError=Sy;D0.ConflictError=cy;D0.RateLimitError=ry;D0.BadRequestError=dy;D0.AuthenticationError=py;D0.InternalServerError=Ty;D0.PermissionDeniedError=hy;D0.UnprocessableEntityError=ny;D0.toFile=gf;class D4 extends D0{constructor(){super(...arguments);this.completions=new ty(this),this.messages=new $8(this),this.models=new vy(this),this.beta=new u6(this)}}D4.Completions=ty;D4.Messages=$8;D4.Models=vy;D4.Beta=u6;function Wf(E){return E instanceof Error?E:Error(String(E))}function C8(E){return E instanceof Error?E.message:String(E)}function o8(E){if(E&&typeof E==="object"&&"code"in E&&typeof E.code==="string")return E.code;return}function zf(E){return o8(E)==="ENOENT"}var b6,t6=null;function Xf(){if(t6)return t6;if(!S6(process.env.DEBUG_CLAUDE_AGENT_SDK))return b6=null,t6=Promise.resolve(),t6;let E=Sh(Gh(),"debug");return b6=Sh(E,`sdk-${Qf()}.txt`),process.stderr.write(`SDK debug logs: ${b6}
49
- `),t6=Yf(E,{recursive:!0}).then(()=>{}).catch(()=>{}),t6}function a3(E){if(b6===null)return;let y=`${new Date().toISOString()} ${E}
50
- `;Xf().then(()=>{if(b6)Jf(b6,y).catch(()=>{})})}function CS(){let E=new Set;return{subscribe(y){return E.add(y),()=>{E.delete(y)}},emit(...y){for(let p of E)p(...y)},clear(){E.clear()}}}function Eu(){let E="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof ch==="function"){let y=$f();try{E=ch(y).normalize("NFC")}catch{E=y.normalize("NFC")}}return{originalCwd:E,projectRoot:E,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,turnHookDurationMs:0,turnToolDurationMs:0,turnClassifierDurationMs:0,turnToolCount:0,turnHookCount:0,turnClassifierCount:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:E,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,kairosActive:!1,strictToolResultPairing:!1,memoryToggledOff:!1,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,flagSettingsInline:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:aS(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionCronTasks:[],sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,mainThreadAgentType:void 0,isRemoteMode:!1,...!1,directConnectServerUrl:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,afkModeHeaderLatched:null,fastModeHeaderLatched:null,cacheEditingHeaderLatched:null,thinkingClearLatched:null,promptId:null,lastMainRequestId:void 0,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var yu=Eu();function du(){return yu.sessionId}var pu=CS(),ci=pu.subscribe,hu=CS(),ni=hu.subscribe;function Tu({writeFn:E,flushIntervalMs:y=1000,maxBufferSize:p=100,maxBufferBytes:h=1/0,immediateMode:d=!1}){let S=[],c=0,n=null,r=null;function T(){if(n)clearTimeout(n),n=null}function k(){if(r)E(r.join("")),r=null;if(S.length===0)return;E(S.join("")),S=[],c=0,T()}function o(){if(!n)n=setTimeout(k,y)}function u(){if(r){r.push(...S),S=[],c=0,T();return}let i=S;S=[],c=0,T(),r=i,setImmediate(()=>{let v=r;if(r=null,v)E(v.join(""))})}return{write(i){if(d){E(i);return}if(S.push(i),c+=i.length,o(),S.length>=p||c>=h)u()},flush:k,dispose(){k()}}}var nh=new Set;function mu(E){return nh.add(E),()=>nh.delete(E)}var Ru=E6((E)=>{if(!E||E.trim()==="")return null;let y=E.split(",").map((S)=>S.trim()).filter(Boolean);if(y.length===0)return null;let p=y.some((S)=>S.startsWith("!")),h=y.some((S)=>!S.startsWith("!"));if(p&&h)return null;let d=y.map((S)=>S.replace(/^!/,"").toLowerCase());return{include:p?[]:d,exclude:p?d:[],isExclusive:p}});function fu(E){let y=[],p=E.match(/^MCP server ["']([^"']+)["']/);if(p&&p[1])y.push("mcp"),y.push(p[1].toLowerCase());else{let S=E.match(/^([^:[]+):/);if(S&&S[1])y.push(S[1].trim().toLowerCase())}let h=E.match(/^\[([^\]]+)]/);if(h&&h[1])y.push(h[1].trim().toLowerCase());if(E.toLowerCase().includes("1p event:"))y.push("1p");let d=E.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(d&&d[1]){let S=d[1].trim().toLowerCase();if(S.length<30&&!S.includes(" "))y.push(S)}return Array.from(new Set(y))}function uu(E,y){if(!y)return!0;if(E.length===0)return!1;if(y.isExclusive)return!E.some((p)=>y.exclude.includes(p));else return E.some((p)=>y.include.includes(p))}function ku(E,y){if(!y)return!0;let p=fu(E);return uu(p,y)}var vu={cwd(){return process.cwd()},existsSync(E){let y=[];try{let d=L0(y,q0`fs.existsSync(${E})`,0);return r0.existsSync(E)}catch(d){var p=d,h=1}finally{j0(y,p,h)}},async stat(E){return tu(E)},async readdir(E){return ou(E,{withFileTypes:!0})},async unlink(E){return Zu(E)},async rmdir(E){return Iu(E)},async rm(E,y){return iu(E,y)},async mkdir(E,y){try{await au(E,{recursive:!0,...y})}catch(p){if(o8(p)!=="EEXIST")throw p}},async readFile(E,y){return rh(E,{encoding:y.encoding})},async rename(E,y){return xu(E,y)},statSync(E){let y=[];try{let d=L0(y,q0`fs.statSync(${E})`,0);return r0.statSync(E)}catch(d){var p=d,h=1}finally{j0(y,p,h)}},lstatSync(E){let y=[];try{let d=L0(y,q0`fs.lstatSync(${E})`,0);return r0.lstatSync(E)}catch(d){var p=d,h=1}finally{j0(y,p,h)}},readFileSync(E,y){let p=[];try{let S=L0(p,q0`fs.readFileSync(${E})`,0);return r0.readFileSync(E,{encoding:y.encoding})}catch(S){var h=S,d=1}finally{j0(p,h,d)}},readFileBytesSync(E){let y=[];try{let d=L0(y,q0`fs.readFileBytesSync(${E})`,0);return r0.readFileSync(E)}catch(d){var p=d,h=1}finally{j0(y,p,h)}},readSync(E,y){let p=[];try{let S=L0(p,q0`fs.readSync(${E}, ${y.length} bytes)`,0),c=void 0;try{c=r0.openSync(E,"r");let n=Buffer.alloc(y.length),r=r0.readSync(c,n,0,y.length,0);return{buffer:n,bytesRead:r}}finally{if(c)r0.closeSync(c)}}catch(S){var h=S,d=1}finally{j0(p,h,d)}},appendFileSync(E,y,p){let h=[];try{let c=L0(h,q0`fs.appendFileSync(${E}, ${y.length} chars)`,0);if(p?.mode!==void 0)try{let n=r0.openSync(E,"ax",p.mode);try{r0.appendFileSync(n,y)}finally{r0.closeSync(n)}return}catch(n){if(o8(n)!=="EEXIST")throw n}r0.appendFileSync(E,y)}catch(c){var d=c,S=1}finally{j0(h,d,S)}},copyFileSync(E,y){let p=[];try{let S=L0(p,q0`fs.copyFileSync(${E} → ${y})`,0);r0.copyFileSync(E,y)}catch(S){var h=S,d=1}finally{j0(p,h,d)}},unlinkSync(E){let y=[];try{let d=L0(y,q0`fs.unlinkSync(${E})`,0);r0.unlinkSync(E)}catch(d){var p=d,h=1}finally{j0(y,p,h)}},renameSync(E,y){let p=[];try{let S=L0(p,q0`fs.renameSync(${E} → ${y})`,0);r0.renameSync(E,y)}catch(S){var h=S,d=1}finally{j0(p,h,d)}},linkSync(E,y){let p=[];try{let S=L0(p,q0`fs.linkSync(${E} → ${y})`,0);r0.linkSync(E,y)}catch(S){var h=S,d=1}finally{j0(p,h,d)}},symlinkSync(E,y,p){let h=[];try{let c=L0(h,q0`fs.symlinkSync(${E} → ${y})`,0);r0.symlinkSync(E,y,p)}catch(c){var d=c,S=1}finally{j0(h,d,S)}},readlinkSync(E){let y=[];try{let d=L0(y,q0`fs.readlinkSync(${E})`,0);return r0.readlinkSync(E)}catch(d){var p=d,h=1}finally{j0(y,p,h)}},realpathSync(E){let y=[];try{let d=L0(y,q0`fs.realpathSync(${E})`,0);return r0.realpathSync(E).normalize("NFC")}catch(d){var p=d,h=1}finally{j0(y,p,h)}},mkdirSync(E,y){let p=[];try{let S=L0(p,q0`fs.mkdirSync(${E})`,0),c={recursive:!0};if(y?.mode!==void 0)c.mode=y.mode;try{r0.mkdirSync(E,c)}catch(n){if(o8(n)!=="EEXIST")throw n}}catch(S){var h=S,d=1}finally{j0(p,h,d)}},readdirSync(E){let y=[];try{let d=L0(y,q0`fs.readdirSync(${E})`,0);return r0.readdirSync(E,{withFileTypes:!0})}catch(d){var p=d,h=1}finally{j0(y,p,h)}},readdirStringSync(E){let y=[];try{let d=L0(y,q0`fs.readdirStringSync(${E})`,0);return r0.readdirSync(E)}catch(d){var p=d,h=1}finally{j0(y,p,h)}},isDirEmptySync(E){let y=[];try{let d=L0(y,q0`fs.isDirEmptySync(${E})`,0);return this.readdirSync(E).length===0}catch(d){var p=d,h=1}finally{j0(y,p,h)}},rmdirSync(E){let y=[];try{let d=L0(y,q0`fs.rmdirSync(${E})`,0);r0.rmdirSync(E)}catch(d){var p=d,h=1}finally{j0(y,p,h)}},rmSync(E,y){let p=[];try{let S=L0(p,q0`fs.rmSync(${E})`,0);r0.rmSync(E,y)}catch(S){var h=S,d=1}finally{j0(p,h,d)}},createWriteStream(E){return r0.createWriteStream(E)},async readFileBytes(E,y){if(y===void 0)return rh(E);let p=await Cu(E,"r");try{let{size:h}=await p.stat(),d=Math.min(h,y),S=Buffer.allocUnsafe(d),c=0;while(c<d){let{bytesRead:n}=await p.read(S,c,d-c,c);if(n===0)break;c+=n}return c<d?S.subarray(0,c):S}finally{await p.close()}}},Fu=vu;function Th(){return Fu}function Au(E,y){if(E.destroyed)return;E.write(y)}function Mu(E){Au(process.stderr,E)}var HE={verbose:0,debug:1,info:2,warn:3,error:4},su=E6(()=>{let E=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();if(E&&Object.hasOwn(HE,E))return E;return"debug"}),bu=!1,OE=E6(()=>{return bu||S6(process.env.DEBUG)||S6(process.env.DEBUG_SDK)||process.argv.includes("--debug")||process.argv.includes("-d")||IS()||process.argv.some((E)=>E.startsWith("--debug="))||iS()!==null}),eu=E6(()=>{let E=process.argv.find((p)=>p.startsWith("--debug="));if(!E)return null;let y=E.substring(8);return Ru(y)}),IS=E6(()=>{return process.argv.includes("--debug-to-stderr")||process.argv.includes("-d2e")}),iS=E6(()=>{for(let E=0;E<process.argv.length;E++){let y=process.argv[E];if(y.startsWith("--debug-file="))return y.substring(13);if(y==="--debug-file"&&E+1<process.argv.length)return process.argv[E+1]}return null});function gu(E){if(!OE())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let y=eu();return ku(E,y)}var lu=!1,m8=null,LE=Promise.resolve();async function Pu(E,y,p,h){if(E)await cu(y,{recursive:!0}).catch(()=>{});await Su(p,h),ZS()}function Lu(){}function ju(){if(!m8){let E=null;m8=Tu({writeFn:(y)=>{let p=tS(),h=oS(p),d=E!==h;if(E=h,OE()){if(d)try{Th().mkdirSync(h)}catch{}Th().appendFileSync(p,y),ZS();return}LE=LE.then(Pu.bind(null,d,h,p,y)).catch(Lu)},flushIntervalMs:1000,maxBufferSize:100,immediateMode:OE()}),mu(async()=>{m8?.dispose(),await LE})}return m8}function A3(E,{level:y}={level:"debug"}){if(HE[y]<HE[su()])return;if(!gu(E))return;if(lu&&E.includes(`
51
- `))E=C3(E);let p=`${new Date().toISOString()} [${y.toUpperCase()}] ${E.trim()}
52
- `;if(IS()){Mu(p);return}ju().write(p)}function tS(){return iS()??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??xS(Gh(),"debug",`${du()}.txt`)}var ZS=E6(async()=>{try{let E=tS(),y=oS(E),p=xS(y,"latest");await ru(p).catch(()=>{}),await nu(E,p)}catch{}}),Ri=(()=>{let E=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(E!==void 0){let y=Number(E);if(!Number.isNaN(y)&&y>=0)return y}return 1/0})(),qu={[Symbol.dispose](){}};function _u(){return qu}var q0=_u;function C3(E,y,p){let h=[];try{let c=L0(h,q0`JSON.stringify(${E})`,0);return JSON.stringify(E,y,p)}catch(c){var d=c,S=1}finally{j0(h,d,S)}}var Ay=(E,y)=>{let p=[];try{let S=L0(p,q0`JSON.parse(${E})`,0);return typeof y>"u"?JSON.parse(E):JSON.parse(E,y)}catch(S){var h=S,d=1}finally{j0(p,h,d)}};function Du(E){let y=E.trim();return y.startsWith("{")&&y.endsWith("}")}function Vu(E,y){let p={...E};if(y){let h=y.enabled===!0&&y.failIfUnavailable===void 0?{...y,failIfUnavailable:!0}:y,d=p.settings;if(d&&!Du(d))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let S={sandbox:h};if(d)try{S={...Ay(d),sandbox:h}}catch{}p.settings=C3(S)}return p}var Bu=2000;class vS{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(E){this.options=E,this.abortController=E.abortController||Nh(),this.initialize()}getDefaultExecutable(){return wh()?"bun":"node"}spawnLocalProcess(E){let{command:y,args:p,cwd:h,env:d,signal:S}=E,c=S6(d.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",n=am(y,p,{cwd:h,stdio:["pipe","pipe",c],signal:S,env:d,windowsHide:!0});if(S6(d.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)n.stderr.on("data",(r)=>{let T=r.toString();if(a3(T),this.options.stderr)this.options.stderr(T)});return{stdin:n.stdin,stdout:n.stdout,get killed(){return n.killed},get exitCode(){return n.exitCode},kill:n.kill.bind(n),on:n.on.bind(n),once:n.once.bind(n),off:n.off.bind(n)}}initialize(){try{let{additionalDirectories:E=[],agent:y,betas:p,cwd:h,executable:d=this.getDefaultExecutable(),executableArgs:S=[],extraArgs:c={},pathToClaudeCodeExecutable:n,env:r={...process.env},thinkingConfig:T,maxTurns:k,maxBudgetUsd:o,taskBudget:u,model:i,fallbackModel:v,jsonSchema:F,permissionMode:t,allowDangerouslySkipPermissions:m,permissionPromptToolName:a,continueConversation:R,resume:f,settingSources:I,allowedTools:x=[],disallowedTools:Z=[],tools:A,mcpServers:g,strictMcpConfig:V,canUseTool:_,includePartialMessages:N,plugins:O,sandbox:z}=this.options,K=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(T){switch(T.type){case"enabled":if(T.budgetTokens===void 0)K.push("--thinking","adaptive");else K.push("--max-thinking-tokens",T.budgetTokens.toString());break;case"disabled":K.push("--thinking","disabled");break;case"adaptive":K.push("--thinking","adaptive");break}if(T.type!=="disabled"&&T.display)K.push("--thinking-display",T.display)}if(this.options.effort)K.push("--effort",this.options.effort);if(k)K.push("--max-turns",k.toString());if(o!==void 0)K.push("--max-budget-usd",o.toString());if(u)K.push("--task-budget",u.total.toString());if(i)K.push("--model",i);if(y)K.push("--agent",y);if(p&&p.length>0)K.push("--betas",p.join(","));if(F)K.push("--json-schema",C3(F));if(this.options.debugFile)K.push("--debug-file",this.options.debugFile);else if(this.options.debug)K.push("--debug");if(S6(r.DEBUG_CLAUDE_AGENT_SDK))K.push("--debug-to-stderr");if(_){if(a)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");K.push("--permission-prompt-tool","stdio")}else if(a)K.push("--permission-prompt-tool",a);if(R)K.push("--continue");if(f)K.push("--resume",f);if(this.options.proactive)K.push("--proactive");if(this.options.assistant)K.push("--assistant");if(this.options.channels&&this.options.channels.length>0)K.push("--channels",...this.options.channels);if(x.length>0)K.push("--allowedTools",x.join(","));if(Z.length>0)K.push("--disallowedTools",Z.join(","));if(A!==void 0)if(Array.isArray(A))if(A.length===0)K.push("--tools","");else K.push("--tools",A.join(","));else K.push("--tools","default");if(g&&Object.keys(g).length>0)K.push("--mcp-config",C3({mcpServers:g}));if(I!==void 0)K.push(`--setting-sources=${I.join(",")}`);if(V)K.push("--strict-mcp-config");if(t)K.push("--permission-mode",t);if(m)K.push("--allow-dangerously-skip-permissions");if(v){if(i&&v===i)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");K.push("--fallback-model",v)}if(this.options.includeHookEvents)K.push("--include-hook-events");if(N)K.push("--include-partial-messages");for(let C of E)K.push("--add-dir",C);if(O&&O.length>0)for(let C of O)if(C.type==="local")K.push("--plugin-dir",C.path);else throw Error(`Unsupported plugin type: ${C.type}`);if(this.options.forkSession)K.push("--fork-session");if(this.options.resumeSessionAt)K.push("--resume-session-at",this.options.resumeSessionAt);if(this.options.sessionId)K.push("--session-id",this.options.sessionId);if(this.options.persistSession===!1)K.push("--no-session-persistence");let l0={...c??{}};if(this.options.settings)l0.settings=this.options.settings;let H0=Vu(l0,z);for(let[C,s]of Object.entries(H0))if(s===null)K.push(`--${C}`);else K.push(`--${C}`,s);if(!r.CLAUDE_CODE_ENTRYPOINT)r.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(delete r.NODE_OPTIONS,S6(r.DEBUG_CLAUDE_AGENT_SDK))r.DEBUG="1";else delete r.DEBUG;let O0=Nu(n),o0=O0?n:d,b=O0?[...S,...K]:[...S,n,...K],L={command:o0,args:b,cwd:h,env:r,signal:this.abortController.signal};if(this.options.spawnClaudeCodeProcess)a3(`Spawning Claude Code (custom): ${o0} ${b.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(L);else a3(`Spawning Claude Code: ${o0} ${b.join(" ")}`),this.process=this.spawnLocalProcess(L);this.processStdin=this.process.stdin,this.processStdout=this.process.stdout;let B=()=>{if(this.process&&!this.process.killed)this.process.kill("SIGTERM")};this.processExitHandler=B,this.abortHandler=B,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.process.on("error",(C)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new P3("Claude Code process aborted by user");else if(zf(C)){let s=O0?`Claude Code native binary not found at ${n}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${n}. Is options.pathToClaudeCodeExecutable set?`;this.exitError=ReferenceError(s),a3(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${C.message}`),a3(this.exitError.message)}),this.process.on("exit",(C,s)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new P3("Claude Code process aborted by user");else{let P=this.getProcessExitError(C,s);if(P)this.exitError=P,a3(P.message)}}),this.ready=!0}catch(E){throw this.ready=!1,E}}getProcessExitError(E,y){if(E!==0&&E!==null)return Error(`Claude Code process exited with code ${E}`);else if(y)return Error(`Claude Code process terminated by signal ${y}`);return}write(E){if(this.abortController.signal.aborted)throw new P3("Operation aborted");if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){a3("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);a3(`[ProcessTransport] Writing to stdin: ${E.substring(0,100)}`);try{if(!this.processStdin.write(E))a3("[ProcessTransport] Write buffer full, data queued")}catch(y){throw this.ready=!1,Error(`Failed to write to process stdin: ${C8(y)}`)}}close(){if(this.processStdin)this.processStdin.end(),this.processStdin=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:y}of this.exitListeners)this.process?.off("exit",y);this.exitListeners=[];let E=this.process;if(E&&!E.killed&&E.exitCode===null)setTimeout((y)=>{if(y.killed||y.exitCode!==null)return;y.kill("SIGTERM"),setTimeout((p)=>{if(p.exitCode===null)p.kill("SIGKILL")},5000,y).unref()},Bu,E).unref(),E.once("exit",()=>{if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0});else if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0;this.ready=!1}isReady(){return this.ready}async*readMessages(){if(!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let E=Cm({input:this.processStdout}),y=this.process?(()=>{let p=this.process,h=()=>E.close();return p.on("error",h),()=>p.off("error",h)})():void 0;if(this.exitError)E.close();try{for await(let p of E)if(p.trim()){let h;try{h=Ay(p)}catch(d){a3(`Non-JSON stdout: ${p}`);continue}yield h}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(p){throw p}finally{y?.(),E.close()}}endInput(){if(this.processStdin)this.processStdin.end()}getInputStream(){return this.processStdin}onExit(E){if(!this.process)return()=>{};let y=(p,h)=>{let d=this.getProcessExitError(p,h);E(d)};return this.process.on("exit",y),this.exitListeners.push({callback:E,handler:y}),()=>{if(this.process)this.process.off("exit",y);let p=this.exitListeners.findIndex((h)=>h.handler===y);if(p!==-1)this.exitListeners.splice(p,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((E,y)=>{let p=(d,S)=>{if(this.abortController.signal.aborted){y(new P3("Operation aborted"));return}let c=this.getProcessExitError(d,S);if(c)y(c);else E()};this.process.once("exit",p);let h=(d)=>{this.process.off("exit",p),y(d)};this.process.once("error",h),this.process.once("exit",()=>{this.process.off("error",h)})})}}function Nu(E){return![".js",".mjs",".tsx",".ts",".jsx"].some((y)=>E.endsWith(y))}function wu(E,y=process.platform,p=process.arch){let h;if(y==="linux")h=[`@anthropic-ai/claude-agent-sdk-linux-${p}-musl/cli`,`@anthropic-ai/claude-agent-sdk-linux-${p}/cli`];else if(y==="win32")h=[`@anthropic-ai/claude-agent-sdk-win32-${p}/cli.exe`];else h=[`@anthropic-ai/claude-agent-sdk-${y}-${p}/cli`];for(let d of h)try{return E(d)}catch{}return null}class My{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(E){this.returned=E}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((E,y)=>{this.readResolve=E,this.readReject=y})}enqueue(E){if(this.readResolve){let y=this.readResolve;this.readResolve=void 0,this.readReject=void 0,y({done:!1,value:E})}else this.queue.push(E)}done(){if(this.isDone=!0,this.readResolve){let E=this.readResolve;this.readResolve=void 0,this.readReject=void 0,E({done:!0,value:void 0})}}error(E){if(this.hasError=E,this.readReject){let y=this.readReject;this.readResolve=void 0,this.readReject=void 0,y(E)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}class FS{sendMcpMessage;isClosed=!1;constructor(E){this.sendMcpMessage=E}onclose;onerror;onmessage;async start(){}async send(E){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(E)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}class AS{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new My;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;setIsSingleUserTurn(E){this.isSingleUserTurn=E}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0}constructor(E,y,p,h,d,S=new Map,c,n,r){this.transport=E,this.isSingleUserTurn=y,this.canUseTool=p,this.hooks=h,this.abortController=d,this.jsonSchema=c,this.initConfig=n,this.onElicitation=r;for(let[T,k]of S)this.connectSdkMcpServer(T,k);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(E){this.inputStream.error(E)}async stopTask(E){await this.request({subtype:"stop_task",task_id:E})}close(){this.cleanup()}cleanup(E){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{for(let p of this.cancelControllers.values())p.abort();this.cancelControllers.clear(),this.transport.close();let y=Error("Query closed before response received");for(let{reject:p}of this.pendingControlResponses.values())p(y);this.pendingControlResponses.clear();for(let{reject:p}of this.pendingMcpResponses.values())p(y);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let p of this.sdkMcpTransports.values())p.close().catch(()=>{});if(this.sdkMcpTransports.clear(),E)this.inputStream.error(E);else this.inputStream.done()}catch(y){}}next(...[E]){return this.sdkMessages.next(...[E])}return(E){return this.sdkMessages.return(E)}throw(E){return this.sdkMessages.throw(E)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let E of this.transport.readMessages()){if(E.type==="control_response"){let y=this.pendingControlResponses.get(E.response.request_id);if(y)y.handler(E.response);continue}else if(E.type==="control_request"){this.handleControlRequest(E);continue}else if(E.type==="control_cancel_request"){this.handleControlCancelRequest(E);continue}else if(E.type==="keep_alive")continue;if(E.type==="system"&&E.subtype==="post_turn_summary")continue;if(E.type==="result"){if(this.lastErrorResultText=E.is_error?E.subtype==="success"?E.result:E.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)A3("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}else if(!(E.type==="system"&&E.subtype==="session_state_changed"))this.lastErrorResultText=void 0;this.inputStream.enqueue(E)}if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(E){if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.lastErrorResultText!==void 0&&!(E instanceof P3)){let y=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);A3(`[Query.readMessages] Replacing exit error with result text. Original: ${C8(E)}`),this.inputStream.error(y),this.cleanup(y);return}this.inputStream.error(E),this.cleanup(E)}}async handleControlRequest(E){let y=new AbortController;this.cancelControllers.set(E.request_id,y);try{let p=await this.processControlRequest(E,y.signal);if(this.cleanupPerformed)return;let h={type:"control_response",response:{subtype:"success",request_id:E.request_id,response:p}};await Promise.resolve(this.transport.write(C3(h)+`
53
- `))}catch(p){if(this.cleanupPerformed)return;let h={type:"control_response",response:{subtype:"error",request_id:E.request_id,error:C8(p)}};try{await Promise.resolve(this.transport.write(C3(h)+`
54
- `))}catch(d){A3(`[Query.handleControlRequest] Error-response write failed: ${C8(d)}`,{level:"error"})}}finally{this.cancelControllers.delete(E.request_id)}}handleControlCancelRequest(E){let y=this.cancelControllers.get(E.request_id);if(y)y.abort(),this.cancelControllers.delete(E.request_id)}async processControlRequest(E,y){if(E.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(E.request.tool_name,E.request.input,{signal:y,suggestions:E.request.permission_suggestions,blockedPath:E.request.blocked_path,decisionReason:E.request.decision_reason,title:E.request.title,displayName:E.request.display_name,description:E.request.description,toolUseID:E.request.tool_use_id,agentID:E.request.agent_id}),toolUseID:E.request.tool_use_id}}else if(E.request.subtype==="hook_callback")return await this.handleHookCallbacks(E.request.callback_id,E.request.input,E.request.tool_use_id,y);else if(E.request.subtype==="mcp_message"){let p=E.request,h=this.sdkMcpTransports.get(p.server_name);if(!h)throw Error(`SDK MCP server not found: ${p.server_name}`);if("method"in p.message&&"id"in p.message&&p.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(p.server_name,p,h)};else{if(h.onmessage)h.onmessage(p.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}else if(E.request.subtype==="elicitation"){let p=E.request;if(this.onElicitation)return await this.onElicitation({serverName:p.mcp_server_name,message:p.message,mode:p.mode,url:p.url,elicitationId:p.elicitation_id,requestedSchema:p.requested_schema,title:p.title,displayName:p.display_name,description:p.description},{signal:y});return{action:"decline"}}throw Error("Unsupported control request subtype: "+E.request.subtype)}async*readSdkMessages(){for await(let E of this.inputStream)yield E}async initialize(){let E;if(this.hooks){E={};for(let[h,d]of Object.entries(this.hooks))if(d.length>0)E[h]=d.map((S)=>{let c=[];for(let n of S.hooks){let r=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(r,n),c.push(r)}return{matcher:S.matcher,hookCallbackIds:c,timeout:S.timeout}})}let y=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,p={subtype:"initialize",hooks:E,sdkMcpServers:y,jsonSchema:this.jsonSchema,systemPrompt:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,agents:this.initConfig?.agents,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries};return(await this.request(p)).response}async interrupt(){await this.request({subtype:"interrupt"})}async setPermissionMode(E){await this.request({subtype:"set_permission_mode",mode:E})}async setModel(E){await this.request({subtype:"set_model",model:E})}async setMaxThinkingTokens(E){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:E})}async applyFlagSettings(E){await this.request({subtype:"apply_flag_settings",settings:E})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(E,y){return(await this.request({subtype:"rewind_files",user_message_id:E,dry_run:y?.dryRun})).response}async cancelAsyncMessage(E){return(await this.request({subtype:"cancel_async_message",message_uuid:E})).response.cancelled}async seedReadState(E,y){await this.request({subtype:"seed_read_state",path:E,mtime:y})}async enableRemoteControl(E){return(await this.request({subtype:"remote_control",enabled:E})).response}async setProactive(E){await this.request({subtype:"set_proactive",enabled:E})}async generateSessionTitle(E,y){return(await this.request({subtype:"generate_session_title",description:E,persist:y?.persist})).response.title}async askSideQuestion(E){return(await this.request({subtype:"side_question",question:E})).response.response}processPendingPermissionRequests(E){for(let y of E)if(y.request.subtype==="can_use_tool")this.handleControlRequest(y).catch(()=>{})}request(E){let y=Math.random().toString(36).substring(2,15),p={request_id:y,type:"control_request",request:E};return new Promise((h,d)=>{this.pendingControlResponses.set(y,{handler:(S)=>{if(this.pendingControlResponses.delete(y),S.subtype==="success")h(S);else if(d(Error(S.error)),S.pending_permission_requests)this.processPendingPermissionRequests(S.pending_permission_requests)},reject:d}),Promise.resolve(this.transport.write(C3(p)+`
55
- `)).catch((S)=>{this.pendingControlResponses.delete(y),d(S)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(E){await this.request({subtype:"mcp_reconnect",serverName:E})}async toggleMcpServer(E,y){await this.request({subtype:"mcp_toggle",serverName:E,enabled:y})}async enableChannel(E){await this.request({subtype:"channel_enable",serverName:E})}async mcpAuthenticate(E){return(await this.request({subtype:"mcp_authenticate",serverName:E})).response}async mcpClearAuth(E){return(await this.request({subtype:"mcp_clear_auth",serverName:E})).response}async mcpSubmitOAuthCallbackUrl(E,y){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:E,callbackUrl:y})).response}async claudeAuthenticate(E){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:E})).response}async claudeOAuthCallback(E,y){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:E,state:y})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async reloadPlugins(){return(await this.request({subtype:"reload_plugins"})).response}async setMcpServers(E){let y={},p={};for(let[c,n]of Object.entries(E))if(n.type==="sdk"&&"instance"in n)y[c]=n.instance;else p[c]=n;let h=new Set(this.sdkMcpServerInstances.keys()),d=new Set(Object.keys(y));for(let c of h)if(!d.has(c))await this.disconnectSdkMcpServer(c);for(let[c,n]of Object.entries(y))if(!h.has(c))this.connectSdkMcpServer(c,n);let S={};for(let c of Object.keys(y))S[c]={type:"sdk",name:c};return(await this.request({subtype:"mcp_set_servers",servers:{...p,...S}})).response}async accountInfo(){return(await this.initialization).account}async streamInput(E){A3("[Query.streamInput] Starting to process input stream");try{let y=0;for await(let p of E){if(y++,A3(`[Query.streamInput] Processing message ${y}: ${p.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(C3(p)+`
56
- `))}if(A3(`[Query.streamInput] Finished processing ${y} messages from input stream`),y>0&&this.hasBidirectionalNeeds())A3("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();A3("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(y){if(!(y instanceof P3))throw y}}waitForFirstResult(){if(this.firstResultReceived)return A3("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve();return new Promise((E)=>{if(this.abortController?.signal.aborted){E();return}this.abortController?.signal.addEventListener("abort",()=>E(),{once:!0}),this.firstResultReceivedResolve=E})}handleHookCallbacks(E,y,p,h){let d=this.hookCallbacks.get(E);if(!d)throw Error(`No hook callback found for ID: ${E}`);return d(y,p,{signal:h})}connectSdkMcpServer(E,y){let p=new FS((h)=>this.sendMcpServerMessageToCli(E,h));this.sdkMcpTransports.set(E,p),this.sdkMcpServerInstances.set(E,y),y.connect(p).catch((h)=>{if(this.sdkMcpTransports.get(E)===p)this.sdkMcpTransports.delete(E);if(this.sdkMcpServerInstances.get(E)===y)this.sdkMcpServerInstances.delete(E);A3(`[Query.connectSdkMcpServer] Failed to connect MCP server '${E}': ${h}`,{level:"error"})})}async disconnectSdkMcpServer(E){let y=this.sdkMcpTransports.get(E);if(y)await y.close(),this.sdkMcpTransports.delete(E);this.sdkMcpServerInstances.delete(E)}sendMcpServerMessageToCli(E,y){if("id"in y&&y.id!==null&&y.id!==void 0){let h=`${E}:${y.id}`,d=this.pendingMcpResponses.get(h);if(d){d.resolve(y),this.pendingMcpResponses.delete(h);return}}let p={type:"control_request",request_id:aS(),request:{subtype:"mcp_message",server_name:E,message:y}};Promise.resolve(this.transport.write(C3(p)+`
57
- `)).catch((h)=>{A3(`[Query.sendMcpServerMessageToCli] Transport write failed: ${h}`,{level:"error"})})}handleMcpControlRequest(E,y,p){let h="id"in y.message?y.message.id:null,d=`${E}:${h}`;return new Promise((S,c)=>{let n=()=>{this.pendingMcpResponses.delete(d)},r=(k)=>{n(),S(k)},T=(k)=>{n(),c(k)};if(this.pendingMcpResponses.set(d,{resolve:r,reject:T}),p.onmessage)p.onmessage(y.message);else{n(),c(Error("No message handler registered"));return}})}}var ki=Hu(Ku);var ai=Buffer.from('{"type":"attribution-snapshot"'),Ci=Buffer.from('{"type":"system"'),Ou=10,oi=Buffer.from([Ou]);var t0;(function(E){E.assertEqual=(d)=>{};function y(d){}E.assertIs=y;function p(d){throw Error()}E.assertNever=p,E.arrayToEnum=(d)=>{let S={};for(let c of d)S[c]=c;return S},E.getValidEnumValues=(d)=>{let S=E.objectKeys(d).filter((n)=>typeof d[d[n]]!=="number"),c={};for(let n of S)c[n]=d[n];return E.objectValues(c)},E.objectValues=(d)=>{return E.objectKeys(d).map(function(S){return d[S]})},E.objectKeys=typeof Object.keys==="function"?(d)=>Object.keys(d):(d)=>{let S=[];for(let c in d)if(Object.prototype.hasOwnProperty.call(d,c))S.push(c);return S},E.find=(d,S)=>{for(let c of d)if(S(c))return c;return},E.isInteger=typeof Number.isInteger==="function"?(d)=>Number.isInteger(d):(d)=>typeof d==="number"&&Number.isFinite(d)&&Math.floor(d)===d;function h(d,S=" | "){return d.map((c)=>typeof c==="string"?`'${c}'`:c).join(S)}E.joinValues=h,E.jsonStringifyReplacer=(d,S)=>{if(typeof S==="bigint")return S.toString();return S}})(t0||(t0={}));var mh;(function(E){E.mergeShapes=(y,p)=>{return{...y,...p}}})(mh||(mh={}));var Y=t0.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J3=(E)=>{switch(typeof E){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return Number.isNaN(E)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":if(Array.isArray(E))return Y.array;if(E===null)return Y.null;if(E.then&&typeof E.then==="function"&&E.catch&&typeof E.catch==="function")return Y.promise;if(typeof Map<"u"&&E instanceof Map)return Y.map;if(typeof Set<"u"&&E instanceof Set)return Y.set;if(typeof Date<"u"&&E instanceof Date)return Y.date;return Y.object;default:return Y.unknown}},w=t0.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I3 extends Error{get errors(){return this.issues}constructor(E){super();this.issues=[],this.addIssue=(p)=>{this.issues=[...this.issues,p]},this.addIssues=(p=[])=>{this.issues=[...this.issues,...p]};let y=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,y);else this.__proto__=y;this.name="ZodError",this.issues=E}format(E){let y=E||function(d){return d.message},p={_errors:[]},h=(d)=>{for(let S of d.issues)if(S.code==="invalid_union")S.unionErrors.map(h);else if(S.code==="invalid_return_type")h(S.returnTypeError);else if(S.code==="invalid_arguments")h(S.argumentsError);else if(S.path.length===0)p._errors.push(y(S));else{let c=p,n=0;while(n<S.path.length){let r=S.path[n];if(n!==S.path.length-1)c[r]=c[r]||{_errors:[]};else c[r]=c[r]||{_errors:[]},c[r]._errors.push(y(S));c=c[r],n++}}};return h(this),p}static assert(E){if(!(E instanceof I3))throw Error(`Not a ZodError: ${E}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,t0.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(E=(y)=>y.message){let y={},p=[];for(let h of this.issues)if(h.path.length>0){let d=h.path[0];y[d]=y[d]||[],y[d].push(E(h))}else p.push(E(h));return{formErrors:p,fieldErrors:y}}get formErrors(){return this.flatten()}}I3.create=(E)=>{return new I3(E)};var Uu=(E,y)=>{let p;switch(E.code){case w.invalid_type:if(E.received===Y.undefined)p="Required";else p=`Expected ${E.expected}, received ${E.received}`;break;case w.invalid_literal:p=`Invalid literal value, expected ${JSON.stringify(E.expected,t0.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:p=`Unrecognized key(s) in object: ${t0.joinValues(E.keys,", ")}`;break;case w.invalid_union:p="Invalid input";break;case w.invalid_union_discriminator:p=`Invalid discriminator value. Expected ${t0.joinValues(E.options)}`;break;case w.invalid_enum_value:p=`Invalid enum value. Expected ${t0.joinValues(E.options)}, received '${E.received}'`;break;case w.invalid_arguments:p="Invalid function arguments";break;case w.invalid_return_type:p="Invalid function return type";break;case w.invalid_date:p="Invalid date";break;case w.invalid_string:if(typeof E.validation==="object")if("includes"in E.validation){if(p=`Invalid input: must include "${E.validation.includes}"`,typeof E.validation.position==="number")p=`${p} at one or more positions greater than or equal to ${E.validation.position}`}else if("startsWith"in E.validation)p=`Invalid input: must start with "${E.validation.startsWith}"`;else if("endsWith"in E.validation)p=`Invalid input: must end with "${E.validation.endsWith}"`;else t0.assertNever(E.validation);else if(E.validation!=="regex")p=`Invalid ${E.validation}`;else p="Invalid";break;case w.too_small:if(E.type==="array")p=`Array must contain ${E.exact?"exactly":E.inclusive?"at least":"more than"} ${E.minimum} element(s)`;else if(E.type==="string")p=`String must contain ${E.exact?"exactly":E.inclusive?"at least":"over"} ${E.minimum} character(s)`;else if(E.type==="number")p=`Number must be ${E.exact?"exactly equal to ":E.inclusive?"greater than or equal to ":"greater than "}${E.minimum}`;else if(E.type==="bigint")p=`Number must be ${E.exact?"exactly equal to ":E.inclusive?"greater than or equal to ":"greater than "}${E.minimum}`;else if(E.type==="date")p=`Date must be ${E.exact?"exactly equal to ":E.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(E.minimum))}`;else p="Invalid input";break;case w.too_big:if(E.type==="array")p=`Array must contain ${E.exact?"exactly":E.inclusive?"at most":"less than"} ${E.maximum} element(s)`;else if(E.type==="string")p=`String must contain ${E.exact?"exactly":E.inclusive?"at most":"under"} ${E.maximum} character(s)`;else if(E.type==="number")p=`Number must be ${E.exact?"exactly":E.inclusive?"less than or equal to":"less than"} ${E.maximum}`;else if(E.type==="bigint")p=`BigInt must be ${E.exact?"exactly":E.inclusive?"less than or equal to":"less than"} ${E.maximum}`;else if(E.type==="date")p=`Date must be ${E.exact?"exactly":E.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(E.maximum))}`;else p="Invalid input";break;case w.custom:p="Invalid input";break;case w.invalid_intersection_types:p="Intersection results could not be merged";break;case w.not_multiple_of:p=`Number must be a multiple of ${E.multipleOf}`;break;case w.not_finite:p="Number must be finite";break;default:p=y.defaultError,t0.assertNever(E)}return{message:p}},I4=Uu,Gu=I4;function UE(){return Gu}var GE=(E)=>{let{data:y,path:p,errorMaps:h,issueData:d}=E,S=[...p,...d.path||[]],c={...d,path:S};if(d.message!==void 0)return{...d,path:S,message:d.message};let n="",r=h.filter((T)=>!!T).slice().reverse();for(let T of r)n=T(c,{data:y,defaultError:n}).message;return{...d,path:S,message:n}};function G(E,y){let p=UE(),h=GE({issueData:y,data:E.data,path:E.path,errorMaps:[E.common.contextualErrorMap,E.schemaErrorMap,p,p===I4?void 0:I4].filter((d)=>!!d)});E.common.issues.push(h)}class p3{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(E,y){let p=[];for(let h of y){if(h.status==="aborted")return S0;if(h.status==="dirty")E.dirty();p.push(h.value)}return{status:E.value,value:p}}static async mergeObjectAsync(E,y){let p=[];for(let h of y){let d=await h.key,S=await h.value;p.push({key:d,value:S})}return p3.mergeObjectSync(E,p)}static mergeObjectSync(E,y){let p={};for(let h of y){let{key:d,value:S}=h;if(d.status==="aborted")return S0;if(S.status==="aborted")return S0;if(d.status==="dirty")E.dirty();if(S.status==="dirty")E.dirty();if(d.value!=="__proto__"&&(typeof S.value<"u"||h.alwaysSet))p[d.value]=S.value}return{status:E.value,value:p}}}var S0=Object.freeze({status:"aborted"}),u4=(E)=>({status:"dirty",value:E}),S3=(E)=>({status:"valid",value:E}),Rh=(E)=>E.status==="aborted",fh=(E)=>E.status==="dirty",g6=(E)=>E.status==="valid",F8=(E)=>typeof Promise<"u"&&E instanceof Promise,$;(function(E){E.errToObj=(y)=>typeof y==="string"?{message:y}:y||{},E.toString=(y)=>typeof y==="string"?y:y?.message})($||($={}));class s3{constructor(E,y,p,h){this._cachedPath=[],this.parent=E,this.data=y,this._path=p,this._key=h}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var uh=(E,y)=>{if(g6(y))return{success:!0,data:y.value};else{if(!E.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let p=new I3(E.common.issues);return this._error=p,this._error}}}};function m0(E){if(!E)return{};let{errorMap:y,invalid_type_error:p,required_error:h,description:d}=E;if(y&&(p||h))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(y)return{errorMap:y,description:d};return{errorMap:(S,c)=>{let{message:n}=E;if(S.code==="invalid_enum_value")return{message:n??c.defaultError};if(typeof c.data>"u")return{message:n??h??c.defaultError};if(S.code!=="invalid_type")return{message:c.defaultError};return{message:n??p??c.defaultError}},description:d}}class a0{get description(){return this._def.description}_getType(E){return J3(E.data)}_getOrReturnCtx(E,y){return y||{common:E.parent.common,data:E.data,parsedType:J3(E.data),schemaErrorMap:this._def.errorMap,path:E.path,parent:E.parent}}_processInputParams(E){return{status:new p3,ctx:{common:E.parent.common,data:E.data,parsedType:J3(E.data),schemaErrorMap:this._def.errorMap,path:E.path,parent:E.parent}}}_parseSync(E){let y=this._parse(E);if(F8(y))throw Error("Synchronous parse encountered promise.");return y}_parseAsync(E){let y=this._parse(E);return Promise.resolve(y)}parse(E,y){let p=this.safeParse(E,y);if(p.success)return p.data;throw p.error}safeParse(E,y){let p={common:{issues:[],async:y?.async??!1,contextualErrorMap:y?.errorMap},path:y?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:E,parsedType:J3(E)},h=this._parseSync({data:E,path:p.path,parent:p});return uh(p,h)}"~validate"(E){let y={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:E,parsedType:J3(E)};if(!this["~standard"].async)try{let p=this._parseSync({data:E,path:[],parent:y});return g6(p)?{value:p.value}:{issues:y.common.issues}}catch(p){if(p?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;y.common={issues:[],async:!0}}return this._parseAsync({data:E,path:[],parent:y}).then((p)=>g6(p)?{value:p.value}:{issues:y.common.issues})}async parseAsync(E,y){let p=await this.safeParseAsync(E,y);if(p.success)return p.data;throw p.error}async safeParseAsync(E,y){let p={common:{issues:[],contextualErrorMap:y?.errorMap,async:!0},path:y?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:E,parsedType:J3(E)},h=this._parse({data:E,path:p.path,parent:p}),d=await(F8(h)?h:Promise.resolve(h));return uh(p,d)}refine(E,y){let p=(h)=>{if(typeof y==="string"||typeof y>"u")return{message:y};else if(typeof y==="function")return y(h);else return y};return this._refinement((h,d)=>{let S=E(h),c=()=>d.addIssue({code:w.custom,...p(h)});if(typeof Promise<"u"&&S instanceof Promise)return S.then((n)=>{if(!n)return c(),!1;else return!0});if(!S)return c(),!1;else return!0})}refinement(E,y){return this._refinement((p,h)=>{if(!E(p))return h.addIssue(typeof y==="function"?y(p,h):y),!1;else return!0})}_refinement(E){return new _3({schema:this,typeName:c0.ZodEffects,effect:{type:"refinement",refinement:E}})}superRefine(E){return this._refinement(E)}constructor(E){this.spa=this.safeParseAsync,this._def=E,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(y)=>this["~validate"](y)}}optional(){return q3.create(this,this._def)}nullable(){return X3.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return j3.create(this)}promise(){return j6.create(this,this._def)}or(E){return v4.create([this,E],this._def)}and(E){return F4.create(this,E,this._def)}transform(E){return new _3({...m0(this._def),schema:this,typeName:c0.ZodEffects,effect:{type:"transform",transform:E}})}default(E){let y=typeof E==="function"?E:()=>E;return new b4({...m0(this._def),innerType:this,defaultValue:y,typeName:c0.ZodDefault})}brand(){return new by({typeName:c0.ZodBranded,type:this,...m0(this._def)})}catch(E){let y=typeof E==="function"?E:()=>E;return new e4({...m0(this._def),innerType:this,catchValue:y,typeName:c0.ZodCatch})}describe(E){return new this.constructor({...this._def,description:E})}pipe(E){return EE.create(this,E)}readonly(){return g4.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Wu=/^c[^\s-]{8,}$/i,zu=/^[0-9a-z]+$/,Qu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ju=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Yu=/^[a-z0-9_-]{21}$/i,Xu=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$u=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ek=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",jE,dk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Sk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ck=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,MS="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",rk=new RegExp(`^${MS}$`);function sS(E){let y="[0-5]\\d";if(E.precision)y=`${y}\\.\\d{${E.precision}}`;else if(E.precision==null)y=`${y}(\\.\\d+)?`;let p=E.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${y})${p}`}function Tk(E){return new RegExp(`^${sS(E)}$`)}function mk(E){let y=`${MS}T${sS(E)}`,p=[];if(p.push(E.local?"Z?":"Z"),E.offset)p.push("([+-]\\d{2}:?\\d{2})");return y=`${y}(${p.join("|")})`,new RegExp(`^${y}$`)}function Rk(E,y){if((y==="v4"||!y)&&dk.test(E))return!0;if((y==="v6"||!y)&&hk.test(E))return!0;return!1}function fk(E,y){if(!Xu.test(E))return!1;try{let[p]=E.split(".");if(!p)return!1;let h=p.replace(/-/g,"+").replace(/_/g,"/").padEnd(p.length+(4-p.length%4)%4,"="),d=JSON.parse(atob(h));if(typeof d!=="object"||d===null)return!1;if("typ"in d&&d?.typ!=="JWT")return!1;if(!d.alg)return!1;if(y&&d.alg!==y)return!1;return!0}catch{return!1}}function uk(E,y){if((y==="v4"||!y)&&pk.test(E))return!0;if((y==="v6"||!y)&&Sk.test(E))return!0;return!1}class w3 extends a0{_parse(E){if(this._def.coerce)E.data=String(E.data);if(this._getType(E)!==Y.string){let h=this._getOrReturnCtx(E);return G(h,{code:w.invalid_type,expected:Y.string,received:h.parsedType}),S0}let y=new p3,p=void 0;for(let h of this._def.checks)if(h.kind==="min"){if(E.data.length<h.value)p=this._getOrReturnCtx(E,p),G(p,{code:w.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),y.dirty()}else if(h.kind==="max"){if(E.data.length>h.value)p=this._getOrReturnCtx(E,p),G(p,{code:w.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),y.dirty()}else if(h.kind==="length"){let d=E.data.length>h.value,S=E.data.length<h.value;if(d||S){if(p=this._getOrReturnCtx(E,p),d)G(p,{code:w.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message});else if(S)G(p,{code:w.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message});y.dirty()}}else if(h.kind==="email"){if(!Ek.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"email",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="emoji"){if(!jE)jE=new RegExp(yk,"u");if(!jE.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"emoji",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="uuid"){if(!Ju.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"uuid",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="nanoid"){if(!Yu.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"nanoid",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="cuid"){if(!Wu.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"cuid",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="cuid2"){if(!zu.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"cuid2",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="ulid"){if(!Qu.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"ulid",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="url")try{new URL(E.data)}catch{p=this._getOrReturnCtx(E,p),G(p,{validation:"url",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="regex"){if(h.regex.lastIndex=0,!h.regex.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"regex",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="trim")E.data=E.data.trim();else if(h.kind==="includes"){if(!E.data.includes(h.value,h.position))p=this._getOrReturnCtx(E,p),G(p,{code:w.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),y.dirty()}else if(h.kind==="toLowerCase")E.data=E.data.toLowerCase();else if(h.kind==="toUpperCase")E.data=E.data.toUpperCase();else if(h.kind==="startsWith"){if(!E.data.startsWith(h.value))p=this._getOrReturnCtx(E,p),G(p,{code:w.invalid_string,validation:{startsWith:h.value},message:h.message}),y.dirty()}else if(h.kind==="endsWith"){if(!E.data.endsWith(h.value))p=this._getOrReturnCtx(E,p),G(p,{code:w.invalid_string,validation:{endsWith:h.value},message:h.message}),y.dirty()}else if(h.kind==="datetime"){if(!mk(h).test(E.data))p=this._getOrReturnCtx(E,p),G(p,{code:w.invalid_string,validation:"datetime",message:h.message}),y.dirty()}else if(h.kind==="date"){if(!rk.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{code:w.invalid_string,validation:"date",message:h.message}),y.dirty()}else if(h.kind==="time"){if(!Tk(h).test(E.data))p=this._getOrReturnCtx(E,p),G(p,{code:w.invalid_string,validation:"time",message:h.message}),y.dirty()}else if(h.kind==="duration"){if(!$u.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"duration",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="ip"){if(!Rk(E.data,h.version))p=this._getOrReturnCtx(E,p),G(p,{validation:"ip",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="jwt"){if(!fk(E.data,h.alg))p=this._getOrReturnCtx(E,p),G(p,{validation:"jwt",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="cidr"){if(!uk(E.data,h.version))p=this._getOrReturnCtx(E,p),G(p,{validation:"cidr",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="base64"){if(!ck.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"base64",code:w.invalid_string,message:h.message}),y.dirty()}else if(h.kind==="base64url"){if(!nk.test(E.data))p=this._getOrReturnCtx(E,p),G(p,{validation:"base64url",code:w.invalid_string,message:h.message}),y.dirty()}else t0.assertNever(h);return{status:y.value,value:E.data}}_regex(E,y,p){return this.refinement((h)=>E.test(h),{validation:y,code:w.invalid_string,...$.errToObj(p)})}_addCheck(E){return new w3({...this._def,checks:[...this._def.checks,E]})}email(E){return this._addCheck({kind:"email",...$.errToObj(E)})}url(E){return this._addCheck({kind:"url",...$.errToObj(E)})}emoji(E){return this._addCheck({kind:"emoji",...$.errToObj(E)})}uuid(E){return this._addCheck({kind:"uuid",...$.errToObj(E)})}nanoid(E){return this._addCheck({kind:"nanoid",...$.errToObj(E)})}cuid(E){return this._addCheck({kind:"cuid",...$.errToObj(E)})}cuid2(E){return this._addCheck({kind:"cuid2",...$.errToObj(E)})}ulid(E){return this._addCheck({kind:"ulid",...$.errToObj(E)})}base64(E){return this._addCheck({kind:"base64",...$.errToObj(E)})}base64url(E){return this._addCheck({kind:"base64url",...$.errToObj(E)})}jwt(E){return this._addCheck({kind:"jwt",...$.errToObj(E)})}ip(E){return this._addCheck({kind:"ip",...$.errToObj(E)})}cidr(E){return this._addCheck({kind:"cidr",...$.errToObj(E)})}datetime(E){if(typeof E==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:E});return this._addCheck({kind:"datetime",precision:typeof E?.precision>"u"?null:E?.precision,offset:E?.offset??!1,local:E?.local??!1,...$.errToObj(E?.message)})}date(E){return this._addCheck({kind:"date",message:E})}time(E){if(typeof E==="string")return this._addCheck({kind:"time",precision:null,message:E});return this._addCheck({kind:"time",precision:typeof E?.precision>"u"?null:E?.precision,...$.errToObj(E?.message)})}duration(E){return this._addCheck({kind:"duration",...$.errToObj(E)})}regex(E,y){return this._addCheck({kind:"regex",regex:E,...$.errToObj(y)})}includes(E,y){return this._addCheck({kind:"includes",value:E,position:y?.position,...$.errToObj(y?.message)})}startsWith(E,y){return this._addCheck({kind:"startsWith",value:E,...$.errToObj(y)})}endsWith(E,y){return this._addCheck({kind:"endsWith",value:E,...$.errToObj(y)})}min(E,y){return this._addCheck({kind:"min",value:E,...$.errToObj(y)})}max(E,y){return this._addCheck({kind:"max",value:E,...$.errToObj(y)})}length(E,y){return this._addCheck({kind:"length",value:E,...$.errToObj(y)})}nonempty(E){return this.min(1,$.errToObj(E))}trim(){return new w3({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new w3({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new w3({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((E)=>E.kind==="datetime")}get isDate(){return!!this._def.checks.find((E)=>E.kind==="date")}get isTime(){return!!this._def.checks.find((E)=>E.kind==="time")}get isDuration(){return!!this._def.checks.find((E)=>E.kind==="duration")}get isEmail(){return!!this._def.checks.find((E)=>E.kind==="email")}get isURL(){return!!this._def.checks.find((E)=>E.kind==="url")}get isEmoji(){return!!this._def.checks.find((E)=>E.kind==="emoji")}get isUUID(){return!!this._def.checks.find((E)=>E.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((E)=>E.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((E)=>E.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((E)=>E.kind==="cuid2")}get isULID(){return!!this._def.checks.find((E)=>E.kind==="ulid")}get isIP(){return!!this._def.checks.find((E)=>E.kind==="ip")}get isCIDR(){return!!this._def.checks.find((E)=>E.kind==="cidr")}get isBase64(){return!!this._def.checks.find((E)=>E.kind==="base64")}get isBase64url(){return!!this._def.checks.find((E)=>E.kind==="base64url")}get minLength(){let E=null;for(let y of this._def.checks)if(y.kind==="min"){if(E===null||y.value>E)E=y.value}return E}get maxLength(){let E=null;for(let y of this._def.checks)if(y.kind==="max"){if(E===null||y.value<E)E=y.value}return E}}w3.create=(E)=>{return new w3({checks:[],typeName:c0.ZodString,coerce:E?.coerce??!1,...m0(E)})};function kk(E,y){let p=(E.toString().split(".")[1]||"").length,h=(y.toString().split(".")[1]||"").length,d=p>h?p:h,S=Number.parseInt(E.toFixed(d).replace(".","")),c=Number.parseInt(y.toFixed(d).replace(".",""));return S%c/10**d}class l6 extends a0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(E){if(this._def.coerce)E.data=Number(E.data);if(this._getType(E)!==Y.number){let h=this._getOrReturnCtx(E);return G(h,{code:w.invalid_type,expected:Y.number,received:h.parsedType}),S0}let y=void 0,p=new p3;for(let h of this._def.checks)if(h.kind==="int"){if(!t0.isInteger(E.data))y=this._getOrReturnCtx(E,y),G(y,{code:w.invalid_type,expected:"integer",received:"float",message:h.message}),p.dirty()}else if(h.kind==="min"){if(h.inclusive?E.data<h.value:E.data<=h.value)y=this._getOrReturnCtx(E,y),G(y,{code:w.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),p.dirty()}else if(h.kind==="max"){if(h.inclusive?E.data>h.value:E.data>=h.value)y=this._getOrReturnCtx(E,y),G(y,{code:w.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),p.dirty()}else if(h.kind==="multipleOf"){if(kk(E.data,h.value)!==0)y=this._getOrReturnCtx(E,y),G(y,{code:w.not_multiple_of,multipleOf:h.value,message:h.message}),p.dirty()}else if(h.kind==="finite"){if(!Number.isFinite(E.data))y=this._getOrReturnCtx(E,y),G(y,{code:w.not_finite,message:h.message}),p.dirty()}else t0.assertNever(h);return{status:p.value,value:E.data}}gte(E,y){return this.setLimit("min",E,!0,$.toString(y))}gt(E,y){return this.setLimit("min",E,!1,$.toString(y))}lte(E,y){return this.setLimit("max",E,!0,$.toString(y))}lt(E,y){return this.setLimit("max",E,!1,$.toString(y))}setLimit(E,y,p,h){return new l6({...this._def,checks:[...this._def.checks,{kind:E,value:y,inclusive:p,message:$.toString(h)}]})}_addCheck(E){return new l6({...this._def,checks:[...this._def.checks,E]})}int(E){return this._addCheck({kind:"int",message:$.toString(E)})}positive(E){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(E)})}negative(E){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(E)})}nonpositive(E){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(E)})}nonnegative(E){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(E)})}multipleOf(E,y){return this._addCheck({kind:"multipleOf",value:E,message:$.toString(y)})}finite(E){return this._addCheck({kind:"finite",message:$.toString(E)})}safe(E){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(E)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(E)})}get minValue(){let E=null;for(let y of this._def.checks)if(y.kind==="min"){if(E===null||y.value>E)E=y.value}return E}get maxValue(){let E=null;for(let y of this._def.checks)if(y.kind==="max"){if(E===null||y.value<E)E=y.value}return E}get isInt(){return!!this._def.checks.find((E)=>E.kind==="int"||E.kind==="multipleOf"&&t0.isInteger(E.value))}get isFinite(){let E=null,y=null;for(let p of this._def.checks)if(p.kind==="finite"||p.kind==="int"||p.kind==="multipleOf")return!0;else if(p.kind==="min"){if(y===null||p.value>y)y=p.value}else if(p.kind==="max"){if(E===null||p.value<E)E=p.value}return Number.isFinite(y)&&Number.isFinite(E)}}l6.create=(E)=>{return new l6({checks:[],typeName:c0.ZodNumber,coerce:E?.coerce||!1,...m0(E)})};class P6 extends a0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(E){if(this._def.coerce)try{E.data=BigInt(E.data)}catch{return this._getInvalidInput(E)}if(this._getType(E)!==Y.bigint)return this._getInvalidInput(E);let y=void 0,p=new p3;for(let h of this._def.checks)if(h.kind==="min"){if(h.inclusive?E.data<h.value:E.data<=h.value)y=this._getOrReturnCtx(E,y),G(y,{code:w.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),p.dirty()}else if(h.kind==="max"){if(h.inclusive?E.data>h.value:E.data>=h.value)y=this._getOrReturnCtx(E,y),G(y,{code:w.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),p.dirty()}else if(h.kind==="multipleOf"){if(E.data%h.value!==BigInt(0))y=this._getOrReturnCtx(E,y),G(y,{code:w.not_multiple_of,multipleOf:h.value,message:h.message}),p.dirty()}else t0.assertNever(h);return{status:p.value,value:E.data}}_getInvalidInput(E){let y=this._getOrReturnCtx(E);return G(y,{code:w.invalid_type,expected:Y.bigint,received:y.parsedType}),S0}gte(E,y){return this.setLimit("min",E,!0,$.toString(y))}gt(E,y){return this.setLimit("min",E,!1,$.toString(y))}lte(E,y){return this.setLimit("max",E,!0,$.toString(y))}lt(E,y){return this.setLimit("max",E,!1,$.toString(y))}setLimit(E,y,p,h){return new P6({...this._def,checks:[...this._def.checks,{kind:E,value:y,inclusive:p,message:$.toString(h)}]})}_addCheck(E){return new P6({...this._def,checks:[...this._def.checks,E]})}positive(E){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$.toString(E)})}negative(E){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(E)})}nonpositive(E){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(E)})}nonnegative(E){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(E)})}multipleOf(E,y){return this._addCheck({kind:"multipleOf",value:E,message:$.toString(y)})}get minValue(){let E=null;for(let y of this._def.checks)if(y.kind==="min"){if(E===null||y.value>E)E=y.value}return E}get maxValue(){let E=null;for(let y of this._def.checks)if(y.kind==="max"){if(E===null||y.value<E)E=y.value}return E}}P6.create=(E)=>{return new P6({checks:[],typeName:c0.ZodBigInt,coerce:E?.coerce??!1,...m0(E)})};class A8 extends a0{_parse(E){if(this._def.coerce)E.data=Boolean(E.data);if(this._getType(E)!==Y.boolean){let y=this._getOrReturnCtx(E);return G(y,{code:w.invalid_type,expected:Y.boolean,received:y.parsedType}),S0}return S3(E.data)}}A8.create=(E)=>{return new A8({typeName:c0.ZodBoolean,coerce:E?.coerce||!1,...m0(E)})};class i4 extends a0{_parse(E){if(this._def.coerce)E.data=new Date(E.data);if(this._getType(E)!==Y.date){let h=this._getOrReturnCtx(E);return G(h,{code:w.invalid_type,expected:Y.date,received:h.parsedType}),S0}if(Number.isNaN(E.data.getTime())){let h=this._getOrReturnCtx(E);return G(h,{code:w.invalid_date}),S0}let y=new p3,p=void 0;for(let h of this._def.checks)if(h.kind==="min"){if(E.data.getTime()<h.value)p=this._getOrReturnCtx(E,p),G(p,{code:w.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),y.dirty()}else if(h.kind==="max"){if(E.data.getTime()>h.value)p=this._getOrReturnCtx(E,p),G(p,{code:w.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),y.dirty()}else t0.assertNever(h);return{status:y.value,value:new Date(E.data.getTime())}}_addCheck(E){return new i4({...this._def,checks:[...this._def.checks,E]})}min(E,y){return this._addCheck({kind:"min",value:E.getTime(),message:$.toString(y)})}max(E,y){return this._addCheck({kind:"max",value:E.getTime(),message:$.toString(y)})}get minDate(){let E=null;for(let y of this._def.checks)if(y.kind==="min"){if(E===null||y.value>E)E=y.value}return E!=null?new Date(E):null}get maxDate(){let E=null;for(let y of this._def.checks)if(y.kind==="max"){if(E===null||y.value<E)E=y.value}return E!=null?new Date(E):null}}i4.create=(E)=>{return new i4({checks:[],coerce:E?.coerce||!1,typeName:c0.ZodDate,...m0(E)})};class M8 extends a0{_parse(E){if(this._getType(E)!==Y.symbol){let y=this._getOrReturnCtx(E);return G(y,{code:w.invalid_type,expected:Y.symbol,received:y.parsedType}),S0}return S3(E.data)}}M8.create=(E)=>{return new M8({typeName:c0.ZodSymbol,...m0(E)})};class t4 extends a0{_parse(E){if(this._getType(E)!==Y.undefined){let y=this._getOrReturnCtx(E);return G(y,{code:w.invalid_type,expected:Y.undefined,received:y.parsedType}),S0}return S3(E.data)}}t4.create=(E)=>{return new t4({typeName:c0.ZodUndefined,...m0(E)})};class Z4 extends a0{_parse(E){if(this._getType(E)!==Y.null){let y=this._getOrReturnCtx(E);return G(y,{code:w.invalid_type,expected:Y.null,received:y.parsedType}),S0}return S3(E.data)}}Z4.create=(E)=>{return new Z4({typeName:c0.ZodNull,...m0(E)})};class s8 extends a0{constructor(){super(...arguments);this._any=!0}_parse(E){return S3(E.data)}}s8.create=(E)=>{return new s8({typeName:c0.ZodAny,...m0(E)})};class n6 extends a0{constructor(){super(...arguments);this._unknown=!0}_parse(E){return S3(E.data)}}n6.create=(E)=>{return new n6({typeName:c0.ZodUnknown,...m0(E)})};class H3 extends a0{_parse(E){let y=this._getOrReturnCtx(E);return G(y,{code:w.invalid_type,expected:Y.never,received:y.parsedType}),S0}}H3.create=(E)=>{return new H3({typeName:c0.ZodNever,...m0(E)})};class b8 extends a0{_parse(E){if(this._getType(E)!==Y.undefined){let y=this._getOrReturnCtx(E);return G(y,{code:w.invalid_type,expected:Y.void,received:y.parsedType}),S0}return S3(E.data)}}b8.create=(E)=>{return new b8({typeName:c0.ZodVoid,...m0(E)})};class j3 extends a0{_parse(E){let{ctx:y,status:p}=this._processInputParams(E),h=this._def;if(y.parsedType!==Y.array)return G(y,{code:w.invalid_type,expected:Y.array,received:y.parsedType}),S0;if(h.exactLength!==null){let S=y.data.length>h.exactLength.value,c=y.data.length<h.exactLength.value;if(S||c)G(y,{code:S?w.too_big:w.too_small,minimum:c?h.exactLength.value:void 0,maximum:S?h.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:h.exactLength.message}),p.dirty()}if(h.minLength!==null){if(y.data.length<h.minLength.value)G(y,{code:w.too_small,minimum:h.minLength.value,type:"array",inclusive:!0,exact:!1,message:h.minLength.message}),p.dirty()}if(h.maxLength!==null){if(y.data.length>h.maxLength.value)G(y,{code:w.too_big,maximum:h.maxLength.value,type:"array",inclusive:!0,exact:!1,message:h.maxLength.message}),p.dirty()}if(y.common.async)return Promise.all([...y.data].map((S,c)=>{return h.type._parseAsync(new s3(y,S,y.path,c))})).then((S)=>{return p3.mergeArray(p,S)});let d=[...y.data].map((S,c)=>{return h.type._parseSync(new s3(y,S,y.path,c))});return p3.mergeArray(p,d)}get element(){return this._def.type}min(E,y){return new j3({...this._def,minLength:{value:E,message:$.toString(y)}})}max(E,y){return new j3({...this._def,maxLength:{value:E,message:$.toString(y)}})}length(E,y){return new j3({...this._def,exactLength:{value:E,message:$.toString(y)}})}nonempty(E){return this.min(1,E)}}j3.create=(E,y)=>{return new j3({type:E,minLength:null,maxLength:null,exactLength:null,typeName:c0.ZodArray,...m0(y)})};function F6(E){if(E instanceof _0){let y={};for(let p in E.shape){let h=E.shape[p];y[p]=q3.create(F6(h))}return new _0({...E._def,shape:()=>y})}else if(E instanceof j3)return new j3({...E._def,type:F6(E.element)});else if(E instanceof q3)return q3.create(F6(E.unwrap()));else if(E instanceof X3)return X3.create(F6(E.unwrap()));else if(E instanceof O3)return O3.create(E.items.map((y)=>F6(y)));else return E}class _0 extends a0{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let E=this._def.shape(),y=t0.objectKeys(E);return this._cached={shape:E,keys:y},this._cached}_parse(E){if(this._getType(E)!==Y.object){let n=this._getOrReturnCtx(E);return G(n,{code:w.invalid_type,expected:Y.object,received:n.parsedType}),S0}let{status:y,ctx:p}=this._processInputParams(E),{shape:h,keys:d}=this._getCached(),S=[];if(!(this._def.catchall instanceof H3&&this._def.unknownKeys==="strip")){for(let n in p.data)if(!d.includes(n))S.push(n)}let c=[];for(let n of d){let r=h[n],T=p.data[n];c.push({key:{status:"valid",value:n},value:r._parse(new s3(p,T,p.path,n)),alwaysSet:n in p.data})}if(this._def.catchall instanceof H3){let n=this._def.unknownKeys;if(n==="passthrough")for(let r of S)c.push({key:{status:"valid",value:r},value:{status:"valid",value:p.data[r]}});else if(n==="strict"){if(S.length>0)G(p,{code:w.unrecognized_keys,keys:S}),y.dirty()}else if(n==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let n=this._def.catchall;for(let r of S){let T=p.data[r];c.push({key:{status:"valid",value:r},value:n._parse(new s3(p,T,p.path,r)),alwaysSet:r in p.data})}}if(p.common.async)return Promise.resolve().then(async()=>{let n=[];for(let r of c){let T=await r.key,k=await r.value;n.push({key:T,value:k,alwaysSet:r.alwaysSet})}return n}).then((n)=>{return p3.mergeObjectSync(y,n)});else return p3.mergeObjectSync(y,c)}get shape(){return this._def.shape()}strict(E){return $.errToObj,new _0({...this._def,unknownKeys:"strict",...E!==void 0?{errorMap:(y,p)=>{let h=this._def.errorMap?.(y,p).message??p.defaultError;if(y.code==="unrecognized_keys")return{message:$.errToObj(E).message??h};return{message:h}}}:{}})}strip(){return new _0({...this._def,unknownKeys:"strip"})}passthrough(){return new _0({...this._def,unknownKeys:"passthrough"})}extend(E){return new _0({...this._def,shape:()=>({...this._def.shape(),...E})})}merge(E){return new _0({unknownKeys:E._def.unknownKeys,catchall:E._def.catchall,shape:()=>({...this._def.shape(),...E._def.shape()}),typeName:c0.ZodObject})}setKey(E,y){return this.augment({[E]:y})}catchall(E){return new _0({...this._def,catchall:E})}pick(E){let y={};for(let p of t0.objectKeys(E))if(E[p]&&this.shape[p])y[p]=this.shape[p];return new _0({...this._def,shape:()=>y})}omit(E){let y={};for(let p of t0.objectKeys(this.shape))if(!E[p])y[p]=this.shape[p];return new _0({...this._def,shape:()=>y})}deepPartial(){return F6(this)}partial(E){let y={};for(let p of t0.objectKeys(this.shape)){let h=this.shape[p];if(E&&!E[p])y[p]=h;else y[p]=h.optional()}return new _0({...this._def,shape:()=>y})}required(E){let y={};for(let p of t0.objectKeys(this.shape))if(E&&!E[p])y[p]=this.shape[p];else{let h=this.shape[p];while(h instanceof q3)h=h._def.innerType;y[p]=h}return new _0({...this._def,shape:()=>y})}keyof(){return bS(t0.objectKeys(this.shape))}}_0.create=(E,y)=>{return new _0({shape:()=>E,unknownKeys:"strip",catchall:H3.create(),typeName:c0.ZodObject,...m0(y)})};_0.strictCreate=(E,y)=>{return new _0({shape:()=>E,unknownKeys:"strict",catchall:H3.create(),typeName:c0.ZodObject,...m0(y)})};_0.lazycreate=(E,y)=>{return new _0({shape:E,unknownKeys:"strip",catchall:H3.create(),typeName:c0.ZodObject,...m0(y)})};class v4 extends a0{_parse(E){let{ctx:y}=this._processInputParams(E),p=this._def.options;function h(d){for(let c of d)if(c.result.status==="valid")return c.result;for(let c of d)if(c.result.status==="dirty")return y.common.issues.push(...c.ctx.common.issues),c.result;let S=d.map((c)=>new I3(c.ctx.common.issues));return G(y,{code:w.invalid_union,unionErrors:S}),S0}if(y.common.async)return Promise.all(p.map(async(d)=>{let S={...y,common:{...y.common,issues:[]},parent:null};return{result:await d._parseAsync({data:y.data,path:y.path,parent:S}),ctx:S}})).then(h);else{let d=void 0,S=[];for(let n of p){let r={...y,common:{...y.common,issues:[]},parent:null},T=n._parseSync({data:y.data,path:y.path,parent:r});if(T.status==="valid")return T;else if(T.status==="dirty"&&!d)d={result:T,ctx:r};if(r.common.issues.length)S.push(r.common.issues)}if(d)return y.common.issues.push(...d.ctx.common.issues),d.result;let c=S.map((n)=>new I3(n));return G(y,{code:w.invalid_union,unionErrors:c}),S0}}get options(){return this._def.options}}v4.create=(E,y)=>{return new v4({options:E,typeName:c0.ZodUnion,...m0(y)})};var B3=(E)=>{if(E instanceof A4)return B3(E.schema);else if(E instanceof _3)return B3(E.innerType());else if(E instanceof M4)return[E.value];else if(E instanceof r6)return E.options;else if(E instanceof s4)return t0.objectValues(E.enum);else if(E instanceof b4)return B3(E._def.innerType);else if(E instanceof t4)return[void 0];else if(E instanceof Z4)return[null];else if(E instanceof q3)return[void 0,...B3(E.unwrap())];else if(E instanceof X3)return[null,...B3(E.unwrap())];else if(E instanceof by)return B3(E.unwrap());else if(E instanceof g4)return B3(E.unwrap());else if(E instanceof e4)return B3(E._def.innerType);else return[]};class sy extends a0{_parse(E){let{ctx:y}=this._processInputParams(E);if(y.parsedType!==Y.object)return G(y,{code:w.invalid_type,expected:Y.object,received:y.parsedType}),S0;let p=this.discriminator,h=y.data[p],d=this.optionsMap.get(h);if(!d)return G(y,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[p]}),S0;if(y.common.async)return d._parseAsync({data:y.data,path:y.path,parent:y});else return d._parseSync({data:y.data,path:y.path,parent:y})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(E,y,p){let h=new Map;for(let d of y){let S=B3(d.shape[E]);if(!S.length)throw Error(`A discriminator value for key \`${E}\` could not be extracted from all schema options`);for(let c of S){if(h.has(c))throw Error(`Discriminator property ${String(E)} has duplicate value ${String(c)}`);h.set(c,d)}}return new sy({typeName:c0.ZodDiscriminatedUnion,discriminator:E,options:y,optionsMap:h,...m0(p)})}}function WE(E,y){let p=J3(E),h=J3(y);if(E===y)return{valid:!0,data:E};else if(p===Y.object&&h===Y.object){let d=t0.objectKeys(y),S=t0.objectKeys(E).filter((n)=>d.indexOf(n)!==-1),c={...E,...y};for(let n of S){let r=WE(E[n],y[n]);if(!r.valid)return{valid:!1};c[n]=r.data}return{valid:!0,data:c}}else if(p===Y.array&&h===Y.array){if(E.length!==y.length)return{valid:!1};let d=[];for(let S=0;S<E.length;S++){let c=E[S],n=y[S],r=WE(c,n);if(!r.valid)return{valid:!1};d.push(r.data)}return{valid:!0,data:d}}else if(p===Y.date&&h===Y.date&&+E===+y)return{valid:!0,data:E};else return{valid:!1}}class F4 extends a0{_parse(E){let{status:y,ctx:p}=this._processInputParams(E),h=(d,S)=>{if(Rh(d)||Rh(S))return S0;let c=WE(d.value,S.value);if(!c.valid)return G(p,{code:w.invalid_intersection_types}),S0;if(fh(d)||fh(S))y.dirty();return{status:y.value,value:c.data}};if(p.common.async)return Promise.all([this._def.left._parseAsync({data:p.data,path:p.path,parent:p}),this._def.right._parseAsync({data:p.data,path:p.path,parent:p})]).then(([d,S])=>h(d,S));else return h(this._def.left._parseSync({data:p.data,path:p.path,parent:p}),this._def.right._parseSync({data:p.data,path:p.path,parent:p}))}}F4.create=(E,y,p)=>{return new F4({left:E,right:y,typeName:c0.ZodIntersection,...m0(p)})};class O3 extends a0{_parse(E){let{status:y,ctx:p}=this._processInputParams(E);if(p.parsedType!==Y.array)return G(p,{code:w.invalid_type,expected:Y.array,received:p.parsedType}),S0;if(p.data.length<this._def.items.length)return G(p,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S0;if(!this._def.rest&&p.data.length>this._def.items.length)G(p,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y.dirty();let h=[...p.data].map((d,S)=>{let c=this._def.items[S]||this._def.rest;if(!c)return null;return c._parse(new s3(p,d,p.path,S))}).filter((d)=>!!d);if(p.common.async)return Promise.all(h).then((d)=>{return p3.mergeArray(y,d)});else return p3.mergeArray(y,h)}get items(){return this._def.items}rest(E){return new O3({...this._def,rest:E})}}O3.create=(E,y)=>{if(!Array.isArray(E))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new O3({items:E,typeName:c0.ZodTuple,rest:null,...m0(y)})};class e8 extends a0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(E){let{status:y,ctx:p}=this._processInputParams(E);if(p.parsedType!==Y.object)return G(p,{code:w.invalid_type,expected:Y.object,received:p.parsedType}),S0;let h=[],d=this._def.keyType,S=this._def.valueType;for(let c in p.data)h.push({key:d._parse(new s3(p,c,p.path,c)),value:S._parse(new s3(p,p.data[c],p.path,c)),alwaysSet:c in p.data});if(p.common.async)return p3.mergeObjectAsync(y,h);else return p3.mergeObjectSync(y,h)}get element(){return this._def.valueType}static create(E,y,p){if(y instanceof a0)return new e8({keyType:E,valueType:y,typeName:c0.ZodRecord,...m0(p)});return new e8({keyType:w3.create(),valueType:E,typeName:c0.ZodRecord,...m0(y)})}}class g8 extends a0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(E){let{status:y,ctx:p}=this._processInputParams(E);if(p.parsedType!==Y.map)return G(p,{code:w.invalid_type,expected:Y.map,received:p.parsedType}),S0;let h=this._def.keyType,d=this._def.valueType,S=[...p.data.entries()].map(([c,n],r)=>{return{key:h._parse(new s3(p,c,p.path,[r,"key"])),value:d._parse(new s3(p,n,p.path,[r,"value"]))}});if(p.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let n of S){let r=await n.key,T=await n.value;if(r.status==="aborted"||T.status==="aborted")return S0;if(r.status==="dirty"||T.status==="dirty")y.dirty();c.set(r.value,T.value)}return{status:y.value,value:c}})}else{let c=new Map;for(let n of S){let{key:r,value:T}=n;if(r.status==="aborted"||T.status==="aborted")return S0;if(r.status==="dirty"||T.status==="dirty")y.dirty();c.set(r.value,T.value)}return{status:y.value,value:c}}}}g8.create=(E,y,p)=>{return new g8({valueType:y,keyType:E,typeName:c0.ZodMap,...m0(p)})};class L6 extends a0{_parse(E){let{status:y,ctx:p}=this._processInputParams(E);if(p.parsedType!==Y.set)return G(p,{code:w.invalid_type,expected:Y.set,received:p.parsedType}),S0;let h=this._def;if(h.minSize!==null){if(p.data.size<h.minSize.value)G(p,{code:w.too_small,minimum:h.minSize.value,type:"set",inclusive:!0,exact:!1,message:h.minSize.message}),y.dirty()}if(h.maxSize!==null){if(p.data.size>h.maxSize.value)G(p,{code:w.too_big,maximum:h.maxSize.value,type:"set",inclusive:!0,exact:!1,message:h.maxSize.message}),y.dirty()}let d=this._def.valueType;function S(n){let r=new Set;for(let T of n){if(T.status==="aborted")return S0;if(T.status==="dirty")y.dirty();r.add(T.value)}return{status:y.value,value:r}}let c=[...p.data.values()].map((n,r)=>d._parse(new s3(p,n,p.path,r)));if(p.common.async)return Promise.all(c).then((n)=>S(n));else return S(c)}min(E,y){return new L6({...this._def,minSize:{value:E,message:$.toString(y)}})}max(E,y){return new L6({...this._def,maxSize:{value:E,message:$.toString(y)}})}size(E,y){return this.min(E,y).max(E,y)}nonempty(E){return this.min(1,E)}}L6.create=(E,y)=>{return new L6({valueType:E,minSize:null,maxSize:null,typeName:c0.ZodSet,...m0(y)})};class C4 extends a0{constructor(){super(...arguments);this.validate=this.implement}_parse(E){let{ctx:y}=this._processInputParams(E);if(y.parsedType!==Y.function)return G(y,{code:w.invalid_type,expected:Y.function,received:y.parsedType}),S0;function p(c,n){return GE({data:c,path:y.path,errorMaps:[y.common.contextualErrorMap,y.schemaErrorMap,UE(),I4].filter((r)=>!!r),issueData:{code:w.invalid_arguments,argumentsError:n}})}function h(c,n){return GE({data:c,path:y.path,errorMaps:[y.common.contextualErrorMap,y.schemaErrorMap,UE(),I4].filter((r)=>!!r),issueData:{code:w.invalid_return_type,returnTypeError:n}})}let d={errorMap:y.common.contextualErrorMap},S=y.data;if(this._def.returns instanceof j6){let c=this;return S3(async function(...n){let r=new I3([]),T=await c._def.args.parseAsync(n,d).catch((o)=>{throw r.addIssue(p(n,o)),r}),k=await Reflect.apply(S,this,T);return await c._def.returns._def.type.parseAsync(k,d).catch((o)=>{throw r.addIssue(h(k,o)),r})})}else{let c=this;return S3(function(...n){let r=c._def.args.safeParse(n,d);if(!r.success)throw new I3([p(n,r.error)]);let T=Reflect.apply(S,this,r.data),k=c._def.returns.safeParse(T,d);if(!k.success)throw new I3([h(T,k.error)]);return k.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...E){return new C4({...this._def,args:O3.create(E).rest(n6.create())})}returns(E){return new C4({...this._def,returns:E})}implement(E){return this.parse(E)}strictImplement(E){return this.parse(E)}static create(E,y,p){return new C4({args:E?E:O3.create([]).rest(n6.create()),returns:y||n6.create(),typeName:c0.ZodFunction,...m0(p)})}}class A4 extends a0{get schema(){return this._def.getter()}_parse(E){let{ctx:y}=this._processInputParams(E);return this._def.getter()._parse({data:y.data,path:y.path,parent:y})}}A4.create=(E,y)=>{return new A4({getter:E,typeName:c0.ZodLazy,...m0(y)})};class M4 extends a0{_parse(E){if(E.data!==this._def.value){let y=this._getOrReturnCtx(E);return G(y,{received:y.data,code:w.invalid_literal,expected:this._def.value}),S0}return{status:"valid",value:E.data}}get value(){return this._def.value}}M4.create=(E,y)=>{return new M4({value:E,typeName:c0.ZodLiteral,...m0(y)})};function bS(E,y){return new r6({values:E,typeName:c0.ZodEnum,...m0(y)})}class r6 extends a0{_parse(E){if(typeof E.data!=="string"){let y=this._getOrReturnCtx(E),p=this._def.values;return G(y,{expected:t0.joinValues(p),received:y.parsedType,code:w.invalid_type}),S0}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(E.data)){let y=this._getOrReturnCtx(E),p=this._def.values;return G(y,{received:y.data,code:w.invalid_enum_value,options:p}),S0}return S3(E.data)}get options(){return this._def.values}get enum(){let E={};for(let y of this._def.values)E[y]=y;return E}get Values(){let E={};for(let y of this._def.values)E[y]=y;return E}get Enum(){let E={};for(let y of this._def.values)E[y]=y;return E}extract(E,y=this._def){return r6.create(E,{...this._def,...y})}exclude(E,y=this._def){return r6.create(this.options.filter((p)=>!E.includes(p)),{...this._def,...y})}}r6.create=bS;class s4 extends a0{_parse(E){let y=t0.getValidEnumValues(this._def.values),p=this._getOrReturnCtx(E);if(p.parsedType!==Y.string&&p.parsedType!==Y.number){let h=t0.objectValues(y);return G(p,{expected:t0.joinValues(h),received:p.parsedType,code:w.invalid_type}),S0}if(!this._cache)this._cache=new Set(t0.getValidEnumValues(this._def.values));if(!this._cache.has(E.data)){let h=t0.objectValues(y);return G(p,{received:p.data,code:w.invalid_enum_value,options:h}),S0}return S3(E.data)}get enum(){return this._def.values}}s4.create=(E,y)=>{return new s4({values:E,typeName:c0.ZodNativeEnum,...m0(y)})};class j6 extends a0{unwrap(){return this._def.type}_parse(E){let{ctx:y}=this._processInputParams(E);if(y.parsedType!==Y.promise&&y.common.async===!1)return G(y,{code:w.invalid_type,expected:Y.promise,received:y.parsedType}),S0;let p=y.parsedType===Y.promise?y.data:Promise.resolve(y.data);return S3(p.then((h)=>{return this._def.type.parseAsync(h,{path:y.path,errorMap:y.common.contextualErrorMap})}))}}j6.create=(E,y)=>{return new j6({type:E,typeName:c0.ZodPromise,...m0(y)})};class _3 extends a0{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===c0.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(E){let{status:y,ctx:p}=this._processInputParams(E),h=this._def.effect||null,d={addIssue:(S)=>{if(G(p,S),S.fatal)y.abort();else y.dirty()},get path(){return p.path}};if(d.addIssue=d.addIssue.bind(d),h.type==="preprocess"){let S=h.transform(p.data,d);if(p.common.async)return Promise.resolve(S).then(async(c)=>{if(y.value==="aborted")return S0;let n=await this._def.schema._parseAsync({data:c,path:p.path,parent:p});if(n.status==="aborted")return S0;if(n.status==="dirty")return u4(n.value);if(y.value==="dirty")return u4(n.value);return n});else{if(y.value==="aborted")return S0;let c=this._def.schema._parseSync({data:S,path:p.path,parent:p});if(c.status==="aborted")return S0;if(c.status==="dirty")return u4(c.value);if(y.value==="dirty")return u4(c.value);return c}}if(h.type==="refinement"){let S=(c)=>{let n=h.refinement(c,d);if(p.common.async)return Promise.resolve(n);if(n instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(p.common.async===!1){let c=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});if(c.status==="aborted")return S0;if(c.status==="dirty")y.dirty();return S(c.value),{status:y.value,value:c.value}}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then((c)=>{if(c.status==="aborted")return S0;if(c.status==="dirty")y.dirty();return S(c.value).then(()=>{return{status:y.value,value:c.value}})})}if(h.type==="transform")if(p.common.async===!1){let S=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});if(!g6(S))return S0;let c=h.transform(S.value,d);if(c instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:y.value,value:c}}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then((S)=>{if(!g6(S))return S0;return Promise.resolve(h.transform(S.value,d)).then((c)=>({status:y.value,value:c}))});t0.assertNever(h)}}_3.create=(E,y,p)=>{return new _3({schema:E,typeName:c0.ZodEffects,effect:y,...m0(p)})};_3.createWithPreprocess=(E,y,p)=>{return new _3({schema:y,effect:{type:"preprocess",transform:E},typeName:c0.ZodEffects,...m0(p)})};class q3 extends a0{_parse(E){if(this._getType(E)===Y.undefined)return S3(void 0);return this._def.innerType._parse(E)}unwrap(){return this._def.innerType}}q3.create=(E,y)=>{return new q3({innerType:E,typeName:c0.ZodOptional,...m0(y)})};class X3 extends a0{_parse(E){if(this._getType(E)===Y.null)return S3(null);return this._def.innerType._parse(E)}unwrap(){return this._def.innerType}}X3.create=(E,y)=>{return new X3({innerType:E,typeName:c0.ZodNullable,...m0(y)})};class b4 extends a0{_parse(E){let{ctx:y}=this._processInputParams(E),p=y.data;if(y.parsedType===Y.undefined)p=this._def.defaultValue();return this._def.innerType._parse({data:p,path:y.path,parent:y})}removeDefault(){return this._def.innerType}}b4.create=(E,y)=>{return new b4({innerType:E,typeName:c0.ZodDefault,defaultValue:typeof y.default==="function"?y.default:()=>y.default,...m0(y)})};class e4 extends a0{_parse(E){let{ctx:y}=this._processInputParams(E),p={...y,common:{...y.common,issues:[]}},h=this._def.innerType._parse({data:p.data,path:p.path,parent:{...p}});if(F8(h))return h.then((d)=>{return{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new I3(p.common.issues)},input:p.data})}});else return{status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new I3(p.common.issues)},input:p.data})}}removeCatch(){return this._def.innerType}}e4.create=(E,y)=>{return new e4({innerType:E,typeName:c0.ZodCatch,catchValue:typeof y.catch==="function"?y.catch:()=>y.catch,...m0(y)})};class l8 extends a0{_parse(E){if(this._getType(E)!==Y.nan){let y=this._getOrReturnCtx(E);return G(y,{code:w.invalid_type,expected:Y.nan,received:y.parsedType}),S0}return{status:"valid",value:E.data}}}l8.create=(E)=>{return new l8({typeName:c0.ZodNaN,...m0(E)})};var xi=Symbol("zod_brand");class by extends a0{_parse(E){let{ctx:y}=this._processInputParams(E),p=y.data;return this._def.type._parse({data:p,path:y.path,parent:y})}unwrap(){return this._def.type}}class EE extends a0{_parse(E){let{status:y,ctx:p}=this._processInputParams(E);if(p.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:p.data,path:p.path,parent:p});if(h.status==="aborted")return S0;if(h.status==="dirty")return y.dirty(),u4(h.value);else return this._def.out._parseAsync({data:h.value,path:p.path,parent:p})})();else{let h=this._def.in._parseSync({data:p.data,path:p.path,parent:p});if(h.status==="aborted")return S0;if(h.status==="dirty")return y.dirty(),{status:"dirty",value:h.value};else return this._def.out._parseSync({data:h.value,path:p.path,parent:p})}}static create(E,y){return new EE({in:E,out:y,typeName:c0.ZodPipeline})}}class g4 extends a0{_parse(E){let y=this._def.innerType._parse(E),p=(h)=>{if(g6(h))h.value=Object.freeze(h.value);return h};return F8(y)?y.then((h)=>p(h)):p(y)}unwrap(){return this._def.innerType}}g4.create=(E,y)=>{return new g4({innerType:E,typeName:c0.ZodReadonly,...m0(y)})};var Ii={object:_0.lazycreate},c0;(function(E){E.ZodString="ZodString",E.ZodNumber="ZodNumber",E.ZodNaN="ZodNaN",E.ZodBigInt="ZodBigInt",E.ZodBoolean="ZodBoolean",E.ZodDate="ZodDate",E.ZodSymbol="ZodSymbol",E.ZodUndefined="ZodUndefined",E.ZodNull="ZodNull",E.ZodAny="ZodAny",E.ZodUnknown="ZodUnknown",E.ZodNever="ZodNever",E.ZodVoid="ZodVoid",E.ZodArray="ZodArray",E.ZodObject="ZodObject",E.ZodUnion="ZodUnion",E.ZodDiscriminatedUnion="ZodDiscriminatedUnion",E.ZodIntersection="ZodIntersection",E.ZodTuple="ZodTuple",E.ZodRecord="ZodRecord",E.ZodMap="ZodMap",E.ZodSet="ZodSet",E.ZodFunction="ZodFunction",E.ZodLazy="ZodLazy",E.ZodLiteral="ZodLiteral",E.ZodEnum="ZodEnum",E.ZodEffects="ZodEffects",E.ZodNativeEnum="ZodNativeEnum",E.ZodOptional="ZodOptional",E.ZodNullable="ZodNullable",E.ZodDefault="ZodDefault",E.ZodCatch="ZodCatch",E.ZodPromise="ZodPromise",E.ZodBranded="ZodBranded",E.ZodPipeline="ZodPipeline",E.ZodReadonly="ZodReadonly"})(c0||(c0={}));var ii=w3.create,ti=l6.create,Zi=l8.create,vi=P6.create,Fi=A8.create,Ai=i4.create,Mi=M8.create,si=t4.create,bi=Z4.create,ei=s8.create,gi=n6.create,li=H3.create,Pi=b8.create,Li=j3.create,ji=_0.create,qi=_0.strictCreate,_i=v4.create,Di=sy.create,Vi=F4.create,Bi=O3.create,Ni=e8.create,wi=g8.create,Ki=L6.create,Hi=C4.create,Oi=A4.create,Ui=M4.create,Gi=r6.create,Wi=s4.create,zi=j6.create,Qi=_3.create,Ji=q3.create,Yi=X3.create,Xi=_3.createWithPreprocess,$i=EE.create,eS={};f6(eS,{version:()=>wc,util:()=>x0,treeifyError:()=>KS,toJSONSchema:()=>qn,toDotPath:()=>HS,safeParseAsync:()=>Ny,safeParse:()=>Vy,registry:()=>dd,regexes:()=>wy,prettifyError:()=>OS,parseAsync:()=>q8,parse:()=>j8,locales:()=>yd,isValidJWT:()=>R9,isValidBase64URL:()=>r9,isValidBase64:()=>Gy,globalRegistry:()=>c6,globalConfig:()=>P8,function:()=>jn,formatError:()=>jy,flattenError:()=>Ly,config:()=>h3,clone:()=>g3,_xid:()=>kd,_void:()=>xn,_uuidv7:()=>nd,_uuidv6:()=>cd,_uuidv4:()=>Sd,_uuid:()=>hd,_url:()=>rd,_uppercase:()=>sd,_unknown:()=>V8,_union:()=>aC,_undefined:()=>kn,_ulid:()=>ud,_uint64:()=>fn,_uint32:()=>cn,_tuple:()=>bn,_trim:()=>Ld,_transform:()=>FC,_toUpperCase:()=>qd,_toLowerCase:()=>jd,_templateLiteral:()=>LC,_symbol:()=>un,_success:()=>eC,_stringbool:()=>Pn,_stringFormat:()=>Ln,_string:()=>W9,_startsWith:()=>ed,_size:()=>Fd,_set:()=>iC,_safeParseAsync:()=>By,_safeParse:()=>Dy,_regex:()=>Ad,_refine:()=>ln,_record:()=>xC,_readonly:()=>PC,_property:()=>sn,_promise:()=>qC,_positive:()=>vn,_pipe:()=>lC,_parseAsync:()=>_y,_parse:()=>qy,_overwrite:()=>C6,_optional:()=>AC,_number:()=>En,_nullable:()=>MC,_null:()=>an,_normalize:()=>Pd,_nonpositive:()=>An,_nonoptional:()=>bC,_nonnegative:()=>Mn,_never:()=>on,_negative:()=>Fn,_nativeEnum:()=>ZC,_nanoid:()=>md,_nan:()=>Zn,_multipleOf:()=>L4,_minSize:()=>j4,_minLength:()=>_6,_min:()=>m3,_mime:()=>ld,_maxSize:()=>nE,_maxLength:()=>rE,_max:()=>M3,_map:()=>IC,_lte:()=>M3,_lt:()=>m6,_lowercase:()=>Md,_literal:()=>vC,_length:()=>TE,_lazy:()=>jC,_ksuid:()=>ad,_jwt:()=>vd,_isoTime:()=>X9,_isoDuration:()=>$9,_isoDateTime:()=>J9,_isoDate:()=>Y9,_ipv6:()=>od,_ipv4:()=>Cd,_intersection:()=>oC,_int64:()=>Rn,_int32:()=>Sn,_int:()=>dn,_includes:()=>bd,_guid:()=>D8,_gte:()=>m3,_gt:()=>R6,_float64:()=>hn,_float32:()=>pn,_file:()=>en,_enum:()=>tC,_endsWith:()=>gd,_emoji:()=>Td,_email:()=>pd,_e164:()=>Zd,_discriminatedUnion:()=>CC,_default:()=>sC,_date:()=>In,_custom:()=>gn,_cuid2:()=>fd,_cuid:()=>Rd,_coercedString:()=>z9,_coercedNumber:()=>yn,_coercedDate:()=>tn,_coercedBoolean:()=>rn,_coercedBigint:()=>mn,_cidrv6:()=>Id,_cidrv4:()=>xd,_catch:()=>gC,_boolean:()=>nn,_bigint:()=>Tn,_base64url:()=>td,_base64:()=>id,_array:()=>_d,_any:()=>Cn,TimePrecision:()=>Q9,NEVER:()=>gS,JSONSchemaGenerator:()=>B8,JSONSchema:()=>_C,Doc:()=>Uy,$output:()=>U9,$input:()=>G9,$constructor:()=>e,$brand:()=>lS,$ZodXID:()=>Yc,$ZodVoid:()=>t9,$ZodUnknown:()=>_8,$ZodUnion:()=>Xy,$ZodUndefined:()=>o9,$ZodUUID:()=>Hc,$ZodURL:()=>Uc,$ZodULID:()=>Jc,$ZodType:()=>T0,$ZodTuple:()=>SE,$ZodTransform:()=>$y,$ZodTemplateLiteral:()=>N9,$ZodSymbol:()=>C9,$ZodSuccess:()=>_9,$ZodStringFormat:()=>M0,$ZodString:()=>N4,$ZodSet:()=>s9,$ZodRegistry:()=>cE,$ZodRecord:()=>A9,$ZodRealError:()=>V4,$ZodReadonly:()=>B9,$ZodPromise:()=>w9,$ZodPrefault:()=>j9,$ZodPipe:()=>Ed,$ZodOptional:()=>l9,$ZodObject:()=>Yy,$ZodNumberFormat:()=>k9,$ZodNumber:()=>Wy,$ZodNullable:()=>P9,$ZodNull:()=>x9,$ZodNonOptional:()=>q9,$ZodNever:()=>i9,$ZodNanoID:()=>Wc,$ZodNaN:()=>V9,$ZodMap:()=>M9,$ZodLiteral:()=>e9,$ZodLazy:()=>K9,$ZodKSUID:()=>Xc,$ZodJWT:()=>f9,$ZodIntersection:()=>F9,$ZodISOTime:()=>y9,$ZodISODuration:()=>d9,$ZodISODateTime:()=>$c,$ZodISODate:()=>E9,$ZodIPv6:()=>h9,$ZodIPv4:()=>p9,$ZodGUID:()=>Kc,$ZodFunction:()=>Dd,$ZodFile:()=>g9,$ZodError:()=>Py,$ZodEnum:()=>b9,$ZodEmoji:()=>Gc,$ZodEmail:()=>Oc,$ZodE164:()=>m9,$ZodDiscriminatedUnion:()=>v9,$ZodDefault:()=>L9,$ZodDate:()=>Z9,$ZodCustomStringFormat:()=>u9,$ZodCustom:()=>H9,$ZodCheckUpperCase:()=>jc,$ZodCheckStringFormat:()=>B4,$ZodCheckStartsWith:()=>_c,$ZodCheckSizeEquals:()=>bc,$ZodCheckRegex:()=>Pc,$ZodCheckProperty:()=>Vc,$ZodCheckOverwrite:()=>Nc,$ZodCheckNumberFormat:()=>Fc,$ZodCheckMultipleOf:()=>vc,$ZodCheckMinSize:()=>sc,$ZodCheckMinLength:()=>gc,$ZodCheckMimeType:()=>Bc,$ZodCheckMaxSize:()=>Mc,$ZodCheckMaxLength:()=>ec,$ZodCheckLowerCase:()=>Lc,$ZodCheckLessThan:()=>Hy,$ZodCheckLengthEquals:()=>lc,$ZodCheckIncludes:()=>qc,$ZodCheckGreaterThan:()=>Oy,$ZodCheckEndsWith:()=>Dc,$ZodCheckBigIntFormat:()=>Ac,$ZodCheck:()=>V0,$ZodCatch:()=>D9,$ZodCUID2:()=>Qc,$ZodCUID:()=>zc,$ZodCIDRv6:()=>c9,$ZodCIDRv4:()=>S9,$ZodBoolean:()=>zy,$ZodBigIntFormat:()=>a9,$ZodBigInt:()=>Qy,$ZodBase64URL:()=>T9,$ZodBase64:()=>n9,$ZodAsyncError:()=>T6,$ZodArray:()=>Jy,$ZodAny:()=>I9});var gS=Object.freeze({status:"aborted"});function e(E,y,p){function h(n,r){var T;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(T=n._zod).traits??(T.traits=new Set),n._zod.traits.add(E),y(n,r);for(let k in c.prototype)if(!(k in n))Object.defineProperty(n,k,{value:c.prototype[k].bind(n)});n._zod.constr=c,n._zod.def=r}let d=p?.Parent??Object;class S extends d{}Object.defineProperty(S,"name",{value:E});function c(n){var r;let T=p?.Parent?new S:this;h(T,n),(r=T._zod).deferred??(r.deferred=[]);for(let k of T._zod.deferred)k();return T}return Object.defineProperty(c,"init",{value:h}),Object.defineProperty(c,Symbol.hasInstance,{value:(n)=>{if(p?.Parent&&n instanceof p.Parent)return!0;return n?._zod?.traits?.has(E)}}),Object.defineProperty(c,"name",{value:E}),c}var lS=Symbol("zod_brand");class T6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var P8={};function h3(E){if(E)Object.assign(P8,E);return P8}var x0={};f6(x0,{unwrapMessage:()=>k4,stringifyPrimitive:()=>R0,required:()=>lk,randomString:()=>Zk,propertyKeyTypes:()=>L8,promiseAllObject:()=>tk,primitiveTypes:()=>qS,prefixIssues:()=>x3,pick:()=>Mk,partial:()=>gk,optionalKeys:()=>_S,omit:()=>sk,numKeys:()=>vk,nullish:()=>k6,normalizeParams:()=>H,merge:()=>ek,jsonStringifyReplacer:()=>PS,joinValues:()=>U,issue:()=>BS,isPlainObject:()=>P4,isObject:()=>l4,getSizableOrigin:()=>pE,getParsedType:()=>Fk,getLengthableOrigin:()=>hE,getEnumValues:()=>ey,getElementAtPath:()=>ik,floatSafeRemainder:()=>LS,finalizeIssue:()=>b3,extend:()=>bk,escapeRegex:()=>a6,esc:()=>A6,defineLazy:()=>v0,createTransparentProxy:()=>Ak,clone:()=>g3,cleanRegex:()=>dE,cleanEnum:()=>Pk,captureStackTrace:()=>ly,cached:()=>yE,assignProp:()=>gy,assertNotEqual:()=>Ck,assertNever:()=>xk,assertIs:()=>ok,assertEqual:()=>ak,assert:()=>Ik,allowsEval:()=>jS,aborted:()=>e6,NUMBER_FORMAT_RANGES:()=>DS,Class:()=>NS,BIGINT_FORMAT_RANGES:()=>VS});function ak(E){return E}function Ck(E){return E}function ok(E){}function xk(E){throw Error()}function Ik(E){}function ey(E){let y=Object.values(E).filter((p)=>typeof p==="number");return Object.entries(E).filter(([p,h])=>y.indexOf(+p)===-1).map(([p,h])=>h)}function U(E,y="|"){return E.map((p)=>R0(p)).join(y)}function PS(E,y){if(typeof y==="bigint")return y.toString();return y}function yE(E){return{get value(){{let y=E();return Object.defineProperty(this,"value",{value:y}),y}throw Error("cached value already set")}}}function k6(E){return E===null||E===void 0}function dE(E){let y=E.startsWith("^")?1:0,p=E.endsWith("$")?E.length-1:E.length;return E.slice(y,p)}function LS(E,y){let p=(E.toString().split(".")[1]||"").length,h=(y.toString().split(".")[1]||"").length,d=p>h?p:h,S=Number.parseInt(E.toFixed(d).replace(".","")),c=Number.parseInt(y.toFixed(d).replace(".",""));return S%c/10**d}function v0(E,y,p){Object.defineProperty(E,y,{get(){{let h=p();return E[y]=h,h}throw Error("cached value already set")},set(h){Object.defineProperty(E,y,{value:h})},configurable:!0})}function gy(E,y,p){Object.defineProperty(E,y,{value:p,writable:!0,enumerable:!0,configurable:!0})}function ik(E,y){if(!y)return E;return y.reduce((p,h)=>p?.[h],E)}function tk(E){let y=Object.keys(E),p=y.map((h)=>E[h]);return Promise.all(p).then((h)=>{let d={};for(let S=0;S<y.length;S++)d[y[S]]=h[S];return d})}function Zk(E=10){let y="";for(let p=0;p<E;p++)y+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return y}function A6(E){return JSON.stringify(E)}var ly=Error.captureStackTrace?Error.captureStackTrace:(...E)=>{};function l4(E){return typeof E==="object"&&E!==null&&!Array.isArray(E)}var jS=yE(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(E){return!1}});function P4(E){if(l4(E)===!1)return!1;let y=E.constructor;if(y===void 0)return!0;let p=y.prototype;if(l4(p)===!1)return!1;if(Object.prototype.hasOwnProperty.call(p,"isPrototypeOf")===!1)return!1;return!0}function vk(E){let y=0;for(let p in E)if(Object.prototype.hasOwnProperty.call(E,p))y++;return y}var Fk=(E)=>{let y=typeof E;switch(y){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(E)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(E))return"array";if(E===null)return"null";if(E.then&&typeof E.then==="function"&&E.catch&&typeof E.catch==="function")return"promise";if(typeof Map<"u"&&E instanceof Map)return"map";if(typeof Set<"u"&&E instanceof Set)return"set";if(typeof Date<"u"&&E instanceof Date)return"date";if(typeof File<"u"&&E instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${y}`)}},L8=new Set(["string","number","symbol"]),qS=new Set(["string","number","bigint","boolean","symbol","undefined"]);function a6(E){return E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g3(E,y,p){let h=new E._zod.constr(y??E._zod.def);if(!y||p?.parent)h._zod.parent=E;return h}function H(E){let y=E;if(!y)return{};if(typeof y==="string")return{error:()=>y};if(y?.message!==void 0){if(y?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");y.error=y.message}if(delete y.message,typeof y.error==="string")return{...y,error:()=>y.error};return y}function Ak(E){let y;return new Proxy({},{get(p,h,d){return y??(y=E()),Reflect.get(y,h,d)},set(p,h,d,S){return y??(y=E()),Reflect.set(y,h,d,S)},has(p,h){return y??(y=E()),Reflect.has(y,h)},deleteProperty(p,h){return y??(y=E()),Reflect.deleteProperty(y,h)},ownKeys(p){return y??(y=E()),Reflect.ownKeys(y)},getOwnPropertyDescriptor(p,h){return y??(y=E()),Reflect.getOwnPropertyDescriptor(y,h)},defineProperty(p,h,d){return y??(y=E()),Reflect.defineProperty(y,h,d)}})}function R0(E){if(typeof E==="bigint")return E.toString()+"n";if(typeof E==="string")return`"${E}"`;return`${E}`}function _S(E){return Object.keys(E).filter((y)=>{return E[y]._zod.optin==="optional"&&E[y]._zod.optout==="optional"})}var DS={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},VS={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Mk(E,y){let p={},h=E._zod.def;for(let d in y){if(!(d in h.shape))throw Error(`Unrecognized key: "${d}"`);if(!y[d])continue;p[d]=h.shape[d]}return g3(E,{...E._zod.def,shape:p,checks:[]})}function sk(E,y){let p={...E._zod.def.shape},h=E._zod.def;for(let d in y){if(!(d in h.shape))throw Error(`Unrecognized key: "${d}"`);if(!y[d])continue;delete p[d]}return g3(E,{...E._zod.def,shape:p,checks:[]})}function bk(E,y){if(!P4(y))throw Error("Invalid input to extend: expected a plain object");let p={...E._zod.def,get shape(){let h={...E._zod.def.shape,...y};return gy(this,"shape",h),h},checks:[]};return g3(E,p)}function ek(E,y){return g3(E,{...E._zod.def,get shape(){let p={...E._zod.def.shape,...y._zod.def.shape};return gy(this,"shape",p),p},catchall:y._zod.def.catchall,checks:[]})}function gk(E,y,p){let h=y._zod.def.shape,d={...h};if(p)for(let S in p){if(!(S in h))throw Error(`Unrecognized key: "${S}"`);if(!p[S])continue;d[S]=E?new E({type:"optional",innerType:h[S]}):h[S]}else for(let S in h)d[S]=E?new E({type:"optional",innerType:h[S]}):h[S];return g3(y,{...y._zod.def,shape:d,checks:[]})}function lk(E,y,p){let h=y._zod.def.shape,d={...h};if(p)for(let S in p){if(!(S in d))throw Error(`Unrecognized key: "${S}"`);if(!p[S])continue;d[S]=new E({type:"nonoptional",innerType:h[S]})}else for(let S in h)d[S]=new E({type:"nonoptional",innerType:h[S]});return g3(y,{...y._zod.def,shape:d,checks:[]})}function e6(E,y=0){for(let p=y;p<E.issues.length;p++)if(E.issues[p]?.continue!==!0)return!0;return!1}function x3(E,y){return y.map((p)=>{var h;return(h=p).path??(h.path=[]),p.path.unshift(E),p})}function k4(E){return typeof E==="string"?E:E?.message}function b3(E,y,p){let h={...E,path:E.path??[]};if(!E.message){let d=k4(E.inst?._zod.def?.error?.(E))??k4(y?.error?.(E))??k4(p.customError?.(E))??k4(p.localeError?.(E))??"Invalid input";h.message=d}if(delete h.inst,delete h.continue,!y?.reportInput)delete h.input;return h}function pE(E){if(E instanceof Set)return"set";if(E instanceof Map)return"map";if(E instanceof File)return"file";return"unknown"}function hE(E){if(Array.isArray(E))return"array";if(typeof E==="string")return"string";return"unknown"}function BS(...E){let[y,p,h]=E;if(typeof y==="string")return{message:y,code:"custom",input:p,inst:h};return{...y}}function Pk(E){return Object.entries(E).filter(([y,p])=>{return Number.isNaN(Number.parseInt(y,10))}).map((y)=>y[1])}class NS{constructor(...E){}}var wS=(E,y)=>{E.name="$ZodError",Object.defineProperty(E,"_zod",{value:E._zod,enumerable:!1}),Object.defineProperty(E,"issues",{value:y,enumerable:!1}),Object.defineProperty(E,"message",{get(){return JSON.stringify(y,PS,2)},enumerable:!0})},Py=e("$ZodError",wS),V4=e("$ZodError",wS,{Parent:Error});function Ly(E,y=(p)=>p.message){let p={},h=[];for(let d of E.issues)if(d.path.length>0)p[d.path[0]]=p[d.path[0]]||[],p[d.path[0]].push(y(d));else h.push(y(d));return{formErrors:h,fieldErrors:p}}function jy(E,y){let p=y||function(S){return S.message},h={_errors:[]},d=(S)=>{for(let c of S.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((n)=>d({issues:n}));else if(c.code==="invalid_key")d({issues:c.issues});else if(c.code==="invalid_element")d({issues:c.issues});else if(c.path.length===0)h._errors.push(p(c));else{let n=h,r=0;while(r<c.path.length){let T=c.path[r];if(r!==c.path.length-1)n[T]=n[T]||{_errors:[]};else n[T]=n[T]||{_errors:[]},n[T]._errors.push(p(c));n=n[T],r++}}};return d(E),h}function KS(E,y){let p=y||function(S){return S.message},h={errors:[]},d=(S,c=[])=>{var n,r;for(let T of S.issues)if(T.code==="invalid_union"&&T.errors.length)T.errors.map((k)=>d({issues:k},T.path));else if(T.code==="invalid_key")d({issues:T.issues},T.path);else if(T.code==="invalid_element")d({issues:T.issues},T.path);else{let k=[...c,...T.path];if(k.length===0){h.errors.push(p(T));continue}let o=h,u=0;while(u<k.length){let i=k[u],v=u===k.length-1;if(typeof i==="string")o.properties??(o.properties={}),(n=o.properties)[i]??(n[i]={errors:[]}),o=o.properties[i];else o.items??(o.items=[]),(r=o.items)[i]??(r[i]={errors:[]}),o=o.items[i];if(v)o.errors.push(p(T));u++}}};return d(E),h}function HS(E){let y=[];for(let p of E)if(typeof p==="number")y.push(`[${p}]`);else if(typeof p==="symbol")y.push(`[${JSON.stringify(String(p))}]`);else if(/[^\w$]/.test(p))y.push(`[${JSON.stringify(p)}]`);else{if(y.length)y.push(".");y.push(p)}return y.join("")}function OS(E){let y=[],p=[...E.issues].sort((h,d)=>h.path.length-d.path.length);for(let h of p)if(y.push(`✖ ${h.message}`),h.path?.length)y.push(` → at ${HS(h.path)}`);return y.join(`
58
- `)}var qy=(E)=>(y,p,h,d)=>{let S=h?Object.assign(h,{async:!1}):{async:!1},c=y._zod.run({value:p,issues:[]},S);if(c instanceof Promise)throw new T6;if(c.issues.length){let n=new(d?.Err??E)(c.issues.map((r)=>b3(r,S,h3())));throw ly(n,d?.callee),n}return c.value},j8=qy(V4),_y=(E)=>async(y,p,h,d)=>{let S=h?Object.assign(h,{async:!0}):{async:!0},c=y._zod.run({value:p,issues:[]},S);if(c instanceof Promise)c=await c;if(c.issues.length){let n=new(d?.Err??E)(c.issues.map((r)=>b3(r,S,h3())));throw ly(n,d?.callee),n}return c.value},q8=_y(V4),Dy=(E)=>(y,p,h)=>{let d=h?{...h,async:!1}:{async:!1},S=y._zod.run({value:p,issues:[]},d);if(S instanceof Promise)throw new T6;return S.issues.length?{success:!1,error:new(E??Py)(S.issues.map((c)=>b3(c,d,h3())))}:{success:!0,data:S.value}},Vy=Dy(V4),By=(E)=>async(y,p,h)=>{let d=h?Object.assign(h,{async:!0}):{async:!0},S=y._zod.run({value:p,issues:[]},d);if(S instanceof Promise)S=await S;return S.issues.length?{success:!1,error:new E(S.issues.map((c)=>b3(c,d,h3())))}:{success:!0,data:S.value}},Ny=By(V4),wy={};f6(wy,{xid:()=>zS,uuid7:()=>_k,uuid6:()=>qk,uuid4:()=>jk,uuid:()=>q6,uppercase:()=>tc,unicodeEmail:()=>Bk,undefined:()=>Ic,ulid:()=>WS,time:()=>Rc,string:()=>uc,rfc5322Email:()=>Vk,number:()=>Cc,null:()=>xc,nanoid:()=>JS,lowercase:()=>ic,ksuid:()=>QS,ipv6:()=>dc,ipv4:()=>yc,integer:()=>ac,html5Email:()=>Dk,hostname:()=>cc,guid:()=>XS,extendedDuration:()=>Lk,emoji:()=>Ec,email:()=>$S,e164:()=>nc,duration:()=>YS,domain:()=>Kk,datetime:()=>fc,date:()=>Tc,cuid2:()=>GS,cuid:()=>US,cidrv6:()=>hc,cidrv4:()=>pc,browserEmail:()=>Nk,boolean:()=>oc,bigint:()=>kc,base64url:()=>Ky,base64:()=>Sc,_emoji:()=>wk});var US=/^[cC][^\s-]{8,}$/,GS=/^[0-9a-z]+$/,WS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zS=/^[0-9a-vA-V]{20}$/,QS=/^[A-Za-z0-9]{27}$/,JS=/^[a-zA-Z0-9_-]{21}$/,YS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Lk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,XS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,q6=(E)=>{if(!E)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${E}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},jk=q6(4),qk=q6(6),_k=q6(7),$S=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Dk=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Vk=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Bk=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Nk=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,wk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ec(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var yc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,pc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Sc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ky=/^[A-Za-z0-9_-]*$/,cc=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Kk=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,nc=/^\+(?:[0-9]){6,14}[0-9]$/,rc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Tc=new RegExp(`^${rc}$`);function mc(E){return typeof E.precision==="number"?E.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":E.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${E.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Rc(E){return new RegExp(`^${mc(E)}$`)}function fc(E){let y=mc({precision:E.precision}),p=["Z"];if(E.local)p.push("");if(E.offset)p.push("([+-]\\d{2}:\\d{2})");let h=`${y}(?:${p.join("|")})`;return new RegExp(`^${rc}T(?:${h})$`)}var uc=(E)=>{let y=E?`[\\s\\S]{${E?.minimum??0},${E?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${y}$`)},kc=/^\d+n?$/,ac=/^\d+$/,Cc=/^-?\d+(?:\.\d+)?/i,oc=/true|false/i,xc=/null/i,Ic=/undefined/i,ic=/^[^A-Z]*$/,tc=/^[^a-z]*$/,V0=e("$ZodCheck",(E,y)=>{var p;E._zod??(E._zod={}),E._zod.def=y,(p=E._zod).onattach??(p.onattach=[])}),Zc={number:"number",bigint:"bigint",object:"date"},Hy=e("$ZodCheckLessThan",(E,y)=>{V0.init(E,y);let p=Zc[typeof y.value];E._zod.onattach.push((h)=>{let d=h._zod.bag,S=(y.inclusive?d.maximum:d.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(y.value<S)if(y.inclusive)d.maximum=y.value;else d.exclusiveMaximum=y.value}),E._zod.check=(h)=>{if(y.inclusive?h.value<=y.value:h.value<y.value)return;h.issues.push({origin:p,code:"too_big",maximum:y.value,input:h.value,inclusive:y.inclusive,inst:E,continue:!y.abort})}}),Oy=e("$ZodCheckGreaterThan",(E,y)=>{V0.init(E,y);let p=Zc[typeof y.value];E._zod.onattach.push((h)=>{let d=h._zod.bag,S=(y.inclusive?d.minimum:d.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(y.value>S)if(y.inclusive)d.minimum=y.value;else d.exclusiveMinimum=y.value}),E._zod.check=(h)=>{if(y.inclusive?h.value>=y.value:h.value>y.value)return;h.issues.push({origin:p,code:"too_small",minimum:y.value,input:h.value,inclusive:y.inclusive,inst:E,continue:!y.abort})}}),vc=e("$ZodCheckMultipleOf",(E,y)=>{V0.init(E,y),E._zod.onattach.push((p)=>{var h;(h=p._zod.bag).multipleOf??(h.multipleOf=y.value)}),E._zod.check=(p)=>{if(typeof p.value!==typeof y.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof p.value==="bigint"?p.value%y.value===BigInt(0):LS(p.value,y.value)===0)return;p.issues.push({origin:typeof p.value,code:"not_multiple_of",divisor:y.value,input:p.value,inst:E,continue:!y.abort})}}),Fc=e("$ZodCheckNumberFormat",(E,y)=>{V0.init(E,y),y.format=y.format||"float64";let p=y.format?.includes("int"),h=p?"int":"number",[d,S]=DS[y.format];E._zod.onattach.push((c)=>{let n=c._zod.bag;if(n.format=y.format,n.minimum=d,n.maximum=S,p)n.pattern=ac}),E._zod.check=(c)=>{let n=c.value;if(p){if(!Number.isInteger(n)){c.issues.push({expected:h,format:y.format,code:"invalid_type",input:n,inst:E});return}if(!Number.isSafeInteger(n)){if(n>0)c.issues.push({input:n,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:E,origin:h,continue:!y.abort});else c.issues.push({input:n,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:E,origin:h,continue:!y.abort});return}}if(n<d)c.issues.push({origin:"number",input:n,code:"too_small",minimum:d,inclusive:!0,inst:E,continue:!y.abort});if(n>S)c.issues.push({origin:"number",input:n,code:"too_big",maximum:S,inst:E})}}),Ac=e("$ZodCheckBigIntFormat",(E,y)=>{V0.init(E,y);let[p,h]=VS[y.format];E._zod.onattach.push((d)=>{let S=d._zod.bag;S.format=y.format,S.minimum=p,S.maximum=h}),E._zod.check=(d)=>{let S=d.value;if(S<p)d.issues.push({origin:"bigint",input:S,code:"too_small",minimum:p,inclusive:!0,inst:E,continue:!y.abort});if(S>h)d.issues.push({origin:"bigint",input:S,code:"too_big",maximum:h,inst:E})}}),Mc=e("$ZodCheckMaxSize",(E,y)=>{V0.init(E,y),E._zod.when=(p)=>{let h=p.value;return!k6(h)&&h.size!==void 0},E._zod.onattach.push((p)=>{let h=p._zod.bag.maximum??Number.POSITIVE_INFINITY;if(y.maximum<h)p._zod.bag.maximum=y.maximum}),E._zod.check=(p)=>{let h=p.value;if(h.size<=y.maximum)return;p.issues.push({origin:pE(h),code:"too_big",maximum:y.maximum,input:h,inst:E,continue:!y.abort})}}),sc=e("$ZodCheckMinSize",(E,y)=>{V0.init(E,y),E._zod.when=(p)=>{let h=p.value;return!k6(h)&&h.size!==void 0},E._zod.onattach.push((p)=>{let h=p._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(y.minimum>h)p._zod.bag.minimum=y.minimum}),E._zod.check=(p)=>{let h=p.value;if(h.size>=y.minimum)return;p.issues.push({origin:pE(h),code:"too_small",minimum:y.minimum,input:h,inst:E,continue:!y.abort})}}),bc=e("$ZodCheckSizeEquals",(E,y)=>{V0.init(E,y),E._zod.when=(p)=>{let h=p.value;return!k6(h)&&h.size!==void 0},E._zod.onattach.push((p)=>{let h=p._zod.bag;h.minimum=y.size,h.maximum=y.size,h.size=y.size}),E._zod.check=(p)=>{let h=p.value,d=h.size;if(d===y.size)return;let S=d>y.size;p.issues.push({origin:pE(h),...S?{code:"too_big",maximum:y.size}:{code:"too_small",minimum:y.size},inclusive:!0,exact:!0,input:p.value,inst:E,continue:!y.abort})}}),ec=e("$ZodCheckMaxLength",(E,y)=>{V0.init(E,y),E._zod.when=(p)=>{let h=p.value;return!k6(h)&&h.length!==void 0},E._zod.onattach.push((p)=>{let h=p._zod.bag.maximum??Number.POSITIVE_INFINITY;if(y.maximum<h)p._zod.bag.maximum=y.maximum}),E._zod.check=(p)=>{let h=p.value;if(h.length<=y.maximum)return;let d=hE(h);p.issues.push({origin:d,code:"too_big",maximum:y.maximum,inclusive:!0,input:h,inst:E,continue:!y.abort})}}),gc=e("$ZodCheckMinLength",(E,y)=>{V0.init(E,y),E._zod.when=(p)=>{let h=p.value;return!k6(h)&&h.length!==void 0},E._zod.onattach.push((p)=>{let h=p._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(y.minimum>h)p._zod.bag.minimum=y.minimum}),E._zod.check=(p)=>{let h=p.value;if(h.length>=y.minimum)return;let d=hE(h);p.issues.push({origin:d,code:"too_small",minimum:y.minimum,inclusive:!0,input:h,inst:E,continue:!y.abort})}}),lc=e("$ZodCheckLengthEquals",(E,y)=>{V0.init(E,y),E._zod.when=(p)=>{let h=p.value;return!k6(h)&&h.length!==void 0},E._zod.onattach.push((p)=>{let h=p._zod.bag;h.minimum=y.length,h.maximum=y.length,h.length=y.length}),E._zod.check=(p)=>{let h=p.value,d=h.length;if(d===y.length)return;let S=hE(h),c=d>y.length;p.issues.push({origin:S,...c?{code:"too_big",maximum:y.length}:{code:"too_small",minimum:y.length},inclusive:!0,exact:!0,input:p.value,inst:E,continue:!y.abort})}}),B4=e("$ZodCheckStringFormat",(E,y)=>{var p,h;if(V0.init(E,y),E._zod.onattach.push((d)=>{let S=d._zod.bag;if(S.format=y.format,y.pattern)S.patterns??(S.patterns=new Set),S.patterns.add(y.pattern)}),y.pattern)(p=E._zod).check??(p.check=(d)=>{if(y.pattern.lastIndex=0,y.pattern.test(d.value))return;d.issues.push({origin:"string",code:"invalid_format",format:y.format,input:d.value,...y.pattern?{pattern:y.pattern.toString()}:{},inst:E,continue:!y.abort})});else(h=E._zod).check??(h.check=()=>{})}),Pc=e("$ZodCheckRegex",(E,y)=>{B4.init(E,y),E._zod.check=(p)=>{if(y.pattern.lastIndex=0,y.pattern.test(p.value))return;p.issues.push({origin:"string",code:"invalid_format",format:"regex",input:p.value,pattern:y.pattern.toString(),inst:E,continue:!y.abort})}}),Lc=e("$ZodCheckLowerCase",(E,y)=>{y.pattern??(y.pattern=ic),B4.init(E,y)}),jc=e("$ZodCheckUpperCase",(E,y)=>{y.pattern??(y.pattern=tc),B4.init(E,y)}),qc=e("$ZodCheckIncludes",(E,y)=>{V0.init(E,y);let p=a6(y.includes),h=new RegExp(typeof y.position==="number"?`^.{${y.position}}${p}`:p);y.pattern=h,E._zod.onattach.push((d)=>{let S=d._zod.bag;S.patterns??(S.patterns=new Set),S.patterns.add(h)}),E._zod.check=(d)=>{if(d.value.includes(y.includes,y.position))return;d.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:y.includes,input:d.value,inst:E,continue:!y.abort})}}),_c=e("$ZodCheckStartsWith",(E,y)=>{V0.init(E,y);let p=new RegExp(`^${a6(y.prefix)}.*`);y.pattern??(y.pattern=p),E._zod.onattach.push((h)=>{let d=h._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(p)}),E._zod.check=(h)=>{if(h.value.startsWith(y.prefix))return;h.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:y.prefix,input:h.value,inst:E,continue:!y.abort})}}),Dc=e("$ZodCheckEndsWith",(E,y)=>{V0.init(E,y);let p=new RegExp(`.*${a6(y.suffix)}$`);y.pattern??(y.pattern=p),E._zod.onattach.push((h)=>{let d=h._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(p)}),E._zod.check=(h)=>{if(h.value.endsWith(y.suffix))return;h.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:y.suffix,input:h.value,inst:E,continue:!y.abort})}});function kh(E,y,p){if(E.issues.length)y.issues.push(...x3(p,E.issues))}var Vc=e("$ZodCheckProperty",(E,y)=>{V0.init(E,y),E._zod.check=(p)=>{let h=y.schema._zod.run({value:p.value[y.property],issues:[]},{});if(h instanceof Promise)return h.then((d)=>kh(d,p,y.property));kh(h,p,y.property);return}}),Bc=e("$ZodCheckMimeType",(E,y)=>{V0.init(E,y);let p=new Set(y.mime);E._zod.onattach.push((h)=>{h._zod.bag.mime=y.mime}),E._zod.check=(h)=>{if(p.has(h.value.type))return;h.issues.push({code:"invalid_value",values:y.mime,input:h.value.type,inst:E})}}),Nc=e("$ZodCheckOverwrite",(E,y)=>{V0.init(E,y),E._zod.check=(p)=>{p.value=y.tx(p.value)}});class Uy{constructor(E=[]){if(this.content=[],this.indent=0,this)this.args=E}indented(E){this.indent+=1,E(this),this.indent-=1}write(E){if(typeof E==="function"){E(this,{execution:"sync"}),E(this,{execution:"async"});return}let y=E.split(`
59
- `).filter((d)=>d),p=Math.min(...y.map((d)=>d.length-d.trimStart().length)),h=y.map((d)=>d.slice(p)).map((d)=>" ".repeat(this.indent*2)+d);for(let d of h)this.content.push(d)}compile(){let E=Function,y=this?.args,p=[...(this?.content??[""]).map((h)=>` ${h}`)];return new E(...y,p.join(`
60
- `))}}var wc={major:4,minor:0,patch:0},T0=e("$ZodType",(E,y)=>{var p;E??(E={}),E._zod.def=y,E._zod.bag=E._zod.bag||{},E._zod.version=wc;let h=[...E._zod.def.checks??[]];if(E._zod.traits.has("$ZodCheck"))h.unshift(E);for(let d of h)for(let S of d._zod.onattach)S(E);if(h.length===0)(p=E._zod).deferred??(p.deferred=[]),E._zod.deferred?.push(()=>{E._zod.run=E._zod.parse});else{let d=(S,c,n)=>{let r=e6(S),T;for(let k of c){if(k._zod.when){if(!k._zod.when(S))continue}else if(r)continue;let o=S.issues.length,u=k._zod.check(S);if(u instanceof Promise&&n?.async===!1)throw new T6;if(T||u instanceof Promise)T=(T??Promise.resolve()).then(async()=>{if(await u,S.issues.length===o)return;if(!r)r=e6(S,o)});else{if(S.issues.length===o)continue;if(!r)r=e6(S,o)}}if(T)return T.then(()=>{return S});return S};E._zod.run=(S,c)=>{let n=E._zod.parse(S,c);if(n instanceof Promise){if(c.async===!1)throw new T6;return n.then((r)=>d(r,h,c))}return d(n,h,c)}}E["~standard"]={validate:(d)=>{try{let S=Vy(E,d);return S.success?{value:S.data}:{issues:S.error?.issues}}catch(S){return Ny(E,d).then((c)=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}}),N4=e("$ZodString",(E,y)=>{T0.init(E,y),E._zod.pattern=[...E?._zod.bag?.patterns??[]].pop()??uc(E._zod.bag),E._zod.parse=(p,h)=>{if(y.coerce)try{p.value=String(p.value)}catch(d){}if(typeof p.value==="string")return p;return p.issues.push({expected:"string",code:"invalid_type",input:p.value,inst:E}),p}}),M0=e("$ZodStringFormat",(E,y)=>{B4.init(E,y),N4.init(E,y)}),Kc=e("$ZodGUID",(E,y)=>{y.pattern??(y.pattern=XS),M0.init(E,y)}),Hc=e("$ZodUUID",(E,y)=>{if(y.version){let p={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[y.version];if(p===void 0)throw Error(`Invalid UUID version: "${y.version}"`);y.pattern??(y.pattern=q6(p))}else y.pattern??(y.pattern=q6());M0.init(E,y)}),Oc=e("$ZodEmail",(E,y)=>{y.pattern??(y.pattern=$S),M0.init(E,y)}),Uc=e("$ZodURL",(E,y)=>{M0.init(E,y),E._zod.check=(p)=>{try{let h=p.value,d=new URL(h),S=d.href;if(y.hostname){if(y.hostname.lastIndex=0,!y.hostname.test(d.hostname))p.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:cc.source,input:p.value,inst:E,continue:!y.abort})}if(y.protocol){if(y.protocol.lastIndex=0,!y.protocol.test(d.protocol.endsWith(":")?d.protocol.slice(0,-1):d.protocol))p.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:y.protocol.source,input:p.value,inst:E,continue:!y.abort})}if(!h.endsWith("/")&&S.endsWith("/"))p.value=S.slice(0,-1);else p.value=S;return}catch(h){p.issues.push({code:"invalid_format",format:"url",input:p.value,inst:E,continue:!y.abort})}}}),Gc=e("$ZodEmoji",(E,y)=>{y.pattern??(y.pattern=Ec()),M0.init(E,y)}),Wc=e("$ZodNanoID",(E,y)=>{y.pattern??(y.pattern=JS),M0.init(E,y)}),zc=e("$ZodCUID",(E,y)=>{y.pattern??(y.pattern=US),M0.init(E,y)}),Qc=e("$ZodCUID2",(E,y)=>{y.pattern??(y.pattern=GS),M0.init(E,y)}),Jc=e("$ZodULID",(E,y)=>{y.pattern??(y.pattern=WS),M0.init(E,y)}),Yc=e("$ZodXID",(E,y)=>{y.pattern??(y.pattern=zS),M0.init(E,y)}),Xc=e("$ZodKSUID",(E,y)=>{y.pattern??(y.pattern=QS),M0.init(E,y)}),$c=e("$ZodISODateTime",(E,y)=>{y.pattern??(y.pattern=fc(y)),M0.init(E,y)}),E9=e("$ZodISODate",(E,y)=>{y.pattern??(y.pattern=Tc),M0.init(E,y)}),y9=e("$ZodISOTime",(E,y)=>{y.pattern??(y.pattern=Rc(y)),M0.init(E,y)}),d9=e("$ZodISODuration",(E,y)=>{y.pattern??(y.pattern=YS),M0.init(E,y)}),p9=e("$ZodIPv4",(E,y)=>{y.pattern??(y.pattern=yc),M0.init(E,y),E._zod.onattach.push((p)=>{let h=p._zod.bag;h.format="ipv4"})}),h9=e("$ZodIPv6",(E,y)=>{y.pattern??(y.pattern=dc),M0.init(E,y),E._zod.onattach.push((p)=>{let h=p._zod.bag;h.format="ipv6"}),E._zod.check=(p)=>{try{new URL(`http://[${p.value}]`)}catch{p.issues.push({code:"invalid_format",format:"ipv6",input:p.value,inst:E,continue:!y.abort})}}}),S9=e("$ZodCIDRv4",(E,y)=>{y.pattern??(y.pattern=pc),M0.init(E,y)}),c9=e("$ZodCIDRv6",(E,y)=>{y.pattern??(y.pattern=hc),M0.init(E,y),E._zod.check=(p)=>{let[h,d]=p.value.split("/");try{if(!d)throw Error();let S=Number(d);if(`${S}`!==d)throw Error();if(S<0||S>128)throw Error();new URL(`http://[${h}]`)}catch{p.issues.push({code:"invalid_format",format:"cidrv6",input:p.value,inst:E,continue:!y.abort})}}});function Gy(E){if(E==="")return!0;if(E.length%4!==0)return!1;try{return atob(E),!0}catch{return!1}}var n9=e("$ZodBase64",(E,y)=>{y.pattern??(y.pattern=Sc),M0.init(E,y),E._zod.onattach.push((p)=>{p._zod.bag.contentEncoding="base64"}),E._zod.check=(p)=>{if(Gy(p.value))return;p.issues.push({code:"invalid_format",format:"base64",input:p.value,inst:E,continue:!y.abort})}});function r9(E){if(!Ky.test(E))return!1;let y=E.replace(/[-_]/g,(h)=>h==="-"?"+":"/"),p=y.padEnd(Math.ceil(y.length/4)*4,"=");return Gy(p)}var T9=e("$ZodBase64URL",(E,y)=>{y.pattern??(y.pattern=Ky),M0.init(E,y),E._zod.onattach.push((p)=>{p._zod.bag.contentEncoding="base64url"}),E._zod.check=(p)=>{if(r9(p.value))return;p.issues.push({code:"invalid_format",format:"base64url",input:p.value,inst:E,continue:!y.abort})}}),m9=e("$ZodE164",(E,y)=>{y.pattern??(y.pattern=nc),M0.init(E,y)});function R9(E,y=null){try{let p=E.split(".");if(p.length!==3)return!1;let[h]=p;if(!h)return!1;let d=JSON.parse(atob(h));if("typ"in d&&d?.typ!=="JWT")return!1;if(!d.alg)return!1;if(y&&(!("alg"in d)||d.alg!==y))return!1;return!0}catch{return!1}}var f9=e("$ZodJWT",(E,y)=>{M0.init(E,y),E._zod.check=(p)=>{if(R9(p.value,y.alg))return;p.issues.push({code:"invalid_format",format:"jwt",input:p.value,inst:E,continue:!y.abort})}}),u9=e("$ZodCustomStringFormat",(E,y)=>{M0.init(E,y),E._zod.check=(p)=>{if(y.fn(p.value))return;p.issues.push({code:"invalid_format",format:y.format,input:p.value,inst:E,continue:!y.abort})}}),Wy=e("$ZodNumber",(E,y)=>{T0.init(E,y),E._zod.pattern=E._zod.bag.pattern??Cc,E._zod.parse=(p,h)=>{if(y.coerce)try{p.value=Number(p.value)}catch(c){}let d=p.value;if(typeof d==="number"&&!Number.isNaN(d)&&Number.isFinite(d))return p;let S=typeof d==="number"?Number.isNaN(d)?"NaN":!Number.isFinite(d)?"Infinity":void 0:void 0;return p.issues.push({expected:"number",code:"invalid_type",input:d,inst:E,...S?{received:S}:{}}),p}}),k9=e("$ZodNumber",(E,y)=>{Fc.init(E,y),Wy.init(E,y)}),zy=e("$ZodBoolean",(E,y)=>{T0.init(E,y),E._zod.pattern=oc,E._zod.parse=(p,h)=>{if(y.coerce)try{p.value=Boolean(p.value)}catch(S){}let d=p.value;if(typeof d==="boolean")return p;return p.issues.push({expected:"boolean",code:"invalid_type",input:d,inst:E}),p}}),Qy=e("$ZodBigInt",(E,y)=>{T0.init(E,y),E._zod.pattern=kc,E._zod.parse=(p,h)=>{if(y.coerce)try{p.value=BigInt(p.value)}catch(d){}if(typeof p.value==="bigint")return p;return p.issues.push({expected:"bigint",code:"invalid_type",input:p.value,inst:E}),p}}),a9=e("$ZodBigInt",(E,y)=>{Ac.init(E,y),Qy.init(E,y)}),C9=e("$ZodSymbol",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=p.value;if(typeof d==="symbol")return p;return p.issues.push({expected:"symbol",code:"invalid_type",input:d,inst:E}),p}}),o9=e("$ZodUndefined",(E,y)=>{T0.init(E,y),E._zod.pattern=Ic,E._zod.values=new Set([void 0]),E._zod.optin="optional",E._zod.optout="optional",E._zod.parse=(p,h)=>{let d=p.value;if(typeof d>"u")return p;return p.issues.push({expected:"undefined",code:"invalid_type",input:d,inst:E}),p}}),x9=e("$ZodNull",(E,y)=>{T0.init(E,y),E._zod.pattern=xc,E._zod.values=new Set([null]),E._zod.parse=(p,h)=>{let d=p.value;if(d===null)return p;return p.issues.push({expected:"null",code:"invalid_type",input:d,inst:E}),p}}),I9=e("$ZodAny",(E,y)=>{T0.init(E,y),E._zod.parse=(p)=>p}),_8=e("$ZodUnknown",(E,y)=>{T0.init(E,y),E._zod.parse=(p)=>p}),i9=e("$ZodNever",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{return p.issues.push({expected:"never",code:"invalid_type",input:p.value,inst:E}),p}}),t9=e("$ZodVoid",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=p.value;if(typeof d>"u")return p;return p.issues.push({expected:"void",code:"invalid_type",input:d,inst:E}),p}}),Z9=e("$ZodDate",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{if(y.coerce)try{p.value=new Date(p.value)}catch(c){}let d=p.value,S=d instanceof Date;if(S&&!Number.isNaN(d.getTime()))return p;return p.issues.push({expected:"date",code:"invalid_type",input:d,...S?{received:"Invalid Date"}:{},inst:E}),p}});function ah(E,y,p){if(E.issues.length)y.issues.push(...x3(p,E.issues));y.value[p]=E.value}var Jy=e("$ZodArray",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=p.value;if(!Array.isArray(d))return p.issues.push({expected:"array",code:"invalid_type",input:d,inst:E}),p;p.value=Array(d.length);let S=[];for(let c=0;c<d.length;c++){let n=d[c],r=y.element._zod.run({value:n,issues:[]},h);if(r instanceof Promise)S.push(r.then((T)=>ah(T,p,c)));else ah(r,p,c)}if(S.length)return Promise.all(S).then(()=>p);return p}});function R8(E,y,p){if(E.issues.length)y.issues.push(...x3(p,E.issues));y.value[p]=E.value}function Ch(E,y,p,h){if(E.issues.length)if(h[p]===void 0)if(p in h)y.value[p]=void 0;else y.value[p]=E.value;else y.issues.push(...x3(p,E.issues));else if(E.value===void 0){if(p in h)y.value[p]=void 0}else y.value[p]=E.value}var Yy=e("$ZodObject",(E,y)=>{T0.init(E,y);let p=yE(()=>{let k=Object.keys(y.shape);for(let u of k)if(!(y.shape[u]instanceof T0))throw Error(`Invalid element at key "${u}": expected a Zod schema`);let o=_S(y.shape);return{shape:y.shape,keys:k,keySet:new Set(k),numKeys:k.length,optionalKeys:new Set(o)}});v0(E._zod,"propValues",()=>{let k=y.shape,o={};for(let u in k){let i=k[u]._zod;if(i.values){o[u]??(o[u]=new Set);for(let v of i.values)o[u].add(v)}}return o});let h=(k)=>{let o=new Uy(["shape","payload","ctx"]),u=p.value,i=(m)=>{let a=A6(m);return`shape[${a}]._zod.run({ value: input[${a}], issues: [] }, ctx)`};o.write("const input = payload.value;");let v=Object.create(null),F=0;for(let m of u.keys)v[m]=`key_${F++}`;o.write("const newResult = {}");for(let m of u.keys)if(u.optionalKeys.has(m)){let a=v[m];o.write(`const ${a} = ${i(m)};`);let R=A6(m);o.write(`
61
- if (${a}.issues.length) {
62
- if (input[${R}] === undefined) {
63
- if (${R} in input) {
64
- newResult[${R}] = undefined;
48
+ `);this.baseURL=a.baseURL,this.timeout=a.timeout??vn.DEFAULT_TIMEOUT,this.logger=a.logger??console;let n="warn";this.logLevel=n,this.logLevel=Ni(a.logLevel,"ClientOptions.logLevel",this)??Ni(cs("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??n,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??mp(),Q(this,Es,up,"f"),this._options=a,this.apiKey=typeof e==="string"?e:null,this.authToken=s}withOptions(t){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...t})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:e}){if(t.get("x-api-key")||t.get("authorization"))return;if(this.apiKey&&t.get("x-api-key"))return;if(e.has("x-api-key"))return;if(this.authToken&&t.get("authorization"))return;if(e.has("authorization"))return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(t){return kt([await this.apiKeyAuth(t),await this.bearerAuth(t)])}async apiKeyAuth(t){if(this.apiKey==null)return;return kt([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken==null)return;return kt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return Sp(t)}getUserAgent(){return`${this.constructor.name}/JS ${xe}`}defaultIdempotencyKey(){return`stainless-node-retry-${Qh()}`}makeStatusError(t,e,s,r){return $t.generate(t,e,s,r)}buildURL(t,e,s){let r=!M(this,Kr,"m",So).call(this)&&s||this.baseURL,a=np(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),n=this.defaultQuery(),i=Object.fromEntries(a.searchParams);if(!Li(n)||!Li(i))e={...i,...n,...e};if(typeof e==="object"&&e&&!Array.isArray(e))a.search=this.stringifyQuery(e);return a.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128000>600)throw new ht("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(t){}async prepareRequest(t,{url:e,options:s}){}get(t,e){return this.methodRequest("get",t,e)}post(t,e){return this.methodRequest("post",t,e)}patch(t,e){return this.methodRequest("patch",t,e)}put(t,e){return this.methodRequest("put",t,e)}delete(t,e){return this.methodRequest("delete",t,e)}methodRequest(t,e,s){return this.request(Promise.resolve(s).then((r)=>{return{method:t,path:e,...r}}))}request(t,e=null){return new Js(this,this.makeRequest(t,e,void 0))}async makeRequest(t,e,s){let r=await t,a=r.maxRetries??this.maxRetries;if(e==null)e=a;await this.prepareOptions(r);let{req:n,url:i,timeout:h}=await this.buildRequest(r,{retryCount:a-e});await this.prepareRequest(n,{url:i,options:r});let o="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),c=s===void 0?"":`, retryOf: ${s}`,m=Date.now();if(e0(this).debug(`[${o}] sending request`,re({retryOfRequestLogID:s,method:r.method,url:i,options:r,headers:n.headers})),r.signal?.aborted)throw new S0;let u=new AbortController,p=await this.fetchWithTimeout(i,n,h,u).catch(_r),k=Date.now();if(p instanceof globalThis.Error){let R=`retrying, ${e} attempts remaining`;if(r.signal?.aborted)throw new S0;let d=fa(p)||/timed? ?out/i.test(String(p)+("cause"in p?String(p.cause):""));if(e)return e0(this).info(`[${o}] connection ${d?"timed out":"failed"} - ${R}`),e0(this).debug(`[${o}] connection ${d?"timed out":"failed"} (${R})`,re({retryOfRequestLogID:s,url:i,durationMs:k-m,message:p.message})),this.retryRequest(r,e,s??o);if(e0(this).info(`[${o}] connection ${d?"timed out":"failed"} - error; no more retries left`),e0(this).debug(`[${o}] connection ${d?"timed out":"failed"} (error; no more retries left)`,re({retryOfRequestLogID:s,url:i,durationMs:k-m,message:p.message})),d)throw new en;throw new _a({cause:p})}let C=[...p.headers.entries()].filter(([R])=>R==="request-id").map(([R,d])=>", "+R+": "+JSON.stringify(d)).join(""),I=`[${o}${c}${C}] ${n.method} ${i} ${p.ok?"succeeded":"failed"} with status ${p.status} in ${k-m}ms`;if(!p.ok){let R=await this.shouldRetry(p);if(e&&R){let T=`retrying, ${e} attempts remaining`;return await Ep(p.body),e0(this).info(`${I} - ${T}`),e0(this).debug(`[${o}] response error (${T})`,re({retryOfRequestLogID:s,url:p.url,status:p.status,headers:p.headers,durationMs:k-m})),this.retryRequest(r,e,s??o,p.headers)}let d=R?"error; no more retries left":"error; not retryable";e0(this).info(`${I} - ${d}`);let E=await p.text().catch((T)=>_r(T).message),y=Jh(E),l=y?void 0:E;throw e0(this).debug(`[${o}] response error (${d})`,re({retryOfRequestLogID:s,url:p.url,status:p.status,headers:p.headers,message:l,durationMs:Date.now()-m})),this.makeStatusError(p.status,y,l,p.headers)}return e0(this).info(I),e0(this).debug(`[${o}] response start`,re({retryOfRequestLogID:s,url:p.url,status:p.status,headers:p.headers,durationMs:k-m})),{response:p,options:r,controller:u,requestLogID:o,retryOfRequestLogID:s,startTime:m}}getAPIList(t,e,s){return this.requestAPIList(e,s&&"then"in s?s.then((r)=>({method:"get",path:t,...r})):{method:"get",path:t,...s})}requestAPIList(t,e){let s=this.makeRequest(e,null,void 0);return new ao(this,s,t)}async fetchWithTimeout(t,e,s,r){let{signal:a,method:n,...i}=e||{},h=this._makeAbort(r);if(a)a.addEventListener("abort",h,{once:!0});let o=setTimeout(h,s),c=globalThis.ReadableStream&&i.body instanceof globalThis.ReadableStream||typeof i.body==="object"&&i.body!==null&&Symbol.asyncIterator in i.body,m={signal:r.signal,...c?{duplex:"half"}:{},method:"GET",...i};if(n)m.method=n.toUpperCase();try{return await this.fetch.call(void 0,t,m)}finally{clearTimeout(o)}}async shouldRetry(t){let e=t.headers.get("x-should-retry");if(e==="true")return!0;if(e==="false")return!1;if(t.status===408)return!0;if(t.status===409)return!0;if(t.status===429)return!0;if(t.status>=500)return!0;return!1}async retryRequest(t,e,s,r){let a,n=r?.get("retry-after-ms");if(n){let h=parseFloat(n);if(!Number.isNaN(h))a=h}let i=r?.get("retry-after");if(i&&!a){let h=parseFloat(i);if(!Number.isNaN(h))a=h*1000;else a=Date.parse(i)-Date.now()}if(a===void 0){let h=t.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(e,h)}return await op(a),this.makeRequest(t,e-1,s)}calculateDefaultRetryTimeoutMillis(t,e){let s=e-t,r=Math.min(0.5*Math.pow(2,s),8),a=1-Math.random()*0.25;return r*a*1000}calculateNonstreamingTimeout(t,e){if(3600000*t/128000>600000||e!=null&&t>e)throw new ht("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(t,{retryCount:e=0}={}){let s={...t},{method:r,path:a,query:n,defaultBaseURL:i}=s,h=this.buildURL(a,n,i);if("timeout"in s)hp("timeout",s.timeout);s.timeout=s.timeout??this.timeout;let{bodyHeaders:o,body:c}=this.buildBody({options:s}),m=await this.buildHeaders({options:t,method:r,bodyHeaders:o,retryCount:e});return{req:{method:r,headers:m,...s.signal&&{signal:s.signal},...globalThis.ReadableStream&&c instanceof globalThis.ReadableStream&&{duplex:"half"},...c&&{body:c},...this.fetchOptions??{},...s.fetchOptions??{}},url:h,timeout:s.timeout}}async buildHeaders({options:t,method:e,bodyHeaders:s,retryCount:r}){let a={};if(this.idempotencyHeader&&e!=="get"){if(!t.idempotencyKey)t.idempotencyKey=this.defaultIdempotencyKey();a[this.idempotencyHeader]=t.idempotencyKey}let n=kt([a,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1000))}:{},...pp(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,s,t.headers]);return this.validateHeaders(n),n.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:e}}){if(!t)return{bodyHeaders:void 0,body:void 0};let s=kt([e]);if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t==="string"&&s.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:t};else if(typeof t==="object"&&((Symbol.asyncIterator in t)||(Symbol.iterator in t)&&("next"in t)&&typeof t.next==="function"))return{bodyHeaders:void 0,body:Xh(t)};else if(typeof t==="object"&&s.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)};else return M(this,Es,"f").call(this,{body:t,headers:s})}}vn=Dt,Es=new WeakMap,Kr=new WeakSet,So=function(){return this.baseURL!=="https://api.anthropic.com"};Dt.Anthropic=vn;Dt.HUMAN_PROMPT=Up;Dt.AI_PROMPT=Gp;Dt.DEFAULT_TIMEOUT=600000;Dt.AnthropicError=ht;Dt.APIError=$t;Dt.APIConnectionError=_a;Dt.APIConnectionTimeoutError=en;Dt.APIUserAbortError=S0;Dt.NotFoundError=nn;Dt.ConflictError=hn;Dt.RateLimitError=cn;Dt.BadRequestError=an;Dt.AuthenticationError=sn;Dt.InternalServerError=dn;Dt.PermissionDeniedError=rn;Dt.UnprocessableEntityError=on;Dt.toFile=Fp;class Da extends Dt{constructor(){super(...arguments);this.completions=new xn(this),this.messages=new $s(this),this.models=new In(this),this.beta=new pe(this)}}Da.Completions=xn;Da.Messages=$s;Da.Models=In;Da.Beta=pe;function Wp(t){return t instanceof Error?t:Error(String(t))}function us(t){return t instanceof Error?t.message:String(t)}function Ss(t){if(t&&typeof t==="object"&&"code"in t&&typeof t.code==="string")return t.code;return}function zp(t){return Ss(t)==="ENOENT"}var Ae,Re=null;function Xp(){if(Re)return Re;if(!ne(process.env.DEBUG_CLAUDE_AGENT_SDK))return Ae=null,Re=Promise.resolve(),Re;let t=hh(zh(),"debug");return Ae=hh(t,`sdk-${Qp()}.txt`),process.stderr.write(`SDK debug logs: ${Ae}
49
+ `),Re=Yp(t,{recursive:!0}).then(()=>{}).catch(()=>{}),Re}function E0(t){if(Ae===null)return;let e=`${new Date().toISOString()} ${t}
50
+ `;Xp().then(()=>{if(Ae)Jp(Ae,e).catch(()=>{})})}function To(){let t=new Set;return{subscribe(e){return t.add(e),()=>{t.delete(e)}},emit(...e){for(let s of t)s(...e)},clear(){t.clear()}}}function tm(){let t="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof oh==="function"){let e=$p();try{t=oh(e).normalize("NFC")}catch{t=e.normalize("NFC")}}return{originalCwd:t,projectRoot:t,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,turnHookDurationMs:0,turnToolDurationMs:0,turnClassifierDurationMs:0,turnToolCount:0,turnHookCount:0,turnClassifierCount:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:t,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,kairosActive:!1,strictToolResultPairing:!1,memoryToggledOff:!1,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,flagSettingsInline:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:fo(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionCronTasks:[],sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,mainThreadAgentType:void 0,isRemoteMode:!1,...!1,directConnectServerUrl:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,afkModeHeaderLatched:null,fastModeHeaderLatched:null,cacheEditingHeaderLatched:null,thinkingClearLatched:null,promptId:null,lastMainRequestId:void 0,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var em=tm();function am(){return em.sessionId}var sm=To(),o9=sm.subscribe,rm=To(),c9=rm.subscribe;function cm({writeFn:t,flushIntervalMs:e=1000,maxBufferSize:s=100,maxBufferBytes:r=1/0,immediateMode:a=!1}){let n=[],i=0,h=null,o=null;function c(){if(h)clearTimeout(h),h=null}function m(){if(o)t(o.join("")),o=null;if(n.length===0)return;t(n.join("")),n=[],i=0,c()}function u(){if(!h)h=setTimeout(m,e)}function p(){if(o){o.push(...n),n=[],i=0,c();return}let k=n;n=[],i=0,c(),o=k,setImmediate(()=>{let C=o;if(o=null,C)t(C.join(""))})}return{write(k){if(a){t(k);return}if(n.push(k),i+=k.length,u(),n.length>=s||i>=r)p()},flush:m,dispose(){m()}}}var ch=new Set;function dm(t){return ch.add(t),()=>ch.delete(t)}var ym=te((t)=>{if(!t||t.trim()==="")return null;let e=t.split(",").map((n)=>n.trim()).filter(Boolean);if(e.length===0)return null;let s=e.some((n)=>n.startsWith("!")),r=e.some((n)=>!n.startsWith("!"));if(s&&r)return null;let a=e.map((n)=>n.replace(/^!/,"").toLowerCase());return{include:s?[]:a,exclude:s?a:[],isExclusive:s}});function lm(t){let e=[],s=t.match(/^MCP server ["']([^"']+)["']/);if(s&&s[1])e.push("mcp"),e.push(s[1].toLowerCase());else{let n=t.match(/^([^:[]+):/);if(n&&n[1])e.push(n[1].trim().toLowerCase())}let r=t.match(/^\[([^\]]+)]/);if(r&&r[1])e.push(r[1].trim().toLowerCase());if(t.toLowerCase().includes("1p event:"))e.push("1p");let a=t.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(a&&a[1]){let n=a[1].trim().toLowerCase();if(n.length<30&&!n.includes(" "))e.push(n)}return Array.from(new Set(e))}function pm(t,e){if(!e)return!0;if(t.length===0)return!1;if(e.isExclusive)return!t.some((s)=>e.exclude.includes(s));else return t.some((s)=>e.include.includes(s))}function mm(t,e){if(!e)return!0;let s=lm(t);return pm(s,e)}var Cm={cwd(){return process.cwd()},existsSync(t){let e=[];try{let a=Lt(e,qt`fs.existsSync(${t})`,0);return ot.existsSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},async stat(t){return Rm(t)},async readdir(t){return Sm(t,{withFileTypes:!0})},async unlink(t){return xm(t)},async rmdir(t){return Tm(t)},async rm(t,e){return km(t,e)},async mkdir(t,e){try{await Em(t,{recursive:!0,...e})}catch(s){if(Ss(s)!=="EEXIST")throw s}},async readFile(t,e){return dh(t,{encoding:e.encoding})},async rename(t,e){return fm(t,e)},statSync(t){let e=[];try{let a=Lt(e,qt`fs.statSync(${t})`,0);return ot.statSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},lstatSync(t){let e=[];try{let a=Lt(e,qt`fs.lstatSync(${t})`,0);return ot.lstatSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},readFileSync(t,e){let s=[];try{let n=Lt(s,qt`fs.readFileSync(${t})`,0);return ot.readFileSync(t,{encoding:e.encoding})}catch(n){var r=n,a=1}finally{jt(s,r,a)}},readFileBytesSync(t){let e=[];try{let a=Lt(e,qt`fs.readFileBytesSync(${t})`,0);return ot.readFileSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},readSync(t,e){let s=[];try{let n=Lt(s,qt`fs.readSync(${t}, ${e.length} bytes)`,0),i=void 0;try{i=ot.openSync(t,"r");let h=Buffer.alloc(e.length),o=ot.readSync(i,h,0,e.length,0);return{buffer:h,bytesRead:o}}finally{if(i)ot.closeSync(i)}}catch(n){var r=n,a=1}finally{jt(s,r,a)}},appendFileSync(t,e,s){let r=[];try{let i=Lt(r,qt`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(s?.mode!==void 0)try{let h=ot.openSync(t,"ax",s.mode);try{ot.appendFileSync(h,e)}finally{ot.closeSync(h)}return}catch(h){if(Ss(h)!=="EEXIST")throw h}ot.appendFileSync(t,e)}catch(i){var a=i,n=1}finally{jt(r,a,n)}},copyFileSync(t,e){let s=[];try{let n=Lt(s,qt`fs.copyFileSync(${t} → ${e})`,0);ot.copyFileSync(t,e)}catch(n){var r=n,a=1}finally{jt(s,r,a)}},unlinkSync(t){let e=[];try{let a=Lt(e,qt`fs.unlinkSync(${t})`,0);ot.unlinkSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},renameSync(t,e){let s=[];try{let n=Lt(s,qt`fs.renameSync(${t} → ${e})`,0);ot.renameSync(t,e)}catch(n){var r=n,a=1}finally{jt(s,r,a)}},linkSync(t,e){let s=[];try{let n=Lt(s,qt`fs.linkSync(${t} → ${e})`,0);ot.linkSync(t,e)}catch(n){var r=n,a=1}finally{jt(s,r,a)}},symlinkSync(t,e,s){let r=[];try{let i=Lt(r,qt`fs.symlinkSync(${t} → ${e})`,0);ot.symlinkSync(t,e,s)}catch(i){var a=i,n=1}finally{jt(r,a,n)}},readlinkSync(t){let e=[];try{let a=Lt(e,qt`fs.readlinkSync(${t})`,0);return ot.readlinkSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},realpathSync(t){let e=[];try{let a=Lt(e,qt`fs.realpathSync(${t})`,0);return ot.realpathSync(t).normalize("NFC")}catch(a){var s=a,r=1}finally{jt(e,s,r)}},mkdirSync(t,e){let s=[];try{let n=Lt(s,qt`fs.mkdirSync(${t})`,0),i={recursive:!0};if(e?.mode!==void 0)i.mode=e.mode;try{ot.mkdirSync(t,i)}catch(h){if(Ss(h)!=="EEXIST")throw h}}catch(n){var r=n,a=1}finally{jt(s,r,a)}},readdirSync(t){let e=[];try{let a=Lt(e,qt`fs.readdirSync(${t})`,0);return ot.readdirSync(t,{withFileTypes:!0})}catch(a){var s=a,r=1}finally{jt(e,s,r)}},readdirStringSync(t){let e=[];try{let a=Lt(e,qt`fs.readdirStringSync(${t})`,0);return ot.readdirSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},isDirEmptySync(t){let e=[];try{let a=Lt(e,qt`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(a){var s=a,r=1}finally{jt(e,s,r)}},rmdirSync(t){let e=[];try{let a=Lt(e,qt`fs.rmdirSync(${t})`,0);ot.rmdirSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},rmSync(t,e){let s=[];try{let n=Lt(s,qt`fs.rmSync(${t})`,0);ot.rmSync(t,e)}catch(n){var r=n,a=1}finally{jt(s,r,a)}},createWriteStream(t){return ot.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return dh(t);let s=await um(t,"r");try{let{size:r}=await s.stat(),a=Math.min(r,e),n=Buffer.allocUnsafe(a),i=0;while(i<a){let{bytesRead:h}=await s.read(n,i,a-i,i);if(h===0)break;i+=h}return i<a?n.subarray(0,i):n}finally{await s.close()}}},Im=Cm;function yh(){return Im}function vm(t,e){if(t.destroyed)return;t.write(e)}function gm(t){vm(process.stderr,t)}var Hr={verbose:0,debug:1,info:2,warn:3,error:4},bm=te(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();if(t&&Object.hasOwn(Hr,t))return t;return"debug"}),Am=!1,Or=te(()=>{return Am||ne(process.env.DEBUG)||ne(process.env.DEBUG_SDK)||process.argv.includes("--debug")||process.argv.includes("-d")||xo()||process.argv.some((t)=>t.startsWith("--debug="))||Co()!==null}),Zm=te(()=>{let t=process.argv.find((s)=>s.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return ym(e)}),xo=te(()=>{return process.argv.includes("--debug-to-stderr")||process.argv.includes("-d2e")}),Co=te(()=>{for(let t=0;t<process.argv.length;t++){let e=process.argv[t];if(e.startsWith("--debug-file="))return e.substring(13);if(e==="--debug-file"&&t+1<process.argv.length)return process.argv[t+1]}return null});function Fm(t){if(!Or())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=Zm();return mm(t,e)}var Mm=!1,ds=null,Lr=Promise.resolve();async function Pm(t,e,s,r){if(t)await im(e,{recursive:!0}).catch(()=>{});await nm(s,r),vo()}function Lm(){}function jm(){if(!ds){let t=null;ds=cm({writeFn:(e)=>{let s=Io(),r=ko(s),a=t!==r;if(t=r,Or()){if(a)try{yh().mkdirSync(r)}catch{}yh().appendFileSync(s,e),vo();return}Lr=Lr.then(Pm.bind(null,a,r,s,e)).catch(Lm)},flushIntervalMs:1000,maxBufferSize:100,immediateMode:Or()}),dm(async()=>{ds?.dispose(),await Lr})}return ds}function v0(t,{level:e}={level:"debug"}){if(Hr[e]<Hr[bm()])return;if(!Fm(t))return;if(Mm&&t.includes(`
51
+ `))t=u0(t);let s=`${new Date().toISOString()} [${e.toUpperCase()}] ${t.trim()}
52
+ `;if(xo()){gm(s);return}jm().write(s)}function Io(){return Co()??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??Ro(zh(),"debug",`${am()}.txt`)}var vo=te(async()=>{try{let t=Io(),e=ko(t),s=Ro(e,"latest");await om(s).catch(()=>{}),await hm(t,s)}catch{}}),p9=(()=>{let t=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(t!==void 0){let e=Number(t);if(!Number.isNaN(e)&&e>=0)return e}return 1/0})(),qm={[Symbol.dispose](){}};function _m(){return qm}var qt=_m;function u0(t,e,s){let r=[];try{let i=Lt(r,qt`JSON.stringify(${t})`,0);return JSON.stringify(t,e,s)}catch(i){var a=i,n=1}finally{jt(r,a,n)}}var gn=(t,e)=>{let s=[];try{let n=Lt(s,qt`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(n){var r=n,a=1}finally{jt(s,r,a)}};function Dm(t){let e=t.trim();return e.startsWith("{")&&e.endsWith("}")}function Bm(t,e){let s={...t};if(e){let r=e.enabled===!0&&e.failIfUnavailable===void 0?{...e,failIfUnavailable:!0}:e,a=s.settings;if(a&&!Dm(a))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let n={sandbox:r};if(a)try{n={...gn(a),sandbox:r}}catch{}s.settings=u0(n)}return s}var Vm=2000;class go{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(t){this.options=t,this.abortController=t.abortController||Kh(),this.initialize()}getDefaultExecutable(){return Hh()?"bun":"node"}spawnLocalProcess(t){let{command:e,args:s,cwd:r,env:a,signal:n}=t,i=ne(a.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",h=u8(e,s,{cwd:r,stdio:["pipe","pipe",i],signal:n,env:a,windowsHide:!0});if(ne(a.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)h.stderr.on("data",(o)=>{let c=o.toString();if(E0(c),this.options.stderr)this.options.stderr(c)});return{stdin:h.stdin,stdout:h.stdout,get killed(){return h.killed},get exitCode(){return h.exitCode},kill:h.kill.bind(h),on:h.on.bind(h),once:h.once.bind(h),off:h.off.bind(h)}}initialize(){try{let{additionalDirectories:t=[],agent:e,betas:s,cwd:r,executable:a=this.getDefaultExecutable(),executableArgs:n=[],extraArgs:i={},pathToClaudeCodeExecutable:h,env:o={...process.env},thinkingConfig:c,maxTurns:m,maxBudgetUsd:u,taskBudget:p,model:k,fallbackModel:C,jsonSchema:I,permissionMode:R,allowDangerouslySkipPermissions:d,permissionPromptToolName:E,continueConversation:y,resume:l,settingSources:T,allowedTools:f=[],disallowedTools:x=[],tools:v,mcpServers:F,strictMcpConfig:B,canUseTool:_,includePartialMessages:N,plugins:O,sandbox:z}=this.options,K=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(c){switch(c.type){case"enabled":if(c.budgetTokens===void 0)K.push("--thinking","adaptive");else K.push("--max-thinking-tokens",c.budgetTokens.toString());break;case"disabled":K.push("--thinking","disabled");break;case"adaptive":K.push("--thinking","adaptive");break}if(c.type!=="disabled"&&c.display)K.push("--thinking-display",c.display)}if(this.options.effort)K.push("--effort",this.options.effort);if(m)K.push("--max-turns",m.toString());if(u!==void 0)K.push("--max-budget-usd",u.toString());if(p)K.push("--task-budget",p.total.toString());if(k)K.push("--model",k);if(e)K.push("--agent",e);if(s&&s.length>0)K.push("--betas",s.join(","));if(I)K.push("--json-schema",u0(I));if(this.options.debugFile)K.push("--debug-file",this.options.debugFile);else if(this.options.debug)K.push("--debug");if(ne(o.DEBUG_CLAUDE_AGENT_SDK))K.push("--debug-to-stderr");if(_){if(E)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");K.push("--permission-prompt-tool","stdio")}else if(E)K.push("--permission-prompt-tool",E);if(y)K.push("--continue");if(l)K.push("--resume",l);if(this.options.proactive)K.push("--proactive");if(this.options.assistant)K.push("--assistant");if(this.options.channels&&this.options.channels.length>0)K.push("--channels",...this.options.channels);if(f.length>0)K.push("--allowedTools",f.join(","));if(x.length>0)K.push("--disallowedTools",x.join(","));if(v!==void 0)if(Array.isArray(v))if(v.length===0)K.push("--tools","");else K.push("--tools",v.join(","));else K.push("--tools","default");if(F&&Object.keys(F).length>0)K.push("--mcp-config",u0({mcpServers:F}));if(T!==void 0)K.push(`--setting-sources=${T.join(",")}`);if(B)K.push("--strict-mcp-config");if(R)K.push("--permission-mode",R);if(d)K.push("--allow-dangerously-skip-permissions");if(C){if(k&&C===k)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");K.push("--fallback-model",C)}if(this.options.includeHookEvents)K.push("--include-hook-events");if(N)K.push("--include-partial-messages");for(let S of t)K.push("--add-dir",S);if(O&&O.length>0)for(let S of O)if(S.type==="local")K.push("--plugin-dir",S.path);else throw Error(`Unsupported plugin type: ${S.type}`);if(this.options.forkSession)K.push("--fork-session");if(this.options.resumeSessionAt)K.push("--resume-session-at",this.options.resumeSessionAt);if(this.options.sessionId)K.push("--session-id",this.options.sessionId);if(this.options.persistSession===!1)K.push("--no-session-persistence");let Mt={...i??{}};if(this.options.settings)Mt.settings=this.options.settings;let Ht=Bm(Mt,z);for(let[S,b]of Object.entries(Ht))if(b===null)K.push(`--${S}`);else K.push(`--${S}`,b);if(!o.CLAUDE_CODE_ENTRYPOINT)o.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(delete o.NODE_OPTIONS,ne(o.DEBUG_CLAUDE_AGENT_SDK))o.DEBUG="1";else delete o.DEBUG;let Ot=Nm(h),St=Ot?h:a,A=Ot?[...n,...K]:[...n,h,...K],L={command:St,args:A,cwd:r,env:o,signal:this.abortController.signal};if(this.options.spawnClaudeCodeProcess)E0(`Spawning Claude Code (custom): ${St} ${A.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(L);else E0(`Spawning Claude Code: ${St} ${A.join(" ")}`),this.process=this.spawnLocalProcess(L);this.processStdin=this.process.stdin,this.processStdout=this.process.stdout;let V=()=>{if(this.process&&!this.process.killed)this.process.kill("SIGTERM")};this.processExitHandler=V,this.abortHandler=V,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.process.on("error",(S)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new P0("Claude Code process aborted by user");else if(zp(S)){let b=Ot?`Claude Code native binary not found at ${h}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${h}. Is options.pathToClaudeCodeExecutable set?`;this.exitError=ReferenceError(b),E0(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${S.message}`),E0(this.exitError.message)}),this.process.on("exit",(S,b)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new P0("Claude Code process aborted by user");else{let P=this.getProcessExitError(S,b);if(P)this.exitError=P,E0(P.message)}}),this.ready=!0}catch(t){throw this.ready=!1,t}}getProcessExitError(t,e){if(t!==0&&t!==null)return Error(`Claude Code process exited with code ${t}`);else if(e)return Error(`Claude Code process terminated by signal ${e}`);return}write(t){if(this.abortController.signal.aborted)throw new P0("Operation aborted");if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){E0("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);E0(`[ProcessTransport] Writing to stdin: ${t.substring(0,100)}`);try{if(!this.processStdin.write(t))E0("[ProcessTransport] Write buffer full, data queued")}catch(e){throw this.ready=!1,Error(`Failed to write to process stdin: ${us(e)}`)}}close(){if(this.processStdin)this.processStdin.end(),this.processStdin=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:e}of this.exitListeners)this.process?.off("exit",e);this.exitListeners=[];let t=this.process;if(t&&!t.killed&&t.exitCode===null)setTimeout((e)=>{if(e.killed||e.exitCode!==null)return;e.kill("SIGTERM"),setTimeout((s)=>{if(s.exitCode===null)s.kill("SIGKILL")},5000,e).unref()},Vm,t).unref(),t.once("exit",()=>{if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0});else if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0;this.ready=!1}isReady(){return this.ready}async*readMessages(){if(!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let t=S8({input:this.processStdout}),e=this.process?(()=>{let s=this.process,r=()=>t.close();return s.on("error",r),()=>s.off("error",r)})():void 0;if(this.exitError)t.close();try{for await(let s of t)if(s.trim()){let r;try{r=gn(s)}catch(a){E0(`Non-JSON stdout: ${s}`);continue}yield r}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(s){throw s}finally{e?.(),t.close()}}endInput(){if(this.processStdin)this.processStdin.end()}getInputStream(){return this.processStdin}onExit(t){if(!this.process)return()=>{};let e=(s,r)=>{let a=this.getProcessExitError(s,r);t(a)};return this.process.on("exit",e),this.exitListeners.push({callback:t,handler:e}),()=>{if(this.process)this.process.off("exit",e);let s=this.exitListeners.findIndex((r)=>r.handler===e);if(s!==-1)this.exitListeners.splice(s,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((t,e)=>{let s=(a,n)=>{if(this.abortController.signal.aborted){e(new P0("Operation aborted"));return}let i=this.getProcessExitError(a,n);if(i)e(i);else t()};this.process.once("exit",s);let r=(a)=>{this.process.off("exit",s),e(a)};this.process.once("error",r),this.process.once("exit",()=>{this.process.off("error",r)})})}}function Nm(t){return![".js",".mjs",".tsx",".ts",".jsx"].some((e)=>t.endsWith(e))}function wm(t,e=process.platform,s=process.arch){let r;if(e==="linux")r=[`@anthropic-ai/claude-agent-sdk-linux-${s}-musl/cli`,`@anthropic-ai/claude-agent-sdk-linux-${s}/cli`];else if(e==="win32")r=[`@anthropic-ai/claude-agent-sdk-win32-${s}/cli.exe`];else r=[`@anthropic-ai/claude-agent-sdk-${e}-${s}/cli`];for(let a of r)try{return t(a)}catch{}return null}class bn{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(t){this.returned=t}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((t,e)=>{this.readResolve=t,this.readReject=e})}enqueue(t){if(this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!1,value:t})}else this.queue.push(t)}done(){if(this.isDone=!0,this.readResolve){let t=this.readResolve;this.readResolve=void 0,this.readReject=void 0,t({done:!0,value:void 0})}}error(t){if(this.hasError=t,this.readReject){let e=this.readReject;this.readResolve=void 0,this.readReject=void 0,e(t)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}class bo{sendMcpMessage;isClosed=!1;constructor(t){this.sendMcpMessage=t}onclose;onerror;onmessage;async start(){}async send(t){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(t)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}class Ao{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new bn;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;setIsSingleUserTurn(t){this.isSingleUserTurn=t}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0}constructor(t,e,s,r,a,n=new Map,i,h,o){this.transport=t,this.isSingleUserTurn=e,this.canUseTool=s,this.hooks=r,this.abortController=a,this.jsonSchema=i,this.initConfig=h,this.onElicitation=o;for(let[c,m]of n)this.connectSdkMcpServer(c,m);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(t){this.inputStream.error(t)}async stopTask(t){await this.request({subtype:"stop_task",task_id:t})}close(){this.cleanup()}cleanup(t){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{for(let s of this.cancelControllers.values())s.abort();this.cancelControllers.clear(),this.transport.close();let e=Error("Query closed before response received");for(let{reject:s}of this.pendingControlResponses.values())s(e);this.pendingControlResponses.clear();for(let{reject:s}of this.pendingMcpResponses.values())s(e);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let s of this.sdkMcpTransports.values())s.close().catch(()=>{});if(this.sdkMcpTransports.clear(),t)this.inputStream.error(t);else this.inputStream.done()}catch(e){}}next(...[t]){return this.sdkMessages.next(...[t])}return(t){return this.sdkMessages.return(t)}throw(t){return this.sdkMessages.throw(t)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let t of this.transport.readMessages()){if(t.type==="control_response"){let e=this.pendingControlResponses.get(t.response.request_id);if(e)e.handler(t.response);continue}else if(t.type==="control_request"){this.handleControlRequest(t);continue}else if(t.type==="control_cancel_request"){this.handleControlCancelRequest(t);continue}else if(t.type==="keep_alive")continue;if(t.type==="system"&&t.subtype==="post_turn_summary")continue;if(t.type==="result"){if(this.lastErrorResultText=t.is_error?t.subtype==="success"?t.result:t.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)v0("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}else if(!(t.type==="system"&&t.subtype==="session_state_changed"))this.lastErrorResultText=void 0;this.inputStream.enqueue(t)}if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(t){if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.lastErrorResultText!==void 0&&!(t instanceof P0)){let e=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);v0(`[Query.readMessages] Replacing exit error with result text. Original: ${us(t)}`),this.inputStream.error(e),this.cleanup(e);return}this.inputStream.error(t),this.cleanup(t)}}async handleControlRequest(t){let e=new AbortController;this.cancelControllers.set(t.request_id,e);try{let s=await this.processControlRequest(t,e.signal);if(this.cleanupPerformed)return;let r={type:"control_response",response:{subtype:"success",request_id:t.request_id,response:s}};await Promise.resolve(this.transport.write(u0(r)+`
53
+ `))}catch(s){if(this.cleanupPerformed)return;let r={type:"control_response",response:{subtype:"error",request_id:t.request_id,error:us(s)}};try{await Promise.resolve(this.transport.write(u0(r)+`
54
+ `))}catch(a){v0(`[Query.handleControlRequest] Error-response write failed: ${us(a)}`,{level:"error"})}}finally{this.cancelControllers.delete(t.request_id)}}handleControlCancelRequest(t){let e=this.cancelControllers.get(t.request_id);if(e)e.abort(),this.cancelControllers.delete(t.request_id)}async processControlRequest(t,e){if(t.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(t.request.tool_name,t.request.input,{signal:e,suggestions:t.request.permission_suggestions,blockedPath:t.request.blocked_path,decisionReason:t.request.decision_reason,title:t.request.title,displayName:t.request.display_name,description:t.request.description,toolUseID:t.request.tool_use_id,agentID:t.request.agent_id}),toolUseID:t.request.tool_use_id}}else if(t.request.subtype==="hook_callback")return await this.handleHookCallbacks(t.request.callback_id,t.request.input,t.request.tool_use_id,e);else if(t.request.subtype==="mcp_message"){let s=t.request,r=this.sdkMcpTransports.get(s.server_name);if(!r)throw Error(`SDK MCP server not found: ${s.server_name}`);if("method"in s.message&&"id"in s.message&&s.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(s.server_name,s,r)};else{if(r.onmessage)r.onmessage(s.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}else if(t.request.subtype==="elicitation"){let s=t.request;if(this.onElicitation)return await this.onElicitation({serverName:s.mcp_server_name,message:s.message,mode:s.mode,url:s.url,elicitationId:s.elicitation_id,requestedSchema:s.requested_schema,title:s.title,displayName:s.display_name,description:s.description},{signal:e});return{action:"decline"}}throw Error("Unsupported control request subtype: "+t.request.subtype)}async*readSdkMessages(){for await(let t of this.inputStream)yield t}async initialize(){let t;if(this.hooks){t={};for(let[r,a]of Object.entries(this.hooks))if(a.length>0)t[r]=a.map((n)=>{let i=[];for(let h of n.hooks){let o=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(o,h),i.push(o)}return{matcher:n.matcher,hookCallbackIds:i,timeout:n.timeout}})}let e=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,s={subtype:"initialize",hooks:t,sdkMcpServers:e,jsonSchema:this.jsonSchema,systemPrompt:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,agents:this.initConfig?.agents,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries};return(await this.request(s)).response}async interrupt(){await this.request({subtype:"interrupt"})}async setPermissionMode(t){await this.request({subtype:"set_permission_mode",mode:t})}async setModel(t){await this.request({subtype:"set_model",model:t})}async setMaxThinkingTokens(t){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:t})}async applyFlagSettings(t){await this.request({subtype:"apply_flag_settings",settings:t})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(t,e){return(await this.request({subtype:"rewind_files",user_message_id:t,dry_run:e?.dryRun})).response}async cancelAsyncMessage(t){return(await this.request({subtype:"cancel_async_message",message_uuid:t})).response.cancelled}async seedReadState(t,e){await this.request({subtype:"seed_read_state",path:t,mtime:e})}async enableRemoteControl(t){return(await this.request({subtype:"remote_control",enabled:t})).response}async setProactive(t){await this.request({subtype:"set_proactive",enabled:t})}async generateSessionTitle(t,e){return(await this.request({subtype:"generate_session_title",description:t,persist:e?.persist})).response.title}async askSideQuestion(t){return(await this.request({subtype:"side_question",question:t})).response.response}processPendingPermissionRequests(t){for(let e of t)if(e.request.subtype==="can_use_tool")this.handleControlRequest(e).catch(()=>{})}request(t){let e=Math.random().toString(36).substring(2,15),s={request_id:e,type:"control_request",request:t};return new Promise((r,a)=>{this.pendingControlResponses.set(e,{handler:(n)=>{if(this.pendingControlResponses.delete(e),n.subtype==="success")r(n);else if(a(Error(n.error)),n.pending_permission_requests)this.processPendingPermissionRequests(n.pending_permission_requests)},reject:a}),Promise.resolve(this.transport.write(u0(s)+`
55
+ `)).catch((n)=>{this.pendingControlResponses.delete(e),a(n)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(t){await this.request({subtype:"mcp_reconnect",serverName:t})}async toggleMcpServer(t,e){await this.request({subtype:"mcp_toggle",serverName:t,enabled:e})}async enableChannel(t){await this.request({subtype:"channel_enable",serverName:t})}async mcpAuthenticate(t){return(await this.request({subtype:"mcp_authenticate",serverName:t})).response}async mcpClearAuth(t){return(await this.request({subtype:"mcp_clear_auth",serverName:t})).response}async mcpSubmitOAuthCallbackUrl(t,e){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:t,callbackUrl:e})).response}async claudeAuthenticate(t){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:t})).response}async claudeOAuthCallback(t,e){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:t,state:e})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async reloadPlugins(){return(await this.request({subtype:"reload_plugins"})).response}async setMcpServers(t){let e={},s={};for(let[i,h]of Object.entries(t))if(h.type==="sdk"&&"instance"in h)e[i]=h.instance;else s[i]=h;let r=new Set(this.sdkMcpServerInstances.keys()),a=new Set(Object.keys(e));for(let i of r)if(!a.has(i))await this.disconnectSdkMcpServer(i);for(let[i,h]of Object.entries(e))if(!r.has(i))this.connectSdkMcpServer(i,h);let n={};for(let i of Object.keys(e))n[i]={type:"sdk",name:i};return(await this.request({subtype:"mcp_set_servers",servers:{...s,...n}})).response}async accountInfo(){return(await this.initialization).account}async streamInput(t){v0("[Query.streamInput] Starting to process input stream");try{let e=0;for await(let s of t){if(e++,v0(`[Query.streamInput] Processing message ${e}: ${s.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(u0(s)+`
56
+ `))}if(v0(`[Query.streamInput] Finished processing ${e} messages from input stream`),e>0&&this.hasBidirectionalNeeds())v0("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();v0("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(e){if(!(e instanceof P0))throw e}}waitForFirstResult(){if(this.firstResultReceived)return v0("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve();return new Promise((t)=>{if(this.abortController?.signal.aborted){t();return}this.abortController?.signal.addEventListener("abort",()=>t(),{once:!0}),this.firstResultReceivedResolve=t})}handleHookCallbacks(t,e,s,r){let a=this.hookCallbacks.get(t);if(!a)throw Error(`No hook callback found for ID: ${t}`);return a(e,s,{signal:r})}connectSdkMcpServer(t,e){let s=new bo((r)=>this.sendMcpServerMessageToCli(t,r));this.sdkMcpTransports.set(t,s),this.sdkMcpServerInstances.set(t,e),e.connect(s).catch((r)=>{if(this.sdkMcpTransports.get(t)===s)this.sdkMcpTransports.delete(t);if(this.sdkMcpServerInstances.get(t)===e)this.sdkMcpServerInstances.delete(t);v0(`[Query.connectSdkMcpServer] Failed to connect MCP server '${t}': ${r}`,{level:"error"})})}async disconnectSdkMcpServer(t){let e=this.sdkMcpTransports.get(t);if(e)await e.close(),this.sdkMcpTransports.delete(t);this.sdkMcpServerInstances.delete(t)}sendMcpServerMessageToCli(t,e){if("id"in e&&e.id!==null&&e.id!==void 0){let r=`${t}:${e.id}`,a=this.pendingMcpResponses.get(r);if(a){a.resolve(e),this.pendingMcpResponses.delete(r);return}}let s={type:"control_request",request_id:fo(),request:{subtype:"mcp_message",server_name:t,message:e}};Promise.resolve(this.transport.write(u0(s)+`
57
+ `)).catch((r)=>{v0(`[Query.sendMcpServerMessageToCli] Transport write failed: ${r}`,{level:"error"})})}handleMcpControlRequest(t,e,s){let r="id"in e.message?e.message.id:null,a=`${t}:${r}`;return new Promise((n,i)=>{let h=()=>{this.pendingMcpResponses.delete(a)},o=(m)=>{h(),n(m)},c=(m)=>{h(),i(m)};if(this.pendingMcpResponses.set(a,{resolve:o,reject:c}),s.onmessage)s.onmessage(e.message);else{h(),i(Error("No message handler registered"));return}})}}var u9=Hm(Km);var S9=Buffer.from('{"type":"attribution-snapshot"'),f9=Buffer.from('{"type":"system"'),Om=10,T9=Buffer.from([Om]);var Rt;(function(t){t.assertEqual=(a)=>{};function e(a){}t.assertIs=e;function s(a){throw Error()}t.assertNever=s,t.arrayToEnum=(a)=>{let n={};for(let i of a)n[i]=i;return n},t.getValidEnumValues=(a)=>{let n=t.objectKeys(a).filter((h)=>typeof a[a[h]]!=="number"),i={};for(let h of n)i[h]=a[h];return t.objectValues(i)},t.objectValues=(a)=>{return t.objectKeys(a).map(function(n){return a[n]})},t.objectKeys=typeof Object.keys==="function"?(a)=>Object.keys(a):(a)=>{let n=[];for(let i in a)if(Object.prototype.hasOwnProperty.call(a,i))n.push(i);return n},t.find=(a,n)=>{for(let i of a)if(n(i))return i;return},t.isInteger=typeof Number.isInteger==="function"?(a)=>Number.isInteger(a):(a)=>typeof a==="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map((i)=>typeof i==="string"?`'${i}'`:i).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(a,n)=>{if(typeof n==="bigint")return n.toString();return n}})(Rt||(Rt={}));var lh;(function(t){t.mergeShapes=(e,s)=>{return{...e,...s}}})(lh||(lh={}));var Y=Rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J0=(t)=>{switch(typeof t){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return Number.isNaN(t)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":if(Array.isArray(t))return Y.array;if(t===null)return Y.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return Y.promise;if(typeof Map<"u"&&t instanceof Map)return Y.map;if(typeof Set<"u"&&t instanceof Set)return Y.set;if(typeof Date<"u"&&t instanceof Date)return Y.date;return Y.object;default:return Y.unknown}},w=Rt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class T0 extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(s)=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let e=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,e);else this.__proto__=e;this.name="ZodError",this.issues=t}format(t){let e=t||function(a){return a.message},s={_errors:[]},r=(a)=>{for(let n of a.issues)if(n.code==="invalid_union")n.unionErrors.map(r);else if(n.code==="invalid_return_type")r(n.returnTypeError);else if(n.code==="invalid_arguments")r(n.argumentsError);else if(n.path.length===0)s._errors.push(e(n));else{let i=s,h=0;while(h<n.path.length){let o=n.path[h];if(h!==n.path.length-1)i[o]=i[o]||{_errors:[]};else i[o]=i[o]||{_errors:[]},i[o]._errors.push(e(n));i=i[o],h++}}};return r(this),s}static assert(t){if(!(t instanceof T0))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(e)=>e.message){let e={},s=[];for(let r of this.issues)if(r.path.length>0){let a=r.path[0];e[a]=e[a]||[],e[a].push(t(r))}else s.push(t(r));return{formErrors:s,fieldErrors:e}}get formErrors(){return this.flatten()}}T0.create=(t)=>{return new T0(t)};var Um=(t,e)=>{let s;switch(t.code){case w.invalid_type:if(t.received===Y.undefined)s="Required";else s=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,Rt.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:s=`Unrecognized key(s) in object: ${Rt.joinValues(t.keys,", ")}`;break;case w.invalid_union:s="Invalid input";break;case w.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Rt.joinValues(t.options)}`;break;case w.invalid_enum_value:s=`Invalid enum value. Expected ${Rt.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:s="Invalid function arguments";break;case w.invalid_return_type:s="Invalid function return type";break;case w.invalid_date:s="Invalid date";break;case w.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")s=`${s} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)s=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)s=`Invalid input: must end with "${t.validation.endsWith}"`;else Rt.assertNever(t.validation);else if(t.validation!=="regex")s=`Invalid ${t.validation}`;else s="Invalid";break;case w.too_small:if(t.type==="array")s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else s="Invalid input";break;case w.too_big:if(t.type==="array")s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else s="Invalid input";break;case w.custom:s="Invalid input";break;case w.invalid_intersection_types:s="Intersection results could not be merged";break;case w.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:s="Number must be finite";break;default:s=e.defaultError,Rt.assertNever(t)}return{message:s}},Ta=Um,Gm=Ta;function Ur(){return Gm}var Gr=(t)=>{let{data:e,path:s,errorMaps:r,issueData:a}=t,n=[...s,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let h="",o=r.filter((c)=>!!c).slice().reverse();for(let c of o)h=c(i,{data:e,defaultError:h}).message;return{...a,path:n,message:h}};function G(t,e){let s=Ur(),r=Gr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===Ta?void 0:Ta].filter((a)=>!!a)});t.common.issues.push(r)}class s0{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,e){let s=[];for(let r of e){if(r.status==="aborted")return nt;if(r.status==="dirty")t.dirty();s.push(r.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,e){let s=[];for(let r of e){let a=await r.key,n=await r.value;s.push({key:a,value:n})}return s0.mergeObjectSync(t,s)}static mergeObjectSync(t,e){let s={};for(let r of e){let{key:a,value:n}=r;if(a.status==="aborted")return nt;if(n.status==="aborted")return nt;if(a.status==="dirty")t.dirty();if(n.status==="dirty")t.dirty();if(a.value!=="__proto__"&&(typeof n.value<"u"||r.alwaysSet))s[a.value]=n.value}return{status:t.value,value:s}}}var nt=Object.freeze({status:"aborted"}),pa=(t)=>({status:"dirty",value:t}),n0=(t)=>({status:"valid",value:t}),ph=(t)=>t.status==="aborted",mh=(t)=>t.status==="dirty",Fe=(t)=>t.status==="valid",Is=(t)=>typeof Promise<"u"&&t instanceof Promise,$;(function(t){t.errToObj=(e)=>typeof e==="string"?{message:e}:e||{},t.toString=(e)=>typeof e==="string"?e:e?.message})($||($={}));class b0{constructor(t,e,s,r){this._cachedPath=[],this.parent=t,this.data=e,this._path=s,this._key=r}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var Eh=(t,e)=>{if(Fe(e))return{success:!0,data:e.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new T0(t.common.issues);return this._error=s,this._error}}}};function dt(t){if(!t)return{};let{errorMap:e,invalid_type_error:s,required_error:r,description:a}=t;if(e&&(s||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(e)return{errorMap:e,description:a};return{errorMap:(n,i)=>{let{message:h}=t;if(n.code==="invalid_enum_value")return{message:h??i.defaultError};if(typeof i.data>"u")return{message:h??r??i.defaultError};if(n.code!=="invalid_type")return{message:i.defaultError};return{message:h??s??i.defaultError}},description:a}}class Et{get description(){return this._def.description}_getType(t){return J0(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:J0(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new s0,ctx:{common:t.parent.common,data:t.data,parsedType:J0(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Is(e))throw Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let s=this.safeParse(t,e);if(s.success)return s.data;throw s.error}safeParse(t,e){let s={common:{issues:[],async:e?.async??!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:J0(t)},r=this._parseSync({data:t,path:s.path,parent:s});return Eh(s,r)}"~validate"(t){let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:J0(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:e});return Fe(s)?{value:s.value}:{issues:e.common.issues}}catch(s){if(s?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then((s)=>Fe(s)?{value:s.value}:{issues:e.common.issues})}async parseAsync(t,e){let s=await this.safeParseAsync(t,e);if(s.success)return s.data;throw s.error}async safeParseAsync(t,e){let s={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:J0(t)},r=this._parse({data:t,path:s.path,parent:s}),a=await(Is(r)?r:Promise.resolve(r));return Eh(s,a)}refine(t,e){let s=(r)=>{if(typeof e==="string"||typeof e>"u")return{message:e};else if(typeof e==="function")return e(r);else return e};return this._refinement((r,a)=>{let n=t(r),i=()=>a.addIssue({code:w.custom,...s(r)});if(typeof Promise<"u"&&n instanceof Promise)return n.then((h)=>{if(!h)return i(),!1;else return!0});if(!n)return i(),!1;else return!0})}refinement(t,e){return this._refinement((s,r)=>{if(!t(s))return r.addIssue(typeof e==="function"?e(s,r):e),!1;else return!0})}_refinement(t){return new _0({schema:this,typeName:it.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(e)=>this["~validate"](e)}}optional(){return q0.create(this,this._def)}nullable(){return X0.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return j0.create(this)}promise(){return je.create(this,this._def)}or(t){return Ca.create([this,t],this._def)}and(t){return Ia.create(this,t,this._def)}transform(t){return new _0({...dt(this._def),schema:this,typeName:it.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t==="function"?t:()=>t;return new Aa({...dt(this._def),innerType:this,defaultValue:e,typeName:it.ZodDefault})}brand(){return new Zn({typeName:it.ZodBranded,type:this,...dt(this._def)})}catch(t){let e=typeof t==="function"?t:()=>t;return new Za({...dt(this._def),innerType:this,catchValue:e,typeName:it.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return tr.create(this,t)}readonly(){return Fa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Wm=/^c[^\s-]{8,}$/i,zm=/^[0-9a-z]+$/,Qm=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Jm=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ym=/^[a-z0-9_-]{21}$/i,Xm=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$m=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",jr,aE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,rE=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nE=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,iE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Zo="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oE=new RegExp(`^${Zo}$`);function Fo(t){let e="[0-5]\\d";if(t.precision)e=`${e}\\.\\d{${t.precision}}`;else if(t.precision==null)e=`${e}(\\.\\d+)?`;let s=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function cE(t){return new RegExp(`^${Fo(t)}$`)}function dE(t){let e=`${Zo}T${Fo(t)}`,s=[];if(s.push(t.local?"Z?":"Z"),t.offset)s.push("([+-]\\d{2}:?\\d{2})");return e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function yE(t,e){if((e==="v4"||!e)&&aE.test(t))return!0;if((e==="v6"||!e)&&rE.test(t))return!0;return!1}function lE(t,e){if(!Xm.test(t))return!1;try{let[s]=t.split(".");if(!s)return!1;let r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(r));if(typeof a!=="object"||a===null)return!1;if("typ"in a&&a?.typ!=="JWT")return!1;if(!a.alg)return!1;if(e&&a.alg!==e)return!1;return!0}catch{return!1}}function pE(t,e){if((e==="v4"||!e)&&sE.test(t))return!0;if((e==="v6"||!e)&&nE.test(t))return!0;return!1}class H0 extends Et{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==Y.string){let r=this._getOrReturnCtx(t);return G(r,{code:w.invalid_type,expected:Y.string,received:r.parsedType}),nt}let e=new s0,s=void 0;for(let r of this._def.checks)if(r.kind==="min"){if(t.data.length<r.value)s=this._getOrReturnCtx(t,s),G(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),e.dirty()}else if(r.kind==="max"){if(t.data.length>r.value)s=this._getOrReturnCtx(t,s),G(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),e.dirty()}else if(r.kind==="length"){let a=t.data.length>r.value,n=t.data.length<r.value;if(a||n){if(s=this._getOrReturnCtx(t,s),a)G(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message});else if(n)G(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message});e.dirty()}}else if(r.kind==="email"){if(!tE.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"email",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="emoji"){if(!jr)jr=new RegExp(eE,"u");if(!jr.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"emoji",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="uuid"){if(!Jm.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"uuid",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="nanoid"){if(!Ym.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"nanoid",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="cuid"){if(!Wm.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"cuid",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="cuid2"){if(!zm.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"cuid2",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="ulid"){if(!Qm.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"ulid",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),G(s,{validation:"url",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="regex"){if(r.regex.lastIndex=0,!r.regex.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"regex",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="trim")t.data=t.data.trim();else if(r.kind==="includes"){if(!t.data.includes(r.value,r.position))s=this._getOrReturnCtx(t,s),G(s,{code:w.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),e.dirty()}else if(r.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(r.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(r.kind==="startsWith"){if(!t.data.startsWith(r.value))s=this._getOrReturnCtx(t,s),G(s,{code:w.invalid_string,validation:{startsWith:r.value},message:r.message}),e.dirty()}else if(r.kind==="endsWith"){if(!t.data.endsWith(r.value))s=this._getOrReturnCtx(t,s),G(s,{code:w.invalid_string,validation:{endsWith:r.value},message:r.message}),e.dirty()}else if(r.kind==="datetime"){if(!dE(r).test(t.data))s=this._getOrReturnCtx(t,s),G(s,{code:w.invalid_string,validation:"datetime",message:r.message}),e.dirty()}else if(r.kind==="date"){if(!oE.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{code:w.invalid_string,validation:"date",message:r.message}),e.dirty()}else if(r.kind==="time"){if(!cE(r).test(t.data))s=this._getOrReturnCtx(t,s),G(s,{code:w.invalid_string,validation:"time",message:r.message}),e.dirty()}else if(r.kind==="duration"){if(!$m.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"duration",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="ip"){if(!yE(t.data,r.version))s=this._getOrReturnCtx(t,s),G(s,{validation:"ip",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="jwt"){if(!lE(t.data,r.alg))s=this._getOrReturnCtx(t,s),G(s,{validation:"jwt",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="cidr"){if(!pE(t.data,r.version))s=this._getOrReturnCtx(t,s),G(s,{validation:"cidr",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="base64"){if(!iE.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"base64",code:w.invalid_string,message:r.message}),e.dirty()}else if(r.kind==="base64url"){if(!hE.test(t.data))s=this._getOrReturnCtx(t,s),G(s,{validation:"base64url",code:w.invalid_string,message:r.message}),e.dirty()}else Rt.assertNever(r);return{status:e.value,value:t.data}}_regex(t,e,s){return this.refinement((r)=>t.test(r),{validation:e,code:w.invalid_string,...$.errToObj(s)})}_addCheck(t){return new H0({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...$.errToObj(t)})}url(t){return this._addCheck({kind:"url",...$.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...$.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...$.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...$.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...$.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...$.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...$.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...$.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...$.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...$.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...$.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...$.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...$.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...$.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...$.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...$.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e?.position,...$.errToObj(e?.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...$.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...$.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...$.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...$.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...$.errToObj(e)})}nonempty(t){return this.min(1,$.errToObj(t))}trim(){return new H0({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new H0({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new H0({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxLength(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}}H0.create=(t)=>{return new H0({checks:[],typeName:it.ZodString,coerce:t?.coerce??!1,...dt(t)})};function mE(t,e){let s=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=s>r?s:r,n=Number.parseInt(t.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class Me extends Et{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==Y.number){let r=this._getOrReturnCtx(t);return G(r,{code:w.invalid_type,expected:Y.number,received:r.parsedType}),nt}let e=void 0,s=new s0;for(let r of this._def.checks)if(r.kind==="int"){if(!Rt.isInteger(t.data))e=this._getOrReturnCtx(t,e),G(e,{code:w.invalid_type,expected:"integer",received:"float",message:r.message}),s.dirty()}else if(r.kind==="min"){if(r.inclusive?t.data<r.value:t.data<=r.value)e=this._getOrReturnCtx(t,e),G(e,{code:w.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()}else if(r.kind==="max"){if(r.inclusive?t.data>r.value:t.data>=r.value)e=this._getOrReturnCtx(t,e),G(e,{code:w.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()}else if(r.kind==="multipleOf"){if(mE(t.data,r.value)!==0)e=this._getOrReturnCtx(t,e),G(e,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()}else if(r.kind==="finite"){if(!Number.isFinite(t.data))e=this._getOrReturnCtx(t,e),G(e,{code:w.not_finite,message:r.message}),s.dirty()}else Rt.assertNever(r);return{status:s.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,$.toString(e))}gt(t,e){return this.setLimit("min",t,!1,$.toString(e))}lte(t,e){return this.setLimit("max",t,!0,$.toString(e))}lt(t,e){return this.setLimit("max",t,!1,$.toString(e))}setLimit(t,e,s,r){return new Me({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:s,message:$.toString(r)}]})}_addCheck(t){return new Me({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:$.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:$.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxValue(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&Rt.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let s of this._def.checks)if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;else if(s.kind==="min"){if(e===null||s.value>e)e=s.value}else if(s.kind==="max"){if(t===null||s.value<t)t=s.value}return Number.isFinite(e)&&Number.isFinite(t)}}Me.create=(t)=>{return new Me({checks:[],typeName:it.ZodNumber,coerce:t?.coerce||!1,...dt(t)})};class Pe extends Et{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Y.bigint)return this._getInvalidInput(t);let e=void 0,s=new s0;for(let r of this._def.checks)if(r.kind==="min"){if(r.inclusive?t.data<r.value:t.data<=r.value)e=this._getOrReturnCtx(t,e),G(e,{code:w.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()}else if(r.kind==="max"){if(r.inclusive?t.data>r.value:t.data>=r.value)e=this._getOrReturnCtx(t,e),G(e,{code:w.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()}else if(r.kind==="multipleOf"){if(t.data%r.value!==BigInt(0))e=this._getOrReturnCtx(t,e),G(e,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()}else Rt.assertNever(r);return{status:s.value,value:t.data}}_getInvalidInput(t){let e=this._getOrReturnCtx(t);return G(e,{code:w.invalid_type,expected:Y.bigint,received:e.parsedType}),nt}gte(t,e){return this.setLimit("min",t,!0,$.toString(e))}gt(t,e){return this.setLimit("min",t,!1,$.toString(e))}lte(t,e){return this.setLimit("max",t,!0,$.toString(e))}lt(t,e){return this.setLimit("max",t,!1,$.toString(e))}setLimit(t,e,s,r){return new Pe({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:s,message:$.toString(r)}]})}_addCheck(t){return new Pe({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxValue(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}}Pe.create=(t)=>{return new Pe({checks:[],typeName:it.ZodBigInt,coerce:t?.coerce??!1,...dt(t)})};class vs extends Et{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==Y.boolean){let e=this._getOrReturnCtx(t);return G(e,{code:w.invalid_type,expected:Y.boolean,received:e.parsedType}),nt}return n0(t.data)}}vs.create=(t)=>{return new vs({typeName:it.ZodBoolean,coerce:t?.coerce||!1,...dt(t)})};class ka extends Et{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==Y.date){let r=this._getOrReturnCtx(t);return G(r,{code:w.invalid_type,expected:Y.date,received:r.parsedType}),nt}if(Number.isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return G(r,{code:w.invalid_date}),nt}let e=new s0,s=void 0;for(let r of this._def.checks)if(r.kind==="min"){if(t.data.getTime()<r.value)s=this._getOrReturnCtx(t,s),G(s,{code:w.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),e.dirty()}else if(r.kind==="max"){if(t.data.getTime()>r.value)s=this._getOrReturnCtx(t,s),G(s,{code:w.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),e.dirty()}else Rt.assertNever(r);return{status:e.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ka({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:$.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:$.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t!=null?new Date(t):null}}ka.create=(t)=>{return new ka({checks:[],coerce:t?.coerce||!1,typeName:it.ZodDate,...dt(t)})};class gs extends Et{_parse(t){if(this._getType(t)!==Y.symbol){let e=this._getOrReturnCtx(t);return G(e,{code:w.invalid_type,expected:Y.symbol,received:e.parsedType}),nt}return n0(t.data)}}gs.create=(t)=>{return new gs({typeName:it.ZodSymbol,...dt(t)})};class Ra extends Et{_parse(t){if(this._getType(t)!==Y.undefined){let e=this._getOrReturnCtx(t);return G(e,{code:w.invalid_type,expected:Y.undefined,received:e.parsedType}),nt}return n0(t.data)}}Ra.create=(t)=>{return new Ra({typeName:it.ZodUndefined,...dt(t)})};class xa extends Et{_parse(t){if(this._getType(t)!==Y.null){let e=this._getOrReturnCtx(t);return G(e,{code:w.invalid_type,expected:Y.null,received:e.parsedType}),nt}return n0(t.data)}}xa.create=(t)=>{return new xa({typeName:it.ZodNull,...dt(t)})};class bs extends Et{constructor(){super(...arguments);this._any=!0}_parse(t){return n0(t.data)}}bs.create=(t)=>{return new bs({typeName:it.ZodAny,...dt(t)})};class he extends Et{constructor(){super(...arguments);this._unknown=!0}_parse(t){return n0(t.data)}}he.create=(t)=>{return new he({typeName:it.ZodUnknown,...dt(t)})};class U0 extends Et{_parse(t){let e=this._getOrReturnCtx(t);return G(e,{code:w.invalid_type,expected:Y.never,received:e.parsedType}),nt}}U0.create=(t)=>{return new U0({typeName:it.ZodNever,...dt(t)})};class As extends Et{_parse(t){if(this._getType(t)!==Y.undefined){let e=this._getOrReturnCtx(t);return G(e,{code:w.invalid_type,expected:Y.void,received:e.parsedType}),nt}return n0(t.data)}}As.create=(t)=>{return new As({typeName:it.ZodVoid,...dt(t)})};class j0 extends Et{_parse(t){let{ctx:e,status:s}=this._processInputParams(t),r=this._def;if(e.parsedType!==Y.array)return G(e,{code:w.invalid_type,expected:Y.array,received:e.parsedType}),nt;if(r.exactLength!==null){let n=e.data.length>r.exactLength.value,i=e.data.length<r.exactLength.value;if(n||i)G(e,{code:n?w.too_big:w.too_small,minimum:i?r.exactLength.value:void 0,maximum:n?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty()}if(r.minLength!==null){if(e.data.length<r.minLength.value)G(e,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()}if(r.maxLength!==null){if(e.data.length>r.maxLength.value)G(e,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()}if(e.common.async)return Promise.all([...e.data].map((n,i)=>{return r.type._parseAsync(new b0(e,n,e.path,i))})).then((n)=>{return s0.mergeArray(s,n)});let a=[...e.data].map((n,i)=>{return r.type._parseSync(new b0(e,n,e.path,i))});return s0.mergeArray(s,a)}get element(){return this._def.type}min(t,e){return new j0({...this._def,minLength:{value:t,message:$.toString(e)}})}max(t,e){return new j0({...this._def,maxLength:{value:t,message:$.toString(e)}})}length(t,e){return new j0({...this._def,exactLength:{value:t,message:$.toString(e)}})}nonempty(t){return this.min(1,t)}}j0.create=(t,e)=>{return new j0({type:t,minLength:null,maxLength:null,exactLength:null,typeName:it.ZodArray,...dt(e)})};function Ie(t){if(t instanceof _t){let e={};for(let s in t.shape){let r=t.shape[s];e[s]=q0.create(Ie(r))}return new _t({...t._def,shape:()=>e})}else if(t instanceof j0)return new j0({...t._def,type:Ie(t.element)});else if(t instanceof q0)return q0.create(Ie(t.unwrap()));else if(t instanceof X0)return X0.create(Ie(t.unwrap()));else if(t instanceof G0)return G0.create(t.items.map((e)=>Ie(e)));else return t}class _t extends Et{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=Rt.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==Y.object){let h=this._getOrReturnCtx(t);return G(h,{code:w.invalid_type,expected:Y.object,received:h.parsedType}),nt}let{status:e,ctx:s}=this._processInputParams(t),{shape:r,keys:a}=this._getCached(),n=[];if(!(this._def.catchall instanceof U0&&this._def.unknownKeys==="strip")){for(let h in s.data)if(!a.includes(h))n.push(h)}let i=[];for(let h of a){let o=r[h],c=s.data[h];i.push({key:{status:"valid",value:h},value:o._parse(new b0(s,c,s.path,h)),alwaysSet:h in s.data})}if(this._def.catchall instanceof U0){let h=this._def.unknownKeys;if(h==="passthrough")for(let o of n)i.push({key:{status:"valid",value:o},value:{status:"valid",value:s.data[o]}});else if(h==="strict"){if(n.length>0)G(s,{code:w.unrecognized_keys,keys:n}),e.dirty()}else if(h==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let o of n){let c=s.data[o];i.push({key:{status:"valid",value:o},value:h._parse(new b0(s,c,s.path,o)),alwaysSet:o in s.data})}}if(s.common.async)return Promise.resolve().then(async()=>{let h=[];for(let o of i){let c=await o.key,m=await o.value;h.push({key:c,value:m,alwaysSet:o.alwaysSet})}return h}).then((h)=>{return s0.mergeObjectSync(e,h)});else return s0.mergeObjectSync(e,i)}get shape(){return this._def.shape()}strict(t){return $.errToObj,new _t({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,s)=>{let r=this._def.errorMap?.(e,s).message??s.defaultError;if(e.code==="unrecognized_keys")return{message:$.errToObj(t).message??r};return{message:r}}}:{}})}strip(){return new _t({...this._def,unknownKeys:"strip"})}passthrough(){return new _t({...this._def,unknownKeys:"passthrough"})}extend(t){return new _t({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new _t({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:it.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new _t({...this._def,catchall:t})}pick(t){let e={};for(let s of Rt.objectKeys(t))if(t[s]&&this.shape[s])e[s]=this.shape[s];return new _t({...this._def,shape:()=>e})}omit(t){let e={};for(let s of Rt.objectKeys(this.shape))if(!t[s])e[s]=this.shape[s];return new _t({...this._def,shape:()=>e})}deepPartial(){return Ie(this)}partial(t){let e={};for(let s of Rt.objectKeys(this.shape)){let r=this.shape[s];if(t&&!t[s])e[s]=r;else e[s]=r.optional()}return new _t({...this._def,shape:()=>e})}required(t){let e={};for(let s of Rt.objectKeys(this.shape))if(t&&!t[s])e[s]=this.shape[s];else{let r=this.shape[s];while(r instanceof q0)r=r._def.innerType;e[s]=r}return new _t({...this._def,shape:()=>e})}keyof(){return Mo(Rt.objectKeys(this.shape))}}_t.create=(t,e)=>{return new _t({shape:()=>t,unknownKeys:"strip",catchall:U0.create(),typeName:it.ZodObject,...dt(e)})};_t.strictCreate=(t,e)=>{return new _t({shape:()=>t,unknownKeys:"strict",catchall:U0.create(),typeName:it.ZodObject,...dt(e)})};_t.lazycreate=(t,e)=>{return new _t({shape:t,unknownKeys:"strip",catchall:U0.create(),typeName:it.ZodObject,...dt(e)})};class Ca extends Et{_parse(t){let{ctx:e}=this._processInputParams(t),s=this._def.options;function r(a){for(let i of a)if(i.result.status==="valid")return i.result;for(let i of a)if(i.result.status==="dirty")return e.common.issues.push(...i.ctx.common.issues),i.result;let n=a.map((i)=>new T0(i.ctx.common.issues));return G(e,{code:w.invalid_union,unionErrors:n}),nt}if(e.common.async)return Promise.all(s.map(async(a)=>{let n={...e,common:{...e.common,issues:[]},parent:null};return{result:await a._parseAsync({data:e.data,path:e.path,parent:n}),ctx:n}})).then(r);else{let a=void 0,n=[];for(let h of s){let o={...e,common:{...e.common,issues:[]},parent:null},c=h._parseSync({data:e.data,path:e.path,parent:o});if(c.status==="valid")return c;else if(c.status==="dirty"&&!a)a={result:c,ctx:o};if(o.common.issues.length)n.push(o.common.issues)}if(a)return e.common.issues.push(...a.ctx.common.issues),a.result;let i=n.map((h)=>new T0(h));return G(e,{code:w.invalid_union,unionErrors:i}),nt}}get options(){return this._def.options}}Ca.create=(t,e)=>{return new Ca({options:t,typeName:it.ZodUnion,...dt(e)})};var w0=(t)=>{if(t instanceof va)return w0(t.schema);else if(t instanceof _0)return w0(t.innerType());else if(t instanceof ga)return[t.value];else if(t instanceof oe)return t.options;else if(t instanceof ba)return Rt.objectValues(t.enum);else if(t instanceof Aa)return w0(t._def.innerType);else if(t instanceof Ra)return[void 0];else if(t instanceof xa)return[null];else if(t instanceof q0)return[void 0,...w0(t.unwrap())];else if(t instanceof X0)return[null,...w0(t.unwrap())];else if(t instanceof Zn)return w0(t.unwrap());else if(t instanceof Fa)return w0(t.unwrap());else if(t instanceof Za)return w0(t._def.innerType);else return[]};class An extends Et{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Y.object)return G(e,{code:w.invalid_type,expected:Y.object,received:e.parsedType}),nt;let s=this.discriminator,r=e.data[s],a=this.optionsMap.get(r);if(!a)return G(e,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),nt;if(e.common.async)return a._parseAsync({data:e.data,path:e.path,parent:e});else return a._parseSync({data:e.data,path:e.path,parent:e})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,s){let r=new Map;for(let a of e){let n=w0(a.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let i of n){if(r.has(i))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(i)}`);r.set(i,a)}}return new An({typeName:it.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:r,...dt(s)})}}function Wr(t,e){let s=J0(t),r=J0(e);if(t===e)return{valid:!0,data:t};else if(s===Y.object&&r===Y.object){let a=Rt.objectKeys(e),n=Rt.objectKeys(t).filter((h)=>a.indexOf(h)!==-1),i={...t,...e};for(let h of n){let o=Wr(t[h],e[h]);if(!o.valid)return{valid:!1};i[h]=o.data}return{valid:!0,data:i}}else if(s===Y.array&&r===Y.array){if(t.length!==e.length)return{valid:!1};let a=[];for(let n=0;n<t.length;n++){let i=t[n],h=e[n],o=Wr(i,h);if(!o.valid)return{valid:!1};a.push(o.data)}return{valid:!0,data:a}}else if(s===Y.date&&r===Y.date&&+t===+e)return{valid:!0,data:t};else return{valid:!1}}class Ia extends Et{_parse(t){let{status:e,ctx:s}=this._processInputParams(t),r=(a,n)=>{if(ph(a)||ph(n))return nt;let i=Wr(a.value,n.value);if(!i.valid)return G(s,{code:w.invalid_intersection_types}),nt;if(mh(a)||mh(n))e.dirty();return{status:e.value,value:i.data}};if(s.common.async)return Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,n])=>r(a,n));else return r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Ia.create=(t,e,s)=>{return new Ia({left:t,right:e,typeName:it.ZodIntersection,...dt(s)})};class G0 extends Et{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==Y.array)return G(s,{code:w.invalid_type,expected:Y.array,received:s.parsedType}),nt;if(s.data.length<this._def.items.length)return G(s,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nt;if(!this._def.rest&&s.data.length>this._def.items.length)G(s,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty();let r=[...s.data].map((a,n)=>{let i=this._def.items[n]||this._def.rest;if(!i)return null;return i._parse(new b0(s,a,s.path,n))}).filter((a)=>!!a);if(s.common.async)return Promise.all(r).then((a)=>{return s0.mergeArray(e,a)});else return s0.mergeArray(e,r)}get items(){return this._def.items}rest(t){return new G0({...this._def,rest:t})}}G0.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new G0({items:t,typeName:it.ZodTuple,rest:null,...dt(e)})};class Zs extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==Y.object)return G(s,{code:w.invalid_type,expected:Y.object,received:s.parsedType}),nt;let r=[],a=this._def.keyType,n=this._def.valueType;for(let i in s.data)r.push({key:a._parse(new b0(s,i,s.path,i)),value:n._parse(new b0(s,s.data[i],s.path,i)),alwaysSet:i in s.data});if(s.common.async)return s0.mergeObjectAsync(e,r);else return s0.mergeObjectSync(e,r)}get element(){return this._def.valueType}static create(t,e,s){if(e instanceof Et)return new Zs({keyType:t,valueType:e,typeName:it.ZodRecord,...dt(s)});return new Zs({keyType:H0.create(),valueType:t,typeName:it.ZodRecord,...dt(e)})}}class Fs extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==Y.map)return G(s,{code:w.invalid_type,expected:Y.map,received:s.parsedType}),nt;let r=this._def.keyType,a=this._def.valueType,n=[...s.data.entries()].map(([i,h],o)=>{return{key:r._parse(new b0(s,i,s.path,[o,"key"])),value:a._parse(new b0(s,h,s.path,[o,"value"]))}});if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let h of n){let o=await h.key,c=await h.value;if(o.status==="aborted"||c.status==="aborted")return nt;if(o.status==="dirty"||c.status==="dirty")e.dirty();i.set(o.value,c.value)}return{status:e.value,value:i}})}else{let i=new Map;for(let h of n){let{key:o,value:c}=h;if(o.status==="aborted"||c.status==="aborted")return nt;if(o.status==="dirty"||c.status==="dirty")e.dirty();i.set(o.value,c.value)}return{status:e.value,value:i}}}}Fs.create=(t,e,s)=>{return new Fs({valueType:e,keyType:t,typeName:it.ZodMap,...dt(s)})};class Le extends Et{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==Y.set)return G(s,{code:w.invalid_type,expected:Y.set,received:s.parsedType}),nt;let r=this._def;if(r.minSize!==null){if(s.data.size<r.minSize.value)G(s,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),e.dirty()}if(r.maxSize!==null){if(s.data.size>r.maxSize.value)G(s,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),e.dirty()}let a=this._def.valueType;function n(h){let o=new Set;for(let c of h){if(c.status==="aborted")return nt;if(c.status==="dirty")e.dirty();o.add(c.value)}return{status:e.value,value:o}}let i=[...s.data.values()].map((h,o)=>a._parse(new b0(s,h,s.path,o)));if(s.common.async)return Promise.all(i).then((h)=>n(h));else return n(i)}min(t,e){return new Le({...this._def,minSize:{value:t,message:$.toString(e)}})}max(t,e){return new Le({...this._def,maxSize:{value:t,message:$.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}}Le.create=(t,e)=>{return new Le({valueType:t,minSize:null,maxSize:null,typeName:it.ZodSet,...dt(e)})};class ua extends Et{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Y.function)return G(e,{code:w.invalid_type,expected:Y.function,received:e.parsedType}),nt;function s(i,h){return Gr({data:i,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ur(),Ta].filter((o)=>!!o),issueData:{code:w.invalid_arguments,argumentsError:h}})}function r(i,h){return Gr({data:i,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ur(),Ta].filter((o)=>!!o),issueData:{code:w.invalid_return_type,returnTypeError:h}})}let a={errorMap:e.common.contextualErrorMap},n=e.data;if(this._def.returns instanceof je){let i=this;return n0(async function(...h){let o=new T0([]),c=await i._def.args.parseAsync(h,a).catch((u)=>{throw o.addIssue(s(h,u)),o}),m=await Reflect.apply(n,this,c);return await i._def.returns._def.type.parseAsync(m,a).catch((u)=>{throw o.addIssue(r(m,u)),o})})}else{let i=this;return n0(function(...h){let o=i._def.args.safeParse(h,a);if(!o.success)throw new T0([s(h,o.error)]);let c=Reflect.apply(n,this,o.data),m=i._def.returns.safeParse(c,a);if(!m.success)throw new T0([r(c,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ua({...this._def,args:G0.create(t).rest(he.create())})}returns(t){return new ua({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,s){return new ua({args:t?t:G0.create([]).rest(he.create()),returns:e||he.create(),typeName:it.ZodFunction,...dt(s)})}}class va extends Et{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}}va.create=(t,e)=>{return new va({getter:t,typeName:it.ZodLazy,...dt(e)})};class ga extends Et{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return G(e,{received:e.data,code:w.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:t.data}}get value(){return this._def.value}}ga.create=(t,e)=>{return new ga({value:t,typeName:it.ZodLiteral,...dt(e)})};function Mo(t,e){return new oe({values:t,typeName:it.ZodEnum,...dt(e)})}class oe extends Et{_parse(t){if(typeof t.data!=="string"){let e=this._getOrReturnCtx(t),s=this._def.values;return G(e,{expected:Rt.joinValues(s),received:e.parsedType,code:w.invalid_type}),nt}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let e=this._getOrReturnCtx(t),s=this._def.values;return G(e,{received:e.data,code:w.invalid_enum_value,options:s}),nt}return n0(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return oe.create(t,{...this._def,...e})}exclude(t,e=this._def){return oe.create(this.options.filter((s)=>!t.includes(s)),{...this._def,...e})}}oe.create=Mo;class ba extends Et{_parse(t){let e=Rt.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==Y.string&&s.parsedType!==Y.number){let r=Rt.objectValues(e);return G(s,{expected:Rt.joinValues(r),received:s.parsedType,code:w.invalid_type}),nt}if(!this._cache)this._cache=new Set(Rt.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let r=Rt.objectValues(e);return G(s,{received:s.data,code:w.invalid_enum_value,options:r}),nt}return n0(t.data)}get enum(){return this._def.values}}ba.create=(t,e)=>{return new ba({values:t,typeName:it.ZodNativeEnum,...dt(e)})};class je extends Et{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Y.promise&&e.common.async===!1)return G(e,{code:w.invalid_type,expected:Y.promise,received:e.parsedType}),nt;let s=e.parsedType===Y.promise?e.data:Promise.resolve(e.data);return n0(s.then((r)=>{return this._def.type.parseAsync(r,{path:e.path,errorMap:e.common.contextualErrorMap})}))}}je.create=(t,e)=>{return new je({type:t,typeName:it.ZodPromise,...dt(e)})};class _0 extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===it.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:s}=this._processInputParams(t),r=this._def.effect||null,a={addIssue:(n)=>{if(G(s,n),n.fatal)e.abort();else e.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){let n=r.transform(s.data,a);if(s.common.async)return Promise.resolve(n).then(async(i)=>{if(e.value==="aborted")return nt;let h=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});if(h.status==="aborted")return nt;if(h.status==="dirty")return pa(h.value);if(e.value==="dirty")return pa(h.value);return h});else{if(e.value==="aborted")return nt;let i=this._def.schema._parseSync({data:n,path:s.path,parent:s});if(i.status==="aborted")return nt;if(i.status==="dirty")return pa(i.value);if(e.value==="dirty")return pa(i.value);return i}}if(r.type==="refinement"){let n=(i)=>{let h=r.refinement(i,a);if(s.common.async)return Promise.resolve(h);if(h instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(i.status==="aborted")return nt;if(i.status==="dirty")e.dirty();return n(i.value),{status:e.value,value:i.value}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((i)=>{if(i.status==="aborted")return nt;if(i.status==="dirty")e.dirty();return n(i.value).then(()=>{return{status:e.value,value:i.value}})})}if(r.type==="transform")if(s.common.async===!1){let n=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Fe(n))return nt;let i=r.transform(n.value,a);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((n)=>{if(!Fe(n))return nt;return Promise.resolve(r.transform(n.value,a)).then((i)=>({status:e.value,value:i}))});Rt.assertNever(r)}}_0.create=(t,e,s)=>{return new _0({schema:t,typeName:it.ZodEffects,effect:e,...dt(s)})};_0.createWithPreprocess=(t,e,s)=>{return new _0({schema:e,effect:{type:"preprocess",transform:t},typeName:it.ZodEffects,...dt(s)})};class q0 extends Et{_parse(t){if(this._getType(t)===Y.undefined)return n0(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}q0.create=(t,e)=>{return new q0({innerType:t,typeName:it.ZodOptional,...dt(e)})};class X0 extends Et{_parse(t){if(this._getType(t)===Y.null)return n0(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}X0.create=(t,e)=>{return new X0({innerType:t,typeName:it.ZodNullable,...dt(e)})};class Aa extends Et{_parse(t){let{ctx:e}=this._processInputParams(t),s=e.data;if(e.parsedType===Y.undefined)s=this._def.defaultValue();return this._def.innerType._parse({data:s,path:e.path,parent:e})}removeDefault(){return this._def.innerType}}Aa.create=(t,e)=>{return new Aa({innerType:t,typeName:it.ZodDefault,defaultValue:typeof e.default==="function"?e.default:()=>e.default,...dt(e)})};class Za extends Et{_parse(t){let{ctx:e}=this._processInputParams(t),s={...e,common:{...e.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});if(Is(r))return r.then((a)=>{return{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T0(s.common.issues)},input:s.data})}});else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new T0(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Za.create=(t,e)=>{return new Za({innerType:t,typeName:it.ZodCatch,catchValue:typeof e.catch==="function"?e.catch:()=>e.catch,...dt(e)})};class Ms extends Et{_parse(t){if(this._getType(t)!==Y.nan){let e=this._getOrReturnCtx(t);return G(e,{code:w.invalid_type,expected:Y.nan,received:e.parsedType}),nt}return{status:"valid",value:t.data}}}Ms.create=(t)=>{return new Ms({typeName:it.ZodNaN,...dt(t)})};var k9=Symbol("zod_brand");class Zn extends Et{_parse(t){let{ctx:e}=this._processInputParams(t),s=e.data;return this._def.type._parse({data:s,path:e.path,parent:e})}unwrap(){return this._def.type}}class tr extends Et{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});if(r.status==="aborted")return nt;if(r.status==="dirty")return e.dirty(),pa(r.value);else return this._def.out._parseAsync({data:r.value,path:s.path,parent:s})})();else{let r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});if(r.status==="aborted")return nt;if(r.status==="dirty")return e.dirty(),{status:"dirty",value:r.value};else return this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(t,e){return new tr({in:t,out:e,typeName:it.ZodPipeline})}}class Fa extends Et{_parse(t){let e=this._def.innerType._parse(t),s=(r)=>{if(Fe(r))r.value=Object.freeze(r.value);return r};return Is(e)?e.then((r)=>s(r)):s(e)}unwrap(){return this._def.innerType}}Fa.create=(t,e)=>{return new Fa({innerType:t,typeName:it.ZodReadonly,...dt(e)})};var R9={object:_t.lazycreate},it;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(it||(it={}));var x9=H0.create,C9=Me.create,I9=Ms.create,v9=Pe.create,g9=vs.create,b9=ka.create,A9=gs.create,Z9=Ra.create,F9=xa.create,M9=bs.create,P9=he.create,L9=U0.create,j9=As.create,q9=j0.create,_9=_t.create,D9=_t.strictCreate,B9=Ca.create,V9=An.create,N9=Ia.create,w9=G0.create,K9=Zs.create,H9=Fs.create,O9=Le.create,U9=ua.create,G9=va.create,W9=ga.create,z9=oe.create,Q9=ba.create,J9=je.create,Y9=_0.create,X9=q0.create,$9=X0.create,tR=_0.createWithPreprocess,eR=tr.create,Po={};le(Po,{version:()=>Oc,util:()=>ft,treeifyError:()=>Uo,toJSONSchema:()=>Dd,toDotPath:()=>Go,safeParseAsync:()=>wn,safeParse:()=>Vn,registry:()=>s3,regexes:()=>Kn,prettifyError:()=>Wo,parseAsync:()=>qs,parse:()=>js,locales:()=>a3,isValidJWT:()=>m6,isValidBase64URL:()=>y6,isValidBase64:()=>Wn,globalRegistry:()=>ie,globalConfig:()=>Ps,function:()=>_d,formatError:()=>qn,flattenError:()=>jn,config:()=>r0,clone:()=>F0,_xid:()=>E3,_void:()=>Rd,_uuidv7:()=>o3,_uuidv6:()=>h3,_uuidv4:()=>i3,_uuid:()=>n3,_url:()=>c3,_uppercase:()=>A3,_unknown:()=>Bs,_union:()=>ES,_undefined:()=>Sd,_ulid:()=>m3,_uint64:()=>Ed,_uint32:()=>cd,_tuple:()=>Fd,_trim:()=>j3,_transform:()=>IS,_toUpperCase:()=>_3,_toLowerCase:()=>q3,_templateLiteral:()=>LS,_symbol:()=>ud,_success:()=>ZS,_stringbool:()=>jd,_stringFormat:()=>qd,_string:()=>J6,_startsWith:()=>F3,_size:()=>v3,_set:()=>kS,_safeParseAsync:()=>Nn,_safeParse:()=>Bn,_regex:()=>g3,_refine:()=>Ld,_record:()=>fS,_readonly:()=>PS,_property:()=>Zd,_promise:()=>qS,_positive:()=>vd,_pipe:()=>MS,_parseAsync:()=>Dn,_parse:()=>_n,_overwrite:()=>ue,_optional:()=>vS,_number:()=>sd,_nullable:()=>gS,_null:()=>fd,_normalize:()=>L3,_nonpositive:()=>bd,_nonoptional:()=>AS,_nonnegative:()=>Ad,_never:()=>kd,_negative:()=>gd,_nativeEnum:()=>xS,_nanoid:()=>y3,_nan:()=>Id,_multipleOf:()=>La,_minSize:()=>ja,_minLength:()=>_e,_min:()=>d0,_mime:()=>P3,_maxSize:()=>hr,_maxLength:()=>or,_max:()=>g0,_map:()=>TS,_lte:()=>g0,_lt:()=>de,_lowercase:()=>b3,_literal:()=>CS,_length:()=>cr,_lazy:()=>jS,_ksuid:()=>u3,_jwt:()=>I3,_isoTime:()=>ed,_isoDuration:()=>ad,_isoDateTime:()=>$6,_isoDate:()=>td,_ipv6:()=>f3,_ipv4:()=>S3,_intersection:()=>SS,_int64:()=>md,_int32:()=>od,_int:()=>nd,_includes:()=>Z3,_guid:()=>Ds,_gte:()=>d0,_gt:()=>ye,_float64:()=>hd,_float32:()=>id,_file:()=>Md,_enum:()=>RS,_endsWith:()=>M3,_emoji:()=>d3,_email:()=>r3,_e164:()=>C3,_discriminatedUnion:()=>uS,_default:()=>bS,_date:()=>xd,_custom:()=>Pd,_cuid2:()=>p3,_cuid:()=>l3,_coercedString:()=>Y6,_coercedNumber:()=>rd,_coercedDate:()=>Cd,_coercedBoolean:()=>yd,_coercedBigint:()=>pd,_cidrv6:()=>k3,_cidrv4:()=>T3,_catch:()=>FS,_boolean:()=>dd,_bigint:()=>ld,_base64url:()=>x3,_base64:()=>R3,_array:()=>D3,_any:()=>Td,TimePrecision:()=>X6,NEVER:()=>Lo,JSONSchemaGenerator:()=>Vs,JSONSchema:()=>_S,Doc:()=>Gn,$output:()=>z6,$input:()=>Q6,$constructor:()=>Z,$brand:()=>jo,$ZodXID:()=>t6,$ZodVoid:()=>I6,$ZodUnknown:()=>_s,$ZodUnion:()=>$n,$ZodUndefined:()=>k6,$ZodUUID:()=>Gc,$ZodURL:()=>zc,$ZodULID:()=>$c,$ZodType:()=>ct,$ZodTuple:()=>nr,$ZodTransform:()=>t3,$ZodTemplateLiteral:()=>H6,$ZodSymbol:()=>T6,$ZodSuccess:()=>V6,$ZodStringFormat:()=>gt,$ZodString:()=>Na,$ZodSet:()=>F6,$ZodRegistry:()=>ir,$ZodRecord:()=>A6,$ZodRealError:()=>Ba,$ZodReadonly:()=>K6,$ZodPromise:()=>O6,$ZodPrefault:()=>D6,$ZodPipe:()=>e3,$ZodOptional:()=>j6,$ZodObject:()=>Xn,$ZodNumberFormat:()=>S6,$ZodNumber:()=>zn,$ZodNullable:()=>q6,$ZodNull:()=>R6,$ZodNonOptional:()=>B6,$ZodNever:()=>C6,$ZodNanoID:()=>Jc,$ZodNaN:()=>w6,$ZodMap:()=>Z6,$ZodLiteral:()=>P6,$ZodLazy:()=>U6,$ZodKSUID:()=>e6,$ZodJWT:()=>E6,$ZodIntersection:()=>b6,$ZodISOTime:()=>r6,$ZodISODuration:()=>n6,$ZodISODateTime:()=>a6,$ZodISODate:()=>s6,$ZodIPv6:()=>h6,$ZodIPv4:()=>i6,$ZodGUID:()=>Uc,$ZodFunction:()=>B3,$ZodFile:()=>L6,$ZodError:()=>Ln,$ZodEnum:()=>M6,$ZodEmoji:()=>Qc,$ZodEmail:()=>Wc,$ZodE164:()=>p6,$ZodDiscriminatedUnion:()=>g6,$ZodDefault:()=>_6,$ZodDate:()=>v6,$ZodCustomStringFormat:()=>u6,$ZodCustom:()=>G6,$ZodCheckUpperCase:()=>Dc,$ZodCheckStringFormat:()=>Va,$ZodCheckStartsWith:()=>Vc,$ZodCheckSizeEquals:()=>Mc,$ZodCheckRegex:()=>qc,$ZodCheckProperty:()=>wc,$ZodCheckOverwrite:()=>Hc,$ZodCheckNumberFormat:()=>bc,$ZodCheckMultipleOf:()=>gc,$ZodCheckMinSize:()=>Fc,$ZodCheckMinLength:()=>Lc,$ZodCheckMimeType:()=>Kc,$ZodCheckMaxSize:()=>Zc,$ZodCheckMaxLength:()=>Pc,$ZodCheckLowerCase:()=>_c,$ZodCheckLessThan:()=>On,$ZodCheckLengthEquals:()=>jc,$ZodCheckIncludes:()=>Bc,$ZodCheckGreaterThan:()=>Un,$ZodCheckEndsWith:()=>Nc,$ZodCheckBigIntFormat:()=>Ac,$ZodCheck:()=>Bt,$ZodCatch:()=>N6,$ZodCUID2:()=>Xc,$ZodCUID:()=>Yc,$ZodCIDRv6:()=>c6,$ZodCIDRv4:()=>o6,$ZodBoolean:()=>Qn,$ZodBigIntFormat:()=>f6,$ZodBigInt:()=>Jn,$ZodBase64URL:()=>l6,$ZodBase64:()=>d6,$ZodAsyncError:()=>ce,$ZodArray:()=>Yn,$ZodAny:()=>x6});var Lo=Object.freeze({status:"aborted"});function Z(t,e,s){function r(h,o){var c;Object.defineProperty(h,"_zod",{value:h._zod??{},enumerable:!1}),(c=h._zod).traits??(c.traits=new Set),h._zod.traits.add(t),e(h,o);for(let m in i.prototype)if(!(m in h))Object.defineProperty(h,m,{value:i.prototype[m].bind(h)});h._zod.constr=i,h._zod.def=o}let a=s?.Parent??Object;class n extends a{}Object.defineProperty(n,"name",{value:t});function i(h){var o;let c=s?.Parent?new n:this;r(c,h),(o=c._zod).deferred??(o.deferred=[]);for(let m of c._zod.deferred)m();return c}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:(h)=>{if(s?.Parent&&h instanceof s.Parent)return!0;return h?._zod?.traits?.has(t)}}),Object.defineProperty(i,"name",{value:t}),i}var jo=Symbol("zod_brand");class ce extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Ps={};function r0(t){if(t)Object.assign(Ps,t);return Ps}var ft={};le(ft,{unwrapMessage:()=>ma,stringifyPrimitive:()=>yt,required:()=>ME,randomString:()=>xE,propertyKeyTypes:()=>Ls,promiseAllObject:()=>RE,primitiveTypes:()=>Bo,prefixIssues:()=>f0,pick:()=>gE,partial:()=>FE,optionalKeys:()=>Vo,omit:()=>bE,numKeys:()=>CE,nullish:()=>me,normalizeParams:()=>H,merge:()=>ZE,jsonStringifyReplacer:()=>qo,joinValues:()=>U,issue:()=>Ko,isPlainObject:()=>Pa,isObject:()=>Ma,getSizableOrigin:()=>sr,getParsedType:()=>IE,getLengthableOrigin:()=>rr,getEnumValues:()=>Fn,getElementAtPath:()=>kE,floatSafeRemainder:()=>_o,finalizeIssue:()=>A0,extend:()=>AE,escapeRegex:()=>Ee,esc:()=>ve,defineLazy:()=>Ct,createTransparentProxy:()=>vE,clone:()=>F0,cleanRegex:()=>ar,cleanEnum:()=>PE,captureStackTrace:()=>Pn,cached:()=>er,assignProp:()=>Mn,assertNotEqual:()=>uE,assertNever:()=>fE,assertIs:()=>SE,assertEqual:()=>EE,assert:()=>TE,allowsEval:()=>Do,aborted:()=>Ze,NUMBER_FORMAT_RANGES:()=>No,Class:()=>Ho,BIGINT_FORMAT_RANGES:()=>wo});function EE(t){return t}function uE(t){return t}function SE(t){}function fE(t){throw Error()}function TE(t){}function Fn(t){let e=Object.values(t).filter((s)=>typeof s==="number");return Object.entries(t).filter(([s,r])=>e.indexOf(+s)===-1).map(([s,r])=>r)}function U(t,e="|"){return t.map((s)=>yt(s)).join(e)}function qo(t,e){if(typeof e==="bigint")return e.toString();return e}function er(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function me(t){return t===null||t===void 0}function ar(t){let e=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;return t.slice(e,s)}function _o(t,e){let s=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=s>r?s:r,n=Number.parseInt(t.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}function Ct(t,e,s){Object.defineProperty(t,e,{get(){{let r=s();return t[e]=r,r}throw Error("cached value already set")},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function Mn(t,e,s){Object.defineProperty(t,e,{value:s,writable:!0,enumerable:!0,configurable:!0})}function kE(t,e){if(!e)return t;return e.reduce((s,r)=>s?.[r],t)}function RE(t){let e=Object.keys(t),s=e.map((r)=>t[r]);return Promise.all(s).then((r)=>{let a={};for(let n=0;n<e.length;n++)a[e[n]]=r[n];return a})}function xE(t=10){let e="";for(let s=0;s<t;s++)e+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return e}function ve(t){return JSON.stringify(t)}var Pn=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};function Ma(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var Do=er(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(t){return!1}});function Pa(t){if(Ma(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let s=e.prototype;if(Ma(s)===!1)return!1;if(Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)return!1;return!0}function CE(t){let e=0;for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s))e++;return e}var IE=(t)=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(t))return"array";if(t===null)return"null";if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return"promise";if(typeof Map<"u"&&t instanceof Map)return"map";if(typeof Set<"u"&&t instanceof Set)return"set";if(typeof Date<"u"&&t instanceof Date)return"date";if(typeof File<"u"&&t instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${e}`)}},Ls=new Set(["string","number","symbol"]),Bo=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ee(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F0(t,e,s){let r=new t._zod.constr(e??t._zod.def);if(!e||s?.parent)r._zod.parent=t;return r}function H(t){let e=t;if(!e)return{};if(typeof e==="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}if(delete e.message,typeof e.error==="string")return{...e,error:()=>e.error};return e}function vE(t){let e;return new Proxy({},{get(s,r,a){return e??(e=t()),Reflect.get(e,r,a)},set(s,r,a,n){return e??(e=t()),Reflect.set(e,r,a,n)},has(s,r){return e??(e=t()),Reflect.has(e,r)},deleteProperty(s,r){return e??(e=t()),Reflect.deleteProperty(e,r)},ownKeys(s){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(s,r){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,r)},defineProperty(s,r,a){return e??(e=t()),Reflect.defineProperty(e,r,a)}})}function yt(t){if(typeof t==="bigint")return t.toString()+"n";if(typeof t==="string")return`"${t}"`;return`${t}`}function Vo(t){return Object.keys(t).filter((e)=>{return t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional"})}var No={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function gE(t,e){let s={},r=t._zod.def;for(let a in e){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);if(!e[a])continue;s[a]=r.shape[a]}return F0(t,{...t._zod.def,shape:s,checks:[]})}function bE(t,e){let s={...t._zod.def.shape},r=t._zod.def;for(let a in e){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);if(!e[a])continue;delete s[a]}return F0(t,{...t._zod.def,shape:s,checks:[]})}function AE(t,e){if(!Pa(e))throw Error("Invalid input to extend: expected a plain object");let s={...t._zod.def,get shape(){let r={...t._zod.def.shape,...e};return Mn(this,"shape",r),r},checks:[]};return F0(t,s)}function ZE(t,e){return F0(t,{...t._zod.def,get shape(){let s={...t._zod.def.shape,...e._zod.def.shape};return Mn(this,"shape",s),s},catchall:e._zod.def.catchall,checks:[]})}function FE(t,e,s){let r=e._zod.def.shape,a={...r};if(s)for(let n in s){if(!(n in r))throw Error(`Unrecognized key: "${n}"`);if(!s[n])continue;a[n]=t?new t({type:"optional",innerType:r[n]}):r[n]}else for(let n in r)a[n]=t?new t({type:"optional",innerType:r[n]}):r[n];return F0(e,{...e._zod.def,shape:a,checks:[]})}function ME(t,e,s){let r=e._zod.def.shape,a={...r};if(s)for(let n in s){if(!(n in a))throw Error(`Unrecognized key: "${n}"`);if(!s[n])continue;a[n]=new t({type:"nonoptional",innerType:r[n]})}else for(let n in r)a[n]=new t({type:"nonoptional",innerType:r[n]});return F0(e,{...e._zod.def,shape:a,checks:[]})}function Ze(t,e=0){for(let s=e;s<t.issues.length;s++)if(t.issues[s]?.continue!==!0)return!0;return!1}function f0(t,e){return e.map((s)=>{var r;return(r=s).path??(r.path=[]),s.path.unshift(t),s})}function ma(t){return typeof t==="string"?t:t?.message}function A0(t,e,s){let r={...t,path:t.path??[]};if(!t.message){let a=ma(t.inst?._zod.def?.error?.(t))??ma(e?.error?.(t))??ma(s.customError?.(t))??ma(s.localeError?.(t))??"Invalid input";r.message=a}if(delete r.inst,delete r.continue,!e?.reportInput)delete r.input;return r}function sr(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map";if(t instanceof File)return"file";return"unknown"}function rr(t){if(Array.isArray(t))return"array";if(typeof t==="string")return"string";return"unknown"}function Ko(...t){let[e,s,r]=t;if(typeof e==="string")return{message:e,code:"custom",input:s,inst:r};return{...e}}function PE(t){return Object.entries(t).filter(([e,s])=>{return Number.isNaN(Number.parseInt(e,10))}).map((e)=>e[1])}class Ho{constructor(...t){}}var Oo=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,qo,2)},enumerable:!0})},Ln=Z("$ZodError",Oo),Ba=Z("$ZodError",Oo,{Parent:Error});function jn(t,e=(s)=>s.message){let s={},r=[];for(let a of t.issues)if(a.path.length>0)s[a.path[0]]=s[a.path[0]]||[],s[a.path[0]].push(e(a));else r.push(e(a));return{formErrors:r,fieldErrors:s}}function qn(t,e){let s=e||function(n){return n.message},r={_errors:[]},a=(n)=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((h)=>a({issues:h}));else if(i.code==="invalid_key")a({issues:i.issues});else if(i.code==="invalid_element")a({issues:i.issues});else if(i.path.length===0)r._errors.push(s(i));else{let h=r,o=0;while(o<i.path.length){let c=i.path[o];if(o!==i.path.length-1)h[c]=h[c]||{_errors:[]};else h[c]=h[c]||{_errors:[]},h[c]._errors.push(s(i));h=h[c],o++}}};return a(t),r}function Uo(t,e){let s=e||function(n){return n.message},r={errors:[]},a=(n,i=[])=>{var h,o;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((m)=>a({issues:m},c.path));else if(c.code==="invalid_key")a({issues:c.issues},c.path);else if(c.code==="invalid_element")a({issues:c.issues},c.path);else{let m=[...i,...c.path];if(m.length===0){r.errors.push(s(c));continue}let u=r,p=0;while(p<m.length){let k=m[p],C=p===m.length-1;if(typeof k==="string")u.properties??(u.properties={}),(h=u.properties)[k]??(h[k]={errors:[]}),u=u.properties[k];else u.items??(u.items=[]),(o=u.items)[k]??(o[k]={errors:[]}),u=u.items[k];if(C)u.errors.push(s(c));p++}}};return a(t),r}function Go(t){let e=[];for(let s of t)if(typeof s==="number")e.push(`[${s}]`);else if(typeof s==="symbol")e.push(`[${JSON.stringify(String(s))}]`);else if(/[^\w$]/.test(s))e.push(`[${JSON.stringify(s)}]`);else{if(e.length)e.push(".");e.push(s)}return e.join("")}function Wo(t){let e=[],s=[...t.issues].sort((r,a)=>r.path.length-a.path.length);for(let r of s)if(e.push(`✖ ${r.message}`),r.path?.length)e.push(` → at ${Go(r.path)}`);return e.join(`
58
+ `)}var _n=(t)=>(e,s,r,a)=>{let n=r?Object.assign(r,{async:!1}):{async:!1},i=e._zod.run({value:s,issues:[]},n);if(i instanceof Promise)throw new ce;if(i.issues.length){let h=new(a?.Err??t)(i.issues.map((o)=>A0(o,n,r0())));throw Pn(h,a?.callee),h}return i.value},js=_n(Ba),Dn=(t)=>async(e,s,r,a)=>{let n=r?Object.assign(r,{async:!0}):{async:!0},i=e._zod.run({value:s,issues:[]},n);if(i instanceof Promise)i=await i;if(i.issues.length){let h=new(a?.Err??t)(i.issues.map((o)=>A0(o,n,r0())));throw Pn(h,a?.callee),h}return i.value},qs=Dn(Ba),Bn=(t)=>(e,s,r)=>{let a=r?{...r,async:!1}:{async:!1},n=e._zod.run({value:s,issues:[]},a);if(n instanceof Promise)throw new ce;return n.issues.length?{success:!1,error:new(t??Ln)(n.issues.map((i)=>A0(i,a,r0())))}:{success:!0,data:n.value}},Vn=Bn(Ba),Nn=(t)=>async(e,s,r)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},n=e._zod.run({value:s,issues:[]},a);if(n instanceof Promise)n=await n;return n.issues.length?{success:!1,error:new t(n.issues.map((i)=>A0(i,a,r0())))}:{success:!0,data:n.value}},wn=Nn(Ba),Kn={};le(Kn,{xid:()=>Yo,uuid7:()=>_E,uuid6:()=>qE,uuid4:()=>jE,uuid:()=>qe,uppercase:()=>Ic,unicodeEmail:()=>VE,undefined:()=>xc,ulid:()=>Jo,time:()=>mc,string:()=>uc,rfc5322Email:()=>BE,number:()=>Tc,null:()=>Rc,nanoid:()=>$o,lowercase:()=>Cc,ksuid:()=>Xo,ipv6:()=>nc,ipv4:()=>rc,integer:()=>fc,html5Email:()=>DE,hostname:()=>cc,guid:()=>ec,extendedDuration:()=>LE,emoji:()=>sc,email:()=>ac,e164:()=>dc,duration:()=>tc,domain:()=>KE,datetime:()=>Ec,date:()=>lc,cuid2:()=>Qo,cuid:()=>zo,cidrv6:()=>hc,cidrv4:()=>ic,browserEmail:()=>NE,boolean:()=>kc,bigint:()=>Sc,base64url:()=>Hn,base64:()=>oc,_emoji:()=>wE});var zo=/^[cC][^\s-]{8,}$/,Qo=/^[0-9a-z]+$/,Jo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Yo=/^[0-9a-vA-V]{20}$/,Xo=/^[A-Za-z0-9]{27}$/,$o=/^[a-zA-Z0-9_-]{21}$/,tc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,LE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ec=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qe=(t)=>{if(!t)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},jE=qe(4),qE=qe(6),_E=qe(7),ac=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,DE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,BE=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,VE=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,NE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,wE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function sc(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var rc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,ic=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hn=/^[A-Za-z0-9_-]*$/,cc=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,KE=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,dc=/^\+(?:[0-9]){6,14}[0-9]$/,yc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",lc=new RegExp(`^${yc}$`);function pc(t){return typeof t.precision==="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function mc(t){return new RegExp(`^${pc(t)}$`)}function Ec(t){let e=pc({precision:t.precision}),s=["Z"];if(t.local)s.push("");if(t.offset)s.push("([+-]\\d{2}:\\d{2})");let r=`${e}(?:${s.join("|")})`;return new RegExp(`^${yc}T(?:${r})$`)}var uc=(t)=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Sc=/^\d+n?$/,fc=/^\d+$/,Tc=/^-?\d+(?:\.\d+)?/i,kc=/true|false/i,Rc=/null/i,xc=/undefined/i,Cc=/^[^A-Z]*$/,Ic=/^[^a-z]*$/,Bt=Z("$ZodCheck",(t,e)=>{var s;t._zod??(t._zod={}),t._zod.def=e,(s=t._zod).onattach??(s.onattach=[])}),vc={number:"number",bigint:"bigint",object:"date"},On=Z("$ZodCheckLessThan",(t,e)=>{Bt.init(t,e);let s=vc[typeof e.value];t._zod.onattach.push((r)=>{let a=r._zod.bag,n=(e.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(e.value<n)if(e.inclusive)a.maximum=e.value;else a.exclusiveMaximum=e.value}),t._zod.check=(r)=>{if(e.inclusive?r.value<=e.value:r.value<e.value)return;r.issues.push({origin:s,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Un=Z("$ZodCheckGreaterThan",(t,e)=>{Bt.init(t,e);let s=vc[typeof e.value];t._zod.onattach.push((r)=>{let a=r._zod.bag,n=(e.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(e.value>n)if(e.inclusive)a.minimum=e.value;else a.exclusiveMinimum=e.value}),t._zod.check=(r)=>{if(e.inclusive?r.value>=e.value:r.value>e.value)return;r.issues.push({origin:s,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),gc=Z("$ZodCheckMultipleOf",(t,e)=>{Bt.init(t,e),t._zod.onattach.push((s)=>{var r;(r=s._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=(s)=>{if(typeof s.value!==typeof e.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof s.value==="bigint"?s.value%e.value===BigInt(0):_o(s.value,e.value)===0)return;s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:e.value,input:s.value,inst:t,continue:!e.abort})}}),bc=Z("$ZodCheckNumberFormat",(t,e)=>{Bt.init(t,e),e.format=e.format||"float64";let s=e.format?.includes("int"),r=s?"int":"number",[a,n]=No[e.format];t._zod.onattach.push((i)=>{let h=i._zod.bag;if(h.format=e.format,h.minimum=a,h.maximum=n,s)h.pattern=fc}),t._zod.check=(i)=>{let h=i.value;if(s){if(!Number.isInteger(h)){i.issues.push({expected:r,format:e.format,code:"invalid_type",input:h,inst:t});return}if(!Number.isSafeInteger(h)){if(h>0)i.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});else i.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}if(h<a)i.issues.push({origin:"number",input:h,code:"too_small",minimum:a,inclusive:!0,inst:t,continue:!e.abort});if(h>n)i.issues.push({origin:"number",input:h,code:"too_big",maximum:n,inst:t})}}),Ac=Z("$ZodCheckBigIntFormat",(t,e)=>{Bt.init(t,e);let[s,r]=wo[e.format];t._zod.onattach.push((a)=>{let n=a._zod.bag;n.format=e.format,n.minimum=s,n.maximum=r}),t._zod.check=(a)=>{let n=a.value;if(n<s)a.issues.push({origin:"bigint",input:n,code:"too_small",minimum:s,inclusive:!0,inst:t,continue:!e.abort});if(n>r)a.issues.push({origin:"bigint",input:n,code:"too_big",maximum:r,inst:t})}}),Zc=Z("$ZodCheckMaxSize",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!me(r)&&r.size!==void 0},t._zod.onattach.push((s)=>{let r=s._zod.bag.maximum??Number.POSITIVE_INFINITY;if(e.maximum<r)s._zod.bag.maximum=e.maximum}),t._zod.check=(s)=>{let r=s.value;if(r.size<=e.maximum)return;s.issues.push({origin:sr(r),code:"too_big",maximum:e.maximum,input:r,inst:t,continue:!e.abort})}}),Fc=Z("$ZodCheckMinSize",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!me(r)&&r.size!==void 0},t._zod.onattach.push((s)=>{let r=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(e.minimum>r)s._zod.bag.minimum=e.minimum}),t._zod.check=(s)=>{let r=s.value;if(r.size>=e.minimum)return;s.issues.push({origin:sr(r),code:"too_small",minimum:e.minimum,input:r,inst:t,continue:!e.abort})}}),Mc=Z("$ZodCheckSizeEquals",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!me(r)&&r.size!==void 0},t._zod.onattach.push((s)=>{let r=s._zod.bag;r.minimum=e.size,r.maximum=e.size,r.size=e.size}),t._zod.check=(s)=>{let r=s.value,a=r.size;if(a===e.size)return;let n=a>e.size;s.issues.push({origin:sr(r),...n?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:s.value,inst:t,continue:!e.abort})}}),Pc=Z("$ZodCheckMaxLength",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!me(r)&&r.length!==void 0},t._zod.onattach.push((s)=>{let r=s._zod.bag.maximum??Number.POSITIVE_INFINITY;if(e.maximum<r)s._zod.bag.maximum=e.maximum}),t._zod.check=(s)=>{let r=s.value;if(r.length<=e.maximum)return;let a=rr(r);s.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Lc=Z("$ZodCheckMinLength",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!me(r)&&r.length!==void 0},t._zod.onattach.push((s)=>{let r=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(e.minimum>r)s._zod.bag.minimum=e.minimum}),t._zod.check=(s)=>{let r=s.value;if(r.length>=e.minimum)return;let a=rr(r);s.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),jc=Z("$ZodCheckLengthEquals",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!me(r)&&r.length!==void 0},t._zod.onattach.push((s)=>{let r=s._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=(s)=>{let r=s.value,a=r.length;if(a===e.length)return;let n=rr(r),i=a>e.length;s.issues.push({origin:n,...i?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:s.value,inst:t,continue:!e.abort})}}),Va=Z("$ZodCheckStringFormat",(t,e)=>{var s,r;if(Bt.init(t,e),t._zod.onattach.push((a)=>{let n=a._zod.bag;if(n.format=e.format,e.pattern)n.patterns??(n.patterns=new Set),n.patterns.add(e.pattern)}),e.pattern)(s=t._zod).check??(s.check=(a)=>{if(e.pattern.lastIndex=0,e.pattern.test(a.value))return;a.issues.push({origin:"string",code:"invalid_format",format:e.format,input:a.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})});else(r=t._zod).check??(r.check=()=>{})}),qc=Z("$ZodCheckRegex",(t,e)=>{Va.init(t,e),t._zod.check=(s)=>{if(e.pattern.lastIndex=0,e.pattern.test(s.value))return;s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),_c=Z("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Cc),Va.init(t,e)}),Dc=Z("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Ic),Va.init(t,e)}),Bc=Z("$ZodCheckIncludes",(t,e)=>{Bt.init(t,e);let s=Ee(e.includes),r=new RegExp(typeof e.position==="number"?`^.{${e.position}}${s}`:s);e.pattern=r,t._zod.onattach.push((a)=>{let n=a._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=(a)=>{if(a.value.includes(e.includes,e.position))return;a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:a.value,inst:t,continue:!e.abort})}}),Vc=Z("$ZodCheckStartsWith",(t,e)=>{Bt.init(t,e);let s=new RegExp(`^${Ee(e.prefix)}.*`);e.pattern??(e.pattern=s),t._zod.onattach.push((r)=>{let a=r._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(s)}),t._zod.check=(r)=>{if(r.value.startsWith(e.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Nc=Z("$ZodCheckEndsWith",(t,e)=>{Bt.init(t,e);let s=new RegExp(`.*${Ee(e.suffix)}$`);e.pattern??(e.pattern=s),t._zod.onattach.push((r)=>{let a=r._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(s)}),t._zod.check=(r)=>{if(r.value.endsWith(e.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}});function uh(t,e,s){if(t.issues.length)e.issues.push(...f0(s,t.issues))}var wc=Z("$ZodCheckProperty",(t,e)=>{Bt.init(t,e),t._zod.check=(s)=>{let r=e.schema._zod.run({value:s.value[e.property],issues:[]},{});if(r instanceof Promise)return r.then((a)=>uh(a,s,e.property));uh(r,s,e.property);return}}),Kc=Z("$ZodCheckMimeType",(t,e)=>{Bt.init(t,e);let s=new Set(e.mime);t._zod.onattach.push((r)=>{r._zod.bag.mime=e.mime}),t._zod.check=(r)=>{if(s.has(r.value.type))return;r.issues.push({code:"invalid_value",values:e.mime,input:r.value.type,inst:t})}}),Hc=Z("$ZodCheckOverwrite",(t,e)=>{Bt.init(t,e),t._zod.check=(s)=>{s.value=e.tx(s.value)}});class Gn{constructor(t=[]){if(this.content=[],this.indent=0,this)this.args=t}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t==="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let e=t.split(`
59
+ `).filter((a)=>a),s=Math.min(...e.map((a)=>a.length-a.trimStart().length)),r=e.map((a)=>a.slice(s)).map((a)=>" ".repeat(this.indent*2)+a);for(let a of r)this.content.push(a)}compile(){let t=Function,e=this?.args,s=[...(this?.content??[""]).map((r)=>` ${r}`)];return new t(...e,s.join(`
60
+ `))}}var Oc={major:4,minor:0,patch:0},ct=Z("$ZodType",(t,e)=>{var s;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Oc;let r=[...t._zod.def.checks??[]];if(t._zod.traits.has("$ZodCheck"))r.unshift(t);for(let a of r)for(let n of a._zod.onattach)n(t);if(r.length===0)(s=t._zod).deferred??(s.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let a=(n,i,h)=>{let o=Ze(n),c;for(let m of i){if(m._zod.when){if(!m._zod.when(n))continue}else if(o)continue;let u=n.issues.length,p=m._zod.check(n);if(p instanceof Promise&&h?.async===!1)throw new ce;if(c||p instanceof Promise)c=(c??Promise.resolve()).then(async()=>{if(await p,n.issues.length===u)return;if(!o)o=Ze(n,u)});else{if(n.issues.length===u)continue;if(!o)o=Ze(n,u)}}if(c)return c.then(()=>{return n});return n};t._zod.run=(n,i)=>{let h=t._zod.parse(n,i);if(h instanceof Promise){if(i.async===!1)throw new ce;return h.then((o)=>a(o,r,i))}return a(h,r,i)}}t["~standard"]={validate:(a)=>{try{let n=Vn(t,a);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return wn(t,a).then((i)=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Na=Z("$ZodString",(t,e)=>{ct.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??uc(t._zod.bag),t._zod.parse=(s,r)=>{if(e.coerce)try{s.value=String(s.value)}catch(a){}if(typeof s.value==="string")return s;return s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:t}),s}}),gt=Z("$ZodStringFormat",(t,e)=>{Va.init(t,e),Na.init(t,e)}),Uc=Z("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=ec),gt.init(t,e)}),Gc=Z("$ZodUUID",(t,e)=>{if(e.version){let s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(s===void 0)throw Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=qe(s))}else e.pattern??(e.pattern=qe());gt.init(t,e)}),Wc=Z("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=ac),gt.init(t,e)}),zc=Z("$ZodURL",(t,e)=>{gt.init(t,e),t._zod.check=(s)=>{try{let r=s.value,a=new URL(r),n=a.href;if(e.hostname){if(e.hostname.lastIndex=0,!e.hostname.test(a.hostname))s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:cc.source,input:s.value,inst:t,continue:!e.abort})}if(e.protocol){if(e.protocol.lastIndex=0,!e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:s.value,inst:t,continue:!e.abort})}if(!r.endsWith("/")&&n.endsWith("/"))s.value=n.slice(0,-1);else s.value=n;return}catch(r){s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:t,continue:!e.abort})}}}),Qc=Z("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=sc()),gt.init(t,e)}),Jc=Z("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=$o),gt.init(t,e)}),Yc=Z("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=zo),gt.init(t,e)}),Xc=Z("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Qo),gt.init(t,e)}),$c=Z("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Jo),gt.init(t,e)}),t6=Z("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Yo),gt.init(t,e)}),e6=Z("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Xo),gt.init(t,e)}),a6=Z("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Ec(e)),gt.init(t,e)}),s6=Z("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=lc),gt.init(t,e)}),r6=Z("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=mc(e)),gt.init(t,e)}),n6=Z("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=tc),gt.init(t,e)}),i6=Z("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=rc),gt.init(t,e),t._zod.onattach.push((s)=>{let r=s._zod.bag;r.format="ipv4"})}),h6=Z("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=nc),gt.init(t,e),t._zod.onattach.push((s)=>{let r=s._zod.bag;r.format="ipv6"}),t._zod.check=(s)=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:t,continue:!e.abort})}}}),o6=Z("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=ic),gt.init(t,e)}),c6=Z("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=hc),gt.init(t,e),t._zod.check=(s)=>{let[r,a]=s.value.split("/");try{if(!a)throw Error();let n=Number(a);if(`${n}`!==a)throw Error();if(n<0||n>128)throw Error();new URL(`http://[${r}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:t,continue:!e.abort})}}});function Wn(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var d6=Z("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=oc),gt.init(t,e),t._zod.onattach.push((s)=>{s._zod.bag.contentEncoding="base64"}),t._zod.check=(s)=>{if(Wn(s.value))return;s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:t,continue:!e.abort})}});function y6(t){if(!Hn.test(t))return!1;let e=t.replace(/[-_]/g,(r)=>r==="-"?"+":"/"),s=e.padEnd(Math.ceil(e.length/4)*4,"=");return Wn(s)}var l6=Z("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Hn),gt.init(t,e),t._zod.onattach.push((s)=>{s._zod.bag.contentEncoding="base64url"}),t._zod.check=(s)=>{if(y6(s.value))return;s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:t,continue:!e.abort})}}),p6=Z("$ZodE164",(t,e)=>{e.pattern??(e.pattern=dc),gt.init(t,e)});function m6(t,e=null){try{let s=t.split(".");if(s.length!==3)return!1;let[r]=s;if(!r)return!1;let a=JSON.parse(atob(r));if("typ"in a&&a?.typ!=="JWT")return!1;if(!a.alg)return!1;if(e&&(!("alg"in a)||a.alg!==e))return!1;return!0}catch{return!1}}var E6=Z("$ZodJWT",(t,e)=>{gt.init(t,e),t._zod.check=(s)=>{if(m6(s.value,e.alg))return;s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:t,continue:!e.abort})}}),u6=Z("$ZodCustomStringFormat",(t,e)=>{gt.init(t,e),t._zod.check=(s)=>{if(e.fn(s.value))return;s.issues.push({code:"invalid_format",format:e.format,input:s.value,inst:t,continue:!e.abort})}}),zn=Z("$ZodNumber",(t,e)=>{ct.init(t,e),t._zod.pattern=t._zod.bag.pattern??Tc,t._zod.parse=(s,r)=>{if(e.coerce)try{s.value=Number(s.value)}catch(i){}let a=s.value;if(typeof a==="number"&&!Number.isNaN(a)&&Number.isFinite(a))return s;let n=typeof a==="number"?Number.isNaN(a)?"NaN":!Number.isFinite(a)?"Infinity":void 0:void 0;return s.issues.push({expected:"number",code:"invalid_type",input:a,inst:t,...n?{received:n}:{}}),s}}),S6=Z("$ZodNumber",(t,e)=>{bc.init(t,e),zn.init(t,e)}),Qn=Z("$ZodBoolean",(t,e)=>{ct.init(t,e),t._zod.pattern=kc,t._zod.parse=(s,r)=>{if(e.coerce)try{s.value=Boolean(s.value)}catch(n){}let a=s.value;if(typeof a==="boolean")return s;return s.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:t}),s}}),Jn=Z("$ZodBigInt",(t,e)=>{ct.init(t,e),t._zod.pattern=Sc,t._zod.parse=(s,r)=>{if(e.coerce)try{s.value=BigInt(s.value)}catch(a){}if(typeof s.value==="bigint")return s;return s.issues.push({expected:"bigint",code:"invalid_type",input:s.value,inst:t}),s}}),f6=Z("$ZodBigInt",(t,e)=>{Ac.init(t,e),Jn.init(t,e)}),T6=Z("$ZodSymbol",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=s.value;if(typeof a==="symbol")return s;return s.issues.push({expected:"symbol",code:"invalid_type",input:a,inst:t}),s}}),k6=Z("$ZodUndefined",(t,e)=>{ct.init(t,e),t._zod.pattern=xc,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(s,r)=>{let a=s.value;if(typeof a>"u")return s;return s.issues.push({expected:"undefined",code:"invalid_type",input:a,inst:t}),s}}),R6=Z("$ZodNull",(t,e)=>{ct.init(t,e),t._zod.pattern=Rc,t._zod.values=new Set([null]),t._zod.parse=(s,r)=>{let a=s.value;if(a===null)return s;return s.issues.push({expected:"null",code:"invalid_type",input:a,inst:t}),s}}),x6=Z("$ZodAny",(t,e)=>{ct.init(t,e),t._zod.parse=(s)=>s}),_s=Z("$ZodUnknown",(t,e)=>{ct.init(t,e),t._zod.parse=(s)=>s}),C6=Z("$ZodNever",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{return s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:t}),s}}),I6=Z("$ZodVoid",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=s.value;if(typeof a>"u")return s;return s.issues.push({expected:"void",code:"invalid_type",input:a,inst:t}),s}}),v6=Z("$ZodDate",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{if(e.coerce)try{s.value=new Date(s.value)}catch(i){}let a=s.value,n=a instanceof Date;if(n&&!Number.isNaN(a.getTime()))return s;return s.issues.push({expected:"date",code:"invalid_type",input:a,...n?{received:"Invalid Date"}:{},inst:t}),s}});function Sh(t,e,s){if(t.issues.length)e.issues.push(...f0(s,t.issues));e.value[s]=t.value}var Yn=Z("$ZodArray",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=s.value;if(!Array.isArray(a))return s.issues.push({expected:"array",code:"invalid_type",input:a,inst:t}),s;s.value=Array(a.length);let n=[];for(let i=0;i<a.length;i++){let h=a[i],o=e.element._zod.run({value:h,issues:[]},r);if(o instanceof Promise)n.push(o.then((c)=>Sh(c,s,i)));else Sh(o,s,i)}if(n.length)return Promise.all(n).then(()=>s);return s}});function ys(t,e,s){if(t.issues.length)e.issues.push(...f0(s,t.issues));e.value[s]=t.value}function fh(t,e,s,r){if(t.issues.length)if(r[s]===void 0)if(s in r)e.value[s]=void 0;else e.value[s]=t.value;else e.issues.push(...f0(s,t.issues));else if(t.value===void 0){if(s in r)e.value[s]=void 0}else e.value[s]=t.value}var Xn=Z("$ZodObject",(t,e)=>{ct.init(t,e);let s=er(()=>{let m=Object.keys(e.shape);for(let p of m)if(!(e.shape[p]instanceof ct))throw Error(`Invalid element at key "${p}": expected a Zod schema`);let u=Vo(e.shape);return{shape:e.shape,keys:m,keySet:new Set(m),numKeys:m.length,optionalKeys:new Set(u)}});Ct(t._zod,"propValues",()=>{let m=e.shape,u={};for(let p in m){let k=m[p]._zod;if(k.values){u[p]??(u[p]=new Set);for(let C of k.values)u[p].add(C)}}return u});let r=(m)=>{let u=new Gn(["shape","payload","ctx"]),p=s.value,k=(d)=>{let E=ve(d);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};u.write("const input = payload.value;");let C=Object.create(null),I=0;for(let d of p.keys)C[d]=`key_${I++}`;u.write("const newResult = {}");for(let d of p.keys)if(p.optionalKeys.has(d)){let E=C[d];u.write(`const ${E} = ${k(d)};`);let y=ve(d);u.write(`
61
+ if (${E}.issues.length) {
62
+ if (input[${y}] === undefined) {
63
+ if (${y} in input) {
64
+ newResult[${y}] = undefined;
65
65
  }
66
66
  } else {
67
67
  payload.issues = payload.issues.concat(
68
- ${a}.issues.map((iss) => ({
68
+ ${E}.issues.map((iss) => ({
69
69
  ...iss,
70
- path: iss.path ? [${R}, ...iss.path] : [${R}],
70
+ path: iss.path ? [${y}, ...iss.path] : [${y}],
71
71
  }))
72
72
  );
73
73
  }
74
- } else if (${a}.value === undefined) {
75
- if (${R} in input) newResult[${R}] = undefined;
74
+ } else if (${E}.value === undefined) {
75
+ if (${y} in input) newResult[${y}] = undefined;
76
76
  } else {
77
- newResult[${R}] = ${a}.value;
77
+ newResult[${y}] = ${E}.value;
78
78
  }
79
- `)}else{let a=v[m];o.write(`const ${a} = ${i(m)};`),o.write(`
80
- if (${a}.issues.length) payload.issues = payload.issues.concat(${a}.issues.map(iss => ({
79
+ `)}else{let E=C[d];u.write(`const ${E} = ${k(d)};`),u.write(`
80
+ if (${E}.issues.length) payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
81
81
  ...iss,
82
- path: iss.path ? [${A6(m)}, ...iss.path] : [${A6(m)}]
83
- })));`),o.write(`newResult[${A6(m)}] = ${a}.value`)}o.write("payload.value = newResult;"),o.write("return payload;");let t=o.compile();return(m,a)=>t(k,m,a)},d,S=l4,c=!P8.jitless,n=c&&jS.value,r=y.catchall,T;E._zod.parse=(k,o)=>{T??(T=p.value);let u=k.value;if(!S(u))return k.issues.push({expected:"object",code:"invalid_type",input:u,inst:E}),k;let i=[];if(c&&n&&o?.async===!1&&o.jitless!==!0){if(!d)d=h(y.shape);k=d(k,o)}else{k.value={};let a=T.shape;for(let R of T.keys){let f=a[R],I=f._zod.run({value:u[R],issues:[]},o),x=f._zod.optin==="optional"&&f._zod.optout==="optional";if(I instanceof Promise)i.push(I.then((Z)=>x?Ch(Z,k,R,u):R8(Z,k,R)));else if(x)Ch(I,k,R,u);else R8(I,k,R)}}if(!r)return i.length?Promise.all(i).then(()=>k):k;let v=[],F=T.keySet,t=r._zod,m=t.def.type;for(let a of Object.keys(u)){if(F.has(a))continue;if(m==="never"){v.push(a);continue}let R=t.run({value:u[a],issues:[]},o);if(R instanceof Promise)i.push(R.then((f)=>R8(f,k,a)));else R8(R,k,a)}if(v.length)k.issues.push({code:"unrecognized_keys",keys:v,input:u,inst:E});if(!i.length)return k;return Promise.all(i).then(()=>{return k})}});function oh(E,y,p,h){for(let d of E)if(d.issues.length===0)return y.value=d.value,y;return y.issues.push({code:"invalid_union",input:y.value,inst:p,errors:E.map((d)=>d.issues.map((S)=>b3(S,h,h3())))}),y}var Xy=e("$ZodUnion",(E,y)=>{T0.init(E,y),v0(E._zod,"optin",()=>y.options.some((p)=>p._zod.optin==="optional")?"optional":void 0),v0(E._zod,"optout",()=>y.options.some((p)=>p._zod.optout==="optional")?"optional":void 0),v0(E._zod,"values",()=>{if(y.options.every((p)=>p._zod.values))return new Set(y.options.flatMap((p)=>Array.from(p._zod.values)));return}),v0(E._zod,"pattern",()=>{if(y.options.every((p)=>p._zod.pattern)){let p=y.options.map((h)=>h._zod.pattern);return new RegExp(`^(${p.map((h)=>dE(h.source)).join("|")})$`)}return}),E._zod.parse=(p,h)=>{let d=!1,S=[];for(let c of y.options){let n=c._zod.run({value:p.value,issues:[]},h);if(n instanceof Promise)S.push(n),d=!0;else{if(n.issues.length===0)return n;S.push(n)}}if(!d)return oh(S,p,E,h);return Promise.all(S).then((c)=>{return oh(c,p,E,h)})}}),v9=e("$ZodDiscriminatedUnion",(E,y)=>{Xy.init(E,y);let p=E._zod.parse;v0(E._zod,"propValues",()=>{let d={};for(let S of y.options){let c=S._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${y.options.indexOf(S)}"`);for(let[n,r]of Object.entries(c)){if(!d[n])d[n]=new Set;for(let T of r)d[n].add(T)}}return d});let h=yE(()=>{let d=y.options,S=new Map;for(let c of d){let n=c._zod.propValues[y.discriminator];if(!n||n.size===0)throw Error(`Invalid discriminated union option at index "${y.options.indexOf(c)}"`);for(let r of n){if(S.has(r))throw Error(`Duplicate discriminator value "${String(r)}"`);S.set(r,c)}}return S});E._zod.parse=(d,S)=>{let c=d.value;if(!l4(c))return d.issues.push({code:"invalid_type",expected:"object",input:c,inst:E}),d;let n=h.value.get(c?.[y.discriminator]);if(n)return n._zod.run(d,S);if(y.unionFallback)return p(d,S);return d.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[y.discriminator],inst:E}),d}}),F9=e("$ZodIntersection",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=p.value,S=y.left._zod.run({value:d,issues:[]},h),c=y.right._zod.run({value:d,issues:[]},h);if(S instanceof Promise||c instanceof Promise)return Promise.all([S,c]).then(([n,r])=>{return xh(p,n,r)});return xh(p,S,c)}});function zE(E,y){if(E===y)return{valid:!0,data:E};if(E instanceof Date&&y instanceof Date&&+E===+y)return{valid:!0,data:E};if(P4(E)&&P4(y)){let p=Object.keys(y),h=Object.keys(E).filter((S)=>p.indexOf(S)!==-1),d={...E,...y};for(let S of h){let c=zE(E[S],y[S]);if(!c.valid)return{valid:!1,mergeErrorPath:[S,...c.mergeErrorPath]};d[S]=c.data}return{valid:!0,data:d}}if(Array.isArray(E)&&Array.isArray(y)){if(E.length!==y.length)return{valid:!1,mergeErrorPath:[]};let p=[];for(let h=0;h<E.length;h++){let d=E[h],S=y[h],c=zE(d,S);if(!c.valid)return{valid:!1,mergeErrorPath:[h,...c.mergeErrorPath]};p.push(c.data)}return{valid:!0,data:p}}return{valid:!1,mergeErrorPath:[]}}function xh(E,y,p){if(y.issues.length)E.issues.push(...y.issues);if(p.issues.length)E.issues.push(...p.issues);if(e6(E))return E;let h=zE(y.value,p.value);if(!h.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(h.mergeErrorPath)}`);return E.value=h.data,E}var SE=e("$ZodTuple",(E,y)=>{T0.init(E,y);let p=y.items,h=p.length-[...p].reverse().findIndex((d)=>d._zod.optin!=="optional");E._zod.parse=(d,S)=>{let c=d.value;if(!Array.isArray(c))return d.issues.push({input:c,inst:E,expected:"tuple",code:"invalid_type"}),d;d.value=[];let n=[];if(!y.rest){let T=c.length>p.length,k=c.length<h-1;if(T||k)return d.issues.push({input:c,inst:E,origin:"array",...T?{code:"too_big",maximum:p.length}:{code:"too_small",minimum:p.length}}),d}let r=-1;for(let T of p){if(r++,r>=c.length){if(r>=h)continue}let k=T._zod.run({value:c[r],issues:[]},S);if(k instanceof Promise)n.push(k.then((o)=>f8(o,d,r)));else f8(k,d,r)}if(y.rest){let T=c.slice(p.length);for(let k of T){r++;let o=y.rest._zod.run({value:k,issues:[]},S);if(o instanceof Promise)n.push(o.then((u)=>f8(u,d,r)));else f8(o,d,r)}}if(n.length)return Promise.all(n).then(()=>d);return d}});function f8(E,y,p){if(E.issues.length)y.issues.push(...x3(p,E.issues));y.value[p]=E.value}var A9=e("$ZodRecord",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=p.value;if(!P4(d))return p.issues.push({expected:"record",code:"invalid_type",input:d,inst:E}),p;let S=[];if(y.keyType._zod.values){let c=y.keyType._zod.values;p.value={};for(let r of c)if(typeof r==="string"||typeof r==="number"||typeof r==="symbol"){let T=y.valueType._zod.run({value:d[r],issues:[]},h);if(T instanceof Promise)S.push(T.then((k)=>{if(k.issues.length)p.issues.push(...x3(r,k.issues));p.value[r]=k.value}));else{if(T.issues.length)p.issues.push(...x3(r,T.issues));p.value[r]=T.value}}let n;for(let r in d)if(!c.has(r))n=n??[],n.push(r);if(n&&n.length>0)p.issues.push({code:"unrecognized_keys",input:d,inst:E,keys:n})}else{p.value={};for(let c of Reflect.ownKeys(d)){if(c==="__proto__")continue;let n=y.keyType._zod.run({value:c,issues:[]},h);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(n.issues.length){p.issues.push({origin:"record",code:"invalid_key",issues:n.issues.map((T)=>b3(T,h,h3())),input:c,path:[c],inst:E}),p.value[n.value]=n.value;continue}let r=y.valueType._zod.run({value:d[c],issues:[]},h);if(r instanceof Promise)S.push(r.then((T)=>{if(T.issues.length)p.issues.push(...x3(c,T.issues));p.value[n.value]=T.value}));else{if(r.issues.length)p.issues.push(...x3(c,r.issues));p.value[n.value]=r.value}}}if(S.length)return Promise.all(S).then(()=>p);return p}}),M9=e("$ZodMap",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=p.value;if(!(d instanceof Map))return p.issues.push({expected:"map",code:"invalid_type",input:d,inst:E}),p;let S=[];p.value=new Map;for(let[c,n]of d){let r=y.keyType._zod.run({value:c,issues:[]},h),T=y.valueType._zod.run({value:n,issues:[]},h);if(r instanceof Promise||T instanceof Promise)S.push(Promise.all([r,T]).then(([k,o])=>{Ih(k,o,p,c,d,E,h)}));else Ih(r,T,p,c,d,E,h)}if(S.length)return Promise.all(S).then(()=>p);return p}});function Ih(E,y,p,h,d,S,c){if(E.issues.length)if(L8.has(typeof h))p.issues.push(...x3(h,E.issues));else p.issues.push({origin:"map",code:"invalid_key",input:d,inst:S,issues:E.issues.map((n)=>b3(n,c,h3()))});if(y.issues.length)if(L8.has(typeof h))p.issues.push(...x3(h,y.issues));else p.issues.push({origin:"map",code:"invalid_element",input:d,inst:S,key:h,issues:y.issues.map((n)=>b3(n,c,h3()))});p.value.set(E.value,y.value)}var s9=e("$ZodSet",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=p.value;if(!(d instanceof Set))return p.issues.push({input:d,inst:E,expected:"set",code:"invalid_type"}),p;let S=[];p.value=new Set;for(let c of d){let n=y.valueType._zod.run({value:c,issues:[]},h);if(n instanceof Promise)S.push(n.then((r)=>ih(r,p)));else ih(n,p)}if(S.length)return Promise.all(S).then(()=>p);return p}});function ih(E,y){if(E.issues.length)y.issues.push(...E.issues);y.value.add(E.value)}var b9=e("$ZodEnum",(E,y)=>{T0.init(E,y);let p=ey(y.entries);E._zod.values=new Set(p),E._zod.pattern=new RegExp(`^(${p.filter((h)=>L8.has(typeof h)).map((h)=>typeof h==="string"?a6(h):h.toString()).join("|")})$`),E._zod.parse=(h,d)=>{let S=h.value;if(E._zod.values.has(S))return h;return h.issues.push({code:"invalid_value",values:p,input:S,inst:E}),h}}),e9=e("$ZodLiteral",(E,y)=>{T0.init(E,y),E._zod.values=new Set(y.values),E._zod.pattern=new RegExp(`^(${y.values.map((p)=>typeof p==="string"?a6(p):p?p.toString():String(p)).join("|")})$`),E._zod.parse=(p,h)=>{let d=p.value;if(E._zod.values.has(d))return p;return p.issues.push({code:"invalid_value",values:y.values,input:d,inst:E}),p}}),g9=e("$ZodFile",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=p.value;if(d instanceof File)return p;return p.issues.push({expected:"file",code:"invalid_type",input:d,inst:E}),p}}),$y=e("$ZodTransform",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=y.transform(p.value,p);if(h.async)return(d instanceof Promise?d:Promise.resolve(d)).then((S)=>{return p.value=S,p});if(d instanceof Promise)throw new T6;return p.value=d,p}}),l9=e("$ZodOptional",(E,y)=>{T0.init(E,y),E._zod.optin="optional",E._zod.optout="optional",v0(E._zod,"values",()=>{return y.innerType._zod.values?new Set([...y.innerType._zod.values,void 0]):void 0}),v0(E._zod,"pattern",()=>{let p=y.innerType._zod.pattern;return p?new RegExp(`^(${dE(p.source)})?$`):void 0}),E._zod.parse=(p,h)=>{if(y.innerType._zod.optin==="optional")return y.innerType._zod.run(p,h);if(p.value===void 0)return p;return y.innerType._zod.run(p,h)}}),P9=e("$ZodNullable",(E,y)=>{T0.init(E,y),v0(E._zod,"optin",()=>y.innerType._zod.optin),v0(E._zod,"optout",()=>y.innerType._zod.optout),v0(E._zod,"pattern",()=>{let p=y.innerType._zod.pattern;return p?new RegExp(`^(${dE(p.source)}|null)$`):void 0}),v0(E._zod,"values",()=>{return y.innerType._zod.values?new Set([...y.innerType._zod.values,null]):void 0}),E._zod.parse=(p,h)=>{if(p.value===null)return p;return y.innerType._zod.run(p,h)}}),L9=e("$ZodDefault",(E,y)=>{T0.init(E,y),E._zod.optin="optional",v0(E._zod,"values",()=>y.innerType._zod.values),E._zod.parse=(p,h)=>{if(p.value===void 0)return p.value=y.defaultValue,p;let d=y.innerType._zod.run(p,h);if(d instanceof Promise)return d.then((S)=>th(S,y));return th(d,y)}});function th(E,y){if(E.value===void 0)E.value=y.defaultValue;return E}var j9=e("$ZodPrefault",(E,y)=>{T0.init(E,y),E._zod.optin="optional",v0(E._zod,"values",()=>y.innerType._zod.values),E._zod.parse=(p,h)=>{if(p.value===void 0)p.value=y.defaultValue;return y.innerType._zod.run(p,h)}}),q9=e("$ZodNonOptional",(E,y)=>{T0.init(E,y),v0(E._zod,"values",()=>{let p=y.innerType._zod.values;return p?new Set([...p].filter((h)=>h!==void 0)):void 0}),E._zod.parse=(p,h)=>{let d=y.innerType._zod.run(p,h);if(d instanceof Promise)return d.then((S)=>Zh(S,E));return Zh(d,E)}});function Zh(E,y){if(!E.issues.length&&E.value===void 0)E.issues.push({code:"invalid_type",expected:"nonoptional",input:E.value,inst:y});return E}var _9=e("$ZodSuccess",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{let d=y.innerType._zod.run(p,h);if(d instanceof Promise)return d.then((S)=>{return p.value=S.issues.length===0,p});return p.value=d.issues.length===0,p}}),D9=e("$ZodCatch",(E,y)=>{T0.init(E,y),E._zod.optin="optional",v0(E._zod,"optout",()=>y.innerType._zod.optout),v0(E._zod,"values",()=>y.innerType._zod.values),E._zod.parse=(p,h)=>{let d=y.innerType._zod.run(p,h);if(d instanceof Promise)return d.then((S)=>{if(p.value=S.value,S.issues.length)p.value=y.catchValue({...p,error:{issues:S.issues.map((c)=>b3(c,h,h3()))},input:p.value}),p.issues=[];return p});if(p.value=d.value,d.issues.length)p.value=y.catchValue({...p,error:{issues:d.issues.map((S)=>b3(S,h,h3()))},input:p.value}),p.issues=[];return p}}),V9=e("$ZodNaN",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{if(typeof p.value!=="number"||!Number.isNaN(p.value))return p.issues.push({input:p.value,inst:E,expected:"nan",code:"invalid_type"}),p;return p}}),Ed=e("$ZodPipe",(E,y)=>{T0.init(E,y),v0(E._zod,"values",()=>y.in._zod.values),v0(E._zod,"optin",()=>y.in._zod.optin),v0(E._zod,"optout",()=>y.out._zod.optout),E._zod.parse=(p,h)=>{let d=y.in._zod.run(p,h);if(d instanceof Promise)return d.then((S)=>vh(S,y,h));return vh(d,y,h)}});function vh(E,y,p){if(e6(E))return E;return y.out._zod.run({value:E.value,issues:E.issues},p)}var B9=e("$ZodReadonly",(E,y)=>{T0.init(E,y),v0(E._zod,"propValues",()=>y.innerType._zod.propValues),v0(E._zod,"values",()=>y.innerType._zod.values),v0(E._zod,"optin",()=>y.innerType._zod.optin),v0(E._zod,"optout",()=>y.innerType._zod.optout),E._zod.parse=(p,h)=>{let d=y.innerType._zod.run(p,h);if(d instanceof Promise)return d.then(Fh);return Fh(d)}});function Fh(E){return E.value=Object.freeze(E.value),E}var N9=e("$ZodTemplateLiteral",(E,y)=>{T0.init(E,y);let p=[];for(let h of y.parts)if(h instanceof T0){if(!h._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...h._zod.traits].shift()}`);let d=h._zod.pattern instanceof RegExp?h._zod.pattern.source:h._zod.pattern;if(!d)throw Error(`Invalid template literal part: ${h._zod.traits}`);let S=d.startsWith("^")?1:0,c=d.endsWith("$")?d.length-1:d.length;p.push(d.slice(S,c))}else if(h===null||qS.has(typeof h))p.push(a6(`${h}`));else throw Error(`Invalid template literal part: ${h}`);E._zod.pattern=new RegExp(`^${p.join("")}$`),E._zod.parse=(h,d)=>{if(typeof h.value!=="string")return h.issues.push({input:h.value,inst:E,expected:"template_literal",code:"invalid_type"}),h;if(E._zod.pattern.lastIndex=0,!E._zod.pattern.test(h.value))return h.issues.push({input:h.value,inst:E,code:"invalid_format",format:"template_literal",pattern:E._zod.pattern.source}),h;return h}}),w9=e("$ZodPromise",(E,y)=>{T0.init(E,y),E._zod.parse=(p,h)=>{return Promise.resolve(p.value).then((d)=>y.innerType._zod.run({value:d,issues:[]},h))}}),K9=e("$ZodLazy",(E,y)=>{T0.init(E,y),v0(E._zod,"innerType",()=>y.getter()),v0(E._zod,"pattern",()=>E._zod.innerType._zod.pattern),v0(E._zod,"propValues",()=>E._zod.innerType._zod.propValues),v0(E._zod,"optin",()=>E._zod.innerType._zod.optin),v0(E._zod,"optout",()=>E._zod.innerType._zod.optout),E._zod.parse=(p,h)=>{return E._zod.innerType._zod.run(p,h)}}),H9=e("$ZodCustom",(E,y)=>{V0.init(E,y),T0.init(E,y),E._zod.parse=(p,h)=>{return p},E._zod.check=(p)=>{let h=p.value,d=y.fn(h);if(d instanceof Promise)return d.then((S)=>Ah(S,p,h,E));Ah(d,p,h,E);return}});function Ah(E,y,p,h){if(!E){let d={code:"custom",input:p,inst:h,path:[...h._zod.def.path??[]],continue:!h._zod.def.abort};if(h._zod.def.params)d.params=h._zod.def.params;y.issues.push(BS(d))}}var yd={};f6(yd,{zhTW:()=>kC,zhCN:()=>fC,vi:()=>mC,ur:()=>rC,ua:()=>cC,tr:()=>hC,th:()=>yC,ta:()=>$a,sv:()=>Ya,sl:()=>Qa,ru:()=>Wa,pt:()=>Ua,ps:()=>wa,pl:()=>Ha,ota:()=>Ba,no:()=>Da,nl:()=>qa,ms:()=>La,mk:()=>la,ko:()=>ea,kh:()=>sa,ja:()=>Aa,it:()=>va,id:()=>ta,hu:()=>Ia,he:()=>oa,frCA:()=>aa,fr:()=>ua,fi:()=>Ra,fa:()=>Ta,es:()=>na,eo:()=>Sa,en:()=>O9,de:()=>Ea,cs:()=>Xk,ca:()=>Jk,be:()=>zk,az:()=>Gk,ar:()=>Ok});var Hk=()=>{let E={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${d.expected}، ولكن تم إدخال ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${R0(d.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return` أكبر من اللازم: يفترض أن تكون ${d.origin??"القيمة"} ${S} ${d.maximum.toString()} ${c.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${d.origin??"القيمة"} ${S} ${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`أصغر من اللازم: يفترض لـ ${d.origin} أن يكون ${S} ${d.minimum.toString()} ${c.unit}`;return`أصغر من اللازم: يفترض لـ ${d.origin} أن يكون ${S} ${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${d.prefix}"`;if(S.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${S.suffix}"`;if(S.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${S.includes}"`;if(S.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${S.pattern}`;return`${h[S.format]??d.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${d.divisor}`;case"unrecognized_keys":return`معرف${d.keys.length>1?"ات":""} غريب${d.keys.length>1?"ة":""}: ${U(d.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${d.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${d.origin}`;default:return"مدخل غير مقبول"}}};function Ok(){return{localeError:Hk()}}var Uk=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${d.expected}, daxil olan ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Yanlış dəyər: gözlənilən ${R0(d.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Çox böyük: gözlənilən ${d.origin??"dəyər"} ${S}${d.maximum.toString()} ${c.unit??"element"}`;return`Çox böyük: gözlənilən ${d.origin??"dəyər"} ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Çox kiçik: gözlənilən ${d.origin} ${S}${d.minimum.toString()} ${c.unit}`;return`Çox kiçik: gözlənilən ${d.origin} ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Yanlış mətn: "${S.prefix}" ilə başlamalıdır`;if(S.format==="ends_with")return`Yanlış mətn: "${S.suffix}" ilə bitməlidir`;if(S.format==="includes")return`Yanlış mətn: "${S.includes}" daxil olmalıdır`;if(S.format==="regex")return`Yanlış mətn: ${S.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${h[S.format]??d.format}`}case"not_multiple_of":return`Yanlış ədəd: ${d.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${d.keys.length>1?"lar":""}: ${U(d.keys,", ")}`;case"invalid_key":return`${d.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${d.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Gk(){return{localeError:Uk()}}function Mh(E,y,p,h){let d=Math.abs(E),S=d%10,c=d%100;if(c>=11&&c<=19)return h;if(S===1)return y;if(S>=2&&S<=4)return p;return h}var Wk=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"лік";case"object":{if(Array.isArray(d))return"масіў";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${d.expected}, атрымана ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Няправільны ўвод: чакалася ${R0(d.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c){let n=Number(d.maximum),r=Mh(n,c.unit.one,c.unit.few,c.unit.many);return`Занадта вялікі: чакалася, што ${d.origin??"значэнне"} павінна ${c.verb} ${S}${d.maximum.toString()} ${r}`}return`Занадта вялікі: чакалася, што ${d.origin??"значэнне"} павінна быць ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c){let n=Number(d.minimum),r=Mh(n,c.unit.one,c.unit.few,c.unit.many);return`Занадта малы: чакалася, што ${d.origin} павінна ${c.verb} ${S}${d.minimum.toString()} ${r}`}return`Занадта малы: чакалася, што ${d.origin} павінна быць ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${S.prefix}"`;if(S.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${S.suffix}"`;if(S.format==="includes")return`Няправільны радок: павінен змяшчаць "${S.includes}"`;if(S.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${S.pattern}`;return`Няправільны ${h[S.format]??d.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${d.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${d.keys.length>1?"ключы":"ключ"}: ${U(d.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${d.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${d.origin}`;default:return"Няправільны ўвод"}}};function zk(){return{localeError:Wk()}}var Qk=()=>{let E={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Tipus invàlid: s'esperava ${d.expected}, s'ha rebut ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Valor invàlid: s'esperava ${R0(d.values[0])}`;return`Opció invàlida: s'esperava una de ${U(d.values," o ")}`;case"too_big":{let S=d.inclusive?"com a màxim":"menys de",c=y(d.origin);if(c)return`Massa gran: s'esperava que ${d.origin??"el valor"} contingués ${S} ${d.maximum.toString()} ${c.unit??"elements"}`;return`Massa gran: s'esperava que ${d.origin??"el valor"} fos ${S} ${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?"com a mínim":"més de",c=y(d.origin);if(c)return`Massa petit: s'esperava que ${d.origin} contingués ${S} ${d.minimum.toString()} ${c.unit}`;return`Massa petit: s'esperava que ${d.origin} fos ${S} ${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Format invàlid: ha de començar amb "${S.prefix}"`;if(S.format==="ends_with")return`Format invàlid: ha d'acabar amb "${S.suffix}"`;if(S.format==="includes")return`Format invàlid: ha d'incloure "${S.includes}"`;if(S.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${S.pattern}`;return`Format invàlid per a ${h[S.format]??d.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${d.divisor}`;case"unrecognized_keys":return`Clau${d.keys.length>1?"s":""} no reconeguda${d.keys.length>1?"s":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${d.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${d.origin}`;default:return"Entrada invàlida"}}};function Jk(){return{localeError:Qk()}}var Yk=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"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(d))return"pole";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Neplatný vstup: očekáváno ${d.expected}, obdrženo ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Neplatný vstup: očekáváno ${R0(d.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Hodnota je příliš velká: ${d.origin??"hodnota"} musí mít ${S}${d.maximum.toString()} ${c.unit??"prvků"}`;return`Hodnota je příliš velká: ${d.origin??"hodnota"} musí být ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Hodnota je příliš malá: ${d.origin??"hodnota"} musí mít ${S}${d.minimum.toString()} ${c.unit??"prvků"}`;return`Hodnota je příliš malá: ${d.origin??"hodnota"} musí být ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Neplatný řetězec: musí začínat na "${S.prefix}"`;if(S.format==="ends_with")return`Neplatný řetězec: musí končit na "${S.suffix}"`;if(S.format==="includes")return`Neplatný řetězec: musí obsahovat "${S.includes}"`;if(S.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${S.pattern}`;return`Neplatný formát ${h[S.format]??d.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${d.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${U(d.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${d.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${d.origin}`;default:return"Neplatný vstup"}}};function Xk(){return{localeError:Yk()}}var $k=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"Zahl";case"object":{if(Array.isArray(d))return"Array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${d.expected}, erhalten ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Ungültige Eingabe: erwartet ${R0(d.values[0])}`;return`Ungültige Option: erwartet eine von ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Zu groß: erwartet, dass ${d.origin??"Wert"} ${S}${d.maximum.toString()} ${c.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${d.origin??"Wert"} ${S}${d.maximum.toString()} ist`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Zu klein: erwartet, dass ${d.origin} ${S}${d.minimum.toString()} ${c.unit} hat`;return`Zu klein: erwartet, dass ${d.origin} ${S}${d.minimum.toString()} ist`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Ungültiger String: muss mit "${S.prefix}" beginnen`;if(S.format==="ends_with")return`Ungültiger String: muss mit "${S.suffix}" enden`;if(S.format==="includes")return`Ungültiger String: muss "${S.includes}" enthalten`;if(S.format==="regex")return`Ungültiger String: muss dem Muster ${S.pattern} entsprechen`;return`Ungültig: ${h[S.format]??d.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${d.divisor} sein`;case"unrecognized_keys":return`${d.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${U(d.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${d.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${d.origin}`;default:return"Ungültige Eingabe"}}};function Ea(){return{localeError:$k()}}var ya=(E)=>{let y=typeof E;switch(y){case"number":return Number.isNaN(E)?"NaN":"number";case"object":{if(Array.isArray(E))return"array";if(E===null)return"null";if(Object.getPrototypeOf(E)!==Object.prototype&&E.constructor)return E.constructor.name}}return y},da=()=>{let E={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 y(h){return E[h]??null}let p={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(h)=>{switch(h.code){case"invalid_type":return`Invalid input: expected ${h.expected}, received ${ya(h.input)}`;case"invalid_value":if(h.values.length===1)return`Invalid input: expected ${R0(h.values[0])}`;return`Invalid option: expected one of ${U(h.values,"|")}`;case"too_big":{let d=h.inclusive?"<=":"<",S=y(h.origin);if(S)return`Too big: expected ${h.origin??"value"} to have ${d}${h.maximum.toString()} ${S.unit??"elements"}`;return`Too big: expected ${h.origin??"value"} to be ${d}${h.maximum.toString()}`}case"too_small":{let d=h.inclusive?">=":">",S=y(h.origin);if(S)return`Too small: expected ${h.origin} to have ${d}${h.minimum.toString()} ${S.unit}`;return`Too small: expected ${h.origin} to be ${d}${h.minimum.toString()}`}case"invalid_format":{let d=h;if(d.format==="starts_with")return`Invalid string: must start with "${d.prefix}"`;if(d.format==="ends_with")return`Invalid string: must end with "${d.suffix}"`;if(d.format==="includes")return`Invalid string: must include "${d.includes}"`;if(d.format==="regex")return`Invalid string: must match pattern ${d.pattern}`;return`Invalid ${p[d.format]??h.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${h.divisor}`;case"unrecognized_keys":return`Unrecognized key${h.keys.length>1?"s":""}: ${U(h.keys,", ")}`;case"invalid_key":return`Invalid key in ${h.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${h.origin}`;default:return"Invalid input"}}};function O9(){return{localeError:da()}}var pa=(E)=>{let y=typeof E;switch(y){case"number":return Number.isNaN(E)?"NaN":"nombro";case"object":{if(Array.isArray(E))return"tabelo";if(E===null)return"senvalora";if(Object.getPrototypeOf(E)!==Object.prototype&&E.constructor)return E.constructor.name}}return y},ha=()=>{let E={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function y(h){return E[h]??null}let p={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(h)=>{switch(h.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${h.expected}, riceviĝis ${pa(h.input)}`;case"invalid_value":if(h.values.length===1)return`Nevalida enigo: atendiĝis ${R0(h.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${U(h.values,"|")}`;case"too_big":{let d=h.inclusive?"<=":"<",S=y(h.origin);if(S)return`Tro granda: atendiĝis ke ${h.origin??"valoro"} havu ${d}${h.maximum.toString()} ${S.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${h.origin??"valoro"} havu ${d}${h.maximum.toString()}`}case"too_small":{let d=h.inclusive?">=":">",S=y(h.origin);if(S)return`Tro malgranda: atendiĝis ke ${h.origin} havu ${d}${h.minimum.toString()} ${S.unit}`;return`Tro malgranda: atendiĝis ke ${h.origin} estu ${d}${h.minimum.toString()}`}case"invalid_format":{let d=h;if(d.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${d.prefix}"`;if(d.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${d.suffix}"`;if(d.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${d.includes}"`;if(d.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${d.pattern}`;return`Nevalida ${p[d.format]??h.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${h.divisor}`;case"unrecognized_keys":return`Nekonata${h.keys.length>1?"j":""} ŝlosilo${h.keys.length>1?"j":""}: ${U(h.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${h.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${h.origin}`;default:return"Nevalida enigo"}}};function Sa(){return{localeError:ha()}}var ca=()=>{let E={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"número";case"object":{if(Array.isArray(d))return"arreglo";if(d===null)return"nulo";if(Object.getPrototypeOf(d)!==Object.prototype)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Entrada inválida: se esperaba ${d.expected}, recibido ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Entrada inválida: se esperaba ${R0(d.values[0])}`;return`Opción inválida: se esperaba una de ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Demasiado grande: se esperaba que ${d.origin??"valor"} tuviera ${S}${d.maximum.toString()} ${c.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${d.origin??"valor"} fuera ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Demasiado pequeño: se esperaba que ${d.origin} tuviera ${S}${d.minimum.toString()} ${c.unit}`;return`Demasiado pequeño: se esperaba que ${d.origin} fuera ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Cadena inválida: debe comenzar con "${S.prefix}"`;if(S.format==="ends_with")return`Cadena inválida: debe terminar en "${S.suffix}"`;if(S.format==="includes")return`Cadena inválida: debe incluir "${S.includes}"`;if(S.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${S.pattern}`;return`Inválido ${h[S.format]??d.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${d.divisor}`;case"unrecognized_keys":return`Llave${d.keys.length>1?"s":""} desconocida${d.keys.length>1?"s":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Llave inválida en ${d.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${d.origin}`;default:return"Entrada inválida"}}};function na(){return{localeError:ca()}}var ra=()=>{let E={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"عدد";case"object":{if(Array.isArray(d))return"آرایه";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${d.expected} می‌بود، ${p(d.input)} دریافت شد`;case"invalid_value":if(d.values.length===1)return`ورودی نامعتبر: می‌بایست ${R0(d.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${U(d.values,"|")} می‌بود`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`خیلی بزرگ: ${d.origin??"مقدار"} باید ${S}${d.maximum.toString()} ${c.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${d.origin??"مقدار"} باید ${S}${d.maximum.toString()} باشد`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`خیلی کوچک: ${d.origin} باید ${S}${d.minimum.toString()} ${c.unit} باشد`;return`خیلی کوچک: ${d.origin} باید ${S}${d.minimum.toString()} باشد`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`رشته نامعتبر: باید با "${S.prefix}" شروع شود`;if(S.format==="ends_with")return`رشته نامعتبر: باید با "${S.suffix}" تمام شود`;if(S.format==="includes")return`رشته نامعتبر: باید شامل "${S.includes}" باشد`;if(S.format==="regex")return`رشته نامعتبر: باید با الگوی ${S.pattern} مطابقت داشته باشد`;return`${h[S.format]??d.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${d.divisor} باشد`;case"unrecognized_keys":return`کلید${d.keys.length>1?"های":""} ناشناس: ${U(d.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${d.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${d.origin}`;default:return"ورودی نامعتبر"}}};function Ta(){return{localeError:ra()}}var ma=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${d.expected}, oli ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Virheellinen syöte: täytyy olla ${R0(d.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Liian suuri: ${c.subject} täytyy olla ${S}${d.maximum.toString()} ${c.unit}`.trim();return`Liian suuri: arvon täytyy olla ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Liian pieni: ${c.subject} täytyy olla ${S}${d.minimum.toString()} ${c.unit}`.trim();return`Liian pieni: arvon täytyy olla ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${S.prefix}"`;if(S.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${S.suffix}"`;if(S.format==="includes")return`Virheellinen syöte: täytyy sisältää "${S.includes}"`;if(S.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${S.pattern}`;return`Virheellinen ${h[S.format]??d.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${d.divisor} monikerta`;case"unrecognized_keys":return`${d.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${U(d.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"}}};function Ra(){return{localeError:ma()}}var fa=()=>{let E={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"nombre";case"object":{if(Array.isArray(d))return"tableau";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Entrée invalide : ${d.expected} attendu, ${p(d.input)} reçu`;case"invalid_value":if(d.values.length===1)return`Entrée invalide : ${R0(d.values[0])} attendu`;return`Option invalide : une valeur parmi ${U(d.values,"|")} attendue`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Trop grand : ${d.origin??"valeur"} doit ${c.verb} ${S}${d.maximum.toString()} ${c.unit??"élément(s)"}`;return`Trop grand : ${d.origin??"valeur"} doit être ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Trop petit : ${d.origin} doit ${c.verb} ${S}${d.minimum.toString()} ${c.unit}`;return`Trop petit : ${d.origin} doit être ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Chaîne invalide : doit commencer par "${S.prefix}"`;if(S.format==="ends_with")return`Chaîne invalide : doit se terminer par "${S.suffix}"`;if(S.format==="includes")return`Chaîne invalide : doit inclure "${S.includes}"`;if(S.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${S.pattern}`;return`${h[S.format]??d.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${d.divisor}`;case"unrecognized_keys":return`Clé${d.keys.length>1?"s":""} non reconnue${d.keys.length>1?"s":""} : ${U(d.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${d.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${d.origin}`;default:return"Entrée invalide"}}};function ua(){return{localeError:fa()}}var ka=()=>{let E={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Entrée invalide : attendu ${d.expected}, reçu ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Entrée invalide : attendu ${R0(d.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"≤":"<",c=y(d.origin);if(c)return`Trop grand : attendu que ${d.origin??"la valeur"} ait ${S}${d.maximum.toString()} ${c.unit}`;return`Trop grand : attendu que ${d.origin??"la valeur"} soit ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?"≥":">",c=y(d.origin);if(c)return`Trop petit : attendu que ${d.origin} ait ${S}${d.minimum.toString()} ${c.unit}`;return`Trop petit : attendu que ${d.origin} soit ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Chaîne invalide : doit commencer par "${S.prefix}"`;if(S.format==="ends_with")return`Chaîne invalide : doit se terminer par "${S.suffix}"`;if(S.format==="includes")return`Chaîne invalide : doit inclure "${S.includes}"`;if(S.format==="regex")return`Chaîne invalide : doit correspondre au motif ${S.pattern}`;return`${h[S.format]??d.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${d.divisor}`;case"unrecognized_keys":return`Clé${d.keys.length>1?"s":""} non reconnue${d.keys.length>1?"s":""} : ${U(d.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${d.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${d.origin}`;default:return"Entrée invalide"}}};function aa(){return{localeError:ka()}}var Ca=()=>{let E={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(d)=>{switch(d.code){case"invalid_type":return`קלט לא תקין: צריך ${d.expected}, התקבל ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`קלט לא תקין: צריך ${R0(d.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`גדול מדי: ${d.origin??"value"} צריך להיות ${S}${d.maximum.toString()} ${c.unit??"elements"}`;return`גדול מדי: ${d.origin??"value"} צריך להיות ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`קטן מדי: ${d.origin} צריך להיות ${S}${d.minimum.toString()} ${c.unit}`;return`קטן מדי: ${d.origin} צריך להיות ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${S.prefix}"`;if(S.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${S.suffix}"`;if(S.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${S.includes}"`;if(S.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${S.pattern}`;return`${h[S.format]??d.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${d.divisor}`;case"unrecognized_keys":return`מפתח${d.keys.length>1?"ות":""} לא מזוה${d.keys.length>1?"ים":"ה"}: ${U(d.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${d.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${d.origin}`;default:return"קלט לא תקין"}}};function oa(){return{localeError:Ca()}}var xa=()=>{let E={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"szám";case"object":{if(Array.isArray(d))return"tömb";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${d.expected}, a kapott érték ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Érvénytelen bemenet: a várt érték ${R0(d.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Túl nagy: ${d.origin??"érték"} mérete túl nagy ${S}${d.maximum.toString()} ${c.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${d.origin??"érték"} túl nagy: ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Túl kicsi: a bemeneti érték ${d.origin} mérete túl kicsi ${S}${d.minimum.toString()} ${c.unit}`;return`Túl kicsi: a bemeneti érték ${d.origin} túl kicsi ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Érvénytelen string: "${S.prefix}" értékkel kell kezdődnie`;if(S.format==="ends_with")return`Érvénytelen string: "${S.suffix}" értékkel kell végződnie`;if(S.format==="includes")return`Érvénytelen string: "${S.includes}" értéket kell tartalmaznia`;if(S.format==="regex")return`Érvénytelen string: ${S.pattern} mintának kell megfelelnie`;return`Érvénytelen ${h[S.format]??d.format}`}case"not_multiple_of":return`Érvénytelen szám: ${d.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${d.keys.length>1?"s":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${d.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${d.origin}`;default:return"Érvénytelen bemenet"}}};function Ia(){return{localeError:xa()}}var ia=()=>{let E={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Input tidak valid: diharapkan ${d.expected}, diterima ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Input tidak valid: diharapkan ${R0(d.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Terlalu besar: diharapkan ${d.origin??"value"} memiliki ${S}${d.maximum.toString()} ${c.unit??"elemen"}`;return`Terlalu besar: diharapkan ${d.origin??"value"} menjadi ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Terlalu kecil: diharapkan ${d.origin} memiliki ${S}${d.minimum.toString()} ${c.unit}`;return`Terlalu kecil: diharapkan ${d.origin} menjadi ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`String tidak valid: harus dimulai dengan "${S.prefix}"`;if(S.format==="ends_with")return`String tidak valid: harus berakhir dengan "${S.suffix}"`;if(S.format==="includes")return`String tidak valid: harus menyertakan "${S.includes}"`;if(S.format==="regex")return`String tidak valid: harus sesuai pola ${S.pattern}`;return`${h[S.format]??d.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${d.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${d.keys.length>1?"s":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${d.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${d.origin}`;default:return"Input tidak valid"}}};function ta(){return{localeError:ia()}}var Za=()=>{let E={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"numero";case"object":{if(Array.isArray(d))return"vettore";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Input non valido: atteso ${d.expected}, ricevuto ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Input non valido: atteso ${R0(d.values[0])}`;return`Opzione non valida: atteso uno tra ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Troppo grande: ${d.origin??"valore"} deve avere ${S}${d.maximum.toString()} ${c.unit??"elementi"}`;return`Troppo grande: ${d.origin??"valore"} deve essere ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Troppo piccolo: ${d.origin} deve avere ${S}${d.minimum.toString()} ${c.unit}`;return`Troppo piccolo: ${d.origin} deve essere ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Stringa non valida: deve iniziare con "${S.prefix}"`;if(S.format==="ends_with")return`Stringa non valida: deve terminare con "${S.suffix}"`;if(S.format==="includes")return`Stringa non valida: deve includere "${S.includes}"`;if(S.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${S.pattern}`;return`Invalid ${h[S.format]??d.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${d.divisor}`;case"unrecognized_keys":return`Chiav${d.keys.length>1?"i":"e"} non riconosciut${d.keys.length>1?"e":"a"}: ${U(d.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${d.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${d.origin}`;default:return"Input non valido"}}};function va(){return{localeError:Za()}}var Fa=()=>{let E={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"数値";case"object":{if(Array.isArray(d))return"配列";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`無効な入力: ${d.expected}が期待されましたが、${p(d.input)}が入力されました`;case"invalid_value":if(d.values.length===1)return`無効な入力: ${R0(d.values[0])}が期待されました`;return`無効な選択: ${U(d.values,"、")}のいずれかである必要があります`;case"too_big":{let S=d.inclusive?"以下である":"より小さい",c=y(d.origin);if(c)return`大きすぎる値: ${d.origin??"値"}は${d.maximum.toString()}${c.unit??"要素"}${S}必要があります`;return`大きすぎる値: ${d.origin??"値"}は${d.maximum.toString()}${S}必要があります`}case"too_small":{let S=d.inclusive?"以上である":"より大きい",c=y(d.origin);if(c)return`小さすぎる値: ${d.origin}は${d.minimum.toString()}${c.unit}${S}必要があります`;return`小さすぎる値: ${d.origin}は${d.minimum.toString()}${S}必要があります`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`無効な文字列: "${S.prefix}"で始まる必要があります`;if(S.format==="ends_with")return`無効な文字列: "${S.suffix}"で終わる必要があります`;if(S.format==="includes")return`無効な文字列: "${S.includes}"を含む必要があります`;if(S.format==="regex")return`無効な文字列: パターン${S.pattern}に一致する必要があります`;return`無効な${h[S.format]??d.format}`}case"not_multiple_of":return`無効な数値: ${d.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${d.keys.length>1?"群":""}: ${U(d.keys,"、")}`;case"invalid_key":return`${d.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${d.origin}内の無効な値`;default:return"無効な入力"}}};function Aa(){return{localeError:Fa()}}var Ma=()=>{let E={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(d))return"អារេ (Array)";if(d===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${d.expected} ប៉ុន្តែទទួលបាន ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${R0(d.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`ធំពេក៖ ត្រូវការ ${d.origin??"តម្លៃ"} ${S} ${d.maximum.toString()} ${c.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${d.origin??"តម្លៃ"} ${S} ${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`តូចពេក៖ ត្រូវការ ${d.origin} ${S} ${d.minimum.toString()} ${c.unit}`;return`តូចពេក៖ ត្រូវការ ${d.origin} ${S} ${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${S.prefix}"`;if(S.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${S.suffix}"`;if(S.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${S.includes}"`;if(S.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${S.pattern}`;return`មិនត្រឹមត្រូវ៖ ${h[S.format]??d.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${d.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${U(d.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${d.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${d.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function sa(){return{localeError:Ma()}}var ba=()=>{let E={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${d.expected}, 받은 타입은 ${p(d.input)}입니다`;case"invalid_value":if(d.values.length===1)return`잘못된 입력: 값은 ${R0(d.values[0])} 이어야 합니다`;return`잘못된 옵션: ${U(d.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let S=d.inclusive?"이하":"미만",c=S==="미만"?"이어야 합니다":"여야 합니다",n=y(d.origin),r=n?.unit??"요소";if(n)return`${d.origin??"값"}이 너무 큽니다: ${d.maximum.toString()}${r} ${S}${c}`;return`${d.origin??"값"}이 너무 큽니다: ${d.maximum.toString()} ${S}${c}`}case"too_small":{let S=d.inclusive?"이상":"초과",c=S==="이상"?"이어야 합니다":"여야 합니다",n=y(d.origin),r=n?.unit??"요소";if(n)return`${d.origin??"값"}이 너무 작습니다: ${d.minimum.toString()}${r} ${S}${c}`;return`${d.origin??"값"}이 너무 작습니다: ${d.minimum.toString()} ${S}${c}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`잘못된 문자열: "${S.prefix}"(으)로 시작해야 합니다`;if(S.format==="ends_with")return`잘못된 문자열: "${S.suffix}"(으)로 끝나야 합니다`;if(S.format==="includes")return`잘못된 문자열: "${S.includes}"을(를) 포함해야 합니다`;if(S.format==="regex")return`잘못된 문자열: 정규식 ${S.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${h[S.format]??d.format}`}case"not_multiple_of":return`잘못된 숫자: ${d.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${U(d.keys,", ")}`;case"invalid_key":return`잘못된 키: ${d.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${d.origin}`;default:return"잘못된 입력"}}};function ea(){return{localeError:ba()}}var ga=()=>{let E={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"број";case"object":{if(Array.isArray(d))return"низа";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Грешен внес: се очекува ${d.expected}, примено ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Invalid input: expected ${R0(d.values[0])}`;return`Грешана опција: се очекува една ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Премногу голем: се очекува ${d.origin??"вредноста"} да има ${S}${d.maximum.toString()} ${c.unit??"елементи"}`;return`Премногу голем: се очекува ${d.origin??"вредноста"} да биде ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Премногу мал: се очекува ${d.origin} да има ${S}${d.minimum.toString()} ${c.unit}`;return`Премногу мал: се очекува ${d.origin} да биде ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Неважечка низа: мора да започнува со "${S.prefix}"`;if(S.format==="ends_with")return`Неважечка низа: мора да завршува со "${S.suffix}"`;if(S.format==="includes")return`Неважечка низа: мора да вклучува "${S.includes}"`;if(S.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${S.pattern}`;return`Invalid ${h[S.format]??d.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${d.divisor}`;case"unrecognized_keys":return`${d.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${U(d.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${d.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${d.origin}`;default:return"Грешен внес"}}};function la(){return{localeError:ga()}}var Pa=()=>{let E={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"nombor";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Input tidak sah: dijangka ${d.expected}, diterima ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Input tidak sah: dijangka ${R0(d.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Terlalu besar: dijangka ${d.origin??"nilai"} ${c.verb} ${S}${d.maximum.toString()} ${c.unit??"elemen"}`;return`Terlalu besar: dijangka ${d.origin??"nilai"} adalah ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Terlalu kecil: dijangka ${d.origin} ${c.verb} ${S}${d.minimum.toString()} ${c.unit}`;return`Terlalu kecil: dijangka ${d.origin} adalah ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`String tidak sah: mesti bermula dengan "${S.prefix}"`;if(S.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${S.suffix}"`;if(S.format==="includes")return`String tidak sah: mesti mengandungi "${S.includes}"`;if(S.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${S.pattern}`;return`${h[S.format]??d.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${d.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${U(d.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${d.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${d.origin}`;default:return"Input tidak sah"}}};function La(){return{localeError:Pa()}}var ja=()=>{let E={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"getal";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Ongeldige invoer: verwacht ${d.expected}, ontving ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Ongeldige invoer: verwacht ${R0(d.values[0])}`;return`Ongeldige optie: verwacht één van ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Te lang: verwacht dat ${d.origin??"waarde"} ${S}${d.maximum.toString()} ${c.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${d.origin??"waarde"} ${S}${d.maximum.toString()} is`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Te kort: verwacht dat ${d.origin} ${S}${d.minimum.toString()} ${c.unit} bevat`;return`Te kort: verwacht dat ${d.origin} ${S}${d.minimum.toString()} is`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Ongeldige tekst: moet met "${S.prefix}" beginnen`;if(S.format==="ends_with")return`Ongeldige tekst: moet op "${S.suffix}" eindigen`;if(S.format==="includes")return`Ongeldige tekst: moet "${S.includes}" bevatten`;if(S.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${S.pattern}`;return`Ongeldig: ${h[S.format]??d.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${d.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${d.keys.length>1?"s":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${d.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${d.origin}`;default:return"Ongeldige invoer"}}};function qa(){return{localeError:ja()}}var _a=()=>{let E={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"tall";case"object":{if(Array.isArray(d))return"liste";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Ugyldig input: forventet ${d.expected}, fikk ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Ugyldig verdi: forventet ${R0(d.values[0])}`;return`Ugyldig valg: forventet en av ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`For stor(t): forventet ${d.origin??"value"} til å ha ${S}${d.maximum.toString()} ${c.unit??"elementer"}`;return`For stor(t): forventet ${d.origin??"value"} til å ha ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`For lite(n): forventet ${d.origin} til å ha ${S}${d.minimum.toString()} ${c.unit}`;return`For lite(n): forventet ${d.origin} til å ha ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Ugyldig streng: må starte med "${S.prefix}"`;if(S.format==="ends_with")return`Ugyldig streng: må ende med "${S.suffix}"`;if(S.format==="includes")return`Ugyldig streng: må inneholde "${S.includes}"`;if(S.format==="regex")return`Ugyldig streng: må matche mønsteret ${S.pattern}`;return`Ugyldig ${h[S.format]??d.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${d.divisor}`;case"unrecognized_keys":return`${d.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${U(d.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${d.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${d.origin}`;default:return"Ugyldig input"}}};function Da(){return{localeError:_a()}}var Va=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"numara";case"object":{if(Array.isArray(d))return"saf";if(d===null)return"gayb";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Fâsit giren: umulan ${d.expected}, alınan ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Fâsit giren: umulan ${R0(d.values[0])}`;return`Fâsit tercih: mûteberler ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Fazla büyük: ${d.origin??"value"}, ${S}${d.maximum.toString()} ${c.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${d.origin??"value"}, ${S}${d.maximum.toString()} olmalıydı.`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Fazla küçük: ${d.origin}, ${S}${d.minimum.toString()} ${c.unit} sahip olmalıydı.`;return`Fazla küçük: ${d.origin}, ${S}${d.minimum.toString()} olmalıydı.`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Fâsit metin: "${S.prefix}" ile başlamalı.`;if(S.format==="ends_with")return`Fâsit metin: "${S.suffix}" ile bitmeli.`;if(S.format==="includes")return`Fâsit metin: "${S.includes}" ihtivâ etmeli.`;if(S.format==="regex")return`Fâsit metin: ${S.pattern} nakşına uymalı.`;return`Fâsit ${h[S.format]??d.format}`}case"not_multiple_of":return`Fâsit sayı: ${d.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${d.keys.length>1?"s":""}: ${U(d.keys,", ")}`;case"invalid_key":return`${d.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${d.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Ba(){return{localeError:Va()}}var Na=()=>{let E={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"عدد";case"object":{if(Array.isArray(d))return"ارې";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`ناسم ورودي: باید ${d.expected} وای, مګر ${p(d.input)} ترلاسه شو`;case"invalid_value":if(d.values.length===1)return`ناسم ورودي: باید ${R0(d.values[0])} وای`;return`ناسم انتخاب: باید یو له ${U(d.values,"|")} څخه وای`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`ډیر لوی: ${d.origin??"ارزښت"} باید ${S}${d.maximum.toString()} ${c.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${d.origin??"ارزښت"} باید ${S}${d.maximum.toString()} وي`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`ډیر کوچنی: ${d.origin} باید ${S}${d.minimum.toString()} ${c.unit} ولري`;return`ډیر کوچنی: ${d.origin} باید ${S}${d.minimum.toString()} وي`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`ناسم متن: باید د "${S.prefix}" سره پیل شي`;if(S.format==="ends_with")return`ناسم متن: باید د "${S.suffix}" سره پای ته ورسيږي`;if(S.format==="includes")return`ناسم متن: باید "${S.includes}" ولري`;if(S.format==="regex")return`ناسم متن: باید د ${S.pattern} سره مطابقت ولري`;return`${h[S.format]??d.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${d.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${d.keys.length>1?"کلیډونه":"کلیډ"}: ${U(d.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${d.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${d.origin} کې`;default:return"ناسمه ورودي"}}};function wa(){return{localeError:Na()}}var Ka=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"liczba";case"object":{if(Array.isArray(d))return"tablica";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${d.expected}, otrzymano ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${R0(d.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Za duża wartość: oczekiwano, że ${d.origin??"wartość"} będzie mieć ${S}${d.maximum.toString()} ${c.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${d.origin??"wartość"} będzie wynosić ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Za mała wartość: oczekiwano, że ${d.origin??"wartość"} będzie mieć ${S}${d.minimum.toString()} ${c.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${d.origin??"wartość"} będzie wynosić ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${S.prefix}"`;if(S.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${S.suffix}"`;if(S.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${S.includes}"`;if(S.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${S.pattern}`;return`Nieprawidłow(y/a/e) ${h[S.format]??d.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${d.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${d.keys.length>1?"s":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${d.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${d.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Ha(){return{localeError:Ka()}}var Oa=()=>{let E={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"número";case"object":{if(Array.isArray(d))return"array";if(d===null)return"nulo";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Tipo inválido: esperado ${d.expected}, recebido ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Entrada inválida: esperado ${R0(d.values[0])}`;return`Opção inválida: esperada uma das ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Muito grande: esperado que ${d.origin??"valor"} tivesse ${S}${d.maximum.toString()} ${c.unit??"elementos"}`;return`Muito grande: esperado que ${d.origin??"valor"} fosse ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Muito pequeno: esperado que ${d.origin} tivesse ${S}${d.minimum.toString()} ${c.unit}`;return`Muito pequeno: esperado que ${d.origin} fosse ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Texto inválido: deve começar com "${S.prefix}"`;if(S.format==="ends_with")return`Texto inválido: deve terminar com "${S.suffix}"`;if(S.format==="includes")return`Texto inválido: deve incluir "${S.includes}"`;if(S.format==="regex")return`Texto inválido: deve corresponder ao padrão ${S.pattern}`;return`${h[S.format]??d.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${d.divisor}`;case"unrecognized_keys":return`Chave${d.keys.length>1?"s":""} desconhecida${d.keys.length>1?"s":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Chave inválida em ${d.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${d.origin}`;default:return"Campo inválido"}}};function Ua(){return{localeError:Oa()}}function sh(E,y,p,h){let d=Math.abs(E),S=d%10,c=d%100;if(c>=11&&c<=19)return h;if(S===1)return y;if(S>=2&&S<=4)return p;return h}var Ga=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"число";case"object":{if(Array.isArray(d))return"массив";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Неверный ввод: ожидалось ${d.expected}, получено ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Неверный ввод: ожидалось ${R0(d.values[0])}`;return`Неверный вариант: ожидалось одно из ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c){let n=Number(d.maximum),r=sh(n,c.unit.one,c.unit.few,c.unit.many);return`Слишком большое значение: ожидалось, что ${d.origin??"значение"} будет иметь ${S}${d.maximum.toString()} ${r}`}return`Слишком большое значение: ожидалось, что ${d.origin??"значение"} будет ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c){let n=Number(d.minimum),r=sh(n,c.unit.one,c.unit.few,c.unit.many);return`Слишком маленькое значение: ожидалось, что ${d.origin} будет иметь ${S}${d.minimum.toString()} ${r}`}return`Слишком маленькое значение: ожидалось, что ${d.origin} будет ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Неверная строка: должна начинаться с "${S.prefix}"`;if(S.format==="ends_with")return`Неверная строка: должна заканчиваться на "${S.suffix}"`;if(S.format==="includes")return`Неверная строка: должна содержать "${S.includes}"`;if(S.format==="regex")return`Неверная строка: должна соответствовать шаблону ${S.pattern}`;return`Неверный ${h[S.format]??d.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${d.divisor}`;case"unrecognized_keys":return`Нераспознанн${d.keys.length>1?"ые":"ый"} ключ${d.keys.length>1?"и":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${d.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${d.origin}`;default:return"Неверные входные данные"}}};function Wa(){return{localeError:Ga()}}var za=()=>{let E={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"število";case"object":{if(Array.isArray(d))return"tabela";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${d.expected}, prejeto ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Neveljaven vnos: pričakovano ${R0(d.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Preveliko: pričakovano, da bo ${d.origin??"vrednost"} imelo ${S}${d.maximum.toString()} ${c.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${d.origin??"vrednost"} ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Premajhno: pričakovano, da bo ${d.origin} imelo ${S}${d.minimum.toString()} ${c.unit}`;return`Premajhno: pričakovano, da bo ${d.origin} ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Neveljaven niz: mora se začeti z "${S.prefix}"`;if(S.format==="ends_with")return`Neveljaven niz: mora se končati z "${S.suffix}"`;if(S.format==="includes")return`Neveljaven niz: mora vsebovati "${S.includes}"`;if(S.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${S.pattern}`;return`Neveljaven ${h[S.format]??d.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${d.divisor}`;case"unrecognized_keys":return`Neprepoznan${d.keys.length>1?"i ključi":" ključ"}: ${U(d.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${d.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${d.origin}`;default:return"Neveljaven vnos"}}};function Qa(){return{localeError:za()}}var Ja=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"antal";case"object":{if(Array.isArray(d))return"lista";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${d.expected}, fick ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Ogiltig inmatning: förväntat ${R0(d.values[0])}`;return`Ogiltigt val: förväntade en av ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`För stor(t): förväntade ${d.origin??"värdet"} att ha ${S}${d.maximum.toString()} ${c.unit??"element"}`;return`För stor(t): förväntat ${d.origin??"värdet"} att ha ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`För lite(t): förväntade ${d.origin??"värdet"} att ha ${S}${d.minimum.toString()} ${c.unit}`;return`För lite(t): förväntade ${d.origin??"värdet"} att ha ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Ogiltig sträng: måste börja med "${S.prefix}"`;if(S.format==="ends_with")return`Ogiltig sträng: måste sluta med "${S.suffix}"`;if(S.format==="includes")return`Ogiltig sträng: måste innehålla "${S.includes}"`;if(S.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${S.pattern}"`;return`Ogiltig(t) ${h[S.format]??d.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${d.divisor}`;case"unrecognized_keys":return`${d.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${U(d.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${d.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${d.origin??"värdet"}`;default:return"Ogiltig input"}}};function Ya(){return{localeError:Ja()}}var Xa=()=>{let E={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(d))return"அணி";if(d===null)return"வெறுமை";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${d.expected}, பெறப்பட்டது ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${R0(d.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${U(d.values,"|")} இல் ஒன்று`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${d.origin??"மதிப்பு"} ${S}${d.maximum.toString()} ${c.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${d.origin??"மதிப்பு"} ${S}${d.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${d.origin} ${S}${d.minimum.toString()} ${c.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${d.origin} ${S}${d.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`தவறான சரம்: "${S.prefix}" இல் தொடங்க வேண்டும்`;if(S.format==="ends_with")return`தவறான சரம்: "${S.suffix}" இல் முடிவடைய வேண்டும்`;if(S.format==="includes")return`தவறான சரம்: "${S.includes}" ஐ உள்ளடக்க வேண்டும்`;if(S.format==="regex")return`தவறான சரம்: ${S.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${h[S.format]??d.format}`}case"not_multiple_of":return`தவறான எண்: ${d.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${d.keys.length>1?"கள்":""}: ${U(d.keys,", ")}`;case"invalid_key":return`${d.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${d.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function $a(){return{localeError:Xa()}}var EC=()=>{let E={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(d))return"อาร์เรย์ (Array)";if(d===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${d.expected} แต่ได้รับ ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${R0(d.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"ไม่เกิน":"น้อยกว่า",c=y(d.origin);if(c)return`เกินกำหนด: ${d.origin??"ค่า"} ควรมี${S} ${d.maximum.toString()} ${c.unit??"รายการ"}`;return`เกินกำหนด: ${d.origin??"ค่า"} ควรมี${S} ${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?"อย่างน้อย":"มากกว่า",c=y(d.origin);if(c)return`น้อยกว่ากำหนด: ${d.origin} ควรมี${S} ${d.minimum.toString()} ${c.unit}`;return`น้อยกว่ากำหนด: ${d.origin} ควรมี${S} ${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${S.prefix}"`;if(S.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${S.suffix}"`;if(S.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${S.includes}" อยู่ในข้อความ`;if(S.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${S.pattern}`;return`รูปแบบไม่ถูกต้อง: ${h[S.format]??d.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${d.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${U(d.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${d.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${d.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function yC(){return{localeError:EC()}}var dC=(E)=>{let y=typeof E;switch(y){case"number":return Number.isNaN(E)?"NaN":"number";case"object":{if(Array.isArray(E))return"array";if(E===null)return"null";if(Object.getPrototypeOf(E)!==Object.prototype&&E.constructor)return E.constructor.name}}return y},pC=()=>{let E={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function y(h){return E[h]??null}let p={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(h)=>{switch(h.code){case"invalid_type":return`Geçersiz değer: beklenen ${h.expected}, alınan ${dC(h.input)}`;case"invalid_value":if(h.values.length===1)return`Geçersiz değer: beklenen ${R0(h.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${U(h.values,"|")}`;case"too_big":{let d=h.inclusive?"<=":"<",S=y(h.origin);if(S)return`Çok büyük: beklenen ${h.origin??"değer"} ${d}${h.maximum.toString()} ${S.unit??"öğe"}`;return`Çok büyük: beklenen ${h.origin??"değer"} ${d}${h.maximum.toString()}`}case"too_small":{let d=h.inclusive?">=":">",S=y(h.origin);if(S)return`Çok küçük: beklenen ${h.origin} ${d}${h.minimum.toString()} ${S.unit}`;return`Çok küçük: beklenen ${h.origin} ${d}${h.minimum.toString()}`}case"invalid_format":{let d=h;if(d.format==="starts_with")return`Geçersiz metin: "${d.prefix}" ile başlamalı`;if(d.format==="ends_with")return`Geçersiz metin: "${d.suffix}" ile bitmeli`;if(d.format==="includes")return`Geçersiz metin: "${d.includes}" içermeli`;if(d.format==="regex")return`Geçersiz metin: ${d.pattern} desenine uymalı`;return`Geçersiz ${p[d.format]??h.format}`}case"not_multiple_of":return`Geçersiz sayı: ${h.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${h.keys.length>1?"lar":""}: ${U(h.keys,", ")}`;case"invalid_key":return`${h.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${h.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function hC(){return{localeError:pC()}}var SC=()=>{let E={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"число";case"object":{if(Array.isArray(d))return"масив";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${d.expected}, отримано ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Неправильні вхідні дані: очікується ${R0(d.values[0])}`;return`Неправильна опція: очікується одне з ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Занадто велике: очікується, що ${d.origin??"значення"} ${c.verb} ${S}${d.maximum.toString()} ${c.unit??"елементів"}`;return`Занадто велике: очікується, що ${d.origin??"значення"} буде ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Занадто мале: очікується, що ${d.origin} ${c.verb} ${S}${d.minimum.toString()} ${c.unit}`;return`Занадто мале: очікується, що ${d.origin} буде ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Неправильний рядок: повинен починатися з "${S.prefix}"`;if(S.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${S.suffix}"`;if(S.format==="includes")return`Неправильний рядок: повинен містити "${S.includes}"`;if(S.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${S.pattern}`;return`Неправильний ${h[S.format]??d.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${d.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${d.keys.length>1?"і":""}: ${U(d.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${d.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${d.origin}`;default:return"Неправильні вхідні дані"}}};function cC(){return{localeError:SC()}}var nC=()=>{let E={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"نمبر";case"object":{if(Array.isArray(d))return"آرے";if(d===null)return"نل";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`غلط ان پٹ: ${d.expected} متوقع تھا، ${p(d.input)} موصول ہوا`;case"invalid_value":if(d.values.length===1)return`غلط ان پٹ: ${R0(d.values[0])} متوقع تھا`;return`غلط آپشن: ${U(d.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`بہت بڑا: ${d.origin??"ویلیو"} کے ${S}${d.maximum.toString()} ${c.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${d.origin??"ویلیو"} کا ${S}${d.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`بہت چھوٹا: ${d.origin} کے ${S}${d.minimum.toString()} ${c.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${d.origin} کا ${S}${d.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`غلط سٹرنگ: "${S.prefix}" سے شروع ہونا چاہیے`;if(S.format==="ends_with")return`غلط سٹرنگ: "${S.suffix}" پر ختم ہونا چاہیے`;if(S.format==="includes")return`غلط سٹرنگ: "${S.includes}" شامل ہونا چاہیے`;if(S.format==="regex")return`غلط سٹرنگ: پیٹرن ${S.pattern} سے میچ ہونا چاہیے`;return`غلط ${h[S.format]??d.format}`}case"not_multiple_of":return`غلط نمبر: ${d.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${d.keys.length>1?"ز":""}: ${U(d.keys,"، ")}`;case"invalid_key":return`${d.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${d.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function rC(){return{localeError:nC()}}var TC=()=>{let E={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 y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"số";case"object":{if(Array.isArray(d))return"mảng";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${d.expected}, nhận được ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${R0(d.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`Quá lớn: mong đợi ${d.origin??"giá trị"} ${c.verb} ${S}${d.maximum.toString()} ${c.unit??"phần tử"}`;return`Quá lớn: mong đợi ${d.origin??"giá trị"} ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`Quá nhỏ: mong đợi ${d.origin} ${c.verb} ${S}${d.minimum.toString()} ${c.unit}`;return`Quá nhỏ: mong đợi ${d.origin} ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${S.prefix}"`;if(S.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${S.suffix}"`;if(S.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${S.includes}"`;if(S.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${S.pattern}`;return`${h[S.format]??d.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 ${d.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${U(d.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${d.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 ${d.origin}`;default:return"Đầu vào không hợp lệ"}}};function mC(){return{localeError:TC()}}var RC=()=>{let E={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(d))return"数组";if(d===null)return"空值(null)";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`无效输入:期望 ${d.expected},实际接收 ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`无效输入:期望 ${R0(d.values[0])}`;return`无效选项:期望以下之一 ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`数值过大:期望 ${d.origin??"值"} ${S}${d.maximum.toString()} ${c.unit??"个元素"}`;return`数值过大:期望 ${d.origin??"值"} ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`数值过小:期望 ${d.origin} ${S}${d.minimum.toString()} ${c.unit}`;return`数值过小:期望 ${d.origin} ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`无效字符串:必须以 "${S.prefix}" 开头`;if(S.format==="ends_with")return`无效字符串:必须以 "${S.suffix}" 结尾`;if(S.format==="includes")return`无效字符串:必须包含 "${S.includes}"`;if(S.format==="regex")return`无效字符串:必须满足正则表达式 ${S.pattern}`;return`无效${h[S.format]??d.format}`}case"not_multiple_of":return`无效数字:必须是 ${d.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${U(d.keys,", ")}`;case"invalid_key":return`${d.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${d.origin} 中包含无效值(value)`;default:return"无效输入"}}};function fC(){return{localeError:RC()}}var uC=()=>{let E={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function y(d){return E[d]??null}let p=(d)=>{let S=typeof d;switch(S){case"number":return Number.isNaN(d)?"NaN":"number";case"object":{if(Array.isArray(d))return"array";if(d===null)return"null";if(Object.getPrototypeOf(d)!==Object.prototype&&d.constructor)return d.constructor.name}}return S},h={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(d)=>{switch(d.code){case"invalid_type":return`無效的輸入值:預期為 ${d.expected},但收到 ${p(d.input)}`;case"invalid_value":if(d.values.length===1)return`無效的輸入值:預期為 ${R0(d.values[0])}`;return`無效的選項:預期為以下其中之一 ${U(d.values,"|")}`;case"too_big":{let S=d.inclusive?"<=":"<",c=y(d.origin);if(c)return`數值過大:預期 ${d.origin??"值"} 應為 ${S}${d.maximum.toString()} ${c.unit??"個元素"}`;return`數值過大:預期 ${d.origin??"值"} 應為 ${S}${d.maximum.toString()}`}case"too_small":{let S=d.inclusive?">=":">",c=y(d.origin);if(c)return`數值過小:預期 ${d.origin} 應為 ${S}${d.minimum.toString()} ${c.unit}`;return`數值過小:預期 ${d.origin} 應為 ${S}${d.minimum.toString()}`}case"invalid_format":{let S=d;if(S.format==="starts_with")return`無效的字串:必須以 "${S.prefix}" 開頭`;if(S.format==="ends_with")return`無效的字串:必須以 "${S.suffix}" 結尾`;if(S.format==="includes")return`無效的字串:必須包含 "${S.includes}"`;if(S.format==="regex")return`無效的字串:必須符合格式 ${S.pattern}`;return`無效的 ${h[S.format]??d.format}`}case"not_multiple_of":return`無效的數字:必須為 ${d.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${d.keys.length>1?"們":""}:${U(d.keys,"、")}`;case"invalid_key":return`${d.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${d.origin} 中有無效的值`;default:return"無效的輸入值"}}};function kC(){return{localeError:uC()}}var U9=Symbol("ZodOutput"),G9=Symbol("ZodInput");class cE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(E,...y){let p=y[0];if(this._map.set(E,p),p&&typeof p==="object"&&"id"in p){if(this._idmap.has(p.id))throw Error(`ID ${p.id} already exists in the registry`);this._idmap.set(p.id,E)}return this}remove(E){return this._map.delete(E),this}get(E){let y=E._zod.parent;if(y){let p={...this.get(y)??{}};return delete p.id,{...p,...this._map.get(E)}}return this._map.get(E)}has(E){return this._map.has(E)}}function dd(){return new cE}var c6=dd();function W9(E,y){return new E({type:"string",...H(y)})}function z9(E,y){return new E({type:"string",coerce:!0,...H(y)})}function pd(E,y){return new E({type:"string",format:"email",check:"string_format",abort:!1,...H(y)})}function D8(E,y){return new E({type:"string",format:"guid",check:"string_format",abort:!1,...H(y)})}function hd(E,y){return new E({type:"string",format:"uuid",check:"string_format",abort:!1,...H(y)})}function Sd(E,y){return new E({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(y)})}function cd(E,y){return new E({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(y)})}function nd(E,y){return new E({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(y)})}function rd(E,y){return new E({type:"string",format:"url",check:"string_format",abort:!1,...H(y)})}function Td(E,y){return new E({type:"string",format:"emoji",check:"string_format",abort:!1,...H(y)})}function md(E,y){return new E({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(y)})}function Rd(E,y){return new E({type:"string",format:"cuid",check:"string_format",abort:!1,...H(y)})}function fd(E,y){return new E({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(y)})}function ud(E,y){return new E({type:"string",format:"ulid",check:"string_format",abort:!1,...H(y)})}function kd(E,y){return new E({type:"string",format:"xid",check:"string_format",abort:!1,...H(y)})}function ad(E,y){return new E({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(y)})}function Cd(E,y){return new E({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(y)})}function od(E,y){return new E({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(y)})}function xd(E,y){return new E({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(y)})}function Id(E,y){return new E({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(y)})}function id(E,y){return new E({type:"string",format:"base64",check:"string_format",abort:!1,...H(y)})}function td(E,y){return new E({type:"string",format:"base64url",check:"string_format",abort:!1,...H(y)})}function Zd(E,y){return new E({type:"string",format:"e164",check:"string_format",abort:!1,...H(y)})}function vd(E,y){return new E({type:"string",format:"jwt",check:"string_format",abort:!1,...H(y)})}var Q9={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function J9(E,y){return new E({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(y)})}function Y9(E,y){return new E({type:"string",format:"date",check:"string_format",...H(y)})}function X9(E,y){return new E({type:"string",format:"time",check:"string_format",precision:null,...H(y)})}function $9(E,y){return new E({type:"string",format:"duration",check:"string_format",...H(y)})}function En(E,y){return new E({type:"number",checks:[],...H(y)})}function yn(E,y){return new E({type:"number",coerce:!0,checks:[],...H(y)})}function dn(E,y){return new E({type:"number",check:"number_format",abort:!1,format:"safeint",...H(y)})}function pn(E,y){return new E({type:"number",check:"number_format",abort:!1,format:"float32",...H(y)})}function hn(E,y){return new E({type:"number",check:"number_format",abort:!1,format:"float64",...H(y)})}function Sn(E,y){return new E({type:"number",check:"number_format",abort:!1,format:"int32",...H(y)})}function cn(E,y){return new E({type:"number",check:"number_format",abort:!1,format:"uint32",...H(y)})}function nn(E,y){return new E({type:"boolean",...H(y)})}function rn(E,y){return new E({type:"boolean",coerce:!0,...H(y)})}function Tn(E,y){return new E({type:"bigint",...H(y)})}function mn(E,y){return new E({type:"bigint",coerce:!0,...H(y)})}function Rn(E,y){return new E({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...H(y)})}function fn(E,y){return new E({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...H(y)})}function un(E,y){return new E({type:"symbol",...H(y)})}function kn(E,y){return new E({type:"undefined",...H(y)})}function an(E,y){return new E({type:"null",...H(y)})}function Cn(E){return new E({type:"any"})}function V8(E){return new E({type:"unknown"})}function on(E,y){return new E({type:"never",...H(y)})}function xn(E,y){return new E({type:"void",...H(y)})}function In(E,y){return new E({type:"date",...H(y)})}function tn(E,y){return new E({type:"date",coerce:!0,...H(y)})}function Zn(E,y){return new E({type:"nan",...H(y)})}function m6(E,y){return new Hy({check:"less_than",...H(y),value:E,inclusive:!1})}function M3(E,y){return new Hy({check:"less_than",...H(y),value:E,inclusive:!0})}function R6(E,y){return new Oy({check:"greater_than",...H(y),value:E,inclusive:!1})}function m3(E,y){return new Oy({check:"greater_than",...H(y),value:E,inclusive:!0})}function vn(E){return R6(0,E)}function Fn(E){return m6(0,E)}function An(E){return M3(0,E)}function Mn(E){return m3(0,E)}function L4(E,y){return new vc({check:"multiple_of",...H(y),value:E})}function nE(E,y){return new Mc({check:"max_size",...H(y),maximum:E})}function j4(E,y){return new sc({check:"min_size",...H(y),minimum:E})}function Fd(E,y){return new bc({check:"size_equals",...H(y),size:E})}function rE(E,y){return new ec({check:"max_length",...H(y),maximum:E})}function _6(E,y){return new gc({check:"min_length",...H(y),minimum:E})}function TE(E,y){return new lc({check:"length_equals",...H(y),length:E})}function Ad(E,y){return new Pc({check:"string_format",format:"regex",...H(y),pattern:E})}function Md(E){return new Lc({check:"string_format",format:"lowercase",...H(E)})}function sd(E){return new jc({check:"string_format",format:"uppercase",...H(E)})}function bd(E,y){return new qc({check:"string_format",format:"includes",...H(y),includes:E})}function ed(E,y){return new _c({check:"string_format",format:"starts_with",...H(y),prefix:E})}function gd(E,y){return new Dc({check:"string_format",format:"ends_with",...H(y),suffix:E})}function sn(E,y,p){return new Vc({check:"property",property:E,schema:y,...H(p)})}function ld(E,y){return new Bc({check:"mime_type",mime:E,...H(y)})}function C6(E){return new Nc({check:"overwrite",tx:E})}function Pd(E){return C6((y)=>y.normalize(E))}function Ld(){return C6((E)=>E.trim())}function jd(){return C6((E)=>E.toLowerCase())}function qd(){return C6((E)=>E.toUpperCase())}function _d(E,y,p){return new E({type:"array",element:y,...H(p)})}function aC(E,y,p){return new E({type:"union",options:y,...H(p)})}function CC(E,y,p,h){return new E({type:"union",options:p,discriminator:y,...H(h)})}function oC(E,y,p){return new E({type:"intersection",left:y,right:p})}function bn(E,y,p,h){let d=p instanceof T0;return new E({type:"tuple",items:y,rest:d?p:null,...H(d?h:p)})}function xC(E,y,p,h){return new E({type:"record",keyType:y,valueType:p,...H(h)})}function IC(E,y,p,h){return new E({type:"map",keyType:y,valueType:p,...H(h)})}function iC(E,y,p){return new E({type:"set",valueType:y,...H(p)})}function tC(E,y,p){let h=Array.isArray(y)?Object.fromEntries(y.map((d)=>[d,d])):y;return new E({type:"enum",entries:h,...H(p)})}function ZC(E,y,p){return new E({type:"enum",entries:y,...H(p)})}function vC(E,y,p){return new E({type:"literal",values:Array.isArray(y)?y:[y],...H(p)})}function en(E,y){return new E({type:"file",...H(y)})}function FC(E,y){return new E({type:"transform",transform:y})}function AC(E,y){return new E({type:"optional",innerType:y})}function MC(E,y){return new E({type:"nullable",innerType:y})}function sC(E,y,p){return new E({type:"default",innerType:y,get defaultValue(){return typeof p==="function"?p():p}})}function bC(E,y,p){return new E({type:"nonoptional",innerType:y,...H(p)})}function eC(E,y){return new E({type:"success",innerType:y})}function gC(E,y,p){return new E({type:"catch",innerType:y,catchValue:typeof p==="function"?p:()=>p})}function lC(E,y,p){return new E({type:"pipe",in:y,out:p})}function PC(E,y){return new E({type:"readonly",innerType:y})}function LC(E,y,p){return new E({type:"template_literal",parts:y,...H(p)})}function jC(E,y){return new E({type:"lazy",getter:y})}function qC(E,y){return new E({type:"promise",innerType:y})}function gn(E,y,p){let h=H(p);return h.abort??(h.abort=!0),new E({type:"custom",check:"custom",fn:y,...h})}function ln(E,y,p){return new E({type:"custom",check:"custom",fn:y,...H(p)})}function Pn(E,y){let p=H(y),h=p.truthy??["true","1","yes","on","y","enabled"],d=p.falsy??["false","0","no","off","n","disabled"];if(p.case!=="sensitive")h=h.map((u)=>typeof u==="string"?u.toLowerCase():u),d=d.map((u)=>typeof u==="string"?u.toLowerCase():u);let S=new Set(h),c=new Set(d),n=E.Pipe??Ed,r=E.Boolean??zy,T=E.String??N4,k=new(E.Transform??$y)({type:"transform",transform:(u,i)=>{let v=u;if(p.case!=="sensitive")v=v.toLowerCase();if(S.has(v))return!0;else if(c.has(v))return!1;else return i.issues.push({code:"invalid_value",expected:"stringbool",values:[...S,...c],input:i.value,inst:k}),{}},error:p.error}),o=new n({type:"pipe",in:new T({type:"string",error:p.error}),out:k,error:p.error});return new n({type:"pipe",in:o,out:new r({type:"boolean",error:p.error}),error:p.error})}function Ln(E,y,p,h={}){let d=H(h),S={...H(h),check:"string_format",type:"string",format:y,fn:typeof p==="function"?p:(c)=>p.test(c),...d};if(p instanceof RegExp)S.pattern=p;return new E(S)}class Dd{constructor(E){this._def=E,this.def=E}implement(E){if(typeof E!=="function")throw Error("implement() must be called with a function");let y=(...p)=>{let h=this._def.input?j8(this._def.input,p,void 0,{callee:y}):p;if(!Array.isArray(h))throw Error("Invalid arguments schema: not an array or tuple schema.");let d=E(...h);return this._def.output?j8(this._def.output,d,void 0,{callee:y}):d};return y}implementAsync(E){if(typeof E!=="function")throw Error("implement() must be called with a function");let y=async(...p)=>{let h=this._def.input?await q8(this._def.input,p,void 0,{callee:y}):p;if(!Array.isArray(h))throw Error("Invalid arguments schema: not an array or tuple schema.");let d=await E(...h);return this._def.output?q8(this._def.output,d,void 0,{callee:y}):d};return y}input(...E){let y=this.constructor;if(Array.isArray(E[0]))return new y({type:"function",input:new SE({type:"tuple",items:E[0],rest:E[1]}),output:this._def.output});return new y({type:"function",input:E[0],output:this._def.output})}output(E){return new this.constructor({type:"function",input:this._def.input,output:E})}}function jn(E){return new Dd({type:"function",input:Array.isArray(E?.input)?bn(SE,E?.input):E?.input??_d(Jy,V8(_8)),output:E?.output??V8(_8)})}class B8{constructor(E){this.counter=0,this.metadataRegistry=E?.metadata??c6,this.target=E?.target??"draft-2020-12",this.unrepresentable=E?.unrepresentable??"throw",this.override=E?.override??(()=>{}),this.io=E?.io??"output",this.seen=new Map}process(E,y={path:[],schemaPath:[]}){var p;let h=E._zod.def,d={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},S=this.seen.get(E);if(S){if(S.count++,y.schemaPath.includes(E))S.cycle=y.path;return S.schema}let c={schema:{},count:1,cycle:void 0,path:y.path};this.seen.set(E,c);let n=E._zod.toJSONSchema?.();if(n)c.schema=n;else{let T={...y,schemaPath:[...y.schemaPath,E],path:y.path},k=E._zod.parent;if(k)c.ref=k,this.process(k,T),this.seen.get(k).isParent=!0;else{let o=c.schema;switch(h.type){case"string":{let u=o;u.type="string";let{minimum:i,maximum:v,format:F,patterns:t,contentEncoding:m}=E._zod.bag;if(typeof i==="number")u.minLength=i;if(typeof v==="number")u.maxLength=v;if(F){if(u.format=d[F]??F,u.format==="")delete u.format}if(m)u.contentEncoding=m;if(t&&t.size>0){let a=[...t];if(a.length===1)u.pattern=a[0].source;else if(a.length>1)c.schema.allOf=[...a.map((R)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:R.source}))]}break}case"number":{let u=o,{minimum:i,maximum:v,format:F,multipleOf:t,exclusiveMaximum:m,exclusiveMinimum:a}=E._zod.bag;if(typeof F==="string"&&F.includes("int"))u.type="integer";else u.type="number";if(typeof a==="number")u.exclusiveMinimum=a;if(typeof i==="number"){if(u.minimum=i,typeof a==="number")if(a>=i)delete u.minimum;else delete u.exclusiveMinimum}if(typeof m==="number")u.exclusiveMaximum=m;if(typeof v==="number"){if(u.maximum=v,typeof m==="number")if(m<=v)delete u.maximum;else delete u.exclusiveMaximum}if(typeof t==="number")u.multipleOf=t;break}case"boolean":{let u=o;u.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":{o.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{o.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let u=o,{minimum:i,maximum:v}=E._zod.bag;if(typeof i==="number")u.minItems=i;if(typeof v==="number")u.maxItems=v;u.type="array",u.items=this.process(h.element,{...T,path:[...T.path,"items"]});break}case"object":{let u=o;u.type="object",u.properties={};let i=h.shape;for(let t in i)u.properties[t]=this.process(i[t],{...T,path:[...T.path,"properties",t]});let v=new Set(Object.keys(i)),F=new Set([...v].filter((t)=>{let m=h.shape[t]._zod;if(this.io==="input")return m.optin===void 0;else return m.optout===void 0}));if(F.size>0)u.required=Array.from(F);if(h.catchall?._zod.def.type==="never")u.additionalProperties=!1;else if(!h.catchall){if(this.io==="output")u.additionalProperties=!1}else if(h.catchall)u.additionalProperties=this.process(h.catchall,{...T,path:[...T.path,"additionalProperties"]});break}case"union":{let u=o;u.anyOf=h.options.map((i,v)=>this.process(i,{...T,path:[...T.path,"anyOf",v]}));break}case"intersection":{let u=o,i=this.process(h.left,{...T,path:[...T.path,"allOf",0]}),v=this.process(h.right,{...T,path:[...T.path,"allOf",1]}),F=(m)=>("allOf"in m)&&Object.keys(m).length===1,t=[...F(i)?i.allOf:[i],...F(v)?v.allOf:[v]];u.allOf=t;break}case"tuple":{let u=o;u.type="array";let i=h.items.map((t,m)=>this.process(t,{...T,path:[...T.path,"prefixItems",m]}));if(this.target==="draft-2020-12")u.prefixItems=i;else u.items=i;if(h.rest){let t=this.process(h.rest,{...T,path:[...T.path,"items"]});if(this.target==="draft-2020-12")u.items=t;else u.additionalItems=t}if(h.rest)u.items=this.process(h.rest,{...T,path:[...T.path,"items"]});let{minimum:v,maximum:F}=E._zod.bag;if(typeof v==="number")u.minItems=v;if(typeof F==="number")u.maxItems=F;break}case"record":{let u=o;u.type="object",u.propertyNames=this.process(h.keyType,{...T,path:[...T.path,"propertyNames"]}),u.additionalProperties=this.process(h.valueType,{...T,path:[...T.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 u=o,i=ey(h.entries);if(i.every((v)=>typeof v==="number"))u.type="number";if(i.every((v)=>typeof v==="string"))u.type="string";u.enum=i;break}case"literal":{let u=o,i=[];for(let v of h.values)if(v===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof v==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(v));else i.push(v);if(i.length===0);else if(i.length===1){let v=i[0];u.type=v===null?"null":typeof v,u.const=v}else{if(i.every((v)=>typeof v==="number"))u.type="number";if(i.every((v)=>typeof v==="string"))u.type="string";if(i.every((v)=>typeof v==="boolean"))u.type="string";if(i.every((v)=>v===null))u.type="null";u.enum=i}break}case"file":{let u=o,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:v,maximum:F,mime:t}=E._zod.bag;if(v!==void 0)i.minLength=v;if(F!==void 0)i.maxLength=F;if(t)if(t.length===1)i.contentMediaType=t[0],Object.assign(u,i);else u.anyOf=t.map((m)=>{return{...i,contentMediaType:m}});else Object.assign(u,i);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let u=this.process(h.innerType,T);o.anyOf=[u,{type:"null"}];break}case"nonoptional":{this.process(h.innerType,T),c.ref=h.innerType;break}case"success":{let u=o;u.type="boolean";break}case"default":{this.process(h.innerType,T),c.ref=h.innerType,o.default=JSON.parse(JSON.stringify(h.defaultValue));break}case"prefault":{if(this.process(h.innerType,T),c.ref=h.innerType,this.io==="input")o._prefault=JSON.parse(JSON.stringify(h.defaultValue));break}case"catch":{this.process(h.innerType,T),c.ref=h.innerType;let u;try{u=h.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}o.default=u;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let u=o,i=E._zod.pattern;if(!i)throw Error("Pattern not found in template literal");u.type="string",u.pattern=i.source;break}case"pipe":{let u=this.io==="input"?h.in._zod.def.type==="transform"?h.out:h.in:h.out;this.process(u,T),c.ref=u;break}case"readonly":{this.process(h.innerType,T),c.ref=h.innerType,o.readOnly=!0;break}case"promise":{this.process(h.innerType,T),c.ref=h.innerType;break}case"optional":{this.process(h.innerType,T),c.ref=h.innerType;break}case"lazy":{let u=E._zod.innerType;this.process(u,T),c.ref=u;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let r=this.metadataRegistry.get(E);if(r)Object.assign(c.schema,r);if(this.io==="input"&&w0(E))delete c.schema.examples,delete c.schema.default;if(this.io==="input"&&c.schema._prefault)(p=c.schema).default??(p.default=c.schema._prefault);return delete c.schema._prefault,this.seen.get(E).schema}emit(E,y){let p={cycles:y?.cycles??"ref",reused:y?.reused??"inline",external:y?.external??void 0},h=this.seen.get(E);if(!h)throw Error("Unprocessed schema. This is a bug in Zod.");let d=(T)=>{let k=this.target==="draft-2020-12"?"$defs":"definitions";if(p.external){let i=p.external.registry.get(T[0])?.id;if(i)return{ref:p.external.uri(i)};let v=T[1].defId??T[1].schema.id??`schema${this.counter++}`;return T[1].defId=v,{defId:v,ref:`${p.external.uri("__shared")}#/${k}/${v}`}}if(T[1]===h)return{ref:"#"};let o=`#/${k}/`,u=T[1].schema.id??`__schema${this.counter++}`;return{defId:u,ref:o+u}},S=(T)=>{if(T[1].schema.$ref)return;let k=T[1],{ref:o,defId:u}=d(T);if(k.def={...k.schema},u)k.defId=u;let i=k.schema;for(let v in i)delete i[v];i.$ref=o};for(let T of this.seen.entries()){let k=T[1];if(E===T[0]){S(T);continue}if(p.external){let o=p.external.registry.get(T[0])?.id;if(E!==T[0]&&o){S(T);continue}}if(this.metadataRegistry.get(T[0])?.id){S(T);continue}if(k.cycle){if(p.cycles==="throw")throw Error(`Cycle detected: #/${k.cycle?.join("/")}/<root>
82
+ path: iss.path ? [${ve(d)}, ...iss.path] : [${ve(d)}]
83
+ })));`),u.write(`newResult[${ve(d)}] = ${E}.value`)}u.write("payload.value = newResult;"),u.write("return payload;");let R=u.compile();return(d,E)=>R(m,d,E)},a,n=Ma,i=!Ps.jitless,h=i&&Do.value,o=e.catchall,c;t._zod.parse=(m,u)=>{c??(c=s.value);let p=m.value;if(!n(p))return m.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),m;let k=[];if(i&&h&&u?.async===!1&&u.jitless!==!0){if(!a)a=r(e.shape);m=a(m,u)}else{m.value={};let E=c.shape;for(let y of c.keys){let l=E[y],T=l._zod.run({value:p[y],issues:[]},u),f=l._zod.optin==="optional"&&l._zod.optout==="optional";if(T instanceof Promise)k.push(T.then((x)=>f?fh(x,m,y,p):ys(x,m,y)));else if(f)fh(T,m,y,p);else ys(T,m,y)}}if(!o)return k.length?Promise.all(k).then(()=>m):m;let C=[],I=c.keySet,R=o._zod,d=R.def.type;for(let E of Object.keys(p)){if(I.has(E))continue;if(d==="never"){C.push(E);continue}let y=R.run({value:p[E],issues:[]},u);if(y instanceof Promise)k.push(y.then((l)=>ys(l,m,E)));else ys(y,m,E)}if(C.length)m.issues.push({code:"unrecognized_keys",keys:C,input:p,inst:t});if(!k.length)return m;return Promise.all(k).then(()=>{return m})}});function Th(t,e,s,r){for(let a of t)if(a.issues.length===0)return e.value=a.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:s,errors:t.map((a)=>a.issues.map((n)=>A0(n,r,r0())))}),e}var $n=Z("$ZodUnion",(t,e)=>{ct.init(t,e),Ct(t._zod,"optin",()=>e.options.some((s)=>s._zod.optin==="optional")?"optional":void 0),Ct(t._zod,"optout",()=>e.options.some((s)=>s._zod.optout==="optional")?"optional":void 0),Ct(t._zod,"values",()=>{if(e.options.every((s)=>s._zod.values))return new Set(e.options.flatMap((s)=>Array.from(s._zod.values)));return}),Ct(t._zod,"pattern",()=>{if(e.options.every((s)=>s._zod.pattern)){let s=e.options.map((r)=>r._zod.pattern);return new RegExp(`^(${s.map((r)=>ar(r.source)).join("|")})$`)}return}),t._zod.parse=(s,r)=>{let a=!1,n=[];for(let i of e.options){let h=i._zod.run({value:s.value,issues:[]},r);if(h instanceof Promise)n.push(h),a=!0;else{if(h.issues.length===0)return h;n.push(h)}}if(!a)return Th(n,s,t,r);return Promise.all(n).then((i)=>{return Th(i,s,t,r)})}}),g6=Z("$ZodDiscriminatedUnion",(t,e)=>{$n.init(t,e);let s=t._zod.parse;Ct(t._zod,"propValues",()=>{let a={};for(let n of e.options){let i=n._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let[h,o]of Object.entries(i)){if(!a[h])a[h]=new Set;for(let c of o)a[h].add(c)}}return a});let r=er(()=>{let a=e.options,n=new Map;for(let i of a){let h=i._zod.propValues[e.discriminator];if(!h||h.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let o of h){if(n.has(o))throw Error(`Duplicate discriminator value "${String(o)}"`);n.set(o,i)}}return n});t._zod.parse=(a,n)=>{let i=a.value;if(!Ma(i))return a.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),a;let h=r.value.get(i?.[e.discriminator]);if(h)return h._zod.run(a,n);if(e.unionFallback)return s(a,n);return a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[e.discriminator],inst:t}),a}}),b6=Z("$ZodIntersection",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=s.value,n=e.left._zod.run({value:a,issues:[]},r),i=e.right._zod.run({value:a,issues:[]},r);if(n instanceof Promise||i instanceof Promise)return Promise.all([n,i]).then(([h,o])=>{return kh(s,h,o)});return kh(s,n,i)}});function zr(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t===+e)return{valid:!0,data:t};if(Pa(t)&&Pa(e)){let s=Object.keys(e),r=Object.keys(t).filter((n)=>s.indexOf(n)!==-1),a={...t,...e};for(let n of r){let i=zr(t[n],e[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};a[n]=i.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let s=[];for(let r=0;r<t.length;r++){let a=t[r],n=e[r],i=zr(a,n);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};s.push(i.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function kh(t,e,s){if(e.issues.length)t.issues.push(...e.issues);if(s.issues.length)t.issues.push(...s.issues);if(Ze(t))return t;let r=zr(e.value,s.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}var nr=Z("$ZodTuple",(t,e)=>{ct.init(t,e);let s=e.items,r=s.length-[...s].reverse().findIndex((a)=>a._zod.optin!=="optional");t._zod.parse=(a,n)=>{let i=a.value;if(!Array.isArray(i))return a.issues.push({input:i,inst:t,expected:"tuple",code:"invalid_type"}),a;a.value=[];let h=[];if(!e.rest){let c=i.length>s.length,m=i.length<r-1;if(c||m)return a.issues.push({input:i,inst:t,origin:"array",...c?{code:"too_big",maximum:s.length}:{code:"too_small",minimum:s.length}}),a}let o=-1;for(let c of s){if(o++,o>=i.length){if(o>=r)continue}let m=c._zod.run({value:i[o],issues:[]},n);if(m instanceof Promise)h.push(m.then((u)=>ls(u,a,o)));else ls(m,a,o)}if(e.rest){let c=i.slice(s.length);for(let m of c){o++;let u=e.rest._zod.run({value:m,issues:[]},n);if(u instanceof Promise)h.push(u.then((p)=>ls(p,a,o)));else ls(u,a,o)}}if(h.length)return Promise.all(h).then(()=>a);return a}});function ls(t,e,s){if(t.issues.length)e.issues.push(...f0(s,t.issues));e.value[s]=t.value}var A6=Z("$ZodRecord",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=s.value;if(!Pa(a))return s.issues.push({expected:"record",code:"invalid_type",input:a,inst:t}),s;let n=[];if(e.keyType._zod.values){let i=e.keyType._zod.values;s.value={};for(let o of i)if(typeof o==="string"||typeof o==="number"||typeof o==="symbol"){let c=e.valueType._zod.run({value:a[o],issues:[]},r);if(c instanceof Promise)n.push(c.then((m)=>{if(m.issues.length)s.issues.push(...f0(o,m.issues));s.value[o]=m.value}));else{if(c.issues.length)s.issues.push(...f0(o,c.issues));s.value[o]=c.value}}let h;for(let o in a)if(!i.has(o))h=h??[],h.push(o);if(h&&h.length>0)s.issues.push({code:"unrecognized_keys",input:a,inst:t,keys:h})}else{s.value={};for(let i of Reflect.ownKeys(a)){if(i==="__proto__")continue;let h=e.keyType._zod.run({value:i,issues:[]},r);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(h.issues.length){s.issues.push({origin:"record",code:"invalid_key",issues:h.issues.map((c)=>A0(c,r,r0())),input:i,path:[i],inst:t}),s.value[h.value]=h.value;continue}let o=e.valueType._zod.run({value:a[i],issues:[]},r);if(o instanceof Promise)n.push(o.then((c)=>{if(c.issues.length)s.issues.push(...f0(i,c.issues));s.value[h.value]=c.value}));else{if(o.issues.length)s.issues.push(...f0(i,o.issues));s.value[h.value]=o.value}}}if(n.length)return Promise.all(n).then(()=>s);return s}}),Z6=Z("$ZodMap",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=s.value;if(!(a instanceof Map))return s.issues.push({expected:"map",code:"invalid_type",input:a,inst:t}),s;let n=[];s.value=new Map;for(let[i,h]of a){let o=e.keyType._zod.run({value:i,issues:[]},r),c=e.valueType._zod.run({value:h,issues:[]},r);if(o instanceof Promise||c instanceof Promise)n.push(Promise.all([o,c]).then(([m,u])=>{Rh(m,u,s,i,a,t,r)}));else Rh(o,c,s,i,a,t,r)}if(n.length)return Promise.all(n).then(()=>s);return s}});function Rh(t,e,s,r,a,n,i){if(t.issues.length)if(Ls.has(typeof r))s.issues.push(...f0(r,t.issues));else s.issues.push({origin:"map",code:"invalid_key",input:a,inst:n,issues:t.issues.map((h)=>A0(h,i,r0()))});if(e.issues.length)if(Ls.has(typeof r))s.issues.push(...f0(r,e.issues));else s.issues.push({origin:"map",code:"invalid_element",input:a,inst:n,key:r,issues:e.issues.map((h)=>A0(h,i,r0()))});s.value.set(t.value,e.value)}var F6=Z("$ZodSet",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=s.value;if(!(a instanceof Set))return s.issues.push({input:a,inst:t,expected:"set",code:"invalid_type"}),s;let n=[];s.value=new Set;for(let i of a){let h=e.valueType._zod.run({value:i,issues:[]},r);if(h instanceof Promise)n.push(h.then((o)=>xh(o,s)));else xh(h,s)}if(n.length)return Promise.all(n).then(()=>s);return s}});function xh(t,e){if(t.issues.length)e.issues.push(...t.issues);e.value.add(t.value)}var M6=Z("$ZodEnum",(t,e)=>{ct.init(t,e);let s=Fn(e.entries);t._zod.values=new Set(s),t._zod.pattern=new RegExp(`^(${s.filter((r)=>Ls.has(typeof r)).map((r)=>typeof r==="string"?Ee(r):r.toString()).join("|")})$`),t._zod.parse=(r,a)=>{let n=r.value;if(t._zod.values.has(n))return r;return r.issues.push({code:"invalid_value",values:s,input:n,inst:t}),r}}),P6=Z("$ZodLiteral",(t,e)=>{ct.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map((s)=>typeof s==="string"?Ee(s):s?s.toString():String(s)).join("|")})$`),t._zod.parse=(s,r)=>{let a=s.value;if(t._zod.values.has(a))return s;return s.issues.push({code:"invalid_value",values:e.values,input:a,inst:t}),s}}),L6=Z("$ZodFile",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=s.value;if(a instanceof File)return s;return s.issues.push({expected:"file",code:"invalid_type",input:a,inst:t}),s}}),t3=Z("$ZodTransform",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=e.transform(s.value,s);if(r.async)return(a instanceof Promise?a:Promise.resolve(a)).then((n)=>{return s.value=n,s});if(a instanceof Promise)throw new ce;return s.value=a,s}}),j6=Z("$ZodOptional",(t,e)=>{ct.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ct(t._zod,"values",()=>{return e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0}),Ct(t._zod,"pattern",()=>{let s=e.innerType._zod.pattern;return s?new RegExp(`^(${ar(s.source)})?$`):void 0}),t._zod.parse=(s,r)=>{if(e.innerType._zod.optin==="optional")return e.innerType._zod.run(s,r);if(s.value===void 0)return s;return e.innerType._zod.run(s,r)}}),q6=Z("$ZodNullable",(t,e)=>{ct.init(t,e),Ct(t._zod,"optin",()=>e.innerType._zod.optin),Ct(t._zod,"optout",()=>e.innerType._zod.optout),Ct(t._zod,"pattern",()=>{let s=e.innerType._zod.pattern;return s?new RegExp(`^(${ar(s.source)}|null)$`):void 0}),Ct(t._zod,"values",()=>{return e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0}),t._zod.parse=(s,r)=>{if(s.value===null)return s;return e.innerType._zod.run(s,r)}}),_6=Z("$ZodDefault",(t,e)=>{ct.init(t,e),t._zod.optin="optional",Ct(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(s,r)=>{if(s.value===void 0)return s.value=e.defaultValue,s;let a=e.innerType._zod.run(s,r);if(a instanceof Promise)return a.then((n)=>Ch(n,e));return Ch(a,e)}});function Ch(t,e){if(t.value===void 0)t.value=e.defaultValue;return t}var D6=Z("$ZodPrefault",(t,e)=>{ct.init(t,e),t._zod.optin="optional",Ct(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(s,r)=>{if(s.value===void 0)s.value=e.defaultValue;return e.innerType._zod.run(s,r)}}),B6=Z("$ZodNonOptional",(t,e)=>{ct.init(t,e),Ct(t._zod,"values",()=>{let s=e.innerType._zod.values;return s?new Set([...s].filter((r)=>r!==void 0)):void 0}),t._zod.parse=(s,r)=>{let a=e.innerType._zod.run(s,r);if(a instanceof Promise)return a.then((n)=>Ih(n,t));return Ih(a,t)}});function Ih(t,e){if(!t.issues.length&&t.value===void 0)t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e});return t}var V6=Z("$ZodSuccess",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{let a=e.innerType._zod.run(s,r);if(a instanceof Promise)return a.then((n)=>{return s.value=n.issues.length===0,s});return s.value=a.issues.length===0,s}}),N6=Z("$ZodCatch",(t,e)=>{ct.init(t,e),t._zod.optin="optional",Ct(t._zod,"optout",()=>e.innerType._zod.optout),Ct(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(s,r)=>{let a=e.innerType._zod.run(s,r);if(a instanceof Promise)return a.then((n)=>{if(s.value=n.value,n.issues.length)s.value=e.catchValue({...s,error:{issues:n.issues.map((i)=>A0(i,r,r0()))},input:s.value}),s.issues=[];return s});if(s.value=a.value,a.issues.length)s.value=e.catchValue({...s,error:{issues:a.issues.map((n)=>A0(n,r,r0()))},input:s.value}),s.issues=[];return s}}),w6=Z("$ZodNaN",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{if(typeof s.value!=="number"||!Number.isNaN(s.value))return s.issues.push({input:s.value,inst:t,expected:"nan",code:"invalid_type"}),s;return s}}),e3=Z("$ZodPipe",(t,e)=>{ct.init(t,e),Ct(t._zod,"values",()=>e.in._zod.values),Ct(t._zod,"optin",()=>e.in._zod.optin),Ct(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(s,r)=>{let a=e.in._zod.run(s,r);if(a instanceof Promise)return a.then((n)=>vh(n,e,r));return vh(a,e,r)}});function vh(t,e,s){if(Ze(t))return t;return e.out._zod.run({value:t.value,issues:t.issues},s)}var K6=Z("$ZodReadonly",(t,e)=>{ct.init(t,e),Ct(t._zod,"propValues",()=>e.innerType._zod.propValues),Ct(t._zod,"values",()=>e.innerType._zod.values),Ct(t._zod,"optin",()=>e.innerType._zod.optin),Ct(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(s,r)=>{let a=e.innerType._zod.run(s,r);if(a instanceof Promise)return a.then(gh);return gh(a)}});function gh(t){return t.value=Object.freeze(t.value),t}var H6=Z("$ZodTemplateLiteral",(t,e)=>{ct.init(t,e);let s=[];for(let r of e.parts)if(r instanceof ct){if(!r._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let a=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!a)throw Error(`Invalid template literal part: ${r._zod.traits}`);let n=a.startsWith("^")?1:0,i=a.endsWith("$")?a.length-1:a.length;s.push(a.slice(n,i))}else if(r===null||Bo.has(typeof r))s.push(Ee(`${r}`));else throw Error(`Invalid template literal part: ${r}`);t._zod.pattern=new RegExp(`^${s.join("")}$`),t._zod.parse=(r,a)=>{if(typeof r.value!=="string")return r.issues.push({input:r.value,inst:t,expected:"template_literal",code:"invalid_type"}),r;if(t._zod.pattern.lastIndex=0,!t._zod.pattern.test(r.value))return r.issues.push({input:r.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),r;return r}}),O6=Z("$ZodPromise",(t,e)=>{ct.init(t,e),t._zod.parse=(s,r)=>{return Promise.resolve(s.value).then((a)=>e.innerType._zod.run({value:a,issues:[]},r))}}),U6=Z("$ZodLazy",(t,e)=>{ct.init(t,e),Ct(t._zod,"innerType",()=>e.getter()),Ct(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Ct(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Ct(t._zod,"optin",()=>t._zod.innerType._zod.optin),Ct(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(s,r)=>{return t._zod.innerType._zod.run(s,r)}}),G6=Z("$ZodCustom",(t,e)=>{Bt.init(t,e),ct.init(t,e),t._zod.parse=(s,r)=>{return s},t._zod.check=(s)=>{let r=s.value,a=e.fn(r);if(a instanceof Promise)return a.then((n)=>bh(n,s,r,t));bh(a,s,r,t);return}});function bh(t,e,s,r){if(!t){let a={code:"custom",input:s,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};if(r._zod.def.params)a.params=r._zod.def.params;e.issues.push(Ko(a))}}var a3={};le(a3,{zhTW:()=>mS,zhCN:()=>lS,vi:()=>dS,ur:()=>oS,ua:()=>iS,tr:()=>rS,th:()=>eS,ta:()=>$u,sv:()=>Yu,sl:()=>Qu,ru:()=>Wu,pt:()=>Uu,ps:()=>wu,pl:()=>Hu,ota:()=>Vu,no:()=>Du,nl:()=>qu,ms:()=>Lu,mk:()=>Mu,ko:()=>Zu,kh:()=>bu,ja:()=>vu,it:()=>Cu,id:()=>Ru,hu:()=>Tu,he:()=>Su,frCA:()=>Eu,fr:()=>pu,fi:()=>yu,fa:()=>cu,es:()=>hu,eo:()=>nu,en:()=>W6,de:()=>tu,cs:()=>XE,ca:()=>JE,be:()=>zE,az:()=>GE,ar:()=>OE});var HE=()=>{let t={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${a.expected}، ولكن تم إدخال ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${yt(a.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return` أكبر من اللازم: يفترض أن تكون ${a.origin??"القيمة"} ${n} ${a.maximum.toString()} ${i.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${a.origin??"القيمة"} ${n} ${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`أصغر من اللازم: يفترض لـ ${a.origin} أن يكون ${n} ${a.minimum.toString()} ${i.unit}`;return`أصغر من اللازم: يفترض لـ ${a.origin} أن يكون ${n} ${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${a.prefix}"`;if(n.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${n.suffix}"`;if(n.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${n.includes}"`;if(n.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${n.pattern}`;return`${r[n.format]??a.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${a.divisor}`;case"unrecognized_keys":return`معرف${a.keys.length>1?"ات":""} غريب${a.keys.length>1?"ة":""}: ${U(a.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${a.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${a.origin}`;default:return"مدخل غير مقبول"}}};function OE(){return{localeError:HE()}}var UE=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${a.expected}, daxil olan ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Yanlış dəyər: gözlənilən ${yt(a.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Çox böyük: gözlənilən ${a.origin??"dəyər"} ${n}${a.maximum.toString()} ${i.unit??"element"}`;return`Çox böyük: gözlənilən ${a.origin??"dəyər"} ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Çox kiçik: gözlənilən ${a.origin} ${n}${a.minimum.toString()} ${i.unit}`;return`Çox kiçik: gözlənilən ${a.origin} ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Yanlış mətn: "${n.prefix}" ilə başlamalıdır`;if(n.format==="ends_with")return`Yanlış mətn: "${n.suffix}" ilə bitməlidir`;if(n.format==="includes")return`Yanlış mətn: "${n.includes}" daxil olmalıdır`;if(n.format==="regex")return`Yanlış mətn: ${n.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${r[n.format]??a.format}`}case"not_multiple_of":return`Yanlış ədəd: ${a.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${a.keys.length>1?"lar":""}: ${U(a.keys,", ")}`;case"invalid_key":return`${a.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${a.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function GE(){return{localeError:UE()}}function Ah(t,e,s,r){let a=Math.abs(t),n=a%10,i=a%100;if(i>=11&&i<=19)return r;if(n===1)return e;if(n>=2&&n<=4)return s;return r}var WE=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"лік";case"object":{if(Array.isArray(a))return"масіў";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${a.expected}, атрымана ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Няправільны ўвод: чакалася ${yt(a.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i){let h=Number(a.maximum),o=Ah(h,i.unit.one,i.unit.few,i.unit.many);return`Занадта вялікі: чакалася, што ${a.origin??"значэнне"} павінна ${i.verb} ${n}${a.maximum.toString()} ${o}`}return`Занадта вялікі: чакалася, што ${a.origin??"значэнне"} павінна быць ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i){let h=Number(a.minimum),o=Ah(h,i.unit.one,i.unit.few,i.unit.many);return`Занадта малы: чакалася, што ${a.origin} павінна ${i.verb} ${n}${a.minimum.toString()} ${o}`}return`Занадта малы: чакалася, што ${a.origin} павінна быць ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${n.prefix}"`;if(n.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${n.suffix}"`;if(n.format==="includes")return`Няправільны радок: павінен змяшчаць "${n.includes}"`;if(n.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${n.pattern}`;return`Няправільны ${r[n.format]??a.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${a.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${a.keys.length>1?"ключы":"ключ"}: ${U(a.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${a.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${a.origin}`;default:return"Няправільны ўвод"}}};function zE(){return{localeError:WE()}}var QE=()=>{let t={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Tipus invàlid: s'esperava ${a.expected}, s'ha rebut ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Valor invàlid: s'esperava ${yt(a.values[0])}`;return`Opció invàlida: s'esperava una de ${U(a.values," o ")}`;case"too_big":{let n=a.inclusive?"com a màxim":"menys de",i=e(a.origin);if(i)return`Massa gran: s'esperava que ${a.origin??"el valor"} contingués ${n} ${a.maximum.toString()} ${i.unit??"elements"}`;return`Massa gran: s'esperava que ${a.origin??"el valor"} fos ${n} ${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?"com a mínim":"més de",i=e(a.origin);if(i)return`Massa petit: s'esperava que ${a.origin} contingués ${n} ${a.minimum.toString()} ${i.unit}`;return`Massa petit: s'esperava que ${a.origin} fos ${n} ${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Format invàlid: ha de començar amb "${n.prefix}"`;if(n.format==="ends_with")return`Format invàlid: ha d'acabar amb "${n.suffix}"`;if(n.format==="includes")return`Format invàlid: ha d'incloure "${n.includes}"`;if(n.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${n.pattern}`;return`Format invàlid per a ${r[n.format]??a.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${a.divisor}`;case"unrecognized_keys":return`Clau${a.keys.length>1?"s":""} no reconeguda${a.keys.length>1?"s":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${a.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${a.origin}`;default:return"Entrada invàlida"}}};function JE(){return{localeError:QE()}}var YE=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"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(a))return"pole";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Neplatný vstup: očekáváno ${a.expected}, obdrženo ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Neplatný vstup: očekáváno ${yt(a.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Hodnota je příliš velká: ${a.origin??"hodnota"} musí mít ${n}${a.maximum.toString()} ${i.unit??"prvků"}`;return`Hodnota je příliš velká: ${a.origin??"hodnota"} musí být ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Hodnota je příliš malá: ${a.origin??"hodnota"} musí mít ${n}${a.minimum.toString()} ${i.unit??"prvků"}`;return`Hodnota je příliš malá: ${a.origin??"hodnota"} musí být ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Neplatný řetězec: musí začínat na "${n.prefix}"`;if(n.format==="ends_with")return`Neplatný řetězec: musí končit na "${n.suffix}"`;if(n.format==="includes")return`Neplatný řetězec: musí obsahovat "${n.includes}"`;if(n.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${n.pattern}`;return`Neplatný formát ${r[n.format]??a.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${a.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${U(a.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${a.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${a.origin}`;default:return"Neplatný vstup"}}};function XE(){return{localeError:YE()}}var $E=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"Zahl";case"object":{if(Array.isArray(a))return"Array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${a.expected}, erhalten ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Ungültige Eingabe: erwartet ${yt(a.values[0])}`;return`Ungültige Option: erwartet eine von ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Zu groß: erwartet, dass ${a.origin??"Wert"} ${n}${a.maximum.toString()} ${i.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${a.origin??"Wert"} ${n}${a.maximum.toString()} ist`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Zu klein: erwartet, dass ${a.origin} ${n}${a.minimum.toString()} ${i.unit} hat`;return`Zu klein: erwartet, dass ${a.origin} ${n}${a.minimum.toString()} ist`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Ungültiger String: muss mit "${n.prefix}" beginnen`;if(n.format==="ends_with")return`Ungültiger String: muss mit "${n.suffix}" enden`;if(n.format==="includes")return`Ungültiger String: muss "${n.includes}" enthalten`;if(n.format==="regex")return`Ungültiger String: muss dem Muster ${n.pattern} entsprechen`;return`Ungültig: ${r[n.format]??a.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${a.divisor} sein`;case"unrecognized_keys":return`${a.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${U(a.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${a.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${a.origin}`;default:return"Ungültige Eingabe"}}};function tu(){return{localeError:$E()}}var eu=(t)=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},au=()=>{let t={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 e(r){return t[r]??null}let s={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(r)=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${eu(r.input)}`;case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${yt(r.values[0])}`;return`Invalid option: expected one of ${U(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",n=e(r.origin);if(n)return`Too big: expected ${r.origin??"value"} to have ${a}${r.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",n=e(r.origin);if(n)return`Too small: expected ${r.origin} to have ${a}${r.minimum.toString()} ${n.unit}`;return`Too small: expected ${r.origin} to be ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;if(a.format==="starts_with")return`Invalid string: must start with "${a.prefix}"`;if(a.format==="ends_with")return`Invalid string: must end with "${a.suffix}"`;if(a.format==="includes")return`Invalid string: must include "${a.includes}"`;if(a.format==="regex")return`Invalid string: must match pattern ${a.pattern}`;return`Invalid ${s[a.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${U(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function W6(){return{localeError:au()}}var su=(t)=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},ru=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}let s={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(r)=>{switch(r.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${r.expected}, riceviĝis ${su(r.input)}`;case"invalid_value":if(r.values.length===1)return`Nevalida enigo: atendiĝis ${yt(r.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${U(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",n=e(r.origin);if(n)return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${a}${r.maximum.toString()} ${n.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",n=e(r.origin);if(n)return`Tro malgranda: atendiĝis ke ${r.origin} havu ${a}${r.minimum.toString()} ${n.unit}`;return`Tro malgranda: atendiĝis ke ${r.origin} estu ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;if(a.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${a.prefix}"`;if(a.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${a.suffix}"`;if(a.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${a.includes}"`;if(a.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`;return`Nevalida ${s[a.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${U(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function nu(){return{localeError:ru()}}var iu=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"número";case"object":{if(Array.isArray(a))return"arreglo";if(a===null)return"nulo";if(Object.getPrototypeOf(a)!==Object.prototype)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Entrada inválida: se esperaba ${a.expected}, recibido ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Entrada inválida: se esperaba ${yt(a.values[0])}`;return`Opción inválida: se esperaba una de ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Demasiado grande: se esperaba que ${a.origin??"valor"} tuviera ${n}${a.maximum.toString()} ${i.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${a.origin??"valor"} fuera ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Demasiado pequeño: se esperaba que ${a.origin} tuviera ${n}${a.minimum.toString()} ${i.unit}`;return`Demasiado pequeño: se esperaba que ${a.origin} fuera ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Cadena inválida: debe comenzar con "${n.prefix}"`;if(n.format==="ends_with")return`Cadena inválida: debe terminar en "${n.suffix}"`;if(n.format==="includes")return`Cadena inválida: debe incluir "${n.includes}"`;if(n.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${n.pattern}`;return`Inválido ${r[n.format]??a.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Llave inválida en ${a.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${a.origin}`;default:return"Entrada inválida"}}};function hu(){return{localeError:iu()}}var ou=()=>{let t={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"عدد";case"object":{if(Array.isArray(a))return"آرایه";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${a.expected} می‌بود، ${s(a.input)} دریافت شد`;case"invalid_value":if(a.values.length===1)return`ورودی نامعتبر: می‌بایست ${yt(a.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${U(a.values,"|")} می‌بود`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`خیلی بزرگ: ${a.origin??"مقدار"} باید ${n}${a.maximum.toString()} ${i.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${a.origin??"مقدار"} باید ${n}${a.maximum.toString()} باشد`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`خیلی کوچک: ${a.origin} باید ${n}${a.minimum.toString()} ${i.unit} باشد`;return`خیلی کوچک: ${a.origin} باید ${n}${a.minimum.toString()} باشد`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`رشته نامعتبر: باید با "${n.prefix}" شروع شود`;if(n.format==="ends_with")return`رشته نامعتبر: باید با "${n.suffix}" تمام شود`;if(n.format==="includes")return`رشته نامعتبر: باید شامل "${n.includes}" باشد`;if(n.format==="regex")return`رشته نامعتبر: باید با الگوی ${n.pattern} مطابقت داشته باشد`;return`${r[n.format]??a.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${a.divisor} باشد`;case"unrecognized_keys":return`کلید${a.keys.length>1?"های":""} ناشناس: ${U(a.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${a.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${a.origin}`;default:return"ورودی نامعتبر"}}};function cu(){return{localeError:ou()}}var du=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${a.expected}, oli ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Virheellinen syöte: täytyy olla ${yt(a.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Liian suuri: ${i.subject} täytyy olla ${n}${a.maximum.toString()} ${i.unit}`.trim();return`Liian suuri: arvon täytyy olla ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Liian pieni: ${i.subject} täytyy olla ${n}${a.minimum.toString()} ${i.unit}`.trim();return`Liian pieni: arvon täytyy olla ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${n.prefix}"`;if(n.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${n.suffix}"`;if(n.format==="includes")return`Virheellinen syöte: täytyy sisältää "${n.includes}"`;if(n.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${n.pattern}`;return`Virheellinen ${r[n.format]??a.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${a.divisor} monikerta`;case"unrecognized_keys":return`${a.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${U(a.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"}}};function yu(){return{localeError:du()}}var lu=()=>{let t={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"nombre";case"object":{if(Array.isArray(a))return"tableau";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Entrée invalide : ${a.expected} attendu, ${s(a.input)} reçu`;case"invalid_value":if(a.values.length===1)return`Entrée invalide : ${yt(a.values[0])} attendu`;return`Option invalide : une valeur parmi ${U(a.values,"|")} attendue`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Trop grand : ${a.origin??"valeur"} doit ${i.verb} ${n}${a.maximum.toString()} ${i.unit??"élément(s)"}`;return`Trop grand : ${a.origin??"valeur"} doit être ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Trop petit : ${a.origin} doit ${i.verb} ${n}${a.minimum.toString()} ${i.unit}`;return`Trop petit : ${a.origin} doit être ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Chaîne invalide : doit commencer par "${n.prefix}"`;if(n.format==="ends_with")return`Chaîne invalide : doit se terminer par "${n.suffix}"`;if(n.format==="includes")return`Chaîne invalide : doit inclure "${n.includes}"`;if(n.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${n.pattern}`;return`${r[n.format]??a.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${a.divisor}`;case"unrecognized_keys":return`Clé${a.keys.length>1?"s":""} non reconnue${a.keys.length>1?"s":""} : ${U(a.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${a.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${a.origin}`;default:return"Entrée invalide"}}};function pu(){return{localeError:lu()}}var mu=()=>{let t={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Entrée invalide : attendu ${a.expected}, reçu ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Entrée invalide : attendu ${yt(a.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"≤":"<",i=e(a.origin);if(i)return`Trop grand : attendu que ${a.origin??"la valeur"} ait ${n}${a.maximum.toString()} ${i.unit}`;return`Trop grand : attendu que ${a.origin??"la valeur"} soit ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?"≥":">",i=e(a.origin);if(i)return`Trop petit : attendu que ${a.origin} ait ${n}${a.minimum.toString()} ${i.unit}`;return`Trop petit : attendu que ${a.origin} soit ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Chaîne invalide : doit commencer par "${n.prefix}"`;if(n.format==="ends_with")return`Chaîne invalide : doit se terminer par "${n.suffix}"`;if(n.format==="includes")return`Chaîne invalide : doit inclure "${n.includes}"`;if(n.format==="regex")return`Chaîne invalide : doit correspondre au motif ${n.pattern}`;return`${r[n.format]??a.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${a.divisor}`;case"unrecognized_keys":return`Clé${a.keys.length>1?"s":""} non reconnue${a.keys.length>1?"s":""} : ${U(a.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${a.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${a.origin}`;default:return"Entrée invalide"}}};function Eu(){return{localeError:mu()}}var uu=()=>{let t={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(a)=>{switch(a.code){case"invalid_type":return`קלט לא תקין: צריך ${a.expected}, התקבל ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`קלט לא תקין: צריך ${yt(a.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`גדול מדי: ${a.origin??"value"} צריך להיות ${n}${a.maximum.toString()} ${i.unit??"elements"}`;return`גדול מדי: ${a.origin??"value"} צריך להיות ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`קטן מדי: ${a.origin} צריך להיות ${n}${a.minimum.toString()} ${i.unit}`;return`קטן מדי: ${a.origin} צריך להיות ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${n.prefix}"`;if(n.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${n.suffix}"`;if(n.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${n.includes}"`;if(n.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${n.pattern}`;return`${r[n.format]??a.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${a.divisor}`;case"unrecognized_keys":return`מפתח${a.keys.length>1?"ות":""} לא מזוה${a.keys.length>1?"ים":"ה"}: ${U(a.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${a.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${a.origin}`;default:return"קלט לא תקין"}}};function Su(){return{localeError:uu()}}var fu=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"szám";case"object":{if(Array.isArray(a))return"tömb";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${a.expected}, a kapott érték ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Érvénytelen bemenet: a várt érték ${yt(a.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Túl nagy: ${a.origin??"érték"} mérete túl nagy ${n}${a.maximum.toString()} ${i.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${a.origin??"érték"} túl nagy: ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Túl kicsi: a bemeneti érték ${a.origin} mérete túl kicsi ${n}${a.minimum.toString()} ${i.unit}`;return`Túl kicsi: a bemeneti érték ${a.origin} túl kicsi ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Érvénytelen string: "${n.prefix}" értékkel kell kezdődnie`;if(n.format==="ends_with")return`Érvénytelen string: "${n.suffix}" értékkel kell végződnie`;if(n.format==="includes")return`Érvénytelen string: "${n.includes}" értéket kell tartalmaznia`;if(n.format==="regex")return`Érvénytelen string: ${n.pattern} mintának kell megfelelnie`;return`Érvénytelen ${r[n.format]??a.format}`}case"not_multiple_of":return`Érvénytelen szám: ${a.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${a.keys.length>1?"s":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${a.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${a.origin}`;default:return"Érvénytelen bemenet"}}};function Tu(){return{localeError:fu()}}var ku=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Input tidak valid: diharapkan ${a.expected}, diterima ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Input tidak valid: diharapkan ${yt(a.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Terlalu besar: diharapkan ${a.origin??"value"} memiliki ${n}${a.maximum.toString()} ${i.unit??"elemen"}`;return`Terlalu besar: diharapkan ${a.origin??"value"} menjadi ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Terlalu kecil: diharapkan ${a.origin} memiliki ${n}${a.minimum.toString()} ${i.unit}`;return`Terlalu kecil: diharapkan ${a.origin} menjadi ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`String tidak valid: harus dimulai dengan "${n.prefix}"`;if(n.format==="ends_with")return`String tidak valid: harus berakhir dengan "${n.suffix}"`;if(n.format==="includes")return`String tidak valid: harus menyertakan "${n.includes}"`;if(n.format==="regex")return`String tidak valid: harus sesuai pola ${n.pattern}`;return`${r[n.format]??a.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${a.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${a.keys.length>1?"s":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${a.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${a.origin}`;default:return"Input tidak valid"}}};function Ru(){return{localeError:ku()}}var xu=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"numero";case"object":{if(Array.isArray(a))return"vettore";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Input non valido: atteso ${a.expected}, ricevuto ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Input non valido: atteso ${yt(a.values[0])}`;return`Opzione non valida: atteso uno tra ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Troppo grande: ${a.origin??"valore"} deve avere ${n}${a.maximum.toString()} ${i.unit??"elementi"}`;return`Troppo grande: ${a.origin??"valore"} deve essere ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Troppo piccolo: ${a.origin} deve avere ${n}${a.minimum.toString()} ${i.unit}`;return`Troppo piccolo: ${a.origin} deve essere ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Stringa non valida: deve iniziare con "${n.prefix}"`;if(n.format==="ends_with")return`Stringa non valida: deve terminare con "${n.suffix}"`;if(n.format==="includes")return`Stringa non valida: deve includere "${n.includes}"`;if(n.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${n.pattern}`;return`Invalid ${r[n.format]??a.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${a.divisor}`;case"unrecognized_keys":return`Chiav${a.keys.length>1?"i":"e"} non riconosciut${a.keys.length>1?"e":"a"}: ${U(a.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${a.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${a.origin}`;default:return"Input non valido"}}};function Cu(){return{localeError:xu()}}var Iu=()=>{let t={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"数値";case"object":{if(Array.isArray(a))return"配列";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`無効な入力: ${a.expected}が期待されましたが、${s(a.input)}が入力されました`;case"invalid_value":if(a.values.length===1)return`無効な入力: ${yt(a.values[0])}が期待されました`;return`無効な選択: ${U(a.values,"、")}のいずれかである必要があります`;case"too_big":{let n=a.inclusive?"以下である":"より小さい",i=e(a.origin);if(i)return`大きすぎる値: ${a.origin??"値"}は${a.maximum.toString()}${i.unit??"要素"}${n}必要があります`;return`大きすぎる値: ${a.origin??"値"}は${a.maximum.toString()}${n}必要があります`}case"too_small":{let n=a.inclusive?"以上である":"より大きい",i=e(a.origin);if(i)return`小さすぎる値: ${a.origin}は${a.minimum.toString()}${i.unit}${n}必要があります`;return`小さすぎる値: ${a.origin}は${a.minimum.toString()}${n}必要があります`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`無効な文字列: "${n.prefix}"で始まる必要があります`;if(n.format==="ends_with")return`無効な文字列: "${n.suffix}"で終わる必要があります`;if(n.format==="includes")return`無効な文字列: "${n.includes}"を含む必要があります`;if(n.format==="regex")return`無効な文字列: パターン${n.pattern}に一致する必要があります`;return`無効な${r[n.format]??a.format}`}case"not_multiple_of":return`無効な数値: ${a.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${a.keys.length>1?"群":""}: ${U(a.keys,"、")}`;case"invalid_key":return`${a.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${a.origin}内の無効な値`;default:return"無効な入力"}}};function vu(){return{localeError:Iu()}}var gu=()=>{let t={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(a))return"អារេ (Array)";if(a===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${a.expected} ប៉ុន្តែទទួលបាន ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${yt(a.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`ធំពេក៖ ត្រូវការ ${a.origin??"តម្លៃ"} ${n} ${a.maximum.toString()} ${i.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${a.origin??"តម្លៃ"} ${n} ${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`តូចពេក៖ ត្រូវការ ${a.origin} ${n} ${a.minimum.toString()} ${i.unit}`;return`តូចពេក៖ ត្រូវការ ${a.origin} ${n} ${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${n.prefix}"`;if(n.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${n.suffix}"`;if(n.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${n.includes}"`;if(n.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${n.pattern}`;return`មិនត្រឹមត្រូវ៖ ${r[n.format]??a.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${a.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${U(a.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${a.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${a.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function bu(){return{localeError:gu()}}var Au=()=>{let t={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${a.expected}, 받은 타입은 ${s(a.input)}입니다`;case"invalid_value":if(a.values.length===1)return`잘못된 입력: 값은 ${yt(a.values[0])} 이어야 합니다`;return`잘못된 옵션: ${U(a.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let n=a.inclusive?"이하":"미만",i=n==="미만"?"이어야 합니다":"여야 합니다",h=e(a.origin),o=h?.unit??"요소";if(h)return`${a.origin??"값"}이 너무 큽니다: ${a.maximum.toString()}${o} ${n}${i}`;return`${a.origin??"값"}이 너무 큽니다: ${a.maximum.toString()} ${n}${i}`}case"too_small":{let n=a.inclusive?"이상":"초과",i=n==="이상"?"이어야 합니다":"여야 합니다",h=e(a.origin),o=h?.unit??"요소";if(h)return`${a.origin??"값"}이 너무 작습니다: ${a.minimum.toString()}${o} ${n}${i}`;return`${a.origin??"값"}이 너무 작습니다: ${a.minimum.toString()} ${n}${i}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`잘못된 문자열: "${n.prefix}"(으)로 시작해야 합니다`;if(n.format==="ends_with")return`잘못된 문자열: "${n.suffix}"(으)로 끝나야 합니다`;if(n.format==="includes")return`잘못된 문자열: "${n.includes}"을(를) 포함해야 합니다`;if(n.format==="regex")return`잘못된 문자열: 정규식 ${n.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${r[n.format]??a.format}`}case"not_multiple_of":return`잘못된 숫자: ${a.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${U(a.keys,", ")}`;case"invalid_key":return`잘못된 키: ${a.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${a.origin}`;default:return"잘못된 입력"}}};function Zu(){return{localeError:Au()}}var Fu=()=>{let t={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"број";case"object":{if(Array.isArray(a))return"низа";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Грешен внес: се очекува ${a.expected}, примено ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Invalid input: expected ${yt(a.values[0])}`;return`Грешана опција: се очекува една ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Премногу голем: се очекува ${a.origin??"вредноста"} да има ${n}${a.maximum.toString()} ${i.unit??"елементи"}`;return`Премногу голем: се очекува ${a.origin??"вредноста"} да биде ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Премногу мал: се очекува ${a.origin} да има ${n}${a.minimum.toString()} ${i.unit}`;return`Премногу мал: се очекува ${a.origin} да биде ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Неважечка низа: мора да започнува со "${n.prefix}"`;if(n.format==="ends_with")return`Неважечка низа: мора да завршува со "${n.suffix}"`;if(n.format==="includes")return`Неважечка низа: мора да вклучува "${n.includes}"`;if(n.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${n.pattern}`;return`Invalid ${r[n.format]??a.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${U(a.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${a.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${a.origin}`;default:return"Грешен внес"}}};function Mu(){return{localeError:Fu()}}var Pu=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"nombor";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Input tidak sah: dijangka ${a.expected}, diterima ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Input tidak sah: dijangka ${yt(a.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Terlalu besar: dijangka ${a.origin??"nilai"} ${i.verb} ${n}${a.maximum.toString()} ${i.unit??"elemen"}`;return`Terlalu besar: dijangka ${a.origin??"nilai"} adalah ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Terlalu kecil: dijangka ${a.origin} ${i.verb} ${n}${a.minimum.toString()} ${i.unit}`;return`Terlalu kecil: dijangka ${a.origin} adalah ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`String tidak sah: mesti bermula dengan "${n.prefix}"`;if(n.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${n.suffix}"`;if(n.format==="includes")return`String tidak sah: mesti mengandungi "${n.includes}"`;if(n.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${n.pattern}`;return`${r[n.format]??a.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${a.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${U(a.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${a.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${a.origin}`;default:return"Input tidak sah"}}};function Lu(){return{localeError:Pu()}}var ju=()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"getal";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Ongeldige invoer: verwacht ${a.expected}, ontving ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Ongeldige invoer: verwacht ${yt(a.values[0])}`;return`Ongeldige optie: verwacht één van ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Te lang: verwacht dat ${a.origin??"waarde"} ${n}${a.maximum.toString()} ${i.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${a.origin??"waarde"} ${n}${a.maximum.toString()} is`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Te kort: verwacht dat ${a.origin} ${n}${a.minimum.toString()} ${i.unit} bevat`;return`Te kort: verwacht dat ${a.origin} ${n}${a.minimum.toString()} is`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Ongeldige tekst: moet met "${n.prefix}" beginnen`;if(n.format==="ends_with")return`Ongeldige tekst: moet op "${n.suffix}" eindigen`;if(n.format==="includes")return`Ongeldige tekst: moet "${n.includes}" bevatten`;if(n.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${n.pattern}`;return`Ongeldig: ${r[n.format]??a.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${a.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${a.keys.length>1?"s":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${a.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${a.origin}`;default:return"Ongeldige invoer"}}};function qu(){return{localeError:ju()}}var _u=()=>{let t={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"tall";case"object":{if(Array.isArray(a))return"liste";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Ugyldig input: forventet ${a.expected}, fikk ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Ugyldig verdi: forventet ${yt(a.values[0])}`;return`Ugyldig valg: forventet en av ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`For stor(t): forventet ${a.origin??"value"} til å ha ${n}${a.maximum.toString()} ${i.unit??"elementer"}`;return`For stor(t): forventet ${a.origin??"value"} til å ha ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`For lite(n): forventet ${a.origin} til å ha ${n}${a.minimum.toString()} ${i.unit}`;return`For lite(n): forventet ${a.origin} til å ha ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Ugyldig streng: må starte med "${n.prefix}"`;if(n.format==="ends_with")return`Ugyldig streng: må ende med "${n.suffix}"`;if(n.format==="includes")return`Ugyldig streng: må inneholde "${n.includes}"`;if(n.format==="regex")return`Ugyldig streng: må matche mønsteret ${n.pattern}`;return`Ugyldig ${r[n.format]??a.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${U(a.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${a.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${a.origin}`;default:return"Ugyldig input"}}};function Du(){return{localeError:_u()}}var Bu=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"numara";case"object":{if(Array.isArray(a))return"saf";if(a===null)return"gayb";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Fâsit giren: umulan ${a.expected}, alınan ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Fâsit giren: umulan ${yt(a.values[0])}`;return`Fâsit tercih: mûteberler ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Fazla büyük: ${a.origin??"value"}, ${n}${a.maximum.toString()} ${i.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${a.origin??"value"}, ${n}${a.maximum.toString()} olmalıydı.`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Fazla küçük: ${a.origin}, ${n}${a.minimum.toString()} ${i.unit} sahip olmalıydı.`;return`Fazla küçük: ${a.origin}, ${n}${a.minimum.toString()} olmalıydı.`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Fâsit metin: "${n.prefix}" ile başlamalı.`;if(n.format==="ends_with")return`Fâsit metin: "${n.suffix}" ile bitmeli.`;if(n.format==="includes")return`Fâsit metin: "${n.includes}" ihtivâ etmeli.`;if(n.format==="regex")return`Fâsit metin: ${n.pattern} nakşına uymalı.`;return`Fâsit ${r[n.format]??a.format}`}case"not_multiple_of":return`Fâsit sayı: ${a.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${a.keys.length>1?"s":""}: ${U(a.keys,", ")}`;case"invalid_key":return`${a.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${a.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Vu(){return{localeError:Bu()}}var Nu=()=>{let t={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"عدد";case"object":{if(Array.isArray(a))return"ارې";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`ناسم ورودي: باید ${a.expected} وای, مګر ${s(a.input)} ترلاسه شو`;case"invalid_value":if(a.values.length===1)return`ناسم ورودي: باید ${yt(a.values[0])} وای`;return`ناسم انتخاب: باید یو له ${U(a.values,"|")} څخه وای`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`ډیر لوی: ${a.origin??"ارزښت"} باید ${n}${a.maximum.toString()} ${i.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${a.origin??"ارزښت"} باید ${n}${a.maximum.toString()} وي`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`ډیر کوچنی: ${a.origin} باید ${n}${a.minimum.toString()} ${i.unit} ولري`;return`ډیر کوچنی: ${a.origin} باید ${n}${a.minimum.toString()} وي`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`ناسم متن: باید د "${n.prefix}" سره پیل شي`;if(n.format==="ends_with")return`ناسم متن: باید د "${n.suffix}" سره پای ته ورسيږي`;if(n.format==="includes")return`ناسم متن: باید "${n.includes}" ولري`;if(n.format==="regex")return`ناسم متن: باید د ${n.pattern} سره مطابقت ولري`;return`${r[n.format]??a.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${a.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${a.keys.length>1?"کلیډونه":"کلیډ"}: ${U(a.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${a.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${a.origin} کې`;default:return"ناسمه ورودي"}}};function wu(){return{localeError:Nu()}}var Ku=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"liczba";case"object":{if(Array.isArray(a))return"tablica";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${a.expected}, otrzymano ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${yt(a.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Za duża wartość: oczekiwano, że ${a.origin??"wartość"} będzie mieć ${n}${a.maximum.toString()} ${i.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${a.origin??"wartość"} będzie wynosić ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Za mała wartość: oczekiwano, że ${a.origin??"wartość"} będzie mieć ${n}${a.minimum.toString()} ${i.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${a.origin??"wartość"} będzie wynosić ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${n.prefix}"`;if(n.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${n.suffix}"`;if(n.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${n.includes}"`;if(n.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${n.pattern}`;return`Nieprawidłow(y/a/e) ${r[n.format]??a.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${a.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${a.keys.length>1?"s":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${a.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${a.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Hu(){return{localeError:Ku()}}var Ou=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"número";case"object":{if(Array.isArray(a))return"array";if(a===null)return"nulo";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Tipo inválido: esperado ${a.expected}, recebido ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Entrada inválida: esperado ${yt(a.values[0])}`;return`Opção inválida: esperada uma das ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Muito grande: esperado que ${a.origin??"valor"} tivesse ${n}${a.maximum.toString()} ${i.unit??"elementos"}`;return`Muito grande: esperado que ${a.origin??"valor"} fosse ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Muito pequeno: esperado que ${a.origin} tivesse ${n}${a.minimum.toString()} ${i.unit}`;return`Muito pequeno: esperado que ${a.origin} fosse ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Texto inválido: deve começar com "${n.prefix}"`;if(n.format==="ends_with")return`Texto inválido: deve terminar com "${n.suffix}"`;if(n.format==="includes")return`Texto inválido: deve incluir "${n.includes}"`;if(n.format==="regex")return`Texto inválido: deve corresponder ao padrão ${n.pattern}`;return`${r[n.format]??a.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${a.divisor}`;case"unrecognized_keys":return`Chave${a.keys.length>1?"s":""} desconhecida${a.keys.length>1?"s":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Chave inválida em ${a.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${a.origin}`;default:return"Campo inválido"}}};function Uu(){return{localeError:Ou()}}function Zh(t,e,s,r){let a=Math.abs(t),n=a%10,i=a%100;if(i>=11&&i<=19)return r;if(n===1)return e;if(n>=2&&n<=4)return s;return r}var Gu=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"число";case"object":{if(Array.isArray(a))return"массив";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Неверный ввод: ожидалось ${a.expected}, получено ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Неверный ввод: ожидалось ${yt(a.values[0])}`;return`Неверный вариант: ожидалось одно из ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i){let h=Number(a.maximum),o=Zh(h,i.unit.one,i.unit.few,i.unit.many);return`Слишком большое значение: ожидалось, что ${a.origin??"значение"} будет иметь ${n}${a.maximum.toString()} ${o}`}return`Слишком большое значение: ожидалось, что ${a.origin??"значение"} будет ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i){let h=Number(a.minimum),o=Zh(h,i.unit.one,i.unit.few,i.unit.many);return`Слишком маленькое значение: ожидалось, что ${a.origin} будет иметь ${n}${a.minimum.toString()} ${o}`}return`Слишком маленькое значение: ожидалось, что ${a.origin} будет ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Неверная строка: должна начинаться с "${n.prefix}"`;if(n.format==="ends_with")return`Неверная строка: должна заканчиваться на "${n.suffix}"`;if(n.format==="includes")return`Неверная строка: должна содержать "${n.includes}"`;if(n.format==="regex")return`Неверная строка: должна соответствовать шаблону ${n.pattern}`;return`Неверный ${r[n.format]??a.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${a.divisor}`;case"unrecognized_keys":return`Нераспознанн${a.keys.length>1?"ые":"ый"} ключ${a.keys.length>1?"и":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${a.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${a.origin}`;default:return"Неверные входные данные"}}};function Wu(){return{localeError:Gu()}}var zu=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"število";case"object":{if(Array.isArray(a))return"tabela";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${a.expected}, prejeto ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Neveljaven vnos: pričakovano ${yt(a.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Preveliko: pričakovano, da bo ${a.origin??"vrednost"} imelo ${n}${a.maximum.toString()} ${i.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${a.origin??"vrednost"} ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Premajhno: pričakovano, da bo ${a.origin} imelo ${n}${a.minimum.toString()} ${i.unit}`;return`Premajhno: pričakovano, da bo ${a.origin} ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Neveljaven niz: mora se začeti z "${n.prefix}"`;if(n.format==="ends_with")return`Neveljaven niz: mora se končati z "${n.suffix}"`;if(n.format==="includes")return`Neveljaven niz: mora vsebovati "${n.includes}"`;if(n.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${n.pattern}`;return`Neveljaven ${r[n.format]??a.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${a.divisor}`;case"unrecognized_keys":return`Neprepoznan${a.keys.length>1?"i ključi":" ključ"}: ${U(a.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${a.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${a.origin}`;default:return"Neveljaven vnos"}}};function Qu(){return{localeError:zu()}}var Ju=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"antal";case"object":{if(Array.isArray(a))return"lista";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${a.expected}, fick ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Ogiltig inmatning: förväntat ${yt(a.values[0])}`;return`Ogiltigt val: förväntade en av ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`För stor(t): förväntade ${a.origin??"värdet"} att ha ${n}${a.maximum.toString()} ${i.unit??"element"}`;return`För stor(t): förväntat ${a.origin??"värdet"} att ha ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`För lite(t): förväntade ${a.origin??"värdet"} att ha ${n}${a.minimum.toString()} ${i.unit}`;return`För lite(t): förväntade ${a.origin??"värdet"} att ha ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Ogiltig sträng: måste börja med "${n.prefix}"`;if(n.format==="ends_with")return`Ogiltig sträng: måste sluta med "${n.suffix}"`;if(n.format==="includes")return`Ogiltig sträng: måste innehålla "${n.includes}"`;if(n.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${n.pattern}"`;return`Ogiltig(t) ${r[n.format]??a.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${U(a.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${a.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${a.origin??"värdet"}`;default:return"Ogiltig input"}}};function Yu(){return{localeError:Ju()}}var Xu=()=>{let t={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(a))return"அணி";if(a===null)return"வெறுமை";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${a.expected}, பெறப்பட்டது ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${yt(a.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${U(a.values,"|")} இல் ஒன்று`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${a.origin??"மதிப்பு"} ${n}${a.maximum.toString()} ${i.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${a.origin??"மதிப்பு"} ${n}${a.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${a.origin} ${n}${a.minimum.toString()} ${i.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${a.origin} ${n}${a.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`தவறான சரம்: "${n.prefix}" இல் தொடங்க வேண்டும்`;if(n.format==="ends_with")return`தவறான சரம்: "${n.suffix}" இல் முடிவடைய வேண்டும்`;if(n.format==="includes")return`தவறான சரம்: "${n.includes}" ஐ உள்ளடக்க வேண்டும்`;if(n.format==="regex")return`தவறான சரம்: ${n.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${r[n.format]??a.format}`}case"not_multiple_of":return`தவறான எண்: ${a.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${a.keys.length>1?"கள்":""}: ${U(a.keys,", ")}`;case"invalid_key":return`${a.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${a.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function $u(){return{localeError:Xu()}}var tS=()=>{let t={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(a))return"อาร์เรย์ (Array)";if(a===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${a.expected} แต่ได้รับ ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${yt(a.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"ไม่เกิน":"น้อยกว่า",i=e(a.origin);if(i)return`เกินกำหนด: ${a.origin??"ค่า"} ควรมี${n} ${a.maximum.toString()} ${i.unit??"รายการ"}`;return`เกินกำหนด: ${a.origin??"ค่า"} ควรมี${n} ${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?"อย่างน้อย":"มากกว่า",i=e(a.origin);if(i)return`น้อยกว่ากำหนด: ${a.origin} ควรมี${n} ${a.minimum.toString()} ${i.unit}`;return`น้อยกว่ากำหนด: ${a.origin} ควรมี${n} ${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${n.prefix}"`;if(n.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${n.suffix}"`;if(n.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${n.includes}" อยู่ในข้อความ`;if(n.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${n.pattern}`;return`รูปแบบไม่ถูกต้อง: ${r[n.format]??a.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${a.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${U(a.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${a.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${a.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function eS(){return{localeError:tS()}}var aS=(t)=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},sS=()=>{let t={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function e(r){return t[r]??null}let s={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(r)=>{switch(r.code){case"invalid_type":return`Geçersiz değer: beklenen ${r.expected}, alınan ${aS(r.input)}`;case"invalid_value":if(r.values.length===1)return`Geçersiz değer: beklenen ${yt(r.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${U(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",n=e(r.origin);if(n)return`Çok büyük: beklenen ${r.origin??"değer"} ${a}${r.maximum.toString()} ${n.unit??"öğe"}`;return`Çok büyük: beklenen ${r.origin??"değer"} ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",n=e(r.origin);if(n)return`Çok küçük: beklenen ${r.origin} ${a}${r.minimum.toString()} ${n.unit}`;return`Çok küçük: beklenen ${r.origin} ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;if(a.format==="starts_with")return`Geçersiz metin: "${a.prefix}" ile başlamalı`;if(a.format==="ends_with")return`Geçersiz metin: "${a.suffix}" ile bitmeli`;if(a.format==="includes")return`Geçersiz metin: "${a.includes}" içermeli`;if(a.format==="regex")return`Geçersiz metin: ${a.pattern} desenine uymalı`;return`Geçersiz ${s[a.format]??r.format}`}case"not_multiple_of":return`Geçersiz sayı: ${r.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${U(r.keys,", ")}`;case"invalid_key":return`${r.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${r.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function rS(){return{localeError:sS()}}var nS=()=>{let t={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"число";case"object":{if(Array.isArray(a))return"масив";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${a.expected}, отримано ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Неправильні вхідні дані: очікується ${yt(a.values[0])}`;return`Неправильна опція: очікується одне з ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Занадто велике: очікується, що ${a.origin??"значення"} ${i.verb} ${n}${a.maximum.toString()} ${i.unit??"елементів"}`;return`Занадто велике: очікується, що ${a.origin??"значення"} буде ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Занадто мале: очікується, що ${a.origin} ${i.verb} ${n}${a.minimum.toString()} ${i.unit}`;return`Занадто мале: очікується, що ${a.origin} буде ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Неправильний рядок: повинен починатися з "${n.prefix}"`;if(n.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${n.suffix}"`;if(n.format==="includes")return`Неправильний рядок: повинен містити "${n.includes}"`;if(n.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${n.pattern}`;return`Неправильний ${r[n.format]??a.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${a.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${a.keys.length>1?"і":""}: ${U(a.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${a.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${a.origin}`;default:return"Неправильні вхідні дані"}}};function iS(){return{localeError:nS()}}var hS=()=>{let t={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"نمبر";case"object":{if(Array.isArray(a))return"آرے";if(a===null)return"نل";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`غلط ان پٹ: ${a.expected} متوقع تھا، ${s(a.input)} موصول ہوا`;case"invalid_value":if(a.values.length===1)return`غلط ان پٹ: ${yt(a.values[0])} متوقع تھا`;return`غلط آپشن: ${U(a.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`بہت بڑا: ${a.origin??"ویلیو"} کے ${n}${a.maximum.toString()} ${i.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${a.origin??"ویلیو"} کا ${n}${a.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`بہت چھوٹا: ${a.origin} کے ${n}${a.minimum.toString()} ${i.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${a.origin} کا ${n}${a.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`غلط سٹرنگ: "${n.prefix}" سے شروع ہونا چاہیے`;if(n.format==="ends_with")return`غلط سٹرنگ: "${n.suffix}" پر ختم ہونا چاہیے`;if(n.format==="includes")return`غلط سٹرنگ: "${n.includes}" شامل ہونا چاہیے`;if(n.format==="regex")return`غلط سٹرنگ: پیٹرن ${n.pattern} سے میچ ہونا چاہیے`;return`غلط ${r[n.format]??a.format}`}case"not_multiple_of":return`غلط نمبر: ${a.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${a.keys.length>1?"ز":""}: ${U(a.keys,"، ")}`;case"invalid_key":return`${a.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${a.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function oS(){return{localeError:hS()}}var cS=()=>{let t={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 e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"số";case"object":{if(Array.isArray(a))return"mảng";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${a.expected}, nhận được ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${yt(a.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`Quá lớn: mong đợi ${a.origin??"giá trị"} ${i.verb} ${n}${a.maximum.toString()} ${i.unit??"phần tử"}`;return`Quá lớn: mong đợi ${a.origin??"giá trị"} ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`Quá nhỏ: mong đợi ${a.origin} ${i.verb} ${n}${a.minimum.toString()} ${i.unit}`;return`Quá nhỏ: mong đợi ${a.origin} ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${n.prefix}"`;if(n.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${n.suffix}"`;if(n.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${n.includes}"`;if(n.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${n.pattern}`;return`${r[n.format]??a.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 ${a.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${U(a.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${a.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 ${a.origin}`;default:return"Đầu vào không hợp lệ"}}};function dS(){return{localeError:cS()}}var yS=()=>{let t={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(a))return"数组";if(a===null)return"空值(null)";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`无效输入:期望 ${a.expected},实际接收 ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`无效输入:期望 ${yt(a.values[0])}`;return`无效选项:期望以下之一 ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`数值过大:期望 ${a.origin??"值"} ${n}${a.maximum.toString()} ${i.unit??"个元素"}`;return`数值过大:期望 ${a.origin??"值"} ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`数值过小:期望 ${a.origin} ${n}${a.minimum.toString()} ${i.unit}`;return`数值过小:期望 ${a.origin} ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`无效字符串:必须以 "${n.prefix}" 开头`;if(n.format==="ends_with")return`无效字符串:必须以 "${n.suffix}" 结尾`;if(n.format==="includes")return`无效字符串:必须包含 "${n.includes}"`;if(n.format==="regex")return`无效字符串:必须满足正则表达式 ${n.pattern}`;return`无效${r[n.format]??a.format}`}case"not_multiple_of":return`无效数字:必须是 ${a.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${U(a.keys,", ")}`;case"invalid_key":return`${a.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${a.origin} 中包含无效值(value)`;default:return"无效输入"}}};function lS(){return{localeError:yS()}}var pS=()=>{let t={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function e(a){return t[a]??null}let s=(a)=>{let n=typeof a;switch(n){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name}}return n},r={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(a)=>{switch(a.code){case"invalid_type":return`無效的輸入值:預期為 ${a.expected},但收到 ${s(a.input)}`;case"invalid_value":if(a.values.length===1)return`無效的輸入值:預期為 ${yt(a.values[0])}`;return`無效的選項:預期為以下其中之一 ${U(a.values,"|")}`;case"too_big":{let n=a.inclusive?"<=":"<",i=e(a.origin);if(i)return`數值過大:預期 ${a.origin??"值"} 應為 ${n}${a.maximum.toString()} ${i.unit??"個元素"}`;return`數值過大:預期 ${a.origin??"值"} 應為 ${n}${a.maximum.toString()}`}case"too_small":{let n=a.inclusive?">=":">",i=e(a.origin);if(i)return`數值過小:預期 ${a.origin} 應為 ${n}${a.minimum.toString()} ${i.unit}`;return`數值過小:預期 ${a.origin} 應為 ${n}${a.minimum.toString()}`}case"invalid_format":{let n=a;if(n.format==="starts_with")return`無效的字串:必須以 "${n.prefix}" 開頭`;if(n.format==="ends_with")return`無效的字串:必須以 "${n.suffix}" 結尾`;if(n.format==="includes")return`無效的字串:必須包含 "${n.includes}"`;if(n.format==="regex")return`無效的字串:必須符合格式 ${n.pattern}`;return`無效的 ${r[n.format]??a.format}`}case"not_multiple_of":return`無效的數字:必須為 ${a.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${a.keys.length>1?"們":""}:${U(a.keys,"、")}`;case"invalid_key":return`${a.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${a.origin} 中有無效的值`;default:return"無效的輸入值"}}};function mS(){return{localeError:pS()}}var z6=Symbol("ZodOutput"),Q6=Symbol("ZodInput");class ir{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...e){let s=e[0];if(this._map.set(t,s),s&&typeof s==="object"&&"id"in s){if(this._idmap.has(s.id))throw Error(`ID ${s.id} already exists in the registry`);this._idmap.set(s.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){let e=t._zod.parent;if(e){let s={...this.get(e)??{}};return delete s.id,{...s,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function s3(){return new ir}var ie=s3();function J6(t,e){return new t({type:"string",...H(e)})}function Y6(t,e){return new t({type:"string",coerce:!0,...H(e)})}function r3(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...H(e)})}function Ds(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...H(e)})}function n3(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...H(e)})}function i3(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(e)})}function h3(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(e)})}function o3(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(e)})}function c3(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...H(e)})}function d3(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...H(e)})}function y3(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(e)})}function l3(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...H(e)})}function p3(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(e)})}function m3(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...H(e)})}function E3(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...H(e)})}function u3(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(e)})}function S3(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(e)})}function f3(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(e)})}function T3(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(e)})}function k3(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(e)})}function R3(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...H(e)})}function x3(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...H(e)})}function C3(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...H(e)})}function I3(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...H(e)})}var X6={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function $6(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(e)})}function td(t,e){return new t({type:"string",format:"date",check:"string_format",...H(e)})}function ed(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...H(e)})}function ad(t,e){return new t({type:"string",format:"duration",check:"string_format",...H(e)})}function sd(t,e){return new t({type:"number",checks:[],...H(e)})}function rd(t,e){return new t({type:"number",coerce:!0,checks:[],...H(e)})}function nd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...H(e)})}function id(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...H(e)})}function hd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...H(e)})}function od(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...H(e)})}function cd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...H(e)})}function dd(t,e){return new t({type:"boolean",...H(e)})}function yd(t,e){return new t({type:"boolean",coerce:!0,...H(e)})}function ld(t,e){return new t({type:"bigint",...H(e)})}function pd(t,e){return new t({type:"bigint",coerce:!0,...H(e)})}function md(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...H(e)})}function Ed(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...H(e)})}function ud(t,e){return new t({type:"symbol",...H(e)})}function Sd(t,e){return new t({type:"undefined",...H(e)})}function fd(t,e){return new t({type:"null",...H(e)})}function Td(t){return new t({type:"any"})}function Bs(t){return new t({type:"unknown"})}function kd(t,e){return new t({type:"never",...H(e)})}function Rd(t,e){return new t({type:"void",...H(e)})}function xd(t,e){return new t({type:"date",...H(e)})}function Cd(t,e){return new t({type:"date",coerce:!0,...H(e)})}function Id(t,e){return new t({type:"nan",...H(e)})}function de(t,e){return new On({check:"less_than",...H(e),value:t,inclusive:!1})}function g0(t,e){return new On({check:"less_than",...H(e),value:t,inclusive:!0})}function ye(t,e){return new Un({check:"greater_than",...H(e),value:t,inclusive:!1})}function d0(t,e){return new Un({check:"greater_than",...H(e),value:t,inclusive:!0})}function vd(t){return ye(0,t)}function gd(t){return de(0,t)}function bd(t){return g0(0,t)}function Ad(t){return d0(0,t)}function La(t,e){return new gc({check:"multiple_of",...H(e),value:t})}function hr(t,e){return new Zc({check:"max_size",...H(e),maximum:t})}function ja(t,e){return new Fc({check:"min_size",...H(e),minimum:t})}function v3(t,e){return new Mc({check:"size_equals",...H(e),size:t})}function or(t,e){return new Pc({check:"max_length",...H(e),maximum:t})}function _e(t,e){return new Lc({check:"min_length",...H(e),minimum:t})}function cr(t,e){return new jc({check:"length_equals",...H(e),length:t})}function g3(t,e){return new qc({check:"string_format",format:"regex",...H(e),pattern:t})}function b3(t){return new _c({check:"string_format",format:"lowercase",...H(t)})}function A3(t){return new Dc({check:"string_format",format:"uppercase",...H(t)})}function Z3(t,e){return new Bc({check:"string_format",format:"includes",...H(e),includes:t})}function F3(t,e){return new Vc({check:"string_format",format:"starts_with",...H(e),prefix:t})}function M3(t,e){return new Nc({check:"string_format",format:"ends_with",...H(e),suffix:t})}function Zd(t,e,s){return new wc({check:"property",property:t,schema:e,...H(s)})}function P3(t,e){return new Kc({check:"mime_type",mime:t,...H(e)})}function ue(t){return new Hc({check:"overwrite",tx:t})}function L3(t){return ue((e)=>e.normalize(t))}function j3(){return ue((t)=>t.trim())}function q3(){return ue((t)=>t.toLowerCase())}function _3(){return ue((t)=>t.toUpperCase())}function D3(t,e,s){return new t({type:"array",element:e,...H(s)})}function ES(t,e,s){return new t({type:"union",options:e,...H(s)})}function uS(t,e,s,r){return new t({type:"union",options:s,discriminator:e,...H(r)})}function SS(t,e,s){return new t({type:"intersection",left:e,right:s})}function Fd(t,e,s,r){let a=s instanceof ct;return new t({type:"tuple",items:e,rest:a?s:null,...H(a?r:s)})}function fS(t,e,s,r){return new t({type:"record",keyType:e,valueType:s,...H(r)})}function TS(t,e,s,r){return new t({type:"map",keyType:e,valueType:s,...H(r)})}function kS(t,e,s){return new t({type:"set",valueType:e,...H(s)})}function RS(t,e,s){let r=Array.isArray(e)?Object.fromEntries(e.map((a)=>[a,a])):e;return new t({type:"enum",entries:r,...H(s)})}function xS(t,e,s){return new t({type:"enum",entries:e,...H(s)})}function CS(t,e,s){return new t({type:"literal",values:Array.isArray(e)?e:[e],...H(s)})}function Md(t,e){return new t({type:"file",...H(e)})}function IS(t,e){return new t({type:"transform",transform:e})}function vS(t,e){return new t({type:"optional",innerType:e})}function gS(t,e){return new t({type:"nullable",innerType:e})}function bS(t,e,s){return new t({type:"default",innerType:e,get defaultValue(){return typeof s==="function"?s():s}})}function AS(t,e,s){return new t({type:"nonoptional",innerType:e,...H(s)})}function ZS(t,e){return new t({type:"success",innerType:e})}function FS(t,e,s){return new t({type:"catch",innerType:e,catchValue:typeof s==="function"?s:()=>s})}function MS(t,e,s){return new t({type:"pipe",in:e,out:s})}function PS(t,e){return new t({type:"readonly",innerType:e})}function LS(t,e,s){return new t({type:"template_literal",parts:e,...H(s)})}function jS(t,e){return new t({type:"lazy",getter:e})}function qS(t,e){return new t({type:"promise",innerType:e})}function Pd(t,e,s){let r=H(s);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function Ld(t,e,s){return new t({type:"custom",check:"custom",fn:e,...H(s)})}function jd(t,e){let s=H(e),r=s.truthy??["true","1","yes","on","y","enabled"],a=s.falsy??["false","0","no","off","n","disabled"];if(s.case!=="sensitive")r=r.map((p)=>typeof p==="string"?p.toLowerCase():p),a=a.map((p)=>typeof p==="string"?p.toLowerCase():p);let n=new Set(r),i=new Set(a),h=t.Pipe??e3,o=t.Boolean??Qn,c=t.String??Na,m=new(t.Transform??t3)({type:"transform",transform:(p,k)=>{let C=p;if(s.case!=="sensitive")C=C.toLowerCase();if(n.has(C))return!0;else if(i.has(C))return!1;else return k.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...i],input:k.value,inst:m}),{}},error:s.error}),u=new h({type:"pipe",in:new c({type:"string",error:s.error}),out:m,error:s.error});return new h({type:"pipe",in:u,out:new o({type:"boolean",error:s.error}),error:s.error})}function qd(t,e,s,r={}){let a=H(r),n={...H(r),check:"string_format",type:"string",format:e,fn:typeof s==="function"?s:(i)=>s.test(i),...a};if(s instanceof RegExp)n.pattern=s;return new t(n)}class B3{constructor(t){this._def=t,this.def=t}implement(t){if(typeof t!=="function")throw Error("implement() must be called with a function");let e=(...s)=>{let r=this._def.input?js(this._def.input,s,void 0,{callee:e}):s;if(!Array.isArray(r))throw Error("Invalid arguments schema: not an array or tuple schema.");let a=t(...r);return this._def.output?js(this._def.output,a,void 0,{callee:e}):a};return e}implementAsync(t){if(typeof t!=="function")throw Error("implement() must be called with a function");let e=async(...s)=>{let r=this._def.input?await qs(this._def.input,s,void 0,{callee:e}):s;if(!Array.isArray(r))throw Error("Invalid arguments schema: not an array or tuple schema.");let a=await t(...r);return this._def.output?qs(this._def.output,a,void 0,{callee:e}):a};return e}input(...t){let e=this.constructor;if(Array.isArray(t[0]))return new e({type:"function",input:new nr({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output});return new e({type:"function",input:t[0],output:this._def.output})}output(t){return new this.constructor({type:"function",input:this._def.input,output:t})}}function _d(t){return new B3({type:"function",input:Array.isArray(t?.input)?Fd(nr,t?.input):t?.input??D3(Yn,Bs(_s)),output:t?.output??Bs(_s)})}class Vs{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??ie,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,e={path:[],schemaPath:[]}){var s;let r=t._zod.def,a={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},n=this.seen.get(t);if(n){if(n.count++,e.schemaPath.includes(t))n.cycle=e.path;return n.schema}let i={schema:{},count:1,cycle:void 0,path:e.path};this.seen.set(t,i);let h=t._zod.toJSONSchema?.();if(h)i.schema=h;else{let c={...e,schemaPath:[...e.schemaPath,t],path:e.path},m=t._zod.parent;if(m)i.ref=m,this.process(m,c),this.seen.get(m).isParent=!0;else{let u=i.schema;switch(r.type){case"string":{let p=u;p.type="string";let{minimum:k,maximum:C,format:I,patterns:R,contentEncoding:d}=t._zod.bag;if(typeof k==="number")p.minLength=k;if(typeof C==="number")p.maxLength=C;if(I){if(p.format=a[I]??I,p.format==="")delete p.format}if(d)p.contentEncoding=d;if(R&&R.size>0){let E=[...R];if(E.length===1)p.pattern=E[0].source;else if(E.length>1)i.schema.allOf=[...E.map((y)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:y.source}))]}break}case"number":{let p=u,{minimum:k,maximum:C,format:I,multipleOf:R,exclusiveMaximum:d,exclusiveMinimum:E}=t._zod.bag;if(typeof I==="string"&&I.includes("int"))p.type="integer";else p.type="number";if(typeof E==="number")p.exclusiveMinimum=E;if(typeof k==="number"){if(p.minimum=k,typeof E==="number")if(E>=k)delete p.minimum;else delete p.exclusiveMinimum}if(typeof d==="number")p.exclusiveMaximum=d;if(typeof C==="number"){if(p.maximum=C,typeof d==="number")if(d<=C)delete p.maximum;else delete p.exclusiveMaximum}if(typeof R==="number")p.multipleOf=R;break}case"boolean":{let p=u;p.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":{u.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{u.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let p=u,{minimum:k,maximum:C}=t._zod.bag;if(typeof k==="number")p.minItems=k;if(typeof C==="number")p.maxItems=C;p.type="array",p.items=this.process(r.element,{...c,path:[...c.path,"items"]});break}case"object":{let p=u;p.type="object",p.properties={};let k=r.shape;for(let R in k)p.properties[R]=this.process(k[R],{...c,path:[...c.path,"properties",R]});let C=new Set(Object.keys(k)),I=new Set([...C].filter((R)=>{let d=r.shape[R]._zod;if(this.io==="input")return d.optin===void 0;else return d.optout===void 0}));if(I.size>0)p.required=Array.from(I);if(r.catchall?._zod.def.type==="never")p.additionalProperties=!1;else if(!r.catchall){if(this.io==="output")p.additionalProperties=!1}else if(r.catchall)p.additionalProperties=this.process(r.catchall,{...c,path:[...c.path,"additionalProperties"]});break}case"union":{let p=u;p.anyOf=r.options.map((k,C)=>this.process(k,{...c,path:[...c.path,"anyOf",C]}));break}case"intersection":{let p=u,k=this.process(r.left,{...c,path:[...c.path,"allOf",0]}),C=this.process(r.right,{...c,path:[...c.path,"allOf",1]}),I=(d)=>("allOf"in d)&&Object.keys(d).length===1,R=[...I(k)?k.allOf:[k],...I(C)?C.allOf:[C]];p.allOf=R;break}case"tuple":{let p=u;p.type="array";let k=r.items.map((R,d)=>this.process(R,{...c,path:[...c.path,"prefixItems",d]}));if(this.target==="draft-2020-12")p.prefixItems=k;else p.items=k;if(r.rest){let R=this.process(r.rest,{...c,path:[...c.path,"items"]});if(this.target==="draft-2020-12")p.items=R;else p.additionalItems=R}if(r.rest)p.items=this.process(r.rest,{...c,path:[...c.path,"items"]});let{minimum:C,maximum:I}=t._zod.bag;if(typeof C==="number")p.minItems=C;if(typeof I==="number")p.maxItems=I;break}case"record":{let p=u;p.type="object",p.propertyNames=this.process(r.keyType,{...c,path:[...c.path,"propertyNames"]}),p.additionalProperties=this.process(r.valueType,{...c,path:[...c.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 p=u,k=Fn(r.entries);if(k.every((C)=>typeof C==="number"))p.type="number";if(k.every((C)=>typeof C==="string"))p.type="string";p.enum=k;break}case"literal":{let p=u,k=[];for(let C of r.values)if(C===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof C==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else k.push(Number(C));else k.push(C);if(k.length===0);else if(k.length===1){let C=k[0];p.type=C===null?"null":typeof C,p.const=C}else{if(k.every((C)=>typeof C==="number"))p.type="number";if(k.every((C)=>typeof C==="string"))p.type="string";if(k.every((C)=>typeof C==="boolean"))p.type="string";if(k.every((C)=>C===null))p.type="null";p.enum=k}break}case"file":{let p=u,k={type:"string",format:"binary",contentEncoding:"binary"},{minimum:C,maximum:I,mime:R}=t._zod.bag;if(C!==void 0)k.minLength=C;if(I!==void 0)k.maxLength=I;if(R)if(R.length===1)k.contentMediaType=R[0],Object.assign(p,k);else p.anyOf=R.map((d)=>{return{...k,contentMediaType:d}});else Object.assign(p,k);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let p=this.process(r.innerType,c);u.anyOf=[p,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,c),i.ref=r.innerType;break}case"success":{let p=u;p.type="boolean";break}case"default":{this.process(r.innerType,c),i.ref=r.innerType,u.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{if(this.process(r.innerType,c),i.ref=r.innerType,this.io==="input")u._prefault=JSON.parse(JSON.stringify(r.defaultValue));break}case"catch":{this.process(r.innerType,c),i.ref=r.innerType;let p;try{p=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}u.default=p;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let p=u,k=t._zod.pattern;if(!k)throw Error("Pattern not found in template literal");p.type="string",p.pattern=k.source;break}case"pipe":{let p=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(p,c),i.ref=p;break}case"readonly":{this.process(r.innerType,c),i.ref=r.innerType,u.readOnly=!0;break}case"promise":{this.process(r.innerType,c),i.ref=r.innerType;break}case"optional":{this.process(r.innerType,c),i.ref=r.innerType;break}case"lazy":{let p=t._zod.innerType;this.process(p,c),i.ref=p;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let o=this.metadataRegistry.get(t);if(o)Object.assign(i.schema,o);if(this.io==="input"&&wt(t))delete i.schema.examples,delete i.schema.default;if(this.io==="input"&&i.schema._prefault)(s=i.schema).default??(s.default=i.schema._prefault);return delete i.schema._prefault,this.seen.get(t).schema}emit(t,e){let s={cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0},r=this.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let a=(c)=>{let m=this.target==="draft-2020-12"?"$defs":"definitions";if(s.external){let k=s.external.registry.get(c[0])?.id;if(k)return{ref:s.external.uri(k)};let C=c[1].defId??c[1].schema.id??`schema${this.counter++}`;return c[1].defId=C,{defId:C,ref:`${s.external.uri("__shared")}#/${m}/${C}`}}if(c[1]===r)return{ref:"#"};let u=`#/${m}/`,p=c[1].schema.id??`__schema${this.counter++}`;return{defId:p,ref:u+p}},n=(c)=>{if(c[1].schema.$ref)return;let m=c[1],{ref:u,defId:p}=a(c);if(m.def={...m.schema},p)m.defId=p;let k=m.schema;for(let C in k)delete k[C];k.$ref=u};for(let c of this.seen.entries()){let m=c[1];if(t===c[0]){n(c);continue}if(s.external){let u=s.external.registry.get(c[0])?.id;if(t!==c[0]&&u){n(c);continue}}if(this.metadataRegistry.get(c[0])?.id){n(c);continue}if(m.cycle){if(s.cycles==="throw")throw Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
84
84
 
85
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(p.cycles==="ref")S(T);continue}if(k.count>1){if(p.reused==="ref"){S(T);continue}}}let c=(T,k)=>{let o=this.seen.get(T),u=o.def??o.schema,i={...u};if(o.ref===null)return;let v=o.ref;if(o.ref=null,v){c(v,k);let F=this.seen.get(v).schema;if(F.$ref&&k.target==="draft-7")u.allOf=u.allOf??[],u.allOf.push(F);else Object.assign(u,F),Object.assign(u,i)}if(!o.isParent)this.override({zodSchema:T,jsonSchema:u,path:o.path??[]})};for(let T of[...this.seen.entries()].reverse())c(T[0],{target:this.target});let n={};if(this.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")n.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(n,h.def);let r=p.external?.defs??{};for(let T of this.seen.entries()){let k=T[1];if(k.def&&k.defId)r[k.defId]=k.def}if(!p.external&&Object.keys(r).length>0)if(this.target==="draft-2020-12")n.$defs=r;else n.definitions=r;try{return JSON.parse(JSON.stringify(n))}catch(T){throw Error("Error converting schema to JSON.")}}}function qn(E,y){if(E instanceof cE){let h=new B8(y),d={};for(let n of E._idmap.entries()){let[r,T]=n;h.process(T)}let S={},c={registry:E,uri:y?.uri||((n)=>n),defs:d};for(let n of E._idmap.entries()){let[r,T]=n;S[r]=h.emit(T,{...y,external:c})}if(Object.keys(d).length>0){let n=h.target==="draft-2020-12"?"$defs":"definitions";S.__shared={[n]:d}}return{schemas:S}}let p=new B8(y);return p.process(E),p.emit(E,y)}function w0(E,y){let p=y??{seen:new Set};if(p.seen.has(E))return!1;p.seen.add(E);let h=E._zod.def;switch(h.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return w0(h.element,p);case"object":{for(let d in h.shape)if(w0(h.shape[d],p))return!0;return!1}case"union":{for(let d of h.options)if(w0(d,p))return!0;return!1}case"intersection":return w0(h.left,p)||w0(h.right,p);case"tuple":{for(let d of h.items)if(w0(d,p))return!0;if(h.rest&&w0(h.rest,p))return!0;return!1}case"record":return w0(h.keyType,p)||w0(h.valueType,p);case"map":return w0(h.keyType,p)||w0(h.valueType,p);case"set":return w0(h.valueType,p);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return w0(h.innerType,p);case"lazy":return w0(h.getter(),p);case"default":return w0(h.innerType,p);case"prefault":return w0(h.innerType,p);case"custom":return!1;case"transform":return!0;case"pipe":return w0(h.in,p)||w0(h.out,p);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${h.type}`)}var _C={},DC=e("ZodMiniType",(E,y)=>{if(!E._zod)throw Error("Uninitialized schema in ZodMiniType.");T0.init(E,y),E.def=y,E.parse=(p,h)=>j8(E,p,h,{callee:E.parse}),E.safeParse=(p,h)=>Vy(E,p,h),E.parseAsync=async(p,h)=>q8(E,p,h,{callee:E.parseAsync}),E.safeParseAsync=async(p,h)=>Ny(E,p,h),E.check=(...p)=>{return E.clone({...y,checks:[...y.checks??[],...p.map((h)=>typeof h==="function"?{_zod:{check:h,def:{check:"custom"},onattach:[]}}:h)]})},E.clone=(p,h)=>g3(E,p,h),E.brand=()=>E,E.register=(p,h)=>{return p.add(E,h),E}}),Et=e("ZodMiniObject",(E,y)=>{Yy.init(E,y),DC.init(E,y),x0.defineLazy(E,"shape",()=>y.shape)});var M6={};f6(M6,{xid:()=>YC,void:()=>Io,uuidv7:()=>OC,uuidv6:()=>HC,uuidv4:()=>KC,uuid:()=>wC,url:()=>UC,uppercase:()=>sd,unknown:()=>e0,union:()=>A0,undefined:()=>oo,ulid:()=>JC,uint64:()=>ao,uint32:()=>fo,tuple:()=>vo,trim:()=>Ld,treeifyError:()=>KS,transform:()=>up,toUpperCase:()=>qd,toLowerCase:()=>jd,toJSONSchema:()=>qn,templateLiteral:()=>Po,symbol:()=>Co,superRefine:()=>Mr,success:()=>go,stringbool:()=>qo,stringFormat:()=>ro,string:()=>q,strictObject:()=>Zo,startsWith:()=>ed,size:()=>Fd,setErrorMap:()=>Vo,set:()=>Mo,safeParseAsync:()=>On,safeParse:()=>Hn,registry:()=>dd,regexes:()=>wy,regex:()=>Ad,refine:()=>Ar,record:()=>s0,readonly:()=>xr,property:()=>sn,promise:()=>Lo,prettifyError:()=>OS,preprocess:()=>op,prefault:()=>Rr,positive:()=>vn,pipe:()=>K8,partialRecord:()=>Fo,parseAsync:()=>Kn,parse:()=>wn,overwrite:()=>C6,optional:()=>g0,object:()=>J,number:()=>F0,nullish:()=>eo,nullable:()=>w8,null:()=>kE,normalize:()=>Pd,nonpositive:()=>An,nonoptional:()=>fr,nonnegative:()=>Mn,never:()=>aE,negative:()=>Fn,nativeEnum:()=>so,nanoid:()=>WC,nan:()=>lo,multipleOf:()=>L4,minSize:()=>j4,minLength:()=>_6,mime:()=>ld,maxSize:()=>nE,maxLength:()=>rE,map:()=>Ao,lte:()=>M3,lt:()=>m6,lowercase:()=>Md,looseObject:()=>d3,locales:()=>yd,literal:()=>E0,length:()=>TE,lazy:()=>tr,ksuid:()=>XC,keyof:()=>to,jwt:()=>no,json:()=>_o,iso:()=>Vd,ipv6:()=>Eo,ipv4:()=>$C,intersection:()=>oE,int64:()=>ko,int32:()=>Ro,int:()=>QE,instanceof:()=>jo,includes:()=>bd,guid:()=>NC,gte:()=>m3,gt:()=>R6,globalRegistry:()=>c6,getErrorMap:()=>Bo,function:()=>jn,formatError:()=>jy,float64:()=>mo,float32:()=>To,flattenError:()=>Ly,file:()=>bo,enum:()=>c3,endsWith:()=>gd,emoji:()=>GC,email:()=>BC,e164:()=>co,discriminatedUnion:()=>mp,date:()=>io,custom:()=>Fr,cuid2:()=>QC,cuid:()=>zC,core:()=>eS,config:()=>h3,coerce:()=>sr,clone:()=>g3,cidrv6:()=>po,cidrv4:()=>yo,check:()=>vr,catch:()=>ar,boolean:()=>K0,bigint:()=>uo,base64url:()=>So,base64:()=>ho,array:()=>I0,any:()=>xo,_default:()=>Tr,_ZodString:()=>Hd,ZodXID:()=>Yd,ZodVoid:()=>Xn,ZodUnknown:()=>Jn,ZodUnion:()=>Tp,ZodUndefined:()=>Wn,ZodUUID:()=>K3,ZodURL:()=>Ud,ZodULID:()=>Jd,ZodType:()=>k0,ZodTuple:()=>dr,ZodTransform:()=>fp,ZodTemplateLiteral:()=>Ir,ZodSymbol:()=>Gn,ZodSuccess:()=>ur,ZodStringFormat:()=>b0,ZodString:()=>mE,ZodSet:()=>hr,ZodRecord:()=>Rp,ZodRealError:()=>w4,ZodReadonly:()=>or,ZodPromise:()=>Zr,ZodPrefault:()=>mr,ZodPipe:()=>Cp,ZodOptional:()=>kp,ZodObject:()=>CE,ZodNumberFormat:()=>O6,ZodNumber:()=>RE,ZodNullable:()=>nr,ZodNull:()=>zn,ZodNonOptional:()=>ap,ZodNever:()=>Yn,ZodNanoID:()=>Wd,ZodNaN:()=>Cr,ZodMap:()=>pr,ZodLiteral:()=>Sr,ZodLazy:()=>ir,ZodKSUID:()=>Xd,ZodJWT:()=>cp,ZodIssueCode:()=>Do,ZodIntersection:()=>yr,ZodISOTime:()=>wd,ZodISODuration:()=>Kd,ZodISODateTime:()=>Bd,ZodISODate:()=>Nd,ZodIPv6:()=>Ep,ZodIPv4:()=>$d,ZodGUID:()=>N8,ZodFile:()=>cr,ZodError:()=>VC,ZodEnum:()=>q4,ZodEmoji:()=>Gd,ZodEmail:()=>Od,ZodE164:()=>Sp,ZodDiscriminatedUnion:()=>Er,ZodDefault:()=>rr,ZodDate:()=>rp,ZodCustomStringFormat:()=>Un,ZodCustom:()=>xE,ZodCatch:()=>kr,ZodCUID2:()=>Qd,ZodCUID:()=>zd,ZodCIDRv6:()=>dp,ZodCIDRv4:()=>yp,ZodBoolean:()=>fE,ZodBigIntFormat:()=>np,ZodBigInt:()=>uE,ZodBase64URL:()=>hp,ZodBase64:()=>pp,ZodArray:()=>$n,ZodAny:()=>Qn,TimePrecision:()=>Q9,NEVER:()=>gS,$output:()=>U9,$input:()=>G9,$brand:()=>lS});var Vd={};f6(Vd,{time:()=>Vn,duration:()=>Bn,datetime:()=>_n,date:()=>Dn,ZodISOTime:()=>wd,ZodISODuration:()=>Kd,ZodISODateTime:()=>Bd,ZodISODate:()=>Nd});var Bd=e("ZodISODateTime",(E,y)=>{$c.init(E,y),b0.init(E,y)});function _n(E){return J9(Bd,E)}var Nd=e("ZodISODate",(E,y)=>{E9.init(E,y),b0.init(E,y)});function Dn(E){return Y9(Nd,E)}var wd=e("ZodISOTime",(E,y)=>{y9.init(E,y),b0.init(E,y)});function Vn(E){return X9(wd,E)}var Kd=e("ZodISODuration",(E,y)=>{d9.init(E,y),b0.init(E,y)});function Bn(E){return $9(Kd,E)}var Nn=(E,y)=>{Py.init(E,y),E.name="ZodError",Object.defineProperties(E,{format:{value:(p)=>jy(E,p)},flatten:{value:(p)=>Ly(E,p)},addIssue:{value:(p)=>E.issues.push(p)},addIssues:{value:(p)=>E.issues.push(...p)},isEmpty:{get(){return E.issues.length===0}}})},VC=e("ZodError",Nn),w4=e("ZodError",Nn,{Parent:Error}),wn=qy(w4),Kn=_y(w4),Hn=Dy(w4),On=By(w4),k0=e("ZodType",(E,y)=>{return T0.init(E,y),E.def=y,Object.defineProperty(E,"_def",{value:y}),E.check=(...p)=>{return E.clone({...y,checks:[...y.checks??[],...p.map((h)=>typeof h==="function"?{_zod:{check:h,def:{check:"custom"},onattach:[]}}:h)]})},E.clone=(p,h)=>g3(E,p,h),E.brand=()=>E,E.register=(p,h)=>{return p.add(E,h),E},E.parse=(p,h)=>wn(E,p,h,{callee:E.parse}),E.safeParse=(p,h)=>Hn(E,p,h),E.parseAsync=async(p,h)=>Kn(E,p,h,{callee:E.parseAsync}),E.safeParseAsync=async(p,h)=>On(E,p,h),E.spa=E.safeParseAsync,E.refine=(p,h)=>E.check(Ar(p,h)),E.superRefine=(p)=>E.check(Mr(p)),E.overwrite=(p)=>E.check(C6(p)),E.optional=()=>g0(E),E.nullable=()=>w8(E),E.nullish=()=>g0(w8(E)),E.nonoptional=(p)=>fr(E,p),E.array=()=>I0(E),E.or=(p)=>A0([E,p]),E.and=(p)=>oE(E,p),E.transform=(p)=>K8(E,up(p)),E.default=(p)=>Tr(E,p),E.prefault=(p)=>Rr(E,p),E.catch=(p)=>ar(E,p),E.pipe=(p)=>K8(E,p),E.readonly=()=>xr(E),E.describe=(p)=>{let h=E.clone();return c6.add(h,{description:p}),h},Object.defineProperty(E,"description",{get(){return c6.get(E)?.description},configurable:!0}),E.meta=(...p)=>{if(p.length===0)return c6.get(E);let h=E.clone();return c6.add(h,p[0]),h},E.isOptional=()=>E.safeParse(void 0).success,E.isNullable=()=>E.safeParse(null).success,E}),Hd=e("_ZodString",(E,y)=>{N4.init(E,y),k0.init(E,y);let p=E._zod.bag;E.format=p.format??null,E.minLength=p.minimum??null,E.maxLength=p.maximum??null,E.regex=(...h)=>E.check(Ad(...h)),E.includes=(...h)=>E.check(bd(...h)),E.startsWith=(...h)=>E.check(ed(...h)),E.endsWith=(...h)=>E.check(gd(...h)),E.min=(...h)=>E.check(_6(...h)),E.max=(...h)=>E.check(rE(...h)),E.length=(...h)=>E.check(TE(...h)),E.nonempty=(...h)=>E.check(_6(1,...h)),E.lowercase=(h)=>E.check(Md(h)),E.uppercase=(h)=>E.check(sd(h)),E.trim=()=>E.check(Ld()),E.normalize=(...h)=>E.check(Pd(...h)),E.toLowerCase=()=>E.check(jd()),E.toUpperCase=()=>E.check(qd())}),mE=e("ZodString",(E,y)=>{N4.init(E,y),Hd.init(E,y),E.email=(p)=>E.check(pd(Od,p)),E.url=(p)=>E.check(rd(Ud,p)),E.jwt=(p)=>E.check(vd(cp,p)),E.emoji=(p)=>E.check(Td(Gd,p)),E.guid=(p)=>E.check(D8(N8,p)),E.uuid=(p)=>E.check(hd(K3,p)),E.uuidv4=(p)=>E.check(Sd(K3,p)),E.uuidv6=(p)=>E.check(cd(K3,p)),E.uuidv7=(p)=>E.check(nd(K3,p)),E.nanoid=(p)=>E.check(md(Wd,p)),E.guid=(p)=>E.check(D8(N8,p)),E.cuid=(p)=>E.check(Rd(zd,p)),E.cuid2=(p)=>E.check(fd(Qd,p)),E.ulid=(p)=>E.check(ud(Jd,p)),E.base64=(p)=>E.check(id(pp,p)),E.base64url=(p)=>E.check(td(hp,p)),E.xid=(p)=>E.check(kd(Yd,p)),E.ksuid=(p)=>E.check(ad(Xd,p)),E.ipv4=(p)=>E.check(Cd($d,p)),E.ipv6=(p)=>E.check(od(Ep,p)),E.cidrv4=(p)=>E.check(xd(yp,p)),E.cidrv6=(p)=>E.check(Id(dp,p)),E.e164=(p)=>E.check(Zd(Sp,p)),E.datetime=(p)=>E.check(_n(p)),E.date=(p)=>E.check(Dn(p)),E.time=(p)=>E.check(Vn(p)),E.duration=(p)=>E.check(Bn(p))});function q(E){return W9(mE,E)}var b0=e("ZodStringFormat",(E,y)=>{M0.init(E,y),Hd.init(E,y)}),Od=e("ZodEmail",(E,y)=>{Oc.init(E,y),b0.init(E,y)});function BC(E){return pd(Od,E)}var N8=e("ZodGUID",(E,y)=>{Kc.init(E,y),b0.init(E,y)});function NC(E){return D8(N8,E)}var K3=e("ZodUUID",(E,y)=>{Hc.init(E,y),b0.init(E,y)});function wC(E){return hd(K3,E)}function KC(E){return Sd(K3,E)}function HC(E){return cd(K3,E)}function OC(E){return nd(K3,E)}var Ud=e("ZodURL",(E,y)=>{Uc.init(E,y),b0.init(E,y)});function UC(E){return rd(Ud,E)}var Gd=e("ZodEmoji",(E,y)=>{Gc.init(E,y),b0.init(E,y)});function GC(E){return Td(Gd,E)}var Wd=e("ZodNanoID",(E,y)=>{Wc.init(E,y),b0.init(E,y)});function WC(E){return md(Wd,E)}var zd=e("ZodCUID",(E,y)=>{zc.init(E,y),b0.init(E,y)});function zC(E){return Rd(zd,E)}var Qd=e("ZodCUID2",(E,y)=>{Qc.init(E,y),b0.init(E,y)});function QC(E){return fd(Qd,E)}var Jd=e("ZodULID",(E,y)=>{Jc.init(E,y),b0.init(E,y)});function JC(E){return ud(Jd,E)}var Yd=e("ZodXID",(E,y)=>{Yc.init(E,y),b0.init(E,y)});function YC(E){return kd(Yd,E)}var Xd=e("ZodKSUID",(E,y)=>{Xc.init(E,y),b0.init(E,y)});function XC(E){return ad(Xd,E)}var $d=e("ZodIPv4",(E,y)=>{p9.init(E,y),b0.init(E,y)});function $C(E){return Cd($d,E)}var Ep=e("ZodIPv6",(E,y)=>{h9.init(E,y),b0.init(E,y)});function Eo(E){return od(Ep,E)}var yp=e("ZodCIDRv4",(E,y)=>{S9.init(E,y),b0.init(E,y)});function yo(E){return xd(yp,E)}var dp=e("ZodCIDRv6",(E,y)=>{c9.init(E,y),b0.init(E,y)});function po(E){return Id(dp,E)}var pp=e("ZodBase64",(E,y)=>{n9.init(E,y),b0.init(E,y)});function ho(E){return id(pp,E)}var hp=e("ZodBase64URL",(E,y)=>{T9.init(E,y),b0.init(E,y)});function So(E){return td(hp,E)}var Sp=e("ZodE164",(E,y)=>{m9.init(E,y),b0.init(E,y)});function co(E){return Zd(Sp,E)}var cp=e("ZodJWT",(E,y)=>{f9.init(E,y),b0.init(E,y)});function no(E){return vd(cp,E)}var Un=e("ZodCustomStringFormat",(E,y)=>{u9.init(E,y),b0.init(E,y)});function ro(E,y,p={}){return Ln(Un,E,y,p)}var RE=e("ZodNumber",(E,y)=>{Wy.init(E,y),k0.init(E,y),E.gt=(h,d)=>E.check(R6(h,d)),E.gte=(h,d)=>E.check(m3(h,d)),E.min=(h,d)=>E.check(m3(h,d)),E.lt=(h,d)=>E.check(m6(h,d)),E.lte=(h,d)=>E.check(M3(h,d)),E.max=(h,d)=>E.check(M3(h,d)),E.int=(h)=>E.check(QE(h)),E.safe=(h)=>E.check(QE(h)),E.positive=(h)=>E.check(R6(0,h)),E.nonnegative=(h)=>E.check(m3(0,h)),E.negative=(h)=>E.check(m6(0,h)),E.nonpositive=(h)=>E.check(M3(0,h)),E.multipleOf=(h,d)=>E.check(L4(h,d)),E.step=(h,d)=>E.check(L4(h,d)),E.finite=()=>E;let p=E._zod.bag;E.minValue=Math.max(p.minimum??Number.NEGATIVE_INFINITY,p.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,E.maxValue=Math.min(p.maximum??Number.POSITIVE_INFINITY,p.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,E.isInt=(p.format??"").includes("int")||Number.isSafeInteger(p.multipleOf??0.5),E.isFinite=!0,E.format=p.format??null});function F0(E){return En(RE,E)}var O6=e("ZodNumberFormat",(E,y)=>{k9.init(E,y),RE.init(E,y)});function QE(E){return dn(O6,E)}function To(E){return pn(O6,E)}function mo(E){return hn(O6,E)}function Ro(E){return Sn(O6,E)}function fo(E){return cn(O6,E)}var fE=e("ZodBoolean",(E,y)=>{zy.init(E,y),k0.init(E,y)});function K0(E){return nn(fE,E)}var uE=e("ZodBigInt",(E,y)=>{Qy.init(E,y),k0.init(E,y),E.gte=(h,d)=>E.check(m3(h,d)),E.min=(h,d)=>E.check(m3(h,d)),E.gt=(h,d)=>E.check(R6(h,d)),E.gte=(h,d)=>E.check(m3(h,d)),E.min=(h,d)=>E.check(m3(h,d)),E.lt=(h,d)=>E.check(m6(h,d)),E.lte=(h,d)=>E.check(M3(h,d)),E.max=(h,d)=>E.check(M3(h,d)),E.positive=(h)=>E.check(R6(BigInt(0),h)),E.negative=(h)=>E.check(m6(BigInt(0),h)),E.nonpositive=(h)=>E.check(M3(BigInt(0),h)),E.nonnegative=(h)=>E.check(m3(BigInt(0),h)),E.multipleOf=(h,d)=>E.check(L4(h,d));let p=E._zod.bag;E.minValue=p.minimum??null,E.maxValue=p.maximum??null,E.format=p.format??null});function uo(E){return Tn(uE,E)}var np=e("ZodBigIntFormat",(E,y)=>{a9.init(E,y),uE.init(E,y)});function ko(E){return Rn(np,E)}function ao(E){return fn(np,E)}var Gn=e("ZodSymbol",(E,y)=>{C9.init(E,y),k0.init(E,y)});function Co(E){return un(Gn,E)}var Wn=e("ZodUndefined",(E,y)=>{o9.init(E,y),k0.init(E,y)});function oo(E){return kn(Wn,E)}var zn=e("ZodNull",(E,y)=>{x9.init(E,y),k0.init(E,y)});function kE(E){return an(zn,E)}var Qn=e("ZodAny",(E,y)=>{I9.init(E,y),k0.init(E,y)});function xo(){return Cn(Qn)}var Jn=e("ZodUnknown",(E,y)=>{_8.init(E,y),k0.init(E,y)});function e0(){return V8(Jn)}var Yn=e("ZodNever",(E,y)=>{i9.init(E,y),k0.init(E,y)});function aE(E){return on(Yn,E)}var Xn=e("ZodVoid",(E,y)=>{t9.init(E,y),k0.init(E,y)});function Io(E){return xn(Xn,E)}var rp=e("ZodDate",(E,y)=>{Z9.init(E,y),k0.init(E,y),E.min=(h,d)=>E.check(m3(h,d)),E.max=(h,d)=>E.check(M3(h,d));let p=E._zod.bag;E.minDate=p.minimum?new Date(p.minimum):null,E.maxDate=p.maximum?new Date(p.maximum):null});function io(E){return In(rp,E)}var $n=e("ZodArray",(E,y)=>{Jy.init(E,y),k0.init(E,y),E.element=y.element,E.min=(p,h)=>E.check(_6(p,h)),E.nonempty=(p)=>E.check(_6(1,p)),E.max=(p,h)=>E.check(rE(p,h)),E.length=(p,h)=>E.check(TE(p,h)),E.unwrap=()=>E.element});function I0(E,y){return _d($n,E,y)}function to(E){let y=E._zod.def.shape;return E0(Object.keys(y))}var CE=e("ZodObject",(E,y)=>{Yy.init(E,y),k0.init(E,y),x0.defineLazy(E,"shape",()=>y.shape),E.keyof=()=>c3(Object.keys(E._zod.def.shape)),E.catchall=(p)=>E.clone({...E._zod.def,catchall:p}),E.passthrough=()=>E.clone({...E._zod.def,catchall:e0()}),E.loose=()=>E.clone({...E._zod.def,catchall:e0()}),E.strict=()=>E.clone({...E._zod.def,catchall:aE()}),E.strip=()=>E.clone({...E._zod.def,catchall:void 0}),E.extend=(p)=>{return x0.extend(E,p)},E.merge=(p)=>x0.merge(E,p),E.pick=(p)=>x0.pick(E,p),E.omit=(p)=>x0.omit(E,p),E.partial=(...p)=>x0.partial(kp,E,p[0]),E.required=(...p)=>x0.required(ap,E,p[0])});function J(E,y){let p={type:"object",get shape(){return x0.assignProp(this,"shape",{...E}),this.shape},...x0.normalizeParams(y)};return new CE(p)}function Zo(E,y){return new CE({type:"object",get shape(){return x0.assignProp(this,"shape",{...E}),this.shape},catchall:aE(),...x0.normalizeParams(y)})}function d3(E,y){return new CE({type:"object",get shape(){return x0.assignProp(this,"shape",{...E}),this.shape},catchall:e0(),...x0.normalizeParams(y)})}var Tp=e("ZodUnion",(E,y)=>{Xy.init(E,y),k0.init(E,y),E.options=y.options});function A0(E,y){return new Tp({type:"union",options:E,...x0.normalizeParams(y)})}var Er=e("ZodDiscriminatedUnion",(E,y)=>{Tp.init(E,y),v9.init(E,y)});function mp(E,y,p){return new Er({type:"union",options:y,discriminator:E,...x0.normalizeParams(p)})}var yr=e("ZodIntersection",(E,y)=>{F9.init(E,y),k0.init(E,y)});function oE(E,y){return new yr({type:"intersection",left:E,right:y})}var dr=e("ZodTuple",(E,y)=>{SE.init(E,y),k0.init(E,y),E.rest=(p)=>E.clone({...E._zod.def,rest:p})});function vo(E,y,p){let h=y instanceof T0,d=h?p:y;return new dr({type:"tuple",items:E,rest:h?y:null,...x0.normalizeParams(d)})}var Rp=e("ZodRecord",(E,y)=>{A9.init(E,y),k0.init(E,y),E.keyType=y.keyType,E.valueType=y.valueType});function s0(E,y,p){return new Rp({type:"record",keyType:E,valueType:y,...x0.normalizeParams(p)})}function Fo(E,y,p){return new Rp({type:"record",keyType:A0([E,aE()]),valueType:y,...x0.normalizeParams(p)})}var pr=e("ZodMap",(E,y)=>{M9.init(E,y),k0.init(E,y),E.keyType=y.keyType,E.valueType=y.valueType});function Ao(E,y,p){return new pr({type:"map",keyType:E,valueType:y,...x0.normalizeParams(p)})}var hr=e("ZodSet",(E,y)=>{s9.init(E,y),k0.init(E,y),E.min=(...p)=>E.check(j4(...p)),E.nonempty=(p)=>E.check(j4(1,p)),E.max=(...p)=>E.check(nE(...p)),E.size=(...p)=>E.check(Fd(...p))});function Mo(E,y){return new hr({type:"set",valueType:E,...x0.normalizeParams(y)})}var q4=e("ZodEnum",(E,y)=>{b9.init(E,y),k0.init(E,y),E.enum=y.entries,E.options=Object.values(y.entries);let p=new Set(Object.keys(y.entries));E.extract=(h,d)=>{let S={};for(let c of h)if(p.has(c))S[c]=y.entries[c];else throw Error(`Key ${c} not found in enum`);return new q4({...y,checks:[],...x0.normalizeParams(d),entries:S})},E.exclude=(h,d)=>{let S={...y.entries};for(let c of h)if(p.has(c))delete S[c];else throw Error(`Key ${c} not found in enum`);return new q4({...y,checks:[],...x0.normalizeParams(d),entries:S})}});function c3(E,y){let p=Array.isArray(E)?Object.fromEntries(E.map((h)=>[h,h])):E;return new q4({type:"enum",entries:p,...x0.normalizeParams(y)})}function so(E,y){return new q4({type:"enum",entries:E,...x0.normalizeParams(y)})}var Sr=e("ZodLiteral",(E,y)=>{e9.init(E,y),k0.init(E,y),E.values=new Set(y.values),Object.defineProperty(E,"value",{get(){if(y.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return y.values[0]}})});function E0(E,y){return new Sr({type:"literal",values:Array.isArray(E)?E:[E],...x0.normalizeParams(y)})}var cr=e("ZodFile",(E,y)=>{g9.init(E,y),k0.init(E,y),E.min=(p,h)=>E.check(j4(p,h)),E.max=(p,h)=>E.check(nE(p,h)),E.mime=(p,h)=>E.check(ld(Array.isArray(p)?p:[p],h))});function bo(E){return en(cr,E)}var fp=e("ZodTransform",(E,y)=>{$y.init(E,y),k0.init(E,y),E._zod.parse=(p,h)=>{p.addIssue=(S)=>{if(typeof S==="string")p.issues.push(x0.issue(S,p.value,y));else{let c=S;if(c.fatal)c.continue=!1;c.code??(c.code="custom"),c.input??(c.input=p.value),c.inst??(c.inst=E),c.continue??(c.continue=!0),p.issues.push(x0.issue(c))}};let d=y.transform(p.value,p);if(d instanceof Promise)return d.then((S)=>{return p.value=S,p});return p.value=d,p}});function up(E){return new fp({type:"transform",transform:E})}var kp=e("ZodOptional",(E,y)=>{l9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.innerType});function g0(E){return new kp({type:"optional",innerType:E})}var nr=e("ZodNullable",(E,y)=>{P9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.innerType});function w8(E){return new nr({type:"nullable",innerType:E})}function eo(E){return g0(w8(E))}var rr=e("ZodDefault",(E,y)=>{L9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.innerType,E.removeDefault=E.unwrap});function Tr(E,y){return new rr({type:"default",innerType:E,get defaultValue(){return typeof y==="function"?y():y}})}var mr=e("ZodPrefault",(E,y)=>{j9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.innerType});function Rr(E,y){return new mr({type:"prefault",innerType:E,get defaultValue(){return typeof y==="function"?y():y}})}var ap=e("ZodNonOptional",(E,y)=>{q9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.innerType});function fr(E,y){return new ap({type:"nonoptional",innerType:E,...x0.normalizeParams(y)})}var ur=e("ZodSuccess",(E,y)=>{_9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.innerType});function go(E){return new ur({type:"success",innerType:E})}var kr=e("ZodCatch",(E,y)=>{D9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.innerType,E.removeCatch=E.unwrap});function ar(E,y){return new kr({type:"catch",innerType:E,catchValue:typeof y==="function"?y:()=>y})}var Cr=e("ZodNaN",(E,y)=>{V9.init(E,y),k0.init(E,y)});function lo(E){return Zn(Cr,E)}var Cp=e("ZodPipe",(E,y)=>{Ed.init(E,y),k0.init(E,y),E.in=y.in,E.out=y.out});function K8(E,y){return new Cp({type:"pipe",in:E,out:y})}var or=e("ZodReadonly",(E,y)=>{B9.init(E,y),k0.init(E,y)});function xr(E){return new or({type:"readonly",innerType:E})}var Ir=e("ZodTemplateLiteral",(E,y)=>{N9.init(E,y),k0.init(E,y)});function Po(E,y){return new Ir({type:"template_literal",parts:E,...x0.normalizeParams(y)})}var ir=e("ZodLazy",(E,y)=>{K9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.getter()});function tr(E){return new ir({type:"lazy",getter:E})}var Zr=e("ZodPromise",(E,y)=>{w9.init(E,y),k0.init(E,y),E.unwrap=()=>E._zod.def.innerType});function Lo(E){return new Zr({type:"promise",innerType:E})}var xE=e("ZodCustom",(E,y)=>{H9.init(E,y),k0.init(E,y)});function vr(E,y){let p=new V0({check:"custom",...x0.normalizeParams(y)});return p._zod.check=E,p}function Fr(E,y){return gn(xE,E??(()=>!0),y)}function Ar(E,y={}){return ln(xE,E,y)}function Mr(E,y){let p=vr((h)=>{return h.addIssue=(d)=>{if(typeof d==="string")h.issues.push(x0.issue(d,h.value,p._zod.def));else{let S=d;if(S.fatal)S.continue=!1;S.code??(S.code="custom"),S.input??(S.input=h.value),S.inst??(S.inst=p),S.continue??(S.continue=!p._zod.def.abort),h.issues.push(x0.issue(S))}},E(h.value,h)},y);return p}function jo(E,y={error:`Input not instance of ${E.name}`}){let p=new xE({type:"custom",check:"custom",fn:(h)=>h instanceof E,abort:!0,...x0.normalizeParams(y)});return p._zod.bag.Class=E,p}var qo=(...E)=>Pn({Pipe:Cp,Boolean:fE,String:mE,Transform:fp},...E);function _o(E){let y=tr(()=>{return A0([q(E),F0(),K0(),kE(),I0(y),s0(q(),y)])});return y}function op(E,y){return K8(up(E),y)}var Do={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 Vo(E){h3({customError:E})}function Bo(){return h3().customError}var sr={};f6(sr,{string:()=>No,number:()=>wo,date:()=>Oo,boolean:()=>Ko,bigint:()=>Ho});function No(E){return z9(mE,E)}function wo(E){return yn(RE,E)}function Ko(E){return rn(fE,E)}function Ho(E){return mn(uE,E)}function Oo(E){return tn(rp,E)}h3(O9());var Uo="io.modelcontextprotocol/related-task",IE="2.0",Q0=Fr((E)=>E!==null&&(typeof E==="object"||typeof E==="function")),br=A0([q(),F0().int()]),er=q(),yt=d3({ttl:A0([F0(),kE()]).optional(),pollInterval:F0().optional()}),Go=J({ttl:F0().optional()}),Wo=J({taskId:q()}),xp=d3({progressToken:br.optional(),[Uo]:Wo.optional()}),R3=J({_meta:xp.optional()}),iE=R3.extend({task:Go.optional()});var J0=J({method:q(),params:R3.loose().optional()}),t3=J({_meta:xp.optional()}),Z3=J({method:q(),params:t3.loose().optional()}),Y0=d3({_meta:xp.optional()}),tE=A0([q(),F0().int()]),zo=J({jsonrpc:E0(IE),id:tE,...J0.shape}).strict();var Qo=J({jsonrpc:E0(IE),...Z3.shape}).strict();var gr=J({jsonrpc:E0(IE),id:tE,result:Y0}).strict();var bh;(function(E){E[E.ConnectionClosed=-32000]="ConnectionClosed",E[E.RequestTimeout=-32001]="RequestTimeout",E[E.ParseError=-32700]="ParseError",E[E.InvalidRequest=-32600]="InvalidRequest",E[E.MethodNotFound=-32601]="MethodNotFound",E[E.InvalidParams=-32602]="InvalidParams",E[E.InternalError=-32603]="InternalError",E[E.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(bh||(bh={}));var lr=J({jsonrpc:E0(IE),id:tE.optional(),error:J({code:F0().int(),message:q(),data:e0().optional()})}).strict();var dt=A0([zo,Qo,gr,lr]),pt=A0([gr,lr]),Pr=Y0.strict(),Jo=t3.extend({requestId:tE.optional(),reason:q().optional()}),Lr=Z3.extend({method:E0("notifications/cancelled"),params:Jo}),Yo=J({src:q(),mimeType:q().optional(),sizes:I0(q()).optional(),theme:c3(["light","dark"]).optional()}),K4=J({icons:I0(Yo).optional()}),D6=J({name:q(),title:q().optional()}),jr=D6.extend({...D6.shape,...K4.shape,version:q(),websiteUrl:q().optional(),description:q().optional()}),Xo=oE(J({applyDefaults:K0().optional()}),s0(q(),e0())),$o=op((E)=>{if(E&&typeof E==="object"&&!Array.isArray(E)){if(Object.keys(E).length===0)return{form:{}}}return E},oE(J({form:Xo.optional(),url:Q0.optional()}),s0(q(),e0()).optional())),Ex=d3({list:Q0.optional(),cancel:Q0.optional(),requests:d3({sampling:d3({createMessage:Q0.optional()}).optional(),elicitation:d3({create:Q0.optional()}).optional()}).optional()}),yx=d3({list:Q0.optional(),cancel:Q0.optional(),requests:d3({tools:d3({call:Q0.optional()}).optional()}).optional()}),dx=J({experimental:s0(q(),Q0).optional(),sampling:J({context:Q0.optional(),tools:Q0.optional()}).optional(),elicitation:$o.optional(),roots:J({listChanged:K0().optional()}).optional(),tasks:Ex.optional()}),px=R3.extend({protocolVersion:q(),capabilities:dx,clientInfo:jr}),hx=J0.extend({method:E0("initialize"),params:px}),Sx=J({experimental:s0(q(),Q0).optional(),logging:Q0.optional(),completions:Q0.optional(),prompts:J({listChanged:K0().optional()}).optional(),resources:J({subscribe:K0().optional(),listChanged:K0().optional()}).optional(),tools:J({listChanged:K0().optional()}).optional(),tasks:yx.optional()}),cx=Y0.extend({protocolVersion:q(),capabilities:Sx,serverInfo:jr,instructions:q().optional()}),nx=Z3.extend({method:E0("notifications/initialized"),params:t3.optional()}),qr=J0.extend({method:E0("ping"),params:R3.optional()}),rx=J({progress:F0(),total:g0(F0()),message:g0(q())}),Tx=J({...t3.shape,...rx.shape,progressToken:br}),_r=Z3.extend({method:E0("notifications/progress"),params:Tx}),mx=R3.extend({cursor:er.optional()}),H4=J0.extend({params:mx.optional()}),O4=Y0.extend({nextCursor:er.optional()}),Rx=c3(["working","input_required","completed","failed","cancelled"]),U4=J({taskId:q(),status:Rx,ttl:A0([F0(),kE()]),createdAt:q(),lastUpdatedAt:q(),pollInterval:g0(F0()),statusMessage:g0(q())}),Dr=Y0.extend({task:U4}),fx=t3.merge(U4),Vr=Z3.extend({method:E0("notifications/tasks/status"),params:fx}),Br=J0.extend({method:E0("tasks/get"),params:R3.extend({taskId:q()})}),Nr=Y0.merge(U4),wr=J0.extend({method:E0("tasks/result"),params:R3.extend({taskId:q()})}),ht=Y0.loose(),Kr=H4.extend({method:E0("tasks/list")}),Hr=O4.extend({tasks:I0(U4)}),Or=J0.extend({method:E0("tasks/cancel"),params:R3.extend({taskId:q()})}),St=Y0.merge(U4),Ur=J({uri:q(),mimeType:g0(q()),_meta:s0(q(),e0()).optional()}),Gr=Ur.extend({text:q()}),Ip=q().refine((E)=>{try{return atob(E),!0}catch{return!1}},{message:"Invalid Base64 string"}),Wr=Ur.extend({blob:Ip}),G4=c3(["user","assistant"]),U6=J({audience:I0(G4).optional(),priority:F0().min(0).max(1).optional(),lastModified:Vd.datetime({offset:!0}).optional()}),zr=J({...D6.shape,...K4.shape,uri:q(),description:g0(q()),mimeType:g0(q()),annotations:U6.optional(),_meta:g0(d3({}))}),ux=J({...D6.shape,...K4.shape,uriTemplate:q(),description:g0(q()),mimeType:g0(q()),annotations:U6.optional(),_meta:g0(d3({}))}),kx=H4.extend({method:E0("resources/list")}),ax=O4.extend({resources:I0(zr)}),Cx=H4.extend({method:E0("resources/templates/list")}),ox=O4.extend({resourceTemplates:I0(ux)}),ip=R3.extend({uri:q()}),xx=ip,Ix=J0.extend({method:E0("resources/read"),params:xx}),ix=Y0.extend({contents:I0(A0([Gr,Wr]))}),tx=Z3.extend({method:E0("notifications/resources/list_changed"),params:t3.optional()}),Zx=ip,vx=J0.extend({method:E0("resources/subscribe"),params:Zx}),Fx=ip,Ax=J0.extend({method:E0("resources/unsubscribe"),params:Fx}),Mx=t3.extend({uri:q()}),sx=Z3.extend({method:E0("notifications/resources/updated"),params:Mx}),bx=J({name:q(),description:g0(q()),required:g0(K0())}),ex=J({...D6.shape,...K4.shape,description:g0(q()),arguments:g0(I0(bx)),_meta:g0(d3({}))}),gx=H4.extend({method:E0("prompts/list")}),lx=O4.extend({prompts:I0(ex)}),Px=R3.extend({name:q(),arguments:s0(q(),q()).optional()}),Lx=J0.extend({method:E0("prompts/get"),params:Px}),tp=J({type:E0("text"),text:q(),annotations:U6.optional(),_meta:s0(q(),e0()).optional()}),Zp=J({type:E0("image"),data:Ip,mimeType:q(),annotations:U6.optional(),_meta:s0(q(),e0()).optional()}),vp=J({type:E0("audio"),data:Ip,mimeType:q(),annotations:U6.optional(),_meta:s0(q(),e0()).optional()}),jx=J({type:E0("tool_use"),name:q(),id:q(),input:s0(q(),e0()),_meta:s0(q(),e0()).optional()}),qx=J({type:E0("resource"),resource:A0([Gr,Wr]),annotations:U6.optional(),_meta:s0(q(),e0()).optional()}),_x=zr.extend({type:E0("resource_link")}),Fp=A0([tp,Zp,vp,_x,qx]),Dx=J({role:G4,content:Fp}),Vx=Y0.extend({description:q().optional(),messages:I0(Dx)}),Bx=Z3.extend({method:E0("notifications/prompts/list_changed"),params:t3.optional()}),Nx=J({title:q().optional(),readOnlyHint:K0().optional(),destructiveHint:K0().optional(),idempotentHint:K0().optional(),openWorldHint:K0().optional()}),wx=J({taskSupport:c3(["required","optional","forbidden"]).optional()}),Qr=J({...D6.shape,...K4.shape,description:q().optional(),inputSchema:J({type:E0("object"),properties:s0(q(),Q0).optional(),required:I0(q()).optional()}).catchall(e0()),outputSchema:J({type:E0("object"),properties:s0(q(),Q0).optional(),required:I0(q()).optional()}).catchall(e0()).optional(),annotations:Nx.optional(),execution:wx.optional(),_meta:s0(q(),e0()).optional()}),Kx=H4.extend({method:E0("tools/list")}),Hx=O4.extend({tools:I0(Qr)}),Jr=Y0.extend({content:I0(Fp).default([]),structuredContent:s0(q(),e0()).optional(),isError:K0().optional()}),ct=Jr.or(Y0.extend({toolResult:e0()})),Ox=iE.extend({name:q(),arguments:s0(q(),e0()).optional()}),Ux=J0.extend({method:E0("tools/call"),params:Ox}),Gx=Z3.extend({method:E0("notifications/tools/list_changed"),params:t3.optional()}),nt=J({autoRefresh:K0().default(!0),debounceMs:F0().int().nonnegative().default(300)}),Yr=c3(["debug","info","notice","warning","error","critical","alert","emergency"]),Wx=R3.extend({level:Yr}),zx=J0.extend({method:E0("logging/setLevel"),params:Wx}),Qx=t3.extend({level:Yr,logger:q().optional(),data:e0()}),Jx=Z3.extend({method:E0("notifications/message"),params:Qx}),Yx=J({name:q().optional()}),Xx=J({hints:I0(Yx).optional(),costPriority:F0().min(0).max(1).optional(),speedPriority:F0().min(0).max(1).optional(),intelligencePriority:F0().min(0).max(1).optional()}),$x=J({mode:c3(["auto","required","none"]).optional()}),EI=J({type:E0("tool_result"),toolUseId:q().describe("The unique identifier for the corresponding tool call."),content:I0(Fp).default([]),structuredContent:J({}).loose().optional(),isError:K0().optional(),_meta:s0(q(),e0()).optional()}),yI=mp("type",[tp,Zp,vp]),H8=mp("type",[tp,Zp,vp,jx,EI]),dI=J({role:G4,content:A0([H8,I0(H8)]),_meta:s0(q(),e0()).optional()}),pI=iE.extend({messages:I0(dI),modelPreferences:Xx.optional(),systemPrompt:q().optional(),includeContext:c3(["none","thisServer","allServers"]).optional(),temperature:F0().optional(),maxTokens:F0().int(),stopSequences:I0(q()).optional(),metadata:Q0.optional(),tools:I0(Qr).optional(),toolChoice:$x.optional()}),hI=J0.extend({method:E0("sampling/createMessage"),params:pI}),SI=Y0.extend({model:q(),stopReason:g0(c3(["endTurn","stopSequence","maxTokens"]).or(q())),role:G4,content:yI}),cI=Y0.extend({model:q(),stopReason:g0(c3(["endTurn","stopSequence","maxTokens","toolUse"]).or(q())),role:G4,content:A0([H8,I0(H8)])}),nI=J({type:E0("boolean"),title:q().optional(),description:q().optional(),default:K0().optional()}),rI=J({type:E0("string"),title:q().optional(),description:q().optional(),minLength:F0().optional(),maxLength:F0().optional(),format:c3(["email","uri","date","date-time"]).optional(),default:q().optional()}),TI=J({type:c3(["number","integer"]),title:q().optional(),description:q().optional(),minimum:F0().optional(),maximum:F0().optional(),default:F0().optional()}),mI=J({type:E0("string"),title:q().optional(),description:q().optional(),enum:I0(q()),default:q().optional()}),RI=J({type:E0("string"),title:q().optional(),description:q().optional(),oneOf:I0(J({const:q(),title:q()})),default:q().optional()}),fI=J({type:E0("string"),title:q().optional(),description:q().optional(),enum:I0(q()),enumNames:I0(q()).optional(),default:q().optional()}),uI=A0([mI,RI]),kI=J({type:E0("array"),title:q().optional(),description:q().optional(),minItems:F0().optional(),maxItems:F0().optional(),items:J({type:E0("string"),enum:I0(q())}),default:I0(q()).optional()}),aI=J({type:E0("array"),title:q().optional(),description:q().optional(),minItems:F0().optional(),maxItems:F0().optional(),items:J({anyOf:I0(J({const:q(),title:q()}))}),default:I0(q()).optional()}),CI=A0([kI,aI]),oI=A0([fI,uI,CI]),xI=A0([oI,nI,rI,TI]),II=iE.extend({mode:E0("form").optional(),message:q(),requestedSchema:J({type:E0("object"),properties:s0(q(),xI),required:I0(q()).optional()})}),iI=iE.extend({mode:E0("url"),message:q(),elicitationId:q(),url:q().url()}),tI=A0([II,iI]),ZI=J0.extend({method:E0("elicitation/create"),params:tI}),vI=t3.extend({elicitationId:q()}),FI=Z3.extend({method:E0("notifications/elicitation/complete"),params:vI}),AI=Y0.extend({action:c3(["accept","decline","cancel"]),content:op((E)=>E===null?void 0:E,s0(q(),A0([q(),F0(),K0(),I0(q())])).optional())}),MI=J({type:E0("ref/resource"),uri:q()}),sI=J({type:E0("ref/prompt"),name:q()}),bI=R3.extend({ref:A0([sI,MI]),argument:J({name:q(),value:q()}),context:J({arguments:s0(q(),q()).optional()}).optional()}),eI=J0.extend({method:E0("completion/complete"),params:bI});var gI=Y0.extend({completion:d3({values:I0(q()).max(100),total:g0(F0().int()),hasMore:g0(K0())})}),lI=J({uri:q().startsWith("file://"),name:q().optional(),_meta:s0(q(),e0()).optional()}),PI=J0.extend({method:E0("roots/list"),params:R3.optional()}),LI=Y0.extend({roots:I0(lI)}),jI=Z3.extend({method:E0("notifications/roots/list_changed"),params:t3.optional()}),rt=A0([qr,hx,eI,zx,Lx,gx,kx,Cx,Ix,vx,Ax,Ux,Kx,Br,wr,Kr,Or]),Tt=A0([Lr,_r,nx,jI,Vr]),mt=A0([Pr,SI,cI,AI,LI,Nr,Hr,Dr]),Rt=A0([qr,hI,ZI,PI,Br,wr,Kr,Or]),ft=A0([Lr,_r,Jx,sx,tx,Gx,Bx,Vr,FI]),ut=A0([Pr,cx,gI,Vx,lx,ax,ox,ix,Jr,Hx,Nr,Hr,Dr]);var kt=Symbol("Let zodToJsonSchema decide on which parser to use");var at=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Ct=Ph(Bh(),1),ot=Ph(mm(),1);var eh;(function(E){E.Completable="McpCompletable"})(eh||(eh={}));function qI(E){let y;return()=>y??=E()}var gh=15000,_I=qI(()=>M6.object({session_id:M6.string(),ws_url:M6.string(),work_dir:M6.string().optional(),session_key:M6.string().optional()}));class Y3 extends Error{constructor(E){super(E);this.name="DirectConnectError"}}class DI{options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new My;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];constructor(E){this.options=E,this.abortController=E.abortController??new AbortController,this.readyPromise=new Promise((y,p)=>{this.readyResolve=y,this.readyReject=p}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new P3("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new P3("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let E;try{let d=await VI(this.options);this.sessionId=d.sessionId,this.workDir=d.workDir,E=d.wsUrl}catch(d){this.failInit(Wf(d));return}if(this.closed){if(this.options.deleteSessionOnClose&&this.sessionId)lh(this.options.serverUrl,this.sessionId,this.options.authToken);return}let y={};if(this.options.authToken)y.authorization=`Bearer ${this.options.authToken}`;let p=new WebSocket(E,{headers:y});this.ws=p;let h=setTimeout((d,S)=>{if(!d.readyState){S.close();let c=new Y3(`WebSocket connection timeout after ${gh}ms`);d.exitError=c,d.readyReject?.(c)}},gh,this,p);p.addEventListener("open",()=>{clearTimeout(h),this.readyState=!0,a3(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.()}),p.addEventListener("message",(d)=>{let S=typeof d.data==="string"?d.data:"";if(S.indexOf(`
86
- `)===-1){if(S)this.partialChunks.push(S);return}let c=this.partialChunks.join("")+S;this.partialChunks.length=0;let n=c.split(`
87
- `),r=n.pop()??"";if(r)this.partialChunks.push(r);for(let T of n){if(!T)continue;let k;try{k=Ay(T)}catch(o){a3(`DirectConnect: dropped malformed JSON line (${T.length} bytes): ${o}`);continue}this.messages.enqueue(k)}}),p.addEventListener("error",()=>{clearTimeout(h);let d=new Y3("WebSocket connection error");this.exitError=d,this.readyReject?.(d),this.messages.done()}),p.addEventListener("close",(d)=>{if(this.readyState=!1,this.closed=!0,d.code!==1000&&d.code!==1001&&!this.exitError)this.exitError=new Y3(`WebSocket closed abnormally: ${d.code} ${d.reason}`);this.messages.done()})}failInit(E){this.exitError=E,this.closed=!0,this.readyReject?.(E),this.messages.done()}async write(E){if(this.abortController.signal.aborted)throw new P3("Operation aborted");if(!this.readyState)await this.readyPromise;if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Y3("Transport is not ready for writing");this.ws.send(E)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}close(){if(this.closed)return;if(this.closed=!0,this.readyState=!1,this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;if(!this.abortController.signal.aborted)this.abortController.abort();if(this.ws&&this.ws.readyState===WebSocket.OPEN)this.ws.close(1000,"Normal closure");if(this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId)lh(this.options.serverUrl,this.sessionId,this.options.authToken)}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}async function VI(E){let y={"content-type":"application/json"};if(E.authToken)y.authorization=`Bearer ${E.authToken}`;let p={};if(E.cwd)p.cwd=E.cwd;if(E.sessionKey)p.session_key=E.sessionKey;if(E.permissionMode)p.permission_mode=E.permissionMode;let h;try{h=await fetch(`${E.serverUrl}/sessions`,{method:"POST",headers:y,body:C3(p)})}catch(S){throw new Y3(`Failed to connect to server at ${E.serverUrl}: ${S instanceof Error?S.message:String(S)}`)}if(!h.ok){let S=await h.text().catch(()=>"");throw new Y3(`Failed to create session: ${h.status} ${h.statusText}${S?` — ${S}`:""}`)}let d=_I().safeParse(await h.json());if(!d.success)throw new Y3(`Invalid session response: ${d.error.message}`);return{sessionId:d.data.session_id,wsUrl:d.data.ws_url,workDir:d.data.work_dir}}async function lh(E,y,p){let h={};if(p)h.authorization=`Bearer ${p}`;try{await fetch(`${E}/sessions/${y}`,{method:"DELETE",headers:h})}catch{}}function BI(E,y){let{systemPrompt:p,settings:h,settingSources:d,sandbox:S,...c}=E??{},n,r;if(p===void 0)n="";else if(typeof p==="string")n=p;else if(p.type==="preset")r=p.append;let T=c.pathToClaudeCodeExecutable;if(!T){let l3=fm(import.meta.url),F3=Rm(l3),W6=wu((W4)=>F3.resolve(W4));if(W6)T=W6;else try{T=F3.resolve("./cli.js")}catch{throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`)}}process.env.CLAUDE_AGENT_SDK_VERSION="0.2.96";let{abortController:k=Nh(),additionalDirectories:o=[],agent:u,agents:i,allowedTools:v=[],betas:F,canUseTool:t,continue:m,cwd:a,debug:R,debugFile:f,disallowedTools:I=[],tools:x,env:Z,executable:A=wh()?"bun":"node",executableArgs:g=[],extraArgs:V={},fallbackModel:_,enableFileCheckpointing:N,toolConfig:O,forkSession:z,hooks:K,includeHookEvents:l0,includePartialMessages:H0,onElicitation:O0,persistSession:o0,thinking:b,effort:L,maxThinkingTokens:B,maxTurns:C,maxBudgetUsd:s,taskBudget:P,mcpServers:X,model:d0,outputFormat:C0,permissionMode:h0="default",allowDangerouslySkipPermissions:P0=!1,permissionPromptToolName:v3,plugins:M,workload:j,resume:D,resumeSessionAt:y0,sessionId:p0,stderr:f0,strictMcpConfig:G0}=c,X0=C0?.type==="json_schema"?C0.schema:void 0,U0=Z;if(!U0)U0={...process.env};if(!U0.CLAUDE_CODE_ENTRYPOINT)U0.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(N)U0.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(O?.askUserQuestion?.previewFormat)U0.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=O.askUserQuestion.previewFormat;let W0={},B0=new Map;if(X)for(let[l3,F3]of Object.entries(X))if(F3.type==="sdk"&&F3.instance)B0.set(l3,F3.instance);else W0[l3]=F3;let f3;if(b)switch(b.type){case"adaptive":f3={type:"adaptive",display:b.display};break;case"enabled":f3={type:"enabled",budgetTokens:b.budgetTokens,display:b.display};break;case"disabled":f3={type:"disabled"};break}else if(B!==void 0)f3=B===0?{type:"disabled"}:{type:"enabled",budgetTokens:B};let E3=new vS({abortController:k,additionalDirectories:o,agent:u,betas:F,cwd:a,debug:R,debugFile:f,executable:A,executableArgs:g,extraArgs:j?{...V,workload:j}:V,pathToClaudeCodeExecutable:T,env:U0,forkSession:z,stderr:f0,thinkingConfig:f3,effort:L,maxTurns:C,maxBudgetUsd:s,taskBudget:P,model:d0,fallbackModel:_,jsonSchema:X0,permissionMode:h0,allowDangerouslySkipPermissions:P0,permissionPromptToolName:v3,continueConversation:m,resume:D,resumeSessionAt:y0,sessionId:p0,settings:typeof h==="object"?C3(h):h,settingSources:d,allowedTools:v,disallowedTools:I,tools:x,mcpServers:W0,strictMcpConfig:G0,canUseTool:!!t,hooks:!!K,includeHookEvents:l0,includePartialMessages:H0,persistSession:o0,plugins:M,sandbox:S,spawnClaudeCodeProcess:c.spawnClaudeCodeProcess}),G6={systemPrompt:n,appendSystemPrompt:r,agents:i,promptSuggestions:c.promptSuggestions,agentProgressSummaries:c.agentProgressSummaries};return{queryInstance:new AS(E3,y,t,K,k,B0,X0,G6,O0),transport:E3,abortController:k}}function NI(E,y,p,h){if(typeof p==="string")y.write(C3({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:p}]},parent_tool_use_id:null})+`
88
- `);else E.streamInput(p).catch((d)=>h.abort(d))}function Xr({prompt:E,options:y}){let{queryInstance:p,transport:h,abortController:d}=BI(y,typeof E==="string");return NI(p,h,E,d),p}import{hostname as $r}from"os";class ET{url;alias;resumeId;token;constructor(E,y,p){this.url=E.replace(/\/$/,""),this.alias=y,this.resumeId=`agent-${y}-${Date.now().toString(36)}`,this.token=p}async call(E,y){let p={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};if(this.token)p.Authorization=`Bearer ${this.token}`;let d=await(await fetch(`${this.url}/mcp`,{method:"POST",headers:p,body:JSON.stringify({jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:E,arguments:y}})})).text(),S=d.match(/data: (.+)/),c=S?JSON.parse(S[1]):JSON.parse(d),n=c?.result?.content?.[0]?.text;return n?JSON.parse(n):c}report(E,y){return this.call("report_status",{resume_id:this.resumeId,alias:this.alias,status:E,server:$r(),hostname:$r(),agent:"agent-node",project_dir:process.cwd(),...y})}getInbox(E=5){return this.call("get_inbox",{alias:this.alias,limit:E})}ack(E){return this.call("ack_inbox",{alias:this.alias,message_id:E})}send(E,y,p="normal"){return this.call("send_task",{alias:E,task:y,priority:p,from_session:this.alias})}sseUrl(){return`${this.url}/events/${encodeURIComponent(this.alias)}`}}class ZE{config;client;running=!1;sessionId;log;constructor(E){this.config={model:"claude-sonnet-4-6",tools:[],maxTurns:5,heartbeatInterval:180000,...E},this.client=new ET(E.hub,E.alias,E.token),this.log=E.log||((y)=>console.log(`[${new Date().toTimeString().slice(0,8)}] [${E.alias}] ${y}`))}async processTask(E){if(this.config.onTask){let d=await this.config.onTask(E);if(typeof d==="string")return d}let y=`你是 ${this.config.alias},收到来自 ${E.from_session} 的任务:
85
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(s.cycles==="ref")n(c);continue}if(m.count>1){if(s.reused==="ref"){n(c);continue}}}let i=(c,m)=>{let u=this.seen.get(c),p=u.def??u.schema,k={...p};if(u.ref===null)return;let C=u.ref;if(u.ref=null,C){i(C,m);let I=this.seen.get(C).schema;if(I.$ref&&m.target==="draft-7")p.allOf=p.allOf??[],p.allOf.push(I);else Object.assign(p,I),Object.assign(p,k)}if(!u.isParent)this.override({zodSchema:c,jsonSchema:p,path:u.path??[]})};for(let c of[...this.seen.entries()].reverse())i(c[0],{target:this.target});let h={};if(this.target==="draft-2020-12")h.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")h.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(h,r.def);let o=s.external?.defs??{};for(let c of this.seen.entries()){let m=c[1];if(m.def&&m.defId)o[m.defId]=m.def}if(!s.external&&Object.keys(o).length>0)if(this.target==="draft-2020-12")h.$defs=o;else h.definitions=o;try{return JSON.parse(JSON.stringify(h))}catch(c){throw Error("Error converting schema to JSON.")}}}function Dd(t,e){if(t instanceof ir){let r=new Vs(e),a={};for(let h of t._idmap.entries()){let[o,c]=h;r.process(c)}let n={},i={registry:t,uri:e?.uri||((h)=>h),defs:a};for(let h of t._idmap.entries()){let[o,c]=h;n[o]=r.emit(c,{...e,external:i})}if(Object.keys(a).length>0){let h=r.target==="draft-2020-12"?"$defs":"definitions";n.__shared={[h]:a}}return{schemas:n}}let s=new Vs(e);return s.process(t),s.emit(t,e)}function wt(t,e){let s=e??{seen:new Set};if(s.seen.has(t))return!1;s.seen.add(t);let r=t._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return wt(r.element,s);case"object":{for(let a in r.shape)if(wt(r.shape[a],s))return!0;return!1}case"union":{for(let a of r.options)if(wt(a,s))return!0;return!1}case"intersection":return wt(r.left,s)||wt(r.right,s);case"tuple":{for(let a of r.items)if(wt(a,s))return!0;if(r.rest&&wt(r.rest,s))return!0;return!1}case"record":return wt(r.keyType,s)||wt(r.valueType,s);case"map":return wt(r.keyType,s)||wt(r.valueType,s);case"set":return wt(r.valueType,s);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return wt(r.innerType,s);case"lazy":return wt(r.getter(),s);case"default":return wt(r.innerType,s);case"prefault":return wt(r.innerType,s);case"custom":return!1;case"transform":return!0;case"pipe":return wt(r.in,s)||wt(r.out,s);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var _S={},DS=Z("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");ct.init(t,e),t.def=e,t.parse=(s,r)=>js(t,s,r,{callee:t.parse}),t.safeParse=(s,r)=>Vn(t,s,r),t.parseAsync=async(s,r)=>qs(t,s,r,{callee:t.parseAsync}),t.safeParseAsync=async(s,r)=>wn(t,s,r),t.check=(...s)=>{return t.clone({...e,checks:[...e.checks??[],...s.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})},t.clone=(s,r)=>F0(t,s,r),t.brand=()=>t,t.register=(s,r)=>{return s.add(t,r),t}}),aR=Z("ZodMiniObject",(t,e)=>{Xn.init(t,e),DS.init(t,e),ft.defineLazy(t,"shape",()=>e.shape)});var ge={};le(ge,{xid:()=>YS,void:()=>Tf,uuidv7:()=>OS,uuidv6:()=>HS,uuidv4:()=>KS,uuid:()=>wS,url:()=>US,uppercase:()=>A3,unknown:()=>Zt,union:()=>vt,undefined:()=>Sf,ulid:()=>JS,uint64:()=>Ef,uint32:()=>lf,tuple:()=>Cf,trim:()=>j3,treeifyError:()=>Uo,transform:()=>mi,toUpperCase:()=>_3,toLowerCase:()=>q3,toJSONSchema:()=>Dd,templateLiteral:()=>Pf,symbol:()=>uf,superRefine:()=>Ay,success:()=>Ff,stringbool:()=>qf,stringFormat:()=>of,string:()=>q,strictObject:()=>xf,startsWith:()=>F3,size:()=>v3,setErrorMap:()=>Bf,set:()=>gf,safeParseAsync:()=>Gd,safeParse:()=>Ud,registry:()=>s3,regexes:()=>Kn,regex:()=>g3,refine:()=>by,record:()=>bt,readonly:()=>ky,property:()=>Zd,promise:()=>Lf,prettifyError:()=>Wo,preprocess:()=>fi,prefault:()=>py,positive:()=>vd,pipe:()=>Ks,partialRecord:()=>If,parseAsync:()=>Od,parse:()=>Hd,overwrite:()=>ue,optional:()=>Ft,object:()=>J,number:()=>It,nullish:()=>Zf,nullable:()=>ws,null:()=>mr,normalize:()=>L3,nonpositive:()=>bd,nonoptional:()=>my,nonnegative:()=>Ad,never:()=>Er,negative:()=>gd,nativeEnum:()=>bf,nanoid:()=>WS,nan:()=>Mf,multipleOf:()=>La,minSize:()=>ja,minLength:()=>_e,mime:()=>P3,maxSize:()=>hr,maxLength:()=>or,map:()=>vf,lte:()=>g0,lt:()=>de,lowercase:()=>b3,looseObject:()=>a0,locales:()=>a3,literal:()=>tt,length:()=>cr,lazy:()=>Cy,ksuid:()=>XS,keyof:()=>Rf,jwt:()=>hf,json:()=>_f,iso:()=>V3,ipv6:()=>tf,ipv4:()=>$S,intersection:()=>Sr,int64:()=>mf,int32:()=>yf,int:()=>Qr,instanceof:()=>jf,includes:()=>Z3,guid:()=>NS,gte:()=>d0,gt:()=>ye,globalRegistry:()=>ie,getErrorMap:()=>Vf,function:()=>_d,formatError:()=>qn,float64:()=>df,float32:()=>cf,flattenError:()=>jn,file:()=>Af,enum:()=>i0,endsWith:()=>M3,emoji:()=>GS,email:()=>VS,e164:()=>nf,discriminatedUnion:()=>yi,date:()=>kf,custom:()=>gy,cuid2:()=>QS,cuid:()=>zS,core:()=>Po,config:()=>r0,coerce:()=>Zy,clone:()=>F0,cidrv6:()=>af,cidrv4:()=>ef,check:()=>vy,catch:()=>Sy,boolean:()=>Kt,bigint:()=>pf,base64url:()=>rf,base64:()=>sf,array:()=>Tt,any:()=>ff,_default:()=>yy,_ZodString:()=>O3,ZodXID:()=>X3,ZodVoid:()=>ty,ZodUnknown:()=>Xd,ZodUnion:()=>di,ZodUndefined:()=>Qd,ZodUUID:()=>O0,ZodURL:()=>G3,ZodULID:()=>Y3,ZodType:()=>mt,ZodTuple:()=>ry,ZodTransform:()=>pi,ZodTemplateLiteral:()=>Ry,ZodSymbol:()=>zd,ZodSuccess:()=>Ey,ZodStringFormat:()=>At,ZodString:()=>dr,ZodSet:()=>iy,ZodRecord:()=>li,ZodRealError:()=>wa,ZodReadonly:()=>Ty,ZodPromise:()=>Iy,ZodPrefault:()=>ly,ZodPipe:()=>Si,ZodOptional:()=>Ei,ZodObject:()=>ur,ZodNumberFormat:()=>Oe,ZodNumber:()=>yr,ZodNullable:()=>cy,ZodNull:()=>Jd,ZodNonOptional:()=>ui,ZodNever:()=>$d,ZodNanoID:()=>z3,ZodNaN:()=>fy,ZodMap:()=>ny,ZodLiteral:()=>hy,ZodLazy:()=>xy,ZodKSUID:()=>$3,ZodJWT:()=>hi,ZodIssueCode:()=>Df,ZodIntersection:()=>sy,ZodISOTime:()=>K3,ZodISODuration:()=>H3,ZodISODateTime:()=>N3,ZodISODate:()=>w3,ZodIPv6:()=>ei,ZodIPv4:()=>ti,ZodGUID:()=>Ns,ZodFile:()=>oy,ZodError:()=>BS,ZodEnum:()=>qa,ZodEmoji:()=>W3,ZodEmail:()=>U3,ZodE164:()=>ii,ZodDiscriminatedUnion:()=>ay,ZodDefault:()=>dy,ZodDate:()=>ci,ZodCustomStringFormat:()=>Wd,ZodCustom:()=>fr,ZodCatch:()=>uy,ZodCUID2:()=>J3,ZodCUID:()=>Q3,ZodCIDRv6:()=>si,ZodCIDRv4:()=>ai,ZodBoolean:()=>lr,ZodBigIntFormat:()=>oi,ZodBigInt:()=>pr,ZodBase64URL:()=>ni,ZodBase64:()=>ri,ZodArray:()=>ey,ZodAny:()=>Yd,TimePrecision:()=>X6,NEVER:()=>Lo,$output:()=>z6,$input:()=>Q6,$brand:()=>jo});var V3={};le(V3,{time:()=>Nd,duration:()=>wd,datetime:()=>Bd,date:()=>Vd,ZodISOTime:()=>K3,ZodISODuration:()=>H3,ZodISODateTime:()=>N3,ZodISODate:()=>w3});var N3=Z("ZodISODateTime",(t,e)=>{a6.init(t,e),At.init(t,e)});function Bd(t){return $6(N3,t)}var w3=Z("ZodISODate",(t,e)=>{s6.init(t,e),At.init(t,e)});function Vd(t){return td(w3,t)}var K3=Z("ZodISOTime",(t,e)=>{r6.init(t,e),At.init(t,e)});function Nd(t){return ed(K3,t)}var H3=Z("ZodISODuration",(t,e)=>{n6.init(t,e),At.init(t,e)});function wd(t){return ad(H3,t)}var Kd=(t,e)=>{Ln.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:(s)=>qn(t,s)},flatten:{value:(s)=>jn(t,s)},addIssue:{value:(s)=>t.issues.push(s)},addIssues:{value:(s)=>t.issues.push(...s)},isEmpty:{get(){return t.issues.length===0}}})},BS=Z("ZodError",Kd),wa=Z("ZodError",Kd,{Parent:Error}),Hd=_n(wa),Od=Dn(wa),Ud=Bn(wa),Gd=Nn(wa),mt=Z("ZodType",(t,e)=>{return ct.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...s)=>{return t.clone({...e,checks:[...e.checks??[],...s.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})},t.clone=(s,r)=>F0(t,s,r),t.brand=()=>t,t.register=(s,r)=>{return s.add(t,r),t},t.parse=(s,r)=>Hd(t,s,r,{callee:t.parse}),t.safeParse=(s,r)=>Ud(t,s,r),t.parseAsync=async(s,r)=>Od(t,s,r,{callee:t.parseAsync}),t.safeParseAsync=async(s,r)=>Gd(t,s,r),t.spa=t.safeParseAsync,t.refine=(s,r)=>t.check(by(s,r)),t.superRefine=(s)=>t.check(Ay(s)),t.overwrite=(s)=>t.check(ue(s)),t.optional=()=>Ft(t),t.nullable=()=>ws(t),t.nullish=()=>Ft(ws(t)),t.nonoptional=(s)=>my(t,s),t.array=()=>Tt(t),t.or=(s)=>vt([t,s]),t.and=(s)=>Sr(t,s),t.transform=(s)=>Ks(t,mi(s)),t.default=(s)=>yy(t,s),t.prefault=(s)=>py(t,s),t.catch=(s)=>Sy(t,s),t.pipe=(s)=>Ks(t,s),t.readonly=()=>ky(t),t.describe=(s)=>{let r=t.clone();return ie.add(r,{description:s}),r},Object.defineProperty(t,"description",{get(){return ie.get(t)?.description},configurable:!0}),t.meta=(...s)=>{if(s.length===0)return ie.get(t);let r=t.clone();return ie.add(r,s[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t}),O3=Z("_ZodString",(t,e)=>{Na.init(t,e),mt.init(t,e);let s=t._zod.bag;t.format=s.format??null,t.minLength=s.minimum??null,t.maxLength=s.maximum??null,t.regex=(...r)=>t.check(g3(...r)),t.includes=(...r)=>t.check(Z3(...r)),t.startsWith=(...r)=>t.check(F3(...r)),t.endsWith=(...r)=>t.check(M3(...r)),t.min=(...r)=>t.check(_e(...r)),t.max=(...r)=>t.check(or(...r)),t.length=(...r)=>t.check(cr(...r)),t.nonempty=(...r)=>t.check(_e(1,...r)),t.lowercase=(r)=>t.check(b3(r)),t.uppercase=(r)=>t.check(A3(r)),t.trim=()=>t.check(j3()),t.normalize=(...r)=>t.check(L3(...r)),t.toLowerCase=()=>t.check(q3()),t.toUpperCase=()=>t.check(_3())}),dr=Z("ZodString",(t,e)=>{Na.init(t,e),O3.init(t,e),t.email=(s)=>t.check(r3(U3,s)),t.url=(s)=>t.check(c3(G3,s)),t.jwt=(s)=>t.check(I3(hi,s)),t.emoji=(s)=>t.check(d3(W3,s)),t.guid=(s)=>t.check(Ds(Ns,s)),t.uuid=(s)=>t.check(n3(O0,s)),t.uuidv4=(s)=>t.check(i3(O0,s)),t.uuidv6=(s)=>t.check(h3(O0,s)),t.uuidv7=(s)=>t.check(o3(O0,s)),t.nanoid=(s)=>t.check(y3(z3,s)),t.guid=(s)=>t.check(Ds(Ns,s)),t.cuid=(s)=>t.check(l3(Q3,s)),t.cuid2=(s)=>t.check(p3(J3,s)),t.ulid=(s)=>t.check(m3(Y3,s)),t.base64=(s)=>t.check(R3(ri,s)),t.base64url=(s)=>t.check(x3(ni,s)),t.xid=(s)=>t.check(E3(X3,s)),t.ksuid=(s)=>t.check(u3($3,s)),t.ipv4=(s)=>t.check(S3(ti,s)),t.ipv6=(s)=>t.check(f3(ei,s)),t.cidrv4=(s)=>t.check(T3(ai,s)),t.cidrv6=(s)=>t.check(k3(si,s)),t.e164=(s)=>t.check(C3(ii,s)),t.datetime=(s)=>t.check(Bd(s)),t.date=(s)=>t.check(Vd(s)),t.time=(s)=>t.check(Nd(s)),t.duration=(s)=>t.check(wd(s))});function q(t){return J6(dr,t)}var At=Z("ZodStringFormat",(t,e)=>{gt.init(t,e),O3.init(t,e)}),U3=Z("ZodEmail",(t,e)=>{Wc.init(t,e),At.init(t,e)});function VS(t){return r3(U3,t)}var Ns=Z("ZodGUID",(t,e)=>{Uc.init(t,e),At.init(t,e)});function NS(t){return Ds(Ns,t)}var O0=Z("ZodUUID",(t,e)=>{Gc.init(t,e),At.init(t,e)});function wS(t){return n3(O0,t)}function KS(t){return i3(O0,t)}function HS(t){return h3(O0,t)}function OS(t){return o3(O0,t)}var G3=Z("ZodURL",(t,e)=>{zc.init(t,e),At.init(t,e)});function US(t){return c3(G3,t)}var W3=Z("ZodEmoji",(t,e)=>{Qc.init(t,e),At.init(t,e)});function GS(t){return d3(W3,t)}var z3=Z("ZodNanoID",(t,e)=>{Jc.init(t,e),At.init(t,e)});function WS(t){return y3(z3,t)}var Q3=Z("ZodCUID",(t,e)=>{Yc.init(t,e),At.init(t,e)});function zS(t){return l3(Q3,t)}var J3=Z("ZodCUID2",(t,e)=>{Xc.init(t,e),At.init(t,e)});function QS(t){return p3(J3,t)}var Y3=Z("ZodULID",(t,e)=>{$c.init(t,e),At.init(t,e)});function JS(t){return m3(Y3,t)}var X3=Z("ZodXID",(t,e)=>{t6.init(t,e),At.init(t,e)});function YS(t){return E3(X3,t)}var $3=Z("ZodKSUID",(t,e)=>{e6.init(t,e),At.init(t,e)});function XS(t){return u3($3,t)}var ti=Z("ZodIPv4",(t,e)=>{i6.init(t,e),At.init(t,e)});function $S(t){return S3(ti,t)}var ei=Z("ZodIPv6",(t,e)=>{h6.init(t,e),At.init(t,e)});function tf(t){return f3(ei,t)}var ai=Z("ZodCIDRv4",(t,e)=>{o6.init(t,e),At.init(t,e)});function ef(t){return T3(ai,t)}var si=Z("ZodCIDRv6",(t,e)=>{c6.init(t,e),At.init(t,e)});function af(t){return k3(si,t)}var ri=Z("ZodBase64",(t,e)=>{d6.init(t,e),At.init(t,e)});function sf(t){return R3(ri,t)}var ni=Z("ZodBase64URL",(t,e)=>{l6.init(t,e),At.init(t,e)});function rf(t){return x3(ni,t)}var ii=Z("ZodE164",(t,e)=>{p6.init(t,e),At.init(t,e)});function nf(t){return C3(ii,t)}var hi=Z("ZodJWT",(t,e)=>{E6.init(t,e),At.init(t,e)});function hf(t){return I3(hi,t)}var Wd=Z("ZodCustomStringFormat",(t,e)=>{u6.init(t,e),At.init(t,e)});function of(t,e,s={}){return qd(Wd,t,e,s)}var yr=Z("ZodNumber",(t,e)=>{zn.init(t,e),mt.init(t,e),t.gt=(r,a)=>t.check(ye(r,a)),t.gte=(r,a)=>t.check(d0(r,a)),t.min=(r,a)=>t.check(d0(r,a)),t.lt=(r,a)=>t.check(de(r,a)),t.lte=(r,a)=>t.check(g0(r,a)),t.max=(r,a)=>t.check(g0(r,a)),t.int=(r)=>t.check(Qr(r)),t.safe=(r)=>t.check(Qr(r)),t.positive=(r)=>t.check(ye(0,r)),t.nonnegative=(r)=>t.check(d0(0,r)),t.negative=(r)=>t.check(de(0,r)),t.nonpositive=(r)=>t.check(g0(0,r)),t.multipleOf=(r,a)=>t.check(La(r,a)),t.step=(r,a)=>t.check(La(r,a)),t.finite=()=>t;let s=t._zod.bag;t.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??0.5),t.isFinite=!0,t.format=s.format??null});function It(t){return sd(yr,t)}var Oe=Z("ZodNumberFormat",(t,e)=>{S6.init(t,e),yr.init(t,e)});function Qr(t){return nd(Oe,t)}function cf(t){return id(Oe,t)}function df(t){return hd(Oe,t)}function yf(t){return od(Oe,t)}function lf(t){return cd(Oe,t)}var lr=Z("ZodBoolean",(t,e)=>{Qn.init(t,e),mt.init(t,e)});function Kt(t){return dd(lr,t)}var pr=Z("ZodBigInt",(t,e)=>{Jn.init(t,e),mt.init(t,e),t.gte=(r,a)=>t.check(d0(r,a)),t.min=(r,a)=>t.check(d0(r,a)),t.gt=(r,a)=>t.check(ye(r,a)),t.gte=(r,a)=>t.check(d0(r,a)),t.min=(r,a)=>t.check(d0(r,a)),t.lt=(r,a)=>t.check(de(r,a)),t.lte=(r,a)=>t.check(g0(r,a)),t.max=(r,a)=>t.check(g0(r,a)),t.positive=(r)=>t.check(ye(BigInt(0),r)),t.negative=(r)=>t.check(de(BigInt(0),r)),t.nonpositive=(r)=>t.check(g0(BigInt(0),r)),t.nonnegative=(r)=>t.check(d0(BigInt(0),r)),t.multipleOf=(r,a)=>t.check(La(r,a));let s=t._zod.bag;t.minValue=s.minimum??null,t.maxValue=s.maximum??null,t.format=s.format??null});function pf(t){return ld(pr,t)}var oi=Z("ZodBigIntFormat",(t,e)=>{f6.init(t,e),pr.init(t,e)});function mf(t){return md(oi,t)}function Ef(t){return Ed(oi,t)}var zd=Z("ZodSymbol",(t,e)=>{T6.init(t,e),mt.init(t,e)});function uf(t){return ud(zd,t)}var Qd=Z("ZodUndefined",(t,e)=>{k6.init(t,e),mt.init(t,e)});function Sf(t){return Sd(Qd,t)}var Jd=Z("ZodNull",(t,e)=>{R6.init(t,e),mt.init(t,e)});function mr(t){return fd(Jd,t)}var Yd=Z("ZodAny",(t,e)=>{x6.init(t,e),mt.init(t,e)});function ff(){return Td(Yd)}var Xd=Z("ZodUnknown",(t,e)=>{_s.init(t,e),mt.init(t,e)});function Zt(){return Bs(Xd)}var $d=Z("ZodNever",(t,e)=>{C6.init(t,e),mt.init(t,e)});function Er(t){return kd($d,t)}var ty=Z("ZodVoid",(t,e)=>{I6.init(t,e),mt.init(t,e)});function Tf(t){return Rd(ty,t)}var ci=Z("ZodDate",(t,e)=>{v6.init(t,e),mt.init(t,e),t.min=(r,a)=>t.check(d0(r,a)),t.max=(r,a)=>t.check(g0(r,a));let s=t._zod.bag;t.minDate=s.minimum?new Date(s.minimum):null,t.maxDate=s.maximum?new Date(s.maximum):null});function kf(t){return xd(ci,t)}var ey=Z("ZodArray",(t,e)=>{Yn.init(t,e),mt.init(t,e),t.element=e.element,t.min=(s,r)=>t.check(_e(s,r)),t.nonempty=(s)=>t.check(_e(1,s)),t.max=(s,r)=>t.check(or(s,r)),t.length=(s,r)=>t.check(cr(s,r)),t.unwrap=()=>t.element});function Tt(t,e){return D3(ey,t,e)}function Rf(t){let e=t._zod.def.shape;return tt(Object.keys(e))}var ur=Z("ZodObject",(t,e)=>{Xn.init(t,e),mt.init(t,e),ft.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>i0(Object.keys(t._zod.def.shape)),t.catchall=(s)=>t.clone({...t._zod.def,catchall:s}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Zt()}),t.loose=()=>t.clone({...t._zod.def,catchall:Zt()}),t.strict=()=>t.clone({...t._zod.def,catchall:Er()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=(s)=>{return ft.extend(t,s)},t.merge=(s)=>ft.merge(t,s),t.pick=(s)=>ft.pick(t,s),t.omit=(s)=>ft.omit(t,s),t.partial=(...s)=>ft.partial(Ei,t,s[0]),t.required=(...s)=>ft.required(ui,t,s[0])});function J(t,e){let s={type:"object",get shape(){return ft.assignProp(this,"shape",{...t}),this.shape},...ft.normalizeParams(e)};return new ur(s)}function xf(t,e){return new ur({type:"object",get shape(){return ft.assignProp(this,"shape",{...t}),this.shape},catchall:Er(),...ft.normalizeParams(e)})}function a0(t,e){return new ur({type:"object",get shape(){return ft.assignProp(this,"shape",{...t}),this.shape},catchall:Zt(),...ft.normalizeParams(e)})}var di=Z("ZodUnion",(t,e)=>{$n.init(t,e),mt.init(t,e),t.options=e.options});function vt(t,e){return new di({type:"union",options:t,...ft.normalizeParams(e)})}var ay=Z("ZodDiscriminatedUnion",(t,e)=>{di.init(t,e),g6.init(t,e)});function yi(t,e,s){return new ay({type:"union",options:e,discriminator:t,...ft.normalizeParams(s)})}var sy=Z("ZodIntersection",(t,e)=>{b6.init(t,e),mt.init(t,e)});function Sr(t,e){return new sy({type:"intersection",left:t,right:e})}var ry=Z("ZodTuple",(t,e)=>{nr.init(t,e),mt.init(t,e),t.rest=(s)=>t.clone({...t._zod.def,rest:s})});function Cf(t,e,s){let r=e instanceof ct,a=r?s:e;return new ry({type:"tuple",items:t,rest:r?e:null,...ft.normalizeParams(a)})}var li=Z("ZodRecord",(t,e)=>{A6.init(t,e),mt.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function bt(t,e,s){return new li({type:"record",keyType:t,valueType:e,...ft.normalizeParams(s)})}function If(t,e,s){return new li({type:"record",keyType:vt([t,Er()]),valueType:e,...ft.normalizeParams(s)})}var ny=Z("ZodMap",(t,e)=>{Z6.init(t,e),mt.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function vf(t,e,s){return new ny({type:"map",keyType:t,valueType:e,...ft.normalizeParams(s)})}var iy=Z("ZodSet",(t,e)=>{F6.init(t,e),mt.init(t,e),t.min=(...s)=>t.check(ja(...s)),t.nonempty=(s)=>t.check(ja(1,s)),t.max=(...s)=>t.check(hr(...s)),t.size=(...s)=>t.check(v3(...s))});function gf(t,e){return new iy({type:"set",valueType:t,...ft.normalizeParams(e)})}var qa=Z("ZodEnum",(t,e)=>{M6.init(t,e),mt.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let s=new Set(Object.keys(e.entries));t.extract=(r,a)=>{let n={};for(let i of r)if(s.has(i))n[i]=e.entries[i];else throw Error(`Key ${i} not found in enum`);return new qa({...e,checks:[],...ft.normalizeParams(a),entries:n})},t.exclude=(r,a)=>{let n={...e.entries};for(let i of r)if(s.has(i))delete n[i];else throw Error(`Key ${i} not found in enum`);return new qa({...e,checks:[],...ft.normalizeParams(a),entries:n})}});function i0(t,e){let s=Array.isArray(t)?Object.fromEntries(t.map((r)=>[r,r])):t;return new qa({type:"enum",entries:s,...ft.normalizeParams(e)})}function bf(t,e){return new qa({type:"enum",entries:t,...ft.normalizeParams(e)})}var hy=Z("ZodLiteral",(t,e)=>{P6.init(t,e),mt.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function tt(t,e){return new hy({type:"literal",values:Array.isArray(t)?t:[t],...ft.normalizeParams(e)})}var oy=Z("ZodFile",(t,e)=>{L6.init(t,e),mt.init(t,e),t.min=(s,r)=>t.check(ja(s,r)),t.max=(s,r)=>t.check(hr(s,r)),t.mime=(s,r)=>t.check(P3(Array.isArray(s)?s:[s],r))});function Af(t){return Md(oy,t)}var pi=Z("ZodTransform",(t,e)=>{t3.init(t,e),mt.init(t,e),t._zod.parse=(s,r)=>{s.addIssue=(n)=>{if(typeof n==="string")s.issues.push(ft.issue(n,s.value,e));else{let i=n;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=s.value),i.inst??(i.inst=t),i.continue??(i.continue=!0),s.issues.push(ft.issue(i))}};let a=e.transform(s.value,s);if(a instanceof Promise)return a.then((n)=>{return s.value=n,s});return s.value=a,s}});function mi(t){return new pi({type:"transform",transform:t})}var Ei=Z("ZodOptional",(t,e)=>{j6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ft(t){return new Ei({type:"optional",innerType:t})}var cy=Z("ZodNullable",(t,e)=>{q6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ws(t){return new cy({type:"nullable",innerType:t})}function Zf(t){return Ft(ws(t))}var dy=Z("ZodDefault",(t,e)=>{_6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function yy(t,e){return new dy({type:"default",innerType:t,get defaultValue(){return typeof e==="function"?e():e}})}var ly=Z("ZodPrefault",(t,e)=>{D6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.innerType});function py(t,e){return new ly({type:"prefault",innerType:t,get defaultValue(){return typeof e==="function"?e():e}})}var ui=Z("ZodNonOptional",(t,e)=>{B6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.innerType});function my(t,e){return new ui({type:"nonoptional",innerType:t,...ft.normalizeParams(e)})}var Ey=Z("ZodSuccess",(t,e)=>{V6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ff(t){return new Ey({type:"success",innerType:t})}var uy=Z("ZodCatch",(t,e)=>{N6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Sy(t,e){return new uy({type:"catch",innerType:t,catchValue:typeof e==="function"?e:()=>e})}var fy=Z("ZodNaN",(t,e)=>{w6.init(t,e),mt.init(t,e)});function Mf(t){return Id(fy,t)}var Si=Z("ZodPipe",(t,e)=>{e3.init(t,e),mt.init(t,e),t.in=e.in,t.out=e.out});function Ks(t,e){return new Si({type:"pipe",in:t,out:e})}var Ty=Z("ZodReadonly",(t,e)=>{K6.init(t,e),mt.init(t,e)});function ky(t){return new Ty({type:"readonly",innerType:t})}var Ry=Z("ZodTemplateLiteral",(t,e)=>{H6.init(t,e),mt.init(t,e)});function Pf(t,e){return new Ry({type:"template_literal",parts:t,...ft.normalizeParams(e)})}var xy=Z("ZodLazy",(t,e)=>{U6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.getter()});function Cy(t){return new xy({type:"lazy",getter:t})}var Iy=Z("ZodPromise",(t,e)=>{O6.init(t,e),mt.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Lf(t){return new Iy({type:"promise",innerType:t})}var fr=Z("ZodCustom",(t,e)=>{G6.init(t,e),mt.init(t,e)});function vy(t,e){let s=new Bt({check:"custom",...ft.normalizeParams(e)});return s._zod.check=t,s}function gy(t,e){return Pd(fr,t??(()=>!0),e)}function by(t,e={}){return Ld(fr,t,e)}function Ay(t,e){let s=vy((r)=>{return r.addIssue=(a)=>{if(typeof a==="string")r.issues.push(ft.issue(a,r.value,s._zod.def));else{let n=a;if(n.fatal)n.continue=!1;n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=s),n.continue??(n.continue=!s._zod.def.abort),r.issues.push(ft.issue(n))}},t(r.value,r)},e);return s}function jf(t,e={error:`Input not instance of ${t.name}`}){let s=new fr({type:"custom",check:"custom",fn:(r)=>r instanceof t,abort:!0,...ft.normalizeParams(e)});return s._zod.bag.Class=t,s}var qf=(...t)=>jd({Pipe:Si,Boolean:lr,String:dr,Transform:pi},...t);function _f(t){let e=Cy(()=>{return vt([q(t),It(),Kt(),mr(),Tt(e),bt(q(),e)])});return e}function fi(t,e){return Ks(mi(t),e)}var Df={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 Bf(t){r0({customError:t})}function Vf(){return r0().customError}var Zy={};le(Zy,{string:()=>Nf,number:()=>wf,date:()=>Of,boolean:()=>Kf,bigint:()=>Hf});function Nf(t){return Y6(dr,t)}function wf(t){return rd(yr,t)}function Kf(t){return yd(lr,t)}function Hf(t){return pd(pr,t)}function Of(t){return Cd(ci,t)}r0(W6());var Uf="io.modelcontextprotocol/related-task",Tr="2.0",Qt=gy((t)=>t!==null&&(typeof t==="object"||typeof t==="function")),Fy=vt([q(),It().int()]),My=q(),sR=a0({ttl:vt([It(),mr()]).optional(),pollInterval:It().optional()}),Gf=J({ttl:It().optional()}),Wf=J({taskId:q()}),Ti=a0({progressToken:Fy.optional(),[Uf]:Wf.optional()}),y0=J({_meta:Ti.optional()}),kr=y0.extend({task:Gf.optional()});var Jt=J({method:q(),params:y0.loose().optional()}),R0=J({_meta:Ti.optional()}),x0=J({method:q(),params:R0.loose().optional()}),Yt=a0({_meta:Ti.optional()}),Rr=vt([q(),It().int()]),zf=J({jsonrpc:tt(Tr),id:Rr,...Jt.shape}).strict();var Qf=J({jsonrpc:tt(Tr),...x0.shape}).strict();var Py=J({jsonrpc:tt(Tr),id:Rr,result:Yt}).strict();var Fh;(function(t){t[t.ConnectionClosed=-32000]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Fh||(Fh={}));var Ly=J({jsonrpc:tt(Tr),id:Rr.optional(),error:J({code:It().int(),message:q(),data:Zt().optional()})}).strict();var rR=vt([zf,Qf,Py,Ly]),nR=vt([Py,Ly]),jy=Yt.strict(),Jf=R0.extend({requestId:Rr.optional(),reason:q().optional()}),qy=x0.extend({method:tt("notifications/cancelled"),params:Jf}),Yf=J({src:q(),mimeType:q().optional(),sizes:Tt(q()).optional(),theme:i0(["light","dark"]).optional()}),Ka=J({icons:Tt(Yf).optional()}),De=J({name:q(),title:q().optional()}),_y=De.extend({...De.shape,...Ka.shape,version:q(),websiteUrl:q().optional(),description:q().optional()}),Xf=Sr(J({applyDefaults:Kt().optional()}),bt(q(),Zt())),$f=fi((t)=>{if(t&&typeof t==="object"&&!Array.isArray(t)){if(Object.keys(t).length===0)return{form:{}}}return t},Sr(J({form:Xf.optional(),url:Qt.optional()}),bt(q(),Zt()).optional())),tT=a0({list:Qt.optional(),cancel:Qt.optional(),requests:a0({sampling:a0({createMessage:Qt.optional()}).optional(),elicitation:a0({create:Qt.optional()}).optional()}).optional()}),eT=a0({list:Qt.optional(),cancel:Qt.optional(),requests:a0({tools:a0({call:Qt.optional()}).optional()}).optional()}),aT=J({experimental:bt(q(),Qt).optional(),sampling:J({context:Qt.optional(),tools:Qt.optional()}).optional(),elicitation:$f.optional(),roots:J({listChanged:Kt().optional()}).optional(),tasks:tT.optional()}),sT=y0.extend({protocolVersion:q(),capabilities:aT,clientInfo:_y}),rT=Jt.extend({method:tt("initialize"),params:sT}),nT=J({experimental:bt(q(),Qt).optional(),logging:Qt.optional(),completions:Qt.optional(),prompts:J({listChanged:Kt().optional()}).optional(),resources:J({subscribe:Kt().optional(),listChanged:Kt().optional()}).optional(),tools:J({listChanged:Kt().optional()}).optional(),tasks:eT.optional()}),iT=Yt.extend({protocolVersion:q(),capabilities:nT,serverInfo:_y,instructions:q().optional()}),hT=x0.extend({method:tt("notifications/initialized"),params:R0.optional()}),Dy=Jt.extend({method:tt("ping"),params:y0.optional()}),oT=J({progress:It(),total:Ft(It()),message:Ft(q())}),cT=J({...R0.shape,...oT.shape,progressToken:Fy}),By=x0.extend({method:tt("notifications/progress"),params:cT}),dT=y0.extend({cursor:My.optional()}),Ha=Jt.extend({params:dT.optional()}),Oa=Yt.extend({nextCursor:My.optional()}),yT=i0(["working","input_required","completed","failed","cancelled"]),Ua=J({taskId:q(),status:yT,ttl:vt([It(),mr()]),createdAt:q(),lastUpdatedAt:q(),pollInterval:Ft(It()),statusMessage:Ft(q())}),Vy=Yt.extend({task:Ua}),lT=R0.merge(Ua),Ny=x0.extend({method:tt("notifications/tasks/status"),params:lT}),wy=Jt.extend({method:tt("tasks/get"),params:y0.extend({taskId:q()})}),Ky=Yt.merge(Ua),Hy=Jt.extend({method:tt("tasks/result"),params:y0.extend({taskId:q()})}),iR=Yt.loose(),Oy=Ha.extend({method:tt("tasks/list")}),Uy=Oa.extend({tasks:Tt(Ua)}),Gy=Jt.extend({method:tt("tasks/cancel"),params:y0.extend({taskId:q()})}),hR=Yt.merge(Ua),Wy=J({uri:q(),mimeType:Ft(q()),_meta:bt(q(),Zt()).optional()}),zy=Wy.extend({text:q()}),ki=q().refine((t)=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Qy=Wy.extend({blob:ki}),Ga=i0(["user","assistant"]),Ue=J({audience:Tt(Ga).optional(),priority:It().min(0).max(1).optional(),lastModified:V3.datetime({offset:!0}).optional()}),Jy=J({...De.shape,...Ka.shape,uri:q(),description:Ft(q()),mimeType:Ft(q()),annotations:Ue.optional(),_meta:Ft(a0({}))}),pT=J({...De.shape,...Ka.shape,uriTemplate:q(),description:Ft(q()),mimeType:Ft(q()),annotations:Ue.optional(),_meta:Ft(a0({}))}),mT=Ha.extend({method:tt("resources/list")}),ET=Oa.extend({resources:Tt(Jy)}),uT=Ha.extend({method:tt("resources/templates/list")}),ST=Oa.extend({resourceTemplates:Tt(pT)}),Ri=y0.extend({uri:q()}),fT=Ri,TT=Jt.extend({method:tt("resources/read"),params:fT}),kT=Yt.extend({contents:Tt(vt([zy,Qy]))}),RT=x0.extend({method:tt("notifications/resources/list_changed"),params:R0.optional()}),xT=Ri,CT=Jt.extend({method:tt("resources/subscribe"),params:xT}),IT=Ri,vT=Jt.extend({method:tt("resources/unsubscribe"),params:IT}),gT=R0.extend({uri:q()}),bT=x0.extend({method:tt("notifications/resources/updated"),params:gT}),AT=J({name:q(),description:Ft(q()),required:Ft(Kt())}),ZT=J({...De.shape,...Ka.shape,description:Ft(q()),arguments:Ft(Tt(AT)),_meta:Ft(a0({}))}),FT=Ha.extend({method:tt("prompts/list")}),MT=Oa.extend({prompts:Tt(ZT)}),PT=y0.extend({name:q(),arguments:bt(q(),q()).optional()}),LT=Jt.extend({method:tt("prompts/get"),params:PT}),xi=J({type:tt("text"),text:q(),annotations:Ue.optional(),_meta:bt(q(),Zt()).optional()}),Ci=J({type:tt("image"),data:ki,mimeType:q(),annotations:Ue.optional(),_meta:bt(q(),Zt()).optional()}),Ii=J({type:tt("audio"),data:ki,mimeType:q(),annotations:Ue.optional(),_meta:bt(q(),Zt()).optional()}),jT=J({type:tt("tool_use"),name:q(),id:q(),input:bt(q(),Zt()),_meta:bt(q(),Zt()).optional()}),qT=J({type:tt("resource"),resource:vt([zy,Qy]),annotations:Ue.optional(),_meta:bt(q(),Zt()).optional()}),_T=Jy.extend({type:tt("resource_link")}),vi=vt([xi,Ci,Ii,_T,qT]),DT=J({role:Ga,content:vi}),BT=Yt.extend({description:q().optional(),messages:Tt(DT)}),VT=x0.extend({method:tt("notifications/prompts/list_changed"),params:R0.optional()}),NT=J({title:q().optional(),readOnlyHint:Kt().optional(),destructiveHint:Kt().optional(),idempotentHint:Kt().optional(),openWorldHint:Kt().optional()}),wT=J({taskSupport:i0(["required","optional","forbidden"]).optional()}),Yy=J({...De.shape,...Ka.shape,description:q().optional(),inputSchema:J({type:tt("object"),properties:bt(q(),Qt).optional(),required:Tt(q()).optional()}).catchall(Zt()),outputSchema:J({type:tt("object"),properties:bt(q(),Qt).optional(),required:Tt(q()).optional()}).catchall(Zt()).optional(),annotations:NT.optional(),execution:wT.optional(),_meta:bt(q(),Zt()).optional()}),KT=Ha.extend({method:tt("tools/list")}),HT=Oa.extend({tools:Tt(Yy)}),Xy=Yt.extend({content:Tt(vi).default([]),structuredContent:bt(q(),Zt()).optional(),isError:Kt().optional()}),oR=Xy.or(Yt.extend({toolResult:Zt()})),OT=kr.extend({name:q(),arguments:bt(q(),Zt()).optional()}),UT=Jt.extend({method:tt("tools/call"),params:OT}),GT=x0.extend({method:tt("notifications/tools/list_changed"),params:R0.optional()}),cR=J({autoRefresh:Kt().default(!0),debounceMs:It().int().nonnegative().default(300)}),$y=i0(["debug","info","notice","warning","error","critical","alert","emergency"]),WT=y0.extend({level:$y}),zT=Jt.extend({method:tt("logging/setLevel"),params:WT}),QT=R0.extend({level:$y,logger:q().optional(),data:Zt()}),JT=x0.extend({method:tt("notifications/message"),params:QT}),YT=J({name:q().optional()}),XT=J({hints:Tt(YT).optional(),costPriority:It().min(0).max(1).optional(),speedPriority:It().min(0).max(1).optional(),intelligencePriority:It().min(0).max(1).optional()}),$T=J({mode:i0(["auto","required","none"]).optional()}),tk=J({type:tt("tool_result"),toolUseId:q().describe("The unique identifier for the corresponding tool call."),content:Tt(vi).default([]),structuredContent:J({}).loose().optional(),isError:Kt().optional(),_meta:bt(q(),Zt()).optional()}),ek=yi("type",[xi,Ci,Ii]),Hs=yi("type",[xi,Ci,Ii,jT,tk]),ak=J({role:Ga,content:vt([Hs,Tt(Hs)]),_meta:bt(q(),Zt()).optional()}),sk=kr.extend({messages:Tt(ak),modelPreferences:XT.optional(),systemPrompt:q().optional(),includeContext:i0(["none","thisServer","allServers"]).optional(),temperature:It().optional(),maxTokens:It().int(),stopSequences:Tt(q()).optional(),metadata:Qt.optional(),tools:Tt(Yy).optional(),toolChoice:$T.optional()}),rk=Jt.extend({method:tt("sampling/createMessage"),params:sk}),nk=Yt.extend({model:q(),stopReason:Ft(i0(["endTurn","stopSequence","maxTokens"]).or(q())),role:Ga,content:ek}),ik=Yt.extend({model:q(),stopReason:Ft(i0(["endTurn","stopSequence","maxTokens","toolUse"]).or(q())),role:Ga,content:vt([Hs,Tt(Hs)])}),hk=J({type:tt("boolean"),title:q().optional(),description:q().optional(),default:Kt().optional()}),ok=J({type:tt("string"),title:q().optional(),description:q().optional(),minLength:It().optional(),maxLength:It().optional(),format:i0(["email","uri","date","date-time"]).optional(),default:q().optional()}),ck=J({type:i0(["number","integer"]),title:q().optional(),description:q().optional(),minimum:It().optional(),maximum:It().optional(),default:It().optional()}),dk=J({type:tt("string"),title:q().optional(),description:q().optional(),enum:Tt(q()),default:q().optional()}),yk=J({type:tt("string"),title:q().optional(),description:q().optional(),oneOf:Tt(J({const:q(),title:q()})),default:q().optional()}),lk=J({type:tt("string"),title:q().optional(),description:q().optional(),enum:Tt(q()),enumNames:Tt(q()).optional(),default:q().optional()}),pk=vt([dk,yk]),mk=J({type:tt("array"),title:q().optional(),description:q().optional(),minItems:It().optional(),maxItems:It().optional(),items:J({type:tt("string"),enum:Tt(q())}),default:Tt(q()).optional()}),Ek=J({type:tt("array"),title:q().optional(),description:q().optional(),minItems:It().optional(),maxItems:It().optional(),items:J({anyOf:Tt(J({const:q(),title:q()}))}),default:Tt(q()).optional()}),uk=vt([mk,Ek]),Sk=vt([lk,pk,uk]),fk=vt([Sk,hk,ok,ck]),Tk=kr.extend({mode:tt("form").optional(),message:q(),requestedSchema:J({type:tt("object"),properties:bt(q(),fk),required:Tt(q()).optional()})}),kk=kr.extend({mode:tt("url"),message:q(),elicitationId:q(),url:q().url()}),Rk=vt([Tk,kk]),xk=Jt.extend({method:tt("elicitation/create"),params:Rk}),Ck=R0.extend({elicitationId:q()}),Ik=x0.extend({method:tt("notifications/elicitation/complete"),params:Ck}),vk=Yt.extend({action:i0(["accept","decline","cancel"]),content:fi((t)=>t===null?void 0:t,bt(q(),vt([q(),It(),Kt(),Tt(q())])).optional())}),gk=J({type:tt("ref/resource"),uri:q()}),bk=J({type:tt("ref/prompt"),name:q()}),Ak=y0.extend({ref:vt([bk,gk]),argument:J({name:q(),value:q()}),context:J({arguments:bt(q(),q()).optional()}).optional()}),Zk=Jt.extend({method:tt("completion/complete"),params:Ak});var Fk=Yt.extend({completion:a0({values:Tt(q()).max(100),total:Ft(It().int()),hasMore:Ft(Kt())})}),Mk=J({uri:q().startsWith("file://"),name:q().optional(),_meta:bt(q(),Zt()).optional()}),Pk=Jt.extend({method:tt("roots/list"),params:y0.optional()}),Lk=Yt.extend({roots:Tt(Mk)}),jk=x0.extend({method:tt("notifications/roots/list_changed"),params:R0.optional()}),dR=vt([Dy,rT,Zk,zT,LT,FT,mT,uT,TT,CT,vT,UT,KT,wy,Hy,Oy,Gy]),yR=vt([qy,By,hT,jk,Ny]),lR=vt([jy,nk,ik,vk,Lk,Ky,Uy,Vy]),pR=vt([Dy,rk,xk,Pk,wy,Hy,Oy,Gy]),mR=vt([qy,By,JT,bT,RT,GT,VT,Ny,Ik]),ER=vt([jy,iT,Fk,BT,MT,ET,ST,kT,Xy,HT,Ky,Uy,Vy]);var uR=Symbol("Let zodToJsonSchema decide on which parser to use");var SR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var fR=jh(wh(),1),TR=jh(y8(),1);var Mh;(function(t){t.Completable="McpCompletable"})(Mh||(Mh={}));function qk(t){let e;return()=>e??=t()}var Ph=15000,_k=qk(()=>ge.object({session_id:ge.string(),ws_url:ge.string(),work_dir:ge.string().optional(),session_key:ge.string().optional()}));class Y0 extends Error{constructor(t){super(t);this.name="DirectConnectError"}}class Dk{options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new bn;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];constructor(t){this.options=t,this.abortController=t.abortController??new AbortController,this.readyPromise=new Promise((e,s)=>{this.readyResolve=e,this.readyReject=s}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new P0("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new P0("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let t;try{let a=await Bk(this.options);this.sessionId=a.sessionId,this.workDir=a.workDir,t=a.wsUrl}catch(a){this.failInit(Wp(a));return}if(this.closed){if(this.options.deleteSessionOnClose&&this.sessionId)Lh(this.options.serverUrl,this.sessionId,this.options.authToken);return}let e={};if(this.options.authToken)e.authorization=`Bearer ${this.options.authToken}`;let s=new WebSocket(t,{headers:e});this.ws=s;let r=setTimeout((a,n)=>{if(!a.readyState){n.close();let i=new Y0(`WebSocket connection timeout after ${Ph}ms`);a.exitError=i,a.readyReject?.(i)}},Ph,this,s);s.addEventListener("open",()=>{clearTimeout(r),this.readyState=!0,E0(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.()}),s.addEventListener("message",(a)=>{let n=typeof a.data==="string"?a.data:"";if(n.indexOf(`
86
+ `)===-1){if(n)this.partialChunks.push(n);return}let i=this.partialChunks.join("")+n;this.partialChunks.length=0;let h=i.split(`
87
+ `),o=h.pop()??"";if(o)this.partialChunks.push(o);for(let c of h){if(!c)continue;let m;try{m=gn(c)}catch(u){E0(`DirectConnect: dropped malformed JSON line (${c.length} bytes): ${u}`);continue}this.messages.enqueue(m)}}),s.addEventListener("error",()=>{clearTimeout(r);let a=new Y0("WebSocket connection error");this.exitError=a,this.readyReject?.(a),this.messages.done()}),s.addEventListener("close",(a)=>{if(this.readyState=!1,this.closed=!0,a.code!==1000&&a.code!==1001&&!this.exitError)this.exitError=new Y0(`WebSocket closed abnormally: ${a.code} ${a.reason}`);this.messages.done()})}failInit(t){this.exitError=t,this.closed=!0,this.readyReject?.(t),this.messages.done()}async write(t){if(this.abortController.signal.aborted)throw new P0("Operation aborted");if(!this.readyState)await this.readyPromise;if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Y0("Transport is not ready for writing");this.ws.send(t)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}close(){if(this.closed)return;if(this.closed=!0,this.readyState=!1,this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;if(!this.abortController.signal.aborted)this.abortController.abort();if(this.ws&&this.ws.readyState===WebSocket.OPEN)this.ws.close(1000,"Normal closure");if(this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId)Lh(this.options.serverUrl,this.sessionId,this.options.authToken)}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}async function Bk(t){let e={"content-type":"application/json"};if(t.authToken)e.authorization=`Bearer ${t.authToken}`;let s={};if(t.cwd)s.cwd=t.cwd;if(t.sessionKey)s.session_key=t.sessionKey;if(t.permissionMode)s.permission_mode=t.permissionMode;let r;try{r=await fetch(`${t.serverUrl}/sessions`,{method:"POST",headers:e,body:u0(s)})}catch(n){throw new Y0(`Failed to connect to server at ${t.serverUrl}: ${n instanceof Error?n.message:String(n)}`)}if(!r.ok){let n=await r.text().catch(()=>"");throw new Y0(`Failed to create session: ${r.status} ${r.statusText}${n?` — ${n}`:""}`)}let a=_k().safeParse(await r.json());if(!a.success)throw new Y0(`Invalid session response: ${a.error.message}`);return{sessionId:a.data.session_id,wsUrl:a.data.ws_url,workDir:a.data.work_dir}}async function Lh(t,e,s){let r={};if(s)r.authorization=`Bearer ${s}`;try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:r})}catch{}}function Vk(t,e){let{systemPrompt:s,settings:r,settingSources:a,sandbox:n,...i}=t??{},h,o;if(s===void 0)h="";else if(typeof s==="string")h=s;else if(s.type==="preset")o=s.append;let c=i.pathToClaudeCodeExecutable;if(!c){let M0=p8(import.meta.url),I0=l8(M0),We=wm((Wa)=>I0.resolve(Wa));if(We)c=We;else try{c=I0.resolve("./cli.js")}catch{throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`)}}process.env.CLAUDE_AGENT_SDK_VERSION="0.2.96";let{abortController:m=Kh(),additionalDirectories:u=[],agent:p,agents:k,allowedTools:C=[],betas:I,canUseTool:R,continue:d,cwd:E,debug:y,debugFile:l,disallowedTools:T=[],tools:f,env:x,executable:v=Hh()?"bun":"node",executableArgs:F=[],extraArgs:B={},fallbackModel:_,enableFileCheckpointing:N,toolConfig:O,forkSession:z,hooks:K,includeHookEvents:Mt,includePartialMessages:Ht,onElicitation:Ot,persistSession:St,thinking:A,effort:L,maxThinkingTokens:V,maxTurns:S,maxBudgetUsd:b,taskBudget:P,mcpServers:X,model:at,outputFormat:ut,permissionMode:rt="default",allowDangerouslySkipPermissions:Pt=!1,permissionPromptToolName:C0,plugins:g,workload:j,resume:D,resumeSessionAt:et,sessionId:st,stderr:lt,strictMcpConfig:Gt}=i,Xt=ut?.type==="json_schema"?ut.schema:void 0,Ut=x;if(!Ut)Ut={...process.env};if(!Ut.CLAUDE_CODE_ENTRYPOINT)Ut.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(N)Ut.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(O?.askUserQuestion?.previewFormat)Ut.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=O.askUserQuestion.previewFormat;let Wt={},Vt=new Map;if(X)for(let[M0,I0]of Object.entries(X))if(I0.type==="sdk"&&I0.instance)Vt.set(M0,I0.instance);else Wt[M0]=I0;let l0;if(A)switch(A.type){case"adaptive":l0={type:"adaptive",display:A.display};break;case"enabled":l0={type:"enabled",budgetTokens:A.budgetTokens,display:A.display};break;case"disabled":l0={type:"disabled"};break}else if(V!==void 0)l0=V===0?{type:"disabled"}:{type:"enabled",budgetTokens:V};let t0=new go({abortController:m,additionalDirectories:u,agent:p,betas:I,cwd:E,debug:y,debugFile:l,executable:v,executableArgs:F,extraArgs:j?{...B,workload:j}:B,pathToClaudeCodeExecutable:c,env:Ut,forkSession:z,stderr:lt,thinkingConfig:l0,effort:L,maxTurns:S,maxBudgetUsd:b,taskBudget:P,model:at,fallbackModel:_,jsonSchema:Xt,permissionMode:rt,allowDangerouslySkipPermissions:Pt,permissionPromptToolName:C0,continueConversation:d,resume:D,resumeSessionAt:et,sessionId:st,settings:typeof r==="object"?u0(r):r,settingSources:a,allowedTools:C,disallowedTools:T,tools:f,mcpServers:Wt,strictMcpConfig:Gt,canUseTool:!!R,hooks:!!K,includeHookEvents:Mt,includePartialMessages:Ht,persistSession:St,plugins:g,sandbox:n,spawnClaudeCodeProcess:i.spawnClaudeCodeProcess}),Ge={systemPrompt:h,appendSystemPrompt:o,agents:k,promptSuggestions:i.promptSuggestions,agentProgressSummaries:i.agentProgressSummaries};return{queryInstance:new Ao(t0,e,R,K,m,Vt,Xt,Ge,Ot),transport:t0,abortController:m}}function Nk(t,e,s,r){if(typeof s==="string")e.write(u0({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:s}]},parent_tool_use_id:null})+`
88
+ `);else t.streamInput(s).catch((a)=>r.abort(a))}function t4({prompt:t,options:e}){let{queryInstance:s,transport:r,abortController:a}=Vk(e,typeof t==="string");return Nk(s,r,t,a),s}import{EventEmitter as wk}from"events";import{hostname as e4}from"os";class gi extends wk{url;alias;token;agent;resumeId;heartbeatInterval;reconnectDelay;heartbeatTimer;sseAbort;running=!1;constructor(t){super();if(this.url=t.url.replace(/\/$/,""),this.alias=t.alias,this.token=t.token,this.agent=t.agent||"sdk",this.resumeId=`sdk-${t.alias}-${Date.now().toString(36)}`,this.heartbeatInterval=t.heartbeatInterval??180000,this.reconnectDelay=t.reconnectDelay??3000,t.autoConnect!==!1)this.connect()}log(t){console.log(`[${new Date().toTimeString().slice(0,8)}] [commhub:${this.alias}] ${t}`)}async call(t,e){let s={"Content-Type":"application/json"};if(this.token)s.Authorization=`Bearer ${this.token}`;let r=await(await fetch(`${this.url}/mcp`,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:t,arguments:e}})})).json(),a=r?.result?.content?.[0]?.text;return a?JSON.parse(a):r}async connect(){if(this.running)return;this.running=!0,await this.status("idle"),this.log("registered"),this.heartbeatTimer=setInterval(()=>{this.status("idle").catch((t)=>this.log(`heartbeat failed: ${t.message}`))},this.heartbeatInterval),this.connectSSE()}async disconnect(){if(this.running=!1,this.sseAbort?.abort(),this.heartbeatTimer)clearInterval(this.heartbeatTimer);await this.status("offline").catch(()=>{}),this.log("disconnected")}async send(t,e,s="normal"){return this.call("send_task",{alias:t,task:e,priority:s,from_session:this.alias})}async message(t,e){return this.call("send_message",{alias:t,message:e,from_session:this.alias})}async reply(t,e,s="completed"){return this.call("reply",{task_id:t,text:e,status:s})}async status(t,e){return this.call("report_status",{resume_id:this.resumeId,alias:this.alias,status:t,server:e4(),hostname:e4(),agent:this.agent,project_dir:process.cwd(),...e})}async getAllStatus(){return this.call("get_all_status",{})}async broadcast(t,e){return this.call("broadcast",{message:t,filter_server:e?.server,filter_status:e?.status})}async connectSSE(){let t=encodeURIComponent(this.alias),e=`${this.url}/events/${t}`,s=this.reconnectDelay;while(this.running){try{this.sseAbort=new AbortController;let r={Accept:"text/event-stream"};if(this.token)r.Authorization=`Bearer ${this.token}`;let a=await fetch(e,{headers:r,signal:this.sseAbort.signal});if(!a.ok||!a.body){this.log(`SSE failed: ${a.status}`),await this.sleep(s),s=Math.min(s*1.5,60000);continue}s=this.reconnectDelay;let n=a.body.getReader(),i=new TextDecoder,h="";while(this.running){let{done:o,value:c}=await n.read();if(o)break;h+=i.decode(c,{stream:!0});let m=h.split(`
89
+ `);h=m.pop()||"";for(let u of m){if(!u.startsWith("data: "))continue;try{let p=JSON.parse(u.slice(6));if(p.type==="connected"){this.log("SSE connected"),this.emit("connected");continue}if(p.type==="new_task"||p.type==="new_message"||p.type==="broadcast")await this.processInbox()}catch{}}}}catch(r){if(r.name==="AbortError")break;this.emit("error",r),this.log(`SSE error: ${r.message}`)}if(this.running)this.emit("disconnected"),this.log(`SSE reconnecting in ${s/1000}s...`),await this.sleep(s),s=Math.min(s*1.5,60000)}}async processInbox(){try{let t=(await this.call("get_inbox",{alias:this.alias,limit:10}))?.messages||[];for(let e of t)await this.call("ack_inbox",{alias:this.alias,message_id:e.id}),this.log(`← ${e.from_session}: ${e.content.slice(0,60)}`),this.emit("task",e),this.emit("message",e)}catch(t){this.log(`inbox error: ${t.message}`)}}sleep(t){return new Promise((e)=>setTimeout(e,t))}}class xr{config;hub;running=!1;sessionId;log;constructor(t){this.config={model:"claude-sonnet-4-6",tools:[],maxTurns:5,heartbeatInterval:180000,runtime:"claude",...t},this.hub=new gi({url:t.hub,alias:t.alias,token:t.token,agent:"agent-node",heartbeatInterval:this.config.heartbeatInterval,autoConnect:!1}),this.log=t.log||((e)=>console.log(`[${new Date().toTimeString().slice(0,8)}] [${t.alias}] ${e}`))}async processTask(t){if(this.config.onTask){let a=await this.config.onTask(t);if(typeof a==="string")return a}if(this.config.runtime==="codex")return`[codex runtime 暂未实现] 收到: ${t.content.slice(0,100)}`;let e=`你是 ${this.config.alias},收到来自 ${t.from_session} 的任务:
89
90
 
90
- ${E.content}
91
+ ${t.content}
91
92
 
92
- 执行完后简要汇报结果。`,p={model:this.config.model,tools:this.config.tools?.length?this.config.tools:[],maxTurns:this.config.maxTurns,permissionMode:"bypassPermissions",allowDangerouslySkipPermissions:!0};if(this.config.systemPrompt)p.systemPrompt=this.config.systemPrompt;if(this.sessionId)p.resume=this.sessionId;let h="";try{for await(let d of Xr({prompt:y,options:p})){if(d.type==="system"&&d.subtype==="init")this.sessionId=d.session_id;if(d.type==="result")h=d.subtype==="success"?d.result:`错误: ${d.result||d.error}`}}catch(d){h=`SDK 错误: ${d.message}`,this.log(`错误: ${d.message}`)}if(this.config.onResult)await this.config.onResult(E,h);return h}async processInbox(){let E=await this.client.getInbox();if(!E?.messages?.length)return;for(let y of E.messages){let p=y.from_session||"hub";this.log(`← [${p}] ${y.content?.slice(0,60)}`),await this.client.ack(y.id),await this.client.report("working",{task:y.content?.slice(0,50)});let h=await this.processTask(y);this.log(`→ [${p}] ${h?.slice(0,60)}`),await this.client.send(p,`[${this.config.alias}] ${h?.slice(0,2000)}`),await this.client.report("idle")}}async connectSSE(){let E=this.client.sseUrl(),y=3000;while(this.running){try{let p=await fetch(E,{headers:{Accept:"text/event-stream"}});if(!p.ok||!p.body){await this.sleep(y),y=Math.min(y*1.5,60000);continue}y=3000;let h=p.body.getReader(),d=new TextDecoder,S="";while(this.running){let{done:c,value:n}=await h.read();if(c)break;S+=d.decode(n,{stream:!0});let r=S.split(`
93
- `);S=r.pop()||"";for(let T of r){if(!T.startsWith("data: "))continue;try{let k=JSON.parse(T.slice(6));if(k.type==="connected"){this.log("SSE 已连接");continue}if(["new_task","new_message","broadcast"].includes(k.type))await this.processInbox()}catch{}}}}catch(p){if(p.name==="AbortError")break;this.log(`SSE 错误: ${p.message}`)}if(this.running)this.log(`SSE 重连 (${y/1000}s)...`),await this.sleep(y),y=Math.min(y*1.5,60000)}}sleep(E){return new Promise((y)=>setTimeout(y,E))}async start(){this.running=!0,this.log(`启动 | Hub: ${this.config.hub} | Model: ${this.config.model}`),await this.client.report("idle",{task:"待命"}),this.log("已注册到 CommHub");let E=setInterval(()=>{this.client.report("idle").catch(()=>{})},this.config.heartbeatInterval),y=async()=>{this.log("退出..."),this.running=!1,clearInterval(E),await this.client.report("offline").catch(()=>{}),process.exit(0)};process.on("SIGINT",y),process.on("SIGTERM",y),await this.connectSSE()}async stop(){this.running=!1,await this.client.report("offline").catch(()=>{}),this.log("已停止")}}var Zt=ZE;import{readFileSync as wI,existsSync as KI}from"fs";import{join as HI}from"path";var o6=process.argv.slice(2),G3={};for(let E=0;E<o6.length;E++)if(o6[E].startsWith("--")&&E+1<o6.length)G3[o6[E].slice(2)]=o6[++E];else if(o6[E]==="-h"||o6[E]==="--help")console.log(`
93
+ 执行完后简要汇报结果。`,s={model:this.config.model,tools:this.config.tools?.length?this.config.tools:[],maxTurns:this.config.maxTurns,permissionMode:"bypassPermissions",allowDangerouslySkipPermissions:!0};if(this.config.systemPrompt)s.systemPrompt=this.config.systemPrompt;if(this.sessionId)s.resume=this.sessionId;let r="";try{for await(let a of t4({prompt:e,options:s})){if(a.type==="system"&&a.subtype==="init")this.sessionId=a.session_id;if(a.type==="result")r=a.subtype==="success"?a.result:`错误: ${a.result||a.error}`}}catch(a){r=`SDK 错误: ${a.message}`,this.log(`错误: ${a.message}`)}if(this.config.onResult)await this.config.onResult(t,r);return r}async start(){this.running=!0,this.log(`启动 | Hub: ${this.config.hub} | Model: ${this.config.model} | Runtime: ${this.config.runtime}`),await this.hub.connect(),this.log("已连接 CommHub"),this.hub.on("task",async(e)=>{let s=e.from_session||"hub";this.log(`← [${s}] ${e.content?.slice(0,60)}`),await this.hub.status("working",{task:e.content?.slice(0,50)});let r=await this.processTask(e);this.log(`→ [${s}] ${r?.slice(0,60)}`),await this.hub.send(s,`[${this.config.alias}] ${r?.slice(0,2000)}`),await this.hub.status("idle")});let t=async()=>{this.log("退出..."),this.running=!1,await this.hub.disconnect(),process.exit(0)};process.on("SIGINT",t),process.on("SIGTERM",t),await new Promise(()=>{})}async stop(){this.running=!1,await this.hub.disconnect(),this.log("已停止")}}var bR=xr;import{readFileSync as Kk,existsSync as Hk}from"fs";import{join as Ok}from"path";var Se=process.argv.slice(2),B0={};for(let t=0;t<Se.length;t++)if(Se[t].startsWith("--")&&t+1<Se.length)B0[Se[t].slice(2)]=Se[++t];else if(Se[t]==="-h"||Se[t]==="--help")console.log(`
94
94
  @sleep2agi/agent-node — AI Agent 节点,一行命令加入 CommHub 网络
95
95
 
96
96
  用法:
@@ -100,6 +100,7 @@ ${E.content}
100
100
  --alias <name> Agent 别名 (必需)
101
101
  --hub <url> CommHub Server URL (default: http://127.0.0.1:9200)
102
102
  --model <name> AI 模型 (default: claude-sonnet-4-6)
103
+ --runtime <type> 运行时: claude (default) | codex
103
104
  --tools <list> 可用工具,逗号分隔 (default: 无)
104
105
  --max-turns <n> 每任务最大轮次 (default: 5)
105
106
  --prompt <text> 自定义 System Prompt
@@ -124,5 +125,5 @@ ${E.content}
124
125
  # Claude Agent
125
126
  ANTHROPIC_API_KEY=sk-xxx \\
126
127
  npx @sleep2agi/agent-node --alias "Claude马" --model claude-sonnet-4-6
127
- `),process.exit(0);var OI=G3.config||".agent-node.json",U3={},Ap=HI(process.cwd(),OI);if(KI(Ap))try{U3=JSON.parse(wI(Ap,"utf-8")),console.log(`[agent-node] 加载配置: ${Ap}`)}catch(E){console.error(`[agent-node] 配置文件解析失败: ${E.message}`)}var yT=G3.alias||process.env.ALIAS||U3.alias;if(!yT)console.error(`错误: 必须指定 --alias
128
- 用法: npx @sleep2agi/agent-node --alias "我的Agent"`),process.exit(1);var UI={alias:yT,hub:G3.hub||process.env.COMMHUB_URL||U3.hub||"http://127.0.0.1:9200",model:G3.model||process.env.MODEL||U3.model||"claude-sonnet-4-6",tools:(G3.tools||U3.tools||"").split(",").filter(Boolean),maxTurns:parseInt(G3["max-turns"]||U3.maxTurns||"5"),systemPrompt:G3.prompt||U3.systemPrompt||"",token:G3.token||process.env.COMMHUB_TOKEN||U3.token,heartbeatInterval:parseInt(U3.heartbeatInterval||"180000")},GI=new ZE(UI);GI.start().catch((E)=>{console.error(`[agent-node] 启动失败: ${E.message}`),process.exit(1)});
128
+ `),process.exit(0);var Uk=B0.config||".agent-node.json",D0={},bi=Ok(process.cwd(),Uk);if(Hk(bi))try{D0=JSON.parse(Kk(bi,"utf-8")),console.log(`[agent-node] 加载配置: ${bi}`)}catch(t){console.error(`[agent-node] 配置文件解析失败: ${t.message}`)}var a4=B0.alias||process.env.ALIAS||D0.alias;if(!a4)console.error(`错误: 必须指定 --alias
129
+ 用法: npx @sleep2agi/agent-node --alias "我的Agent"`),process.exit(1);var Gk=B0.runtime||process.env.RUNTIME||D0.runtime||"claude",Wk={alias:a4,hub:B0.hub||process.env.COMMHUB_URL||D0.hub||"http://127.0.0.1:9200",model:B0.model||process.env.MODEL||D0.model||"claude-sonnet-4-6",runtime:Gk,tools:(B0.tools||D0.tools||"").split(",").filter(Boolean),maxTurns:parseInt(B0["max-turns"]||D0.maxTurns||"5"),systemPrompt:B0.prompt||D0.systemPrompt||"",token:B0.token||process.env.COMMHUB_TOKEN||D0.token,heartbeatInterval:parseInt(D0.heartbeatInterval||"180000")},zk=new xr(Wk);zk.start().catch((t)=>{console.error(`[agent-node] 启动失败: ${t.message}`),process.exit(1)});