@sleep2agi/agent-node 0.1.1 → 0.3.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 p8}from"module";import{fileURLToPath as l8}from"url";import{setMaxListeners as S8}from"events";import{spawn as k8}from"child_process";import{createInterface as f8}from"readline";import{homedir as nu}from"os";import{join as iu}from"path";import{randomUUID as Xu}from"crypto";import{appendFile as $u,mkdir as tE}from"fs/promises";import{join as oh}from"path";import{realpathSync as yh}from"fs";import{cwd as aE}from"process";import{randomUUID as fc}from"crypto";import{appendFile as cE,mkdir as dE,symlink as oE,unlink as yE}from"fs/promises";import{dirname as xc,join as Ic}from"path";import*as ct from"fs";import{mkdir as TE,open as kE,readdir as fE,readFile as uh,rename as RE,rmdir as xE,rm as IE,stat as vE,unlink as CE}from"fs/promises";import{execFile as UE}from"child_process";import{promisify as GE}from"util";var hy=Object.create,{getPrototypeOf:cy,defineProperty:B3,getOwnPropertyNames:dy}=Object,oy=Object.prototype.hasOwnProperty;function yy(t){return this[t]}var my,uy,Dh=(t,e,s)=>{var r=t!=null&&typeof t==="object";if(r){var a=e?my??=new WeakMap:uy??=new WeakMap,n=a.get(t);if(n)return n}s=t!=null?hy(cy(t)):{};let i=e||!t||!t.__esModule?B3(s,"default",{value:t,enumerable:!0}):s;for(let h of dy(t))if(!oy.call(i,h))B3(i,h,{get:yy.bind(t,h),enumerable:!0});if(r)a.set(t,i);return i},W=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ey=(t)=>t;function py(t,e){this[t]=Ey.bind(null,e)}var me=(t,e)=>{for(var s in e)B3(t,s,{get:e[s],enumerable:!0,configurable:!0,set:py.bind(e,s)})},ly=Symbol.dispose||Symbol.for("Symbol.dispose"),Sy=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[Sy];if(r===void 0)r=e[ly];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,c,d){return d=Error(c),d.name="SuppressedError",d.error=i,d.suppressed=h,d},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,(c)=>(a(c),n()))}catch(c){a(c)}if(s)throw e};return n()},ks=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(o){super();if(!t.IDENTIFIER.test(o))throw Error("CodeGen: name must be a valid identifier");this.str=o}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=s;class r extends e{constructor(o){super();this._items=typeof o==="string"?[o]:o}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let o=this._items[0];return o===""||o==='""'}get str(){var o;return(o=this._str)!==null&&o!==void 0?o:this._str=this._items.reduce((p,y)=>`${p}${y}`,"")}get names(){var o;return(o=this._names)!==null&&o!==void 0?o:this._names=this._items.reduce((p,y)=>{if(y instanceof s)p[y.str]=(p[y.str]||0)+1;return p},{})}}t._Code=r,t.nil=new r("");function a(o,...p){let y=[o[0]],m=0;while(m<p.length)h(y,p[m]),y.push(o[++m]);return new r(y)}t._=a;var n=new r("+");function i(o,...p){let y=[f(o[0])],m=0;while(m<p.length)y.push(n),h(y,p[m]),y.push(n,f(o[++m]));return c(y),new r(y)}t.str=i;function h(o,p){if(p instanceof r)o.push(...p._items);else if(p instanceof s)o.push(p);else o.push(l(p))}t.addCodeArg=h;function c(o){let p=1;while(p<o.length-1){if(o[p]===n){let y=d(o[p-1],o[p+1]);if(y!==void 0){o.splice(p-1,3,y);continue}o[p++]="+"}p++}}function d(o,p){if(p==='""')return o;if(o==='""')return p;if(typeof o=="string"){if(p instanceof s||o[o.length-1]!=='"')return;if(typeof p!="string")return`${o.slice(0,-1)}${p}"`;if(p[0]==='"')return o.slice(0,-1)+p.slice(1);return}if(typeof p=="string"&&p[0]==='"'&&!(o instanceof s))return`"${o}${p.slice(1)}`;return}function E(o,p){return p.emptyStr()?o:o.emptyStr()?p:i`${o}${p}`}t.strConcat=E;function l(o){return typeof o=="number"||typeof o=="boolean"||o===null?o:f(Array.isArray(o)?o.join(","):o)}function u(o){return new r(f(o))}t.stringify=u;function f(o){return JSON.stringify(o).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=f;function I(o){return typeof o=="string"&&t.IDENTIFIER.test(o)?new r(`.${o}`):a`[${o}]`}t.getProperty=I;function v(o){if(typeof o=="string"&&t.IDENTIFIER.test(o))return new r(`${o}`);throw Error(`CodeGen: invalid export name: ${o}, use explicit $id name mapping`)}t.getEsmExportName=v;function R(o){return new r(o.toString())}t.regexpCode=R}),Mi=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=ks();class s extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`);this.value=c.value}}var r;(function(c){c[c.Started=0]="Started",c[c.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:c,parent:d}={}){this._names={},this._prefixes=c,this._parent=d}toName(c){return c instanceof e.Name?c:this.name(c)}name(c){return new e.Name(this._newName(c))}_newName(c){let d=this._names[c]||this._nameGroup(c);return`${c}${d.index++}`}_nameGroup(c){var d,E;if(((E=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||E===void 0?void 0:E.has(c))||this._prefixes&&!this._prefixes.has(c))throw Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}t.Scope=a;class n extends e.Name{constructor(c,d){super(d);this.prefix=c}setValue(c,{property:d,itemIndex:E}){this.value=c,this.scopePath=e._`.${new e.Name(d)}[${E}]`}}t.ValueScopeName=n;var i=e._`\n`;class h extends a{constructor(c){super(c);this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?i:e.nil}}get(){return this._scope}name(c){return new n(c,this._newName(c))}value(c,d){var E;if(d.ref===void 0)throw Error("CodeGen: ref must be passed in value");let l=this.toName(c),{prefix:u}=l,f=(E=d.key)!==null&&E!==void 0?E:d.ref,I=this._values[u];if(I){let o=I.get(f);if(o)return o}else I=this._values[u]=new Map;I.set(f,l);let v=this._scope[u]||(this._scope[u]=[]),R=v.length;return v[R]=d.ref,l.setValue(d,{property:u,itemIndex:R}),l}getValue(c,d){let E=this._values[c];if(!E)return;return E.get(d)}scopeRefs(c,d=this._values){return this._reduceValues(d,(E)=>{if(E.scopePath===void 0)throw Error(`CodeGen: name "${E}" has no value`);return e._`${c}${E.scopePath}`})}scopeCode(c=this._values,d,E){return this._reduceValues(c,(l)=>{if(l.value===void 0)throw Error(`CodeGen: name "${l}" has no value`);return l.value.code},d,E)}_reduceValues(c,d,E={},l){let u=e.nil;for(let f in c){let I=c[f];if(!I)continue;let v=E[f]=E[f]||new Map;I.forEach((R)=>{if(v.has(R))return;v.set(R,r.Started);let o=d(R);if(o){let p=this.opts.es5?t.varKinds.var:t.varKinds.const;u=e._`${u}${p} ${R} = ${o};${this.opts._n}`}else if(o=l===null||l===void 0?void 0:l(R))u=e._`${u}${o}${this.opts._n}`;else throw new s(R);v.set(R,r.Completed)})}return u}}t.ValueScope=h}),ut=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=ks(),s=Mi(),r=ks();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=Mi();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 c 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 d extends n{constructor(S){super();this.label=S,this.names={}}render({_n:S}){return`${this.label}:`+S}}class E extends n{constructor(S){super();this.label=S,this.names={}}render({_n:S}){return`break${this.label?` ${this.label}`:""};`+S}}class l extends n{constructor(S){super();this.error=S}render({_n:S}){return`throw ${this.error};`+S}get names(){return this.error.names}}class u 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 f 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 I extends f{render(S){return"{"+S._n+super.render(S)+"}"+S._n}}class v extends f{}class R extends I{}R.kind="else";class o extends I{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 o?b:b.nodes;if(this.nodes.length)return this;return new o(Mt(S),b instanceof o?[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}}o.kind="if";class p extends I{}p.kind="for";class y extends p{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 m extends p{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 k extends p{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 T extends I{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)}}T.kind="func";class x extends f{render(S){return"return "+super.render(S)}}x.kind="return";class C extends I{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 I{constructor(S){super();this.error=S}render(S){return`catch(${this.error})`+super.render(S)}}F.kind="catch";class B extends I{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 v]}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 c(S,t.operators.ADD,b))}code(S){if(typeof S=="function")S();else if(S!==e.nil)this._leafNode(new u(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 o(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 o(S))}else(){return this._elseNode(new R)}endIf(){return this._endBlockNode(o,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 lt=this._scope.toName(S);return this._for(new m(at,lt,b,P),()=>X(lt))}forOf(S,b,P,X=s.varKinds.const){let at=this._scope.toName(S);if(this.opts.es5){let lt=b instanceof e.Name?b:this.var("_arr",b);return this.forRange("_i",0,e._`${lt}.length`,(rt)=>{this.var(at,e._`${lt}[${rt}]`),P(at)})}return this._for(new k("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 k("in",X,at,b),()=>P(at))}endFor(){return this._endBlockNode(p)}label(S){return this._leafNode(new d(S))}break(S){return this._leafNode(new E(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 C;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 l(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 T(S,b,P)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(T)}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 o))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((lt,rt)=>{if(rt instanceof e.Name)rt=X(rt);if(rt instanceof e._Code)lt.push(...rt._items);else lt.push(rt);return lt},[]));function X(lt){let rt=P[lt.str];if(rt===void 0||b[lt.str]!==1)return lt;return delete b[lt.str],rt}function at(lt){return lt instanceof e._Code&&lt._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 Ot=L(t.operators.AND);function Ut(...S){return S.reduce(Ot)}t.and=Ut;var St=L(t.operators.OR);function Z(...S){return S.reduce(St)}t.or=Z;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=ut(),s=ks();function r(T){let x={};for(let C of T)x[C]=!0;return x}t.toHash=r;function a(T,x){if(typeof x=="boolean")return x;if(Object.keys(x).length===0)return!0;return n(T,x),!i(x,T.self.RULES.all)}t.alwaysValidSchema=a;function n(T,x=T.schema){let{opts:C,self:F}=T;if(!C.strictSchema)return;if(typeof x==="boolean")return;let B=F.RULES.keywords;for(let _ in x)if(!B[_])k(T,`unknown keyword: "${_}"`)}t.checkUnknownRules=n;function i(T,x){if(typeof T=="boolean")return!T;for(let C in T)if(x[C])return!0;return!1}t.schemaHasRules=i;function h(T,x){if(typeof T=="boolean")return!T;for(let C in T)if(C!=="$ref"&&x.all[C])return!0;return!1}t.schemaHasRulesButRef=h;function c({topSchemaRef:T,schemaPath:x},C,F,B){if(!B){if(typeof C=="number"||typeof C=="boolean")return C;if(typeof C=="string")return e._`${C}`}return e._`${T}${x}${(0,e.getProperty)(F)}`}t.schemaRefOrVal=c;function d(T){return u(decodeURIComponent(T))}t.unescapeFragment=d;function E(T){return encodeURIComponent(l(T))}t.escapeFragment=E;function l(T){if(typeof T=="number")return`${T}`;return T.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=l;function u(T){return T.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=u;function f(T,x){if(Array.isArray(T))for(let C of T)x(C);else x(T)}t.eachItem=f;function I({mergeNames:T,mergeToName:x,mergeValues:C,resultToName:F}){return(B,_,N,O)=>{let z=N===void 0?_:N instanceof e.Name?(_ instanceof e.Name?T(B,_,N):x(B,_,N),N):_ instanceof e.Name?(x(B,N,_),_):C(_,N);return O===e.Name&&!(z instanceof e.Name)?F(B,z):z}}t.mergeEvaluated={props:I({mergeNames:(T,x,C)=>T.if(e._`${C} !== true && ${x} !== undefined`,()=>{T.if(e._`${x} === true`,()=>T.assign(C,!0),()=>T.assign(C,e._`${C} || {}`).code(e._`Object.assign(${C}, ${x})`))}),mergeToName:(T,x,C)=>T.if(e._`${C} !== true`,()=>{if(x===!0)T.assign(C,!0);else T.assign(C,e._`${C} || {}`),R(T,C,x)}),mergeValues:(T,x)=>T===!0?!0:{...T,...x},resultToName:v}),items:I({mergeNames:(T,x,C)=>T.if(e._`${C} !== true && ${x} !== undefined`,()=>T.assign(C,e._`${x} === true ? true : ${C} > ${x} ? ${C} : ${x}`)),mergeToName:(T,x,C)=>T.if(e._`${C} !== true`,()=>T.assign(C,x===!0?!0:e._`${C} > ${x} ? ${C} : ${x}`)),mergeValues:(T,x)=>T===!0?!0:Math.max(T,x),resultToName:(T,x)=>T.var("items",x)})};function v(T,x){if(x===!0)return T.var("props",!0);let C=T.var("props",e._`{}`);if(x!==void 0)R(T,C,x);return C}t.evaluatedPropsToName=v;function R(T,x,C){Object.keys(C).forEach((F)=>T.assign(e._`${x}${(0,e.getProperty)(F)}`,!0))}t.setEvaluated=R;var o={};function p(T,x){return T.scopeValue("func",{ref:x,code:o[x.code]||(o[x.code]=new s._Code(x.code))})}t.useFunc=p;var y;(function(T){T[T.Num=0]="Num",T[T.Str=1]="Str"})(y||(t.Type=y={}));function m(T,x,C){if(T instanceof e.Name){let F=x===y.Num;return C?F?e._`"[" + ${T} + "]"`:e._`"['" + ${T} + "']"`:F?e._`"/" + ${T}`:e._`"/" + ${T}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return C?(0,e.getProperty)(T).toString():"/"+l(T)}t.getErrorPath=m;function k(T,x,C=T.opts.strictSchema){if(!C)return;if(x=`strict mode: ${x}`,C===!0)throw Error(x);T.self.logger.warn(x)}t.checkStrictMode=k}),$0=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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}),Us=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=ut(),s=xt(),r=$0();t.keywordError={message:({keyword:R})=>e.str`must pass "${R}" keyword validation`},t.keyword$DataError={message:({keyword:R,schemaType:o})=>o?e.str`"${R}" keyword must be ${o} ($data)`:e.str`"${R}" keyword is invalid ($data)`};function a(R,o=t.keywordError,p,y){let{it:m}=R,{gen:k,compositeRule:T,allErrors:x}=m,C=l(R,o,p);if(y!==null&&y!==void 0?y:T||x)c(k,C);else d(m,e._`[${C}]`)}t.reportError=a;function n(R,o=t.keywordError,p){let{it:y}=R,{gen:m,compositeRule:k,allErrors:T}=y,x=l(R,o,p);if(c(m,x),!(k||T))d(y,r.default.vErrors)}t.reportExtraError=n;function i(R,o){R.assign(r.default.errors,o),R.if(e._`${r.default.vErrors} !== null`,()=>R.if(o,()=>R.assign(e._`${r.default.vErrors}.length`,o),()=>R.assign(r.default.vErrors,null)))}t.resetErrorsCount=i;function h({gen:R,keyword:o,schemaValue:p,data:y,errsCount:m,it:k}){if(m===void 0)throw Error("ajv implementation error");let T=R.name("err");R.forRange("i",m,r.default.errors,(x)=>{if(R.const(T,e._`${r.default.vErrors}[${x}]`),R.if(e._`${T}.instancePath === undefined`,()=>R.assign(e._`${T}.instancePath`,(0,e.strConcat)(r.default.instancePath,k.errorPath))),R.assign(e._`${T}.schemaPath`,e.str`${k.errSchemaPath}/${o}`),k.opts.verbose)R.assign(e._`${T}.schema`,p),R.assign(e._`${T}.data`,y)})}t.extendErrors=h;function c(R,o){let p=R.const("err",o);R.if(e._`${r.default.vErrors} === null`,()=>R.assign(r.default.vErrors,e._`[${p}]`),e._`${r.default.vErrors}.push(${p})`),R.code(e._`${r.default.errors}++`)}function d(R,o){let{gen:p,validateName:y,schemaEnv:m}=R;if(m.$async)p.throw(e._`new ${R.ValidationError}(${o})`);else p.assign(e._`${y}.errors`,o),p.return(!1)}var E={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 l(R,o,p){let{createErrors:y}=R.it;if(y===!1)return e._`{}`;return u(R,o,p)}function u(R,o,p={}){let{gen:y,it:m}=R,k=[f(m,p),I(R,p)];return v(R,o,k),y.object(...k)}function f({errorPath:R},{instancePath:o}){let p=o?e.str`${R}${(0,s.getErrorPath)(o,s.Type.Str)}`:R;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,p)]}function I({keyword:R,it:{errSchemaPath:o}},{schemaPath:p,parentSchema:y}){let m=y?o:e.str`${o}/${R}`;if(p)m=e.str`${m}${(0,s.getErrorPath)(p,s.Type.Str)}`;return[E.schemaPath,m]}function v(R,{params:o,message:p},y){let{keyword:m,data:k,schemaValue:T,it:x}=R,{opts:C,propertyName:F,topSchemaRef:B,schemaPath:_}=x;if(y.push([E.keyword,m],[E.params,typeof o=="function"?o(R):o||e._`{}`]),C.messages)y.push([E.message,typeof p=="function"?p(R):p]);if(C.verbose)y.push([E.schema,T],[E.parentSchema,e._`${B}${_}`],[r.default.data,k]);if(F)y.push([E.propertyName,F])}}),Ty=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=Us(),s=ut(),r=$0(),a={message:"boolean schema is false"};function n(c){let{gen:d,schema:E,validateName:l}=c;if(E===!1)h(c,!1);else if(typeof E=="object"&&E.$async===!0)d.return(r.default.data);else d.assign(s._`${l}.errors`,null),d.return(!0)}t.topBoolOrEmptySchema=n;function i(c,d){let{gen:E,schema:l}=c;if(l===!1)E.var(d,!1),h(c);else E.var(d,!0)}t.boolOrEmptySchema=i;function h(c,d){let{gen:E,data:l}=c,u={gen:E,keyword:"false schema",data:l,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(u,a,void 0,d)}}),Bh=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}),Vh=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}),fs=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=Bh(),s=Vh(),r=Us(),a=ut(),n=xt(),i;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(i||(t.DataType=i={}));function h(y){let m=c(y.type);if(m.includes("null")){if(y.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!m.length&&y.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(y.nullable===!0)m.push("null")}return m}t.getSchemaTypes=h;function c(y){let m=Array.isArray(y)?y:y?[y]:[];if(m.every(e.isJSONType))return m;throw Error("type must be JSONType or JSONType[]: "+m.join(","))}t.getJSONTypes=c;function d(y,m){let{gen:k,data:T,opts:x}=y,C=l(m,x.coerceTypes),F=m.length>0&&!(C.length===0&&m.length===1&&(0,s.schemaHasRulesForType)(y,m[0]));if(F){let B=v(m,T,x.strictNumbers,i.Wrong);k.if(B,()=>{if(C.length)u(y,m,C);else o(y)})}return F}t.coerceAndCheckDataType=d;var E=new Set(["string","number","integer","boolean","null"]);function l(y,m){return m?y.filter((k)=>E.has(k)||m==="array"&&k==="array"):[]}function u(y,m,k){let{gen:T,data:x,opts:C}=y,F=T.let("dataType",a._`typeof ${x}`),B=T.let("coerced",a._`undefined`);if(C.coerceTypes==="array")T.if(a._`${F} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>T.assign(x,a._`${x}[0]`).assign(F,a._`typeof ${x}`).if(v(m,x,C.strictNumbers),()=>T.assign(B,x)));T.if(a._`${B} !== undefined`);for(let N of k)if(E.has(N)||N==="array"&&C.coerceTypes==="array")_(N);T.else(),o(y),T.endIf(),T.if(a._`${B} !== undefined`,()=>{T.assign(x,B),f(y,B)});function _(N){switch(N){case"string":T.elseIf(a._`${F} == "number" || ${F} == "boolean"`).assign(B,a._`"" + ${x}`).elseIf(a._`${x} === null`).assign(B,a._`""`);return;case"number":T.elseIf(a._`${F} == "boolean" || ${x} === null
4
+ || (${F} == "string" && ${x} && ${x} == +${x})`).assign(B,a._`+${x}`);return;case"integer":T.elseIf(a._`${F} === "boolean" || ${x} === null
5
+ || (${F} === "string" && ${x} && ${x} == +${x} && !(${x} % 1))`).assign(B,a._`+${x}`);return;case"boolean":T.elseIf(a._`${x} === "false" || ${x} === 0 || ${x} === null`).assign(B,!1).elseIf(a._`${x} === "true" || ${x} === 1`).assign(B,!0);return;case"null":T.elseIf(a._`${x} === "" || ${x} === 0 || ${x} === false`),T.assign(B,null);return;case"array":T.elseIf(a._`${F} === "string" || ${F} === "number"
6
+ || ${F} === "boolean" || ${x} === null`).assign(B,a._`[${x}]`)}}}function f({gen:y,parentData:m,parentDataProperty:k},T){y.if(a._`${m} !== undefined`,()=>y.assign(a._`${m}[${k}]`,T))}function I(y,m,k,T=i.Correct){let x=T===i.Correct?a.operators.EQ:a.operators.NEQ,C;switch(y){case"null":return a._`${m} ${x} null`;case"array":C=a._`Array.isArray(${m})`;break;case"object":C=a._`${m} && typeof ${m} == "object" && !Array.isArray(${m})`;break;case"integer":C=F(a._`!(${m} % 1) && !isNaN(${m})`);break;case"number":C=F();break;default:return a._`typeof ${m} ${x} ${y}`}return T===i.Correct?C:(0,a.not)(C);function F(B=a.nil){return(0,a.and)(a._`typeof ${m} == "number"`,B,k?a._`isFinite(${m})`:a.nil)}}t.checkDataType=I;function v(y,m,k,T){if(y.length===1)return I(y[0],m,k,T);let x,C=(0,n.toHash)(y);if(C.array&&C.object){let F=a._`typeof ${m} != "object"`;x=C.null?F:a._`!${m} || ${F}`,delete C.null,delete C.array,delete C.object}else x=a.nil;if(C.number)delete C.integer;for(let F in C)x=(0,a.and)(x,I(F,m,k,T));return x}t.checkDataTypes=v;var R={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:m})=>typeof y=="string"?a._`{type: ${y}}`:a._`{type: ${m}}`};function o(y){let m=p(y);(0,r.reportError)(m,R)}t.reportTypeError=o;function p(y){let{gen:m,data:k,schema:T}=y,x=(0,n.schemaRefOrVal)(y,T,"type");return{gen:m,keyword:"type",data:k,schema:T.type,schemaCode:x,schemaValue:x,parentSchema:T,params:{},it:y}}}),ky=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=ut(),s=xt();function r(n,i){let{properties:h,items:c}=n.schema;if(i==="object"&&h)for(let d in h)a(n,d,h[d].default);else if(i==="array"&&Array.isArray(c))c.forEach((d,E)=>a(n,E,d.default))}t.assignDefaults=r;function a(n,i,h){let{gen:c,compositeRule:d,data:E,opts:l}=n;if(h===void 0)return;let u=e._`${E}${(0,e.getProperty)(i)}`;if(d){(0,s.checkStrictMode)(n,`default is ignored for: ${u}`);return}let f=e._`${u} === undefined`;if(l.useDefaults==="empty")f=e._`${f} || ${u} === null || ${u} === ""`;c.if(f,e._`${u} = ${(0,e.stringify)(h)}`)}}),M0=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=ut(),s=xt(),r=$0(),a=xt();function n(y,m){let{gen:k,data:T,it:x}=y;k.if(l(k,T,m,x.opts.ownProperties),()=>{y.setParams({missingProperty:e._`${m}`},!0),y.error()})}t.checkReportMissingProp=n;function i({gen:y,data:m,it:{opts:k}},T,x){return(0,e.or)(...T.map((C)=>(0,e.and)(l(y,m,C,k.ownProperties),e._`${x} = ${C}`)))}t.checkMissingProp=i;function h(y,m){y.setParams({missingProperty:m},!0),y.error()}t.reportMissingProp=h;function c(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}t.hasPropFunc=c;function d(y,m,k){return e._`${c(y)}.call(${m}, ${k})`}t.isOwnProperty=d;function E(y,m,k,T){let x=e._`${m}${(0,e.getProperty)(k)} !== undefined`;return T?e._`${x} && ${d(y,m,k)}`:x}t.propertyInData=E;function l(y,m,k,T){let x=e._`${m}${(0,e.getProperty)(k)} === undefined`;return T?(0,e.or)(x,(0,e.not)(d(y,m,k))):x}t.noPropertyInData=l;function u(y){return y?Object.keys(y).filter((m)=>m!=="__proto__"):[]}t.allSchemaProperties=u;function f(y,m){return u(m).filter((k)=>!(0,s.alwaysValidSchema)(y,m[k]))}t.schemaProperties=f;function I({schemaCode:y,data:m,it:{gen:k,topSchemaRef:T,schemaPath:x,errorPath:C},it:F},B,_,N){let O=N?e._`${y}, ${m}, ${T}${x}`:m,z=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,C)],[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}, ${k.object(...z)}`;return _!==e.nil?e._`${B}.call(${_}, ${K})`:e._`${B}(${K})`}t.callValidateCode=I;var v=e._`new RegExp`;function R({gen:y,it:{opts:m}},k){let T=m.unicodeRegExp?"u":"",{regExp:x}=m.code,C=x(k,T);return y.scopeValue("pattern",{key:C.toString(),ref:C,code:e._`${x.code==="new RegExp"?v:(0,a.useFunc)(y,x)}(${k}, ${T})`})}t.usePattern=R;function o(y){let{gen:m,data:k,keyword:T,it:x}=y,C=m.name("valid");if(x.allErrors){let B=m.let("valid",!0);return F(()=>m.assign(B,!1)),B}return m.var(C,!0),F(()=>m.break()),C;function F(B){let _=m.const("len",e._`${k}.length`);m.forRange("i",0,_,(N)=>{y.subschema({keyword:T,dataProp:N,dataPropType:s.Type.Num},C),m.if((0,e.not)(C),B)})}}t.validateArray=o;function p(y){let{gen:m,schema:k,keyword:T,it:x}=y;if(!Array.isArray(k))throw Error("ajv implementation error");if(k.some((B)=>(0,s.alwaysValidSchema)(x,B))&&!x.opts.unevaluated)return;let C=m.let("valid",!1),F=m.name("_valid");m.block(()=>k.forEach((B,_)=>{let N=y.subschema({keyword:T,schemaProp:_,compositeRule:!0},F);if(m.assign(C,e._`${C} || ${F}`),!y.mergeValidEvaluated(N,F))m.if((0,e.not)(C))})),y.result(C,()=>y.reset(),()=>y.error(!0))}t.validateUnion=p}),fy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=ut(),s=$0(),r=M0(),a=Us();function n(f,I){let{gen:v,keyword:R,schema:o,parentSchema:p,it:y}=f,m=I.macro.call(y.self,o,p,y),k=E(v,R,m);if(y.opts.validateSchema!==!1)y.self.validateSchema(m,!0);let T=v.name("valid");f.subschema({schema:m,schemaPath:e.nil,errSchemaPath:`${y.errSchemaPath}/${R}`,topSchemaRef:k,compositeRule:!0},T),f.pass(T,()=>f.error(!0))}t.macroKeywordCode=n;function i(f,I){var v;let{gen:R,keyword:o,schema:p,parentSchema:y,$data:m,it:k}=f;d(k,I);let T=!m&&I.compile?I.compile.call(k.self,p,y,k):I.validate,x=E(R,o,T),C=R.let("valid");f.block$data(C,F),f.ok((v=I.valid)!==null&&v!==void 0?v:C);function F(){if(I.errors===!1){if(N(),I.modifying)h(f);O(()=>f.error())}else{let z=I.async?B():_();if(I.modifying)h(f);O(()=>c(f,z))}}function B(){let z=R.let("ruleErrs",null);return R.try(()=>N(e._`await `),(K)=>R.assign(C,!1).if(e._`${K} instanceof ${k.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=I.async?e._`await `:e.nil){let K=k.opts.passContext?s.default.this:s.default.self,Mt=!(("compile"in I)&&!m||I.schema===!1);R.assign(C,e._`${z}${(0,r.callValidateCode)(f,x,K,Mt)}`,I.modifying)}function O(z){var K;R.if((0,e.not)((K=I.valid)!==null&&K!==void 0?K:C),z)}}t.funcKeywordCode=i;function h(f){let{gen:I,data:v,it:R}=f;I.if(R.parentData,()=>I.assign(v,e._`${R.parentData}[${R.parentDataProperty}]`))}function c(f,I){let{gen:v}=f;v.if(e._`Array.isArray(${I})`,()=>{v.assign(s.default.vErrors,e._`${s.default.vErrors} === null ? ${I} : ${s.default.vErrors}.concat(${I})`).assign(s.default.errors,e._`${s.default.vErrors}.length`),(0,a.extendErrors)(f)},()=>f.error())}function d({schemaEnv:f},I){if(I.async&&!f.$async)throw Error("async keyword in sync schema")}function E(f,I,v){if(v===void 0)throw Error(`keyword "${I}" failed to compile`);return f.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function l(f,I,v=!1){return!I.length||I.some((R)=>R==="array"?Array.isArray(f):R==="object"?f&&typeof f=="object"&&!Array.isArray(f):typeof f==R||v&&typeof f>"u")}t.validSchemaType=l;function u({schema:f,opts:I,self:v,errSchemaPath:R},o,p){if(Array.isArray(o.keyword)?!o.keyword.includes(p):o.keyword!==p)throw Error("ajv implementation error");let y=o.dependencies;if(y===null||y===void 0?void 0:y.some((m)=>!Object.prototype.hasOwnProperty.call(f,m)))throw Error(`parent schema must have dependencies of ${p}: ${y.join(",")}`);if(o.validateSchema){if(!o.validateSchema(f[p])){let m=`keyword "${p}" value is invalid at path "${R}": `+v.errorsText(o.validateSchema.errors);if(I.validateSchema==="log")v.logger.error(m);else throw Error(m)}}}t.validateKeywordUsage=u}),Ry=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=ut(),s=xt();function r(i,{keyword:h,schemaProp:c,schema:d,schemaPath:E,errSchemaPath:l,topSchemaRef:u}){if(h!==void 0&&d!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(h!==void 0){let f=i.schema[h];return c===void 0?{schema:f,schemaPath:e._`${i.schemaPath}${(0,e.getProperty)(h)}`,errSchemaPath:`${i.errSchemaPath}/${h}`}:{schema:f[c],schemaPath:e._`${i.schemaPath}${(0,e.getProperty)(h)}${(0,e.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${h}/${(0,s.escapeFragment)(c)}`}}if(d!==void 0){if(E===void 0||l===void 0||u===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:E,topSchemaRef:u,errSchemaPath:l}}throw Error('either "keyword" or "schema" must be passed')}t.getSubschema=r;function a(i,h,{dataProp:c,dataPropType:d,data:E,dataTypes:l,propertyName:u}){if(E!==void 0&&c!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:f}=h;if(c!==void 0){let{errorPath:v,dataPathArr:R,opts:o}=h,p=f.let("data",e._`${h.data}${(0,e.getProperty)(c)}`,!0);I(p),i.errorPath=e.str`${v}${(0,s.getErrorPath)(c,d,o.jsPropertySyntax)}`,i.parentDataProperty=e._`${c}`,i.dataPathArr=[...R,i.parentDataProperty]}if(E!==void 0){let v=E instanceof e.Name?E:f.let("data",E,!0);if(I(v),u!==void 0)i.propertyName=u}if(l)i.dataTypes=l;function I(v){i.data=v,i.dataLevel=h.dataLevel+1,i.dataTypes=[],h.definedProperties=new Set,i.parentData=h.data,i.dataNames=[...h.dataNames,v]}}t.extendSubschemaData=a;function n(i,{jtdDiscriminator:h,jtdMetadata:c,compositeRule:d,createErrors:E,allErrors:l}){if(d!==void 0)i.compositeRule=d;if(E!==void 0)i.createErrors=E;if(l!==void 0)i.allErrors=l;i.jtdDiscriminator=h,i.jtdMetadata=c}t.extendSubschemaMode=n}),Nh=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 c=h[i];if(!s(r[c],a[c]))return!1}return!0}return r!==r&&a!==a}}),xy=W((t,e)=>{var s=e.exports=function(n,i,h){if(typeof i=="function")h=i,i={};h=i.cb||h;var c=typeof h=="function"?h:h.pre||function(){},d=h.post||function(){};r(i,c,d,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,c,d,E,l,u,f,I){if(c&&typeof c=="object"&&!Array.isArray(c)){i(c,d,E,l,u,f,I);for(var v in c){var R=c[v];if(Array.isArray(R)){if(v in s.arrayKeywords)for(var o=0;o<R.length;o++)r(n,i,h,R[o],d+"/"+v+"/"+o,E,d,v,c,o)}else if(v in s.propsKeywords){if(R&&typeof R=="object")for(var p in R)r(n,i,h,R[p],d+"/"+v+"/"+a(p),E,d,v,c,p)}else if(v in s.keywords||n.allKeys&&!(v in s.skipKeywords))r(n,i,h,R,d+"/"+v,E,d,v,c)}h(c,d,E,l,u,f,I)}}function a(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}}),Gs=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=Nh(),r=xy(),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function n(R,o=!0){if(typeof R=="boolean")return!0;if(o===!0)return!h(R);if(!o)return!1;return c(R)<=o}t.inlineRef=n;var i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function h(R){for(let o in R){if(i.has(o))return!0;let p=R[o];if(Array.isArray(p)&&p.some(h))return!0;if(typeof p=="object"&&h(p))return!0}return!1}function c(R){let o=0;for(let p in R){if(p==="$ref")return 1/0;if(o++,a.has(p))continue;if(typeof R[p]=="object")(0,e.eachItem)(R[p],(y)=>o+=c(y));if(o===1/0)return 1/0}return o}function d(R,o="",p){if(p!==!1)o=u(o);let y=R.parse(o);return E(R,y)}t.getFullPath=d;function E(R,o){return R.serialize(o).split("#")[0]+"#"}t._getFullPath=E;var l=/#\/?$/;function u(R){return R?R.replace(l,""):""}t.normalizeId=u;function f(R,o,p){return p=u(p),R.resolve(o,p)}t.resolveUrl=f;var I=/^[a-z_][-a-z0-9._]*$/i;function v(R,o){if(typeof R=="boolean")return{};let{schemaId:p,uriResolver:y}=this.opts,m=u(R[p]||o),k={"":m},T=d(y,m,!1),x={},C=new Set;return r(R,{allKeys:!0},(_,N,O,z)=>{if(z===void 0)return;let K=T+N,Mt=k[z];if(typeof _[p]=="string")Mt=Ot.call(this,_[p]);Ut.call(this,_.$anchor),Ut.call(this,_.$dynamicAnchor),k[N]=Mt;function Ot(St){let Z=this.opts.uriResolver.resolve;if(St=u(Mt?Z(Mt,St):St),C.has(St))throw B(St);C.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!==u(K))if(St[0]==="#")F(_,x[St],St),x[St]=_;else this.refs[St]=K;return St}function Ut(St){if(typeof St=="string"){if(!I.test(St))throw Error(`invalid anchor "${St}"`);Ot.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=v}),Ws=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=Ty(),s=fs(),r=Vh(),a=fs(),n=ky(),i=fy(),h=Ry(),c=ut(),d=$0(),E=Gs(),l=xt(),u=Us();function f(A){if(T(A)){if(C(A),k(A)){o(A);return}}I(A,()=>(0,e.topBoolOrEmptySchema)(A))}t.validateFunctionCode=f;function I({gen:A,validateName:j,schema:D,schemaEnv:et,opts:st},mt){if(st.code.es5)A.func(j,c._`${d.default.data}, ${d.default.valCxt}`,et.$async,()=>{A.code(c._`"use strict"; ${y(D,st)}`),R(A,st),A.code(mt)});else A.func(j,c._`${d.default.data}, ${v(st)}`,et.$async,()=>A.code(y(D,st)).code(mt))}function v(A){return c._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${A.dynamicRef?c._`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`}function R(A,j){A.if(d.default.valCxt,()=>{if(A.var(d.default.instancePath,c._`${d.default.valCxt}.${d.default.instancePath}`),A.var(d.default.parentData,c._`${d.default.valCxt}.${d.default.parentData}`),A.var(d.default.parentDataProperty,c._`${d.default.valCxt}.${d.default.parentDataProperty}`),A.var(d.default.rootData,c._`${d.default.valCxt}.${d.default.rootData}`),j.dynamicRef)A.var(d.default.dynamicAnchors,c._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{if(A.var(d.default.instancePath,c._`""`),A.var(d.default.parentData,c._`undefined`),A.var(d.default.parentDataProperty,c._`undefined`),A.var(d.default.rootData,d.default.data),j.dynamicRef)A.var(d.default.dynamicAnchors,c._`{}`)})}function o(A){let{schema:j,opts:D,gen:et}=A;I(A,()=>{if(D.$comment&&j.$comment)z(A);if(_(A),et.let(d.default.vErrors,null),et.let(d.default.errors,0),D.unevaluated)p(A);F(A),K(A)});return}function p(A){let{gen:j,validateName:D}=A;A.evaluated=j.const("evaluated",c._`${D}.evaluated`),j.if(c._`${A.evaluated}.dynamicProps`,()=>j.assign(c._`${A.evaluated}.props`,c._`undefined`)),j.if(c._`${A.evaluated}.dynamicItems`,()=>j.assign(c._`${A.evaluated}.items`,c._`undefined`))}function y(A,j){let D=typeof A=="object"&&A[j.schemaId];return D&&(j.code.source||j.code.process)?c._`/*# sourceURL=${D} */`:c.nil}function m(A,j){if(T(A)){if(C(A),k(A)){x(A,j);return}}(0,e.boolOrEmptySchema)(A,j)}function k({schema:A,self:j}){if(typeof A=="boolean")return!A;for(let D in A)if(j.RULES.all[D])return!0;return!1}function T(A){return typeof A.schema!="boolean"}function x(A,j){let{schema:D,gen:et,opts:st}=A;if(st.$comment&&D.$comment)z(A);N(A),O(A);let mt=et.const("_errs",d.default.errors);F(A,mt),et.var(j,c._`${mt} === ${d.default.errors}`)}function C(A){(0,l.checkUnknownRules)(A),B(A)}function F(A,j){if(A.opts.jtd)return Ot(A,[],!1,j);let D=(0,s.getSchemaTypes)(A.schema),et=(0,s.coerceAndCheckDataType)(A,D);Ot(A,D,!et,j)}function B(A){let{schema:j,errSchemaPath:D,opts:et,self:st}=A;if(j.$ref&&et.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(j,st.RULES))st.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function _(A){let{schema:j,opts:D}=A;if(j.default!==void 0&&D.useDefaults&&D.strictSchema)(0,l.checkStrictMode)(A,"default is ignored in the schema root")}function N(A){let j=A.schema[A.opts.schemaId];if(j)A.baseId=(0,E.resolveUrl)(A.opts.uriResolver,A.baseId,j)}function O(A){if(A.schema.$async&&!A.schemaEnv.$async)throw Error("async schema in sync schema")}function z({gen:A,schemaEnv:j,schema:D,errSchemaPath:et,opts:st}){let mt=D.$comment;if(st.$comment===!0)A.code(c._`${d.default.self}.logger.log(${mt})`);else if(typeof st.$comment=="function"){let Wt=c.str`${et}/$comment`,$t=A.scopeValue("root",{ref:j.root});A.code(c._`${d.default.self}.opts.$comment(${mt}, ${Wt}, ${$t}.schema)`)}}function K(A){let{gen:j,schemaEnv:D,validateName:et,ValidationError:st,opts:mt}=A;if(D.$async)j.if(c._`${d.default.errors} === 0`,()=>j.return(d.default.data),()=>j.throw(c._`new ${st}(${d.default.vErrors})`));else{if(j.assign(c._`${et}.errors`,d.default.vErrors),mt.unevaluated)Mt(A);j.return(c._`${d.default.errors} === 0`)}}function Mt({gen:A,evaluated:j,props:D,items:et}){if(D instanceof c.Name)A.assign(c._`${j}.props`,D);if(et instanceof c.Name)A.assign(c._`${j}.items`,et)}function Ot(A,j,D,et){let{gen:st,schema:mt,data:Wt,allErrors:$t,opts:Gt,self:zt}=A,{RULES:Vt}=zt;if(mt.$ref&&(Gt.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(mt,Vt))){st.block(()=>lt(A,"$ref",Vt.all.$ref.definition));return}if(!Gt.jtd)St(A,j);st.block(()=>{for(let e0 of Vt.rules)E0(e0);E0(Vt.post)});function E0(e0){if(!(0,r.shouldUseGroup)(mt,e0))return;if(e0.type){if(st.if((0,a.checkDataType)(e0.type,Wt,Gt.strictNumbers)),Ut(A,e0),j.length===1&&j[0]===e0.type&&D)st.else(),(0,a.reportTypeError)(A);st.endIf()}else Ut(A,e0);if(!$t)st.if(c._`${d.default.errors} === ${et||0}`)}}function Ut(A,j){let{gen:D,schema:et,opts:{useDefaults:st}}=A;if(st)(0,n.assignDefaults)(A,j.type);D.block(()=>{for(let mt of j.rules)if((0,r.shouldUseRule)(et,mt))lt(A,mt.keyword,mt.definition,j.type)})}function St(A,j){if(A.schemaEnv.meta||!A.opts.strictTypes)return;if(Z(A,j),!A.opts.allowUnionTypes)L(A,j);V(A,A.dataTypes)}function Z(A,j){if(!j.length)return;if(!A.dataTypes.length){A.dataTypes=j;return}j.forEach((D)=>{if(!b(A.dataTypes,D))X(A,`type "${D}" not allowed by context "${A.dataTypes.join(",")}"`)}),P(A,j)}function L(A,j){if(j.length>1&&!(j.length===2&&j.includes("null")))X(A,"use allowUnionTypes to allow union type keyword")}function V(A,j){let D=A.self.RULES.all;for(let et in D){let st=D[et];if(typeof st=="object"&&(0,r.shouldUseRule)(A.schema,st)){let{type:mt}=st.definition;if(mt.length&&!mt.some((Wt)=>S(j,Wt)))X(A,`missing type "${mt.join(",")}" for keyword "${et}"`)}}}function S(A,j){return A.includes(j)||j==="number"&&A.includes("integer")}function b(A,j){return A.includes(j)||j==="integer"&&A.includes("number")}function P(A,j){let D=[];for(let et of A.dataTypes)if(b(j,et))D.push(et);else if(j.includes("integer")&&et==="number")D.push("integer");A.dataTypes=D}function X(A,j){let D=A.schemaEnv.baseId+A.errSchemaPath;j+=` at "${D}" (strictTypes)`,(0,l.checkStrictMode)(A,j,A.opts.strictTypes)}class at{constructor(A,j,D){if((0,i.validateKeywordUsage)(A,j,D),this.gen=A.gen,this.allErrors=A.allErrors,this.keyword=D,this.data=A.data,this.schema=A.schema[D],this.$data=j.$data&&A.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(A,this.schema,D,this.$data),this.schemaType=j.schemaType,this.parentSchema=A.schema,this.params={},this.it=A,this.def=j,this.$data)this.schemaCode=A.gen.const("vSchema",C0(this.$data,A));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=A.gen.const("_errs",d.default.errors)}result(A,j,D){this.failResult((0,c.not)(A),j,D)}failResult(A,j,D){if(this.gen.if(A),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(A,j){this.failResult((0,c.not)(A),void 0,j)}fail(A){if(A===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(A),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(A){if(!this.$data)return this.fail(A);let{schemaCode:j}=this;this.fail(c._`${j} !== undefined && (${(0,c.or)(this.invalid$data(),A)})`)}error(A,j,D){if(j){this.setParams(j),this._error(A,D),this.setParams({});return}this._error(A,D)}_error(A,j){(A?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(A){if(!this.allErrors)this.gen.if(A)}setParams(A,j){if(j)Object.assign(this.params,A);else this.params=A}block$data(A,j,D=c.nil){this.gen.block(()=>{this.check$data(A,D),j()})}check$data(A=c.nil,j=c.nil){if(!this.$data)return;let{gen:D,schemaCode:et,schemaType:st,def:mt}=this;if(D.if((0,c.or)(c._`${et} === undefined`,j)),A!==c.nil)D.assign(A,!0);if(st.length||mt.validateSchema){if(D.elseIf(this.invalid$data()),this.$dataError(),A!==c.nil)D.assign(A,!1)}D.else()}invalid$data(){let{gen:A,schemaCode:j,schemaType:D,def:et,it:st}=this;return(0,c.or)(mt(),Wt());function mt(){if(D.length){if(!(j instanceof c.Name))throw Error("ajv implementation error");let $t=Array.isArray(D)?D:[D];return c._`${(0,a.checkDataTypes)($t,j,st.opts.strictNumbers,a.DataType.Wrong)}`}return c.nil}function Wt(){if(et.validateSchema){let $t=A.scopeValue("validate$data",{ref:et.validateSchema});return c._`!${$t}(${j})`}return c.nil}}subschema(A,j){let D=(0,h.getSubschema)(this.it,A);(0,h.extendSubschemaData)(D,this.it,A),(0,h.extendSubschemaMode)(D,A);let et={...this.it,...D,items:void 0,props:void 0};return m(et,j),et}mergeEvaluated(A,j){let{it:D,gen:et}=this;if(!D.opts.unevaluated)return;if(D.props!==!0&&A.props!==void 0)D.props=l.mergeEvaluated.props(et,A.props,D.props,j);if(D.items!==!0&&A.items!==void 0)D.items=l.mergeEvaluated.items(et,A.items,D.items,j)}mergeValidEvaluated(A,j){let{it:D,gen:et}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return et.if(j,()=>this.mergeEvaluated(A,c.Name)),!0}}t.KeywordCxt=at;function lt(A,j,D,et){let st=new at(A,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(A,{dataLevel:j,dataNames:D,dataPathArr:et}){let st,mt;if(A==="")return d.default.rootData;if(A[0]==="/"){if(!rt.test(A))throw Error(`Invalid JSON-pointer: ${A}`);st=A,mt=d.default.rootData}else{let zt=Pt.exec(A);if(!zt)throw Error(`Invalid JSON-pointer: ${A}`);let Vt=+zt[1];if(st=zt[2],st==="#"){if(Vt>=j)throw Error(Gt("property/index",Vt));return et[j-Vt]}if(Vt>j)throw Error(Gt("data",Vt));if(mt=D[j-Vt],!st)return mt}let Wt=mt,$t=st.split("/");for(let zt of $t)if(zt)mt=c._`${mt}${(0,c.getProperty)((0,l.unescapeJsonPointer)(zt))}`,Wt=c._`${Wt} && ${mt}`;return Wt;function Gt(zt,Vt){return`Cannot access ${zt} ${Vt} levels up, current level is ${j}`}}t.getData=C0}),$3=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}),zs=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Gs();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}),tr=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=ut(),s=$3(),r=$0(),a=Gs(),n=xt(),i=Ws();class h{constructor(o){var p;this.refs={},this.dynamicAnchors={};let y;if(typeof o.schema=="object")y=o.schema;this.schema=o.schema,this.schemaId=o.schemaId,this.root=o.root||this,this.baseId=(p=o.baseId)!==null&&p!==void 0?p:(0,a.normalizeId)(y===null||y===void 0?void 0:y[o.schemaId||"$id"]),this.schemaPath=o.schemaPath,this.localRefs=o.localRefs,this.meta=o.meta,this.$async=y===null||y===void 0?void 0:y.$async,this.refs={}}}t.SchemaEnv=h;function c(o){let p=l.call(this,o);if(p)return p;let y=(0,a.getFullPath)(this.opts.uriResolver,o.root.baseId),{es5:m,lines:k}=this.opts.code,{ownProperties:T}=this.opts,x=new e.CodeGen(this.scope,{es5:m,lines:k,ownProperties:T}),C;if(o.$async)C=x.scopeValue("Error",{ref:s.default,code:e._`require("ajv/dist/runtime/validation_error").default`});let F=x.scopeName("validate");o.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:o.schema,code:(0,e.stringify)(o.schema)}:{ref:o.schema}),validateName:F,ValidationError:C,schema:o.schema,schemaEnv:o,rootId:y,baseId:o.baseId||y,schemaPath:e.nil,errSchemaPath:o.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},_;try{this._compilations.add(o),(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(_,o);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=o.schema,O.schemaEnv=o,o.$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 o.validate=O,o}catch(N){if(delete o.validate,delete o.validateName,_)this.logger.error("Error compiling schema, function code:",_);throw N}finally{this._compilations.delete(o)}}t.compileSchema=c;function d(o,p,y){var m;y=(0,a.resolveUrl)(this.opts.uriResolver,p,y);let k=o.refs[y];if(k)return k;let T=f.call(this,o,y);if(T===void 0){let x=(m=o.localRefs)===null||m===void 0?void 0:m[y],{schemaId:C}=this.opts;if(x)T=new h({schema:x,schemaId:C,root:o,baseId:p})}if(T===void 0)return;return o.refs[y]=E.call(this,T)}t.resolveRef=d;function E(o){if((0,a.inlineRef)(o.schema,this.opts.inlineRefs))return o.schema;return o.validate?o:c.call(this,o)}function l(o){for(let p of this._compilations)if(u(p,o))return p}t.getCompilingSchema=l;function u(o,p){return o.schema===p.schema&&o.root===p.root&&o.baseId===p.baseId}function f(o,p){let y;while(typeof(y=this.refs[p])=="string")p=y;return y||this.schemas[p]||I.call(this,o,p)}function I(o,p){let y=this.opts.uriResolver.parse(p),m=(0,a._getFullPath)(this.opts.uriResolver,y),k=(0,a.getFullPath)(this.opts.uriResolver,o.baseId,void 0);if(Object.keys(o.schema).length>0&&m===k)return R.call(this,y,o);let T=(0,a.normalizeId)(m),x=this.refs[T]||this.schemas[T];if(typeof x=="string"){let C=I.call(this,o,x);if(typeof(C===null||C===void 0?void 0:C.schema)!=="object")return;return R.call(this,y,C)}if(typeof(x===null||x===void 0?void 0:x.schema)!=="object")return;if(!x.validate)c.call(this,x);if(T===(0,a.normalizeId)(p)){let{schema:C}=x,{schemaId:F}=this.opts,B=C[F];if(B)k=(0,a.resolveUrl)(this.opts.uriResolver,k,B);return new h({schema:C,schemaId:F,root:o,baseId:k})}return R.call(this,y,x)}t.resolveSchema=I;var v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function R(o,{baseId:p,schema:y,root:m}){var k;if(((k=o.fragment)===null||k===void 0?void 0:k[0])!=="/")return;for(let C of o.fragment.slice(1).split("/")){if(typeof y==="boolean")return;let F=y[(0,n.unescapeFragment)(C)];if(F===void 0)return;y=F;let B=typeof y==="object"&&y[this.opts.schemaId];if(!v.has(C)&&B)p=(0,a.resolveUrl)(this.opts.uriResolver,p,B)}let T;if(typeof y!="boolean"&&y.$ref&&!(0,n.schemaHasRulesButRef)(y,this.RULES)){let C=(0,a.resolveUrl)(this.opts.uriResolver,p,y.$ref);T=I.call(this,m,C)}let{schemaId:x}=this.opts;if(T=T||new h({schema:y,schemaId:x,root:m,baseId:p}),T.schema!==T.root.schema)return T;return}}),Iy=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}}),vy=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}}),Cy=W((t,e)=>{var{HEX:s}=vy(),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(o){if(d(o,".")<3)return{host:o,isIPV4:!1};let p=o.match(r)||[],[y]=p;if(y)return{host:c(y,"."),isIPV4:!0};else return{host:o,isIPV4:!1}}function n(o,p=!1){let y="",m=!0;for(let k of o){if(s[k]===void 0)return;if(k!=="0"&&m===!0)m=!1;if(!m)y+=k}if(p&&y.length===0)y="0";return y}function i(o){let p=0,y={error:!1,address:"",zone:""},m=[],k=[],T=!1,x=!1,C=!1;function F(){if(k.length){if(T===!1){let B=n(k);if(B!==void 0)m.push(B);else return y.error=!0,!1}k.length=0}return!0}for(let B=0;B<o.length;B++){let _=o[B];if(_==="["||_==="]")continue;if(_===":"){if(x===!0)C=!0;if(!F())break;if(p++,m.push(":"),p>7){y.error=!0;break}if(B-1>=0&&o[B-1]===":")x=!0;continue}else if(_==="%"){if(!F())break;T=!0}else{k.push(_);continue}}if(k.length)if(T)y.zone=k.join("");else if(C)m.push(k.join(""));else m.push(n(k));return y.address=m.join(""),y}function h(o){if(d(o,":")<2)return{host:o,isIPV6:!1};let p=i(o);if(!p.error){let{address:y,address:m}=p;if(p.zone)y+="%"+p.zone,m+="%25"+p.zone;return{host:y,escapedHost:m,isIPV6:!0}}else return{host:o,isIPV6:!1}}function c(o,p){let y="",m=!0,k=o.length;for(let T=0;T<k;T++){let x=o[T];if(x==="0"&&m){if(T+1<=k&&o[T+1]===p||T+1===k)y+=x,m=!1}else{if(x===p)m=!0;else m=!1;y+=x}}return y}function d(o,p){let y=0;for(let m=0;m<o.length;m++)if(o[m]===p)y++;return y}var E=/^\.\.?\//u,l=/^\/\.(?:\/|$)/u,u=/^\/\.\.(?:\/|$)/u,f=/^\/?(?:.|\n)*?(?=\/|$)/u;function I(o){let p=[];while(o.length)if(o.match(E))o=o.replace(E,"");else if(o.match(l))o=o.replace(l,"/");else if(o.match(u))o=o.replace(u,"/"),p.pop();else if(o==="."||o==="..")o="";else{let y=o.match(f);if(y){let m=y[0];o=o.slice(m.length),p.push(m)}else throw Error("Unexpected dot segment condition")}return p.join("")}function v(o,p){let y=p!==!0?escape:unescape;if(o.scheme!==void 0)o.scheme=y(o.scheme);if(o.userinfo!==void 0)o.userinfo=y(o.userinfo);if(o.host!==void 0)o.host=y(o.host);if(o.path!==void 0)o.path=y(o.path);if(o.query!==void 0)o.query=y(o.query);if(o.fragment!==void 0)o.fragment=y(o.fragment);return o}function R(o){let p=[];if(o.userinfo!==void 0)p.push(o.userinfo),p.push("@");if(o.host!==void 0){let y=unescape(o.host),m=a(y);if(m.isIPV4)y=m.host;else{let k=h(m.host);if(k.isIPV6===!0)y=`[${k.escapedHost}]`;else y=o.host}p.push(y)}if(typeof o.port==="number"||typeof o.port==="string")p.push(":"),p.push(String(o.port));return p.length?p.join(""):void 0}e.exports={recomposeAuthority:R,normalizeComponentEncoding:v,removeDotSegments:I,normalizeIPv4:a,normalizeIPv6:h,stringArrayToHexStripped:n}}),Ay=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(m){return typeof m.secure==="boolean"?m.secure:String(m.scheme).toLowerCase()==="wss"}function n(m){if(!m.host)m.error=m.error||"HTTP URIs must have a host.";return m}function i(m){let k=String(m.scheme).toLowerCase()==="https";if(m.port===(k?443:80)||m.port==="")m.port=void 0;if(!m.path)m.path="/";return m}function h(m){return m.secure=a(m),m.resourceName=(m.path||"/")+(m.query?"?"+m.query:""),m.path=void 0,m.query=void 0,m}function c(m){if(m.port===(a(m)?443:80)||m.port==="")m.port=void 0;if(typeof m.secure==="boolean")m.scheme=m.secure?"wss":"ws",m.secure=void 0;if(m.resourceName){let[k,T]=m.resourceName.split("?");m.path=k&&k!=="/"?k:void 0,m.query=T,m.resourceName=void 0}return m.fragment=void 0,m}function d(m,k){if(!m.path)return m.error="URN can not be parsed",m;let T=m.path.match(r);if(T){let x=k.scheme||m.scheme||"urn";m.nid=T[1].toLowerCase(),m.nss=T[2];let C=`${x}:${k.nid||m.nid}`,F=y[C];if(m.path=void 0,F)m=F.parse(m,k)}else m.error=m.error||"URN can not be parsed.";return m}function E(m,k){let T=k.scheme||m.scheme||"urn",x=m.nid.toLowerCase(),C=`${T}:${k.nid||x}`,F=y[C];if(F)m=F.serialize(m,k);let B=m,_=m.nss;return B.path=`${x||k.nid}:${_}`,k.skipEscape=!0,B}function l(m,k){let T=m;if(T.uuid=T.nss,T.nss=void 0,!k.tolerant&&(!T.uuid||!s.test(T.uuid)))T.error=T.error||"UUID is not valid.";return T}function u(m){let k=m;return k.nss=(m.uuid||"").toLowerCase(),k}var f={scheme:"http",domainHost:!0,parse:n,serialize:i},I={scheme:"https",domainHost:f.domainHost,parse:n,serialize:i},v={scheme:"ws",domainHost:!0,parse:h,serialize:c},R={scheme:"wss",domainHost:v.domainHost,parse:v.parse,serialize:v.serialize},o={scheme:"urn",parse:d,serialize:E,skipNormalize:!0},p={scheme:"urn:uuid",parse:l,serialize:u,skipNormalize:!0},y={http:f,https:I,ws:v,wss:R,urn:o,"urn:uuid":p};e.exports=y}),by=W((t,e)=>{var{normalizeIPv6:s,normalizeIPv4:r,removeDotSegments:a,recomposeAuthority:n,normalizeComponentEncoding:i}=Cy(),h=Ay();function c(p,y){if(typeof p==="string")p=u(R(p,y),y);else if(typeof p==="object")p=R(u(p,y),y);return p}function d(p,y,m){let k=Object.assign({scheme:"null"},m),T=E(R(p,k),R(y,k),k,!0);return u(T,{...k,skipEscape:!0})}function E(p,y,m,k){let T={};if(!k)p=R(u(p,m),m),y=R(u(y,m),m);if(m=m||{},!m.tolerant&&y.scheme)T.scheme=y.scheme,T.userinfo=y.userinfo,T.host=y.host,T.port=y.port,T.path=a(y.path||""),T.query=y.query;else{if(y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)T.userinfo=y.userinfo,T.host=y.host,T.port=y.port,T.path=a(y.path||""),T.query=y.query;else{if(!y.path)if(T.path=p.path,y.query!==void 0)T.query=y.query;else T.query=p.query;else{if(y.path.charAt(0)==="/")T.path=a(y.path);else{if((p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path)T.path="/"+y.path;else if(!p.path)T.path=y.path;else T.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+y.path;T.path=a(T.path)}T.query=y.query}T.userinfo=p.userinfo,T.host=p.host,T.port=p.port}T.scheme=p.scheme}return T.fragment=y.fragment,T}function l(p,y,m){if(typeof p==="string")p=unescape(p),p=u(i(R(p,m),!0),{...m,skipEscape:!0});else if(typeof p==="object")p=u(i(p,!0),{...m,skipEscape:!0});if(typeof y==="string")y=unescape(y),y=u(i(R(y,m),!0),{...m,skipEscape:!0});else if(typeof y==="object")y=u(i(y,!0),{...m,skipEscape:!0});return p.toLowerCase()===y.toLowerCase()}function u(p,y){let m={host:p.host,scheme:p.scheme,userinfo:p.userinfo,port:p.port,path:p.path,query:p.query,nid:p.nid,nss:p.nss,uuid:p.uuid,fragment:p.fragment,reference:p.reference,resourceName:p.resourceName,secure:p.secure,error:""},k=Object.assign({},y),T=[],x=h[(k.scheme||m.scheme||"").toLowerCase()];if(x&&x.serialize)x.serialize(m,k);if(m.path!==void 0)if(!k.skipEscape){if(m.path=escape(m.path),m.scheme!==void 0)m.path=m.path.split("%3A").join(":")}else m.path=unescape(m.path);if(k.reference!=="suffix"&&m.scheme)T.push(m.scheme,":");let C=n(m);if(C!==void 0){if(k.reference!=="suffix")T.push("//");if(T.push(C),m.path&&m.path.charAt(0)!=="/")T.push("/")}if(m.path!==void 0){let F=m.path;if(!k.absolutePath&&(!x||!x.absolutePath))F=a(F);if(C===void 0)F=F.replace(/^\/\//u,"/%2F");T.push(F)}if(m.query!==void 0)T.push("?",m.query);if(m.fragment!==void 0)T.push("#",m.fragment);return T.join("")}var f=Array.from({length:127},(p,y)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(y)));function I(p){let y=0;for(let m=0,k=p.length;m<k;++m)if(y=p.charCodeAt(m),y>126||f[y])return!0;return!1}var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function R(p,y){let m=Object.assign({},y),k={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},T=p.indexOf("%")!==-1,x=!1;if(m.reference==="suffix")p=(m.scheme?m.scheme+":":"")+"//"+p;let C=p.match(v);if(C){if(k.scheme=C[1],k.userinfo=C[3],k.host=C[4],k.port=parseInt(C[5],10),k.path=C[6]||"",k.query=C[7],k.fragment=C[8],isNaN(k.port))k.port=C[5];if(k.host){let B=r(k.host);if(B.isIPV4===!1){let _=s(B.host);k.host=_.host.toLowerCase(),x=_.isIPV6}else k.host=B.host,x=!0}if(k.scheme===void 0&&k.userinfo===void 0&&k.host===void 0&&k.port===void 0&&k.query===void 0&&!k.path)k.reference="same-document";else if(k.scheme===void 0)k.reference="relative";else if(k.fragment===void 0)k.reference="absolute";else k.reference="uri";if(m.reference&&m.reference!=="suffix"&&m.reference!==k.reference)k.error=k.error||"URI is not a "+m.reference+" reference.";let F=h[(m.scheme||k.scheme||"").toLowerCase()];if(!m.unicodeSupport&&(!F||!F.unicodeSupport)){if(k.host&&(m.domainHost||F&&F.domainHost)&&x===!1&&I(k.host))try{k.host=URL.domainToASCII(k.host.toLowerCase())}catch(B){k.error=k.error||"Host's domain name can not be converted to ASCII: "+B}}if(!F||F&&!F.skipNormalize){if(T&&k.scheme!==void 0)k.scheme=unescape(k.scheme);if(T&&k.host!==void 0)k.host=unescape(k.host);if(k.path)k.path=escape(unescape(k.path));if(k.fragment)k.fragment=encodeURI(decodeURIComponent(k.fragment))}if(F&&F.parse)F.parse(k,m)}else k.error=k.error||"URI can not be parsed.";return k}var o={SCHEMES:h,normalize:c,resolve:d,resolveComponents:E,equal:l,serialize:u,parse:R};e.exports=o,e.exports.default=o,e.exports.fastUri=o}),Zy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=by();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),gy=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=Ws();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var s=ut();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=$3(),a=zs(),n=Bh(),i=tr(),h=ut(),c=Gs(),d=fs(),E=xt(),l=Iy(),u=Zy(),f=(Z,L)=>new RegExp(Z,L);f.code="new RegExp";var I=["removeAdditional","useDefaults","coerceTypes"],v=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."},o={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function y(Z){var L,V,S,b,P,X,at,lt,rt,Pt,C0,A,j,D,et,st,mt,Wt,$t,Gt,zt,Vt,E0,e0,Ge;let L0=Z.strict,A0=(L=Z.code)===null||L===void 0?void 0:L.optimize,We=A0===!0||A0===void 0?1:A0||0,za=(S=(V=Z.code)===null||V===void 0?void 0:V.regExp)!==null&&S!==void 0?S:f,iy=(b=Z.uriResolver)!==null&&b!==void 0?b:u.default;return{strictSchema:(X=(P=Z.strictSchema)!==null&&P!==void 0?P:L0)!==null&&X!==void 0?X:!0,strictNumbers:(lt=(at=Z.strictNumbers)!==null&&at!==void 0?at:L0)!==null&&lt!==void 0?lt:!0,strictTypes:(Pt=(rt=Z.strictTypes)!==null&&rt!==void 0?rt:L0)!==null&&Pt!==void 0?Pt:"log",strictTuples:(A=(C0=Z.strictTuples)!==null&&C0!==void 0?C0:L0)!==null&&A!==void 0?A:"log",strictRequired:(D=(j=Z.strictRequired)!==null&&j!==void 0?j:L0)!==null&&D!==void 0?D:!1,code:Z.code?{...Z.code,optimize:We,regExp:za}:{optimize:We,regExp:za},loopRequired:(et=Z.loopRequired)!==null&&et!==void 0?et:p,loopEnum:(st=Z.loopEnum)!==null&&st!==void 0?st:p,meta:(mt=Z.meta)!==null&&mt!==void 0?mt:!0,messages:(Wt=Z.messages)!==null&&Wt!==void 0?Wt:!0,inlineRefs:($t=Z.inlineRefs)!==null&&$t!==void 0?$t:!0,schemaId:(Gt=Z.schemaId)!==null&&Gt!==void 0?Gt:"$id",addUsedSchema:(zt=Z.addUsedSchema)!==null&&zt!==void 0?zt:!0,validateSchema:(Vt=Z.validateSchema)!==null&&Vt!==void 0?Vt:!0,validateFormats:(E0=Z.validateFormats)!==null&&E0!==void 0?E0:!0,unicodeRegExp:(e0=Z.unicodeRegExp)!==null&&e0!==void 0?e0:!0,int32range:(Ge=Z.int32range)!==null&&Ge!==void 0?Ge:!0,uriResolver:iy}}class m{constructor(Z={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,Z=this.opts={...Z,...y(Z)};let{es5:L,lines:V}=this.opts.code;this.scope=new h.ValueScope({scope:{},prefixes:v,es5:L,lines:V}),this.logger=N(Z.logger);let S=Z.validateFormats;if(Z.validateFormats=!1,this.RULES=(0,n.getRules)(),k.call(this,R,Z,"NOT SUPPORTED"),k.call(this,o,Z,"DEPRECATED","warn"),this._metaOpts=B.call(this),Z.formats)C.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Z.keywords)F.call(this,Z.keywords);if(typeof Z.meta=="object")this.addMetaSchema(Z.meta);x.call(this),Z.validateFormats=S}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Z,meta:L,schemaId:V}=this.opts,S=l;if(V==="id")S={...l},S.id=S.$id,delete S.$id;if(L&&Z)this.addMetaSchema(S,S[V],!1)}defaultMeta(){let{meta:Z,schemaId:L}=this.opts;return this.opts.defaultMeta=typeof Z=="object"?Z[L]||Z:void 0}validate(Z,L){let V;if(typeof Z=="string"){if(V=this.getSchema(Z),!V)throw Error(`no schema with key or ref "${Z}"`)}else V=this.compile(Z);let S=V(L);if(!("$async"in V))this.errors=V.errors;return S}compile(Z,L){let V=this._addSchema(Z,L);return V.validate||this._compileSchemaEnv(V)}compileAsync(Z,L){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return S.call(this,Z,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 lt.call(this,rt);if(!this.refs[rt])await b.call(this,Pt.$schema);if(!this.refs[rt])this.addSchema(Pt,rt,L)}async function lt(rt){let Pt=this._loading[rt];if(Pt)return Pt;try{return await(this._loading[rt]=V(rt))}finally{delete this._loading[rt]}}}addSchema(Z,L,V,S=this.opts.validateSchema){if(Array.isArray(Z)){for(let P of Z)this.addSchema(P,void 0,V,S);return this}let b;if(typeof Z==="object"){let{schemaId:P}=this.opts;if(b=Z[P],b!==void 0&&typeof b!="string")throw Error(`schema ${P} must be string`)}return L=(0,c.normalizeId)(L||b),this._checkUnique(L),this.schemas[L]=this._addSchema(Z,V,L,S,!0),this}addMetaSchema(Z,L,V=this.opts.validateSchema){return this.addSchema(Z,L,!0,V),this}validateSchema(Z,L){if(typeof Z=="boolean")return!0;let V;if(V=Z.$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,Z);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(Z){let L;while(typeof(L=T.call(this,Z))=="string")Z=L;if(L===void 0){let{schemaId:V}=this.opts,S=new i.SchemaEnv({schema:{},schemaId:V});if(L=i.resolveSchema.call(this,S,Z),!L)return;this.refs[Z]=L}return L.validate||this._compileSchemaEnv(L)}removeSchema(Z){if(Z instanceof RegExp)return this._removeAllSchemas(this.schemas,Z),this._removeAllSchemas(this.refs,Z),this;switch(typeof Z){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let L=T.call(this,Z);if(typeof L=="object")this._cache.delete(L.schema);return delete this.schemas[Z],delete this.refs[Z],this}case"object":{let L=Z;this._cache.delete(L);let V=Z[this.opts.schemaId];if(V)V=(0,c.normalizeId)(V),delete this.schemas[V],delete this.refs[V];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Z){for(let L of Z)this.addKeyword(L);return this}addKeyword(Z,L){let V;if(typeof Z=="string"){if(V=Z,typeof L=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),L.keyword=V}else if(typeof Z=="object"&&L===void 0){if(L=Z,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,E.eachItem)(V,(b)=>K.call(this,b)),this;Ot.call(this,L);let S={...L,type:(0,d.getJSONTypes)(L.type),schemaType:(0,d.getJSONTypes)(L.schemaType)};return(0,E.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(Z){let L=this.RULES.all[Z];return typeof L=="object"?L.definition:!!L}removeKeyword(Z){let{RULES:L}=this;delete L.keywords[Z],delete L.all[Z];for(let V of L.rules){let S=V.rules.findIndex((b)=>b.keyword===Z);if(S>=0)V.rules.splice(S,1)}return this}addFormat(Z,L){if(typeof L=="string")L=new RegExp(L);return this.formats[Z]=L,this}errorsText(Z=this.errors,{separator:L=", ",dataVar:V="data"}={}){if(!Z||Z.length===0)return"No errors";return Z.map((S)=>`${V}${S.instancePath} ${S.message}`).reduce((S,b)=>S+L+b)}$dataMetaSchema(Z,L){let V=this.RULES.all;Z=JSON.parse(JSON.stringify(Z));for(let S of L){let b=S.split("/").slice(1),P=Z;for(let X of b)P=P[X];for(let X in V){let at=V[X];if(typeof at!="object")continue;let{$data:lt}=at.definition,rt=P[X];if(lt&&rt)P[X]=St(rt)}}return Z}_removeAllSchemas(Z,L){for(let V in Z){let S=Z[V];if(!L||L.test(V)){if(typeof S=="string")delete Z[V];else if(S&&!S.meta)this._cache.delete(S.schema),delete Z[V]}}}_addSchema(Z,L,V,S=this.opts.validateSchema,b=this.opts.addUsedSchema){let P,{schemaId:X}=this.opts;if(typeof Z=="object")P=Z[X];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Z!="boolean")throw Error("schema must be object or boolean");let at=this._cache.get(Z);if(at!==void 0)return at;V=(0,c.normalizeId)(P||V);let lt=c.getSchemaRefs.call(this,Z,V);if(at=new i.SchemaEnv({schema:Z,schemaId:X,meta:L,baseId:V,localRefs:lt}),this._cache.set(at.schema,at),b&&!V.startsWith("#")){if(V)this._checkUnique(V);this.refs[V]=at}if(S)this.validateSchema(Z,!0);return at}_checkUnique(Z){if(this.schemas[Z]||this.refs[Z])throw Error(`schema with key or id "${Z}" already exists`)}_compileSchemaEnv(Z){if(Z.meta)this._compileMetaSchema(Z);else i.compileSchema.call(this,Z);if(!Z.validate)throw Error("ajv implementation error");return Z.validate}_compileMetaSchema(Z){let L=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,Z)}finally{this.opts=L}}}m.ValidationError=r.default,m.MissingRefError=a.default,t.default=m;function k(Z,L,V,S="error"){for(let b in Z){let P=b;if(P in L)this.logger[S](`${V}: option ${b}. ${Z[P]}`)}}function T(Z){return Z=(0,c.normalizeId)(Z),this.schemas[Z]||this.refs[Z]}function x(){let Z=this.opts.schemas;if(!Z)return;if(Array.isArray(Z))this.addSchema(Z);else for(let L in Z)this.addSchema(Z[L],L)}function C(){for(let Z in this.opts.formats){let L=this.opts.formats[Z];if(L)this.addFormat(Z,L)}}function F(Z){if(Array.isArray(Z)){this.addVocabulary(Z);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let L in Z){let V=Z[L];if(!V.keyword)V.keyword=L;this.addKeyword(V)}}function B(){let Z={...this.opts};for(let L of I)delete Z[L];return Z}var _={log(){},warn(){},error(){}};function N(Z){if(Z===!1)return _;if(Z===void 0)return console;if(Z.log&&Z.warn&&Z.error)return Z;throw Error("logger must implement log, warn and error methods")}var O=/^[a-z_$][a-z0-9_$:-]*$/i;function z(Z,L){let{RULES:V}=this;if((0,E.eachItem)(Z,(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(Z,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:lt})=>lt===V);if(!X)X={type:V,rules:[]},P.rules.push(X);if(P.keywords[Z]=!0,!L)return;let at={keyword:Z,definition:{...L,type:(0,d.getJSONTypes)(L.type),schemaType:(0,d.getJSONTypes)(L.schemaType)}};if(L.before)Mt.call(this,X,at,L.before);else X.rules.push(at);P.all[Z]=at,(S=L.implements)===null||S===void 0||S.forEach((lt)=>this.addKeyword(lt))}function Mt(Z,L,V){let S=Z.rules.findIndex((b)=>b.keyword===V);if(S>=0)Z.rules.splice(S,0,L);else Z.rules.push(L),this.logger.warn(`rule ${V} is not defined`)}function Ot(Z){let{metaSchema:L}=Z;if(L===void 0)return;if(Z.$data&&this.opts.$data)L=St(L);Z.validateSchema=this.compile(L,!0)}var Ut={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function St(Z){return{anyOf:[Z,Ut]}}}),Fy=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}),My=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=zs(),s=M0(),r=ut(),a=$0(),n=tr(),i=xt(),h={keyword:"$ref",schemaType:"string",code(E){let{gen:l,schema:u,it:f}=E,{baseId:I,schemaEnv:v,validateName:R,opts:o,self:p}=f,{root:y}=v;if((u==="#"||u==="#/")&&I===y.baseId)return k();let m=n.resolveRef.call(p,y,I,u);if(m===void 0)throw new e.default(f.opts.uriResolver,I,u);if(m instanceof n.SchemaEnv)return T(m);return x(m);function k(){if(v===y)return d(E,R,v,v.$async);let C=l.scopeValue("root",{ref:y});return d(E,r._`${C}.validate`,y,y.$async)}function T(C){let F=c(E,C);d(E,F,C,C.$async)}function x(C){let F=l.scopeValue("schema",o.code.source===!0?{ref:C,code:(0,r.stringify)(C)}:{ref:C}),B=l.name("valid"),_=E.subschema({schema:C,dataTypes:[],schemaPath:r.nil,topSchemaRef:F,errSchemaPath:u},B);E.mergeEvaluated(_),E.ok(B)}}};function c(E,l){let{gen:u}=E;return l.validate?u.scopeValue("validate",{ref:l.validate}):r._`${u.scopeValue("wrapper",{ref:l})}.validate`}t.getValidate=c;function d(E,l,u,f){let{gen:I,it:v}=E,{allErrors:R,schemaEnv:o,opts:p}=v,y=p.passContext?a.default.this:r.nil;if(f)m();else k();function m(){if(!o.$async)throw Error("async schema referenced by sync schema");let C=I.let("valid");I.try(()=>{if(I.code(r._`await ${(0,s.callValidateCode)(E,l,y)}`),x(l),!R)I.assign(C,!0)},(F)=>{if(I.if(r._`!(${F} instanceof ${v.ValidationError})`,()=>I.throw(F)),T(F),!R)I.assign(C,!1)}),E.ok(C)}function k(){E.result((0,s.callValidateCode)(E,l,y),()=>x(l),()=>T(l))}function T(C){let F=r._`${C}.errors`;I.assign(a.default.vErrors,r._`${a.default.vErrors} === null ? ${F} : ${a.default.vErrors}.concat(${F})`),I.assign(a.default.errors,r._`${a.default.vErrors}.length`)}function x(C){var F;if(!v.opts.unevaluated)return;let B=(F=u===null||u===void 0?void 0:u.validate)===null||F===void 0?void 0:F.evaluated;if(v.props!==!0)if(B&&!B.dynamicProps){if(B.props!==void 0)v.props=i.mergeEvaluated.props(I,B.props,v.props)}else{let _=I.var("props",r._`${C}.evaluated.props`);v.props=i.mergeEvaluated.props(I,_,v.props,r.Name)}if(v.items!==!0)if(B&&!B.dynamicItems){if(B.items!==void 0)v.items=i.mergeEvaluated.items(I,B.items,v.items)}else{let _=I.var("items",r._`${C}.evaluated.items`);v.items=i.mergeEvaluated.items(I,_,v.items,r.Name)}}}t.callRef=d,t.default=h}),Py=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fy(),s=My(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,s.default];t.default=r}),Ly=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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:c,schemaCode:d}=i;i.fail$data(e._`${c} ${r[h].fail} ${d} || isNaN(${c})`)}};t.default=n}),jy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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:c}=a,d=c.opts.multipleOfPrecision,E=n.let("res"),l=d?e._`Math.abs(Math.round(${E}) - ${E}) > 1e-${d}`:e._`${E} !== parseInt(${E})`;a.fail$data(e._`(${h} === 0 || (${E} = ${i}/${h}, ${l}))`)}};t.default=r}),qy=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'}),_y=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),s=xt(),r=qy(),a={message({keyword:i,schemaCode:h}){let c=i==="maxLength"?"more":"fewer";return e.str`must NOT have ${c} 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:c,schemaCode:d,it:E}=i,l=h==="maxLength"?e.operators.GT:e.operators.LT,u=E.opts.unicode===!1?e._`${c}.length`:e._`${(0,s.useFunc)(i.gen,r.default)}(${c})`;i.fail$data(e._`${u} ${l} ${d}`)}};t.default=n}),Dy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=M0(),s=xt(),r=ut(),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:c,$data:d,schema:E,schemaCode:l,it:u}=i,f=u.opts.unicodeRegExp?"u":"";if(d){let{regExp:I}=u.opts.code,v=I.code==="new RegExp"?r._`new RegExp`:(0,s.useFunc)(h,I),R=h.let("valid");h.try(()=>h.assign(R,r._`${v}(${l}, ${f}).test(${c})`),()=>h.assign(R,!1)),i.fail$data(r._`!${R}`)}else{let I=(0,e.usePattern)(i,E);i.fail$data(r._`!${I}.test(${c})`)}}};t.default=n}),By=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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,c=n==="maxProperties"?e.operators.GT:e.operators.LT;a.fail$data(e._`Object.keys(${i}).length ${c} ${h}`)}};t.default=r}),Vy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=M0(),s=ut(),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:c,schemaCode:d,data:E,$data:l,it:u}=i,{opts:f}=u;if(!l&&c.length===0)return;let I=c.length>=f.loopRequired;if(u.allErrors)v();else R();if(f.strictRequired){let y=i.parentSchema.properties,{definedProperties:m}=i.it;for(let k of c)if((y===null||y===void 0?void 0:y[k])===void 0&&!m.has(k)){let T=u.schemaEnv.baseId+u.errSchemaPath,x=`required property "${k}" is not defined at "${T}" (strictRequired)`;(0,r.checkStrictMode)(u,x,u.opts.strictRequired)}}function v(){if(I||l)i.block$data(s.nil,o);else for(let y of c)(0,e.checkReportMissingProp)(i,y)}function R(){let y=h.let("missing");if(I||l){let m=h.let("valid",!0);i.block$data(m,()=>p(y,m)),i.ok(m)}else h.if((0,e.checkMissingProp)(i,c,y)),(0,e.reportMissingProp)(i,y),h.else()}function o(){h.forOf("prop",d,(y)=>{i.setParams({missingProperty:y}),h.if((0,e.noPropertyInData)(h,E,y,f.ownProperties),()=>i.error())})}function p(y,m){i.setParams({missingProperty:y}),h.forOf(y,d,()=>{h.assign(m,(0,e.propertyInData)(h,E,y,f.ownProperties)),h.if((0,s.not)(m),()=>{i.error(),h.break()})},s.nil)}}};t.default=n}),Ny=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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,c=n==="maxItems"?e.operators.GT:e.operators.LT;a.fail$data(e._`${i}.length ${c} ${h}`)}};t.default=r}),er=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Nh();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),wy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=fs(),s=ut(),r=xt(),a=er(),n={message:({params:{i:h,j:c}})=>s.str`must NOT have duplicate items (items ## ${c} and ${h} are identical)`,params:({params:{i:h,j:c}})=>s._`{i: ${h}, j: ${c}}`},i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:n,code(h){let{gen:c,data:d,$data:E,schema:l,parentSchema:u,schemaCode:f,it:I}=h;if(!E&&!l)return;let v=c.let("valid"),R=u.items?(0,e.getSchemaTypes)(u.items):[];h.block$data(v,o,s._`${f} === false`),h.ok(v);function o(){let k=c.let("i",s._`${d}.length`),T=c.let("j");h.setParams({i:k,j:T}),c.assign(v,!0),c.if(s._`${k} > 1`,()=>(p()?y:m)(k,T))}function p(){return R.length>0&&!R.some((k)=>k==="object"||k==="array")}function y(k,T){let x=c.name("item"),C=(0,e.checkDataTypes)(R,x,I.opts.strictNumbers,e.DataType.Wrong),F=c.const("indices",s._`{}`);c.for(s._`;${k}--;`,()=>{if(c.let(x,s._`${d}[${k}]`),c.if(C,s._`continue`),R.length>1)c.if(s._`typeof ${x} == "string"`,s._`${x} += "_"`);c.if(s._`typeof ${F}[${x}] == "number"`,()=>{c.assign(T,s._`${F}[${x}]`),h.error(),c.assign(v,!1).break()}).code(s._`${F}[${x}] = ${k}`)})}function m(k,T){let x=(0,r.useFunc)(c,a.default),C=c.name("outer");c.label(C).for(s._`;${k}--;`,()=>c.for(s._`${T} = ${k}; ${T}--;`,()=>c.if(s._`${x}(${d}[${k}], ${d}[${T}])`,()=>{h.error(),c.assign(v,!1).break(C)})))}}};t.default=i}),Ky=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),s=xt(),r=er(),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:c,$data:d,schemaCode:E,schema:l}=i;if(d||l&&typeof l=="object")i.fail$data(e._`!${(0,s.useFunc)(h,r.default)}(${c}, ${E})`);else i.fail(e._`${l} !== ${c}`)}};t.default=n}),Hy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),s=xt(),r=er(),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:c,$data:d,schema:E,schemaCode:l,it:u}=i;if(!d&&E.length===0)throw Error("enum must have non-empty array");let f=E.length>=u.opts.loopEnum,I,v=()=>I!==null&&I!==void 0?I:I=(0,s.useFunc)(h,r.default),R;if(f||d)R=h.let("valid"),i.block$data(R,o);else{if(!Array.isArray(E))throw Error("ajv implementation error");let y=h.const("vSchema",l);R=(0,e.or)(...E.map((m,k)=>p(y,k)))}i.pass(R);function o(){h.assign(R,!1),h.forOf("v",l,(y)=>h.if(e._`${v()}(${c}, ${y})`,()=>h.assign(R,!0).break()))}function p(y,m){let k=E[m];return typeof k==="object"&&k!==null?e._`${v()}(${c}, ${y}[${m}])`:e._`${c} === ${k}`}}};t.default=n}),Oy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ly(),s=jy(),r=_y(),a=Dy(),n=By(),i=Vy(),h=Ny(),c=wy(),d=Ky(),E=Hy(),l=[e.default,s.default,r.default,a.default,n.default,i.default,h.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,E.default];t.default=l}),wh=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=ut(),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:c}=i,{items:d}=h;if(!Array.isArray(d)){(0,s.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(i,d)}};function n(i,h){let{gen:c,schema:d,data:E,keyword:l,it:u}=i;u.items=!0;let f=c.const("len",e._`${E}.length`);if(d===!1)i.setParams({len:h.length}),i.pass(e._`${f} <= ${h.length}`);else if(typeof d=="object"&&!(0,s.alwaysValidSchema)(u,d)){let v=c.var("valid",e._`${f} <= ${h.length}`);c.if((0,e.not)(v),()=>I(v)),i.ok(v)}function I(v){c.forRange("i",h.length,f,(R)=>{if(i.subschema({keyword:l,dataProp:R,dataPropType:s.Type.Num},v),!u.allErrors)c.if((0,e.not)(v),()=>c.break())})}}t.validateAdditionalItems=n,t.default=a}),Kh=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=ut(),s=xt(),r=M0(),a={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:h,it:c}=i;if(Array.isArray(h))return n(i,"additionalItems",h);if(c.items=!0,(0,s.alwaysValidSchema)(c,h))return;i.ok((0,r.validateArray)(i))}};function n(i,h,c=i.schema){let{gen:d,parentSchema:E,data:l,keyword:u,it:f}=i;if(R(E),f.opts.unevaluated&&c.length&&f.items!==!0)f.items=s.mergeEvaluated.items(d,c.length,f.items);let I=d.name("valid"),v=d.const("len",e._`${l}.length`);c.forEach((o,p)=>{if((0,s.alwaysValidSchema)(f,o))return;d.if(e._`${v} > ${p}`,()=>i.subschema({keyword:u,schemaProp:p,dataProp:p},I)),i.ok(I)});function R(o){let{opts:p,errSchemaPath:y}=f,m=c.length,k=m===o.minItems&&(m===o.maxItems||o[h]===!1);if(p.strictTuples&&!k){let T=`"${u}" is ${m}-tuple, but minItems or maxItems/${h} are not specified or different at path "${y}"`;(0,s.checkStrictMode)(f,T,p.strictTuples)}}}t.validateTuple=n,t.default=a}),Uy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Kh(),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(r)=>(0,e.validateTuple)(r,"items")};t.default=s}),Gy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),s=xt(),r=M0(),a=wh(),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:c,parentSchema:d,it:E}=h,{prefixItems:l}=d;if(E.items=!0,(0,s.alwaysValidSchema)(E,c))return;if(l)(0,a.validateAdditionalItems)(h,l);else h.ok((0,r.validateArray)(h))}};t.default=i}),Wy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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:c,data:d,it:E}=n,l,u,{minContains:f,maxContains:I}=c;if(E.opts.next)l=f===void 0?1:f,u=I;else l=1;let v=i.const("len",e._`${d}.length`);if(n.setParams({min:l,max:u}),u===void 0&&l===0){(0,s.checkStrictMode)(E,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&l>u){(0,s.checkStrictMode)(E,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,s.alwaysValidSchema)(E,h)){let m=e._`${v} >= ${l}`;if(u!==void 0)m=e._`${m} && ${v} <= ${u}`;n.pass(m);return}E.items=!0;let R=i.name("valid");if(u===void 0&&l===1)p(R,()=>i.if(R,()=>i.break()));else if(l===0){if(i.let(R,!0),u!==void 0)i.if(e._`${d}.length > 0`,o)}else i.let(R,!1),o();n.result(R,()=>n.reset());function o(){let m=i.name("_valid"),k=i.let("count",0);p(m,()=>i.if(m,()=>y(k)))}function p(m,k){i.forRange("i",0,v,(T)=>{n.subschema({keyword:"contains",dataProp:T,dataPropType:s.Type.Num,compositeRule:!0},m),k()})}function y(m){if(i.code(e._`${m}++`),u===void 0)i.if(e._`${m} >= ${l}`,()=>i.assign(R,!0).break());else if(i.if(e._`${m} > ${u}`,()=>i.assign(R,!1).break()),l===1)i.assign(R,!0);else i.if(e._`${m} >= ${l}`,()=>i.assign(R,!0))}}};t.default=a}),zy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=ut(),s=xt(),r=M0();t.error={message:({params:{property:c,depsCount:d,deps:E}})=>{let l=d===1?"property":"properties";return e.str`must have ${l} ${E} when property ${c} is present`},params:({params:{property:c,depsCount:d,deps:E,missingProperty:l}})=>e._`{property: ${c},
7
+ missingProperty: ${l},
8
+ depsCount: ${d},
9
+ deps: ${E}}`};var a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){let[d,E]=n(c);i(c,d),h(c,E)}};function n({schema:c}){let d={},E={};for(let l in c){if(l==="__proto__")continue;let u=Array.isArray(c[l])?d:E;u[l]=c[l]}return[d,E]}function i(c,d=c.schema){let{gen:E,data:l,it:u}=c;if(Object.keys(d).length===0)return;let f=E.let("missing");for(let I in d){let v=d[I];if(v.length===0)continue;let R=(0,r.propertyInData)(E,l,I,u.opts.ownProperties);if(c.setParams({property:I,depsCount:v.length,deps:v.join(", ")}),u.allErrors)E.if(R,()=>{for(let o of v)(0,r.checkReportMissingProp)(c,o)});else E.if(e._`${R} && (${(0,r.checkMissingProp)(c,v,f)})`),(0,r.reportMissingProp)(c,f),E.else()}}t.validatePropertyDeps=i;function h(c,d=c.schema){let{gen:E,data:l,keyword:u,it:f}=c,I=E.name("valid");for(let v in d){if((0,s.alwaysValidSchema)(f,d[v]))continue;E.if((0,r.propertyInData)(E,l,v,f.opts.ownProperties),()=>{let R=c.subschema({keyword:u,schemaProp:v},I);c.mergeValidEvaluated(R,I)},()=>E.var(I,!0)),c.ok(I)}}t.validateSchemaDeps=h,t.default=a}),Qy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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:c,it:d}=n;if((0,s.alwaysValidSchema)(d,h))return;let E=i.name("valid");i.forIn("key",c,(l)=>{n.setParams({propertyName:l}),n.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},E),i.if((0,e.not)(E),()=>{if(n.error(!0),!d.allErrors)i.break()})}),n.ok(E)}};t.default=a}),Hh=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=M0(),s=ut(),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:c,schema:d,parentSchema:E,data:l,errsCount:u,it:f}=h;if(!u)throw Error("ajv implementation error");let{allErrors:I,opts:v}=f;if(f.props=!0,v.removeAdditional!=="all"&&(0,a.alwaysValidSchema)(f,d))return;let R=(0,e.allSchemaProperties)(E.properties),o=(0,e.allSchemaProperties)(E.patternProperties);p(),h.ok(s._`${u} === ${r.default.errors}`);function p(){c.forIn("key",l,(x)=>{if(!R.length&&!o.length)k(x);else c.if(y(x),()=>k(x))})}function y(x){let C;if(R.length>8){let F=(0,a.schemaRefOrVal)(f,E.properties,"properties");C=(0,e.isOwnProperty)(c,F,x)}else if(R.length)C=(0,s.or)(...R.map((F)=>s._`${x} === ${F}`));else C=s.nil;if(o.length)C=(0,s.or)(C,...o.map((F)=>s._`${(0,e.usePattern)(h,F)}.test(${x})`));return(0,s.not)(C)}function m(x){c.code(s._`delete ${l}[${x}]`)}function k(x){if(v.removeAdditional==="all"||v.removeAdditional&&d===!1){m(x);return}if(d===!1){if(h.setParams({additionalProperty:x}),h.error(),!I)c.break();return}if(typeof d=="object"&&!(0,a.alwaysValidSchema)(f,d)){let C=c.name("valid");if(v.removeAdditional==="failing")T(x,C,!1),c.if((0,s.not)(C),()=>{h.reset(),m(x)});else if(T(x,C),!I)c.if((0,s.not)(C),()=>c.break())}}function T(x,C,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,C)}}};t.default=i}),Jy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ws(),s=M0(),r=xt(),a=Hh(),n={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:h,schema:c,parentSchema:d,data:E,it:l}=i;if(l.opts.removeAdditional==="all"&&d.additionalProperties===void 0)a.default.code(new e.KeywordCxt(l,a.default,"additionalProperties"));let u=(0,s.allSchemaProperties)(c);for(let o of u)l.definedProperties.add(o);if(l.opts.unevaluated&&u.length&&l.props!==!0)l.props=r.mergeEvaluated.props(h,(0,r.toHash)(u),l.props);let f=u.filter((o)=>!(0,r.alwaysValidSchema)(l,c[o]));if(f.length===0)return;let I=h.name("valid");for(let o of f){if(v(o))R(o);else{if(h.if((0,s.propertyInData)(h,E,o,l.opts.ownProperties)),R(o),!l.allErrors)h.else().var(I,!0);h.endIf()}i.it.definedProperties.add(o),i.ok(I)}function v(o){return l.opts.useDefaults&&!l.compositeRule&&c[o].default!==void 0}function R(o){i.subschema({keyword:"properties",schemaProp:o,dataProp:o},I)}}};t.default=n}),Yy=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=M0(),s=ut(),r=xt(),a=xt(),n={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:h,schema:c,data:d,parentSchema:E,it:l}=i,{opts:u}=l,f=(0,e.allSchemaProperties)(c),I=f.filter((k)=>(0,r.alwaysValidSchema)(l,c[k]));if(f.length===0||I.length===f.length&&(!l.opts.unevaluated||l.props===!0))return;let v=u.strictSchema&&!u.allowMatchingProperties&&E.properties,R=h.name("valid");if(l.props!==!0&&!(l.props instanceof s.Name))l.props=(0,a.evaluatedPropsToName)(h,l.props);let{props:o}=l;p();function p(){for(let k of f){if(v)y(k);if(l.allErrors)m(k);else h.var(R,!0),m(k),h.if(R)}}function y(k){for(let T in v)if(new RegExp(k).test(T))(0,r.checkStrictMode)(l,`property ${T} matches pattern ${k} (use allowMatchingProperties)`)}function m(k){h.forIn("key",d,(T)=>{h.if(s._`${(0,e.usePattern)(i,k)}.test(${T})`,()=>{let x=I.includes(k);if(!x)i.subschema({keyword:"patternProperties",schemaProp:k,dataProp:T,dataPropType:a.Type.Str},R);if(l.opts.unevaluated&&o!==!0)h.assign(s._`${o}[${T}]`,!0);else if(!x&&!l.allErrors)h.if((0,s.not)(R),()=>h.break())})})}}};t.default=n}),Xy=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}),$y=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=M0(),s={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=s}),t8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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:c,it:d}=n;if(!Array.isArray(h))throw Error("ajv implementation error");if(d.opts.discriminator&&c.discriminator)return;let E=h,l=i.let("valid",!1),u=i.let("passing",null),f=i.name("_valid");n.setParams({passing:u}),i.block(I),n.result(l,()=>n.reset(),()=>n.error(!0));function I(){E.forEach((v,R)=>{let o;if((0,s.alwaysValidSchema)(d,v))i.var(f,!0);else o=n.subschema({keyword:"oneOf",schemaProp:R,compositeRule:!0},f);if(R>0)i.if(e._`${f} && ${l}`).assign(l,!1).assign(u,e._`[${u}, ${R}]`).else();i.if(f,()=>{if(i.assign(l,!0),i.assign(u,R),o)n.mergeEvaluated(o,e.Name)})})}}};t.default=a}),e8=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((c,d)=>{if((0,e.alwaysValidSchema)(i,c))return;let E=r.subschema({keyword:"allOf",schemaProp:d},h);r.ok(h),r.mergeEvaluated(E)})}};t.default=s}),a8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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:c,it:d}=i;if(c.then===void 0&&c.else===void 0)(0,s.checkStrictMode)(d,'"if" without "then" and "else" is ignored');let E=n(d,"then"),l=n(d,"else");if(!E&&!l)return;let u=h.let("valid",!0),f=h.name("_valid");if(I(),i.reset(),E&&l){let R=h.let("ifClause");i.setParams({ifClause:R}),h.if(f,v("then",R),v("else",R))}else if(E)h.if(f,v("then"));else h.if((0,e.not)(f),v("else"));i.pass(u,()=>i.error(!0));function I(){let R=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},f);i.mergeEvaluated(R)}function v(R,o){return()=>{let p=i.subschema({keyword:R},f);if(h.assign(u,f),i.mergeValidEvaluated(p,u),o)h.assign(o,e._`${R}`);else i.setParams({ifClause:R})}}}};function n(i,h){let c=i.schema[h];return c!==void 0&&!(0,s.alwaysValidSchema)(i,c)}t.default=a}),s8=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}),r8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=wh(),s=Uy(),r=Kh(),a=Gy(),n=Wy(),i=zy(),h=Qy(),c=Hh(),d=Jy(),E=Yy(),l=Xy(),u=$y(),f=t8(),I=e8(),v=a8(),R=s8();function o(p=!1){let y=[l.default,u.default,f.default,I.default,v.default,R.default,h.default,c.default,i.default,d.default,E.default];if(p)y.push(s.default,a.default);else y.push(e.default,r.default);return y.push(n.default),y}t.default=o}),n8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),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:c,schema:d,schemaCode:E,it:l}=a,{opts:u,errSchemaPath:f,schemaEnv:I,self:v}=l;if(!u.validateFormats)return;if(c)R();else o();function R(){let p=i.scopeValue("formats",{ref:v.formats,code:u.code.formats}),y=i.const("fDef",e._`${p}[${E}]`),m=i.let("fType"),k=i.let("format");i.if(e._`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>i.assign(m,e._`${y}.type || "string"`).assign(k,e._`${y}.validate`),()=>i.assign(m,e._`"string"`).assign(k,y)),a.fail$data((0,e.or)(T(),x()));function T(){if(u.strictSchema===!1)return e.nil;return e._`${E} && !${k}`}function x(){let C=I.$async?e._`(${y}.async ? await ${k}(${h}) : ${k}(${h}))`:e._`${k}(${h})`,F=e._`(typeof ${k} == "function" ? ${C} : ${k}.test(${h}))`;return e._`${k} && ${k} !== true && ${m} === ${n} && !${F}`}}function o(){let p=v.formats[d];if(!p){T();return}if(p===!0)return;let[y,m,k]=x(p);if(y===n)a.pass(C());function T(){if(u.strictSchema===!1){v.logger.warn(F());return}throw Error(F());function F(){return`unknown format "${d}" ignored in schema at path "${f}"`}}function x(F){let B=F instanceof RegExp?(0,e.regexpCode)(F):u.code.formats?e._`${u.code.formats}${(0,e.getProperty)(d)}`:void 0,_=i.scopeValue("formats",{key:d,ref:F,code:B});if(typeof F=="object"&&!(F instanceof RegExp))return[F.type||"string",F.validate,e._`${_}.validate`];return["string",F,_]}function C(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!I.$async)throw Error("async format in sync schema");return e._`await ${k}(${h})`}return typeof m=="function"?e._`${k}(${h})`:e._`${k}.test(${h})`}}}};t.default=r}),i8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=n8(),s=[e.default];t.default=s}),h8=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"]}),c8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Py(),s=Oy(),r=r8(),a=i8(),n=h8(),i=[e.default,s.default,(0,r.default)(),a.default,n.metadataVocabulary,n.contentVocabulary];t.default=i}),d8=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={}))}),o8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ut(),s=d8(),r=tr(),a=zs(),n=xt(),i={message:({params:{discrError:c,tagName:d}})=>c===s.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:c,tag:d,tagName:E}})=>e._`{error: ${c}, tag: ${E}, tagValue: ${d}}`},h={keyword:"discriminator",type:"object",schemaType:"object",error:i,code(c){let{gen:d,data:E,schema:l,parentSchema:u,it:f}=c,{oneOf:I}=u;if(!f.opts.discriminator)throw Error("discriminator: requires discriminator option");let v=l.propertyName;if(typeof v!="string")throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!I)throw Error("discriminator: requires oneOf keyword");let R=d.let("valid",!1),o=d.const("tag",e._`${E}${(0,e.getProperty)(v)}`);d.if(e._`typeof ${o} == "string"`,()=>p(),()=>c.error(!1,{discrError:s.DiscrError.Tag,tag:o,tagName:v})),c.ok(R);function p(){let k=m();d.if(!1);for(let T in k)d.elseIf(e._`${o} === ${T}`),d.assign(R,y(k[T]));d.else(),c.error(!1,{discrError:s.DiscrError.Mapping,tag:o,tagName:v}),d.endIf()}function y(k){let T=d.name("valid"),x=c.subschema({keyword:"oneOf",schemaProp:k},T);return c.mergeEvaluated(x,e.Name),T}function m(){var k;let T={},x=F(u),C=!0;for(let N=0;N<I.length;N++){let O=I[N];if((O===null||O===void 0?void 0:O.$ref)&&!(0,n.schemaHasRulesButRef)(O,f.self.RULES)){let K=O.$ref;if(O=r.resolveRef.call(f.self,f.schemaEnv.root,f.baseId,K),O instanceof r.SchemaEnv)O=O.schema;if(O===void 0)throw new a.default(f.opts.uriResolver,f.baseId,K)}let z=(k=O===null||O===void 0?void 0:O.properties)===null||k===void 0?void 0:k[v];if(typeof z!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);C=C&&(x||F(O)),B(z,N)}if(!C)throw Error(`discriminator: "${v}" must be required`);return T;function F({required:N}){return Array.isArray(N)&&N.includes(v)}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/${v}" must have "const" or "enum"`)}function _(N,O){if(typeof N!="string"||N in T)throw Error(`discriminator: "${v}" values must be unique strings`);T[N]=O}}}};t.default=h}),y8=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}}),Oh=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=gy(),r=c8(),a=o8(),n=y8(),i=["/properties"],h="http://json-schema.org/draft-07/schema";class c extends s.default{_addVocabularies(){if(super._addVocabularies(),r.default.forEach((f)=>this.addVocabulary(f)),this.opts.discriminator)this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let f=this.opts.$data?this.$dataMetaSchema(n,i):n;this.addMetaSchema(f,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=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var d=Ws();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var E=ut();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return E._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return E.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return E.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return E.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return E.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return E.CodeGen}});var l=$3();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var u=zs();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return u.default}})}),m8=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(c(!0),d),"date-time":e(u(!0),f),"iso-time":e(c(),E),"iso-date-time":e(u(),I),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:o,"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:T},int64:{type:"number",validate:x},float:{type:"number",validate:C},double:{type:"number",validate:C},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,d),"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,f),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,E),"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,I),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 c(_){return function(N){let O=h.exec(N);if(!O)return!1;let z=+O[1],K=+O[2],Mt=+O[3],Ot=O[4],Ut=O[5]==="-"?-1:1,St=+(O[6]||0),Z=+(O[7]||0);if(St>23||Z>59||_&&!Ot)return!1;if(z<=23&&K<=59&&Mt<60)return!0;let L=K-Z*Ut,V=z-St*Ut-(L<0?1:0);return(V===23||V===-1)&&(L===59||L===-1)&&Mt<61}}function d(_,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 E(_,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 l=/t|\s/i;function u(_){let N=c(_);return function(O){let z=O.split(l);return z.length===2&&n(z[0])&&N(z[1])}}function f(_,N){if(!(_&&N))return;let O=new Date(_).valueOf(),z=new Date(N).valueOf();if(!(O&&z))return;return O-z}function I(_,N){if(!(_&&N))return;let[O,z]=_.split(l),[K,Mt]=N.split(l),Ot=i(O,K);if(Ot===void 0)return;return Ot||d(z,Mt)}var v=/\/|:/,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 o(_){return v.test(_)&&R.test(_)}var p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(_){return p.lastIndex=0,p.test(_)}var m=-2147483648,k=2147483647;function T(_){return Number.isInteger(_)&&_<=k&&_>=m}function x(_){return Number.isInteger(_)}function C(){return!0}var F=/[^\\]\\Z/;function B(_){if(F.test(_))return!1;try{return new RegExp(_),!0}catch(N){return!1}}}),u8=W((t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=Oh(),s=ut(),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:c})=>s.str`should be ${a[h].okStr} ${c}`,params:({keyword:h,schemaCode:c})=>s._`{comparison: ${a[h].okStr}, limit: ${c}}`};t.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:n,code(h){let{gen:c,data:d,schemaCode:E,keyword:l,it:u}=h,{opts:f,self:I}=u;if(!f.validateFormats)return;let v=new e.KeywordCxt(u,I.RULES.all.format.definition,"format");if(v.$data)R();else o();function R(){let y=c.scopeValue("formats",{ref:I.formats,code:f.code.formats}),m=c.const("fmt",s._`${y}[${v.schemaCode}]`);h.fail$data((0,s.or)(s._`typeof ${m} != "object"`,s._`${m} instanceof RegExp`,s._`typeof ${m}.compare != "function"`,p(m)))}function o(){let y=v.schema,m=I.formats[y];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw Error(`"${l}": format "${y}" does not define "compare" function`);let k=c.scopeValue("formats",{key:y,ref:m,code:f.code.formats?s._`${f.code.formats}${(0,s.getProperty)(y)}`:void 0});h.fail$data(p(k))}function p(y){return s._`${y}.compare(${d}, ${E}) ${a[l].fail} 0`}},dependencies:["format"]};var i=(h)=>{return h.addKeyword(t.formatLimitDefinition),h};t.default=i}),E8=W((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var s=m8(),r=u8(),a=ut(),n=new a.Name("fullFormats"),i=new a.Name("fastFormats"),h=(d,E={keywords:!0})=>{if(Array.isArray(E))return c(d,E,s.fullFormats,n),d;let[l,u]=E.mode==="fast"?[s.fastFormats,i]:[s.fullFormats,n],f=E.formats||s.formatNames;if(c(d,f,l,u),E.keywords)(0,r.default)(d);return d};h.get=(d,E="full")=>{let l=(E==="fast"?s.fastFormats:s.fullFormats)[d];if(!l)throw Error(`Unknown format "${d}"`);return l};function c(d,E,l,u){var f,I;(f=(I=d.opts.code).formats)!==null&&f!==void 0||(I.formats=a._`require("ajv-formats/dist/formats").${u}`);for(let v of E)d.addFormat(v,l[v])}e.exports=t=h,Object.defineProperty(t,"__esModule",{value:!0}),t.default=h}),T8=50;function Uh(t=T8){let e=new AbortController;return S8(t,e.signal),e}class j0 extends Error{}function Gh(){return process.versions.bun!==void 0}var R8=typeof global=="object"&&global&&global.Object===Object&&global,x8=R8,I8=typeof self=="object"&&self&&self.Object===Object&&self,v8=x8||I8||Function("return this")(),ar=v8,C8=ar.Symbol,Rs=C8,Wh=Object.prototype,A8=Wh.hasOwnProperty,b8=Wh.toString,ze=Rs?Rs.toStringTag:void 0;function Z8(t){var e=A8.call(t,ze),s=t[ze];try{t[ze]=void 0;var r=!0}catch(n){}var a=b8.call(t);if(r)if(e)t[ze]=s;else delete t[ze];return a}var g8=Z8,F8=Object.prototype,M8=F8.toString;function P8(t){return M8.call(t)}var L8=P8,j8="[object Null]",q8="[object Undefined]",Pi=Rs?Rs.toStringTag:void 0;function _8(t){if(t==null)return t===void 0?q8:j8;return Pi&&Pi in Object(t)?g8(t):L8(t)}var D8=_8;function B8(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var zh=B8,V8="[object AsyncFunction]",N8="[object Function]",w8="[object GeneratorFunction]",K8="[object Proxy]";function H8(t){if(!zh(t))return!1;var e=D8(t);return e==N8||e==w8||e==V8||e==K8}var O8=H8,U8=ar["__core-js_shared__"],A3=U8,Li=function(){var t=/[^.]+$/.exec(A3&&A3.keys&&A3.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function G8(t){return!!Li&&Li in t}var W8=G8,z8=Function.prototype,Q8=z8.toString;function J8(t){if(t!=null){try{return Q8.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var Y8=J8,X8=/[\\^$.*+?()[\]{}|]/g,$8=/^\[object .+?Constructor\]$/,tm=Function.prototype,em=Object.prototype,am=tm.toString,sm=em.hasOwnProperty,rm=RegExp("^"+am.call(sm).replace(X8,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nm(t){if(!zh(t)||W8(t))return!1;var e=O8(t)?rm:$8;return e.test(Y8(t))}var im=nm;function hm(t,e){return t==null?void 0:t[e]}var cm=hm;function dm(t,e){var s=cm(t,e);return im(s)?s:void 0}var Qh=dm,om=Qh(Object,"create"),Sa=om;function ym(){this.__data__=Sa?Sa(null):{},this.size=0}var mm=ym;function um(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Em=um,pm="__lodash_hash_undefined__",lm=Object.prototype,Sm=lm.hasOwnProperty;function Tm(t){var e=this.__data__;if(Sa){var s=e[t];return s===pm?void 0:s}return Sm.call(e,t)?e[t]:void 0}var km=Tm,fm=Object.prototype,Rm=fm.hasOwnProperty;function xm(t){var e=this.__data__;return Sa?e[t]!==void 0:Rm.call(e,t)}var Im=xm,vm="__lodash_hash_undefined__";function Cm(t,e){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=Sa&&e===void 0?vm:e,this}var Am=Cm;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=mm;Be.prototype.delete=Em;Be.prototype.get=km;Be.prototype.has=Im;Be.prototype.set=Am;var ji=Be;function bm(){this.__data__=[],this.size=0}var Zm=bm;function gm(t,e){return t===e||t!==t&&e!==e}var Fm=gm;function Mm(t,e){var s=t.length;while(s--)if(Fm(t[s][0],e))return s;return-1}var Qs=Mm,Pm=Array.prototype,Lm=Pm.splice;function jm(t){var e=this.__data__,s=Qs(e,t);if(s<0)return!1;var r=e.length-1;if(s==r)e.pop();else Lm.call(e,s,1);return--this.size,!0}var qm=jm;function _m(t){var e=this.__data__,s=Qs(e,t);return s<0?void 0:e[s][1]}var Dm=_m;function Bm(t){return Qs(this.__data__,t)>-1}var Vm=Bm;function Nm(t,e){var s=this.__data__,r=Qs(s,t);if(r<0)++this.size,s.push([t,e]);else s[r][1]=e;return this}var wm=Nm;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=Zm;Ve.prototype.delete=qm;Ve.prototype.get=Dm;Ve.prototype.has=Vm;Ve.prototype.set=wm;var Km=Ve,Hm=Qh(ar,"Map"),Om=Hm;function Um(){this.size=0,this.__data__={hash:new ji,map:new(Om||Km),string:new ji}}var Gm=Um;function Wm(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var zm=Wm;function Qm(t,e){var s=t.__data__;return zm(e)?s[typeof e=="string"?"string":"hash"]:s.map}var Js=Qm;function Jm(t){var e=Js(this,t).delete(t);return this.size-=e?1:0,e}var Ym=Jm;function Xm(t){return Js(this,t).get(t)}var $m=Xm;function tu(t){return Js(this,t).has(t)}var eu=tu;function au(t,e){var s=Js(this,t),r=s.size;return s.set(t,e),this.size+=s.size==r?0:1,this}var su=au;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=Gm;Ne.prototype.delete=Ym;Ne.prototype.get=$m;Ne.prototype.has=eu;Ne.prototype.set=su;var Jh=Ne,ru="Expected a function";function sr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(ru);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(sr.Cache||Jh),s}sr.Cache=Jh;var te=sr,Yh=te(()=>{return(process.env.CLAUDE_CONFIG_DIR??iu(nu(),".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 Xh=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return Xh=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 Ta(t){return typeof t==="object"&&t!==null&&(("name"in t)&&t.name==="AbortError"||("message"in t)&&String(t.message).includes("FetchRequestCanceledException"))}var V3=(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 t0 extends ht{constructor(t,e,s,r,a){super(`${t0.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:V3(e)});let a=e,n=a?.error?.type;if(t===400)return new nr(t,a,s,r,n);if(t===401)return new ir(t,a,s,r,n);if(t===403)return new hr(t,a,s,r,n);if(t===404)return new cr(t,a,s,r,n);if(t===409)return new dr(t,a,s,r,n);if(t===422)return new or(t,a,s,r,n);if(t===429)return new yr(t,a,s,r,n);if(t>=500)return new mr(t,a,s,r,n);return new t0(t,a,s,r,n)}}class k0 extends t0{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class _a extends t0{constructor({message:t,cause:e}){super(void 0,void 0,t||"Connection error.",void 0);if(e)this.cause=e}}class rr extends _a{constructor({message:t}={}){super({message:t??"Request timed out."})}}class nr extends t0{}class ir extends t0{}class hr extends t0{}class cr extends t0{}class dr extends t0{}class or extends t0{}class yr extends t0{}class mr extends t0{}var hu=/^[a-z][a-z0-9+.-]*:/i,cu=(t)=>{return hu.test(t)},N3=(t)=>(N3=Array.isArray,N3(t)),qi=N3;function w3(t){if(typeof t!=="object")return{};return t??{}}function _i(t){if(!t)return!0;for(let e in t)return!1;return!0}function du(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var ou=(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},$h=(t)=>{try{return JSON.parse(t)}catch(e){return}},yu=(t)=>new Promise((e)=>setTimeout(e,t)),xe="0.81.0",mu=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function uu(){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 Eu=()=>{let t=uu();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xe,"X-Stainless-OS":Bi(Deno.build.os),"X-Stainless-Arch":Di(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":Bi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Di(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=pu();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 pu(){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 Di=(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"},Bi=(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"},Vi,lu=()=>{return Vi??(Vi=Eu())};function Su(){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 tc(...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 ec(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return tc({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 ur(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 Tu(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 ku=({headers:t,body:e})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}};function fu(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 Ru(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 Ni;function Er(t){let e;return(Ni??(e=new globalThis.TextEncoder,Ni=e.encode.bind(e)))(t)}var wi;function Ki(t){let e;return(wi??(e=new globalThis.TextDecoder,wi=e.decode.bind(e)))(t)}var o0,y0;class we{constructor(){o0.set(this,void 0),y0.set(this,void 0),Q(this,o0,new Uint8Array,"f"),Q(this,y0,null,"f")}decode(t){if(t==null)return[];let e=t instanceof ArrayBuffer?new Uint8Array(t):typeof t==="string"?Er(t):t;Q(this,o0,Ru([M(this,o0,"f"),e]),"f");let s=[],r;while((r=xu(M(this,o0,"f"),M(this,y0,"f")))!=null){if(r.carriage&&M(this,y0,"f")==null){Q(this,y0,r.index,"f");continue}if(M(this,y0,"f")!=null&&(r.index!==M(this,y0,"f")+1||r.carriage)){s.push(Ki(M(this,o0,"f").subarray(0,M(this,y0,"f")-1))),Q(this,o0,M(this,o0,"f").subarray(M(this,y0,"f")),"f"),Q(this,y0,null,"f");continue}let a=M(this,y0,"f")!==null?r.preceding-1:r.preceding,n=Ki(M(this,o0,"f").subarray(0,a));s.push(n),Q(this,o0,M(this,o0,"f").subarray(r.index),"f"),Q(this,y0,null,"f")}return s}flush(){if(!M(this,o0,"f").length)return[];return this.decode(`
10
+ `)}}o0=new WeakMap,y0=new WeakMap;we.NEWLINE_CHARS=new Set([`
11
+ `,"\r"]);we.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function xu(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 Iu(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 xs={off:0,error:200,warn:300,info:400,debug:500},Hi=(t,e,s)=>{if(!t)return;if(du(xs,t))return t;a0(s).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(xs))}`);return};function ya(){}function Qa(t,e,s){if(!e||xs[t]>xs[s])return ya;else return e[t].bind(e)}var vu={error:ya,warn:ya,info:ya,debug:ya},Oi=new WeakMap;function a0(t){let e=t.logger,s=t.logLevel??"off";if(!e)return vu;let r=Oi.get(e);if(r&&r[0]===s)return r[1];let a={error:Qa("error",e,s),warn:Qa("warn",e,s),info:Qa("info",e,s),debug:Qa("debug",e,s)};return Oi.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 q0{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?a0(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 Cu(t,e)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(c){throw a.error("Could not parse message into JSON:",h.data),a.error("From chunk:",h.raw),c}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(c){throw a.error("Could not parse message into JSON:",h.data),a.error("From chunk:",h.raw),c}if(h.event==="ping")continue;if(h.event==="error"){let c=$h(h.data)??h.data,d=c?.error?.type;throw new t0(void 0,c,void 0,t.headers,d)}}i=!0}catch(h){if(Ta(h))return;throw h}finally{if(!i)e.abort()}}return new q0(n,e,s)}static fromReadableStream(t,e,s){let r=!1;async function*a(){let i=new we,h=ur(t);for await(let c of h)for(let d of i.decode(c))yield d;for(let c of i.flush())yield c}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(Ta(h))return;throw h}finally{if(!i)e.abort()}}return new q0(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 q0(()=>r(t),this.controller,M(this,Qe,"f")),new q0(()=>r(e),this.controller,M(this,Qe,"f"))]}toReadableStream(){let t=this,e;return tc({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=Er(JSON.stringify(r)+`
12
+ `);s.enqueue(n)}catch(r){s.error(r)}},async cancel(){await e.return?.()}})}}async function*Cu(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 ac,r=new we,a=ur(t.body);for await(let n of Au(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*Au(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"?Er(s):s,a=new Uint8Array(e.length+r.length);a.set(e),a.set(r,e.length),e=a;let n;while((n=Iu(e))!==-1)yield e.slice(0,n),e=e.slice(n)}if(e.length>0)yield e}class ac{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]=bu(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 bu(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 sc(t,e){let{response:s,requestLogID:r,retryOfRequestLogID:a,startTime:n}=e,i=await(async()=>{if(e.options.stream){if(a0(t).debug("response",s.status,s.url,s.headers,s.body),e.options.__streamClass)return e.options.__streamClass.fromSSEResponse(s,e.controller);return q0.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 c=await s.json();return rc(c,s)}return await s.text()})();return a0(t).debug(`[${r}] response parsed`,re({retryOfRequestLogID:a,url:s.url,status:s.status,body:i,durationMs:Date.now()-n})),i}function rc(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 ma;class Ys extends Promise{constructor(t,e,s=sc){super((r)=>{r(null)});this.responsePromise=e,this.parseResponse=s,ma.set(this,void 0),Q(this,ma,t,"f")}_thenUnwrap(t){return new Ys(M(this,ma,"f"),this.responsePromise,async(e,s)=>rc(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,ma,"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)}}ma=new WeakMap;var Ja;class pr{constructor(t,e,s,r){Ja.set(this,void 0),Q(this,Ja,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,Ja,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;yield t;while(t.hasNextPage())t=await t.getNextPage(),yield t}async*[(Ja=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let e of t.getPaginatedItems())yield e}}class nc extends Ys{constructor(t,e,s){super(t,e,async(r,a)=>new s(r,a.response,await sc(r,a),a.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let e of t)yield e}}class Ke extends pr{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:{...w3(this.options.query),before_id:e}}}let t=this.last_id;if(!t)return null;return{...this.options,query:{...w3(this.options.query),after_id:t}}}}class lr extends pr{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:{...w3(this.options.query),page:t}}}}var ic=()=>{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 ic(),new File(t,e??"unknown_file",s)}function Es(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 hc=(t)=>t!=null&&typeof t==="object"&&typeof t[Symbol.asyncIterator]==="function",Sr=async(t,e,s=!0)=>{return{...t,body:await gu(t.body,e,s)}},Ui=new WeakMap;function Zu(t){let e=typeof t==="function"?t:t.fetch,s=Ui.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 Ui.set(e,r),r}var gu=async(t,e,s=!0)=>{if(!await Zu(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])=>K3(r,a,n,s))),r},Fu=(t)=>t instanceof Blob&&("name"in t),K3=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()],Es(s,r),a))}else if(hc(s))t.append(e,be([await new Response(ec(s)).blob()],Es(s,r)));else if(Fu(s))t.append(e,be([s],Es(s,r),{type:s.type}));else if(Array.isArray(s))await Promise.all(s.map((a)=>K3(t,e+"[]",a,r)));else if(typeof s==="object")await Promise.all(Object.entries(s).map(([a,n])=>K3(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`)},cc=(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",Mu=(t)=>t!=null&&typeof t==="object"&&typeof t.name==="string"&&typeof t.lastModified==="number"&&cc(t),Pu=(t)=>t!=null&&typeof t==="object"&&typeof t.url==="string"&&typeof t.blob==="function";async function Lu(t,e,s){if(ic(),t=await t,e||(e=Es(t,!0)),Mu(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(Pu(t)){let a=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),be(await H3(a),e,s)}let r=await H3(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 H3(t){let e=[];if(typeof t==="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(cc(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(hc(t))for await(let s of t)e.push(...await H3(s));else{let s=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${s?`; constructor: ${s}`:""}${ju(t)}`)}return e}function ju(t){if(typeof t!=="object"||t===null)return"";return`; props: [${Object.getOwnPropertyNames(t).map((e)=>`"${e}"`).join(", ")}]`}class x0{constructor(t){this._client=t}}var dc=Symbol.for("brand.privateNullableHeaders");function*qu(t){if(!t)return;if(dc 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(qi(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=qi(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 ft=(t)=>{let e=new Headers,s=new Set;for(let r of t){let a=new Set;for(let[n,i]of qu(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{[dc]:!0,values:e,nulls:s}},pa=Symbol("anthropic.sdk.stainlessHelper");function ps(t){return typeof t==="object"&&t!==null&&pa in t}function oc(t,e){let s=new Set;if(t){for(let r of t)if(ps(r))s.add(r[pa])}if(e)for(let r of e){if(ps(r))s.add(r[pa]);if(Array.isArray(r.content)){for(let a of r.content)if(ps(a))s.add(a[pa])}}return Array.from(s)}function yc(t,e){let s=oc(t,e);if(s.length===0)return{};return{"x-stainless-helper":s.join(", ")}}function _u(t){if(ps(t))return{"x-stainless-helper":t[pa]};return{}}function mc(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Gi=Object.freeze(Object.create(null)),Du=(t=mc)=>function(e,...s){if(e.length===1)return e[0];let r=!1,a=[],n=e.reduce((d,E,l)=>{if(/[?#]/.test(E))r=!0;let u=s[l],f=(r?encodeURIComponent:t)(""+u);if(l!==s.length&&(u==null||typeof u==="object"&&u.toString===Object.getPrototypeOf(Object.getPrototypeOf(u.hasOwnProperty??Gi)??Gi)?.toString))f=u+"",a.push({start:d.length+E.length,length:f.length,error:`Value of type ${Object.prototype.toString.call(u).slice(8,-1)} is not a valid path parameter`});return d+E+(l===s.length?"":f)},""),i=n.split(/[?#]/,1)[0],h=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,c;while((c=h.exec(i))!==null)a.push({start:c.index,length:c[0].length,error:`Value "${c[0]}" can't be safely passed as a path parameter`});if(a.sort((d,E)=>d.start-E.start),a.length>0){let d=0,E=a.reduce((l,u)=>{let f=" ".repeat(u.start-d),I="^".repeat(u.length);return d=u.start+u.length,l+f+I},"");throw new ht(`Path parameters result in path with invalid segments:
14
+ ${a.map((l)=>l.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
+ ${E}`)}return n},Qt=Du(mc);class Tr extends x0{list(t={},e){let{betas:s,...r}=t??{};return this._client.getAPIList("/v1/files",Ke,{query:r,...e,headers:ft([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},e?.headers])})}delete(t,e={},s){let{betas:r}=e??{};return this._client.delete(Qt`/v1/files/${t}`,{...s,headers:ft([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},s?.headers])})}download(t,e={},s){let{betas:r}=e??{};return this._client.get(Qt`/v1/files/${t}/content`,{...s,headers:ft([{"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(Qt`/v1/files/${t}`,{...s,headers:ft([{"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",Sr({body:r,...e,headers:ft([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},_u(r.file),e?.headers])},this._client))}}class kr extends x0{retrieve(t,e={},s){let{betas:r}=e??{};return this._client.get(Qt`/v1/models/${t}?beta=true`,{...s,headers:ft([{...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:ft([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},e?.headers])})}}var uc={"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 Ec(t){return t?.output_format??t?.output_config?.format}function Wi(t,e,s){let r=Ec(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 pc(t,e,s)}function pc(t,e,s){let r=null,a=t.content.map((n)=>{if(n.type==="text"){let i=Bu(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 Bu(t,e){let s=Ec(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 Vu=(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},Ie=(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),Ie(t);case"number":let s=e.value[e.value.length-1];if(s==="."||s==="-")return t=t.slice(0,t.length-1),Ie(t);case"string":let r=t[t.length-2];if(r?.type==="delimiter")return t=t.slice(0,t.length-1),Ie(t);else if(r?.type==="brace"&&r.value==="{")return t=t.slice(0,t.length-1),Ie(t);break;case"delimiter":return t=t.slice(0,t.length-1),Ie(t)}return t},Nu=(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},wu=(t)=>{let e="";return t.map((s)=>{switch(s.type){case"string":e+='"'+s.value+'"';break;default:e+=s.value;break}}),e},lc=(t)=>JSON.parse(wu(Nu(Ie(Vu(t))))),p0,W0,Te,Je,Ya,Ye,Xe,Xa,$e,V0,ta,$a,ts,ee,es,as,ea,b3,zi,ss,Z3,g3,F3,Qi,Ji="__json_buf";function Yi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}class Is{constructor(t,e){p0.add(this),this.messages=[],this.receivedMessages=[],W0.set(this,void 0),Te.set(this,null),this.controller=new AbortController,Je.set(this,void 0),Ya.set(this,()=>{}),Ye.set(this,()=>{}),Xe.set(this,void 0),Xa.set(this,()=>{}),$e.set(this,()=>{}),V0.set(this,{}),ta.set(this,!1),$a.set(this,!1),ts.set(this,!1),ee.set(this,!1),es.set(this,void 0),as.set(this,void 0),ea.set(this,void 0),ss.set(this,(s)=>{if(Q(this,$a,!0,"f"),Ta(s))s=new k0;if(s instanceof k0)return Q(this,ts,!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,Ya,s,"f"),Q(this,Ye,r,"f")}),"f"),Q(this,Xe,new Promise((s,r)=>{Q(this,Xa,s,"f"),Q(this,$e,r,"f")}),"f"),M(this,Je,"f").catch(()=>{}),M(this,Xe,"f").catch(()=>{}),Q(this,Te,t,"f"),Q(this,ea,e?.logger??console,"f")}get response(){return M(this,es,"f")}get request_id(){return M(this,as,"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 Is(null);return e._run(()=>e._fromReadableStream(t)),e}static createMessage(t,e,s,{logger:r}={}){let a=new Is(e,{logger:r});for(let n of e.messages)a._addMessageParam(n);return Q(a,Te,{...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,ss,"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",Z3).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",g3).call(this,h);if(i.controller.signal?.aborted)throw new k0;M(this,p0,"m",F3).call(this)}finally{if(r&&a)r.removeEventListener("abort",a)}}_connected(t){if(this.ended)return;Q(this,es,t,"f"),Q(this,as,t?.headers.get("request-id"),"f"),M(this,Ya,"f").call(this,t),this._emit("connect")}get ended(){return M(this,ta,"f")}get errored(){return M(this,$a,"f")}get aborted(){return M(this,ts,"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",b3).call(this)}async finalText(){return await this.done(),M(this,p0,"m",zi).call(this)}_emit(t,...e){if(M(this,ta,"f"))return;if(t==="end")Q(this,ta,!0,"f"),M(this,Xa,"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",b3).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",Z3).call(this),this._connected(null);let a=q0.fromReadableStream(t,this.controller);for await(let n of a)M(this,p0,"m",g3).call(this,n);if(a.controller.signal?.aborted)throw new k0;M(this,p0,"m",F3).call(this)}finally{if(s&&r)s.removeEventListener("abort",r)}}[(W0=new WeakMap,Te=new WeakMap,Je=new WeakMap,Ya=new WeakMap,Ye=new WeakMap,Xe=new WeakMap,Xa=new WeakMap,$e=new WeakMap,V0=new WeakMap,ta=new WeakMap,$a=new WeakMap,ts=new WeakMap,ee=new WeakMap,es=new WeakMap,as=new WeakMap,ea=new WeakMap,ss=new WeakMap,p0=new WeakSet,b3=function(){if(this.receivedMessages.length===0)throw new ht("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},zi=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(" ")},Z3=function(){if(this.ended)return;Q(this,W0,void 0,"f")},g3=function(t){if(this.ended)return;let e=M(this,p0,"m",Qi).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(Yi(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:Xi(t.delta)}break}case"message_stop":{this._addMessageParam(e),this._addMessage(Wi(e,M(this,Te,"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}},F3=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"),Wi(t,M(this,Te,"f"),{logger:M(this,ea,"f")})},Qi=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&&Yi(s)){let r=s[Ji]||"";r+=t.delta.partial_json;let a={...s};if(Object.defineProperty(a,Ji,{value:r,enumerable:!1,writable:!0}),r)try{a.input=lc(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,ss,"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:Xi(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 q0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function Xi(t){}class fr 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 Ku=1e5,Hu=`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,93 +36,93 @@ 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,ke,ae,Nt,sa,d0,K0,z0,ra,$i,O3;function th(){let t,e;return{promise:new Promise((s,r)=>{t=s,e=r}),resolve:t,reject:e}}class Rr{constructor(t,e,s){aa.add(this),this.client=t,ke.set(this,!1),ae.set(this,!1),Nt.set(this,void 0),sa.set(this,void 0),d0.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",...oc(e.tools,e.messages)].join(", ");Q(this,sa,{...s,headers:ft([{"x-stainless-helper":r},s?.headers])},"f"),Q(this,z0,th(),"f")}async*[(ke=new WeakMap,ae=new WeakMap,Nt=new WeakMap,sa=new WeakMap,d0=new WeakMap,K0=new WeakMap,z0=new WeakMap,ra=new WeakMap,aa=new WeakSet,$i=async function(){let t=M(this,Nt,"f").params.compactionControl;if(!t||!t.enabled)return!1;let e=0;if(M(this,d0,"f")!==void 0)try{let h=await M(this,d0,"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??Ku;if(e<s)return!1;let r=t.model??M(this,Nt,"f").params.model,a=t.summaryPrompt??Hu,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 c=h.content.filter((d)=>d.type!=="tool_use");if(c.length===0)n.pop();else h.content=c}}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,ke,"f"))throw new ht("Cannot iterate over a consumed stream");Q(this,ke,!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,d0,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,d0,e.finalMessage(),"f"),M(this,d0,"f").catch(()=>{}),yield e;else Q(this,d0,this.client.beta.messages.create({...a,stream:!1},M(this,sa,"f")),"f"),yield M(this,d0,"f");if(!await M(this,aa,"m",$i).call(this)){if(!M(this,ae,"f")){let{role:i,content:h}=await M(this,d0,"f");M(this,Nt,"f").params.messages.push({role:i,content:h})}let n=await M(this,aa,"m",O3).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,d0,"f"))throw new ht("ToolRunner concluded without a message from the server");M(this,z0,"f").resolve(await M(this,d0,"f"))}catch(e){throw Q(this,ke,!1,"f"),M(this,z0,"f").promise.catch(()=>{}),M(this,z0,"f").reject(e),Q(this,z0,th(),"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,d0,"f")??this.params.messages.at(-1);if(!t)return null;return M(this,aa,"m",O3).call(this,t)}done(){return M(this,z0,"f").promise}async runUntilDone(){if(!M(this,ke,"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)}}O3=async function(t){if(M(this,K0,"f")!==void 0)return M(this,K0,"f");return Q(this,K0,Ou(M(this,Nt,"f").params,t),"f"),M(this,K0,"f")};async function Ou(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 fr?n.content:`Error: ${n instanceof Error?n.message:String(n)}`,is_error:!0}}}))}}class Xs{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 Xs(ur(t.body),e)}}class xr extends x0{create(t,e){let{betas:s,...r}=t;return this._client.post("/v1/messages/batches?beta=true",{body:r,...e,headers:ft([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},e?.headers])})}retrieve(t,e={},s){let{betas:r}=e??{};return this._client.get(Qt`/v1/messages/batches/${t}?beta=true`,{...s,headers:ft([{"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:ft([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},e?.headers])})}delete(t,e={},s){let{betas:r}=e??{};return this._client.delete(Qt`/v1/messages/batches/${t}?beta=true`,{...s,headers:ft([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},s?.headers])})}cancel(t,e={},s){let{betas:r}=e??{};return this._client.post(Qt`/v1/messages/batches/${t}/cancel?beta=true`,{...s,headers:ft([{"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:ft([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},s?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((n,i)=>Xs.fromResponse(i.response,i.controller))}}var eh={"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"},Uu=["claude-opus-4-6"];class He extends x0{constructor(){super(...arguments);this.batches=new xr(this._client)}create(t,e){let s=ah(t),{betas:r,...a}=s;if(a.model in eh)console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${eh[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 Uu&&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=uc[a.model]??void 0;n=this._client.calculateNonstreamingTimeout(a.max_tokens,h)}let i=yc(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:n??600000,...e,headers:ft([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i,e?.headers]),stream:s.stream??!1})}parse(t,e){return e={...e,headers:ft([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-12-15"].toString()},e?.headers])},this.create(t,e).then((s)=>pc(s,t,{logger:this._client.logger??console}))}stream(t,e){return Is.createMessage(this,t,e)}countTokens(t,e){let s=ah(t),{betas:r,...a}=s;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...e,headers:ft([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString()},e?.headers])})}toolRunner(t,e){return new Rr(this._client,t,e)}}function ah(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=xr;He.BetaToolRunner=Rr;He.ToolError=fr;class Ir extends x0{create(t,e={},s){let{betas:r,...a}=e??{};return this._client.post(Qt`/v1/skills/${t}/versions?beta=true`,Sr({body:a,...s,headers:ft([{"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(Qt`/v1/skills/${r}/versions/${t}?beta=true`,{...s,headers:ft([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},s?.headers])})}list(t,e={},s){let{betas:r,...a}=e??{};return this._client.getAPIList(Qt`/v1/skills/${t}/versions?beta=true`,lr,{query:a,...s,headers:ft([{"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(Qt`/v1/skills/${r}/versions/${t}?beta=true`,{...s,headers:ft([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},s?.headers])})}}class $s extends x0{constructor(){super(...arguments);this.versions=new Ir(this._client)}create(t={},e){let{betas:s,...r}=t??{};return this._client.post("/v1/skills?beta=true",Sr({body:r,...e,headers:ft([{"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(Qt`/v1/skills/${t}?beta=true`,{...s,headers:ft([{"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",lr,{query:r,...e,headers:ft([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},e?.headers])})}delete(t,e={},s){let{betas:r}=e??{};return this._client.delete(Qt`/v1/skills/${t}?beta=true`,{...s,headers:ft([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},s?.headers])})}}$s.Versions=Ir;class ue extends x0{constructor(){super(...arguments);this.models=new kr(this._client),this.messages=new He(this._client),this.files=new Tr(this._client),this.skills=new $s(this._client)}}ue.Models=kr;ue.Messages=He;ue.Files=Tr;ue.Skills=$s;class vr extends x0{create(t,e){let{betas:s,...r}=t;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??600000,...e,headers:ft([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},e?.headers]),stream:t.stream??!1})}}function Sc(t){return t?.output_config?.format}function sh(t,e,s){let r=Sc(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 Tc(t,e,s)}function Tc(t,e,s){let r=null,a=t.content.map((n)=>{if(n.type==="text"){let i=Gu(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 Gu(t,e){let s=Sc(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 l0,Q0,fe,na,rs,ia,ha,ns,ca,N0,da,is,hs,se,cs,ds,oa,M3,rh,P3,L3,j3,q3,nh,ih="__json_buf";function hh(t){return t.type==="tool_use"||t.type==="server_tool_use"}class vs{constructor(t,e){l0.add(this),this.messages=[],this.receivedMessages=[],Q0.set(this,void 0),fe.set(this,null),this.controller=new AbortController,na.set(this,void 0),rs.set(this,()=>{}),ia.set(this,()=>{}),ha.set(this,void 0),ns.set(this,()=>{}),ca.set(this,()=>{}),N0.set(this,{}),da.set(this,!1),is.set(this,!1),hs.set(this,!1),se.set(this,!1),cs.set(this,void 0),ds.set(this,void 0),oa.set(this,void 0),P3.set(this,(s)=>{if(Q(this,is,!0,"f"),Ta(s))s=new k0;if(s instanceof k0)return Q(this,hs,!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,rs,s,"f"),Q(this,ia,r,"f")}),"f"),Q(this,ha,new Promise((s,r)=>{Q(this,ns,s,"f"),Q(this,ca,r,"f")}),"f"),M(this,na,"f").catch(()=>{}),M(this,ha,"f").catch(()=>{}),Q(this,fe,t,"f"),Q(this,oa,e?.logger??console,"f")}get response(){return M(this,cs,"f")}get request_id(){return M(this,ds,"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 vs(null);return e._run(()=>e._fromReadableStream(t)),e}static createMessage(t,e,s,{logger:r}={}){let a=new vs(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,P3,"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,l0,"m",L3).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,l0,"m",j3).call(this,h);if(i.controller.signal?.aborted)throw new k0;M(this,l0,"m",q3).call(this)}finally{if(r&&a)r.removeEventListener("abort",a)}}_connected(t){if(this.ended)return;Q(this,cs,t,"f"),Q(this,ds,t?.headers.get("request-id"),"f"),M(this,rs,"f").call(this,t),this._emit("connect")}get ended(){return M(this,da,"f")}get errored(){return M(this,is,"f")}get aborted(){return M(this,hs,"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,l0,"m",M3).call(this)}async finalText(){return await this.done(),M(this,l0,"m",rh).call(this)}_emit(t,...e){if(M(this,da,"f"))return;if(t==="end")Q(this,da,!0,"f"),M(this,ns,"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,ca,"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,ca,"f").call(this,r),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,l0,"m",M3).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,l0,"m",L3).call(this),this._connected(null);let a=q0.fromReadableStream(t,this.controller);for await(let n of a)M(this,l0,"m",j3).call(this,n);if(a.controller.signal?.aborted)throw new k0;M(this,l0,"m",q3).call(this)}finally{if(s&&r)s.removeEventListener("abort",r)}}[(Q0=new WeakMap,fe=new WeakMap,na=new WeakMap,rs=new WeakMap,ia=new WeakMap,ha=new WeakMap,ns=new WeakMap,ca=new WeakMap,N0=new WeakMap,da=new WeakMap,is=new WeakMap,hs=new WeakMap,se=new WeakMap,cs=new WeakMap,ds=new WeakMap,oa=new WeakMap,P3=new WeakMap,l0=new WeakSet,M3=function(){if(this.receivedMessages.length===0)throw new ht("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},rh=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(" ")},L3=function(){if(this.ended)return;Q(this,Q0,void 0,"f")},j3=function(t){if(this.ended)return;let e=M(this,l0,"m",nh).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(hh(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:ch(t.delta)}break}case"message_stop":{this._addMessageParam(e),this._addMessage(sh(e,M(this,fe,"f"),{logger:M(this,oa,"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}},q3=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"),sh(t,M(this,fe,"f"),{logger:M(this,oa,"f")})},nh=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&&hh(s)){let r=s[ih]||"";r+=t.delta.partial_json;let a={...s};if(Object.defineProperty(a,ih,{value:r,enumerable:!1,writable:!0}),r)a.input=lc(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:ch(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 q0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function ch(t){}class Cr extends x0{create(t,e){return this._client.post("/v1/messages/batches",{body:t,...e})}retrieve(t,e){return this._client.get(Qt`/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(Qt`/v1/messages/batches/${t}`,e)}cancel(t,e){return this._client.post(Qt`/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:ft([{Accept:"application/binary"},e?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((r,a)=>Xs.fromResponse(a.response,a.controller))}}class t3 extends x0{constructor(){super(...arguments);this.batches=new Cr(this._client)}create(t,e){if(t.model in dh)console.warn(`The model '${t.model}' is deprecated and will reach end-of-life on ${dh[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 Wu&&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=uc[t.model]??void 0;s=this._client.calculateNonstreamingTimeout(t.max_tokens,a)}let r=yc(t.tools,t.messages);return this._client.post("/v1/messages",{body:t,timeout:s??600000,...e,headers:ft([r,e?.headers]),stream:t.stream??!1})}parse(t,e){return this.create(t,e).then((s)=>Tc(s,t,{logger:this._client.logger??console}))}stream(t,e){return vs.createMessage(this,t,e,{logger:this._client.logger??console})}countTokens(t,e){return this._client.post("/v1/messages/count_tokens",{body:t,...e})}}var dh={"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"},Wu=["claude-opus-4-6"];t3.Batches=Cr;class Ar extends x0{retrieve(t,e={},s){let{betas:r}=e??{};return this._client.get(Qt`/v1/models/${t}`,{...s,headers:ft([{...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:ft([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},e?.headers])})}}var os=(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},U3,br,ls,kc,zu="\\n\\nHuman:",Qu="\\n\\nAssistant:";class Dt{constructor({baseURL:t=os("ANTHROPIC_BASE_URL"),apiKey:e=os("ANTHROPIC_API_KEY")??null,authToken:s=os("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){U3.add(this),ls.set(this,void 0);let a={apiKey:e,authToken:s,...r,baseURL:t||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&mu())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??br.DEFAULT_TIMEOUT,this.logger=a.logger??console;let n="warn";this.logLevel=n,this.logLevel=Hi(a.logLevel,"ClientOptions.logLevel",this)??Hi(os("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??n,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??Su(),Q(this,ls,ku,"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 ft([await this.apiKeyAuth(t),await this.bearerAuth(t)])}async apiKeyAuth(t){if(this.apiKey==null)return;return ft([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken==null)return;return ft([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return fu(t)}getUserAgent(){return`${this.constructor.name}/JS ${xe}`}defaultIdempotencyKey(){return`stainless-node-retry-${Xh()}`}makeStatusError(t,e,s,r){return t0.generate(t,e,s,r)}buildURL(t,e,s){let r=!M(this,U3,"m",kc).call(this)&&s||this.baseURL,a=cu(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),n=this.defaultQuery(),i=Object.fromEntries(a.searchParams);if(!_i(n)||!_i(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 Ys(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 c="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),d=s===void 0?"":`, retryOf: ${s}`,E=Date.now();if(a0(this).debug(`[${c}] sending request`,re({retryOfRequestLogID:s,method:r.method,url:i,options:r,headers:n.headers})),r.signal?.aborted)throw new k0;let l=new AbortController,u=await this.fetchWithTimeout(i,n,h,l).catch(V3),f=Date.now();if(u instanceof globalThis.Error){let R=`retrying, ${e} attempts remaining`;if(r.signal?.aborted)throw new k0;let o=Ta(u)||/timed? ?out/i.test(String(u)+("cause"in u?String(u.cause):""));if(e)return a0(this).info(`[${c}] connection ${o?"timed out":"failed"} - ${R}`),a0(this).debug(`[${c}] connection ${o?"timed out":"failed"} (${R})`,re({retryOfRequestLogID:s,url:i,durationMs:f-E,message:u.message})),this.retryRequest(r,e,s??c);if(a0(this).info(`[${c}] connection ${o?"timed out":"failed"} - error; no more retries left`),a0(this).debug(`[${c}] connection ${o?"timed out":"failed"} (error; no more retries left)`,re({retryOfRequestLogID:s,url:i,durationMs:f-E,message:u.message})),o)throw new rr;throw new _a({cause:u})}let I=[...u.headers.entries()].filter(([R])=>R==="request-id").map(([R,o])=>", "+R+": "+JSON.stringify(o)).join(""),v=`[${c}${d}${I}] ${n.method} ${i} ${u.ok?"succeeded":"failed"} with status ${u.status} in ${f-E}ms`;if(!u.ok){let R=await this.shouldRetry(u);if(e&&R){let k=`retrying, ${e} attempts remaining`;return await Tu(u.body),a0(this).info(`${v} - ${k}`),a0(this).debug(`[${c}] response error (${k})`,re({retryOfRequestLogID:s,url:u.url,status:u.status,headers:u.headers,durationMs:f-E})),this.retryRequest(r,e,s??c,u.headers)}let o=R?"error; no more retries left":"error; not retryable";a0(this).info(`${v} - ${o}`);let p=await u.text().catch((k)=>V3(k).message),y=$h(p),m=y?void 0:p;throw a0(this).debug(`[${c}] response error (${o})`,re({retryOfRequestLogID:s,url:u.url,status:u.status,headers:u.headers,message:m,durationMs:Date.now()-E})),this.makeStatusError(u.status,y,m,u.headers)}return a0(this).info(v),a0(this).debug(`[${c}] response start`,re({retryOfRequestLogID:s,url:u.url,status:u.status,headers:u.headers,durationMs:f-E})),{response:u,options:r,controller:l,requestLogID:c,retryOfRequestLogID:s,startTime:E}}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 nc(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 c=setTimeout(h,s),d=globalThis.ReadableStream&&i.body instanceof globalThis.ReadableStream||typeof i.body==="object"&&i.body!==null&&Symbol.asyncIterator in i.body,E={signal:r.signal,...d?{duplex:"half"}:{},method:"GET",...i};if(n)E.method=n.toUpperCase();try{return await this.fetch.call(void 0,t,E)}finally{clearTimeout(c)}}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 yu(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)ou("timeout",s.timeout);s.timeout=s.timeout??this.timeout;let{bodyHeaders:c,body:d}=this.buildBody({options:s}),E=await this.buildHeaders({options:t,method:r,bodyHeaders:c,retryCount:e});return{req:{method:r,headers:E,...s.signal&&{signal:s.signal},...globalThis.ReadableStream&&d instanceof globalThis.ReadableStream&&{duplex:"half"},...d&&{body:d},...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=ft([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))}:{},...lu(),...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=ft([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:ec(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,ls,"f").call(this,{body:t,headers:s})}}br=Dt,ls=new WeakMap,U3=new WeakSet,kc=function(){return this.baseURL!=="https://api.anthropic.com"};Dt.Anthropic=br;Dt.HUMAN_PROMPT=zu;Dt.AI_PROMPT=Qu;Dt.DEFAULT_TIMEOUT=600000;Dt.AnthropicError=ht;Dt.APIError=t0;Dt.APIConnectionError=_a;Dt.APIConnectionTimeoutError=rr;Dt.APIUserAbortError=k0;Dt.NotFoundError=cr;Dt.ConflictError=dr;Dt.RateLimitError=yr;Dt.BadRequestError=nr;Dt.AuthenticationError=ir;Dt.InternalServerError=mr;Dt.PermissionDeniedError=hr;Dt.UnprocessableEntityError=or;Dt.toFile=Lu;class Da extends Dt{constructor(){super(...arguments);this.completions=new vr(this),this.messages=new t3(this),this.models=new Ar(this),this.beta=new ue(this)}}Da.Completions=vr;Da.Messages=t3;Da.Models=Ar;Da.Beta=ue;function Ju(t){return t instanceof Error?t:Error(String(t))}function Ss(t){return t instanceof Error?t.message:String(t)}function Ts(t){if(t&&typeof t==="object"&&"code"in t&&typeof t.code==="string")return t.code;return}function Yu(t){return Ts(t)==="ENOENT"}var Ze,Re=null;function eE(){if(Re)return Re;if(!ne(process.env.DEBUG_CLAUDE_AGENT_SDK))return Ze=null,Re=Promise.resolve(),Re;let t=oh(Yh(),"debug");return Ze=oh(t,`sdk-${Xu()}.txt`),process.stderr.write(`SDK debug logs: ${Ze}
49
+ `),Re=tE(t,{recursive:!0}).then(()=>{}).catch(()=>{}),Re}function S0(t){if(Ze===null)return;let e=`${new Date().toISOString()} ${t}
50
+ `;eE().then(()=>{if(Ze)$u(Ze,e).catch(()=>{})})}function Rc(){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 sE(){let t="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof yh==="function"){let e=aE();try{t=yh(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:fc(),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 rE=sE();function nE(){return rE.sessionId}var iE=Rc(),yf=iE.subscribe,hE=Rc(),mf=hE.subscribe;function mE({writeFn:t,flushIntervalMs:e=1000,maxBufferSize:s=100,maxBufferBytes:r=1/0,immediateMode:a=!1}){let n=[],i=0,h=null,c=null;function d(){if(h)clearTimeout(h),h=null}function E(){if(c)t(c.join("")),c=null;if(n.length===0)return;t(n.join("")),n=[],i=0,d()}function l(){if(!h)h=setTimeout(E,e)}function u(){if(c){c.push(...n),n=[],i=0,d();return}let f=n;n=[],i=0,d(),c=f,setImmediate(()=>{let I=c;if(c=null,I)t(I.join(""))})}return{write(f){if(a){t(f);return}if(n.push(f),i+=f.length,l(),n.length>=s||i>=r)u()},flush:E,dispose(){E()}}}var mh=new Set;function uE(t){return mh.add(t),()=>mh.delete(t)}var EE=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 pE(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 lE(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 SE(t,e){if(!e)return!0;let s=pE(t);return lE(s,e)}var AE={cwd(){return process.cwd()},existsSync(t){let e=[];try{let a=Lt(e,qt`fs.existsSync(${t})`,0);return ct.existsSync(t)}catch(a){var s=a,r=1}finally{jt(e,s,r)}},async stat(t){return vE(t)},async readdir(t){return fE(t,{withFileTypes:!0})},async unlink(t){return CE(t)},async rmdir(t){return xE(t)},async rm(t,e){return IE(t,e)},async mkdir(t,e){try{await TE(t,{recursive:!0,...e})}catch(s){if(Ts(s)!=="EEXIST")throw s}},async readFile(t,e){return uh(t,{encoding:e.encoding})},async rename(t,e){return RE(t,e)},statSync(t){let e=[];try{let a=Lt(e,qt`fs.statSync(${t})`,0);return ct.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 ct.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 ct.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 ct.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=ct.openSync(t,"r");let h=Buffer.alloc(e.length),c=ct.readSync(i,h,0,e.length,0);return{buffer:h,bytesRead:c}}finally{if(i)ct.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=ct.openSync(t,"ax",s.mode);try{ct.appendFileSync(h,e)}finally{ct.closeSync(h)}return}catch(h){if(Ts(h)!=="EEXIST")throw h}ct.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);ct.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);ct.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);ct.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);ct.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);ct.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 ct.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 ct.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{ct.mkdirSync(t,i)}catch(h){if(Ts(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 ct.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 ct.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);ct.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);ct.rmSync(t,e)}catch(n){var r=n,a=1}finally{jt(s,r,a)}},createWriteStream(t){return ct.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return uh(t);let s=await kE(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()}}},bE=AE;function Eh(){return bE}function ZE(t,e){if(t.destroyed)return;t.write(e)}function gE(t){ZE(process.stderr,t)}var G3={verbose:0,debug:1,info:2,warn:3,error:4},FE=te(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();if(t&&Object.hasOwn(G3,t))return t;return"debug"}),ME=!1,W3=te(()=>{return ME||ne(process.env.DEBUG)||ne(process.env.DEBUG_SDK)||process.argv.includes("--debug")||process.argv.includes("-d")||vc()||process.argv.some((t)=>t.startsWith("--debug="))||Cc()!==null}),PE=te(()=>{let t=process.argv.find((s)=>s.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return EE(e)}),vc=te(()=>{return process.argv.includes("--debug-to-stderr")||process.argv.includes("-d2e")}),Cc=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 LE(t){if(!W3())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=PE();return SE(t,e)}var jE=!1,ys=null,_3=Promise.resolve();async function qE(t,e,s,r){if(t)await dE(e,{recursive:!0}).catch(()=>{});await cE(s,r),bc()}function _E(){}function DE(){if(!ys){let t=null;ys=mE({writeFn:(e)=>{let s=Ac(),r=xc(s),a=t!==r;if(t=r,W3()){if(a)try{Eh().mkdirSync(r)}catch{}Eh().appendFileSync(s,e),bc();return}_3=_3.then(qE.bind(null,a,r,s,e)).catch(_E)},flushIntervalMs:1000,maxBufferSize:100,immediateMode:W3()}),uE(async()=>{ys?.dispose(),await _3})}return ys}function b0(t,{level:e}={level:"debug"}){if(G3[e]<G3[FE()])return;if(!LE(t))return;if(jE&&t.includes(`
51
+ `))t=T0(t);let s=`${new Date().toISOString()} [${e.toUpperCase()}] ${t.trim()}
52
+ `;if(vc()){gE(s);return}DE().write(s)}function Ac(){return Cc()??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??Ic(Yh(),"debug",`${nE()}.txt`)}var bc=te(async()=>{try{let t=Ac(),e=xc(t),s=Ic(e,"latest");await yE(s).catch(()=>{}),await oE(t,s)}catch{}}),lf=(()=>{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})(),BE={[Symbol.dispose](){}};function VE(){return BE}var qt=VE;function T0(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 Zr=(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 NE(t){let e=t.trim();return e.startsWith("{")&&e.endsWith("}")}function wE(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&&!NE(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={...Zr(a),sandbox:r}}catch{}s.settings=T0(n)}return s}var KE=2000;class Zc{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(t){this.options=t,this.abortController=t.abortController||Uh(),this.initialize()}getDefaultExecutable(){return Gh()?"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=k8(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",(c)=>{let d=c.toString();if(S0(d),this.options.stderr)this.options.stderr(d)});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:c={...process.env},thinkingConfig:d,maxTurns:E,maxBudgetUsd:l,taskBudget:u,model:f,fallbackModel:I,jsonSchema:v,permissionMode:R,allowDangerouslySkipPermissions:o,permissionPromptToolName:p,continueConversation:y,resume:m,settingSources:k,allowedTools:T=[],disallowedTools:x=[],tools:C,mcpServers:F,strictMcpConfig:B,canUseTool:_,includePartialMessages:N,plugins:O,sandbox:z}=this.options,K=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(d){switch(d.type){case"enabled":if(d.budgetTokens===void 0)K.push("--thinking","adaptive");else K.push("--max-thinking-tokens",d.budgetTokens.toString());break;case"disabled":K.push("--thinking","disabled");break;case"adaptive":K.push("--thinking","adaptive");break}if(d.type!=="disabled"&&d.display)K.push("--thinking-display",d.display)}if(this.options.effort)K.push("--effort",this.options.effort);if(E)K.push("--max-turns",E.toString());if(l!==void 0)K.push("--max-budget-usd",l.toString());if(u)K.push("--task-budget",u.total.toString());if(f)K.push("--model",f);if(e)K.push("--agent",e);if(s&&s.length>0)K.push("--betas",s.join(","));if(v)K.push("--json-schema",T0(v));if(this.options.debugFile)K.push("--debug-file",this.options.debugFile);else if(this.options.debug)K.push("--debug");if(ne(c.DEBUG_CLAUDE_AGENT_SDK))K.push("--debug-to-stderr");if(_){if(p)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");K.push("--permission-prompt-tool","stdio")}else if(p)K.push("--permission-prompt-tool",p);if(y)K.push("--continue");if(m)K.push("--resume",m);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(T.length>0)K.push("--allowedTools",T.join(","));if(x.length>0)K.push("--disallowedTools",x.join(","));if(C!==void 0)if(Array.isArray(C))if(C.length===0)K.push("--tools","");else K.push("--tools",C.join(","));else K.push("--tools","default");if(F&&Object.keys(F).length>0)K.push("--mcp-config",T0({mcpServers:F}));if(k!==void 0)K.push(`--setting-sources=${k.join(",")}`);if(B)K.push("--strict-mcp-config");if(R)K.push("--permission-mode",R);if(o)K.push("--allow-dangerously-skip-permissions");if(I){if(f&&I===f)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");K.push("--fallback-model",I)}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 Ot=wE(Mt,z);for(let[S,b]of Object.entries(Ot))if(b===null)K.push(`--${S}`);else K.push(`--${S}`,b);if(!c.CLAUDE_CODE_ENTRYPOINT)c.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(delete c.NODE_OPTIONS,ne(c.DEBUG_CLAUDE_AGENT_SDK))c.DEBUG="1";else delete c.DEBUG;let Ut=HE(h),St=Ut?h:a,Z=Ut?[...n,...K]:[...n,h,...K],L={command:St,args:Z,cwd:r,env:c,signal:this.abortController.signal};if(this.options.spawnClaudeCodeProcess)S0(`Spawning Claude Code (custom): ${St} ${Z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(L);else S0(`Spawning Claude Code: ${St} ${Z.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 j0("Claude Code process aborted by user");else if(Yu(S)){let b=Ut?`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),S0(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${S.message}`),S0(this.exitError.message)}),this.process.on("exit",(S,b)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new j0("Claude Code process aborted by user");else{let P=this.getProcessExitError(S,b);if(P)this.exitError=P,S0(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 j0("Operation aborted");if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){S0("[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}`);S0(`[ProcessTransport] Writing to stdin: ${t.substring(0,100)}`);try{if(!this.processStdin.write(t))S0("[ProcessTransport] Write buffer full, data queued")}catch(e){throw this.ready=!1,Error(`Failed to write to process stdin: ${Ss(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()},KE,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=f8({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=Zr(s)}catch(a){S0(`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 j0("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 HE(t){return![".js",".mjs",".tsx",".ts",".jsx"].some((e)=>t.endsWith(e))}function OE(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 gr{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 gc{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 Fc{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new gr;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,c){this.transport=t,this.isSingleUserTurn=e,this.canUseTool=s,this.hooks=r,this.abortController=a,this.jsonSchema=i,this.initConfig=h,this.onElicitation=c;for(let[d,E]of n)this.connectSdkMcpServer(d,E);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)b0("[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 j0)){let e=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);b0(`[Query.readMessages] Replacing exit error with result text. Original: ${Ss(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(T0(r)+`
53
+ `))}catch(s){if(this.cleanupPerformed)return;let r={type:"control_response",response:{subtype:"error",request_id:t.request_id,error:Ss(s)}};try{await Promise.resolve(this.transport.write(T0(r)+`
54
+ `))}catch(a){b0(`[Query.handleControlRequest] Error-response write failed: ${Ss(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 c=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(c,h),i.push(c)}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(T0(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){b0("[Query.streamInput] Starting to process input stream");try{let e=0;for await(let s of t){if(e++,b0(`[Query.streamInput] Processing message ${e}: ${s.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(T0(s)+`
56
+ `))}if(b0(`[Query.streamInput] Finished processing ${e} messages from input stream`),e>0&&this.hasBidirectionalNeeds())b0("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();b0("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(e){if(!(e instanceof j0))throw e}}waitForFirstResult(){if(this.firstResultReceived)return b0("[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 gc((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);b0(`[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:fc(),request:{subtype:"mcp_message",server_name:t,message:e}};Promise.resolve(this.transport.write(T0(s)+`
57
+ `)).catch((r)=>{b0(`[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)},c=(E)=>{h(),n(E)},d=(E)=>{h(),i(E)};if(this.pendingMcpResponses.set(a,{resolve:c,reject:d}),s.onmessage)s.onmessage(e.message);else{h(),i(Error("No message handler registered"));return}})}}var kf=GE(UE);var ff=Buffer.from('{"type":"attribution-snapshot"'),Rf=Buffer.from('{"type":"system"'),WE=10,xf=Buffer.from([WE]);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 ph;(function(t){t.mergeShapes=(e,s)=>{return{...e,...s}}})(ph||(ph={}));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 R0 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 c=n.path[h];if(h!==n.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(e(n));i=i[c],h++}}};return r(this),s}static assert(t){if(!(t instanceof R0))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()}}R0.create=(t)=>{return new R0(t)};var zE=(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}},ka=zE,QE=ka;function z3(){return QE}var Q3=(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="",c=r.filter((d)=>!!d).slice().reverse();for(let d of c)h=d(i,{data:e,defaultError:h}).message;return{...a,path:n,message:h}};function G(t,e){let s=z3(),r=Q3({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===ka?void 0:ka].filter((a)=>!!a)});t.common.issues.push(r)}class r0{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 r0.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"}),ua=(t)=>({status:"dirty",value:t}),i0=(t)=>({status:"valid",value:t}),lh=(t)=>t.status==="aborted",Sh=(t)=>t.status==="dirty",Fe=(t)=>t.status==="valid",Cs=(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 g0{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 Th=(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 R0(t.common.issues);return this._error=s,this._error}}}};function ot(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 pt{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 r0,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(Cs(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 Th(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(Cs(r)?r:Promise.resolve(r));return Th(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 B0({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 D0.create(this,this._def)}nullable(){return X0.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _0.create(this)}promise(){return je.create(this,this._def)}or(t){return Ia.create([this,t],this._def)}and(t){return va.create(this,t,this._def)}transform(t){return new B0({...ot(this._def),schema:this,typeName:it.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t==="function"?t:()=>t;return new Za({...ot(this._def),innerType:this,defaultValue:e,typeName:it.ZodDefault})}brand(){return new Mr({typeName:it.ZodBranded,type:this,...ot(this._def)})}catch(t){let e=typeof t==="function"?t:()=>t;return new ga({...ot(this._def),innerType:this,catchValue:e,typeName:it.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return e3.create(this,t)}readonly(){return Fa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var JE=/^c[^\s-]{8,}$/i,YE=/^[0-9a-z]+$/,XE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$E=/^[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,tp=/^[a-z0-9_-]{21}$/i,ep=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ap=/^[-+]?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)?)??$/,sp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",D3,np=/^(?:(?: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])$/,ip=/^(?:(?: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])$/,hp=/^(([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]))$/,cp=/^(([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])$/,dp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,op=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Mc="((\\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])))",yp=new RegExp(`^${Mc}$`);function Pc(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 mp(t){return new RegExp(`^${Pc(t)}$`)}function up(t){let e=`${Mc}T${Pc(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 Ep(t,e){if((e==="v4"||!e)&&np.test(t))return!0;if((e==="v6"||!e)&&hp.test(t))return!0;return!1}function pp(t,e){if(!ep.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 lp(t,e){if((e==="v4"||!e)&&ip.test(t))return!0;if((e==="v6"||!e)&&cp.test(t))return!0;return!1}class H0 extends pt{_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 r0,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(!sp.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(!D3)D3=new RegExp(rp,"u");if(!D3.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(!$E.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(!tp.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(!JE.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(!YE.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(!XE.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(!up(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(!yp.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(!mp(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(!ap.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(!Ep(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(!pp(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(!lp(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(!dp.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(!op.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,...ot(t)})};function Sp(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 pt{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 r0;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(Sp(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,...ot(t)})};class Pe extends pt{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 r0;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,...ot(t)})};class As extends pt{_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 i0(t.data)}}As.create=(t)=>{return new As({typeName:it.ZodBoolean,coerce:t?.coerce||!1,...ot(t)})};class fa extends pt{_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 r0,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 fa({...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}}fa.create=(t)=>{return new fa({checks:[],coerce:t?.coerce||!1,typeName:it.ZodDate,...ot(t)})};class bs extends pt{_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 i0(t.data)}}bs.create=(t)=>{return new bs({typeName:it.ZodSymbol,...ot(t)})};class Ra extends pt{_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 i0(t.data)}}Ra.create=(t)=>{return new Ra({typeName:it.ZodUndefined,...ot(t)})};class xa extends pt{_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 i0(t.data)}}xa.create=(t)=>{return new xa({typeName:it.ZodNull,...ot(t)})};class Zs extends pt{constructor(){super(...arguments);this._any=!0}_parse(t){return i0(t.data)}}Zs.create=(t)=>{return new Zs({typeName:it.ZodAny,...ot(t)})};class he extends pt{constructor(){super(...arguments);this._unknown=!0}_parse(t){return i0(t.data)}}he.create=(t)=>{return new he({typeName:it.ZodUnknown,...ot(t)})};class U0 extends pt{_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,...ot(t)})};class gs extends pt{_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 i0(t.data)}}gs.create=(t)=>{return new gs({typeName:it.ZodVoid,...ot(t)})};class _0 extends pt{_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 g0(e,n,e.path,i))})).then((n)=>{return r0.mergeArray(s,n)});let a=[...e.data].map((n,i)=>{return r.type._parseSync(new g0(e,n,e.path,i))});return r0.mergeArray(s,a)}get element(){return this._def.type}min(t,e){return new _0({...this._def,minLength:{value:t,message:$.toString(e)}})}max(t,e){return new _0({...this._def,maxLength:{value:t,message:$.toString(e)}})}length(t,e){return new _0({...this._def,exactLength:{value:t,message:$.toString(e)}})}nonempty(t){return this.min(1,t)}}_0.create=(t,e)=>{return new _0({type:t,minLength:null,maxLength:null,exactLength:null,typeName:it.ZodArray,...ot(e)})};function ve(t){if(t instanceof _t){let e={};for(let s in t.shape){let r=t.shape[s];e[s]=D0.create(ve(r))}return new _t({...t._def,shape:()=>e})}else if(t instanceof _0)return new _0({...t._def,type:ve(t.element)});else if(t instanceof D0)return D0.create(ve(t.unwrap()));else if(t instanceof X0)return X0.create(ve(t.unwrap()));else if(t instanceof G0)return G0.create(t.items.map((e)=>ve(e)));else return t}class _t extends pt{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 c=r[h],d=s.data[h];i.push({key:{status:"valid",value:h},value:c._parse(new g0(s,d,s.path,h)),alwaysSet:h in s.data})}if(this._def.catchall instanceof U0){let h=this._def.unknownKeys;if(h==="passthrough")for(let c of n)i.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});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 c of n){let d=s.data[c];i.push({key:{status:"valid",value:c},value:h._parse(new g0(s,d,s.path,c)),alwaysSet:c in s.data})}}if(s.common.async)return Promise.resolve().then(async()=>{let h=[];for(let c of i){let d=await c.key,E=await c.value;h.push({key:d,value:E,alwaysSet:c.alwaysSet})}return h}).then((h)=>{return r0.mergeObjectSync(e,h)});else return r0.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 ve(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 D0)r=r._def.innerType;e[s]=r}return new _t({...this._def,shape:()=>e})}keyof(){return Lc(Rt.objectKeys(this.shape))}}_t.create=(t,e)=>{return new _t({shape:()=>t,unknownKeys:"strip",catchall:U0.create(),typeName:it.ZodObject,...ot(e)})};_t.strictCreate=(t,e)=>{return new _t({shape:()=>t,unknownKeys:"strict",catchall:U0.create(),typeName:it.ZodObject,...ot(e)})};_t.lazycreate=(t,e)=>{return new _t({shape:t,unknownKeys:"strip",catchall:U0.create(),typeName:it.ZodObject,...ot(e)})};class Ia extends pt{_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 R0(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 c={...e,common:{...e.common,issues:[]},parent:null},d=h._parseSync({data:e.data,path:e.path,parent:c});if(d.status==="valid")return d;else if(d.status==="dirty"&&!a)a={result:d,ctx:c};if(c.common.issues.length)n.push(c.common.issues)}if(a)return e.common.issues.push(...a.ctx.common.issues),a.result;let i=n.map((h)=>new R0(h));return G(e,{code:w.invalid_union,unionErrors:i}),nt}}get options(){return this._def.options}}Ia.create=(t,e)=>{return new Ia({options:t,typeName:it.ZodUnion,...ot(e)})};var w0=(t)=>{if(t instanceof Ca)return w0(t.schema);else if(t instanceof B0)return w0(t.innerType());else if(t instanceof Aa)return[t.value];else if(t instanceof ce)return t.options;else if(t instanceof ba)return Rt.objectValues(t.enum);else if(t instanceof Za)return w0(t._def.innerType);else if(t instanceof Ra)return[void 0];else if(t instanceof xa)return[null];else if(t instanceof D0)return[void 0,...w0(t.unwrap())];else if(t instanceof X0)return[null,...w0(t.unwrap())];else if(t instanceof Mr)return w0(t.unwrap());else if(t instanceof Fa)return w0(t.unwrap());else if(t instanceof ga)return w0(t._def.innerType);else return[]};class Fr extends pt{_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 Fr({typeName:it.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:r,...ot(s)})}}function J3(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 c=J3(t[h],e[h]);if(!c.valid)return{valid:!1};i[h]=c.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],c=J3(i,h);if(!c.valid)return{valid:!1};a.push(c.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 va extends pt{_parse(t){let{status:e,ctx:s}=this._processInputParams(t),r=(a,n)=>{if(lh(a)||lh(n))return nt;let i=J3(a.value,n.value);if(!i.valid)return G(s,{code:w.invalid_intersection_types}),nt;if(Sh(a)||Sh(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}))}}va.create=(t,e,s)=>{return new va({left:t,right:e,typeName:it.ZodIntersection,...ot(s)})};class G0 extends pt{_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 g0(s,a,s.path,n))}).filter((a)=>!!a);if(s.common.async)return Promise.all(r).then((a)=>{return r0.mergeArray(e,a)});else return r0.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,...ot(e)})};class Fs extends pt{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 g0(s,i,s.path,i)),value:n._parse(new g0(s,s.data[i],s.path,i)),alwaysSet:i in s.data});if(s.common.async)return r0.mergeObjectAsync(e,r);else return r0.mergeObjectSync(e,r)}get element(){return this._def.valueType}static create(t,e,s){if(e instanceof pt)return new Fs({keyType:t,valueType:e,typeName:it.ZodRecord,...ot(s)});return new Fs({keyType:H0.create(),valueType:t,typeName:it.ZodRecord,...ot(e)})}}class Ms extends pt{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],c)=>{return{key:r._parse(new g0(s,i,s.path,[c,"key"])),value:a._parse(new g0(s,h,s.path,[c,"value"]))}});if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let h of n){let c=await h.key,d=await h.value;if(c.status==="aborted"||d.status==="aborted")return nt;if(c.status==="dirty"||d.status==="dirty")e.dirty();i.set(c.value,d.value)}return{status:e.value,value:i}})}else{let i=new Map;for(let h of n){let{key:c,value:d}=h;if(c.status==="aborted"||d.status==="aborted")return nt;if(c.status==="dirty"||d.status==="dirty")e.dirty();i.set(c.value,d.value)}return{status:e.value,value:i}}}}Ms.create=(t,e,s)=>{return new Ms({valueType:e,keyType:t,typeName:it.ZodMap,...ot(s)})};class Le extends pt{_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 c=new Set;for(let d of h){if(d.status==="aborted")return nt;if(d.status==="dirty")e.dirty();c.add(d.value)}return{status:e.value,value:c}}let i=[...s.data.values()].map((h,c)=>a._parse(new g0(s,h,s.path,c)));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,...ot(e)})};class la extends pt{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 Q3({data:i,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,z3(),ka].filter((c)=>!!c),issueData:{code:w.invalid_arguments,argumentsError:h}})}function r(i,h){return Q3({data:i,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,z3(),ka].filter((c)=>!!c),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 i0(async function(...h){let c=new R0([]),d=await i._def.args.parseAsync(h,a).catch((l)=>{throw c.addIssue(s(h,l)),c}),E=await Reflect.apply(n,this,d);return await i._def.returns._def.type.parseAsync(E,a).catch((l)=>{throw c.addIssue(r(E,l)),c})})}else{let i=this;return i0(function(...h){let c=i._def.args.safeParse(h,a);if(!c.success)throw new R0([s(h,c.error)]);let d=Reflect.apply(n,this,c.data),E=i._def.returns.safeParse(d,a);if(!E.success)throw new R0([r(d,E.error)]);return E.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new la({...this._def,args:G0.create(t).rest(he.create())})}returns(t){return new la({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,s){return new la({args:t?t:G0.create([]).rest(he.create()),returns:e||he.create(),typeName:it.ZodFunction,...ot(s)})}}class Ca extends pt{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})}}Ca.create=(t,e)=>{return new Ca({getter:t,typeName:it.ZodLazy,...ot(e)})};class Aa extends pt{_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}}Aa.create=(t,e)=>{return new Aa({value:t,typeName:it.ZodLiteral,...ot(e)})};function Lc(t,e){return new ce({values:t,typeName:it.ZodEnum,...ot(e)})}class ce extends pt{_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 i0(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 ce.create(t,{...this._def,...e})}exclude(t,e=this._def){return ce.create(this.options.filter((s)=>!t.includes(s)),{...this._def,...e})}}ce.create=Lc;class ba extends pt{_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 i0(t.data)}get enum(){return this._def.values}}ba.create=(t,e)=>{return new ba({values:t,typeName:it.ZodNativeEnum,...ot(e)})};class je extends pt{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 i0(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,...ot(e)})};class B0 extends pt{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 ua(h.value);if(e.value==="dirty")return ua(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 ua(i.value);if(e.value==="dirty")return ua(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)}}B0.create=(t,e,s)=>{return new B0({schema:t,typeName:it.ZodEffects,effect:e,...ot(s)})};B0.createWithPreprocess=(t,e,s)=>{return new B0({schema:e,effect:{type:"preprocess",transform:t},typeName:it.ZodEffects,...ot(s)})};class D0 extends pt{_parse(t){if(this._getType(t)===Y.undefined)return i0(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}D0.create=(t,e)=>{return new D0({innerType:t,typeName:it.ZodOptional,...ot(e)})};class X0 extends pt{_parse(t){if(this._getType(t)===Y.null)return i0(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}X0.create=(t,e)=>{return new X0({innerType:t,typeName:it.ZodNullable,...ot(e)})};class Za extends pt{_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}}Za.create=(t,e)=>{return new Za({innerType:t,typeName:it.ZodDefault,defaultValue:typeof e.default==="function"?e.default:()=>e.default,...ot(e)})};class ga extends pt{_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(Cs(r))return r.then((a)=>{return{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new R0(s.common.issues)},input:s.data})}});else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new R0(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ga.create=(t,e)=>{return new ga({innerType:t,typeName:it.ZodCatch,catchValue:typeof e.catch==="function"?e.catch:()=>e.catch,...ot(e)})};class Ps extends pt{_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}}}Ps.create=(t)=>{return new Ps({typeName:it.ZodNaN,...ot(t)})};var If=Symbol("zod_brand");class Mr extends pt{_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 e3 extends pt{_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(),ua(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 e3({in:t,out:e,typeName:it.ZodPipeline})}}class Fa extends pt{_parse(t){let e=this._def.innerType._parse(t),s=(r)=>{if(Fe(r))r.value=Object.freeze(r.value);return r};return Cs(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,...ot(e)})};var vf={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 Cf=H0.create,Af=Me.create,bf=Ps.create,Zf=Pe.create,gf=As.create,Ff=fa.create,Mf=bs.create,Pf=Ra.create,Lf=xa.create,jf=Zs.create,qf=he.create,_f=U0.create,Df=gs.create,Bf=_0.create,Vf=_t.create,Nf=_t.strictCreate,wf=Ia.create,Kf=Fr.create,Hf=va.create,Of=G0.create,Uf=Fs.create,Gf=Ms.create,Wf=Le.create,zf=la.create,Qf=Ca.create,Jf=Aa.create,Yf=ce.create,Xf=ba.create,$f=je.create,tR=B0.create,eR=D0.create,aR=X0.create,sR=B0.createWithPreprocess,rR=e3.create,jc={};me(jc,{version:()=>G6,util:()=>Tt,treeifyError:()=>Wc,toJSONSchema:()=>No,toDotPath:()=>zc,safeParseAsync:()=>Hr,safeParse:()=>wr,registry:()=>nn,regexes:()=>Or,prettifyError:()=>Qc,parseAsync:()=>_s,parse:()=>qs,locales:()=>rn,isValidJWT:()=>ld,isValidBase64URL:()=>ud,isValidBase64:()=>Qr,globalRegistry:()=>ie,globalConfig:()=>Ls,function:()=>Vo,formatError:()=>Dr,flattenError:()=>_r,config:()=>n0,clone:()=>P0,_xid:()=>Tn,_void:()=>vo,_uuidv7:()=>yn,_uuidv6:()=>on,_uuidv4:()=>dn,_uuid:()=>cn,_url:()=>mn,_uppercase:()=>Mn,_unknown:()=>Vs,_union:()=>TS,_undefined:()=>fo,_ulid:()=>Sn,_uint64:()=>To,_uint32:()=>mo,_tuple:()=>Lo,_trim:()=>Dn,_transform:()=>bS,_toUpperCase:()=>Vn,_toLowerCase:()=>Bn,_templateLiteral:()=>_S,_symbol:()=>ko,_success:()=>PS,_stringbool:()=>Do,_stringFormat:()=>Bo,_string:()=>Xd,_startsWith:()=>Ln,_size:()=>Zn,_set:()=>IS,_safeParseAsync:()=>Kr,_safeParse:()=>Nr,_regex:()=>gn,_refine:()=>_o,_record:()=>RS,_readonly:()=>qS,_property:()=>Po,_promise:()=>BS,_positive:()=>Zo,_pipe:()=>jS,_parseAsync:()=>Vr,_parse:()=>Br,_overwrite:()=>le,_optional:()=>ZS,_number:()=>no,_nullable:()=>gS,_null:()=>Ro,_normalize:()=>_n,_nonpositive:()=>Fo,_nonoptional:()=>MS,_nonnegative:()=>Mo,_never:()=>Io,_negative:()=>go,_nativeEnum:()=>CS,_nanoid:()=>En,_nan:()=>bo,_multipleOf:()=>La,_minSize:()=>ja,_minLength:()=>_e,_min:()=>m0,_mime:()=>qn,_maxSize:()=>c3,_maxLength:()=>d3,_max:()=>Z0,_map:()=>xS,_lte:()=>Z0,_lt:()=>oe,_lowercase:()=>Fn,_literal:()=>AS,_length:()=>o3,_lazy:()=>DS,_ksuid:()=>kn,_jwt:()=>bn,_isoTime:()=>so,_isoDuration:()=>ro,_isoDateTime:()=>eo,_isoDate:()=>ao,_ipv6:()=>Rn,_ipv4:()=>fn,_intersection:()=>fS,_int64:()=>So,_int32:()=>yo,_int:()=>ho,_includes:()=>Pn,_guid:()=>Bs,_gte:()=>m0,_gt:()=>ye,_float64:()=>oo,_float32:()=>co,_file:()=>jo,_enum:()=>vS,_endsWith:()=>jn,_emoji:()=>un,_email:()=>hn,_e164:()=>An,_discriminatedUnion:()=>kS,_default:()=>FS,_date:()=>Co,_custom:()=>qo,_cuid2:()=>ln,_cuid:()=>pn,_coercedString:()=>$d,_coercedNumber:()=>io,_coercedDate:()=>Ao,_coercedBoolean:()=>Eo,_coercedBigint:()=>lo,_cidrv6:()=>In,_cidrv4:()=>xn,_catch:()=>LS,_boolean:()=>uo,_bigint:()=>po,_base64url:()=>Cn,_base64:()=>vn,_array:()=>Nn,_any:()=>xo,TimePrecision:()=>to,NEVER:()=>qc,JSONSchemaGenerator:()=>Ns,JSONSchema:()=>VS,Doc:()=>zr,$output:()=>Jd,$input:()=>Yd,$constructor:()=>g,$brand:()=>_c,$ZodXID:()=>ad,$ZodVoid:()=>Ad,$ZodUnknown:()=>Ds,$ZodUnion:()=>en,$ZodUndefined:()=>xd,$ZodUUID:()=>z6,$ZodURL:()=>J6,$ZodULID:()=>ed,$ZodType:()=>dt,$ZodTuple:()=>i3,$ZodTransform:()=>an,$ZodTemplateLiteral:()=>Ud,$ZodSymbol:()=>Rd,$ZodSuccess:()=>wd,$ZodStringFormat:()=>At,$ZodString:()=>Na,$ZodSet:()=>Pd,$ZodRegistry:()=>h3,$ZodRecord:()=>Fd,$ZodRealError:()=>Ba,$ZodReadonly:()=>Od,$ZodPromise:()=>Gd,$ZodPrefault:()=>Vd,$ZodPipe:()=>sn,$ZodOptional:()=>_d,$ZodObject:()=>tn,$ZodNumberFormat:()=>kd,$ZodNumber:()=>Jr,$ZodNullable:()=>Dd,$ZodNull:()=>Id,$ZodNonOptional:()=>Nd,$ZodNever:()=>Cd,$ZodNanoID:()=>X6,$ZodNaN:()=>Hd,$ZodMap:()=>Md,$ZodLiteral:()=>jd,$ZodLazy:()=>Wd,$ZodKSUID:()=>sd,$ZodJWT:()=>Sd,$ZodIntersection:()=>gd,$ZodISOTime:()=>id,$ZodISODuration:()=>hd,$ZodISODateTime:()=>rd,$ZodISODate:()=>nd,$ZodIPv6:()=>dd,$ZodIPv4:()=>cd,$ZodGUID:()=>W6,$ZodFunction:()=>wn,$ZodFile:()=>qd,$ZodError:()=>qr,$ZodEnum:()=>Ld,$ZodEmoji:()=>Y6,$ZodEmail:()=>Q6,$ZodE164:()=>pd,$ZodDiscriminatedUnion:()=>Zd,$ZodDefault:()=>Bd,$ZodDate:()=>bd,$ZodCustomStringFormat:()=>Td,$ZodCustom:()=>zd,$ZodCheckUpperCase:()=>V6,$ZodCheckStringFormat:()=>Va,$ZodCheckStartsWith:()=>w6,$ZodCheckSizeEquals:()=>L6,$ZodCheckRegex:()=>D6,$ZodCheckProperty:()=>H6,$ZodCheckOverwrite:()=>U6,$ZodCheckNumberFormat:()=>g6,$ZodCheckMultipleOf:()=>Z6,$ZodCheckMinSize:()=>P6,$ZodCheckMinLength:()=>q6,$ZodCheckMimeType:()=>O6,$ZodCheckMaxSize:()=>M6,$ZodCheckMaxLength:()=>j6,$ZodCheckLowerCase:()=>B6,$ZodCheckLessThan:()=>Gr,$ZodCheckLengthEquals:()=>_6,$ZodCheckIncludes:()=>N6,$ZodCheckGreaterThan:()=>Wr,$ZodCheckEndsWith:()=>K6,$ZodCheckBigIntFormat:()=>F6,$ZodCheck:()=>Bt,$ZodCatch:()=>Kd,$ZodCUID2:()=>td,$ZodCUID:()=>$6,$ZodCIDRv6:()=>yd,$ZodCIDRv4:()=>od,$ZodBoolean:()=>Yr,$ZodBigIntFormat:()=>fd,$ZodBigInt:()=>Xr,$ZodBase64URL:()=>Ed,$ZodBase64:()=>md,$ZodAsyncError:()=>de,$ZodArray:()=>$r,$ZodAny:()=>vd});var qc=Object.freeze({status:"aborted"});function g(t,e,s){function r(h,c){var d;Object.defineProperty(h,"_zod",{value:h._zod??{},enumerable:!1}),(d=h._zod).traits??(d.traits=new Set),h._zod.traits.add(t),e(h,c);for(let E in i.prototype)if(!(E in h))Object.defineProperty(h,E,{value:i.prototype[E].bind(h)});h._zod.constr=i,h._zod.def=c}let a=s?.Parent??Object;class n extends a{}Object.defineProperty(n,"name",{value:t});function i(h){var c;let d=s?.Parent?new n:this;r(d,h),(c=d._zod).deferred??(c.deferred=[]);for(let E of d._zod.deferred)E();return d}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 _c=Symbol("zod_brand");class de extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Ls={};function n0(t){if(t)Object.assign(Ls,t);return Ls}var Tt={};me(Tt,{unwrapMessage:()=>Ea,stringifyPrimitive:()=>yt,required:()=>jp,randomString:()=>Cp,propertyKeyTypes:()=>js,promiseAllObject:()=>vp,primitiveTypes:()=>Nc,prefixIssues:()=>f0,pick:()=>gp,partial:()=>Lp,optionalKeys:()=>wc,omit:()=>Fp,numKeys:()=>Ap,nullish:()=>Ee,normalizeParams:()=>H,merge:()=>Pp,jsonStringifyReplacer:()=>Dc,joinValues:()=>U,issue:()=>Oc,isPlainObject:()=>Pa,isObject:()=>Ma,getSizableOrigin:()=>r3,getParsedType:()=>bp,getLengthableOrigin:()=>n3,getEnumValues:()=>Pr,getElementAtPath:()=>Ip,floatSafeRemainder:()=>Bc,finalizeIssue:()=>F0,extend:()=>Mp,escapeRegex:()=>pe,esc:()=>Ce,defineLazy:()=>It,createTransparentProxy:()=>Zp,clone:()=>P0,cleanRegex:()=>s3,cleanEnum:()=>qp,captureStackTrace:()=>jr,cached:()=>a3,assignProp:()=>Lr,assertNotEqual:()=>kp,assertNever:()=>Rp,assertIs:()=>fp,assertEqual:()=>Tp,assert:()=>xp,allowsEval:()=>Vc,aborted:()=>ge,NUMBER_FORMAT_RANGES:()=>Kc,Class:()=>Uc,BIGINT_FORMAT_RANGES:()=>Hc});function Tp(t){return t}function kp(t){return t}function fp(t){}function Rp(t){throw Error()}function xp(t){}function Pr(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 Dc(t,e){if(typeof e==="bigint")return e.toString();return e}function a3(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function Ee(t){return t===null||t===void 0}function s3(t){let e=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;return t.slice(e,s)}function Bc(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 It(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 Lr(t,e,s){Object.defineProperty(t,e,{value:s,writable:!0,enumerable:!0,configurable:!0})}function Ip(t,e){if(!e)return t;return e.reduce((s,r)=>s?.[r],t)}function vp(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 Cp(t=10){let e="";for(let s=0;s<t;s++)e+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return e}function Ce(t){return JSON.stringify(t)}var jr=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};function Ma(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var Vc=a3(()=>{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 Ap(t){let e=0;for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s))e++;return e}var bp=(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}`)}},js=new Set(["string","number","symbol"]),Nc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function pe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P0(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 Zp(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 wc(t){return Object.keys(t).filter((e)=>{return t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional"})}var Kc={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]},Hc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function gp(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 P0(t,{...t._zod.def,shape:s,checks:[]})}function Fp(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 P0(t,{...t._zod.def,shape:s,checks:[]})}function Mp(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 Lr(this,"shape",r),r},checks:[]};return P0(t,s)}function Pp(t,e){return P0(t,{...t._zod.def,get shape(){let s={...t._zod.def.shape,...e._zod.def.shape};return Lr(this,"shape",s),s},catchall:e._zod.def.catchall,checks:[]})}function Lp(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 P0(e,{...e._zod.def,shape:a,checks:[]})}function jp(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 P0(e,{...e._zod.def,shape:a,checks:[]})}function ge(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 Ea(t){return typeof t==="string"?t:t?.message}function F0(t,e,s){let r={...t,path:t.path??[]};if(!t.message){let a=Ea(t.inst?._zod.def?.error?.(t))??Ea(e?.error?.(t))??Ea(s.customError?.(t))??Ea(s.localeError?.(t))??"Invalid input";r.message=a}if(delete r.inst,delete r.continue,!e?.reportInput)delete r.input;return r}function r3(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map";if(t instanceof File)return"file";return"unknown"}function n3(t){if(Array.isArray(t))return"array";if(typeof t==="string")return"string";return"unknown"}function Oc(...t){let[e,s,r]=t;if(typeof e==="string")return{message:e,code:"custom",input:s,inst:r};return{...e}}function qp(t){return Object.entries(t).filter(([e,s])=>{return Number.isNaN(Number.parseInt(e,10))}).map((e)=>e[1])}class Uc{constructor(...t){}}var Gc=(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,Dc,2)},enumerable:!0})},qr=g("$ZodError",Gc),Ba=g("$ZodError",Gc,{Parent:Error});function _r(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 Dr(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,c=0;while(c<i.path.length){let d=i.path[c];if(c!==i.path.length-1)h[d]=h[d]||{_errors:[]};else h[d]=h[d]||{_errors:[]},h[d]._errors.push(s(i));h=h[d],c++}}};return a(t),r}function Wc(t,e){let s=e||function(n){return n.message},r={errors:[]},a=(n,i=[])=>{var h,c;for(let d of n.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map((E)=>a({issues:E},d.path));else if(d.code==="invalid_key")a({issues:d.issues},d.path);else if(d.code==="invalid_element")a({issues:d.issues},d.path);else{let E=[...i,...d.path];if(E.length===0){r.errors.push(s(d));continue}let l=r,u=0;while(u<E.length){let f=E[u],I=u===E.length-1;if(typeof f==="string")l.properties??(l.properties={}),(h=l.properties)[f]??(h[f]={errors:[]}),l=l.properties[f];else l.items??(l.items=[]),(c=l.items)[f]??(c[f]={errors:[]}),l=l.items[f];if(I)l.errors.push(s(d));u++}}};return a(t),r}function zc(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 Qc(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 ${zc(r.path)}`);return e.join(`
58
+ `)}var Br=(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 de;if(i.issues.length){let h=new(a?.Err??t)(i.issues.map((c)=>F0(c,n,n0())));throw jr(h,a?.callee),h}return i.value},qs=Br(Ba),Vr=(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((c)=>F0(c,n,n0())));throw jr(h,a?.callee),h}return i.value},_s=Vr(Ba),Nr=(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 de;return n.issues.length?{success:!1,error:new(t??qr)(n.issues.map((i)=>F0(i,a,n0())))}:{success:!0,data:n.value}},wr=Nr(Ba),Kr=(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)=>F0(i,a,n0())))}:{success:!0,data:n.value}},Hr=Kr(Ba),Or={};me(Or,{xid:()=>$c,uuid7:()=>Vp,uuid6:()=>Bp,uuid4:()=>Dp,uuid:()=>qe,uppercase:()=>A6,unicodeEmail:()=>Kp,undefined:()=>v6,ulid:()=>Xc,time:()=>l6,string:()=>T6,rfc5322Email:()=>wp,number:()=>R6,null:()=>I6,nanoid:()=>e6,lowercase:()=>C6,ksuid:()=>t6,ipv6:()=>h6,ipv4:()=>i6,integer:()=>f6,html5Email:()=>Np,hostname:()=>y6,guid:()=>s6,extendedDuration:()=>_p,emoji:()=>n6,email:()=>r6,e164:()=>m6,duration:()=>a6,domain:()=>Up,datetime:()=>S6,date:()=>E6,cuid2:()=>Yc,cuid:()=>Jc,cidrv6:()=>d6,cidrv4:()=>c6,browserEmail:()=>Hp,boolean:()=>x6,bigint:()=>k6,base64url:()=>Ur,base64:()=>o6,_emoji:()=>Op});var Jc=/^[cC][^\s-]{8,}$/,Yc=/^[0-9a-z]+$/,Xc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$c=/^[0-9a-vA-V]{20}$/,t6=/^[A-Za-z0-9]{27}$/,e6=/^[a-zA-Z0-9_-]{21}$/,a6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_p=/^[-+]?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)?)??$/,s6=/^([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})$`)},Dp=qe(4),Bp=qe(6),Vp=qe(7),r6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Np=/^[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])?)*$/,wp=/^(([^<>()\[\]\\.,;:\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,}))$/,Kp=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Hp=/^[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])?)*$/,Op="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function n6(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var i6=/^(?:(?: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])$/,h6=/^(([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})$/,c6=/^((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])$/,d6=/^(([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])$/,o6=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ur=/^[A-Za-z0-9_-]*$/,y6=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Up=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,m6=/^\+(?:[0-9]){6,14}[0-9]$/,u6="(?:(?:\\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])))",E6=new RegExp(`^${u6}$`);function p6(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 l6(t){return new RegExp(`^${p6(t)}$`)}function S6(t){let e=p6({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(`^${u6}T(?:${r})$`)}var T6=(t)=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},k6=/^\d+n?$/,f6=/^\d+$/,R6=/^-?\d+(?:\.\d+)?/i,x6=/true|false/i,I6=/null/i,v6=/undefined/i,C6=/^[^A-Z]*$/,A6=/^[^a-z]*$/,Bt=g("$ZodCheck",(t,e)=>{var s;t._zod??(t._zod={}),t._zod.def=e,(s=t._zod).onattach??(s.onattach=[])}),b6={number:"number",bigint:"bigint",object:"date"},Gr=g("$ZodCheckLessThan",(t,e)=>{Bt.init(t,e);let s=b6[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})}}),Wr=g("$ZodCheckGreaterThan",(t,e)=>{Bt.init(t,e);let s=b6[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})}}),Z6=g("$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):Bc(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})}}),g6=g("$ZodCheckNumberFormat",(t,e)=>{Bt.init(t,e),e.format=e.format||"float64";let s=e.format?.includes("int"),r=s?"int":"number",[a,n]=Kc[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=f6}),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})}}),F6=g("$ZodCheckBigIntFormat",(t,e)=>{Bt.init(t,e);let[s,r]=Hc[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})}}),M6=g("$ZodCheckMaxSize",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!Ee(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:r3(r),code:"too_big",maximum:e.maximum,input:r,inst:t,continue:!e.abort})}}),P6=g("$ZodCheckMinSize",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!Ee(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:r3(r),code:"too_small",minimum:e.minimum,input:r,inst:t,continue:!e.abort})}}),L6=g("$ZodCheckSizeEquals",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!Ee(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:r3(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})}}),j6=g("$ZodCheckMaxLength",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!Ee(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=n3(r);s.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),q6=g("$ZodCheckMinLength",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!Ee(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=n3(r);s.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),_6=g("$ZodCheckLengthEquals",(t,e)=>{Bt.init(t,e),t._zod.when=(s)=>{let r=s.value;return!Ee(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=n3(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=g("$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=()=>{})}),D6=g("$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})}}),B6=g("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=C6),Va.init(t,e)}),V6=g("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=A6),Va.init(t,e)}),N6=g("$ZodCheckIncludes",(t,e)=>{Bt.init(t,e);let s=pe(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})}}),w6=g("$ZodCheckStartsWith",(t,e)=>{Bt.init(t,e);let s=new RegExp(`^${pe(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})}}),K6=g("$ZodCheckEndsWith",(t,e)=>{Bt.init(t,e);let s=new RegExp(`.*${pe(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 kh(t,e,s){if(t.issues.length)e.issues.push(...f0(s,t.issues))}var H6=g("$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)=>kh(a,s,e.property));kh(r,s,e.property);return}}),O6=g("$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})}}),U6=g("$ZodCheckOverwrite",(t,e)=>{Bt.init(t,e),t._zod.check=(s)=>{s.value=e.tx(s.value)}});class zr{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 G6={major:4,minor:0,patch:0},dt=g("$ZodType",(t,e)=>{var s;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=G6;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 c=ge(n),d;for(let E of i){if(E._zod.when){if(!E._zod.when(n))continue}else if(c)continue;let l=n.issues.length,u=E._zod.check(n);if(u instanceof Promise&&h?.async===!1)throw new de;if(d||u instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await u,n.issues.length===l)return;if(!c)c=ge(n,l)});else{if(n.issues.length===l)continue;if(!c)c=ge(n,l)}}if(d)return d.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 de;return h.then((c)=>a(c,r,i))}return a(h,r,i)}}t["~standard"]={validate:(a)=>{try{let n=wr(t,a);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Hr(t,a).then((i)=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Na=g("$ZodString",(t,e)=>{dt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??T6(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}}),At=g("$ZodStringFormat",(t,e)=>{Va.init(t,e),Na.init(t,e)}),W6=g("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=s6),At.init(t,e)}),z6=g("$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());At.init(t,e)}),Q6=g("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=r6),At.init(t,e)}),J6=g("$ZodURL",(t,e)=>{At.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:y6.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})}}}),Y6=g("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=n6()),At.init(t,e)}),X6=g("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=e6),At.init(t,e)}),$6=g("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Jc),At.init(t,e)}),td=g("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Yc),At.init(t,e)}),ed=g("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Xc),At.init(t,e)}),ad=g("$ZodXID",(t,e)=>{e.pattern??(e.pattern=$c),At.init(t,e)}),sd=g("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=t6),At.init(t,e)}),rd=g("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=S6(e)),At.init(t,e)}),nd=g("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=E6),At.init(t,e)}),id=g("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=l6(e)),At.init(t,e)}),hd=g("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=a6),At.init(t,e)}),cd=g("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=i6),At.init(t,e),t._zod.onattach.push((s)=>{let r=s._zod.bag;r.format="ipv4"})}),dd=g("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=h6),At.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})}}}),od=g("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=c6),At.init(t,e)}),yd=g("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=d6),At.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 Qr(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var md=g("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=o6),At.init(t,e),t._zod.onattach.push((s)=>{s._zod.bag.contentEncoding="base64"}),t._zod.check=(s)=>{if(Qr(s.value))return;s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:t,continue:!e.abort})}});function ud(t){if(!Ur.test(t))return!1;let e=t.replace(/[-_]/g,(r)=>r==="-"?"+":"/"),s=e.padEnd(Math.ceil(e.length/4)*4,"=");return Qr(s)}var Ed=g("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ur),At.init(t,e),t._zod.onattach.push((s)=>{s._zod.bag.contentEncoding="base64url"}),t._zod.check=(s)=>{if(ud(s.value))return;s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:t,continue:!e.abort})}}),pd=g("$ZodE164",(t,e)=>{e.pattern??(e.pattern=m6),At.init(t,e)});function ld(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 Sd=g("$ZodJWT",(t,e)=>{At.init(t,e),t._zod.check=(s)=>{if(ld(s.value,e.alg))return;s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:t,continue:!e.abort})}}),Td=g("$ZodCustomStringFormat",(t,e)=>{At.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})}}),Jr=g("$ZodNumber",(t,e)=>{dt.init(t,e),t._zod.pattern=t._zod.bag.pattern??R6,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}}),kd=g("$ZodNumber",(t,e)=>{g6.init(t,e),Jr.init(t,e)}),Yr=g("$ZodBoolean",(t,e)=>{dt.init(t,e),t._zod.pattern=x6,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}}),Xr=g("$ZodBigInt",(t,e)=>{dt.init(t,e),t._zod.pattern=k6,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}}),fd=g("$ZodBigInt",(t,e)=>{F6.init(t,e),Xr.init(t,e)}),Rd=g("$ZodSymbol",(t,e)=>{dt.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}}),xd=g("$ZodUndefined",(t,e)=>{dt.init(t,e),t._zod.pattern=v6,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}}),Id=g("$ZodNull",(t,e)=>{dt.init(t,e),t._zod.pattern=I6,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}}),vd=g("$ZodAny",(t,e)=>{dt.init(t,e),t._zod.parse=(s)=>s}),Ds=g("$ZodUnknown",(t,e)=>{dt.init(t,e),t._zod.parse=(s)=>s}),Cd=g("$ZodNever",(t,e)=>{dt.init(t,e),t._zod.parse=(s,r)=>{return s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:t}),s}}),Ad=g("$ZodVoid",(t,e)=>{dt.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}}),bd=g("$ZodDate",(t,e)=>{dt.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 fh(t,e,s){if(t.issues.length)e.issues.push(...f0(s,t.issues));e.value[s]=t.value}var $r=g("$ZodArray",(t,e)=>{dt.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],c=e.element._zod.run({value:h,issues:[]},r);if(c instanceof Promise)n.push(c.then((d)=>fh(d,s,i)));else fh(c,s,i)}if(n.length)return Promise.all(n).then(()=>s);return s}});function ms(t,e,s){if(t.issues.length)e.issues.push(...f0(s,t.issues));e.value[s]=t.value}function Rh(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 tn=g("$ZodObject",(t,e)=>{dt.init(t,e);let s=a3(()=>{let E=Object.keys(e.shape);for(let u of E)if(!(e.shape[u]instanceof dt))throw Error(`Invalid element at key "${u}": expected a Zod schema`);let l=wc(e.shape);return{shape:e.shape,keys:E,keySet:new Set(E),numKeys:E.length,optionalKeys:new Set(l)}});It(t._zod,"propValues",()=>{let E=e.shape,l={};for(let u in E){let f=E[u]._zod;if(f.values){l[u]??(l[u]=new Set);for(let I of f.values)l[u].add(I)}}return l});let r=(E)=>{let l=new zr(["shape","payload","ctx"]),u=s.value,f=(o)=>{let p=Ce(o);return`shape[${p}]._zod.run({ value: input[${p}], issues: [] }, ctx)`};l.write("const input = payload.value;");let I=Object.create(null),v=0;for(let o of u.keys)I[o]=`key_${v++}`;l.write("const newResult = {}");for(let o of u.keys)if(u.optionalKeys.has(o)){let p=I[o];l.write(`const ${p} = ${f(o)};`);let y=Ce(o);l.write(`
61
+ if (${p}.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
+ ${p}.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 (${p}.value === undefined) {
75
+ if (${y} in input) newResult[${y}] = undefined;
76
76
  } else {
77
- newResult[${R}] = ${a}.value;
77
+ newResult[${y}] = ${p}.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 p=I[o];l.write(`const ${p} = ${f(o)};`),l.write(`
80
+ if (${p}.issues.length) payload.issues = payload.issues.concat(${p}.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 ? [${Ce(o)}, ...iss.path] : [${Ce(o)}]
83
+ })));`),l.write(`newResult[${Ce(o)}] = ${p}.value`)}l.write("payload.value = newResult;"),l.write("return payload;");let R=l.compile();return(o,p)=>R(E,o,p)},a,n=Ma,i=!Ls.jitless,h=i&&Vc.value,c=e.catchall,d;t._zod.parse=(E,l)=>{d??(d=s.value);let u=E.value;if(!n(u))return E.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),E;let f=[];if(i&&h&&l?.async===!1&&l.jitless!==!0){if(!a)a=r(e.shape);E=a(E,l)}else{E.value={};let p=d.shape;for(let y of d.keys){let m=p[y],k=m._zod.run({value:u[y],issues:[]},l),T=m._zod.optin==="optional"&&m._zod.optout==="optional";if(k instanceof Promise)f.push(k.then((x)=>T?Rh(x,E,y,u):ms(x,E,y)));else if(T)Rh(k,E,y,u);else ms(k,E,y)}}if(!c)return f.length?Promise.all(f).then(()=>E):E;let I=[],v=d.keySet,R=c._zod,o=R.def.type;for(let p of Object.keys(u)){if(v.has(p))continue;if(o==="never"){I.push(p);continue}let y=R.run({value:u[p],issues:[]},l);if(y instanceof Promise)f.push(y.then((m)=>ms(m,E,p)));else ms(y,E,p)}if(I.length)E.issues.push({code:"unrecognized_keys",keys:I,input:u,inst:t});if(!f.length)return E;return Promise.all(f).then(()=>{return E})}});function xh(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)=>F0(n,r,n0())))}),e}var en=g("$ZodUnion",(t,e)=>{dt.init(t,e),It(t._zod,"optin",()=>e.options.some((s)=>s._zod.optin==="optional")?"optional":void 0),It(t._zod,"optout",()=>e.options.some((s)=>s._zod.optout==="optional")?"optional":void 0),It(t._zod,"values",()=>{if(e.options.every((s)=>s._zod.values))return new Set(e.options.flatMap((s)=>Array.from(s._zod.values)));return}),It(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)=>s3(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 xh(n,s,t,r);return Promise.all(n).then((i)=>{return xh(i,s,t,r)})}}),Zd=g("$ZodDiscriminatedUnion",(t,e)=>{en.init(t,e);let s=t._zod.parse;It(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,c]of Object.entries(i)){if(!a[h])a[h]=new Set;for(let d of c)a[h].add(d)}}return a});let r=a3(()=>{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 c of h){if(n.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);n.set(c,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}}),gd=g("$ZodIntersection",(t,e)=>{dt.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,c])=>{return Ih(s,h,c)});return Ih(s,n,i)}});function Y3(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=Y3(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=Y3(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 Ih(t,e,s){if(e.issues.length)t.issues.push(...e.issues);if(s.issues.length)t.issues.push(...s.issues);if(ge(t))return t;let r=Y3(e.value,s.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}var i3=g("$ZodTuple",(t,e)=>{dt.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 d=i.length>s.length,E=i.length<r-1;if(d||E)return a.issues.push({input:i,inst:t,origin:"array",...d?{code:"too_big",maximum:s.length}:{code:"too_small",minimum:s.length}}),a}let c=-1;for(let d of s){if(c++,c>=i.length){if(c>=r)continue}let E=d._zod.run({value:i[c],issues:[]},n);if(E instanceof Promise)h.push(E.then((l)=>us(l,a,c)));else us(E,a,c)}if(e.rest){let d=i.slice(s.length);for(let E of d){c++;let l=e.rest._zod.run({value:E,issues:[]},n);if(l instanceof Promise)h.push(l.then((u)=>us(u,a,c)));else us(l,a,c)}}if(h.length)return Promise.all(h).then(()=>a);return a}});function us(t,e,s){if(t.issues.length)e.issues.push(...f0(s,t.issues));e.value[s]=t.value}var Fd=g("$ZodRecord",(t,e)=>{dt.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 c of i)if(typeof c==="string"||typeof c==="number"||typeof c==="symbol"){let d=e.valueType._zod.run({value:a[c],issues:[]},r);if(d instanceof Promise)n.push(d.then((E)=>{if(E.issues.length)s.issues.push(...f0(c,E.issues));s.value[c]=E.value}));else{if(d.issues.length)s.issues.push(...f0(c,d.issues));s.value[c]=d.value}}let h;for(let c in a)if(!i.has(c))h=h??[],h.push(c);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((d)=>F0(d,r,n0())),input:i,path:[i],inst:t}),s.value[h.value]=h.value;continue}let c=e.valueType._zod.run({value:a[i],issues:[]},r);if(c instanceof Promise)n.push(c.then((d)=>{if(d.issues.length)s.issues.push(...f0(i,d.issues));s.value[h.value]=d.value}));else{if(c.issues.length)s.issues.push(...f0(i,c.issues));s.value[h.value]=c.value}}}if(n.length)return Promise.all(n).then(()=>s);return s}}),Md=g("$ZodMap",(t,e)=>{dt.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 c=e.keyType._zod.run({value:i,issues:[]},r),d=e.valueType._zod.run({value:h,issues:[]},r);if(c instanceof Promise||d instanceof Promise)n.push(Promise.all([c,d]).then(([E,l])=>{vh(E,l,s,i,a,t,r)}));else vh(c,d,s,i,a,t,r)}if(n.length)return Promise.all(n).then(()=>s);return s}});function vh(t,e,s,r,a,n,i){if(t.issues.length)if(js.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)=>F0(h,i,n0()))});if(e.issues.length)if(js.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)=>F0(h,i,n0()))});s.value.set(t.value,e.value)}var Pd=g("$ZodSet",(t,e)=>{dt.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((c)=>Ch(c,s)));else Ch(h,s)}if(n.length)return Promise.all(n).then(()=>s);return s}});function Ch(t,e){if(t.issues.length)e.issues.push(...t.issues);e.value.add(t.value)}var Ld=g("$ZodEnum",(t,e)=>{dt.init(t,e);let s=Pr(e.entries);t._zod.values=new Set(s),t._zod.pattern=new RegExp(`^(${s.filter((r)=>js.has(typeof r)).map((r)=>typeof r==="string"?pe(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}}),jd=g("$ZodLiteral",(t,e)=>{dt.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map((s)=>typeof s==="string"?pe(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}}),qd=g("$ZodFile",(t,e)=>{dt.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}}),an=g("$ZodTransform",(t,e)=>{dt.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 de;return s.value=a,s}}),_d=g("$ZodOptional",(t,e)=>{dt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",It(t._zod,"values",()=>{return e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0}),It(t._zod,"pattern",()=>{let s=e.innerType._zod.pattern;return s?new RegExp(`^(${s3(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)}}),Dd=g("$ZodNullable",(t,e)=>{dt.init(t,e),It(t._zod,"optin",()=>e.innerType._zod.optin),It(t._zod,"optout",()=>e.innerType._zod.optout),It(t._zod,"pattern",()=>{let s=e.innerType._zod.pattern;return s?new RegExp(`^(${s3(s.source)}|null)$`):void 0}),It(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)}}),Bd=g("$ZodDefault",(t,e)=>{dt.init(t,e),t._zod.optin="optional",It(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)=>Ah(n,e));return Ah(a,e)}});function Ah(t,e){if(t.value===void 0)t.value=e.defaultValue;return t}var Vd=g("$ZodPrefault",(t,e)=>{dt.init(t,e),t._zod.optin="optional",It(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)}}),Nd=g("$ZodNonOptional",(t,e)=>{dt.init(t,e),It(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)=>bh(n,t));return bh(a,t)}});function bh(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 wd=g("$ZodSuccess",(t,e)=>{dt.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}}),Kd=g("$ZodCatch",(t,e)=>{dt.init(t,e),t._zod.optin="optional",It(t._zod,"optout",()=>e.innerType._zod.optout),It(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)=>F0(i,r,n0()))},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)=>F0(n,r,n0()))},input:s.value}),s.issues=[];return s}}),Hd=g("$ZodNaN",(t,e)=>{dt.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}}),sn=g("$ZodPipe",(t,e)=>{dt.init(t,e),It(t._zod,"values",()=>e.in._zod.values),It(t._zod,"optin",()=>e.in._zod.optin),It(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)=>Zh(n,e,r));return Zh(a,e,r)}});function Zh(t,e,s){if(ge(t))return t;return e.out._zod.run({value:t.value,issues:t.issues},s)}var Od=g("$ZodReadonly",(t,e)=>{dt.init(t,e),It(t._zod,"propValues",()=>e.innerType._zod.propValues),It(t._zod,"values",()=>e.innerType._zod.values),It(t._zod,"optin",()=>e.innerType._zod.optin),It(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 Ud=g("$ZodTemplateLiteral",(t,e)=>{dt.init(t,e);let s=[];for(let r of e.parts)if(r instanceof dt){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||Nc.has(typeof r))s.push(pe(`${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}}),Gd=g("$ZodPromise",(t,e)=>{dt.init(t,e),t._zod.parse=(s,r)=>{return Promise.resolve(s.value).then((a)=>e.innerType._zod.run({value:a,issues:[]},r))}}),Wd=g("$ZodLazy",(t,e)=>{dt.init(t,e),It(t._zod,"innerType",()=>e.getter()),It(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),It(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),It(t._zod,"optin",()=>t._zod.innerType._zod.optin),It(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(s,r)=>{return t._zod.innerType._zod.run(s,r)}}),zd=g("$ZodCustom",(t,e)=>{Bt.init(t,e),dt.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)=>Fh(n,s,r,t));Fh(a,s,r,t);return}});function Fh(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(Oc(a))}}var rn={};me(rn,{zhTW:()=>SS,zhCN:()=>pS,vi:()=>uS,ur:()=>yS,ua:()=>dS,tr:()=>hS,th:()=>rS,ta:()=>aS,sv:()=>tS,sl:()=>Xl,ru:()=>Jl,pt:()=>zl,ps:()=>Ol,pl:()=>Gl,ota:()=>Kl,no:()=>Nl,nl:()=>Bl,ms:()=>_l,mk:()=>jl,ko:()=>Pl,kh:()=>Fl,ja:()=>Zl,it:()=>Al,id:()=>vl,hu:()=>xl,he:()=>fl,frCA:()=>Tl,fr:()=>ll,fi:()=>El,fa:()=>ml,es:()=>ol,eo:()=>cl,en:()=>Qd,de:()=>sl,cs:()=>el,ca:()=>$p,be:()=>Yp,az:()=>Qp,ar:()=>Wp});var Gp=()=>{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 Wp(){return{localeError:Gp()}}var zp=()=>{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 Qp(){return{localeError:zp()}}function Mh(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 Jp=()=>{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),c=Mh(h,i.unit.one,i.unit.few,i.unit.many);return`Занадта вялікі: чакалася, што ${a.origin??"значэнне"} павінна ${i.verb} ${n}${a.maximum.toString()} ${c}`}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),c=Mh(h,i.unit.one,i.unit.few,i.unit.many);return`Занадта малы: чакалася, што ${a.origin} павінна ${i.verb} ${n}${a.minimum.toString()} ${c}`}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 Yp(){return{localeError:Jp()}}var Xp=()=>{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 $p(){return{localeError:Xp()}}var tl=()=>{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 el(){return{localeError:tl()}}var al=()=>{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 sl(){return{localeError:al()}}var rl=(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},nl=()=>{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 ${rl(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 Qd(){return{localeError:nl()}}var il=(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},hl=()=>{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 ${il(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 cl(){return{localeError:hl()}}var dl=()=>{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 ol(){return{localeError:dl()}}var yl=()=>{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 ml(){return{localeError:yl()}}var ul=()=>{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 El(){return{localeError:ul()}}var pl=()=>{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 ll(){return{localeError:pl()}}var Sl=()=>{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 Tl(){return{localeError:Sl()}}var kl=()=>{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 fl(){return{localeError:kl()}}var Rl=()=>{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 xl(){return{localeError:Rl()}}var Il=()=>{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 vl(){return{localeError:Il()}}var Cl=()=>{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 Al(){return{localeError:Cl()}}var bl=()=>{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 Zl(){return{localeError:bl()}}var gl=()=>{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 Fl(){return{localeError:gl()}}var Ml=()=>{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),c=h?.unit??"요소";if(h)return`${a.origin??"값"}이 너무 큽니다: ${a.maximum.toString()}${c} ${n}${i}`;return`${a.origin??"값"}이 너무 큽니다: ${a.maximum.toString()} ${n}${i}`}case"too_small":{let n=a.inclusive?"이상":"초과",i=n==="이상"?"이어야 합니다":"여야 합니다",h=e(a.origin),c=h?.unit??"요소";if(h)return`${a.origin??"값"}이 너무 작습니다: ${a.minimum.toString()}${c} ${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 Pl(){return{localeError:Ml()}}var Ll=()=>{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 jl(){return{localeError:Ll()}}var ql=()=>{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 _l(){return{localeError:ql()}}var Dl=()=>{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 Bl(){return{localeError:Dl()}}var Vl=()=>{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 Nl(){return{localeError:Vl()}}var wl=()=>{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 Kl(){return{localeError:wl()}}var Hl=()=>{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 Ol(){return{localeError:Hl()}}var Ul=()=>{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 Gl(){return{localeError:Ul()}}var Wl=()=>{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 zl(){return{localeError:Wl()}}function Ph(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 Ql=()=>{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),c=Ph(h,i.unit.one,i.unit.few,i.unit.many);return`Слишком большое значение: ожидалось, что ${a.origin??"значение"} будет иметь ${n}${a.maximum.toString()} ${c}`}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),c=Ph(h,i.unit.one,i.unit.few,i.unit.many);return`Слишком маленькое значение: ожидалось, что ${a.origin} будет иметь ${n}${a.minimum.toString()} ${c}`}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 Jl(){return{localeError:Ql()}}var Yl=()=>{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 Xl(){return{localeError:Yl()}}var $l=()=>{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 tS(){return{localeError:$l()}}var eS=()=>{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 aS(){return{localeError:eS()}}var sS=()=>{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 rS(){return{localeError:sS()}}var nS=(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},iS=()=>{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 ${nS(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 hS(){return{localeError:iS()}}var cS=()=>{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 dS(){return{localeError:cS()}}var oS=()=>{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 yS(){return{localeError:oS()}}var mS=()=>{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 uS(){return{localeError:mS()}}var ES=()=>{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 pS(){return{localeError:ES()}}var lS=()=>{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 SS(){return{localeError:lS()}}var Jd=Symbol("ZodOutput"),Yd=Symbol("ZodInput");class h3{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 nn(){return new h3}var ie=nn();function Xd(t,e){return new t({type:"string",...H(e)})}function $d(t,e){return new t({type:"string",coerce:!0,...H(e)})}function hn(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...H(e)})}function Bs(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...H(e)})}function cn(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...H(e)})}function dn(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(e)})}function on(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(e)})}function yn(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(e)})}function mn(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...H(e)})}function un(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...H(e)})}function En(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(e)})}function pn(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...H(e)})}function ln(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(e)})}function Sn(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...H(e)})}function Tn(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...H(e)})}function kn(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(e)})}function fn(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(e)})}function Rn(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(e)})}function xn(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(e)})}function In(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(e)})}function vn(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...H(e)})}function Cn(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...H(e)})}function An(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...H(e)})}function bn(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...H(e)})}var to={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function eo(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(e)})}function ao(t,e){return new t({type:"string",format:"date",check:"string_format",...H(e)})}function so(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...H(e)})}function ro(t,e){return new t({type:"string",format:"duration",check:"string_format",...H(e)})}function no(t,e){return new t({type:"number",checks:[],...H(e)})}function io(t,e){return new t({type:"number",coerce:!0,checks:[],...H(e)})}function ho(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...H(e)})}function co(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...H(e)})}function oo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...H(e)})}function yo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...H(e)})}function mo(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...H(e)})}function uo(t,e){return new t({type:"boolean",...H(e)})}function Eo(t,e){return new t({type:"boolean",coerce:!0,...H(e)})}function po(t,e){return new t({type:"bigint",...H(e)})}function lo(t,e){return new t({type:"bigint",coerce:!0,...H(e)})}function So(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...H(e)})}function To(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...H(e)})}function ko(t,e){return new t({type:"symbol",...H(e)})}function fo(t,e){return new t({type:"undefined",...H(e)})}function Ro(t,e){return new t({type:"null",...H(e)})}function xo(t){return new t({type:"any"})}function Vs(t){return new t({type:"unknown"})}function Io(t,e){return new t({type:"never",...H(e)})}function vo(t,e){return new t({type:"void",...H(e)})}function Co(t,e){return new t({type:"date",...H(e)})}function Ao(t,e){return new t({type:"date",coerce:!0,...H(e)})}function bo(t,e){return new t({type:"nan",...H(e)})}function oe(t,e){return new Gr({check:"less_than",...H(e),value:t,inclusive:!1})}function Z0(t,e){return new Gr({check:"less_than",...H(e),value:t,inclusive:!0})}function ye(t,e){return new Wr({check:"greater_than",...H(e),value:t,inclusive:!1})}function m0(t,e){return new Wr({check:"greater_than",...H(e),value:t,inclusive:!0})}function Zo(t){return ye(0,t)}function go(t){return oe(0,t)}function Fo(t){return Z0(0,t)}function Mo(t){return m0(0,t)}function La(t,e){return new Z6({check:"multiple_of",...H(e),value:t})}function c3(t,e){return new M6({check:"max_size",...H(e),maximum:t})}function ja(t,e){return new P6({check:"min_size",...H(e),minimum:t})}function Zn(t,e){return new L6({check:"size_equals",...H(e),size:t})}function d3(t,e){return new j6({check:"max_length",...H(e),maximum:t})}function _e(t,e){return new q6({check:"min_length",...H(e),minimum:t})}function o3(t,e){return new _6({check:"length_equals",...H(e),length:t})}function gn(t,e){return new D6({check:"string_format",format:"regex",...H(e),pattern:t})}function Fn(t){return new B6({check:"string_format",format:"lowercase",...H(t)})}function Mn(t){return new V6({check:"string_format",format:"uppercase",...H(t)})}function Pn(t,e){return new N6({check:"string_format",format:"includes",...H(e),includes:t})}function Ln(t,e){return new w6({check:"string_format",format:"starts_with",...H(e),prefix:t})}function jn(t,e){return new K6({check:"string_format",format:"ends_with",...H(e),suffix:t})}function Po(t,e,s){return new H6({check:"property",property:t,schema:e,...H(s)})}function qn(t,e){return new O6({check:"mime_type",mime:t,...H(e)})}function le(t){return new U6({check:"overwrite",tx:t})}function _n(t){return le((e)=>e.normalize(t))}function Dn(){return le((t)=>t.trim())}function Bn(){return le((t)=>t.toLowerCase())}function Vn(){return le((t)=>t.toUpperCase())}function Nn(t,e,s){return new t({type:"array",element:e,...H(s)})}function TS(t,e,s){return new t({type:"union",options:e,...H(s)})}function kS(t,e,s,r){return new t({type:"union",options:s,discriminator:e,...H(r)})}function fS(t,e,s){return new t({type:"intersection",left:e,right:s})}function Lo(t,e,s,r){let a=s instanceof dt;return new t({type:"tuple",items:e,rest:a?s:null,...H(a?r:s)})}function RS(t,e,s,r){return new t({type:"record",keyType:e,valueType:s,...H(r)})}function xS(t,e,s,r){return new t({type:"map",keyType:e,valueType:s,...H(r)})}function IS(t,e,s){return new t({type:"set",valueType:e,...H(s)})}function vS(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 CS(t,e,s){return new t({type:"enum",entries:e,...H(s)})}function AS(t,e,s){return new t({type:"literal",values:Array.isArray(e)?e:[e],...H(s)})}function jo(t,e){return new t({type:"file",...H(e)})}function bS(t,e){return new t({type:"transform",transform:e})}function ZS(t,e){return new t({type:"optional",innerType:e})}function gS(t,e){return new t({type:"nullable",innerType:e})}function FS(t,e,s){return new t({type:"default",innerType:e,get defaultValue(){return typeof s==="function"?s():s}})}function MS(t,e,s){return new t({type:"nonoptional",innerType:e,...H(s)})}function PS(t,e){return new t({type:"success",innerType:e})}function LS(t,e,s){return new t({type:"catch",innerType:e,catchValue:typeof s==="function"?s:()=>s})}function jS(t,e,s){return new t({type:"pipe",in:e,out:s})}function qS(t,e){return new t({type:"readonly",innerType:e})}function _S(t,e,s){return new t({type:"template_literal",parts:e,...H(s)})}function DS(t,e){return new t({type:"lazy",getter:e})}function BS(t,e){return new t({type:"promise",innerType:e})}function qo(t,e,s){let r=H(s);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function _o(t,e,s){return new t({type:"custom",check:"custom",fn:e,...H(s)})}function Do(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((u)=>typeof u==="string"?u.toLowerCase():u),a=a.map((u)=>typeof u==="string"?u.toLowerCase():u);let n=new Set(r),i=new Set(a),h=t.Pipe??sn,c=t.Boolean??Yr,d=t.String??Na,E=new(t.Transform??an)({type:"transform",transform:(u,f)=>{let I=u;if(s.case!=="sensitive")I=I.toLowerCase();if(n.has(I))return!0;else if(i.has(I))return!1;else return f.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...i],input:f.value,inst:E}),{}},error:s.error}),l=new h({type:"pipe",in:new d({type:"string",error:s.error}),out:E,error:s.error});return new h({type:"pipe",in:l,out:new c({type:"boolean",error:s.error}),error:s.error})}function Bo(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 wn{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?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=t(...r);return this._def.output?qs(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 _s(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?_s(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 i3({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 Vo(t){return new wn({type:"function",input:Array.isArray(t?.input)?Lo(i3,t?.input):t?.input??Nn($r,Vs(Ds)),output:t?.output??Vs(Ds)})}class Ns{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 d={...e,schemaPath:[...e.schemaPath,t],path:e.path},E=t._zod.parent;if(E)i.ref=E,this.process(E,d),this.seen.get(E).isParent=!0;else{let l=i.schema;switch(r.type){case"string":{let u=l;u.type="string";let{minimum:f,maximum:I,format:v,patterns:R,contentEncoding:o}=t._zod.bag;if(typeof f==="number")u.minLength=f;if(typeof I==="number")u.maxLength=I;if(v){if(u.format=a[v]??v,u.format==="")delete u.format}if(o)u.contentEncoding=o;if(R&&R.size>0){let p=[...R];if(p.length===1)u.pattern=p[0].source;else if(p.length>1)i.schema.allOf=[...p.map((y)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:y.source}))]}break}case"number":{let u=l,{minimum:f,maximum:I,format:v,multipleOf:R,exclusiveMaximum:o,exclusiveMinimum:p}=t._zod.bag;if(typeof v==="string"&&v.includes("int"))u.type="integer";else u.type="number";if(typeof p==="number")u.exclusiveMinimum=p;if(typeof f==="number"){if(u.minimum=f,typeof p==="number")if(p>=f)delete u.minimum;else delete u.exclusiveMinimum}if(typeof o==="number")u.exclusiveMaximum=o;if(typeof I==="number"){if(u.maximum=I,typeof o==="number")if(o<=I)delete u.maximum;else delete u.exclusiveMaximum}if(typeof R==="number")u.multipleOf=R;break}case"boolean":{let u=l;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":{l.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{l.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=l,{minimum:f,maximum:I}=t._zod.bag;if(typeof f==="number")u.minItems=f;if(typeof I==="number")u.maxItems=I;u.type="array",u.items=this.process(r.element,{...d,path:[...d.path,"items"]});break}case"object":{let u=l;u.type="object",u.properties={};let f=r.shape;for(let R in f)u.properties[R]=this.process(f[R],{...d,path:[...d.path,"properties",R]});let I=new Set(Object.keys(f)),v=new Set([...I].filter((R)=>{let o=r.shape[R]._zod;if(this.io==="input")return o.optin===void 0;else return o.optout===void 0}));if(v.size>0)u.required=Array.from(v);if(r.catchall?._zod.def.type==="never")u.additionalProperties=!1;else if(!r.catchall){if(this.io==="output")u.additionalProperties=!1}else if(r.catchall)u.additionalProperties=this.process(r.catchall,{...d,path:[...d.path,"additionalProperties"]});break}case"union":{let u=l;u.anyOf=r.options.map((f,I)=>this.process(f,{...d,path:[...d.path,"anyOf",I]}));break}case"intersection":{let u=l,f=this.process(r.left,{...d,path:[...d.path,"allOf",0]}),I=this.process(r.right,{...d,path:[...d.path,"allOf",1]}),v=(o)=>("allOf"in o)&&Object.keys(o).length===1,R=[...v(f)?f.allOf:[f],...v(I)?I.allOf:[I]];u.allOf=R;break}case"tuple":{let u=l;u.type="array";let f=r.items.map((R,o)=>this.process(R,{...d,path:[...d.path,"prefixItems",o]}));if(this.target==="draft-2020-12")u.prefixItems=f;else u.items=f;if(r.rest){let R=this.process(r.rest,{...d,path:[...d.path,"items"]});if(this.target==="draft-2020-12")u.items=R;else u.additionalItems=R}if(r.rest)u.items=this.process(r.rest,{...d,path:[...d.path,"items"]});let{minimum:I,maximum:v}=t._zod.bag;if(typeof I==="number")u.minItems=I;if(typeof v==="number")u.maxItems=v;break}case"record":{let u=l;u.type="object",u.propertyNames=this.process(r.keyType,{...d,path:[...d.path,"propertyNames"]}),u.additionalProperties=this.process(r.valueType,{...d,path:[...d.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=l,f=Pr(r.entries);if(f.every((I)=>typeof I==="number"))u.type="number";if(f.every((I)=>typeof I==="string"))u.type="string";u.enum=f;break}case"literal":{let u=l,f=[];for(let I of r.values)if(I===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof I==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else f.push(Number(I));else f.push(I);if(f.length===0);else if(f.length===1){let I=f[0];u.type=I===null?"null":typeof I,u.const=I}else{if(f.every((I)=>typeof I==="number"))u.type="number";if(f.every((I)=>typeof I==="string"))u.type="string";if(f.every((I)=>typeof I==="boolean"))u.type="string";if(f.every((I)=>I===null))u.type="null";u.enum=f}break}case"file":{let u=l,f={type:"string",format:"binary",contentEncoding:"binary"},{minimum:I,maximum:v,mime:R}=t._zod.bag;if(I!==void 0)f.minLength=I;if(v!==void 0)f.maxLength=v;if(R)if(R.length===1)f.contentMediaType=R[0],Object.assign(u,f);else u.anyOf=R.map((o)=>{return{...f,contentMediaType:o}});else Object.assign(u,f);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let u=this.process(r.innerType,d);l.anyOf=[u,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,d),i.ref=r.innerType;break}case"success":{let u=l;u.type="boolean";break}case"default":{this.process(r.innerType,d),i.ref=r.innerType,l.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{if(this.process(r.innerType,d),i.ref=r.innerType,this.io==="input")l._prefault=JSON.parse(JSON.stringify(r.defaultValue));break}case"catch":{this.process(r.innerType,d),i.ref=r.innerType;let u;try{u=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}l.default=u;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let u=l,f=t._zod.pattern;if(!f)throw Error("Pattern not found in template literal");u.type="string",u.pattern=f.source;break}case"pipe":{let u=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(u,d),i.ref=u;break}case"readonly":{this.process(r.innerType,d),i.ref=r.innerType,l.readOnly=!0;break}case"promise":{this.process(r.innerType,d),i.ref=r.innerType;break}case"optional":{this.process(r.innerType,d),i.ref=r.innerType;break}case"lazy":{let u=t._zod.innerType;this.process(u,d),i.ref=u;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(t);if(c)Object.assign(i.schema,c);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=(d)=>{let E=this.target==="draft-2020-12"?"$defs":"definitions";if(s.external){let f=s.external.registry.get(d[0])?.id;if(f)return{ref:s.external.uri(f)};let I=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=I,{defId:I,ref:`${s.external.uri("__shared")}#/${E}/${I}`}}if(d[1]===r)return{ref:"#"};let l=`#/${E}/`,u=d[1].schema.id??`__schema${this.counter++}`;return{defId:u,ref:l+u}},n=(d)=>{if(d[1].schema.$ref)return;let E=d[1],{ref:l,defId:u}=a(d);if(E.def={...E.schema},u)E.defId=u;let f=E.schema;for(let I in f)delete f[I];f.$ref=l};for(let d of this.seen.entries()){let E=d[1];if(t===d[0]){n(d);continue}if(s.external){let l=s.external.registry.get(d[0])?.id;if(t!==d[0]&&l){n(d);continue}}if(this.metadataRegistry.get(d[0])?.id){n(d);continue}if(E.cycle){if(s.cycles==="throw")throw Error(`Cycle detected: #/${E.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(d);continue}if(E.count>1){if(s.reused==="ref"){n(d);continue}}}let i=(d,E)=>{let l=this.seen.get(d),u=l.def??l.schema,f={...u};if(l.ref===null)return;let I=l.ref;if(l.ref=null,I){i(I,E);let v=this.seen.get(I).schema;if(v.$ref&&E.target==="draft-7")u.allOf=u.allOf??[],u.allOf.push(v);else Object.assign(u,v),Object.assign(u,f)}if(!l.isParent)this.override({zodSchema:d,jsonSchema:u,path:l.path??[]})};for(let d of[...this.seen.entries()].reverse())i(d[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 c=s.external?.defs??{};for(let d of this.seen.entries()){let E=d[1];if(E.def&&E.defId)c[E.defId]=E.def}if(!s.external&&Object.keys(c).length>0)if(this.target==="draft-2020-12")h.$defs=c;else h.definitions=c;try{return JSON.parse(JSON.stringify(h))}catch(d){throw Error("Error converting schema to JSON.")}}}function No(t,e){if(t instanceof h3){let r=new Ns(e),a={};for(let h of t._idmap.entries()){let[c,d]=h;r.process(d)}let n={},i={registry:t,uri:e?.uri||((h)=>h),defs:a};for(let h of t._idmap.entries()){let[c,d]=h;n[c]=r.emit(d,{...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 Ns(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 VS={},NS=g("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");dt.init(t,e),t.def=e,t.parse=(s,r)=>qs(t,s,r,{callee:t.parse}),t.safeParse=(s,r)=>wr(t,s,r),t.parseAsync=async(s,r)=>_s(t,s,r,{callee:t.parseAsync}),t.safeParseAsync=async(s,r)=>Hr(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)=>P0(t,s,r),t.brand=()=>t,t.register=(s,r)=>{return s.add(t,r),t}}),nR=g("ZodMiniObject",(t,e)=>{tn.init(t,e),NS.init(t,e),Tt.defineLazy(t,"shape",()=>e.shape)});var Ae={};me(Ae,{xid:()=>tT,void:()=>RT,uuidv7:()=>WS,uuidv6:()=>GS,uuidv4:()=>US,uuid:()=>OS,url:()=>zS,uppercase:()=>Mn,unknown:()=>gt,union:()=>Ct,undefined:()=>kT,ulid:()=>$S,uint64:()=>ST,uint32:()=>ET,tuple:()=>CT,trim:()=>Dn,treeifyError:()=>Wc,transform:()=>Si,toUpperCase:()=>Vn,toLowerCase:()=>Bn,toJSONSchema:()=>No,templateLiteral:()=>jT,symbol:()=>TT,superRefine:()=>M4,success:()=>PT,stringbool:()=>DT,stringFormat:()=>oT,string:()=>q,strictObject:()=>vT,startsWith:()=>Ln,size:()=>Zn,setErrorMap:()=>NT,set:()=>ZT,safeParseAsync:()=>Qo,safeParse:()=>zo,registry:()=>nn,regexes:()=>Or,regex:()=>gn,refine:()=>F4,record:()=>bt,readonly:()=>I4,property:()=>Po,promise:()=>qT,prettifyError:()=>Qc,preprocess:()=>Ri,prefault:()=>l4,positive:()=>Zo,pipe:()=>Hs,partialRecord:()=>AT,parseAsync:()=>Wo,parse:()=>Go,overwrite:()=>le,optional:()=>Ft,object:()=>J,number:()=>vt,nullish:()=>MT,nullable:()=>Ks,null:()=>p3,normalize:()=>_n,nonpositive:()=>Fo,nonoptional:()=>S4,nonnegative:()=>Mo,never:()=>l3,negative:()=>go,nativeEnum:()=>gT,nanoid:()=>JS,nan:()=>LT,multipleOf:()=>La,minSize:()=>ja,minLength:()=>_e,mime:()=>qn,maxSize:()=>c3,maxLength:()=>d3,map:()=>bT,lte:()=>Z0,lt:()=>oe,lowercase:()=>Fn,looseObject:()=>s0,locales:()=>rn,literal:()=>tt,length:()=>o3,lazy:()=>A4,ksuid:()=>eT,keyof:()=>IT,jwt:()=>dT,json:()=>BT,iso:()=>Kn,ipv6:()=>sT,ipv4:()=>aT,intersection:()=>T3,int64:()=>lT,int32:()=>uT,int:()=>X3,instanceof:()=>_T,includes:()=>Pn,guid:()=>HS,gte:()=>m0,gt:()=>ye,globalRegistry:()=>ie,getErrorMap:()=>wT,function:()=>Vo,formatError:()=>Dr,float64:()=>mT,float32:()=>yT,flattenError:()=>_r,file:()=>FT,enum:()=>h0,endsWith:()=>jn,emoji:()=>QS,email:()=>KS,e164:()=>cT,discriminatedUnion:()=>Ei,date:()=>xT,custom:()=>g4,cuid2:()=>XS,cuid:()=>YS,core:()=>jc,config:()=>n0,coerce:()=>P4,clone:()=>P0,cidrv6:()=>nT,cidrv4:()=>rT,check:()=>Z4,catch:()=>f4,boolean:()=>Kt,bigint:()=>pT,base64url:()=>hT,base64:()=>iT,array:()=>kt,any:()=>fT,_default:()=>E4,_ZodString:()=>Wn,ZodXID:()=>ei,ZodVoid:()=>s4,ZodUnknown:()=>e4,ZodUnion:()=>ui,ZodUndefined:()=>Xo,ZodUUID:()=>O0,ZodURL:()=>Qn,ZodULID:()=>ti,ZodType:()=>Et,ZodTuple:()=>h4,ZodTransform:()=>li,ZodTemplateLiteral:()=>v4,ZodSymbol:()=>Yo,ZodSuccess:()=>T4,ZodStringFormat:()=>Zt,ZodString:()=>y3,ZodSet:()=>d4,ZodRecord:()=>pi,ZodRealError:()=>wa,ZodReadonly:()=>x4,ZodPromise:()=>b4,ZodPrefault:()=>p4,ZodPipe:()=>fi,ZodOptional:()=>Ti,ZodObject:()=>S3,ZodNumberFormat:()=>Oe,ZodNumber:()=>m3,ZodNullable:()=>m4,ZodNull:()=>$o,ZodNonOptional:()=>ki,ZodNever:()=>a4,ZodNanoID:()=>Yn,ZodNaN:()=>R4,ZodMap:()=>c4,ZodLiteral:()=>o4,ZodLazy:()=>C4,ZodKSUID:()=>ai,ZodJWT:()=>oi,ZodIssueCode:()=>VT,ZodIntersection:()=>i4,ZodISOTime:()=>Un,ZodISODuration:()=>Gn,ZodISODateTime:()=>Hn,ZodISODate:()=>On,ZodIPv6:()=>ri,ZodIPv4:()=>si,ZodGUID:()=>ws,ZodFile:()=>y4,ZodError:()=>wS,ZodEnum:()=>qa,ZodEmoji:()=>Jn,ZodEmail:()=>zn,ZodE164:()=>di,ZodDiscriminatedUnion:()=>n4,ZodDefault:()=>u4,ZodDate:()=>mi,ZodCustomStringFormat:()=>Jo,ZodCustom:()=>k3,ZodCatch:()=>k4,ZodCUID2:()=>$n,ZodCUID:()=>Xn,ZodCIDRv6:()=>ii,ZodCIDRv4:()=>ni,ZodBoolean:()=>u3,ZodBigIntFormat:()=>yi,ZodBigInt:()=>E3,ZodBase64URL:()=>ci,ZodBase64:()=>hi,ZodArray:()=>r4,ZodAny:()=>t4,TimePrecision:()=>to,NEVER:()=>qc,$output:()=>Jd,$input:()=>Yd,$brand:()=>_c});var Kn={};me(Kn,{time:()=>Ho,duration:()=>Oo,datetime:()=>wo,date:()=>Ko,ZodISOTime:()=>Un,ZodISODuration:()=>Gn,ZodISODateTime:()=>Hn,ZodISODate:()=>On});var Hn=g("ZodISODateTime",(t,e)=>{rd.init(t,e),Zt.init(t,e)});function wo(t){return eo(Hn,t)}var On=g("ZodISODate",(t,e)=>{nd.init(t,e),Zt.init(t,e)});function Ko(t){return ao(On,t)}var Un=g("ZodISOTime",(t,e)=>{id.init(t,e),Zt.init(t,e)});function Ho(t){return so(Un,t)}var Gn=g("ZodISODuration",(t,e)=>{hd.init(t,e),Zt.init(t,e)});function Oo(t){return ro(Gn,t)}var Uo=(t,e)=>{qr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:(s)=>Dr(t,s)},flatten:{value:(s)=>_r(t,s)},addIssue:{value:(s)=>t.issues.push(s)},addIssues:{value:(s)=>t.issues.push(...s)},isEmpty:{get(){return t.issues.length===0}}})},wS=g("ZodError",Uo),wa=g("ZodError",Uo,{Parent:Error}),Go=Br(wa),Wo=Vr(wa),zo=Nr(wa),Qo=Kr(wa),Et=g("ZodType",(t,e)=>{return dt.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)=>P0(t,s,r),t.brand=()=>t,t.register=(s,r)=>{return s.add(t,r),t},t.parse=(s,r)=>Go(t,s,r,{callee:t.parse}),t.safeParse=(s,r)=>zo(t,s,r),t.parseAsync=async(s,r)=>Wo(t,s,r,{callee:t.parseAsync}),t.safeParseAsync=async(s,r)=>Qo(t,s,r),t.spa=t.safeParseAsync,t.refine=(s,r)=>t.check(F4(s,r)),t.superRefine=(s)=>t.check(M4(s)),t.overwrite=(s)=>t.check(le(s)),t.optional=()=>Ft(t),t.nullable=()=>Ks(t),t.nullish=()=>Ft(Ks(t)),t.nonoptional=(s)=>S4(t,s),t.array=()=>kt(t),t.or=(s)=>Ct([t,s]),t.and=(s)=>T3(t,s),t.transform=(s)=>Hs(t,Si(s)),t.default=(s)=>E4(t,s),t.prefault=(s)=>l4(t,s),t.catch=(s)=>f4(t,s),t.pipe=(s)=>Hs(t,s),t.readonly=()=>I4(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}),Wn=g("_ZodString",(t,e)=>{Na.init(t,e),Et.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(gn(...r)),t.includes=(...r)=>t.check(Pn(...r)),t.startsWith=(...r)=>t.check(Ln(...r)),t.endsWith=(...r)=>t.check(jn(...r)),t.min=(...r)=>t.check(_e(...r)),t.max=(...r)=>t.check(d3(...r)),t.length=(...r)=>t.check(o3(...r)),t.nonempty=(...r)=>t.check(_e(1,...r)),t.lowercase=(r)=>t.check(Fn(r)),t.uppercase=(r)=>t.check(Mn(r)),t.trim=()=>t.check(Dn()),t.normalize=(...r)=>t.check(_n(...r)),t.toLowerCase=()=>t.check(Bn()),t.toUpperCase=()=>t.check(Vn())}),y3=g("ZodString",(t,e)=>{Na.init(t,e),Wn.init(t,e),t.email=(s)=>t.check(hn(zn,s)),t.url=(s)=>t.check(mn(Qn,s)),t.jwt=(s)=>t.check(bn(oi,s)),t.emoji=(s)=>t.check(un(Jn,s)),t.guid=(s)=>t.check(Bs(ws,s)),t.uuid=(s)=>t.check(cn(O0,s)),t.uuidv4=(s)=>t.check(dn(O0,s)),t.uuidv6=(s)=>t.check(on(O0,s)),t.uuidv7=(s)=>t.check(yn(O0,s)),t.nanoid=(s)=>t.check(En(Yn,s)),t.guid=(s)=>t.check(Bs(ws,s)),t.cuid=(s)=>t.check(pn(Xn,s)),t.cuid2=(s)=>t.check(ln($n,s)),t.ulid=(s)=>t.check(Sn(ti,s)),t.base64=(s)=>t.check(vn(hi,s)),t.base64url=(s)=>t.check(Cn(ci,s)),t.xid=(s)=>t.check(Tn(ei,s)),t.ksuid=(s)=>t.check(kn(ai,s)),t.ipv4=(s)=>t.check(fn(si,s)),t.ipv6=(s)=>t.check(Rn(ri,s)),t.cidrv4=(s)=>t.check(xn(ni,s)),t.cidrv6=(s)=>t.check(In(ii,s)),t.e164=(s)=>t.check(An(di,s)),t.datetime=(s)=>t.check(wo(s)),t.date=(s)=>t.check(Ko(s)),t.time=(s)=>t.check(Ho(s)),t.duration=(s)=>t.check(Oo(s))});function q(t){return Xd(y3,t)}var Zt=g("ZodStringFormat",(t,e)=>{At.init(t,e),Wn.init(t,e)}),zn=g("ZodEmail",(t,e)=>{Q6.init(t,e),Zt.init(t,e)});function KS(t){return hn(zn,t)}var ws=g("ZodGUID",(t,e)=>{W6.init(t,e),Zt.init(t,e)});function HS(t){return Bs(ws,t)}var O0=g("ZodUUID",(t,e)=>{z6.init(t,e),Zt.init(t,e)});function OS(t){return cn(O0,t)}function US(t){return dn(O0,t)}function GS(t){return on(O0,t)}function WS(t){return yn(O0,t)}var Qn=g("ZodURL",(t,e)=>{J6.init(t,e),Zt.init(t,e)});function zS(t){return mn(Qn,t)}var Jn=g("ZodEmoji",(t,e)=>{Y6.init(t,e),Zt.init(t,e)});function QS(t){return un(Jn,t)}var Yn=g("ZodNanoID",(t,e)=>{X6.init(t,e),Zt.init(t,e)});function JS(t){return En(Yn,t)}var Xn=g("ZodCUID",(t,e)=>{$6.init(t,e),Zt.init(t,e)});function YS(t){return pn(Xn,t)}var $n=g("ZodCUID2",(t,e)=>{td.init(t,e),Zt.init(t,e)});function XS(t){return ln($n,t)}var ti=g("ZodULID",(t,e)=>{ed.init(t,e),Zt.init(t,e)});function $S(t){return Sn(ti,t)}var ei=g("ZodXID",(t,e)=>{ad.init(t,e),Zt.init(t,e)});function tT(t){return Tn(ei,t)}var ai=g("ZodKSUID",(t,e)=>{sd.init(t,e),Zt.init(t,e)});function eT(t){return kn(ai,t)}var si=g("ZodIPv4",(t,e)=>{cd.init(t,e),Zt.init(t,e)});function aT(t){return fn(si,t)}var ri=g("ZodIPv6",(t,e)=>{dd.init(t,e),Zt.init(t,e)});function sT(t){return Rn(ri,t)}var ni=g("ZodCIDRv4",(t,e)=>{od.init(t,e),Zt.init(t,e)});function rT(t){return xn(ni,t)}var ii=g("ZodCIDRv6",(t,e)=>{yd.init(t,e),Zt.init(t,e)});function nT(t){return In(ii,t)}var hi=g("ZodBase64",(t,e)=>{md.init(t,e),Zt.init(t,e)});function iT(t){return vn(hi,t)}var ci=g("ZodBase64URL",(t,e)=>{Ed.init(t,e),Zt.init(t,e)});function hT(t){return Cn(ci,t)}var di=g("ZodE164",(t,e)=>{pd.init(t,e),Zt.init(t,e)});function cT(t){return An(di,t)}var oi=g("ZodJWT",(t,e)=>{Sd.init(t,e),Zt.init(t,e)});function dT(t){return bn(oi,t)}var Jo=g("ZodCustomStringFormat",(t,e)=>{Td.init(t,e),Zt.init(t,e)});function oT(t,e,s={}){return Bo(Jo,t,e,s)}var m3=g("ZodNumber",(t,e)=>{Jr.init(t,e),Et.init(t,e),t.gt=(r,a)=>t.check(ye(r,a)),t.gte=(r,a)=>t.check(m0(r,a)),t.min=(r,a)=>t.check(m0(r,a)),t.lt=(r,a)=>t.check(oe(r,a)),t.lte=(r,a)=>t.check(Z0(r,a)),t.max=(r,a)=>t.check(Z0(r,a)),t.int=(r)=>t.check(X3(r)),t.safe=(r)=>t.check(X3(r)),t.positive=(r)=>t.check(ye(0,r)),t.nonnegative=(r)=>t.check(m0(0,r)),t.negative=(r)=>t.check(oe(0,r)),t.nonpositive=(r)=>t.check(Z0(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 vt(t){return no(m3,t)}var Oe=g("ZodNumberFormat",(t,e)=>{kd.init(t,e),m3.init(t,e)});function X3(t){return ho(Oe,t)}function yT(t){return co(Oe,t)}function mT(t){return oo(Oe,t)}function uT(t){return yo(Oe,t)}function ET(t){return mo(Oe,t)}var u3=g("ZodBoolean",(t,e)=>{Yr.init(t,e),Et.init(t,e)});function Kt(t){return uo(u3,t)}var E3=g("ZodBigInt",(t,e)=>{Xr.init(t,e),Et.init(t,e),t.gte=(r,a)=>t.check(m0(r,a)),t.min=(r,a)=>t.check(m0(r,a)),t.gt=(r,a)=>t.check(ye(r,a)),t.gte=(r,a)=>t.check(m0(r,a)),t.min=(r,a)=>t.check(m0(r,a)),t.lt=(r,a)=>t.check(oe(r,a)),t.lte=(r,a)=>t.check(Z0(r,a)),t.max=(r,a)=>t.check(Z0(r,a)),t.positive=(r)=>t.check(ye(BigInt(0),r)),t.negative=(r)=>t.check(oe(BigInt(0),r)),t.nonpositive=(r)=>t.check(Z0(BigInt(0),r)),t.nonnegative=(r)=>t.check(m0(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 pT(t){return po(E3,t)}var yi=g("ZodBigIntFormat",(t,e)=>{fd.init(t,e),E3.init(t,e)});function lT(t){return So(yi,t)}function ST(t){return To(yi,t)}var Yo=g("ZodSymbol",(t,e)=>{Rd.init(t,e),Et.init(t,e)});function TT(t){return ko(Yo,t)}var Xo=g("ZodUndefined",(t,e)=>{xd.init(t,e),Et.init(t,e)});function kT(t){return fo(Xo,t)}var $o=g("ZodNull",(t,e)=>{Id.init(t,e),Et.init(t,e)});function p3(t){return Ro($o,t)}var t4=g("ZodAny",(t,e)=>{vd.init(t,e),Et.init(t,e)});function fT(){return xo(t4)}var e4=g("ZodUnknown",(t,e)=>{Ds.init(t,e),Et.init(t,e)});function gt(){return Vs(e4)}var a4=g("ZodNever",(t,e)=>{Cd.init(t,e),Et.init(t,e)});function l3(t){return Io(a4,t)}var s4=g("ZodVoid",(t,e)=>{Ad.init(t,e),Et.init(t,e)});function RT(t){return vo(s4,t)}var mi=g("ZodDate",(t,e)=>{bd.init(t,e),Et.init(t,e),t.min=(r,a)=>t.check(m0(r,a)),t.max=(r,a)=>t.check(Z0(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 xT(t){return Co(mi,t)}var r4=g("ZodArray",(t,e)=>{$r.init(t,e),Et.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(d3(s,r)),t.length=(s,r)=>t.check(o3(s,r)),t.unwrap=()=>t.element});function kt(t,e){return Nn(r4,t,e)}function IT(t){let e=t._zod.def.shape;return tt(Object.keys(e))}var S3=g("ZodObject",(t,e)=>{tn.init(t,e),Et.init(t,e),Tt.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>h0(Object.keys(t._zod.def.shape)),t.catchall=(s)=>t.clone({...t._zod.def,catchall:s}),t.passthrough=()=>t.clone({...t._zod.def,catchall:gt()}),t.loose=()=>t.clone({...t._zod.def,catchall:gt()}),t.strict=()=>t.clone({...t._zod.def,catchall:l3()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=(s)=>{return Tt.extend(t,s)},t.merge=(s)=>Tt.merge(t,s),t.pick=(s)=>Tt.pick(t,s),t.omit=(s)=>Tt.omit(t,s),t.partial=(...s)=>Tt.partial(Ti,t,s[0]),t.required=(...s)=>Tt.required(ki,t,s[0])});function J(t,e){let s={type:"object",get shape(){return Tt.assignProp(this,"shape",{...t}),this.shape},...Tt.normalizeParams(e)};return new S3(s)}function vT(t,e){return new S3({type:"object",get shape(){return Tt.assignProp(this,"shape",{...t}),this.shape},catchall:l3(),...Tt.normalizeParams(e)})}function s0(t,e){return new S3({type:"object",get shape(){return Tt.assignProp(this,"shape",{...t}),this.shape},catchall:gt(),...Tt.normalizeParams(e)})}var ui=g("ZodUnion",(t,e)=>{en.init(t,e),Et.init(t,e),t.options=e.options});function Ct(t,e){return new ui({type:"union",options:t,...Tt.normalizeParams(e)})}var n4=g("ZodDiscriminatedUnion",(t,e)=>{ui.init(t,e),Zd.init(t,e)});function Ei(t,e,s){return new n4({type:"union",options:e,discriminator:t,...Tt.normalizeParams(s)})}var i4=g("ZodIntersection",(t,e)=>{gd.init(t,e),Et.init(t,e)});function T3(t,e){return new i4({type:"intersection",left:t,right:e})}var h4=g("ZodTuple",(t,e)=>{i3.init(t,e),Et.init(t,e),t.rest=(s)=>t.clone({...t._zod.def,rest:s})});function CT(t,e,s){let r=e instanceof dt,a=r?s:e;return new h4({type:"tuple",items:t,rest:r?e:null,...Tt.normalizeParams(a)})}var pi=g("ZodRecord",(t,e)=>{Fd.init(t,e),Et.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function bt(t,e,s){return new pi({type:"record",keyType:t,valueType:e,...Tt.normalizeParams(s)})}function AT(t,e,s){return new pi({type:"record",keyType:Ct([t,l3()]),valueType:e,...Tt.normalizeParams(s)})}var c4=g("ZodMap",(t,e)=>{Md.init(t,e),Et.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function bT(t,e,s){return new c4({type:"map",keyType:t,valueType:e,...Tt.normalizeParams(s)})}var d4=g("ZodSet",(t,e)=>{Pd.init(t,e),Et.init(t,e),t.min=(...s)=>t.check(ja(...s)),t.nonempty=(s)=>t.check(ja(1,s)),t.max=(...s)=>t.check(c3(...s)),t.size=(...s)=>t.check(Zn(...s))});function ZT(t,e){return new d4({type:"set",valueType:t,...Tt.normalizeParams(e)})}var qa=g("ZodEnum",(t,e)=>{Ld.init(t,e),Et.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:[],...Tt.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:[],...Tt.normalizeParams(a),entries:n})}});function h0(t,e){let s=Array.isArray(t)?Object.fromEntries(t.map((r)=>[r,r])):t;return new qa({type:"enum",entries:s,...Tt.normalizeParams(e)})}function gT(t,e){return new qa({type:"enum",entries:t,...Tt.normalizeParams(e)})}var o4=g("ZodLiteral",(t,e)=>{jd.init(t,e),Et.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 o4({type:"literal",values:Array.isArray(t)?t:[t],...Tt.normalizeParams(e)})}var y4=g("ZodFile",(t,e)=>{qd.init(t,e),Et.init(t,e),t.min=(s,r)=>t.check(ja(s,r)),t.max=(s,r)=>t.check(c3(s,r)),t.mime=(s,r)=>t.check(qn(Array.isArray(s)?s:[s],r))});function FT(t){return jo(y4,t)}var li=g("ZodTransform",(t,e)=>{an.init(t,e),Et.init(t,e),t._zod.parse=(s,r)=>{s.addIssue=(n)=>{if(typeof n==="string")s.issues.push(Tt.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(Tt.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 Si(t){return new li({type:"transform",transform:t})}var Ti=g("ZodOptional",(t,e)=>{_d.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ft(t){return new Ti({type:"optional",innerType:t})}var m4=g("ZodNullable",(t,e)=>{Dd.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ks(t){return new m4({type:"nullable",innerType:t})}function MT(t){return Ft(Ks(t))}var u4=g("ZodDefault",(t,e)=>{Bd.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function E4(t,e){return new u4({type:"default",innerType:t,get defaultValue(){return typeof e==="function"?e():e}})}var p4=g("ZodPrefault",(t,e)=>{Vd.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.innerType});function l4(t,e){return new p4({type:"prefault",innerType:t,get defaultValue(){return typeof e==="function"?e():e}})}var ki=g("ZodNonOptional",(t,e)=>{Nd.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.innerType});function S4(t,e){return new ki({type:"nonoptional",innerType:t,...Tt.normalizeParams(e)})}var T4=g("ZodSuccess",(t,e)=>{wd.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.innerType});function PT(t){return new T4({type:"success",innerType:t})}var k4=g("ZodCatch",(t,e)=>{Kd.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function f4(t,e){return new k4({type:"catch",innerType:t,catchValue:typeof e==="function"?e:()=>e})}var R4=g("ZodNaN",(t,e)=>{Hd.init(t,e),Et.init(t,e)});function LT(t){return bo(R4,t)}var fi=g("ZodPipe",(t,e)=>{sn.init(t,e),Et.init(t,e),t.in=e.in,t.out=e.out});function Hs(t,e){return new fi({type:"pipe",in:t,out:e})}var x4=g("ZodReadonly",(t,e)=>{Od.init(t,e),Et.init(t,e)});function I4(t){return new x4({type:"readonly",innerType:t})}var v4=g("ZodTemplateLiteral",(t,e)=>{Ud.init(t,e),Et.init(t,e)});function jT(t,e){return new v4({type:"template_literal",parts:t,...Tt.normalizeParams(e)})}var C4=g("ZodLazy",(t,e)=>{Wd.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.getter()});function A4(t){return new C4({type:"lazy",getter:t})}var b4=g("ZodPromise",(t,e)=>{Gd.init(t,e),Et.init(t,e),t.unwrap=()=>t._zod.def.innerType});function qT(t){return new b4({type:"promise",innerType:t})}var k3=g("ZodCustom",(t,e)=>{zd.init(t,e),Et.init(t,e)});function Z4(t,e){let s=new Bt({check:"custom",...Tt.normalizeParams(e)});return s._zod.check=t,s}function g4(t,e){return qo(k3,t??(()=>!0),e)}function F4(t,e={}){return _o(k3,t,e)}function M4(t,e){let s=Z4((r)=>{return r.addIssue=(a)=>{if(typeof a==="string")r.issues.push(Tt.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(Tt.issue(n))}},t(r.value,r)},e);return s}function _T(t,e={error:`Input not instance of ${t.name}`}){let s=new k3({type:"custom",check:"custom",fn:(r)=>r instanceof t,abort:!0,...Tt.normalizeParams(e)});return s._zod.bag.Class=t,s}var DT=(...t)=>Do({Pipe:fi,Boolean:u3,String:y3,Transform:li},...t);function BT(t){let e=A4(()=>{return Ct([q(t),vt(),Kt(),p3(),kt(e),bt(q(),e)])});return e}function Ri(t,e){return Hs(Si(t),e)}var VT={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 NT(t){n0({customError:t})}function wT(){return n0().customError}var P4={};me(P4,{string:()=>KT,number:()=>HT,date:()=>GT,boolean:()=>OT,bigint:()=>UT});function KT(t){return $d(y3,t)}function HT(t){return io(m3,t)}function OT(t){return Eo(u3,t)}function UT(t){return lo(E3,t)}function GT(t){return Ao(mi,t)}n0(Qd());var WT="io.modelcontextprotocol/related-task",f3="2.0",Jt=g4((t)=>t!==null&&(typeof t==="object"||typeof t==="function")),L4=Ct([q(),vt().int()]),j4=q(),iR=s0({ttl:Ct([vt(),p3()]).optional(),pollInterval:vt().optional()}),zT=J({ttl:vt().optional()}),QT=J({taskId:q()}),xi=s0({progressToken:L4.optional(),[WT]:QT.optional()}),u0=J({_meta:xi.optional()}),R3=u0.extend({task:zT.optional()});var Yt=J({method:q(),params:u0.loose().optional()}),I0=J({_meta:xi.optional()}),v0=J({method:q(),params:I0.loose().optional()}),Xt=s0({_meta:xi.optional()}),x3=Ct([q(),vt().int()]),JT=J({jsonrpc:tt(f3),id:x3,...Yt.shape}).strict();var YT=J({jsonrpc:tt(f3),...v0.shape}).strict();var q4=J({jsonrpc:tt(f3),id:x3,result:Xt}).strict();var Lh;(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"})(Lh||(Lh={}));var _4=J({jsonrpc:tt(f3),id:x3.optional(),error:J({code:vt().int(),message:q(),data:gt().optional()})}).strict();var hR=Ct([JT,YT,q4,_4]),cR=Ct([q4,_4]),D4=Xt.strict(),XT=I0.extend({requestId:x3.optional(),reason:q().optional()}),B4=v0.extend({method:tt("notifications/cancelled"),params:XT}),$T=J({src:q(),mimeType:q().optional(),sizes:kt(q()).optional(),theme:h0(["light","dark"]).optional()}),Ka=J({icons:kt($T).optional()}),De=J({name:q(),title:q().optional()}),V4=De.extend({...De.shape,...Ka.shape,version:q(),websiteUrl:q().optional(),description:q().optional()}),t9=T3(J({applyDefaults:Kt().optional()}),bt(q(),gt())),e9=Ri((t)=>{if(t&&typeof t==="object"&&!Array.isArray(t)){if(Object.keys(t).length===0)return{form:{}}}return t},T3(J({form:t9.optional(),url:Jt.optional()}),bt(q(),gt()).optional())),a9=s0({list:Jt.optional(),cancel:Jt.optional(),requests:s0({sampling:s0({createMessage:Jt.optional()}).optional(),elicitation:s0({create:Jt.optional()}).optional()}).optional()}),s9=s0({list:Jt.optional(),cancel:Jt.optional(),requests:s0({tools:s0({call:Jt.optional()}).optional()}).optional()}),r9=J({experimental:bt(q(),Jt).optional(),sampling:J({context:Jt.optional(),tools:Jt.optional()}).optional(),elicitation:e9.optional(),roots:J({listChanged:Kt().optional()}).optional(),tasks:a9.optional()}),n9=u0.extend({protocolVersion:q(),capabilities:r9,clientInfo:V4}),i9=Yt.extend({method:tt("initialize"),params:n9}),h9=J({experimental:bt(q(),Jt).optional(),logging:Jt.optional(),completions:Jt.optional(),prompts:J({listChanged:Kt().optional()}).optional(),resources:J({subscribe:Kt().optional(),listChanged:Kt().optional()}).optional(),tools:J({listChanged:Kt().optional()}).optional(),tasks:s9.optional()}),c9=Xt.extend({protocolVersion:q(),capabilities:h9,serverInfo:V4,instructions:q().optional()}),d9=v0.extend({method:tt("notifications/initialized"),params:I0.optional()}),N4=Yt.extend({method:tt("ping"),params:u0.optional()}),o9=J({progress:vt(),total:Ft(vt()),message:Ft(q())}),y9=J({...I0.shape,...o9.shape,progressToken:L4}),w4=v0.extend({method:tt("notifications/progress"),params:y9}),m9=u0.extend({cursor:j4.optional()}),Ha=Yt.extend({params:m9.optional()}),Oa=Xt.extend({nextCursor:j4.optional()}),u9=h0(["working","input_required","completed","failed","cancelled"]),Ua=J({taskId:q(),status:u9,ttl:Ct([vt(),p3()]),createdAt:q(),lastUpdatedAt:q(),pollInterval:Ft(vt()),statusMessage:Ft(q())}),K4=Xt.extend({task:Ua}),E9=I0.merge(Ua),H4=v0.extend({method:tt("notifications/tasks/status"),params:E9}),O4=Yt.extend({method:tt("tasks/get"),params:u0.extend({taskId:q()})}),U4=Xt.merge(Ua),G4=Yt.extend({method:tt("tasks/result"),params:u0.extend({taskId:q()})}),dR=Xt.loose(),W4=Ha.extend({method:tt("tasks/list")}),z4=Oa.extend({tasks:kt(Ua)}),Q4=Yt.extend({method:tt("tasks/cancel"),params:u0.extend({taskId:q()})}),oR=Xt.merge(Ua),J4=J({uri:q(),mimeType:Ft(q()),_meta:bt(q(),gt()).optional()}),Y4=J4.extend({text:q()}),Ii=q().refine((t)=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),X4=J4.extend({blob:Ii}),Ga=h0(["user","assistant"]),Ue=J({audience:kt(Ga).optional(),priority:vt().min(0).max(1).optional(),lastModified:Kn.datetime({offset:!0}).optional()}),$4=J({...De.shape,...Ka.shape,uri:q(),description:Ft(q()),mimeType:Ft(q()),annotations:Ue.optional(),_meta:Ft(s0({}))}),p9=J({...De.shape,...Ka.shape,uriTemplate:q(),description:Ft(q()),mimeType:Ft(q()),annotations:Ue.optional(),_meta:Ft(s0({}))}),l9=Ha.extend({method:tt("resources/list")}),S9=Oa.extend({resources:kt($4)}),T9=Ha.extend({method:tt("resources/templates/list")}),k9=Oa.extend({resourceTemplates:kt(p9)}),vi=u0.extend({uri:q()}),f9=vi,R9=Yt.extend({method:tt("resources/read"),params:f9}),x9=Xt.extend({contents:kt(Ct([Y4,X4]))}),I9=v0.extend({method:tt("notifications/resources/list_changed"),params:I0.optional()}),v9=vi,C9=Yt.extend({method:tt("resources/subscribe"),params:v9}),A9=vi,b9=Yt.extend({method:tt("resources/unsubscribe"),params:A9}),Z9=I0.extend({uri:q()}),g9=v0.extend({method:tt("notifications/resources/updated"),params:Z9}),F9=J({name:q(),description:Ft(q()),required:Ft(Kt())}),M9=J({...De.shape,...Ka.shape,description:Ft(q()),arguments:Ft(kt(F9)),_meta:Ft(s0({}))}),P9=Ha.extend({method:tt("prompts/list")}),L9=Oa.extend({prompts:kt(M9)}),j9=u0.extend({name:q(),arguments:bt(q(),q()).optional()}),q9=Yt.extend({method:tt("prompts/get"),params:j9}),Ci=J({type:tt("text"),text:q(),annotations:Ue.optional(),_meta:bt(q(),gt()).optional()}),Ai=J({type:tt("image"),data:Ii,mimeType:q(),annotations:Ue.optional(),_meta:bt(q(),gt()).optional()}),bi=J({type:tt("audio"),data:Ii,mimeType:q(),annotations:Ue.optional(),_meta:bt(q(),gt()).optional()}),_9=J({type:tt("tool_use"),name:q(),id:q(),input:bt(q(),gt()),_meta:bt(q(),gt()).optional()}),D9=J({type:tt("resource"),resource:Ct([Y4,X4]),annotations:Ue.optional(),_meta:bt(q(),gt()).optional()}),B9=$4.extend({type:tt("resource_link")}),Zi=Ct([Ci,Ai,bi,B9,D9]),V9=J({role:Ga,content:Zi}),N9=Xt.extend({description:q().optional(),messages:kt(V9)}),w9=v0.extend({method:tt("notifications/prompts/list_changed"),params:I0.optional()}),K9=J({title:q().optional(),readOnlyHint:Kt().optional(),destructiveHint:Kt().optional(),idempotentHint:Kt().optional(),openWorldHint:Kt().optional()}),H9=J({taskSupport:h0(["required","optional","forbidden"]).optional()}),ty=J({...De.shape,...Ka.shape,description:q().optional(),inputSchema:J({type:tt("object"),properties:bt(q(),Jt).optional(),required:kt(q()).optional()}).catchall(gt()),outputSchema:J({type:tt("object"),properties:bt(q(),Jt).optional(),required:kt(q()).optional()}).catchall(gt()).optional(),annotations:K9.optional(),execution:H9.optional(),_meta:bt(q(),gt()).optional()}),O9=Ha.extend({method:tt("tools/list")}),U9=Oa.extend({tools:kt(ty)}),ey=Xt.extend({content:kt(Zi).default([]),structuredContent:bt(q(),gt()).optional(),isError:Kt().optional()}),yR=ey.or(Xt.extend({toolResult:gt()})),G9=R3.extend({name:q(),arguments:bt(q(),gt()).optional()}),W9=Yt.extend({method:tt("tools/call"),params:G9}),z9=v0.extend({method:tt("notifications/tools/list_changed"),params:I0.optional()}),mR=J({autoRefresh:Kt().default(!0),debounceMs:vt().int().nonnegative().default(300)}),ay=h0(["debug","info","notice","warning","error","critical","alert","emergency"]),Q9=u0.extend({level:ay}),J9=Yt.extend({method:tt("logging/setLevel"),params:Q9}),Y9=I0.extend({level:ay,logger:q().optional(),data:gt()}),X9=v0.extend({method:tt("notifications/message"),params:Y9}),$9=J({name:q().optional()}),tk=J({hints:kt($9).optional(),costPriority:vt().min(0).max(1).optional(),speedPriority:vt().min(0).max(1).optional(),intelligencePriority:vt().min(0).max(1).optional()}),ek=J({mode:h0(["auto","required","none"]).optional()}),ak=J({type:tt("tool_result"),toolUseId:q().describe("The unique identifier for the corresponding tool call."),content:kt(Zi).default([]),structuredContent:J({}).loose().optional(),isError:Kt().optional(),_meta:bt(q(),gt()).optional()}),sk=Ei("type",[Ci,Ai,bi]),Os=Ei("type",[Ci,Ai,bi,_9,ak]),rk=J({role:Ga,content:Ct([Os,kt(Os)]),_meta:bt(q(),gt()).optional()}),nk=R3.extend({messages:kt(rk),modelPreferences:tk.optional(),systemPrompt:q().optional(),includeContext:h0(["none","thisServer","allServers"]).optional(),temperature:vt().optional(),maxTokens:vt().int(),stopSequences:kt(q()).optional(),metadata:Jt.optional(),tools:kt(ty).optional(),toolChoice:ek.optional()}),ik=Yt.extend({method:tt("sampling/createMessage"),params:nk}),hk=Xt.extend({model:q(),stopReason:Ft(h0(["endTurn","stopSequence","maxTokens"]).or(q())),role:Ga,content:sk}),ck=Xt.extend({model:q(),stopReason:Ft(h0(["endTurn","stopSequence","maxTokens","toolUse"]).or(q())),role:Ga,content:Ct([Os,kt(Os)])}),dk=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:vt().optional(),maxLength:vt().optional(),format:h0(["email","uri","date","date-time"]).optional(),default:q().optional()}),yk=J({type:h0(["number","integer"]),title:q().optional(),description:q().optional(),minimum:vt().optional(),maximum:vt().optional(),default:vt().optional()}),mk=J({type:tt("string"),title:q().optional(),description:q().optional(),enum:kt(q()),default:q().optional()}),uk=J({type:tt("string"),title:q().optional(),description:q().optional(),oneOf:kt(J({const:q(),title:q()})),default:q().optional()}),Ek=J({type:tt("string"),title:q().optional(),description:q().optional(),enum:kt(q()),enumNames:kt(q()).optional(),default:q().optional()}),pk=Ct([mk,uk]),lk=J({type:tt("array"),title:q().optional(),description:q().optional(),minItems:vt().optional(),maxItems:vt().optional(),items:J({type:tt("string"),enum:kt(q())}),default:kt(q()).optional()}),Sk=J({type:tt("array"),title:q().optional(),description:q().optional(),minItems:vt().optional(),maxItems:vt().optional(),items:J({anyOf:kt(J({const:q(),title:q()}))}),default:kt(q()).optional()}),Tk=Ct([lk,Sk]),kk=Ct([Ek,pk,Tk]),fk=Ct([kk,dk,ok,yk]),Rk=R3.extend({mode:tt("form").optional(),message:q(),requestedSchema:J({type:tt("object"),properties:bt(q(),fk),required:kt(q()).optional()})}),xk=R3.extend({mode:tt("url"),message:q(),elicitationId:q(),url:q().url()}),Ik=Ct([Rk,xk]),vk=Yt.extend({method:tt("elicitation/create"),params:Ik}),Ck=I0.extend({elicitationId:q()}),Ak=v0.extend({method:tt("notifications/elicitation/complete"),params:Ck}),bk=Xt.extend({action:h0(["accept","decline","cancel"]),content:Ri((t)=>t===null?void 0:t,bt(q(),Ct([q(),vt(),Kt(),kt(q())])).optional())}),Zk=J({type:tt("ref/resource"),uri:q()}),gk=J({type:tt("ref/prompt"),name:q()}),Fk=u0.extend({ref:Ct([gk,Zk]),argument:J({name:q(),value:q()}),context:J({arguments:bt(q(),q()).optional()}).optional()}),Mk=Yt.extend({method:tt("completion/complete"),params:Fk});var Pk=Xt.extend({completion:s0({values:kt(q()).max(100),total:Ft(vt().int()),hasMore:Ft(Kt())})}),Lk=J({uri:q().startsWith("file://"),name:q().optional(),_meta:bt(q(),gt()).optional()}),jk=Yt.extend({method:tt("roots/list"),params:u0.optional()}),qk=Xt.extend({roots:kt(Lk)}),_k=v0.extend({method:tt("notifications/roots/list_changed"),params:I0.optional()}),uR=Ct([N4,i9,Mk,J9,q9,P9,l9,T9,R9,C9,b9,W9,O9,O4,G4,W4,Q4]),ER=Ct([B4,w4,d9,_k,H4]),pR=Ct([D4,hk,ck,bk,qk,U4,z4,K4]),lR=Ct([N4,ik,vk,jk,O4,G4,W4,Q4]),SR=Ct([B4,w4,X9,g9,I9,z9,w9,H4,Ak]),TR=Ct([D4,c9,Pk,N9,L9,S9,k9,x9,ey,U9,U4,z4,K4]);var kR=Symbol("Let zodToJsonSchema decide on which parser to use");var fR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var RR=Dh(Oh(),1),xR=Dh(E8(),1);var jh;(function(t){t.Completable="McpCompletable"})(jh||(jh={}));function Dk(t){let e;return()=>e??=t()}var qh=15000,Bk=Dk(()=>Ae.object({session_id:Ae.string(),ws_url:Ae.string(),work_dir:Ae.string().optional(),session_key:Ae.string().optional()}));class Y0 extends Error{constructor(t){super(t);this.name="DirectConnectError"}}class Vk{options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new gr;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 j0("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new j0("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let t;try{let a=await Nk(this.options);this.sessionId=a.sessionId,this.workDir=a.workDir,t=a.wsUrl}catch(a){this.failInit(Ju(a));return}if(this.closed){if(this.options.deleteSessionOnClose&&this.sessionId)_h(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 ${qh}ms`);a.exitError=i,a.readyReject?.(i)}},qh,this,s);s.addEventListener("open",()=>{clearTimeout(r),this.readyState=!0,S0(`[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
+ `),c=h.pop()??"";if(c)this.partialChunks.push(c);for(let d of h){if(!d)continue;let E;try{E=Zr(d)}catch(l){S0(`DirectConnect: dropped malformed JSON line (${d.length} bytes): ${l}`);continue}this.messages.enqueue(E)}}),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 j0("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)_h(this.options.serverUrl,this.sessionId,this.options.authToken)}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}async function Nk(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:T0(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=Bk().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 _h(t,e,s){let r={};if(s)r.authorization=`Bearer ${s}`;try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:r})}catch{}}function wk(t,e){let{systemPrompt:s,settings:r,settingSources:a,sandbox:n,...i}=t??{},h,c;if(s===void 0)h="";else if(typeof s==="string")h=s;else if(s.type==="preset")c=s.append;let d=i.pathToClaudeCodeExecutable;if(!d){let L0=l8(import.meta.url),A0=p8(L0),We=OE((za)=>A0.resolve(za));if(We)d=We;else try{d=A0.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:E=Uh(),additionalDirectories:l=[],agent:u,agents:f,allowedTools:I=[],betas:v,canUseTool:R,continue:o,cwd:p,debug:y,debugFile:m,disallowedTools:k=[],tools:T,env:x,executable:C=Gh()?"bun":"node",executableArgs:F=[],extraArgs:B={},fallbackModel:_,enableFileCheckpointing:N,toolConfig:O,forkSession:z,hooks:K,includeHookEvents:Mt,includePartialMessages:Ot,onElicitation:Ut,persistSession:St,thinking:Z,effort:L,maxThinkingTokens:V,maxTurns:S,maxBudgetUsd:b,taskBudget:P,mcpServers:X,model:at,outputFormat:lt,permissionMode:rt="default",allowDangerouslySkipPermissions:Pt=!1,permissionPromptToolName:C0,plugins:A,workload:j,resume:D,resumeSessionAt:et,sessionId:st,stderr:mt,strictMcpConfig:Wt}=i,$t=lt?.type==="json_schema"?lt.schema:void 0,Gt=x;if(!Gt)Gt={...process.env};if(!Gt.CLAUDE_CODE_ENTRYPOINT)Gt.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(N)Gt.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(O?.askUserQuestion?.previewFormat)Gt.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=O.askUserQuestion.previewFormat;let zt={},Vt=new Map;if(X)for(let[L0,A0]of Object.entries(X))if(A0.type==="sdk"&&A0.instance)Vt.set(L0,A0.instance);else zt[L0]=A0;let E0;if(Z)switch(Z.type){case"adaptive":E0={type:"adaptive",display:Z.display};break;case"enabled":E0={type:"enabled",budgetTokens:Z.budgetTokens,display:Z.display};break;case"disabled":E0={type:"disabled"};break}else if(V!==void 0)E0=V===0?{type:"disabled"}:{type:"enabled",budgetTokens:V};let e0=new Zc({abortController:E,additionalDirectories:l,agent:u,betas:v,cwd:p,debug:y,debugFile:m,executable:C,executableArgs:F,extraArgs:j?{...B,workload:j}:B,pathToClaudeCodeExecutable:d,env:Gt,forkSession:z,stderr:mt,thinkingConfig:E0,effort:L,maxTurns:S,maxBudgetUsd:b,taskBudget:P,model:at,fallbackModel:_,jsonSchema:$t,permissionMode:rt,allowDangerouslySkipPermissions:Pt,permissionPromptToolName:C0,continueConversation:o,resume:D,resumeSessionAt:et,sessionId:st,settings:typeof r==="object"?T0(r):r,settingSources:a,allowedTools:I,disallowedTools:k,tools:T,mcpServers:zt,strictMcpConfig:Wt,canUseTool:!!R,hooks:!!K,includeHookEvents:Mt,includePartialMessages:Ot,persistSession:St,plugins:A,sandbox:n,spawnClaudeCodeProcess:i.spawnClaudeCodeProcess}),Ge={systemPrompt:h,appendSystemPrompt:c,agents:f,promptSuggestions:i.promptSuggestions,agentProgressSummaries:i.agentProgressSummaries};return{queryInstance:new Fc(e0,e,R,K,E,Vt,$t,Ge,Ut),transport:e0,abortController:E}}function Kk(t,e,s,r){if(typeof s==="string")e.write(T0({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 sy({prompt:t,options:e}){let{queryInstance:s,transport:r,abortController:a}=wk(e,typeof t==="string");return Kk(s,r,t,a),s}import{EventEmitter as Hk}from"events";import{hostname as ry}from"os";class gi extends Hk{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:ry(),hostname:ry(),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:c,value:d}=await n.read();if(c)break;h+=i.decode(d,{stream:!0});let E=h.split(`
89
+ `);h=E.pop()||"";for(let l of E){if(!l.startsWith("data: "))continue;try{let u=JSON.parse(l.slice(6));if(u.type==="connected"){this.log("SSE connected"),this.emit("connected");continue}if(u.type==="new_task"||u.type==="new_message"||u.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 I3{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 sy({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 FR=I3;import{readFileSync as Ok,existsSync as Uk}from"fs";import{join as v3}from"path";import{homedir as Gk}from"os";var ny=Gk(),Se=process.argv.slice(2),c0={};for(let t=0;t<Se.length;t++)if(Se[t].startsWith("--")&&t+1<Se.length)c0[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
  用法:
97
- npx @sleep2agi/agent-node --alias "我的Agent" --hub http://127.0.0.1:9200
97
+ npx @sleep2agi/agent-node --alias "我的Agent"
98
+
99
+ 配置加载:
100
+ 1. CLI 参数 (--hub, --model, ...)
101
+ 2. 环境变量 (COMMHUB_URL, MODEL, ...)
102
+ 3. .anet/profiles/<alias>.json (和 anet CLI 共享)
103
+ 4. ~/.anet/config.json (全局 hub URL)
104
+ 5. 默认值
98
105
 
99
106
  选项:
100
107
  --alias <name> Agent 别名 (必需)
101
- --hub <url> CommHub Server URL (default: http://127.0.0.1:9200)
108
+ --hub <url> CommHub Server URL
102
109
  --model <name> AI 模型 (default: claude-sonnet-4-6)
103
- --tools <list> 可用工具,逗号分隔 (default: 无)
110
+ --runtime <type> 运行时: claude (default) | codex
111
+ --tools <list> 可用工具,逗号分隔
104
112
  --max-turns <n> 每任务最大轮次 (default: 5)
105
113
  --prompt <text> 自定义 System Prompt
106
114
  --token <token> CommHub auth token
107
- --config <path> 配置文件路径 (default: .agent-node.json)
115
+ --config <path> 配置文件路径 (覆盖 .anet/profiles/ 自动查找)
108
116
  -h, --help 显示帮助
109
117
 
110
- 环境变量:
111
- ANTHROPIC_BASE_URL API 端点 (MiniMax: https://api.minimaxi.com/anthropic)
112
- ANTHROPIC_AUTH_TOKEN API Token
113
- ANTHROPIC_API_KEY API Key (Anthropic 原生)
114
- COMMHUB_URL CommHub URL (--hub 的替代)
115
- ALIAS Agent 别名 (--alias 的替代)
116
- MODEL 模型名 (--model 的替代)
117
-
118
118
  示例:
119
- # MiniMax Agent
119
+ # anet profile(推荐)
120
+ anet init profile 小明1号 --alias 小明1号
121
+ npx @sleep2agi/agent-node --alias 小明1号
122
+
123
+ # 全手动
120
124
  ANTHROPIC_BASE_URL=https://api.minimaxi.com/anthropic \\
121
125
  ANTHROPIC_AUTH_TOKEN=sk-xxx \\
122
126
  npx @sleep2agi/agent-node --alias "MiniMax马" --model MiniMax-M2.7
123
-
124
- # Claude Agent
125
- ANTHROPIC_API_KEY=sk-xxx \\
126
- 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)});
127
+ `),process.exit(0);function C3(t){if(!Uk(t))return null;try{return JSON.parse(Ok(t,"utf-8"))}catch{return null}}var Ht={};if(c0.config){let t=C3(v3(process.cwd(),c0.config));if(t)Ht=t,console.log(`[agent-node] 配置: ${c0.config}`)}var Wa=c0.alias||process.env.ALIAS||Ht.alias;if(!c0.config&&Wa){let t=v3(process.cwd(),".anet","profiles",`${Wa}.json`),e=C3(t);if(e){if(Ht={...e,...Ht},console.log(`[agent-node] Profile: .anet/profiles/${Wa}.json`),e.env&&typeof e.env==="object"){for(let[s,r]of Object.entries(e.env))if(!process.env[s]&&typeof r==="string")process.env[s]=r.replace(/^~/,ny)}}}var Fi=C3(v3(ny,".anet","config.json"));if(Fi){if(!Ht.hub&&Fi.hub)Ht.hub=Fi.hub}if(!c0.config&&Object.keys(Ht).length===0){let t=C3(v3(process.cwd(),".agent-node.json"));if(t)Ht=t,console.log("[agent-node] 配置: .agent-node.json (legacy)")}if(!Wa)console.error(`错误: 必须指定 --alias
128
+ 用法: npx @sleep2agi/agent-node --alias "我的Agent"`),process.exit(1);var Wk=c0.runtime||process.env.RUNTIME||Ht.runtime||"claude",zk=c0.tools||(Array.isArray(Ht.tools)?Ht.tools.join(","):Ht.tools)||"",Qk={alias:Wa,hub:c0.hub||process.env.COMMHUB_URL||Ht.hub||"http://127.0.0.1:9200",model:c0.model||process.env.MODEL||Ht.model||"claude-sonnet-4-6",runtime:Wk,tools:zk.split(",").filter(Boolean),maxTurns:parseInt(c0["max-turns"]||Ht.flags?.maxTurns||Ht.maxTurns||"5"),systemPrompt:c0.prompt||Ht.systemPrompt||"",token:c0.token||process.env.COMMHUB_TOKEN||Ht.token,heartbeatInterval:parseInt(Ht.heartbeatInterval||"180000")},Jk=new I3(Qk);Jk.start().catch((t)=>{console.error(`[agent-node] 启动失败: ${t.message}`),process.exit(1)});