@sura_ai/mcp-server 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +44 -44
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var Ij=Object.create;var{getPrototypeOf:Uj,defineProperty:eD,getOwnPropertyNames:wj}=Object;var bj=Object.prototype.hasOwnProperty;var CH=($,I,U)=>{U=$!=null?Ij(Uj($)):{};let b=I||!$||!$.__esModule?eD(U,"default",{value:$,enumerable:!0}):U;for(let w of wj($))if(!bj.call(b,w))eD(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)eD($,U,{get:I[U],enumerable:!0,configurable:!0,set:(b)=>I[U]=()=>b})};var JU=Z((Sz)=>{Object.defineProperty(Sz,"__esModule",{value:!0});Sz.regexpCode=Sz.getEsmExportName=Sz.getProperty=Sz.safeStringify=Sz.stringify=Sz.strConcat=Sz.addCodeArg=Sz.str=Sz._=Sz.nil=Sz._Code=Sz.Name=Sz.IDENTIFIER=Sz._CodeOrName=void 0;class Xb{}Sz._CodeOrName=Xb;Sz.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class P1 extends Xb{constructor($){super();if(!Sz.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}}}Sz.Name=P1;class j6 extends Xb{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 P1)I[U.str]=(I[U.str]||0)+1;return I},{})}}Sz._Code=j6;Sz.nil=new j6("");function jz($,...I){let U=[$[0]],b=0;while(b<I.length)u8(U,I[b]),U.push($[++b]);return new j6(U)}Sz._=jz;var y8=new j6("+");function Ez($,...I){let U=[NU($[0])],b=0;while(b<I.length)U.push(y8),u8(U,I[b]),U.push(y8,NU($[++b]));return Lk(U),new j6(U)}Sz.str=Ez;function u8($,I){if(I instanceof j6)$.push(...I._items);else if(I instanceof P1)$.push(I);else $.push(Vk(I))}Sz.addCodeArg=u8;function Lk($){let I=1;while(I<$.length-1){if($[I]===y8){let U=Kk($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function Kk($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof P1||$[$.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 P1))return`"${$}${I.slice(1)}`;return}function vk($,I){return I.emptyStr()?$:$.emptyStr()?I:Ez`${$}${I}`}Sz.strConcat=vk;function Vk($){return typeof $=="number"||typeof $=="boolean"||$===null?$:NU(Array.isArray($)?$.join(","):$)}function qk($){return new j6(NU($))}Sz.stringify=qk;function NU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Sz.safeStringify=NU;function Mk($){return typeof $=="string"&&Sz.IDENTIFIER.test($)?new j6(`.${$}`):jz`[${$}]`}Sz.getProperty=Mk;function Fk($){if(typeof $=="string"&&Sz.IDENTIFIER.test($))return new j6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Sz.getEsmExportName=Fk;function jk($){return new j6($.toString())}Sz.regexpCode=jk});var r8=Z((Tz)=>{Object.defineProperty(Tz,"__esModule",{value:!0});Tz.ValueScope=Tz.ValueScopeName=Tz.Scope=Tz.varKinds=Tz.UsedValueState=void 0;var e$=JU();class kz extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var Wb;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(Wb||(Tz.UsedValueState=Wb={}));Tz.varKinds={const:new e$.Name("const"),let:new e$.Name("let"),var:new e$.Name("var")};class c8{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}}}Tz.Scope=c8;class m8 extends e$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=e$._`.${new e$.Name(I)}[${U}]`}}Tz.ValueScopeName=m8;var fk=e$._`\n`;class Rz extends c8{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?fk:e$.nil}}get(){return this._scope}name($){return new m8($,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,Wb.Started);let G=I(Q);if(G){let Y=this.opts.es5?Tz.varKinds.var:Tz.varKinds.const;w=e$._`${w}${Y} ${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 kz(Q);W.set(Q,Wb.Completed)})}return w}}Tz.ValueScope=Rz});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$=JU(),E6=r8(),z4=JU();Object.defineProperty(s$,"_",{enumerable:!0,get:function(){return z4._}});Object.defineProperty(s$,"str",{enumerable:!0,get:function(){return z4.str}});Object.defineProperty(s$,"strConcat",{enumerable:!0,get:function(){return z4.strConcat}});Object.defineProperty(s$,"nil",{enumerable:!0,get:function(){return z4.nil}});Object.defineProperty(s$,"getProperty",{enumerable:!0,get:function(){return z4.getProperty}});Object.defineProperty(s$,"stringify",{enumerable:!0,get:function(){return z4.stringify}});Object.defineProperty(s$,"regexpCode",{enumerable:!0,get:function(){return z4.regexpCode}});Object.defineProperty(s$,"Name",{enumerable:!0,get:function(){return z4.Name}});var Bb=r8();Object.defineProperty(s$,"Scope",{enumerable:!0,get:function(){return Bb.Scope}});Object.defineProperty(s$,"ValueScope",{enumerable:!0,get:function(){return Bb.ValueScope}});Object.defineProperty(s$,"ValueScopeName",{enumerable:!0,get:function(){return Bb.ValueScopeName}});Object.defineProperty(s$,"varKinds",{enumerable:!0,get:function(){return Bb.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 L4{optimizeNodes(){return this}optimizeNames($,I){return this}}class Zz extends L4{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=R1(this.rhs,$,I);return this}get names(){return this.rhs instanceof X$._CodeOrName?this.rhs.names:{}}}class o8 extends L4{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=R1(this.rhs,$,I),this}get names(){let $=this.lhs instanceof X$.Name?{}:{...this.lhs.names};return Jb($,this.rhs)}}class Cz extends o8{constructor($,I,U,b){super($,U,b);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class gz extends L4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class xz extends L4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class hz extends L4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class fz extends L4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=R1(this.code,$,I),this}get names(){return this.code instanceof X$._CodeOrName?this.code.names:{}}}class Hb extends L4{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;ck($,w.names),U.splice(b,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>p4($,I.names),{})}}class K4 extends Hb{render($){return"{"+$._n+super.render($)+"}"+$._n}}class yz extends Hb{}class BU extends K4{}BU.kind="else";class e6 extends K4{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 BU(U):U}if(I){if($===!1)return I instanceof e6?I:I.nodes;if(this.nodes.length)return this;return new e6(rz($),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=R1(this.condition,$,I),this}get names(){let $=super.names;if(Jb($,this.condition),this.else)p4($,this.else.names);return $}}e6.kind="if";class k1 extends K4{}k1.kind="for";class uz extends k1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=R1(this.iteration,$,I),this}get names(){return p4(super.names,this.iteration.names)}}class lz extends k1{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 $=Jb(super.names,this.from);return Jb($,this.to)}}class n8 extends k1{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=R1(this.iterable,$,I),this}get names(){return p4(super.names,this.iterable.names)}}class Qb extends K4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}Qb.kind="func";class Gb extends Hb{render($){return"return "+super.render($)}}Gb.kind="return";class cz extends K4{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)p4($,this.catch.names);if(this.finally)p4($,this.finally.names);return $}}class Yb extends K4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}Yb.kind="catch";class Nb extends K4{render($){return"finally"+super.render($)}}Nb.kind="finally";class mz{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 yz]}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 o8($,I,U))}add($,I){return this._leafNode(new Cz($,s$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X$.nil)this._leafNode(new fz($));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 BU)}endIf(){return this._endBlockNode(e6,BU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new uz($),I)}forRange($,I,U,b,w=this.opts.es5?E6.varKinds.var:E6.varKinds.let){let X=this._scope.toName($);return this._for(new lz(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 n8("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 n8("in",b,w,I),()=>U(w))}endFor(){return this._endBlockNode(k1)}label($){return this._leafNode(new gz($))}break($){return this._leafNode(new xz($))}return($){let I=new Gb;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Gb)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let b=new cz;if(this._blockNode(b),this.code($),I){let w=this.name("e");this._currNode=b.catch=new Yb(w),I(w)}if(U)this._currNode=b.finally=new Nb,this.code(U);return this._endBlockNode(Yb,Nb)}throw($){return this._leafNode(new hz($))}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 Qb($,I,U)),b)this.code(b).endFunc();return this}endFunc(){return this._endBlockNode(Qb)}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=mz;function p4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function Jb($,I){return I instanceof X$._CodeOrName?p4($,I.names):$}function R1($,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 ck($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function rz($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X$._`!${i8($)}`}s$.not=rz;var mk=nz(s$.operators.AND);function rk(...$){return $.reduce(mk)}s$.and=rk;var nk=nz(s$.operators.OR);function ik(...$){return $.reduce(nk)}s$.or=ik;function nz($){return(I,U)=>I===X$.nil?U:U===X$.nil?I:X$._`${i8(I)} ${$} ${i8(U)}`}function i8($){return $ instanceof X$.Name?$:X$._`(${$})`}});var W$=Z(($3)=>{Object.defineProperty($3,"__esModule",{value:!0});$3.checkStrictMode=$3.getErrorPath=$3.Type=$3.useFunc=$3.setEvaluated=$3.evaluatedPropsToName=$3.mergeEvaluated=$3.eachItem=$3.unescapeJsonPointer=$3.escapeJsonPointer=$3.escapeFragment=$3.unescapeFragment=$3.schemaRefOrVal=$3.schemaHasRulesButRef=$3.schemaHasRules=$3.checkUnknownRules=$3.alwaysValidSchema=$3.toHash=void 0;var H$=a(),tk=JU();function ak($){let I={};for(let U of $)I[U]=!0;return I}$3.toHash=ak;function ek($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return pz($,I),!tz(I,$.self.RULES.all)}$3.alwaysValidSchema=ek;function pz($,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])sz($,`unknown keyword: "${X}"`)}$3.checkUnknownRules=pz;function tz($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}$3.schemaHasRules=tz;function sk($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}$3.schemaHasRulesButRef=sk;function $2({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)}`}$3.schemaRefOrVal=$2;function I2($){return az(decodeURIComponent($))}$3.unescapeFragment=I2;function U2($){return encodeURIComponent(p8($))}$3.escapeFragment=U2;function p8($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}$3.escapeJsonPointer=p8;function az($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}$3.unescapeJsonPointer=az;function w2($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}$3.eachItem=w2;function oz({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}}$3.mergeEvaluated={props:oz({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} || {}`),t8($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:ez}),items:oz({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 ez($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",H$._`{}`);if(I!==void 0)t8($,U,I);return U}$3.evaluatedPropsToName=ez;function t8($,I,U){Object.keys(U).forEach((b)=>$.assign(H$._`${I}${H$.getProperty(b)}`,!0))}$3.setEvaluated=t8;var dz={};function b2($,I){return $.scopeValue("func",{ref:I,code:dz[I.code]||(dz[I.code]=new tk._Code(I.code))})}$3.useFunc=b2;var d8;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(d8||($3.Type=d8={}));function X2($,I,U){if($ instanceof H$.Name){let b=I===d8.Num;return U?b?H$._`"[" + ${$} + "]"`:H$._`"['" + ${$} + "']"`:b?H$._`"/" + ${$}`:H$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?H$.getProperty($).toString():"/"+p8($)}$3.getErrorPath=X2;function sz($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}$3.checkStrictMode=sz});var s6=Z((U3)=>{Object.defineProperty(U3,"__esModule",{value:!0});var y$=a(),M2={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")};U3.default=M2});var HU=Z((D3)=>{Object.defineProperty(D3,"__esModule",{value:!0});D3.extendErrors=D3.resetErrorsCount=D3.reportExtraError=D3.reportError=D3.keyword$DataError=D3.keywordError=void 0;var D$=a(),Ob=W$(),n$=s6();D3.keywordError={message:({keyword:$})=>D$.str`must pass "${$}" keyword validation`};D3.keyword$DataError={message:({keyword:$,schemaType:I})=>I?D$.str`"${$}" keyword must be ${I} ($data)`:D$.str`"${$}" keyword is invalid ($data)`};function j2($,I=D3.keywordError,U,b){let{it:w}=$,{gen:X,compositeRule:D,allErrors:W}=w,Q=X3($,I,U);if(b!==null&&b!==void 0?b:D||W)w3(X,Q);else b3(w,D$._`[${Q}]`)}D3.reportError=j2;function E2($,I=D3.keywordError,U){let{it:b}=$,{gen:w,compositeRule:X,allErrors:D}=b,W=X3($,I,U);if(w3(w,W),!(X||D))b3(b,n$.default.vErrors)}D3.reportExtraError=E2;function S2($,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)))}D3.resetErrorsCount=S2;function P2({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)})}D3.extendErrors=P2;function w3($,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 b3($,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 t4={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 X3($,I,U){let{createErrors:b}=$.it;if(b===!1)return D$._`{}`;return k2($,I,U)}function k2($,I,U={}){let{gen:b,it:w}=$,X=[R2(w,U),T2($,U)];return _2($,I,X),b.object(...X)}function R2({errorPath:$},{instancePath:I}){let U=I?D$.str`${$}${Ob.getErrorPath(I,Ob.Type.Str)}`:$;return[n$.default.instancePath,D$.strConcat(n$.default.instancePath,U)]}function T2({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:b}){let w=b?I:D$.str`${I}/${$}`;if(U)w=D$.str`${w}${Ob.getErrorPath(U,Ob.Type.Str)}`;return[t4.schemaPath,w]}function _2($,{params:I,message:U},b){let{keyword:w,data:X,schemaValue:D,it:W}=$,{opts:Q,propertyName:G,topSchemaRef:Y,schemaPath:J}=W;if(b.push([t4.keyword,w],[t4.params,typeof I=="function"?I($):I||D$._`{}`]),Q.messages)b.push([t4.message,typeof U=="function"?U($):U]);if(Q.verbose)b.push([t4.schema,D],[t4.parentSchema,D$._`${Y}${J}`],[n$.default.data,X]);if(G)b.push([t4.propertyName,G])}});var N3=Z((G3)=>{Object.defineProperty(G3,"__esModule",{value:!0});G3.boolOrEmptySchema=G3.topBoolOrEmptySchema=void 0;var h2=HU(),f2=a(),y2=s6(),u2={message:"boolean schema is false"};function l2($){let{gen:I,schema:U,validateName:b}=$;if(U===!1)Q3($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(y2.default.data);else I.assign(f2._`${b}.errors`,null),I.return(!0)}G3.topBoolOrEmptySchema=l2;function c2($,I){let{gen:U,schema:b}=$;if(b===!1)U.var(I,!1),Q3($);else U.var(I,!0)}G3.boolOrEmptySchema=c2;function Q3($,I){let{gen:U,data:b}=$,w={gen:U,keyword:"false schema",data:b,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};h2.reportError(w,u2,void 0,I)}});var e8=Z((J3)=>{Object.defineProperty(J3,"__esModule",{value:!0});J3.getRules=J3.isJSONType=void 0;var r2=["string","number","integer","boolean","null","object","array"],n2=new Set(r2);function i2($){return typeof $=="string"&&n2.has($)}J3.isJSONType=i2;function o2(){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:{}}}J3.getRules=o2});var s8=Z((O3)=>{Object.defineProperty(O3,"__esModule",{value:!0});O3.shouldUseRule=O3.shouldUseGroup=O3.schemaHasRulesForType=void 0;function p2({schema:$,self:I},U){let b=I.RULES.types[U];return b&&b!==!0&&H3($,b)}O3.schemaHasRulesForType=p2;function H3($,I){return I.rules.some((U)=>A3($,U))}O3.shouldUseGroup=H3;function A3($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((b)=>$[b]!==void 0))}O3.shouldUseRule=A3});var AU=Z((V3)=>{Object.defineProperty(V3,"__esModule",{value:!0});V3.reportTypeError=V3.checkDataTypes=V3.checkDataType=V3.coerceAndCheckDataType=V3.getJSONTypes=V3.getSchemaTypes=V3.DataType=void 0;var e2=e8(),s2=s8(),$R=HU(),p=a(),L3=W$(),T1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(T1||(V3.DataType=T1={}));function IR($){let I=K3($.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}V3.getSchemaTypes=IR;function K3($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(e2.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}V3.getJSONTypes=K3;function UR($,I){let{gen:U,data:b,opts:w}=$,X=wR(I,w.coerceTypes),D=I.length>0&&!(X.length===0&&I.length===1&&s2.schemaHasRulesForType($,I[0]));if(D){let W=IQ(I,b,w.strictNumbers,T1.Wrong);U.if(W,()=>{if(X.length)bR($,I,X);else UQ($)})}return D}V3.coerceAndCheckDataType=UR;var v3=new Set(["string","number","integer","boolean","null"]);function wR($,I){return I?$.filter((U)=>v3.has(U)||I==="array"&&U==="array"):[]}function bR($,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(IQ(I,w,X.strictNumbers),()=>b.assign(W,w)));b.if(p._`${W} !== undefined`);for(let G of U)if(v3.has(G)||G==="array"&&X.coerceTypes==="array")Q(G);b.else(),UQ($),b.endIf(),b.if(p._`${W} !== undefined`,()=>{b.assign(w,W),XR($,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 $j=Object.create;var{getPrototypeOf:Ij,defineProperty:eD,getOwnPropertyNames:Uj}=Object;var wj=Object.prototype.hasOwnProperty;var ZH=($,I,U)=>{U=$!=null?$j(Ij($)):{};let b=I||!$||!$.__esModule?eD(U,"default",{value:$,enumerable:!0}):U;for(let w of Uj($))if(!wj.call(b,w))eD(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)eD($,U,{get:I[U],enumerable:!0,configurable:!0,set:(b)=>I[U]=()=>b})};var JU=Z((Ez)=>{Object.defineProperty(Ez,"__esModule",{value:!0});Ez.regexpCode=Ez.getEsmExportName=Ez.getProperty=Ez.safeStringify=Ez.stringify=Ez.strConcat=Ez.addCodeArg=Ez.str=Ez._=Ez.nil=Ez._Code=Ez.Name=Ez.IDENTIFIER=Ez._CodeOrName=void 0;class Xb{}Ez._CodeOrName=Xb;Ez.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class P1 extends Xb{constructor($){super();if(!Ez.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}}}Ez.Name=P1;class j6 extends Xb{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 P1)I[U.str]=(I[U.str]||0)+1;return I},{})}}Ez._Code=j6;Ez.nil=new j6("");function Fz($,...I){let U=[$[0]],b=0;while(b<I.length)u8(U,I[b]),U.push($[++b]);return new j6(U)}Ez._=Fz;var y8=new j6("+");function jz($,...I){let U=[NU($[0])],b=0;while(b<I.length)U.push(y8),u8(U,I[b]),U.push(y8,NU($[++b]));return zk(U),new j6(U)}Ez.str=jz;function u8($,I){if(I instanceof j6)$.push(...I._items);else if(I instanceof P1)$.push(I);else $.push(vk(I))}Ez.addCodeArg=u8;function zk($){let I=1;while(I<$.length-1){if($[I]===y8){let U=Lk($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function Lk($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof P1||$[$.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 P1))return`"${$}${I.slice(1)}`;return}function Kk($,I){return I.emptyStr()?$:$.emptyStr()?I:jz`${$}${I}`}Ez.strConcat=Kk;function vk($){return typeof $=="number"||typeof $=="boolean"||$===null?$:NU(Array.isArray($)?$.join(","):$)}function Vk($){return new j6(NU($))}Ez.stringify=Vk;function NU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ez.safeStringify=NU;function qk($){return typeof $=="string"&&Ez.IDENTIFIER.test($)?new j6(`.${$}`):Fz`[${$}]`}Ez.getProperty=qk;function Mk($){if(typeof $=="string"&&Ez.IDENTIFIER.test($))return new j6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Ez.getEsmExportName=Mk;function Fk($){return new j6($.toString())}Ez.regexpCode=Fk});var r8=Z((Rz)=>{Object.defineProperty(Rz,"__esModule",{value:!0});Rz.ValueScope=Rz.ValueScopeName=Rz.Scope=Rz.varKinds=Rz.UsedValueState=void 0;var e$=JU();class Pz extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var Wb;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(Wb||(Rz.UsedValueState=Wb={}));Rz.varKinds={const:new e$.Name("const"),let:new e$.Name("let"),var:new e$.Name("var")};class c8{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}}}Rz.Scope=c8;class m8 extends e$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=e$._`.${new e$.Name(I)}[${U}]`}}Rz.ValueScopeName=m8;var hk=e$._`\n`;class kz extends c8{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?hk:e$.nil}}get(){return this._scope}name($){return new m8($,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,Wb.Started);let G=I(Q);if(G){let Y=this.opts.es5?Rz.varKinds.var:Rz.varKinds.const;w=e$._`${w}${Y} ${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 Pz(Q);W.set(Q,Wb.Completed)})}return w}}Rz.ValueScope=kz});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$=JU(),E6=r8(),z4=JU();Object.defineProperty(s$,"_",{enumerable:!0,get:function(){return z4._}});Object.defineProperty(s$,"str",{enumerable:!0,get:function(){return z4.str}});Object.defineProperty(s$,"strConcat",{enumerable:!0,get:function(){return z4.strConcat}});Object.defineProperty(s$,"nil",{enumerable:!0,get:function(){return z4.nil}});Object.defineProperty(s$,"getProperty",{enumerable:!0,get:function(){return z4.getProperty}});Object.defineProperty(s$,"stringify",{enumerable:!0,get:function(){return z4.stringify}});Object.defineProperty(s$,"regexpCode",{enumerable:!0,get:function(){return z4.regexpCode}});Object.defineProperty(s$,"Name",{enumerable:!0,get:function(){return z4.Name}});var Bb=r8();Object.defineProperty(s$,"Scope",{enumerable:!0,get:function(){return Bb.Scope}});Object.defineProperty(s$,"ValueScope",{enumerable:!0,get:function(){return Bb.ValueScope}});Object.defineProperty(s$,"ValueScopeName",{enumerable:!0,get:function(){return Bb.ValueScopeName}});Object.defineProperty(s$,"varKinds",{enumerable:!0,get:function(){return Bb.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 L4{optimizeNodes(){return this}optimizeNames($,I){return this}}class _z extends L4{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=R1(this.rhs,$,I);return this}get names(){return this.rhs instanceof X$._CodeOrName?this.rhs.names:{}}}class o8 extends L4{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=R1(this.rhs,$,I),this}get names(){let $=this.lhs instanceof X$.Name?{}:{...this.lhs.names};return Jb($,this.rhs)}}class Zz extends o8{constructor($,I,U,b){super($,U,b);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class Cz extends L4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class gz extends L4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class xz extends L4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class hz extends L4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=R1(this.code,$,I),this}get names(){return this.code instanceof X$._CodeOrName?this.code.names:{}}}class Hb extends L4{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;lk($,w.names),U.splice(b,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>p4($,I.names),{})}}class K4 extends Hb{render($){return"{"+$._n+super.render($)+"}"+$._n}}class fz extends Hb{}class BU extends K4{}BU.kind="else";class e6 extends K4{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 BU(U):U}if(I){if($===!1)return I instanceof e6?I:I.nodes;if(this.nodes.length)return this;return new e6(mz($),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=R1(this.condition,$,I),this}get names(){let $=super.names;if(Jb($,this.condition),this.else)p4($,this.else.names);return $}}e6.kind="if";class k1 extends K4{}k1.kind="for";class yz extends k1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=R1(this.iteration,$,I),this}get names(){return p4(super.names,this.iteration.names)}}class uz extends k1{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 $=Jb(super.names,this.from);return Jb($,this.to)}}class n8 extends k1{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=R1(this.iterable,$,I),this}get names(){return p4(super.names,this.iterable.names)}}class Qb extends K4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}Qb.kind="func";class Gb extends Hb{render($){return"return "+super.render($)}}Gb.kind="return";class lz extends K4{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)p4($,this.catch.names);if(this.finally)p4($,this.finally.names);return $}}class Yb extends K4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}Yb.kind="catch";class Nb extends K4{render($){return"finally"+super.render($)}}Nb.kind="finally";class cz{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 _z($,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 o8($,I,U))}add($,I){return this._leafNode(new Zz($,s$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X$.nil)this._leafNode(new hz($));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 BU)}endIf(){return this._endBlockNode(e6,BU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new yz($),I)}forRange($,I,U,b,w=this.opts.es5?E6.varKinds.var:E6.varKinds.let){let X=this._scope.toName($);return this._for(new uz(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 n8("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 n8("in",b,w,I),()=>U(w))}endFor(){return this._endBlockNode(k1)}label($){return this._leafNode(new Cz($))}break($){return this._leafNode(new gz($))}return($){let I=new Gb;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Gb)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let b=new lz;if(this._blockNode(b),this.code($),I){let w=this.name("e");this._currNode=b.catch=new Yb(w),I(w)}if(U)this._currNode=b.finally=new Nb,this.code(U);return this._endBlockNode(Yb,Nb)}throw($){return this._leafNode(new xz($))}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 Qb($,I,U)),b)this.code(b).endFunc();return this}endFunc(){return this._endBlockNode(Qb)}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=cz;function p4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function Jb($,I){return I instanceof X$._CodeOrName?p4($,I.names):$}function R1($,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 lk($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function mz($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X$._`!${i8($)}`}s$.not=mz;var ck=rz(s$.operators.AND);function mk(...$){return $.reduce(ck)}s$.and=mk;var rk=rz(s$.operators.OR);function nk(...$){return $.reduce(rk)}s$.or=nk;function rz($){return(I,U)=>I===X$.nil?U:U===X$.nil?I:X$._`${i8(I)} ${$} ${i8(U)}`}function i8($){return $ instanceof X$.Name?$:X$._`(${$})`}});var W$=Z((sz)=>{Object.defineProperty(sz,"__esModule",{value:!0});sz.checkStrictMode=sz.getErrorPath=sz.Type=sz.useFunc=sz.setEvaluated=sz.evaluatedPropsToName=sz.mergeEvaluated=sz.eachItem=sz.unescapeJsonPointer=sz.escapeJsonPointer=sz.escapeFragment=sz.unescapeFragment=sz.schemaRefOrVal=sz.schemaHasRulesButRef=sz.schemaHasRules=sz.checkUnknownRules=sz.alwaysValidSchema=sz.toHash=void 0;var H$=a(),pk=JU();function tk($){let I={};for(let U of $)I[U]=!0;return I}sz.toHash=tk;function ak($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return dz($,I),!pz(I,$.self.RULES.all)}sz.alwaysValidSchema=ak;function dz($,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])ez($,`unknown keyword: "${X}"`)}sz.checkUnknownRules=dz;function pz($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}sz.schemaHasRules=pz;function ek($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}sz.schemaHasRulesButRef=ek;function sk({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)}`}sz.schemaRefOrVal=sk;function $2($){return tz(decodeURIComponent($))}sz.unescapeFragment=$2;function I2($){return encodeURIComponent(p8($))}sz.escapeFragment=I2;function p8($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}sz.escapeJsonPointer=p8;function tz($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}sz.unescapeJsonPointer=tz;function U2($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}sz.eachItem=U2;function iz({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}}sz.mergeEvaluated={props:iz({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} || {}`),t8($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:az}),items:iz({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 az($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",H$._`{}`);if(I!==void 0)t8($,U,I);return U}sz.evaluatedPropsToName=az;function t8($,I,U){Object.keys(U).forEach((b)=>$.assign(H$._`${I}${H$.getProperty(b)}`,!0))}sz.setEvaluated=t8;var oz={};function w2($,I){return $.scopeValue("func",{ref:I,code:oz[I.code]||(oz[I.code]=new pk._Code(I.code))})}sz.useFunc=w2;var d8;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(d8||(sz.Type=d8={}));function b2($,I,U){if($ instanceof H$.Name){let b=I===d8.Num;return U?b?H$._`"[" + ${$} + "]"`:H$._`"['" + ${$} + "']"`:b?H$._`"/" + ${$}`:H$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?H$.getProperty($).toString():"/"+p8($)}sz.getErrorPath=b2;function ez($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}sz.checkStrictMode=ez});var s6=Z((I3)=>{Object.defineProperty(I3,"__esModule",{value:!0});var y$=a(),q2={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")};I3.default=q2});var HU=Z((X3)=>{Object.defineProperty(X3,"__esModule",{value:!0});X3.extendErrors=X3.resetErrorsCount=X3.reportExtraError=X3.reportError=X3.keyword$DataError=X3.keywordError=void 0;var D$=a(),Ob=W$(),n$=s6();X3.keywordError={message:({keyword:$})=>D$.str`must pass "${$}" keyword validation`};X3.keyword$DataError={message:({keyword:$,schemaType:I})=>I?D$.str`"${$}" keyword must be ${I} ($data)`:D$.str`"${$}" keyword is invalid ($data)`};function F2($,I=X3.keywordError,U,b){let{it:w}=$,{gen:X,compositeRule:D,allErrors:W}=w,Q=b3($,I,U);if(b!==null&&b!==void 0?b:D||W)U3(X,Q);else w3(w,D$._`[${Q}]`)}X3.reportError=F2;function j2($,I=X3.keywordError,U){let{it:b}=$,{gen:w,compositeRule:X,allErrors:D}=b,W=b3($,I,U);if(U3(w,W),!(X||D))w3(b,n$.default.vErrors)}X3.reportExtraError=j2;function E2($,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)))}X3.resetErrorsCount=E2;function S2({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)})}X3.extendErrors=S2;function U3($,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 w3($,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 t4={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 b3($,I,U){let{createErrors:b}=$.it;if(b===!1)return D$._`{}`;return P2($,I,U)}function P2($,I,U={}){let{gen:b,it:w}=$,X=[k2(w,U),R2($,U)];return T2($,I,X),b.object(...X)}function k2({errorPath:$},{instancePath:I}){let U=I?D$.str`${$}${Ob.getErrorPath(I,Ob.Type.Str)}`:$;return[n$.default.instancePath,D$.strConcat(n$.default.instancePath,U)]}function R2({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:b}){let w=b?I:D$.str`${I}/${$}`;if(U)w=D$.str`${w}${Ob.getErrorPath(U,Ob.Type.Str)}`;return[t4.schemaPath,w]}function T2($,{params:I,message:U},b){let{keyword:w,data:X,schemaValue:D,it:W}=$,{opts:Q,propertyName:G,topSchemaRef:Y,schemaPath:J}=W;if(b.push([t4.keyword,w],[t4.params,typeof I=="function"?I($):I||D$._`{}`]),Q.messages)b.push([t4.message,typeof U=="function"?U($):U]);if(Q.verbose)b.push([t4.schema,D],[t4.parentSchema,D$._`${Y}${J}`],[n$.default.data,X]);if(G)b.push([t4.propertyName,G])}});var Y3=Z((Q3)=>{Object.defineProperty(Q3,"__esModule",{value:!0});Q3.boolOrEmptySchema=Q3.topBoolOrEmptySchema=void 0;var x2=HU(),h2=a(),f2=s6(),y2={message:"boolean schema is false"};function u2($){let{gen:I,schema:U,validateName:b}=$;if(U===!1)W3($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(f2.default.data);else I.assign(h2._`${b}.errors`,null),I.return(!0)}Q3.topBoolOrEmptySchema=u2;function l2($,I){let{gen:U,schema:b}=$;if(b===!1)U.var(I,!1),W3($);else U.var(I,!0)}Q3.boolOrEmptySchema=l2;function W3($,I){let{gen:U,data:b}=$,w={gen:U,keyword:"false schema",data:b,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};x2.reportError(w,y2,void 0,I)}});var e8=Z((N3)=>{Object.defineProperty(N3,"__esModule",{value:!0});N3.getRules=N3.isJSONType=void 0;var m2=["string","number","integer","boolean","null","object","array"],r2=new Set(m2);function n2($){return typeof $=="string"&&r2.has($)}N3.isJSONType=n2;function i2(){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:{}}}N3.getRules=i2});var s8=Z((A3)=>{Object.defineProperty(A3,"__esModule",{value:!0});A3.shouldUseRule=A3.shouldUseGroup=A3.schemaHasRulesForType=void 0;function d2({schema:$,self:I},U){let b=I.RULES.types[U];return b&&b!==!0&&B3($,b)}A3.schemaHasRulesForType=d2;function B3($,I){return I.rules.some((U)=>H3($,U))}A3.shouldUseGroup=B3;function H3($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((b)=>$[b]!==void 0))}A3.shouldUseRule=H3});var AU=Z((v3)=>{Object.defineProperty(v3,"__esModule",{value:!0});v3.reportTypeError=v3.checkDataTypes=v3.checkDataType=v3.coerceAndCheckDataType=v3.getJSONTypes=v3.getSchemaTypes=v3.DataType=void 0;var a2=e8(),e2=s8(),s2=HU(),p=a(),z3=W$(),T1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(T1||(v3.DataType=T1={}));function $R($){let I=L3($.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}v3.getSchemaTypes=$R;function L3($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(a2.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}v3.getJSONTypes=L3;function IR($,I){let{gen:U,data:b,opts:w}=$,X=UR(I,w.coerceTypes),D=I.length>0&&!(X.length===0&&I.length===1&&e2.schemaHasRulesForType($,I[0]));if(D){let W=IQ(I,b,w.strictNumbers,T1.Wrong);U.if(W,()=>{if(X.length)wR($,I,X);else UQ($)})}return D}v3.coerceAndCheckDataType=IR;var K3=new Set(["string","number","integer","boolean","null"]);function UR($,I){return I?$.filter((U)=>K3.has(U)||I==="array"&&U==="array"):[]}function wR($,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(IQ(I,w,X.strictNumbers),()=>b.assign(W,w)));b.if(p._`${W} !== undefined`);for(let G of U)if(K3.has(G)||G==="array"&&X.coerceTypes==="array")Q(G);b.else(),UQ($),b.endIf(),b.if(p._`${W} !== undefined`,()=>{b.assign(w,W),bR($,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 XR({gen:$,parentData:I,parentDataProperty:U},b){$.if(p._`${I} !== undefined`,()=>$.assign(p._`${I}[${U}]`,b))}function $Q($,I,U,b=T1.Correct){let w=b===T1.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===T1.Correct?X:p.not(X);function D(W=p.nil){return p.and(p._`typeof ${I} == "number"`,W,U?p._`isFinite(${I})`:p.nil)}}V3.checkDataType=$Q;function IQ($,I,U,b){if($.length===1)return $Q($[0],I,U,b);let w,X=L3.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,$Q(D,I,U,b));return w}V3.checkDataTypes=IQ;var DR={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?p._`{type: ${$}}`:p._`{type: ${I}}`};function UQ($){let I=WR($);$R.reportError(I,DR)}V3.reportTypeError=UQ;function WR($){let{gen:I,data:U,schema:b}=$,w=L3.schemaRefOrVal($,b,"type");return{gen:I,keyword:"type",data:U,schema:b.type,schemaCode:w,schemaValue:w,parentSchema:b,params:{},it:$}}});var E3=Z((F3)=>{Object.defineProperty(F3,"__esModule",{value:!0});F3.assignDefaults=void 0;var _1=a(),HR=W$();function AR($,I){let{properties:U,items:b}=$.schema;if(I==="object"&&U)for(let w in U)M3($,w,U[w].default);else if(I==="array"&&Array.isArray(b))b.forEach((w,X)=>M3($,X,w.default))}F3.assignDefaults=AR;function M3($,I,U){let{gen:b,compositeRule:w,data:X,opts:D}=$;if(U===void 0)return;let W=_1._`${X}${_1.getProperty(I)}`;if(w){HR.checkStrictMode($,`default is ignored for: ${W}`);return}let Q=_1._`${W} === undefined`;if(D.useDefaults==="empty")Q=_1._`${Q} || ${W} === null || ${W} === ""`;b.if(Q,_1._`${W} = ${_1.stringify(U)}`)}});var O6=Z((k3)=>{Object.defineProperty(k3,"__esModule",{value:!0});k3.validateUnion=k3.validateArray=k3.usePattern=k3.callValidateCode=k3.schemaProperties=k3.allSchemaProperties=k3.noPropertyInData=k3.propertyInData=k3.isOwnProperty=k3.hasPropFunc=k3.reportMissingProp=k3.checkMissingProp=k3.checkReportMissingProp=void 0;var K$=a(),wQ=W$(),v4=s6(),OR=W$();function zR($,I){let{gen:U,data:b,it:w}=$;U.if(XQ(U,b,I,w.opts.ownProperties),()=>{$.setParams({missingProperty:K$._`${I}`},!0),$.error()})}k3.checkReportMissingProp=zR;function LR({gen:$,data:I,it:{opts:U}},b,w){return K$.or(...b.map((X)=>K$.and(XQ($,I,X,U.ownProperties),K$._`${w} = ${X}`)))}k3.checkMissingProp=LR;function KR($,I){$.setParams({missingProperty:I},!0),$.error()}k3.reportMissingProp=KR;function S3($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:K$._`Object.prototype.hasOwnProperty`})}k3.hasPropFunc=S3;function bQ($,I,U){return K$._`${S3($)}.call(${I}, ${U})`}k3.isOwnProperty=bQ;function vR($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} !== undefined`;return b?K$._`${w} && ${bQ($,I,U)}`:w}k3.propertyInData=vR;function XQ($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} === undefined`;return b?K$.or(w,K$.not(bQ($,I,U))):w}k3.noPropertyInData=XQ;function P3($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}k3.allSchemaProperties=P3;function VR($,I){return P3(I).filter((U)=>!wQ.alwaysValidSchema($,I[U]))}k3.schemaProperties=VR;function qR({schemaCode:$,data:I,it:{gen:U,topSchemaRef:b,schemaPath:w,errorPath:X},it:D},W,Q,G){let Y=G?K$._`${$}, ${I}, ${b}${w}`:I,J=[[v4.default.instancePath,K$.strConcat(v4.default.instancePath,X)],[v4.default.parentData,D.parentData],[v4.default.parentDataProperty,D.parentDataProperty],[v4.default.rootData,v4.default.rootData]];if(D.opts.dynamicRef)J.push([v4.default.dynamicAnchors,v4.default.dynamicAnchors]);let H=K$._`${Y}, ${U.object(...J)}`;return Q!==K$.nil?K$._`${W}.call(${Q}, ${H})`:K$._`${W}(${H})`}k3.callValidateCode=qR;var MR=K$._`new RegExp`;function FR({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"?MR:OR.useFunc($,w)}(${U}, ${b})`})}k3.usePattern=FR;function jR($){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:wQ.Type.Num},X),I.if(K$.not(X),W)})}}k3.validateArray=jR;function ER($){let{gen:I,schema:U,keyword:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((Q)=>wQ.alwaysValidSchema(w,Q))&&!w.opts.unevaluated)return;let D=I.let("valid",!1),W=I.name("_valid");I.block(()=>U.forEach((Q,G)=>{let Y=$.subschema({keyword:b,schemaProp:G,compositeRule:!0},W);if(I.assign(D,K$._`${D} || ${W}`),!$.mergeValidEvaluated(Y,W))I.if(K$.not(D))})),$.result(D,()=>$.reset(),()=>$.error(!0))}k3.validateUnion=ER});var g3=Z((Z3)=>{Object.defineProperty(Z3,"__esModule",{value:!0});Z3.validateKeywordUsage=Z3.validSchemaType=Z3.funcKeywordCode=Z3.macroKeywordCode=void 0;var i$=a(),a4=s6(),yR=O6(),uR=HU();function lR($,I){let{gen:U,keyword:b,schema:w,parentSchema:X,it:D}=$,W=I.macro.call(D.self,w,X,D),Q=_3(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=lR;function cR($,I){var U;let{gen:b,keyword:w,schema:X,parentSchema:D,$data:W,it:Q}=$;rR(Q,I);let G=!W&&I.compile?I.compile.call(Q.self,X,D,Q):I.validate,Y=_3(b,w,G),J=b.let("valid");$.block$data(J,H),$.ok((U=I.valid)!==null&&U!==void 0?U:J);function H(){if(I.errors===!1){if(O(),I.modifying)T3($);V(()=>$.error())}else{let q=I.async?B():A();if(I.modifying)T3($);V(()=>mR($,q))}}function B(){let q=b.let("ruleErrs",null);return b.try(()=>O(i$._`await `),(k)=>b.assign(J,!1).if(i$._`${k} instanceof ${Q.ValidationError}`,()=>b.assign(q,i$._`${k}.errors`),()=>b.throw(k))),q}function A(){let q=i$._`${Y}.errors`;return b.assign(q,null),O(i$.nil),q}function O(q=I.async?i$._`await `:i$.nil){let k=Q.opts.passContext?a4.default.this:a4.default.self,P=!(("compile"in I)&&!W||I.schema===!1);b.assign(J,i$._`${q}${yR.callValidateCode($,Y,k,P)}`,I.modifying)}function V(q){var k;b.if(i$.not((k=I.valid)!==null&&k!==void 0?k:J),q)}}Z3.funcKeywordCode=cR;function T3($){let{gen:I,data:U,it:b}=$;I.if(b.parentData,()=>I.assign(U,i$._`${b.parentData}[${b.parentDataProperty}]`))}function mR($,I){let{gen:U}=$;U.if(i$._`Array.isArray(${I})`,()=>{U.assign(a4.default.vErrors,i$._`${a4.default.vErrors} === null ? ${I} : ${a4.default.vErrors}.concat(${I})`).assign(a4.default.errors,i$._`${a4.default.vErrors}.length`),uR.extendErrors($)},()=>$.error())}function rR({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function _3($,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 nR($,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=nR;function iR({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=iR});var y3=Z((h3)=>{Object.defineProperty(h3,"__esModule",{value:!0});h3.extendSubschemaMode=h3.extendSubschemaData=h3.getSubschema=void 0;var h6=a(),x3=W$();function tR($,{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}/${x3.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')}h3.getSubschema=tR;function aR($,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:Y,opts:J}=I,H=W.let("data",h6._`${I.data}${h6.getProperty(U)}`,!0);Q(H),$.errorPath=h6.str`${G}${x3.getErrorPath(U,b,J.jsPropertySyntax)}`,$.parentDataProperty=h6._`${U}`,$.dataPathArr=[...Y,$.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]}}h3.extendSubschemaData=aR;function eR($,{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}h3.extendSubschemaMode=eR});var DQ=Z(($o,u3)=>{u3.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 c3=Z((Io,l3)=>{var V4=l3.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(){};zb(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 zb($,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 Y in b){var J=b[Y];if(Array.isArray(J)){if(Y in V4.arrayKeywords)for(var H=0;H<J.length;H++)zb($,I,U,J[H],w+"/"+Y+"/"+H,X,w,Y,b,H)}else if(Y in V4.propsKeywords){if(J&&typeof J=="object")for(var B in J)zb($,I,U,J[B],w+"/"+Y+"/"+IT(B),X,w,Y,b,B)}else if(Y in V4.keywords||$.allKeys&&!(Y in V4.skipKeywords))zb($,I,U,J,w+"/"+Y,X,w,Y,b)}U(b,w,X,D,W,Q,G)}}function IT($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var OU=Z((i3)=>{Object.defineProperty(i3,"__esModule",{value:!0});i3.getSchemaRefs=i3.resolveUrl=i3.normalizeId=i3._getFullPath=i3.getFullPath=i3.inlineRef=void 0;var UT=W$(),wT=DQ(),bT=c3(),XT=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function DT($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!WQ($);if(!I)return!1;return m3($)<=I}i3.inlineRef=DT;var WT=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function WQ($){for(let I in $){if(WT.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(WQ))return!0;if(typeof U=="object"&&WQ(U))return!0}return!1}function m3($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,XT.has(U))continue;if(typeof $[U]=="object")UT.eachItem($[U],(b)=>I+=m3(b));if(I===1/0)return 1/0}return I}function r3($,I="",U){if(U!==!1)I=Z1(I);let b=$.parse(I);return n3($,b)}i3.getFullPath=r3;function n3($,I){return $.serialize(I).split("#")[0]+"#"}i3._getFullPath=n3;var QT=/#\/?$/;function Z1($){return $?$.replace(QT,""):""}i3.normalizeId=Z1;function GT($,I,U){return U=Z1(U),$.resolve(I,U)}i3.resolveUrl=GT;var YT=/^[a-z_][-a-z0-9._]*$/i;function NT($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:b}=this.opts,w=Z1($[U]||I),X={"":w},D=r3(b,w,!1),W={},Q=new Set;return bT($,{allKeys:!0},(J,H,B,A)=>{if(A===void 0)return;let O=D+H,V=X[A];if(typeof J[U]=="string")V=q.call(this,J[U]);k.call(this,J.$anchor),k.call(this,J.$dynamicAnchor),X[H]=V;function q(P){let h=this.opts.uriResolver.resolve;if(P=Z1(V?h(V,P):P),Q.has(P))throw Y(P);Q.add(P);let l=this.refs[P];if(typeof l=="string")l=this.refs[l];if(typeof l=="object")G(J,l.schema,P);else if(P!==Z1(O))if(P[0]==="#")G(J,W[P],P),W[P]=J;else this.refs[P]=O;return P}function k(P){if(typeof P=="string"){if(!YT.test(P))throw new Error(`invalid anchor "${P}"`);q.call(this,`#${P}`)}}}),W;function G(J,H,B){if(H!==void 0&&!wT(J,H))throw Y(B)}function Y(J){return new Error(`reference "${J}" resolves to more than one schema`)}}i3.getSchemaRefs=NT});var KU=Z((QL)=>{Object.defineProperty(QL,"__esModule",{value:!0});QL.getData=QL.KeywordCxt=QL.validateFunctionCode=void 0;var e3=N3(),d3=AU(),GQ=s8(),Lb=AU(),zT=E3(),LU=g3(),QQ=y3(),u=a(),i=s6(),LT=OU(),$4=W$(),zU=HU();function KT($){if(IL($)){if(UL($),$L($)){qT($);return}}s3($,()=>e3.topBoolOrEmptySchema($))}QL.validateFunctionCode=KT;function s3({gen:$,validateName:I,schema:U,schemaEnv:b,opts:w},X){if(w.code.es5)$.func(I,u._`${i.default.data}, ${i.default.valCxt}`,b.$async,()=>{$.code(u._`"use strict"; ${p3(U,w)}`),VT($,w),$.code(X)});else $.func(I,u._`${i.default.data}, ${vT(w)}`,b.$async,()=>$.code(p3(U,w)).code(X))}function vT($){return u._`{${i.default.instancePath}="", ${i.default.parentData}, ${i.default.parentDataProperty}, ${i.default.rootData}=${i.default.data}${$.dynamicRef?u._`, ${i.default.dynamicAnchors}={}`:u.nil}}={}`}function VT($,I){$.if(i.default.valCxt,()=>{if($.var(i.default.instancePath,u._`${i.default.valCxt}.${i.default.instancePath}`),$.var(i.default.parentData,u._`${i.default.valCxt}.${i.default.parentData}`),$.var(i.default.parentDataProperty,u._`${i.default.valCxt}.${i.default.parentDataProperty}`),$.var(i.default.rootData,u._`${i.default.valCxt}.${i.default.rootData}`),I.dynamicRef)$.var(i.default.dynamicAnchors,u._`${i.default.valCxt}.${i.default.dynamicAnchors}`)},()=>{if($.var(i.default.instancePath,u._`""`),$.var(i.default.parentData,u._`undefined`),$.var(i.default.parentDataProperty,u._`undefined`),$.var(i.default.rootData,i.default.data),I.dynamicRef)$.var(i.default.dynamicAnchors,u._`{}`)})}function qT($){let{schema:I,opts:U,gen:b}=$;s3($,()=>{if(U.$comment&&I.$comment)bL($);if(ST($),b.let(i.default.vErrors,null),b.let(i.default.errors,0),U.unevaluated)MT($);wL($),RT($)});return}function MT($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",u._`${U}.evaluated`),I.if(u._`${$.evaluated}.dynamicProps`,()=>I.assign(u._`${$.evaluated}.props`,u._`undefined`)),I.if(u._`${$.evaluated}.dynamicItems`,()=>I.assign(u._`${$.evaluated}.items`,u._`undefined`))}function p3($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?u._`/*# sourceURL=${U} */`:u.nil}function FT($,I){if(IL($)){if(UL($),$L($)){jT($,I);return}}e3.boolOrEmptySchema($,I)}function $L({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function IL($){return typeof $.schema!="boolean"}function jT($,I){let{schema:U,gen:b,opts:w}=$;if(w.$comment&&U.$comment)bL($);PT($),kT($);let X=b.const("_errs",i.default.errors);wL($,X),b.var(I,u._`${X} === ${i.default.errors}`)}function UL($){$4.checkUnknownRules($),ET($)}function wL($,I){if($.opts.jtd)return t3($,[],!1,I);let U=d3.getSchemaTypes($.schema),b=d3.coerceAndCheckDataType($,U);t3($,U,!b,I)}function ET($){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 ST($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)$4.checkStrictMode($,"default is ignored in the schema root")}function PT($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=LT.resolveUrl($.opts.uriResolver,$.baseId,I)}function kT($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function bL({gen:$,schemaEnv:I,schema:U,errSchemaPath:b,opts:w}){let X=U.$comment;if(w.$comment===!0)$.code(u._`${i.default.self}.logger.log(${X})`);else if(typeof w.$comment=="function"){let D=u.str`${b}/$comment`,W=$.scopeValue("root",{ref:I.root});$.code(u._`${i.default.self}.opts.$comment(${X}, ${D}, ${W}.schema)`)}}function RT($){let{gen:I,schemaEnv:U,validateName:b,ValidationError:w,opts:X}=$;if(U.$async)I.if(u._`${i.default.errors} === 0`,()=>I.return(i.default.data),()=>I.throw(u._`new ${w}(${i.default.vErrors})`));else{if(I.assign(u._`${b}.errors`,i.default.vErrors),X.unevaluated)TT($);I.return(u._`${i.default.errors} === 0`)}}function TT({gen:$,evaluated:I,props:U,items:b}){if(U instanceof u.Name)$.assign(u._`${I}.props`,U);if(b instanceof u.Name)$.assign(u._`${I}.items`,b)}function t3($,I,U,b){let{gen:w,schema:X,data:D,allErrors:W,opts:Q,self:G}=$,{RULES:Y}=G;if(X.$ref&&(Q.ignoreKeywordsWithRef||!$4.schemaHasRulesButRef(X,Y))){w.block(()=>DL($,"$ref",Y.all.$ref.definition));return}if(!Q.jtd)_T($,I);w.block(()=>{for(let H of Y.rules)J(H);J(Y.post)});function J(H){if(!GQ.shouldUseGroup(X,H))return;if(H.type){if(w.if(Lb.checkDataType(H.type,D,Q.strictNumbers)),a3($,H),I.length===1&&I[0]===H.type&&U)w.else(),Lb.reportTypeError($);w.endIf()}else a3($,H);if(!W)w.if(u._`${i.default.errors} === ${b||0}`)}}function a3($,I){let{gen:U,schema:b,opts:{useDefaults:w}}=$;if(w)zT.assignDefaults($,I.type);U.block(()=>{for(let X of I.rules)if(GQ.shouldUseRule(b,X))DL($,X.keyword,X.definition,I.type)})}function _T($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(ZT($,I),!$.opts.allowUnionTypes)CT($,I);gT($,$.dataTypes)}function ZT($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!XL($.dataTypes,U))YQ($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),hT($,I)}function CT($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))YQ($,"use allowUnionTypes to allow union type keyword")}function gT($,I){let U=$.self.RULES.all;for(let b in U){let w=U[b];if(typeof w=="object"&&GQ.shouldUseRule($.schema,w)){let{type:X}=w.definition;if(X.length&&!X.some((D)=>xT(I,D)))YQ($,`missing type "${X.join(",")}" for keyword "${b}"`)}}}function xT($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function XL($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function hT($,I){let U=[];for(let b of $.dataTypes)if(XL(I,b))U.push(b);else if(I.includes("integer")&&b==="number")U.push("integer");$.dataTypes=U}function YQ($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,$4.checkStrictMode($,I,$.opts.strictTypes)}class NQ{constructor($,I,U){if(LU.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",WL(this.$data,$));else if(this.schemaCode=this.schemaValue,!LU.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(u.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(u.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(u._`${I} !== undefined && (${u.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?zU.reportExtraError:zU.reportError)(this,this.def.error,I)}$dataError(){zU.reportError(this,this.def.$dataError||zU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');zU.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=u.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=u.nil,I=u.nil){if(!this.$data)return;let{gen:U,schemaCode:b,schemaType:w,def:X}=this;if(U.if(u.or(u._`${b} === undefined`,I)),$!==u.nil)U.assign($,!0);if(w.length||X.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==u.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:b,it:w}=this;return u.or(X(),D());function X(){if(U.length){if(!(I instanceof u.Name))throw new Error("ajv implementation error");let W=Array.isArray(U)?U:[U];return u._`${Lb.checkDataTypes(W,I,w.opts.strictNumbers,Lb.DataType.Wrong)}`}return u.nil}function D(){if(b.validateSchema){let W=$.scopeValue("validate$data",{ref:b.validateSchema});return u._`!${W}(${I})`}return u.nil}}subschema($,I){let U=QQ.getSubschema(this.it,$);QQ.extendSubschemaData(U,this.it,$),QQ.extendSubschemaMode(U,$);let b={...this.it,...U,items:void 0,props:void 0};return FT(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($,u.Name)),!0}}QL.KeywordCxt=NQ;function DL($,I,U,b){let w=new NQ($,U,I);if("code"in U)U.code(w,b);else if(w.$data&&U.validate)LU.funcKeywordCode(w,U);else if("macro"in U)LU.macroKeywordCode(w,U);else if(U.compile||U.validate)LU.funcKeywordCode(w,U)}var fT=/^\/(?:[^~]|~0|~1)*$/,yT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function WL($,{dataLevel:I,dataNames:U,dataPathArr:b}){let w,X;if($==="")return i.default.rootData;if($[0]==="/"){if(!fT.test($))throw new Error(`Invalid JSON-pointer: ${$}`);w=$,X=i.default.rootData}else{let G=yT.exec($);if(!G)throw new Error(`Invalid JSON-pointer: ${$}`);let Y=+G[1];if(w=G[2],w==="#"){if(Y>=I)throw new Error(Q("property/index",Y));return b[I-Y]}if(Y>I)throw new Error(Q("data",Y));if(X=U[I-Y],!w)return X}let D=X,W=w.split("/");for(let G of W)if(G)X=u._`${X}${u.getProperty($4.unescapeJsonPointer(G))}`,D=u._`${D} && ${X}`;return D;function Q(G,Y){return`Cannot access ${G} ${Y} levels up, current level is ${I}`}}QL.getData=WL});var Kb=Z((NL)=>{Object.defineProperty(NL,"__esModule",{value:!0});class YL extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}NL.default=YL});var vU=Z((BL)=>{Object.defineProperty(BL,"__esModule",{value:!0});var JQ=OU();class JL extends Error{constructor($,I,U,b){super(b||`can't resolve reference ${U} from id ${I}`);this.missingRef=JQ.resolveUrl($,I,U),this.missingSchema=JQ.normalizeId(JQ.getFullPath($,this.missingRef))}}BL.default=JL});var Vb=Z((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});OL.resolveSchema=OL.getCompilingSchema=OL.resolveRef=OL.compileSchema=OL.SchemaEnv=void 0;var S6=a(),rT=Kb(),e4=s6(),P6=OU(),HL=W$(),nT=KU();class VU{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={}}}OL.SchemaEnv=VU;function HQ($){let I=AL.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:rT.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:e4.default.data,parentData:e4.default.parentData,parentDataProperty:e4.default.parentDataProperty,dataNames:[e4.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},Y;try{this._compilations.add($),nT.validateFunctionCode(G),D.optimize(this.opts.code.optimize);let J=D.toString();if(Y=`${D.scopeRefs(e4.default.scope)}return ${J}`,this.opts.code.process)Y=this.opts.code.process(Y,$);let B=new Function(`${e4.default.self}`,`${e4.default.scope}`,Y)(this,this.scope.get());if(this.scope.value(Q,{ref:B}),B.errors=null,B.schema=$.schema,B.schemaEnv=$,$.$async)B.$async=!0;if(this.opts.code.source===!0)B.source={validateName:Q,validateCode:J,scopeValues:D._values};if(this.opts.unevaluated){let{props:A,items:O}=G;if(B.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},B.source)B.source.evaluated=S6.stringify(B.evaluated)}return $.validate=B,$}catch(J){if(delete $.validate,delete $.validateName,Y)this.logger.error("Error compiling schema, function code:",Y);throw J}finally{this._compilations.delete($)}}OL.compileSchema=HQ;function iT($,I,U){var b;U=P6.resolveUrl(this.opts.uriResolver,I,U);let w=$.refs[U];if(w)return w;let X=pT.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 VU({schema:D,schemaId:W,root:$,baseId:I})}if(X===void 0)return;return $.refs[U]=oT.call(this,X)}OL.resolveRef=iT;function oT($){if(P6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:HQ.call(this,$)}function AL($){for(let I of this._compilations)if(dT(I,$))return I}OL.getCompilingSchema=AL;function dT($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function pT($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||vb.call(this,$,I)}function vb($,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 BQ.call(this,U,$);let X=P6.normalizeId(b),D=this.refs[X]||this.schemas[X];if(typeof D=="string"){let W=vb.call(this,$,D);if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;return BQ.call(this,U,W)}if(typeof(D===null||D===void 0?void 0:D.schema)!=="object")return;if(!D.validate)HQ.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 VU({schema:W,schemaId:Q,root:$,baseId:w})}return BQ.call(this,U,D)}OL.resolveSchema=vb;var tT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function BQ($,{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[HL.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&&!HL.schemaHasRulesButRef(U,this.RULES)){let W=P6.resolveUrl(this.opts.uriResolver,I,U.$ref);X=vb.call(this,b,W)}let{schemaId:D}=this.opts;if(X=X||new VU({schema:U,schemaId:D,root:b,baseId:I}),X.schema!==X.root.schema)return X;return}});var LL=Z((Wo,I_)=>{I_.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 OQ=Z((Qo,qL)=>{var U_=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),vL=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 AQ($){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 w_=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function KL($){return $.length=0,!0}function b_($,I,U){if($.length){let b=AQ($);if(b!=="")I.push(b);else return U.error=!0,!1;$.length=0}return!0}function X_($){let I=0,U={error:!1,address:"",zone:""},b=[],w=[],X=!1,D=!1,W=b_;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=KL}else{w.push(G);continue}}if(w.length)if(W===KL)U.zone=w.join("");else if(D)b.push(w.join(""));else b.push(AQ(w));return U.address=b.join(""),U}function VL($){if(D_($,":")<2)return{host:$,isIPV6:!1};let I=X_($);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 D_($,I){let U=0;for(let b=0;b<$.length;b++)if($[b]===I)U++;return U}function W_($){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 Q_($,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 G_($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!vL(U)){let b=VL(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}qL.exports={nonSimpleDomain:w_,recomposeAuthority:G_,normalizeComponentEncoding:Q_,removeDotSegments:W_,isIPv4:vL,isUUID:U_,normalizeIPv6:VL,stringArrayToHexStripped:AQ}});var SL=Z((Go,EL)=>{var{isUUID:Y_}=OQ(),N_=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,J_=["http","https","ws","wss","urn","urn:uuid"];function B_($){return J_.indexOf($)!==-1}function zQ($){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 ML($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function FL($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function H_($){return $.secure=zQ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function A_($){if($.port===(zQ($)?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 O_($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(N_);if(U){let b=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let w=`${b}:${I.nid||$.nid}`,X=LQ(w);if($.path=void 0,X)$=X.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function z_($,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=LQ(w);if(X)$=X.serialize($,I);let D=$,W=$.nss;return D.path=`${b||I.nid}:${W}`,I.skipEscape=!0,D}function L_($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!Y_(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function K_($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var jL={scheme:"http",domainHost:!0,parse:ML,serialize:FL},v_={scheme:"https",domainHost:jL.domainHost,parse:ML,serialize:FL},qb={scheme:"ws",domainHost:!0,parse:H_,serialize:A_},V_={scheme:"wss",domainHost:qb.domainHost,parse:qb.parse,serialize:qb.serialize},q_={scheme:"urn",parse:O_,serialize:z_,skipNormalize:!0},M_={scheme:"urn:uuid",parse:L_,serialize:K_,skipNormalize:!0},Mb={http:jL,https:v_,ws:qb,wss:V_,urn:q_,"urn:uuid":M_};Object.setPrototypeOf(Mb,null);function LQ($){return $&&(Mb[$]||Mb[$.toLowerCase()])||void 0}EL.exports={wsIsSecure:zQ,SCHEMES:Mb,isValidSchemeName:B_,getSchemeHandler:LQ}});var RL=Z((Yo,jb)=>{var{normalizeIPv6:F_,removeDotSegments:qU,recomposeAuthority:j_,normalizeComponentEncoding:Fb,isIPv4:E_,nonSimpleDomain:S_}=OQ(),{SCHEMES:P_,getSchemeHandler:PL}=SL();function k_($,I){if(typeof $==="string")$=f6(I4($,I),I);else if(typeof $==="object")$=I4(f6($,I),I);return $}function R_($,I,U){let b=U?Object.assign({scheme:"null"},U):{scheme:"null"},w=kL(I4($,b),I4(I,b),b,!0);return b.skipEscape=!0,f6(w,b)}function kL($,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=qU(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=qU(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=qU(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=qU(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 T_($,I,U){if(typeof $==="string")$=unescape($),$=f6(Fb(I4($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=f6(Fb($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=f6(Fb(I4(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=f6(Fb(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=PL(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=j_(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=qU(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 __=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\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(__);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(E_(b.host)===!1){let Q=F_(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=PL(U.scheme||b.scheme);if(!U.unicodeSupport&&(!D||!D.unicodeSupport)){if(b.host&&(U.domainHost||D&&D.domainHost)&&w===!1&&S_(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 KQ={SCHEMES:P_,normalize:k_,resolve:R_,resolveComponent:kL,equal:T_,serialize:f6,parse:I4};jb.exports=KQ;jb.exports.default=KQ;jb.exports.fastUri=KQ});var ZL=Z((_L)=>{Object.defineProperty(_L,"__esModule",{value:!0});var TL=RL();TL.code='require("ajv/dist/runtime/uri").default';_L.default=TL});var lL=Z((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.CodeGen=U4.Name=U4.nil=U4.stringify=U4.str=U4._=U4.KeywordCxt=void 0;var C_=KU();Object.defineProperty(U4,"KeywordCxt",{enumerable:!0,get:function(){return C_.KeywordCxt}});var C1=a();Object.defineProperty(U4,"_",{enumerable:!0,get:function(){return C1._}});Object.defineProperty(U4,"str",{enumerable:!0,get:function(){return C1.str}});Object.defineProperty(U4,"stringify",{enumerable:!0,get:function(){return C1.stringify}});Object.defineProperty(U4,"nil",{enumerable:!0,get:function(){return C1.nil}});Object.defineProperty(U4,"Name",{enumerable:!0,get:function(){return C1.Name}});Object.defineProperty(U4,"CodeGen",{enumerable:!0,get:function(){return C1.CodeGen}});var g_=Kb(),fL=vU(),x_=e8(),MU=Vb(),h_=a(),FU=OU(),Eb=AU(),VQ=W$(),CL=LL(),f_=ZL(),yL=($,I)=>new RegExp($,I);yL.code="new RegExp";var y_=["removeAdditional","useDefaults","coerceTypes"],u_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),l_={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."},c_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},gL=200;function m_($){var I,U,b,w,X,D,W,Q,G,Y,J,H,B,A,O,V,q,k,P,h,l,l$,N6,B1,tD;let SI=$.strict,aD=(I=$.code)===null||I===void 0?void 0:I.optimize,_H=aD===!0||aD===void 0?1:aD||0,ZH=(b=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&b!==void 0?b:yL,$j=(w=$.uriResolver)!==null&&w!==void 0?w:f_.default;return{strictSchema:(D=(X=$.strictSchema)!==null&&X!==void 0?X:SI)!==null&&D!==void 0?D:!0,strictNumbers:(Q=(W=$.strictNumbers)!==null&&W!==void 0?W:SI)!==null&&Q!==void 0?Q:!0,strictTypes:(Y=(G=$.strictTypes)!==null&&G!==void 0?G:SI)!==null&&Y!==void 0?Y:"log",strictTuples:(H=(J=$.strictTuples)!==null&&J!==void 0?J:SI)!==null&&H!==void 0?H:"log",strictRequired:(A=(B=$.strictRequired)!==null&&B!==void 0?B:SI)!==null&&A!==void 0?A:!1,code:$.code?{...$.code,optimize:_H,regExp:ZH}:{optimize:_H,regExp:ZH},loopRequired:(O=$.loopRequired)!==null&&O!==void 0?O:gL,loopEnum:(V=$.loopEnum)!==null&&V!==void 0?V:gL,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:(h=$.schemaId)!==null&&h!==void 0?h:"$id",addUsedSchema:(l=$.addUsedSchema)!==null&&l!==void 0?l:!0,validateSchema:(l$=$.validateSchema)!==null&&l$!==void 0?l$:!0,validateFormats:(N6=$.validateFormats)!==null&&N6!==void 0?N6:!0,unicodeRegExp:(B1=$.unicodeRegExp)!==null&&B1!==void 0?B1:!0,int32range:(tD=$.int32range)!==null&&tD!==void 0?tD:!0,uriResolver:$j}}class Sb{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 h_.ValueScope({scope:{},prefixes:u_,es5:I,lines:U}),this.logger=p_($.logger);let b=$.validateFormats;if($.validateFormats=!1,this.RULES=x_.getRules(),xL.call(this,l_,$,"NOT SUPPORTED"),xL.call(this,c_,$,"DEPRECATED","warn"),this._metaOpts=o_.call(this),$.formats)n_.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)i_.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);r_.call(this),$.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,b=CL;if(U==="id")b={...CL},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,Y){await w.call(this,G.$schema);let J=this._addSchema(G,Y);return J.validate||X.call(this,J)}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(Y){if(!(Y instanceof fL.default))throw Y;return D.call(this,Y),await W.call(this,Y.missingSchema),X.call(this,G)}}function D({missingSchema:G,missingRef:Y}){if(this.refs[G])throw new Error(`AnySchema ${G} is loaded but ${Y} cannot be resolved`)}async function W(G){let Y=await Q.call(this,G);if(!this.refs[G])await w.call(this,Y.$schema);if(!this.refs[G])this.addSchema(Y,G,I)}async function Q(G){let Y=this._loading[G];if(Y)return Y;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=FU.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=hL.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,b=new MU.SchemaEnv({schema:{},schemaId:U});if(I=MU.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=hL.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=FU.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(a_.call(this,U,I),!I)return VQ.eachItem(U,(w)=>vQ.call(this,w)),this;s_.call(this,I);let b={...I,type:Eb.getJSONTypes(I.type),schemaType:Eb.getJSONTypes(I.schemaType)};return VQ.eachItem(U,b.type.length===0?(w)=>vQ.call(this,w,b):(w)=>b.type.forEach((X)=>vQ.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]=uL(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=FU.normalizeId(X||U);let Q=FU.getSchemaRefs.call(this,$,U);if(W=new MU.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 MU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{MU.compileSchema.call(this,$)}finally{this.opts=I}}}Sb.ValidationError=g_.default;Sb.MissingRefError=fL.default;U4.default=Sb;function xL($,I,U,b="error"){for(let w in $){let X=w;if(X in I)this.logger[b](`${U}: option ${w}. ${$[X]}`)}}function hL($){return $=FU.normalizeId($),this.schemas[$]||this.refs[$]}function r_(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function n_(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function i_($){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 o_(){let $={...this.opts};for(let I of y_)delete $[I];return $}var d_={log(){},warn(){},error(){}};function p_($){if($===!1)return d_;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 a_($,I){let{RULES:U}=this;if(VQ.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 vQ($,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:Eb.getJSONTypes(I.type),schemaType:Eb.getJSONTypes(I.schemaType)}};if(I.before)e_.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 e_($,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 s_($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=uL(I);$.validateSchema=this.compile(I,!0)}var $Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function uL($){return{anyOf:[$,$Z]}}});var mL=Z((cL)=>{Object.defineProperty(cL,"__esModule",{value:!0});var wZ={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cL.default=wZ});var pL=Z((oL)=>{Object.defineProperty(oL,"__esModule",{value:!0});oL.callRef=oL.getValidate=void 0;var XZ=vU(),rL=O6(),$6=a(),g1=s6(),nL=Vb(),Pb=W$(),DZ={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 J();let Y=nL.resolveRef.call(Q,G,w,U);if(Y===void 0)throw new XZ.default(b.opts.uriResolver,w,U);if(Y instanceof nL.SchemaEnv)return H(Y);return B(Y);function J(){if(X===G)return kb($,D,X,X.$async);let A=I.scopeValue("root",{ref:G});return kb($,$6._`${A}.validate`,G,G.$async)}function H(A){let O=iL($,A);kb($,O,A,A.$async)}function B(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 iL($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):$6._`${U.scopeValue("wrapper",{ref:I})}.validate`}oL.getValidate=iL;function kb($,I,U,b){let{gen:w,it:X}=$,{allErrors:D,schemaEnv:W,opts:Q}=X,G=Q.passContext?g1.default.this:$6.nil;if(b)Y();else J();function Y(){if(!W.$async)throw new Error("async schema referenced by sync schema");let A=w.let("valid");w.try(()=>{if(w.code($6._`await ${rL.callValidateCode($,I,G)}`),B(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 J(){$.result(rL.callValidateCode($,I,G),()=>B(I),()=>H(I))}function H(A){let O=$6._`${A}.errors`;w.assign(g1.default.vErrors,$6._`${g1.default.vErrors} === null ? ${O} : ${g1.default.vErrors}.concat(${O})`),w.assign(g1.default.errors,$6._`${g1.default.vErrors}.length`)}function B(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=Pb.mergeEvaluated.props(w,V.props,X.props)}else{let q=w.var("props",$6._`${A}.evaluated.props`);X.props=Pb.mergeEvaluated.props(w,q,X.props,$6.Name)}if(X.items!==!0)if(V&&!V.dynamicItems){if(V.items!==void 0)X.items=Pb.mergeEvaluated.items(w,V.items,X.items)}else{let q=w.var("items",$6._`${A}.evaluated.items`);X.items=Pb.mergeEvaluated.items(w,q,X.items,$6.Name)}}}oL.callRef=kb;oL.default=DZ});var aL=Z((tL)=>{Object.defineProperty(tL,"__esModule",{value:!0});var GZ=mL(),YZ=pL(),NZ=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",GZ.default,YZ.default];tL.default=NZ});var sL=Z((eL)=>{Object.defineProperty(eL,"__esModule",{value:!0});var Rb=a(),q4=Rb.operators,Tb={maximum:{okStr:"<=",ok:q4.LTE,fail:q4.GT},minimum:{okStr:">=",ok:q4.GTE,fail:q4.LT},exclusiveMaximum:{okStr:"<",ok:q4.LT,fail:q4.GTE},exclusiveMinimum:{okStr:">",ok:q4.GT,fail:q4.LTE}},BZ={message:({keyword:$,schemaCode:I})=>Rb.str`must be ${Tb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>Rb._`{comparison: ${Tb[$].okStr}, limit: ${I}}`},HZ={keyword:Object.keys(Tb),type:"number",schemaType:"number",$data:!0,error:BZ,code($){let{keyword:I,data:U,schemaCode:b}=$;$.fail$data(Rb._`${U} ${Tb[I].fail} ${b} || isNaN(${U})`)}};eL.default=HZ});var IK=Z(($K)=>{Object.defineProperty($K,"__esModule",{value:!0});var jU=a(),OZ={message:({schemaCode:$})=>jU.str`must be multiple of ${$}`,params:({schemaCode:$})=>jU._`{multipleOf: ${$}}`},zZ={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:OZ,code($){let{gen:I,data:U,schemaCode:b,it:w}=$,X=w.opts.multipleOfPrecision,D=I.let("res"),W=X?jU._`Math.abs(Math.round(${D}) - ${D}) > 1e-${X}`:jU._`${D} !== parseInt(${D})`;$.fail$data(jU._`(${b} === 0 || (${D} = ${U}/${b}, ${W}))`)}};$K.default=zZ});var bK=Z((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});function UK($){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}wK.default=UK;UK.code='require("ajv/dist/runtime/ucs2length").default'});var DK=Z((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});var s4=a(),vZ=W$(),VZ=bK(),qZ={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return s4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>s4._`{limit: ${$}}`},MZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qZ,code($){let{keyword:I,data:U,schemaCode:b,it:w}=$,X=I==="maxLength"?s4.operators.GT:s4.operators.LT,D=w.opts.unicode===!1?s4._`${U}.length`:s4._`${vZ.useFunc($.gen,VZ.default)}(${U})`;$.fail$data(s4._`${D} ${X} ${b}`)}};XK.default=MZ});var QK=Z((WK)=>{Object.defineProperty(WK,"__esModule",{value:!0});var jZ=O6(),_b=a(),EZ={message:({schemaCode:$})=>_b.str`must match pattern "${$}"`,params:({schemaCode:$})=>_b._`{pattern: ${$}}`},SZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:EZ,code($){let{data:I,$data:U,schema:b,schemaCode:w,it:X}=$,D=X.opts.unicodeRegExp?"u":"",W=U?_b._`(new RegExp(${w}, ${D}))`:jZ.usePattern($,b);$.fail$data(_b._`!${W}.test(${I})`)}};WK.default=SZ});var YK=Z((GK)=>{Object.defineProperty(GK,"__esModule",{value:!0});var EU=a(),kZ={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return EU.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>EU._`{limit: ${$}}`},RZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxProperties"?EU.operators.GT:EU.operators.LT;$.fail$data(EU._`Object.keys(${U}).length ${w} ${b}`)}};GK.default=RZ});var JK=Z((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});var SU=O6(),PU=a(),_Z=W$(),ZZ={message:({params:{missingProperty:$}})=>PU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>PU._`{missingProperty: ${$}}`},CZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:ZZ,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 Y();if(W.strictRequired){let B=$.parentSchema.properties,{definedProperties:A}=$.it;for(let O of U)if((B===null||B===void 0?void 0:B[O])===void 0&&!A.has(O)){let V=D.schemaEnv.baseId+D.errSchemaPath,q=`required property "${O}" is not defined at "${V}" (strictRequired)`;_Z.checkStrictMode(D,q,D.opts.strictRequired)}}function G(){if(Q||X)$.block$data(PU.nil,J);else for(let B of U)SU.checkReportMissingProp($,B)}function Y(){let B=I.let("missing");if(Q||X){let A=I.let("valid",!0);$.block$data(A,()=>H(B,A)),$.ok(A)}else I.if(SU.checkMissingProp($,U,B)),SU.reportMissingProp($,B),I.else()}function J(){I.forOf("prop",b,(B)=>{$.setParams({missingProperty:B}),I.if(SU.noPropertyInData(I,w,B,W.ownProperties),()=>$.error())})}function H(B,A){$.setParams({missingProperty:B}),I.forOf(B,b,()=>{I.assign(A,SU.propertyInData(I,w,B,W.ownProperties)),I.if(PU.not(A),()=>{$.error(),I.break()})},PU.nil)}}};NK.default=CZ});var HK=Z((BK)=>{Object.defineProperty(BK,"__esModule",{value:!0});var kU=a(),xZ={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return kU.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>kU._`{limit: ${$}}`},hZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:xZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxItems"?kU.operators.GT:kU.operators.LT;$.fail$data(kU._`${U}.length ${w} ${b}`)}};BK.default=hZ});var Zb=Z((OK)=>{Object.defineProperty(OK,"__esModule",{value:!0});var AK=DQ();AK.code='require("ajv/dist/runtime/equal").default';OK.default=AK});var LK=Z((zK)=>{Object.defineProperty(zK,"__esModule",{value:!0});var qQ=AU(),h$=a(),uZ=W$(),lZ=Zb(),cZ={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:cZ,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?qQ.getSchemaTypes(X.items):[];$.block$data(Q,Y,h$._`${D} === false`),$.ok(Q);function Y(){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`,()=>(J()?H:B)(A,O))}function J(){return G.length>0&&!G.some((A)=>A==="object"||A==="array")}function H(A,O){let V=I.name("item"),q=qQ.checkDataTypes(G,V,W.opts.strictNumbers,qQ.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 B(A,O){let V=uZ.useFunc(I,lZ.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)})))}}};zK.default=mZ});var vK=Z((KK)=>{Object.defineProperty(KK,"__esModule",{value:!0});var MQ=a(),nZ=W$(),iZ=Zb(),oZ={message:"must be equal to constant",params:({schemaCode:$})=>MQ._`{allowedValue: ${$}}`},dZ={keyword:"const",$data:!0,error:oZ,code($){let{gen:I,data:U,$data:b,schemaCode:w,schema:X}=$;if(b||X&&typeof X=="object")$.fail$data(MQ._`!${nZ.useFunc(I,iZ.default)}(${U}, ${w})`);else $.fail(MQ._`${X} !== ${U}`)}};KK.default=dZ});var qK=Z((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});var RU=a(),tZ=W$(),aZ=Zb(),eZ={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>RU._`{allowedValues: ${$}}`},sZ={keyword:"enum",schemaType:"array",$data:!0,error:eZ,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,aZ.default),Y;if(W||b)Y=I.let("valid"),$.block$data(Y,J);else{if(!Array.isArray(w))throw new Error("ajv implementation error");let B=I.const("vSchema",X);Y=RU.or(...w.map((A,O)=>H(B,O)))}$.pass(Y);function J(){I.assign(Y,!1),I.forOf("v",X,(B)=>I.if(RU._`${G()}(${U}, ${B})`,()=>I.assign(Y,!0).break()))}function H(B,A){let O=w[A];return typeof O==="object"&&O!==null?RU._`${G()}(${U}, ${B}[${A}])`:RU._`${U} === ${O}`}}};VK.default=sZ});var FK=Z((MK)=>{Object.defineProperty(MK,"__esModule",{value:!0});var IC=sL(),UC=IK(),wC=DK(),bC=QK(),XC=YK(),DC=JK(),WC=HK(),QC=LK(),GC=vK(),YC=qK(),NC=[IC.default,UC.default,wC.default,bC.default,XC.default,DC.default,WC.default,QC.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},GC.default,YC.default];MK.default=NC});var jQ=Z((EK)=>{Object.defineProperty(EK,"__esModule",{value:!0});EK.validateAdditionalItems=void 0;var $1=a(),FQ=W$(),BC={message:({params:{len:$}})=>$1.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>$1._`{limit: ${$}}`},HC={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:BC,code($){let{parentSchema:I,it:U}=$,{items:b}=I;if(!Array.isArray(b)){FQ.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}jK($,b)}};function jK($,I){let{gen:U,schema:b,data:w,keyword:X,it:D}=$;D.items=!0;let W=U.const("len",$1._`${w}.length`);if(b===!1)$.setParams({len:I.length}),$.pass($1._`${W} <= ${I.length}`);else if(typeof b=="object"&&!FQ.alwaysValidSchema(D,b)){let G=U.var("valid",$1._`${W} <= ${I.length}`);U.if($1.not(G),()=>Q(G)),$.ok(G)}function Q(G){U.forRange("i",I.length,W,(Y)=>{if($.subschema({keyword:X,dataProp:Y,dataPropType:FQ.Type.Num},G),!D.allErrors)U.if($1.not(G),()=>U.break())})}}EK.validateAdditionalItems=jK;EK.default=HC});var EQ=Z((RK)=>{Object.defineProperty(RK,"__esModule",{value:!0});RK.validateTuple=void 0;var PK=a(),Cb=W$(),OC=O6(),zC={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return kK($,"additionalItems",I);if(U.items=!0,Cb.alwaysValidSchema(U,I))return;$.ok(OC.validateArray($))}};function kK($,I,U=$.schema){let{gen:b,parentSchema:w,data:X,keyword:D,it:W}=$;if(Y(w),W.opts.unevaluated&&U.length&&W.items!==!0)W.items=Cb.mergeEvaluated.items(b,U.length,W.items);let Q=b.name("valid"),G=b.const("len",PK._`${X}.length`);U.forEach((J,H)=>{if(Cb.alwaysValidSchema(W,J))return;b.if(PK._`${G} > ${H}`,()=>$.subschema({keyword:D,schemaProp:H,dataProp:H},Q)),$.ok(Q)});function Y(J){let{opts:H,errSchemaPath:B}=W,A=U.length,O=A===J.minItems&&(A===J.maxItems||J[I]===!1);if(H.strictTuples&&!O){let V=`"${D}" is ${A}-tuple, but minItems or maxItems/${I} are not specified or different at path "${B}"`;Cb.checkStrictMode(W,V,H.strictTuples)}}}RK.validateTuple=kK;RK.default=zC});var ZK=Z((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var KC=EQ(),vC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>KC.validateTuple($,"items")};_K.default=vC});var xK=Z((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});var CK=a(),qC=W$(),MC=O6(),FC=jQ(),jC={message:({params:{len:$}})=>CK.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>CK._`{limit: ${$}}`},EC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:jC,code($){let{schema:I,parentSchema:U,it:b}=$,{prefixItems:w}=U;if(b.items=!0,qC.alwaysValidSchema(b,I))return;if(w)FC.validateAdditionalItems($,w);else $.ok(MC.validateArray($))}};gK.default=EC});var fK=Z((hK)=>{Object.defineProperty(hK,"__esModule",{value:!0});var z6=a(),gb=W$(),PC={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}}`},kC={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:PC,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 Y=I.const("len",z6._`${w}.length`);if($.setParams({min:D,max:W}),W===void 0&&D===0){gb.checkStrictMode(X,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(W!==void 0&&D>W){gb.checkStrictMode(X,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(gb.alwaysValidSchema(X,U)){let O=z6._`${Y} >= ${D}`;if(W!==void 0)O=z6._`${O} && ${Y} <= ${W}`;$.pass(O);return}X.items=!0;let J=I.name("valid");if(W===void 0&&D===1)B(J,()=>I.if(J,()=>I.break()));else if(D===0){if(I.let(J,!0),W!==void 0)I.if(z6._`${w}.length > 0`,H)}else I.let(J,!1),H();$.result(J,()=>$.reset());function H(){let O=I.name("_valid"),V=I.let("count",0);B(O,()=>I.if(O,()=>A(V)))}function B(O,V){I.forRange("i",0,Y,(q)=>{$.subschema({keyword:"contains",dataProp:q,dataPropType:gb.Type.Num,compositeRule:!0},O),V()})}function A(O){if(I.code(z6._`${O}++`),W===void 0)I.if(z6._`${O} >= ${D}`,()=>I.assign(J,!0).break());else if(I.if(z6._`${O} > ${W}`,()=>I.assign(J,!1).break()),D===1)I.assign(J,!0);else I.if(z6._`${O} >= ${D}`,()=>I.assign(J,!0))}}};hK.default=kC});var rK=Z((lK)=>{Object.defineProperty(lK,"__esModule",{value:!0});lK.validateSchemaDeps=lK.validatePropertyDeps=lK.error=void 0;var SQ=a(),TC=W$(),TU=O6();lK.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let b=I===1?"property":"properties";return SQ.str`must have ${b} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:b}})=>SQ._`{property: ${$},
|
|
6
|
+
|| ${D} === "boolean" || ${w} === null`).assign(W,p._`[${w}]`)}}}function bR({gen:$,parentData:I,parentDataProperty:U},b){$.if(p._`${I} !== undefined`,()=>$.assign(p._`${I}[${U}]`,b))}function $Q($,I,U,b=T1.Correct){let w=b===T1.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===T1.Correct?X:p.not(X);function D(W=p.nil){return p.and(p._`typeof ${I} == "number"`,W,U?p._`isFinite(${I})`:p.nil)}}v3.checkDataType=$Q;function IQ($,I,U,b){if($.length===1)return $Q($[0],I,U,b);let w,X=z3.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,$Q(D,I,U,b));return w}v3.checkDataTypes=IQ;var XR={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?p._`{type: ${$}}`:p._`{type: ${I}}`};function UQ($){let I=DR($);s2.reportError(I,XR)}v3.reportTypeError=UQ;function DR($){let{gen:I,data:U,schema:b}=$,w=z3.schemaRefOrVal($,b,"type");return{gen:I,keyword:"type",data:U,schema:b.type,schemaCode:w,schemaValue:w,parentSchema:b,params:{},it:$}}});var j3=Z((M3)=>{Object.defineProperty(M3,"__esModule",{value:!0});M3.assignDefaults=void 0;var _1=a(),BR=W$();function HR($,I){let{properties:U,items:b}=$.schema;if(I==="object"&&U)for(let w in U)q3($,w,U[w].default);else if(I==="array"&&Array.isArray(b))b.forEach((w,X)=>q3($,X,w.default))}M3.assignDefaults=HR;function q3($,I,U){let{gen:b,compositeRule:w,data:X,opts:D}=$;if(U===void 0)return;let W=_1._`${X}${_1.getProperty(I)}`;if(w){BR.checkStrictMode($,`default is ignored for: ${W}`);return}let Q=_1._`${W} === undefined`;if(D.useDefaults==="empty")Q=_1._`${Q} || ${W} === null || ${W} === ""`;b.if(Q,_1._`${W} = ${_1.stringify(U)}`)}});var O6=Z((P3)=>{Object.defineProperty(P3,"__esModule",{value:!0});P3.validateUnion=P3.validateArray=P3.usePattern=P3.callValidateCode=P3.schemaProperties=P3.allSchemaProperties=P3.noPropertyInData=P3.propertyInData=P3.isOwnProperty=P3.hasPropFunc=P3.reportMissingProp=P3.checkMissingProp=P3.checkReportMissingProp=void 0;var K$=a(),wQ=W$(),v4=s6(),AR=W$();function OR($,I){let{gen:U,data:b,it:w}=$;U.if(XQ(U,b,I,w.opts.ownProperties),()=>{$.setParams({missingProperty:K$._`${I}`},!0),$.error()})}P3.checkReportMissingProp=OR;function zR({gen:$,data:I,it:{opts:U}},b,w){return K$.or(...b.map((X)=>K$.and(XQ($,I,X,U.ownProperties),K$._`${w} = ${X}`)))}P3.checkMissingProp=zR;function LR($,I){$.setParams({missingProperty:I},!0),$.error()}P3.reportMissingProp=LR;function E3($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:K$._`Object.prototype.hasOwnProperty`})}P3.hasPropFunc=E3;function bQ($,I,U){return K$._`${E3($)}.call(${I}, ${U})`}P3.isOwnProperty=bQ;function KR($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} !== undefined`;return b?K$._`${w} && ${bQ($,I,U)}`:w}P3.propertyInData=KR;function XQ($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} === undefined`;return b?K$.or(w,K$.not(bQ($,I,U))):w}P3.noPropertyInData=XQ;function S3($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}P3.allSchemaProperties=S3;function vR($,I){return S3(I).filter((U)=>!wQ.alwaysValidSchema($,I[U]))}P3.schemaProperties=vR;function VR({schemaCode:$,data:I,it:{gen:U,topSchemaRef:b,schemaPath:w,errorPath:X},it:D},W,Q,G){let Y=G?K$._`${$}, ${I}, ${b}${w}`:I,J=[[v4.default.instancePath,K$.strConcat(v4.default.instancePath,X)],[v4.default.parentData,D.parentData],[v4.default.parentDataProperty,D.parentDataProperty],[v4.default.rootData,v4.default.rootData]];if(D.opts.dynamicRef)J.push([v4.default.dynamicAnchors,v4.default.dynamicAnchors]);let H=K$._`${Y}, ${U.object(...J)}`;return Q!==K$.nil?K$._`${W}.call(${Q}, ${H})`:K$._`${W}(${H})`}P3.callValidateCode=VR;var qR=K$._`new RegExp`;function MR({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"?qR:AR.useFunc($,w)}(${U}, ${b})`})}P3.usePattern=MR;function FR($){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:wQ.Type.Num},X),I.if(K$.not(X),W)})}}P3.validateArray=FR;function jR($){let{gen:I,schema:U,keyword:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((Q)=>wQ.alwaysValidSchema(w,Q))&&!w.opts.unevaluated)return;let D=I.let("valid",!1),W=I.name("_valid");I.block(()=>U.forEach((Q,G)=>{let Y=$.subschema({keyword:b,schemaProp:G,compositeRule:!0},W);if(I.assign(D,K$._`${D} || ${W}`),!$.mergeValidEvaluated(Y,W))I.if(K$.not(D))})),$.result(D,()=>$.reset(),()=>$.error(!0))}P3.validateUnion=jR});var C3=Z((_3)=>{Object.defineProperty(_3,"__esModule",{value:!0});_3.validateKeywordUsage=_3.validSchemaType=_3.funcKeywordCode=_3.macroKeywordCode=void 0;var i$=a(),a4=s6(),fR=O6(),yR=HU();function uR($,I){let{gen:U,keyword:b,schema:w,parentSchema:X,it:D}=$,W=I.macro.call(D.self,w,X,D),Q=T3(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))}_3.macroKeywordCode=uR;function lR($,I){var U;let{gen:b,keyword:w,schema:X,parentSchema:D,$data:W,it:Q}=$;mR(Q,I);let G=!W&&I.compile?I.compile.call(Q.self,X,D,Q):I.validate,Y=T3(b,w,G),J=b.let("valid");$.block$data(J,H),$.ok((U=I.valid)!==null&&U!==void 0?U:J);function H(){if(I.errors===!1){if(O(),I.modifying)R3($);V(()=>$.error())}else{let q=I.async?B():A();if(I.modifying)R3($);V(()=>cR($,q))}}function B(){let q=b.let("ruleErrs",null);return b.try(()=>O(i$._`await `),(k)=>b.assign(J,!1).if(i$._`${k} instanceof ${Q.ValidationError}`,()=>b.assign(q,i$._`${k}.errors`),()=>b.throw(k))),q}function A(){let q=i$._`${Y}.errors`;return b.assign(q,null),O(i$.nil),q}function O(q=I.async?i$._`await `:i$.nil){let k=Q.opts.passContext?a4.default.this:a4.default.self,P=!(("compile"in I)&&!W||I.schema===!1);b.assign(J,i$._`${q}${fR.callValidateCode($,Y,k,P)}`,I.modifying)}function V(q){var k;b.if(i$.not((k=I.valid)!==null&&k!==void 0?k:J),q)}}_3.funcKeywordCode=lR;function R3($){let{gen:I,data:U,it:b}=$;I.if(b.parentData,()=>I.assign(U,i$._`${b.parentData}[${b.parentDataProperty}]`))}function cR($,I){let{gen:U}=$;U.if(i$._`Array.isArray(${I})`,()=>{U.assign(a4.default.vErrors,i$._`${a4.default.vErrors} === null ? ${I} : ${a4.default.vErrors}.concat(${I})`).assign(a4.default.errors,i$._`${a4.default.vErrors}.length`),yR.extendErrors($)},()=>$.error())}function mR({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function T3($,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 rR($,I,U=!1){return!I.length||I.some((b)=>b==="array"?Array.isArray($):b==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==b||U&&typeof $=="undefined")}_3.validSchemaType=rR;function nR({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)}}}_3.validateKeywordUsage=nR});var f3=Z((x3)=>{Object.defineProperty(x3,"__esModule",{value:!0});x3.extendSubschemaMode=x3.extendSubschemaData=x3.getSubschema=void 0;var h6=a(),g3=W$();function pR($,{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}/${g3.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')}x3.getSubschema=pR;function tR($,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:Y,opts:J}=I,H=W.let("data",h6._`${I.data}${h6.getProperty(U)}`,!0);Q(H),$.errorPath=h6.str`${G}${g3.getErrorPath(U,b,J.jsPropertySyntax)}`,$.parentDataProperty=h6._`${U}`,$.dataPathArr=[...Y,$.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]}}x3.extendSubschemaData=tR;function aR($,{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}x3.extendSubschemaMode=aR});var DQ=Z(($o,y3)=>{y3.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 l3=Z((Io,u3)=>{var V4=u3.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(){};zb(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 zb($,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 Y in b){var J=b[Y];if(Array.isArray(J)){if(Y in V4.arrayKeywords)for(var H=0;H<J.length;H++)zb($,I,U,J[H],w+"/"+Y+"/"+H,X,w,Y,b,H)}else if(Y in V4.propsKeywords){if(J&&typeof J=="object")for(var B in J)zb($,I,U,J[B],w+"/"+Y+"/"+$T(B),X,w,Y,b,B)}else if(Y in V4.keywords||$.allKeys&&!(Y in V4.skipKeywords))zb($,I,U,J,w+"/"+Y,X,w,Y,b)}U(b,w,X,D,W,Q,G)}}function $T($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var OU=Z((n3)=>{Object.defineProperty(n3,"__esModule",{value:!0});n3.getSchemaRefs=n3.resolveUrl=n3.normalizeId=n3._getFullPath=n3.getFullPath=n3.inlineRef=void 0;var IT=W$(),UT=DQ(),wT=l3(),bT=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function XT($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!WQ($);if(!I)return!1;return c3($)<=I}n3.inlineRef=XT;var DT=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function WQ($){for(let I in $){if(DT.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(WQ))return!0;if(typeof U=="object"&&WQ(U))return!0}return!1}function c3($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,bT.has(U))continue;if(typeof $[U]=="object")IT.eachItem($[U],(b)=>I+=c3(b));if(I===1/0)return 1/0}return I}function m3($,I="",U){if(U!==!1)I=Z1(I);let b=$.parse(I);return r3($,b)}n3.getFullPath=m3;function r3($,I){return $.serialize(I).split("#")[0]+"#"}n3._getFullPath=r3;var WT=/#\/?$/;function Z1($){return $?$.replace(WT,""):""}n3.normalizeId=Z1;function QT($,I,U){return U=Z1(U),$.resolve(I,U)}n3.resolveUrl=QT;var GT=/^[a-z_][-a-z0-9._]*$/i;function YT($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:b}=this.opts,w=Z1($[U]||I),X={"":w},D=m3(b,w,!1),W={},Q=new Set;return wT($,{allKeys:!0},(J,H,B,A)=>{if(A===void 0)return;let O=D+H,V=X[A];if(typeof J[U]=="string")V=q.call(this,J[U]);k.call(this,J.$anchor),k.call(this,J.$dynamicAnchor),X[H]=V;function q(P){let h=this.opts.uriResolver.resolve;if(P=Z1(V?h(V,P):P),Q.has(P))throw Y(P);Q.add(P);let l=this.refs[P];if(typeof l=="string")l=this.refs[l];if(typeof l=="object")G(J,l.schema,P);else if(P!==Z1(O))if(P[0]==="#")G(J,W[P],P),W[P]=J;else this.refs[P]=O;return P}function k(P){if(typeof P=="string"){if(!GT.test(P))throw new Error(`invalid anchor "${P}"`);q.call(this,`#${P}`)}}}),W;function G(J,H,B){if(H!==void 0&&!UT(J,H))throw Y(B)}function Y(J){return new Error(`reference "${J}" resolves to more than one schema`)}}n3.getSchemaRefs=YT});var KU=Z((WL)=>{Object.defineProperty(WL,"__esModule",{value:!0});WL.getData=WL.KeywordCxt=WL.validateFunctionCode=void 0;var a3=Y3(),o3=AU(),GQ=s8(),Lb=AU(),OT=j3(),LU=C3(),QQ=f3(),u=a(),i=s6(),zT=OU(),$4=W$(),zU=HU();function LT($){if($L($)){if(IL($),s3($)){VT($);return}}e3($,()=>a3.topBoolOrEmptySchema($))}WL.validateFunctionCode=LT;function e3({gen:$,validateName:I,schema:U,schemaEnv:b,opts:w},X){if(w.code.es5)$.func(I,u._`${i.default.data}, ${i.default.valCxt}`,b.$async,()=>{$.code(u._`"use strict"; ${d3(U,w)}`),vT($,w),$.code(X)});else $.func(I,u._`${i.default.data}, ${KT(w)}`,b.$async,()=>$.code(d3(U,w)).code(X))}function KT($){return u._`{${i.default.instancePath}="", ${i.default.parentData}, ${i.default.parentDataProperty}, ${i.default.rootData}=${i.default.data}${$.dynamicRef?u._`, ${i.default.dynamicAnchors}={}`:u.nil}}={}`}function vT($,I){$.if(i.default.valCxt,()=>{if($.var(i.default.instancePath,u._`${i.default.valCxt}.${i.default.instancePath}`),$.var(i.default.parentData,u._`${i.default.valCxt}.${i.default.parentData}`),$.var(i.default.parentDataProperty,u._`${i.default.valCxt}.${i.default.parentDataProperty}`),$.var(i.default.rootData,u._`${i.default.valCxt}.${i.default.rootData}`),I.dynamicRef)$.var(i.default.dynamicAnchors,u._`${i.default.valCxt}.${i.default.dynamicAnchors}`)},()=>{if($.var(i.default.instancePath,u._`""`),$.var(i.default.parentData,u._`undefined`),$.var(i.default.parentDataProperty,u._`undefined`),$.var(i.default.rootData,i.default.data),I.dynamicRef)$.var(i.default.dynamicAnchors,u._`{}`)})}function VT($){let{schema:I,opts:U,gen:b}=$;e3($,()=>{if(U.$comment&&I.$comment)wL($);if(ET($),b.let(i.default.vErrors,null),b.let(i.default.errors,0),U.unevaluated)qT($);UL($),kT($)});return}function qT($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",u._`${U}.evaluated`),I.if(u._`${$.evaluated}.dynamicProps`,()=>I.assign(u._`${$.evaluated}.props`,u._`undefined`)),I.if(u._`${$.evaluated}.dynamicItems`,()=>I.assign(u._`${$.evaluated}.items`,u._`undefined`))}function d3($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?u._`/*# sourceURL=${U} */`:u.nil}function MT($,I){if($L($)){if(IL($),s3($)){FT($,I);return}}a3.boolOrEmptySchema($,I)}function s3({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function $L($){return typeof $.schema!="boolean"}function FT($,I){let{schema:U,gen:b,opts:w}=$;if(w.$comment&&U.$comment)wL($);ST($),PT($);let X=b.const("_errs",i.default.errors);UL($,X),b.var(I,u._`${X} === ${i.default.errors}`)}function IL($){$4.checkUnknownRules($),jT($)}function UL($,I){if($.opts.jtd)return p3($,[],!1,I);let U=o3.getSchemaTypes($.schema),b=o3.coerceAndCheckDataType($,U);p3($,U,!b,I)}function jT($){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 ET($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)$4.checkStrictMode($,"default is ignored in the schema root")}function ST($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=zT.resolveUrl($.opts.uriResolver,$.baseId,I)}function PT($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function wL({gen:$,schemaEnv:I,schema:U,errSchemaPath:b,opts:w}){let X=U.$comment;if(w.$comment===!0)$.code(u._`${i.default.self}.logger.log(${X})`);else if(typeof w.$comment=="function"){let D=u.str`${b}/$comment`,W=$.scopeValue("root",{ref:I.root});$.code(u._`${i.default.self}.opts.$comment(${X}, ${D}, ${W}.schema)`)}}function kT($){let{gen:I,schemaEnv:U,validateName:b,ValidationError:w,opts:X}=$;if(U.$async)I.if(u._`${i.default.errors} === 0`,()=>I.return(i.default.data),()=>I.throw(u._`new ${w}(${i.default.vErrors})`));else{if(I.assign(u._`${b}.errors`,i.default.vErrors),X.unevaluated)RT($);I.return(u._`${i.default.errors} === 0`)}}function RT({gen:$,evaluated:I,props:U,items:b}){if(U instanceof u.Name)$.assign(u._`${I}.props`,U);if(b instanceof u.Name)$.assign(u._`${I}.items`,b)}function p3($,I,U,b){let{gen:w,schema:X,data:D,allErrors:W,opts:Q,self:G}=$,{RULES:Y}=G;if(X.$ref&&(Q.ignoreKeywordsWithRef||!$4.schemaHasRulesButRef(X,Y))){w.block(()=>XL($,"$ref",Y.all.$ref.definition));return}if(!Q.jtd)TT($,I);w.block(()=>{for(let H of Y.rules)J(H);J(Y.post)});function J(H){if(!GQ.shouldUseGroup(X,H))return;if(H.type){if(w.if(Lb.checkDataType(H.type,D,Q.strictNumbers)),t3($,H),I.length===1&&I[0]===H.type&&U)w.else(),Lb.reportTypeError($);w.endIf()}else t3($,H);if(!W)w.if(u._`${i.default.errors} === ${b||0}`)}}function t3($,I){let{gen:U,schema:b,opts:{useDefaults:w}}=$;if(w)OT.assignDefaults($,I.type);U.block(()=>{for(let X of I.rules)if(GQ.shouldUseRule(b,X))XL($,X.keyword,X.definition,I.type)})}function TT($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(_T($,I),!$.opts.allowUnionTypes)ZT($,I);CT($,$.dataTypes)}function _T($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!bL($.dataTypes,U))YQ($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),xT($,I)}function ZT($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))YQ($,"use allowUnionTypes to allow union type keyword")}function CT($,I){let U=$.self.RULES.all;for(let b in U){let w=U[b];if(typeof w=="object"&&GQ.shouldUseRule($.schema,w)){let{type:X}=w.definition;if(X.length&&!X.some((D)=>gT(I,D)))YQ($,`missing type "${X.join(",")}" for keyword "${b}"`)}}}function gT($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function bL($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function xT($,I){let U=[];for(let b of $.dataTypes)if(bL(I,b))U.push(b);else if(I.includes("integer")&&b==="number")U.push("integer");$.dataTypes=U}function YQ($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,$4.checkStrictMode($,I,$.opts.strictTypes)}class NQ{constructor($,I,U){if(LU.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",DL(this.$data,$));else if(this.schemaCode=this.schemaValue,!LU.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(u.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(u.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(u._`${I} !== undefined && (${u.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?zU.reportExtraError:zU.reportError)(this,this.def.error,I)}$dataError(){zU.reportError(this,this.def.$dataError||zU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');zU.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=u.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=u.nil,I=u.nil){if(!this.$data)return;let{gen:U,schemaCode:b,schemaType:w,def:X}=this;if(U.if(u.or(u._`${b} === undefined`,I)),$!==u.nil)U.assign($,!0);if(w.length||X.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==u.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:b,it:w}=this;return u.or(X(),D());function X(){if(U.length){if(!(I instanceof u.Name))throw new Error("ajv implementation error");let W=Array.isArray(U)?U:[U];return u._`${Lb.checkDataTypes(W,I,w.opts.strictNumbers,Lb.DataType.Wrong)}`}return u.nil}function D(){if(b.validateSchema){let W=$.scopeValue("validate$data",{ref:b.validateSchema});return u._`!${W}(${I})`}return u.nil}}subschema($,I){let U=QQ.getSubschema(this.it,$);QQ.extendSubschemaData(U,this.it,$),QQ.extendSubschemaMode(U,$);let b={...this.it,...U,items:void 0,props:void 0};return MT(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($,u.Name)),!0}}WL.KeywordCxt=NQ;function XL($,I,U,b){let w=new NQ($,U,I);if("code"in U)U.code(w,b);else if(w.$data&&U.validate)LU.funcKeywordCode(w,U);else if("macro"in U)LU.macroKeywordCode(w,U);else if(U.compile||U.validate)LU.funcKeywordCode(w,U)}var hT=/^\/(?:[^~]|~0|~1)*$/,fT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function DL($,{dataLevel:I,dataNames:U,dataPathArr:b}){let w,X;if($==="")return i.default.rootData;if($[0]==="/"){if(!hT.test($))throw new Error(`Invalid JSON-pointer: ${$}`);w=$,X=i.default.rootData}else{let G=fT.exec($);if(!G)throw new Error(`Invalid JSON-pointer: ${$}`);let Y=+G[1];if(w=G[2],w==="#"){if(Y>=I)throw new Error(Q("property/index",Y));return b[I-Y]}if(Y>I)throw new Error(Q("data",Y));if(X=U[I-Y],!w)return X}let D=X,W=w.split("/");for(let G of W)if(G)X=u._`${X}${u.getProperty($4.unescapeJsonPointer(G))}`,D=u._`${D} && ${X}`;return D;function Q(G,Y){return`Cannot access ${G} ${Y} levels up, current level is ${I}`}}WL.getData=DL});var Kb=Z((YL)=>{Object.defineProperty(YL,"__esModule",{value:!0});class GL extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}YL.default=GL});var vU=Z((JL)=>{Object.defineProperty(JL,"__esModule",{value:!0});var JQ=OU();class NL extends Error{constructor($,I,U,b){super(b||`can't resolve reference ${U} from id ${I}`);this.missingRef=JQ.resolveUrl($,I,U),this.missingSchema=JQ.normalizeId(JQ.getFullPath($,this.missingRef))}}JL.default=NL});var Vb=Z((AL)=>{Object.defineProperty(AL,"__esModule",{value:!0});AL.resolveSchema=AL.getCompilingSchema=AL.resolveRef=AL.compileSchema=AL.SchemaEnv=void 0;var S6=a(),mT=Kb(),e4=s6(),P6=OU(),BL=W$(),rT=KU();class VU{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={}}}AL.SchemaEnv=VU;function HQ($){let I=HL.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:mT.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:e4.default.data,parentData:e4.default.parentData,parentDataProperty:e4.default.parentDataProperty,dataNames:[e4.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},Y;try{this._compilations.add($),rT.validateFunctionCode(G),D.optimize(this.opts.code.optimize);let J=D.toString();if(Y=`${D.scopeRefs(e4.default.scope)}return ${J}`,this.opts.code.process)Y=this.opts.code.process(Y,$);let B=new Function(`${e4.default.self}`,`${e4.default.scope}`,Y)(this,this.scope.get());if(this.scope.value(Q,{ref:B}),B.errors=null,B.schema=$.schema,B.schemaEnv=$,$.$async)B.$async=!0;if(this.opts.code.source===!0)B.source={validateName:Q,validateCode:J,scopeValues:D._values};if(this.opts.unevaluated){let{props:A,items:O}=G;if(B.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},B.source)B.source.evaluated=S6.stringify(B.evaluated)}return $.validate=B,$}catch(J){if(delete $.validate,delete $.validateName,Y)this.logger.error("Error compiling schema, function code:",Y);throw J}finally{this._compilations.delete($)}}AL.compileSchema=HQ;function nT($,I,U){var b;U=P6.resolveUrl(this.opts.uriResolver,I,U);let w=$.refs[U];if(w)return w;let X=dT.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 VU({schema:D,schemaId:W,root:$,baseId:I})}if(X===void 0)return;return $.refs[U]=iT.call(this,X)}AL.resolveRef=nT;function iT($){if(P6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:HQ.call(this,$)}function HL($){for(let I of this._compilations)if(oT(I,$))return I}AL.getCompilingSchema=HL;function oT($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function dT($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||vb.call(this,$,I)}function vb($,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 BQ.call(this,U,$);let X=P6.normalizeId(b),D=this.refs[X]||this.schemas[X];if(typeof D=="string"){let W=vb.call(this,$,D);if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;return BQ.call(this,U,W)}if(typeof(D===null||D===void 0?void 0:D.schema)!=="object")return;if(!D.validate)HQ.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 VU({schema:W,schemaId:Q,root:$,baseId:w})}return BQ.call(this,U,D)}AL.resolveSchema=vb;var pT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function BQ($,{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[BL.unescapeFragment(W)];if(Q===void 0)return;U=Q;let G=typeof U==="object"&&U[this.opts.schemaId];if(!pT.has(W)&&G)I=P6.resolveUrl(this.opts.uriResolver,I,G)}let X;if(typeof U!="boolean"&&U.$ref&&!BL.schemaHasRulesButRef(U,this.RULES)){let W=P6.resolveUrl(this.opts.uriResolver,I,U.$ref);X=vb.call(this,b,W)}let{schemaId:D}=this.opts;if(X=X||new VU({schema:U,schemaId:D,root:b,baseId:I}),X.schema!==X.root.schema)return X;return}});var zL=Z((Wo,$_)=>{$_.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 OQ=Z((Qo,VL)=>{var I_=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),KL=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 AQ($){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 U_=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function LL($){return $.length=0,!0}function w_($,I,U){if($.length){let b=AQ($);if(b!=="")I.push(b);else return U.error=!0,!1;$.length=0}return!0}function b_($){let I=0,U={error:!1,address:"",zone:""},b=[],w=[],X=!1,D=!1,W=w_;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=LL}else{w.push(G);continue}}if(w.length)if(W===LL)U.zone=w.join("");else if(D)b.push(w.join(""));else b.push(AQ(w));return U.address=b.join(""),U}function vL($){if(X_($,":")<2)return{host:$,isIPV6:!1};let I=b_($);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 X_($,I){let U=0;for(let b=0;b<$.length;b++)if($[b]===I)U++;return U}function D_($){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 W_($,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 Q_($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!KL(U)){let b=vL(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}VL.exports={nonSimpleDomain:U_,recomposeAuthority:Q_,normalizeComponentEncoding:W_,removeDotSegments:D_,isIPv4:KL,isUUID:I_,normalizeIPv6:vL,stringArrayToHexStripped:AQ}});var EL=Z((Go,jL)=>{var{isUUID:G_}=OQ(),Y_=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,N_=["http","https","ws","wss","urn","urn:uuid"];function J_($){return N_.indexOf($)!==-1}function zQ($){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 qL($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function ML($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function B_($){return $.secure=zQ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function H_($){if($.port===(zQ($)?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 A_($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(Y_);if(U){let b=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let w=`${b}:${I.nid||$.nid}`,X=LQ(w);if($.path=void 0,X)$=X.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function O_($,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=LQ(w);if(X)$=X.serialize($,I);let D=$,W=$.nss;return D.path=`${b||I.nid}:${W}`,I.skipEscape=!0,D}function z_($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!G_(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function L_($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var FL={scheme:"http",domainHost:!0,parse:qL,serialize:ML},K_={scheme:"https",domainHost:FL.domainHost,parse:qL,serialize:ML},qb={scheme:"ws",domainHost:!0,parse:B_,serialize:H_},v_={scheme:"wss",domainHost:qb.domainHost,parse:qb.parse,serialize:qb.serialize},V_={scheme:"urn",parse:A_,serialize:O_,skipNormalize:!0},q_={scheme:"urn:uuid",parse:z_,serialize:L_,skipNormalize:!0},Mb={http:FL,https:K_,ws:qb,wss:v_,urn:V_,"urn:uuid":q_};Object.setPrototypeOf(Mb,null);function LQ($){return $&&(Mb[$]||Mb[$.toLowerCase()])||void 0}jL.exports={wsIsSecure:zQ,SCHEMES:Mb,isValidSchemeName:J_,getSchemeHandler:LQ}});var kL=Z((Yo,jb)=>{var{normalizeIPv6:M_,removeDotSegments:qU,recomposeAuthority:F_,normalizeComponentEncoding:Fb,isIPv4:j_,nonSimpleDomain:E_}=OQ(),{SCHEMES:S_,getSchemeHandler:SL}=EL();function P_($,I){if(typeof $==="string")$=f6(I4($,I),I);else if(typeof $==="object")$=I4(f6($,I),I);return $}function k_($,I,U){let b=U?Object.assign({scheme:"null"},U):{scheme:"null"},w=PL(I4($,b),I4(I,b),b,!0);return b.skipEscape=!0,f6(w,b)}function PL($,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=qU(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=qU(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=qU(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=qU(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 R_($,I,U){if(typeof $==="string")$=unescape($),$=f6(Fb(I4($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=f6(Fb($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=f6(Fb(I4(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=f6(Fb(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=SL(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=F_(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=qU(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 T_=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\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(T_);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(j_(b.host)===!1){let Q=M_(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=SL(U.scheme||b.scheme);if(!U.unicodeSupport&&(!D||!D.unicodeSupport)){if(b.host&&(U.domainHost||D&&D.domainHost)&&w===!1&&E_(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 KQ={SCHEMES:S_,normalize:P_,resolve:k_,resolveComponent:PL,equal:R_,serialize:f6,parse:I4};jb.exports=KQ;jb.exports.default=KQ;jb.exports.fastUri=KQ});var _L=Z((TL)=>{Object.defineProperty(TL,"__esModule",{value:!0});var RL=kL();RL.code='require("ajv/dist/runtime/uri").default';TL.default=RL});var uL=Z((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.CodeGen=U4.Name=U4.nil=U4.stringify=U4.str=U4._=U4.KeywordCxt=void 0;var Z_=KU();Object.defineProperty(U4,"KeywordCxt",{enumerable:!0,get:function(){return Z_.KeywordCxt}});var C1=a();Object.defineProperty(U4,"_",{enumerable:!0,get:function(){return C1._}});Object.defineProperty(U4,"str",{enumerable:!0,get:function(){return C1.str}});Object.defineProperty(U4,"stringify",{enumerable:!0,get:function(){return C1.stringify}});Object.defineProperty(U4,"nil",{enumerable:!0,get:function(){return C1.nil}});Object.defineProperty(U4,"Name",{enumerable:!0,get:function(){return C1.Name}});Object.defineProperty(U4,"CodeGen",{enumerable:!0,get:function(){return C1.CodeGen}});var C_=Kb(),hL=vU(),g_=e8(),MU=Vb(),x_=a(),FU=OU(),Eb=AU(),VQ=W$(),ZL=zL(),h_=_L(),fL=($,I)=>new RegExp($,I);fL.code="new RegExp";var f_=["removeAdditional","useDefaults","coerceTypes"],y_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),u_={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."},l_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},CL=200;function c_($){var I,U,b,w,X,D,W,Q,G,Y,J,H,B,A,O,V,q,k,P,h,l,l$,N6,B1,tD;let SI=$.strict,aD=(I=$.code)===null||I===void 0?void 0:I.optimize,TH=aD===!0||aD===void 0?1:aD||0,_H=(b=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&b!==void 0?b:fL,sF=(w=$.uriResolver)!==null&&w!==void 0?w:h_.default;return{strictSchema:(D=(X=$.strictSchema)!==null&&X!==void 0?X:SI)!==null&&D!==void 0?D:!0,strictNumbers:(Q=(W=$.strictNumbers)!==null&&W!==void 0?W:SI)!==null&&Q!==void 0?Q:!0,strictTypes:(Y=(G=$.strictTypes)!==null&&G!==void 0?G:SI)!==null&&Y!==void 0?Y:"log",strictTuples:(H=(J=$.strictTuples)!==null&&J!==void 0?J:SI)!==null&&H!==void 0?H:"log",strictRequired:(A=(B=$.strictRequired)!==null&&B!==void 0?B:SI)!==null&&A!==void 0?A:!1,code:$.code?{...$.code,optimize:TH,regExp:_H}:{optimize:TH,regExp:_H},loopRequired:(O=$.loopRequired)!==null&&O!==void 0?O:CL,loopEnum:(V=$.loopEnum)!==null&&V!==void 0?V:CL,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:(h=$.schemaId)!==null&&h!==void 0?h:"$id",addUsedSchema:(l=$.addUsedSchema)!==null&&l!==void 0?l:!0,validateSchema:(l$=$.validateSchema)!==null&&l$!==void 0?l$:!0,validateFormats:(N6=$.validateFormats)!==null&&N6!==void 0?N6:!0,unicodeRegExp:(B1=$.unicodeRegExp)!==null&&B1!==void 0?B1:!0,int32range:(tD=$.int32range)!==null&&tD!==void 0?tD:!0,uriResolver:sF}}class Sb{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...c_($)};let{es5:I,lines:U}=this.opts.code;this.scope=new x_.ValueScope({scope:{},prefixes:y_,es5:I,lines:U}),this.logger=d_($.logger);let b=$.validateFormats;if($.validateFormats=!1,this.RULES=g_.getRules(),gL.call(this,u_,$,"NOT SUPPORTED"),gL.call(this,l_,$,"DEPRECATED","warn"),this._metaOpts=i_.call(this),$.formats)r_.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)n_.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);m_.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,Y){await w.call(this,G.$schema);let J=this._addSchema(G,Y);return J.validate||X.call(this,J)}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(Y){if(!(Y instanceof hL.default))throw Y;return D.call(this,Y),await W.call(this,Y.missingSchema),X.call(this,G)}}function D({missingSchema:G,missingRef:Y}){if(this.refs[G])throw new Error(`AnySchema ${G} is loaded but ${Y} cannot be resolved`)}async function W(G){let Y=await Q.call(this,G);if(!this.refs[G])await w.call(this,Y.$schema);if(!this.refs[G])this.addSchema(Y,G,I)}async function Q(G){let Y=this._loading[G];if(Y)return Y;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=FU.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=xL.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,b=new MU.SchemaEnv({schema:{},schemaId:U});if(I=MU.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=xL.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=FU.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(t_.call(this,U,I),!I)return VQ.eachItem(U,(w)=>vQ.call(this,w)),this;e_.call(this,I);let b={...I,type:Eb.getJSONTypes(I.type),schemaType:Eb.getJSONTypes(I.schemaType)};return VQ.eachItem(U,b.type.length===0?(w)=>vQ.call(this,w,b):(w)=>b.type.forEach((X)=>vQ.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]=yL(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=FU.normalizeId(X||U);let Q=FU.getSchemaRefs.call(this,$,U);if(W=new MU.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 MU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{MU.compileSchema.call(this,$)}finally{this.opts=I}}}Sb.ValidationError=C_.default;Sb.MissingRefError=hL.default;U4.default=Sb;function gL($,I,U,b="error"){for(let w in $){let X=w;if(X in I)this.logger[b](`${U}: option ${w}. ${$[X]}`)}}function xL($){return $=FU.normalizeId($),this.schemas[$]||this.refs[$]}function m_(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function r_(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function n_($){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 i_(){let $={...this.opts};for(let I of f_)delete $[I];return $}var o_={log(){},warn(){},error(){}};function d_($){if($===!1)return o_;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var p_=/^[a-z_$][a-z0-9_$:-]*$/i;function t_($,I){let{RULES:U}=this;if(VQ.eachItem($,(b)=>{if(U.keywords[b])throw new Error(`Keyword ${b} is already defined`);if(!p_.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 vQ($,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:Eb.getJSONTypes(I.type),schemaType:Eb.getJSONTypes(I.schemaType)}};if(I.before)a_.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 a_($,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 e_($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=yL(I);$.validateSchema=this.compile(I,!0)}var s_={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function yL($){return{anyOf:[$,s_]}}});var cL=Z((lL)=>{Object.defineProperty(lL,"__esModule",{value:!0});var UZ={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};lL.default=UZ});var dL=Z((iL)=>{Object.defineProperty(iL,"__esModule",{value:!0});iL.callRef=iL.getValidate=void 0;var bZ=vU(),mL=O6(),$6=a(),g1=s6(),rL=Vb(),Pb=W$(),XZ={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 J();let Y=rL.resolveRef.call(Q,G,w,U);if(Y===void 0)throw new bZ.default(b.opts.uriResolver,w,U);if(Y instanceof rL.SchemaEnv)return H(Y);return B(Y);function J(){if(X===G)return kb($,D,X,X.$async);let A=I.scopeValue("root",{ref:G});return kb($,$6._`${A}.validate`,G,G.$async)}function H(A){let O=nL($,A);kb($,O,A,A.$async)}function B(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 nL($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):$6._`${U.scopeValue("wrapper",{ref:I})}.validate`}iL.getValidate=nL;function kb($,I,U,b){let{gen:w,it:X}=$,{allErrors:D,schemaEnv:W,opts:Q}=X,G=Q.passContext?g1.default.this:$6.nil;if(b)Y();else J();function Y(){if(!W.$async)throw new Error("async schema referenced by sync schema");let A=w.let("valid");w.try(()=>{if(w.code($6._`await ${mL.callValidateCode($,I,G)}`),B(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 J(){$.result(mL.callValidateCode($,I,G),()=>B(I),()=>H(I))}function H(A){let O=$6._`${A}.errors`;w.assign(g1.default.vErrors,$6._`${g1.default.vErrors} === null ? ${O} : ${g1.default.vErrors}.concat(${O})`),w.assign(g1.default.errors,$6._`${g1.default.vErrors}.length`)}function B(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=Pb.mergeEvaluated.props(w,V.props,X.props)}else{let q=w.var("props",$6._`${A}.evaluated.props`);X.props=Pb.mergeEvaluated.props(w,q,X.props,$6.Name)}if(X.items!==!0)if(V&&!V.dynamicItems){if(V.items!==void 0)X.items=Pb.mergeEvaluated.items(w,V.items,X.items)}else{let q=w.var("items",$6._`${A}.evaluated.items`);X.items=Pb.mergeEvaluated.items(w,q,X.items,$6.Name)}}}iL.callRef=kb;iL.default=XZ});var tL=Z((pL)=>{Object.defineProperty(pL,"__esModule",{value:!0});var QZ=cL(),GZ=dL(),YZ=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",QZ.default,GZ.default];pL.default=YZ});var eL=Z((aL)=>{Object.defineProperty(aL,"__esModule",{value:!0});var Rb=a(),q4=Rb.operators,Tb={maximum:{okStr:"<=",ok:q4.LTE,fail:q4.GT},minimum:{okStr:">=",ok:q4.GTE,fail:q4.LT},exclusiveMaximum:{okStr:"<",ok:q4.LT,fail:q4.GTE},exclusiveMinimum:{okStr:">",ok:q4.GT,fail:q4.LTE}},JZ={message:({keyword:$,schemaCode:I})=>Rb.str`must be ${Tb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>Rb._`{comparison: ${Tb[$].okStr}, limit: ${I}}`},BZ={keyword:Object.keys(Tb),type:"number",schemaType:"number",$data:!0,error:JZ,code($){let{keyword:I,data:U,schemaCode:b}=$;$.fail$data(Rb._`${U} ${Tb[I].fail} ${b} || isNaN(${U})`)}};aL.default=BZ});var $K=Z((sL)=>{Object.defineProperty(sL,"__esModule",{value:!0});var jU=a(),AZ={message:({schemaCode:$})=>jU.str`must be multiple of ${$}`,params:({schemaCode:$})=>jU._`{multipleOf: ${$}}`},OZ={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:AZ,code($){let{gen:I,data:U,schemaCode:b,it:w}=$,X=w.opts.multipleOfPrecision,D=I.let("res"),W=X?jU._`Math.abs(Math.round(${D}) - ${D}) > 1e-${X}`:jU._`${D} !== parseInt(${D})`;$.fail$data(jU._`(${b} === 0 || (${D} = ${U}/${b}, ${W}))`)}};sL.default=OZ});var wK=Z((UK)=>{Object.defineProperty(UK,"__esModule",{value:!0});function IK($){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}UK.default=IK;IK.code='require("ajv/dist/runtime/ucs2length").default'});var XK=Z((bK)=>{Object.defineProperty(bK,"__esModule",{value:!0});var s4=a(),KZ=W$(),vZ=wK(),VZ={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return s4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>s4._`{limit: ${$}}`},qZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:VZ,code($){let{keyword:I,data:U,schemaCode:b,it:w}=$,X=I==="maxLength"?s4.operators.GT:s4.operators.LT,D=w.opts.unicode===!1?s4._`${U}.length`:s4._`${KZ.useFunc($.gen,vZ.default)}(${U})`;$.fail$data(s4._`${D} ${X} ${b}`)}};bK.default=qZ});var WK=Z((DK)=>{Object.defineProperty(DK,"__esModule",{value:!0});var FZ=O6(),_b=a(),jZ={message:({schemaCode:$})=>_b.str`must match pattern "${$}"`,params:({schemaCode:$})=>_b._`{pattern: ${$}}`},EZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:jZ,code($){let{data:I,$data:U,schema:b,schemaCode:w,it:X}=$,D=X.opts.unicodeRegExp?"u":"",W=U?_b._`(new RegExp(${w}, ${D}))`:FZ.usePattern($,b);$.fail$data(_b._`!${W}.test(${I})`)}};DK.default=EZ});var GK=Z((QK)=>{Object.defineProperty(QK,"__esModule",{value:!0});var EU=a(),PZ={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return EU.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>EU._`{limit: ${$}}`},kZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:PZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxProperties"?EU.operators.GT:EU.operators.LT;$.fail$data(EU._`Object.keys(${U}).length ${w} ${b}`)}};QK.default=kZ});var NK=Z((YK)=>{Object.defineProperty(YK,"__esModule",{value:!0});var SU=O6(),PU=a(),TZ=W$(),_Z={message:({params:{missingProperty:$}})=>PU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>PU._`{missingProperty: ${$}}`},ZZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:_Z,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 Y();if(W.strictRequired){let B=$.parentSchema.properties,{definedProperties:A}=$.it;for(let O of U)if((B===null||B===void 0?void 0:B[O])===void 0&&!A.has(O)){let V=D.schemaEnv.baseId+D.errSchemaPath,q=`required property "${O}" is not defined at "${V}" (strictRequired)`;TZ.checkStrictMode(D,q,D.opts.strictRequired)}}function G(){if(Q||X)$.block$data(PU.nil,J);else for(let B of U)SU.checkReportMissingProp($,B)}function Y(){let B=I.let("missing");if(Q||X){let A=I.let("valid",!0);$.block$data(A,()=>H(B,A)),$.ok(A)}else I.if(SU.checkMissingProp($,U,B)),SU.reportMissingProp($,B),I.else()}function J(){I.forOf("prop",b,(B)=>{$.setParams({missingProperty:B}),I.if(SU.noPropertyInData(I,w,B,W.ownProperties),()=>$.error())})}function H(B,A){$.setParams({missingProperty:B}),I.forOf(B,b,()=>{I.assign(A,SU.propertyInData(I,w,B,W.ownProperties)),I.if(PU.not(A),()=>{$.error(),I.break()})},PU.nil)}}};YK.default=ZZ});var BK=Z((JK)=>{Object.defineProperty(JK,"__esModule",{value:!0});var kU=a(),gZ={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return kU.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>kU._`{limit: ${$}}`},xZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:gZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxItems"?kU.operators.GT:kU.operators.LT;$.fail$data(kU._`${U}.length ${w} ${b}`)}};JK.default=xZ});var Zb=Z((AK)=>{Object.defineProperty(AK,"__esModule",{value:!0});var HK=DQ();HK.code='require("ajv/dist/runtime/equal").default';AK.default=HK});var zK=Z((OK)=>{Object.defineProperty(OK,"__esModule",{value:!0});var qQ=AU(),h$=a(),yZ=W$(),uZ=Zb(),lZ={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}}`},cZ={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:lZ,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?qQ.getSchemaTypes(X.items):[];$.block$data(Q,Y,h$._`${D} === false`),$.ok(Q);function Y(){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`,()=>(J()?H:B)(A,O))}function J(){return G.length>0&&!G.some((A)=>A==="object"||A==="array")}function H(A,O){let V=I.name("item"),q=qQ.checkDataTypes(G,V,W.opts.strictNumbers,qQ.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 B(A,O){let V=yZ.useFunc(I,uZ.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)})))}}};OK.default=cZ});var KK=Z((LK)=>{Object.defineProperty(LK,"__esModule",{value:!0});var MQ=a(),rZ=W$(),nZ=Zb(),iZ={message:"must be equal to constant",params:({schemaCode:$})=>MQ._`{allowedValue: ${$}}`},oZ={keyword:"const",$data:!0,error:iZ,code($){let{gen:I,data:U,$data:b,schemaCode:w,schema:X}=$;if(b||X&&typeof X=="object")$.fail$data(MQ._`!${rZ.useFunc(I,nZ.default)}(${U}, ${w})`);else $.fail(MQ._`${X} !== ${U}`)}};LK.default=oZ});var VK=Z((vK)=>{Object.defineProperty(vK,"__esModule",{value:!0});var RU=a(),pZ=W$(),tZ=Zb(),aZ={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>RU._`{allowedValues: ${$}}`},eZ={keyword:"enum",schemaType:"array",$data:!0,error:aZ,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=pZ.useFunc(I,tZ.default),Y;if(W||b)Y=I.let("valid"),$.block$data(Y,J);else{if(!Array.isArray(w))throw new Error("ajv implementation error");let B=I.const("vSchema",X);Y=RU.or(...w.map((A,O)=>H(B,O)))}$.pass(Y);function J(){I.assign(Y,!1),I.forOf("v",X,(B)=>I.if(RU._`${G()}(${U}, ${B})`,()=>I.assign(Y,!0).break()))}function H(B,A){let O=w[A];return typeof O==="object"&&O!==null?RU._`${G()}(${U}, ${B}[${A}])`:RU._`${U} === ${O}`}}};vK.default=eZ});var MK=Z((qK)=>{Object.defineProperty(qK,"__esModule",{value:!0});var $C=eL(),IC=$K(),UC=XK(),wC=WK(),bC=GK(),XC=NK(),DC=BK(),WC=zK(),QC=KK(),GC=VK(),YC=[$C.default,IC.default,UC.default,wC.default,bC.default,XC.default,DC.default,WC.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},QC.default,GC.default];qK.default=YC});var jQ=Z((jK)=>{Object.defineProperty(jK,"__esModule",{value:!0});jK.validateAdditionalItems=void 0;var $1=a(),FQ=W$(),JC={message:({params:{len:$}})=>$1.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>$1._`{limit: ${$}}`},BC={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:JC,code($){let{parentSchema:I,it:U}=$,{items:b}=I;if(!Array.isArray(b)){FQ.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}FK($,b)}};function FK($,I){let{gen:U,schema:b,data:w,keyword:X,it:D}=$;D.items=!0;let W=U.const("len",$1._`${w}.length`);if(b===!1)$.setParams({len:I.length}),$.pass($1._`${W} <= ${I.length}`);else if(typeof b=="object"&&!FQ.alwaysValidSchema(D,b)){let G=U.var("valid",$1._`${W} <= ${I.length}`);U.if($1.not(G),()=>Q(G)),$.ok(G)}function Q(G){U.forRange("i",I.length,W,(Y)=>{if($.subschema({keyword:X,dataProp:Y,dataPropType:FQ.Type.Num},G),!D.allErrors)U.if($1.not(G),()=>U.break())})}}jK.validateAdditionalItems=FK;jK.default=BC});var EQ=Z((kK)=>{Object.defineProperty(kK,"__esModule",{value:!0});kK.validateTuple=void 0;var SK=a(),Cb=W$(),AC=O6(),OC={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return PK($,"additionalItems",I);if(U.items=!0,Cb.alwaysValidSchema(U,I))return;$.ok(AC.validateArray($))}};function PK($,I,U=$.schema){let{gen:b,parentSchema:w,data:X,keyword:D,it:W}=$;if(Y(w),W.opts.unevaluated&&U.length&&W.items!==!0)W.items=Cb.mergeEvaluated.items(b,U.length,W.items);let Q=b.name("valid"),G=b.const("len",SK._`${X}.length`);U.forEach((J,H)=>{if(Cb.alwaysValidSchema(W,J))return;b.if(SK._`${G} > ${H}`,()=>$.subschema({keyword:D,schemaProp:H,dataProp:H},Q)),$.ok(Q)});function Y(J){let{opts:H,errSchemaPath:B}=W,A=U.length,O=A===J.minItems&&(A===J.maxItems||J[I]===!1);if(H.strictTuples&&!O){let V=`"${D}" is ${A}-tuple, but minItems or maxItems/${I} are not specified or different at path "${B}"`;Cb.checkStrictMode(W,V,H.strictTuples)}}}kK.validateTuple=PK;kK.default=OC});var _K=Z((TK)=>{Object.defineProperty(TK,"__esModule",{value:!0});var LC=EQ(),KC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>LC.validateTuple($,"items")};TK.default=KC});var gK=Z((CK)=>{Object.defineProperty(CK,"__esModule",{value:!0});var ZK=a(),VC=W$(),qC=O6(),MC=jQ(),FC={message:({params:{len:$}})=>ZK.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>ZK._`{limit: ${$}}`},jC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:FC,code($){let{schema:I,parentSchema:U,it:b}=$,{prefixItems:w}=U;if(b.items=!0,VC.alwaysValidSchema(b,I))return;if(w)MC.validateAdditionalItems($,w);else $.ok(qC.validateArray($))}};CK.default=jC});var hK=Z((xK)=>{Object.defineProperty(xK,"__esModule",{value:!0});var z6=a(),gb=W$(),SC={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}}`},PC={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:SC,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 Y=I.const("len",z6._`${w}.length`);if($.setParams({min:D,max:W}),W===void 0&&D===0){gb.checkStrictMode(X,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(W!==void 0&&D>W){gb.checkStrictMode(X,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(gb.alwaysValidSchema(X,U)){let O=z6._`${Y} >= ${D}`;if(W!==void 0)O=z6._`${O} && ${Y} <= ${W}`;$.pass(O);return}X.items=!0;let J=I.name("valid");if(W===void 0&&D===1)B(J,()=>I.if(J,()=>I.break()));else if(D===0){if(I.let(J,!0),W!==void 0)I.if(z6._`${w}.length > 0`,H)}else I.let(J,!1),H();$.result(J,()=>$.reset());function H(){let O=I.name("_valid"),V=I.let("count",0);B(O,()=>I.if(O,()=>A(V)))}function B(O,V){I.forRange("i",0,Y,(q)=>{$.subschema({keyword:"contains",dataProp:q,dataPropType:gb.Type.Num,compositeRule:!0},O),V()})}function A(O){if(I.code(z6._`${O}++`),W===void 0)I.if(z6._`${O} >= ${D}`,()=>I.assign(J,!0).break());else if(I.if(z6._`${O} > ${W}`,()=>I.assign(J,!1).break()),D===1)I.assign(J,!0);else I.if(z6._`${O} >= ${D}`,()=>I.assign(J,!0))}}};xK.default=PC});var mK=Z((uK)=>{Object.defineProperty(uK,"__esModule",{value:!0});uK.validateSchemaDeps=uK.validatePropertyDeps=uK.error=void 0;var SQ=a(),RC=W$(),TU=O6();uK.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let b=I===1?"property":"properties";return SQ.str`must have ${b} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:b}})=>SQ._`{property: ${$},
|
|
7
7
|
missingProperty: ${b},
|
|
8
8
|
depsCount: ${I},
|
|
9
|
-
deps: ${U}}`};var _C={keyword:"dependencies",type:"object",schemaType:"object",error:lK.error,code($){let[I,U]=ZC($);yK($,I),uK($,U)}};function ZC({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 yK($,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=TU.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)TU.checkReportMissingProp($,G)});else U.if(SQ._`${Q} && (${TU.checkMissingProp($,W,X)})`),TU.reportMissingProp($,X),U.else()}}lK.validatePropertyDeps=yK;function uK($,I=$.schema){let{gen:U,data:b,keyword:w,it:X}=$,D=U.name("valid");for(let W in I){if(TC.alwaysValidSchema(X,I[W]))continue;U.if(TU.propertyInData(U,b,W,X.opts.ownProperties),()=>{let Q=$.subschema({keyword:w,schemaProp:W},D);$.mergeValidEvaluated(Q,D)},()=>U.var(D,!0)),$.ok(D)}}lK.validateSchemaDeps=uK;lK.default=_C});var oK=Z((iK)=>{Object.defineProperty(iK,"__esModule",{value:!0});var nK=a(),xC=W$(),hC={message:"property name must be valid",params:({params:$})=>nK._`{propertyName: ${$.propertyName}}`},fC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:hC,code($){let{gen:I,schema:U,data:b,it:w}=$;if(xC.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(nK.not(X),()=>{if($.error(!0),!w.allErrors)I.break()})}),$.ok(X)}};iK.default=fC});var PQ=Z((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});var xb=O6(),k6=a(),uC=s6(),hb=W$(),lC={message:"must NOT have additional properties",params:({params:$})=>k6._`{additionalProperty: ${$.additionalProperty}}`},cC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:lC,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"&&hb.alwaysValidSchema(D,U))return;let G=xb.allSchemaProperties(b.properties),Y=xb.allSchemaProperties(b.patternProperties);J(),$.ok(k6._`${X} === ${uC.default.errors}`);function J(){I.forIn("key",w,(V)=>{if(!G.length&&!Y.length)A(V);else I.if(H(V),()=>A(V))})}function H(V){let q;if(G.length>8){let k=hb.schemaRefOrVal(D,b.properties,"properties");q=xb.isOwnProperty(I,k,V)}else if(G.length)q=k6.or(...G.map((k)=>k6._`${V} === ${k}`));else q=k6.nil;if(Y.length)q=k6.or(q,...Y.map((k)=>k6._`${xb.usePattern($,k)}.test(${V})`));return k6.not(q)}function B(V){I.code(k6._`delete ${w}[${V}]`)}function A(V){if(Q.removeAdditional==="all"||Q.removeAdditional&&U===!1){B(V);return}if(U===!1){if($.setParams({additionalProperty:V}),$.error(),!W)I.break();return}if(typeof U=="object"&&!hb.alwaysValidSchema(D,U)){let q=I.name("valid");if(Q.removeAdditional==="failing")O(V,q,!1),I.if(k6.not(q),()=>{$.reset(),B(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:hb.Type.Str};if(k===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,q)}}};dK.default=cC});var eK=Z((aK)=>{Object.defineProperty(aK,"__esModule",{value:!0});var rC=KU(),pK=O6(),kQ=W$(),tK=PQ(),nC={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)tK.default.code(new rC.KeywordCxt(X,tK.default,"additionalProperties"));let D=pK.allSchemaProperties(U);for(let J of D)X.definedProperties.add(J);if(X.opts.unevaluated&&D.length&&X.props!==!0)X.props=kQ.mergeEvaluated.props(I,kQ.toHash(D),X.props);let W=D.filter((J)=>!kQ.alwaysValidSchema(X,U[J]));if(W.length===0)return;let Q=I.name("valid");for(let J of W){if(G(J))Y(J);else{if(I.if(pK.propertyInData(I,w,J,X.opts.ownProperties)),Y(J),!X.allErrors)I.else().var(Q,!0);I.endIf()}$.it.definedProperties.add(J),$.ok(Q)}function G(J){return X.opts.useDefaults&&!X.compositeRule&&U[J].default!==void 0}function Y(J){$.subschema({keyword:"properties",schemaProp:J,dataProp:J},Q)}}};aK.default=nC});var wv=Z((Uv)=>{Object.defineProperty(Uv,"__esModule",{value:!0});var sK=O6(),fb=a(),$v=W$(),Iv=W$(),oC={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:b,parentSchema:w,it:X}=$,{opts:D}=X,W=sK.allSchemaProperties(U),Q=W.filter((O)=>$v.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,Y=I.name("valid");if(X.props!==!0&&!(X.props instanceof fb.Name))X.props=Iv.evaluatedPropsToName(I,X.props);let{props:J}=X;H();function H(){for(let O of W){if(G)B(O);if(X.allErrors)A(O);else I.var(Y,!0),A(O),I.if(Y)}}function B(O){for(let V in G)if(new RegExp(O).test(V))$v.checkStrictMode(X,`property ${V} matches pattern ${O} (use allowMatchingProperties)`)}function A(O){I.forIn("key",b,(V)=>{I.if(fb._`${sK.usePattern($,O)}.test(${V})`,()=>{let q=Q.includes(O);if(!q)$.subschema({keyword:"patternProperties",schemaProp:O,dataProp:V,dataPropType:Iv.Type.Str},Y);if(X.opts.unevaluated&&J!==!0)I.assign(fb._`${J}[${V}]`,!0);else if(!q&&!X.allErrors)I.if(fb.not(Y),()=>I.break())})})}}};Uv.default=oC});var Xv=Z((bv)=>{Object.defineProperty(bv,"__esModule",{value:!0});var pC=W$(),tC={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:b}=$;if(pC.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"}};bv.default=tC});var Wv=Z((Dv)=>{Object.defineProperty(Dv,"__esModule",{value:!0});var eC=O6(),sC={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:eC.validateUnion,error:{message:"must match a schema in anyOf"}};Dv.default=sC});var Gv=Z((Qv)=>{Object.defineProperty(Qv,"__esModule",{value:!0});var yb=a(),Ig=W$(),Ug={message:"must match exactly one schema in oneOf",params:({params:$})=>yb._`{passingSchemas: ${$.passing}}`},wg={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ug,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((Y,J)=>{let H;if(Ig.alwaysValidSchema(w,Y))I.var(Q,!0);else H=$.subschema({keyword:"oneOf",schemaProp:J,compositeRule:!0},Q);if(J>0)I.if(yb._`${Q} && ${D}`).assign(D,!1).assign(W,yb._`[${W}, ${J}]`).else();I.if(Q,()=>{if(I.assign(D,!0),I.assign(W,J),H)$.mergeEvaluated(H,yb.Name)})})}}};Qv.default=wg});var Nv=Z((Yv)=>{Object.defineProperty(Yv,"__esModule",{value:!0});var Xg=W$(),Dg={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(Xg.alwaysValidSchema(b,X))return;let W=$.subschema({keyword:"allOf",schemaProp:D},w);$.ok(w),$.mergeEvaluated(W)})}};Yv.default=Dg});var Av=Z((Hv)=>{Object.defineProperty(Hv,"__esModule",{value:!0});var ub=a(),Bv=W$(),Qg={message:({params:$})=>ub.str`must match "${$.ifClause}" schema`,params:({params:$})=>ub._`{failingKeyword: ${$.ifClause}}`},Gg={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Qg,code($){let{gen:I,parentSchema:U,it:b}=$;if(U.then===void 0&&U.else===void 0)Bv.checkStrictMode(b,'"if" without "then" and "else" is ignored');let w=Jv(b,"then"),X=Jv(b,"else");if(!w&&!X)return;let D=I.let("valid",!0),W=I.name("_valid");if(Q(),$.reset(),w&&X){let Y=I.let("ifClause");$.setParams({ifClause:Y}),I.if(W,G("then",Y),G("else",Y))}else if(w)I.if(W,G("then"));else I.if(ub.not(W),G("else"));$.pass(D,()=>$.error(!0));function Q(){let Y=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},W);$.mergeEvaluated(Y)}function G(Y,J){return()=>{let H=$.subschema({keyword:Y},W);if(I.assign(D,W),$.mergeValidEvaluated(H,D),J)I.assign(J,ub._`${Y}`);else $.setParams({ifClause:Y})}}}};function Jv($,I){let U=$.schema[I];return U!==void 0&&!Bv.alwaysValidSchema($,U)}Hv.default=Gg});var zv=Z((Ov)=>{Object.defineProperty(Ov,"__esModule",{value:!0});var Ng=W$(),Jg={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)Ng.checkStrictMode(U,`"${$}" without "if" is ignored`)}};Ov.default=Jg});var Kv=Z((Lv)=>{Object.defineProperty(Lv,"__esModule",{value:!0});var Hg=jQ(),Ag=ZK(),Og=EQ(),zg=xK(),Lg=fK(),Kg=rK(),vg=oK(),Vg=PQ(),qg=eK(),Mg=wv(),Fg=Xv(),jg=Wv(),Eg=Gv(),Sg=Nv(),Pg=Av(),kg=zv();function Rg($=!1){let I=[Fg.default,jg.default,Eg.default,Sg.default,Pg.default,kg.default,vg.default,Vg.default,Kg.default,qg.default,Mg.default];if($)I.push(Ag.default,zg.default);else I.push(Hg.default,Og.default);return I.push(Lg.default),I}Lv.default=Rg});var Vv=Z((vv)=>{Object.defineProperty(vv,"__esModule",{value:!0});var S$=a(),_g={message:({schemaCode:$})=>S$.str`must match format "${$}"`,params:({schemaCode:$})=>S$._`{format: ${$}}`},Zg={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:_g,code($,I){let{gen:U,data:b,$data:w,schema:X,schemaCode:D,it:W}=$,{opts:Q,errSchemaPath:G,schemaEnv:Y,self:J}=W;if(!Q.validateFormats)return;if(w)H();else B();function H(){let A=U.scopeValue("formats",{ref:J.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 h=Y.$async?S$._`(${O}.async ? await ${q}(${b}) : ${q}(${b}))`:S$._`${q}(${b})`,l=S$._`(typeof ${q} == "function" ? ${h} : ${q}.test(${b}))`;return S$._`${q} && ${q} !== true && ${V} === ${I} && !${l}`}}function B(){let A=J.formats[X];if(!A){k();return}if(A===!0)return;let[O,V,q]=P(A);if(O===I)$.pass(h());function k(){if(Q.strictSchema===!1){J.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,N6=U.scopeValue("formats",{key:X,ref:l,code:l$});if(typeof l=="object"&&!(l instanceof RegExp))return[l.type||"string",l.validate,S$._`${N6}.validate`];return["string",l,N6]}function h(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!Y.$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})`}}}};vv.default=Zg});var Mv=Z((qv)=>{Object.defineProperty(qv,"__esModule",{value:!0});var gg=Vv(),xg=[gg.default];qv.default=xg});var Ev=Z((Fv)=>{Object.defineProperty(Fv,"__esModule",{value:!0});Fv.contentVocabulary=Fv.metadataVocabulary=void 0;Fv.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Fv.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kv=Z((Pv)=>{Object.defineProperty(Pv,"__esModule",{value:!0});var yg=aL(),ug=FK(),lg=Kv(),cg=Mv(),Sv=Ev(),mg=[yg.default,ug.default,lg.default(),cg.default,Sv.metadataVocabulary,Sv.contentVocabulary];Pv.default=mg});var Zv=Z((Tv)=>{Object.defineProperty(Tv,"__esModule",{value:!0});Tv.DiscrError=void 0;var Rv;(function($){$.Tag="tag",$.Mapping="mapping"})(Rv||(Tv.DiscrError=Rv={}))});var xv=Z((gv)=>{Object.defineProperty(gv,"__esModule",{value:!0});var x1=a(),RQ=Zv(),Cv=Vb(),ng=vU(),ig=W$(),og={message:({params:{discrError:$,tagName:I}})=>$===RQ.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>x1._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},dg={keyword:"discriminator",type:"object",schemaType:"object",error:og,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",x1._`${U}${x1.getProperty(W)}`);I.if(x1._`typeof ${G} == "string"`,()=>Y(),()=>$.error(!1,{discrError:RQ.DiscrError.Tag,tag:G,tagName:W})),$.ok(Q);function Y(){let B=H();I.if(!1);for(let A in B)I.elseIf(x1._`${G} === ${A}`),I.assign(Q,J(B[A]));I.else(),$.error(!1,{discrError:RQ.DiscrError.Mapping,tag:G,tagName:W}),I.endIf()}function J(B){let A=I.name("valid"),O=$.subschema({keyword:"oneOf",schemaProp:B},A);return $.mergeEvaluated(O,x1.Name),A}function H(){var B;let A={},O=q(w),V=!0;for(let h=0;h<D.length;h++){let l=D[h];if((l===null||l===void 0?void 0:l.$ref)&&!ig.schemaHasRulesButRef(l,X.self.RULES)){let N6=l.$ref;if(l=Cv.resolveRef.call(X.self,X.schemaEnv.root,X.baseId,N6),l instanceof Cv.SchemaEnv)l=l.schema;if(l===void 0)throw new ng.default(X.opts.uriResolver,X.baseId,N6)}let l$=(B=l===null||l===void 0?void 0:l.properties)===null||B===void 0?void 0:B[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$,h)}if(!V)throw new Error(`discriminator: "${W}" must be required`);return A;function q({required:h}){return Array.isArray(h)&&h.includes(W)}function k(h,l){if(h.const)P(h.const,l);else if(h.enum)for(let l$ of h.enum)P(l$,l);else throw new Error(`discriminator: "properties/${W}" must have "const" or "enum"`)}function P(h,l){if(typeof h!="string"||h in A)throw new Error(`discriminator: "${W}" values must be unique strings`);A[h]=l}}}};gv.default=dg});var hv=Z((Xd,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 _Q=Z((I6,TQ)=>{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 ag=lL(),eg=kv(),sg=xv(),fv=hv(),$x=["/properties"],lb="http://json-schema.org/draft-07/schema";class _U extends ag.default{_addVocabularies(){if(super._addVocabularies(),eg.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(sg.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(fv,$x):fv;this.addMetaSchema($,lb,!1),this.refs["http://json-schema.org/schema"]=lb}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(lb)?lb:void 0)}}I6.Ajv=_U;TQ.exports=I6=_U;TQ.exports.Ajv=_U;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=_U;var Ix=KU();Object.defineProperty(I6,"KeywordCxt",{enumerable:!0,get:function(){return Ix.KeywordCxt}});var h1=a();Object.defineProperty(I6,"_",{enumerable:!0,get:function(){return h1._}});Object.defineProperty(I6,"str",{enumerable:!0,get:function(){return h1.str}});Object.defineProperty(I6,"stringify",{enumerable:!0,get:function(){return h1.stringify}});Object.defineProperty(I6,"nil",{enumerable:!0,get:function(){return h1.nil}});Object.defineProperty(I6,"Name",{enumerable:!0,get:function(){return h1.Name}});Object.defineProperty(I6,"CodeGen",{enumerable:!0,get:function(){return h1.CodeGen}});var Ux=Kb();Object.defineProperty(I6,"ValidationError",{enumerable:!0,get:function(){return Ux.default}});var wx=vU();Object.defineProperty(I6,"MissingRefError",{enumerable:!0,get:function(){return wx.default}})});var dv=Z((iv)=>{Object.defineProperty(iv,"__esModule",{value:!0});iv.formatNames=iv.fastFormats=iv.fullFormats=void 0;function y6($,I){return{validate:$,compare:I}}iv.fullFormats={date:y6(cv,xQ),time:y6(CQ(!0),hQ),"date-time":y6(yv(!0),rv),"iso-time":y6(CQ(),mv),"iso-date-time":y6(yv(),nv),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Nx,"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:Lx,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:Jx,int32:{type:"number",validate:Ax},int64:{type:"number",validate:Ox},float:{type:"number",validate:lv},double:{type:"number",validate:lv},password:!0,binary:!0};iv.fastFormats={...iv.fullFormats,date:y6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,xQ),time:y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,hQ),"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,rv),"iso-time":y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,mv),"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,nv),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};iv.formatNames=Object.keys(iv.fullFormats);function Dx($){return $%4===0&&($%100!==0||$%400===0)}var Wx=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Qx=[0,31,28,31,30,31,30,31,31,30,31,30,31];function cv($){let I=Wx.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&&Dx(U)?29:Qx[b])}function xQ($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var ZQ=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function CQ($){return function I(U){let b=ZQ.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),Y=+(b[7]||0);if(G>23||Y>59||$&&!W)return!1;if(w<=23&&X<=59&&D<60)return!0;let J=X-Y*Q,H=w-G*Q-(J<0?1:0);return(H===23||H===-1)&&(J===59||J===-1)&&D<61}}function hQ($,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 mv($,I){if(!($&&I))return;let U=ZQ.exec($),b=ZQ.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 gQ=/t|\s/i;function yv($){let I=CQ($);return function U(b){let w=b.split(gQ);return w.length===2&&cv(w[0])&&I(w[1])}}function rv($,I){if(!($&&I))return;let U=new Date($).valueOf(),b=new Date(I).valueOf();if(!(U&&b))return;return U-b}function nv($,I){if(!($&&I))return;let[U,b]=$.split(gQ),[w,X]=I.split(gQ),D=xQ(U,w);if(D===void 0)return;return D||hQ(b,X)}var Gx=/\/|:/,Yx=/^(?:[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 Nx($){return Gx.test($)&&Yx.test($)}var uv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Jx($){return uv.lastIndex=0,uv.test($)}var Bx=-2147483648,Hx=2147483647;function Ax($){return Number.isInteger($)&&$<=Hx&&$>=Bx}function Ox($){return Number.isInteger($)}function lv(){return!0}var zx=/[^\\]\\Z/;function Lx($){if(zx.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var tv=Z((pv)=>{Object.defineProperty(pv,"__esModule",{value:!0});pv.formatLimitDefinition=void 0;var vx=_Q(),R6=a(),M4=R6.operators,cb={formatMaximum:{okStr:"<=",ok:M4.LTE,fail:M4.GT},formatMinimum:{okStr:">=",ok:M4.GTE,fail:M4.LT},formatExclusiveMaximum:{okStr:"<",ok:M4.LT,fail:M4.GTE},formatExclusiveMinimum:{okStr:">",ok:M4.GT,fail:M4.LTE}},Vx={message:({keyword:$,schemaCode:I})=>R6.str`should be ${cb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>R6._`{comparison: ${cb[$].okStr}, limit: ${I}}`};pv.formatLimitDefinition={keyword:Object.keys(cb),type:"string",schemaType:"string",$data:!0,error:Vx,code($){let{gen:I,data:U,schemaCode:b,keyword:w,it:X}=$,{opts:D,self:W}=X;if(!D.validateFormats)return;let Q=new vx.KeywordCxt(X,W.RULES.all.format.definition,"format");if(Q.$data)G();else Y();function G(){let H=I.scopeValue("formats",{ref:W.formats,code:D.code.formats}),B=I.const("fmt",R6._`${H}[${Q.schemaCode}]`);$.fail$data(R6.or(R6._`typeof ${B} != "object"`,R6._`${B} instanceof RegExp`,R6._`typeof ${B}.compare != "function"`,J(B)))}function Y(){let H=Q.schema,B=W.formats[H];if(!B||B===!0)return;if(typeof B!="object"||B instanceof RegExp||typeof B.compare!="function")throw new Error(`"${w}": format "${H}" does not define "compare" function`);let A=I.scopeValue("formats",{key:H,ref:B,code:D.code.formats?R6._`${D.code.formats}${R6.getProperty(H)}`:void 0});$.fail$data(J(A))}function J(H){return R6._`${H}.compare(${U}, ${b}) ${cb[w].fail} 0`}},dependencies:["format"]};var qx=($)=>{return $.addKeyword(pv.formatLimitDefinition),$};pv.default=qx});var $V=Z((ZU,sv)=>{Object.defineProperty(ZU,"__esModule",{value:!0});var f1=dv(),Fx=tv(),uQ=a(),av=new uQ.Name("fullFormats"),jx=new uQ.Name("fastFormats"),lQ=($,I={keywords:!0})=>{if(Array.isArray(I))return ev($,I,f1.fullFormats,av),$;let[U,b]=I.mode==="fast"?[f1.fastFormats,jx]:[f1.fullFormats,av],w=I.formats||f1.formatNames;if(ev($,w,U,b),I.keywords)Fx.default($);return $};lQ.get=($,I="full")=>{let b=(I==="fast"?f1.fastFormats:f1.fullFormats)[$];if(!b)throw new Error(`Unknown format "${$}"`);return b};function ev($,I,U,b){var w,X;(w=(X=$.opts.code).formats)!==null&&w!==void 0||(X.formats=uQ._`require("ajv-formats/dist/formats").${b}`);for(let D of I)$.addFormat(D,U[D])}sv.exports=ZU=lQ;Object.defineProperty(ZU,"__esModule",{value:!0});ZU.default=lQ});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 gH;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(gH||(gH={}));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 M=$$.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 Xj=($,I)=>{let U;switch($.code){case M.invalid_type:if($.received===R.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case M.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,$$.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:U=`Unrecognized key(s) in object: ${$$.joinValues($.keys,", ")}`;break;case M.invalid_union:U="Invalid input";break;case M.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${$$.joinValues($.options)}`;break;case M.invalid_enum_value:U=`Invalid enum value. Expected ${$$.joinValues($.options)}, received '${$.received}'`;break;case M.invalid_arguments:U="Invalid function arguments";break;case M.invalid_return_type:U="Invalid function return type";break;case M.invalid_date:U="Invalid date";break;case M.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 M.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 M.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 M.custom:U="Invalid input";break;case M.invalid_intersection_types:U="Intersection results could not be merged";break;case M.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case M.not_finite:U="Number must be finite";break;default:U=I.defaultError,$$.assertNever($)}return{message:U}},Q4=Xj;var Dj=Q4;function PI(){return Dj}var Uw=($)=>{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=PI(),b=Uw({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===Q4?void 0:Q4].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"}),H1=($)=>({status:"dirty",value:$}),c$=($)=>({status:"valid",value:$}),sD=($)=>$.status==="aborted",$W=($)=>$.status==="dirty",y4=($)=>$.status==="valid",kI=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var x;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(x||(x={}));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 xH=($,I)=>{if(y4(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(kI(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 xH(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 y4(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)=>y4(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(kI(b)?b:Promise.resolve(b));return xH(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:M.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:F.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 J6.create(this,this._def)}nullable(){return G4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return C6.create(this)}promise(){return K1.create(this,this._def)}or($){return CI.create([this,$],this._def)}and($){return gI.create(this,$,this._def)}transform($){return new g6({...d(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new yI({...d(this._def),innerType:this,defaultValue:I,typeName:F.ZodDefault})}brand(){return new bW({typeName:F.ZodBranded,type:this,...d(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new uI({...d(this._def),innerType:this,catchValue:I,typeName:F.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return Yw.create(this,$)}readonly(){return lI.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Wj=/^c[^\s-]{8,}$/i,Qj=/^[0-9a-z]+$/,Gj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yj=/^[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,Nj=/^[a-z0-9_-]{21}$/i,Jj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Bj=/^[-+]?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)?)??$/,Hj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Aj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",IW,Oj=/^(?:(?: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])$/,zj=/^(?:(?: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])$/,Lj=/^(([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]))$/,Kj=/^(([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])$/,vj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hH="((\\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])))",qj=new RegExp(`^${hH}$`);function fH($){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 Mj($){return new RegExp(`^${fH($)}$`)}function Fj($){let I=`${hH}T${fH($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function jj($,I){if((I==="v4"||!I)&&Oj.test($))return!0;if((I==="v6"||!I)&&Lj.test($))return!0;return!1}function Ej($,I){if(!Jj.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 Sj($,I){if((I==="v4"||!I)&&zj.test($))return!0;if((I==="v6"||!I)&&Kj.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:M.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:M.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:M.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:M.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});else if(D)T(b,{code:M.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});U.dirty()}}else if(w.kind==="email"){if(!Hj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"email",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="emoji"){if(!IW)IW=new RegExp(Aj,"u");if(!IW.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"emoji",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="uuid"){if(!Yj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"uuid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="nanoid"){if(!Nj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"nanoid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid"){if(!Wj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid2"){if(!Qj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid2",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ulid"){if(!Gj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"ulid",code:M.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:M.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:M.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:M.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:M.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:M.invalid_string,validation:{endsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="datetime"){if(!Fj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"datetime",message:w.message}),U.dirty()}else if(w.kind==="date"){if(!qj.test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"date",message:w.message}),U.dirty()}else if(w.kind==="time"){if(!Mj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"time",message:w.message}),U.dirty()}else if(w.kind==="duration"){if(!Bj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"duration",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ip"){if(!jj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"ip",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="jwt"){if(!Ej($.data,w.alg))b=this._getOrReturnCtx($,b),T(b,{validation:"jwt",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cidr"){if(!Sj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"cidr",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64"){if(!vj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64url"){if(!Vj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64url",code:M.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:M.invalid_string,...x.errToObj(U)})}_addCheck($){return new p6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...x.errToObj($)})}url($){return this._addCheck({kind:"url",...x.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...x.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...x.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...x.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...x.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...x.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...x.errToObj($)})}base64($){return this._addCheck({kind:"base64",...x.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...x.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...x.errToObj($)})}ip($){return this._addCheck({kind:"ip",...x.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...x.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,...x.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,...x.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...x.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...x.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...x.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...x.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...x.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...x.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...x.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...x.errToObj(I)})}nonempty($){return this.min(1,x.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:F.ZodString,coerce:$?.coerce??!1,...d($)})};function Pj($,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 O1 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:M.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:M.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:M.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:M.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if(Pj($.data,w.value)!==0)U=this._getOrReturnCtx($,U),T(U,{code:M.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:M.not_finite,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,x.toString(I))}gt($,I){return this.setLimit("min",$,!1,x.toString(I))}lte($,I){return this.setLimit("max",$,!0,x.toString(I))}lt($,I){return this.setLimit("max",$,!1,x.toString(I))}setLimit($,I,U,b){return new O1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(b)}]})}_addCheck($){return new O1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:x.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:x.toString(I)})}finite($){return this._addCheck({kind:"finite",message:x.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.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($)}}O1.create=($)=>{return new O1({checks:[],typeName:F.ZodNumber,coerce:$?.coerce||!1,...d($)})};class z1 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:M.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:M.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:M.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:M.invalid_type,expected:R.bigint,received:I.parsedType}),r}gte($,I){return this.setLimit("min",$,!0,x.toString(I))}gt($,I){return this.setLimit("min",$,!1,x.toString(I))}lte($,I){return this.setLimit("max",$,!0,x.toString(I))}lt($,I){return this.setLimit("max",$,!1,x.toString(I))}setLimit($,I,U,b){return new z1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(b)}]})}_addCheck($){return new z1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:x.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 $}}z1.create=($)=>{return new z1({checks:[],typeName:F.ZodBigInt,coerce:$?.coerce??!1,...d($)})};class ww extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.boolean,received:U.parsedType}),r}return c$($.data)}}ww.create=($)=>{return new ww({typeName:F.ZodBoolean,coerce:$?.coerce||!1,...d($)})};class TI extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let w=this._getOrReturnCtx($);return T(w,{code:M.invalid_type,expected:R.date,received:w.parsedType}),r}if(Number.isNaN($.data.getTime())){let w=this._getOrReturnCtx($);return T(w,{code:M.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:M.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:M.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 TI({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:x.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:x.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}}TI.create=($)=>{return new TI({checks:[],coerce:$?.coerce||!1,typeName:F.ZodDate,...d($)})};class bw extends e{_parse($){if(this._getType($)!==R.symbol){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.symbol,received:U.parsedType}),r}return c$($.data)}}bw.create=($)=>{return new bw({typeName:F.ZodSymbol,...d($)})};class _I extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.undefined,received:U.parsedType}),r}return c$($.data)}}_I.create=($)=>{return new _I({typeName:F.ZodUndefined,...d($)})};class ZI extends e{_parse($){if(this._getType($)!==R.null){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.null,received:U.parsedType}),r}return c$($.data)}}ZI.create=($)=>{return new ZI({typeName:F.ZodNull,...d($)})};class Xw extends e{constructor(){super(...arguments);this._any=!0}_parse($){return c$($.data)}}Xw.create=($)=>{return new Xw({typeName:F.ZodAny,...d($)})};class u4 extends e{constructor(){super(...arguments);this._unknown=!0}_parse($){return c$($.data)}}u4.create=($)=>{return new u4({typeName:F.ZodUnknown,...d($)})};class t6 extends e{_parse($){let I=this._getOrReturnCtx($);return T(I,{code:M.invalid_type,expected:R.never,received:I.parsedType}),r}}t6.create=($)=>{return new t6({typeName:F.ZodNever,...d($)})};class Dw extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.void,received:U.parsedType}),r}return c$($.data)}}Dw.create=($)=>{return new Dw({typeName:F.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:M.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?M.too_big:M.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:M.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:M.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:x.toString(I)}})}max($,I){return new C6({...this._def,maxLength:{value:$,message:x.toString(I)}})}length($,I){return new C6({...this._def,exactLength:{value:$,message:x.toString(I)}})}nonempty($){return this.min(1,$)}}C6.create=($,I)=>{return new C6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...d(I)})};function A1($){if($ instanceof E$){let I={};for(let U in $.shape){let b=$.shape[U];I[U]=J6.create(A1(b))}return new E$({...$._def,shape:()=>I})}else if($ instanceof C6)return new C6({...$._def,type:A1($.element)});else if($ instanceof J6)return J6.create(A1($.unwrap()));else if($ instanceof G4)return G4.create(A1($.unwrap()));else if($ instanceof a6)return a6.create($.items.map((I)=>A1(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:M.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],Y=b.data[Q];W.push({key:{status:"valid",value:Q},value:G._parse(new V6(b,Y,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:M.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 Y=b.data[G];W.push({key:{status:"valid",value:G},value:Q._parse(new V6(b,Y,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 Y=await G.key,J=await G.value;Q.push({key:Y,value:J,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 x.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:x.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:F.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 A1(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 J6)w=w._def.innerType;I[U]=w}return new E$({...this._def,shape:()=>I})}keyof(){return yH($$.objectKeys(this.shape))}}E$.create=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strip",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};E$.strictCreate=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strict",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};E$.lazycreate=($,I)=>{return new E$({shape:$,unknownKeys:"strip",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};class CI 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:M.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:M.invalid_union,unionErrors:D}),r}}get options(){return this._def.options}}CI.create=($,I)=>{return new CI({options:$,typeName:F.ZodUnion,...d(I)})};var d6=($)=>{if($ instanceof xI)return d6($.schema);else if($ instanceof g6)return d6($.innerType());else if($ instanceof hI)return[$.value];else if($ instanceof l4)return $.options;else if($ instanceof fI)return $$.objectValues($.enum);else if($ instanceof yI)return d6($._def.innerType);else if($ instanceof _I)return[void 0];else if($ instanceof ZI)return[null];else if($ instanceof J6)return[void 0,...d6($.unwrap())];else if($ instanceof G4)return[null,...d6($.unwrap())];else if($ instanceof bW)return d6($.unwrap());else if($ instanceof lI)return d6($.unwrap());else if($ instanceof uI)return d6($._def.innerType);else return[]};class wW extends e{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.object)return T(I,{code:M.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:M.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 wW({typeName:F.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:b,...d(U)})}}function UW($,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=UW($[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=UW(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 gI extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($),b=(w,X)=>{if(sD(w)||sD(X))return r;let D=UW(w.value,X.value);if(!D.valid)return T(U,{code:M.invalid_intersection_types}),r;if($W(w)||$W(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}))}}gI.create=($,I,U)=>{return new gI({left:$,right:I,typeName:F.ZodIntersection,...d(U)})};class a6 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.array)return T(U,{code:M.invalid_type,expected:R.array,received:U.parsedType}),r;if(U.data.length<this._def.items.length)return T(U,{code:M.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:M.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:F.ZodTuple,rest:null,...d(I)})};class Ww 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:M.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 Ww({keyType:$,valueType:I,typeName:F.ZodRecord,...d(U)});return new Ww({keyType:p6.create(),valueType:$,typeName:F.ZodRecord,...d(I)})}}class Qw 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:M.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}}}}Qw.create=($,I,U)=>{return new Qw({valueType:I,keyType:$,typeName:F.ZodMap,...d(U)})};class L1 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.set)return T(U,{code:M.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:M.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:M.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 L1({...this._def,minSize:{value:$,message:x.toString(I)}})}max($,I){return new L1({...this._def,maxSize:{value:$,message:x.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}L1.create=($,I)=>{return new L1({valueType:$,minSize:null,maxSize:null,typeName:F.ZodSet,...d(I)})};class RI extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.function)return T(I,{code:M.invalid_type,expected:R.function,received:I.parsedType}),r;function U(D,W){return Uw({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,PI(),Q4].filter((Q)=>!!Q),issueData:{code:M.invalid_arguments,argumentsError:W}})}function b(D,W){return Uw({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,PI(),Q4].filter((Q)=>!!Q),issueData:{code:M.invalid_return_type,returnTypeError:W}})}let w={errorMap:I.common.contextualErrorMap},X=I.data;if(this._def.returns instanceof K1){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}),Y=await Reflect.apply(X,this,G);return await D._def.returns._def.type.parseAsync(Y,w).catch((H)=>{throw Q.addIssue(b(Y,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),Y=D._def.returns.safeParse(G,w);if(!Y.success)throw new X6([b(G,Y.error)]);return Y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new RI({...this._def,args:a6.create($).rest(u4.create())})}returns($){return new RI({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new RI({args:$?$:a6.create([]).rest(u4.create()),returns:I||u4.create(),typeName:F.ZodFunction,...d(U)})}}class xI 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})}}xI.create=($,I)=>{return new xI({getter:$,typeName:F.ZodLazy,...d(I)})};class hI extends e{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return T(I,{received:I.data,code:M.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}hI.create=($,I)=>{return new hI({value:$,typeName:F.ZodLiteral,...d(I)})};function yH($,I){return new l4({values:$,typeName:F.ZodEnum,...d(I)})}class l4 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:M.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:M.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 l4.create($,{...this._def,...I})}exclude($,I=this._def){return l4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}l4.create=yH;class fI 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:M.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:M.invalid_enum_value,options:b}),r}return c$($.data)}get enum(){return this._def.values}}fI.create=($,I)=>{return new fI({values:$,typeName:F.ZodNativeEnum,...d(I)})};class K1 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:M.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})}))}}K1.create=($,I)=>{return new K1({type:$,typeName:F.ZodPromise,...d(I)})};class g6 extends e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.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 H1(W.value);if(I.value==="dirty")return H1(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 H1(D.value);if(I.value==="dirty")return H1(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(!y4(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(!y4(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:F.ZodEffects,effect:I,...d(U)})};g6.createWithPreprocess=($,I,U)=>{return new g6({schema:I,effect:{type:"preprocess",transform:$},typeName:F.ZodEffects,...d(U)})};class J6 extends e{_parse($){if(this._getType($)===R.undefined)return c$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}J6.create=($,I)=>{return new J6({innerType:$,typeName:F.ZodOptional,...d(I)})};class G4 extends e{_parse($){if(this._getType($)===R.null)return c$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}G4.create=($,I)=>{return new G4({innerType:$,typeName:F.ZodNullable,...d(I)})};class yI 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}}yI.create=($,I)=>{return new yI({innerType:$,typeName:F.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...d(I)})};class uI 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(kI(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}}uI.create=($,I)=>{return new uI({innerType:$,typeName:F.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...d(I)})};class Gw extends e{_parse($){if(this._getType($)!==R.nan){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.nan,received:U.parsedType}),r}return{status:"valid",value:$.data}}}Gw.create=($)=>{return new Gw({typeName:F.ZodNaN,...d($)})};var Al=Symbol("zod_brand");class bW 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 Yw 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(),H1(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 Yw({in:$,out:I,typeName:F.ZodPipeline})}}class lI extends e{_parse($){let I=this._def.innerType._parse($),U=(b)=>{if(y4(b))b.value=Object.freeze(b.value);return b};return kI(I)?I.then((b)=>U(b)):U(I)}unwrap(){return this._def.innerType}}lI.create=($,I)=>{return new lI({innerType:$,typeName:F.ZodReadonly,...d(I)})};var Ol={object:E$.lazycreate},F;(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"})(F||(F={}));var zl=p6.create,Ll=O1.create,Kl=Gw.create,vl=z1.create,Vl=ww.create,ql=TI.create,Ml=bw.create,Fl=_I.create,jl=ZI.create,El=Xw.create,Sl=u4.create,Pl=t6.create,kl=Dw.create,Rl=C6.create,uH=E$.create,Tl=E$.strictCreate,_l=CI.create,Zl=wW.create,Cl=gI.create,gl=a6.create,xl=Ww.create,hl=Qw.create,fl=L1.create,yl=RI.create,ul=xI.create,ll=hI.create,cl=l4.create,ml=fI.create,rl=K1.create,nl=g6.create,il=J6.create,ol=G4.create,dl=g6.createWithPreprocess,pl=Yw.create;var kj=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 Y in D.prototype)if(!(Y in W))Object.defineProperty(W,Y,{value:D.prototype[Y].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 Y of G._zod.deferred)Y();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 Rj=Symbol("zod_brand");class Y4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Nw={};function D6($){if($)Object.assign(Nw,$);return Nw}var I$={};v6(I$,{unwrapMessage:()=>cI,stringifyPrimitive:()=>Hw,required:()=>oj,randomString:()=>fj,propertyKeyTypes:()=>YW,promiseAllObject:()=>hj,primitiveTypes:()=>lH,prefixIssues:()=>x6,pick:()=>cj,partial:()=>ij,optionalKeys:()=>NW,omit:()=>mj,numKeys:()=>yj,nullish:()=>nI,normalizeParams:()=>m,merge:()=>nj,jsonStringifyReplacer:()=>DW,joinValues:()=>Jw,issue:()=>BW,isPlainObject:()=>V1,isObject:()=>v1,getSizableOrigin:()=>mH,getParsedType:()=>uj,getLengthableOrigin:()=>oI,getEnumValues:()=>mI,getElementAtPath:()=>xj,floatSafeRemainder:()=>WW,finalizeIssue:()=>q6,extend:()=>rj,escapeRegex:()=>N4,esc:()=>c4,defineLazy:()=>O$,createTransparentProxy:()=>lj,clone:()=>W6,cleanRegex:()=>iI,cleanEnum:()=>dj,captureStackTrace:()=>Bw,cached:()=>rI,assignProp:()=>QW,assertNotEqual:()=>_j,assertNever:()=>Cj,assertIs:()=>Zj,assertEqual:()=>Tj,assert:()=>gj,allowsEval:()=>GW,aborted:()=>m4,NUMBER_FORMAT_RANGES:()=>JW,Class:()=>rH,BIGINT_FORMAT_RANGES:()=>cH});function Tj($){return $}function _j($){return $}function Zj($){}function Cj($){throw new Error}function gj($){}function mI($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function Jw($,I="|"){return $.map((U)=>Hw(U)).join(I)}function DW($,I){if(typeof I==="bigint")return I.toString();return I}function rI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function nI($){return $===null||$===void 0}function iI($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function WW($,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 QW($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function xj($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function hj($){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 fj($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function c4($){return JSON.stringify($)}var Bw=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};function v1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var GW=rI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function V1($){if(v1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;let U=I.prototype;if(v1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function yj($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var uj=($)=>{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}`)}},YW=new Set(["string","number","symbol"]),lH=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 lj($){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 Hw($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function NW($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var JW={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]},cH={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function cj($,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 rj($,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 QW(this,"shape",b),b},checks:[]};return W6($,U)}function nj($,I){return W6($,{...$._zod.def,get shape(){let U={...$._zod.def.shape,...I._zod.def.shape};return QW(this,"shape",U),U},catchall:I._zod.def.catchall,checks:[]})}function ij($,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 oj($,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 m4($,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 cI($){return typeof $==="string"?$:$?.message}function q6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=cI($.inst?._zod.def?.error?.($))??cI(I?.error?.($))??cI(U.customError?.($))??cI(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function mH($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function oI($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function BW(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function dj($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}class rH{constructor(...$){}}var nH=($,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,DW,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Aw=v("$ZodError",nH),dI=v("$ZodError",nH,{Parent:Error});function HW($,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 AW($,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 OW=($)=>(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 Y4;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Bw(W,w?.callee),W}return D.value},zW=OW(dI),LW=($)=>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 Bw(W,w?.callee),W}return D.value},KW=LW(dI),vW=($)=>(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 Y4;return X.issues.length?{success:!1,error:new($??Aw)(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},r4=vW(dI),VW=($)=>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}},n4=VW(dI);var iH=/^[cC][^\s-]{8,}$/,oH=/^[0-9a-z]+$/,dH=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pH=/^[0-9a-vA-V]{20}$/,tH=/^[A-Za-z0-9]{27}$/,aH=/^[a-zA-Z0-9_-]{21}$/,eH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var sH=/^([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})$/,qW=($)=>{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 $A=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function IA(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var UA=/^(?:(?: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])$/,wA=/^(([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})$/,bA=/^((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])$/,XA=/^(([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])$/,DA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,MW=/^[A-Za-z0-9_-]*$/,WA=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var QA=/^\+(?:[0-9]){6,14}[0-9]$/,GA="(?:(?:\\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])))",YA=new RegExp(`^${GA}$`);function NA($){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 JA($){return new RegExp(`^${NA($)}$`)}function BA($){let I=NA({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-]\\d{2}:\\d{2})");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${GA}T(?:${b})$`)}var HA=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)};var AA=/^\d+$/,OA=/^-?\d+(?:\.\d+)?/i,zA=/true|false/i,LA=/null/i;var KA=/^[^A-Z]*$/,vA=/^[^a-z]*$/;var Z$=v("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),VA={number:"number",bigint:"bigint",object:"date"},FW=v("$ZodCheckLessThan",($,I)=>{Z$.init($,I);let U=VA[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})}}),jW=v("$ZodCheckGreaterThan",($,I)=>{Z$.init($,I);let U=VA[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})}}),qA=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):WW(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})}}),MA=v("$ZodCheckNumberFormat",($,I)=>{Z$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=JW[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=AA}),$._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 FA=v("$ZodCheckMaxLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(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=oI(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),jA=v("$ZodCheckMinLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(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=oI(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),EA=v("$ZodCheckLengthEquals",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(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=oI(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})}}),pI=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=()=>{})}),SA=v("$ZodCheckRegex",($,I)=>{pI.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})}}),PA=v("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=KA),pI.init($,I)}),kA=v("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=vA),pI.init($,I)}),RA=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})}}),TA=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})}}),_A=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 EW{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 TC={keyword:"dependencies",type:"object",schemaType:"object",error:uK.error,code($){let[I,U]=_C($);fK($,I),yK($,U)}};function _C({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=TU.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)TU.checkReportMissingProp($,G)});else U.if(SQ._`${Q} && (${TU.checkMissingProp($,W,X)})`),TU.reportMissingProp($,X),U.else()}}uK.validatePropertyDeps=fK;function yK($,I=$.schema){let{gen:U,data:b,keyword:w,it:X}=$,D=U.name("valid");for(let W in I){if(RC.alwaysValidSchema(X,I[W]))continue;U.if(TU.propertyInData(U,b,W,X.opts.ownProperties),()=>{let Q=$.subschema({keyword:w,schemaProp:W},D);$.mergeValidEvaluated(Q,D)},()=>U.var(D,!0)),$.ok(D)}}uK.validateSchemaDeps=yK;uK.default=TC});var iK=Z((nK)=>{Object.defineProperty(nK,"__esModule",{value:!0});var rK=a(),gC=W$(),xC={message:"property name must be valid",params:({params:$})=>rK._`{propertyName: ${$.propertyName}}`},hC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:xC,code($){let{gen:I,schema:U,data:b,it:w}=$;if(gC.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(rK.not(X),()=>{if($.error(!0),!w.allErrors)I.break()})}),$.ok(X)}};nK.default=hC});var PQ=Z((oK)=>{Object.defineProperty(oK,"__esModule",{value:!0});var xb=O6(),k6=a(),yC=s6(),hb=W$(),uC={message:"must NOT have additional properties",params:({params:$})=>k6._`{additionalProperty: ${$.additionalProperty}}`},lC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:uC,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"&&hb.alwaysValidSchema(D,U))return;let G=xb.allSchemaProperties(b.properties),Y=xb.allSchemaProperties(b.patternProperties);J(),$.ok(k6._`${X} === ${yC.default.errors}`);function J(){I.forIn("key",w,(V)=>{if(!G.length&&!Y.length)A(V);else I.if(H(V),()=>A(V))})}function H(V){let q;if(G.length>8){let k=hb.schemaRefOrVal(D,b.properties,"properties");q=xb.isOwnProperty(I,k,V)}else if(G.length)q=k6.or(...G.map((k)=>k6._`${V} === ${k}`));else q=k6.nil;if(Y.length)q=k6.or(q,...Y.map((k)=>k6._`${xb.usePattern($,k)}.test(${V})`));return k6.not(q)}function B(V){I.code(k6._`delete ${w}[${V}]`)}function A(V){if(Q.removeAdditional==="all"||Q.removeAdditional&&U===!1){B(V);return}if(U===!1){if($.setParams({additionalProperty:V}),$.error(),!W)I.break();return}if(typeof U=="object"&&!hb.alwaysValidSchema(D,U)){let q=I.name("valid");if(Q.removeAdditional==="failing")O(V,q,!1),I.if(k6.not(q),()=>{$.reset(),B(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:hb.Type.Str};if(k===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,q)}}};oK.default=lC});var aK=Z((tK)=>{Object.defineProperty(tK,"__esModule",{value:!0});var mC=KU(),dK=O6(),kQ=W$(),pK=PQ(),rC={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)pK.default.code(new mC.KeywordCxt(X,pK.default,"additionalProperties"));let D=dK.allSchemaProperties(U);for(let J of D)X.definedProperties.add(J);if(X.opts.unevaluated&&D.length&&X.props!==!0)X.props=kQ.mergeEvaluated.props(I,kQ.toHash(D),X.props);let W=D.filter((J)=>!kQ.alwaysValidSchema(X,U[J]));if(W.length===0)return;let Q=I.name("valid");for(let J of W){if(G(J))Y(J);else{if(I.if(dK.propertyInData(I,w,J,X.opts.ownProperties)),Y(J),!X.allErrors)I.else().var(Q,!0);I.endIf()}$.it.definedProperties.add(J),$.ok(Q)}function G(J){return X.opts.useDefaults&&!X.compositeRule&&U[J].default!==void 0}function Y(J){$.subschema({keyword:"properties",schemaProp:J,dataProp:J},Q)}}};tK.default=rC});var Uv=Z((Iv)=>{Object.defineProperty(Iv,"__esModule",{value:!0});var eK=O6(),fb=a(),sK=W$(),$v=W$(),iC={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:b,parentSchema:w,it:X}=$,{opts:D}=X,W=eK.allSchemaProperties(U),Q=W.filter((O)=>sK.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,Y=I.name("valid");if(X.props!==!0&&!(X.props instanceof fb.Name))X.props=$v.evaluatedPropsToName(I,X.props);let{props:J}=X;H();function H(){for(let O of W){if(G)B(O);if(X.allErrors)A(O);else I.var(Y,!0),A(O),I.if(Y)}}function B(O){for(let V in G)if(new RegExp(O).test(V))sK.checkStrictMode(X,`property ${V} matches pattern ${O} (use allowMatchingProperties)`)}function A(O){I.forIn("key",b,(V)=>{I.if(fb._`${eK.usePattern($,O)}.test(${V})`,()=>{let q=Q.includes(O);if(!q)$.subschema({keyword:"patternProperties",schemaProp:O,dataProp:V,dataPropType:$v.Type.Str},Y);if(X.opts.unevaluated&&J!==!0)I.assign(fb._`${J}[${V}]`,!0);else if(!q&&!X.allErrors)I.if(fb.not(Y),()=>I.break())})})}}};Iv.default=iC});var bv=Z((wv)=>{Object.defineProperty(wv,"__esModule",{value:!0});var dC=W$(),pC={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:b}=$;if(dC.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"}};wv.default=pC});var Dv=Z((Xv)=>{Object.defineProperty(Xv,"__esModule",{value:!0});var aC=O6(),eC={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:aC.validateUnion,error:{message:"must match a schema in anyOf"}};Xv.default=eC});var Qv=Z((Wv)=>{Object.defineProperty(Wv,"__esModule",{value:!0});var yb=a(),$g=W$(),Ig={message:"must match exactly one schema in oneOf",params:({params:$})=>yb._`{passingSchemas: ${$.passing}}`},Ug={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ig,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((Y,J)=>{let H;if($g.alwaysValidSchema(w,Y))I.var(Q,!0);else H=$.subschema({keyword:"oneOf",schemaProp:J,compositeRule:!0},Q);if(J>0)I.if(yb._`${Q} && ${D}`).assign(D,!1).assign(W,yb._`[${W}, ${J}]`).else();I.if(Q,()=>{if(I.assign(D,!0),I.assign(W,J),H)$.mergeEvaluated(H,yb.Name)})})}}};Wv.default=Ug});var Yv=Z((Gv)=>{Object.defineProperty(Gv,"__esModule",{value:!0});var bg=W$(),Xg={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(bg.alwaysValidSchema(b,X))return;let W=$.subschema({keyword:"allOf",schemaProp:D},w);$.ok(w),$.mergeEvaluated(W)})}};Gv.default=Xg});var Hv=Z((Bv)=>{Object.defineProperty(Bv,"__esModule",{value:!0});var ub=a(),Jv=W$(),Wg={message:({params:$})=>ub.str`must match "${$.ifClause}" schema`,params:({params:$})=>ub._`{failingKeyword: ${$.ifClause}}`},Qg={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Wg,code($){let{gen:I,parentSchema:U,it:b}=$;if(U.then===void 0&&U.else===void 0)Jv.checkStrictMode(b,'"if" without "then" and "else" is ignored');let w=Nv(b,"then"),X=Nv(b,"else");if(!w&&!X)return;let D=I.let("valid",!0),W=I.name("_valid");if(Q(),$.reset(),w&&X){let Y=I.let("ifClause");$.setParams({ifClause:Y}),I.if(W,G("then",Y),G("else",Y))}else if(w)I.if(W,G("then"));else I.if(ub.not(W),G("else"));$.pass(D,()=>$.error(!0));function Q(){let Y=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},W);$.mergeEvaluated(Y)}function G(Y,J){return()=>{let H=$.subschema({keyword:Y},W);if(I.assign(D,W),$.mergeValidEvaluated(H,D),J)I.assign(J,ub._`${Y}`);else $.setParams({ifClause:Y})}}}};function Nv($,I){let U=$.schema[I];return U!==void 0&&!Jv.alwaysValidSchema($,U)}Bv.default=Qg});var Ov=Z((Av)=>{Object.defineProperty(Av,"__esModule",{value:!0});var Yg=W$(),Ng={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)Yg.checkStrictMode(U,`"${$}" without "if" is ignored`)}};Av.default=Ng});var Lv=Z((zv)=>{Object.defineProperty(zv,"__esModule",{value:!0});var Bg=jQ(),Hg=_K(),Ag=EQ(),Og=gK(),zg=hK(),Lg=mK(),Kg=iK(),vg=PQ(),Vg=aK(),qg=Uv(),Mg=bv(),Fg=Dv(),jg=Qv(),Eg=Yv(),Sg=Hv(),Pg=Ov();function kg($=!1){let I=[Mg.default,Fg.default,jg.default,Eg.default,Sg.default,Pg.default,Kg.default,vg.default,Lg.default,Vg.default,qg.default];if($)I.push(Hg.default,Og.default);else I.push(Bg.default,Ag.default);return I.push(zg.default),I}zv.default=kg});var vv=Z((Kv)=>{Object.defineProperty(Kv,"__esModule",{value:!0});var S$=a(),Tg={message:({schemaCode:$})=>S$.str`must match format "${$}"`,params:({schemaCode:$})=>S$._`{format: ${$}}`},_g={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Tg,code($,I){let{gen:U,data:b,$data:w,schema:X,schemaCode:D,it:W}=$,{opts:Q,errSchemaPath:G,schemaEnv:Y,self:J}=W;if(!Q.validateFormats)return;if(w)H();else B();function H(){let A=U.scopeValue("formats",{ref:J.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 h=Y.$async?S$._`(${O}.async ? await ${q}(${b}) : ${q}(${b}))`:S$._`${q}(${b})`,l=S$._`(typeof ${q} == "function" ? ${h} : ${q}.test(${b}))`;return S$._`${q} && ${q} !== true && ${V} === ${I} && !${l}`}}function B(){let A=J.formats[X];if(!A){k();return}if(A===!0)return;let[O,V,q]=P(A);if(O===I)$.pass(h());function k(){if(Q.strictSchema===!1){J.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,N6=U.scopeValue("formats",{key:X,ref:l,code:l$});if(typeof l=="object"&&!(l instanceof RegExp))return[l.type||"string",l.validate,S$._`${N6}.validate`];return["string",l,N6]}function h(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!Y.$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})`}}}};Kv.default=_g});var qv=Z((Vv)=>{Object.defineProperty(Vv,"__esModule",{value:!0});var Cg=vv(),gg=[Cg.default];Vv.default=gg});var jv=Z((Mv)=>{Object.defineProperty(Mv,"__esModule",{value:!0});Mv.contentVocabulary=Mv.metadataVocabulary=void 0;Mv.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mv.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Pv=Z((Sv)=>{Object.defineProperty(Sv,"__esModule",{value:!0});var fg=tL(),yg=MK(),ug=Lv(),lg=qv(),Ev=jv(),cg=[fg.default,yg.default,ug.default(),lg.default,Ev.metadataVocabulary,Ev.contentVocabulary];Sv.default=cg});var _v=Z((Rv)=>{Object.defineProperty(Rv,"__esModule",{value:!0});Rv.DiscrError=void 0;var kv;(function($){$.Tag="tag",$.Mapping="mapping"})(kv||(Rv.DiscrError=kv={}))});var gv=Z((Cv)=>{Object.defineProperty(Cv,"__esModule",{value:!0});var x1=a(),RQ=_v(),Zv=Vb(),rg=vU(),ng=W$(),ig={message:({params:{discrError:$,tagName:I}})=>$===RQ.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>x1._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},og={keyword:"discriminator",type:"object",schemaType:"object",error:ig,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",x1._`${U}${x1.getProperty(W)}`);I.if(x1._`typeof ${G} == "string"`,()=>Y(),()=>$.error(!1,{discrError:RQ.DiscrError.Tag,tag:G,tagName:W})),$.ok(Q);function Y(){let B=H();I.if(!1);for(let A in B)I.elseIf(x1._`${G} === ${A}`),I.assign(Q,J(B[A]));I.else(),$.error(!1,{discrError:RQ.DiscrError.Mapping,tag:G,tagName:W}),I.endIf()}function J(B){let A=I.name("valid"),O=$.subschema({keyword:"oneOf",schemaProp:B},A);return $.mergeEvaluated(O,x1.Name),A}function H(){var B;let A={},O=q(w),V=!0;for(let h=0;h<D.length;h++){let l=D[h];if((l===null||l===void 0?void 0:l.$ref)&&!ng.schemaHasRulesButRef(l,X.self.RULES)){let N6=l.$ref;if(l=Zv.resolveRef.call(X.self,X.schemaEnv.root,X.baseId,N6),l instanceof Zv.SchemaEnv)l=l.schema;if(l===void 0)throw new rg.default(X.opts.uriResolver,X.baseId,N6)}let l$=(B=l===null||l===void 0?void 0:l.properties)===null||B===void 0?void 0:B[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$,h)}if(!V)throw new Error(`discriminator: "${W}" must be required`);return A;function q({required:h}){return Array.isArray(h)&&h.includes(W)}function k(h,l){if(h.const)P(h.const,l);else if(h.enum)for(let l$ of h.enum)P(l$,l);else throw new Error(`discriminator: "properties/${W}" must have "const" or "enum"`)}function P(h,l){if(typeof h!="string"||h in A)throw new Error(`discriminator: "${W}" values must be unique strings`);A[h]=l}}}};Cv.default=og});var xv=Z((Xd,pg)=>{pg.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 _Q=Z((I6,TQ)=>{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 tg=uL(),ag=Pv(),eg=gv(),hv=xv(),sg=["/properties"],lb="http://json-schema.org/draft-07/schema";class _U extends tg.default{_addVocabularies(){if(super._addVocabularies(),ag.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(eg.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(hv,sg):hv;this.addMetaSchema($,lb,!1),this.refs["http://json-schema.org/schema"]=lb}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(lb)?lb:void 0)}}I6.Ajv=_U;TQ.exports=I6=_U;TQ.exports.Ajv=_U;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=_U;var $x=KU();Object.defineProperty(I6,"KeywordCxt",{enumerable:!0,get:function(){return $x.KeywordCxt}});var h1=a();Object.defineProperty(I6,"_",{enumerable:!0,get:function(){return h1._}});Object.defineProperty(I6,"str",{enumerable:!0,get:function(){return h1.str}});Object.defineProperty(I6,"stringify",{enumerable:!0,get:function(){return h1.stringify}});Object.defineProperty(I6,"nil",{enumerable:!0,get:function(){return h1.nil}});Object.defineProperty(I6,"Name",{enumerable:!0,get:function(){return h1.Name}});Object.defineProperty(I6,"CodeGen",{enumerable:!0,get:function(){return h1.CodeGen}});var Ix=Kb();Object.defineProperty(I6,"ValidationError",{enumerable:!0,get:function(){return Ix.default}});var Ux=vU();Object.defineProperty(I6,"MissingRefError",{enumerable:!0,get:function(){return Ux.default}})});var ov=Z((nv)=>{Object.defineProperty(nv,"__esModule",{value:!0});nv.formatNames=nv.fastFormats=nv.fullFormats=void 0;function y6($,I){return{validate:$,compare:I}}nv.fullFormats={date:y6(lv,xQ),time:y6(CQ(!0),hQ),"date-time":y6(fv(!0),mv),"iso-time":y6(CQ(),cv),"iso-date-time":y6(fv(),rv),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Yx,"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:zx,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:Nx,int32:{type:"number",validate:Hx},int64:{type:"number",validate:Ax},float:{type:"number",validate:uv},double:{type:"number",validate:uv},password:!0,binary:!0};nv.fastFormats={...nv.fullFormats,date:y6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,xQ),time:y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,hQ),"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,mv),"iso-time":y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,cv),"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,rv),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};nv.formatNames=Object.keys(nv.fullFormats);function Xx($){return $%4===0&&($%100!==0||$%400===0)}var Dx=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Wx=[0,31,28,31,30,31,30,31,31,30,31,30,31];function lv($){let I=Dx.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&&Xx(U)?29:Wx[b])}function xQ($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var ZQ=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function CQ($){return function I(U){let b=ZQ.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),Y=+(b[7]||0);if(G>23||Y>59||$&&!W)return!1;if(w<=23&&X<=59&&D<60)return!0;let J=X-Y*Q,H=w-G*Q-(J<0?1:0);return(H===23||H===-1)&&(J===59||J===-1)&&D<61}}function hQ($,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 cv($,I){if(!($&&I))return;let U=ZQ.exec($),b=ZQ.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 gQ=/t|\s/i;function fv($){let I=CQ($);return function U(b){let w=b.split(gQ);return w.length===2&&lv(w[0])&&I(w[1])}}function mv($,I){if(!($&&I))return;let U=new Date($).valueOf(),b=new Date(I).valueOf();if(!(U&&b))return;return U-b}function rv($,I){if(!($&&I))return;let[U,b]=$.split(gQ),[w,X]=I.split(gQ),D=xQ(U,w);if(D===void 0)return;return D||hQ(b,X)}var Qx=/\/|:/,Gx=/^(?:[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 Yx($){return Qx.test($)&&Gx.test($)}var yv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Nx($){return yv.lastIndex=0,yv.test($)}var Jx=-2147483648,Bx=2147483647;function Hx($){return Number.isInteger($)&&$<=Bx&&$>=Jx}function Ax($){return Number.isInteger($)}function uv(){return!0}var Ox=/[^\\]\\Z/;function zx($){if(Ox.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var pv=Z((dv)=>{Object.defineProperty(dv,"__esModule",{value:!0});dv.formatLimitDefinition=void 0;var Kx=_Q(),R6=a(),M4=R6.operators,cb={formatMaximum:{okStr:"<=",ok:M4.LTE,fail:M4.GT},formatMinimum:{okStr:">=",ok:M4.GTE,fail:M4.LT},formatExclusiveMaximum:{okStr:"<",ok:M4.LT,fail:M4.GTE},formatExclusiveMinimum:{okStr:">",ok:M4.GT,fail:M4.LTE}},vx={message:({keyword:$,schemaCode:I})=>R6.str`should be ${cb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>R6._`{comparison: ${cb[$].okStr}, limit: ${I}}`};dv.formatLimitDefinition={keyword:Object.keys(cb),type:"string",schemaType:"string",$data:!0,error:vx,code($){let{gen:I,data:U,schemaCode:b,keyword:w,it:X}=$,{opts:D,self:W}=X;if(!D.validateFormats)return;let Q=new Kx.KeywordCxt(X,W.RULES.all.format.definition,"format");if(Q.$data)G();else Y();function G(){let H=I.scopeValue("formats",{ref:W.formats,code:D.code.formats}),B=I.const("fmt",R6._`${H}[${Q.schemaCode}]`);$.fail$data(R6.or(R6._`typeof ${B} != "object"`,R6._`${B} instanceof RegExp`,R6._`typeof ${B}.compare != "function"`,J(B)))}function Y(){let H=Q.schema,B=W.formats[H];if(!B||B===!0)return;if(typeof B!="object"||B instanceof RegExp||typeof B.compare!="function")throw new Error(`"${w}": format "${H}" does not define "compare" function`);let A=I.scopeValue("formats",{key:H,ref:B,code:D.code.formats?R6._`${D.code.formats}${R6.getProperty(H)}`:void 0});$.fail$data(J(A))}function J(H){return R6._`${H}.compare(${U}, ${b}) ${cb[w].fail} 0`}},dependencies:["format"]};var Vx=($)=>{return $.addKeyword(dv.formatLimitDefinition),$};dv.default=Vx});var sv=Z((ZU,ev)=>{Object.defineProperty(ZU,"__esModule",{value:!0});var f1=ov(),Mx=pv(),uQ=a(),tv=new uQ.Name("fullFormats"),Fx=new uQ.Name("fastFormats"),lQ=($,I={keywords:!0})=>{if(Array.isArray(I))return av($,I,f1.fullFormats,tv),$;let[U,b]=I.mode==="fast"?[f1.fastFormats,Fx]:[f1.fullFormats,tv],w=I.formats||f1.formatNames;if(av($,w,U,b),I.keywords)Mx.default($);return $};lQ.get=($,I="full")=>{let b=(I==="fast"?f1.fastFormats:f1.fullFormats)[$];if(!b)throw new Error(`Unknown format "${$}"`);return b};function av($,I,U,b){var w,X;(w=(X=$.opts.code).formats)!==null&&w!==void 0||(X.formats=uQ._`require("ajv-formats/dist/formats").${b}`);for(let D of I)$.addFormat(D,U[D])}ev.exports=ZU=lQ;Object.defineProperty(ZU,"__esModule",{value:!0});ZU.default=lQ});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 CH;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(CH||(CH={}));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 M=$$.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 bj=($,I)=>{let U;switch($.code){case M.invalid_type:if($.received===R.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case M.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,$$.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:U=`Unrecognized key(s) in object: ${$$.joinValues($.keys,", ")}`;break;case M.invalid_union:U="Invalid input";break;case M.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${$$.joinValues($.options)}`;break;case M.invalid_enum_value:U=`Invalid enum value. Expected ${$$.joinValues($.options)}, received '${$.received}'`;break;case M.invalid_arguments:U="Invalid function arguments";break;case M.invalid_return_type:U="Invalid function return type";break;case M.invalid_date:U="Invalid date";break;case M.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 M.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 M.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 M.custom:U="Invalid input";break;case M.invalid_intersection_types:U="Intersection results could not be merged";break;case M.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case M.not_finite:U="Number must be finite";break;default:U=I.defaultError,$$.assertNever($)}return{message:U}},Q4=bj;var Xj=Q4;function PI(){return Xj}var Uw=($)=>{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=PI(),b=Uw({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===Q4?void 0:Q4].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"}),H1=($)=>({status:"dirty",value:$}),c$=($)=>({status:"valid",value:$}),sD=($)=>$.status==="aborted",$W=($)=>$.status==="dirty",y4=($)=>$.status==="valid",kI=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var x;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(x||(x={}));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 gH=($,I)=>{if(y4(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(kI(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 gH(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 y4(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)=>y4(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(kI(b)?b:Promise.resolve(b));return gH(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:M.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:F.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 J6.create(this,this._def)}nullable(){return G4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return C6.create(this)}promise(){return K1.create(this,this._def)}or($){return CI.create([this,$],this._def)}and($){return gI.create(this,$,this._def)}transform($){return new g6({...d(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new yI({...d(this._def),innerType:this,defaultValue:I,typeName:F.ZodDefault})}brand(){return new bW({typeName:F.ZodBranded,type:this,...d(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new uI({...d(this._def),innerType:this,catchValue:I,typeName:F.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return Yw.create(this,$)}readonly(){return lI.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Dj=/^c[^\s-]{8,}$/i,Wj=/^[0-9a-z]+$/,Qj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Gj=/^[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,Yj=/^[a-z0-9_-]{21}$/i,Nj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jj=/^[-+]?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)?)??$/,Bj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",IW,Aj=/^(?:(?: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])$/,Oj=/^(?:(?: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])$/,zj=/^(([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]))$/,Lj=/^(([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])$/,Kj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xH="((\\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])))",Vj=new RegExp(`^${xH}$`);function hH($){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 qj($){return new RegExp(`^${hH($)}$`)}function Mj($){let I=`${xH}T${hH($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function Fj($,I){if((I==="v4"||!I)&&Aj.test($))return!0;if((I==="v6"||!I)&&zj.test($))return!0;return!1}function jj($,I){if(!Nj.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 Ej($,I){if((I==="v4"||!I)&&Oj.test($))return!0;if((I==="v6"||!I)&&Lj.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:M.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:M.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:M.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:M.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});else if(D)T(b,{code:M.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});U.dirty()}}else if(w.kind==="email"){if(!Bj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"email",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="emoji"){if(!IW)IW=new RegExp(Hj,"u");if(!IW.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"emoji",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="uuid"){if(!Gj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"uuid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="nanoid"){if(!Yj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"nanoid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid"){if(!Dj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid2"){if(!Wj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid2",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ulid"){if(!Qj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"ulid",code:M.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:M.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:M.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:M.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:M.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:M.invalid_string,validation:{endsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="datetime"){if(!Mj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"datetime",message:w.message}),U.dirty()}else if(w.kind==="date"){if(!Vj.test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"date",message:w.message}),U.dirty()}else if(w.kind==="time"){if(!qj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"time",message:w.message}),U.dirty()}else if(w.kind==="duration"){if(!Jj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"duration",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ip"){if(!Fj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"ip",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="jwt"){if(!jj($.data,w.alg))b=this._getOrReturnCtx($,b),T(b,{validation:"jwt",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cidr"){if(!Ej($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"cidr",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64"){if(!Kj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64url"){if(!vj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64url",code:M.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:M.invalid_string,...x.errToObj(U)})}_addCheck($){return new p6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...x.errToObj($)})}url($){return this._addCheck({kind:"url",...x.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...x.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...x.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...x.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...x.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...x.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...x.errToObj($)})}base64($){return this._addCheck({kind:"base64",...x.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...x.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...x.errToObj($)})}ip($){return this._addCheck({kind:"ip",...x.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...x.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,...x.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,...x.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...x.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...x.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...x.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...x.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...x.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...x.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...x.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...x.errToObj(I)})}nonempty($){return this.min(1,x.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:F.ZodString,coerce:$?.coerce??!1,...d($)})};function Sj($,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 O1 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:M.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:M.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:M.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:M.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if(Sj($.data,w.value)!==0)U=this._getOrReturnCtx($,U),T(U,{code:M.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:M.not_finite,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,x.toString(I))}gt($,I){return this.setLimit("min",$,!1,x.toString(I))}lte($,I){return this.setLimit("max",$,!0,x.toString(I))}lt($,I){return this.setLimit("max",$,!1,x.toString(I))}setLimit($,I,U,b){return new O1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(b)}]})}_addCheck($){return new O1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:x.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:x.toString(I)})}finite($){return this._addCheck({kind:"finite",message:x.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.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($)}}O1.create=($)=>{return new O1({checks:[],typeName:F.ZodNumber,coerce:$?.coerce||!1,...d($)})};class z1 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:M.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:M.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:M.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:M.invalid_type,expected:R.bigint,received:I.parsedType}),r}gte($,I){return this.setLimit("min",$,!0,x.toString(I))}gt($,I){return this.setLimit("min",$,!1,x.toString(I))}lte($,I){return this.setLimit("max",$,!0,x.toString(I))}lt($,I){return this.setLimit("max",$,!1,x.toString(I))}setLimit($,I,U,b){return new z1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(b)}]})}_addCheck($){return new z1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:x.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 $}}z1.create=($)=>{return new z1({checks:[],typeName:F.ZodBigInt,coerce:$?.coerce??!1,...d($)})};class ww extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.boolean,received:U.parsedType}),r}return c$($.data)}}ww.create=($)=>{return new ww({typeName:F.ZodBoolean,coerce:$?.coerce||!1,...d($)})};class TI extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let w=this._getOrReturnCtx($);return T(w,{code:M.invalid_type,expected:R.date,received:w.parsedType}),r}if(Number.isNaN($.data.getTime())){let w=this._getOrReturnCtx($);return T(w,{code:M.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:M.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:M.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 TI({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:x.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:x.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}}TI.create=($)=>{return new TI({checks:[],coerce:$?.coerce||!1,typeName:F.ZodDate,...d($)})};class bw extends e{_parse($){if(this._getType($)!==R.symbol){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.symbol,received:U.parsedType}),r}return c$($.data)}}bw.create=($)=>{return new bw({typeName:F.ZodSymbol,...d($)})};class _I extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.undefined,received:U.parsedType}),r}return c$($.data)}}_I.create=($)=>{return new _I({typeName:F.ZodUndefined,...d($)})};class ZI extends e{_parse($){if(this._getType($)!==R.null){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.null,received:U.parsedType}),r}return c$($.data)}}ZI.create=($)=>{return new ZI({typeName:F.ZodNull,...d($)})};class Xw extends e{constructor(){super(...arguments);this._any=!0}_parse($){return c$($.data)}}Xw.create=($)=>{return new Xw({typeName:F.ZodAny,...d($)})};class u4 extends e{constructor(){super(...arguments);this._unknown=!0}_parse($){return c$($.data)}}u4.create=($)=>{return new u4({typeName:F.ZodUnknown,...d($)})};class t6 extends e{_parse($){let I=this._getOrReturnCtx($);return T(I,{code:M.invalid_type,expected:R.never,received:I.parsedType}),r}}t6.create=($)=>{return new t6({typeName:F.ZodNever,...d($)})};class Dw extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.void,received:U.parsedType}),r}return c$($.data)}}Dw.create=($)=>{return new Dw({typeName:F.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:M.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?M.too_big:M.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:M.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:M.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:x.toString(I)}})}max($,I){return new C6({...this._def,maxLength:{value:$,message:x.toString(I)}})}length($,I){return new C6({...this._def,exactLength:{value:$,message:x.toString(I)}})}nonempty($){return this.min(1,$)}}C6.create=($,I)=>{return new C6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...d(I)})};function A1($){if($ instanceof E$){let I={};for(let U in $.shape){let b=$.shape[U];I[U]=J6.create(A1(b))}return new E$({...$._def,shape:()=>I})}else if($ instanceof C6)return new C6({...$._def,type:A1($.element)});else if($ instanceof J6)return J6.create(A1($.unwrap()));else if($ instanceof G4)return G4.create(A1($.unwrap()));else if($ instanceof a6)return a6.create($.items.map((I)=>A1(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:M.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],Y=b.data[Q];W.push({key:{status:"valid",value:Q},value:G._parse(new V6(b,Y,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:M.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 Y=b.data[G];W.push({key:{status:"valid",value:G},value:Q._parse(new V6(b,Y,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 Y=await G.key,J=await G.value;Q.push({key:Y,value:J,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 x.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:x.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:F.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 A1(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 J6)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:F.ZodObject,...d(I)})};E$.strictCreate=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strict",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};E$.lazycreate=($,I)=>{return new E$({shape:$,unknownKeys:"strip",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};class CI 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:M.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:M.invalid_union,unionErrors:D}),r}}get options(){return this._def.options}}CI.create=($,I)=>{return new CI({options:$,typeName:F.ZodUnion,...d(I)})};var d6=($)=>{if($ instanceof xI)return d6($.schema);else if($ instanceof g6)return d6($.innerType());else if($ instanceof hI)return[$.value];else if($ instanceof l4)return $.options;else if($ instanceof fI)return $$.objectValues($.enum);else if($ instanceof yI)return d6($._def.innerType);else if($ instanceof _I)return[void 0];else if($ instanceof ZI)return[null];else if($ instanceof J6)return[void 0,...d6($.unwrap())];else if($ instanceof G4)return[null,...d6($.unwrap())];else if($ instanceof bW)return d6($.unwrap());else if($ instanceof lI)return d6($.unwrap());else if($ instanceof uI)return d6($._def.innerType);else return[]};class wW extends e{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.object)return T(I,{code:M.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:M.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 wW({typeName:F.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:b,...d(U)})}}function UW($,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=UW($[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=UW(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 gI extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($),b=(w,X)=>{if(sD(w)||sD(X))return r;let D=UW(w.value,X.value);if(!D.valid)return T(U,{code:M.invalid_intersection_types}),r;if($W(w)||$W(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}))}}gI.create=($,I,U)=>{return new gI({left:$,right:I,typeName:F.ZodIntersection,...d(U)})};class a6 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.array)return T(U,{code:M.invalid_type,expected:R.array,received:U.parsedType}),r;if(U.data.length<this._def.items.length)return T(U,{code:M.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:M.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:F.ZodTuple,rest:null,...d(I)})};class Ww 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:M.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 Ww({keyType:$,valueType:I,typeName:F.ZodRecord,...d(U)});return new Ww({keyType:p6.create(),valueType:$,typeName:F.ZodRecord,...d(I)})}}class Qw 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:M.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}}}}Qw.create=($,I,U)=>{return new Qw({valueType:I,keyType:$,typeName:F.ZodMap,...d(U)})};class L1 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.set)return T(U,{code:M.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:M.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:M.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 L1({...this._def,minSize:{value:$,message:x.toString(I)}})}max($,I){return new L1({...this._def,maxSize:{value:$,message:x.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}L1.create=($,I)=>{return new L1({valueType:$,minSize:null,maxSize:null,typeName:F.ZodSet,...d(I)})};class RI extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.function)return T(I,{code:M.invalid_type,expected:R.function,received:I.parsedType}),r;function U(D,W){return Uw({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,PI(),Q4].filter((Q)=>!!Q),issueData:{code:M.invalid_arguments,argumentsError:W}})}function b(D,W){return Uw({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,PI(),Q4].filter((Q)=>!!Q),issueData:{code:M.invalid_return_type,returnTypeError:W}})}let w={errorMap:I.common.contextualErrorMap},X=I.data;if(this._def.returns instanceof K1){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}),Y=await Reflect.apply(X,this,G);return await D._def.returns._def.type.parseAsync(Y,w).catch((H)=>{throw Q.addIssue(b(Y,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),Y=D._def.returns.safeParse(G,w);if(!Y.success)throw new X6([b(G,Y.error)]);return Y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new RI({...this._def,args:a6.create($).rest(u4.create())})}returns($){return new RI({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new RI({args:$?$:a6.create([]).rest(u4.create()),returns:I||u4.create(),typeName:F.ZodFunction,...d(U)})}}class xI 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})}}xI.create=($,I)=>{return new xI({getter:$,typeName:F.ZodLazy,...d(I)})};class hI extends e{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return T(I,{received:I.data,code:M.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}hI.create=($,I)=>{return new hI({value:$,typeName:F.ZodLiteral,...d(I)})};function fH($,I){return new l4({values:$,typeName:F.ZodEnum,...d(I)})}class l4 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:M.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:M.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 l4.create($,{...this._def,...I})}exclude($,I=this._def){return l4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}l4.create=fH;class fI 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:M.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:M.invalid_enum_value,options:b}),r}return c$($.data)}get enum(){return this._def.values}}fI.create=($,I)=>{return new fI({values:$,typeName:F.ZodNativeEnum,...d(I)})};class K1 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:M.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})}))}}K1.create=($,I)=>{return new K1({type:$,typeName:F.ZodPromise,...d(I)})};class g6 extends e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.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 H1(W.value);if(I.value==="dirty")return H1(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 H1(D.value);if(I.value==="dirty")return H1(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(!y4(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(!y4(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:F.ZodEffects,effect:I,...d(U)})};g6.createWithPreprocess=($,I,U)=>{return new g6({schema:I,effect:{type:"preprocess",transform:$},typeName:F.ZodEffects,...d(U)})};class J6 extends e{_parse($){if(this._getType($)===R.undefined)return c$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}J6.create=($,I)=>{return new J6({innerType:$,typeName:F.ZodOptional,...d(I)})};class G4 extends e{_parse($){if(this._getType($)===R.null)return c$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}G4.create=($,I)=>{return new G4({innerType:$,typeName:F.ZodNullable,...d(I)})};class yI 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}}yI.create=($,I)=>{return new yI({innerType:$,typeName:F.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...d(I)})};class uI 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(kI(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}}uI.create=($,I)=>{return new uI({innerType:$,typeName:F.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...d(I)})};class Gw extends e{_parse($){if(this._getType($)!==R.nan){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.nan,received:U.parsedType}),r}return{status:"valid",value:$.data}}}Gw.create=($)=>{return new Gw({typeName:F.ZodNaN,...d($)})};var Al=Symbol("zod_brand");class bW 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 Yw 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(),H1(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 Yw({in:$,out:I,typeName:F.ZodPipeline})}}class lI extends e{_parse($){let I=this._def.innerType._parse($),U=(b)=>{if(y4(b))b.value=Object.freeze(b.value);return b};return kI(I)?I.then((b)=>U(b)):U(I)}unwrap(){return this._def.innerType}}lI.create=($,I)=>{return new lI({innerType:$,typeName:F.ZodReadonly,...d(I)})};var Ol={object:E$.lazycreate},F;(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"})(F||(F={}));var zl=p6.create,Ll=O1.create,Kl=Gw.create,vl=z1.create,Vl=ww.create,ql=TI.create,Ml=bw.create,Fl=_I.create,jl=ZI.create,El=Xw.create,Sl=u4.create,Pl=t6.create,kl=Dw.create,Rl=C6.create,yH=E$.create,Tl=E$.strictCreate,_l=CI.create,Zl=wW.create,Cl=gI.create,gl=a6.create,xl=Ww.create,hl=Qw.create,fl=L1.create,yl=RI.create,ul=xI.create,ll=hI.create,cl=l4.create,ml=fI.create,rl=K1.create,nl=g6.create,il=J6.create,ol=G4.create,dl=g6.createWithPreprocess,pl=Yw.create;var Pj=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 Y in D.prototype)if(!(Y in W))Object.defineProperty(W,Y,{value:D.prototype[Y].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 Y of G._zod.deferred)Y();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 kj=Symbol("zod_brand");class Y4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Nw={};function D6($){if($)Object.assign(Nw,$);return Nw}var I$={};v6(I$,{unwrapMessage:()=>cI,stringifyPrimitive:()=>Hw,required:()=>ij,randomString:()=>hj,propertyKeyTypes:()=>YW,promiseAllObject:()=>xj,primitiveTypes:()=>uH,prefixIssues:()=>x6,pick:()=>lj,partial:()=>nj,optionalKeys:()=>NW,omit:()=>cj,numKeys:()=>fj,nullish:()=>nI,normalizeParams:()=>m,merge:()=>rj,jsonStringifyReplacer:()=>DW,joinValues:()=>Jw,issue:()=>BW,isPlainObject:()=>V1,isObject:()=>v1,getSizableOrigin:()=>cH,getParsedType:()=>yj,getLengthableOrigin:()=>oI,getEnumValues:()=>mI,getElementAtPath:()=>gj,floatSafeRemainder:()=>WW,finalizeIssue:()=>q6,extend:()=>mj,escapeRegex:()=>N4,esc:()=>c4,defineLazy:()=>O$,createTransparentProxy:()=>uj,clone:()=>W6,cleanRegex:()=>iI,cleanEnum:()=>oj,captureStackTrace:()=>Bw,cached:()=>rI,assignProp:()=>QW,assertNotEqual:()=>Tj,assertNever:()=>Zj,assertIs:()=>_j,assertEqual:()=>Rj,assert:()=>Cj,allowsEval:()=>GW,aborted:()=>m4,NUMBER_FORMAT_RANGES:()=>JW,Class:()=>mH,BIGINT_FORMAT_RANGES:()=>lH});function Rj($){return $}function Tj($){return $}function _j($){}function Zj($){throw new Error}function Cj($){}function mI($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function Jw($,I="|"){return $.map((U)=>Hw(U)).join(I)}function DW($,I){if(typeof I==="bigint")return I.toString();return I}function rI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function nI($){return $===null||$===void 0}function iI($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function WW($,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 QW($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function gj($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function xj($){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 hj($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function c4($){return JSON.stringify($)}var Bw=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};function v1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var GW=rI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function V1($){if(v1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;let U=I.prototype;if(v1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function fj($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var yj=($)=>{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}`)}},YW=new Set(["string","number","symbol"]),uH=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 uj($){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 Hw($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function NW($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var JW={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]},lH={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function lj($,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 cj($,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 mj($,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 QW(this,"shape",b),b},checks:[]};return W6($,U)}function rj($,I){return W6($,{...$._zod.def,get shape(){let U={...$._zod.def.shape,...I._zod.def.shape};return QW(this,"shape",U),U},catchall:I._zod.def.catchall,checks:[]})}function nj($,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 ij($,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 m4($,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 cI($){return typeof $==="string"?$:$?.message}function q6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=cI($.inst?._zod.def?.error?.($))??cI(I?.error?.($))??cI(U.customError?.($))??cI(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function cH($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function oI($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function BW(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function oj($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}class mH{constructor(...$){}}var rH=($,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,DW,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Aw=v("$ZodError",rH),dI=v("$ZodError",rH,{Parent:Error});function HW($,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 AW($,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 OW=($)=>(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 Y4;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Bw(W,w?.callee),W}return D.value},zW=OW(dI),LW=($)=>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 Bw(W,w?.callee),W}return D.value},KW=LW(dI),vW=($)=>(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 Y4;return X.issues.length?{success:!1,error:new($??Aw)(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},r4=vW(dI),VW=($)=>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}},n4=VW(dI);var nH=/^[cC][^\s-]{8,}$/,iH=/^[0-9a-z]+$/,oH=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dH=/^[0-9a-vA-V]{20}$/,pH=/^[A-Za-z0-9]{27}$/,tH=/^[a-zA-Z0-9_-]{21}$/,aH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var eH=/^([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})$/,qW=($)=>{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 sH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function $A(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var IA=/^(?:(?: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])$/,UA=/^(([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})$/,wA=/^((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])$/,bA=/^(([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])$/,XA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,MW=/^[A-Za-z0-9_-]*$/,DA=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var WA=/^\+(?:[0-9]){6,14}[0-9]$/,QA="(?:(?:\\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])))",GA=new RegExp(`^${QA}$`);function YA($){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 NA($){return new RegExp(`^${YA($)}$`)}function JA($){let I=YA({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-]\\d{2}:\\d{2})");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${QA}T(?:${b})$`)}var BA=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)};var HA=/^\d+$/,AA=/^-?\d+(?:\.\d+)?/i,OA=/true|false/i,zA=/null/i;var LA=/^[^A-Z]*$/,KA=/^[^a-z]*$/;var Z$=v("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),vA={number:"number",bigint:"bigint",object:"date"},FW=v("$ZodCheckLessThan",($,I)=>{Z$.init($,I);let U=vA[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})}}),jW=v("$ZodCheckGreaterThan",($,I)=>{Z$.init($,I);let U=vA[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})}}),VA=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):WW(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})}}),qA=v("$ZodCheckNumberFormat",($,I)=>{Z$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=JW[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=HA}),$._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 MA=v("$ZodCheckMaxLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(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=oI(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),FA=v("$ZodCheckMinLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(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=oI(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),jA=v("$ZodCheckLengthEquals",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(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=oI(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})}}),pI=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=()=>{})}),EA=v("$ZodCheckRegex",($,I)=>{pI.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})}}),SA=v("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=LA),pI.init($,I)}),PA=v("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=KA),pI.init($,I)}),kA=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})}}),RA=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})}}),TA=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 _A=v("$ZodCheckOverwrite",($,I)=>{Z$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class EW{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
|
|
11
|
+
`))}}var CA={major:4,minor:0,patch:0};var Y$=v("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=CA;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=m4(X),G;for(let Y of D){if(Y._zod.def.when){if(!Y._zod.def.when(X))continue}else if(Q)continue;let J=X.issues.length,H=Y._zod.check(X);if(H instanceof Promise&&W?.async===!1)throw new Y4;if(G||H instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await H,X.issues.length===J)return;if(!Q)Q=m4(X,J)});else{if(X.issues.length===J)continue;if(!Q)Q=m4(X,J)}}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 Y4;return W.then((Q)=>w(Q,b,D))}return w(W,b,D)}}$["~standard"]={validate:(w)=>{try{let X=r4($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return n4($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),tI=v("$ZodString",($,I)=>{Y$.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??BA($._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)=>{pI.init($,I),tI.init($,I)}),PW=v("$ZodGUID",($,I)=>{I.pattern??(I.pattern=eH),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=qW(b))}else I.pattern??(I.pattern=qW());z$.init($,I)}),RW=v("$ZodEmail",($,I)=>{I.pattern??(I.pattern=sH),z$.init($,I)}),TW=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:DA.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})}}}),_W=v("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=$A()),z$.init($,I)}),ZW=v("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=tH),z$.init($,I)}),CW=v("$ZodCUID",($,I)=>{I.pattern??(I.pattern=nH),z$.init($,I)}),gW=v("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=iH),z$.init($,I)}),xW=v("$ZodULID",($,I)=>{I.pattern??(I.pattern=oH),z$.init($,I)}),hW=v("$ZodXID",($,I)=>{I.pattern??(I.pattern=dH),z$.init($,I)}),fW=v("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=pH),z$.init($,I)}),rA=v("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=JA(I)),z$.init($,I)}),nA=v("$ZodISODate",($,I)=>{I.pattern??(I.pattern=GA),z$.init($,I)}),iA=v("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=NA(I)),z$.init($,I)}),oA=v("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=aH),z$.init($,I)}),yW=v("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=IA),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv4"})}),uW=v("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=UA),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})}}}),lW=v("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=wA),z$.init($,I)}),cW=v("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=bA),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 dA($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var mW=v("$ZodBase64",($,I)=>{I.pattern??(I.pattern=XA),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64"}),$._zod.check=(U)=>{if(dA(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function pj($){if(!MW.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return dA(U)}var rW=v("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=MW),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64url"}),$._zod.check=(U)=>{if(pj(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),nW=v("$ZodE164",($,I)=>{I.pattern??(I.pattern=WA),z$.init($,I)});function tj($,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 iW=v("$ZodJWT",($,I)=>{z$.init($,I),$._zod.check=(U)=>{if(tj(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}});var Lw=v("$ZodNumber",($,I)=>{Y$.init($,I),$._zod.pattern=$._zod.bag.pattern??AA,$._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}}),oW=v("$ZodNumber",($,I)=>{qA.init($,I),Lw.init($,I)}),dW=v("$ZodBoolean",($,I)=>{Y$.init($,I),$._zod.pattern=OA,$._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 pW=v("$ZodNull",($,I)=>{Y$.init($,I),$._zod.pattern=zA,$._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 tW=v("$ZodUnknown",($,I)=>{Y$.init($,I),$._zod.parse=(U)=>U}),aW=v("$ZodNever",($,I)=>{Y$.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}});function gA($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}var eW=v("$ZodArray",($,I)=>{Y$.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)=>gA(G,U,D)));else gA(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function zw($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}function xA($,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 Kw=v("$ZodObject",($,I)=>{Y$.init($,I);let U=rI(()=>{let J=Object.keys(I.shape);for(let B of J)if(!(I.shape[B]instanceof Y$))throw new Error(`Invalid element at key "${B}": expected a Zod schema`);let H=NW(I.shape);return{shape:I.shape,keys:J,keySet:new Set(J),numKeys:J.length,optionalKeys:new Set(H)}});O$($._zod,"propValues",()=>{let J=I.shape,H={};for(let B in J){let A=J[B]._zod;if(A.values){H[B]??(H[B]=new Set);for(let O of A.values)H[B].add(O)}}return H});let b=(J)=>{let H=new EW(["shape","payload","ctx"]),B=U.value,A=(k)=>{let P=c4(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 B.keys)O[k]=`key_${V++}`;H.write("const newResult = {}");for(let k of B.keys)if(B.optionalKeys.has(k)){let P=O[k];H.write(`const ${P} = ${A(k)};`);let h=c4(k);H.write(`
|
|
12
12
|
if (${P}.issues.length) {
|
|
13
13
|
if (input[${h}] === undefined) {
|
|
14
14
|
if (${h} in input) {
|
|
@@ -31,18 +31,18 @@ var Ij=Object.create;var{getPrototypeOf:Uj,defineProperty:eD,getOwnPropertyNames
|
|
|
31
31
|
if (${P}.issues.length) payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
32
32
|
...iss,
|
|
33
33
|
path: iss.path ? [${c4(k)}, ...iss.path] : [${c4(k)}]
|
|
34
|
-
})));`),H.write(`newResult[${c4(k)}] = ${P}.value`)}H.write("payload.value = newResult;"),H.write("return payload;");let q=H.compile();return(k,P)=>q(J,k,P)},w,X=v1,D=!Nw.jitless,Q=D&&GW.value,G=I.catchall,Y;$._zod.parse=(J,H)=>{Y??(Y=U.value);let B=J.value;if(!X(B))return J.issues.push({expected:"object",code:"invalid_type",input:B,inst:$}),J;let A=[];if(D&&Q&&H?.async===!1&&H.jitless!==!0){if(!w)w=b(I.shape);J=w(J,H)}else{J.value={};let P=Y.shape;for(let h of Y.keys){let l=P[h],l$=l._zod.run({value:B[h],issues:[]},H),N6=l._zod.optin==="optional"&&l._zod.optout==="optional";if(l$ instanceof Promise)A.push(l$.then((B1)=>N6?hA(B1,J,h,B):zw(B1,J,h)));else if(N6)hA(l$,J,h,B);else zw(l$,J,h)}}if(!G)return A.length?Promise.all(A).then(()=>J):J;let O=[],V=Y.keySet,q=G._zod,k=q.def.type;for(let P of Object.keys(B)){if(V.has(P))continue;if(k==="never"){O.push(P);continue}let h=q.run({value:B[P],issues:[]},H);if(h instanceof Promise)A.push(h.then((l)=>zw(l,J,P)));else zw(h,J,P)}if(O.length)J.issues.push({code:"unrecognized_keys",keys:O,input:B,inst:$});if(!A.length)return J;return Promise.all(A).then(()=>{return J})}});function fA($,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 vw=v("$ZodUnion",($,I)=>{Y$.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)=>iI(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 fA(X,U,$,b);return Promise.all(X).then((D)=>{return fA(D,U,$,b)})}}),sW=v("$ZodDiscriminatedUnion",($,I)=>{vw.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=rI(()=>{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(!v1(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}}),$9=v("$ZodIntersection",($,I)=>{Y$.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 yA(U,Q,G)});return yA(U,X,D)}});function SW($,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=SW($[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=SW(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 yA($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(m4($))return $;let b=SW(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var I9=v("$ZodRecord",($,I)=>{Y$.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((Y)=>{if(Y.issues.length)U.issues.push(...x6(Q,Y.issues));U.value[Q]=Y.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 U9=v("$ZodEnum",($,I)=>{Y$.init($,I);let U=mI(I.entries);$._zod.values=new Set(U),$._zod.pattern=new RegExp(`^(${U.filter((b)=>YW.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}}),w9=v("$ZodLiteral",($,I)=>{Y$.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 b9=v("$ZodTransform",($,I)=>{Y$.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 Y4;return U.value=w,U}}),X9=v("$ZodOptional",($,I)=>{Y$.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(`^(${iI(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)}}),D9=v("$ZodNullable",($,I)=>{Y$.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(`^(${iI(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)}}),W9=v("$ZodDefault",($,I)=>{Y$.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)=>uA(X,I));return uA(w,I)}});function uA($,I){if($.value===void 0)$.value=I.defaultValue;return $}var Q9=v("$ZodPrefault",($,I)=>{Y$.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)}}),G9=v("$ZodNonOptional",($,I)=>{Y$.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)=>lA(X,$));return lA(w,$)}});function lA($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var Y9=v("$ZodCatch",($,I)=>{Y$.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 N9=v("$ZodPipe",($,I)=>{Y$.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)=>cA(X,I,b));return cA(w,I,b)}});function cA($,I,U){if(m4($))return $;return I.out._zod.run({value:$.value,issues:$.issues},U)}var J9=v("$ZodReadonly",($,I)=>{Y$.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(mA);return mA(w)}});function mA($){return $.value=Object.freeze($.value),$}var B9=v("$ZodCustom",($,I)=>{Z$.init($,I),Y$.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)=>rA(X,U,b,$));rA(w,U,b,$);return}});function rA($,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(BW(w))}}var ej=($)=>{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},sj=()=>{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 ${ej(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${Hw(b.values[0])}`;return`Invalid option: expected one of ${Jw(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":""}: ${Jw(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 H9(){return{localeError:sj()}}var $E=Symbol("ZodOutput"),IE=Symbol("ZodInput");class Vw{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 tA(){return new Vw}var J4=tA();function A9($,I){return new $({type:"string",...m(I)})}function O9($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...m(I)})}function qw($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...m(I)})}function z9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...m(I)})}function L9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(I)})}function K9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(I)})}function v9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(I)})}function V9($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...m(I)})}function q9($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...m(I)})}function M9($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(I)})}function F9($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...m(I)})}function j9($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(I)})}function E9($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...m(I)})}function S9($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...m(I)})}function P9($,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 R9($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(I)})}function T9($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(I)})}function _9($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(I)})}function Z9($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...m(I)})}function C9($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...m(I)})}function g9($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...m(I)})}function x9($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...m(I)})}function aA($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(I)})}function eA($,I){return new $({type:"string",format:"date",check:"string_format",...m(I)})}function sA($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...m(I)})}function $O($,I){return new $({type:"string",format:"duration",check:"string_format",...m(I)})}function h9($,I){return new $({type:"number",checks:[],...m(I)})}function f9($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...m(I)})}function y9($,I){return new $({type:"boolean",...m(I)})}function u9($,I){return new $({type:"null",...m(I)})}function l9($){return new $({type:"unknown"})}function c9($,I){return new $({type:"never",...m(I)})}function Mw($,I){return new FW({check:"less_than",...m(I),value:$,inclusive:!1})}function aI($,I){return new FW({check:"less_than",...m(I),value:$,inclusive:!0})}function Fw($,I){return new jW({check:"greater_than",...m(I),value:$,inclusive:!1})}function eI($,I){return new jW({check:"greater_than",...m(I),value:$,inclusive:!0})}function jw($,I){return new qA({check:"multiple_of",...m(I),value:$})}function Ew($,I){return new FA({check:"max_length",...m(I),maximum:$})}function q1($,I){return new jA({check:"min_length",...m(I),minimum:$})}function Sw($,I){return new EA({check:"length_equals",...m(I),length:$})}function m9($,I){return new SA({check:"string_format",format:"regex",...m(I),pattern:$})}function r9($){return new PA({check:"string_format",format:"lowercase",...m($)})}function n9($){return new kA({check:"string_format",format:"uppercase",...m($)})}function i9($,I){return new RA({check:"string_format",format:"includes",...m(I),includes:$})}function o9($,I){return new TA({check:"string_format",format:"starts_with",...m(I),prefix:$})}function d9($,I){return new _A({check:"string_format",format:"ends_with",...m(I),suffix:$})}function i4($){return new ZA({check:"overwrite",tx:$})}function p9($){return i4((I)=>I.normalize($))}function t9(){return i4(($)=>$.trim())}function a9(){return i4(($)=>$.toLowerCase())}function e9(){return i4(($)=>$.toUpperCase())}function IO($,I,U){return new $({type:"array",element:I,...m(U)})}function s9($,I,U){let b=m(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function $8($,I,U){return new $({type:"custom",check:"custom",fn:I,...m(U)})}class I8{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??J4,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 Y={...I,schemaPath:[...I.schemaPath,$],path:I.path},J=$._zod.parent;if(J)D.ref=J,this.process(J,Y),this.seen.get(J).isParent=!0;else{let H=D.schema;switch(b.type){case"string":{let B=H;B.type="string";let{minimum:A,maximum:O,format:V,patterns:q,contentEncoding:k}=$._zod.bag;if(typeof A==="number")B.minLength=A;if(typeof O==="number")B.maxLength=O;if(V){if(B.format=w[V]??V,B.format==="")delete B.format}if(k)B.contentEncoding=k;if(q&&q.size>0){let P=[...q];if(P.length===1)B.pattern=P[0].source;else if(P.length>1)D.schema.allOf=[...P.map((h)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:h.source}))]}break}case"number":{let B=H,{minimum:A,maximum:O,format:V,multipleOf:q,exclusiveMaximum:k,exclusiveMinimum:P}=$._zod.bag;if(typeof V==="string"&&V.includes("int"))B.type="integer";else B.type="number";if(typeof P==="number")B.exclusiveMinimum=P;if(typeof A==="number"){if(B.minimum=A,typeof P==="number")if(P>=A)delete B.minimum;else delete B.exclusiveMinimum}if(typeof k==="number")B.exclusiveMaximum=k;if(typeof O==="number"){if(B.maximum=O,typeof k==="number")if(k<=O)delete B.maximum;else delete B.exclusiveMaximum}if(typeof q==="number")B.multipleOf=q;break}case"boolean":{let B=H;B.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 B=H,{minimum:A,maximum:O}=$._zod.bag;if(typeof A==="number")B.minItems=A;if(typeof O==="number")B.maxItems=O;B.type="array",B.items=this.process(b.element,{...Y,path:[...Y.path,"items"]});break}case"object":{let B=H;B.type="object",B.properties={};let A=b.shape;for(let q in A)B.properties[q]=this.process(A[q],{...Y,path:[...Y.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)B.required=Array.from(V);if(b.catchall?._zod.def.type==="never")B.additionalProperties=!1;else if(!b.catchall){if(this.io==="output")B.additionalProperties=!1}else if(b.catchall)B.additionalProperties=this.process(b.catchall,{...Y,path:[...Y.path,"additionalProperties"]});break}case"union":{let B=H;B.anyOf=b.options.map((A,O)=>this.process(A,{...Y,path:[...Y.path,"anyOf",O]}));break}case"intersection":{let B=H,A=this.process(b.left,{...Y,path:[...Y.path,"allOf",0]}),O=this.process(b.right,{...Y,path:[...Y.path,"allOf",1]}),V=(k)=>("allOf"in k)&&Object.keys(k).length===1,q=[...V(A)?A.allOf:[A],...V(O)?O.allOf:[O]];B.allOf=q;break}case"tuple":{let B=H;B.type="array";let A=b.items.map((q,k)=>this.process(q,{...Y,path:[...Y.path,"prefixItems",k]}));if(this.target==="draft-2020-12")B.prefixItems=A;else B.items=A;if(b.rest){let q=this.process(b.rest,{...Y,path:[...Y.path,"items"]});if(this.target==="draft-2020-12")B.items=q;else B.additionalItems=q}if(b.rest)B.items=this.process(b.rest,{...Y,path:[...Y.path,"items"]});let{minimum:O,maximum:V}=$._zod.bag;if(typeof O==="number")B.minItems=O;if(typeof V==="number")B.maxItems=V;break}case"record":{let B=H;B.type="object",B.propertyNames=this.process(b.keyType,{...Y,path:[...Y.path,"propertyNames"]}),B.additionalProperties=this.process(b.valueType,{...Y,path:[...Y.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 B=H,A=mI(b.entries);if(A.every((O)=>typeof O==="number"))B.type="number";if(A.every((O)=>typeof O==="string"))B.type="string";B.enum=A;break}case"literal":{let B=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];B.type=O===null?"null":typeof O,B.const=O}else{if(A.every((O)=>typeof O==="number"))B.type="number";if(A.every((O)=>typeof O==="string"))B.type="string";if(A.every((O)=>typeof O==="boolean"))B.type="string";if(A.every((O)=>O===null))B.type="null";B.enum=A}break}case"file":{let B=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(B,A);else B.anyOf=q.map((k)=>{return{...A,contentMediaType:k}});else Object.assign(B,A);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let B=this.process(b.innerType,Y);H.anyOf=[B,{type:"null"}];break}case"nonoptional":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"success":{let B=H;B.type="boolean";break}case"default":{this.process(b.innerType,Y),D.ref=b.innerType,H.default=JSON.parse(JSON.stringify(b.defaultValue));break}case"prefault":{if(this.process(b.innerType,Y),D.ref=b.innerType,this.io==="input")H._prefault=JSON.parse(JSON.stringify(b.defaultValue));break}case"catch":{this.process(b.innerType,Y),D.ref=b.innerType;let B;try{B=b.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}H.default=B;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let B=H,A=$._zod.pattern;if(!A)throw new Error("Pattern not found in template literal");B.type="string",B.pattern=A.source;break}case"pipe":{let B=this.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;this.process(B,Y),D.ref=B;break}case"readonly":{this.process(b.innerType,Y),D.ref=b.innerType,H.readOnly=!0;break}case"promise":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"optional":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"lazy":{let B=$._zod.innerType;this.process(B,Y),D.ref=B;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 Y=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")}#/${Y}/${V}`}}if(G[1]===b)return{ref:"#"};let H=`${"#"}/${Y}/`,B=G[1].schema.id??`__schema${this.counter++}`;return{defId:B,ref:H+B}},X=(G)=>{if(G[1].schema.$ref)return;let Y=G[1],{ref:J,defId:H}=w(G);if(Y.def={...Y.schema},H)Y.defId=H;let B=Y.schema;for(let A in B)delete B[A];B.$ref=J};if(U.cycles==="throw")for(let G of this.seen.entries()){let Y=G[1];if(Y.cycle)throw new Error(`Cycle detected: #/${Y.cycle?.join("/")}/<root>
|
|
34
|
+
})));`),H.write(`newResult[${c4(k)}] = ${P}.value`)}H.write("payload.value = newResult;"),H.write("return payload;");let q=H.compile();return(k,P)=>q(J,k,P)},w,X=v1,D=!Nw.jitless,Q=D&&GW.value,G=I.catchall,Y;$._zod.parse=(J,H)=>{Y??(Y=U.value);let B=J.value;if(!X(B))return J.issues.push({expected:"object",code:"invalid_type",input:B,inst:$}),J;let A=[];if(D&&Q&&H?.async===!1&&H.jitless!==!0){if(!w)w=b(I.shape);J=w(J,H)}else{J.value={};let P=Y.shape;for(let h of Y.keys){let l=P[h],l$=l._zod.run({value:B[h],issues:[]},H),N6=l._zod.optin==="optional"&&l._zod.optout==="optional";if(l$ instanceof Promise)A.push(l$.then((B1)=>N6?xA(B1,J,h,B):zw(B1,J,h)));else if(N6)xA(l$,J,h,B);else zw(l$,J,h)}}if(!G)return A.length?Promise.all(A).then(()=>J):J;let O=[],V=Y.keySet,q=G._zod,k=q.def.type;for(let P of Object.keys(B)){if(V.has(P))continue;if(k==="never"){O.push(P);continue}let h=q.run({value:B[P],issues:[]},H);if(h instanceof Promise)A.push(h.then((l)=>zw(l,J,P)));else zw(h,J,P)}if(O.length)J.issues.push({code:"unrecognized_keys",keys:O,input:B,inst:$});if(!A.length)return J;return Promise.all(A).then(()=>{return J})}});function hA($,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 vw=v("$ZodUnion",($,I)=>{Y$.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)=>iI(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 hA(X,U,$,b);return Promise.all(X).then((D)=>{return hA(D,U,$,b)})}}),sW=v("$ZodDiscriminatedUnion",($,I)=>{vw.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=rI(()=>{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(!v1(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}}),$9=v("$ZodIntersection",($,I)=>{Y$.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 SW($,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=SW($[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=SW(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(m4($))return $;let b=SW(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var I9=v("$ZodRecord",($,I)=>{Y$.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((Y)=>{if(Y.issues.length)U.issues.push(...x6(Q,Y.issues));U.value[Q]=Y.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 U9=v("$ZodEnum",($,I)=>{Y$.init($,I);let U=mI(I.entries);$._zod.values=new Set(U),$._zod.pattern=new RegExp(`^(${U.filter((b)=>YW.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}}),w9=v("$ZodLiteral",($,I)=>{Y$.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 b9=v("$ZodTransform",($,I)=>{Y$.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 Y4;return U.value=w,U}}),X9=v("$ZodOptional",($,I)=>{Y$.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(`^(${iI(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)}}),D9=v("$ZodNullable",($,I)=>{Y$.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(`^(${iI(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)}}),W9=v("$ZodDefault",($,I)=>{Y$.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)=>yA(X,I));return yA(w,I)}});function yA($,I){if($.value===void 0)$.value=I.defaultValue;return $}var Q9=v("$ZodPrefault",($,I)=>{Y$.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)}}),G9=v("$ZodNonOptional",($,I)=>{Y$.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)=>uA(X,$));return uA(w,$)}});function uA($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var Y9=v("$ZodCatch",($,I)=>{Y$.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 N9=v("$ZodPipe",($,I)=>{Y$.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)=>lA(X,I,b));return lA(w,I,b)}});function lA($,I,U){if(m4($))return $;return I.out._zod.run({value:$.value,issues:$.issues},U)}var J9=v("$ZodReadonly",($,I)=>{Y$.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(cA);return cA(w)}});function cA($){return $.value=Object.freeze($.value),$}var B9=v("$ZodCustom",($,I)=>{Z$.init($,I),Y$.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)=>mA(X,U,b,$));mA(w,U,b,$);return}});function mA($,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(BW(w))}}var aj=($)=>{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},ej=()=>{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 ${aj(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${Hw(b.values[0])}`;return`Invalid option: expected one of ${Jw(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":""}: ${Jw(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 H9(){return{localeError:ej()}}var sj=Symbol("ZodOutput"),$E=Symbol("ZodInput");class Vw{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 pA(){return new Vw}var J4=pA();function A9($,I){return new $({type:"string",...m(I)})}function O9($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...m(I)})}function qw($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...m(I)})}function z9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...m(I)})}function L9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(I)})}function K9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(I)})}function v9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(I)})}function V9($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...m(I)})}function q9($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...m(I)})}function M9($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(I)})}function F9($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...m(I)})}function j9($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(I)})}function E9($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...m(I)})}function S9($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...m(I)})}function P9($,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 R9($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(I)})}function T9($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(I)})}function _9($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(I)})}function Z9($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...m(I)})}function C9($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...m(I)})}function g9($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...m(I)})}function x9($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...m(I)})}function tA($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(I)})}function aA($,I){return new $({type:"string",format:"date",check:"string_format",...m(I)})}function eA($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...m(I)})}function sA($,I){return new $({type:"string",format:"duration",check:"string_format",...m(I)})}function h9($,I){return new $({type:"number",checks:[],...m(I)})}function f9($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...m(I)})}function y9($,I){return new $({type:"boolean",...m(I)})}function u9($,I){return new $({type:"null",...m(I)})}function l9($){return new $({type:"unknown"})}function c9($,I){return new $({type:"never",...m(I)})}function Mw($,I){return new FW({check:"less_than",...m(I),value:$,inclusive:!1})}function aI($,I){return new FW({check:"less_than",...m(I),value:$,inclusive:!0})}function Fw($,I){return new jW({check:"greater_than",...m(I),value:$,inclusive:!1})}function eI($,I){return new jW({check:"greater_than",...m(I),value:$,inclusive:!0})}function jw($,I){return new VA({check:"multiple_of",...m(I),value:$})}function Ew($,I){return new MA({check:"max_length",...m(I),maximum:$})}function q1($,I){return new FA({check:"min_length",...m(I),minimum:$})}function Sw($,I){return new jA({check:"length_equals",...m(I),length:$})}function m9($,I){return new EA({check:"string_format",format:"regex",...m(I),pattern:$})}function r9($){return new SA({check:"string_format",format:"lowercase",...m($)})}function n9($){return new PA({check:"string_format",format:"uppercase",...m($)})}function i9($,I){return new kA({check:"string_format",format:"includes",...m(I),includes:$})}function o9($,I){return new RA({check:"string_format",format:"starts_with",...m(I),prefix:$})}function d9($,I){return new TA({check:"string_format",format:"ends_with",...m(I),suffix:$})}function i4($){return new _A({check:"overwrite",tx:$})}function p9($){return i4((I)=>I.normalize($))}function t9(){return i4(($)=>$.trim())}function a9(){return i4(($)=>$.toLowerCase())}function e9(){return i4(($)=>$.toUpperCase())}function $O($,I,U){return new $({type:"array",element:I,...m(U)})}function s9($,I,U){let b=m(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function $8($,I,U){return new $({type:"custom",check:"custom",fn:I,...m(U)})}class I8{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??J4,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 Y={...I,schemaPath:[...I.schemaPath,$],path:I.path},J=$._zod.parent;if(J)D.ref=J,this.process(J,Y),this.seen.get(J).isParent=!0;else{let H=D.schema;switch(b.type){case"string":{let B=H;B.type="string";let{minimum:A,maximum:O,format:V,patterns:q,contentEncoding:k}=$._zod.bag;if(typeof A==="number")B.minLength=A;if(typeof O==="number")B.maxLength=O;if(V){if(B.format=w[V]??V,B.format==="")delete B.format}if(k)B.contentEncoding=k;if(q&&q.size>0){let P=[...q];if(P.length===1)B.pattern=P[0].source;else if(P.length>1)D.schema.allOf=[...P.map((h)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:h.source}))]}break}case"number":{let B=H,{minimum:A,maximum:O,format:V,multipleOf:q,exclusiveMaximum:k,exclusiveMinimum:P}=$._zod.bag;if(typeof V==="string"&&V.includes("int"))B.type="integer";else B.type="number";if(typeof P==="number")B.exclusiveMinimum=P;if(typeof A==="number"){if(B.minimum=A,typeof P==="number")if(P>=A)delete B.minimum;else delete B.exclusiveMinimum}if(typeof k==="number")B.exclusiveMaximum=k;if(typeof O==="number"){if(B.maximum=O,typeof k==="number")if(k<=O)delete B.maximum;else delete B.exclusiveMaximum}if(typeof q==="number")B.multipleOf=q;break}case"boolean":{let B=H;B.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 B=H,{minimum:A,maximum:O}=$._zod.bag;if(typeof A==="number")B.minItems=A;if(typeof O==="number")B.maxItems=O;B.type="array",B.items=this.process(b.element,{...Y,path:[...Y.path,"items"]});break}case"object":{let B=H;B.type="object",B.properties={};let A=b.shape;for(let q in A)B.properties[q]=this.process(A[q],{...Y,path:[...Y.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)B.required=Array.from(V);if(b.catchall?._zod.def.type==="never")B.additionalProperties=!1;else if(!b.catchall){if(this.io==="output")B.additionalProperties=!1}else if(b.catchall)B.additionalProperties=this.process(b.catchall,{...Y,path:[...Y.path,"additionalProperties"]});break}case"union":{let B=H;B.anyOf=b.options.map((A,O)=>this.process(A,{...Y,path:[...Y.path,"anyOf",O]}));break}case"intersection":{let B=H,A=this.process(b.left,{...Y,path:[...Y.path,"allOf",0]}),O=this.process(b.right,{...Y,path:[...Y.path,"allOf",1]}),V=(k)=>("allOf"in k)&&Object.keys(k).length===1,q=[...V(A)?A.allOf:[A],...V(O)?O.allOf:[O]];B.allOf=q;break}case"tuple":{let B=H;B.type="array";let A=b.items.map((q,k)=>this.process(q,{...Y,path:[...Y.path,"prefixItems",k]}));if(this.target==="draft-2020-12")B.prefixItems=A;else B.items=A;if(b.rest){let q=this.process(b.rest,{...Y,path:[...Y.path,"items"]});if(this.target==="draft-2020-12")B.items=q;else B.additionalItems=q}if(b.rest)B.items=this.process(b.rest,{...Y,path:[...Y.path,"items"]});let{minimum:O,maximum:V}=$._zod.bag;if(typeof O==="number")B.minItems=O;if(typeof V==="number")B.maxItems=V;break}case"record":{let B=H;B.type="object",B.propertyNames=this.process(b.keyType,{...Y,path:[...Y.path,"propertyNames"]}),B.additionalProperties=this.process(b.valueType,{...Y,path:[...Y.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 B=H,A=mI(b.entries);if(A.every((O)=>typeof O==="number"))B.type="number";if(A.every((O)=>typeof O==="string"))B.type="string";B.enum=A;break}case"literal":{let B=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];B.type=O===null?"null":typeof O,B.const=O}else{if(A.every((O)=>typeof O==="number"))B.type="number";if(A.every((O)=>typeof O==="string"))B.type="string";if(A.every((O)=>typeof O==="boolean"))B.type="string";if(A.every((O)=>O===null))B.type="null";B.enum=A}break}case"file":{let B=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(B,A);else B.anyOf=q.map((k)=>{return{...A,contentMediaType:k}});else Object.assign(B,A);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let B=this.process(b.innerType,Y);H.anyOf=[B,{type:"null"}];break}case"nonoptional":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"success":{let B=H;B.type="boolean";break}case"default":{this.process(b.innerType,Y),D.ref=b.innerType,H.default=JSON.parse(JSON.stringify(b.defaultValue));break}case"prefault":{if(this.process(b.innerType,Y),D.ref=b.innerType,this.io==="input")H._prefault=JSON.parse(JSON.stringify(b.defaultValue));break}case"catch":{this.process(b.innerType,Y),D.ref=b.innerType;let B;try{B=b.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}H.default=B;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let B=H,A=$._zod.pattern;if(!A)throw new Error("Pattern not found in template literal");B.type="string",B.pattern=A.source;break}case"pipe":{let B=this.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;this.process(B,Y),D.ref=B;break}case"readonly":{this.process(b.innerType,Y),D.ref=b.innerType,H.readOnly=!0;break}case"promise":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"optional":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"lazy":{let B=$._zod.innerType;this.process(B,Y),D.ref=B;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 Y=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")}#/${Y}/${V}`}}if(G[1]===b)return{ref:"#"};let H=`${"#"}/${Y}/`,B=G[1].schema.id??`__schema${this.counter++}`;return{defId:B,ref:H+B}},X=(G)=>{if(G[1].schema.$ref)return;let Y=G[1],{ref:J,defId:H}=w(G);if(Y.def={...Y.schema},H)Y.defId=H;let B=Y.schema;for(let A in B)delete B[A];B.$ref=J};if(U.cycles==="throw")for(let G of this.seen.entries()){let Y=G[1];if(Y.cycle)throw new Error(`Cycle detected: #/${Y.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 Y=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(Y.cycle){X(G);continue}if(Y.count>1){if(U.reused==="ref"){X(G);continue}}}let D=(G,Y)=>{let J=this.seen.get(G),H=J.def??J.schema,B={...H};if(J.ref===null)return;let A=J.ref;if(J.ref=null,A){D(A,Y);let O=this.seen.get(A).schema;if(O.$ref&&Y.target==="draft-7")H.allOf=H.allOf??[],H.allOf.push(O);else Object.assign(H,O),Object.assign(H,B)}if(!J.isParent)this.override({zodSchema:G,jsonSchema:H,path:J.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 Y=G[1];if(Y.def&&Y.defId)Q[Y.defId]=Y.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 U8($,I){if($ instanceof Vw){let b=new I8(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 I8(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 xE=v("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");Y$.init($,I),$.def=I,$.parse=(U,b)=>zW($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>r4($,U,b),$.parseAsync=async(U,b)=>KW($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>n4($,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 hE=v("ZodMiniObject",($,I)=>{Kw.init($,I),xE.init($,I),I$.defineLazy($,"shape",()=>I.shape)});function w8($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new hE(U)}function B6($){return!!$._zod}function d4($){let I=Object.values($);if(I.length===0)return w8({});let U=I.every(B6),b=I.every((w)=>!B6(w));if(U)return w8($);if(b)return uH($);throw new Error("Mixed Zod versions detected in object shape.")}function B4($,I){if(B6($))return r4($,I);return $.safeParse(I)}async function Pw($,I){if(B6($))return await n4($,I);return await $.safeParseAsync(I)}function H4($){if(!$)return;let I;if(B6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function M1($){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 d4($)}}if(B6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function kw($){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 wO($){return $.description}function bO($){if(B6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function Rw($){if(B6($)){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 sI={};v6(sI,{time:()=>D8,duration:()=>W8,datetime:()=>b8,date:()=>X8,ZodISOTime:()=>WO,ZodISODuration:()=>QO,ZodISODateTime:()=>XO,ZodISODate:()=>DO});var XO=v("ZodISODateTime",($,I)=>{nA.init($,I),v$.init($,I)});function b8($){return aA(XO,$)}var DO=v("ZodISODate",($,I)=>{iA.init($,I),v$.init($,I)});function X8($){return eA(DO,$)}var WO=v("ZodISOTime",($,I)=>{oA.init($,I),v$.init($,I)});function D8($){return sA(WO,$)}var QO=v("ZodISODuration",($,I)=>{dA.init($,I),v$.init($,I)});function W8($){return $O(QO,$)}var GO=($,I)=>{Aw.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>AW($,U)},flatten:{value:(U)=>HW($,U)},addIssue:{value:(U)=>$.issues.push(U)},addIssues:{value:(U)=>$.issues.push(...U)},isEmpty:{get(){return $.issues.length===0}}})},Im=v("ZodError",GO),$U=v("ZodError",GO,{Parent:Error});var YO=OW($U),NO=LW($U),JO=vW($U),BO=VW($U);var j$=v("ZodType",($,I)=>{return Y$.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)=>YO($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>JO($,U,b),$.parseAsync=async(U,b)=>NO($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>BO($,U,b),$.spa=$.safeParseAsync,$.refine=(U,b)=>$.check(CS(U,b)),$.superRefine=(U)=>$.check(gS(U)),$.overwrite=(U)=>$.check(i4(U)),$.optional=()=>F$($),$.nullable=()=>OO($),$.nullish=()=>F$(OO($)),$.nonoptional=(U)=>SS($,U),$.array=()=>w$($),$.or=(U)=>L$([$,U]),$.and=(U)=>_w($,U),$.transform=(U)=>G8($,VO(U)),$.default=(U)=>FS($,U),$.prefault=(U)=>ES($,U),$.catch=(U)=>kS($,U),$.pipe=(U)=>G8($,U),$.readonly=()=>_S($),$.describe=(U)=>{let b=$.clone();return J4.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return J4.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return J4.get($);let b=$.clone();return J4.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),zO=v("_ZodString",($,I)=>{tI.init($,I),j$.init($,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(m9(...b)),$.includes=(...b)=>$.check(i9(...b)),$.startsWith=(...b)=>$.check(o9(...b)),$.endsWith=(...b)=>$.check(d9(...b)),$.min=(...b)=>$.check(q1(...b)),$.max=(...b)=>$.check(Ew(...b)),$.length=(...b)=>$.check(Sw(...b)),$.nonempty=(...b)=>$.check(q1(1,...b)),$.lowercase=(b)=>$.check(r9(b)),$.uppercase=(b)=>$.check(n9(b)),$.trim=()=>$.check(t9()),$.normalize=(...b)=>$.check(p9(...b)),$.toLowerCase=()=>$.check(a9()),$.toUpperCase=()=>$.check(e9())}),iE=v("ZodString",($,I)=>{tI.init($,I),zO.init($,I),$.email=(U)=>$.check(O9(oE,U)),$.url=(U)=>$.check(V9(dE,U)),$.jwt=(U)=>$.check(x9(GS,U)),$.emoji=(U)=>$.check(q9(pE,U)),$.guid=(U)=>$.check(qw(HO,U)),$.uuid=(U)=>$.check(z9(Tw,U)),$.uuidv4=(U)=>$.check(L9(Tw,U)),$.uuidv6=(U)=>$.check(K9(Tw,U)),$.uuidv7=(U)=>$.check(v9(Tw,U)),$.nanoid=(U)=>$.check(M9(tE,U)),$.guid=(U)=>$.check(qw(HO,U)),$.cuid=(U)=>$.check(F9(aE,U)),$.cuid2=(U)=>$.check(j9(eE,U)),$.ulid=(U)=>$.check(E9(sE,U)),$.base64=(U)=>$.check(Z9(DS,U)),$.base64url=(U)=>$.check(C9(WS,U)),$.xid=(U)=>$.check(S9($S,U)),$.ksuid=(U)=>$.check(P9(IS,U)),$.ipv4=(U)=>$.check(k9(US,U)),$.ipv6=(U)=>$.check(R9(wS,U)),$.cidrv4=(U)=>$.check(T9(bS,U)),$.cidrv6=(U)=>$.check(_9(XS,U)),$.e164=(U)=>$.check(g9(QS,U)),$.datetime=(U)=>$.check(b8(U)),$.date=(U)=>$.check(X8(U)),$.time=(U)=>$.check(D8(U)),$.duration=(U)=>$.check(W8(U))});function K($){return A9(iE,$)}var v$=v("ZodStringFormat",($,I)=>{z$.init($,I),zO.init($,I)}),oE=v("ZodEmail",($,I)=>{RW.init($,I),v$.init($,I)});var HO=v("ZodGUID",($,I)=>{PW.init($,I),v$.init($,I)});var Tw=v("ZodUUID",($,I)=>{kW.init($,I),v$.init($,I)});var dE=v("ZodURL",($,I)=>{TW.init($,I),v$.init($,I)});var pE=v("ZodEmoji",($,I)=>{_W.init($,I),v$.init($,I)});var tE=v("ZodNanoID",($,I)=>{ZW.init($,I),v$.init($,I)});var aE=v("ZodCUID",($,I)=>{CW.init($,I),v$.init($,I)});var eE=v("ZodCUID2",($,I)=>{gW.init($,I),v$.init($,I)});var sE=v("ZodULID",($,I)=>{xW.init($,I),v$.init($,I)});var $S=v("ZodXID",($,I)=>{hW.init($,I),v$.init($,I)});var IS=v("ZodKSUID",($,I)=>{fW.init($,I),v$.init($,I)});var US=v("ZodIPv4",($,I)=>{yW.init($,I),v$.init($,I)});var wS=v("ZodIPv6",($,I)=>{uW.init($,I),v$.init($,I)});var bS=v("ZodCIDRv4",($,I)=>{lW.init($,I),v$.init($,I)});var XS=v("ZodCIDRv6",($,I)=>{cW.init($,I),v$.init($,I)});var DS=v("ZodBase64",($,I)=>{mW.init($,I),v$.init($,I)});var WS=v("ZodBase64URL",($,I)=>{rW.init($,I),v$.init($,I)});var QS=v("ZodE164",($,I)=>{nW.init($,I),v$.init($,I)});var GS=v("ZodJWT",($,I)=>{iW.init($,I),v$.init($,I)});var LO=v("ZodNumber",($,I)=>{Lw.init($,I),j$.init($,I),$.gt=(b,w)=>$.check(Fw(b,w)),$.gte=(b,w)=>$.check(eI(b,w)),$.min=(b,w)=>$.check(eI(b,w)),$.lt=(b,w)=>$.check(Mw(b,w)),$.lte=(b,w)=>$.check(aI(b,w)),$.max=(b,w)=>$.check(aI(b,w)),$.int=(b)=>$.check(AO(b)),$.safe=(b)=>$.check(AO(b)),$.positive=(b)=>$.check(Fw(0,b)),$.nonnegative=(b)=>$.check(eI(0,b)),$.negative=(b)=>$.check(Mw(0,b)),$.nonpositive=(b)=>$.check(aI(0,b)),$.multipleOf=(b,w)=>$.check(jw(b,w)),$.step=(b,w)=>$.check(jw(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 h9(LO,$)}var YS=v("ZodNumberFormat",($,I)=>{oW.init($,I),LO.init($,I)});function AO($){return f9(YS,$)}var NS=v("ZodBoolean",($,I)=>{dW.init($,I),j$.init($,I)});function T$($){return y9(NS,$)}var JS=v("ZodNull",($,I)=>{pW.init($,I),j$.init($,I)});function Y8($){return u9(JS,$)}var BS=v("ZodUnknown",($,I)=>{tW.init($,I),j$.init($,I)});function V$(){return l9(BS)}var HS=v("ZodNever",($,I)=>{aW.init($,I),j$.init($,I)});function AS($){return c9(HS,$)}var OS=v("ZodArray",($,I)=>{eW.init($,I),j$.init($,I),$.element=I.element,$.min=(U,b)=>$.check(q1(U,b)),$.nonempty=(U)=>$.check(q1(1,U)),$.max=(U,b)=>$.check(Ew(U,b)),$.length=(U,b)=>$.check(Sw(U,b)),$.unwrap=()=>$.element});function w$($,I){return IO(OS,$,I)}var KO=v("ZodObject",($,I)=>{Kw.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:AS()}),$.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(qO,$,U[0]),$.required=(...U)=>I$.required(MO,$,U[0])});function C($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new KO(U)}function m$($,I){return new KO({type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},catchall:V$(),...I$.normalizeParams(I)})}var vO=v("ZodUnion",($,I)=>{vw.init($,I),j$.init($,I),$.options=I.options});function L$($,I){return new vO({type:"union",options:$,...I$.normalizeParams(I)})}var zS=v("ZodDiscriminatedUnion",($,I)=>{vO.init($,I),sW.init($,I)});function N8($,I,U){return new zS({type:"union",options:I,discriminator:$,...I$.normalizeParams(U)})}var LS=v("ZodIntersection",($,I)=>{$9.init($,I),j$.init($,I)});function _w($,I){return new LS({type:"intersection",left:$,right:I})}var KS=v("ZodRecord",($,I)=>{I9.init($,I),j$.init($,I),$.keyType=I.keyType,$.valueType=I.valueType});function q$($,I,U){return new KS({type:"record",keyType:$,valueType:I,...I$.normalizeParams(U)})}var Q8=v("ZodEnum",($,I)=>{U9.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 Q8({...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 Q8({...I,checks:[],...I$.normalizeParams(w),entries:X})}});function a$($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new Q8({type:"enum",entries:U,...I$.normalizeParams(I)})}var vS=v("ZodLiteral",($,I)=>{w9.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 y($,I){return new vS({type:"literal",values:Array.isArray($)?$:[$],...I$.normalizeParams(I)})}var VS=v("ZodTransform",($,I)=>{b9.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 VO($){return new VS({type:"transform",transform:$})}var qO=v("ZodOptional",($,I)=>{X9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function F$($){return new qO({type:"optional",innerType:$})}var qS=v("ZodNullable",($,I)=>{D9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function OO($){return new qS({type:"nullable",innerType:$})}var MS=v("ZodDefault",($,I)=>{W9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function FS($,I){return new MS({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var jS=v("ZodPrefault",($,I)=>{Q9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function ES($,I){return new jS({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var MO=v("ZodNonOptional",($,I)=>{G9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function SS($,I){return new MO({type:"nonoptional",innerType:$,...I$.normalizeParams(I)})}var PS=v("ZodCatch",($,I)=>{Y9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function kS($,I){return new PS({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var RS=v("ZodPipe",($,I)=>{N9.init($,I),j$.init($,I),$.in=I.in,$.out=I.out});function G8($,I){return new RS({type:"pipe",in:$,out:I})}var TS=v("ZodReadonly",($,I)=>{J9.init($,I),j$.init($,I)});function _S($){return new TS({type:"readonly",innerType:$})}var FO=v("ZodCustom",($,I)=>{B9.init($,I),j$.init($,I)});function ZS($){let I=new Z$({check:"custom"});return I._zod.check=$,I}function jO($,I){return s9(FO,$??(()=>!0),I)}function CS($,I={}){return $8(FO,$,I)}function gS($){let I=ZS((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 J8($,I){return G8(VO($),I)}D6(H9());var B8="2025-11-25";var EO=[B8,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],A4="io.modelcontextprotocol/related-task",Cw="2.0",C$=jO(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),SO=L$([K(),Q$().int()]),PO=K(),Am=m$({ttl:L$([Q$(),Y8()]).optional(),pollInterval:Q$().optional()}),xS=C({ttl:Q$().optional()}),hS=C({taskId:K()}),H8=m$({progressToken:SO.optional(),[A4]:hS.optional()}),Q6=C({_meta:H8.optional()}),IU=Q6.extend({task:xS.optional()}),kO=($)=>IU.safeParse($).success,g$=C({method:K(),params:Q6.loose().optional()}),H6=C({_meta:H8.optional()}),A6=C({method:K(),params:H6.loose().optional()}),x$=m$({_meta:H8.optional()}),gw=L$([K(),Q$().int()]),RO=C({jsonrpc:y(Cw),id:gw,...g$.shape}).strict(),A8=($)=>RO.safeParse($).success,TO=C({jsonrpc:y(Cw),...A6.shape}).strict(),_O=($)=>TO.safeParse($).success,O8=C({jsonrpc:y(Cw),id:gw,result:x$}).strict(),UU=($)=>O8.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 z8=C({jsonrpc:y(Cw),id:gw.optional(),error:C({code:Q$().int(),message:K(),data:V$().optional()})}).strict();var ZO=($)=>z8.safeParse($).success;var CO=L$([RO,TO,O8,z8]),Om=L$([O8,z8]),xw=x$.strict(),fS=H6.extend({requestId:gw.optional(),reason:K().optional()}),hw=A6.extend({method:y("notifications/cancelled"),params:fS}),yS=C({src:K(),mimeType:K().optional(),sizes:w$(K()).optional(),theme:a$(["light","dark"]).optional()}),wU=C({icons:w$(yS).optional()}),F1=C({name:K(),title:K().optional()}),gO=F1.extend({...F1.shape,...wU.shape,version:K(),websiteUrl:K().optional(),description:K().optional()}),uS=_w(C({applyDefaults:T$().optional()}),q$(K(),V$())),lS=J8(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},_w(C({form:uS.optional(),url:C$.optional()}),q$(K(),V$()).optional())),cS=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()}),rS=C({experimental:q$(K(),C$).optional(),sampling:C({context:C$.optional(),tools:C$.optional()}).optional(),elicitation:lS.optional(),roots:C({listChanged:T$().optional()}).optional(),tasks:cS.optional()}),nS=Q6.extend({protocolVersion:K(),capabilities:rS,clientInfo:gO}),L8=g$.extend({method:y("initialize"),params:nS});var iS=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()}),oS=x$.extend({protocolVersion:K(),capabilities:iS,serverInfo:gO,instructions:K().optional()}),K8=A6.extend({method:y("notifications/initialized"),params:H6.optional()});var fw=g$.extend({method:y("ping"),params:Q6.optional()}),dS=C({progress:Q$(),total:F$(Q$()),message:F$(K())}),pS=C({...H6.shape,...dS.shape,progressToken:SO}),yw=A6.extend({method:y("notifications/progress"),params:pS}),tS=Q6.extend({cursor:PO.optional()}),bU=g$.extend({params:tS.optional()}),XU=x$.extend({nextCursor:PO.optional()}),aS=a$(["working","input_required","completed","failed","cancelled"]),DU=C({taskId:K(),status:aS,ttl:L$([Q$(),Y8()]),createdAt:K(),lastUpdatedAt:K(),pollInterval:F$(Q$()),statusMessage:F$(K())}),j1=x$.extend({task:DU}),eS=H6.merge(DU),WU=A6.extend({method:y("notifications/tasks/status"),params:eS}),uw=g$.extend({method:y("tasks/get"),params:Q6.extend({taskId:K()})}),lw=x$.merge(DU),cw=g$.extend({method:y("tasks/result"),params:Q6.extend({taskId:K()})}),zm=x$.loose(),mw=bU.extend({method:y("tasks/list")}),rw=XU.extend({tasks:w$(DU)}),nw=g$.extend({method:y("tasks/cancel"),params:Q6.extend({taskId:K()})}),xO=x$.merge(DU),hO=C({uri:K(),mimeType:F$(K()),_meta:q$(K(),V$()).optional()}),fO=hO.extend({text:K()}),v8=K().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),yO=hO.extend({blob:v8}),QU=a$(["user","assistant"]),E1=C({audience:w$(QU).optional(),priority:Q$().min(0).max(1).optional(),lastModified:sI.datetime({offset:!0}).optional()}),uO=C({...F1.shape,...wU.shape,uri:K(),description:F$(K()),mimeType:F$(K()),annotations:E1.optional(),_meta:F$(m$({}))}),sS=C({...F1.shape,...wU.shape,uriTemplate:K(),description:F$(K()),mimeType:F$(K()),annotations:E1.optional(),_meta:F$(m$({}))}),iw=bU.extend({method:y("resources/list")}),$P=XU.extend({resources:w$(uO)}),ow=bU.extend({method:y("resources/templates/list")}),IP=XU.extend({resourceTemplates:w$(sS)}),V8=Q6.extend({uri:K()}),UP=V8,dw=g$.extend({method:y("resources/read"),params:UP}),wP=x$.extend({contents:w$(L$([fO,yO]))}),bP=A6.extend({method:y("notifications/resources/list_changed"),params:H6.optional()}),XP=V8,DP=g$.extend({method:y("resources/subscribe"),params:XP}),WP=V8,QP=g$.extend({method:y("resources/unsubscribe"),params:WP}),GP=H6.extend({uri:K()}),YP=A6.extend({method:y("notifications/resources/updated"),params:GP}),NP=C({name:K(),description:F$(K()),required:F$(T$())}),JP=C({...F1.shape,...wU.shape,description:F$(K()),arguments:F$(w$(NP)),_meta:F$(m$({}))}),pw=bU.extend({method:y("prompts/list")}),BP=XU.extend({prompts:w$(JP)}),HP=Q6.extend({name:K(),arguments:q$(K(),K()).optional()}),tw=g$.extend({method:y("prompts/get"),params:HP}),q8=C({type:y("text"),text:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),M8=C({type:y("image"),data:v8,mimeType:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),F8=C({type:y("audio"),data:v8,mimeType:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),AP=C({type:y("tool_use"),name:K(),id:K(),input:q$(K(),V$()),_meta:q$(K(),V$()).optional()}),OP=C({type:y("resource"),resource:L$([fO,yO]),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),zP=uO.extend({type:y("resource_link")}),j8=L$([q8,M8,F8,zP,OP]),LP=C({role:QU,content:j8}),KP=x$.extend({description:K().optional(),messages:w$(LP)}),vP=A6.extend({method:y("notifications/prompts/list_changed"),params:H6.optional()}),VP=C({title:K().optional(),readOnlyHint:T$().optional(),destructiveHint:T$().optional(),idempotentHint:T$().optional(),openWorldHint:T$().optional()}),qP=C({taskSupport:a$(["required","optional","forbidden"]).optional()}),lO=C({...F1.shape,...wU.shape,description:K().optional(),inputSchema:C({type:y("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()),outputSchema:C({type:y("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()).optional(),annotations:VP.optional(),execution:qP.optional(),_meta:q$(K(),V$()).optional()}),aw=bU.extend({method:y("tools/list")}),MP=XU.extend({tools:w$(lO)}),ew=x$.extend({content:w$(j8).default([]),structuredContent:q$(K(),V$()).optional(),isError:T$().optional()}),Lm=ew.or(x$.extend({toolResult:V$()})),FP=IU.extend({name:K(),arguments:q$(K(),V$()).optional()}),S1=g$.extend({method:y("tools/call"),params:FP}),jP=A6.extend({method:y("notifications/tools/list_changed"),params:H6.optional()}),Km=C({autoRefresh:T$().default(!0),debounceMs:Q$().int().nonnegative().default(300)}),GU=a$(["debug","info","notice","warning","error","critical","alert","emergency"]),EP=Q6.extend({level:GU}),E8=g$.extend({method:y("logging/setLevel"),params:EP}),SP=H6.extend({level:GU,logger:K().optional(),data:V$()}),PP=A6.extend({method:y("notifications/message"),params:SP}),kP=C({name:K().optional()}),RP=C({hints:w$(kP).optional(),costPriority:Q$().min(0).max(1).optional(),speedPriority:Q$().min(0).max(1).optional(),intelligencePriority:Q$().min(0).max(1).optional()}),TP=C({mode:a$(["auto","required","none"]).optional()}),_P=C({type:y("tool_result"),toolUseId:K().describe("The unique identifier for the corresponding tool call."),content:w$(j8).default([]),structuredContent:C({}).loose().optional(),isError:T$().optional(),_meta:q$(K(),V$()).optional()}),ZP=N8("type",[q8,M8,F8]),Zw=N8("type",[q8,M8,F8,AP,_P]),CP=C({role:QU,content:L$([Zw,w$(Zw)]),_meta:q$(K(),V$()).optional()}),gP=IU.extend({messages:w$(CP),modelPreferences:RP.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$(lO).optional(),toolChoice:TP.optional()}),xP=g$.extend({method:y("sampling/createMessage"),params:gP}),S8=x$.extend({model:K(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens"]).or(K())),role:QU,content:ZP}),P8=x$.extend({model:K(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens","toolUse"]).or(K())),role:QU,content:L$([Zw,w$(Zw)])}),hP=C({type:y("boolean"),title:K().optional(),description:K().optional(),default:T$().optional()}),fP=C({type:y("string"),title:K().optional(),description:K().optional(),minLength:Q$().optional(),maxLength:Q$().optional(),format:a$(["email","uri","date","date-time"]).optional(),default:K().optional()}),yP=C({type:a$(["number","integer"]),title:K().optional(),description:K().optional(),minimum:Q$().optional(),maximum:Q$().optional(),default:Q$().optional()}),uP=C({type:y("string"),title:K().optional(),description:K().optional(),enum:w$(K()),default:K().optional()}),lP=C({type:y("string"),title:K().optional(),description:K().optional(),oneOf:w$(C({const:K(),title:K()})),default:K().optional()}),cP=C({type:y("string"),title:K().optional(),description:K().optional(),enum:w$(K()),enumNames:w$(K()).optional(),default:K().optional()}),mP=L$([uP,lP]),rP=C({type:y("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({type:y("string"),enum:w$(K())}),default:w$(K()).optional()}),nP=C({type:y("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()}),iP=L$([rP,nP]),oP=L$([cP,mP,iP]),dP=L$([oP,hP,fP,yP]),pP=IU.extend({mode:y("form").optional(),message:K(),requestedSchema:C({type:y("object"),properties:q$(K(),dP),required:w$(K()).optional()})}),tP=IU.extend({mode:y("url"),message:K(),elicitationId:K(),url:K().url()}),aP=L$([pP,tP]),eP=g$.extend({method:y("elicitation/create"),params:aP}),sP=H6.extend({elicitationId:K()}),$k=A6.extend({method:y("notifications/elicitation/complete"),params:sP}),sw=x$.extend({action:a$(["accept","decline","cancel"]),content:J8(($)=>$===null?void 0:$,q$(K(),L$([K(),Q$(),T$(),w$(K())])).optional())}),Ik=C({type:y("ref/resource"),uri:K()});var Uk=C({type:y("ref/prompt"),name:K()}),wk=Q6.extend({ref:L$([Uk,Ik]),argument:C({name:K(),value:K()}),context:C({arguments:q$(K(),K()).optional()}).optional()}),$b=g$.extend({method:y("completion/complete"),params:wk});function cO($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function mO($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var bk=x$.extend({completion:m$({values:w$(K()).max(100),total:F$(Q$().int()),hasMore:F$(T$())})}),Xk=C({uri:K().startsWith("file://"),name:K().optional(),_meta:q$(K(),V$()).optional()}),Dk=g$.extend({method:y("roots/list"),params:Q6.optional()}),k8=x$.extend({roots:w$(Xk)}),Wk=A6.extend({method:y("notifications/roots/list_changed"),params:H6.optional()}),vm=L$([fw,L8,$b,E8,tw,pw,iw,ow,dw,DP,QP,S1,aw,uw,cw,mw,nw]),Vm=L$([hw,yw,K8,Wk,WU]),qm=L$([xw,S8,P8,sw,k8,lw,rw,j1]),Mm=L$([fw,xP,eP,Dk,uw,cw,mw,nw]),Fm=L$([hw,yw,PP,YP,bP,jP,vP,WU,$k]),jm=L$([xw,oS,bk,KP,BP,$P,IP,wP,ew,MP,lw,rw,j1]);class f 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 rO(b.elicitations,I)}return new f($,I,U)}}class rO extends f{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(c.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function O4($){return $==="completed"||$==="failed"||$==="cancelled"}var iO=Symbol("Let zodToJsonSchema decide on which parser to use");var nO={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"},oO=($)=>typeof $==="string"?{...nO,name:$}:{...nO,...$};var dO=($)=>{let I=oO($),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 R8($,I,U,b){if(!b?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function b$($,I,U,b,w){$[I]=U,R8($,I,b,w)}var Ib=($,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 M$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?Ib(I,$.currentPath):I.join("/")}}function pO($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==F.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 tO($,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 aO(){return{type:"boolean"}}function Ub($,I){return n($.type._def,I)}var eO=($,I)=>{return n($.innerType._def,I)};function T8($,I,U){let b=U??I.dateStrategy;if(Array.isArray(b))return{anyOf:b.map((w,X)=>T8($,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 Qk($,I)}}var Qk=($,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 sO($,I){return{...n($.innerType._def,I),default:$.defaultValue()}}function $z($,I){return I.effectStrategy==="input"?n($.schema._def,I):M$(I)}function Iz($){return{type:"string",enum:Array.from($.values)}}var Gk=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function Uz($,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(Gk(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 wz($,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 _8=void 0,M6={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(_8===void 0)_8=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return _8},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 wb($,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":F6(U,"email",b.message,I);break;case"format:idn-email":F6(U,"idn-email",b.message,I);break;case"pattern:zod":r$(U,M6.email,b.message,I);break}break;case"url":F6(U,"uri",b.message,I);break;case"uuid":F6(U,"uuid",b.message,I);break;case"regex":r$(U,b.regex,b.message,I);break;case"cuid":r$(U,M6.cuid,b.message,I);break;case"cuid2":r$(U,M6.cuid2,b.message,I);break;case"startsWith":r$(U,RegExp(`^${Z8(b.value,I)}`),b.message,I);break;case"endsWith":r$(U,RegExp(`${Z8(b.value,I)}$`),b.message,I);break;case"datetime":F6(U,"date-time",b.message,I);break;case"date":F6(U,"date",b.message,I);break;case"time":F6(U,"time",b.message,I);break;case"duration":F6(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(Z8(b.value,I)),b.message,I);break}case"ip":{if(b.version!=="v6")F6(U,"ipv4",b.message,I);if(b.version!=="v4")F6(U,"ipv6",b.message,I);break}case"base64url":r$(U,M6.base64url,b.message,I);break;case"jwt":r$(U,M6.jwt,b.message,I);break;case"cidr":{if(b.version!=="v6")r$(U,M6.ipv4Cidr,b.message,I);if(b.version!=="v4")r$(U,M6.ipv6Cidr,b.message,I);break}case"emoji":r$(U,M6.emoji(),b.message,I);break;case"ulid":{r$(U,M6.ulid,b.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{F6(U,"binary",b.message,I);break}case"contentEncoding:base64":{b$(U,"contentEncoding","base64",b.message,I);break}case"pattern:zod":{r$(U,M6.base64,b.message,I);break}}break}case"nanoid":r$(U,M6.nanoid,b.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((w)=>{})(b)}return U}function Z8($,I){return I.patternStrategy==="escape"?Nk($):$}var Yk=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Nk($){let I="";for(let U=0;U<$.length;U++){if(!Yk.has($[U]))I+="\\";I+=$[U]}return I}function F6($,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:bz(I,b),...U&&b.errorMessages&&{errorMessage:{pattern:U}}})}else b$($,"pattern",bz(I,b),U,b)}function bz($,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 Y=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(Y.cycle){X(G);continue}if(Y.count>1){if(U.reused==="ref"){X(G);continue}}}let D=(G,Y)=>{let J=this.seen.get(G),H=J.def??J.schema,B={...H};if(J.ref===null)return;let A=J.ref;if(J.ref=null,A){D(A,Y);let O=this.seen.get(A).schema;if(O.$ref&&Y.target==="draft-7")H.allOf=H.allOf??[],H.allOf.push(O);else Object.assign(H,O),Object.assign(H,B)}if(!J.isParent)this.override({zodSchema:G,jsonSchema:H,path:J.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 Y=G[1];if(Y.def&&Y.defId)Q[Y.defId]=Y.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 U8($,I){if($ instanceof Vw){let b=new I8(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 I8(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 gE=v("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");Y$.init($,I),$.def=I,$.parse=(U,b)=>zW($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>r4($,U,b),$.parseAsync=async(U,b)=>KW($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>n4($,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 xE=v("ZodMiniObject",($,I)=>{Kw.init($,I),gE.init($,I),I$.defineLazy($,"shape",()=>I.shape)});function w8($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new xE(U)}function B6($){return!!$._zod}function d4($){let I=Object.values($);if(I.length===0)return w8({});let U=I.every(B6),b=I.every((w)=>!B6(w));if(U)return w8($);if(b)return yH($);throw new Error("Mixed Zod versions detected in object shape.")}function B4($,I){if(B6($))return r4($,I);return $.safeParse(I)}async function Pw($,I){if(B6($))return await n4($,I);return await $.safeParseAsync(I)}function H4($){if(!$)return;let I;if(B6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function M1($){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 d4($)}}if(B6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function kw($){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 UO($){return $.description}function wO($){if(B6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function Rw($){if(B6($)){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 sI={};v6(sI,{time:()=>D8,duration:()=>W8,datetime:()=>b8,date:()=>X8,ZodISOTime:()=>DO,ZodISODuration:()=>WO,ZodISODateTime:()=>bO,ZodISODate:()=>XO});var bO=v("ZodISODateTime",($,I)=>{rA.init($,I),v$.init($,I)});function b8($){return tA(bO,$)}var XO=v("ZodISODate",($,I)=>{nA.init($,I),v$.init($,I)});function X8($){return aA(XO,$)}var DO=v("ZodISOTime",($,I)=>{iA.init($,I),v$.init($,I)});function D8($){return eA(DO,$)}var WO=v("ZodISODuration",($,I)=>{oA.init($,I),v$.init($,I)});function W8($){return sA(WO,$)}var QO=($,I)=>{Aw.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>AW($,U)},flatten:{value:(U)=>HW($,U)},addIssue:{value:(U)=>$.issues.push(U)},addIssues:{value:(U)=>$.issues.push(...U)},isEmpty:{get(){return $.issues.length===0}}})},Im=v("ZodError",QO),$U=v("ZodError",QO,{Parent:Error});var GO=OW($U),YO=LW($U),NO=vW($U),JO=VW($U);var j$=v("ZodType",($,I)=>{return Y$.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)=>GO($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>NO($,U,b),$.parseAsync=async(U,b)=>YO($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>JO($,U,b),$.spa=$.safeParseAsync,$.refine=(U,b)=>$.check(ZS(U,b)),$.superRefine=(U)=>$.check(CS(U)),$.overwrite=(U)=>$.check(i4(U)),$.optional=()=>F$($),$.nullable=()=>AO($),$.nullish=()=>F$(AO($)),$.nonoptional=(U)=>ES($,U),$.array=()=>w$($),$.or=(U)=>L$([$,U]),$.and=(U)=>_w($,U),$.transform=(U)=>G8($,vO(U)),$.default=(U)=>MS($,U),$.prefault=(U)=>jS($,U),$.catch=(U)=>PS($,U),$.pipe=(U)=>G8($,U),$.readonly=()=>TS($),$.describe=(U)=>{let b=$.clone();return J4.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return J4.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return J4.get($);let b=$.clone();return J4.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),OO=v("_ZodString",($,I)=>{tI.init($,I),j$.init($,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(m9(...b)),$.includes=(...b)=>$.check(i9(...b)),$.startsWith=(...b)=>$.check(o9(...b)),$.endsWith=(...b)=>$.check(d9(...b)),$.min=(...b)=>$.check(q1(...b)),$.max=(...b)=>$.check(Ew(...b)),$.length=(...b)=>$.check(Sw(...b)),$.nonempty=(...b)=>$.check(q1(1,...b)),$.lowercase=(b)=>$.check(r9(b)),$.uppercase=(b)=>$.check(n9(b)),$.trim=()=>$.check(t9()),$.normalize=(...b)=>$.check(p9(...b)),$.toLowerCase=()=>$.check(a9()),$.toUpperCase=()=>$.check(e9())}),nE=v("ZodString",($,I)=>{tI.init($,I),OO.init($,I),$.email=(U)=>$.check(O9(iE,U)),$.url=(U)=>$.check(V9(oE,U)),$.jwt=(U)=>$.check(x9(QS,U)),$.emoji=(U)=>$.check(q9(dE,U)),$.guid=(U)=>$.check(qw(BO,U)),$.uuid=(U)=>$.check(z9(Tw,U)),$.uuidv4=(U)=>$.check(L9(Tw,U)),$.uuidv6=(U)=>$.check(K9(Tw,U)),$.uuidv7=(U)=>$.check(v9(Tw,U)),$.nanoid=(U)=>$.check(M9(pE,U)),$.guid=(U)=>$.check(qw(BO,U)),$.cuid=(U)=>$.check(F9(tE,U)),$.cuid2=(U)=>$.check(j9(aE,U)),$.ulid=(U)=>$.check(E9(eE,U)),$.base64=(U)=>$.check(Z9(XS,U)),$.base64url=(U)=>$.check(C9(DS,U)),$.xid=(U)=>$.check(S9(sE,U)),$.ksuid=(U)=>$.check(P9($S,U)),$.ipv4=(U)=>$.check(k9(IS,U)),$.ipv6=(U)=>$.check(R9(US,U)),$.cidrv4=(U)=>$.check(T9(wS,U)),$.cidrv6=(U)=>$.check(_9(bS,U)),$.e164=(U)=>$.check(g9(WS,U)),$.datetime=(U)=>$.check(b8(U)),$.date=(U)=>$.check(X8(U)),$.time=(U)=>$.check(D8(U)),$.duration=(U)=>$.check(W8(U))});function K($){return A9(nE,$)}var v$=v("ZodStringFormat",($,I)=>{z$.init($,I),OO.init($,I)}),iE=v("ZodEmail",($,I)=>{RW.init($,I),v$.init($,I)});var BO=v("ZodGUID",($,I)=>{PW.init($,I),v$.init($,I)});var Tw=v("ZodUUID",($,I)=>{kW.init($,I),v$.init($,I)});var oE=v("ZodURL",($,I)=>{TW.init($,I),v$.init($,I)});var dE=v("ZodEmoji",($,I)=>{_W.init($,I),v$.init($,I)});var pE=v("ZodNanoID",($,I)=>{ZW.init($,I),v$.init($,I)});var tE=v("ZodCUID",($,I)=>{CW.init($,I),v$.init($,I)});var aE=v("ZodCUID2",($,I)=>{gW.init($,I),v$.init($,I)});var eE=v("ZodULID",($,I)=>{xW.init($,I),v$.init($,I)});var sE=v("ZodXID",($,I)=>{hW.init($,I),v$.init($,I)});var $S=v("ZodKSUID",($,I)=>{fW.init($,I),v$.init($,I)});var IS=v("ZodIPv4",($,I)=>{yW.init($,I),v$.init($,I)});var US=v("ZodIPv6",($,I)=>{uW.init($,I),v$.init($,I)});var wS=v("ZodCIDRv4",($,I)=>{lW.init($,I),v$.init($,I)});var bS=v("ZodCIDRv6",($,I)=>{cW.init($,I),v$.init($,I)});var XS=v("ZodBase64",($,I)=>{mW.init($,I),v$.init($,I)});var DS=v("ZodBase64URL",($,I)=>{rW.init($,I),v$.init($,I)});var WS=v("ZodE164",($,I)=>{nW.init($,I),v$.init($,I)});var QS=v("ZodJWT",($,I)=>{iW.init($,I),v$.init($,I)});var zO=v("ZodNumber",($,I)=>{Lw.init($,I),j$.init($,I),$.gt=(b,w)=>$.check(Fw(b,w)),$.gte=(b,w)=>$.check(eI(b,w)),$.min=(b,w)=>$.check(eI(b,w)),$.lt=(b,w)=>$.check(Mw(b,w)),$.lte=(b,w)=>$.check(aI(b,w)),$.max=(b,w)=>$.check(aI(b,w)),$.int=(b)=>$.check(HO(b)),$.safe=(b)=>$.check(HO(b)),$.positive=(b)=>$.check(Fw(0,b)),$.nonnegative=(b)=>$.check(eI(0,b)),$.negative=(b)=>$.check(Mw(0,b)),$.nonpositive=(b)=>$.check(aI(0,b)),$.multipleOf=(b,w)=>$.check(jw(b,w)),$.step=(b,w)=>$.check(jw(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 h9(zO,$)}var GS=v("ZodNumberFormat",($,I)=>{oW.init($,I),zO.init($,I)});function HO($){return f9(GS,$)}var YS=v("ZodBoolean",($,I)=>{dW.init($,I),j$.init($,I)});function T$($){return y9(YS,$)}var NS=v("ZodNull",($,I)=>{pW.init($,I),j$.init($,I)});function Y8($){return u9(NS,$)}var JS=v("ZodUnknown",($,I)=>{tW.init($,I),j$.init($,I)});function V$(){return l9(JS)}var BS=v("ZodNever",($,I)=>{aW.init($,I),j$.init($,I)});function HS($){return c9(BS,$)}var AS=v("ZodArray",($,I)=>{eW.init($,I),j$.init($,I),$.element=I.element,$.min=(U,b)=>$.check(q1(U,b)),$.nonempty=(U)=>$.check(q1(1,U)),$.max=(U,b)=>$.check(Ew(U,b)),$.length=(U,b)=>$.check(Sw(U,b)),$.unwrap=()=>$.element});function w$($,I){return $O(AS,$,I)}var LO=v("ZodObject",($,I)=>{Kw.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:HS()}),$.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(VO,$,U[0]),$.required=(...U)=>I$.required(qO,$,U[0])});function C($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new LO(U)}function m$($,I){return new LO({type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},catchall:V$(),...I$.normalizeParams(I)})}var KO=v("ZodUnion",($,I)=>{vw.init($,I),j$.init($,I),$.options=I.options});function L$($,I){return new KO({type:"union",options:$,...I$.normalizeParams(I)})}var OS=v("ZodDiscriminatedUnion",($,I)=>{KO.init($,I),sW.init($,I)});function N8($,I,U){return new OS({type:"union",options:I,discriminator:$,...I$.normalizeParams(U)})}var zS=v("ZodIntersection",($,I)=>{$9.init($,I),j$.init($,I)});function _w($,I){return new zS({type:"intersection",left:$,right:I})}var LS=v("ZodRecord",($,I)=>{I9.init($,I),j$.init($,I),$.keyType=I.keyType,$.valueType=I.valueType});function q$($,I,U){return new LS({type:"record",keyType:$,valueType:I,...I$.normalizeParams(U)})}var Q8=v("ZodEnum",($,I)=>{U9.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 Q8({...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 Q8({...I,checks:[],...I$.normalizeParams(w),entries:X})}});function a$($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new Q8({type:"enum",entries:U,...I$.normalizeParams(I)})}var KS=v("ZodLiteral",($,I)=>{w9.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 y($,I){return new KS({type:"literal",values:Array.isArray($)?$:[$],...I$.normalizeParams(I)})}var vS=v("ZodTransform",($,I)=>{b9.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 vO($){return new vS({type:"transform",transform:$})}var VO=v("ZodOptional",($,I)=>{X9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function F$($){return new VO({type:"optional",innerType:$})}var VS=v("ZodNullable",($,I)=>{D9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function AO($){return new VS({type:"nullable",innerType:$})}var qS=v("ZodDefault",($,I)=>{W9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function MS($,I){return new qS({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var FS=v("ZodPrefault",($,I)=>{Q9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function jS($,I){return new FS({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var qO=v("ZodNonOptional",($,I)=>{G9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function ES($,I){return new qO({type:"nonoptional",innerType:$,...I$.normalizeParams(I)})}var SS=v("ZodCatch",($,I)=>{Y9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function PS($,I){return new SS({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var kS=v("ZodPipe",($,I)=>{N9.init($,I),j$.init($,I),$.in=I.in,$.out=I.out});function G8($,I){return new kS({type:"pipe",in:$,out:I})}var RS=v("ZodReadonly",($,I)=>{J9.init($,I),j$.init($,I)});function TS($){return new RS({type:"readonly",innerType:$})}var MO=v("ZodCustom",($,I)=>{B9.init($,I),j$.init($,I)});function _S($){let I=new Z$({check:"custom"});return I._zod.check=$,I}function FO($,I){return s9(MO,$??(()=>!0),I)}function ZS($,I={}){return $8(MO,$,I)}function CS($){let I=_S((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 J8($,I){return G8(vO($),I)}D6(H9());var B8="2025-11-25";var jO=[B8,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],A4="io.modelcontextprotocol/related-task",Cw="2.0",C$=FO(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),EO=L$([K(),Q$().int()]),SO=K(),Am=m$({ttl:L$([Q$(),Y8()]).optional(),pollInterval:Q$().optional()}),gS=C({ttl:Q$().optional()}),xS=C({taskId:K()}),H8=m$({progressToken:EO.optional(),[A4]:xS.optional()}),Q6=C({_meta:H8.optional()}),IU=Q6.extend({task:gS.optional()}),PO=($)=>IU.safeParse($).success,g$=C({method:K(),params:Q6.loose().optional()}),H6=C({_meta:H8.optional()}),A6=C({method:K(),params:H6.loose().optional()}),x$=m$({_meta:H8.optional()}),gw=L$([K(),Q$().int()]),kO=C({jsonrpc:y(Cw),id:gw,...g$.shape}).strict(),A8=($)=>kO.safeParse($).success,RO=C({jsonrpc:y(Cw),...A6.shape}).strict(),TO=($)=>RO.safeParse($).success,O8=C({jsonrpc:y(Cw),id:gw,result:x$}).strict(),UU=($)=>O8.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 z8=C({jsonrpc:y(Cw),id:gw.optional(),error:C({code:Q$().int(),message:K(),data:V$().optional()})}).strict();var _O=($)=>z8.safeParse($).success;var ZO=L$([kO,RO,O8,z8]),Om=L$([O8,z8]),xw=x$.strict(),hS=H6.extend({requestId:gw.optional(),reason:K().optional()}),hw=A6.extend({method:y("notifications/cancelled"),params:hS}),fS=C({src:K(),mimeType:K().optional(),sizes:w$(K()).optional(),theme:a$(["light","dark"]).optional()}),wU=C({icons:w$(fS).optional()}),F1=C({name:K(),title:K().optional()}),CO=F1.extend({...F1.shape,...wU.shape,version:K(),websiteUrl:K().optional(),description:K().optional()}),yS=_w(C({applyDefaults:T$().optional()}),q$(K(),V$())),uS=J8(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},_w(C({form:yS.optional(),url:C$.optional()}),q$(K(),V$()).optional())),lS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({sampling:m$({createMessage:C$.optional()}).optional(),elicitation:m$({create:C$.optional()}).optional()}).optional()}),cS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({tools:m$({call:C$.optional()}).optional()}).optional()}),mS=C({experimental:q$(K(),C$).optional(),sampling:C({context:C$.optional(),tools:C$.optional()}).optional(),elicitation:uS.optional(),roots:C({listChanged:T$().optional()}).optional(),tasks:lS.optional()}),rS=Q6.extend({protocolVersion:K(),capabilities:mS,clientInfo:CO}),L8=g$.extend({method:y("initialize"),params:rS});var nS=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:cS.optional()}),iS=x$.extend({protocolVersion:K(),capabilities:nS,serverInfo:CO,instructions:K().optional()}),K8=A6.extend({method:y("notifications/initialized"),params:H6.optional()});var fw=g$.extend({method:y("ping"),params:Q6.optional()}),oS=C({progress:Q$(),total:F$(Q$()),message:F$(K())}),dS=C({...H6.shape,...oS.shape,progressToken:EO}),yw=A6.extend({method:y("notifications/progress"),params:dS}),pS=Q6.extend({cursor:SO.optional()}),bU=g$.extend({params:pS.optional()}),XU=x$.extend({nextCursor:SO.optional()}),tS=a$(["working","input_required","completed","failed","cancelled"]),DU=C({taskId:K(),status:tS,ttl:L$([Q$(),Y8()]),createdAt:K(),lastUpdatedAt:K(),pollInterval:F$(Q$()),statusMessage:F$(K())}),j1=x$.extend({task:DU}),aS=H6.merge(DU),WU=A6.extend({method:y("notifications/tasks/status"),params:aS}),uw=g$.extend({method:y("tasks/get"),params:Q6.extend({taskId:K()})}),lw=x$.merge(DU),cw=g$.extend({method:y("tasks/result"),params:Q6.extend({taskId:K()})}),zm=x$.loose(),mw=bU.extend({method:y("tasks/list")}),rw=XU.extend({tasks:w$(DU)}),nw=g$.extend({method:y("tasks/cancel"),params:Q6.extend({taskId:K()})}),gO=x$.merge(DU),xO=C({uri:K(),mimeType:F$(K()),_meta:q$(K(),V$()).optional()}),hO=xO.extend({text:K()}),v8=K().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),fO=xO.extend({blob:v8}),QU=a$(["user","assistant"]),E1=C({audience:w$(QU).optional(),priority:Q$().min(0).max(1).optional(),lastModified:sI.datetime({offset:!0}).optional()}),yO=C({...F1.shape,...wU.shape,uri:K(),description:F$(K()),mimeType:F$(K()),annotations:E1.optional(),_meta:F$(m$({}))}),eS=C({...F1.shape,...wU.shape,uriTemplate:K(),description:F$(K()),mimeType:F$(K()),annotations:E1.optional(),_meta:F$(m$({}))}),iw=bU.extend({method:y("resources/list")}),sS=XU.extend({resources:w$(yO)}),ow=bU.extend({method:y("resources/templates/list")}),$P=XU.extend({resourceTemplates:w$(eS)}),V8=Q6.extend({uri:K()}),IP=V8,dw=g$.extend({method:y("resources/read"),params:IP}),UP=x$.extend({contents:w$(L$([hO,fO]))}),wP=A6.extend({method:y("notifications/resources/list_changed"),params:H6.optional()}),bP=V8,XP=g$.extend({method:y("resources/subscribe"),params:bP}),DP=V8,WP=g$.extend({method:y("resources/unsubscribe"),params:DP}),QP=H6.extend({uri:K()}),GP=A6.extend({method:y("notifications/resources/updated"),params:QP}),YP=C({name:K(),description:F$(K()),required:F$(T$())}),NP=C({...F1.shape,...wU.shape,description:F$(K()),arguments:F$(w$(YP)),_meta:F$(m$({}))}),pw=bU.extend({method:y("prompts/list")}),JP=XU.extend({prompts:w$(NP)}),BP=Q6.extend({name:K(),arguments:q$(K(),K()).optional()}),tw=g$.extend({method:y("prompts/get"),params:BP}),q8=C({type:y("text"),text:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),M8=C({type:y("image"),data:v8,mimeType:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),F8=C({type:y("audio"),data:v8,mimeType:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),HP=C({type:y("tool_use"),name:K(),id:K(),input:q$(K(),V$()),_meta:q$(K(),V$()).optional()}),AP=C({type:y("resource"),resource:L$([hO,fO]),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),OP=yO.extend({type:y("resource_link")}),j8=L$([q8,M8,F8,OP,AP]),zP=C({role:QU,content:j8}),LP=x$.extend({description:K().optional(),messages:w$(zP)}),KP=A6.extend({method:y("notifications/prompts/list_changed"),params:H6.optional()}),vP=C({title:K().optional(),readOnlyHint:T$().optional(),destructiveHint:T$().optional(),idempotentHint:T$().optional(),openWorldHint:T$().optional()}),VP=C({taskSupport:a$(["required","optional","forbidden"]).optional()}),uO=C({...F1.shape,...wU.shape,description:K().optional(),inputSchema:C({type:y("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()),outputSchema:C({type:y("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()).optional(),annotations:vP.optional(),execution:VP.optional(),_meta:q$(K(),V$()).optional()}),aw=bU.extend({method:y("tools/list")}),qP=XU.extend({tools:w$(uO)}),ew=x$.extend({content:w$(j8).default([]),structuredContent:q$(K(),V$()).optional(),isError:T$().optional()}),Lm=ew.or(x$.extend({toolResult:V$()})),MP=IU.extend({name:K(),arguments:q$(K(),V$()).optional()}),S1=g$.extend({method:y("tools/call"),params:MP}),FP=A6.extend({method:y("notifications/tools/list_changed"),params:H6.optional()}),Km=C({autoRefresh:T$().default(!0),debounceMs:Q$().int().nonnegative().default(300)}),GU=a$(["debug","info","notice","warning","error","critical","alert","emergency"]),jP=Q6.extend({level:GU}),E8=g$.extend({method:y("logging/setLevel"),params:jP}),EP=H6.extend({level:GU,logger:K().optional(),data:V$()}),SP=A6.extend({method:y("notifications/message"),params:EP}),PP=C({name:K().optional()}),kP=C({hints:w$(PP).optional(),costPriority:Q$().min(0).max(1).optional(),speedPriority:Q$().min(0).max(1).optional(),intelligencePriority:Q$().min(0).max(1).optional()}),RP=C({mode:a$(["auto","required","none"]).optional()}),TP=C({type:y("tool_result"),toolUseId:K().describe("The unique identifier for the corresponding tool call."),content:w$(j8).default([]),structuredContent:C({}).loose().optional(),isError:T$().optional(),_meta:q$(K(),V$()).optional()}),_P=N8("type",[q8,M8,F8]),Zw=N8("type",[q8,M8,F8,HP,TP]),ZP=C({role:QU,content:L$([Zw,w$(Zw)]),_meta:q$(K(),V$()).optional()}),CP=IU.extend({messages:w$(ZP),modelPreferences:kP.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$(uO).optional(),toolChoice:RP.optional()}),gP=g$.extend({method:y("sampling/createMessage"),params:CP}),S8=x$.extend({model:K(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens"]).or(K())),role:QU,content:_P}),P8=x$.extend({model:K(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens","toolUse"]).or(K())),role:QU,content:L$([Zw,w$(Zw)])}),xP=C({type:y("boolean"),title:K().optional(),description:K().optional(),default:T$().optional()}),hP=C({type:y("string"),title:K().optional(),description:K().optional(),minLength:Q$().optional(),maxLength:Q$().optional(),format:a$(["email","uri","date","date-time"]).optional(),default:K().optional()}),fP=C({type:a$(["number","integer"]),title:K().optional(),description:K().optional(),minimum:Q$().optional(),maximum:Q$().optional(),default:Q$().optional()}),yP=C({type:y("string"),title:K().optional(),description:K().optional(),enum:w$(K()),default:K().optional()}),uP=C({type:y("string"),title:K().optional(),description:K().optional(),oneOf:w$(C({const:K(),title:K()})),default:K().optional()}),lP=C({type:y("string"),title:K().optional(),description:K().optional(),enum:w$(K()),enumNames:w$(K()).optional(),default:K().optional()}),cP=L$([yP,uP]),mP=C({type:y("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({type:y("string"),enum:w$(K())}),default:w$(K()).optional()}),rP=C({type:y("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()}),nP=L$([mP,rP]),iP=L$([lP,cP,nP]),oP=L$([iP,xP,hP,fP]),dP=IU.extend({mode:y("form").optional(),message:K(),requestedSchema:C({type:y("object"),properties:q$(K(),oP),required:w$(K()).optional()})}),pP=IU.extend({mode:y("url"),message:K(),elicitationId:K(),url:K().url()}),tP=L$([dP,pP]),aP=g$.extend({method:y("elicitation/create"),params:tP}),eP=H6.extend({elicitationId:K()}),sP=A6.extend({method:y("notifications/elicitation/complete"),params:eP}),sw=x$.extend({action:a$(["accept","decline","cancel"]),content:J8(($)=>$===null?void 0:$,q$(K(),L$([K(),Q$(),T$(),w$(K())])).optional())}),$k=C({type:y("ref/resource"),uri:K()});var Ik=C({type:y("ref/prompt"),name:K()}),Uk=Q6.extend({ref:L$([Ik,$k]),argument:C({name:K(),value:K()}),context:C({arguments:q$(K(),K()).optional()}).optional()}),$b=g$.extend({method:y("completion/complete"),params:Uk});function lO($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function cO($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var wk=x$.extend({completion:m$({values:w$(K()).max(100),total:F$(Q$().int()),hasMore:F$(T$())})}),bk=C({uri:K().startsWith("file://"),name:K().optional(),_meta:q$(K(),V$()).optional()}),Xk=g$.extend({method:y("roots/list"),params:Q6.optional()}),k8=x$.extend({roots:w$(bk)}),Dk=A6.extend({method:y("notifications/roots/list_changed"),params:H6.optional()}),vm=L$([fw,L8,$b,E8,tw,pw,iw,ow,dw,XP,WP,S1,aw,uw,cw,mw,nw]),Vm=L$([hw,yw,K8,Dk,WU]),qm=L$([xw,S8,P8,sw,k8,lw,rw,j1]),Mm=L$([fw,gP,aP,Xk,uw,cw,mw,nw]),Fm=L$([hw,yw,SP,GP,wP,FP,KP,WU,sP]),jm=L$([xw,iS,wk,LP,JP,sS,$P,UP,ew,qP,lw,rw,j1]);class f 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 mO(b.elicitations,I)}return new f($,I,U)}}class mO extends f{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(c.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function O4($){return $==="completed"||$==="failed"||$==="cancelled"}var nO=Symbol("Let zodToJsonSchema decide on which parser to use");var rO={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"},iO=($)=>typeof $==="string"?{...rO,name:$}:{...rO,...$};var oO=($)=>{let I=iO($),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 R8($,I,U,b){if(!b?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function b$($,I,U,b,w){$[I]=U,R8($,I,b,w)}var Ib=($,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 M$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?Ib(I,$.currentPath):I.join("/")}}function dO($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==F.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 pO($,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 tO(){return{type:"boolean"}}function Ub($,I){return n($.type._def,I)}var aO=($,I)=>{return n($.innerType._def,I)};function T8($,I,U){let b=U??I.dateStrategy;if(Array.isArray(b))return{anyOf:b.map((w,X)=>T8($,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 Wk($,I)}}var Wk=($,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 eO($,I){return{...n($.innerType._def,I),default:$.defaultValue()}}function sO($,I){return I.effectStrategy==="input"?n($.schema._def,I):M$(I)}function $z($){return{type:"string",enum:Array.from($.values)}}var Qk=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function Iz($,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(Qk(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 Uz($,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 _8=void 0,M6={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(_8===void 0)_8=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return _8},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 wb($,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":F6(U,"email",b.message,I);break;case"format:idn-email":F6(U,"idn-email",b.message,I);break;case"pattern:zod":r$(U,M6.email,b.message,I);break}break;case"url":F6(U,"uri",b.message,I);break;case"uuid":F6(U,"uuid",b.message,I);break;case"regex":r$(U,b.regex,b.message,I);break;case"cuid":r$(U,M6.cuid,b.message,I);break;case"cuid2":r$(U,M6.cuid2,b.message,I);break;case"startsWith":r$(U,RegExp(`^${Z8(b.value,I)}`),b.message,I);break;case"endsWith":r$(U,RegExp(`${Z8(b.value,I)}$`),b.message,I);break;case"datetime":F6(U,"date-time",b.message,I);break;case"date":F6(U,"date",b.message,I);break;case"time":F6(U,"time",b.message,I);break;case"duration":F6(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(Z8(b.value,I)),b.message,I);break}case"ip":{if(b.version!=="v6")F6(U,"ipv4",b.message,I);if(b.version!=="v4")F6(U,"ipv6",b.message,I);break}case"base64url":r$(U,M6.base64url,b.message,I);break;case"jwt":r$(U,M6.jwt,b.message,I);break;case"cidr":{if(b.version!=="v6")r$(U,M6.ipv4Cidr,b.message,I);if(b.version!=="v4")r$(U,M6.ipv6Cidr,b.message,I);break}case"emoji":r$(U,M6.emoji(),b.message,I);break;case"ulid":{r$(U,M6.ulid,b.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{F6(U,"binary",b.message,I);break}case"contentEncoding:base64":{b$(U,"contentEncoding","base64",b.message,I);break}case"pattern:zod":{r$(U,M6.base64,b.message,I);break}}break}case"nanoid":r$(U,M6.nanoid,b.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((w)=>{})(b)}return U}function Z8($,I){return I.patternStrategy==="escape"?Yk($):$}var Gk=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Yk($){let I="";for(let U=0;U<$.length;U++){if(!Gk.has($[U]))I+="\\";I+=$[U]}return I}function F6($,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:wz(I,b),...U&&b.errorMessages&&{errorMessage:{pattern:U}}})}else b$($,"pattern",wz(I,b),U,b)}function wz($,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 bb($,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===F.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]})??M$(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===F.ZodString&&$.keyType._def.checks?.length){let{type:b,...w}=wb($.keyType._def,I);return{...U,propertyNames:w}}else if($.keyType?._def.typeName===F.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===F.ZodBranded&&$.keyType._def.type._def.typeName===F.ZodString&&$.keyType._def.type._def.checks?.length){let{type:b,...w}=Ub($.keyType._def,I);return{...U,propertyNames:w}}return U}function Xz($,I){if(I.mapStrategy==="record")return bb($,I);let U=n($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||M$(I),b=n($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||M$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,b],minItems:2,maxItems:2}}}function Dz($){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 Wz($){return $.target==="openAi"?void 0:{not:M$({...$,currentPath:[...$.currentPath,"not"]})}}function Qz($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var YU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Yz($,I){if(I.target==="openApi3")return Gz($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((b)=>(b._def.typeName in YU)&&(!b._def.checks||!b._def.checks.length))){let b=U.reduce((w,X)=>{let D=YU[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 Gz($,I)}var Gz=($,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 Nz($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:YU[$.innerType._def.typeName],nullable:!0};return{type:[YU[$.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 Jz($,I){let U={type:"number"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"int":U.type="integer",R8(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 Bz($,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=Bk(Q);if(G&&U){if(Q._def.typeName==="ZodOptional")Q=Q._def.innerType;if(!Q.isNullable())Q=Q.nullable();G=!1}let Y=n(Q._def,{...I,currentPath:[...I.currentPath,"properties",W],propertyPath:[...I.currentPath,"properties",W]});if(Y===void 0)continue;if(b.properties[W]=Y,!G)w.push(W)}if(w.length)b.required=w;let D=Jk($,I);if(D!==void 0)b.additionalProperties=D;return b}function Jk($,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 Bk($){try{return $.isOptional()}catch{return!0}}var Hz=($,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:M$(I)},U]}:M$(I)};var Az=($,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 Oz($,I){return n($.type._def,I)}function zz($,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 Lz($,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 Kz($){return{not:M$($)}}function vz($){return M$($)}var Vz=($,I)=>{return n($.innerType._def,I)};var qz=($,I,U)=>{switch(I){case F.ZodString:return wb($,U);case F.ZodNumber:return Jz($,U);case F.ZodObject:return Bz($,U);case F.ZodBigInt:return tO($,U);case F.ZodBoolean:return aO();case F.ZodDate:return T8($,U);case F.ZodUndefined:return Kz(U);case F.ZodNull:return Qz(U);case F.ZodArray:return pO($,U);case F.ZodUnion:case F.ZodDiscriminatedUnion:return Yz($,U);case F.ZodIntersection:return Uz($,U);case F.ZodTuple:return Lz($,U);case F.ZodRecord:return bb($,U);case F.ZodLiteral:return wz($,U);case F.ZodEnum:return Iz($);case F.ZodNativeEnum:return Dz($);case F.ZodNullable:return Nz($,U);case F.ZodOptional:return Hz($,U);case F.ZodMap:return Xz($,U);case F.ZodSet:return zz($,U);case F.ZodLazy:return()=>$.getter()._def;case F.ZodPromise:return Oz($,U);case F.ZodNaN:case F.ZodNever:return Wz(U);case F.ZodEffects:return $z($,U);case F.ZodAny:return M$(U);case F.ZodUnknown:return vz(U);case F.ZodDefault:return sO($,U);case F.ZodBranded:return Ub($,U);case F.ZodReadonly:return Vz($,U);case F.ZodCatch:return eO($,U);case F.ZodPipeline:return Az($,U);case F.ZodFunction:case F.ZodVoid:case F.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!==iO)return W}if(b&&!U){let W=Hk(b,I);if(W!==void 0)return W}let w={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,w);let X=qz($,$.typeName,I),D=typeof X==="function"?n(X(),I):X;if(D)Ak($,I,D);if(I.postProcess){let W=I.postProcess(D,$,I);return w.jsonSchema=D,W}return w.jsonSchema=D,D}var Hk=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:Ib(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`),M$(I);return I.$refStrategy==="seen"?M$(I):void 0}}},Ak=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var C8=($,I)=>{let U=dO(I),b=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((Q,[G,Y])=>({...Q,[G]:n(Y._def,{...U,currentPath:[...U.basePath,U.definitionPath,G]},!0)??M$(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)??M$(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 Ok($){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 g8($,I){if(B6($))return U8($,{target:Ok(I?.target),io:I?.pipeStrategy??"input"});return C8($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function x8($){let U=H4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Rw(U);if(typeof b!=="string")throw new Error("Schema method literal must be a string");return b}function h8($,I){let U=B4($,I);if(!U.success)throw U.error;return U.data}var zk=60000;class f8{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(hw,(I)=>{this._oncancel(I)}),this.setNotificationHandler(yw,(I)=>{this._onprogress(I)}),this.setRequestHandler(fw,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(uw,async(I,U)=>{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new f(c.InvalidParams,"Failed to retrieve task: Task not found");return{...b}}),this.setRequestHandler(cw,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 Y=W,J=new f(Y.error.code,Y.error.message,Y.error.data);G(J)}else{let Y=D.type==="response"?"Response":"Error";this._onerror(new Error(`${Y} 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 f(c.InvalidParams,`Task not found: ${w}`);if(!O4(X.status))return await this._waitForTaskUpdate(w,U.signal),await b();if(O4(X.status)){let D=await this._taskStore.getTaskResult(w,U.sessionId);return this._clearTaskQueue(w),{...D,_meta:{...D._meta,[A4]:{taskId:w}}}}return await b()};return await b()}),this.setRequestHandler(mw,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 f(c.InvalidParams,`Failed to list tasks: ${b instanceof Error?b.message:String(b)}`)}}),this.setRequestHandler(nw,async(I,U)=>{try{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new f(c.InvalidParams,`Task not found: ${I.params.taskId}`);if(O4(b.status))throw new f(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 f(c.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...w}}catch(b){if(b instanceof f)throw b;throw new f(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($),f.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),UU(w)||ZO(w))this._onresponse(w);else if(A8(w))this._onrequest(w,X);else if(_O(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=f.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?.[A4]?.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((Y)=>this._onerror(new Error(`Failed to enqueue error response: ${Y}`)));else b?.send(G).catch((Y)=>this._onerror(new Error(`Failed to send an error response: ${Y}`)));return}let X=new AbortController;this._requestHandlerAbortControllers.set($.id,X);let D=kO($.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 Y={relatedRequestId:$.id};if(w)Y.relatedTask={taskId:w};await this.notification(G,Y)},sendRequest:async(G,Y,J)=>{let H={...J,relatedRequestId:$.id};if(w&&!H.relatedTask)H.relatedTask={taskId:w};let B=H.relatedTask?.taskId??w;if(B&&W)await W.updateTaskStatus(B,"input_required");return await this.request(G,Y,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 Y={result:G,jsonrpc:"2.0",id:$.id};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"response",message:Y,timestamp:Date.now()},b?.sessionId);else await b?.send(Y)},async(G)=>{if(X.signal.aborted)return;let Y={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:Y,timestamp:Date.now()},b?.sessionId);else await b?.send(Y)}).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),UU($))U($);else{let X=new f($.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(UU($)&&$.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(UU($))b($);else{let X=f.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 f?X:new f(c.InternalError,String(X))}}return}let w;try{let X=await this.request($,j1,U);if(X.task)w=X.task.taskId,yield{type:"taskCreated",task:X.task};else throw new f(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},O4(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 f(c.InternalError,`Task ${w} failed`)};else if(D.status==="cancelled")yield{type:"error",error:new f(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 f?X:new f(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 Y=(q)=>{G(q)};if(!this._transport){Y(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),D)this.assertTaskCapability($.method)}catch(q){Y(q);return}U?.signal?.throwIfAborted();let J=this._requestMessageId++,H={...$,jsonrpc:"2.0",id:J};if(U?.onprogress)this._progressHandlers.set(J,U.onprogress),H.params={...$.params,_meta:{...$.params?._meta||{},progressToken:J}};if(D)H.params={...H.params,task:D};if(W)H.params={...H.params,_meta:{...H.params?._meta||{},[A4]:W}};let B=(q)=>{this._responseHandlers.delete(J),this._progressHandlers.delete(J),this._cleanupTimeout(J),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:J,reason:String(q)}},{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((P)=>this._onerror(new Error(`Failed to send cancellation: ${P}`)));let k=q instanceof f?q:new f(c.RequestTimeout,String(q));G(k)};this._responseHandlers.set(J,(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",()=>{B(U?.signal?.reason)});let A=U?.timeout??zk,O=()=>B(f.fromError(c.RequestTimeout,"Request timed out",{timeout:A}));this._setupTimeout(J,A,U?.maxTotalTimeout,O,U?.resetTimeoutOnProgress??!1);let V=W?.taskId;if(V){let q=(k)=>{let P=this._responseHandlers.get(J);if(P)P(k);else this._onerror(new Error(`Response handler missing for side-channeled request ${J}`))};this._requestResolvers.set(J,q),this._enqueueTaskMessage(V,{type:"request",message:H,timestamp:Date.now()}).catch((k)=>{this._cleanupTimeout(J),G(k)})}else this._transport.send(H,{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((q)=>{this._cleanupTimeout(J),G(q)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},lw,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},rw,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},xO,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||{},[A4]: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||{},[A4]: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||{},[A4]:I.relatedTask}}};await this._transport.send(X,I)}setRequestHandler($,I){let U=x8($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(b,w)=>{let X=h8($,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=x8($);this._notificationHandlers.set(U,(b)=>{let w=h8($,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"&&A8(b.message)){let w=b.message.id,X=this._requestResolvers.get(w);if(X)X(new f(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 f(c.InvalidRequest,"Request cancelled"));return}let X=setTimeout(b,U);I.addEventListener("abort",()=>{clearTimeout(X),w(new f(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 f(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=WU.parse({method:"notifications/tasks/status",params:D});if(await this.notification(W),O4(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 f(c.InvalidParams,`Task "${b}" not found - it may have been cleaned up`);if(O4(D.status))throw new f(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=WU.parse({method:"notifications/tasks/status",params:W});if(await this.notification(Q),O4(W.status))this._cleanupTaskProgressHandler(b)}},listTasks:(b)=>{return U.listTasks(b,I)}}}}function Mz($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function Fz($,I){let U={...$};for(let b in I){let w=b,X=I[w];if(X===void 0)continue;let D=U[w];if(Mz(D)&&Mz(X))U[w]={...D,...X};else U[w]=X}return U}var IV=CH(_Q(),1),UV=CH($V(),1);function Ex(){let $=new IV.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return UV.default($),$}class cQ{constructor($){this._ajv=$??Ex()}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 mQ{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 wV($,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 bV($,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 rQ extends f8{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(GU.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 cQ,this.setRequestHandler(L8,(U)=>this._oninitialize(U)),this.setNotificationHandler(K8,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(E8,async(U,b)=>{let w=b.sessionId||b.requestInfo?.headers["mcp-session-id"]||void 0,{level:X}=U.params,D=GU.safeParse(X);if(D.success)this._loggingLevels.set(w,D.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new mQ(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Fz(this._capabilities,$)}setRequestHandler($,I){let b=H4($)?.method;if(!b)throw new Error("Schema is missing a method literal");let w;if(B6(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(S1,W);if(!G.success){let B=G.error instanceof Error?G.error.message:String(G.error);throw new f(c.InvalidParams,`Invalid tools/call request: ${B}`)}let{params:Y}=G.data,J=await Promise.resolve(I(W,Q));if(Y.task){let B=B4(j1,J);if(!B.success){let A=B.error instanceof Error?B.error.message:String(B.error);throw new f(c.InvalidParams,`Invalid task creation result: ${A}`)}return B.data}let H=B4(ew,J);if(!H.success){let B=H.error instanceof Error?H.error.message:String(H.error);throw new f(c.InvalidParams,`Invalid tools/call result: ${B}`)}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($){bV(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;wV(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:EO.includes(I)?I:B8,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"},xw)}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((Y)=>Y.type==="tool_use").map((Y)=>Y.id)),G=new Set(b.filter((Y)=>Y.type==="tool_result").map((Y)=>Y.toolUseId));if(Q.size!==G.size||![...Q].every((Y)=>G.has(Y)))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:$},P8,I);return this.request({method:"sampling/createMessage",params:$},S8,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},sw,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},sw,I);if(w.action==="accept"&&w.content&&b.requestedSchema)try{let D=this._jsonSchemaValidator.getValidator(b.requestedSchema)(w.content);if(!D.valid)throw new f(c.InvalidParams,`Elicitation response content does not match requested schema: ${D.errorMessage}`)}catch(X){if(X instanceof f)throw X;throw new f(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 DV=Symbol.for("mcp.completable");function nQ($){return!!$&&typeof $==="object"&&DV in $}function WV($){return $[DV]?.complete}var XV;(function($){$.Completable="McpCompletable"})(XV||(XV={}));var Sx=/^[A-Za-z0-9._-]{1,128}$/;function Px($){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(!Sx.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 kx($,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 iQ($){let I=Px($);return kx($,I.warnings),I.isValid}class oQ{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 pQ{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 rQ($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new oQ(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(aw)),this.server.assertCanSetRequestHandler(F4(S1)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(aw,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let b=M1(I.inputSchema);return b?g8(b,{strictUnions:!0,pipeStrategy:"input"}):Rx})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let b=M1(I.outputSchema);if(b)U.outputSchema=g8(b,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(S1,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new f(c.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new f(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 f(c.InternalError,`Tool ${$.params.name} has taskSupport '${w}' but was not registered with registerToolTask`);if(w==="required"&&!b)throw new f(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 f){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=M1($.inputSchema)??$.inputSchema,X=await Pw(w,I);if(!X.success){let D="error"in X?X.error:"Unknown error",W=kw(D);throw new f(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 f(c.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let b=M1($.outputSchema),w=await Pw(b,I.structuredContent);if(!w.success){let X="error"in w?w.error:"Unknown error",D=kw(X);throw new f(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((J)=>setTimeout(J,G));let Y=await U.taskStore.getTask(W);if(!Y)throw new f(c.InternalError,`Task ${W} not found during polling`);Q=Y}return await U.taskStore.getTaskResult(W)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(F4($b)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler($b,async($)=>{switch($.params.ref.type){case"ref/prompt":return cO($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return mO($),this.handleResourceCompletion($,$.params.ref);default:throw new f(c.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new f(c.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return CU;let w=H4(U.argsSchema)?.[$.params.argument.name];if(!nQ(w))return CU;let X=WV(w);if(!X)return CU;let D=await X($.params.argument.value,$.params.context);return GV(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 CU;throw new f(c.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let b=U.resourceTemplate.completeCallback($.params.argument.name);if(!b)return CU;let w=await b($.params.argument.value,$.params.context);return GV(w)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(iw)),this.server.assertCanSetRequestHandler(F4(ow)),this.server.assertCanSetRequestHandler(F4(dw)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(iw,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(ow,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(dw,async($,I)=>{let U=new URL($.params.uri),b=this._registeredResources[U.toString()];if(b){if(!b.enabled)throw new f(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 f(c.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(pw)),this.server.assertCanSetRequestHandler(F4(tw)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(pw,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?_x(I.argsSchema):void 0}})})),this.server.setRequestHandler(tw,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new f(c.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let b=M1(U.argsSchema),w=await Pw(b,$.params.arguments);if(!w.success){let W="error"in w?w.error:"Unknown error",Q=kw(W);throw new f(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:d4(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=d4(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 J6?W._def?.innerType:W;return nQ(Q)}))this.setCompletionRequestHandler()}return X}_createRegisteredTool($,I,U,b,w,X,D,W,Q){iQ($);let G={title:I,description:U,inputSchema:QV(b),outputSchema:QV(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:(Y)=>{if(typeof Y.name!=="undefined"&&Y.name!==$){if(typeof Y.name==="string")iQ(Y.name);if(delete this._registeredTools[$],Y.name)this._registeredTools[Y.name]=G}if(typeof Y.title!=="undefined")G.title=Y.title;if(typeof Y.description!=="undefined")G.description=Y.description;if(typeof Y.paramsSchema!=="undefined")G.inputSchema=d4(Y.paramsSchema);if(typeof Y.outputSchema!=="undefined")G.outputSchema=d4(Y.outputSchema);if(typeof Y.callback!=="undefined")G.handler=Y.callback;if(typeof Y.annotations!=="undefined")G.annotations=Y.annotations;if(typeof Y._meta!=="undefined")G._meta=Y._meta;if(typeof Y.enabled!=="undefined")G.enabled=Y.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(dQ(W)){if(b=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!dQ(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 Rx={type:"object",properties:{}};function YV($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Tx($){return"_def"in $||"_zod"in $||YV($)}function dQ($){if(typeof $!=="object"||$===null)return!1;if(Tx($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(YV)}function QV($){if(!$)return;if(dQ($))return d4($);return $}function _x($){let I=H4($);if(!I)return[];return Object.entries(I).map(([U,b])=>{let w=wO(b),X=bO(b);return{name:U,description:w,required:!X}})}function F4($){let U=H4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Rw(U);if(typeof b==="string")return b;throw new Error("Schema method literal must be a string")}function GV($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var CU={completion:{values:[],hasMore:!1}};import JV from"node:process";class tQ{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),
|
|
42
|
-
`}class aQ{constructor($=JV.stdin,I=JV.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new tQ,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=NV($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:Cx,defineProperty:BV,getOwnPropertyDescriptor:gx,getOwnPropertyNames:HV,getPrototypeOf:xx}=Object,hx=Object.prototype.hasOwnProperty,T6=($,I)=>function(){return I||$[HV($)[0]]((I={exports:{}}).exports,I),I.exports},fx=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=HV(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!hx.call($,W)&&W!==U)BV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=gx(I,W))||b.enumerable})}return $},N$=($,I,U)=>(U=$!=null?Cx(xx($)):{},fx(I||!$||!$.__esModule?BV(U,"default",{value:$,enumerable:!0}):U,$)),AV=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}}),yx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=AV().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}}),ux=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=AV().default,b=yx();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=ux();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(lx,I)}};return I}function lx($,I){return I($)}function eQ($){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 sQ($){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 mb($){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 OV($){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)})}function w4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function rb(){return Object.create(null)}var y1={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 zV=[y1.BAD_GATEWAY,y1.SERVICE_UNAVAILABLE,y1.GATEWAY_TIMEOUT,y1.INTERNAL_SERVER_ERROR];var{create:mx,defineProperty:KV,getOwnPropertyDescriptor:rx,getOwnPropertyNames:vV,getPrototypeOf:nx}=Object,ix=Object.prototype.hasOwnProperty,gU=($,I)=>function(){return I||$[vV($)[0]]((I={exports:{}}).exports,I),I.exports},ox=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=vV(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!ix.call($,W)&&W!==U)KV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=rx(I,W))||b.enumerable})}return $},xU=($,I,U)=>(U=$!=null?mx(nx($)):{},ox(I||!$||!$.__esModule?KV(U,"default",{value:$,enumerable:!0}):U,$)),VV=()=>{},LV=($)=>{if(Object.freeze)Object.freeze($)};function qV($,I,U){var b;let w=I.join(".");return(b=U[w])!==null&&b!==void 0||(U[w]=new Proxy(VV,{get(X,D){if(typeof D!=="string"||D==="then")return;return qV($,[...I,D],U)},apply(X,D,W){let Q=I[I.length-1];if(Q==="valueOf"||Q==="toString"||Q==="toJSON")return`tRPC.proxy(${I.slice(0,-1).join(".")})`;let 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 LV(G.args),LV(G.path),$(G)}})),U[w]}var nb=($)=>qV($,[],rb()),$G=($)=>{return new Proxy(VV,{get(I,U){if(U==="then")return;return $(U)}})};var MV=gU({"../../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}}),dx=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=MV().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}}),px=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=MV().default,b=dx();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}}),IG=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=px();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}}),ib=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=IG();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}}),Yp=xU(ib(),1);var Hp=xU(IG(),1);var ob=xU(ib(),1);function ex($,I){if("error"in $){let b=I.deserialize($.error);return{ok:!1,error:ob.default(ob.default({},$),{},{error:b})}}return{ok:!0,result:ob.default(ob.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var UG=class extends Error{constructor(){super("Unable to transform response from server")}};function wG($,I){let U;try{U=ex($,I)}catch(b){throw new UG}if(!U.ok&&(!w4(U.error.error)||typeof U.error.error.code!=="number"))throw new UG;if(U.ok&&!w4(U.result))throw new UG;return U}var Ap=xU(ib(),1);var Op=Symbol();var db=N$(u6(),1),u1=N$(_$(),1);function FV($){return $ instanceof j4}function Uh($){return w4($)&&w4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function wh($,I){if(typeof $==="string")return $;if(w4($)&&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});db.default(this,"cause",void 0),db.default(this,"shape",void 0),db.default(this,"data",void 0),db.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(FV(b)){if(U.meta)b.meta=u1.default(u1.default({},b.meta),U.meta);return b}if(Uh(b))return new $(b.error.message,u1.default(u1.default({},U),{},{result:b,cause:U.cause}));return new $(wh(b,"Unknown error"),u1.default(u1.default({},U),{},{cause:b}))}};function pb($){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 jV=($)=>typeof $==="function";function EV($){if($)return $;if(typeof window!=="undefined"&&jV(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&jV(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var hU=N$(_$(),1);function tb($){return{url:$.url.toString(),fetch:$.fetch,transformer:pb($.transformer),methodOverride:$.methodOverride}}function bh($){let I={};for(let U=0;U<$.length;U++){let b=$[U];I[U]=b}return I}var Xh={query:"GET",mutation:"POST",subscription:"PATCH"};function SV($){return"input"in $?$.transformer.input.serialize($.input):bh($.inputs.map((I)=>$.transformer.input.serialize(I)))}var l1=($)=>{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=SV($);if(X!==void 0&&$.methodOverride!=="POST")w.push(`input=${encodeURIComponent(JSON.stringify(X))}`)}if(w.length)b+="?"+w.join("&");return b},PV=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=SV($);return I!==void 0?JSON.stringify(I):void 0},bG=($)=>{return ab(hU.default(hU.default({},$),{},{contentTypeHeader:"application/json",getUrl:l1,getBody:PV}))},Dh=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},Wh=($)=>{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 Dh};async function kV($){var I,U;Wh($.signal);let b=$.getUrl($),w=$.getBody($),X=(I=$.methodOverride)!==null&&I!==void 0?I:Xh[$.type],D=await(async()=>{let Q=await $.headers();if(Symbol.iterator in Q)return Object.fromEntries(Q);return Q})(),W=hU.default(hU.default(hU.default({},$.contentTypeHeader&&X!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(U=$.trpcAcceptHeaderKey)!==null&&U!==void 0?U:"trpc-accept"]:$.trpcAcceptHeader}:void 0),D);return EV($.fetch)(b,{method:X,signal:$.signal,body:w,headers:W})}async function ab($){let I={},U=await kV($);I.response=U;let b=await U.json();return I.responseJSON=b,{json:b,meta:I}}function RV($){return $ instanceof Uint8Array||$ instanceof Blob}function TV($){return $ instanceof FormData}var c1=N$(_$(),1),Qh=($)=>{if("input"in $){let{input:I}=$;if(TV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return ab(c1.default(c1.default({},$),{},{contentTypeHeader:void 0,getUrl:l1,getBody:()=>I}))}if(RV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return ab(c1.default(c1.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:l1,getBody:()=>I}))}}return bG($)};function XG($){let I=tb($);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=Qh(c1.default(c1.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((Y)=>{G=Y.meta;let J=wG(Y.json,I.transformer.output);if(!J.ok){w.error(j4.from(J.error,{meta:G}));return}w.next({context:Y.meta,result:J.result}),w.complete()}).catch((Y)=>{w.error(j4.from(Y,{meta:G}))}),()=>{}})}}}var Bt=N$(_$(),1);var Ot=N$(_$(),1);var DG=($,...I)=>{return typeof $==="function"?$(...I):$},qt=N$(u6(),1);function Gh(){let $,I;return{promise:new Promise((b,w)=>{$=b,I=w}),resolve:$,reject:I}}async function Yh($){let I=await DG($.url);if(!$.connectionParams)return I;let b=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+b}async function Nh($,I){let U={method:"connectionParams",data:await DG($)};return I.encode(U)}var Mt=N$(u6(),1);var E4=N$(u6(),1);function Jh($){let{promise:I,resolve:U,reject:b}=Gh();return $.addEventListener("open",()=>{$.removeEventListener("error",b),U()}),$.addEventListener("error",b),I}function Bh($,{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 Hh=class ${constructor(I){var U;if(E4.default(this,"id",++$.connectCount),E4.default(this,"WebSocketPonyfill",void 0),E4.default(this,"urlOptions",void 0),E4.default(this,"keepAliveOpts",void 0),E4.default(this,"encoder",void 0),E4.default(this,"wsObservable",mb(null)),E4.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,this.encoder=I.encoder}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=Yh(I.urlOptions).then((b)=>new I.WebSocketPonyfill(b));I.openPromise=U.then(async(b)=>{if(I.ws=b,b.binaryType="arraybuffer",b.addEventListener("message",function({data:w}){if(w==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)Bh(b,I.keepAliveOpts);if(b.addEventListener("close",()=>{if(I.ws===b)I.ws=null}),await Jh(b),I.urlOptions.connectionParams)b.send(await Nh(I.urlOptions.connectionParams,I.encoder))});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()}}};E4.default(Hh,"connectCount",0);var Ft=N$(u6(),1),jt=N$(_$(),1);var WG=N$(u6(),1),_V=N$(_$(),1),Ah=class{constructor($){WG.default(this,"links",void 0),WG.default(this,"runtime",void 0),WG.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return OV({links:this.links,op:_V.default(_V.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(sQ())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await eQ(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 Oh=Symbol.for("trpc_untypedClient"),zh={query:"query",mutate:"mutation",subscribe:"subscription"},Lh=($)=>{return zh[$]};function Kh($){let I=nb(({path:U,args:b})=>{let w=[...U],X=Lh(w.pop()),D=w.join(".");return $[X](D,...b)});return $G((U)=>{if(U===Oh)return $;return I[U]})}function ZV($){let I=new Ah($);return Kh(I)}var $a=N$(_$(),1);var Ia=N$(_$(),1);var vh=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}}),Ua=N$(vh(),1);var wa=N$(_$(),1);var Vh=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 Y=G;if(typeof G!="function")throw new TypeError("Object is not disposable.");Y&&(G=function J(){try{Y.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,Y=0;function J(){for(;Q=X.pop();)try{if(!Q.a&&Y===1)return Y=0,X.push(Q),Promise.resolve().then(J);if(Q.d){var B=Q.d.call(Q.v);if(Q.a)return Y|=2,Promise.resolve(B).then(J,H)}else Y|=1}catch(A){return H(A)}if(Y===1)return G!==w?Promise.reject(G):Promise.resolve();if(G!==w)throw G}function H(B){return G=G!==w?new b(B,G):B,J()}return J()}}}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),CV=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}}),qh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=CV();function b(w){return new U(w,0)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Mh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,I){var U=CV();function b(X){return function(){return new w(X.apply(this,arguments))}}function w(X){var D,W;function Q(Y,J){try{var H=X[Y](J),B=H.value,A=B instanceof U;Promise.resolve(A?B.v:B).then(function(O){if(A){var V=Y==="return"?"return":"next";if(!B.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(Y,J){switch(Y){case"return":D.resolve({value:J,done:!0});break;case"throw":D.reject(J);break;default:D.resolve({value:J,done:!1})}(D=D.next)?Q(D.key,D.arg):W=null}this._invoke=function(Y,J){return new Promise(function(H,B){var A={key:Y,arg:J,resolve:H,reject:B,next:null};W?W=W.next=A:(D=W=A,Q(Y,J))})},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}}),ba=N$(Vh(),1),Xa=N$(qh(),1),Da=N$(Mh(),1),Wa=N$(_$(),1);class QG{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 fU{constructor($){this.generateIdentifier=$,this.kv=new QG}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 GG extends fU{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 Fh($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function gV($,I){let U=Fh($);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 m1($,I){return $.indexOf(I)!==-1}function YG($,I){for(let U=0;U<$.length;U++){let b=$[U];if(I(b))return b}return}class NG{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return gV(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var jh=($)=>Object.prototype.toString.call($).slice(8,-1),JG=($)=>typeof $==="undefined",Eh=($)=>$===null,U1=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},eb=($)=>U1($)&&Object.keys($).length===0,_6=($)=>Array.isArray($),Sh=($)=>typeof $==="string",Ph=($)=>typeof $==="number"&&!isNaN($),kh=($)=>typeof $==="boolean",xV=($)=>$ instanceof RegExp,S4=($)=>$ instanceof Map,P4=($)=>$ instanceof Set,BG=($)=>jh($)==="Symbol",hV=($)=>$ instanceof Date&&!isNaN($.valueOf()),sb=($)=>$ instanceof Error,HG=($)=>typeof $==="number"&&isNaN($),fV=($)=>kh($)||Eh($)||JG($)||Ph($)||Sh($)||BG($),yV=($)=>typeof $==="bigint",uV=($)=>$===1/0||$===-1/0,lV=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),cV=($)=>$ instanceof URL;var $X=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),IX=($)=>$.map(String).map($X).join("."),r1=($,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 mV=[c6(JG,"undefined",()=>null,()=>{return}),c6(yV,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),c6(hV,"Date",($)=>$.toISOString(),($)=>new Date($)),c6(sb,"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(xV,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),c6(P4,"set",($)=>[...$.values()],($)=>new Set($)),c6(S4,"map",($)=>[...$.entries()],($)=>new Map($)),c6(($)=>HG($)||uV($),"number",($)=>{if(HG($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),c6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),c6(cV,"URL",($)=>$.toString(),($)=>new URL($))];function UX($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var rV=UX(($,I)=>{if(BG($))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}),Rh=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),nV=UX(lV,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=Rh[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function AG($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var iV=UX(AG,($,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),$)}),oV=UX(($,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($)}),Th=[iV,rV,oV,nV],OG=($,I)=>{let U=YG(Th,(w)=>w.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let b=YG(mV,(w)=>w.isApplicable($,I));if(b)return{value:b.transform($,I),type:b.annotation};return},dV={};mV.forEach(($)=>{dV[$.annotation]=$});var pV=($,I,U)=>{if(_6(I))switch(I[0]){case"symbol":return rV.untransform($,I,U);case"class":return iV.untransform($,I,U);case"custom":return oV.untransform($,I,U);case"typed-array":return nV.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let b=dV[I];if(!b)throw new Error("Unknown transformation: "+I);return b.untransform($,U)}};var n1=($,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 tV($){if(m1($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(m1($,"prototype"))throw new Error("prototype is not allowed as a property");if(m1($,"constructor"))throw new Error("constructor is not allowed as a property")}var aV=($,I)=>{tV(I);for(let U=0;U<I.length;U++){let b=I[U];if(P4($))$=n1($,+b);else if(S4($)){let w=+b,X=+I[++U]===0?"key":"value",D=n1($,w);switch(X){case"key":$=D;break;case"value":$=$.get(D);break}}else $=$[b]}return $},wX=($,I,U)=>{if(tV(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(P4(b)){let W=+D;b=n1(b,W)}else if(S4(b)){if(X===I.length-2)break;let Q=+D,G=+I[++X]===0?"key":"value",Y=n1(b,Q);switch(G){case"key":b=Y;break;case"value":b=b.get(Y);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(P4(b)){let X=n1(b,+w),D=U(X);if(X!==D)b.delete(X),b.add(D)}if(S4(b)){let X=+I[I.length-2],D=n1(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 eV=($)=>$<1;function zG($,I,U,b=[]){if(!$)return;let w=eV(U);if(!_6($)){I1($,(W,Q)=>zG(W,I,U,[...b,...r1(Q,w)]));return}let[X,D]=$;if(D)I1(D,(W,Q)=>{zG(W,I,U,[...b,...r1(Q,w)])});I(X,b)}function sV($,I,U,b){return zG(I,(w,X)=>{$=wX($,X,(D)=>pV(D,w,b))},U),$}function $q($,I,U){let b=eV(U);function w(X,D){let W=aV($,r1(D,b));X.map((Q)=>r1(Q,b)).forEach((Q)=>{$=wX($,Q,()=>W)})}if(_6(I)){let[X,D]=I;if(X.forEach((W)=>{$=wX($,r1(W,b),()=>$)}),D)I1(D,w)}else I1(I,w);return $}var _h=($,I)=>U1($)||_6($)||S4($)||P4($)||sb($)||AG($,I);function Zh($,I,U){let b=U.get($);if(b)b.push(I);else U.set($,[I])}function Iq($,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(IX);else U[IX(X)]=D.map(IX)}),b)if(eb(U))return[b];else return[b,U];else return eb(U)?void 0:U}var LG=($,I,U,b,w=[],X=[],D=new Map)=>{let W=fV($);if(!W){Zh($,w,I);let B=D.get($);if(B)return b?{transformedValue:null}:B}if(!_h($,U)){let B=OG($,U),A=B?{transformedValue:B.value,annotations:[B.type]}:{transformedValue:$};if(!W)D.set($,A);return A}if(m1(X,$))return{transformedValue:null};let Q=OG($,U),G=Q?.value??$,Y=_6(G)?[]:{},J={};I1(G,(B,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=LG(B,I,U,b,[...w,A],[...X,$],D);if(Y[A]=O.transformedValue,_6(O.annotations))J[$X(A)]=O.annotations;else if(U1(O.annotations))I1(O.annotations,(V,q)=>{J[$X(A)+"."+q]=V})});let H=eb(J)?{transformedValue:Y,annotations:Q?[Q.type]:void 0}:{transformedValue:Y,annotations:Q?[Q.type,J]:J};if(!W)D.set($,H);return H};function bX($){return Object.prototype.toString.call($).slice(8,-1)}function XX($){return bX($)==="Array"}function KG($){if(bX($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function Ch($,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 DX($,I={}){if(XX($))return $.map((w)=>DX(w,I));if(!KG($))return $;let U=Object.getOwnPropertyNames($),b=Object.getOwnPropertySymbols($);return[...U,...b].reduce((w,X)=>{if(X==="__proto__")return w;if(XX(I.props)&&!I.props.includes(X))return w;let D=$[X],W=DX(D,I);return Ch(w,X,W,$,I.nonenumerable),w},{})}class U${constructor({dedupe:$=!1}={}){this.classRegistry=new GG,this.symbolRegistry=new fU((I)=>I.description??""),this.customTransformerRegistry=new NG,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=LG($,I,this,this.dedupe),b={json:U.transformedValue};if(U.annotations)b.meta={...b.meta,values:U.annotations};let w=Iq(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:DX(U);if(b?.values)w=sV(w,b.values,b.v??0,this);if(b?.referentialEqualities)w=$q(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 Uq=U$;var{serialize:da,deserialize:pa,stringify:ta,parse:aa,registerClass:ea,registerCustom:sa,registerSymbol:$e,allowErrorProps:Ie}=U$;class vG{trpc;constructor($){this.trpc=ZV({links:[XG({url:`${$.apiUrl}/trpc`,transformer:Uq,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 situate($){return this.trpc.mcpTools.situate.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 updateEdge($){return this.trpc.mcpTools.updateEdge.mutate($)}async updateArtifactLinkRelation($){return this.trpc.mcpTools.updateArtifactLinkRelation.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 VG($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var b4=VG();async function wq($){let I=VG();I.info("Initializing server context...");let U=new vG({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 N={};v6(N,{xor:()=>kM,xid:()=>eq,void:()=>MM,uuidv7:()=>rq,uuidv6:()=>mq,uuidv4:()=>cq,uuid:()=>lq,util:()=>E,url:()=>nq,uppercase:()=>wI,unknown:()=>Y1,union:()=>_D,undefined:()=>VM,ulid:()=>aq,uint64:()=>KM,uint32:()=>OM,tuple:()=>fJ,trim:()=>GI,treeifyError:()=>ZG,transform:()=>CD,toUpperCase:()=>NI,toLowerCase:()=>YI,toJSONSchema:()=>XD,templateLiteral:()=>cM,symbol:()=>vM,superRefine:()=>GB,success:()=>yM,stringbool:()=>tM,stringFormat:()=>GM,string:()=>ND,strictObject:()=>SM,startsWith:()=>XI,slugify:()=>JI,size:()=>$I,setErrorMap:()=>zu,set:()=>CM,safeParseAsync:()=>JJ,safeParse:()=>NJ,safeEncodeAsync:()=>KJ,safeEncode:()=>zJ,safeDecodeAsync:()=>vJ,safeDecode:()=>LJ,registry:()=>TX,regexes:()=>K6,regex:()=>II,refine:()=>QB,record:()=>yJ,readonly:()=>UB,property:()=>UD,promise:()=>mM,prettifyError:()=>CG,preprocess:()=>eM,prefault:()=>pJ,positive:()=>eX,pipe:()=>J0,partialRecord:()=>TM,parseAsync:()=>YJ,parse:()=>GJ,overwrite:()=>Z6,optional:()=>Y0,object:()=>EM,number:()=>qJ,nullish:()=>fM,nullable:()=>N0,null:()=>SJ,normalize:()=>QI,nonpositive:()=>$D,nonoptional:()=>tJ,nonnegative:()=>ID,never:()=>TD,negative:()=>sX,nativeEnum:()=>gM,nanoid:()=>dq,nan:()=>uM,multipleOf:()=>C4,minSize:()=>g4,minLength:()=>X4,mime:()=>WI,meta:()=>dM,maxSize:()=>W1,maxLength:()=>Q1,map:()=>ZM,mac:()=>IM,lte:()=>Y6,lt:()=>r6,lowercase:()=>UI,looseRecord:()=>_M,looseObject:()=>PM,locales:()=>X0,literal:()=>xM,length:()=>G1,lazy:()=>XB,ksuid:()=>sq,keyof:()=>jM,jwt:()=>QM,json:()=>aM,iso:()=>AI,ipv6:()=>UM,ipv4:()=>$M,intersection:()=>xJ,int64:()=>LM,int32:()=>AM,int:()=>JD,instanceof:()=>pM,includes:()=>bI,httpUrl:()=>iq,hostname:()=>YM,hex:()=>NM,hash:()=>JM,guid:()=>uq,gte:()=>p$,gt:()=>n6,globalRegistry:()=>d$,getErrorMap:()=>Lu,function:()=>rM,fromJSONSchema:()=>$F,formatError:()=>dU,float64:()=>HM,float32:()=>BM,flattenError:()=>oU,file:()=>hM,enum:()=>ZD,endsWith:()=>DI,encodeAsync:()=>AJ,encode:()=>BJ,emoji:()=>oq,email:()=>yq,e164:()=>WM,discriminatedUnion:()=>RM,describe:()=>oM,decodeAsync:()=>OJ,decode:()=>HJ,date:()=>FM,custom:()=>iM,cuid2:()=>tq,cuid:()=>pq,core:()=>D4,config:()=>P$,coerce:()=>NB,codec:()=>lM,clone:()=>o$,cidrv6:()=>bM,cidrv4:()=>wM,check:()=>nM,catch:()=>sJ,boolean:()=>MJ,bigint:()=>zM,base64url:()=>DM,base64:()=>XM,array:()=>A0,any:()=>qM,_function:()=>rM,_default:()=>oJ,_ZodString:()=>BD,ZodXor:()=>ZJ,ZodXID:()=>vD,ZodVoid:()=>TJ,ZodUnknown:()=>kJ,ZodUnion:()=>z0,ZodUndefined:()=>jJ,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>KD,ZodType:()=>t,ZodTuple:()=>hJ,ZodTransform:()=>rJ,ZodTemplateLiteral:()=>wB,ZodSymbol:()=>FJ,ZodSuccess:()=>aJ,ZodStringFormat:()=>B$,ZodString:()=>zI,ZodSet:()=>lJ,ZodRecord:()=>L0,ZodRealError:()=>b6,ZodReadonly:()=>IB,ZodPromise:()=>DB,ZodPrefault:()=>dJ,ZodPipe:()=>hD,ZodOptional:()=>gD,ZodObject:()=>O0,ZodNumberFormat:()=>N1,ZodNumber:()=>KI,ZodNullable:()=>nJ,ZodNull:()=>EJ,ZodNonOptional:()=>xD,ZodNever:()=>RJ,ZodNanoID:()=>OD,ZodNaN:()=>$B,ZodMap:()=>uJ,ZodMAC:()=>VJ,ZodLiteral:()=>cJ,ZodLazy:()=>bB,ZodKSUID:()=>VD,ZodJWT:()=>kD,ZodIssueCode:()=>Ou,ZodIntersection:()=>gJ,ZodISOTime:()=>GD,ZodISODuration:()=>YD,ZodISODateTime:()=>WD,ZodISODate:()=>QD,ZodIPv6:()=>MD,ZodIPv4:()=>qD,ZodGUID:()=>G0,ZodFunction:()=>WB,ZodFirstPartyTypeKind:()=>YB,ZodFile:()=>mJ,ZodError:()=>Hu,ZodEnum:()=>OI,ZodEmoji:()=>AD,ZodEmail:()=>HD,ZodE164:()=>PD,ZodDiscriminatedUnion:()=>CJ,ZodDefault:()=>iJ,ZodDate:()=>H0,ZodCustomStringFormat:()=>LI,ZodCustom:()=>K0,ZodCodec:()=>fD,ZodCatch:()=>eJ,ZodCUID2:()=>LD,ZodCUID:()=>zD,ZodCIDRv6:()=>jD,ZodCIDRv4:()=>FD,ZodBoolean:()=>vI,ZodBigIntFormat:()=>RD,ZodBigInt:()=>VI,ZodBase64URL:()=>SD,ZodBase64:()=>ED,ZodArray:()=>_J,ZodAny:()=>PJ,TimePrecision:()=>h7,NEVER:()=>qG,$output:()=>T7,$input:()=>_7,$brand:()=>MG});var D4={};v6(D4,{version:()=>RY,util:()=>E,treeifyError:()=>ZG,toJSONSchema:()=>XD,toDotPath:()=>Gq,safeParseAsync:()=>xG,safeParse:()=>gG,safeEncodeAsync:()=>Bf,safeEncode:()=>Nf,safeDecodeAsync:()=>Hf,safeDecode:()=>Jf,registry:()=>TX,regexes:()=>K6,process:()=>G$,prettifyError:()=>CG,parseAsync:()=>YX,parse:()=>GX,meta:()=>z5,locales:()=>X0,isValidJWT:()=>Pq,isValidBase64URL:()=>Sq,isValidBase64:()=>eY,initializeContext:()=>x4,globalRegistry:()=>d$,globalConfig:()=>yU,formatError:()=>dU,flattenError:()=>oU,finalize:()=>f4,extractDefs:()=>h4,encodeAsync:()=>Gf,encode:()=>Wf,describe:()=>O5,decodeAsync:()=>Yf,decode:()=>Qf,createToJSONSchemaMethod:()=>K5,createStandardJSONSchemaMethod:()=>HI,config:()=>P$,clone:()=>o$,_xor:()=>ry,_xid:()=>cX,_void:()=>W5,_uuidv7:()=>xX,_uuidv6:()=>gX,_uuidv4:()=>CX,_uuid:()=>ZX,_url:()=>W0,_uppercase:()=>wI,_unknown:()=>X5,_union:()=>my,_undefined:()=>U5,_ulid:()=>lX,_uint64:()=>$5,_uint32:()=>d7,_tuple:()=>oy,_trim:()=>GI,_transform:()=>$u,_toUpperCase:()=>NI,_toLowerCase:()=>YI,_templateLiteral:()=>Gu,_symbol:()=>I5,_superRefine:()=>A5,_success:()=>Xu,_stringbool:()=>L5,_stringFormat:()=>BI,_string:()=>C7,_startsWith:()=>XI,_slugify:()=>JI,_size:()=>$I,_set:()=>ty,_safeParseAsync:()=>e1,_safeParse:()=>a1,_safeEncodeAsync:()=>zX,_safeEncode:()=>AX,_safeDecodeAsync:()=>LX,_safeDecode:()=>OX,_regex:()=>II,_refine:()=>H5,_record:()=>dy,_readonly:()=>Qu,_property:()=>UD,_promise:()=>Nu,_positive:()=>eX,_pipe:()=>Wu,_parseAsync:()=>t1,_parse:()=>p1,_overwrite:()=>Z6,_optional:()=>Iu,_number:()=>c7,_nullable:()=>Uu,_null:()=>w5,_normalize:()=>QI,_nonpositive:()=>$D,_nonoptional:()=>bu,_nonnegative:()=>ID,_never:()=>D5,_negative:()=>sX,_nativeEnum:()=>ey,_nanoid:()=>fX,_nan:()=>Y5,_multipleOf:()=>C4,_minSize:()=>g4,_minLength:()=>X4,_min:()=>p$,_mime:()=>WI,_maxSize:()=>W1,_maxLength:()=>Q1,_max:()=>Y6,_map:()=>py,_mac:()=>x7,_lte:()=>Y6,_lt:()=>r6,_lowercase:()=>UI,_literal:()=>sy,_length:()=>G1,_lazy:()=>Yu,_ksuid:()=>mX,_jwt:()=>aX,_isoTime:()=>u7,_isoDuration:()=>l7,_isoDateTime:()=>f7,_isoDate:()=>y7,_ipv6:()=>nX,_ipv4:()=>rX,_intersection:()=>iy,_int64:()=>s7,_int32:()=>o7,_int:()=>r7,_includes:()=>bI,_guid:()=>D0,_gte:()=>p$,_gt:()=>n6,_float64:()=>i7,_float32:()=>n7,_file:()=>J5,_enum:()=>ay,_endsWith:()=>DI,_encodeAsync:()=>BX,_encode:()=>NX,_emoji:()=>hX,_email:()=>_X,_e164:()=>tX,_discriminatedUnion:()=>ny,_default:()=>wu,_decodeAsync:()=>HX,_decode:()=>JX,_date:()=>Q5,_custom:()=>B5,_cuid2:()=>uX,_cuid:()=>yX,_coercedString:()=>g7,_coercedNumber:()=>m7,_coercedDate:()=>G5,_coercedBoolean:()=>t7,_coercedBigint:()=>e7,_cidrv6:()=>oX,_cidrv4:()=>iX,_check:()=>xq,_catch:()=>Du,_boolean:()=>p7,_bigint:()=>a7,_base64url:()=>pX,_base64:()=>dX,_array:()=>N5,_any:()=>b5,TimePrecision:()=>h7,NEVER:()=>qG,JSONSchemaGenerator:()=>bJ,JSONSchema:()=>hq,Doc:()=>qX,$output:()=>T7,$input:()=>_7,$constructor:()=>z,$brand:()=>MG,$ZodXor:()=>ON,$ZodXID:()=>lY,$ZodVoid:()=>JN,$ZodUnknown:()=>YN,$ZodUnion:()=>eU,$ZodUndefined:()=>WN,$ZodUUID:()=>ZY,$ZodURL:()=>gY,$ZodULID:()=>uY,$ZodType:()=>o,$ZodTuple:()=>RX,$ZodTransform:()=>jN,$ZodTemplateLiteral:()=>xN,$ZodSymbol:()=>DN,$ZodSuccess:()=>TN,$ZodStringFormat:()=>J$,$ZodString:()=>D1,$ZodSet:()=>VN,$ZodRegistry:()=>Z7,$ZodRecord:()=>KN,$ZodRealError:()=>w6,$ZodReadonly:()=>gN,$ZodPromise:()=>fN,$ZodPrefault:()=>kN,$ZodPipe:()=>CN,$ZodOptional:()=>EN,$ZodObjectJIT:()=>AN,$ZodObject:()=>Tq,$ZodNumberFormat:()=>bN,$ZodNumber:()=>PX,$ZodNullable:()=>SN,$ZodNull:()=>QN,$ZodNonOptional:()=>RN,$ZodNever:()=>NN,$ZodNanoID:()=>hY,$ZodNaN:()=>ZN,$ZodMap:()=>vN,$ZodMAC:()=>pY,$ZodLiteral:()=>MN,$ZodLazy:()=>yN,$ZodKSUID:()=>cY,$ZodJWT:()=>UN,$ZodIntersection:()=>LN,$ZodISOTime:()=>nY,$ZodISODuration:()=>iY,$ZodISODateTime:()=>mY,$ZodISODate:()=>rY,$ZodIPv6:()=>dY,$ZodIPv4:()=>oY,$ZodGUID:()=>_Y,$ZodFunction:()=>hN,$ZodFile:()=>FN,$ZodError:()=>iU,$ZodEnum:()=>qN,$ZodEncodeError:()=>w1,$ZodEmoji:()=>xY,$ZodEmail:()=>CY,$ZodE164:()=>IN,$ZodDiscriminatedUnion:()=>zN,$ZodDefault:()=>PN,$ZodDate:()=>BN,$ZodCustomStringFormat:()=>wN,$ZodCustom:()=>uN,$ZodCodec:()=>sU,$ZodCheckUpperCase:()=>MY,$ZodCheckStringFormat:()=>s1,$ZodCheckStartsWith:()=>jY,$ZodCheckSizeEquals:()=>zY,$ZodCheckRegex:()=>VY,$ZodCheckProperty:()=>SY,$ZodCheckOverwrite:()=>kY,$ZodCheckNumberFormat:()=>BY,$ZodCheckMultipleOf:()=>JY,$ZodCheckMinSize:()=>OY,$ZodCheckMinLength:()=>KY,$ZodCheckMimeType:()=>PY,$ZodCheckMaxSize:()=>AY,$ZodCheckMaxLength:()=>LY,$ZodCheckLowerCase:()=>qY,$ZodCheckLessThan:()=>vX,$ZodCheckLengthEquals:()=>vY,$ZodCheckIncludes:()=>FY,$ZodCheckGreaterThan:()=>VX,$ZodCheckEndsWith:()=>EY,$ZodCheckBigIntFormat:()=>HY,$ZodCheck:()=>A$,$ZodCatch:()=>_N,$ZodCUID2:()=>yY,$ZodCUID:()=>fY,$ZodCIDRv6:()=>aY,$ZodCIDRv4:()=>tY,$ZodBoolean:()=>aU,$ZodBigIntFormat:()=>XN,$ZodBigInt:()=>kX,$ZodBase64URL:()=>$N,$ZodBase64:()=>sY,$ZodAsyncError:()=>m6,$ZodArray:()=>HN,$ZodAny:()=>GN});var qG=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,Y=Object.keys(G);for(let J=0;J<Y.length;J++){let H=Y[J];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 Y of G._zod.deferred)Y();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 MG=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 yU={};function P$($){if($)Object.assign(yU,$);return yU}var E={};v6(E,{unwrapMessage:()=>uU,uint8ArrayToHex:()=>Xf,uint8ArrayToBase64url:()=>wf,uint8ArrayToBase64:()=>Dq,stringifyPrimitive:()=>j,slugify:()=>EG,shallowClone:()=>PG,safeExtend:()=>ah,required:()=>$f,randomString:()=>rh,propertyKeyTypes:()=>mU,promiseAllObject:()=>mh,primitiveTypes:()=>kG,prefixIssues:()=>G6,pick:()=>dh,partial:()=>sh,optionalKeys:()=>RG,omit:()=>ph,objectClone:()=>uh,numKeys:()=>nh,nullish:()=>k4,normalizeParams:()=>S,mergeDefs:()=>T4,merge:()=>eh,jsonStringifyReplacer:()=>i1,joinValues:()=>L,issue:()=>d1,isPlainObject:()=>_4,isObject:()=>b1,hexToUint8Array:()=>bf,getSizableOrigin:()=>rU,getParsedType:()=>ih,getLengthableOrigin:()=>nU,getEnumValues:()=>lU,getElementAtPath:()=>ch,floatSafeRemainder:()=>jG,finalizeIssue:()=>U6,extend:()=>th,escapeRegex:()=>L6,esc:()=>WX,defineLazy:()=>s,createTransparentProxy:()=>oh,cloneDef:()=>lh,clone:()=>o$,cleanRegex:()=>cU,cleanEnum:()=>If,captureStackTrace:()=>QX,cached:()=>o1,base64urlToUint8Array:()=>Uf,base64ToUint8Array:()=>Xq,assignProp:()=>R4,assertNotEqual:()=>xh,assertNever:()=>fh,assertIs:()=>hh,assertEqual:()=>gh,assert:()=>yh,allowsEval:()=>SG,aborted:()=>Z4,NUMBER_FORMAT_RANGES:()=>TG,Class:()=>Wq,BIGINT_FORMAT_RANGES:()=>_G});function gh($){return $}function xh($){return $}function hh($){}function fh($){throw new Error("Unexpected value in exhaustive check")}function yh($){}function lU($){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 i1($,I){if(typeof I==="bigint")return I.toString();return I}function o1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function k4($){return $===null||$===void 0}function cU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function jG($,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 bq=Symbol("evaluating");function s($,I,U){let b=void 0;Object.defineProperty($,I,{get(){if(b===bq)return;if(b===void 0)b=bq,b=U();return b},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function uh($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function R4($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function T4(...$){let I={};for(let U of $){let b=Object.getOwnPropertyDescriptors(U);Object.assign(I,b)}return Object.defineProperties({},I)}function lh($){return T4($._zod.def)}function ch($,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 rh($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function WX($){return JSON.stringify($)}function EG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var QX="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function b1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var SG=o1(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function _4($){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 PG($){if(_4($))return{...$};if(Array.isArray($))return[...$];return $}function nh($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var ih=($)=>{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}`)}},mU=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 oh($){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 RG($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var TG={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]},_G={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function dh($,I){let U=$._zod.def,b=T4($._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 R4(this,"shape",w),w},checks:[]});return o$($,b)}function ph($,I){let U=$._zod.def,b=T4($._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 R4(this,"shape",w),w},checks:[]});return o$($,b)}function th($,I){if(!_4(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=T4($._zod.def,{get shape(){let X={...$._zod.def.shape,...I};return R4(this,"shape",X),X},checks:[]});return o$($,w)}function ah($,I){if(!_4(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 R4(this,"shape",b),b},checks:$._zod.def.checks};return o$($,U)}function eh($,I){let U=T4($._zod.def,{get shape(){let b={...$._zod.def.shape,...I._zod.def.shape};return R4(this,"shape",b),b},get catchall(){return I._zod.def.catchall},checks:[]});return o$($,U)}function sh($,I,U){let b=T4(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 R4(this,"shape",X),X},checks:[]});return o$(I,b)}function $f($,I,U){let b=T4(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 R4(this,"shape",X),X},checks:[]});return o$(I,b)}function Z4($,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 uU($){return typeof $==="string"?$:$?.message}function U6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=uU($.inst?._zod.def?.error?.($))??uU(I?.error?.($))??uU(U.customError?.($))??uU(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function rU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function nU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function d1(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function If($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function Xq($){let I=atob($),U=new Uint8Array(I.length);for(let b=0;b<I.length;b++)U[b]=I.charCodeAt(b);return U}function Dq($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function Uf($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return Xq(I+U)}function wf($){return Dq($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function bf($){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 Xf($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class Wq{constructor(...$){}}var Qq=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,i1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},iU=z("$ZodError",Qq),w6=z("$ZodError",Qq,{Parent:Error});function oU($,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 dU($,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 ZG($,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 Y=U,J=0;while(J<G.length){let H=G[J],B=J===G.length-1;if(typeof H==="string")Y.properties??(Y.properties={}),(D=Y.properties)[H]??(D[H]={errors:[]}),Y=Y.properties[H];else Y.items??(Y.items=[]),(W=Y.items)[H]??(W[H]={errors:[]}),Y=Y.items[H];if(B)Y.errors.push(I(Q));J++}}};return b($),U}function Gq($){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 CG($){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 ${Gq(b.path)}`);return I.join(`
|
|
43
|
-
`)}var p1=($)=>(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 QX(W,w?.callee),W}return D.value},GX=p1(w6),t1=($)=>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 QX(W,w?.callee),W}return D.value},YX=t1(w6),a1=($)=>(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($??iU)(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},gG=a1(w6),e1=($)=>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}},xG=e1(w6),NX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return p1($)(I,U,w)},Wf=NX(w6),JX=($)=>(I,U,b)=>{return p1($)(I,U,b)},Qf=JX(w6),BX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return t1($)(I,U,w)},Gf=BX(w6),HX=($)=>async(I,U,b)=>{return t1($)(I,U,b)},Yf=HX(w6),AX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return a1($)(I,U,w)},Nf=AX(w6),OX=($)=>(I,U,b)=>{return a1($)(I,U,b)},Jf=OX(w6),zX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return e1($)(I,U,w)},Bf=zX(w6),LX=($)=>async(I,U,b)=>{return e1($)(I,U,b)},Hf=LX(w6);var K6={};v6(K6,{xid:()=>uG,uuid7:()=>Lf,uuid6:()=>zf,uuid4:()=>Of,uuid:()=>X1,uppercase:()=>NY,unicodeEmail:()=>Yq,undefined:()=>GY,ulid:()=>yG,time:()=>IY,string:()=>wY,sha512_hex:()=>yf,sha512_base64url:()=>lf,sha512_base64:()=>uf,sha384_hex:()=>xf,sha384_base64url:()=>ff,sha384_base64:()=>hf,sha256_hex:()=>Zf,sha256_base64url:()=>gf,sha256_base64:()=>Cf,sha1_hex:()=>Rf,sha1_base64url:()=>_f,sha1_base64:()=>Tf,rfc5322Email:()=>vf,number:()=>DY,null:()=>QY,nanoid:()=>cG,md5_hex:()=>Sf,md5_base64url:()=>kf,md5_base64:()=>Pf,mac:()=>pG,lowercase:()=>YY,ksuid:()=>lG,ipv6:()=>dG,ipv4:()=>oG,integer:()=>XY,idnEmail:()=>Vf,html5Email:()=>Kf,hostname:()=>Ff,hex:()=>Ef,guid:()=>rG,extendedDuration:()=>Af,emoji:()=>iG,email:()=>nG,e164:()=>sG,duration:()=>mG,domain:()=>jf,datetime:()=>UY,date:()=>$Y,cuid2:()=>fG,cuid:()=>hG,cidrv6:()=>aG,cidrv4:()=>tG,browserEmail:()=>qf,boolean:()=>WY,bigint:()=>bY,base64url:()=>KX,base64:()=>eG});var hG=/^[cC][^\s-]{8,}$/,fG=/^[0-9a-z]+$/,yG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uG=/^[0-9a-vA-V]{20}$/,lG=/^[A-Za-z0-9]{27}$/,cG=/^[a-zA-Z0-9_-]{21}$/,mG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Af=/^[-+]?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)?)??$/,rG=/^([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})$`)},Of=X1(4),zf=X1(6),Lf=X1(7),nG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kf=/^[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])?)*$/,vf=/^(([^<>()\[\]\\.,;:\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,}))$/,Yq=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Vf=Yq,qf=/^[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])?)*$/,Mf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iG(){return new RegExp(Mf,"u")}var oG=/^(?:(?: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])$/,dG=/^(([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}|:))$/,pG=($)=>{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}$`)},tG=/^((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])$/,aG=/^(([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])$/,eG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,KX=/^[A-Za-z0-9_-]*$/,Ff=/^(?=.{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])?)*\.?$/,jf=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,sG=/^\+(?:[0-9]){6,14}[0-9]$/,Nq="(?:(?:\\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])))",$Y=new RegExp(`^${Nq}$`);function Jq($){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 IY($){return new RegExp(`^${Jq($)}$`)}function UY($){let I=Jq({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(`^${Nq}T(?:${b})$`)}var wY=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},bY=/^-?\d+n?$/,XY=/^-?\d+$/,DY=/^-?\d+(?:\.\d+)?/,WY=/^(?:true|false)$/i,QY=/^null$/i;var GY=/^undefined$/i;var YY=/^[^A-Z]*$/,NY=/^[^a-z]*$/,Ef=/^[0-9a-fA-F]*$/;function pU($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function tU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Sf=/^[0-9a-fA-F]{32}$/,Pf=pU(22,"=="),kf=tU(22),Rf=/^[0-9a-fA-F]{40}$/,Tf=pU(27,"="),_f=tU(27),Zf=/^[0-9a-fA-F]{64}$/,Cf=pU(43,"="),gf=tU(43),xf=/^[0-9a-fA-F]{96}$/,hf=pU(64,""),ff=tU(64),yf=/^[0-9a-fA-F]{128}$/,uf=pU(86,"=="),lf=tU(86);var A$=z("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),Hq={number:"number",bigint:"bigint",object:"date"},vX=z("$ZodCheckLessThan",($,I)=>{A$.init($,I);let U=Hq[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})}}),VX=z("$ZodCheckGreaterThan",($,I)=>{A$.init($,I);let U=Hq[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})}}),JY=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):jG(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})}}),BY=z("$ZodCheckNumberFormat",($,I)=>{A$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=TG[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=XY}),$._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:$})}}),HY=z("$ZodCheckBigIntFormat",($,I)=>{A$.init($,I);let[U,b]=_G[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:$})}}),AY=z("$ZodCheckMaxSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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:rU(w),code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),OY=z("$ZodCheckMinSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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:rU(w),code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),zY=z("$ZodCheckSizeEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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:rU(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})}}),LY=z("$ZodCheckMaxLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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=nU(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),KY=z("$ZodCheckMinLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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=nU(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),vY=z("$ZodCheckLengthEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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=nU(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})}}),s1=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=()=>{})}),VY=z("$ZodCheckRegex",($,I)=>{s1.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})}}),qY=z("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=YY),s1.init($,I)}),MY=z("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=NY),s1.init($,I)}),FY=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})}}),jY=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})}}),EY=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 Bq($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues))}var SY=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)=>Bq(w,U,I.property));Bq(b,U,I.property);return}}),PY=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})}}),kY=z("$ZodCheckOverwrite",($,I)=>{A$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class qX{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 bb($,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===F.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]})??M$(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===F.ZodString&&$.keyType._def.checks?.length){let{type:b,...w}=wb($.keyType._def,I);return{...U,propertyNames:w}}else if($.keyType?._def.typeName===F.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===F.ZodBranded&&$.keyType._def.type._def.typeName===F.ZodString&&$.keyType._def.type._def.checks?.length){let{type:b,...w}=Ub($.keyType._def,I);return{...U,propertyNames:w}}return U}function bz($,I){if(I.mapStrategy==="record")return bb($,I);let U=n($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||M$(I),b=n($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||M$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,b],minItems:2,maxItems:2}}}function Xz($){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 Dz($){return $.target==="openAi"?void 0:{not:M$({...$,currentPath:[...$.currentPath,"not"]})}}function Wz($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var YU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Gz($,I){if(I.target==="openApi3")return Qz($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((b)=>(b._def.typeName in YU)&&(!b._def.checks||!b._def.checks.length))){let b=U.reduce((w,X)=>{let D=YU[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 Qz($,I)}var Qz=($,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 Yz($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:YU[$.innerType._def.typeName],nullable:!0};return{type:[YU[$.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 Nz($,I){let U={type:"number"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"int":U.type="integer",R8(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 Jz($,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=Jk(Q);if(G&&U){if(Q._def.typeName==="ZodOptional")Q=Q._def.innerType;if(!Q.isNullable())Q=Q.nullable();G=!1}let Y=n(Q._def,{...I,currentPath:[...I.currentPath,"properties",W],propertyPath:[...I.currentPath,"properties",W]});if(Y===void 0)continue;if(b.properties[W]=Y,!G)w.push(W)}if(w.length)b.required=w;let D=Nk($,I);if(D!==void 0)b.additionalProperties=D;return b}function Nk($,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 Jk($){try{return $.isOptional()}catch{return!0}}var Bz=($,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:M$(I)},U]}:M$(I)};var Hz=($,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 Az($,I){return n($.type._def,I)}function Oz($,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 zz($,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 Lz($){return{not:M$($)}}function Kz($){return M$($)}var vz=($,I)=>{return n($.innerType._def,I)};var Vz=($,I,U)=>{switch(I){case F.ZodString:return wb($,U);case F.ZodNumber:return Nz($,U);case F.ZodObject:return Jz($,U);case F.ZodBigInt:return pO($,U);case F.ZodBoolean:return tO();case F.ZodDate:return T8($,U);case F.ZodUndefined:return Lz(U);case F.ZodNull:return Wz(U);case F.ZodArray:return dO($,U);case F.ZodUnion:case F.ZodDiscriminatedUnion:return Gz($,U);case F.ZodIntersection:return Iz($,U);case F.ZodTuple:return zz($,U);case F.ZodRecord:return bb($,U);case F.ZodLiteral:return Uz($,U);case F.ZodEnum:return $z($);case F.ZodNativeEnum:return Xz($);case F.ZodNullable:return Yz($,U);case F.ZodOptional:return Bz($,U);case F.ZodMap:return bz($,U);case F.ZodSet:return Oz($,U);case F.ZodLazy:return()=>$.getter()._def;case F.ZodPromise:return Az($,U);case F.ZodNaN:case F.ZodNever:return Dz(U);case F.ZodEffects:return sO($,U);case F.ZodAny:return M$(U);case F.ZodUnknown:return Kz(U);case F.ZodDefault:return eO($,U);case F.ZodBranded:return Ub($,U);case F.ZodReadonly:return vz($,U);case F.ZodCatch:return aO($,U);case F.ZodPipeline:return Hz($,U);case F.ZodFunction:case F.ZodVoid:case F.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!==nO)return W}if(b&&!U){let W=Bk(b,I);if(W!==void 0)return W}let w={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,w);let X=Vz($,$.typeName,I),D=typeof X==="function"?n(X(),I):X;if(D)Hk($,I,D);if(I.postProcess){let W=I.postProcess(D,$,I);return w.jsonSchema=D,W}return w.jsonSchema=D,D}var Bk=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:Ib(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`),M$(I);return I.$refStrategy==="seen"?M$(I):void 0}}},Hk=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var C8=($,I)=>{let U=oO(I),b=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((Q,[G,Y])=>({...Q,[G]:n(Y._def,{...U,currentPath:[...U.basePath,U.definitionPath,G]},!0)??M$(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)??M$(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 Ak($){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 g8($,I){if(B6($))return U8($,{target:Ak(I?.target),io:I?.pipeStrategy??"input"});return C8($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function x8($){let U=H4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Rw(U);if(typeof b!=="string")throw new Error("Schema method literal must be a string");return b}function h8($,I){let U=B4($,I);if(!U.success)throw U.error;return U.data}var Ok=60000;class f8{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(hw,(I)=>{this._oncancel(I)}),this.setNotificationHandler(yw,(I)=>{this._onprogress(I)}),this.setRequestHandler(fw,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(uw,async(I,U)=>{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new f(c.InvalidParams,"Failed to retrieve task: Task not found");return{...b}}),this.setRequestHandler(cw,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 Y=W,J=new f(Y.error.code,Y.error.message,Y.error.data);G(J)}else{let Y=D.type==="response"?"Response":"Error";this._onerror(new Error(`${Y} 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 f(c.InvalidParams,`Task not found: ${w}`);if(!O4(X.status))return await this._waitForTaskUpdate(w,U.signal),await b();if(O4(X.status)){let D=await this._taskStore.getTaskResult(w,U.sessionId);return this._clearTaskQueue(w),{...D,_meta:{...D._meta,[A4]:{taskId:w}}}}return await b()};return await b()}),this.setRequestHandler(mw,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 f(c.InvalidParams,`Failed to list tasks: ${b instanceof Error?b.message:String(b)}`)}}),this.setRequestHandler(nw,async(I,U)=>{try{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new f(c.InvalidParams,`Task not found: ${I.params.taskId}`);if(O4(b.status))throw new f(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 f(c.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...w}}catch(b){if(b instanceof f)throw b;throw new f(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($),f.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),UU(w)||_O(w))this._onresponse(w);else if(A8(w))this._onrequest(w,X);else if(TO(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=f.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?.[A4]?.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((Y)=>this._onerror(new Error(`Failed to enqueue error response: ${Y}`)));else b?.send(G).catch((Y)=>this._onerror(new Error(`Failed to send an error response: ${Y}`)));return}let X=new AbortController;this._requestHandlerAbortControllers.set($.id,X);let D=PO($.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 Y={relatedRequestId:$.id};if(w)Y.relatedTask={taskId:w};await this.notification(G,Y)},sendRequest:async(G,Y,J)=>{let H={...J,relatedRequestId:$.id};if(w&&!H.relatedTask)H.relatedTask={taskId:w};let B=H.relatedTask?.taskId??w;if(B&&W)await W.updateTaskStatus(B,"input_required");return await this.request(G,Y,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 Y={result:G,jsonrpc:"2.0",id:$.id};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"response",message:Y,timestamp:Date.now()},b?.sessionId);else await b?.send(Y)},async(G)=>{if(X.signal.aborted)return;let Y={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:Y,timestamp:Date.now()},b?.sessionId);else await b?.send(Y)}).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),UU($))U($);else{let X=new f($.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(UU($)&&$.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(UU($))b($);else{let X=f.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 f?X:new f(c.InternalError,String(X))}}return}let w;try{let X=await this.request($,j1,U);if(X.task)w=X.task.taskId,yield{type:"taskCreated",task:X.task};else throw new f(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},O4(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 f(c.InternalError,`Task ${w} failed`)};else if(D.status==="cancelled")yield{type:"error",error:new f(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 f?X:new f(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 Y=(q)=>{G(q)};if(!this._transport){Y(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),D)this.assertTaskCapability($.method)}catch(q){Y(q);return}U?.signal?.throwIfAborted();let J=this._requestMessageId++,H={...$,jsonrpc:"2.0",id:J};if(U?.onprogress)this._progressHandlers.set(J,U.onprogress),H.params={...$.params,_meta:{...$.params?._meta||{},progressToken:J}};if(D)H.params={...H.params,task:D};if(W)H.params={...H.params,_meta:{...H.params?._meta||{},[A4]:W}};let B=(q)=>{this._responseHandlers.delete(J),this._progressHandlers.delete(J),this._cleanupTimeout(J),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:J,reason:String(q)}},{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((P)=>this._onerror(new Error(`Failed to send cancellation: ${P}`)));let k=q instanceof f?q:new f(c.RequestTimeout,String(q));G(k)};this._responseHandlers.set(J,(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",()=>{B(U?.signal?.reason)});let A=U?.timeout??Ok,O=()=>B(f.fromError(c.RequestTimeout,"Request timed out",{timeout:A}));this._setupTimeout(J,A,U?.maxTotalTimeout,O,U?.resetTimeoutOnProgress??!1);let V=W?.taskId;if(V){let q=(k)=>{let P=this._responseHandlers.get(J);if(P)P(k);else this._onerror(new Error(`Response handler missing for side-channeled request ${J}`))};this._requestResolvers.set(J,q),this._enqueueTaskMessage(V,{type:"request",message:H,timestamp:Date.now()}).catch((k)=>{this._cleanupTimeout(J),G(k)})}else this._transport.send(H,{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((q)=>{this._cleanupTimeout(J),G(q)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},lw,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},rw,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},gO,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||{},[A4]: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||{},[A4]: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||{},[A4]:I.relatedTask}}};await this._transport.send(X,I)}setRequestHandler($,I){let U=x8($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(b,w)=>{let X=h8($,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=x8($);this._notificationHandlers.set(U,(b)=>{let w=h8($,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"&&A8(b.message)){let w=b.message.id,X=this._requestResolvers.get(w);if(X)X(new f(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 f(c.InvalidRequest,"Request cancelled"));return}let X=setTimeout(b,U);I.addEventListener("abort",()=>{clearTimeout(X),w(new f(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 f(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=WU.parse({method:"notifications/tasks/status",params:D});if(await this.notification(W),O4(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 f(c.InvalidParams,`Task "${b}" not found - it may have been cleaned up`);if(O4(D.status))throw new f(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=WU.parse({method:"notifications/tasks/status",params:W});if(await this.notification(Q),O4(W.status))this._cleanupTaskProgressHandler(b)}},listTasks:(b)=>{return U.listTasks(b,I)}}}}function qz($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function Mz($,I){let U={...$};for(let b in I){let w=b,X=I[w];if(X===void 0)continue;let D=U[w];if(qz(D)&&qz(X))U[w]={...D,...X};else U[w]=X}return U}var $V=ZH(_Q(),1),IV=ZH(sv(),1);function jx(){let $=new $V.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return IV.default($),$}class cQ{constructor($){this._ajv=$??jx()}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 mQ{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 wV($,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 rQ extends f8{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(GU.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 cQ,this.setRequestHandler(L8,(U)=>this._oninitialize(U)),this.setNotificationHandler(K8,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(E8,async(U,b)=>{let w=b.sessionId||b.requestInfo?.headers["mcp-session-id"]||void 0,{level:X}=U.params,D=GU.safeParse(X);if(D.success)this._loggingLevels.set(w,D.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new mQ(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Mz(this._capabilities,$)}setRequestHandler($,I){let b=H4($)?.method;if(!b)throw new Error("Schema is missing a method literal");let w;if(B6(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(S1,W);if(!G.success){let B=G.error instanceof Error?G.error.message:String(G.error);throw new f(c.InvalidParams,`Invalid tools/call request: ${B}`)}let{params:Y}=G.data,J=await Promise.resolve(I(W,Q));if(Y.task){let B=B4(j1,J);if(!B.success){let A=B.error instanceof Error?B.error.message:String(B.error);throw new f(c.InvalidParams,`Invalid task creation result: ${A}`)}return B.data}let H=B4(ew,J);if(!H.success){let B=H.error instanceof Error?H.error.message:String(H.error);throw new f(c.InvalidParams,`Invalid tools/call result: ${B}`)}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($){wV(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:jO.includes(I)?I:B8,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"},xw)}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((Y)=>Y.type==="tool_use").map((Y)=>Y.id)),G=new Set(b.filter((Y)=>Y.type==="tool_result").map((Y)=>Y.toolUseId));if(Q.size!==G.size||![...Q].every((Y)=>G.has(Y)))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:$},P8,I);return this.request({method:"sampling/createMessage",params:$},S8,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},sw,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},sw,I);if(w.action==="accept"&&w.content&&b.requestedSchema)try{let D=this._jsonSchemaValidator.getValidator(b.requestedSchema)(w.content);if(!D.valid)throw new f(c.InvalidParams,`Elicitation response content does not match requested schema: ${D.errorMessage}`)}catch(X){if(X instanceof f)throw X;throw new f(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 XV=Symbol.for("mcp.completable");function nQ($){return!!$&&typeof $==="object"&&XV in $}function DV($){return $[XV]?.complete}var bV;(function($){$.Completable="McpCompletable"})(bV||(bV={}));var Ex=/^[A-Za-z0-9._-]{1,128}$/;function Sx($){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(!Ex.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 Px($,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 iQ($){let I=Sx($);return Px($,I.warnings),I.isValid}class oQ{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 pQ{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 rQ($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new oQ(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(aw)),this.server.assertCanSetRequestHandler(F4(S1)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(aw,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let b=M1(I.inputSchema);return b?g8(b,{strictUnions:!0,pipeStrategy:"input"}):kx})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let b=M1(I.outputSchema);if(b)U.outputSchema=g8(b,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(S1,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new f(c.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new f(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 f(c.InternalError,`Tool ${$.params.name} has taskSupport '${w}' but was not registered with registerToolTask`);if(w==="required"&&!b)throw new f(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 f){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=M1($.inputSchema)??$.inputSchema,X=await Pw(w,I);if(!X.success){let D="error"in X?X.error:"Unknown error",W=kw(D);throw new f(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 f(c.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let b=M1($.outputSchema),w=await Pw(b,I.structuredContent);if(!w.success){let X="error"in w?w.error:"Unknown error",D=kw(X);throw new f(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((J)=>setTimeout(J,G));let Y=await U.taskStore.getTask(W);if(!Y)throw new f(c.InternalError,`Task ${W} not found during polling`);Q=Y}return await U.taskStore.getTaskResult(W)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(F4($b)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler($b,async($)=>{switch($.params.ref.type){case"ref/prompt":return lO($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return cO($),this.handleResourceCompletion($,$.params.ref);default:throw new f(c.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new f(c.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return CU;let w=H4(U.argsSchema)?.[$.params.argument.name];if(!nQ(w))return CU;let X=DV(w);if(!X)return CU;let D=await X($.params.argument.value,$.params.context);return QV(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 CU;throw new f(c.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let b=U.resourceTemplate.completeCallback($.params.argument.name);if(!b)return CU;let w=await b($.params.argument.value,$.params.context);return QV(w)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(iw)),this.server.assertCanSetRequestHandler(F4(ow)),this.server.assertCanSetRequestHandler(F4(dw)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(iw,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(ow,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(dw,async($,I)=>{let U=new URL($.params.uri),b=this._registeredResources[U.toString()];if(b){if(!b.enabled)throw new f(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 f(c.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(pw)),this.server.assertCanSetRequestHandler(F4(tw)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(pw,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?Tx(I.argsSchema):void 0}})})),this.server.setRequestHandler(tw,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new f(c.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let b=M1(U.argsSchema),w=await Pw(b,$.params.arguments);if(!w.success){let W="error"in w?w.error:"Unknown error",Q=kw(W);throw new f(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:d4(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=d4(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 J6?W._def?.innerType:W;return nQ(Q)}))this.setCompletionRequestHandler()}return X}_createRegisteredTool($,I,U,b,w,X,D,W,Q){iQ($);let G={title:I,description:U,inputSchema:WV(b),outputSchema:WV(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:(Y)=>{if(typeof Y.name!=="undefined"&&Y.name!==$){if(typeof Y.name==="string")iQ(Y.name);if(delete this._registeredTools[$],Y.name)this._registeredTools[Y.name]=G}if(typeof Y.title!=="undefined")G.title=Y.title;if(typeof Y.description!=="undefined")G.description=Y.description;if(typeof Y.paramsSchema!=="undefined")G.inputSchema=d4(Y.paramsSchema);if(typeof Y.outputSchema!=="undefined")G.outputSchema=d4(Y.outputSchema);if(typeof Y.callback!=="undefined")G.handler=Y.callback;if(typeof Y.annotations!=="undefined")G.annotations=Y.annotations;if(typeof Y._meta!=="undefined")G._meta=Y._meta;if(typeof Y.enabled!=="undefined")G.enabled=Y.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(dQ(W)){if(b=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!dQ(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 kx={type:"object",properties:{}};function GV($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Rx($){return"_def"in $||"_zod"in $||GV($)}function dQ($){if(typeof $!=="object"||$===null)return!1;if(Rx($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(GV)}function WV($){if(!$)return;if(dQ($))return d4($);return $}function Tx($){let I=H4($);if(!I)return[];return Object.entries(I).map(([U,b])=>{let w=UO(b),X=wO(b);return{name:U,description:w,required:!X}})}function F4($){let U=H4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Rw(U);if(typeof b==="string")return b;throw new Error("Schema method literal must be a string")}function QV($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var CU={completion:{values:[],hasMore:!1}};import NV from"node:process";class tQ{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),_x(I)}clear(){this._buffer=void 0}}function _x($){return ZO.parse(JSON.parse($))}function YV($){return JSON.stringify($)+`
|
|
42
|
+
`}class aQ{constructor($=NV.stdin,I=NV.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new tQ,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=YV($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:Zx,defineProperty:JV,getOwnPropertyDescriptor:Cx,getOwnPropertyNames:BV,getPrototypeOf:gx}=Object,xx=Object.prototype.hasOwnProperty,T6=($,I)=>function(){return I||$[BV($)[0]]((I={exports:{}}).exports,I),I.exports},hx=($,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],!xx.call($,W)&&W!==U)JV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=Cx(I,W))||b.enumerable})}return $},N$=($,I,U)=>(U=$!=null?Zx(gx($)):{},hx(I||!$||!$.__esModule?JV(U,"default",{value:$,enumerable:!0}):U,$)),HV=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}}),fx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=HV().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}}),yx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=HV().default,b=fx();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=yx();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(ux,I)}};return I}function ux($,I){return I($)}function eQ($){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 sQ($){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 mb($){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 AV($){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)})}function w4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function rb(){return Object.create(null)}var y1={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 OV=[y1.BAD_GATEWAY,y1.SERVICE_UNAVAILABLE,y1.GATEWAY_TIMEOUT,y1.INTERNAL_SERVER_ERROR];var{create:cx,defineProperty:LV,getOwnPropertyDescriptor:mx,getOwnPropertyNames:KV,getPrototypeOf:rx}=Object,nx=Object.prototype.hasOwnProperty,gU=($,I)=>function(){return I||$[KV($)[0]]((I={exports:{}}).exports,I),I.exports},ix=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=KV(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!nx.call($,W)&&W!==U)LV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=mx(I,W))||b.enumerable})}return $},xU=($,I,U)=>(U=$!=null?cx(rx($)):{},ix(I||!$||!$.__esModule?LV(U,"default",{value:$,enumerable:!0}):U,$)),vV=()=>{},zV=($)=>{if(Object.freeze)Object.freeze($)};function VV($,I,U){var b;let w=I.join(".");return(b=U[w])!==null&&b!==void 0||(U[w]=new Proxy(vV,{get(X,D){if(typeof D!=="string"||D==="then")return;return VV($,[...I,D],U)},apply(X,D,W){let Q=I[I.length-1];if(Q==="valueOf"||Q==="toString"||Q==="toJSON")return`tRPC.proxy(${I.slice(0,-1).join(".")})`;let 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 zV(G.args),zV(G.path),$(G)}})),U[w]}var nb=($)=>VV($,[],rb()),$G=($)=>{return new Proxy(vV,{get(I,U){if(U==="then")return;return $(U)}})};var qV=gU({"../../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}}),ox=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=qV().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}}),dx=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=qV().default,b=ox();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}}),IG=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=dx();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}}),ib=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=IG();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}}),Yp=xU(ib(),1);var Hp=xU(IG(),1);var ob=xU(ib(),1);function ax($,I){if("error"in $){let b=I.deserialize($.error);return{ok:!1,error:ob.default(ob.default({},$),{},{error:b})}}return{ok:!0,result:ob.default(ob.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var UG=class extends Error{constructor(){super("Unable to transform response from server")}};function wG($,I){let U;try{U=ax($,I)}catch(b){throw new UG}if(!U.ok&&(!w4(U.error.error)||typeof U.error.error.code!=="number"))throw new UG;if(U.ok&&!w4(U.result))throw new UG;return U}var Ap=xU(ib(),1);var Op=Symbol();var db=N$(u6(),1),u1=N$(_$(),1);function MV($){return $ instanceof j4}function Ih($){return w4($)&&w4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function Uh($,I){if(typeof $==="string")return $;if(w4($)&&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});db.default(this,"cause",void 0),db.default(this,"shape",void 0),db.default(this,"data",void 0),db.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(MV(b)){if(U.meta)b.meta=u1.default(u1.default({},b.meta),U.meta);return b}if(Ih(b))return new $(b.error.message,u1.default(u1.default({},U),{},{result:b,cause:U.cause}));return new $(Uh(b,"Unknown error"),u1.default(u1.default({},U),{},{cause:b}))}};function pb($){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 FV=($)=>typeof $==="function";function jV($){if($)return $;if(typeof window!=="undefined"&&FV(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&FV(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var hU=N$(_$(),1);function tb($){return{url:$.url.toString(),fetch:$.fetch,transformer:pb($.transformer),methodOverride:$.methodOverride}}function wh($){let I={};for(let U=0;U<$.length;U++){let b=$[U];I[U]=b}return I}var bh={query:"GET",mutation:"POST",subscription:"PATCH"};function EV($){return"input"in $?$.transformer.input.serialize($.input):wh($.inputs.map((I)=>$.transformer.input.serialize(I)))}var l1=($)=>{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=EV($);if(X!==void 0&&$.methodOverride!=="POST")w.push(`input=${encodeURIComponent(JSON.stringify(X))}`)}if(w.length)b+="?"+w.join("&");return b},SV=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=EV($);return I!==void 0?JSON.stringify(I):void 0},bG=($)=>{return ab(hU.default(hU.default({},$),{},{contentTypeHeader:"application/json",getUrl:l1,getBody:SV}))},Xh=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},Dh=($)=>{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 Xh};async function PV($){var I,U;Dh($.signal);let b=$.getUrl($),w=$.getBody($),X=(I=$.methodOverride)!==null&&I!==void 0?I:bh[$.type],D=await(async()=>{let Q=await $.headers();if(Symbol.iterator in Q)return Object.fromEntries(Q);return Q})(),W=hU.default(hU.default(hU.default({},$.contentTypeHeader&&X!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(U=$.trpcAcceptHeaderKey)!==null&&U!==void 0?U:"trpc-accept"]:$.trpcAcceptHeader}:void 0),D);return jV($.fetch)(b,{method:X,signal:$.signal,body:w,headers:W})}async function ab($){let I={},U=await PV($);I.response=U;let b=await U.json();return I.responseJSON=b,{json:b,meta:I}}function kV($){return $ instanceof Uint8Array||$ instanceof Blob}function RV($){return $ instanceof FormData}var c1=N$(_$(),1),Wh=($)=>{if("input"in $){let{input:I}=$;if(RV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return ab(c1.default(c1.default({},$),{},{contentTypeHeader:void 0,getUrl:l1,getBody:()=>I}))}if(kV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return ab(c1.default(c1.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:l1,getBody:()=>I}))}}return bG($)};function XG($){let I=tb($);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=Wh(c1.default(c1.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((Y)=>{G=Y.meta;let J=wG(Y.json,I.transformer.output);if(!J.ok){w.error(j4.from(J.error,{meta:G}));return}w.next({context:Y.meta,result:J.result}),w.complete()}).catch((Y)=>{w.error(j4.from(Y,{meta:G}))}),()=>{}})}}}var Bt=N$(_$(),1);var Ot=N$(_$(),1);var DG=($,...I)=>{return typeof $==="function"?$(...I):$},qt=N$(u6(),1);function Qh(){let $,I;return{promise:new Promise((b,w)=>{$=b,I=w}),resolve:$,reject:I}}async function Gh($){let I=await DG($.url);if(!$.connectionParams)return I;let b=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+b}async function Yh($,I){let U={method:"connectionParams",data:await DG($)};return I.encode(U)}var Mt=N$(u6(),1);var E4=N$(u6(),1);function Nh($){let{promise:I,resolve:U,reject:b}=Qh();return $.addEventListener("open",()=>{$.removeEventListener("error",b),U()}),$.addEventListener("error",b),I}function Jh($,{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 Bh=class ${constructor(I){var U;if(E4.default(this,"id",++$.connectCount),E4.default(this,"WebSocketPonyfill",void 0),E4.default(this,"urlOptions",void 0),E4.default(this,"keepAliveOpts",void 0),E4.default(this,"encoder",void 0),E4.default(this,"wsObservable",mb(null)),E4.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,this.encoder=I.encoder}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=Gh(I.urlOptions).then((b)=>new I.WebSocketPonyfill(b));I.openPromise=U.then(async(b)=>{if(I.ws=b,b.binaryType="arraybuffer",b.addEventListener("message",function({data:w}){if(w==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)Jh(b,I.keepAliveOpts);if(b.addEventListener("close",()=>{if(I.ws===b)I.ws=null}),await Nh(b),I.urlOptions.connectionParams)b.send(await Yh(I.urlOptions.connectionParams,I.encoder))});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()}}};E4.default(Bh,"connectCount",0);var Ft=N$(u6(),1),jt=N$(_$(),1);var WG=N$(u6(),1),TV=N$(_$(),1),Hh=class{constructor($){WG.default(this,"links",void 0),WG.default(this,"runtime",void 0),WG.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return AV({links:this.links,op:TV.default(TV.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(sQ())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await eQ(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 Ah=Symbol.for("trpc_untypedClient"),Oh={query:"query",mutate:"mutation",subscribe:"subscription"},zh=($)=>{return Oh[$]};function Lh($){let I=nb(({path:U,args:b})=>{let w=[...U],X=zh(w.pop()),D=w.join(".");return $[X](D,...b)});return $G((U)=>{if(U===Ah)return $;return I[U]})}function _V($){let I=new Hh($);return Lh(I)}var $a=N$(_$(),1);var Ia=N$(_$(),1);var Kh=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}}),Ua=N$(Kh(),1);var wa=N$(_$(),1);var vh=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 Y=G;if(typeof G!="function")throw new TypeError("Object is not disposable.");Y&&(G=function J(){try{Y.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,Y=0;function J(){for(;Q=X.pop();)try{if(!Q.a&&Y===1)return Y=0,X.push(Q),Promise.resolve().then(J);if(Q.d){var B=Q.d.call(Q.v);if(Q.a)return Y|=2,Promise.resolve(B).then(J,H)}else Y|=1}catch(A){return H(A)}if(Y===1)return G!==w?Promise.reject(G):Promise.resolve();if(G!==w)throw G}function H(B){return G=G!==w?new b(B,G):B,J()}return J()}}}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}}),Vh=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}}),qh=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(Y,J){try{var H=X[Y](J),B=H.value,A=B instanceof U;Promise.resolve(A?B.v:B).then(function(O){if(A){var V=Y==="return"?"return":"next";if(!B.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(Y,J){switch(Y){case"return":D.resolve({value:J,done:!0});break;case"throw":D.reject(J);break;default:D.resolve({value:J,done:!1})}(D=D.next)?Q(D.key,D.arg):W=null}this._invoke=function(Y,J){return new Promise(function(H,B){var A={key:Y,arg:J,resolve:H,reject:B,next:null};W?W=W.next=A:(D=W=A,Q(Y,J))})},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}}),ba=N$(vh(),1),Xa=N$(Vh(),1),Da=N$(qh(),1),Wa=N$(_$(),1);class QG{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 fU{constructor($){this.generateIdentifier=$,this.kv=new QG}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 GG extends fU{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 Mh($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function CV($,I){let U=Mh($);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 m1($,I){return $.indexOf(I)!==-1}function YG($,I){for(let U=0;U<$.length;U++){let b=$[U];if(I(b))return b}return}class NG{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return CV(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var Fh=($)=>Object.prototype.toString.call($).slice(8,-1),JG=($)=>typeof $==="undefined",jh=($)=>$===null,U1=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},eb=($)=>U1($)&&Object.keys($).length===0,_6=($)=>Array.isArray($),Eh=($)=>typeof $==="string",Sh=($)=>typeof $==="number"&&!isNaN($),Ph=($)=>typeof $==="boolean",gV=($)=>$ instanceof RegExp,S4=($)=>$ instanceof Map,P4=($)=>$ instanceof Set,BG=($)=>Fh($)==="Symbol",xV=($)=>$ instanceof Date&&!isNaN($.valueOf()),sb=($)=>$ instanceof Error,HG=($)=>typeof $==="number"&&isNaN($),hV=($)=>Ph($)||jh($)||JG($)||Sh($)||Eh($)||BG($),fV=($)=>typeof $==="bigint",yV=($)=>$===1/0||$===-1/0,uV=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),lV=($)=>$ instanceof URL;var $X=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),IX=($)=>$.map(String).map($X).join("."),r1=($,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 cV=[c6(JG,"undefined",()=>null,()=>{return}),c6(fV,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),c6(xV,"Date",($)=>$.toISOString(),($)=>new Date($)),c6(sb,"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(gV,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),c6(P4,"set",($)=>[...$.values()],($)=>new Set($)),c6(S4,"map",($)=>[...$.entries()],($)=>new Map($)),c6(($)=>HG($)||yV($),"number",($)=>{if(HG($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),c6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),c6(lV,"URL",($)=>$.toString(),($)=>new URL($))];function UX($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var mV=UX(($,I)=>{if(BG($))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}),kh=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),rV=UX(uV,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=kh[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function AG($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var nV=UX(AG,($,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),$)}),iV=UX(($,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($)}),Rh=[nV,mV,iV,rV],OG=($,I)=>{let U=YG(Rh,(w)=>w.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let b=YG(cV,(w)=>w.isApplicable($,I));if(b)return{value:b.transform($,I),type:b.annotation};return},oV={};cV.forEach(($)=>{oV[$.annotation]=$});var dV=($,I,U)=>{if(_6(I))switch(I[0]){case"symbol":return mV.untransform($,I,U);case"class":return nV.untransform($,I,U);case"custom":return iV.untransform($,I,U);case"typed-array":return rV.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let b=oV[I];if(!b)throw new Error("Unknown transformation: "+I);return b.untransform($,U)}};var n1=($,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 pV($){if(m1($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(m1($,"prototype"))throw new Error("prototype is not allowed as a property");if(m1($,"constructor"))throw new Error("constructor is not allowed as a property")}var tV=($,I)=>{pV(I);for(let U=0;U<I.length;U++){let b=I[U];if(P4($))$=n1($,+b);else if(S4($)){let w=+b,X=+I[++U]===0?"key":"value",D=n1($,w);switch(X){case"key":$=D;break;case"value":$=$.get(D);break}}else $=$[b]}return $},wX=($,I,U)=>{if(pV(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(P4(b)){let W=+D;b=n1(b,W)}else if(S4(b)){if(X===I.length-2)break;let Q=+D,G=+I[++X]===0?"key":"value",Y=n1(b,Q);switch(G){case"key":b=Y;break;case"value":b=b.get(Y);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(P4(b)){let X=n1(b,+w),D=U(X);if(X!==D)b.delete(X),b.add(D)}if(S4(b)){let X=+I[I.length-2],D=n1(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 aV=($)=>$<1;function zG($,I,U,b=[]){if(!$)return;let w=aV(U);if(!_6($)){I1($,(W,Q)=>zG(W,I,U,[...b,...r1(Q,w)]));return}let[X,D]=$;if(D)I1(D,(W,Q)=>{zG(W,I,U,[...b,...r1(Q,w)])});I(X,b)}function eV($,I,U,b){return zG(I,(w,X)=>{$=wX($,X,(D)=>dV(D,w,b))},U),$}function sV($,I,U){let b=aV(U);function w(X,D){let W=tV($,r1(D,b));X.map((Q)=>r1(Q,b)).forEach((Q)=>{$=wX($,Q,()=>W)})}if(_6(I)){let[X,D]=I;if(X.forEach((W)=>{$=wX($,r1(W,b),()=>$)}),D)I1(D,w)}else I1(I,w);return $}var Th=($,I)=>U1($)||_6($)||S4($)||P4($)||sb($)||AG($,I);function _h($,I,U){let b=U.get($);if(b)b.push(I);else U.set($,[I])}function $q($,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(IX);else U[IX(X)]=D.map(IX)}),b)if(eb(U))return[b];else return[b,U];else return eb(U)?void 0:U}var LG=($,I,U,b,w=[],X=[],D=new Map)=>{let W=hV($);if(!W){_h($,w,I);let B=D.get($);if(B)return b?{transformedValue:null}:B}if(!Th($,U)){let B=OG($,U),A=B?{transformedValue:B.value,annotations:[B.type]}:{transformedValue:$};if(!W)D.set($,A);return A}if(m1(X,$))return{transformedValue:null};let Q=OG($,U),G=Q?.value??$,Y=_6(G)?[]:{},J={};I1(G,(B,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=LG(B,I,U,b,[...w,A],[...X,$],D);if(Y[A]=O.transformedValue,_6(O.annotations))J[$X(A)]=O.annotations;else if(U1(O.annotations))I1(O.annotations,(V,q)=>{J[$X(A)+"."+q]=V})});let H=eb(J)?{transformedValue:Y,annotations:Q?[Q.type]:void 0}:{transformedValue:Y,annotations:Q?[Q.type,J]:J};if(!W)D.set($,H);return H};function bX($){return Object.prototype.toString.call($).slice(8,-1)}function XX($){return bX($)==="Array"}function KG($){if(bX($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function Zh($,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 DX($,I={}){if(XX($))return $.map((w)=>DX(w,I));if(!KG($))return $;let U=Object.getOwnPropertyNames($),b=Object.getOwnPropertySymbols($);return[...U,...b].reduce((w,X)=>{if(X==="__proto__")return w;if(XX(I.props)&&!I.props.includes(X))return w;let D=$[X],W=DX(D,I);return Zh(w,X,W,$,I.nonenumerable),w},{})}class U${constructor({dedupe:$=!1}={}){this.classRegistry=new GG,this.symbolRegistry=new fU((I)=>I.description??""),this.customTransformerRegistry=new NG,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=LG($,I,this,this.dedupe),b={json:U.transformedValue};if(U.annotations)b.meta={...b.meta,values:U.annotations};let w=$q(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:DX(U);if(b?.values)w=eV(w,b.values,b.v??0,this);if(b?.referentialEqualities)w=sV(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 Iq=U$;var{serialize:da,deserialize:pa,stringify:ta,parse:aa,registerClass:ea,registerCustom:sa,registerSymbol:$e,allowErrorProps:Ie}=U$;class vG{trpc;constructor($){this.trpc=_V({links:[XG({url:`${$.apiUrl}/trpc`,transformer:Iq,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 situate($){return this.trpc.mcpTools.situate.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 updateEdge($){return this.trpc.mcpTools.updateEdge.mutate($)}async updateArtifactLinkRelation($){return this.trpc.mcpTools.updateArtifactLinkRelation.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 VG($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var b4=VG();async function Uq($){let I=VG();I.info("Initializing server context...");let U=new vG({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 N={};v6(N,{xor:()=>PM,xid:()=>aq,void:()=>qM,uuidv7:()=>mq,uuidv6:()=>cq,uuidv4:()=>lq,uuid:()=>uq,util:()=>E,url:()=>rq,uppercase:()=>wI,unknown:()=>Y1,union:()=>_D,undefined:()=>vM,ulid:()=>tq,uint64:()=>LM,uint32:()=>AM,tuple:()=>fJ,trim:()=>GI,treeifyError:()=>ZG,transform:()=>CD,toUpperCase:()=>NI,toLowerCase:()=>YI,toJSONSchema:()=>XD,templateLiteral:()=>lM,symbol:()=>KM,superRefine:()=>GB,success:()=>fM,stringbool:()=>pM,stringFormat:()=>QM,string:()=>ND,strictObject:()=>EM,startsWith:()=>XI,slugify:()=>JI,size:()=>$I,setErrorMap:()=>Ou,set:()=>ZM,safeParseAsync:()=>JJ,safeParse:()=>NJ,safeEncodeAsync:()=>KJ,safeEncode:()=>zJ,safeDecodeAsync:()=>vJ,safeDecode:()=>LJ,registry:()=>TX,regexes:()=>K6,regex:()=>II,refine:()=>QB,record:()=>yJ,readonly:()=>UB,property:()=>UD,promise:()=>cM,prettifyError:()=>CG,preprocess:()=>aM,prefault:()=>pJ,positive:()=>eX,pipe:()=>J0,partialRecord:()=>RM,parseAsync:()=>YJ,parse:()=>GJ,overwrite:()=>Z6,optional:()=>Y0,object:()=>jM,number:()=>qJ,nullish:()=>hM,nullable:()=>N0,null:()=>SJ,normalize:()=>QI,nonpositive:()=>$D,nonoptional:()=>tJ,nonnegative:()=>ID,never:()=>TD,negative:()=>sX,nativeEnum:()=>CM,nanoid:()=>oq,nan:()=>yM,multipleOf:()=>C4,minSize:()=>g4,minLength:()=>X4,mime:()=>WI,meta:()=>oM,maxSize:()=>W1,maxLength:()=>Q1,map:()=>_M,mac:()=>$M,lte:()=>Y6,lt:()=>r6,lowercase:()=>UI,looseRecord:()=>TM,looseObject:()=>SM,locales:()=>X0,literal:()=>gM,length:()=>G1,lazy:()=>XB,ksuid:()=>eq,keyof:()=>FM,jwt:()=>WM,json:()=>tM,iso:()=>AI,ipv6:()=>IM,ipv4:()=>sq,intersection:()=>xJ,int64:()=>zM,int32:()=>HM,int:()=>JD,instanceof:()=>dM,includes:()=>bI,httpUrl:()=>nq,hostname:()=>GM,hex:()=>YM,hash:()=>NM,guid:()=>yq,gte:()=>p$,gt:()=>n6,globalRegistry:()=>d$,getErrorMap:()=>zu,function:()=>mM,fromJSONSchema:()=>sM,formatError:()=>dU,float64:()=>BM,float32:()=>JM,flattenError:()=>oU,file:()=>xM,enum:()=>ZD,endsWith:()=>DI,encodeAsync:()=>AJ,encode:()=>BJ,emoji:()=>iq,email:()=>fq,e164:()=>DM,discriminatedUnion:()=>kM,describe:()=>iM,decodeAsync:()=>OJ,decode:()=>HJ,date:()=>MM,custom:()=>nM,cuid2:()=>pq,cuid:()=>dq,core:()=>D4,config:()=>P$,coerce:()=>NB,codec:()=>uM,clone:()=>o$,cidrv6:()=>wM,cidrv4:()=>UM,check:()=>rM,catch:()=>sJ,boolean:()=>MJ,bigint:()=>OM,base64url:()=>XM,base64:()=>bM,array:()=>A0,any:()=>VM,_function:()=>mM,_default:()=>oJ,_ZodString:()=>BD,ZodXor:()=>ZJ,ZodXID:()=>vD,ZodVoid:()=>TJ,ZodUnknown:()=>kJ,ZodUnion:()=>z0,ZodUndefined:()=>jJ,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>KD,ZodType:()=>t,ZodTuple:()=>hJ,ZodTransform:()=>rJ,ZodTemplateLiteral:()=>wB,ZodSymbol:()=>FJ,ZodSuccess:()=>aJ,ZodStringFormat:()=>B$,ZodString:()=>zI,ZodSet:()=>lJ,ZodRecord:()=>L0,ZodRealError:()=>b6,ZodReadonly:()=>IB,ZodPromise:()=>DB,ZodPrefault:()=>dJ,ZodPipe:()=>hD,ZodOptional:()=>gD,ZodObject:()=>O0,ZodNumberFormat:()=>N1,ZodNumber:()=>KI,ZodNullable:()=>nJ,ZodNull:()=>EJ,ZodNonOptional:()=>xD,ZodNever:()=>RJ,ZodNanoID:()=>OD,ZodNaN:()=>$B,ZodMap:()=>uJ,ZodMAC:()=>VJ,ZodLiteral:()=>cJ,ZodLazy:()=>bB,ZodKSUID:()=>VD,ZodJWT:()=>kD,ZodIssueCode:()=>Au,ZodIntersection:()=>gJ,ZodISOTime:()=>GD,ZodISODuration:()=>YD,ZodISODateTime:()=>WD,ZodISODate:()=>QD,ZodIPv6:()=>MD,ZodIPv4:()=>qD,ZodGUID:()=>G0,ZodFunction:()=>WB,ZodFirstPartyTypeKind:()=>YB,ZodFile:()=>mJ,ZodError:()=>Bu,ZodEnum:()=>OI,ZodEmoji:()=>AD,ZodEmail:()=>HD,ZodE164:()=>PD,ZodDiscriminatedUnion:()=>CJ,ZodDefault:()=>iJ,ZodDate:()=>H0,ZodCustomStringFormat:()=>LI,ZodCustom:()=>K0,ZodCodec:()=>fD,ZodCatch:()=>eJ,ZodCUID2:()=>LD,ZodCUID:()=>zD,ZodCIDRv6:()=>jD,ZodCIDRv4:()=>FD,ZodBoolean:()=>vI,ZodBigIntFormat:()=>RD,ZodBigInt:()=>VI,ZodBase64URL:()=>SD,ZodBase64:()=>ED,ZodArray:()=>_J,ZodAny:()=>PJ,TimePrecision:()=>h7,NEVER:()=>qG,$output:()=>T7,$input:()=>_7,$brand:()=>MG});var D4={};v6(D4,{version:()=>RY,util:()=>E,treeifyError:()=>ZG,toJSONSchema:()=>XD,toDotPath:()=>Qq,safeParseAsync:()=>xG,safeParse:()=>gG,safeEncodeAsync:()=>Jf,safeEncode:()=>Yf,safeDecodeAsync:()=>Bf,safeDecode:()=>Nf,registry:()=>TX,regexes:()=>K6,process:()=>G$,prettifyError:()=>CG,parseAsync:()=>YX,parse:()=>GX,meta:()=>z5,locales:()=>X0,isValidJWT:()=>Sq,isValidBase64URL:()=>Eq,isValidBase64:()=>eY,initializeContext:()=>x4,globalRegistry:()=>d$,globalConfig:()=>yU,formatError:()=>dU,flattenError:()=>oU,finalize:()=>f4,extractDefs:()=>h4,encodeAsync:()=>Qf,encode:()=>Df,describe:()=>O5,decodeAsync:()=>Gf,decode:()=>Wf,createToJSONSchemaMethod:()=>K5,createStandardJSONSchemaMethod:()=>HI,config:()=>P$,clone:()=>o$,_xor:()=>my,_xid:()=>cX,_void:()=>W5,_uuidv7:()=>xX,_uuidv6:()=>gX,_uuidv4:()=>CX,_uuid:()=>ZX,_url:()=>W0,_uppercase:()=>wI,_unknown:()=>X5,_union:()=>cy,_undefined:()=>U5,_ulid:()=>lX,_uint64:()=>$5,_uint32:()=>d7,_tuple:()=>iy,_trim:()=>GI,_transform:()=>sy,_toUpperCase:()=>NI,_toLowerCase:()=>YI,_templateLiteral:()=>Qu,_symbol:()=>I5,_superRefine:()=>A5,_success:()=>bu,_stringbool:()=>L5,_stringFormat:()=>BI,_string:()=>C7,_startsWith:()=>XI,_slugify:()=>JI,_size:()=>$I,_set:()=>py,_safeParseAsync:()=>e1,_safeParse:()=>a1,_safeEncodeAsync:()=>zX,_safeEncode:()=>AX,_safeDecodeAsync:()=>LX,_safeDecode:()=>OX,_regex:()=>II,_refine:()=>H5,_record:()=>oy,_readonly:()=>Wu,_property:()=>UD,_promise:()=>Yu,_positive:()=>eX,_pipe:()=>Du,_parseAsync:()=>t1,_parse:()=>p1,_overwrite:()=>Z6,_optional:()=>$u,_number:()=>c7,_nullable:()=>Iu,_null:()=>w5,_normalize:()=>QI,_nonpositive:()=>$D,_nonoptional:()=>wu,_nonnegative:()=>ID,_never:()=>D5,_negative:()=>sX,_nativeEnum:()=>ay,_nanoid:()=>fX,_nan:()=>Y5,_multipleOf:()=>C4,_minSize:()=>g4,_minLength:()=>X4,_min:()=>p$,_mime:()=>WI,_maxSize:()=>W1,_maxLength:()=>Q1,_max:()=>Y6,_map:()=>dy,_mac:()=>x7,_lte:()=>Y6,_lt:()=>r6,_lowercase:()=>UI,_literal:()=>ey,_length:()=>G1,_lazy:()=>Gu,_ksuid:()=>mX,_jwt:()=>aX,_isoTime:()=>u7,_isoDuration:()=>l7,_isoDateTime:()=>f7,_isoDate:()=>y7,_ipv6:()=>nX,_ipv4:()=>rX,_intersection:()=>ny,_int64:()=>s7,_int32:()=>o7,_int:()=>r7,_includes:()=>bI,_guid:()=>D0,_gte:()=>p$,_gt:()=>n6,_float64:()=>i7,_float32:()=>n7,_file:()=>J5,_enum:()=>ty,_endsWith:()=>DI,_encodeAsync:()=>BX,_encode:()=>NX,_emoji:()=>hX,_email:()=>_X,_e164:()=>tX,_discriminatedUnion:()=>ry,_default:()=>Uu,_decodeAsync:()=>HX,_decode:()=>JX,_date:()=>Q5,_custom:()=>B5,_cuid2:()=>uX,_cuid:()=>yX,_coercedString:()=>g7,_coercedNumber:()=>m7,_coercedDate:()=>G5,_coercedBoolean:()=>t7,_coercedBigint:()=>e7,_cidrv6:()=>oX,_cidrv4:()=>iX,_check:()=>gq,_catch:()=>Xu,_boolean:()=>p7,_bigint:()=>a7,_base64url:()=>pX,_base64:()=>dX,_array:()=>N5,_any:()=>b5,TimePrecision:()=>h7,NEVER:()=>qG,JSONSchemaGenerator:()=>bJ,JSONSchema:()=>xq,Doc:()=>qX,$output:()=>T7,$input:()=>_7,$constructor:()=>z,$brand:()=>MG,$ZodXor:()=>ON,$ZodXID:()=>lY,$ZodVoid:()=>JN,$ZodUnknown:()=>YN,$ZodUnion:()=>eU,$ZodUndefined:()=>WN,$ZodUUID:()=>ZY,$ZodURL:()=>gY,$ZodULID:()=>uY,$ZodType:()=>o,$ZodTuple:()=>RX,$ZodTransform:()=>jN,$ZodTemplateLiteral:()=>xN,$ZodSymbol:()=>DN,$ZodSuccess:()=>TN,$ZodStringFormat:()=>J$,$ZodString:()=>D1,$ZodSet:()=>VN,$ZodRegistry:()=>Z7,$ZodRecord:()=>KN,$ZodRealError:()=>w6,$ZodReadonly:()=>gN,$ZodPromise:()=>fN,$ZodPrefault:()=>kN,$ZodPipe:()=>CN,$ZodOptional:()=>EN,$ZodObjectJIT:()=>AN,$ZodObject:()=>Rq,$ZodNumberFormat:()=>bN,$ZodNumber:()=>PX,$ZodNullable:()=>SN,$ZodNull:()=>QN,$ZodNonOptional:()=>RN,$ZodNever:()=>NN,$ZodNanoID:()=>hY,$ZodNaN:()=>ZN,$ZodMap:()=>vN,$ZodMAC:()=>pY,$ZodLiteral:()=>MN,$ZodLazy:()=>yN,$ZodKSUID:()=>cY,$ZodJWT:()=>UN,$ZodIntersection:()=>LN,$ZodISOTime:()=>nY,$ZodISODuration:()=>iY,$ZodISODateTime:()=>mY,$ZodISODate:()=>rY,$ZodIPv6:()=>dY,$ZodIPv4:()=>oY,$ZodGUID:()=>_Y,$ZodFunction:()=>hN,$ZodFile:()=>FN,$ZodError:()=>iU,$ZodEnum:()=>qN,$ZodEncodeError:()=>w1,$ZodEmoji:()=>xY,$ZodEmail:()=>CY,$ZodE164:()=>IN,$ZodDiscriminatedUnion:()=>zN,$ZodDefault:()=>PN,$ZodDate:()=>BN,$ZodCustomStringFormat:()=>wN,$ZodCustom:()=>uN,$ZodCodec:()=>sU,$ZodCheckUpperCase:()=>MY,$ZodCheckStringFormat:()=>s1,$ZodCheckStartsWith:()=>jY,$ZodCheckSizeEquals:()=>zY,$ZodCheckRegex:()=>VY,$ZodCheckProperty:()=>SY,$ZodCheckOverwrite:()=>kY,$ZodCheckNumberFormat:()=>BY,$ZodCheckMultipleOf:()=>JY,$ZodCheckMinSize:()=>OY,$ZodCheckMinLength:()=>KY,$ZodCheckMimeType:()=>PY,$ZodCheckMaxSize:()=>AY,$ZodCheckMaxLength:()=>LY,$ZodCheckLowerCase:()=>qY,$ZodCheckLessThan:()=>vX,$ZodCheckLengthEquals:()=>vY,$ZodCheckIncludes:()=>FY,$ZodCheckGreaterThan:()=>VX,$ZodCheckEndsWith:()=>EY,$ZodCheckBigIntFormat:()=>HY,$ZodCheck:()=>A$,$ZodCatch:()=>_N,$ZodCUID2:()=>yY,$ZodCUID:()=>fY,$ZodCIDRv6:()=>aY,$ZodCIDRv4:()=>tY,$ZodBoolean:()=>aU,$ZodBigIntFormat:()=>XN,$ZodBigInt:()=>kX,$ZodBase64URL:()=>$N,$ZodBase64:()=>sY,$ZodAsyncError:()=>m6,$ZodArray:()=>HN,$ZodAny:()=>GN});var qG=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,Y=Object.keys(G);for(let J=0;J<Y.length;J++){let H=Y[J];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 Y of G._zod.deferred)Y();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 MG=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 yU={};function P$($){if($)Object.assign(yU,$);return yU}var E={};v6(E,{unwrapMessage:()=>uU,uint8ArrayToHex:()=>bf,uint8ArrayToBase64url:()=>Uf,uint8ArrayToBase64:()=>Xq,stringifyPrimitive:()=>j,slugify:()=>EG,shallowClone:()=>PG,safeExtend:()=>th,required:()=>sh,randomString:()=>mh,propertyKeyTypes:()=>mU,promiseAllObject:()=>ch,primitiveTypes:()=>kG,prefixIssues:()=>G6,pick:()=>oh,partial:()=>eh,optionalKeys:()=>RG,omit:()=>dh,objectClone:()=>yh,numKeys:()=>rh,nullish:()=>k4,normalizeParams:()=>S,mergeDefs:()=>T4,merge:()=>ah,jsonStringifyReplacer:()=>i1,joinValues:()=>L,issue:()=>d1,isPlainObject:()=>_4,isObject:()=>b1,hexToUint8Array:()=>wf,getSizableOrigin:()=>rU,getParsedType:()=>nh,getLengthableOrigin:()=>nU,getEnumValues:()=>lU,getElementAtPath:()=>lh,floatSafeRemainder:()=>jG,finalizeIssue:()=>U6,extend:()=>ph,escapeRegex:()=>L6,esc:()=>WX,defineLazy:()=>s,createTransparentProxy:()=>ih,cloneDef:()=>uh,clone:()=>o$,cleanRegex:()=>cU,cleanEnum:()=>$f,captureStackTrace:()=>QX,cached:()=>o1,base64urlToUint8Array:()=>If,base64ToUint8Array:()=>bq,assignProp:()=>R4,assertNotEqual:()=>gh,assertNever:()=>hh,assertIs:()=>xh,assertEqual:()=>Ch,assert:()=>fh,allowsEval:()=>SG,aborted:()=>Z4,NUMBER_FORMAT_RANGES:()=>TG,Class:()=>Dq,BIGINT_FORMAT_RANGES:()=>_G});function Ch($){return $}function gh($){return $}function xh($){}function hh($){throw new Error("Unexpected value in exhaustive check")}function fh($){}function lU($){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 i1($,I){if(typeof I==="bigint")return I.toString();return I}function o1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function k4($){return $===null||$===void 0}function cU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function jG($,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 wq=Symbol("evaluating");function s($,I,U){let b=void 0;Object.defineProperty($,I,{get(){if(b===wq)return;if(b===void 0)b=wq,b=U();return b},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function yh($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function R4($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function T4(...$){let I={};for(let U of $){let b=Object.getOwnPropertyDescriptors(U);Object.assign(I,b)}return Object.defineProperties({},I)}function uh($){return T4($._zod.def)}function lh($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function ch($){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 mh($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function WX($){return JSON.stringify($)}function EG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var QX="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function b1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var SG=o1(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function _4($){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 PG($){if(_4($))return{...$};if(Array.isArray($))return[...$];return $}function rh($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var nh=($)=>{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}`)}},mU=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 ih($){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 RG($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var TG={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]},_G={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function oh($,I){let U=$._zod.def,b=T4($._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 R4(this,"shape",w),w},checks:[]});return o$($,b)}function dh($,I){let U=$._zod.def,b=T4($._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 R4(this,"shape",w),w},checks:[]});return o$($,b)}function ph($,I){if(!_4(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=T4($._zod.def,{get shape(){let X={...$._zod.def.shape,...I};return R4(this,"shape",X),X},checks:[]});return o$($,w)}function th($,I){if(!_4(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 R4(this,"shape",b),b},checks:$._zod.def.checks};return o$($,U)}function ah($,I){let U=T4($._zod.def,{get shape(){let b={...$._zod.def.shape,...I._zod.def.shape};return R4(this,"shape",b),b},get catchall(){return I._zod.def.catchall},checks:[]});return o$($,U)}function eh($,I,U){let b=T4(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 R4(this,"shape",X),X},checks:[]});return o$(I,b)}function sh($,I,U){let b=T4(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 R4(this,"shape",X),X},checks:[]});return o$(I,b)}function Z4($,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 uU($){return typeof $==="string"?$:$?.message}function U6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=uU($.inst?._zod.def?.error?.($))??uU(I?.error?.($))??uU(U.customError?.($))??uU(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function rU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function nU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function d1(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function $f($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function bq($){let I=atob($),U=new Uint8Array(I.length);for(let b=0;b<I.length;b++)U[b]=I.charCodeAt(b);return U}function Xq($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function If($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return bq(I+U)}function Uf($){return Xq($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function wf($){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 bf($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class Dq{constructor(...$){}}var Wq=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,i1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},iU=z("$ZodError",Wq),w6=z("$ZodError",Wq,{Parent:Error});function oU($,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 dU($,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 ZG($,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 Y=U,J=0;while(J<G.length){let H=G[J],B=J===G.length-1;if(typeof H==="string")Y.properties??(Y.properties={}),(D=Y.properties)[H]??(D[H]={errors:[]}),Y=Y.properties[H];else Y.items??(Y.items=[]),(W=Y.items)[H]??(W[H]={errors:[]}),Y=Y.items[H];if(B)Y.errors.push(I(Q));J++}}};return b($),U}function Qq($){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 CG($){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 ${Qq(b.path)}`);return I.join(`
|
|
43
|
+
`)}var p1=($)=>(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 QX(W,w?.callee),W}return D.value},GX=p1(w6),t1=($)=>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 QX(W,w?.callee),W}return D.value},YX=t1(w6),a1=($)=>(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($??iU)(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},gG=a1(w6),e1=($)=>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}},xG=e1(w6),NX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return p1($)(I,U,w)},Df=NX(w6),JX=($)=>(I,U,b)=>{return p1($)(I,U,b)},Wf=JX(w6),BX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return t1($)(I,U,w)},Qf=BX(w6),HX=($)=>async(I,U,b)=>{return t1($)(I,U,b)},Gf=HX(w6),AX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return a1($)(I,U,w)},Yf=AX(w6),OX=($)=>(I,U,b)=>{return a1($)(I,U,b)},Nf=OX(w6),zX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return e1($)(I,U,w)},Jf=zX(w6),LX=($)=>async(I,U,b)=>{return e1($)(I,U,b)},Bf=LX(w6);var K6={};v6(K6,{xid:()=>uG,uuid7:()=>zf,uuid6:()=>Of,uuid4:()=>Af,uuid:()=>X1,uppercase:()=>NY,unicodeEmail:()=>Gq,undefined:()=>GY,ulid:()=>yG,time:()=>IY,string:()=>wY,sha512_hex:()=>ff,sha512_base64url:()=>uf,sha512_base64:()=>yf,sha384_hex:()=>gf,sha384_base64url:()=>hf,sha384_base64:()=>xf,sha256_hex:()=>_f,sha256_base64url:()=>Cf,sha256_base64:()=>Zf,sha1_hex:()=>kf,sha1_base64url:()=>Tf,sha1_base64:()=>Rf,rfc5322Email:()=>Kf,number:()=>DY,null:()=>QY,nanoid:()=>cG,md5_hex:()=>Ef,md5_base64url:()=>Pf,md5_base64:()=>Sf,mac:()=>pG,lowercase:()=>YY,ksuid:()=>lG,ipv6:()=>dG,ipv4:()=>oG,integer:()=>XY,idnEmail:()=>vf,html5Email:()=>Lf,hostname:()=>Mf,hex:()=>jf,guid:()=>rG,extendedDuration:()=>Hf,emoji:()=>iG,email:()=>nG,e164:()=>sG,duration:()=>mG,domain:()=>Ff,datetime:()=>UY,date:()=>$Y,cuid2:()=>fG,cuid:()=>hG,cidrv6:()=>aG,cidrv4:()=>tG,browserEmail:()=>Vf,boolean:()=>WY,bigint:()=>bY,base64url:()=>KX,base64:()=>eG});var hG=/^[cC][^\s-]{8,}$/,fG=/^[0-9a-z]+$/,yG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uG=/^[0-9a-vA-V]{20}$/,lG=/^[A-Za-z0-9]{27}$/,cG=/^[a-zA-Z0-9_-]{21}$/,mG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hf=/^[-+]?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)?)??$/,rG=/^([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})$`)},Af=X1(4),Of=X1(6),zf=X1(7),nG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Lf=/^[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])?)*$/,Kf=/^(([^<>()\[\]\\.,;:\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,}))$/,Gq=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,vf=Gq,Vf=/^[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])?)*$/,qf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iG(){return new RegExp(qf,"u")}var oG=/^(?:(?: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])$/,dG=/^(([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}|:))$/,pG=($)=>{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}$`)},tG=/^((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])$/,aG=/^(([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])$/,eG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,KX=/^[A-Za-z0-9_-]*$/,Mf=/^(?=.{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])?)*\.?$/,Ff=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,sG=/^\+(?:[0-9]){6,14}[0-9]$/,Yq="(?:(?:\\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])))",$Y=new RegExp(`^${Yq}$`);function Nq($){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 IY($){return new RegExp(`^${Nq($)}$`)}function UY($){let I=Nq({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(`^${Yq}T(?:${b})$`)}var wY=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},bY=/^-?\d+n?$/,XY=/^-?\d+$/,DY=/^-?\d+(?:\.\d+)?/,WY=/^(?:true|false)$/i,QY=/^null$/i;var GY=/^undefined$/i;var YY=/^[^A-Z]*$/,NY=/^[^a-z]*$/,jf=/^[0-9a-fA-F]*$/;function pU($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function tU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Ef=/^[0-9a-fA-F]{32}$/,Sf=pU(22,"=="),Pf=tU(22),kf=/^[0-9a-fA-F]{40}$/,Rf=pU(27,"="),Tf=tU(27),_f=/^[0-9a-fA-F]{64}$/,Zf=pU(43,"="),Cf=tU(43),gf=/^[0-9a-fA-F]{96}$/,xf=pU(64,""),hf=tU(64),ff=/^[0-9a-fA-F]{128}$/,yf=pU(86,"=="),uf=tU(86);var A$=z("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),Bq={number:"number",bigint:"bigint",object:"date"},vX=z("$ZodCheckLessThan",($,I)=>{A$.init($,I);let U=Bq[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})}}),VX=z("$ZodCheckGreaterThan",($,I)=>{A$.init($,I);let U=Bq[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})}}),JY=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):jG(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})}}),BY=z("$ZodCheckNumberFormat",($,I)=>{A$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=TG[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=XY}),$._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:$})}}),HY=z("$ZodCheckBigIntFormat",($,I)=>{A$.init($,I);let[U,b]=_G[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:$})}}),AY=z("$ZodCheckMaxSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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:rU(w),code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),OY=z("$ZodCheckMinSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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:rU(w),code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),zY=z("$ZodCheckSizeEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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:rU(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})}}),LY=z("$ZodCheckMaxLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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=nU(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),KY=z("$ZodCheckMinLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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=nU(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),vY=z("$ZodCheckLengthEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(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=nU(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})}}),s1=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=()=>{})}),VY=z("$ZodCheckRegex",($,I)=>{s1.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})}}),qY=z("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=YY),s1.init($,I)}),MY=z("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=NY),s1.init($,I)}),FY=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})}}),jY=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})}}),EY=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 Jq($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues))}var SY=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)=>Jq(w,U,I.property));Jq(b,U,I.property);return}}),PY=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})}}),kY=z("$ZodCheckOverwrite",($,I)=>{A$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class qX{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 RY={major:4,minor:2,patch:1};var o=z("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=RY;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=Z4(D),Y;for(let J of W){if(J._zod.def.when){if(!J._zod.def.when(D))continue}else if(G)continue;let H=D.issues.length,B=J._zod.check(D);if(B instanceof Promise&&Q?.async===!1)throw new m6;if(Y||B instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await B,D.issues.length===H)return;if(!G)G=Z4(D,H)});else{if(D.issues.length===H)continue;if(!G)G=Z4(D,H)}}if(Y)return Y.then(()=>{return D});return D},X=(D,W,Q)=>{if(Z4(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((Y)=>$._zod.parse(Y,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((Y)=>{return X(Y,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=gG($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return xG($,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()??wY($._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}}),J$=z("$ZodStringFormat",($,I)=>{s1.init($,I),D1.init($,I)}),_Y=z("$ZodGUID",($,I)=>{I.pattern??(I.pattern=rG),J$.init($,I)}),ZY=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());J$.init($,I)}),CY=z("$ZodEmail",($,I)=>{I.pattern??(I.pattern=nG),J$.init($,I)}),gY=z("$ZodURL",($,I)=>{J$.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})}}}),xY=z("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=iG()),J$.init($,I)}),hY=z("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=cG),J$.init($,I)}),fY=z("$ZodCUID",($,I)=>{I.pattern??(I.pattern=hG),J$.init($,I)}),yY=z("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=fG),J$.init($,I)}),uY=z("$ZodULID",($,I)=>{I.pattern??(I.pattern=yG),J$.init($,I)}),lY=z("$ZodXID",($,I)=>{I.pattern??(I.pattern=uG),J$.init($,I)}),cY=z("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=lG),J$.init($,I)}),mY=z("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=UY(I)),J$.init($,I)}),rY=z("$ZodISODate",($,I)=>{I.pattern??(I.pattern=$Y),J$.init($,I)}),nY=z("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=IY(I)),J$.init($,I)}),iY=z("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=mG),J$.init($,I)}),oY=z("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=oG),J$.init($,I),$._zod.bag.format="ipv4"}),dY=z("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=dG),J$.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})}}}),pY=z("$ZodMAC",($,I)=>{I.pattern??(I.pattern=pG(I.delimiter)),J$.init($,I),$._zod.bag.format="mac"}),tY=z("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=tG),J$.init($,I)}),aY=z("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=aG),J$.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 eY($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var sY=z("$ZodBase64",($,I)=>{I.pattern??(I.pattern=eG),J$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(eY(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function Sq($){if(!KX.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return eY(U)}var $N=z("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=KX),J$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(Sq(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),IN=z("$ZodE164",($,I)=>{I.pattern??(I.pattern=sG),J$.init($,I)});function Pq($,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 UN=z("$ZodJWT",($,I)=>{J$.init($,I),$._zod.check=(U)=>{if(Pq(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),wN=z("$ZodCustomStringFormat",($,I)=>{J$.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})}}),PX=z("$ZodNumber",($,I)=>{o.init($,I),$._zod.pattern=$._zod.bag.pattern??DY,$._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}}),bN=z("$ZodNumberFormat",($,I)=>{BY.init($,I),PX.init($,I)}),aU=z("$ZodBoolean",($,I)=>{o.init($,I),$._zod.pattern=WY,$._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}}),kX=z("$ZodBigInt",($,I)=>{o.init($,I),$._zod.pattern=bY,$._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}}),XN=z("$ZodBigIntFormat",($,I)=>{HY.init($,I),kX.init($,I)}),DN=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}}),WN=z("$ZodUndefined",($,I)=>{o.init($,I),$._zod.pattern=GY,$._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}}),QN=z("$ZodNull",($,I)=>{o.init($,I),$._zod.pattern=QY,$._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}}),GN=z("$ZodAny",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),YN=z("$ZodUnknown",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),NN=z("$ZodNever",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),JN=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}}),BN=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 Oq($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var HN=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)=>Oq(G,U,D)));else Oq(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function SX($,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 kq($){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=RG($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function Rq($,I,U,b,w,X){let D=[],W=w.keySet,Q=w.catchall._zod,G=Q.def.type;for(let Y in I){if(W.has(Y))continue;if(G==="never"){D.push(Y);continue}let J=Q.run({value:I[Y],issues:[]},b);if(J instanceof Promise)$.push(J.then((H)=>SX(H,U,Y,I)));else SX(J,U,Y,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 Tq=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=o1(()=>kq(I));s($._zod,"propValues",()=>{let W=I.shape,Q={};for(let G in W){let Y=W[G]._zod;if(Y.values){Q[G]??(Q[G]=new Set);for(let J of Y.values)Q[G].add(J)}}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 Y=[],J=D.shape;for(let H of D.keys){let A=J[H]._zod.run({value:G[H],issues:[]},Q);if(A instanceof Promise)Y.push(A.then((O)=>SX(O,W,H,G)));else SX(A,W,H,G)}if(!X)return Y.length?Promise.all(Y).then(()=>W):W;return Rq(Y,G,W,Q,b.value,$)}}),AN=z("$ZodObjectJIT",($,I)=>{Tq.init($,I);let U=$._zod.parse,b=o1(()=>kq(I)),w=(H)=>{let B=new qX(["shape","payload","ctx"]),A=b.value,O=(P)=>{let h=WX(P);return`shape[${h}]._zod.run({ value: input[${h}], issues: [] }, ctx)`};B.write("const input = payload.value;");let V=Object.create(null),q=0;for(let P of A.keys)V[P]=`key_${q++}`;B.write("const newResult = {};");for(let P of A.keys){let h=V[P],l=WX(P);B.write(`const ${h} = ${O(P)};`),B.write(`
|
|
45
|
+
`))}}var RY={major:4,minor:2,patch:1};var o=z("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=RY;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=Z4(D),Y;for(let J of W){if(J._zod.def.when){if(!J._zod.def.when(D))continue}else if(G)continue;let H=D.issues.length,B=J._zod.check(D);if(B instanceof Promise&&Q?.async===!1)throw new m6;if(Y||B instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await B,D.issues.length===H)return;if(!G)G=Z4(D,H)});else{if(D.issues.length===H)continue;if(!G)G=Z4(D,H)}}if(Y)return Y.then(()=>{return D});return D},X=(D,W,Q)=>{if(Z4(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((Y)=>$._zod.parse(Y,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((Y)=>{return X(Y,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=gG($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return xG($,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()??wY($._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}}),J$=z("$ZodStringFormat",($,I)=>{s1.init($,I),D1.init($,I)}),_Y=z("$ZodGUID",($,I)=>{I.pattern??(I.pattern=rG),J$.init($,I)}),ZY=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());J$.init($,I)}),CY=z("$ZodEmail",($,I)=>{I.pattern??(I.pattern=nG),J$.init($,I)}),gY=z("$ZodURL",($,I)=>{J$.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})}}}),xY=z("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=iG()),J$.init($,I)}),hY=z("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=cG),J$.init($,I)}),fY=z("$ZodCUID",($,I)=>{I.pattern??(I.pattern=hG),J$.init($,I)}),yY=z("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=fG),J$.init($,I)}),uY=z("$ZodULID",($,I)=>{I.pattern??(I.pattern=yG),J$.init($,I)}),lY=z("$ZodXID",($,I)=>{I.pattern??(I.pattern=uG),J$.init($,I)}),cY=z("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=lG),J$.init($,I)}),mY=z("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=UY(I)),J$.init($,I)}),rY=z("$ZodISODate",($,I)=>{I.pattern??(I.pattern=$Y),J$.init($,I)}),nY=z("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=IY(I)),J$.init($,I)}),iY=z("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=mG),J$.init($,I)}),oY=z("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=oG),J$.init($,I),$._zod.bag.format="ipv4"}),dY=z("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=dG),J$.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})}}}),pY=z("$ZodMAC",($,I)=>{I.pattern??(I.pattern=pG(I.delimiter)),J$.init($,I),$._zod.bag.format="mac"}),tY=z("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=tG),J$.init($,I)}),aY=z("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=aG),J$.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 eY($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var sY=z("$ZodBase64",($,I)=>{I.pattern??(I.pattern=eG),J$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(eY(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function Eq($){if(!KX.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return eY(U)}var $N=z("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=KX),J$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(Eq(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),IN=z("$ZodE164",($,I)=>{I.pattern??(I.pattern=sG),J$.init($,I)});function Sq($,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 UN=z("$ZodJWT",($,I)=>{J$.init($,I),$._zod.check=(U)=>{if(Sq(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),wN=z("$ZodCustomStringFormat",($,I)=>{J$.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})}}),PX=z("$ZodNumber",($,I)=>{o.init($,I),$._zod.pattern=$._zod.bag.pattern??DY,$._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}}),bN=z("$ZodNumberFormat",($,I)=>{BY.init($,I),PX.init($,I)}),aU=z("$ZodBoolean",($,I)=>{o.init($,I),$._zod.pattern=WY,$._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}}),kX=z("$ZodBigInt",($,I)=>{o.init($,I),$._zod.pattern=bY,$._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}}),XN=z("$ZodBigIntFormat",($,I)=>{HY.init($,I),kX.init($,I)}),DN=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}}),WN=z("$ZodUndefined",($,I)=>{o.init($,I),$._zod.pattern=GY,$._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}}),QN=z("$ZodNull",($,I)=>{o.init($,I),$._zod.pattern=QY,$._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}}),GN=z("$ZodAny",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),YN=z("$ZodUnknown",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),NN=z("$ZodNever",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),JN=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}}),BN=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 Aq($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var HN=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)=>Aq(G,U,D)));else Aq(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function SX($,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 Pq($){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=RG($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function kq($,I,U,b,w,X){let D=[],W=w.keySet,Q=w.catchall._zod,G=Q.def.type;for(let Y in I){if(W.has(Y))continue;if(G==="never"){D.push(Y);continue}let J=Q.run({value:I[Y],issues:[]},b);if(J instanceof Promise)$.push(J.then((H)=>SX(H,U,Y,I)));else SX(J,U,Y,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 Rq=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=o1(()=>Pq(I));s($._zod,"propValues",()=>{let W=I.shape,Q={};for(let G in W){let Y=W[G]._zod;if(Y.values){Q[G]??(Q[G]=new Set);for(let J of Y.values)Q[G].add(J)}}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 Y=[],J=D.shape;for(let H of D.keys){let A=J[H]._zod.run({value:G[H],issues:[]},Q);if(A instanceof Promise)Y.push(A.then((O)=>SX(O,W,H,G)));else SX(A,W,H,G)}if(!X)return Y.length?Promise.all(Y).then(()=>W):W;return kq(Y,G,W,Q,b.value,$)}}),AN=z("$ZodObjectJIT",($,I)=>{Rq.init($,I);let U=$._zod.parse,b=o1(()=>Pq(I)),w=(H)=>{let B=new qX(["shape","payload","ctx"]),A=b.value,O=(P)=>{let h=WX(P);return`shape[${h}]._zod.run({ value: input[${h}], issues: [] }, ctx)`};B.write("const input = payload.value;");let V=Object.create(null),q=0;for(let P of A.keys)V[P]=`key_${q++}`;B.write("const newResult = {};");for(let P of A.keys){let h=V[P],l=WX(P);B.write(`const ${h} = ${O(P)};`),B.write(`
|
|
46
46
|
if (${h}.issues.length) {
|
|
47
47
|
payload.issues = payload.issues.concat(${h}.issues.map(iss => ({
|
|
48
48
|
...iss,
|
|
@@ -59,50 +59,50 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
59
59
|
newResult[${l}] = ${h}.value;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
`)}B.write("payload.value = newResult;"),B.write("return payload;");let k=B.compile();return(P,h)=>k(H,P,h)},X,D=b1,W=!yU.jitless,G=W&&SG.value,Y=I.catchall,J;$._zod.parse=(H,B)=>{J??(J=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&&B?.async===!1&&B.jitless!==!0){if(!X)X=w(I.shape);if(H=X(H,B),!Y)return H;return Rq([],A,H,B,J,$)}return U(H,B)}});function zq($,I,U,b){for(let X of $)if(X.issues.length===0)return I.value=X.value,I;let w=$.filter((X)=>!Z4(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 eU=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)=>cU(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 zq(W,w,$,X);return Promise.all(W).then((Q)=>{return zq(Q,w,$,X)})}});function Lq($,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 ON=z("$ZodXor",($,I)=>{eU.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 Lq(W,w,$,X);return Promise.all(W).then((Q)=>{return Lq(Q,w,$,X)})}}),zN=z("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,eU.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=o1(()=>{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}}),LN=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 Kq(U,Q,G)});return Kq(U,X,D)}});function TY($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(_4($)&&_4(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=TY($[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=TY(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 Kq($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(Z4($))return $;let b=TY(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var RX=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((Y)=>Y._zod.optin!=="optional"),Q=W===-1?0:U.length-W;if(!I.rest){let Y=X.length>U.length,J=X.length<Q-1;if(Y||J)return b.issues.push({...Y?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:X,inst:$,origin:"array"}),b}let G=-1;for(let Y of U){if(G++,G>=X.length){if(G>=Q)continue}let J=Y._zod.run({value:X[G],issues:[]},w);if(J instanceof Promise)D.push(J.then((H)=>MX(H,b,G)));else MX(J,b,G)}if(I.rest){let Y=X.slice(U.length);for(let J of Y){G++;let H=I.rest._zod.run({value:J,issues:[]},w);if(H instanceof Promise)D.push(H.then((B)=>MX(B,b,G)));else MX(H,b,G)}}if(D.length)return Promise.all(D).then(()=>b);return b}});function MX($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var KN=z("$ZodRecord",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!_4(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 Y=I.valueType._zod.run({value:w[G],issues:[]},b);if(Y instanceof Promise)X.push(Y.then((J)=>{if(J.issues.length)U.issues.push(...G6(G,J.issues));U.value[G]=J.value}));else{if(Y.issues.length)U.issues.push(...G6(G,Y.issues));U.value[G]=Y.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((Y)=>U6(Y,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((Y)=>{if(Y.issues.length)U.issues.push(...G6(W,Y.issues));U.value[Q.value]=Y.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}}),vN=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(([Y,J])=>{vq(Y,J,U,D,w,$,b)}));else vq(Q,G,U,D,w,$,b)}if(X.length)return Promise.all(X).then(()=>U);return U}});function vq($,I,U,b,w,X,D){if($.issues.length)if(mU.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(mU.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 VN=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)=>Vq(Q,U)));else Vq(W,U)}if(X.length)return Promise.all(X).then(()=>U);return U}});function Vq($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var qN=z("$ZodEnum",($,I)=>{o.init($,I);let U=lU(I.entries),b=new Set(U);$._zod.values=b,$._zod.pattern=new RegExp(`^(${U.filter((w)=>mU.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}}),MN=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}}),FN=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}}),jN=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 qq($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var EN=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(`^(${cU(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)=>qq(X,U.value));return qq(w,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),SN=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(`^(${cU(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)}}),PN=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)=>Mq(X,I));return Mq(w,I)}});function Mq($,I){if($.value===void 0)$.value=I.defaultValue;return $}var kN=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)}}),RN=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)=>Fq(X,$));return Fq(w,$)}});function Fq($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var TN=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}}),_N=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}}),ZN=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}}),CN=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)=>FX(D,I.in,b));return FX(X,I.in,b)}let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>FX(X,I.out,b));return FX(w,I.out,b)}});function FX($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var sU=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)=>jX(D,I,b));return jX(X,I,b)}else{let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>jX(D,I,b));return jX(X,I,b)}}});function jX($,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)=>EX($,X,I.out,U));return EX($,w,I.out,U)}else{let w=I.reverseTransform($.value,$);if(w instanceof Promise)return w.then((X)=>EX($,X,I.in,U));return EX($,w,I.in,U)}}function EX($,I,U,b){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},b)}var gN=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(jq);return jq(w)}});function jq($){return $.value=Object.freeze($.value),$}var xN=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}}),hN=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?GX($._def.input,b):b,X=Reflect.apply(U,this,w);if($._def.output)return GX($._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 YX($._def.input,b):b,X=await Reflect.apply(U,this,w);if($._def.output)return await YX($._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 RX({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})},$}),fN=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))}}),yN=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)}}),uN=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)=>Eq(X,U,b,$));Eq(w,U,b,$);return}});function Eq($,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(d1(w))}}var X0={};v6(X0,{zhTW:()=>k7,zhCN:()=>P7,yo:()=>R7,vi:()=>S7,ur:()=>E7,uk:()=>b0,ua:()=>j7,tr:()=>F7,th:()=>M7,ta:()=>q7,sv:()=>V7,sl:()=>v7,ru:()=>K7,pt:()=>L7,ps:()=>O7,pl:()=>z7,ota:()=>A7,no:()=>H7,nl:()=>B7,ms:()=>J7,mk:()=>N7,lt:()=>Y7,ko:()=>G7,km:()=>I0,kh:()=>Q7,ka:()=>W7,ja:()=>D7,it:()=>X7,is:()=>b7,id:()=>w7,hu:()=>U7,he:()=>I7,frCA:()=>$7,fr:()=>sN,fi:()=>eN,fa:()=>aN,es:()=>tN,eo:()=>pN,en:()=>$0,de:()=>dN,da:()=>oN,cs:()=>iN,ca:()=>nN,bg:()=>rN,be:()=>mN,az:()=>cN,ar:()=>lN});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 lN(){return{localeError:mf()}}var rf=()=>{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 cN(){return{localeError:rf()}}function _q($,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 nf=()=>{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=_q(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=_q(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 mN(){return{localeError:nf()}}var of=($)=>{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},df=()=>{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}, получен ${of(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 rN(){return{localeError:df()}}var pf=()=>{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 nN(){return{localeError:pf()}}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 iN(){return{localeError:tf()}}var af=()=>{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 oN(){return{localeError:af()}}var ef=()=>{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 dN(){return{localeError:ef()}}var sf=($)=>{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},$y=()=>{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 ${sf(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 $0(){return{localeError:$y()}}var Iy=($)=>{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},Uy=()=>{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 ${Iy(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 pN(){return{localeError:Uy()}}var wy=()=>{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 tN(){return{localeError:wy()}}var by=()=>{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 aN(){return{localeError:by()}}var Xy=()=>{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 eN(){return{localeError:Xy()}}var Dy=()=>{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 sN(){return{localeError:Dy()}}var Wy=()=>{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 $7(){return{localeError:Wy()}}var Qy=()=>{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 Y=U(G);if(Y)return Y.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 Y=typeof G;switch(Y){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 Y}},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 Y=G.expected,J=b(Y),H=W(G.input),B=$[H]?.label??H;return`קלט לא תקין: צריך להיות ${J}, התקבל ${B}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(G.values[0])}`;let Y=G.values.map((B)=>j(B));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Y[0]} או ${Y[1]}`;let J=Y[Y.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Y.slice(0,-1).join(", ")} או ${J}`}case"too_big":{let Y=D(G.origin),J=w(G.origin??"value");if(G.origin==="string")return`${Y?.longLabel??"ארוך"} מדי: ${J} צריכה להכיל ${G.maximum.toString()} ${Y?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let A=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${J} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך",O=G.inclusive?`${G.maximum} ${Y?.unit??""} או פחות`:`פחות מ-${G.maximum} ${Y?.unit??""}`;return`גדול מדי: ${J} ${A} להכיל ${O}`.trim()}let H=G.inclusive?"<=":"<",B=X(G.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${J} ${B} ${H}${G.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${J} ${B} ${H}${G.maximum.toString()}`}case"too_small":{let Y=D(G.origin),J=w(G.origin??"value");if(G.origin==="string")return`${Y?.shortLabel??"קצר"} מדי: ${J} צריכה להכיל ${G.minimum.toString()} ${Y?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let A=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${J} צריך להיות ${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`קטן מדי: ${J} ${A} להכיל ${V}`}let O=G.inclusive?`${G.minimum} ${Y?.unit??""} או יותר`:`יותר מ-${G.minimum} ${Y?.unit??""}`;return`קטן מדי: ${J} ${A} להכיל ${O}`.trim()}let H=G.inclusive?">=":">",B=X(G.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${J} ${B} ${H}${G.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${J} ${B} ${H}${G.minimum.toString()}`}case"invalid_format":{let Y=G;if(Y.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${Y.prefix}"`;if(Y.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${Y.suffix}"`;if(Y.format==="includes")return`המחרוזת חייבת לכלול "${Y.includes}"`;if(Y.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${Y.pattern}`;let J=Q[Y.format],H=J?.label??Y.format,A=(J?.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 I7(){return{localeError:Qy()}}var Gy=()=>{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 U7(){return{localeError:Gy()}}var Yy=()=>{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 w7(){return{localeError:Yy()}}var Ny=($)=>{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},Jy=()=>{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 ${Ny(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 b7(){return{localeError:Jy()}}var By=()=>{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 X7(){return{localeError:By()}}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"配列";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 D7(){return{localeError:Hy()}}var Ay=($)=>{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},Oy=()=>{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}, მიღებული ${Ay(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 W7(){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"អារេ (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 I0(){return{localeError:zy()}}function Q7(){return I0()}var Ly=()=>{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 G7(){return{localeError:Ly()}}var Ky=($)=>{return w0(typeof $,$)},w0=($,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 $},U0=($)=>{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 vy=()=>{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 ${Ky(b.input)}, o tikėtasi - ${w0(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=w0(b.origin),X=I(b.origin,Zq(Number(b.maximum)),b.inclusive??!1,"smaller");if(X?.verb)return`${U0(w??b.origin??"reikšmė")} ${X.verb} ${b.maximum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${U0(w??b.origin??"reikšmė")} turi būti ${D} ${b.maximum.toString()} ${X?.unit}`}case"too_small":{let w=w0(b.origin),X=I(b.origin,Zq(Number(b.minimum)),b.inclusive??!1,"bigger");if(X?.verb)return`${U0(w??b.origin??"reikšmė")} ${X.verb} ${b.minimum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${U0(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=w0(b.origin);return`${U0(w??b.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Y7(){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`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 N7(){return{localeError:Vy()}}var qy=()=>{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 J7(){return{localeError:qy()}}var My=()=>{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 B7(){return{localeError:My()}}var Fy=()=>{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 H7(){return{localeError:Fy()}}var jy=()=>{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 A7(){return{localeError:jy()}}var Ey=()=>{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 O7(){return{localeError:Ey()}}var Sy=()=>{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 z7(){return{localeError:Sy()}}var Py=()=>{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 L7(){return{localeError:Py()}}function Cq($,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 ky=()=>{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=Cq(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=Cq(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 K7(){return{localeError:ky()}}var Ry=()=>{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 v7(){return{localeError:Ry()}}var Ty=()=>{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 V7(){return{localeError:Ty()}}var _y=()=>{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 q7(){return{localeError:_y()}}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"อาร์เรย์ (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 M7(){return{localeError:Zy()}}var Cy=($)=>{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},gy=()=>{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 ${Cy(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 F7(){return{localeError:gy()}}var xy=()=>{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 b0(){return{localeError:xy()}}function j7(){return b0()}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"آرے";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 E7(){return{localeError:hy()}}var fy=()=>{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 S7(){return{localeError:fy()}}var yy=()=>{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 P7(){return{localeError:yy()}}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":"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:uy()}}var ly=()=>{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 R7(){return{localeError:ly()}}var gq,T7=Symbol("ZodOutput"),_7=Symbol("ZodInput");class Z7{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 TX(){return new Z7}(gq=globalThis).__zod_globalRegistry??(gq.__zod_globalRegistry=TX());var d$=globalThis.__zod_globalRegistry;function C7($,I){return new $({type:"string",...S(I)})}function g7($,I){return new $({type:"string",coerce:!0,...S(I)})}function _X($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...S(I)})}function D0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...S(I)})}function ZX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...S(I)})}function CX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(I)})}function gX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(I)})}function xX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(I)})}function W0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...S(I)})}function hX($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...S(I)})}function fX($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(I)})}function yX($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...S(I)})}function uX($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(I)})}function lX($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...S(I)})}function cX($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...S(I)})}function mX($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(I)})}function rX($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(I)})}function nX($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(I)})}function x7($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...S(I)})}function iX($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(I)})}function oX($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(I)})}function dX($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...S(I)})}function pX($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...S(I)})}function tX($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...S(I)})}function aX($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...S(I)})}var h7={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function f7($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(I)})}function y7($,I){return new $({type:"string",format:"date",check:"string_format",...S(I)})}function u7($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...S(I)})}function l7($,I){return new $({type:"string",format:"duration",check:"string_format",...S(I)})}function c7($,I){return new $({type:"number",checks:[],...S(I)})}function m7($,I){return new $({type:"number",coerce:!0,checks:[],...S(I)})}function r7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...S(I)})}function n7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...S(I)})}function i7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...S(I)})}function o7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...S(I)})}function d7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...S(I)})}function p7($,I){return new $({type:"boolean",...S(I)})}function t7($,I){return new $({type:"boolean",coerce:!0,...S(I)})}function a7($,I){return new $({type:"bigint",...S(I)})}function e7($,I){return new $({type:"bigint",coerce:!0,...S(I)})}function s7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(I)})}function $5($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(I)})}function I5($,I){return new $({type:"symbol",...S(I)})}function U5($,I){return new $({type:"undefined",...S(I)})}function w5($,I){return new $({type:"null",...S(I)})}function b5($){return new $({type:"any"})}function X5($){return new $({type:"unknown"})}function D5($,I){return new $({type:"never",...S(I)})}function W5($,I){return new $({type:"void",...S(I)})}function Q5($,I){return new $({type:"date",...S(I)})}function G5($,I){return new $({type:"date",coerce:!0,...S(I)})}function Y5($,I){return new $({type:"nan",...S(I)})}function r6($,I){return new vX({check:"less_than",...S(I),value:$,inclusive:!1})}function Y6($,I){return new vX({check:"less_than",...S(I),value:$,inclusive:!0})}function n6($,I){return new VX({check:"greater_than",...S(I),value:$,inclusive:!1})}function p$($,I){return new VX({check:"greater_than",...S(I),value:$,inclusive:!0})}function eX($){return n6(0,$)}function sX($){return r6(0,$)}function $D($){return Y6(0,$)}function ID($){return p$(0,$)}function C4($,I){return new JY({check:"multiple_of",...S(I),value:$})}function W1($,I){return new AY({check:"max_size",...S(I),maximum:$})}function g4($,I){return new OY({check:"min_size",...S(I),minimum:$})}function $I($,I){return new zY({check:"size_equals",...S(I),size:$})}function Q1($,I){return new LY({check:"max_length",...S(I),maximum:$})}function X4($,I){return new KY({check:"min_length",...S(I),minimum:$})}function G1($,I){return new vY({check:"length_equals",...S(I),length:$})}function II($,I){return new VY({check:"string_format",format:"regex",...S(I),pattern:$})}function UI($){return new qY({check:"string_format",format:"lowercase",...S($)})}function wI($){return new MY({check:"string_format",format:"uppercase",...S($)})}function bI($,I){return new FY({check:"string_format",format:"includes",...S(I),includes:$})}function XI($,I){return new jY({check:"string_format",format:"starts_with",...S(I),prefix:$})}function DI($,I){return new EY({check:"string_format",format:"ends_with",...S(I),suffix:$})}function UD($,I,U){return new SY({check:"property",property:$,schema:I,...S(U)})}function WI($,I){return new PY({check:"mime_type",mime:$,...S(I)})}function Z6($){return new kY({check:"overwrite",tx:$})}function QI($){return Z6((I)=>I.normalize($))}function GI(){return Z6(($)=>$.trim())}function YI(){return Z6(($)=>$.toLowerCase())}function NI(){return Z6(($)=>$.toUpperCase())}function JI(){return Z6(($)=>EG($))}function N5($,I,U){return new $({type:"array",element:I,...S(U)})}function my($,I,U){return new $({type:"union",options:I,...S(U)})}function ry($,I,U){return new $({type:"union",options:I,inclusive:!1,...S(U)})}function ny($,I,U,b){return new $({type:"union",options:U,discriminator:I,...S(b)})}function iy($,I,U){return new $({type:"intersection",left:I,right:U})}function oy($,I,U,b){let w=U instanceof o;return new $({type:"tuple",items:I,rest:w?U:null,...S(w?b:U)})}function dy($,I,U,b){return new $({type:"record",keyType:I,valueType:U,...S(b)})}function py($,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 ay($,I,U){let b=Array.isArray(I)?Object.fromEntries(I.map((w)=>[w,w])):I;return new $({type:"enum",entries:b,...S(U)})}function ey($,I,U){return new $({type:"enum",entries:I,...S(U)})}function sy($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...S(U)})}function J5($,I){return new $({type:"file",...S(I)})}function $u($,I){return new $({type:"transform",transform:I})}function Iu($,I){return new $({type:"optional",innerType:I})}function Uu($,I){return new $({type:"nullable",innerType:I})}function wu($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():PG(U)}})}function bu($,I,U){return new $({type:"nonoptional",innerType:I,...S(U)})}function Xu($,I){return new $({type:"success",innerType:I})}function Du($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function Wu($,I,U){return new $({type:"pipe",in:I,out:U})}function Qu($,I){return new $({type:"readonly",innerType:I})}function Gu($,I,U){return new $({type:"template_literal",parts:I,...S(U)})}function Yu($,I){return new $({type:"lazy",getter:I})}function Nu($,I){return new $({type:"promise",innerType:I})}function B5($,I,U){let b=S(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function H5($,I,U){return new $({type:"custom",check:"custom",fn:I,...S(U)})}function A5($){let I=xq((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(d1(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(d1(w))}},$(U.value,U)});return I}function xq($,I){let U=new A$({check:"custom",...S(I)});return U._zod.check=$,U}function O5($){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 z5($){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 L5($,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((B)=>typeof B==="string"?B.toLowerCase():B),w=w.map((B)=>typeof B==="string"?B.toLowerCase():B);let X=new Set(b),D=new Set(w),W=$.Codec??sU,Q=$.Boolean??aU,Y=new($.String??D1)({type:"string",error:U.error}),J=new Q({type:"boolean",error:U.error}),H=new W({type:"pipe",in:Y,out:J,transform:(B,A)=>{let O=B;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:(B,A)=>{if(B===!0)return b[0]||"true";else return w[0]||"false"},error:U.error});return H}function BI($,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 x4($){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 Y={...U,schemaPath:[...U.schemaPath,$],path:U.path},J=$._zod.parent;if(J)D.ref=J,G$(J,I,Y),I.seen.get(J).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,D.schema,Y);else{let H=D.schema,B=I.processors[w.type];if(!B)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${w.type}`);B($,I,H,Y)}}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 h4($,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 Y=$.external.registry.get(X[0])?.id,J=$.external.uri??((B)=>B);if(Y)return{ref:J(Y)};let H=X[1].defId??X[1].schema.id??`schema${$.counter++}`;return X[1].defId=H,{defId:H,ref:`${J("__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 Y in G)delete G[Y];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
|
+
`)}B.write("payload.value = newResult;"),B.write("return payload;");let k=B.compile();return(P,h)=>k(H,P,h)},X,D=b1,W=!yU.jitless,G=W&&SG.value,Y=I.catchall,J;$._zod.parse=(H,B)=>{J??(J=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&&B?.async===!1&&B.jitless!==!0){if(!X)X=w(I.shape);if(H=X(H,B),!Y)return H;return kq([],A,H,B,J,$)}return U(H,B)}});function Oq($,I,U,b){for(let X of $)if(X.issues.length===0)return I.value=X.value,I;let w=$.filter((X)=>!Z4(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 eU=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)=>cU(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 Oq(W,w,$,X);return Promise.all(W).then((Q)=>{return Oq(Q,w,$,X)})}});function zq($,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 ON=z("$ZodXor",($,I)=>{eU.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 zq(W,w,$,X);return Promise.all(W).then((Q)=>{return zq(Q,w,$,X)})}}),zN=z("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,eU.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=o1(()=>{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}}),LN=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 Lq(U,Q,G)});return Lq(U,X,D)}});function TY($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(_4($)&&_4(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=TY($[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=TY(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 Lq($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(Z4($))return $;let b=TY(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var RX=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((Y)=>Y._zod.optin!=="optional"),Q=W===-1?0:U.length-W;if(!I.rest){let Y=X.length>U.length,J=X.length<Q-1;if(Y||J)return b.issues.push({...Y?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:X,inst:$,origin:"array"}),b}let G=-1;for(let Y of U){if(G++,G>=X.length){if(G>=Q)continue}let J=Y._zod.run({value:X[G],issues:[]},w);if(J instanceof Promise)D.push(J.then((H)=>MX(H,b,G)));else MX(J,b,G)}if(I.rest){let Y=X.slice(U.length);for(let J of Y){G++;let H=I.rest._zod.run({value:J,issues:[]},w);if(H instanceof Promise)D.push(H.then((B)=>MX(B,b,G)));else MX(H,b,G)}}if(D.length)return Promise.all(D).then(()=>b);return b}});function MX($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var KN=z("$ZodRecord",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!_4(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 Y=I.valueType._zod.run({value:w[G],issues:[]},b);if(Y instanceof Promise)X.push(Y.then((J)=>{if(J.issues.length)U.issues.push(...G6(G,J.issues));U.value[G]=J.value}));else{if(Y.issues.length)U.issues.push(...G6(G,Y.issues));U.value[G]=Y.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((Y)=>U6(Y,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((Y)=>{if(Y.issues.length)U.issues.push(...G6(W,Y.issues));U.value[Q.value]=Y.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}}),vN=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(([Y,J])=>{Kq(Y,J,U,D,w,$,b)}));else Kq(Q,G,U,D,w,$,b)}if(X.length)return Promise.all(X).then(()=>U);return U}});function Kq($,I,U,b,w,X,D){if($.issues.length)if(mU.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(mU.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 VN=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)=>vq(Q,U)));else vq(W,U)}if(X.length)return Promise.all(X).then(()=>U);return U}});function vq($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var qN=z("$ZodEnum",($,I)=>{o.init($,I);let U=lU(I.entries),b=new Set(U);$._zod.values=b,$._zod.pattern=new RegExp(`^(${U.filter((w)=>mU.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}}),MN=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}}),FN=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}}),jN=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 Vq($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var EN=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(`^(${cU(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)=>Vq(X,U.value));return Vq(w,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),SN=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(`^(${cU(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)}}),PN=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)=>qq(X,I));return qq(w,I)}});function qq($,I){if($.value===void 0)$.value=I.defaultValue;return $}var kN=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)}}),RN=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)=>Mq(X,$));return Mq(w,$)}});function Mq($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var TN=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}}),_N=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}}),ZN=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}}),CN=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)=>FX(D,I.in,b));return FX(X,I.in,b)}let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>FX(X,I.out,b));return FX(w,I.out,b)}});function FX($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var sU=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)=>jX(D,I,b));return jX(X,I,b)}else{let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>jX(D,I,b));return jX(X,I,b)}}});function jX($,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)=>EX($,X,I.out,U));return EX($,w,I.out,U)}else{let w=I.reverseTransform($.value,$);if(w instanceof Promise)return w.then((X)=>EX($,X,I.in,U));return EX($,w,I.in,U)}}function EX($,I,U,b){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},b)}var gN=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(Fq);return Fq(w)}});function Fq($){return $.value=Object.freeze($.value),$}var xN=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}}),hN=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?GX($._def.input,b):b,X=Reflect.apply(U,this,w);if($._def.output)return GX($._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 YX($._def.input,b):b,X=await Reflect.apply(U,this,w);if($._def.output)return await YX($._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 RX({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})},$}),fN=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))}}),yN=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)}}),uN=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)=>jq(X,U,b,$));jq(w,U,b,$);return}});function jq($,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(d1(w))}}var X0={};v6(X0,{zhTW:()=>k7,zhCN:()=>P7,yo:()=>R7,vi:()=>S7,ur:()=>E7,uk:()=>b0,ua:()=>j7,tr:()=>F7,th:()=>M7,ta:()=>q7,sv:()=>V7,sl:()=>v7,ru:()=>K7,pt:()=>L7,ps:()=>O7,pl:()=>z7,ota:()=>A7,no:()=>H7,nl:()=>B7,ms:()=>J7,mk:()=>N7,lt:()=>Y7,ko:()=>G7,km:()=>I0,kh:()=>Q7,ka:()=>W7,ja:()=>D7,it:()=>X7,is:()=>b7,id:()=>w7,hu:()=>U7,he:()=>I7,frCA:()=>$7,fr:()=>sN,fi:()=>eN,fa:()=>aN,es:()=>tN,eo:()=>pN,en:()=>$0,de:()=>dN,da:()=>oN,cs:()=>iN,ca:()=>nN,bg:()=>rN,be:()=>mN,az:()=>cN,ar:()=>lN});var cf=()=>{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 lN(){return{localeError:cf()}}var mf=()=>{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 cN(){return{localeError:mf()}}function Tq($,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 rf=()=>{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=Tq(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=Tq(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 mN(){return{localeError:rf()}}var nf=($)=>{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},of=()=>{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}, получен ${nf(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 rN(){return{localeError:of()}}var df=()=>{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 nN(){return{localeError:df()}}var pf=()=>{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 iN(){return{localeError:pf()}}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 oN(){return{localeError:tf()}}var af=()=>{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 dN(){return{localeError:af()}}var ef=($)=>{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},sf=()=>{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 ${ef(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 $0(){return{localeError:sf()}}var $y=($)=>{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},Iy=()=>{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 ${$y(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 pN(){return{localeError:Iy()}}var Uy=()=>{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 tN(){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:"تاریخ و زمان ایزو",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 aN(){return{localeError:wy()}}var by=()=>{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 eN(){return{localeError:by()}}var Xy=()=>{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 sN(){return{localeError:Xy()}}var Dy=()=>{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 $7(){return{localeError:Dy()}}var Wy=()=>{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 Y=U(G);if(Y)return Y.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 Y=typeof G;switch(Y){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 Y}},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 Y=G.expected,J=b(Y),H=W(G.input),B=$[H]?.label??H;return`קלט לא תקין: צריך להיות ${J}, התקבל ${B}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(G.values[0])}`;let Y=G.values.map((B)=>j(B));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Y[0]} או ${Y[1]}`;let J=Y[Y.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Y.slice(0,-1).join(", ")} או ${J}`}case"too_big":{let Y=D(G.origin),J=w(G.origin??"value");if(G.origin==="string")return`${Y?.longLabel??"ארוך"} מדי: ${J} צריכה להכיל ${G.maximum.toString()} ${Y?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let A=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${J} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך",O=G.inclusive?`${G.maximum} ${Y?.unit??""} או פחות`:`פחות מ-${G.maximum} ${Y?.unit??""}`;return`גדול מדי: ${J} ${A} להכיל ${O}`.trim()}let H=G.inclusive?"<=":"<",B=X(G.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${J} ${B} ${H}${G.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${J} ${B} ${H}${G.maximum.toString()}`}case"too_small":{let Y=D(G.origin),J=w(G.origin??"value");if(G.origin==="string")return`${Y?.shortLabel??"קצר"} מדי: ${J} צריכה להכיל ${G.minimum.toString()} ${Y?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let A=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${J} צריך להיות ${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`קטן מדי: ${J} ${A} להכיל ${V}`}let O=G.inclusive?`${G.minimum} ${Y?.unit??""} או יותר`:`יותר מ-${G.minimum} ${Y?.unit??""}`;return`קטן מדי: ${J} ${A} להכיל ${O}`.trim()}let H=G.inclusive?">=":">",B=X(G.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${J} ${B} ${H}${G.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${J} ${B} ${H}${G.minimum.toString()}`}case"invalid_format":{let Y=G;if(Y.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${Y.prefix}"`;if(Y.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${Y.suffix}"`;if(Y.format==="includes")return`המחרוזת חייבת לכלול "${Y.includes}"`;if(Y.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${Y.pattern}`;let J=Q[Y.format],H=J?.label??Y.format,A=(J?.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 I7(){return{localeError:Wy()}}var Qy=()=>{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 U7(){return{localeError:Qy()}}var Gy=()=>{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 w7(){return{localeError:Gy()}}var Yy=($)=>{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},Ny=()=>{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 ${Yy(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 b7(){return{localeError:Ny()}}var Jy=()=>{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 X7(){return{localeError:Jy()}}var By=()=>{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 D7(){return{localeError:By()}}var Hy=($)=>{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},Ay=()=>{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}, მიღებული ${Hy(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 W7(){return{localeError:Ay()}}var Oy=()=>{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 I0(){return{localeError:Oy()}}function Q7(){return I0()}var zy=()=>{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 G7(){return{localeError:zy()}}var Ly=($)=>{return w0(typeof $,$)},w0=($,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 $},U0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function _q($){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 Ky=()=>{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 ${Ly(b.input)}, o tikėtasi - ${w0(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=w0(b.origin),X=I(b.origin,_q(Number(b.maximum)),b.inclusive??!1,"smaller");if(X?.verb)return`${U0(w??b.origin??"reikšmė")} ${X.verb} ${b.maximum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${U0(w??b.origin??"reikšmė")} turi būti ${D} ${b.maximum.toString()} ${X?.unit}`}case"too_small":{let w=w0(b.origin),X=I(b.origin,_q(Number(b.minimum)),b.inclusive??!1,"bigger");if(X?.verb)return`${U0(w??b.origin??"reikšmė")} ${X.verb} ${b.minimum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${U0(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=w0(b.origin);return`${U0(w??b.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Y7(){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`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 N7(){return{localeError:vy()}}var Vy=()=>{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 J7(){return{localeError:Vy()}}var qy=()=>{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 B7(){return{localeError:qy()}}var My=()=>{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 H7(){return{localeError:My()}}var Fy=()=>{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 A7(){return{localeError:Fy()}}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)?"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 O7(){return{localeError:jy()}}var Ey=()=>{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 z7(){return{localeError:Ey()}}var Sy=()=>{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 L7(){return{localeError:Sy()}}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 Py=()=>{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 K7(){return{localeError:Py()}}var ky=()=>{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 v7(){return{localeError:ky()}}var Ry=()=>{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 V7(){return{localeError:Ry()}}var Ty=()=>{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 q7(){return{localeError:Ty()}}var _y=()=>{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 M7(){return{localeError:_y()}}var Zy=($)=>{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},Cy=()=>{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 ${Zy(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 F7(){return{localeError:Cy()}}var gy=()=>{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 b0(){return{localeError:gy()}}function j7(){return b0()}var xy=()=>{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 E7(){return{localeError:xy()}}var hy=()=>{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 S7(){return{localeError:hy()}}var fy=()=>{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 P7(){return{localeError:fy()}}var yy=()=>{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:yy()}}var uy=()=>{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 R7(){return{localeError:uy()}}var Cq,T7=Symbol("ZodOutput"),_7=Symbol("ZodInput");class Z7{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 TX(){return new Z7}(Cq=globalThis).__zod_globalRegistry??(Cq.__zod_globalRegistry=TX());var d$=globalThis.__zod_globalRegistry;function C7($,I){return new $({type:"string",...S(I)})}function g7($,I){return new $({type:"string",coerce:!0,...S(I)})}function _X($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...S(I)})}function D0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...S(I)})}function ZX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...S(I)})}function CX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(I)})}function gX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(I)})}function xX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(I)})}function W0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...S(I)})}function hX($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...S(I)})}function fX($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(I)})}function yX($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...S(I)})}function uX($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(I)})}function lX($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...S(I)})}function cX($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...S(I)})}function mX($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(I)})}function rX($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(I)})}function nX($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(I)})}function x7($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...S(I)})}function iX($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(I)})}function oX($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(I)})}function dX($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...S(I)})}function pX($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...S(I)})}function tX($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...S(I)})}function aX($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...S(I)})}var h7={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function f7($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(I)})}function y7($,I){return new $({type:"string",format:"date",check:"string_format",...S(I)})}function u7($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...S(I)})}function l7($,I){return new $({type:"string",format:"duration",check:"string_format",...S(I)})}function c7($,I){return new $({type:"number",checks:[],...S(I)})}function m7($,I){return new $({type:"number",coerce:!0,checks:[],...S(I)})}function r7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...S(I)})}function n7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...S(I)})}function i7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...S(I)})}function o7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...S(I)})}function d7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...S(I)})}function p7($,I){return new $({type:"boolean",...S(I)})}function t7($,I){return new $({type:"boolean",coerce:!0,...S(I)})}function a7($,I){return new $({type:"bigint",...S(I)})}function e7($,I){return new $({type:"bigint",coerce:!0,...S(I)})}function s7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(I)})}function $5($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(I)})}function I5($,I){return new $({type:"symbol",...S(I)})}function U5($,I){return new $({type:"undefined",...S(I)})}function w5($,I){return new $({type:"null",...S(I)})}function b5($){return new $({type:"any"})}function X5($){return new $({type:"unknown"})}function D5($,I){return new $({type:"never",...S(I)})}function W5($,I){return new $({type:"void",...S(I)})}function Q5($,I){return new $({type:"date",...S(I)})}function G5($,I){return new $({type:"date",coerce:!0,...S(I)})}function Y5($,I){return new $({type:"nan",...S(I)})}function r6($,I){return new vX({check:"less_than",...S(I),value:$,inclusive:!1})}function Y6($,I){return new vX({check:"less_than",...S(I),value:$,inclusive:!0})}function n6($,I){return new VX({check:"greater_than",...S(I),value:$,inclusive:!1})}function p$($,I){return new VX({check:"greater_than",...S(I),value:$,inclusive:!0})}function eX($){return n6(0,$)}function sX($){return r6(0,$)}function $D($){return Y6(0,$)}function ID($){return p$(0,$)}function C4($,I){return new JY({check:"multiple_of",...S(I),value:$})}function W1($,I){return new AY({check:"max_size",...S(I),maximum:$})}function g4($,I){return new OY({check:"min_size",...S(I),minimum:$})}function $I($,I){return new zY({check:"size_equals",...S(I),size:$})}function Q1($,I){return new LY({check:"max_length",...S(I),maximum:$})}function X4($,I){return new KY({check:"min_length",...S(I),minimum:$})}function G1($,I){return new vY({check:"length_equals",...S(I),length:$})}function II($,I){return new VY({check:"string_format",format:"regex",...S(I),pattern:$})}function UI($){return new qY({check:"string_format",format:"lowercase",...S($)})}function wI($){return new MY({check:"string_format",format:"uppercase",...S($)})}function bI($,I){return new FY({check:"string_format",format:"includes",...S(I),includes:$})}function XI($,I){return new jY({check:"string_format",format:"starts_with",...S(I),prefix:$})}function DI($,I){return new EY({check:"string_format",format:"ends_with",...S(I),suffix:$})}function UD($,I,U){return new SY({check:"property",property:$,schema:I,...S(U)})}function WI($,I){return new PY({check:"mime_type",mime:$,...S(I)})}function Z6($){return new kY({check:"overwrite",tx:$})}function QI($){return Z6((I)=>I.normalize($))}function GI(){return Z6(($)=>$.trim())}function YI(){return Z6(($)=>$.toLowerCase())}function NI(){return Z6(($)=>$.toUpperCase())}function JI(){return Z6(($)=>EG($))}function N5($,I,U){return new $({type:"array",element:I,...S(U)})}function cy($,I,U){return new $({type:"union",options:I,...S(U)})}function my($,I,U){return new $({type:"union",options:I,inclusive:!1,...S(U)})}function ry($,I,U,b){return new $({type:"union",options:U,discriminator:I,...S(b)})}function ny($,I,U){return new $({type:"intersection",left:I,right:U})}function iy($,I,U,b){let w=U instanceof o;return new $({type:"tuple",items:I,rest:w?U:null,...S(w?b:U)})}function oy($,I,U,b){return new $({type:"record",keyType:I,valueType:U,...S(b)})}function dy($,I,U,b){return new $({type:"map",keyType:I,valueType:U,...S(b)})}function py($,I,U){return new $({type:"set",valueType:I,...S(U)})}function ty($,I,U){let b=Array.isArray(I)?Object.fromEntries(I.map((w)=>[w,w])):I;return new $({type:"enum",entries:b,...S(U)})}function ay($,I,U){return new $({type:"enum",entries:I,...S(U)})}function ey($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...S(U)})}function J5($,I){return new $({type:"file",...S(I)})}function sy($,I){return new $({type:"transform",transform:I})}function $u($,I){return new $({type:"optional",innerType:I})}function Iu($,I){return new $({type:"nullable",innerType:I})}function Uu($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():PG(U)}})}function wu($,I,U){return new $({type:"nonoptional",innerType:I,...S(U)})}function bu($,I){return new $({type:"success",innerType:I})}function Xu($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function Du($,I,U){return new $({type:"pipe",in:I,out:U})}function Wu($,I){return new $({type:"readonly",innerType:I})}function Qu($,I,U){return new $({type:"template_literal",parts:I,...S(U)})}function Gu($,I){return new $({type:"lazy",getter:I})}function Yu($,I){return new $({type:"promise",innerType:I})}function B5($,I,U){let b=S(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function H5($,I,U){return new $({type:"custom",check:"custom",fn:I,...S(U)})}function A5($){let I=gq((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(d1(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(d1(w))}},$(U.value,U)});return I}function gq($,I){let U=new A$({check:"custom",...S(I)});return U._zod.check=$,U}function O5($){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 z5($){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 L5($,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((B)=>typeof B==="string"?B.toLowerCase():B),w=w.map((B)=>typeof B==="string"?B.toLowerCase():B);let X=new Set(b),D=new Set(w),W=$.Codec??sU,Q=$.Boolean??aU,Y=new($.String??D1)({type:"string",error:U.error}),J=new Q({type:"boolean",error:U.error}),H=new W({type:"pipe",in:Y,out:J,transform:(B,A)=>{let O=B;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:(B,A)=>{if(B===!0)return b[0]||"true";else return w[0]||"false"},error:U.error});return H}function BI($,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 x4($){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 Y={...U,schemaPath:[...U.schemaPath,$],path:U.path},J=$._zod.parent;if(J)D.ref=J,G$(J,I,Y),I.seen.get(J).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,D.schema,Y);else{let H=D.schema,B=I.processors[w.type];if(!B)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${w.type}`);B($,I,H,Y)}}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 h4($,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 Y=$.external.registry.get(X[0])?.id,J=$.external.uri??((B)=>B);if(Y)return{ref:J(Y)};let H=X[1].defId??X[1].schema.id??`schema${$.counter++}`;return X[1].defId=H,{defId:H,ref:`${J("__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 Y in G)delete G[Y];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 f4($,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 Y=W.ref;if(W.ref=null,Y){b(Y);let J=$.seen.get(Y).schema;if(J.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))Q.allOf=Q.allOf??[],Q.allOf.push(J);else Object.assign(Q,J),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:HI(I,"input"),output:HI(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 K5=($,I={})=>(U)=>{let b=x4({...U,processors:I});return G$($,b),h4(b,$),f4(b,$)},HI=($,I)=>(U)=>{let{libraryOptions:b,target:w}=U??{},X=x4({...b??{},target:w,io:I,processors:{}});return G$($,X),h4(X,$),f4(X,$)};var Ju={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},v5=($,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=Ju[W]??W,w.format==="")delete w.format}if(G)w.contentEncoding=G;if(Q&&Q.size>0){let Y=[...Q];if(Y.length===1)w.pattern=Y[0].source;else if(Y.length>1)w.allOf=[...Y.map((J)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:J.source}))]}},V5=($,I,U,b)=>{let w=U,{minimum:X,maximum:D,format:W,multipleOf:Q,exclusiveMaximum:G,exclusiveMinimum:Y}=$._zod.bag;if(typeof W==="string"&&W.includes("int"))w.type="integer";else w.type="number";if(typeof Y==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.minimum=Y,w.exclusiveMinimum=!0;else w.exclusiveMinimum=Y;if(typeof X==="number"){if(w.minimum=X,typeof Y==="number"&&I.target!=="draft-04")if(Y>=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},q5=($,I,U,b)=>{U.type="boolean"},M5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},F5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},j5=($,I,U,b)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},E5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},S5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},P5=($,I,U,b)=>{U.not={}},k5=($,I,U,b)=>{},R5=($,I,U,b)=>{},T5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},_5=($,I,U,b)=>{let w=$._zod.def,X=lU(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},Z5=($,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}},C5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},g5=($,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},x5=($,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)},h5=($,I,U,b)=>{U.type="boolean"},f5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},y5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},u5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},l5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},c5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},m5=($,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"]})},r5=($,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 Y=X.shape[G]._zod;if(I.io==="input")return Y.optin===void 0;else return Y.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"]})},bD=($,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},n5=($,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},i5=($,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,B)=>G$(H,I,{...b,path:[...b.path,D,B]})),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:Y,maximum:J}=$._zod.bag;if(typeof Y==="number")w.minItems=Y;if(typeof J==="number")w.maxItems=J},o5=($,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"]})},d5=($,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"}]},p5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},t5=($,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))},a5=($,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))},e5=($,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},s5=($,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},$J=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.readOnly=!0},IJ=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},UJ=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},wJ=($,I,U,b)=>{let w=$._zod.innerType;G$(w,I,b);let X=I.seen.get($);X.ref=w},wD={string:v5,number:V5,boolean:q5,bigint:M5,symbol:F5,null:j5,undefined:E5,void:S5,never:P5,any:k5,unknown:R5,date:T5,enum:_5,literal:Z5,nan:C5,template_literal:g5,file:x5,success:h5,custom:f5,function:y5,transform:u5,map:l5,set:c5,array:m5,object:r5,union:bD,intersection:n5,tuple:i5,record:o5,nullable:d5,nonoptional:p5,default:t5,prefault:a5,catch:e5,pipe:s5,readonly:$J,promise:IJ,optional:UJ,lazy:wJ};function XD($,I){if("_idmap"in $){let b=$,w=x4({...I,processors:wD}),X={};for(let Q of b._idmap.entries()){let[G,Y]=Q;G$(Y,w)}let D={},W={registry:b,uri:I?.uri,defs:X};w.external=W;for(let Q of b._idmap.entries()){let[G,Y]=Q;h4(w,Y),D[G]=f4(w,Y)}if(Object.keys(X).length>0){let Q=w.target==="draft-2020-12"?"$defs":"definitions";D.__shared={[Q]:X}}return{schemas:D}}let U=x4({...I,processors:wD});return G$($,U),h4(U,$),f4(U,$)}class bJ{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=x4({processors:wD,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}h4(this.ctx,$);let U=f4(this.ctx,$),{"~standard":b,...w}=U;return w}}var hq={};var Q0={};v6(Q0,{xor:()=>kM,xid:()=>eq,void:()=>MM,uuidv7:()=>rq,uuidv6:()=>mq,uuidv4:()=>cq,uuid:()=>lq,url:()=>nq,unknown:()=>Y1,union:()=>_D,undefined:()=>VM,ulid:()=>aq,uint64:()=>KM,uint32:()=>OM,tuple:()=>fJ,transform:()=>CD,templateLiteral:()=>cM,symbol:()=>vM,superRefine:()=>GB,success:()=>yM,stringbool:()=>tM,stringFormat:()=>GM,string:()=>ND,strictObject:()=>SM,set:()=>CM,refine:()=>QB,record:()=>yJ,readonly:()=>UB,promise:()=>mM,preprocess:()=>eM,prefault:()=>pJ,pipe:()=>J0,partialRecord:()=>TM,optional:()=>Y0,object:()=>EM,number:()=>qJ,nullish:()=>fM,nullable:()=>N0,null:()=>SJ,nonoptional:()=>tJ,never:()=>TD,nativeEnum:()=>gM,nanoid:()=>dq,nan:()=>uM,meta:()=>dM,map:()=>ZM,mac:()=>IM,looseRecord:()=>_M,looseObject:()=>PM,literal:()=>xM,lazy:()=>XB,ksuid:()=>sq,keyof:()=>jM,jwt:()=>QM,json:()=>aM,ipv6:()=>UM,ipv4:()=>$M,intersection:()=>xJ,int64:()=>LM,int32:()=>AM,int:()=>JD,instanceof:()=>pM,httpUrl:()=>iq,hostname:()=>YM,hex:()=>NM,hash:()=>JM,guid:()=>uq,function:()=>rM,float64:()=>HM,float32:()=>BM,file:()=>hM,enum:()=>ZD,emoji:()=>oq,email:()=>yq,e164:()=>WM,discriminatedUnion:()=>RM,describe:()=>oM,date:()=>FM,custom:()=>iM,cuid2:()=>tq,cuid:()=>pq,codec:()=>lM,cidrv6:()=>bM,cidrv4:()=>wM,check:()=>nM,catch:()=>sJ,boolean:()=>MJ,bigint:()=>zM,base64url:()=>DM,base64:()=>XM,array:()=>A0,any:()=>qM,_function:()=>rM,_default:()=>oJ,_ZodString:()=>BD,ZodXor:()=>ZJ,ZodXID:()=>vD,ZodVoid:()=>TJ,ZodUnknown:()=>kJ,ZodUnion:()=>z0,ZodUndefined:()=>jJ,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>KD,ZodType:()=>t,ZodTuple:()=>hJ,ZodTransform:()=>rJ,ZodTemplateLiteral:()=>wB,ZodSymbol:()=>FJ,ZodSuccess:()=>aJ,ZodStringFormat:()=>B$,ZodString:()=>zI,ZodSet:()=>lJ,ZodRecord:()=>L0,ZodReadonly:()=>IB,ZodPromise:()=>DB,ZodPrefault:()=>dJ,ZodPipe:()=>hD,ZodOptional:()=>gD,ZodObject:()=>O0,ZodNumberFormat:()=>N1,ZodNumber:()=>KI,ZodNullable:()=>nJ,ZodNull:()=>EJ,ZodNonOptional:()=>xD,ZodNever:()=>RJ,ZodNanoID:()=>OD,ZodNaN:()=>$B,ZodMap:()=>uJ,ZodMAC:()=>VJ,ZodLiteral:()=>cJ,ZodLazy:()=>bB,ZodKSUID:()=>VD,ZodJWT:()=>kD,ZodIntersection:()=>gJ,ZodIPv6:()=>MD,ZodIPv4:()=>qD,ZodGUID:()=>G0,ZodFunction:()=>WB,ZodFile:()=>mJ,ZodEnum:()=>OI,ZodEmoji:()=>AD,ZodEmail:()=>HD,ZodE164:()=>PD,ZodDiscriminatedUnion:()=>CJ,ZodDefault:()=>iJ,ZodDate:()=>H0,ZodCustomStringFormat:()=>LI,ZodCustom:()=>K0,ZodCodec:()=>fD,ZodCatch:()=>eJ,ZodCUID2:()=>LD,ZodCUID:()=>zD,ZodCIDRv6:()=>jD,ZodCIDRv4:()=>FD,ZodBoolean:()=>vI,ZodBigIntFormat:()=>RD,ZodBigInt:()=>VI,ZodBase64URL:()=>SD,ZodBase64:()=>ED,ZodArray:()=>_J,ZodAny:()=>PJ});var DD={};v6(DD,{uppercase:()=>wI,trim:()=>GI,toUpperCase:()=>NI,toLowerCase:()=>YI,startsWith:()=>XI,slugify:()=>JI,size:()=>$I,regex:()=>II,property:()=>UD,positive:()=>eX,overwrite:()=>Z6,normalize:()=>QI,nonpositive:()=>$D,nonnegative:()=>ID,negative:()=>sX,multipleOf:()=>C4,minSize:()=>g4,minLength:()=>X4,mime:()=>WI,maxSize:()=>W1,maxLength:()=>Q1,lte:()=>Y6,lt:()=>r6,lowercase:()=>UI,length:()=>G1,includes:()=>bI,gte:()=>p$,gt:()=>n6,endsWith:()=>DI});var AI={};v6(AI,{time:()=>WJ,duration:()=>QJ,datetime:()=>XJ,date:()=>DJ,ZodISOTime:()=>GD,ZodISODuration:()=>YD,ZodISODateTime:()=>WD,ZodISODate:()=>QD});var WD=z("ZodISODateTime",($,I)=>{mY.init($,I),B$.init($,I)});function XJ($){return f7(WD,$)}var QD=z("ZodISODate",($,I)=>{rY.init($,I),B$.init($,I)});function DJ($){return y7(QD,$)}var GD=z("ZodISOTime",($,I)=>{nY.init($,I),B$.init($,I)});function WJ($){return u7(GD,$)}var YD=z("ZodISODuration",($,I)=>{iY.init($,I),B$.init($,I)});function QJ($){return l7(YD,$)}var fq=($,I)=>{iU.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>dU($,U)},flatten:{value:(U)=>oU($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,i1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,i1,2)}},isEmpty:{get(){return $.issues.length===0}}})},Hu=z("ZodError",fq),b6=z("ZodError",fq,{Parent:Error});var GJ=p1(b6),YJ=t1(b6),NJ=a1(b6),JJ=e1(b6),BJ=NX(b6),HJ=JX(b6),AJ=BX(b6),OJ=HX(b6),zJ=AX(b6),LJ=OX(b6),KJ=zX(b6),vJ=LX(b6);var t=z("ZodType",($,I)=>{return o.init($,I),Object.assign($["~standard"],{jsonSchema:{input:HI($,"input"),output:HI($,"output")}}),$.toJSONSchema=K5($,{}),$.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)=>GJ($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>NJ($,U,b),$.parseAsync=async(U,b)=>YJ($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>JJ($,U,b),$.spa=$.safeParseAsync,$.encode=(U,b)=>BJ($,U,b),$.decode=(U,b)=>HJ($,U,b),$.encodeAsync=async(U,b)=>AJ($,U,b),$.decodeAsync=async(U,b)=>OJ($,U,b),$.safeEncode=(U,b)=>zJ($,U,b),$.safeDecode=(U,b)=>LJ($,U,b),$.safeEncodeAsync=async(U,b)=>KJ($,U,b),$.safeDecodeAsync=async(U,b)=>vJ($,U,b),$.refine=(U,b)=>$.check(QB(U,b)),$.superRefine=(U)=>$.check(GB(U)),$.overwrite=(U)=>$.check(Z6(U)),$.optional=()=>Y0($),$.nullable=()=>N0($),$.nullish=()=>Y0(N0($)),$.nonoptional=(U)=>tJ($,U),$.array=()=>A0($),$.or=(U)=>_D([$,U]),$.and=(U)=>xJ($,U),$.transform=(U)=>J0($,CD(U)),$.default=(U)=>oJ($,U),$.prefault=(U)=>pJ($,U),$.catch=(U)=>sJ($,U),$.pipe=(U)=>J0($,U),$.readonly=()=>UB($),$.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,$}),BD=z("_ZodString",($,I)=>{D1.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>v5($,b,w,X);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(II(...b)),$.includes=(...b)=>$.check(bI(...b)),$.startsWith=(...b)=>$.check(XI(...b)),$.endsWith=(...b)=>$.check(DI(...b)),$.min=(...b)=>$.check(X4(...b)),$.max=(...b)=>$.check(Q1(...b)),$.length=(...b)=>$.check(G1(...b)),$.nonempty=(...b)=>$.check(X4(1,...b)),$.lowercase=(b)=>$.check(UI(b)),$.uppercase=(b)=>$.check(wI(b)),$.trim=()=>$.check(GI()),$.normalize=(...b)=>$.check(QI(...b)),$.toLowerCase=()=>$.check(YI()),$.toUpperCase=()=>$.check(NI()),$.slugify=()=>$.check(JI())}),zI=z("ZodString",($,I)=>{D1.init($,I),BD.init($,I),$.email=(U)=>$.check(_X(HD,U)),$.url=(U)=>$.check(W0(B0,U)),$.jwt=(U)=>$.check(aX(kD,U)),$.emoji=(U)=>$.check(hX(AD,U)),$.guid=(U)=>$.check(D0(G0,U)),$.uuid=(U)=>$.check(ZX(i6,U)),$.uuidv4=(U)=>$.check(CX(i6,U)),$.uuidv6=(U)=>$.check(gX(i6,U)),$.uuidv7=(U)=>$.check(xX(i6,U)),$.nanoid=(U)=>$.check(fX(OD,U)),$.guid=(U)=>$.check(D0(G0,U)),$.cuid=(U)=>$.check(yX(zD,U)),$.cuid2=(U)=>$.check(uX(LD,U)),$.ulid=(U)=>$.check(lX(KD,U)),$.base64=(U)=>$.check(dX(ED,U)),$.base64url=(U)=>$.check(pX(SD,U)),$.xid=(U)=>$.check(cX(vD,U)),$.ksuid=(U)=>$.check(mX(VD,U)),$.ipv4=(U)=>$.check(rX(qD,U)),$.ipv6=(U)=>$.check(nX(MD,U)),$.cidrv4=(U)=>$.check(iX(FD,U)),$.cidrv6=(U)=>$.check(oX(jD,U)),$.e164=(U)=>$.check(tX(PD,U)),$.datetime=(U)=>$.check(XJ(U)),$.date=(U)=>$.check(DJ(U)),$.time=(U)=>$.check(WJ(U)),$.duration=(U)=>$.check(QJ(U))});function ND($){return C7(zI,$)}var B$=z("ZodStringFormat",($,I)=>{J$.init($,I),BD.init($,I)}),HD=z("ZodEmail",($,I)=>{CY.init($,I),B$.init($,I)});function yq($){return _X(HD,$)}var G0=z("ZodGUID",($,I)=>{_Y.init($,I),B$.init($,I)});function uq($){return D0(G0,$)}var i6=z("ZodUUID",($,I)=>{ZY.init($,I),B$.init($,I)});function lq($){return ZX(i6,$)}function cq($){return CX(i6,$)}function mq($){return gX(i6,$)}function rq($){return xX(i6,$)}var B0=z("ZodURL",($,I)=>{gY.init($,I),B$.init($,I)});function nq($){return W0(B0,$)}function iq($){return W0(B0,{protocol:/^https?$/,hostname:K6.domain,...E.normalizeParams($)})}var AD=z("ZodEmoji",($,I)=>{xY.init($,I),B$.init($,I)});function oq($){return hX(AD,$)}var OD=z("ZodNanoID",($,I)=>{hY.init($,I),B$.init($,I)});function dq($){return fX(OD,$)}var zD=z("ZodCUID",($,I)=>{fY.init($,I),B$.init($,I)});function pq($){return yX(zD,$)}var LD=z("ZodCUID2",($,I)=>{yY.init($,I),B$.init($,I)});function tq($){return uX(LD,$)}var KD=z("ZodULID",($,I)=>{uY.init($,I),B$.init($,I)});function aq($){return lX(KD,$)}var vD=z("ZodXID",($,I)=>{lY.init($,I),B$.init($,I)});function eq($){return cX(vD,$)}var VD=z("ZodKSUID",($,I)=>{cY.init($,I),B$.init($,I)});function sq($){return mX(VD,$)}var qD=z("ZodIPv4",($,I)=>{oY.init($,I),B$.init($,I)});function $M($){return rX(qD,$)}var VJ=z("ZodMAC",($,I)=>{pY.init($,I),B$.init($,I)});function IM($){return x7(VJ,$)}var MD=z("ZodIPv6",($,I)=>{dY.init($,I),B$.init($,I)});function UM($){return nX(MD,$)}var FD=z("ZodCIDRv4",($,I)=>{tY.init($,I),B$.init($,I)});function wM($){return iX(FD,$)}var jD=z("ZodCIDRv6",($,I)=>{aY.init($,I),B$.init($,I)});function bM($){return oX(jD,$)}var ED=z("ZodBase64",($,I)=>{sY.init($,I),B$.init($,I)});function XM($){return dX(ED,$)}var SD=z("ZodBase64URL",($,I)=>{$N.init($,I),B$.init($,I)});function DM($){return pX(SD,$)}var PD=z("ZodE164",($,I)=>{IN.init($,I),B$.init($,I)});function WM($){return tX(PD,$)}var kD=z("ZodJWT",($,I)=>{UN.init($,I),B$.init($,I)});function QM($){return aX(kD,$)}var LI=z("ZodCustomStringFormat",($,I)=>{wN.init($,I),B$.init($,I)});function GM($,I,U={}){return BI(LI,$,I,U)}function YM($){return BI(LI,"hostname",K6.hostname,$)}function NM($){return BI(LI,"hex",K6.hex,$)}function JM($,I){let U=I?.enc??"hex",b=`${$}_${U}`,w=K6[b];if(!w)throw new Error(`Unrecognized hash format: ${b}`);return BI(LI,b,w,I)}var KI=z("ZodNumber",($,I)=>{PX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>V5($,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(Y6(b,w)),$.max=(b,w)=>$.check(Y6(b,w)),$.int=(b)=>$.check(JD(b)),$.safe=(b)=>$.check(JD(b)),$.positive=(b)=>$.check(n6(0,b)),$.nonnegative=(b)=>$.check(p$(0,b)),$.negative=(b)=>$.check(r6(0,b)),$.nonpositive=(b)=>$.check(Y6(0,b)),$.multipleOf=(b,w)=>$.check(C4(b,w)),$.step=(b,w)=>$.check(C4(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 qJ($){return c7(KI,$)}var N1=z("ZodNumberFormat",($,I)=>{bN.init($,I),KI.init($,I)});function JD($){return r7(N1,$)}function BM($){return n7(N1,$)}function HM($){return i7(N1,$)}function AM($){return o7(N1,$)}function OM($){return d7(N1,$)}var vI=z("ZodBoolean",($,I)=>{aU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>q5($,U,b,w)});function MJ($){return p7(vI,$)}var VI=z("ZodBigInt",($,I)=>{kX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>M5($,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(Y6(b,w)),$.max=(b,w)=>$.check(Y6(b,w)),$.positive=(b)=>$.check(n6(BigInt(0),b)),$.negative=(b)=>$.check(r6(BigInt(0),b)),$.nonpositive=(b)=>$.check(Y6(BigInt(0),b)),$.nonnegative=(b)=>$.check(p$(BigInt(0),b)),$.multipleOf=(b,w)=>$.check(C4(b,w));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function zM($){return a7(VI,$)}var RD=z("ZodBigIntFormat",($,I)=>{XN.init($,I),VI.init($,I)});function LM($){return s7(RD,$)}function KM($){return $5(RD,$)}var FJ=z("ZodSymbol",($,I)=>{DN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>F5($,U,b,w)});function vM($){return I5(FJ,$)}var jJ=z("ZodUndefined",($,I)=>{WN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>E5($,U,b,w)});function VM($){return U5(jJ,$)}var EJ=z("ZodNull",($,I)=>{QN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>j5($,U,b,w)});function SJ($){return w5(EJ,$)}var PJ=z("ZodAny",($,I)=>{GN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>k5($,U,b,w)});function qM(){return b5(PJ)}var kJ=z("ZodUnknown",($,I)=>{YN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>R5($,U,b,w)});function Y1(){return X5(kJ)}var RJ=z("ZodNever",($,I)=>{NN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>P5($,U,b,w)});function TD($){return D5(RJ,$)}var TJ=z("ZodVoid",($,I)=>{JN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>S5($,U,b,w)});function MM($){return W5(TJ,$)}var H0=z("ZodDate",($,I)=>{BN.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>T5($,b,w,X),$.min=(b,w)=>$.check(p$(b,w)),$.max=(b,w)=>$.check(Y6(b,w));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function FM($){return Q5(H0,$)}var _J=z("ZodArray",($,I)=>{HN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>m5($,U,b,w),$.element=I.element,$.min=(U,b)=>$.check(X4(U,b)),$.nonempty=(U)=>$.check(X4(1,U)),$.max=(U,b)=>$.check(Q1(U,b)),$.length=(U,b)=>$.check(G1(U,b)),$.unwrap=()=>$.element});function A0($,I){return N5(_J,$,I)}function jM($){let I=$._zod.def.shape;return ZD(Object.keys(I))}var O0=z("ZodObject",($,I)=>{AN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>r5($,U,b,w),E.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>ZD(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Y1()}),$.loose=()=>$.clone({...$._zod.def,catchall:Y1()}),$.strict=()=>$.clone({...$._zod.def,catchall:TD()}),$.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(gD,$,U[0]),$.required=(...U)=>E.required(xD,$,U[0])});function EM($,I){let U={type:"object",shape:$??{},...E.normalizeParams(I)};return new O0(U)}function SM($,I){return new O0({type:"object",shape:$,catchall:TD(),...E.normalizeParams(I)})}function PM($,I){return new O0({type:"object",shape:$,catchall:Y1(),...E.normalizeParams(I)})}var z0=z("ZodUnion",($,I)=>{eU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>bD($,U,b,w),$.options=I.options});function _D($,I){return new z0({type:"union",options:$,...E.normalizeParams(I)})}var ZJ=z("ZodXor",($,I)=>{z0.init($,I),ON.init($,I),$._zod.processJSONSchema=(U,b,w)=>bD($,U,b,w),$.options=I.options});function kM($,I){return new ZJ({type:"union",options:$,inclusive:!1,...E.normalizeParams(I)})}var CJ=z("ZodDiscriminatedUnion",($,I)=>{z0.init($,I),zN.init($,I)});function RM($,I,U){return new CJ({type:"union",options:I,discriminator:$,...E.normalizeParams(U)})}var gJ=z("ZodIntersection",($,I)=>{LN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>n5($,U,b,w)});function xJ($,I){return new gJ({type:"intersection",left:$,right:I})}var hJ=z("ZodTuple",($,I)=>{RX.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>i5($,U,b,w),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function fJ($,I,U){let b=I instanceof o,w=b?U:I;return new hJ({type:"tuple",items:$,rest:b?I:null,...E.normalizeParams(w)})}var L0=z("ZodRecord",($,I)=>{KN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>o5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function yJ($,I,U){return new L0({type:"record",keyType:$,valueType:I,...E.normalizeParams(U)})}function TM($,I,U){let b=o$($);return b._zod.values=void 0,new L0({type:"record",keyType:b,valueType:I,...E.normalizeParams(U)})}function _M($,I,U){return new L0({type:"record",keyType:$,valueType:I,mode:"loose",...E.normalizeParams(U)})}var uJ=z("ZodMap",($,I)=>{vN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>l5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function ZM($,I,U){return new uJ({type:"map",keyType:$,valueType:I,...E.normalizeParams(U)})}var lJ=z("ZodSet",($,I)=>{VN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>c5($,U,b,w),$.min=(...U)=>$.check(g4(...U)),$.nonempty=(U)=>$.check(g4(1,U)),$.max=(...U)=>$.check(W1(...U)),$.size=(...U)=>$.check($I(...U))});function CM($,I){return new lJ({type:"set",valueType:$,...E.normalizeParams(I)})}var OI=z("ZodEnum",($,I)=>{qN.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>_5($,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 OI({...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 OI({...I,checks:[],...E.normalizeParams(w),entries:X})}});function ZD($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new OI({type:"enum",entries:U,...E.normalizeParams(I)})}function gM($,I){return new OI({type:"enum",entries:$,...E.normalizeParams(I)})}var cJ=z("ZodLiteral",($,I)=>{MN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>Z5($,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 xM($,I){return new cJ({type:"literal",values:Array.isArray($)?$:[$],...E.normalizeParams(I)})}var mJ=z("ZodFile",($,I)=>{FN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>x5($,U,b,w),$.min=(U,b)=>$.check(g4(U,b)),$.max=(U,b)=>$.check(W1(U,b)),$.mime=(U,b)=>$.check(WI(Array.isArray(U)?U:[U],b))});function hM($){return J5(mJ,$)}var rJ=z("ZodTransform",($,I)=>{jN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>u5($,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 CD($){return new rJ({type:"transform",transform:$})}var gD=z("ZodOptional",($,I)=>{EN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>UJ($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function Y0($){return new gD({type:"optional",innerType:$})}var nJ=z("ZodNullable",($,I)=>{SN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>d5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function N0($){return new nJ({type:"nullable",innerType:$})}function fM($){return Y0(N0($))}var iJ=z("ZodDefault",($,I)=>{PN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>t5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function oJ($,I){return new iJ({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var dJ=z("ZodPrefault",($,I)=>{kN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>a5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function pJ($,I){return new dJ({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var xD=z("ZodNonOptional",($,I)=>{RN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>p5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function tJ($,I){return new xD({type:"nonoptional",innerType:$,...E.normalizeParams(I)})}var aJ=z("ZodSuccess",($,I)=>{TN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>h5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function yM($){return new aJ({type:"success",innerType:$})}var eJ=z("ZodCatch",($,I)=>{_N.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>e5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function sJ($,I){return new eJ({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var $B=z("ZodNaN",($,I)=>{ZN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>C5($,U,b,w)});function uM($){return Y5($B,$)}var hD=z("ZodPipe",($,I)=>{CN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>s5($,U,b,w),$.in=I.in,$.out=I.out});function J0($,I){return new hD({type:"pipe",in:$,out:I})}var fD=z("ZodCodec",($,I)=>{hD.init($,I),sU.init($,I)});function lM($,I,U){return new fD({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var IB=z("ZodReadonly",($,I)=>{gN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>$J($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function UB($){return new IB({type:"readonly",innerType:$})}var wB=z("ZodTemplateLiteral",($,I)=>{xN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>g5($,U,b,w)});function cM($,I){return new wB({type:"template_literal",parts:$,...E.normalizeParams(I)})}var bB=z("ZodLazy",($,I)=>{yN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>wJ($,U,b,w),$.unwrap=()=>$._zod.def.getter()});function XB($){return new bB({type:"lazy",getter:$})}var DB=z("ZodPromise",($,I)=>{fN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>IJ($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function mM($){return new DB({type:"promise",innerType:$})}var WB=z("ZodFunction",($,I)=>{hN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>y5($,U,b,w)});function rM($){return new WB({type:"function",input:Array.isArray($?.input)?fJ($?.input):$?.input??A0(Y1()),output:$?.output??Y1()})}var K0=z("ZodCustom",($,I)=>{uN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>f5($,U,b,w)});function nM($){let I=new A$({check:"custom"});return I._zod.check=$,I}function iM($,I){return B5(K0,$??(()=>!0),I)}function QB($,I={}){return H5(K0,$,I)}function GB($){return A5($)}var oM=O5,dM=z5;function pM($,I={error:`Input not instance of ${$.name}`}){let U=new K0({type:"custom",check:"custom",fn:(b)=>b instanceof $,abort:!0,...E.normalizeParams(I)});return U._zod.bag.Class=$,U}var tM=(...$)=>L5({Codec:fD,Boolean:vI,String:zI},...$);function aM($){let I=XB(()=>{return _D([ND($),qJ(),MJ(),SJ(),A0(I),yJ(ND(),I)])});return I}function eM($,I){return J0(CD($),I)}var Ou={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 zu($){P$({customError:$})}function Lu(){return P$().customError}var YB;(function($){})(YB||(YB={}));var _={...Q0,...DD,iso:AI};function Ku($,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 vu($,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 sM($,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=vu(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 sM(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 Y=u$(G,I);w[Q]=D.has(Q)?Y:Y.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 Y=_.object(w).passthrough(),J=_.looseRecord(Q,G);b=_.intersection(Y,J);break}if($.patternProperties){let Q=$.patternProperties,G=Object.keys(Q),Y=[];for(let H of G){let B=u$(Q[H],I),A=_.string().regex(new RegExp(H));Y.push(_.looseRecord(A,B))}let J=[];if(Object.keys(w).length>0)J.push(_.object(w).passthrough());if(J.push(...Y),J.length===0)b=_.object({}).passthrough();else if(J.length===1)b=J[0];else{let H=_.intersection(J[0],J[1]);for(let B=2;B<J.length;B++)H=_.intersection(H,J[B]);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=sM($,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 $F($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=Ku($,I?.defaultTarget),b=$.$defs||$.definitions||{};return u$($,{version:U,defs:b,refs:new Map,processing:new Set,rootSchema:$})}var NB={};v6(NB,{string:()=>Vu,number:()=>qu,date:()=>ju,boolean:()=>Mu,bigint:()=>Fu});function Vu($){return g7(zI,$)}function qu($){return m7(KI,$)}function Mu($){return t7(vI,$)}function Fu($){return e7(VI,$)}function ju($){return G5(H0,$)}P$($0());var W4=N.enum(["document","record"]),yD=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],uD=["literature","document","record","annotation","artifact"],lD=["molecule","reaction"],qI=50,cD=50;var JB=N.object({blockType:N.enum(yD).default("paragraph").describe("Type of block to create. Default: paragraph"),content:N.string().describe("Text content for the block"),headingLevel:N.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:N.boolean().optional().describe("Checked state for checkListItem"),title:N.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:N.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:N.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:N.enum(uD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:N.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:N.string().optional().describe("Cached title of the linked entity"),doi:N.string().optional().describe("DOI for literature references"),smiles:N.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:N.enum(lD).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:N.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:N.string().optional().describe("Optional description or notes for the molecule block"),matrixId:N.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:N.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:N.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:N.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:N.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 Eu=N.enum(["text","number","unit","select","boolean"]),Su=N.enum(["mandatory","recommended","optional"]),IF=N.object({key:N.string().min(1).describe("Stable column key"),label:N.string().min(1).describe("Human-readable column label"),type:Eu.describe("Column type"),unit:N.string().optional().describe("Optional display unit"),mandation:Su.describe("Field importance level"),description:N.string().optional().describe("Optional field description"),standardRef:N.string().optional().describe("Optional ontology reference"),options:N.array(N.string()).optional().describe("Allowed values for select columns"),hidden:N.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`).")}),MI=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.null()])),UF=N.enum(["generic","stoichiometry"]),BB=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.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:N.string().min(1).describe("Matrix label shown in the editor"),columns:N.array(IF).max(qI).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:N.array(MI).optional().describe("Matrix rows"),nodeRef:N.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:N.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:N.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:N.string().optional().describe("Insert as CHILD of this container block"),childPosition:N.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:N.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"]}),v0={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 HB=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),rows:N.array(MI).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:N.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 AB=N.object({matrixId:N.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:N.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:N.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:N.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:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),q0={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 FI=N.enum(["procedure","characterization","observation","step"]),jI=N.object({type:N.literal("file"),target:N.enum(["local","server","url"]),path:N.string().min(1),format:N.string().min(1),label:N.string().min(1),instrument:N.string().optional(),metadata:N.record(N.string(),N.union([N.string(),N.number(),N.boolean()])).optional()}),wF=N.object({artifactId:N.string().uuid(),role:N.enum(["input","output","derived_from","referenced"]),context:N.record(N.string(),N.unknown()).optional()}),bF=N.object({matrixId:N.string().uuid()}),M0=N.object({tempId:N.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:N.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:N.string().min(1).describe("Human-readable node label."),type:FI.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:N.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:N.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:N.array(jI).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:N.array(wF).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:N.array(bF).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."),body:N.string().optional().describe('This node\'s prose, as markdown — the same syntax you use for document/record content (headings, bullet/numbered lists, **bold**, *italic*, `code`, [[mention:type:uuid|Label]], etc.). Seeds the node body so the text renders under the node in the procedure tree. Authored once at creation; edit the prose directly afterwards. Renders once the record body has a `procedureTree` block (insert one with `insert_block(blockType:"procedureTree")` if absent). Do NOT dump step prose as loose body paragraphs — put it here so it attaches to the node.')}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]});var XF=N.enum(["replace","append"]),OB=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:N.array(M0).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:XF.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:N.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:N.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"]}),F0={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 DF=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],Pu=["molecule","material","mixture","biomacromolecule"],G6$=N.enum(Pu),WF=["active","depleted","archived","draft"],mD=N.enum(DF),EI=N.enum(WF),ku=N.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.'),zB=N.object({id:N.string().uuid().describe("UUID of the artifact to update."),name:N.string().min(1).optional().describe("Display name (skip to keep existing)."),description:N.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:N.array(N.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:N.record(N.string(),N.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:ku.optional(),artifactType:mD.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:EI.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:N.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:N.string().optional().describe("Free-form physical/logical location."),parentId:N.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:N.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)."}),j0={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 QF=N.object({cid:N.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:N.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:N.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:N.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"}),LB=N.object({name:N.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:mD.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:N.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:N.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:N.string().optional().describe("Plain-text description."),tags:N.array(N.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:N.record(N.string(),N.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:EI.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:N.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:N.string().optional().describe("Free-form physical/logical location."),parentId:N.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:N.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:N.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:QF.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:N.object({nodeId:N.string().uuid(),role:N.enum(["input","output","derived_from","referenced"]),context:N.record(N.string(),N.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.")}),E0={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 KB=N.object({title:N.string().min(1).max(500).describe("Title for the new document"),content:N.string().optional().describe("Optional initial content in markdown format"),organizationId:N.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:N.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:N.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.")}),S0={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 vB=N.object({title:N.string().min(1).max(500).describe("Paper title"),doi:N.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:N.array(N.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:N.string().optional().describe("Journal name"),year:N.number().int().positive().optional().describe("Publication year"),sourceUrl:N.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:N.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:N.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:N.string().uuid().optional().describe("Space within workspace"),fetchFullText:N.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.")}),P0={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 VB=N.object({reactionArtifactId:N.string().uuid().describe('UUID of the reaction artifact to derive the stoichiometry matrix from. Must be `artifactType: "reaction"` — other types return an error.'),workspaceId:N.string().uuid().describe("Workspace scope. Must match the reaction artifact and (if provided) the target entity."),entityType:N.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:N.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:N.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:N.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>".')}),k0={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 qB=N.object({title:N.string().min(1).max(500).describe("Title for the new record."),organizationId:N.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:N.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:N.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:N.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:N.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:N.array(N.string().uuid()).optional().describe("User ids participating in this research activity."),initialTree:N.array(M0).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.")}),R0={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 rD=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),blockId:N.string().optional().describe("Block ID to delete (for single delete)"),blockIds:N.array(N.string()).max(cD).optional().describe(`Array of block IDs to delete (batch mode, max ${cD})`)}),Ru=rD.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"}),T0={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 MB=N.object({matrixId:N.string().uuid().describe("UUID of the matrix to delete."),version:N.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:N.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.")}),_0={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 Tu=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),FB=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),rowIndices:N.array(N.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:Tu.optional(),version:N.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"]}),Z0={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 jB=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:N.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).")}),C0={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(" ")};function k$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let b=String(U);return b.includes(",")?`"${b}"`:b}).join(",")}`}function nD($){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 YF($,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),Y=W>0?"...":"",J=Q<$.length?"...":"",H=G<I.length?"...":"",B=`${Y}${$.slice(W,Q)}${J}`,A=`${Y}${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 f4($,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 Y=W.ref;if(W.ref=null,Y){b(Y);let J=$.seen.get(Y).schema;if(J.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))Q.allOf=Q.allOf??[],Q.allOf.push(J);else Object.assign(Q,J),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:HI(I,"input"),output:HI(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 K5=($,I={})=>(U)=>{let b=x4({...U,processors:I});return G$($,b),h4(b,$),f4(b,$)},HI=($,I)=>(U)=>{let{libraryOptions:b,target:w}=U??{},X=x4({...b??{},target:w,io:I,processors:{}});return G$($,X),h4(X,$),f4(X,$)};var Nu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},v5=($,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=Nu[W]??W,w.format==="")delete w.format}if(G)w.contentEncoding=G;if(Q&&Q.size>0){let Y=[...Q];if(Y.length===1)w.pattern=Y[0].source;else if(Y.length>1)w.allOf=[...Y.map((J)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:J.source}))]}},V5=($,I,U,b)=>{let w=U,{minimum:X,maximum:D,format:W,multipleOf:Q,exclusiveMaximum:G,exclusiveMinimum:Y}=$._zod.bag;if(typeof W==="string"&&W.includes("int"))w.type="integer";else w.type="number";if(typeof Y==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.minimum=Y,w.exclusiveMinimum=!0;else w.exclusiveMinimum=Y;if(typeof X==="number"){if(w.minimum=X,typeof Y==="number"&&I.target!=="draft-04")if(Y>=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},q5=($,I,U,b)=>{U.type="boolean"},M5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},F5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},j5=($,I,U,b)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},E5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},S5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},P5=($,I,U,b)=>{U.not={}},k5=($,I,U,b)=>{},R5=($,I,U,b)=>{},T5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},_5=($,I,U,b)=>{let w=$._zod.def,X=lU(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},Z5=($,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}},C5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},g5=($,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},x5=($,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)},h5=($,I,U,b)=>{U.type="boolean"},f5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},y5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},u5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},l5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},c5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},m5=($,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"]})},r5=($,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 Y=X.shape[G]._zod;if(I.io==="input")return Y.optin===void 0;else return Y.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"]})},bD=($,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},n5=($,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},i5=($,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,B)=>G$(H,I,{...b,path:[...b.path,D,B]})),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:Y,maximum:J}=$._zod.bag;if(typeof Y==="number")w.minItems=Y;if(typeof J==="number")w.maxItems=J},o5=($,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"]})},d5=($,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"}]},p5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},t5=($,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))},a5=($,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))},e5=($,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},s5=($,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},$J=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.readOnly=!0},IJ=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},UJ=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},wJ=($,I,U,b)=>{let w=$._zod.innerType;G$(w,I,b);let X=I.seen.get($);X.ref=w},wD={string:v5,number:V5,boolean:q5,bigint:M5,symbol:F5,null:j5,undefined:E5,void:S5,never:P5,any:k5,unknown:R5,date:T5,enum:_5,literal:Z5,nan:C5,template_literal:g5,file:x5,success:h5,custom:f5,function:y5,transform:u5,map:l5,set:c5,array:m5,object:r5,union:bD,intersection:n5,tuple:i5,record:o5,nullable:d5,nonoptional:p5,default:t5,prefault:a5,catch:e5,pipe:s5,readonly:$J,promise:IJ,optional:UJ,lazy:wJ};function XD($,I){if("_idmap"in $){let b=$,w=x4({...I,processors:wD}),X={};for(let Q of b._idmap.entries()){let[G,Y]=Q;G$(Y,w)}let D={},W={registry:b,uri:I?.uri,defs:X};w.external=W;for(let Q of b._idmap.entries()){let[G,Y]=Q;h4(w,Y),D[G]=f4(w,Y)}if(Object.keys(X).length>0){let Q=w.target==="draft-2020-12"?"$defs":"definitions";D.__shared={[Q]:X}}return{schemas:D}}let U=x4({...I,processors:wD});return G$($,U),h4(U,$),f4(U,$)}class bJ{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=x4({processors:wD,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}h4(this.ctx,$);let U=f4(this.ctx,$),{"~standard":b,...w}=U;return w}}var xq={};var Q0={};v6(Q0,{xor:()=>PM,xid:()=>aq,void:()=>qM,uuidv7:()=>mq,uuidv6:()=>cq,uuidv4:()=>lq,uuid:()=>uq,url:()=>rq,unknown:()=>Y1,union:()=>_D,undefined:()=>vM,ulid:()=>tq,uint64:()=>LM,uint32:()=>AM,tuple:()=>fJ,transform:()=>CD,templateLiteral:()=>lM,symbol:()=>KM,superRefine:()=>GB,success:()=>fM,stringbool:()=>pM,stringFormat:()=>QM,string:()=>ND,strictObject:()=>EM,set:()=>ZM,refine:()=>QB,record:()=>yJ,readonly:()=>UB,promise:()=>cM,preprocess:()=>aM,prefault:()=>pJ,pipe:()=>J0,partialRecord:()=>RM,optional:()=>Y0,object:()=>jM,number:()=>qJ,nullish:()=>hM,nullable:()=>N0,null:()=>SJ,nonoptional:()=>tJ,never:()=>TD,nativeEnum:()=>CM,nanoid:()=>oq,nan:()=>yM,meta:()=>oM,map:()=>_M,mac:()=>$M,looseRecord:()=>TM,looseObject:()=>SM,literal:()=>gM,lazy:()=>XB,ksuid:()=>eq,keyof:()=>FM,jwt:()=>WM,json:()=>tM,ipv6:()=>IM,ipv4:()=>sq,intersection:()=>xJ,int64:()=>zM,int32:()=>HM,int:()=>JD,instanceof:()=>dM,httpUrl:()=>nq,hostname:()=>GM,hex:()=>YM,hash:()=>NM,guid:()=>yq,function:()=>mM,float64:()=>BM,float32:()=>JM,file:()=>xM,enum:()=>ZD,emoji:()=>iq,email:()=>fq,e164:()=>DM,discriminatedUnion:()=>kM,describe:()=>iM,date:()=>MM,custom:()=>nM,cuid2:()=>pq,cuid:()=>dq,codec:()=>uM,cidrv6:()=>wM,cidrv4:()=>UM,check:()=>rM,catch:()=>sJ,boolean:()=>MJ,bigint:()=>OM,base64url:()=>XM,base64:()=>bM,array:()=>A0,any:()=>VM,_function:()=>mM,_default:()=>oJ,_ZodString:()=>BD,ZodXor:()=>ZJ,ZodXID:()=>vD,ZodVoid:()=>TJ,ZodUnknown:()=>kJ,ZodUnion:()=>z0,ZodUndefined:()=>jJ,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>KD,ZodType:()=>t,ZodTuple:()=>hJ,ZodTransform:()=>rJ,ZodTemplateLiteral:()=>wB,ZodSymbol:()=>FJ,ZodSuccess:()=>aJ,ZodStringFormat:()=>B$,ZodString:()=>zI,ZodSet:()=>lJ,ZodRecord:()=>L0,ZodReadonly:()=>IB,ZodPromise:()=>DB,ZodPrefault:()=>dJ,ZodPipe:()=>hD,ZodOptional:()=>gD,ZodObject:()=>O0,ZodNumberFormat:()=>N1,ZodNumber:()=>KI,ZodNullable:()=>nJ,ZodNull:()=>EJ,ZodNonOptional:()=>xD,ZodNever:()=>RJ,ZodNanoID:()=>OD,ZodNaN:()=>$B,ZodMap:()=>uJ,ZodMAC:()=>VJ,ZodLiteral:()=>cJ,ZodLazy:()=>bB,ZodKSUID:()=>VD,ZodJWT:()=>kD,ZodIntersection:()=>gJ,ZodIPv6:()=>MD,ZodIPv4:()=>qD,ZodGUID:()=>G0,ZodFunction:()=>WB,ZodFile:()=>mJ,ZodEnum:()=>OI,ZodEmoji:()=>AD,ZodEmail:()=>HD,ZodE164:()=>PD,ZodDiscriminatedUnion:()=>CJ,ZodDefault:()=>iJ,ZodDate:()=>H0,ZodCustomStringFormat:()=>LI,ZodCustom:()=>K0,ZodCodec:()=>fD,ZodCatch:()=>eJ,ZodCUID2:()=>LD,ZodCUID:()=>zD,ZodCIDRv6:()=>jD,ZodCIDRv4:()=>FD,ZodBoolean:()=>vI,ZodBigIntFormat:()=>RD,ZodBigInt:()=>VI,ZodBase64URL:()=>SD,ZodBase64:()=>ED,ZodArray:()=>_J,ZodAny:()=>PJ});var DD={};v6(DD,{uppercase:()=>wI,trim:()=>GI,toUpperCase:()=>NI,toLowerCase:()=>YI,startsWith:()=>XI,slugify:()=>JI,size:()=>$I,regex:()=>II,property:()=>UD,positive:()=>eX,overwrite:()=>Z6,normalize:()=>QI,nonpositive:()=>$D,nonnegative:()=>ID,negative:()=>sX,multipleOf:()=>C4,minSize:()=>g4,minLength:()=>X4,mime:()=>WI,maxSize:()=>W1,maxLength:()=>Q1,lte:()=>Y6,lt:()=>r6,lowercase:()=>UI,length:()=>G1,includes:()=>bI,gte:()=>p$,gt:()=>n6,endsWith:()=>DI});var AI={};v6(AI,{time:()=>WJ,duration:()=>QJ,datetime:()=>XJ,date:()=>DJ,ZodISOTime:()=>GD,ZodISODuration:()=>YD,ZodISODateTime:()=>WD,ZodISODate:()=>QD});var WD=z("ZodISODateTime",($,I)=>{mY.init($,I),B$.init($,I)});function XJ($){return f7(WD,$)}var QD=z("ZodISODate",($,I)=>{rY.init($,I),B$.init($,I)});function DJ($){return y7(QD,$)}var GD=z("ZodISOTime",($,I)=>{nY.init($,I),B$.init($,I)});function WJ($){return u7(GD,$)}var YD=z("ZodISODuration",($,I)=>{iY.init($,I),B$.init($,I)});function QJ($){return l7(YD,$)}var hq=($,I)=>{iU.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>dU($,U)},flatten:{value:(U)=>oU($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,i1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,i1,2)}},isEmpty:{get(){return $.issues.length===0}}})},Bu=z("ZodError",hq),b6=z("ZodError",hq,{Parent:Error});var GJ=p1(b6),YJ=t1(b6),NJ=a1(b6),JJ=e1(b6),BJ=NX(b6),HJ=JX(b6),AJ=BX(b6),OJ=HX(b6),zJ=AX(b6),LJ=OX(b6),KJ=zX(b6),vJ=LX(b6);var t=z("ZodType",($,I)=>{return o.init($,I),Object.assign($["~standard"],{jsonSchema:{input:HI($,"input"),output:HI($,"output")}}),$.toJSONSchema=K5($,{}),$.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)=>GJ($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>NJ($,U,b),$.parseAsync=async(U,b)=>YJ($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>JJ($,U,b),$.spa=$.safeParseAsync,$.encode=(U,b)=>BJ($,U,b),$.decode=(U,b)=>HJ($,U,b),$.encodeAsync=async(U,b)=>AJ($,U,b),$.decodeAsync=async(U,b)=>OJ($,U,b),$.safeEncode=(U,b)=>zJ($,U,b),$.safeDecode=(U,b)=>LJ($,U,b),$.safeEncodeAsync=async(U,b)=>KJ($,U,b),$.safeDecodeAsync=async(U,b)=>vJ($,U,b),$.refine=(U,b)=>$.check(QB(U,b)),$.superRefine=(U)=>$.check(GB(U)),$.overwrite=(U)=>$.check(Z6(U)),$.optional=()=>Y0($),$.nullable=()=>N0($),$.nullish=()=>Y0(N0($)),$.nonoptional=(U)=>tJ($,U),$.array=()=>A0($),$.or=(U)=>_D([$,U]),$.and=(U)=>xJ($,U),$.transform=(U)=>J0($,CD(U)),$.default=(U)=>oJ($,U),$.prefault=(U)=>pJ($,U),$.catch=(U)=>sJ($,U),$.pipe=(U)=>J0($,U),$.readonly=()=>UB($),$.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,$}),BD=z("_ZodString",($,I)=>{D1.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>v5($,b,w,X);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(II(...b)),$.includes=(...b)=>$.check(bI(...b)),$.startsWith=(...b)=>$.check(XI(...b)),$.endsWith=(...b)=>$.check(DI(...b)),$.min=(...b)=>$.check(X4(...b)),$.max=(...b)=>$.check(Q1(...b)),$.length=(...b)=>$.check(G1(...b)),$.nonempty=(...b)=>$.check(X4(1,...b)),$.lowercase=(b)=>$.check(UI(b)),$.uppercase=(b)=>$.check(wI(b)),$.trim=()=>$.check(GI()),$.normalize=(...b)=>$.check(QI(...b)),$.toLowerCase=()=>$.check(YI()),$.toUpperCase=()=>$.check(NI()),$.slugify=()=>$.check(JI())}),zI=z("ZodString",($,I)=>{D1.init($,I),BD.init($,I),$.email=(U)=>$.check(_X(HD,U)),$.url=(U)=>$.check(W0(B0,U)),$.jwt=(U)=>$.check(aX(kD,U)),$.emoji=(U)=>$.check(hX(AD,U)),$.guid=(U)=>$.check(D0(G0,U)),$.uuid=(U)=>$.check(ZX(i6,U)),$.uuidv4=(U)=>$.check(CX(i6,U)),$.uuidv6=(U)=>$.check(gX(i6,U)),$.uuidv7=(U)=>$.check(xX(i6,U)),$.nanoid=(U)=>$.check(fX(OD,U)),$.guid=(U)=>$.check(D0(G0,U)),$.cuid=(U)=>$.check(yX(zD,U)),$.cuid2=(U)=>$.check(uX(LD,U)),$.ulid=(U)=>$.check(lX(KD,U)),$.base64=(U)=>$.check(dX(ED,U)),$.base64url=(U)=>$.check(pX(SD,U)),$.xid=(U)=>$.check(cX(vD,U)),$.ksuid=(U)=>$.check(mX(VD,U)),$.ipv4=(U)=>$.check(rX(qD,U)),$.ipv6=(U)=>$.check(nX(MD,U)),$.cidrv4=(U)=>$.check(iX(FD,U)),$.cidrv6=(U)=>$.check(oX(jD,U)),$.e164=(U)=>$.check(tX(PD,U)),$.datetime=(U)=>$.check(XJ(U)),$.date=(U)=>$.check(DJ(U)),$.time=(U)=>$.check(WJ(U)),$.duration=(U)=>$.check(QJ(U))});function ND($){return C7(zI,$)}var B$=z("ZodStringFormat",($,I)=>{J$.init($,I),BD.init($,I)}),HD=z("ZodEmail",($,I)=>{CY.init($,I),B$.init($,I)});function fq($){return _X(HD,$)}var G0=z("ZodGUID",($,I)=>{_Y.init($,I),B$.init($,I)});function yq($){return D0(G0,$)}var i6=z("ZodUUID",($,I)=>{ZY.init($,I),B$.init($,I)});function uq($){return ZX(i6,$)}function lq($){return CX(i6,$)}function cq($){return gX(i6,$)}function mq($){return xX(i6,$)}var B0=z("ZodURL",($,I)=>{gY.init($,I),B$.init($,I)});function rq($){return W0(B0,$)}function nq($){return W0(B0,{protocol:/^https?$/,hostname:K6.domain,...E.normalizeParams($)})}var AD=z("ZodEmoji",($,I)=>{xY.init($,I),B$.init($,I)});function iq($){return hX(AD,$)}var OD=z("ZodNanoID",($,I)=>{hY.init($,I),B$.init($,I)});function oq($){return fX(OD,$)}var zD=z("ZodCUID",($,I)=>{fY.init($,I),B$.init($,I)});function dq($){return yX(zD,$)}var LD=z("ZodCUID2",($,I)=>{yY.init($,I),B$.init($,I)});function pq($){return uX(LD,$)}var KD=z("ZodULID",($,I)=>{uY.init($,I),B$.init($,I)});function tq($){return lX(KD,$)}var vD=z("ZodXID",($,I)=>{lY.init($,I),B$.init($,I)});function aq($){return cX(vD,$)}var VD=z("ZodKSUID",($,I)=>{cY.init($,I),B$.init($,I)});function eq($){return mX(VD,$)}var qD=z("ZodIPv4",($,I)=>{oY.init($,I),B$.init($,I)});function sq($){return rX(qD,$)}var VJ=z("ZodMAC",($,I)=>{pY.init($,I),B$.init($,I)});function $M($){return x7(VJ,$)}var MD=z("ZodIPv6",($,I)=>{dY.init($,I),B$.init($,I)});function IM($){return nX(MD,$)}var FD=z("ZodCIDRv4",($,I)=>{tY.init($,I),B$.init($,I)});function UM($){return iX(FD,$)}var jD=z("ZodCIDRv6",($,I)=>{aY.init($,I),B$.init($,I)});function wM($){return oX(jD,$)}var ED=z("ZodBase64",($,I)=>{sY.init($,I),B$.init($,I)});function bM($){return dX(ED,$)}var SD=z("ZodBase64URL",($,I)=>{$N.init($,I),B$.init($,I)});function XM($){return pX(SD,$)}var PD=z("ZodE164",($,I)=>{IN.init($,I),B$.init($,I)});function DM($){return tX(PD,$)}var kD=z("ZodJWT",($,I)=>{UN.init($,I),B$.init($,I)});function WM($){return aX(kD,$)}var LI=z("ZodCustomStringFormat",($,I)=>{wN.init($,I),B$.init($,I)});function QM($,I,U={}){return BI(LI,$,I,U)}function GM($){return BI(LI,"hostname",K6.hostname,$)}function YM($){return BI(LI,"hex",K6.hex,$)}function NM($,I){let U=I?.enc??"hex",b=`${$}_${U}`,w=K6[b];if(!w)throw new Error(`Unrecognized hash format: ${b}`);return BI(LI,b,w,I)}var KI=z("ZodNumber",($,I)=>{PX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>V5($,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(Y6(b,w)),$.max=(b,w)=>$.check(Y6(b,w)),$.int=(b)=>$.check(JD(b)),$.safe=(b)=>$.check(JD(b)),$.positive=(b)=>$.check(n6(0,b)),$.nonnegative=(b)=>$.check(p$(0,b)),$.negative=(b)=>$.check(r6(0,b)),$.nonpositive=(b)=>$.check(Y6(0,b)),$.multipleOf=(b,w)=>$.check(C4(b,w)),$.step=(b,w)=>$.check(C4(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 qJ($){return c7(KI,$)}var N1=z("ZodNumberFormat",($,I)=>{bN.init($,I),KI.init($,I)});function JD($){return r7(N1,$)}function JM($){return n7(N1,$)}function BM($){return i7(N1,$)}function HM($){return o7(N1,$)}function AM($){return d7(N1,$)}var vI=z("ZodBoolean",($,I)=>{aU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>q5($,U,b,w)});function MJ($){return p7(vI,$)}var VI=z("ZodBigInt",($,I)=>{kX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>M5($,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(Y6(b,w)),$.max=(b,w)=>$.check(Y6(b,w)),$.positive=(b)=>$.check(n6(BigInt(0),b)),$.negative=(b)=>$.check(r6(BigInt(0),b)),$.nonpositive=(b)=>$.check(Y6(BigInt(0),b)),$.nonnegative=(b)=>$.check(p$(BigInt(0),b)),$.multipleOf=(b,w)=>$.check(C4(b,w));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function OM($){return a7(VI,$)}var RD=z("ZodBigIntFormat",($,I)=>{XN.init($,I),VI.init($,I)});function zM($){return s7(RD,$)}function LM($){return $5(RD,$)}var FJ=z("ZodSymbol",($,I)=>{DN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>F5($,U,b,w)});function KM($){return I5(FJ,$)}var jJ=z("ZodUndefined",($,I)=>{WN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>E5($,U,b,w)});function vM($){return U5(jJ,$)}var EJ=z("ZodNull",($,I)=>{QN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>j5($,U,b,w)});function SJ($){return w5(EJ,$)}var PJ=z("ZodAny",($,I)=>{GN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>k5($,U,b,w)});function VM(){return b5(PJ)}var kJ=z("ZodUnknown",($,I)=>{YN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>R5($,U,b,w)});function Y1(){return X5(kJ)}var RJ=z("ZodNever",($,I)=>{NN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>P5($,U,b,w)});function TD($){return D5(RJ,$)}var TJ=z("ZodVoid",($,I)=>{JN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>S5($,U,b,w)});function qM($){return W5(TJ,$)}var H0=z("ZodDate",($,I)=>{BN.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>T5($,b,w,X),$.min=(b,w)=>$.check(p$(b,w)),$.max=(b,w)=>$.check(Y6(b,w));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function MM($){return Q5(H0,$)}var _J=z("ZodArray",($,I)=>{HN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>m5($,U,b,w),$.element=I.element,$.min=(U,b)=>$.check(X4(U,b)),$.nonempty=(U)=>$.check(X4(1,U)),$.max=(U,b)=>$.check(Q1(U,b)),$.length=(U,b)=>$.check(G1(U,b)),$.unwrap=()=>$.element});function A0($,I){return N5(_J,$,I)}function FM($){let I=$._zod.def.shape;return ZD(Object.keys(I))}var O0=z("ZodObject",($,I)=>{AN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>r5($,U,b,w),E.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>ZD(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Y1()}),$.loose=()=>$.clone({...$._zod.def,catchall:Y1()}),$.strict=()=>$.clone({...$._zod.def,catchall:TD()}),$.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(gD,$,U[0]),$.required=(...U)=>E.required(xD,$,U[0])});function jM($,I){let U={type:"object",shape:$??{},...E.normalizeParams(I)};return new O0(U)}function EM($,I){return new O0({type:"object",shape:$,catchall:TD(),...E.normalizeParams(I)})}function SM($,I){return new O0({type:"object",shape:$,catchall:Y1(),...E.normalizeParams(I)})}var z0=z("ZodUnion",($,I)=>{eU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>bD($,U,b,w),$.options=I.options});function _D($,I){return new z0({type:"union",options:$,...E.normalizeParams(I)})}var ZJ=z("ZodXor",($,I)=>{z0.init($,I),ON.init($,I),$._zod.processJSONSchema=(U,b,w)=>bD($,U,b,w),$.options=I.options});function PM($,I){return new ZJ({type:"union",options:$,inclusive:!1,...E.normalizeParams(I)})}var CJ=z("ZodDiscriminatedUnion",($,I)=>{z0.init($,I),zN.init($,I)});function kM($,I,U){return new CJ({type:"union",options:I,discriminator:$,...E.normalizeParams(U)})}var gJ=z("ZodIntersection",($,I)=>{LN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>n5($,U,b,w)});function xJ($,I){return new gJ({type:"intersection",left:$,right:I})}var hJ=z("ZodTuple",($,I)=>{RX.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>i5($,U,b,w),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function fJ($,I,U){let b=I instanceof o,w=b?U:I;return new hJ({type:"tuple",items:$,rest:b?I:null,...E.normalizeParams(w)})}var L0=z("ZodRecord",($,I)=>{KN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>o5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function yJ($,I,U){return new L0({type:"record",keyType:$,valueType:I,...E.normalizeParams(U)})}function RM($,I,U){let b=o$($);return b._zod.values=void 0,new L0({type:"record",keyType:b,valueType:I,...E.normalizeParams(U)})}function TM($,I,U){return new L0({type:"record",keyType:$,valueType:I,mode:"loose",...E.normalizeParams(U)})}var uJ=z("ZodMap",($,I)=>{vN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>l5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function _M($,I,U){return new uJ({type:"map",keyType:$,valueType:I,...E.normalizeParams(U)})}var lJ=z("ZodSet",($,I)=>{VN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>c5($,U,b,w),$.min=(...U)=>$.check(g4(...U)),$.nonempty=(U)=>$.check(g4(1,U)),$.max=(...U)=>$.check(W1(...U)),$.size=(...U)=>$.check($I(...U))});function ZM($,I){return new lJ({type:"set",valueType:$,...E.normalizeParams(I)})}var OI=z("ZodEnum",($,I)=>{qN.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>_5($,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 OI({...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 OI({...I,checks:[],...E.normalizeParams(w),entries:X})}});function ZD($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new OI({type:"enum",entries:U,...E.normalizeParams(I)})}function CM($,I){return new OI({type:"enum",entries:$,...E.normalizeParams(I)})}var cJ=z("ZodLiteral",($,I)=>{MN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>Z5($,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 gM($,I){return new cJ({type:"literal",values:Array.isArray($)?$:[$],...E.normalizeParams(I)})}var mJ=z("ZodFile",($,I)=>{FN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>x5($,U,b,w),$.min=(U,b)=>$.check(g4(U,b)),$.max=(U,b)=>$.check(W1(U,b)),$.mime=(U,b)=>$.check(WI(Array.isArray(U)?U:[U],b))});function xM($){return J5(mJ,$)}var rJ=z("ZodTransform",($,I)=>{jN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>u5($,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 CD($){return new rJ({type:"transform",transform:$})}var gD=z("ZodOptional",($,I)=>{EN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>UJ($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function Y0($){return new gD({type:"optional",innerType:$})}var nJ=z("ZodNullable",($,I)=>{SN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>d5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function N0($){return new nJ({type:"nullable",innerType:$})}function hM($){return Y0(N0($))}var iJ=z("ZodDefault",($,I)=>{PN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>t5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function oJ($,I){return new iJ({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var dJ=z("ZodPrefault",($,I)=>{kN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>a5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function pJ($,I){return new dJ({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var xD=z("ZodNonOptional",($,I)=>{RN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>p5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function tJ($,I){return new xD({type:"nonoptional",innerType:$,...E.normalizeParams(I)})}var aJ=z("ZodSuccess",($,I)=>{TN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>h5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function fM($){return new aJ({type:"success",innerType:$})}var eJ=z("ZodCatch",($,I)=>{_N.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>e5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function sJ($,I){return new eJ({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var $B=z("ZodNaN",($,I)=>{ZN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>C5($,U,b,w)});function yM($){return Y5($B,$)}var hD=z("ZodPipe",($,I)=>{CN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>s5($,U,b,w),$.in=I.in,$.out=I.out});function J0($,I){return new hD({type:"pipe",in:$,out:I})}var fD=z("ZodCodec",($,I)=>{hD.init($,I),sU.init($,I)});function uM($,I,U){return new fD({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var IB=z("ZodReadonly",($,I)=>{gN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>$J($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function UB($){return new IB({type:"readonly",innerType:$})}var wB=z("ZodTemplateLiteral",($,I)=>{xN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>g5($,U,b,w)});function lM($,I){return new wB({type:"template_literal",parts:$,...E.normalizeParams(I)})}var bB=z("ZodLazy",($,I)=>{yN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>wJ($,U,b,w),$.unwrap=()=>$._zod.def.getter()});function XB($){return new bB({type:"lazy",getter:$})}var DB=z("ZodPromise",($,I)=>{fN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>IJ($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function cM($){return new DB({type:"promise",innerType:$})}var WB=z("ZodFunction",($,I)=>{hN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>y5($,U,b,w)});function mM($){return new WB({type:"function",input:Array.isArray($?.input)?fJ($?.input):$?.input??A0(Y1()),output:$?.output??Y1()})}var K0=z("ZodCustom",($,I)=>{uN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>f5($,U,b,w)});function rM($){let I=new A$({check:"custom"});return I._zod.check=$,I}function nM($,I){return B5(K0,$??(()=>!0),I)}function QB($,I={}){return H5(K0,$,I)}function GB($){return A5($)}var iM=O5,oM=z5;function dM($,I={error:`Input not instance of ${$.name}`}){let U=new K0({type:"custom",check:"custom",fn:(b)=>b instanceof $,abort:!0,...E.normalizeParams(I)});return U._zod.bag.Class=$,U}var pM=(...$)=>L5({Codec:fD,Boolean:vI,String:zI},...$);function tM($){let I=XB(()=>{return _D([ND($),qJ(),MJ(),SJ(),A0(I),yJ(ND(),I)])});return I}function aM($,I){return J0(CD($),I)}var Au={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 Ou($){P$({customError:$})}function zu(){return P$().customError}var YB;(function($){})(YB||(YB={}));var _={...Q0,...DD,iso:AI};function Lu($,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 Ku($,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 eM($,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=Ku(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 eM(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 Y=u$(G,I);w[Q]=D.has(Q)?Y:Y.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 Y=_.object(w).passthrough(),J=_.looseRecord(Q,G);b=_.intersection(Y,J);break}if($.patternProperties){let Q=$.patternProperties,G=Object.keys(Q),Y=[];for(let H of G){let B=u$(Q[H],I),A=_.string().regex(new RegExp(H));Y.push(_.looseRecord(A,B))}let J=[];if(Object.keys(w).length>0)J.push(_.object(w).passthrough());if(J.push(...Y),J.length===0)b=_.object({}).passthrough();else if(J.length===1)b=J[0];else{let H=_.intersection(J[0],J[1]);for(let B=2;B<J.length;B++)H=_.intersection(H,J[B]);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=eM($,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 sM($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=Lu($,I?.defaultTarget),b=$.$defs||$.definitions||{};return u$($,{version:U,defs:b,refs:new Map,processing:new Set,rootSchema:$})}var NB={};v6(NB,{string:()=>vu,number:()=>Vu,date:()=>Fu,boolean:()=>qu,bigint:()=>Mu});function vu($){return g7(zI,$)}function Vu($){return m7(KI,$)}function qu($){return t7(vI,$)}function Mu($){return e7(VI,$)}function Fu($){return G5(H0,$)}P$($0());var W4=N.enum(["document","record"]),yD=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],uD=["literature","document","record","annotation","artifact"],lD=["molecule","reaction"],qI=50,cD=50;var JB=N.object({blockType:N.enum(yD).default("paragraph").describe("Type of block to create. Default: paragraph"),content:N.string().describe("Text content for the block"),headingLevel:N.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:N.boolean().optional().describe("Checked state for checkListItem"),title:N.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:N.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:N.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:N.enum(uD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:N.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:N.string().optional().describe("Cached title of the linked entity"),doi:N.string().optional().describe("DOI for literature references"),smiles:N.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:N.enum(lD).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:N.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:N.string().optional().describe("Optional description or notes for the molecule block"),matrixId:N.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:N.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:N.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:N.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:N.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 ju=N.enum(["text","number","unit","select","boolean"]),Eu=N.enum(["mandatory","recommended","optional"]),$F=N.object({key:N.string().min(1).describe("Stable column key"),label:N.string().min(1).describe("Human-readable column label"),type:ju.describe("Column type"),unit:N.string().optional().describe("Optional display unit"),mandation:Eu.describe("Field importance level"),description:N.string().optional().describe("Optional field description"),standardRef:N.string().optional().describe("Optional ontology reference"),options:N.array(N.string()).optional().describe("Allowed values for select columns"),hidden:N.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`).")}),MI=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.null()])),IF=N.enum(["generic","stoichiometry"]),BB=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),kind:IF.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:N.string().min(1).describe("Matrix label shown in the editor"),columns:N.array($F).max(qI).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:N.array(MI).optional().describe("Matrix rows"),nodeRef:N.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:N.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:N.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:N.string().optional().describe("Insert as CHILD of this container block"),childPosition:N.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:N.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"]}),v0={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 HB=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),rows:N.array(MI).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:N.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 AB=N.object({matrixId:N.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:N.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:N.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:N.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:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),q0={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 FI=N.enum(["procedure","characterization","observation","step"]),jI=N.object({type:N.literal("file"),target:N.enum(["local","server","url"]),path:N.string().min(1),format:N.string().min(1),label:N.string().min(1),instrument:N.string().optional(),metadata:N.record(N.string(),N.union([N.string(),N.number(),N.boolean()])).optional()}),UF=N.object({artifactId:N.string().uuid(),role:N.enum(["input","output","derived_from","referenced"]),context:N.record(N.string(),N.unknown()).optional()}),wF=N.object({matrixId:N.string().uuid()}),M0=N.object({tempId:N.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:N.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:N.string().min(1).describe("Human-readable node label."),type:FI.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:N.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:N.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:N.array(jI).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:N.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:N.array(wF).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."),body:N.string().optional().describe('This node\'s prose, as markdown — the same syntax you use for document/record content (headings, bullet/numbered lists, **bold**, *italic*, `code`, [[mention:type:uuid|Label]], etc.). Seeds the node body so the text renders under the node in the procedure tree. Authored once at creation; edit the prose directly afterwards. Renders once the record body has a `procedureTree` block (insert one with `insert_block(blockType:"procedureTree")` if absent). Do NOT dump step prose as loose body paragraphs — put it here so it attaches to the node.')}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]});var bF=N.enum(["replace","append"]),OB=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:N.array(M0).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:bF.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:N.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:N.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"]}),F0={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 XF=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],Su=["molecule","material","mixture","biomacromolecule"],G6$=N.enum(Su),DF=["active","depleted","archived","draft"],mD=N.enum(XF),EI=N.enum(DF),Pu=N.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.'),zB=N.object({id:N.string().uuid().describe("UUID of the artifact to update."),name:N.string().min(1).optional().describe("Display name (skip to keep existing)."),description:N.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:N.array(N.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:N.record(N.string(),N.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:Pu.optional(),artifactType:mD.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:EI.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:N.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:N.string().optional().describe("Free-form physical/logical location."),parentId:N.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:N.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)."}),j0={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 WF=N.object({cid:N.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:N.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:N.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:N.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"}),LB=N.object({name:N.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:mD.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:N.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:N.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:N.string().optional().describe("Plain-text description."),tags:N.array(N.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:N.record(N.string(),N.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:EI.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:N.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:N.string().optional().describe("Free-form physical/logical location."),parentId:N.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:N.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:N.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:WF.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:N.object({nodeId:N.string().uuid(),role:N.enum(["input","output","derived_from","referenced"]),context:N.record(N.string(),N.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.")}),E0={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 KB=N.object({title:N.string().min(1).max(500).describe("Title for the new document"),content:N.string().optional().describe("Optional initial content in markdown format"),organizationId:N.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:N.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:N.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."),tags:N.array(N.string()).optional().describe("Canonical tag display names to assign to the new document. Existing tags are matched case-insensitively; unknown tags are auto-created within the org. Renaming/merging tags later via the canonical tag system is rename-safe.")}),S0={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 vB=N.object({title:N.string().min(1).max(500).describe("Paper title"),doi:N.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:N.array(N.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:N.string().optional().describe("Journal name"),year:N.number().int().positive().optional().describe("Publication year"),sourceUrl:N.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:N.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:N.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:N.string().uuid().optional().describe("Space within workspace"),fetchFullText:N.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."),tags:N.array(N.string()).optional().describe("Canonical tag display names to assign to the literature item. Merged with any tags resolved from the DOI metadata (the union is applied).")}),P0={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 VB=N.object({reactionArtifactId:N.string().uuid().describe('UUID of the reaction artifact to derive the stoichiometry matrix from. Must be `artifactType: "reaction"` — other types return an error.'),workspaceId:N.string().uuid().describe("Workspace scope. Must match the reaction artifact and (if provided) the target entity."),entityType:N.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:N.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:N.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:N.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>".')}),k0={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 qB=N.object({title:N.string().min(1).max(500).describe("Title for the new record."),organizationId:N.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:N.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:N.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:N.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:N.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:N.array(N.string().uuid()).optional().describe("User ids participating in this research activity."),tags:N.array(N.string()).optional().describe("Canonical tag display names to assign to the new record. Existing tags are matched case-insensitively; unknown tags are auto-created within the org. Renaming/merging tags later via the canonical tag system is rename-safe."),initialTree:N.array(M0).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.")}),R0={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 rD=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),blockId:N.string().optional().describe("Block ID to delete (for single delete)"),blockIds:N.array(N.string()).max(cD).optional().describe(`Array of block IDs to delete (batch mode, max ${cD})`)}),ku=rD.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"}),T0={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 MB=N.object({matrixId:N.string().uuid().describe("UUID of the matrix to delete."),version:N.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:N.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.")}),_0={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 Ru=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),FB=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),rowIndices:N.array(N.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:Ru.optional(),version:N.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"]}),Z0={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 jB=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:N.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).")}),C0={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(" ")};function k$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let b=String(U);return b.includes(",")?`"${b}"`:b}).join(",")}`}function nD($){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 GF($,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),Y=W>0?"...":"",J=Q<$.length?"...":"",H=G<I.length?"...":"",B=`${Y}${$.slice(W,Q)}${J}`,A=`${Y}${I.slice(W,G)}${H}`;return`--- before
|
|
65
65
|
${B}
|
|
66
66
|
+++ after
|
|
67
|
-
${A}`}function
|
|
68
|
-
`)}function
|
|
67
|
+
${A}`}function EB($){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
|
+
`)}function SB($){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((J)=>J.literatureMetadata),Q=D.some((J)=>J.creatorName),G=W?"{type,title,id,relevance,tags,doi,firstAuthor,year,journal":"{type,title,id,relevance,tags",Y=Q?`${G},creator,snippet}`:`${G},snippet}`;X.push(`${Y}[${D.length}]:`);for(let J of D){let H=J.bestSnippet??J.snippet??"",B=H.length>120?`${H.slice(0,117)}...`:H,A=J.tags?.join(" | ")??"",O=J.creatorName??"";if(W){let V=J.literatureMetadata,q=[J.entityType,J.entityTitle,J.entityId,J.relevance,A,V?.doi??"",V?.firstAuthor??"",V?.year??"",V?.journal??""];if(Q)q.push(O);q.push(B),X.push(k$(q))}else{let V=[J.entityType,J.entityTitle,J.entityId,J.relevance,A];if(Q)V.push(O);V.push(B),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 Y=G.bestSnippet??G.snippet??"",J=Y.length>120?`${Y.slice(0,117)}...`:Y,H=[G.entityType,G.entityTitle,G.entityId,G.blockId];if(W)H.push(G.creatorName??"");H.push(J),X.push(k$(H))}}return X.join(`
|
|
70
|
-
`)}function
|
|
71
|
-
`)}function
|
|
72
|
-
`)}function
|
|
73
|
-
`);let D=X.reduce((W,Q)=>Math.max(W,Q.hop),0);for(let W=1;W<=D;W++){let Q=X.filter((G)=>G.hop===W);if(Q.length===0)continue;I.push(""),I.push(`*Hop ${W}* (${Q.length} edges):`);for(let G of Q)for(let Y of
|
|
74
|
-
`)}function
|
|
75
|
-
`);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(
|
|
76
|
-
`)}function
|
|
70
|
+
`)}function YF($){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 Tu($){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 NF($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function _u($){let I=[],U=$.direction==="forward"?"→":"←",b=$.direction==="forward"?"↗":"↙";if($.type==="annotation")b="\uD83D\uDCDD";else if($.type==="citation")b="\uD83D\uDCD6";let w=$.dstEntityType??$.dstScope,X=$.dstTitle||$.dstId.slice(0,8),D=NF(w,$.dstId),W=[$.type,$.direction,`via ${$.provenance}`];if(typeof $.weight==="number"&&$.weight>1)W.push(`shared by ${$.weight} records`);if(I.push(` ${b} ${U} ${w}: ${X} (${D}, ${W.join(" · ")})`),$.text)I.push(` "${$.text}"`);if($.snippet)I.push(` — ${$.snippet}`);return I}function PB($){if(!$.found)return JSON.stringify({found:!1,error:$.error??"Entity not found"});let I=[],U=$.root,b=U?NF(U.type,U.id):"unknown";I.push(`**Situated:** ${U?.type??"entity"} "${U?.title??""}" (${b})`);let w=[`depth ${$.depth??0}`,`${$.nodes?.length??0} nodes`,`${$.edges?.length??0} edges`];if($.truncated)w.push("truncated (busy hop — re-situate a specific node for more)");I.push(`*${w.join(" · ")}*`);let X=$.edges??[];if(X.length===0)return I.push(""),I.push("*No connections within the traversed depth.*"),I.join(`
|
|
73
|
+
`);let D=X.reduce((W,Q)=>Math.max(W,Q.hop),0);for(let W=1;W<=D;W++){let Q=X.filter((G)=>G.hop===W);if(Q.length===0)continue;I.push(""),I.push(`*Hop ${W}* (${Q.length} edges):`);for(let G of Q)for(let Y of _u(G))I.push(Y)}return I.join(`
|
|
74
|
+
`)}function kB($){let I=[];if(I.push(`**"${$.entityTitle}"** - ${$.entityType}`),$.creatorName)I.push(`*by ${$.creatorName}*`);if($.recordStatus)I.push(`*status: ${$.recordStatus}*`);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(`
|
|
75
|
+
`);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(YF($.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(Tu($.overview.regions))}}if($.procedureTree)I.push(""),I.push("**Procedure Tree:**"),I.push($.procedureTree);if(typeof $.edgeCount==="number"&&$.edgeCount>0)I.push(""),I.push(`**Connections**: ${$.edgeCount} edge${$.edgeCount===1?"":"s"} — call \`situate(entityId, depth=1..3)\` to map the graph.`);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(`
|
|
76
|
+
`)}function RB($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
|
|
77
77
|
Title: ${$.title}
|
|
78
|
-
ID: ${$.documentId}`}function
|
|
78
|
+
ID: ${$.documentId}`}function TB($){if(!$.success)return`Failed to import literature: ${$.error}`;if($.alreadyExisted){let U=`Already in library: ${$.title} (id: ${$.literatureId})`;if($.coreEnriched)return`${U}
|
|
79
79
|
Triggered CORE enrichment for missing content.`;return U}let I=`Literature imported successfully.
|
|
80
80
|
Title: ${$.title}
|
|
81
81
|
ID: ${$.literatureId}`;if($.coreEnriched){let U=[];if($.charCount)U.push(`${$.charCount.toLocaleString()} chars`);if($.sectionCount)U.push(`${$.sectionCount} sections`);if($.referenceCount)U.push(`${$.referenceCount} references`);return`${I}
|
|
82
82
|
Full text: imported from CORE (${U.join(", ")})`}if($.error?.includes("CORE enrichment in progress"))return`${I}
|
|
83
|
-
Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function
|
|
83
|
+
Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function _B($){if(!$.success)return`Failed to insert matrix: ${$.error}`;return`Matrix inserted successfully.
|
|
84
84
|
Label: ${$.label}
|
|
85
85
|
Matrix ID: ${$.matrixId}
|
|
86
|
-
Block ID: ${$.blockId}`}function
|
|
87
|
-
`)}function
|
|
86
|
+
Block ID: ${$.blockId}`}function ZB($){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(`
|
|
87
|
+
`)}function CB($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(GF($.originalText,$.updatedText));let U=nD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
|
|
88
88
|
|
|
89
|
-
`)}function
|
|
89
|
+
`)}function gB($){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(`
|
|
90
90
|
`)}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=nD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
|
|
91
|
-
`)}function
|
|
91
|
+
`)}function xB($){if(!$.success)return`Delete failed: ${$.error}`;if($.deletedBlockIds&&$.deletedBlockIds.length>0){let b=[`Deleted ${$.deletedBlockIds.length} blocks:`];if($.results){for(let w of $.results)if(w.success){let X=w.blockType??"?",D=w.contentPreview?`: ${w.contentPreview.slice(0,60)}${w.contentPreview.length>60?"...":""}`:"";b.push(` [${X} | ${w.blockId}]${D}`)}}return b.join(`
|
|
92
92
|
`)}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=nD($.positionContext);if(U)I.push(`New adjacency: ${U}`);return I.join(`
|
|
93
|
-
`)}function
|
|
93
|
+
`)}function hB($){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(`
|
|
94
94
|
`),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(`
|
|
95
|
-
`)}function
|
|
96
|
-
`)}function
|
|
97
|
-
`)}function
|
|
98
|
-
`)}function
|
|
99
|
-
`)}function
|
|
100
|
-
`)}function
|
|
101
|
-
`)}function
|
|
102
|
-
`)}function
|
|
103
|
-
`)}function
|
|
104
|
-
`)}function
|
|
105
|
-
`)}var Zu=N.object({cid:N.number().int().positive().describe("PubChem Compound ID (CID).")}),WH={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 Cu=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,gu=N.object({inchi_key:N.string().regex(Cu,"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).')}),QH={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 BF=N.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),xu=N.object({cid:N.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:N.array(BF).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:N.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),GH={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 hu=N.enum(["preamble","full"]),YH=N.object({entityId:N.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:N.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},N.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:N.array(N.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:hu.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:N.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:N.array(N.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:N.array(N.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:N.array(N.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:N.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:N.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:N.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:N.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.'),connections:N.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},N.boolean()).optional().describe("Return entity connections (graph edges), unioned across all relationship subsystems: content-derived links (mentions, citations, annotation edges, matrix/artifact embeds) AND "+"transactional artifact links (record/procedure-node → "+'artifact, with role input|output|derived_from|referenced) AND matrix provenance (matrices this entity owns or that were derived from it). Inbound artifact links carry a reuse-degree ("shared by N records"). Both directions. Included automatically as a summary in overview mode.')}),g0={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 NH=N.object({forceRefresh:N.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),x0={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 iD=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),afterBlockId:N.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:N.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:N.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:N.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:N.enum(yD).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:N.string().optional().describe("Text content for the new block"),headingLevel:N.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:N.boolean().optional().describe("Checked state for checkListItem"),title:N.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:N.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:N.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:N.enum(uD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:N.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:N.string().optional().describe("Cached title of the linked entity"),doi:N.string().optional().describe("DOI for literature references"),smiles:N.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:N.enum(lD).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:N.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:N.string().optional().describe("Optional description or notes for the structure block"),matrixId:N.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:N.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:N.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:N.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:N.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:N.array(JB).max(qI).optional().describe(`Array of blocks to insert in sequence. Max ${qI} blocks. Use this for inserting multiple blocks in one call.`)}),fu=iD.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"}),h0={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
|
|
95
|
+
`)}function fB($){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 yB($){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 uB($){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(lB($.schema));return U.join(`
|
|
96
|
+
`)}function lB($){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 cB($){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(`
|
|
97
|
+
`)}function mB($){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(lB($.schema));return b.join(`
|
|
98
|
+
`)}function rB($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function nB($){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(`
|
|
99
|
+
`)}function iB($){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(`
|
|
100
|
+
`)}function oB($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function dB($){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(`
|
|
101
|
+
`)}function pB($){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(`
|
|
102
|
+
`)}function tB($){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 aB($){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 eB($){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 sB($){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(`
|
|
103
|
+
`)}function $H($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function IH($){if(!$.success)return $.error??"update_edge failed";return`[edge typed | edgeId=${$.edgeId??""}, relation=${$.relationType??""}, direction=${$.direction??""}]`}function UH($){if(!$.success)return $.error??"update_artifact_link_relation failed";return`[link relation typed | artifactLinkId=${$.artifactLinkId??""}, relation=${$.relationType??""}, role=${$.role??""} (unchanged)]`}function wH($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function bH($){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(`
|
|
104
|
+
`)}function QF($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function XH($){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,QF(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?QF(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(`
|
|
105
|
+
`)}var Zu=N.object({cid:N.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 Cu=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,gu=N.object({inchi_key:N.string().regex(Cu,"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 JF=N.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),xu=N.object({cid:N.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:N.array(JF).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:N.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 hu=N.enum(["preamble","full"]),GH=N.object({entityId:N.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:N.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},N.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:N.array(N.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:hu.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:N.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:N.array(N.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:N.array(N.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:N.array(N.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:N.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:N.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:N.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:N.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.')}),g0={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. Surfaces a connection count for the entity — call `situate` to map the graph.\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.\n\nFor the graph around an entity (mentions, citations, annotation edges, artifact links, matrix provenance, typed relation predicates), call `situate(entityId, depth=1..3)` — it returns the bounded k-hop subgraph in one call. `get_content` overview only carries a count as a discovery hint.\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 YH=N.object({forceRefresh:N.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),x0={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 iD=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),afterBlockId:N.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:N.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:N.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:N.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:N.enum(yD).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:N.string().optional().describe("Text content for the new block"),headingLevel:N.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:N.boolean().optional().describe("Checked state for checkListItem"),title:N.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:N.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:N.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:N.enum(uD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:N.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:N.string().optional().describe("Cached title of the linked entity"),doi:N.string().optional().describe("DOI for literature references"),smiles:N.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:N.enum(lD).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:N.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:N.string().optional().describe("Optional description or notes for the structure block"),matrixId:N.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:N.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:N.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:N.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:N.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:N.array(JB).max(qI).optional().describe(`Array of blocks to insert in sequence. Max ${qI} blocks. Use this for inserting multiple blocks in one call.`)}),fu=iD.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"}),h0={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
|
|
106
106
|
1. afterBlockId: Insert as SIBLING after the specified block
|
|
107
107
|
2. beforeBlockId: Insert as SIBLING before the specified block
|
|
108
108
|
3. parentBlockId: Insert as CHILD of a container block (e.g., referenceItem inside referenceList)
|
|
@@ -173,7 +173,7 @@ To add prose under a procedure node, use the prose container's blockId instead:
|
|
|
173
173
|
|
|
174
174
|
The procedureTree container itself is fine as a sibling anchor (afterBlockId / beforeBlockId) but never as a parentBlockId (its children are projected sections).
|
|
175
175
|
|
|
176
|
-
**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 JH=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:N.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:N.string().min(1).describe("Human-readable node label."),type:FI.describe("Node type."),afterNodeId:N.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:N.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:N.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:N.array(jI).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"]}),f0={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 BH=N.object({templateId:N.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:N.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:N.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:N.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:N.string().optional(),tags:N.array(N.string()).optional(),properties:N.record(N.string(),N.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:EI.optional(),storageRef:N.string().optional(),location:N.string().optional(),parentId:N.string().uuid().optional(),sourceRecordId:N.string().uuid().optional(),slotBindings:N.array(N.object({role:N.string().describe('Slot role from the template (e.g. "reactant").'),label:N.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:N.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`.")}),y0={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 HH=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:N.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:N.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:N.record(N.string(),N.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.')}),u0={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 AH=N.object({matrixId:N.string().uuid().describe("UUID of the matrix to inspect.")}),l0={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 OH=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),c0={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 zH=N.object({recordId:N.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),m0={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 LH=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),nodeRef:N.union([N.string().uuid(),N.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:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),r0={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 HF=N.object({nodeId:N.string().uuid().describe("UUID of the node to move/reorder."),parentId:N.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:N.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),KH=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),moves:N.array(HF).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.")}),n0={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 yu=N.object({cas:N.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),vH={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 VH=N.object({query:N.string().min(1).optional().describe("Search query keywords"),mode:N.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:N.object({type:N.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:N.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:N.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:N.string().uuid().optional().describe("Filter by workspace ID"),spaceId:N.string().uuid().optional().describe("Filter by space ID"),limit:N.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:N.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:N.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:N.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:N.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),tags:N.array(N.string()).optional().describe("Filter by tags. Matches entities that have all of the provided tags by default."),artifactType:N.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:N.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),i0={name:"search",description:`Search across literature, documents, records, and artifacts.
|
|
176
|
+
**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 NH=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:N.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:N.string().min(1).describe("Human-readable node label."),type:FI.describe("Node type."),afterNodeId:N.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:N.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:N.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:N.array(jI).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"]}),f0={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 JH=N.object({templateId:N.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:N.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:N.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:N.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:N.string().optional(),tags:N.array(N.string()).optional(),properties:N.record(N.string(),N.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:EI.optional(),storageRef:N.string().optional(),location:N.string().optional(),parentId:N.string().uuid().optional(),sourceRecordId:N.string().uuid().optional(),slotBindings:N.array(N.object({role:N.string().describe('Slot role from the template (e.g. "reactant").'),label:N.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:N.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`.")}),y0={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 BH=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:N.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:N.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:N.record(N.string(),N.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.')}),u0={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 HH=N.object({matrixId:N.string().uuid().describe("UUID of the matrix to inspect.")}),l0={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 AH=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),c0={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 OH=N.object({recordId:N.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),m0={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 zH=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),nodeRef:N.union([N.string().uuid(),N.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:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),r0={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 BF=N.object({nodeId:N.string().uuid().describe("UUID of the node to move/reorder."),parentId:N.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:N.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),LH=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),moves:N.array(BF).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.")}),n0={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 yu=N.object({cas:N.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),KH={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 vH=N.object({query:N.string().min(1).optional().describe("Search query keywords"),mode:N.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:N.object({type:N.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:N.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:N.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:N.string().uuid().optional().describe("Filter by workspace ID"),spaceId:N.string().uuid().optional().describe("Filter by space ID"),limit:N.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:N.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:N.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:N.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:N.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),artifactType:N.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:N.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),i0={name:"search",description:`Search across literature, documents, records, and artifacts.
|
|
177
177
|
|
|
178
178
|
**Modes:**
|
|
179
179
|
- \`library\` (default): Returns unique entities ranked by relevance. Use when browsing/discovering.
|
|
@@ -225,9 +225,9 @@ Requires \`workspaceId\`. Returns artifact names, types, and retrieval hints.
|
|
|
225
225
|
**Retrieval Hints:**
|
|
226
226
|
Library mode results include \`bestBlockId\` and smart \`retrievalHint\`:
|
|
227
227
|
- High relevance: Jump directly to the best block via \`blockIds=['bestBlockId']\`
|
|
228
|
-
- Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var uu=N.object({name:N.string().optional().describe("Compound name, trade name, or systematic name."),cas:N.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:N.number().int().positive().optional().describe("PubChem CID."),inchi_key:N.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:N.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."),
|
|
228
|
+
- Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var uu=N.object({name:N.string().optional().describe("Compound name, trade name, or systematic name."),cas:N.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:N.number().int().positive().optional().describe("PubChem CID."),inchi_key:N.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:N.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."),VH={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 qH=N.object({entityId:N.string().describe('Entity ID (UUID or short ref like "rec-a3f7e2b9") to situate — the root of the bounded subgraph.'),depth:N.union([N.literal(1),N.literal(2),N.literal(3)]).optional().describe("Traversal depth (1–3, default 2). Bounded BFS over the unified edge model; matrix/node endpoints are terminal leaves.")}),o0={name:"situate",description:["Get the bounded k-hop relationship subgraph around an entity in ONE call — instead of 4–6 manual get_content follow-ups.","Bounded BFS over the unified edge model (the same edges get_content surfaces): mentions, citations, annotation edges, matrix/artifact embeds, transactional artifact links (record/procedure-node → artifact, role input|output|derived_from|referenced), matrix provenance, and promoted typed relation predicates.","Returns the root, hop-annotated nodes, and canonical hop-annotated edges grouped by depth. `matrix`/`node` endpoints are terminal leaves (included, not expanded). Per-hop ranking keeps typed/promoted + high-reuse + structural edges; `truncated:true` means a busy hop dropped low-signal edges (raise nothing — re-`situate` a specific node instead).","Use this to map how a record/document/literature/artifact connects across the workspace before deep-reading; follow interesting nodes with get_content."].join(" ")};var MH=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),blockId:N.string().describe("Block ID to edit"),oldText:N.string().describe("Exact text to find and replace (must match exactly)"),newText:N.string().describe("Text to replace with")}),d0={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 FH=N.object({linkId:N.string().uuid().describe("UUID of the `artifact_links` row to delete. Returned by `link_artifact_to_node` and `list_node_artifact_links`.")}),p0={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 t0={tests:{gloss:"experiment/run → hypothesis/claim/method/prediction: the subject is an empirical test of the object.",reading:"[subject] tests [object]",example:"This run tests the biphasic-DMSN nucleation hypothesis.",symmetric:!1},supports:{gloss:"evidence/result → claim: the subject is evidence in favour of the object (positive pole).",reading:"[subject] supports [object]",example:"The DLS size distribution supports the monodispersity claim.",symmetric:!1},refutes:{gloss:"evidence/result → claim: the subject is evidence against the object (negative pole).",reading:"[subject] refutes [object]",example:"The blank control refutes the catalyst-free pathway claim.",symmetric:!1},replicates:{gloss:"run → prior run: the subject independently reproduces the object under matching conditions.",reading:"[subject] replicates [object]",example:"This batch replicates the 2026-03 reference synthesis.",symmetric:!1},supersedes:{gloss:"newer → older: the subject wholesale replaces the object (the object no longer stands).",reading:"[subject] supersedes [object]",example:"The v2 protocol supersedes the original procedure.",symmetric:!1},corrects:{gloss:"erratum/fix → flawed entity: the subject fixes a specific error in the object (object otherwise stands).",reading:"[subject] corrects [object]",example:"This erratum corrects the yield reported in the prior record.",symmetric:!1},uses:{gloss:"run/analysis → protocol/method/instrument/dataset: the subject employs the object as an input or tool.",reading:"[subject] uses [object]",example:"This characterization uses the standard DLS SOP.",symmetric:!1},characterizes:{gloss:"analysis/measurement → sample/material: the subject measures or describes properties of the object.",reading:"[subject] characterizes [object]",example:"This TEM analysis characterizes the silica nanoparticle sample.",symmetric:!1}},jH=Object.keys(t0),a0=N.enum(jH);function J1(){return jH.map(($)=>`- \`${$}\` — ${t0[$].gloss} Reading: "${t0[$].reading}". e.g. ${t0[$].example}`).join(`
|
|
229
229
|
`)}var oD=N.object({artifactLinkId:N.string().uuid().describe("The `artifact_links` row's `id` (the join-row uuid). Returned by `link_artifact_to_node` and `list_node_artifact_links`. This is the JOIN-ROW id, NOT the artifact id or node id."),relationType:a0.describe(`The relation predicate. One of the eight ratified predicates — DISJOINT from the structural roles (input/output/derived_from/referenced). NEVER pass a structural role here:
|
|
230
230
|
${J1()}`),note:N.string().min(1).describe("REQUIRED rationale (§5.9c): a concise free-text justification for asserting this typed relation. Domain specificity lives here; the predicate stays universal. Stored in `relation_note`; the structural `role` is left untouched.")}),lu=oD.extend({note:N.string().optional()}),e0={name:"update_artifact_link_relation",description:["Set the TYPED, queryable SEMANTIC relation on an existing artifact ↔ source link (an `artifact_links` row) — the epistemic/methodological layer the structural roles (input/output/derived_from/referenced) cannot express.","Use this to record what a node/record actually *does* relative to a linked artifact: tests a hypothesis, supports/refutes a claim, replicates a prior run, supersedes/corrects an entity, uses a protocol, or characterizes a sample.","This is SEPARATE from `link_artifact_to_node` (which creates the row + sets the structural `role`). It keys on the join-row `artifactLinkId` and writes ONLY `relation_type`/`relation_note`; the structural `role` is never changed.","The eight predicates are deliberately tight and universal — pick the one whose argument structure matches; put domain specificity in the REQUIRED `note`, never by inventing a predicate (unknown predicates are rejected).","Predicates (disjoint from structural roles — NEVER pass a structural role here):",J1(),"Re-calling with the same `artifactLinkId` re-types the relation in place."].join(`
|
|
231
231
|
`)};var dD=N.object({edgeId:N.string().uuid().optional().describe("OPTIONAL. Present → RE-TYPE mode: the mention already carries this `edgeId` prop (an already-promoted edge); the tool re-edits the typed metadata in place (DB-only, no document write). Absent → PROMOTION mode: the mention is currently untyped; the tool locates the mention inline in the source entity, mints a fresh `edgeId` into it (the durable anchor), then writes the typed edge. Promotion needs WebSocket config; re-type does not."),sourceEntityId:N.string().uuid().describe("UUID of the document/record the mention lives in (the edge subject)."),sourceEntityType:N.enum(["document","record"]).describe("Type of the source entity (document or record)."),targetEntityId:N.string().uuid().describe("UUID of the mentioned entity (the edge object)."),targetEntityType:N.enum(["literature","document","record","artifact","matrix"]).describe("Type of the mentioned (target) entity."),blockId:N.string().optional().describe("PROMOTION mode only. Optional block scope: when set, only that block is searched for the target mention; when omitted, the whole source entity body is searched. Pass this to disambiguate when the same entity is mentioned in multiple blocks (the tool returns an `ambiguous_mention` error telling you to.) Ignored in re-type mode."),occurrence:N.number().int().min(0).optional().describe("PROMOTION mode only. 0-based index among matching mentions within the search scope (default 0 = first match). Pass this to disambiguate when a single block contains multiple mentions of the same target entity (the tool returns an `ambiguous_mention` error telling you to). Ignored in re-type mode."),relationType:a0.describe(`The relation predicate. One of the eight ratified, disjoint-from-structural predicates:
|
|
232
232
|
${J1()}`),note:N.string().min(1).describe("REQUIRED rationale (§5.9c): a concise free-text justification for asserting this typed edge. Domain specificity lives here; the predicate stays universal."),direction:N.enum(["forward","inverse"]).describe("Reading orientation (§6.2). `forward` = subject → object (the source entity tests/uses/etc. the mentioned entity — the usual case). `inverse` = object → subject (e.g. the mentioned reviewer note *refutes* this document). Storage always keeps source = subject; this only flips the reading.")}),cu=dD.extend({edgeId:N.string().uuid(),note:N.string().optional()}),s0={name:"update_edge",description:["Promote a plain @mention into a TYPED, queryable, convergence-preserved relationship edge — the epistemic/methodological layer the structural links (input/output/derived_from/referenced) cannot express.","Use this to record what a run/analysis/result actually *does* relative to another entity: tests a hypothesis, supports/refutes a claim, replicates a prior run, supersedes/corrects an entity, uses a protocol, or characterizes a sample.","The eight predicates are deliberately tight and universal — pick the one whose argument structure matches; put domain specificity in the REQUIRED `note`, never by inventing a predicate (unknown predicates are rejected).","Predicates (disjoint from structural roles — NEVER pass a structural role here):",J1(),"Two modes: (a) PROMOTION — omit `edgeId`; the tool finds the @mention of `targetEntity` inside `sourceEntity`, writes a durable edge anchor into the document, then types the edge. Disambiguate with `blockId` and/or `occurrence` if the tool reports `ambiguous_mention`. (b) RE-TYPE — pass the existing `edgeId` (an already-promoted mention) to re-edit the typed metadata in place. Either way, the metadata survives every document convergence."].join(`
|
|
233
|
-
`)};var mu=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.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)."),ru=N.object({rowIndex:N.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:mu.optional(),values:MI.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"]}),SH=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),updates:N.array(ru).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),$w={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 PH=N.object({nodeId:N.string().uuid().describe("UUID of the existing procedure node to update."),label:N.string().min(1).optional().describe("New label (skip to keep existing)."),type:FI.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:N.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:N.array(jI).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)."}),Iw={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(" ")};var kH=[i0,g0,o0,d0,h0,v0,k0,T0,S0,P0,R0,E0,y0,x0,m0,F0,f0,Iw,n0,C0,V0,$w,j0,Z0,r0,q0,l0,_0,u0,p0,c0,e0,s0,qH,WH,QH,vH,GH],nu=kH.map(($)=>$.name),iu=Object.fromEntries(kH.map(($)=>[$.name,$]));function RH($){return{content:[{type:"text",text:$}]}}function TH($){return{content:[{type:"text",text:$}],isError:!0}}function g($,I,U){let{definition:b,schema:w,createExecutor:X,formatOutput:D,formatError:W=(J)=>J.message,getLogMessage:Q=(J)=>JSON.stringify(J).slice(0,100)}=U,G=X(I),Y=w.shape;$.tool(b.name,b.description,Y,async(J)=>{let H=J,B=Q(H);I.log.info(`${b.name}: ${B}`);try{let A=await G(H),O=D(A,H);return I.log.info(`${b.name}: completed`),RH(O)}catch(A){let O=A instanceof Error?W(A,H):"Unknown error";return I.log.error(`${b.name} failed:`,A),TH(`${b.name} error: ${O}`)}})}function pD($,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,Y=X(I),J=w.shape;$.tool(b.name,b.description,J,async(H)=>{let B=H,A=G(B);I.log.info(`${b.name}: ${A}`);try{let O=await Y(B);if(!O.found)return I.log.info(`${b.name}: not found`),{content:[{type:"text",text:W(O,B)}],isError:!0};return I.log.info(`${b.name}: found`),RH(D(O,B))}catch(O){let V=O instanceof Error?Q(O,B):"Unknown error";return I.log.error(`${b.name} failed:`,O),TH(`${b.name} error: ${V}`)}})}function AF($,I){g($,I,{definition:V0,schema:HB,createExecutor:(U)=>{return async(b)=>{return await U.client.appendMatrixRows(b)}},formatOutput:dB,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function OF($,I){g($,I,{definition:q0,schema:AB,createExecutor:(U)=>{return async(b)=>{return await U.client.attachMatrix(b)}},formatOutput:sB,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 zF($,I){g($,I,{definition:F0,schema:OB,createExecutor:(U)=>{return async(b)=>{return await U.client.buildProcedureTree(b)}},formatOutput:oB,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function LF($,I){g($,I,{definition:E0,schema:LB,createExecutor:(U)=>{return async(b)=>{return await U.client.createArtifact(b)}},formatOutput:lB,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function KF($,I){g($,I,{definition:S0,schema:KB,createExecutor:(U)=>{return async(b)=>{return await U.client.createDocument(b)}},formatOutput:TB,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function vF($,I){g($,I,{definition:P0,schema:vB,createExecutor:(U)=>{return async(b)=>{return U.client.createLiterature(b)}},formatOutput:_B,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function VF($,I){g($,I,{definition:k0,schema:VB,createExecutor:(U)=>{return async(b)=>{return await U.client.createMatrixFromReactionArtifact(b)}},formatOutput:CB,getLogMessage:(U)=>`Deriving matrix from reaction ${U.reactionArtifactId.slice(0,8)}`})}function qF($,I){g($,I,{definition:R0,schema:qB,createExecutor:(U)=>{return async(b)=>{return await U.client.createRecord(b)}},formatOutput:fB,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function MF($,I){g($,I,{definition:T0,schema:rD,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteBlock(b)}},formatOutput:hB,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 FF($,I){g($,I,{definition:_0,schema:MB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrix(b)}},formatOutput:eB,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function jF($,I){g($,I,{definition:Z0,schema:FB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrixRows(b)}},formatOutput:tB,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function EF($,I){g($,I,{definition:C0,schema:jB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteProcedureNode(b)}},formatOutput:iB,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function SF($,I){pD($,I,{definition:g0,schema:YH,createExecutor:(U)=>{return async(b)=>{return U.client.getContent(b)}},formatSuccess:RB,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 PF($,I){g($,I,{definition:x0,schema:NH,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:SB,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function kF($,I){g($,I,{definition:h0,schema:iD,createExecutor:(U)=>{return async(b)=>{return await U.client.insertBlock(b)}},formatOutput:xB,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 RF($,I){g($,I,{definition:v0,schema:BB,createExecutor:(U)=>{return async(b)=>{return await U.client.insertMatrix(b)}},formatOutput:(U)=>ZB(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function TF($,I){g($,I,{definition:f0,schema:JH,createExecutor:(U)=>{return async(b)=>{return await U.client.insertProcedureNode(b)}},formatOutput:yB,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function _F($,I){g($,I,{definition:y0,schema:BH,createExecutor:(U)=>{return async(b)=>{return await U.client.instantiateArtifactTemplate(b)}},formatOutput:mB,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function ZF($,I){g($,I,{definition:u0,schema:HH,createExecutor:(U)=>{return async(b)=>{return await U.client.linkArtifactToNode(b)}},formatOutput:IH,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function CF($,I){g($,I,{definition:l0,schema:AH,createExecutor:(U)=>{return async(b)=>{return await U.client.listMatrixReferences(b)}},formatOutput:$H,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function gF($,I){g($,I,{definition:c0,schema:OH,createExecutor:(U)=>{return async(b)=>{return await U.client.listNodeArtifactLinks(b)}},formatOutput:XH,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function xF($,I){g($,I,{definition:m0,schema:zH,createExecutor:(U)=>{return async(b)=>{return await U.client.listProcedureNodes(b)}},formatOutput:DH,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function hF($,I){g($,I,{definition:r0,schema:LH,createExecutor:(U)=>{return async(b)=>{return await U.client.rebindMatrixToNode(b)}},formatOutput:aB,getLogMessage:(U)=>{let b=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${b}`}})}function fF($,I){g($,I,{definition:n0,schema:KH,createExecutor:(U)=>{return async(b)=>{return await U.client.reorderProcedureNodes(b)}},formatOutput:nB,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function ou($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function yF($,I){g($,I,{definition:i0,schema:VH,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}),Y=G.results.map((J)=>{let H=J.description?J.description.length>100?`${J.description.slice(0,97)}...`:J.description:`${J.artifactType}, ${J.status}`;return{entityType:"artifact",entityId:J.id,entityTitle:J.name,matchCount:1,bestBlockId:"",snippet:H,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${J.id}")`}}});return{mode:"library",found:Y.length,results:Y,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((Y)=>{let{bestMatch:J}=Y,H=ou(J.rank,Y.matchCount),B={entityType:Y.entityType,entityId:Y.entityId,entityTitle:Y.entityTitle,matchCount:Y.matchCount,bestBlockId:J.blockId,snippet:J.snippet,relevance:H,tags:Y.tags,retrievalHint:J.blockId?{recommended:"blockIds",usage:`blockIds=['${J.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(Y.literatureMetadata)B.literatureMetadata=Y.literatureMetadata;if(Y.creatorId)B.creatorId=Y.creatorId;if(Y.creatorName)B.creatorName=Y.creatorName;return B});return{mode:"library",found:G.length,results:G,hasMore:D.hasMore}}let Q=W.map((G)=>{let Y={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:""}']`}},J=G.creatorId,H=G.creatorName;if(J)Y.creatorId=J;if(H)Y.creatorName=H;return Y});return{mode:"blocks",found:Q.length,results:Q,hasMore:D.hasMore}}},formatOutput:(U)=>PB(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function uF($,I){pD($,I,{definition:o0,schema:MH,createExecutor:(U)=>{return async(b)=>{return U.client.situate(b)}},formatSuccess:kB,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>`${U.entityId.slice(0,8)}... (depth ${U.depth??2})`})}function lF($,I){g($,I,{definition:d0,schema:FH,createExecutor:(U)=>{return async(b)=>{return await U.client.strReplaceBlock(b)}},formatOutput:gB,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function cF($,I){g($,I,{definition:p0,schema:jH,createExecutor:(U)=>{return async(b)=>{return await U.client.unlinkArtifactFromNode(b)}},formatOutput:bH,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function mF($,I){g($,I,{definition:j0,schema:zB,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifact(b)}},formatOutput:rB,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function rF($,I){g($,I,{definition:e0,schema:oD,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifactLinkRelation(b)}},formatOutput:wH,getLogMessage:(U)=>`Typing artifact link ${U.artifactLinkId.slice(0,8)} as "${U.relationType}"`})}function nF($,I){g($,I,{definition:s0,schema:dD,createExecutor:(U)=>{return async(b)=>{return await U.client.updateEdge(b)}},formatOutput:UH,getLogMessage:(U)=>U.edgeId?`Re-typing edge ${U.edgeId.slice(0,8)} as "${U.relationType}" (${U.direction})`:`Promoting @mention → "${U.relationType}" edge (${U.direction})`})}function iF($,I){g($,I,{definition:$w,schema:SH,createExecutor:(U)=>{return async(b)=>{return await U.client.updateMatrixRows(b)}},formatOutput:pB,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function oF($,I){g($,I,{definition:Iw,schema:PH,createExecutor:(U)=>{return async(b)=>{return await U.client.updateProcedureNode(b)}},formatOutput:uB,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function dF($,I){I.log.info("Registering tools..."),yF($,I),SF($,I),uF($,I),lF($,I),kF($,I),RF($,I),VF($,I),MF($,I),KF($,I),vF($,I),qF($,I),PF($,I),xF($,I),zF($,I),TF($,I),oF($,I),fF($,I),EF($,I),AF($,I),iF($,I),jF($,I),hF($,I),FF($,I),OF($,I),CF($,I),LF($,I),mF($,I),_F($,I),ZF($,I),cF($,I),gF($,I),rF($,I),nF($,I),I.log.info("All tools registered")}function du(){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}b4.info("Starting SURA MCP Server...");var pF=du(),tF=pF.apiKey??process.env.SURA_API_KEY,pu=pF.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!tF)b4.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),b4.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var tu=await wq({apiUrl:pu,apiKey:tF}),aF=new pQ({name:"sura",version:"0.1.0"});dF(aF,tu);var eF=new aQ,sF=async($)=>{b4.info(`Received ${$}, shutting down...`),await eF.close(),process.exit(0)};process.on("SIGTERM",()=>sF("SIGTERM"));process.on("SIGINT",()=>sF("SIGINT"));process.on("uncaughtException",($)=>{b4.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{b4.error("Unhandled rejection:",$)});b4.info("Connecting stdio transport...");await aF.connect(eF);b4.info("SURA MCP Server ready");
|
|
233
|
+
`)};var mu=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.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)."),ru=N.object({rowIndex:N.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:mu.optional(),values:MI.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"]}),EH=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),updates:N.array(ru).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),$w={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 SH=N.object({nodeId:N.string().uuid().describe("UUID of the existing procedure node to update."),label:N.string().min(1).optional().describe("New label (skip to keep existing)."),type:FI.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:N.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:N.array(jI).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)."}),Iw={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(" ")};var PH=[i0,g0,o0,d0,h0,v0,k0,T0,S0,P0,R0,E0,y0,x0,m0,F0,f0,Iw,n0,C0,V0,$w,j0,Z0,r0,q0,l0,_0,u0,p0,c0,e0,s0,VH,DH,WH,KH,QH],nu=PH.map(($)=>$.name),iu=Object.fromEntries(PH.map(($)=>[$.name,$]));function kH($){return{content:[{type:"text",text:$}]}}function RH($){return{content:[{type:"text",text:$}],isError:!0}}function g($,I,U){let{definition:b,schema:w,createExecutor:X,formatOutput:D,formatError:W=(J)=>J.message,getLogMessage:Q=(J)=>JSON.stringify(J).slice(0,100)}=U,G=X(I),Y=w.shape;$.tool(b.name,b.description,Y,async(J)=>{let H=J,B=Q(H);I.log.info(`${b.name}: ${B}`);try{let A=await G(H),O=D(A,H);return I.log.info(`${b.name}: completed`),kH(O)}catch(A){let O=A instanceof Error?W(A,H):"Unknown error";return I.log.error(`${b.name} failed:`,A),RH(`${b.name} error: ${O}`)}})}function pD($,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,Y=X(I),J=w.shape;$.tool(b.name,b.description,J,async(H)=>{let B=H,A=G(B);I.log.info(`${b.name}: ${A}`);try{let O=await Y(B);if(!O.found)return I.log.info(`${b.name}: not found`),{content:[{type:"text",text:W(O,B)}],isError:!0};return I.log.info(`${b.name}: found`),kH(D(O,B))}catch(O){let V=O instanceof Error?Q(O,B):"Unknown error";return I.log.error(`${b.name} failed:`,O),RH(`${b.name} error: ${V}`)}})}function HF($,I){g($,I,{definition:V0,schema:HB,createExecutor:(U)=>{return async(b)=>{return await U.client.appendMatrixRows(b)}},formatOutput:oB,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function AF($,I){g($,I,{definition:q0,schema:AB,createExecutor:(U)=>{return async(b)=>{return await U.client.attachMatrix(b)}},formatOutput:eB,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 OF($,I){g($,I,{definition:F0,schema:OB,createExecutor:(U)=>{return async(b)=>{return await U.client.buildProcedureTree(b)}},formatOutput:iB,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function zF($,I){g($,I,{definition:E0,schema:LB,createExecutor:(U)=>{return async(b)=>{return await U.client.createArtifact(b)}},formatOutput:uB,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function LF($,I){g($,I,{definition:S0,schema:KB,createExecutor:(U)=>{return async(b)=>{return await U.client.createDocument(b)}},formatOutput:RB,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function KF($,I){g($,I,{definition:P0,schema:vB,createExecutor:(U)=>{return async(b)=>{return U.client.createLiterature(b)}},formatOutput:TB,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function vF($,I){g($,I,{definition:k0,schema:VB,createExecutor:(U)=>{return async(b)=>{return await U.client.createMatrixFromReactionArtifact(b)}},formatOutput:ZB,getLogMessage:(U)=>`Deriving matrix from reaction ${U.reactionArtifactId.slice(0,8)}`})}function VF($,I){g($,I,{definition:R0,schema:qB,createExecutor:(U)=>{return async(b)=>{return await U.client.createRecord(b)}},formatOutput:hB,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function qF($,I){g($,I,{definition:T0,schema:rD,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteBlock(b)}},formatOutput:xB,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 MF($,I){g($,I,{definition:_0,schema:MB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrix(b)}},formatOutput:aB,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function FF($,I){g($,I,{definition:Z0,schema:FB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrixRows(b)}},formatOutput:pB,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function jF($,I){g($,I,{definition:C0,schema:jB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteProcedureNode(b)}},formatOutput:nB,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function EF($,I){pD($,I,{definition:g0,schema:GH,createExecutor:(U)=>{return async(b)=>{return U.client.getContent(b)}},formatSuccess:kB,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 SF($,I){g($,I,{definition:x0,schema:YH,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:EB,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function PF($,I){g($,I,{definition:h0,schema:iD,createExecutor:(U)=>{return async(b)=>{return await U.client.insertBlock(b)}},formatOutput:gB,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 kF($,I){g($,I,{definition:v0,schema:BB,createExecutor:(U)=>{return async(b)=>{return await U.client.insertMatrix(b)}},formatOutput:(U)=>_B(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function RF($,I){g($,I,{definition:f0,schema:NH,createExecutor:(U)=>{return async(b)=>{return await U.client.insertProcedureNode(b)}},formatOutput:fB,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function TF($,I){g($,I,{definition:y0,schema:JH,createExecutor:(U)=>{return async(b)=>{return await U.client.instantiateArtifactTemplate(b)}},formatOutput:cB,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function _F($,I){g($,I,{definition:u0,schema:BH,createExecutor:(U)=>{return async(b)=>{return await U.client.linkArtifactToNode(b)}},formatOutput:$H,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function ZF($,I){g($,I,{definition:l0,schema:HH,createExecutor:(U)=>{return async(b)=>{return await U.client.listMatrixReferences(b)}},formatOutput:sB,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function CF($,I){g($,I,{definition:c0,schema:AH,createExecutor:(U)=>{return async(b)=>{return await U.client.listNodeArtifactLinks(b)}},formatOutput:bH,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function gF($,I){g($,I,{definition:m0,schema:OH,createExecutor:(U)=>{return async(b)=>{return await U.client.listProcedureNodes(b)}},formatOutput:XH,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function xF($,I){g($,I,{definition:r0,schema:zH,createExecutor:(U)=>{return async(b)=>{return await U.client.rebindMatrixToNode(b)}},formatOutput:tB,getLogMessage:(U)=>{let b=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${b}`}})}function hF($,I){g($,I,{definition:n0,schema:LH,createExecutor:(U)=>{return async(b)=>{return await U.client.reorderProcedureNodes(b)}},formatOutput:rB,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function ou($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function fF($,I){g($,I,{definition:i0,schema:vH,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}),Y=G.results.map((J)=>{let H=J.description?J.description.length>100?`${J.description.slice(0,97)}...`:J.description:`${J.artifactType}, ${J.status}`;return{entityType:"artifact",entityId:J.id,entityTitle:J.name,matchCount:1,bestBlockId:"",snippet:H,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${J.id}")`}}});return{mode:"library",found:Y.length,results:Y,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}),W=D.results??[];if(w==="library"){let G=W.map((Y)=>{let{bestMatch:J}=Y,H=ou(J.rank,Y.matchCount),B={entityType:Y.entityType,entityId:Y.entityId,entityTitle:Y.entityTitle,matchCount:Y.matchCount,bestBlockId:J.blockId,snippet:J.snippet,relevance:H,tags:Y.tags,retrievalHint:J.blockId?{recommended:"blockIds",usage:`blockIds=['${J.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(Y.literatureMetadata)B.literatureMetadata=Y.literatureMetadata;if(Y.creatorId)B.creatorId=Y.creatorId;if(Y.creatorName)B.creatorName=Y.creatorName;return B});return{mode:"library",found:G.length,results:G,hasMore:D.hasMore}}let Q=W.map((G)=>{let Y={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:""}']`}},J=G.creatorId,H=G.creatorName;if(J)Y.creatorId=J;if(H)Y.creatorName=H;return Y});return{mode:"blocks",found:Q.length,results:Q,hasMore:D.hasMore}}},formatOutput:(U)=>SB(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function yF($,I){pD($,I,{definition:o0,schema:qH,createExecutor:(U)=>{return async(b)=>{return U.client.situate(b)}},formatSuccess:PB,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>`${U.entityId.slice(0,8)}... (depth ${U.depth??2})`})}function uF($,I){g($,I,{definition:d0,schema:MH,createExecutor:(U)=>{return async(b)=>{return await U.client.strReplaceBlock(b)}},formatOutput:CB,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function lF($,I){g($,I,{definition:p0,schema:FH,createExecutor:(U)=>{return async(b)=>{return await U.client.unlinkArtifactFromNode(b)}},formatOutput:wH,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function cF($,I){g($,I,{definition:j0,schema:zB,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifact(b)}},formatOutput:mB,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function mF($,I){g($,I,{definition:e0,schema:oD,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifactLinkRelation(b)}},formatOutput:UH,getLogMessage:(U)=>`Typing artifact link ${U.artifactLinkId.slice(0,8)} as "${U.relationType}"`})}function rF($,I){g($,I,{definition:s0,schema:dD,createExecutor:(U)=>{return async(b)=>{return await U.client.updateEdge(b)}},formatOutput:IH,getLogMessage:(U)=>U.edgeId?`Re-typing edge ${U.edgeId.slice(0,8)} as "${U.relationType}" (${U.direction})`:`Promoting @mention → "${U.relationType}" edge (${U.direction})`})}function nF($,I){g($,I,{definition:$w,schema:EH,createExecutor:(U)=>{return async(b)=>{return await U.client.updateMatrixRows(b)}},formatOutput:dB,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function iF($,I){g($,I,{definition:Iw,schema:SH,createExecutor:(U)=>{return async(b)=>{return await U.client.updateProcedureNode(b)}},formatOutput:yB,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function oF($,I){I.log.info("Registering tools..."),fF($,I),EF($,I),yF($,I),uF($,I),PF($,I),kF($,I),vF($,I),qF($,I),LF($,I),KF($,I),VF($,I),SF($,I),gF($,I),OF($,I),RF($,I),iF($,I),hF($,I),jF($,I),HF($,I),nF($,I),FF($,I),xF($,I),MF($,I),AF($,I),ZF($,I),zF($,I),cF($,I),TF($,I),_F($,I),lF($,I),CF($,I),mF($,I),rF($,I),I.log.info("All tools registered")}function du(){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}b4.info("Starting SURA MCP Server...");var dF=du(),pF=dF.apiKey??process.env.SURA_API_KEY,pu=dF.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!pF)b4.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),b4.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var tu=await Uq({apiUrl:pu,apiKey:pF}),tF=new pQ({name:"sura",version:"0.1.0"});oF(tF,tu);var aF=new aQ,eF=async($)=>{b4.info(`Received ${$}, shutting down...`),await aF.close(),process.exit(0)};process.on("SIGTERM",()=>eF("SIGTERM"));process.on("SIGINT",()=>eF("SIGINT"));process.on("uncaughtException",($)=>{b4.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{b4.error("Unhandled rejection:",$)});b4.info("Connecting stdio transport...");await tF.connect(aF);b4.info("SURA MCP Server ready");
|