@sura_ai/mcp-server 0.1.44 → 0.1.46

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.
Files changed (2) hide show
  1. package/dist/index.js +35 -31
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- var xM=Object.create;var{getPrototypeOf:hM,defineProperty:cD,getOwnPropertyNames:fM}=Object;var yM=Object.prototype.hasOwnProperty;var zH=($,I,U)=>{U=$!=null?xM(hM($)):{};let b=I||!$||!$.__esModule?cD(U,"default",{value:$,enumerable:!0}):U;for(let w of fM($))if(!yM.call(b,w))cD(b,w,{get:()=>$[w],enumerable:!0});return b};var Z=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var v6=($,I)=>{for(var U in I)cD($,U,{get:I[U],enumerable:!0,configurable:!0,set:(b)=>I[U]=()=>b})};var NU=Z((Nz)=>{Object.defineProperty(Nz,"__esModule",{value:!0});Nz.regexpCode=Nz.getEsmExportName=Nz.getProperty=Nz.safeStringify=Nz.stringify=Nz.strConcat=Nz.addCodeArg=Nz.str=Nz._=Nz.nil=Nz._Code=Nz.Name=Nz.IDENTIFIER=Nz._CodeOrName=void 0;class sw{}Nz._CodeOrName=sw;Nz.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class S1 extends sw{constructor($){super();if(!Nz.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Nz.Name=S1;class j6 extends sw{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,U)=>`${I}${U}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,U)=>{if(U instanceof S1)I[U.str]=(I[U.str]||0)+1;return I},{})}}Nz._Code=j6;Nz.nil=new j6("");function Qz($,...I){let U=[$[0]],b=0;while(b<I.length)R8(U,I[b]),U.push($[++b]);return new j6(U)}Nz._=Qz;var k8=new j6("+");function Gz($,...I){let U=[GU($[0])],b=0;while(b<I.length)U.push(k8),R8(U,I[b]),U.push(k8,GU($[++b]));return sP(U),new j6(U)}Nz.str=Gz;function R8($,I){if(I instanceof j6)$.push(...I._items);else if(I instanceof S1)$.push(I);else $.push(Uk(I))}Nz.addCodeArg=R8;function sP($){let I=1;while(I<$.length-1){if($[I]===k8){let U=$k($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function $k($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof S1||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof S1))return`"${$}${I.slice(1)}`;return}function Ik($,I){return I.emptyStr()?$:$.emptyStr()?I:Gz`${$}${I}`}Nz.strConcat=Ik;function Uk($){return typeof $=="number"||typeof $=="boolean"||$===null?$:GU(Array.isArray($)?$.join(","):$)}function wk($){return new j6(GU($))}Nz.stringify=wk;function GU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Nz.safeStringify=GU;function bk($){return typeof $=="string"&&Nz.IDENTIFIER.test($)?new j6(`.${$}`):Qz`[${$}]`}Nz.getProperty=bk;function Xk($){if(typeof $=="string"&&Nz.IDENTIFIER.test($))return new j6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Nz.getEsmExportName=Xk;function Dk($){return new j6($.toString())}Nz.regexpCode=Dk});var C8=Z((Hz)=>{Object.defineProperty(Hz,"__esModule",{value:!0});Hz.ValueScope=Hz.ValueScopeName=Hz.Scope=Hz.varKinds=Hz.UsedValueState=void 0;var e$=NU();class Bz extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var Ib;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(Ib||(Hz.UsedValueState=Ib={}));Hz.varKinds={const:new e$.Name("const"),let:new e$.Name("let"),var:new e$.Name("var")};class _8{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof e$.Name?$:this.name($)}name($){return new e$.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,U;if(((U=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||U===void 0?void 0:U.has($))||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}Hz.Scope=_8;class Z8 extends e$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=e$._`.${new e$.Name(I)}[${U}]`}}Hz.ValueScopeName=Z8;var Kk=e$._`\n`;class Jz extends _8{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?Kk:e$.nil}}get(){return this._scope}name($){return new Z8($,this._newName($))}value($,I){var U;if(I.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let b=this.toName($),{prefix:w}=b,X=(U=I.key)!==null&&U!==void 0?U:I.ref,D=this._values[w];if(D){let G=D.get(X);if(G)return G}else D=this._values[w]=new Map;D.set(X,b);let W=this._scope[w]||(this._scope[w]=[]),Q=W.length;return W[Q]=I.ref,b.setValue(I,{property:w,itemIndex:Q}),b}getValue($,I){let U=this._values[$];if(!U)return;return U.get(I)}scopeRefs($,I=this._values){return this._reduceValues(I,(U)=>{if(U.scopePath===void 0)throw new Error(`CodeGen: name "${U}" has no value`);return e$._`${$}${U.scopePath}`})}scopeCode($=this._values,I,U){return this._reduceValues($,(b)=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},I,U)}_reduceValues($,I,U={},b){let w=e$.nil;for(let X in $){let D=$[X];if(!D)continue;let W=U[X]=U[X]||new Map;D.forEach((Q)=>{if(W.has(Q))return;W.set(Q,Ib.Started);let G=I(Q);if(G){let N=this.opts.es5?Hz.varKinds.var:Hz.varKinds.const;w=e$._`${w}${N} ${Q} = ${G};${this.opts._n}`}else if(G=b===null||b===void 0?void 0:b(Q))w=e$._`${w}${G}${this.opts._n}`;else throw new Bz(Q);W.set(Q,Ib.Completed)})}return w}}Hz.ValueScope=Jz});var a=Z((s$)=>{Object.defineProperty(s$,"__esModule",{value:!0});s$.or=s$.and=s$.not=s$.CodeGen=s$.operators=s$.varKinds=s$.ValueScopeName=s$.ValueScope=s$.Scope=s$.Name=s$.regexpCode=s$.stringify=s$.getProperty=s$.nil=s$.strConcat=s$.str=s$._=void 0;var X$=NU(),E6=C8(),O4=NU();Object.defineProperty(s$,"_",{enumerable:!0,get:function(){return O4._}});Object.defineProperty(s$,"str",{enumerable:!0,get:function(){return O4.str}});Object.defineProperty(s$,"strConcat",{enumerable:!0,get:function(){return O4.strConcat}});Object.defineProperty(s$,"nil",{enumerable:!0,get:function(){return O4.nil}});Object.defineProperty(s$,"getProperty",{enumerable:!0,get:function(){return O4.getProperty}});Object.defineProperty(s$,"stringify",{enumerable:!0,get:function(){return O4.stringify}});Object.defineProperty(s$,"regexpCode",{enumerable:!0,get:function(){return O4.regexpCode}});Object.defineProperty(s$,"Name",{enumerable:!0,get:function(){return O4.Name}});var Wb=C8();Object.defineProperty(s$,"Scope",{enumerable:!0,get:function(){return Wb.Scope}});Object.defineProperty(s$,"ValueScope",{enumerable:!0,get:function(){return Wb.ValueScope}});Object.defineProperty(s$,"ValueScopeName",{enumerable:!0,get:function(){return Wb.ValueScopeName}});Object.defineProperty(s$,"varKinds",{enumerable:!0,get:function(){return Wb.varKinds}});s$.operators={GT:new X$._Code(">"),GTE:new X$._Code(">="),LT:new X$._Code("<"),LTE:new X$._Code("<="),EQ:new X$._Code("==="),NEQ:new X$._Code("!=="),NOT:new X$._Code("!"),OR:new X$._Code("||"),AND:new X$._Code("&&"),ADD:new X$._Code("+")};class z4{optimizeNodes(){return this}optimizeNames($,I){return this}}class Oz extends z4{constructor($,I,U){super();this.varKind=$,this.name=I,this.rhs=U}render({es5:$,_n:I}){let U=$?E6.varKinds.var:this.varKind,b=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${b};`+I}optimizeNames($,I){if(!$[this.name.str])return;if(this.rhs)this.rhs=k1(this.rhs,$,I);return this}get names(){return this.rhs instanceof X$._CodeOrName?this.rhs.names:{}}}class h8 extends z4{constructor($,I,U){super();this.lhs=$,this.rhs=I,this.sideEffects=U}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,I){if(this.lhs instanceof X$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=k1(this.rhs,$,I),this}get names(){let $=this.lhs instanceof X$.Name?{}:{...this.lhs.names};return Db($,this.rhs)}}class zz extends h8{constructor($,I,U,b){super($,U,b);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class Lz extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class Kz extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class vz extends z4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class Vz extends z4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=k1(this.code,$,I),this}get names(){return this.code instanceof X$._CodeOrName?this.code.names:{}}}class Qb extends z4{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((I,U)=>I+U.render($),"")}optimizeNodes(){let{nodes:$}=this,I=$.length;while(I--){let U=$[I].optimizeNodes();if(Array.isArray(U))$.splice(I,1,...U);else if(U)$[I]=U;else $.splice(I,1)}return $.length>0?this:void 0}optimizeNames($,I){let{nodes:U}=this,b=U.length;while(b--){let w=U[b];if(w.optimizeNames($,I))continue;Fk($,w.names),U.splice(b,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>d4($,I.names),{})}}class L4 extends Qb{render($){return"{"+$._n+super.render($)+"}"+$._n}}class qz extends Qb{}class YU extends L4{}YU.kind="else";class e6 extends L4{constructor($,I){super(I);this.condition=$}render($){let I=`if(${this.condition})`+super.render($);if(this.else)I+="else "+this.else.render($);return I}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let I=this.else;if(I){let U=I.optimizeNodes();I=this.else=Array.isArray(U)?new YU(U):U}if(I){if($===!1)return I instanceof e6?I:I.nodes;if(this.nodes.length)return this;return new e6(Sz($),I instanceof e6?[I]:I.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,I){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames($,I),!(super.optimizeNames($,I)||this.else))return;return this.condition=k1(this.condition,$,I),this}get names(){let $=super.names;if(Db($,this.condition),this.else)d4($,this.else.names);return $}}e6.kind="if";class P1 extends L4{}P1.kind="for";class Fz extends P1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=k1(this.iteration,$,I),this}get names(){return d4(super.names,this.iteration.names)}}class Mz extends P1{constructor($,I,U,b){super();this.varKind=$,this.name=I,this.from=U,this.to=b}render($){let I=$.es5?E6.varKinds.var:this.varKind,{name:U,from:b,to:w}=this;return`for(${I} ${U}=${b}; ${U}<${w}; ${U}++)`+super.render($)}get names(){let $=Db(super.names,this.from);return Db($,this.to)}}class g8 extends P1{constructor($,I,U,b){super();this.loop=$,this.varKind=I,this.name=U,this.iterable=b}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iterable=k1(this.iterable,$,I),this}get names(){return d4(super.names,this.iterable.names)}}class Ub extends L4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}Ub.kind="func";class wb extends Qb{render($){return"return "+super.render($)}}wb.kind="return";class jz extends L4{render($){let I="try"+super.render($);if(this.catch)I+=this.catch.render($);if(this.finally)I+=this.finally.render($);return I}optimizeNodes(){var $,I;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(I=this.finally)===null||I===void 0||I.optimizeNodes(),this}optimizeNames($,I){var U,b;return super.optimizeNames($,I),(U=this.catch)===null||U===void 0||U.optimizeNames($,I),(b=this.finally)===null||b===void 0||b.optimizeNames($,I),this}get names(){let $=super.names;if(this.catch)d4($,this.catch.names);if(this.finally)d4($,this.finally.names);return $}}class bb extends L4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}bb.kind="catch";class Xb extends L4{render($){return"finally"+super.render($)}}Xb.kind="finally";class Ez{constructor($,I={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...I,_n:I.lines?`
3
- `:""},this._extScope=$,this._scope=new E6.Scope({parent:$}),this._nodes=[new qz]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let U=this._extScope.value($,I);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,U,b){let w=this._scope.toName(I);if(U!==void 0&&b)this._constants[w.str]=U;return this._leafNode(new Oz($,w,U)),w}const($,I,U){return this._def(E6.varKinds.const,$,I,U)}let($,I,U){return this._def(E6.varKinds.let,$,I,U)}var($,I,U){return this._def(E6.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new h8($,I,U))}add($,I){return this._leafNode(new zz($,s$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X$.nil)this._leafNode(new Vz($));return this}object(...$){let I=["{"];for(let[U,b]of $){if(I.length>1)I.push(",");if(I.push(U),U!==b||this.opts.es5)I.push(":"),X$.addCodeArg(I,b)}return I.push("}"),new X$._Code(I)}if($,I,U){if(this._blockNode(new e6($)),I&&U)this.code(I).else().code(U).endIf();else if(I)this.code(I).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new e6($))}else(){return this._elseNode(new YU)}endIf(){return this._endBlockNode(e6,YU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new Fz($),I)}forRange($,I,U,b,w=this.opts.es5?E6.varKinds.var:E6.varKinds.let){let X=this._scope.toName($);return this._for(new Mz(w,X,I,U),()=>b(X))}forOf($,I,U,b=E6.varKinds.const){let w=this._scope.toName($);if(this.opts.es5){let X=I instanceof X$.Name?I:this.var("_arr",I);return this.forRange("_i",0,X$._`${X}.length`,(D)=>{this.var(w,X$._`${X}[${D}]`),U(w)})}return this._for(new g8("of",b,w,I),()=>U(w))}forIn($,I,U,b=this.opts.es5?E6.varKinds.var:E6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,X$._`Object.keys(${I})`,U);let w=this._scope.toName($);return this._for(new g8("in",b,w,I),()=>U(w))}endFor(){return this._endBlockNode(P1)}label($){return this._leafNode(new Lz($))}break($){return this._leafNode(new Kz($))}return($){let I=new wb;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(wb)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let b=new jz;if(this._blockNode(b),this.code($),I){let w=this.name("e");this._currNode=b.catch=new bb(w),I(w)}if(U)this._currNode=b.finally=new Xb,this.code(U);return this._endBlockNode(bb,Xb)}throw($){return this._leafNode(new vz($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw new Error("CodeGen: not in self-balancing block");let U=this._nodes.length-I;if(U<0||$!==void 0&&U!==$)throw new Error(`CodeGen: wrong number of nodes: ${U} vs ${$} expected`);return this._nodes.length=I,this}func($,I=X$.nil,U,b){if(this._blockNode(new Ub($,I,U)),b)this.code(b).endFunc();return this}endFunc(){return this._endBlockNode(Ub)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let U=this._currNode;if(U instanceof $||I&&U instanceof I)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof e6))throw new Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}s$.CodeGen=Ez;function d4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function Db($,I){return I instanceof X$._CodeOrName?d4($,I.names):$}function k1($,I,U){if($ instanceof X$.Name)return b($);if(!w($))return $;return new X$._Code($._items.reduce((X,D)=>{if(D instanceof X$.Name)D=b(D);if(D instanceof X$._Code)X.push(...D._items);else X.push(D);return X},[]));function b(X){let D=U[X.str];if(D===void 0||I[X.str]!==1)return X;return delete I[X.str],D}function w(X){return X instanceof X$._Code&&X._items.some((D)=>D instanceof X$.Name&&I[D.str]===1&&U[D.str]!==void 0)}}function Fk($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function Sz($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X$._`!${x8($)}`}s$.not=Sz;var Mk=Pz(s$.operators.AND);function jk(...$){return $.reduce(Mk)}s$.and=jk;var Ek=Pz(s$.operators.OR);function Sk(...$){return $.reduce(Ek)}s$.or=Sk;function Pz($){return(I,U)=>I===X$.nil?U:U===X$.nil?I:X$._`${x8(I)} ${$} ${x8(U)}`}function x8($){return $ instanceof X$.Name?$:X$._`(${$})`}});var W$=Z((hz)=>{Object.defineProperty(hz,"__esModule",{value:!0});hz.checkStrictMode=hz.getErrorPath=hz.Type=hz.useFunc=hz.setEvaluated=hz.evaluatedPropsToName=hz.mergeEvaluated=hz.eachItem=hz.unescapeJsonPointer=hz.escapeJsonPointer=hz.escapeFragment=hz.unescapeFragment=hz.schemaRefOrVal=hz.schemaHasRulesButRef=hz.schemaHasRules=hz.checkUnknownRules=hz.alwaysValidSchema=hz.toHash=void 0;var H$=a(),Tk=NU();function _k($){let I={};for(let U of $)I[U]=!0;return I}hz.toHash=_k;function Zk($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return _z($,I),!Zz(I,$.self.RULES.all)}hz.alwaysValidSchema=Zk;function _z($,I=$.schema){let{opts:U,self:b}=$;if(!U.strictSchema)return;if(typeof I==="boolean")return;let w=b.RULES.keywords;for(let X in I)if(!w[X])xz($,`unknown keyword: "${X}"`)}hz.checkUnknownRules=_z;function Zz($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}hz.schemaHasRules=Zz;function Ck($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}hz.schemaHasRulesButRef=Ck;function gk({topSchemaRef:$,schemaPath:I},U,b,w){if(!w){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return H$._`${U}`}return H$._`${$}${I}${H$.getProperty(b)}`}hz.schemaRefOrVal=gk;function xk($){return Cz(decodeURIComponent($))}hz.unescapeFragment=xk;function hk($){return encodeURIComponent(y8($))}hz.escapeFragment=hk;function y8($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}hz.escapeJsonPointer=y8;function Cz($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}hz.unescapeJsonPointer=Cz;function fk($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}hz.eachItem=fk;function Rz({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:b}){return(w,X,D,W)=>{let Q=D===void 0?X:D instanceof H$.Name?(X instanceof H$.Name?$(w,X,D):I(w,X,D),D):X instanceof H$.Name?(I(w,D,X),X):U(X,D);return W===H$.Name&&!(Q instanceof H$.Name)?b(w,Q):Q}}hz.mergeEvaluated={props:Rz({mergeNames:($,I,U)=>$.if(H$._`${U} !== true && ${I} !== undefined`,()=>{$.if(H$._`${I} === true`,()=>$.assign(U,!0),()=>$.assign(U,H$._`${U} || {}`).code(H$._`Object.assign(${U}, ${I})`))}),mergeToName:($,I,U)=>$.if(H$._`${U} !== true`,()=>{if(I===!0)$.assign(U,!0);else $.assign(U,H$._`${U} || {}`),u8($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:gz}),items:Rz({mergeNames:($,I,U)=>$.if(H$._`${U} !== true && ${I} !== undefined`,()=>$.assign(U,H$._`${I} === true ? true : ${U} > ${I} ? ${U} : ${I}`)),mergeToName:($,I,U)=>$.if(H$._`${U} !== true`,()=>$.assign(U,I===!0?!0:H$._`${U} > ${I} ? ${U} : ${I}`)),mergeValues:($,I)=>$===!0?!0:Math.max($,I),resultToName:($,I)=>$.var("items",I)})};function gz($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",H$._`{}`);if(I!==void 0)u8($,U,I);return U}hz.evaluatedPropsToName=gz;function u8($,I,U){Object.keys(U).forEach((b)=>$.assign(H$._`${I}${H$.getProperty(b)}`,!0))}hz.setEvaluated=u8;var Tz={};function yk($,I){return $.scopeValue("func",{ref:I,code:Tz[I.code]||(Tz[I.code]=new Tk._Code(I.code))})}hz.useFunc=yk;var f8;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(f8||(hz.Type=f8={}));function uk($,I,U){if($ instanceof H$.Name){let b=I===f8.Num;return U?b?H$._`"[" + ${$} + "]"`:H$._`"['" + ${$} + "']"`:b?H$._`"/" + ${$}`:H$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?H$.getProperty($).toString():"/"+y8($)}hz.getErrorPath=uk;function xz($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}hz.checkStrictMode=xz});var s6=Z((yz)=>{Object.defineProperty(yz,"__esModule",{value:!0});var y$=a(),bR={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")};yz.default=bR});var BU=Z((mz)=>{Object.defineProperty(mz,"__esModule",{value:!0});mz.extendErrors=mz.resetErrorsCount=mz.reportExtraError=mz.reportError=mz.keyword$DataError=mz.keywordError=void 0;var D$=a(),Nb=W$(),n$=s6();mz.keywordError={message:({keyword:$})=>D$.str`must pass "${$}" keyword validation`};mz.keyword$DataError={message:({keyword:$,schemaType:I})=>I?D$.str`"${$}" keyword must be ${I} ($data)`:D$.str`"${$}" keyword is invalid ($data)`};function DR($,I=mz.keywordError,U,b){let{it:w}=$,{gen:X,compositeRule:D,allErrors:W}=w,Q=cz($,I,U);if(b!==null&&b!==void 0?b:D||W)uz(X,Q);else lz(w,D$._`[${Q}]`)}mz.reportError=DR;function WR($,I=mz.keywordError,U){let{it:b}=$,{gen:w,compositeRule:X,allErrors:D}=b,W=cz($,I,U);if(uz(w,W),!(X||D))lz(b,n$.default.vErrors)}mz.reportExtraError=WR;function QR($,I){$.assign(n$.default.errors,I),$.if(D$._`${n$.default.vErrors} !== null`,()=>$.if(I,()=>$.assign(D$._`${n$.default.vErrors}.length`,I),()=>$.assign(n$.default.vErrors,null)))}mz.resetErrorsCount=QR;function GR({gen:$,keyword:I,schemaValue:U,data:b,errsCount:w,it:X}){if(w===void 0)throw new Error("ajv implementation error");let D=$.name("err");$.forRange("i",w,n$.default.errors,(W)=>{if($.const(D,D$._`${n$.default.vErrors}[${W}]`),$.if(D$._`${D}.instancePath === undefined`,()=>$.assign(D$._`${D}.instancePath`,D$.strConcat(n$.default.instancePath,X.errorPath))),$.assign(D$._`${D}.schemaPath`,D$.str`${X.errSchemaPath}/${I}`),X.opts.verbose)$.assign(D$._`${D}.schema`,U),$.assign(D$._`${D}.data`,b)})}mz.extendErrors=GR;function uz($,I){let U=$.const("err",I);$.if(D$._`${n$.default.vErrors} === null`,()=>$.assign(n$.default.vErrors,D$._`[${U}]`),D$._`${n$.default.vErrors}.push(${U})`),$.code(D$._`${n$.default.errors}++`)}function lz($,I){let{gen:U,validateName:b,schemaEnv:w}=$;if(w.$async)U.throw(D$._`new ${$.ValidationError}(${I})`);else U.assign(D$._`${b}.errors`,I),U.return(!1)}var p4={keyword:new D$.Name("keyword"),schemaPath:new D$.Name("schemaPath"),params:new D$.Name("params"),propertyName:new D$.Name("propertyName"),message:new D$.Name("message"),schema:new D$.Name("schema"),parentSchema:new D$.Name("parentSchema")};function cz($,I,U){let{createErrors:b}=$.it;if(b===!1)return D$._`{}`;return NR($,I,U)}function NR($,I,U={}){let{gen:b,it:w}=$,X=[YR(w,U),BR($,U)];return JR($,I,X),b.object(...X)}function YR({errorPath:$},{instancePath:I}){let U=I?D$.str`${$}${Nb.getErrorPath(I,Nb.Type.Str)}`:$;return[n$.default.instancePath,D$.strConcat(n$.default.instancePath,U)]}function BR({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:b}){let w=b?I:D$.str`${I}/${$}`;if(U)w=D$.str`${w}${Nb.getErrorPath(U,Nb.Type.Str)}`;return[p4.schemaPath,w]}function JR($,{params:I,message:U},b){let{keyword:w,data:X,schemaValue:D,it:W}=$,{opts:Q,propertyName:G,topSchemaRef:N,schemaPath:B}=W;if(b.push([p4.keyword,w],[p4.params,typeof I=="function"?I($):I||D$._`{}`]),Q.messages)b.push([p4.message,typeof U=="function"?U($):U]);if(Q.verbose)b.push([p4.schema,D],[p4.parentSchema,D$._`${N}${B}`],[n$.default.data,X]);if(G)b.push([p4.propertyName,G])}});var dz=Z((iz)=>{Object.defineProperty(iz,"__esModule",{value:!0});iz.boolOrEmptySchema=iz.topBoolOrEmptySchema=void 0;var LR=BU(),KR=a(),vR=s6(),VR={message:"boolean schema is false"};function qR($){let{gen:I,schema:U,validateName:b}=$;if(U===!1)nz($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(vR.default.data);else I.assign(KR._`${b}.errors`,null),I.return(!0)}iz.topBoolOrEmptySchema=qR;function FR($,I){let{gen:U,schema:b}=$;if(b===!1)U.var(I,!1),nz($);else U.var(I,!0)}iz.boolOrEmptySchema=FR;function nz($,I){let{gen:U,data:b}=$,w={gen:U,keyword:"false schema",data:b,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};LR.reportError(w,VR,void 0,I)}});var c8=Z((pz)=>{Object.defineProperty(pz,"__esModule",{value:!0});pz.getRules=pz.isJSONType=void 0;var jR=["string","number","integer","boolean","null","object","array"],ER=new Set(jR);function SR($){return typeof $=="string"&&ER.has($)}pz.isJSONType=SR;function PR(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}pz.getRules=PR});var m8=Z((sz)=>{Object.defineProperty(sz,"__esModule",{value:!0});sz.shouldUseRule=sz.shouldUseGroup=sz.schemaHasRulesForType=void 0;function RR({schema:$,self:I},U){let b=I.RULES.types[U];return b&&b!==!0&&az($,b)}sz.schemaHasRulesForType=RR;function az($,I){return I.rules.some((U)=>ez($,U))}sz.shouldUseGroup=az;function ez($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((b)=>$[b]!==void 0))}sz.shouldUseRule=ez});var JU=Z((b3)=>{Object.defineProperty(b3,"__esModule",{value:!0});b3.reportTypeError=b3.checkDataTypes=b3.checkDataType=b3.coerceAndCheckDataType=b3.getJSONTypes=b3.getSchemaTypes=b3.DataType=void 0;var ZR=c8(),CR=m8(),gR=BU(),p=a(),I3=W$(),R1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(R1||(b3.DataType=R1={}));function xR($){let I=U3($.type);if(I.includes("null")){if($.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!I.length&&$.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');if($.nullable===!0)I.push("null")}return I}b3.getSchemaTypes=xR;function U3($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(ZR.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}b3.getJSONTypes=U3;function hR($,I){let{gen:U,data:b,opts:w}=$,X=fR(I,w.coerceTypes),D=I.length>0&&!(X.length===0&&I.length===1&&CR.schemaHasRulesForType($,I[0]));if(D){let W=n8(I,b,w.strictNumbers,R1.Wrong);U.if(W,()=>{if(X.length)yR($,I,X);else i8($)})}return D}b3.coerceAndCheckDataType=hR;var w3=new Set(["string","number","integer","boolean","null"]);function fR($,I){return I?$.filter((U)=>w3.has(U)||I==="array"&&U==="array"):[]}function yR($,I,U){let{gen:b,data:w,opts:X}=$,D=b.let("dataType",p._`typeof ${w}`),W=b.let("coerced",p._`undefined`);if(X.coerceTypes==="array")b.if(p._`${D} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>b.assign(w,p._`${w}[0]`).assign(D,p._`typeof ${w}`).if(n8(I,w,X.strictNumbers),()=>b.assign(W,w)));b.if(p._`${W} !== undefined`);for(let G of U)if(w3.has(G)||G==="array"&&X.coerceTypes==="array")Q(G);b.else(),i8($),b.endIf(),b.if(p._`${W} !== undefined`,()=>{b.assign(w,W),uR($,W)});function Q(G){switch(G){case"string":b.elseIf(p._`${D} == "number" || ${D} == "boolean"`).assign(W,p._`"" + ${w}`).elseIf(p._`${w} === null`).assign(W,p._`""`);return;case"number":b.elseIf(p._`${D} == "boolean" || ${w} === null
2
+ var hM=Object.create;var{getPrototypeOf:fM,defineProperty:cD,getOwnPropertyNames:yM}=Object;var uM=Object.prototype.hasOwnProperty;var LH=($,I,U)=>{U=$!=null?hM(fM($)):{};let b=I||!$||!$.__esModule?cD(U,"default",{value:$,enumerable:!0}):U;for(let w of yM($))if(!uM.call(b,w))cD(b,w,{get:()=>$[w],enumerable:!0});return b};var Z=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var v6=($,I)=>{for(var U in I)cD($,U,{get:I[U],enumerable:!0,configurable:!0,set:(b)=>I[U]=()=>b})};var NU=Z((Yz)=>{Object.defineProperty(Yz,"__esModule",{value:!0});Yz.regexpCode=Yz.getEsmExportName=Yz.getProperty=Yz.safeStringify=Yz.stringify=Yz.strConcat=Yz.addCodeArg=Yz.str=Yz._=Yz.nil=Yz._Code=Yz.Name=Yz.IDENTIFIER=Yz._CodeOrName=void 0;class sw{}Yz._CodeOrName=sw;Yz.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class S1 extends sw{constructor($){super();if(!Yz.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Yz.Name=S1;class j6 extends sw{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,U)=>`${I}${U}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,U)=>{if(U instanceof S1)I[U.str]=(I[U.str]||0)+1;return I},{})}}Yz._Code=j6;Yz.nil=new j6("");function Gz($,...I){let U=[$[0]],b=0;while(b<I.length)R8(U,I[b]),U.push($[++b]);return new j6(U)}Yz._=Gz;var k8=new j6("+");function Nz($,...I){let U=[GU($[0])],b=0;while(b<I.length)U.push(k8),R8(U,I[b]),U.push(k8,GU($[++b]));return $k(U),new j6(U)}Yz.str=Nz;function R8($,I){if(I instanceof j6)$.push(...I._items);else if(I instanceof S1)$.push(I);else $.push(wk(I))}Yz.addCodeArg=R8;function $k($){let I=1;while(I<$.length-1){if($[I]===k8){let U=Ik($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function Ik($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof S1||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof S1))return`"${$}${I.slice(1)}`;return}function Uk($,I){return I.emptyStr()?$:$.emptyStr()?I:Nz`${$}${I}`}Yz.strConcat=Uk;function wk($){return typeof $=="number"||typeof $=="boolean"||$===null?$:GU(Array.isArray($)?$.join(","):$)}function bk($){return new j6(GU($))}Yz.stringify=bk;function GU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Yz.safeStringify=GU;function Xk($){return typeof $=="string"&&Yz.IDENTIFIER.test($)?new j6(`.${$}`):Gz`[${$}]`}Yz.getProperty=Xk;function Dk($){if(typeof $=="string"&&Yz.IDENTIFIER.test($))return new j6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Yz.getEsmExportName=Dk;function Wk($){return new j6($.toString())}Yz.regexpCode=Wk});var C8=Z((Az)=>{Object.defineProperty(Az,"__esModule",{value:!0});Az.ValueScope=Az.ValueScopeName=Az.Scope=Az.varKinds=Az.UsedValueState=void 0;var e$=NU();class Jz extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var Ib;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(Ib||(Az.UsedValueState=Ib={}));Az.varKinds={const:new e$.Name("const"),let:new e$.Name("let"),var:new e$.Name("var")};class _8{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof e$.Name?$:this.name($)}name($){return new e$.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,U;if(((U=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||U===void 0?void 0:U.has($))||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}Az.Scope=_8;class Z8 extends e$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=e$._`.${new e$.Name(I)}[${U}]`}}Az.ValueScopeName=Z8;var vk=e$._`\n`;class Hz extends _8{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?vk:e$.nil}}get(){return this._scope}name($){return new Z8($,this._newName($))}value($,I){var U;if(I.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let b=this.toName($),{prefix:w}=b,X=(U=I.key)!==null&&U!==void 0?U:I.ref,D=this._values[w];if(D){let G=D.get(X);if(G)return G}else D=this._values[w]=new Map;D.set(X,b);let W=this._scope[w]||(this._scope[w]=[]),Q=W.length;return W[Q]=I.ref,b.setValue(I,{property:w,itemIndex:Q}),b}getValue($,I){let U=this._values[$];if(!U)return;return U.get(I)}scopeRefs($,I=this._values){return this._reduceValues(I,(U)=>{if(U.scopePath===void 0)throw new Error(`CodeGen: name "${U}" has no value`);return e$._`${$}${U.scopePath}`})}scopeCode($=this._values,I,U){return this._reduceValues($,(b)=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},I,U)}_reduceValues($,I,U={},b){let w=e$.nil;for(let X in $){let D=$[X];if(!D)continue;let W=U[X]=U[X]||new Map;D.forEach((Q)=>{if(W.has(Q))return;W.set(Q,Ib.Started);let G=I(Q);if(G){let N=this.opts.es5?Az.varKinds.var:Az.varKinds.const;w=e$._`${w}${N} ${Q} = ${G};${this.opts._n}`}else if(G=b===null||b===void 0?void 0:b(Q))w=e$._`${w}${G}${this.opts._n}`;else throw new Jz(Q);W.set(Q,Ib.Completed)})}return w}}Az.ValueScope=Hz});var a=Z((s$)=>{Object.defineProperty(s$,"__esModule",{value:!0});s$.or=s$.and=s$.not=s$.CodeGen=s$.operators=s$.varKinds=s$.ValueScopeName=s$.ValueScope=s$.Scope=s$.Name=s$.regexpCode=s$.stringify=s$.getProperty=s$.nil=s$.strConcat=s$.str=s$._=void 0;var X$=NU(),E6=C8(),O4=NU();Object.defineProperty(s$,"_",{enumerable:!0,get:function(){return O4._}});Object.defineProperty(s$,"str",{enumerable:!0,get:function(){return O4.str}});Object.defineProperty(s$,"strConcat",{enumerable:!0,get:function(){return O4.strConcat}});Object.defineProperty(s$,"nil",{enumerable:!0,get:function(){return O4.nil}});Object.defineProperty(s$,"getProperty",{enumerable:!0,get:function(){return O4.getProperty}});Object.defineProperty(s$,"stringify",{enumerable:!0,get:function(){return O4.stringify}});Object.defineProperty(s$,"regexpCode",{enumerable:!0,get:function(){return O4.regexpCode}});Object.defineProperty(s$,"Name",{enumerable:!0,get:function(){return O4.Name}});var Wb=C8();Object.defineProperty(s$,"Scope",{enumerable:!0,get:function(){return Wb.Scope}});Object.defineProperty(s$,"ValueScope",{enumerable:!0,get:function(){return Wb.ValueScope}});Object.defineProperty(s$,"ValueScopeName",{enumerable:!0,get:function(){return Wb.ValueScopeName}});Object.defineProperty(s$,"varKinds",{enumerable:!0,get:function(){return Wb.varKinds}});s$.operators={GT:new X$._Code(">"),GTE:new X$._Code(">="),LT:new X$._Code("<"),LTE:new X$._Code("<="),EQ:new X$._Code("==="),NEQ:new X$._Code("!=="),NOT:new X$._Code("!"),OR:new X$._Code("||"),AND:new X$._Code("&&"),ADD:new X$._Code("+")};class z4{optimizeNodes(){return this}optimizeNames($,I){return this}}class zz extends z4{constructor($,I,U){super();this.varKind=$,this.name=I,this.rhs=U}render({es5:$,_n:I}){let U=$?E6.varKinds.var:this.varKind,b=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${b};`+I}optimizeNames($,I){if(!$[this.name.str])return;if(this.rhs)this.rhs=k1(this.rhs,$,I);return this}get names(){return this.rhs instanceof X$._CodeOrName?this.rhs.names:{}}}class h8 extends z4{constructor($,I,U){super();this.lhs=$,this.rhs=I,this.sideEffects=U}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,I){if(this.lhs instanceof X$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=k1(this.rhs,$,I),this}get names(){let $=this.lhs instanceof X$.Name?{}:{...this.lhs.names};return Db($,this.rhs)}}class Lz extends h8{constructor($,I,U,b){super($,U,b);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class Kz extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class vz extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class Vz extends z4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class qz extends z4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=k1(this.code,$,I),this}get names(){return this.code instanceof X$._CodeOrName?this.code.names:{}}}class Qb extends z4{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((I,U)=>I+U.render($),"")}optimizeNodes(){let{nodes:$}=this,I=$.length;while(I--){let U=$[I].optimizeNodes();if(Array.isArray(U))$.splice(I,1,...U);else if(U)$[I]=U;else $.splice(I,1)}return $.length>0?this:void 0}optimizeNames($,I){let{nodes:U}=this,b=U.length;while(b--){let w=U[b];if(w.optimizeNames($,I))continue;Mk($,w.names),U.splice(b,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>d4($,I.names),{})}}class L4 extends Qb{render($){return"{"+$._n+super.render($)+"}"+$._n}}class Fz extends Qb{}class YU extends L4{}YU.kind="else";class e6 extends L4{constructor($,I){super(I);this.condition=$}render($){let I=`if(${this.condition})`+super.render($);if(this.else)I+="else "+this.else.render($);return I}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let I=this.else;if(I){let U=I.optimizeNodes();I=this.else=Array.isArray(U)?new YU(U):U}if(I){if($===!1)return I instanceof e6?I:I.nodes;if(this.nodes.length)return this;return new e6(Pz($),I instanceof e6?[I]:I.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,I){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames($,I),!(super.optimizeNames($,I)||this.else))return;return this.condition=k1(this.condition,$,I),this}get names(){let $=super.names;if(Db($,this.condition),this.else)d4($,this.else.names);return $}}e6.kind="if";class P1 extends L4{}P1.kind="for";class Mz extends P1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=k1(this.iteration,$,I),this}get names(){return d4(super.names,this.iteration.names)}}class jz extends P1{constructor($,I,U,b){super();this.varKind=$,this.name=I,this.from=U,this.to=b}render($){let I=$.es5?E6.varKinds.var:this.varKind,{name:U,from:b,to:w}=this;return`for(${I} ${U}=${b}; ${U}<${w}; ${U}++)`+super.render($)}get names(){let $=Db(super.names,this.from);return Db($,this.to)}}class g8 extends P1{constructor($,I,U,b){super();this.loop=$,this.varKind=I,this.name=U,this.iterable=b}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iterable=k1(this.iterable,$,I),this}get names(){return d4(super.names,this.iterable.names)}}class Ub extends L4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}Ub.kind="func";class wb extends Qb{render($){return"return "+super.render($)}}wb.kind="return";class Ez extends L4{render($){let I="try"+super.render($);if(this.catch)I+=this.catch.render($);if(this.finally)I+=this.finally.render($);return I}optimizeNodes(){var $,I;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(I=this.finally)===null||I===void 0||I.optimizeNodes(),this}optimizeNames($,I){var U,b;return super.optimizeNames($,I),(U=this.catch)===null||U===void 0||U.optimizeNames($,I),(b=this.finally)===null||b===void 0||b.optimizeNames($,I),this}get names(){let $=super.names;if(this.catch)d4($,this.catch.names);if(this.finally)d4($,this.finally.names);return $}}class bb extends L4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}bb.kind="catch";class Xb extends L4{render($){return"finally"+super.render($)}}Xb.kind="finally";class Sz{constructor($,I={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...I,_n:I.lines?`
3
+ `:""},this._extScope=$,this._scope=new E6.Scope({parent:$}),this._nodes=[new Fz]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let U=this._extScope.value($,I);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,U,b){let w=this._scope.toName(I);if(U!==void 0&&b)this._constants[w.str]=U;return this._leafNode(new zz($,w,U)),w}const($,I,U){return this._def(E6.varKinds.const,$,I,U)}let($,I,U){return this._def(E6.varKinds.let,$,I,U)}var($,I,U){return this._def(E6.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new h8($,I,U))}add($,I){return this._leafNode(new Lz($,s$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X$.nil)this._leafNode(new qz($));return this}object(...$){let I=["{"];for(let[U,b]of $){if(I.length>1)I.push(",");if(I.push(U),U!==b||this.opts.es5)I.push(":"),X$.addCodeArg(I,b)}return I.push("}"),new X$._Code(I)}if($,I,U){if(this._blockNode(new e6($)),I&&U)this.code(I).else().code(U).endIf();else if(I)this.code(I).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new e6($))}else(){return this._elseNode(new YU)}endIf(){return this._endBlockNode(e6,YU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new Mz($),I)}forRange($,I,U,b,w=this.opts.es5?E6.varKinds.var:E6.varKinds.let){let X=this._scope.toName($);return this._for(new jz(w,X,I,U),()=>b(X))}forOf($,I,U,b=E6.varKinds.const){let w=this._scope.toName($);if(this.opts.es5){let X=I instanceof X$.Name?I:this.var("_arr",I);return this.forRange("_i",0,X$._`${X}.length`,(D)=>{this.var(w,X$._`${X}[${D}]`),U(w)})}return this._for(new g8("of",b,w,I),()=>U(w))}forIn($,I,U,b=this.opts.es5?E6.varKinds.var:E6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,X$._`Object.keys(${I})`,U);let w=this._scope.toName($);return this._for(new g8("in",b,w,I),()=>U(w))}endFor(){return this._endBlockNode(P1)}label($){return this._leafNode(new Kz($))}break($){return this._leafNode(new vz($))}return($){let I=new wb;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(wb)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let b=new Ez;if(this._blockNode(b),this.code($),I){let w=this.name("e");this._currNode=b.catch=new bb(w),I(w)}if(U)this._currNode=b.finally=new Xb,this.code(U);return this._endBlockNode(bb,Xb)}throw($){return this._leafNode(new Vz($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw new Error("CodeGen: not in self-balancing block");let U=this._nodes.length-I;if(U<0||$!==void 0&&U!==$)throw new Error(`CodeGen: wrong number of nodes: ${U} vs ${$} expected`);return this._nodes.length=I,this}func($,I=X$.nil,U,b){if(this._blockNode(new Ub($,I,U)),b)this.code(b).endFunc();return this}endFunc(){return this._endBlockNode(Ub)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let U=this._currNode;if(U instanceof $||I&&U instanceof I)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof e6))throw new Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}s$.CodeGen=Sz;function d4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function Db($,I){return I instanceof X$._CodeOrName?d4($,I.names):$}function k1($,I,U){if($ instanceof X$.Name)return b($);if(!w($))return $;return new X$._Code($._items.reduce((X,D)=>{if(D instanceof X$.Name)D=b(D);if(D instanceof X$._Code)X.push(...D._items);else X.push(D);return X},[]));function b(X){let D=U[X.str];if(D===void 0||I[X.str]!==1)return X;return delete I[X.str],D}function w(X){return X instanceof X$._Code&&X._items.some((D)=>D instanceof X$.Name&&I[D.str]===1&&U[D.str]!==void 0)}}function Mk($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function Pz($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X$._`!${x8($)}`}s$.not=Pz;var jk=kz(s$.operators.AND);function Ek(...$){return $.reduce(jk)}s$.and=Ek;var Sk=kz(s$.operators.OR);function Pk(...$){return $.reduce(Sk)}s$.or=Pk;function kz($){return(I,U)=>I===X$.nil?U:U===X$.nil?I:X$._`${x8(I)} ${$} ${x8(U)}`}function x8($){return $ instanceof X$.Name?$:X$._`(${$})`}});var W$=Z((fz)=>{Object.defineProperty(fz,"__esModule",{value:!0});fz.checkStrictMode=fz.getErrorPath=fz.Type=fz.useFunc=fz.setEvaluated=fz.evaluatedPropsToName=fz.mergeEvaluated=fz.eachItem=fz.unescapeJsonPointer=fz.escapeJsonPointer=fz.escapeFragment=fz.unescapeFragment=fz.schemaRefOrVal=fz.schemaHasRulesButRef=fz.schemaHasRules=fz.checkUnknownRules=fz.alwaysValidSchema=fz.toHash=void 0;var H$=a(),_k=NU();function Zk($){let I={};for(let U of $)I[U]=!0;return I}fz.toHash=Zk;function Ck($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return Zz($,I),!Cz(I,$.self.RULES.all)}fz.alwaysValidSchema=Ck;function Zz($,I=$.schema){let{opts:U,self:b}=$;if(!U.strictSchema)return;if(typeof I==="boolean")return;let w=b.RULES.keywords;for(let X in I)if(!w[X])hz($,`unknown keyword: "${X}"`)}fz.checkUnknownRules=Zz;function Cz($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}fz.schemaHasRules=Cz;function gk($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}fz.schemaHasRulesButRef=gk;function xk({topSchemaRef:$,schemaPath:I},U,b,w){if(!w){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return H$._`${U}`}return H$._`${$}${I}${H$.getProperty(b)}`}fz.schemaRefOrVal=xk;function hk($){return gz(decodeURIComponent($))}fz.unescapeFragment=hk;function fk($){return encodeURIComponent(y8($))}fz.escapeFragment=fk;function y8($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}fz.escapeJsonPointer=y8;function gz($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}fz.unescapeJsonPointer=gz;function yk($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}fz.eachItem=yk;function Tz({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:b}){return(w,X,D,W)=>{let Q=D===void 0?X:D instanceof H$.Name?(X instanceof H$.Name?$(w,X,D):I(w,X,D),D):X instanceof H$.Name?(I(w,D,X),X):U(X,D);return W===H$.Name&&!(Q instanceof H$.Name)?b(w,Q):Q}}fz.mergeEvaluated={props:Tz({mergeNames:($,I,U)=>$.if(H$._`${U} !== true && ${I} !== undefined`,()=>{$.if(H$._`${I} === true`,()=>$.assign(U,!0),()=>$.assign(U,H$._`${U} || {}`).code(H$._`Object.assign(${U}, ${I})`))}),mergeToName:($,I,U)=>$.if(H$._`${U} !== true`,()=>{if(I===!0)$.assign(U,!0);else $.assign(U,H$._`${U} || {}`),u8($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:xz}),items:Tz({mergeNames:($,I,U)=>$.if(H$._`${U} !== true && ${I} !== undefined`,()=>$.assign(U,H$._`${I} === true ? true : ${U} > ${I} ? ${U} : ${I}`)),mergeToName:($,I,U)=>$.if(H$._`${U} !== true`,()=>$.assign(U,I===!0?!0:H$._`${U} > ${I} ? ${U} : ${I}`)),mergeValues:($,I)=>$===!0?!0:Math.max($,I),resultToName:($,I)=>$.var("items",I)})};function xz($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",H$._`{}`);if(I!==void 0)u8($,U,I);return U}fz.evaluatedPropsToName=xz;function u8($,I,U){Object.keys(U).forEach((b)=>$.assign(H$._`${I}${H$.getProperty(b)}`,!0))}fz.setEvaluated=u8;var _z={};function uk($,I){return $.scopeValue("func",{ref:I,code:_z[I.code]||(_z[I.code]=new _k._Code(I.code))})}fz.useFunc=uk;var f8;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(f8||(fz.Type=f8={}));function lk($,I,U){if($ instanceof H$.Name){let b=I===f8.Num;return U?b?H$._`"[" + ${$} + "]"`:H$._`"['" + ${$} + "']"`:b?H$._`"/" + ${$}`:H$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?H$.getProperty($).toString():"/"+y8($)}fz.getErrorPath=lk;function hz($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}fz.checkStrictMode=hz});var s6=Z((uz)=>{Object.defineProperty(uz,"__esModule",{value:!0});var y$=a(),XR={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")};uz.default=XR});var BU=Z((rz)=>{Object.defineProperty(rz,"__esModule",{value:!0});rz.extendErrors=rz.resetErrorsCount=rz.reportExtraError=rz.reportError=rz.keyword$DataError=rz.keywordError=void 0;var D$=a(),Nb=W$(),n$=s6();rz.keywordError={message:({keyword:$})=>D$.str`must pass "${$}" keyword validation`};rz.keyword$DataError={message:({keyword:$,schemaType:I})=>I?D$.str`"${$}" keyword must be ${I} ($data)`:D$.str`"${$}" keyword is invalid ($data)`};function WR($,I=rz.keywordError,U,b){let{it:w}=$,{gen:X,compositeRule:D,allErrors:W}=w,Q=mz($,I,U);if(b!==null&&b!==void 0?b:D||W)lz(X,Q);else cz(w,D$._`[${Q}]`)}rz.reportError=WR;function QR($,I=rz.keywordError,U){let{it:b}=$,{gen:w,compositeRule:X,allErrors:D}=b,W=mz($,I,U);if(lz(w,W),!(X||D))cz(b,n$.default.vErrors)}rz.reportExtraError=QR;function GR($,I){$.assign(n$.default.errors,I),$.if(D$._`${n$.default.vErrors} !== null`,()=>$.if(I,()=>$.assign(D$._`${n$.default.vErrors}.length`,I),()=>$.assign(n$.default.vErrors,null)))}rz.resetErrorsCount=GR;function NR({gen:$,keyword:I,schemaValue:U,data:b,errsCount:w,it:X}){if(w===void 0)throw new Error("ajv implementation error");let D=$.name("err");$.forRange("i",w,n$.default.errors,(W)=>{if($.const(D,D$._`${n$.default.vErrors}[${W}]`),$.if(D$._`${D}.instancePath === undefined`,()=>$.assign(D$._`${D}.instancePath`,D$.strConcat(n$.default.instancePath,X.errorPath))),$.assign(D$._`${D}.schemaPath`,D$.str`${X.errSchemaPath}/${I}`),X.opts.verbose)$.assign(D$._`${D}.schema`,U),$.assign(D$._`${D}.data`,b)})}rz.extendErrors=NR;function lz($,I){let U=$.const("err",I);$.if(D$._`${n$.default.vErrors} === null`,()=>$.assign(n$.default.vErrors,D$._`[${U}]`),D$._`${n$.default.vErrors}.push(${U})`),$.code(D$._`${n$.default.errors}++`)}function cz($,I){let{gen:U,validateName:b,schemaEnv:w}=$;if(w.$async)U.throw(D$._`new ${$.ValidationError}(${I})`);else U.assign(D$._`${b}.errors`,I),U.return(!1)}var p4={keyword:new D$.Name("keyword"),schemaPath:new D$.Name("schemaPath"),params:new D$.Name("params"),propertyName:new D$.Name("propertyName"),message:new D$.Name("message"),schema:new D$.Name("schema"),parentSchema:new D$.Name("parentSchema")};function mz($,I,U){let{createErrors:b}=$.it;if(b===!1)return D$._`{}`;return YR($,I,U)}function YR($,I,U={}){let{gen:b,it:w}=$,X=[BR(w,U),JR($,U)];return HR($,I,X),b.object(...X)}function BR({errorPath:$},{instancePath:I}){let U=I?D$.str`${$}${Nb.getErrorPath(I,Nb.Type.Str)}`:$;return[n$.default.instancePath,D$.strConcat(n$.default.instancePath,U)]}function JR({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:b}){let w=b?I:D$.str`${I}/${$}`;if(U)w=D$.str`${w}${Nb.getErrorPath(U,Nb.Type.Str)}`;return[p4.schemaPath,w]}function HR($,{params:I,message:U},b){let{keyword:w,data:X,schemaValue:D,it:W}=$,{opts:Q,propertyName:G,topSchemaRef:N,schemaPath:B}=W;if(b.push([p4.keyword,w],[p4.params,typeof I=="function"?I($):I||D$._`{}`]),Q.messages)b.push([p4.message,typeof U=="function"?U($):U]);if(Q.verbose)b.push([p4.schema,D],[p4.parentSchema,D$._`${N}${B}`],[n$.default.data,X]);if(G)b.push([p4.propertyName,G])}});var pz=Z((oz)=>{Object.defineProperty(oz,"__esModule",{value:!0});oz.boolOrEmptySchema=oz.topBoolOrEmptySchema=void 0;var KR=BU(),vR=a(),VR=s6(),qR={message:"boolean schema is false"};function FR($){let{gen:I,schema:U,validateName:b}=$;if(U===!1)iz($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(VR.default.data);else I.assign(vR._`${b}.errors`,null),I.return(!0)}oz.topBoolOrEmptySchema=FR;function MR($,I){let{gen:U,schema:b}=$;if(b===!1)U.var(I,!1),iz($);else U.var(I,!0)}oz.boolOrEmptySchema=MR;function iz($,I){let{gen:U,data:b}=$,w={gen:U,keyword:"false schema",data:b,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};KR.reportError(w,qR,void 0,I)}});var c8=Z((tz)=>{Object.defineProperty(tz,"__esModule",{value:!0});tz.getRules=tz.isJSONType=void 0;var ER=["string","number","integer","boolean","null","object","array"],SR=new Set(ER);function PR($){return typeof $=="string"&&SR.has($)}tz.isJSONType=PR;function kR(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}tz.getRules=kR});var m8=Z(($3)=>{Object.defineProperty($3,"__esModule",{value:!0});$3.shouldUseRule=$3.shouldUseGroup=$3.schemaHasRulesForType=void 0;function TR({schema:$,self:I},U){let b=I.RULES.types[U];return b&&b!==!0&&ez($,b)}$3.schemaHasRulesForType=TR;function ez($,I){return I.rules.some((U)=>sz($,U))}$3.shouldUseGroup=ez;function sz($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((b)=>$[b]!==void 0))}$3.shouldUseRule=sz});var JU=Z((X3)=>{Object.defineProperty(X3,"__esModule",{value:!0});X3.reportTypeError=X3.checkDataTypes=X3.checkDataType=X3.coerceAndCheckDataType=X3.getJSONTypes=X3.getSchemaTypes=X3.DataType=void 0;var CR=c8(),gR=m8(),xR=BU(),p=a(),U3=W$(),R1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(R1||(X3.DataType=R1={}));function hR($){let I=w3($.type);if(I.includes("null")){if($.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!I.length&&$.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');if($.nullable===!0)I.push("null")}return I}X3.getSchemaTypes=hR;function w3($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(CR.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}X3.getJSONTypes=w3;function fR($,I){let{gen:U,data:b,opts:w}=$,X=yR(I,w.coerceTypes),D=I.length>0&&!(X.length===0&&I.length===1&&gR.schemaHasRulesForType($,I[0]));if(D){let W=n8(I,b,w.strictNumbers,R1.Wrong);U.if(W,()=>{if(X.length)uR($,I,X);else i8($)})}return D}X3.coerceAndCheckDataType=fR;var b3=new Set(["string","number","integer","boolean","null"]);function yR($,I){return I?$.filter((U)=>b3.has(U)||I==="array"&&U==="array"):[]}function uR($,I,U){let{gen:b,data:w,opts:X}=$,D=b.let("dataType",p._`typeof ${w}`),W=b.let("coerced",p._`undefined`);if(X.coerceTypes==="array")b.if(p._`${D} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>b.assign(w,p._`${w}[0]`).assign(D,p._`typeof ${w}`).if(n8(I,w,X.strictNumbers),()=>b.assign(W,w)));b.if(p._`${W} !== undefined`);for(let G of U)if(b3.has(G)||G==="array"&&X.coerceTypes==="array")Q(G);b.else(),i8($),b.endIf(),b.if(p._`${W} !== undefined`,()=>{b.assign(w,W),lR($,W)});function Q(G){switch(G){case"string":b.elseIf(p._`${D} == "number" || ${D} == "boolean"`).assign(W,p._`"" + ${w}`).elseIf(p._`${w} === null`).assign(W,p._`""`);return;case"number":b.elseIf(p._`${D} == "boolean" || ${w} === null
4
4
  || (${D} == "string" && ${w} && ${w} == +${w})`).assign(W,p._`+${w}`);return;case"integer":b.elseIf(p._`${D} === "boolean" || ${w} === null
5
5
  || (${D} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(W,p._`+${w}`);return;case"boolean":b.elseIf(p._`${w} === "false" || ${w} === 0 || ${w} === null`).assign(W,!1).elseIf(p._`${w} === "true" || ${w} === 1`).assign(W,!0);return;case"null":b.elseIf(p._`${w} === "" || ${w} === 0 || ${w} === false`),b.assign(W,null);return;case"array":b.elseIf(p._`${D} === "string" || ${D} === "number"
6
- || ${D} === "boolean" || ${w} === null`).assign(W,p._`[${w}]`)}}}function uR({gen:$,parentData:I,parentDataProperty:U},b){$.if(p._`${I} !== undefined`,()=>$.assign(p._`${I}[${U}]`,b))}function r8($,I,U,b=R1.Correct){let w=b===R1.Correct?p.operators.EQ:p.operators.NEQ,X;switch($){case"null":return p._`${I} ${w} null`;case"array":X=p._`Array.isArray(${I})`;break;case"object":X=p._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":X=D(p._`!(${I} % 1) && !isNaN(${I})`);break;case"number":X=D();break;default:return p._`typeof ${I} ${w} ${$}`}return b===R1.Correct?X:p.not(X);function D(W=p.nil){return p.and(p._`typeof ${I} == "number"`,W,U?p._`isFinite(${I})`:p.nil)}}b3.checkDataType=r8;function n8($,I,U,b){if($.length===1)return r8($[0],I,U,b);let w,X=I3.toHash($);if(X.array&&X.object){let D=p._`typeof ${I} != "object"`;w=X.null?D:p._`!${I} || ${D}`,delete X.null,delete X.array,delete X.object}else w=p.nil;if(X.number)delete X.integer;for(let D in X)w=p.and(w,r8(D,I,U,b));return w}b3.checkDataTypes=n8;var lR={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?p._`{type: ${$}}`:p._`{type: ${I}}`};function i8($){let I=cR($);gR.reportError(I,lR)}b3.reportTypeError=i8;function cR($){let{gen:I,data:U,schema:b}=$,w=I3.schemaRefOrVal($,b,"type");return{gen:I,keyword:"type",data:U,schema:b.type,schemaCode:w,schemaValue:w,parentSchema:b,params:{},it:$}}});var G3=Z((W3)=>{Object.defineProperty(W3,"__esModule",{value:!0});W3.assignDefaults=void 0;var T1=a(),pR=W$();function tR($,I){let{properties:U,items:b}=$.schema;if(I==="object"&&U)for(let w in U)D3($,w,U[w].default);else if(I==="array"&&Array.isArray(b))b.forEach((w,X)=>D3($,X,w.default))}W3.assignDefaults=tR;function D3($,I,U){let{gen:b,compositeRule:w,data:X,opts:D}=$;if(U===void 0)return;let W=T1._`${X}${T1.getProperty(I)}`;if(w){pR.checkStrictMode($,`default is ignored for: ${W}`);return}let Q=T1._`${W} === undefined`;if(D.useDefaults==="empty")Q=T1._`${Q} || ${W} === null || ${W} === ""`;b.if(Q,T1._`${W} = ${T1.stringify(U)}`)}});var O6=Z((B3)=>{Object.defineProperty(B3,"__esModule",{value:!0});B3.validateUnion=B3.validateArray=B3.usePattern=B3.callValidateCode=B3.schemaProperties=B3.allSchemaProperties=B3.noPropertyInData=B3.propertyInData=B3.isOwnProperty=B3.hasPropFunc=B3.reportMissingProp=B3.checkMissingProp=B3.checkReportMissingProp=void 0;var K$=a(),o8=W$(),K4=s6(),aR=W$();function eR($,I){let{gen:U,data:b,it:w}=$;U.if(p8(U,b,I,w.opts.ownProperties),()=>{$.setParams({missingProperty:K$._`${I}`},!0),$.error()})}B3.checkReportMissingProp=eR;function sR({gen:$,data:I,it:{opts:U}},b,w){return K$.or(...b.map((X)=>K$.and(p8($,I,X,U.ownProperties),K$._`${w} = ${X}`)))}B3.checkMissingProp=sR;function $2($,I){$.setParams({missingProperty:I},!0),$.error()}B3.reportMissingProp=$2;function N3($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:K$._`Object.prototype.hasOwnProperty`})}B3.hasPropFunc=N3;function d8($,I,U){return K$._`${N3($)}.call(${I}, ${U})`}B3.isOwnProperty=d8;function I2($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} !== undefined`;return b?K$._`${w} && ${d8($,I,U)}`:w}B3.propertyInData=I2;function p8($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} === undefined`;return b?K$.or(w,K$.not(d8($,I,U))):w}B3.noPropertyInData=p8;function Y3($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}B3.allSchemaProperties=Y3;function U2($,I){return Y3(I).filter((U)=>!o8.alwaysValidSchema($,I[U]))}B3.schemaProperties=U2;function w2({schemaCode:$,data:I,it:{gen:U,topSchemaRef:b,schemaPath:w,errorPath:X},it:D},W,Q,G){let N=G?K$._`${$}, ${I}, ${b}${w}`:I,B=[[K4.default.instancePath,K$.strConcat(K4.default.instancePath,X)],[K4.default.parentData,D.parentData],[K4.default.parentDataProperty,D.parentDataProperty],[K4.default.rootData,K4.default.rootData]];if(D.opts.dynamicRef)B.push([K4.default.dynamicAnchors,K4.default.dynamicAnchors]);let H=K$._`${N}, ${U.object(...B)}`;return Q!==K$.nil?K$._`${W}.call(${Q}, ${H})`:K$._`${W}(${H})`}B3.callValidateCode=w2;var b2=K$._`new RegExp`;function X2({gen:$,it:{opts:I}},U){let b=I.unicodeRegExp?"u":"",{regExp:w}=I.code,X=w(U,b);return $.scopeValue("pattern",{key:X.toString(),ref:X,code:K$._`${w.code==="new RegExp"?b2:aR.useFunc($,w)}(${U}, ${b})`})}B3.usePattern=X2;function D2($){let{gen:I,data:U,keyword:b,it:w}=$,X=I.name("valid");if(w.allErrors){let W=I.let("valid",!0);return D(()=>I.assign(W,!1)),W}return I.var(X,!0),D(()=>I.break()),X;function D(W){let Q=I.const("len",K$._`${U}.length`);I.forRange("i",0,Q,(G)=>{$.subschema({keyword:b,dataProp:G,dataPropType:o8.Type.Num},X),I.if(K$.not(X),W)})}}B3.validateArray=D2;function W2($){let{gen:I,schema:U,keyword:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((Q)=>o8.alwaysValidSchema(w,Q))&&!w.opts.unevaluated)return;let D=I.let("valid",!1),W=I.name("_valid");I.block(()=>U.forEach((Q,G)=>{let N=$.subschema({keyword:b,schemaProp:G,compositeRule:!0},W);if(I.assign(D,K$._`${D} || ${W}`),!$.mergeValidEvaluated(N,W))I.if(K$.not(D))})),$.result(D,()=>$.reset(),()=>$.error(!0))}B3.validateUnion=W2});var L3=Z((O3)=>{Object.defineProperty(O3,"__esModule",{value:!0});O3.validateKeywordUsage=O3.validSchemaType=O3.funcKeywordCode=O3.macroKeywordCode=void 0;var i$=a(),t4=s6(),v2=O6(),V2=BU();function q2($,I){let{gen:U,keyword:b,schema:w,parentSchema:X,it:D}=$,W=I.macro.call(D.self,w,X,D),Q=A3(U,b,W);if(D.opts.validateSchema!==!1)D.self.validateSchema(W,!0);let G=U.name("valid");$.subschema({schema:W,schemaPath:i$.nil,errSchemaPath:`${D.errSchemaPath}/${b}`,topSchemaRef:Q,compositeRule:!0},G),$.pass(G,()=>$.error(!0))}O3.macroKeywordCode=q2;function F2($,I){var U;let{gen:b,keyword:w,schema:X,parentSchema:D,$data:W,it:Q}=$;j2(Q,I);let G=!W&&I.compile?I.compile.call(Q.self,X,D,Q):I.validate,N=A3(b,w,G),B=b.let("valid");$.block$data(B,H),$.ok((U=I.valid)!==null&&U!==void 0?U:B);function H(){if(I.errors===!1){if(O(),I.modifying)H3($);V(()=>$.error())}else{let q=I.async?J():A();if(I.modifying)H3($);V(()=>M2($,q))}}function J(){let q=b.let("ruleErrs",null);return b.try(()=>O(i$._`await `),(k)=>b.assign(B,!1).if(i$._`${k} instanceof ${Q.ValidationError}`,()=>b.assign(q,i$._`${k}.errors`),()=>b.throw(k))),q}function A(){let q=i$._`${N}.errors`;return b.assign(q,null),O(i$.nil),q}function O(q=I.async?i$._`await `:i$.nil){let k=Q.opts.passContext?t4.default.this:t4.default.self,P=!(("compile"in I)&&!W||I.schema===!1);b.assign(B,i$._`${q}${v2.callValidateCode($,N,k,P)}`,I.modifying)}function V(q){var k;b.if(i$.not((k=I.valid)!==null&&k!==void 0?k:B),q)}}O3.funcKeywordCode=F2;function H3($){let{gen:I,data:U,it:b}=$;I.if(b.parentData,()=>I.assign(U,i$._`${b.parentData}[${b.parentDataProperty}]`))}function M2($,I){let{gen:U}=$;U.if(i$._`Array.isArray(${I})`,()=>{U.assign(t4.default.vErrors,i$._`${t4.default.vErrors} === null ? ${I} : ${t4.default.vErrors}.concat(${I})`).assign(t4.default.errors,i$._`${t4.default.vErrors}.length`),V2.extendErrors($)},()=>$.error())}function j2({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function A3($,I,U){if(U===void 0)throw new Error(`keyword "${I}" failed to compile`);return $.scopeValue("keyword",typeof U=="function"?{ref:U}:{ref:U,code:i$.stringify(U)})}function E2($,I,U=!1){return!I.length||I.some((b)=>b==="array"?Array.isArray($):b==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==b||U&&typeof $=="undefined")}O3.validSchemaType=E2;function S2({schema:$,opts:I,self:U,errSchemaPath:b},w,X){if(Array.isArray(w.keyword)?!w.keyword.includes(X):w.keyword!==X)throw new Error("ajv implementation error");let D=w.dependencies;if(D===null||D===void 0?void 0:D.some((W)=>!Object.prototype.hasOwnProperty.call($,W)))throw new Error(`parent schema must have dependencies of ${X}: ${D.join(",")}`);if(w.validateSchema){if(!w.validateSchema($[X])){let Q=`keyword "${X}" value is invalid at path "${b}": `+U.errorsText(w.validateSchema.errors);if(I.validateSchema==="log")U.logger.error(Q);else throw new Error(Q)}}}O3.validateKeywordUsage=S2});var q3=Z((v3)=>{Object.defineProperty(v3,"__esModule",{value:!0});v3.extendSubschemaMode=v3.extendSubschemaData=v3.getSubschema=void 0;var h6=a(),K3=W$();function T2($,{keyword:I,schemaProp:U,schema:b,schemaPath:w,errSchemaPath:X,topSchemaRef:D}){if(I!==void 0&&b!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(I!==void 0){let W=$.schema[I];return U===void 0?{schema:W,schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:W[U],schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}${h6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${K3.escapeFragment(U)}`}}if(b!==void 0){if(w===void 0||X===void 0||D===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:b,schemaPath:w,topSchemaRef:D,errSchemaPath:X}}throw new Error('either "keyword" or "schema" must be passed')}v3.getSubschema=T2;function _2($,I,{dataProp:U,dataPropType:b,data:w,dataTypes:X,propertyName:D}){if(w!==void 0&&U!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:W}=I;if(U!==void 0){let{errorPath:G,dataPathArr:N,opts:B}=I,H=W.let("data",h6._`${I.data}${h6.getProperty(U)}`,!0);Q(H),$.errorPath=h6.str`${G}${K3.getErrorPath(U,b,B.jsPropertySyntax)}`,$.parentDataProperty=h6._`${U}`,$.dataPathArr=[...N,$.parentDataProperty]}if(w!==void 0){let G=w instanceof h6.Name?w:W.let("data",w,!0);if(Q(G),D!==void 0)$.propertyName=D}if(X)$.dataTypes=X;function Q(G){$.data=G,$.dataLevel=I.dataLevel+1,$.dataTypes=[],I.definedProperties=new Set,$.parentData=I.data,$.dataNames=[...I.dataNames,G]}}v3.extendSubschemaData=_2;function Z2($,{jtdDiscriminator:I,jtdMetadata:U,compositeRule:b,createErrors:w,allErrors:X}){if(b!==void 0)$.compositeRule=b;if(w!==void 0)$.createErrors=w;if(X!==void 0)$.allErrors=X;$.jtdDiscriminator=I,$.jtdMetadata=U}v3.extendSubschemaMode=Z2});var t8=Z((Zi,F3)=>{F3.exports=function $(I,U){if(I===U)return!0;if(I&&U&&typeof I=="object"&&typeof U=="object"){if(I.constructor!==U.constructor)return!1;var b,w,X;if(Array.isArray(I)){if(b=I.length,b!=U.length)return!1;for(w=b;w--!==0;)if(!$(I[w],U[w]))return!1;return!0}if(I.constructor===RegExp)return I.source===U.source&&I.flags===U.flags;if(I.valueOf!==Object.prototype.valueOf)return I.valueOf()===U.valueOf();if(I.toString!==Object.prototype.toString)return I.toString()===U.toString();if(X=Object.keys(I),b=X.length,b!==Object.keys(U).length)return!1;for(w=b;w--!==0;)if(!Object.prototype.hasOwnProperty.call(U,X[w]))return!1;for(w=b;w--!==0;){var D=X[w];if(!$(I[D],U[D]))return!1}return!0}return I!==I&&U!==U}});var j3=Z((Ci,M3)=>{var v4=M3.exports=function($,I,U){if(typeof I=="function")U=I,I={};U=I.cb||U;var b=typeof U=="function"?U:U.pre||function(){},w=U.post||function(){};Yb(I,b,w,$,"",$)};v4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};v4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};v4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};v4.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 Yb($,I,U,b,w,X,D,W,Q,G){if(b&&typeof b=="object"&&!Array.isArray(b)){I(b,w,X,D,W,Q,G);for(var N in b){var B=b[N];if(Array.isArray(B)){if(N in v4.arrayKeywords)for(var H=0;H<B.length;H++)Yb($,I,U,B[H],w+"/"+N+"/"+H,X,w,N,b,H)}else if(N in v4.propsKeywords){if(B&&typeof B=="object")for(var J in B)Yb($,I,U,B[J],w+"/"+N+"/"+x2(J),X,w,N,b,J)}else if(N in v4.keywords||$.allKeys&&!(N in v4.skipKeywords))Yb($,I,U,B,w+"/"+N,X,w,N,b)}U(b,w,X,D,W,Q,G)}}function x2($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var HU=Z((k3)=>{Object.defineProperty(k3,"__esModule",{value:!0});k3.getSchemaRefs=k3.resolveUrl=k3.normalizeId=k3._getFullPath=k3.getFullPath=k3.inlineRef=void 0;var h2=W$(),f2=t8(),y2=j3(),u2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function l2($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!a8($);if(!I)return!1;return E3($)<=I}k3.inlineRef=l2;var c2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a8($){for(let I in $){if(c2.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(a8))return!0;if(typeof U=="object"&&a8(U))return!0}return!1}function E3($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,u2.has(U))continue;if(typeof $[U]=="object")h2.eachItem($[U],(b)=>I+=E3(b));if(I===1/0)return 1/0}return I}function S3($,I="",U){if(U!==!1)I=_1(I);let b=$.parse(I);return P3($,b)}k3.getFullPath=S3;function P3($,I){return $.serialize(I).split("#")[0]+"#"}k3._getFullPath=P3;var m2=/#\/?$/;function _1($){return $?$.replace(m2,""):""}k3.normalizeId=_1;function r2($,I,U){return U=_1(U),$.resolve(I,U)}k3.resolveUrl=r2;var n2=/^[a-z_][-a-z0-9._]*$/i;function i2($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:b}=this.opts,w=_1($[U]||I),X={"":w},D=S3(b,w,!1),W={},Q=new Set;return y2($,{allKeys:!0},(B,H,J,A)=>{if(A===void 0)return;let O=D+H,V=X[A];if(typeof B[U]=="string")V=q.call(this,B[U]);k.call(this,B.$anchor),k.call(this,B.$dynamicAnchor),X[H]=V;function q(P){let x=this.opts.uriResolver.resolve;if(P=_1(V?x(V,P):P),Q.has(P))throw N(P);Q.add(P);let l=this.refs[P];if(typeof l=="string")l=this.refs[l];if(typeof l=="object")G(B,l.schema,P);else if(P!==_1(O))if(P[0]==="#")G(B,W[P],P),W[P]=B;else this.refs[P]=O;return P}function k(P){if(typeof P=="string"){if(!n2.test(P))throw new Error(`invalid anchor "${P}"`);q.call(this,`#${P}`)}}}),W;function G(B,H,J){if(H!==void 0&&!f2(B,H))throw N(J)}function N(B){return new Error(`reference "${B}" resolves to more than one schema`)}}k3.getSchemaRefs=i2});var zU=Z((n3)=>{Object.defineProperty(n3,"__esModule",{value:!0});n3.getData=n3.KeywordCxt=n3.validateFunctionCode=void 0;var g3=dz(),T3=JU(),s8=m8(),Bb=JU(),e2=G3(),OU=L3(),e8=q3(),y=a(),i=s6(),s2=HU(),$4=W$(),AU=BU();function $T($){if(f3($)){if(y3($),h3($)){wT($);return}}x3($,()=>g3.topBoolOrEmptySchema($))}n3.validateFunctionCode=$T;function x3({gen:$,validateName:I,schema:U,schemaEnv:b,opts:w},X){if(w.code.es5)$.func(I,y._`${i.default.data}, ${i.default.valCxt}`,b.$async,()=>{$.code(y._`"use strict"; ${_3(U,w)}`),UT($,w),$.code(X)});else $.func(I,y._`${i.default.data}, ${IT(w)}`,b.$async,()=>$.code(_3(U,w)).code(X))}function IT($){return y._`{${i.default.instancePath}="", ${i.default.parentData}, ${i.default.parentDataProperty}, ${i.default.rootData}=${i.default.data}${$.dynamicRef?y._`, ${i.default.dynamicAnchors}={}`:y.nil}}={}`}function UT($,I){$.if(i.default.valCxt,()=>{if($.var(i.default.instancePath,y._`${i.default.valCxt}.${i.default.instancePath}`),$.var(i.default.parentData,y._`${i.default.valCxt}.${i.default.parentData}`),$.var(i.default.parentDataProperty,y._`${i.default.valCxt}.${i.default.parentDataProperty}`),$.var(i.default.rootData,y._`${i.default.valCxt}.${i.default.rootData}`),I.dynamicRef)$.var(i.default.dynamicAnchors,y._`${i.default.valCxt}.${i.default.dynamicAnchors}`)},()=>{if($.var(i.default.instancePath,y._`""`),$.var(i.default.parentData,y._`undefined`),$.var(i.default.parentDataProperty,y._`undefined`),$.var(i.default.rootData,i.default.data),I.dynamicRef)$.var(i.default.dynamicAnchors,y._`{}`)})}function wT($){let{schema:I,opts:U,gen:b}=$;x3($,()=>{if(U.$comment&&I.$comment)l3($);if(QT($),b.let(i.default.vErrors,null),b.let(i.default.errors,0),U.unevaluated)bT($);u3($),YT($)});return}function bT($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",y._`${U}.evaluated`),I.if(y._`${$.evaluated}.dynamicProps`,()=>I.assign(y._`${$.evaluated}.props`,y._`undefined`)),I.if(y._`${$.evaluated}.dynamicItems`,()=>I.assign(y._`${$.evaluated}.items`,y._`undefined`))}function _3($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?y._`/*# sourceURL=${U} */`:y.nil}function XT($,I){if(f3($)){if(y3($),h3($)){DT($,I);return}}g3.boolOrEmptySchema($,I)}function h3({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function f3($){return typeof $.schema!="boolean"}function DT($,I){let{schema:U,gen:b,opts:w}=$;if(w.$comment&&U.$comment)l3($);GT($),NT($);let X=b.const("_errs",i.default.errors);u3($,X),b.var(I,y._`${X} === ${i.default.errors}`)}function y3($){$4.checkUnknownRules($),WT($)}function u3($,I){if($.opts.jtd)return Z3($,[],!1,I);let U=T3.getSchemaTypes($.schema),b=T3.coerceAndCheckDataType($,U);Z3($,U,!b,I)}function WT($){let{schema:I,errSchemaPath:U,opts:b,self:w}=$;if(I.$ref&&b.ignoreKeywordsWithRef&&$4.schemaHasRulesButRef(I,w.RULES))w.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function QT($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)$4.checkStrictMode($,"default is ignored in the schema root")}function GT($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=s2.resolveUrl($.opts.uriResolver,$.baseId,I)}function NT($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function l3({gen:$,schemaEnv:I,schema:U,errSchemaPath:b,opts:w}){let X=U.$comment;if(w.$comment===!0)$.code(y._`${i.default.self}.logger.log(${X})`);else if(typeof w.$comment=="function"){let D=y.str`${b}/$comment`,W=$.scopeValue("root",{ref:I.root});$.code(y._`${i.default.self}.opts.$comment(${X}, ${D}, ${W}.schema)`)}}function YT($){let{gen:I,schemaEnv:U,validateName:b,ValidationError:w,opts:X}=$;if(U.$async)I.if(y._`${i.default.errors} === 0`,()=>I.return(i.default.data),()=>I.throw(y._`new ${w}(${i.default.vErrors})`));else{if(I.assign(y._`${b}.errors`,i.default.vErrors),X.unevaluated)BT($);I.return(y._`${i.default.errors} === 0`)}}function BT({gen:$,evaluated:I,props:U,items:b}){if(U instanceof y.Name)$.assign(y._`${I}.props`,U);if(b instanceof y.Name)$.assign(y._`${I}.items`,b)}function Z3($,I,U,b){let{gen:w,schema:X,data:D,allErrors:W,opts:Q,self:G}=$,{RULES:N}=G;if(X.$ref&&(Q.ignoreKeywordsWithRef||!$4.schemaHasRulesButRef(X,N))){w.block(()=>m3($,"$ref",N.all.$ref.definition));return}if(!Q.jtd)JT($,I);w.block(()=>{for(let H of N.rules)B(H);B(N.post)});function B(H){if(!s8.shouldUseGroup(X,H))return;if(H.type){if(w.if(Bb.checkDataType(H.type,D,Q.strictNumbers)),C3($,H),I.length===1&&I[0]===H.type&&U)w.else(),Bb.reportTypeError($);w.endIf()}else C3($,H);if(!W)w.if(y._`${i.default.errors} === ${b||0}`)}}function C3($,I){let{gen:U,schema:b,opts:{useDefaults:w}}=$;if(w)e2.assignDefaults($,I.type);U.block(()=>{for(let X of I.rules)if(s8.shouldUseRule(b,X))m3($,X.keyword,X.definition,I.type)})}function JT($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(HT($,I),!$.opts.allowUnionTypes)AT($,I);OT($,$.dataTypes)}function HT($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!c3($.dataTypes,U))$Q($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),LT($,I)}function AT($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))$Q($,"use allowUnionTypes to allow union type keyword")}function OT($,I){let U=$.self.RULES.all;for(let b in U){let w=U[b];if(typeof w=="object"&&s8.shouldUseRule($.schema,w)){let{type:X}=w.definition;if(X.length&&!X.some((D)=>zT(I,D)))$Q($,`missing type "${X.join(",")}" for keyword "${b}"`)}}}function zT($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function c3($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function LT($,I){let U=[];for(let b of $.dataTypes)if(c3(I,b))U.push(b);else if(I.includes("integer")&&b==="number")U.push("integer");$.dataTypes=U}function $Q($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,$4.checkStrictMode($,I,$.opts.strictTypes)}class IQ{constructor($,I,U){if(OU.validateKeywordUsage($,I,U),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=U,this.data=$.data,this.schema=$.schema[U],this.$data=I.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=$4.schemaRefOrVal($,this.schema,U,this.$data),this.schemaType=I.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=I,this.$data)this.schemaCode=$.gen.const("vSchema",r3(this.$data,$));else if(this.schemaCode=this.schemaValue,!OU.validSchemaType(this.schema,I.schemaType,I.allowUndefined))throw new Error(`${U} value must be ${JSON.stringify(I.schemaType)}`);if("code"in I?I.trackErrors:I.errors!==!1)this.errsCount=$.gen.const("_errs",i.default.errors)}result($,I,U){this.failResult(y.not($),I,U)}failResult($,I,U){if(this.gen.if($),U)U();else this.error();if(I){if(this.gen.else(),I(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,I){this.failResult(y.not($),void 0,I)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:I}=this;this.fail(y._`${I} !== undefined && (${y.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?AU.reportExtraError:AU.reportError)(this,this.def.error,I)}$dataError(){AU.reportError(this,this.def.$dataError||AU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');AU.resetErrorsCount(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,I){if(I)Object.assign(this.params,$);else this.params=$}block$data($,I,U=y.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=y.nil,I=y.nil){if(!this.$data)return;let{gen:U,schemaCode:b,schemaType:w,def:X}=this;if(U.if(y.or(y._`${b} === undefined`,I)),$!==y.nil)U.assign($,!0);if(w.length||X.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==y.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:b,it:w}=this;return y.or(X(),D());function X(){if(U.length){if(!(I instanceof y.Name))throw new Error("ajv implementation error");let W=Array.isArray(U)?U:[U];return y._`${Bb.checkDataTypes(W,I,w.opts.strictNumbers,Bb.DataType.Wrong)}`}return y.nil}function D(){if(b.validateSchema){let W=$.scopeValue("validate$data",{ref:b.validateSchema});return y._`!${W}(${I})`}return y.nil}}subschema($,I){let U=e8.getSubschema(this.it,$);e8.extendSubschemaData(U,this.it,$),e8.extendSubschemaMode(U,$);let b={...this.it,...U,items:void 0,props:void 0};return XT(b,I),b}mergeEvaluated($,I){let{it:U,gen:b}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&$.props!==void 0)U.props=$4.mergeEvaluated.props(b,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=$4.mergeEvaluated.items(b,$.items,U.items,I)}mergeValidEvaluated($,I){let{it:U,gen:b}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return b.if(I,()=>this.mergeEvaluated($,y.Name)),!0}}n3.KeywordCxt=IQ;function m3($,I,U,b){let w=new IQ($,U,I);if("code"in U)U.code(w,b);else if(w.$data&&U.validate)OU.funcKeywordCode(w,U);else if("macro"in U)OU.macroKeywordCode(w,U);else if(U.compile||U.validate)OU.funcKeywordCode(w,U)}var KT=/^\/(?:[^~]|~0|~1)*$/,vT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function r3($,{dataLevel:I,dataNames:U,dataPathArr:b}){let w,X;if($==="")return i.default.rootData;if($[0]==="/"){if(!KT.test($))throw new Error(`Invalid JSON-pointer: ${$}`);w=$,X=i.default.rootData}else{let G=vT.exec($);if(!G)throw new Error(`Invalid JSON-pointer: ${$}`);let N=+G[1];if(w=G[2],w==="#"){if(N>=I)throw new Error(Q("property/index",N));return b[I-N]}if(N>I)throw new Error(Q("data",N));if(X=U[I-N],!w)return X}let D=X,W=w.split("/");for(let G of W)if(G)X=y._`${X}${y.getProperty($4.unescapeJsonPointer(G))}`,D=y._`${D} && ${X}`;return D;function Q(G,N){return`Cannot access ${G} ${N} levels up, current level is ${I}`}}n3.getData=r3});var Jb=Z((d3)=>{Object.defineProperty(d3,"__esModule",{value:!0});class o3 extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}d3.default=o3});var LU=Z((t3)=>{Object.defineProperty(t3,"__esModule",{value:!0});var UQ=HU();class p3 extends Error{constructor($,I,U,b){super(b||`can't resolve reference ${U} from id ${I}`);this.missingRef=UQ.resolveUrl($,I,U),this.missingSchema=UQ.normalizeId(UQ.getFullPath($,this.missingRef))}}t3.default=p3});var Ab=Z((s3)=>{Object.defineProperty(s3,"__esModule",{value:!0});s3.resolveSchema=s3.getCompilingSchema=s3.resolveRef=s3.compileSchema=s3.SchemaEnv=void 0;var S6=a(),jT=Jb(),a4=s6(),P6=HU(),a3=W$(),ET=zU();class KU{constructor($){var I;this.refs={},this.dynamicAnchors={};let U;if(typeof $.schema=="object")U=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(I=$.baseId)!==null&&I!==void 0?I:P6.normalizeId(U===null||U===void 0?void 0:U[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=U===null||U===void 0?void 0:U.$async,this.refs={}}}s3.SchemaEnv=KU;function bQ($){let I=e3.call(this,$);if(I)return I;let U=P6.getFullPath(this.opts.uriResolver,$.root.baseId),{es5:b,lines:w}=this.opts.code,{ownProperties:X}=this.opts,D=new S6.CodeGen(this.scope,{es5:b,lines:w,ownProperties:X}),W;if($.$async)W=D.scopeValue("Error",{ref:jT.default,code:S6._`require("ajv/dist/runtime/validation_error").default`});let Q=D.scopeName("validate");$.validateName=Q;let G={gen:D,allErrors:this.opts.allErrors,data:a4.default.data,parentData:a4.default.parentData,parentDataProperty:a4.default.parentDataProperty,dataNames:[a4.default.data],dataPathArr:[S6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:D.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:S6.stringify($.schema)}:{ref:$.schema}),validateName:Q,ValidationError:W,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:S6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:S6._`""`,opts:this.opts,self:this},N;try{this._compilations.add($),ET.validateFunctionCode(G),D.optimize(this.opts.code.optimize);let B=D.toString();if(N=`${D.scopeRefs(a4.default.scope)}return ${B}`,this.opts.code.process)N=this.opts.code.process(N,$);let J=new Function(`${a4.default.self}`,`${a4.default.scope}`,N)(this,this.scope.get());if(this.scope.value(Q,{ref:J}),J.errors=null,J.schema=$.schema,J.schemaEnv=$,$.$async)J.$async=!0;if(this.opts.code.source===!0)J.source={validateName:Q,validateCode:B,scopeValues:D._values};if(this.opts.unevaluated){let{props:A,items:O}=G;if(J.evaluated={props:A instanceof S6.Name?void 0:A,items:O instanceof S6.Name?void 0:O,dynamicProps:A instanceof S6.Name,dynamicItems:O instanceof S6.Name},J.source)J.source.evaluated=S6.stringify(J.evaluated)}return $.validate=J,$}catch(B){if(delete $.validate,delete $.validateName,N)this.logger.error("Error compiling schema, function code:",N);throw B}finally{this._compilations.delete($)}}s3.compileSchema=bQ;function ST($,I,U){var b;U=P6.resolveUrl(this.opts.uriResolver,I,U);let w=$.refs[U];if(w)return w;let X=RT.call(this,$,U);if(X===void 0){let D=(b=$.localRefs)===null||b===void 0?void 0:b[U],{schemaId:W}=this.opts;if(D)X=new KU({schema:D,schemaId:W,root:$,baseId:I})}if(X===void 0)return;return $.refs[U]=PT.call(this,X)}s3.resolveRef=ST;function PT($){if(P6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:bQ.call(this,$)}function e3($){for(let I of this._compilations)if(kT(I,$))return I}s3.getCompilingSchema=e3;function kT($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function RT($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||Hb.call(this,$,I)}function Hb($,I){let U=this.opts.uriResolver.parse(I),b=P6._getFullPath(this.opts.uriResolver,U),w=P6.getFullPath(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&b===w)return wQ.call(this,U,$);let X=P6.normalizeId(b),D=this.refs[X]||this.schemas[X];if(typeof D=="string"){let W=Hb.call(this,$,D);if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;return wQ.call(this,U,W)}if(typeof(D===null||D===void 0?void 0:D.schema)!=="object")return;if(!D.validate)bQ.call(this,D);if(X===P6.normalizeId(I)){let{schema:W}=D,{schemaId:Q}=this.opts,G=W[Q];if(G)w=P6.resolveUrl(this.opts.uriResolver,w,G);return new KU({schema:W,schemaId:Q,root:$,baseId:w})}return wQ.call(this,U,D)}s3.resolveSchema=Hb;var TT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function wQ($,{baseId:I,schema:U,root:b}){var w;if(((w=$.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let W of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let Q=U[a3.unescapeFragment(W)];if(Q===void 0)return;U=Q;let G=typeof U==="object"&&U[this.opts.schemaId];if(!TT.has(W)&&G)I=P6.resolveUrl(this.opts.uriResolver,I,G)}let X;if(typeof U!="boolean"&&U.$ref&&!a3.schemaHasRulesButRef(U,this.RULES)){let W=P6.resolveUrl(this.opts.uriResolver,I,U.$ref);X=Hb.call(this,b,W)}let{schemaId:D}=this.opts;if(X=X||new KU({schema:U,schemaId:D,root:b,baseId:I}),X.schema!==X.root.schema)return X;return}});var IL=Z((ui,xT)=>{xT.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}});var DQ=Z((li,XL)=>{var hT=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wL=RegExp.prototype.test.bind(/^(?:(?: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 XQ($){let I="",U=0,b=0;for(b=0;b<$.length;b++){if(U=$[b].charCodeAt(0),U===48)continue;if(!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[b];break}for(b+=1;b<$.length;b++){if(U=$[b].charCodeAt(0),!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[b]}return I}var fT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function UL($){return $.length=0,!0}function yT($,I,U){if($.length){let b=XQ($);if(b!=="")I.push(b);else return U.error=!0,!1;$.length=0}return!0}function uT($){let I=0,U={error:!1,address:"",zone:""},b=[],w=[],X=!1,D=!1,W=yT;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(G==="["||G==="]")continue;if(G===":"){if(X===!0)D=!0;if(!W(w,b,U))break;if(++I>7){U.error=!0;break}if(Q>0&&$[Q-1]===":")X=!0;b.push(":");continue}else if(G==="%"){if(!W(w,b,U))break;W=UL}else{w.push(G);continue}}if(w.length)if(W===UL)U.zone=w.join("");else if(D)b.push(w.join(""));else b.push(XQ(w));return U.address=b.join(""),U}function bL($){if(lT($,":")<2)return{host:$,isIPV6:!1};let I=uT($);if(!I.error){let{address:U,address:b}=I;if(I.zone)U+="%"+I.zone,b+="%25"+I.zone;return{host:U,isIPV6:!0,escapedHost:b}}else return{host:$,isIPV6:!1}}function lT($,I){let U=0;for(let b=0;b<$.length;b++)if($[b]===I)U++;return U}function cT($){let I=$,U=[],b=-1,w=0;while(w=I.length){if(w===1)if(I===".")break;else if(I==="/"){U.push("/");break}else{U.push(I);break}else if(w===2){if(I[0]==="."){if(I[1]===".")break;else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."||I[1]==="/"){U.push("/");break}}}else if(w===3){if(I==="/.."){if(U.length!==0)U.pop();U.push("/");break}}if(I[0]==="."){if(I[1]==="."){if(I[2]==="/"){I=I.slice(3);continue}}else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."){if(I[2]==="/"){I=I.slice(2);continue}else if(I[2]==="."){if(I[3]==="/"){if(I=I.slice(3),U.length!==0)U.pop();continue}}}}if((b=I.indexOf("/",1))===-1){U.push(I);break}else U.push(I.slice(0,b)),I=I.slice(b)}return U.join("")}function mT($,I){let U=I!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=U($.scheme);if($.userinfo!==void 0)$.userinfo=U($.userinfo);if($.host!==void 0)$.host=U($.host);if($.path!==void 0)$.path=U($.path);if($.query!==void 0)$.query=U($.query);if($.fragment!==void 0)$.fragment=U($.fragment);return $}function rT($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!wL(U)){let b=bL(U);if(b.isIPV6===!0)U=`[${b.escapedHost}]`;else U=$.host}I.push(U)}if(typeof $.port==="number"||typeof $.port==="string")I.push(":"),I.push(String($.port));return I.length?I.join(""):void 0}XL.exports={nonSimpleDomain:fT,recomposeAuthority:rT,normalizeComponentEncoding:mT,removeDotSegments:cT,isIPv4:wL,isUUID:hT,normalizeIPv6:bL,stringArrayToHexStripped:XQ}});var NL=Z((ci,GL)=>{var{isUUID:nT}=DQ(),iT=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,oT=["http","https","ws","wss","urn","urn:uuid"];function dT($){return oT.indexOf($)!==-1}function WQ($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function DL($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function WL($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function pT($){return $.secure=WQ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function tT($){if($.port===(WQ($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[I,U]=$.resourceName.split("?");$.path=I&&I!=="/"?I:void 0,$.query=U,$.resourceName=void 0}return $.fragment=void 0,$}function aT($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(iT);if(U){let b=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let w=`${b}:${I.nid||$.nid}`,X=QQ(w);if($.path=void 0,X)$=X.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function eT($,I){if($.nid===void 0)throw new Error("URN without nid cannot be serialized");let U=I.scheme||$.scheme||"urn",b=$.nid.toLowerCase(),w=`${U}:${I.nid||b}`,X=QQ(w);if(X)$=X.serialize($,I);let D=$,W=$.nss;return D.path=`${b||I.nid}:${W}`,I.skipEscape=!0,D}function sT($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!nT(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function $_($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var QL={scheme:"http",domainHost:!0,parse:DL,serialize:WL},I_={scheme:"https",domainHost:QL.domainHost,parse:DL,serialize:WL},Ob={scheme:"ws",domainHost:!0,parse:pT,serialize:tT},U_={scheme:"wss",domainHost:Ob.domainHost,parse:Ob.parse,serialize:Ob.serialize},w_={scheme:"urn",parse:aT,serialize:eT,skipNormalize:!0},b_={scheme:"urn:uuid",parse:sT,serialize:$_,skipNormalize:!0},zb={http:QL,https:I_,ws:Ob,wss:U_,urn:w_,"urn:uuid":b_};Object.setPrototypeOf(zb,null);function QQ($){return $&&(zb[$]||zb[$.toLowerCase()])||void 0}GL.exports={wsIsSecure:WQ,SCHEMES:zb,isValidSchemeName:dT,getSchemeHandler:QQ}});var JL=Z((mi,Kb)=>{var{normalizeIPv6:X_,removeDotSegments:vU,recomposeAuthority:D_,normalizeComponentEncoding:Lb,isIPv4:W_,nonSimpleDomain:Q_}=DQ(),{SCHEMES:G_,getSchemeHandler:YL}=NL();function N_($,I){if(typeof $==="string")$=f6(I4($,I),I);else if(typeof $==="object")$=I4(f6($,I),I);return $}function Y_($,I,U){let b=U?Object.assign({scheme:"null"},U):{scheme:"null"},w=BL(I4($,b),I4(I,b),b,!0);return b.skipEscape=!0,f6(w,b)}function BL($,I,U,b){let w={};if(!b)$=I4(f6($,U),U),I=I4(f6(I,U),U);if(U=U||{},!U.tolerant&&I.scheme)w.scheme=I.scheme,w.userinfo=I.userinfo,w.host=I.host,w.port=I.port,w.path=vU(I.path||""),w.query=I.query;else{if(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)w.userinfo=I.userinfo,w.host=I.host,w.port=I.port,w.path=vU(I.path||""),w.query=I.query;else{if(!I.path)if(w.path=$.path,I.query!==void 0)w.query=I.query;else w.query=$.query;else{if(I.path[0]==="/")w.path=vU(I.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)w.path="/"+I.path;else if(!$.path)w.path=I.path;else w.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+I.path;w.path=vU(w.path)}w.query=I.query}w.userinfo=$.userinfo,w.host=$.host,w.port=$.port}w.scheme=$.scheme}return w.fragment=I.fragment,w}function B_($,I,U){if(typeof $==="string")$=unescape($),$=f6(Lb(I4($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=f6(Lb($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=f6(Lb(I4(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=f6(Lb(I,!0),{...U,skipEscape:!0});return $.toLowerCase()===I.toLowerCase()}function f6($,I){let U={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},b=Object.assign({},I),w=[],X=YL(b.scheme||U.scheme);if(X&&X.serialize)X.serialize(U,b);if(U.path!==void 0)if(!b.skipEscape){if(U.path=escape(U.path),U.scheme!==void 0)U.path=U.path.split("%3A").join(":")}else U.path=unescape(U.path);if(b.reference!=="suffix"&&U.scheme)w.push(U.scheme,":");let D=D_(U);if(D!==void 0){if(b.reference!=="suffix")w.push("//");if(w.push(D),U.path&&U.path[0]!=="/")w.push("/")}if(U.path!==void 0){let W=U.path;if(!b.absolutePath&&(!X||!X.absolutePath))W=vU(W);if(D===void 0&&W[0]==="/"&&W[1]==="/")W="/%2F"+W.slice(2);w.push(W)}if(U.query!==void 0)w.push("?",U.query);if(U.fragment!==void 0)w.push("#",U.fragment);return w.join("")}var J_=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I4($,I){let U=Object.assign({},I),b={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},w=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let X=$.match(J_);if(X){if(b.scheme=X[1],b.userinfo=X[3],b.host=X[4],b.port=parseInt(X[5],10),b.path=X[6]||"",b.query=X[7],b.fragment=X[8],isNaN(b.port))b.port=X[5];if(b.host)if(W_(b.host)===!1){let Q=X_(b.host);b.host=Q.host.toLowerCase(),w=Q.isIPV6}else w=!0;if(b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&b.query===void 0&&!b.path)b.reference="same-document";else if(b.scheme===void 0)b.reference="relative";else if(b.fragment===void 0)b.reference="absolute";else b.reference="uri";if(U.reference&&U.reference!=="suffix"&&U.reference!==b.reference)b.error=b.error||"URI is not a "+U.reference+" reference.";let D=YL(U.scheme||b.scheme);if(!U.unicodeSupport&&(!D||!D.unicodeSupport)){if(b.host&&(U.domainHost||D&&D.domainHost)&&w===!1&&Q_(b.host))try{b.host=URL.domainToASCII(b.host.toLowerCase())}catch(W){b.error=b.error||"Host's domain name can not be converted to ASCII: "+W}}if(!D||D&&!D.skipNormalize){if($.indexOf("%")!==-1){if(b.scheme!==void 0)b.scheme=unescape(b.scheme);if(b.host!==void 0)b.host=unescape(b.host)}if(b.path)b.path=escape(unescape(b.path));if(b.fragment)b.fragment=encodeURI(decodeURIComponent(b.fragment))}if(D&&D.parse)D.parse(b,U)}else b.error=b.error||"URI can not be parsed.";return b}var GQ={SCHEMES:G_,normalize:N_,resolve:Y_,resolveComponent:BL,equal:B_,serialize:f6,parse:I4};Kb.exports=GQ;Kb.exports.default=GQ;Kb.exports.fastUri=GQ});var OL=Z((AL)=>{Object.defineProperty(AL,"__esModule",{value:!0});var HL=JL();HL.code='require("ajv/dist/runtime/uri").default';AL.default=HL});var ML=Z((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.CodeGen=U4.Name=U4.nil=U4.stringify=U4.str=U4._=U4.KeywordCxt=void 0;var A_=zU();Object.defineProperty(U4,"KeywordCxt",{enumerable:!0,get:function(){return A_.KeywordCxt}});var Z1=a();Object.defineProperty(U4,"_",{enumerable:!0,get:function(){return Z1._}});Object.defineProperty(U4,"str",{enumerable:!0,get:function(){return Z1.str}});Object.defineProperty(U4,"stringify",{enumerable:!0,get:function(){return Z1.stringify}});Object.defineProperty(U4,"nil",{enumerable:!0,get:function(){return Z1.nil}});Object.defineProperty(U4,"Name",{enumerable:!0,get:function(){return Z1.Name}});Object.defineProperty(U4,"CodeGen",{enumerable:!0,get:function(){return Z1.CodeGen}});var O_=Jb(),VL=LU(),z_=c8(),VU=Ab(),L_=a(),qU=HU(),vb=JU(),YQ=W$(),zL=IL(),K_=OL(),qL=($,I)=>new RegExp($,I);qL.code="new RegExp";var v_=["removeAdditional","useDefaults","coerceTypes"],V_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),q_={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."},F_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},LL=200;function M_($){var I,U,b,w,X,D,W,Q,G,N,B,H,J,A,O,V,q,k,P,x,l,l$,Y6,B1,uD;let jI=$.strict,lD=(I=$.code)===null||I===void 0?void 0:I.optimize,AH=lD===!0||lD===void 0?1:lD||0,OH=(b=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&b!==void 0?b:qL,gM=(w=$.uriResolver)!==null&&w!==void 0?w:K_.default;return{strictSchema:(D=(X=$.strictSchema)!==null&&X!==void 0?X:jI)!==null&&D!==void 0?D:!0,strictNumbers:(Q=(W=$.strictNumbers)!==null&&W!==void 0?W:jI)!==null&&Q!==void 0?Q:!0,strictTypes:(N=(G=$.strictTypes)!==null&&G!==void 0?G:jI)!==null&&N!==void 0?N:"log",strictTuples:(H=(B=$.strictTuples)!==null&&B!==void 0?B:jI)!==null&&H!==void 0?H:"log",strictRequired:(A=(J=$.strictRequired)!==null&&J!==void 0?J:jI)!==null&&A!==void 0?A:!1,code:$.code?{...$.code,optimize:AH,regExp:OH}:{optimize:AH,regExp:OH},loopRequired:(O=$.loopRequired)!==null&&O!==void 0?O:LL,loopEnum:(V=$.loopEnum)!==null&&V!==void 0?V:LL,meta:(q=$.meta)!==null&&q!==void 0?q:!0,messages:(k=$.messages)!==null&&k!==void 0?k:!0,inlineRefs:(P=$.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(x=$.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(l=$.addUsedSchema)!==null&&l!==void 0?l:!0,validateSchema:(l$=$.validateSchema)!==null&&l$!==void 0?l$:!0,validateFormats:(Y6=$.validateFormats)!==null&&Y6!==void 0?Y6:!0,unicodeRegExp:(B1=$.unicodeRegExp)!==null&&B1!==void 0?B1:!0,int32range:(uD=$.int32range)!==null&&uD!==void 0?uD:!0,uriResolver:gM}}class Vb{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...M_($)};let{es5:I,lines:U}=this.opts.code;this.scope=new L_.ValueScope({scope:{},prefixes:V_,es5:I,lines:U}),this.logger=R_($.logger);let b=$.validateFormats;if($.validateFormats=!1,this.RULES=z_.getRules(),KL.call(this,q_,$,"NOT SUPPORTED"),KL.call(this,F_,$,"DEPRECATED","warn"),this._metaOpts=P_.call(this),$.formats)E_.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)S_.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);j_.call(this),$.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,b=zL;if(U==="id")b={...zL},b.id=b.$id,delete b.$id;if(I&&$)this.addMetaSchema(b,b[U],!1)}defaultMeta(){let{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let U;if(typeof $=="string"){if(U=this.getSchema($),!U)throw new Error(`no schema with key or ref "${$}"`)}else U=this.compile($);let b=U(I);if(!("$async"in U))this.errors=U.errors;return b}compile($,I){let U=this._addSchema($,I);return U.validate||this._compileSchemaEnv(U)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:U}=this.opts;return b.call(this,$,I);async function b(G,N){await w.call(this,G.$schema);let B=this._addSchema(G,N);return B.validate||X.call(this,B)}async function w(G){if(G&&!this.getSchema(G))await b.call(this,{$ref:G},!0)}async function X(G){try{return this._compileSchemaEnv(G)}catch(N){if(!(N instanceof VL.default))throw N;return D.call(this,N),await W.call(this,N.missingSchema),X.call(this,G)}}function D({missingSchema:G,missingRef:N}){if(this.refs[G])throw new Error(`AnySchema ${G} is loaded but ${N} cannot be resolved`)}async function W(G){let N=await Q.call(this,G);if(!this.refs[G])await w.call(this,N.$schema);if(!this.refs[G])this.addSchema(N,G,I)}async function Q(G){let N=this._loading[G];if(N)return N;try{return await(this._loading[G]=U(G))}finally{delete this._loading[G]}}}addSchema($,I,U,b=this.opts.validateSchema){if(Array.isArray($)){for(let X of $)this.addSchema(X,void 0,U,b);return this}let w;if(typeof $==="object"){let{schemaId:X}=this.opts;if(w=$[X],w!==void 0&&typeof w!="string")throw new Error(`schema ${X} must be string`)}return I=qU.normalizeId(I||w),this._checkUnique(I),this.schemas[I]=this._addSchema($,U,I,b,!0),this}addMetaSchema($,I,U=this.opts.validateSchema){return this.addSchema($,I,!0,U),this}validateSchema($,I){if(typeof $=="boolean")return!0;let U;if(U=$.$schema,U!==void 0&&typeof U!="string")throw new Error("$schema must be a string");if(U=U||this.opts.defaultMeta||this.defaultMeta(),!U)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let b=this.validate(U,$);if(!b&&I){let w="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(w);else throw new Error(w)}return b}getSchema($){let I;while(typeof(I=vL.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,b=new VU.SchemaEnv({schema:{},schemaId:U});if(I=VU.resolveSchema.call(this,b,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let I=vL.call(this,$);if(typeof I=="object")this._cache.delete(I.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let I=$;this._cache.delete(I);let U=$[this.opts.schemaId];if(U)U=qU.normalizeId(U),delete this.schemas[U],delete this.refs[U];return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let I of $)this.addKeyword(I);return this}addKeyword($,I){let U;if(typeof $=="string"){if(U=$,typeof I=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=U}else if(typeof $=="object"&&I===void 0){if(I=$,U=I.keyword,Array.isArray(U)&&!U.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(__.call(this,U,I),!I)return YQ.eachItem(U,(w)=>NQ.call(this,w)),this;C_.call(this,I);let b={...I,type:vb.getJSONTypes(I.type),schemaType:vb.getJSONTypes(I.schemaType)};return YQ.eachItem(U,b.type.length===0?(w)=>NQ.call(this,w,b):(w)=>b.type.forEach((X)=>NQ.call(this,w,b,X))),this}getKeyword($){let I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){let{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(let U of I.rules){let b=U.rules.findIndex((w)=>w.keyword===$);if(b>=0)U.rules.splice(b,1)}return this}addFormat($,I){if(typeof I=="string")I=new RegExp(I);return this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:U="data"}={}){if(!$||$.length===0)return"No errors";return $.map((b)=>`${U}${b.instancePath} ${b.message}`).reduce((b,w)=>b+I+w)}$dataMetaSchema($,I){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let b of I){let w=b.split("/").slice(1),X=$;for(let D of w)X=X[D];for(let D in U){let W=U[D];if(typeof W!="object")continue;let{$data:Q}=W.definition,G=X[D];if(Q&&G)X[D]=FL(G)}}return $}_removeAllSchemas($,I){for(let U in $){let b=$[U];if(!I||I.test(U)){if(typeof b=="string")delete $[U];else if(b&&!b.meta)this._cache.delete(b.schema),delete $[U]}}}_addSchema($,I,U,b=this.opts.validateSchema,w=this.opts.addUsedSchema){let X,{schemaId:D}=this.opts;if(typeof $=="object")X=$[D];else if(this.opts.jtd)throw new Error("schema must be object");else if(typeof $!="boolean")throw new Error("schema must be object or boolean");let W=this._cache.get($);if(W!==void 0)return W;U=qU.normalizeId(X||U);let Q=qU.getSchemaRefs.call(this,$,U);if(W=new VU.SchemaEnv({schema:$,schemaId:D,meta:I,baseId:U,localRefs:Q}),this._cache.set(W.schema,W),w&&!U.startsWith("#")){if(U)this._checkUnique(U);this.refs[U]=W}if(b)this.validateSchema($,!0);return W}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else VU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{VU.compileSchema.call(this,$)}finally{this.opts=I}}}Vb.ValidationError=O_.default;Vb.MissingRefError=VL.default;U4.default=Vb;function KL($,I,U,b="error"){for(let w in $){let X=w;if(X in I)this.logger[b](`${U}: option ${w}. ${$[X]}`)}}function vL($){return $=qU.normalizeId($),this.schemas[$]||this.refs[$]}function j_(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function E_(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function S_($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let I in $){let U=$[I];if(!U.keyword)U.keyword=I;this.addKeyword(U)}}function P_(){let $={...this.opts};for(let I of v_)delete $[I];return $}var k_={log(){},warn(){},error(){}};function R_($){if($===!1)return k_;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var T_=/^[a-z_$][a-z0-9_$:-]*$/i;function __($,I){let{RULES:U}=this;if(YQ.eachItem($,(b)=>{if(U.keywords[b])throw new Error(`Keyword ${b} is already defined`);if(!T_.test(b))throw new Error(`Keyword ${b} has invalid name`)}),!I)return;if(I.$data&&!(("code"in I)||("validate"in I)))throw new Error('$data keyword must have "code" or "validate" function')}function NQ($,I,U){var b;let w=I===null||I===void 0?void 0:I.post;if(U&&w)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:X}=this,D=w?X.post:X.rules.find(({type:Q})=>Q===U);if(!D)D={type:U,rules:[]},X.rules.push(D);if(X.keywords[$]=!0,!I)return;let W={keyword:$,definition:{...I,type:vb.getJSONTypes(I.type),schemaType:vb.getJSONTypes(I.schemaType)}};if(I.before)Z_.call(this,D,W,I.before);else D.rules.push(W);X.all[$]=W,(b=I.implements)===null||b===void 0||b.forEach((Q)=>this.addKeyword(Q))}function Z_($,I,U){let b=$.rules.findIndex((w)=>w.keyword===U);if(b>=0)$.rules.splice(b,0,I);else $.rules.push(I),this.logger.warn(`rule ${U} is not defined`)}function C_($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=FL(I);$.validateSchema=this.compile(I,!0)}var g_={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function FL($){return{anyOf:[$,g_]}}});var EL=Z((jL)=>{Object.defineProperty(jL,"__esModule",{value:!0});var f_={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};jL.default=f_});var _L=Z((RL)=>{Object.defineProperty(RL,"__esModule",{value:!0});RL.callRef=RL.getValidate=void 0;var u_=LU(),SL=O6(),$6=a(),C1=s6(),PL=Ab(),qb=W$(),l_={keyword:"$ref",schemaType:"string",code($){let{gen:I,schema:U,it:b}=$,{baseId:w,schemaEnv:X,validateName:D,opts:W,self:Q}=b,{root:G}=X;if((U==="#"||U==="#/")&&w===G.baseId)return B();let N=PL.resolveRef.call(Q,G,w,U);if(N===void 0)throw new u_.default(b.opts.uriResolver,w,U);if(N instanceof PL.SchemaEnv)return H(N);return J(N);function B(){if(X===G)return Fb($,D,X,X.$async);let A=I.scopeValue("root",{ref:G});return Fb($,$6._`${A}.validate`,G,G.$async)}function H(A){let O=kL($,A);Fb($,O,A,A.$async)}function J(A){let O=I.scopeValue("schema",W.code.source===!0?{ref:A,code:$6.stringify(A)}:{ref:A}),V=I.name("valid"),q=$.subschema({schema:A,dataTypes:[],schemaPath:$6.nil,topSchemaRef:O,errSchemaPath:U},V);$.mergeEvaluated(q),$.ok(V)}}};function kL($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):$6._`${U.scopeValue("wrapper",{ref:I})}.validate`}RL.getValidate=kL;function Fb($,I,U,b){let{gen:w,it:X}=$,{allErrors:D,schemaEnv:W,opts:Q}=X,G=Q.passContext?C1.default.this:$6.nil;if(b)N();else B();function N(){if(!W.$async)throw new Error("async schema referenced by sync schema");let A=w.let("valid");w.try(()=>{if(w.code($6._`await ${SL.callValidateCode($,I,G)}`),J(I),!D)w.assign(A,!0)},(O)=>{if(w.if($6._`!(${O} instanceof ${X.ValidationError})`,()=>w.throw(O)),H(O),!D)w.assign(A,!1)}),$.ok(A)}function B(){$.result(SL.callValidateCode($,I,G),()=>J(I),()=>H(I))}function H(A){let O=$6._`${A}.errors`;w.assign(C1.default.vErrors,$6._`${C1.default.vErrors} === null ? ${O} : ${C1.default.vErrors}.concat(${O})`),w.assign(C1.default.errors,$6._`${C1.default.vErrors}.length`)}function J(A){var O;if(!X.opts.unevaluated)return;let V=(O=U===null||U===void 0?void 0:U.validate)===null||O===void 0?void 0:O.evaluated;if(X.props!==!0)if(V&&!V.dynamicProps){if(V.props!==void 0)X.props=qb.mergeEvaluated.props(w,V.props,X.props)}else{let q=w.var("props",$6._`${A}.evaluated.props`);X.props=qb.mergeEvaluated.props(w,q,X.props,$6.Name)}if(X.items!==!0)if(V&&!V.dynamicItems){if(V.items!==void 0)X.items=qb.mergeEvaluated.items(w,V.items,X.items)}else{let q=w.var("items",$6._`${A}.evaluated.items`);X.items=qb.mergeEvaluated.items(w,q,X.items,$6.Name)}}}RL.callRef=Fb;RL.default=l_});var CL=Z((ZL)=>{Object.defineProperty(ZL,"__esModule",{value:!0});var r_=EL(),n_=_L(),i_=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r_.default,n_.default];ZL.default=i_});var xL=Z((gL)=>{Object.defineProperty(gL,"__esModule",{value:!0});var Mb=a(),V4=Mb.operators,jb={maximum:{okStr:"<=",ok:V4.LTE,fail:V4.GT},minimum:{okStr:">=",ok:V4.GTE,fail:V4.LT},exclusiveMaximum:{okStr:"<",ok:V4.LT,fail:V4.GTE},exclusiveMinimum:{okStr:">",ok:V4.GT,fail:V4.LTE}},d_={message:({keyword:$,schemaCode:I})=>Mb.str`must be ${jb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>Mb._`{comparison: ${jb[$].okStr}, limit: ${I}}`},p_={keyword:Object.keys(jb),type:"number",schemaType:"number",$data:!0,error:d_,code($){let{keyword:I,data:U,schemaCode:b}=$;$.fail$data(Mb._`${U} ${jb[I].fail} ${b} || isNaN(${U})`)}};gL.default=p_});var fL=Z((hL)=>{Object.defineProperty(hL,"__esModule",{value:!0});var FU=a(),a_={message:({schemaCode:$})=>FU.str`must be multiple of ${$}`,params:({schemaCode:$})=>FU._`{multipleOf: ${$}}`},e_={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:a_,code($){let{gen:I,data:U,schemaCode:b,it:w}=$,X=w.opts.multipleOfPrecision,D=I.let("res"),W=X?FU._`Math.abs(Math.round(${D}) - ${D}) > 1e-${X}`:FU._`${D} !== parseInt(${D})`;$.fail$data(FU._`(${b} === 0 || (${D} = ${U}/${b}, ${W}))`)}};hL.default=e_});var lL=Z((uL)=>{Object.defineProperty(uL,"__esModule",{value:!0});function yL($){let I=$.length,U=0,b=0,w;while(b<I)if(U++,w=$.charCodeAt(b++),w>=55296&&w<=56319&&b<I){if(w=$.charCodeAt(b),(w&64512)===56320)b++}return U}uL.default=yL;yL.code='require("ajv/dist/runtime/ucs2length").default'});var mL=Z((cL)=>{Object.defineProperty(cL,"__esModule",{value:!0});var e4=a(),IZ=W$(),UZ=lL(),wZ={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return e4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>e4._`{limit: ${$}}`},bZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wZ,code($){let{keyword:I,data:U,schemaCode:b,it:w}=$,X=I==="maxLength"?e4.operators.GT:e4.operators.LT,D=w.opts.unicode===!1?e4._`${U}.length`:e4._`${IZ.useFunc($.gen,UZ.default)}(${U})`;$.fail$data(e4._`${D} ${X} ${b}`)}};cL.default=bZ});var nL=Z((rL)=>{Object.defineProperty(rL,"__esModule",{value:!0});var DZ=O6(),Eb=a(),WZ={message:({schemaCode:$})=>Eb.str`must match pattern "${$}"`,params:({schemaCode:$})=>Eb._`{pattern: ${$}}`},QZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:WZ,code($){let{data:I,$data:U,schema:b,schemaCode:w,it:X}=$,D=X.opts.unicodeRegExp?"u":"",W=U?Eb._`(new RegExp(${w}, ${D}))`:DZ.usePattern($,b);$.fail$data(Eb._`!${W}.test(${I})`)}};rL.default=QZ});var oL=Z((iL)=>{Object.defineProperty(iL,"__esModule",{value:!0});var MU=a(),NZ={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return MU.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>MU._`{limit: ${$}}`},YZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:NZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxProperties"?MU.operators.GT:MU.operators.LT;$.fail$data(MU._`Object.keys(${U}).length ${w} ${b}`)}};iL.default=YZ});var pL=Z((dL)=>{Object.defineProperty(dL,"__esModule",{value:!0});var jU=O6(),EU=a(),JZ=W$(),HZ={message:({params:{missingProperty:$}})=>EU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>EU._`{missingProperty: ${$}}`},AZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:HZ,code($){let{gen:I,schema:U,schemaCode:b,data:w,$data:X,it:D}=$,{opts:W}=D;if(!X&&U.length===0)return;let Q=U.length>=W.loopRequired;if(D.allErrors)G();else N();if(W.strictRequired){let J=$.parentSchema.properties,{definedProperties:A}=$.it;for(let O of U)if((J===null||J===void 0?void 0:J[O])===void 0&&!A.has(O)){let V=D.schemaEnv.baseId+D.errSchemaPath,q=`required property "${O}" is not defined at "${V}" (strictRequired)`;JZ.checkStrictMode(D,q,D.opts.strictRequired)}}function G(){if(Q||X)$.block$data(EU.nil,B);else for(let J of U)jU.checkReportMissingProp($,J)}function N(){let J=I.let("missing");if(Q||X){let A=I.let("valid",!0);$.block$data(A,()=>H(J,A)),$.ok(A)}else I.if(jU.checkMissingProp($,U,J)),jU.reportMissingProp($,J),I.else()}function B(){I.forOf("prop",b,(J)=>{$.setParams({missingProperty:J}),I.if(jU.noPropertyInData(I,w,J,W.ownProperties),()=>$.error())})}function H(J,A){$.setParams({missingProperty:J}),I.forOf(J,b,()=>{I.assign(A,jU.propertyInData(I,w,J,W.ownProperties)),I.if(EU.not(A),()=>{$.error(),I.break()})},EU.nil)}}};dL.default=AZ});var aL=Z((tL)=>{Object.defineProperty(tL,"__esModule",{value:!0});var SU=a(),zZ={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return SU.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>SU._`{limit: ${$}}`},LZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:zZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxItems"?SU.operators.GT:SU.operators.LT;$.fail$data(SU._`${U}.length ${w} ${b}`)}};tL.default=LZ});var Sb=Z((sL)=>{Object.defineProperty(sL,"__esModule",{value:!0});var eL=t8();eL.code='require("ajv/dist/runtime/equal").default';sL.default=eL});var IK=Z(($K)=>{Object.defineProperty($K,"__esModule",{value:!0});var BQ=JU(),h$=a(),VZ=W$(),qZ=Sb(),FZ={message:({params:{i:$,j:I}})=>h$.str`must NOT have duplicate items (items ## ${I} and ${$} are identical)`,params:({params:{i:$,j:I}})=>h$._`{i: ${$}, j: ${I}}`},MZ={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:FZ,code($){let{gen:I,data:U,$data:b,schema:w,parentSchema:X,schemaCode:D,it:W}=$;if(!b&&!w)return;let Q=I.let("valid"),G=X.items?BQ.getSchemaTypes(X.items):[];$.block$data(Q,N,h$._`${D} === false`),$.ok(Q);function N(){let A=I.let("i",h$._`${U}.length`),O=I.let("j");$.setParams({i:A,j:O}),I.assign(Q,!0),I.if(h$._`${A} > 1`,()=>(B()?H:J)(A,O))}function B(){return G.length>0&&!G.some((A)=>A==="object"||A==="array")}function H(A,O){let V=I.name("item"),q=BQ.checkDataTypes(G,V,W.opts.strictNumbers,BQ.DataType.Wrong),k=I.const("indices",h$._`{}`);I.for(h$._`;${A}--;`,()=>{if(I.let(V,h$._`${U}[${A}]`),I.if(q,h$._`continue`),G.length>1)I.if(h$._`typeof ${V} == "string"`,h$._`${V} += "_"`);I.if(h$._`typeof ${k}[${V}] == "number"`,()=>{I.assign(O,h$._`${k}[${V}]`),$.error(),I.assign(Q,!1).break()}).code(h$._`${k}[${V}] = ${A}`)})}function J(A,O){let V=VZ.useFunc(I,qZ.default),q=I.name("outer");I.label(q).for(h$._`;${A}--;`,()=>I.for(h$._`${O} = ${A}; ${O}--;`,()=>I.if(h$._`${V}(${U}[${A}], ${U}[${O}])`,()=>{$.error(),I.assign(Q,!1).break(q)})))}}};$K.default=MZ});var wK=Z((UK)=>{Object.defineProperty(UK,"__esModule",{value:!0});var JQ=a(),EZ=W$(),SZ=Sb(),PZ={message:"must be equal to constant",params:({schemaCode:$})=>JQ._`{allowedValue: ${$}}`},kZ={keyword:"const",$data:!0,error:PZ,code($){let{gen:I,data:U,$data:b,schemaCode:w,schema:X}=$;if(b||X&&typeof X=="object")$.fail$data(JQ._`!${EZ.useFunc(I,SZ.default)}(${U}, ${w})`);else $.fail(JQ._`${X} !== ${U}`)}};UK.default=kZ});var XK=Z((bK)=>{Object.defineProperty(bK,"__esModule",{value:!0});var PU=a(),TZ=W$(),_Z=Sb(),ZZ={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>PU._`{allowedValues: ${$}}`},CZ={keyword:"enum",schemaType:"array",$data:!0,error:ZZ,code($){let{gen:I,data:U,$data:b,schema:w,schemaCode:X,it:D}=$;if(!b&&w.length===0)throw new Error("enum must have non-empty array");let W=w.length>=D.opts.loopEnum,Q,G=()=>Q!==null&&Q!==void 0?Q:Q=TZ.useFunc(I,_Z.default),N;if(W||b)N=I.let("valid"),$.block$data(N,B);else{if(!Array.isArray(w))throw new Error("ajv implementation error");let J=I.const("vSchema",X);N=PU.or(...w.map((A,O)=>H(J,O)))}$.pass(N);function B(){I.assign(N,!1),I.forOf("v",X,(J)=>I.if(PU._`${G()}(${U}, ${J})`,()=>I.assign(N,!0).break()))}function H(J,A){let O=w[A];return typeof O==="object"&&O!==null?PU._`${G()}(${U}, ${J}[${A}])`:PU._`${U} === ${O}`}}};bK.default=CZ});var WK=Z((DK)=>{Object.defineProperty(DK,"__esModule",{value:!0});var xZ=xL(),hZ=fL(),fZ=mL(),yZ=nL(),uZ=oL(),lZ=pL(),cZ=aL(),mZ=IK(),rZ=wK(),nZ=XK(),iZ=[xZ.default,hZ.default,fZ.default,yZ.default,uZ.default,lZ.default,cZ.default,mZ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},rZ.default,nZ.default];DK.default=iZ});var AQ=Z((GK)=>{Object.defineProperty(GK,"__esModule",{value:!0});GK.validateAdditionalItems=void 0;var s4=a(),HQ=W$(),dZ={message:({params:{len:$}})=>s4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>s4._`{limit: ${$}}`},pZ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:dZ,code($){let{parentSchema:I,it:U}=$,{items:b}=I;if(!Array.isArray(b)){HQ.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}QK($,b)}};function QK($,I){let{gen:U,schema:b,data:w,keyword:X,it:D}=$;D.items=!0;let W=U.const("len",s4._`${w}.length`);if(b===!1)$.setParams({len:I.length}),$.pass(s4._`${W} <= ${I.length}`);else if(typeof b=="object"&&!HQ.alwaysValidSchema(D,b)){let G=U.var("valid",s4._`${W} <= ${I.length}`);U.if(s4.not(G),()=>Q(G)),$.ok(G)}function Q(G){U.forRange("i",I.length,W,(N)=>{if($.subschema({keyword:X,dataProp:N,dataPropType:HQ.Type.Num},G),!D.allErrors)U.if(s4.not(G),()=>U.break())})}}GK.validateAdditionalItems=QK;GK.default=pZ});var OQ=Z((JK)=>{Object.defineProperty(JK,"__esModule",{value:!0});JK.validateTuple=void 0;var YK=a(),Pb=W$(),aZ=O6(),eZ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return BK($,"additionalItems",I);if(U.items=!0,Pb.alwaysValidSchema(U,I))return;$.ok(aZ.validateArray($))}};function BK($,I,U=$.schema){let{gen:b,parentSchema:w,data:X,keyword:D,it:W}=$;if(N(w),W.opts.unevaluated&&U.length&&W.items!==!0)W.items=Pb.mergeEvaluated.items(b,U.length,W.items);let Q=b.name("valid"),G=b.const("len",YK._`${X}.length`);U.forEach((B,H)=>{if(Pb.alwaysValidSchema(W,B))return;b.if(YK._`${G} > ${H}`,()=>$.subschema({keyword:D,schemaProp:H,dataProp:H},Q)),$.ok(Q)});function N(B){let{opts:H,errSchemaPath:J}=W,A=U.length,O=A===B.minItems&&(A===B.maxItems||B[I]===!1);if(H.strictTuples&&!O){let V=`"${D}" is ${A}-tuple, but minItems or maxItems/${I} are not specified or different at path "${J}"`;Pb.checkStrictMode(W,V,H.strictTuples)}}}JK.validateTuple=BK;JK.default=eZ});var OK=Z((AK)=>{Object.defineProperty(AK,"__esModule",{value:!0});var $C=OQ(),IC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>$C.validateTuple($,"items")};AK.default=IC});var KK=Z((LK)=>{Object.defineProperty(LK,"__esModule",{value:!0});var zK=a(),wC=W$(),bC=O6(),XC=AQ(),DC={message:({params:{len:$}})=>zK.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>zK._`{limit: ${$}}`},WC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:DC,code($){let{schema:I,parentSchema:U,it:b}=$,{prefixItems:w}=U;if(b.items=!0,wC.alwaysValidSchema(b,I))return;if(w)XC.validateAdditionalItems($,w);else $.ok(bC.validateArray($))}};LK.default=WC});var VK=Z((vK)=>{Object.defineProperty(vK,"__esModule",{value:!0});var z6=a(),kb=W$(),GC={message:({params:{min:$,max:I}})=>I===void 0?z6.str`must contain at least ${$} valid item(s)`:z6.str`must contain at least ${$} and no more than ${I} valid item(s)`,params:({params:{min:$,max:I}})=>I===void 0?z6._`{minContains: ${$}}`:z6._`{minContains: ${$}, maxContains: ${I}}`},NC={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:GC,code($){let{gen:I,schema:U,parentSchema:b,data:w,it:X}=$,D,W,{minContains:Q,maxContains:G}=b;if(X.opts.next)D=Q===void 0?1:Q,W=G;else D=1;let N=I.const("len",z6._`${w}.length`);if($.setParams({min:D,max:W}),W===void 0&&D===0){kb.checkStrictMode(X,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(W!==void 0&&D>W){kb.checkStrictMode(X,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(kb.alwaysValidSchema(X,U)){let O=z6._`${N} >= ${D}`;if(W!==void 0)O=z6._`${O} && ${N} <= ${W}`;$.pass(O);return}X.items=!0;let B=I.name("valid");if(W===void 0&&D===1)J(B,()=>I.if(B,()=>I.break()));else if(D===0){if(I.let(B,!0),W!==void 0)I.if(z6._`${w}.length > 0`,H)}else I.let(B,!1),H();$.result(B,()=>$.reset());function H(){let O=I.name("_valid"),V=I.let("count",0);J(O,()=>I.if(O,()=>A(V)))}function J(O,V){I.forRange("i",0,N,(q)=>{$.subschema({keyword:"contains",dataProp:q,dataPropType:kb.Type.Num,compositeRule:!0},O),V()})}function A(O){if(I.code(z6._`${O}++`),W===void 0)I.if(z6._`${O} >= ${D}`,()=>I.assign(B,!0).break());else if(I.if(z6._`${O} > ${W}`,()=>I.assign(B,!1).break()),D===1)I.assign(B,!0);else I.if(z6._`${O} >= ${D}`,()=>I.assign(B,!0))}}};vK.default=NC});var SK=Z((MK)=>{Object.defineProperty(MK,"__esModule",{value:!0});MK.validateSchemaDeps=MK.validatePropertyDeps=MK.error=void 0;var zQ=a(),BC=W$(),kU=O6();MK.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let b=I===1?"property":"properties";return zQ.str`must have ${b} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:b}})=>zQ._`{property: ${$},
6
+ || ${D} === "boolean" || ${w} === null`).assign(W,p._`[${w}]`)}}}function lR({gen:$,parentData:I,parentDataProperty:U},b){$.if(p._`${I} !== undefined`,()=>$.assign(p._`${I}[${U}]`,b))}function r8($,I,U,b=R1.Correct){let w=b===R1.Correct?p.operators.EQ:p.operators.NEQ,X;switch($){case"null":return p._`${I} ${w} null`;case"array":X=p._`Array.isArray(${I})`;break;case"object":X=p._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":X=D(p._`!(${I} % 1) && !isNaN(${I})`);break;case"number":X=D();break;default:return p._`typeof ${I} ${w} ${$}`}return b===R1.Correct?X:p.not(X);function D(W=p.nil){return p.and(p._`typeof ${I} == "number"`,W,U?p._`isFinite(${I})`:p.nil)}}X3.checkDataType=r8;function n8($,I,U,b){if($.length===1)return r8($[0],I,U,b);let w,X=U3.toHash($);if(X.array&&X.object){let D=p._`typeof ${I} != "object"`;w=X.null?D:p._`!${I} || ${D}`,delete X.null,delete X.array,delete X.object}else w=p.nil;if(X.number)delete X.integer;for(let D in X)w=p.and(w,r8(D,I,U,b));return w}X3.checkDataTypes=n8;var cR={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?p._`{type: ${$}}`:p._`{type: ${I}}`};function i8($){let I=mR($);xR.reportError(I,cR)}X3.reportTypeError=i8;function mR($){let{gen:I,data:U,schema:b}=$,w=U3.schemaRefOrVal($,b,"type");return{gen:I,keyword:"type",data:U,schema:b.type,schemaCode:w,schemaValue:w,parentSchema:b,params:{},it:$}}});var N3=Z((Q3)=>{Object.defineProperty(Q3,"__esModule",{value:!0});Q3.assignDefaults=void 0;var T1=a(),tR=W$();function aR($,I){let{properties:U,items:b}=$.schema;if(I==="object"&&U)for(let w in U)W3($,w,U[w].default);else if(I==="array"&&Array.isArray(b))b.forEach((w,X)=>W3($,X,w.default))}Q3.assignDefaults=aR;function W3($,I,U){let{gen:b,compositeRule:w,data:X,opts:D}=$;if(U===void 0)return;let W=T1._`${X}${T1.getProperty(I)}`;if(w){tR.checkStrictMode($,`default is ignored for: ${W}`);return}let Q=T1._`${W} === undefined`;if(D.useDefaults==="empty")Q=T1._`${Q} || ${W} === null || ${W} === ""`;b.if(Q,T1._`${W} = ${T1.stringify(U)}`)}});var O6=Z((J3)=>{Object.defineProperty(J3,"__esModule",{value:!0});J3.validateUnion=J3.validateArray=J3.usePattern=J3.callValidateCode=J3.schemaProperties=J3.allSchemaProperties=J3.noPropertyInData=J3.propertyInData=J3.isOwnProperty=J3.hasPropFunc=J3.reportMissingProp=J3.checkMissingProp=J3.checkReportMissingProp=void 0;var K$=a(),o8=W$(),K4=s6(),eR=W$();function sR($,I){let{gen:U,data:b,it:w}=$;U.if(p8(U,b,I,w.opts.ownProperties),()=>{$.setParams({missingProperty:K$._`${I}`},!0),$.error()})}J3.checkReportMissingProp=sR;function $2({gen:$,data:I,it:{opts:U}},b,w){return K$.or(...b.map((X)=>K$.and(p8($,I,X,U.ownProperties),K$._`${w} = ${X}`)))}J3.checkMissingProp=$2;function I2($,I){$.setParams({missingProperty:I},!0),$.error()}J3.reportMissingProp=I2;function Y3($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:K$._`Object.prototype.hasOwnProperty`})}J3.hasPropFunc=Y3;function d8($,I,U){return K$._`${Y3($)}.call(${I}, ${U})`}J3.isOwnProperty=d8;function U2($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} !== undefined`;return b?K$._`${w} && ${d8($,I,U)}`:w}J3.propertyInData=U2;function p8($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} === undefined`;return b?K$.or(w,K$.not(d8($,I,U))):w}J3.noPropertyInData=p8;function B3($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}J3.allSchemaProperties=B3;function w2($,I){return B3(I).filter((U)=>!o8.alwaysValidSchema($,I[U]))}J3.schemaProperties=w2;function b2({schemaCode:$,data:I,it:{gen:U,topSchemaRef:b,schemaPath:w,errorPath:X},it:D},W,Q,G){let N=G?K$._`${$}, ${I}, ${b}${w}`:I,B=[[K4.default.instancePath,K$.strConcat(K4.default.instancePath,X)],[K4.default.parentData,D.parentData],[K4.default.parentDataProperty,D.parentDataProperty],[K4.default.rootData,K4.default.rootData]];if(D.opts.dynamicRef)B.push([K4.default.dynamicAnchors,K4.default.dynamicAnchors]);let H=K$._`${N}, ${U.object(...B)}`;return Q!==K$.nil?K$._`${W}.call(${Q}, ${H})`:K$._`${W}(${H})`}J3.callValidateCode=b2;var X2=K$._`new RegExp`;function D2({gen:$,it:{opts:I}},U){let b=I.unicodeRegExp?"u":"",{regExp:w}=I.code,X=w(U,b);return $.scopeValue("pattern",{key:X.toString(),ref:X,code:K$._`${w.code==="new RegExp"?X2:eR.useFunc($,w)}(${U}, ${b})`})}J3.usePattern=D2;function W2($){let{gen:I,data:U,keyword:b,it:w}=$,X=I.name("valid");if(w.allErrors){let W=I.let("valid",!0);return D(()=>I.assign(W,!1)),W}return I.var(X,!0),D(()=>I.break()),X;function D(W){let Q=I.const("len",K$._`${U}.length`);I.forRange("i",0,Q,(G)=>{$.subschema({keyword:b,dataProp:G,dataPropType:o8.Type.Num},X),I.if(K$.not(X),W)})}}J3.validateArray=W2;function Q2($){let{gen:I,schema:U,keyword:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((Q)=>o8.alwaysValidSchema(w,Q))&&!w.opts.unevaluated)return;let D=I.let("valid",!1),W=I.name("_valid");I.block(()=>U.forEach((Q,G)=>{let N=$.subschema({keyword:b,schemaProp:G,compositeRule:!0},W);if(I.assign(D,K$._`${D} || ${W}`),!$.mergeValidEvaluated(N,W))I.if(K$.not(D))})),$.result(D,()=>$.reset(),()=>$.error(!0))}J3.validateUnion=Q2});var K3=Z((z3)=>{Object.defineProperty(z3,"__esModule",{value:!0});z3.validateKeywordUsage=z3.validSchemaType=z3.funcKeywordCode=z3.macroKeywordCode=void 0;var i$=a(),t4=s6(),V2=O6(),q2=BU();function F2($,I){let{gen:U,keyword:b,schema:w,parentSchema:X,it:D}=$,W=I.macro.call(D.self,w,X,D),Q=O3(U,b,W);if(D.opts.validateSchema!==!1)D.self.validateSchema(W,!0);let G=U.name("valid");$.subschema({schema:W,schemaPath:i$.nil,errSchemaPath:`${D.errSchemaPath}/${b}`,topSchemaRef:Q,compositeRule:!0},G),$.pass(G,()=>$.error(!0))}z3.macroKeywordCode=F2;function M2($,I){var U;let{gen:b,keyword:w,schema:X,parentSchema:D,$data:W,it:Q}=$;E2(Q,I);let G=!W&&I.compile?I.compile.call(Q.self,X,D,Q):I.validate,N=O3(b,w,G),B=b.let("valid");$.block$data(B,H),$.ok((U=I.valid)!==null&&U!==void 0?U:B);function H(){if(I.errors===!1){if(O(),I.modifying)A3($);V(()=>$.error())}else{let q=I.async?J():A();if(I.modifying)A3($);V(()=>j2($,q))}}function J(){let q=b.let("ruleErrs",null);return b.try(()=>O(i$._`await `),(k)=>b.assign(B,!1).if(i$._`${k} instanceof ${Q.ValidationError}`,()=>b.assign(q,i$._`${k}.errors`),()=>b.throw(k))),q}function A(){let q=i$._`${N}.errors`;return b.assign(q,null),O(i$.nil),q}function O(q=I.async?i$._`await `:i$.nil){let k=Q.opts.passContext?t4.default.this:t4.default.self,P=!(("compile"in I)&&!W||I.schema===!1);b.assign(B,i$._`${q}${V2.callValidateCode($,N,k,P)}`,I.modifying)}function V(q){var k;b.if(i$.not((k=I.valid)!==null&&k!==void 0?k:B),q)}}z3.funcKeywordCode=M2;function A3($){let{gen:I,data:U,it:b}=$;I.if(b.parentData,()=>I.assign(U,i$._`${b.parentData}[${b.parentDataProperty}]`))}function j2($,I){let{gen:U}=$;U.if(i$._`Array.isArray(${I})`,()=>{U.assign(t4.default.vErrors,i$._`${t4.default.vErrors} === null ? ${I} : ${t4.default.vErrors}.concat(${I})`).assign(t4.default.errors,i$._`${t4.default.vErrors}.length`),q2.extendErrors($)},()=>$.error())}function E2({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function O3($,I,U){if(U===void 0)throw new Error(`keyword "${I}" failed to compile`);return $.scopeValue("keyword",typeof U=="function"?{ref:U}:{ref:U,code:i$.stringify(U)})}function S2($,I,U=!1){return!I.length||I.some((b)=>b==="array"?Array.isArray($):b==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==b||U&&typeof $=="undefined")}z3.validSchemaType=S2;function P2({schema:$,opts:I,self:U,errSchemaPath:b},w,X){if(Array.isArray(w.keyword)?!w.keyword.includes(X):w.keyword!==X)throw new Error("ajv implementation error");let D=w.dependencies;if(D===null||D===void 0?void 0:D.some((W)=>!Object.prototype.hasOwnProperty.call($,W)))throw new Error(`parent schema must have dependencies of ${X}: ${D.join(",")}`);if(w.validateSchema){if(!w.validateSchema($[X])){let Q=`keyword "${X}" value is invalid at path "${b}": `+U.errorsText(w.validateSchema.errors);if(I.validateSchema==="log")U.logger.error(Q);else throw new Error(Q)}}}z3.validateKeywordUsage=P2});var F3=Z((V3)=>{Object.defineProperty(V3,"__esModule",{value:!0});V3.extendSubschemaMode=V3.extendSubschemaData=V3.getSubschema=void 0;var h6=a(),v3=W$();function _2($,{keyword:I,schemaProp:U,schema:b,schemaPath:w,errSchemaPath:X,topSchemaRef:D}){if(I!==void 0&&b!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(I!==void 0){let W=$.schema[I];return U===void 0?{schema:W,schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:W[U],schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}${h6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${v3.escapeFragment(U)}`}}if(b!==void 0){if(w===void 0||X===void 0||D===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:b,schemaPath:w,topSchemaRef:D,errSchemaPath:X}}throw new Error('either "keyword" or "schema" must be passed')}V3.getSubschema=_2;function Z2($,I,{dataProp:U,dataPropType:b,data:w,dataTypes:X,propertyName:D}){if(w!==void 0&&U!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:W}=I;if(U!==void 0){let{errorPath:G,dataPathArr:N,opts:B}=I,H=W.let("data",h6._`${I.data}${h6.getProperty(U)}`,!0);Q(H),$.errorPath=h6.str`${G}${v3.getErrorPath(U,b,B.jsPropertySyntax)}`,$.parentDataProperty=h6._`${U}`,$.dataPathArr=[...N,$.parentDataProperty]}if(w!==void 0){let G=w instanceof h6.Name?w:W.let("data",w,!0);if(Q(G),D!==void 0)$.propertyName=D}if(X)$.dataTypes=X;function Q(G){$.data=G,$.dataLevel=I.dataLevel+1,$.dataTypes=[],I.definedProperties=new Set,$.parentData=I.data,$.dataNames=[...I.dataNames,G]}}V3.extendSubschemaData=Z2;function C2($,{jtdDiscriminator:I,jtdMetadata:U,compositeRule:b,createErrors:w,allErrors:X}){if(b!==void 0)$.compositeRule=b;if(w!==void 0)$.createErrors=w;if(X!==void 0)$.allErrors=X;$.jtdDiscriminator=I,$.jtdMetadata=U}V3.extendSubschemaMode=C2});var t8=Z((Ci,M3)=>{M3.exports=function $(I,U){if(I===U)return!0;if(I&&U&&typeof I=="object"&&typeof U=="object"){if(I.constructor!==U.constructor)return!1;var b,w,X;if(Array.isArray(I)){if(b=I.length,b!=U.length)return!1;for(w=b;w--!==0;)if(!$(I[w],U[w]))return!1;return!0}if(I.constructor===RegExp)return I.source===U.source&&I.flags===U.flags;if(I.valueOf!==Object.prototype.valueOf)return I.valueOf()===U.valueOf();if(I.toString!==Object.prototype.toString)return I.toString()===U.toString();if(X=Object.keys(I),b=X.length,b!==Object.keys(U).length)return!1;for(w=b;w--!==0;)if(!Object.prototype.hasOwnProperty.call(U,X[w]))return!1;for(w=b;w--!==0;){var D=X[w];if(!$(I[D],U[D]))return!1}return!0}return I!==I&&U!==U}});var E3=Z((gi,j3)=>{var v4=j3.exports=function($,I,U){if(typeof I=="function")U=I,I={};U=I.cb||U;var b=typeof U=="function"?U:U.pre||function(){},w=U.post||function(){};Yb(I,b,w,$,"",$)};v4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};v4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};v4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};v4.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 Yb($,I,U,b,w,X,D,W,Q,G){if(b&&typeof b=="object"&&!Array.isArray(b)){I(b,w,X,D,W,Q,G);for(var N in b){var B=b[N];if(Array.isArray(B)){if(N in v4.arrayKeywords)for(var H=0;H<B.length;H++)Yb($,I,U,B[H],w+"/"+N+"/"+H,X,w,N,b,H)}else if(N in v4.propsKeywords){if(B&&typeof B=="object")for(var J in B)Yb($,I,U,B[J],w+"/"+N+"/"+h2(J),X,w,N,b,J)}else if(N in v4.keywords||$.allKeys&&!(N in v4.skipKeywords))Yb($,I,U,B,w+"/"+N,X,w,N,b)}U(b,w,X,D,W,Q,G)}}function h2($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var HU=Z((R3)=>{Object.defineProperty(R3,"__esModule",{value:!0});R3.getSchemaRefs=R3.resolveUrl=R3.normalizeId=R3._getFullPath=R3.getFullPath=R3.inlineRef=void 0;var f2=W$(),y2=t8(),u2=E3(),l2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function c2($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!a8($);if(!I)return!1;return S3($)<=I}R3.inlineRef=c2;var m2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a8($){for(let I in $){if(m2.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(a8))return!0;if(typeof U=="object"&&a8(U))return!0}return!1}function S3($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,l2.has(U))continue;if(typeof $[U]=="object")f2.eachItem($[U],(b)=>I+=S3(b));if(I===1/0)return 1/0}return I}function P3($,I="",U){if(U!==!1)I=_1(I);let b=$.parse(I);return k3($,b)}R3.getFullPath=P3;function k3($,I){return $.serialize(I).split("#")[0]+"#"}R3._getFullPath=k3;var r2=/#\/?$/;function _1($){return $?$.replace(r2,""):""}R3.normalizeId=_1;function n2($,I,U){return U=_1(U),$.resolve(I,U)}R3.resolveUrl=n2;var i2=/^[a-z_][-a-z0-9._]*$/i;function o2($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:b}=this.opts,w=_1($[U]||I),X={"":w},D=P3(b,w,!1),W={},Q=new Set;return u2($,{allKeys:!0},(B,H,J,A)=>{if(A===void 0)return;let O=D+H,V=X[A];if(typeof B[U]=="string")V=q.call(this,B[U]);k.call(this,B.$anchor),k.call(this,B.$dynamicAnchor),X[H]=V;function q(P){let x=this.opts.uriResolver.resolve;if(P=_1(V?x(V,P):P),Q.has(P))throw N(P);Q.add(P);let l=this.refs[P];if(typeof l=="string")l=this.refs[l];if(typeof l=="object")G(B,l.schema,P);else if(P!==_1(O))if(P[0]==="#")G(B,W[P],P),W[P]=B;else this.refs[P]=O;return P}function k(P){if(typeof P=="string"){if(!i2.test(P))throw new Error(`invalid anchor "${P}"`);q.call(this,`#${P}`)}}}),W;function G(B,H,J){if(H!==void 0&&!y2(B,H))throw N(J)}function N(B){return new Error(`reference "${B}" resolves to more than one schema`)}}R3.getSchemaRefs=o2});var zU=Z((i3)=>{Object.defineProperty(i3,"__esModule",{value:!0});i3.getData=i3.KeywordCxt=i3.validateFunctionCode=void 0;var x3=pz(),_3=JU(),s8=m8(),Bb=JU(),s2=N3(),OU=K3(),e8=F3(),y=a(),i=s6(),$T=HU(),$4=W$(),AU=BU();function IT($){if(y3($)){if(u3($),f3($)){bT($);return}}h3($,()=>x3.topBoolOrEmptySchema($))}i3.validateFunctionCode=IT;function h3({gen:$,validateName:I,schema:U,schemaEnv:b,opts:w},X){if(w.code.es5)$.func(I,y._`${i.default.data}, ${i.default.valCxt}`,b.$async,()=>{$.code(y._`"use strict"; ${Z3(U,w)}`),wT($,w),$.code(X)});else $.func(I,y._`${i.default.data}, ${UT(w)}`,b.$async,()=>$.code(Z3(U,w)).code(X))}function UT($){return y._`{${i.default.instancePath}="", ${i.default.parentData}, ${i.default.parentDataProperty}, ${i.default.rootData}=${i.default.data}${$.dynamicRef?y._`, ${i.default.dynamicAnchors}={}`:y.nil}}={}`}function wT($,I){$.if(i.default.valCxt,()=>{if($.var(i.default.instancePath,y._`${i.default.valCxt}.${i.default.instancePath}`),$.var(i.default.parentData,y._`${i.default.valCxt}.${i.default.parentData}`),$.var(i.default.parentDataProperty,y._`${i.default.valCxt}.${i.default.parentDataProperty}`),$.var(i.default.rootData,y._`${i.default.valCxt}.${i.default.rootData}`),I.dynamicRef)$.var(i.default.dynamicAnchors,y._`${i.default.valCxt}.${i.default.dynamicAnchors}`)},()=>{if($.var(i.default.instancePath,y._`""`),$.var(i.default.parentData,y._`undefined`),$.var(i.default.parentDataProperty,y._`undefined`),$.var(i.default.rootData,i.default.data),I.dynamicRef)$.var(i.default.dynamicAnchors,y._`{}`)})}function bT($){let{schema:I,opts:U,gen:b}=$;h3($,()=>{if(U.$comment&&I.$comment)c3($);if(GT($),b.let(i.default.vErrors,null),b.let(i.default.errors,0),U.unevaluated)XT($);l3($),BT($)});return}function XT($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",y._`${U}.evaluated`),I.if(y._`${$.evaluated}.dynamicProps`,()=>I.assign(y._`${$.evaluated}.props`,y._`undefined`)),I.if(y._`${$.evaluated}.dynamicItems`,()=>I.assign(y._`${$.evaluated}.items`,y._`undefined`))}function Z3($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?y._`/*# sourceURL=${U} */`:y.nil}function DT($,I){if(y3($)){if(u3($),f3($)){WT($,I);return}}x3.boolOrEmptySchema($,I)}function f3({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function y3($){return typeof $.schema!="boolean"}function WT($,I){let{schema:U,gen:b,opts:w}=$;if(w.$comment&&U.$comment)c3($);NT($),YT($);let X=b.const("_errs",i.default.errors);l3($,X),b.var(I,y._`${X} === ${i.default.errors}`)}function u3($){$4.checkUnknownRules($),QT($)}function l3($,I){if($.opts.jtd)return C3($,[],!1,I);let U=_3.getSchemaTypes($.schema),b=_3.coerceAndCheckDataType($,U);C3($,U,!b,I)}function QT($){let{schema:I,errSchemaPath:U,opts:b,self:w}=$;if(I.$ref&&b.ignoreKeywordsWithRef&&$4.schemaHasRulesButRef(I,w.RULES))w.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function GT($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)$4.checkStrictMode($,"default is ignored in the schema root")}function NT($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=$T.resolveUrl($.opts.uriResolver,$.baseId,I)}function YT($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function c3({gen:$,schemaEnv:I,schema:U,errSchemaPath:b,opts:w}){let X=U.$comment;if(w.$comment===!0)$.code(y._`${i.default.self}.logger.log(${X})`);else if(typeof w.$comment=="function"){let D=y.str`${b}/$comment`,W=$.scopeValue("root",{ref:I.root});$.code(y._`${i.default.self}.opts.$comment(${X}, ${D}, ${W}.schema)`)}}function BT($){let{gen:I,schemaEnv:U,validateName:b,ValidationError:w,opts:X}=$;if(U.$async)I.if(y._`${i.default.errors} === 0`,()=>I.return(i.default.data),()=>I.throw(y._`new ${w}(${i.default.vErrors})`));else{if(I.assign(y._`${b}.errors`,i.default.vErrors),X.unevaluated)JT($);I.return(y._`${i.default.errors} === 0`)}}function JT({gen:$,evaluated:I,props:U,items:b}){if(U instanceof y.Name)$.assign(y._`${I}.props`,U);if(b instanceof y.Name)$.assign(y._`${I}.items`,b)}function C3($,I,U,b){let{gen:w,schema:X,data:D,allErrors:W,opts:Q,self:G}=$,{RULES:N}=G;if(X.$ref&&(Q.ignoreKeywordsWithRef||!$4.schemaHasRulesButRef(X,N))){w.block(()=>r3($,"$ref",N.all.$ref.definition));return}if(!Q.jtd)HT($,I);w.block(()=>{for(let H of N.rules)B(H);B(N.post)});function B(H){if(!s8.shouldUseGroup(X,H))return;if(H.type){if(w.if(Bb.checkDataType(H.type,D,Q.strictNumbers)),g3($,H),I.length===1&&I[0]===H.type&&U)w.else(),Bb.reportTypeError($);w.endIf()}else g3($,H);if(!W)w.if(y._`${i.default.errors} === ${b||0}`)}}function g3($,I){let{gen:U,schema:b,opts:{useDefaults:w}}=$;if(w)s2.assignDefaults($,I.type);U.block(()=>{for(let X of I.rules)if(s8.shouldUseRule(b,X))r3($,X.keyword,X.definition,I.type)})}function HT($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(AT($,I),!$.opts.allowUnionTypes)OT($,I);zT($,$.dataTypes)}function AT($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!m3($.dataTypes,U))$Q($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),KT($,I)}function OT($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))$Q($,"use allowUnionTypes to allow union type keyword")}function zT($,I){let U=$.self.RULES.all;for(let b in U){let w=U[b];if(typeof w=="object"&&s8.shouldUseRule($.schema,w)){let{type:X}=w.definition;if(X.length&&!X.some((D)=>LT(I,D)))$Q($,`missing type "${X.join(",")}" for keyword "${b}"`)}}}function LT($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function m3($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function KT($,I){let U=[];for(let b of $.dataTypes)if(m3(I,b))U.push(b);else if(I.includes("integer")&&b==="number")U.push("integer");$.dataTypes=U}function $Q($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,$4.checkStrictMode($,I,$.opts.strictTypes)}class IQ{constructor($,I,U){if(OU.validateKeywordUsage($,I,U),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=U,this.data=$.data,this.schema=$.schema[U],this.$data=I.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=$4.schemaRefOrVal($,this.schema,U,this.$data),this.schemaType=I.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=I,this.$data)this.schemaCode=$.gen.const("vSchema",n3(this.$data,$));else if(this.schemaCode=this.schemaValue,!OU.validSchemaType(this.schema,I.schemaType,I.allowUndefined))throw new Error(`${U} value must be ${JSON.stringify(I.schemaType)}`);if("code"in I?I.trackErrors:I.errors!==!1)this.errsCount=$.gen.const("_errs",i.default.errors)}result($,I,U){this.failResult(y.not($),I,U)}failResult($,I,U){if(this.gen.if($),U)U();else this.error();if(I){if(this.gen.else(),I(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,I){this.failResult(y.not($),void 0,I)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:I}=this;this.fail(y._`${I} !== undefined && (${y.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?AU.reportExtraError:AU.reportError)(this,this.def.error,I)}$dataError(){AU.reportError(this,this.def.$dataError||AU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');AU.resetErrorsCount(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,I){if(I)Object.assign(this.params,$);else this.params=$}block$data($,I,U=y.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=y.nil,I=y.nil){if(!this.$data)return;let{gen:U,schemaCode:b,schemaType:w,def:X}=this;if(U.if(y.or(y._`${b} === undefined`,I)),$!==y.nil)U.assign($,!0);if(w.length||X.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==y.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:b,it:w}=this;return y.or(X(),D());function X(){if(U.length){if(!(I instanceof y.Name))throw new Error("ajv implementation error");let W=Array.isArray(U)?U:[U];return y._`${Bb.checkDataTypes(W,I,w.opts.strictNumbers,Bb.DataType.Wrong)}`}return y.nil}function D(){if(b.validateSchema){let W=$.scopeValue("validate$data",{ref:b.validateSchema});return y._`!${W}(${I})`}return y.nil}}subschema($,I){let U=e8.getSubschema(this.it,$);e8.extendSubschemaData(U,this.it,$),e8.extendSubschemaMode(U,$);let b={...this.it,...U,items:void 0,props:void 0};return DT(b,I),b}mergeEvaluated($,I){let{it:U,gen:b}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&$.props!==void 0)U.props=$4.mergeEvaluated.props(b,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=$4.mergeEvaluated.items(b,$.items,U.items,I)}mergeValidEvaluated($,I){let{it:U,gen:b}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return b.if(I,()=>this.mergeEvaluated($,y.Name)),!0}}i3.KeywordCxt=IQ;function r3($,I,U,b){let w=new IQ($,U,I);if("code"in U)U.code(w,b);else if(w.$data&&U.validate)OU.funcKeywordCode(w,U);else if("macro"in U)OU.macroKeywordCode(w,U);else if(U.compile||U.validate)OU.funcKeywordCode(w,U)}var vT=/^\/(?:[^~]|~0|~1)*$/,VT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function n3($,{dataLevel:I,dataNames:U,dataPathArr:b}){let w,X;if($==="")return i.default.rootData;if($[0]==="/"){if(!vT.test($))throw new Error(`Invalid JSON-pointer: ${$}`);w=$,X=i.default.rootData}else{let G=VT.exec($);if(!G)throw new Error(`Invalid JSON-pointer: ${$}`);let N=+G[1];if(w=G[2],w==="#"){if(N>=I)throw new Error(Q("property/index",N));return b[I-N]}if(N>I)throw new Error(Q("data",N));if(X=U[I-N],!w)return X}let D=X,W=w.split("/");for(let G of W)if(G)X=y._`${X}${y.getProperty($4.unescapeJsonPointer(G))}`,D=y._`${D} && ${X}`;return D;function Q(G,N){return`Cannot access ${G} ${N} levels up, current level is ${I}`}}i3.getData=n3});var Jb=Z((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});class d3 extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}p3.default=d3});var LU=Z((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});var UQ=HU();class t3 extends Error{constructor($,I,U,b){super(b||`can't resolve reference ${U} from id ${I}`);this.missingRef=UQ.resolveUrl($,I,U),this.missingSchema=UQ.normalizeId(UQ.getFullPath($,this.missingRef))}}a3.default=t3});var Ab=Z(($L)=>{Object.defineProperty($L,"__esModule",{value:!0});$L.resolveSchema=$L.getCompilingSchema=$L.resolveRef=$L.compileSchema=$L.SchemaEnv=void 0;var S6=a(),ET=Jb(),a4=s6(),P6=HU(),e3=W$(),ST=zU();class KU{constructor($){var I;this.refs={},this.dynamicAnchors={};let U;if(typeof $.schema=="object")U=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(I=$.baseId)!==null&&I!==void 0?I:P6.normalizeId(U===null||U===void 0?void 0:U[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=U===null||U===void 0?void 0:U.$async,this.refs={}}}$L.SchemaEnv=KU;function bQ($){let I=s3.call(this,$);if(I)return I;let U=P6.getFullPath(this.opts.uriResolver,$.root.baseId),{es5:b,lines:w}=this.opts.code,{ownProperties:X}=this.opts,D=new S6.CodeGen(this.scope,{es5:b,lines:w,ownProperties:X}),W;if($.$async)W=D.scopeValue("Error",{ref:ET.default,code:S6._`require("ajv/dist/runtime/validation_error").default`});let Q=D.scopeName("validate");$.validateName=Q;let G={gen:D,allErrors:this.opts.allErrors,data:a4.default.data,parentData:a4.default.parentData,parentDataProperty:a4.default.parentDataProperty,dataNames:[a4.default.data],dataPathArr:[S6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:D.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:S6.stringify($.schema)}:{ref:$.schema}),validateName:Q,ValidationError:W,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:S6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:S6._`""`,opts:this.opts,self:this},N;try{this._compilations.add($),ST.validateFunctionCode(G),D.optimize(this.opts.code.optimize);let B=D.toString();if(N=`${D.scopeRefs(a4.default.scope)}return ${B}`,this.opts.code.process)N=this.opts.code.process(N,$);let J=new Function(`${a4.default.self}`,`${a4.default.scope}`,N)(this,this.scope.get());if(this.scope.value(Q,{ref:J}),J.errors=null,J.schema=$.schema,J.schemaEnv=$,$.$async)J.$async=!0;if(this.opts.code.source===!0)J.source={validateName:Q,validateCode:B,scopeValues:D._values};if(this.opts.unevaluated){let{props:A,items:O}=G;if(J.evaluated={props:A instanceof S6.Name?void 0:A,items:O instanceof S6.Name?void 0:O,dynamicProps:A instanceof S6.Name,dynamicItems:O instanceof S6.Name},J.source)J.source.evaluated=S6.stringify(J.evaluated)}return $.validate=J,$}catch(B){if(delete $.validate,delete $.validateName,N)this.logger.error("Error compiling schema, function code:",N);throw B}finally{this._compilations.delete($)}}$L.compileSchema=bQ;function PT($,I,U){var b;U=P6.resolveUrl(this.opts.uriResolver,I,U);let w=$.refs[U];if(w)return w;let X=TT.call(this,$,U);if(X===void 0){let D=(b=$.localRefs)===null||b===void 0?void 0:b[U],{schemaId:W}=this.opts;if(D)X=new KU({schema:D,schemaId:W,root:$,baseId:I})}if(X===void 0)return;return $.refs[U]=kT.call(this,X)}$L.resolveRef=PT;function kT($){if(P6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:bQ.call(this,$)}function s3($){for(let I of this._compilations)if(RT(I,$))return I}$L.getCompilingSchema=s3;function RT($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function TT($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||Hb.call(this,$,I)}function Hb($,I){let U=this.opts.uriResolver.parse(I),b=P6._getFullPath(this.opts.uriResolver,U),w=P6.getFullPath(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&b===w)return wQ.call(this,U,$);let X=P6.normalizeId(b),D=this.refs[X]||this.schemas[X];if(typeof D=="string"){let W=Hb.call(this,$,D);if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;return wQ.call(this,U,W)}if(typeof(D===null||D===void 0?void 0:D.schema)!=="object")return;if(!D.validate)bQ.call(this,D);if(X===P6.normalizeId(I)){let{schema:W}=D,{schemaId:Q}=this.opts,G=W[Q];if(G)w=P6.resolveUrl(this.opts.uriResolver,w,G);return new KU({schema:W,schemaId:Q,root:$,baseId:w})}return wQ.call(this,U,D)}$L.resolveSchema=Hb;var _T=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function wQ($,{baseId:I,schema:U,root:b}){var w;if(((w=$.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let W of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let Q=U[e3.unescapeFragment(W)];if(Q===void 0)return;U=Q;let G=typeof U==="object"&&U[this.opts.schemaId];if(!_T.has(W)&&G)I=P6.resolveUrl(this.opts.uriResolver,I,G)}let X;if(typeof U!="boolean"&&U.$ref&&!e3.schemaHasRulesButRef(U,this.RULES)){let W=P6.resolveUrl(this.opts.uriResolver,I,U.$ref);X=Hb.call(this,b,W)}let{schemaId:D}=this.opts;if(X=X||new KU({schema:U,schemaId:D,root:b,baseId:I}),X.schema!==X.root.schema)return X;return}});var UL=Z((li,hT)=>{hT.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}});var DQ=Z((ci,DL)=>{var fT=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),bL=RegExp.prototype.test.bind(/^(?:(?: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 XQ($){let I="",U=0,b=0;for(b=0;b<$.length;b++){if(U=$[b].charCodeAt(0),U===48)continue;if(!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[b];break}for(b+=1;b<$.length;b++){if(U=$[b].charCodeAt(0),!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[b]}return I}var yT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function wL($){return $.length=0,!0}function uT($,I,U){if($.length){let b=XQ($);if(b!=="")I.push(b);else return U.error=!0,!1;$.length=0}return!0}function lT($){let I=0,U={error:!1,address:"",zone:""},b=[],w=[],X=!1,D=!1,W=uT;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(G==="["||G==="]")continue;if(G===":"){if(X===!0)D=!0;if(!W(w,b,U))break;if(++I>7){U.error=!0;break}if(Q>0&&$[Q-1]===":")X=!0;b.push(":");continue}else if(G==="%"){if(!W(w,b,U))break;W=wL}else{w.push(G);continue}}if(w.length)if(W===wL)U.zone=w.join("");else if(D)b.push(w.join(""));else b.push(XQ(w));return U.address=b.join(""),U}function XL($){if(cT($,":")<2)return{host:$,isIPV6:!1};let I=lT($);if(!I.error){let{address:U,address:b}=I;if(I.zone)U+="%"+I.zone,b+="%25"+I.zone;return{host:U,isIPV6:!0,escapedHost:b}}else return{host:$,isIPV6:!1}}function cT($,I){let U=0;for(let b=0;b<$.length;b++)if($[b]===I)U++;return U}function mT($){let I=$,U=[],b=-1,w=0;while(w=I.length){if(w===1)if(I===".")break;else if(I==="/"){U.push("/");break}else{U.push(I);break}else if(w===2){if(I[0]==="."){if(I[1]===".")break;else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."||I[1]==="/"){U.push("/");break}}}else if(w===3){if(I==="/.."){if(U.length!==0)U.pop();U.push("/");break}}if(I[0]==="."){if(I[1]==="."){if(I[2]==="/"){I=I.slice(3);continue}}else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."){if(I[2]==="/"){I=I.slice(2);continue}else if(I[2]==="."){if(I[3]==="/"){if(I=I.slice(3),U.length!==0)U.pop();continue}}}}if((b=I.indexOf("/",1))===-1){U.push(I);break}else U.push(I.slice(0,b)),I=I.slice(b)}return U.join("")}function rT($,I){let U=I!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=U($.scheme);if($.userinfo!==void 0)$.userinfo=U($.userinfo);if($.host!==void 0)$.host=U($.host);if($.path!==void 0)$.path=U($.path);if($.query!==void 0)$.query=U($.query);if($.fragment!==void 0)$.fragment=U($.fragment);return $}function nT($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!bL(U)){let b=XL(U);if(b.isIPV6===!0)U=`[${b.escapedHost}]`;else U=$.host}I.push(U)}if(typeof $.port==="number"||typeof $.port==="string")I.push(":"),I.push(String($.port));return I.length?I.join(""):void 0}DL.exports={nonSimpleDomain:yT,recomposeAuthority:nT,normalizeComponentEncoding:rT,removeDotSegments:mT,isIPv4:bL,isUUID:fT,normalizeIPv6:XL,stringArrayToHexStripped:XQ}});var YL=Z((mi,NL)=>{var{isUUID:iT}=DQ(),oT=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,dT=["http","https","ws","wss","urn","urn:uuid"];function pT($){return dT.indexOf($)!==-1}function WQ($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function WL($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function QL($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function tT($){return $.secure=WQ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function aT($){if($.port===(WQ($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[I,U]=$.resourceName.split("?");$.path=I&&I!=="/"?I:void 0,$.query=U,$.resourceName=void 0}return $.fragment=void 0,$}function eT($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(oT);if(U){let b=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let w=`${b}:${I.nid||$.nid}`,X=QQ(w);if($.path=void 0,X)$=X.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function sT($,I){if($.nid===void 0)throw new Error("URN without nid cannot be serialized");let U=I.scheme||$.scheme||"urn",b=$.nid.toLowerCase(),w=`${U}:${I.nid||b}`,X=QQ(w);if(X)$=X.serialize($,I);let D=$,W=$.nss;return D.path=`${b||I.nid}:${W}`,I.skipEscape=!0,D}function $_($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!iT(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function I_($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var GL={scheme:"http",domainHost:!0,parse:WL,serialize:QL},U_={scheme:"https",domainHost:GL.domainHost,parse:WL,serialize:QL},Ob={scheme:"ws",domainHost:!0,parse:tT,serialize:aT},w_={scheme:"wss",domainHost:Ob.domainHost,parse:Ob.parse,serialize:Ob.serialize},b_={scheme:"urn",parse:eT,serialize:sT,skipNormalize:!0},X_={scheme:"urn:uuid",parse:$_,serialize:I_,skipNormalize:!0},zb={http:GL,https:U_,ws:Ob,wss:w_,urn:b_,"urn:uuid":X_};Object.setPrototypeOf(zb,null);function QQ($){return $&&(zb[$]||zb[$.toLowerCase()])||void 0}NL.exports={wsIsSecure:WQ,SCHEMES:zb,isValidSchemeName:pT,getSchemeHandler:QQ}});var HL=Z((ri,Kb)=>{var{normalizeIPv6:D_,removeDotSegments:vU,recomposeAuthority:W_,normalizeComponentEncoding:Lb,isIPv4:Q_,nonSimpleDomain:G_}=DQ(),{SCHEMES:N_,getSchemeHandler:BL}=YL();function Y_($,I){if(typeof $==="string")$=f6(I4($,I),I);else if(typeof $==="object")$=I4(f6($,I),I);return $}function B_($,I,U){let b=U?Object.assign({scheme:"null"},U):{scheme:"null"},w=JL(I4($,b),I4(I,b),b,!0);return b.skipEscape=!0,f6(w,b)}function JL($,I,U,b){let w={};if(!b)$=I4(f6($,U),U),I=I4(f6(I,U),U);if(U=U||{},!U.tolerant&&I.scheme)w.scheme=I.scheme,w.userinfo=I.userinfo,w.host=I.host,w.port=I.port,w.path=vU(I.path||""),w.query=I.query;else{if(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)w.userinfo=I.userinfo,w.host=I.host,w.port=I.port,w.path=vU(I.path||""),w.query=I.query;else{if(!I.path)if(w.path=$.path,I.query!==void 0)w.query=I.query;else w.query=$.query;else{if(I.path[0]==="/")w.path=vU(I.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)w.path="/"+I.path;else if(!$.path)w.path=I.path;else w.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+I.path;w.path=vU(w.path)}w.query=I.query}w.userinfo=$.userinfo,w.host=$.host,w.port=$.port}w.scheme=$.scheme}return w.fragment=I.fragment,w}function J_($,I,U){if(typeof $==="string")$=unescape($),$=f6(Lb(I4($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=f6(Lb($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=f6(Lb(I4(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=f6(Lb(I,!0),{...U,skipEscape:!0});return $.toLowerCase()===I.toLowerCase()}function f6($,I){let U={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},b=Object.assign({},I),w=[],X=BL(b.scheme||U.scheme);if(X&&X.serialize)X.serialize(U,b);if(U.path!==void 0)if(!b.skipEscape){if(U.path=escape(U.path),U.scheme!==void 0)U.path=U.path.split("%3A").join(":")}else U.path=unescape(U.path);if(b.reference!=="suffix"&&U.scheme)w.push(U.scheme,":");let D=W_(U);if(D!==void 0){if(b.reference!=="suffix")w.push("//");if(w.push(D),U.path&&U.path[0]!=="/")w.push("/")}if(U.path!==void 0){let W=U.path;if(!b.absolutePath&&(!X||!X.absolutePath))W=vU(W);if(D===void 0&&W[0]==="/"&&W[1]==="/")W="/%2F"+W.slice(2);w.push(W)}if(U.query!==void 0)w.push("?",U.query);if(U.fragment!==void 0)w.push("#",U.fragment);return w.join("")}var H_=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I4($,I){let U=Object.assign({},I),b={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},w=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let X=$.match(H_);if(X){if(b.scheme=X[1],b.userinfo=X[3],b.host=X[4],b.port=parseInt(X[5],10),b.path=X[6]||"",b.query=X[7],b.fragment=X[8],isNaN(b.port))b.port=X[5];if(b.host)if(Q_(b.host)===!1){let Q=D_(b.host);b.host=Q.host.toLowerCase(),w=Q.isIPV6}else w=!0;if(b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&b.query===void 0&&!b.path)b.reference="same-document";else if(b.scheme===void 0)b.reference="relative";else if(b.fragment===void 0)b.reference="absolute";else b.reference="uri";if(U.reference&&U.reference!=="suffix"&&U.reference!==b.reference)b.error=b.error||"URI is not a "+U.reference+" reference.";let D=BL(U.scheme||b.scheme);if(!U.unicodeSupport&&(!D||!D.unicodeSupport)){if(b.host&&(U.domainHost||D&&D.domainHost)&&w===!1&&G_(b.host))try{b.host=URL.domainToASCII(b.host.toLowerCase())}catch(W){b.error=b.error||"Host's domain name can not be converted to ASCII: "+W}}if(!D||D&&!D.skipNormalize){if($.indexOf("%")!==-1){if(b.scheme!==void 0)b.scheme=unescape(b.scheme);if(b.host!==void 0)b.host=unescape(b.host)}if(b.path)b.path=escape(unescape(b.path));if(b.fragment)b.fragment=encodeURI(decodeURIComponent(b.fragment))}if(D&&D.parse)D.parse(b,U)}else b.error=b.error||"URI can not be parsed.";return b}var GQ={SCHEMES:N_,normalize:Y_,resolve:B_,resolveComponent:JL,equal:J_,serialize:f6,parse:I4};Kb.exports=GQ;Kb.exports.default=GQ;Kb.exports.fastUri=GQ});var zL=Z((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});var AL=HL();AL.code='require("ajv/dist/runtime/uri").default';OL.default=AL});var jL=Z((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.CodeGen=U4.Name=U4.nil=U4.stringify=U4.str=U4._=U4.KeywordCxt=void 0;var O_=zU();Object.defineProperty(U4,"KeywordCxt",{enumerable:!0,get:function(){return O_.KeywordCxt}});var Z1=a();Object.defineProperty(U4,"_",{enumerable:!0,get:function(){return Z1._}});Object.defineProperty(U4,"str",{enumerable:!0,get:function(){return Z1.str}});Object.defineProperty(U4,"stringify",{enumerable:!0,get:function(){return Z1.stringify}});Object.defineProperty(U4,"nil",{enumerable:!0,get:function(){return Z1.nil}});Object.defineProperty(U4,"Name",{enumerable:!0,get:function(){return Z1.Name}});Object.defineProperty(U4,"CodeGen",{enumerable:!0,get:function(){return Z1.CodeGen}});var z_=Jb(),qL=LU(),L_=c8(),VU=Ab(),K_=a(),qU=HU(),vb=JU(),YQ=W$(),LL=UL(),v_=zL(),FL=($,I)=>new RegExp($,I);FL.code="new RegExp";var V_=["removeAdditional","useDefaults","coerceTypes"],q_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),F_={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.'},KL=200;function j_($){var I,U,b,w,X,D,W,Q,G,N,B,H,J,A,O,V,q,k,P,x,l,l$,Y6,B1,uD;let jI=$.strict,lD=(I=$.code)===null||I===void 0?void 0:I.optimize,OH=lD===!0||lD===void 0?1:lD||0,zH=(b=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&b!==void 0?b:FL,xM=(w=$.uriResolver)!==null&&w!==void 0?w:v_.default;return{strictSchema:(D=(X=$.strictSchema)!==null&&X!==void 0?X:jI)!==null&&D!==void 0?D:!0,strictNumbers:(Q=(W=$.strictNumbers)!==null&&W!==void 0?W:jI)!==null&&Q!==void 0?Q:!0,strictTypes:(N=(G=$.strictTypes)!==null&&G!==void 0?G:jI)!==null&&N!==void 0?N:"log",strictTuples:(H=(B=$.strictTuples)!==null&&B!==void 0?B:jI)!==null&&H!==void 0?H:"log",strictRequired:(A=(J=$.strictRequired)!==null&&J!==void 0?J:jI)!==null&&A!==void 0?A:!1,code:$.code?{...$.code,optimize:OH,regExp:zH}:{optimize:OH,regExp:zH},loopRequired:(O=$.loopRequired)!==null&&O!==void 0?O:KL,loopEnum:(V=$.loopEnum)!==null&&V!==void 0?V:KL,meta:(q=$.meta)!==null&&q!==void 0?q:!0,messages:(k=$.messages)!==null&&k!==void 0?k:!0,inlineRefs:(P=$.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(x=$.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(l=$.addUsedSchema)!==null&&l!==void 0?l:!0,validateSchema:(l$=$.validateSchema)!==null&&l$!==void 0?l$:!0,validateFormats:(Y6=$.validateFormats)!==null&&Y6!==void 0?Y6:!0,unicodeRegExp:(B1=$.unicodeRegExp)!==null&&B1!==void 0?B1:!0,int32range:(uD=$.int32range)!==null&&uD!==void 0?uD:!0,uriResolver:xM}}class Vb{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...j_($)};let{es5:I,lines:U}=this.opts.code;this.scope=new K_.ValueScope({scope:{},prefixes:q_,es5:I,lines:U}),this.logger=T_($.logger);let b=$.validateFormats;if($.validateFormats=!1,this.RULES=L_.getRules(),vL.call(this,F_,$,"NOT SUPPORTED"),vL.call(this,M_,$,"DEPRECATED","warn"),this._metaOpts=k_.call(this),$.formats)S_.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)P_.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);E_.call(this),$.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,b=LL;if(U==="id")b={...LL},b.id=b.$id,delete b.$id;if(I&&$)this.addMetaSchema(b,b[U],!1)}defaultMeta(){let{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let U;if(typeof $=="string"){if(U=this.getSchema($),!U)throw new Error(`no schema with key or ref "${$}"`)}else U=this.compile($);let b=U(I);if(!("$async"in U))this.errors=U.errors;return b}compile($,I){let U=this._addSchema($,I);return U.validate||this._compileSchemaEnv(U)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:U}=this.opts;return b.call(this,$,I);async function b(G,N){await w.call(this,G.$schema);let B=this._addSchema(G,N);return B.validate||X.call(this,B)}async function w(G){if(G&&!this.getSchema(G))await b.call(this,{$ref:G},!0)}async function X(G){try{return this._compileSchemaEnv(G)}catch(N){if(!(N instanceof qL.default))throw N;return D.call(this,N),await W.call(this,N.missingSchema),X.call(this,G)}}function D({missingSchema:G,missingRef:N}){if(this.refs[G])throw new Error(`AnySchema ${G} is loaded but ${N} cannot be resolved`)}async function W(G){let N=await Q.call(this,G);if(!this.refs[G])await w.call(this,N.$schema);if(!this.refs[G])this.addSchema(N,G,I)}async function Q(G){let N=this._loading[G];if(N)return N;try{return await(this._loading[G]=U(G))}finally{delete this._loading[G]}}}addSchema($,I,U,b=this.opts.validateSchema){if(Array.isArray($)){for(let X of $)this.addSchema(X,void 0,U,b);return this}let w;if(typeof $==="object"){let{schemaId:X}=this.opts;if(w=$[X],w!==void 0&&typeof w!="string")throw new Error(`schema ${X} must be string`)}return I=qU.normalizeId(I||w),this._checkUnique(I),this.schemas[I]=this._addSchema($,U,I,b,!0),this}addMetaSchema($,I,U=this.opts.validateSchema){return this.addSchema($,I,!0,U),this}validateSchema($,I){if(typeof $=="boolean")return!0;let U;if(U=$.$schema,U!==void 0&&typeof U!="string")throw new Error("$schema must be a string");if(U=U||this.opts.defaultMeta||this.defaultMeta(),!U)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let b=this.validate(U,$);if(!b&&I){let w="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(w);else throw new Error(w)}return b}getSchema($){let I;while(typeof(I=VL.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,b=new VU.SchemaEnv({schema:{},schemaId:U});if(I=VU.resolveSchema.call(this,b,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let I=VL.call(this,$);if(typeof I=="object")this._cache.delete(I.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let I=$;this._cache.delete(I);let U=$[this.opts.schemaId];if(U)U=qU.normalizeId(U),delete this.schemas[U],delete this.refs[U];return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let I of $)this.addKeyword(I);return this}addKeyword($,I){let U;if(typeof $=="string"){if(U=$,typeof I=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=U}else if(typeof $=="object"&&I===void 0){if(I=$,U=I.keyword,Array.isArray(U)&&!U.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Z_.call(this,U,I),!I)return YQ.eachItem(U,(w)=>NQ.call(this,w)),this;g_.call(this,I);let b={...I,type:vb.getJSONTypes(I.type),schemaType:vb.getJSONTypes(I.schemaType)};return YQ.eachItem(U,b.type.length===0?(w)=>NQ.call(this,w,b):(w)=>b.type.forEach((X)=>NQ.call(this,w,b,X))),this}getKeyword($){let I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){let{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(let U of I.rules){let b=U.rules.findIndex((w)=>w.keyword===$);if(b>=0)U.rules.splice(b,1)}return this}addFormat($,I){if(typeof I=="string")I=new RegExp(I);return this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:U="data"}={}){if(!$||$.length===0)return"No errors";return $.map((b)=>`${U}${b.instancePath} ${b.message}`).reduce((b,w)=>b+I+w)}$dataMetaSchema($,I){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let b of I){let w=b.split("/").slice(1),X=$;for(let D of w)X=X[D];for(let D in U){let W=U[D];if(typeof W!="object")continue;let{$data:Q}=W.definition,G=X[D];if(Q&&G)X[D]=ML(G)}}return $}_removeAllSchemas($,I){for(let U in $){let b=$[U];if(!I||I.test(U)){if(typeof b=="string")delete $[U];else if(b&&!b.meta)this._cache.delete(b.schema),delete $[U]}}}_addSchema($,I,U,b=this.opts.validateSchema,w=this.opts.addUsedSchema){let X,{schemaId:D}=this.opts;if(typeof $=="object")X=$[D];else if(this.opts.jtd)throw new Error("schema must be object");else if(typeof $!="boolean")throw new Error("schema must be object or boolean");let W=this._cache.get($);if(W!==void 0)return W;U=qU.normalizeId(X||U);let Q=qU.getSchemaRefs.call(this,$,U);if(W=new VU.SchemaEnv({schema:$,schemaId:D,meta:I,baseId:U,localRefs:Q}),this._cache.set(W.schema,W),w&&!U.startsWith("#")){if(U)this._checkUnique(U);this.refs[U]=W}if(b)this.validateSchema($,!0);return W}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else VU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{VU.compileSchema.call(this,$)}finally{this.opts=I}}}Vb.ValidationError=z_.default;Vb.MissingRefError=qL.default;U4.default=Vb;function vL($,I,U,b="error"){for(let w in $){let X=w;if(X in I)this.logger[b](`${U}: option ${w}. ${$[X]}`)}}function VL($){return $=qU.normalizeId($),this.schemas[$]||this.refs[$]}function E_(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function S_(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function P_($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let I in $){let U=$[I];if(!U.keyword)U.keyword=I;this.addKeyword(U)}}function k_(){let $={...this.opts};for(let I of V_)delete $[I];return $}var R_={log(){},warn(){},error(){}};function T_($){if($===!1)return R_;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var __=/^[a-z_$][a-z0-9_$:-]*$/i;function Z_($,I){let{RULES:U}=this;if(YQ.eachItem($,(b)=>{if(U.keywords[b])throw new Error(`Keyword ${b} is already defined`);if(!__.test(b))throw new Error(`Keyword ${b} has invalid name`)}),!I)return;if(I.$data&&!(("code"in I)||("validate"in I)))throw new Error('$data keyword must have "code" or "validate" function')}function NQ($,I,U){var b;let w=I===null||I===void 0?void 0:I.post;if(U&&w)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:X}=this,D=w?X.post:X.rules.find(({type:Q})=>Q===U);if(!D)D={type:U,rules:[]},X.rules.push(D);if(X.keywords[$]=!0,!I)return;let W={keyword:$,definition:{...I,type:vb.getJSONTypes(I.type),schemaType:vb.getJSONTypes(I.schemaType)}};if(I.before)C_.call(this,D,W,I.before);else D.rules.push(W);X.all[$]=W,(b=I.implements)===null||b===void 0||b.forEach((Q)=>this.addKeyword(Q))}function C_($,I,U){let b=$.rules.findIndex((w)=>w.keyword===U);if(b>=0)$.rules.splice(b,0,I);else $.rules.push(I),this.logger.warn(`rule ${U} is not defined`)}function g_($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=ML(I);$.validateSchema=this.compile(I,!0)}var x_={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ML($){return{anyOf:[$,x_]}}});var SL=Z((EL)=>{Object.defineProperty(EL,"__esModule",{value:!0});var y_={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};EL.default=y_});var ZL=Z((TL)=>{Object.defineProperty(TL,"__esModule",{value:!0});TL.callRef=TL.getValidate=void 0;var l_=LU(),PL=O6(),$6=a(),C1=s6(),kL=Ab(),qb=W$(),c_={keyword:"$ref",schemaType:"string",code($){let{gen:I,schema:U,it:b}=$,{baseId:w,schemaEnv:X,validateName:D,opts:W,self:Q}=b,{root:G}=X;if((U==="#"||U==="#/")&&w===G.baseId)return B();let N=kL.resolveRef.call(Q,G,w,U);if(N===void 0)throw new l_.default(b.opts.uriResolver,w,U);if(N instanceof kL.SchemaEnv)return H(N);return J(N);function B(){if(X===G)return Fb($,D,X,X.$async);let A=I.scopeValue("root",{ref:G});return Fb($,$6._`${A}.validate`,G,G.$async)}function H(A){let O=RL($,A);Fb($,O,A,A.$async)}function J(A){let O=I.scopeValue("schema",W.code.source===!0?{ref:A,code:$6.stringify(A)}:{ref:A}),V=I.name("valid"),q=$.subschema({schema:A,dataTypes:[],schemaPath:$6.nil,topSchemaRef:O,errSchemaPath:U},V);$.mergeEvaluated(q),$.ok(V)}}};function RL($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):$6._`${U.scopeValue("wrapper",{ref:I})}.validate`}TL.getValidate=RL;function Fb($,I,U,b){let{gen:w,it:X}=$,{allErrors:D,schemaEnv:W,opts:Q}=X,G=Q.passContext?C1.default.this:$6.nil;if(b)N();else B();function N(){if(!W.$async)throw new Error("async schema referenced by sync schema");let A=w.let("valid");w.try(()=>{if(w.code($6._`await ${PL.callValidateCode($,I,G)}`),J(I),!D)w.assign(A,!0)},(O)=>{if(w.if($6._`!(${O} instanceof ${X.ValidationError})`,()=>w.throw(O)),H(O),!D)w.assign(A,!1)}),$.ok(A)}function B(){$.result(PL.callValidateCode($,I,G),()=>J(I),()=>H(I))}function H(A){let O=$6._`${A}.errors`;w.assign(C1.default.vErrors,$6._`${C1.default.vErrors} === null ? ${O} : ${C1.default.vErrors}.concat(${O})`),w.assign(C1.default.errors,$6._`${C1.default.vErrors}.length`)}function J(A){var O;if(!X.opts.unevaluated)return;let V=(O=U===null||U===void 0?void 0:U.validate)===null||O===void 0?void 0:O.evaluated;if(X.props!==!0)if(V&&!V.dynamicProps){if(V.props!==void 0)X.props=qb.mergeEvaluated.props(w,V.props,X.props)}else{let q=w.var("props",$6._`${A}.evaluated.props`);X.props=qb.mergeEvaluated.props(w,q,X.props,$6.Name)}if(X.items!==!0)if(V&&!V.dynamicItems){if(V.items!==void 0)X.items=qb.mergeEvaluated.items(w,V.items,X.items)}else{let q=w.var("items",$6._`${A}.evaluated.items`);X.items=qb.mergeEvaluated.items(w,q,X.items,$6.Name)}}}TL.callRef=Fb;TL.default=c_});var gL=Z((CL)=>{Object.defineProperty(CL,"__esModule",{value:!0});var n_=SL(),i_=ZL(),o_=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n_.default,i_.default];CL.default=o_});var hL=Z((xL)=>{Object.defineProperty(xL,"__esModule",{value:!0});var Mb=a(),V4=Mb.operators,jb={maximum:{okStr:"<=",ok:V4.LTE,fail:V4.GT},minimum:{okStr:">=",ok:V4.GTE,fail:V4.LT},exclusiveMaximum:{okStr:"<",ok:V4.LT,fail:V4.GTE},exclusiveMinimum:{okStr:">",ok:V4.GT,fail:V4.LTE}},p_={message:({keyword:$,schemaCode:I})=>Mb.str`must be ${jb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>Mb._`{comparison: ${jb[$].okStr}, limit: ${I}}`},t_={keyword:Object.keys(jb),type:"number",schemaType:"number",$data:!0,error:p_,code($){let{keyword:I,data:U,schemaCode:b}=$;$.fail$data(Mb._`${U} ${jb[I].fail} ${b} || isNaN(${U})`)}};xL.default=t_});var yL=Z((fL)=>{Object.defineProperty(fL,"__esModule",{value:!0});var FU=a(),e_={message:({schemaCode:$})=>FU.str`must be multiple of ${$}`,params:({schemaCode:$})=>FU._`{multipleOf: ${$}}`},s_={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:e_,code($){let{gen:I,data:U,schemaCode:b,it:w}=$,X=w.opts.multipleOfPrecision,D=I.let("res"),W=X?FU._`Math.abs(Math.round(${D}) - ${D}) > 1e-${X}`:FU._`${D} !== parseInt(${D})`;$.fail$data(FU._`(${b} === 0 || (${D} = ${U}/${b}, ${W}))`)}};fL.default=s_});var cL=Z((lL)=>{Object.defineProperty(lL,"__esModule",{value:!0});function uL($){let I=$.length,U=0,b=0,w;while(b<I)if(U++,w=$.charCodeAt(b++),w>=55296&&w<=56319&&b<I){if(w=$.charCodeAt(b),(w&64512)===56320)b++}return U}lL.default=uL;uL.code='require("ajv/dist/runtime/ucs2length").default'});var rL=Z((mL)=>{Object.defineProperty(mL,"__esModule",{value:!0});var e4=a(),UZ=W$(),wZ=cL(),bZ={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return e4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>e4._`{limit: ${$}}`},XZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:bZ,code($){let{keyword:I,data:U,schemaCode:b,it:w}=$,X=I==="maxLength"?e4.operators.GT:e4.operators.LT,D=w.opts.unicode===!1?e4._`${U}.length`:e4._`${UZ.useFunc($.gen,wZ.default)}(${U})`;$.fail$data(e4._`${D} ${X} ${b}`)}};mL.default=XZ});var iL=Z((nL)=>{Object.defineProperty(nL,"__esModule",{value:!0});var WZ=O6(),Eb=a(),QZ={message:({schemaCode:$})=>Eb.str`must match pattern "${$}"`,params:({schemaCode:$})=>Eb._`{pattern: ${$}}`},GZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QZ,code($){let{data:I,$data:U,schema:b,schemaCode:w,it:X}=$,D=X.opts.unicodeRegExp?"u":"",W=U?Eb._`(new RegExp(${w}, ${D}))`:WZ.usePattern($,b);$.fail$data(Eb._`!${W}.test(${I})`)}};nL.default=GZ});var dL=Z((oL)=>{Object.defineProperty(oL,"__esModule",{value:!0});var MU=a(),YZ={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return MU.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>MU._`{limit: ${$}}`},BZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:YZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxProperties"?MU.operators.GT:MU.operators.LT;$.fail$data(MU._`Object.keys(${U}).length ${w} ${b}`)}};oL.default=BZ});var tL=Z((pL)=>{Object.defineProperty(pL,"__esModule",{value:!0});var jU=O6(),EU=a(),HZ=W$(),AZ={message:({params:{missingProperty:$}})=>EU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>EU._`{missingProperty: ${$}}`},OZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:AZ,code($){let{gen:I,schema:U,schemaCode:b,data:w,$data:X,it:D}=$,{opts:W}=D;if(!X&&U.length===0)return;let Q=U.length>=W.loopRequired;if(D.allErrors)G();else N();if(W.strictRequired){let J=$.parentSchema.properties,{definedProperties:A}=$.it;for(let O of U)if((J===null||J===void 0?void 0:J[O])===void 0&&!A.has(O)){let V=D.schemaEnv.baseId+D.errSchemaPath,q=`required property "${O}" is not defined at "${V}" (strictRequired)`;HZ.checkStrictMode(D,q,D.opts.strictRequired)}}function G(){if(Q||X)$.block$data(EU.nil,B);else for(let J of U)jU.checkReportMissingProp($,J)}function N(){let J=I.let("missing");if(Q||X){let A=I.let("valid",!0);$.block$data(A,()=>H(J,A)),$.ok(A)}else I.if(jU.checkMissingProp($,U,J)),jU.reportMissingProp($,J),I.else()}function B(){I.forOf("prop",b,(J)=>{$.setParams({missingProperty:J}),I.if(jU.noPropertyInData(I,w,J,W.ownProperties),()=>$.error())})}function H(J,A){$.setParams({missingProperty:J}),I.forOf(J,b,()=>{I.assign(A,jU.propertyInData(I,w,J,W.ownProperties)),I.if(EU.not(A),()=>{$.error(),I.break()})},EU.nil)}}};pL.default=OZ});var eL=Z((aL)=>{Object.defineProperty(aL,"__esModule",{value:!0});var SU=a(),LZ={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return SU.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>SU._`{limit: ${$}}`},KZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:LZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxItems"?SU.operators.GT:SU.operators.LT;$.fail$data(SU._`${U}.length ${w} ${b}`)}};aL.default=KZ});var Sb=Z(($K)=>{Object.defineProperty($K,"__esModule",{value:!0});var sL=t8();sL.code='require("ajv/dist/runtime/equal").default';$K.default=sL});var UK=Z((IK)=>{Object.defineProperty(IK,"__esModule",{value:!0});var BQ=JU(),h$=a(),qZ=W$(),FZ=Sb(),MZ={message:({params:{i:$,j:I}})=>h$.str`must NOT have duplicate items (items ## ${I} and ${$} are identical)`,params:({params:{i:$,j:I}})=>h$._`{i: ${$}, j: ${I}}`},jZ={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:MZ,code($){let{gen:I,data:U,$data:b,schema:w,parentSchema:X,schemaCode:D,it:W}=$;if(!b&&!w)return;let Q=I.let("valid"),G=X.items?BQ.getSchemaTypes(X.items):[];$.block$data(Q,N,h$._`${D} === false`),$.ok(Q);function N(){let A=I.let("i",h$._`${U}.length`),O=I.let("j");$.setParams({i:A,j:O}),I.assign(Q,!0),I.if(h$._`${A} > 1`,()=>(B()?H:J)(A,O))}function B(){return G.length>0&&!G.some((A)=>A==="object"||A==="array")}function H(A,O){let V=I.name("item"),q=BQ.checkDataTypes(G,V,W.opts.strictNumbers,BQ.DataType.Wrong),k=I.const("indices",h$._`{}`);I.for(h$._`;${A}--;`,()=>{if(I.let(V,h$._`${U}[${A}]`),I.if(q,h$._`continue`),G.length>1)I.if(h$._`typeof ${V} == "string"`,h$._`${V} += "_"`);I.if(h$._`typeof ${k}[${V}] == "number"`,()=>{I.assign(O,h$._`${k}[${V}]`),$.error(),I.assign(Q,!1).break()}).code(h$._`${k}[${V}] = ${A}`)})}function J(A,O){let V=qZ.useFunc(I,FZ.default),q=I.name("outer");I.label(q).for(h$._`;${A}--;`,()=>I.for(h$._`${O} = ${A}; ${O}--;`,()=>I.if(h$._`${V}(${U}[${A}], ${U}[${O}])`,()=>{$.error(),I.assign(Q,!1).break(q)})))}}};IK.default=jZ});var bK=Z((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});var JQ=a(),SZ=W$(),PZ=Sb(),kZ={message:"must be equal to constant",params:({schemaCode:$})=>JQ._`{allowedValue: ${$}}`},RZ={keyword:"const",$data:!0,error:kZ,code($){let{gen:I,data:U,$data:b,schemaCode:w,schema:X}=$;if(b||X&&typeof X=="object")$.fail$data(JQ._`!${SZ.useFunc(I,PZ.default)}(${U}, ${w})`);else $.fail(JQ._`${X} !== ${U}`)}};wK.default=RZ});var DK=Z((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});var PU=a(),_Z=W$(),ZZ=Sb(),CZ={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>PU._`{allowedValues: ${$}}`},gZ={keyword:"enum",schemaType:"array",$data:!0,error:CZ,code($){let{gen:I,data:U,$data:b,schema:w,schemaCode:X,it:D}=$;if(!b&&w.length===0)throw new Error("enum must have non-empty array");let W=w.length>=D.opts.loopEnum,Q,G=()=>Q!==null&&Q!==void 0?Q:Q=_Z.useFunc(I,ZZ.default),N;if(W||b)N=I.let("valid"),$.block$data(N,B);else{if(!Array.isArray(w))throw new Error("ajv implementation error");let J=I.const("vSchema",X);N=PU.or(...w.map((A,O)=>H(J,O)))}$.pass(N);function B(){I.assign(N,!1),I.forOf("v",X,(J)=>I.if(PU._`${G()}(${U}, ${J})`,()=>I.assign(N,!0).break()))}function H(J,A){let O=w[A];return typeof O==="object"&&O!==null?PU._`${G()}(${U}, ${J}[${A}])`:PU._`${U} === ${O}`}}};XK.default=gZ});var QK=Z((WK)=>{Object.defineProperty(WK,"__esModule",{value:!0});var hZ=hL(),fZ=yL(),yZ=rL(),uZ=iL(),lZ=dL(),cZ=tL(),mZ=eL(),rZ=UK(),nZ=bK(),iZ=DK(),oZ=[hZ.default,fZ.default,yZ.default,uZ.default,lZ.default,cZ.default,mZ.default,rZ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nZ.default,iZ.default];WK.default=oZ});var AQ=Z((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});NK.validateAdditionalItems=void 0;var s4=a(),HQ=W$(),pZ={message:({params:{len:$}})=>s4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>s4._`{limit: ${$}}`},tZ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:pZ,code($){let{parentSchema:I,it:U}=$,{items:b}=I;if(!Array.isArray(b)){HQ.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}GK($,b)}};function GK($,I){let{gen:U,schema:b,data:w,keyword:X,it:D}=$;D.items=!0;let W=U.const("len",s4._`${w}.length`);if(b===!1)$.setParams({len:I.length}),$.pass(s4._`${W} <= ${I.length}`);else if(typeof b=="object"&&!HQ.alwaysValidSchema(D,b)){let G=U.var("valid",s4._`${W} <= ${I.length}`);U.if(s4.not(G),()=>Q(G)),$.ok(G)}function Q(G){U.forRange("i",I.length,W,(N)=>{if($.subschema({keyword:X,dataProp:N,dataPropType:HQ.Type.Num},G),!D.allErrors)U.if(s4.not(G),()=>U.break())})}}NK.validateAdditionalItems=GK;NK.default=tZ});var OQ=Z((HK)=>{Object.defineProperty(HK,"__esModule",{value:!0});HK.validateTuple=void 0;var BK=a(),Pb=W$(),eZ=O6(),sZ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return JK($,"additionalItems",I);if(U.items=!0,Pb.alwaysValidSchema(U,I))return;$.ok(eZ.validateArray($))}};function JK($,I,U=$.schema){let{gen:b,parentSchema:w,data:X,keyword:D,it:W}=$;if(N(w),W.opts.unevaluated&&U.length&&W.items!==!0)W.items=Pb.mergeEvaluated.items(b,U.length,W.items);let Q=b.name("valid"),G=b.const("len",BK._`${X}.length`);U.forEach((B,H)=>{if(Pb.alwaysValidSchema(W,B))return;b.if(BK._`${G} > ${H}`,()=>$.subschema({keyword:D,schemaProp:H,dataProp:H},Q)),$.ok(Q)});function N(B){let{opts:H,errSchemaPath:J}=W,A=U.length,O=A===B.minItems&&(A===B.maxItems||B[I]===!1);if(H.strictTuples&&!O){let V=`"${D}" is ${A}-tuple, but minItems or maxItems/${I} are not specified or different at path "${J}"`;Pb.checkStrictMode(W,V,H.strictTuples)}}}HK.validateTuple=JK;HK.default=sZ});var zK=Z((OK)=>{Object.defineProperty(OK,"__esModule",{value:!0});var IC=OQ(),UC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>IC.validateTuple($,"items")};OK.default=UC});var vK=Z((KK)=>{Object.defineProperty(KK,"__esModule",{value:!0});var LK=a(),bC=W$(),XC=O6(),DC=AQ(),WC={message:({params:{len:$}})=>LK.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>LK._`{limit: ${$}}`},QC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:WC,code($){let{schema:I,parentSchema:U,it:b}=$,{prefixItems:w}=U;if(b.items=!0,bC.alwaysValidSchema(b,I))return;if(w)DC.validateAdditionalItems($,w);else $.ok(XC.validateArray($))}};KK.default=QC});var qK=Z((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});var z6=a(),kb=W$(),NC={message:({params:{min:$,max:I}})=>I===void 0?z6.str`must contain at least ${$} valid item(s)`:z6.str`must contain at least ${$} and no more than ${I} valid item(s)`,params:({params:{min:$,max:I}})=>I===void 0?z6._`{minContains: ${$}}`:z6._`{minContains: ${$}, maxContains: ${I}}`},YC={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:NC,code($){let{gen:I,schema:U,parentSchema:b,data:w,it:X}=$,D,W,{minContains:Q,maxContains:G}=b;if(X.opts.next)D=Q===void 0?1:Q,W=G;else D=1;let N=I.const("len",z6._`${w}.length`);if($.setParams({min:D,max:W}),W===void 0&&D===0){kb.checkStrictMode(X,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(W!==void 0&&D>W){kb.checkStrictMode(X,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(kb.alwaysValidSchema(X,U)){let O=z6._`${N} >= ${D}`;if(W!==void 0)O=z6._`${O} && ${N} <= ${W}`;$.pass(O);return}X.items=!0;let B=I.name("valid");if(W===void 0&&D===1)J(B,()=>I.if(B,()=>I.break()));else if(D===0){if(I.let(B,!0),W!==void 0)I.if(z6._`${w}.length > 0`,H)}else I.let(B,!1),H();$.result(B,()=>$.reset());function H(){let O=I.name("_valid"),V=I.let("count",0);J(O,()=>I.if(O,()=>A(V)))}function J(O,V){I.forRange("i",0,N,(q)=>{$.subschema({keyword:"contains",dataProp:q,dataPropType:kb.Type.Num,compositeRule:!0},O),V()})}function A(O){if(I.code(z6._`${O}++`),W===void 0)I.if(z6._`${O} >= ${D}`,()=>I.assign(B,!0).break());else if(I.if(z6._`${O} > ${W}`,()=>I.assign(B,!1).break()),D===1)I.assign(B,!0);else I.if(z6._`${O} >= ${D}`,()=>I.assign(B,!0))}}};VK.default=YC});var PK=Z((jK)=>{Object.defineProperty(jK,"__esModule",{value:!0});jK.validateSchemaDeps=jK.validatePropertyDeps=jK.error=void 0;var zQ=a(),JC=W$(),kU=O6();jK.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let b=I===1?"property":"properties";return zQ.str`must have ${b} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:b}})=>zQ._`{property: ${$},
7
7
  missingProperty: ${b},
8
8
  depsCount: ${I},
9
- deps: ${U}}`};var JC={keyword:"dependencies",type:"object",schemaType:"object",error:MK.error,code($){let[I,U]=HC($);qK($,I),FK($,U)}};function HC({schema:$}){let I={},U={};for(let b in $){if(b==="__proto__")continue;let w=Array.isArray($[b])?I:U;w[b]=$[b]}return[I,U]}function qK($,I=$.schema){let{gen:U,data:b,it:w}=$;if(Object.keys(I).length===0)return;let X=U.let("missing");for(let D in I){let W=I[D];if(W.length===0)continue;let Q=kU.propertyInData(U,b,D,w.opts.ownProperties);if($.setParams({property:D,depsCount:W.length,deps:W.join(", ")}),w.allErrors)U.if(Q,()=>{for(let G of W)kU.checkReportMissingProp($,G)});else U.if(zQ._`${Q} && (${kU.checkMissingProp($,W,X)})`),kU.reportMissingProp($,X),U.else()}}MK.validatePropertyDeps=qK;function FK($,I=$.schema){let{gen:U,data:b,keyword:w,it:X}=$,D=U.name("valid");for(let W in I){if(BC.alwaysValidSchema(X,I[W]))continue;U.if(kU.propertyInData(U,b,W,X.opts.ownProperties),()=>{let Q=$.subschema({keyword:w,schemaProp:W},D);$.mergeValidEvaluated(Q,D)},()=>U.var(D,!0)),$.ok(D)}}MK.validateSchemaDeps=FK;MK.default=JC});var RK=Z((kK)=>{Object.defineProperty(kK,"__esModule",{value:!0});var PK=a(),zC=W$(),LC={message:"property name must be valid",params:({params:$})=>PK._`{propertyName: ${$.propertyName}}`},KC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:LC,code($){let{gen:I,schema:U,data:b,it:w}=$;if(zC.alwaysValidSchema(w,U))return;let X=I.name("valid");I.forIn("key",b,(D)=>{$.setParams({propertyName:D}),$.subschema({keyword:"propertyNames",data:D,dataTypes:["string"],propertyName:D,compositeRule:!0},X),I.if(PK.not(X),()=>{if($.error(!0),!w.allErrors)I.break()})}),$.ok(X)}};kK.default=KC});var LQ=Z((TK)=>{Object.defineProperty(TK,"__esModule",{value:!0});var Rb=O6(),k6=a(),VC=s6(),Tb=W$(),qC={message:"must NOT have additional properties",params:({params:$})=>k6._`{additionalProperty: ${$.additionalProperty}}`},FC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qC,code($){let{gen:I,schema:U,parentSchema:b,data:w,errsCount:X,it:D}=$;if(!X)throw new Error("ajv implementation error");let{allErrors:W,opts:Q}=D;if(D.props=!0,Q.removeAdditional!=="all"&&Tb.alwaysValidSchema(D,U))return;let G=Rb.allSchemaProperties(b.properties),N=Rb.allSchemaProperties(b.patternProperties);B(),$.ok(k6._`${X} === ${VC.default.errors}`);function B(){I.forIn("key",w,(V)=>{if(!G.length&&!N.length)A(V);else I.if(H(V),()=>A(V))})}function H(V){let q;if(G.length>8){let k=Tb.schemaRefOrVal(D,b.properties,"properties");q=Rb.isOwnProperty(I,k,V)}else if(G.length)q=k6.or(...G.map((k)=>k6._`${V} === ${k}`));else q=k6.nil;if(N.length)q=k6.or(q,...N.map((k)=>k6._`${Rb.usePattern($,k)}.test(${V})`));return k6.not(q)}function J(V){I.code(k6._`delete ${w}[${V}]`)}function A(V){if(Q.removeAdditional==="all"||Q.removeAdditional&&U===!1){J(V);return}if(U===!1){if($.setParams({additionalProperty:V}),$.error(),!W)I.break();return}if(typeof U=="object"&&!Tb.alwaysValidSchema(D,U)){let q=I.name("valid");if(Q.removeAdditional==="failing")O(V,q,!1),I.if(k6.not(q),()=>{$.reset(),J(V)});else if(O(V,q),!W)I.if(k6.not(q),()=>I.break())}}function O(V,q,k){let P={keyword:"additionalProperties",dataProp:V,dataPropType:Tb.Type.Str};if(k===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,q)}}};TK.default=FC});var gK=Z((CK)=>{Object.defineProperty(CK,"__esModule",{value:!0});var jC=zU(),_K=O6(),KQ=W$(),ZK=LQ(),EC={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:b,data:w,it:X}=$;if(X.opts.removeAdditional==="all"&&b.additionalProperties===void 0)ZK.default.code(new jC.KeywordCxt(X,ZK.default,"additionalProperties"));let D=_K.allSchemaProperties(U);for(let B of D)X.definedProperties.add(B);if(X.opts.unevaluated&&D.length&&X.props!==!0)X.props=KQ.mergeEvaluated.props(I,KQ.toHash(D),X.props);let W=D.filter((B)=>!KQ.alwaysValidSchema(X,U[B]));if(W.length===0)return;let Q=I.name("valid");for(let B of W){if(G(B))N(B);else{if(I.if(_K.propertyInData(I,w,B,X.opts.ownProperties)),N(B),!X.allErrors)I.else().var(Q,!0);I.endIf()}$.it.definedProperties.add(B),$.ok(Q)}function G(B){return X.opts.useDefaults&&!X.compositeRule&&U[B].default!==void 0}function N(B){$.subschema({keyword:"properties",schemaProp:B,dataProp:B},Q)}}};CK.default=EC});var uK=Z((yK)=>{Object.defineProperty(yK,"__esModule",{value:!0});var xK=O6(),_b=a(),hK=W$(),fK=W$(),PC={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:b,parentSchema:w,it:X}=$,{opts:D}=X,W=xK.allSchemaProperties(U),Q=W.filter((O)=>hK.alwaysValidSchema(X,U[O]));if(W.length===0||Q.length===W.length&&(!X.opts.unevaluated||X.props===!0))return;let G=D.strictSchema&&!D.allowMatchingProperties&&w.properties,N=I.name("valid");if(X.props!==!0&&!(X.props instanceof _b.Name))X.props=fK.evaluatedPropsToName(I,X.props);let{props:B}=X;H();function H(){for(let O of W){if(G)J(O);if(X.allErrors)A(O);else I.var(N,!0),A(O),I.if(N)}}function J(O){for(let V in G)if(new RegExp(O).test(V))hK.checkStrictMode(X,`property ${V} matches pattern ${O} (use allowMatchingProperties)`)}function A(O){I.forIn("key",b,(V)=>{I.if(_b._`${xK.usePattern($,O)}.test(${V})`,()=>{let q=Q.includes(O);if(!q)$.subschema({keyword:"patternProperties",schemaProp:O,dataProp:V,dataPropType:fK.Type.Str},N);if(X.opts.unevaluated&&B!==!0)I.assign(_b._`${B}[${V}]`,!0);else if(!q&&!X.allErrors)I.if(_b.not(N),()=>I.break())})})}}};yK.default=PC});var cK=Z((lK)=>{Object.defineProperty(lK,"__esModule",{value:!0});var RC=W$(),TC={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:b}=$;if(RC.alwaysValidSchema(b,U)){$.fail();return}let w=I.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},w),$.failResult(w,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};lK.default=TC});var rK=Z((mK)=>{Object.defineProperty(mK,"__esModule",{value:!0});var ZC=O6(),CC={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ZC.validateUnion,error:{message:"must match a schema in anyOf"}};mK.default=CC});var iK=Z((nK)=>{Object.defineProperty(nK,"__esModule",{value:!0});var Zb=a(),xC=W$(),hC={message:"must match exactly one schema in oneOf",params:({params:$})=>Zb._`{passingSchemas: ${$.passing}}`},fC={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:hC,code($){let{gen:I,schema:U,parentSchema:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(w.opts.discriminator&&b.discriminator)return;let X=U,D=I.let("valid",!1),W=I.let("passing",null),Q=I.name("_valid");$.setParams({passing:W}),I.block(G),$.result(D,()=>$.reset(),()=>$.error(!0));function G(){X.forEach((N,B)=>{let H;if(xC.alwaysValidSchema(w,N))I.var(Q,!0);else H=$.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},Q);if(B>0)I.if(Zb._`${Q} && ${D}`).assign(D,!1).assign(W,Zb._`[${W}, ${B}]`).else();I.if(Q,()=>{if(I.assign(D,!0),I.assign(W,B),H)$.mergeEvaluated(H,Zb.Name)})})}}};nK.default=fC});var dK=Z((oK)=>{Object.defineProperty(oK,"__esModule",{value:!0});var uC=W$(),lC={keyword:"allOf",schemaType:"array",code($){let{gen:I,schema:U,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");let w=I.name("valid");U.forEach((X,D)=>{if(uC.alwaysValidSchema(b,X))return;let W=$.subschema({keyword:"allOf",schemaProp:D},w);$.ok(w),$.mergeEvaluated(W)})}};oK.default=lC});var eK=Z((aK)=>{Object.defineProperty(aK,"__esModule",{value:!0});var Cb=a(),tK=W$(),mC={message:({params:$})=>Cb.str`must match "${$.ifClause}" schema`,params:({params:$})=>Cb._`{failingKeyword: ${$.ifClause}}`},rC={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:mC,code($){let{gen:I,parentSchema:U,it:b}=$;if(U.then===void 0&&U.else===void 0)tK.checkStrictMode(b,'"if" without "then" and "else" is ignored');let w=pK(b,"then"),X=pK(b,"else");if(!w&&!X)return;let D=I.let("valid",!0),W=I.name("_valid");if(Q(),$.reset(),w&&X){let N=I.let("ifClause");$.setParams({ifClause:N}),I.if(W,G("then",N),G("else",N))}else if(w)I.if(W,G("then"));else I.if(Cb.not(W),G("else"));$.pass(D,()=>$.error(!0));function Q(){let N=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},W);$.mergeEvaluated(N)}function G(N,B){return()=>{let H=$.subschema({keyword:N},W);if(I.assign(D,W),$.mergeValidEvaluated(H,D),B)I.assign(B,Cb._`${N}`);else $.setParams({ifClause:N})}}}};function pK($,I){let U=$.schema[I];return U!==void 0&&!tK.alwaysValidSchema($,U)}aK.default=rC});var $v=Z((sK)=>{Object.defineProperty(sK,"__esModule",{value:!0});var iC=W$(),oC={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)iC.checkStrictMode(U,`"${$}" without "if" is ignored`)}};sK.default=oC});var Uv=Z((Iv)=>{Object.defineProperty(Iv,"__esModule",{value:!0});var pC=AQ(),tC=OK(),aC=OQ(),eC=KK(),sC=VK(),$g=SK(),Ig=RK(),Ug=LQ(),wg=gK(),bg=uK(),Xg=cK(),Dg=rK(),Wg=iK(),Qg=dK(),Gg=eK(),Ng=$v();function Yg($=!1){let I=[Xg.default,Dg.default,Wg.default,Qg.default,Gg.default,Ng.default,Ig.default,Ug.default,$g.default,wg.default,bg.default];if($)I.push(tC.default,eC.default);else I.push(pC.default,aC.default);return I.push(sC.default),I}Iv.default=Yg});var bv=Z((wv)=>{Object.defineProperty(wv,"__esModule",{value:!0});var S$=a(),Jg={message:({schemaCode:$})=>S$.str`must match format "${$}"`,params:({schemaCode:$})=>S$._`{format: ${$}}`},Hg={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Jg,code($,I){let{gen:U,data:b,$data:w,schema:X,schemaCode:D,it:W}=$,{opts:Q,errSchemaPath:G,schemaEnv:N,self:B}=W;if(!Q.validateFormats)return;if(w)H();else J();function H(){let A=U.scopeValue("formats",{ref:B.formats,code:Q.code.formats}),O=U.const("fDef",S$._`${A}[${D}]`),V=U.let("fType"),q=U.let("format");U.if(S$._`typeof ${O} == "object" && !(${O} instanceof RegExp)`,()=>U.assign(V,S$._`${O}.type || "string"`).assign(q,S$._`${O}.validate`),()=>U.assign(V,S$._`"string"`).assign(q,O)),$.fail$data(S$.or(k(),P()));function k(){if(Q.strictSchema===!1)return S$.nil;return S$._`${D} && !${q}`}function P(){let x=N.$async?S$._`(${O}.async ? await ${q}(${b}) : ${q}(${b}))`:S$._`${q}(${b})`,l=S$._`(typeof ${q} == "function" ? ${x} : ${q}.test(${b}))`;return S$._`${q} && ${q} !== true && ${V} === ${I} && !${l}`}}function J(){let A=B.formats[X];if(!A){k();return}if(A===!0)return;let[O,V,q]=P(A);if(O===I)$.pass(x());function k(){if(Q.strictSchema===!1){B.logger.warn(l());return}throw new Error(l());function l(){return`unknown format "${X}" ignored in schema at path "${G}"`}}function P(l){let l$=l instanceof RegExp?S$.regexpCode(l):Q.code.formats?S$._`${Q.code.formats}${S$.getProperty(X)}`:void 0,Y6=U.scopeValue("formats",{key:X,ref:l,code:l$});if(typeof l=="object"&&!(l instanceof RegExp))return[l.type||"string",l.validate,S$._`${Y6}.validate`];return["string",l,Y6]}function x(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!N.$async)throw new Error("async format in sync schema");return S$._`await ${q}(${b})`}return typeof V=="function"?S$._`${q}(${b})`:S$._`${q}.test(${b})`}}}};wv.default=Hg});var Dv=Z((Xv)=>{Object.defineProperty(Xv,"__esModule",{value:!0});var Og=bv(),zg=[Og.default];Xv.default=zg});var Gv=Z((Wv)=>{Object.defineProperty(Wv,"__esModule",{value:!0});Wv.contentVocabulary=Wv.metadataVocabulary=void 0;Wv.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Wv.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Bv=Z((Yv)=>{Object.defineProperty(Yv,"__esModule",{value:!0});var vg=CL(),Vg=WK(),qg=Uv(),Fg=Dv(),Nv=Gv(),Mg=[vg.default,Vg.default,qg.default(),Fg.default,Nv.metadataVocabulary,Nv.contentVocabulary];Yv.default=Mg});var Ov=Z((Hv)=>{Object.defineProperty(Hv,"__esModule",{value:!0});Hv.DiscrError=void 0;var Jv;(function($){$.Tag="tag",$.Mapping="mapping"})(Jv||(Hv.DiscrError=Jv={}))});var Kv=Z((Lv)=>{Object.defineProperty(Lv,"__esModule",{value:!0});var g1=a(),vQ=Ov(),zv=Ab(),Eg=LU(),Sg=W$(),Pg={message:({params:{discrError:$,tagName:I}})=>$===vQ.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>g1._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},kg={keyword:"discriminator",type:"object",schemaType:"object",error:Pg,code($){let{gen:I,data:U,schema:b,parentSchema:w,it:X}=$,{oneOf:D}=w;if(!X.opts.discriminator)throw new Error("discriminator: requires discriminator option");let W=b.propertyName;if(typeof W!="string")throw new Error("discriminator: requires propertyName");if(b.mapping)throw new Error("discriminator: mapping is not supported");if(!D)throw new Error("discriminator: requires oneOf keyword");let Q=I.let("valid",!1),G=I.const("tag",g1._`${U}${g1.getProperty(W)}`);I.if(g1._`typeof ${G} == "string"`,()=>N(),()=>$.error(!1,{discrError:vQ.DiscrError.Tag,tag:G,tagName:W})),$.ok(Q);function N(){let J=H();I.if(!1);for(let A in J)I.elseIf(g1._`${G} === ${A}`),I.assign(Q,B(J[A]));I.else(),$.error(!1,{discrError:vQ.DiscrError.Mapping,tag:G,tagName:W}),I.endIf()}function B(J){let A=I.name("valid"),O=$.subschema({keyword:"oneOf",schemaProp:J},A);return $.mergeEvaluated(O,g1.Name),A}function H(){var J;let A={},O=q(w),V=!0;for(let x=0;x<D.length;x++){let l=D[x];if((l===null||l===void 0?void 0:l.$ref)&&!Sg.schemaHasRulesButRef(l,X.self.RULES)){let Y6=l.$ref;if(l=zv.resolveRef.call(X.self,X.schemaEnv.root,X.baseId,Y6),l instanceof zv.SchemaEnv)l=l.schema;if(l===void 0)throw new Eg.default(X.opts.uriResolver,X.baseId,Y6)}let l$=(J=l===null||l===void 0?void 0:l.properties)===null||J===void 0?void 0:J[W];if(typeof l$!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${W}"`);V=V&&(O||q(l)),k(l$,x)}if(!V)throw new Error(`discriminator: "${W}" must be required`);return A;function q({required:x}){return Array.isArray(x)&&x.includes(W)}function k(x,l){if(x.const)P(x.const,l);else if(x.enum)for(let l$ of x.enum)P(l$,l);else throw new Error(`discriminator: "properties/${W}" must have "const" or "enum"`)}function P(x,l){if(typeof x!="string"||x in A)throw new Error(`discriminator: "${W}" values must be unique strings`);A[x]=l}}}};Lv.default=kg});var vv=Z((ho,Tg)=>{Tg.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}});var qQ=Z((I6,VQ)=>{Object.defineProperty(I6,"__esModule",{value:!0});I6.MissingRefError=I6.ValidationError=I6.CodeGen=I6.Name=I6.nil=I6.stringify=I6.str=I6._=I6.KeywordCxt=I6.Ajv=void 0;var _g=ML(),Zg=Bv(),Cg=Kv(),Vv=vv(),gg=["/properties"],gb="http://json-schema.org/draft-07/schema";class RU extends _g.default{_addVocabularies(){if(super._addVocabularies(),Zg.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(Cg.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(Vv,gg):Vv;this.addMetaSchema($,gb,!1),this.refs["http://json-schema.org/schema"]=gb}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(gb)?gb:void 0)}}I6.Ajv=RU;VQ.exports=I6=RU;VQ.exports.Ajv=RU;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=RU;var xg=zU();Object.defineProperty(I6,"KeywordCxt",{enumerable:!0,get:function(){return xg.KeywordCxt}});var x1=a();Object.defineProperty(I6,"_",{enumerable:!0,get:function(){return x1._}});Object.defineProperty(I6,"str",{enumerable:!0,get:function(){return x1.str}});Object.defineProperty(I6,"stringify",{enumerable:!0,get:function(){return x1.stringify}});Object.defineProperty(I6,"nil",{enumerable:!0,get:function(){return x1.nil}});Object.defineProperty(I6,"Name",{enumerable:!0,get:function(){return x1.Name}});Object.defineProperty(I6,"CodeGen",{enumerable:!0,get:function(){return x1.CodeGen}});var hg=Jb();Object.defineProperty(I6,"ValidationError",{enumerable:!0,get:function(){return hg.default}});var fg=LU();Object.defineProperty(I6,"MissingRefError",{enumerable:!0,get:function(){return fg.default}})});var Tv=Z((kv)=>{Object.defineProperty(kv,"__esModule",{value:!0});kv.formatNames=kv.fastFormats=kv.fullFormats=void 0;function y6($,I){return{validate:$,compare:I}}kv.fullFormats={date:y6(jv,EQ),time:y6(MQ(!0),SQ),"date-time":y6(qv(!0),Sv),"iso-time":y6(MQ(),Ev),"iso-date-time":y6(qv(),Pv),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:ig,"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:sg,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:og,int32:{type:"number",validate:tg},int64:{type:"number",validate:ag},float:{type:"number",validate:Mv},double:{type:"number",validate:Mv},password:!0,binary:!0};kv.fastFormats={...kv.fullFormats,date:y6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,EQ),time:y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,SQ),"date-time":y6(/^\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,Sv),"iso-time":y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ev),"iso-date-time":y6(/^\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,Pv),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};kv.formatNames=Object.keys(kv.fullFormats);function lg($){return $%4===0&&($%100!==0||$%400===0)}var cg=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,mg=[0,31,28,31,30,31,30,31,31,30,31,30,31];function jv($){let I=cg.exec($);if(!I)return!1;let U=+I[1],b=+I[2],w=+I[3];return b>=1&&b<=12&&w>=1&&w<=(b===2&&lg(U)?29:mg[b])}function EQ($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var FQ=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function MQ($){return function I(U){let b=FQ.exec(U);if(!b)return!1;let w=+b[1],X=+b[2],D=+b[3],W=b[4],Q=b[5]==="-"?-1:1,G=+(b[6]||0),N=+(b[7]||0);if(G>23||N>59||$&&!W)return!1;if(w<=23&&X<=59&&D<60)return!0;let B=X-N*Q,H=w-G*Q-(B<0?1:0);return(H===23||H===-1)&&(B===59||B===-1)&&D<61}}function SQ($,I){if(!($&&I))return;let U=new Date("2020-01-01T"+$).valueOf(),b=new Date("2020-01-01T"+I).valueOf();if(!(U&&b))return;return U-b}function Ev($,I){if(!($&&I))return;let U=FQ.exec($),b=FQ.exec(I);if(!(U&&b))return;if($=U[1]+U[2]+U[3],I=b[1]+b[2]+b[3],$>I)return 1;if($<I)return-1;return 0}var jQ=/t|\s/i;function qv($){let I=MQ($);return function U(b){let w=b.split(jQ);return w.length===2&&jv(w[0])&&I(w[1])}}function Sv($,I){if(!($&&I))return;let U=new Date($).valueOf(),b=new Date(I).valueOf();if(!(U&&b))return;return U-b}function Pv($,I){if(!($&&I))return;let[U,b]=$.split(jQ),[w,X]=I.split(jQ),D=EQ(U,w);if(D===void 0)return;return D||SQ(b,X)}var rg=/\/|:/,ng=/^(?:[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 ig($){return rg.test($)&&ng.test($)}var Fv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function og($){return Fv.lastIndex=0,Fv.test($)}var dg=-2147483648,pg=2147483647;function tg($){return Number.isInteger($)&&$<=pg&&$>=dg}function ag($){return Number.isInteger($)}function Mv(){return!0}var eg=/[^\\]\\Z/;function sg($){if(eg.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var Zv=Z((_v)=>{Object.defineProperty(_v,"__esModule",{value:!0});_v.formatLimitDefinition=void 0;var Ix=qQ(),R6=a(),q4=R6.operators,xb={formatMaximum:{okStr:"<=",ok:q4.LTE,fail:q4.GT},formatMinimum:{okStr:">=",ok:q4.GTE,fail:q4.LT},formatExclusiveMaximum:{okStr:"<",ok:q4.LT,fail:q4.GTE},formatExclusiveMinimum:{okStr:">",ok:q4.GT,fail:q4.LTE}},Ux={message:({keyword:$,schemaCode:I})=>R6.str`should be ${xb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>R6._`{comparison: ${xb[$].okStr}, limit: ${I}}`};_v.formatLimitDefinition={keyword:Object.keys(xb),type:"string",schemaType:"string",$data:!0,error:Ux,code($){let{gen:I,data:U,schemaCode:b,keyword:w,it:X}=$,{opts:D,self:W}=X;if(!D.validateFormats)return;let Q=new Ix.KeywordCxt(X,W.RULES.all.format.definition,"format");if(Q.$data)G();else N();function G(){let H=I.scopeValue("formats",{ref:W.formats,code:D.code.formats}),J=I.const("fmt",R6._`${H}[${Q.schemaCode}]`);$.fail$data(R6.or(R6._`typeof ${J} != "object"`,R6._`${J} instanceof RegExp`,R6._`typeof ${J}.compare != "function"`,B(J)))}function N(){let H=Q.schema,J=W.formats[H];if(!J||J===!0)return;if(typeof J!="object"||J instanceof RegExp||typeof J.compare!="function")throw new Error(`"${w}": format "${H}" does not define "compare" function`);let A=I.scopeValue("formats",{key:H,ref:J,code:D.code.formats?R6._`${D.code.formats}${R6.getProperty(H)}`:void 0});$.fail$data(B(A))}function B(H){return R6._`${H}.compare(${U}, ${b}) ${xb[w].fail} 0`}},dependencies:["format"]};var wx=($)=>{return $.addKeyword(_v.formatLimitDefinition),$};_v.default=wx});var hv=Z((TU,xv)=>{Object.defineProperty(TU,"__esModule",{value:!0});var h1=Tv(),Xx=Zv(),RQ=a(),Cv=new RQ.Name("fullFormats"),Dx=new RQ.Name("fastFormats"),TQ=($,I={keywords:!0})=>{if(Array.isArray(I))return gv($,I,h1.fullFormats,Cv),$;let[U,b]=I.mode==="fast"?[h1.fastFormats,Dx]:[h1.fullFormats,Cv],w=I.formats||h1.formatNames;if(gv($,w,U,b),I.keywords)Xx.default($);return $};TQ.get=($,I="full")=>{let b=(I==="fast"?h1.fastFormats:h1.fullFormats)[$];if(!b)throw new Error(`Unknown format "${$}"`);return b};function gv($,I,U,b){var w,X;(w=(X=$.opts.code).formats)!==null&&w!==void 0||(X.formats=RQ._`require("ajv-formats/dist/formats").${b}`);for(let D of I)$.addFormat(D,U[D])}xv.exports=TU=TQ;Object.defineProperty(TU,"__esModule",{value:!0});TU.default=TQ});var $$;(function($){$.assertEqual=(w)=>{};function I(w){}$.assertIs=I;function U(w){throw new Error}$.assertNever=U,$.arrayToEnum=(w)=>{let X={};for(let D of w)X[D]=D;return X},$.getValidEnumValues=(w)=>{let X=$.objectKeys(w).filter((W)=>typeof w[w[W]]!=="number"),D={};for(let W of X)D[W]=w[W];return $.objectValues(D)},$.objectValues=(w)=>{return $.objectKeys(w).map(function(X){return w[X]})},$.objectKeys=typeof Object.keys==="function"?(w)=>Object.keys(w):(w)=>{let X=[];for(let D in w)if(Object.prototype.hasOwnProperty.call(w,D))X.push(D);return X},$.find=(w,X)=>{for(let D of w)if(X(D))return D;return},$.isInteger=typeof Number.isInteger==="function"?(w)=>Number.isInteger(w):(w)=>typeof w==="number"&&Number.isFinite(w)&&Math.floor(w)===w;function b(w,X=" | "){return w.map((D)=>typeof D==="string"?`'${D}'`:D).join(X)}$.joinValues=b,$.jsonStringifyReplacer=(w,X)=>{if(typeof X==="bigint")return X.toString();return X}})($$||($$={}));var LH;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(LH||(LH={}));var R=$$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o6=($)=>{switch(typeof $){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN($)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":if(Array.isArray($))return R.array;if($===null)return R.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return R.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return R.map;if(typeof Set!=="undefined"&&$ instanceof Set)return R.set;if(typeof Date!=="undefined"&&$ instanceof Date)return R.date;return R.object;default:return R.unknown}};var F=$$.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 X6 extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(U)=>{this.issues=[...this.issues,U]},this.addIssues=(U=[])=>{this.issues=[...this.issues,...U]};let I=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,I);else this.__proto__=I;this.name="ZodError",this.issues=$}format($){let I=$||function(w){return w.message},U={_errors:[]},b=(w)=>{for(let X of w.issues)if(X.code==="invalid_union")X.unionErrors.map(b);else if(X.code==="invalid_return_type")b(X.returnTypeError);else if(X.code==="invalid_arguments")b(X.argumentsError);else if(X.path.length===0)U._errors.push(I(X));else{let D=U,W=0;while(W<X.path.length){let Q=X.path[W];if(W!==X.path.length-1)D[Q]=D[Q]||{_errors:[]};else D[Q]=D[Q]||{_errors:[]},D[Q]._errors.push(I(X));D=D[Q],W++}}};return b(this),U}static assert($){if(!($ instanceof X6))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(I)=>I.message){let I={},U=[];for(let b of this.issues)if(b.path.length>0){let w=b.path[0];I[w]=I[w]||[],I[w].push($(b))}else U.push($(b));return{formErrors:U,fieldErrors:I}}get formErrors(){return this.flatten()}}X6.create=($)=>{return new X6($)};var uM=($,I)=>{let U;switch($.code){case F.invalid_type:if($.received===R.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case F.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,$$.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:U=`Unrecognized key(s) in object: ${$$.joinValues($.keys,", ")}`;break;case F.invalid_union:U="Invalid input";break;case F.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${$$.joinValues($.options)}`;break;case F.invalid_enum_value:U=`Invalid enum value. Expected ${$$.joinValues($.options)}, received '${$.received}'`;break;case F.invalid_arguments:U="Invalid function arguments";break;case F.invalid_return_type:U="Invalid function return type";break;case F.invalid_date:U="Invalid date";break;case F.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(U=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")U=`${U} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)U=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)U=`Invalid input: must end with "${$.validation.endsWith}"`;else $$.assertNever($.validation);else if($.validation!=="regex")U=`Invalid ${$.validation}`;else U="Invalid";break;case F.too_small:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else U="Invalid input";break;case F.too_big:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")U=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else U="Invalid input";break;case F.custom:U="Invalid input";break;case F.invalid_intersection_types:U="Intersection results could not be merged";break;case F.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case F.not_finite:U="Number must be finite";break;default:U=I.defaultError,$$.assertNever($)}return{message:U}},W4=uM;var lM=W4;function EI(){return lM}var t0=($)=>{let{data:I,path:U,errorMaps:b,issueData:w}=$,X=[...U,...w.path||[]],D={...w,path:X};if(w.message!==void 0)return{...w,path:X,message:w.message};let W="",Q=b.filter((G)=>!!G).slice().reverse();for(let G of Q)W=G(D,{data:I,defaultError:W}).message;return{...w,path:X,message:W}};function T($,I){let U=EI(),b=t0({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===W4?void 0:W4].filter((w)=>!!w)});$.common.issues.push(b)}class f${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,I){let U=[];for(let b of I){if(b.status==="aborted")return r;if(b.status==="dirty")$.dirty();U.push(b.value)}return{status:$.value,value:U}}static async mergeObjectAsync($,I){let U=[];for(let b of I){let w=await b.key,X=await b.value;U.push({key:w,value:X})}return f$.mergeObjectSync($,U)}static mergeObjectSync($,I){let U={};for(let b of I){let{key:w,value:X}=b;if(w.status==="aborted")return r;if(X.status==="aborted")return r;if(w.status==="dirty")$.dirty();if(X.status==="dirty")$.dirty();if(w.value!=="__proto__"&&(typeof X.value!=="undefined"||b.alwaysSet))U[w.value]=X.value}return{status:$.value,value:U}}}var r=Object.freeze({status:"aborted"}),J1=($)=>({status:"dirty",value:$}),c$=($)=>({status:"valid",value:$}),mD=($)=>$.status==="aborted",rD=($)=>$.status==="dirty",f4=($)=>$.status==="valid",SI=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var g;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(g||(g={}));class V6{constructor($,I,U,b){this._cachedPath=[],this.parent=$,this.data=I,this._path=U,this._key=b}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 KH=($,I)=>{if(f4(I))return{success:!0,data:I.value};else{if(!$.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let U=new X6($.common.issues);return this._error=U,this._error}}}};function d($){if(!$)return{};let{errorMap:I,invalid_type_error:U,required_error:b,description:w}=$;if(I&&(U||b))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(I)return{errorMap:I,description:w};return{errorMap:(D,W)=>{let{message:Q}=$;if(D.code==="invalid_enum_value")return{message:Q??W.defaultError};if(typeof W.data==="undefined")return{message:Q??b??W.defaultError};if(D.code!=="invalid_type")return{message:W.defaultError};return{message:Q??U??W.defaultError}},description:w}}class e{get description(){return this._def.description}_getType($){return o6($.data)}_getOrReturnCtx($,I){return I||{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new f$,ctx:{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let I=this._parse($);if(SI(I))throw new Error("Synchronous parse encountered promise.");return I}_parseAsync($){let I=this._parse($);return Promise.resolve(I)}parse($,I){let U=this.safeParse($,I);if(U.success)return U.data;throw U.error}safeParse($,I){let U={common:{issues:[],async:I?.async??!1,contextualErrorMap:I?.errorMap},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)},b=this._parseSync({data:$,path:U.path,parent:U});return KH(U,b)}"~validate"($){let I={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)};if(!this["~standard"].async)try{let U=this._parseSync({data:$,path:[],parent:I});return f4(U)?{value:U.value}:{issues:I.common.issues}}catch(U){if(U?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;I.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:I}).then((U)=>f4(U)?{value:U.value}:{issues:I.common.issues})}async parseAsync($,I){let U=await this.safeParseAsync($,I);if(U.success)return U.data;throw U.error}async safeParseAsync($,I){let U={common:{issues:[],contextualErrorMap:I?.errorMap,async:!0},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)},b=this._parse({data:$,path:U.path,parent:U}),w=await(SI(b)?b:Promise.resolve(b));return KH(U,w)}refine($,I){let U=(b)=>{if(typeof I==="string"||typeof I==="undefined")return{message:I};else if(typeof I==="function")return I(b);else return I};return this._refinement((b,w)=>{let X=$(b),D=()=>w.addIssue({code:F.custom,...U(b)});if(typeof Promise!=="undefined"&&X instanceof Promise)return X.then((W)=>{if(!W)return D(),!1;else return!0});if(!X)return D(),!1;else return!0})}refinement($,I){return this._refinement((U,b)=>{if(!$(U))return b.addIssue(typeof I==="function"?I(U,b):I),!1;else return!0})}_refinement($){return new g6({schema:this,typeName:M.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(I)=>this["~validate"](I)}}optional(){return B6.create(this,this._def)}nullable(){return Q4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return C6.create(this)}promise(){return L1.create(this,this._def)}or($){return _I.create([this,$],this._def)}and($){return ZI.create(this,$,this._def)}transform($){return new g6({...d(this._def),schema:this,typeName:M.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new hI({...d(this._def),innerType:this,defaultValue:I,typeName:M.ZodDefault})}brand(){return new dD({typeName:M.ZodBranded,type:this,...d(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new fI({...d(this._def),innerType:this,catchValue:I,typeName:M.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return bw.create(this,$)}readonly(){return yI.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var cM=/^c[^\s-]{8,}$/i,mM=/^[0-9a-z]+$/,rM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nM=/^[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,iM=/^[a-z0-9_-]{21}$/i,oM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dM=/^[-+]?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)?)??$/,pM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",nD,aM=/^(?:(?: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])$/,eM=/^(?:(?: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])$/,sM=/^(([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]))$/,$j=/^(([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])$/,Ij=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vH="((\\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])))",wj=new RegExp(`^${vH}$`);function VH($){let I="[0-5]\\d";if($.precision)I=`${I}\\.\\d{${$.precision}}`;else if($.precision==null)I=`${I}(\\.\\d+)?`;let U=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${I})${U}`}function bj($){return new RegExp(`^${VH($)}$`)}function Xj($){let I=`${vH}T${VH($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function Dj($,I){if((I==="v4"||!I)&&aM.test($))return!0;if((I==="v6"||!I)&&sM.test($))return!0;return!1}function Wj($,I){if(!oM.test($))return!1;try{let[U]=$.split(".");if(!U)return!1;let b=U.replace(/-/g,"+").replace(/_/g,"/").padEnd(U.length+(4-U.length%4)%4,"="),w=JSON.parse(atob(b));if(typeof w!=="object"||w===null)return!1;if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&w.alg!==I)return!1;return!0}catch{return!1}}function Qj($,I){if((I==="v4"||!I)&&eM.test($))return!0;if((I==="v6"||!I)&&$j.test($))return!0;return!1}class p6 extends e{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==R.string){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.string,received:w.parsedType}),r}let U=new f$,b=void 0;for(let w of this._def.checks)if(w.kind==="min"){if($.data.length<w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),U.dirty()}else if(w.kind==="max"){if($.data.length>w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),U.dirty()}else if(w.kind==="length"){let X=$.data.length>w.value,D=$.data.length<w.value;if(X||D){if(b=this._getOrReturnCtx($,b),X)T(b,{code:F.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});else if(D)T(b,{code:F.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});U.dirty()}}else if(w.kind==="email"){if(!pM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"email",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="emoji"){if(!nD)nD=new RegExp(tM,"u");if(!nD.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"emoji",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="uuid"){if(!nM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"uuid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="nanoid"){if(!iM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"nanoid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid"){if(!cM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid2"){if(!mM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid2",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ulid"){if(!rM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"ulid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="url")try{new URL($.data)}catch{b=this._getOrReturnCtx($,b),T(b,{validation:"url",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="regex"){if(w.regex.lastIndex=0,!w.regex.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"regex",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="trim")$.data=$.data.trim();else if(w.kind==="includes"){if(!$.data.includes(w.value,w.position))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{includes:w.value,position:w.position},message:w.message}),U.dirty()}else if(w.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(w.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(w.kind==="startsWith"){if(!$.data.startsWith(w.value))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{startsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="endsWith"){if(!$.data.endsWith(w.value))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{endsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="datetime"){if(!Xj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"datetime",message:w.message}),U.dirty()}else if(w.kind==="date"){if(!wj.test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"date",message:w.message}),U.dirty()}else if(w.kind==="time"){if(!bj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"time",message:w.message}),U.dirty()}else if(w.kind==="duration"){if(!dM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"duration",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ip"){if(!Dj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"ip",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="jwt"){if(!Wj($.data,w.alg))b=this._getOrReturnCtx($,b),T(b,{validation:"jwt",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cidr"){if(!Qj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"cidr",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64"){if(!Ij.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64url"){if(!Uj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64url",code:F.invalid_string,message:w.message}),U.dirty()}else $$.assertNever(w);return{status:U.value,value:$.data}}_regex($,I,U){return this.refinement((b)=>$.test(b),{validation:I,code:F.invalid_string,...g.errToObj(U)})}_addCheck($){return new p6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...g.errToObj($)})}url($){return this._addCheck({kind:"url",...g.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...g.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...g.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...g.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...g.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...g.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...g.errToObj($)})}base64($){return this._addCheck({kind:"base64",...g.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...g.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...g.errToObj($)})}ip($){return this._addCheck({kind:"ip",...g.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...g.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision==="undefined"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...g.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision==="undefined"?null:$?.precision,...g.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...g.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...g.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...g.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...g.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...g.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...g.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...g.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...g.errToObj(I)})}nonempty($){return this.min(1,g.errToObj($))}trim(){return new p6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxLength(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}p6.create=($)=>{return new p6({checks:[],typeName:M.ZodString,coerce:$?.coerce??!1,...d($)})};function Gj($,I){let U=($.toString().split(".")[1]||"").length,b=(I.toString().split(".")[1]||"").length,w=U>b?U:b,X=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(I.toFixed(w).replace(".",""));return X%D/10**w}class A1 extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==R.number){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.number,received:w.parsedType}),r}let U=void 0,b=new f$;for(let w of this._def.checks)if(w.kind==="int"){if(!$$.isInteger($.data))U=this._getOrReturnCtx($,U),T(U,{code:F.invalid_type,expected:"integer",received:"float",message:w.message}),b.dirty()}else if(w.kind==="min"){if(w.inclusive?$.data<w.value:$.data<=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_small,minimum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="max"){if(w.inclusive?$.data>w.value:$.data>=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if(Gj($.data,w.value)!==0)U=this._getOrReturnCtx($,U),T(U,{code:F.not_multiple_of,multipleOf:w.value,message:w.message}),b.dirty()}else if(w.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),T(U,{code:F.not_finite,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,g.toString(I))}gt($,I){return this.setLimit("min",$,!1,g.toString(I))}lte($,I){return this.setLimit("max",$,!0,g.toString(I))}lt($,I){return this.setLimit("max",$,!1,g.toString(I))}setLimit($,I,U,b){return new A1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:g.toString(b)}]})}_addCheck($){return new A1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:g.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(I)})}finite($){return this._addCheck({kind:"finite",message:g.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString($)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&$$.isInteger($.value))}get isFinite(){let $=null,I=null;for(let U of this._def.checks)if(U.kind==="finite"||U.kind==="int"||U.kind==="multipleOf")return!0;else if(U.kind==="min"){if(I===null||U.value>I)I=U.value}else if(U.kind==="max"){if($===null||U.value<$)$=U.value}return Number.isFinite(I)&&Number.isFinite($)}}A1.create=($)=>{return new A1({checks:[],typeName:M.ZodNumber,coerce:$?.coerce||!1,...d($)})};class O1 extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==R.bigint)return this._getInvalidInput($);let U=void 0,b=new f$;for(let w of this._def.checks)if(w.kind==="min"){if(w.inclusive?$.data<w.value:$.data<=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_small,type:"bigint",minimum:w.value,inclusive:w.inclusive,message:w.message}),b.dirty()}else if(w.kind==="max"){if(w.inclusive?$.data>w.value:$.data>=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_big,type:"bigint",maximum:w.value,inclusive:w.inclusive,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if($.data%w.value!==BigInt(0))U=this._getOrReturnCtx($,U),T(U,{code:F.not_multiple_of,multipleOf:w.value,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}_getInvalidInput($){let I=this._getOrReturnCtx($);return T(I,{code:F.invalid_type,expected:R.bigint,received:I.parsedType}),r}gte($,I){return this.setLimit("min",$,!0,g.toString(I))}gt($,I){return this.setLimit("min",$,!1,g.toString(I))}lte($,I){return this.setLimit("max",$,!0,g.toString(I))}lt($,I){return this.setLimit("max",$,!1,g.toString(I))}setLimit($,I,U,b){return new O1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:g.toString(b)}]})}_addCheck($){return new O1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(I)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}O1.create=($)=>{return new O1({checks:[],typeName:M.ZodBigInt,coerce:$?.coerce??!1,...d($)})};class a0 extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.boolean,received:U.parsedType}),r}return c$($.data)}}a0.create=($)=>{return new a0({typeName:M.ZodBoolean,coerce:$?.coerce||!1,...d($)})};class kI extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.date,received:w.parsedType}),r}if(Number.isNaN($.data.getTime())){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_date}),r}let U=new f$,b=void 0;for(let w of this._def.checks)if(w.kind==="min"){if($.data.getTime()<w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_small,message:w.message,inclusive:!0,exact:!1,minimum:w.value,type:"date"}),U.dirty()}else if(w.kind==="max"){if($.data.getTime()>w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_big,message:w.message,inclusive:!0,exact:!1,maximum:w.value,type:"date"}),U.dirty()}else $$.assertNever(w);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new kI({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:g.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:g.toString(I)})}get minDate(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $!=null?new Date($):null}}kI.create=($)=>{return new kI({checks:[],coerce:$?.coerce||!1,typeName:M.ZodDate,...d($)})};class e0 extends e{_parse($){if(this._getType($)!==R.symbol){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.symbol,received:U.parsedType}),r}return c$($.data)}}e0.create=($)=>{return new e0({typeName:M.ZodSymbol,...d($)})};class RI extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.undefined,received:U.parsedType}),r}return c$($.data)}}RI.create=($)=>{return new RI({typeName:M.ZodUndefined,...d($)})};class TI extends e{_parse($){if(this._getType($)!==R.null){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.null,received:U.parsedType}),r}return c$($.data)}}TI.create=($)=>{return new TI({typeName:M.ZodNull,...d($)})};class s0 extends e{constructor(){super(...arguments);this._any=!0}_parse($){return c$($.data)}}s0.create=($)=>{return new s0({typeName:M.ZodAny,...d($)})};class y4 extends e{constructor(){super(...arguments);this._unknown=!0}_parse($){return c$($.data)}}y4.create=($)=>{return new y4({typeName:M.ZodUnknown,...d($)})};class t6 extends e{_parse($){let I=this._getOrReturnCtx($);return T(I,{code:F.invalid_type,expected:R.never,received:I.parsedType}),r}}t6.create=($)=>{return new t6({typeName:M.ZodNever,...d($)})};class $w extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.void,received:U.parsedType}),r}return c$($.data)}}$w.create=($)=>{return new $w({typeName:M.ZodVoid,...d($)})};class C6 extends e{_parse($){let{ctx:I,status:U}=this._processInputParams($),b=this._def;if(I.parsedType!==R.array)return T(I,{code:F.invalid_type,expected:R.array,received:I.parsedType}),r;if(b.exactLength!==null){let X=I.data.length>b.exactLength.value,D=I.data.length<b.exactLength.value;if(X||D)T(I,{code:X?F.too_big:F.too_small,minimum:D?b.exactLength.value:void 0,maximum:X?b.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:b.exactLength.message}),U.dirty()}if(b.minLength!==null){if(I.data.length<b.minLength.value)T(I,{code:F.too_small,minimum:b.minLength.value,type:"array",inclusive:!0,exact:!1,message:b.minLength.message}),U.dirty()}if(b.maxLength!==null){if(I.data.length>b.maxLength.value)T(I,{code:F.too_big,maximum:b.maxLength.value,type:"array",inclusive:!0,exact:!1,message:b.maxLength.message}),U.dirty()}if(I.common.async)return Promise.all([...I.data].map((X,D)=>{return b.type._parseAsync(new V6(I,X,I.path,D))})).then((X)=>{return f$.mergeArray(U,X)});let w=[...I.data].map((X,D)=>{return b.type._parseSync(new V6(I,X,I.path,D))});return f$.mergeArray(U,w)}get element(){return this._def.type}min($,I){return new C6({...this._def,minLength:{value:$,message:g.toString(I)}})}max($,I){return new C6({...this._def,maxLength:{value:$,message:g.toString(I)}})}length($,I){return new C6({...this._def,exactLength:{value:$,message:g.toString(I)}})}nonempty($){return this.min(1,$)}}C6.create=($,I)=>{return new C6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:M.ZodArray,...d(I)})};function H1($){if($ instanceof E$){let I={};for(let U in $.shape){let b=$.shape[U];I[U]=B6.create(H1(b))}return new E$({...$._def,shape:()=>I})}else if($ instanceof C6)return new C6({...$._def,type:H1($.element)});else if($ instanceof B6)return B6.create(H1($.unwrap()));else if($ instanceof Q4)return Q4.create(H1($.unwrap()));else if($ instanceof a6)return a6.create($.items.map((I)=>H1(I)));else return $}class E$ extends e{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),I=$$.objectKeys($);return this._cached={shape:$,keys:I},this._cached}_parse($){if(this._getType($)!==R.object){let Q=this._getOrReturnCtx($);return T(Q,{code:F.invalid_type,expected:R.object,received:Q.parsedType}),r}let{status:U,ctx:b}=this._processInputParams($),{shape:w,keys:X}=this._getCached(),D=[];if(!(this._def.catchall instanceof t6&&this._def.unknownKeys==="strip")){for(let Q in b.data)if(!X.includes(Q))D.push(Q)}let W=[];for(let Q of X){let G=w[Q],N=b.data[Q];W.push({key:{status:"valid",value:Q},value:G._parse(new V6(b,N,b.path,Q)),alwaysSet:Q in b.data})}if(this._def.catchall instanceof t6){let Q=this._def.unknownKeys;if(Q==="passthrough")for(let G of D)W.push({key:{status:"valid",value:G},value:{status:"valid",value:b.data[G]}});else if(Q==="strict"){if(D.length>0)T(b,{code:F.unrecognized_keys,keys:D}),U.dirty()}else if(Q==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Q=this._def.catchall;for(let G of D){let N=b.data[G];W.push({key:{status:"valid",value:G},value:Q._parse(new V6(b,N,b.path,G)),alwaysSet:G in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let Q=[];for(let G of W){let N=await G.key,B=await G.value;Q.push({key:N,value:B,alwaysSet:G.alwaysSet})}return Q}).then((Q)=>{return f$.mergeObjectSync(U,Q)});else return f$.mergeObjectSync(U,W)}get shape(){return this._def.shape()}strict($){return g.errToObj,new E$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(I,U)=>{let b=this._def.errorMap?.(I,U).message??U.defaultError;if(I.code==="unrecognized_keys")return{message:g.errToObj($).message??b};return{message:b}}}:{}})}strip(){return new E$({...this._def,unknownKeys:"strip"})}passthrough(){return new E$({...this._def,unknownKeys:"passthrough"})}extend($){return new E$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new E$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:M.ZodObject})}setKey($,I){return this.augment({[$]:I})}catchall($){return new E$({...this._def,catchall:$})}pick($){let I={};for(let U of $$.objectKeys($))if($[U]&&this.shape[U])I[U]=this.shape[U];return new E$({...this._def,shape:()=>I})}omit($){let I={};for(let U of $$.objectKeys(this.shape))if(!$[U])I[U]=this.shape[U];return new E$({...this._def,shape:()=>I})}deepPartial(){return H1(this)}partial($){let I={};for(let U of $$.objectKeys(this.shape)){let b=this.shape[U];if($&&!$[U])I[U]=b;else I[U]=b.optional()}return new E$({...this._def,shape:()=>I})}required($){let I={};for(let U of $$.objectKeys(this.shape))if($&&!$[U])I[U]=this.shape[U];else{let w=this.shape[U];while(w instanceof B6)w=w._def.innerType;I[U]=w}return new E$({...this._def,shape:()=>I})}keyof(){return qH($$.objectKeys(this.shape))}}E$.create=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strip",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};E$.strictCreate=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strict",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};E$.lazycreate=($,I)=>{return new E$({shape:$,unknownKeys:"strip",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};class _I extends e{_parse($){let{ctx:I}=this._processInputParams($),U=this._def.options;function b(w){for(let D of w)if(D.result.status==="valid")return D.result;for(let D of w)if(D.result.status==="dirty")return I.common.issues.push(...D.ctx.common.issues),D.result;let X=w.map((D)=>new X6(D.ctx.common.issues));return T(I,{code:F.invalid_union,unionErrors:X}),r}if(I.common.async)return Promise.all(U.map(async(w)=>{let X={...I,common:{...I.common,issues:[]},parent:null};return{result:await w._parseAsync({data:I.data,path:I.path,parent:X}),ctx:X}})).then(b);else{let w=void 0,X=[];for(let W of U){let Q={...I,common:{...I.common,issues:[]},parent:null},G=W._parseSync({data:I.data,path:I.path,parent:Q});if(G.status==="valid")return G;else if(G.status==="dirty"&&!w)w={result:G,ctx:Q};if(Q.common.issues.length)X.push(Q.common.issues)}if(w)return I.common.issues.push(...w.ctx.common.issues),w.result;let D=X.map((W)=>new X6(W));return T(I,{code:F.invalid_union,unionErrors:D}),r}}get options(){return this._def.options}}_I.create=($,I)=>{return new _I({options:$,typeName:M.ZodUnion,...d(I)})};var d6=($)=>{if($ instanceof CI)return d6($.schema);else if($ instanceof g6)return d6($.innerType());else if($ instanceof gI)return[$.value];else if($ instanceof u4)return $.options;else if($ instanceof xI)return $$.objectValues($.enum);else if($ instanceof hI)return d6($._def.innerType);else if($ instanceof RI)return[void 0];else if($ instanceof TI)return[null];else if($ instanceof B6)return[void 0,...d6($.unwrap())];else if($ instanceof Q4)return[null,...d6($.unwrap())];else if($ instanceof dD)return d6($.unwrap());else if($ instanceof yI)return d6($.unwrap());else if($ instanceof fI)return d6($._def.innerType);else return[]};class oD extends e{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.object)return T(I,{code:F.invalid_type,expected:R.object,received:I.parsedType}),r;let U=this.discriminator,b=I.data[U],w=this.optionsMap.get(b);if(!w)return T(I,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),r;if(I.common.async)return w._parseAsync({data:I.data,path:I.path,parent:I});else return w._parseSync({data:I.data,path:I.path,parent:I})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,I,U){let b=new Map;for(let w of I){let X=d6(w.shape[$]);if(!X.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let D of X){if(b.has(D))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(D)}`);b.set(D,w)}}return new oD({typeName:M.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:b,...d(U)})}}function iD($,I){let U=o6($),b=o6(I);if($===I)return{valid:!0,data:$};else if(U===R.object&&b===R.object){let w=$$.objectKeys(I),X=$$.objectKeys($).filter((W)=>w.indexOf(W)!==-1),D={...$,...I};for(let W of X){let Q=iD($[W],I[W]);if(!Q.valid)return{valid:!1};D[W]=Q.data}return{valid:!0,data:D}}else if(U===R.array&&b===R.array){if($.length!==I.length)return{valid:!1};let w=[];for(let X=0;X<$.length;X++){let D=$[X],W=I[X],Q=iD(D,W);if(!Q.valid)return{valid:!1};w.push(Q.data)}return{valid:!0,data:w}}else if(U===R.date&&b===R.date&&+$===+I)return{valid:!0,data:$};else return{valid:!1}}class ZI extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($),b=(w,X)=>{if(mD(w)||mD(X))return r;let D=iD(w.value,X.value);if(!D.valid)return T(U,{code:F.invalid_intersection_types}),r;if(rD(w)||rD(X))I.dirty();return{status:I.value,value:D.data}};if(U.common.async)return Promise.all([this._def.left._parseAsync({data:U.data,path:U.path,parent:U}),this._def.right._parseAsync({data:U.data,path:U.path,parent:U})]).then(([w,X])=>b(w,X));else return b(this._def.left._parseSync({data:U.data,path:U.path,parent:U}),this._def.right._parseSync({data:U.data,path:U.path,parent:U}))}}ZI.create=($,I,U)=>{return new ZI({left:$,right:I,typeName:M.ZodIntersection,...d(U)})};class a6 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.array)return T(U,{code:F.invalid_type,expected:R.array,received:U.parsedType}),r;if(U.data.length<this._def.items.length)return T(U,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r;if(!this._def.rest&&U.data.length>this._def.items.length)T(U,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I.dirty();let w=[...U.data].map((X,D)=>{let W=this._def.items[D]||this._def.rest;if(!W)return null;return W._parse(new V6(U,X,U.path,D))}).filter((X)=>!!X);if(U.common.async)return Promise.all(w).then((X)=>{return f$.mergeArray(I,X)});else return f$.mergeArray(I,w)}get items(){return this._def.items}rest($){return new a6({...this._def,rest:$})}}a6.create=($,I)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new a6({items:$,typeName:M.ZodTuple,rest:null,...d(I)})};class Iw extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.object)return T(U,{code:F.invalid_type,expected:R.object,received:U.parsedType}),r;let b=[],w=this._def.keyType,X=this._def.valueType;for(let D in U.data)b.push({key:w._parse(new V6(U,D,U.path,D)),value:X._parse(new V6(U,U.data[D],U.path,D)),alwaysSet:D in U.data});if(U.common.async)return f$.mergeObjectAsync(I,b);else return f$.mergeObjectSync(I,b)}get element(){return this._def.valueType}static create($,I,U){if(I instanceof e)return new Iw({keyType:$,valueType:I,typeName:M.ZodRecord,...d(U)});return new Iw({keyType:p6.create(),valueType:$,typeName:M.ZodRecord,...d(I)})}}class Uw extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.map)return T(U,{code:F.invalid_type,expected:R.map,received:U.parsedType}),r;let b=this._def.keyType,w=this._def.valueType,X=[...U.data.entries()].map(([D,W],Q)=>{return{key:b._parse(new V6(U,D,U.path,[Q,"key"])),value:w._parse(new V6(U,W,U.path,[Q,"value"]))}});if(U.common.async){let D=new Map;return Promise.resolve().then(async()=>{for(let W of X){let Q=await W.key,G=await W.value;if(Q.status==="aborted"||G.status==="aborted")return r;if(Q.status==="dirty"||G.status==="dirty")I.dirty();D.set(Q.value,G.value)}return{status:I.value,value:D}})}else{let D=new Map;for(let W of X){let{key:Q,value:G}=W;if(Q.status==="aborted"||G.status==="aborted")return r;if(Q.status==="dirty"||G.status==="dirty")I.dirty();D.set(Q.value,G.value)}return{status:I.value,value:D}}}}Uw.create=($,I,U)=>{return new Uw({valueType:I,keyType:$,typeName:M.ZodMap,...d(U)})};class z1 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.set)return T(U,{code:F.invalid_type,expected:R.set,received:U.parsedType}),r;let b=this._def;if(b.minSize!==null){if(U.data.size<b.minSize.value)T(U,{code:F.too_small,minimum:b.minSize.value,type:"set",inclusive:!0,exact:!1,message:b.minSize.message}),I.dirty()}if(b.maxSize!==null){if(U.data.size>b.maxSize.value)T(U,{code:F.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),I.dirty()}let w=this._def.valueType;function X(W){let Q=new Set;for(let G of W){if(G.status==="aborted")return r;if(G.status==="dirty")I.dirty();Q.add(G.value)}return{status:I.value,value:Q}}let D=[...U.data.values()].map((W,Q)=>w._parse(new V6(U,W,U.path,Q)));if(U.common.async)return Promise.all(D).then((W)=>X(W));else return X(D)}min($,I){return new z1({...this._def,minSize:{value:$,message:g.toString(I)}})}max($,I){return new z1({...this._def,maxSize:{value:$,message:g.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}z1.create=($,I)=>{return new z1({valueType:$,minSize:null,maxSize:null,typeName:M.ZodSet,...d(I)})};class PI extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.function)return T(I,{code:F.invalid_type,expected:R.function,received:I.parsedType}),r;function U(D,W){return t0({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,EI(),W4].filter((Q)=>!!Q),issueData:{code:F.invalid_arguments,argumentsError:W}})}function b(D,W){return t0({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,EI(),W4].filter((Q)=>!!Q),issueData:{code:F.invalid_return_type,returnTypeError:W}})}let w={errorMap:I.common.contextualErrorMap},X=I.data;if(this._def.returns instanceof L1){let D=this;return c$(async function(...W){let Q=new X6([]),G=await D._def.args.parseAsync(W,w).catch((H)=>{throw Q.addIssue(U(W,H)),Q}),N=await Reflect.apply(X,this,G);return await D._def.returns._def.type.parseAsync(N,w).catch((H)=>{throw Q.addIssue(b(N,H)),Q})})}else{let D=this;return c$(function(...W){let Q=D._def.args.safeParse(W,w);if(!Q.success)throw new X6([U(W,Q.error)]);let G=Reflect.apply(X,this,Q.data),N=D._def.returns.safeParse(G,w);if(!N.success)throw new X6([b(G,N.error)]);return N.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new PI({...this._def,args:a6.create($).rest(y4.create())})}returns($){return new PI({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new PI({args:$?$:a6.create([]).rest(y4.create()),returns:I||y4.create(),typeName:M.ZodFunction,...d(U)})}}class CI extends e{get schema(){return this._def.getter()}_parse($){let{ctx:I}=this._processInputParams($);return this._def.getter()._parse({data:I.data,path:I.path,parent:I})}}CI.create=($,I)=>{return new CI({getter:$,typeName:M.ZodLazy,...d(I)})};class gI extends e{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return T(I,{received:I.data,code:F.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}gI.create=($,I)=>{return new gI({value:$,typeName:M.ZodLiteral,...d(I)})};function qH($,I){return new u4({values:$,typeName:M.ZodEnum,...d(I)})}class u4 extends e{_parse($){if(typeof $.data!=="string"){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{expected:$$.joinValues(U),received:I.parsedType,code:F.invalid_type}),r}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{received:I.data,code:F.invalid_enum_value,options:U}),r}return c$($.data)}get options(){return this._def.values}get enum(){let $={};for(let I of this._def.values)$[I]=I;return $}get Values(){let $={};for(let I of this._def.values)$[I]=I;return $}get Enum(){let $={};for(let I of this._def.values)$[I]=I;return $}extract($,I=this._def){return u4.create($,{...this._def,...I})}exclude($,I=this._def){return u4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}u4.create=qH;class xI extends e{_parse($){let I=$$.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==R.string&&U.parsedType!==R.number){let b=$$.objectValues(I);return T(U,{expected:$$.joinValues(b),received:U.parsedType,code:F.invalid_type}),r}if(!this._cache)this._cache=new Set($$.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let b=$$.objectValues(I);return T(U,{received:U.data,code:F.invalid_enum_value,options:b}),r}return c$($.data)}get enum(){return this._def.values}}xI.create=($,I)=>{return new xI({values:$,typeName:M.ZodNativeEnum,...d(I)})};class L1 extends e{unwrap(){return this._def.type}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.promise&&I.common.async===!1)return T(I,{code:F.invalid_type,expected:R.promise,received:I.parsedType}),r;let U=I.parsedType===R.promise?I.data:Promise.resolve(I.data);return c$(U.then((b)=>{return this._def.type.parseAsync(b,{path:I.path,errorMap:I.common.contextualErrorMap})}))}}L1.create=($,I)=>{return new L1({type:$,typeName:M.ZodPromise,...d(I)})};class g6 extends e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===M.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:I,ctx:U}=this._processInputParams($),b=this._def.effect||null,w={addIssue:(X)=>{if(T(U,X),X.fatal)I.abort();else I.dirty()},get path(){return U.path}};if(w.addIssue=w.addIssue.bind(w),b.type==="preprocess"){let X=b.transform(U.data,w);if(U.common.async)return Promise.resolve(X).then(async(D)=>{if(I.value==="aborted")return r;let W=await this._def.schema._parseAsync({data:D,path:U.path,parent:U});if(W.status==="aborted")return r;if(W.status==="dirty")return J1(W.value);if(I.value==="dirty")return J1(W.value);return W});else{if(I.value==="aborted")return r;let D=this._def.schema._parseSync({data:X,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")return J1(D.value);if(I.value==="dirty")return J1(D.value);return D}}if(b.type==="refinement"){let X=(D)=>{let W=b.refinement(D,w);if(U.common.async)return Promise.resolve(W);if(W instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return D};if(U.common.async===!1){let D=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")I.dirty();return X(D.value),{status:I.value,value:D.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((D)=>{if(D.status==="aborted")return r;if(D.status==="dirty")I.dirty();return X(D.value).then(()=>{return{status:I.value,value:D.value}})})}if(b.type==="transform")if(U.common.async===!1){let X=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(!f4(X))return r;let D=b.transform(X.value,w);if(D instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:I.value,value:D}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((X)=>{if(!f4(X))return r;return Promise.resolve(b.transform(X.value,w)).then((D)=>({status:I.value,value:D}))});$$.assertNever(b)}}g6.create=($,I,U)=>{return new g6({schema:$,typeName:M.ZodEffects,effect:I,...d(U)})};g6.createWithPreprocess=($,I,U)=>{return new g6({schema:I,effect:{type:"preprocess",transform:$},typeName:M.ZodEffects,...d(U)})};class B6 extends e{_parse($){if(this._getType($)===R.undefined)return c$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}B6.create=($,I)=>{return new B6({innerType:$,typeName:M.ZodOptional,...d(I)})};class Q4 extends e{_parse($){if(this._getType($)===R.null)return c$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Q4.create=($,I)=>{return new Q4({innerType:$,typeName:M.ZodNullable,...d(I)})};class hI extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;if(I.parsedType===R.undefined)U=this._def.defaultValue();return this._def.innerType._parse({data:U,path:I.path,parent:I})}removeDefault(){return this._def.innerType}}hI.create=($,I)=>{return new hI({innerType:$,typeName:M.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...d(I)})};class fI extends e{_parse($){let{ctx:I}=this._processInputParams($),U={...I,common:{...I.common,issues:[]}},b=this._def.innerType._parse({data:U.data,path:U.path,parent:{...U}});if(SI(b))return b.then((w)=>{return{status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new X6(U.common.issues)},input:U.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new X6(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}fI.create=($,I)=>{return new fI({innerType:$,typeName:M.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...d(I)})};class ww extends e{_parse($){if(this._getType($)!==R.nan){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.nan,received:U.parsedType}),r}return{status:"valid",value:$.data}}}ww.create=($)=>{return new ww({typeName:M.ZodNaN,...d($)})};var du=Symbol("zod_brand");class dD extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;return this._def.type._parse({data:U,path:I.path,parent:I})}unwrap(){return this._def.type}}class bw extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let w=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(w.status==="aborted")return r;if(w.status==="dirty")return I.dirty(),J1(w.value);else return this._def.out._parseAsync({data:w.value,path:U.path,parent:U})})();else{let b=this._def.in._parseSync({data:U.data,path:U.path,parent:U});if(b.status==="aborted")return r;if(b.status==="dirty")return I.dirty(),{status:"dirty",value:b.value};else return this._def.out._parseSync({data:b.value,path:U.path,parent:U})}}static create($,I){return new bw({in:$,out:I,typeName:M.ZodPipeline})}}class yI extends e{_parse($){let I=this._def.innerType._parse($),U=(b)=>{if(f4(b))b.value=Object.freeze(b.value);return b};return SI(I)?I.then((b)=>U(b)):U(I)}unwrap(){return this._def.innerType}}yI.create=($,I)=>{return new yI({innerType:$,typeName:M.ZodReadonly,...d(I)})};var pu={object:E$.lazycreate},M;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(M||(M={}));var tu=p6.create,au=A1.create,eu=ww.create,su=O1.create,$l=a0.create,Il=kI.create,Ul=e0.create,wl=RI.create,bl=TI.create,Xl=s0.create,Dl=y4.create,Wl=t6.create,Ql=$w.create,Gl=C6.create,FH=E$.create,Nl=E$.strictCreate,Yl=_I.create,Bl=oD.create,Jl=ZI.create,Hl=a6.create,Al=Iw.create,Ol=Uw.create,zl=z1.create,Ll=PI.create,Kl=CI.create,vl=gI.create,Vl=u4.create,ql=xI.create,Fl=L1.create,Ml=g6.create,jl=B6.create,El=Q4.create,Sl=g6.createWithPreprocess,Pl=bw.create;var Nj=Object.freeze({status:"aborted"});function v($,I,U){function b(W,Q){var G;Object.defineProperty(W,"_zod",{value:W._zod??{},enumerable:!1}),(G=W._zod).traits??(G.traits=new Set),W._zod.traits.add($),I(W,Q);for(let N in D.prototype)if(!(N in W))Object.defineProperty(W,N,{value:D.prototype[N].bind(W)});W._zod.constr=D,W._zod.def=Q}let w=U?.Parent??Object;class X extends w{}Object.defineProperty(X,"name",{value:$});function D(W){var Q;let G=U?.Parent?new X:this;b(G,W),(Q=G._zod).deferred??(Q.deferred=[]);for(let N of G._zod.deferred)N();return G}return Object.defineProperty(D,"init",{value:b}),Object.defineProperty(D,Symbol.hasInstance,{value:(W)=>{if(U?.Parent&&W instanceof U.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(D,"name",{value:$}),D}var Yj=Symbol("zod_brand");class G4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Xw={};function D6($){if($)Object.assign(Xw,$);return Xw}var I$={};v6(I$,{unwrapMessage:()=>uI,stringifyPrimitive:()=>Qw,required:()=>Pj,randomString:()=>Kj,propertyKeyTypes:()=>$W,promiseAllObject:()=>Lj,primitiveTypes:()=>MH,prefixIssues:()=>x6,pick:()=>Fj,partial:()=>Sj,optionalKeys:()=>IW,omit:()=>Mj,numKeys:()=>vj,nullish:()=>mI,normalizeParams:()=>m,merge:()=>Ej,jsonStringifyReplacer:()=>tD,joinValues:()=>Dw,issue:()=>wW,isPlainObject:()=>v1,isObject:()=>K1,getSizableOrigin:()=>EH,getParsedType:()=>Vj,getLengthableOrigin:()=>nI,getEnumValues:()=>lI,getElementAtPath:()=>zj,floatSafeRemainder:()=>aD,finalizeIssue:()=>q6,extend:()=>jj,escapeRegex:()=>N4,esc:()=>l4,defineLazy:()=>O$,createTransparentProxy:()=>qj,clone:()=>W6,cleanRegex:()=>rI,cleanEnum:()=>kj,captureStackTrace:()=>Ww,cached:()=>cI,assignProp:()=>eD,assertNotEqual:()=>Jj,assertNever:()=>Aj,assertIs:()=>Hj,assertEqual:()=>Bj,assert:()=>Oj,allowsEval:()=>sD,aborted:()=>c4,NUMBER_FORMAT_RANGES:()=>UW,Class:()=>SH,BIGINT_FORMAT_RANGES:()=>jH});function Bj($){return $}function Jj($){return $}function Hj($){}function Aj($){throw new Error}function Oj($){}function lI($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function Dw($,I="|"){return $.map((U)=>Qw(U)).join(I)}function tD($,I){if(typeof I==="bigint")return I.toString();return I}function cI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function mI($){return $===null||$===void 0}function rI($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function aD($,I){let U=($.toString().split(".")[1]||"").length,b=(I.toString().split(".")[1]||"").length,w=U>b?U:b,X=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(I.toFixed(w).replace(".",""));return X%D/10**w}function O$($,I,U){Object.defineProperty($,I,{get(){{let w=U();return $[I]=w,w}throw new Error("cached value already set")},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function eD($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function zj($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function Lj($){let I=Object.keys($),U=I.map((b)=>$[b]);return Promise.all(U).then((b)=>{let w={};for(let X=0;X<I.length;X++)w[I[X]]=b[X];return w})}function Kj($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function l4($){return JSON.stringify($)}var Ww=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};function K1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var sD=cI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function v1($){if(K1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;let U=I.prototype;if(K1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function vj($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var Vj=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},$W=new Set(["string","number","symbol"]),MH=new Set(["string","number","bigint","boolean","symbol","undefined"]);function N4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W6($,I,U){let b=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)b._zod.parent=$;return b}function m($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function qj($){let I;return new Proxy({},{get(U,b,w){return I??(I=$()),Reflect.get(I,b,w)},set(U,b,w,X){return I??(I=$()),Reflect.set(I,b,w,X)},has(U,b){return I??(I=$()),Reflect.has(I,b)},deleteProperty(U,b){return I??(I=$()),Reflect.deleteProperty(I,b)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,b){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,b)},defineProperty(U,b,w){return I??(I=$()),Reflect.defineProperty(I,b,w)}})}function Qw($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function IW($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var UW={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]},jH={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Fj($,I){let U={},b=$._zod.def;for(let w in I){if(!(w in b.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;U[w]=b.shape[w]}return W6($,{...$._zod.def,shape:U,checks:[]})}function Mj($,I){let U={...$._zod.def.shape},b=$._zod.def;for(let w in I){if(!(w in b.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;delete U[w]}return W6($,{...$._zod.def,shape:U,checks:[]})}function jj($,I){if(!v1(I))throw new Error("Invalid input to extend: expected a plain object");let U={...$._zod.def,get shape(){let b={...$._zod.def.shape,...I};return eD(this,"shape",b),b},checks:[]};return W6($,U)}function Ej($,I){return W6($,{...$._zod.def,get shape(){let U={...$._zod.def.shape,...I._zod.def.shape};return eD(this,"shape",U),U},catchall:I._zod.def.catchall,checks:[]})}function Sj($,I,U){let b=I._zod.def.shape,w={...b};if(U)for(let X in U){if(!(X in b))throw new Error(`Unrecognized key: "${X}"`);if(!U[X])continue;w[X]=$?new $({type:"optional",innerType:b[X]}):b[X]}else for(let X in b)w[X]=$?new $({type:"optional",innerType:b[X]}):b[X];return W6(I,{...I._zod.def,shape:w,checks:[]})}function Pj($,I,U){let b=I._zod.def.shape,w={...b};if(U)for(let X in U){if(!(X in w))throw new Error(`Unrecognized key: "${X}"`);if(!U[X])continue;w[X]=new $({type:"nonoptional",innerType:b[X]})}else for(let X in b)w[X]=new $({type:"nonoptional",innerType:b[X]});return W6(I,{...I._zod.def,shape:w,checks:[]})}function c4($,I=0){for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function x6($,I){return I.map((U)=>{var b;return(b=U).path??(b.path=[]),U.path.unshift($),U})}function uI($){return typeof $==="string"?$:$?.message}function q6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=uI($.inst?._zod.def?.error?.($))??uI(I?.error?.($))??uI(U.customError?.($))??uI(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function EH($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function nI($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function wW(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function kj($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}class SH{constructor(...$){}}var PH=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),Object.defineProperty($,"message",{get(){return JSON.stringify(I,tD,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Gw=v("$ZodError",PH),iI=v("$ZodError",PH,{Parent:Error});function bW($,I=(U)=>U.message){let U={},b=[];for(let w of $.issues)if(w.path.length>0)U[w.path[0]]=U[w.path[0]]||[],U[w.path[0]].push(I(w));else b.push(I(w));return{formErrors:b,fieldErrors:U}}function XW($,I){let U=I||function(X){return X.message},b={_errors:[]},w=(X)=>{for(let D of X.issues)if(D.code==="invalid_union"&&D.errors.length)D.errors.map((W)=>w({issues:W}));else if(D.code==="invalid_key")w({issues:D.issues});else if(D.code==="invalid_element")w({issues:D.issues});else if(D.path.length===0)b._errors.push(U(D));else{let W=b,Q=0;while(Q<D.path.length){let G=D.path[Q];if(Q!==D.path.length-1)W[G]=W[G]||{_errors:[]};else W[G]=W[G]||{_errors:[]},W[G]._errors.push(U(D));W=W[G],Q++}}};return w($),b}var DW=($)=>(I,U,b,w)=>{let X=b?Object.assign(b,{async:!1}):{async:!1},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)throw new G4;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Ww(W,w?.callee),W}return D.value},WW=DW(iI),QW=($)=>async(I,U,b,w)=>{let X=b?Object.assign(b,{async:!0}):{async:!0},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)D=await D;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Ww(W,w?.callee),W}return D.value},GW=QW(iI),NW=($)=>(I,U,b)=>{let w=b?{...b,async:!1}:{async:!1},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)throw new G4;return X.issues.length?{success:!1,error:new($??Gw)(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},m4=NW(iI),YW=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{async:!0}):{async:!0},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},r4=YW(iI);var kH=/^[cC][^\s-]{8,}$/,RH=/^[0-9a-z]+$/,TH=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_H=/^[0-9a-vA-V]{20}$/,ZH=/^[A-Za-z0-9]{27}$/,CH=/^[a-zA-Z0-9_-]{21}$/,gH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var xH=/^([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})$/,BW=($)=>{if(!$)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}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var hH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function fH(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var yH=/^(?:(?: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])$/,uH=/^(([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})$/,lH=/^((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])$/,cH=/^(([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])$/,mH=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,JW=/^[A-Za-z0-9_-]*$/,rH=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var nH=/^\+(?:[0-9]){6,14}[0-9]$/,iH="(?:(?:\\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])))",oH=new RegExp(`^${iH}$`);function dH($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.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{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function pH($){return new RegExp(`^${dH($)}$`)}function tH($){let I=dH({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-]\\d{2}:\\d{2})");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${iH}T(?:${b})$`)}var aH=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)};var eH=/^\d+$/,sH=/^-?\d+(?:\.\d+)?/i,$A=/true|false/i,IA=/null/i;var UA=/^[^A-Z]*$/,wA=/^[^a-z]*$/;var Z$=v("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),bA={number:"number",bigint:"bigint",object:"date"},HW=v("$ZodCheckLessThan",($,I)=>{Z$.init($,I);let U=bA[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.maximum:w.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<X)if(I.inclusive)w.maximum=I.value;else w.exclusiveMaximum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value<=I.value:b.value<I.value)return;b.issues.push({origin:U,code:"too_big",maximum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),AW=v("$ZodCheckGreaterThan",($,I)=>{Z$.init($,I);let U=bA[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.minimum:w.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>X)if(I.inclusive)w.minimum=I.value;else w.exclusiveMinimum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value>=I.value:b.value>I.value)return;b.issues.push({origin:U,code:"too_small",minimum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),XA=v("$ZodCheckMultipleOf",($,I)=>{Z$.init($,I),$._zod.onattach.push((U)=>{var b;(b=U._zod.bag).multipleOf??(b.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):aD(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),DA=v("$ZodCheckNumberFormat",($,I)=>{Z$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=UW[I.format];$._zod.onattach.push((D)=>{let W=D._zod.bag;if(W.format=I.format,W.minimum=w,W.maximum=X,U)W.pattern=eH}),$._zod.check=(D)=>{let W=D.value;if(U){if(!Number.isInteger(W)){D.issues.push({expected:b,format:I.format,code:"invalid_type",input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)D.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});else D.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});return}}if(W<w)D.issues.push({origin:"number",input:W,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!I.abort});if(W>X)D.issues.push({origin:"number",input:W,code:"too_big",maximum:X,inst:$})}});var WA=v("$ZodCheckMaxLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.length<=I.maximum)return;let D=nI(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),QA=v("$ZodCheckMinLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.length>=I.minimum)return;let D=nI(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),GA=v("$ZodCheckLengthEquals",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.length,w.maximum=I.length,w.length=I.length}),$._zod.check=(b)=>{let w=b.value,X=w.length;if(X===I.length)return;let D=nI(w),W=X>I.length;b.issues.push({origin:D,...W?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),oI=v("$ZodCheckStringFormat",($,I)=>{var U,b;if(Z$.init($,I),$._zod.onattach.push((w)=>{let X=w._zod.bag;if(X.format=I.format,I.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(w)=>{if(I.pattern.lastIndex=0,I.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:I.format,input:w.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(b=$._zod).check??(b.check=()=>{})}),NA=v("$ZodCheckRegex",($,I)=>{oI.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),YA=v("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=UA),oI.init($,I)}),BA=v("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=wA),oI.init($,I)}),JA=v("$ZodCheckIncludes",($,I)=>{Z$.init($,I);let U=N4(I.includes),b=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=b,$._zod.onattach.push((w)=>{let X=w._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(b)}),$._zod.check=(w)=>{if(w.value.includes(I.includes,I.position))return;w.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:w.value,inst:$,continue:!I.abort})}}),HA=v("$ZodCheckStartsWith",($,I)=>{Z$.init($,I);let U=new RegExp(`^${N4(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.startsWith(I.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:b.value,inst:$,continue:!I.abort})}}),AA=v("$ZodCheckEndsWith",($,I)=>{Z$.init($,I);let U=new RegExp(`.*${N4(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.endsWith(I.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:b.value,inst:$,continue:!I.abort})}});var OA=v("$ZodCheckOverwrite",($,I)=>{Z$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class OW{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
9
+ deps: ${U}}`};var HC={keyword:"dependencies",type:"object",schemaType:"object",error:jK.error,code($){let[I,U]=AC($);FK($,I),MK($,U)}};function AC({schema:$}){let I={},U={};for(let b in $){if(b==="__proto__")continue;let w=Array.isArray($[b])?I:U;w[b]=$[b]}return[I,U]}function FK($,I=$.schema){let{gen:U,data:b,it:w}=$;if(Object.keys(I).length===0)return;let X=U.let("missing");for(let D in I){let W=I[D];if(W.length===0)continue;let Q=kU.propertyInData(U,b,D,w.opts.ownProperties);if($.setParams({property:D,depsCount:W.length,deps:W.join(", ")}),w.allErrors)U.if(Q,()=>{for(let G of W)kU.checkReportMissingProp($,G)});else U.if(zQ._`${Q} && (${kU.checkMissingProp($,W,X)})`),kU.reportMissingProp($,X),U.else()}}jK.validatePropertyDeps=FK;function MK($,I=$.schema){let{gen:U,data:b,keyword:w,it:X}=$,D=U.name("valid");for(let W in I){if(JC.alwaysValidSchema(X,I[W]))continue;U.if(kU.propertyInData(U,b,W,X.opts.ownProperties),()=>{let Q=$.subschema({keyword:w,schemaProp:W},D);$.mergeValidEvaluated(Q,D)},()=>U.var(D,!0)),$.ok(D)}}jK.validateSchemaDeps=MK;jK.default=HC});var TK=Z((RK)=>{Object.defineProperty(RK,"__esModule",{value:!0});var kK=a(),LC=W$(),KC={message:"property name must be valid",params:({params:$})=>kK._`{propertyName: ${$.propertyName}}`},vC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:KC,code($){let{gen:I,schema:U,data:b,it:w}=$;if(LC.alwaysValidSchema(w,U))return;let X=I.name("valid");I.forIn("key",b,(D)=>{$.setParams({propertyName:D}),$.subschema({keyword:"propertyNames",data:D,dataTypes:["string"],propertyName:D,compositeRule:!0},X),I.if(kK.not(X),()=>{if($.error(!0),!w.allErrors)I.break()})}),$.ok(X)}};RK.default=vC});var LQ=Z((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var Rb=O6(),k6=a(),qC=s6(),Tb=W$(),FC={message:"must NOT have additional properties",params:({params:$})=>k6._`{additionalProperty: ${$.additionalProperty}}`},MC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:FC,code($){let{gen:I,schema:U,parentSchema:b,data:w,errsCount:X,it:D}=$;if(!X)throw new Error("ajv implementation error");let{allErrors:W,opts:Q}=D;if(D.props=!0,Q.removeAdditional!=="all"&&Tb.alwaysValidSchema(D,U))return;let G=Rb.allSchemaProperties(b.properties),N=Rb.allSchemaProperties(b.patternProperties);B(),$.ok(k6._`${X} === ${qC.default.errors}`);function B(){I.forIn("key",w,(V)=>{if(!G.length&&!N.length)A(V);else I.if(H(V),()=>A(V))})}function H(V){let q;if(G.length>8){let k=Tb.schemaRefOrVal(D,b.properties,"properties");q=Rb.isOwnProperty(I,k,V)}else if(G.length)q=k6.or(...G.map((k)=>k6._`${V} === ${k}`));else q=k6.nil;if(N.length)q=k6.or(q,...N.map((k)=>k6._`${Rb.usePattern($,k)}.test(${V})`));return k6.not(q)}function J(V){I.code(k6._`delete ${w}[${V}]`)}function A(V){if(Q.removeAdditional==="all"||Q.removeAdditional&&U===!1){J(V);return}if(U===!1){if($.setParams({additionalProperty:V}),$.error(),!W)I.break();return}if(typeof U=="object"&&!Tb.alwaysValidSchema(D,U)){let q=I.name("valid");if(Q.removeAdditional==="failing")O(V,q,!1),I.if(k6.not(q),()=>{$.reset(),J(V)});else if(O(V,q),!W)I.if(k6.not(q),()=>I.break())}}function O(V,q,k){let P={keyword:"additionalProperties",dataProp:V,dataPropType:Tb.Type.Str};if(k===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,q)}}};_K.default=MC});var xK=Z((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});var EC=zU(),ZK=O6(),KQ=W$(),CK=LQ(),SC={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:b,data:w,it:X}=$;if(X.opts.removeAdditional==="all"&&b.additionalProperties===void 0)CK.default.code(new EC.KeywordCxt(X,CK.default,"additionalProperties"));let D=ZK.allSchemaProperties(U);for(let B of D)X.definedProperties.add(B);if(X.opts.unevaluated&&D.length&&X.props!==!0)X.props=KQ.mergeEvaluated.props(I,KQ.toHash(D),X.props);let W=D.filter((B)=>!KQ.alwaysValidSchema(X,U[B]));if(W.length===0)return;let Q=I.name("valid");for(let B of W){if(G(B))N(B);else{if(I.if(ZK.propertyInData(I,w,B,X.opts.ownProperties)),N(B),!X.allErrors)I.else().var(Q,!0);I.endIf()}$.it.definedProperties.add(B),$.ok(Q)}function G(B){return X.opts.useDefaults&&!X.compositeRule&&U[B].default!==void 0}function N(B){$.subschema({keyword:"properties",schemaProp:B,dataProp:B},Q)}}};gK.default=SC});var lK=Z((uK)=>{Object.defineProperty(uK,"__esModule",{value:!0});var hK=O6(),_b=a(),fK=W$(),yK=W$(),kC={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:b,parentSchema:w,it:X}=$,{opts:D}=X,W=hK.allSchemaProperties(U),Q=W.filter((O)=>fK.alwaysValidSchema(X,U[O]));if(W.length===0||Q.length===W.length&&(!X.opts.unevaluated||X.props===!0))return;let G=D.strictSchema&&!D.allowMatchingProperties&&w.properties,N=I.name("valid");if(X.props!==!0&&!(X.props instanceof _b.Name))X.props=yK.evaluatedPropsToName(I,X.props);let{props:B}=X;H();function H(){for(let O of W){if(G)J(O);if(X.allErrors)A(O);else I.var(N,!0),A(O),I.if(N)}}function J(O){for(let V in G)if(new RegExp(O).test(V))fK.checkStrictMode(X,`property ${V} matches pattern ${O} (use allowMatchingProperties)`)}function A(O){I.forIn("key",b,(V)=>{I.if(_b._`${hK.usePattern($,O)}.test(${V})`,()=>{let q=Q.includes(O);if(!q)$.subschema({keyword:"patternProperties",schemaProp:O,dataProp:V,dataPropType:yK.Type.Str},N);if(X.opts.unevaluated&&B!==!0)I.assign(_b._`${B}[${V}]`,!0);else if(!q&&!X.allErrors)I.if(_b.not(N),()=>I.break())})})}}};uK.default=kC});var mK=Z((cK)=>{Object.defineProperty(cK,"__esModule",{value:!0});var TC=W$(),_C={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:b}=$;if(TC.alwaysValidSchema(b,U)){$.fail();return}let w=I.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},w),$.failResult(w,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};cK.default=_C});var nK=Z((rK)=>{Object.defineProperty(rK,"__esModule",{value:!0});var CC=O6(),gC={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:CC.validateUnion,error:{message:"must match a schema in anyOf"}};rK.default=gC});var oK=Z((iK)=>{Object.defineProperty(iK,"__esModule",{value:!0});var Zb=a(),hC=W$(),fC={message:"must match exactly one schema in oneOf",params:({params:$})=>Zb._`{passingSchemas: ${$.passing}}`},yC={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:fC,code($){let{gen:I,schema:U,parentSchema:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(w.opts.discriminator&&b.discriminator)return;let X=U,D=I.let("valid",!1),W=I.let("passing",null),Q=I.name("_valid");$.setParams({passing:W}),I.block(G),$.result(D,()=>$.reset(),()=>$.error(!0));function G(){X.forEach((N,B)=>{let H;if(hC.alwaysValidSchema(w,N))I.var(Q,!0);else H=$.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},Q);if(B>0)I.if(Zb._`${Q} && ${D}`).assign(D,!1).assign(W,Zb._`[${W}, ${B}]`).else();I.if(Q,()=>{if(I.assign(D,!0),I.assign(W,B),H)$.mergeEvaluated(H,Zb.Name)})})}}};iK.default=yC});var pK=Z((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});var lC=W$(),cC={keyword:"allOf",schemaType:"array",code($){let{gen:I,schema:U,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");let w=I.name("valid");U.forEach((X,D)=>{if(lC.alwaysValidSchema(b,X))return;let W=$.subschema({keyword:"allOf",schemaProp:D},w);$.ok(w),$.mergeEvaluated(W)})}};dK.default=cC});var sK=Z((eK)=>{Object.defineProperty(eK,"__esModule",{value:!0});var Cb=a(),aK=W$(),rC={message:({params:$})=>Cb.str`must match "${$.ifClause}" schema`,params:({params:$})=>Cb._`{failingKeyword: ${$.ifClause}}`},nC={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rC,code($){let{gen:I,parentSchema:U,it:b}=$;if(U.then===void 0&&U.else===void 0)aK.checkStrictMode(b,'"if" without "then" and "else" is ignored');let w=tK(b,"then"),X=tK(b,"else");if(!w&&!X)return;let D=I.let("valid",!0),W=I.name("_valid");if(Q(),$.reset(),w&&X){let N=I.let("ifClause");$.setParams({ifClause:N}),I.if(W,G("then",N),G("else",N))}else if(w)I.if(W,G("then"));else I.if(Cb.not(W),G("else"));$.pass(D,()=>$.error(!0));function Q(){let N=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},W);$.mergeEvaluated(N)}function G(N,B){return()=>{let H=$.subschema({keyword:N},W);if(I.assign(D,W),$.mergeValidEvaluated(H,D),B)I.assign(B,Cb._`${N}`);else $.setParams({ifClause:N})}}}};function tK($,I){let U=$.schema[I];return U!==void 0&&!aK.alwaysValidSchema($,U)}eK.default=nC});var Iv=Z(($v)=>{Object.defineProperty($v,"__esModule",{value:!0});var oC=W$(),dC={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)oC.checkStrictMode(U,`"${$}" without "if" is ignored`)}};$v.default=dC});var wv=Z((Uv)=>{Object.defineProperty(Uv,"__esModule",{value:!0});var tC=AQ(),aC=zK(),eC=OQ(),sC=vK(),$g=qK(),Ig=PK(),Ug=TK(),wg=LQ(),bg=xK(),Xg=lK(),Dg=mK(),Wg=nK(),Qg=oK(),Gg=pK(),Ng=sK(),Yg=Iv();function Bg($=!1){let I=[Dg.default,Wg.default,Qg.default,Gg.default,Ng.default,Yg.default,Ug.default,wg.default,Ig.default,bg.default,Xg.default];if($)I.push(aC.default,sC.default);else I.push(tC.default,eC.default);return I.push($g.default),I}Uv.default=Bg});var Xv=Z((bv)=>{Object.defineProperty(bv,"__esModule",{value:!0});var S$=a(),Hg={message:({schemaCode:$})=>S$.str`must match format "${$}"`,params:({schemaCode:$})=>S$._`{format: ${$}}`},Ag={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Hg,code($,I){let{gen:U,data:b,$data:w,schema:X,schemaCode:D,it:W}=$,{opts:Q,errSchemaPath:G,schemaEnv:N,self:B}=W;if(!Q.validateFormats)return;if(w)H();else J();function H(){let A=U.scopeValue("formats",{ref:B.formats,code:Q.code.formats}),O=U.const("fDef",S$._`${A}[${D}]`),V=U.let("fType"),q=U.let("format");U.if(S$._`typeof ${O} == "object" && !(${O} instanceof RegExp)`,()=>U.assign(V,S$._`${O}.type || "string"`).assign(q,S$._`${O}.validate`),()=>U.assign(V,S$._`"string"`).assign(q,O)),$.fail$data(S$.or(k(),P()));function k(){if(Q.strictSchema===!1)return S$.nil;return S$._`${D} && !${q}`}function P(){let x=N.$async?S$._`(${O}.async ? await ${q}(${b}) : ${q}(${b}))`:S$._`${q}(${b})`,l=S$._`(typeof ${q} == "function" ? ${x} : ${q}.test(${b}))`;return S$._`${q} && ${q} !== true && ${V} === ${I} && !${l}`}}function J(){let A=B.formats[X];if(!A){k();return}if(A===!0)return;let[O,V,q]=P(A);if(O===I)$.pass(x());function k(){if(Q.strictSchema===!1){B.logger.warn(l());return}throw new Error(l());function l(){return`unknown format "${X}" ignored in schema at path "${G}"`}}function P(l){let l$=l instanceof RegExp?S$.regexpCode(l):Q.code.formats?S$._`${Q.code.formats}${S$.getProperty(X)}`:void 0,Y6=U.scopeValue("formats",{key:X,ref:l,code:l$});if(typeof l=="object"&&!(l instanceof RegExp))return[l.type||"string",l.validate,S$._`${Y6}.validate`];return["string",l,Y6]}function x(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!N.$async)throw new Error("async format in sync schema");return S$._`await ${q}(${b})`}return typeof V=="function"?S$._`${q}(${b})`:S$._`${q}.test(${b})`}}}};bv.default=Ag});var Wv=Z((Dv)=>{Object.defineProperty(Dv,"__esModule",{value:!0});var zg=Xv(),Lg=[zg.default];Dv.default=Lg});var Nv=Z((Qv)=>{Object.defineProperty(Qv,"__esModule",{value:!0});Qv.contentVocabulary=Qv.metadataVocabulary=void 0;Qv.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Qv.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Jv=Z((Bv)=>{Object.defineProperty(Bv,"__esModule",{value:!0});var Vg=gL(),qg=QK(),Fg=wv(),Mg=Wv(),Yv=Nv(),jg=[Vg.default,qg.default,Fg.default(),Mg.default,Yv.metadataVocabulary,Yv.contentVocabulary];Bv.default=jg});var zv=Z((Av)=>{Object.defineProperty(Av,"__esModule",{value:!0});Av.DiscrError=void 0;var Hv;(function($){$.Tag="tag",$.Mapping="mapping"})(Hv||(Av.DiscrError=Hv={}))});var vv=Z((Kv)=>{Object.defineProperty(Kv,"__esModule",{value:!0});var g1=a(),vQ=zv(),Lv=Ab(),Sg=LU(),Pg=W$(),kg={message:({params:{discrError:$,tagName:I}})=>$===vQ.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>g1._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},Rg={keyword:"discriminator",type:"object",schemaType:"object",error:kg,code($){let{gen:I,data:U,schema:b,parentSchema:w,it:X}=$,{oneOf:D}=w;if(!X.opts.discriminator)throw new Error("discriminator: requires discriminator option");let W=b.propertyName;if(typeof W!="string")throw new Error("discriminator: requires propertyName");if(b.mapping)throw new Error("discriminator: mapping is not supported");if(!D)throw new Error("discriminator: requires oneOf keyword");let Q=I.let("valid",!1),G=I.const("tag",g1._`${U}${g1.getProperty(W)}`);I.if(g1._`typeof ${G} == "string"`,()=>N(),()=>$.error(!1,{discrError:vQ.DiscrError.Tag,tag:G,tagName:W})),$.ok(Q);function N(){let J=H();I.if(!1);for(let A in J)I.elseIf(g1._`${G} === ${A}`),I.assign(Q,B(J[A]));I.else(),$.error(!1,{discrError:vQ.DiscrError.Mapping,tag:G,tagName:W}),I.endIf()}function B(J){let A=I.name("valid"),O=$.subschema({keyword:"oneOf",schemaProp:J},A);return $.mergeEvaluated(O,g1.Name),A}function H(){var J;let A={},O=q(w),V=!0;for(let x=0;x<D.length;x++){let l=D[x];if((l===null||l===void 0?void 0:l.$ref)&&!Pg.schemaHasRulesButRef(l,X.self.RULES)){let Y6=l.$ref;if(l=Lv.resolveRef.call(X.self,X.schemaEnv.root,X.baseId,Y6),l instanceof Lv.SchemaEnv)l=l.schema;if(l===void 0)throw new Sg.default(X.opts.uriResolver,X.baseId,Y6)}let l$=(J=l===null||l===void 0?void 0:l.properties)===null||J===void 0?void 0:J[W];if(typeof l$!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${W}"`);V=V&&(O||q(l)),k(l$,x)}if(!V)throw new Error(`discriminator: "${W}" must be required`);return A;function q({required:x}){return Array.isArray(x)&&x.includes(W)}function k(x,l){if(x.const)P(x.const,l);else if(x.enum)for(let l$ of x.enum)P(l$,l);else throw new Error(`discriminator: "properties/${W}" must have "const" or "enum"`)}function P(x,l){if(typeof x!="string"||x in A)throw new Error(`discriminator: "${W}" values must be unique strings`);A[x]=l}}}};Kv.default=Rg});var Vv=Z((fo,_g)=>{_g.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}});var qQ=Z((I6,VQ)=>{Object.defineProperty(I6,"__esModule",{value:!0});I6.MissingRefError=I6.ValidationError=I6.CodeGen=I6.Name=I6.nil=I6.stringify=I6.str=I6._=I6.KeywordCxt=I6.Ajv=void 0;var Zg=jL(),Cg=Jv(),gg=vv(),qv=Vv(),xg=["/properties"],gb="http://json-schema.org/draft-07/schema";class RU extends Zg.default{_addVocabularies(){if(super._addVocabularies(),Cg.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(gg.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(qv,xg):qv;this.addMetaSchema($,gb,!1),this.refs["http://json-schema.org/schema"]=gb}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(gb)?gb:void 0)}}I6.Ajv=RU;VQ.exports=I6=RU;VQ.exports.Ajv=RU;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=RU;var hg=zU();Object.defineProperty(I6,"KeywordCxt",{enumerable:!0,get:function(){return hg.KeywordCxt}});var x1=a();Object.defineProperty(I6,"_",{enumerable:!0,get:function(){return x1._}});Object.defineProperty(I6,"str",{enumerable:!0,get:function(){return x1.str}});Object.defineProperty(I6,"stringify",{enumerable:!0,get:function(){return x1.stringify}});Object.defineProperty(I6,"nil",{enumerable:!0,get:function(){return x1.nil}});Object.defineProperty(I6,"Name",{enumerable:!0,get:function(){return x1.Name}});Object.defineProperty(I6,"CodeGen",{enumerable:!0,get:function(){return x1.CodeGen}});var fg=Jb();Object.defineProperty(I6,"ValidationError",{enumerable:!0,get:function(){return fg.default}});var yg=LU();Object.defineProperty(I6,"MissingRefError",{enumerable:!0,get:function(){return yg.default}})});var _v=Z((Rv)=>{Object.defineProperty(Rv,"__esModule",{value:!0});Rv.formatNames=Rv.fastFormats=Rv.fullFormats=void 0;function y6($,I){return{validate:$,compare:I}}Rv.fullFormats={date:y6(Ev,EQ),time:y6(MQ(!0),SQ),"date-time":y6(Fv(!0),Pv),"iso-time":y6(MQ(),Sv),"iso-date-time":y6(Fv(),kv),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:og,"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:$x,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:dg,int32:{type:"number",validate:ag},int64:{type:"number",validate:eg},float:{type:"number",validate:jv},double:{type:"number",validate:jv},password:!0,binary:!0};Rv.fastFormats={...Rv.fullFormats,date:y6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,EQ),time:y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,SQ),"date-time":y6(/^\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,Pv),"iso-time":y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Sv),"iso-date-time":y6(/^\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,kv),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};Rv.formatNames=Object.keys(Rv.fullFormats);function cg($){return $%4===0&&($%100!==0||$%400===0)}var mg=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,rg=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ev($){let I=mg.exec($);if(!I)return!1;let U=+I[1],b=+I[2],w=+I[3];return b>=1&&b<=12&&w>=1&&w<=(b===2&&cg(U)?29:rg[b])}function EQ($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var FQ=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function MQ($){return function I(U){let b=FQ.exec(U);if(!b)return!1;let w=+b[1],X=+b[2],D=+b[3],W=b[4],Q=b[5]==="-"?-1:1,G=+(b[6]||0),N=+(b[7]||0);if(G>23||N>59||$&&!W)return!1;if(w<=23&&X<=59&&D<60)return!0;let B=X-N*Q,H=w-G*Q-(B<0?1:0);return(H===23||H===-1)&&(B===59||B===-1)&&D<61}}function SQ($,I){if(!($&&I))return;let U=new Date("2020-01-01T"+$).valueOf(),b=new Date("2020-01-01T"+I).valueOf();if(!(U&&b))return;return U-b}function Sv($,I){if(!($&&I))return;let U=FQ.exec($),b=FQ.exec(I);if(!(U&&b))return;if($=U[1]+U[2]+U[3],I=b[1]+b[2]+b[3],$>I)return 1;if($<I)return-1;return 0}var jQ=/t|\s/i;function Fv($){let I=MQ($);return function U(b){let w=b.split(jQ);return w.length===2&&Ev(w[0])&&I(w[1])}}function Pv($,I){if(!($&&I))return;let U=new Date($).valueOf(),b=new Date(I).valueOf();if(!(U&&b))return;return U-b}function kv($,I){if(!($&&I))return;let[U,b]=$.split(jQ),[w,X]=I.split(jQ),D=EQ(U,w);if(D===void 0)return;return D||SQ(b,X)}var ng=/\/|:/,ig=/^(?:[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 og($){return ng.test($)&&ig.test($)}var Mv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function dg($){return Mv.lastIndex=0,Mv.test($)}var pg=-2147483648,tg=2147483647;function ag($){return Number.isInteger($)&&$<=tg&&$>=pg}function eg($){return Number.isInteger($)}function jv(){return!0}var sg=/[^\\]\\Z/;function $x($){if(sg.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var Cv=Z((Zv)=>{Object.defineProperty(Zv,"__esModule",{value:!0});Zv.formatLimitDefinition=void 0;var Ux=qQ(),R6=a(),q4=R6.operators,xb={formatMaximum:{okStr:"<=",ok:q4.LTE,fail:q4.GT},formatMinimum:{okStr:">=",ok:q4.GTE,fail:q4.LT},formatExclusiveMaximum:{okStr:"<",ok:q4.LT,fail:q4.GTE},formatExclusiveMinimum:{okStr:">",ok:q4.GT,fail:q4.LTE}},wx={message:({keyword:$,schemaCode:I})=>R6.str`should be ${xb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>R6._`{comparison: ${xb[$].okStr}, limit: ${I}}`};Zv.formatLimitDefinition={keyword:Object.keys(xb),type:"string",schemaType:"string",$data:!0,error:wx,code($){let{gen:I,data:U,schemaCode:b,keyword:w,it:X}=$,{opts:D,self:W}=X;if(!D.validateFormats)return;let Q=new Ux.KeywordCxt(X,W.RULES.all.format.definition,"format");if(Q.$data)G();else N();function G(){let H=I.scopeValue("formats",{ref:W.formats,code:D.code.formats}),J=I.const("fmt",R6._`${H}[${Q.schemaCode}]`);$.fail$data(R6.or(R6._`typeof ${J} != "object"`,R6._`${J} instanceof RegExp`,R6._`typeof ${J}.compare != "function"`,B(J)))}function N(){let H=Q.schema,J=W.formats[H];if(!J||J===!0)return;if(typeof J!="object"||J instanceof RegExp||typeof J.compare!="function")throw new Error(`"${w}": format "${H}" does not define "compare" function`);let A=I.scopeValue("formats",{key:H,ref:J,code:D.code.formats?R6._`${D.code.formats}${R6.getProperty(H)}`:void 0});$.fail$data(B(A))}function B(H){return R6._`${H}.compare(${U}, ${b}) ${xb[w].fail} 0`}},dependencies:["format"]};var bx=($)=>{return $.addKeyword(Zv.formatLimitDefinition),$};Zv.default=bx});var fv=Z((TU,hv)=>{Object.defineProperty(TU,"__esModule",{value:!0});var h1=_v(),Dx=Cv(),RQ=a(),gv=new RQ.Name("fullFormats"),Wx=new RQ.Name("fastFormats"),TQ=($,I={keywords:!0})=>{if(Array.isArray(I))return xv($,I,h1.fullFormats,gv),$;let[U,b]=I.mode==="fast"?[h1.fastFormats,Wx]:[h1.fullFormats,gv],w=I.formats||h1.formatNames;if(xv($,w,U,b),I.keywords)Dx.default($);return $};TQ.get=($,I="full")=>{let b=(I==="fast"?h1.fastFormats:h1.fullFormats)[$];if(!b)throw new Error(`Unknown format "${$}"`);return b};function xv($,I,U,b){var w,X;(w=(X=$.opts.code).formats)!==null&&w!==void 0||(X.formats=RQ._`require("ajv-formats/dist/formats").${b}`);for(let D of I)$.addFormat(D,U[D])}hv.exports=TU=TQ;Object.defineProperty(TU,"__esModule",{value:!0});TU.default=TQ});var $$;(function($){$.assertEqual=(w)=>{};function I(w){}$.assertIs=I;function U(w){throw new Error}$.assertNever=U,$.arrayToEnum=(w)=>{let X={};for(let D of w)X[D]=D;return X},$.getValidEnumValues=(w)=>{let X=$.objectKeys(w).filter((W)=>typeof w[w[W]]!=="number"),D={};for(let W of X)D[W]=w[W];return $.objectValues(D)},$.objectValues=(w)=>{return $.objectKeys(w).map(function(X){return w[X]})},$.objectKeys=typeof Object.keys==="function"?(w)=>Object.keys(w):(w)=>{let X=[];for(let D in w)if(Object.prototype.hasOwnProperty.call(w,D))X.push(D);return X},$.find=(w,X)=>{for(let D of w)if(X(D))return D;return},$.isInteger=typeof Number.isInteger==="function"?(w)=>Number.isInteger(w):(w)=>typeof w==="number"&&Number.isFinite(w)&&Math.floor(w)===w;function b(w,X=" | "){return w.map((D)=>typeof D==="string"?`'${D}'`:D).join(X)}$.joinValues=b,$.jsonStringifyReplacer=(w,X)=>{if(typeof X==="bigint")return X.toString();return X}})($$||($$={}));var KH;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(KH||(KH={}));var R=$$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o6=($)=>{switch(typeof $){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN($)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":if(Array.isArray($))return R.array;if($===null)return R.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return R.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return R.map;if(typeof Set!=="undefined"&&$ instanceof Set)return R.set;if(typeof Date!=="undefined"&&$ instanceof Date)return R.date;return R.object;default:return R.unknown}};var F=$$.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 X6 extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(U)=>{this.issues=[...this.issues,U]},this.addIssues=(U=[])=>{this.issues=[...this.issues,...U]};let I=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,I);else this.__proto__=I;this.name="ZodError",this.issues=$}format($){let I=$||function(w){return w.message},U={_errors:[]},b=(w)=>{for(let X of w.issues)if(X.code==="invalid_union")X.unionErrors.map(b);else if(X.code==="invalid_return_type")b(X.returnTypeError);else if(X.code==="invalid_arguments")b(X.argumentsError);else if(X.path.length===0)U._errors.push(I(X));else{let D=U,W=0;while(W<X.path.length){let Q=X.path[W];if(W!==X.path.length-1)D[Q]=D[Q]||{_errors:[]};else D[Q]=D[Q]||{_errors:[]},D[Q]._errors.push(I(X));D=D[Q],W++}}};return b(this),U}static assert($){if(!($ instanceof X6))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(I)=>I.message){let I={},U=[];for(let b of this.issues)if(b.path.length>0){let w=b.path[0];I[w]=I[w]||[],I[w].push($(b))}else U.push($(b));return{formErrors:U,fieldErrors:I}}get formErrors(){return this.flatten()}}X6.create=($)=>{return new X6($)};var lM=($,I)=>{let U;switch($.code){case F.invalid_type:if($.received===R.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case F.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,$$.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:U=`Unrecognized key(s) in object: ${$$.joinValues($.keys,", ")}`;break;case F.invalid_union:U="Invalid input";break;case F.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${$$.joinValues($.options)}`;break;case F.invalid_enum_value:U=`Invalid enum value. Expected ${$$.joinValues($.options)}, received '${$.received}'`;break;case F.invalid_arguments:U="Invalid function arguments";break;case F.invalid_return_type:U="Invalid function return type";break;case F.invalid_date:U="Invalid date";break;case F.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(U=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")U=`${U} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)U=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)U=`Invalid input: must end with "${$.validation.endsWith}"`;else $$.assertNever($.validation);else if($.validation!=="regex")U=`Invalid ${$.validation}`;else U="Invalid";break;case F.too_small:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else U="Invalid input";break;case F.too_big:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")U=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else U="Invalid input";break;case F.custom:U="Invalid input";break;case F.invalid_intersection_types:U="Intersection results could not be merged";break;case F.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case F.not_finite:U="Number must be finite";break;default:U=I.defaultError,$$.assertNever($)}return{message:U}},W4=lM;var cM=W4;function EI(){return cM}var t0=($)=>{let{data:I,path:U,errorMaps:b,issueData:w}=$,X=[...U,...w.path||[]],D={...w,path:X};if(w.message!==void 0)return{...w,path:X,message:w.message};let W="",Q=b.filter((G)=>!!G).slice().reverse();for(let G of Q)W=G(D,{data:I,defaultError:W}).message;return{...w,path:X,message:W}};function T($,I){let U=EI(),b=t0({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===W4?void 0:W4].filter((w)=>!!w)});$.common.issues.push(b)}class f${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,I){let U=[];for(let b of I){if(b.status==="aborted")return r;if(b.status==="dirty")$.dirty();U.push(b.value)}return{status:$.value,value:U}}static async mergeObjectAsync($,I){let U=[];for(let b of I){let w=await b.key,X=await b.value;U.push({key:w,value:X})}return f$.mergeObjectSync($,U)}static mergeObjectSync($,I){let U={};for(let b of I){let{key:w,value:X}=b;if(w.status==="aborted")return r;if(X.status==="aborted")return r;if(w.status==="dirty")$.dirty();if(X.status==="dirty")$.dirty();if(w.value!=="__proto__"&&(typeof X.value!=="undefined"||b.alwaysSet))U[w.value]=X.value}return{status:$.value,value:U}}}var r=Object.freeze({status:"aborted"}),J1=($)=>({status:"dirty",value:$}),c$=($)=>({status:"valid",value:$}),mD=($)=>$.status==="aborted",rD=($)=>$.status==="dirty",f4=($)=>$.status==="valid",SI=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var g;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(g||(g={}));class V6{constructor($,I,U,b){this._cachedPath=[],this.parent=$,this.data=I,this._path=U,this._key=b}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 vH=($,I)=>{if(f4(I))return{success:!0,data:I.value};else{if(!$.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let U=new X6($.common.issues);return this._error=U,this._error}}}};function d($){if(!$)return{};let{errorMap:I,invalid_type_error:U,required_error:b,description:w}=$;if(I&&(U||b))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(I)return{errorMap:I,description:w};return{errorMap:(D,W)=>{let{message:Q}=$;if(D.code==="invalid_enum_value")return{message:Q??W.defaultError};if(typeof W.data==="undefined")return{message:Q??b??W.defaultError};if(D.code!=="invalid_type")return{message:W.defaultError};return{message:Q??U??W.defaultError}},description:w}}class e{get description(){return this._def.description}_getType($){return o6($.data)}_getOrReturnCtx($,I){return I||{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new f$,ctx:{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let I=this._parse($);if(SI(I))throw new Error("Synchronous parse encountered promise.");return I}_parseAsync($){let I=this._parse($);return Promise.resolve(I)}parse($,I){let U=this.safeParse($,I);if(U.success)return U.data;throw U.error}safeParse($,I){let U={common:{issues:[],async:I?.async??!1,contextualErrorMap:I?.errorMap},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)},b=this._parseSync({data:$,path:U.path,parent:U});return vH(U,b)}"~validate"($){let I={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)};if(!this["~standard"].async)try{let U=this._parseSync({data:$,path:[],parent:I});return f4(U)?{value:U.value}:{issues:I.common.issues}}catch(U){if(U?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;I.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:I}).then((U)=>f4(U)?{value:U.value}:{issues:I.common.issues})}async parseAsync($,I){let U=await this.safeParseAsync($,I);if(U.success)return U.data;throw U.error}async safeParseAsync($,I){let U={common:{issues:[],contextualErrorMap:I?.errorMap,async:!0},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)},b=this._parse({data:$,path:U.path,parent:U}),w=await(SI(b)?b:Promise.resolve(b));return vH(U,w)}refine($,I){let U=(b)=>{if(typeof I==="string"||typeof I==="undefined")return{message:I};else if(typeof I==="function")return I(b);else return I};return this._refinement((b,w)=>{let X=$(b),D=()=>w.addIssue({code:F.custom,...U(b)});if(typeof Promise!=="undefined"&&X instanceof Promise)return X.then((W)=>{if(!W)return D(),!1;else return!0});if(!X)return D(),!1;else return!0})}refinement($,I){return this._refinement((U,b)=>{if(!$(U))return b.addIssue(typeof I==="function"?I(U,b):I),!1;else return!0})}_refinement($){return new g6({schema:this,typeName:M.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(I)=>this["~validate"](I)}}optional(){return B6.create(this,this._def)}nullable(){return Q4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return C6.create(this)}promise(){return L1.create(this,this._def)}or($){return _I.create([this,$],this._def)}and($){return ZI.create(this,$,this._def)}transform($){return new g6({...d(this._def),schema:this,typeName:M.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new hI({...d(this._def),innerType:this,defaultValue:I,typeName:M.ZodDefault})}brand(){return new dD({typeName:M.ZodBranded,type:this,...d(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new fI({...d(this._def),innerType:this,catchValue:I,typeName:M.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return bw.create(this,$)}readonly(){return yI.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var mM=/^c[^\s-]{8,}$/i,rM=/^[0-9a-z]+$/,nM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,iM=/^[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,oM=/^[a-z0-9_-]{21}$/i,dM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pM=/^[-+]?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)?)??$/,tM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,aM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",nD,eM=/^(?:(?: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])$/,sM=/^(?:(?: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])$/,$j=/^(([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]))$/,Ij=/^(([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])$/,Uj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,VH="((\\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])))",bj=new RegExp(`^${VH}$`);function qH($){let I="[0-5]\\d";if($.precision)I=`${I}\\.\\d{${$.precision}}`;else if($.precision==null)I=`${I}(\\.\\d+)?`;let U=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${I})${U}`}function Xj($){return new RegExp(`^${qH($)}$`)}function Dj($){let I=`${VH}T${qH($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function Wj($,I){if((I==="v4"||!I)&&eM.test($))return!0;if((I==="v6"||!I)&&$j.test($))return!0;return!1}function Qj($,I){if(!dM.test($))return!1;try{let[U]=$.split(".");if(!U)return!1;let b=U.replace(/-/g,"+").replace(/_/g,"/").padEnd(U.length+(4-U.length%4)%4,"="),w=JSON.parse(atob(b));if(typeof w!=="object"||w===null)return!1;if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&w.alg!==I)return!1;return!0}catch{return!1}}function Gj($,I){if((I==="v4"||!I)&&sM.test($))return!0;if((I==="v6"||!I)&&Ij.test($))return!0;return!1}class p6 extends e{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==R.string){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.string,received:w.parsedType}),r}let U=new f$,b=void 0;for(let w of this._def.checks)if(w.kind==="min"){if($.data.length<w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),U.dirty()}else if(w.kind==="max"){if($.data.length>w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),U.dirty()}else if(w.kind==="length"){let X=$.data.length>w.value,D=$.data.length<w.value;if(X||D){if(b=this._getOrReturnCtx($,b),X)T(b,{code:F.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});else if(D)T(b,{code:F.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});U.dirty()}}else if(w.kind==="email"){if(!tM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"email",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="emoji"){if(!nD)nD=new RegExp(aM,"u");if(!nD.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"emoji",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="uuid"){if(!iM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"uuid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="nanoid"){if(!oM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"nanoid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid"){if(!mM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid2"){if(!rM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid2",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ulid"){if(!nM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"ulid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="url")try{new URL($.data)}catch{b=this._getOrReturnCtx($,b),T(b,{validation:"url",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="regex"){if(w.regex.lastIndex=0,!w.regex.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"regex",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="trim")$.data=$.data.trim();else if(w.kind==="includes"){if(!$.data.includes(w.value,w.position))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{includes:w.value,position:w.position},message:w.message}),U.dirty()}else if(w.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(w.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(w.kind==="startsWith"){if(!$.data.startsWith(w.value))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{startsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="endsWith"){if(!$.data.endsWith(w.value))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{endsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="datetime"){if(!Dj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"datetime",message:w.message}),U.dirty()}else if(w.kind==="date"){if(!bj.test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"date",message:w.message}),U.dirty()}else if(w.kind==="time"){if(!Xj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"time",message:w.message}),U.dirty()}else if(w.kind==="duration"){if(!pM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"duration",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ip"){if(!Wj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"ip",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="jwt"){if(!Qj($.data,w.alg))b=this._getOrReturnCtx($,b),T(b,{validation:"jwt",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cidr"){if(!Gj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"cidr",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64"){if(!Uj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64url"){if(!wj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64url",code:F.invalid_string,message:w.message}),U.dirty()}else $$.assertNever(w);return{status:U.value,value:$.data}}_regex($,I,U){return this.refinement((b)=>$.test(b),{validation:I,code:F.invalid_string,...g.errToObj(U)})}_addCheck($){return new p6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...g.errToObj($)})}url($){return this._addCheck({kind:"url",...g.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...g.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...g.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...g.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...g.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...g.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...g.errToObj($)})}base64($){return this._addCheck({kind:"base64",...g.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...g.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...g.errToObj($)})}ip($){return this._addCheck({kind:"ip",...g.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...g.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision==="undefined"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...g.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision==="undefined"?null:$?.precision,...g.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...g.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...g.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...g.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...g.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...g.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...g.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...g.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...g.errToObj(I)})}nonempty($){return this.min(1,g.errToObj($))}trim(){return new p6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxLength(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}p6.create=($)=>{return new p6({checks:[],typeName:M.ZodString,coerce:$?.coerce??!1,...d($)})};function Nj($,I){let U=($.toString().split(".")[1]||"").length,b=(I.toString().split(".")[1]||"").length,w=U>b?U:b,X=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(I.toFixed(w).replace(".",""));return X%D/10**w}class A1 extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==R.number){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.number,received:w.parsedType}),r}let U=void 0,b=new f$;for(let w of this._def.checks)if(w.kind==="int"){if(!$$.isInteger($.data))U=this._getOrReturnCtx($,U),T(U,{code:F.invalid_type,expected:"integer",received:"float",message:w.message}),b.dirty()}else if(w.kind==="min"){if(w.inclusive?$.data<w.value:$.data<=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_small,minimum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="max"){if(w.inclusive?$.data>w.value:$.data>=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if(Nj($.data,w.value)!==0)U=this._getOrReturnCtx($,U),T(U,{code:F.not_multiple_of,multipleOf:w.value,message:w.message}),b.dirty()}else if(w.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),T(U,{code:F.not_finite,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,g.toString(I))}gt($,I){return this.setLimit("min",$,!1,g.toString(I))}lte($,I){return this.setLimit("max",$,!0,g.toString(I))}lt($,I){return this.setLimit("max",$,!1,g.toString(I))}setLimit($,I,U,b){return new A1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:g.toString(b)}]})}_addCheck($){return new A1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:g.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(I)})}finite($){return this._addCheck({kind:"finite",message:g.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString($)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&$$.isInteger($.value))}get isFinite(){let $=null,I=null;for(let U of this._def.checks)if(U.kind==="finite"||U.kind==="int"||U.kind==="multipleOf")return!0;else if(U.kind==="min"){if(I===null||U.value>I)I=U.value}else if(U.kind==="max"){if($===null||U.value<$)$=U.value}return Number.isFinite(I)&&Number.isFinite($)}}A1.create=($)=>{return new A1({checks:[],typeName:M.ZodNumber,coerce:$?.coerce||!1,...d($)})};class O1 extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==R.bigint)return this._getInvalidInput($);let U=void 0,b=new f$;for(let w of this._def.checks)if(w.kind==="min"){if(w.inclusive?$.data<w.value:$.data<=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_small,type:"bigint",minimum:w.value,inclusive:w.inclusive,message:w.message}),b.dirty()}else if(w.kind==="max"){if(w.inclusive?$.data>w.value:$.data>=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_big,type:"bigint",maximum:w.value,inclusive:w.inclusive,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if($.data%w.value!==BigInt(0))U=this._getOrReturnCtx($,U),T(U,{code:F.not_multiple_of,multipleOf:w.value,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}_getInvalidInput($){let I=this._getOrReturnCtx($);return T(I,{code:F.invalid_type,expected:R.bigint,received:I.parsedType}),r}gte($,I){return this.setLimit("min",$,!0,g.toString(I))}gt($,I){return this.setLimit("min",$,!1,g.toString(I))}lte($,I){return this.setLimit("max",$,!0,g.toString(I))}lt($,I){return this.setLimit("max",$,!1,g.toString(I))}setLimit($,I,U,b){return new O1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:g.toString(b)}]})}_addCheck($){return new O1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(I)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}O1.create=($)=>{return new O1({checks:[],typeName:M.ZodBigInt,coerce:$?.coerce??!1,...d($)})};class a0 extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.boolean,received:U.parsedType}),r}return c$($.data)}}a0.create=($)=>{return new a0({typeName:M.ZodBoolean,coerce:$?.coerce||!1,...d($)})};class kI extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.date,received:w.parsedType}),r}if(Number.isNaN($.data.getTime())){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_date}),r}let U=new f$,b=void 0;for(let w of this._def.checks)if(w.kind==="min"){if($.data.getTime()<w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_small,message:w.message,inclusive:!0,exact:!1,minimum:w.value,type:"date"}),U.dirty()}else if(w.kind==="max"){if($.data.getTime()>w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_big,message:w.message,inclusive:!0,exact:!1,maximum:w.value,type:"date"}),U.dirty()}else $$.assertNever(w);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new kI({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:g.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:g.toString(I)})}get minDate(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $!=null?new Date($):null}}kI.create=($)=>{return new kI({checks:[],coerce:$?.coerce||!1,typeName:M.ZodDate,...d($)})};class e0 extends e{_parse($){if(this._getType($)!==R.symbol){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.symbol,received:U.parsedType}),r}return c$($.data)}}e0.create=($)=>{return new e0({typeName:M.ZodSymbol,...d($)})};class RI extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.undefined,received:U.parsedType}),r}return c$($.data)}}RI.create=($)=>{return new RI({typeName:M.ZodUndefined,...d($)})};class TI extends e{_parse($){if(this._getType($)!==R.null){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.null,received:U.parsedType}),r}return c$($.data)}}TI.create=($)=>{return new TI({typeName:M.ZodNull,...d($)})};class s0 extends e{constructor(){super(...arguments);this._any=!0}_parse($){return c$($.data)}}s0.create=($)=>{return new s0({typeName:M.ZodAny,...d($)})};class y4 extends e{constructor(){super(...arguments);this._unknown=!0}_parse($){return c$($.data)}}y4.create=($)=>{return new y4({typeName:M.ZodUnknown,...d($)})};class t6 extends e{_parse($){let I=this._getOrReturnCtx($);return T(I,{code:F.invalid_type,expected:R.never,received:I.parsedType}),r}}t6.create=($)=>{return new t6({typeName:M.ZodNever,...d($)})};class $w extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.void,received:U.parsedType}),r}return c$($.data)}}$w.create=($)=>{return new $w({typeName:M.ZodVoid,...d($)})};class C6 extends e{_parse($){let{ctx:I,status:U}=this._processInputParams($),b=this._def;if(I.parsedType!==R.array)return T(I,{code:F.invalid_type,expected:R.array,received:I.parsedType}),r;if(b.exactLength!==null){let X=I.data.length>b.exactLength.value,D=I.data.length<b.exactLength.value;if(X||D)T(I,{code:X?F.too_big:F.too_small,minimum:D?b.exactLength.value:void 0,maximum:X?b.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:b.exactLength.message}),U.dirty()}if(b.minLength!==null){if(I.data.length<b.minLength.value)T(I,{code:F.too_small,minimum:b.minLength.value,type:"array",inclusive:!0,exact:!1,message:b.minLength.message}),U.dirty()}if(b.maxLength!==null){if(I.data.length>b.maxLength.value)T(I,{code:F.too_big,maximum:b.maxLength.value,type:"array",inclusive:!0,exact:!1,message:b.maxLength.message}),U.dirty()}if(I.common.async)return Promise.all([...I.data].map((X,D)=>{return b.type._parseAsync(new V6(I,X,I.path,D))})).then((X)=>{return f$.mergeArray(U,X)});let w=[...I.data].map((X,D)=>{return b.type._parseSync(new V6(I,X,I.path,D))});return f$.mergeArray(U,w)}get element(){return this._def.type}min($,I){return new C6({...this._def,minLength:{value:$,message:g.toString(I)}})}max($,I){return new C6({...this._def,maxLength:{value:$,message:g.toString(I)}})}length($,I){return new C6({...this._def,exactLength:{value:$,message:g.toString(I)}})}nonempty($){return this.min(1,$)}}C6.create=($,I)=>{return new C6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:M.ZodArray,...d(I)})};function H1($){if($ instanceof E$){let I={};for(let U in $.shape){let b=$.shape[U];I[U]=B6.create(H1(b))}return new E$({...$._def,shape:()=>I})}else if($ instanceof C6)return new C6({...$._def,type:H1($.element)});else if($ instanceof B6)return B6.create(H1($.unwrap()));else if($ instanceof Q4)return Q4.create(H1($.unwrap()));else if($ instanceof a6)return a6.create($.items.map((I)=>H1(I)));else return $}class E$ extends e{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),I=$$.objectKeys($);return this._cached={shape:$,keys:I},this._cached}_parse($){if(this._getType($)!==R.object){let Q=this._getOrReturnCtx($);return T(Q,{code:F.invalid_type,expected:R.object,received:Q.parsedType}),r}let{status:U,ctx:b}=this._processInputParams($),{shape:w,keys:X}=this._getCached(),D=[];if(!(this._def.catchall instanceof t6&&this._def.unknownKeys==="strip")){for(let Q in b.data)if(!X.includes(Q))D.push(Q)}let W=[];for(let Q of X){let G=w[Q],N=b.data[Q];W.push({key:{status:"valid",value:Q},value:G._parse(new V6(b,N,b.path,Q)),alwaysSet:Q in b.data})}if(this._def.catchall instanceof t6){let Q=this._def.unknownKeys;if(Q==="passthrough")for(let G of D)W.push({key:{status:"valid",value:G},value:{status:"valid",value:b.data[G]}});else if(Q==="strict"){if(D.length>0)T(b,{code:F.unrecognized_keys,keys:D}),U.dirty()}else if(Q==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Q=this._def.catchall;for(let G of D){let N=b.data[G];W.push({key:{status:"valid",value:G},value:Q._parse(new V6(b,N,b.path,G)),alwaysSet:G in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let Q=[];for(let G of W){let N=await G.key,B=await G.value;Q.push({key:N,value:B,alwaysSet:G.alwaysSet})}return Q}).then((Q)=>{return f$.mergeObjectSync(U,Q)});else return f$.mergeObjectSync(U,W)}get shape(){return this._def.shape()}strict($){return g.errToObj,new E$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(I,U)=>{let b=this._def.errorMap?.(I,U).message??U.defaultError;if(I.code==="unrecognized_keys")return{message:g.errToObj($).message??b};return{message:b}}}:{}})}strip(){return new E$({...this._def,unknownKeys:"strip"})}passthrough(){return new E$({...this._def,unknownKeys:"passthrough"})}extend($){return new E$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new E$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:M.ZodObject})}setKey($,I){return this.augment({[$]:I})}catchall($){return new E$({...this._def,catchall:$})}pick($){let I={};for(let U of $$.objectKeys($))if($[U]&&this.shape[U])I[U]=this.shape[U];return new E$({...this._def,shape:()=>I})}omit($){let I={};for(let U of $$.objectKeys(this.shape))if(!$[U])I[U]=this.shape[U];return new E$({...this._def,shape:()=>I})}deepPartial(){return H1(this)}partial($){let I={};for(let U of $$.objectKeys(this.shape)){let b=this.shape[U];if($&&!$[U])I[U]=b;else I[U]=b.optional()}return new E$({...this._def,shape:()=>I})}required($){let I={};for(let U of $$.objectKeys(this.shape))if($&&!$[U])I[U]=this.shape[U];else{let w=this.shape[U];while(w instanceof B6)w=w._def.innerType;I[U]=w}return new E$({...this._def,shape:()=>I})}keyof(){return FH($$.objectKeys(this.shape))}}E$.create=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strip",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};E$.strictCreate=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strict",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};E$.lazycreate=($,I)=>{return new E$({shape:$,unknownKeys:"strip",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};class _I extends e{_parse($){let{ctx:I}=this._processInputParams($),U=this._def.options;function b(w){for(let D of w)if(D.result.status==="valid")return D.result;for(let D of w)if(D.result.status==="dirty")return I.common.issues.push(...D.ctx.common.issues),D.result;let X=w.map((D)=>new X6(D.ctx.common.issues));return T(I,{code:F.invalid_union,unionErrors:X}),r}if(I.common.async)return Promise.all(U.map(async(w)=>{let X={...I,common:{...I.common,issues:[]},parent:null};return{result:await w._parseAsync({data:I.data,path:I.path,parent:X}),ctx:X}})).then(b);else{let w=void 0,X=[];for(let W of U){let Q={...I,common:{...I.common,issues:[]},parent:null},G=W._parseSync({data:I.data,path:I.path,parent:Q});if(G.status==="valid")return G;else if(G.status==="dirty"&&!w)w={result:G,ctx:Q};if(Q.common.issues.length)X.push(Q.common.issues)}if(w)return I.common.issues.push(...w.ctx.common.issues),w.result;let D=X.map((W)=>new X6(W));return T(I,{code:F.invalid_union,unionErrors:D}),r}}get options(){return this._def.options}}_I.create=($,I)=>{return new _I({options:$,typeName:M.ZodUnion,...d(I)})};var d6=($)=>{if($ instanceof CI)return d6($.schema);else if($ instanceof g6)return d6($.innerType());else if($ instanceof gI)return[$.value];else if($ instanceof u4)return $.options;else if($ instanceof xI)return $$.objectValues($.enum);else if($ instanceof hI)return d6($._def.innerType);else if($ instanceof RI)return[void 0];else if($ instanceof TI)return[null];else if($ instanceof B6)return[void 0,...d6($.unwrap())];else if($ instanceof Q4)return[null,...d6($.unwrap())];else if($ instanceof dD)return d6($.unwrap());else if($ instanceof yI)return d6($.unwrap());else if($ instanceof fI)return d6($._def.innerType);else return[]};class oD extends e{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.object)return T(I,{code:F.invalid_type,expected:R.object,received:I.parsedType}),r;let U=this.discriminator,b=I.data[U],w=this.optionsMap.get(b);if(!w)return T(I,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),r;if(I.common.async)return w._parseAsync({data:I.data,path:I.path,parent:I});else return w._parseSync({data:I.data,path:I.path,parent:I})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,I,U){let b=new Map;for(let w of I){let X=d6(w.shape[$]);if(!X.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let D of X){if(b.has(D))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(D)}`);b.set(D,w)}}return new oD({typeName:M.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:b,...d(U)})}}function iD($,I){let U=o6($),b=o6(I);if($===I)return{valid:!0,data:$};else if(U===R.object&&b===R.object){let w=$$.objectKeys(I),X=$$.objectKeys($).filter((W)=>w.indexOf(W)!==-1),D={...$,...I};for(let W of X){let Q=iD($[W],I[W]);if(!Q.valid)return{valid:!1};D[W]=Q.data}return{valid:!0,data:D}}else if(U===R.array&&b===R.array){if($.length!==I.length)return{valid:!1};let w=[];for(let X=0;X<$.length;X++){let D=$[X],W=I[X],Q=iD(D,W);if(!Q.valid)return{valid:!1};w.push(Q.data)}return{valid:!0,data:w}}else if(U===R.date&&b===R.date&&+$===+I)return{valid:!0,data:$};else return{valid:!1}}class ZI extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($),b=(w,X)=>{if(mD(w)||mD(X))return r;let D=iD(w.value,X.value);if(!D.valid)return T(U,{code:F.invalid_intersection_types}),r;if(rD(w)||rD(X))I.dirty();return{status:I.value,value:D.data}};if(U.common.async)return Promise.all([this._def.left._parseAsync({data:U.data,path:U.path,parent:U}),this._def.right._parseAsync({data:U.data,path:U.path,parent:U})]).then(([w,X])=>b(w,X));else return b(this._def.left._parseSync({data:U.data,path:U.path,parent:U}),this._def.right._parseSync({data:U.data,path:U.path,parent:U}))}}ZI.create=($,I,U)=>{return new ZI({left:$,right:I,typeName:M.ZodIntersection,...d(U)})};class a6 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.array)return T(U,{code:F.invalid_type,expected:R.array,received:U.parsedType}),r;if(U.data.length<this._def.items.length)return T(U,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r;if(!this._def.rest&&U.data.length>this._def.items.length)T(U,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I.dirty();let w=[...U.data].map((X,D)=>{let W=this._def.items[D]||this._def.rest;if(!W)return null;return W._parse(new V6(U,X,U.path,D))}).filter((X)=>!!X);if(U.common.async)return Promise.all(w).then((X)=>{return f$.mergeArray(I,X)});else return f$.mergeArray(I,w)}get items(){return this._def.items}rest($){return new a6({...this._def,rest:$})}}a6.create=($,I)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new a6({items:$,typeName:M.ZodTuple,rest:null,...d(I)})};class Iw extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.object)return T(U,{code:F.invalid_type,expected:R.object,received:U.parsedType}),r;let b=[],w=this._def.keyType,X=this._def.valueType;for(let D in U.data)b.push({key:w._parse(new V6(U,D,U.path,D)),value:X._parse(new V6(U,U.data[D],U.path,D)),alwaysSet:D in U.data});if(U.common.async)return f$.mergeObjectAsync(I,b);else return f$.mergeObjectSync(I,b)}get element(){return this._def.valueType}static create($,I,U){if(I instanceof e)return new Iw({keyType:$,valueType:I,typeName:M.ZodRecord,...d(U)});return new Iw({keyType:p6.create(),valueType:$,typeName:M.ZodRecord,...d(I)})}}class Uw extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.map)return T(U,{code:F.invalid_type,expected:R.map,received:U.parsedType}),r;let b=this._def.keyType,w=this._def.valueType,X=[...U.data.entries()].map(([D,W],Q)=>{return{key:b._parse(new V6(U,D,U.path,[Q,"key"])),value:w._parse(new V6(U,W,U.path,[Q,"value"]))}});if(U.common.async){let D=new Map;return Promise.resolve().then(async()=>{for(let W of X){let Q=await W.key,G=await W.value;if(Q.status==="aborted"||G.status==="aborted")return r;if(Q.status==="dirty"||G.status==="dirty")I.dirty();D.set(Q.value,G.value)}return{status:I.value,value:D}})}else{let D=new Map;for(let W of X){let{key:Q,value:G}=W;if(Q.status==="aborted"||G.status==="aborted")return r;if(Q.status==="dirty"||G.status==="dirty")I.dirty();D.set(Q.value,G.value)}return{status:I.value,value:D}}}}Uw.create=($,I,U)=>{return new Uw({valueType:I,keyType:$,typeName:M.ZodMap,...d(U)})};class z1 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.set)return T(U,{code:F.invalid_type,expected:R.set,received:U.parsedType}),r;let b=this._def;if(b.minSize!==null){if(U.data.size<b.minSize.value)T(U,{code:F.too_small,minimum:b.minSize.value,type:"set",inclusive:!0,exact:!1,message:b.minSize.message}),I.dirty()}if(b.maxSize!==null){if(U.data.size>b.maxSize.value)T(U,{code:F.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),I.dirty()}let w=this._def.valueType;function X(W){let Q=new Set;for(let G of W){if(G.status==="aborted")return r;if(G.status==="dirty")I.dirty();Q.add(G.value)}return{status:I.value,value:Q}}let D=[...U.data.values()].map((W,Q)=>w._parse(new V6(U,W,U.path,Q)));if(U.common.async)return Promise.all(D).then((W)=>X(W));else return X(D)}min($,I){return new z1({...this._def,minSize:{value:$,message:g.toString(I)}})}max($,I){return new z1({...this._def,maxSize:{value:$,message:g.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}z1.create=($,I)=>{return new z1({valueType:$,minSize:null,maxSize:null,typeName:M.ZodSet,...d(I)})};class PI extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.function)return T(I,{code:F.invalid_type,expected:R.function,received:I.parsedType}),r;function U(D,W){return t0({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,EI(),W4].filter((Q)=>!!Q),issueData:{code:F.invalid_arguments,argumentsError:W}})}function b(D,W){return t0({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,EI(),W4].filter((Q)=>!!Q),issueData:{code:F.invalid_return_type,returnTypeError:W}})}let w={errorMap:I.common.contextualErrorMap},X=I.data;if(this._def.returns instanceof L1){let D=this;return c$(async function(...W){let Q=new X6([]),G=await D._def.args.parseAsync(W,w).catch((H)=>{throw Q.addIssue(U(W,H)),Q}),N=await Reflect.apply(X,this,G);return await D._def.returns._def.type.parseAsync(N,w).catch((H)=>{throw Q.addIssue(b(N,H)),Q})})}else{let D=this;return c$(function(...W){let Q=D._def.args.safeParse(W,w);if(!Q.success)throw new X6([U(W,Q.error)]);let G=Reflect.apply(X,this,Q.data),N=D._def.returns.safeParse(G,w);if(!N.success)throw new X6([b(G,N.error)]);return N.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new PI({...this._def,args:a6.create($).rest(y4.create())})}returns($){return new PI({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new PI({args:$?$:a6.create([]).rest(y4.create()),returns:I||y4.create(),typeName:M.ZodFunction,...d(U)})}}class CI extends e{get schema(){return this._def.getter()}_parse($){let{ctx:I}=this._processInputParams($);return this._def.getter()._parse({data:I.data,path:I.path,parent:I})}}CI.create=($,I)=>{return new CI({getter:$,typeName:M.ZodLazy,...d(I)})};class gI extends e{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return T(I,{received:I.data,code:F.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}gI.create=($,I)=>{return new gI({value:$,typeName:M.ZodLiteral,...d(I)})};function FH($,I){return new u4({values:$,typeName:M.ZodEnum,...d(I)})}class u4 extends e{_parse($){if(typeof $.data!=="string"){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{expected:$$.joinValues(U),received:I.parsedType,code:F.invalid_type}),r}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{received:I.data,code:F.invalid_enum_value,options:U}),r}return c$($.data)}get options(){return this._def.values}get enum(){let $={};for(let I of this._def.values)$[I]=I;return $}get Values(){let $={};for(let I of this._def.values)$[I]=I;return $}get Enum(){let $={};for(let I of this._def.values)$[I]=I;return $}extract($,I=this._def){return u4.create($,{...this._def,...I})}exclude($,I=this._def){return u4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}u4.create=FH;class xI extends e{_parse($){let I=$$.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==R.string&&U.parsedType!==R.number){let b=$$.objectValues(I);return T(U,{expected:$$.joinValues(b),received:U.parsedType,code:F.invalid_type}),r}if(!this._cache)this._cache=new Set($$.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let b=$$.objectValues(I);return T(U,{received:U.data,code:F.invalid_enum_value,options:b}),r}return c$($.data)}get enum(){return this._def.values}}xI.create=($,I)=>{return new xI({values:$,typeName:M.ZodNativeEnum,...d(I)})};class L1 extends e{unwrap(){return this._def.type}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.promise&&I.common.async===!1)return T(I,{code:F.invalid_type,expected:R.promise,received:I.parsedType}),r;let U=I.parsedType===R.promise?I.data:Promise.resolve(I.data);return c$(U.then((b)=>{return this._def.type.parseAsync(b,{path:I.path,errorMap:I.common.contextualErrorMap})}))}}L1.create=($,I)=>{return new L1({type:$,typeName:M.ZodPromise,...d(I)})};class g6 extends e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===M.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:I,ctx:U}=this._processInputParams($),b=this._def.effect||null,w={addIssue:(X)=>{if(T(U,X),X.fatal)I.abort();else I.dirty()},get path(){return U.path}};if(w.addIssue=w.addIssue.bind(w),b.type==="preprocess"){let X=b.transform(U.data,w);if(U.common.async)return Promise.resolve(X).then(async(D)=>{if(I.value==="aborted")return r;let W=await this._def.schema._parseAsync({data:D,path:U.path,parent:U});if(W.status==="aborted")return r;if(W.status==="dirty")return J1(W.value);if(I.value==="dirty")return J1(W.value);return W});else{if(I.value==="aborted")return r;let D=this._def.schema._parseSync({data:X,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")return J1(D.value);if(I.value==="dirty")return J1(D.value);return D}}if(b.type==="refinement"){let X=(D)=>{let W=b.refinement(D,w);if(U.common.async)return Promise.resolve(W);if(W instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return D};if(U.common.async===!1){let D=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")I.dirty();return X(D.value),{status:I.value,value:D.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((D)=>{if(D.status==="aborted")return r;if(D.status==="dirty")I.dirty();return X(D.value).then(()=>{return{status:I.value,value:D.value}})})}if(b.type==="transform")if(U.common.async===!1){let X=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(!f4(X))return r;let D=b.transform(X.value,w);if(D instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:I.value,value:D}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((X)=>{if(!f4(X))return r;return Promise.resolve(b.transform(X.value,w)).then((D)=>({status:I.value,value:D}))});$$.assertNever(b)}}g6.create=($,I,U)=>{return new g6({schema:$,typeName:M.ZodEffects,effect:I,...d(U)})};g6.createWithPreprocess=($,I,U)=>{return new g6({schema:I,effect:{type:"preprocess",transform:$},typeName:M.ZodEffects,...d(U)})};class B6 extends e{_parse($){if(this._getType($)===R.undefined)return c$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}B6.create=($,I)=>{return new B6({innerType:$,typeName:M.ZodOptional,...d(I)})};class Q4 extends e{_parse($){if(this._getType($)===R.null)return c$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Q4.create=($,I)=>{return new Q4({innerType:$,typeName:M.ZodNullable,...d(I)})};class hI extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;if(I.parsedType===R.undefined)U=this._def.defaultValue();return this._def.innerType._parse({data:U,path:I.path,parent:I})}removeDefault(){return this._def.innerType}}hI.create=($,I)=>{return new hI({innerType:$,typeName:M.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...d(I)})};class fI extends e{_parse($){let{ctx:I}=this._processInputParams($),U={...I,common:{...I.common,issues:[]}},b=this._def.innerType._parse({data:U.data,path:U.path,parent:{...U}});if(SI(b))return b.then((w)=>{return{status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new X6(U.common.issues)},input:U.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new X6(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}fI.create=($,I)=>{return new fI({innerType:$,typeName:M.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...d(I)})};class ww extends e{_parse($){if(this._getType($)!==R.nan){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.nan,received:U.parsedType}),r}return{status:"valid",value:$.data}}}ww.create=($)=>{return new ww({typeName:M.ZodNaN,...d($)})};var pu=Symbol("zod_brand");class dD extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;return this._def.type._parse({data:U,path:I.path,parent:I})}unwrap(){return this._def.type}}class bw extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let w=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(w.status==="aborted")return r;if(w.status==="dirty")return I.dirty(),J1(w.value);else return this._def.out._parseAsync({data:w.value,path:U.path,parent:U})})();else{let b=this._def.in._parseSync({data:U.data,path:U.path,parent:U});if(b.status==="aborted")return r;if(b.status==="dirty")return I.dirty(),{status:"dirty",value:b.value};else return this._def.out._parseSync({data:b.value,path:U.path,parent:U})}}static create($,I){return new bw({in:$,out:I,typeName:M.ZodPipeline})}}class yI extends e{_parse($){let I=this._def.innerType._parse($),U=(b)=>{if(f4(b))b.value=Object.freeze(b.value);return b};return SI(I)?I.then((b)=>U(b)):U(I)}unwrap(){return this._def.innerType}}yI.create=($,I)=>{return new yI({innerType:$,typeName:M.ZodReadonly,...d(I)})};var tu={object:E$.lazycreate},M;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(M||(M={}));var au=p6.create,eu=A1.create,su=ww.create,$l=O1.create,Il=a0.create,Ul=kI.create,wl=e0.create,bl=RI.create,Xl=TI.create,Dl=s0.create,Wl=y4.create,Ql=t6.create,Gl=$w.create,Nl=C6.create,MH=E$.create,Yl=E$.strictCreate,Bl=_I.create,Jl=oD.create,Hl=ZI.create,Al=a6.create,Ol=Iw.create,zl=Uw.create,Ll=z1.create,Kl=PI.create,vl=CI.create,Vl=gI.create,ql=u4.create,Fl=xI.create,Ml=L1.create,jl=g6.create,El=B6.create,Sl=Q4.create,Pl=g6.createWithPreprocess,kl=bw.create;var Yj=Object.freeze({status:"aborted"});function v($,I,U){function b(W,Q){var G;Object.defineProperty(W,"_zod",{value:W._zod??{},enumerable:!1}),(G=W._zod).traits??(G.traits=new Set),W._zod.traits.add($),I(W,Q);for(let N in D.prototype)if(!(N in W))Object.defineProperty(W,N,{value:D.prototype[N].bind(W)});W._zod.constr=D,W._zod.def=Q}let w=U?.Parent??Object;class X extends w{}Object.defineProperty(X,"name",{value:$});function D(W){var Q;let G=U?.Parent?new X:this;b(G,W),(Q=G._zod).deferred??(Q.deferred=[]);for(let N of G._zod.deferred)N();return G}return Object.defineProperty(D,"init",{value:b}),Object.defineProperty(D,Symbol.hasInstance,{value:(W)=>{if(U?.Parent&&W instanceof U.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(D,"name",{value:$}),D}var Bj=Symbol("zod_brand");class G4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Xw={};function D6($){if($)Object.assign(Xw,$);return Xw}var I$={};v6(I$,{unwrapMessage:()=>uI,stringifyPrimitive:()=>Qw,required:()=>kj,randomString:()=>vj,propertyKeyTypes:()=>$W,promiseAllObject:()=>Kj,primitiveTypes:()=>jH,prefixIssues:()=>x6,pick:()=>Mj,partial:()=>Pj,optionalKeys:()=>IW,omit:()=>jj,numKeys:()=>Vj,nullish:()=>mI,normalizeParams:()=>m,merge:()=>Sj,jsonStringifyReplacer:()=>tD,joinValues:()=>Dw,issue:()=>wW,isPlainObject:()=>v1,isObject:()=>K1,getSizableOrigin:()=>SH,getParsedType:()=>qj,getLengthableOrigin:()=>nI,getEnumValues:()=>lI,getElementAtPath:()=>Lj,floatSafeRemainder:()=>aD,finalizeIssue:()=>q6,extend:()=>Ej,escapeRegex:()=>N4,esc:()=>l4,defineLazy:()=>O$,createTransparentProxy:()=>Fj,clone:()=>W6,cleanRegex:()=>rI,cleanEnum:()=>Rj,captureStackTrace:()=>Ww,cached:()=>cI,assignProp:()=>eD,assertNotEqual:()=>Hj,assertNever:()=>Oj,assertIs:()=>Aj,assertEqual:()=>Jj,assert:()=>zj,allowsEval:()=>sD,aborted:()=>c4,NUMBER_FORMAT_RANGES:()=>UW,Class:()=>PH,BIGINT_FORMAT_RANGES:()=>EH});function Jj($){return $}function Hj($){return $}function Aj($){}function Oj($){throw new Error}function zj($){}function lI($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function Dw($,I="|"){return $.map((U)=>Qw(U)).join(I)}function tD($,I){if(typeof I==="bigint")return I.toString();return I}function cI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function mI($){return $===null||$===void 0}function rI($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function aD($,I){let U=($.toString().split(".")[1]||"").length,b=(I.toString().split(".")[1]||"").length,w=U>b?U:b,X=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(I.toFixed(w).replace(".",""));return X%D/10**w}function O$($,I,U){Object.defineProperty($,I,{get(){{let w=U();return $[I]=w,w}throw new Error("cached value already set")},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function eD($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function Lj($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function Kj($){let I=Object.keys($),U=I.map((b)=>$[b]);return Promise.all(U).then((b)=>{let w={};for(let X=0;X<I.length;X++)w[I[X]]=b[X];return w})}function vj($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function l4($){return JSON.stringify($)}var Ww=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};function K1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var sD=cI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function v1($){if(K1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;let U=I.prototype;if(K1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function Vj($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var qj=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},$W=new Set(["string","number","symbol"]),jH=new Set(["string","number","bigint","boolean","symbol","undefined"]);function N4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W6($,I,U){let b=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)b._zod.parent=$;return b}function m($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function Fj($){let I;return new Proxy({},{get(U,b,w){return I??(I=$()),Reflect.get(I,b,w)},set(U,b,w,X){return I??(I=$()),Reflect.set(I,b,w,X)},has(U,b){return I??(I=$()),Reflect.has(I,b)},deleteProperty(U,b){return I??(I=$()),Reflect.deleteProperty(I,b)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,b){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,b)},defineProperty(U,b,w){return I??(I=$()),Reflect.defineProperty(I,b,w)}})}function Qw($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function IW($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var UW={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]},EH={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Mj($,I){let U={},b=$._zod.def;for(let w in I){if(!(w in b.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;U[w]=b.shape[w]}return W6($,{...$._zod.def,shape:U,checks:[]})}function jj($,I){let U={...$._zod.def.shape},b=$._zod.def;for(let w in I){if(!(w in b.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;delete U[w]}return W6($,{...$._zod.def,shape:U,checks:[]})}function Ej($,I){if(!v1(I))throw new Error("Invalid input to extend: expected a plain object");let U={...$._zod.def,get shape(){let b={...$._zod.def.shape,...I};return eD(this,"shape",b),b},checks:[]};return W6($,U)}function Sj($,I){return W6($,{...$._zod.def,get shape(){let U={...$._zod.def.shape,...I._zod.def.shape};return eD(this,"shape",U),U},catchall:I._zod.def.catchall,checks:[]})}function Pj($,I,U){let b=I._zod.def.shape,w={...b};if(U)for(let X in U){if(!(X in b))throw new Error(`Unrecognized key: "${X}"`);if(!U[X])continue;w[X]=$?new $({type:"optional",innerType:b[X]}):b[X]}else for(let X in b)w[X]=$?new $({type:"optional",innerType:b[X]}):b[X];return W6(I,{...I._zod.def,shape:w,checks:[]})}function kj($,I,U){let b=I._zod.def.shape,w={...b};if(U)for(let X in U){if(!(X in w))throw new Error(`Unrecognized key: "${X}"`);if(!U[X])continue;w[X]=new $({type:"nonoptional",innerType:b[X]})}else for(let X in b)w[X]=new $({type:"nonoptional",innerType:b[X]});return W6(I,{...I._zod.def,shape:w,checks:[]})}function c4($,I=0){for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function x6($,I){return I.map((U)=>{var b;return(b=U).path??(b.path=[]),U.path.unshift($),U})}function uI($){return typeof $==="string"?$:$?.message}function q6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=uI($.inst?._zod.def?.error?.($))??uI(I?.error?.($))??uI(U.customError?.($))??uI(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function SH($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function nI($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function wW(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function Rj($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}class PH{constructor(...$){}}var kH=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),Object.defineProperty($,"message",{get(){return JSON.stringify(I,tD,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Gw=v("$ZodError",kH),iI=v("$ZodError",kH,{Parent:Error});function bW($,I=(U)=>U.message){let U={},b=[];for(let w of $.issues)if(w.path.length>0)U[w.path[0]]=U[w.path[0]]||[],U[w.path[0]].push(I(w));else b.push(I(w));return{formErrors:b,fieldErrors:U}}function XW($,I){let U=I||function(X){return X.message},b={_errors:[]},w=(X)=>{for(let D of X.issues)if(D.code==="invalid_union"&&D.errors.length)D.errors.map((W)=>w({issues:W}));else if(D.code==="invalid_key")w({issues:D.issues});else if(D.code==="invalid_element")w({issues:D.issues});else if(D.path.length===0)b._errors.push(U(D));else{let W=b,Q=0;while(Q<D.path.length){let G=D.path[Q];if(Q!==D.path.length-1)W[G]=W[G]||{_errors:[]};else W[G]=W[G]||{_errors:[]},W[G]._errors.push(U(D));W=W[G],Q++}}};return w($),b}var DW=($)=>(I,U,b,w)=>{let X=b?Object.assign(b,{async:!1}):{async:!1},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)throw new G4;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Ww(W,w?.callee),W}return D.value},WW=DW(iI),QW=($)=>async(I,U,b,w)=>{let X=b?Object.assign(b,{async:!0}):{async:!0},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)D=await D;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Ww(W,w?.callee),W}return D.value},GW=QW(iI),NW=($)=>(I,U,b)=>{let w=b?{...b,async:!1}:{async:!1},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)throw new G4;return X.issues.length?{success:!1,error:new($??Gw)(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},m4=NW(iI),YW=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{async:!0}):{async:!0},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},r4=YW(iI);var RH=/^[cC][^\s-]{8,}$/,TH=/^[0-9a-z]+$/,_H=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ZH=/^[0-9a-vA-V]{20}$/,CH=/^[A-Za-z0-9]{27}$/,gH=/^[a-zA-Z0-9_-]{21}$/,xH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var hH=/^([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})$/,BW=($)=>{if(!$)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}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var fH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function yH(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var uH=/^(?:(?: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])$/,lH=/^(([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})$/,cH=/^((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])$/,mH=/^(([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])$/,rH=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,JW=/^[A-Za-z0-9_-]*$/,nH=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var iH=/^\+(?:[0-9]){6,14}[0-9]$/,oH="(?:(?:\\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])))",dH=new RegExp(`^${oH}$`);function pH($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.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{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function tH($){return new RegExp(`^${pH($)}$`)}function aH($){let I=pH({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-]\\d{2}:\\d{2})");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${oH}T(?:${b})$`)}var eH=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)};var sH=/^\d+$/,$A=/^-?\d+(?:\.\d+)?/i,IA=/true|false/i,UA=/null/i;var wA=/^[^A-Z]*$/,bA=/^[^a-z]*$/;var Z$=v("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),XA={number:"number",bigint:"bigint",object:"date"},HW=v("$ZodCheckLessThan",($,I)=>{Z$.init($,I);let U=XA[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.maximum:w.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<X)if(I.inclusive)w.maximum=I.value;else w.exclusiveMaximum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value<=I.value:b.value<I.value)return;b.issues.push({origin:U,code:"too_big",maximum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),AW=v("$ZodCheckGreaterThan",($,I)=>{Z$.init($,I);let U=XA[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.minimum:w.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>X)if(I.inclusive)w.minimum=I.value;else w.exclusiveMinimum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value>=I.value:b.value>I.value)return;b.issues.push({origin:U,code:"too_small",minimum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),DA=v("$ZodCheckMultipleOf",($,I)=>{Z$.init($,I),$._zod.onattach.push((U)=>{var b;(b=U._zod.bag).multipleOf??(b.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):aD(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),WA=v("$ZodCheckNumberFormat",($,I)=>{Z$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=UW[I.format];$._zod.onattach.push((D)=>{let W=D._zod.bag;if(W.format=I.format,W.minimum=w,W.maximum=X,U)W.pattern=sH}),$._zod.check=(D)=>{let W=D.value;if(U){if(!Number.isInteger(W)){D.issues.push({expected:b,format:I.format,code:"invalid_type",input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)D.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});else D.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});return}}if(W<w)D.issues.push({origin:"number",input:W,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!I.abort});if(W>X)D.issues.push({origin:"number",input:W,code:"too_big",maximum:X,inst:$})}});var QA=v("$ZodCheckMaxLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.length<=I.maximum)return;let D=nI(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),GA=v("$ZodCheckMinLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.length>=I.minimum)return;let D=nI(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),NA=v("$ZodCheckLengthEquals",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.length,w.maximum=I.length,w.length=I.length}),$._zod.check=(b)=>{let w=b.value,X=w.length;if(X===I.length)return;let D=nI(w),W=X>I.length;b.issues.push({origin:D,...W?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),oI=v("$ZodCheckStringFormat",($,I)=>{var U,b;if(Z$.init($,I),$._zod.onattach.push((w)=>{let X=w._zod.bag;if(X.format=I.format,I.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(w)=>{if(I.pattern.lastIndex=0,I.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:I.format,input:w.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(b=$._zod).check??(b.check=()=>{})}),YA=v("$ZodCheckRegex",($,I)=>{oI.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),BA=v("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=wA),oI.init($,I)}),JA=v("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=bA),oI.init($,I)}),HA=v("$ZodCheckIncludes",($,I)=>{Z$.init($,I);let U=N4(I.includes),b=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=b,$._zod.onattach.push((w)=>{let X=w._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(b)}),$._zod.check=(w)=>{if(w.value.includes(I.includes,I.position))return;w.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:w.value,inst:$,continue:!I.abort})}}),AA=v("$ZodCheckStartsWith",($,I)=>{Z$.init($,I);let U=new RegExp(`^${N4(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.startsWith(I.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:b.value,inst:$,continue:!I.abort})}}),OA=v("$ZodCheckEndsWith",($,I)=>{Z$.init($,I);let U=new RegExp(`.*${N4(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.endsWith(I.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:b.value,inst:$,continue:!I.abort})}});var zA=v("$ZodCheckOverwrite",($,I)=>{Z$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class OW{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
10
10
  `).filter((X)=>X),b=Math.min(...U.map((X)=>X.length-X.trimStart().length)),w=U.map((X)=>X.slice(b)).map((X)=>" ".repeat(this.indent*2)+X);for(let X of w)this.content.push(X)}compile(){let $=Function,I=this?.args,b=[...(this?.content??[""]).map((w)=>` ${w}`)];return new $(...I,b.join(`
11
- `))}}var LA={major:4,minor:0,patch:0};var N$=v("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=LA;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let w of b)for(let X of w._zod.onattach)X($);if(b.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let w=(X,D,W)=>{let Q=c4(X),G;for(let N of D){if(N._zod.def.when){if(!N._zod.def.when(X))continue}else if(Q)continue;let B=X.issues.length,H=N._zod.check(X);if(H instanceof Promise&&W?.async===!1)throw new G4;if(G||H instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await H,X.issues.length===B)return;if(!Q)Q=c4(X,B)});else{if(X.issues.length===B)continue;if(!Q)Q=c4(X,B)}}if(G)return G.then(()=>{return X});return X};$._zod.run=(X,D)=>{let W=$._zod.parse(X,D);if(W instanceof Promise){if(D.async===!1)throw new G4;return W.then((Q)=>w(Q,b,D))}return w(W,b,D)}}$["~standard"]={validate:(w)=>{try{let X=m4($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return r4($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),dI=v("$ZodString",($,I)=>{N$.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??aH($._zod.bag),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=String(U.value)}catch(w){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),z$=v("$ZodStringFormat",($,I)=>{oI.init($,I),dI.init($,I)}),LW=v("$ZodGUID",($,I)=>{I.pattern??(I.pattern=xH),z$.init($,I)}),KW=v("$ZodUUID",($,I)=>{if(I.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(b===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=BW(b))}else I.pattern??(I.pattern=BW());z$.init($,I)}),vW=v("$ZodEmail",($,I)=>{I.pattern??(I.pattern=hH),z$.init($,I)}),VW=v("$ZodURL",($,I)=>{z$.init($,I),$._zod.check=(U)=>{try{let b=U.value,w=new URL(b),X=w.href;if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(w.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:rH.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(w.protocol.endsWith(":")?w.protocol.slice(0,-1):w.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(!b.endsWith("/")&&X.endsWith("/"))U.value=X.slice(0,-1);else U.value=X;return}catch(b){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),qW=v("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=fH()),z$.init($,I)}),FW=v("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=CH),z$.init($,I)}),MW=v("$ZodCUID",($,I)=>{I.pattern??(I.pattern=kH),z$.init($,I)}),jW=v("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=RH),z$.init($,I)}),EW=v("$ZodULID",($,I)=>{I.pattern??(I.pattern=TH),z$.init($,I)}),SW=v("$ZodXID",($,I)=>{I.pattern??(I.pattern=_H),z$.init($,I)}),PW=v("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=ZH),z$.init($,I)}),PA=v("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=tH(I)),z$.init($,I)}),kA=v("$ZodISODate",($,I)=>{I.pattern??(I.pattern=oH),z$.init($,I)}),RA=v("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=pH(I)),z$.init($,I)}),TA=v("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=gH),z$.init($,I)}),kW=v("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=yH),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv4"})}),RW=v("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=uH),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv6"}),$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),TW=v("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=lH),z$.init($,I)}),_W=v("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=cH),z$.init($,I),$._zod.check=(U)=>{let[b,w]=U.value.split("/");try{if(!w)throw new Error;let X=Number(w);if(`${X}`!==w)throw new Error;if(X<0||X>128)throw new Error;new URL(`http://[${b}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function _A($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var ZW=v("$ZodBase64",($,I)=>{I.pattern??(I.pattern=mH),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64"}),$._zod.check=(U)=>{if(_A(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function Tj($){if(!JW.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return _A(U)}var CW=v("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=JW),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64url"}),$._zod.check=(U)=>{if(Tj(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),gW=v("$ZodE164",($,I)=>{I.pattern??(I.pattern=nH),z$.init($,I)});function _j($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[b]=U;if(!b)return!1;let w=JSON.parse(atob(b));if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&(!("alg"in w)||w.alg!==I))return!1;return!0}catch{return!1}}var xW=v("$ZodJWT",($,I)=>{z$.init($,I),$._zod.check=(U)=>{if(_j(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}});var Bw=v("$ZodNumber",($,I)=>{N$.init($,I),$._zod.pattern=$._zod.bag.pattern??sH,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Number(U.value)}catch(D){}let w=U.value;if(typeof w==="number"&&!Number.isNaN(w)&&Number.isFinite(w))return U;let X=typeof w==="number"?Number.isNaN(w)?"NaN":!Number.isFinite(w)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:w,inst:$,...X?{received:X}:{}}),U}}),hW=v("$ZodNumber",($,I)=>{DA.init($,I),Bw.init($,I)}),fW=v("$ZodBoolean",($,I)=>{N$.init($,I),$._zod.pattern=$A,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(X){}let w=U.value;if(typeof w==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:w,inst:$}),U}});var yW=v("$ZodNull",($,I)=>{N$.init($,I),$._zod.pattern=IA,$._zod.values=new Set([null]),$._zod.parse=(U,b)=>{let w=U.value;if(w===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:w,inst:$}),U}});var uW=v("$ZodUnknown",($,I)=>{N$.init($,I),$._zod.parse=(U)=>U}),lW=v("$ZodNever",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}});function KA($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}var cW=v("$ZodArray",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({expected:"array",code:"invalid_type",input:w,inst:$}),U;U.value=Array(w.length);let X=[];for(let D=0;D<w.length;D++){let W=w[D],Q=I.element._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>KA(G,U,D)));else KA(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function Yw($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}function vA($,I,U,b){if($.issues.length)if(b[U]===void 0)if(U in b)I.value[U]=void 0;else I.value[U]=$.value;else I.issues.push(...x6(U,$.issues));else if($.value===void 0){if(U in b)I.value[U]=void 0}else I.value[U]=$.value}var Jw=v("$ZodObject",($,I)=>{N$.init($,I);let U=cI(()=>{let B=Object.keys(I.shape);for(let J of B)if(!(I.shape[J]instanceof N$))throw new Error(`Invalid element at key "${J}": expected a Zod schema`);let H=IW(I.shape);return{shape:I.shape,keys:B,keySet:new Set(B),numKeys:B.length,optionalKeys:new Set(H)}});O$($._zod,"propValues",()=>{let B=I.shape,H={};for(let J in B){let A=B[J]._zod;if(A.values){H[J]??(H[J]=new Set);for(let O of A.values)H[J].add(O)}}return H});let b=(B)=>{let H=new OW(["shape","payload","ctx"]),J=U.value,A=(k)=>{let P=l4(k);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};H.write("const input = payload.value;");let O=Object.create(null),V=0;for(let k of J.keys)O[k]=`key_${V++}`;H.write("const newResult = {}");for(let k of J.keys)if(J.optionalKeys.has(k)){let P=O[k];H.write(`const ${P} = ${A(k)};`);let x=l4(k);H.write(`
11
+ `))}}var KA={major:4,minor:0,patch:0};var N$=v("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=KA;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let w of b)for(let X of w._zod.onattach)X($);if(b.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let w=(X,D,W)=>{let Q=c4(X),G;for(let N of D){if(N._zod.def.when){if(!N._zod.def.when(X))continue}else if(Q)continue;let B=X.issues.length,H=N._zod.check(X);if(H instanceof Promise&&W?.async===!1)throw new G4;if(G||H instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await H,X.issues.length===B)return;if(!Q)Q=c4(X,B)});else{if(X.issues.length===B)continue;if(!Q)Q=c4(X,B)}}if(G)return G.then(()=>{return X});return X};$._zod.run=(X,D)=>{let W=$._zod.parse(X,D);if(W instanceof Promise){if(D.async===!1)throw new G4;return W.then((Q)=>w(Q,b,D))}return w(W,b,D)}}$["~standard"]={validate:(w)=>{try{let X=m4($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return r4($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),dI=v("$ZodString",($,I)=>{N$.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??eH($._zod.bag),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=String(U.value)}catch(w){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),z$=v("$ZodStringFormat",($,I)=>{oI.init($,I),dI.init($,I)}),LW=v("$ZodGUID",($,I)=>{I.pattern??(I.pattern=hH),z$.init($,I)}),KW=v("$ZodUUID",($,I)=>{if(I.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(b===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=BW(b))}else I.pattern??(I.pattern=BW());z$.init($,I)}),vW=v("$ZodEmail",($,I)=>{I.pattern??(I.pattern=fH),z$.init($,I)}),VW=v("$ZodURL",($,I)=>{z$.init($,I),$._zod.check=(U)=>{try{let b=U.value,w=new URL(b),X=w.href;if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(w.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:nH.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(w.protocol.endsWith(":")?w.protocol.slice(0,-1):w.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(!b.endsWith("/")&&X.endsWith("/"))U.value=X.slice(0,-1);else U.value=X;return}catch(b){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),qW=v("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=yH()),z$.init($,I)}),FW=v("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=gH),z$.init($,I)}),MW=v("$ZodCUID",($,I)=>{I.pattern??(I.pattern=RH),z$.init($,I)}),jW=v("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=TH),z$.init($,I)}),EW=v("$ZodULID",($,I)=>{I.pattern??(I.pattern=_H),z$.init($,I)}),SW=v("$ZodXID",($,I)=>{I.pattern??(I.pattern=ZH),z$.init($,I)}),PW=v("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=CH),z$.init($,I)}),kA=v("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=aH(I)),z$.init($,I)}),RA=v("$ZodISODate",($,I)=>{I.pattern??(I.pattern=dH),z$.init($,I)}),TA=v("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=tH(I)),z$.init($,I)}),_A=v("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=xH),z$.init($,I)}),kW=v("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=uH),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv4"})}),RW=v("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=lH),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv6"}),$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),TW=v("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=cH),z$.init($,I)}),_W=v("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=mH),z$.init($,I),$._zod.check=(U)=>{let[b,w]=U.value.split("/");try{if(!w)throw new Error;let X=Number(w);if(`${X}`!==w)throw new Error;if(X<0||X>128)throw new Error;new URL(`http://[${b}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function ZA($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var ZW=v("$ZodBase64",($,I)=>{I.pattern??(I.pattern=rH),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64"}),$._zod.check=(U)=>{if(ZA(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function _j($){if(!JW.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return ZA(U)}var CW=v("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=JW),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64url"}),$._zod.check=(U)=>{if(_j(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),gW=v("$ZodE164",($,I)=>{I.pattern??(I.pattern=iH),z$.init($,I)});function Zj($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[b]=U;if(!b)return!1;let w=JSON.parse(atob(b));if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&(!("alg"in w)||w.alg!==I))return!1;return!0}catch{return!1}}var xW=v("$ZodJWT",($,I)=>{z$.init($,I),$._zod.check=(U)=>{if(Zj(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}});var Bw=v("$ZodNumber",($,I)=>{N$.init($,I),$._zod.pattern=$._zod.bag.pattern??$A,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Number(U.value)}catch(D){}let w=U.value;if(typeof w==="number"&&!Number.isNaN(w)&&Number.isFinite(w))return U;let X=typeof w==="number"?Number.isNaN(w)?"NaN":!Number.isFinite(w)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:w,inst:$,...X?{received:X}:{}}),U}}),hW=v("$ZodNumber",($,I)=>{WA.init($,I),Bw.init($,I)}),fW=v("$ZodBoolean",($,I)=>{N$.init($,I),$._zod.pattern=IA,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(X){}let w=U.value;if(typeof w==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:w,inst:$}),U}});var yW=v("$ZodNull",($,I)=>{N$.init($,I),$._zod.pattern=UA,$._zod.values=new Set([null]),$._zod.parse=(U,b)=>{let w=U.value;if(w===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:w,inst:$}),U}});var uW=v("$ZodUnknown",($,I)=>{N$.init($,I),$._zod.parse=(U)=>U}),lW=v("$ZodNever",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}});function vA($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}var cW=v("$ZodArray",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({expected:"array",code:"invalid_type",input:w,inst:$}),U;U.value=Array(w.length);let X=[];for(let D=0;D<w.length;D++){let W=w[D],Q=I.element._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>vA(G,U,D)));else vA(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function Yw($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}function VA($,I,U,b){if($.issues.length)if(b[U]===void 0)if(U in b)I.value[U]=void 0;else I.value[U]=$.value;else I.issues.push(...x6(U,$.issues));else if($.value===void 0){if(U in b)I.value[U]=void 0}else I.value[U]=$.value}var Jw=v("$ZodObject",($,I)=>{N$.init($,I);let U=cI(()=>{let B=Object.keys(I.shape);for(let J of B)if(!(I.shape[J]instanceof N$))throw new Error(`Invalid element at key "${J}": expected a Zod schema`);let H=IW(I.shape);return{shape:I.shape,keys:B,keySet:new Set(B),numKeys:B.length,optionalKeys:new Set(H)}});O$($._zod,"propValues",()=>{let B=I.shape,H={};for(let J in B){let A=B[J]._zod;if(A.values){H[J]??(H[J]=new Set);for(let O of A.values)H[J].add(O)}}return H});let b=(B)=>{let H=new OW(["shape","payload","ctx"]),J=U.value,A=(k)=>{let P=l4(k);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};H.write("const input = payload.value;");let O=Object.create(null),V=0;for(let k of J.keys)O[k]=`key_${V++}`;H.write("const newResult = {}");for(let k of J.keys)if(J.optionalKeys.has(k)){let P=O[k];H.write(`const ${P} = ${A(k)};`);let x=l4(k);H.write(`
12
12
  if (${P}.issues.length) {
13
13
  if (input[${x}] === undefined) {
14
14
  if (${x} in input) {
@@ -31,18 +31,18 @@ var xM=Object.create;var{getPrototypeOf:hM,defineProperty:cD,getOwnPropertyNames
31
31
  if (${P}.issues.length) payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
32
32
  ...iss,
33
33
  path: iss.path ? [${l4(k)}, ...iss.path] : [${l4(k)}]
34
- })));`),H.write(`newResult[${l4(k)}] = ${P}.value`)}H.write("payload.value = newResult;"),H.write("return payload;");let q=H.compile();return(k,P)=>q(B,k,P)},w,X=K1,D=!Xw.jitless,Q=D&&sD.value,G=I.catchall,N;$._zod.parse=(B,H)=>{N??(N=U.value);let J=B.value;if(!X(J))return B.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),B;let A=[];if(D&&Q&&H?.async===!1&&H.jitless!==!0){if(!w)w=b(I.shape);B=w(B,H)}else{B.value={};let P=N.shape;for(let x of N.keys){let l=P[x],l$=l._zod.run({value:J[x],issues:[]},H),Y6=l._zod.optin==="optional"&&l._zod.optout==="optional";if(l$ instanceof Promise)A.push(l$.then((B1)=>Y6?vA(B1,B,x,J):Yw(B1,B,x)));else if(Y6)vA(l$,B,x,J);else Yw(l$,B,x)}}if(!G)return A.length?Promise.all(A).then(()=>B):B;let O=[],V=N.keySet,q=G._zod,k=q.def.type;for(let P of Object.keys(J)){if(V.has(P))continue;if(k==="never"){O.push(P);continue}let x=q.run({value:J[P],issues:[]},H);if(x instanceof Promise)A.push(x.then((l)=>Yw(l,B,P)));else Yw(x,B,P)}if(O.length)B.issues.push({code:"unrecognized_keys",keys:O,input:J,inst:$});if(!A.length)return B;return Promise.all(A).then(()=>{return B})}});function VA($,I,U,b){for(let w of $)if(w.issues.length===0)return I.value=w.value,I;return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((X)=>q6(X,b,D6())))}),I}var Hw=v("$ZodUnion",($,I)=>{N$.init($,I),O$($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),O$($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),O$($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),O$($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((b)=>b._zod.pattern);return new RegExp(`^(${U.map((b)=>rI(b.source)).join("|")})$`)}return}),$._zod.parse=(U,b)=>{let w=!1,X=[];for(let D of I.options){let W=D._zod.run({value:U.value,issues:[]},b);if(W instanceof Promise)X.push(W),w=!0;else{if(W.issues.length===0)return W;X.push(W)}}if(!w)return VA(X,U,$,b);return Promise.all(X).then((D)=>{return VA(D,U,$,b)})}}),mW=v("$ZodDiscriminatedUnion",($,I)=>{Hw.init($,I);let U=$._zod.parse;O$($._zod,"propValues",()=>{let w={};for(let X of I.options){let D=X._zod.propValues;if(!D||Object.keys(D).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(X)}"`);for(let[W,Q]of Object.entries(D)){if(!w[W])w[W]=new Set;for(let G of Q)w[W].add(G)}}return w});let b=cI(()=>{let w=I.options,X=new Map;for(let D of w){let W=D._zod.propValues[I.discriminator];if(!W||W.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(D)}"`);for(let Q of W){if(X.has(Q))throw new Error(`Duplicate discriminator value "${String(Q)}"`);X.set(Q,D)}}return X});$._zod.parse=(w,X)=>{let D=w.value;if(!K1(D))return w.issues.push({code:"invalid_type",expected:"object",input:D,inst:$}),w;let W=b.value.get(D?.[I.discriminator]);if(W)return W._zod.run(w,X);if(I.unionFallback)return U(w,X);return w.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:D,path:[I.discriminator],inst:$}),w}}),rW=v("$ZodIntersection",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value,X=I.left._zod.run({value:w,issues:[]},b),D=I.right._zod.run({value:w,issues:[]},b);if(X instanceof Promise||D instanceof Promise)return Promise.all([X,D]).then(([Q,G])=>{return qA(U,Q,G)});return qA(U,X,D)}});function zW($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(v1($)&&v1(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=zW($[X],I[X]);if(!D.valid)return{valid:!1,mergeErrorPath:[X,...D.mergeErrorPath]};w[X]=D.data}return{valid:!0,data:w}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let b=0;b<$.length;b++){let w=$[b],X=I[b],D=zW(w,X);if(!D.valid)return{valid:!1,mergeErrorPath:[b,...D.mergeErrorPath]};U.push(D.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function qA($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(c4($))return $;let b=zW(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var nW=v("$ZodRecord",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!v1(w))return U.issues.push({expected:"record",code:"invalid_type",input:w,inst:$}),U;let X=[];if(I.keyType._zod.values){let D=I.keyType._zod.values;U.value={};for(let Q of D)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="symbol"){let G=I.valueType._zod.run({value:w[Q],issues:[]},b);if(G instanceof Promise)X.push(G.then((N)=>{if(N.issues.length)U.issues.push(...x6(Q,N.issues));U.value[Q]=N.value}));else{if(G.issues.length)U.issues.push(...x6(Q,G.issues));U.value[Q]=G.value}}let W;for(let Q in w)if(!D.has(Q))W=W??[],W.push(Q);if(W&&W.length>0)U.issues.push({code:"unrecognized_keys",input:w,inst:$,keys:W})}else{U.value={};for(let D of Reflect.ownKeys(w)){if(D==="__proto__")continue;let W=I.keyType._zod.run({value:D,issues:[]},b);if(W instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(W.issues.length){U.issues.push({origin:"record",code:"invalid_key",issues:W.issues.map((G)=>q6(G,b,D6())),input:D,path:[D],inst:$}),U.value[W.value]=W.value;continue}let Q=I.valueType._zod.run({value:w[D],issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>{if(G.issues.length)U.issues.push(...x6(D,G.issues));U.value[W.value]=G.value}));else{if(Q.issues.length)U.issues.push(...x6(D,Q.issues));U.value[W.value]=Q.value}}}if(X.length)return Promise.all(X).then(()=>U);return U}});var iW=v("$ZodEnum",($,I)=>{N$.init($,I);let U=lI(I.entries);$._zod.values=new Set(U),$._zod.pattern=new RegExp(`^(${U.filter((b)=>$W.has(typeof b)).map((b)=>typeof b==="string"?N4(b):b.toString()).join("|")})$`),$._zod.parse=(b,w)=>{let X=b.value;if($._zod.values.has(X))return b;return b.issues.push({code:"invalid_value",values:U,input:X,inst:$}),b}}),oW=v("$ZodLiteral",($,I)=>{N$.init($,I),$._zod.values=new Set(I.values),$._zod.pattern=new RegExp(`^(${I.values.map((U)=>typeof U==="string"?N4(U):U?U.toString():String(U)).join("|")})$`),$._zod.parse=(U,b)=>{let w=U.value;if($._zod.values.has(w))return U;return U.issues.push({code:"invalid_value",values:I.values,input:w,inst:$}),U}});var dW=v("$ZodTransform",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=I.transform(U.value,U);if(b.async)return(w instanceof Promise?w:Promise.resolve(w)).then((D)=>{return U.value=D,U});if(w instanceof Promise)throw new G4;return U.value=w,U}}),pW=v("$ZodOptional",($,I)=>{N$.init($,I),$._zod.optin="optional",$._zod.optout="optional",O$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),O$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${rI(U.source)})?$`):void 0}),$._zod.parse=(U,b)=>{if(I.innerType._zod.optin==="optional")return I.innerType._zod.run(U,b);if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),tW=v("$ZodNullable",($,I)=>{N$.init($,I),O$($._zod,"optin",()=>I.innerType._zod.optin),O$($._zod,"optout",()=>I.innerType._zod.optout),O$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${rI(U.source)}|null)$`):void 0}),O$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,b)=>{if(U.value===null)return U;return I.innerType._zod.run(U,b)}}),aW=v("$ZodDefault",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(U.value===void 0)return U.value=I.defaultValue,U;let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>FA(X,I));return FA(w,I)}});function FA($,I){if($.value===void 0)$.value=I.defaultValue;return $}var eW=v("$ZodPrefault",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,b)}}),sW=v("$ZodNonOptional",($,I)=>{N$.init($,I),O$($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>MA(X,$));return MA(w,$)}});function MA($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var $9=v("$ZodCatch",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"optout",()=>I.innerType._zod.optout),O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{if(U.value=X.value,X.issues.length)U.value=I.catchValue({...U,error:{issues:X.issues.map((D)=>q6(D,b,D6()))},input:U.value}),U.issues=[];return U});if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((X)=>q6(X,b,D6()))},input:U.value}),U.issues=[];return U}});var I9=v("$ZodPipe",($,I)=>{N$.init($,I),O$($._zod,"values",()=>I.in._zod.values),O$($._zod,"optin",()=>I.in._zod.optin),O$($._zod,"optout",()=>I.out._zod.optout),$._zod.parse=(U,b)=>{let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>jA(X,I,b));return jA(w,I,b)}});function jA($,I,U){if(c4($))return $;return I.out._zod.run({value:$.value,issues:$.issues},U)}var U9=v("$ZodReadonly",($,I)=>{N$.init($,I),O$($._zod,"propValues",()=>I.innerType._zod.propValues),O$($._zod,"values",()=>I.innerType._zod.values),O$($._zod,"optin",()=>I.innerType._zod.optin),O$($._zod,"optout",()=>I.innerType._zod.optout),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then(EA);return EA(w)}});function EA($){return $.value=Object.freeze($.value),$}var w9=v("$ZodCustom",($,I)=>{Z$.init($,I),N$.init($,I),$._zod.parse=(U,b)=>{return U},$._zod.check=(U)=>{let b=U.value,w=I.fn(b);if(w instanceof Promise)return w.then((X)=>SA(X,U,b,$));SA(w,U,b,$);return}});function SA($,I,U,b){if(!$){let w={code:"custom",input:U,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)w.params=b._zod.def.params;I.issues.push(wW(w))}}var Zj=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},Cj=()=>{let $={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 I(b){return $[b]??null}let U={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(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${Zj(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${Qw(b.values[0])}`;return`Invalid option: expected one of ${Dw(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Too big: expected ${b.origin??"value"} to have ${w}${b.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Too small: expected ${b.origin} to have ${w}${b.minimum.toString()} ${X.unit}`;return`Too small: expected ${b.origin} to be ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${U[w.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${Dw(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function b9(){return{localeError:Cj()}}var gj=Symbol("ZodOutput"),xj=Symbol("ZodInput");class Aw{constructor(){this._map=new Map,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};return delete U.id,{...U,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function ZA(){return new Aw}var Y4=ZA();function X9($,I){return new $({type:"string",...m(I)})}function D9($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...m(I)})}function Ow($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...m(I)})}function W9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...m(I)})}function Q9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(I)})}function G9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(I)})}function N9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(I)})}function Y9($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...m(I)})}function B9($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...m(I)})}function J9($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(I)})}function H9($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...m(I)})}function A9($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(I)})}function O9($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...m(I)})}function z9($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...m(I)})}function L9($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...m(I)})}function K9($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...m(I)})}function v9($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(I)})}function V9($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(I)})}function q9($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(I)})}function F9($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...m(I)})}function M9($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...m(I)})}function j9($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...m(I)})}function E9($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...m(I)})}function CA($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(I)})}function gA($,I){return new $({type:"string",format:"date",check:"string_format",...m(I)})}function xA($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...m(I)})}function hA($,I){return new $({type:"string",format:"duration",check:"string_format",...m(I)})}function S9($,I){return new $({type:"number",checks:[],...m(I)})}function P9($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...m(I)})}function k9($,I){return new $({type:"boolean",...m(I)})}function R9($,I){return new $({type:"null",...m(I)})}function T9($){return new $({type:"unknown"})}function _9($,I){return new $({type:"never",...m(I)})}function zw($,I){return new HW({check:"less_than",...m(I),value:$,inclusive:!1})}function pI($,I){return new HW({check:"less_than",...m(I),value:$,inclusive:!0})}function Lw($,I){return new AW({check:"greater_than",...m(I),value:$,inclusive:!1})}function tI($,I){return new AW({check:"greater_than",...m(I),value:$,inclusive:!0})}function Kw($,I){return new XA({check:"multiple_of",...m(I),value:$})}function vw($,I){return new WA({check:"max_length",...m(I),maximum:$})}function V1($,I){return new QA({check:"min_length",...m(I),minimum:$})}function Vw($,I){return new GA({check:"length_equals",...m(I),length:$})}function Z9($,I){return new NA({check:"string_format",format:"regex",...m(I),pattern:$})}function C9($){return new YA({check:"string_format",format:"lowercase",...m($)})}function g9($){return new BA({check:"string_format",format:"uppercase",...m($)})}function x9($,I){return new JA({check:"string_format",format:"includes",...m(I),includes:$})}function h9($,I){return new HA({check:"string_format",format:"starts_with",...m(I),prefix:$})}function f9($,I){return new AA({check:"string_format",format:"ends_with",...m(I),suffix:$})}function n4($){return new OA({check:"overwrite",tx:$})}function y9($){return n4((I)=>I.normalize($))}function u9(){return n4(($)=>$.trim())}function l9(){return n4(($)=>$.toLowerCase())}function c9(){return n4(($)=>$.toUpperCase())}function fA($,I,U){return new $({type:"array",element:I,...m(U)})}function m9($,I,U){let b=m(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function r9($,I,U){return new $({type:"custom",check:"custom",fn:I,...m(U)})}class n9{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??Y4,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,I={path:[],schemaPath:[]}){var U;let b=$._zod.def,w={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},X=this.seen.get($);if(X){if(X.count++,I.schemaPath.includes($))X.cycle=I.path;return X.schema}let D={schema:{},count:1,cycle:void 0,path:I.path};this.seen.set($,D);let W=$._zod.toJSONSchema?.();if(W)D.schema=W;else{let N={...I,schemaPath:[...I.schemaPath,$],path:I.path},B=$._zod.parent;if(B)D.ref=B,this.process(B,N),this.seen.get(B).isParent=!0;else{let H=D.schema;switch(b.type){case"string":{let J=H;J.type="string";let{minimum:A,maximum:O,format:V,patterns:q,contentEncoding:k}=$._zod.bag;if(typeof A==="number")J.minLength=A;if(typeof O==="number")J.maxLength=O;if(V){if(J.format=w[V]??V,J.format==="")delete J.format}if(k)J.contentEncoding=k;if(q&&q.size>0){let P=[...q];if(P.length===1)J.pattern=P[0].source;else if(P.length>1)D.schema.allOf=[...P.map((x)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:x.source}))]}break}case"number":{let J=H,{minimum:A,maximum:O,format:V,multipleOf:q,exclusiveMaximum:k,exclusiveMinimum:P}=$._zod.bag;if(typeof V==="string"&&V.includes("int"))J.type="integer";else J.type="number";if(typeof P==="number")J.exclusiveMinimum=P;if(typeof A==="number"){if(J.minimum=A,typeof P==="number")if(P>=A)delete J.minimum;else delete J.exclusiveMinimum}if(typeof k==="number")J.exclusiveMaximum=k;if(typeof O==="number"){if(J.maximum=O,typeof k==="number")if(k<=O)delete J.maximum;else delete J.exclusiveMaximum}if(typeof q==="number")J.multipleOf=q;break}case"boolean":{let J=H;J.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{H.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{H.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let J=H,{minimum:A,maximum:O}=$._zod.bag;if(typeof A==="number")J.minItems=A;if(typeof O==="number")J.maxItems=O;J.type="array",J.items=this.process(b.element,{...N,path:[...N.path,"items"]});break}case"object":{let J=H;J.type="object",J.properties={};let A=b.shape;for(let q in A)J.properties[q]=this.process(A[q],{...N,path:[...N.path,"properties",q]});let O=new Set(Object.keys(A)),V=new Set([...O].filter((q)=>{let k=b.shape[q]._zod;if(this.io==="input")return k.optin===void 0;else return k.optout===void 0}));if(V.size>0)J.required=Array.from(V);if(b.catchall?._zod.def.type==="never")J.additionalProperties=!1;else if(!b.catchall){if(this.io==="output")J.additionalProperties=!1}else if(b.catchall)J.additionalProperties=this.process(b.catchall,{...N,path:[...N.path,"additionalProperties"]});break}case"union":{let J=H;J.anyOf=b.options.map((A,O)=>this.process(A,{...N,path:[...N.path,"anyOf",O]}));break}case"intersection":{let J=H,A=this.process(b.left,{...N,path:[...N.path,"allOf",0]}),O=this.process(b.right,{...N,path:[...N.path,"allOf",1]}),V=(k)=>("allOf"in k)&&Object.keys(k).length===1,q=[...V(A)?A.allOf:[A],...V(O)?O.allOf:[O]];J.allOf=q;break}case"tuple":{let J=H;J.type="array";let A=b.items.map((q,k)=>this.process(q,{...N,path:[...N.path,"prefixItems",k]}));if(this.target==="draft-2020-12")J.prefixItems=A;else J.items=A;if(b.rest){let q=this.process(b.rest,{...N,path:[...N.path,"items"]});if(this.target==="draft-2020-12")J.items=q;else J.additionalItems=q}if(b.rest)J.items=this.process(b.rest,{...N,path:[...N.path,"items"]});let{minimum:O,maximum:V}=$._zod.bag;if(typeof O==="number")J.minItems=O;if(typeof V==="number")J.maxItems=V;break}case"record":{let J=H;J.type="object",J.propertyNames=this.process(b.keyType,{...N,path:[...N.path,"propertyNames"]}),J.additionalProperties=this.process(b.valueType,{...N,path:[...N.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let J=H,A=lI(b.entries);if(A.every((O)=>typeof O==="number"))J.type="number";if(A.every((O)=>typeof O==="string"))J.type="string";J.enum=A;break}case"literal":{let J=H,A=[];for(let O of b.values)if(O===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof O==="bigint")if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else A.push(Number(O));else A.push(O);if(A.length===0);else if(A.length===1){let O=A[0];J.type=O===null?"null":typeof O,J.const=O}else{if(A.every((O)=>typeof O==="number"))J.type="number";if(A.every((O)=>typeof O==="string"))J.type="string";if(A.every((O)=>typeof O==="boolean"))J.type="string";if(A.every((O)=>O===null))J.type="null";J.enum=A}break}case"file":{let J=H,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:O,maximum:V,mime:q}=$._zod.bag;if(O!==void 0)A.minLength=O;if(V!==void 0)A.maxLength=V;if(q)if(q.length===1)A.contentMediaType=q[0],Object.assign(J,A);else J.anyOf=q.map((k)=>{return{...A,contentMediaType:k}});else Object.assign(J,A);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let J=this.process(b.innerType,N);H.anyOf=[J,{type:"null"}];break}case"nonoptional":{this.process(b.innerType,N),D.ref=b.innerType;break}case"success":{let J=H;J.type="boolean";break}case"default":{this.process(b.innerType,N),D.ref=b.innerType,H.default=JSON.parse(JSON.stringify(b.defaultValue));break}case"prefault":{if(this.process(b.innerType,N),D.ref=b.innerType,this.io==="input")H._prefault=JSON.parse(JSON.stringify(b.defaultValue));break}case"catch":{this.process(b.innerType,N),D.ref=b.innerType;let J;try{J=b.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}H.default=J;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let J=H,A=$._zod.pattern;if(!A)throw new Error("Pattern not found in template literal");J.type="string",J.pattern=A.source;break}case"pipe":{let J=this.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;this.process(J,N),D.ref=J;break}case"readonly":{this.process(b.innerType,N),D.ref=b.innerType,H.readOnly=!0;break}case"promise":{this.process(b.innerType,N),D.ref=b.innerType;break}case"optional":{this.process(b.innerType,N),D.ref=b.innerType;break}case"lazy":{let J=$._zod.innerType;this.process(J,N),D.ref=J;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let Q=this.metadataRegistry.get($);if(Q)Object.assign(D.schema,Q);if(this.io==="input"&&R$($))delete D.schema.examples,delete D.schema.default;if(this.io==="input"&&D.schema._prefault)(U=D.schema).default??(U.default=D.schema._prefault);return delete D.schema._prefault,this.seen.get($).schema}emit($,I){let U={cycles:I?.cycles??"ref",reused:I?.reused??"inline",external:I?.external??void 0},b=this.seen.get($);if(!b)throw new Error("Unprocessed schema. This is a bug in Zod.");let w=(G)=>{let N=this.target==="draft-2020-12"?"$defs":"definitions";if(U.external){let A=U.external.registry.get(G[0])?.id,O=U.external.uri??((q)=>q);if(A)return{ref:O(A)};let V=G[1].defId??G[1].schema.id??`schema${this.counter++}`;return G[1].defId=V,{defId:V,ref:`${O("__shared")}#/${N}/${V}`}}if(G[1]===b)return{ref:"#"};let H=`${"#"}/${N}/`,J=G[1].schema.id??`__schema${this.counter++}`;return{defId:J,ref:H+J}},X=(G)=>{if(G[1].schema.$ref)return;let N=G[1],{ref:B,defId:H}=w(G);if(N.def={...N.schema},H)N.defId=H;let J=N.schema;for(let A in J)delete J[A];J.$ref=B};if(U.cycles==="throw")for(let G of this.seen.entries()){let N=G[1];if(N.cycle)throw new Error(`Cycle detected: #/${N.cycle?.join("/")}/<root>
34
+ })));`),H.write(`newResult[${l4(k)}] = ${P}.value`)}H.write("payload.value = newResult;"),H.write("return payload;");let q=H.compile();return(k,P)=>q(B,k,P)},w,X=K1,D=!Xw.jitless,Q=D&&sD.value,G=I.catchall,N;$._zod.parse=(B,H)=>{N??(N=U.value);let J=B.value;if(!X(J))return B.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),B;let A=[];if(D&&Q&&H?.async===!1&&H.jitless!==!0){if(!w)w=b(I.shape);B=w(B,H)}else{B.value={};let P=N.shape;for(let x of N.keys){let l=P[x],l$=l._zod.run({value:J[x],issues:[]},H),Y6=l._zod.optin==="optional"&&l._zod.optout==="optional";if(l$ instanceof Promise)A.push(l$.then((B1)=>Y6?VA(B1,B,x,J):Yw(B1,B,x)));else if(Y6)VA(l$,B,x,J);else Yw(l$,B,x)}}if(!G)return A.length?Promise.all(A).then(()=>B):B;let O=[],V=N.keySet,q=G._zod,k=q.def.type;for(let P of Object.keys(J)){if(V.has(P))continue;if(k==="never"){O.push(P);continue}let x=q.run({value:J[P],issues:[]},H);if(x instanceof Promise)A.push(x.then((l)=>Yw(l,B,P)));else Yw(x,B,P)}if(O.length)B.issues.push({code:"unrecognized_keys",keys:O,input:J,inst:$});if(!A.length)return B;return Promise.all(A).then(()=>{return B})}});function qA($,I,U,b){for(let w of $)if(w.issues.length===0)return I.value=w.value,I;return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((X)=>q6(X,b,D6())))}),I}var Hw=v("$ZodUnion",($,I)=>{N$.init($,I),O$($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),O$($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),O$($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),O$($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((b)=>b._zod.pattern);return new RegExp(`^(${U.map((b)=>rI(b.source)).join("|")})$`)}return}),$._zod.parse=(U,b)=>{let w=!1,X=[];for(let D of I.options){let W=D._zod.run({value:U.value,issues:[]},b);if(W instanceof Promise)X.push(W),w=!0;else{if(W.issues.length===0)return W;X.push(W)}}if(!w)return qA(X,U,$,b);return Promise.all(X).then((D)=>{return qA(D,U,$,b)})}}),mW=v("$ZodDiscriminatedUnion",($,I)=>{Hw.init($,I);let U=$._zod.parse;O$($._zod,"propValues",()=>{let w={};for(let X of I.options){let D=X._zod.propValues;if(!D||Object.keys(D).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(X)}"`);for(let[W,Q]of Object.entries(D)){if(!w[W])w[W]=new Set;for(let G of Q)w[W].add(G)}}return w});let b=cI(()=>{let w=I.options,X=new Map;for(let D of w){let W=D._zod.propValues[I.discriminator];if(!W||W.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(D)}"`);for(let Q of W){if(X.has(Q))throw new Error(`Duplicate discriminator value "${String(Q)}"`);X.set(Q,D)}}return X});$._zod.parse=(w,X)=>{let D=w.value;if(!K1(D))return w.issues.push({code:"invalid_type",expected:"object",input:D,inst:$}),w;let W=b.value.get(D?.[I.discriminator]);if(W)return W._zod.run(w,X);if(I.unionFallback)return U(w,X);return w.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:D,path:[I.discriminator],inst:$}),w}}),rW=v("$ZodIntersection",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value,X=I.left._zod.run({value:w,issues:[]},b),D=I.right._zod.run({value:w,issues:[]},b);if(X instanceof Promise||D instanceof Promise)return Promise.all([X,D]).then(([Q,G])=>{return FA(U,Q,G)});return FA(U,X,D)}});function zW($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(v1($)&&v1(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=zW($[X],I[X]);if(!D.valid)return{valid:!1,mergeErrorPath:[X,...D.mergeErrorPath]};w[X]=D.data}return{valid:!0,data:w}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let b=0;b<$.length;b++){let w=$[b],X=I[b],D=zW(w,X);if(!D.valid)return{valid:!1,mergeErrorPath:[b,...D.mergeErrorPath]};U.push(D.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function FA($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(c4($))return $;let b=zW(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var nW=v("$ZodRecord",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!v1(w))return U.issues.push({expected:"record",code:"invalid_type",input:w,inst:$}),U;let X=[];if(I.keyType._zod.values){let D=I.keyType._zod.values;U.value={};for(let Q of D)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="symbol"){let G=I.valueType._zod.run({value:w[Q],issues:[]},b);if(G instanceof Promise)X.push(G.then((N)=>{if(N.issues.length)U.issues.push(...x6(Q,N.issues));U.value[Q]=N.value}));else{if(G.issues.length)U.issues.push(...x6(Q,G.issues));U.value[Q]=G.value}}let W;for(let Q in w)if(!D.has(Q))W=W??[],W.push(Q);if(W&&W.length>0)U.issues.push({code:"unrecognized_keys",input:w,inst:$,keys:W})}else{U.value={};for(let D of Reflect.ownKeys(w)){if(D==="__proto__")continue;let W=I.keyType._zod.run({value:D,issues:[]},b);if(W instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(W.issues.length){U.issues.push({origin:"record",code:"invalid_key",issues:W.issues.map((G)=>q6(G,b,D6())),input:D,path:[D],inst:$}),U.value[W.value]=W.value;continue}let Q=I.valueType._zod.run({value:w[D],issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>{if(G.issues.length)U.issues.push(...x6(D,G.issues));U.value[W.value]=G.value}));else{if(Q.issues.length)U.issues.push(...x6(D,Q.issues));U.value[W.value]=Q.value}}}if(X.length)return Promise.all(X).then(()=>U);return U}});var iW=v("$ZodEnum",($,I)=>{N$.init($,I);let U=lI(I.entries);$._zod.values=new Set(U),$._zod.pattern=new RegExp(`^(${U.filter((b)=>$W.has(typeof b)).map((b)=>typeof b==="string"?N4(b):b.toString()).join("|")})$`),$._zod.parse=(b,w)=>{let X=b.value;if($._zod.values.has(X))return b;return b.issues.push({code:"invalid_value",values:U,input:X,inst:$}),b}}),oW=v("$ZodLiteral",($,I)=>{N$.init($,I),$._zod.values=new Set(I.values),$._zod.pattern=new RegExp(`^(${I.values.map((U)=>typeof U==="string"?N4(U):U?U.toString():String(U)).join("|")})$`),$._zod.parse=(U,b)=>{let w=U.value;if($._zod.values.has(w))return U;return U.issues.push({code:"invalid_value",values:I.values,input:w,inst:$}),U}});var dW=v("$ZodTransform",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=I.transform(U.value,U);if(b.async)return(w instanceof Promise?w:Promise.resolve(w)).then((D)=>{return U.value=D,U});if(w instanceof Promise)throw new G4;return U.value=w,U}}),pW=v("$ZodOptional",($,I)=>{N$.init($,I),$._zod.optin="optional",$._zod.optout="optional",O$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),O$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${rI(U.source)})?$`):void 0}),$._zod.parse=(U,b)=>{if(I.innerType._zod.optin==="optional")return I.innerType._zod.run(U,b);if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),tW=v("$ZodNullable",($,I)=>{N$.init($,I),O$($._zod,"optin",()=>I.innerType._zod.optin),O$($._zod,"optout",()=>I.innerType._zod.optout),O$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${rI(U.source)}|null)$`):void 0}),O$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,b)=>{if(U.value===null)return U;return I.innerType._zod.run(U,b)}}),aW=v("$ZodDefault",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(U.value===void 0)return U.value=I.defaultValue,U;let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>MA(X,I));return MA(w,I)}});function MA($,I){if($.value===void 0)$.value=I.defaultValue;return $}var eW=v("$ZodPrefault",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,b)}}),sW=v("$ZodNonOptional",($,I)=>{N$.init($,I),O$($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>jA(X,$));return jA(w,$)}});function jA($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var $9=v("$ZodCatch",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"optout",()=>I.innerType._zod.optout),O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{if(U.value=X.value,X.issues.length)U.value=I.catchValue({...U,error:{issues:X.issues.map((D)=>q6(D,b,D6()))},input:U.value}),U.issues=[];return U});if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((X)=>q6(X,b,D6()))},input:U.value}),U.issues=[];return U}});var I9=v("$ZodPipe",($,I)=>{N$.init($,I),O$($._zod,"values",()=>I.in._zod.values),O$($._zod,"optin",()=>I.in._zod.optin),O$($._zod,"optout",()=>I.out._zod.optout),$._zod.parse=(U,b)=>{let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>EA(X,I,b));return EA(w,I,b)}});function EA($,I,U){if(c4($))return $;return I.out._zod.run({value:$.value,issues:$.issues},U)}var U9=v("$ZodReadonly",($,I)=>{N$.init($,I),O$($._zod,"propValues",()=>I.innerType._zod.propValues),O$($._zod,"values",()=>I.innerType._zod.values),O$($._zod,"optin",()=>I.innerType._zod.optin),O$($._zod,"optout",()=>I.innerType._zod.optout),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then(SA);return SA(w)}});function SA($){return $.value=Object.freeze($.value),$}var w9=v("$ZodCustom",($,I)=>{Z$.init($,I),N$.init($,I),$._zod.parse=(U,b)=>{return U},$._zod.check=(U)=>{let b=U.value,w=I.fn(b);if(w instanceof Promise)return w.then((X)=>PA(X,U,b,$));PA(w,U,b,$);return}});function PA($,I,U,b){if(!$){let w={code:"custom",input:U,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)w.params=b._zod.def.params;I.issues.push(wW(w))}}var Cj=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},gj=()=>{let $={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 I(b){return $[b]??null}let U={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(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${Cj(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${Qw(b.values[0])}`;return`Invalid option: expected one of ${Dw(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Too big: expected ${b.origin??"value"} to have ${w}${b.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Too small: expected ${b.origin} to have ${w}${b.minimum.toString()} ${X.unit}`;return`Too small: expected ${b.origin} to be ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${U[w.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${Dw(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function b9(){return{localeError:gj()}}var xj=Symbol("ZodOutput"),hj=Symbol("ZodInput");class Aw{constructor(){this._map=new Map,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};return delete U.id,{...U,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function CA(){return new Aw}var Y4=CA();function X9($,I){return new $({type:"string",...m(I)})}function D9($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...m(I)})}function Ow($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...m(I)})}function W9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...m(I)})}function Q9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(I)})}function G9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(I)})}function N9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(I)})}function Y9($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...m(I)})}function B9($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...m(I)})}function J9($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(I)})}function H9($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...m(I)})}function A9($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(I)})}function O9($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...m(I)})}function z9($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...m(I)})}function L9($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...m(I)})}function K9($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...m(I)})}function v9($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(I)})}function V9($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(I)})}function q9($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(I)})}function F9($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...m(I)})}function M9($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...m(I)})}function j9($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...m(I)})}function E9($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...m(I)})}function gA($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(I)})}function xA($,I){return new $({type:"string",format:"date",check:"string_format",...m(I)})}function hA($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...m(I)})}function fA($,I){return new $({type:"string",format:"duration",check:"string_format",...m(I)})}function S9($,I){return new $({type:"number",checks:[],...m(I)})}function P9($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...m(I)})}function k9($,I){return new $({type:"boolean",...m(I)})}function R9($,I){return new $({type:"null",...m(I)})}function T9($){return new $({type:"unknown"})}function _9($,I){return new $({type:"never",...m(I)})}function zw($,I){return new HW({check:"less_than",...m(I),value:$,inclusive:!1})}function pI($,I){return new HW({check:"less_than",...m(I),value:$,inclusive:!0})}function Lw($,I){return new AW({check:"greater_than",...m(I),value:$,inclusive:!1})}function tI($,I){return new AW({check:"greater_than",...m(I),value:$,inclusive:!0})}function Kw($,I){return new DA({check:"multiple_of",...m(I),value:$})}function vw($,I){return new QA({check:"max_length",...m(I),maximum:$})}function V1($,I){return new GA({check:"min_length",...m(I),minimum:$})}function Vw($,I){return new NA({check:"length_equals",...m(I),length:$})}function Z9($,I){return new YA({check:"string_format",format:"regex",...m(I),pattern:$})}function C9($){return new BA({check:"string_format",format:"lowercase",...m($)})}function g9($){return new JA({check:"string_format",format:"uppercase",...m($)})}function x9($,I){return new HA({check:"string_format",format:"includes",...m(I),includes:$})}function h9($,I){return new AA({check:"string_format",format:"starts_with",...m(I),prefix:$})}function f9($,I){return new OA({check:"string_format",format:"ends_with",...m(I),suffix:$})}function n4($){return new zA({check:"overwrite",tx:$})}function y9($){return n4((I)=>I.normalize($))}function u9(){return n4(($)=>$.trim())}function l9(){return n4(($)=>$.toLowerCase())}function c9(){return n4(($)=>$.toUpperCase())}function yA($,I,U){return new $({type:"array",element:I,...m(U)})}function m9($,I,U){let b=m(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function r9($,I,U){return new $({type:"custom",check:"custom",fn:I,...m(U)})}class n9{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??Y4,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,I={path:[],schemaPath:[]}){var U;let b=$._zod.def,w={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},X=this.seen.get($);if(X){if(X.count++,I.schemaPath.includes($))X.cycle=I.path;return X.schema}let D={schema:{},count:1,cycle:void 0,path:I.path};this.seen.set($,D);let W=$._zod.toJSONSchema?.();if(W)D.schema=W;else{let N={...I,schemaPath:[...I.schemaPath,$],path:I.path},B=$._zod.parent;if(B)D.ref=B,this.process(B,N),this.seen.get(B).isParent=!0;else{let H=D.schema;switch(b.type){case"string":{let J=H;J.type="string";let{minimum:A,maximum:O,format:V,patterns:q,contentEncoding:k}=$._zod.bag;if(typeof A==="number")J.minLength=A;if(typeof O==="number")J.maxLength=O;if(V){if(J.format=w[V]??V,J.format==="")delete J.format}if(k)J.contentEncoding=k;if(q&&q.size>0){let P=[...q];if(P.length===1)J.pattern=P[0].source;else if(P.length>1)D.schema.allOf=[...P.map((x)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:x.source}))]}break}case"number":{let J=H,{minimum:A,maximum:O,format:V,multipleOf:q,exclusiveMaximum:k,exclusiveMinimum:P}=$._zod.bag;if(typeof V==="string"&&V.includes("int"))J.type="integer";else J.type="number";if(typeof P==="number")J.exclusiveMinimum=P;if(typeof A==="number"){if(J.minimum=A,typeof P==="number")if(P>=A)delete J.minimum;else delete J.exclusiveMinimum}if(typeof k==="number")J.exclusiveMaximum=k;if(typeof O==="number"){if(J.maximum=O,typeof k==="number")if(k<=O)delete J.maximum;else delete J.exclusiveMaximum}if(typeof q==="number")J.multipleOf=q;break}case"boolean":{let J=H;J.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{H.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{H.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let J=H,{minimum:A,maximum:O}=$._zod.bag;if(typeof A==="number")J.minItems=A;if(typeof O==="number")J.maxItems=O;J.type="array",J.items=this.process(b.element,{...N,path:[...N.path,"items"]});break}case"object":{let J=H;J.type="object",J.properties={};let A=b.shape;for(let q in A)J.properties[q]=this.process(A[q],{...N,path:[...N.path,"properties",q]});let O=new Set(Object.keys(A)),V=new Set([...O].filter((q)=>{let k=b.shape[q]._zod;if(this.io==="input")return k.optin===void 0;else return k.optout===void 0}));if(V.size>0)J.required=Array.from(V);if(b.catchall?._zod.def.type==="never")J.additionalProperties=!1;else if(!b.catchall){if(this.io==="output")J.additionalProperties=!1}else if(b.catchall)J.additionalProperties=this.process(b.catchall,{...N,path:[...N.path,"additionalProperties"]});break}case"union":{let J=H;J.anyOf=b.options.map((A,O)=>this.process(A,{...N,path:[...N.path,"anyOf",O]}));break}case"intersection":{let J=H,A=this.process(b.left,{...N,path:[...N.path,"allOf",0]}),O=this.process(b.right,{...N,path:[...N.path,"allOf",1]}),V=(k)=>("allOf"in k)&&Object.keys(k).length===1,q=[...V(A)?A.allOf:[A],...V(O)?O.allOf:[O]];J.allOf=q;break}case"tuple":{let J=H;J.type="array";let A=b.items.map((q,k)=>this.process(q,{...N,path:[...N.path,"prefixItems",k]}));if(this.target==="draft-2020-12")J.prefixItems=A;else J.items=A;if(b.rest){let q=this.process(b.rest,{...N,path:[...N.path,"items"]});if(this.target==="draft-2020-12")J.items=q;else J.additionalItems=q}if(b.rest)J.items=this.process(b.rest,{...N,path:[...N.path,"items"]});let{minimum:O,maximum:V}=$._zod.bag;if(typeof O==="number")J.minItems=O;if(typeof V==="number")J.maxItems=V;break}case"record":{let J=H;J.type="object",J.propertyNames=this.process(b.keyType,{...N,path:[...N.path,"propertyNames"]}),J.additionalProperties=this.process(b.valueType,{...N,path:[...N.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let J=H,A=lI(b.entries);if(A.every((O)=>typeof O==="number"))J.type="number";if(A.every((O)=>typeof O==="string"))J.type="string";J.enum=A;break}case"literal":{let J=H,A=[];for(let O of b.values)if(O===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof O==="bigint")if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else A.push(Number(O));else A.push(O);if(A.length===0);else if(A.length===1){let O=A[0];J.type=O===null?"null":typeof O,J.const=O}else{if(A.every((O)=>typeof O==="number"))J.type="number";if(A.every((O)=>typeof O==="string"))J.type="string";if(A.every((O)=>typeof O==="boolean"))J.type="string";if(A.every((O)=>O===null))J.type="null";J.enum=A}break}case"file":{let J=H,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:O,maximum:V,mime:q}=$._zod.bag;if(O!==void 0)A.minLength=O;if(V!==void 0)A.maxLength=V;if(q)if(q.length===1)A.contentMediaType=q[0],Object.assign(J,A);else J.anyOf=q.map((k)=>{return{...A,contentMediaType:k}});else Object.assign(J,A);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let J=this.process(b.innerType,N);H.anyOf=[J,{type:"null"}];break}case"nonoptional":{this.process(b.innerType,N),D.ref=b.innerType;break}case"success":{let J=H;J.type="boolean";break}case"default":{this.process(b.innerType,N),D.ref=b.innerType,H.default=JSON.parse(JSON.stringify(b.defaultValue));break}case"prefault":{if(this.process(b.innerType,N),D.ref=b.innerType,this.io==="input")H._prefault=JSON.parse(JSON.stringify(b.defaultValue));break}case"catch":{this.process(b.innerType,N),D.ref=b.innerType;let J;try{J=b.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}H.default=J;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let J=H,A=$._zod.pattern;if(!A)throw new Error("Pattern not found in template literal");J.type="string",J.pattern=A.source;break}case"pipe":{let J=this.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;this.process(J,N),D.ref=J;break}case"readonly":{this.process(b.innerType,N),D.ref=b.innerType,H.readOnly=!0;break}case"promise":{this.process(b.innerType,N),D.ref=b.innerType;break}case"optional":{this.process(b.innerType,N),D.ref=b.innerType;break}case"lazy":{let J=$._zod.innerType;this.process(J,N),D.ref=J;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let Q=this.metadataRegistry.get($);if(Q)Object.assign(D.schema,Q);if(this.io==="input"&&R$($))delete D.schema.examples,delete D.schema.default;if(this.io==="input"&&D.schema._prefault)(U=D.schema).default??(U.default=D.schema._prefault);return delete D.schema._prefault,this.seen.get($).schema}emit($,I){let U={cycles:I?.cycles??"ref",reused:I?.reused??"inline",external:I?.external??void 0},b=this.seen.get($);if(!b)throw new Error("Unprocessed schema. This is a bug in Zod.");let w=(G)=>{let N=this.target==="draft-2020-12"?"$defs":"definitions";if(U.external){let A=U.external.registry.get(G[0])?.id,O=U.external.uri??((q)=>q);if(A)return{ref:O(A)};let V=G[1].defId??G[1].schema.id??`schema${this.counter++}`;return G[1].defId=V,{defId:V,ref:`${O("__shared")}#/${N}/${V}`}}if(G[1]===b)return{ref:"#"};let H=`${"#"}/${N}/`,J=G[1].schema.id??`__schema${this.counter++}`;return{defId:J,ref:H+J}},X=(G)=>{if(G[1].schema.$ref)return;let N=G[1],{ref:B,defId:H}=w(G);if(N.def={...N.schema},H)N.defId=H;let J=N.schema;for(let A in J)delete J[A];J.$ref=B};if(U.cycles==="throw")for(let G of this.seen.entries()){let N=G[1];if(N.cycle)throw new Error(`Cycle detected: #/${N.cycle?.join("/")}/<root>
35
35
 
36
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let G of this.seen.entries()){let N=G[1];if($===G[0]){X(G);continue}if(U.external){let H=U.external.registry.get(G[0])?.id;if($!==G[0]&&H){X(G);continue}}if(this.metadataRegistry.get(G[0])?.id){X(G);continue}if(N.cycle){X(G);continue}if(N.count>1){if(U.reused==="ref"){X(G);continue}}}let D=(G,N)=>{let B=this.seen.get(G),H=B.def??B.schema,J={...H};if(B.ref===null)return;let A=B.ref;if(B.ref=null,A){D(A,N);let O=this.seen.get(A).schema;if(O.$ref&&N.target==="draft-7")H.allOf=H.allOf??[],H.allOf.push(O);else Object.assign(H,O),Object.assign(H,J)}if(!B.isParent)this.override({zodSchema:G,jsonSchema:H,path:B.path??[]})};for(let G of[...this.seen.entries()].reverse())D(G[0],{target:this.target});let W={};if(this.target==="draft-2020-12")W.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")W.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);if(U.external?.uri){let G=U.external.registry.get($)?.id;if(!G)throw new Error("Schema is missing an `id` property");W.$id=U.external.uri(G)}Object.assign(W,b.def);let Q=U.external?.defs??{};for(let G of this.seen.entries()){let N=G[1];if(N.def&&N.defId)Q[N.defId]=N.def}if(U.external);else if(Object.keys(Q).length>0)if(this.target==="draft-2020-12")W.$defs=Q;else W.definitions=Q;try{return JSON.parse(JSON.stringify(W))}catch(G){throw new Error("Error converting schema to JSON.")}}}function i9($,I){if($ instanceof Aw){let b=new n9(I),w={};for(let W of $._idmap.entries()){let[Q,G]=W;b.process(G)}let X={},D={registry:$,uri:I?.uri,defs:w};for(let W of $._idmap.entries()){let[Q,G]=W;X[Q]=b.emit(G,{...I,external:D})}if(Object.keys(w).length>0){let W=b.target==="draft-2020-12"?"$defs":"definitions";X.__shared={[W]:w}}return{schemas:X}}let U=new n9(I);return U.process($),U.emit($,I)}function R$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let w=$._zod.def;switch(w.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 R$(w.element,U);case"object":{for(let X in w.shape)if(R$(w.shape[X],U))return!0;return!1}case"union":{for(let X of w.options)if(R$(X,U))return!0;return!1}case"intersection":return R$(w.left,U)||R$(w.right,U);case"tuple":{for(let X of w.items)if(R$(X,U))return!0;if(w.rest&&R$(w.rest,U))return!0;return!1}case"record":return R$(w.keyType,U)||R$(w.valueType,U);case"map":return R$(w.keyType,U)||R$(w.valueType,U);case"set":return R$(w.valueType,U);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return R$(w.innerType,U);case"lazy":return R$(w.getter(),U);case"default":return R$(w.innerType,U);case"prefault":return R$(w.innerType,U);case"custom":return!1;case"transform":return!0;case"pipe":return R$(w.in,U)||R$(w.out,U);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${w.type}`)}var zE=v("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");N$.init($,I),$.def=I,$.parse=(U,b)=>WW($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>m4($,U,b),$.parseAsync=async(U,b)=>GW($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>r4($,U,b),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(U,b)=>W6($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$}});var LE=v("ZodMiniObject",($,I)=>{Jw.init($,I),zE.init($,I),I$.defineLazy($,"shape",()=>I.shape)});function o9($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new LE(U)}function J6($){return!!$._zod}function o4($){let I=Object.values($);if(I.length===0)return o9({});let U=I.every(J6),b=I.every((w)=>!J6(w));if(U)return o9($);if(b)return FH($);throw new Error("Mixed Zod versions detected in object shape.")}function B4($,I){if(J6($))return m4($,I);return $.safeParse(I)}async function qw($,I){if(J6($))return await r4($,I);return await $.safeParseAsync(I)}function J4($){if(!$)return;let I;if(J6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function q1($){if(!$)return;if(typeof $==="object"){let I=$,U=$;if(!I._def&&!U._zod){let b=Object.values($);if(b.length>0&&b.every((w)=>typeof w==="object"&&w!==null&&(w._def!==void 0||w._zod!==void 0||typeof w.parse==="function")))return o4($)}}if(J6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function Fw($){if($&&typeof $==="object"){if("message"in $&&typeof $.message==="string")return $.message;if("issues"in $&&Array.isArray($.issues)&&$.issues.length>0){let I=$.issues[0];if(I&&typeof I==="object"&&"message"in I)return String(I.message)}try{return JSON.stringify($)}catch{return String($)}}return String($)}function uA($){return $.description}function lA($){if(J6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function Mw($){if(J6($)){let X=$._zod?.def;if(X){if(X.value!==void 0)return X.value;if(Array.isArray(X.values)&&X.values.length>0)return X.values[0]}}let U=$._def;if(U){if(U.value!==void 0)return U.value;if(Array.isArray(U.values)&&U.values.length>0)return U.values[0]}let b=$.value;if(b!==void 0)return b;return}var aI={};v6(aI,{time:()=>t9,duration:()=>a9,datetime:()=>d9,date:()=>p9,ZodISOTime:()=>rA,ZodISODuration:()=>nA,ZodISODateTime:()=>cA,ZodISODate:()=>mA});var cA=v("ZodISODateTime",($,I)=>{PA.init($,I),v$.init($,I)});function d9($){return CA(cA,$)}var mA=v("ZodISODate",($,I)=>{kA.init($,I),v$.init($,I)});function p9($){return gA(mA,$)}var rA=v("ZodISOTime",($,I)=>{RA.init($,I),v$.init($,I)});function t9($){return xA(rA,$)}var nA=v("ZodISODuration",($,I)=>{TA.init($,I),v$.init($,I)});function a9($){return hA(nA,$)}var iA=($,I)=>{Gw.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>XW($,U)},flatten:{value:(U)=>bW($,U)},addIssue:{value:(U)=>$.issues.push(U)},addIssues:{value:(U)=>$.issues.push(...U)},isEmpty:{get(){return $.issues.length===0}}})},Cc=v("ZodError",iA),eI=v("ZodError",iA,{Parent:Error});var oA=DW(eI),dA=QW(eI),pA=NW(eI),tA=YW(eI);var j$=v("ZodType",($,I)=>{return N$.init($,I),$.def=I,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(U,b)=>W6($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$},$.parse=(U,b)=>oA($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>pA($,U,b),$.parseAsync=async(U,b)=>dA($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>tA($,U,b),$.spa=$.safeParseAsync,$.refine=(U,b)=>$.check(AS(U,b)),$.superRefine=(U)=>$.check(OS(U)),$.overwrite=(U)=>$.check(n4(U)),$.optional=()=>M$($),$.nullable=()=>sA($),$.nullish=()=>M$(sA($)),$.nonoptional=(U)=>QS($,U),$.array=()=>w$($),$.or=(U)=>L$([$,U]),$.and=(U)=>Ew($,U),$.transform=(U)=>s9($,bO(U)),$.default=(U)=>XS($,U),$.prefault=(U)=>WS($,U),$.catch=(U)=>NS($,U),$.pipe=(U)=>s9($,U),$.readonly=()=>JS($),$.describe=(U)=>{let b=$.clone();return Y4.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return Y4.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return Y4.get($);let b=$.clone();return Y4.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),$O=v("_ZodString",($,I)=>{dI.init($,I),j$.init($,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(Z9(...b)),$.includes=(...b)=>$.check(x9(...b)),$.startsWith=(...b)=>$.check(h9(...b)),$.endsWith=(...b)=>$.check(f9(...b)),$.min=(...b)=>$.check(V1(...b)),$.max=(...b)=>$.check(vw(...b)),$.length=(...b)=>$.check(Vw(...b)),$.nonempty=(...b)=>$.check(V1(1,...b)),$.lowercase=(b)=>$.check(C9(b)),$.uppercase=(b)=>$.check(g9(b)),$.trim=()=>$.check(u9()),$.normalize=(...b)=>$.check(y9(...b)),$.toLowerCase=()=>$.check(l9()),$.toUpperCase=()=>$.check(c9())}),SE=v("ZodString",($,I)=>{dI.init($,I),$O.init($,I),$.email=(U)=>$.check(D9(PE,U)),$.url=(U)=>$.check(Y9(kE,U)),$.jwt=(U)=>$.check(E9(rE,U)),$.emoji=(U)=>$.check(B9(RE,U)),$.guid=(U)=>$.check(Ow(aA,U)),$.uuid=(U)=>$.check(W9(jw,U)),$.uuidv4=(U)=>$.check(Q9(jw,U)),$.uuidv6=(U)=>$.check(G9(jw,U)),$.uuidv7=(U)=>$.check(N9(jw,U)),$.nanoid=(U)=>$.check(J9(TE,U)),$.guid=(U)=>$.check(Ow(aA,U)),$.cuid=(U)=>$.check(H9(_E,U)),$.cuid2=(U)=>$.check(A9(ZE,U)),$.ulid=(U)=>$.check(O9(CE,U)),$.base64=(U)=>$.check(F9(lE,U)),$.base64url=(U)=>$.check(M9(cE,U)),$.xid=(U)=>$.check(z9(gE,U)),$.ksuid=(U)=>$.check(L9(xE,U)),$.ipv4=(U)=>$.check(K9(hE,U)),$.ipv6=(U)=>$.check(v9(fE,U)),$.cidrv4=(U)=>$.check(V9(yE,U)),$.cidrv6=(U)=>$.check(q9(uE,U)),$.e164=(U)=>$.check(j9(mE,U)),$.datetime=(U)=>$.check(d9(U)),$.date=(U)=>$.check(p9(U)),$.time=(U)=>$.check(t9(U)),$.duration=(U)=>$.check(a9(U))});function K($){return X9(SE,$)}var v$=v("ZodStringFormat",($,I)=>{z$.init($,I),$O.init($,I)}),PE=v("ZodEmail",($,I)=>{vW.init($,I),v$.init($,I)});var aA=v("ZodGUID",($,I)=>{LW.init($,I),v$.init($,I)});var jw=v("ZodUUID",($,I)=>{KW.init($,I),v$.init($,I)});var kE=v("ZodURL",($,I)=>{VW.init($,I),v$.init($,I)});var RE=v("ZodEmoji",($,I)=>{qW.init($,I),v$.init($,I)});var TE=v("ZodNanoID",($,I)=>{FW.init($,I),v$.init($,I)});var _E=v("ZodCUID",($,I)=>{MW.init($,I),v$.init($,I)});var ZE=v("ZodCUID2",($,I)=>{jW.init($,I),v$.init($,I)});var CE=v("ZodULID",($,I)=>{EW.init($,I),v$.init($,I)});var gE=v("ZodXID",($,I)=>{SW.init($,I),v$.init($,I)});var xE=v("ZodKSUID",($,I)=>{PW.init($,I),v$.init($,I)});var hE=v("ZodIPv4",($,I)=>{kW.init($,I),v$.init($,I)});var fE=v("ZodIPv6",($,I)=>{RW.init($,I),v$.init($,I)});var yE=v("ZodCIDRv4",($,I)=>{TW.init($,I),v$.init($,I)});var uE=v("ZodCIDRv6",($,I)=>{_W.init($,I),v$.init($,I)});var lE=v("ZodBase64",($,I)=>{ZW.init($,I),v$.init($,I)});var cE=v("ZodBase64URL",($,I)=>{CW.init($,I),v$.init($,I)});var mE=v("ZodE164",($,I)=>{gW.init($,I),v$.init($,I)});var rE=v("ZodJWT",($,I)=>{xW.init($,I),v$.init($,I)});var IO=v("ZodNumber",($,I)=>{Bw.init($,I),j$.init($,I),$.gt=(b,w)=>$.check(Lw(b,w)),$.gte=(b,w)=>$.check(tI(b,w)),$.min=(b,w)=>$.check(tI(b,w)),$.lt=(b,w)=>$.check(zw(b,w)),$.lte=(b,w)=>$.check(pI(b,w)),$.max=(b,w)=>$.check(pI(b,w)),$.int=(b)=>$.check(eA(b)),$.safe=(b)=>$.check(eA(b)),$.positive=(b)=>$.check(Lw(0,b)),$.nonnegative=(b)=>$.check(tI(0,b)),$.negative=(b)=>$.check(zw(0,b)),$.nonpositive=(b)=>$.check(pI(0,b)),$.multipleOf=(b,w)=>$.check(Kw(b,w)),$.step=(b,w)=>$.check(Kw(b,w)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function Q$($){return S9(IO,$)}var nE=v("ZodNumberFormat",($,I)=>{hW.init($,I),IO.init($,I)});function eA($){return P9(nE,$)}var iE=v("ZodBoolean",($,I)=>{fW.init($,I),j$.init($,I)});function T$($){return k9(iE,$)}var oE=v("ZodNull",($,I)=>{yW.init($,I),j$.init($,I)});function $8($){return R9(oE,$)}var dE=v("ZodUnknown",($,I)=>{uW.init($,I),j$.init($,I)});function V$(){return T9(dE)}var pE=v("ZodNever",($,I)=>{lW.init($,I),j$.init($,I)});function tE($){return _9(pE,$)}var aE=v("ZodArray",($,I)=>{cW.init($,I),j$.init($,I),$.element=I.element,$.min=(U,b)=>$.check(V1(U,b)),$.nonempty=(U)=>$.check(V1(1,U)),$.max=(U,b)=>$.check(vw(U,b)),$.length=(U,b)=>$.check(Vw(U,b)),$.unwrap=()=>$.element});function w$($,I){return fA(aE,$,I)}var UO=v("ZodObject",($,I)=>{Jw.init($,I),j$.init($,I),I$.defineLazy($,"shape",()=>I.shape),$.keyof=()=>a$(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:V$()}),$.loose=()=>$.clone({...$._zod.def,catchall:V$()}),$.strict=()=>$.clone({...$._zod.def,catchall:tE()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return I$.extend($,U)},$.merge=(U)=>I$.merge($,U),$.pick=(U)=>I$.pick($,U),$.omit=(U)=>I$.omit($,U),$.partial=(...U)=>I$.partial(XO,$,U[0]),$.required=(...U)=>I$.required(DO,$,U[0])});function C($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new UO(U)}function m$($,I){return new UO({type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},catchall:V$(),...I$.normalizeParams(I)})}var wO=v("ZodUnion",($,I)=>{Hw.init($,I),j$.init($,I),$.options=I.options});function L$($,I){return new wO({type:"union",options:$,...I$.normalizeParams(I)})}var eE=v("ZodDiscriminatedUnion",($,I)=>{wO.init($,I),mW.init($,I)});function I8($,I,U){return new eE({type:"union",options:I,discriminator:$,...I$.normalizeParams(U)})}var sE=v("ZodIntersection",($,I)=>{rW.init($,I),j$.init($,I)});function Ew($,I){return new sE({type:"intersection",left:$,right:I})}var $S=v("ZodRecord",($,I)=>{nW.init($,I),j$.init($,I),$.keyType=I.keyType,$.valueType=I.valueType});function q$($,I,U){return new $S({type:"record",keyType:$,valueType:I,...I$.normalizeParams(U)})}var e9=v("ZodEnum",($,I)=>{iW.init($,I),j$.init($,I),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(b,w)=>{let X={};for(let D of b)if(U.has(D))X[D]=I.entries[D];else throw new Error(`Key ${D} not found in enum`);return new e9({...I,checks:[],...I$.normalizeParams(w),entries:X})},$.exclude=(b,w)=>{let X={...I.entries};for(let D of b)if(U.has(D))delete X[D];else throw new Error(`Key ${D} not found in enum`);return new e9({...I,checks:[],...I$.normalizeParams(w),entries:X})}});function a$($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new e9({type:"enum",entries:U,...I$.normalizeParams(I)})}var IS=v("ZodLiteral",($,I)=>{oW.init($,I),j$.init($,I),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function f($,I){return new IS({type:"literal",values:Array.isArray($)?$:[$],...I$.normalizeParams(I)})}var US=v("ZodTransform",($,I)=>{dW.init($,I),j$.init($,I),$._zod.parse=(U,b)=>{U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(I$.issue(X,U.value,I));else{let D=X;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=$),D.continue??(D.continue=!0),U.issues.push(I$.issue(D))}};let w=I.transform(U.value,U);if(w instanceof Promise)return w.then((X)=>{return U.value=X,U});return U.value=w,U}});function bO($){return new US({type:"transform",transform:$})}var XO=v("ZodOptional",($,I)=>{pW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function M$($){return new XO({type:"optional",innerType:$})}var wS=v("ZodNullable",($,I)=>{tW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function sA($){return new wS({type:"nullable",innerType:$})}var bS=v("ZodDefault",($,I)=>{aW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function XS($,I){return new bS({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var DS=v("ZodPrefault",($,I)=>{eW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function WS($,I){return new DS({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var DO=v("ZodNonOptional",($,I)=>{sW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function QS($,I){return new DO({type:"nonoptional",innerType:$,...I$.normalizeParams(I)})}var GS=v("ZodCatch",($,I)=>{$9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function NS($,I){return new GS({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var YS=v("ZodPipe",($,I)=>{I9.init($,I),j$.init($,I),$.in=I.in,$.out=I.out});function s9($,I){return new YS({type:"pipe",in:$,out:I})}var BS=v("ZodReadonly",($,I)=>{U9.init($,I),j$.init($,I)});function JS($){return new BS({type:"readonly",innerType:$})}var WO=v("ZodCustom",($,I)=>{w9.init($,I),j$.init($,I)});function HS($){let I=new Z$({check:"custom"});return I._zod.check=$,I}function QO($,I){return m9(WO,$??(()=>!0),I)}function AS($,I={}){return r9(WO,$,I)}function OS($){let I=HS((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(I$.issue(b,U.value,I._zod.def));else{let w=b;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=I),w.continue??(w.continue=!I._zod.def.abort),U.issues.push(I$.issue(w))}},$(U.value,U)});return I}function U8($,I){return s9(bO($),I)}D6(b9());var w8="2025-11-25";var GO=[w8,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],H4="io.modelcontextprotocol/related-task",Pw="2.0",C$=QO(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),NO=L$([K(),Q$().int()]),YO=K(),dc=m$({ttl:L$([Q$(),$8()]).optional(),pollInterval:Q$().optional()}),zS=C({ttl:Q$().optional()}),LS=C({taskId:K()}),b8=m$({progressToken:NO.optional(),[H4]:LS.optional()}),Q6=C({_meta:b8.optional()}),sI=Q6.extend({task:zS.optional()}),BO=($)=>sI.safeParse($).success,g$=C({method:K(),params:Q6.loose().optional()}),H6=C({_meta:b8.optional()}),A6=C({method:K(),params:H6.loose().optional()}),x$=m$({_meta:b8.optional()}),kw=L$([K(),Q$().int()]),JO=C({jsonrpc:f(Pw),id:kw,...g$.shape}).strict(),X8=($)=>JO.safeParse($).success,HO=C({jsonrpc:f(Pw),...A6.shape}).strict(),AO=($)=>HO.safeParse($).success,D8=C({jsonrpc:f(Pw),id:kw,result:x$}).strict(),$U=($)=>D8.safeParse($).success;var c;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(c||(c={}));var W8=C({jsonrpc:f(Pw),id:kw.optional(),error:C({code:Q$().int(),message:K(),data:V$().optional()})}).strict();var OO=($)=>W8.safeParse($).success;var zO=L$([JO,HO,D8,W8]),pc=L$([D8,W8]),Rw=x$.strict(),KS=H6.extend({requestId:kw.optional(),reason:K().optional()}),Tw=A6.extend({method:f("notifications/cancelled"),params:KS}),vS=C({src:K(),mimeType:K().optional(),sizes:w$(K()).optional(),theme:a$(["light","dark"]).optional()}),IU=C({icons:w$(vS).optional()}),F1=C({name:K(),title:K().optional()}),LO=F1.extend({...F1.shape,...IU.shape,version:K(),websiteUrl:K().optional(),description:K().optional()}),VS=Ew(C({applyDefaults:T$().optional()}),q$(K(),V$())),qS=U8(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},Ew(C({form:VS.optional(),url:C$.optional()}),q$(K(),V$()).optional())),FS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({sampling:m$({createMessage:C$.optional()}).optional(),elicitation:m$({create:C$.optional()}).optional()}).optional()}),MS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({tools:m$({call:C$.optional()}).optional()}).optional()}),jS=C({experimental:q$(K(),C$).optional(),sampling:C({context:C$.optional(),tools:C$.optional()}).optional(),elicitation:qS.optional(),roots:C({listChanged:T$().optional()}).optional(),tasks:FS.optional()}),ES=Q6.extend({protocolVersion:K(),capabilities:jS,clientInfo:LO}),Q8=g$.extend({method:f("initialize"),params:ES});var SS=C({experimental:q$(K(),C$).optional(),logging:C$.optional(),completions:C$.optional(),prompts:C({listChanged:T$().optional()}).optional(),resources:C({subscribe:T$().optional(),listChanged:T$().optional()}).optional(),tools:C({listChanged:T$().optional()}).optional(),tasks:MS.optional()}),PS=x$.extend({protocolVersion:K(),capabilities:SS,serverInfo:LO,instructions:K().optional()}),G8=A6.extend({method:f("notifications/initialized"),params:H6.optional()});var _w=g$.extend({method:f("ping"),params:Q6.optional()}),kS=C({progress:Q$(),total:M$(Q$()),message:M$(K())}),RS=C({...H6.shape,...kS.shape,progressToken:NO}),Zw=A6.extend({method:f("notifications/progress"),params:RS}),TS=Q6.extend({cursor:YO.optional()}),UU=g$.extend({params:TS.optional()}),wU=x$.extend({nextCursor:YO.optional()}),_S=a$(["working","input_required","completed","failed","cancelled"]),bU=C({taskId:K(),status:_S,ttl:L$([Q$(),$8()]),createdAt:K(),lastUpdatedAt:K(),pollInterval:M$(Q$()),statusMessage:M$(K())}),M1=x$.extend({task:bU}),ZS=H6.merge(bU),XU=A6.extend({method:f("notifications/tasks/status"),params:ZS}),Cw=g$.extend({method:f("tasks/get"),params:Q6.extend({taskId:K()})}),gw=x$.merge(bU),xw=g$.extend({method:f("tasks/result"),params:Q6.extend({taskId:K()})}),tc=x$.loose(),hw=UU.extend({method:f("tasks/list")}),fw=wU.extend({tasks:w$(bU)}),yw=g$.extend({method:f("tasks/cancel"),params:Q6.extend({taskId:K()})}),KO=x$.merge(bU),vO=C({uri:K(),mimeType:M$(K()),_meta:q$(K(),V$()).optional()}),VO=vO.extend({text:K()}),N8=K().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),qO=vO.extend({blob:N8}),DU=a$(["user","assistant"]),j1=C({audience:w$(DU).optional(),priority:Q$().min(0).max(1).optional(),lastModified:aI.datetime({offset:!0}).optional()}),FO=C({...F1.shape,...IU.shape,uri:K(),description:M$(K()),mimeType:M$(K()),annotations:j1.optional(),_meta:M$(m$({}))}),CS=C({...F1.shape,...IU.shape,uriTemplate:K(),description:M$(K()),mimeType:M$(K()),annotations:j1.optional(),_meta:M$(m$({}))}),uw=UU.extend({method:f("resources/list")}),gS=wU.extend({resources:w$(FO)}),lw=UU.extend({method:f("resources/templates/list")}),xS=wU.extend({resourceTemplates:w$(CS)}),Y8=Q6.extend({uri:K()}),hS=Y8,cw=g$.extend({method:f("resources/read"),params:hS}),fS=x$.extend({contents:w$(L$([VO,qO]))}),yS=A6.extend({method:f("notifications/resources/list_changed"),params:H6.optional()}),uS=Y8,lS=g$.extend({method:f("resources/subscribe"),params:uS}),cS=Y8,mS=g$.extend({method:f("resources/unsubscribe"),params:cS}),rS=H6.extend({uri:K()}),nS=A6.extend({method:f("notifications/resources/updated"),params:rS}),iS=C({name:K(),description:M$(K()),required:M$(T$())}),oS=C({...F1.shape,...IU.shape,description:M$(K()),arguments:M$(w$(iS)),_meta:M$(m$({}))}),mw=UU.extend({method:f("prompts/list")}),dS=wU.extend({prompts:w$(oS)}),pS=Q6.extend({name:K(),arguments:q$(K(),K()).optional()}),rw=g$.extend({method:f("prompts/get"),params:pS}),B8=C({type:f("text"),text:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),J8=C({type:f("image"),data:N8,mimeType:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),H8=C({type:f("audio"),data:N8,mimeType:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),tS=C({type:f("tool_use"),name:K(),id:K(),input:q$(K(),V$()),_meta:q$(K(),V$()).optional()}),aS=C({type:f("resource"),resource:L$([VO,qO]),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),eS=FO.extend({type:f("resource_link")}),A8=L$([B8,J8,H8,eS,aS]),sS=C({role:DU,content:A8}),$P=x$.extend({description:K().optional(),messages:w$(sS)}),IP=A6.extend({method:f("notifications/prompts/list_changed"),params:H6.optional()}),UP=C({title:K().optional(),readOnlyHint:T$().optional(),destructiveHint:T$().optional(),idempotentHint:T$().optional(),openWorldHint:T$().optional()}),wP=C({taskSupport:a$(["required","optional","forbidden"]).optional()}),MO=C({...F1.shape,...IU.shape,description:K().optional(),inputSchema:C({type:f("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()),outputSchema:C({type:f("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()).optional(),annotations:UP.optional(),execution:wP.optional(),_meta:q$(K(),V$()).optional()}),nw=UU.extend({method:f("tools/list")}),bP=wU.extend({tools:w$(MO)}),iw=x$.extend({content:w$(A8).default([]),structuredContent:q$(K(),V$()).optional(),isError:T$().optional()}),ac=iw.or(x$.extend({toolResult:V$()})),XP=sI.extend({name:K(),arguments:q$(K(),V$()).optional()}),E1=g$.extend({method:f("tools/call"),params:XP}),DP=A6.extend({method:f("notifications/tools/list_changed"),params:H6.optional()}),ec=C({autoRefresh:T$().default(!0),debounceMs:Q$().int().nonnegative().default(300)}),WU=a$(["debug","info","notice","warning","error","critical","alert","emergency"]),WP=Q6.extend({level:WU}),O8=g$.extend({method:f("logging/setLevel"),params:WP}),QP=H6.extend({level:WU,logger:K().optional(),data:V$()}),GP=A6.extend({method:f("notifications/message"),params:QP}),NP=C({name:K().optional()}),YP=C({hints:w$(NP).optional(),costPriority:Q$().min(0).max(1).optional(),speedPriority:Q$().min(0).max(1).optional(),intelligencePriority:Q$().min(0).max(1).optional()}),BP=C({mode:a$(["auto","required","none"]).optional()}),JP=C({type:f("tool_result"),toolUseId:K().describe("The unique identifier for the corresponding tool call."),content:w$(A8).default([]),structuredContent:C({}).loose().optional(),isError:T$().optional(),_meta:q$(K(),V$()).optional()}),HP=I8("type",[B8,J8,H8]),Sw=I8("type",[B8,J8,H8,tS,JP]),AP=C({role:DU,content:L$([Sw,w$(Sw)]),_meta:q$(K(),V$()).optional()}),OP=sI.extend({messages:w$(AP),modelPreferences:YP.optional(),systemPrompt:K().optional(),includeContext:a$(["none","thisServer","allServers"]).optional(),temperature:Q$().optional(),maxTokens:Q$().int(),stopSequences:w$(K()).optional(),metadata:C$.optional(),tools:w$(MO).optional(),toolChoice:BP.optional()}),zP=g$.extend({method:f("sampling/createMessage"),params:OP}),z8=x$.extend({model:K(),stopReason:M$(a$(["endTurn","stopSequence","maxTokens"]).or(K())),role:DU,content:HP}),L8=x$.extend({model:K(),stopReason:M$(a$(["endTurn","stopSequence","maxTokens","toolUse"]).or(K())),role:DU,content:L$([Sw,w$(Sw)])}),LP=C({type:f("boolean"),title:K().optional(),description:K().optional(),default:T$().optional()}),KP=C({type:f("string"),title:K().optional(),description:K().optional(),minLength:Q$().optional(),maxLength:Q$().optional(),format:a$(["email","uri","date","date-time"]).optional(),default:K().optional()}),vP=C({type:a$(["number","integer"]),title:K().optional(),description:K().optional(),minimum:Q$().optional(),maximum:Q$().optional(),default:Q$().optional()}),VP=C({type:f("string"),title:K().optional(),description:K().optional(),enum:w$(K()),default:K().optional()}),qP=C({type:f("string"),title:K().optional(),description:K().optional(),oneOf:w$(C({const:K(),title:K()})),default:K().optional()}),FP=C({type:f("string"),title:K().optional(),description:K().optional(),enum:w$(K()),enumNames:w$(K()).optional(),default:K().optional()}),MP=L$([VP,qP]),jP=C({type:f("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({type:f("string"),enum:w$(K())}),default:w$(K()).optional()}),EP=C({type:f("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({anyOf:w$(C({const:K(),title:K()}))}),default:w$(K()).optional()}),SP=L$([jP,EP]),PP=L$([FP,MP,SP]),kP=L$([PP,LP,KP,vP]),RP=sI.extend({mode:f("form").optional(),message:K(),requestedSchema:C({type:f("object"),properties:q$(K(),kP),required:w$(K()).optional()})}),TP=sI.extend({mode:f("url"),message:K(),elicitationId:K(),url:K().url()}),_P=L$([RP,TP]),ZP=g$.extend({method:f("elicitation/create"),params:_P}),CP=H6.extend({elicitationId:K()}),gP=A6.extend({method:f("notifications/elicitation/complete"),params:CP}),ow=x$.extend({action:a$(["accept","decline","cancel"]),content:U8(($)=>$===null?void 0:$,q$(K(),L$([K(),Q$(),T$(),w$(K())])).optional())}),xP=C({type:f("ref/resource"),uri:K()});var hP=C({type:f("ref/prompt"),name:K()}),fP=Q6.extend({ref:L$([hP,xP]),argument:C({name:K(),value:K()}),context:C({arguments:q$(K(),K()).optional()}).optional()}),dw=g$.extend({method:f("completion/complete"),params:fP});function jO($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function EO($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var yP=x$.extend({completion:m$({values:w$(K()).max(100),total:M$(Q$().int()),hasMore:M$(T$())})}),uP=C({uri:K().startsWith("file://"),name:K().optional(),_meta:q$(K(),V$()).optional()}),lP=g$.extend({method:f("roots/list"),params:Q6.optional()}),K8=x$.extend({roots:w$(uP)}),cP=A6.extend({method:f("notifications/roots/list_changed"),params:H6.optional()}),sc=L$([_w,Q8,dw,O8,rw,mw,uw,lw,cw,lS,mS,E1,nw,Cw,xw,hw,yw]),$m=L$([Tw,Zw,G8,cP,XU]),Im=L$([Rw,z8,L8,ow,K8,gw,fw,M1]),Um=L$([_w,zP,ZP,lP,Cw,xw,hw,yw]),wm=L$([Tw,Zw,GP,nS,yS,DP,IP,XU,gP]),bm=L$([Rw,PS,yP,$P,dS,gS,xS,fS,iw,bP,gw,fw,M1]);class h extends Error{constructor($,I,U){super(`MCP error ${$}: ${I}`);this.code=$,this.data=U,this.name="McpError"}static fromError($,I,U){if($===c.UrlElicitationRequired&&U){let b=U;if(b.elicitations)return new SO(b.elicitations,I)}return new h($,I,U)}}class SO extends h{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(c.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function A4($){return $==="completed"||$==="failed"||$==="cancelled"}var kO=Symbol("Let zodToJsonSchema decide on which parser to use");var PO={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},RO=($)=>typeof $==="string"?{...PO,name:$}:{...PO,...$};var TO=($)=>{let I=RO($),U=I.name!==void 0?[...I.basePath,I.definitionPath,I.name]:I.basePath;return{...I,flags:{hasReferencedOpenAiAnyType:!1},currentPath:U,propertyPath:void 0,seen:new Map(Object.entries(I.definitions).map(([b,w])=>[w._def,{def:w._def,path:[...I.basePath,I.definitionPath,b],jsonSchema:void 0}]))}};function v8($,I,U,b){if(!b?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function b$($,I,U,b,w){$[I]=U,v8($,I,b,w)}var pw=($,I)=>{let U=0;for(;U<$.length&&U<I.length;U++)if($[U]!==I[U])break;return[($.length-U).toString(),...I.slice(U)].join("/")};function F$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?pw(I,$.currentPath):I.join("/")}}function _O($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==M.ZodAny)U.items=n($.type._def,{...I,currentPath:[...I.currentPath,"items"]});if($.minLength)b$(U,"minItems",$.minLength.value,$.minLength.message,I);if($.maxLength)b$(U,"maxItems",$.maxLength.value,$.maxLength.message,I);if($.exactLength)b$(U,"minItems",$.exactLength.value,$.exactLength.message,I),b$(U,"maxItems",$.exactLength.value,$.exactLength.message,I);return U}function ZO($,I){let U={type:"integer",format:"int64"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"min":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"minimum",b.value,b.message,I);else b$(U,"exclusiveMinimum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMinimum=!0;b$(U,"minimum",b.value,b.message,I)}break;case"max":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"maximum",b.value,b.message,I);else b$(U,"exclusiveMaximum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMaximum=!0;b$(U,"maximum",b.value,b.message,I)}break;case"multipleOf":b$(U,"multipleOf",b.value,b.message,I);break}return U}function CO(){return{type:"boolean"}}function tw($,I){return n($.type._def,I)}var gO=($,I)=>{return n($.innerType._def,I)};function V8($,I,U){let b=U??I.dateStrategy;if(Array.isArray(b))return{anyOf:b.map((w,X)=>V8($,I,w))};switch(b){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return mP($,I)}}var mP=($,I)=>{let U={type:"integer",format:"unix-time"};if(I.target==="openApi3")return U;for(let b of $.checks)switch(b.kind){case"min":b$(U,"minimum",b.value,b.message,I);break;case"max":b$(U,"maximum",b.value,b.message,I);break}return U};function xO($,I){return{...n($.innerType._def,I),default:$.defaultValue()}}function hO($,I){return I.effectStrategy==="input"?n($.schema._def,I):F$(I)}function fO($){return{type:"string",enum:Array.from($.values)}}var rP=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function yO($,I){let U=[n($.left._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),n($.right._def,{...I,currentPath:[...I.currentPath,"allOf","1"]})].filter((X)=>!!X),b=I.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,w=[];return U.forEach((X)=>{if(rP(X)){if(w.push(...X.allOf),X.unevaluatedProperties===void 0)b=void 0}else{let D=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:W,...Q}=X;D=Q}else b=void 0;w.push(D)}}),w.length?{allOf:w,...b}:void 0}function uO($,I){let U=typeof $.value;if(U!=="bigint"&&U!=="number"&&U!=="boolean"&&U!=="string")return{type:Array.isArray($.value)?"array":"object"};if(I.target==="openApi3")return{type:U==="bigint"?"integer":U,enum:[$.value]};return{type:U==="bigint"?"integer":U,const:$.value}}var q8=void 0,F6={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(q8===void 0)q8=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return q8},uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function aw($,I){let U={type:"string"};if($.checks)for(let b of $.checks)switch(b.kind){case"min":b$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,b.value):b.value,b.message,I);break;case"max":b$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,b.value):b.value,b.message,I);break;case"email":switch(I.emailStrategy){case"format:email":M6(U,"email",b.message,I);break;case"format:idn-email":M6(U,"idn-email",b.message,I);break;case"pattern:zod":r$(U,F6.email,b.message,I);break}break;case"url":M6(U,"uri",b.message,I);break;case"uuid":M6(U,"uuid",b.message,I);break;case"regex":r$(U,b.regex,b.message,I);break;case"cuid":r$(U,F6.cuid,b.message,I);break;case"cuid2":r$(U,F6.cuid2,b.message,I);break;case"startsWith":r$(U,RegExp(`^${F8(b.value,I)}`),b.message,I);break;case"endsWith":r$(U,RegExp(`${F8(b.value,I)}$`),b.message,I);break;case"datetime":M6(U,"date-time",b.message,I);break;case"date":M6(U,"date",b.message,I);break;case"time":M6(U,"time",b.message,I);break;case"duration":M6(U,"duration",b.message,I);break;case"length":b$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,b.value):b.value,b.message,I),b$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,b.value):b.value,b.message,I);break;case"includes":{r$(U,RegExp(F8(b.value,I)),b.message,I);break}case"ip":{if(b.version!=="v6")M6(U,"ipv4",b.message,I);if(b.version!=="v4")M6(U,"ipv6",b.message,I);break}case"base64url":r$(U,F6.base64url,b.message,I);break;case"jwt":r$(U,F6.jwt,b.message,I);break;case"cidr":{if(b.version!=="v6")r$(U,F6.ipv4Cidr,b.message,I);if(b.version!=="v4")r$(U,F6.ipv6Cidr,b.message,I);break}case"emoji":r$(U,F6.emoji(),b.message,I);break;case"ulid":{r$(U,F6.ulid,b.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{M6(U,"binary",b.message,I);break}case"contentEncoding:base64":{b$(U,"contentEncoding","base64",b.message,I);break}case"pattern:zod":{r$(U,F6.base64,b.message,I);break}}break}case"nanoid":r$(U,F6.nanoid,b.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((w)=>{})(b)}return U}function F8($,I){return I.patternStrategy==="escape"?iP($):$}var nP=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function iP($){let I="";for(let U=0;U<$.length;U++){if(!nP.has($[U]))I+="\\";I+=$[U]}return I}function M6($,I,U,b){if($.format||$.anyOf?.some((w)=>w.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&b.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:I,...U&&b.errorMessages&&{errorMessage:{format:U}}})}else b$($,"format",I,U,b)}function r$($,I,U,b){if($.pattern||$.allOf?.some((w)=>w.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&b.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:lO(I,b),...U&&b.errorMessages&&{errorMessage:{pattern:U}}})}else b$($,"pattern",lO(I,b),U,b)}function lO($,I){if(!I.applyRegexFlags||!$.flags)return $.source;let U={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},b=U.i?$.source.toLowerCase():$.source,w="",X=!1,D=!1,W=!1;for(let Q=0;Q<b.length;Q++){if(X){w+=b[Q],X=!1;continue}if(U.i){if(D){if(b[Q].match(/[a-z]/)){if(W)w+=b[Q],w+=`${b[Q-2]}-${b[Q]}`.toUpperCase(),W=!1;else if(b[Q+1]==="-"&&b[Q+2]?.match(/[a-z]/))w+=b[Q],W=!0;else w+=`${b[Q]}${b[Q].toUpperCase()}`;continue}}else if(b[Q].match(/[a-z]/)){w+=`[${b[Q]}${b[Q].toUpperCase()}]`;continue}}if(U.m){if(b[Q]==="^"){w+=`(^|(?<=[\r
36
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let G of this.seen.entries()){let N=G[1];if($===G[0]){X(G);continue}if(U.external){let H=U.external.registry.get(G[0])?.id;if($!==G[0]&&H){X(G);continue}}if(this.metadataRegistry.get(G[0])?.id){X(G);continue}if(N.cycle){X(G);continue}if(N.count>1){if(U.reused==="ref"){X(G);continue}}}let D=(G,N)=>{let B=this.seen.get(G),H=B.def??B.schema,J={...H};if(B.ref===null)return;let A=B.ref;if(B.ref=null,A){D(A,N);let O=this.seen.get(A).schema;if(O.$ref&&N.target==="draft-7")H.allOf=H.allOf??[],H.allOf.push(O);else Object.assign(H,O),Object.assign(H,J)}if(!B.isParent)this.override({zodSchema:G,jsonSchema:H,path:B.path??[]})};for(let G of[...this.seen.entries()].reverse())D(G[0],{target:this.target});let W={};if(this.target==="draft-2020-12")W.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")W.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);if(U.external?.uri){let G=U.external.registry.get($)?.id;if(!G)throw new Error("Schema is missing an `id` property");W.$id=U.external.uri(G)}Object.assign(W,b.def);let Q=U.external?.defs??{};for(let G of this.seen.entries()){let N=G[1];if(N.def&&N.defId)Q[N.defId]=N.def}if(U.external);else if(Object.keys(Q).length>0)if(this.target==="draft-2020-12")W.$defs=Q;else W.definitions=Q;try{return JSON.parse(JSON.stringify(W))}catch(G){throw new Error("Error converting schema to JSON.")}}}function i9($,I){if($ instanceof Aw){let b=new n9(I),w={};for(let W of $._idmap.entries()){let[Q,G]=W;b.process(G)}let X={},D={registry:$,uri:I?.uri,defs:w};for(let W of $._idmap.entries()){let[Q,G]=W;X[Q]=b.emit(G,{...I,external:D})}if(Object.keys(w).length>0){let W=b.target==="draft-2020-12"?"$defs":"definitions";X.__shared={[W]:w}}return{schemas:X}}let U=new n9(I);return U.process($),U.emit($,I)}function R$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let w=$._zod.def;switch(w.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 R$(w.element,U);case"object":{for(let X in w.shape)if(R$(w.shape[X],U))return!0;return!1}case"union":{for(let X of w.options)if(R$(X,U))return!0;return!1}case"intersection":return R$(w.left,U)||R$(w.right,U);case"tuple":{for(let X of w.items)if(R$(X,U))return!0;if(w.rest&&R$(w.rest,U))return!0;return!1}case"record":return R$(w.keyType,U)||R$(w.valueType,U);case"map":return R$(w.keyType,U)||R$(w.valueType,U);case"set":return R$(w.valueType,U);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return R$(w.innerType,U);case"lazy":return R$(w.getter(),U);case"default":return R$(w.innerType,U);case"prefault":return R$(w.innerType,U);case"custom":return!1;case"transform":return!0;case"pipe":return R$(w.in,U)||R$(w.out,U);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${w.type}`)}var LE=v("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");N$.init($,I),$.def=I,$.parse=(U,b)=>WW($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>m4($,U,b),$.parseAsync=async(U,b)=>GW($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>r4($,U,b),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(U,b)=>W6($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$}});var KE=v("ZodMiniObject",($,I)=>{Jw.init($,I),LE.init($,I),I$.defineLazy($,"shape",()=>I.shape)});function o9($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new KE(U)}function J6($){return!!$._zod}function o4($){let I=Object.values($);if(I.length===0)return o9({});let U=I.every(J6),b=I.every((w)=>!J6(w));if(U)return o9($);if(b)return MH($);throw new Error("Mixed Zod versions detected in object shape.")}function B4($,I){if(J6($))return m4($,I);return $.safeParse(I)}async function qw($,I){if(J6($))return await r4($,I);return await $.safeParseAsync(I)}function J4($){if(!$)return;let I;if(J6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function q1($){if(!$)return;if(typeof $==="object"){let I=$,U=$;if(!I._def&&!U._zod){let b=Object.values($);if(b.length>0&&b.every((w)=>typeof w==="object"&&w!==null&&(w._def!==void 0||w._zod!==void 0||typeof w.parse==="function")))return o4($)}}if(J6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function Fw($){if($&&typeof $==="object"){if("message"in $&&typeof $.message==="string")return $.message;if("issues"in $&&Array.isArray($.issues)&&$.issues.length>0){let I=$.issues[0];if(I&&typeof I==="object"&&"message"in I)return String(I.message)}try{return JSON.stringify($)}catch{return String($)}}return String($)}function lA($){return $.description}function cA($){if(J6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function Mw($){if(J6($)){let X=$._zod?.def;if(X){if(X.value!==void 0)return X.value;if(Array.isArray(X.values)&&X.values.length>0)return X.values[0]}}let U=$._def;if(U){if(U.value!==void 0)return U.value;if(Array.isArray(U.values)&&U.values.length>0)return U.values[0]}let b=$.value;if(b!==void 0)return b;return}var aI={};v6(aI,{time:()=>t9,duration:()=>a9,datetime:()=>d9,date:()=>p9,ZodISOTime:()=>nA,ZodISODuration:()=>iA,ZodISODateTime:()=>mA,ZodISODate:()=>rA});var mA=v("ZodISODateTime",($,I)=>{kA.init($,I),v$.init($,I)});function d9($){return gA(mA,$)}var rA=v("ZodISODate",($,I)=>{RA.init($,I),v$.init($,I)});function p9($){return xA(rA,$)}var nA=v("ZodISOTime",($,I)=>{TA.init($,I),v$.init($,I)});function t9($){return hA(nA,$)}var iA=v("ZodISODuration",($,I)=>{_A.init($,I),v$.init($,I)});function a9($){return fA(iA,$)}var oA=($,I)=>{Gw.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>XW($,U)},flatten:{value:(U)=>bW($,U)},addIssue:{value:(U)=>$.issues.push(U)},addIssues:{value:(U)=>$.issues.push(...U)},isEmpty:{get(){return $.issues.length===0}}})},gc=v("ZodError",oA),eI=v("ZodError",oA,{Parent:Error});var dA=DW(eI),pA=QW(eI),tA=NW(eI),aA=YW(eI);var j$=v("ZodType",($,I)=>{return N$.init($,I),$.def=I,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(U,b)=>W6($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$},$.parse=(U,b)=>dA($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>tA($,U,b),$.parseAsync=async(U,b)=>pA($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>aA($,U,b),$.spa=$.safeParseAsync,$.refine=(U,b)=>$.check(OS(U,b)),$.superRefine=(U)=>$.check(zS(U)),$.overwrite=(U)=>$.check(n4(U)),$.optional=()=>M$($),$.nullable=()=>$O($),$.nullish=()=>M$($O($)),$.nonoptional=(U)=>GS($,U),$.array=()=>w$($),$.or=(U)=>L$([$,U]),$.and=(U)=>Ew($,U),$.transform=(U)=>s9($,XO(U)),$.default=(U)=>DS($,U),$.prefault=(U)=>QS($,U),$.catch=(U)=>YS($,U),$.pipe=(U)=>s9($,U),$.readonly=()=>HS($),$.describe=(U)=>{let b=$.clone();return Y4.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return Y4.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return Y4.get($);let b=$.clone();return Y4.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),IO=v("_ZodString",($,I)=>{dI.init($,I),j$.init($,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(Z9(...b)),$.includes=(...b)=>$.check(x9(...b)),$.startsWith=(...b)=>$.check(h9(...b)),$.endsWith=(...b)=>$.check(f9(...b)),$.min=(...b)=>$.check(V1(...b)),$.max=(...b)=>$.check(vw(...b)),$.length=(...b)=>$.check(Vw(...b)),$.nonempty=(...b)=>$.check(V1(1,...b)),$.lowercase=(b)=>$.check(C9(b)),$.uppercase=(b)=>$.check(g9(b)),$.trim=()=>$.check(u9()),$.normalize=(...b)=>$.check(y9(...b)),$.toLowerCase=()=>$.check(l9()),$.toUpperCase=()=>$.check(c9())}),PE=v("ZodString",($,I)=>{dI.init($,I),IO.init($,I),$.email=(U)=>$.check(D9(kE,U)),$.url=(U)=>$.check(Y9(RE,U)),$.jwt=(U)=>$.check(E9(nE,U)),$.emoji=(U)=>$.check(B9(TE,U)),$.guid=(U)=>$.check(Ow(eA,U)),$.uuid=(U)=>$.check(W9(jw,U)),$.uuidv4=(U)=>$.check(Q9(jw,U)),$.uuidv6=(U)=>$.check(G9(jw,U)),$.uuidv7=(U)=>$.check(N9(jw,U)),$.nanoid=(U)=>$.check(J9(_E,U)),$.guid=(U)=>$.check(Ow(eA,U)),$.cuid=(U)=>$.check(H9(ZE,U)),$.cuid2=(U)=>$.check(A9(CE,U)),$.ulid=(U)=>$.check(O9(gE,U)),$.base64=(U)=>$.check(F9(cE,U)),$.base64url=(U)=>$.check(M9(mE,U)),$.xid=(U)=>$.check(z9(xE,U)),$.ksuid=(U)=>$.check(L9(hE,U)),$.ipv4=(U)=>$.check(K9(fE,U)),$.ipv6=(U)=>$.check(v9(yE,U)),$.cidrv4=(U)=>$.check(V9(uE,U)),$.cidrv6=(U)=>$.check(q9(lE,U)),$.e164=(U)=>$.check(j9(rE,U)),$.datetime=(U)=>$.check(d9(U)),$.date=(U)=>$.check(p9(U)),$.time=(U)=>$.check(t9(U)),$.duration=(U)=>$.check(a9(U))});function K($){return X9(PE,$)}var v$=v("ZodStringFormat",($,I)=>{z$.init($,I),IO.init($,I)}),kE=v("ZodEmail",($,I)=>{vW.init($,I),v$.init($,I)});var eA=v("ZodGUID",($,I)=>{LW.init($,I),v$.init($,I)});var jw=v("ZodUUID",($,I)=>{KW.init($,I),v$.init($,I)});var RE=v("ZodURL",($,I)=>{VW.init($,I),v$.init($,I)});var TE=v("ZodEmoji",($,I)=>{qW.init($,I),v$.init($,I)});var _E=v("ZodNanoID",($,I)=>{FW.init($,I),v$.init($,I)});var ZE=v("ZodCUID",($,I)=>{MW.init($,I),v$.init($,I)});var CE=v("ZodCUID2",($,I)=>{jW.init($,I),v$.init($,I)});var gE=v("ZodULID",($,I)=>{EW.init($,I),v$.init($,I)});var xE=v("ZodXID",($,I)=>{SW.init($,I),v$.init($,I)});var hE=v("ZodKSUID",($,I)=>{PW.init($,I),v$.init($,I)});var fE=v("ZodIPv4",($,I)=>{kW.init($,I),v$.init($,I)});var yE=v("ZodIPv6",($,I)=>{RW.init($,I),v$.init($,I)});var uE=v("ZodCIDRv4",($,I)=>{TW.init($,I),v$.init($,I)});var lE=v("ZodCIDRv6",($,I)=>{_W.init($,I),v$.init($,I)});var cE=v("ZodBase64",($,I)=>{ZW.init($,I),v$.init($,I)});var mE=v("ZodBase64URL",($,I)=>{CW.init($,I),v$.init($,I)});var rE=v("ZodE164",($,I)=>{gW.init($,I),v$.init($,I)});var nE=v("ZodJWT",($,I)=>{xW.init($,I),v$.init($,I)});var UO=v("ZodNumber",($,I)=>{Bw.init($,I),j$.init($,I),$.gt=(b,w)=>$.check(Lw(b,w)),$.gte=(b,w)=>$.check(tI(b,w)),$.min=(b,w)=>$.check(tI(b,w)),$.lt=(b,w)=>$.check(zw(b,w)),$.lte=(b,w)=>$.check(pI(b,w)),$.max=(b,w)=>$.check(pI(b,w)),$.int=(b)=>$.check(sA(b)),$.safe=(b)=>$.check(sA(b)),$.positive=(b)=>$.check(Lw(0,b)),$.nonnegative=(b)=>$.check(tI(0,b)),$.negative=(b)=>$.check(zw(0,b)),$.nonpositive=(b)=>$.check(pI(0,b)),$.multipleOf=(b,w)=>$.check(Kw(b,w)),$.step=(b,w)=>$.check(Kw(b,w)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function Q$($){return S9(UO,$)}var iE=v("ZodNumberFormat",($,I)=>{hW.init($,I),UO.init($,I)});function sA($){return P9(iE,$)}var oE=v("ZodBoolean",($,I)=>{fW.init($,I),j$.init($,I)});function T$($){return k9(oE,$)}var dE=v("ZodNull",($,I)=>{yW.init($,I),j$.init($,I)});function $8($){return R9(dE,$)}var pE=v("ZodUnknown",($,I)=>{uW.init($,I),j$.init($,I)});function V$(){return T9(pE)}var tE=v("ZodNever",($,I)=>{lW.init($,I),j$.init($,I)});function aE($){return _9(tE,$)}var eE=v("ZodArray",($,I)=>{cW.init($,I),j$.init($,I),$.element=I.element,$.min=(U,b)=>$.check(V1(U,b)),$.nonempty=(U)=>$.check(V1(1,U)),$.max=(U,b)=>$.check(vw(U,b)),$.length=(U,b)=>$.check(Vw(U,b)),$.unwrap=()=>$.element});function w$($,I){return yA(eE,$,I)}var wO=v("ZodObject",($,I)=>{Jw.init($,I),j$.init($,I),I$.defineLazy($,"shape",()=>I.shape),$.keyof=()=>a$(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:V$()}),$.loose=()=>$.clone({...$._zod.def,catchall:V$()}),$.strict=()=>$.clone({...$._zod.def,catchall:aE()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return I$.extend($,U)},$.merge=(U)=>I$.merge($,U),$.pick=(U)=>I$.pick($,U),$.omit=(U)=>I$.omit($,U),$.partial=(...U)=>I$.partial(DO,$,U[0]),$.required=(...U)=>I$.required(WO,$,U[0])});function C($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new wO(U)}function m$($,I){return new wO({type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},catchall:V$(),...I$.normalizeParams(I)})}var bO=v("ZodUnion",($,I)=>{Hw.init($,I),j$.init($,I),$.options=I.options});function L$($,I){return new bO({type:"union",options:$,...I$.normalizeParams(I)})}var sE=v("ZodDiscriminatedUnion",($,I)=>{bO.init($,I),mW.init($,I)});function I8($,I,U){return new sE({type:"union",options:I,discriminator:$,...I$.normalizeParams(U)})}var $S=v("ZodIntersection",($,I)=>{rW.init($,I),j$.init($,I)});function Ew($,I){return new $S({type:"intersection",left:$,right:I})}var IS=v("ZodRecord",($,I)=>{nW.init($,I),j$.init($,I),$.keyType=I.keyType,$.valueType=I.valueType});function q$($,I,U){return new IS({type:"record",keyType:$,valueType:I,...I$.normalizeParams(U)})}var e9=v("ZodEnum",($,I)=>{iW.init($,I),j$.init($,I),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(b,w)=>{let X={};for(let D of b)if(U.has(D))X[D]=I.entries[D];else throw new Error(`Key ${D} not found in enum`);return new e9({...I,checks:[],...I$.normalizeParams(w),entries:X})},$.exclude=(b,w)=>{let X={...I.entries};for(let D of b)if(U.has(D))delete X[D];else throw new Error(`Key ${D} not found in enum`);return new e9({...I,checks:[],...I$.normalizeParams(w),entries:X})}});function a$($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new e9({type:"enum",entries:U,...I$.normalizeParams(I)})}var US=v("ZodLiteral",($,I)=>{oW.init($,I),j$.init($,I),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function f($,I){return new US({type:"literal",values:Array.isArray($)?$:[$],...I$.normalizeParams(I)})}var wS=v("ZodTransform",($,I)=>{dW.init($,I),j$.init($,I),$._zod.parse=(U,b)=>{U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(I$.issue(X,U.value,I));else{let D=X;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=$),D.continue??(D.continue=!0),U.issues.push(I$.issue(D))}};let w=I.transform(U.value,U);if(w instanceof Promise)return w.then((X)=>{return U.value=X,U});return U.value=w,U}});function XO($){return new wS({type:"transform",transform:$})}var DO=v("ZodOptional",($,I)=>{pW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function M$($){return new DO({type:"optional",innerType:$})}var bS=v("ZodNullable",($,I)=>{tW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function $O($){return new bS({type:"nullable",innerType:$})}var XS=v("ZodDefault",($,I)=>{aW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function DS($,I){return new XS({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var WS=v("ZodPrefault",($,I)=>{eW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function QS($,I){return new WS({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var WO=v("ZodNonOptional",($,I)=>{sW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function GS($,I){return new WO({type:"nonoptional",innerType:$,...I$.normalizeParams(I)})}var NS=v("ZodCatch",($,I)=>{$9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function YS($,I){return new NS({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var BS=v("ZodPipe",($,I)=>{I9.init($,I),j$.init($,I),$.in=I.in,$.out=I.out});function s9($,I){return new BS({type:"pipe",in:$,out:I})}var JS=v("ZodReadonly",($,I)=>{U9.init($,I),j$.init($,I)});function HS($){return new JS({type:"readonly",innerType:$})}var QO=v("ZodCustom",($,I)=>{w9.init($,I),j$.init($,I)});function AS($){let I=new Z$({check:"custom"});return I._zod.check=$,I}function GO($,I){return m9(QO,$??(()=>!0),I)}function OS($,I={}){return r9(QO,$,I)}function zS($){let I=AS((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(I$.issue(b,U.value,I._zod.def));else{let w=b;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=I),w.continue??(w.continue=!I._zod.def.abort),U.issues.push(I$.issue(w))}},$(U.value,U)});return I}function U8($,I){return s9(XO($),I)}D6(b9());var w8="2025-11-25";var NO=[w8,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],H4="io.modelcontextprotocol/related-task",Pw="2.0",C$=GO(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),YO=L$([K(),Q$().int()]),BO=K(),pc=m$({ttl:L$([Q$(),$8()]).optional(),pollInterval:Q$().optional()}),LS=C({ttl:Q$().optional()}),KS=C({taskId:K()}),b8=m$({progressToken:YO.optional(),[H4]:KS.optional()}),Q6=C({_meta:b8.optional()}),sI=Q6.extend({task:LS.optional()}),JO=($)=>sI.safeParse($).success,g$=C({method:K(),params:Q6.loose().optional()}),H6=C({_meta:b8.optional()}),A6=C({method:K(),params:H6.loose().optional()}),x$=m$({_meta:b8.optional()}),kw=L$([K(),Q$().int()]),HO=C({jsonrpc:f(Pw),id:kw,...g$.shape}).strict(),X8=($)=>HO.safeParse($).success,AO=C({jsonrpc:f(Pw),...A6.shape}).strict(),OO=($)=>AO.safeParse($).success,D8=C({jsonrpc:f(Pw),id:kw,result:x$}).strict(),$U=($)=>D8.safeParse($).success;var c;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(c||(c={}));var W8=C({jsonrpc:f(Pw),id:kw.optional(),error:C({code:Q$().int(),message:K(),data:V$().optional()})}).strict();var zO=($)=>W8.safeParse($).success;var LO=L$([HO,AO,D8,W8]),tc=L$([D8,W8]),Rw=x$.strict(),vS=H6.extend({requestId:kw.optional(),reason:K().optional()}),Tw=A6.extend({method:f("notifications/cancelled"),params:vS}),VS=C({src:K(),mimeType:K().optional(),sizes:w$(K()).optional(),theme:a$(["light","dark"]).optional()}),IU=C({icons:w$(VS).optional()}),F1=C({name:K(),title:K().optional()}),KO=F1.extend({...F1.shape,...IU.shape,version:K(),websiteUrl:K().optional(),description:K().optional()}),qS=Ew(C({applyDefaults:T$().optional()}),q$(K(),V$())),FS=U8(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},Ew(C({form:qS.optional(),url:C$.optional()}),q$(K(),V$()).optional())),MS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({sampling:m$({createMessage:C$.optional()}).optional(),elicitation:m$({create:C$.optional()}).optional()}).optional()}),jS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({tools:m$({call:C$.optional()}).optional()}).optional()}),ES=C({experimental:q$(K(),C$).optional(),sampling:C({context:C$.optional(),tools:C$.optional()}).optional(),elicitation:FS.optional(),roots:C({listChanged:T$().optional()}).optional(),tasks:MS.optional()}),SS=Q6.extend({protocolVersion:K(),capabilities:ES,clientInfo:KO}),Q8=g$.extend({method:f("initialize"),params:SS});var PS=C({experimental:q$(K(),C$).optional(),logging:C$.optional(),completions:C$.optional(),prompts:C({listChanged:T$().optional()}).optional(),resources:C({subscribe:T$().optional(),listChanged:T$().optional()}).optional(),tools:C({listChanged:T$().optional()}).optional(),tasks:jS.optional()}),kS=x$.extend({protocolVersion:K(),capabilities:PS,serverInfo:KO,instructions:K().optional()}),G8=A6.extend({method:f("notifications/initialized"),params:H6.optional()});var _w=g$.extend({method:f("ping"),params:Q6.optional()}),RS=C({progress:Q$(),total:M$(Q$()),message:M$(K())}),TS=C({...H6.shape,...RS.shape,progressToken:YO}),Zw=A6.extend({method:f("notifications/progress"),params:TS}),_S=Q6.extend({cursor:BO.optional()}),UU=g$.extend({params:_S.optional()}),wU=x$.extend({nextCursor:BO.optional()}),ZS=a$(["working","input_required","completed","failed","cancelled"]),bU=C({taskId:K(),status:ZS,ttl:L$([Q$(),$8()]),createdAt:K(),lastUpdatedAt:K(),pollInterval:M$(Q$()),statusMessage:M$(K())}),M1=x$.extend({task:bU}),CS=H6.merge(bU),XU=A6.extend({method:f("notifications/tasks/status"),params:CS}),Cw=g$.extend({method:f("tasks/get"),params:Q6.extend({taskId:K()})}),gw=x$.merge(bU),xw=g$.extend({method:f("tasks/result"),params:Q6.extend({taskId:K()})}),ac=x$.loose(),hw=UU.extend({method:f("tasks/list")}),fw=wU.extend({tasks:w$(bU)}),yw=g$.extend({method:f("tasks/cancel"),params:Q6.extend({taskId:K()})}),vO=x$.merge(bU),VO=C({uri:K(),mimeType:M$(K()),_meta:q$(K(),V$()).optional()}),qO=VO.extend({text:K()}),N8=K().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),FO=VO.extend({blob:N8}),DU=a$(["user","assistant"]),j1=C({audience:w$(DU).optional(),priority:Q$().min(0).max(1).optional(),lastModified:aI.datetime({offset:!0}).optional()}),MO=C({...F1.shape,...IU.shape,uri:K(),description:M$(K()),mimeType:M$(K()),annotations:j1.optional(),_meta:M$(m$({}))}),gS=C({...F1.shape,...IU.shape,uriTemplate:K(),description:M$(K()),mimeType:M$(K()),annotations:j1.optional(),_meta:M$(m$({}))}),uw=UU.extend({method:f("resources/list")}),xS=wU.extend({resources:w$(MO)}),lw=UU.extend({method:f("resources/templates/list")}),hS=wU.extend({resourceTemplates:w$(gS)}),Y8=Q6.extend({uri:K()}),fS=Y8,cw=g$.extend({method:f("resources/read"),params:fS}),yS=x$.extend({contents:w$(L$([qO,FO]))}),uS=A6.extend({method:f("notifications/resources/list_changed"),params:H6.optional()}),lS=Y8,cS=g$.extend({method:f("resources/subscribe"),params:lS}),mS=Y8,rS=g$.extend({method:f("resources/unsubscribe"),params:mS}),nS=H6.extend({uri:K()}),iS=A6.extend({method:f("notifications/resources/updated"),params:nS}),oS=C({name:K(),description:M$(K()),required:M$(T$())}),dS=C({...F1.shape,...IU.shape,description:M$(K()),arguments:M$(w$(oS)),_meta:M$(m$({}))}),mw=UU.extend({method:f("prompts/list")}),pS=wU.extend({prompts:w$(dS)}),tS=Q6.extend({name:K(),arguments:q$(K(),K()).optional()}),rw=g$.extend({method:f("prompts/get"),params:tS}),B8=C({type:f("text"),text:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),J8=C({type:f("image"),data:N8,mimeType:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),H8=C({type:f("audio"),data:N8,mimeType:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),aS=C({type:f("tool_use"),name:K(),id:K(),input:q$(K(),V$()),_meta:q$(K(),V$()).optional()}),eS=C({type:f("resource"),resource:L$([qO,FO]),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),sS=MO.extend({type:f("resource_link")}),A8=L$([B8,J8,H8,sS,eS]),$P=C({role:DU,content:A8}),IP=x$.extend({description:K().optional(),messages:w$($P)}),UP=A6.extend({method:f("notifications/prompts/list_changed"),params:H6.optional()}),wP=C({title:K().optional(),readOnlyHint:T$().optional(),destructiveHint:T$().optional(),idempotentHint:T$().optional(),openWorldHint:T$().optional()}),bP=C({taskSupport:a$(["required","optional","forbidden"]).optional()}),jO=C({...F1.shape,...IU.shape,description:K().optional(),inputSchema:C({type:f("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()),outputSchema:C({type:f("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()).optional(),annotations:wP.optional(),execution:bP.optional(),_meta:q$(K(),V$()).optional()}),nw=UU.extend({method:f("tools/list")}),XP=wU.extend({tools:w$(jO)}),iw=x$.extend({content:w$(A8).default([]),structuredContent:q$(K(),V$()).optional(),isError:T$().optional()}),ec=iw.or(x$.extend({toolResult:V$()})),DP=sI.extend({name:K(),arguments:q$(K(),V$()).optional()}),E1=g$.extend({method:f("tools/call"),params:DP}),WP=A6.extend({method:f("notifications/tools/list_changed"),params:H6.optional()}),sc=C({autoRefresh:T$().default(!0),debounceMs:Q$().int().nonnegative().default(300)}),WU=a$(["debug","info","notice","warning","error","critical","alert","emergency"]),QP=Q6.extend({level:WU}),O8=g$.extend({method:f("logging/setLevel"),params:QP}),GP=H6.extend({level:WU,logger:K().optional(),data:V$()}),NP=A6.extend({method:f("notifications/message"),params:GP}),YP=C({name:K().optional()}),BP=C({hints:w$(YP).optional(),costPriority:Q$().min(0).max(1).optional(),speedPriority:Q$().min(0).max(1).optional(),intelligencePriority:Q$().min(0).max(1).optional()}),JP=C({mode:a$(["auto","required","none"]).optional()}),HP=C({type:f("tool_result"),toolUseId:K().describe("The unique identifier for the corresponding tool call."),content:w$(A8).default([]),structuredContent:C({}).loose().optional(),isError:T$().optional(),_meta:q$(K(),V$()).optional()}),AP=I8("type",[B8,J8,H8]),Sw=I8("type",[B8,J8,H8,aS,HP]),OP=C({role:DU,content:L$([Sw,w$(Sw)]),_meta:q$(K(),V$()).optional()}),zP=sI.extend({messages:w$(OP),modelPreferences:BP.optional(),systemPrompt:K().optional(),includeContext:a$(["none","thisServer","allServers"]).optional(),temperature:Q$().optional(),maxTokens:Q$().int(),stopSequences:w$(K()).optional(),metadata:C$.optional(),tools:w$(jO).optional(),toolChoice:JP.optional()}),LP=g$.extend({method:f("sampling/createMessage"),params:zP}),z8=x$.extend({model:K(),stopReason:M$(a$(["endTurn","stopSequence","maxTokens"]).or(K())),role:DU,content:AP}),L8=x$.extend({model:K(),stopReason:M$(a$(["endTurn","stopSequence","maxTokens","toolUse"]).or(K())),role:DU,content:L$([Sw,w$(Sw)])}),KP=C({type:f("boolean"),title:K().optional(),description:K().optional(),default:T$().optional()}),vP=C({type:f("string"),title:K().optional(),description:K().optional(),minLength:Q$().optional(),maxLength:Q$().optional(),format:a$(["email","uri","date","date-time"]).optional(),default:K().optional()}),VP=C({type:a$(["number","integer"]),title:K().optional(),description:K().optional(),minimum:Q$().optional(),maximum:Q$().optional(),default:Q$().optional()}),qP=C({type:f("string"),title:K().optional(),description:K().optional(),enum:w$(K()),default:K().optional()}),FP=C({type:f("string"),title:K().optional(),description:K().optional(),oneOf:w$(C({const:K(),title:K()})),default:K().optional()}),MP=C({type:f("string"),title:K().optional(),description:K().optional(),enum:w$(K()),enumNames:w$(K()).optional(),default:K().optional()}),jP=L$([qP,FP]),EP=C({type:f("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({type:f("string"),enum:w$(K())}),default:w$(K()).optional()}),SP=C({type:f("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({anyOf:w$(C({const:K(),title:K()}))}),default:w$(K()).optional()}),PP=L$([EP,SP]),kP=L$([MP,jP,PP]),RP=L$([kP,KP,vP,VP]),TP=sI.extend({mode:f("form").optional(),message:K(),requestedSchema:C({type:f("object"),properties:q$(K(),RP),required:w$(K()).optional()})}),_P=sI.extend({mode:f("url"),message:K(),elicitationId:K(),url:K().url()}),ZP=L$([TP,_P]),CP=g$.extend({method:f("elicitation/create"),params:ZP}),gP=H6.extend({elicitationId:K()}),xP=A6.extend({method:f("notifications/elicitation/complete"),params:gP}),ow=x$.extend({action:a$(["accept","decline","cancel"]),content:U8(($)=>$===null?void 0:$,q$(K(),L$([K(),Q$(),T$(),w$(K())])).optional())}),hP=C({type:f("ref/resource"),uri:K()});var fP=C({type:f("ref/prompt"),name:K()}),yP=Q6.extend({ref:L$([fP,hP]),argument:C({name:K(),value:K()}),context:C({arguments:q$(K(),K()).optional()}).optional()}),dw=g$.extend({method:f("completion/complete"),params:yP});function EO($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function SO($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var uP=x$.extend({completion:m$({values:w$(K()).max(100),total:M$(Q$().int()),hasMore:M$(T$())})}),lP=C({uri:K().startsWith("file://"),name:K().optional(),_meta:q$(K(),V$()).optional()}),cP=g$.extend({method:f("roots/list"),params:Q6.optional()}),K8=x$.extend({roots:w$(lP)}),mP=A6.extend({method:f("notifications/roots/list_changed"),params:H6.optional()}),$m=L$([_w,Q8,dw,O8,rw,mw,uw,lw,cw,cS,rS,E1,nw,Cw,xw,hw,yw]),Im=L$([Tw,Zw,G8,mP,XU]),Um=L$([Rw,z8,L8,ow,K8,gw,fw,M1]),wm=L$([_w,LP,CP,cP,Cw,xw,hw,yw]),bm=L$([Tw,Zw,NP,iS,uS,WP,UP,XU,xP]),Xm=L$([Rw,kS,uP,IP,pS,xS,hS,yS,iw,XP,gw,fw,M1]);class h extends Error{constructor($,I,U){super(`MCP error ${$}: ${I}`);this.code=$,this.data=U,this.name="McpError"}static fromError($,I,U){if($===c.UrlElicitationRequired&&U){let b=U;if(b.elicitations)return new PO(b.elicitations,I)}return new h($,I,U)}}class PO extends h{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(c.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function A4($){return $==="completed"||$==="failed"||$==="cancelled"}var RO=Symbol("Let zodToJsonSchema decide on which parser to use");var kO={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},TO=($)=>typeof $==="string"?{...kO,name:$}:{...kO,...$};var _O=($)=>{let I=TO($),U=I.name!==void 0?[...I.basePath,I.definitionPath,I.name]:I.basePath;return{...I,flags:{hasReferencedOpenAiAnyType:!1},currentPath:U,propertyPath:void 0,seen:new Map(Object.entries(I.definitions).map(([b,w])=>[w._def,{def:w._def,path:[...I.basePath,I.definitionPath,b],jsonSchema:void 0}]))}};function v8($,I,U,b){if(!b?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function b$($,I,U,b,w){$[I]=U,v8($,I,b,w)}var pw=($,I)=>{let U=0;for(;U<$.length&&U<I.length;U++)if($[U]!==I[U])break;return[($.length-U).toString(),...I.slice(U)].join("/")};function F$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?pw(I,$.currentPath):I.join("/")}}function ZO($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==M.ZodAny)U.items=n($.type._def,{...I,currentPath:[...I.currentPath,"items"]});if($.minLength)b$(U,"minItems",$.minLength.value,$.minLength.message,I);if($.maxLength)b$(U,"maxItems",$.maxLength.value,$.maxLength.message,I);if($.exactLength)b$(U,"minItems",$.exactLength.value,$.exactLength.message,I),b$(U,"maxItems",$.exactLength.value,$.exactLength.message,I);return U}function CO($,I){let U={type:"integer",format:"int64"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"min":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"minimum",b.value,b.message,I);else b$(U,"exclusiveMinimum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMinimum=!0;b$(U,"minimum",b.value,b.message,I)}break;case"max":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"maximum",b.value,b.message,I);else b$(U,"exclusiveMaximum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMaximum=!0;b$(U,"maximum",b.value,b.message,I)}break;case"multipleOf":b$(U,"multipleOf",b.value,b.message,I);break}return U}function gO(){return{type:"boolean"}}function tw($,I){return n($.type._def,I)}var xO=($,I)=>{return n($.innerType._def,I)};function V8($,I,U){let b=U??I.dateStrategy;if(Array.isArray(b))return{anyOf:b.map((w,X)=>V8($,I,w))};switch(b){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return rP($,I)}}var rP=($,I)=>{let U={type:"integer",format:"unix-time"};if(I.target==="openApi3")return U;for(let b of $.checks)switch(b.kind){case"min":b$(U,"minimum",b.value,b.message,I);break;case"max":b$(U,"maximum",b.value,b.message,I);break}return U};function hO($,I){return{...n($.innerType._def,I),default:$.defaultValue()}}function fO($,I){return I.effectStrategy==="input"?n($.schema._def,I):F$(I)}function yO($){return{type:"string",enum:Array.from($.values)}}var nP=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function uO($,I){let U=[n($.left._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),n($.right._def,{...I,currentPath:[...I.currentPath,"allOf","1"]})].filter((X)=>!!X),b=I.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,w=[];return U.forEach((X)=>{if(nP(X)){if(w.push(...X.allOf),X.unevaluatedProperties===void 0)b=void 0}else{let D=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:W,...Q}=X;D=Q}else b=void 0;w.push(D)}}),w.length?{allOf:w,...b}:void 0}function lO($,I){let U=typeof $.value;if(U!=="bigint"&&U!=="number"&&U!=="boolean"&&U!=="string")return{type:Array.isArray($.value)?"array":"object"};if(I.target==="openApi3")return{type:U==="bigint"?"integer":U,enum:[$.value]};return{type:U==="bigint"?"integer":U,const:$.value}}var q8=void 0,F6={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(q8===void 0)q8=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return q8},uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function aw($,I){let U={type:"string"};if($.checks)for(let b of $.checks)switch(b.kind){case"min":b$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,b.value):b.value,b.message,I);break;case"max":b$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,b.value):b.value,b.message,I);break;case"email":switch(I.emailStrategy){case"format:email":M6(U,"email",b.message,I);break;case"format:idn-email":M6(U,"idn-email",b.message,I);break;case"pattern:zod":r$(U,F6.email,b.message,I);break}break;case"url":M6(U,"uri",b.message,I);break;case"uuid":M6(U,"uuid",b.message,I);break;case"regex":r$(U,b.regex,b.message,I);break;case"cuid":r$(U,F6.cuid,b.message,I);break;case"cuid2":r$(U,F6.cuid2,b.message,I);break;case"startsWith":r$(U,RegExp(`^${F8(b.value,I)}`),b.message,I);break;case"endsWith":r$(U,RegExp(`${F8(b.value,I)}$`),b.message,I);break;case"datetime":M6(U,"date-time",b.message,I);break;case"date":M6(U,"date",b.message,I);break;case"time":M6(U,"time",b.message,I);break;case"duration":M6(U,"duration",b.message,I);break;case"length":b$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,b.value):b.value,b.message,I),b$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,b.value):b.value,b.message,I);break;case"includes":{r$(U,RegExp(F8(b.value,I)),b.message,I);break}case"ip":{if(b.version!=="v6")M6(U,"ipv4",b.message,I);if(b.version!=="v4")M6(U,"ipv6",b.message,I);break}case"base64url":r$(U,F6.base64url,b.message,I);break;case"jwt":r$(U,F6.jwt,b.message,I);break;case"cidr":{if(b.version!=="v6")r$(U,F6.ipv4Cidr,b.message,I);if(b.version!=="v4")r$(U,F6.ipv6Cidr,b.message,I);break}case"emoji":r$(U,F6.emoji(),b.message,I);break;case"ulid":{r$(U,F6.ulid,b.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{M6(U,"binary",b.message,I);break}case"contentEncoding:base64":{b$(U,"contentEncoding","base64",b.message,I);break}case"pattern:zod":{r$(U,F6.base64,b.message,I);break}}break}case"nanoid":r$(U,F6.nanoid,b.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((w)=>{})(b)}return U}function F8($,I){return I.patternStrategy==="escape"?oP($):$}var iP=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function oP($){let I="";for(let U=0;U<$.length;U++){if(!iP.has($[U]))I+="\\";I+=$[U]}return I}function M6($,I,U,b){if($.format||$.anyOf?.some((w)=>w.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&b.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:I,...U&&b.errorMessages&&{errorMessage:{format:U}}})}else b$($,"format",I,U,b)}function r$($,I,U,b){if($.pattern||$.allOf?.some((w)=>w.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&b.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:cO(I,b),...U&&b.errorMessages&&{errorMessage:{pattern:U}}})}else b$($,"pattern",cO(I,b),U,b)}function cO($,I){if(!I.applyRegexFlags||!$.flags)return $.source;let U={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},b=U.i?$.source.toLowerCase():$.source,w="",X=!1,D=!1,W=!1;for(let Q=0;Q<b.length;Q++){if(X){w+=b[Q],X=!1;continue}if(U.i){if(D){if(b[Q].match(/[a-z]/)){if(W)w+=b[Q],w+=`${b[Q-2]}-${b[Q]}`.toUpperCase(),W=!1;else if(b[Q+1]==="-"&&b[Q+2]?.match(/[a-z]/))w+=b[Q],W=!0;else w+=`${b[Q]}${b[Q].toUpperCase()}`;continue}}else if(b[Q].match(/[a-z]/)){w+=`[${b[Q]}${b[Q].toUpperCase()}]`;continue}}if(U.m){if(b[Q]==="^"){w+=`(^|(?<=[\r
37
37
  ]))`;continue}else if(b[Q]==="$"){w+=`($|(?=[\r
38
38
  ]))`;continue}}if(U.s&&b[Q]==="."){w+=D?`${b[Q]}\r
39
39
  `:`[${b[Q]}\r
40
- ]`;continue}if(w+=b[Q],b[Q]==="\\")X=!0;else if(D&&b[Q]==="]")D=!1;else if(!D&&b[Q]==="[")D=!0}try{new RegExp(w)}catch{return console.warn(`Could not convert regex pattern at ${I.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return w}function ew($,I){if(I.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(I.target==="openApi3"&&$.keyType?._def.typeName===M.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((b,w)=>({...b,[w]:n($.valueType._def,{...I,currentPath:[...I.currentPath,"properties",w]})??F$(I)}),{}),additionalProperties:I.rejectedAdditionalProperties};let U={type:"object",additionalProperties:n($.valueType._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]})??I.allowedAdditionalProperties};if(I.target==="openApi3")return U;if($.keyType?._def.typeName===M.ZodString&&$.keyType._def.checks?.length){let{type:b,...w}=aw($.keyType._def,I);return{...U,propertyNames:w}}else if($.keyType?._def.typeName===M.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===M.ZodBranded&&$.keyType._def.type._def.typeName===M.ZodString&&$.keyType._def.type._def.checks?.length){let{type:b,...w}=tw($.keyType._def,I);return{...U,propertyNames:w}}return U}function cO($,I){if(I.mapStrategy==="record")return ew($,I);let U=n($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||F$(I),b=n($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||F$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,b],minItems:2,maxItems:2}}}function mO($){let I=$.values,b=Object.keys($.values).filter((X)=>{return typeof I[I[X]]!=="number"}).map((X)=>I[X]),w=Array.from(new Set(b.map((X)=>typeof X)));return{type:w.length===1?w[0]==="string"?"string":"number":["string","number"],enum:b}}function rO($){return $.target==="openAi"?void 0:{not:F$({...$,currentPath:[...$.currentPath,"not"]})}}function nO($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var QU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function oO($,I){if(I.target==="openApi3")return iO($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((b)=>(b._def.typeName in QU)&&(!b._def.checks||!b._def.checks.length))){let b=U.reduce((w,X)=>{let D=QU[X._def.typeName];return D&&!w.includes(D)?[...w,D]:w},[]);return{type:b.length>1?b:b[0]}}else if(U.every((b)=>b._def.typeName==="ZodLiteral"&&!b.description)){let b=U.reduce((w,X)=>{let D=typeof X._def.value;switch(D){case"string":case"number":case"boolean":return[...w,D];case"bigint":return[...w,"integer"];case"object":if(X._def.value===null)return[...w,"null"];case"symbol":case"undefined":case"function":default:return w}},[]);if(b.length===U.length){let w=b.filter((X,D,W)=>W.indexOf(X)===D);return{type:w.length>1?w:w[0],enum:U.reduce((X,D)=>{return X.includes(D._def.value)?X:[...X,D._def.value]},[])}}}else if(U.every((b)=>b._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((b,w)=>[...b,...w._def.values.filter((X)=>!b.includes(X))],[])};return iO($,I)}var iO=($,I)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((b,w)=>n(b._def,{...I,currentPath:[...I.currentPath,"anyOf",`${w}`]})).filter((b)=>!!b&&(!I.strictUnions||typeof b==="object"&&Object.keys(b).length>0));return U.length?{anyOf:U}:void 0};function dO($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:QU[$.innerType._def.typeName],nullable:!0};return{type:[QU[$.innerType._def.typeName],"null"]}}if(I.target==="openApi3"){let b=n($.innerType._def,{...I,currentPath:[...I.currentPath]});if(b&&"$ref"in b)return{allOf:[b],nullable:!0};return b&&{...b,nullable:!0}}let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","0"]});return U&&{anyOf:[U,{type:"null"}]}}function pO($,I){let U={type:"number"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"int":U.type="integer",v8(U,"type",b.message,I);break;case"min":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"minimum",b.value,b.message,I);else b$(U,"exclusiveMinimum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMinimum=!0;b$(U,"minimum",b.value,b.message,I)}break;case"max":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"maximum",b.value,b.message,I);else b$(U,"exclusiveMaximum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMaximum=!0;b$(U,"maximum",b.value,b.message,I)}break;case"multipleOf":b$(U,"multipleOf",b.value,b.message,I);break}return U}function tO($,I){let U=I.target==="openAi",b={type:"object",properties:{}},w=[],X=$.shape();for(let W in X){let Q=X[W];if(Q===void 0||Q._def===void 0)continue;let G=dP(Q);if(G&&U){if(Q._def.typeName==="ZodOptional")Q=Q._def.innerType;if(!Q.isNullable())Q=Q.nullable();G=!1}let N=n(Q._def,{...I,currentPath:[...I.currentPath,"properties",W],propertyPath:[...I.currentPath,"properties",W]});if(N===void 0)continue;if(b.properties[W]=N,!G)w.push(W)}if(w.length)b.required=w;let D=oP($,I);if(D!==void 0)b.additionalProperties=D;return b}function oP($,I){if($.catchall._def.typeName!=="ZodNever")return n($.catchall._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return I.allowedAdditionalProperties;case"strict":return I.rejectedAdditionalProperties;case"strip":return I.removeAdditionalStrategy==="strict"?I.allowedAdditionalProperties:I.rejectedAdditionalProperties}}function dP($){try{return $.isOptional()}catch{return!0}}var aO=($,I)=>{if(I.currentPath.toString()===I.propertyPath?.toString())return n($.innerType._def,I);let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","1"]});return U?{anyOf:[{not:F$(I)},U]}:F$(I)};var eO=($,I)=>{if(I.pipeStrategy==="input")return n($.in._def,I);else if(I.pipeStrategy==="output")return n($.out._def,I);let U=n($.in._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),b=n($.out._def,{...I,currentPath:[...I.currentPath,"allOf",U?"1":"0"]});return{allOf:[U,b].filter((w)=>w!==void 0)}};function sO($,I){return n($.type._def,I)}function $z($,I){let b={type:"array",uniqueItems:!0,items:n($.valueType._def,{...I,currentPath:[...I.currentPath,"items"]})};if($.minSize)b$(b,"minItems",$.minSize.value,$.minSize.message,I);if($.maxSize)b$(b,"maxItems",$.maxSize.value,$.maxSize.message,I);return b}function Iz($,I){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((U,b)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${b}`]})).reduce((U,b)=>b===void 0?U:[...U,b],[]),additionalItems:n($.rest._def,{...I,currentPath:[...I.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((U,b)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${b}`]})).reduce((U,b)=>b===void 0?U:[...U,b],[])}}function Uz($){return{not:F$($)}}function wz($){return F$($)}var bz=($,I)=>{return n($.innerType._def,I)};var Xz=($,I,U)=>{switch(I){case M.ZodString:return aw($,U);case M.ZodNumber:return pO($,U);case M.ZodObject:return tO($,U);case M.ZodBigInt:return ZO($,U);case M.ZodBoolean:return CO();case M.ZodDate:return V8($,U);case M.ZodUndefined:return Uz(U);case M.ZodNull:return nO(U);case M.ZodArray:return _O($,U);case M.ZodUnion:case M.ZodDiscriminatedUnion:return oO($,U);case M.ZodIntersection:return yO($,U);case M.ZodTuple:return Iz($,U);case M.ZodRecord:return ew($,U);case M.ZodLiteral:return uO($,U);case M.ZodEnum:return fO($);case M.ZodNativeEnum:return mO($);case M.ZodNullable:return dO($,U);case M.ZodOptional:return aO($,U);case M.ZodMap:return cO($,U);case M.ZodSet:return $z($,U);case M.ZodLazy:return()=>$.getter()._def;case M.ZodPromise:return sO($,U);case M.ZodNaN:case M.ZodNever:return rO(U);case M.ZodEffects:return hO($,U);case M.ZodAny:return F$(U);case M.ZodUnknown:return wz(U);case M.ZodDefault:return xO($,U);case M.ZodBranded:return tw($,U);case M.ZodReadonly:return bz($,U);case M.ZodCatch:return gO($,U);case M.ZodPipeline:return eO($,U);case M.ZodFunction:case M.ZodVoid:case M.ZodSymbol:return;default:return((b)=>{return})(I)}};function n($,I,U=!1){let b=I.seen.get($);if(I.override){let W=I.override?.($,I,b,U);if(W!==kO)return W}if(b&&!U){let W=pP(b,I);if(W!==void 0)return W}let w={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,w);let X=Xz($,$.typeName,I),D=typeof X==="function"?n(X(),I):X;if(D)tP($,I,D);if(I.postProcess){let W=I.postProcess(D,$,I);return w.jsonSchema=D,W}return w.jsonSchema=D,D}var pP=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:pw(I.currentPath,$.path)};case"none":case"seen":{if($.path.length<I.currentPath.length&&$.path.every((U,b)=>I.currentPath[b]===U))return console.warn(`Recursive reference detected at ${I.currentPath.join("/")}! Defaulting to any`),F$(I);return I.$refStrategy==="seen"?F$(I):void 0}}},tP=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var M8=($,I)=>{let U=TO(I),b=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((Q,[G,N])=>({...Q,[G]:n(N._def,{...U,currentPath:[...U.basePath,U.definitionPath,G]},!0)??F$(U)}),{}):void 0,w=typeof I==="string"?I:I?.nameStrategy==="title"?void 0:I?.name,X=n($._def,w===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,w]},!1)??F$(U),D=typeof I==="object"&&I.name!==void 0&&I.nameStrategy==="title"?I.name:void 0;if(D!==void 0)X.title=D;if(U.flags.hasReferencedOpenAiAnyType){if(!b)b={};if(!b[U.openAiAnyTypeName])b[U.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:U.$refStrategy==="relative"?"1":[...U.basePath,U.definitionPath,U.openAiAnyTypeName].join("/")}}}let W=w===void 0?b?{...X,[U.definitionPath]:b}:X:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,w].join("/"),[U.definitionPath]:{...b,[w]:X}};if(U.target==="jsonSchema7")W.$schema="http://json-schema.org/draft-07/schema#";else if(U.target==="jsonSchema2019-09"||U.target==="openAi")W.$schema="https://json-schema.org/draft/2019-09/schema#";if(U.target==="openAi"&&(("anyOf"in W)||("oneOf"in W)||("allOf"in W)||("type"in W)&&Array.isArray(W.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return W};function aP($){if(!$)return"draft-7";if($==="jsonSchema7"||$==="draft-7")return"draft-7";if($==="jsonSchema2019-09"||$==="draft-2020-12")return"draft-2020-12";return"draft-7"}function j8($,I){if(J6($))return i9($,{target:aP(I?.target),io:I?.pipeStrategy??"input"});return M8($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function E8($){let U=J4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Mw(U);if(typeof b!=="string")throw new Error("Schema method literal must be a string");return b}function S8($,I){let U=B4($,I);if(!U.success)throw U.error;return U.data}var eP=60000;class P8{constructor($){if(this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Tw,(I)=>{this._oncancel(I)}),this.setNotificationHandler(Zw,(I)=>{this._onprogress(I)}),this.setRequestHandler(_w,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(Cw,async(I,U)=>{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new h(c.InvalidParams,"Failed to retrieve task: Task not found");return{...b}}),this.setRequestHandler(xw,async(I,U)=>{let b=async()=>{let w=I.params.taskId;if(this._taskMessageQueue){let D;while(D=await this._taskMessageQueue.dequeue(w,U.sessionId)){if(D.type==="response"||D.type==="error"){let W=D.message,Q=W.id,G=this._requestResolvers.get(Q);if(G)if(this._requestResolvers.delete(Q),D.type==="response")G(W);else{let N=W,B=new h(N.error.code,N.error.message,N.error.data);G(B)}else{let N=D.type==="response"?"Response":"Error";this._onerror(new Error(`${N} handler missing for request ${Q}`))}continue}await this._transport?.send(D.message,{relatedRequestId:U.requestId})}}let X=await this._taskStore.getTask(w,U.sessionId);if(!X)throw new h(c.InvalidParams,`Task not found: ${w}`);if(!A4(X.status))return await this._waitForTaskUpdate(w,U.signal),await b();if(A4(X.status)){let D=await this._taskStore.getTaskResult(w,U.sessionId);return this._clearTaskQueue(w),{...D,_meta:{...D._meta,[H4]:{taskId:w}}}}return await b()};return await b()}),this.setRequestHandler(hw,async(I,U)=>{try{let{tasks:b,nextCursor:w}=await this._taskStore.listTasks(I.params?.cursor,U.sessionId);return{tasks:b,nextCursor:w,_meta:{}}}catch(b){throw new h(c.InvalidParams,`Failed to list tasks: ${b instanceof Error?b.message:String(b)}`)}}),this.setRequestHandler(yw,async(I,U)=>{try{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new h(c.InvalidParams,`Task not found: ${I.params.taskId}`);if(A4(b.status))throw new h(c.InvalidParams,`Cannot cancel task in terminal status: ${b.status}`);await this._taskStore.updateTaskStatus(I.params.taskId,"cancelled","Client cancelled task execution.",U.sessionId),this._clearTaskQueue(I.params.taskId);let w=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!w)throw new h(c.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...w}}catch(b){if(b instanceof h)throw b;throw new h(c.InvalidRequest,`Failed to cancel task: ${b instanceof Error?b.message:String(b)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,I,U,b,w=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(b,I),startTime:Date.now(),timeout:I,maxTotalTimeout:U,resetTimeoutOnProgress:w,onTimeout:b})}_resetTimeout($){let I=this._timeoutInfo.get($);if(!I)return!1;let U=Date.now()-I.startTime;if(I.maxTotalTimeout&&U>=I.maxTotalTimeout)throw this._timeoutInfo.delete($),h.fromError(c.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:I.maxTotalTimeout,totalElapsed:U});return clearTimeout(I.timeoutId),I.timeoutId=setTimeout(I.onTimeout,I.timeout),!0}_cleanupTimeout($){let I=this._timeoutInfo.get($);if(I)clearTimeout(I.timeoutId),this._timeoutInfo.delete($)}async connect($){this._transport=$;let I=this.transport?.onclose;this._transport.onclose=()=>{I?.(),this._onclose()};let U=this.transport?.onerror;this._transport.onerror=(w)=>{U?.(w),this._onerror(w)};let b=this._transport?.onmessage;this._transport.onmessage=(w,X)=>{if(b?.(w,X),$U(w)||OO(w))this._onresponse(w);else if(X8(w))this._onrequest(w,X);else if(AO(w))this._onnotification(w);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(w)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let I=h.fromError(c.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let U of $.values())U(I)}_onerror($){this.onerror?.($)}_onnotification($){let I=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(I===void 0)return;Promise.resolve().then(()=>I($)).catch((U)=>this._onerror(new Error(`Uncaught error in notification handler: ${U}`)))}_onrequest($,I){let U=this._requestHandlers.get($.method)??this.fallbackRequestHandler,b=this._transport,w=$.params?._meta?.[H4]?.taskId;if(U===void 0){let G={jsonrpc:"2.0",id:$.id,error:{code:c.MethodNotFound,message:"Method not found"}};if(w&&this._taskMessageQueue)this._enqueueTaskMessage(w,{type:"error",message:G,timestamp:Date.now()},b?.sessionId).catch((N)=>this._onerror(new Error(`Failed to enqueue error response: ${N}`)));else b?.send(G).catch((N)=>this._onerror(new Error(`Failed to send an error response: ${N}`)));return}let X=new AbortController;this._requestHandlerAbortControllers.set($.id,X);let D=BO($.params)?$.params.task:void 0,W=this._taskStore?this.requestTaskStore($,b?.sessionId):void 0,Q={signal:X.signal,sessionId:b?.sessionId,_meta:$.params?._meta,sendNotification:async(G)=>{let N={relatedRequestId:$.id};if(w)N.relatedTask={taskId:w};await this.notification(G,N)},sendRequest:async(G,N,B)=>{let H={...B,relatedRequestId:$.id};if(w&&!H.relatedTask)H.relatedTask={taskId:w};let J=H.relatedTask?.taskId??w;if(J&&W)await W.updateTaskStatus(J,"input_required");return await this.request(G,N,H)},authInfo:I?.authInfo,requestId:$.id,requestInfo:I?.requestInfo,taskId:w,taskStore:W,taskRequestedTtl:D?.ttl,closeSSEStream:I?.closeSSEStream,closeStandaloneSSEStream:I?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(D)this.assertTaskHandlerCapability($.method)}).then(()=>U($,Q)).then(async(G)=>{if(X.signal.aborted)return;let N={result:G,jsonrpc:"2.0",id:$.id};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"response",message:N,timestamp:Date.now()},b?.sessionId);else await b?.send(N)},async(G)=>{if(X.signal.aborted)return;let N={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(G.code)?G.code:c.InternalError,message:G.message??"Internal error",...G.data!==void 0&&{data:G.data}}};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"error",message:N,timestamp:Date.now()},b?.sessionId);else await b?.send(N)}).catch((G)=>this._onerror(new Error(`Failed to send response: ${G}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:I,...U}=$.params,b=Number(I),w=this._progressHandlers.get(b);if(!w){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let X=this._responseHandlers.get(b),D=this._timeoutInfo.get(b);if(D&&X&&D.resetTimeoutOnProgress)try{this._resetTimeout(b)}catch(W){this._responseHandlers.delete(b),this._progressHandlers.delete(b),this._cleanupTimeout(b),X(W);return}w(U)}_onresponse($){let I=Number($.id),U=this._requestResolvers.get(I);if(U){if(this._requestResolvers.delete(I),$U($))U($);else{let X=new h($.error.code,$.error.message,$.error.data);U(X)}return}let b=this._responseHandlers.get(I);if(b===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(I),this._cleanupTimeout(I);let w=!1;if($U($)&&$.result&&typeof $.result==="object"){let X=$.result;if(X.task&&typeof X.task==="object"){let D=X.task;if(typeof D.taskId==="string")w=!0,this._taskProgressTokens.set(D.taskId,I)}}if(!w)this._progressHandlers.delete(I);if($U($))b($);else{let X=h.fromError($.error.code,$.error.message,$.error.data);b(X)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,I,U){let{task:b}=U??{};if(!b){try{yield{type:"result",result:await this.request($,I,U)}}catch(X){yield{type:"error",error:X instanceof h?X:new h(c.InternalError,String(X))}}return}let w;try{let X=await this.request($,M1,U);if(X.task)w=X.task.taskId,yield{type:"taskCreated",task:X.task};else throw new h(c.InternalError,"Task creation did not return a task");while(!0){let D=await this.getTask({taskId:w},U);if(yield{type:"taskStatus",task:D},A4(D.status)){if(D.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:w},I,U)};else if(D.status==="failed")yield{type:"error",error:new h(c.InternalError,`Task ${w} failed`)};else if(D.status==="cancelled")yield{type:"error",error:new h(c.InternalError,`Task ${w} was cancelled`)};return}if(D.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:w},I,U)};return}let W=D.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((Q)=>setTimeout(Q,W)),U?.signal?.throwIfAborted()}}catch(X){yield{type:"error",error:X instanceof h?X:new h(c.InternalError,String(X))}}}request($,I,U){let{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X,task:D,relatedTask:W}=U??{};return new Promise((Q,G)=>{let N=(q)=>{G(q)};if(!this._transport){N(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),D)this.assertTaskCapability($.method)}catch(q){N(q);return}U?.signal?.throwIfAborted();let B=this._requestMessageId++,H={...$,jsonrpc:"2.0",id:B};if(U?.onprogress)this._progressHandlers.set(B,U.onprogress),H.params={...$.params,_meta:{...$.params?._meta||{},progressToken:B}};if(D)H.params={...H.params,task:D};if(W)H.params={...H.params,_meta:{...H.params?._meta||{},[H4]:W}};let J=(q)=>{this._responseHandlers.delete(B),this._progressHandlers.delete(B),this._cleanupTimeout(B),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:B,reason:String(q)}},{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((P)=>this._onerror(new Error(`Failed to send cancellation: ${P}`)));let k=q instanceof h?q:new h(c.RequestTimeout,String(q));G(k)};this._responseHandlers.set(B,(q)=>{if(U?.signal?.aborted)return;if(q instanceof Error)return G(q);try{let k=B4(I,q.result);if(!k.success)G(k.error);else Q(k.data)}catch(k){G(k)}}),U?.signal?.addEventListener("abort",()=>{J(U?.signal?.reason)});let A=U?.timeout??eP,O=()=>J(h.fromError(c.RequestTimeout,"Request timed out",{timeout:A}));this._setupTimeout(B,A,U?.maxTotalTimeout,O,U?.resetTimeoutOnProgress??!1);let V=W?.taskId;if(V){let q=(k)=>{let P=this._responseHandlers.get(B);if(P)P(k);else this._onerror(new Error(`Response handler missing for side-channeled request ${B}`))};this._requestResolvers.set(B,q),this._enqueueTaskMessage(V,{type:"request",message:H,timestamp:Date.now()}).catch((k)=>{this._cleanupTimeout(B),G(k)})}else this._transport.send(H,{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((q)=>{this._cleanupTimeout(B),G(q)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},gw,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},fw,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},KO,I)}async notification($,I){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let U=I?.relatedTask?.taskId;if(U){let D={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[H4]:I.relatedTask}}};await this._enqueueTaskMessage(U,{type:"notification",message:D,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!I?.relatedRequestId&&!I?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let D={...$,jsonrpc:"2.0"};if(I?.relatedTask)D={...D,params:{...D.params,_meta:{...D.params?._meta||{},[H4]:I.relatedTask}}};this._transport?.send(D,I).catch((W)=>this._onerror(W))});return}let X={...$,jsonrpc:"2.0"};if(I?.relatedTask)X={...X,params:{...X.params,_meta:{...X.params?._meta||{},[H4]:I.relatedTask}}};await this._transport.send(X,I)}setRequestHandler($,I){let U=E8($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(b,w)=>{let X=S8($,b);return Promise.resolve(I(X,w))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw new Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,I){let U=E8($);this._notificationHandlers.set(U,(b)=>{let w=S8($,b);return Promise.resolve(I(w))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let I=this._taskProgressTokens.get($);if(I!==void 0)this._progressHandlers.delete(I),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,I,U){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let b=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,I,U,b)}async _clearTaskQueue($,I){if(this._taskMessageQueue){let U=await this._taskMessageQueue.dequeueAll($,I);for(let b of U)if(b.type==="request"&&X8(b.message)){let w=b.message.id,X=this._requestResolvers.get(w);if(X)X(new h(c.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(w);else this._onerror(new Error(`Resolver missing for request ${w} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,I){let U=this._options?.defaultTaskPollInterval??1000;try{let b=await this._taskStore?.getTask($);if(b?.pollInterval)U=b.pollInterval}catch{}return new Promise((b,w)=>{if(I.aborted){w(new h(c.InvalidRequest,"Request cancelled"));return}let X=setTimeout(b,U);I.addEventListener("abort",()=>{clearTimeout(X),w(new h(c.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,I){let U=this._taskStore;if(!U)throw new Error("No task store configured");return{createTask:async(b)=>{if(!$)throw new Error("No request provided");return await U.createTask(b,$.id,{method:$.method,params:$.params},I)},getTask:async(b)=>{let w=await U.getTask(b,I);if(!w)throw new h(c.InvalidParams,"Failed to retrieve task: Task not found");return w},storeTaskResult:async(b,w,X)=>{await U.storeTaskResult(b,w,X,I);let D=await U.getTask(b,I);if(D){let W=XU.parse({method:"notifications/tasks/status",params:D});if(await this.notification(W),A4(D.status))this._cleanupTaskProgressHandler(b)}},getTaskResult:(b)=>{return U.getTaskResult(b,I)},updateTaskStatus:async(b,w,X)=>{let D=await U.getTask(b,I);if(!D)throw new h(c.InvalidParams,`Task "${b}" not found - it may have been cleaned up`);if(A4(D.status))throw new h(c.InvalidParams,`Cannot update task "${b}" from terminal status "${D.status}" to "${w}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await U.updateTaskStatus(b,w,X,I);let W=await U.getTask(b,I);if(W){let Q=XU.parse({method:"notifications/tasks/status",params:W});if(await this.notification(Q),A4(W.status))this._cleanupTaskProgressHandler(b)}},listTasks:(b)=>{return U.listTasks(b,I)}}}}function Dz($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function Wz($,I){let U={...$};for(let b in I){let w=b,X=I[w];if(X===void 0)continue;let D=U[w];if(Dz(D)&&Dz(X))U[w]={...D,...X};else U[w]=X}return U}var fv=zH(qQ(),1),yv=zH(hv(),1);function Wx(){let $=new fv.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return yv.default($),$}class _Q{constructor($){this._ajv=$??Wx()}getValidator($){let I="$id"in $&&typeof $.$id==="string"?this._ajv.getSchema($.$id)??this._ajv.compile($):this._ajv.compile($);return(U)=>{if(I(U))return{valid:!0,data:U,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(I.errors)}}}}class ZQ{constructor($){this._server=$}requestStream($,I,U){return this._server.requestStream($,I,U)}async getTask($,I){return this._server.getTask({taskId:$},I)}async getTaskResult($,I,U){return this._server.getTaskResult({taskId:$},I,U)}async listTasks($,I){return this._server.listTasks($?{cursor:$}:void 0,I)}async cancelTask($,I){return this._server.cancelTask({taskId:$},I)}}function uv($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"tools/call":if(!$.tools?.call)throw new Error(`${U} does not support task creation for tools/call (required for ${I})`);break;default:break}}function lv($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"sampling/createMessage":if(!$.sampling?.createMessage)throw new Error(`${U} does not support task creation for sampling/createMessage (required for ${I})`);break;case"elicitation/create":if(!$.elicitation?.create)throw new Error(`${U} does not support task creation for elicitation/create (required for ${I})`);break;default:break}}class CQ extends P8{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(WU.options.map((U,b)=>[U,b])),this.isMessageIgnored=(U,b)=>{let w=this._loggingLevels.get(b);return w?this.LOG_LEVEL_SEVERITY.get(U)<this.LOG_LEVEL_SEVERITY.get(w):!1},this._capabilities=I?.capabilities??{},this._instructions=I?.instructions,this._jsonSchemaValidator=I?.jsonSchemaValidator??new _Q,this.setRequestHandler(Q8,(U)=>this._oninitialize(U)),this.setNotificationHandler(G8,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(O8,async(U,b)=>{let w=b.sessionId||b.requestInfo?.headers["mcp-session-id"]||void 0,{level:X}=U.params,D=WU.safeParse(X);if(D.success)this._loggingLevels.set(w,D.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new ZQ(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Wz(this._capabilities,$)}setRequestHandler($,I){let b=J4($)?.method;if(!b)throw new Error("Schema is missing a method literal");let w;if(J6(b)){let D=b;w=D._zod?.def?.value??D.value}else{let D=b;w=D._def?.value??D.value}if(typeof w!=="string")throw new Error("Schema method literal must be a string");if(w==="tools/call"){let D=async(W,Q)=>{let G=B4(E1,W);if(!G.success){let J=G.error instanceof Error?G.error.message:String(G.error);throw new h(c.InvalidParams,`Invalid tools/call request: ${J}`)}let{params:N}=G.data,B=await Promise.resolve(I(W,Q));if(N.task){let J=B4(M1,B);if(!J.success){let A=J.error instanceof Error?J.error.message:String(J.error);throw new h(c.InvalidParams,`Invalid task creation result: ${A}`)}return J.data}let H=B4(iw,B);if(!H.success){let J=H.error instanceof Error?H.error.message:String(H.error);throw new h(c.InvalidParams,`Invalid tools/call result: ${J}`)}return H.data};return super.setRequestHandler($,D)}return super.setRequestHandler($,I)}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){if(!this._capabilities)return;switch($){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${$})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${$})`);break;case"ping":case"initialize":break}}assertTaskCapability($){lv(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;uv(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:GO.includes(I)?I:w8,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Rw)}async createMessage($,I){if($.tools||$.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.")}if($.messages.length>0){let U=$.messages[$.messages.length-1],b=Array.isArray(U.content)?U.content:[U.content],w=b.some((Q)=>Q.type==="tool_result"),X=$.messages.length>1?$.messages[$.messages.length-2]:void 0,D=X?Array.isArray(X.content)?X.content:[X.content]:[],W=D.some((Q)=>Q.type==="tool_use");if(w){if(b.some((Q)=>Q.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!W)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(W){let Q=new Set(D.filter((N)=>N.type==="tool_use").map((N)=>N.id)),G=new Set(b.filter((N)=>N.type==="tool_result").map((N)=>N.toolUseId));if(Q.size!==G.size||![...Q].every((N)=>G.has(N)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if($.tools)return this.request({method:"sampling/createMessage",params:$},L8,I);return this.request({method:"sampling/createMessage",params:$},z8,I)}async elicitInput($,I){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let b=$;return this.request({method:"elicitation/create",params:b},ow,I)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let b=$.mode==="form"?$:{...$,mode:"form"},w=await this.request({method:"elicitation/create",params:b},ow,I);if(w.action==="accept"&&w.content&&b.requestedSchema)try{let D=this._jsonSchemaValidator.getValidator(b.requestedSchema)(w.content);if(!D.valid)throw new h(c.InvalidParams,`Elicitation response content does not match requested schema: ${D.errorMessage}`)}catch(X){if(X instanceof h)throw X;throw new h(c.InternalError,`Error validating elicitation response: ${X instanceof Error?X.message:String(X)}`)}return w}}}createElicitationCompletionNotifier($,I){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},I)}async listRoots($,I){return this.request({method:"roots/list",params:$},K8,I)}async sendLoggingMessage($,I){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,I))return this.notification({method:"notifications/message",params:$})}}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var mv=Symbol.for("mcp.completable");function gQ($){return!!$&&typeof $==="object"&&mv in $}function rv($){return $[mv]?.complete}var cv;(function($){$.Completable="McpCompletable"})(cv||(cv={}));var Qx=/^[A-Za-z0-9._-]{1,128}$/;function Gx($){let I=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))I.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))I.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))I.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))I.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Qx.test($)){let U=$.split("").filter((b)=>!/[A-Za-z0-9._-]/.test(b)).filter((b,w,X)=>X.indexOf(b)===w);return I.push(`Tool name contains invalid characters: ${U.map((b)=>`"${b}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:I}}return{isValid:!0,warnings:I}}function Nx($,I){if(I.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let U of I)console.warn(` - ${U}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function xQ($){let I=Gx($);return Nx($,I.warnings),I.isValid}class hQ{constructor($){this._mcpServer=$}registerToolTask($,I,U){let b={taskSupport:"required",...I.execution};if(b.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${$}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool($,I.title,I.description,I.inputSchema,I.outputSchema,I.annotations,b,I._meta,U)}}class yQ{constructor($,I){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new CQ($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new hQ(this)};return this._experimental}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(nw)),this.server.assertCanSetRequestHandler(F4(E1)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(nw,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let b=q1(I.inputSchema);return b?j8(b,{strictUnions:!0,pipeStrategy:"input"}):Yx})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let b=q1(I.outputSchema);if(b)U.outputSchema=j8(b,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(E1,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new h(c.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Tool ${$.params.name} disabled`);let b=!!$.params.task,w=U.execution?.taskSupport,X="createTask"in U.handler;if((w==="required"||w==="optional")&&!X)throw new h(c.InternalError,`Tool ${$.params.name} has taskSupport '${w}' but was not registered with registerToolTask`);if(w==="required"&&!b)throw new h(c.MethodNotFound,`Tool ${$.params.name} requires task augmentation (taskSupport: 'required')`);if(w==="optional"&&!b&&X)return await this.handleAutomaticTaskPolling(U,$,I);let D=await this.validateToolInput(U,$.params.arguments,$.params.name),W=await this.executeToolHandler(U,D,I);if(b)return W;return await this.validateToolOutput(U,W,$.params.name),W}catch(U){if(U instanceof h){if(U.code===c.UrlElicitationRequired)throw U}return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,I,U){if(!$.inputSchema)return;let w=q1($.inputSchema)??$.inputSchema,X=await qw(w,I);if(!X.success){let D="error"in X?X.error:"Unknown error",W=Fw(D);throw new h(c.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${W}`)}return X.data}async validateToolOutput($,I,U){if(!$.outputSchema)return;if(!("content"in I))return;if(I.isError)return;if(!I.structuredContent)throw new h(c.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let b=q1($.outputSchema),w=await qw(b,I.structuredContent);if(!w.success){let X="error"in w?w.error:"Unknown error",D=Fw(X);throw new h(c.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${D}`)}}async executeToolHandler($,I,U){let b=$.handler;if("createTask"in b){if(!U.taskStore)throw new Error("No task store provided.");let X={...U,taskStore:U.taskStore};if($.inputSchema){let D=b;return await Promise.resolve(D.createTask(I,X))}else{let D=b;return await Promise.resolve(D.createTask(X))}}if($.inputSchema){let X=b;return await Promise.resolve(X(I,U))}else{let X=b;return await Promise.resolve(X(U))}}async handleAutomaticTaskPolling($,I,U){if(!U.taskStore)throw new Error("No task store provided for task-capable tool.");let b=await this.validateToolInput($,I.params.arguments,I.params.name),w=$.handler,X={...U,taskStore:U.taskStore},D=b?await Promise.resolve(w.createTask(b,X)):await Promise.resolve(w.createTask(X)),W=D.task.taskId,Q=D.task,G=Q.pollInterval??5000;while(Q.status!=="completed"&&Q.status!=="failed"&&Q.status!=="cancelled"){await new Promise((B)=>setTimeout(B,G));let N=await U.taskStore.getTask(W);if(!N)throw new h(c.InternalError,`Task ${W} not found during polling`);Q=N}return await U.taskStore.getTaskResult(W)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(F4(dw)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(dw,async($)=>{switch($.params.ref.type){case"ref/prompt":return jO($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return EO($),this.handleResourceCompletion($,$.params.ref);default:throw new h(c.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new h(c.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return _U;let w=J4(U.argsSchema)?.[$.params.argument.name];if(!gQ(w))return _U;let X=rv(w);if(!X)return _U;let D=await X($.params.argument.value,$.params.context);return iv(D)}async handleResourceCompletion($,I){let U=Object.values(this._registeredResourceTemplates).find((X)=>X.resourceTemplate.uriTemplate.toString()===I.uri);if(!U){if(this._registeredResources[I.uri])return _U;throw new h(c.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let b=U.resourceTemplate.completeCallback($.params.argument.name);if(!b)return _U;let w=await b($.params.argument.value,$.params.context);return iv(w)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(uw)),this.server.assertCanSetRequestHandler(F4(lw)),this.server.assertCanSetRequestHandler(F4(cw)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(uw,async($,I)=>{let U=Object.entries(this._registeredResources).filter(([w,X])=>X.enabled).map(([w,X])=>({uri:w,name:X.name,...X.metadata})),b=[];for(let w of Object.values(this._registeredResourceTemplates)){if(!w.resourceTemplate.listCallback)continue;let X=await w.resourceTemplate.listCallback(I);for(let D of X.resources)b.push({...w.metadata,...D})}return{resources:[...U,...b]}}),this.server.setRequestHandler(lw,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(cw,async($,I)=>{let U=new URL($.params.uri),b=this._registeredResources[U.toString()];if(b){if(!b.enabled)throw new h(c.InvalidParams,`Resource ${U} disabled`);return b.readCallback(U,I)}for(let w of Object.values(this._registeredResourceTemplates)){let X=w.resourceTemplate.uriTemplate.match(U.toString());if(X)return w.readCallback(U,X,I)}throw new h(c.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(mw)),this.server.assertCanSetRequestHandler(F4(rw)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(mw,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?Jx(I.argsSchema):void 0}})})),this.server.setRequestHandler(rw,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new h(c.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let b=q1(U.argsSchema),w=await qw(b,$.params.arguments);if(!w.success){let W="error"in w?w.error:"Unknown error",Q=Fw(W);throw new h(c.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${Q}`)}let X=w.data,D=U.callback;return await Promise.resolve(D(X,I))}else{let b=U.callback;return await Promise.resolve(b(I))}}),this._promptHandlersInitialized=!0}resource($,I,...U){let b;if(typeof U[0]==="object")b=U.shift();let w=U[0];if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let X=this._createRegisteredResource($,void 0,I,b,w);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let X=this._createRegisteredResourceTemplate($,void 0,I,b,w);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}}registerResource($,I,U,b){if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let w=this._createRegisteredResource($,U.title,I,U,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let w=this._createRegisteredResourceTemplate($,U.title,I,U,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}}_createRegisteredResource($,I,U,b,w){let X={name:$,title:I,metadata:b,readCallback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({uri:null}),update:(D)=>{if(typeof D.uri!=="undefined"&&D.uri!==U){if(delete this._registeredResources[U],D.uri)this._registeredResources[D.uri]=X}if(typeof D.name!=="undefined")X.name=D.name;if(typeof D.title!=="undefined")X.title=D.title;if(typeof D.metadata!=="undefined")X.metadata=D.metadata;if(typeof D.callback!=="undefined")X.readCallback=D.callback;if(typeof D.enabled!=="undefined")X.enabled=D.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=X,X}_createRegisteredResourceTemplate($,I,U,b,w){let X={resourceTemplate:U,title:I,metadata:b,readCallback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Q)=>{if(typeof Q.name!=="undefined"&&Q.name!==$){if(delete this._registeredResourceTemplates[$],Q.name)this._registeredResourceTemplates[Q.name]=X}if(typeof Q.title!=="undefined")X.title=Q.title;if(typeof Q.template!=="undefined")X.resourceTemplate=Q.template;if(typeof Q.metadata!=="undefined")X.metadata=Q.metadata;if(typeof Q.callback!=="undefined")X.readCallback=Q.callback;if(typeof Q.enabled!=="undefined")X.enabled=Q.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=X;let D=U.uriTemplate.variableNames;if(Array.isArray(D)&&D.some((Q)=>!!U.completeCallback(Q)))this.setCompletionRequestHandler();return X}_createRegisteredPrompt($,I,U,b,w){let X={title:I,description:U,argsSchema:b===void 0?void 0:o4(b),callback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(D)=>{if(typeof D.name!=="undefined"&&D.name!==$){if(delete this._registeredPrompts[$],D.name)this._registeredPrompts[D.name]=X}if(typeof D.title!=="undefined")X.title=D.title;if(typeof D.description!=="undefined")X.description=D.description;if(typeof D.argsSchema!=="undefined")X.argsSchema=o4(D.argsSchema);if(typeof D.callback!=="undefined")X.callback=D.callback;if(typeof D.enabled!=="undefined")X.enabled=D.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=X,b){if(Object.values(b).some((W)=>{let Q=W instanceof B6?W._def?.innerType:W;return gQ(Q)}))this.setCompletionRequestHandler()}return X}_createRegisteredTool($,I,U,b,w,X,D,W,Q){xQ($);let G={title:I,description:U,inputSchema:nv(b),outputSchema:nv(w),annotations:X,execution:D,_meta:W,handler:Q,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({name:null}),update:(N)=>{if(typeof N.name!=="undefined"&&N.name!==$){if(typeof N.name==="string")xQ(N.name);if(delete this._registeredTools[$],N.name)this._registeredTools[N.name]=G}if(typeof N.title!=="undefined")G.title=N.title;if(typeof N.description!=="undefined")G.description=N.description;if(typeof N.paramsSchema!=="undefined")G.inputSchema=o4(N.paramsSchema);if(typeof N.outputSchema!=="undefined")G.outputSchema=o4(N.outputSchema);if(typeof N.callback!=="undefined")G.handler=N.callback;if(typeof N.annotations!=="undefined")G.annotations=N.annotations;if(typeof N._meta!=="undefined")G._meta=N._meta;if(typeof N.enabled!=="undefined")G.enabled=N.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=G,this.setToolRequestHandlers(),this.sendToolListChanged(),G}tool($,...I){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let U,b,w,X;if(typeof I[0]==="string")U=I.shift();if(I.length>1){let W=I[0];if(fQ(W)){if(b=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!fQ(I[0]))X=I.shift()}else if(typeof W==="object"&&W!==null)X=I.shift()}let D=I[0];return this._createRegisteredTool($,void 0,U,b,w,X,{taskSupport:"forbidden"},void 0,D)}registerTool($,I,U){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let{title:b,description:w,inputSchema:X,outputSchema:D,annotations:W,_meta:Q}=I;return this._createRegisteredTool($,b,w,X,D,W,{taskSupport:"forbidden"},Q,U)}prompt($,...I){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let U;if(typeof I[0]==="string")U=I.shift();let b;if(I.length>1)b=I.shift();let w=I[0],X=this._createRegisteredPrompt($,void 0,U,b,w);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),X}registerPrompt($,I,U){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let{title:b,description:w,argsSchema:X}=I,D=this._createRegisteredPrompt($,b,w,X,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),D}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,I){return this.server.sendLoggingMessage($,I)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var Yx={type:"object",properties:{}};function ov($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Bx($){return"_def"in $||"_zod"in $||ov($)}function fQ($){if(typeof $!=="object"||$===null)return!1;if(Bx($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(ov)}function nv($){if(!$)return;if(fQ($))return o4($);return $}function Jx($){let I=J4($);if(!I)return[];return Object.entries(I).map(([U,b])=>{let w=uA(b),X=lA(b);return{name:U,description:w,required:!X}})}function F4($){let U=J4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Mw(U);if(typeof b==="string")return b;throw new Error("Schema method literal must be a string")}function iv($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var _U={completion:{values:[],hasMore:!1}};import pv from"node:process";class uQ{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
41
- `);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),Hx(I)}clear(){this._buffer=void 0}}function Hx($){return zO.parse(JSON.parse($))}function dv($){return JSON.stringify($)+`
42
- `}class lQ{constructor($=pv.stdin,I=pv.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new uQ,this._started=!1,this._ondata=(U)=>{this._readBuffer.append(U),this.processReadBuffer()},this._onerror=(U)=>{this.onerror?.(U)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let U=dv($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:Ax,defineProperty:tv,getOwnPropertyDescriptor:Ox,getOwnPropertyNames:av,getPrototypeOf:zx}=Object,Lx=Object.prototype.hasOwnProperty,T6=($,I)=>function(){return I||$[av($)[0]]((I={exports:{}}).exports,I),I.exports},Kx=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=av(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!Lx.call($,W)&&W!==U)tv($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=Ox(I,W))||b.enumerable})}return $},Y$=($,I,U)=>(U=$!=null?Ax(zx($)):{},Kx(I||!$||!$.__esModule?tv(U,"default",{value:$,enumerable:!0}):U,$)),ev=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(b){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},I.exports.__esModule=!0,I.exports.default=I.exports,U(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),vx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=ev().default;function b(w,X){if(U(w)!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var W=D.call(w,X||"default");if(U(W)!="object")return W;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(w)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Vx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=ev().default,b=vx();function w(X){var D=b(X,"string");return U(D)=="symbol"?D:D+""}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),u6=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=Vx();function b(w,X,D){return(X=U(X))in w?Object.defineProperty(w,X,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[X]=D,w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),_$=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=u6();function b(X,D){var W=Object.keys(X);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(X);D&&(Q=Q.filter(function(G){return Object.getOwnPropertyDescriptor(X,G).enumerable})),W.push.apply(W,Q)}return W}function w(X){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?b(Object(W),!0).forEach(function(Q){U(X,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(W)):b(Object(W)).forEach(function(Q){Object.defineProperty(X,Q,Object.getOwnPropertyDescriptor(W,Q))})}return X}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}});function l6($){let I={subscribe(U){let b=null,w=!1,X=!1,D=!1;function W(){if(b===null){D=!0;return}if(X)return;if(X=!0,typeof b==="function")b();else if(b)b.unsubscribe()}if(b=$({next(Q){var G;if(w)return;(G=U.next)===null||G===void 0||G.call(U,Q)},error(Q){var G;if(w)return;w=!0,(G=U.error)===null||G===void 0||G.call(U,Q),W()},complete(){var Q;if(w)return;w=!0,(Q=U.complete)===null||Q===void 0||Q.call(U),W()}}),D)W();return{unsubscribe:W}},pipe(...U){return U.reduce(qx,I)}};return I}function qx($,I){return I($)}function cQ($){let I=new AbortController;return new Promise((b,w)=>{let X=!1;function D(){if(X)return;X=!0,W.unsubscribe()}I.signal.addEventListener("abort",()=>{w(I.signal.reason)});let W=$.subscribe({next(Q){X=!0,b(Q),D()},error(Q){w(Q)},complete(){I.abort(),D()}})})}function mQ($){return(I)=>{let U=0,b=null,w=[];function X(){if(b)return;b=I.subscribe({next(W){for(let G of w){var Q;(Q=G.next)===null||Q===void 0||Q.call(G,W)}},error(W){for(let G of w){var Q;(Q=G.error)===null||Q===void 0||Q.call(G,W)}},complete(){for(let Q of w){var W;(W=Q.complete)===null||W===void 0||W.call(Q)}}})}function D(){if(U===0&&b){let W=b;b=null,W.unsubscribe()}}return l6((W)=>{return U++,w.push(W),X(),{unsubscribe(){U--,D();let Q=w.findIndex((G)=>G===W);if(Q>-1)w.splice(Q,1)}}})}}var Pd=Symbol();function hb($){let I=$,U=[],b=(D)=>{if(I!==void 0)D.next(I);U.push(D)},w=(D)=>{U.splice(U.indexOf(D),1)},X=l6((D)=>{return b(D),()=>{w(D)}});return X.next=(D)=>{if(I===D)return;I=D;for(let W of U)W.next(D)},X.get=()=>I,X}function sv($){return l6((I)=>{function U(w=0,X=$.op){let D=$.links[w];if(!D)throw new Error("No more links to execute - did you forget to add an ending link?");return D({op:X,next(Q){return U(w+1,Q)}})}return U().subscribe(I)})}var ZU={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};var $V=[ZU.BAD_GATEWAY,ZU.SERVICE_UNAVAILABLE,ZU.GATEWAY_TIMEOUT,ZU.INTERNAL_SERVER_ERROR];function M4($){return!!$&&!Array.isArray($)&&typeof $==="object"}var{create:Fx,defineProperty:UV,getOwnPropertyDescriptor:Mx,getOwnPropertyNames:wV,getPrototypeOf:jx}=Object,Ex=Object.prototype.hasOwnProperty,CU=($,I)=>function(){return I||$[wV($)[0]]((I={exports:{}}).exports,I),I.exports},Sx=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=wV(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!Ex.call($,W)&&W!==U)UV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=Mx(I,W))||b.enumerable})}return $},gU=($,I,U)=>(U=$!=null?Fx(jx($)):{},Sx(I||!$||!$.__esModule?UV(U,"default",{value:$,enumerable:!0}):U,$)),bV=()=>{},IV=($)=>{if(Object.freeze)Object.freeze($)};function XV($,I,U){var b;let w=I.join(".");return(b=U[w])!==null&&b!==void 0||(U[w]=new Proxy(bV,{get(X,D){if(typeof D!=="string"||D==="then")return;return XV($,[...I,D],U)},apply(X,D,W){let Q=I[I.length-1],G={args:W,path:I};if(Q==="call")G={args:W.length>=2?[W[1]]:[],path:I.slice(0,-1)};else if(Q==="apply")G={args:W.length>=2?W[1]:[],path:I.slice(0,-1)};return IV(G.args),IV(G.path),$(G)}})),U[w]}var fb=($)=>XV($,[],Object.create(null)),rQ=($)=>{return new Proxy(bV,{get(I,U){if(U==="then")return;return $(U)}})};var DV=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(b){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},I.exports.__esModule=!0,I.exports.default=I.exports,U(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),Px=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=DV().default;function b(w,X){if(U(w)!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var W=D.call(w,X||"default");if(U(W)!="object")return W;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(w)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),kx=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=DV().default,b=Px();function w(X){var D=b(X,"string");return U(D)=="symbol"?D:D+""}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),nQ=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=kx();function b(w,X,D){return(X=U(X))in w?Object.defineProperty(w,X,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[X]=D,w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),yb=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=nQ();function b(X,D){var W=Object.keys(X);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(X);D&&(Q=Q.filter(function(G){return Object.getOwnPropertyDescriptor(X,G).enumerable})),W.push.apply(W,Q)}return W}function w(X){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?b(Object(W),!0).forEach(function(Q){U(X,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(W)):b(Object(W)).forEach(function(Q){Object.defineProperty(X,Q,Object.getOwnPropertyDescriptor(W,Q))})}return X}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),cd=gU(yb(),1);var id=gU(nQ(),1);var ub=gU(yb(),1);function Zx($,I){if("error"in $){let b=I.deserialize($.error);return{ok:!1,error:ub.default(ub.default({},$),{},{error:b})}}return{ok:!0,result:ub.default(ub.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var iQ=class extends Error{constructor(){super("Unable to transform response from server")}};function oQ($,I){let U;try{U=Zx($,I)}catch(b){throw new iQ}if(!U.ok&&(!M4(U.error.error)||typeof U.error.error.code!=="number"))throw new iQ;if(U.ok&&!M4(U.result))throw new iQ;return U}var od=gU(yb(),1);var dd=Symbol();var lb=Y$(u6(),1),f1=Y$(_$(),1);function WV($){return $ instanceof j4}function hx($){return M4($)&&M4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function fx($,I){if(typeof $==="string")return $;if(M4($)&&typeof $.message==="string")return $.message;return I}var j4=class $ extends Error{constructor(I,U){var b,w;let X=U===null||U===void 0?void 0:U.cause;super(I,{cause:X});lb.default(this,"cause",void 0),lb.default(this,"shape",void 0),lb.default(this,"data",void 0),lb.default(this,"meta",void 0),this.meta=U===null||U===void 0?void 0:U.meta,this.cause=X,this.shape=U===null||U===void 0||(b=U.result)===null||b===void 0?void 0:b.error,this.data=U===null||U===void 0||(w=U.result)===null||w===void 0?void 0:w.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(I,U={}){let b=I;if(WV(b)){if(U.meta)b.meta=f1.default(f1.default({},b.meta),U.meta);return b}if(hx(b))return new $(b.error.message,f1.default(f1.default({},U),{},{result:b}));return new $(fx(b,"Unknown error"),f1.default(f1.default({},U),{},{cause:b}))}};function cb($){let I=$;if(!I)return{input:{serialize:(U)=>U,deserialize:(U)=>U},output:{serialize:(U)=>U,deserialize:(U)=>U}};if("input"in I)return I;return{input:I,output:I}}var QV=($)=>typeof $==="function";function GV($){if($)return $;if(typeof window!=="undefined"&&QV(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&QV(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var xU=Y$(_$(),1);function mb($){return{url:$.url.toString(),fetch:$.fetch,transformer:cb($.transformer),methodOverride:$.methodOverride}}function yx($){let I={};for(let U=0;U<$.length;U++){let b=$[U];I[U]=b}return I}var ux={query:"GET",mutation:"POST",subscription:"PATCH"};function NV($){return"input"in $?$.transformer.input.serialize($.input):yx($.inputs.map((I)=>$.transformer.input.serialize(I)))}var y1=($)=>{let I=$.url.split("?"),b=I[0].replace(/\/$/,"")+"/"+$.path,w=[];if(I[1])w.push(I[1]);if("inputs"in $)w.push("batch=1");if($.type==="query"||$.type==="subscription"){let X=NV($);if(X!==void 0&&$.methodOverride!=="POST")w.push(`input=${encodeURIComponent(JSON.stringify(X))}`)}if(w.length)b+="?"+w.join("&");return b},YV=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=NV($);return I!==void 0?JSON.stringify(I):void 0},dQ=($)=>{return rb(xU.default(xU.default({},$),{},{contentTypeHeader:"application/json",getUrl:y1,getBody:YV}))},lx=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},cx=($)=>{var I;if(!($===null||$===void 0?void 0:$.aborted))return;if((I=$.throwIfAborted)===null||I===void 0||I.call($),typeof DOMException!=="undefined")throw new DOMException("AbortError","AbortError");throw new lx};async function BV($){var I;cx($.signal);let U=$.getUrl($),b=$.getBody($),w=(I=$.methodOverride)!==null&&I!==void 0?I:ux[$.type],X=await(async()=>{let W=await $.headers();if(Symbol.iterator in W)return Object.fromEntries(W);return W})(),D=xU.default(xU.default(xU.default({},$.contentTypeHeader&&w!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{"trpc-accept":$.trpcAcceptHeader}:void 0),X);return GV($.fetch)(U,{method:w,signal:$.signal,body:b,headers:D})}async function rb($){let I={},U=await BV($);I.response=U;let b=await U.json();return I.responseJSON=b,{json:b,meta:I}}function JV($){return $ instanceof Uint8Array||$ instanceof Blob}function HV($){return $ instanceof FormData}var u1=Y$(_$(),1),mx=($)=>{if("input"in $){let{input:I}=$;if(HV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return rb(u1.default(u1.default({},$),{},{contentTypeHeader:void 0,getUrl:y1,getBody:()=>I}))}if(JV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return rb(u1.default(u1.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:y1,getBody:()=>I}))}}return dQ($)};function pQ($){let I=mb($);return()=>{return(U)=>{let{op:b}=U;return l6((w)=>{let{path:X,input:D,type:W}=b;if(W==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let Q=mx(u1.default(u1.default({},I),{},{type:W,path:X,input:D,signal:b.signal,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({op:b});return $.headers}})),G=void 0;return Q.then((N)=>{G=N.meta;let B=oQ(N.json,I.transformer.output);if(!B.ok){w.error(j4.from(B.error,{meta:G}));return}w.next({context:N.meta,result:B.result}),w.complete()}).catch((N)=>{w.error(j4.from(N,{meta:G}))}),()=>{}})}}}var ip=Y$(_$(),1);var pp=Y$(_$(),1);var tQ=($,...I)=>{return typeof $==="function"?$(...I):$},It=Y$(u6(),1);function rx(){let $,I;return{promise:new Promise((b,w)=>{$=b,I=w}),resolve:$,reject:I}}async function nx($){let I=await tQ($.url);if(!$.connectionParams)return I;let b=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+b}async function ix($){let I={method:"connectionParams",data:await tQ($)};return JSON.stringify(I)}var Ut=Y$(u6(),1);var $1=Y$(u6(),1);function ox($){let{promise:I,resolve:U,reject:b}=rx();return $.addEventListener("open",()=>{$.removeEventListener("error",b),U()}),$.addEventListener("error",b),I}function dx($,{intervalMs:I,pongTimeoutMs:U}){let b,w;function X(){b=setTimeout(()=>{$.send("PING"),w=setTimeout(()=>{$.close()},U)},I)}function D(){clearTimeout(b),X()}function W(){clearTimeout(w),D()}$.addEventListener("open",X),$.addEventListener("message",({data:Q})=>{if(clearTimeout(b),X(),Q==="PONG")W()}),$.addEventListener("close",()=>{clearTimeout(b),clearTimeout(w)})}var px=class ${constructor(I){var U;if($1.default(this,"id",++$.connectCount),$1.default(this,"WebSocketPonyfill",void 0),$1.default(this,"urlOptions",void 0),$1.default(this,"keepAliveOpts",void 0),$1.default(this,"wsObservable",hb(null)),$1.default(this,"openPromise",null),this.WebSocketPonyfill=(U=I.WebSocketPonyfill)!==null&&U!==void 0?U:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=I.urlOptions,this.keepAliveOpts=I.keepAlive}get ws(){return this.wsObservable.get()}set ws(I){this.wsObservable.next(I)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var I=this;if(I.openPromise)return I.openPromise;I.id=++$.connectCount;let U=nx(I.urlOptions).then((b)=>new I.WebSocketPonyfill(b));I.openPromise=U.then(async(b)=>{if(I.ws=b,b.addEventListener("message",function({data:w}){if(w==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)dx(b,I.keepAliveOpts);if(b.addEventListener("close",()=>{if(I.ws===b)I.ws=null}),await ox(b),I.urlOptions.connectionParams)b.send(await ix(I.urlOptions.connectionParams))});try{await I.openPromise}finally{I.openPromise=null}}async close(){var I=this;try{await I.openPromise}finally{var U;(U=I.ws)===null||U===void 0||U.close()}}};$1.default(px,"connectCount",0);var wt=Y$(u6(),1),bt=Y$(_$(),1);var aQ=Y$(u6(),1),AV=Y$(_$(),1),tx=class{constructor($){aQ.default(this,"links",void 0),aQ.default(this,"runtime",void 0),aQ.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return sv({links:this.links,op:AV.default(AV.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(mQ())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await cQ(U)).result.data}catch(U){throw j4.from(U)}}query($,I,U){return this.requestAsPromise({type:"query",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}mutation($,I,U){return this.requestAsPromise({type:"mutation",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}subscription($,I,U){return this.$request({type:"subscription",path:$,input:I,context:U.context,signal:U.signal}).subscribe({next(w){switch(w.result.type){case"state":{var X;(X=U.onConnectionStateChange)===null||X===void 0||X.call(U,w.result);break}case"started":{var D;(D=U.onStarted)===null||D===void 0||D.call(U,{context:w.context});break}case"stopped":{var W;(W=U.onStopped)===null||W===void 0||W.call(U);break}case"data":case void 0:{var Q;(Q=U.onData)===null||Q===void 0||Q.call(U,w.result.data);break}}},error(w){var X;(X=U.onError)===null||X===void 0||X.call(U,w)},complete(){var w;(w=U.onComplete)===null||w===void 0||w.call(U)}})}};var ax=Symbol.for("trpc_untypedClient"),ex={query:"query",mutate:"mutation",subscribe:"subscription"},sx=($)=>{return ex[$]};function $h($){let I=fb(({path:U,args:b})=>{let w=[...U],X=sx(w.pop()),D=w.join(".");return $[X](D,...b)});return rQ((U)=>{if(U===ax)return $;return I[U]})}function OV($){let I=new tx($);return $h(I)}var _t=Y$(_$(),1);var Zt=Y$(_$(),1);var Ih=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,I){function U(w){var X,D,W,Q=2;for(typeof Symbol!="undefined"&&(D=Symbol.asyncIterator,W=Symbol.iterator);Q--;){if(D&&(X=w[D])!=null)return X.call(w);if(W&&(X=w[W])!=null)return new b(X.call(w));D="@@asyncIterator",W="@@iterator"}throw new TypeError("Object is not async iterable")}function b(w){function X(D){if(Object(D)!==D)return Promise.reject(new TypeError(D+" is not an object."));var W=D.done;return Promise.resolve(D.value).then(function(Q){return{value:Q,done:W}})}return b=function D(W){this.s=W,this.n=W.next},b.prototype={s:null,n:null,next:function D(){return X(this.n.apply(this.s,arguments))},return:function D(W){var Q=this.s.return;return Q===void 0?Promise.resolve({value:W,done:!0}):X(Q.apply(this.s,arguments))},throw:function D(W){var Q=this.s.return;return Q===void 0?Promise.reject(W):X(Q.apply(this.s,arguments))}},new b(w)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),Ct=Y$(Ih(),1);var gt=Y$(_$(),1);var Uh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,I){function U(){var b=typeof SuppressedError=="function"?SuppressedError:function(W,Q){var G=Error();return G.name="SuppressedError",G.error=W,G.suppressed=Q,G},w={},X=[];function D(W,Q){if(Q!=null){if(Object(Q)!==Q)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(W)var G=Q[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(G===void 0&&(G=Q[Symbol.dispose||Symbol.for("Symbol.dispose")],W))var N=G;if(typeof G!="function")throw new TypeError("Object is not disposable.");N&&(G=function B(){try{N.call(Q)}catch(H){return Promise.reject(H)}}),X.push({v:Q,d:G,a:W})}else W&&X.push({d:Q,a:W});return Q}return{e:w,u:D.bind(null,!1),a:D.bind(null,!0),d:function W(){var Q,G=this.e,N=0;function B(){for(;Q=X.pop();)try{if(!Q.a&&N===1)return N=0,X.push(Q),Promise.resolve().then(B);if(Q.d){var J=Q.d.call(Q.v);if(Q.a)return N|=2,Promise.resolve(J).then(B,H)}else N|=1}catch(A){return H(A)}if(N===1)return G!==w?Promise.reject(G):Promise.resolve();if(G!==w)throw G}function H(J){return G=G!==w?new b(J,G):J,B()}return B()}}}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),zV=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,I){function U(b,w){this.v=b,this.k=w}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),wh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=zV();function b(w){return new U(w,0)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),bh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,I){var U=zV();function b(X){return function(){return new w(X.apply(this,arguments))}}function w(X){var D,W;function Q(N,B){try{var H=X[N](B),J=H.value,A=J instanceof U;Promise.resolve(A?J.v:J).then(function(O){if(A){var V=N==="return"?"return":"next";if(!J.k||O.done)return Q(V,O);O=X[V](O).value}G(H.done?"return":"normal",O)},function(O){Q("throw",O)})}catch(O){G("throw",O)}}function G(N,B){switch(N){case"return":D.resolve({value:B,done:!0});break;case"throw":D.reject(B);break;default:D.resolve({value:B,done:!1})}(D=D.next)?Q(D.key,D.arg):W=null}this._invoke=function(N,B){return new Promise(function(H,J){var A={key:N,arg:B,resolve:H,reject:J,next:null};W?W=W.next=A:(D=W=A,Q(N,B))})},typeof X.return!="function"&&(this.return=void 0)}w.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},w.prototype.next=function(X){return this._invoke("next",X)},w.prototype.throw=function(X){return this._invoke("throw",X)},w.prototype.return=function(X){return this._invoke("return",X)},I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),xt=Y$(Uh(),1),ht=Y$(wh(),1),ft=Y$(bh(),1),yt=Y$(_$(),1);class eQ{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set($,I){this.keyToValue.set($,I),this.valueToKey.set(I,$)}getByKey($){return this.keyToValue.get($)}getByValue($){return this.valueToKey.get($)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class hU{constructor($){this.generateIdentifier=$,this.kv=new eQ}register($,I){if(this.kv.getByValue($))return;if(!I)I=this.generateIdentifier($);this.kv.set(I,$)}clear(){this.kv.clear()}getIdentifier($){return this.kv.getByValue($)}getValue($){return this.kv.getByKey($)}}class sQ extends hU{constructor(){super(($)=>$.name);this.classToAllowedProps=new Map}register($,I){if(typeof I==="object"){if(I.allowProps)this.classToAllowedProps.set($,I.allowProps);super.register($,I.identifier)}else super.register($,I)}getAllowedProps($){return this.classToAllowedProps.get($)}}function Xh($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function LV($,I){let U=Xh($);if("find"in U)return U.find(I);let b=U;for(let w=0;w<b.length;w++){let X=b[w];if(I(X))return X}return}function I1($,I){Object.entries($).forEach(([U,b])=>I(b,U))}function l1($,I){return $.indexOf(I)!==-1}function $G($,I){for(let U=0;U<$.length;U++){let b=$[U];if(I(b))return b}return}class IG{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return LV(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var Dh=($)=>Object.prototype.toString.call($).slice(8,-1),UG=($)=>typeof $==="undefined",Wh=($)=>$===null,U1=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},nb=($)=>U1($)&&Object.keys($).length===0,_6=($)=>Array.isArray($),Qh=($)=>typeof $==="string",Gh=($)=>typeof $==="number"&&!isNaN($),Nh=($)=>typeof $==="boolean",KV=($)=>$ instanceof RegExp,E4=($)=>$ instanceof Map,S4=($)=>$ instanceof Set,wG=($)=>Dh($)==="Symbol",vV=($)=>$ instanceof Date&&!isNaN($.valueOf()),ib=($)=>$ instanceof Error,bG=($)=>typeof $==="number"&&isNaN($),VV=($)=>Nh($)||Wh($)||UG($)||Gh($)||Qh($)||wG($),qV=($)=>typeof $==="bigint",FV=($)=>$===1/0||$===-1/0,MV=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),jV=($)=>$ instanceof URL;var ob=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),db=($)=>$.map(String).map(ob).join("."),c1=($,I)=>{let U=[],b="";for(let X=0;X<$.length;X++){let D=$.charAt(X);if(!I&&D==="\\"){let G=$.charAt(X+1);if(G==="\\"){b+="\\",X++;continue}else if(G!==".")throw Error("invalid path")}if(D==="\\"&&$.charAt(X+1)==="."){b+=".",X++;continue}if(D==="."){U.push(b),b="";continue}b+=D}let w=b;return U.push(w),U};function c6($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var EV=[c6(UG,"undefined",()=>null,()=>{return}),c6(qV,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),c6(vV,"Date",($)=>$.toISOString(),($)=>new Date($)),c6(ib,"Error",($,I)=>{let U={name:$.name,message:$.message};if("cause"in $)U.cause=$.cause;return I.allowedErrorProps.forEach((b)=>{U[b]=$[b]}),U},($,I)=>{let U=new Error($.message,{cause:$.cause});return U.name=$.name,U.stack=$.stack,I.allowedErrorProps.forEach((b)=>{U[b]=$[b]}),U}),c6(KV,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),c6(S4,"set",($)=>[...$.values()],($)=>new Set($)),c6(E4,"map",($)=>[...$.entries()],($)=>new Map($)),c6(($)=>bG($)||FV($),"number",($)=>{if(bG($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),c6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),c6(jV,"URL",($)=>$.toString(),($)=>new URL($))];function pb($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var SV=pb(($,I)=>{if(wG($))return!!I.symbolRegistry.getIdentifier($);return!1},($,I)=>{return["symbol",I.symbolRegistry.getIdentifier($)]},($)=>$.description,($,I,U)=>{let b=U.symbolRegistry.getValue(I[1]);if(!b)throw new Error("Trying to deserialize unknown symbol");return b}),Yh=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),PV=pb(MV,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=Yh[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function XG($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var kV=pb(XG,($,I)=>{return["class",I.classRegistry.getIdentifier($.constructor)]},($,I)=>{let U=I.classRegistry.getAllowedProps($.constructor);if(!U)return{...$};let b={};return U.forEach((w)=>{b[w]=$[w]}),b},($,I,U)=>{let b=U.classRegistry.getValue(I[1]);if(!b)throw new Error(`Trying to deserialize unknown class '${I[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(b.prototype),$)}),RV=pb(($,I)=>{return!!I.customTransformerRegistry.findApplicable($)},($,I)=>{return["custom",I.customTransformerRegistry.findApplicable($).name]},($,I)=>{return I.customTransformerRegistry.findApplicable($).serialize($)},($,I,U)=>{let b=U.customTransformerRegistry.findByName(I[1]);if(!b)throw new Error("Trying to deserialize unknown custom value");return b.deserialize($)}),Bh=[kV,SV,RV,PV],DG=($,I)=>{let U=$G(Bh,(w)=>w.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let b=$G(EV,(w)=>w.isApplicable($,I));if(b)return{value:b.transform($,I),type:b.annotation};return},TV={};EV.forEach(($)=>{TV[$.annotation]=$});var _V=($,I,U)=>{if(_6(I))switch(I[0]){case"symbol":return SV.untransform($,I,U);case"class":return kV.untransform($,I,U);case"custom":return RV.untransform($,I,U);case"typed-array":return PV.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let b=TV[I];if(!b)throw new Error("Unknown transformation: "+I);return b.untransform($,U)}};var m1=($,I)=>{if(I>$.size)throw new Error("index out of bounds");let U=$.keys();while(I>0)U.next(),I--;return U.next().value};function ZV($){if(l1($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(l1($,"prototype"))throw new Error("prototype is not allowed as a property");if(l1($,"constructor"))throw new Error("constructor is not allowed as a property")}var CV=($,I)=>{ZV(I);for(let U=0;U<I.length;U++){let b=I[U];if(S4($))$=m1($,+b);else if(E4($)){let w=+b,X=+I[++U]===0?"key":"value",D=m1($,w);switch(X){case"key":$=D;break;case"value":$=$.get(D);break}}else $=$[b]}return $},tb=($,I,U)=>{if(ZV(I),I.length===0)return U($);let b=$;for(let X=0;X<I.length-1;X++){let D=I[X];if(_6(b)){let W=+D;b=b[W]}else if(U1(b))b=b[D];else if(S4(b)){let W=+D;b=m1(b,W)}else if(E4(b)){if(X===I.length-2)break;let Q=+D,G=+I[++X]===0?"key":"value",N=m1(b,Q);switch(G){case"key":b=N;break;case"value":b=b.get(N);break}}}let w=I[I.length-1];if(_6(b))b[+w]=U(b[+w]);else if(U1(b))b[w]=U(b[w]);if(S4(b)){let X=m1(b,+w),D=U(X);if(X!==D)b.delete(X),b.add(D)}if(E4(b)){let X=+I[I.length-2],D=m1(b,X);switch(+w===0?"key":"value"){case"key":{let Q=U(D);if(b.set(Q,b.get(D)),Q!==D)b.delete(D);break}case"value":{b.set(D,U(b.get(D)));break}}}return $};var gV=($)=>$<1;function WG($,I,U,b=[]){if(!$)return;let w=gV(U);if(!_6($)){I1($,(W,Q)=>WG(W,I,U,[...b,...c1(Q,w)]));return}let[X,D]=$;if(D)I1(D,(W,Q)=>{WG(W,I,U,[...b,...c1(Q,w)])});I(X,b)}function xV($,I,U,b){return WG(I,(w,X)=>{$=tb($,X,(D)=>_V(D,w,b))},U),$}function hV($,I,U){let b=gV(U);function w(X,D){let W=CV($,c1(D,b));X.map((Q)=>c1(Q,b)).forEach((Q)=>{$=tb($,Q,()=>W)})}if(_6(I)){let[X,D]=I;if(X.forEach((W)=>{$=tb($,c1(W,b),()=>$)}),D)I1(D,w)}else I1(I,w);return $}var Jh=($,I)=>U1($)||_6($)||E4($)||S4($)||ib($)||XG($,I);function Hh($,I,U){let b=U.get($);if(b)b.push(I);else U.set($,[I])}function fV($,I){let U={},b=void 0;if($.forEach((w)=>{if(w.length<=1)return;if(!I)w=w.map((W)=>W.map(String)).sort((W,Q)=>W.length-Q.length);let[X,...D]=w;if(X.length===0)b=D.map(db);else U[db(X)]=D.map(db)}),b)if(nb(U))return[b];else return[b,U];else return nb(U)?void 0:U}var QG=($,I,U,b,w=[],X=[],D=new Map)=>{let W=VV($);if(!W){Hh($,w,I);let J=D.get($);if(J)return b?{transformedValue:null}:J}if(!Jh($,U)){let J=DG($,U),A=J?{transformedValue:J.value,annotations:[J.type]}:{transformedValue:$};if(!W)D.set($,A);return A}if(l1(X,$))return{transformedValue:null};let Q=DG($,U),G=Q?.value??$,N=_6(G)?[]:{},B={};I1(G,(J,A)=>{if(A==="__proto__"||A==="constructor"||A==="prototype")throw new Error(`Detected property ${A}. This is a prototype pollution risk, please remove it from your object.`);let O=QG(J,I,U,b,[...w,A],[...X,$],D);if(N[A]=O.transformedValue,_6(O.annotations))B[ob(A)]=O.annotations;else if(U1(O.annotations))I1(O.annotations,(V,q)=>{B[ob(A)+"."+q]=V})});let H=nb(B)?{transformedValue:N,annotations:Q?[Q.type]:void 0}:{transformedValue:N,annotations:Q?[Q.type,B]:B};if(!W)D.set($,H);return H};function ab($){return Object.prototype.toString.call($).slice(8,-1)}function eb($){return ab($)==="Array"}function GG($){if(ab($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function Ah($,I,U,b,w){let X={}.propertyIsEnumerable.call(b,I)?"enumerable":"nonenumerable";if(X==="enumerable")$[I]=U;if(w&&X==="nonenumerable")Object.defineProperty($,I,{value:U,enumerable:!1,writable:!0,configurable:!0})}function sb($,I={}){if(eb($))return $.map((w)=>sb(w,I));if(!GG($))return $;let U=Object.getOwnPropertyNames($),b=Object.getOwnPropertySymbols($);return[...U,...b].reduce((w,X)=>{if(X==="__proto__")return w;if(eb(I.props)&&!I.props.includes(X))return w;let D=$[X],W=sb(D,I);return Ah(w,X,W,$,I.nonenumerable),w},{})}class U${constructor({dedupe:$=!1}={}){this.classRegistry=new sQ,this.symbolRegistry=new hU((I)=>I.description??""),this.customTransformerRegistry=new IG,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=QG($,I,this,this.dedupe),b={json:U.transformedValue};if(U.annotations)b.meta={...b.meta,values:U.annotations};let w=fV(I,this.dedupe);if(w)b.meta={...b.meta,referentialEqualities:w};if(b.meta)b.meta.v=1;return b}deserialize($,I){let{json:U,meta:b}=$,w=I?.inPlace?U:sb(U);if(b?.values)w=xV(w,b.values,b.v??0,this);if(b?.referentialEqualities)w=hV(w,b.referentialEqualities,b.v??0);return w}stringify($){return JSON.stringify(this.serialize($))}parse($){return this.deserialize(JSON.parse($),{inPlace:!0})}registerClass($,I){this.classRegistry.register($,I)}registerSymbol($,I){this.symbolRegistry.register($,I)}registerCustom($,I){this.customTransformerRegistry.register({name:I,...$})}allowErrorProps(...$){this.allowedErrorProps.push(...$)}}U$.defaultInstance=new U$;U$.serialize=U$.defaultInstance.serialize.bind(U$.defaultInstance);U$.deserialize=U$.defaultInstance.deserialize.bind(U$.defaultInstance);U$.stringify=U$.defaultInstance.stringify.bind(U$.defaultInstance);U$.parse=U$.defaultInstance.parse.bind(U$.defaultInstance);U$.registerClass=U$.defaultInstance.registerClass.bind(U$.defaultInstance);U$.registerSymbol=U$.defaultInstance.registerSymbol.bind(U$.defaultInstance);U$.registerCustom=U$.defaultInstance.registerCustom.bind(U$.defaultInstance);U$.allowErrorProps=U$.defaultInstance.allowErrorProps.bind(U$.defaultInstance);var yV=U$;var{serialize:Ea,deserialize:Sa,stringify:Pa,parse:ka,registerClass:Ra,registerCustom:Ta,registerSymbol:_a,allowErrorProps:Za}=U$;class NG{trpc;constructor($){this.trpc=OV({links:[pQ({url:`${$.apiUrl}/trpc`,transformer:yV,headers:()=>({Authorization:`Bearer ${$.apiKey}`})})]})}async whoami(){return this.trpc.apiKeys.whoami.query()}async search($){return this.trpc.search.blocks.query($)}async getContent($){return this.trpc.mcpTools.getContent.query($)}async getWorkspaceContext(){return this.trpc.mcpTools.getWorkspaceContext.query()}async strReplaceBlock($){return this.trpc.mcpTools.strReplaceBlock.mutate($)}async insertBlock($){return this.trpc.mcpTools.insertBlock.mutate($)}async insertMatrix($){return this.trpc.mcpTools.insertMatrix.mutate($)}async createMatrixFromReactionArtifact($){return this.trpc.mcpTools.createMatrixFromReactionArtifact.mutate($)}async deleteBlock($){return this.trpc.mcpTools.deleteBlock.mutate($)}async createDocument($){return this.trpc.mcpTools.createDocument.mutate($)}async createLiterature($){return this.trpc.mcpTools.createLiterature.mutate($)}async searchArtifacts($){return this.trpc.mcpTools.searchArtifacts.query($)}async createRecord($){return this.trpc.mcpTools.createRecord.mutate($)}async listProcedureNodes($){return this.trpc.mcpTools.listProcedureNodes.query($)}async buildProcedureTree($){return this.trpc.mcpTools.buildProcedureTree.mutate($)}async insertProcedureNode($){return this.trpc.mcpTools.insertProcedureNode.mutate($)}async updateProcedureNode($){return this.trpc.mcpTools.updateProcedureNode.mutate($)}async updateArtifact($){return this.trpc.mcpTools.updateArtifact.mutate($)}async createArtifact($){return this.trpc.mcpTools.createArtifact.mutate($)}async reorderProcedureNodes($){return this.trpc.mcpTools.reorderProcedureNodes.mutate($)}async deleteProcedureNode($){return this.trpc.mcpTools.deleteProcedureNode.mutate($)}async appendMatrixRows($){return this.trpc.mcpTools.appendMatrixRows.mutate($)}async updateMatrixRows($){return this.trpc.mcpTools.updateMatrixRows.mutate($)}async deleteMatrixRows($){return this.trpc.mcpTools.deleteMatrixRows.mutate($)}async rebindMatrixToNode($){return this.trpc.mcpTools.rebindMatrixToNode.mutate($)}async deleteMatrix($){return this.trpc.mcpTools.deleteMatrix.mutate($)}async attachMatrix($){return this.trpc.mcpTools.attachMatrix.mutate($)}async listMatrixReferences($){let U=(await this.trpc.mcpTools.listMatrixReferences.query($)).references??[];return{success:!0,matrixId:$.matrixId,references:U,totalCount:U.length}}async linkArtifactToNode($){return this.trpc.mcpTools.linkArtifactToNode.mutate($)}async unlinkArtifactFromNode($){return this.trpc.mcpTools.unlinkArtifactFromNode.mutate($)}async listNodeArtifactLinks($){return this.trpc.mcpTools.listNodeArtifactLinks.query($)}async instantiateArtifactTemplate($){return this.trpc.mcpTools.instantiateArtifactTemplate.mutate($)}}function YG($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var w4=YG();async function uV($){let I=YG();I.info("Initializing server context...");let U=new NG({apiUrl:$.apiUrl,apiKey:$.apiKey});I.info("Resolving user identity from API key...");let b;try{b=(await U.whoami()).userId,I.info(`Resolved user: ${b.slice(0,8)}...`)}catch(X){I.error("Failed to resolve user identity from API key:",X),I.error("Ensure SURA_API_URL is correct and the API server is running."),process.exit(1)}I.info(`API URL: ${$.apiUrl}`);let w={userId:b,client:U,log:I};try{I.info("Loading workspace context..."),w.workspaceContext=await U.getWorkspaceContext();let X=w.workspaceContext.orgs.length,D=w.workspaceContext.orgs.reduce((W,Q)=>W+Q.workspaces.length,0);I.info(`Workspace context loaded: ${X} org(s), ${D} workspace(s)`)}catch(X){I.warn("Failed to load workspace context at startup (will retry on first tool call):",X)}return w}var Y={};v6(Y,{xor:()=>BF,xid:()=>gq,void:()=>DF,uuidv7:()=>Sq,uuidv6:()=>Eq,uuidv4:()=>jq,uuid:()=>Mq,util:()=>E,url:()=>Pq,uppercase:()=>II,unknown:()=>N1,union:()=>jD,undefined:()=>bF,ulid:()=>Cq,uint64:()=>UF,uint32:()=>sq,tuple:()=>PB,trim:()=>WI,treeifyError:()=>FG,transform:()=>SD,toUpperCase:()=>GI,toLowerCase:()=>QI,toJSONSchema:()=>eX,templateLiteral:()=>jF,symbol:()=>wF,superRefine:()=>sB,success:()=>qF,stringbool:()=>ZF,stringFormat:()=>iq,string:()=>bD,strictObject:()=>NF,startsWith:()=>wI,slugify:()=>NI,size:()=>e1,setErrorMap:()=>ey,set:()=>zF,safeParseAsync:()=>UB,safeParse:()=>IB,safeEncodeAsync:()=>GB,safeEncode:()=>WB,safeDecodeAsync:()=>NB,safeDecode:()=>QB,registry:()=>MX,regexes:()=>K6,regex:()=>s1,refine:()=>eB,record:()=>kB,readonly:()=>iB,property:()=>pX,promise:()=>EF,prettifyError:()=>MG,preprocess:()=>gF,prefault:()=>yB,positive:()=>nX,pipe:()=>Y0,partialRecord:()=>HF,parseAsync:()=>$B,parse:()=>s5,overwrite:()=>Z6,optional:()=>G0,object:()=>GF,number:()=>BB,nullish:()=>VF,nullable:()=>N0,null:()=>zB,normalize:()=>DI,nonpositive:()=>oX,nonoptional:()=>uB,nonnegative:()=>dX,never:()=>MD,negative:()=>iX,nativeEnum:()=>LF,nanoid:()=>Tq,nan:()=>FF,multipleOf:()=>Z4,minSize:()=>C4,minLength:()=>b4,mime:()=>XI,meta:()=>TF,maxSize:()=>W1,maxLength:()=>Q1,map:()=>OF,mac:()=>fq,lte:()=>N6,lt:()=>r6,lowercase:()=>$I,looseRecord:()=>AF,looseObject:()=>YF,locales:()=>b0,literal:()=>KF,length:()=>G1,lazy:()=>pB,ksuid:()=>xq,keyof:()=>QF,jwt:()=>nq,json:()=>CF,iso:()=>JI,ipv6:()=>yq,ipv4:()=>hq,intersection:()=>EB,int64:()=>IF,int32:()=>eq,int:()=>XD,instanceof:()=>_F,includes:()=>UI,httpUrl:()=>kq,hostname:()=>oq,hex:()=>dq,hash:()=>pq,guid:()=>Fq,gte:()=>p$,gt:()=>n6,globalRegistry:()=>d$,getErrorMap:()=>sy,function:()=>SF,fromJSONSchema:()=>hF,formatError:()=>oU,float64:()=>aq,float32:()=>tq,flattenError:()=>iU,file:()=>vF,enum:()=>ED,endsWith:()=>bI,encodeAsync:()=>XB,encode:()=>wB,emoji:()=>Rq,email:()=>qq,e164:()=>rq,discriminatedUnion:()=>JF,describe:()=>RF,decodeAsync:()=>DB,decode:()=>bB,date:()=>WF,custom:()=>kF,cuid2:()=>Zq,cuid:()=>_q,core:()=>X4,config:()=>P$,coerce:()=>IJ,codec:()=>MF,clone:()=>o$,cidrv6:()=>lq,cidrv4:()=>uq,check:()=>PF,catch:()=>mB,boolean:()=>JB,bigint:()=>$F,base64url:()=>mq,base64:()=>cq,array:()=>H0,any:()=>XF,_function:()=>SF,_default:()=>hB,_ZodString:()=>DD,ZodXor:()=>FB,ZodXID:()=>JD,ZodVoid:()=>VB,ZodUnknown:()=>KB,ZodUnion:()=>O0,ZodUndefined:()=>AB,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>BD,ZodType:()=>t,ZodTuple:()=>SB,ZodTransform:()=>CB,ZodTemplateLiteral:()=>oB,ZodSymbol:()=>HB,ZodSuccess:()=>lB,ZodStringFormat:()=>J$,ZodString:()=>AI,ZodSet:()=>TB,ZodRecord:()=>z0,ZodRealError:()=>b6,ZodReadonly:()=>nB,ZodPromise:()=>tB,ZodPrefault:()=>fB,ZodPipe:()=>RD,ZodOptional:()=>PD,ZodObject:()=>A0,ZodNumberFormat:()=>Y1,ZodNumber:()=>zI,ZodNullable:()=>gB,ZodNull:()=>OB,ZodNonOptional:()=>kD,ZodNever:()=>vB,ZodNanoID:()=>GD,ZodNaN:()=>rB,ZodMap:()=>RB,ZodMAC:()=>YB,ZodLiteral:()=>_B,ZodLazy:()=>dB,ZodKSUID:()=>HD,ZodJWT:()=>qD,ZodIssueCode:()=>ay,ZodIntersection:()=>jB,ZodISOTime:()=>UD,ZodISODuration:()=>wD,ZodISODateTime:()=>$D,ZodISODate:()=>ID,ZodIPv6:()=>OD,ZodIPv4:()=>AD,ZodGUID:()=>Q0,ZodFunction:()=>aB,ZodFirstPartyTypeKind:()=>$J,ZodFile:()=>ZB,ZodError:()=>py,ZodEnum:()=>HI,ZodEmoji:()=>QD,ZodEmail:()=>WD,ZodE164:()=>VD,ZodDiscriminatedUnion:()=>MB,ZodDefault:()=>xB,ZodDate:()=>J0,ZodCustomStringFormat:()=>OI,ZodCustom:()=>L0,ZodCodec:()=>TD,ZodCatch:()=>cB,ZodCUID2:()=>YD,ZodCUID:()=>ND,ZodCIDRv6:()=>LD,ZodCIDRv4:()=>zD,ZodBoolean:()=>LI,ZodBigIntFormat:()=>FD,ZodBigInt:()=>KI,ZodBase64URL:()=>vD,ZodBase64:()=>KD,ZodArray:()=>qB,ZodAny:()=>LB,TimePrecision:()=>S7,NEVER:()=>BG,$output:()=>V7,$input:()=>q7,$brand:()=>JG});var X4={};v6(X4,{version:()=>vN,util:()=>E,treeifyError:()=>FG,toJSONSchema:()=>eX,toDotPath:()=>iV,safeParseAsync:()=>EG,safeParse:()=>jG,safeEncodeAsync:()=>dh,safeEncode:()=>ih,safeDecodeAsync:()=>ph,safeDecode:()=>oh,registry:()=>MX,regexes:()=>K6,process:()=>G$,prettifyError:()=>MG,parseAsync:()=>wX,parse:()=>UX,meta:()=>W5,locales:()=>b0,isValidJWT:()=>Yq,isValidBase64URL:()=>Nq,isValidBase64:()=>cN,initializeContext:()=>g4,globalRegistry:()=>d$,globalConfig:()=>fU,formatError:()=>oU,flattenError:()=>iU,finalize:()=>h4,extractDefs:()=>x4,encodeAsync:()=>rh,encode:()=>ch,describe:()=>D5,decodeAsync:()=>nh,decode:()=>mh,createToJSONSchemaMethod:()=>G5,createStandardJSONSchemaMethod:()=>BI,config:()=>P$,clone:()=>o$,_xor:()=>jy,_xid:()=>gX,_void:()=>a7,_uuidv7:()=>kX,_uuidv6:()=>PX,_uuidv4:()=>SX,_uuid:()=>EX,_url:()=>D0,_uppercase:()=>II,_unknown:()=>p7,_union:()=>My,_undefined:()=>i7,_ulid:()=>CX,_uint64:()=>r7,_uint32:()=>f7,_tuple:()=>Py,_trim:()=>WI,_transform:()=>gy,_toUpperCase:()=>GI,_toLowerCase:()=>QI,_templateLiteral:()=>ry,_symbol:()=>n7,_superRefine:()=>X5,_success:()=>uy,_stringbool:()=>Q5,_stringFormat:()=>YI,_string:()=>M7,_startsWith:()=>wI,_slugify:()=>NI,_size:()=>e1,_set:()=>Ty,_safeParseAsync:()=>t1,_safeParse:()=>p1,_safeEncodeAsync:()=>NX,_safeEncode:()=>QX,_safeDecodeAsync:()=>YX,_safeDecode:()=>GX,_regex:()=>s1,_refine:()=>b5,_record:()=>ky,_readonly:()=>my,_property:()=>pX,_promise:()=>iy,_positive:()=>nX,_pipe:()=>cy,_parseAsync:()=>d1,_parse:()=>o1,_overwrite:()=>Z6,_optional:()=>xy,_number:()=>_7,_nullable:()=>hy,_null:()=>o7,_normalize:()=>DI,_nonpositive:()=>oX,_nonoptional:()=>yy,_nonnegative:()=>dX,_never:()=>t7,_negative:()=>iX,_nativeEnum:()=>Zy,_nanoid:()=>TX,_nan:()=>$5,_multipleOf:()=>Z4,_minSize:()=>C4,_minLength:()=>b4,_min:()=>p$,_mime:()=>XI,_maxSize:()=>W1,_maxLength:()=>Q1,_max:()=>N6,_map:()=>Ry,_mac:()=>E7,_lte:()=>N6,_lt:()=>r6,_lowercase:()=>$I,_literal:()=>Cy,_length:()=>G1,_lazy:()=>ny,_ksuid:()=>xX,_jwt:()=>rX,_isoTime:()=>R7,_isoDuration:()=>T7,_isoDateTime:()=>P7,_isoDate:()=>k7,_ipv6:()=>fX,_ipv4:()=>hX,_intersection:()=>Sy,_int64:()=>m7,_int32:()=>h7,_int:()=>C7,_includes:()=>UI,_guid:()=>X0,_gte:()=>p$,_gt:()=>n6,_float64:()=>x7,_float32:()=>g7,_file:()=>U5,_enum:()=>_y,_endsWith:()=>bI,_encodeAsync:()=>DX,_encode:()=>bX,_emoji:()=>RX,_email:()=>jX,_e164:()=>mX,_discriminatedUnion:()=>Ey,_default:()=>fy,_decodeAsync:()=>WX,_decode:()=>XX,_date:()=>e7,_custom:()=>w5,_cuid2:()=>ZX,_cuid:()=>_X,_coercedString:()=>j7,_coercedNumber:()=>Z7,_coercedDate:()=>s7,_coercedBoolean:()=>u7,_coercedBigint:()=>c7,_cidrv6:()=>uX,_cidrv4:()=>yX,_check:()=>Kq,_catch:()=>ly,_boolean:()=>y7,_bigint:()=>l7,_base64url:()=>cX,_base64:()=>lX,_array:()=>I5,_any:()=>d7,TimePrecision:()=>S7,NEVER:()=>BG,JSONSchemaGenerator:()=>d5,JSONSchema:()=>vq,Doc:()=>AX,$output:()=>V7,$input:()=>q7,$constructor:()=>z,$brand:()=>JG,$ZodXor:()=>DY,$ZodXID:()=>TN,$ZodVoid:()=>UY,$ZodUnknown:()=>$Y,$ZodUnion:()=>aU,$ZodUndefined:()=>aN,$ZodUUID:()=>FN,$ZodURL:()=>jN,$ZodULID:()=>RN,$ZodType:()=>o,$ZodTuple:()=>FX,$ZodTransform:()=>AY,$ZodTemplateLiteral:()=>EY,$ZodSymbol:()=>tN,$ZodSuccess:()=>VY,$ZodStringFormat:()=>B$,$ZodString:()=>D1,$ZodSet:()=>YY,$ZodRegistry:()=>F7,$ZodRecord:()=>GY,$ZodRealError:()=>w6,$ZodReadonly:()=>jY,$ZodPromise:()=>PY,$ZodPrefault:()=>KY,$ZodPipe:()=>MY,$ZodOptional:()=>OY,$ZodObjectJIT:()=>XY,$ZodObject:()=>Hq,$ZodNumberFormat:()=>dN,$ZodNumber:()=>VX,$ZodNullable:()=>zY,$ZodNull:()=>eN,$ZodNonOptional:()=>vY,$ZodNever:()=>IY,$ZodNanoID:()=>SN,$ZodNaN:()=>FY,$ZodMap:()=>NY,$ZodMAC:()=>yN,$ZodLiteral:()=>JY,$ZodLazy:()=>kY,$ZodKSUID:()=>_N,$ZodJWT:()=>iN,$ZodIntersection:()=>QY,$ZodISOTime:()=>gN,$ZodISODuration:()=>xN,$ZodISODateTime:()=>ZN,$ZodISODate:()=>CN,$ZodIPv6:()=>fN,$ZodIPv4:()=>hN,$ZodGUID:()=>qN,$ZodFunction:()=>SY,$ZodFile:()=>HY,$ZodError:()=>nU,$ZodEnum:()=>BY,$ZodEncodeError:()=>w1,$ZodEmoji:()=>EN,$ZodEmail:()=>MN,$ZodE164:()=>nN,$ZodDiscriminatedUnion:()=>WY,$ZodDefault:()=>LY,$ZodDate:()=>wY,$ZodCustomStringFormat:()=>oN,$ZodCustom:()=>RY,$ZodCodec:()=>eU,$ZodCheckUpperCase:()=>JN,$ZodCheckStringFormat:()=>a1,$ZodCheckStartsWith:()=>AN,$ZodCheckSizeEquals:()=>WN,$ZodCheckRegex:()=>YN,$ZodCheckProperty:()=>zN,$ZodCheckOverwrite:()=>KN,$ZodCheckNumberFormat:()=>wN,$ZodCheckMultipleOf:()=>UN,$ZodCheckMinSize:()=>DN,$ZodCheckMinLength:()=>GN,$ZodCheckMimeType:()=>LN,$ZodCheckMaxSize:()=>XN,$ZodCheckMaxLength:()=>QN,$ZodCheckLowerCase:()=>BN,$ZodCheckLessThan:()=>JX,$ZodCheckLengthEquals:()=>NN,$ZodCheckIncludes:()=>HN,$ZodCheckGreaterThan:()=>HX,$ZodCheckEndsWith:()=>ON,$ZodCheckBigIntFormat:()=>bN,$ZodCheck:()=>A$,$ZodCatch:()=>qY,$ZodCUID2:()=>kN,$ZodCUID:()=>PN,$ZodCIDRv6:()=>lN,$ZodCIDRv4:()=>uN,$ZodBoolean:()=>tU,$ZodBigIntFormat:()=>pN,$ZodBigInt:()=>qX,$ZodBase64URL:()=>rN,$ZodBase64:()=>mN,$ZodAsyncError:()=>m6,$ZodArray:()=>bY,$ZodAny:()=>sN});var BG=Object.freeze({status:"aborted"});function z($,I,U){function b(W,Q){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:Q,constr:D,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),I(W,Q);let G=D.prototype,N=Object.keys(G);for(let B=0;B<N.length;B++){let H=N[B];if(!(H in W))W[H]=G[H].bind(W)}}let w=U?.Parent??Object;class X extends w{}Object.defineProperty(X,"name",{value:$});function D(W){var Q;let G=U?.Parent?new X:this;b(G,W),(Q=G._zod).deferred??(Q.deferred=[]);for(let N of G._zod.deferred)N();return G}return Object.defineProperty(D,"init",{value:b}),Object.defineProperty(D,Symbol.hasInstance,{value:(W)=>{if(U?.Parent&&W instanceof U.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(D,"name",{value:$}),D}var JG=Symbol("zod_brand");class m6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class w1 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var fU={};function P$($){if($)Object.assign(fU,$);return fU}var E={};v6(E,{unwrapMessage:()=>yU,uint8ArrayToHex:()=>uh,uint8ArrayToBase64url:()=>fh,uint8ArrayToBase64:()=>mV,stringifyPrimitive:()=>j,slugify:()=>OG,shallowClone:()=>LG,safeExtend:()=>_h,required:()=>gh,randomString:()=>jh,propertyKeyTypes:()=>cU,promiseAllObject:()=>Mh,primitiveTypes:()=>KG,prefixIssues:()=>G6,pick:()=>kh,partial:()=>Ch,optionalKeys:()=>vG,omit:()=>Rh,objectClone:()=>Vh,numKeys:()=>Eh,nullish:()=>P4,normalizeParams:()=>S,mergeDefs:()=>R4,merge:()=>Zh,jsonStringifyReplacer:()=>r1,joinValues:()=>L,issue:()=>i1,isPlainObject:()=>T4,isObject:()=>b1,hexToUint8Array:()=>yh,getSizableOrigin:()=>mU,getParsedType:()=>Sh,getLengthableOrigin:()=>rU,getEnumValues:()=>uU,getElementAtPath:()=>Fh,floatSafeRemainder:()=>AG,finalizeIssue:()=>U6,extend:()=>Th,escapeRegex:()=>L6,esc:()=>$X,defineLazy:()=>s,createTransparentProxy:()=>Ph,cloneDef:()=>qh,clone:()=>o$,cleanRegex:()=>lU,cleanEnum:()=>xh,captureStackTrace:()=>IX,cached:()=>n1,base64urlToUint8Array:()=>hh,base64ToUint8Array:()=>cV,assignProp:()=>k4,assertNotEqual:()=>zh,assertNever:()=>Kh,assertIs:()=>Lh,assertEqual:()=>Oh,assert:()=>vh,allowsEval:()=>zG,aborted:()=>_4,NUMBER_FORMAT_RANGES:()=>VG,Class:()=>rV,BIGINT_FORMAT_RANGES:()=>qG});function Oh($){return $}function zh($){return $}function Lh($){}function Kh($){throw new Error("Unexpected value in exhaustive check")}function vh($){}function uU($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function L($,I="|"){return $.map((U)=>j(U)).join(I)}function r1($,I){if(typeof I==="bigint")return I.toString();return I}function n1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function P4($){return $===null||$===void 0}function lU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function AG($,I){let U=($.toString().split(".")[1]||"").length,b=I.toString(),w=(b.split(".")[1]||"").length;if(w===0&&/\d?e-\d?/.test(b)){let Q=b.match(/\d?e-(\d?)/);if(Q?.[1])w=Number.parseInt(Q[1])}let X=U>w?U:w,D=Number.parseInt($.toFixed(X).replace(".","")),W=Number.parseInt(I.toFixed(X).replace(".",""));return D%W/10**X}var lV=Symbol("evaluating");function s($,I,U){let b=void 0;Object.defineProperty($,I,{get(){if(b===lV)return;if(b===void 0)b=lV,b=U();return b},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function Vh($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function k4($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function R4(...$){let I={};for(let U of $){let b=Object.getOwnPropertyDescriptors(U);Object.assign(I,b)}return Object.defineProperties({},I)}function qh($){return R4($._zod.def)}function Fh($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function Mh($){let I=Object.keys($),U=I.map((b)=>$[b]);return Promise.all(U).then((b)=>{let w={};for(let X=0;X<I.length;X++)w[I[X]]=b[X];return w})}function jh($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function $X($){return JSON.stringify($)}function OG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var IX="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function b1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var zG=n1(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function T4($){if(b1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(b1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function LG($){if(T4($))return{...$};if(Array.isArray($))return[...$];return $}function Eh($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var Sh=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},cU=new Set(["string","number","symbol"]),KG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function L6($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o$($,I,U){let b=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)b._zod.parent=$;return b}function S($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function Ph($){let I;return new Proxy({},{get(U,b,w){return I??(I=$()),Reflect.get(I,b,w)},set(U,b,w,X){return I??(I=$()),Reflect.set(I,b,w,X)},has(U,b){return I??(I=$()),Reflect.has(I,b)},deleteProperty(U,b){return I??(I=$()),Reflect.deleteProperty(I,b)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,b){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,b)},defineProperty(U,b,w){return I??(I=$()),Reflect.defineProperty(I,b,w)}})}function j($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function vG($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var VG={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]},qG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function kh($,I){let U=$._zod.def,b=R4($._zod.def,{get shape(){let w={};for(let X in I){if(!(X in U.shape))throw new Error(`Unrecognized key: "${X}"`);if(!I[X])continue;w[X]=U.shape[X]}return k4(this,"shape",w),w},checks:[]});return o$($,b)}function Rh($,I){let U=$._zod.def,b=R4($._zod.def,{get shape(){let w={...$._zod.def.shape};for(let X in I){if(!(X in U.shape))throw new Error(`Unrecognized key: "${X}"`);if(!I[X])continue;delete w[X]}return k4(this,"shape",w),w},checks:[]});return o$($,b)}function Th($,I){if(!T4(I))throw new Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let w=R4($._zod.def,{get shape(){let X={...$._zod.def.shape,...I};return k4(this,"shape",X),X},checks:[]});return o$($,w)}function _h($,I){if(!T4(I))throw new Error("Invalid input to safeExtend: expected a plain object");let U={...$._zod.def,get shape(){let b={...$._zod.def.shape,...I};return k4(this,"shape",b),b},checks:$._zod.def.checks};return o$($,U)}function Zh($,I){let U=R4($._zod.def,{get shape(){let b={...$._zod.def.shape,...I._zod.def.shape};return k4(this,"shape",b),b},get catchall(){return I._zod.def.catchall},checks:[]});return o$($,U)}function Ch($,I,U){let b=R4(I._zod.def,{get shape(){let w=I._zod.def.shape,X={...w};if(U)for(let D in U){if(!(D in w))throw new Error(`Unrecognized key: "${D}"`);if(!U[D])continue;X[D]=$?new $({type:"optional",innerType:w[D]}):w[D]}else for(let D in w)X[D]=$?new $({type:"optional",innerType:w[D]}):w[D];return k4(this,"shape",X),X},checks:[]});return o$(I,b)}function gh($,I,U){let b=R4(I._zod.def,{get shape(){let w=I._zod.def.shape,X={...w};if(U)for(let D in U){if(!(D in X))throw new Error(`Unrecognized key: "${D}"`);if(!U[D])continue;X[D]=new $({type:"nonoptional",innerType:w[D]})}else for(let D in w)X[D]=new $({type:"nonoptional",innerType:w[D]});return k4(this,"shape",X),X},checks:[]});return o$(I,b)}function _4($,I=0){if($.aborted===!0)return!0;for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function G6($,I){return I.map((U)=>{var b;return(b=U).path??(b.path=[]),U.path.unshift($),U})}function yU($){return typeof $==="string"?$:$?.message}function U6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=yU($.inst?._zod.def?.error?.($))??yU(I?.error?.($))??yU(U.customError?.($))??yU(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function mU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function rU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function i1(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function xh($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function cV($){let I=atob($),U=new Uint8Array(I.length);for(let b=0;b<I.length;b++)U[b]=I.charCodeAt(b);return U}function mV($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function hh($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return cV(I+U)}function fh($){return mV($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function yh($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw new Error("Invalid hex string length");let U=new Uint8Array(I.length/2);for(let b=0;b<I.length;b+=2)U[b/2]=Number.parseInt(I.slice(b,b+2),16);return U}function uh($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class rV{constructor(...$){}}var nV=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,r1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},nU=z("$ZodError",nV),w6=z("$ZodError",nV,{Parent:Error});function iU($,I=(U)=>U.message){let U={},b=[];for(let w of $.issues)if(w.path.length>0)U[w.path[0]]=U[w.path[0]]||[],U[w.path[0]].push(I(w));else b.push(I(w));return{formErrors:b,fieldErrors:U}}function oU($,I=(U)=>U.message){let U={_errors:[]},b=(w)=>{for(let X of w.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((D)=>b({issues:D}));else if(X.code==="invalid_key")b({issues:X.issues});else if(X.code==="invalid_element")b({issues:X.issues});else if(X.path.length===0)U._errors.push(I(X));else{let D=U,W=0;while(W<X.path.length){let Q=X.path[W];if(W!==X.path.length-1)D[Q]=D[Q]||{_errors:[]};else D[Q]=D[Q]||{_errors:[]},D[Q]._errors.push(I(X));D=D[Q],W++}}};return b($),U}function FG($,I=(U)=>U.message){let U={errors:[]},b=(w,X=[])=>{var D,W;for(let Q of w.issues)if(Q.code==="invalid_union"&&Q.errors.length)Q.errors.map((G)=>b({issues:G},Q.path));else if(Q.code==="invalid_key")b({issues:Q.issues},Q.path);else if(Q.code==="invalid_element")b({issues:Q.issues},Q.path);else{let G=[...X,...Q.path];if(G.length===0){U.errors.push(I(Q));continue}let N=U,B=0;while(B<G.length){let H=G[B],J=B===G.length-1;if(typeof H==="string")N.properties??(N.properties={}),(D=N.properties)[H]??(D[H]={errors:[]}),N=N.properties[H];else N.items??(N.items=[]),(W=N.items)[H]??(W[H]={errors:[]}),N=N.items[H];if(J)N.errors.push(I(Q));B++}}};return b($),U}function iV($){let I=[],U=$.map((b)=>typeof b==="object"?b.key:b);for(let b of U)if(typeof b==="number")I.push(`[${b}]`);else if(typeof b==="symbol")I.push(`[${JSON.stringify(String(b))}]`);else if(/[^\w$]/.test(b))I.push(`[${JSON.stringify(b)}]`);else{if(I.length)I.push(".");I.push(b)}return I.join("")}function MG($){let I=[],U=[...$.issues].sort((b,w)=>(b.path??[]).length-(w.path??[]).length);for(let b of U)if(I.push(`✖ ${b.message}`),b.path?.length)I.push(` → at ${iV(b.path)}`);return I.join(`
43
- `)}var o1=($)=>(I,U,b,w)=>{let X=b?Object.assign(b,{async:!1}):{async:!1},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)throw new m6;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>U6(Q,X,P$())));throw IX(W,w?.callee),W}return D.value},UX=o1(w6),d1=($)=>async(I,U,b,w)=>{let X=b?Object.assign(b,{async:!0}):{async:!0},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)D=await D;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>U6(Q,X,P$())));throw IX(W,w?.callee),W}return D.value},wX=d1(w6),p1=($)=>(I,U,b)=>{let w=b?{...b,async:!1}:{async:!1},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)throw new m6;return X.issues.length?{success:!1,error:new($??nU)(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},jG=p1(w6),t1=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{async:!0}):{async:!0},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},EG=t1(w6),bX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return o1($)(I,U,w)},ch=bX(w6),XX=($)=>(I,U,b)=>{return o1($)(I,U,b)},mh=XX(w6),DX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return d1($)(I,U,w)},rh=DX(w6),WX=($)=>async(I,U,b)=>{return d1($)(I,U,b)},nh=WX(w6),QX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return p1($)(I,U,w)},ih=QX(w6),GX=($)=>(I,U,b)=>{return p1($)(I,U,b)},oh=GX(w6),NX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return t1($)(I,U,w)},dh=NX(w6),YX=($)=>async(I,U,b)=>{return t1($)(I,U,b)},ph=YX(w6);var K6={};v6(K6,{xid:()=>RG,uuid7:()=>sh,uuid6:()=>eh,uuid4:()=>ah,uuid:()=>X1,uppercase:()=>IN,unicodeEmail:()=>oV,undefined:()=>sG,ulid:()=>kG,time:()=>nG,string:()=>oG,sha512_hex:()=>vf,sha512_base64url:()=>qf,sha512_base64:()=>Vf,sha384_hex:()=>zf,sha384_base64url:()=>Kf,sha384_base64:()=>Lf,sha256_hex:()=>Hf,sha256_base64url:()=>Of,sha256_base64:()=>Af,sha1_hex:()=>Yf,sha1_base64url:()=>Jf,sha1_base64:()=>Bf,rfc5322Email:()=>If,number:()=>tG,null:()=>eG,nanoid:()=>_G,md5_hex:()=>Qf,md5_base64url:()=>Nf,md5_base64:()=>Gf,mac:()=>yG,lowercase:()=>$N,ksuid:()=>TG,ipv6:()=>fG,ipv4:()=>hG,integer:()=>pG,idnEmail:()=>Uf,html5Email:()=>$f,hostname:()=>Xf,hex:()=>Wf,guid:()=>CG,extendedDuration:()=>th,emoji:()=>xG,email:()=>gG,e164:()=>mG,duration:()=>ZG,domain:()=>Df,datetime:()=>iG,date:()=>rG,cuid2:()=>PG,cuid:()=>SG,cidrv6:()=>lG,cidrv4:()=>uG,browserEmail:()=>wf,boolean:()=>aG,bigint:()=>dG,base64url:()=>BX,base64:()=>cG});var SG=/^[cC][^\s-]{8,}$/,PG=/^[0-9a-z]+$/,kG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RG=/^[0-9a-vA-V]{20}$/,TG=/^[A-Za-z0-9]{27}$/,_G=/^[a-zA-Z0-9_-]{21}$/,ZG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,th=/^[-+]?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)?)??$/,CG=/^([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})$/,X1=($)=>{if(!$)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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},ah=X1(4),eh=X1(6),sh=X1(7),gG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$f=/^[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])?)*$/,If=/^(([^<>()\[\]\\.,;:\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,}))$/,oV=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Uf=oV,wf=/^[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])?)*$/,bf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xG(){return new RegExp(bf,"u")}var hG=/^(?:(?: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])$/,fG=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,yG=($)=>{let I=L6($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},uG=/^((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])$/,lG=/^(([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])$/,cG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,BX=/^[A-Za-z0-9_-]*$/,Xf=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Df=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mG=/^\+(?:[0-9]){6,14}[0-9]$/,dV="(?:(?:\\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])))",rG=new RegExp(`^${dV}$`);function pV($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.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{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function nG($){return new RegExp(`^${pV($)}$`)}function iG($){let I=pV({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${dV}T(?:${b})$`)}var oG=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},dG=/^-?\d+n?$/,pG=/^-?\d+$/,tG=/^-?\d+(?:\.\d+)?/,aG=/^(?:true|false)$/i,eG=/^null$/i;var sG=/^undefined$/i;var $N=/^[^A-Z]*$/,IN=/^[^a-z]*$/,Wf=/^[0-9a-fA-F]*$/;function dU($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function pU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Qf=/^[0-9a-fA-F]{32}$/,Gf=dU(22,"=="),Nf=pU(22),Yf=/^[0-9a-fA-F]{40}$/,Bf=dU(27,"="),Jf=pU(27),Hf=/^[0-9a-fA-F]{64}$/,Af=dU(43,"="),Of=pU(43),zf=/^[0-9a-fA-F]{96}$/,Lf=dU(64,""),Kf=pU(64),vf=/^[0-9a-fA-F]{128}$/,Vf=dU(86,"=="),qf=pU(86);var A$=z("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),aV={number:"number",bigint:"bigint",object:"date"},JX=z("$ZodCheckLessThan",($,I)=>{A$.init($,I);let U=aV[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.maximum:w.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<X)if(I.inclusive)w.maximum=I.value;else w.exclusiveMaximum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value<=I.value:b.value<I.value)return;b.issues.push({origin:U,code:"too_big",maximum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),HX=z("$ZodCheckGreaterThan",($,I)=>{A$.init($,I);let U=aV[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.minimum:w.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>X)if(I.inclusive)w.minimum=I.value;else w.exclusiveMinimum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value>=I.value:b.value>I.value)return;b.issues.push({origin:U,code:"too_small",minimum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),UN=z("$ZodCheckMultipleOf",($,I)=>{A$.init($,I),$._zod.onattach.push((U)=>{var b;(b=U._zod.bag).multipleOf??(b.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):AG(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),wN=z("$ZodCheckNumberFormat",($,I)=>{A$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=VG[I.format];$._zod.onattach.push((D)=>{let W=D._zod.bag;if(W.format=I.format,W.minimum=w,W.maximum=X,U)W.pattern=pG}),$._zod.check=(D)=>{let W=D.value;if(U){if(!Number.isInteger(W)){D.issues.push({expected:b,format:I.format,code:"invalid_type",continue:!1,input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)D.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});else D.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});return}}if(W<w)D.issues.push({origin:"number",input:W,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!I.abort});if(W>X)D.issues.push({origin:"number",input:W,code:"too_big",maximum:X,inst:$})}}),bN=z("$ZodCheckBigIntFormat",($,I)=>{A$.init($,I);let[U,b]=qG[I.format];$._zod.onattach.push((w)=>{let X=w._zod.bag;X.format=I.format,X.minimum=U,X.maximum=b}),$._zod.check=(w)=>{let X=w.value;if(X<U)w.issues.push({origin:"bigint",input:X,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(X>b)w.issues.push({origin:"bigint",input:X,code:"too_big",maximum:b,inst:$})}}),XN=z("$ZodCheckMaxSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.size<=I.maximum)return;b.issues.push({origin:mU(w),code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),DN=z("$ZodCheckMinSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.size>=I.minimum)return;b.issues.push({origin:mU(w),code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),WN=z("$ZodCheckSizeEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.size,w.maximum=I.size,w.size=I.size}),$._zod.check=(b)=>{let w=b.value,X=w.size;if(X===I.size)return;let D=X>I.size;b.issues.push({origin:mU(w),...D?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),QN=z("$ZodCheckMaxLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.length<=I.maximum)return;let D=rU(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),GN=z("$ZodCheckMinLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.length>=I.minimum)return;let D=rU(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),NN=z("$ZodCheckLengthEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.length,w.maximum=I.length,w.length=I.length}),$._zod.check=(b)=>{let w=b.value,X=w.length;if(X===I.length)return;let D=rU(w),W=X>I.length;b.issues.push({origin:D,...W?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),a1=z("$ZodCheckStringFormat",($,I)=>{var U,b;if(A$.init($,I),$._zod.onattach.push((w)=>{let X=w._zod.bag;if(X.format=I.format,I.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(w)=>{if(I.pattern.lastIndex=0,I.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:I.format,input:w.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(b=$._zod).check??(b.check=()=>{})}),YN=z("$ZodCheckRegex",($,I)=>{a1.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),BN=z("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=$N),a1.init($,I)}),JN=z("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=IN),a1.init($,I)}),HN=z("$ZodCheckIncludes",($,I)=>{A$.init($,I);let U=L6(I.includes),b=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=b,$._zod.onattach.push((w)=>{let X=w._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(b)}),$._zod.check=(w)=>{if(w.value.includes(I.includes,I.position))return;w.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:w.value,inst:$,continue:!I.abort})}}),AN=z("$ZodCheckStartsWith",($,I)=>{A$.init($,I);let U=new RegExp(`^${L6(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.startsWith(I.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:b.value,inst:$,continue:!I.abort})}}),ON=z("$ZodCheckEndsWith",($,I)=>{A$.init($,I);let U=new RegExp(`.*${L6(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.endsWith(I.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:b.value,inst:$,continue:!I.abort})}});function tV($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues))}var zN=z("$ZodCheckProperty",($,I)=>{A$.init($,I),$._zod.check=(U)=>{let b=I.schema._zod.run({value:U.value[I.property],issues:[]},{});if(b instanceof Promise)return b.then((w)=>tV(w,U,I.property));tV(b,U,I.property);return}}),LN=z("$ZodCheckMimeType",($,I)=>{A$.init($,I);let U=new Set(I.mime);$._zod.onattach.push((b)=>{b._zod.bag.mime=I.mime}),$._zod.check=(b)=>{if(U.has(b.value.type))return;b.issues.push({code:"invalid_value",values:I.mime,input:b.value.type,inst:$,continue:!I.abort})}}),KN=z("$ZodCheckOverwrite",($,I)=>{A$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class AX{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
40
+ ]`;continue}if(w+=b[Q],b[Q]==="\\")X=!0;else if(D&&b[Q]==="]")D=!1;else if(!D&&b[Q]==="[")D=!0}try{new RegExp(w)}catch{return console.warn(`Could not convert regex pattern at ${I.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return w}function ew($,I){if(I.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(I.target==="openApi3"&&$.keyType?._def.typeName===M.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((b,w)=>({...b,[w]:n($.valueType._def,{...I,currentPath:[...I.currentPath,"properties",w]})??F$(I)}),{}),additionalProperties:I.rejectedAdditionalProperties};let U={type:"object",additionalProperties:n($.valueType._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]})??I.allowedAdditionalProperties};if(I.target==="openApi3")return U;if($.keyType?._def.typeName===M.ZodString&&$.keyType._def.checks?.length){let{type:b,...w}=aw($.keyType._def,I);return{...U,propertyNames:w}}else if($.keyType?._def.typeName===M.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===M.ZodBranded&&$.keyType._def.type._def.typeName===M.ZodString&&$.keyType._def.type._def.checks?.length){let{type:b,...w}=tw($.keyType._def,I);return{...U,propertyNames:w}}return U}function mO($,I){if(I.mapStrategy==="record")return ew($,I);let U=n($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||F$(I),b=n($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||F$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,b],minItems:2,maxItems:2}}}function rO($){let I=$.values,b=Object.keys($.values).filter((X)=>{return typeof I[I[X]]!=="number"}).map((X)=>I[X]),w=Array.from(new Set(b.map((X)=>typeof X)));return{type:w.length===1?w[0]==="string"?"string":"number":["string","number"],enum:b}}function nO($){return $.target==="openAi"?void 0:{not:F$({...$,currentPath:[...$.currentPath,"not"]})}}function iO($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var QU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function dO($,I){if(I.target==="openApi3")return oO($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((b)=>(b._def.typeName in QU)&&(!b._def.checks||!b._def.checks.length))){let b=U.reduce((w,X)=>{let D=QU[X._def.typeName];return D&&!w.includes(D)?[...w,D]:w},[]);return{type:b.length>1?b:b[0]}}else if(U.every((b)=>b._def.typeName==="ZodLiteral"&&!b.description)){let b=U.reduce((w,X)=>{let D=typeof X._def.value;switch(D){case"string":case"number":case"boolean":return[...w,D];case"bigint":return[...w,"integer"];case"object":if(X._def.value===null)return[...w,"null"];case"symbol":case"undefined":case"function":default:return w}},[]);if(b.length===U.length){let w=b.filter((X,D,W)=>W.indexOf(X)===D);return{type:w.length>1?w:w[0],enum:U.reduce((X,D)=>{return X.includes(D._def.value)?X:[...X,D._def.value]},[])}}}else if(U.every((b)=>b._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((b,w)=>[...b,...w._def.values.filter((X)=>!b.includes(X))],[])};return oO($,I)}var oO=($,I)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((b,w)=>n(b._def,{...I,currentPath:[...I.currentPath,"anyOf",`${w}`]})).filter((b)=>!!b&&(!I.strictUnions||typeof b==="object"&&Object.keys(b).length>0));return U.length?{anyOf:U}:void 0};function pO($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:QU[$.innerType._def.typeName],nullable:!0};return{type:[QU[$.innerType._def.typeName],"null"]}}if(I.target==="openApi3"){let b=n($.innerType._def,{...I,currentPath:[...I.currentPath]});if(b&&"$ref"in b)return{allOf:[b],nullable:!0};return b&&{...b,nullable:!0}}let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","0"]});return U&&{anyOf:[U,{type:"null"}]}}function tO($,I){let U={type:"number"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"int":U.type="integer",v8(U,"type",b.message,I);break;case"min":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"minimum",b.value,b.message,I);else b$(U,"exclusiveMinimum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMinimum=!0;b$(U,"minimum",b.value,b.message,I)}break;case"max":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"maximum",b.value,b.message,I);else b$(U,"exclusiveMaximum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMaximum=!0;b$(U,"maximum",b.value,b.message,I)}break;case"multipleOf":b$(U,"multipleOf",b.value,b.message,I);break}return U}function aO($,I){let U=I.target==="openAi",b={type:"object",properties:{}},w=[],X=$.shape();for(let W in X){let Q=X[W];if(Q===void 0||Q._def===void 0)continue;let G=pP(Q);if(G&&U){if(Q._def.typeName==="ZodOptional")Q=Q._def.innerType;if(!Q.isNullable())Q=Q.nullable();G=!1}let N=n(Q._def,{...I,currentPath:[...I.currentPath,"properties",W],propertyPath:[...I.currentPath,"properties",W]});if(N===void 0)continue;if(b.properties[W]=N,!G)w.push(W)}if(w.length)b.required=w;let D=dP($,I);if(D!==void 0)b.additionalProperties=D;return b}function dP($,I){if($.catchall._def.typeName!=="ZodNever")return n($.catchall._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return I.allowedAdditionalProperties;case"strict":return I.rejectedAdditionalProperties;case"strip":return I.removeAdditionalStrategy==="strict"?I.allowedAdditionalProperties:I.rejectedAdditionalProperties}}function pP($){try{return $.isOptional()}catch{return!0}}var eO=($,I)=>{if(I.currentPath.toString()===I.propertyPath?.toString())return n($.innerType._def,I);let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","1"]});return U?{anyOf:[{not:F$(I)},U]}:F$(I)};var sO=($,I)=>{if(I.pipeStrategy==="input")return n($.in._def,I);else if(I.pipeStrategy==="output")return n($.out._def,I);let U=n($.in._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),b=n($.out._def,{...I,currentPath:[...I.currentPath,"allOf",U?"1":"0"]});return{allOf:[U,b].filter((w)=>w!==void 0)}};function $z($,I){return n($.type._def,I)}function Iz($,I){let b={type:"array",uniqueItems:!0,items:n($.valueType._def,{...I,currentPath:[...I.currentPath,"items"]})};if($.minSize)b$(b,"minItems",$.minSize.value,$.minSize.message,I);if($.maxSize)b$(b,"maxItems",$.maxSize.value,$.maxSize.message,I);return b}function Uz($,I){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((U,b)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${b}`]})).reduce((U,b)=>b===void 0?U:[...U,b],[]),additionalItems:n($.rest._def,{...I,currentPath:[...I.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((U,b)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${b}`]})).reduce((U,b)=>b===void 0?U:[...U,b],[])}}function wz($){return{not:F$($)}}function bz($){return F$($)}var Xz=($,I)=>{return n($.innerType._def,I)};var Dz=($,I,U)=>{switch(I){case M.ZodString:return aw($,U);case M.ZodNumber:return tO($,U);case M.ZodObject:return aO($,U);case M.ZodBigInt:return CO($,U);case M.ZodBoolean:return gO();case M.ZodDate:return V8($,U);case M.ZodUndefined:return wz(U);case M.ZodNull:return iO(U);case M.ZodArray:return ZO($,U);case M.ZodUnion:case M.ZodDiscriminatedUnion:return dO($,U);case M.ZodIntersection:return uO($,U);case M.ZodTuple:return Uz($,U);case M.ZodRecord:return ew($,U);case M.ZodLiteral:return lO($,U);case M.ZodEnum:return yO($);case M.ZodNativeEnum:return rO($);case M.ZodNullable:return pO($,U);case M.ZodOptional:return eO($,U);case M.ZodMap:return mO($,U);case M.ZodSet:return Iz($,U);case M.ZodLazy:return()=>$.getter()._def;case M.ZodPromise:return $z($,U);case M.ZodNaN:case M.ZodNever:return nO(U);case M.ZodEffects:return fO($,U);case M.ZodAny:return F$(U);case M.ZodUnknown:return bz(U);case M.ZodDefault:return hO($,U);case M.ZodBranded:return tw($,U);case M.ZodReadonly:return Xz($,U);case M.ZodCatch:return xO($,U);case M.ZodPipeline:return sO($,U);case M.ZodFunction:case M.ZodVoid:case M.ZodSymbol:return;default:return((b)=>{return})(I)}};function n($,I,U=!1){let b=I.seen.get($);if(I.override){let W=I.override?.($,I,b,U);if(W!==RO)return W}if(b&&!U){let W=tP(b,I);if(W!==void 0)return W}let w={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,w);let X=Dz($,$.typeName,I),D=typeof X==="function"?n(X(),I):X;if(D)aP($,I,D);if(I.postProcess){let W=I.postProcess(D,$,I);return w.jsonSchema=D,W}return w.jsonSchema=D,D}var tP=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:pw(I.currentPath,$.path)};case"none":case"seen":{if($.path.length<I.currentPath.length&&$.path.every((U,b)=>I.currentPath[b]===U))return console.warn(`Recursive reference detected at ${I.currentPath.join("/")}! Defaulting to any`),F$(I);return I.$refStrategy==="seen"?F$(I):void 0}}},aP=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var M8=($,I)=>{let U=_O(I),b=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((Q,[G,N])=>({...Q,[G]:n(N._def,{...U,currentPath:[...U.basePath,U.definitionPath,G]},!0)??F$(U)}),{}):void 0,w=typeof I==="string"?I:I?.nameStrategy==="title"?void 0:I?.name,X=n($._def,w===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,w]},!1)??F$(U),D=typeof I==="object"&&I.name!==void 0&&I.nameStrategy==="title"?I.name:void 0;if(D!==void 0)X.title=D;if(U.flags.hasReferencedOpenAiAnyType){if(!b)b={};if(!b[U.openAiAnyTypeName])b[U.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:U.$refStrategy==="relative"?"1":[...U.basePath,U.definitionPath,U.openAiAnyTypeName].join("/")}}}let W=w===void 0?b?{...X,[U.definitionPath]:b}:X:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,w].join("/"),[U.definitionPath]:{...b,[w]:X}};if(U.target==="jsonSchema7")W.$schema="http://json-schema.org/draft-07/schema#";else if(U.target==="jsonSchema2019-09"||U.target==="openAi")W.$schema="https://json-schema.org/draft/2019-09/schema#";if(U.target==="openAi"&&(("anyOf"in W)||("oneOf"in W)||("allOf"in W)||("type"in W)&&Array.isArray(W.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return W};function eP($){if(!$)return"draft-7";if($==="jsonSchema7"||$==="draft-7")return"draft-7";if($==="jsonSchema2019-09"||$==="draft-2020-12")return"draft-2020-12";return"draft-7"}function j8($,I){if(J6($))return i9($,{target:eP(I?.target),io:I?.pipeStrategy??"input"});return M8($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function E8($){let U=J4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Mw(U);if(typeof b!=="string")throw new Error("Schema method literal must be a string");return b}function S8($,I){let U=B4($,I);if(!U.success)throw U.error;return U.data}var sP=60000;class P8{constructor($){if(this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Tw,(I)=>{this._oncancel(I)}),this.setNotificationHandler(Zw,(I)=>{this._onprogress(I)}),this.setRequestHandler(_w,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(Cw,async(I,U)=>{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new h(c.InvalidParams,"Failed to retrieve task: Task not found");return{...b}}),this.setRequestHandler(xw,async(I,U)=>{let b=async()=>{let w=I.params.taskId;if(this._taskMessageQueue){let D;while(D=await this._taskMessageQueue.dequeue(w,U.sessionId)){if(D.type==="response"||D.type==="error"){let W=D.message,Q=W.id,G=this._requestResolvers.get(Q);if(G)if(this._requestResolvers.delete(Q),D.type==="response")G(W);else{let N=W,B=new h(N.error.code,N.error.message,N.error.data);G(B)}else{let N=D.type==="response"?"Response":"Error";this._onerror(new Error(`${N} handler missing for request ${Q}`))}continue}await this._transport?.send(D.message,{relatedRequestId:U.requestId})}}let X=await this._taskStore.getTask(w,U.sessionId);if(!X)throw new h(c.InvalidParams,`Task not found: ${w}`);if(!A4(X.status))return await this._waitForTaskUpdate(w,U.signal),await b();if(A4(X.status)){let D=await this._taskStore.getTaskResult(w,U.sessionId);return this._clearTaskQueue(w),{...D,_meta:{...D._meta,[H4]:{taskId:w}}}}return await b()};return await b()}),this.setRequestHandler(hw,async(I,U)=>{try{let{tasks:b,nextCursor:w}=await this._taskStore.listTasks(I.params?.cursor,U.sessionId);return{tasks:b,nextCursor:w,_meta:{}}}catch(b){throw new h(c.InvalidParams,`Failed to list tasks: ${b instanceof Error?b.message:String(b)}`)}}),this.setRequestHandler(yw,async(I,U)=>{try{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new h(c.InvalidParams,`Task not found: ${I.params.taskId}`);if(A4(b.status))throw new h(c.InvalidParams,`Cannot cancel task in terminal status: ${b.status}`);await this._taskStore.updateTaskStatus(I.params.taskId,"cancelled","Client cancelled task execution.",U.sessionId),this._clearTaskQueue(I.params.taskId);let w=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!w)throw new h(c.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...w}}catch(b){if(b instanceof h)throw b;throw new h(c.InvalidRequest,`Failed to cancel task: ${b instanceof Error?b.message:String(b)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,I,U,b,w=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(b,I),startTime:Date.now(),timeout:I,maxTotalTimeout:U,resetTimeoutOnProgress:w,onTimeout:b})}_resetTimeout($){let I=this._timeoutInfo.get($);if(!I)return!1;let U=Date.now()-I.startTime;if(I.maxTotalTimeout&&U>=I.maxTotalTimeout)throw this._timeoutInfo.delete($),h.fromError(c.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:I.maxTotalTimeout,totalElapsed:U});return clearTimeout(I.timeoutId),I.timeoutId=setTimeout(I.onTimeout,I.timeout),!0}_cleanupTimeout($){let I=this._timeoutInfo.get($);if(I)clearTimeout(I.timeoutId),this._timeoutInfo.delete($)}async connect($){this._transport=$;let I=this.transport?.onclose;this._transport.onclose=()=>{I?.(),this._onclose()};let U=this.transport?.onerror;this._transport.onerror=(w)=>{U?.(w),this._onerror(w)};let b=this._transport?.onmessage;this._transport.onmessage=(w,X)=>{if(b?.(w,X),$U(w)||zO(w))this._onresponse(w);else if(X8(w))this._onrequest(w,X);else if(OO(w))this._onnotification(w);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(w)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let I=h.fromError(c.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let U of $.values())U(I)}_onerror($){this.onerror?.($)}_onnotification($){let I=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(I===void 0)return;Promise.resolve().then(()=>I($)).catch((U)=>this._onerror(new Error(`Uncaught error in notification handler: ${U}`)))}_onrequest($,I){let U=this._requestHandlers.get($.method)??this.fallbackRequestHandler,b=this._transport,w=$.params?._meta?.[H4]?.taskId;if(U===void 0){let G={jsonrpc:"2.0",id:$.id,error:{code:c.MethodNotFound,message:"Method not found"}};if(w&&this._taskMessageQueue)this._enqueueTaskMessage(w,{type:"error",message:G,timestamp:Date.now()},b?.sessionId).catch((N)=>this._onerror(new Error(`Failed to enqueue error response: ${N}`)));else b?.send(G).catch((N)=>this._onerror(new Error(`Failed to send an error response: ${N}`)));return}let X=new AbortController;this._requestHandlerAbortControllers.set($.id,X);let D=JO($.params)?$.params.task:void 0,W=this._taskStore?this.requestTaskStore($,b?.sessionId):void 0,Q={signal:X.signal,sessionId:b?.sessionId,_meta:$.params?._meta,sendNotification:async(G)=>{let N={relatedRequestId:$.id};if(w)N.relatedTask={taskId:w};await this.notification(G,N)},sendRequest:async(G,N,B)=>{let H={...B,relatedRequestId:$.id};if(w&&!H.relatedTask)H.relatedTask={taskId:w};let J=H.relatedTask?.taskId??w;if(J&&W)await W.updateTaskStatus(J,"input_required");return await this.request(G,N,H)},authInfo:I?.authInfo,requestId:$.id,requestInfo:I?.requestInfo,taskId:w,taskStore:W,taskRequestedTtl:D?.ttl,closeSSEStream:I?.closeSSEStream,closeStandaloneSSEStream:I?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(D)this.assertTaskHandlerCapability($.method)}).then(()=>U($,Q)).then(async(G)=>{if(X.signal.aborted)return;let N={result:G,jsonrpc:"2.0",id:$.id};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"response",message:N,timestamp:Date.now()},b?.sessionId);else await b?.send(N)},async(G)=>{if(X.signal.aborted)return;let N={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(G.code)?G.code:c.InternalError,message:G.message??"Internal error",...G.data!==void 0&&{data:G.data}}};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"error",message:N,timestamp:Date.now()},b?.sessionId);else await b?.send(N)}).catch((G)=>this._onerror(new Error(`Failed to send response: ${G}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:I,...U}=$.params,b=Number(I),w=this._progressHandlers.get(b);if(!w){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let X=this._responseHandlers.get(b),D=this._timeoutInfo.get(b);if(D&&X&&D.resetTimeoutOnProgress)try{this._resetTimeout(b)}catch(W){this._responseHandlers.delete(b),this._progressHandlers.delete(b),this._cleanupTimeout(b),X(W);return}w(U)}_onresponse($){let I=Number($.id),U=this._requestResolvers.get(I);if(U){if(this._requestResolvers.delete(I),$U($))U($);else{let X=new h($.error.code,$.error.message,$.error.data);U(X)}return}let b=this._responseHandlers.get(I);if(b===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(I),this._cleanupTimeout(I);let w=!1;if($U($)&&$.result&&typeof $.result==="object"){let X=$.result;if(X.task&&typeof X.task==="object"){let D=X.task;if(typeof D.taskId==="string")w=!0,this._taskProgressTokens.set(D.taskId,I)}}if(!w)this._progressHandlers.delete(I);if($U($))b($);else{let X=h.fromError($.error.code,$.error.message,$.error.data);b(X)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,I,U){let{task:b}=U??{};if(!b){try{yield{type:"result",result:await this.request($,I,U)}}catch(X){yield{type:"error",error:X instanceof h?X:new h(c.InternalError,String(X))}}return}let w;try{let X=await this.request($,M1,U);if(X.task)w=X.task.taskId,yield{type:"taskCreated",task:X.task};else throw new h(c.InternalError,"Task creation did not return a task");while(!0){let D=await this.getTask({taskId:w},U);if(yield{type:"taskStatus",task:D},A4(D.status)){if(D.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:w},I,U)};else if(D.status==="failed")yield{type:"error",error:new h(c.InternalError,`Task ${w} failed`)};else if(D.status==="cancelled")yield{type:"error",error:new h(c.InternalError,`Task ${w} was cancelled`)};return}if(D.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:w},I,U)};return}let W=D.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((Q)=>setTimeout(Q,W)),U?.signal?.throwIfAborted()}}catch(X){yield{type:"error",error:X instanceof h?X:new h(c.InternalError,String(X))}}}request($,I,U){let{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X,task:D,relatedTask:W}=U??{};return new Promise((Q,G)=>{let N=(q)=>{G(q)};if(!this._transport){N(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),D)this.assertTaskCapability($.method)}catch(q){N(q);return}U?.signal?.throwIfAborted();let B=this._requestMessageId++,H={...$,jsonrpc:"2.0",id:B};if(U?.onprogress)this._progressHandlers.set(B,U.onprogress),H.params={...$.params,_meta:{...$.params?._meta||{},progressToken:B}};if(D)H.params={...H.params,task:D};if(W)H.params={...H.params,_meta:{...H.params?._meta||{},[H4]:W}};let J=(q)=>{this._responseHandlers.delete(B),this._progressHandlers.delete(B),this._cleanupTimeout(B),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:B,reason:String(q)}},{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((P)=>this._onerror(new Error(`Failed to send cancellation: ${P}`)));let k=q instanceof h?q:new h(c.RequestTimeout,String(q));G(k)};this._responseHandlers.set(B,(q)=>{if(U?.signal?.aborted)return;if(q instanceof Error)return G(q);try{let k=B4(I,q.result);if(!k.success)G(k.error);else Q(k.data)}catch(k){G(k)}}),U?.signal?.addEventListener("abort",()=>{J(U?.signal?.reason)});let A=U?.timeout??sP,O=()=>J(h.fromError(c.RequestTimeout,"Request timed out",{timeout:A}));this._setupTimeout(B,A,U?.maxTotalTimeout,O,U?.resetTimeoutOnProgress??!1);let V=W?.taskId;if(V){let q=(k)=>{let P=this._responseHandlers.get(B);if(P)P(k);else this._onerror(new Error(`Response handler missing for side-channeled request ${B}`))};this._requestResolvers.set(B,q),this._enqueueTaskMessage(V,{type:"request",message:H,timestamp:Date.now()}).catch((k)=>{this._cleanupTimeout(B),G(k)})}else this._transport.send(H,{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((q)=>{this._cleanupTimeout(B),G(q)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},gw,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},fw,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},vO,I)}async notification($,I){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let U=I?.relatedTask?.taskId;if(U){let D={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[H4]:I.relatedTask}}};await this._enqueueTaskMessage(U,{type:"notification",message:D,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!I?.relatedRequestId&&!I?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let D={...$,jsonrpc:"2.0"};if(I?.relatedTask)D={...D,params:{...D.params,_meta:{...D.params?._meta||{},[H4]:I.relatedTask}}};this._transport?.send(D,I).catch((W)=>this._onerror(W))});return}let X={...$,jsonrpc:"2.0"};if(I?.relatedTask)X={...X,params:{...X.params,_meta:{...X.params?._meta||{},[H4]:I.relatedTask}}};await this._transport.send(X,I)}setRequestHandler($,I){let U=E8($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(b,w)=>{let X=S8($,b);return Promise.resolve(I(X,w))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw new Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,I){let U=E8($);this._notificationHandlers.set(U,(b)=>{let w=S8($,b);return Promise.resolve(I(w))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let I=this._taskProgressTokens.get($);if(I!==void 0)this._progressHandlers.delete(I),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,I,U){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let b=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,I,U,b)}async _clearTaskQueue($,I){if(this._taskMessageQueue){let U=await this._taskMessageQueue.dequeueAll($,I);for(let b of U)if(b.type==="request"&&X8(b.message)){let w=b.message.id,X=this._requestResolvers.get(w);if(X)X(new h(c.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(w);else this._onerror(new Error(`Resolver missing for request ${w} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,I){let U=this._options?.defaultTaskPollInterval??1000;try{let b=await this._taskStore?.getTask($);if(b?.pollInterval)U=b.pollInterval}catch{}return new Promise((b,w)=>{if(I.aborted){w(new h(c.InvalidRequest,"Request cancelled"));return}let X=setTimeout(b,U);I.addEventListener("abort",()=>{clearTimeout(X),w(new h(c.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,I){let U=this._taskStore;if(!U)throw new Error("No task store configured");return{createTask:async(b)=>{if(!$)throw new Error("No request provided");return await U.createTask(b,$.id,{method:$.method,params:$.params},I)},getTask:async(b)=>{let w=await U.getTask(b,I);if(!w)throw new h(c.InvalidParams,"Failed to retrieve task: Task not found");return w},storeTaskResult:async(b,w,X)=>{await U.storeTaskResult(b,w,X,I);let D=await U.getTask(b,I);if(D){let W=XU.parse({method:"notifications/tasks/status",params:D});if(await this.notification(W),A4(D.status))this._cleanupTaskProgressHandler(b)}},getTaskResult:(b)=>{return U.getTaskResult(b,I)},updateTaskStatus:async(b,w,X)=>{let D=await U.getTask(b,I);if(!D)throw new h(c.InvalidParams,`Task "${b}" not found - it may have been cleaned up`);if(A4(D.status))throw new h(c.InvalidParams,`Cannot update task "${b}" from terminal status "${D.status}" to "${w}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await U.updateTaskStatus(b,w,X,I);let W=await U.getTask(b,I);if(W){let Q=XU.parse({method:"notifications/tasks/status",params:W});if(await this.notification(Q),A4(W.status))this._cleanupTaskProgressHandler(b)}},listTasks:(b)=>{return U.listTasks(b,I)}}}}function Wz($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function Qz($,I){let U={...$};for(let b in I){let w=b,X=I[w];if(X===void 0)continue;let D=U[w];if(Wz(D)&&Wz(X))U[w]={...D,...X};else U[w]=X}return U}var yv=LH(qQ(),1),uv=LH(fv(),1);function Qx(){let $=new yv.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return uv.default($),$}class _Q{constructor($){this._ajv=$??Qx()}getValidator($){let I="$id"in $&&typeof $.$id==="string"?this._ajv.getSchema($.$id)??this._ajv.compile($):this._ajv.compile($);return(U)=>{if(I(U))return{valid:!0,data:U,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(I.errors)}}}}class ZQ{constructor($){this._server=$}requestStream($,I,U){return this._server.requestStream($,I,U)}async getTask($,I){return this._server.getTask({taskId:$},I)}async getTaskResult($,I,U){return this._server.getTaskResult({taskId:$},I,U)}async listTasks($,I){return this._server.listTasks($?{cursor:$}:void 0,I)}async cancelTask($,I){return this._server.cancelTask({taskId:$},I)}}function lv($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"tools/call":if(!$.tools?.call)throw new Error(`${U} does not support task creation for tools/call (required for ${I})`);break;default:break}}function cv($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"sampling/createMessage":if(!$.sampling?.createMessage)throw new Error(`${U} does not support task creation for sampling/createMessage (required for ${I})`);break;case"elicitation/create":if(!$.elicitation?.create)throw new Error(`${U} does not support task creation for elicitation/create (required for ${I})`);break;default:break}}class CQ extends P8{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(WU.options.map((U,b)=>[U,b])),this.isMessageIgnored=(U,b)=>{let w=this._loggingLevels.get(b);return w?this.LOG_LEVEL_SEVERITY.get(U)<this.LOG_LEVEL_SEVERITY.get(w):!1},this._capabilities=I?.capabilities??{},this._instructions=I?.instructions,this._jsonSchemaValidator=I?.jsonSchemaValidator??new _Q,this.setRequestHandler(Q8,(U)=>this._oninitialize(U)),this.setNotificationHandler(G8,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(O8,async(U,b)=>{let w=b.sessionId||b.requestInfo?.headers["mcp-session-id"]||void 0,{level:X}=U.params,D=WU.safeParse(X);if(D.success)this._loggingLevels.set(w,D.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new ZQ(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Qz(this._capabilities,$)}setRequestHandler($,I){let b=J4($)?.method;if(!b)throw new Error("Schema is missing a method literal");let w;if(J6(b)){let D=b;w=D._zod?.def?.value??D.value}else{let D=b;w=D._def?.value??D.value}if(typeof w!=="string")throw new Error("Schema method literal must be a string");if(w==="tools/call"){let D=async(W,Q)=>{let G=B4(E1,W);if(!G.success){let J=G.error instanceof Error?G.error.message:String(G.error);throw new h(c.InvalidParams,`Invalid tools/call request: ${J}`)}let{params:N}=G.data,B=await Promise.resolve(I(W,Q));if(N.task){let J=B4(M1,B);if(!J.success){let A=J.error instanceof Error?J.error.message:String(J.error);throw new h(c.InvalidParams,`Invalid task creation result: ${A}`)}return J.data}let H=B4(iw,B);if(!H.success){let J=H.error instanceof Error?H.error.message:String(H.error);throw new h(c.InvalidParams,`Invalid tools/call result: ${J}`)}return H.data};return super.setRequestHandler($,D)}return super.setRequestHandler($,I)}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){if(!this._capabilities)return;switch($){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${$})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${$})`);break;case"ping":case"initialize":break}}assertTaskCapability($){cv(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;lv(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:NO.includes(I)?I:w8,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Rw)}async createMessage($,I){if($.tools||$.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.")}if($.messages.length>0){let U=$.messages[$.messages.length-1],b=Array.isArray(U.content)?U.content:[U.content],w=b.some((Q)=>Q.type==="tool_result"),X=$.messages.length>1?$.messages[$.messages.length-2]:void 0,D=X?Array.isArray(X.content)?X.content:[X.content]:[],W=D.some((Q)=>Q.type==="tool_use");if(w){if(b.some((Q)=>Q.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!W)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(W){let Q=new Set(D.filter((N)=>N.type==="tool_use").map((N)=>N.id)),G=new Set(b.filter((N)=>N.type==="tool_result").map((N)=>N.toolUseId));if(Q.size!==G.size||![...Q].every((N)=>G.has(N)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if($.tools)return this.request({method:"sampling/createMessage",params:$},L8,I);return this.request({method:"sampling/createMessage",params:$},z8,I)}async elicitInput($,I){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let b=$;return this.request({method:"elicitation/create",params:b},ow,I)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let b=$.mode==="form"?$:{...$,mode:"form"},w=await this.request({method:"elicitation/create",params:b},ow,I);if(w.action==="accept"&&w.content&&b.requestedSchema)try{let D=this._jsonSchemaValidator.getValidator(b.requestedSchema)(w.content);if(!D.valid)throw new h(c.InvalidParams,`Elicitation response content does not match requested schema: ${D.errorMessage}`)}catch(X){if(X instanceof h)throw X;throw new h(c.InternalError,`Error validating elicitation response: ${X instanceof Error?X.message:String(X)}`)}return w}}}createElicitationCompletionNotifier($,I){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},I)}async listRoots($,I){return this.request({method:"roots/list",params:$},K8,I)}async sendLoggingMessage($,I){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,I))return this.notification({method:"notifications/message",params:$})}}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var rv=Symbol.for("mcp.completable");function gQ($){return!!$&&typeof $==="object"&&rv in $}function nv($){return $[rv]?.complete}var mv;(function($){$.Completable="McpCompletable"})(mv||(mv={}));var Gx=/^[A-Za-z0-9._-]{1,128}$/;function Nx($){let I=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))I.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))I.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))I.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))I.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Gx.test($)){let U=$.split("").filter((b)=>!/[A-Za-z0-9._-]/.test(b)).filter((b,w,X)=>X.indexOf(b)===w);return I.push(`Tool name contains invalid characters: ${U.map((b)=>`"${b}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:I}}return{isValid:!0,warnings:I}}function Yx($,I){if(I.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let U of I)console.warn(` - ${U}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function xQ($){let I=Nx($);return Yx($,I.warnings),I.isValid}class hQ{constructor($){this._mcpServer=$}registerToolTask($,I,U){let b={taskSupport:"required",...I.execution};if(b.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${$}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool($,I.title,I.description,I.inputSchema,I.outputSchema,I.annotations,b,I._meta,U)}}class yQ{constructor($,I){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new CQ($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new hQ(this)};return this._experimental}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(nw)),this.server.assertCanSetRequestHandler(F4(E1)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(nw,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let b=q1(I.inputSchema);return b?j8(b,{strictUnions:!0,pipeStrategy:"input"}):Bx})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let b=q1(I.outputSchema);if(b)U.outputSchema=j8(b,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(E1,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new h(c.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Tool ${$.params.name} disabled`);let b=!!$.params.task,w=U.execution?.taskSupport,X="createTask"in U.handler;if((w==="required"||w==="optional")&&!X)throw new h(c.InternalError,`Tool ${$.params.name} has taskSupport '${w}' but was not registered with registerToolTask`);if(w==="required"&&!b)throw new h(c.MethodNotFound,`Tool ${$.params.name} requires task augmentation (taskSupport: 'required')`);if(w==="optional"&&!b&&X)return await this.handleAutomaticTaskPolling(U,$,I);let D=await this.validateToolInput(U,$.params.arguments,$.params.name),W=await this.executeToolHandler(U,D,I);if(b)return W;return await this.validateToolOutput(U,W,$.params.name),W}catch(U){if(U instanceof h){if(U.code===c.UrlElicitationRequired)throw U}return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,I,U){if(!$.inputSchema)return;let w=q1($.inputSchema)??$.inputSchema,X=await qw(w,I);if(!X.success){let D="error"in X?X.error:"Unknown error",W=Fw(D);throw new h(c.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${W}`)}return X.data}async validateToolOutput($,I,U){if(!$.outputSchema)return;if(!("content"in I))return;if(I.isError)return;if(!I.structuredContent)throw new h(c.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let b=q1($.outputSchema),w=await qw(b,I.structuredContent);if(!w.success){let X="error"in w?w.error:"Unknown error",D=Fw(X);throw new h(c.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${D}`)}}async executeToolHandler($,I,U){let b=$.handler;if("createTask"in b){if(!U.taskStore)throw new Error("No task store provided.");let X={...U,taskStore:U.taskStore};if($.inputSchema){let D=b;return await Promise.resolve(D.createTask(I,X))}else{let D=b;return await Promise.resolve(D.createTask(X))}}if($.inputSchema){let X=b;return await Promise.resolve(X(I,U))}else{let X=b;return await Promise.resolve(X(U))}}async handleAutomaticTaskPolling($,I,U){if(!U.taskStore)throw new Error("No task store provided for task-capable tool.");let b=await this.validateToolInput($,I.params.arguments,I.params.name),w=$.handler,X={...U,taskStore:U.taskStore},D=b?await Promise.resolve(w.createTask(b,X)):await Promise.resolve(w.createTask(X)),W=D.task.taskId,Q=D.task,G=Q.pollInterval??5000;while(Q.status!=="completed"&&Q.status!=="failed"&&Q.status!=="cancelled"){await new Promise((B)=>setTimeout(B,G));let N=await U.taskStore.getTask(W);if(!N)throw new h(c.InternalError,`Task ${W} not found during polling`);Q=N}return await U.taskStore.getTaskResult(W)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(F4(dw)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(dw,async($)=>{switch($.params.ref.type){case"ref/prompt":return EO($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return SO($),this.handleResourceCompletion($,$.params.ref);default:throw new h(c.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new h(c.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return _U;let w=J4(U.argsSchema)?.[$.params.argument.name];if(!gQ(w))return _U;let X=nv(w);if(!X)return _U;let D=await X($.params.argument.value,$.params.context);return ov(D)}async handleResourceCompletion($,I){let U=Object.values(this._registeredResourceTemplates).find((X)=>X.resourceTemplate.uriTemplate.toString()===I.uri);if(!U){if(this._registeredResources[I.uri])return _U;throw new h(c.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let b=U.resourceTemplate.completeCallback($.params.argument.name);if(!b)return _U;let w=await b($.params.argument.value,$.params.context);return ov(w)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(uw)),this.server.assertCanSetRequestHandler(F4(lw)),this.server.assertCanSetRequestHandler(F4(cw)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(uw,async($,I)=>{let U=Object.entries(this._registeredResources).filter(([w,X])=>X.enabled).map(([w,X])=>({uri:w,name:X.name,...X.metadata})),b=[];for(let w of Object.values(this._registeredResourceTemplates)){if(!w.resourceTemplate.listCallback)continue;let X=await w.resourceTemplate.listCallback(I);for(let D of X.resources)b.push({...w.metadata,...D})}return{resources:[...U,...b]}}),this.server.setRequestHandler(lw,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(cw,async($,I)=>{let U=new URL($.params.uri),b=this._registeredResources[U.toString()];if(b){if(!b.enabled)throw new h(c.InvalidParams,`Resource ${U} disabled`);return b.readCallback(U,I)}for(let w of Object.values(this._registeredResourceTemplates)){let X=w.resourceTemplate.uriTemplate.match(U.toString());if(X)return w.readCallback(U,X,I)}throw new h(c.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(mw)),this.server.assertCanSetRequestHandler(F4(rw)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(mw,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?Hx(I.argsSchema):void 0}})})),this.server.setRequestHandler(rw,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new h(c.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let b=q1(U.argsSchema),w=await qw(b,$.params.arguments);if(!w.success){let W="error"in w?w.error:"Unknown error",Q=Fw(W);throw new h(c.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${Q}`)}let X=w.data,D=U.callback;return await Promise.resolve(D(X,I))}else{let b=U.callback;return await Promise.resolve(b(I))}}),this._promptHandlersInitialized=!0}resource($,I,...U){let b;if(typeof U[0]==="object")b=U.shift();let w=U[0];if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let X=this._createRegisteredResource($,void 0,I,b,w);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let X=this._createRegisteredResourceTemplate($,void 0,I,b,w);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}}registerResource($,I,U,b){if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let w=this._createRegisteredResource($,U.title,I,U,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let w=this._createRegisteredResourceTemplate($,U.title,I,U,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}}_createRegisteredResource($,I,U,b,w){let X={name:$,title:I,metadata:b,readCallback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({uri:null}),update:(D)=>{if(typeof D.uri!=="undefined"&&D.uri!==U){if(delete this._registeredResources[U],D.uri)this._registeredResources[D.uri]=X}if(typeof D.name!=="undefined")X.name=D.name;if(typeof D.title!=="undefined")X.title=D.title;if(typeof D.metadata!=="undefined")X.metadata=D.metadata;if(typeof D.callback!=="undefined")X.readCallback=D.callback;if(typeof D.enabled!=="undefined")X.enabled=D.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=X,X}_createRegisteredResourceTemplate($,I,U,b,w){let X={resourceTemplate:U,title:I,metadata:b,readCallback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Q)=>{if(typeof Q.name!=="undefined"&&Q.name!==$){if(delete this._registeredResourceTemplates[$],Q.name)this._registeredResourceTemplates[Q.name]=X}if(typeof Q.title!=="undefined")X.title=Q.title;if(typeof Q.template!=="undefined")X.resourceTemplate=Q.template;if(typeof Q.metadata!=="undefined")X.metadata=Q.metadata;if(typeof Q.callback!=="undefined")X.readCallback=Q.callback;if(typeof Q.enabled!=="undefined")X.enabled=Q.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=X;let D=U.uriTemplate.variableNames;if(Array.isArray(D)&&D.some((Q)=>!!U.completeCallback(Q)))this.setCompletionRequestHandler();return X}_createRegisteredPrompt($,I,U,b,w){let X={title:I,description:U,argsSchema:b===void 0?void 0:o4(b),callback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(D)=>{if(typeof D.name!=="undefined"&&D.name!==$){if(delete this._registeredPrompts[$],D.name)this._registeredPrompts[D.name]=X}if(typeof D.title!=="undefined")X.title=D.title;if(typeof D.description!=="undefined")X.description=D.description;if(typeof D.argsSchema!=="undefined")X.argsSchema=o4(D.argsSchema);if(typeof D.callback!=="undefined")X.callback=D.callback;if(typeof D.enabled!=="undefined")X.enabled=D.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=X,b){if(Object.values(b).some((W)=>{let Q=W instanceof B6?W._def?.innerType:W;return gQ(Q)}))this.setCompletionRequestHandler()}return X}_createRegisteredTool($,I,U,b,w,X,D,W,Q){xQ($);let G={title:I,description:U,inputSchema:iv(b),outputSchema:iv(w),annotations:X,execution:D,_meta:W,handler:Q,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({name:null}),update:(N)=>{if(typeof N.name!=="undefined"&&N.name!==$){if(typeof N.name==="string")xQ(N.name);if(delete this._registeredTools[$],N.name)this._registeredTools[N.name]=G}if(typeof N.title!=="undefined")G.title=N.title;if(typeof N.description!=="undefined")G.description=N.description;if(typeof N.paramsSchema!=="undefined")G.inputSchema=o4(N.paramsSchema);if(typeof N.outputSchema!=="undefined")G.outputSchema=o4(N.outputSchema);if(typeof N.callback!=="undefined")G.handler=N.callback;if(typeof N.annotations!=="undefined")G.annotations=N.annotations;if(typeof N._meta!=="undefined")G._meta=N._meta;if(typeof N.enabled!=="undefined")G.enabled=N.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=G,this.setToolRequestHandlers(),this.sendToolListChanged(),G}tool($,...I){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let U,b,w,X;if(typeof I[0]==="string")U=I.shift();if(I.length>1){let W=I[0];if(fQ(W)){if(b=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!fQ(I[0]))X=I.shift()}else if(typeof W==="object"&&W!==null)X=I.shift()}let D=I[0];return this._createRegisteredTool($,void 0,U,b,w,X,{taskSupport:"forbidden"},void 0,D)}registerTool($,I,U){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let{title:b,description:w,inputSchema:X,outputSchema:D,annotations:W,_meta:Q}=I;return this._createRegisteredTool($,b,w,X,D,W,{taskSupport:"forbidden"},Q,U)}prompt($,...I){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let U;if(typeof I[0]==="string")U=I.shift();let b;if(I.length>1)b=I.shift();let w=I[0],X=this._createRegisteredPrompt($,void 0,U,b,w);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),X}registerPrompt($,I,U){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let{title:b,description:w,argsSchema:X}=I,D=this._createRegisteredPrompt($,b,w,X,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),D}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,I){return this.server.sendLoggingMessage($,I)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var Bx={type:"object",properties:{}};function dv($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Jx($){return"_def"in $||"_zod"in $||dv($)}function fQ($){if(typeof $!=="object"||$===null)return!1;if(Jx($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(dv)}function iv($){if(!$)return;if(fQ($))return o4($);return $}function Hx($){let I=J4($);if(!I)return[];return Object.entries(I).map(([U,b])=>{let w=lA(b),X=cA(b);return{name:U,description:w,required:!X}})}function F4($){let U=J4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Mw(U);if(typeof b==="string")return b;throw new Error("Schema method literal must be a string")}function ov($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var _U={completion:{values:[],hasMore:!1}};import tv from"node:process";class uQ{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
41
+ `);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),Ax(I)}clear(){this._buffer=void 0}}function Ax($){return LO.parse(JSON.parse($))}function pv($){return JSON.stringify($)+`
42
+ `}class lQ{constructor($=tv.stdin,I=tv.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new uQ,this._started=!1,this._ondata=(U)=>{this._readBuffer.append(U),this.processReadBuffer()},this._onerror=(U)=>{this.onerror?.(U)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let U=pv($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:Ox,defineProperty:av,getOwnPropertyDescriptor:zx,getOwnPropertyNames:ev,getPrototypeOf:Lx}=Object,Kx=Object.prototype.hasOwnProperty,T6=($,I)=>function(){return I||$[ev($)[0]]((I={exports:{}}).exports,I),I.exports},vx=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=ev(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!Kx.call($,W)&&W!==U)av($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=zx(I,W))||b.enumerable})}return $},Y$=($,I,U)=>(U=$!=null?Ox(Lx($)):{},vx(I||!$||!$.__esModule?av(U,"default",{value:$,enumerable:!0}):U,$)),sv=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(b){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},I.exports.__esModule=!0,I.exports.default=I.exports,U(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),Vx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=sv().default;function b(w,X){if(U(w)!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var W=D.call(w,X||"default");if(U(W)!="object")return W;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(w)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),qx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=sv().default,b=Vx();function w(X){var D=b(X,"string");return U(D)=="symbol"?D:D+""}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),u6=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=qx();function b(w,X,D){return(X=U(X))in w?Object.defineProperty(w,X,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[X]=D,w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),_$=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=u6();function b(X,D){var W=Object.keys(X);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(X);D&&(Q=Q.filter(function(G){return Object.getOwnPropertyDescriptor(X,G).enumerable})),W.push.apply(W,Q)}return W}function w(X){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?b(Object(W),!0).forEach(function(Q){U(X,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(W)):b(Object(W)).forEach(function(Q){Object.defineProperty(X,Q,Object.getOwnPropertyDescriptor(W,Q))})}return X}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}});function l6($){let I={subscribe(U){let b=null,w=!1,X=!1,D=!1;function W(){if(b===null){D=!0;return}if(X)return;if(X=!0,typeof b==="function")b();else if(b)b.unsubscribe()}if(b=$({next(Q){var G;if(w)return;(G=U.next)===null||G===void 0||G.call(U,Q)},error(Q){var G;if(w)return;w=!0,(G=U.error)===null||G===void 0||G.call(U,Q),W()},complete(){var Q;if(w)return;w=!0,(Q=U.complete)===null||Q===void 0||Q.call(U),W()}}),D)W();return{unsubscribe:W}},pipe(...U){return U.reduce(Fx,I)}};return I}function Fx($,I){return I($)}function cQ($){let I=new AbortController;return new Promise((b,w)=>{let X=!1;function D(){if(X)return;X=!0,W.unsubscribe()}I.signal.addEventListener("abort",()=>{w(I.signal.reason)});let W=$.subscribe({next(Q){X=!0,b(Q),D()},error(Q){w(Q)},complete(){I.abort(),D()}})})}function mQ($){return(I)=>{let U=0,b=null,w=[];function X(){if(b)return;b=I.subscribe({next(W){for(let G of w){var Q;(Q=G.next)===null||Q===void 0||Q.call(G,W)}},error(W){for(let G of w){var Q;(Q=G.error)===null||Q===void 0||Q.call(G,W)}},complete(){for(let Q of w){var W;(W=Q.complete)===null||W===void 0||W.call(Q)}}})}function D(){if(U===0&&b){let W=b;b=null,W.unsubscribe()}}return l6((W)=>{return U++,w.push(W),X(),{unsubscribe(){U--,D();let Q=w.findIndex((G)=>G===W);if(Q>-1)w.splice(Q,1)}}})}}var kd=Symbol();function hb($){let I=$,U=[],b=(D)=>{if(I!==void 0)D.next(I);U.push(D)},w=(D)=>{U.splice(U.indexOf(D),1)},X=l6((D)=>{return b(D),()=>{w(D)}});return X.next=(D)=>{if(I===D)return;I=D;for(let W of U)W.next(D)},X.get=()=>I,X}function $V($){return l6((I)=>{function U(w=0,X=$.op){let D=$.links[w];if(!D)throw new Error("No more links to execute - did you forget to add an ending link?");return D({op:X,next(Q){return U(w+1,Q)}})}return U().subscribe(I)})}var ZU={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};var IV=[ZU.BAD_GATEWAY,ZU.SERVICE_UNAVAILABLE,ZU.GATEWAY_TIMEOUT,ZU.INTERNAL_SERVER_ERROR];function M4($){return!!$&&!Array.isArray($)&&typeof $==="object"}var{create:Mx,defineProperty:wV,getOwnPropertyDescriptor:jx,getOwnPropertyNames:bV,getPrototypeOf:Ex}=Object,Sx=Object.prototype.hasOwnProperty,CU=($,I)=>function(){return I||$[bV($)[0]]((I={exports:{}}).exports,I),I.exports},Px=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=bV(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!Sx.call($,W)&&W!==U)wV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=jx(I,W))||b.enumerable})}return $},gU=($,I,U)=>(U=$!=null?Mx(Ex($)):{},Px(I||!$||!$.__esModule?wV(U,"default",{value:$,enumerable:!0}):U,$)),XV=()=>{},UV=($)=>{if(Object.freeze)Object.freeze($)};function DV($,I,U){var b;let w=I.join(".");return(b=U[w])!==null&&b!==void 0||(U[w]=new Proxy(XV,{get(X,D){if(typeof D!=="string"||D==="then")return;return DV($,[...I,D],U)},apply(X,D,W){let Q=I[I.length-1],G={args:W,path:I};if(Q==="call")G={args:W.length>=2?[W[1]]:[],path:I.slice(0,-1)};else if(Q==="apply")G={args:W.length>=2?W[1]:[],path:I.slice(0,-1)};return UV(G.args),UV(G.path),$(G)}})),U[w]}var fb=($)=>DV($,[],Object.create(null)),rQ=($)=>{return new Proxy(XV,{get(I,U){if(U==="then")return;return $(U)}})};var WV=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(b){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},I.exports.__esModule=!0,I.exports.default=I.exports,U(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),kx=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=WV().default;function b(w,X){if(U(w)!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var W=D.call(w,X||"default");if(U(W)!="object")return W;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(w)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Rx=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=WV().default,b=kx();function w(X){var D=b(X,"string");return U(D)=="symbol"?D:D+""}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),nQ=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=Rx();function b(w,X,D){return(X=U(X))in w?Object.defineProperty(w,X,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[X]=D,w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),yb=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=nQ();function b(X,D){var W=Object.keys(X);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(X);D&&(Q=Q.filter(function(G){return Object.getOwnPropertyDescriptor(X,G).enumerable})),W.push.apply(W,Q)}return W}function w(X){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?b(Object(W),!0).forEach(function(Q){U(X,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(W)):b(Object(W)).forEach(function(Q){Object.defineProperty(X,Q,Object.getOwnPropertyDescriptor(W,Q))})}return X}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),md=gU(yb(),1);var od=gU(nQ(),1);var ub=gU(yb(),1);function Cx($,I){if("error"in $){let b=I.deserialize($.error);return{ok:!1,error:ub.default(ub.default({},$),{},{error:b})}}return{ok:!0,result:ub.default(ub.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var iQ=class extends Error{constructor(){super("Unable to transform response from server")}};function oQ($,I){let U;try{U=Cx($,I)}catch(b){throw new iQ}if(!U.ok&&(!M4(U.error.error)||typeof U.error.error.code!=="number"))throw new iQ;if(U.ok&&!M4(U.result))throw new iQ;return U}var dd=gU(yb(),1);var pd=Symbol();var lb=Y$(u6(),1),f1=Y$(_$(),1);function QV($){return $ instanceof j4}function fx($){return M4($)&&M4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function yx($,I){if(typeof $==="string")return $;if(M4($)&&typeof $.message==="string")return $.message;return I}var j4=class $ extends Error{constructor(I,U){var b,w;let X=U===null||U===void 0?void 0:U.cause;super(I,{cause:X});lb.default(this,"cause",void 0),lb.default(this,"shape",void 0),lb.default(this,"data",void 0),lb.default(this,"meta",void 0),this.meta=U===null||U===void 0?void 0:U.meta,this.cause=X,this.shape=U===null||U===void 0||(b=U.result)===null||b===void 0?void 0:b.error,this.data=U===null||U===void 0||(w=U.result)===null||w===void 0?void 0:w.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(I,U={}){let b=I;if(QV(b)){if(U.meta)b.meta=f1.default(f1.default({},b.meta),U.meta);return b}if(fx(b))return new $(b.error.message,f1.default(f1.default({},U),{},{result:b}));return new $(yx(b,"Unknown error"),f1.default(f1.default({},U),{},{cause:b}))}};function cb($){let I=$;if(!I)return{input:{serialize:(U)=>U,deserialize:(U)=>U},output:{serialize:(U)=>U,deserialize:(U)=>U}};if("input"in I)return I;return{input:I,output:I}}var GV=($)=>typeof $==="function";function NV($){if($)return $;if(typeof window!=="undefined"&&GV(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&GV(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var xU=Y$(_$(),1);function mb($){return{url:$.url.toString(),fetch:$.fetch,transformer:cb($.transformer),methodOverride:$.methodOverride}}function ux($){let I={};for(let U=0;U<$.length;U++){let b=$[U];I[U]=b}return I}var lx={query:"GET",mutation:"POST",subscription:"PATCH"};function YV($){return"input"in $?$.transformer.input.serialize($.input):ux($.inputs.map((I)=>$.transformer.input.serialize(I)))}var y1=($)=>{let I=$.url.split("?"),b=I[0].replace(/\/$/,"")+"/"+$.path,w=[];if(I[1])w.push(I[1]);if("inputs"in $)w.push("batch=1");if($.type==="query"||$.type==="subscription"){let X=YV($);if(X!==void 0&&$.methodOverride!=="POST")w.push(`input=${encodeURIComponent(JSON.stringify(X))}`)}if(w.length)b+="?"+w.join("&");return b},BV=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=YV($);return I!==void 0?JSON.stringify(I):void 0},dQ=($)=>{return rb(xU.default(xU.default({},$),{},{contentTypeHeader:"application/json",getUrl:y1,getBody:BV}))},cx=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},mx=($)=>{var I;if(!($===null||$===void 0?void 0:$.aborted))return;if((I=$.throwIfAborted)===null||I===void 0||I.call($),typeof DOMException!=="undefined")throw new DOMException("AbortError","AbortError");throw new cx};async function JV($){var I;mx($.signal);let U=$.getUrl($),b=$.getBody($),w=(I=$.methodOverride)!==null&&I!==void 0?I:lx[$.type],X=await(async()=>{let W=await $.headers();if(Symbol.iterator in W)return Object.fromEntries(W);return W})(),D=xU.default(xU.default(xU.default({},$.contentTypeHeader&&w!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{"trpc-accept":$.trpcAcceptHeader}:void 0),X);return NV($.fetch)(U,{method:w,signal:$.signal,body:b,headers:D})}async function rb($){let I={},U=await JV($);I.response=U;let b=await U.json();return I.responseJSON=b,{json:b,meta:I}}function HV($){return $ instanceof Uint8Array||$ instanceof Blob}function AV($){return $ instanceof FormData}var u1=Y$(_$(),1),rx=($)=>{if("input"in $){let{input:I}=$;if(AV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return rb(u1.default(u1.default({},$),{},{contentTypeHeader:void 0,getUrl:y1,getBody:()=>I}))}if(HV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return rb(u1.default(u1.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:y1,getBody:()=>I}))}}return dQ($)};function pQ($){let I=mb($);return()=>{return(U)=>{let{op:b}=U;return l6((w)=>{let{path:X,input:D,type:W}=b;if(W==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let Q=rx(u1.default(u1.default({},I),{},{type:W,path:X,input:D,signal:b.signal,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({op:b});return $.headers}})),G=void 0;return Q.then((N)=>{G=N.meta;let B=oQ(N.json,I.transformer.output);if(!B.ok){w.error(j4.from(B.error,{meta:G}));return}w.next({context:N.meta,result:B.result}),w.complete()}).catch((N)=>{w.error(j4.from(N,{meta:G}))}),()=>{}})}}}var op=Y$(_$(),1);var tp=Y$(_$(),1);var tQ=($,...I)=>{return typeof $==="function"?$(...I):$},Ut=Y$(u6(),1);function nx(){let $,I;return{promise:new Promise((b,w)=>{$=b,I=w}),resolve:$,reject:I}}async function ix($){let I=await tQ($.url);if(!$.connectionParams)return I;let b=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+b}async function ox($){let I={method:"connectionParams",data:await tQ($)};return JSON.stringify(I)}var wt=Y$(u6(),1);var $1=Y$(u6(),1);function dx($){let{promise:I,resolve:U,reject:b}=nx();return $.addEventListener("open",()=>{$.removeEventListener("error",b),U()}),$.addEventListener("error",b),I}function px($,{intervalMs:I,pongTimeoutMs:U}){let b,w;function X(){b=setTimeout(()=>{$.send("PING"),w=setTimeout(()=>{$.close()},U)},I)}function D(){clearTimeout(b),X()}function W(){clearTimeout(w),D()}$.addEventListener("open",X),$.addEventListener("message",({data:Q})=>{if(clearTimeout(b),X(),Q==="PONG")W()}),$.addEventListener("close",()=>{clearTimeout(b),clearTimeout(w)})}var tx=class ${constructor(I){var U;if($1.default(this,"id",++$.connectCount),$1.default(this,"WebSocketPonyfill",void 0),$1.default(this,"urlOptions",void 0),$1.default(this,"keepAliveOpts",void 0),$1.default(this,"wsObservable",hb(null)),$1.default(this,"openPromise",null),this.WebSocketPonyfill=(U=I.WebSocketPonyfill)!==null&&U!==void 0?U:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=I.urlOptions,this.keepAliveOpts=I.keepAlive}get ws(){return this.wsObservable.get()}set ws(I){this.wsObservable.next(I)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var I=this;if(I.openPromise)return I.openPromise;I.id=++$.connectCount;let U=ix(I.urlOptions).then((b)=>new I.WebSocketPonyfill(b));I.openPromise=U.then(async(b)=>{if(I.ws=b,b.addEventListener("message",function({data:w}){if(w==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)px(b,I.keepAliveOpts);if(b.addEventListener("close",()=>{if(I.ws===b)I.ws=null}),await dx(b),I.urlOptions.connectionParams)b.send(await ox(I.urlOptions.connectionParams))});try{await I.openPromise}finally{I.openPromise=null}}async close(){var I=this;try{await I.openPromise}finally{var U;(U=I.ws)===null||U===void 0||U.close()}}};$1.default(tx,"connectCount",0);var bt=Y$(u6(),1),Xt=Y$(_$(),1);var aQ=Y$(u6(),1),OV=Y$(_$(),1),ax=class{constructor($){aQ.default(this,"links",void 0),aQ.default(this,"runtime",void 0),aQ.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return $V({links:this.links,op:OV.default(OV.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(mQ())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await cQ(U)).result.data}catch(U){throw j4.from(U)}}query($,I,U){return this.requestAsPromise({type:"query",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}mutation($,I,U){return this.requestAsPromise({type:"mutation",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}subscription($,I,U){return this.$request({type:"subscription",path:$,input:I,context:U.context,signal:U.signal}).subscribe({next(w){switch(w.result.type){case"state":{var X;(X=U.onConnectionStateChange)===null||X===void 0||X.call(U,w.result);break}case"started":{var D;(D=U.onStarted)===null||D===void 0||D.call(U,{context:w.context});break}case"stopped":{var W;(W=U.onStopped)===null||W===void 0||W.call(U);break}case"data":case void 0:{var Q;(Q=U.onData)===null||Q===void 0||Q.call(U,w.result.data);break}}},error(w){var X;(X=U.onError)===null||X===void 0||X.call(U,w)},complete(){var w;(w=U.onComplete)===null||w===void 0||w.call(U)}})}};var ex=Symbol.for("trpc_untypedClient"),sx={query:"query",mutate:"mutation",subscribe:"subscription"},$h=($)=>{return sx[$]};function Ih($){let I=fb(({path:U,args:b})=>{let w=[...U],X=$h(w.pop()),D=w.join(".");return $[X](D,...b)});return rQ((U)=>{if(U===ex)return $;return I[U]})}function zV($){let I=new ax($);return Ih(I)}var Zt=Y$(_$(),1);var Ct=Y$(_$(),1);var Uh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,I){function U(w){var X,D,W,Q=2;for(typeof Symbol!="undefined"&&(D=Symbol.asyncIterator,W=Symbol.iterator);Q--;){if(D&&(X=w[D])!=null)return X.call(w);if(W&&(X=w[W])!=null)return new b(X.call(w));D="@@asyncIterator",W="@@iterator"}throw new TypeError("Object is not async iterable")}function b(w){function X(D){if(Object(D)!==D)return Promise.reject(new TypeError(D+" is not an object."));var W=D.done;return Promise.resolve(D.value).then(function(Q){return{value:Q,done:W}})}return b=function D(W){this.s=W,this.n=W.next},b.prototype={s:null,n:null,next:function D(){return X(this.n.apply(this.s,arguments))},return:function D(W){var Q=this.s.return;return Q===void 0?Promise.resolve({value:W,done:!0}):X(Q.apply(this.s,arguments))},throw:function D(W){var Q=this.s.return;return Q===void 0?Promise.reject(W):X(Q.apply(this.s,arguments))}},new b(w)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),gt=Y$(Uh(),1);var xt=Y$(_$(),1);var wh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,I){function U(){var b=typeof SuppressedError=="function"?SuppressedError:function(W,Q){var G=Error();return G.name="SuppressedError",G.error=W,G.suppressed=Q,G},w={},X=[];function D(W,Q){if(Q!=null){if(Object(Q)!==Q)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(W)var G=Q[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(G===void 0&&(G=Q[Symbol.dispose||Symbol.for("Symbol.dispose")],W))var N=G;if(typeof G!="function")throw new TypeError("Object is not disposable.");N&&(G=function B(){try{N.call(Q)}catch(H){return Promise.reject(H)}}),X.push({v:Q,d:G,a:W})}else W&&X.push({d:Q,a:W});return Q}return{e:w,u:D.bind(null,!1),a:D.bind(null,!0),d:function W(){var Q,G=this.e,N=0;function B(){for(;Q=X.pop();)try{if(!Q.a&&N===1)return N=0,X.push(Q),Promise.resolve().then(B);if(Q.d){var J=Q.d.call(Q.v);if(Q.a)return N|=2,Promise.resolve(J).then(B,H)}else N|=1}catch(A){return H(A)}if(N===1)return G!==w?Promise.reject(G):Promise.resolve();if(G!==w)throw G}function H(J){return G=G!==w?new b(J,G):J,B()}return B()}}}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),LV=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,I){function U(b,w){this.v=b,this.k=w}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),bh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=LV();function b(w){return new U(w,0)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Xh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,I){var U=LV();function b(X){return function(){return new w(X.apply(this,arguments))}}function w(X){var D,W;function Q(N,B){try{var H=X[N](B),J=H.value,A=J instanceof U;Promise.resolve(A?J.v:J).then(function(O){if(A){var V=N==="return"?"return":"next";if(!J.k||O.done)return Q(V,O);O=X[V](O).value}G(H.done?"return":"normal",O)},function(O){Q("throw",O)})}catch(O){G("throw",O)}}function G(N,B){switch(N){case"return":D.resolve({value:B,done:!0});break;case"throw":D.reject(B);break;default:D.resolve({value:B,done:!1})}(D=D.next)?Q(D.key,D.arg):W=null}this._invoke=function(N,B){return new Promise(function(H,J){var A={key:N,arg:B,resolve:H,reject:J,next:null};W?W=W.next=A:(D=W=A,Q(N,B))})},typeof X.return!="function"&&(this.return=void 0)}w.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},w.prototype.next=function(X){return this._invoke("next",X)},w.prototype.throw=function(X){return this._invoke("throw",X)},w.prototype.return=function(X){return this._invoke("return",X)},I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),ht=Y$(wh(),1),ft=Y$(bh(),1),yt=Y$(Xh(),1),ut=Y$(_$(),1);class eQ{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set($,I){this.keyToValue.set($,I),this.valueToKey.set(I,$)}getByKey($){return this.keyToValue.get($)}getByValue($){return this.valueToKey.get($)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class hU{constructor($){this.generateIdentifier=$,this.kv=new eQ}register($,I){if(this.kv.getByValue($))return;if(!I)I=this.generateIdentifier($);this.kv.set(I,$)}clear(){this.kv.clear()}getIdentifier($){return this.kv.getByValue($)}getValue($){return this.kv.getByKey($)}}class sQ extends hU{constructor(){super(($)=>$.name);this.classToAllowedProps=new Map}register($,I){if(typeof I==="object"){if(I.allowProps)this.classToAllowedProps.set($,I.allowProps);super.register($,I.identifier)}else super.register($,I)}getAllowedProps($){return this.classToAllowedProps.get($)}}function Dh($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function KV($,I){let U=Dh($);if("find"in U)return U.find(I);let b=U;for(let w=0;w<b.length;w++){let X=b[w];if(I(X))return X}return}function I1($,I){Object.entries($).forEach(([U,b])=>I(b,U))}function l1($,I){return $.indexOf(I)!==-1}function $G($,I){for(let U=0;U<$.length;U++){let b=$[U];if(I(b))return b}return}class IG{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return KV(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var Wh=($)=>Object.prototype.toString.call($).slice(8,-1),UG=($)=>typeof $==="undefined",Qh=($)=>$===null,U1=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},nb=($)=>U1($)&&Object.keys($).length===0,_6=($)=>Array.isArray($),Gh=($)=>typeof $==="string",Nh=($)=>typeof $==="number"&&!isNaN($),Yh=($)=>typeof $==="boolean",vV=($)=>$ instanceof RegExp,E4=($)=>$ instanceof Map,S4=($)=>$ instanceof Set,wG=($)=>Wh($)==="Symbol",VV=($)=>$ instanceof Date&&!isNaN($.valueOf()),ib=($)=>$ instanceof Error,bG=($)=>typeof $==="number"&&isNaN($),qV=($)=>Yh($)||Qh($)||UG($)||Nh($)||Gh($)||wG($),FV=($)=>typeof $==="bigint",MV=($)=>$===1/0||$===-1/0,jV=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),EV=($)=>$ instanceof URL;var ob=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),db=($)=>$.map(String).map(ob).join("."),c1=($,I)=>{let U=[],b="";for(let X=0;X<$.length;X++){let D=$.charAt(X);if(!I&&D==="\\"){let G=$.charAt(X+1);if(G==="\\"){b+="\\",X++;continue}else if(G!==".")throw Error("invalid path")}if(D==="\\"&&$.charAt(X+1)==="."){b+=".",X++;continue}if(D==="."){U.push(b),b="";continue}b+=D}let w=b;return U.push(w),U};function c6($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var SV=[c6(UG,"undefined",()=>null,()=>{return}),c6(FV,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),c6(VV,"Date",($)=>$.toISOString(),($)=>new Date($)),c6(ib,"Error",($,I)=>{let U={name:$.name,message:$.message};if("cause"in $)U.cause=$.cause;return I.allowedErrorProps.forEach((b)=>{U[b]=$[b]}),U},($,I)=>{let U=new Error($.message,{cause:$.cause});return U.name=$.name,U.stack=$.stack,I.allowedErrorProps.forEach((b)=>{U[b]=$[b]}),U}),c6(vV,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),c6(S4,"set",($)=>[...$.values()],($)=>new Set($)),c6(E4,"map",($)=>[...$.entries()],($)=>new Map($)),c6(($)=>bG($)||MV($),"number",($)=>{if(bG($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),c6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),c6(EV,"URL",($)=>$.toString(),($)=>new URL($))];function pb($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var PV=pb(($,I)=>{if(wG($))return!!I.symbolRegistry.getIdentifier($);return!1},($,I)=>{return["symbol",I.symbolRegistry.getIdentifier($)]},($)=>$.description,($,I,U)=>{let b=U.symbolRegistry.getValue(I[1]);if(!b)throw new Error("Trying to deserialize unknown symbol");return b}),Bh=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),kV=pb(jV,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=Bh[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function XG($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var RV=pb(XG,($,I)=>{return["class",I.classRegistry.getIdentifier($.constructor)]},($,I)=>{let U=I.classRegistry.getAllowedProps($.constructor);if(!U)return{...$};let b={};return U.forEach((w)=>{b[w]=$[w]}),b},($,I,U)=>{let b=U.classRegistry.getValue(I[1]);if(!b)throw new Error(`Trying to deserialize unknown class '${I[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(b.prototype),$)}),TV=pb(($,I)=>{return!!I.customTransformerRegistry.findApplicable($)},($,I)=>{return["custom",I.customTransformerRegistry.findApplicable($).name]},($,I)=>{return I.customTransformerRegistry.findApplicable($).serialize($)},($,I,U)=>{let b=U.customTransformerRegistry.findByName(I[1]);if(!b)throw new Error("Trying to deserialize unknown custom value");return b.deserialize($)}),Jh=[RV,PV,TV,kV],DG=($,I)=>{let U=$G(Jh,(w)=>w.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let b=$G(SV,(w)=>w.isApplicable($,I));if(b)return{value:b.transform($,I),type:b.annotation};return},_V={};SV.forEach(($)=>{_V[$.annotation]=$});var ZV=($,I,U)=>{if(_6(I))switch(I[0]){case"symbol":return PV.untransform($,I,U);case"class":return RV.untransform($,I,U);case"custom":return TV.untransform($,I,U);case"typed-array":return kV.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let b=_V[I];if(!b)throw new Error("Unknown transformation: "+I);return b.untransform($,U)}};var m1=($,I)=>{if(I>$.size)throw new Error("index out of bounds");let U=$.keys();while(I>0)U.next(),I--;return U.next().value};function CV($){if(l1($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(l1($,"prototype"))throw new Error("prototype is not allowed as a property");if(l1($,"constructor"))throw new Error("constructor is not allowed as a property")}var gV=($,I)=>{CV(I);for(let U=0;U<I.length;U++){let b=I[U];if(S4($))$=m1($,+b);else if(E4($)){let w=+b,X=+I[++U]===0?"key":"value",D=m1($,w);switch(X){case"key":$=D;break;case"value":$=$.get(D);break}}else $=$[b]}return $},tb=($,I,U)=>{if(CV(I),I.length===0)return U($);let b=$;for(let X=0;X<I.length-1;X++){let D=I[X];if(_6(b)){let W=+D;b=b[W]}else if(U1(b))b=b[D];else if(S4(b)){let W=+D;b=m1(b,W)}else if(E4(b)){if(X===I.length-2)break;let Q=+D,G=+I[++X]===0?"key":"value",N=m1(b,Q);switch(G){case"key":b=N;break;case"value":b=b.get(N);break}}}let w=I[I.length-1];if(_6(b))b[+w]=U(b[+w]);else if(U1(b))b[w]=U(b[w]);if(S4(b)){let X=m1(b,+w),D=U(X);if(X!==D)b.delete(X),b.add(D)}if(E4(b)){let X=+I[I.length-2],D=m1(b,X);switch(+w===0?"key":"value"){case"key":{let Q=U(D);if(b.set(Q,b.get(D)),Q!==D)b.delete(D);break}case"value":{b.set(D,U(b.get(D)));break}}}return $};var xV=($)=>$<1;function WG($,I,U,b=[]){if(!$)return;let w=xV(U);if(!_6($)){I1($,(W,Q)=>WG(W,I,U,[...b,...c1(Q,w)]));return}let[X,D]=$;if(D)I1(D,(W,Q)=>{WG(W,I,U,[...b,...c1(Q,w)])});I(X,b)}function hV($,I,U,b){return WG(I,(w,X)=>{$=tb($,X,(D)=>ZV(D,w,b))},U),$}function fV($,I,U){let b=xV(U);function w(X,D){let W=gV($,c1(D,b));X.map((Q)=>c1(Q,b)).forEach((Q)=>{$=tb($,Q,()=>W)})}if(_6(I)){let[X,D]=I;if(X.forEach((W)=>{$=tb($,c1(W,b),()=>$)}),D)I1(D,w)}else I1(I,w);return $}var Hh=($,I)=>U1($)||_6($)||E4($)||S4($)||ib($)||XG($,I);function Ah($,I,U){let b=U.get($);if(b)b.push(I);else U.set($,[I])}function yV($,I){let U={},b=void 0;if($.forEach((w)=>{if(w.length<=1)return;if(!I)w=w.map((W)=>W.map(String)).sort((W,Q)=>W.length-Q.length);let[X,...D]=w;if(X.length===0)b=D.map(db);else U[db(X)]=D.map(db)}),b)if(nb(U))return[b];else return[b,U];else return nb(U)?void 0:U}var QG=($,I,U,b,w=[],X=[],D=new Map)=>{let W=qV($);if(!W){Ah($,w,I);let J=D.get($);if(J)return b?{transformedValue:null}:J}if(!Hh($,U)){let J=DG($,U),A=J?{transformedValue:J.value,annotations:[J.type]}:{transformedValue:$};if(!W)D.set($,A);return A}if(l1(X,$))return{transformedValue:null};let Q=DG($,U),G=Q?.value??$,N=_6(G)?[]:{},B={};I1(G,(J,A)=>{if(A==="__proto__"||A==="constructor"||A==="prototype")throw new Error(`Detected property ${A}. This is a prototype pollution risk, please remove it from your object.`);let O=QG(J,I,U,b,[...w,A],[...X,$],D);if(N[A]=O.transformedValue,_6(O.annotations))B[ob(A)]=O.annotations;else if(U1(O.annotations))I1(O.annotations,(V,q)=>{B[ob(A)+"."+q]=V})});let H=nb(B)?{transformedValue:N,annotations:Q?[Q.type]:void 0}:{transformedValue:N,annotations:Q?[Q.type,B]:B};if(!W)D.set($,H);return H};function ab($){return Object.prototype.toString.call($).slice(8,-1)}function eb($){return ab($)==="Array"}function GG($){if(ab($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function Oh($,I,U,b,w){let X={}.propertyIsEnumerable.call(b,I)?"enumerable":"nonenumerable";if(X==="enumerable")$[I]=U;if(w&&X==="nonenumerable")Object.defineProperty($,I,{value:U,enumerable:!1,writable:!0,configurable:!0})}function sb($,I={}){if(eb($))return $.map((w)=>sb(w,I));if(!GG($))return $;let U=Object.getOwnPropertyNames($),b=Object.getOwnPropertySymbols($);return[...U,...b].reduce((w,X)=>{if(X==="__proto__")return w;if(eb(I.props)&&!I.props.includes(X))return w;let D=$[X],W=sb(D,I);return Oh(w,X,W,$,I.nonenumerable),w},{})}class U${constructor({dedupe:$=!1}={}){this.classRegistry=new sQ,this.symbolRegistry=new hU((I)=>I.description??""),this.customTransformerRegistry=new IG,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=QG($,I,this,this.dedupe),b={json:U.transformedValue};if(U.annotations)b.meta={...b.meta,values:U.annotations};let w=yV(I,this.dedupe);if(w)b.meta={...b.meta,referentialEqualities:w};if(b.meta)b.meta.v=1;return b}deserialize($,I){let{json:U,meta:b}=$,w=I?.inPlace?U:sb(U);if(b?.values)w=hV(w,b.values,b.v??0,this);if(b?.referentialEqualities)w=fV(w,b.referentialEqualities,b.v??0);return w}stringify($){return JSON.stringify(this.serialize($))}parse($){return this.deserialize(JSON.parse($),{inPlace:!0})}registerClass($,I){this.classRegistry.register($,I)}registerSymbol($,I){this.symbolRegistry.register($,I)}registerCustom($,I){this.customTransformerRegistry.register({name:I,...$})}allowErrorProps(...$){this.allowedErrorProps.push(...$)}}U$.defaultInstance=new U$;U$.serialize=U$.defaultInstance.serialize.bind(U$.defaultInstance);U$.deserialize=U$.defaultInstance.deserialize.bind(U$.defaultInstance);U$.stringify=U$.defaultInstance.stringify.bind(U$.defaultInstance);U$.parse=U$.defaultInstance.parse.bind(U$.defaultInstance);U$.registerClass=U$.defaultInstance.registerClass.bind(U$.defaultInstance);U$.registerSymbol=U$.defaultInstance.registerSymbol.bind(U$.defaultInstance);U$.registerCustom=U$.defaultInstance.registerCustom.bind(U$.defaultInstance);U$.allowErrorProps=U$.defaultInstance.allowErrorProps.bind(U$.defaultInstance);var uV=U$;var{serialize:Sa,deserialize:Pa,stringify:ka,parse:Ra,registerClass:Ta,registerCustom:_a,registerSymbol:Za,allowErrorProps:Ca}=U$;class NG{trpc;constructor($){this.trpc=zV({links:[pQ({url:`${$.apiUrl}/trpc`,transformer:uV,headers:()=>({Authorization:`Bearer ${$.apiKey}`})})]})}async whoami(){return this.trpc.apiKeys.whoami.query()}async search($){return this.trpc.search.blocks.query($)}async getContent($){return this.trpc.mcpTools.getContent.query($)}async getWorkspaceContext(){return this.trpc.mcpTools.getWorkspaceContext.query()}async strReplaceBlock($){return this.trpc.mcpTools.strReplaceBlock.mutate($)}async insertBlock($){return this.trpc.mcpTools.insertBlock.mutate($)}async insertMatrix($){return this.trpc.mcpTools.insertMatrix.mutate($)}async createMatrixFromReactionArtifact($){return this.trpc.mcpTools.createMatrixFromReactionArtifact.mutate($)}async deleteBlock($){return this.trpc.mcpTools.deleteBlock.mutate($)}async createDocument($){return this.trpc.mcpTools.createDocument.mutate($)}async createLiterature($){return this.trpc.mcpTools.createLiterature.mutate($)}async searchArtifacts($){return this.trpc.mcpTools.searchArtifacts.query($)}async createRecord($){return this.trpc.mcpTools.createRecord.mutate($)}async listProcedureNodes($){return this.trpc.mcpTools.listProcedureNodes.query($)}async buildProcedureTree($){return this.trpc.mcpTools.buildProcedureTree.mutate($)}async insertProcedureNode($){return this.trpc.mcpTools.insertProcedureNode.mutate($)}async updateProcedureNode($){return this.trpc.mcpTools.updateProcedureNode.mutate($)}async updateArtifact($){return this.trpc.mcpTools.updateArtifact.mutate($)}async createArtifact($){return this.trpc.mcpTools.createArtifact.mutate($)}async reorderProcedureNodes($){return this.trpc.mcpTools.reorderProcedureNodes.mutate($)}async deleteProcedureNode($){return this.trpc.mcpTools.deleteProcedureNode.mutate($)}async appendMatrixRows($){return this.trpc.mcpTools.appendMatrixRows.mutate($)}async updateMatrixRows($){return this.trpc.mcpTools.updateMatrixRows.mutate($)}async deleteMatrixRows($){return this.trpc.mcpTools.deleteMatrixRows.mutate($)}async rebindMatrixToNode($){return this.trpc.mcpTools.rebindMatrixToNode.mutate($)}async deleteMatrix($){return this.trpc.mcpTools.deleteMatrix.mutate($)}async attachMatrix($){return this.trpc.mcpTools.attachMatrix.mutate($)}async listMatrixReferences($){let U=(await this.trpc.mcpTools.listMatrixReferences.query($)).references??[];return{success:!0,matrixId:$.matrixId,references:U,totalCount:U.length}}async linkArtifactToNode($){return this.trpc.mcpTools.linkArtifactToNode.mutate($)}async unlinkArtifactFromNode($){return this.trpc.mcpTools.unlinkArtifactFromNode.mutate($)}async listNodeArtifactLinks($){return this.trpc.mcpTools.listNodeArtifactLinks.query($)}async instantiateArtifactTemplate($){return this.trpc.mcpTools.instantiateArtifactTemplate.mutate($)}}function YG($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var w4=YG();async function lV($){let I=YG();I.info("Initializing server context...");let U=new NG({apiUrl:$.apiUrl,apiKey:$.apiKey});I.info("Resolving user identity from API key...");let b;try{b=(await U.whoami()).userId,I.info(`Resolved user: ${b.slice(0,8)}...`)}catch(X){I.error("Failed to resolve user identity from API key:",X),I.error("Ensure SURA_API_URL is correct and the API server is running."),process.exit(1)}I.info(`API URL: ${$.apiUrl}`);let w={userId:b,client:U,log:I};try{I.info("Loading workspace context..."),w.workspaceContext=await U.getWorkspaceContext();let X=w.workspaceContext.orgs.length,D=w.workspaceContext.orgs.reduce((W,Q)=>W+Q.workspaces.length,0);I.info(`Workspace context loaded: ${X} org(s), ${D} workspace(s)`)}catch(X){I.warn("Failed to load workspace context at startup (will retry on first tool call):",X)}return w}var Y={};v6(Y,{xor:()=>JF,xid:()=>xq,void:()=>WF,uuidv7:()=>Pq,uuidv6:()=>Sq,uuidv4:()=>Eq,uuid:()=>jq,util:()=>E,url:()=>kq,uppercase:()=>II,unknown:()=>N1,union:()=>jD,undefined:()=>XF,ulid:()=>gq,uint64:()=>wF,uint32:()=>$F,tuple:()=>PB,trim:()=>WI,treeifyError:()=>FG,transform:()=>SD,toUpperCase:()=>GI,toLowerCase:()=>QI,toJSONSchema:()=>eX,templateLiteral:()=>EF,symbol:()=>bF,superRefine:()=>sB,success:()=>FF,stringbool:()=>CF,stringFormat:()=>oq,string:()=>bD,strictObject:()=>YF,startsWith:()=>wI,slugify:()=>NI,size:()=>e1,setErrorMap:()=>sy,set:()=>LF,safeParseAsync:()=>UB,safeParse:()=>IB,safeEncodeAsync:()=>GB,safeEncode:()=>WB,safeDecodeAsync:()=>NB,safeDecode:()=>QB,registry:()=>MX,regexes:()=>K6,regex:()=>s1,refine:()=>eB,record:()=>kB,readonly:()=>iB,property:()=>pX,promise:()=>SF,prettifyError:()=>MG,preprocess:()=>xF,prefault:()=>yB,positive:()=>nX,pipe:()=>Y0,partialRecord:()=>AF,parseAsync:()=>$B,parse:()=>s5,overwrite:()=>Z6,optional:()=>G0,object:()=>NF,number:()=>BB,nullish:()=>qF,nullable:()=>N0,null:()=>zB,normalize:()=>DI,nonpositive:()=>oX,nonoptional:()=>uB,nonnegative:()=>dX,never:()=>MD,negative:()=>iX,nativeEnum:()=>KF,nanoid:()=>_q,nan:()=>MF,multipleOf:()=>Z4,minSize:()=>C4,minLength:()=>b4,mime:()=>XI,meta:()=>_F,maxSize:()=>W1,maxLength:()=>Q1,map:()=>zF,mac:()=>yq,lte:()=>N6,lt:()=>r6,lowercase:()=>$I,looseRecord:()=>OF,looseObject:()=>BF,locales:()=>b0,literal:()=>vF,length:()=>G1,lazy:()=>pB,ksuid:()=>hq,keyof:()=>GF,jwt:()=>iq,json:()=>gF,iso:()=>JI,ipv6:()=>uq,ipv4:()=>fq,intersection:()=>EB,int64:()=>UF,int32:()=>sq,int:()=>XD,instanceof:()=>ZF,includes:()=>UI,httpUrl:()=>Rq,hostname:()=>dq,hex:()=>pq,hash:()=>tq,guid:()=>Mq,gte:()=>p$,gt:()=>n6,globalRegistry:()=>d$,getErrorMap:()=>$u,function:()=>PF,fromJSONSchema:()=>fF,formatError:()=>oU,float64:()=>eq,float32:()=>aq,flattenError:()=>iU,file:()=>VF,enum:()=>ED,endsWith:()=>bI,encodeAsync:()=>XB,encode:()=>wB,emoji:()=>Tq,email:()=>Fq,e164:()=>nq,discriminatedUnion:()=>HF,describe:()=>TF,decodeAsync:()=>DB,decode:()=>bB,date:()=>QF,custom:()=>RF,cuid2:()=>Cq,cuid:()=>Zq,core:()=>X4,config:()=>P$,coerce:()=>IJ,codec:()=>jF,clone:()=>o$,cidrv6:()=>cq,cidrv4:()=>lq,check:()=>kF,catch:()=>mB,boolean:()=>JB,bigint:()=>IF,base64url:()=>rq,base64:()=>mq,array:()=>H0,any:()=>DF,_function:()=>PF,_default:()=>hB,_ZodString:()=>DD,ZodXor:()=>FB,ZodXID:()=>JD,ZodVoid:()=>VB,ZodUnknown:()=>KB,ZodUnion:()=>O0,ZodUndefined:()=>AB,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>BD,ZodType:()=>t,ZodTuple:()=>SB,ZodTransform:()=>CB,ZodTemplateLiteral:()=>oB,ZodSymbol:()=>HB,ZodSuccess:()=>lB,ZodStringFormat:()=>J$,ZodString:()=>AI,ZodSet:()=>TB,ZodRecord:()=>z0,ZodRealError:()=>b6,ZodReadonly:()=>nB,ZodPromise:()=>tB,ZodPrefault:()=>fB,ZodPipe:()=>RD,ZodOptional:()=>PD,ZodObject:()=>A0,ZodNumberFormat:()=>Y1,ZodNumber:()=>zI,ZodNullable:()=>gB,ZodNull:()=>OB,ZodNonOptional:()=>kD,ZodNever:()=>vB,ZodNanoID:()=>GD,ZodNaN:()=>rB,ZodMap:()=>RB,ZodMAC:()=>YB,ZodLiteral:()=>_B,ZodLazy:()=>dB,ZodKSUID:()=>HD,ZodJWT:()=>qD,ZodIssueCode:()=>ey,ZodIntersection:()=>jB,ZodISOTime:()=>UD,ZodISODuration:()=>wD,ZodISODateTime:()=>$D,ZodISODate:()=>ID,ZodIPv6:()=>OD,ZodIPv4:()=>AD,ZodGUID:()=>Q0,ZodFunction:()=>aB,ZodFirstPartyTypeKind:()=>$J,ZodFile:()=>ZB,ZodError:()=>ty,ZodEnum:()=>HI,ZodEmoji:()=>QD,ZodEmail:()=>WD,ZodE164:()=>VD,ZodDiscriminatedUnion:()=>MB,ZodDefault:()=>xB,ZodDate:()=>J0,ZodCustomStringFormat:()=>OI,ZodCustom:()=>L0,ZodCodec:()=>TD,ZodCatch:()=>cB,ZodCUID2:()=>YD,ZodCUID:()=>ND,ZodCIDRv6:()=>LD,ZodCIDRv4:()=>zD,ZodBoolean:()=>LI,ZodBigIntFormat:()=>FD,ZodBigInt:()=>KI,ZodBase64URL:()=>vD,ZodBase64:()=>KD,ZodArray:()=>qB,ZodAny:()=>LB,TimePrecision:()=>S7,NEVER:()=>BG,$output:()=>V7,$input:()=>q7,$brand:()=>JG});var X4={};v6(X4,{version:()=>vN,util:()=>E,treeifyError:()=>FG,toJSONSchema:()=>eX,toDotPath:()=>oV,safeParseAsync:()=>EG,safeParse:()=>jG,safeEncodeAsync:()=>ph,safeEncode:()=>oh,safeDecodeAsync:()=>th,safeDecode:()=>dh,registry:()=>MX,regexes:()=>K6,process:()=>G$,prettifyError:()=>MG,parseAsync:()=>wX,parse:()=>UX,meta:()=>W5,locales:()=>b0,isValidJWT:()=>Bq,isValidBase64URL:()=>Yq,isValidBase64:()=>cN,initializeContext:()=>g4,globalRegistry:()=>d$,globalConfig:()=>fU,formatError:()=>oU,flattenError:()=>iU,finalize:()=>h4,extractDefs:()=>x4,encodeAsync:()=>nh,encode:()=>mh,describe:()=>D5,decodeAsync:()=>ih,decode:()=>rh,createToJSONSchemaMethod:()=>G5,createStandardJSONSchemaMethod:()=>BI,config:()=>P$,clone:()=>o$,_xor:()=>Ey,_xid:()=>gX,_void:()=>a7,_uuidv7:()=>kX,_uuidv6:()=>PX,_uuidv4:()=>SX,_uuid:()=>EX,_url:()=>D0,_uppercase:()=>II,_unknown:()=>p7,_union:()=>jy,_undefined:()=>i7,_ulid:()=>CX,_uint64:()=>r7,_uint32:()=>f7,_tuple:()=>ky,_trim:()=>WI,_transform:()=>xy,_toUpperCase:()=>GI,_toLowerCase:()=>QI,_templateLiteral:()=>ny,_symbol:()=>n7,_superRefine:()=>X5,_success:()=>ly,_stringbool:()=>Q5,_stringFormat:()=>YI,_string:()=>M7,_startsWith:()=>wI,_slugify:()=>NI,_size:()=>e1,_set:()=>_y,_safeParseAsync:()=>t1,_safeParse:()=>p1,_safeEncodeAsync:()=>NX,_safeEncode:()=>QX,_safeDecodeAsync:()=>YX,_safeDecode:()=>GX,_regex:()=>s1,_refine:()=>b5,_record:()=>Ry,_readonly:()=>ry,_property:()=>pX,_promise:()=>oy,_positive:()=>nX,_pipe:()=>my,_parseAsync:()=>d1,_parse:()=>o1,_overwrite:()=>Z6,_optional:()=>hy,_number:()=>_7,_nullable:()=>fy,_null:()=>o7,_normalize:()=>DI,_nonpositive:()=>oX,_nonoptional:()=>uy,_nonnegative:()=>dX,_never:()=>t7,_negative:()=>iX,_nativeEnum:()=>Cy,_nanoid:()=>TX,_nan:()=>$5,_multipleOf:()=>Z4,_minSize:()=>C4,_minLength:()=>b4,_min:()=>p$,_mime:()=>XI,_maxSize:()=>W1,_maxLength:()=>Q1,_max:()=>N6,_map:()=>Ty,_mac:()=>E7,_lte:()=>N6,_lt:()=>r6,_lowercase:()=>$I,_literal:()=>gy,_length:()=>G1,_lazy:()=>iy,_ksuid:()=>xX,_jwt:()=>rX,_isoTime:()=>R7,_isoDuration:()=>T7,_isoDateTime:()=>P7,_isoDate:()=>k7,_ipv6:()=>fX,_ipv4:()=>hX,_intersection:()=>Py,_int64:()=>m7,_int32:()=>h7,_int:()=>C7,_includes:()=>UI,_guid:()=>X0,_gte:()=>p$,_gt:()=>n6,_float64:()=>x7,_float32:()=>g7,_file:()=>U5,_enum:()=>Zy,_endsWith:()=>bI,_encodeAsync:()=>DX,_encode:()=>bX,_emoji:()=>RX,_email:()=>jX,_e164:()=>mX,_discriminatedUnion:()=>Sy,_default:()=>yy,_decodeAsync:()=>WX,_decode:()=>XX,_date:()=>e7,_custom:()=>w5,_cuid2:()=>ZX,_cuid:()=>_X,_coercedString:()=>j7,_coercedNumber:()=>Z7,_coercedDate:()=>s7,_coercedBoolean:()=>u7,_coercedBigint:()=>c7,_cidrv6:()=>uX,_cidrv4:()=>yX,_check:()=>vq,_catch:()=>cy,_boolean:()=>y7,_bigint:()=>l7,_base64url:()=>cX,_base64:()=>lX,_array:()=>I5,_any:()=>d7,TimePrecision:()=>S7,NEVER:()=>BG,JSONSchemaGenerator:()=>d5,JSONSchema:()=>Vq,Doc:()=>AX,$output:()=>V7,$input:()=>q7,$constructor:()=>z,$brand:()=>JG,$ZodXor:()=>DY,$ZodXID:()=>TN,$ZodVoid:()=>UY,$ZodUnknown:()=>$Y,$ZodUnion:()=>aU,$ZodUndefined:()=>aN,$ZodUUID:()=>FN,$ZodURL:()=>jN,$ZodULID:()=>RN,$ZodType:()=>o,$ZodTuple:()=>FX,$ZodTransform:()=>AY,$ZodTemplateLiteral:()=>EY,$ZodSymbol:()=>tN,$ZodSuccess:()=>VY,$ZodStringFormat:()=>B$,$ZodString:()=>D1,$ZodSet:()=>YY,$ZodRegistry:()=>F7,$ZodRecord:()=>GY,$ZodRealError:()=>w6,$ZodReadonly:()=>jY,$ZodPromise:()=>PY,$ZodPrefault:()=>KY,$ZodPipe:()=>MY,$ZodOptional:()=>OY,$ZodObjectJIT:()=>XY,$ZodObject:()=>Aq,$ZodNumberFormat:()=>dN,$ZodNumber:()=>VX,$ZodNullable:()=>zY,$ZodNull:()=>eN,$ZodNonOptional:()=>vY,$ZodNever:()=>IY,$ZodNanoID:()=>SN,$ZodNaN:()=>FY,$ZodMap:()=>NY,$ZodMAC:()=>yN,$ZodLiteral:()=>JY,$ZodLazy:()=>kY,$ZodKSUID:()=>_N,$ZodJWT:()=>iN,$ZodIntersection:()=>QY,$ZodISOTime:()=>gN,$ZodISODuration:()=>xN,$ZodISODateTime:()=>ZN,$ZodISODate:()=>CN,$ZodIPv6:()=>fN,$ZodIPv4:()=>hN,$ZodGUID:()=>qN,$ZodFunction:()=>SY,$ZodFile:()=>HY,$ZodError:()=>nU,$ZodEnum:()=>BY,$ZodEncodeError:()=>w1,$ZodEmoji:()=>EN,$ZodEmail:()=>MN,$ZodE164:()=>nN,$ZodDiscriminatedUnion:()=>WY,$ZodDefault:()=>LY,$ZodDate:()=>wY,$ZodCustomStringFormat:()=>oN,$ZodCustom:()=>RY,$ZodCodec:()=>eU,$ZodCheckUpperCase:()=>JN,$ZodCheckStringFormat:()=>a1,$ZodCheckStartsWith:()=>AN,$ZodCheckSizeEquals:()=>WN,$ZodCheckRegex:()=>YN,$ZodCheckProperty:()=>zN,$ZodCheckOverwrite:()=>KN,$ZodCheckNumberFormat:()=>wN,$ZodCheckMultipleOf:()=>UN,$ZodCheckMinSize:()=>DN,$ZodCheckMinLength:()=>GN,$ZodCheckMimeType:()=>LN,$ZodCheckMaxSize:()=>XN,$ZodCheckMaxLength:()=>QN,$ZodCheckLowerCase:()=>BN,$ZodCheckLessThan:()=>JX,$ZodCheckLengthEquals:()=>NN,$ZodCheckIncludes:()=>HN,$ZodCheckGreaterThan:()=>HX,$ZodCheckEndsWith:()=>ON,$ZodCheckBigIntFormat:()=>bN,$ZodCheck:()=>A$,$ZodCatch:()=>qY,$ZodCUID2:()=>kN,$ZodCUID:()=>PN,$ZodCIDRv6:()=>lN,$ZodCIDRv4:()=>uN,$ZodBoolean:()=>tU,$ZodBigIntFormat:()=>pN,$ZodBigInt:()=>qX,$ZodBase64URL:()=>rN,$ZodBase64:()=>mN,$ZodAsyncError:()=>m6,$ZodArray:()=>bY,$ZodAny:()=>sN});var BG=Object.freeze({status:"aborted"});function z($,I,U){function b(W,Q){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:Q,constr:D,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),I(W,Q);let G=D.prototype,N=Object.keys(G);for(let B=0;B<N.length;B++){let H=N[B];if(!(H in W))W[H]=G[H].bind(W)}}let w=U?.Parent??Object;class X extends w{}Object.defineProperty(X,"name",{value:$});function D(W){var Q;let G=U?.Parent?new X:this;b(G,W),(Q=G._zod).deferred??(Q.deferred=[]);for(let N of G._zod.deferred)N();return G}return Object.defineProperty(D,"init",{value:b}),Object.defineProperty(D,Symbol.hasInstance,{value:(W)=>{if(U?.Parent&&W instanceof U.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(D,"name",{value:$}),D}var JG=Symbol("zod_brand");class m6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class w1 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var fU={};function P$($){if($)Object.assign(fU,$);return fU}var E={};v6(E,{unwrapMessage:()=>yU,uint8ArrayToHex:()=>lh,uint8ArrayToBase64url:()=>yh,uint8ArrayToBase64:()=>rV,stringifyPrimitive:()=>j,slugify:()=>OG,shallowClone:()=>LG,safeExtend:()=>Zh,required:()=>xh,randomString:()=>Eh,propertyKeyTypes:()=>cU,promiseAllObject:()=>jh,primitiveTypes:()=>KG,prefixIssues:()=>G6,pick:()=>Rh,partial:()=>gh,optionalKeys:()=>vG,omit:()=>Th,objectClone:()=>qh,numKeys:()=>Sh,nullish:()=>P4,normalizeParams:()=>S,mergeDefs:()=>R4,merge:()=>Ch,jsonStringifyReplacer:()=>r1,joinValues:()=>L,issue:()=>i1,isPlainObject:()=>T4,isObject:()=>b1,hexToUint8Array:()=>uh,getSizableOrigin:()=>mU,getParsedType:()=>Ph,getLengthableOrigin:()=>rU,getEnumValues:()=>uU,getElementAtPath:()=>Mh,floatSafeRemainder:()=>AG,finalizeIssue:()=>U6,extend:()=>_h,escapeRegex:()=>L6,esc:()=>$X,defineLazy:()=>s,createTransparentProxy:()=>kh,cloneDef:()=>Fh,clone:()=>o$,cleanRegex:()=>lU,cleanEnum:()=>hh,captureStackTrace:()=>IX,cached:()=>n1,base64urlToUint8Array:()=>fh,base64ToUint8Array:()=>mV,assignProp:()=>k4,assertNotEqual:()=>Lh,assertNever:()=>vh,assertIs:()=>Kh,assertEqual:()=>zh,assert:()=>Vh,allowsEval:()=>zG,aborted:()=>_4,NUMBER_FORMAT_RANGES:()=>VG,Class:()=>nV,BIGINT_FORMAT_RANGES:()=>qG});function zh($){return $}function Lh($){return $}function Kh($){}function vh($){throw new Error("Unexpected value in exhaustive check")}function Vh($){}function uU($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function L($,I="|"){return $.map((U)=>j(U)).join(I)}function r1($,I){if(typeof I==="bigint")return I.toString();return I}function n1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function P4($){return $===null||$===void 0}function lU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function AG($,I){let U=($.toString().split(".")[1]||"").length,b=I.toString(),w=(b.split(".")[1]||"").length;if(w===0&&/\d?e-\d?/.test(b)){let Q=b.match(/\d?e-(\d?)/);if(Q?.[1])w=Number.parseInt(Q[1])}let X=U>w?U:w,D=Number.parseInt($.toFixed(X).replace(".","")),W=Number.parseInt(I.toFixed(X).replace(".",""));return D%W/10**X}var cV=Symbol("evaluating");function s($,I,U){let b=void 0;Object.defineProperty($,I,{get(){if(b===cV)return;if(b===void 0)b=cV,b=U();return b},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function qh($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function k4($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function R4(...$){let I={};for(let U of $){let b=Object.getOwnPropertyDescriptors(U);Object.assign(I,b)}return Object.defineProperties({},I)}function Fh($){return R4($._zod.def)}function Mh($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function jh($){let I=Object.keys($),U=I.map((b)=>$[b]);return Promise.all(U).then((b)=>{let w={};for(let X=0;X<I.length;X++)w[I[X]]=b[X];return w})}function Eh($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function $X($){return JSON.stringify($)}function OG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var IX="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function b1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var zG=n1(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function T4($){if(b1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(b1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function LG($){if(T4($))return{...$};if(Array.isArray($))return[...$];return $}function Sh($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var Ph=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},cU=new Set(["string","number","symbol"]),KG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function L6($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o$($,I,U){let b=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)b._zod.parent=$;return b}function S($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function kh($){let I;return new Proxy({},{get(U,b,w){return I??(I=$()),Reflect.get(I,b,w)},set(U,b,w,X){return I??(I=$()),Reflect.set(I,b,w,X)},has(U,b){return I??(I=$()),Reflect.has(I,b)},deleteProperty(U,b){return I??(I=$()),Reflect.deleteProperty(I,b)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,b){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,b)},defineProperty(U,b,w){return I??(I=$()),Reflect.defineProperty(I,b,w)}})}function j($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function vG($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var VG={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]},qG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Rh($,I){let U=$._zod.def,b=R4($._zod.def,{get shape(){let w={};for(let X in I){if(!(X in U.shape))throw new Error(`Unrecognized key: "${X}"`);if(!I[X])continue;w[X]=U.shape[X]}return k4(this,"shape",w),w},checks:[]});return o$($,b)}function Th($,I){let U=$._zod.def,b=R4($._zod.def,{get shape(){let w={...$._zod.def.shape};for(let X in I){if(!(X in U.shape))throw new Error(`Unrecognized key: "${X}"`);if(!I[X])continue;delete w[X]}return k4(this,"shape",w),w},checks:[]});return o$($,b)}function _h($,I){if(!T4(I))throw new Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let w=R4($._zod.def,{get shape(){let X={...$._zod.def.shape,...I};return k4(this,"shape",X),X},checks:[]});return o$($,w)}function Zh($,I){if(!T4(I))throw new Error("Invalid input to safeExtend: expected a plain object");let U={...$._zod.def,get shape(){let b={...$._zod.def.shape,...I};return k4(this,"shape",b),b},checks:$._zod.def.checks};return o$($,U)}function Ch($,I){let U=R4($._zod.def,{get shape(){let b={...$._zod.def.shape,...I._zod.def.shape};return k4(this,"shape",b),b},get catchall(){return I._zod.def.catchall},checks:[]});return o$($,U)}function gh($,I,U){let b=R4(I._zod.def,{get shape(){let w=I._zod.def.shape,X={...w};if(U)for(let D in U){if(!(D in w))throw new Error(`Unrecognized key: "${D}"`);if(!U[D])continue;X[D]=$?new $({type:"optional",innerType:w[D]}):w[D]}else for(let D in w)X[D]=$?new $({type:"optional",innerType:w[D]}):w[D];return k4(this,"shape",X),X},checks:[]});return o$(I,b)}function xh($,I,U){let b=R4(I._zod.def,{get shape(){let w=I._zod.def.shape,X={...w};if(U)for(let D in U){if(!(D in X))throw new Error(`Unrecognized key: "${D}"`);if(!U[D])continue;X[D]=new $({type:"nonoptional",innerType:w[D]})}else for(let D in w)X[D]=new $({type:"nonoptional",innerType:w[D]});return k4(this,"shape",X),X},checks:[]});return o$(I,b)}function _4($,I=0){if($.aborted===!0)return!0;for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function G6($,I){return I.map((U)=>{var b;return(b=U).path??(b.path=[]),U.path.unshift($),U})}function yU($){return typeof $==="string"?$:$?.message}function U6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=yU($.inst?._zod.def?.error?.($))??yU(I?.error?.($))??yU(U.customError?.($))??yU(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function mU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function rU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function i1(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function hh($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function mV($){let I=atob($),U=new Uint8Array(I.length);for(let b=0;b<I.length;b++)U[b]=I.charCodeAt(b);return U}function rV($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function fh($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return mV(I+U)}function yh($){return rV($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function uh($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw new Error("Invalid hex string length");let U=new Uint8Array(I.length/2);for(let b=0;b<I.length;b+=2)U[b/2]=Number.parseInt(I.slice(b,b+2),16);return U}function lh($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class nV{constructor(...$){}}var iV=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,r1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},nU=z("$ZodError",iV),w6=z("$ZodError",iV,{Parent:Error});function iU($,I=(U)=>U.message){let U={},b=[];for(let w of $.issues)if(w.path.length>0)U[w.path[0]]=U[w.path[0]]||[],U[w.path[0]].push(I(w));else b.push(I(w));return{formErrors:b,fieldErrors:U}}function oU($,I=(U)=>U.message){let U={_errors:[]},b=(w)=>{for(let X of w.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((D)=>b({issues:D}));else if(X.code==="invalid_key")b({issues:X.issues});else if(X.code==="invalid_element")b({issues:X.issues});else if(X.path.length===0)U._errors.push(I(X));else{let D=U,W=0;while(W<X.path.length){let Q=X.path[W];if(W!==X.path.length-1)D[Q]=D[Q]||{_errors:[]};else D[Q]=D[Q]||{_errors:[]},D[Q]._errors.push(I(X));D=D[Q],W++}}};return b($),U}function FG($,I=(U)=>U.message){let U={errors:[]},b=(w,X=[])=>{var D,W;for(let Q of w.issues)if(Q.code==="invalid_union"&&Q.errors.length)Q.errors.map((G)=>b({issues:G},Q.path));else if(Q.code==="invalid_key")b({issues:Q.issues},Q.path);else if(Q.code==="invalid_element")b({issues:Q.issues},Q.path);else{let G=[...X,...Q.path];if(G.length===0){U.errors.push(I(Q));continue}let N=U,B=0;while(B<G.length){let H=G[B],J=B===G.length-1;if(typeof H==="string")N.properties??(N.properties={}),(D=N.properties)[H]??(D[H]={errors:[]}),N=N.properties[H];else N.items??(N.items=[]),(W=N.items)[H]??(W[H]={errors:[]}),N=N.items[H];if(J)N.errors.push(I(Q));B++}}};return b($),U}function oV($){let I=[],U=$.map((b)=>typeof b==="object"?b.key:b);for(let b of U)if(typeof b==="number")I.push(`[${b}]`);else if(typeof b==="symbol")I.push(`[${JSON.stringify(String(b))}]`);else if(/[^\w$]/.test(b))I.push(`[${JSON.stringify(b)}]`);else{if(I.length)I.push(".");I.push(b)}return I.join("")}function MG($){let I=[],U=[...$.issues].sort((b,w)=>(b.path??[]).length-(w.path??[]).length);for(let b of U)if(I.push(`✖ ${b.message}`),b.path?.length)I.push(` → at ${oV(b.path)}`);return I.join(`
43
+ `)}var o1=($)=>(I,U,b,w)=>{let X=b?Object.assign(b,{async:!1}):{async:!1},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)throw new m6;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>U6(Q,X,P$())));throw IX(W,w?.callee),W}return D.value},UX=o1(w6),d1=($)=>async(I,U,b,w)=>{let X=b?Object.assign(b,{async:!0}):{async:!0},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)D=await D;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>U6(Q,X,P$())));throw IX(W,w?.callee),W}return D.value},wX=d1(w6),p1=($)=>(I,U,b)=>{let w=b?{...b,async:!1}:{async:!1},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)throw new m6;return X.issues.length?{success:!1,error:new($??nU)(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},jG=p1(w6),t1=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{async:!0}):{async:!0},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},EG=t1(w6),bX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return o1($)(I,U,w)},mh=bX(w6),XX=($)=>(I,U,b)=>{return o1($)(I,U,b)},rh=XX(w6),DX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return d1($)(I,U,w)},nh=DX(w6),WX=($)=>async(I,U,b)=>{return d1($)(I,U,b)},ih=WX(w6),QX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return p1($)(I,U,w)},oh=QX(w6),GX=($)=>(I,U,b)=>{return p1($)(I,U,b)},dh=GX(w6),NX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return t1($)(I,U,w)},ph=NX(w6),YX=($)=>async(I,U,b)=>{return t1($)(I,U,b)},th=YX(w6);var K6={};v6(K6,{xid:()=>RG,uuid7:()=>$f,uuid6:()=>sh,uuid4:()=>eh,uuid:()=>X1,uppercase:()=>IN,unicodeEmail:()=>dV,undefined:()=>sG,ulid:()=>kG,time:()=>nG,string:()=>oG,sha512_hex:()=>Vf,sha512_base64url:()=>Ff,sha512_base64:()=>qf,sha384_hex:()=>Lf,sha384_base64url:()=>vf,sha384_base64:()=>Kf,sha256_hex:()=>Af,sha256_base64url:()=>zf,sha256_base64:()=>Of,sha1_hex:()=>Bf,sha1_base64url:()=>Hf,sha1_base64:()=>Jf,rfc5322Email:()=>Uf,number:()=>tG,null:()=>eG,nanoid:()=>_G,md5_hex:()=>Gf,md5_base64url:()=>Yf,md5_base64:()=>Nf,mac:()=>yG,lowercase:()=>$N,ksuid:()=>TG,ipv6:()=>fG,ipv4:()=>hG,integer:()=>pG,idnEmail:()=>wf,html5Email:()=>If,hostname:()=>Df,hex:()=>Qf,guid:()=>CG,extendedDuration:()=>ah,emoji:()=>xG,email:()=>gG,e164:()=>mG,duration:()=>ZG,domain:()=>Wf,datetime:()=>iG,date:()=>rG,cuid2:()=>PG,cuid:()=>SG,cidrv6:()=>lG,cidrv4:()=>uG,browserEmail:()=>bf,boolean:()=>aG,bigint:()=>dG,base64url:()=>BX,base64:()=>cG});var SG=/^[cC][^\s-]{8,}$/,PG=/^[0-9a-z]+$/,kG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RG=/^[0-9a-vA-V]{20}$/,TG=/^[A-Za-z0-9]{27}$/,_G=/^[a-zA-Z0-9_-]{21}$/,ZG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ah=/^[-+]?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)?)??$/,CG=/^([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})$/,X1=($)=>{if(!$)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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},eh=X1(4),sh=X1(6),$f=X1(7),gG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,If=/^[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])?)*$/,Uf=/^(([^<>()\[\]\\.,;:\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,}))$/,dV=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,wf=dV,bf=/^[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])?)*$/,Xf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xG(){return new RegExp(Xf,"u")}var hG=/^(?:(?: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])$/,fG=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,yG=($)=>{let I=L6($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},uG=/^((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])$/,lG=/^(([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])$/,cG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,BX=/^[A-Za-z0-9_-]*$/,Df=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Wf=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mG=/^\+(?:[0-9]){6,14}[0-9]$/,pV="(?:(?:\\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])))",rG=new RegExp(`^${pV}$`);function tV($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.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{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function nG($){return new RegExp(`^${tV($)}$`)}function iG($){let I=tV({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${pV}T(?:${b})$`)}var oG=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},dG=/^-?\d+n?$/,pG=/^-?\d+$/,tG=/^-?\d+(?:\.\d+)?/,aG=/^(?:true|false)$/i,eG=/^null$/i;var sG=/^undefined$/i;var $N=/^[^A-Z]*$/,IN=/^[^a-z]*$/,Qf=/^[0-9a-fA-F]*$/;function dU($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function pU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Gf=/^[0-9a-fA-F]{32}$/,Nf=dU(22,"=="),Yf=pU(22),Bf=/^[0-9a-fA-F]{40}$/,Jf=dU(27,"="),Hf=pU(27),Af=/^[0-9a-fA-F]{64}$/,Of=dU(43,"="),zf=pU(43),Lf=/^[0-9a-fA-F]{96}$/,Kf=dU(64,""),vf=pU(64),Vf=/^[0-9a-fA-F]{128}$/,qf=dU(86,"=="),Ff=pU(86);var A$=z("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),eV={number:"number",bigint:"bigint",object:"date"},JX=z("$ZodCheckLessThan",($,I)=>{A$.init($,I);let U=eV[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.maximum:w.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<X)if(I.inclusive)w.maximum=I.value;else w.exclusiveMaximum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value<=I.value:b.value<I.value)return;b.issues.push({origin:U,code:"too_big",maximum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),HX=z("$ZodCheckGreaterThan",($,I)=>{A$.init($,I);let U=eV[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.minimum:w.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>X)if(I.inclusive)w.minimum=I.value;else w.exclusiveMinimum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value>=I.value:b.value>I.value)return;b.issues.push({origin:U,code:"too_small",minimum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),UN=z("$ZodCheckMultipleOf",($,I)=>{A$.init($,I),$._zod.onattach.push((U)=>{var b;(b=U._zod.bag).multipleOf??(b.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):AG(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),wN=z("$ZodCheckNumberFormat",($,I)=>{A$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=VG[I.format];$._zod.onattach.push((D)=>{let W=D._zod.bag;if(W.format=I.format,W.minimum=w,W.maximum=X,U)W.pattern=pG}),$._zod.check=(D)=>{let W=D.value;if(U){if(!Number.isInteger(W)){D.issues.push({expected:b,format:I.format,code:"invalid_type",continue:!1,input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)D.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});else D.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});return}}if(W<w)D.issues.push({origin:"number",input:W,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!I.abort});if(W>X)D.issues.push({origin:"number",input:W,code:"too_big",maximum:X,inst:$})}}),bN=z("$ZodCheckBigIntFormat",($,I)=>{A$.init($,I);let[U,b]=qG[I.format];$._zod.onattach.push((w)=>{let X=w._zod.bag;X.format=I.format,X.minimum=U,X.maximum=b}),$._zod.check=(w)=>{let X=w.value;if(X<U)w.issues.push({origin:"bigint",input:X,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(X>b)w.issues.push({origin:"bigint",input:X,code:"too_big",maximum:b,inst:$})}}),XN=z("$ZodCheckMaxSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.size<=I.maximum)return;b.issues.push({origin:mU(w),code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),DN=z("$ZodCheckMinSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.size>=I.minimum)return;b.issues.push({origin:mU(w),code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),WN=z("$ZodCheckSizeEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.size,w.maximum=I.size,w.size=I.size}),$._zod.check=(b)=>{let w=b.value,X=w.size;if(X===I.size)return;let D=X>I.size;b.issues.push({origin:mU(w),...D?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),QN=z("$ZodCheckMaxLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.length<=I.maximum)return;let D=rU(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),GN=z("$ZodCheckMinLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.length>=I.minimum)return;let D=rU(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),NN=z("$ZodCheckLengthEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.length,w.maximum=I.length,w.length=I.length}),$._zod.check=(b)=>{let w=b.value,X=w.length;if(X===I.length)return;let D=rU(w),W=X>I.length;b.issues.push({origin:D,...W?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),a1=z("$ZodCheckStringFormat",($,I)=>{var U,b;if(A$.init($,I),$._zod.onattach.push((w)=>{let X=w._zod.bag;if(X.format=I.format,I.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(w)=>{if(I.pattern.lastIndex=0,I.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:I.format,input:w.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(b=$._zod).check??(b.check=()=>{})}),YN=z("$ZodCheckRegex",($,I)=>{a1.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),BN=z("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=$N),a1.init($,I)}),JN=z("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=IN),a1.init($,I)}),HN=z("$ZodCheckIncludes",($,I)=>{A$.init($,I);let U=L6(I.includes),b=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=b,$._zod.onattach.push((w)=>{let X=w._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(b)}),$._zod.check=(w)=>{if(w.value.includes(I.includes,I.position))return;w.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:w.value,inst:$,continue:!I.abort})}}),AN=z("$ZodCheckStartsWith",($,I)=>{A$.init($,I);let U=new RegExp(`^${L6(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.startsWith(I.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:b.value,inst:$,continue:!I.abort})}}),ON=z("$ZodCheckEndsWith",($,I)=>{A$.init($,I);let U=new RegExp(`.*${L6(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.endsWith(I.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:b.value,inst:$,continue:!I.abort})}});function aV($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues))}var zN=z("$ZodCheckProperty",($,I)=>{A$.init($,I),$._zod.check=(U)=>{let b=I.schema._zod.run({value:U.value[I.property],issues:[]},{});if(b instanceof Promise)return b.then((w)=>aV(w,U,I.property));aV(b,U,I.property);return}}),LN=z("$ZodCheckMimeType",($,I)=>{A$.init($,I);let U=new Set(I.mime);$._zod.onattach.push((b)=>{b._zod.bag.mime=I.mime}),$._zod.check=(b)=>{if(U.has(b.value.type))return;b.issues.push({code:"invalid_value",values:I.mime,input:b.value.type,inst:$,continue:!I.abort})}}),KN=z("$ZodCheckOverwrite",($,I)=>{A$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class AX{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
44
44
  `).filter((X)=>X),b=Math.min(...U.map((X)=>X.length-X.trimStart().length)),w=U.map((X)=>X.slice(b)).map((X)=>" ".repeat(this.indent*2)+X);for(let X of w)this.content.push(X)}compile(){let $=Function,I=this?.args,b=[...(this?.content??[""]).map((w)=>` ${w}`)];return new $(...I,b.join(`
45
- `))}}var vN={major:4,minor:2,patch:1};var o=z("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=vN;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let w of b)for(let X of w._zod.onattach)X($);if(b.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let w=(D,W,Q)=>{let G=_4(D),N;for(let B of W){if(B._zod.def.when){if(!B._zod.def.when(D))continue}else if(G)continue;let H=D.issues.length,J=B._zod.check(D);if(J instanceof Promise&&Q?.async===!1)throw new m6;if(N||J instanceof Promise)N=(N??Promise.resolve()).then(async()=>{if(await J,D.issues.length===H)return;if(!G)G=_4(D,H)});else{if(D.issues.length===H)continue;if(!G)G=_4(D,H)}}if(N)return N.then(()=>{return D});return D},X=(D,W,Q)=>{if(_4(D))return D.aborted=!0,D;let G=w(W,b,Q);if(G instanceof Promise){if(Q.async===!1)throw new m6;return G.then((N)=>$._zod.parse(N,Q))}return $._zod.parse(G,Q)};$._zod.run=(D,W)=>{if(W.skipChecks)return $._zod.parse(D,W);if(W.direction==="backward"){let G=$._zod.parse({value:D.value,issues:[]},{...W,skipChecks:!0});if(G instanceof Promise)return G.then((N)=>{return X(N,D,W)});return X(G,D,W)}let Q=$._zod.parse(D,W);if(Q instanceof Promise){if(W.async===!1)throw new m6;return Q.then((G)=>w(G,b,W))}return w(Q,b,W)}}$["~standard"]={validate:(w)=>{try{let X=jG($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return EG($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),D1=z("$ZodString",($,I)=>{o.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??oG($._zod.bag),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=String(U.value)}catch(w){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),B$=z("$ZodStringFormat",($,I)=>{a1.init($,I),D1.init($,I)}),qN=z("$ZodGUID",($,I)=>{I.pattern??(I.pattern=CG),B$.init($,I)}),FN=z("$ZodUUID",($,I)=>{if(I.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(b===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=X1(b))}else I.pattern??(I.pattern=X1());B$.init($,I)}),MN=z("$ZodEmail",($,I)=>{I.pattern??(I.pattern=gG),B$.init($,I)}),jN=z("$ZodURL",($,I)=>{B$.init($,I),$._zod.check=(U)=>{try{let b=U.value.trim(),w=new URL(b);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(w.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(w.protocol.endsWith(":")?w.protocol.slice(0,-1):w.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=w.href;else U.value=b;return}catch(b){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),EN=z("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=xG()),B$.init($,I)}),SN=z("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=_G),B$.init($,I)}),PN=z("$ZodCUID",($,I)=>{I.pattern??(I.pattern=SG),B$.init($,I)}),kN=z("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=PG),B$.init($,I)}),RN=z("$ZodULID",($,I)=>{I.pattern??(I.pattern=kG),B$.init($,I)}),TN=z("$ZodXID",($,I)=>{I.pattern??(I.pattern=RG),B$.init($,I)}),_N=z("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=TG),B$.init($,I)}),ZN=z("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=iG(I)),B$.init($,I)}),CN=z("$ZodISODate",($,I)=>{I.pattern??(I.pattern=rG),B$.init($,I)}),gN=z("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=nG(I)),B$.init($,I)}),xN=z("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=ZG),B$.init($,I)}),hN=z("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=hG),B$.init($,I),$._zod.bag.format="ipv4"}),fN=z("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=fG),B$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),yN=z("$ZodMAC",($,I)=>{I.pattern??(I.pattern=yG(I.delimiter)),B$.init($,I),$._zod.bag.format="mac"}),uN=z("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=uG),B$.init($,I)}),lN=z("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=lG),B$.init($,I),$._zod.check=(U)=>{let b=U.value.split("/");try{if(b.length!==2)throw new Error;let[w,X]=b;if(!X)throw new Error;let D=Number(X);if(`${D}`!==X)throw new Error;if(D<0||D>128)throw new Error;new URL(`http://[${w}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function cN($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var mN=z("$ZodBase64",($,I)=>{I.pattern??(I.pattern=cG),B$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(cN(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function Nq($){if(!BX.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return cN(U)}var rN=z("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=BX),B$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(Nq(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),nN=z("$ZodE164",($,I)=>{I.pattern??(I.pattern=mG),B$.init($,I)});function Yq($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[b]=U;if(!b)return!1;let w=JSON.parse(atob(b));if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&(!("alg"in w)||w.alg!==I))return!1;return!0}catch{return!1}}var iN=z("$ZodJWT",($,I)=>{B$.init($,I),$._zod.check=(U)=>{if(Yq(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),oN=z("$ZodCustomStringFormat",($,I)=>{B$.init($,I),$._zod.check=(U)=>{if(I.fn(U.value))return;U.issues.push({code:"invalid_format",format:I.format,input:U.value,inst:$,continue:!I.abort})}}),VX=z("$ZodNumber",($,I)=>{o.init($,I),$._zod.pattern=$._zod.bag.pattern??tG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Number(U.value)}catch(D){}let w=U.value;if(typeof w==="number"&&!Number.isNaN(w)&&Number.isFinite(w))return U;let X=typeof w==="number"?Number.isNaN(w)?"NaN":!Number.isFinite(w)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:w,inst:$,...X?{received:X}:{}}),U}}),dN=z("$ZodNumberFormat",($,I)=>{wN.init($,I),VX.init($,I)}),tU=z("$ZodBoolean",($,I)=>{o.init($,I),$._zod.pattern=aG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(X){}let w=U.value;if(typeof w==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:w,inst:$}),U}}),qX=z("$ZodBigInt",($,I)=>{o.init($,I),$._zod.pattern=dG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=BigInt(U.value)}catch(w){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),pN=z("$ZodBigIntFormat",($,I)=>{bN.init($,I),qX.init($,I)}),tN=z("$ZodSymbol",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:w,inst:$}),U}}),aN=z("$ZodUndefined",($,I)=>{o.init($,I),$._zod.pattern=sG,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="undefined")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:w,inst:$}),U}}),eN=z("$ZodNull",($,I)=>{o.init($,I),$._zod.pattern=eG,$._zod.values=new Set([null]),$._zod.parse=(U,b)=>{let w=U.value;if(w===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:w,inst:$}),U}}),sN=z("$ZodAny",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),$Y=z("$ZodUnknown",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),IY=z("$ZodNever",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),UY=z("$ZodVoid",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="undefined")return U;return U.issues.push({expected:"void",code:"invalid_type",input:w,inst:$}),U}}),wY=z("$ZodDate",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=new Date(U.value)}catch(W){}let w=U.value,X=w instanceof Date;if(X&&!Number.isNaN(w.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:w,...X?{received:"Invalid Date"}:{},inst:$}),U}});function sV($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var bY=z("$ZodArray",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({expected:"array",code:"invalid_type",input:w,inst:$}),U;U.value=Array(w.length);let X=[];for(let D=0;D<w.length;D++){let W=w[D],Q=I.element._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>sV(G,U,D)));else sV(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function vX($,I,U,b){if($.issues.length)I.issues.push(...G6(U,$.issues));if($.value===void 0){if(U in b)I.value[U]=void 0}else I.value[U]=$.value}function Bq($){let I=Object.keys($.shape);for(let b of I)if(!$.shape?.[b]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${b}": expected a Zod schema`);let U=vG($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function Jq($,I,U,b,w,X){let D=[],W=w.keySet,Q=w.catchall._zod,G=Q.def.type;for(let N in I){if(W.has(N))continue;if(G==="never"){D.push(N);continue}let B=Q.run({value:I[N],issues:[]},b);if(B instanceof Promise)$.push(B.then((H)=>vX(H,U,N,I)));else vX(B,U,N,I)}if(D.length)U.issues.push({code:"unrecognized_keys",keys:D,input:I,inst:X});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var Hq=z("$ZodObject",($,I)=>{if(o.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let W=I.shape;Object.defineProperty(I,"shape",{get:()=>{let Q={...W};return Object.defineProperty(I,"shape",{value:Q}),Q}})}let b=n1(()=>Bq(I));s($._zod,"propValues",()=>{let W=I.shape,Q={};for(let G in W){let N=W[G]._zod;if(N.values){Q[G]??(Q[G]=new Set);for(let B of N.values)Q[G].add(B)}}return Q});let w=b1,X=I.catchall,D;$._zod.parse=(W,Q)=>{D??(D=b.value);let G=W.value;if(!w(G))return W.issues.push({expected:"object",code:"invalid_type",input:G,inst:$}),W;W.value={};let N=[],B=D.shape;for(let H of D.keys){let A=B[H]._zod.run({value:G[H],issues:[]},Q);if(A instanceof Promise)N.push(A.then((O)=>vX(O,W,H,G)));else vX(A,W,H,G)}if(!X)return N.length?Promise.all(N).then(()=>W):W;return Jq(N,G,W,Q,b.value,$)}}),XY=z("$ZodObjectJIT",($,I)=>{Hq.init($,I);let U=$._zod.parse,b=n1(()=>Bq(I)),w=(H)=>{let J=new AX(["shape","payload","ctx"]),A=b.value,O=(P)=>{let x=$X(P);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};J.write("const input = payload.value;");let V=Object.create(null),q=0;for(let P of A.keys)V[P]=`key_${q++}`;J.write("const newResult = {};");for(let P of A.keys){let x=V[P],l=$X(P);J.write(`const ${x} = ${O(P)};`),J.write(`
45
+ `))}}var vN={major:4,minor:2,patch:1};var o=z("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=vN;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let w of b)for(let X of w._zod.onattach)X($);if(b.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let w=(D,W,Q)=>{let G=_4(D),N;for(let B of W){if(B._zod.def.when){if(!B._zod.def.when(D))continue}else if(G)continue;let H=D.issues.length,J=B._zod.check(D);if(J instanceof Promise&&Q?.async===!1)throw new m6;if(N||J instanceof Promise)N=(N??Promise.resolve()).then(async()=>{if(await J,D.issues.length===H)return;if(!G)G=_4(D,H)});else{if(D.issues.length===H)continue;if(!G)G=_4(D,H)}}if(N)return N.then(()=>{return D});return D},X=(D,W,Q)=>{if(_4(D))return D.aborted=!0,D;let G=w(W,b,Q);if(G instanceof Promise){if(Q.async===!1)throw new m6;return G.then((N)=>$._zod.parse(N,Q))}return $._zod.parse(G,Q)};$._zod.run=(D,W)=>{if(W.skipChecks)return $._zod.parse(D,W);if(W.direction==="backward"){let G=$._zod.parse({value:D.value,issues:[]},{...W,skipChecks:!0});if(G instanceof Promise)return G.then((N)=>{return X(N,D,W)});return X(G,D,W)}let Q=$._zod.parse(D,W);if(Q instanceof Promise){if(W.async===!1)throw new m6;return Q.then((G)=>w(G,b,W))}return w(Q,b,W)}}$["~standard"]={validate:(w)=>{try{let X=jG($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return EG($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),D1=z("$ZodString",($,I)=>{o.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??oG($._zod.bag),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=String(U.value)}catch(w){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),B$=z("$ZodStringFormat",($,I)=>{a1.init($,I),D1.init($,I)}),qN=z("$ZodGUID",($,I)=>{I.pattern??(I.pattern=CG),B$.init($,I)}),FN=z("$ZodUUID",($,I)=>{if(I.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(b===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=X1(b))}else I.pattern??(I.pattern=X1());B$.init($,I)}),MN=z("$ZodEmail",($,I)=>{I.pattern??(I.pattern=gG),B$.init($,I)}),jN=z("$ZodURL",($,I)=>{B$.init($,I),$._zod.check=(U)=>{try{let b=U.value.trim(),w=new URL(b);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(w.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(w.protocol.endsWith(":")?w.protocol.slice(0,-1):w.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=w.href;else U.value=b;return}catch(b){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),EN=z("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=xG()),B$.init($,I)}),SN=z("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=_G),B$.init($,I)}),PN=z("$ZodCUID",($,I)=>{I.pattern??(I.pattern=SG),B$.init($,I)}),kN=z("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=PG),B$.init($,I)}),RN=z("$ZodULID",($,I)=>{I.pattern??(I.pattern=kG),B$.init($,I)}),TN=z("$ZodXID",($,I)=>{I.pattern??(I.pattern=RG),B$.init($,I)}),_N=z("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=TG),B$.init($,I)}),ZN=z("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=iG(I)),B$.init($,I)}),CN=z("$ZodISODate",($,I)=>{I.pattern??(I.pattern=rG),B$.init($,I)}),gN=z("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=nG(I)),B$.init($,I)}),xN=z("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=ZG),B$.init($,I)}),hN=z("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=hG),B$.init($,I),$._zod.bag.format="ipv4"}),fN=z("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=fG),B$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),yN=z("$ZodMAC",($,I)=>{I.pattern??(I.pattern=yG(I.delimiter)),B$.init($,I),$._zod.bag.format="mac"}),uN=z("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=uG),B$.init($,I)}),lN=z("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=lG),B$.init($,I),$._zod.check=(U)=>{let b=U.value.split("/");try{if(b.length!==2)throw new Error;let[w,X]=b;if(!X)throw new Error;let D=Number(X);if(`${D}`!==X)throw new Error;if(D<0||D>128)throw new Error;new URL(`http://[${w}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function cN($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var mN=z("$ZodBase64",($,I)=>{I.pattern??(I.pattern=cG),B$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(cN(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function Yq($){if(!BX.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return cN(U)}var rN=z("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=BX),B$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(Yq(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),nN=z("$ZodE164",($,I)=>{I.pattern??(I.pattern=mG),B$.init($,I)});function Bq($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[b]=U;if(!b)return!1;let w=JSON.parse(atob(b));if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&(!("alg"in w)||w.alg!==I))return!1;return!0}catch{return!1}}var iN=z("$ZodJWT",($,I)=>{B$.init($,I),$._zod.check=(U)=>{if(Bq(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),oN=z("$ZodCustomStringFormat",($,I)=>{B$.init($,I),$._zod.check=(U)=>{if(I.fn(U.value))return;U.issues.push({code:"invalid_format",format:I.format,input:U.value,inst:$,continue:!I.abort})}}),VX=z("$ZodNumber",($,I)=>{o.init($,I),$._zod.pattern=$._zod.bag.pattern??tG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Number(U.value)}catch(D){}let w=U.value;if(typeof w==="number"&&!Number.isNaN(w)&&Number.isFinite(w))return U;let X=typeof w==="number"?Number.isNaN(w)?"NaN":!Number.isFinite(w)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:w,inst:$,...X?{received:X}:{}}),U}}),dN=z("$ZodNumberFormat",($,I)=>{wN.init($,I),VX.init($,I)}),tU=z("$ZodBoolean",($,I)=>{o.init($,I),$._zod.pattern=aG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(X){}let w=U.value;if(typeof w==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:w,inst:$}),U}}),qX=z("$ZodBigInt",($,I)=>{o.init($,I),$._zod.pattern=dG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=BigInt(U.value)}catch(w){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),pN=z("$ZodBigIntFormat",($,I)=>{bN.init($,I),qX.init($,I)}),tN=z("$ZodSymbol",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:w,inst:$}),U}}),aN=z("$ZodUndefined",($,I)=>{o.init($,I),$._zod.pattern=sG,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="undefined")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:w,inst:$}),U}}),eN=z("$ZodNull",($,I)=>{o.init($,I),$._zod.pattern=eG,$._zod.values=new Set([null]),$._zod.parse=(U,b)=>{let w=U.value;if(w===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:w,inst:$}),U}}),sN=z("$ZodAny",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),$Y=z("$ZodUnknown",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),IY=z("$ZodNever",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),UY=z("$ZodVoid",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="undefined")return U;return U.issues.push({expected:"void",code:"invalid_type",input:w,inst:$}),U}}),wY=z("$ZodDate",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=new Date(U.value)}catch(W){}let w=U.value,X=w instanceof Date;if(X&&!Number.isNaN(w.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:w,...X?{received:"Invalid Date"}:{},inst:$}),U}});function $q($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var bY=z("$ZodArray",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({expected:"array",code:"invalid_type",input:w,inst:$}),U;U.value=Array(w.length);let X=[];for(let D=0;D<w.length;D++){let W=w[D],Q=I.element._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>$q(G,U,D)));else $q(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function vX($,I,U,b){if($.issues.length)I.issues.push(...G6(U,$.issues));if($.value===void 0){if(U in b)I.value[U]=void 0}else I.value[U]=$.value}function Jq($){let I=Object.keys($.shape);for(let b of I)if(!$.shape?.[b]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${b}": expected a Zod schema`);let U=vG($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function Hq($,I,U,b,w,X){let D=[],W=w.keySet,Q=w.catchall._zod,G=Q.def.type;for(let N in I){if(W.has(N))continue;if(G==="never"){D.push(N);continue}let B=Q.run({value:I[N],issues:[]},b);if(B instanceof Promise)$.push(B.then((H)=>vX(H,U,N,I)));else vX(B,U,N,I)}if(D.length)U.issues.push({code:"unrecognized_keys",keys:D,input:I,inst:X});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var Aq=z("$ZodObject",($,I)=>{if(o.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let W=I.shape;Object.defineProperty(I,"shape",{get:()=>{let Q={...W};return Object.defineProperty(I,"shape",{value:Q}),Q}})}let b=n1(()=>Jq(I));s($._zod,"propValues",()=>{let W=I.shape,Q={};for(let G in W){let N=W[G]._zod;if(N.values){Q[G]??(Q[G]=new Set);for(let B of N.values)Q[G].add(B)}}return Q});let w=b1,X=I.catchall,D;$._zod.parse=(W,Q)=>{D??(D=b.value);let G=W.value;if(!w(G))return W.issues.push({expected:"object",code:"invalid_type",input:G,inst:$}),W;W.value={};let N=[],B=D.shape;for(let H of D.keys){let A=B[H]._zod.run({value:G[H],issues:[]},Q);if(A instanceof Promise)N.push(A.then((O)=>vX(O,W,H,G)));else vX(A,W,H,G)}if(!X)return N.length?Promise.all(N).then(()=>W):W;return Hq(N,G,W,Q,b.value,$)}}),XY=z("$ZodObjectJIT",($,I)=>{Aq.init($,I);let U=$._zod.parse,b=n1(()=>Jq(I)),w=(H)=>{let J=new AX(["shape","payload","ctx"]),A=b.value,O=(P)=>{let x=$X(P);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};J.write("const input = payload.value;");let V=Object.create(null),q=0;for(let P of A.keys)V[P]=`key_${q++}`;J.write("const newResult = {};");for(let P of A.keys){let x=V[P],l=$X(P);J.write(`const ${x} = ${O(P)};`),J.write(`
46
46
  if (${x}.issues.length) {
47
47
  payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
48
48
  ...iss,
@@ -59,18 +59,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
59
59
  newResult[${l}] = ${x}.value;
60
60
  }
61
61
 
62
- `)}J.write("payload.value = newResult;"),J.write("return payload;");let k=J.compile();return(P,x)=>k(H,P,x)},X,D=b1,W=!fU.jitless,G=W&&zG.value,N=I.catchall,B;$._zod.parse=(H,J)=>{B??(B=b.value);let A=H.value;if(!D(A))return H.issues.push({expected:"object",code:"invalid_type",input:A,inst:$}),H;if(W&&G&&J?.async===!1&&J.jitless!==!0){if(!X)X=w(I.shape);if(H=X(H,J),!N)return H;return Jq([],A,H,J,B,$)}return U(H,J)}});function $q($,I,U,b){for(let X of $)if(X.issues.length===0)return I.value=X.value,I;let w=$.filter((X)=>!_4(X));if(w.length===1)return I.value=w[0].value,w[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((X)=>X.issues.map((D)=>U6(D,b,P$())))}),I}var aU=z("$ZodUnion",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.options.some((w)=>w._zod.optin==="optional")?"optional":void 0),s($._zod,"optout",()=>I.options.some((w)=>w._zod.optout==="optional")?"optional":void 0),s($._zod,"values",()=>{if(I.options.every((w)=>w._zod.values))return new Set(I.options.flatMap((w)=>Array.from(w._zod.values)));return}),s($._zod,"pattern",()=>{if(I.options.every((w)=>w._zod.pattern)){let w=I.options.map((X)=>X._zod.pattern);return new RegExp(`^(${w.map((X)=>lU(X.source)).join("|")})$`)}return});let U=I.options.length===1,b=I.options[0]._zod.run;$._zod.parse=(w,X)=>{if(U)return b(w,X);let D=!1,W=[];for(let Q of I.options){let G=Q._zod.run({value:w.value,issues:[]},X);if(G instanceof Promise)W.push(G),D=!0;else{if(G.issues.length===0)return G;W.push(G)}}if(!D)return $q(W,w,$,X);return Promise.all(W).then((Q)=>{return $q(Q,w,$,X)})}});function Iq($,I,U,b){let w=$.filter((X)=>X.issues.length===0);if(w.length===1)return I.value=w[0].value,I;if(w.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((X)=>X.issues.map((D)=>U6(D,b,P$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var DY=z("$ZodXor",($,I)=>{aU.init($,I),I.inclusive=!1;let U=I.options.length===1,b=I.options[0]._zod.run;$._zod.parse=(w,X)=>{if(U)return b(w,X);let D=!1,W=[];for(let Q of I.options){let G=Q._zod.run({value:w.value,issues:[]},X);if(G instanceof Promise)W.push(G),D=!0;else W.push(G)}if(!D)return Iq(W,w,$,X);return Promise.all(W).then((Q)=>{return Iq(Q,w,$,X)})}}),WY=z("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,aU.init($,I);let U=$._zod.parse;s($._zod,"propValues",()=>{let w={};for(let X of I.options){let D=X._zod.propValues;if(!D||Object.keys(D).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(X)}"`);for(let[W,Q]of Object.entries(D)){if(!w[W])w[W]=new Set;for(let G of Q)w[W].add(G)}}return w});let b=n1(()=>{let w=I.options,X=new Map;for(let D of w){let W=D._zod.propValues?.[I.discriminator];if(!W||W.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(D)}"`);for(let Q of W){if(X.has(Q))throw new Error(`Duplicate discriminator value "${String(Q)}"`);X.set(Q,D)}}return X});$._zod.parse=(w,X)=>{let D=w.value;if(!b1(D))return w.issues.push({code:"invalid_type",expected:"object",input:D,inst:$}),w;let W=b.value.get(D?.[I.discriminator]);if(W)return W._zod.run(w,X);if(I.unionFallback)return U(w,X);return w.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:D,path:[I.discriminator],inst:$}),w}}),QY=z("$ZodIntersection",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value,X=I.left._zod.run({value:w,issues:[]},b),D=I.right._zod.run({value:w,issues:[]},b);if(X instanceof Promise||D instanceof Promise)return Promise.all([X,D]).then(([Q,G])=>{return Uq(U,Q,G)});return Uq(U,X,D)}});function VN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(T4($)&&T4(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=VN($[X],I[X]);if(!D.valid)return{valid:!1,mergeErrorPath:[X,...D.mergeErrorPath]};w[X]=D.data}return{valid:!0,data:w}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let b=0;b<$.length;b++){let w=$[b],X=I[b],D=VN(w,X);if(!D.valid)return{valid:!1,mergeErrorPath:[b,...D.mergeErrorPath]};U.push(D.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function Uq($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(_4($))return $;let b=VN(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var FX=z("$ZodTuple",($,I)=>{o.init($,I);let U=I.items;$._zod.parse=(b,w)=>{let X=b.value;if(!Array.isArray(X))return b.issues.push({input:X,inst:$,expected:"tuple",code:"invalid_type"}),b;b.value=[];let D=[],W=[...U].reverse().findIndex((N)=>N._zod.optin!=="optional"),Q=W===-1?0:U.length-W;if(!I.rest){let N=X.length>U.length,B=X.length<Q-1;if(N||B)return b.issues.push({...N?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:X,inst:$,origin:"array"}),b}let G=-1;for(let N of U){if(G++,G>=X.length){if(G>=Q)continue}let B=N._zod.run({value:X[G],issues:[]},w);if(B instanceof Promise)D.push(B.then((H)=>OX(H,b,G)));else OX(B,b,G)}if(I.rest){let N=X.slice(U.length);for(let B of N){G++;let H=I.rest._zod.run({value:B,issues:[]},w);if(H instanceof Promise)D.push(H.then((J)=>OX(J,b,G)));else OX(H,b,G)}}if(D.length)return Promise.all(D).then(()=>b);return b}});function OX($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var GY=z("$ZodRecord",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!T4(w))return U.issues.push({expected:"record",code:"invalid_type",input:w,inst:$}),U;let X=[],D=I.keyType._zod.values;if(D){U.value={};let W=new Set;for(let G of D)if(typeof G==="string"||typeof G==="number"||typeof G==="symbol"){W.add(typeof G==="number"?G.toString():G);let N=I.valueType._zod.run({value:w[G],issues:[]},b);if(N instanceof Promise)X.push(N.then((B)=>{if(B.issues.length)U.issues.push(...G6(G,B.issues));U.value[G]=B.value}));else{if(N.issues.length)U.issues.push(...G6(G,N.issues));U.value[G]=N.value}}let Q;for(let G in w)if(!W.has(G))Q=Q??[],Q.push(G);if(Q&&Q.length>0)U.issues.push({code:"unrecognized_keys",input:w,inst:$,keys:Q})}else{U.value={};for(let W of Reflect.ownKeys(w)){if(W==="__proto__")continue;let Q=I.keyType._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(Q.issues.length){if(I.mode==="loose")U.value[W]=w[W];else U.issues.push({code:"invalid_key",origin:"record",issues:Q.issues.map((N)=>U6(N,b,P$())),input:W,path:[W],inst:$});continue}let G=I.valueType._zod.run({value:w[W],issues:[]},b);if(G instanceof Promise)X.push(G.then((N)=>{if(N.issues.length)U.issues.push(...G6(W,N.issues));U.value[Q.value]=N.value}));else{if(G.issues.length)U.issues.push(...G6(W,G.issues));U.value[Q.value]=G.value}}}if(X.length)return Promise.all(X).then(()=>U);return U}}),NY=z("$ZodMap",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!(w instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:w,inst:$}),U;let X=[];U.value=new Map;for(let[D,W]of w){let Q=I.keyType._zod.run({value:D,issues:[]},b),G=I.valueType._zod.run({value:W,issues:[]},b);if(Q instanceof Promise||G instanceof Promise)X.push(Promise.all([Q,G]).then(([N,B])=>{wq(N,B,U,D,w,$,b)}));else wq(Q,G,U,D,w,$,b)}if(X.length)return Promise.all(X).then(()=>U);return U}});function wq($,I,U,b,w,X,D){if($.issues.length)if(cU.has(typeof b))U.issues.push(...G6(b,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:w,inst:X,issues:$.issues.map((W)=>U6(W,D,P$()))});if(I.issues.length)if(cU.has(typeof b))U.issues.push(...G6(b,I.issues));else U.issues.push({origin:"map",code:"invalid_element",input:w,inst:X,key:b,issues:I.issues.map((W)=>U6(W,D,P$()))});U.value.set($.value,I.value)}var YY=z("$ZodSet",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!(w instanceof Set))return U.issues.push({input:w,inst:$,expected:"set",code:"invalid_type"}),U;let X=[];U.value=new Set;for(let D of w){let W=I.valueType._zod.run({value:D,issues:[]},b);if(W instanceof Promise)X.push(W.then((Q)=>bq(Q,U)));else bq(W,U)}if(X.length)return Promise.all(X).then(()=>U);return U}});function bq($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var BY=z("$ZodEnum",($,I)=>{o.init($,I);let U=uU(I.entries),b=new Set(U);$._zod.values=b,$._zod.pattern=new RegExp(`^(${U.filter((w)=>cU.has(typeof w)).map((w)=>typeof w==="string"?L6(w):w.toString()).join("|")})$`),$._zod.parse=(w,X)=>{let D=w.value;if(b.has(D))return w;return w.issues.push({code:"invalid_value",values:U,input:D,inst:$}),w}}),JY=z("$ZodLiteral",($,I)=>{if(o.init($,I),I.values.length===0)throw new Error("Cannot create literal schema with no valid values");let U=new Set(I.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${I.values.map((b)=>typeof b==="string"?L6(b):b?L6(b.toString()):String(b)).join("|")})$`),$._zod.parse=(b,w)=>{let X=b.value;if(U.has(X))return b;return b.issues.push({code:"invalid_value",values:I.values,input:X,inst:$}),b}}),HY=z("$ZodFile",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(w instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:w,inst:$}),U}}),AY=z("$ZodTransform",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1($.constructor.name);let w=I.transform(U.value,U);if(b.async)return(w instanceof Promise?w:Promise.resolve(w)).then((D)=>{return U.value=D,U});if(w instanceof Promise)throw new m6;return U.value=w,U}});function Xq($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var OY=z("$ZodOptional",($,I)=>{o.init($,I),$._zod.optin="optional",$._zod.optout="optional",s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${lU(U.source)})?$`):void 0}),$._zod.parse=(U,b)=>{if(I.innerType._zod.optin==="optional"){let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Xq(X,U.value));return Xq(w,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),zY=z("$ZodNullable",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${lU(U.source)}|null)$`):void 0}),s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,b)=>{if(U.value===null)return U;return I.innerType._zod.run(U,b)}}),LY=z("$ZodDefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);if(U.value===void 0)return U.value=I.defaultValue,U;let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Dq(X,I));return Dq(w,I)}});function Dq($,I){if($.value===void 0)$.value=I.defaultValue;return $}var KY=z("$ZodPrefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,b)}}),vY=z("$ZodNonOptional",($,I)=>{o.init($,I),s($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Wq(X,$));return Wq(w,$)}});function Wq($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var VY=z("$ZodSuccess",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1("ZodSuccess");let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{return U.value=X.issues.length===0,U});return U.value=w.issues.length===0,U}}),qY=z("$ZodCatch",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{if(U.value=X.value,X.issues.length)U.value=I.catchValue({...U,error:{issues:X.issues.map((D)=>U6(D,b,P$()))},input:U.value}),U.issues=[];return U});if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((X)=>U6(X,b,P$()))},input:U.value}),U.issues=[];return U}}),FY=z("$ZodNaN",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),MY=z("$ZodPipe",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,b)=>{if(b.direction==="backward"){let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>zX(D,I.in,b));return zX(X,I.in,b)}let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>zX(X,I.out,b));return zX(w,I.out,b)}});function zX($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var eU=z("$ZodCodec",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,b)=>{if((b.direction||"forward")==="forward"){let X=I.in._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>LX(D,I,b));return LX(X,I,b)}else{let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>LX(D,I,b));return LX(X,I,b)}}});function LX($,I,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let w=I.transform($.value,$);if(w instanceof Promise)return w.then((X)=>KX($,X,I.out,U));return KX($,w,I.out,U)}else{let w=I.reverseTransform($.value,$);if(w instanceof Promise)return w.then((X)=>KX($,X,I.in,U));return KX($,w,I.in,U)}}function KX($,I,U,b){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},b)}var jY=z("$ZodReadonly",($,I)=>{o.init($,I),s($._zod,"propValues",()=>I.innerType._zod.propValues),s($._zod,"values",()=>I.innerType._zod.values),s($._zod,"optin",()=>I.innerType?._zod?.optin),s($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then(Qq);return Qq(w)}});function Qq($){return $.value=Object.freeze($.value),$}var EY=z("$ZodTemplateLiteral",($,I)=>{o.init($,I);let U=[];for(let b of I.parts)if(typeof b==="object"&&b!==null){if(!b._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...b._zod.traits].shift()}`);let w=b._zod.pattern instanceof RegExp?b._zod.pattern.source:b._zod.pattern;if(!w)throw new Error(`Invalid template literal part: ${b._zod.traits}`);let X=w.startsWith("^")?1:0,D=w.endsWith("$")?w.length-1:w.length;U.push(w.slice(X,D))}else if(b===null||KG.has(typeof b))U.push(L6(`${b}`));else throw new Error(`Invalid template literal part: ${b}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(b,w)=>{if(typeof b.value!=="string")return b.issues.push({input:b.value,inst:$,expected:"template_literal",code:"invalid_type"}),b;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(b.value))return b.issues.push({input:b.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),b;return b}}),SY=z("$ZodFunction",($,I)=>{return o.init($,I),$._def=I,$._zod.def=I,$.implement=(U)=>{if(typeof U!=="function")throw new Error("implement() must be called with a function");return function(...b){let w=$._def.input?UX($._def.input,b):b,X=Reflect.apply(U,this,w);if($._def.output)return UX($._def.output,X);return X}},$.implementAsync=(U)=>{if(typeof U!=="function")throw new Error("implementAsync() must be called with a function");return async function(...b){let w=$._def.input?await wX($._def.input,b):b,X=await Reflect.apply(U,this,w);if($._def.output)return await wX($._def.output,X);return X}},$._zod.parse=(U,b)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let b=$.constructor;if(Array.isArray(U[0]))return new b({type:"function",input:new FX({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new b({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),PY=z("$ZodPromise",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return Promise.resolve(U.value).then((w)=>I.innerType._zod.run({value:w,issues:[]},b))}}),kY=z("$ZodLazy",($,I)=>{o.init($,I),s($._zod,"innerType",()=>I.getter()),s($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),s($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),s($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),s($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,b)=>{return $._zod.innerType._zod.run(U,b)}}),RY=z("$ZodCustom",($,I)=>{A$.init($,I),o.init($,I),$._zod.parse=(U,b)=>{return U},$._zod.check=(U)=>{let b=U.value,w=I.fn(b);if(w instanceof Promise)return w.then((X)=>Gq(X,U,b,$));Gq(w,U,b,$);return}});function Gq($,I,U,b){if(!$){let w={code:"custom",input:U,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)w.params=b._zod.def.params;I.issues.push(i1(w))}}var b0={};v6(b0,{zhTW:()=>K7,zhCN:()=>L7,yo:()=>v7,vi:()=>z7,ur:()=>O7,uk:()=>w0,ua:()=>A7,tr:()=>H7,th:()=>J7,ta:()=>B7,sv:()=>Y7,sl:()=>N7,ru:()=>G7,pt:()=>Q7,ps:()=>D7,pl:()=>W7,ota:()=>X7,no:()=>b7,nl:()=>w7,ms:()=>U7,mk:()=>I7,lt:()=>$7,ko:()=>sY,km:()=>$0,kh:()=>eY,ka:()=>aY,ja:()=>tY,it:()=>pY,is:()=>dY,id:()=>oY,hu:()=>iY,he:()=>nY,frCA:()=>rY,fr:()=>mY,fi:()=>cY,fa:()=>lY,es:()=>uY,eo:()=>yY,en:()=>sU,de:()=>fY,da:()=>hY,cs:()=>xY,ca:()=>gY,bg:()=>CY,be:()=>ZY,az:()=>_Y,ar:()=>TY});var Mf=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${w.expected}، ولكن تم إدخال ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${j(w.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return` أكبر من اللازم: يفترض أن تكون ${w.origin??"القيمة"} ${X} ${w.maximum.toString()} ${D.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${w.origin??"القيمة"} ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`أصغر من اللازم: يفترض لـ ${w.origin} أن يكون ${X} ${w.minimum.toString()} ${D.unit}`;return`أصغر من اللازم: يفترض لـ ${w.origin} أن يكون ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${w.prefix}"`;if(X.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${X.suffix}"`;if(X.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${X.includes}"`;if(X.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${X.pattern}`;return`${b[X.format]??w.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${w.divisor}`;case"unrecognized_keys":return`معرف${w.keys.length>1?"ات":""} غريب${w.keys.length>1?"ة":""}: ${L(w.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${w.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${w.origin}`;default:return"مدخل غير مقبول"}}};function TY(){return{localeError:Mf()}}var jf=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${w.expected}, daxil olan ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Yanlış dəyər: gözlənilən ${j(w.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Çox böyük: gözlənilən ${w.origin??"dəyər"} ${X}${w.maximum.toString()} ${D.unit??"element"}`;return`Çox böyük: gözlənilən ${w.origin??"dəyər"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Çox kiçik: gözlənilən ${w.origin} ${X}${w.minimum.toString()} ${D.unit}`;return`Çox kiçik: gözlənilən ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Yanlış mətn: "${X.prefix}" ilə başlamalıdır`;if(X.format==="ends_with")return`Yanlış mətn: "${X.suffix}" ilə bitməlidir`;if(X.format==="includes")return`Yanlış mətn: "${X.includes}" daxil olmalıdır`;if(X.format==="regex")return`Yanlış mətn: ${X.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${b[X.format]??w.format}`}case"not_multiple_of":return`Yanlış ədəd: ${w.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${w.keys.length>1?"lar":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${w.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function _Y(){return{localeError:jf()}}function Aq($,I,U,b){let w=Math.abs($),X=w%10,D=w%100;if(D>=11&&D<=19)return b;if(X===1)return I;if(X>=2&&X<=4)return U;return b}var Ef=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"лік";case"object":{if(Array.isArray(w))return"масіў";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${w.expected}, атрымана ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Няправільны ўвод: чакалася ${j(w.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D){let W=Number(w.maximum),Q=Aq(W,D.unit.one,D.unit.few,D.unit.many);return`Занадта вялікі: чакалася, што ${w.origin??"значэнне"} павінна ${D.verb} ${X}${w.maximum.toString()} ${Q}`}return`Занадта вялікі: чакалася, што ${w.origin??"значэнне"} павінна быць ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D){let W=Number(w.minimum),Q=Aq(W,D.unit.one,D.unit.few,D.unit.many);return`Занадта малы: чакалася, што ${w.origin} павінна ${D.verb} ${X}${w.minimum.toString()} ${Q}`}return`Занадта малы: чакалася, што ${w.origin} павінна быць ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${X.prefix}"`;if(X.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${X.suffix}"`;if(X.format==="includes")return`Няправільны радок: павінен змяшчаць "${X.includes}"`;if(X.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${X.pattern}`;return`Няправільны ${b[X.format]??w.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${w.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${w.keys.length>1?"ключы":"ключ"}: ${L(w.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${w.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${w.origin}`;default:return"Няправільны ўвод"}}};function ZY(){return{localeError:Ef()}}var Sf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"число";case"object":{if(Array.isArray($))return"масив";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},Pf=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(b){return $[b]??null}let U={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(b)=>{switch(b.code){case"invalid_type":return`Невалиден вход: очакван ${b.expected}, получен ${Sf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Невалиден вход: очакван ${j(b.values[0])}`;return`Невалидна опция: очаквано едно от ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Твърде голямо: очаква се ${b.origin??"стойност"} да съдържа ${w}${b.maximum.toString()} ${X.unit??"елемента"}`;return`Твърде голямо: очаква се ${b.origin??"стойност"} да бъде ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Твърде малко: очаква се ${b.origin} да съдържа ${w}${b.minimum.toString()} ${X.unit}`;return`Твърде малко: очаква се ${b.origin} да бъде ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Невалиден низ: трябва да започва с "${w.prefix}"`;if(w.format==="ends_with")return`Невалиден низ: трябва да завършва с "${w.suffix}"`;if(w.format==="includes")return`Невалиден низ: трябва да включва "${w.includes}"`;if(w.format==="regex")return`Невалиден низ: трябва да съвпада с ${w.pattern}`;let X="Невалиден";if(w.format==="emoji")X="Невалидно";if(w.format==="datetime")X="Невалидно";if(w.format==="date")X="Невалидна";if(w.format==="time")X="Невалидно";if(w.format==="duration")X="Невалидна";return`${X} ${U[w.format]??b.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${b.divisor}`;case"unrecognized_keys":return`Неразпознат${b.keys.length>1?"и":""} ключ${b.keys.length>1?"ове":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${b.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${b.origin}`;default:return"Невалиден вход"}}};function CY(){return{localeError:Pf()}}var kf=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Tipus invàlid: s'esperava ${w.expected}, s'ha rebut ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Valor invàlid: s'esperava ${j(w.values[0])}`;return`Opció invàlida: s'esperava una de ${L(w.values," o ")}`;case"too_big":{let X=w.inclusive?"com a màxim":"menys de",D=I(w.origin);if(D)return`Massa gran: s'esperava que ${w.origin??"el valor"} contingués ${X} ${w.maximum.toString()} ${D.unit??"elements"}`;return`Massa gran: s'esperava que ${w.origin??"el valor"} fos ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"com a mínim":"més de",D=I(w.origin);if(D)return`Massa petit: s'esperava que ${w.origin} contingués ${X} ${w.minimum.toString()} ${D.unit}`;return`Massa petit: s'esperava que ${w.origin} fos ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Format invàlid: ha de començar amb "${X.prefix}"`;if(X.format==="ends_with")return`Format invàlid: ha d'acabar amb "${X.suffix}"`;if(X.format==="includes")return`Format invàlid: ha d'incloure "${X.includes}"`;if(X.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${X.pattern}`;return`Format invàlid per a ${b[X.format]??w.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${w.divisor}`;case"unrecognized_keys":return`Clau${w.keys.length>1?"s":""} no reconeguda${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${w.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${w.origin}`;default:return"Entrada invàlida"}}};function gY(){return{localeError:kf()}}var Rf=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"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(w))return"pole";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Neplatný vstup: očekáváno ${w.expected}, obdrženo ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Neplatný vstup: očekáváno ${j(w.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Hodnota je příliš velká: ${w.origin??"hodnota"} musí mít ${X}${w.maximum.toString()} ${D.unit??"prvků"}`;return`Hodnota je příliš velká: ${w.origin??"hodnota"} musí být ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Hodnota je příliš malá: ${w.origin??"hodnota"} musí mít ${X}${w.minimum.toString()} ${D.unit??"prvků"}`;return`Hodnota je příliš malá: ${w.origin??"hodnota"} musí být ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Neplatný řetězec: musí začínat na "${X.prefix}"`;if(X.format==="ends_with")return`Neplatný řetězec: musí končit na "${X.suffix}"`;if(X.format==="includes")return`Neplatný řetězec: musí obsahovat "${X.includes}"`;if(X.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${X.pattern}`;return`Neplatný formát ${b[X.format]??w.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${w.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${L(w.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${w.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${w.origin}`;default:return"Neplatný vstup"}}};function xY(){return{localeError:Rf()}}var Tf=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},I={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function U(D){return $[D]??null}function b(D){return I[D]??D}let w=(D)=>{let W=typeof D;switch(W){case"number":return Number.isNaN(D)?"NaN":"tal";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"objekt"}}return W},X={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Ugyldigt input: forventede ${b(D.expected)}, fik ${b(w(D.input))}`;case"invalid_value":if(D.values.length===1)return`Ugyldig værdi: forventede ${j(D.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${L(D.values,"|")}`;case"too_big":{let W=D.inclusive?"<=":"<",Q=U(D.origin),G=b(D.origin);if(Q)return`For stor: forventede ${G??"value"} ${Q.verb} ${W} ${D.maximum.toString()} ${Q.unit??"elementer"}`;return`For stor: forventede ${G??"value"} havde ${W} ${D.maximum.toString()}`}case"too_small":{let W=D.inclusive?">=":">",Q=U(D.origin),G=b(D.origin);if(Q)return`For lille: forventede ${G} ${Q.verb} ${W} ${D.minimum.toString()} ${Q.unit}`;return`For lille: forventede ${G} havde ${W} ${D.minimum.toString()}`}case"invalid_format":{let W=D;if(W.format==="starts_with")return`Ugyldig streng: skal starte med "${W.prefix}"`;if(W.format==="ends_with")return`Ugyldig streng: skal ende med "${W.suffix}"`;if(W.format==="includes")return`Ugyldig streng: skal indeholde "${W.includes}"`;if(W.format==="regex")return`Ugyldig streng: skal matche mønsteret ${W.pattern}`;return`Ugyldig ${X[W.format]??D.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${D.divisor}`;case"unrecognized_keys":return`${D.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${L(D.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${D.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${D.origin}`;default:return"Ugyldigt input"}}};function hY(){return{localeError:Tf()}}var _f=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"Zahl";case"object":{if(Array.isArray(w))return"Array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${w.expected}, erhalten ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ungültige Eingabe: erwartet ${j(w.values[0])}`;return`Ungültige Option: erwartet eine von ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Zu groß: erwartet, dass ${w.origin??"Wert"} ${X}${w.maximum.toString()} ${D.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${w.origin??"Wert"} ${X}${w.maximum.toString()} ist`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Zu klein: erwartet, dass ${w.origin} ${X}${w.minimum.toString()} ${D.unit} hat`;return`Zu klein: erwartet, dass ${w.origin} ${X}${w.minimum.toString()} ist`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ungültiger String: muss mit "${X.prefix}" beginnen`;if(X.format==="ends_with")return`Ungültiger String: muss mit "${X.suffix}" enden`;if(X.format==="includes")return`Ungültiger String: muss "${X.includes}" enthalten`;if(X.format==="regex")return`Ungültiger String: muss dem Muster ${X.pattern} entsprechen`;return`Ungültig: ${b[X.format]??w.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${w.divisor} sein`;case"unrecognized_keys":return`${w.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${w.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${w.origin}`;default:return"Ungültige Eingabe"}}};function fY(){return{localeError:_f()}}var Zf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},Cf=()=>{let $={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 I(b){return $[b]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${Zf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${j(b.values[0])}`;return`Invalid option: expected one of ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Too big: expected ${b.origin??"value"} to have ${w}${b.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Too small: expected ${b.origin} to have ${w}${b.minimum.toString()} ${X.unit}`;return`Too small: expected ${b.origin} to be ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${U[w.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function sU(){return{localeError:Cf()}}var gf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},xf=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(b){return $[b]??null}let U={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(b)=>{switch(b.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${b.expected}, riceviĝis ${gf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Nevalida enigo: atendiĝis ${j(b.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${w}${b.maximum.toString()} ${X.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Tro malgranda: atendiĝis ke ${b.origin} havu ${w}${b.minimum.toString()} ${X.unit}`;return`Tro malgranda: atendiĝis ke ${b.origin} estu ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${w.prefix}"`;if(w.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${w.suffix}"`;if(w.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${w.includes}"`;if(w.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${w.pattern}`;return`Nevalida ${U[w.format]??b.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${b.divisor}`;case"unrecognized_keys":return`Nekonata${b.keys.length>1?"j":""} ŝlosilo${b.keys.length>1?"j":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${b.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${b.origin}`;default:return"Nevalida enigo"}}};function yY(){return{localeError:xf()}}var hf=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},I={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function U(D){return $[D]??null}function b(D){return I[D]??D}let w=(D)=>{let W=typeof D;switch(W){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)return D.constructor.name;return"object"}}return W},X={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 ${b(D.expected)}, recibido ${b(w(D.input))}`;case"invalid_value":if(D.values.length===1)return`Entrada inválida: se esperaba ${j(D.values[0])}`;return`Opción inválida: se esperaba una de ${L(D.values,"|")}`;case"too_big":{let W=D.inclusive?"<=":"<",Q=U(D.origin),G=b(D.origin);if(Q)return`Demasiado grande: se esperaba que ${G??"valor"} tuviera ${W}${D.maximum.toString()} ${Q.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${G??"valor"} fuera ${W}${D.maximum.toString()}`}case"too_small":{let W=D.inclusive?">=":">",Q=U(D.origin),G=b(D.origin);if(Q)return`Demasiado pequeño: se esperaba que ${G} tuviera ${W}${D.minimum.toString()} ${Q.unit}`;return`Demasiado pequeño: se esperaba que ${G} fuera ${W}${D.minimum.toString()}`}case"invalid_format":{let W=D;if(W.format==="starts_with")return`Cadena inválida: debe comenzar con "${W.prefix}"`;if(W.format==="ends_with")return`Cadena inválida: debe terminar en "${W.suffix}"`;if(W.format==="includes")return`Cadena inválida: debe incluir "${W.includes}"`;if(W.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${W.pattern}`;return`Inválido ${X[W.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":""}: ${L(D.keys,", ")}`;case"invalid_key":return`Llave inválida en ${b(D.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${b(D.origin)}`;default:return"Entrada inválida"}}};function uY(){return{localeError:hf()}}var ff=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"عدد";case"object":{if(Array.isArray(w))return"آرایه";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${w.expected} می‌بود، ${U(w.input)} دریافت شد`;case"invalid_value":if(w.values.length===1)return`ورودی نامعتبر: می‌بایست ${j(w.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${L(w.values,"|")} می‌بود`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`خیلی بزرگ: ${w.origin??"مقدار"} باید ${X}${w.maximum.toString()} ${D.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${w.origin??"مقدار"} باید ${X}${w.maximum.toString()} باشد`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`خیلی کوچک: ${w.origin} باید ${X}${w.minimum.toString()} ${D.unit} باشد`;return`خیلی کوچک: ${w.origin} باید ${X}${w.minimum.toString()} باشد`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`رشته نامعتبر: باید با "${X.prefix}" شروع شود`;if(X.format==="ends_with")return`رشته نامعتبر: باید با "${X.suffix}" تمام شود`;if(X.format==="includes")return`رشته نامعتبر: باید شامل "${X.includes}" باشد`;if(X.format==="regex")return`رشته نامعتبر: باید با الگوی ${X.pattern} مطابقت داشته باشد`;return`${b[X.format]??w.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${w.divisor} باشد`;case"unrecognized_keys":return`کلید${w.keys.length>1?"های":""} ناشناس: ${L(w.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${w.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${w.origin}`;default:return"ورودی نامعتبر"}}};function lY(){return{localeError:ff()}}var yf=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${w.expected}, oli ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Virheellinen syöte: täytyy olla ${j(w.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Liian suuri: ${D.subject} täytyy olla ${X}${w.maximum.toString()} ${D.unit}`.trim();return`Liian suuri: arvon täytyy olla ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Liian pieni: ${D.subject} täytyy olla ${X}${w.minimum.toString()} ${D.unit}`.trim();return`Liian pieni: arvon täytyy olla ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${X.prefix}"`;if(X.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${X.suffix}"`;if(X.format==="includes")return`Virheellinen syöte: täytyy sisältää "${X.includes}"`;if(X.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${X.pattern}`;return`Virheellinen ${b[X.format]??w.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${w.divisor} monikerta`;case"unrecognized_keys":return`${w.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${L(w.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 cY(){return{localeError:yf()}}var uf=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nombre";case"object":{if(Array.isArray(w))return"tableau";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Entrée invalide : ${w.expected} attendu, ${U(w.input)} reçu`;case"invalid_value":if(w.values.length===1)return`Entrée invalide : ${j(w.values[0])} attendu`;return`Option invalide : une valeur parmi ${L(w.values,"|")} attendue`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Trop grand : ${w.origin??"valeur"} doit ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"élément(s)"}`;return`Trop grand : ${w.origin??"valeur"} doit être ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Trop petit : ${w.origin} doit ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Trop petit : ${w.origin} doit être ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chaîne invalide : doit commencer par "${X.prefix}"`;if(X.format==="ends_with")return`Chaîne invalide : doit se terminer par "${X.suffix}"`;if(X.format==="includes")return`Chaîne invalide : doit inclure "${X.includes}"`;if(X.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${X.pattern}`;return`${b[X.format]??w.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${w.divisor}`;case"unrecognized_keys":return`Clé${w.keys.length>1?"s":""} non reconnue${w.keys.length>1?"s":""} : ${L(w.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${w.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${w.origin}`;default:return"Entrée invalide"}}};function mY(){return{localeError:uf()}}var lf=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Entrée invalide : attendu ${w.expected}, reçu ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Entrée invalide : attendu ${j(w.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"≤":"<",D=I(w.origin);if(D)return`Trop grand : attendu que ${w.origin??"la valeur"} ait ${X}${w.maximum.toString()} ${D.unit}`;return`Trop grand : attendu que ${w.origin??"la valeur"} soit ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"≥":">",D=I(w.origin);if(D)return`Trop petit : attendu que ${w.origin} ait ${X}${w.minimum.toString()} ${D.unit}`;return`Trop petit : attendu que ${w.origin} soit ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chaîne invalide : doit commencer par "${X.prefix}"`;if(X.format==="ends_with")return`Chaîne invalide : doit se terminer par "${X.suffix}"`;if(X.format==="includes")return`Chaîne invalide : doit inclure "${X.includes}"`;if(X.format==="regex")return`Chaîne invalide : doit correspondre au motif ${X.pattern}`;return`${b[X.format]??w.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${w.divisor}`;case"unrecognized_keys":return`Clé${w.keys.length>1?"s":""} non reconnue${w.keys.length>1?"s":""} : ${L(w.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${w.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${w.origin}`;default:return"Entrée invalide"}}};function rY(){return{localeError:lf()}}var cf=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(G)=>G?$[G]:void 0,b=(G)=>{let N=U(G);if(N)return N.label;return G??$.unknown.label},w=(G)=>`ה${b(G)}`,X=(G)=>{return(U(G)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},D=(G)=>{if(!G)return null;return I[G]??null},W=(G)=>{let N=typeof G;switch(N){case"number":return Number.isNaN(G)?"NaN":"number";case"object":{if(Array.isArray(G))return"array";if(G===null)return"null";if(Object.getPrototypeOf(G)!==Object.prototype&&G.constructor)return G.constructor.name;return"object"}default:return N}},Q={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(G)=>{switch(G.code){case"invalid_type":{let N=G.expected,B=b(N),H=W(G.input),J=$[H]?.label??H;return`קלט לא תקין: צריך להיות ${B}, התקבל ${J}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(G.values[0])}`;let N=G.values.map((J)=>j(J));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${N[0]} או ${N[1]}`;let B=N[N.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${N.slice(0,-1).join(", ")} או ${B}`}case"too_big":{let N=D(G.origin),B=w(G.origin??"value");if(G.origin==="string")return`${N?.longLabel??"ארוך"} מדי: ${B} צריכה להכיל ${G.maximum.toString()} ${N?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let A=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${B} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך",O=G.inclusive?`${G.maximum} ${N?.unit??""} או פחות`:`פחות מ-${G.maximum} ${N?.unit??""}`;return`גדול מדי: ${B} ${A} להכיל ${O}`.trim()}let H=G.inclusive?"<=":"<",J=X(G.origin??"value");if(N?.unit)return`${N.longLabel} מדי: ${B} ${J} ${H}${G.maximum.toString()} ${N.unit}`;return`${N?.longLabel??"גדול"} מדי: ${B} ${J} ${H}${G.maximum.toString()}`}case"too_small":{let N=D(G.origin),B=w(G.origin??"value");if(G.origin==="string")return`${N?.shortLabel??"קצר"} מדי: ${B} צריכה להכיל ${G.minimum.toString()} ${N?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let A=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${B} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך";if(G.minimum===1&&G.inclusive){let V=G.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${B} ${A} להכיל ${V}`}let O=G.inclusive?`${G.minimum} ${N?.unit??""} או יותר`:`יותר מ-${G.minimum} ${N?.unit??""}`;return`קטן מדי: ${B} ${A} להכיל ${O}`.trim()}let H=G.inclusive?">=":">",J=X(G.origin??"value");if(N?.unit)return`${N.shortLabel} מדי: ${B} ${J} ${H}${G.minimum.toString()} ${N.unit}`;return`${N?.shortLabel??"קטן"} מדי: ${B} ${J} ${H}${G.minimum.toString()}`}case"invalid_format":{let N=G;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}`;let B=Q[N.format],H=B?.label??N.format,A=(B?.gender??"m")==="f"?"תקינה":"תקין";return`${H} לא ${A}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${G.divisor}`;case"unrecognized_keys":return`מפתח${G.keys.length>1?"ות":""} לא מזוה${G.keys.length>1?"ים":"ה"}: ${L(G.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${w(G.origin??"array")}`;default:return"קלט לא תקין"}}};function nY(){return{localeError:cf()}}var mf=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"szám";case"object":{if(Array.isArray(w))return"tömb";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${w.expected}, a kapott érték ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Érvénytelen bemenet: a várt érték ${j(w.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Túl nagy: ${w.origin??"érték"} mérete túl nagy ${X}${w.maximum.toString()} ${D.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${w.origin??"érték"} túl nagy: ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Túl kicsi: a bemeneti érték ${w.origin} mérete túl kicsi ${X}${w.minimum.toString()} ${D.unit}`;return`Túl kicsi: a bemeneti érték ${w.origin} túl kicsi ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Érvénytelen string: "${X.prefix}" értékkel kell kezdődnie`;if(X.format==="ends_with")return`Érvénytelen string: "${X.suffix}" értékkel kell végződnie`;if(X.format==="includes")return`Érvénytelen string: "${X.includes}" értéket kell tartalmaznia`;if(X.format==="regex")return`Érvénytelen string: ${X.pattern} mintának kell megfelelnie`;return`Érvénytelen ${b[X.format]??w.format}`}case"not_multiple_of":return`Érvénytelen szám: ${w.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${w.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${w.origin}`;default:return"Érvénytelen bemenet"}}};function iY(){return{localeError:mf()}}var rf=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Input tidak valid: diharapkan ${w.expected}, diterima ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input tidak valid: diharapkan ${j(w.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Terlalu besar: diharapkan ${w.origin??"value"} memiliki ${X}${w.maximum.toString()} ${D.unit??"elemen"}`;return`Terlalu besar: diharapkan ${w.origin??"value"} menjadi ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Terlalu kecil: diharapkan ${w.origin} memiliki ${X}${w.minimum.toString()} ${D.unit}`;return`Terlalu kecil: diharapkan ${w.origin} menjadi ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`String tidak valid: harus dimulai dengan "${X.prefix}"`;if(X.format==="ends_with")return`String tidak valid: harus berakhir dengan "${X.suffix}"`;if(X.format==="includes")return`String tidak valid: harus menyertakan "${X.includes}"`;if(X.format==="regex")return`String tidak valid: harus sesuai pola ${X.pattern}`;return`${b[X.format]??w.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${w.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${w.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${w.origin}`;default:return"Input tidak valid"}}};function oY(){return{localeError:rf()}}var nf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},of=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(b){return $[b]??null}let U={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(b)=>{switch(b.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${nf(b.input)} þar sem á að vera ${b.expected}`;case"invalid_value":if(b.values.length===1)return`Rangt gildi: gert ráð fyrir ${j(b.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} hafi ${w}${b.maximum.toString()} ${X.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} sé ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Of lítið: gert er ráð fyrir að ${b.origin} hafi ${w}${b.minimum.toString()} ${X.unit}`;return`Of lítið: gert er ráð fyrir að ${b.origin} sé ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ógildur strengur: verður að byrja á "${w.prefix}"`;if(w.format==="ends_with")return`Ógildur strengur: verður að enda á "${w.suffix}"`;if(w.format==="includes")return`Ógildur strengur: verður að innihalda "${w.includes}"`;if(w.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${w.pattern}`;return`Rangt ${U[w.format]??b.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${b.divisor}`;case"unrecognized_keys":return`Óþekkt ${b.keys.length>1?"ir lyklar":"ur lykill"}: ${L(b.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${b.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${b.origin}`;default:return"Rangt gildi"}}};function dY(){return{localeError:of()}}var df=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"numero";case"object":{if(Array.isArray(w))return"vettore";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Input non valido: atteso ${w.expected}, ricevuto ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input non valido: atteso ${j(w.values[0])}`;return`Opzione non valida: atteso uno tra ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Troppo grande: ${w.origin??"valore"} deve avere ${X}${w.maximum.toString()} ${D.unit??"elementi"}`;return`Troppo grande: ${w.origin??"valore"} deve essere ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Troppo piccolo: ${w.origin} deve avere ${X}${w.minimum.toString()} ${D.unit}`;return`Troppo piccolo: ${w.origin} deve essere ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Stringa non valida: deve iniziare con "${X.prefix}"`;if(X.format==="ends_with")return`Stringa non valida: deve terminare con "${X.suffix}"`;if(X.format==="includes")return`Stringa non valida: deve includere "${X.includes}"`;if(X.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${X.pattern}`;return`Invalid ${b[X.format]??w.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${w.divisor}`;case"unrecognized_keys":return`Chiav${w.keys.length>1?"i":"e"} non riconosciut${w.keys.length>1?"e":"a"}: ${L(w.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${w.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${w.origin}`;default:return"Input non valido"}}};function pY(){return{localeError:df()}}var pf=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"数値";case"object":{if(Array.isArray(w))return"配列";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`無効な入力: ${w.expected}が期待されましたが、${U(w.input)}が入力されました`;case"invalid_value":if(w.values.length===1)return`無効な入力: ${j(w.values[0])}が期待されました`;return`無効な選択: ${L(w.values,"、")}のいずれかである必要があります`;case"too_big":{let X=w.inclusive?"以下である":"より小さい",D=I(w.origin);if(D)return`大きすぎる値: ${w.origin??"値"}は${w.maximum.toString()}${D.unit??"要素"}${X}必要があります`;return`大きすぎる値: ${w.origin??"値"}は${w.maximum.toString()}${X}必要があります`}case"too_small":{let X=w.inclusive?"以上である":"より大きい",D=I(w.origin);if(D)return`小さすぎる値: ${w.origin}は${w.minimum.toString()}${D.unit}${X}必要があります`;return`小さすぎる値: ${w.origin}は${w.minimum.toString()}${X}必要があります`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`無効な文字列: "${X.prefix}"で始まる必要があります`;if(X.format==="ends_with")return`無効な文字列: "${X.suffix}"で終わる必要があります`;if(X.format==="includes")return`無効な文字列: "${X.includes}"を含む必要があります`;if(X.format==="regex")return`無効な文字列: パターン${X.pattern}に一致する必要があります`;return`無効な${b[X.format]??w.format}`}case"not_multiple_of":return`無効な数値: ${w.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${w.keys.length>1?"群":""}: ${L(w.keys,"、")}`;case"invalid_key":return`${w.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${w.origin}内の無効な値`;default:return"無効な入力"}}};function tY(){return{localeError:pf()}}var tf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[I]??I},af=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(b){return $[b]??null}let U={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(b)=>{switch(b.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${b.expected}, მიღებული ${tf(b.input)}`;case"invalid_value":if(b.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${j(b.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${L(b.values,"|")}-დან`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} ${X.verb} ${w}${b.maximum.toString()} ${X.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} იყოს ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} ${X.verb} ${w}${b.minimum.toString()} ${X.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} იყოს ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${w.prefix}"-ით`;if(w.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${w.suffix}"-ით`;if(w.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${w.includes}"-ს`;if(w.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${w.pattern}`;return`არასწორი ${U[w.format]??b.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${b.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${b.keys.length>1?"ები":"ი"}: ${L(b.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${b.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${b.origin}-ში`;default:return"არასწორი შეყვანა"}}};function aY(){return{localeError:af()}}var ef=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(w))return"អារេ (Array)";if(w===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${w.expected} ប៉ុន្តែទទួលបាន ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${j(w.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`ធំពេក៖ ត្រូវការ ${w.origin??"តម្លៃ"} ${X} ${w.maximum.toString()} ${D.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${w.origin??"តម្លៃ"} ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`តូចពេក៖ ត្រូវការ ${w.origin} ${X} ${w.minimum.toString()} ${D.unit}`;return`តូចពេក៖ ត្រូវការ ${w.origin} ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${X.prefix}"`;if(X.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${X.suffix}"`;if(X.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${X.includes}"`;if(X.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${X.pattern}`;return`មិនត្រឹមត្រូវ៖ ${b[X.format]??w.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${w.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${L(w.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${w.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${w.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function $0(){return{localeError:ef()}}function eY(){return $0()}var sf=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${w.expected}, 받은 타입은 ${U(w.input)}입니다`;case"invalid_value":if(w.values.length===1)return`잘못된 입력: 값은 ${j(w.values[0])} 이어야 합니다`;return`잘못된 옵션: ${L(w.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let X=w.inclusive?"이하":"미만",D=X==="미만"?"이어야 합니다":"여야 합니다",W=I(w.origin),Q=W?.unit??"요소";if(W)return`${w.origin??"값"}이 너무 큽니다: ${w.maximum.toString()}${Q} ${X}${D}`;return`${w.origin??"값"}이 너무 큽니다: ${w.maximum.toString()} ${X}${D}`}case"too_small":{let X=w.inclusive?"이상":"초과",D=X==="이상"?"이어야 합니다":"여야 합니다",W=I(w.origin),Q=W?.unit??"요소";if(W)return`${w.origin??"값"}이 너무 작습니다: ${w.minimum.toString()}${Q} ${X}${D}`;return`${w.origin??"값"}이 너무 작습니다: ${w.minimum.toString()} ${X}${D}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`잘못된 문자열: "${X.prefix}"(으)로 시작해야 합니다`;if(X.format==="ends_with")return`잘못된 문자열: "${X.suffix}"(으)로 끝나야 합니다`;if(X.format==="includes")return`잘못된 문자열: "${X.includes}"을(를) 포함해야 합니다`;if(X.format==="regex")return`잘못된 문자열: 정규식 ${X.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${b[X.format]??w.format}`}case"not_multiple_of":return`잘못된 숫자: ${w.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${L(w.keys,", ")}`;case"invalid_key":return`잘못된 키: ${w.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${w.origin}`;default:return"잘못된 입력"}}};function sY(){return{localeError:sf()}}var $y=($)=>{return U0(typeof $,$)},U0=($,I=void 0)=>{switch($){case"number":return Number.isNaN(I)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(I===void 0)return"nežinomas objektas";if(I===null)return"nulinė reikšmė";if(Array.isArray(I))return"masyvas";if(Object.getPrototypeOf(I)!==Object.prototype&&I.constructor)return I.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},I0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function Oq($){let I=Math.abs($),U=I%10,b=I%100;if(b>=11&&b<=19||U===0)return"many";if(U===1)return"one";return"few"}var Iy=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(b,w,X,D){let W=$[b]??null;if(W===null)return W;return{unit:W.unit[w],verb:W.verb[D][X?"inclusive":"notInclusive"]}}let U={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(b)=>{switch(b.code){case"invalid_type":return`Gautas tipas ${$y(b.input)}, o tikėtasi - ${U0(b.expected)}`;case"invalid_value":if(b.values.length===1)return`Privalo būti ${j(b.values[0])}`;return`Privalo būti vienas iš ${L(b.values,"|")} pasirinkimų`;case"too_big":{let w=U0(b.origin),X=I(b.origin,Oq(Number(b.maximum)),b.inclusive??!1,"smaller");if(X?.verb)return`${I0(w??b.origin??"reikšmė")} ${X.verb} ${b.maximum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${I0(w??b.origin??"reikšmė")} turi būti ${D} ${b.maximum.toString()} ${X?.unit}`}case"too_small":{let w=U0(b.origin),X=I(b.origin,Oq(Number(b.minimum)),b.inclusive??!1,"bigger");if(X?.verb)return`${I0(w??b.origin??"reikšmė")} ${X.verb} ${b.minimum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${I0(w??b.origin??"reikšmė")} turi būti ${D} ${b.minimum.toString()} ${X?.unit}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Eilutė privalo prasidėti "${w.prefix}"`;if(w.format==="ends_with")return`Eilutė privalo pasibaigti "${w.suffix}"`;if(w.format==="includes")return`Eilutė privalo įtraukti "${w.includes}"`;if(w.format==="regex")return`Eilutė privalo atitikti ${w.pattern}`;return`Neteisingas ${U[w.format]??b.format}`}case"not_multiple_of":return`Skaičius privalo būti ${b.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${b.keys.length>1?"i":"as"} rakt${b.keys.length>1?"ai":"as"}: ${L(b.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let w=U0(b.origin);return`${I0(w??b.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function $7(){return{localeError:Iy()}}var Uy=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"број";case"object":{if(Array.isArray(w))return"низа";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Грешен внес: се очекува ${w.expected}, примено ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Invalid input: expected ${j(w.values[0])}`;return`Грешана опција: се очекува една ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Премногу голем: се очекува ${w.origin??"вредноста"} да има ${X}${w.maximum.toString()} ${D.unit??"елементи"}`;return`Премногу голем: се очекува ${w.origin??"вредноста"} да биде ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Премногу мал: се очекува ${w.origin} да има ${X}${w.minimum.toString()} ${D.unit}`;return`Премногу мал: се очекува ${w.origin} да биде ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неважечка низа: мора да започнува со "${X.prefix}"`;if(X.format==="ends_with")return`Неважечка низа: мора да завршува со "${X.suffix}"`;if(X.format==="includes")return`Неважечка низа: мора да вклучува "${X.includes}"`;if(X.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${X.pattern}`;return`Invalid ${b[X.format]??w.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${L(w.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${w.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${w.origin}`;default:return"Грешен внес"}}};function I7(){return{localeError:Uy()}}var wy=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nombor";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Input tidak sah: dijangka ${w.expected}, diterima ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input tidak sah: dijangka ${j(w.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Terlalu besar: dijangka ${w.origin??"nilai"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"elemen"}`;return`Terlalu besar: dijangka ${w.origin??"nilai"} adalah ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Terlalu kecil: dijangka ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Terlalu kecil: dijangka ${w.origin} adalah ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`String tidak sah: mesti bermula dengan "${X.prefix}"`;if(X.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${X.suffix}"`;if(X.format==="includes")return`String tidak sah: mesti mengandungi "${X.includes}"`;if(X.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${X.pattern}`;return`${b[X.format]??w.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${w.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${L(w.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${w.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${w.origin}`;default:return"Input tidak sah"}}};function U7(){return{localeError:wy()}}var by=()=>{let $={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"getal";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Ongeldige invoer: verwacht ${w.expected}, ontving ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ongeldige invoer: verwacht ${j(w.values[0])}`;return`Ongeldige optie: verwacht één van ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Te groot: verwacht dat ${w.origin??"waarde"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"elementen"}`;return`Te groot: verwacht dat ${w.origin??"waarde"} ${X}${w.maximum.toString()} is`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Te klein: verwacht dat ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Te klein: verwacht dat ${w.origin} ${X}${w.minimum.toString()} is`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ongeldige tekst: moet met "${X.prefix}" beginnen`;if(X.format==="ends_with")return`Ongeldige tekst: moet op "${X.suffix}" eindigen`;if(X.format==="includes")return`Ongeldige tekst: moet "${X.includes}" bevatten`;if(X.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${X.pattern}`;return`Ongeldig: ${b[X.format]??w.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${w.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${w.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${w.origin}`;default:return"Ongeldige invoer"}}};function w7(){return{localeError:by()}}var Xy=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"tall";case"object":{if(Array.isArray(w))return"liste";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Ugyldig input: forventet ${w.expected}, fikk ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ugyldig verdi: forventet ${j(w.values[0])}`;return`Ugyldig valg: forventet en av ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`For stor(t): forventet ${w.origin??"value"} til å ha ${X}${w.maximum.toString()} ${D.unit??"elementer"}`;return`For stor(t): forventet ${w.origin??"value"} til å ha ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`For lite(n): forventet ${w.origin} til å ha ${X}${w.minimum.toString()} ${D.unit}`;return`For lite(n): forventet ${w.origin} til å ha ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ugyldig streng: må starte med "${X.prefix}"`;if(X.format==="ends_with")return`Ugyldig streng: må ende med "${X.suffix}"`;if(X.format==="includes")return`Ugyldig streng: må inneholde "${X.includes}"`;if(X.format==="regex")return`Ugyldig streng: må matche mønsteret ${X.pattern}`;return`Ugyldig ${b[X.format]??w.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${w.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${w.origin}`;default:return"Ugyldig input"}}};function b7(){return{localeError:Xy()}}var Dy=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"numara";case"object":{if(Array.isArray(w))return"saf";if(w===null)return"gayb";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Fâsit giren: umulan ${w.expected}, alınan ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Fâsit giren: umulan ${j(w.values[0])}`;return`Fâsit tercih: mûteberler ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Fazla büyük: ${w.origin??"value"}, ${X}${w.maximum.toString()} ${D.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${w.origin??"value"}, ${X}${w.maximum.toString()} olmalıydı.`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Fazla küçük: ${w.origin}, ${X}${w.minimum.toString()} ${D.unit} sahip olmalıydı.`;return`Fazla küçük: ${w.origin}, ${X}${w.minimum.toString()} olmalıydı.`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Fâsit metin: "${X.prefix}" ile başlamalı.`;if(X.format==="ends_with")return`Fâsit metin: "${X.suffix}" ile bitmeli.`;if(X.format==="includes")return`Fâsit metin: "${X.includes}" ihtivâ etmeli.`;if(X.format==="regex")return`Fâsit metin: ${X.pattern} nakşına uymalı.`;return`Fâsit ${b[X.format]??w.format}`}case"not_multiple_of":return`Fâsit sayı: ${w.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${w.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function X7(){return{localeError:Dy()}}var Wy=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"عدد";case"object":{if(Array.isArray(w))return"ارې";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`ناسم ورودي: باید ${w.expected} وای, مګر ${U(w.input)} ترلاسه شو`;case"invalid_value":if(w.values.length===1)return`ناسم ورودي: باید ${j(w.values[0])} وای`;return`ناسم انتخاب: باید یو له ${L(w.values,"|")} څخه وای`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`ډیر لوی: ${w.origin??"ارزښت"} باید ${X}${w.maximum.toString()} ${D.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${w.origin??"ارزښت"} باید ${X}${w.maximum.toString()} وي`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`ډیر کوچنی: ${w.origin} باید ${X}${w.minimum.toString()} ${D.unit} ولري`;return`ډیر کوچنی: ${w.origin} باید ${X}${w.minimum.toString()} وي`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`ناسم متن: باید د "${X.prefix}" سره پیل شي`;if(X.format==="ends_with")return`ناسم متن: باید د "${X.suffix}" سره پای ته ورسيږي`;if(X.format==="includes")return`ناسم متن: باید "${X.includes}" ولري`;if(X.format==="regex")return`ناسم متن: باید د ${X.pattern} سره مطابقت ولري`;return`${b[X.format]??w.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${w.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${w.keys.length>1?"کلیډونه":"کلیډ"}: ${L(w.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${w.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${w.origin} کې`;default:return"ناسمه ورودي"}}};function D7(){return{localeError:Wy()}}var Qy=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"liczba";case"object":{if(Array.isArray(w))return"tablica";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${w.expected}, otrzymano ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${j(w.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Za duża wartość: oczekiwano, że ${w.origin??"wartość"} będzie mieć ${X}${w.maximum.toString()} ${D.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${w.origin??"wartość"} będzie wynosić ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Za mała wartość: oczekiwano, że ${w.origin??"wartość"} będzie mieć ${X}${w.minimum.toString()} ${D.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${w.origin??"wartość"} będzie wynosić ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${X.prefix}"`;if(X.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${X.suffix}"`;if(X.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${X.includes}"`;if(X.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${X.pattern}`;return`Nieprawidłow(y/a/e) ${b[X.format]??w.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${w.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${w.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${w.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function W7(){return{localeError:Qy()}}var Gy=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"número";case"object":{if(Array.isArray(w))return"array";if(w===null)return"nulo";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Tipo inválido: esperado ${w.expected}, recebido ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Entrada inválida: esperado ${j(w.values[0])}`;return`Opção inválida: esperada uma das ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Muito grande: esperado que ${w.origin??"valor"} tivesse ${X}${w.maximum.toString()} ${D.unit??"elementos"}`;return`Muito grande: esperado que ${w.origin??"valor"} fosse ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Muito pequeno: esperado que ${w.origin} tivesse ${X}${w.minimum.toString()} ${D.unit}`;return`Muito pequeno: esperado que ${w.origin} fosse ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Texto inválido: deve começar com "${X.prefix}"`;if(X.format==="ends_with")return`Texto inválido: deve terminar com "${X.suffix}"`;if(X.format==="includes")return`Texto inválido: deve incluir "${X.includes}"`;if(X.format==="regex")return`Texto inválido: deve corresponder ao padrão ${X.pattern}`;return`${b[X.format]??w.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${w.divisor}`;case"unrecognized_keys":return`Chave${w.keys.length>1?"s":""} desconhecida${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Chave inválida em ${w.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${w.origin}`;default:return"Campo inválido"}}};function Q7(){return{localeError:Gy()}}function zq($,I,U,b){let w=Math.abs($),X=w%10,D=w%100;if(D>=11&&D<=19)return b;if(X===1)return I;if(X>=2&&X<=4)return U;return b}var Ny=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"число";case"object":{if(Array.isArray(w))return"массив";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Неверный ввод: ожидалось ${w.expected}, получено ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Неверный ввод: ожидалось ${j(w.values[0])}`;return`Неверный вариант: ожидалось одно из ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D){let W=Number(w.maximum),Q=zq(W,D.unit.one,D.unit.few,D.unit.many);return`Слишком большое значение: ожидалось, что ${w.origin??"значение"} будет иметь ${X}${w.maximum.toString()} ${Q}`}return`Слишком большое значение: ожидалось, что ${w.origin??"значение"} будет ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D){let W=Number(w.minimum),Q=zq(W,D.unit.one,D.unit.few,D.unit.many);return`Слишком маленькое значение: ожидалось, что ${w.origin} будет иметь ${X}${w.minimum.toString()} ${Q}`}return`Слишком маленькое значение: ожидалось, что ${w.origin} будет ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неверная строка: должна начинаться с "${X.prefix}"`;if(X.format==="ends_with")return`Неверная строка: должна заканчиваться на "${X.suffix}"`;if(X.format==="includes")return`Неверная строка: должна содержать "${X.includes}"`;if(X.format==="regex")return`Неверная строка: должна соответствовать шаблону ${X.pattern}`;return`Неверный ${b[X.format]??w.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${w.divisor}`;case"unrecognized_keys":return`Нераспознанн${w.keys.length>1?"ые":"ый"} ключ${w.keys.length>1?"и":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${w.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${w.origin}`;default:return"Неверные входные данные"}}};function G7(){return{localeError:Ny()}}var Yy=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"število";case"object":{if(Array.isArray(w))return"tabela";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${w.expected}, prejeto ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Neveljaven vnos: pričakovano ${j(w.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Preveliko: pričakovano, da bo ${w.origin??"vrednost"} imelo ${X}${w.maximum.toString()} ${D.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${w.origin??"vrednost"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Premajhno: pričakovano, da bo ${w.origin} imelo ${X}${w.minimum.toString()} ${D.unit}`;return`Premajhno: pričakovano, da bo ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Neveljaven niz: mora se začeti z "${X.prefix}"`;if(X.format==="ends_with")return`Neveljaven niz: mora se končati z "${X.suffix}"`;if(X.format==="includes")return`Neveljaven niz: mora vsebovati "${X.includes}"`;if(X.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${X.pattern}`;return`Neveljaven ${b[X.format]??w.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${w.divisor}`;case"unrecognized_keys":return`Neprepoznan${w.keys.length>1?"i ključi":" ključ"}: ${L(w.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${w.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${w.origin}`;default:return"Neveljaven vnos"}}};function N7(){return{localeError:Yy()}}var By=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"antal";case"object":{if(Array.isArray(w))return"lista";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${w.expected}, fick ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ogiltig inmatning: förväntat ${j(w.values[0])}`;return`Ogiltigt val: förväntade en av ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`För stor(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.maximum.toString()} ${D.unit??"element"}`;return`För stor(t): förväntat ${w.origin??"värdet"} att ha ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`För lite(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.minimum.toString()} ${D.unit}`;return`För lite(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ogiltig sträng: måste börja med "${X.prefix}"`;if(X.format==="ends_with")return`Ogiltig sträng: måste sluta med "${X.suffix}"`;if(X.format==="includes")return`Ogiltig sträng: måste innehålla "${X.includes}"`;if(X.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${X.pattern}"`;return`Ogiltig(t) ${b[X.format]??w.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${w.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${w.origin??"värdet"}`;default:return"Ogiltig input"}}};function Y7(){return{localeError:By()}}var Jy=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(w))return"அணி";if(w===null)return"வெறுமை";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${w.expected}, பெறப்பட்டது ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${j(w.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${L(w.values,"|")} இல் ஒன்று`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${w.origin??"மதிப்பு"} ${X}${w.maximum.toString()} ${D.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${w.origin??"மதிப்பு"} ${X}${w.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${w.origin} ${X}${w.minimum.toString()} ${D.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${w.origin} ${X}${w.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`தவறான சரம்: "${X.prefix}" இல் தொடங்க வேண்டும்`;if(X.format==="ends_with")return`தவறான சரம்: "${X.suffix}" இல் முடிவடைய வேண்டும்`;if(X.format==="includes")return`தவறான சரம்: "${X.includes}" ஐ உள்ளடக்க வேண்டும்`;if(X.format==="regex")return`தவறான சரம்: ${X.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${b[X.format]??w.format}`}case"not_multiple_of":return`தவறான எண்: ${w.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${w.keys.length>1?"கள்":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${w.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function B7(){return{localeError:Jy()}}var Hy=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(w))return"อาร์เรย์ (Array)";if(w===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${w.expected} แต่ได้รับ ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${j(w.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"ไม่เกิน":"น้อยกว่า",D=I(w.origin);if(D)return`เกินกำหนด: ${w.origin??"ค่า"} ควรมี${X} ${w.maximum.toString()} ${D.unit??"รายการ"}`;return`เกินกำหนด: ${w.origin??"ค่า"} ควรมี${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"อย่างน้อย":"มากกว่า",D=I(w.origin);if(D)return`น้อยกว่ากำหนด: ${w.origin} ควรมี${X} ${w.minimum.toString()} ${D.unit}`;return`น้อยกว่ากำหนด: ${w.origin} ควรมี${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${X.prefix}"`;if(X.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${X.suffix}"`;if(X.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${X.includes}" อยู่ในข้อความ`;if(X.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${X.pattern}`;return`รูปแบบไม่ถูกต้อง: ${b[X.format]??w.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${w.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${L(w.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${w.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${w.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function J7(){return{localeError:Hy()}}var Ay=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},Oy=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(b){return $[b]??null}let U={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(b)=>{switch(b.code){case"invalid_type":return`Geçersiz değer: beklenen ${b.expected}, alınan ${Ay(b.input)}`;case"invalid_value":if(b.values.length===1)return`Geçersiz değer: beklenen ${j(b.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Çok büyük: beklenen ${b.origin??"değer"} ${w}${b.maximum.toString()} ${X.unit??"öğe"}`;return`Çok büyük: beklenen ${b.origin??"değer"} ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Çok küçük: beklenen ${b.origin} ${w}${b.minimum.toString()} ${X.unit}`;return`Çok küçük: beklenen ${b.origin} ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Geçersiz metin: "${w.prefix}" ile başlamalı`;if(w.format==="ends_with")return`Geçersiz metin: "${w.suffix}" ile bitmeli`;if(w.format==="includes")return`Geçersiz metin: "${w.includes}" içermeli`;if(w.format==="regex")return`Geçersiz metin: ${w.pattern} desenine uymalı`;return`Geçersiz ${U[w.format]??b.format}`}case"not_multiple_of":return`Geçersiz sayı: ${b.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${b.keys.length>1?"lar":""}: ${L(b.keys,", ")}`;case"invalid_key":return`${b.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${b.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function H7(){return{localeError:Oy()}}var zy=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"число";case"object":{if(Array.isArray(w))return"масив";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${w.expected}, отримано ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Неправильні вхідні дані: очікується ${j(w.values[0])}`;return`Неправильна опція: очікується одне з ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Занадто велике: очікується, що ${w.origin??"значення"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"елементів"}`;return`Занадто велике: очікується, що ${w.origin??"значення"} буде ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Занадто мале: очікується, що ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Занадто мале: очікується, що ${w.origin} буде ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неправильний рядок: повинен починатися з "${X.prefix}"`;if(X.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${X.suffix}"`;if(X.format==="includes")return`Неправильний рядок: повинен містити "${X.includes}"`;if(X.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${X.pattern}`;return`Неправильний ${b[X.format]??w.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${w.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${w.keys.length>1?"і":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${w.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${w.origin}`;default:return"Неправильні вхідні дані"}}};function w0(){return{localeError:zy()}}function A7(){return w0()}var Ly=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"نمبر";case"object":{if(Array.isArray(w))return"آرے";if(w===null)return"نل";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`غلط ان پٹ: ${w.expected} متوقع تھا، ${U(w.input)} موصول ہوا`;case"invalid_value":if(w.values.length===1)return`غلط ان پٹ: ${j(w.values[0])} متوقع تھا`;return`غلط آپشن: ${L(w.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`بہت بڑا: ${w.origin??"ویلیو"} کے ${X}${w.maximum.toString()} ${D.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${w.origin??"ویلیو"} کا ${X}${w.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`بہت چھوٹا: ${w.origin} کے ${X}${w.minimum.toString()} ${D.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${w.origin} کا ${X}${w.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`غلط سٹرنگ: "${X.prefix}" سے شروع ہونا چاہیے`;if(X.format==="ends_with")return`غلط سٹرنگ: "${X.suffix}" پر ختم ہونا چاہیے`;if(X.format==="includes")return`غلط سٹرنگ: "${X.includes}" شامل ہونا چاہیے`;if(X.format==="regex")return`غلط سٹرنگ: پیٹرن ${X.pattern} سے میچ ہونا چاہیے`;return`غلط ${b[X.format]??w.format}`}case"not_multiple_of":return`غلط نمبر: ${w.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${w.keys.length>1?"ز":""}: ${L(w.keys,"، ")}`;case"invalid_key":return`${w.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${w.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function O7(){return{localeError:Ly()}}var Ky=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"số";case"object":{if(Array.isArray(w))return"mảng";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${w.expected}, nhận được ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${j(w.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Quá lớn: mong đợi ${w.origin??"giá trị"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"phần tử"}`;return`Quá lớn: mong đợi ${w.origin??"giá trị"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Quá nhỏ: mong đợi ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Quá nhỏ: mong đợi ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${X.prefix}"`;if(X.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${X.suffix}"`;if(X.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${X.includes}"`;if(X.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${X.pattern}`;return`${b[X.format]??w.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 ${w.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${L(w.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${w.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 ${w.origin}`;default:return"Đầu vào không hợp lệ"}}};function z7(){return{localeError:Ky()}}var vy=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(w))return"数组";if(w===null)return"空值(null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`无效输入:期望 ${w.expected},实际接收 ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`无效输入:期望 ${j(w.values[0])}`;return`无效选项:期望以下之一 ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`数值过大:期望 ${w.origin??"值"} ${X}${w.maximum.toString()} ${D.unit??"个元素"}`;return`数值过大:期望 ${w.origin??"值"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`数值过小:期望 ${w.origin} ${X}${w.minimum.toString()} ${D.unit}`;return`数值过小:期望 ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`无效字符串:必须以 "${X.prefix}" 开头`;if(X.format==="ends_with")return`无效字符串:必须以 "${X.suffix}" 结尾`;if(X.format==="includes")return`无效字符串:必须包含 "${X.includes}"`;if(X.format==="regex")return`无效字符串:必须满足正则表达式 ${X.pattern}`;return`无效${b[X.format]??w.format}`}case"not_multiple_of":return`无效数字:必须是 ${w.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${w.origin} 中包含无效值(value)`;default:return"无效输入"}}};function L7(){return{localeError:vy()}}var Vy=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`無效的輸入值:預期為 ${w.expected},但收到 ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`無效的輸入值:預期為 ${j(w.values[0])}`;return`無效的選項:預期為以下其中之一 ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`數值過大:預期 ${w.origin??"值"} 應為 ${X}${w.maximum.toString()} ${D.unit??"個元素"}`;return`數值過大:預期 ${w.origin??"值"} 應為 ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`數值過小:預期 ${w.origin} 應為 ${X}${w.minimum.toString()} ${D.unit}`;return`數值過小:預期 ${w.origin} 應為 ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`無效的字串:必須以 "${X.prefix}" 開頭`;if(X.format==="ends_with")return`無效的字串:必須以 "${X.suffix}" 結尾`;if(X.format==="includes")return`無效的字串:必須包含 "${X.includes}"`;if(X.format==="regex")return`無效的字串:必須符合格式 ${X.pattern}`;return`無效的 ${b[X.format]??w.format}`}case"not_multiple_of":return`無效的數字:必須為 ${w.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${w.keys.length>1?"們":""}:${L(w.keys,"、")}`;case"invalid_key":return`${w.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${w.origin} 中有無效的值`;default:return"無效的輸入值"}}};function K7(){return{localeError:Vy()}}var qy=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(w))return"akopọ";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(w)=>{switch(w.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${w.expected}, àmọ̀ a rí ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${j(w.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${w.origin??"iye"} ${D.verb} ${X}${w.maximum} ${D.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${X}${w.maximum}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Kéré ju: a ní láti jẹ́ pé ${w.origin} ${D.verb} ${X}${w.minimum} ${D.unit}`;return`Kéré ju: a ní láti jẹ́ ${X}${w.minimum}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${X.prefix}"`;if(X.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${X.suffix}"`;if(X.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${X.includes}"`;if(X.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${X.pattern}`;return`Aṣìṣe: ${b[X.format]??w.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${w.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${L(w.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${w.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${w.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function v7(){return{localeError:qy()}}var Lq,V7=Symbol("ZodOutput"),q7=Symbol("ZodInput");class F7{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};delete U.id;let b={...U,...this._map.get($)};return Object.keys(b).length?b:void 0}return this._map.get($)}has($){return this._map.has($)}}function MX(){return new F7}(Lq=globalThis).__zod_globalRegistry??(Lq.__zod_globalRegistry=MX());var d$=globalThis.__zod_globalRegistry;function M7($,I){return new $({type:"string",...S(I)})}function j7($,I){return new $({type:"string",coerce:!0,...S(I)})}function jX($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...S(I)})}function X0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...S(I)})}function EX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...S(I)})}function SX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(I)})}function PX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(I)})}function kX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(I)})}function D0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...S(I)})}function RX($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...S(I)})}function TX($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(I)})}function _X($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...S(I)})}function ZX($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(I)})}function CX($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...S(I)})}function gX($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...S(I)})}function xX($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(I)})}function hX($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(I)})}function fX($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(I)})}function E7($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...S(I)})}function yX($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(I)})}function uX($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(I)})}function lX($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...S(I)})}function cX($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...S(I)})}function mX($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...S(I)})}function rX($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...S(I)})}var S7={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function P7($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(I)})}function k7($,I){return new $({type:"string",format:"date",check:"string_format",...S(I)})}function R7($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...S(I)})}function T7($,I){return new $({type:"string",format:"duration",check:"string_format",...S(I)})}function _7($,I){return new $({type:"number",checks:[],...S(I)})}function Z7($,I){return new $({type:"number",coerce:!0,checks:[],...S(I)})}function C7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...S(I)})}function g7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...S(I)})}function x7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...S(I)})}function h7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...S(I)})}function f7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...S(I)})}function y7($,I){return new $({type:"boolean",...S(I)})}function u7($,I){return new $({type:"boolean",coerce:!0,...S(I)})}function l7($,I){return new $({type:"bigint",...S(I)})}function c7($,I){return new $({type:"bigint",coerce:!0,...S(I)})}function m7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(I)})}function r7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(I)})}function n7($,I){return new $({type:"symbol",...S(I)})}function i7($,I){return new $({type:"undefined",...S(I)})}function o7($,I){return new $({type:"null",...S(I)})}function d7($){return new $({type:"any"})}function p7($){return new $({type:"unknown"})}function t7($,I){return new $({type:"never",...S(I)})}function a7($,I){return new $({type:"void",...S(I)})}function e7($,I){return new $({type:"date",...S(I)})}function s7($,I){return new $({type:"date",coerce:!0,...S(I)})}function $5($,I){return new $({type:"nan",...S(I)})}function r6($,I){return new JX({check:"less_than",...S(I),value:$,inclusive:!1})}function N6($,I){return new JX({check:"less_than",...S(I),value:$,inclusive:!0})}function n6($,I){return new HX({check:"greater_than",...S(I),value:$,inclusive:!1})}function p$($,I){return new HX({check:"greater_than",...S(I),value:$,inclusive:!0})}function nX($){return n6(0,$)}function iX($){return r6(0,$)}function oX($){return N6(0,$)}function dX($){return p$(0,$)}function Z4($,I){return new UN({check:"multiple_of",...S(I),value:$})}function W1($,I){return new XN({check:"max_size",...S(I),maximum:$})}function C4($,I){return new DN({check:"min_size",...S(I),minimum:$})}function e1($,I){return new WN({check:"size_equals",...S(I),size:$})}function Q1($,I){return new QN({check:"max_length",...S(I),maximum:$})}function b4($,I){return new GN({check:"min_length",...S(I),minimum:$})}function G1($,I){return new NN({check:"length_equals",...S(I),length:$})}function s1($,I){return new YN({check:"string_format",format:"regex",...S(I),pattern:$})}function $I($){return new BN({check:"string_format",format:"lowercase",...S($)})}function II($){return new JN({check:"string_format",format:"uppercase",...S($)})}function UI($,I){return new HN({check:"string_format",format:"includes",...S(I),includes:$})}function wI($,I){return new AN({check:"string_format",format:"starts_with",...S(I),prefix:$})}function bI($,I){return new ON({check:"string_format",format:"ends_with",...S(I),suffix:$})}function pX($,I,U){return new zN({check:"property",property:$,schema:I,...S(U)})}function XI($,I){return new LN({check:"mime_type",mime:$,...S(I)})}function Z6($){return new KN({check:"overwrite",tx:$})}function DI($){return Z6((I)=>I.normalize($))}function WI(){return Z6(($)=>$.trim())}function QI(){return Z6(($)=>$.toLowerCase())}function GI(){return Z6(($)=>$.toUpperCase())}function NI(){return Z6(($)=>OG($))}function I5($,I,U){return new $({type:"array",element:I,...S(U)})}function My($,I,U){return new $({type:"union",options:I,...S(U)})}function jy($,I,U){return new $({type:"union",options:I,inclusive:!1,...S(U)})}function Ey($,I,U,b){return new $({type:"union",options:U,discriminator:I,...S(b)})}function Sy($,I,U){return new $({type:"intersection",left:I,right:U})}function Py($,I,U,b){let w=U instanceof o;return new $({type:"tuple",items:I,rest:w?U:null,...S(w?b:U)})}function ky($,I,U,b){return new $({type:"record",keyType:I,valueType:U,...S(b)})}function Ry($,I,U,b){return new $({type:"map",keyType:I,valueType:U,...S(b)})}function Ty($,I,U){return new $({type:"set",valueType:I,...S(U)})}function _y($,I,U){let b=Array.isArray(I)?Object.fromEntries(I.map((w)=>[w,w])):I;return new $({type:"enum",entries:b,...S(U)})}function Zy($,I,U){return new $({type:"enum",entries:I,...S(U)})}function Cy($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...S(U)})}function U5($,I){return new $({type:"file",...S(I)})}function gy($,I){return new $({type:"transform",transform:I})}function xy($,I){return new $({type:"optional",innerType:I})}function hy($,I){return new $({type:"nullable",innerType:I})}function fy($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():LG(U)}})}function yy($,I,U){return new $({type:"nonoptional",innerType:I,...S(U)})}function uy($,I){return new $({type:"success",innerType:I})}function ly($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function cy($,I,U){return new $({type:"pipe",in:I,out:U})}function my($,I){return new $({type:"readonly",innerType:I})}function ry($,I,U){return new $({type:"template_literal",parts:I,...S(U)})}function ny($,I){return new $({type:"lazy",getter:I})}function iy($,I){return new $({type:"promise",innerType:I})}function w5($,I,U){let b=S(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function b5($,I,U){return new $({type:"custom",check:"custom",fn:I,...S(U)})}function X5($){let I=Kq((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(i1(b,U.value,I._zod.def));else{let w=b;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=I),w.continue??(w.continue=!I._zod.def.abort),U.issues.push(i1(w))}},$(U.value,U)});return I}function Kq($,I){let U=new A$({check:"custom",...S(I)});return U._zod.check=$,U}function D5($){let I=new A$({check:"describe"});return I._zod.onattach=[(U)=>{let b=d$.get(U)??{};d$.add(U,{...b,description:$})}],I._zod.check=()=>{},I}function W5($){let I=new A$({check:"meta"});return I._zod.onattach=[(U)=>{let b=d$.get(U)??{};d$.add(U,{...b,...$})}],I._zod.check=()=>{},I}function Q5($,I){let U=S(I),b=U.truthy??["true","1","yes","on","y","enabled"],w=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")b=b.map((J)=>typeof J==="string"?J.toLowerCase():J),w=w.map((J)=>typeof J==="string"?J.toLowerCase():J);let X=new Set(b),D=new Set(w),W=$.Codec??eU,Q=$.Boolean??tU,N=new($.String??D1)({type:"string",error:U.error}),B=new Q({type:"boolean",error:U.error}),H=new W({type:"pipe",in:N,out:B,transform:(J,A)=>{let O=J;if(U.case!=="sensitive")O=O.toLowerCase();if(X.has(O))return!0;else if(D.has(O))return!1;else return A.issues.push({code:"invalid_value",expected:"stringbool",values:[...X,...D],input:A.value,inst:H,continue:!1}),{}},reverseTransform:(J,A)=>{if(J===!0)return b[0]||"true";else return w[0]||"false"},error:U.error});return H}function YI($,I,U,b={}){let w=S(b),X={...S(b),check:"string_format",type:"string",format:I,fn:typeof U==="function"?U:(W)=>U.test(W),...w};if(U instanceof RegExp)X.pattern=U;return new $(X)}function g4($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??d$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function G$($,I,U={path:[],schemaPath:[]}){var b;let w=$._zod.def,X=I.seen.get($);if(X){if(X.count++,U.schemaPath.includes($))X.cycle=U.path;return X.schema}let D={schema:{},count:1,cycle:void 0,path:U.path};I.seen.set($,D);let W=$._zod.toJSONSchema?.();if(W)D.schema=W;else{let N={...U,schemaPath:[...U.schemaPath,$],path:U.path},B=$._zod.parent;if(B)D.ref=B,G$(B,I,N),I.seen.get(B).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,D.schema,N);else{let H=D.schema,J=I.processors[w.type];if(!J)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${w.type}`);J($,I,H,N)}}let Q=I.metadataRegistry.get($);if(Q)Object.assign(D.schema,Q);if(I.io==="input"&&t$($))delete D.schema.examples,delete D.schema.default;if(I.io==="input"&&D.schema._prefault)(b=D.schema).default??(b.default=D.schema._prefault);return delete D.schema._prefault,I.seen.get($).schema}function x4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let b=(X)=>{let D=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let N=$.external.registry.get(X[0])?.id,B=$.external.uri??((J)=>J);if(N)return{ref:B(N)};let H=X[1].defId??X[1].schema.id??`schema${$.counter++}`;return X[1].defId=H,{defId:H,ref:`${B("__shared")}#/${D}/${H}`}}if(X[1]===U)return{ref:"#"};let Q=`${"#"}/${D}/`,G=X[1].schema.id??`__schema${$.counter++}`;return{defId:G,ref:Q+G}},w=(X)=>{if(X[1].schema.$ref)return;let D=X[1],{ref:W,defId:Q}=b(X);if(D.def={...D.schema},Q)D.defId=Q;let G=D.schema;for(let N in G)delete G[N];G.$ref=W};if($.cycles==="throw")for(let X of $.seen.entries()){let D=X[1];if(D.cycle)throw new Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
62
+ `)}J.write("payload.value = newResult;"),J.write("return payload;");let k=J.compile();return(P,x)=>k(H,P,x)},X,D=b1,W=!fU.jitless,G=W&&zG.value,N=I.catchall,B;$._zod.parse=(H,J)=>{B??(B=b.value);let A=H.value;if(!D(A))return H.issues.push({expected:"object",code:"invalid_type",input:A,inst:$}),H;if(W&&G&&J?.async===!1&&J.jitless!==!0){if(!X)X=w(I.shape);if(H=X(H,J),!N)return H;return Hq([],A,H,J,B,$)}return U(H,J)}});function Iq($,I,U,b){for(let X of $)if(X.issues.length===0)return I.value=X.value,I;let w=$.filter((X)=>!_4(X));if(w.length===1)return I.value=w[0].value,w[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((X)=>X.issues.map((D)=>U6(D,b,P$())))}),I}var aU=z("$ZodUnion",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.options.some((w)=>w._zod.optin==="optional")?"optional":void 0),s($._zod,"optout",()=>I.options.some((w)=>w._zod.optout==="optional")?"optional":void 0),s($._zod,"values",()=>{if(I.options.every((w)=>w._zod.values))return new Set(I.options.flatMap((w)=>Array.from(w._zod.values)));return}),s($._zod,"pattern",()=>{if(I.options.every((w)=>w._zod.pattern)){let w=I.options.map((X)=>X._zod.pattern);return new RegExp(`^(${w.map((X)=>lU(X.source)).join("|")})$`)}return});let U=I.options.length===1,b=I.options[0]._zod.run;$._zod.parse=(w,X)=>{if(U)return b(w,X);let D=!1,W=[];for(let Q of I.options){let G=Q._zod.run({value:w.value,issues:[]},X);if(G instanceof Promise)W.push(G),D=!0;else{if(G.issues.length===0)return G;W.push(G)}}if(!D)return Iq(W,w,$,X);return Promise.all(W).then((Q)=>{return Iq(Q,w,$,X)})}});function Uq($,I,U,b){let w=$.filter((X)=>X.issues.length===0);if(w.length===1)return I.value=w[0].value,I;if(w.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((X)=>X.issues.map((D)=>U6(D,b,P$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var DY=z("$ZodXor",($,I)=>{aU.init($,I),I.inclusive=!1;let U=I.options.length===1,b=I.options[0]._zod.run;$._zod.parse=(w,X)=>{if(U)return b(w,X);let D=!1,W=[];for(let Q of I.options){let G=Q._zod.run({value:w.value,issues:[]},X);if(G instanceof Promise)W.push(G),D=!0;else W.push(G)}if(!D)return Uq(W,w,$,X);return Promise.all(W).then((Q)=>{return Uq(Q,w,$,X)})}}),WY=z("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,aU.init($,I);let U=$._zod.parse;s($._zod,"propValues",()=>{let w={};for(let X of I.options){let D=X._zod.propValues;if(!D||Object.keys(D).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(X)}"`);for(let[W,Q]of Object.entries(D)){if(!w[W])w[W]=new Set;for(let G of Q)w[W].add(G)}}return w});let b=n1(()=>{let w=I.options,X=new Map;for(let D of w){let W=D._zod.propValues?.[I.discriminator];if(!W||W.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(D)}"`);for(let Q of W){if(X.has(Q))throw new Error(`Duplicate discriminator value "${String(Q)}"`);X.set(Q,D)}}return X});$._zod.parse=(w,X)=>{let D=w.value;if(!b1(D))return w.issues.push({code:"invalid_type",expected:"object",input:D,inst:$}),w;let W=b.value.get(D?.[I.discriminator]);if(W)return W._zod.run(w,X);if(I.unionFallback)return U(w,X);return w.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:D,path:[I.discriminator],inst:$}),w}}),QY=z("$ZodIntersection",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value,X=I.left._zod.run({value:w,issues:[]},b),D=I.right._zod.run({value:w,issues:[]},b);if(X instanceof Promise||D instanceof Promise)return Promise.all([X,D]).then(([Q,G])=>{return wq(U,Q,G)});return wq(U,X,D)}});function VN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(T4($)&&T4(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=VN($[X],I[X]);if(!D.valid)return{valid:!1,mergeErrorPath:[X,...D.mergeErrorPath]};w[X]=D.data}return{valid:!0,data:w}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let b=0;b<$.length;b++){let w=$[b],X=I[b],D=VN(w,X);if(!D.valid)return{valid:!1,mergeErrorPath:[b,...D.mergeErrorPath]};U.push(D.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function wq($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(_4($))return $;let b=VN(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var FX=z("$ZodTuple",($,I)=>{o.init($,I);let U=I.items;$._zod.parse=(b,w)=>{let X=b.value;if(!Array.isArray(X))return b.issues.push({input:X,inst:$,expected:"tuple",code:"invalid_type"}),b;b.value=[];let D=[],W=[...U].reverse().findIndex((N)=>N._zod.optin!=="optional"),Q=W===-1?0:U.length-W;if(!I.rest){let N=X.length>U.length,B=X.length<Q-1;if(N||B)return b.issues.push({...N?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:X,inst:$,origin:"array"}),b}let G=-1;for(let N of U){if(G++,G>=X.length){if(G>=Q)continue}let B=N._zod.run({value:X[G],issues:[]},w);if(B instanceof Promise)D.push(B.then((H)=>OX(H,b,G)));else OX(B,b,G)}if(I.rest){let N=X.slice(U.length);for(let B of N){G++;let H=I.rest._zod.run({value:B,issues:[]},w);if(H instanceof Promise)D.push(H.then((J)=>OX(J,b,G)));else OX(H,b,G)}}if(D.length)return Promise.all(D).then(()=>b);return b}});function OX($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var GY=z("$ZodRecord",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!T4(w))return U.issues.push({expected:"record",code:"invalid_type",input:w,inst:$}),U;let X=[],D=I.keyType._zod.values;if(D){U.value={};let W=new Set;for(let G of D)if(typeof G==="string"||typeof G==="number"||typeof G==="symbol"){W.add(typeof G==="number"?G.toString():G);let N=I.valueType._zod.run({value:w[G],issues:[]},b);if(N instanceof Promise)X.push(N.then((B)=>{if(B.issues.length)U.issues.push(...G6(G,B.issues));U.value[G]=B.value}));else{if(N.issues.length)U.issues.push(...G6(G,N.issues));U.value[G]=N.value}}let Q;for(let G in w)if(!W.has(G))Q=Q??[],Q.push(G);if(Q&&Q.length>0)U.issues.push({code:"unrecognized_keys",input:w,inst:$,keys:Q})}else{U.value={};for(let W of Reflect.ownKeys(w)){if(W==="__proto__")continue;let Q=I.keyType._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(Q.issues.length){if(I.mode==="loose")U.value[W]=w[W];else U.issues.push({code:"invalid_key",origin:"record",issues:Q.issues.map((N)=>U6(N,b,P$())),input:W,path:[W],inst:$});continue}let G=I.valueType._zod.run({value:w[W],issues:[]},b);if(G instanceof Promise)X.push(G.then((N)=>{if(N.issues.length)U.issues.push(...G6(W,N.issues));U.value[Q.value]=N.value}));else{if(G.issues.length)U.issues.push(...G6(W,G.issues));U.value[Q.value]=G.value}}}if(X.length)return Promise.all(X).then(()=>U);return U}}),NY=z("$ZodMap",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!(w instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:w,inst:$}),U;let X=[];U.value=new Map;for(let[D,W]of w){let Q=I.keyType._zod.run({value:D,issues:[]},b),G=I.valueType._zod.run({value:W,issues:[]},b);if(Q instanceof Promise||G instanceof Promise)X.push(Promise.all([Q,G]).then(([N,B])=>{bq(N,B,U,D,w,$,b)}));else bq(Q,G,U,D,w,$,b)}if(X.length)return Promise.all(X).then(()=>U);return U}});function bq($,I,U,b,w,X,D){if($.issues.length)if(cU.has(typeof b))U.issues.push(...G6(b,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:w,inst:X,issues:$.issues.map((W)=>U6(W,D,P$()))});if(I.issues.length)if(cU.has(typeof b))U.issues.push(...G6(b,I.issues));else U.issues.push({origin:"map",code:"invalid_element",input:w,inst:X,key:b,issues:I.issues.map((W)=>U6(W,D,P$()))});U.value.set($.value,I.value)}var YY=z("$ZodSet",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!(w instanceof Set))return U.issues.push({input:w,inst:$,expected:"set",code:"invalid_type"}),U;let X=[];U.value=new Set;for(let D of w){let W=I.valueType._zod.run({value:D,issues:[]},b);if(W instanceof Promise)X.push(W.then((Q)=>Xq(Q,U)));else Xq(W,U)}if(X.length)return Promise.all(X).then(()=>U);return U}});function Xq($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var BY=z("$ZodEnum",($,I)=>{o.init($,I);let U=uU(I.entries),b=new Set(U);$._zod.values=b,$._zod.pattern=new RegExp(`^(${U.filter((w)=>cU.has(typeof w)).map((w)=>typeof w==="string"?L6(w):w.toString()).join("|")})$`),$._zod.parse=(w,X)=>{let D=w.value;if(b.has(D))return w;return w.issues.push({code:"invalid_value",values:U,input:D,inst:$}),w}}),JY=z("$ZodLiteral",($,I)=>{if(o.init($,I),I.values.length===0)throw new Error("Cannot create literal schema with no valid values");let U=new Set(I.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${I.values.map((b)=>typeof b==="string"?L6(b):b?L6(b.toString()):String(b)).join("|")})$`),$._zod.parse=(b,w)=>{let X=b.value;if(U.has(X))return b;return b.issues.push({code:"invalid_value",values:I.values,input:X,inst:$}),b}}),HY=z("$ZodFile",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(w instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:w,inst:$}),U}}),AY=z("$ZodTransform",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1($.constructor.name);let w=I.transform(U.value,U);if(b.async)return(w instanceof Promise?w:Promise.resolve(w)).then((D)=>{return U.value=D,U});if(w instanceof Promise)throw new m6;return U.value=w,U}});function Dq($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var OY=z("$ZodOptional",($,I)=>{o.init($,I),$._zod.optin="optional",$._zod.optout="optional",s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${lU(U.source)})?$`):void 0}),$._zod.parse=(U,b)=>{if(I.innerType._zod.optin==="optional"){let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Dq(X,U.value));return Dq(w,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),zY=z("$ZodNullable",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${lU(U.source)}|null)$`):void 0}),s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,b)=>{if(U.value===null)return U;return I.innerType._zod.run(U,b)}}),LY=z("$ZodDefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);if(U.value===void 0)return U.value=I.defaultValue,U;let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Wq(X,I));return Wq(w,I)}});function Wq($,I){if($.value===void 0)$.value=I.defaultValue;return $}var KY=z("$ZodPrefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,b)}}),vY=z("$ZodNonOptional",($,I)=>{o.init($,I),s($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Qq(X,$));return Qq(w,$)}});function Qq($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var VY=z("$ZodSuccess",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1("ZodSuccess");let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{return U.value=X.issues.length===0,U});return U.value=w.issues.length===0,U}}),qY=z("$ZodCatch",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{if(U.value=X.value,X.issues.length)U.value=I.catchValue({...U,error:{issues:X.issues.map((D)=>U6(D,b,P$()))},input:U.value}),U.issues=[];return U});if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((X)=>U6(X,b,P$()))},input:U.value}),U.issues=[];return U}}),FY=z("$ZodNaN",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),MY=z("$ZodPipe",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,b)=>{if(b.direction==="backward"){let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>zX(D,I.in,b));return zX(X,I.in,b)}let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>zX(X,I.out,b));return zX(w,I.out,b)}});function zX($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var eU=z("$ZodCodec",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,b)=>{if((b.direction||"forward")==="forward"){let X=I.in._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>LX(D,I,b));return LX(X,I,b)}else{let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>LX(D,I,b));return LX(X,I,b)}}});function LX($,I,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let w=I.transform($.value,$);if(w instanceof Promise)return w.then((X)=>KX($,X,I.out,U));return KX($,w,I.out,U)}else{let w=I.reverseTransform($.value,$);if(w instanceof Promise)return w.then((X)=>KX($,X,I.in,U));return KX($,w,I.in,U)}}function KX($,I,U,b){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},b)}var jY=z("$ZodReadonly",($,I)=>{o.init($,I),s($._zod,"propValues",()=>I.innerType._zod.propValues),s($._zod,"values",()=>I.innerType._zod.values),s($._zod,"optin",()=>I.innerType?._zod?.optin),s($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then(Gq);return Gq(w)}});function Gq($){return $.value=Object.freeze($.value),$}var EY=z("$ZodTemplateLiteral",($,I)=>{o.init($,I);let U=[];for(let b of I.parts)if(typeof b==="object"&&b!==null){if(!b._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...b._zod.traits].shift()}`);let w=b._zod.pattern instanceof RegExp?b._zod.pattern.source:b._zod.pattern;if(!w)throw new Error(`Invalid template literal part: ${b._zod.traits}`);let X=w.startsWith("^")?1:0,D=w.endsWith("$")?w.length-1:w.length;U.push(w.slice(X,D))}else if(b===null||KG.has(typeof b))U.push(L6(`${b}`));else throw new Error(`Invalid template literal part: ${b}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(b,w)=>{if(typeof b.value!=="string")return b.issues.push({input:b.value,inst:$,expected:"template_literal",code:"invalid_type"}),b;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(b.value))return b.issues.push({input:b.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),b;return b}}),SY=z("$ZodFunction",($,I)=>{return o.init($,I),$._def=I,$._zod.def=I,$.implement=(U)=>{if(typeof U!=="function")throw new Error("implement() must be called with a function");return function(...b){let w=$._def.input?UX($._def.input,b):b,X=Reflect.apply(U,this,w);if($._def.output)return UX($._def.output,X);return X}},$.implementAsync=(U)=>{if(typeof U!=="function")throw new Error("implementAsync() must be called with a function");return async function(...b){let w=$._def.input?await wX($._def.input,b):b,X=await Reflect.apply(U,this,w);if($._def.output)return await wX($._def.output,X);return X}},$._zod.parse=(U,b)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let b=$.constructor;if(Array.isArray(U[0]))return new b({type:"function",input:new FX({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new b({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),PY=z("$ZodPromise",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return Promise.resolve(U.value).then((w)=>I.innerType._zod.run({value:w,issues:[]},b))}}),kY=z("$ZodLazy",($,I)=>{o.init($,I),s($._zod,"innerType",()=>I.getter()),s($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),s($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),s($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),s($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,b)=>{return $._zod.innerType._zod.run(U,b)}}),RY=z("$ZodCustom",($,I)=>{A$.init($,I),o.init($,I),$._zod.parse=(U,b)=>{return U},$._zod.check=(U)=>{let b=U.value,w=I.fn(b);if(w instanceof Promise)return w.then((X)=>Nq(X,U,b,$));Nq(w,U,b,$);return}});function Nq($,I,U,b){if(!$){let w={code:"custom",input:U,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)w.params=b._zod.def.params;I.issues.push(i1(w))}}var b0={};v6(b0,{zhTW:()=>K7,zhCN:()=>L7,yo:()=>v7,vi:()=>z7,ur:()=>O7,uk:()=>w0,ua:()=>A7,tr:()=>H7,th:()=>J7,ta:()=>B7,sv:()=>Y7,sl:()=>N7,ru:()=>G7,pt:()=>Q7,ps:()=>D7,pl:()=>W7,ota:()=>X7,no:()=>b7,nl:()=>w7,ms:()=>U7,mk:()=>I7,lt:()=>$7,ko:()=>sY,km:()=>$0,kh:()=>eY,ka:()=>aY,ja:()=>tY,it:()=>pY,is:()=>dY,id:()=>oY,hu:()=>iY,he:()=>nY,frCA:()=>rY,fr:()=>mY,fi:()=>cY,fa:()=>lY,es:()=>uY,eo:()=>yY,en:()=>sU,de:()=>fY,da:()=>hY,cs:()=>xY,ca:()=>gY,bg:()=>CY,be:()=>ZY,az:()=>_Y,ar:()=>TY});var jf=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${w.expected}، ولكن تم إدخال ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${j(w.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return` أكبر من اللازم: يفترض أن تكون ${w.origin??"القيمة"} ${X} ${w.maximum.toString()} ${D.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${w.origin??"القيمة"} ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`أصغر من اللازم: يفترض لـ ${w.origin} أن يكون ${X} ${w.minimum.toString()} ${D.unit}`;return`أصغر من اللازم: يفترض لـ ${w.origin} أن يكون ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${w.prefix}"`;if(X.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${X.suffix}"`;if(X.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${X.includes}"`;if(X.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${X.pattern}`;return`${b[X.format]??w.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${w.divisor}`;case"unrecognized_keys":return`معرف${w.keys.length>1?"ات":""} غريب${w.keys.length>1?"ة":""}: ${L(w.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${w.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${w.origin}`;default:return"مدخل غير مقبول"}}};function TY(){return{localeError:jf()}}var Ef=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${w.expected}, daxil olan ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Yanlış dəyər: gözlənilən ${j(w.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Çox böyük: gözlənilən ${w.origin??"dəyər"} ${X}${w.maximum.toString()} ${D.unit??"element"}`;return`Çox böyük: gözlənilən ${w.origin??"dəyər"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Çox kiçik: gözlənilən ${w.origin} ${X}${w.minimum.toString()} ${D.unit}`;return`Çox kiçik: gözlənilən ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Yanlış mətn: "${X.prefix}" ilə başlamalıdır`;if(X.format==="ends_with")return`Yanlış mətn: "${X.suffix}" ilə bitməlidir`;if(X.format==="includes")return`Yanlış mətn: "${X.includes}" daxil olmalıdır`;if(X.format==="regex")return`Yanlış mətn: ${X.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${b[X.format]??w.format}`}case"not_multiple_of":return`Yanlış ədəd: ${w.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${w.keys.length>1?"lar":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${w.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function _Y(){return{localeError:Ef()}}function Oq($,I,U,b){let w=Math.abs($),X=w%10,D=w%100;if(D>=11&&D<=19)return b;if(X===1)return I;if(X>=2&&X<=4)return U;return b}var Sf=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"лік";case"object":{if(Array.isArray(w))return"масіў";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${w.expected}, атрымана ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Няправільны ўвод: чакалася ${j(w.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D){let W=Number(w.maximum),Q=Oq(W,D.unit.one,D.unit.few,D.unit.many);return`Занадта вялікі: чакалася, што ${w.origin??"значэнне"} павінна ${D.verb} ${X}${w.maximum.toString()} ${Q}`}return`Занадта вялікі: чакалася, што ${w.origin??"значэнне"} павінна быць ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D){let W=Number(w.minimum),Q=Oq(W,D.unit.one,D.unit.few,D.unit.many);return`Занадта малы: чакалася, што ${w.origin} павінна ${D.verb} ${X}${w.minimum.toString()} ${Q}`}return`Занадта малы: чакалася, што ${w.origin} павінна быць ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${X.prefix}"`;if(X.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${X.suffix}"`;if(X.format==="includes")return`Няправільны радок: павінен змяшчаць "${X.includes}"`;if(X.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${X.pattern}`;return`Няправільны ${b[X.format]??w.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${w.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${w.keys.length>1?"ключы":"ключ"}: ${L(w.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${w.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${w.origin}`;default:return"Няправільны ўвод"}}};function ZY(){return{localeError:Sf()}}var Pf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"число";case"object":{if(Array.isArray($))return"масив";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},kf=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(b){return $[b]??null}let U={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(b)=>{switch(b.code){case"invalid_type":return`Невалиден вход: очакван ${b.expected}, получен ${Pf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Невалиден вход: очакван ${j(b.values[0])}`;return`Невалидна опция: очаквано едно от ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Твърде голямо: очаква се ${b.origin??"стойност"} да съдържа ${w}${b.maximum.toString()} ${X.unit??"елемента"}`;return`Твърде голямо: очаква се ${b.origin??"стойност"} да бъде ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Твърде малко: очаква се ${b.origin} да съдържа ${w}${b.minimum.toString()} ${X.unit}`;return`Твърде малко: очаква се ${b.origin} да бъде ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Невалиден низ: трябва да започва с "${w.prefix}"`;if(w.format==="ends_with")return`Невалиден низ: трябва да завършва с "${w.suffix}"`;if(w.format==="includes")return`Невалиден низ: трябва да включва "${w.includes}"`;if(w.format==="regex")return`Невалиден низ: трябва да съвпада с ${w.pattern}`;let X="Невалиден";if(w.format==="emoji")X="Невалидно";if(w.format==="datetime")X="Невалидно";if(w.format==="date")X="Невалидна";if(w.format==="time")X="Невалидно";if(w.format==="duration")X="Невалидна";return`${X} ${U[w.format]??b.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${b.divisor}`;case"unrecognized_keys":return`Неразпознат${b.keys.length>1?"и":""} ключ${b.keys.length>1?"ове":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${b.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${b.origin}`;default:return"Невалиден вход"}}};function CY(){return{localeError:kf()}}var Rf=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Tipus invàlid: s'esperava ${w.expected}, s'ha rebut ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Valor invàlid: s'esperava ${j(w.values[0])}`;return`Opció invàlida: s'esperava una de ${L(w.values," o ")}`;case"too_big":{let X=w.inclusive?"com a màxim":"menys de",D=I(w.origin);if(D)return`Massa gran: s'esperava que ${w.origin??"el valor"} contingués ${X} ${w.maximum.toString()} ${D.unit??"elements"}`;return`Massa gran: s'esperava que ${w.origin??"el valor"} fos ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"com a mínim":"més de",D=I(w.origin);if(D)return`Massa petit: s'esperava que ${w.origin} contingués ${X} ${w.minimum.toString()} ${D.unit}`;return`Massa petit: s'esperava que ${w.origin} fos ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Format invàlid: ha de començar amb "${X.prefix}"`;if(X.format==="ends_with")return`Format invàlid: ha d'acabar amb "${X.suffix}"`;if(X.format==="includes")return`Format invàlid: ha d'incloure "${X.includes}"`;if(X.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${X.pattern}`;return`Format invàlid per a ${b[X.format]??w.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${w.divisor}`;case"unrecognized_keys":return`Clau${w.keys.length>1?"s":""} no reconeguda${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${w.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${w.origin}`;default:return"Entrada invàlida"}}};function gY(){return{localeError:Rf()}}var Tf=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"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(w))return"pole";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Neplatný vstup: očekáváno ${w.expected}, obdrženo ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Neplatný vstup: očekáváno ${j(w.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Hodnota je příliš velká: ${w.origin??"hodnota"} musí mít ${X}${w.maximum.toString()} ${D.unit??"prvků"}`;return`Hodnota je příliš velká: ${w.origin??"hodnota"} musí být ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Hodnota je příliš malá: ${w.origin??"hodnota"} musí mít ${X}${w.minimum.toString()} ${D.unit??"prvků"}`;return`Hodnota je příliš malá: ${w.origin??"hodnota"} musí být ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Neplatný řetězec: musí začínat na "${X.prefix}"`;if(X.format==="ends_with")return`Neplatný řetězec: musí končit na "${X.suffix}"`;if(X.format==="includes")return`Neplatný řetězec: musí obsahovat "${X.includes}"`;if(X.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${X.pattern}`;return`Neplatný formát ${b[X.format]??w.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${w.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${L(w.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${w.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${w.origin}`;default:return"Neplatný vstup"}}};function xY(){return{localeError:Tf()}}var _f=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},I={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function U(D){return $[D]??null}function b(D){return I[D]??D}let w=(D)=>{let W=typeof D;switch(W){case"number":return Number.isNaN(D)?"NaN":"tal";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"objekt"}}return W},X={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Ugyldigt input: forventede ${b(D.expected)}, fik ${b(w(D.input))}`;case"invalid_value":if(D.values.length===1)return`Ugyldig værdi: forventede ${j(D.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${L(D.values,"|")}`;case"too_big":{let W=D.inclusive?"<=":"<",Q=U(D.origin),G=b(D.origin);if(Q)return`For stor: forventede ${G??"value"} ${Q.verb} ${W} ${D.maximum.toString()} ${Q.unit??"elementer"}`;return`For stor: forventede ${G??"value"} havde ${W} ${D.maximum.toString()}`}case"too_small":{let W=D.inclusive?">=":">",Q=U(D.origin),G=b(D.origin);if(Q)return`For lille: forventede ${G} ${Q.verb} ${W} ${D.minimum.toString()} ${Q.unit}`;return`For lille: forventede ${G} havde ${W} ${D.minimum.toString()}`}case"invalid_format":{let W=D;if(W.format==="starts_with")return`Ugyldig streng: skal starte med "${W.prefix}"`;if(W.format==="ends_with")return`Ugyldig streng: skal ende med "${W.suffix}"`;if(W.format==="includes")return`Ugyldig streng: skal indeholde "${W.includes}"`;if(W.format==="regex")return`Ugyldig streng: skal matche mønsteret ${W.pattern}`;return`Ugyldig ${X[W.format]??D.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${D.divisor}`;case"unrecognized_keys":return`${D.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${L(D.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${D.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${D.origin}`;default:return"Ugyldigt input"}}};function hY(){return{localeError:_f()}}var Zf=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"Zahl";case"object":{if(Array.isArray(w))return"Array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${w.expected}, erhalten ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ungültige Eingabe: erwartet ${j(w.values[0])}`;return`Ungültige Option: erwartet eine von ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Zu groß: erwartet, dass ${w.origin??"Wert"} ${X}${w.maximum.toString()} ${D.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${w.origin??"Wert"} ${X}${w.maximum.toString()} ist`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Zu klein: erwartet, dass ${w.origin} ${X}${w.minimum.toString()} ${D.unit} hat`;return`Zu klein: erwartet, dass ${w.origin} ${X}${w.minimum.toString()} ist`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ungültiger String: muss mit "${X.prefix}" beginnen`;if(X.format==="ends_with")return`Ungültiger String: muss mit "${X.suffix}" enden`;if(X.format==="includes")return`Ungültiger String: muss "${X.includes}" enthalten`;if(X.format==="regex")return`Ungültiger String: muss dem Muster ${X.pattern} entsprechen`;return`Ungültig: ${b[X.format]??w.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${w.divisor} sein`;case"unrecognized_keys":return`${w.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${w.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${w.origin}`;default:return"Ungültige Eingabe"}}};function fY(){return{localeError:Zf()}}var Cf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},gf=()=>{let $={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 I(b){return $[b]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${Cf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${j(b.values[0])}`;return`Invalid option: expected one of ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Too big: expected ${b.origin??"value"} to have ${w}${b.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Too small: expected ${b.origin} to have ${w}${b.minimum.toString()} ${X.unit}`;return`Too small: expected ${b.origin} to be ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${U[w.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function sU(){return{localeError:gf()}}var xf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},hf=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(b){return $[b]??null}let U={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(b)=>{switch(b.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${b.expected}, riceviĝis ${xf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Nevalida enigo: atendiĝis ${j(b.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${w}${b.maximum.toString()} ${X.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Tro malgranda: atendiĝis ke ${b.origin} havu ${w}${b.minimum.toString()} ${X.unit}`;return`Tro malgranda: atendiĝis ke ${b.origin} estu ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${w.prefix}"`;if(w.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${w.suffix}"`;if(w.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${w.includes}"`;if(w.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${w.pattern}`;return`Nevalida ${U[w.format]??b.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${b.divisor}`;case"unrecognized_keys":return`Nekonata${b.keys.length>1?"j":""} ŝlosilo${b.keys.length>1?"j":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${b.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${b.origin}`;default:return"Nevalida enigo"}}};function yY(){return{localeError:hf()}}var ff=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},I={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function U(D){return $[D]??null}function b(D){return I[D]??D}let w=(D)=>{let W=typeof D;switch(W){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)return D.constructor.name;return"object"}}return W},X={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 ${b(D.expected)}, recibido ${b(w(D.input))}`;case"invalid_value":if(D.values.length===1)return`Entrada inválida: se esperaba ${j(D.values[0])}`;return`Opción inválida: se esperaba una de ${L(D.values,"|")}`;case"too_big":{let W=D.inclusive?"<=":"<",Q=U(D.origin),G=b(D.origin);if(Q)return`Demasiado grande: se esperaba que ${G??"valor"} tuviera ${W}${D.maximum.toString()} ${Q.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${G??"valor"} fuera ${W}${D.maximum.toString()}`}case"too_small":{let W=D.inclusive?">=":">",Q=U(D.origin),G=b(D.origin);if(Q)return`Demasiado pequeño: se esperaba que ${G} tuviera ${W}${D.minimum.toString()} ${Q.unit}`;return`Demasiado pequeño: se esperaba que ${G} fuera ${W}${D.minimum.toString()}`}case"invalid_format":{let W=D;if(W.format==="starts_with")return`Cadena inválida: debe comenzar con "${W.prefix}"`;if(W.format==="ends_with")return`Cadena inválida: debe terminar en "${W.suffix}"`;if(W.format==="includes")return`Cadena inválida: debe incluir "${W.includes}"`;if(W.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${W.pattern}`;return`Inválido ${X[W.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":""}: ${L(D.keys,", ")}`;case"invalid_key":return`Llave inválida en ${b(D.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${b(D.origin)}`;default:return"Entrada inválida"}}};function uY(){return{localeError:ff()}}var yf=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"عدد";case"object":{if(Array.isArray(w))return"آرایه";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${w.expected} می‌بود، ${U(w.input)} دریافت شد`;case"invalid_value":if(w.values.length===1)return`ورودی نامعتبر: می‌بایست ${j(w.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${L(w.values,"|")} می‌بود`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`خیلی بزرگ: ${w.origin??"مقدار"} باید ${X}${w.maximum.toString()} ${D.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${w.origin??"مقدار"} باید ${X}${w.maximum.toString()} باشد`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`خیلی کوچک: ${w.origin} باید ${X}${w.minimum.toString()} ${D.unit} باشد`;return`خیلی کوچک: ${w.origin} باید ${X}${w.minimum.toString()} باشد`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`رشته نامعتبر: باید با "${X.prefix}" شروع شود`;if(X.format==="ends_with")return`رشته نامعتبر: باید با "${X.suffix}" تمام شود`;if(X.format==="includes")return`رشته نامعتبر: باید شامل "${X.includes}" باشد`;if(X.format==="regex")return`رشته نامعتبر: باید با الگوی ${X.pattern} مطابقت داشته باشد`;return`${b[X.format]??w.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${w.divisor} باشد`;case"unrecognized_keys":return`کلید${w.keys.length>1?"های":""} ناشناس: ${L(w.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${w.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${w.origin}`;default:return"ورودی نامعتبر"}}};function lY(){return{localeError:yf()}}var uf=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${w.expected}, oli ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Virheellinen syöte: täytyy olla ${j(w.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Liian suuri: ${D.subject} täytyy olla ${X}${w.maximum.toString()} ${D.unit}`.trim();return`Liian suuri: arvon täytyy olla ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Liian pieni: ${D.subject} täytyy olla ${X}${w.minimum.toString()} ${D.unit}`.trim();return`Liian pieni: arvon täytyy olla ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${X.prefix}"`;if(X.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${X.suffix}"`;if(X.format==="includes")return`Virheellinen syöte: täytyy sisältää "${X.includes}"`;if(X.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${X.pattern}`;return`Virheellinen ${b[X.format]??w.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${w.divisor} monikerta`;case"unrecognized_keys":return`${w.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${L(w.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 cY(){return{localeError:uf()}}var lf=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nombre";case"object":{if(Array.isArray(w))return"tableau";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Entrée invalide : ${w.expected} attendu, ${U(w.input)} reçu`;case"invalid_value":if(w.values.length===1)return`Entrée invalide : ${j(w.values[0])} attendu`;return`Option invalide : une valeur parmi ${L(w.values,"|")} attendue`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Trop grand : ${w.origin??"valeur"} doit ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"élément(s)"}`;return`Trop grand : ${w.origin??"valeur"} doit être ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Trop petit : ${w.origin} doit ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Trop petit : ${w.origin} doit être ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chaîne invalide : doit commencer par "${X.prefix}"`;if(X.format==="ends_with")return`Chaîne invalide : doit se terminer par "${X.suffix}"`;if(X.format==="includes")return`Chaîne invalide : doit inclure "${X.includes}"`;if(X.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${X.pattern}`;return`${b[X.format]??w.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${w.divisor}`;case"unrecognized_keys":return`Clé${w.keys.length>1?"s":""} non reconnue${w.keys.length>1?"s":""} : ${L(w.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${w.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${w.origin}`;default:return"Entrée invalide"}}};function mY(){return{localeError:lf()}}var cf=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Entrée invalide : attendu ${w.expected}, reçu ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Entrée invalide : attendu ${j(w.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"≤":"<",D=I(w.origin);if(D)return`Trop grand : attendu que ${w.origin??"la valeur"} ait ${X}${w.maximum.toString()} ${D.unit}`;return`Trop grand : attendu que ${w.origin??"la valeur"} soit ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"≥":">",D=I(w.origin);if(D)return`Trop petit : attendu que ${w.origin} ait ${X}${w.minimum.toString()} ${D.unit}`;return`Trop petit : attendu que ${w.origin} soit ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chaîne invalide : doit commencer par "${X.prefix}"`;if(X.format==="ends_with")return`Chaîne invalide : doit se terminer par "${X.suffix}"`;if(X.format==="includes")return`Chaîne invalide : doit inclure "${X.includes}"`;if(X.format==="regex")return`Chaîne invalide : doit correspondre au motif ${X.pattern}`;return`${b[X.format]??w.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${w.divisor}`;case"unrecognized_keys":return`Clé${w.keys.length>1?"s":""} non reconnue${w.keys.length>1?"s":""} : ${L(w.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${w.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${w.origin}`;default:return"Entrée invalide"}}};function rY(){return{localeError:cf()}}var mf=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(G)=>G?$[G]:void 0,b=(G)=>{let N=U(G);if(N)return N.label;return G??$.unknown.label},w=(G)=>`ה${b(G)}`,X=(G)=>{return(U(G)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},D=(G)=>{if(!G)return null;return I[G]??null},W=(G)=>{let N=typeof G;switch(N){case"number":return Number.isNaN(G)?"NaN":"number";case"object":{if(Array.isArray(G))return"array";if(G===null)return"null";if(Object.getPrototypeOf(G)!==Object.prototype&&G.constructor)return G.constructor.name;return"object"}default:return N}},Q={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(G)=>{switch(G.code){case"invalid_type":{let N=G.expected,B=b(N),H=W(G.input),J=$[H]?.label??H;return`קלט לא תקין: צריך להיות ${B}, התקבל ${J}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(G.values[0])}`;let N=G.values.map((J)=>j(J));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${N[0]} או ${N[1]}`;let B=N[N.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${N.slice(0,-1).join(", ")} או ${B}`}case"too_big":{let N=D(G.origin),B=w(G.origin??"value");if(G.origin==="string")return`${N?.longLabel??"ארוך"} מדי: ${B} צריכה להכיל ${G.maximum.toString()} ${N?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let A=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${B} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך",O=G.inclusive?`${G.maximum} ${N?.unit??""} או פחות`:`פחות מ-${G.maximum} ${N?.unit??""}`;return`גדול מדי: ${B} ${A} להכיל ${O}`.trim()}let H=G.inclusive?"<=":"<",J=X(G.origin??"value");if(N?.unit)return`${N.longLabel} מדי: ${B} ${J} ${H}${G.maximum.toString()} ${N.unit}`;return`${N?.longLabel??"גדול"} מדי: ${B} ${J} ${H}${G.maximum.toString()}`}case"too_small":{let N=D(G.origin),B=w(G.origin??"value");if(G.origin==="string")return`${N?.shortLabel??"קצר"} מדי: ${B} צריכה להכיל ${G.minimum.toString()} ${N?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let A=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${B} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך";if(G.minimum===1&&G.inclusive){let V=G.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${B} ${A} להכיל ${V}`}let O=G.inclusive?`${G.minimum} ${N?.unit??""} או יותר`:`יותר מ-${G.minimum} ${N?.unit??""}`;return`קטן מדי: ${B} ${A} להכיל ${O}`.trim()}let H=G.inclusive?">=":">",J=X(G.origin??"value");if(N?.unit)return`${N.shortLabel} מדי: ${B} ${J} ${H}${G.minimum.toString()} ${N.unit}`;return`${N?.shortLabel??"קטן"} מדי: ${B} ${J} ${H}${G.minimum.toString()}`}case"invalid_format":{let N=G;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}`;let B=Q[N.format],H=B?.label??N.format,A=(B?.gender??"m")==="f"?"תקינה":"תקין";return`${H} לא ${A}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${G.divisor}`;case"unrecognized_keys":return`מפתח${G.keys.length>1?"ות":""} לא מזוה${G.keys.length>1?"ים":"ה"}: ${L(G.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${w(G.origin??"array")}`;default:return"קלט לא תקין"}}};function nY(){return{localeError:mf()}}var rf=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"szám";case"object":{if(Array.isArray(w))return"tömb";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${w.expected}, a kapott érték ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Érvénytelen bemenet: a várt érték ${j(w.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Túl nagy: ${w.origin??"érték"} mérete túl nagy ${X}${w.maximum.toString()} ${D.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${w.origin??"érték"} túl nagy: ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Túl kicsi: a bemeneti érték ${w.origin} mérete túl kicsi ${X}${w.minimum.toString()} ${D.unit}`;return`Túl kicsi: a bemeneti érték ${w.origin} túl kicsi ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Érvénytelen string: "${X.prefix}" értékkel kell kezdődnie`;if(X.format==="ends_with")return`Érvénytelen string: "${X.suffix}" értékkel kell végződnie`;if(X.format==="includes")return`Érvénytelen string: "${X.includes}" értéket kell tartalmaznia`;if(X.format==="regex")return`Érvénytelen string: ${X.pattern} mintának kell megfelelnie`;return`Érvénytelen ${b[X.format]??w.format}`}case"not_multiple_of":return`Érvénytelen szám: ${w.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${w.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${w.origin}`;default:return"Érvénytelen bemenet"}}};function iY(){return{localeError:rf()}}var nf=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Input tidak valid: diharapkan ${w.expected}, diterima ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input tidak valid: diharapkan ${j(w.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Terlalu besar: diharapkan ${w.origin??"value"} memiliki ${X}${w.maximum.toString()} ${D.unit??"elemen"}`;return`Terlalu besar: diharapkan ${w.origin??"value"} menjadi ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Terlalu kecil: diharapkan ${w.origin} memiliki ${X}${w.minimum.toString()} ${D.unit}`;return`Terlalu kecil: diharapkan ${w.origin} menjadi ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`String tidak valid: harus dimulai dengan "${X.prefix}"`;if(X.format==="ends_with")return`String tidak valid: harus berakhir dengan "${X.suffix}"`;if(X.format==="includes")return`String tidak valid: harus menyertakan "${X.includes}"`;if(X.format==="regex")return`String tidak valid: harus sesuai pola ${X.pattern}`;return`${b[X.format]??w.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${w.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${w.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${w.origin}`;default:return"Input tidak valid"}}};function oY(){return{localeError:nf()}}var of=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},df=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(b){return $[b]??null}let U={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(b)=>{switch(b.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${of(b.input)} þar sem á að vera ${b.expected}`;case"invalid_value":if(b.values.length===1)return`Rangt gildi: gert ráð fyrir ${j(b.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} hafi ${w}${b.maximum.toString()} ${X.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} sé ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Of lítið: gert er ráð fyrir að ${b.origin} hafi ${w}${b.minimum.toString()} ${X.unit}`;return`Of lítið: gert er ráð fyrir að ${b.origin} sé ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ógildur strengur: verður að byrja á "${w.prefix}"`;if(w.format==="ends_with")return`Ógildur strengur: verður að enda á "${w.suffix}"`;if(w.format==="includes")return`Ógildur strengur: verður að innihalda "${w.includes}"`;if(w.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${w.pattern}`;return`Rangt ${U[w.format]??b.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${b.divisor}`;case"unrecognized_keys":return`Óþekkt ${b.keys.length>1?"ir lyklar":"ur lykill"}: ${L(b.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${b.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${b.origin}`;default:return"Rangt gildi"}}};function dY(){return{localeError:df()}}var pf=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"numero";case"object":{if(Array.isArray(w))return"vettore";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Input non valido: atteso ${w.expected}, ricevuto ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input non valido: atteso ${j(w.values[0])}`;return`Opzione non valida: atteso uno tra ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Troppo grande: ${w.origin??"valore"} deve avere ${X}${w.maximum.toString()} ${D.unit??"elementi"}`;return`Troppo grande: ${w.origin??"valore"} deve essere ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Troppo piccolo: ${w.origin} deve avere ${X}${w.minimum.toString()} ${D.unit}`;return`Troppo piccolo: ${w.origin} deve essere ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Stringa non valida: deve iniziare con "${X.prefix}"`;if(X.format==="ends_with")return`Stringa non valida: deve terminare con "${X.suffix}"`;if(X.format==="includes")return`Stringa non valida: deve includere "${X.includes}"`;if(X.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${X.pattern}`;return`Invalid ${b[X.format]??w.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${w.divisor}`;case"unrecognized_keys":return`Chiav${w.keys.length>1?"i":"e"} non riconosciut${w.keys.length>1?"e":"a"}: ${L(w.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${w.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${w.origin}`;default:return"Input non valido"}}};function pY(){return{localeError:pf()}}var tf=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"数値";case"object":{if(Array.isArray(w))return"配列";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`無効な入力: ${w.expected}が期待されましたが、${U(w.input)}が入力されました`;case"invalid_value":if(w.values.length===1)return`無効な入力: ${j(w.values[0])}が期待されました`;return`無効な選択: ${L(w.values,"、")}のいずれかである必要があります`;case"too_big":{let X=w.inclusive?"以下である":"より小さい",D=I(w.origin);if(D)return`大きすぎる値: ${w.origin??"値"}は${w.maximum.toString()}${D.unit??"要素"}${X}必要があります`;return`大きすぎる値: ${w.origin??"値"}は${w.maximum.toString()}${X}必要があります`}case"too_small":{let X=w.inclusive?"以上である":"より大きい",D=I(w.origin);if(D)return`小さすぎる値: ${w.origin}は${w.minimum.toString()}${D.unit}${X}必要があります`;return`小さすぎる値: ${w.origin}は${w.minimum.toString()}${X}必要があります`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`無効な文字列: "${X.prefix}"で始まる必要があります`;if(X.format==="ends_with")return`無効な文字列: "${X.suffix}"で終わる必要があります`;if(X.format==="includes")return`無効な文字列: "${X.includes}"を含む必要があります`;if(X.format==="regex")return`無効な文字列: パターン${X.pattern}に一致する必要があります`;return`無効な${b[X.format]??w.format}`}case"not_multiple_of":return`無効な数値: ${w.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${w.keys.length>1?"群":""}: ${L(w.keys,"、")}`;case"invalid_key":return`${w.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${w.origin}内の無効な値`;default:return"無効な入力"}}};function tY(){return{localeError:tf()}}var af=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[I]??I},ef=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(b){return $[b]??null}let U={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(b)=>{switch(b.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${b.expected}, მიღებული ${af(b.input)}`;case"invalid_value":if(b.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${j(b.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${L(b.values,"|")}-დან`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} ${X.verb} ${w}${b.maximum.toString()} ${X.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} იყოს ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} ${X.verb} ${w}${b.minimum.toString()} ${X.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} იყოს ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${w.prefix}"-ით`;if(w.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${w.suffix}"-ით`;if(w.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${w.includes}"-ს`;if(w.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${w.pattern}`;return`არასწორი ${U[w.format]??b.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${b.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${b.keys.length>1?"ები":"ი"}: ${L(b.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${b.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${b.origin}-ში`;default:return"არასწორი შეყვანა"}}};function aY(){return{localeError:ef()}}var sf=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(w))return"អារេ (Array)";if(w===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${w.expected} ប៉ុន្តែទទួលបាន ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${j(w.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`ធំពេក៖ ត្រូវការ ${w.origin??"តម្លៃ"} ${X} ${w.maximum.toString()} ${D.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${w.origin??"តម្លៃ"} ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`តូចពេក៖ ត្រូវការ ${w.origin} ${X} ${w.minimum.toString()} ${D.unit}`;return`តូចពេក៖ ត្រូវការ ${w.origin} ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${X.prefix}"`;if(X.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${X.suffix}"`;if(X.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${X.includes}"`;if(X.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${X.pattern}`;return`មិនត្រឹមត្រូវ៖ ${b[X.format]??w.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${w.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${L(w.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${w.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${w.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function $0(){return{localeError:sf()}}function eY(){return $0()}var $y=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${w.expected}, 받은 타입은 ${U(w.input)}입니다`;case"invalid_value":if(w.values.length===1)return`잘못된 입력: 값은 ${j(w.values[0])} 이어야 합니다`;return`잘못된 옵션: ${L(w.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let X=w.inclusive?"이하":"미만",D=X==="미만"?"이어야 합니다":"여야 합니다",W=I(w.origin),Q=W?.unit??"요소";if(W)return`${w.origin??"값"}이 너무 큽니다: ${w.maximum.toString()}${Q} ${X}${D}`;return`${w.origin??"값"}이 너무 큽니다: ${w.maximum.toString()} ${X}${D}`}case"too_small":{let X=w.inclusive?"이상":"초과",D=X==="이상"?"이어야 합니다":"여야 합니다",W=I(w.origin),Q=W?.unit??"요소";if(W)return`${w.origin??"값"}이 너무 작습니다: ${w.minimum.toString()}${Q} ${X}${D}`;return`${w.origin??"값"}이 너무 작습니다: ${w.minimum.toString()} ${X}${D}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`잘못된 문자열: "${X.prefix}"(으)로 시작해야 합니다`;if(X.format==="ends_with")return`잘못된 문자열: "${X.suffix}"(으)로 끝나야 합니다`;if(X.format==="includes")return`잘못된 문자열: "${X.includes}"을(를) 포함해야 합니다`;if(X.format==="regex")return`잘못된 문자열: 정규식 ${X.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${b[X.format]??w.format}`}case"not_multiple_of":return`잘못된 숫자: ${w.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${L(w.keys,", ")}`;case"invalid_key":return`잘못된 키: ${w.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${w.origin}`;default:return"잘못된 입력"}}};function sY(){return{localeError:$y()}}var Iy=($)=>{return U0(typeof $,$)},U0=($,I=void 0)=>{switch($){case"number":return Number.isNaN(I)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(I===void 0)return"nežinomas objektas";if(I===null)return"nulinė reikšmė";if(Array.isArray(I))return"masyvas";if(Object.getPrototypeOf(I)!==Object.prototype&&I.constructor)return I.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},I0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function zq($){let I=Math.abs($),U=I%10,b=I%100;if(b>=11&&b<=19||U===0)return"many";if(U===1)return"one";return"few"}var Uy=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(b,w,X,D){let W=$[b]??null;if(W===null)return W;return{unit:W.unit[w],verb:W.verb[D][X?"inclusive":"notInclusive"]}}let U={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(b)=>{switch(b.code){case"invalid_type":return`Gautas tipas ${Iy(b.input)}, o tikėtasi - ${U0(b.expected)}`;case"invalid_value":if(b.values.length===1)return`Privalo būti ${j(b.values[0])}`;return`Privalo būti vienas iš ${L(b.values,"|")} pasirinkimų`;case"too_big":{let w=U0(b.origin),X=I(b.origin,zq(Number(b.maximum)),b.inclusive??!1,"smaller");if(X?.verb)return`${I0(w??b.origin??"reikšmė")} ${X.verb} ${b.maximum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${I0(w??b.origin??"reikšmė")} turi būti ${D} ${b.maximum.toString()} ${X?.unit}`}case"too_small":{let w=U0(b.origin),X=I(b.origin,zq(Number(b.minimum)),b.inclusive??!1,"bigger");if(X?.verb)return`${I0(w??b.origin??"reikšmė")} ${X.verb} ${b.minimum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${I0(w??b.origin??"reikšmė")} turi būti ${D} ${b.minimum.toString()} ${X?.unit}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Eilutė privalo prasidėti "${w.prefix}"`;if(w.format==="ends_with")return`Eilutė privalo pasibaigti "${w.suffix}"`;if(w.format==="includes")return`Eilutė privalo įtraukti "${w.includes}"`;if(w.format==="regex")return`Eilutė privalo atitikti ${w.pattern}`;return`Neteisingas ${U[w.format]??b.format}`}case"not_multiple_of":return`Skaičius privalo būti ${b.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${b.keys.length>1?"i":"as"} rakt${b.keys.length>1?"ai":"as"}: ${L(b.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let w=U0(b.origin);return`${I0(w??b.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function $7(){return{localeError:Uy()}}var wy=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"број";case"object":{if(Array.isArray(w))return"низа";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Грешен внес: се очекува ${w.expected}, примено ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Invalid input: expected ${j(w.values[0])}`;return`Грешана опција: се очекува една ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Премногу голем: се очекува ${w.origin??"вредноста"} да има ${X}${w.maximum.toString()} ${D.unit??"елементи"}`;return`Премногу голем: се очекува ${w.origin??"вредноста"} да биде ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Премногу мал: се очекува ${w.origin} да има ${X}${w.minimum.toString()} ${D.unit}`;return`Премногу мал: се очекува ${w.origin} да биде ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неважечка низа: мора да започнува со "${X.prefix}"`;if(X.format==="ends_with")return`Неважечка низа: мора да завршува со "${X.suffix}"`;if(X.format==="includes")return`Неважечка низа: мора да вклучува "${X.includes}"`;if(X.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${X.pattern}`;return`Invalid ${b[X.format]??w.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${L(w.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${w.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${w.origin}`;default:return"Грешен внес"}}};function I7(){return{localeError:wy()}}var by=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nombor";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Input tidak sah: dijangka ${w.expected}, diterima ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input tidak sah: dijangka ${j(w.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Terlalu besar: dijangka ${w.origin??"nilai"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"elemen"}`;return`Terlalu besar: dijangka ${w.origin??"nilai"} adalah ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Terlalu kecil: dijangka ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Terlalu kecil: dijangka ${w.origin} adalah ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`String tidak sah: mesti bermula dengan "${X.prefix}"`;if(X.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${X.suffix}"`;if(X.format==="includes")return`String tidak sah: mesti mengandungi "${X.includes}"`;if(X.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${X.pattern}`;return`${b[X.format]??w.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${w.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${L(w.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${w.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${w.origin}`;default:return"Input tidak sah"}}};function U7(){return{localeError:by()}}var Xy=()=>{let $={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"getal";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Ongeldige invoer: verwacht ${w.expected}, ontving ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ongeldige invoer: verwacht ${j(w.values[0])}`;return`Ongeldige optie: verwacht één van ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Te groot: verwacht dat ${w.origin??"waarde"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"elementen"}`;return`Te groot: verwacht dat ${w.origin??"waarde"} ${X}${w.maximum.toString()} is`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Te klein: verwacht dat ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Te klein: verwacht dat ${w.origin} ${X}${w.minimum.toString()} is`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ongeldige tekst: moet met "${X.prefix}" beginnen`;if(X.format==="ends_with")return`Ongeldige tekst: moet op "${X.suffix}" eindigen`;if(X.format==="includes")return`Ongeldige tekst: moet "${X.includes}" bevatten`;if(X.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${X.pattern}`;return`Ongeldig: ${b[X.format]??w.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${w.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${w.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${w.origin}`;default:return"Ongeldige invoer"}}};function w7(){return{localeError:Xy()}}var Dy=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"tall";case"object":{if(Array.isArray(w))return"liste";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Ugyldig input: forventet ${w.expected}, fikk ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ugyldig verdi: forventet ${j(w.values[0])}`;return`Ugyldig valg: forventet en av ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`For stor(t): forventet ${w.origin??"value"} til å ha ${X}${w.maximum.toString()} ${D.unit??"elementer"}`;return`For stor(t): forventet ${w.origin??"value"} til å ha ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`For lite(n): forventet ${w.origin} til å ha ${X}${w.minimum.toString()} ${D.unit}`;return`For lite(n): forventet ${w.origin} til å ha ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ugyldig streng: må starte med "${X.prefix}"`;if(X.format==="ends_with")return`Ugyldig streng: må ende med "${X.suffix}"`;if(X.format==="includes")return`Ugyldig streng: må inneholde "${X.includes}"`;if(X.format==="regex")return`Ugyldig streng: må matche mønsteret ${X.pattern}`;return`Ugyldig ${b[X.format]??w.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${w.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${w.origin}`;default:return"Ugyldig input"}}};function b7(){return{localeError:Dy()}}var Wy=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"numara";case"object":{if(Array.isArray(w))return"saf";if(w===null)return"gayb";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Fâsit giren: umulan ${w.expected}, alınan ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Fâsit giren: umulan ${j(w.values[0])}`;return`Fâsit tercih: mûteberler ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Fazla büyük: ${w.origin??"value"}, ${X}${w.maximum.toString()} ${D.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${w.origin??"value"}, ${X}${w.maximum.toString()} olmalıydı.`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Fazla küçük: ${w.origin}, ${X}${w.minimum.toString()} ${D.unit} sahip olmalıydı.`;return`Fazla küçük: ${w.origin}, ${X}${w.minimum.toString()} olmalıydı.`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Fâsit metin: "${X.prefix}" ile başlamalı.`;if(X.format==="ends_with")return`Fâsit metin: "${X.suffix}" ile bitmeli.`;if(X.format==="includes")return`Fâsit metin: "${X.includes}" ihtivâ etmeli.`;if(X.format==="regex")return`Fâsit metin: ${X.pattern} nakşına uymalı.`;return`Fâsit ${b[X.format]??w.format}`}case"not_multiple_of":return`Fâsit sayı: ${w.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${w.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function X7(){return{localeError:Wy()}}var Qy=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"عدد";case"object":{if(Array.isArray(w))return"ارې";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`ناسم ورودي: باید ${w.expected} وای, مګر ${U(w.input)} ترلاسه شو`;case"invalid_value":if(w.values.length===1)return`ناسم ورودي: باید ${j(w.values[0])} وای`;return`ناسم انتخاب: باید یو له ${L(w.values,"|")} څخه وای`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`ډیر لوی: ${w.origin??"ارزښت"} باید ${X}${w.maximum.toString()} ${D.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${w.origin??"ارزښت"} باید ${X}${w.maximum.toString()} وي`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`ډیر کوچنی: ${w.origin} باید ${X}${w.minimum.toString()} ${D.unit} ولري`;return`ډیر کوچنی: ${w.origin} باید ${X}${w.minimum.toString()} وي`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`ناسم متن: باید د "${X.prefix}" سره پیل شي`;if(X.format==="ends_with")return`ناسم متن: باید د "${X.suffix}" سره پای ته ورسيږي`;if(X.format==="includes")return`ناسم متن: باید "${X.includes}" ولري`;if(X.format==="regex")return`ناسم متن: باید د ${X.pattern} سره مطابقت ولري`;return`${b[X.format]??w.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${w.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${w.keys.length>1?"کلیډونه":"کلیډ"}: ${L(w.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${w.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${w.origin} کې`;default:return"ناسمه ورودي"}}};function D7(){return{localeError:Qy()}}var Gy=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"liczba";case"object":{if(Array.isArray(w))return"tablica";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${w.expected}, otrzymano ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${j(w.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Za duża wartość: oczekiwano, że ${w.origin??"wartość"} będzie mieć ${X}${w.maximum.toString()} ${D.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${w.origin??"wartość"} będzie wynosić ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Za mała wartość: oczekiwano, że ${w.origin??"wartość"} będzie mieć ${X}${w.minimum.toString()} ${D.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${w.origin??"wartość"} będzie wynosić ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${X.prefix}"`;if(X.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${X.suffix}"`;if(X.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${X.includes}"`;if(X.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${X.pattern}`;return`Nieprawidłow(y/a/e) ${b[X.format]??w.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${w.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${w.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${w.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function W7(){return{localeError:Gy()}}var Ny=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"número";case"object":{if(Array.isArray(w))return"array";if(w===null)return"nulo";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Tipo inválido: esperado ${w.expected}, recebido ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Entrada inválida: esperado ${j(w.values[0])}`;return`Opção inválida: esperada uma das ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Muito grande: esperado que ${w.origin??"valor"} tivesse ${X}${w.maximum.toString()} ${D.unit??"elementos"}`;return`Muito grande: esperado que ${w.origin??"valor"} fosse ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Muito pequeno: esperado que ${w.origin} tivesse ${X}${w.minimum.toString()} ${D.unit}`;return`Muito pequeno: esperado que ${w.origin} fosse ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Texto inválido: deve começar com "${X.prefix}"`;if(X.format==="ends_with")return`Texto inválido: deve terminar com "${X.suffix}"`;if(X.format==="includes")return`Texto inválido: deve incluir "${X.includes}"`;if(X.format==="regex")return`Texto inválido: deve corresponder ao padrão ${X.pattern}`;return`${b[X.format]??w.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${w.divisor}`;case"unrecognized_keys":return`Chave${w.keys.length>1?"s":""} desconhecida${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Chave inválida em ${w.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${w.origin}`;default:return"Campo inválido"}}};function Q7(){return{localeError:Ny()}}function Lq($,I,U,b){let w=Math.abs($),X=w%10,D=w%100;if(D>=11&&D<=19)return b;if(X===1)return I;if(X>=2&&X<=4)return U;return b}var Yy=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"число";case"object":{if(Array.isArray(w))return"массив";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Неверный ввод: ожидалось ${w.expected}, получено ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Неверный ввод: ожидалось ${j(w.values[0])}`;return`Неверный вариант: ожидалось одно из ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D){let W=Number(w.maximum),Q=Lq(W,D.unit.one,D.unit.few,D.unit.many);return`Слишком большое значение: ожидалось, что ${w.origin??"значение"} будет иметь ${X}${w.maximum.toString()} ${Q}`}return`Слишком большое значение: ожидалось, что ${w.origin??"значение"} будет ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D){let W=Number(w.minimum),Q=Lq(W,D.unit.one,D.unit.few,D.unit.many);return`Слишком маленькое значение: ожидалось, что ${w.origin} будет иметь ${X}${w.minimum.toString()} ${Q}`}return`Слишком маленькое значение: ожидалось, что ${w.origin} будет ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неверная строка: должна начинаться с "${X.prefix}"`;if(X.format==="ends_with")return`Неверная строка: должна заканчиваться на "${X.suffix}"`;if(X.format==="includes")return`Неверная строка: должна содержать "${X.includes}"`;if(X.format==="regex")return`Неверная строка: должна соответствовать шаблону ${X.pattern}`;return`Неверный ${b[X.format]??w.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${w.divisor}`;case"unrecognized_keys":return`Нераспознанн${w.keys.length>1?"ые":"ый"} ключ${w.keys.length>1?"и":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${w.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${w.origin}`;default:return"Неверные входные данные"}}};function G7(){return{localeError:Yy()}}var By=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"število";case"object":{if(Array.isArray(w))return"tabela";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${w.expected}, prejeto ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Neveljaven vnos: pričakovano ${j(w.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Preveliko: pričakovano, da bo ${w.origin??"vrednost"} imelo ${X}${w.maximum.toString()} ${D.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${w.origin??"vrednost"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Premajhno: pričakovano, da bo ${w.origin} imelo ${X}${w.minimum.toString()} ${D.unit}`;return`Premajhno: pričakovano, da bo ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Neveljaven niz: mora se začeti z "${X.prefix}"`;if(X.format==="ends_with")return`Neveljaven niz: mora se končati z "${X.suffix}"`;if(X.format==="includes")return`Neveljaven niz: mora vsebovati "${X.includes}"`;if(X.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${X.pattern}`;return`Neveljaven ${b[X.format]??w.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${w.divisor}`;case"unrecognized_keys":return`Neprepoznan${w.keys.length>1?"i ključi":" ključ"}: ${L(w.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${w.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${w.origin}`;default:return"Neveljaven vnos"}}};function N7(){return{localeError:By()}}var Jy=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"antal";case"object":{if(Array.isArray(w))return"lista";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${w.expected}, fick ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ogiltig inmatning: förväntat ${j(w.values[0])}`;return`Ogiltigt val: förväntade en av ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`För stor(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.maximum.toString()} ${D.unit??"element"}`;return`För stor(t): förväntat ${w.origin??"värdet"} att ha ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`För lite(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.minimum.toString()} ${D.unit}`;return`För lite(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ogiltig sträng: måste börja med "${X.prefix}"`;if(X.format==="ends_with")return`Ogiltig sträng: måste sluta med "${X.suffix}"`;if(X.format==="includes")return`Ogiltig sträng: måste innehålla "${X.includes}"`;if(X.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${X.pattern}"`;return`Ogiltig(t) ${b[X.format]??w.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${w.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${w.origin??"värdet"}`;default:return"Ogiltig input"}}};function Y7(){return{localeError:Jy()}}var Hy=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(w))return"அணி";if(w===null)return"வெறுமை";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${w.expected}, பெறப்பட்டது ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${j(w.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${L(w.values,"|")} இல் ஒன்று`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${w.origin??"மதிப்பு"} ${X}${w.maximum.toString()} ${D.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${w.origin??"மதிப்பு"} ${X}${w.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${w.origin} ${X}${w.minimum.toString()} ${D.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${w.origin} ${X}${w.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`தவறான சரம்: "${X.prefix}" இல் தொடங்க வேண்டும்`;if(X.format==="ends_with")return`தவறான சரம்: "${X.suffix}" இல் முடிவடைய வேண்டும்`;if(X.format==="includes")return`தவறான சரம்: "${X.includes}" ஐ உள்ளடக்க வேண்டும்`;if(X.format==="regex")return`தவறான சரம்: ${X.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${b[X.format]??w.format}`}case"not_multiple_of":return`தவறான எண்: ${w.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${w.keys.length>1?"கள்":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${w.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function B7(){return{localeError:Hy()}}var Ay=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(w))return"อาร์เรย์ (Array)";if(w===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${w.expected} แต่ได้รับ ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${j(w.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"ไม่เกิน":"น้อยกว่า",D=I(w.origin);if(D)return`เกินกำหนด: ${w.origin??"ค่า"} ควรมี${X} ${w.maximum.toString()} ${D.unit??"รายการ"}`;return`เกินกำหนด: ${w.origin??"ค่า"} ควรมี${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"อย่างน้อย":"มากกว่า",D=I(w.origin);if(D)return`น้อยกว่ากำหนด: ${w.origin} ควรมี${X} ${w.minimum.toString()} ${D.unit}`;return`น้อยกว่ากำหนด: ${w.origin} ควรมี${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${X.prefix}"`;if(X.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${X.suffix}"`;if(X.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${X.includes}" อยู่ในข้อความ`;if(X.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${X.pattern}`;return`รูปแบบไม่ถูกต้อง: ${b[X.format]??w.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${w.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${L(w.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${w.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${w.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function J7(){return{localeError:Ay()}}var Oy=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},zy=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(b){return $[b]??null}let U={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(b)=>{switch(b.code){case"invalid_type":return`Geçersiz değer: beklenen ${b.expected}, alınan ${Oy(b.input)}`;case"invalid_value":if(b.values.length===1)return`Geçersiz değer: beklenen ${j(b.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Çok büyük: beklenen ${b.origin??"değer"} ${w}${b.maximum.toString()} ${X.unit??"öğe"}`;return`Çok büyük: beklenen ${b.origin??"değer"} ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Çok küçük: beklenen ${b.origin} ${w}${b.minimum.toString()} ${X.unit}`;return`Çok küçük: beklenen ${b.origin} ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Geçersiz metin: "${w.prefix}" ile başlamalı`;if(w.format==="ends_with")return`Geçersiz metin: "${w.suffix}" ile bitmeli`;if(w.format==="includes")return`Geçersiz metin: "${w.includes}" içermeli`;if(w.format==="regex")return`Geçersiz metin: ${w.pattern} desenine uymalı`;return`Geçersiz ${U[w.format]??b.format}`}case"not_multiple_of":return`Geçersiz sayı: ${b.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${b.keys.length>1?"lar":""}: ${L(b.keys,", ")}`;case"invalid_key":return`${b.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${b.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function H7(){return{localeError:zy()}}var Ly=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"число";case"object":{if(Array.isArray(w))return"масив";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${w.expected}, отримано ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Неправильні вхідні дані: очікується ${j(w.values[0])}`;return`Неправильна опція: очікується одне з ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Занадто велике: очікується, що ${w.origin??"значення"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"елементів"}`;return`Занадто велике: очікується, що ${w.origin??"значення"} буде ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Занадто мале: очікується, що ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Занадто мале: очікується, що ${w.origin} буде ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неправильний рядок: повинен починатися з "${X.prefix}"`;if(X.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${X.suffix}"`;if(X.format==="includes")return`Неправильний рядок: повинен містити "${X.includes}"`;if(X.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${X.pattern}`;return`Неправильний ${b[X.format]??w.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${w.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${w.keys.length>1?"і":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${w.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${w.origin}`;default:return"Неправильні вхідні дані"}}};function w0(){return{localeError:Ly()}}function A7(){return w0()}var Ky=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"نمبر";case"object":{if(Array.isArray(w))return"آرے";if(w===null)return"نل";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`غلط ان پٹ: ${w.expected} متوقع تھا، ${U(w.input)} موصول ہوا`;case"invalid_value":if(w.values.length===1)return`غلط ان پٹ: ${j(w.values[0])} متوقع تھا`;return`غلط آپشن: ${L(w.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`بہت بڑا: ${w.origin??"ویلیو"} کے ${X}${w.maximum.toString()} ${D.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${w.origin??"ویلیو"} کا ${X}${w.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`بہت چھوٹا: ${w.origin} کے ${X}${w.minimum.toString()} ${D.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${w.origin} کا ${X}${w.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`غلط سٹرنگ: "${X.prefix}" سے شروع ہونا چاہیے`;if(X.format==="ends_with")return`غلط سٹرنگ: "${X.suffix}" پر ختم ہونا چاہیے`;if(X.format==="includes")return`غلط سٹرنگ: "${X.includes}" شامل ہونا چاہیے`;if(X.format==="regex")return`غلط سٹرنگ: پیٹرن ${X.pattern} سے میچ ہونا چاہیے`;return`غلط ${b[X.format]??w.format}`}case"not_multiple_of":return`غلط نمبر: ${w.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${w.keys.length>1?"ز":""}: ${L(w.keys,"، ")}`;case"invalid_key":return`${w.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${w.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function O7(){return{localeError:Ky()}}var vy=()=>{let $={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 I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"số";case"object":{if(Array.isArray(w))return"mảng";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${w.expected}, nhận được ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${j(w.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Quá lớn: mong đợi ${w.origin??"giá trị"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"phần tử"}`;return`Quá lớn: mong đợi ${w.origin??"giá trị"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Quá nhỏ: mong đợi ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Quá nhỏ: mong đợi ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${X.prefix}"`;if(X.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${X.suffix}"`;if(X.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${X.includes}"`;if(X.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${X.pattern}`;return`${b[X.format]??w.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 ${w.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${L(w.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${w.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 ${w.origin}`;default:return"Đầu vào không hợp lệ"}}};function z7(){return{localeError:vy()}}var Vy=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(w))return"数组";if(w===null)return"空值(null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`无效输入:期望 ${w.expected},实际接收 ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`无效输入:期望 ${j(w.values[0])}`;return`无效选项:期望以下之一 ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`数值过大:期望 ${w.origin??"值"} ${X}${w.maximum.toString()} ${D.unit??"个元素"}`;return`数值过大:期望 ${w.origin??"值"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`数值过小:期望 ${w.origin} ${X}${w.minimum.toString()} ${D.unit}`;return`数值过小:期望 ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`无效字符串:必须以 "${X.prefix}" 开头`;if(X.format==="ends_with")return`无效字符串:必须以 "${X.suffix}" 结尾`;if(X.format==="includes")return`无效字符串:必须包含 "${X.includes}"`;if(X.format==="regex")return`无效字符串:必须满足正则表达式 ${X.pattern}`;return`无效${b[X.format]??w.format}`}case"not_multiple_of":return`无效数字:必须是 ${w.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${w.origin} 中包含无效值(value)`;default:return"无效输入"}}};function L7(){return{localeError:Vy()}}var qy=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={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(w)=>{switch(w.code){case"invalid_type":return`無效的輸入值:預期為 ${w.expected},但收到 ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`無效的輸入值:預期為 ${j(w.values[0])}`;return`無效的選項:預期為以下其中之一 ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`數值過大:預期 ${w.origin??"值"} 應為 ${X}${w.maximum.toString()} ${D.unit??"個元素"}`;return`數值過大:預期 ${w.origin??"值"} 應為 ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`數值過小:預期 ${w.origin} 應為 ${X}${w.minimum.toString()} ${D.unit}`;return`數值過小:預期 ${w.origin} 應為 ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`無效的字串:必須以 "${X.prefix}" 開頭`;if(X.format==="ends_with")return`無效的字串:必須以 "${X.suffix}" 結尾`;if(X.format==="includes")return`無效的字串:必須包含 "${X.includes}"`;if(X.format==="regex")return`無效的字串:必須符合格式 ${X.pattern}`;return`無效的 ${b[X.format]??w.format}`}case"not_multiple_of":return`無效的數字:必須為 ${w.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${w.keys.length>1?"們":""}:${L(w.keys,"、")}`;case"invalid_key":return`${w.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${w.origin} 中有無效的值`;default:return"無效的輸入值"}}};function K7(){return{localeError:qy()}}var Fy=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(w))return"akopọ";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(w)=>{switch(w.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${w.expected}, àmọ̀ a rí ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${j(w.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${w.origin??"iye"} ${D.verb} ${X}${w.maximum} ${D.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${X}${w.maximum}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Kéré ju: a ní láti jẹ́ pé ${w.origin} ${D.verb} ${X}${w.minimum} ${D.unit}`;return`Kéré ju: a ní láti jẹ́ ${X}${w.minimum}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${X.prefix}"`;if(X.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${X.suffix}"`;if(X.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${X.includes}"`;if(X.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${X.pattern}`;return`Aṣìṣe: ${b[X.format]??w.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${w.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${L(w.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${w.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${w.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function v7(){return{localeError:Fy()}}var Kq,V7=Symbol("ZodOutput"),q7=Symbol("ZodInput");class F7{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};delete U.id;let b={...U,...this._map.get($)};return Object.keys(b).length?b:void 0}return this._map.get($)}has($){return this._map.has($)}}function MX(){return new F7}(Kq=globalThis).__zod_globalRegistry??(Kq.__zod_globalRegistry=MX());var d$=globalThis.__zod_globalRegistry;function M7($,I){return new $({type:"string",...S(I)})}function j7($,I){return new $({type:"string",coerce:!0,...S(I)})}function jX($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...S(I)})}function X0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...S(I)})}function EX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...S(I)})}function SX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(I)})}function PX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(I)})}function kX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(I)})}function D0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...S(I)})}function RX($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...S(I)})}function TX($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(I)})}function _X($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...S(I)})}function ZX($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(I)})}function CX($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...S(I)})}function gX($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...S(I)})}function xX($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(I)})}function hX($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(I)})}function fX($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(I)})}function E7($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...S(I)})}function yX($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(I)})}function uX($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(I)})}function lX($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...S(I)})}function cX($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...S(I)})}function mX($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...S(I)})}function rX($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...S(I)})}var S7={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function P7($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(I)})}function k7($,I){return new $({type:"string",format:"date",check:"string_format",...S(I)})}function R7($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...S(I)})}function T7($,I){return new $({type:"string",format:"duration",check:"string_format",...S(I)})}function _7($,I){return new $({type:"number",checks:[],...S(I)})}function Z7($,I){return new $({type:"number",coerce:!0,checks:[],...S(I)})}function C7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...S(I)})}function g7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...S(I)})}function x7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...S(I)})}function h7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...S(I)})}function f7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...S(I)})}function y7($,I){return new $({type:"boolean",...S(I)})}function u7($,I){return new $({type:"boolean",coerce:!0,...S(I)})}function l7($,I){return new $({type:"bigint",...S(I)})}function c7($,I){return new $({type:"bigint",coerce:!0,...S(I)})}function m7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(I)})}function r7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(I)})}function n7($,I){return new $({type:"symbol",...S(I)})}function i7($,I){return new $({type:"undefined",...S(I)})}function o7($,I){return new $({type:"null",...S(I)})}function d7($){return new $({type:"any"})}function p7($){return new $({type:"unknown"})}function t7($,I){return new $({type:"never",...S(I)})}function a7($,I){return new $({type:"void",...S(I)})}function e7($,I){return new $({type:"date",...S(I)})}function s7($,I){return new $({type:"date",coerce:!0,...S(I)})}function $5($,I){return new $({type:"nan",...S(I)})}function r6($,I){return new JX({check:"less_than",...S(I),value:$,inclusive:!1})}function N6($,I){return new JX({check:"less_than",...S(I),value:$,inclusive:!0})}function n6($,I){return new HX({check:"greater_than",...S(I),value:$,inclusive:!1})}function p$($,I){return new HX({check:"greater_than",...S(I),value:$,inclusive:!0})}function nX($){return n6(0,$)}function iX($){return r6(0,$)}function oX($){return N6(0,$)}function dX($){return p$(0,$)}function Z4($,I){return new UN({check:"multiple_of",...S(I),value:$})}function W1($,I){return new XN({check:"max_size",...S(I),maximum:$})}function C4($,I){return new DN({check:"min_size",...S(I),minimum:$})}function e1($,I){return new WN({check:"size_equals",...S(I),size:$})}function Q1($,I){return new QN({check:"max_length",...S(I),maximum:$})}function b4($,I){return new GN({check:"min_length",...S(I),minimum:$})}function G1($,I){return new NN({check:"length_equals",...S(I),length:$})}function s1($,I){return new YN({check:"string_format",format:"regex",...S(I),pattern:$})}function $I($){return new BN({check:"string_format",format:"lowercase",...S($)})}function II($){return new JN({check:"string_format",format:"uppercase",...S($)})}function UI($,I){return new HN({check:"string_format",format:"includes",...S(I),includes:$})}function wI($,I){return new AN({check:"string_format",format:"starts_with",...S(I),prefix:$})}function bI($,I){return new ON({check:"string_format",format:"ends_with",...S(I),suffix:$})}function pX($,I,U){return new zN({check:"property",property:$,schema:I,...S(U)})}function XI($,I){return new LN({check:"mime_type",mime:$,...S(I)})}function Z6($){return new KN({check:"overwrite",tx:$})}function DI($){return Z6((I)=>I.normalize($))}function WI(){return Z6(($)=>$.trim())}function QI(){return Z6(($)=>$.toLowerCase())}function GI(){return Z6(($)=>$.toUpperCase())}function NI(){return Z6(($)=>OG($))}function I5($,I,U){return new $({type:"array",element:I,...S(U)})}function jy($,I,U){return new $({type:"union",options:I,...S(U)})}function Ey($,I,U){return new $({type:"union",options:I,inclusive:!1,...S(U)})}function Sy($,I,U,b){return new $({type:"union",options:U,discriminator:I,...S(b)})}function Py($,I,U){return new $({type:"intersection",left:I,right:U})}function ky($,I,U,b){let w=U instanceof o;return new $({type:"tuple",items:I,rest:w?U:null,...S(w?b:U)})}function Ry($,I,U,b){return new $({type:"record",keyType:I,valueType:U,...S(b)})}function Ty($,I,U,b){return new $({type:"map",keyType:I,valueType:U,...S(b)})}function _y($,I,U){return new $({type:"set",valueType:I,...S(U)})}function Zy($,I,U){let b=Array.isArray(I)?Object.fromEntries(I.map((w)=>[w,w])):I;return new $({type:"enum",entries:b,...S(U)})}function Cy($,I,U){return new $({type:"enum",entries:I,...S(U)})}function gy($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...S(U)})}function U5($,I){return new $({type:"file",...S(I)})}function xy($,I){return new $({type:"transform",transform:I})}function hy($,I){return new $({type:"optional",innerType:I})}function fy($,I){return new $({type:"nullable",innerType:I})}function yy($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():LG(U)}})}function uy($,I,U){return new $({type:"nonoptional",innerType:I,...S(U)})}function ly($,I){return new $({type:"success",innerType:I})}function cy($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function my($,I,U){return new $({type:"pipe",in:I,out:U})}function ry($,I){return new $({type:"readonly",innerType:I})}function ny($,I,U){return new $({type:"template_literal",parts:I,...S(U)})}function iy($,I){return new $({type:"lazy",getter:I})}function oy($,I){return new $({type:"promise",innerType:I})}function w5($,I,U){let b=S(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function b5($,I,U){return new $({type:"custom",check:"custom",fn:I,...S(U)})}function X5($){let I=vq((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(i1(b,U.value,I._zod.def));else{let w=b;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=I),w.continue??(w.continue=!I._zod.def.abort),U.issues.push(i1(w))}},$(U.value,U)});return I}function vq($,I){let U=new A$({check:"custom",...S(I)});return U._zod.check=$,U}function D5($){let I=new A$({check:"describe"});return I._zod.onattach=[(U)=>{let b=d$.get(U)??{};d$.add(U,{...b,description:$})}],I._zod.check=()=>{},I}function W5($){let I=new A$({check:"meta"});return I._zod.onattach=[(U)=>{let b=d$.get(U)??{};d$.add(U,{...b,...$})}],I._zod.check=()=>{},I}function Q5($,I){let U=S(I),b=U.truthy??["true","1","yes","on","y","enabled"],w=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")b=b.map((J)=>typeof J==="string"?J.toLowerCase():J),w=w.map((J)=>typeof J==="string"?J.toLowerCase():J);let X=new Set(b),D=new Set(w),W=$.Codec??eU,Q=$.Boolean??tU,N=new($.String??D1)({type:"string",error:U.error}),B=new Q({type:"boolean",error:U.error}),H=new W({type:"pipe",in:N,out:B,transform:(J,A)=>{let O=J;if(U.case!=="sensitive")O=O.toLowerCase();if(X.has(O))return!0;else if(D.has(O))return!1;else return A.issues.push({code:"invalid_value",expected:"stringbool",values:[...X,...D],input:A.value,inst:H,continue:!1}),{}},reverseTransform:(J,A)=>{if(J===!0)return b[0]||"true";else return w[0]||"false"},error:U.error});return H}function YI($,I,U,b={}){let w=S(b),X={...S(b),check:"string_format",type:"string",format:I,fn:typeof U==="function"?U:(W)=>U.test(W),...w};if(U instanceof RegExp)X.pattern=U;return new $(X)}function g4($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??d$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function G$($,I,U={path:[],schemaPath:[]}){var b;let w=$._zod.def,X=I.seen.get($);if(X){if(X.count++,U.schemaPath.includes($))X.cycle=U.path;return X.schema}let D={schema:{},count:1,cycle:void 0,path:U.path};I.seen.set($,D);let W=$._zod.toJSONSchema?.();if(W)D.schema=W;else{let N={...U,schemaPath:[...U.schemaPath,$],path:U.path},B=$._zod.parent;if(B)D.ref=B,G$(B,I,N),I.seen.get(B).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,D.schema,N);else{let H=D.schema,J=I.processors[w.type];if(!J)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${w.type}`);J($,I,H,N)}}let Q=I.metadataRegistry.get($);if(Q)Object.assign(D.schema,Q);if(I.io==="input"&&t$($))delete D.schema.examples,delete D.schema.default;if(I.io==="input"&&D.schema._prefault)(b=D.schema).default??(b.default=D.schema._prefault);return delete D.schema._prefault,I.seen.get($).schema}function x4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let b=(X)=>{let D=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let N=$.external.registry.get(X[0])?.id,B=$.external.uri??((J)=>J);if(N)return{ref:B(N)};let H=X[1].defId??X[1].schema.id??`schema${$.counter++}`;return X[1].defId=H,{defId:H,ref:`${B("__shared")}#/${D}/${H}`}}if(X[1]===U)return{ref:"#"};let Q=`${"#"}/${D}/`,G=X[1].schema.id??`__schema${$.counter++}`;return{defId:G,ref:Q+G}},w=(X)=>{if(X[1].schema.$ref)return;let D=X[1],{ref:W,defId:Q}=b(X);if(D.def={...D.schema},Q)D.defId=Q;let G=D.schema;for(let N in G)delete G[N];G.$ref=W};if($.cycles==="throw")for(let X of $.seen.entries()){let D=X[1];if(D.cycle)throw new Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
63
63
 
64
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of $.seen.entries()){let D=X[1];if(I===X[0]){w(X);continue}if($.external){let Q=$.external.registry.get(X[0])?.id;if(I!==X[0]&&Q){w(X);continue}}if($.metadataRegistry.get(X[0])?.id){w(X);continue}if(D.cycle){w(X);continue}if(D.count>1){if($.reused==="ref"){w(X);continue}}}}function h4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let b=(D)=>{let W=$.seen.get(D),Q=W.def??W.schema,G={...Q};if(W.ref===null)return;let N=W.ref;if(W.ref=null,N){b(N);let B=$.seen.get(N).schema;if(B.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))Q.allOf=Q.allOf??[],Q.allOf.push(B);else Object.assign(Q,B),Object.assign(Q,G)}if(!W.isParent)$.override({zodSchema:D,jsonSchema:Q,path:W.path??[]})};for(let D of[...$.seen.entries()].reverse())b(D[0]);let w={};if($.target==="draft-2020-12")w.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")w.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")w.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let D=$.external.registry.get(I)?.id;if(!D)throw new Error("Schema is missing an `id` property");w.$id=$.external.uri(D)}Object.assign(w,U.def??U.schema);let X=$.external?.defs??{};for(let D of $.seen.entries()){let W=D[1];if(W.def&&W.defId)X[W.defId]=W.def}if($.external);else if(Object.keys(X).length>0)if($.target==="draft-2020-12")w.$defs=X;else w.definitions=X;try{let D=JSON.parse(JSON.stringify(w));return Object.defineProperty(D,"~standard",{value:{...I["~standard"],jsonSchema:{input:BI(I,"input"),output:BI(I,"output")}},enumerable:!1,writable:!1}),D}catch(D){throw new Error("Error converting schema to JSON.")}}function t$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let b=$._zod.def;if(b.type==="transform")return!0;if(b.type==="array")return t$(b.element,U);if(b.type==="set")return t$(b.valueType,U);if(b.type==="lazy")return t$(b.getter(),U);if(b.type==="promise"||b.type==="optional"||b.type==="nonoptional"||b.type==="nullable"||b.type==="readonly"||b.type==="default"||b.type==="prefault")return t$(b.innerType,U);if(b.type==="intersection")return t$(b.left,U)||t$(b.right,U);if(b.type==="record"||b.type==="map")return t$(b.keyType,U)||t$(b.valueType,U);if(b.type==="pipe")return t$(b.in,U)||t$(b.out,U);if(b.type==="object"){for(let w in b.shape)if(t$(b.shape[w],U))return!0;return!1}if(b.type==="union"){for(let w of b.options)if(t$(w,U))return!0;return!1}if(b.type==="tuple"){for(let w of b.items)if(t$(w,U))return!0;if(b.rest&&t$(b.rest,U))return!0;return!1}return!1}var G5=($,I={})=>(U)=>{let b=g4({...U,processors:I});return G$($,b),x4(b,$),h4(b,$)},BI=($,I)=>(U)=>{let{libraryOptions:b,target:w}=U??{},X=g4({...b??{},target:w,io:I,processors:{}});return G$($,X),x4(X,$),h4(X,$)};var oy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},N5=($,I,U,b)=>{let w=U;w.type="string";let{minimum:X,maximum:D,format:W,patterns:Q,contentEncoding:G}=$._zod.bag;if(typeof X==="number")w.minLength=X;if(typeof D==="number")w.maxLength=D;if(W){if(w.format=oy[W]??W,w.format==="")delete w.format}if(G)w.contentEncoding=G;if(Q&&Q.size>0){let N=[...Q];if(N.length===1)w.pattern=N[0].source;else if(N.length>1)w.allOf=[...N.map((B)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:B.source}))]}},Y5=($,I,U,b)=>{let w=U,{minimum:X,maximum:D,format:W,multipleOf:Q,exclusiveMaximum:G,exclusiveMinimum:N}=$._zod.bag;if(typeof W==="string"&&W.includes("int"))w.type="integer";else w.type="number";if(typeof N==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.minimum=N,w.exclusiveMinimum=!0;else w.exclusiveMinimum=N;if(typeof X==="number"){if(w.minimum=X,typeof N==="number"&&I.target!=="draft-04")if(N>=X)delete w.minimum;else delete w.exclusiveMinimum}if(typeof G==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.maximum=G,w.exclusiveMaximum=!0;else w.exclusiveMaximum=G;if(typeof D==="number"){if(w.maximum=D,typeof G==="number"&&I.target!=="draft-04")if(G<=D)delete w.maximum;else delete w.exclusiveMaximum}if(typeof Q==="number")w.multipleOf=Q},B5=($,I,U,b)=>{U.type="boolean"},J5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},H5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},A5=($,I,U,b)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},O5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},z5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},L5=($,I,U,b)=>{U.not={}},K5=($,I,U,b)=>{},v5=($,I,U,b)=>{},V5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},q5=($,I,U,b)=>{let w=$._zod.def,X=uU(w.entries);if(X.every((D)=>typeof D==="number"))U.type="number";if(X.every((D)=>typeof D==="string"))U.type="string";U.enum=X},F5=($,I,U,b)=>{let w=$._zod.def,X=[];for(let D of w.values)if(D===void 0){if(I.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof D==="bigint")if(I.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else X.push(Number(D));else X.push(D);if(X.length===0);else if(X.length===1){let D=X[0];if(U.type=D===null?"null":typeof D,I.target==="draft-04"||I.target==="openapi-3.0")U.enum=[D];else U.const=D}else{if(X.every((D)=>typeof D==="number"))U.type="number";if(X.every((D)=>typeof D==="string"))U.type="string";if(X.every((D)=>typeof D==="boolean"))U.type="boolean";if(X.every((D)=>D===null))U.type="null";U.enum=X}},M5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},j5=($,I,U,b)=>{let w=U,X=$._zod.pattern;if(!X)throw new Error("Pattern not found in template literal");w.type="string",w.pattern=X.source},E5=($,I,U,b)=>{let w=U,X={type:"string",format:"binary",contentEncoding:"binary"},{minimum:D,maximum:W,mime:Q}=$._zod.bag;if(D!==void 0)X.minLength=D;if(W!==void 0)X.maxLength=W;if(Q)if(Q.length===1)X.contentMediaType=Q[0],Object.assign(w,X);else w.anyOf=Q.map((G)=>{return{...X,contentMediaType:G}});else Object.assign(w,X)},S5=($,I,U,b)=>{U.type="boolean"},P5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},k5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},R5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},T5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},_5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Z5=($,I,U,b)=>{let w=U,X=$._zod.def,{minimum:D,maximum:W}=$._zod.bag;if(typeof D==="number")w.minItems=D;if(typeof W==="number")w.maxItems=W;w.type="array",w.items=G$(X.element,I,{...b,path:[...b.path,"items"]})},C5=($,I,U,b)=>{let w=U,X=$._zod.def;w.type="object",w.properties={};let D=X.shape;for(let G in D)w.properties[G]=G$(D[G],I,{...b,path:[...b.path,"properties",G]});let W=new Set(Object.keys(D)),Q=new Set([...W].filter((G)=>{let N=X.shape[G]._zod;if(I.io==="input")return N.optin===void 0;else return N.optout===void 0}));if(Q.size>0)w.required=Array.from(Q);if(X.catchall?._zod.def.type==="never")w.additionalProperties=!1;else if(!X.catchall){if(I.io==="output")w.additionalProperties=!1}else if(X.catchall)w.additionalProperties=G$(X.catchall,I,{...b,path:[...b.path,"additionalProperties"]})},aX=($,I,U,b)=>{let w=$._zod.def,X=w.inclusive===!1,D=w.options.map((W,Q)=>G$(W,I,{...b,path:[...b.path,X?"oneOf":"anyOf",Q]}));if(X)U.oneOf=D;else U.anyOf=D},g5=($,I,U,b)=>{let w=$._zod.def,X=G$(w.left,I,{...b,path:[...b.path,"allOf",0]}),D=G$(w.right,I,{...b,path:[...b.path,"allOf",1]}),W=(G)=>("allOf"in G)&&Object.keys(G).length===1,Q=[...W(X)?X.allOf:[X],...W(D)?D.allOf:[D]];U.allOf=Q},x5=($,I,U,b)=>{let w=U,X=$._zod.def;w.type="array";let D=I.target==="draft-2020-12"?"prefixItems":"items",W=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",Q=X.items.map((H,J)=>G$(H,I,{...b,path:[...b.path,D,J]})),G=X.rest?G$(X.rest,I,{...b,path:[...b.path,W,...I.target==="openapi-3.0"?[X.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(w.prefixItems=Q,G)w.items=G}else if(I.target==="openapi-3.0"){if(w.items={anyOf:Q},G)w.items.anyOf.push(G);if(w.minItems=Q.length,!G)w.maxItems=Q.length}else if(w.items=Q,G)w.additionalItems=G;let{minimum:N,maximum:B}=$._zod.bag;if(typeof N==="number")w.minItems=N;if(typeof B==="number")w.maxItems=B},h5=($,I,U,b)=>{let w=U,X=$._zod.def;if(w.type="object",I.target==="draft-07"||I.target==="draft-2020-12")w.propertyNames=G$(X.keyType,I,{...b,path:[...b.path,"propertyNames"]});w.additionalProperties=G$(X.valueType,I,{...b,path:[...b.path,"additionalProperties"]})},f5=($,I,U,b)=>{let w=$._zod.def,X=G$(w.innerType,I,b),D=I.seen.get($);if(I.target==="openapi-3.0")D.ref=w.innerType,U.nullable=!0;else U.anyOf=[X,{type:"null"}]},y5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},u5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.default=JSON.parse(JSON.stringify(w.defaultValue))},l5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);if(X.ref=w.innerType,I.io==="input")U._prefault=JSON.parse(JSON.stringify(w.defaultValue))},c5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType;let D;try{D=w.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}U.default=D},m5=($,I,U,b)=>{let w=$._zod.def,X=I.io==="input"?w.in._zod.def.type==="transform"?w.out:w.in:w.out;G$(X,I,b);let D=I.seen.get($);D.ref=X},r5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.readOnly=!0},n5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},i5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},o5=($,I,U,b)=>{let w=$._zod.innerType;G$(w,I,b);let X=I.seen.get($);X.ref=w},tX={string:N5,number:Y5,boolean:B5,bigint:J5,symbol:H5,null:A5,undefined:O5,void:z5,never:L5,any:K5,unknown:v5,date:V5,enum:q5,literal:F5,nan:M5,template_literal:j5,file:E5,success:S5,custom:P5,function:k5,transform:R5,map:T5,set:_5,array:Z5,object:C5,union:aX,intersection:g5,tuple:x5,record:h5,nullable:f5,nonoptional:y5,default:u5,prefault:l5,catch:c5,pipe:m5,readonly:r5,promise:n5,optional:i5,lazy:o5};function eX($,I){if("_idmap"in $){let b=$,w=g4({...I,processors:tX}),X={};for(let Q of b._idmap.entries()){let[G,N]=Q;G$(N,w)}let D={},W={registry:b,uri:I?.uri,defs:X};w.external=W;for(let Q of b._idmap.entries()){let[G,N]=Q;x4(w,N),D[G]=h4(w,N)}if(Object.keys(X).length>0){let Q=w.target==="draft-2020-12"?"$defs":"definitions";D.__shared={[Q]:X}}return{schemas:D}}let U=g4({...I,processors:tX});return G$($,U),x4(U,$),h4(U,$)}class d5{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=g4({processors:tX,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return G$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}x4(this.ctx,$);let U=h4(this.ctx,$),{"~standard":b,...w}=U;return w}}var vq={};var W0={};v6(W0,{xor:()=>BF,xid:()=>gq,void:()=>DF,uuidv7:()=>Sq,uuidv6:()=>Eq,uuidv4:()=>jq,uuid:()=>Mq,url:()=>Pq,unknown:()=>N1,union:()=>jD,undefined:()=>bF,ulid:()=>Cq,uint64:()=>UF,uint32:()=>sq,tuple:()=>PB,transform:()=>SD,templateLiteral:()=>jF,symbol:()=>wF,superRefine:()=>sB,success:()=>qF,stringbool:()=>ZF,stringFormat:()=>iq,string:()=>bD,strictObject:()=>NF,set:()=>zF,refine:()=>eB,record:()=>kB,readonly:()=>iB,promise:()=>EF,preprocess:()=>gF,prefault:()=>yB,pipe:()=>Y0,partialRecord:()=>HF,optional:()=>G0,object:()=>GF,number:()=>BB,nullish:()=>VF,nullable:()=>N0,null:()=>zB,nonoptional:()=>uB,never:()=>MD,nativeEnum:()=>LF,nanoid:()=>Tq,nan:()=>FF,meta:()=>TF,map:()=>OF,mac:()=>fq,looseRecord:()=>AF,looseObject:()=>YF,literal:()=>KF,lazy:()=>pB,ksuid:()=>xq,keyof:()=>QF,jwt:()=>nq,json:()=>CF,ipv6:()=>yq,ipv4:()=>hq,intersection:()=>EB,int64:()=>IF,int32:()=>eq,int:()=>XD,instanceof:()=>_F,httpUrl:()=>kq,hostname:()=>oq,hex:()=>dq,hash:()=>pq,guid:()=>Fq,function:()=>SF,float64:()=>aq,float32:()=>tq,file:()=>vF,enum:()=>ED,emoji:()=>Rq,email:()=>qq,e164:()=>rq,discriminatedUnion:()=>JF,describe:()=>RF,date:()=>WF,custom:()=>kF,cuid2:()=>Zq,cuid:()=>_q,codec:()=>MF,cidrv6:()=>lq,cidrv4:()=>uq,check:()=>PF,catch:()=>mB,boolean:()=>JB,bigint:()=>$F,base64url:()=>mq,base64:()=>cq,array:()=>H0,any:()=>XF,_function:()=>SF,_default:()=>hB,_ZodString:()=>DD,ZodXor:()=>FB,ZodXID:()=>JD,ZodVoid:()=>VB,ZodUnknown:()=>KB,ZodUnion:()=>O0,ZodUndefined:()=>AB,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>BD,ZodType:()=>t,ZodTuple:()=>SB,ZodTransform:()=>CB,ZodTemplateLiteral:()=>oB,ZodSymbol:()=>HB,ZodSuccess:()=>lB,ZodStringFormat:()=>J$,ZodString:()=>AI,ZodSet:()=>TB,ZodRecord:()=>z0,ZodReadonly:()=>nB,ZodPromise:()=>tB,ZodPrefault:()=>fB,ZodPipe:()=>RD,ZodOptional:()=>PD,ZodObject:()=>A0,ZodNumberFormat:()=>Y1,ZodNumber:()=>zI,ZodNullable:()=>gB,ZodNull:()=>OB,ZodNonOptional:()=>kD,ZodNever:()=>vB,ZodNanoID:()=>GD,ZodNaN:()=>rB,ZodMap:()=>RB,ZodMAC:()=>YB,ZodLiteral:()=>_B,ZodLazy:()=>dB,ZodKSUID:()=>HD,ZodJWT:()=>qD,ZodIntersection:()=>jB,ZodIPv6:()=>OD,ZodIPv4:()=>AD,ZodGUID:()=>Q0,ZodFunction:()=>aB,ZodFile:()=>ZB,ZodEnum:()=>HI,ZodEmoji:()=>QD,ZodEmail:()=>WD,ZodE164:()=>VD,ZodDiscriminatedUnion:()=>MB,ZodDefault:()=>xB,ZodDate:()=>J0,ZodCustomStringFormat:()=>OI,ZodCustom:()=>L0,ZodCodec:()=>TD,ZodCatch:()=>cB,ZodCUID2:()=>YD,ZodCUID:()=>ND,ZodCIDRv6:()=>LD,ZodCIDRv4:()=>zD,ZodBoolean:()=>LI,ZodBigIntFormat:()=>FD,ZodBigInt:()=>KI,ZodBase64URL:()=>vD,ZodBase64:()=>KD,ZodArray:()=>qB,ZodAny:()=>LB});var sX={};v6(sX,{uppercase:()=>II,trim:()=>WI,toUpperCase:()=>GI,toLowerCase:()=>QI,startsWith:()=>wI,slugify:()=>NI,size:()=>e1,regex:()=>s1,property:()=>pX,positive:()=>nX,overwrite:()=>Z6,normalize:()=>DI,nonpositive:()=>oX,nonnegative:()=>dX,negative:()=>iX,multipleOf:()=>Z4,minSize:()=>C4,minLength:()=>b4,mime:()=>XI,maxSize:()=>W1,maxLength:()=>Q1,lte:()=>N6,lt:()=>r6,lowercase:()=>$I,length:()=>G1,includes:()=>UI,gte:()=>p$,gt:()=>n6,endsWith:()=>bI});var JI={};v6(JI,{time:()=>a5,duration:()=>e5,datetime:()=>p5,date:()=>t5,ZodISOTime:()=>UD,ZodISODuration:()=>wD,ZodISODateTime:()=>$D,ZodISODate:()=>ID});var $D=z("ZodISODateTime",($,I)=>{ZN.init($,I),J$.init($,I)});function p5($){return P7($D,$)}var ID=z("ZodISODate",($,I)=>{CN.init($,I),J$.init($,I)});function t5($){return k7(ID,$)}var UD=z("ZodISOTime",($,I)=>{gN.init($,I),J$.init($,I)});function a5($){return R7(UD,$)}var wD=z("ZodISODuration",($,I)=>{xN.init($,I),J$.init($,I)});function e5($){return T7(wD,$)}var Vq=($,I)=>{nU.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>oU($,U)},flatten:{value:(U)=>iU($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,r1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,r1,2)}},isEmpty:{get(){return $.issues.length===0}}})},py=z("ZodError",Vq),b6=z("ZodError",Vq,{Parent:Error});var s5=o1(b6),$B=d1(b6),IB=p1(b6),UB=t1(b6),wB=bX(b6),bB=XX(b6),XB=DX(b6),DB=WX(b6),WB=QX(b6),QB=GX(b6),GB=NX(b6),NB=YX(b6);var t=z("ZodType",($,I)=>{return o.init($,I),Object.assign($["~standard"],{jsonSchema:{input:BI($,"input"),output:BI($,"output")}}),$.toJSONSchema=G5($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(E.mergeDefs(I,{checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]}))},$.clone=(U,b)=>o$($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$},$.parse=(U,b)=>s5($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>IB($,U,b),$.parseAsync=async(U,b)=>$B($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>UB($,U,b),$.spa=$.safeParseAsync,$.encode=(U,b)=>wB($,U,b),$.decode=(U,b)=>bB($,U,b),$.encodeAsync=async(U,b)=>XB($,U,b),$.decodeAsync=async(U,b)=>DB($,U,b),$.safeEncode=(U,b)=>WB($,U,b),$.safeDecode=(U,b)=>QB($,U,b),$.safeEncodeAsync=async(U,b)=>GB($,U,b),$.safeDecodeAsync=async(U,b)=>NB($,U,b),$.refine=(U,b)=>$.check(eB(U,b)),$.superRefine=(U)=>$.check(sB(U)),$.overwrite=(U)=>$.check(Z6(U)),$.optional=()=>G0($),$.nullable=()=>N0($),$.nullish=()=>G0(N0($)),$.nonoptional=(U)=>uB($,U),$.array=()=>H0($),$.or=(U)=>jD([$,U]),$.and=(U)=>EB($,U),$.transform=(U)=>Y0($,SD(U)),$.default=(U)=>hB($,U),$.prefault=(U)=>yB($,U),$.catch=(U)=>mB($,U),$.pipe=(U)=>Y0($,U),$.readonly=()=>iB($),$.describe=(U)=>{let b=$.clone();return d$.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return d$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return d$.get($);let b=$.clone();return d$.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),DD=z("_ZodString",($,I)=>{D1.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>N5($,b,w,X);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(s1(...b)),$.includes=(...b)=>$.check(UI(...b)),$.startsWith=(...b)=>$.check(wI(...b)),$.endsWith=(...b)=>$.check(bI(...b)),$.min=(...b)=>$.check(b4(...b)),$.max=(...b)=>$.check(Q1(...b)),$.length=(...b)=>$.check(G1(...b)),$.nonempty=(...b)=>$.check(b4(1,...b)),$.lowercase=(b)=>$.check($I(b)),$.uppercase=(b)=>$.check(II(b)),$.trim=()=>$.check(WI()),$.normalize=(...b)=>$.check(DI(...b)),$.toLowerCase=()=>$.check(QI()),$.toUpperCase=()=>$.check(GI()),$.slugify=()=>$.check(NI())}),AI=z("ZodString",($,I)=>{D1.init($,I),DD.init($,I),$.email=(U)=>$.check(jX(WD,U)),$.url=(U)=>$.check(D0(B0,U)),$.jwt=(U)=>$.check(rX(qD,U)),$.emoji=(U)=>$.check(RX(QD,U)),$.guid=(U)=>$.check(X0(Q0,U)),$.uuid=(U)=>$.check(EX(i6,U)),$.uuidv4=(U)=>$.check(SX(i6,U)),$.uuidv6=(U)=>$.check(PX(i6,U)),$.uuidv7=(U)=>$.check(kX(i6,U)),$.nanoid=(U)=>$.check(TX(GD,U)),$.guid=(U)=>$.check(X0(Q0,U)),$.cuid=(U)=>$.check(_X(ND,U)),$.cuid2=(U)=>$.check(ZX(YD,U)),$.ulid=(U)=>$.check(CX(BD,U)),$.base64=(U)=>$.check(lX(KD,U)),$.base64url=(U)=>$.check(cX(vD,U)),$.xid=(U)=>$.check(gX(JD,U)),$.ksuid=(U)=>$.check(xX(HD,U)),$.ipv4=(U)=>$.check(hX(AD,U)),$.ipv6=(U)=>$.check(fX(OD,U)),$.cidrv4=(U)=>$.check(yX(zD,U)),$.cidrv6=(U)=>$.check(uX(LD,U)),$.e164=(U)=>$.check(mX(VD,U)),$.datetime=(U)=>$.check(p5(U)),$.date=(U)=>$.check(t5(U)),$.time=(U)=>$.check(a5(U)),$.duration=(U)=>$.check(e5(U))});function bD($){return M7(AI,$)}var J$=z("ZodStringFormat",($,I)=>{B$.init($,I),DD.init($,I)}),WD=z("ZodEmail",($,I)=>{MN.init($,I),J$.init($,I)});function qq($){return jX(WD,$)}var Q0=z("ZodGUID",($,I)=>{qN.init($,I),J$.init($,I)});function Fq($){return X0(Q0,$)}var i6=z("ZodUUID",($,I)=>{FN.init($,I),J$.init($,I)});function Mq($){return EX(i6,$)}function jq($){return SX(i6,$)}function Eq($){return PX(i6,$)}function Sq($){return kX(i6,$)}var B0=z("ZodURL",($,I)=>{jN.init($,I),J$.init($,I)});function Pq($){return D0(B0,$)}function kq($){return D0(B0,{protocol:/^https?$/,hostname:K6.domain,...E.normalizeParams($)})}var QD=z("ZodEmoji",($,I)=>{EN.init($,I),J$.init($,I)});function Rq($){return RX(QD,$)}var GD=z("ZodNanoID",($,I)=>{SN.init($,I),J$.init($,I)});function Tq($){return TX(GD,$)}var ND=z("ZodCUID",($,I)=>{PN.init($,I),J$.init($,I)});function _q($){return _X(ND,$)}var YD=z("ZodCUID2",($,I)=>{kN.init($,I),J$.init($,I)});function Zq($){return ZX(YD,$)}var BD=z("ZodULID",($,I)=>{RN.init($,I),J$.init($,I)});function Cq($){return CX(BD,$)}var JD=z("ZodXID",($,I)=>{TN.init($,I),J$.init($,I)});function gq($){return gX(JD,$)}var HD=z("ZodKSUID",($,I)=>{_N.init($,I),J$.init($,I)});function xq($){return xX(HD,$)}var AD=z("ZodIPv4",($,I)=>{hN.init($,I),J$.init($,I)});function hq($){return hX(AD,$)}var YB=z("ZodMAC",($,I)=>{yN.init($,I),J$.init($,I)});function fq($){return E7(YB,$)}var OD=z("ZodIPv6",($,I)=>{fN.init($,I),J$.init($,I)});function yq($){return fX(OD,$)}var zD=z("ZodCIDRv4",($,I)=>{uN.init($,I),J$.init($,I)});function uq($){return yX(zD,$)}var LD=z("ZodCIDRv6",($,I)=>{lN.init($,I),J$.init($,I)});function lq($){return uX(LD,$)}var KD=z("ZodBase64",($,I)=>{mN.init($,I),J$.init($,I)});function cq($){return lX(KD,$)}var vD=z("ZodBase64URL",($,I)=>{rN.init($,I),J$.init($,I)});function mq($){return cX(vD,$)}var VD=z("ZodE164",($,I)=>{nN.init($,I),J$.init($,I)});function rq($){return mX(VD,$)}var qD=z("ZodJWT",($,I)=>{iN.init($,I),J$.init($,I)});function nq($){return rX(qD,$)}var OI=z("ZodCustomStringFormat",($,I)=>{oN.init($,I),J$.init($,I)});function iq($,I,U={}){return YI(OI,$,I,U)}function oq($){return YI(OI,"hostname",K6.hostname,$)}function dq($){return YI(OI,"hex",K6.hex,$)}function pq($,I){let U=I?.enc??"hex",b=`${$}_${U}`,w=K6[b];if(!w)throw new Error(`Unrecognized hash format: ${b}`);return YI(OI,b,w,I)}var zI=z("ZodNumber",($,I)=>{VX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>Y5($,b,w,X),$.gt=(b,w)=>$.check(n6(b,w)),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.lt=(b,w)=>$.check(r6(b,w)),$.lte=(b,w)=>$.check(N6(b,w)),$.max=(b,w)=>$.check(N6(b,w)),$.int=(b)=>$.check(XD(b)),$.safe=(b)=>$.check(XD(b)),$.positive=(b)=>$.check(n6(0,b)),$.nonnegative=(b)=>$.check(p$(0,b)),$.negative=(b)=>$.check(r6(0,b)),$.nonpositive=(b)=>$.check(N6(0,b)),$.multipleOf=(b,w)=>$.check(Z4(b,w)),$.step=(b,w)=>$.check(Z4(b,w)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function BB($){return _7(zI,$)}var Y1=z("ZodNumberFormat",($,I)=>{dN.init($,I),zI.init($,I)});function XD($){return C7(Y1,$)}function tq($){return g7(Y1,$)}function aq($){return x7(Y1,$)}function eq($){return h7(Y1,$)}function sq($){return f7(Y1,$)}var LI=z("ZodBoolean",($,I)=>{tU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>B5($,U,b,w)});function JB($){return y7(LI,$)}var KI=z("ZodBigInt",($,I)=>{qX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>J5($,b,w,X),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.gt=(b,w)=>$.check(n6(b,w)),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.lt=(b,w)=>$.check(r6(b,w)),$.lte=(b,w)=>$.check(N6(b,w)),$.max=(b,w)=>$.check(N6(b,w)),$.positive=(b)=>$.check(n6(BigInt(0),b)),$.negative=(b)=>$.check(r6(BigInt(0),b)),$.nonpositive=(b)=>$.check(N6(BigInt(0),b)),$.nonnegative=(b)=>$.check(p$(BigInt(0),b)),$.multipleOf=(b,w)=>$.check(Z4(b,w));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function $F($){return l7(KI,$)}var FD=z("ZodBigIntFormat",($,I)=>{pN.init($,I),KI.init($,I)});function IF($){return m7(FD,$)}function UF($){return r7(FD,$)}var HB=z("ZodSymbol",($,I)=>{tN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>H5($,U,b,w)});function wF($){return n7(HB,$)}var AB=z("ZodUndefined",($,I)=>{aN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>O5($,U,b,w)});function bF($){return i7(AB,$)}var OB=z("ZodNull",($,I)=>{eN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>A5($,U,b,w)});function zB($){return o7(OB,$)}var LB=z("ZodAny",($,I)=>{sN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>K5($,U,b,w)});function XF(){return d7(LB)}var KB=z("ZodUnknown",($,I)=>{$Y.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>v5($,U,b,w)});function N1(){return p7(KB)}var vB=z("ZodNever",($,I)=>{IY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>L5($,U,b,w)});function MD($){return t7(vB,$)}var VB=z("ZodVoid",($,I)=>{UY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>z5($,U,b,w)});function DF($){return a7(VB,$)}var J0=z("ZodDate",($,I)=>{wY.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>V5($,b,w,X),$.min=(b,w)=>$.check(p$(b,w)),$.max=(b,w)=>$.check(N6(b,w));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function WF($){return e7(J0,$)}var qB=z("ZodArray",($,I)=>{bY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>Z5($,U,b,w),$.element=I.element,$.min=(U,b)=>$.check(b4(U,b)),$.nonempty=(U)=>$.check(b4(1,U)),$.max=(U,b)=>$.check(Q1(U,b)),$.length=(U,b)=>$.check(G1(U,b)),$.unwrap=()=>$.element});function H0($,I){return I5(qB,$,I)}function QF($){let I=$._zod.def.shape;return ED(Object.keys(I))}var A0=z("ZodObject",($,I)=>{XY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>C5($,U,b,w),E.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>ED(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:N1()}),$.loose=()=>$.clone({...$._zod.def,catchall:N1()}),$.strict=()=>$.clone({...$._zod.def,catchall:MD()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return E.extend($,U)},$.safeExtend=(U)=>{return E.safeExtend($,U)},$.merge=(U)=>E.merge($,U),$.pick=(U)=>E.pick($,U),$.omit=(U)=>E.omit($,U),$.partial=(...U)=>E.partial(PD,$,U[0]),$.required=(...U)=>E.required(kD,$,U[0])});function GF($,I){let U={type:"object",shape:$??{},...E.normalizeParams(I)};return new A0(U)}function NF($,I){return new A0({type:"object",shape:$,catchall:MD(),...E.normalizeParams(I)})}function YF($,I){return new A0({type:"object",shape:$,catchall:N1(),...E.normalizeParams(I)})}var O0=z("ZodUnion",($,I)=>{aU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>aX($,U,b,w),$.options=I.options});function jD($,I){return new O0({type:"union",options:$,...E.normalizeParams(I)})}var FB=z("ZodXor",($,I)=>{O0.init($,I),DY.init($,I),$._zod.processJSONSchema=(U,b,w)=>aX($,U,b,w),$.options=I.options});function BF($,I){return new FB({type:"union",options:$,inclusive:!1,...E.normalizeParams(I)})}var MB=z("ZodDiscriminatedUnion",($,I)=>{O0.init($,I),WY.init($,I)});function JF($,I,U){return new MB({type:"union",options:I,discriminator:$,...E.normalizeParams(U)})}var jB=z("ZodIntersection",($,I)=>{QY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>g5($,U,b,w)});function EB($,I){return new jB({type:"intersection",left:$,right:I})}var SB=z("ZodTuple",($,I)=>{FX.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>x5($,U,b,w),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function PB($,I,U){let b=I instanceof o,w=b?U:I;return new SB({type:"tuple",items:$,rest:b?I:null,...E.normalizeParams(w)})}var z0=z("ZodRecord",($,I)=>{GY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>h5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function kB($,I,U){return new z0({type:"record",keyType:$,valueType:I,...E.normalizeParams(U)})}function HF($,I,U){let b=o$($);return b._zod.values=void 0,new z0({type:"record",keyType:b,valueType:I,...E.normalizeParams(U)})}function AF($,I,U){return new z0({type:"record",keyType:$,valueType:I,mode:"loose",...E.normalizeParams(U)})}var RB=z("ZodMap",($,I)=>{NY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>T5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function OF($,I,U){return new RB({type:"map",keyType:$,valueType:I,...E.normalizeParams(U)})}var TB=z("ZodSet",($,I)=>{YY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>_5($,U,b,w),$.min=(...U)=>$.check(C4(...U)),$.nonempty=(U)=>$.check(C4(1,U)),$.max=(...U)=>$.check(W1(...U)),$.size=(...U)=>$.check(e1(...U))});function zF($,I){return new TB({type:"set",valueType:$,...E.normalizeParams(I)})}var HI=z("ZodEnum",($,I)=>{BY.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>q5($,b,w,X),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(b,w)=>{let X={};for(let D of b)if(U.has(D))X[D]=I.entries[D];else throw new Error(`Key ${D} not found in enum`);return new HI({...I,checks:[],...E.normalizeParams(w),entries:X})},$.exclude=(b,w)=>{let X={...I.entries};for(let D of b)if(U.has(D))delete X[D];else throw new Error(`Key ${D} not found in enum`);return new HI({...I,checks:[],...E.normalizeParams(w),entries:X})}});function ED($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new HI({type:"enum",entries:U,...E.normalizeParams(I)})}function LF($,I){return new HI({type:"enum",entries:$,...E.normalizeParams(I)})}var _B=z("ZodLiteral",($,I)=>{JY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>F5($,U,b,w),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function KF($,I){return new _B({type:"literal",values:Array.isArray($)?$:[$],...E.normalizeParams(I)})}var ZB=z("ZodFile",($,I)=>{HY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>E5($,U,b,w),$.min=(U,b)=>$.check(C4(U,b)),$.max=(U,b)=>$.check(W1(U,b)),$.mime=(U,b)=>$.check(XI(Array.isArray(U)?U:[U],b))});function vF($){return U5(ZB,$)}var CB=z("ZodTransform",($,I)=>{AY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>R5($,U,b,w),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1($.constructor.name);U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(E.issue(X,U.value,I));else{let D=X;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=$),U.issues.push(E.issue(D))}};let w=I.transform(U.value,U);if(w instanceof Promise)return w.then((X)=>{return U.value=X,U});return U.value=w,U}});function SD($){return new CB({type:"transform",transform:$})}var PD=z("ZodOptional",($,I)=>{OY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>i5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function G0($){return new PD({type:"optional",innerType:$})}var gB=z("ZodNullable",($,I)=>{zY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>f5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function N0($){return new gB({type:"nullable",innerType:$})}function VF($){return G0(N0($))}var xB=z("ZodDefault",($,I)=>{LY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>u5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function hB($,I){return new xB({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var fB=z("ZodPrefault",($,I)=>{KY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>l5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function yB($,I){return new fB({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var kD=z("ZodNonOptional",($,I)=>{vY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>y5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function uB($,I){return new kD({type:"nonoptional",innerType:$,...E.normalizeParams(I)})}var lB=z("ZodSuccess",($,I)=>{VY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>S5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function qF($){return new lB({type:"success",innerType:$})}var cB=z("ZodCatch",($,I)=>{qY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>c5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function mB($,I){return new cB({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var rB=z("ZodNaN",($,I)=>{FY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>M5($,U,b,w)});function FF($){return $5(rB,$)}var RD=z("ZodPipe",($,I)=>{MY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>m5($,U,b,w),$.in=I.in,$.out=I.out});function Y0($,I){return new RD({type:"pipe",in:$,out:I})}var TD=z("ZodCodec",($,I)=>{RD.init($,I),eU.init($,I)});function MF($,I,U){return new TD({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var nB=z("ZodReadonly",($,I)=>{jY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>r5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function iB($){return new nB({type:"readonly",innerType:$})}var oB=z("ZodTemplateLiteral",($,I)=>{EY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>j5($,U,b,w)});function jF($,I){return new oB({type:"template_literal",parts:$,...E.normalizeParams(I)})}var dB=z("ZodLazy",($,I)=>{kY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>o5($,U,b,w),$.unwrap=()=>$._zod.def.getter()});function pB($){return new dB({type:"lazy",getter:$})}var tB=z("ZodPromise",($,I)=>{PY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>n5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function EF($){return new tB({type:"promise",innerType:$})}var aB=z("ZodFunction",($,I)=>{SY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>k5($,U,b,w)});function SF($){return new aB({type:"function",input:Array.isArray($?.input)?PB($?.input):$?.input??H0(N1()),output:$?.output??N1()})}var L0=z("ZodCustom",($,I)=>{RY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>P5($,U,b,w)});function PF($){let I=new A$({check:"custom"});return I._zod.check=$,I}function kF($,I){return w5(L0,$??(()=>!0),I)}function eB($,I={}){return b5(L0,$,I)}function sB($){return X5($)}var RF=D5,TF=W5;function _F($,I={error:`Input not instance of ${$.name}`}){let U=new L0({type:"custom",check:"custom",fn:(b)=>b instanceof $,abort:!0,...E.normalizeParams(I)});return U._zod.bag.Class=$,U}var ZF=(...$)=>Q5({Codec:TD,Boolean:LI,String:AI},...$);function CF($){let I=pB(()=>{return jD([bD($),BB(),JB(),zB(),H0(I),kB(bD(),I)])});return I}function gF($,I){return Y0(SD($),I)}var ay={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 ey($){P$({customError:$})}function sy(){return P$().customError}var $J;(function($){})($J||($J={}));var _={...W0,...sX,iso:JI};function $u($,I){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function Iu($,I){if(!$.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return I.rootSchema;let b=I.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===b){let w=U[1];if(!w||!I.defs[w])throw new Error(`Reference not found: ${$}`);return I.defs[w]}throw new Error(`Reference not found: ${$}`)}function xF($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return _.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let w=$.$ref;if(I.refs.has(w))return I.refs.get(w);if(I.processing.has(w))return _.lazy(()=>{if(!I.refs.has(w))throw new Error(`Circular reference not resolved: ${w}`);return I.refs.get(w)});I.processing.add(w);let X=Iu(w,I),D=u$(X,I);return I.refs.set(w,D),I.processing.delete(w),D}if($.enum!==void 0){let w=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&w.length===1&&w[0]===null)return _.null();if(w.length===0)return _.never();if(w.length===1)return _.literal(w[0]);if(w.every((D)=>typeof D==="string"))return _.enum(w);let X=w.map((D)=>_.literal(D));if(X.length<2)return X[0];return _.union([X[0],X[1],...X.slice(2)])}if($.const!==void 0)return _.literal($.const);let U=$.type;if(Array.isArray(U)){let w=U.map((X)=>{let D={...$,type:X};return xF(D,I)});if(w.length===0)return _.never();if(w.length===1)return w[0];return _.union(w)}if(!U)return _.any();let b;switch(U){case"string":{let w=_.string();if($.format){let X=$.format;if(X==="email")w=w.check(_.email());else if(X==="uri"||X==="uri-reference")w=w.check(_.url());else if(X==="uuid"||X==="guid")w=w.check(_.uuid());else if(X==="date-time")w=w.check(_.iso.datetime());else if(X==="date")w=w.check(_.iso.date());else if(X==="time")w=w.check(_.iso.time());else if(X==="duration")w=w.check(_.iso.duration());else if(X==="ipv4")w=w.check(_.ipv4());else if(X==="ipv6")w=w.check(_.ipv6());else if(X==="mac")w=w.check(_.mac());else if(X==="cidr")w=w.check(_.cidrv4());else if(X==="cidr-v6")w=w.check(_.cidrv6());else if(X==="base64")w=w.check(_.base64());else if(X==="base64url")w=w.check(_.base64url());else if(X==="e164")w=w.check(_.e164());else if(X==="jwt")w=w.check(_.jwt());else if(X==="emoji")w=w.check(_.emoji());else if(X==="nanoid")w=w.check(_.nanoid());else if(X==="cuid")w=w.check(_.cuid());else if(X==="cuid2")w=w.check(_.cuid2());else if(X==="ulid")w=w.check(_.ulid());else if(X==="xid")w=w.check(_.xid());else if(X==="ksuid")w=w.check(_.ksuid())}if(typeof $.minLength==="number")w=w.min($.minLength);if(typeof $.maxLength==="number")w=w.max($.maxLength);if($.pattern)w=w.regex(new RegExp($.pattern));b=w;break}case"number":case"integer":{let w=U==="integer"?_.number().int():_.number();if(typeof $.minimum==="number")w=w.min($.minimum);if(typeof $.maximum==="number")w=w.max($.maximum);if(typeof $.exclusiveMinimum==="number")w=w.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")w=w.gt($.minimum);if(typeof $.exclusiveMaximum==="number")w=w.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")w=w.lt($.maximum);if(typeof $.multipleOf==="number")w=w.multipleOf($.multipleOf);b=w;break}case"boolean":{b=_.boolean();break}case"null":{b=_.null();break}case"object":{let w={},X=$.properties||{},D=new Set($.required||[]);for(let[Q,G]of Object.entries(X)){let N=u$(G,I);w[Q]=D.has(Q)?N:N.optional()}if($.propertyNames){let Q=u$($.propertyNames,I),G=$.additionalProperties&&typeof $.additionalProperties==="object"?u$($.additionalProperties,I):_.any();if(Object.keys(w).length===0){b=_.record(Q,G);break}let N=_.object(w).passthrough(),B=_.looseRecord(Q,G);b=_.intersection(N,B);break}if($.patternProperties){let Q=$.patternProperties,G=Object.keys(Q),N=[];for(let H of G){let J=u$(Q[H],I),A=_.string().regex(new RegExp(H));N.push(_.looseRecord(A,J))}let B=[];if(Object.keys(w).length>0)B.push(_.object(w).passthrough());if(B.push(...N),B.length===0)b=_.object({}).passthrough();else if(B.length===1)b=B[0];else{let H=_.intersection(B[0],B[1]);for(let J=2;J<B.length;J++)H=_.intersection(H,B[J]);b=H}break}let W=_.object(w);if($.additionalProperties===!1)b=W.strict();else if(typeof $.additionalProperties==="object")b=W.catchall(u$($.additionalProperties,I));else b=W.passthrough();break}case"array":{let{prefixItems:w,items:X}=$;if(w&&Array.isArray(w)){let D=w.map((Q)=>u$(Q,I)),W=X&&typeof X==="object"&&!Array.isArray(X)?u$(X,I):void 0;if(W)b=_.tuple(D).rest(W);else b=_.tuple(D);if(typeof $.minItems==="number")b=b.check(_.minLength($.minItems));if(typeof $.maxItems==="number")b=b.check(_.maxLength($.maxItems))}else if(Array.isArray(X)){let D=X.map((Q)=>u$(Q,I)),W=$.additionalItems&&typeof $.additionalItems==="object"?u$($.additionalItems,I):void 0;if(W)b=_.tuple(D).rest(W);else b=_.tuple(D);if(typeof $.minItems==="number")b=b.check(_.minLength($.minItems));if(typeof $.maxItems==="number")b=b.check(_.maxLength($.maxItems))}else if(X!==void 0){let D=u$(X,I),W=_.array(D);if(typeof $.minItems==="number")W=W.min($.minItems);if(typeof $.maxItems==="number")W=W.max($.maxItems);b=W}else b=_.array(_.any());break}default:throw new Error(`Unsupported type: ${U}`)}if($.description)b=b.describe($.description);if($.default!==void 0)b=b.default($.default);return b}function u$($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=xF($,I),b=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let w=$.anyOf.map((D)=>u$(D,I)),X=_.union(w);U=b?_.intersection(U,X):X}if($.oneOf&&Array.isArray($.oneOf)){let w=$.oneOf.map((D)=>u$(D,I)),X=_.xor(w);U=b?_.intersection(U,X):X}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=b?U:_.any();else{let w=b?U:u$($.allOf[0],I),X=b?0:1;for(let D=X;D<$.allOf.length;D++)w=_.intersection(w,u$($.allOf[D],I));U=w}if($.nullable===!0&&I.version==="openapi-3.0")U=_.nullable(U);if($.readOnly===!0)U=_.readonly(U);return U}function hF($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=$u($,I?.defaultTarget),b=$.$defs||$.definitions||{};return u$($,{version:U,defs:b,refs:new Map,processing:new Set,rootSchema:$})}var IJ={};v6(IJ,{string:()=>Uu,number:()=>wu,date:()=>Du,boolean:()=>bu,bigint:()=>Xu});function Uu($){return j7(AI,$)}function wu($){return Z7(zI,$)}function bu($){return u7(LI,$)}function Xu($){return c7(KI,$)}function Du($){return s7(J0,$)}P$(sU());var D4=Y.enum(["document","record"]),_D=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],ZD=["literature","document","record","annotation","artifact"],CD=["molecule","reaction"],vI=50,gD=50;var UJ=Y.object({blockType:Y.enum(_D).default("paragraph").describe("Type of block to create. Default: paragraph"),content:Y.string().describe("Text content for the block"),headingLevel:Y.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:Y.boolean().optional().describe("Checked state for checkListItem"),title:Y.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:Y.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:Y.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:Y.enum(ZD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:Y.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:Y.string().optional().describe("Cached title of the linked entity"),doi:Y.string().optional().describe("DOI for literature references"),smiles:Y.string().optional().describe('SMILES string (e.g., "CCO" for ethanol, "CC(=O)C.N>>CC(N)C.O" for reactions). Required for molecule blocks.'),structureType:Y.enum(CD).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:Y.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:Y.string().optional().describe("Optional description or notes for the molecule block"),matrixId:Y.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:Y.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:Y.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:Y.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:Y.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it.")});var Wu=Y.enum(["text","number","unit","select","boolean"]),Qu=Y.enum(["mandatory","recommended","optional"]),fF=Y.object({key:Y.string().min(1).describe("Stable column key"),label:Y.string().min(1).describe("Human-readable column label"),type:Wu.describe("Column type"),unit:Y.string().optional().describe("Optional display unit"),mandation:Qu.describe("Field importance level"),description:Y.string().optional().describe("Optional field description"),standardRef:Y.string().optional().describe("Optional ontology reference"),options:Y.array(Y.string()).optional().describe("Allowed values for select columns"),hidden:Y.boolean().optional().describe("UI-hidden column. Still surfaced to agents in matrix TOON (with a `hidden` marker in the cols legend) and preserved across row mutations. Use for preset-internal linkage (e.g. stoichiometry `compoundId`).")}),VI=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])),yF=Y.enum(["generic","stoichiometry"]),wJ=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),kind:yF.optional().describe('Typed preset. Defaults to "generic". Use "stoichiometry" for reaction stoichiometry matrices (client-side calc engine derives m/V/n from M/ρ/equiv). When "stoichiometry", `columns` is ignored — the server fills in the stoichiometry preset.'),label:Y.string().min(1).describe("Matrix label shown in the editor"),columns:Y.array(fF).max(vI).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:Y.array(VI).optional().describe("Matrix rows"),nodeRef:Y.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:Y.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:Y.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:Y.string().optional().describe("Insert as CHILD of this container block"),childPosition:Y.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:Y.boolean().optional().default(!0).describe("Whether the structured matrix block should show its preview")}).refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{if($.kind==="stoichiometry")return!0;return($.columns?.length??0)>=1},{message:'`columns` is required for `kind="generic"` (omit or use `kind="stoichiometry"` for the preset).',path:["columns"]}),K0={name:"insert_matrix",description:"Create a structured data matrix AND insert its linked `structuredMatrix` block in one call.\n\nThe tool performs two writes atomically from the agent's perspective:\n1. Insert a new `data_matrices` row (columns + rows + label). The row starts at `version: 0`; all subsequent edits go through the `*_matrix_rows` / `rebind_matrix_to_node` / `delete_matrix` tools and each bumps `version`.\n2. Insert a `structuredMatrix` block referencing the new matrix id.\n\nTwo binding modes (both valid for records and documents):\n- **Body-level (default)**: omit `nodeRef`. The matrix belongs to the entity and the block lives at the top-level of the document/record body. Use this for free-standing tabular data (reagent inventory, condition sets attached to the whole experiment, etc).\n- **Node-attached**: pass `nodeRef` = procedure node UUID (records only). The matrix is logically scoped to that node and surfaces in `list_procedure_nodes` under that node's `matrixCount`. Use this when the matrix captures data produced inside a specific procedure step (e.g. readings per screening condition).\n\n**Typed presets via `kind`:**\n- `kind=\"generic\"` (default): supply your own `columns`.\n- `kind=\"stoichiometry\"`: choose this whenever you want reaction stoichiometry semantics — mixing reactants, reagents, solvents, catalysts, products and deriving the missing quantities. `columns` is ignored; the server fills the stoichiometry preset (Compound, Role, Phase, Equiv, Limiting, M, ρ, Purity, Stock c, Stock wt%, V, m, n, c, plus three hidden columns: `compoundId` linking to a `chemical` artifact, `cBasis` controlling how `c` is computed, and `cBasisManualVolume` for manual-basis rows).\n - Row shape: `{ compound, compoundId?, role, phase?, equiv?, limiting?, molecularWeight?, density?, purity?, stockMolarity?, stockWtPercent?, volume?, mass?, moles?, concentration?, cBasis?, cBasisManualVolume? }`.\n - **Phase grouping** (`phase` column): free-form text label that groups rows for per-phase volume totals. Use for biphasic syntheses (e.g. `phase: \"aqueous\"` vs `phase: \"oil\"`) or to sum per-mixture volumes within a single-pot reaction (e.g. `phase: \"aqueous\"` for water + dissolved CTAC + TEA). Leave blank for single-phase matrices. The UI renders a totals strip below the table; agents can read back via `get_content` to verify mass/volume balance per phase.\n - **Client-side calc engine auto-derives empty cells on every render. Do NOT pre-compute values you can leave null.** The identities propagated are: `n = m / M`, `n = V · c`, `m = V · ρ · purity` (neat liquids), `n = stockMolarity · V` (aqueous stock), `n = stockWtPercent · ρ_soln · V / M` (wt%-labelled stock), `n_i = equiv_i · n_limiting` (by row), and the reverse `equiv_i = n_i / n_limiting` (so molar ratios surface even when the user only entered masses). Derivation respects user-entered values — any non-null cell is treated as locked and never overwritten.\n - Limiting reactant: set `limiting: true` on exactly one reactant row (the engine also auto-picks the first reactant with enough info if none is flagged). Other reactants should carry `equiv` (molar ratio relative to limiting).\n - Units are fixed: M in g/mol, ρ in g/mL, V in mL, m in g, n in mmol, c in mol/L, purity as a decimal fraction (0–1), stockMolarity in mol/L, stockWtPercent in 0–100.\n - **Stock solution inputs**: for aqueous reagents (e.g. \"2 M NaOH\", \"25 wt% CTAC\"), prefer `stockMolarity` or `stockWtPercent` over `purity`. `purity` describes the dissolved compound itself (a neat liquid descriptor); `stockMolarity`/`stockWtPercent` describe the solution. Use only one of stockMolarity / stockWtPercent per row.\n - **Concentration basis** (`cBasis`, `cBasisManualVolume`): the displayed `c` is `n / V_ref` where the reference volume is picked per row. Defaults — solvent rows use `\"none\"` (c blank), non-solvent rows with a `phase` tag use `\"phase\"` (c relative to V_phase), other non-solvent rows use `\"total\"` (c relative to V_total). Leave `cBasis` null to inherit the default; explicit values are `\"none\" | \"phase\" | \"total\" | \"manual\"`. `\"manual\"` requires `cBasisManualVolume` (mL) and uses that as V_ref. Don't set these unless the user has chosen a non-default basis.\n - Minimal pattern for a reaction: one reactant with `{ role: 'reactant', limiting: true, equiv: 1, molecularWeight, mass OR volume }`; additional reactants with `{ role: 'reactant', equiv, molecularWeight }` (cells left null; the engine fills them from the limiting moles).\n\nIf a procedure node is later deleted, its matrices' `nodeRef` is cleared to null (FK `ON DELETE SET NULL`) and they surface in `list_procedure_nodes` as orphans — rebind via `rebind_matrix_to_node` or drop via `delete_matrix`.\n\nPositioning for the block:\n- `afterBlockId`: insert as SIBLING after the specified block\n- `beforeBlockId`: insert as SIBLING before the specified block\n- `parentBlockId`: insert as CHILD of a container block (e.g. inside a procedure section)\n- Omit all three: append the block at the end of the document. Safe for parallel `insert_matrix` calls — each one appends after the current tail, so agents can batch inserts instead of serialising on `afterBlockId`.\n\nExamples:\n- Body-level matrix appended after an existing block:\n `insert_matrix(entityType=\"record\", entityId=\"...\", afterBlockId=\"...\", label=\"Aqueous phase composition\", columns=[...], rows=[...])`\n- Node-attached matrix nested inside a procedure section:\n `insert_matrix(entityType=\"record\", entityId=\"...\", parentBlockId=\"...\", childPosition=\"last\", label=\"Screening Matrix\", columns=[...], rows=[...], nodeRef=\"...\")`\n\n**Record draft-gate:** matrices on records require the record to be in `draft` status. `completed` / `locked` records return a structured `record_not_draft` error — stop and surface it to the user; agents cannot flip record status themselves."};var bJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),rows:Y.array(VI).min(1).describe("New rows to append at the END of the existing rows array. **Row objects must be keyed by `col.key` (the stable column id), NOT `col.label`.** Unknown keys are retained in JSONB but never rendered and cannot be selected by `rowMatch` later. Call `get_content` on the owning entity first to read the column schema (`cols: key(Label,type[,unit])`)."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error with the actual version. Get the current version from `get_content` / `list_procedure_nodes` / prior tool output.")}),v0={name:"append_matrix_rows",description:["Append rows to the end of an existing data matrix (body-level or node-attached).","**Row objects must be keyed by `col.key`, not `col.label`.** Read the schema first via `get_content` on the owning entity; the matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Writing under a label-name that differs from the key persists opaque JSONB that the UI cannot render.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Prefer this over rewriting the entire matrix via the legacy path — row identity is preserved for downstream consumers.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): leave cells empty (`null`) whenever the client-side calc engine should derive them from the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Only persist values you explicitly measured or want to lock. For aqueous reagent stocks (NaOH(aq), CTAC(aq), TEA(aq)) prefer `stockMolarity` (mol/L) or `stockWtPercent` (0–100) over `purity`. Must preserve `compoundId` (hidden column) verbatim on any row you touch — it is the link to the chemical artifact that auto-fills M and ρ. Two more hidden row keys control how the displayed `c` is computed: `cBasis` (one of `null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = let the engine pick a default from role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user has explicitly set them.'].join(" ")};var XJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:Y.enum(["record","artifact","document","literature"]).describe("Owner entity type. Typical use: `record` or `artifact`. Literature attach is currently not supported server-side and will fail."),entityId:Y.string().uuid().describe("Owner entity UUID. The owner MUST live in the same workspace as the matrix, or the server rejects with invalid_matrix_owner."),nodeRef:Y.string().uuid().optional().describe("Optional: if provided, AND the owner is a record, also bind the matrix to this procedure node in the same call. The node must belong to `entityId`."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),V0={name:"attach_matrix",description:["Bind a workspace-owned (orphan) matrix to a provenance owner. Matrices become workspace-owned when their original record/document is deleted — the trigger promotes them instead of cascading. This tool claims them back to a new record or artifact in the same workspace.","Workspace match is enforced server-side: the owner entity MUST live in the same workspace as the matrix. Cross-workspace attach returns an `invalid_matrix_owner` error.","If `nodeRef` is provided and `entityType` is `record`, the matrix is also bound to that procedure node in the same call (combines attach + rebind). The node must belong to the target record.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error.","Only draft records are writable; attaching to a completed/locked record returns `record_not_draft`.","Use `list_matrix_references` first if you want to see which documents/records embed the matrix before attaching."].join(" ")};var DJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the matrix to inspect.")}),q0={name:"list_matrix_references",description:["List the entity_links that embed a data matrix, with each source's type, id, and display title. Matrix embeds are N:M (one matrix can be inserted in multiple records/documents via a `structuredMatrix` block).","Use before calling `delete_matrix` to understand the blast radius — deleting a matrix with embeds elsewhere leaves those blocks in an unlinked state.",'Also useful for analytical questions: "which documents reference matrix X?" or "is this matrix used outside its owner record?".',"Returns empty when the matrix has no embeds. Read-only; no version gate."].join(" ")};var qI=Y.enum(["procedure","characterization","observation","step"]),FI=Y.object({type:Y.literal("file"),target:Y.enum(["local","server","url"]),path:Y.string().min(1),format:Y.string().min(1),label:Y.string().min(1),instrument:Y.string().optional(),metadata:Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean()])).optional()}),uF=Y.object({artifactId:Y.string().uuid(),role:Y.enum(["input","output"]),context:Y.record(Y.string(),Y.unknown()).optional()}),lF=Y.object({matrixId:Y.string().uuid()}),F0=Y.object({tempId:Y.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:Y.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:Y.string().min(1).describe("Human-readable node label."),type:qI.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:Y.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:Y.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:Y.array(FI).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:Y.array(uF).optional().describe("Existing artifacts to link to this node at creation time. Use when the agent already has artifactIds in context (e.g., from `search` or a prior `create_artifact` call). For new artifacts, prefer `create_artifact({ linkToNode })` instead. Failures on individual links are non-fatal — the node is still created and a per-node summary is returned."),matrices:Y.array(lF).optional().describe("Existing data matrices to bind to this node at creation time. Workspace orphans are attached + bound; matrices already owned by this record are rebound. Cross-record matrices are rejected (would steal them from the other tree). For new matrices, call `insert_matrix(nodeRef=…)` after the tree exists.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]});var cF=Y.enum(["replace","append"]),WJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:Y.array(F0).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:cF.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:Y.literal(!0).optional().describe('MUST be set to true when mode="replace" — model-level self-check that the caller understands the existing tree (and its orphaned matrices) will be cleared.'),rootParentId:Y.string().uuid().optional().describe("Append mode only — existing node uuid under which the new roots should be grafted. Omit to graft as top-level siblings.")}).refine(($)=>!($.mode==="replace"&&$.confirm!==!0),{message:'mode="replace" requires confirm: true — destructive operation.',path:["confirm"]}).refine(($)=>!($.mode==="replace"&&$.rootParentId!==void 0),{message:"rootParentId is only valid in append mode; replace wipes the tree first.",path:["rootParentId"]}),M0={name:"build_procedure_tree",description:["Atomically build or augment the procedure-node tree of an ELN record from a canonical JSON tree.","Input is a flat list of nodes using `tempId` / `parentTempId` references; the server remaps to real uuids and returns the mapping.","Modes:","- `append`: grafts the new subtree onto existing structure (either as new roots or under `rootParentId`).","- `replace` (destructive): deletes the entire existing tree first, then inserts the new one. **Requires `confirm: true`** and will orphan any matrices that were bound to deleted nodes — check with `list_procedure_nodes` first.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'`type === "observation"` nodes must have `copyable` omitted or `false`.',"For surgical edits to a single node prefer `insert_procedure_node` / `update_procedure_node` over a full rebuild."].join(" ")};var QJ=Y.object({title:Y.string().min(1).max(500).describe("Title for the new document"),content:Y.string().optional().describe("Optional initial content in markdown format"),organizationId:Y.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:Y.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:Y.string().uuid().optional().describe("Optional space ID. When provided the document is created inside that space and workspace/organization are derived from it. Caller must be a member of the space with write access. Omit for a private (workspace-only) document.")}),j0={name:"create_document",description:"Create a new document. By default the document is private to the user in their current workspace. Pass `spaceId` to create it inside a specific space (shared with space members); workspace and organization are then derived from the space automatically. Use this when the user asks you to create a new document, draft, or note. You can optionally provide initial content in markdown format."};var GJ=Y.object({title:Y.string().min(1).max(500).describe("Paper title"),doi:Y.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:Y.array(Y.string()).optional().describe('Author full names (e.g., ["John Smith", "Jane Doe"]). Omit when a DOI is available so the server can resolve authoritative metadata.'),journal:Y.string().optional().describe("Journal name"),year:Y.number().int().positive().optional().describe("Publication year"),sourceUrl:Y.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:Y.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:Y.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:Y.string().uuid().optional().describe("Space within workspace"),fetchFullText:Y.boolean().optional().default(!1).describe("When true, fetches full text from CORE and stores as structured content blocks. Requires DOI. Default false for metadata-only creation.")}),E0={name:"create_literature",description:"Import a research paper into the user's library. Creates a literature item with bibliographic metadata. If a DOI is provided, the server will try to resolve authoritative metadata before creating the item. Set fetchFullText=true to also fetch and parse the full text from CORE (requires DOI). If a DOI is provided and already exists in the library, returns the existing item (idempotent). Use this when the user explicitly asks to import or add a paper to their library."};var mF=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],Gu=["molecule","material","mixture","biomacromolecule"],o$$=Y.enum(Gu),rF=["active","depleted","archived","draft"],xD=Y.enum(mF),MI=Y.enum(rF),Nu=Y.enum(["merge","replace"]).default("merge").describe('How to apply `properties`. "merge" (default): top-level keys in `properties` are merged into the existing JSONB; pass `null` for a key to delete it. "replace": the supplied object fully overwrites the existing JSONB.'),NJ=Y.object({id:Y.string().uuid().describe("UUID of the artifact to update."),name:Y.string().min(1).optional().describe("Display name (skip to keep existing)."),description:Y.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:Y.array(Y.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:Y.record(Y.string(),Y.unknown()).optional().describe("Free-form JSONB blob. By default merged into existing properties (see `propertiesMode`). Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; chemical → cas_number, molecular_formula, supplier; equipment → model, serial, last_calibration. Advisory only — any keys allowed."),propertiesMode:Nu.optional(),artifactType:xD.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:MI.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:Y.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:Y.string().optional().describe("Free-form physical/logical location."),parentId:Y.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:Y.string().uuid().nullable().optional().describe("Template binding. Pass null to detach.")}).refine(($)=>$.name!==void 0||$.description!==void 0||$.tags!==void 0||$.properties!==void 0||$.artifactType!==void 0||$.status!==void 0||$.storageRef!==void 0||$.location!==void 0||$.parentId!==void 0||$.templateId!==void 0,{message:"Provide at least one field to update (name, description, tags, properties, artifactType, status, storageRef, location, parentId, templateId)."}),S0={name:"update_artifact",description:["Update non-identity fields of an artifact (name, description, tags, properties, artifactType, status, storageRef, location, parentId, templateId).",'`properties` (JSONB) is merged into the existing blob by default — pass `propertiesMode: "replace"` for full overwrite. Use null on a key in merge mode to delete it.',"Identity fields (id, workspaceId, orgId, createdBy*, sourceRecordId, deletedAt, timestamps) are never writable through this tool.","Soft-delete and link mutations have their own paths and are out of scope."].join(" ")};var nF=Y.object({cid:Y.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:Y.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:Y.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:Y.string().optional().describe("Compound name (IUPAC, common, brand). Resolved via PubChem name search; uses the top match.")}).refine(($)=>$.cid||$.cas||$.inchiKey||$.name,{message:"enrichFromPubchem requires at least one of: cid, cas, inchiKey, name"}),YJ=Y.object({name:Y.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:xD.describe('sample | dataset | protocol | file | equipment | chemical | model | reaction. `chemical` is the substance (one per workspace per InChIKey/CCDC); `sample` is a physical instance of a chemical (set `parentId` to the chemical artifact). `reaction` is a sibling type — a transformation (e.g. "Suzuki coupling"), never a sub-flavor of chemical.'),workspaceId:Y.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org (any organizationId passed alongside is ignored). When omitted, falls back to the user's first workspace."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace. Auto-resolved to the user's first org only when nothing more specific is passed."),description:Y.string().optional().describe("Plain-text description."),tags:Y.array(Y.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:Y.record(Y.string(),Y.unknown()).optional().describe(["Free-form JSONB blob. Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; equipment → model, serial, last_calibration; reaction → rxn_smiles, reaction_class, description.",'For chemical artifacts, set `properties.structureClass` to one of: "molecule" (default; PubChem-shaped — iupac_name, molecular_formula, cas_number, canonical_smiles, inchi, inchi_key, molecular_weight, density, ghs_*, …), "material" (MOFs/COFs/zeolites/perovskites — topology, space_group, unit_cell, ccdc_number, framework_formula, bet_surface_area, pore_volume, pore_size, skeletal_density), "mixture" (solutions/electrolytes — components JSON-array of `{artifactId, ratio, role?}`, solvent, concentration_basis), or "biomacromolecule" (proteins/oligonucleotides — uniprot_id, pdb_id, sequence, molecular_weight, pi).',"The server validates keys against the chosen class's typed schema and returns near-match suggestions for likely typos (warn-but-accept). Unknown keys are stored either way; the warning surfaces in the response so you can self-correct on the next call.","Advisory only — any keys allowed."].join(" ")),status:MI.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:Y.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:Y.string().optional().describe("Free-form physical/logical location."),parentId:Y.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:Y.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:Y.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:nF.optional().describe('When set and artifactType is "chemical" with structureClass molecule (or absent), resolve the identifier (cid > inchiKey > cas > name) and auto-fill missing properties from PubChem. Agent-supplied properties always win — enrichment never overwrites. PubChem does NOT index periodic materials, mixtures, biomacromolecules, or reactions, so this is a no-op (logged) for those classes. Failures (no match, PubChem unreachable) do NOT block creation; the artifact is still created with whatever was provided, and the enrichment status is reported in the result.'),linkToNode:Y.object({nodeId:Y.string().uuid(),role:Y.enum(["input","output"]),context:Y.record(Y.string(),Y.unknown()).optional()}).optional().describe("When set, immediately link the newly-created artifact to this procedure node. Equivalent to: `create_artifact(...)` → `link_artifact_to_node({ nodeId, artifactId, role })` — provided as a convenience for the common create-and-link flow. Per-link failures are non-fatal: the artifact is still created and the link error is surfaced in the response.")}),P0={name:"create_artifact",description:["Create a new artifact (sample, dataset, protocol, file, equipment, chemical, model, or reaction).","Pass `workspaceId` to control where it lands; otherwise the user's first workspace is used. Artifacts are workspace-level — there is no space association.",'`createdBySource` is forced to "agent" — never user-controllable through this tool.',"`properties` is free-form JSONB; advisory keys per type are listed in the field description but never enforced.","For molecular chemical artifacts: prefer `enrichFromPubchem: { cas | cid | inchiKey | name }` over hand-assembling properties — the server canonicalizes via PubChem, dedups by InChIKey within the workspace, and auto-fills SMILES/InChI/formula/MW/GHS/transport/descriptors with fillIfAbsent semantics (your `properties` always win). Enrichment failures don't block creation.",'For periodic materials (MOFs/COFs/zeolites/perovskites): set `properties.structureClass = "material"` and supply the structural identity tuple (topology + space_group + unit_cell + ccdc_number) by hand — PubChem does NOT index periodic structures.','For mixtures (solutions/electrolytes): set `properties.structureClass = "mixture"` and reference component chemicals via `properties.components` (JSON array of {artifactId, ratio, role?}). Each component should already exist as a chemical artifact in the workspace.','For reactions: set `artifactType = "reaction"` and supply `properties.rxn_smiles`. Reactions are sibling artifacts, not chemicals.','For samples (physical instances of a chemical): set `artifactType = "sample"` and `parentId = <chemical artifact id>`; the chemical\'s typed properties flow through the UI when the sample is displayed.',"Use this when the user asks to register a new sample, dataset, instrument, chemical, material, mixture, or reaction. To attach the new artifact to a procedure node, pass `linkToNode` (artifact + node + role) — atomic create-and-link."].join(" ")};var BJ=Y.object({title:Y.string().min(1).max(500).describe("Title for the new record."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when spaceId or workspaceId is provided — derived from the parent scope. Auto-resolved to the user's first org only when nothing more specific is passed."),workspaceId:Y.string().uuid().optional().describe("Workspace ID. Ignored when spaceId is provided — derived from the space. Otherwise the workspace's organizationId is used as the record's org (any organizationId passed alongside is ignored)."),spaceId:Y.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:Y.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Expected YYYY-MM-DD").optional().describe("ISO date (YYYY-MM-DD) of the research activity, used for calendar navigation. Defaults to today."),recordType:Y.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:Y.array(Y.string().uuid()).optional().describe("User ids participating in this research activity."),initialTree:Y.array(F0).optional().describe("Optional flat procedure-tree list built via parentTempId. Inserted after the record is created; on success the response carries a tempId → nodeId map.")}),k0={name:"create_record",description:["Create a new ELN research record in the user's workspace.","Records are always created in `draft` status and begin empty — you can populate the prose body with the edit tools afterwards.","Pass `spaceId` to attach the record to a specific space; otherwise it lives at workspace level only.","Provide `initialTree` to stand up the procedure-node tree in the same call (topological insert, parentTempId → parentId).",'`type === "observation"` nodes are required to have `copyable === false` (or omitted).',"Use this when the user asks you to create a new record, experiment entry, or lab notebook page."].join(" ")};var JJ=Y.object({recordId:Y.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),R0={name:"list_procedure_nodes",description:["List the procedure-tree nodes of a record as a flat, token-dense table.","Returns each node's `id`, `parentId`, `order`, `type`, `label`, `copyable`, and live counts of attached matrices, artifact links, and analytical-data file references.","Also emits an `[attachedMatrices]` block with each node-bound matrix's `{matrixId, label, version, rows, cols}` — the `cols` cell uses pipe-separated `key(Label/type[/unit])` entries so you can write `append_/update_/delete_matrix_rows` without an extra `get_content` round-trip.","Orphaned matrices (nodeRef cleared by a node deletion) appear in a separate block with the same schema so they can be rebound via `rebind_matrix_to_node` or dropped via `delete_matrix`.","Use this before editing the tree; reconstruct hierarchy from `parentId` + `order` and pick keys/version for matrix row writes straight from the output."].join(" ")};var HJ=Y.object({reactionArtifactId:Y.string().uuid().describe('UUID of the reaction artifact to derive the stoichiometry matrix from. Must be `artifactType: "reaction"` — other types return an error.'),workspaceId:Y.string().uuid().describe("Workspace scope. Must match the reaction artifact and (if provided) the target entity."),entityType:Y.enum(["record","artifact","document","literature"]).optional().describe("Owner entity type for the spawned matrix. Omit to create a workspace-orphan matrix. Typical use: `record` paired with a `nodeRef`."),entityId:Y.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:Y.string().uuid().optional().describe('Procedure node UUID. When set with `entityType: "record"`, also ensures a procedure_node ↔ reaction artifact link exists (idempotent — duplicate calls are safe).'),label:Y.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>".')}),T0={name:"create_matrix_from_reaction_artifact",description:["Derive a stoichiometry matrix from a saved reaction artifact. Walks the artifact's `linkSlots` (typed component slots: reactant / product / reagent / catalyst / solvent), pulls each linked chemical artifact's name + MW + density, and emits one matrix row per bound slot using the slot's stoichCoefficient. Stamps `derivedFromArtifactId` on the matrix for provenance.","Frozen invariant: edits to the artifact never propagate forward to the spawned matrix; this is a one-shot copy at instantiation time.",'When `entityType: "record"` + `nodeRef` are set, the matrix is bound to the procedure node AND a `procedure_node → reaction artifact` link is ensured (created if absent). One call replaces "link reaction to node" + "spawn matrix" + "bind to node."',"Slots without a `defaultArtifactId` are skipped (no row emitted). The user can fill in those rows by hand on the derived matrix.","Returns the new matrix in the same shape as `insert_matrix`."].join(" ")};var hD=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),blockId:Y.string().optional().describe("Block ID to delete (for single delete)"),blockIds:Y.array(Y.string()).max(gD).optional().describe(`Array of block IDs to delete (batch mode, max ${gD})`)}),Yu=hD.refine(($)=>{let I=$.blockId!==void 0,U=$.blockIds!==void 0&&$.blockIds.length>0;return I!==U},{message:"Provide either blockId (single delete) or blockIds (batch delete), not both"}),_0={name:"delete_block",description:"Delete blocks from a document. Supports single (blockId) or batch (blockIds) mode. Batch mode is more efficient for deleting multiple blocks in one operation. Be careful - this permanently removes blocks and their content. Use get_content first to verify blocks before deleting. "+"Records: only `draft` records are writable; `completed`/`locked` records return a `record_not_draft` error — do not try to flip the status yourself. "+"Do NOT attempt to delete `procedureTree`, `procedureSection`, or `nodeArtifacts` blocks on records — those are sync projections of table-backed rows and re-render on every sync; use the `*_procedure_node` tools to mutate the tree instead."};var AJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the matrix to delete."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error."),acknowledgeDataLoss:Y.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting the matrix removes all rows AND the linked structuredMatrix block from the owning document/record. Not recoverable outside of version snapshots.")}),Z0={name:"delete_matrix",description:["Delete a data matrix row AND the `structuredMatrix` block that references it in the owning document/record. Both writes happen in the same tool call.","Requires `acknowledgeDataLoss: true` as a model-level self-check — prefer `delete_matrix_rows` or `rebind_matrix_to_node` for less-destructive edits.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Undo path: `record_versions` snapshots capture matrix state together with Y.js content when a version is cut, so a prior snapshot restore can recover an accidentally deleted matrix for records under version control."].join(" ")};var Bu=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),OJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),rowIndices:Y.array(Y.number().int().min(0)).min(1).optional().describe("Absolute 0-based indices of rows to delete in the current rows array. Indices resolve against the pre-delete snapshot (batch-safe)."),rowMatch:Bu.optional(),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}).refine(($)=>{let I=$.rowIndices!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndices` (absolute indices) or `rowMatch` (by column values).",path:["rowIndices"]}),C0={name:"delete_matrix_rows",description:["Remove rows from an existing data matrix, either by absolute `rowIndices` or by `rowMatch` (every column/value in the match must equal the row's current cell). Match mode deletes every row that satisfies the criteria.","**`rowMatch` MUST use `col.key` as each object key, NOT `col.label`** — the schema is visible via `get_content` on the owning entity (`cols: key(Label,type[,unit])` + `{key1,key2,...}` row header).","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","To remove the matrix itself (row + structuredMatrix block) use `delete_matrix`. This tool only prunes rows.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var zJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:Y.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting a node cascades to all descendants via FK and orphans any bound matrices (matrix.nodeRef → null).")}),g0={name:"delete_procedure_node",description:["Delete a procedure-tree node and all of its descendants (FK cascade).","Any matrices bound to deleted nodes have their `nodeRef` cleared — the response lists the orphaned matrix ids so the agent can rebind or drop them via the matrix tools.","Requires `acknowledgeCascade: true` as a model-level self-check — check `list_procedure_nodes` before deleting to understand the subtree you are about to remove.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var LJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:Y.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:Y.string().min(1).describe("Human-readable node label."),type:qI.describe("Node type."),afterNodeId:Y.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:Y.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:Y.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:Y.array(FI).optional().describe("File references attached to the new node.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>!($.afterNodeId&&$.order!==void 0),{message:"Provide either afterNodeId (relative) OR order (absolute), not both.",path:["afterNodeId"]}),x0={name:"insert_procedure_node",description:["Insert a single procedure-tree node under a draft record.","Positioning: `afterNodeId` (place right after an existing sibling) OR `order` (explicit 0-indexed slot) — omit both to append at the end.","`parentId` must be an existing node UUID in the same record; omit for a new root.",'`type === "observation"` must have `copyable` omitted or `false`.',"Only draft records are writable; completed/locked records return a `record_not_draft` error.","For bulk construction prefer `build_procedure_tree` instead."].join(" ")};var KJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),nodeRef:Y.union([Y.string().uuid(),Y.null()]).describe("Target procedure node UUID, or null to detach (body-level matrix). The node must belong to the same record that owns the matrix. Passing the same value as the current nodeRef is a no-op but still bumps version."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),h0={name:"rebind_matrix_to_node",description:["Change a matrix's procedure-node binding. Three modes via one tool: (a) promote a body-level matrix to a node-attached one (`nodeRef` = new node UUID, current was null), (b) move a node-attached matrix to a different node under the same record, (c) detach a node-attached matrix back to body level (`nodeRef: null`).","The matrix must be record-owned (documents/literature/artifacts have no procedure tree). The target `nodeRef`, when non-null, must reference a node that belongs to the SAME record as the matrix.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var vJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:Y.string().uuid().describe("UUID of the artifact to link. Use `search` first to discover existing artifacts, or call `create_artifact` and pass its `linkToNode` shortcut to skip this tool."),role:Y.enum(["input","output"]).describe("Role the artifact plays at this node. `input` = consumed/used (e.g., a starting material on a procedure step). `output` = produced/generated (e.g., a sample emerging from a step). Both roles are valid on every node type — pick by direction of flow."),context:Y.record(Y.string(),Y.unknown()).optional().describe('Optional structured context describing the link (e.g., `{quantity: "2.5 g", purpose: "limiting reagent"}`). Free-form JSONB; mirrors the UI surface.')}),f0={name:"link_artifact_to_node",description:['Bind an existing artifact to a procedure node by creating an `artifact_links` row with `source_type=procedure_node`. Mirrors the node inspector "Link artifact" affordance and is the agent equivalent of `attach_matrix` for matrices.',"The artifact must already exist — to create + link in one call, use `create_artifact({ linkToNode: { nodeId, role } })` instead.","Role semantics: `input` (consumed/used at this step) vs `output` (produced/generated). Pick by direction of flow; both roles are valid on every node type.","The mutation does NOT enforce same-record / same-workspace scope on the artifact — `artifact_links` is polymorphic by design (artifacts can be referenced across the workspace). The node's record drives the surface where the link appears.","Returns the new `linkId` so subsequent `unlink_artifact_from_node({ linkId })` calls don't need to re-query."].join(" ")};var VJ=Y.object({linkId:Y.string().uuid().describe("UUID of the `artifact_links` row to delete. Returned by `link_artifact_to_node` and `list_node_artifact_links`.")}),y0={name:"unlink_artifact_from_node",description:["Remove an artifact ↔ procedure-node link by `linkId`. The artifact and the node both stay; only the join row is dropped.","Use `list_node_artifact_links({ nodeId })` first if you only know the node + artifact identifiers — the link id is the join-row uuid, not the artifact id.","Idempotent at the user level: deleting a non-existent link returns `success: true` with `id` echoed (delete-by-id is a no-op on missing rows in the underlying repo)."].join(" ")};var qJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),u0={name:"list_node_artifact_links",description:["List all artifact ↔ procedure-node links for a given node. Returns one row per link with `linkId`, `artifactId`, `artifactName`, `artifactType`, `role`, `context`, and `createdAt`.",'Mirrors the node inspector "Artifacts" panel; use this before `unlink_artifact_from_node` when you only know the artifact id (the link id is the join-row uuid, not the artifact id).'].join(" ")};var iF=Y.object({nodeId:Y.string().uuid().describe("UUID of the node to move/reorder."),parentId:Y.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:Y.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),FJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),moves:Y.array(iF).min(1).describe("Batch of reparent/reorder operations applied together. Each entry carries the node's final parent and order — siblings you don't move keep their current values, so typically you pass moves for the whole sibling set you're rearranging.")}),l0={name:"reorder_procedure_nodes",description:["Batch reparent / reorder procedure-tree nodes in a draft record.","Each move carries the *final* `parentId` + `order` — think of it as a transaction that describes the desired post-state.","Any nodes you omit from `moves` keep their current parent/order, so you usually include the whole sibling set being rearranged.","All moves must target nodes in the same record; cross-record moves are rejected.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var Ju=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold (not just the first)."),Hu=Y.object({rowIndex:Y.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:Ju.optional(),values:VI.describe("Partial row patch. **Keys MUST match `col.key` (the column id), NOT `col.label`.** Keys present here overwrite the matching rows' cells. Keys not in `values` retain their existing values. Set a key to null to clear a cell.")}).refine(($)=>{let I=$.rowIndex!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndex` (absolute) or `rowMatch` (by column values).",path:["rowIndex"]}),MJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),updates:Y.array(Hu).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),c0={name:"update_matrix_rows",description:["Patch cells in an existing data matrix. Each update targets rows by `rowIndex` (absolute 0-based) OR `rowMatch` (every provided column/value must equal the row's current cell); partial column updates are allowed.","**All row-keyed objects (`values`, `rowMatch`) MUST use `col.key` as the object key, NOT `col.label`.** Read the schema first via `get_content` on the owning entity — its matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Mismatched keys persist as opaque JSONB that the UI cannot render.","Match mode updates every row that satisfies the criteria — use it when the match is unique, or when you intend to update a whole group at once.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Set a `values` entry to null to clear a cell. Keys not present in `values` are untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): clearing a numeric cell to null re-enables client-side derivation via the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Keys not in `values` stay untouched — use this to preserve the hidden `compoundId` link to a chemical artifact while patching other cells. Do not manually recompute derived quantities; write only measured or locked-in values. For aqueous stock solutions, set `stockMolarity` (mol/L) or `stockWtPercent` (0–100) rather than approximating via `purity` × `density`. The displayed `c` is computed against a per-row reference volume controlled by two hidden keys: `cBasis` (`null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = engine picks default by role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user explicitly set them.'].join(" ")};var jJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the existing procedure node to update."),label:Y.string().min(1).optional().describe("New label (skip to keep existing)."),type:qI.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:Y.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:Y.array(FI).optional().describe("Replace the current `analyticalData` list with this one. Pass an empty array to clear it; omit to leave it untouched.")}).refine(($)=>{if($.type!=="observation")return!0;return $.copyable===void 0||$.copyable===!1},{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>$.label!==void 0||$.type!==void 0||$.copyable!==void 0||$.analyticalData!==void 0,{message:"Provide at least one field to update (label, type, copyable, analyticalData)."}),m0={name:"update_procedure_node",description:["Update non-structural fields of a procedure-tree node (label, type, copyable, analyticalData).","Structural changes (move / reorder) go through `reorder_procedure_nodes` — this tool never touches parentId or order.",'`type === "observation"` implies `copyable = false`; setting both to a conflicting combination is rejected.',"Passing an empty `analyticalData` array clears the file-ref list; omitting the field leaves it untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};function k$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let b=String(U);return b.includes(",")?`"${b}"`:b}).join(",")}`}function fD($){if(!$)return"";let I=[];if($.previousBlock)I.push(`After: [${$.previousBlock.type} | ${$.previousBlock.id}]`);if($.nextBlock)I.push(`Before: [${$.nextBlock.type} | ${$.nextBlock.id}]`);return I.join(", ")}function pF($,I,U=150){let b=0,w=Math.min($.length,I.length);while(b<w&&$[b]===I[b])b++;let X=0;while(X<w-b&&$.at(1+X)===I.at(1+X))X++;let D=Math.floor(U/2),W=Math.max(0,b-D),Q=Math.min($.length,$.length-X+D),G=Math.min(I.length,I.length-X+D),N=W>0?"...":"",B=Q<$.length?"...":"",H=G<I.length?"...":"",J=`${N}${$.slice(W,Q)}${B}`,A=`${N}${I.slice(W,G)}${H}`;return`--- before
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of $.seen.entries()){let D=X[1];if(I===X[0]){w(X);continue}if($.external){let Q=$.external.registry.get(X[0])?.id;if(I!==X[0]&&Q){w(X);continue}}if($.metadataRegistry.get(X[0])?.id){w(X);continue}if(D.cycle){w(X);continue}if(D.count>1){if($.reused==="ref"){w(X);continue}}}}function h4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let b=(D)=>{let W=$.seen.get(D),Q=W.def??W.schema,G={...Q};if(W.ref===null)return;let N=W.ref;if(W.ref=null,N){b(N);let B=$.seen.get(N).schema;if(B.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))Q.allOf=Q.allOf??[],Q.allOf.push(B);else Object.assign(Q,B),Object.assign(Q,G)}if(!W.isParent)$.override({zodSchema:D,jsonSchema:Q,path:W.path??[]})};for(let D of[...$.seen.entries()].reverse())b(D[0]);let w={};if($.target==="draft-2020-12")w.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")w.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")w.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let D=$.external.registry.get(I)?.id;if(!D)throw new Error("Schema is missing an `id` property");w.$id=$.external.uri(D)}Object.assign(w,U.def??U.schema);let X=$.external?.defs??{};for(let D of $.seen.entries()){let W=D[1];if(W.def&&W.defId)X[W.defId]=W.def}if($.external);else if(Object.keys(X).length>0)if($.target==="draft-2020-12")w.$defs=X;else w.definitions=X;try{let D=JSON.parse(JSON.stringify(w));return Object.defineProperty(D,"~standard",{value:{...I["~standard"],jsonSchema:{input:BI(I,"input"),output:BI(I,"output")}},enumerable:!1,writable:!1}),D}catch(D){throw new Error("Error converting schema to JSON.")}}function t$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let b=$._zod.def;if(b.type==="transform")return!0;if(b.type==="array")return t$(b.element,U);if(b.type==="set")return t$(b.valueType,U);if(b.type==="lazy")return t$(b.getter(),U);if(b.type==="promise"||b.type==="optional"||b.type==="nonoptional"||b.type==="nullable"||b.type==="readonly"||b.type==="default"||b.type==="prefault")return t$(b.innerType,U);if(b.type==="intersection")return t$(b.left,U)||t$(b.right,U);if(b.type==="record"||b.type==="map")return t$(b.keyType,U)||t$(b.valueType,U);if(b.type==="pipe")return t$(b.in,U)||t$(b.out,U);if(b.type==="object"){for(let w in b.shape)if(t$(b.shape[w],U))return!0;return!1}if(b.type==="union"){for(let w of b.options)if(t$(w,U))return!0;return!1}if(b.type==="tuple"){for(let w of b.items)if(t$(w,U))return!0;if(b.rest&&t$(b.rest,U))return!0;return!1}return!1}var G5=($,I={})=>(U)=>{let b=g4({...U,processors:I});return G$($,b),x4(b,$),h4(b,$)},BI=($,I)=>(U)=>{let{libraryOptions:b,target:w}=U??{},X=g4({...b??{},target:w,io:I,processors:{}});return G$($,X),x4(X,$),h4(X,$)};var dy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},N5=($,I,U,b)=>{let w=U;w.type="string";let{minimum:X,maximum:D,format:W,patterns:Q,contentEncoding:G}=$._zod.bag;if(typeof X==="number")w.minLength=X;if(typeof D==="number")w.maxLength=D;if(W){if(w.format=dy[W]??W,w.format==="")delete w.format}if(G)w.contentEncoding=G;if(Q&&Q.size>0){let N=[...Q];if(N.length===1)w.pattern=N[0].source;else if(N.length>1)w.allOf=[...N.map((B)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:B.source}))]}},Y5=($,I,U,b)=>{let w=U,{minimum:X,maximum:D,format:W,multipleOf:Q,exclusiveMaximum:G,exclusiveMinimum:N}=$._zod.bag;if(typeof W==="string"&&W.includes("int"))w.type="integer";else w.type="number";if(typeof N==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.minimum=N,w.exclusiveMinimum=!0;else w.exclusiveMinimum=N;if(typeof X==="number"){if(w.minimum=X,typeof N==="number"&&I.target!=="draft-04")if(N>=X)delete w.minimum;else delete w.exclusiveMinimum}if(typeof G==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.maximum=G,w.exclusiveMaximum=!0;else w.exclusiveMaximum=G;if(typeof D==="number"){if(w.maximum=D,typeof G==="number"&&I.target!=="draft-04")if(G<=D)delete w.maximum;else delete w.exclusiveMaximum}if(typeof Q==="number")w.multipleOf=Q},B5=($,I,U,b)=>{U.type="boolean"},J5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},H5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},A5=($,I,U,b)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},O5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},z5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},L5=($,I,U,b)=>{U.not={}},K5=($,I,U,b)=>{},v5=($,I,U,b)=>{},V5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},q5=($,I,U,b)=>{let w=$._zod.def,X=uU(w.entries);if(X.every((D)=>typeof D==="number"))U.type="number";if(X.every((D)=>typeof D==="string"))U.type="string";U.enum=X},F5=($,I,U,b)=>{let w=$._zod.def,X=[];for(let D of w.values)if(D===void 0){if(I.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof D==="bigint")if(I.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else X.push(Number(D));else X.push(D);if(X.length===0);else if(X.length===1){let D=X[0];if(U.type=D===null?"null":typeof D,I.target==="draft-04"||I.target==="openapi-3.0")U.enum=[D];else U.const=D}else{if(X.every((D)=>typeof D==="number"))U.type="number";if(X.every((D)=>typeof D==="string"))U.type="string";if(X.every((D)=>typeof D==="boolean"))U.type="boolean";if(X.every((D)=>D===null))U.type="null";U.enum=X}},M5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},j5=($,I,U,b)=>{let w=U,X=$._zod.pattern;if(!X)throw new Error("Pattern not found in template literal");w.type="string",w.pattern=X.source},E5=($,I,U,b)=>{let w=U,X={type:"string",format:"binary",contentEncoding:"binary"},{minimum:D,maximum:W,mime:Q}=$._zod.bag;if(D!==void 0)X.minLength=D;if(W!==void 0)X.maxLength=W;if(Q)if(Q.length===1)X.contentMediaType=Q[0],Object.assign(w,X);else w.anyOf=Q.map((G)=>{return{...X,contentMediaType:G}});else Object.assign(w,X)},S5=($,I,U,b)=>{U.type="boolean"},P5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},k5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},R5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},T5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},_5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Z5=($,I,U,b)=>{let w=U,X=$._zod.def,{minimum:D,maximum:W}=$._zod.bag;if(typeof D==="number")w.minItems=D;if(typeof W==="number")w.maxItems=W;w.type="array",w.items=G$(X.element,I,{...b,path:[...b.path,"items"]})},C5=($,I,U,b)=>{let w=U,X=$._zod.def;w.type="object",w.properties={};let D=X.shape;for(let G in D)w.properties[G]=G$(D[G],I,{...b,path:[...b.path,"properties",G]});let W=new Set(Object.keys(D)),Q=new Set([...W].filter((G)=>{let N=X.shape[G]._zod;if(I.io==="input")return N.optin===void 0;else return N.optout===void 0}));if(Q.size>0)w.required=Array.from(Q);if(X.catchall?._zod.def.type==="never")w.additionalProperties=!1;else if(!X.catchall){if(I.io==="output")w.additionalProperties=!1}else if(X.catchall)w.additionalProperties=G$(X.catchall,I,{...b,path:[...b.path,"additionalProperties"]})},aX=($,I,U,b)=>{let w=$._zod.def,X=w.inclusive===!1,D=w.options.map((W,Q)=>G$(W,I,{...b,path:[...b.path,X?"oneOf":"anyOf",Q]}));if(X)U.oneOf=D;else U.anyOf=D},g5=($,I,U,b)=>{let w=$._zod.def,X=G$(w.left,I,{...b,path:[...b.path,"allOf",0]}),D=G$(w.right,I,{...b,path:[...b.path,"allOf",1]}),W=(G)=>("allOf"in G)&&Object.keys(G).length===1,Q=[...W(X)?X.allOf:[X],...W(D)?D.allOf:[D]];U.allOf=Q},x5=($,I,U,b)=>{let w=U,X=$._zod.def;w.type="array";let D=I.target==="draft-2020-12"?"prefixItems":"items",W=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",Q=X.items.map((H,J)=>G$(H,I,{...b,path:[...b.path,D,J]})),G=X.rest?G$(X.rest,I,{...b,path:[...b.path,W,...I.target==="openapi-3.0"?[X.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(w.prefixItems=Q,G)w.items=G}else if(I.target==="openapi-3.0"){if(w.items={anyOf:Q},G)w.items.anyOf.push(G);if(w.minItems=Q.length,!G)w.maxItems=Q.length}else if(w.items=Q,G)w.additionalItems=G;let{minimum:N,maximum:B}=$._zod.bag;if(typeof N==="number")w.minItems=N;if(typeof B==="number")w.maxItems=B},h5=($,I,U,b)=>{let w=U,X=$._zod.def;if(w.type="object",I.target==="draft-07"||I.target==="draft-2020-12")w.propertyNames=G$(X.keyType,I,{...b,path:[...b.path,"propertyNames"]});w.additionalProperties=G$(X.valueType,I,{...b,path:[...b.path,"additionalProperties"]})},f5=($,I,U,b)=>{let w=$._zod.def,X=G$(w.innerType,I,b),D=I.seen.get($);if(I.target==="openapi-3.0")D.ref=w.innerType,U.nullable=!0;else U.anyOf=[X,{type:"null"}]},y5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},u5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.default=JSON.parse(JSON.stringify(w.defaultValue))},l5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);if(X.ref=w.innerType,I.io==="input")U._prefault=JSON.parse(JSON.stringify(w.defaultValue))},c5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType;let D;try{D=w.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}U.default=D},m5=($,I,U,b)=>{let w=$._zod.def,X=I.io==="input"?w.in._zod.def.type==="transform"?w.out:w.in:w.out;G$(X,I,b);let D=I.seen.get($);D.ref=X},r5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.readOnly=!0},n5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},i5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},o5=($,I,U,b)=>{let w=$._zod.innerType;G$(w,I,b);let X=I.seen.get($);X.ref=w},tX={string:N5,number:Y5,boolean:B5,bigint:J5,symbol:H5,null:A5,undefined:O5,void:z5,never:L5,any:K5,unknown:v5,date:V5,enum:q5,literal:F5,nan:M5,template_literal:j5,file:E5,success:S5,custom:P5,function:k5,transform:R5,map:T5,set:_5,array:Z5,object:C5,union:aX,intersection:g5,tuple:x5,record:h5,nullable:f5,nonoptional:y5,default:u5,prefault:l5,catch:c5,pipe:m5,readonly:r5,promise:n5,optional:i5,lazy:o5};function eX($,I){if("_idmap"in $){let b=$,w=g4({...I,processors:tX}),X={};for(let Q of b._idmap.entries()){let[G,N]=Q;G$(N,w)}let D={},W={registry:b,uri:I?.uri,defs:X};w.external=W;for(let Q of b._idmap.entries()){let[G,N]=Q;x4(w,N),D[G]=h4(w,N)}if(Object.keys(X).length>0){let Q=w.target==="draft-2020-12"?"$defs":"definitions";D.__shared={[Q]:X}}return{schemas:D}}let U=g4({...I,processors:tX});return G$($,U),x4(U,$),h4(U,$)}class d5{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=g4({processors:tX,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return G$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}x4(this.ctx,$);let U=h4(this.ctx,$),{"~standard":b,...w}=U;return w}}var Vq={};var W0={};v6(W0,{xor:()=>JF,xid:()=>xq,void:()=>WF,uuidv7:()=>Pq,uuidv6:()=>Sq,uuidv4:()=>Eq,uuid:()=>jq,url:()=>kq,unknown:()=>N1,union:()=>jD,undefined:()=>XF,ulid:()=>gq,uint64:()=>wF,uint32:()=>$F,tuple:()=>PB,transform:()=>SD,templateLiteral:()=>EF,symbol:()=>bF,superRefine:()=>sB,success:()=>FF,stringbool:()=>CF,stringFormat:()=>oq,string:()=>bD,strictObject:()=>YF,set:()=>LF,refine:()=>eB,record:()=>kB,readonly:()=>iB,promise:()=>SF,preprocess:()=>xF,prefault:()=>yB,pipe:()=>Y0,partialRecord:()=>AF,optional:()=>G0,object:()=>NF,number:()=>BB,nullish:()=>qF,nullable:()=>N0,null:()=>zB,nonoptional:()=>uB,never:()=>MD,nativeEnum:()=>KF,nanoid:()=>_q,nan:()=>MF,meta:()=>_F,map:()=>zF,mac:()=>yq,looseRecord:()=>OF,looseObject:()=>BF,literal:()=>vF,lazy:()=>pB,ksuid:()=>hq,keyof:()=>GF,jwt:()=>iq,json:()=>gF,ipv6:()=>uq,ipv4:()=>fq,intersection:()=>EB,int64:()=>UF,int32:()=>sq,int:()=>XD,instanceof:()=>ZF,httpUrl:()=>Rq,hostname:()=>dq,hex:()=>pq,hash:()=>tq,guid:()=>Mq,function:()=>PF,float64:()=>eq,float32:()=>aq,file:()=>VF,enum:()=>ED,emoji:()=>Tq,email:()=>Fq,e164:()=>nq,discriminatedUnion:()=>HF,describe:()=>TF,date:()=>QF,custom:()=>RF,cuid2:()=>Cq,cuid:()=>Zq,codec:()=>jF,cidrv6:()=>cq,cidrv4:()=>lq,check:()=>kF,catch:()=>mB,boolean:()=>JB,bigint:()=>IF,base64url:()=>rq,base64:()=>mq,array:()=>H0,any:()=>DF,_function:()=>PF,_default:()=>hB,_ZodString:()=>DD,ZodXor:()=>FB,ZodXID:()=>JD,ZodVoid:()=>VB,ZodUnknown:()=>KB,ZodUnion:()=>O0,ZodUndefined:()=>AB,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>BD,ZodType:()=>t,ZodTuple:()=>SB,ZodTransform:()=>CB,ZodTemplateLiteral:()=>oB,ZodSymbol:()=>HB,ZodSuccess:()=>lB,ZodStringFormat:()=>J$,ZodString:()=>AI,ZodSet:()=>TB,ZodRecord:()=>z0,ZodReadonly:()=>nB,ZodPromise:()=>tB,ZodPrefault:()=>fB,ZodPipe:()=>RD,ZodOptional:()=>PD,ZodObject:()=>A0,ZodNumberFormat:()=>Y1,ZodNumber:()=>zI,ZodNullable:()=>gB,ZodNull:()=>OB,ZodNonOptional:()=>kD,ZodNever:()=>vB,ZodNanoID:()=>GD,ZodNaN:()=>rB,ZodMap:()=>RB,ZodMAC:()=>YB,ZodLiteral:()=>_B,ZodLazy:()=>dB,ZodKSUID:()=>HD,ZodJWT:()=>qD,ZodIntersection:()=>jB,ZodIPv6:()=>OD,ZodIPv4:()=>AD,ZodGUID:()=>Q0,ZodFunction:()=>aB,ZodFile:()=>ZB,ZodEnum:()=>HI,ZodEmoji:()=>QD,ZodEmail:()=>WD,ZodE164:()=>VD,ZodDiscriminatedUnion:()=>MB,ZodDefault:()=>xB,ZodDate:()=>J0,ZodCustomStringFormat:()=>OI,ZodCustom:()=>L0,ZodCodec:()=>TD,ZodCatch:()=>cB,ZodCUID2:()=>YD,ZodCUID:()=>ND,ZodCIDRv6:()=>LD,ZodCIDRv4:()=>zD,ZodBoolean:()=>LI,ZodBigIntFormat:()=>FD,ZodBigInt:()=>KI,ZodBase64URL:()=>vD,ZodBase64:()=>KD,ZodArray:()=>qB,ZodAny:()=>LB});var sX={};v6(sX,{uppercase:()=>II,trim:()=>WI,toUpperCase:()=>GI,toLowerCase:()=>QI,startsWith:()=>wI,slugify:()=>NI,size:()=>e1,regex:()=>s1,property:()=>pX,positive:()=>nX,overwrite:()=>Z6,normalize:()=>DI,nonpositive:()=>oX,nonnegative:()=>dX,negative:()=>iX,multipleOf:()=>Z4,minSize:()=>C4,minLength:()=>b4,mime:()=>XI,maxSize:()=>W1,maxLength:()=>Q1,lte:()=>N6,lt:()=>r6,lowercase:()=>$I,length:()=>G1,includes:()=>UI,gte:()=>p$,gt:()=>n6,endsWith:()=>bI});var JI={};v6(JI,{time:()=>a5,duration:()=>e5,datetime:()=>p5,date:()=>t5,ZodISOTime:()=>UD,ZodISODuration:()=>wD,ZodISODateTime:()=>$D,ZodISODate:()=>ID});var $D=z("ZodISODateTime",($,I)=>{ZN.init($,I),J$.init($,I)});function p5($){return P7($D,$)}var ID=z("ZodISODate",($,I)=>{CN.init($,I),J$.init($,I)});function t5($){return k7(ID,$)}var UD=z("ZodISOTime",($,I)=>{gN.init($,I),J$.init($,I)});function a5($){return R7(UD,$)}var wD=z("ZodISODuration",($,I)=>{xN.init($,I),J$.init($,I)});function e5($){return T7(wD,$)}var qq=($,I)=>{nU.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>oU($,U)},flatten:{value:(U)=>iU($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,r1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,r1,2)}},isEmpty:{get(){return $.issues.length===0}}})},ty=z("ZodError",qq),b6=z("ZodError",qq,{Parent:Error});var s5=o1(b6),$B=d1(b6),IB=p1(b6),UB=t1(b6),wB=bX(b6),bB=XX(b6),XB=DX(b6),DB=WX(b6),WB=QX(b6),QB=GX(b6),GB=NX(b6),NB=YX(b6);var t=z("ZodType",($,I)=>{return o.init($,I),Object.assign($["~standard"],{jsonSchema:{input:BI($,"input"),output:BI($,"output")}}),$.toJSONSchema=G5($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(E.mergeDefs(I,{checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]}))},$.clone=(U,b)=>o$($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$},$.parse=(U,b)=>s5($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>IB($,U,b),$.parseAsync=async(U,b)=>$B($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>UB($,U,b),$.spa=$.safeParseAsync,$.encode=(U,b)=>wB($,U,b),$.decode=(U,b)=>bB($,U,b),$.encodeAsync=async(U,b)=>XB($,U,b),$.decodeAsync=async(U,b)=>DB($,U,b),$.safeEncode=(U,b)=>WB($,U,b),$.safeDecode=(U,b)=>QB($,U,b),$.safeEncodeAsync=async(U,b)=>GB($,U,b),$.safeDecodeAsync=async(U,b)=>NB($,U,b),$.refine=(U,b)=>$.check(eB(U,b)),$.superRefine=(U)=>$.check(sB(U)),$.overwrite=(U)=>$.check(Z6(U)),$.optional=()=>G0($),$.nullable=()=>N0($),$.nullish=()=>G0(N0($)),$.nonoptional=(U)=>uB($,U),$.array=()=>H0($),$.or=(U)=>jD([$,U]),$.and=(U)=>EB($,U),$.transform=(U)=>Y0($,SD(U)),$.default=(U)=>hB($,U),$.prefault=(U)=>yB($,U),$.catch=(U)=>mB($,U),$.pipe=(U)=>Y0($,U),$.readonly=()=>iB($),$.describe=(U)=>{let b=$.clone();return d$.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return d$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return d$.get($);let b=$.clone();return d$.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),DD=z("_ZodString",($,I)=>{D1.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>N5($,b,w,X);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(s1(...b)),$.includes=(...b)=>$.check(UI(...b)),$.startsWith=(...b)=>$.check(wI(...b)),$.endsWith=(...b)=>$.check(bI(...b)),$.min=(...b)=>$.check(b4(...b)),$.max=(...b)=>$.check(Q1(...b)),$.length=(...b)=>$.check(G1(...b)),$.nonempty=(...b)=>$.check(b4(1,...b)),$.lowercase=(b)=>$.check($I(b)),$.uppercase=(b)=>$.check(II(b)),$.trim=()=>$.check(WI()),$.normalize=(...b)=>$.check(DI(...b)),$.toLowerCase=()=>$.check(QI()),$.toUpperCase=()=>$.check(GI()),$.slugify=()=>$.check(NI())}),AI=z("ZodString",($,I)=>{D1.init($,I),DD.init($,I),$.email=(U)=>$.check(jX(WD,U)),$.url=(U)=>$.check(D0(B0,U)),$.jwt=(U)=>$.check(rX(qD,U)),$.emoji=(U)=>$.check(RX(QD,U)),$.guid=(U)=>$.check(X0(Q0,U)),$.uuid=(U)=>$.check(EX(i6,U)),$.uuidv4=(U)=>$.check(SX(i6,U)),$.uuidv6=(U)=>$.check(PX(i6,U)),$.uuidv7=(U)=>$.check(kX(i6,U)),$.nanoid=(U)=>$.check(TX(GD,U)),$.guid=(U)=>$.check(X0(Q0,U)),$.cuid=(U)=>$.check(_X(ND,U)),$.cuid2=(U)=>$.check(ZX(YD,U)),$.ulid=(U)=>$.check(CX(BD,U)),$.base64=(U)=>$.check(lX(KD,U)),$.base64url=(U)=>$.check(cX(vD,U)),$.xid=(U)=>$.check(gX(JD,U)),$.ksuid=(U)=>$.check(xX(HD,U)),$.ipv4=(U)=>$.check(hX(AD,U)),$.ipv6=(U)=>$.check(fX(OD,U)),$.cidrv4=(U)=>$.check(yX(zD,U)),$.cidrv6=(U)=>$.check(uX(LD,U)),$.e164=(U)=>$.check(mX(VD,U)),$.datetime=(U)=>$.check(p5(U)),$.date=(U)=>$.check(t5(U)),$.time=(U)=>$.check(a5(U)),$.duration=(U)=>$.check(e5(U))});function bD($){return M7(AI,$)}var J$=z("ZodStringFormat",($,I)=>{B$.init($,I),DD.init($,I)}),WD=z("ZodEmail",($,I)=>{MN.init($,I),J$.init($,I)});function Fq($){return jX(WD,$)}var Q0=z("ZodGUID",($,I)=>{qN.init($,I),J$.init($,I)});function Mq($){return X0(Q0,$)}var i6=z("ZodUUID",($,I)=>{FN.init($,I),J$.init($,I)});function jq($){return EX(i6,$)}function Eq($){return SX(i6,$)}function Sq($){return PX(i6,$)}function Pq($){return kX(i6,$)}var B0=z("ZodURL",($,I)=>{jN.init($,I),J$.init($,I)});function kq($){return D0(B0,$)}function Rq($){return D0(B0,{protocol:/^https?$/,hostname:K6.domain,...E.normalizeParams($)})}var QD=z("ZodEmoji",($,I)=>{EN.init($,I),J$.init($,I)});function Tq($){return RX(QD,$)}var GD=z("ZodNanoID",($,I)=>{SN.init($,I),J$.init($,I)});function _q($){return TX(GD,$)}var ND=z("ZodCUID",($,I)=>{PN.init($,I),J$.init($,I)});function Zq($){return _X(ND,$)}var YD=z("ZodCUID2",($,I)=>{kN.init($,I),J$.init($,I)});function Cq($){return ZX(YD,$)}var BD=z("ZodULID",($,I)=>{RN.init($,I),J$.init($,I)});function gq($){return CX(BD,$)}var JD=z("ZodXID",($,I)=>{TN.init($,I),J$.init($,I)});function xq($){return gX(JD,$)}var HD=z("ZodKSUID",($,I)=>{_N.init($,I),J$.init($,I)});function hq($){return xX(HD,$)}var AD=z("ZodIPv4",($,I)=>{hN.init($,I),J$.init($,I)});function fq($){return hX(AD,$)}var YB=z("ZodMAC",($,I)=>{yN.init($,I),J$.init($,I)});function yq($){return E7(YB,$)}var OD=z("ZodIPv6",($,I)=>{fN.init($,I),J$.init($,I)});function uq($){return fX(OD,$)}var zD=z("ZodCIDRv4",($,I)=>{uN.init($,I),J$.init($,I)});function lq($){return yX(zD,$)}var LD=z("ZodCIDRv6",($,I)=>{lN.init($,I),J$.init($,I)});function cq($){return uX(LD,$)}var KD=z("ZodBase64",($,I)=>{mN.init($,I),J$.init($,I)});function mq($){return lX(KD,$)}var vD=z("ZodBase64URL",($,I)=>{rN.init($,I),J$.init($,I)});function rq($){return cX(vD,$)}var VD=z("ZodE164",($,I)=>{nN.init($,I),J$.init($,I)});function nq($){return mX(VD,$)}var qD=z("ZodJWT",($,I)=>{iN.init($,I),J$.init($,I)});function iq($){return rX(qD,$)}var OI=z("ZodCustomStringFormat",($,I)=>{oN.init($,I),J$.init($,I)});function oq($,I,U={}){return YI(OI,$,I,U)}function dq($){return YI(OI,"hostname",K6.hostname,$)}function pq($){return YI(OI,"hex",K6.hex,$)}function tq($,I){let U=I?.enc??"hex",b=`${$}_${U}`,w=K6[b];if(!w)throw new Error(`Unrecognized hash format: ${b}`);return YI(OI,b,w,I)}var zI=z("ZodNumber",($,I)=>{VX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>Y5($,b,w,X),$.gt=(b,w)=>$.check(n6(b,w)),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.lt=(b,w)=>$.check(r6(b,w)),$.lte=(b,w)=>$.check(N6(b,w)),$.max=(b,w)=>$.check(N6(b,w)),$.int=(b)=>$.check(XD(b)),$.safe=(b)=>$.check(XD(b)),$.positive=(b)=>$.check(n6(0,b)),$.nonnegative=(b)=>$.check(p$(0,b)),$.negative=(b)=>$.check(r6(0,b)),$.nonpositive=(b)=>$.check(N6(0,b)),$.multipleOf=(b,w)=>$.check(Z4(b,w)),$.step=(b,w)=>$.check(Z4(b,w)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function BB($){return _7(zI,$)}var Y1=z("ZodNumberFormat",($,I)=>{dN.init($,I),zI.init($,I)});function XD($){return C7(Y1,$)}function aq($){return g7(Y1,$)}function eq($){return x7(Y1,$)}function sq($){return h7(Y1,$)}function $F($){return f7(Y1,$)}var LI=z("ZodBoolean",($,I)=>{tU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>B5($,U,b,w)});function JB($){return y7(LI,$)}var KI=z("ZodBigInt",($,I)=>{qX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>J5($,b,w,X),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.gt=(b,w)=>$.check(n6(b,w)),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.lt=(b,w)=>$.check(r6(b,w)),$.lte=(b,w)=>$.check(N6(b,w)),$.max=(b,w)=>$.check(N6(b,w)),$.positive=(b)=>$.check(n6(BigInt(0),b)),$.negative=(b)=>$.check(r6(BigInt(0),b)),$.nonpositive=(b)=>$.check(N6(BigInt(0),b)),$.nonnegative=(b)=>$.check(p$(BigInt(0),b)),$.multipleOf=(b,w)=>$.check(Z4(b,w));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function IF($){return l7(KI,$)}var FD=z("ZodBigIntFormat",($,I)=>{pN.init($,I),KI.init($,I)});function UF($){return m7(FD,$)}function wF($){return r7(FD,$)}var HB=z("ZodSymbol",($,I)=>{tN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>H5($,U,b,w)});function bF($){return n7(HB,$)}var AB=z("ZodUndefined",($,I)=>{aN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>O5($,U,b,w)});function XF($){return i7(AB,$)}var OB=z("ZodNull",($,I)=>{eN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>A5($,U,b,w)});function zB($){return o7(OB,$)}var LB=z("ZodAny",($,I)=>{sN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>K5($,U,b,w)});function DF(){return d7(LB)}var KB=z("ZodUnknown",($,I)=>{$Y.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>v5($,U,b,w)});function N1(){return p7(KB)}var vB=z("ZodNever",($,I)=>{IY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>L5($,U,b,w)});function MD($){return t7(vB,$)}var VB=z("ZodVoid",($,I)=>{UY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>z5($,U,b,w)});function WF($){return a7(VB,$)}var J0=z("ZodDate",($,I)=>{wY.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>V5($,b,w,X),$.min=(b,w)=>$.check(p$(b,w)),$.max=(b,w)=>$.check(N6(b,w));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function QF($){return e7(J0,$)}var qB=z("ZodArray",($,I)=>{bY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>Z5($,U,b,w),$.element=I.element,$.min=(U,b)=>$.check(b4(U,b)),$.nonempty=(U)=>$.check(b4(1,U)),$.max=(U,b)=>$.check(Q1(U,b)),$.length=(U,b)=>$.check(G1(U,b)),$.unwrap=()=>$.element});function H0($,I){return I5(qB,$,I)}function GF($){let I=$._zod.def.shape;return ED(Object.keys(I))}var A0=z("ZodObject",($,I)=>{XY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>C5($,U,b,w),E.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>ED(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:N1()}),$.loose=()=>$.clone({...$._zod.def,catchall:N1()}),$.strict=()=>$.clone({...$._zod.def,catchall:MD()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return E.extend($,U)},$.safeExtend=(U)=>{return E.safeExtend($,U)},$.merge=(U)=>E.merge($,U),$.pick=(U)=>E.pick($,U),$.omit=(U)=>E.omit($,U),$.partial=(...U)=>E.partial(PD,$,U[0]),$.required=(...U)=>E.required(kD,$,U[0])});function NF($,I){let U={type:"object",shape:$??{},...E.normalizeParams(I)};return new A0(U)}function YF($,I){return new A0({type:"object",shape:$,catchall:MD(),...E.normalizeParams(I)})}function BF($,I){return new A0({type:"object",shape:$,catchall:N1(),...E.normalizeParams(I)})}var O0=z("ZodUnion",($,I)=>{aU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>aX($,U,b,w),$.options=I.options});function jD($,I){return new O0({type:"union",options:$,...E.normalizeParams(I)})}var FB=z("ZodXor",($,I)=>{O0.init($,I),DY.init($,I),$._zod.processJSONSchema=(U,b,w)=>aX($,U,b,w),$.options=I.options});function JF($,I){return new FB({type:"union",options:$,inclusive:!1,...E.normalizeParams(I)})}var MB=z("ZodDiscriminatedUnion",($,I)=>{O0.init($,I),WY.init($,I)});function HF($,I,U){return new MB({type:"union",options:I,discriminator:$,...E.normalizeParams(U)})}var jB=z("ZodIntersection",($,I)=>{QY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>g5($,U,b,w)});function EB($,I){return new jB({type:"intersection",left:$,right:I})}var SB=z("ZodTuple",($,I)=>{FX.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>x5($,U,b,w),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function PB($,I,U){let b=I instanceof o,w=b?U:I;return new SB({type:"tuple",items:$,rest:b?I:null,...E.normalizeParams(w)})}var z0=z("ZodRecord",($,I)=>{GY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>h5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function kB($,I,U){return new z0({type:"record",keyType:$,valueType:I,...E.normalizeParams(U)})}function AF($,I,U){let b=o$($);return b._zod.values=void 0,new z0({type:"record",keyType:b,valueType:I,...E.normalizeParams(U)})}function OF($,I,U){return new z0({type:"record",keyType:$,valueType:I,mode:"loose",...E.normalizeParams(U)})}var RB=z("ZodMap",($,I)=>{NY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>T5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function zF($,I,U){return new RB({type:"map",keyType:$,valueType:I,...E.normalizeParams(U)})}var TB=z("ZodSet",($,I)=>{YY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>_5($,U,b,w),$.min=(...U)=>$.check(C4(...U)),$.nonempty=(U)=>$.check(C4(1,U)),$.max=(...U)=>$.check(W1(...U)),$.size=(...U)=>$.check(e1(...U))});function LF($,I){return new TB({type:"set",valueType:$,...E.normalizeParams(I)})}var HI=z("ZodEnum",($,I)=>{BY.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>q5($,b,w,X),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(b,w)=>{let X={};for(let D of b)if(U.has(D))X[D]=I.entries[D];else throw new Error(`Key ${D} not found in enum`);return new HI({...I,checks:[],...E.normalizeParams(w),entries:X})},$.exclude=(b,w)=>{let X={...I.entries};for(let D of b)if(U.has(D))delete X[D];else throw new Error(`Key ${D} not found in enum`);return new HI({...I,checks:[],...E.normalizeParams(w),entries:X})}});function ED($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new HI({type:"enum",entries:U,...E.normalizeParams(I)})}function KF($,I){return new HI({type:"enum",entries:$,...E.normalizeParams(I)})}var _B=z("ZodLiteral",($,I)=>{JY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>F5($,U,b,w),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function vF($,I){return new _B({type:"literal",values:Array.isArray($)?$:[$],...E.normalizeParams(I)})}var ZB=z("ZodFile",($,I)=>{HY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>E5($,U,b,w),$.min=(U,b)=>$.check(C4(U,b)),$.max=(U,b)=>$.check(W1(U,b)),$.mime=(U,b)=>$.check(XI(Array.isArray(U)?U:[U],b))});function VF($){return U5(ZB,$)}var CB=z("ZodTransform",($,I)=>{AY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>R5($,U,b,w),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1($.constructor.name);U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(E.issue(X,U.value,I));else{let D=X;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=$),U.issues.push(E.issue(D))}};let w=I.transform(U.value,U);if(w instanceof Promise)return w.then((X)=>{return U.value=X,U});return U.value=w,U}});function SD($){return new CB({type:"transform",transform:$})}var PD=z("ZodOptional",($,I)=>{OY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>i5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function G0($){return new PD({type:"optional",innerType:$})}var gB=z("ZodNullable",($,I)=>{zY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>f5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function N0($){return new gB({type:"nullable",innerType:$})}function qF($){return G0(N0($))}var xB=z("ZodDefault",($,I)=>{LY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>u5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function hB($,I){return new xB({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var fB=z("ZodPrefault",($,I)=>{KY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>l5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function yB($,I){return new fB({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var kD=z("ZodNonOptional",($,I)=>{vY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>y5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function uB($,I){return new kD({type:"nonoptional",innerType:$,...E.normalizeParams(I)})}var lB=z("ZodSuccess",($,I)=>{VY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>S5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function FF($){return new lB({type:"success",innerType:$})}var cB=z("ZodCatch",($,I)=>{qY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>c5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function mB($,I){return new cB({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var rB=z("ZodNaN",($,I)=>{FY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>M5($,U,b,w)});function MF($){return $5(rB,$)}var RD=z("ZodPipe",($,I)=>{MY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>m5($,U,b,w),$.in=I.in,$.out=I.out});function Y0($,I){return new RD({type:"pipe",in:$,out:I})}var TD=z("ZodCodec",($,I)=>{RD.init($,I),eU.init($,I)});function jF($,I,U){return new TD({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var nB=z("ZodReadonly",($,I)=>{jY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>r5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function iB($){return new nB({type:"readonly",innerType:$})}var oB=z("ZodTemplateLiteral",($,I)=>{EY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>j5($,U,b,w)});function EF($,I){return new oB({type:"template_literal",parts:$,...E.normalizeParams(I)})}var dB=z("ZodLazy",($,I)=>{kY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>o5($,U,b,w),$.unwrap=()=>$._zod.def.getter()});function pB($){return new dB({type:"lazy",getter:$})}var tB=z("ZodPromise",($,I)=>{PY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>n5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function SF($){return new tB({type:"promise",innerType:$})}var aB=z("ZodFunction",($,I)=>{SY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>k5($,U,b,w)});function PF($){return new aB({type:"function",input:Array.isArray($?.input)?PB($?.input):$?.input??H0(N1()),output:$?.output??N1()})}var L0=z("ZodCustom",($,I)=>{RY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>P5($,U,b,w)});function kF($){let I=new A$({check:"custom"});return I._zod.check=$,I}function RF($,I){return w5(L0,$??(()=>!0),I)}function eB($,I={}){return b5(L0,$,I)}function sB($){return X5($)}var TF=D5,_F=W5;function ZF($,I={error:`Input not instance of ${$.name}`}){let U=new L0({type:"custom",check:"custom",fn:(b)=>b instanceof $,abort:!0,...E.normalizeParams(I)});return U._zod.bag.Class=$,U}var CF=(...$)=>Q5({Codec:TD,Boolean:LI,String:AI},...$);function gF($){let I=pB(()=>{return jD([bD($),BB(),JB(),zB(),H0(I),kB(bD(),I)])});return I}function xF($,I){return Y0(SD($),I)}var ey={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 sy($){P$({customError:$})}function $u(){return P$().customError}var $J;(function($){})($J||($J={}));var _={...W0,...sX,iso:JI};function Iu($,I){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function Uu($,I){if(!$.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return I.rootSchema;let b=I.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===b){let w=U[1];if(!w||!I.defs[w])throw new Error(`Reference not found: ${$}`);return I.defs[w]}throw new Error(`Reference not found: ${$}`)}function hF($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return _.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let w=$.$ref;if(I.refs.has(w))return I.refs.get(w);if(I.processing.has(w))return _.lazy(()=>{if(!I.refs.has(w))throw new Error(`Circular reference not resolved: ${w}`);return I.refs.get(w)});I.processing.add(w);let X=Uu(w,I),D=u$(X,I);return I.refs.set(w,D),I.processing.delete(w),D}if($.enum!==void 0){let w=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&w.length===1&&w[0]===null)return _.null();if(w.length===0)return _.never();if(w.length===1)return _.literal(w[0]);if(w.every((D)=>typeof D==="string"))return _.enum(w);let X=w.map((D)=>_.literal(D));if(X.length<2)return X[0];return _.union([X[0],X[1],...X.slice(2)])}if($.const!==void 0)return _.literal($.const);let U=$.type;if(Array.isArray(U)){let w=U.map((X)=>{let D={...$,type:X};return hF(D,I)});if(w.length===0)return _.never();if(w.length===1)return w[0];return _.union(w)}if(!U)return _.any();let b;switch(U){case"string":{let w=_.string();if($.format){let X=$.format;if(X==="email")w=w.check(_.email());else if(X==="uri"||X==="uri-reference")w=w.check(_.url());else if(X==="uuid"||X==="guid")w=w.check(_.uuid());else if(X==="date-time")w=w.check(_.iso.datetime());else if(X==="date")w=w.check(_.iso.date());else if(X==="time")w=w.check(_.iso.time());else if(X==="duration")w=w.check(_.iso.duration());else if(X==="ipv4")w=w.check(_.ipv4());else if(X==="ipv6")w=w.check(_.ipv6());else if(X==="mac")w=w.check(_.mac());else if(X==="cidr")w=w.check(_.cidrv4());else if(X==="cidr-v6")w=w.check(_.cidrv6());else if(X==="base64")w=w.check(_.base64());else if(X==="base64url")w=w.check(_.base64url());else if(X==="e164")w=w.check(_.e164());else if(X==="jwt")w=w.check(_.jwt());else if(X==="emoji")w=w.check(_.emoji());else if(X==="nanoid")w=w.check(_.nanoid());else if(X==="cuid")w=w.check(_.cuid());else if(X==="cuid2")w=w.check(_.cuid2());else if(X==="ulid")w=w.check(_.ulid());else if(X==="xid")w=w.check(_.xid());else if(X==="ksuid")w=w.check(_.ksuid())}if(typeof $.minLength==="number")w=w.min($.minLength);if(typeof $.maxLength==="number")w=w.max($.maxLength);if($.pattern)w=w.regex(new RegExp($.pattern));b=w;break}case"number":case"integer":{let w=U==="integer"?_.number().int():_.number();if(typeof $.minimum==="number")w=w.min($.minimum);if(typeof $.maximum==="number")w=w.max($.maximum);if(typeof $.exclusiveMinimum==="number")w=w.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")w=w.gt($.minimum);if(typeof $.exclusiveMaximum==="number")w=w.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")w=w.lt($.maximum);if(typeof $.multipleOf==="number")w=w.multipleOf($.multipleOf);b=w;break}case"boolean":{b=_.boolean();break}case"null":{b=_.null();break}case"object":{let w={},X=$.properties||{},D=new Set($.required||[]);for(let[Q,G]of Object.entries(X)){let N=u$(G,I);w[Q]=D.has(Q)?N:N.optional()}if($.propertyNames){let Q=u$($.propertyNames,I),G=$.additionalProperties&&typeof $.additionalProperties==="object"?u$($.additionalProperties,I):_.any();if(Object.keys(w).length===0){b=_.record(Q,G);break}let N=_.object(w).passthrough(),B=_.looseRecord(Q,G);b=_.intersection(N,B);break}if($.patternProperties){let Q=$.patternProperties,G=Object.keys(Q),N=[];for(let H of G){let J=u$(Q[H],I),A=_.string().regex(new RegExp(H));N.push(_.looseRecord(A,J))}let B=[];if(Object.keys(w).length>0)B.push(_.object(w).passthrough());if(B.push(...N),B.length===0)b=_.object({}).passthrough();else if(B.length===1)b=B[0];else{let H=_.intersection(B[0],B[1]);for(let J=2;J<B.length;J++)H=_.intersection(H,B[J]);b=H}break}let W=_.object(w);if($.additionalProperties===!1)b=W.strict();else if(typeof $.additionalProperties==="object")b=W.catchall(u$($.additionalProperties,I));else b=W.passthrough();break}case"array":{let{prefixItems:w,items:X}=$;if(w&&Array.isArray(w)){let D=w.map((Q)=>u$(Q,I)),W=X&&typeof X==="object"&&!Array.isArray(X)?u$(X,I):void 0;if(W)b=_.tuple(D).rest(W);else b=_.tuple(D);if(typeof $.minItems==="number")b=b.check(_.minLength($.minItems));if(typeof $.maxItems==="number")b=b.check(_.maxLength($.maxItems))}else if(Array.isArray(X)){let D=X.map((Q)=>u$(Q,I)),W=$.additionalItems&&typeof $.additionalItems==="object"?u$($.additionalItems,I):void 0;if(W)b=_.tuple(D).rest(W);else b=_.tuple(D);if(typeof $.minItems==="number")b=b.check(_.minLength($.minItems));if(typeof $.maxItems==="number")b=b.check(_.maxLength($.maxItems))}else if(X!==void 0){let D=u$(X,I),W=_.array(D);if(typeof $.minItems==="number")W=W.min($.minItems);if(typeof $.maxItems==="number")W=W.max($.maxItems);b=W}else b=_.array(_.any());break}default:throw new Error(`Unsupported type: ${U}`)}if($.description)b=b.describe($.description);if($.default!==void 0)b=b.default($.default);return b}function u$($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=hF($,I),b=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let w=$.anyOf.map((D)=>u$(D,I)),X=_.union(w);U=b?_.intersection(U,X):X}if($.oneOf&&Array.isArray($.oneOf)){let w=$.oneOf.map((D)=>u$(D,I)),X=_.xor(w);U=b?_.intersection(U,X):X}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=b?U:_.any();else{let w=b?U:u$($.allOf[0],I),X=b?0:1;for(let D=X;D<$.allOf.length;D++)w=_.intersection(w,u$($.allOf[D],I));U=w}if($.nullable===!0&&I.version==="openapi-3.0")U=_.nullable(U);if($.readOnly===!0)U=_.readonly(U);return U}function fF($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=Iu($,I?.defaultTarget),b=$.$defs||$.definitions||{};return u$($,{version:U,defs:b,refs:new Map,processing:new Set,rootSchema:$})}var IJ={};v6(IJ,{string:()=>wu,number:()=>bu,date:()=>Wu,boolean:()=>Xu,bigint:()=>Du});function wu($){return j7(AI,$)}function bu($){return Z7(zI,$)}function Xu($){return u7(LI,$)}function Du($){return c7(KI,$)}function Wu($){return s7(J0,$)}P$(sU());var D4=Y.enum(["document","record"]),_D=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],ZD=["literature","document","record","annotation","artifact"],CD=["molecule","reaction"],vI=50,gD=50;var UJ=Y.object({blockType:Y.enum(_D).default("paragraph").describe("Type of block to create. Default: paragraph"),content:Y.string().describe("Text content for the block"),headingLevel:Y.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:Y.boolean().optional().describe("Checked state for checkListItem"),title:Y.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:Y.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:Y.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:Y.enum(ZD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:Y.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:Y.string().optional().describe("Cached title of the linked entity"),doi:Y.string().optional().describe("DOI for literature references"),smiles:Y.string().optional().describe('SMILES string (e.g., "CCO" for ethanol, "CC(=O)C.N>>CC(N)C.O" for reactions). Required for molecule blocks.'),structureType:Y.enum(CD).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:Y.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:Y.string().optional().describe("Optional description or notes for the molecule block"),matrixId:Y.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:Y.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:Y.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:Y.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:Y.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it.")});var Qu=Y.enum(["text","number","unit","select","boolean"]),Gu=Y.enum(["mandatory","recommended","optional"]),yF=Y.object({key:Y.string().min(1).describe("Stable column key"),label:Y.string().min(1).describe("Human-readable column label"),type:Qu.describe("Column type"),unit:Y.string().optional().describe("Optional display unit"),mandation:Gu.describe("Field importance level"),description:Y.string().optional().describe("Optional field description"),standardRef:Y.string().optional().describe("Optional ontology reference"),options:Y.array(Y.string()).optional().describe("Allowed values for select columns"),hidden:Y.boolean().optional().describe("UI-hidden column. Still surfaced to agents in matrix TOON (with a `hidden` marker in the cols legend) and preserved across row mutations. Use for preset-internal linkage (e.g. stoichiometry `compoundId`).")}),VI=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])),uF=Y.enum(["generic","stoichiometry"]),wJ=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),kind:uF.optional().describe('Typed preset. Defaults to "generic". Use "stoichiometry" for reaction stoichiometry matrices (client-side calc engine derives m/V/n from M/ρ/equiv). When "stoichiometry", `columns` is ignored — the server fills in the stoichiometry preset.'),label:Y.string().min(1).describe("Matrix label shown in the editor"),columns:Y.array(yF).max(vI).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:Y.array(VI).optional().describe("Matrix rows"),nodeRef:Y.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:Y.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:Y.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:Y.string().optional().describe("Insert as CHILD of this container block"),childPosition:Y.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:Y.boolean().optional().default(!0).describe("Whether the structured matrix block should show its preview")}).refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{if($.kind==="stoichiometry")return!0;return($.columns?.length??0)>=1},{message:'`columns` is required for `kind="generic"` (omit or use `kind="stoichiometry"` for the preset).',path:["columns"]}),K0={name:"insert_matrix",description:"Create a structured data matrix AND insert its linked `structuredMatrix` block in one call.\n\nThe tool performs two writes atomically from the agent's perspective:\n1. Insert a new `data_matrices` row (columns + rows + label). The row starts at `version: 0`; all subsequent edits go through the `*_matrix_rows` / `rebind_matrix_to_node` / `delete_matrix` tools and each bumps `version`.\n2. Insert a `structuredMatrix` block referencing the new matrix id.\n\nTwo binding modes (both valid for records and documents):\n- **Body-level (default)**: omit `nodeRef`. The matrix belongs to the entity and the block lives at the top-level of the document/record body. Use this for free-standing tabular data (reagent inventory, condition sets attached to the whole experiment, etc).\n- **Node-attached**: pass `nodeRef` = procedure node UUID (records only). The matrix is logically scoped to that node and surfaces in `list_procedure_nodes` under that node's `matrixCount`. Use this when the matrix captures data produced inside a specific procedure step (e.g. readings per screening condition).\n\n**Typed presets via `kind`:**\n- `kind=\"generic\"` (default): supply your own `columns`.\n- `kind=\"stoichiometry\"`: choose this whenever you want reaction stoichiometry semantics — mixing reactants, reagents, solvents, catalysts, products and deriving the missing quantities. `columns` is ignored; the server fills the stoichiometry preset (Compound, Role, Phase, Equiv, Limiting, M, ρ, Purity, Stock c, Stock wt%, V, m, n, c, plus three hidden columns: `compoundId` linking to a `chemical` artifact, `cBasis` controlling how `c` is computed, and `cBasisManualVolume` for manual-basis rows).\n - Row shape: `{ compound, compoundId?, role, phase?, equiv?, limiting?, molecularWeight?, density?, purity?, stockMolarity?, stockWtPercent?, volume?, mass?, moles?, concentration?, cBasis?, cBasisManualVolume? }`.\n - **Phase grouping** (`phase` column): free-form text label that groups rows for per-phase volume totals. Use for biphasic syntheses (e.g. `phase: \"aqueous\"` vs `phase: \"oil\"`) or to sum per-mixture volumes within a single-pot reaction (e.g. `phase: \"aqueous\"` for water + dissolved CTAC + TEA). Leave blank for single-phase matrices. The UI renders a totals strip below the table; agents can read back via `get_content` to verify mass/volume balance per phase.\n - **Client-side calc engine auto-derives empty cells on every render. Do NOT pre-compute values you can leave null.** The identities propagated are: `n = m / M`, `n = V · c`, `m = V · ρ · purity` (neat liquids), `n = stockMolarity · V` (aqueous stock), `n = stockWtPercent · ρ_soln · V / M` (wt%-labelled stock), `n_i = equiv_i · n_limiting` (by row), and the reverse `equiv_i = n_i / n_limiting` (so molar ratios surface even when the user only entered masses). Derivation respects user-entered values — any non-null cell is treated as locked and never overwritten.\n - Limiting reactant: set `limiting: true` on exactly one reactant row (the engine also auto-picks the first reactant with enough info if none is flagged). Other reactants should carry `equiv` (molar ratio relative to limiting).\n - Units are fixed: M in g/mol, ρ in g/mL, V in mL, m in g, n in mmol, c in mol/L, purity as a decimal fraction (0–1), stockMolarity in mol/L, stockWtPercent in 0–100.\n - **Stock solution inputs**: for aqueous reagents (e.g. \"2 M NaOH\", \"25 wt% CTAC\"), prefer `stockMolarity` or `stockWtPercent` over `purity`. `purity` describes the dissolved compound itself (a neat liquid descriptor); `stockMolarity`/`stockWtPercent` describe the solution. Use only one of stockMolarity / stockWtPercent per row.\n - **Concentration basis** (`cBasis`, `cBasisManualVolume`): the displayed `c` is `n / V_ref` where the reference volume is picked per row. Defaults — solvent rows use `\"none\"` (c blank), non-solvent rows with a `phase` tag use `\"phase\"` (c relative to V_phase), other non-solvent rows use `\"total\"` (c relative to V_total). Leave `cBasis` null to inherit the default; explicit values are `\"none\" | \"phase\" | \"total\" | \"manual\"`. `\"manual\"` requires `cBasisManualVolume` (mL) and uses that as V_ref. Don't set these unless the user has chosen a non-default basis.\n - Minimal pattern for a reaction: one reactant with `{ role: 'reactant', limiting: true, equiv: 1, molecularWeight, mass OR volume }`; additional reactants with `{ role: 'reactant', equiv, molecularWeight }` (cells left null; the engine fills them from the limiting moles).\n\nIf a procedure node is later deleted, its matrices' `nodeRef` is cleared to null (FK `ON DELETE SET NULL`) and they surface in `list_procedure_nodes` as orphans — rebind via `rebind_matrix_to_node` or drop via `delete_matrix`.\n\nPositioning for the block:\n- `afterBlockId`: insert as SIBLING after the specified block\n- `beforeBlockId`: insert as SIBLING before the specified block\n- `parentBlockId`: insert as CHILD of a container block (e.g. inside a procedure section)\n- Omit all three: append the block at the end of the document. Safe for parallel `insert_matrix` calls — each one appends after the current tail, so agents can batch inserts instead of serialising on `afterBlockId`.\n\nExamples:\n- Body-level matrix appended after an existing block:\n `insert_matrix(entityType=\"record\", entityId=\"...\", afterBlockId=\"...\", label=\"Aqueous phase composition\", columns=[...], rows=[...])`\n- Node-attached matrix nested inside a procedure section:\n `insert_matrix(entityType=\"record\", entityId=\"...\", parentBlockId=\"...\", childPosition=\"last\", label=\"Screening Matrix\", columns=[...], rows=[...], nodeRef=\"...\")`\n\n**Record draft-gate:** matrices on records require the record to be in `draft` status. `completed` / `locked` records return a structured `record_not_draft` error — stop and surface it to the user; agents cannot flip record status themselves."};var bJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),rows:Y.array(VI).min(1).describe("New rows to append at the END of the existing rows array. **Row objects must be keyed by `col.key` (the stable column id), NOT `col.label`.** Unknown keys are retained in JSONB but never rendered and cannot be selected by `rowMatch` later. Call `get_content` on the owning entity first to read the column schema (`cols: key(Label,type[,unit])`)."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error with the actual version. Get the current version from `get_content` / `list_procedure_nodes` / prior tool output.")}),v0={name:"append_matrix_rows",description:["Append rows to the end of an existing data matrix (body-level or node-attached).","**Row objects must be keyed by `col.key`, not `col.label`.** Read the schema first via `get_content` on the owning entity; the matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Writing under a label-name that differs from the key persists opaque JSONB that the UI cannot render.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Prefer this over rewriting the entire matrix via the legacy path — row identity is preserved for downstream consumers.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): leave cells empty (`null`) whenever the client-side calc engine should derive them from the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Only persist values you explicitly measured or want to lock. For aqueous reagent stocks (NaOH(aq), CTAC(aq), TEA(aq)) prefer `stockMolarity` (mol/L) or `stockWtPercent` (0–100) over `purity`. Must preserve `compoundId` (hidden column) verbatim on any row you touch — it is the link to the chemical artifact that auto-fills M and ρ. Two more hidden row keys control how the displayed `c` is computed: `cBasis` (one of `null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = let the engine pick a default from role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user has explicitly set them.'].join(" ")};var XJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:Y.enum(["record","artifact","document","literature"]).describe("Owner entity type. Typical use: `record` or `artifact`. Literature attach is currently not supported server-side and will fail."),entityId:Y.string().uuid().describe("Owner entity UUID. The owner MUST live in the same workspace as the matrix, or the server rejects with invalid_matrix_owner."),nodeRef:Y.string().uuid().optional().describe("Optional: if provided, AND the owner is a record, also bind the matrix to this procedure node in the same call. The node must belong to `entityId`."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),V0={name:"attach_matrix",description:["Bind a workspace-owned (orphan) matrix to a provenance owner. Matrices become workspace-owned when their original record/document is deleted — the trigger promotes them instead of cascading. This tool claims them back to a new record or artifact in the same workspace.","Workspace match is enforced server-side: the owner entity MUST live in the same workspace as the matrix. Cross-workspace attach returns an `invalid_matrix_owner` error.","If `nodeRef` is provided and `entityType` is `record`, the matrix is also bound to that procedure node in the same call (combines attach + rebind). The node must belong to the target record.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error.","Only draft records are writable; attaching to a completed/locked record returns `record_not_draft`.","Use `list_matrix_references` first if you want to see which documents/records embed the matrix before attaching."].join(" ")};var DJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the matrix to inspect.")}),q0={name:"list_matrix_references",description:["List the entity_links that embed a data matrix, with each source's type, id, and display title. Matrix embeds are N:M (one matrix can be inserted in multiple records/documents via a `structuredMatrix` block).","Use before calling `delete_matrix` to understand the blast radius — deleting a matrix with embeds elsewhere leaves those blocks in an unlinked state.",'Also useful for analytical questions: "which documents reference matrix X?" or "is this matrix used outside its owner record?".',"Returns empty when the matrix has no embeds. Read-only; no version gate."].join(" ")};var qI=Y.enum(["procedure","characterization","observation","step"]),FI=Y.object({type:Y.literal("file"),target:Y.enum(["local","server","url"]),path:Y.string().min(1),format:Y.string().min(1),label:Y.string().min(1),instrument:Y.string().optional(),metadata:Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean()])).optional()}),lF=Y.object({artifactId:Y.string().uuid(),role:Y.enum(["input","output","derived_from","referenced"]),context:Y.record(Y.string(),Y.unknown()).optional()}),cF=Y.object({matrixId:Y.string().uuid()}),F0=Y.object({tempId:Y.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:Y.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:Y.string().min(1).describe("Human-readable node label."),type:qI.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:Y.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:Y.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:Y.array(FI).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:Y.array(lF).optional().describe("Existing artifacts to link to this node at creation time. Use when the agent already has artifactIds in context (e.g., from `search` or a prior `create_artifact` call). For new artifacts, prefer `create_artifact({ linkToNode })` instead. Failures on individual links are non-fatal — the node is still created and a per-node summary is returned."),matrices:Y.array(cF).optional().describe("Existing data matrices to bind to this node at creation time. Workspace orphans are attached + bound; matrices already owned by this record are rebound. Cross-record matrices are rejected (would steal them from the other tree). For new matrices, call `insert_matrix(nodeRef=…)` after the tree exists.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]});var mF=Y.enum(["replace","append"]),WJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:Y.array(F0).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:mF.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:Y.literal(!0).optional().describe('MUST be set to true when mode="replace" — model-level self-check that the caller understands the existing tree (and its orphaned matrices) will be cleared.'),rootParentId:Y.string().uuid().optional().describe("Append mode only — existing node uuid under which the new roots should be grafted. Omit to graft as top-level siblings.")}).refine(($)=>!($.mode==="replace"&&$.confirm!==!0),{message:'mode="replace" requires confirm: true — destructive operation.',path:["confirm"]}).refine(($)=>!($.mode==="replace"&&$.rootParentId!==void 0),{message:"rootParentId is only valid in append mode; replace wipes the tree first.",path:["rootParentId"]}),M0={name:"build_procedure_tree",description:["Atomically build or augment the procedure-node tree of an ELN record from a canonical JSON tree.","Input is a flat list of nodes using `tempId` / `parentTempId` references; the server remaps to real uuids and returns the mapping.","Modes:","- `append`: grafts the new subtree onto existing structure (either as new roots or under `rootParentId`).","- `replace` (destructive): deletes the entire existing tree first, then inserts the new one. **Requires `confirm: true`** and will orphan any matrices that were bound to deleted nodes — check with `list_procedure_nodes` first.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'`type === "observation"` nodes must have `copyable` omitted or `false`.',"For surgical edits to a single node prefer `insert_procedure_node` / `update_procedure_node` over a full rebuild."].join(" ")};var QJ=Y.object({title:Y.string().min(1).max(500).describe("Title for the new document"),content:Y.string().optional().describe("Optional initial content in markdown format"),organizationId:Y.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:Y.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:Y.string().uuid().optional().describe("Optional space ID. When provided the document is created inside that space and workspace/organization are derived from it. Caller must be a member of the space with write access. Omit for a private (workspace-only) document.")}),j0={name:"create_document",description:"Create a new document. By default the document is private to the user in their current workspace. Pass `spaceId` to create it inside a specific space (shared with space members); workspace and organization are then derived from the space automatically. Use this when the user asks you to create a new document, draft, or note. You can optionally provide initial content in markdown format."};var GJ=Y.object({title:Y.string().min(1).max(500).describe("Paper title"),doi:Y.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:Y.array(Y.string()).optional().describe('Author full names (e.g., ["John Smith", "Jane Doe"]). Omit when a DOI is available so the server can resolve authoritative metadata.'),journal:Y.string().optional().describe("Journal name"),year:Y.number().int().positive().optional().describe("Publication year"),sourceUrl:Y.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:Y.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:Y.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:Y.string().uuid().optional().describe("Space within workspace"),fetchFullText:Y.boolean().optional().default(!1).describe("When true, fetches full text from CORE and stores as structured content blocks. Requires DOI. Default false for metadata-only creation.")}),E0={name:"create_literature",description:"Import a research paper into the user's library. Creates a literature item with bibliographic metadata. If a DOI is provided, the server will try to resolve authoritative metadata before creating the item. Set fetchFullText=true to also fetch and parse the full text from CORE (requires DOI). If a DOI is provided and already exists in the library, returns the existing item (idempotent). Use this when the user explicitly asks to import or add a paper to their library."};var rF=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],Nu=["molecule","material","mixture","biomacromolecule"],d$$=Y.enum(Nu),nF=["active","depleted","archived","draft"],xD=Y.enum(rF),MI=Y.enum(nF),Yu=Y.enum(["merge","replace"]).default("merge").describe('How to apply `properties`. "merge" (default): top-level keys in `properties` are merged into the existing JSONB; pass `null` for a key to delete it. "replace": the supplied object fully overwrites the existing JSONB.'),NJ=Y.object({id:Y.string().uuid().describe("UUID of the artifact to update."),name:Y.string().min(1).optional().describe("Display name (skip to keep existing)."),description:Y.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:Y.array(Y.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:Y.record(Y.string(),Y.unknown()).optional().describe("Free-form JSONB blob. By default merged into existing properties (see `propertiesMode`). Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; chemical → cas_number, molecular_formula, supplier; equipment → model, serial, last_calibration. Advisory only — any keys allowed."),propertiesMode:Yu.optional(),artifactType:xD.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:MI.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:Y.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:Y.string().optional().describe("Free-form physical/logical location."),parentId:Y.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:Y.string().uuid().nullable().optional().describe("Template binding. Pass null to detach.")}).refine(($)=>$.name!==void 0||$.description!==void 0||$.tags!==void 0||$.properties!==void 0||$.artifactType!==void 0||$.status!==void 0||$.storageRef!==void 0||$.location!==void 0||$.parentId!==void 0||$.templateId!==void 0,{message:"Provide at least one field to update (name, description, tags, properties, artifactType, status, storageRef, location, parentId, templateId)."}),S0={name:"update_artifact",description:["Update non-identity fields of an artifact (name, description, tags, properties, artifactType, status, storageRef, location, parentId, templateId).",'`properties` (JSONB) is merged into the existing blob by default — pass `propertiesMode: "replace"` for full overwrite. Use null on a key in merge mode to delete it.',"Identity fields (id, workspaceId, orgId, createdBy*, sourceRecordId, deletedAt, timestamps) are never writable through this tool.","Soft-delete and link mutations have their own paths and are out of scope.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var iF=Y.object({cid:Y.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:Y.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:Y.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:Y.string().optional().describe("Compound name (IUPAC, common, brand). Resolved via PubChem name search; uses the top match.")}).refine(($)=>$.cid||$.cas||$.inchiKey||$.name,{message:"enrichFromPubchem requires at least one of: cid, cas, inchiKey, name"}),YJ=Y.object({name:Y.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:xD.describe('sample | dataset | protocol | file | equipment | chemical | model | reaction. `chemical` is the substance (one per workspace per InChIKey/CCDC); `sample` is a physical instance of a chemical (set `parentId` to the chemical artifact). `reaction` is a sibling type — a transformation (e.g. "Suzuki coupling"), never a sub-flavor of chemical.'),workspaceId:Y.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org (any organizationId passed alongside is ignored). When omitted, falls back to the user's first workspace."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace. Auto-resolved to the user's first org only when nothing more specific is passed."),description:Y.string().optional().describe("Plain-text description."),tags:Y.array(Y.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:Y.record(Y.string(),Y.unknown()).optional().describe(["Free-form JSONB blob. Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; equipment → model, serial, last_calibration; reaction → transformation_class (required: molecular | sol_gel | polymerization | crystallization | self_assembly | mechanochemistry | biological | other), transformation_summary (free-text for non-molecular), rxn_smiles (molecular only), precursor_smiles, reaction_class, description.",'For chemical artifacts, set `properties.structureClass` to one of: "molecule" (default; PubChem-shaped — iupac_name, molecular_formula, cas_number, canonical_smiles, inchi, inchi_key, molecular_weight, density, ghs_*, …), "material" (MOFs/COFs/zeolites/perovskites — topology, space_group, unit_cell, ccdc_number, framework_formula, bet_surface_area, pore_volume, pore_size, skeletal_density), "mixture" (solutions/electrolytes — components JSON-array of `{artifactId, ratio, role?}`, solvent, concentration_basis), or "biomacromolecule" (proteins/oligonucleotides — uniprot_id, pdb_id, sequence, molecular_weight, pi).',"The server validates keys against the chosen class's typed schema and returns near-match suggestions for likely typos (warn-but-accept). Unknown keys are stored either way; the warning surfaces in the response so you can self-correct on the next call.","Advisory only — any keys allowed."].join(" ")),status:MI.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:Y.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:Y.string().optional().describe("Free-form physical/logical location."),parentId:Y.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:Y.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:Y.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:iF.optional().describe('When set and artifactType is "chemical" with structureClass molecule (or absent), resolve the identifier (cid > inchiKey > cas > name) and auto-fill missing properties from PubChem. Agent-supplied properties always win — enrichment never overwrites. PubChem does NOT index periodic materials, mixtures, biomacromolecules, or reactions, so this is a no-op (logged) for those classes. Failures (no match, PubChem unreachable) do NOT block creation; the artifact is still created with whatever was provided, and the enrichment status is reported in the result.'),linkToNode:Y.object({nodeId:Y.string().uuid(),role:Y.enum(["input","output","derived_from","referenced"]),context:Y.record(Y.string(),Y.unknown()).optional()}).optional().describe("When set, immediately link the newly-created artifact to this procedure node. Equivalent to: `create_artifact(...)` → `link_artifact_to_node({ nodeId, artifactId, role })` — provided as a convenience for the common create-and-link flow. Per-link failures are non-fatal: the artifact is still created and the link error is surfaced in the response.")}),P0={name:"create_artifact",description:["Create a new artifact (sample, dataset, protocol, file, equipment, chemical, model, or reaction).","Pass `workspaceId` to control where it lands; otherwise the user's first workspace is used. Artifacts are workspace-level — there is no space association.",'`createdBySource` is forced to "agent" — never user-controllable through this tool.',"`properties` is free-form JSONB; advisory keys per type are listed in the field description but never enforced.","For molecular chemical artifacts: prefer `enrichFromPubchem: { cas | cid | inchiKey | name }` over hand-assembling properties — the server canonicalizes via PubChem, dedups by InChIKey within the workspace, and auto-fills SMILES/InChI/formula/MW/GHS/transport/descriptors with fillIfAbsent semantics (your `properties` always win). Enrichment failures don't block creation.",'For periodic materials (MOFs/COFs/zeolites/perovskites): set `properties.structureClass = "material"` and supply the structural identity tuple (topology + space_group + unit_cell + ccdc_number) by hand — PubChem does NOT index periodic structures.','For mixtures (solutions/electrolytes): set `properties.structureClass = "mixture"` and reference component chemicals via `properties.components` (JSON array of {artifactId, ratio, role?}). Each component should already exist as a chemical artifact in the workspace.','For reactions: set `artifactType = "reaction"` and supply `properties.transformation_class` — one of: molecular, sol_gel, polymerization, crystallization, self_assembly, mechanochemistry, biological, other. For `molecular` reactions also supply `rxn_smiles`. For everything else write a short `transformation_summary` describing what is actually happening. Reactions are sibling artifacts, not chemicals.','For samples (physical instances of a chemical): set `artifactType = "sample"` and `parentId = <chemical artifact id>`; the chemical\'s typed properties flow through the UI when the sample is displayed.',"Use this when the user asks to register a new sample, dataset, instrument, chemical, material, mixture, or reaction. To attach the new artifact to a procedure node, pass `linkToNode` (artifact + node + role) — atomic create-and-link.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var BJ=Y.object({title:Y.string().min(1).max(500).describe("Title for the new record."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when spaceId or workspaceId is provided — derived from the parent scope. Auto-resolved to the user's first org only when nothing more specific is passed."),workspaceId:Y.string().uuid().optional().describe("Workspace ID. Ignored when spaceId is provided — derived from the space. Otherwise the workspace's organizationId is used as the record's org (any organizationId passed alongside is ignored)."),spaceId:Y.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:Y.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Expected YYYY-MM-DD").optional().describe("ISO date (YYYY-MM-DD) of the research activity, used for calendar navigation. Defaults to today."),recordType:Y.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:Y.array(Y.string().uuid()).optional().describe("User ids participating in this research activity."),initialTree:Y.array(F0).optional().describe("Optional flat procedure-tree list built via parentTempId. Inserted after the record is created; on success the response carries a tempId → nodeId map.")}),k0={name:"create_record",description:["Create a new ELN research record in the user's workspace.","Records are always created in `draft` status and begin empty — you can populate the prose body with the edit tools afterwards.","Pass `spaceId` to attach the record to a specific space; otherwise it lives at workspace level only.","Provide `initialTree` to stand up the procedure-node tree in the same call (topological insert, parentTempId → parentId).",'`type === "observation"` nodes are required to have `copyable === false` (or omitted).',"Use this when the user asks you to create a new record, experiment entry, or lab notebook page."].join(" ")};var JJ=Y.object({recordId:Y.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),R0={name:"list_procedure_nodes",description:["List the procedure-tree nodes of a record as a flat, token-dense table.","Returns each node's `id`, `parentId`, `order`, `type`, `label`, `copyable`, and live counts of attached matrices, artifact links, and analytical-data file references.","Also emits an `[attachedMatrices]` block with each node-bound matrix's `{matrixId, label, version, rows, cols}` — the `cols` cell uses pipe-separated `key(Label/type[/unit])` entries so you can write `append_/update_/delete_matrix_rows` without an extra `get_content` round-trip.","Orphaned matrices (nodeRef cleared by a node deletion) appear in a separate block with the same schema so they can be rebound via `rebind_matrix_to_node` or dropped via `delete_matrix`.","Use this before editing the tree; reconstruct hierarchy from `parentId` + `order` and pick keys/version for matrix row writes straight from the output."].join(" ")};var HJ=Y.object({reactionArtifactId:Y.string().uuid().describe('UUID of the reaction artifact to derive the stoichiometry matrix from. Must be `artifactType: "reaction"` — other types return an error.'),workspaceId:Y.string().uuid().describe("Workspace scope. Must match the reaction artifact and (if provided) the target entity."),entityType:Y.enum(["record","artifact","document","literature"]).optional().describe("Owner entity type for the spawned matrix. Omit to create a workspace-orphan matrix. Typical use: `record` paired with a `nodeRef`."),entityId:Y.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:Y.string().uuid().optional().describe('Procedure node UUID. When set with `entityType: "record"`, also ensures a procedure_node ↔ reaction artifact link exists (idempotent — duplicate calls are safe).'),label:Y.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>".')}),T0={name:"create_matrix_from_reaction_artifact",description:["Derive a stoichiometry matrix from a saved reaction artifact. Walks the artifact's `linkSlots` (typed component slots: reactant / product / reagent / catalyst / solvent), pulls each linked chemical artifact's name + MW + density, and emits one matrix row per bound slot using the slot's stoichCoefficient. Stamps `derivedFromArtifactId` on the matrix for provenance.","Frozen invariant: edits to the artifact never propagate forward to the spawned matrix; this is a one-shot copy at instantiation time.",'When `entityType: "record"` + `nodeRef` are set, the matrix is bound to the procedure node AND a `procedure_node → reaction artifact` link is ensured (created if absent). One call replaces "link reaction to node" + "spawn matrix" + "bind to node."',"Slots without a `defaultArtifactId` are skipped (no row emitted). The user can fill in those rows by hand on the derived matrix.","Returns the new matrix in the same shape as `insert_matrix`."].join(" ")};var hD=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),blockId:Y.string().optional().describe("Block ID to delete (for single delete)"),blockIds:Y.array(Y.string()).max(gD).optional().describe(`Array of block IDs to delete (batch mode, max ${gD})`)}),Bu=hD.refine(($)=>{let I=$.blockId!==void 0,U=$.blockIds!==void 0&&$.blockIds.length>0;return I!==U},{message:"Provide either blockId (single delete) or blockIds (batch delete), not both"}),_0={name:"delete_block",description:"Delete blocks from a document. Supports single (blockId) or batch (blockIds) mode. Batch mode is more efficient for deleting multiple blocks in one operation. Be careful - this permanently removes blocks and their content. Use get_content first to verify blocks before deleting. "+"Records: only `draft` records are writable; `completed`/`locked` records return a `record_not_draft` error — do not try to flip the status yourself. "+"Do NOT attempt to delete `procedureTree`, `procedureSection`, or `nodeArtifacts` blocks on records — those are sync projections of table-backed rows and re-render on every sync; use the `*_procedure_node` tools to mutate the tree instead."};var AJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the matrix to delete."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error."),acknowledgeDataLoss:Y.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting the matrix removes all rows AND the linked structuredMatrix block from the owning document/record. Not recoverable outside of version snapshots.")}),Z0={name:"delete_matrix",description:["Delete a data matrix row AND the `structuredMatrix` block that references it in the owning document/record. Both writes happen in the same tool call.","Requires `acknowledgeDataLoss: true` as a model-level self-check — prefer `delete_matrix_rows` or `rebind_matrix_to_node` for less-destructive edits.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Undo path: `record_versions` snapshots capture matrix state together with Y.js content when a version is cut, so a prior snapshot restore can recover an accidentally deleted matrix for records under version control."].join(" ")};var Ju=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),OJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),rowIndices:Y.array(Y.number().int().min(0)).min(1).optional().describe("Absolute 0-based indices of rows to delete in the current rows array. Indices resolve against the pre-delete snapshot (batch-safe)."),rowMatch:Ju.optional(),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}).refine(($)=>{let I=$.rowIndices!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndices` (absolute indices) or `rowMatch` (by column values).",path:["rowIndices"]}),C0={name:"delete_matrix_rows",description:["Remove rows from an existing data matrix, either by absolute `rowIndices` or by `rowMatch` (every column/value in the match must equal the row's current cell). Match mode deletes every row that satisfies the criteria.","**`rowMatch` MUST use `col.key` as each object key, NOT `col.label`** — the schema is visible via `get_content` on the owning entity (`cols: key(Label,type[,unit])` + `{key1,key2,...}` row header).","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","To remove the matrix itself (row + structuredMatrix block) use `delete_matrix`. This tool only prunes rows.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var zJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:Y.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting a node cascades to all descendants via FK and orphans any bound matrices (matrix.nodeRef → null).")}),g0={name:"delete_procedure_node",description:["Delete a procedure-tree node and all of its descendants (FK cascade).","Any matrices bound to deleted nodes have their `nodeRef` cleared — the response lists the orphaned matrix ids so the agent can rebind or drop them via the matrix tools.","Requires `acknowledgeCascade: true` as a model-level self-check — check `list_procedure_nodes` before deleting to understand the subtree you are about to remove.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var LJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:Y.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:Y.string().min(1).describe("Human-readable node label."),type:qI.describe("Node type."),afterNodeId:Y.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:Y.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:Y.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:Y.array(FI).optional().describe("File references attached to the new node.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>!($.afterNodeId&&$.order!==void 0),{message:"Provide either afterNodeId (relative) OR order (absolute), not both.",path:["afterNodeId"]}),x0={name:"insert_procedure_node",description:["Insert a single procedure-tree node under a draft record.","Positioning: `afterNodeId` (place right after an existing sibling) OR `order` (explicit 0-indexed slot) — omit both to append at the end.","`parentId` must be an existing node UUID in the same record; omit for a new root.",'`type === "observation"` must have `copyable` omitted or `false`.',"Only draft records are writable; completed/locked records return a `record_not_draft` error.","For bulk construction prefer `build_procedure_tree` instead."].join(" ")};var KJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),nodeRef:Y.union([Y.string().uuid(),Y.null()]).describe("Target procedure node UUID, or null to detach (body-level matrix). The node must belong to the same record that owns the matrix. Passing the same value as the current nodeRef is a no-op but still bumps version."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),h0={name:"rebind_matrix_to_node",description:["Change a matrix's procedure-node binding. Three modes via one tool: (a) promote a body-level matrix to a node-attached one (`nodeRef` = new node UUID, current was null), (b) move a node-attached matrix to a different node under the same record, (c) detach a node-attached matrix back to body level (`nodeRef: null`).","The matrix must be record-owned (documents/literature/artifacts have no procedure tree). The target `nodeRef`, when non-null, must reference a node that belongs to the SAME record as the matrix.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var vJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:Y.string().uuid().describe("UUID of the artifact to link. Use `search` first to discover existing artifacts, or call `create_artifact` and pass its `linkToNode` shortcut to skip this tool."),role:Y.enum(["input","output","derived_from","referenced"]).describe("Role the artifact plays at this node. `input` = consumed/used (e.g., a starting material on a procedure step). `output` = produced/generated (e.g., a sample emerging from a step). `derived_from` = this step's design/procedure was adapted from the artifact (e.g., reaction artifact serving as the recipe template). `referenced` = the step references the artifact without consuming or producing it (e.g., a reaction artifact, equipment manual, or literature item it documents). Pick by direction of flow / nature of the relationship."),context:Y.record(Y.string(),Y.unknown()).optional().describe('Optional structured context describing the link (e.g., `{quantity: "2.5 g", purpose: "limiting reagent"}`). Free-form JSONB; mirrors the UI surface.')}),f0={name:"link_artifact_to_node",description:['Bind an existing artifact to a procedure node by creating an `artifact_links` row with `source_type=procedure_node`. Mirrors the node inspector "Link artifact" affordance and is the agent equivalent of `attach_matrix` for matrices.',"The artifact must already exist — to create + link in one call, use `create_artifact({ linkToNode: { nodeId, role } })` instead.","Role semantics: `input` (consumed/used at this step), `output` (produced/generated), `derived_from` (this step adapts another artifact as its recipe — e.g., a reaction artifact serving as the procedure template), `referenced` (the step references the artifact without consuming/producing — e.g., equipment manuals, literature, reaction artifacts). Pick by direction of flow / nature of the relationship.","The mutation does NOT enforce same-record / same-workspace scope on the artifact — `artifact_links` is polymorphic by design (artifacts can be referenced across the workspace). The node's record drives the surface where the link appears.","Returns the new `linkId` so subsequent `unlink_artifact_from_node({ linkId })` calls don't need to re-query."].join(" ")};var VJ=Y.object({linkId:Y.string().uuid().describe("UUID of the `artifact_links` row to delete. Returned by `link_artifact_to_node` and `list_node_artifact_links`.")}),y0={name:"unlink_artifact_from_node",description:["Remove an artifact ↔ procedure-node link by `linkId`. The artifact and the node both stay; only the join row is dropped.","Use `list_node_artifact_links({ nodeId })` first if you only know the node + artifact identifiers — the link id is the join-row uuid, not the artifact id.","Idempotent at the user level: deleting a non-existent link returns `success: true` with `id` echoed (delete-by-id is a no-op on missing rows in the underlying repo)."].join(" ")};var qJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),u0={name:"list_node_artifact_links",description:["List all artifact ↔ procedure-node links for a given node. Returns one row per link with `linkId`, `artifactId`, `artifactName`, `artifactType`, `role`, `context`, and `createdAt`.",'Mirrors the node inspector "Artifacts" panel; use this before `unlink_artifact_from_node` when you only know the artifact id (the link id is the join-row uuid, not the artifact id).'].join(" ")};var oF=Y.object({nodeId:Y.string().uuid().describe("UUID of the node to move/reorder."),parentId:Y.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:Y.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),FJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),moves:Y.array(oF).min(1).describe("Batch of reparent/reorder operations applied together. Each entry carries the node's final parent and order — siblings you don't move keep their current values, so typically you pass moves for the whole sibling set you're rearranging.")}),l0={name:"reorder_procedure_nodes",description:["Batch reparent / reorder procedure-tree nodes in a draft record.","Each move carries the *final* `parentId` + `order` — think of it as a transaction that describes the desired post-state.","Any nodes you omit from `moves` keep their current parent/order, so you usually include the whole sibling set being rearranged.","All moves must target nodes in the same record; cross-record moves are rejected.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var Hu=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold (not just the first)."),Au=Y.object({rowIndex:Y.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:Hu.optional(),values:VI.describe("Partial row patch. **Keys MUST match `col.key` (the column id), NOT `col.label`.** Keys present here overwrite the matching rows' cells. Keys not in `values` retain their existing values. Set a key to null to clear a cell.")}).refine(($)=>{let I=$.rowIndex!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndex` (absolute) or `rowMatch` (by column values).",path:["rowIndex"]}),MJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),updates:Y.array(Au).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),c0={name:"update_matrix_rows",description:["Patch cells in an existing data matrix. Each update targets rows by `rowIndex` (absolute 0-based) OR `rowMatch` (every provided column/value must equal the row's current cell); partial column updates are allowed.","**All row-keyed objects (`values`, `rowMatch`) MUST use `col.key` as the object key, NOT `col.label`.** Read the schema first via `get_content` on the owning entity — its matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Mismatched keys persist as opaque JSONB that the UI cannot render.","Match mode updates every row that satisfies the criteria — use it when the match is unique, or when you intend to update a whole group at once.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Set a `values` entry to null to clear a cell. Keys not present in `values` are untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): clearing a numeric cell to null re-enables client-side derivation via the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Keys not in `values` stay untouched — use this to preserve the hidden `compoundId` link to a chemical artifact while patching other cells. Do not manually recompute derived quantities; write only measured or locked-in values. For aqueous stock solutions, set `stockMolarity` (mol/L) or `stockWtPercent` (0–100) rather than approximating via `purity` × `density`. The displayed `c` is computed against a per-row reference volume controlled by two hidden keys: `cBasis` (`null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = engine picks default by role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user explicitly set them.'].join(" ")};var jJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the existing procedure node to update."),label:Y.string().min(1).optional().describe("New label (skip to keep existing)."),type:qI.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:Y.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:Y.array(FI).optional().describe("Replace the current `analyticalData` list with this one. Pass an empty array to clear it; omit to leave it untouched.")}).refine(($)=>{if($.type!=="observation")return!0;return $.copyable===void 0||$.copyable===!1},{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>$.label!==void 0||$.type!==void 0||$.copyable!==void 0||$.analyticalData!==void 0,{message:"Provide at least one field to update (label, type, copyable, analyticalData)."}),m0={name:"update_procedure_node",description:["Update non-structural fields of a procedure-tree node (label, type, copyable, analyticalData).","Structural changes (move / reorder) go through `reorder_procedure_nodes` — this tool never touches parentId or order.",'`type === "observation"` implies `copyable = false`; setting both to a conflicting combination is rejected.',"Passing an empty `analyticalData` array clears the file-ref list; omitting the field leaves it untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};function k$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let b=String(U);return b.includes(",")?`"${b}"`:b}).join(",")}`}function fD($){if(!$)return"";let I=[];if($.previousBlock)I.push(`After: [${$.previousBlock.type} | ${$.previousBlock.id}]`);if($.nextBlock)I.push(`Before: [${$.nextBlock.type} | ${$.nextBlock.id}]`);return I.join(", ")}function tF($,I,U=150){let b=0,w=Math.min($.length,I.length);while(b<w&&$[b]===I[b])b++;let X=0;while(X<w-b&&$.at(1+X)===I.at(1+X))X++;let D=Math.floor(U/2),W=Math.max(0,b-D),Q=Math.min($.length,$.length-X+D),G=Math.min(I.length,I.length-X+D),N=W>0?"...":"",B=Q<$.length?"...":"",H=G<I.length?"...":"",J=`${N}${$.slice(W,Q)}${B}`,A=`${N}${I.slice(W,G)}${H}`;return`--- before
65
65
  ${J}
66
66
  +++ after
67
67
  ${A}`}function EJ($){let I=[];I.push(`[workspace context | default org:${$.defaults.orgId}${$.defaults.workspaceId?` ws:${$.defaults.workspaceId}`:""}]`);let U=0,b=[];for(let w of $.orgs)for(let X of w.workspaces)if(X.spaces.length===0)b.push(k$([w.name,w.id,X.name,X.id,X.type,"","",""])),U++;else for(let D of X.spaces)b.push(k$([w.name,w.id,X.name,X.id,X.type,D.name,D.id,D.type])),U++;return I.push(`{org,orgId,workspace,wsId,wsType,space,spaceId,spaceType}[${U}]:`),I.push(...b),I.join(`
68
68
  `)}function SJ($){let{mode:I,found:U,hasMore:b}=$;if(U===0)return`[results:0 found, ${I}]
69
69
  No results.`;let w=[I,...b?["hasMore"]:[]].join(", "),X=[`[results:${U} found, ${w}]`];if(I==="library"){let D=$.results,W=D.some((B)=>B.literatureMetadata),Q=D.some((B)=>B.creatorName),G=W?"{type,title,id,relevance,tags,doi,firstAuthor,year,journal":"{type,title,id,relevance,tags",N=Q?`${G},creator,snippet}`:`${G},snippet}`;X.push(`${N}[${D.length}]:`);for(let B of D){let H=B.bestSnippet??B.snippet??"",J=H.length>120?`${H.slice(0,117)}...`:H,A=B.tags?.join(" | ")??"",O=B.creatorName??"";if(W){let V=B.literatureMetadata,q=[B.entityType,B.entityTitle,B.entityId,B.relevance,A,V?.doi??"",V?.firstAuthor??"",V?.year??"",V?.journal??""];if(Q)q.push(O);q.push(J),X.push(k$(q))}else{let V=[B.entityType,B.entityTitle,B.entityId,B.relevance,A];if(Q)V.push(O);V.push(J),X.push(k$(V))}}}else{let D=$.results,W=D.some((G)=>G.creatorName),Q=W?"{type,title,entityId,blockId,creator,snippet}":"{type,title,entityId,blockId,snippet}";X.push(`${Q}[${D.length}]:`);for(let G of D){let N=G.bestSnippet??G.snippet??"",B=N.length>120?`${N.slice(0,117)}...`:N,H=[G.entityType,G.entityTitle,G.entityId,G.blockId];if(W)H.push(G.creatorName??"");H.push(B),X.push(k$(H))}}return X.join(`
70
- `)}function tF($){if($.length===0)return"";let I=[`[toc:${$.length} sections]`,`{title,level,tokens,ownTokens,blockId}[${$.length}]:`];for(let U of $)I.push(k$([U.title,U.level,U.estimatedTokens??0,U.ownTokens??0,U.blockId]));return I.join(`
71
- `)}function Au($){if($.length===0)return"";let I=[`[regions:${$.length}]`,`{title,kind,tokens,blocks,retrievalHint}[${$.length}]:`];for(let U of $)I.push(k$([U.title,U.kind,U.estimatedTokens??0,U.blockCount,U.retrievalHint]));return I.join(`
72
- `)}function oF($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function PJ($){let I=[];if(I.push(`**"${$.entityTitle}"** - ${$.entityType}`),$.creatorName)I.push(`*by ${$.creatorName}*`);if($.bibliographic){let U=$.bibliographic,b=[];if(U.authors?.length)b.push(U.authors.length<=3?U.authors.join(", "):`${U.authors[0]} et al.`);if(U.journal)b.push(U.journal);if(U.volume){let w=U.volume;if(U.issue)w+=`(${U.issue})`;if(U.pages)w+=`, ${U.pages}`;b.push(w)}if(U.year)b.push(String(U.year));if(b.length>0)I.push(b.join(", "));if(U.doi)I.push(`DOI: ${U.doi}`);if(U.pmid)I.push(`PMID: ${U.pmid}`);if(U.arxivId)I.push(`arXiv: ${U.arxivId}`);if(U.tags&&U.tags.length>0)I.push(`Tags: ${U.tags.join(", ")}`)}if($.error)return I.push(""),I.push(`**Error:** ${$.error}`),I.join(`
73
- `);if($.overview){if($.overview.wordCount)I.push(`*~${$.overview.wordCount} words*`);if(I.push(""),$.overview.abstract)I.push("**Preview:**"),I.push($.overview.abstract),I.push("");if($.overview.toc&&$.overview.toc.length>0)I.push("**Table of Contents:**"),I.push(tF($.overview.toc));if($.overview.regions&&$.overview.regions.length>0){if($.overview.toc&&$.overview.toc.length>0)I.push("");I.push("**Additional Retrievable Regions:**"),I.push(Au($.overview.regions))}}if($.procedureTree)I.push(""),I.push("**Procedure Tree:**"),I.push($.procedureTree);if($.connections&&$.connections.total>0){if(I.push(""),I.push(`**Connections** (${$.connections.total} edges):`),$.connections.outgoing.length>0){I.push(""),I.push("*Outgoing (this entity → others):*");for(let U of $.connections.outgoing){let b=U.referenceType==="annotation"?"\uD83D\uDCDD":U.referenceType==="citation"?"\uD83D\uDCD6":"↗",w=U.entityTitle||U.entityId.slice(0,8),X=oF(U.entityType,U.entityId);if(U.edgeText)I.push(` ${b} → ${U.entityType}: ${w} (${X})`),I.push(` "${U.edgeText}"`);else I.push(` ${b} → ${U.entityType}: ${w} (${X}, ${U.referenceType})`)}}if($.connections.incoming.length>0){I.push(""),I.push("*Incoming (others → this entity):*");for(let U of $.connections.incoming){let b=U.referenceType==="annotation"?"\uD83D\uDCDD":U.referenceType==="citation"?"\uD83D\uDCD6":"↙",w=U.entityTitle||U.entityId.slice(0,8),X=oF(U.entityType,U.entityId);if(U.edgeText)I.push(` ${b} ← ${U.entityType}: ${w} (${X})`),I.push(` "${U.edgeText}"`);else I.push(` ${b} ← ${U.entityType}: ${w} (${X}, ${U.referenceType})`)}}}if($.markdown){if(I.push(""),$.format==="interleaved")I.push("**Content (with block IDs for editing):**");else I.push("**Markdown Content:**");I.push(""),I.push($.markdown)}if($.sectionInfo){if(I.push(""),I.push(`*Section: ${$.sectionInfo.blockCount} blocks, ${$.sectionInfo.wordCount} words*`),$.sectionInfo.warning)I.push(`*Warning: ${$.sectionInfo.warning}*`)}if($.refs&&$.refs.length>0)I.push(""),I.push("**References:**"),I.push("```json"),I.push(JSON.stringify($.refs,null,2)),I.push("```");return I.join(`
70
+ `)}function aF($){if($.length===0)return"";let I=[`[toc:${$.length} sections]`,`{title,level,tokens,ownTokens,blockId}[${$.length}]:`];for(let U of $)I.push(k$([U.title,U.level,U.estimatedTokens??0,U.ownTokens??0,U.blockId]));return I.join(`
71
+ `)}function Ou($){if($.length===0)return"";let I=[`[regions:${$.length}]`,`{title,kind,tokens,blocks,retrievalHint}[${$.length}]:`];for(let U of $)I.push(k$([U.title,U.kind,U.estimatedTokens??0,U.blockCount,U.retrievalHint]));return I.join(`
72
+ `)}function dF($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function PJ($){let I=[];if(I.push(`**"${$.entityTitle}"** - ${$.entityType}`),$.creatorName)I.push(`*by ${$.creatorName}*`);if($.bibliographic){let U=$.bibliographic,b=[];if(U.authors?.length)b.push(U.authors.length<=3?U.authors.join(", "):`${U.authors[0]} et al.`);if(U.journal)b.push(U.journal);if(U.volume){let w=U.volume;if(U.issue)w+=`(${U.issue})`;if(U.pages)w+=`, ${U.pages}`;b.push(w)}if(U.year)b.push(String(U.year));if(b.length>0)I.push(b.join(", "));if(U.doi)I.push(`DOI: ${U.doi}`);if(U.pmid)I.push(`PMID: ${U.pmid}`);if(U.arxivId)I.push(`arXiv: ${U.arxivId}`);if(U.tags&&U.tags.length>0)I.push(`Tags: ${U.tags.join(", ")}`)}if($.error)return I.push(""),I.push(`**Error:** ${$.error}`),I.join(`
73
+ `);if($.overview){if($.overview.wordCount)I.push(`*~${$.overview.wordCount} words*`);if(I.push(""),$.overview.abstract)I.push("**Preview:**"),I.push($.overview.abstract),I.push("");if($.overview.toc&&$.overview.toc.length>0)I.push("**Table of Contents:**"),I.push(aF($.overview.toc));if($.overview.regions&&$.overview.regions.length>0){if($.overview.toc&&$.overview.toc.length>0)I.push("");I.push("**Additional Retrievable Regions:**"),I.push(Ou($.overview.regions))}}if($.procedureTree)I.push(""),I.push("**Procedure Tree:**"),I.push($.procedureTree);if($.connections&&$.connections.total>0){if(I.push(""),I.push(`**Connections** (${$.connections.total} edges):`),$.connections.outgoing.length>0){I.push(""),I.push("*Outgoing (this entity → others):*");for(let U of $.connections.outgoing){let b=U.referenceType==="annotation"?"\uD83D\uDCDD":U.referenceType==="citation"?"\uD83D\uDCD6":"↗",w=U.entityTitle||U.entityId.slice(0,8),X=dF(U.entityType,U.entityId);if(U.edgeText)I.push(` ${b} → ${U.entityType}: ${w} (${X})`),I.push(` "${U.edgeText}"`);else I.push(` ${b} → ${U.entityType}: ${w} (${X}, ${U.referenceType})`)}}if($.connections.incoming.length>0){I.push(""),I.push("*Incoming (others → this entity):*");for(let U of $.connections.incoming){let b=U.referenceType==="annotation"?"\uD83D\uDCDD":U.referenceType==="citation"?"\uD83D\uDCD6":"↙",w=U.entityTitle||U.entityId.slice(0,8),X=dF(U.entityType,U.entityId);if(U.edgeText)I.push(` ${b} ← ${U.entityType}: ${w} (${X})`),I.push(` "${U.edgeText}"`);else I.push(` ${b} ← ${U.entityType}: ${w} (${X}, ${U.referenceType})`)}}}if($.markdown){if(I.push(""),$.format==="interleaved")I.push("**Content (with block IDs for editing):**");else I.push("**Markdown Content:**");I.push(""),I.push($.markdown)}if($.sectionInfo){if(I.push(""),I.push(`*Section: ${$.sectionInfo.blockCount} blocks, ${$.sectionInfo.wordCount} words*`),$.sectionInfo.warning)I.push(`*Warning: ${$.sectionInfo.warning}*`)}if($.refs&&$.refs.length>0)I.push(""),I.push("**References:**"),I.push("```json"),I.push(JSON.stringify($.refs,null,2)),I.push("```");return I.join(`
74
74
  `)}function kJ($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
75
75
  Title: ${$.title}
76
76
  ID: ${$.documentId}`}function RJ($){if(!$.success)return`Failed to import literature: ${$.error}`;if($.alreadyExisted){let U=`Already in library: ${$.title} (id: ${$.literatureId})`;if($.coreEnriched)return`${U}
@@ -82,7 +82,7 @@ Full text: CORE enrichment in progress -- content available shortly via get_cont
82
82
  Label: ${$.label}
83
83
  Matrix ID: ${$.matrixId}
84
84
  Block ID: ${$.blockId}`}function _J($){if(!$.success)return`Failed to create matrix from reaction: ${$.error}`;let I=$.rowsCreated??0,U=["Stoichiometry matrix derived from reaction artifact.",`Label: ${$.label}`,`Matrix ID: ${$.matrixId}`,`Reaction artifact ID: ${$.reactionArtifactId}`,`Rows created: ${I}`];if(I===0)U.push("Note: the reaction artifact has no bound linkSlots — the matrix has the stoichiometry columns but no rows. Use append_matrix_rows to add components, or bind defaultArtifactId on the slots first.");return U.join(`
85
- `)}function ZJ($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(pF($.originalText,$.updatedText));let U=fD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
85
+ `)}function ZJ($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(tF($.originalText,$.updatedText));let U=fD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
86
86
 
87
87
  `)}function CJ($){if(!$.success)return`Insert failed: ${$.error}`;if($.newBlockIds&&$.newBlockIds.length>0){let b=[`Inserted ${$.newBlockIds.length} blocks:`];if($.results){for(let w of $.results)if(w.success&&w.newBlockId){let X=w.blockType??"paragraph",D=w.contentPreview?`: ${w.contentPreview.slice(0,60)}${w.contentPreview.length>60?"...":""}`:"";b.push(` [${X} | ${w.newBlockId}]${D}`)}}return b.join(`
88
88
  `)}let I=[`Block inserted. ID: ${$.newBlockId}`];if($.insertedBlock){let{blockType:b,content:w}=$.insertedBlock,X=w.length>200?`${w.slice(0,200)}...`:w;if(I.push(`Type: ${b}`),X)I.push(`Content: ${X}`)}let U=fD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
@@ -90,16 +90,17 @@ Block ID: ${$.blockId}`}function _J($){if(!$.success)return`Failed to create mat
90
90
  `)}let I=[];if($.deletedBlock){let{blockType:b,contentPreview:w}=$.deletedBlock;if(I.push(`Deleted [${b} | ${$.deletedBlock.blockId}]`),w)I.push(`Was: ${w}`)}else I.push("Block deleted");let U=fD($.positionContext);if(U)I.push(`New adjacency: ${U}`);return I.join(`
91
91
  `)}function xJ($){if(!$.success)return $.error??"create_record failed";let I=[`[record created | id=${$.recordId??""}]`,$.title?`title: ${$.title}`:"",$.workspaceId?`workspace: ${$.workspaceId}`:"",$.spaceId?`space: ${$.spaceId}`:"space: —"].filter(Boolean).join(`
92
92
  `),U=$.nodeIdMap?Object.entries($.nodeIdMap):[];if(U.length===0)return I;let b=U.map(([w,X])=>k$([w,X]));return[I,"",`{tempId,nodeId}[${U.length}]:`,...b].join(`
93
- `)}function hJ($){if(!$.success)return $.error??"insert_procedure_node failed";let I=$.parentId??"(root)";return`[procedure_node inserted | id=${$.nodeId??""}, parent=${I}, order=${$.order??0}, record=${$.recordId??""}]`}function fJ($){if(!$.success)return $.error??"update_procedure_node failed";let I=$.updatedFields?.join(", ")??"no changes";return`[procedure_node updated | id=${$.nodeId??""}, record=${$.recordId??""}, fields=${I}]`}function yJ($){if(!$.success)return $.error??"create_artifact failed";let U=[`[artifact created | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, workspace=${$.workspaceId??""}, status=${$.status??""}]`];if($.enrichment)if($.enrichment.source==="pubchem"){let b=$.enrichment.populatedKeys,w=b.length===0?"no fields filled (all already present)":`${b.length} field${b.length===1?"":"s"} filled: ${b.join(", ")}`;U.push(`[enrichment | source=pubchem, cid=${$.enrichment.cid}, ${w}]`)}else{let b=$.enrichment.detail?`, detail=${$.enrichment.detail}`:"";U.push(`[enrichment | source=none, reason=${$.enrichment.reason}${b}]`)}if($.linkToNode)if($.linkToNode.success)U.push(`[link_to_node | linkId=${$.linkToNode.linkId}, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}]`);else U.push(`[link_to_node | failed, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}, error=${$.linkToNode.error}]`);if($.warnings&&$.warnings.length>0){let b=$.warnings.map((w)=>w.class?`${w.key}→${w.suggestion} (${w.class})`:`${w.key}→${w.suggestion}`).join(", ");U.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${b}]`)}return U.join(`
94
- `)}function uJ($){if(!$.success)return $.error??"instantiate_artifact_template failed";let I=[`[artifact instantiated | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, template=${$.templateId??""}]`],U=$.links?.length??0;if(U>0){let w=($.links??[]).map((X)=>X.label?`${X.role}/${X.label}=${X.artifactId}`:`${X.role}=${X.artifactId}`).join(", ");I.push(`[links | ${U} slot${U===1?"":"s"} bound: ${w}]`)}let b=$.pendingSlots?.length??0;if(b>0){let w=($.pendingSlots??[]).map((X)=>{let D=X.filter?.artifactType?`:${X.filter.artifactType}${X.filter.structureClass?`/${X.filter.structureClass}`:""}`:"",W=X.label?`(${X.label})`:"";return`${X.role}${W}${D}`}).join(", ");I.push(`[pending_slots | ${b} slot${b===1?"":"s"} need binding: ${w}]`)}return I.join(`
95
- `)}function lJ($){if(!$.success)return $.error??"update_artifact failed";let I=$.updatedFields?.join(", ")??"no changes",U=$.propertyKeys?.length?`, propertyKeys=${$.propertyKeys.join("|")}`:"";return`[artifact updated | id=${$.artifactId??""}, type=${$.artifactType??""}, fields=${I}${U}]`}function cJ($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function mJ($){if(!$.success)return $.error??"delete_procedure_node failed";let I=$.orphanedMatrixIds??[],U=`[procedure_node deleted | id=${$.nodeId??""}, record=${$.recordId??""}, deletedNodes=${$.deletedNodeCount??1}, orphanedMatrices=${I.length}]`;if(I.length===0)return U;let b=I.map((w)=>k$([w]));return[U,"","[orphanedMatrixIds — rebind or delete via the matrix tools]",`{matrixId}[${I.length}]:`,...b].join(`
96
- `)}function rJ($){if(!$.success)return $.error??"build_procedure_tree failed";let I=$.nodeIdMap?Object.entries($.nodeIdMap):[],U=[`[procedure_tree ${$.mode??"built"} | record=${$.recordId??""}, inserted=${I.length}`];if($.mode==="replace")U.push(`, deleted=${$.deletedNodeCount??0}`),U.push(`, orphanedMatrices=${$.orphanedMatrixIds?.length??0}`);U.push("]");let b=U.join("");if(I.length===0)return b;let w=I.map(([D,W])=>k$([D,W])),X=[b,`{tempId,nodeId}[${I.length}]:`,...w];if($.mode==="replace"&&$.orphanedMatrixIds&&$.orphanedMatrixIds.length>0){X.push(""),X.push("[orphanedMatrixIds — rebind or delete via the matrix tools]"),X.push(`{matrixId}[${$.orphanedMatrixIds.length}]:`);for(let D of $.orphanedMatrixIds)X.push(k$([D]))}return X.join(`
97
- `)}function nJ($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function iJ($){if(!$.success)return $.error??"update_matrix_rows failed";let I=$.updatedRowIndices??[],U=`[matrix rows updated | id=${$.matrixId??""}, rows=${$.updatedRowCount??I.length}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((b)=>k$([b]))].join(`
98
- `)}function oJ($){if(!$.success)return $.error??"delete_matrix_rows failed";let I=$.deletedRowIndices??[],U=`[matrix rows deleted | id=${$.matrixId??""}, removed=${$.deletedRowCount??I.length}, remainingRows=${$.newRowCount??0}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((b)=>k$([b]))].join(`
99
- `)}function dJ($){if(!$.success)return $.error??"rebind_matrix_to_node failed";let I=$.previousNodeRef??"(body)",U=$.nodeRef??"(body)";return`[matrix rebound | id=${$.matrixId??""}, record=${$.recordId??""}, ${I} → ${U}, version=${$.newVersion??0}]`}function pJ($){if(!$.success)return $.error??"delete_matrix failed";let I=$.blockDeleted?`block=${$.blockId??"(found)"} removed`:"block: none found (already detached)";return`[matrix deleted | id=${$.matrixId??""}, owner=${$.entityType??""}:${$.entityId??""}, ${I}]`}function tJ($){if(!$.success)return $.error??"attach_matrix failed";let I=`${$.entityType??""}:${$.entityId??""}`,U=$.nodeRef?`, node=${$.nodeRef}`:"";return`[matrix attached | id=${$.matrixId??""}, owner=${I}${U}, version=${$.newVersion??0}]`}function aJ($){if(!$.success)return $.error??"list_matrix_references failed";let I=$.references??[];if(I.length===0)return`[matrix_references: id=${$.matrixId}, count=0] no embeds — safe to delete.`;let U=[`[matrix_references: id=${$.matrixId}, count=${I.length}]`,`{sourceType,sourceId,sourceTitle}[${I.length}]:`],b=I.map((w)=>k$([w.sourceType,w.sourceId,w.sourceTitle??""]));return[...U,...b].join(`
100
- `)}function eJ($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function sJ($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function $H($){if(!$.success)return $.error??"list_node_artifact_links failed";let I=$.links??[];if(I.length===0)return`[node_artifact_links: node=${$.nodeId??""}, count=0] no artifact links.`;let U=[`[node_artifact_links: node=${$.nodeId??""}, count=${I.length}]`,`{linkId,artifactId,artifactName,artifactType,role,context}[${I.length}]:`],b=I.map((w)=>k$([w.linkId,w.artifactId,w.artifactName??"",w.artifactType??"",w.role,w.context&&Object.keys(w.context).length>0?JSON.stringify(w.context):""]));return[...U,...b].join(`
101
- `)}function dF($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function IH($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],U=$.orphanedMatrices??[],b=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${U.length}]`],w=[];if(I.length>0){w.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount,proseBlockCount}[${I.length}]:`);for(let Q of I)w.push(k$([Q.id,Q.parentId??"",Q.order,Q.type,Q.label,Q.copyable?"true":"false",Q.matrixCount,Q.artifactCount,Q.fileCount,Q.proseBlockCount]))}else w.push("No procedure nodes.");let X=[];for(let Q of I){if(!Q.matrices||Q.matrices.length===0)continue;for(let G of Q.matrices)X.push({nodeId:Q.id,matrix:G})}let D=[];if(X.length>0){D.push(""),D.push("[attachedMatrices]"),D.push(`{nodeId,matrixId,label,version,rows,cols}[${X.length}]:`);for(let{nodeId:Q,matrix:G}of X)D.push(k$([Q,G.id,G.label,G.version,G.rowCount,dF(G.columns)]))}let W=[];if(U.length>0)if(W.push(""),W.push("[orphanedMatrices]"),U.some((G)=>G.version!==void 0&&G.columns!==void 0)){W.push(`{id,label,version,rows,cols,updatedAt}[${U.length}]:`);for(let G of U)W.push(k$([G.id,G.label,G.version??"",G.rowCount??"",G.columns?dF(G.columns):"",G.updatedAt]))}else{W.push(`{id,label,updatedAt}[${U.length}]:`);for(let G of U)W.push(k$([G.id,G.label,G.updatedAt]))}return[...b,...w,...D,...W].join(`
102
- `)}var Ou=Y.enum(["preamble","full"]),UH=Y.object({entityId:Y.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:Y.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},Y.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:Y.array(Y.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:Ou.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:Y.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:Y.array(Y.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:Y.array(Y.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:Y.array(Y.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:Y.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:Y.number().int().min(0).optional().describe("Depth: 0 = only direct content (no children), 1 = include immediate children, undefined = all descendants (default). Used with section or node parameter."),from_section:Y.string().optional().describe('Start section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with to_section.'),to_section:Y.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.'),connections:Y.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},Y.boolean()).optional().describe("Return entity connections (graph edges). Shows which entities mention, cite, or annotate this entity and vice versa. Included automatically as a summary in overview mode.")}),r0={name:"get_content",description:'Fetch content from literature, documents, or records. Returns markdown text.\nAccepts full UUIDs or short entity reference IDs (e.g., `lit-a3f7e2b9`, `doc-9bk4x1f2`, `rec-f72mn3a8`, `art-4c2e19af`).\n\n**Modes:**\n1. **Overview** (default): Preview + table of contents with section headings and estimated tokens. For records, also includes the procedure tree showing nodes, matrices, and artifact links.\n2. **Named Regions**: Pass `segment="preamble"` to fetch content before the first heading, or `segment="full"` to fetch the full entity content.\n3. **Section**: Pass `section="Heading Name"` to get all blocks in that section as interleaved markdown.\n4. **Node** (records only): Pass `node="step label"` to get procedure node content - prose, matrices (TOON format), artifacts, and child summaries. Use `depth` to control child expansion.\n5. **Block IDs**: Pass `blockIds=["id1","id2"]` to fetch specific blocks from search results.\n6. **Refs**: Pass `refs=[42,43]` to fetch literature references by number.\n7. **Figures**: Pass `figures=["fig-1"]` to fetch figure blocks.\n8. **Tables**: Pass `tables=["table-1"]` to fetch table blocks.\n9. **Section range**: Pass `from_section` and `to_section` to fetch all content between two headings (inclusive).\n10. **Section with depth**: Pass `section` with `depth=0` for own content only, `depth=1` for immediate children.\n11. **Connections**: Pass `connections=true` to get all entity connections (mentions, citations, annotation edges). Included automatically in overview mode as a summary. Annotation edges include edge text explaining the relationship.\n\n**Interleaved Format (Section mode):**\nSection mode returns content with block IDs embedded for editing:\n```\n[paragraph | dff74a60-0dd9-4cfa-9ae1-04c462d5cf46]\nThis is the paragraph content...\n\n[heading:2 | a9fe6c59-cf59-495c-b688-a6fcfb605491]\n## Methods\n```\nUse these block IDs with `str_replace_block`, `insert_block`, or `delete_block`.\n\n**Reading Strategy:** Check `ownTokens` and `children` in TOC entries:\n- If `ownTokens` is 0 and `children` exists -> container heading, fetch children individually\n- If `children` is absent -> leaf section, fetch directly with `section`\n- `estimatedTokens` = total tokens including all descendants\n- If `overview.regions` is present, use the provided `retrievalHint` to fetch non-TOC content such as opening paragraphs or heading-less documents\n\n**Best Practice:** Check `estimatedTokens` in TOC before fetching large sections.'};var wH=Y.object({forceRefresh:Y.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),n0={name:"get_workspace_context",description:"Get the user's organizational hierarchy: organizations, workspaces, and spaces. Returns default orgId and workspaceId for use with other tools (search, create_document, etc.). Called automatically at startup; use forceRefresh=true to reload if the user creates new workspaces mid-session."};var yD=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),afterBlockId:Y.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:Y.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:Y.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:Y.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:Y.enum(_D).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:Y.string().optional().describe("Text content for the new block"),headingLevel:Y.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:Y.boolean().optional().describe("Checked state for checkListItem"),title:Y.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:Y.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:Y.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:Y.enum(ZD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:Y.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:Y.string().optional().describe("Cached title of the linked entity"),doi:Y.string().optional().describe("DOI for literature references"),smiles:Y.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:Y.enum(CD).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:Y.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:Y.string().optional().describe("Optional description or notes for the structure block"),matrixId:Y.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:Y.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:Y.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:Y.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:Y.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it."),blocks:Y.array(UJ).max(vI).optional().describe(`Array of blocks to insert in sequence. Max ${vI} blocks. Use this for inserting multiple blocks in one call.`)}),zu=yD.refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{let I=$.content!==void 0,U=$.blocks!==void 0&&$.blocks.length>0;return I!==U},{message:"Provide either content (single block) or blocks (batch), not both"}),i0={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
93
+ `)}function hJ($){if(!$.success)return $.error??"insert_procedure_node failed";let I=$.parentId??"(root)";return`[procedure_node inserted | id=${$.nodeId??""}, parent=${I}, order=${$.order??0}, record=${$.recordId??""}]`}function fJ($){if(!$.success)return $.error??"update_procedure_node failed";let I=$.updatedFields?.join(", ")??"no changes";return`[procedure_node updated | id=${$.nodeId??""}, record=${$.recordId??""}, fields=${I}]`}function yJ($){if(!$.success)return $.error??"create_artifact failed";let U=[`[artifact created | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, workspace=${$.workspaceId??""}, status=${$.status??""}]`];if($.enrichment)if($.enrichment.source==="pubchem"){let b=$.enrichment.populatedKeys,w=b.length===0?"no fields filled (all already present)":`${b.length} field${b.length===1?"":"s"} filled: ${b.join(", ")}`;U.push(`[enrichment | source=pubchem, cid=${$.enrichment.cid}, ${w}]`)}else{let b=$.enrichment.detail?`, detail=${$.enrichment.detail}`:"";U.push(`[enrichment | source=none, reason=${$.enrichment.reason}${b}]`)}if($.linkToNode)if($.linkToNode.success)U.push(`[link_to_node | linkId=${$.linkToNode.linkId}, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}]`);else U.push(`[link_to_node | failed, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}, error=${$.linkToNode.error}]`);if($.warnings&&$.warnings.length>0){let b=$.warnings.map((w)=>w.class?`${w.key}→${w.suggestion} (${w.class})`:`${w.key}→${w.suggestion}`).join(", ");U.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${b}]`)}if($.schema)U.push(uJ($.schema));return U.join(`
94
+ `)}function uJ($){let I=$.structureClass?`${$.artifactType}/${$.structureClass}`:$.artifactType,U=$.knownKeys.map((b)=>{let w=b.unit?`[${b.unit}]`:"",X=b.options&&b.options.length>0?`=${b.options.join("|")}`:"",D=b.auto?"*":"";return`${b.key}:${b.type}${w}${X}${D}`}).join(", ");return`[schema | type=${I}, knownKeys: ${U}]`}function lJ($){if(!$.success)return $.error??"instantiate_artifact_template failed";let I=[`[artifact instantiated | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, template=${$.templateId??""}]`],U=$.links?.length??0;if(U>0){let w=($.links??[]).map((X)=>X.label?`${X.role}/${X.label}=${X.artifactId}`:`${X.role}=${X.artifactId}`).join(", ");I.push(`[links | ${U} slot${U===1?"":"s"} bound: ${w}]`)}let b=$.pendingSlots?.length??0;if(b>0){let w=($.pendingSlots??[]).map((X)=>{let D=X.filter?.artifactType?`:${X.filter.artifactType}${X.filter.structureClass?`/${X.filter.structureClass}`:""}`:"",W=X.label?`(${X.label})`:"";return`${X.role}${W}${D}`}).join(", ");I.push(`[pending_slots | ${b} slot${b===1?"":"s"} need binding: ${w}]`)}return I.join(`
95
+ `)}function cJ($){if(!$.success)return $.error??"update_artifact failed";let I=$.updatedFields?.join(", ")??"no changes",U=$.propertyKeys?.length?`, propertyKeys=${$.propertyKeys.join("|")}`:"",b=[`[artifact updated | id=${$.artifactId??""}, type=${$.artifactType??""}, fields=${I}${U}]`];if($.warnings&&$.warnings.length>0){let w=$.warnings.map((X)=>X.class?`${X.key}→${X.suggestion} (${X.class})`:`${X.key}→${X.suggestion}`).join(", ");b.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${w}]`)}if($.schema)b.push(uJ($.schema));return b.join(`
96
+ `)}function mJ($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function rJ($){if(!$.success)return $.error??"delete_procedure_node failed";let I=$.orphanedMatrixIds??[],U=`[procedure_node deleted | id=${$.nodeId??""}, record=${$.recordId??""}, deletedNodes=${$.deletedNodeCount??1}, orphanedMatrices=${I.length}]`;if(I.length===0)return U;let b=I.map((w)=>k$([w]));return[U,"","[orphanedMatrixIds — rebind or delete via the matrix tools]",`{matrixId}[${I.length}]:`,...b].join(`
97
+ `)}function nJ($){if(!$.success)return $.error??"build_procedure_tree failed";let I=$.nodeIdMap?Object.entries($.nodeIdMap):[],U=[`[procedure_tree ${$.mode??"built"} | record=${$.recordId??""}, inserted=${I.length}`];if($.mode==="replace")U.push(`, deleted=${$.deletedNodeCount??0}`),U.push(`, orphanedMatrices=${$.orphanedMatrixIds?.length??0}`);U.push("]");let b=U.join("");if(I.length===0)return b;let w=I.map(([D,W])=>k$([D,W])),X=[b,`{tempId,nodeId}[${I.length}]:`,...w];if($.mode==="replace"&&$.orphanedMatrixIds&&$.orphanedMatrixIds.length>0){X.push(""),X.push("[orphanedMatrixIds — rebind or delete via the matrix tools]"),X.push(`{matrixId}[${$.orphanedMatrixIds.length}]:`);for(let D of $.orphanedMatrixIds)X.push(k$([D]))}return X.join(`
98
+ `)}function iJ($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function oJ($){if(!$.success)return $.error??"update_matrix_rows failed";let I=$.updatedRowIndices??[],U=`[matrix rows updated | id=${$.matrixId??""}, rows=${$.updatedRowCount??I.length}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((b)=>k$([b]))].join(`
99
+ `)}function dJ($){if(!$.success)return $.error??"delete_matrix_rows failed";let I=$.deletedRowIndices??[],U=`[matrix rows deleted | id=${$.matrixId??""}, removed=${$.deletedRowCount??I.length}, remainingRows=${$.newRowCount??0}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((b)=>k$([b]))].join(`
100
+ `)}function pJ($){if(!$.success)return $.error??"rebind_matrix_to_node failed";let I=$.previousNodeRef??"(body)",U=$.nodeRef??"(body)";return`[matrix rebound | id=${$.matrixId??""}, record=${$.recordId??""}, ${I} → ${U}, version=${$.newVersion??0}]`}function tJ($){if(!$.success)return $.error??"delete_matrix failed";let I=$.blockDeleted?`block=${$.blockId??"(found)"} removed`:"block: none found (already detached)";return`[matrix deleted | id=${$.matrixId??""}, owner=${$.entityType??""}:${$.entityId??""}, ${I}]`}function aJ($){if(!$.success)return $.error??"attach_matrix failed";let I=`${$.entityType??""}:${$.entityId??""}`,U=$.nodeRef?`, node=${$.nodeRef}`:"";return`[matrix attached | id=${$.matrixId??""}, owner=${I}${U}, version=${$.newVersion??0}]`}function eJ($){if(!$.success)return $.error??"list_matrix_references failed";let I=$.references??[];if(I.length===0)return`[matrix_references: id=${$.matrixId}, count=0] no embeds — safe to delete.`;let U=[`[matrix_references: id=${$.matrixId}, count=${I.length}]`,`{sourceType,sourceId,sourceTitle}[${I.length}]:`],b=I.map((w)=>k$([w.sourceType,w.sourceId,w.sourceTitle??""]));return[...U,...b].join(`
101
+ `)}function sJ($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function $H($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function IH($){if(!$.success)return $.error??"list_node_artifact_links failed";let I=$.links??[];if(I.length===0)return`[node_artifact_links: node=${$.nodeId??""}, count=0] no artifact links.`;let U=[`[node_artifact_links: node=${$.nodeId??""}, count=${I.length}]`,`{linkId,artifactId,artifactName,artifactType,role,context}[${I.length}]:`],b=I.map((w)=>k$([w.linkId,w.artifactId,w.artifactName??"",w.artifactType??"",w.role,w.context&&Object.keys(w.context).length>0?JSON.stringify(w.context):""]));return[...U,...b].join(`
102
+ `)}function pF($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function UH($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],U=$.orphanedMatrices??[],b=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${U.length}]`],w=[];if(I.length>0){w.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount,proseBlockCount}[${I.length}]:`);for(let Q of I)w.push(k$([Q.id,Q.parentId??"",Q.order,Q.type,Q.label,Q.copyable?"true":"false",Q.matrixCount,Q.artifactCount,Q.fileCount,Q.proseBlockCount]))}else w.push("No procedure nodes.");let X=[];for(let Q of I){if(!Q.matrices||Q.matrices.length===0)continue;for(let G of Q.matrices)X.push({nodeId:Q.id,matrix:G})}let D=[];if(X.length>0){D.push(""),D.push("[attachedMatrices]"),D.push(`{nodeId,matrixId,label,version,rows,cols}[${X.length}]:`);for(let{nodeId:Q,matrix:G}of X)D.push(k$([Q,G.id,G.label,G.version,G.rowCount,pF(G.columns)]))}let W=[];if(U.length>0)if(W.push(""),W.push("[orphanedMatrices]"),U.some((G)=>G.version!==void 0&&G.columns!==void 0)){W.push(`{id,label,version,rows,cols,updatedAt}[${U.length}]:`);for(let G of U)W.push(k$([G.id,G.label,G.version??"",G.rowCount??"",G.columns?pF(G.columns):"",G.updatedAt]))}else{W.push(`{id,label,updatedAt}[${U.length}]:`);for(let G of U)W.push(k$([G.id,G.label,G.updatedAt]))}return[...b,...w,...D,...W].join(`
103
+ `)}var zu=Y.enum(["preamble","full"]),wH=Y.object({entityId:Y.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:Y.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},Y.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:Y.array(Y.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:zu.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:Y.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:Y.array(Y.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:Y.array(Y.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:Y.array(Y.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:Y.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:Y.number().int().min(0).optional().describe("Depth: 0 = only direct content (no children), 1 = include immediate children, undefined = all descendants (default). Used with section or node parameter."),from_section:Y.string().optional().describe('Start section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with to_section.'),to_section:Y.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.'),connections:Y.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},Y.boolean()).optional().describe("Return entity connections (graph edges). Shows which entities mention, cite, or annotate this entity and vice versa. Included automatically as a summary in overview mode.")}),r0={name:"get_content",description:'Fetch content from literature, documents, or records. Returns markdown text.\nAccepts full UUIDs or short entity reference IDs (e.g., `lit-a3f7e2b9`, `doc-9bk4x1f2`, `rec-f72mn3a8`, `art-4c2e19af`).\n\n**Modes:**\n1. **Overview** (default): Preview + table of contents with section headings and estimated tokens. For records, also includes the procedure tree showing nodes, matrices, and artifact links.\n2. **Named Regions**: Pass `segment="preamble"` to fetch content before the first heading, or `segment="full"` to fetch the full entity content.\n3. **Section**: Pass `section="Heading Name"` to get all blocks in that section as interleaved markdown.\n4. **Node** (records only): Pass `node="step label"` to get procedure node content - prose, matrices (TOON format), artifacts, and child summaries. Use `depth` to control child expansion.\n5. **Block IDs**: Pass `blockIds=["id1","id2"]` to fetch specific blocks from search results.\n6. **Refs**: Pass `refs=[42,43]` to fetch literature references by number.\n7. **Figures**: Pass `figures=["fig-1"]` to fetch figure blocks.\n8. **Tables**: Pass `tables=["table-1"]` to fetch table blocks.\n9. **Section range**: Pass `from_section` and `to_section` to fetch all content between two headings (inclusive).\n10. **Section with depth**: Pass `section` with `depth=0` for own content only, `depth=1` for immediate children.\n11. **Connections**: Pass `connections=true` to get all entity connections (mentions, citations, annotation edges). Included automatically in overview mode as a summary. Annotation edges include edge text explaining the relationship.\n\n**Interleaved Format (Section mode):**\nSection mode returns content with block IDs embedded for editing:\n```\n[paragraph | dff74a60-0dd9-4cfa-9ae1-04c462d5cf46]\nThis is the paragraph content...\n\n[heading:2 | a9fe6c59-cf59-495c-b688-a6fcfb605491]\n## Methods\n```\nUse these block IDs with `str_replace_block`, `insert_block`, or `delete_block`.\n\n**Reading Strategy:** Check `ownTokens` and `children` in TOC entries:\n- If `ownTokens` is 0 and `children` exists -> container heading, fetch children individually\n- If `children` is absent -> leaf section, fetch directly with `section`\n- `estimatedTokens` = total tokens including all descendants\n- If `overview.regions` is present, use the provided `retrievalHint` to fetch non-TOC content such as opening paragraphs or heading-less documents\n\n**Best Practice:** Check `estimatedTokens` in TOC before fetching large sections.'};var bH=Y.object({forceRefresh:Y.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),n0={name:"get_workspace_context",description:"Get the user's organizational hierarchy: organizations, workspaces, and spaces. Returns default orgId and workspaceId for use with other tools (search, create_document, etc.). Called automatically at startup; use forceRefresh=true to reload if the user creates new workspaces mid-session."};var yD=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),afterBlockId:Y.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:Y.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:Y.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:Y.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:Y.enum(_D).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:Y.string().optional().describe("Text content for the new block"),headingLevel:Y.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:Y.boolean().optional().describe("Checked state for checkListItem"),title:Y.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:Y.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:Y.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:Y.enum(ZD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:Y.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:Y.string().optional().describe("Cached title of the linked entity"),doi:Y.string().optional().describe("DOI for literature references"),smiles:Y.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:Y.enum(CD).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:Y.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:Y.string().optional().describe("Optional description or notes for the structure block"),matrixId:Y.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:Y.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:Y.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:Y.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:Y.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it."),blocks:Y.array(UJ).max(vI).optional().describe(`Array of blocks to insert in sequence. Max ${vI} blocks. Use this for inserting multiple blocks in one call.`)}),Lu=yD.refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{let I=$.content!==void 0,U=$.blocks!==void 0&&$.blocks.length>0;return I!==U},{message:"Provide either content (single block) or blocks (batch), not both"}),i0={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
103
104
  1. afterBlockId: Insert as SIBLING after the specified block
104
105
  2. beforeBlockId: Insert as SIBLING before the specified block
105
106
  3. parentBlockId: Insert as CHILD of a container block (e.g., referenceItem inside referenceList)
@@ -170,7 +171,7 @@ To add prose under a procedure node, use the prose container's blockId instead:
170
171
 
171
172
  The procedureTree container itself is fine as a sibling anchor (afterBlockId / beforeBlockId) but never as a parentBlockId (its children are projected sections).
172
173
 
173
- **Record draft-gate:** record writes require the record to be in \`draft\` status. \`completed\` / \`locked\` records return a structured \`record_not_draft\` error — stop, surface it to the user, and let them decide whether to re-open the record.`};var bH=Y.object({templateId:Y.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:Y.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org. When omitted, falls back to the user's first workspace."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:Y.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:Y.string().optional(),tags:Y.array(Y.string()).optional(),properties:Y.record(Y.string(),Y.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:MI.optional(),storageRef:Y.string().optional(),location:Y.string().optional(),parentId:Y.string().uuid().optional(),sourceRecordId:Y.string().uuid().optional(),slotBindings:Y.array(Y.object({role:Y.string().describe('Slot role from the template (e.g. "reactant").'),label:Y.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:Y.string().uuid().describe("UUID of the artifact to bind into this slot.")})).optional().describe("Pre-bound slot values. Each binding overrides the template's `defaultArtifactId` for the matching slot. Unmatched bindings are silently ignored. Slots not matched by any binding fall back to `defaultArtifactId`, then to `pendingSlots`.")}),o0={name:"instantiate_artifact_template",description:["Create a new artifact from an `artifact_properties` template, optionally with pre-bound link slots.","The template provides typed-property defaults + a list of `linkSlots` (e.g. a Suzuki coupling template declares slots for aryl halide / boronic acid / Pd source / base / solvent). Caller-supplied `properties` override the template defaults; caller-supplied `slotBindings` override slot `defaultArtifactId`s.","Slots that aren't bound after this call come back as `pendingSlots` so the next turn can prompt the user (or call this tool again with additional `slotBindings`). Per-slot link failures are non-fatal — the artifact is still created.",'Use this when the user asks to "create a new artifact from <template>" or when an agent flow wants to instantiate a template without going through the lower-level `create_artifact` + per-slot `link_artifact_to_node` choreography.'].join(" ")};var Lu=Y.object({cid:Y.number().int().positive().describe("PubChem Compound ID (CID).")}),XH={name:"get_compound_by_cid",description:["Fetch full PubChem metadata for a single compound by its CID.","Faster than `search_compound` when the CID is already known (e.g. you got it from a prior search). Skips the lookup step.","Returns the same shape as `search_compound`: molecular formula, MW, SMILES, InChIKey, CAS numbers, synonyms."].join(" ")};var Ku=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,vu=Y.object({inchi_key:Y.string().regex(Ku,"InChIKey must be in the form AAAAAAAAAAAAAA-BBBBBBBBBB-C (27 uppercase chars with 2 dashes).").describe('Full InChIKey (e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N" for ethanol).')}),DH={name:"get_compound_by_inchi_key",description:["Fetch PubChem metadata by exact InChIKey.","The InChIKey is the canonical 27-character hash for a chemical structure — perfect for cross-source dedup. Returns null when the key is unknown to PubChem (rare but possible for very new structures)."].join(" ")};var aF=Y.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),Vu=Y.object({cid:Y.number().int().positive().describe("PubChem Compound ID (CID). Get one via `search_compound`, `get_compound_by_cid`, `get_compound_by_inchi_key`, or `resolve_cas`."),include:Y.array(aF).optional().describe("Sections to fetch. Defaults to ['physical', 'safety'] when omitted — the most ELN-relevant subset. Pass an explicit array to add or restrict sections. All declared values are live (Phase 1-3): physical, safety, transport, handling, exposure, toxicity, spectra, ecological, regulatory, classification, literature_counts."),verbose:Y.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),WH={name:"get_compound_details",description:["Fetch rich PubChem data for a known compound: experimental physical properties, GHS safety classification, handling guidance, transport info (UN/DOT/IMO/EC), occupational exposure limits, toxicology (LD50/LC50, target organs, antidote), available spectra (NMR, IR, MS, UV), ecological data, regulatory classifications (TSCA/REACH/FDA), taxonomic placements, and literature/patent counts.",'Composable via the `include` parameter — pass an array of section names to compose any subset. Default `["physical", "safety"]` covers the most common ELN questions ("what\'s the boiling point", "is it flammable").',"Use `search_compound` first to resolve a name/CAS to a CID, then call this for the deep data.","Output is structured markdown with citation provenance per fact; agents can quote it directly. Tabular sections (exposure limits, toxicity LD50 values) use TOON.","When 3+ sections are requested, the implementation fetches the full PubChem record once instead of N round-trips — calling with all 11 sections is one HTTP call."].join(" ")};var qu=Y.object({cas:Y.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),QH={name:"resolve_cas",description:["Resolve a CAS Registry Number to full PubChem compound metadata.","Convenience wrapper around `search_compound(cas=...)` that always returns the first match. Use this when the user already has a CAS number and just wants the canonical compound back."].join(" ")};var Fu=Y.object({name:Y.string().optional().describe("Compound name, trade name, or systematic name."),cas:Y.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:Y.number().int().positive().optional().describe("PubChem CID."),inchi_key:Y.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:Y.number().int().min(1).max(10).optional().describe("Max results when searching by name (default 5). Ignored for exact-identifier lookups (cid / inchi_key / cas).")}).refine(($)=>Boolean($.name||$.cas||$.cid||$.inchi_key),"Provide at least one of: name, cas, cid, inchi_key."),GH={name:"search_compound",description:["Look up chemical compounds via PubChem. Accepts any identifier (name / CAS / CID / InChIKey).","Returns up to `limit` matches (default 5, max 10) with molecular formula, MW, SMILES, InChIKey, CAS numbers, and synonyms — enough to verify which compound the user means before acting.",`Use this when the user asks reference questions like "what's the molecular weight of aspirin", "find the CAS number for caffeine", or wants to disambiguate between isomers / common names.`,'Do NOT use this to search the workspace\'s own chemical artifacts — use the `search` tool with `entityType="artifact"` for that. PubChem is the world index; `search` is the local inventory.'].join(" ")};var NH=Y.object({query:Y.string().min(1).optional().describe("Search query keywords"),mode:Y.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:Y.object({type:Y.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:Y.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:Y.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:Y.string().uuid().optional().describe("Filter by workspace ID"),spaceId:Y.string().uuid().optional().describe("Filter by space ID"),limit:Y.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:Y.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:Y.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:Y.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:Y.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),tags:Y.array(Y.string()).optional().describe("Filter by tags. Matches entities that have all of the provided tags by default."),artifactType:Y.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:Y.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),d0={name:"search",description:`Search across literature, documents, records, and artifacts.
174
+ **Record draft-gate:** record writes require the record to be in \`draft\` status. \`completed\` / \`locked\` records return a structured \`record_not_draft\` error — stop, surface it to the user, and let them decide whether to re-open the record.`};var XH=Y.object({templateId:Y.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:Y.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org. When omitted, falls back to the user's first workspace."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:Y.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:Y.string().optional(),tags:Y.array(Y.string()).optional(),properties:Y.record(Y.string(),Y.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:MI.optional(),storageRef:Y.string().optional(),location:Y.string().optional(),parentId:Y.string().uuid().optional(),sourceRecordId:Y.string().uuid().optional(),slotBindings:Y.array(Y.object({role:Y.string().describe('Slot role from the template (e.g. "reactant").'),label:Y.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:Y.string().uuid().describe("UUID of the artifact to bind into this slot.")})).optional().describe("Pre-bound slot values. Each binding overrides the template's `defaultArtifactId` for the matching slot. Unmatched bindings are silently ignored. Slots not matched by any binding fall back to `defaultArtifactId`, then to `pendingSlots`.")}),o0={name:"instantiate_artifact_template",description:["Create a new artifact from an `artifact_properties` template, optionally with pre-bound link slots.","The template provides typed-property defaults + a list of `linkSlots` (e.g. a Suzuki coupling template declares slots for aryl halide / boronic acid / Pd source / base / solvent). Caller-supplied `properties` override the template defaults; caller-supplied `slotBindings` override slot `defaultArtifactId`s.","Slots that aren't bound after this call come back as `pendingSlots` so the next turn can prompt the user (or call this tool again with additional `slotBindings`). Per-slot link failures are non-fatal — the artifact is still created.",'Use this when the user asks to "create a new artifact from <template>" or when an agent flow wants to instantiate a template without going through the lower-level `create_artifact` + per-slot `link_artifact_to_node` choreography.'].join(" ")};var Ku=Y.object({cid:Y.number().int().positive().describe("PubChem Compound ID (CID).")}),DH={name:"get_compound_by_cid",description:["Fetch full PubChem metadata for a single compound by its CID.","Faster than `search_compound` when the CID is already known (e.g. you got it from a prior search). Skips the lookup step.","Returns the same shape as `search_compound`: molecular formula, MW, SMILES, InChIKey, CAS numbers, synonyms."].join(" ")};var vu=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,Vu=Y.object({inchi_key:Y.string().regex(vu,"InChIKey must be in the form AAAAAAAAAAAAAA-BBBBBBBBBB-C (27 uppercase chars with 2 dashes).").describe('Full InChIKey (e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N" for ethanol).')}),WH={name:"get_compound_by_inchi_key",description:["Fetch PubChem metadata by exact InChIKey.","The InChIKey is the canonical 27-character hash for a chemical structure — perfect for cross-source dedup. Returns null when the key is unknown to PubChem (rare but possible for very new structures)."].join(" ")};var eF=Y.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),qu=Y.object({cid:Y.number().int().positive().describe("PubChem Compound ID (CID). Get one via `search_compound`, `get_compound_by_cid`, `get_compound_by_inchi_key`, or `resolve_cas`."),include:Y.array(eF).optional().describe("Sections to fetch. Defaults to ['physical', 'safety'] when omitted — the most ELN-relevant subset. Pass an explicit array to add or restrict sections. All declared values are live (Phase 1-3): physical, safety, transport, handling, exposure, toxicity, spectra, ecological, regulatory, classification, literature_counts."),verbose:Y.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),QH={name:"get_compound_details",description:["Fetch rich PubChem data for a known compound: experimental physical properties, GHS safety classification, handling guidance, transport info (UN/DOT/IMO/EC), occupational exposure limits, toxicology (LD50/LC50, target organs, antidote), available spectra (NMR, IR, MS, UV), ecological data, regulatory classifications (TSCA/REACH/FDA), taxonomic placements, and literature/patent counts.",'Composable via the `include` parameter — pass an array of section names to compose any subset. Default `["physical", "safety"]` covers the most common ELN questions ("what\'s the boiling point", "is it flammable").',"Use `search_compound` first to resolve a name/CAS to a CID, then call this for the deep data.","Output is structured markdown with citation provenance per fact; agents can quote it directly. Tabular sections (exposure limits, toxicity LD50 values) use TOON.","When 3+ sections are requested, the implementation fetches the full PubChem record once instead of N round-trips — calling with all 11 sections is one HTTP call."].join(" ")};var Fu=Y.object({cas:Y.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),GH={name:"resolve_cas",description:["Resolve a CAS Registry Number to full PubChem compound metadata.","Convenience wrapper around `search_compound(cas=...)` that always returns the first match. Use this when the user already has a CAS number and just wants the canonical compound back."].join(" ")};var Mu=Y.object({name:Y.string().optional().describe("Compound name, trade name, or systematic name."),cas:Y.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:Y.number().int().positive().optional().describe("PubChem CID."),inchi_key:Y.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:Y.number().int().min(1).max(10).optional().describe("Max results when searching by name (default 5). Ignored for exact-identifier lookups (cid / inchi_key / cas).")}).refine(($)=>Boolean($.name||$.cas||$.cid||$.inchi_key),"Provide at least one of: name, cas, cid, inchi_key."),NH={name:"search_compound",description:["Look up chemical compounds via PubChem. Accepts any identifier (name / CAS / CID / InChIKey).","Returns up to `limit` matches (default 5, max 10) with molecular formula, MW, SMILES, InChIKey, CAS numbers, and synonyms — enough to verify which compound the user means before acting.",`Use this when the user asks reference questions like "what's the molecular weight of aspirin", "find the CAS number for caffeine", or wants to disambiguate between isomers / common names.`,'Do NOT use this to search the workspace\'s own chemical artifacts — use the `search` tool with `entityType="artifact"` for that. PubChem is the world index; `search` is the local inventory.'].join(" ")};var YH=Y.object({query:Y.string().min(1).optional().describe("Search query keywords"),mode:Y.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:Y.object({type:Y.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:Y.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:Y.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:Y.string().uuid().optional().describe("Filter by workspace ID"),spaceId:Y.string().uuid().optional().describe("Filter by space ID"),limit:Y.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:Y.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:Y.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:Y.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:Y.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),tags:Y.array(Y.string()).optional().describe("Filter by tags. Matches entities that have all of the provided tags by default."),artifactType:Y.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:Y.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),d0={name:"search",description:`Search across literature, documents, records, and artifacts.
174
175
 
175
176
  **Modes:**
176
177
  - \`library\` (default): Returns unique entities ranked by relevance. Use when browsing/discovering.
@@ -198,6 +199,9 @@ The procedureTree container itself is fine as a sibling anchor (afterBlockId / b
198
199
  Lists entities in a workspace or space, sorted by most recently updated.
199
200
  \`search(workspaceId="...", spaceId="...")\` -> All entities in that space
200
201
  \`search(workspaceId="...", scope={type:"literature"})\` -> All literature in workspace
202
+ \`search(workspaceId="...", scope={type:"artifact"}, artifactType="chemical")\` -> All chemicals in workspace
203
+ \`search(workspaceId="...", scope={type:"artifact"}, artifactType="sample")\` -> All samples in workspace
204
+ **This is the way to discover what already exists in a workspace before creating new artifacts.**
201
205
 
202
206
  **Literature Filters:**
203
207
  - \`authorName\`: Filter by author (partial match, e.g., "Shen" finds authors named Shen)
@@ -219,4 +223,4 @@ Requires \`workspaceId\`. Returns artifact names, types, and retrieval hints.
219
223
  **Retrieval Hints:**
220
224
  Library mode results include \`bestBlockId\` and smart \`retrievalHint\`:
221
225
  - High relevance: Jump directly to the best block via \`blockIds=['bestBlockId']\`
222
- - Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var YH=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),blockId:Y.string().describe("Block ID to edit"),oldText:Y.string().describe("Exact text to find and replace (must match exactly)"),newText:Y.string().describe("Text to replace with")}),p0={name:"str_replace_block",description:"Replace text content in a specific block. Works like Claude Code str_replace - find exact text and replace it. oldText must match exactly (case-sensitive). Use get_content first to see exact block content. Content supports SURA markdown inline syntax: **bold**, *italic*, ~~strike~~, `code`, {u}underline{/u}, {color:red}text color{/color}, {bg:yellow}background{/bg}. Colors: default, gray, brown, red, orange, yellow, green, blue, purple, pink. "+"Records: only `draft` records are writable. On `completed`/`locked` records the call returns a structured `record_not_draft` error — stop and ask the user to re-open the record; do not try to flip the status yourself."};var BH=[d0,r0,p0,i0,K0,T0,_0,j0,E0,k0,P0,o0,n0,R0,M0,x0,m0,l0,g0,v0,c0,S0,C0,h0,V0,q0,Z0,f0,y0,u0,GH,XH,DH,QH,WH],Mu=BH.map(($)=>$.name),ju=Object.fromEntries(BH.map(($)=>[$.name,$]));function JH($){return{content:[{type:"text",text:$}]}}function HH($){return{content:[{type:"text",text:$}],isError:!0}}function u($,I,U){let{definition:b,schema:w,createExecutor:X,formatOutput:D,formatError:W=(B)=>B.message,getLogMessage:Q=(B)=>JSON.stringify(B).slice(0,100)}=U,G=X(I),N=w.shape;$.tool(b.name,b.description,N,async(B)=>{let H=B,J=Q(H);I.log.info(`${b.name}: ${J}`);try{let A=await G(H),O=D(A,H);return I.log.info(`${b.name}: completed`),JH(O)}catch(A){let O=A instanceof Error?W(A,H):"Unknown error";return I.log.error(`${b.name} failed:`,A),HH(`${b.name} error: ${O}`)}})}function eF($,I,U){let{definition:b,schema:w,createExecutor:X,formatSuccess:D,formatNotFound:W=(H)=>JSON.stringify({found:!1,error:H.error??"Not found"}),formatError:Q=(H)=>H.message,getLogMessage:G=(H)=>JSON.stringify(H).slice(0,100)}=U,N=X(I),B=w.shape;$.tool(b.name,b.description,B,async(H)=>{let J=H,A=G(J);I.log.info(`${b.name}: ${A}`);try{let O=await N(J);if(!O.found)return I.log.info(`${b.name}: not found`),{content:[{type:"text",text:W(O,J)}],isError:!0};return I.log.info(`${b.name}: found`),JH(D(O,J))}catch(O){let V=O instanceof Error?Q(O,J):"Unknown error";return I.log.error(`${b.name} failed:`,O),HH(`${b.name} error: ${V}`)}})}function sF($,I){u($,I,{definition:v0,schema:bJ,createExecutor:(U)=>{return async(b)=>{return await U.client.appendMatrixRows(b)}},formatOutput:nJ,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function $M($,I){u($,I,{definition:V0,schema:XJ,createExecutor:(U)=>{return async(b)=>{return await U.client.attachMatrix(b)}},formatOutput:tJ,getLogMessage:(U)=>{let b=U.nodeRef?` + node ${U.nodeRef.slice(0,8)}`:"";return`Attaching matrix ${U.matrixId.slice(0,8)} → ${U.entityType}:${U.entityId.slice(0,8)}${b}`}})}function IM($,I){u($,I,{definition:M0,schema:WJ,createExecutor:(U)=>{return async(b)=>{return await U.client.buildProcedureTree(b)}},formatOutput:rJ,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function UM($,I){u($,I,{definition:P0,schema:YJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createArtifact(b)}},formatOutput:yJ,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function wM($,I){u($,I,{definition:T0,schema:HJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createMatrixFromReactionArtifact(b)}},formatOutput:_J,getLogMessage:(U)=>`Deriving matrix from reaction ${U.reactionArtifactId.slice(0,8)}`})}function bM($,I){u($,I,{definition:j0,schema:QJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createDocument(b)}},formatOutput:kJ,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function XM($,I){u($,I,{definition:E0,schema:GJ,createExecutor:(U)=>{return async(b)=>{return U.client.createLiterature(b)}},formatOutput:RJ,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function DM($,I){u($,I,{definition:k0,schema:BJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createRecord(b)}},formatOutput:xJ,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function WM($,I){u($,I,{definition:_0,schema:hD,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteBlock(b)}},formatOutput:gJ,getLogMessage:(U)=>{if(U.blockIds&&U.blockIds.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} batch delete ${U.blockIds.length} blocks`;return`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId?.slice(0,8)??"unknown"}`}})}function QM($,I){u($,I,{definition:Z0,schema:AJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrix(b)}},formatOutput:pJ,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function GM($,I){u($,I,{definition:C0,schema:OJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrixRows(b)}},formatOutput:oJ,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function NM($,I){u($,I,{definition:g0,schema:zJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteProcedureNode(b)}},formatOutput:mJ,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function YM($,I){eF($,I,{definition:r0,schema:UH,createExecutor:(U)=>{return async(b)=>{return U.client.getContent(b)}},formatSuccess:PJ,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>{let b=U.blockIds?`blocks:${U.blockIds.length}`:U.segment?`segment:"${U.segment}"`:U.from_section&&U.to_section?`range:"${U.from_section}"-"${U.to_section}"`:U.node?`node:"${U.node}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.section?`section:"${U.section}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.refs?`refs:${U.refs.length}`:"overview";return`${U.entityId.slice(0,8)}... (${b})`}})}function BM($,I){u($,I,{definition:n0,schema:wH,createExecutor:(U)=>{return async(b)=>{if(U.workspaceContext&&!b.forceRefresh)return U.workspaceContext;let w=await U.client.getWorkspaceContext();return U.workspaceContext=w,w}},formatOutput:EJ,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function JM($,I){u($,I,{definition:i0,schema:yD,createExecutor:(U)=>{return async(b)=>{return await U.client.insertBlock(b)}},formatOutput:CJ,getLogMessage:(U)=>{let b;if(U.parentBlockId)b=`in:${U.parentBlockId.slice(0,8)}`;else if(U.beforeBlockId)b=`before:${U.beforeBlockId.slice(0,8)}`;else if(U.afterBlockId)b=`after:${U.afterBlockId.slice(0,8)}`;else b="start";if(U.blocks&&U.blocks.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} ${b} (batch: ${U.blocks.length} blocks)`;return`${U.entityType}/${U.entityId.slice(0,8)} ${b} (${U.blockType??"paragraph"})`}})}function HM($,I){u($,I,{definition:K0,schema:wJ,createExecutor:(U)=>{return async(b)=>{return await U.client.insertMatrix(b)}},formatOutput:(U)=>TJ(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function AM($,I){u($,I,{definition:x0,schema:LJ,createExecutor:(U)=>{return async(b)=>{return await U.client.insertProcedureNode(b)}},formatOutput:hJ,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function OM($,I){u($,I,{definition:o0,schema:bH,createExecutor:(U)=>{return async(b)=>{return await U.client.instantiateArtifactTemplate(b)}},formatOutput:uJ,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function zM($,I){u($,I,{definition:f0,schema:vJ,createExecutor:(U)=>{return async(b)=>{return await U.client.linkArtifactToNode(b)}},formatOutput:eJ,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function LM($,I){u($,I,{definition:q0,schema:DJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listMatrixReferences(b)}},formatOutput:aJ,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function KM($,I){u($,I,{definition:u0,schema:qJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listNodeArtifactLinks(b)}},formatOutput:$H,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function vM($,I){u($,I,{definition:R0,schema:JJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listProcedureNodes(b)}},formatOutput:IH,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function VM($,I){u($,I,{definition:h0,schema:KJ,createExecutor:(U)=>{return async(b)=>{return await U.client.rebindMatrixToNode(b)}},formatOutput:dJ,getLogMessage:(U)=>{let b=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${b}`}})}function qM($,I){u($,I,{definition:l0,schema:FJ,createExecutor:(U)=>{return async(b)=>{return await U.client.reorderProcedureNodes(b)}},formatOutput:cJ,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function Eu($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function FM($,I){u($,I,{definition:d0,schema:NH,createExecutor:(U)=>{return async(b)=>{let w=b.mode??"library",X=b.limit??10;if(b.scope?.type==="artifact"&&w==="library"&&b.workspaceId){let G=await U.client.searchArtifacts({workspaceId:b.workspaceId,query:b.query,artifactType:b.artifactType,artifactStatus:b.artifactStatus,limit:X}),N=G.results.map((B)=>{let H=B.description?B.description.length>100?`${B.description.slice(0,97)}...`:B.description:`${B.artifactType}, ${B.status}`;return{entityType:"artifact",entityId:B.id,entityTitle:B.name,matchCount:1,bestBlockId:"",snippet:H,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${B.id}")`}}});return{mode:"library",found:N.length,results:N,hasMore:G.hasMore}}let D=await U.client.search({query:b.query,mode:w,entityType:b.scope?.type,entityId:b.scope?.entityId,orgId:b.orgId,workspaceId:b.workspaceId,spaceId:b.spaceId,limit:X,offset:0,authorName:b.authorName,yearMin:b.yearMin,yearMax:b.yearMax,journalName:b.journalName,tags:b.tags}),W=D.results??[];if(w==="library"){let G=W.map((N)=>{let{bestMatch:B}=N,H=Eu(B.rank,N.matchCount),J={entityType:N.entityType,entityId:N.entityId,entityTitle:N.entityTitle,matchCount:N.matchCount,bestBlockId:B.blockId,snippet:B.snippet,relevance:H,tags:N.tags,retrievalHint:B.blockId?{recommended:"blockIds",usage:`blockIds=['${B.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(N.literatureMetadata)J.literatureMetadata=N.literatureMetadata;if(N.creatorId)J.creatorId=N.creatorId;if(N.creatorName)J.creatorName=N.creatorName;return J});return{mode:"library",found:G.length,results:G,hasMore:D.hasMore}}let Q=W.map((G)=>{let N={entityType:G.entityType,entityId:G.entityId,entityTitle:G.entityTitle,blockId:"blockId"in G?G.blockId:"",snippet:"snippet"in G?G.snippet:"",relevance:"medium",retrievalHint:{recommended:"blockIds",usage:`blockIds=['${"blockId"in G?G.blockId:""}']`}},B=G.creatorId,H=G.creatorName;if(B)N.creatorId=B;if(H)N.creatorName=H;return N});return{mode:"blocks",found:Q.length,results:Q,hasMore:D.hasMore}}},formatOutput:(U)=>SJ(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function MM($,I){u($,I,{definition:p0,schema:YH,createExecutor:(U)=>{return async(b)=>{return await U.client.strReplaceBlock(b)}},formatOutput:ZJ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function jM($,I){u($,I,{definition:y0,schema:VJ,createExecutor:(U)=>{return async(b)=>{return await U.client.unlinkArtifactFromNode(b)}},formatOutput:sJ,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function EM($,I){u($,I,{definition:S0,schema:NJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifact(b)}},formatOutput:lJ,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function SM($,I){u($,I,{definition:c0,schema:MJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateMatrixRows(b)}},formatOutput:iJ,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function PM($,I){u($,I,{definition:m0,schema:jJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateProcedureNode(b)}},formatOutput:fJ,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function kM($,I){I.log.info("Registering tools..."),FM($,I),YM($,I),MM($,I),JM($,I),HM($,I),wM($,I),WM($,I),bM($,I),XM($,I),DM($,I),BM($,I),vM($,I),IM($,I),AM($,I),PM($,I),qM($,I),NM($,I),sF($,I),SM($,I),GM($,I),VM($,I),QM($,I),$M($,I),LM($,I),UM($,I),EM($,I),OM($,I),zM($,I),jM($,I),KM($,I),I.log.info("All tools registered")}function Su(){let $=process.argv.slice(2),I={};for(let U=0;U<$.length;U++){let b=$[U],w=$[U+1];if((b==="--api-key"||b==="-k")&&w)I.apiKey=w,U++;else if((b==="--api-url"||b==="-u")&&w)I.apiUrl=w,U++;else if(b==="--help"||b==="-h")process.exit(0)}return I}w4.info("Starting SURA MCP Server...");var RM=Su(),TM=RM.apiKey??process.env.SURA_API_KEY,Pu=RM.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!TM)w4.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),w4.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var ku=await uV({apiUrl:Pu,apiKey:TM}),_M=new yQ({name:"sura",version:"0.1.0"});kM(_M,ku);var ZM=new lQ,CM=async($)=>{w4.info(`Received ${$}, shutting down...`),await ZM.close(),process.exit(0)};process.on("SIGTERM",()=>CM("SIGTERM"));process.on("SIGINT",()=>CM("SIGINT"));process.on("uncaughtException",($)=>{w4.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{w4.error("Unhandled rejection:",$)});w4.info("Connecting stdio transport...");await _M.connect(ZM);w4.info("SURA MCP Server ready");
226
+ - Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var BH=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),blockId:Y.string().describe("Block ID to edit"),oldText:Y.string().describe("Exact text to find and replace (must match exactly)"),newText:Y.string().describe("Text to replace with")}),p0={name:"str_replace_block",description:"Replace text content in a specific block. Works like Claude Code str_replace - find exact text and replace it. oldText must match exactly (case-sensitive). Use get_content first to see exact block content. Content supports SURA markdown inline syntax: **bold**, *italic*, ~~strike~~, `code`, {u}underline{/u}, {color:red}text color{/color}, {bg:yellow}background{/bg}. Colors: default, gray, brown, red, orange, yellow, green, blue, purple, pink. "+"Records: only `draft` records are writable. On `completed`/`locked` records the call returns a structured `record_not_draft` error — stop and ask the user to re-open the record; do not try to flip the status yourself."};var JH=[d0,r0,p0,i0,K0,T0,_0,j0,E0,k0,P0,o0,n0,R0,M0,x0,m0,l0,g0,v0,c0,S0,C0,h0,V0,q0,Z0,f0,y0,u0,NH,DH,WH,GH,QH],ju=JH.map(($)=>$.name),Eu=Object.fromEntries(JH.map(($)=>[$.name,$]));function HH($){return{content:[{type:"text",text:$}]}}function AH($){return{content:[{type:"text",text:$}],isError:!0}}function u($,I,U){let{definition:b,schema:w,createExecutor:X,formatOutput:D,formatError:W=(B)=>B.message,getLogMessage:Q=(B)=>JSON.stringify(B).slice(0,100)}=U,G=X(I),N=w.shape;$.tool(b.name,b.description,N,async(B)=>{let H=B,J=Q(H);I.log.info(`${b.name}: ${J}`);try{let A=await G(H),O=D(A,H);return I.log.info(`${b.name}: completed`),HH(O)}catch(A){let O=A instanceof Error?W(A,H):"Unknown error";return I.log.error(`${b.name} failed:`,A),AH(`${b.name} error: ${O}`)}})}function sF($,I,U){let{definition:b,schema:w,createExecutor:X,formatSuccess:D,formatNotFound:W=(H)=>JSON.stringify({found:!1,error:H.error??"Not found"}),formatError:Q=(H)=>H.message,getLogMessage:G=(H)=>JSON.stringify(H).slice(0,100)}=U,N=X(I),B=w.shape;$.tool(b.name,b.description,B,async(H)=>{let J=H,A=G(J);I.log.info(`${b.name}: ${A}`);try{let O=await N(J);if(!O.found)return I.log.info(`${b.name}: not found`),{content:[{type:"text",text:W(O,J)}],isError:!0};return I.log.info(`${b.name}: found`),HH(D(O,J))}catch(O){let V=O instanceof Error?Q(O,J):"Unknown error";return I.log.error(`${b.name} failed:`,O),AH(`${b.name} error: ${V}`)}})}function $M($,I){u($,I,{definition:v0,schema:bJ,createExecutor:(U)=>{return async(b)=>{return await U.client.appendMatrixRows(b)}},formatOutput:iJ,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function IM($,I){u($,I,{definition:V0,schema:XJ,createExecutor:(U)=>{return async(b)=>{return await U.client.attachMatrix(b)}},formatOutput:aJ,getLogMessage:(U)=>{let b=U.nodeRef?` + node ${U.nodeRef.slice(0,8)}`:"";return`Attaching matrix ${U.matrixId.slice(0,8)} → ${U.entityType}:${U.entityId.slice(0,8)}${b}`}})}function UM($,I){u($,I,{definition:M0,schema:WJ,createExecutor:(U)=>{return async(b)=>{return await U.client.buildProcedureTree(b)}},formatOutput:nJ,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function wM($,I){u($,I,{definition:P0,schema:YJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createArtifact(b)}},formatOutput:yJ,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function bM($,I){u($,I,{definition:T0,schema:HJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createMatrixFromReactionArtifact(b)}},formatOutput:_J,getLogMessage:(U)=>`Deriving matrix from reaction ${U.reactionArtifactId.slice(0,8)}`})}function XM($,I){u($,I,{definition:j0,schema:QJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createDocument(b)}},formatOutput:kJ,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function DM($,I){u($,I,{definition:E0,schema:GJ,createExecutor:(U)=>{return async(b)=>{return U.client.createLiterature(b)}},formatOutput:RJ,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function WM($,I){u($,I,{definition:k0,schema:BJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createRecord(b)}},formatOutput:xJ,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function QM($,I){u($,I,{definition:_0,schema:hD,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteBlock(b)}},formatOutput:gJ,getLogMessage:(U)=>{if(U.blockIds&&U.blockIds.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} batch delete ${U.blockIds.length} blocks`;return`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId?.slice(0,8)??"unknown"}`}})}function GM($,I){u($,I,{definition:Z0,schema:AJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrix(b)}},formatOutput:tJ,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function NM($,I){u($,I,{definition:C0,schema:OJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrixRows(b)}},formatOutput:dJ,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function YM($,I){u($,I,{definition:g0,schema:zJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteProcedureNode(b)}},formatOutput:rJ,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function BM($,I){sF($,I,{definition:r0,schema:wH,createExecutor:(U)=>{return async(b)=>{return U.client.getContent(b)}},formatSuccess:PJ,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>{let b=U.blockIds?`blocks:${U.blockIds.length}`:U.segment?`segment:"${U.segment}"`:U.from_section&&U.to_section?`range:"${U.from_section}"-"${U.to_section}"`:U.node?`node:"${U.node}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.section?`section:"${U.section}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.refs?`refs:${U.refs.length}`:"overview";return`${U.entityId.slice(0,8)}... (${b})`}})}function JM($,I){u($,I,{definition:n0,schema:bH,createExecutor:(U)=>{return async(b)=>{if(U.workspaceContext&&!b.forceRefresh)return U.workspaceContext;let w=await U.client.getWorkspaceContext();return U.workspaceContext=w,w}},formatOutput:EJ,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function HM($,I){u($,I,{definition:i0,schema:yD,createExecutor:(U)=>{return async(b)=>{return await U.client.insertBlock(b)}},formatOutput:CJ,getLogMessage:(U)=>{let b;if(U.parentBlockId)b=`in:${U.parentBlockId.slice(0,8)}`;else if(U.beforeBlockId)b=`before:${U.beforeBlockId.slice(0,8)}`;else if(U.afterBlockId)b=`after:${U.afterBlockId.slice(0,8)}`;else b="start";if(U.blocks&&U.blocks.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} ${b} (batch: ${U.blocks.length} blocks)`;return`${U.entityType}/${U.entityId.slice(0,8)} ${b} (${U.blockType??"paragraph"})`}})}function AM($,I){u($,I,{definition:K0,schema:wJ,createExecutor:(U)=>{return async(b)=>{return await U.client.insertMatrix(b)}},formatOutput:(U)=>TJ(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function OM($,I){u($,I,{definition:x0,schema:LJ,createExecutor:(U)=>{return async(b)=>{return await U.client.insertProcedureNode(b)}},formatOutput:hJ,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function zM($,I){u($,I,{definition:o0,schema:XH,createExecutor:(U)=>{return async(b)=>{return await U.client.instantiateArtifactTemplate(b)}},formatOutput:lJ,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function LM($,I){u($,I,{definition:f0,schema:vJ,createExecutor:(U)=>{return async(b)=>{return await U.client.linkArtifactToNode(b)}},formatOutput:sJ,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function KM($,I){u($,I,{definition:q0,schema:DJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listMatrixReferences(b)}},formatOutput:eJ,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function vM($,I){u($,I,{definition:u0,schema:qJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listNodeArtifactLinks(b)}},formatOutput:IH,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function VM($,I){u($,I,{definition:R0,schema:JJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listProcedureNodes(b)}},formatOutput:UH,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function qM($,I){u($,I,{definition:h0,schema:KJ,createExecutor:(U)=>{return async(b)=>{return await U.client.rebindMatrixToNode(b)}},formatOutput:pJ,getLogMessage:(U)=>{let b=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${b}`}})}function FM($,I){u($,I,{definition:l0,schema:FJ,createExecutor:(U)=>{return async(b)=>{return await U.client.reorderProcedureNodes(b)}},formatOutput:mJ,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function Su($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function MM($,I){u($,I,{definition:d0,schema:YH,createExecutor:(U)=>{return async(b)=>{let w=b.mode??"library",X=b.limit??10;if(b.scope?.type==="artifact"&&w==="library"&&b.workspaceId){let G=await U.client.searchArtifacts({workspaceId:b.workspaceId,query:b.query,artifactType:b.artifactType,artifactStatus:b.artifactStatus,limit:X}),N=G.results.map((B)=>{let H=B.description?B.description.length>100?`${B.description.slice(0,97)}...`:B.description:`${B.artifactType}, ${B.status}`;return{entityType:"artifact",entityId:B.id,entityTitle:B.name,matchCount:1,bestBlockId:"",snippet:H,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${B.id}")`}}});return{mode:"library",found:N.length,results:N,hasMore:G.hasMore}}let D=await U.client.search({query:b.query,mode:w,entityType:b.scope?.type,entityId:b.scope?.entityId,orgId:b.orgId,workspaceId:b.workspaceId,spaceId:b.spaceId,limit:X,offset:0,authorName:b.authorName,yearMin:b.yearMin,yearMax:b.yearMax,journalName:b.journalName,tags:b.tags}),W=D.results??[];if(w==="library"){let G=W.map((N)=>{let{bestMatch:B}=N,H=Su(B.rank,N.matchCount),J={entityType:N.entityType,entityId:N.entityId,entityTitle:N.entityTitle,matchCount:N.matchCount,bestBlockId:B.blockId,snippet:B.snippet,relevance:H,tags:N.tags,retrievalHint:B.blockId?{recommended:"blockIds",usage:`blockIds=['${B.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(N.literatureMetadata)J.literatureMetadata=N.literatureMetadata;if(N.creatorId)J.creatorId=N.creatorId;if(N.creatorName)J.creatorName=N.creatorName;return J});return{mode:"library",found:G.length,results:G,hasMore:D.hasMore}}let Q=W.map((G)=>{let N={entityType:G.entityType,entityId:G.entityId,entityTitle:G.entityTitle,blockId:"blockId"in G?G.blockId:"",snippet:"snippet"in G?G.snippet:"",relevance:"medium",retrievalHint:{recommended:"blockIds",usage:`blockIds=['${"blockId"in G?G.blockId:""}']`}},B=G.creatorId,H=G.creatorName;if(B)N.creatorId=B;if(H)N.creatorName=H;return N});return{mode:"blocks",found:Q.length,results:Q,hasMore:D.hasMore}}},formatOutput:(U)=>SJ(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function jM($,I){u($,I,{definition:p0,schema:BH,createExecutor:(U)=>{return async(b)=>{return await U.client.strReplaceBlock(b)}},formatOutput:ZJ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function EM($,I){u($,I,{definition:y0,schema:VJ,createExecutor:(U)=>{return async(b)=>{return await U.client.unlinkArtifactFromNode(b)}},formatOutput:$H,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function SM($,I){u($,I,{definition:S0,schema:NJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifact(b)}},formatOutput:cJ,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function PM($,I){u($,I,{definition:c0,schema:MJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateMatrixRows(b)}},formatOutput:oJ,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function kM($,I){u($,I,{definition:m0,schema:jJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateProcedureNode(b)}},formatOutput:fJ,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function RM($,I){I.log.info("Registering tools..."),MM($,I),BM($,I),jM($,I),HM($,I),AM($,I),bM($,I),QM($,I),XM($,I),DM($,I),WM($,I),JM($,I),VM($,I),UM($,I),OM($,I),kM($,I),FM($,I),YM($,I),$M($,I),PM($,I),NM($,I),qM($,I),GM($,I),IM($,I),KM($,I),wM($,I),SM($,I),zM($,I),LM($,I),EM($,I),vM($,I),I.log.info("All tools registered")}function Pu(){let $=process.argv.slice(2),I={};for(let U=0;U<$.length;U++){let b=$[U],w=$[U+1];if((b==="--api-key"||b==="-k")&&w)I.apiKey=w,U++;else if((b==="--api-url"||b==="-u")&&w)I.apiUrl=w,U++;else if(b==="--help"||b==="-h")process.exit(0)}return I}w4.info("Starting SURA MCP Server...");var TM=Pu(),_M=TM.apiKey??process.env.SURA_API_KEY,ku=TM.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!_M)w4.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),w4.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var Ru=await lV({apiUrl:ku,apiKey:_M}),ZM=new yQ({name:"sura",version:"0.1.0"});RM(ZM,Ru);var CM=new lQ,gM=async($)=>{w4.info(`Received ${$}, shutting down...`),await CM.close(),process.exit(0)};process.on("SIGTERM",()=>gM("SIGTERM"));process.on("SIGINT",()=>gM("SIGINT"));process.on("uncaughtException",($)=>{w4.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{w4.error("Unhandled rejection:",$)});w4.info("Connecting stdio transport...");await ZM.connect(CM);w4.info("SURA MCP Server ready");