@sura_ai/mcp-server 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.js +72 -70
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,48 +1,48 @@
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
4
- || (${D} == "string" && ${w} && ${w} == +${w})`).assign(W,p._`+${w}`);return;case"integer":b.elseIf(p._`${D} === "boolean" || ${w} === null
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: ${$},
7
- missingProperty: ${b},
2
+ var $E=Object.create;var{getPrototypeOf:IE,defineProperty:eb,getOwnPropertyNames:UE}=Object;var DE=Object.prototype.hasOwnProperty;var C5=($,I,U)=>{U=$!=null?$E(IE($)):{};let A=I||!$||!$.__esModule?eb(U,"default",{value:$,enumerable:!0}):U;for(let D of UE($))if(!DE.call(A,D))eb(A,D,{get:()=>$[D],enumerable:!0});return A};var C=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var K6=($,I)=>{for(var U in I)eb($,U,{get:I[U],enumerable:!0,configurable:!0,set:(A)=>I[U]=()=>A})};var QU=C((SL)=>{Object.defineProperty(SL,"__esModule",{value:!0});SL.regexpCode=SL.getEsmExportName=SL.getProperty=SL.safeStringify=SL.stringify=SL.strConcat=SL.addCodeArg=SL.str=SL._=SL.nil=SL._Code=SL.Name=SL.IDENTIFIER=SL._CodeOrName=void 0;class wA{}SL._CodeOrName=wA;SL.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class kI extends wA{constructor($){super();if(!SL.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}}}SL.Name=kI;class E6 extends wA{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 kI)I[U.str]=(I[U.str]||0)+1;return I},{})}}SL._Code=E6;SL.nil=new E6("");function FL($,...I){let U=[$[0]],A=0;while(A<I.length)uX(U,I[A]),U.push($[++A]);return new E6(U)}SL._=FL;var yX=new E6("+");function EL($,...I){let U=[GU($[0])],A=0;while(A<I.length)U.push(yX),uX(U,I[A]),U.push(yX,GU($[++A]));return LP(U),new E6(U)}SL.str=EL;function uX($,I){if(I instanceof E6)$.push(...I._items);else if(I instanceof kI)$.push(I);else $.push(KP(I))}SL.addCodeArg=uX;function LP($){let I=1;while(I<$.length-1){if($[I]===yX){let U=zP($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function zP($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof kI||$[$.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 kI))return`"${$}${I.slice(1)}`;return}function MP($,I){return I.emptyStr()?$:$.emptyStr()?I:EL`${$}${I}`}SL.strConcat=MP;function KP($){return typeof $=="number"||typeof $=="boolean"||$===null?$:GU(Array.isArray($)?$.join(","):$)}function vP($){return new E6(GU($))}SL.stringify=vP;function GU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}SL.safeStringify=GU;function VP($){return typeof $=="string"&&SL.IDENTIFIER.test($)?new E6(`.${$}`):FL`[${$}]`}SL.getProperty=VP;function qP($){if(typeof $=="string"&&SL.IDENTIFIER.test($))return new E6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}SL.getEsmExportName=qP;function FP($){return new E6($.toString())}SL.regexpCode=FP});var rX=C((RL)=>{Object.defineProperty(RL,"__esModule",{value:!0});RL.ValueScope=RL.ValueScopeName=RL.Scope=RL.varKinds=RL.UsedValueState=void 0;var e$=QU();class kL extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var NA;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(NA||(RL.UsedValueState=NA={}));RL.varKinds={const:new e$.Name("const"),let:new e$.Name("let"),var:new e$.Name("var")};class cX{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}}}RL.Scope=cX;class mX extends e$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=e$._`.${new e$.Name(I)}[${U}]`}}RL.ValueScopeName=mX;var hP=e$._`\n`;class PL extends cX{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?hP:e$.nil}}get(){return this._scope}name($){return new mX($,this._newName($))}value($,I){var U;if(I.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let A=this.toName($),{prefix:D}=A,w=(U=I.key)!==null&&U!==void 0?U:I.ref,b=this._values[D];if(b){let X=b.get(w);if(X)return X}else b=this._values[D]=new Map;b.set(w,A);let N=this._scope[D]||(this._scope[D]=[]),O=N.length;return N[O]=I.ref,A.setValue(I,{property:D,itemIndex:O}),A}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($,(A)=>{if(A.value===void 0)throw new Error(`CodeGen: name "${A}" has no value`);return A.value.code},I,U)}_reduceValues($,I,U={},A){let D=e$.nil;for(let w in $){let b=$[w];if(!b)continue;let N=U[w]=U[w]||new Map;b.forEach((O)=>{if(N.has(O))return;N.set(O,NA.Started);let X=I(O);if(X){let W=this.opts.es5?RL.varKinds.var:RL.varKinds.const;D=e$._`${D}${W} ${O} = ${X};${this.opts._n}`}else if(X=A===null||A===void 0?void 0:A(O))D=e$._`${D}${X}${this.opts._n}`;else throw new kL(O);N.set(O,NA.Completed)})}return D}}RL.ValueScope=PL});var a=C((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 w$=QU(),S6=rX(),L4=QU();Object.defineProperty(s$,"_",{enumerable:!0,get:function(){return L4._}});Object.defineProperty(s$,"str",{enumerable:!0,get:function(){return L4.str}});Object.defineProperty(s$,"strConcat",{enumerable:!0,get:function(){return L4.strConcat}});Object.defineProperty(s$,"nil",{enumerable:!0,get:function(){return L4.nil}});Object.defineProperty(s$,"getProperty",{enumerable:!0,get:function(){return L4.getProperty}});Object.defineProperty(s$,"stringify",{enumerable:!0,get:function(){return L4.stringify}});Object.defineProperty(s$,"regexpCode",{enumerable:!0,get:function(){return L4.regexpCode}});Object.defineProperty(s$,"Name",{enumerable:!0,get:function(){return L4.Name}});var YA=rX();Object.defineProperty(s$,"Scope",{enumerable:!0,get:function(){return YA.Scope}});Object.defineProperty(s$,"ValueScope",{enumerable:!0,get:function(){return YA.ValueScope}});Object.defineProperty(s$,"ValueScopeName",{enumerable:!0,get:function(){return YA.ValueScopeName}});Object.defineProperty(s$,"varKinds",{enumerable:!0,get:function(){return YA.varKinds}});s$.operators={GT:new w$._Code(">"),GTE:new w$._Code(">="),LT:new w$._Code("<"),LTE:new w$._Code("<="),EQ:new w$._Code("==="),NEQ:new w$._Code("!=="),NOT:new w$._Code("!"),OR:new w$._Code("||"),AND:new w$._Code("&&"),ADD:new w$._Code("+")};class z4{optimizeNodes(){return this}optimizeNames($,I){return this}}class _L extends z4{constructor($,I,U){super();this.varKind=$,this.name=I,this.rhs=U}render({es5:$,_n:I}){let U=$?S6.varKinds.var:this.varKind,A=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${A};`+I}optimizeNames($,I){if(!$[this.name.str])return;if(this.rhs)this.rhs=RI(this.rhs,$,I);return this}get names(){return this.rhs instanceof w$._CodeOrName?this.rhs.names:{}}}class oX extends z4{constructor($,I,U){super();this.lhs=$,this.rhs=I,this.sideEffects=U}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,I){if(this.lhs instanceof w$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=RI(this.rhs,$,I),this}get names(){let $=this.lhs instanceof w$.Name?{}:{...this.lhs.names};return QA($,this.rhs)}}class CL extends oX{constructor($,I,U,A){super($,U,A);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class ZL extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class gL extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class xL extends z4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class hL extends z4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=RI(this.code,$,I),this}get names(){return this.code instanceof w$._CodeOrName?this.code.names:{}}}class BA extends z4{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((I,U)=>I+U.render($),"")}optimizeNodes(){let{nodes:$}=this,I=$.length;while(I--){let U=$[I].optimizeNodes();if(Array.isArray(U))$.splice(I,1,...U);else if(U)$[I]=U;else $.splice(I,1)}return $.length>0?this:void 0}optimizeNames($,I){let{nodes:U}=this,A=U.length;while(A--){let D=U[A];if(D.optimizeNames($,I))continue;lP($,D.names),U.splice(A,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>p4($,I.names),{})}}class M4 extends BA{render($){return"{"+$._n+super.render($)+"}"+$._n}}class fL extends BA{}class YU extends M4{}YU.kind="else";class e6 extends M4{constructor($,I){super(I);this.condition=$}render($){let I=`if(${this.condition})`+super.render($);if(this.else)I+="else "+this.else.render($);return I}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let I=this.else;if(I){let U=I.optimizeNodes();I=this.else=Array.isArray(U)?new YU(U):U}if(I){if($===!1)return I instanceof e6?I:I.nodes;if(this.nodes.length)return this;return new e6(mL($),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=RI(this.condition,$,I),this}get names(){let $=super.names;if(QA($,this.condition),this.else)p4($,this.else.names);return $}}e6.kind="if";class PI extends M4{}PI.kind="for";class yL extends PI{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=RI(this.iteration,$,I),this}get names(){return p4(super.names,this.iteration.names)}}class uL extends PI{constructor($,I,U,A){super();this.varKind=$,this.name=I,this.from=U,this.to=A}render($){let I=$.es5?S6.varKinds.var:this.varKind,{name:U,from:A,to:D}=this;return`for(${I} ${U}=${A}; ${U}<${D}; ${U}++)`+super.render($)}get names(){let $=QA(super.names,this.from);return QA($,this.to)}}class nX extends PI{constructor($,I,U,A){super();this.loop=$,this.varKind=I,this.name=U,this.iterable=A}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iterable=RI(this.iterable,$,I),this}get names(){return p4(super.names,this.iterable.names)}}class OA extends M4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}OA.kind="func";class XA extends BA{render($){return"return "+super.render($)}}XA.kind="return";class lL extends M4{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,A;return super.optimizeNames($,I),(U=this.catch)===null||U===void 0||U.optimizeNames($,I),(A=this.finally)===null||A===void 0||A.optimizeNames($,I),this}get names(){let $=super.names;if(this.catch)p4($,this.catch.names);if(this.finally)p4($,this.finally.names);return $}}class WA extends M4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}WA.kind="catch";class GA extends M4{render($){return"finally"+super.render($)}}GA.kind="finally";class cL{constructor($,I={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...I,_n:I.lines?`
3
+ `:""},this._extScope=$,this._scope=new S6.Scope({parent:$}),this._nodes=[new fL]}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,A){let D=this._scope.toName(I);if(U!==void 0&&A)this._constants[D.str]=U;return this._leafNode(new _L($,D,U)),D}const($,I,U){return this._def(S6.varKinds.const,$,I,U)}let($,I,U){return this._def(S6.varKinds.let,$,I,U)}var($,I,U){return this._def(S6.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new oX($,I,U))}add($,I){return this._leafNode(new CL($,s$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==w$.nil)this._leafNode(new hL($));return this}object(...$){let I=["{"];for(let[U,A]of $){if(I.length>1)I.push(",");if(I.push(U),U!==A||this.opts.es5)I.push(":"),w$.addCodeArg(I,A)}return I.push("}"),new w$._Code(I)}if($,I,U){if(this._blockNode(new e6($)),I&&U)this.code(I).else().code(U).endIf();else if(I)this.code(I).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new e6($))}else(){return this._elseNode(new YU)}endIf(){return this._endBlockNode(e6,YU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new yL($),I)}forRange($,I,U,A,D=this.opts.es5?S6.varKinds.var:S6.varKinds.let){let w=this._scope.toName($);return this._for(new uL(D,w,I,U),()=>A(w))}forOf($,I,U,A=S6.varKinds.const){let D=this._scope.toName($);if(this.opts.es5){let w=I instanceof w$.Name?I:this.var("_arr",I);return this.forRange("_i",0,w$._`${w}.length`,(b)=>{this.var(D,w$._`${w}[${b}]`),U(D)})}return this._for(new nX("of",A,D,I),()=>U(D))}forIn($,I,U,A=this.opts.es5?S6.varKinds.var:S6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,w$._`Object.keys(${I})`,U);let D=this._scope.toName($);return this._for(new nX("in",A,D,I),()=>U(D))}endFor(){return this._endBlockNode(PI)}label($){return this._leafNode(new ZL($))}break($){return this._leafNode(new gL($))}return($){let I=new XA;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(XA)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let A=new lL;if(this._blockNode(A),this.code($),I){let D=this.name("e");this._currNode=A.catch=new WA(D),I(D)}if(U)this._currNode=A.finally=new GA,this.code(U);return this._endBlockNode(WA,GA)}throw($){return this._leafNode(new xL($))}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=w$.nil,U,A){if(this._blockNode(new OA($,I,U)),A)this.code(A).endFunc();return this}endFunc(){return this._endBlockNode(OA)}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=cL;function p4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function QA($,I){return I instanceof w$._CodeOrName?p4($,I.names):$}function RI($,I,U){if($ instanceof w$.Name)return A($);if(!D($))return $;return new w$._Code($._items.reduce((w,b)=>{if(b instanceof w$.Name)b=A(b);if(b instanceof w$._Code)w.push(...b._items);else w.push(b);return w},[]));function A(w){let b=U[w.str];if(b===void 0||I[w.str]!==1)return w;return delete I[w.str],b}function D(w){return w instanceof w$._Code&&w._items.some((b)=>b instanceof w$.Name&&I[b.str]===1&&U[b.str]!==void 0)}}function lP($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function mL($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:w$._`!${iX($)}`}s$.not=mL;var cP=rL(s$.operators.AND);function mP(...$){return $.reduce(cP)}s$.and=mP;var rP=rL(s$.operators.OR);function nP(...$){return $.reduce(rP)}s$.or=nP;function rL($){return(I,U)=>I===w$.nil?U:U===w$.nil?I:w$._`${iX(I)} ${$} ${iX(U)}`}function iX($){return $ instanceof w$.Name?$:w$._`(${$})`}});var N$=C((sL)=>{Object.defineProperty(sL,"__esModule",{value:!0});sL.checkStrictMode=sL.getErrorPath=sL.Type=sL.useFunc=sL.setEvaluated=sL.evaluatedPropsToName=sL.mergeEvaluated=sL.eachItem=sL.unescapeJsonPointer=sL.escapeJsonPointer=sL.escapeFragment=sL.unescapeFragment=sL.schemaRefOrVal=sL.schemaHasRulesButRef=sL.schemaHasRules=sL.checkUnknownRules=sL.alwaysValidSchema=sL.toHash=void 0;var B$=a(),pP=QU();function tP($){let I={};for(let U of $)I[U]=!0;return I}sL.toHash=tP;function aP($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return dL($,I),!pL(I,$.self.RULES.all)}sL.alwaysValidSchema=aP;function dL($,I=$.schema){let{opts:U,self:A}=$;if(!U.strictSchema)return;if(typeof I==="boolean")return;let D=A.RULES.keywords;for(let w in I)if(!D[w])eL($,`unknown keyword: "${w}"`)}sL.checkUnknownRules=dL;function pL($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}sL.schemaHasRules=pL;function eP($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}sL.schemaHasRulesButRef=eP;function sP({topSchemaRef:$,schemaPath:I},U,A,D){if(!D){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return B$._`${U}`}return B$._`${$}${I}${B$.getProperty(A)}`}sL.schemaRefOrVal=sP;function $R($){return tL(decodeURIComponent($))}sL.unescapeFragment=$R;function IR($){return encodeURIComponent(pX($))}sL.escapeFragment=IR;function pX($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}sL.escapeJsonPointer=pX;function tL($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}sL.unescapeJsonPointer=tL;function UR($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}sL.eachItem=UR;function iL({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:A}){return(D,w,b,N)=>{let O=b===void 0?w:b instanceof B$.Name?(w instanceof B$.Name?$(D,w,b):I(D,w,b),b):w instanceof B$.Name?(I(D,b,w),w):U(w,b);return N===B$.Name&&!(O instanceof B$.Name)?A(D,O):O}}sL.mergeEvaluated={props:iL({mergeNames:($,I,U)=>$.if(B$._`${U} !== true && ${I} !== undefined`,()=>{$.if(B$._`${I} === true`,()=>$.assign(U,!0),()=>$.assign(U,B$._`${U} || {}`).code(B$._`Object.assign(${U}, ${I})`))}),mergeToName:($,I,U)=>$.if(B$._`${U} !== true`,()=>{if(I===!0)$.assign(U,!0);else $.assign(U,B$._`${U} || {}`),tX($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:aL}),items:iL({mergeNames:($,I,U)=>$.if(B$._`${U} !== true && ${I} !== undefined`,()=>$.assign(U,B$._`${I} === true ? true : ${U} > ${I} ? ${U} : ${I}`)),mergeToName:($,I,U)=>$.if(B$._`${U} !== true`,()=>$.assign(U,I===!0?!0:B$._`${U} > ${I} ? ${U} : ${I}`)),mergeValues:($,I)=>$===!0?!0:Math.max($,I),resultToName:($,I)=>$.var("items",I)})};function aL($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",B$._`{}`);if(I!==void 0)tX($,U,I);return U}sL.evaluatedPropsToName=aL;function tX($,I,U){Object.keys(U).forEach((A)=>$.assign(B$._`${I}${B$.getProperty(A)}`,!0))}sL.setEvaluated=tX;var oL={};function DR($,I){return $.scopeValue("func",{ref:I,code:oL[I.code]||(oL[I.code]=new pP._Code(I.code))})}sL.useFunc=DR;var dX;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(dX||(sL.Type=dX={}));function AR($,I,U){if($ instanceof B$.Name){let A=I===dX.Num;return U?A?B$._`"[" + ${$} + "]"`:B$._`"['" + ${$} + "']"`:A?B$._`"/" + ${$}`:B$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?B$.getProperty($).toString():"/"+pX($)}sL.getErrorPath=AR;function eL($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}sL.checkStrictMode=eL});var s6=C((Iz)=>{Object.defineProperty(Iz,"__esModule",{value:!0});var y$=a(),VR={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")};Iz.default=VR});var BU=C((wz)=>{Object.defineProperty(wz,"__esModule",{value:!0});wz.extendErrors=wz.resetErrorsCount=wz.reportExtraError=wz.reportError=wz.keyword$DataError=wz.keywordError=void 0;var b$=a(),HA=N$(),n$=s6();wz.keywordError={message:({keyword:$})=>b$.str`must pass "${$}" keyword validation`};wz.keyword$DataError={message:({keyword:$,schemaType:I})=>I?b$.str`"${$}" keyword must be ${I} ($data)`:b$.str`"${$}" keyword is invalid ($data)`};function FR($,I=wz.keywordError,U,A){let{it:D}=$,{gen:w,compositeRule:b,allErrors:N}=D,O=Az($,I,U);if(A!==null&&A!==void 0?A:b||N)Uz(w,O);else Dz(D,b$._`[${O}]`)}wz.reportError=FR;function ER($,I=wz.keywordError,U){let{it:A}=$,{gen:D,compositeRule:w,allErrors:b}=A,N=Az($,I,U);if(Uz(D,N),!(w||b))Dz(A,n$.default.vErrors)}wz.reportExtraError=ER;function SR($,I){$.assign(n$.default.errors,I),$.if(b$._`${n$.default.vErrors} !== null`,()=>$.if(I,()=>$.assign(b$._`${n$.default.vErrors}.length`,I),()=>$.assign(n$.default.vErrors,null)))}wz.resetErrorsCount=SR;function jR({gen:$,keyword:I,schemaValue:U,data:A,errsCount:D,it:w}){if(D===void 0)throw new Error("ajv implementation error");let b=$.name("err");$.forRange("i",D,n$.default.errors,(N)=>{if($.const(b,b$._`${n$.default.vErrors}[${N}]`),$.if(b$._`${b}.instancePath === undefined`,()=>$.assign(b$._`${b}.instancePath`,b$.strConcat(n$.default.instancePath,w.errorPath))),$.assign(b$._`${b}.schemaPath`,b$.str`${w.errSchemaPath}/${I}`),w.opts.verbose)$.assign(b$._`${b}.schema`,U),$.assign(b$._`${b}.data`,A)})}wz.extendErrors=jR;function Uz($,I){let U=$.const("err",I);$.if(b$._`${n$.default.vErrors} === null`,()=>$.assign(n$.default.vErrors,b$._`[${U}]`),b$._`${n$.default.vErrors}.push(${U})`),$.code(b$._`${n$.default.errors}++`)}function Dz($,I){let{gen:U,validateName:A,schemaEnv:D}=$;if(D.$async)U.throw(b$._`new ${$.ValidationError}(${I})`);else U.assign(b$._`${A}.errors`,I),U.return(!1)}var t4={keyword:new b$.Name("keyword"),schemaPath:new b$.Name("schemaPath"),params:new b$.Name("params"),propertyName:new b$.Name("propertyName"),message:new b$.Name("message"),schema:new b$.Name("schema"),parentSchema:new b$.Name("parentSchema")};function Az($,I,U){let{createErrors:A}=$.it;if(A===!1)return b$._`{}`;return kR($,I,U)}function kR($,I,U={}){let{gen:A,it:D}=$,w=[PR(D,U),RR($,U)];return TR($,I,w),A.object(...w)}function PR({errorPath:$},{instancePath:I}){let U=I?b$.str`${$}${HA.getErrorPath(I,HA.Type.Str)}`:$;return[n$.default.instancePath,b$.strConcat(n$.default.instancePath,U)]}function RR({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:A}){let D=A?I:b$.str`${I}/${$}`;if(U)D=b$.str`${D}${HA.getErrorPath(U,HA.Type.Str)}`;return[t4.schemaPath,D]}function TR($,{params:I,message:U},A){let{keyword:D,data:w,schemaValue:b,it:N}=$,{opts:O,propertyName:X,topSchemaRef:W,schemaPath:Q}=N;if(A.push([t4.keyword,D],[t4.params,typeof I=="function"?I($):I||b$._`{}`]),O.messages)A.push([t4.message,typeof U=="function"?U($):U]);if(O.verbose)A.push([t4.schema,b],[t4.parentSchema,b$._`${W}${Q}`],[n$.default.data,w]);if(X)A.push([t4.propertyName,X])}});var Wz=C((Oz)=>{Object.defineProperty(Oz,"__esModule",{value:!0});Oz.boolOrEmptySchema=Oz.topBoolOrEmptySchema=void 0;var xR=BU(),hR=a(),fR=s6(),yR={message:"boolean schema is false"};function uR($){let{gen:I,schema:U,validateName:A}=$;if(U===!1)Nz($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(fR.default.data);else I.assign(hR._`${A}.errors`,null),I.return(!0)}Oz.topBoolOrEmptySchema=uR;function lR($,I){let{gen:U,schema:A}=$;if(A===!1)U.var(I,!1),Nz($);else U.var(I,!0)}Oz.boolOrEmptySchema=lR;function Nz($,I){let{gen:U,data:A}=$,D={gen:U,keyword:"false schema",data:A,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};xR.reportError(D,yR,void 0,I)}});var eX=C((Gz)=>{Object.defineProperty(Gz,"__esModule",{value:!0});Gz.getRules=Gz.isJSONType=void 0;var mR=["string","number","integer","boolean","null","object","array"],rR=new Set(mR);function nR($){return typeof $=="string"&&rR.has($)}Gz.isJSONType=nR;function iR(){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:{}}}Gz.getRules=iR});var sX=C((Jz)=>{Object.defineProperty(Jz,"__esModule",{value:!0});Jz.shouldUseRule=Jz.shouldUseGroup=Jz.schemaHasRulesForType=void 0;function dR({schema:$,self:I},U){let A=I.RULES.types[U];return A&&A!==!0&&Yz($,A)}Jz.schemaHasRulesForType=dR;function Yz($,I){return I.rules.some((U)=>Bz($,U))}Jz.shouldUseGroup=Yz;function Bz($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((A)=>$[A]!==void 0))}Jz.shouldUseRule=Bz});var JU=C((Kz)=>{Object.defineProperty(Kz,"__esModule",{value:!0});Kz.reportTypeError=Kz.checkDataTypes=Kz.checkDataType=Kz.coerceAndCheckDataType=Kz.getJSONTypes=Kz.getSchemaTypes=Kz.DataType=void 0;var aR=eX(),eR=sX(),sR=BU(),p=a(),Lz=N$(),TI;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(TI||(Kz.DataType=TI={}));function $2($){let I=zz($.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}Kz.getSchemaTypes=$2;function zz($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(aR.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}Kz.getJSONTypes=zz;function I2($,I){let{gen:U,data:A,opts:D}=$,w=U2(I,D.coerceTypes),b=I.length>0&&!(w.length===0&&I.length===1&&eR.schemaHasRulesForType($,I[0]));if(b){let N=IW(I,A,D.strictNumbers,TI.Wrong);U.if(N,()=>{if(w.length)D2($,I,w);else UW($)})}return b}Kz.coerceAndCheckDataType=I2;var Mz=new Set(["string","number","integer","boolean","null"]);function U2($,I){return I?$.filter((U)=>Mz.has(U)||I==="array"&&U==="array"):[]}function D2($,I,U){let{gen:A,data:D,opts:w}=$,b=A.let("dataType",p._`typeof ${D}`),N=A.let("coerced",p._`undefined`);if(w.coerceTypes==="array")A.if(p._`${b} == 'object' && Array.isArray(${D}) && ${D}.length == 1`,()=>A.assign(D,p._`${D}[0]`).assign(b,p._`typeof ${D}`).if(IW(I,D,w.strictNumbers),()=>A.assign(N,D)));A.if(p._`${N} !== undefined`);for(let X of U)if(Mz.has(X)||X==="array"&&w.coerceTypes==="array")O(X);A.else(),UW($),A.endIf(),A.if(p._`${N} !== undefined`,()=>{A.assign(D,N),A2($,N)});function O(X){switch(X){case"string":A.elseIf(p._`${b} == "number" || ${b} == "boolean"`).assign(N,p._`"" + ${D}`).elseIf(p._`${D} === null`).assign(N,p._`""`);return;case"number":A.elseIf(p._`${b} == "boolean" || ${D} === null
4
+ || (${b} == "string" && ${D} && ${D} == +${D})`).assign(N,p._`+${D}`);return;case"integer":A.elseIf(p._`${b} === "boolean" || ${D} === null
5
+ || (${b} === "string" && ${D} && ${D} == +${D} && !(${D} % 1))`).assign(N,p._`+${D}`);return;case"boolean":A.elseIf(p._`${D} === "false" || ${D} === 0 || ${D} === null`).assign(N,!1).elseIf(p._`${D} === "true" || ${D} === 1`).assign(N,!0);return;case"null":A.elseIf(p._`${D} === "" || ${D} === 0 || ${D} === false`),A.assign(N,null);return;case"array":A.elseIf(p._`${b} === "string" || ${b} === "number"
6
+ || ${b} === "boolean" || ${D} === null`).assign(N,p._`[${D}]`)}}}function A2({gen:$,parentData:I,parentDataProperty:U},A){$.if(p._`${I} !== undefined`,()=>$.assign(p._`${I}[${U}]`,A))}function $W($,I,U,A=TI.Correct){let D=A===TI.Correct?p.operators.EQ:p.operators.NEQ,w;switch($){case"null":return p._`${I} ${D} null`;case"array":w=p._`Array.isArray(${I})`;break;case"object":w=p._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":w=b(p._`!(${I} % 1) && !isNaN(${I})`);break;case"number":w=b();break;default:return p._`typeof ${I} ${D} ${$}`}return A===TI.Correct?w:p.not(w);function b(N=p.nil){return p.and(p._`typeof ${I} == "number"`,N,U?p._`isFinite(${I})`:p.nil)}}Kz.checkDataType=$W;function IW($,I,U,A){if($.length===1)return $W($[0],I,U,A);let D,w=Lz.toHash($);if(w.array&&w.object){let b=p._`typeof ${I} != "object"`;D=w.null?b:p._`!${I} || ${b}`,delete w.null,delete w.array,delete w.object}else D=p.nil;if(w.number)delete w.integer;for(let b in w)D=p.and(D,$W(b,I,U,A));return D}Kz.checkDataTypes=IW;var w2={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?p._`{type: ${$}}`:p._`{type: ${I}}`};function UW($){let I=b2($);sR.reportError(I,w2)}Kz.reportTypeError=UW;function b2($){let{gen:I,data:U,schema:A}=$,D=Lz.schemaRefOrVal($,A,"type");return{gen:I,keyword:"type",data:U,schema:A.type,schemaCode:D,schemaValue:D,parentSchema:A,params:{},it:$}}});var Ez=C((qz)=>{Object.defineProperty(qz,"__esModule",{value:!0});qz.assignDefaults=void 0;var _I=a(),Y2=N$();function B2($,I){let{properties:U,items:A}=$.schema;if(I==="object"&&U)for(let D in U)Vz($,D,U[D].default);else if(I==="array"&&Array.isArray(A))A.forEach((D,w)=>Vz($,w,D.default))}qz.assignDefaults=B2;function Vz($,I,U){let{gen:A,compositeRule:D,data:w,opts:b}=$;if(U===void 0)return;let N=_I._`${w}${_I.getProperty(I)}`;if(D){Y2.checkStrictMode($,`default is ignored for: ${N}`);return}let O=_I._`${N} === undefined`;if(b.useDefaults==="empty")O=_I._`${O} || ${N} === null || ${N} === ""`;A.if(O,_I._`${N} = ${_I.stringify(U)}`)}});var H6=C((kz)=>{Object.defineProperty(kz,"__esModule",{value:!0});kz.validateUnion=kz.validateArray=kz.usePattern=kz.callValidateCode=kz.schemaProperties=kz.allSchemaProperties=kz.noPropertyInData=kz.propertyInData=kz.isOwnProperty=kz.hasPropFunc=kz.reportMissingProp=kz.checkMissingProp=kz.checkReportMissingProp=void 0;var M$=a(),DW=N$(),K4=s6(),J2=N$();function H2($,I){let{gen:U,data:A,it:D}=$;U.if(wW(U,A,I,D.opts.ownProperties),()=>{$.setParams({missingProperty:M$._`${I}`},!0),$.error()})}kz.checkReportMissingProp=H2;function L2({gen:$,data:I,it:{opts:U}},A,D){return M$.or(...A.map((w)=>M$.and(wW($,I,w,U.ownProperties),M$._`${D} = ${w}`)))}kz.checkMissingProp=L2;function z2($,I){$.setParams({missingProperty:I},!0),$.error()}kz.reportMissingProp=z2;function Sz($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:M$._`Object.prototype.hasOwnProperty`})}kz.hasPropFunc=Sz;function AW($,I,U){return M$._`${Sz($)}.call(${I}, ${U})`}kz.isOwnProperty=AW;function M2($,I,U,A){let D=M$._`${I}${M$.getProperty(U)} !== undefined`;return A?M$._`${D} && ${AW($,I,U)}`:D}kz.propertyInData=M2;function wW($,I,U,A){let D=M$._`${I}${M$.getProperty(U)} === undefined`;return A?M$.or(D,M$.not(AW($,I,U))):D}kz.noPropertyInData=wW;function jz($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}kz.allSchemaProperties=jz;function K2($,I){return jz(I).filter((U)=>!DW.alwaysValidSchema($,I[U]))}kz.schemaProperties=K2;function v2({schemaCode:$,data:I,it:{gen:U,topSchemaRef:A,schemaPath:D,errorPath:w},it:b},N,O,X){let W=X?M$._`${$}, ${I}, ${A}${D}`:I,Q=[[K4.default.instancePath,M$.strConcat(K4.default.instancePath,w)],[K4.default.parentData,b.parentData],[K4.default.parentDataProperty,b.parentDataProperty],[K4.default.rootData,K4.default.rootData]];if(b.opts.dynamicRef)Q.push([K4.default.dynamicAnchors,K4.default.dynamicAnchors]);let B=M$._`${W}, ${U.object(...Q)}`;return O!==M$.nil?M$._`${N}.call(${O}, ${B})`:M$._`${N}(${B})`}kz.callValidateCode=v2;var V2=M$._`new RegExp`;function q2({gen:$,it:{opts:I}},U){let A=I.unicodeRegExp?"u":"",{regExp:D}=I.code,w=D(U,A);return $.scopeValue("pattern",{key:w.toString(),ref:w,code:M$._`${D.code==="new RegExp"?V2:J2.useFunc($,D)}(${U}, ${A})`})}kz.usePattern=q2;function F2($){let{gen:I,data:U,keyword:A,it:D}=$,w=I.name("valid");if(D.allErrors){let N=I.let("valid",!0);return b(()=>I.assign(N,!1)),N}return I.var(w,!0),b(()=>I.break()),w;function b(N){let O=I.const("len",M$._`${U}.length`);I.forRange("i",0,O,(X)=>{$.subschema({keyword:A,dataProp:X,dataPropType:DW.Type.Num},w),I.if(M$.not(w),N)})}}kz.validateArray=F2;function E2($){let{gen:I,schema:U,keyword:A,it:D}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((O)=>DW.alwaysValidSchema(D,O))&&!D.opts.unevaluated)return;let b=I.let("valid",!1),N=I.name("_valid");I.block(()=>U.forEach((O,X)=>{let W=$.subschema({keyword:A,schemaProp:X,compositeRule:!0},N);if(I.assign(b,M$._`${b} || ${N}`),!$.mergeValidEvaluated(W,N))I.if(M$.not(b))})),$.result(b,()=>$.reset(),()=>$.error(!0))}kz.validateUnion=E2});var Zz=C((_z)=>{Object.defineProperty(_z,"__esModule",{value:!0});_z.validateKeywordUsage=_z.validSchemaType=_z.funcKeywordCode=_z.macroKeywordCode=void 0;var i$=a(),a4=s6(),f2=H6(),y2=BU();function u2($,I){let{gen:U,keyword:A,schema:D,parentSchema:w,it:b}=$,N=I.macro.call(b.self,D,w,b),O=Tz(U,A,N);if(b.opts.validateSchema!==!1)b.self.validateSchema(N,!0);let X=U.name("valid");$.subschema({schema:N,schemaPath:i$.nil,errSchemaPath:`${b.errSchemaPath}/${A}`,topSchemaRef:O,compositeRule:!0},X),$.pass(X,()=>$.error(!0))}_z.macroKeywordCode=u2;function l2($,I){var U;let{gen:A,keyword:D,schema:w,parentSchema:b,$data:N,it:O}=$;m2(O,I);let X=!N&&I.compile?I.compile.call(O.self,w,b,O):I.validate,W=Tz(A,D,X),Q=A.let("valid");$.block$data(Q,B),$.ok((U=I.valid)!==null&&U!==void 0?U:Q);function B(){if(I.errors===!1){if(H(),I.modifying)Rz($);v(()=>$.error())}else{let V=I.async?Y():J();if(I.modifying)Rz($);v(()=>c2($,V))}}function Y(){let V=A.let("ruleErrs",null);return A.try(()=>H(i$._`await `),(P)=>A.assign(Q,!1).if(i$._`${P} instanceof ${O.ValidationError}`,()=>A.assign(V,i$._`${P}.errors`),()=>A.throw(P))),V}function J(){let V=i$._`${W}.errors`;return A.assign(V,null),H(i$.nil),V}function H(V=I.async?i$._`await `:i$.nil){let P=O.opts.passContext?a4.default.this:a4.default.self,k=!(("compile"in I)&&!N||I.schema===!1);A.assign(Q,i$._`${V}${f2.callValidateCode($,W,P,k)}`,I.modifying)}function v(V){var P;A.if(i$.not((P=I.valid)!==null&&P!==void 0?P:Q),V)}}_z.funcKeywordCode=l2;function Rz($){let{gen:I,data:U,it:A}=$;I.if(A.parentData,()=>I.assign(U,i$._`${A.parentData}[${A.parentDataProperty}]`))}function c2($,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`),y2.extendErrors($)},()=>$.error())}function m2({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function Tz($,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 r2($,I,U=!1){return!I.length||I.some((A)=>A==="array"?Array.isArray($):A==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==A||U&&typeof $=="undefined")}_z.validSchemaType=r2;function n2({schema:$,opts:I,self:U,errSchemaPath:A},D,w){if(Array.isArray(D.keyword)?!D.keyword.includes(w):D.keyword!==w)throw new Error("ajv implementation error");let b=D.dependencies;if(b===null||b===void 0?void 0:b.some((N)=>!Object.prototype.hasOwnProperty.call($,N)))throw new Error(`parent schema must have dependencies of ${w}: ${b.join(",")}`);if(D.validateSchema){if(!D.validateSchema($[w])){let O=`keyword "${w}" value is invalid at path "${A}": `+U.errorsText(D.validateSchema.errors);if(I.validateSchema==="log")U.logger.error(O);else throw new Error(O)}}}_z.validateKeywordUsage=n2});var fz=C((xz)=>{Object.defineProperty(xz,"__esModule",{value:!0});xz.extendSubschemaMode=xz.extendSubschemaData=xz.getSubschema=void 0;var h6=a(),gz=N$();function p2($,{keyword:I,schemaProp:U,schema:A,schemaPath:D,errSchemaPath:w,topSchemaRef:b}){if(I!==void 0&&A!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(I!==void 0){let N=$.schema[I];return U===void 0?{schema:N,schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:N[U],schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}${h6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${gz.escapeFragment(U)}`}}if(A!==void 0){if(D===void 0||w===void 0||b===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:A,schemaPath:D,topSchemaRef:b,errSchemaPath:w}}throw new Error('either "keyword" or "schema" must be passed')}xz.getSubschema=p2;function t2($,I,{dataProp:U,dataPropType:A,data:D,dataTypes:w,propertyName:b}){if(D!==void 0&&U!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:N}=I;if(U!==void 0){let{errorPath:X,dataPathArr:W,opts:Q}=I,B=N.let("data",h6._`${I.data}${h6.getProperty(U)}`,!0);O(B),$.errorPath=h6.str`${X}${gz.getErrorPath(U,A,Q.jsPropertySyntax)}`,$.parentDataProperty=h6._`${U}`,$.dataPathArr=[...W,$.parentDataProperty]}if(D!==void 0){let X=D instanceof h6.Name?D:N.let("data",D,!0);if(O(X),b!==void 0)$.propertyName=b}if(w)$.dataTypes=w;function O(X){$.data=X,$.dataLevel=I.dataLevel+1,$.dataTypes=[],I.definedProperties=new Set,$.parentData=I.data,$.dataNames=[...I.dataNames,X]}}xz.extendSubschemaData=t2;function a2($,{jtdDiscriminator:I,jtdMetadata:U,compositeRule:A,createErrors:D,allErrors:w}){if(A!==void 0)$.compositeRule=A;if(D!==void 0)$.createErrors=D;if(w!==void 0)$.allErrors=w;$.jtdDiscriminator=I,$.jtdMetadata=U}xz.extendSubschemaMode=a2});var bW=C(($o,yz)=>{yz.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 A,D,w;if(Array.isArray(I)){if(A=I.length,A!=U.length)return!1;for(D=A;D--!==0;)if(!$(I[D],U[D]))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(w=Object.keys(I),A=w.length,A!==Object.keys(U).length)return!1;for(D=A;D--!==0;)if(!Object.prototype.hasOwnProperty.call(U,w[D]))return!1;for(D=A;D--!==0;){var b=w[D];if(!$(I[b],U[b]))return!1}return!0}return I!==I&&U!==U}});var lz=C((Io,uz)=>{var v4=uz.exports=function($,I,U){if(typeof I=="function")U=I,I={};U=I.cb||U;var A=typeof U=="function"?U:U.pre||function(){},D=U.post||function(){};LA(I,A,D,$,"",$)};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 LA($,I,U,A,D,w,b,N,O,X){if(A&&typeof A=="object"&&!Array.isArray(A)){I(A,D,w,b,N,O,X);for(var W in A){var Q=A[W];if(Array.isArray(Q)){if(W in v4.arrayKeywords)for(var B=0;B<Q.length;B++)LA($,I,U,Q[B],D+"/"+W+"/"+B,w,D,W,A,B)}else if(W in v4.propsKeywords){if(Q&&typeof Q=="object")for(var Y in Q)LA($,I,U,Q[Y],D+"/"+W+"/"+$T(Y),w,D,W,A,Y)}else if(W in v4.keywords||$.allKeys&&!(W in v4.skipKeywords))LA($,I,U,Q,D+"/"+W,w,D,W,A)}U(A,D,w,b,N,O,X)}}function $T($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var HU=C((nz)=>{Object.defineProperty(nz,"__esModule",{value:!0});nz.getSchemaRefs=nz.resolveUrl=nz.normalizeId=nz._getFullPath=nz.getFullPath=nz.inlineRef=void 0;var IT=N$(),UT=bW(),DT=lz(),AT=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function wT($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!NW($);if(!I)return!1;return cz($)<=I}nz.inlineRef=wT;var bT=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function NW($){for(let I in $){if(bT.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(NW))return!0;if(typeof U=="object"&&NW(U))return!0}return!1}function cz($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,AT.has(U))continue;if(typeof $[U]=="object")IT.eachItem($[U],(A)=>I+=cz(A));if(I===1/0)return 1/0}return I}function mz($,I="",U){if(U!==!1)I=CI(I);let A=$.parse(I);return rz($,A)}nz.getFullPath=mz;function rz($,I){return $.serialize(I).split("#")[0]+"#"}nz._getFullPath=rz;var NT=/#\/?$/;function CI($){return $?$.replace(NT,""):""}nz.normalizeId=CI;function OT($,I,U){return U=CI(U),$.resolve(I,U)}nz.resolveUrl=OT;var XT=/^[a-z_][-a-z0-9._]*$/i;function WT($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:A}=this.opts,D=CI($[U]||I),w={"":D},b=mz(A,D,!1),N={},O=new Set;return DT($,{allKeys:!0},(Q,B,Y,J)=>{if(J===void 0)return;let H=b+B,v=w[J];if(typeof Q[U]=="string")v=V.call(this,Q[U]);P.call(this,Q.$anchor),P.call(this,Q.$dynamicAnchor),w[B]=v;function V(k){let h=this.opts.uriResolver.resolve;if(k=CI(v?h(v,k):k),O.has(k))throw W(k);O.add(k);let l=this.refs[k];if(typeof l=="string")l=this.refs[l];if(typeof l=="object")X(Q,l.schema,k);else if(k!==CI(H))if(k[0]==="#")X(Q,N[k],k),N[k]=Q;else this.refs[k]=H;return k}function P(k){if(typeof k=="string"){if(!XT.test(k))throw new Error(`invalid anchor "${k}"`);V.call(this,`#${k}`)}}}),N;function X(Q,B,Y){if(B!==void 0&&!UT(Q,B))throw W(Y)}function W(Q){return new Error(`reference "${Q}" resolves to more than one schema`)}}nz.getSchemaRefs=WT});var MU=C((N3)=>{Object.defineProperty(N3,"__esModule",{value:!0});N3.getData=N3.KeywordCxt=N3.validateFunctionCode=void 0;var az=Wz(),oz=JU(),XW=sX(),zA=JU(),HT=Ez(),zU=Zz(),OW=fz(),u=a(),i=s6(),LT=HU(),$4=N$(),LU=BU();function zT($){if($3($)){if(I3($),sz($)){vT($);return}}ez($,()=>az.topBoolOrEmptySchema($))}N3.validateFunctionCode=zT;function ez({gen:$,validateName:I,schema:U,schemaEnv:A,opts:D},w){if(D.code.es5)$.func(I,u._`${i.default.data}, ${i.default.valCxt}`,A.$async,()=>{$.code(u._`"use strict"; ${dz(U,D)}`),KT($,D),$.code(w)});else $.func(I,u._`${i.default.data}, ${MT(D)}`,A.$async,()=>$.code(dz(U,D)).code(w))}function MT($){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 KT($,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:A}=$;ez($,()=>{if(U.$comment&&I.$comment)D3($);if(ST($),A.let(i.default.vErrors,null),A.let(i.default.errors,0),U.unevaluated)VT($);U3($),PT($)});return}function VT($){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 dz($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?u._`/*# sourceURL=${U} */`:u.nil}function qT($,I){if($3($)){if(I3($),sz($)){FT($,I);return}}az.boolOrEmptySchema($,I)}function sz({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function $3($){return typeof $.schema!="boolean"}function FT($,I){let{schema:U,gen:A,opts:D}=$;if(D.$comment&&U.$comment)D3($);jT($),kT($);let w=A.const("_errs",i.default.errors);U3($,w),A.var(I,u._`${w} === ${i.default.errors}`)}function I3($){$4.checkUnknownRules($),ET($)}function U3($,I){if($.opts.jtd)return pz($,[],!1,I);let U=oz.getSchemaTypes($.schema),A=oz.coerceAndCheckDataType($,U);pz($,U,!A,I)}function ET($){let{schema:I,errSchemaPath:U,opts:A,self:D}=$;if(I.$ref&&A.ignoreKeywordsWithRef&&$4.schemaHasRulesButRef(I,D.RULES))D.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 jT($){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 D3({gen:$,schemaEnv:I,schema:U,errSchemaPath:A,opts:D}){let w=U.$comment;if(D.$comment===!0)$.code(u._`${i.default.self}.logger.log(${w})`);else if(typeof D.$comment=="function"){let b=u.str`${A}/$comment`,N=$.scopeValue("root",{ref:I.root});$.code(u._`${i.default.self}.opts.$comment(${w}, ${b}, ${N}.schema)`)}}function PT($){let{gen:I,schemaEnv:U,validateName:A,ValidationError:D,opts:w}=$;if(U.$async)I.if(u._`${i.default.errors} === 0`,()=>I.return(i.default.data),()=>I.throw(u._`new ${D}(${i.default.vErrors})`));else{if(I.assign(u._`${A}.errors`,i.default.vErrors),w.unevaluated)RT($);I.return(u._`${i.default.errors} === 0`)}}function RT({gen:$,evaluated:I,props:U,items:A}){if(U instanceof u.Name)$.assign(u._`${I}.props`,U);if(A instanceof u.Name)$.assign(u._`${I}.items`,A)}function pz($,I,U,A){let{gen:D,schema:w,data:b,allErrors:N,opts:O,self:X}=$,{RULES:W}=X;if(w.$ref&&(O.ignoreKeywordsWithRef||!$4.schemaHasRulesButRef(w,W))){D.block(()=>w3($,"$ref",W.all.$ref.definition));return}if(!O.jtd)TT($,I);D.block(()=>{for(let B of W.rules)Q(B);Q(W.post)});function Q(B){if(!XW.shouldUseGroup(w,B))return;if(B.type){if(D.if(zA.checkDataType(B.type,b,O.strictNumbers)),tz($,B),I.length===1&&I[0]===B.type&&U)D.else(),zA.reportTypeError($);D.endIf()}else tz($,B);if(!N)D.if(u._`${i.default.errors} === ${A||0}`)}}function tz($,I){let{gen:U,schema:A,opts:{useDefaults:D}}=$;if(D)HT.assignDefaults($,I.type);U.block(()=>{for(let w of I.rules)if(XW.shouldUseRule(A,w))w3($,w.keyword,w.definition,I.type)})}function TT($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(_T($,I),!$.opts.allowUnionTypes)CT($,I);ZT($,$.dataTypes)}function _T($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!A3($.dataTypes,U))WW($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),xT($,I)}function CT($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))WW($,"use allowUnionTypes to allow union type keyword")}function ZT($,I){let U=$.self.RULES.all;for(let A in U){let D=U[A];if(typeof D=="object"&&XW.shouldUseRule($.schema,D)){let{type:w}=D.definition;if(w.length&&!w.some((b)=>gT(I,b)))WW($,`missing type "${w.join(",")}" for keyword "${A}"`)}}}function gT($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function A3($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function xT($,I){let U=[];for(let A of $.dataTypes)if(A3(I,A))U.push(A);else if(I.includes("integer")&&A==="number")U.push("integer");$.dataTypes=U}function WW($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,$4.checkStrictMode($,I,$.opts.strictTypes)}class GW{constructor($,I,U){if(zU.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",b3(this.$data,$));else if(this.schemaCode=this.schemaValue,!zU.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){($?LU.reportExtraError:LU.reportError)(this,this.def.error,I)}$dataError(){LU.reportError(this,this.def.$dataError||LU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');LU.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:A,schemaType:D,def:w}=this;if(U.if(u.or(u._`${A} === undefined`,I)),$!==u.nil)U.assign($,!0);if(D.length||w.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:A,it:D}=this;return u.or(w(),b());function w(){if(U.length){if(!(I instanceof u.Name))throw new Error("ajv implementation error");let N=Array.isArray(U)?U:[U];return u._`${zA.checkDataTypes(N,I,D.opts.strictNumbers,zA.DataType.Wrong)}`}return u.nil}function b(){if(A.validateSchema){let N=$.scopeValue("validate$data",{ref:A.validateSchema});return u._`!${N}(${I})`}return u.nil}}subschema($,I){let U=OW.getSubschema(this.it,$);OW.extendSubschemaData(U,this.it,$),OW.extendSubschemaMode(U,$);let A={...this.it,...U,items:void 0,props:void 0};return qT(A,I),A}mergeEvaluated($,I){let{it:U,gen:A}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&$.props!==void 0)U.props=$4.mergeEvaluated.props(A,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=$4.mergeEvaluated.items(A,$.items,U.items,I)}mergeValidEvaluated($,I){let{it:U,gen:A}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return A.if(I,()=>this.mergeEvaluated($,u.Name)),!0}}N3.KeywordCxt=GW;function w3($,I,U,A){let D=new GW($,U,I);if("code"in U)U.code(D,A);else if(D.$data&&U.validate)zU.funcKeywordCode(D,U);else if("macro"in U)zU.macroKeywordCode(D,U);else if(U.compile||U.validate)zU.funcKeywordCode(D,U)}var hT=/^\/(?:[^~]|~0|~1)*$/,fT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function b3($,{dataLevel:I,dataNames:U,dataPathArr:A}){let D,w;if($==="")return i.default.rootData;if($[0]==="/"){if(!hT.test($))throw new Error(`Invalid JSON-pointer: ${$}`);D=$,w=i.default.rootData}else{let X=fT.exec($);if(!X)throw new Error(`Invalid JSON-pointer: ${$}`);let W=+X[1];if(D=X[2],D==="#"){if(W>=I)throw new Error(O("property/index",W));return A[I-W]}if(W>I)throw new Error(O("data",W));if(w=U[I-W],!D)return w}let b=w,N=D.split("/");for(let X of N)if(X)w=u._`${w}${u.getProperty($4.unescapeJsonPointer(X))}`,b=u._`${b} && ${w}`;return b;function O(X,W){return`Cannot access ${X} ${W} levels up, current level is ${I}`}}N3.getData=b3});var MA=C((W3)=>{Object.defineProperty(W3,"__esModule",{value:!0});class X3 extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}W3.default=X3});var KU=C((Q3)=>{Object.defineProperty(Q3,"__esModule",{value:!0});var QW=HU();class G3 extends Error{constructor($,I,U,A){super(A||`can't resolve reference ${U} from id ${I}`);this.missingRef=QW.resolveUrl($,I,U),this.missingSchema=QW.normalizeId(QW.getFullPath($,this.missingRef))}}Q3.default=G3});var vA=C((J3)=>{Object.defineProperty(J3,"__esModule",{value:!0});J3.resolveSchema=J3.getCompilingSchema=J3.resolveRef=J3.compileSchema=J3.SchemaEnv=void 0;var j6=a(),mT=MA(),e4=s6(),k6=HU(),Y3=N$(),rT=MU();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:k6.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={}}}J3.SchemaEnv=vU;function BW($){let I=B3.call(this,$);if(I)return I;let U=k6.getFullPath(this.opts.uriResolver,$.root.baseId),{es5:A,lines:D}=this.opts.code,{ownProperties:w}=this.opts,b=new j6.CodeGen(this.scope,{es5:A,lines:D,ownProperties:w}),N;if($.$async)N=b.scopeValue("Error",{ref:mT.default,code:j6._`require("ajv/dist/runtime/validation_error").default`});let O=b.scopeName("validate");$.validateName=O;let X={gen:b,allErrors:this.opts.allErrors,data:e4.default.data,parentData:e4.default.parentData,parentDataProperty:e4.default.parentDataProperty,dataNames:[e4.default.data],dataPathArr:[j6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:b.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:j6.stringify($.schema)}:{ref:$.schema}),validateName:O,ValidationError:N,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:j6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:j6._`""`,opts:this.opts,self:this},W;try{this._compilations.add($),rT.validateFunctionCode(X),b.optimize(this.opts.code.optimize);let Q=b.toString();if(W=`${b.scopeRefs(e4.default.scope)}return ${Q}`,this.opts.code.process)W=this.opts.code.process(W,$);let Y=new Function(`${e4.default.self}`,`${e4.default.scope}`,W)(this,this.scope.get());if(this.scope.value(O,{ref:Y}),Y.errors=null,Y.schema=$.schema,Y.schemaEnv=$,$.$async)Y.$async=!0;if(this.opts.code.source===!0)Y.source={validateName:O,validateCode:Q,scopeValues:b._values};if(this.opts.unevaluated){let{props:J,items:H}=X;if(Y.evaluated={props:J instanceof j6.Name?void 0:J,items:H instanceof j6.Name?void 0:H,dynamicProps:J instanceof j6.Name,dynamicItems:H instanceof j6.Name},Y.source)Y.source.evaluated=j6.stringify(Y.evaluated)}return $.validate=Y,$}catch(Q){if(delete $.validate,delete $.validateName,W)this.logger.error("Error compiling schema, function code:",W);throw Q}finally{this._compilations.delete($)}}J3.compileSchema=BW;function nT($,I,U){var A;U=k6.resolveUrl(this.opts.uriResolver,I,U);let D=$.refs[U];if(D)return D;let w=dT.call(this,$,U);if(w===void 0){let b=(A=$.localRefs)===null||A===void 0?void 0:A[U],{schemaId:N}=this.opts;if(b)w=new vU({schema:b,schemaId:N,root:$,baseId:I})}if(w===void 0)return;return $.refs[U]=iT.call(this,w)}J3.resolveRef=nT;function iT($){if(k6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:BW.call(this,$)}function B3($){for(let I of this._compilations)if(oT(I,$))return I}J3.getCompilingSchema=B3;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]||KA.call(this,$,I)}function KA($,I){let U=this.opts.uriResolver.parse(I),A=k6._getFullPath(this.opts.uriResolver,U),D=k6.getFullPath(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&A===D)return YW.call(this,U,$);let w=k6.normalizeId(A),b=this.refs[w]||this.schemas[w];if(typeof b=="string"){let N=KA.call(this,$,b);if(typeof(N===null||N===void 0?void 0:N.schema)!=="object")return;return YW.call(this,U,N)}if(typeof(b===null||b===void 0?void 0:b.schema)!=="object")return;if(!b.validate)BW.call(this,b);if(w===k6.normalizeId(I)){let{schema:N}=b,{schemaId:O}=this.opts,X=N[O];if(X)D=k6.resolveUrl(this.opts.uriResolver,D,X);return new vU({schema:N,schemaId:O,root:$,baseId:D})}return YW.call(this,U,b)}J3.resolveSchema=KA;var pT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function YW($,{baseId:I,schema:U,root:A}){var D;if(((D=$.fragment)===null||D===void 0?void 0:D[0])!=="/")return;for(let N of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let O=U[Y3.unescapeFragment(N)];if(O===void 0)return;U=O;let X=typeof U==="object"&&U[this.opts.schemaId];if(!pT.has(N)&&X)I=k6.resolveUrl(this.opts.uriResolver,I,X)}let w;if(typeof U!="boolean"&&U.$ref&&!Y3.schemaHasRulesButRef(U,this.RULES)){let N=k6.resolveUrl(this.opts.uriResolver,I,U.$ref);w=KA.call(this,A,N)}let{schemaId:b}=this.opts;if(w=w||new vU({schema:U,schemaId:b,root:A,baseId:I}),w.schema!==w.root.schema)return w;return}});var L3=C((No,$_)=>{$_.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 HW=C((Oo,v3)=>{var I_=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),M3=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 JW($){let I="",U=0,A=0;for(A=0;A<$.length;A++){if(U=$[A].charCodeAt(0),U===48)continue;if(!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[A];break}for(A+=1;A<$.length;A++){if(U=$[A].charCodeAt(0),!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[A]}return I}var U_=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function z3($){return $.length=0,!0}function D_($,I,U){if($.length){let A=JW($);if(A!=="")I.push(A);else return U.error=!0,!1;$.length=0}return!0}function A_($){let I=0,U={error:!1,address:"",zone:""},A=[],D=[],w=!1,b=!1,N=D_;for(let O=0;O<$.length;O++){let X=$[O];if(X==="["||X==="]")continue;if(X===":"){if(w===!0)b=!0;if(!N(D,A,U))break;if(++I>7){U.error=!0;break}if(O>0&&$[O-1]===":")w=!0;A.push(":");continue}else if(X==="%"){if(!N(D,A,U))break;N=z3}else{D.push(X);continue}}if(D.length)if(N===z3)U.zone=D.join("");else if(b)A.push(D.join(""));else A.push(JW(D));return U.address=A.join(""),U}function K3($){if(w_($,":")<2)return{host:$,isIPV6:!1};let I=A_($);if(!I.error){let{address:U,address:A}=I;if(I.zone)U+="%"+I.zone,A+="%25"+I.zone;return{host:U,isIPV6:!0,escapedHost:A}}else return{host:$,isIPV6:!1}}function w_($,I){let U=0;for(let A=0;A<$.length;A++)if($[A]===I)U++;return U}function b_($){let I=$,U=[],A=-1,D=0;while(D=I.length){if(D===1)if(I===".")break;else if(I==="/"){U.push("/");break}else{U.push(I);break}else if(D===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(D===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((A=I.indexOf("/",1))===-1){U.push(I);break}else U.push(I.slice(0,A)),I=I.slice(A)}return U.join("")}function N_($,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 O_($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!M3(U)){let A=K3(U);if(A.isIPV6===!0)U=`[${A.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}v3.exports={nonSimpleDomain:U_,recomposeAuthority:O_,normalizeComponentEncoding:N_,removeDotSegments:b_,isIPv4:M3,isUUID:I_,normalizeIPv6:K3,stringArrayToHexStripped:JW}});var S3=C((Xo,E3)=>{var{isUUID:X_}=HW(),W_=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,G_=["http","https","ws","wss","urn","urn:uuid"];function Q_($){return G_.indexOf($)!==-1}function LW($){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 V3($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function q3($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function Y_($){return $.secure=LW($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function B_($){if($.port===(LW($)?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 J_($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(W_);if(U){let A=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let D=`${A}:${I.nid||$.nid}`,w=zW(D);if($.path=void 0,w)$=w.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function H_($,I){if($.nid===void 0)throw new Error("URN without nid cannot be serialized");let U=I.scheme||$.scheme||"urn",A=$.nid.toLowerCase(),D=`${U}:${I.nid||A}`,w=zW(D);if(w)$=w.serialize($,I);let b=$,N=$.nss;return b.path=`${A||I.nid}:${N}`,I.skipEscape=!0,b}function L_($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!X_(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function z_($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var F3={scheme:"http",domainHost:!0,parse:V3,serialize:q3},M_={scheme:"https",domainHost:F3.domainHost,parse:V3,serialize:q3},VA={scheme:"ws",domainHost:!0,parse:Y_,serialize:B_},K_={scheme:"wss",domainHost:VA.domainHost,parse:VA.parse,serialize:VA.serialize},v_={scheme:"urn",parse:J_,serialize:H_,skipNormalize:!0},V_={scheme:"urn:uuid",parse:L_,serialize:z_,skipNormalize:!0},qA={http:F3,https:M_,ws:VA,wss:K_,urn:v_,"urn:uuid":V_};Object.setPrototypeOf(qA,null);function zW($){return $&&(qA[$]||qA[$.toLowerCase()])||void 0}E3.exports={wsIsSecure:LW,SCHEMES:qA,isValidSchemeName:Q_,getSchemeHandler:zW}});var P3=C((Wo,EA)=>{var{normalizeIPv6:q_,removeDotSegments:VU,recomposeAuthority:F_,normalizeComponentEncoding:FA,isIPv4:E_,nonSimpleDomain:S_}=HW(),{SCHEMES:j_,getSchemeHandler:j3}=S3();function k_($,I){if(typeof $==="string")$=f6(I4($,I),I);else if(typeof $==="object")$=I4(f6($,I),I);return $}function P_($,I,U){let A=U?Object.assign({scheme:"null"},U):{scheme:"null"},D=k3(I4($,A),I4(I,A),A,!0);return A.skipEscape=!0,f6(D,A)}function k3($,I,U,A){let D={};if(!A)$=I4(f6($,U),U),I=I4(f6(I,U),U);if(U=U||{},!U.tolerant&&I.scheme)D.scheme=I.scheme,D.userinfo=I.userinfo,D.host=I.host,D.port=I.port,D.path=VU(I.path||""),D.query=I.query;else{if(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)D.userinfo=I.userinfo,D.host=I.host,D.port=I.port,D.path=VU(I.path||""),D.query=I.query;else{if(!I.path)if(D.path=$.path,I.query!==void 0)D.query=I.query;else D.query=$.query;else{if(I.path[0]==="/")D.path=VU(I.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)D.path="/"+I.path;else if(!$.path)D.path=I.path;else D.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+I.path;D.path=VU(D.path)}D.query=I.query}D.userinfo=$.userinfo,D.host=$.host,D.port=$.port}D.scheme=$.scheme}return D.fragment=I.fragment,D}function R_($,I,U){if(typeof $==="string")$=unescape($),$=f6(FA(I4($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=f6(FA($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=f6(FA(I4(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=f6(FA(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:""},A=Object.assign({},I),D=[],w=j3(A.scheme||U.scheme);if(w&&w.serialize)w.serialize(U,A);if(U.path!==void 0)if(!A.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(A.reference!=="suffix"&&U.scheme)D.push(U.scheme,":");let b=F_(U);if(b!==void 0){if(A.reference!=="suffix")D.push("//");if(D.push(b),U.path&&U.path[0]!=="/")D.push("/")}if(U.path!==void 0){let N=U.path;if(!A.absolutePath&&(!w||!w.absolutePath))N=VU(N);if(b===void 0&&N[0]==="/"&&N[1]==="/")N="/%2F"+N.slice(2);D.push(N)}if(U.query!==void 0)D.push("?",U.query);if(U.fragment!==void 0)D.push("#",U.fragment);return D.join("")}var T_=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I4($,I){let U=Object.assign({},I),A={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},D=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let w=$.match(T_);if(w){if(A.scheme=w[1],A.userinfo=w[3],A.host=w[4],A.port=parseInt(w[5],10),A.path=w[6]||"",A.query=w[7],A.fragment=w[8],isNaN(A.port))A.port=w[5];if(A.host)if(E_(A.host)===!1){let O=q_(A.host);A.host=O.host.toLowerCase(),D=O.isIPV6}else D=!0;if(A.scheme===void 0&&A.userinfo===void 0&&A.host===void 0&&A.port===void 0&&A.query===void 0&&!A.path)A.reference="same-document";else if(A.scheme===void 0)A.reference="relative";else if(A.fragment===void 0)A.reference="absolute";else A.reference="uri";if(U.reference&&U.reference!=="suffix"&&U.reference!==A.reference)A.error=A.error||"URI is not a "+U.reference+" reference.";let b=j3(U.scheme||A.scheme);if(!U.unicodeSupport&&(!b||!b.unicodeSupport)){if(A.host&&(U.domainHost||b&&b.domainHost)&&D===!1&&S_(A.host))try{A.host=URL.domainToASCII(A.host.toLowerCase())}catch(N){A.error=A.error||"Host's domain name can not be converted to ASCII: "+N}}if(!b||b&&!b.skipNormalize){if($.indexOf("%")!==-1){if(A.scheme!==void 0)A.scheme=unescape(A.scheme);if(A.host!==void 0)A.host=unescape(A.host)}if(A.path)A.path=escape(unescape(A.path));if(A.fragment)A.fragment=encodeURI(decodeURIComponent(A.fragment))}if(b&&b.parse)b.parse(A,U)}else A.error=A.error||"URI can not be parsed.";return A}var MW={SCHEMES:j_,normalize:k_,resolve:P_,resolveComponent:k3,equal:R_,serialize:f6,parse:I4};EA.exports=MW;EA.exports.default=MW;EA.exports.fastUri=MW});var _3=C((T3)=>{Object.defineProperty(T3,"__esModule",{value:!0});var R3=P3();R3.code='require("ajv/dist/runtime/uri").default';T3.default=R3});var u3=C((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.CodeGen=U4.Name=U4.nil=U4.stringify=U4.str=U4._=U4.KeywordCxt=void 0;var C_=MU();Object.defineProperty(U4,"KeywordCxt",{enumerable:!0,get:function(){return C_.KeywordCxt}});var ZI=a();Object.defineProperty(U4,"_",{enumerable:!0,get:function(){return ZI._}});Object.defineProperty(U4,"str",{enumerable:!0,get:function(){return ZI.str}});Object.defineProperty(U4,"stringify",{enumerable:!0,get:function(){return ZI.stringify}});Object.defineProperty(U4,"nil",{enumerable:!0,get:function(){return ZI.nil}});Object.defineProperty(U4,"Name",{enumerable:!0,get:function(){return ZI.Name}});Object.defineProperty(U4,"CodeGen",{enumerable:!0,get:function(){return ZI.CodeGen}});var Z_=MA(),h3=KU(),g_=eX(),qU=vA(),x_=a(),FU=HU(),SA=JU(),vW=N$(),C3=L3(),h_=_3(),f3=($,I)=>new RegExp($,I);f3.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.'},Z3=200;function c_($){var I,U,A,D,w,b,N,O,X,W,Q,B,Y,J,H,v,V,P,k,h,l,l$,G6,YI,tb;let j1=$.strict,ab=(I=$.code)===null||I===void 0?void 0:I.optimize,T5=ab===!0||ab===void 0?1:ab||0,_5=(A=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&A!==void 0?A:f3,sF=(D=$.uriResolver)!==null&&D!==void 0?D:h_.default;return{strictSchema:(b=(w=$.strictSchema)!==null&&w!==void 0?w:j1)!==null&&b!==void 0?b:!0,strictNumbers:(O=(N=$.strictNumbers)!==null&&N!==void 0?N:j1)!==null&&O!==void 0?O:!0,strictTypes:(W=(X=$.strictTypes)!==null&&X!==void 0?X:j1)!==null&&W!==void 0?W:"log",strictTuples:(B=(Q=$.strictTuples)!==null&&Q!==void 0?Q:j1)!==null&&B!==void 0?B:"log",strictRequired:(J=(Y=$.strictRequired)!==null&&Y!==void 0?Y:j1)!==null&&J!==void 0?J:!1,code:$.code?{...$.code,optimize:T5,regExp:_5}:{optimize:T5,regExp:_5},loopRequired:(H=$.loopRequired)!==null&&H!==void 0?H:Z3,loopEnum:(v=$.loopEnum)!==null&&v!==void 0?v:Z3,meta:(V=$.meta)!==null&&V!==void 0?V:!0,messages:(P=$.messages)!==null&&P!==void 0?P:!0,inlineRefs:(k=$.inlineRefs)!==null&&k!==void 0?k:!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:(G6=$.validateFormats)!==null&&G6!==void 0?G6:!0,unicodeRegExp:(YI=$.unicodeRegExp)!==null&&YI!==void 0?YI:!0,int32range:(tb=$.int32range)!==null&&tb!==void 0?tb:!0,uriResolver:sF}}class jA{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 A=$.validateFormats;if($.validateFormats=!1,this.RULES=g_.getRules(),g3.call(this,u_,$,"NOT SUPPORTED"),g3.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=A}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,A=C3;if(U==="id")A={...C3},A.id=A.$id,delete A.$id;if(I&&$)this.addMetaSchema(A,A[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 A=U(I);if(!("$async"in U))this.errors=U.errors;return A}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 A.call(this,$,I);async function A(X,W){await D.call(this,X.$schema);let Q=this._addSchema(X,W);return Q.validate||w.call(this,Q)}async function D(X){if(X&&!this.getSchema(X))await A.call(this,{$ref:X},!0)}async function w(X){try{return this._compileSchemaEnv(X)}catch(W){if(!(W instanceof h3.default))throw W;return b.call(this,W),await N.call(this,W.missingSchema),w.call(this,X)}}function b({missingSchema:X,missingRef:W}){if(this.refs[X])throw new Error(`AnySchema ${X} is loaded but ${W} cannot be resolved`)}async function N(X){let W=await O.call(this,X);if(!this.refs[X])await D.call(this,W.$schema);if(!this.refs[X])this.addSchema(W,X,I)}async function O(X){let W=this._loading[X];if(W)return W;try{return await(this._loading[X]=U(X))}finally{delete this._loading[X]}}}addSchema($,I,U,A=this.opts.validateSchema){if(Array.isArray($)){for(let w of $)this.addSchema(w,void 0,U,A);return this}let D;if(typeof $==="object"){let{schemaId:w}=this.opts;if(D=$[w],D!==void 0&&typeof D!="string")throw new Error(`schema ${w} must be string`)}return I=FU.normalizeId(I||D),this._checkUnique(I),this.schemas[I]=this._addSchema($,U,I,A,!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 A=this.validate(U,$);if(!A&&I){let D="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(D);else throw new Error(D)}return A}getSchema($){let I;while(typeof(I=x3.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,A=new qU.SchemaEnv({schema:{},schemaId:U});if(I=qU.resolveSchema.call(this,A,$),!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=x3.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 vW.eachItem(U,(D)=>KW.call(this,D)),this;e_.call(this,I);let A={...I,type:SA.getJSONTypes(I.type),schemaType:SA.getJSONTypes(I.schemaType)};return vW.eachItem(U,A.type.length===0?(D)=>KW.call(this,D,A):(D)=>A.type.forEach((w)=>KW.call(this,D,A,w))),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 A=U.rules.findIndex((D)=>D.keyword===$);if(A>=0)U.rules.splice(A,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((A)=>`${U}${A.instancePath} ${A.message}`).reduce((A,D)=>A+I+D)}$dataMetaSchema($,I){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let A of I){let D=A.split("/").slice(1),w=$;for(let b of D)w=w[b];for(let b in U){let N=U[b];if(typeof N!="object")continue;let{$data:O}=N.definition,X=w[b];if(O&&X)w[b]=y3(X)}}return $}_removeAllSchemas($,I){for(let U in $){let A=$[U];if(!I||I.test(U)){if(typeof A=="string")delete $[U];else if(A&&!A.meta)this._cache.delete(A.schema),delete $[U]}}}_addSchema($,I,U,A=this.opts.validateSchema,D=this.opts.addUsedSchema){let w,{schemaId:b}=this.opts;if(typeof $=="object")w=$[b];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 N=this._cache.get($);if(N!==void 0)return N;U=FU.normalizeId(w||U);let O=FU.getSchemaRefs.call(this,$,U);if(N=new qU.SchemaEnv({schema:$,schemaId:b,meta:I,baseId:U,localRefs:O}),this._cache.set(N.schema,N),D&&!U.startsWith("#")){if(U)this._checkUnique(U);this.refs[U]=N}if(A)this.validateSchema($,!0);return N}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else qU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{qU.compileSchema.call(this,$)}finally{this.opts=I}}}jA.ValidationError=Z_.default;jA.MissingRefError=h3.default;U4.default=jA;function g3($,I,U,A="error"){for(let D in $){let w=D;if(w in I)this.logger[A](`${U}: option ${D}. ${$[w]}`)}}function x3($){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(vW.eachItem($,(A)=>{if(U.keywords[A])throw new Error(`Keyword ${A} is already defined`);if(!p_.test(A))throw new Error(`Keyword ${A} 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 KW($,I,U){var A;let D=I===null||I===void 0?void 0:I.post;if(U&&D)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:w}=this,b=D?w.post:w.rules.find(({type:O})=>O===U);if(!b)b={type:U,rules:[]},w.rules.push(b);if(w.keywords[$]=!0,!I)return;let N={keyword:$,definition:{...I,type:SA.getJSONTypes(I.type),schemaType:SA.getJSONTypes(I.schemaType)}};if(I.before)a_.call(this,b,N,I.before);else b.rules.push(N);w.all[$]=N,(A=I.implements)===null||A===void 0||A.forEach((O)=>this.addKeyword(O))}function a_($,I,U){let A=$.rules.findIndex((D)=>D.keyword===U);if(A>=0)$.rules.splice(A,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=y3(I);$.validateSchema=this.compile(I,!0)}var s_={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function y3($){return{anyOf:[$,s_]}}});var c3=C((l3)=>{Object.defineProperty(l3,"__esModule",{value:!0});var UC={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};l3.default=UC});var d3=C((i3)=>{Object.defineProperty(i3,"__esModule",{value:!0});i3.callRef=i3.getValidate=void 0;var AC=KU(),m3=H6(),$6=a(),gI=s6(),r3=vA(),kA=N$(),wC={keyword:"$ref",schemaType:"string",code($){let{gen:I,schema:U,it:A}=$,{baseId:D,schemaEnv:w,validateName:b,opts:N,self:O}=A,{root:X}=w;if((U==="#"||U==="#/")&&D===X.baseId)return Q();let W=r3.resolveRef.call(O,X,D,U);if(W===void 0)throw new AC.default(A.opts.uriResolver,D,U);if(W instanceof r3.SchemaEnv)return B(W);return Y(W);function Q(){if(w===X)return PA($,b,w,w.$async);let J=I.scopeValue("root",{ref:X});return PA($,$6._`${J}.validate`,X,X.$async)}function B(J){let H=n3($,J);PA($,H,J,J.$async)}function Y(J){let H=I.scopeValue("schema",N.code.source===!0?{ref:J,code:$6.stringify(J)}:{ref:J}),v=I.name("valid"),V=$.subschema({schema:J,dataTypes:[],schemaPath:$6.nil,topSchemaRef:H,errSchemaPath:U},v);$.mergeEvaluated(V),$.ok(v)}}};function n3($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):$6._`${U.scopeValue("wrapper",{ref:I})}.validate`}i3.getValidate=n3;function PA($,I,U,A){let{gen:D,it:w}=$,{allErrors:b,schemaEnv:N,opts:O}=w,X=O.passContext?gI.default.this:$6.nil;if(A)W();else Q();function W(){if(!N.$async)throw new Error("async schema referenced by sync schema");let J=D.let("valid");D.try(()=>{if(D.code($6._`await ${m3.callValidateCode($,I,X)}`),Y(I),!b)D.assign(J,!0)},(H)=>{if(D.if($6._`!(${H} instanceof ${w.ValidationError})`,()=>D.throw(H)),B(H),!b)D.assign(J,!1)}),$.ok(J)}function Q(){$.result(m3.callValidateCode($,I,X),()=>Y(I),()=>B(I))}function B(J){let H=$6._`${J}.errors`;D.assign(gI.default.vErrors,$6._`${gI.default.vErrors} === null ? ${H} : ${gI.default.vErrors}.concat(${H})`),D.assign(gI.default.errors,$6._`${gI.default.vErrors}.length`)}function Y(J){var H;if(!w.opts.unevaluated)return;let v=(H=U===null||U===void 0?void 0:U.validate)===null||H===void 0?void 0:H.evaluated;if(w.props!==!0)if(v&&!v.dynamicProps){if(v.props!==void 0)w.props=kA.mergeEvaluated.props(D,v.props,w.props)}else{let V=D.var("props",$6._`${J}.evaluated.props`);w.props=kA.mergeEvaluated.props(D,V,w.props,$6.Name)}if(w.items!==!0)if(v&&!v.dynamicItems){if(v.items!==void 0)w.items=kA.mergeEvaluated.items(D,v.items,w.items)}else{let V=D.var("items",$6._`${J}.evaluated.items`);w.items=kA.mergeEvaluated.items(D,V,w.items,$6.Name)}}}i3.callRef=PA;i3.default=wC});var t3=C((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});var OC=c3(),XC=d3(),WC=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",OC.default,XC.default];p3.default=WC});var e3=C((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});var RA=a(),V4=RA.operators,TA={maximum:{okStr:"<=",ok:V4.LTE,fail:V4.GT},minimum:{okStr:">=",ok:V4.GTE,fail:V4.LT},exclusiveMaximum:{okStr:"<",ok:V4.LT,fail:V4.GTE},exclusiveMinimum:{okStr:">",ok:V4.GT,fail:V4.LTE}},QC={message:({keyword:$,schemaCode:I})=>RA.str`must be ${TA[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>RA._`{comparison: ${TA[$].okStr}, limit: ${I}}`},YC={keyword:Object.keys(TA),type:"number",schemaType:"number",$data:!0,error:QC,code($){let{keyword:I,data:U,schemaCode:A}=$;$.fail$data(RA._`${U} ${TA[I].fail} ${A} || isNaN(${U})`)}};a3.default=YC});var $M=C((s3)=>{Object.defineProperty(s3,"__esModule",{value:!0});var EU=a(),JC={message:({schemaCode:$})=>EU.str`must be multiple of ${$}`,params:({schemaCode:$})=>EU._`{multipleOf: ${$}}`},HC={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:JC,code($){let{gen:I,data:U,schemaCode:A,it:D}=$,w=D.opts.multipleOfPrecision,b=I.let("res"),N=w?EU._`Math.abs(Math.round(${b}) - ${b}) > 1e-${w}`:EU._`${b} !== parseInt(${b})`;$.fail$data(EU._`(${A} === 0 || (${b} = ${U}/${A}, ${N}))`)}};s3.default=HC});var DM=C((UM)=>{Object.defineProperty(UM,"__esModule",{value:!0});function IM($){let I=$.length,U=0,A=0,D;while(A<I)if(U++,D=$.charCodeAt(A++),D>=55296&&D<=56319&&A<I){if(D=$.charCodeAt(A),(D&64512)===56320)A++}return U}UM.default=IM;IM.code='require("ajv/dist/runtime/ucs2length").default'});var wM=C((AM)=>{Object.defineProperty(AM,"__esModule",{value:!0});var s4=a(),MC=N$(),KC=DM(),vC={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return s4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>s4._`{limit: ${$}}`},VC={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:vC,code($){let{keyword:I,data:U,schemaCode:A,it:D}=$,w=I==="maxLength"?s4.operators.GT:s4.operators.LT,b=D.opts.unicode===!1?s4._`${U}.length`:s4._`${MC.useFunc($.gen,KC.default)}(${U})`;$.fail$data(s4._`${b} ${w} ${A}`)}};AM.default=VC});var NM=C((bM)=>{Object.defineProperty(bM,"__esModule",{value:!0});var FC=H6(),_A=a(),EC={message:({schemaCode:$})=>_A.str`must match pattern "${$}"`,params:({schemaCode:$})=>_A._`{pattern: ${$}}`},SC={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:EC,code($){let{data:I,$data:U,schema:A,schemaCode:D,it:w}=$,b=w.opts.unicodeRegExp?"u":"",N=U?_A._`(new RegExp(${D}, ${b}))`:FC.usePattern($,A);$.fail$data(_A._`!${N}.test(${I})`)}};bM.default=SC});var XM=C((OM)=>{Object.defineProperty(OM,"__esModule",{value:!0});var SU=a(),kC={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return SU.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>SU._`{limit: ${$}}`},PC={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kC,code($){let{keyword:I,data:U,schemaCode:A}=$,D=I==="maxProperties"?SU.operators.GT:SU.operators.LT;$.fail$data(SU._`Object.keys(${U}).length ${D} ${A}`)}};OM.default=PC});var GM=C((WM)=>{Object.defineProperty(WM,"__esModule",{value:!0});var jU=H6(),kU=a(),TC=N$(),_C={message:({params:{missingProperty:$}})=>kU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>kU._`{missingProperty: ${$}}`},CC={keyword:"required",type:"object",schemaType:"array",$data:!0,error:_C,code($){let{gen:I,schema:U,schemaCode:A,data:D,$data:w,it:b}=$,{opts:N}=b;if(!w&&U.length===0)return;let O=U.length>=N.loopRequired;if(b.allErrors)X();else W();if(N.strictRequired){let Y=$.parentSchema.properties,{definedProperties:J}=$.it;for(let H of U)if((Y===null||Y===void 0?void 0:Y[H])===void 0&&!J.has(H)){let v=b.schemaEnv.baseId+b.errSchemaPath,V=`required property "${H}" is not defined at "${v}" (strictRequired)`;TC.checkStrictMode(b,V,b.opts.strictRequired)}}function X(){if(O||w)$.block$data(kU.nil,Q);else for(let Y of U)jU.checkReportMissingProp($,Y)}function W(){let Y=I.let("missing");if(O||w){let J=I.let("valid",!0);$.block$data(J,()=>B(Y,J)),$.ok(J)}else I.if(jU.checkMissingProp($,U,Y)),jU.reportMissingProp($,Y),I.else()}function Q(){I.forOf("prop",A,(Y)=>{$.setParams({missingProperty:Y}),I.if(jU.noPropertyInData(I,D,Y,N.ownProperties),()=>$.error())})}function B(Y,J){$.setParams({missingProperty:Y}),I.forOf(Y,A,()=>{I.assign(J,jU.propertyInData(I,D,Y,N.ownProperties)),I.if(kU.not(J),()=>{$.error(),I.break()})},kU.nil)}}};WM.default=CC});var YM=C((QM)=>{Object.defineProperty(QM,"__esModule",{value:!0});var PU=a(),gC={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return PU.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>PU._`{limit: ${$}}`},xC={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:gC,code($){let{keyword:I,data:U,schemaCode:A}=$,D=I==="maxItems"?PU.operators.GT:PU.operators.LT;$.fail$data(PU._`${U}.length ${D} ${A}`)}};QM.default=xC});var CA=C((JM)=>{Object.defineProperty(JM,"__esModule",{value:!0});var BM=bW();BM.code='require("ajv/dist/runtime/equal").default';JM.default=BM});var LM=C((HM)=>{Object.defineProperty(HM,"__esModule",{value:!0});var VW=JU(),h$=a(),yC=N$(),uC=CA(),lC={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}}`},cC={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:lC,code($){let{gen:I,data:U,$data:A,schema:D,parentSchema:w,schemaCode:b,it:N}=$;if(!A&&!D)return;let O=I.let("valid"),X=w.items?VW.getSchemaTypes(w.items):[];$.block$data(O,W,h$._`${b} === false`),$.ok(O);function W(){let J=I.let("i",h$._`${U}.length`),H=I.let("j");$.setParams({i:J,j:H}),I.assign(O,!0),I.if(h$._`${J} > 1`,()=>(Q()?B:Y)(J,H))}function Q(){return X.length>0&&!X.some((J)=>J==="object"||J==="array")}function B(J,H){let v=I.name("item"),V=VW.checkDataTypes(X,v,N.opts.strictNumbers,VW.DataType.Wrong),P=I.const("indices",h$._`{}`);I.for(h$._`;${J}--;`,()=>{if(I.let(v,h$._`${U}[${J}]`),I.if(V,h$._`continue`),X.length>1)I.if(h$._`typeof ${v} == "string"`,h$._`${v} += "_"`);I.if(h$._`typeof ${P}[${v}] == "number"`,()=>{I.assign(H,h$._`${P}[${v}]`),$.error(),I.assign(O,!1).break()}).code(h$._`${P}[${v}] = ${J}`)})}function Y(J,H){let v=yC.useFunc(I,uC.default),V=I.name("outer");I.label(V).for(h$._`;${J}--;`,()=>I.for(h$._`${H} = ${J}; ${H}--;`,()=>I.if(h$._`${v}(${U}[${J}], ${U}[${H}])`,()=>{$.error(),I.assign(O,!1).break(V)})))}}};HM.default=cC});var MM=C((zM)=>{Object.defineProperty(zM,"__esModule",{value:!0});var qW=a(),rC=N$(),nC=CA(),iC={message:"must be equal to constant",params:({schemaCode:$})=>qW._`{allowedValue: ${$}}`},oC={keyword:"const",$data:!0,error:iC,code($){let{gen:I,data:U,$data:A,schemaCode:D,schema:w}=$;if(A||w&&typeof w=="object")$.fail$data(qW._`!${rC.useFunc(I,nC.default)}(${U}, ${D})`);else $.fail(qW._`${w} !== ${U}`)}};zM.default=oC});var vM=C((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});var RU=a(),pC=N$(),tC=CA(),aC={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>RU._`{allowedValues: ${$}}`},eC={keyword:"enum",schemaType:"array",$data:!0,error:aC,code($){let{gen:I,data:U,$data:A,schema:D,schemaCode:w,it:b}=$;if(!A&&D.length===0)throw new Error("enum must have non-empty array");let N=D.length>=b.opts.loopEnum,O,X=()=>O!==null&&O!==void 0?O:O=pC.useFunc(I,tC.default),W;if(N||A)W=I.let("valid"),$.block$data(W,Q);else{if(!Array.isArray(D))throw new Error("ajv implementation error");let Y=I.const("vSchema",w);W=RU.or(...D.map((J,H)=>B(Y,H)))}$.pass(W);function Q(){I.assign(W,!1),I.forOf("v",w,(Y)=>I.if(RU._`${X()}(${U}, ${Y})`,()=>I.assign(W,!0).break()))}function B(Y,J){let H=D[J];return typeof H==="object"&&H!==null?RU._`${X()}(${U}, ${Y}[${J}])`:RU._`${U} === ${H}`}}};KM.default=eC});var qM=C((VM)=>{Object.defineProperty(VM,"__esModule",{value:!0});var $Z=e3(),IZ=$M(),UZ=wM(),DZ=NM(),AZ=XM(),wZ=GM(),bZ=YM(),NZ=LM(),OZ=MM(),XZ=vM(),WZ=[$Z.default,IZ.default,UZ.default,DZ.default,AZ.default,wZ.default,bZ.default,NZ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},OZ.default,XZ.default];VM.default=WZ});var EW=C((EM)=>{Object.defineProperty(EM,"__esModule",{value:!0});EM.validateAdditionalItems=void 0;var $I=a(),FW=N$(),QZ={message:({params:{len:$}})=>$I.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>$I._`{limit: ${$}}`},YZ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:QZ,code($){let{parentSchema:I,it:U}=$,{items:A}=I;if(!Array.isArray(A)){FW.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}FM($,A)}};function FM($,I){let{gen:U,schema:A,data:D,keyword:w,it:b}=$;b.items=!0;let N=U.const("len",$I._`${D}.length`);if(A===!1)$.setParams({len:I.length}),$.pass($I._`${N} <= ${I.length}`);else if(typeof A=="object"&&!FW.alwaysValidSchema(b,A)){let X=U.var("valid",$I._`${N} <= ${I.length}`);U.if($I.not(X),()=>O(X)),$.ok(X)}function O(X){U.forRange("i",I.length,N,(W)=>{if($.subschema({keyword:w,dataProp:W,dataPropType:FW.Type.Num},X),!b.allErrors)U.if($I.not(X),()=>U.break())})}}EM.validateAdditionalItems=FM;EM.default=YZ});var SW=C((PM)=>{Object.defineProperty(PM,"__esModule",{value:!0});PM.validateTuple=void 0;var jM=a(),ZA=N$(),JZ=H6(),HZ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return kM($,"additionalItems",I);if(U.items=!0,ZA.alwaysValidSchema(U,I))return;$.ok(JZ.validateArray($))}};function kM($,I,U=$.schema){let{gen:A,parentSchema:D,data:w,keyword:b,it:N}=$;if(W(D),N.opts.unevaluated&&U.length&&N.items!==!0)N.items=ZA.mergeEvaluated.items(A,U.length,N.items);let O=A.name("valid"),X=A.const("len",jM._`${w}.length`);U.forEach((Q,B)=>{if(ZA.alwaysValidSchema(N,Q))return;A.if(jM._`${X} > ${B}`,()=>$.subschema({keyword:b,schemaProp:B,dataProp:B},O)),$.ok(O)});function W(Q){let{opts:B,errSchemaPath:Y}=N,J=U.length,H=J===Q.minItems&&(J===Q.maxItems||Q[I]===!1);if(B.strictTuples&&!H){let v=`"${b}" is ${J}-tuple, but minItems or maxItems/${I} are not specified or different at path "${Y}"`;ZA.checkStrictMode(N,v,B.strictTuples)}}}PM.validateTuple=kM;PM.default=HZ});var _M=C((TM)=>{Object.defineProperty(TM,"__esModule",{value:!0});var zZ=SW(),MZ={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>zZ.validateTuple($,"items")};TM.default=MZ});var gM=C((ZM)=>{Object.defineProperty(ZM,"__esModule",{value:!0});var CM=a(),vZ=N$(),VZ=H6(),qZ=EW(),FZ={message:({params:{len:$}})=>CM.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>CM._`{limit: ${$}}`},EZ={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:FZ,code($){let{schema:I,parentSchema:U,it:A}=$,{prefixItems:D}=U;if(A.items=!0,vZ.alwaysValidSchema(A,I))return;if(D)qZ.validateAdditionalItems($,D);else $.ok(VZ.validateArray($))}};ZM.default=EZ});var hM=C((xM)=>{Object.defineProperty(xM,"__esModule",{value:!0});var L6=a(),gA=N$(),jZ={message:({params:{min:$,max:I}})=>I===void 0?L6.str`must contain at least ${$} valid item(s)`:L6.str`must contain at least ${$} and no more than ${I} valid item(s)`,params:({params:{min:$,max:I}})=>I===void 0?L6._`{minContains: ${$}}`:L6._`{minContains: ${$}, maxContains: ${I}}`},kZ={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:jZ,code($){let{gen:I,schema:U,parentSchema:A,data:D,it:w}=$,b,N,{minContains:O,maxContains:X}=A;if(w.opts.next)b=O===void 0?1:O,N=X;else b=1;let W=I.const("len",L6._`${D}.length`);if($.setParams({min:b,max:N}),N===void 0&&b===0){gA.checkStrictMode(w,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(N!==void 0&&b>N){gA.checkStrictMode(w,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(gA.alwaysValidSchema(w,U)){let H=L6._`${W} >= ${b}`;if(N!==void 0)H=L6._`${H} && ${W} <= ${N}`;$.pass(H);return}w.items=!0;let Q=I.name("valid");if(N===void 0&&b===1)Y(Q,()=>I.if(Q,()=>I.break()));else if(b===0){if(I.let(Q,!0),N!==void 0)I.if(L6._`${D}.length > 0`,B)}else I.let(Q,!1),B();$.result(Q,()=>$.reset());function B(){let H=I.name("_valid"),v=I.let("count",0);Y(H,()=>I.if(H,()=>J(v)))}function Y(H,v){I.forRange("i",0,W,(V)=>{$.subschema({keyword:"contains",dataProp:V,dataPropType:gA.Type.Num,compositeRule:!0},H),v()})}function J(H){if(I.code(L6._`${H}++`),N===void 0)I.if(L6._`${H} >= ${b}`,()=>I.assign(Q,!0).break());else if(I.if(L6._`${H} > ${N}`,()=>I.assign(Q,!1).break()),b===1)I.assign(Q,!0);else I.if(L6._`${H} >= ${b}`,()=>I.assign(Q,!0))}}};xM.default=kZ});var mM=C((uM)=>{Object.defineProperty(uM,"__esModule",{value:!0});uM.validateSchemaDeps=uM.validatePropertyDeps=uM.error=void 0;var jW=a(),RZ=N$(),TU=H6();uM.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let A=I===1?"property":"properties";return jW.str`must have ${A} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:A}})=>jW._`{property: ${$},
7
+ missingProperty: ${A},
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(`
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 gA={major:4,minor:0,patch:0};var Y$=v("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=gA;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()??HA($._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=sH),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=$A),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:WA.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=IA()),z$.init($,I)}),ZW=v("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=aH),z$.init($,I)}),CW=v("$ZodCUID",($,I)=>{I.pattern??(I.pattern=iH),z$.init($,I)}),gW=v("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=oH),z$.init($,I)}),xW=v("$ZodULID",($,I)=>{I.pattern??(I.pattern=dH),z$.init($,I)}),hW=v("$ZodXID",($,I)=>{I.pattern??(I.pattern=pH),z$.init($,I)}),fW=v("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=tH),z$.init($,I)}),nA=v("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=BA(I)),z$.init($,I)}),iA=v("$ZodISODate",($,I)=>{I.pattern??(I.pattern=YA),z$.init($,I)}),oA=v("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=JA(I)),z$.init($,I)}),dA=v("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=eH),z$.init($,I)}),yW=v("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=UA),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv4"})}),uW=v("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=wA),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=bA),z$.init($,I)}),cW=v("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=XA),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 pA($){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=DA),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64"}),$._zod.check=(U)=>{if(pA(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function tj($){if(!MW.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return pA(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(tj(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=QA),z$.init($,I)});function aj($,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(aj(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??OA,$._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)=>{MA.init($,I),Lw.init($,I)}),dW=v("$ZodBoolean",($,I)=>{Y$.init($,I),$._zod.pattern=zA,$._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=LA,$._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 xA($,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)=>xA(G,U,D)));else xA(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 hA($,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
- if (${P}.issues.length) {
9
+ deps: ${U}}`};var TZ={keyword:"dependencies",type:"object",schemaType:"object",error:uM.error,code($){let[I,U]=_Z($);fM($,I),yM($,U)}};function _Z({schema:$}){let I={},U={};for(let A in $){if(A==="__proto__")continue;let D=Array.isArray($[A])?I:U;D[A]=$[A]}return[I,U]}function fM($,I=$.schema){let{gen:U,data:A,it:D}=$;if(Object.keys(I).length===0)return;let w=U.let("missing");for(let b in I){let N=I[b];if(N.length===0)continue;let O=TU.propertyInData(U,A,b,D.opts.ownProperties);if($.setParams({property:b,depsCount:N.length,deps:N.join(", ")}),D.allErrors)U.if(O,()=>{for(let X of N)TU.checkReportMissingProp($,X)});else U.if(jW._`${O} && (${TU.checkMissingProp($,N,w)})`),TU.reportMissingProp($,w),U.else()}}uM.validatePropertyDeps=fM;function yM($,I=$.schema){let{gen:U,data:A,keyword:D,it:w}=$,b=U.name("valid");for(let N in I){if(RZ.alwaysValidSchema(w,I[N]))continue;U.if(TU.propertyInData(U,A,N,w.opts.ownProperties),()=>{let O=$.subschema({keyword:D,schemaProp:N},b);$.mergeValidEvaluated(O,b)},()=>U.var(b,!0)),$.ok(b)}}uM.validateSchemaDeps=yM;uM.default=TZ});var iM=C((nM)=>{Object.defineProperty(nM,"__esModule",{value:!0});var rM=a(),gZ=N$(),xZ={message:"property name must be valid",params:({params:$})=>rM._`{propertyName: ${$.propertyName}}`},hZ={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:xZ,code($){let{gen:I,schema:U,data:A,it:D}=$;if(gZ.alwaysValidSchema(D,U))return;let w=I.name("valid");I.forIn("key",A,(b)=>{$.setParams({propertyName:b}),$.subschema({keyword:"propertyNames",data:b,dataTypes:["string"],propertyName:b,compositeRule:!0},w),I.if(rM.not(w),()=>{if($.error(!0),!D.allErrors)I.break()})}),$.ok(w)}};nM.default=hZ});var kW=C((oM)=>{Object.defineProperty(oM,"__esModule",{value:!0});var xA=H6(),P6=a(),yZ=s6(),hA=N$(),uZ={message:"must NOT have additional properties",params:({params:$})=>P6._`{additionalProperty: ${$.additionalProperty}}`},lZ={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:uZ,code($){let{gen:I,schema:U,parentSchema:A,data:D,errsCount:w,it:b}=$;if(!w)throw new Error("ajv implementation error");let{allErrors:N,opts:O}=b;if(b.props=!0,O.removeAdditional!=="all"&&hA.alwaysValidSchema(b,U))return;let X=xA.allSchemaProperties(A.properties),W=xA.allSchemaProperties(A.patternProperties);Q(),$.ok(P6._`${w} === ${yZ.default.errors}`);function Q(){I.forIn("key",D,(v)=>{if(!X.length&&!W.length)J(v);else I.if(B(v),()=>J(v))})}function B(v){let V;if(X.length>8){let P=hA.schemaRefOrVal(b,A.properties,"properties");V=xA.isOwnProperty(I,P,v)}else if(X.length)V=P6.or(...X.map((P)=>P6._`${v} === ${P}`));else V=P6.nil;if(W.length)V=P6.or(V,...W.map((P)=>P6._`${xA.usePattern($,P)}.test(${v})`));return P6.not(V)}function Y(v){I.code(P6._`delete ${D}[${v}]`)}function J(v){if(O.removeAdditional==="all"||O.removeAdditional&&U===!1){Y(v);return}if(U===!1){if($.setParams({additionalProperty:v}),$.error(),!N)I.break();return}if(typeof U=="object"&&!hA.alwaysValidSchema(b,U)){let V=I.name("valid");if(O.removeAdditional==="failing")H(v,V,!1),I.if(P6.not(V),()=>{$.reset(),Y(v)});else if(H(v,V),!N)I.if(P6.not(V),()=>I.break())}}function H(v,V,P){let k={keyword:"additionalProperties",dataProp:v,dataPropType:hA.Type.Str};if(P===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(k,V)}}};oM.default=lZ});var aM=C((tM)=>{Object.defineProperty(tM,"__esModule",{value:!0});var mZ=MU(),dM=H6(),PW=N$(),pM=kW(),rZ={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:A,data:D,it:w}=$;if(w.opts.removeAdditional==="all"&&A.additionalProperties===void 0)pM.default.code(new mZ.KeywordCxt(w,pM.default,"additionalProperties"));let b=dM.allSchemaProperties(U);for(let Q of b)w.definedProperties.add(Q);if(w.opts.unevaluated&&b.length&&w.props!==!0)w.props=PW.mergeEvaluated.props(I,PW.toHash(b),w.props);let N=b.filter((Q)=>!PW.alwaysValidSchema(w,U[Q]));if(N.length===0)return;let O=I.name("valid");for(let Q of N){if(X(Q))W(Q);else{if(I.if(dM.propertyInData(I,D,Q,w.opts.ownProperties)),W(Q),!w.allErrors)I.else().var(O,!0);I.endIf()}$.it.definedProperties.add(Q),$.ok(O)}function X(Q){return w.opts.useDefaults&&!w.compositeRule&&U[Q].default!==void 0}function W(Q){$.subschema({keyword:"properties",schemaProp:Q,dataProp:Q},O)}}};tM.default=rZ});var UK=C((IK)=>{Object.defineProperty(IK,"__esModule",{value:!0});var eM=H6(),fA=a(),sM=N$(),$K=N$(),iZ={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:A,parentSchema:D,it:w}=$,{opts:b}=w,N=eM.allSchemaProperties(U),O=N.filter((H)=>sM.alwaysValidSchema(w,U[H]));if(N.length===0||O.length===N.length&&(!w.opts.unevaluated||w.props===!0))return;let X=b.strictSchema&&!b.allowMatchingProperties&&D.properties,W=I.name("valid");if(w.props!==!0&&!(w.props instanceof fA.Name))w.props=$K.evaluatedPropsToName(I,w.props);let{props:Q}=w;B();function B(){for(let H of N){if(X)Y(H);if(w.allErrors)J(H);else I.var(W,!0),J(H),I.if(W)}}function Y(H){for(let v in X)if(new RegExp(H).test(v))sM.checkStrictMode(w,`property ${v} matches pattern ${H} (use allowMatchingProperties)`)}function J(H){I.forIn("key",A,(v)=>{I.if(fA._`${eM.usePattern($,H)}.test(${v})`,()=>{let V=O.includes(H);if(!V)$.subschema({keyword:"patternProperties",schemaProp:H,dataProp:v,dataPropType:$K.Type.Str},W);if(w.opts.unevaluated&&Q!==!0)I.assign(fA._`${Q}[${v}]`,!0);else if(!V&&!w.allErrors)I.if(fA.not(W),()=>I.break())})})}}};IK.default=iZ});var AK=C((DK)=>{Object.defineProperty(DK,"__esModule",{value:!0});var dZ=N$(),pZ={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:A}=$;if(dZ.alwaysValidSchema(A,U)){$.fail();return}let D=I.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},D),$.failResult(D,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};DK.default=pZ});var bK=C((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});var aZ=H6(),eZ={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:aZ.validateUnion,error:{message:"must match a schema in anyOf"}};wK.default=eZ});var OK=C((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});var yA=a(),$g=N$(),Ig={message:"must match exactly one schema in oneOf",params:({params:$})=>yA._`{passingSchemas: ${$.passing}}`},Ug={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ig,code($){let{gen:I,schema:U,parentSchema:A,it:D}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(D.opts.discriminator&&A.discriminator)return;let w=U,b=I.let("valid",!1),N=I.let("passing",null),O=I.name("_valid");$.setParams({passing:N}),I.block(X),$.result(b,()=>$.reset(),()=>$.error(!0));function X(){w.forEach((W,Q)=>{let B;if($g.alwaysValidSchema(D,W))I.var(O,!0);else B=$.subschema({keyword:"oneOf",schemaProp:Q,compositeRule:!0},O);if(Q>0)I.if(yA._`${O} && ${b}`).assign(b,!1).assign(N,yA._`[${N}, ${Q}]`).else();I.if(O,()=>{if(I.assign(b,!0),I.assign(N,Q),B)$.mergeEvaluated(B,yA.Name)})})}}};NK.default=Ug});var WK=C((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});var Ag=N$(),wg={keyword:"allOf",schemaType:"array",code($){let{gen:I,schema:U,it:A}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");let D=I.name("valid");U.forEach((w,b)=>{if(Ag.alwaysValidSchema(A,w))return;let N=$.subschema({keyword:"allOf",schemaProp:b},D);$.ok(D),$.mergeEvaluated(N)})}};XK.default=wg});var BK=C((YK)=>{Object.defineProperty(YK,"__esModule",{value:!0});var uA=a(),QK=N$(),Ng={message:({params:$})=>uA.str`must match "${$.ifClause}" schema`,params:({params:$})=>uA._`{failingKeyword: ${$.ifClause}}`},Og={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Ng,code($){let{gen:I,parentSchema:U,it:A}=$;if(U.then===void 0&&U.else===void 0)QK.checkStrictMode(A,'"if" without "then" and "else" is ignored');let D=GK(A,"then"),w=GK(A,"else");if(!D&&!w)return;let b=I.let("valid",!0),N=I.name("_valid");if(O(),$.reset(),D&&w){let W=I.let("ifClause");$.setParams({ifClause:W}),I.if(N,X("then",W),X("else",W))}else if(D)I.if(N,X("then"));else I.if(uA.not(N),X("else"));$.pass(b,()=>$.error(!0));function O(){let W=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},N);$.mergeEvaluated(W)}function X(W,Q){return()=>{let B=$.subschema({keyword:W},N);if(I.assign(b,N),$.mergeValidEvaluated(B,b),Q)I.assign(Q,uA._`${W}`);else $.setParams({ifClause:W})}}}};function GK($,I){let U=$.schema[I];return U!==void 0&&!QK.alwaysValidSchema($,U)}YK.default=Og});var HK=C((JK)=>{Object.defineProperty(JK,"__esModule",{value:!0});var Wg=N$(),Gg={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)Wg.checkStrictMode(U,`"${$}" without "if" is ignored`)}};JK.default=Gg});var zK=C((LK)=>{Object.defineProperty(LK,"__esModule",{value:!0});var Yg=EW(),Bg=_M(),Jg=SW(),Hg=gM(),Lg=hM(),zg=mM(),Mg=iM(),Kg=kW(),vg=aM(),Vg=UK(),qg=AK(),Fg=bK(),Eg=OK(),Sg=WK(),jg=BK(),kg=HK();function Pg($=!1){let I=[qg.default,Fg.default,Eg.default,Sg.default,jg.default,kg.default,Mg.default,Kg.default,zg.default,vg.default,Vg.default];if($)I.push(Bg.default,Hg.default);else I.push(Yg.default,Jg.default);return I.push(Lg.default),I}LK.default=Pg});var KK=C((MK)=>{Object.defineProperty(MK,"__esModule",{value:!0});var j$=a(),Tg={message:({schemaCode:$})=>j$.str`must match format "${$}"`,params:({schemaCode:$})=>j$._`{format: ${$}}`},_g={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Tg,code($,I){let{gen:U,data:A,$data:D,schema:w,schemaCode:b,it:N}=$,{opts:O,errSchemaPath:X,schemaEnv:W,self:Q}=N;if(!O.validateFormats)return;if(D)B();else Y();function B(){let J=U.scopeValue("formats",{ref:Q.formats,code:O.code.formats}),H=U.const("fDef",j$._`${J}[${b}]`),v=U.let("fType"),V=U.let("format");U.if(j$._`typeof ${H} == "object" && !(${H} instanceof RegExp)`,()=>U.assign(v,j$._`${H}.type || "string"`).assign(V,j$._`${H}.validate`),()=>U.assign(v,j$._`"string"`).assign(V,H)),$.fail$data(j$.or(P(),k()));function P(){if(O.strictSchema===!1)return j$.nil;return j$._`${b} && !${V}`}function k(){let h=W.$async?j$._`(${H}.async ? await ${V}(${A}) : ${V}(${A}))`:j$._`${V}(${A})`,l=j$._`(typeof ${V} == "function" ? ${h} : ${V}.test(${A}))`;return j$._`${V} && ${V} !== true && ${v} === ${I} && !${l}`}}function Y(){let J=Q.formats[w];if(!J){P();return}if(J===!0)return;let[H,v,V]=k(J);if(H===I)$.pass(h());function P(){if(O.strictSchema===!1){Q.logger.warn(l());return}throw new Error(l());function l(){return`unknown format "${w}" ignored in schema at path "${X}"`}}function k(l){let l$=l instanceof RegExp?j$.regexpCode(l):O.code.formats?j$._`${O.code.formats}${j$.getProperty(w)}`:void 0,G6=U.scopeValue("formats",{key:w,ref:l,code:l$});if(typeof l=="object"&&!(l instanceof RegExp))return[l.type||"string",l.validate,j$._`${G6}.validate`];return["string",l,G6]}function h(){if(typeof J=="object"&&!(J instanceof RegExp)&&J.async){if(!W.$async)throw new Error("async format in sync schema");return j$._`await ${V}(${A})`}return typeof v=="function"?j$._`${V}(${A})`:j$._`${V}.test(${A})`}}}};MK.default=_g});var VK=C((vK)=>{Object.defineProperty(vK,"__esModule",{value:!0});var Zg=KK(),gg=[Zg.default];vK.default=gg});var EK=C((qK)=>{Object.defineProperty(qK,"__esModule",{value:!0});qK.contentVocabulary=qK.metadataVocabulary=void 0;qK.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];qK.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kK=C((jK)=>{Object.defineProperty(jK,"__esModule",{value:!0});var fg=t3(),yg=qM(),ug=zK(),lg=VK(),SK=EK(),cg=[fg.default,yg.default,ug.default(),lg.default,SK.metadataVocabulary,SK.contentVocabulary];jK.default=cg});var _K=C((RK)=>{Object.defineProperty(RK,"__esModule",{value:!0});RK.DiscrError=void 0;var PK;(function($){$.Tag="tag",$.Mapping="mapping"})(PK||(RK.DiscrError=PK={}))});var gK=C((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});var xI=a(),RW=_K(),CK=vA(),rg=KU(),ng=N$(),ig={message:({params:{discrError:$,tagName:I}})=>$===RW.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>xI._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},og={keyword:"discriminator",type:"object",schemaType:"object",error:ig,code($){let{gen:I,data:U,schema:A,parentSchema:D,it:w}=$,{oneOf:b}=D;if(!w.opts.discriminator)throw new Error("discriminator: requires discriminator option");let N=A.propertyName;if(typeof N!="string")throw new Error("discriminator: requires propertyName");if(A.mapping)throw new Error("discriminator: mapping is not supported");if(!b)throw new Error("discriminator: requires oneOf keyword");let O=I.let("valid",!1),X=I.const("tag",xI._`${U}${xI.getProperty(N)}`);I.if(xI._`typeof ${X} == "string"`,()=>W(),()=>$.error(!1,{discrError:RW.DiscrError.Tag,tag:X,tagName:N})),$.ok(O);function W(){let Y=B();I.if(!1);for(let J in Y)I.elseIf(xI._`${X} === ${J}`),I.assign(O,Q(Y[J]));I.else(),$.error(!1,{discrError:RW.DiscrError.Mapping,tag:X,tagName:N}),I.endIf()}function Q(Y){let J=I.name("valid"),H=$.subschema({keyword:"oneOf",schemaProp:Y},J);return $.mergeEvaluated(H,xI.Name),J}function B(){var Y;let J={},H=V(D),v=!0;for(let h=0;h<b.length;h++){let l=b[h];if((l===null||l===void 0?void 0:l.$ref)&&!ng.schemaHasRulesButRef(l,w.self.RULES)){let G6=l.$ref;if(l=CK.resolveRef.call(w.self,w.schemaEnv.root,w.baseId,G6),l instanceof CK.SchemaEnv)l=l.schema;if(l===void 0)throw new rg.default(w.opts.uriResolver,w.baseId,G6)}let l$=(Y=l===null||l===void 0?void 0:l.properties)===null||Y===void 0?void 0:Y[N];if(typeof l$!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${N}"`);v=v&&(H||V(l)),P(l$,h)}if(!v)throw new Error(`discriminator: "${N}" must be required`);return J;function V({required:h}){return Array.isArray(h)&&h.includes(N)}function P(h,l){if(h.const)k(h.const,l);else if(h.enum)for(let l$ of h.enum)k(l$,l);else throw new Error(`discriminator: "properties/${N}" must have "const" or "enum"`)}function k(h,l){if(typeof h!="string"||h in J)throw new Error(`discriminator: "${N}" values must be unique strings`);J[h]=l}}}};ZK.default=og});var xK=C((wd,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 _W=C((I6,TW)=>{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=u3(),ag=kK(),eg=gK(),hK=xK(),sg=["/properties"],lA="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(hK,sg):hK;this.addMetaSchema($,lA,!1),this.refs["http://json-schema.org/schema"]=lA}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(lA)?lA:void 0)}}I6.Ajv=_U;TW.exports=I6=_U;TW.exports.Ajv=_U;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=_U;var $x=MU();Object.defineProperty(I6,"KeywordCxt",{enumerable:!0,get:function(){return $x.KeywordCxt}});var hI=a();Object.defineProperty(I6,"_",{enumerable:!0,get:function(){return hI._}});Object.defineProperty(I6,"str",{enumerable:!0,get:function(){return hI.str}});Object.defineProperty(I6,"stringify",{enumerable:!0,get:function(){return hI.stringify}});Object.defineProperty(I6,"nil",{enumerable:!0,get:function(){return hI.nil}});Object.defineProperty(I6,"Name",{enumerable:!0,get:function(){return hI.Name}});Object.defineProperty(I6,"CodeGen",{enumerable:!0,get:function(){return hI.CodeGen}});var Ix=MA();Object.defineProperty(I6,"ValidationError",{enumerable:!0,get:function(){return Ix.default}});var Ux=KU();Object.defineProperty(I6,"MissingRefError",{enumerable:!0,get:function(){return Ux.default}})});var oK=C((nK)=>{Object.defineProperty(nK,"__esModule",{value:!0});nK.formatNames=nK.fastFormats=nK.fullFormats=void 0;function y6($,I){return{validate:$,compare:I}}nK.fullFormats={date:y6(lK,xW),time:y6(ZW(!0),hW),"date-time":y6(fK(!0),mK),"iso-time":y6(ZW(),cK),"iso-date-time":y6(fK(),rK),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Wx,"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:Gx,int32:{type:"number",validate:Bx},int64:{type:"number",validate:Jx},float:{type:"number",validate:uK},double:{type:"number",validate:uK},password:!0,binary:!0};nK.fastFormats={...nK.fullFormats,date:y6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,xW),time:y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,hW),"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,mK),"iso-time":y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,cK),"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,rK),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};nK.formatNames=Object.keys(nK.fullFormats);function wx($){return $%4===0&&($%100!==0||$%400===0)}var bx=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Nx=[0,31,28,31,30,31,30,31,31,30,31,30,31];function lK($){let I=bx.exec($);if(!I)return!1;let U=+I[1],A=+I[2],D=+I[3];return A>=1&&A<=12&&D>=1&&D<=(A===2&&wx(U)?29:Nx[A])}function xW($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var CW=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function ZW($){return function I(U){let A=CW.exec(U);if(!A)return!1;let D=+A[1],w=+A[2],b=+A[3],N=A[4],O=A[5]==="-"?-1:1,X=+(A[6]||0),W=+(A[7]||0);if(X>23||W>59||$&&!N)return!1;if(D<=23&&w<=59&&b<60)return!0;let Q=w-W*O,B=D-X*O-(Q<0?1:0);return(B===23||B===-1)&&(Q===59||Q===-1)&&b<61}}function hW($,I){if(!($&&I))return;let U=new Date("2020-01-01T"+$).valueOf(),A=new Date("2020-01-01T"+I).valueOf();if(!(U&&A))return;return U-A}function cK($,I){if(!($&&I))return;let U=CW.exec($),A=CW.exec(I);if(!(U&&A))return;if($=U[1]+U[2]+U[3],I=A[1]+A[2]+A[3],$>I)return 1;if($<I)return-1;return 0}var gW=/t|\s/i;function fK($){let I=ZW($);return function U(A){let D=A.split(gW);return D.length===2&&lK(D[0])&&I(D[1])}}function mK($,I){if(!($&&I))return;let U=new Date($).valueOf(),A=new Date(I).valueOf();if(!(U&&A))return;return U-A}function rK($,I){if(!($&&I))return;let[U,A]=$.split(gW),[D,w]=I.split(gW),b=xW(U,D);if(b===void 0)return;return b||hW(A,w)}var Ox=/\/|:/,Xx=/^(?:[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 Wx($){return Ox.test($)&&Xx.test($)}var yK=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Gx($){return yK.lastIndex=0,yK.test($)}var Qx=-2147483648,Yx=2147483647;function Bx($){return Number.isInteger($)&&$<=Yx&&$>=Qx}function Jx($){return Number.isInteger($)}function uK(){return!0}var Hx=/[^\\]\\Z/;function Lx($){if(Hx.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var pK=C((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});dK.formatLimitDefinition=void 0;var Mx=_W(),R6=a(),q4=R6.operators,cA={formatMaximum:{okStr:"<=",ok:q4.LTE,fail:q4.GT},formatMinimum:{okStr:">=",ok:q4.GTE,fail:q4.LT},formatExclusiveMaximum:{okStr:"<",ok:q4.LT,fail:q4.GTE},formatExclusiveMinimum:{okStr:">",ok:q4.GT,fail:q4.LTE}},Kx={message:({keyword:$,schemaCode:I})=>R6.str`should be ${cA[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>R6._`{comparison: ${cA[$].okStr}, limit: ${I}}`};dK.formatLimitDefinition={keyword:Object.keys(cA),type:"string",schemaType:"string",$data:!0,error:Kx,code($){let{gen:I,data:U,schemaCode:A,keyword:D,it:w}=$,{opts:b,self:N}=w;if(!b.validateFormats)return;let O=new Mx.KeywordCxt(w,N.RULES.all.format.definition,"format");if(O.$data)X();else W();function X(){let B=I.scopeValue("formats",{ref:N.formats,code:b.code.formats}),Y=I.const("fmt",R6._`${B}[${O.schemaCode}]`);$.fail$data(R6.or(R6._`typeof ${Y} != "object"`,R6._`${Y} instanceof RegExp`,R6._`typeof ${Y}.compare != "function"`,Q(Y)))}function W(){let B=O.schema,Y=N.formats[B];if(!Y||Y===!0)return;if(typeof Y!="object"||Y instanceof RegExp||typeof Y.compare!="function")throw new Error(`"${D}": format "${B}" does not define "compare" function`);let J=I.scopeValue("formats",{key:B,ref:Y,code:b.code.formats?R6._`${b.code.formats}${R6.getProperty(B)}`:void 0});$.fail$data(Q(J))}function Q(B){return R6._`${B}.compare(${U}, ${A}) ${cA[D].fail} 0`}},dependencies:["format"]};var vx=($)=>{return $.addKeyword(dK.formatLimitDefinition),$};dK.default=vx});var sK=C((CU,eK)=>{Object.defineProperty(CU,"__esModule",{value:!0});var fI=oK(),qx=pK(),uW=a(),tK=new uW.Name("fullFormats"),Fx=new uW.Name("fastFormats"),lW=($,I={keywords:!0})=>{if(Array.isArray(I))return aK($,I,fI.fullFormats,tK),$;let[U,A]=I.mode==="fast"?[fI.fastFormats,Fx]:[fI.fullFormats,tK],D=I.formats||fI.formatNames;if(aK($,D,U,A),I.keywords)qx.default($);return $};lW.get=($,I="full")=>{let A=(I==="fast"?fI.fastFormats:fI.fullFormats)[$];if(!A)throw new Error(`Unknown format "${$}"`);return A};function aK($,I,U,A){var D,w;(D=(w=$.opts.code).formats)!==null&&D!==void 0||(w.formats=uW._`require("ajv-formats/dist/formats").${A}`);for(let b of I)$.addFormat(b,U[b])}eK.exports=CU=lW;Object.defineProperty(CU,"__esModule",{value:!0});CU.default=lW});var $$;(function($){$.assertEqual=(D)=>{};function I(D){}$.assertIs=I;function U(D){throw new Error}$.assertNever=U,$.arrayToEnum=(D)=>{let w={};for(let b of D)w[b]=b;return w},$.getValidEnumValues=(D)=>{let w=$.objectKeys(D).filter((N)=>typeof D[D[N]]!=="number"),b={};for(let N of w)b[N]=D[N];return $.objectValues(b)},$.objectValues=(D)=>{return $.objectKeys(D).map(function(w){return D[w]})},$.objectKeys=typeof Object.keys==="function"?(D)=>Object.keys(D):(D)=>{let w=[];for(let b in D)if(Object.prototype.hasOwnProperty.call(D,b))w.push(b);return w},$.find=(D,w)=>{for(let b of D)if(w(b))return b;return},$.isInteger=typeof Number.isInteger==="function"?(D)=>Number.isInteger(D):(D)=>typeof D==="number"&&Number.isFinite(D)&&Math.floor(D)===D;function A(D,w=" | "){return D.map((b)=>typeof b==="string"?`'${b}'`:b).join(w)}$.joinValues=A,$.jsonStringifyReplacer=(D,w)=>{if(typeof w==="bigint")return w.toString();return w}})($$||($$={}));var Z5;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(Z5||(Z5={}));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 q=$$.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 w6 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(D){return D.message},U={_errors:[]},A=(D)=>{for(let w of D.issues)if(w.code==="invalid_union")w.unionErrors.map(A);else if(w.code==="invalid_return_type")A(w.returnTypeError);else if(w.code==="invalid_arguments")A(w.argumentsError);else if(w.path.length===0)U._errors.push(I(w));else{let b=U,N=0;while(N<w.path.length){let O=w.path[N];if(N!==w.path.length-1)b[O]=b[O]||{_errors:[]};else b[O]=b[O]||{_errors:[]},b[O]._errors.push(I(w));b=b[O],N++}}};return A(this),U}static assert($){if(!($ instanceof w6))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 A of this.issues)if(A.path.length>0){let D=A.path[0];I[D]=I[D]||[],I[D].push($(A))}else U.push($(A));return{formErrors:U,fieldErrors:I}}get formErrors(){return this.flatten()}}w6.create=($)=>{return new w6($)};var AE=($,I)=>{let U;switch($.code){case q.invalid_type:if($.received===R.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case q.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,$$.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:U=`Unrecognized key(s) in object: ${$$.joinValues($.keys,", ")}`;break;case q.invalid_union:U="Invalid input";break;case q.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${$$.joinValues($.options)}`;break;case q.invalid_enum_value:U=`Invalid enum value. Expected ${$$.joinValues($.options)}, received '${$.received}'`;break;case q.invalid_arguments:U="Invalid function arguments";break;case q.invalid_return_type:U="Invalid function return type";break;case q.invalid_date:U="Invalid date";break;case q.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 q.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 q.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 q.custom:U="Invalid input";break;case q.invalid_intersection_types:U="Intersection results could not be merged";break;case q.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case q.not_finite:U="Number must be finite";break;default:U=I.defaultError,$$.assertNever($)}return{message:U}},O4=AE;var wE=O4;function k1(){return wE}var UD=($)=>{let{data:I,path:U,errorMaps:A,issueData:D}=$,w=[...U,...D.path||[]],b={...D,path:w};if(D.message!==void 0)return{...D,path:w,message:D.message};let N="",O=A.filter((X)=>!!X).slice().reverse();for(let X of O)N=X(b,{data:I,defaultError:N}).message;return{...D,path:w,message:N}};function T($,I){let U=k1(),A=UD({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===O4?void 0:O4].filter((D)=>!!D)});$.common.issues.push(A)}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 A of I){if(A.status==="aborted")return r;if(A.status==="dirty")$.dirty();U.push(A.value)}return{status:$.value,value:U}}static async mergeObjectAsync($,I){let U=[];for(let A of I){let D=await A.key,w=await A.value;U.push({key:D,value:w})}return f$.mergeObjectSync($,U)}static mergeObjectSync($,I){let U={};for(let A of I){let{key:D,value:w}=A;if(D.status==="aborted")return r;if(w.status==="aborted")return r;if(D.status==="dirty")$.dirty();if(w.status==="dirty")$.dirty();if(D.value!=="__proto__"&&(typeof w.value!=="undefined"||A.alwaysSet))U[D.value]=w.value}return{status:$.value,value:U}}}var r=Object.freeze({status:"aborted"}),BI=($)=>({status:"dirty",value:$}),c$=($)=>({status:"valid",value:$}),sb=($)=>$.status==="aborted",$N=($)=>$.status==="dirty",y4=($)=>$.status==="valid",P1=($)=>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,A){this._cachedPath=[],this.parent=$,this.data=I,this._path=U,this._key=A}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 g5=($,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 w6($.common.issues);return this._error=U,this._error}}}};function d($){if(!$)return{};let{errorMap:I,invalid_type_error:U,required_error:A,description:D}=$;if(I&&(U||A))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(I)return{errorMap:I,description:D};return{errorMap:(b,N)=>{let{message:O}=$;if(b.code==="invalid_enum_value")return{message:O??N.defaultError};if(typeof N.data==="undefined")return{message:O??A??N.defaultError};if(b.code!=="invalid_type")return{message:N.defaultError};return{message:O??U??N.defaultError}},description:D}}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(P1(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($)},A=this._parseSync({data:$,path:U.path,parent:U});return g5(U,A)}"~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($)},A=this._parse({data:$,path:U.path,parent:U}),D=await(P1(A)?A:Promise.resolve(A));return g5(U,D)}refine($,I){let U=(A)=>{if(typeof I==="string"||typeof I==="undefined")return{message:I};else if(typeof I==="function")return I(A);else return I};return this._refinement((A,D)=>{let w=$(A),b=()=>D.addIssue({code:q.custom,...U(A)});if(typeof Promise!=="undefined"&&w instanceof Promise)return w.then((N)=>{if(!N)return b(),!1;else return!0});if(!w)return b(),!1;else return!0})}refinement($,I){return this._refinement((U,A)=>{if(!$(U))return A.addIssue(typeof I==="function"?I(U,A):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 Q6.create(this,this._def)}nullable(){return X4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z6.create(this)}promise(){return MI.create(this,this._def)}or($){return Z1.create([this,$],this._def)}and($){return g1.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 y1({...d(this._def),innerType:this,defaultValue:I,typeName:F.ZodDefault})}brand(){return new AN({typeName:F.ZodBranded,type:this,...d(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new u1({...d(this._def),innerType:this,catchValue:I,typeName:F.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return WD.create(this,$)}readonly(){return l1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var bE=/^c[^\s-]{8,}$/i,NE=/^[0-9a-z]+$/,OE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,XE=/^[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,WE=/^[a-z0-9_-]{21}$/i,GE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QE=/^[-+]?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)?)??$/,YE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,BE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",IN,JE=/^(?:(?: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])$/,HE=/^(?:(?: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])$/,LE=/^(([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]))$/,zE=/^(([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])$/,ME=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,KE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,x5="((\\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])))",vE=new RegExp(`^${x5}$`);function h5($){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 VE($){return new RegExp(`^${h5($)}$`)}function qE($){let I=`${x5}T${h5($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function FE($,I){if((I==="v4"||!I)&&JE.test($))return!0;if((I==="v6"||!I)&&LE.test($))return!0;return!1}function EE($,I){if(!GE.test($))return!1;try{let[U]=$.split(".");if(!U)return!1;let A=U.replace(/-/g,"+").replace(/_/g,"/").padEnd(U.length+(4-U.length%4)%4,"="),D=JSON.parse(atob(A));if(typeof D!=="object"||D===null)return!1;if("typ"in D&&D?.typ!=="JWT")return!1;if(!D.alg)return!1;if(I&&D.alg!==I)return!1;return!0}catch{return!1}}function SE($,I){if((I==="v4"||!I)&&HE.test($))return!0;if((I==="v6"||!I)&&zE.test($))return!0;return!1}class p6 extends e{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==R.string){let D=this._getOrReturnCtx($);return T(D,{code:q.invalid_type,expected:R.string,received:D.parsedType}),r}let U=new f$,A=void 0;for(let D of this._def.checks)if(D.kind==="min"){if($.data.length<D.value)A=this._getOrReturnCtx($,A),T(A,{code:q.too_small,minimum:D.value,type:"string",inclusive:!0,exact:!1,message:D.message}),U.dirty()}else if(D.kind==="max"){if($.data.length>D.value)A=this._getOrReturnCtx($,A),T(A,{code:q.too_big,maximum:D.value,type:"string",inclusive:!0,exact:!1,message:D.message}),U.dirty()}else if(D.kind==="length"){let w=$.data.length>D.value,b=$.data.length<D.value;if(w||b){if(A=this._getOrReturnCtx($,A),w)T(A,{code:q.too_big,maximum:D.value,type:"string",inclusive:!0,exact:!0,message:D.message});else if(b)T(A,{code:q.too_small,minimum:D.value,type:"string",inclusive:!0,exact:!0,message:D.message});U.dirty()}}else if(D.kind==="email"){if(!YE.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"email",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="emoji"){if(!IN)IN=new RegExp(BE,"u");if(!IN.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"emoji",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="uuid"){if(!XE.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"uuid",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="nanoid"){if(!WE.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"nanoid",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="cuid"){if(!bE.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"cuid",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="cuid2"){if(!NE.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"cuid2",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="ulid"){if(!OE.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"ulid",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="url")try{new URL($.data)}catch{A=this._getOrReturnCtx($,A),T(A,{validation:"url",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="regex"){if(D.regex.lastIndex=0,!D.regex.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"regex",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="trim")$.data=$.data.trim();else if(D.kind==="includes"){if(!$.data.includes(D.value,D.position))A=this._getOrReturnCtx($,A),T(A,{code:q.invalid_string,validation:{includes:D.value,position:D.position},message:D.message}),U.dirty()}else if(D.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(D.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(D.kind==="startsWith"){if(!$.data.startsWith(D.value))A=this._getOrReturnCtx($,A),T(A,{code:q.invalid_string,validation:{startsWith:D.value},message:D.message}),U.dirty()}else if(D.kind==="endsWith"){if(!$.data.endsWith(D.value))A=this._getOrReturnCtx($,A),T(A,{code:q.invalid_string,validation:{endsWith:D.value},message:D.message}),U.dirty()}else if(D.kind==="datetime"){if(!qE(D).test($.data))A=this._getOrReturnCtx($,A),T(A,{code:q.invalid_string,validation:"datetime",message:D.message}),U.dirty()}else if(D.kind==="date"){if(!vE.test($.data))A=this._getOrReturnCtx($,A),T(A,{code:q.invalid_string,validation:"date",message:D.message}),U.dirty()}else if(D.kind==="time"){if(!VE(D).test($.data))A=this._getOrReturnCtx($,A),T(A,{code:q.invalid_string,validation:"time",message:D.message}),U.dirty()}else if(D.kind==="duration"){if(!QE.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"duration",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="ip"){if(!FE($.data,D.version))A=this._getOrReturnCtx($,A),T(A,{validation:"ip",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="jwt"){if(!EE($.data,D.alg))A=this._getOrReturnCtx($,A),T(A,{validation:"jwt",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="cidr"){if(!SE($.data,D.version))A=this._getOrReturnCtx($,A),T(A,{validation:"cidr",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="base64"){if(!ME.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"base64",code:q.invalid_string,message:D.message}),U.dirty()}else if(D.kind==="base64url"){if(!KE.test($.data))A=this._getOrReturnCtx($,A),T(A,{validation:"base64url",code:q.invalid_string,message:D.message}),U.dirty()}else $$.assertNever(D);return{status:U.value,value:$.data}}_regex($,I,U){return this.refinement((A)=>$.test(A),{validation:I,code:q.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 jE($,I){let U=($.toString().split(".")[1]||"").length,A=(I.toString().split(".")[1]||"").length,D=U>A?U:A,w=Number.parseInt($.toFixed(D).replace(".","")),b=Number.parseInt(I.toFixed(D).replace(".",""));return w%b/10**D}class HI 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 D=this._getOrReturnCtx($);return T(D,{code:q.invalid_type,expected:R.number,received:D.parsedType}),r}let U=void 0,A=new f$;for(let D of this._def.checks)if(D.kind==="int"){if(!$$.isInteger($.data))U=this._getOrReturnCtx($,U),T(U,{code:q.invalid_type,expected:"integer",received:"float",message:D.message}),A.dirty()}else if(D.kind==="min"){if(D.inclusive?$.data<D.value:$.data<=D.value)U=this._getOrReturnCtx($,U),T(U,{code:q.too_small,minimum:D.value,type:"number",inclusive:D.inclusive,exact:!1,message:D.message}),A.dirty()}else if(D.kind==="max"){if(D.inclusive?$.data>D.value:$.data>=D.value)U=this._getOrReturnCtx($,U),T(U,{code:q.too_big,maximum:D.value,type:"number",inclusive:D.inclusive,exact:!1,message:D.message}),A.dirty()}else if(D.kind==="multipleOf"){if(jE($.data,D.value)!==0)U=this._getOrReturnCtx($,U),T(U,{code:q.not_multiple_of,multipleOf:D.value,message:D.message}),A.dirty()}else if(D.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),T(U,{code:q.not_finite,message:D.message}),A.dirty()}else $$.assertNever(D);return{status:A.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,A){return new HI({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(A)}]})}_addCheck($){return new HI({...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($)}}HI.create=($)=>{return new HI({checks:[],typeName:F.ZodNumber,coerce:$?.coerce||!1,...d($)})};class LI 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,A=new f$;for(let D of this._def.checks)if(D.kind==="min"){if(D.inclusive?$.data<D.value:$.data<=D.value)U=this._getOrReturnCtx($,U),T(U,{code:q.too_small,type:"bigint",minimum:D.value,inclusive:D.inclusive,message:D.message}),A.dirty()}else if(D.kind==="max"){if(D.inclusive?$.data>D.value:$.data>=D.value)U=this._getOrReturnCtx($,U),T(U,{code:q.too_big,type:"bigint",maximum:D.value,inclusive:D.inclusive,message:D.message}),A.dirty()}else if(D.kind==="multipleOf"){if($.data%D.value!==BigInt(0))U=this._getOrReturnCtx($,U),T(U,{code:q.not_multiple_of,multipleOf:D.value,message:D.message}),A.dirty()}else $$.assertNever(D);return{status:A.value,value:$.data}}_getInvalidInput($){let I=this._getOrReturnCtx($);return T(I,{code:q.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,A){return new LI({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(A)}]})}_addCheck($){return new LI({...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 $}}LI.create=($)=>{return new LI({checks:[],typeName:F.ZodBigInt,coerce:$?.coerce??!1,...d($)})};class DD extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.boolean,received:U.parsedType}),r}return c$($.data)}}DD.create=($)=>{return new DD({typeName:F.ZodBoolean,coerce:$?.coerce||!1,...d($)})};class T1 extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let D=this._getOrReturnCtx($);return T(D,{code:q.invalid_type,expected:R.date,received:D.parsedType}),r}if(Number.isNaN($.data.getTime())){let D=this._getOrReturnCtx($);return T(D,{code:q.invalid_date}),r}let U=new f$,A=void 0;for(let D of this._def.checks)if(D.kind==="min"){if($.data.getTime()<D.value)A=this._getOrReturnCtx($,A),T(A,{code:q.too_small,message:D.message,inclusive:!0,exact:!1,minimum:D.value,type:"date"}),U.dirty()}else if(D.kind==="max"){if($.data.getTime()>D.value)A=this._getOrReturnCtx($,A),T(A,{code:q.too_big,message:D.message,inclusive:!0,exact:!1,maximum:D.value,type:"date"}),U.dirty()}else $$.assertNever(D);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new T1({...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}}T1.create=($)=>{return new T1({checks:[],coerce:$?.coerce||!1,typeName:F.ZodDate,...d($)})};class AD extends e{_parse($){if(this._getType($)!==R.symbol){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.symbol,received:U.parsedType}),r}return c$($.data)}}AD.create=($)=>{return new AD({typeName:F.ZodSymbol,...d($)})};class _1 extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.undefined,received:U.parsedType}),r}return c$($.data)}}_1.create=($)=>{return new _1({typeName:F.ZodUndefined,...d($)})};class C1 extends e{_parse($){if(this._getType($)!==R.null){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.null,received:U.parsedType}),r}return c$($.data)}}C1.create=($)=>{return new C1({typeName:F.ZodNull,...d($)})};class wD extends e{constructor(){super(...arguments);this._any=!0}_parse($){return c$($.data)}}wD.create=($)=>{return new wD({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:q.invalid_type,expected:R.never,received:I.parsedType}),r}}t6.create=($)=>{return new t6({typeName:F.ZodNever,...d($)})};class bD extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.void,received:U.parsedType}),r}return c$($.data)}}bD.create=($)=>{return new bD({typeName:F.ZodVoid,...d($)})};class Z6 extends e{_parse($){let{ctx:I,status:U}=this._processInputParams($),A=this._def;if(I.parsedType!==R.array)return T(I,{code:q.invalid_type,expected:R.array,received:I.parsedType}),r;if(A.exactLength!==null){let w=I.data.length>A.exactLength.value,b=I.data.length<A.exactLength.value;if(w||b)T(I,{code:w?q.too_big:q.too_small,minimum:b?A.exactLength.value:void 0,maximum:w?A.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:A.exactLength.message}),U.dirty()}if(A.minLength!==null){if(I.data.length<A.minLength.value)T(I,{code:q.too_small,minimum:A.minLength.value,type:"array",inclusive:!0,exact:!1,message:A.minLength.message}),U.dirty()}if(A.maxLength!==null){if(I.data.length>A.maxLength.value)T(I,{code:q.too_big,maximum:A.maxLength.value,type:"array",inclusive:!0,exact:!1,message:A.maxLength.message}),U.dirty()}if(I.common.async)return Promise.all([...I.data].map((w,b)=>{return A.type._parseAsync(new v6(I,w,I.path,b))})).then((w)=>{return f$.mergeArray(U,w)});let D=[...I.data].map((w,b)=>{return A.type._parseSync(new v6(I,w,I.path,b))});return f$.mergeArray(U,D)}get element(){return this._def.type}min($,I){return new Z6({...this._def,minLength:{value:$,message:x.toString(I)}})}max($,I){return new Z6({...this._def,maxLength:{value:$,message:x.toString(I)}})}length($,I){return new Z6({...this._def,exactLength:{value:$,message:x.toString(I)}})}nonempty($){return this.min(1,$)}}Z6.create=($,I)=>{return new Z6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...d(I)})};function JI($){if($ instanceof S$){let I={};for(let U in $.shape){let A=$.shape[U];I[U]=Q6.create(JI(A))}return new S$({...$._def,shape:()=>I})}else if($ instanceof Z6)return new Z6({...$._def,type:JI($.element)});else if($ instanceof Q6)return Q6.create(JI($.unwrap()));else if($ instanceof X4)return X4.create(JI($.unwrap()));else if($ instanceof a6)return a6.create($.items.map((I)=>JI(I)));else return $}class S$ 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 O=this._getOrReturnCtx($);return T(O,{code:q.invalid_type,expected:R.object,received:O.parsedType}),r}let{status:U,ctx:A}=this._processInputParams($),{shape:D,keys:w}=this._getCached(),b=[];if(!(this._def.catchall instanceof t6&&this._def.unknownKeys==="strip")){for(let O in A.data)if(!w.includes(O))b.push(O)}let N=[];for(let O of w){let X=D[O],W=A.data[O];N.push({key:{status:"valid",value:O},value:X._parse(new v6(A,W,A.path,O)),alwaysSet:O in A.data})}if(this._def.catchall instanceof t6){let O=this._def.unknownKeys;if(O==="passthrough")for(let X of b)N.push({key:{status:"valid",value:X},value:{status:"valid",value:A.data[X]}});else if(O==="strict"){if(b.length>0)T(A,{code:q.unrecognized_keys,keys:b}),U.dirty()}else if(O==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let O=this._def.catchall;for(let X of b){let W=A.data[X];N.push({key:{status:"valid",value:X},value:O._parse(new v6(A,W,A.path,X)),alwaysSet:X in A.data})}}if(A.common.async)return Promise.resolve().then(async()=>{let O=[];for(let X of N){let W=await X.key,Q=await X.value;O.push({key:W,value:Q,alwaysSet:X.alwaysSet})}return O}).then((O)=>{return f$.mergeObjectSync(U,O)});else return f$.mergeObjectSync(U,N)}get shape(){return this._def.shape()}strict($){return x.errToObj,new S$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(I,U)=>{let A=this._def.errorMap?.(I,U).message??U.defaultError;if(I.code==="unrecognized_keys")return{message:x.errToObj($).message??A};return{message:A}}}:{}})}strip(){return new S$({...this._def,unknownKeys:"strip"})}passthrough(){return new S$({...this._def,unknownKeys:"passthrough"})}extend($){return new S$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new S$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:F.ZodObject})}setKey($,I){return this.augment({[$]:I})}catchall($){return new S$({...this._def,catchall:$})}pick($){let I={};for(let U of $$.objectKeys($))if($[U]&&this.shape[U])I[U]=this.shape[U];return new S$({...this._def,shape:()=>I})}omit($){let I={};for(let U of $$.objectKeys(this.shape))if(!$[U])I[U]=this.shape[U];return new S$({...this._def,shape:()=>I})}deepPartial(){return JI(this)}partial($){let I={};for(let U of $$.objectKeys(this.shape)){let A=this.shape[U];if($&&!$[U])I[U]=A;else I[U]=A.optional()}return new S$({...this._def,shape:()=>I})}required($){let I={};for(let U of $$.objectKeys(this.shape))if($&&!$[U])I[U]=this.shape[U];else{let D=this.shape[U];while(D instanceof Q6)D=D._def.innerType;I[U]=D}return new S$({...this._def,shape:()=>I})}keyof(){return f5($$.objectKeys(this.shape))}}S$.create=($,I)=>{return new S$({shape:()=>$,unknownKeys:"strip",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};S$.strictCreate=($,I)=>{return new S$({shape:()=>$,unknownKeys:"strict",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};S$.lazycreate=($,I)=>{return new S$({shape:$,unknownKeys:"strip",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};class Z1 extends e{_parse($){let{ctx:I}=this._processInputParams($),U=this._def.options;function A(D){for(let b of D)if(b.result.status==="valid")return b.result;for(let b of D)if(b.result.status==="dirty")return I.common.issues.push(...b.ctx.common.issues),b.result;let w=D.map((b)=>new w6(b.ctx.common.issues));return T(I,{code:q.invalid_union,unionErrors:w}),r}if(I.common.async)return Promise.all(U.map(async(D)=>{let w={...I,common:{...I.common,issues:[]},parent:null};return{result:await D._parseAsync({data:I.data,path:I.path,parent:w}),ctx:w}})).then(A);else{let D=void 0,w=[];for(let N of U){let O={...I,common:{...I.common,issues:[]},parent:null},X=N._parseSync({data:I.data,path:I.path,parent:O});if(X.status==="valid")return X;else if(X.status==="dirty"&&!D)D={result:X,ctx:O};if(O.common.issues.length)w.push(O.common.issues)}if(D)return I.common.issues.push(...D.ctx.common.issues),D.result;let b=w.map((N)=>new w6(N));return T(I,{code:q.invalid_union,unionErrors:b}),r}}get options(){return this._def.options}}Z1.create=($,I)=>{return new Z1({options:$,typeName:F.ZodUnion,...d(I)})};var d6=($)=>{if($ instanceof x1)return d6($.schema);else if($ instanceof g6)return d6($.innerType());else if($ instanceof h1)return[$.value];else if($ instanceof l4)return $.options;else if($ instanceof f1)return $$.objectValues($.enum);else if($ instanceof y1)return d6($._def.innerType);else if($ instanceof _1)return[void 0];else if($ instanceof C1)return[null];else if($ instanceof Q6)return[void 0,...d6($.unwrap())];else if($ instanceof X4)return[null,...d6($.unwrap())];else if($ instanceof AN)return d6($.unwrap());else if($ instanceof l1)return d6($.unwrap());else if($ instanceof u1)return d6($._def.innerType);else return[]};class DN extends e{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.object)return T(I,{code:q.invalid_type,expected:R.object,received:I.parsedType}),r;let U=this.discriminator,A=I.data[U],D=this.optionsMap.get(A);if(!D)return T(I,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),r;if(I.common.async)return D._parseAsync({data:I.data,path:I.path,parent:I});else return D._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 A=new Map;for(let D of I){let w=d6(D.shape[$]);if(!w.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let b of w){if(A.has(b))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(b)}`);A.set(b,D)}}return new DN({typeName:F.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:A,...d(U)})}}function UN($,I){let U=o6($),A=o6(I);if($===I)return{valid:!0,data:$};else if(U===R.object&&A===R.object){let D=$$.objectKeys(I),w=$$.objectKeys($).filter((N)=>D.indexOf(N)!==-1),b={...$,...I};for(let N of w){let O=UN($[N],I[N]);if(!O.valid)return{valid:!1};b[N]=O.data}return{valid:!0,data:b}}else if(U===R.array&&A===R.array){if($.length!==I.length)return{valid:!1};let D=[];for(let w=0;w<$.length;w++){let b=$[w],N=I[w],O=UN(b,N);if(!O.valid)return{valid:!1};D.push(O.data)}return{valid:!0,data:D}}else if(U===R.date&&A===R.date&&+$===+I)return{valid:!0,data:$};else return{valid:!1}}class g1 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($),A=(D,w)=>{if(sb(D)||sb(w))return r;let b=UN(D.value,w.value);if(!b.valid)return T(U,{code:q.invalid_intersection_types}),r;if($N(D)||$N(w))I.dirty();return{status:I.value,value:b.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(([D,w])=>A(D,w));else return A(this._def.left._parseSync({data:U.data,path:U.path,parent:U}),this._def.right._parseSync({data:U.data,path:U.path,parent:U}))}}g1.create=($,I,U)=>{return new g1({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:q.invalid_type,expected:R.array,received:U.parsedType}),r;if(U.data.length<this._def.items.length)return T(U,{code:q.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:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I.dirty();let D=[...U.data].map((w,b)=>{let N=this._def.items[b]||this._def.rest;if(!N)return null;return N._parse(new v6(U,w,U.path,b))}).filter((w)=>!!w);if(U.common.async)return Promise.all(D).then((w)=>{return f$.mergeArray(I,w)});else return f$.mergeArray(I,D)}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 ND 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:q.invalid_type,expected:R.object,received:U.parsedType}),r;let A=[],D=this._def.keyType,w=this._def.valueType;for(let b in U.data)A.push({key:D._parse(new v6(U,b,U.path,b)),value:w._parse(new v6(U,U.data[b],U.path,b)),alwaysSet:b in U.data});if(U.common.async)return f$.mergeObjectAsync(I,A);else return f$.mergeObjectSync(I,A)}get element(){return this._def.valueType}static create($,I,U){if(I instanceof e)return new ND({keyType:$,valueType:I,typeName:F.ZodRecord,...d(U)});return new ND({keyType:p6.create(),valueType:$,typeName:F.ZodRecord,...d(I)})}}class OD 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:q.invalid_type,expected:R.map,received:U.parsedType}),r;let A=this._def.keyType,D=this._def.valueType,w=[...U.data.entries()].map(([b,N],O)=>{return{key:A._parse(new v6(U,b,U.path,[O,"key"])),value:D._parse(new v6(U,N,U.path,[O,"value"]))}});if(U.common.async){let b=new Map;return Promise.resolve().then(async()=>{for(let N of w){let O=await N.key,X=await N.value;if(O.status==="aborted"||X.status==="aborted")return r;if(O.status==="dirty"||X.status==="dirty")I.dirty();b.set(O.value,X.value)}return{status:I.value,value:b}})}else{let b=new Map;for(let N of w){let{key:O,value:X}=N;if(O.status==="aborted"||X.status==="aborted")return r;if(O.status==="dirty"||X.status==="dirty")I.dirty();b.set(O.value,X.value)}return{status:I.value,value:b}}}}OD.create=($,I,U)=>{return new OD({valueType:I,keyType:$,typeName:F.ZodMap,...d(U)})};class zI extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.set)return T(U,{code:q.invalid_type,expected:R.set,received:U.parsedType}),r;let A=this._def;if(A.minSize!==null){if(U.data.size<A.minSize.value)T(U,{code:q.too_small,minimum:A.minSize.value,type:"set",inclusive:!0,exact:!1,message:A.minSize.message}),I.dirty()}if(A.maxSize!==null){if(U.data.size>A.maxSize.value)T(U,{code:q.too_big,maximum:A.maxSize.value,type:"set",inclusive:!0,exact:!1,message:A.maxSize.message}),I.dirty()}let D=this._def.valueType;function w(N){let O=new Set;for(let X of N){if(X.status==="aborted")return r;if(X.status==="dirty")I.dirty();O.add(X.value)}return{status:I.value,value:O}}let b=[...U.data.values()].map((N,O)=>D._parse(new v6(U,N,U.path,O)));if(U.common.async)return Promise.all(b).then((N)=>w(N));else return w(b)}min($,I){return new zI({...this._def,minSize:{value:$,message:x.toString(I)}})}max($,I){return new zI({...this._def,maxSize:{value:$,message:x.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}zI.create=($,I)=>{return new zI({valueType:$,minSize:null,maxSize:null,typeName:F.ZodSet,...d(I)})};class R1 extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.function)return T(I,{code:q.invalid_type,expected:R.function,received:I.parsedType}),r;function U(b,N){return UD({data:b,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,k1(),O4].filter((O)=>!!O),issueData:{code:q.invalid_arguments,argumentsError:N}})}function A(b,N){return UD({data:b,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,k1(),O4].filter((O)=>!!O),issueData:{code:q.invalid_return_type,returnTypeError:N}})}let D={errorMap:I.common.contextualErrorMap},w=I.data;if(this._def.returns instanceof MI){let b=this;return c$(async function(...N){let O=new w6([]),X=await b._def.args.parseAsync(N,D).catch((B)=>{throw O.addIssue(U(N,B)),O}),W=await Reflect.apply(w,this,X);return await b._def.returns._def.type.parseAsync(W,D).catch((B)=>{throw O.addIssue(A(W,B)),O})})}else{let b=this;return c$(function(...N){let O=b._def.args.safeParse(N,D);if(!O.success)throw new w6([U(N,O.error)]);let X=Reflect.apply(w,this,O.data),W=b._def.returns.safeParse(X,D);if(!W.success)throw new w6([A(X,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new R1({...this._def,args:a6.create($).rest(u4.create())})}returns($){return new R1({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new R1({args:$?$:a6.create([]).rest(u4.create()),returns:I||u4.create(),typeName:F.ZodFunction,...d(U)})}}class x1 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})}}x1.create=($,I)=>{return new x1({getter:$,typeName:F.ZodLazy,...d(I)})};class h1 extends e{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return T(I,{received:I.data,code:q.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}h1.create=($,I)=>{return new h1({value:$,typeName:F.ZodLiteral,...d(I)})};function f5($,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:q.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:q.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=f5;class f1 extends e{_parse($){let I=$$.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==R.string&&U.parsedType!==R.number){let A=$$.objectValues(I);return T(U,{expected:$$.joinValues(A),received:U.parsedType,code:q.invalid_type}),r}if(!this._cache)this._cache=new Set($$.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let A=$$.objectValues(I);return T(U,{received:U.data,code:q.invalid_enum_value,options:A}),r}return c$($.data)}get enum(){return this._def.values}}f1.create=($,I)=>{return new f1({values:$,typeName:F.ZodNativeEnum,...d(I)})};class MI 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:q.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((A)=>{return this._def.type.parseAsync(A,{path:I.path,errorMap:I.common.contextualErrorMap})}))}}MI.create=($,I)=>{return new MI({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($),A=this._def.effect||null,D={addIssue:(w)=>{if(T(U,w),w.fatal)I.abort();else I.dirty()},get path(){return U.path}};if(D.addIssue=D.addIssue.bind(D),A.type==="preprocess"){let w=A.transform(U.data,D);if(U.common.async)return Promise.resolve(w).then(async(b)=>{if(I.value==="aborted")return r;let N=await this._def.schema._parseAsync({data:b,path:U.path,parent:U});if(N.status==="aborted")return r;if(N.status==="dirty")return BI(N.value);if(I.value==="dirty")return BI(N.value);return N});else{if(I.value==="aborted")return r;let b=this._def.schema._parseSync({data:w,path:U.path,parent:U});if(b.status==="aborted")return r;if(b.status==="dirty")return BI(b.value);if(I.value==="dirty")return BI(b.value);return b}}if(A.type==="refinement"){let w=(b)=>{let N=A.refinement(b,D);if(U.common.async)return Promise.resolve(N);if(N instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return b};if(U.common.async===!1){let b=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(b.status==="aborted")return r;if(b.status==="dirty")I.dirty();return w(b.value),{status:I.value,value:b.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((b)=>{if(b.status==="aborted")return r;if(b.status==="dirty")I.dirty();return w(b.value).then(()=>{return{status:I.value,value:b.value}})})}if(A.type==="transform")if(U.common.async===!1){let w=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(!y4(w))return r;let b=A.transform(w.value,D);if(b instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:I.value,value:b}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((w)=>{if(!y4(w))return r;return Promise.resolve(A.transform(w.value,D)).then((b)=>({status:I.value,value:b}))});$$.assertNever(A)}}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 Q6 extends e{_parse($){if(this._getType($)===R.undefined)return c$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Q6.create=($,I)=>{return new Q6({innerType:$,typeName:F.ZodOptional,...d(I)})};class X4 extends e{_parse($){if(this._getType($)===R.null)return c$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}X4.create=($,I)=>{return new X4({innerType:$,typeName:F.ZodNullable,...d(I)})};class y1 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}}y1.create=($,I)=>{return new y1({innerType:$,typeName:F.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...d(I)})};class u1 extends e{_parse($){let{ctx:I}=this._processInputParams($),U={...I,common:{...I.common,issues:[]}},A=this._def.innerType._parse({data:U.data,path:U.path,parent:{...U}});if(P1(A))return A.then((D)=>{return{status:"valid",value:D.status==="valid"?D.value:this._def.catchValue({get error(){return new w6(U.common.issues)},input:U.data})}});else return{status:"valid",value:A.status==="valid"?A.value:this._def.catchValue({get error(){return new w6(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}u1.create=($,I)=>{return new u1({innerType:$,typeName:F.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...d(I)})};class XD extends e{_parse($){if(this._getType($)!==R.nan){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.nan,received:U.parsedType}),r}return{status:"valid",value:$.data}}}XD.create=($)=>{return new XD({typeName:F.ZodNaN,...d($)})};var Jl=Symbol("zod_brand");class AN 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 WD extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let D=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")return I.dirty(),BI(D.value);else return this._def.out._parseAsync({data:D.value,path:U.path,parent:U})})();else{let A=this._def.in._parseSync({data:U.data,path:U.path,parent:U});if(A.status==="aborted")return r;if(A.status==="dirty")return I.dirty(),{status:"dirty",value:A.value};else return this._def.out._parseSync({data:A.value,path:U.path,parent:U})}}static create($,I){return new WD({in:$,out:I,typeName:F.ZodPipeline})}}class l1 extends e{_parse($){let I=this._def.innerType._parse($),U=(A)=>{if(y4(A))A.value=Object.freeze(A.value);return A};return P1(I)?I.then((A)=>U(A)):U(I)}unwrap(){return this._def.innerType}}l1.create=($,I)=>{return new l1({innerType:$,typeName:F.ZodReadonly,...d(I)})};var Hl={object:S$.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 Ll=p6.create,zl=HI.create,Ml=XD.create,Kl=LI.create,vl=DD.create,Vl=T1.create,ql=AD.create,Fl=_1.create,El=C1.create,Sl=wD.create,jl=u4.create,kl=t6.create,Pl=bD.create,Rl=Z6.create,y5=S$.create,Tl=S$.strictCreate,_l=Z1.create,Cl=DN.create,Zl=g1.create,gl=a6.create,xl=ND.create,hl=OD.create,fl=zI.create,yl=R1.create,ul=x1.create,ll=h1.create,cl=l4.create,ml=f1.create,rl=MI.create,nl=g6.create,il=Q6.create,ol=X4.create,dl=g6.createWithPreprocess,pl=WD.create;var kE=Object.freeze({status:"aborted"});function K($,I,U){function A(N,O){var X;Object.defineProperty(N,"_zod",{value:N._zod??{},enumerable:!1}),(X=N._zod).traits??(X.traits=new Set),N._zod.traits.add($),I(N,O);for(let W in b.prototype)if(!(W in N))Object.defineProperty(N,W,{value:b.prototype[W].bind(N)});N._zod.constr=b,N._zod.def=O}let D=U?.Parent??Object;class w extends D{}Object.defineProperty(w,"name",{value:$});function b(N){var O;let X=U?.Parent?new w:this;A(X,N),(O=X._zod).deferred??(O.deferred=[]);for(let W of X._zod.deferred)W();return X}return Object.defineProperty(b,"init",{value:A}),Object.defineProperty(b,Symbol.hasInstance,{value:(N)=>{if(U?.Parent&&N instanceof U.Parent)return!0;return N?._zod?.traits?.has($)}}),Object.defineProperty(b,"name",{value:$}),b}var PE=Symbol("zod_brand");class W4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var GD={};function b6($){if($)Object.assign(GD,$);return GD}var I$={};K6(I$,{unwrapMessage:()=>c1,stringifyPrimitive:()=>BD,required:()=>iE,randomString:()=>hE,propertyKeyTypes:()=>WN,promiseAllObject:()=>xE,primitiveTypes:()=>u5,prefixIssues:()=>x6,pick:()=>lE,partial:()=>nE,optionalKeys:()=>GN,omit:()=>cE,numKeys:()=>fE,nullish:()=>n1,normalizeParams:()=>m,merge:()=>rE,jsonStringifyReplacer:()=>bN,joinValues:()=>QD,issue:()=>YN,isPlainObject:()=>vI,isObject:()=>KI,getSizableOrigin:()=>c5,getParsedType:()=>yE,getLengthableOrigin:()=>o1,getEnumValues:()=>m1,getElementAtPath:()=>gE,floatSafeRemainder:()=>NN,finalizeIssue:()=>V6,extend:()=>mE,escapeRegex:()=>G4,esc:()=>c4,defineLazy:()=>H$,createTransparentProxy:()=>uE,clone:()=>N6,cleanRegex:()=>i1,cleanEnum:()=>oE,captureStackTrace:()=>YD,cached:()=>r1,assignProp:()=>ON,assertNotEqual:()=>TE,assertNever:()=>CE,assertIs:()=>_E,assertEqual:()=>RE,assert:()=>ZE,allowsEval:()=>XN,aborted:()=>m4,NUMBER_FORMAT_RANGES:()=>QN,Class:()=>m5,BIGINT_FORMAT_RANGES:()=>l5});function RE($){return $}function TE($){return $}function _E($){}function CE($){throw new Error}function ZE($){}function m1($){let I=Object.values($).filter((A)=>typeof A==="number");return Object.entries($).filter(([A,D])=>I.indexOf(+A)===-1).map(([A,D])=>D)}function QD($,I="|"){return $.map((U)=>BD(U)).join(I)}function bN($,I){if(typeof I==="bigint")return I.toString();return I}function r1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function n1($){return $===null||$===void 0}function i1($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function NN($,I){let U=($.toString().split(".")[1]||"").length,A=(I.toString().split(".")[1]||"").length,D=U>A?U:A,w=Number.parseInt($.toFixed(D).replace(".","")),b=Number.parseInt(I.toFixed(D).replace(".",""));return w%b/10**D}function H$($,I,U){Object.defineProperty($,I,{get(){{let D=U();return $[I]=D,D}throw new Error("cached value already set")},set(D){Object.defineProperty($,I,{value:D})},configurable:!0})}function ON($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function gE($,I){if(!I)return $;return I.reduce((U,A)=>U?.[A],$)}function xE($){let I=Object.keys($),U=I.map((A)=>$[A]);return Promise.all(U).then((A)=>{let D={};for(let w=0;w<I.length;w++)D[I[w]]=A[w];return D})}function hE($=10){let U="";for(let A=0;A<$;A++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function c4($){return JSON.stringify($)}var YD=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};function KI($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var XN=r1(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function vI($){if(KI($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;let U=I.prototype;if(KI(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function fE($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var yE=($)=>{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}`)}},WN=new Set(["string","number","symbol"]),u5=new Set(["string","number","bigint","boolean","symbol","undefined"]);function G4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N6($,I,U){let A=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)A._zod.parent=$;return A}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 uE($){let I;return new Proxy({},{get(U,A,D){return I??(I=$()),Reflect.get(I,A,D)},set(U,A,D,w){return I??(I=$()),Reflect.set(I,A,D,w)},has(U,A){return I??(I=$()),Reflect.has(I,A)},deleteProperty(U,A){return I??(I=$()),Reflect.deleteProperty(I,A)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,A){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,A)},defineProperty(U,A,D){return I??(I=$()),Reflect.defineProperty(I,A,D)}})}function BD($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function GN($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var QN={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]},l5={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function lE($,I){let U={},A=$._zod.def;for(let D in I){if(!(D in A.shape))throw new Error(`Unrecognized key: "${D}"`);if(!I[D])continue;U[D]=A.shape[D]}return N6($,{...$._zod.def,shape:U,checks:[]})}function cE($,I){let U={...$._zod.def.shape},A=$._zod.def;for(let D in I){if(!(D in A.shape))throw new Error(`Unrecognized key: "${D}"`);if(!I[D])continue;delete U[D]}return N6($,{...$._zod.def,shape:U,checks:[]})}function mE($,I){if(!vI(I))throw new Error("Invalid input to extend: expected a plain object");let U={...$._zod.def,get shape(){let A={...$._zod.def.shape,...I};return ON(this,"shape",A),A},checks:[]};return N6($,U)}function rE($,I){return N6($,{...$._zod.def,get shape(){let U={...$._zod.def.shape,...I._zod.def.shape};return ON(this,"shape",U),U},catchall:I._zod.def.catchall,checks:[]})}function nE($,I,U){let A=I._zod.def.shape,D={...A};if(U)for(let w in U){if(!(w in A))throw new Error(`Unrecognized key: "${w}"`);if(!U[w])continue;D[w]=$?new $({type:"optional",innerType:A[w]}):A[w]}else for(let w in A)D[w]=$?new $({type:"optional",innerType:A[w]}):A[w];return N6(I,{...I._zod.def,shape:D,checks:[]})}function iE($,I,U){let A=I._zod.def.shape,D={...A};if(U)for(let w in U){if(!(w in D))throw new Error(`Unrecognized key: "${w}"`);if(!U[w])continue;D[w]=new $({type:"nonoptional",innerType:A[w]})}else for(let w in A)D[w]=new $({type:"nonoptional",innerType:A[w]});return N6(I,{...I._zod.def,shape:D,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 A;return(A=U).path??(A.path=[]),U.path.unshift($),U})}function c1($){return typeof $==="string"?$:$?.message}function V6($,I,U){let A={...$,path:$.path??[]};if(!$.message){let D=c1($.inst?._zod.def?.error?.($))??c1(I?.error?.($))??c1(U.customError?.($))??c1(U.localeError?.($))??"Invalid input";A.message=D}if(delete A.inst,delete A.continue,!I?.reportInput)delete A.input;return A}function c5($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function o1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function YN(...$){let[I,U,A]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:A};return{...I}}function oE($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}class m5{constructor(...$){}}var r5=($,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,bN,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},JD=K("$ZodError",r5),d1=K("$ZodError",r5,{Parent:Error});function BN($,I=(U)=>U.message){let U={},A=[];for(let D of $.issues)if(D.path.length>0)U[D.path[0]]=U[D.path[0]]||[],U[D.path[0]].push(I(D));else A.push(I(D));return{formErrors:A,fieldErrors:U}}function JN($,I){let U=I||function(w){return w.message},A={_errors:[]},D=(w)=>{for(let b of w.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((N)=>D({issues:N}));else if(b.code==="invalid_key")D({issues:b.issues});else if(b.code==="invalid_element")D({issues:b.issues});else if(b.path.length===0)A._errors.push(U(b));else{let N=A,O=0;while(O<b.path.length){let X=b.path[O];if(O!==b.path.length-1)N[X]=N[X]||{_errors:[]};else N[X]=N[X]||{_errors:[]},N[X]._errors.push(U(b));N=N[X],O++}}};return D($),A}var HN=($)=>(I,U,A,D)=>{let w=A?Object.assign(A,{async:!1}):{async:!1},b=I._zod.run({value:U,issues:[]},w);if(b instanceof Promise)throw new W4;if(b.issues.length){let N=new(D?.Err??$)(b.issues.map((O)=>V6(O,w,b6())));throw YD(N,D?.callee),N}return b.value},LN=HN(d1),zN=($)=>async(I,U,A,D)=>{let w=A?Object.assign(A,{async:!0}):{async:!0},b=I._zod.run({value:U,issues:[]},w);if(b instanceof Promise)b=await b;if(b.issues.length){let N=new(D?.Err??$)(b.issues.map((O)=>V6(O,w,b6())));throw YD(N,D?.callee),N}return b.value},MN=zN(d1),KN=($)=>(I,U,A)=>{let D=A?{...A,async:!1}:{async:!1},w=I._zod.run({value:U,issues:[]},D);if(w instanceof Promise)throw new W4;return w.issues.length?{success:!1,error:new($??JD)(w.issues.map((b)=>V6(b,D,b6())))}:{success:!0,data:w.value}},r4=KN(d1),vN=($)=>async(I,U,A)=>{let D=A?Object.assign(A,{async:!0}):{async:!0},w=I._zod.run({value:U,issues:[]},D);if(w instanceof Promise)w=await w;return w.issues.length?{success:!1,error:new $(w.issues.map((b)=>V6(b,D,b6())))}:{success:!0,data:w.value}},n4=vN(d1);var n5=/^[cC][^\s-]{8,}$/,i5=/^[0-9a-z]+$/,o5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,d5=/^[0-9a-vA-V]{20}$/,p5=/^[A-Za-z0-9]{27}$/,t5=/^[a-zA-Z0-9_-]{21}$/,a5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var e5=/^([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})$/,VN=($)=>{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 s5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function $J(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var IJ=/^(?:(?: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])$/,UJ=/^(([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})$/,DJ=/^((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])$/,AJ=/^(([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])$/,wJ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qN=/^[A-Za-z0-9_-]*$/,bJ=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var NJ=/^\+(?:[0-9]){6,14}[0-9]$/,OJ="(?:(?:\\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])))",XJ=new RegExp(`^${OJ}$`);function WJ($){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 GJ($){return new RegExp(`^${WJ($)}$`)}function QJ($){let I=WJ({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-]\\d{2}:\\d{2})");let A=`${I}(?:${U.join("|")})`;return new RegExp(`^${OJ}T(?:${A})$`)}var YJ=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)};var BJ=/^\d+$/,JJ=/^-?\d+(?:\.\d+)?/i,HJ=/true|false/i,LJ=/null/i;var zJ=/^[^A-Z]*$/,MJ=/^[^a-z]*$/;var C$=K("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),KJ={number:"number",bigint:"bigint",object:"date"},FN=K("$ZodCheckLessThan",($,I)=>{C$.init($,I);let U=KJ[typeof I.value];$._zod.onattach.push((A)=>{let D=A._zod.bag,w=(I.inclusive?D.maximum:D.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<w)if(I.inclusive)D.maximum=I.value;else D.exclusiveMaximum=I.value}),$._zod.check=(A)=>{if(I.inclusive?A.value<=I.value:A.value<I.value)return;A.issues.push({origin:U,code:"too_big",maximum:I.value,input:A.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),EN=K("$ZodCheckGreaterThan",($,I)=>{C$.init($,I);let U=KJ[typeof I.value];$._zod.onattach.push((A)=>{let D=A._zod.bag,w=(I.inclusive?D.minimum:D.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>w)if(I.inclusive)D.minimum=I.value;else D.exclusiveMinimum=I.value}),$._zod.check=(A)=>{if(I.inclusive?A.value>=I.value:A.value>I.value)return;A.issues.push({origin:U,code:"too_small",minimum:I.value,input:A.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),vJ=K("$ZodCheckMultipleOf",($,I)=>{C$.init($,I),$._zod.onattach.push((U)=>{var A;(A=U._zod.bag).multipleOf??(A.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):NN(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})}}),VJ=K("$ZodCheckNumberFormat",($,I)=>{C$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),A=U?"int":"number",[D,w]=QN[I.format];$._zod.onattach.push((b)=>{let N=b._zod.bag;if(N.format=I.format,N.minimum=D,N.maximum=w,U)N.pattern=BJ}),$._zod.check=(b)=>{let N=b.value;if(U){if(!Number.isInteger(N)){b.issues.push({expected:A,format:I.format,code:"invalid_type",input:N,inst:$});return}if(!Number.isSafeInteger(N)){if(N>0)b.issues.push({input:N,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:A,continue:!I.abort});else b.issues.push({input:N,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:A,continue:!I.abort});return}}if(N<D)b.issues.push({origin:"number",input:N,code:"too_small",minimum:D,inclusive:!0,inst:$,continue:!I.abort});if(N>w)b.issues.push({origin:"number",input:N,code:"too_big",maximum:w,inst:$})}});var qJ=K("$ZodCheckMaxLength",($,I)=>{var U;C$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!n1(D)&&D.length!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<D)A._zod.bag.maximum=I.maximum}),$._zod.check=(A)=>{let D=A.value;if(D.length<=I.maximum)return;let b=o1(D);A.issues.push({origin:b,code:"too_big",maximum:I.maximum,inclusive:!0,input:D,inst:$,continue:!I.abort})}}),FJ=K("$ZodCheckMinLength",($,I)=>{var U;C$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!n1(D)&&D.length!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>D)A._zod.bag.minimum=I.minimum}),$._zod.check=(A)=>{let D=A.value;if(D.length>=I.minimum)return;let b=o1(D);A.issues.push({origin:b,code:"too_small",minimum:I.minimum,inclusive:!0,input:D,inst:$,continue:!I.abort})}}),EJ=K("$ZodCheckLengthEquals",($,I)=>{var U;C$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!n1(D)&&D.length!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag;D.minimum=I.length,D.maximum=I.length,D.length=I.length}),$._zod.check=(A)=>{let D=A.value,w=D.length;if(w===I.length)return;let b=o1(D),N=w>I.length;A.issues.push({origin:b,...N?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:A.value,inst:$,continue:!I.abort})}}),p1=K("$ZodCheckStringFormat",($,I)=>{var U,A;if(C$.init($,I),$._zod.onattach.push((D)=>{let w=D._zod.bag;if(w.format=I.format,I.pattern)w.patterns??(w.patterns=new Set),w.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(D)=>{if(I.pattern.lastIndex=0,I.pattern.test(D.value))return;D.issues.push({origin:"string",code:"invalid_format",format:I.format,input:D.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(A=$._zod).check??(A.check=()=>{})}),SJ=K("$ZodCheckRegex",($,I)=>{p1.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})}}),jJ=K("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=zJ),p1.init($,I)}),kJ=K("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=MJ),p1.init($,I)}),PJ=K("$ZodCheckIncludes",($,I)=>{C$.init($,I);let U=G4(I.includes),A=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=A,$._zod.onattach.push((D)=>{let w=D._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(A)}),$._zod.check=(D)=>{if(D.value.includes(I.includes,I.position))return;D.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:D.value,inst:$,continue:!I.abort})}}),RJ=K("$ZodCheckStartsWith",($,I)=>{C$.init($,I);let U=new RegExp(`^${G4(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((A)=>{let D=A._zod.bag;D.patterns??(D.patterns=new Set),D.patterns.add(U)}),$._zod.check=(A)=>{if(A.value.startsWith(I.prefix))return;A.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:A.value,inst:$,continue:!I.abort})}}),TJ=K("$ZodCheckEndsWith",($,I)=>{C$.init($,I);let U=new RegExp(`.*${G4(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((A)=>{let D=A._zod.bag;D.patterns??(D.patterns=new Set),D.patterns.add(U)}),$._zod.check=(A)=>{if(A.value.endsWith(I.suffix))return;A.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:A.value,inst:$,continue:!I.abort})}});var _J=K("$ZodCheckOverwrite",($,I)=>{C$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class SN{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
+ `).filter((w)=>w),A=Math.min(...U.map((w)=>w.length-w.trimStart().length)),D=U.map((w)=>w.slice(A)).map((w)=>" ".repeat(this.indent*2)+w);for(let w of D)this.content.push(w)}compile(){let $=Function,I=this?.args,A=[...(this?.content??[""]).map((D)=>` ${D}`)];return new $(...I,A.join(`
11
+ `))}}var ZJ={major:4,minor:0,patch:0};var W$=K("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=ZJ;let A=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))A.unshift($);for(let D of A)for(let w of D._zod.onattach)w($);if(A.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let D=(w,b,N)=>{let O=m4(w),X;for(let W of b){if(W._zod.def.when){if(!W._zod.def.when(w))continue}else if(O)continue;let Q=w.issues.length,B=W._zod.check(w);if(B instanceof Promise&&N?.async===!1)throw new W4;if(X||B instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await B,w.issues.length===Q)return;if(!O)O=m4(w,Q)});else{if(w.issues.length===Q)continue;if(!O)O=m4(w,Q)}}if(X)return X.then(()=>{return w});return w};$._zod.run=(w,b)=>{let N=$._zod.parse(w,b);if(N instanceof Promise){if(b.async===!1)throw new W4;return N.then((O)=>D(O,A,b))}return D(N,A,b)}}$["~standard"]={validate:(D)=>{try{let w=r4($,D);return w.success?{value:w.data}:{issues:w.error?.issues}}catch(w){return n4($,D).then((b)=>b.success?{value:b.data}:{issues:b.error?.issues})}},vendor:"zod",version:1}}),t1=K("$ZodString",($,I)=>{W$.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??YJ($._zod.bag),$._zod.parse=(U,A)=>{if(I.coerce)try{U.value=String(U.value)}catch(D){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),L$=K("$ZodStringFormat",($,I)=>{p1.init($,I),t1.init($,I)}),kN=K("$ZodGUID",($,I)=>{I.pattern??(I.pattern=e5),L$.init($,I)}),PN=K("$ZodUUID",($,I)=>{if(I.version){let A={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(A===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=VN(A))}else I.pattern??(I.pattern=VN());L$.init($,I)}),RN=K("$ZodEmail",($,I)=>{I.pattern??(I.pattern=s5),L$.init($,I)}),TN=K("$ZodURL",($,I)=>{L$.init($,I),$._zod.check=(U)=>{try{let A=U.value,D=new URL(A),w=D.href;if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(D.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bJ.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(D.protocol.endsWith(":")?D.protocol.slice(0,-1):D.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(!A.endsWith("/")&&w.endsWith("/"))U.value=w.slice(0,-1);else U.value=w;return}catch(A){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),_N=K("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=$J()),L$.init($,I)}),CN=K("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=t5),L$.init($,I)}),ZN=K("$ZodCUID",($,I)=>{I.pattern??(I.pattern=n5),L$.init($,I)}),gN=K("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=i5),L$.init($,I)}),xN=K("$ZodULID",($,I)=>{I.pattern??(I.pattern=o5),L$.init($,I)}),hN=K("$ZodXID",($,I)=>{I.pattern??(I.pattern=d5),L$.init($,I)}),fN=K("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=p5),L$.init($,I)}),rJ=K("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=QJ(I)),L$.init($,I)}),nJ=K("$ZodISODate",($,I)=>{I.pattern??(I.pattern=XJ),L$.init($,I)}),iJ=K("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=GJ(I)),L$.init($,I)}),oJ=K("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=a5),L$.init($,I)}),yN=K("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=IJ),L$.init($,I),$._zod.onattach.push((U)=>{let A=U._zod.bag;A.format="ipv4"})}),uN=K("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=UJ),L$.init($,I),$._zod.onattach.push((U)=>{let A=U._zod.bag;A.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})}}}),lN=K("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=DJ),L$.init($,I)}),cN=K("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=AJ),L$.init($,I),$._zod.check=(U)=>{let[A,D]=U.value.split("/");try{if(!D)throw new Error;let w=Number(D);if(`${w}`!==D)throw new Error;if(w<0||w>128)throw new Error;new URL(`http://[${A}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function dJ($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var mN=K("$ZodBase64",($,I)=>{I.pattern??(I.pattern=wJ),L$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64"}),$._zod.check=(U)=>{if(dJ(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function pE($){if(!qN.test($))return!1;let I=$.replace(/[-_]/g,(A)=>A==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return dJ(U)}var rN=K("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=qN),L$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64url"}),$._zod.check=(U)=>{if(pE(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),nN=K("$ZodE164",($,I)=>{I.pattern??(I.pattern=NJ),L$.init($,I)});function tE($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[A]=U;if(!A)return!1;let D=JSON.parse(atob(A));if("typ"in D&&D?.typ!=="JWT")return!1;if(!D.alg)return!1;if(I&&(!("alg"in D)||D.alg!==I))return!1;return!0}catch{return!1}}var iN=K("$ZodJWT",($,I)=>{L$.init($,I),$._zod.check=(U)=>{if(tE(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}});var zD=K("$ZodNumber",($,I)=>{W$.init($,I),$._zod.pattern=$._zod.bag.pattern??JJ,$._zod.parse=(U,A)=>{if(I.coerce)try{U.value=Number(U.value)}catch(b){}let D=U.value;if(typeof D==="number"&&!Number.isNaN(D)&&Number.isFinite(D))return U;let w=typeof D==="number"?Number.isNaN(D)?"NaN":!Number.isFinite(D)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:D,inst:$,...w?{received:w}:{}}),U}}),oN=K("$ZodNumber",($,I)=>{VJ.init($,I),zD.init($,I)}),dN=K("$ZodBoolean",($,I)=>{W$.init($,I),$._zod.pattern=HJ,$._zod.parse=(U,A)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(w){}let D=U.value;if(typeof D==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:D,inst:$}),U}});var pN=K("$ZodNull",($,I)=>{W$.init($,I),$._zod.pattern=LJ,$._zod.values=new Set([null]),$._zod.parse=(U,A)=>{let D=U.value;if(D===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:D,inst:$}),U}});var tN=K("$ZodUnknown",($,I)=>{W$.init($,I),$._zod.parse=(U)=>U}),aN=K("$ZodNever",($,I)=>{W$.init($,I),$._zod.parse=(U,A)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}});function gJ($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}var eN=K("$ZodArray",($,I)=>{W$.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(!Array.isArray(D))return U.issues.push({expected:"array",code:"invalid_type",input:D,inst:$}),U;U.value=Array(D.length);let w=[];for(let b=0;b<D.length;b++){let N=D[b],O=I.element._zod.run({value:N,issues:[]},A);if(O instanceof Promise)w.push(O.then((X)=>gJ(X,U,b)));else gJ(O,U,b)}if(w.length)return Promise.all(w).then(()=>U);return U}});function LD($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}function xJ($,I,U,A){if($.issues.length)if(A[U]===void 0)if(U in A)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 A)I.value[U]=void 0}else I.value[U]=$.value}var MD=K("$ZodObject",($,I)=>{W$.init($,I);let U=r1(()=>{let Q=Object.keys(I.shape);for(let Y of Q)if(!(I.shape[Y]instanceof W$))throw new Error(`Invalid element at key "${Y}": expected a Zod schema`);let B=GN(I.shape);return{shape:I.shape,keys:Q,keySet:new Set(Q),numKeys:Q.length,optionalKeys:new Set(B)}});H$($._zod,"propValues",()=>{let Q=I.shape,B={};for(let Y in Q){let J=Q[Y]._zod;if(J.values){B[Y]??(B[Y]=new Set);for(let H of J.values)B[Y].add(H)}}return B});let A=(Q)=>{let B=new SN(["shape","payload","ctx"]),Y=U.value,J=(P)=>{let k=c4(P);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};B.write("const input = payload.value;");let H=Object.create(null),v=0;for(let P of Y.keys)H[P]=`key_${v++}`;B.write("const newResult = {}");for(let P of Y.keys)if(Y.optionalKeys.has(P)){let k=H[P];B.write(`const ${k} = ${J(P)};`);let h=c4(P);B.write(`
12
+ if (${k}.issues.length) {
13
13
  if (input[${h}] === undefined) {
14
14
  if (${h} in input) {
15
15
  newResult[${h}] = undefined;
16
16
  }
17
17
  } else {
18
18
  payload.issues = payload.issues.concat(
19
- ${P}.issues.map((iss) => ({
19
+ ${k}.issues.map((iss) => ({
20
20
  ...iss,
21
21
  path: iss.path ? [${h}, ...iss.path] : [${h}],
22
22
  }))
23
23
  );
24
24
  }
25
- } else if (${P}.value === undefined) {
25
+ } else if (${k}.value === undefined) {
26
26
  if (${h} in input) newResult[${h}] = undefined;
27
27
  } else {
28
- newResult[${h}] = ${P}.value;
28
+ newResult[${h}] = ${k}.value;
29
29
  }
30
- `)}else{let P=O[k];H.write(`const ${P} = ${A(k)};`),H.write(`
31
- if (${P}.issues.length) payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
30
+ `)}else{let k=H[P];B.write(`const ${k} = ${J(P)};`),B.write(`
31
+ if (${k}.issues.length) payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
32
32
  ...iss,
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>
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
37
- ]))`;continue}else if(b[Q]==="$"){w+=`($|(?=[\r
38
- ]))`;continue}}if(U.s&&b[Q]==="."){w+=D?`${b[Q]}\r
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),Zx(I)}clear(){this._buffer=void 0}}function Zx($){return CO.parse(JSON.parse($))}function NV($){return JSON.stringify($)+`
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(`
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(`
33
+ path: iss.path ? [${c4(P)}, ...iss.path] : [${c4(P)}]
34
+ })));`),B.write(`newResult[${c4(P)}] = ${k}.value`)}B.write("payload.value = newResult;"),B.write("return payload;");let V=B.compile();return(P,k)=>V(Q,P,k)},D,w=KI,b=!GD.jitless,O=b&&XN.value,X=I.catchall,W;$._zod.parse=(Q,B)=>{W??(W=U.value);let Y=Q.value;if(!w(Y))return Q.issues.push({expected:"object",code:"invalid_type",input:Y,inst:$}),Q;let J=[];if(b&&O&&B?.async===!1&&B.jitless!==!0){if(!D)D=A(I.shape);Q=D(Q,B)}else{Q.value={};let k=W.shape;for(let h of W.keys){let l=k[h],l$=l._zod.run({value:Y[h],issues:[]},B),G6=l._zod.optin==="optional"&&l._zod.optout==="optional";if(l$ instanceof Promise)J.push(l$.then((YI)=>G6?xJ(YI,Q,h,Y):LD(YI,Q,h)));else if(G6)xJ(l$,Q,h,Y);else LD(l$,Q,h)}}if(!X)return J.length?Promise.all(J).then(()=>Q):Q;let H=[],v=W.keySet,V=X._zod,P=V.def.type;for(let k of Object.keys(Y)){if(v.has(k))continue;if(P==="never"){H.push(k);continue}let h=V.run({value:Y[k],issues:[]},B);if(h instanceof Promise)J.push(h.then((l)=>LD(l,Q,k)));else LD(h,Q,k)}if(H.length)Q.issues.push({code:"unrecognized_keys",keys:H,input:Y,inst:$});if(!J.length)return Q;return Promise.all(J).then(()=>{return Q})}});function hJ($,I,U,A){for(let D of $)if(D.issues.length===0)return I.value=D.value,I;return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((D)=>D.issues.map((w)=>V6(w,A,b6())))}),I}var KD=K("$ZodUnion",($,I)=>{W$.init($,I),H$($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),H$($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),H$($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),H$($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((A)=>A._zod.pattern);return new RegExp(`^(${U.map((A)=>i1(A.source)).join("|")})$`)}return}),$._zod.parse=(U,A)=>{let D=!1,w=[];for(let b of I.options){let N=b._zod.run({value:U.value,issues:[]},A);if(N instanceof Promise)w.push(N),D=!0;else{if(N.issues.length===0)return N;w.push(N)}}if(!D)return hJ(w,U,$,A);return Promise.all(w).then((b)=>{return hJ(b,U,$,A)})}}),sN=K("$ZodDiscriminatedUnion",($,I)=>{KD.init($,I);let U=$._zod.parse;H$($._zod,"propValues",()=>{let D={};for(let w of I.options){let b=w._zod.propValues;if(!b||Object.keys(b).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(w)}"`);for(let[N,O]of Object.entries(b)){if(!D[N])D[N]=new Set;for(let X of O)D[N].add(X)}}return D});let A=r1(()=>{let D=I.options,w=new Map;for(let b of D){let N=b._zod.propValues[I.discriminator];if(!N||N.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(b)}"`);for(let O of N){if(w.has(O))throw new Error(`Duplicate discriminator value "${String(O)}"`);w.set(O,b)}}return w});$._zod.parse=(D,w)=>{let b=D.value;if(!KI(b))return D.issues.push({code:"invalid_type",expected:"object",input:b,inst:$}),D;let N=A.value.get(b?.[I.discriminator]);if(N)return N._zod.run(D,w);if(I.unionFallback)return U(D,w);return D.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:b,path:[I.discriminator],inst:$}),D}}),$O=K("$ZodIntersection",($,I)=>{W$.init($,I),$._zod.parse=(U,A)=>{let D=U.value,w=I.left._zod.run({value:D,issues:[]},A),b=I.right._zod.run({value:D,issues:[]},A);if(w instanceof Promise||b instanceof Promise)return Promise.all([w,b]).then(([O,X])=>{return fJ(U,O,X)});return fJ(U,w,b)}});function jN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(vI($)&&vI(I)){let U=Object.keys(I),A=Object.keys($).filter((w)=>U.indexOf(w)!==-1),D={...$,...I};for(let w of A){let b=jN($[w],I[w]);if(!b.valid)return{valid:!1,mergeErrorPath:[w,...b.mergeErrorPath]};D[w]=b.data}return{valid:!0,data:D}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let A=0;A<$.length;A++){let D=$[A],w=I[A],b=jN(D,w);if(!b.valid)return{valid:!1,mergeErrorPath:[A,...b.mergeErrorPath]};U.push(b.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function fJ($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(m4($))return $;let A=jN(I.value,U.value);if(!A.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(A.mergeErrorPath)}`);return $.value=A.data,$}var IO=K("$ZodRecord",($,I)=>{W$.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(!vI(D))return U.issues.push({expected:"record",code:"invalid_type",input:D,inst:$}),U;let w=[];if(I.keyType._zod.values){let b=I.keyType._zod.values;U.value={};for(let O of b)if(typeof O==="string"||typeof O==="number"||typeof O==="symbol"){let X=I.valueType._zod.run({value:D[O],issues:[]},A);if(X instanceof Promise)w.push(X.then((W)=>{if(W.issues.length)U.issues.push(...x6(O,W.issues));U.value[O]=W.value}));else{if(X.issues.length)U.issues.push(...x6(O,X.issues));U.value[O]=X.value}}let N;for(let O in D)if(!b.has(O))N=N??[],N.push(O);if(N&&N.length>0)U.issues.push({code:"unrecognized_keys",input:D,inst:$,keys:N})}else{U.value={};for(let b of Reflect.ownKeys(D)){if(b==="__proto__")continue;let N=I.keyType._zod.run({value:b,issues:[]},A);if(N instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(N.issues.length){U.issues.push({origin:"record",code:"invalid_key",issues:N.issues.map((X)=>V6(X,A,b6())),input:b,path:[b],inst:$}),U.value[N.value]=N.value;continue}let O=I.valueType._zod.run({value:D[b],issues:[]},A);if(O instanceof Promise)w.push(O.then((X)=>{if(X.issues.length)U.issues.push(...x6(b,X.issues));U.value[N.value]=X.value}));else{if(O.issues.length)U.issues.push(...x6(b,O.issues));U.value[N.value]=O.value}}}if(w.length)return Promise.all(w).then(()=>U);return U}});var UO=K("$ZodEnum",($,I)=>{W$.init($,I);let U=m1(I.entries);$._zod.values=new Set(U),$._zod.pattern=new RegExp(`^(${U.filter((A)=>WN.has(typeof A)).map((A)=>typeof A==="string"?G4(A):A.toString()).join("|")})$`),$._zod.parse=(A,D)=>{let w=A.value;if($._zod.values.has(w))return A;return A.issues.push({code:"invalid_value",values:U,input:w,inst:$}),A}}),DO=K("$ZodLiteral",($,I)=>{W$.init($,I),$._zod.values=new Set(I.values),$._zod.pattern=new RegExp(`^(${I.values.map((U)=>typeof U==="string"?G4(U):U?U.toString():String(U)).join("|")})$`),$._zod.parse=(U,A)=>{let D=U.value;if($._zod.values.has(D))return U;return U.issues.push({code:"invalid_value",values:I.values,input:D,inst:$}),U}});var AO=K("$ZodTransform",($,I)=>{W$.init($,I),$._zod.parse=(U,A)=>{let D=I.transform(U.value,U);if(A.async)return(D instanceof Promise?D:Promise.resolve(D)).then((b)=>{return U.value=b,U});if(D instanceof Promise)throw new W4;return U.value=D,U}}),wO=K("$ZodOptional",($,I)=>{W$.init($,I),$._zod.optin="optional",$._zod.optout="optional",H$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),H$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${i1(U.source)})?$`):void 0}),$._zod.parse=(U,A)=>{if(I.innerType._zod.optin==="optional")return I.innerType._zod.run(U,A);if(U.value===void 0)return U;return I.innerType._zod.run(U,A)}}),bO=K("$ZodNullable",($,I)=>{W$.init($,I),H$($._zod,"optin",()=>I.innerType._zod.optin),H$($._zod,"optout",()=>I.innerType._zod.optout),H$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${i1(U.source)}|null)$`):void 0}),H$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,A)=>{if(U.value===null)return U;return I.innerType._zod.run(U,A)}}),NO=K("$ZodDefault",($,I)=>{W$.init($,I),$._zod.optin="optional",H$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,A)=>{if(U.value===void 0)return U.value=I.defaultValue,U;let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>yJ(w,I));return yJ(D,I)}});function yJ($,I){if($.value===void 0)$.value=I.defaultValue;return $}var OO=K("$ZodPrefault",($,I)=>{W$.init($,I),$._zod.optin="optional",H$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,A)=>{if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,A)}}),XO=K("$ZodNonOptional",($,I)=>{W$.init($,I),H$($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((A)=>A!==void 0)):void 0}),$._zod.parse=(U,A)=>{let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>uJ(w,$));return uJ(D,$)}});function uJ($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var WO=K("$ZodCatch",($,I)=>{W$.init($,I),$._zod.optin="optional",H$($._zod,"optout",()=>I.innerType._zod.optout),H$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,A)=>{let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>{if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((b)=>V6(b,A,b6()))},input:U.value}),U.issues=[];return U});if(U.value=D.value,D.issues.length)U.value=I.catchValue({...U,error:{issues:D.issues.map((w)=>V6(w,A,b6()))},input:U.value}),U.issues=[];return U}});var GO=K("$ZodPipe",($,I)=>{W$.init($,I),H$($._zod,"values",()=>I.in._zod.values),H$($._zod,"optin",()=>I.in._zod.optin),H$($._zod,"optout",()=>I.out._zod.optout),$._zod.parse=(U,A)=>{let D=I.in._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>lJ(w,I,A));return lJ(D,I,A)}});function lJ($,I,U){if(m4($))return $;return I.out._zod.run({value:$.value,issues:$.issues},U)}var QO=K("$ZodReadonly",($,I)=>{W$.init($,I),H$($._zod,"propValues",()=>I.innerType._zod.propValues),H$($._zod,"values",()=>I.innerType._zod.values),H$($._zod,"optin",()=>I.innerType._zod.optin),H$($._zod,"optout",()=>I.innerType._zod.optout),$._zod.parse=(U,A)=>{let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then(cJ);return cJ(D)}});function cJ($){return $.value=Object.freeze($.value),$}var YO=K("$ZodCustom",($,I)=>{C$.init($,I),W$.init($,I),$._zod.parse=(U,A)=>{return U},$._zod.check=(U)=>{let A=U.value,D=I.fn(A);if(D instanceof Promise)return D.then((w)=>mJ(w,U,A,$));mJ(D,U,A,$);return}});function mJ($,I,U,A){if(!$){let D={code:"custom",input:U,inst:A,path:[...A._zod.def.path??[]],continue:!A._zod.def.abort};if(A._zod.def.params)D.params=A._zod.def.params;I.issues.push(YN(D))}}var aE=($)=>{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},eE=()=>{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(A){return $[A]??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(A)=>{switch(A.code){case"invalid_type":return`Invalid input: expected ${A.expected}, received ${aE(A.input)}`;case"invalid_value":if(A.values.length===1)return`Invalid input: expected ${BD(A.values[0])}`;return`Invalid option: expected one of ${QD(A.values,"|")}`;case"too_big":{let D=A.inclusive?"<=":"<",w=I(A.origin);if(w)return`Too big: expected ${A.origin??"value"} to have ${D}${A.maximum.toString()} ${w.unit??"elements"}`;return`Too big: expected ${A.origin??"value"} to be ${D}${A.maximum.toString()}`}case"too_small":{let D=A.inclusive?">=":">",w=I(A.origin);if(w)return`Too small: expected ${A.origin} to have ${D}${A.minimum.toString()} ${w.unit}`;return`Too small: expected ${A.origin} to be ${D}${A.minimum.toString()}`}case"invalid_format":{let D=A;if(D.format==="starts_with")return`Invalid string: must start with "${D.prefix}"`;if(D.format==="ends_with")return`Invalid string: must end with "${D.suffix}"`;if(D.format==="includes")return`Invalid string: must include "${D.includes}"`;if(D.format==="regex")return`Invalid string: must match pattern ${D.pattern}`;return`Invalid ${U[D.format]??A.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${A.divisor}`;case"unrecognized_keys":return`Unrecognized key${A.keys.length>1?"s":""}: ${QD(A.keys,", ")}`;case"invalid_key":return`Invalid key in ${A.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${A.origin}`;default:return"Invalid input"}}};function BO(){return{localeError:eE()}}var sE=Symbol("ZodOutput"),$S=Symbol("ZodInput");class vD{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 pJ(){return new vD}var Q4=pJ();function JO($,I){return new $({type:"string",...m(I)})}function HO($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...m(I)})}function VD($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...m(I)})}function LO($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...m(I)})}function zO($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(I)})}function MO($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(I)})}function KO($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(I)})}function vO($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...m(I)})}function VO($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...m(I)})}function qO($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(I)})}function FO($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...m(I)})}function EO($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(I)})}function SO($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...m(I)})}function jO($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...m(I)})}function kO($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...m(I)})}function PO($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...m(I)})}function RO($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(I)})}function TO($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(I)})}function _O($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(I)})}function CO($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...m(I)})}function ZO($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...m(I)})}function gO($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...m(I)})}function xO($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...m(I)})}function tJ($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(I)})}function aJ($,I){return new $({type:"string",format:"date",check:"string_format",...m(I)})}function eJ($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...m(I)})}function sJ($,I){return new $({type:"string",format:"duration",check:"string_format",...m(I)})}function hO($,I){return new $({type:"number",checks:[],...m(I)})}function fO($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...m(I)})}function yO($,I){return new $({type:"boolean",...m(I)})}function uO($,I){return new $({type:"null",...m(I)})}function lO($){return new $({type:"unknown"})}function cO($,I){return new $({type:"never",...m(I)})}function qD($,I){return new FN({check:"less_than",...m(I),value:$,inclusive:!1})}function a1($,I){return new FN({check:"less_than",...m(I),value:$,inclusive:!0})}function FD($,I){return new EN({check:"greater_than",...m(I),value:$,inclusive:!1})}function e1($,I){return new EN({check:"greater_than",...m(I),value:$,inclusive:!0})}function ED($,I){return new vJ({check:"multiple_of",...m(I),value:$})}function SD($,I){return new qJ({check:"max_length",...m(I),maximum:$})}function VI($,I){return new FJ({check:"min_length",...m(I),minimum:$})}function jD($,I){return new EJ({check:"length_equals",...m(I),length:$})}function mO($,I){return new SJ({check:"string_format",format:"regex",...m(I),pattern:$})}function rO($){return new jJ({check:"string_format",format:"lowercase",...m($)})}function nO($){return new kJ({check:"string_format",format:"uppercase",...m($)})}function iO($,I){return new PJ({check:"string_format",format:"includes",...m(I),includes:$})}function oO($,I){return new RJ({check:"string_format",format:"starts_with",...m(I),prefix:$})}function dO($,I){return new TJ({check:"string_format",format:"ends_with",...m(I),suffix:$})}function i4($){return new _J({check:"overwrite",tx:$})}function pO($){return i4((I)=>I.normalize($))}function tO(){return i4(($)=>$.trim())}function aO(){return i4(($)=>$.toLowerCase())}function eO(){return i4(($)=>$.toUpperCase())}function $H($,I,U){return new $({type:"array",element:I,...m(U)})}function sO($,I,U){let A=m(U);return A.abort??(A.abort=!0),new $({type:"custom",check:"custom",fn:I,...A})}function $X($,I,U){return new $({type:"custom",check:"custom",fn:I,...m(U)})}class IX{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??Q4,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 A=$._zod.def,D={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},w=this.seen.get($);if(w){if(w.count++,I.schemaPath.includes($))w.cycle=I.path;return w.schema}let b={schema:{},count:1,cycle:void 0,path:I.path};this.seen.set($,b);let N=$._zod.toJSONSchema?.();if(N)b.schema=N;else{let W={...I,schemaPath:[...I.schemaPath,$],path:I.path},Q=$._zod.parent;if(Q)b.ref=Q,this.process(Q,W),this.seen.get(Q).isParent=!0;else{let B=b.schema;switch(A.type){case"string":{let Y=B;Y.type="string";let{minimum:J,maximum:H,format:v,patterns:V,contentEncoding:P}=$._zod.bag;if(typeof J==="number")Y.minLength=J;if(typeof H==="number")Y.maxLength=H;if(v){if(Y.format=D[v]??v,Y.format==="")delete Y.format}if(P)Y.contentEncoding=P;if(V&&V.size>0){let k=[...V];if(k.length===1)Y.pattern=k[0].source;else if(k.length>1)b.schema.allOf=[...k.map((h)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:h.source}))]}break}case"number":{let Y=B,{minimum:J,maximum:H,format:v,multipleOf:V,exclusiveMaximum:P,exclusiveMinimum:k}=$._zod.bag;if(typeof v==="string"&&v.includes("int"))Y.type="integer";else Y.type="number";if(typeof k==="number")Y.exclusiveMinimum=k;if(typeof J==="number"){if(Y.minimum=J,typeof k==="number")if(k>=J)delete Y.minimum;else delete Y.exclusiveMinimum}if(typeof P==="number")Y.exclusiveMaximum=P;if(typeof H==="number"){if(Y.maximum=H,typeof P==="number")if(P<=H)delete Y.maximum;else delete Y.exclusiveMaximum}if(typeof V==="number")Y.multipleOf=V;break}case"boolean":{let Y=B;Y.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":{B.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":{B.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let Y=B,{minimum:J,maximum:H}=$._zod.bag;if(typeof J==="number")Y.minItems=J;if(typeof H==="number")Y.maxItems=H;Y.type="array",Y.items=this.process(A.element,{...W,path:[...W.path,"items"]});break}case"object":{let Y=B;Y.type="object",Y.properties={};let J=A.shape;for(let V in J)Y.properties[V]=this.process(J[V],{...W,path:[...W.path,"properties",V]});let H=new Set(Object.keys(J)),v=new Set([...H].filter((V)=>{let P=A.shape[V]._zod;if(this.io==="input")return P.optin===void 0;else return P.optout===void 0}));if(v.size>0)Y.required=Array.from(v);if(A.catchall?._zod.def.type==="never")Y.additionalProperties=!1;else if(!A.catchall){if(this.io==="output")Y.additionalProperties=!1}else if(A.catchall)Y.additionalProperties=this.process(A.catchall,{...W,path:[...W.path,"additionalProperties"]});break}case"union":{let Y=B;Y.anyOf=A.options.map((J,H)=>this.process(J,{...W,path:[...W.path,"anyOf",H]}));break}case"intersection":{let Y=B,J=this.process(A.left,{...W,path:[...W.path,"allOf",0]}),H=this.process(A.right,{...W,path:[...W.path,"allOf",1]}),v=(P)=>("allOf"in P)&&Object.keys(P).length===1,V=[...v(J)?J.allOf:[J],...v(H)?H.allOf:[H]];Y.allOf=V;break}case"tuple":{let Y=B;Y.type="array";let J=A.items.map((V,P)=>this.process(V,{...W,path:[...W.path,"prefixItems",P]}));if(this.target==="draft-2020-12")Y.prefixItems=J;else Y.items=J;if(A.rest){let V=this.process(A.rest,{...W,path:[...W.path,"items"]});if(this.target==="draft-2020-12")Y.items=V;else Y.additionalItems=V}if(A.rest)Y.items=this.process(A.rest,{...W,path:[...W.path,"items"]});let{minimum:H,maximum:v}=$._zod.bag;if(typeof H==="number")Y.minItems=H;if(typeof v==="number")Y.maxItems=v;break}case"record":{let Y=B;Y.type="object",Y.propertyNames=this.process(A.keyType,{...W,path:[...W.path,"propertyNames"]}),Y.additionalProperties=this.process(A.valueType,{...W,path:[...W.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 Y=B,J=m1(A.entries);if(J.every((H)=>typeof H==="number"))Y.type="number";if(J.every((H)=>typeof H==="string"))Y.type="string";Y.enum=J;break}case"literal":{let Y=B,J=[];for(let H of A.values)if(H===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof H==="bigint")if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else J.push(Number(H));else J.push(H);if(J.length===0);else if(J.length===1){let H=J[0];Y.type=H===null?"null":typeof H,Y.const=H}else{if(J.every((H)=>typeof H==="number"))Y.type="number";if(J.every((H)=>typeof H==="string"))Y.type="string";if(J.every((H)=>typeof H==="boolean"))Y.type="string";if(J.every((H)=>H===null))Y.type="null";Y.enum=J}break}case"file":{let Y=B,J={type:"string",format:"binary",contentEncoding:"binary"},{minimum:H,maximum:v,mime:V}=$._zod.bag;if(H!==void 0)J.minLength=H;if(v!==void 0)J.maxLength=v;if(V)if(V.length===1)J.contentMediaType=V[0],Object.assign(Y,J);else Y.anyOf=V.map((P)=>{return{...J,contentMediaType:P}});else Object.assign(Y,J);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let Y=this.process(A.innerType,W);B.anyOf=[Y,{type:"null"}];break}case"nonoptional":{this.process(A.innerType,W),b.ref=A.innerType;break}case"success":{let Y=B;Y.type="boolean";break}case"default":{this.process(A.innerType,W),b.ref=A.innerType,B.default=JSON.parse(JSON.stringify(A.defaultValue));break}case"prefault":{if(this.process(A.innerType,W),b.ref=A.innerType,this.io==="input")B._prefault=JSON.parse(JSON.stringify(A.defaultValue));break}case"catch":{this.process(A.innerType,W),b.ref=A.innerType;let Y;try{Y=A.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}B.default=Y;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let Y=B,J=$._zod.pattern;if(!J)throw new Error("Pattern not found in template literal");Y.type="string",Y.pattern=J.source;break}case"pipe":{let Y=this.io==="input"?A.in._zod.def.type==="transform"?A.out:A.in:A.out;this.process(Y,W),b.ref=Y;break}case"readonly":{this.process(A.innerType,W),b.ref=A.innerType,B.readOnly=!0;break}case"promise":{this.process(A.innerType,W),b.ref=A.innerType;break}case"optional":{this.process(A.innerType,W),b.ref=A.innerType;break}case"lazy":{let Y=$._zod.innerType;this.process(Y,W),b.ref=Y;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let O=this.metadataRegistry.get($);if(O)Object.assign(b.schema,O);if(this.io==="input"&&R$($))delete b.schema.examples,delete b.schema.default;if(this.io==="input"&&b.schema._prefault)(U=b.schema).default??(U.default=b.schema._prefault);return delete b.schema._prefault,this.seen.get($).schema}emit($,I){let U={cycles:I?.cycles??"ref",reused:I?.reused??"inline",external:I?.external??void 0},A=this.seen.get($);if(!A)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=(X)=>{let W=this.target==="draft-2020-12"?"$defs":"definitions";if(U.external){let J=U.external.registry.get(X[0])?.id,H=U.external.uri??((V)=>V);if(J)return{ref:H(J)};let v=X[1].defId??X[1].schema.id??`schema${this.counter++}`;return X[1].defId=v,{defId:v,ref:`${H("__shared")}#/${W}/${v}`}}if(X[1]===A)return{ref:"#"};let B=`${"#"}/${W}/`,Y=X[1].schema.id??`__schema${this.counter++}`;return{defId:Y,ref:B+Y}},w=(X)=>{if(X[1].schema.$ref)return;let W=X[1],{ref:Q,defId:B}=D(X);if(W.def={...W.schema},B)W.defId=B;let Y=W.schema;for(let J in Y)delete Y[J];Y.$ref=Q};if(U.cycles==="throw")for(let X of this.seen.entries()){let W=X[1];if(W.cycle)throw new Error(`Cycle detected: #/${W.cycle?.join("/")}/<root>
35
+
36
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of this.seen.entries()){let W=X[1];if($===X[0]){w(X);continue}if(U.external){let B=U.external.registry.get(X[0])?.id;if($!==X[0]&&B){w(X);continue}}if(this.metadataRegistry.get(X[0])?.id){w(X);continue}if(W.cycle){w(X);continue}if(W.count>1){if(U.reused==="ref"){w(X);continue}}}let b=(X,W)=>{let Q=this.seen.get(X),B=Q.def??Q.schema,Y={...B};if(Q.ref===null)return;let J=Q.ref;if(Q.ref=null,J){b(J,W);let H=this.seen.get(J).schema;if(H.$ref&&W.target==="draft-7")B.allOf=B.allOf??[],B.allOf.push(H);else Object.assign(B,H),Object.assign(B,Y)}if(!Q.isParent)this.override({zodSchema:X,jsonSchema:B,path:Q.path??[]})};for(let X of[...this.seen.entries()].reverse())b(X[0],{target:this.target});let N={};if(this.target==="draft-2020-12")N.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")N.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);if(U.external?.uri){let X=U.external.registry.get($)?.id;if(!X)throw new Error("Schema is missing an `id` property");N.$id=U.external.uri(X)}Object.assign(N,A.def);let O=U.external?.defs??{};for(let X of this.seen.entries()){let W=X[1];if(W.def&&W.defId)O[W.defId]=W.def}if(U.external);else if(Object.keys(O).length>0)if(this.target==="draft-2020-12")N.$defs=O;else N.definitions=O;try{return JSON.parse(JSON.stringify(N))}catch(X){throw new Error("Error converting schema to JSON.")}}}function UX($,I){if($ instanceof vD){let A=new IX(I),D={};for(let N of $._idmap.entries()){let[O,X]=N;A.process(X)}let w={},b={registry:$,uri:I?.uri,defs:D};for(let N of $._idmap.entries()){let[O,X]=N;w[O]=A.emit(X,{...I,external:b})}if(Object.keys(D).length>0){let N=A.target==="draft-2020-12"?"$defs":"definitions";w.__shared={[N]:D}}return{schemas:w}}let U=new IX(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 D=$._zod.def;switch(D.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$(D.element,U);case"object":{for(let w in D.shape)if(R$(D.shape[w],U))return!0;return!1}case"union":{for(let w of D.options)if(R$(w,U))return!0;return!1}case"intersection":return R$(D.left,U)||R$(D.right,U);case"tuple":{for(let w of D.items)if(R$(w,U))return!0;if(D.rest&&R$(D.rest,U))return!0;return!1}case"record":return R$(D.keyType,U)||R$(D.valueType,U);case"map":return R$(D.keyType,U)||R$(D.valueType,U);case"set":return R$(D.valueType,U);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return R$(D.innerType,U);case"lazy":return R$(D.getter(),U);case"default":return R$(D.innerType,U);case"prefault":return R$(D.innerType,U);case"custom":return!1;case"transform":return!0;case"pipe":return R$(D.in,U)||R$(D.out,U);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${D.type}`)}var gS=K("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");W$.init($,I),$.def=I,$.parse=(U,A)=>LN($,U,A,{callee:$.parse}),$.safeParse=(U,A)=>r4($,U,A),$.parseAsync=async(U,A)=>MN($,U,A,{callee:$.parseAsync}),$.safeParseAsync=async(U,A)=>n4($,U,A),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((A)=>typeof A==="function"?{_zod:{check:A,def:{check:"custom"},onattach:[]}}:A)]})},$.clone=(U,A)=>N6($,U,A),$.brand=()=>$,$.register=(U,A)=>{return U.add($,A),$}});var xS=K("ZodMiniObject",($,I)=>{MD.init($,I),gS.init($,I),I$.defineLazy($,"shape",()=>I.shape)});function DX($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new xS(U)}function Y6($){return!!$._zod}function d4($){let I=Object.values($);if(I.length===0)return DX({});let U=I.every(Y6),A=I.every((D)=>!Y6(D));if(U)return DX($);if(A)return y5($);throw new Error("Mixed Zod versions detected in object shape.")}function Y4($,I){if(Y6($))return r4($,I);return $.safeParse(I)}async function kD($,I){if(Y6($))return await n4($,I);return await $.safeParseAsync(I)}function B4($){if(!$)return;let I;if(Y6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function qI($){if(!$)return;if(typeof $==="object"){let I=$,U=$;if(!I._def&&!U._zod){let A=Object.values($);if(A.length>0&&A.every((D)=>typeof D==="object"&&D!==null&&(D._def!==void 0||D._zod!==void 0||typeof D.parse==="function")))return d4($)}}if(Y6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function PD($){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 UH($){return $.description}function DH($){if(Y6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function RD($){if(Y6($)){let w=$._zod?.def;if(w){if(w.value!==void 0)return w.value;if(Array.isArray(w.values)&&w.values.length>0)return w.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 A=$.value;if(A!==void 0)return A;return}var s1={};K6(s1,{time:()=>bX,duration:()=>NX,datetime:()=>AX,date:()=>wX,ZodISOTime:()=>bH,ZodISODuration:()=>NH,ZodISODateTime:()=>AH,ZodISODate:()=>wH});var AH=K("ZodISODateTime",($,I)=>{rJ.init($,I),K$.init($,I)});function AX($){return tJ(AH,$)}var wH=K("ZodISODate",($,I)=>{nJ.init($,I),K$.init($,I)});function wX($){return aJ(wH,$)}var bH=K("ZodISOTime",($,I)=>{iJ.init($,I),K$.init($,I)});function bX($){return eJ(bH,$)}var NH=K("ZodISODuration",($,I)=>{oJ.init($,I),K$.init($,I)});function NX($){return sJ(NH,$)}var OH=($,I)=>{JD.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>JN($,U)},flatten:{value:(U)=>BN($,U)},addIssue:{value:(U)=>$.issues.push(U)},addIssues:{value:(U)=>$.issues.push(...U)},isEmpty:{get(){return $.issues.length===0}}})},Im=K("ZodError",OH),$U=K("ZodError",OH,{Parent:Error});var XH=HN($U),WH=zN($U),GH=KN($U),QH=vN($U);var E$=K("ZodType",($,I)=>{return W$.init($,I),$.def=I,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((A)=>typeof A==="function"?{_zod:{check:A,def:{check:"custom"},onattach:[]}}:A)]})},$.clone=(U,A)=>N6($,U,A),$.brand=()=>$,$.register=(U,A)=>{return U.add($,A),$},$.parse=(U,A)=>XH($,U,A,{callee:$.parse}),$.safeParse=(U,A)=>GH($,U,A),$.parseAsync=async(U,A)=>WH($,U,A,{callee:$.parseAsync}),$.safeParseAsync=async(U,A)=>QH($,U,A),$.spa=$.safeParseAsync,$.refine=(U,A)=>$.check(Cj(U,A)),$.superRefine=(U)=>$.check(Zj(U)),$.overwrite=(U)=>$.check(i4(U)),$.optional=()=>F$($),$.nullable=()=>JH($),$.nullish=()=>F$(JH($)),$.nonoptional=(U)=>Sj($,U),$.array=()=>D$($),$.or=(U)=>z$([$,U]),$.and=(U)=>_D($,U),$.transform=(U)=>XX($,KH(U)),$.default=(U)=>qj($,U),$.prefault=(U)=>Ej($,U),$.catch=(U)=>kj($,U),$.pipe=(U)=>XX($,U),$.readonly=()=>Tj($),$.describe=(U)=>{let A=$.clone();return Q4.add(A,{description:U}),A},Object.defineProperty($,"description",{get(){return Q4.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return Q4.get($);let A=$.clone();return Q4.add(A,U[0]),A},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),HH=K("_ZodString",($,I)=>{t1.init($,I),E$.init($,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...A)=>$.check(mO(...A)),$.includes=(...A)=>$.check(iO(...A)),$.startsWith=(...A)=>$.check(oO(...A)),$.endsWith=(...A)=>$.check(dO(...A)),$.min=(...A)=>$.check(VI(...A)),$.max=(...A)=>$.check(SD(...A)),$.length=(...A)=>$.check(jD(...A)),$.nonempty=(...A)=>$.check(VI(1,...A)),$.lowercase=(A)=>$.check(rO(A)),$.uppercase=(A)=>$.check(nO(A)),$.trim=()=>$.check(tO()),$.normalize=(...A)=>$.check(pO(...A)),$.toLowerCase=()=>$.check(aO()),$.toUpperCase=()=>$.check(eO())}),nS=K("ZodString",($,I)=>{t1.init($,I),HH.init($,I),$.email=(U)=>$.check(HO(iS,U)),$.url=(U)=>$.check(vO(oS,U)),$.jwt=(U)=>$.check(xO(Oj,U)),$.emoji=(U)=>$.check(VO(dS,U)),$.guid=(U)=>$.check(VD(YH,U)),$.uuid=(U)=>$.check(LO(TD,U)),$.uuidv4=(U)=>$.check(zO(TD,U)),$.uuidv6=(U)=>$.check(MO(TD,U)),$.uuidv7=(U)=>$.check(KO(TD,U)),$.nanoid=(U)=>$.check(qO(pS,U)),$.guid=(U)=>$.check(VD(YH,U)),$.cuid=(U)=>$.check(FO(tS,U)),$.cuid2=(U)=>$.check(EO(aS,U)),$.ulid=(U)=>$.check(SO(eS,U)),$.base64=(U)=>$.check(CO(wj,U)),$.base64url=(U)=>$.check(ZO(bj,U)),$.xid=(U)=>$.check(jO(sS,U)),$.ksuid=(U)=>$.check(kO($j,U)),$.ipv4=(U)=>$.check(PO(Ij,U)),$.ipv6=(U)=>$.check(RO(Uj,U)),$.cidrv4=(U)=>$.check(TO(Dj,U)),$.cidrv6=(U)=>$.check(_O(Aj,U)),$.e164=(U)=>$.check(gO(Nj,U)),$.datetime=(U)=>$.check(AX(U)),$.date=(U)=>$.check(wX(U)),$.time=(U)=>$.check(bX(U)),$.duration=(U)=>$.check(NX(U))});function M($){return JO(nS,$)}var K$=K("ZodStringFormat",($,I)=>{L$.init($,I),HH.init($,I)}),iS=K("ZodEmail",($,I)=>{RN.init($,I),K$.init($,I)});var YH=K("ZodGUID",($,I)=>{kN.init($,I),K$.init($,I)});var TD=K("ZodUUID",($,I)=>{PN.init($,I),K$.init($,I)});var oS=K("ZodURL",($,I)=>{TN.init($,I),K$.init($,I)});var dS=K("ZodEmoji",($,I)=>{_N.init($,I),K$.init($,I)});var pS=K("ZodNanoID",($,I)=>{CN.init($,I),K$.init($,I)});var tS=K("ZodCUID",($,I)=>{ZN.init($,I),K$.init($,I)});var aS=K("ZodCUID2",($,I)=>{gN.init($,I),K$.init($,I)});var eS=K("ZodULID",($,I)=>{xN.init($,I),K$.init($,I)});var sS=K("ZodXID",($,I)=>{hN.init($,I),K$.init($,I)});var $j=K("ZodKSUID",($,I)=>{fN.init($,I),K$.init($,I)});var Ij=K("ZodIPv4",($,I)=>{yN.init($,I),K$.init($,I)});var Uj=K("ZodIPv6",($,I)=>{uN.init($,I),K$.init($,I)});var Dj=K("ZodCIDRv4",($,I)=>{lN.init($,I),K$.init($,I)});var Aj=K("ZodCIDRv6",($,I)=>{cN.init($,I),K$.init($,I)});var wj=K("ZodBase64",($,I)=>{mN.init($,I),K$.init($,I)});var bj=K("ZodBase64URL",($,I)=>{rN.init($,I),K$.init($,I)});var Nj=K("ZodE164",($,I)=>{nN.init($,I),K$.init($,I)});var Oj=K("ZodJWT",($,I)=>{iN.init($,I),K$.init($,I)});var LH=K("ZodNumber",($,I)=>{zD.init($,I),E$.init($,I),$.gt=(A,D)=>$.check(FD(A,D)),$.gte=(A,D)=>$.check(e1(A,D)),$.min=(A,D)=>$.check(e1(A,D)),$.lt=(A,D)=>$.check(qD(A,D)),$.lte=(A,D)=>$.check(a1(A,D)),$.max=(A,D)=>$.check(a1(A,D)),$.int=(A)=>$.check(BH(A)),$.safe=(A)=>$.check(BH(A)),$.positive=(A)=>$.check(FD(0,A)),$.nonnegative=(A)=>$.check(e1(0,A)),$.negative=(A)=>$.check(qD(0,A)),$.nonpositive=(A)=>$.check(a1(0,A)),$.multipleOf=(A,D)=>$.check(ED(A,D)),$.step=(A,D)=>$.check(ED(A,D)),$.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 O$($){return hO(LH,$)}var Xj=K("ZodNumberFormat",($,I)=>{oN.init($,I),LH.init($,I)});function BH($){return fO(Xj,$)}var Wj=K("ZodBoolean",($,I)=>{dN.init($,I),E$.init($,I)});function T$($){return yO(Wj,$)}var Gj=K("ZodNull",($,I)=>{pN.init($,I),E$.init($,I)});function WX($){return uO(Gj,$)}var Qj=K("ZodUnknown",($,I)=>{tN.init($,I),E$.init($,I)});function v$(){return lO(Qj)}var Yj=K("ZodNever",($,I)=>{aN.init($,I),E$.init($,I)});function Bj($){return cO(Yj,$)}var Jj=K("ZodArray",($,I)=>{eN.init($,I),E$.init($,I),$.element=I.element,$.min=(U,A)=>$.check(VI(U,A)),$.nonempty=(U)=>$.check(VI(1,U)),$.max=(U,A)=>$.check(SD(U,A)),$.length=(U,A)=>$.check(jD(U,A)),$.unwrap=()=>$.element});function D$($,I){return $H(Jj,$,I)}var zH=K("ZodObject",($,I)=>{MD.init($,I),E$.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:Bj()}),$.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(vH,$,U[0]),$.required=(...U)=>I$.required(VH,$,U[0])});function Z($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new zH(U)}function m$($,I){return new zH({type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},catchall:v$(),...I$.normalizeParams(I)})}var MH=K("ZodUnion",($,I)=>{KD.init($,I),E$.init($,I),$.options=I.options});function z$($,I){return new MH({type:"union",options:$,...I$.normalizeParams(I)})}var Hj=K("ZodDiscriminatedUnion",($,I)=>{MH.init($,I),sN.init($,I)});function GX($,I,U){return new Hj({type:"union",options:I,discriminator:$,...I$.normalizeParams(U)})}var Lj=K("ZodIntersection",($,I)=>{$O.init($,I),E$.init($,I)});function _D($,I){return new Lj({type:"intersection",left:$,right:I})}var zj=K("ZodRecord",($,I)=>{IO.init($,I),E$.init($,I),$.keyType=I.keyType,$.valueType=I.valueType});function V$($,I,U){return new zj({type:"record",keyType:$,valueType:I,...I$.normalizeParams(U)})}var OX=K("ZodEnum",($,I)=>{UO.init($,I),E$.init($,I),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(A,D)=>{let w={};for(let b of A)if(U.has(b))w[b]=I.entries[b];else throw new Error(`Key ${b} not found in enum`);return new OX({...I,checks:[],...I$.normalizeParams(D),entries:w})},$.exclude=(A,D)=>{let w={...I.entries};for(let b of A)if(U.has(b))delete w[b];else throw new Error(`Key ${b} not found in enum`);return new OX({...I,checks:[],...I$.normalizeParams(D),entries:w})}});function a$($,I){let U=Array.isArray($)?Object.fromEntries($.map((A)=>[A,A])):$;return new OX({type:"enum",entries:U,...I$.normalizeParams(I)})}var Mj=K("ZodLiteral",($,I)=>{DO.init($,I),E$.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 Mj({type:"literal",values:Array.isArray($)?$:[$],...I$.normalizeParams(I)})}var Kj=K("ZodTransform",($,I)=>{AO.init($,I),E$.init($,I),$._zod.parse=(U,A)=>{U.addIssue=(w)=>{if(typeof w==="string")U.issues.push(I$.issue(w,U.value,I));else{let b=w;if(b.fatal)b.continue=!1;b.code??(b.code="custom"),b.input??(b.input=U.value),b.inst??(b.inst=$),b.continue??(b.continue=!0),U.issues.push(I$.issue(b))}};let D=I.transform(U.value,U);if(D instanceof Promise)return D.then((w)=>{return U.value=w,U});return U.value=D,U}});function KH($){return new Kj({type:"transform",transform:$})}var vH=K("ZodOptional",($,I)=>{wO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType});function F$($){return new vH({type:"optional",innerType:$})}var vj=K("ZodNullable",($,I)=>{bO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType});function JH($){return new vj({type:"nullable",innerType:$})}var Vj=K("ZodDefault",($,I)=>{NO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function qj($,I){return new Vj({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var Fj=K("ZodPrefault",($,I)=>{OO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType});function Ej($,I){return new Fj({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var VH=K("ZodNonOptional",($,I)=>{XO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType});function Sj($,I){return new VH({type:"nonoptional",innerType:$,...I$.normalizeParams(I)})}var jj=K("ZodCatch",($,I)=>{WO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function kj($,I){return new jj({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var Pj=K("ZodPipe",($,I)=>{GO.init($,I),E$.init($,I),$.in=I.in,$.out=I.out});function XX($,I){return new Pj({type:"pipe",in:$,out:I})}var Rj=K("ZodReadonly",($,I)=>{QO.init($,I),E$.init($,I)});function Tj($){return new Rj({type:"readonly",innerType:$})}var qH=K("ZodCustom",($,I)=>{YO.init($,I),E$.init($,I)});function _j($){let I=new C$({check:"custom"});return I._zod.check=$,I}function FH($,I){return sO(qH,$??(()=>!0),I)}function Cj($,I={}){return $X(qH,$,I)}function Zj($){let I=_j((U)=>{return U.addIssue=(A)=>{if(typeof A==="string")U.issues.push(I$.issue(A,U.value,I._zod.def));else{let D=A;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=I),D.continue??(D.continue=!I._zod.def.abort),U.issues.push(I$.issue(D))}},$(U.value,U)});return I}function QX($,I){return XX(KH($),I)}b6(BO());var YX="2025-11-25";var EH=[YX,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],J4="io.modelcontextprotocol/related-task",ZD="2.0",Z$=FH(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),SH=z$([M(),O$().int()]),jH=M(),Jm=m$({ttl:z$([O$(),WX()]).optional(),pollInterval:O$().optional()}),gj=Z({ttl:O$().optional()}),xj=Z({taskId:M()}),BX=m$({progressToken:SH.optional(),[J4]:xj.optional()}),O6=Z({_meta:BX.optional()}),IU=O6.extend({task:gj.optional()}),kH=($)=>IU.safeParse($).success,g$=Z({method:M(),params:O6.loose().optional()}),B6=Z({_meta:BX.optional()}),J6=Z({method:M(),params:B6.loose().optional()}),x$=m$({_meta:BX.optional()}),gD=z$([M(),O$().int()]),PH=Z({jsonrpc:y(ZD),id:gD,...g$.shape}).strict(),JX=($)=>PH.safeParse($).success,RH=Z({jsonrpc:y(ZD),...J6.shape}).strict(),TH=($)=>RH.safeParse($).success,HX=Z({jsonrpc:y(ZD),id:gD,result:x$}).strict(),UU=($)=>HX.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 LX=Z({jsonrpc:y(ZD),id:gD.optional(),error:Z({code:O$().int(),message:M(),data:v$().optional()})}).strict();var _H=($)=>LX.safeParse($).success;var CH=z$([PH,RH,HX,LX]),Hm=z$([HX,LX]),xD=x$.strict(),hj=B6.extend({requestId:gD.optional(),reason:M().optional()}),hD=J6.extend({method:y("notifications/cancelled"),params:hj}),fj=Z({src:M(),mimeType:M().optional(),sizes:D$(M()).optional(),theme:a$(["light","dark"]).optional()}),DU=Z({icons:D$(fj).optional()}),FI=Z({name:M(),title:M().optional()}),ZH=FI.extend({...FI.shape,...DU.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),yj=_D(Z({applyDefaults:T$().optional()}),V$(M(),v$())),uj=QX(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},_D(Z({form:yj.optional(),url:Z$.optional()}),V$(M(),v$()).optional())),lj=m$({list:Z$.optional(),cancel:Z$.optional(),requests:m$({sampling:m$({createMessage:Z$.optional()}).optional(),elicitation:m$({create:Z$.optional()}).optional()}).optional()}),cj=m$({list:Z$.optional(),cancel:Z$.optional(),requests:m$({tools:m$({call:Z$.optional()}).optional()}).optional()}),mj=Z({experimental:V$(M(),Z$).optional(),sampling:Z({context:Z$.optional(),tools:Z$.optional()}).optional(),elicitation:uj.optional(),roots:Z({listChanged:T$().optional()}).optional(),tasks:lj.optional()}),rj=O6.extend({protocolVersion:M(),capabilities:mj,clientInfo:ZH}),zX=g$.extend({method:y("initialize"),params:rj});var nj=Z({experimental:V$(M(),Z$).optional(),logging:Z$.optional(),completions:Z$.optional(),prompts:Z({listChanged:T$().optional()}).optional(),resources:Z({subscribe:T$().optional(),listChanged:T$().optional()}).optional(),tools:Z({listChanged:T$().optional()}).optional(),tasks:cj.optional()}),ij=x$.extend({protocolVersion:M(),capabilities:nj,serverInfo:ZH,instructions:M().optional()}),MX=J6.extend({method:y("notifications/initialized"),params:B6.optional()});var fD=g$.extend({method:y("ping"),params:O6.optional()}),oj=Z({progress:O$(),total:F$(O$()),message:F$(M())}),dj=Z({...B6.shape,...oj.shape,progressToken:SH}),yD=J6.extend({method:y("notifications/progress"),params:dj}),pj=O6.extend({cursor:jH.optional()}),AU=g$.extend({params:pj.optional()}),wU=x$.extend({nextCursor:jH.optional()}),tj=a$(["working","input_required","completed","failed","cancelled"]),bU=Z({taskId:M(),status:tj,ttl:z$([O$(),WX()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:F$(O$()),statusMessage:F$(M())}),EI=x$.extend({task:bU}),aj=B6.merge(bU),NU=J6.extend({method:y("notifications/tasks/status"),params:aj}),uD=g$.extend({method:y("tasks/get"),params:O6.extend({taskId:M()})}),lD=x$.merge(bU),cD=g$.extend({method:y("tasks/result"),params:O6.extend({taskId:M()})}),Lm=x$.loose(),mD=AU.extend({method:y("tasks/list")}),rD=wU.extend({tasks:D$(bU)}),nD=g$.extend({method:y("tasks/cancel"),params:O6.extend({taskId:M()})}),gH=x$.merge(bU),xH=Z({uri:M(),mimeType:F$(M()),_meta:V$(M(),v$()).optional()}),hH=xH.extend({text:M()}),KX=M().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),fH=xH.extend({blob:KX}),OU=a$(["user","assistant"]),SI=Z({audience:D$(OU).optional(),priority:O$().min(0).max(1).optional(),lastModified:s1.datetime({offset:!0}).optional()}),yH=Z({...FI.shape,...DU.shape,uri:M(),description:F$(M()),mimeType:F$(M()),annotations:SI.optional(),_meta:F$(m$({}))}),ej=Z({...FI.shape,...DU.shape,uriTemplate:M(),description:F$(M()),mimeType:F$(M()),annotations:SI.optional(),_meta:F$(m$({}))}),iD=AU.extend({method:y("resources/list")}),sj=wU.extend({resources:D$(yH)}),oD=AU.extend({method:y("resources/templates/list")}),$k=wU.extend({resourceTemplates:D$(ej)}),vX=O6.extend({uri:M()}),Ik=vX,dD=g$.extend({method:y("resources/read"),params:Ik}),Uk=x$.extend({contents:D$(z$([hH,fH]))}),Dk=J6.extend({method:y("notifications/resources/list_changed"),params:B6.optional()}),Ak=vX,wk=g$.extend({method:y("resources/subscribe"),params:Ak}),bk=vX,Nk=g$.extend({method:y("resources/unsubscribe"),params:bk}),Ok=B6.extend({uri:M()}),Xk=J6.extend({method:y("notifications/resources/updated"),params:Ok}),Wk=Z({name:M(),description:F$(M()),required:F$(T$())}),Gk=Z({...FI.shape,...DU.shape,description:F$(M()),arguments:F$(D$(Wk)),_meta:F$(m$({}))}),pD=AU.extend({method:y("prompts/list")}),Qk=wU.extend({prompts:D$(Gk)}),Yk=O6.extend({name:M(),arguments:V$(M(),M()).optional()}),tD=g$.extend({method:y("prompts/get"),params:Yk}),VX=Z({type:y("text"),text:M(),annotations:SI.optional(),_meta:V$(M(),v$()).optional()}),qX=Z({type:y("image"),data:KX,mimeType:M(),annotations:SI.optional(),_meta:V$(M(),v$()).optional()}),FX=Z({type:y("audio"),data:KX,mimeType:M(),annotations:SI.optional(),_meta:V$(M(),v$()).optional()}),Bk=Z({type:y("tool_use"),name:M(),id:M(),input:V$(M(),v$()),_meta:V$(M(),v$()).optional()}),Jk=Z({type:y("resource"),resource:z$([hH,fH]),annotations:SI.optional(),_meta:V$(M(),v$()).optional()}),Hk=yH.extend({type:y("resource_link")}),EX=z$([VX,qX,FX,Hk,Jk]),Lk=Z({role:OU,content:EX}),zk=x$.extend({description:M().optional(),messages:D$(Lk)}),Mk=J6.extend({method:y("notifications/prompts/list_changed"),params:B6.optional()}),Kk=Z({title:M().optional(),readOnlyHint:T$().optional(),destructiveHint:T$().optional(),idempotentHint:T$().optional(),openWorldHint:T$().optional()}),vk=Z({taskSupport:a$(["required","optional","forbidden"]).optional()}),uH=Z({...FI.shape,...DU.shape,description:M().optional(),inputSchema:Z({type:y("object"),properties:V$(M(),Z$).optional(),required:D$(M()).optional()}).catchall(v$()),outputSchema:Z({type:y("object"),properties:V$(M(),Z$).optional(),required:D$(M()).optional()}).catchall(v$()).optional(),annotations:Kk.optional(),execution:vk.optional(),_meta:V$(M(),v$()).optional()}),aD=AU.extend({method:y("tools/list")}),Vk=wU.extend({tools:D$(uH)}),eD=x$.extend({content:D$(EX).default([]),structuredContent:V$(M(),v$()).optional(),isError:T$().optional()}),zm=eD.or(x$.extend({toolResult:v$()})),qk=IU.extend({name:M(),arguments:V$(M(),v$()).optional()}),jI=g$.extend({method:y("tools/call"),params:qk}),Fk=J6.extend({method:y("notifications/tools/list_changed"),params:B6.optional()}),Mm=Z({autoRefresh:T$().default(!0),debounceMs:O$().int().nonnegative().default(300)}),XU=a$(["debug","info","notice","warning","error","critical","alert","emergency"]),Ek=O6.extend({level:XU}),SX=g$.extend({method:y("logging/setLevel"),params:Ek}),Sk=B6.extend({level:XU,logger:M().optional(),data:v$()}),jk=J6.extend({method:y("notifications/message"),params:Sk}),kk=Z({name:M().optional()}),Pk=Z({hints:D$(kk).optional(),costPriority:O$().min(0).max(1).optional(),speedPriority:O$().min(0).max(1).optional(),intelligencePriority:O$().min(0).max(1).optional()}),Rk=Z({mode:a$(["auto","required","none"]).optional()}),Tk=Z({type:y("tool_result"),toolUseId:M().describe("The unique identifier for the corresponding tool call."),content:D$(EX).default([]),structuredContent:Z({}).loose().optional(),isError:T$().optional(),_meta:V$(M(),v$()).optional()}),_k=GX("type",[VX,qX,FX]),CD=GX("type",[VX,qX,FX,Bk,Tk]),Ck=Z({role:OU,content:z$([CD,D$(CD)]),_meta:V$(M(),v$()).optional()}),Zk=IU.extend({messages:D$(Ck),modelPreferences:Pk.optional(),systemPrompt:M().optional(),includeContext:a$(["none","thisServer","allServers"]).optional(),temperature:O$().optional(),maxTokens:O$().int(),stopSequences:D$(M()).optional(),metadata:Z$.optional(),tools:D$(uH).optional(),toolChoice:Rk.optional()}),gk=g$.extend({method:y("sampling/createMessage"),params:Zk}),jX=x$.extend({model:M(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens"]).or(M())),role:OU,content:_k}),kX=x$.extend({model:M(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens","toolUse"]).or(M())),role:OU,content:z$([CD,D$(CD)])}),xk=Z({type:y("boolean"),title:M().optional(),description:M().optional(),default:T$().optional()}),hk=Z({type:y("string"),title:M().optional(),description:M().optional(),minLength:O$().optional(),maxLength:O$().optional(),format:a$(["email","uri","date","date-time"]).optional(),default:M().optional()}),fk=Z({type:a$(["number","integer"]),title:M().optional(),description:M().optional(),minimum:O$().optional(),maximum:O$().optional(),default:O$().optional()}),yk=Z({type:y("string"),title:M().optional(),description:M().optional(),enum:D$(M()),default:M().optional()}),uk=Z({type:y("string"),title:M().optional(),description:M().optional(),oneOf:D$(Z({const:M(),title:M()})),default:M().optional()}),lk=Z({type:y("string"),title:M().optional(),description:M().optional(),enum:D$(M()),enumNames:D$(M()).optional(),default:M().optional()}),ck=z$([yk,uk]),mk=Z({type:y("array"),title:M().optional(),description:M().optional(),minItems:O$().optional(),maxItems:O$().optional(),items:Z({type:y("string"),enum:D$(M())}),default:D$(M()).optional()}),rk=Z({type:y("array"),title:M().optional(),description:M().optional(),minItems:O$().optional(),maxItems:O$().optional(),items:Z({anyOf:D$(Z({const:M(),title:M()}))}),default:D$(M()).optional()}),nk=z$([mk,rk]),ik=z$([lk,ck,nk]),ok=z$([ik,xk,hk,fk]),dk=IU.extend({mode:y("form").optional(),message:M(),requestedSchema:Z({type:y("object"),properties:V$(M(),ok),required:D$(M()).optional()})}),pk=IU.extend({mode:y("url"),message:M(),elicitationId:M(),url:M().url()}),tk=z$([dk,pk]),ak=g$.extend({method:y("elicitation/create"),params:tk}),ek=B6.extend({elicitationId:M()}),sk=J6.extend({method:y("notifications/elicitation/complete"),params:ek}),sD=x$.extend({action:a$(["accept","decline","cancel"]),content:QX(($)=>$===null?void 0:$,V$(M(),z$([M(),O$(),T$(),D$(M())])).optional())}),$P=Z({type:y("ref/resource"),uri:M()});var IP=Z({type:y("ref/prompt"),name:M()}),UP=O6.extend({ref:z$([IP,$P]),argument:Z({name:M(),value:M()}),context:Z({arguments:V$(M(),M()).optional()}).optional()}),$A=g$.extend({method:y("completion/complete"),params:UP});function lH($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function cH($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var DP=x$.extend({completion:m$({values:D$(M()).max(100),total:F$(O$().int()),hasMore:F$(T$())})}),AP=Z({uri:M().startsWith("file://"),name:M().optional(),_meta:V$(M(),v$()).optional()}),wP=g$.extend({method:y("roots/list"),params:O6.optional()}),PX=x$.extend({roots:D$(AP)}),bP=J6.extend({method:y("notifications/roots/list_changed"),params:B6.optional()}),Km=z$([fD,zX,$A,SX,tD,pD,iD,oD,dD,wk,Nk,jI,aD,uD,cD,mD,nD]),vm=z$([hD,yD,MX,bP,NU]),Vm=z$([xD,jX,kX,sD,PX,lD,rD,EI]),qm=z$([fD,gk,ak,wP,uD,cD,mD,nD]),Fm=z$([hD,yD,jk,Xk,Dk,Fk,Mk,NU,sk]),Em=z$([xD,ij,DP,zk,Qk,sj,$k,Uk,eD,Vk,lD,rD,EI]);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 A=U;if(A.elicitations)return new mH(A.elicitations,I)}return new f($,I,U)}}class mH extends f{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(c.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function H4($){return $==="completed"||$==="failed"||$==="cancelled"}var nH=Symbol("Let zodToJsonSchema decide on which parser to use");var rH={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"},iH=($)=>typeof $==="string"?{...rH,name:$}:{...rH,...$};var oH=($)=>{let I=iH($),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(([A,D])=>[D._def,{def:D._def,path:[...I.basePath,I.definitionPath,A],jsonSchema:void 0}]))}};function RX($,I,U,A){if(!A?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function A$($,I,U,A,D){$[I]=U,RX($,I,A,D)}var IA=($,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 q$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?IA(I,$.currentPath):I.join("/")}}function dH($,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)A$(U,"minItems",$.minLength.value,$.minLength.message,I);if($.maxLength)A$(U,"maxItems",$.maxLength.value,$.maxLength.message,I);if($.exactLength)A$(U,"minItems",$.exactLength.value,$.exactLength.message,I),A$(U,"maxItems",$.exactLength.value,$.exactLength.message,I);return U}function pH($,I){let U={type:"integer",format:"int64"};if(!$.checks)return U;for(let A of $.checks)switch(A.kind){case"min":if(I.target==="jsonSchema7")if(A.inclusive)A$(U,"minimum",A.value,A.message,I);else A$(U,"exclusiveMinimum",A.value,A.message,I);else{if(!A.inclusive)U.exclusiveMinimum=!0;A$(U,"minimum",A.value,A.message,I)}break;case"max":if(I.target==="jsonSchema7")if(A.inclusive)A$(U,"maximum",A.value,A.message,I);else A$(U,"exclusiveMaximum",A.value,A.message,I);else{if(!A.inclusive)U.exclusiveMaximum=!0;A$(U,"maximum",A.value,A.message,I)}break;case"multipleOf":A$(U,"multipleOf",A.value,A.message,I);break}return U}function tH(){return{type:"boolean"}}function UA($,I){return n($.type._def,I)}var aH=($,I)=>{return n($.innerType._def,I)};function TX($,I,U){let A=U??I.dateStrategy;if(Array.isArray(A))return{anyOf:A.map((D,w)=>TX($,I,D))};switch(A){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return NP($,I)}}var NP=($,I)=>{let U={type:"integer",format:"unix-time"};if(I.target==="openApi3")return U;for(let A of $.checks)switch(A.kind){case"min":A$(U,"minimum",A.value,A.message,I);break;case"max":A$(U,"maximum",A.value,A.message,I);break}return U};function eH($,I){return{...n($.innerType._def,I),default:$.defaultValue()}}function sH($,I){return I.effectStrategy==="input"?n($.schema._def,I):q$(I)}function $L($){return{type:"string",enum:Array.from($.values)}}var OP=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function IL($,I){let U=[n($.left._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),n($.right._def,{...I,currentPath:[...I.currentPath,"allOf","1"]})].filter((w)=>!!w),A=I.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,D=[];return U.forEach((w)=>{if(OP(w)){if(D.push(...w.allOf),w.unevaluatedProperties===void 0)A=void 0}else{let b=w;if("additionalProperties"in w&&w.additionalProperties===!1){let{additionalProperties:N,...O}=w;b=O}else A=void 0;D.push(b)}}),D.length?{allOf:D,...A}:void 0}function UL($,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 _X=void 0,q6={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(_X===void 0)_X=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return _X},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 DA($,I){let U={type:"string"};if($.checks)for(let A of $.checks)switch(A.kind){case"min":A$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,A.value):A.value,A.message,I);break;case"max":A$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,A.value):A.value,A.message,I);break;case"email":switch(I.emailStrategy){case"format:email":F6(U,"email",A.message,I);break;case"format:idn-email":F6(U,"idn-email",A.message,I);break;case"pattern:zod":r$(U,q6.email,A.message,I);break}break;case"url":F6(U,"uri",A.message,I);break;case"uuid":F6(U,"uuid",A.message,I);break;case"regex":r$(U,A.regex,A.message,I);break;case"cuid":r$(U,q6.cuid,A.message,I);break;case"cuid2":r$(U,q6.cuid2,A.message,I);break;case"startsWith":r$(U,RegExp(`^${CX(A.value,I)}`),A.message,I);break;case"endsWith":r$(U,RegExp(`${CX(A.value,I)}$`),A.message,I);break;case"datetime":F6(U,"date-time",A.message,I);break;case"date":F6(U,"date",A.message,I);break;case"time":F6(U,"time",A.message,I);break;case"duration":F6(U,"duration",A.message,I);break;case"length":A$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,A.value):A.value,A.message,I),A$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,A.value):A.value,A.message,I);break;case"includes":{r$(U,RegExp(CX(A.value,I)),A.message,I);break}case"ip":{if(A.version!=="v6")F6(U,"ipv4",A.message,I);if(A.version!=="v4")F6(U,"ipv6",A.message,I);break}case"base64url":r$(U,q6.base64url,A.message,I);break;case"jwt":r$(U,q6.jwt,A.message,I);break;case"cidr":{if(A.version!=="v6")r$(U,q6.ipv4Cidr,A.message,I);if(A.version!=="v4")r$(U,q6.ipv6Cidr,A.message,I);break}case"emoji":r$(U,q6.emoji(),A.message,I);break;case"ulid":{r$(U,q6.ulid,A.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{F6(U,"binary",A.message,I);break}case"contentEncoding:base64":{A$(U,"contentEncoding","base64",A.message,I);break}case"pattern:zod":{r$(U,q6.base64,A.message,I);break}}break}case"nanoid":r$(U,q6.nanoid,A.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((D)=>{})(A)}return U}function CX($,I){return I.patternStrategy==="escape"?WP($):$}var XP=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function WP($){let I="";for(let U=0;U<$.length;U++){if(!XP.has($[U]))I+="\\";I+=$[U]}return I}function F6($,I,U,A){if($.format||$.anyOf?.some((D)=>D.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&A.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:I,...U&&A.errorMessages&&{errorMessage:{format:U}}})}else A$($,"format",I,U,A)}function r$($,I,U,A){if($.pattern||$.allOf?.some((D)=>D.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&A.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:DL(I,A),...U&&A.errorMessages&&{errorMessage:{pattern:U}}})}else A$($,"pattern",DL(I,A),U,A)}function DL($,I){if(!I.applyRegexFlags||!$.flags)return $.source;let U={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},A=U.i?$.source.toLowerCase():$.source,D="",w=!1,b=!1,N=!1;for(let O=0;O<A.length;O++){if(w){D+=A[O],w=!1;continue}if(U.i){if(b){if(A[O].match(/[a-z]/)){if(N)D+=A[O],D+=`${A[O-2]}-${A[O]}`.toUpperCase(),N=!1;else if(A[O+1]==="-"&&A[O+2]?.match(/[a-z]/))D+=A[O],N=!0;else D+=`${A[O]}${A[O].toUpperCase()}`;continue}}else if(A[O].match(/[a-z]/)){D+=`[${A[O]}${A[O].toUpperCase()}]`;continue}}if(U.m){if(A[O]==="^"){D+=`(^|(?<=[\r
37
+ ]))`;continue}else if(A[O]==="$"){D+=`($|(?=[\r
38
+ ]))`;continue}}if(U.s&&A[O]==="."){D+=b?`${A[O]}\r
39
+ `:`[${A[O]}\r
40
+ ]`;continue}if(D+=A[O],A[O]==="\\")w=!0;else if(b&&A[O]==="]")b=!1;else if(!b&&A[O]==="[")b=!0}try{new RegExp(D)}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 D}function AA($,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((A,D)=>({...A,[D]:n($.valueType._def,{...I,currentPath:[...I.currentPath,"properties",D]})??q$(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:A,...D}=DA($.keyType._def,I);return{...U,propertyNames:D}}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:A,...D}=UA($.keyType._def,I);return{...U,propertyNames:D}}return U}function AL($,I){if(I.mapStrategy==="record")return AA($,I);let U=n($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||q$(I),A=n($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||q$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,A],minItems:2,maxItems:2}}}function wL($){let I=$.values,A=Object.keys($.values).filter((w)=>{return typeof I[I[w]]!=="number"}).map((w)=>I[w]),D=Array.from(new Set(A.map((w)=>typeof w)));return{type:D.length===1?D[0]==="string"?"string":"number":["string","number"],enum:A}}function bL($){return $.target==="openAi"?void 0:{not:q$({...$,currentPath:[...$.currentPath,"not"]})}}function NL($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var WU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function XL($,I){if(I.target==="openApi3")return OL($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((A)=>(A._def.typeName in WU)&&(!A._def.checks||!A._def.checks.length))){let A=U.reduce((D,w)=>{let b=WU[w._def.typeName];return b&&!D.includes(b)?[...D,b]:D},[]);return{type:A.length>1?A:A[0]}}else if(U.every((A)=>A._def.typeName==="ZodLiteral"&&!A.description)){let A=U.reduce((D,w)=>{let b=typeof w._def.value;switch(b){case"string":case"number":case"boolean":return[...D,b];case"bigint":return[...D,"integer"];case"object":if(w._def.value===null)return[...D,"null"];case"symbol":case"undefined":case"function":default:return D}},[]);if(A.length===U.length){let D=A.filter((w,b,N)=>N.indexOf(w)===b);return{type:D.length>1?D:D[0],enum:U.reduce((w,b)=>{return w.includes(b._def.value)?w:[...w,b._def.value]},[])}}}else if(U.every((A)=>A._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((A,D)=>[...A,...D._def.values.filter((w)=>!A.includes(w))],[])};return OL($,I)}var OL=($,I)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((A,D)=>n(A._def,{...I,currentPath:[...I.currentPath,"anyOf",`${D}`]})).filter((A)=>!!A&&(!I.strictUnions||typeof A==="object"&&Object.keys(A).length>0));return U.length?{anyOf:U}:void 0};function WL($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:WU[$.innerType._def.typeName],nullable:!0};return{type:[WU[$.innerType._def.typeName],"null"]}}if(I.target==="openApi3"){let A=n($.innerType._def,{...I,currentPath:[...I.currentPath]});if(A&&"$ref"in A)return{allOf:[A],nullable:!0};return A&&{...A,nullable:!0}}let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","0"]});return U&&{anyOf:[U,{type:"null"}]}}function GL($,I){let U={type:"number"};if(!$.checks)return U;for(let A of $.checks)switch(A.kind){case"int":U.type="integer",RX(U,"type",A.message,I);break;case"min":if(I.target==="jsonSchema7")if(A.inclusive)A$(U,"minimum",A.value,A.message,I);else A$(U,"exclusiveMinimum",A.value,A.message,I);else{if(!A.inclusive)U.exclusiveMinimum=!0;A$(U,"minimum",A.value,A.message,I)}break;case"max":if(I.target==="jsonSchema7")if(A.inclusive)A$(U,"maximum",A.value,A.message,I);else A$(U,"exclusiveMaximum",A.value,A.message,I);else{if(!A.inclusive)U.exclusiveMaximum=!0;A$(U,"maximum",A.value,A.message,I)}break;case"multipleOf":A$(U,"multipleOf",A.value,A.message,I);break}return U}function QL($,I){let U=I.target==="openAi",A={type:"object",properties:{}},D=[],w=$.shape();for(let N in w){let O=w[N];if(O===void 0||O._def===void 0)continue;let X=QP(O);if(X&&U){if(O._def.typeName==="ZodOptional")O=O._def.innerType;if(!O.isNullable())O=O.nullable();X=!1}let W=n(O._def,{...I,currentPath:[...I.currentPath,"properties",N],propertyPath:[...I.currentPath,"properties",N]});if(W===void 0)continue;if(A.properties[N]=W,!X)D.push(N)}if(D.length)A.required=D;let b=GP($,I);if(b!==void 0)A.additionalProperties=b;return A}function GP($,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 QP($){try{return $.isOptional()}catch{return!0}}var YL=($,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:q$(I)},U]}:q$(I)};var BL=($,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"]}),A=n($.out._def,{...I,currentPath:[...I.currentPath,"allOf",U?"1":"0"]});return{allOf:[U,A].filter((D)=>D!==void 0)}};function JL($,I){return n($.type._def,I)}function HL($,I){let A={type:"array",uniqueItems:!0,items:n($.valueType._def,{...I,currentPath:[...I.currentPath,"items"]})};if($.minSize)A$(A,"minItems",$.minSize.value,$.minSize.message,I);if($.maxSize)A$(A,"maxItems",$.maxSize.value,$.maxSize.message,I);return A}function LL($,I){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((U,A)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${A}`]})).reduce((U,A)=>A===void 0?U:[...U,A],[]),additionalItems:n($.rest._def,{...I,currentPath:[...I.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((U,A)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${A}`]})).reduce((U,A)=>A===void 0?U:[...U,A],[])}}function zL($){return{not:q$($)}}function ML($){return q$($)}var KL=($,I)=>{return n($.innerType._def,I)};var vL=($,I,U)=>{switch(I){case F.ZodString:return DA($,U);case F.ZodNumber:return GL($,U);case F.ZodObject:return QL($,U);case F.ZodBigInt:return pH($,U);case F.ZodBoolean:return tH();case F.ZodDate:return TX($,U);case F.ZodUndefined:return zL(U);case F.ZodNull:return NL(U);case F.ZodArray:return dH($,U);case F.ZodUnion:case F.ZodDiscriminatedUnion:return XL($,U);case F.ZodIntersection:return IL($,U);case F.ZodTuple:return LL($,U);case F.ZodRecord:return AA($,U);case F.ZodLiteral:return UL($,U);case F.ZodEnum:return $L($);case F.ZodNativeEnum:return wL($);case F.ZodNullable:return WL($,U);case F.ZodOptional:return YL($,U);case F.ZodMap:return AL($,U);case F.ZodSet:return HL($,U);case F.ZodLazy:return()=>$.getter()._def;case F.ZodPromise:return JL($,U);case F.ZodNaN:case F.ZodNever:return bL(U);case F.ZodEffects:return sH($,U);case F.ZodAny:return q$(U);case F.ZodUnknown:return ML(U);case F.ZodDefault:return eH($,U);case F.ZodBranded:return UA($,U);case F.ZodReadonly:return KL($,U);case F.ZodCatch:return aH($,U);case F.ZodPipeline:return BL($,U);case F.ZodFunction:case F.ZodVoid:case F.ZodSymbol:return;default:return((A)=>{return})(I)}};function n($,I,U=!1){let A=I.seen.get($);if(I.override){let N=I.override?.($,I,A,U);if(N!==nH)return N}if(A&&!U){let N=YP(A,I);if(N!==void 0)return N}let D={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,D);let w=vL($,$.typeName,I),b=typeof w==="function"?n(w(),I):w;if(b)BP($,I,b);if(I.postProcess){let N=I.postProcess(b,$,I);return D.jsonSchema=b,N}return D.jsonSchema=b,b}var YP=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:IA(I.currentPath,$.path)};case"none":case"seen":{if($.path.length<I.currentPath.length&&$.path.every((U,A)=>I.currentPath[A]===U))return console.warn(`Recursive reference detected at ${I.currentPath.join("/")}! Defaulting to any`),q$(I);return I.$refStrategy==="seen"?q$(I):void 0}}},BP=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var ZX=($,I)=>{let U=oH(I),A=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((O,[X,W])=>({...O,[X]:n(W._def,{...U,currentPath:[...U.basePath,U.definitionPath,X]},!0)??q$(U)}),{}):void 0,D=typeof I==="string"?I:I?.nameStrategy==="title"?void 0:I?.name,w=n($._def,D===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,D]},!1)??q$(U),b=typeof I==="object"&&I.name!==void 0&&I.nameStrategy==="title"?I.name:void 0;if(b!==void 0)w.title=b;if(U.flags.hasReferencedOpenAiAnyType){if(!A)A={};if(!A[U.openAiAnyTypeName])A[U.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:U.$refStrategy==="relative"?"1":[...U.basePath,U.definitionPath,U.openAiAnyTypeName].join("/")}}}let N=D===void 0?A?{...w,[U.definitionPath]:A}:w:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,D].join("/"),[U.definitionPath]:{...A,[D]:w}};if(U.target==="jsonSchema7")N.$schema="http://json-schema.org/draft-07/schema#";else if(U.target==="jsonSchema2019-09"||U.target==="openAi")N.$schema="https://json-schema.org/draft/2019-09/schema#";if(U.target==="openAi"&&(("anyOf"in N)||("oneOf"in N)||("allOf"in N)||("type"in N)&&Array.isArray(N.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return N};function JP($){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 gX($,I){if(Y6($))return UX($,{target:JP(I?.target),io:I?.pipeStrategy??"input"});return ZX($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function xX($){let U=B4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let A=RD(U);if(typeof A!=="string")throw new Error("Schema method literal must be a string");return A}function hX($,I){let U=Y4($,I);if(!U.success)throw U.error;return U.data}var HP=60000;class fX{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(hD,(I)=>{this._oncancel(I)}),this.setNotificationHandler(yD,(I)=>{this._onprogress(I)}),this.setRequestHandler(fD,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(uD,async(I,U)=>{let A=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!A)throw new f(c.InvalidParams,"Failed to retrieve task: Task not found");return{...A}}),this.setRequestHandler(cD,async(I,U)=>{let A=async()=>{let D=I.params.taskId;if(this._taskMessageQueue){let b;while(b=await this._taskMessageQueue.dequeue(D,U.sessionId)){if(b.type==="response"||b.type==="error"){let N=b.message,O=N.id,X=this._requestResolvers.get(O);if(X)if(this._requestResolvers.delete(O),b.type==="response")X(N);else{let W=N,Q=new f(W.error.code,W.error.message,W.error.data);X(Q)}else{let W=b.type==="response"?"Response":"Error";this._onerror(new Error(`${W} handler missing for request ${O}`))}continue}await this._transport?.send(b.message,{relatedRequestId:U.requestId})}}let w=await this._taskStore.getTask(D,U.sessionId);if(!w)throw new f(c.InvalidParams,`Task not found: ${D}`);if(!H4(w.status))return await this._waitForTaskUpdate(D,U.signal),await A();if(H4(w.status)){let b=await this._taskStore.getTaskResult(D,U.sessionId);return this._clearTaskQueue(D),{...b,_meta:{...b._meta,[J4]:{taskId:D}}}}return await A()};return await A()}),this.setRequestHandler(mD,async(I,U)=>{try{let{tasks:A,nextCursor:D}=await this._taskStore.listTasks(I.params?.cursor,U.sessionId);return{tasks:A,nextCursor:D,_meta:{}}}catch(A){throw new f(c.InvalidParams,`Failed to list tasks: ${A instanceof Error?A.message:String(A)}`)}}),this.setRequestHandler(nD,async(I,U)=>{try{let A=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!A)throw new f(c.InvalidParams,`Task not found: ${I.params.taskId}`);if(H4(A.status))throw new f(c.InvalidParams,`Cannot cancel task in terminal status: ${A.status}`);await this._taskStore.updateTaskStatus(I.params.taskId,"cancelled","Client cancelled task execution.",U.sessionId),this._clearTaskQueue(I.params.taskId);let D=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!D)throw new f(c.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...D}}catch(A){if(A instanceof f)throw A;throw new f(c.InvalidRequest,`Failed to cancel task: ${A instanceof Error?A.message:String(A)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,I,U,A,D=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(A,I),startTime:Date.now(),timeout:I,maxTotalTimeout:U,resetTimeoutOnProgress:D,onTimeout:A})}_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=(D)=>{U?.(D),this._onerror(D)};let A=this._transport?.onmessage;this._transport.onmessage=(D,w)=>{if(A?.(D,w),UU(D)||_H(D))this._onresponse(D);else if(JX(D))this._onrequest(D,w);else if(TH(D))this._onnotification(D);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(D)}`))},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,A=this._transport,D=$.params?._meta?.[J4]?.taskId;if(U===void 0){let X={jsonrpc:"2.0",id:$.id,error:{code:c.MethodNotFound,message:"Method not found"}};if(D&&this._taskMessageQueue)this._enqueueTaskMessage(D,{type:"error",message:X,timestamp:Date.now()},A?.sessionId).catch((W)=>this._onerror(new Error(`Failed to enqueue error response: ${W}`)));else A?.send(X).catch((W)=>this._onerror(new Error(`Failed to send an error response: ${W}`)));return}let w=new AbortController;this._requestHandlerAbortControllers.set($.id,w);let b=kH($.params)?$.params.task:void 0,N=this._taskStore?this.requestTaskStore($,A?.sessionId):void 0,O={signal:w.signal,sessionId:A?.sessionId,_meta:$.params?._meta,sendNotification:async(X)=>{let W={relatedRequestId:$.id};if(D)W.relatedTask={taskId:D};await this.notification(X,W)},sendRequest:async(X,W,Q)=>{let B={...Q,relatedRequestId:$.id};if(D&&!B.relatedTask)B.relatedTask={taskId:D};let Y=B.relatedTask?.taskId??D;if(Y&&N)await N.updateTaskStatus(Y,"input_required");return await this.request(X,W,B)},authInfo:I?.authInfo,requestId:$.id,requestInfo:I?.requestInfo,taskId:D,taskStore:N,taskRequestedTtl:b?.ttl,closeSSEStream:I?.closeSSEStream,closeStandaloneSSEStream:I?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(b)this.assertTaskHandlerCapability($.method)}).then(()=>U($,O)).then(async(X)=>{if(w.signal.aborted)return;let W={result:X,jsonrpc:"2.0",id:$.id};if(D&&this._taskMessageQueue)await this._enqueueTaskMessage(D,{type:"response",message:W,timestamp:Date.now()},A?.sessionId);else await A?.send(W)},async(X)=>{if(w.signal.aborted)return;let W={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(X.code)?X.code:c.InternalError,message:X.message??"Internal error",...X.data!==void 0&&{data:X.data}}};if(D&&this._taskMessageQueue)await this._enqueueTaskMessage(D,{type:"error",message:W,timestamp:Date.now()},A?.sessionId);else await A?.send(W)}).catch((X)=>this._onerror(new Error(`Failed to send response: ${X}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:I,...U}=$.params,A=Number(I),D=this._progressHandlers.get(A);if(!D){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let w=this._responseHandlers.get(A),b=this._timeoutInfo.get(A);if(b&&w&&b.resetTimeoutOnProgress)try{this._resetTimeout(A)}catch(N){this._responseHandlers.delete(A),this._progressHandlers.delete(A),this._cleanupTimeout(A),w(N);return}D(U)}_onresponse($){let I=Number($.id),U=this._requestResolvers.get(I);if(U){if(this._requestResolvers.delete(I),UU($))U($);else{let w=new f($.error.code,$.error.message,$.error.data);U(w)}return}let A=this._responseHandlers.get(I);if(A===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 D=!1;if(UU($)&&$.result&&typeof $.result==="object"){let w=$.result;if(w.task&&typeof w.task==="object"){let b=w.task;if(typeof b.taskId==="string")D=!0,this._taskProgressTokens.set(b.taskId,I)}}if(!D)this._progressHandlers.delete(I);if(UU($))A($);else{let w=f.fromError($.error.code,$.error.message,$.error.data);A(w)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,I,U){let{task:A}=U??{};if(!A){try{yield{type:"result",result:await this.request($,I,U)}}catch(w){yield{type:"error",error:w instanceof f?w:new f(c.InternalError,String(w))}}return}let D;try{let w=await this.request($,EI,U);if(w.task)D=w.task.taskId,yield{type:"taskCreated",task:w.task};else throw new f(c.InternalError,"Task creation did not return a task");while(!0){let b=await this.getTask({taskId:D},U);if(yield{type:"taskStatus",task:b},H4(b.status)){if(b.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:D},I,U)};else if(b.status==="failed")yield{type:"error",error:new f(c.InternalError,`Task ${D} failed`)};else if(b.status==="cancelled")yield{type:"error",error:new f(c.InternalError,`Task ${D} was cancelled`)};return}if(b.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:D},I,U)};return}let N=b.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((O)=>setTimeout(O,N)),U?.signal?.throwIfAborted()}}catch(w){yield{type:"error",error:w instanceof f?w:new f(c.InternalError,String(w))}}}request($,I,U){let{relatedRequestId:A,resumptionToken:D,onresumptiontoken:w,task:b,relatedTask:N}=U??{};return new Promise((O,X)=>{let W=(V)=>{X(V)};if(!this._transport){W(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),b)this.assertTaskCapability($.method)}catch(V){W(V);return}U?.signal?.throwIfAborted();let Q=this._requestMessageId++,B={...$,jsonrpc:"2.0",id:Q};if(U?.onprogress)this._progressHandlers.set(Q,U.onprogress),B.params={...$.params,_meta:{...$.params?._meta||{},progressToken:Q}};if(b)B.params={...B.params,task:b};if(N)B.params={...B.params,_meta:{...B.params?._meta||{},[J4]:N}};let Y=(V)=>{this._responseHandlers.delete(Q),this._progressHandlers.delete(Q),this._cleanupTimeout(Q),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:Q,reason:String(V)}},{relatedRequestId:A,resumptionToken:D,onresumptiontoken:w}).catch((k)=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));let P=V instanceof f?V:new f(c.RequestTimeout,String(V));X(P)};this._responseHandlers.set(Q,(V)=>{if(U?.signal?.aborted)return;if(V instanceof Error)return X(V);try{let P=Y4(I,V.result);if(!P.success)X(P.error);else O(P.data)}catch(P){X(P)}}),U?.signal?.addEventListener("abort",()=>{Y(U?.signal?.reason)});let J=U?.timeout??HP,H=()=>Y(f.fromError(c.RequestTimeout,"Request timed out",{timeout:J}));this._setupTimeout(Q,J,U?.maxTotalTimeout,H,U?.resetTimeoutOnProgress??!1);let v=N?.taskId;if(v){let V=(P)=>{let k=this._responseHandlers.get(Q);if(k)k(P);else this._onerror(new Error(`Response handler missing for side-channeled request ${Q}`))};this._requestResolvers.set(Q,V),this._enqueueTaskMessage(v,{type:"request",message:B,timestamp:Date.now()}).catch((P)=>{this._cleanupTimeout(Q),X(P)})}else this._transport.send(B,{relatedRequestId:A,resumptionToken:D,onresumptiontoken:w}).catch((V)=>{this._cleanupTimeout(Q),X(V)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},lD,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},rD,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},gH,I)}async notification($,I){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let U=I?.relatedTask?.taskId;if(U){let b={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[J4]:I.relatedTask}}};await this._enqueueTaskMessage(U,{type:"notification",message:b,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 b={...$,jsonrpc:"2.0"};if(I?.relatedTask)b={...b,params:{...b.params,_meta:{...b.params?._meta||{},[J4]:I.relatedTask}}};this._transport?.send(b,I).catch((N)=>this._onerror(N))});return}let w={...$,jsonrpc:"2.0"};if(I?.relatedTask)w={...w,params:{...w.params,_meta:{...w.params?._meta||{},[J4]:I.relatedTask}}};await this._transport.send(w,I)}setRequestHandler($,I){let U=xX($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(A,D)=>{let w=hX($,A);return Promise.resolve(I(w,D))})}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=xX($);this._notificationHandlers.set(U,(A)=>{let D=hX($,A);return Promise.resolve(I(D))})}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 A=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,I,U,A)}async _clearTaskQueue($,I){if(this._taskMessageQueue){let U=await this._taskMessageQueue.dequeueAll($,I);for(let A of U)if(A.type==="request"&&JX(A.message)){let D=A.message.id,w=this._requestResolvers.get(D);if(w)w(new f(c.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(D);else this._onerror(new Error(`Resolver missing for request ${D} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,I){let U=this._options?.defaultTaskPollInterval??1000;try{let A=await this._taskStore?.getTask($);if(A?.pollInterval)U=A.pollInterval}catch{}return new Promise((A,D)=>{if(I.aborted){D(new f(c.InvalidRequest,"Request cancelled"));return}let w=setTimeout(A,U);I.addEventListener("abort",()=>{clearTimeout(w),D(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(A)=>{if(!$)throw new Error("No request provided");return await U.createTask(A,$.id,{method:$.method,params:$.params},I)},getTask:async(A)=>{let D=await U.getTask(A,I);if(!D)throw new f(c.InvalidParams,"Failed to retrieve task: Task not found");return D},storeTaskResult:async(A,D,w)=>{await U.storeTaskResult(A,D,w,I);let b=await U.getTask(A,I);if(b){let N=NU.parse({method:"notifications/tasks/status",params:b});if(await this.notification(N),H4(b.status))this._cleanupTaskProgressHandler(A)}},getTaskResult:(A)=>{return U.getTaskResult(A,I)},updateTaskStatus:async(A,D,w)=>{let b=await U.getTask(A,I);if(!b)throw new f(c.InvalidParams,`Task "${A}" not found - it may have been cleaned up`);if(H4(b.status))throw new f(c.InvalidParams,`Cannot update task "${A}" from terminal status "${b.status}" to "${D}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await U.updateTaskStatus(A,D,w,I);let N=await U.getTask(A,I);if(N){let O=NU.parse({method:"notifications/tasks/status",params:N});if(await this.notification(O),H4(N.status))this._cleanupTaskProgressHandler(A)}},listTasks:(A)=>{return U.listTasks(A,I)}}}}function VL($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function qL($,I){let U={...$};for(let A in I){let D=A,w=I[D];if(w===void 0)continue;let b=U[D];if(VL(b)&&VL(w))U[D]={...b,...w};else U[D]=w}return U}var $v=C5(_W(),1),Iv=C5(sK(),1);function Ex(){let $=new $v.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Iv.default($),$}class cW{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 mW{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 Dv($,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 rW extends fX{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(XU.options.map((U,A)=>[U,A])),this.isMessageIgnored=(U,A)=>{let D=this._loggingLevels.get(A);return D?this.LOG_LEVEL_SEVERITY.get(U)<this.LOG_LEVEL_SEVERITY.get(D):!1},this._capabilities=I?.capabilities??{},this._instructions=I?.instructions,this._jsonSchemaValidator=I?.jsonSchemaValidator??new cW,this.setRequestHandler(zX,(U)=>this._oninitialize(U)),this.setNotificationHandler(MX,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(SX,async(U,A)=>{let D=A.sessionId||A.requestInfo?.headers["mcp-session-id"]||void 0,{level:w}=U.params,b=XU.safeParse(w);if(b.success)this._loggingLevels.set(D,b.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new mW(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=qL(this._capabilities,$)}setRequestHandler($,I){let A=B4($)?.method;if(!A)throw new Error("Schema is missing a method literal");let D;if(Y6(A)){let b=A;D=b._zod?.def?.value??b.value}else{let b=A;D=b._def?.value??b.value}if(typeof D!=="string")throw new Error("Schema method literal must be a string");if(D==="tools/call"){let b=async(N,O)=>{let X=Y4(jI,N);if(!X.success){let Y=X.error instanceof Error?X.error.message:String(X.error);throw new f(c.InvalidParams,`Invalid tools/call request: ${Y}`)}let{params:W}=X.data,Q=await Promise.resolve(I(N,O));if(W.task){let Y=Y4(EI,Q);if(!Y.success){let J=Y.error instanceof Error?Y.error.message:String(Y.error);throw new f(c.InvalidParams,`Invalid task creation result: ${J}`)}return Y.data}let B=Y4(eD,Q);if(!B.success){let Y=B.error instanceof Error?B.error.message:String(B.error);throw new f(c.InvalidParams,`Invalid tools/call result: ${Y}`)}return B.data};return super.setRequestHandler($,b)}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($){Dv(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:EH.includes(I)?I:YX,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"},xD)}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],A=Array.isArray(U.content)?U.content:[U.content],D=A.some((O)=>O.type==="tool_result"),w=$.messages.length>1?$.messages[$.messages.length-2]:void 0,b=w?Array.isArray(w.content)?w.content:[w.content]:[],N=b.some((O)=>O.type==="tool_use");if(D){if(A.some((O)=>O.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!N)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(N){let O=new Set(b.filter((W)=>W.type==="tool_use").map((W)=>W.id)),X=new Set(A.filter((W)=>W.type==="tool_result").map((W)=>W.toolUseId));if(O.size!==X.size||![...O].every((W)=>X.has(W)))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:$},kX,I);return this.request({method:"sampling/createMessage",params:$},jX,I)}async elicitInput($,I){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let A=$;return this.request({method:"elicitation/create",params:A},sD,I)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let A=$.mode==="form"?$:{...$,mode:"form"},D=await this.request({method:"elicitation/create",params:A},sD,I);if(D.action==="accept"&&D.content&&A.requestedSchema)try{let b=this._jsonSchemaValidator.getValidator(A.requestedSchema)(D.content);if(!b.valid)throw new f(c.InvalidParams,`Elicitation response content does not match requested schema: ${b.errorMessage}`)}catch(w){if(w instanceof f)throw w;throw new f(c.InternalError,`Error validating elicitation response: ${w instanceof Error?w.message:String(w)}`)}return D}}}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:$},PX,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 wv=Symbol.for("mcp.completable");function nW($){return!!$&&typeof $==="object"&&wv in $}function bv($){return $[wv]?.complete}var Av;(function($){$.Completable="McpCompletable"})(Av||(Av={}));var Sx=/^[A-Za-z0-9._-]{1,128}$/;function jx($){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((A)=>!/[A-Za-z0-9._-]/.test(A)).filter((A,D,w)=>w.indexOf(A)===D);return I.push(`Tool name contains invalid characters: ${U.map((A)=>`"${A}"`).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 iW($){let I=jx($);return kx($,I.warnings),I.isValid}class oW{constructor($){this._mcpServer=$}registerToolTask($,I,U){let A={taskSupport:"required",...I.execution};if(A.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,A,I._meta,U)}}class pW{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 rW($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new oW(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(aD)),this.server.assertCanSetRequestHandler(F4(jI)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(aD,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let A=qI(I.inputSchema);return A?gX(A,{strictUnions:!0,pipeStrategy:"input"}):Px})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let A=qI(I.outputSchema);if(A)U.outputSchema=gX(A,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(jI,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 A=!!$.params.task,D=U.execution?.taskSupport,w="createTask"in U.handler;if((D==="required"||D==="optional")&&!w)throw new f(c.InternalError,`Tool ${$.params.name} has taskSupport '${D}' but was not registered with registerToolTask`);if(D==="required"&&!A)throw new f(c.MethodNotFound,`Tool ${$.params.name} requires task augmentation (taskSupport: 'required')`);if(D==="optional"&&!A&&w)return await this.handleAutomaticTaskPolling(U,$,I);let b=await this.validateToolInput(U,$.params.arguments,$.params.name),N=await this.executeToolHandler(U,b,I);if(A)return N;return await this.validateToolOutput(U,N,$.params.name),N}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 D=qI($.inputSchema)??$.inputSchema,w=await kD(D,I);if(!w.success){let b="error"in w?w.error:"Unknown error",N=PD(b);throw new f(c.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${N}`)}return w.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 A=qI($.outputSchema),D=await kD(A,I.structuredContent);if(!D.success){let w="error"in D?D.error:"Unknown error",b=PD(w);throw new f(c.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${b}`)}}async executeToolHandler($,I,U){let A=$.handler;if("createTask"in A){if(!U.taskStore)throw new Error("No task store provided.");let w={...U,taskStore:U.taskStore};if($.inputSchema){let b=A;return await Promise.resolve(b.createTask(I,w))}else{let b=A;return await Promise.resolve(b.createTask(w))}}if($.inputSchema){let w=A;return await Promise.resolve(w(I,U))}else{let w=A;return await Promise.resolve(w(U))}}async handleAutomaticTaskPolling($,I,U){if(!U.taskStore)throw new Error("No task store provided for task-capable tool.");let A=await this.validateToolInput($,I.params.arguments,I.params.name),D=$.handler,w={...U,taskStore:U.taskStore},b=A?await Promise.resolve(D.createTask(A,w)):await Promise.resolve(D.createTask(w)),N=b.task.taskId,O=b.task,X=O.pollInterval??5000;while(O.status!=="completed"&&O.status!=="failed"&&O.status!=="cancelled"){await new Promise((Q)=>setTimeout(Q,X));let W=await U.taskStore.getTask(N);if(!W)throw new f(c.InternalError,`Task ${N} not found during polling`);O=W}return await U.taskStore.getTaskResult(N)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(F4($A)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler($A,async($)=>{switch($.params.ref.type){case"ref/prompt":return lH($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return cH($),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 ZU;let D=B4(U.argsSchema)?.[$.params.argument.name];if(!nW(D))return ZU;let w=bv(D);if(!w)return ZU;let b=await w($.params.argument.value,$.params.context);return Ov(b)}async handleResourceCompletion($,I){let U=Object.values(this._registeredResourceTemplates).find((w)=>w.resourceTemplate.uriTemplate.toString()===I.uri);if(!U){if(this._registeredResources[I.uri])return ZU;throw new f(c.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let A=U.resourceTemplate.completeCallback($.params.argument.name);if(!A)return ZU;let D=await A($.params.argument.value,$.params.context);return Ov(D)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(iD)),this.server.assertCanSetRequestHandler(F4(oD)),this.server.assertCanSetRequestHandler(F4(dD)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(iD,async($,I)=>{let U=Object.entries(this._registeredResources).filter(([D,w])=>w.enabled).map(([D,w])=>({uri:D,name:w.name,...w.metadata})),A=[];for(let D of Object.values(this._registeredResourceTemplates)){if(!D.resourceTemplate.listCallback)continue;let w=await D.resourceTemplate.listCallback(I);for(let b of w.resources)A.push({...D.metadata,...b})}return{resources:[...U,...A]}}),this.server.setRequestHandler(oD,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(dD,async($,I)=>{let U=new URL($.params.uri),A=this._registeredResources[U.toString()];if(A){if(!A.enabled)throw new f(c.InvalidParams,`Resource ${U} disabled`);return A.readCallback(U,I)}for(let D of Object.values(this._registeredResourceTemplates)){let w=D.resourceTemplate.uriTemplate.match(U.toString());if(w)return D.readCallback(U,w,I)}throw new f(c.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(pD)),this.server.assertCanSetRequestHandler(F4(tD)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(pD,()=>({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(tD,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 A=qI(U.argsSchema),D=await kD(A,$.params.arguments);if(!D.success){let N="error"in D?D.error:"Unknown error",O=PD(N);throw new f(c.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${O}`)}let w=D.data,b=U.callback;return await Promise.resolve(b(w,I))}else{let A=U.callback;return await Promise.resolve(A(I))}}),this._promptHandlersInitialized=!0}resource($,I,...U){let A;if(typeof U[0]==="object")A=U.shift();let D=U[0];if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let w=this._createRegisteredResource($,void 0,I,A,D);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let w=this._createRegisteredResourceTemplate($,void 0,I,A,D);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}}registerResource($,I,U,A){if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let D=this._createRegisteredResource($,U.title,I,U,A);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),D}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let D=this._createRegisteredResourceTemplate($,U.title,I,U,A);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),D}}_createRegisteredResource($,I,U,A,D){let w={name:$,title:I,metadata:A,readCallback:D,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({uri:null}),update:(b)=>{if(typeof b.uri!=="undefined"&&b.uri!==U){if(delete this._registeredResources[U],b.uri)this._registeredResources[b.uri]=w}if(typeof b.name!=="undefined")w.name=b.name;if(typeof b.title!=="undefined")w.title=b.title;if(typeof b.metadata!=="undefined")w.metadata=b.metadata;if(typeof b.callback!=="undefined")w.readCallback=b.callback;if(typeof b.enabled!=="undefined")w.enabled=b.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=w,w}_createRegisteredResourceTemplate($,I,U,A,D){let w={resourceTemplate:U,title:I,metadata:A,readCallback:D,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({name:null}),update:(O)=>{if(typeof O.name!=="undefined"&&O.name!==$){if(delete this._registeredResourceTemplates[$],O.name)this._registeredResourceTemplates[O.name]=w}if(typeof O.title!=="undefined")w.title=O.title;if(typeof O.template!=="undefined")w.resourceTemplate=O.template;if(typeof O.metadata!=="undefined")w.metadata=O.metadata;if(typeof O.callback!=="undefined")w.readCallback=O.callback;if(typeof O.enabled!=="undefined")w.enabled=O.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=w;let b=U.uriTemplate.variableNames;if(Array.isArray(b)&&b.some((O)=>!!U.completeCallback(O)))this.setCompletionRequestHandler();return w}_createRegisteredPrompt($,I,U,A,D){let w={title:I,description:U,argsSchema:A===void 0?void 0:d4(A),callback:D,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({name:null}),update:(b)=>{if(typeof b.name!=="undefined"&&b.name!==$){if(delete this._registeredPrompts[$],b.name)this._registeredPrompts[b.name]=w}if(typeof b.title!=="undefined")w.title=b.title;if(typeof b.description!=="undefined")w.description=b.description;if(typeof b.argsSchema!=="undefined")w.argsSchema=d4(b.argsSchema);if(typeof b.callback!=="undefined")w.callback=b.callback;if(typeof b.enabled!=="undefined")w.enabled=b.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=w,A){if(Object.values(A).some((N)=>{let O=N instanceof Q6?N._def?.innerType:N;return nW(O)}))this.setCompletionRequestHandler()}return w}_createRegisteredTool($,I,U,A,D,w,b,N,O){iW($);let X={title:I,description:U,inputSchema:Nv(A),outputSchema:Nv(D),annotations:w,execution:b,_meta:N,handler:O,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(W)=>{if(typeof W.name!=="undefined"&&W.name!==$){if(typeof W.name==="string")iW(W.name);if(delete this._registeredTools[$],W.name)this._registeredTools[W.name]=X}if(typeof W.title!=="undefined")X.title=W.title;if(typeof W.description!=="undefined")X.description=W.description;if(typeof W.paramsSchema!=="undefined")X.inputSchema=d4(W.paramsSchema);if(typeof W.outputSchema!=="undefined")X.outputSchema=d4(W.outputSchema);if(typeof W.callback!=="undefined")X.handler=W.callback;if(typeof W.annotations!=="undefined")X.annotations=W.annotations;if(typeof W._meta!=="undefined")X._meta=W._meta;if(typeof W.enabled!=="undefined")X.enabled=W.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=X,this.setToolRequestHandlers(),this.sendToolListChanged(),X}tool($,...I){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let U,A,D,w;if(typeof I[0]==="string")U=I.shift();if(I.length>1){let N=I[0];if(dW(N)){if(A=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!dW(I[0]))w=I.shift()}else if(typeof N==="object"&&N!==null)w=I.shift()}let b=I[0];return this._createRegisteredTool($,void 0,U,A,D,w,{taskSupport:"forbidden"},void 0,b)}registerTool($,I,U){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let{title:A,description:D,inputSchema:w,outputSchema:b,annotations:N,_meta:O}=I;return this._createRegisteredTool($,A,D,w,b,N,{taskSupport:"forbidden"},O,U)}prompt($,...I){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let U;if(typeof I[0]==="string")U=I.shift();let A;if(I.length>1)A=I.shift();let D=I[0],w=this._createRegisteredPrompt($,void 0,U,A,D);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),w}registerPrompt($,I,U){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let{title:A,description:D,argsSchema:w}=I,b=this._createRegisteredPrompt($,A,D,w,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),b}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 Px={type:"object",properties:{}};function Xv($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Rx($){return"_def"in $||"_zod"in $||Xv($)}function dW($){if(typeof $!=="object"||$===null)return!1;if(Rx($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(Xv)}function Nv($){if(!$)return;if(dW($))return d4($);return $}function Tx($){let I=B4($);if(!I)return[];return Object.entries(I).map(([U,A])=>{let D=UH(A),w=DH(A);return{name:U,description:D,required:!w}})}function F4($){let U=B4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let A=RD(U);if(typeof A==="string")return A;throw new Error("Schema method literal must be a string")}function Ov($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var ZU={completion:{values:[],hasMore:!1}};import Gv from"node:process";class tW{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 CH.parse(JSON.parse($))}function Wv($){return JSON.stringify($)+`
42
+ `}class aW{constructor($=Gv.stdin,I=Gv.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new tW,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=Wv($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:Cx,defineProperty:Qv,getOwnPropertyDescriptor:Zx,getOwnPropertyNames:Yv,getPrototypeOf:gx}=Object,xx=Object.prototype.hasOwnProperty,T6=($,I)=>function(){return I||$[Yv($)[0]]((I={exports:{}}).exports,I),I.exports},hx=($,I,U,A)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var D=Yv(I),w=0,b=D.length,N;w<b;w++)if(N=D[w],!xx.call($,N)&&N!==U)Qv($,N,{get:((O)=>I[O]).bind(null,N),enumerable:!(A=Zx(I,N))||A.enumerable})}return $},G$=($,I,U)=>(U=$!=null?Cx(gx($)):{},hx(I||!$||!$.__esModule?Qv(U,"default",{value:$,enumerable:!0}):U,$)),Bv=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(A){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},I.exports.__esModule=!0,I.exports.default=I.exports,U(A)}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=Bv().default;function A(D,w){if(U(D)!="object"||!D)return D;var b=D[Symbol.toPrimitive];if(b!==void 0){var N=b.call(D,w||"default");if(U(N)!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(D)}I.exports=A,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=Bv().default,A=fx();function D(w){var b=A(w,"string");return U(b)=="symbol"?b:b+""}I.exports=D,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 A(D,w,b){return(w=U(w))in D?Object.defineProperty(D,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):D[w]=b,D}I.exports=A,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 A(w,b){var N=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);b&&(O=O.filter(function(X){return Object.getOwnPropertyDescriptor(w,X).enumerable})),N.push.apply(N,O)}return N}function D(w){for(var b=1;b<arguments.length;b++){var N=arguments[b]!=null?arguments[b]:{};b%2?A(Object(N),!0).forEach(function(O){U(w,O,N[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(N)):A(Object(N)).forEach(function(O){Object.defineProperty(w,O,Object.getOwnPropertyDescriptor(N,O))})}return w}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}});function l6($){let I={subscribe(U){let A=null,D=!1,w=!1,b=!1;function N(){if(A===null){b=!0;return}if(w)return;if(w=!0,typeof A==="function")A();else if(A)A.unsubscribe()}if(A=$({next(O){var X;if(D)return;(X=U.next)===null||X===void 0||X.call(U,O)},error(O){var X;if(D)return;D=!0,(X=U.error)===null||X===void 0||X.call(U,O),N()},complete(){var O;if(D)return;D=!0,(O=U.complete)===null||O===void 0||O.call(U),N()}}),b)N();return{unsubscribe:N}},pipe(...U){return U.reduce(ux,I)}};return I}function ux($,I){return I($)}function eW($){let I=new AbortController;return new Promise((A,D)=>{let w=!1;function b(){if(w)return;w=!0,N.unsubscribe()}I.signal.addEventListener("abort",()=>{D(I.signal.reason)});let N=$.subscribe({next(O){w=!0,A(O),b()},error(O){D(O)},complete(){I.abort(),b()}})})}function sW($){return(I)=>{let U=0,A=null,D=[];function w(){if(A)return;A=I.subscribe({next(N){for(let X of D){var O;(O=X.next)===null||O===void 0||O.call(X,N)}},error(N){for(let X of D){var O;(O=X.error)===null||O===void 0||O.call(X,N)}},complete(){for(let O of D){var N;(N=O.complete)===null||N===void 0||N.call(O)}}})}function b(){if(U===0&&A){let N=A;A=null,N.unsubscribe()}}return l6((N)=>{return U++,D.push(N),w(),{unsubscribe(){U--,b();let O=D.findIndex((X)=>X===N);if(O>-1)D.splice(O,1)}}})}}var pd=Symbol();function mA($){let I=$,U=[],A=(b)=>{if(I!==void 0)b.next(I);U.push(b)},D=(b)=>{U.splice(U.indexOf(b),1)},w=l6((b)=>{return A(b),()=>{D(b)}});return w.next=(b)=>{if(I===b)return;I=b;for(let N of U)N.next(b)},w.get=()=>I,w}function Jv($){return l6((I)=>{function U(D=0,w=$.op){let b=$.links[D];if(!b)throw new Error("No more links to execute - did you forget to add an ending link?");return b({op:w,next(O){return U(D+1,O)}})}return U().subscribe(I)})}function D4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function rA(){return Object.create(null)}var yI={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 Hv=[yI.BAD_GATEWAY,yI.SERVICE_UNAVAILABLE,yI.GATEWAY_TIMEOUT,yI.INTERNAL_SERVER_ERROR];var{create:cx,defineProperty:zv,getOwnPropertyDescriptor:mx,getOwnPropertyNames:Mv,getPrototypeOf:rx}=Object,nx=Object.prototype.hasOwnProperty,gU=($,I)=>function(){return I||$[Mv($)[0]]((I={exports:{}}).exports,I),I.exports},ix=($,I,U,A)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var D=Mv(I),w=0,b=D.length,N;w<b;w++)if(N=D[w],!nx.call($,N)&&N!==U)zv($,N,{get:((O)=>I[O]).bind(null,N),enumerable:!(A=mx(I,N))||A.enumerable})}return $},xU=($,I,U)=>(U=$!=null?cx(rx($)):{},ix(I||!$||!$.__esModule?zv(U,"default",{value:$,enumerable:!0}):U,$)),Kv=()=>{},Lv=($)=>{if(Object.freeze)Object.freeze($)};function vv($,I,U){var A;let D=I.join(".");return(A=U[D])!==null&&A!==void 0||(U[D]=new Proxy(Kv,{get(w,b){if(typeof b!=="string"||b==="then")return;return vv($,[...I,b],U)},apply(w,b,N){let O=I[I.length-1];if(O==="valueOf"||O==="toString"||O==="toJSON")return`tRPC.proxy(${I.slice(0,-1).join(".")})`;let X={args:N,path:I};if(O==="call")X={args:N.length>=2?[N[1]]:[],path:I.slice(0,-1)};else if(O==="apply")X={args:N.length>=2?N[1]:[],path:I.slice(0,-1)};return Lv(X.args),Lv(X.path),$(X)}})),U[D]}var nA=($)=>vv($,[],rA()),$9=($)=>{return new Proxy(Kv,{get(I,U){if(U==="then")return;return $(U)}})};var Vv=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(A){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},I.exports.__esModule=!0,I.exports.default=I.exports,U(A)}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=Vv().default;function A(D,w){if(U(D)!="object"||!D)return D;var b=D[Symbol.toPrimitive];if(b!==void 0){var N=b.call(D,w||"default");if(U(N)!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(D)}I.exports=A,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=Vv().default,A=ox();function D(w){var b=A(w,"string");return U(b)=="symbol"?b:b+""}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),I9=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=dx();function A(D,w,b){return(w=U(w))in D?Object.defineProperty(D,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):D[w]=b,D}I.exports=A,I.exports.__esModule=!0,I.exports.default=I.exports}}),iA=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=I9();function A(w,b){var N=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);b&&(O=O.filter(function(X){return Object.getOwnPropertyDescriptor(w,X).enumerable})),N.push.apply(N,O)}return N}function D(w){for(var b=1;b<arguments.length;b++){var N=arguments[b]!=null?arguments[b]:{};b%2?A(Object(N),!0).forEach(function(O){U(w,O,N[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(N)):A(Object(N)).forEach(function(O){Object.defineProperty(w,O,Object.getOwnPropertyDescriptor(N,O))})}return w}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),Wp=xU(iA(),1);var Bp=xU(I9(),1);var oA=xU(iA(),1);function ax($,I){if("error"in $){let A=I.deserialize($.error);return{ok:!1,error:oA.default(oA.default({},$),{},{error:A})}}return{ok:!0,result:oA.default(oA.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var U9=class extends Error{constructor(){super("Unable to transform response from server")}};function D9($,I){let U;try{U=ax($,I)}catch(A){throw new U9}if(!U.ok&&(!D4(U.error.error)||typeof U.error.error.code!=="number"))throw new U9;if(U.ok&&!D4(U.result))throw new U9;return U}var Jp=xU(iA(),1);var Hp=Symbol();var dA=G$(u6(),1),uI=G$(_$(),1);function qv($){return $ instanceof E4}function Ih($){return D4($)&&D4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function Uh($,I){if(typeof $==="string")return $;if(D4($)&&typeof $.message==="string")return $.message;return I}var E4=class $ extends Error{constructor(I,U){var A,D;let w=U===null||U===void 0?void 0:U.cause;super(I,{cause:w});dA.default(this,"cause",void 0),dA.default(this,"shape",void 0),dA.default(this,"data",void 0),dA.default(this,"meta",void 0),this.meta=U===null||U===void 0?void 0:U.meta,this.cause=w,this.shape=U===null||U===void 0||(A=U.result)===null||A===void 0?void 0:A.error,this.data=U===null||U===void 0||(D=U.result)===null||D===void 0?void 0:D.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(I,U={}){let A=I;if(qv(A)){if(U.meta)A.meta=uI.default(uI.default({},A.meta),U.meta);return A}if(Ih(A))return new $(A.error.message,uI.default(uI.default({},U),{},{result:A,cause:U.cause}));return new $(Uh(A,"Unknown error"),uI.default(uI.default({},U),{},{cause:A}))}};function pA($){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 Ev($){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=G$(_$(),1);function tA($){return{url:$.url.toString(),fetch:$.fetch,transformer:pA($.transformer),methodOverride:$.methodOverride}}function Dh($){let I={};for(let U=0;U<$.length;U++){let A=$[U];I[U]=A}return I}var Ah={query:"GET",mutation:"POST",subscription:"PATCH"};function Sv($){return"input"in $?$.transformer.input.serialize($.input):Dh($.inputs.map((I)=>$.transformer.input.serialize(I)))}var lI=($)=>{let I=$.url.split("?"),A=I[0].replace(/\/$/,"")+"/"+$.path,D=[];if(I[1])D.push(I[1]);if("inputs"in $)D.push("batch=1");if($.type==="query"||$.type==="subscription"){let w=Sv($);if(w!==void 0&&$.methodOverride!=="POST")D.push(`input=${encodeURIComponent(JSON.stringify(w))}`)}if(D.length)A+="?"+D.join("&");return A},jv=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=Sv($);return I!==void 0?JSON.stringify(I):void 0},A9=($)=>{return aA(hU.default(hU.default({},$),{},{contentTypeHeader:"application/json",getUrl:lI,getBody:jv}))},wh=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},bh=($)=>{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 wh};async function kv($){var I,U;bh($.signal);let A=$.getUrl($),D=$.getBody($),w=(I=$.methodOverride)!==null&&I!==void 0?I:Ah[$.type],b=await(async()=>{let O=await $.headers();if(Symbol.iterator in O)return Object.fromEntries(O);return O})(),N=hU.default(hU.default(hU.default({},$.contentTypeHeader&&w!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(U=$.trpcAcceptHeaderKey)!==null&&U!==void 0?U:"trpc-accept"]:$.trpcAcceptHeader}:void 0),b);return Ev($.fetch)(A,{method:w,signal:$.signal,body:D,headers:N})}async function aA($){let I={},U=await kv($);I.response=U;let A=await U.json();return I.responseJSON=A,{json:A,meta:I}}function Pv($){return $ instanceof Uint8Array||$ instanceof Blob}function Rv($){return $ instanceof FormData}var cI=G$(_$(),1),Nh=($)=>{if("input"in $){let{input:I}=$;if(Rv(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return aA(cI.default(cI.default({},$),{},{contentTypeHeader:void 0,getUrl:lI,getBody:()=>I}))}if(Pv(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return aA(cI.default(cI.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:lI,getBody:()=>I}))}}return A9($)};function w9($){let I=tA($);return()=>{return(U)=>{let{op:A}=U;return l6((D)=>{let{path:w,input:b,type:N}=A;if(N==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let O=Nh(cI.default(cI.default({},I),{},{type:N,path:w,input:b,signal:A.signal,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({op:A});return $.headers}})),X=void 0;return O.then((W)=>{X=W.meta;let Q=D9(W.json,I.transformer.output);if(!Q.ok){D.error(E4.from(Q.error,{meta:X}));return}D.next({context:W.meta,result:Q.result}),D.complete()}).catch((W)=>{D.error(E4.from(W,{meta:X}))}),()=>{}})}}}var Yt=G$(_$(),1);var Ht=G$(_$(),1);var b9=($,...I)=>{return typeof $==="function"?$(...I):$},Vt=G$(u6(),1);function Oh(){let $,I;return{promise:new Promise((A,D)=>{$=A,I=D}),resolve:$,reject:I}}async function Xh($){let I=await b9($.url);if(!$.connectionParams)return I;let A=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+A}async function Wh($,I){let U={method:"connectionParams",data:await b9($)};return I.encode(U)}var qt=G$(u6(),1);var S4=G$(u6(),1);function Gh($){let{promise:I,resolve:U,reject:A}=Oh();return $.addEventListener("open",()=>{$.removeEventListener("error",A),U()}),$.addEventListener("error",A),I}function Qh($,{intervalMs:I,pongTimeoutMs:U}){let A,D;function w(){A=setTimeout(()=>{$.send("PING"),D=setTimeout(()=>{$.close()},U)},I)}function b(){clearTimeout(A),w()}function N(){clearTimeout(D),b()}$.addEventListener("open",w),$.addEventListener("message",({data:O})=>{if(clearTimeout(A),w(),O==="PONG")N()}),$.addEventListener("close",()=>{clearTimeout(A),clearTimeout(D)})}var Yh=class ${constructor(I){var U;if(S4.default(this,"id",++$.connectCount),S4.default(this,"WebSocketPonyfill",void 0),S4.default(this,"urlOptions",void 0),S4.default(this,"keepAliveOpts",void 0),S4.default(this,"encoder",void 0),S4.default(this,"wsObservable",mA(null)),S4.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=Xh(I.urlOptions).then((A)=>new I.WebSocketPonyfill(A));I.openPromise=U.then(async(A)=>{if(I.ws=A,A.binaryType="arraybuffer",A.addEventListener("message",function({data:D}){if(D==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)Qh(A,I.keepAliveOpts);if(A.addEventListener("close",()=>{if(I.ws===A)I.ws=null}),await Gh(A),I.urlOptions.connectionParams)A.send(await Wh(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()}}};S4.default(Yh,"connectCount",0);var Ft=G$(u6(),1),Et=G$(_$(),1);var N9=G$(u6(),1),Tv=G$(_$(),1),Bh=class{constructor($){N9.default(this,"links",void 0),N9.default(this,"runtime",void 0),N9.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return Jv({links:this.links,op:Tv.default(Tv.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(sW())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await eW(U)).result.data}catch(U){throw E4.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(D){switch(D.result.type){case"state":{var w;(w=U.onConnectionStateChange)===null||w===void 0||w.call(U,D.result);break}case"started":{var b;(b=U.onStarted)===null||b===void 0||b.call(U,{context:D.context});break}case"stopped":{var N;(N=U.onStopped)===null||N===void 0||N.call(U);break}case"data":case void 0:{var O;(O=U.onData)===null||O===void 0||O.call(U,D.result.data);break}}},error(D){var w;(w=U.onError)===null||w===void 0||w.call(U,D)},complete(){var D;(D=U.onComplete)===null||D===void 0||D.call(U)}})}};var Jh=Symbol.for("trpc_untypedClient"),Hh={query:"query",mutate:"mutation",subscribe:"subscription"},Lh=($)=>{return Hh[$]};function zh($){let I=nA(({path:U,args:A})=>{let D=[...U],w=Lh(D.pop()),b=D.join(".");return $[w](b,...A)});return $9((U)=>{if(U===Jh)return $;return I[U]})}function _v($){let I=new Bh($);return zh(I)}var $a=G$(_$(),1);var Ia=G$(_$(),1);var Mh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,I){function U(D){var w,b,N,O=2;for(typeof Symbol!="undefined"&&(b=Symbol.asyncIterator,N=Symbol.iterator);O--;){if(b&&(w=D[b])!=null)return w.call(D);if(N&&(w=D[N])!=null)return new A(w.call(D));b="@@asyncIterator",N="@@iterator"}throw new TypeError("Object is not async iterable")}function A(D){function w(b){if(Object(b)!==b)return Promise.reject(new TypeError(b+" is not an object."));var N=b.done;return Promise.resolve(b.value).then(function(O){return{value:O,done:N}})}return A=function b(N){this.s=N,this.n=N.next},A.prototype={s:null,n:null,next:function b(){return w(this.n.apply(this.s,arguments))},return:function b(N){var O=this.s.return;return O===void 0?Promise.resolve({value:N,done:!0}):w(O.apply(this.s,arguments))},throw:function b(N){var O=this.s.return;return O===void 0?Promise.reject(N):w(O.apply(this.s,arguments))}},new A(D)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),Ua=G$(Mh(),1);var Da=G$(_$(),1);var Kh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,I){function U(){var A=typeof SuppressedError=="function"?SuppressedError:function(N,O){var X=Error();return X.name="SuppressedError",X.error=N,X.suppressed=O,X},D={},w=[];function b(N,O){if(O!=null){if(Object(O)!==O)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(N)var X=O[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(X===void 0&&(X=O[Symbol.dispose||Symbol.for("Symbol.dispose")],N))var W=X;if(typeof X!="function")throw new TypeError("Object is not disposable.");W&&(X=function Q(){try{W.call(O)}catch(B){return Promise.reject(B)}}),w.push({v:O,d:X,a:N})}else N&&w.push({d:O,a:N});return O}return{e:D,u:b.bind(null,!1),a:b.bind(null,!0),d:function N(){var O,X=this.e,W=0;function Q(){for(;O=w.pop();)try{if(!O.a&&W===1)return W=0,w.push(O),Promise.resolve().then(Q);if(O.d){var Y=O.d.call(O.v);if(O.a)return W|=2,Promise.resolve(Y).then(Q,B)}else W|=1}catch(J){return B(J)}if(W===1)return X!==D?Promise.reject(X):Promise.resolve();if(X!==D)throw X}function B(Y){return X=X!==D?new A(Y,X):Y,Q()}return Q()}}}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(A,D){this.v=A,this.k=D}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=Cv();function A(D){return new U(D,0)}I.exports=A,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/wrapAsyncGenerator.js"($,I){var U=Cv();function A(w){return function(){return new D(w.apply(this,arguments))}}function D(w){var b,N;function O(W,Q){try{var B=w[W](Q),Y=B.value,J=Y instanceof U;Promise.resolve(J?Y.v:Y).then(function(H){if(J){var v=W==="return"?"return":"next";if(!Y.k||H.done)return O(v,H);H=w[v](H).value}X(B.done?"return":"normal",H)},function(H){O("throw",H)})}catch(H){X("throw",H)}}function X(W,Q){switch(W){case"return":b.resolve({value:Q,done:!0});break;case"throw":b.reject(Q);break;default:b.resolve({value:Q,done:!1})}(b=b.next)?O(b.key,b.arg):N=null}this._invoke=function(W,Q){return new Promise(function(B,Y){var J={key:W,arg:Q,resolve:B,reject:Y,next:null};N?N=N.next=J:(b=N=J,O(W,Q))})},typeof w.return!="function"&&(this.return=void 0)}D.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},D.prototype.next=function(w){return this._invoke("next",w)},D.prototype.throw=function(w){return this._invoke("throw",w)},D.prototype.return=function(w){return this._invoke("return",w)},I.exports=A,I.exports.__esModule=!0,I.exports.default=I.exports}}),Aa=G$(Kh(),1),wa=G$(vh(),1),ba=G$(Vh(),1),Na=G$(_$(),1);class O9{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 O9}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 X9 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 qh($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function Zv($,I){let U=qh($);if("find"in U)return U.find(I);let A=U;for(let D=0;D<A.length;D++){let w=A[D];if(I(w))return w}return}function II($,I){Object.entries($).forEach(([U,A])=>I(A,U))}function mI($,I){return $.indexOf(I)!==-1}function W9($,I){for(let U=0;U<$.length;U++){let A=$[U];if(I(A))return A}return}class G9{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return Zv(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var Fh=($)=>Object.prototype.toString.call($).slice(8,-1),Q9=($)=>typeof $==="undefined",Eh=($)=>$===null,UI=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},eA=($)=>UI($)&&Object.keys($).length===0,_6=($)=>Array.isArray($),Sh=($)=>typeof $==="string",jh=($)=>typeof $==="number"&&!isNaN($),kh=($)=>typeof $==="boolean",gv=($)=>$ instanceof RegExp,j4=($)=>$ instanceof Map,k4=($)=>$ instanceof Set,Y9=($)=>Fh($)==="Symbol",xv=($)=>$ instanceof Date&&!isNaN($.valueOf()),sA=($)=>$ instanceof Error,B9=($)=>typeof $==="number"&&isNaN($),hv=($)=>kh($)||Eh($)||Q9($)||jh($)||Sh($)||Y9($),fv=($)=>typeof $==="bigint",yv=($)=>$===1/0||$===-1/0,uv=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),lv=($)=>$ instanceof URL;var $w=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Iw=($)=>$.map(String).map($w).join("."),rI=($,I)=>{let U=[],A="";for(let w=0;w<$.length;w++){let b=$.charAt(w);if(!I&&b==="\\"){let X=$.charAt(w+1);if(X==="\\"){A+="\\",w++;continue}else if(X!==".")throw Error("invalid path")}if(b==="\\"&&$.charAt(w+1)==="."){A+=".",w++;continue}if(b==="."){U.push(A),A="";continue}A+=b}let D=A;return U.push(D),U};function c6($,I,U,A){return{isApplicable:$,annotation:I,transform:U,untransform:A}}var cv=[c6(Q9,"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(sA,"Error",($,I)=>{let U={name:$.name,message:$.message};if("cause"in $)U.cause=$.cause;return I.allowedErrorProps.forEach((A)=>{U[A]=$[A]}),U},($,I)=>{let U=new Error($.message,{cause:$.cause});return U.name=$.name,U.stack=$.stack,I.allowedErrorProps.forEach((A)=>{U[A]=$[A]}),U}),c6(gv,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),c6(k4,"set",($)=>[...$.values()],($)=>new Set($)),c6(j4,"map",($)=>[...$.entries()],($)=>new Map($)),c6(($)=>B9($)||yv($),"number",($)=>{if(B9($))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 Uw($,I,U,A){return{isApplicable:$,annotation:I,transform:U,untransform:A}}var mv=Uw(($,I)=>{if(Y9($))return!!I.symbolRegistry.getIdentifier($);return!1},($,I)=>{return["symbol",I.symbolRegistry.getIdentifier($)]},($)=>$.description,($,I,U)=>{let A=U.symbolRegistry.getValue(I[1]);if(!A)throw new Error("Trying to deserialize unknown symbol");return A}),Ph=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),rv=Uw(uv,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=Ph[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function J9($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var nv=Uw(J9,($,I)=>{return["class",I.classRegistry.getIdentifier($.constructor)]},($,I)=>{let U=I.classRegistry.getAllowedProps($.constructor);if(!U)return{...$};let A={};return U.forEach((D)=>{A[D]=$[D]}),A},($,I,U)=>{let A=U.classRegistry.getValue(I[1]);if(!A)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(A.prototype),$)}),iv=Uw(($,I)=>{return!!I.customTransformerRegistry.findApplicable($)},($,I)=>{return["custom",I.customTransformerRegistry.findApplicable($).name]},($,I)=>{return I.customTransformerRegistry.findApplicable($).serialize($)},($,I,U)=>{let A=U.customTransformerRegistry.findByName(I[1]);if(!A)throw new Error("Trying to deserialize unknown custom value");return A.deserialize($)}),Rh=[nv,mv,iv,rv],H9=($,I)=>{let U=W9(Rh,(D)=>D.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let A=W9(cv,(D)=>D.isApplicable($,I));if(A)return{value:A.transform($,I),type:A.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 A=ov[I];if(!A)throw new Error("Unknown transformation: "+I);return A.untransform($,U)}};var nI=($,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(mI($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(mI($,"prototype"))throw new Error("prototype is not allowed as a property");if(mI($,"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 A=I[U];if(k4($))$=nI($,+A);else if(j4($)){let D=+A,w=+I[++U]===0?"key":"value",b=nI($,D);switch(w){case"key":$=b;break;case"value":$=$.get(b);break}}else $=$[A]}return $},Dw=($,I,U)=>{if(pv(I),I.length===0)return U($);let A=$;for(let w=0;w<I.length-1;w++){let b=I[w];if(_6(A)){let N=+b;A=A[N]}else if(UI(A))A=A[b];else if(k4(A)){let N=+b;A=nI(A,N)}else if(j4(A)){if(w===I.length-2)break;let O=+b,X=+I[++w]===0?"key":"value",W=nI(A,O);switch(X){case"key":A=W;break;case"value":A=A.get(W);break}}}let D=I[I.length-1];if(_6(A))A[+D]=U(A[+D]);else if(UI(A))A[D]=U(A[D]);if(k4(A)){let w=nI(A,+D),b=U(w);if(w!==b)A.delete(w),A.add(b)}if(j4(A)){let w=+I[I.length-2],b=nI(A,w);switch(+D===0?"key":"value"){case"key":{let O=U(b);if(A.set(O,A.get(b)),O!==b)A.delete(b);break}case"value":{A.set(b,U(A.get(b)));break}}}return $};var av=($)=>$<1;function L9($,I,U,A=[]){if(!$)return;let D=av(U);if(!_6($)){II($,(N,O)=>L9(N,I,U,[...A,...rI(O,D)]));return}let[w,b]=$;if(b)II(b,(N,O)=>{L9(N,I,U,[...A,...rI(O,D)])});I(w,A)}function ev($,I,U,A){return L9(I,(D,w)=>{$=Dw($,w,(b)=>dv(b,D,A))},U),$}function sv($,I,U){let A=av(U);function D(w,b){let N=tv($,rI(b,A));w.map((O)=>rI(O,A)).forEach((O)=>{$=Dw($,O,()=>N)})}if(_6(I)){let[w,b]=I;if(w.forEach((N)=>{$=Dw($,rI(N,A),()=>$)}),b)II(b,D)}else II(I,D);return $}var Th=($,I)=>UI($)||_6($)||j4($)||k4($)||sA($)||J9($,I);function _h($,I,U){let A=U.get($);if(A)A.push(I);else U.set($,[I])}function $V($,I){let U={},A=void 0;if($.forEach((D)=>{if(D.length<=1)return;if(!I)D=D.map((N)=>N.map(String)).sort((N,O)=>N.length-O.length);let[w,...b]=D;if(w.length===0)A=b.map(Iw);else U[Iw(w)]=b.map(Iw)}),A)if(eA(U))return[A];else return[A,U];else return eA(U)?void 0:U}var z9=($,I,U,A,D=[],w=[],b=new Map)=>{let N=hv($);if(!N){_h($,D,I);let Y=b.get($);if(Y)return A?{transformedValue:null}:Y}if(!Th($,U)){let Y=H9($,U),J=Y?{transformedValue:Y.value,annotations:[Y.type]}:{transformedValue:$};if(!N)b.set($,J);return J}if(mI(w,$))return{transformedValue:null};let O=H9($,U),X=O?.value??$,W=_6(X)?[]:{},Q={};II(X,(Y,J)=>{if(J==="__proto__"||J==="constructor"||J==="prototype")throw new Error(`Detected property ${J}. This is a prototype pollution risk, please remove it from your object.`);let H=z9(Y,I,U,A,[...D,J],[...w,$],b);if(W[J]=H.transformedValue,_6(H.annotations))Q[$w(J)]=H.annotations;else if(UI(H.annotations))II(H.annotations,(v,V)=>{Q[$w(J)+"."+V]=v})});let B=eA(Q)?{transformedValue:W,annotations:O?[O.type]:void 0}:{transformedValue:W,annotations:O?[O.type,Q]:Q};if(!N)b.set($,B);return B};function Aw($){return Object.prototype.toString.call($).slice(8,-1)}function ww($){return Aw($)==="Array"}function M9($){if(Aw($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function Ch($,I,U,A,D){let w={}.propertyIsEnumerable.call(A,I)?"enumerable":"nonenumerable";if(w==="enumerable")$[I]=U;if(D&&w==="nonenumerable")Object.defineProperty($,I,{value:U,enumerable:!1,writable:!0,configurable:!0})}function bw($,I={}){if(ww($))return $.map((D)=>bw(D,I));if(!M9($))return $;let U=Object.getOwnPropertyNames($),A=Object.getOwnPropertySymbols($);return[...U,...A].reduce((D,w)=>{if(w==="__proto__")return D;if(ww(I.props)&&!I.props.includes(w))return D;let b=$[w],N=bw(b,I);return Ch(D,w,N,$,I.nonenumerable),D},{})}class U${constructor({dedupe:$=!1}={}){this.classRegistry=new X9,this.symbolRegistry=new fU((I)=>I.description??""),this.customTransformerRegistry=new G9,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=z9($,I,this,this.dedupe),A={json:U.transformedValue};if(U.annotations)A.meta={...A.meta,values:U.annotations};let D=$V(I,this.dedupe);if(D)A.meta={...A.meta,referentialEqualities:D};if(A.meta)A.meta.v=1;return A}deserialize($,I){let{json:U,meta:A}=$,D=I?.inPlace?U:bw(U);if(A?.values)D=ev(D,A.values,A.v??0,this);if(A?.referentialEqualities)D=sv(D,A.referentialEqualities,A.v??0);return D}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 IV=U$;var{serialize:da,deserialize:pa,stringify:ta,parse:aa,registerClass:ea,registerCustom:sa,registerSymbol:$e,allowErrorProps:Ie}=U$;class K9{trpc;constructor($){this.trpc=_v({links:[w9({url:`${$.apiUrl}/trpc`,transformer:IV,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 createMatrixFromArtifact($){return this.trpc.mcpTools.createMatrixFromArtifact.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 v9($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var A4=v9();async function UV($){let I=v9();I.info("Initializing server context...");let U=new K9({apiUrl:$.apiUrl,apiKey:$.apiKey});I.info("Resolving user identity from API key...");let A;try{A=(await U.whoami()).userId,I.info(`Resolved user: ${A.slice(0,8)}...`)}catch(w){I.error("Failed to resolve user identity from API key:",w),I.error("Ensure SURA_API_URL is correct and the API server is running."),process.exit(1)}I.info(`API URL: ${$.apiUrl}`);let D={userId:A,client:U,log:I};try{I.info("Loading workspace context..."),D.workspaceContext=await U.getWorkspaceContext();let w=D.workspaceContext.orgs.length,b=D.workspaceContext.orgs.reduce((N,O)=>N+O.workspaces.length,0);I.info(`Workspace context loaded: ${w} org(s), ${b} workspace(s)`)}catch(w){I.warn("Failed to load workspace context at startup (will retry on first tool call):",w)}return D}var G={};K6(G,{xor:()=>kq,xid:()=>aV,void:()=>Vq,uuidv7:()=>mV,uuidv6:()=>cV,uuidv4:()=>lV,uuid:()=>uV,util:()=>S,url:()=>rV,uppercase:()=>D1,unknown:()=>WI,union:()=>_b,undefined:()=>Kq,ulid:()=>tV,uint64:()=>zq,uint32:()=>Jq,tuple:()=>fB,trim:()=>X1,treeifyError:()=>C9,transform:()=>Zb,toUpperCase:()=>G1,toLowerCase:()=>W1,toJSONSchema:()=>wb,templateLiteral:()=>lq,symbol:()=>Mq,superRefine:()=>X7,success:()=>fq,stringbool:()=>pq,stringFormat:()=>Oq,string:()=>Gb,strictObject:()=>Sq,startsWith:()=>w1,slugify:()=>Q1,size:()=>$1,setErrorMap:()=>Hu,set:()=>Cq,safeParseAsync:()=>QB,safeParse:()=>GB,safeEncodeAsync:()=>MB,safeEncode:()=>LB,safeDecodeAsync:()=>KB,safeDecode:()=>zB,registry:()=>Tw,regexes:()=>M6,regex:()=>I1,refine:()=>O7,record:()=>yB,readonly:()=>U7,property:()=>Ub,promise:()=>cq,prettifyError:()=>Z9,preprocess:()=>aq,prefault:()=>pB,positive:()=>ew,pipe:()=>Q0,partialRecord:()=>Rq,parseAsync:()=>WB,parse:()=>XB,overwrite:()=>C6,optional:()=>W0,object:()=>Eq,number:()=>VB,nullish:()=>hq,nullable:()=>G0,null:()=>jB,normalize:()=>O1,nonpositive:()=>$b,nonoptional:()=>tB,nonnegative:()=>Ib,never:()=>Tb,negative:()=>sw,nativeEnum:()=>Zq,nanoid:()=>oV,nan:()=>yq,multipleOf:()=>Z4,minSize:()=>g4,minLength:()=>w4,mime:()=>N1,meta:()=>oq,maxSize:()=>NI,maxLength:()=>OI,map:()=>_q,mac:()=>$q,lte:()=>W6,lt:()=>r6,lowercase:()=>U1,looseRecord:()=>Tq,looseObject:()=>jq,locales:()=>w0,literal:()=>gq,length:()=>XI,lazy:()=>w7,ksuid:()=>eV,keyof:()=>Fq,jwt:()=>Nq,json:()=>tq,iso:()=>J1,ipv6:()=>Iq,ipv4:()=>sV,intersection:()=>xB,int64:()=>Lq,int32:()=>Bq,int:()=>Qb,instanceof:()=>dq,includes:()=>A1,httpUrl:()=>nV,hostname:()=>Xq,hex:()=>Wq,hash:()=>Gq,guid:()=>yV,gte:()=>p$,gt:()=>n6,globalRegistry:()=>d$,getErrorMap:()=>Lu,function:()=>mq,fromJSONSchema:()=>sq,formatError:()=>dU,float64:()=>Yq,float32:()=>Qq,flattenError:()=>oU,file:()=>xq,enum:()=>Cb,endsWith:()=>b1,encodeAsync:()=>JB,encode:()=>YB,emoji:()=>iV,email:()=>fV,e164:()=>bq,discriminatedUnion:()=>Pq,describe:()=>iq,decodeAsync:()=>HB,decode:()=>BB,date:()=>qq,custom:()=>nq,cuid2:()=>pV,cuid:()=>dV,core:()=>b4,config:()=>k$,coerce:()=>G7,codec:()=>uq,clone:()=>o$,cidrv6:()=>Dq,cidrv4:()=>Uq,check:()=>rq,catch:()=>sB,boolean:()=>qB,bigint:()=>Hq,base64url:()=>wq,base64:()=>Aq,array:()=>J0,any:()=>vq,_function:()=>mq,_default:()=>oB,_ZodString:()=>Yb,ZodXor:()=>CB,ZodXID:()=>Kb,ZodVoid:()=>TB,ZodUnknown:()=>PB,ZodUnion:()=>L0,ZodUndefined:()=>EB,ZodUUID:()=>i6,ZodURL:()=>Y0,ZodULID:()=>Mb,ZodType:()=>t,ZodTuple:()=>hB,ZodTransform:()=>rB,ZodTemplateLiteral:()=>D7,ZodSymbol:()=>FB,ZodSuccess:()=>aB,ZodStringFormat:()=>Y$,ZodString:()=>L1,ZodSet:()=>lB,ZodRecord:()=>z0,ZodRealError:()=>A6,ZodReadonly:()=>I7,ZodPromise:()=>b7,ZodPrefault:()=>dB,ZodPipe:()=>hb,ZodOptional:()=>gb,ZodObject:()=>H0,ZodNumberFormat:()=>GI,ZodNumber:()=>M1,ZodNullable:()=>nB,ZodNull:()=>SB,ZodNonOptional:()=>xb,ZodNever:()=>RB,ZodNanoID:()=>Hb,ZodNaN:()=>$7,ZodMap:()=>uB,ZodMAC:()=>vB,ZodLiteral:()=>cB,ZodLazy:()=>A7,ZodKSUID:()=>vb,ZodJWT:()=>Pb,ZodIssueCode:()=>Ju,ZodIntersection:()=>gB,ZodISOTime:()=>Xb,ZodISODuration:()=>Wb,ZodISODateTime:()=>Nb,ZodISODate:()=>Ob,ZodIPv6:()=>qb,ZodIPv4:()=>Vb,ZodGUID:()=>X0,ZodFunction:()=>N7,ZodFirstPartyTypeKind:()=>W7,ZodFile:()=>mB,ZodError:()=>Yu,ZodEnum:()=>H1,ZodEmoji:()=>Jb,ZodEmail:()=>Bb,ZodE164:()=>kb,ZodDiscriminatedUnion:()=>ZB,ZodDefault:()=>iB,ZodDate:()=>B0,ZodCustomStringFormat:()=>z1,ZodCustom:()=>M0,ZodCodec:()=>fb,ZodCatch:()=>eB,ZodCUID2:()=>zb,ZodCUID:()=>Lb,ZodCIDRv6:()=>Eb,ZodCIDRv4:()=>Fb,ZodBoolean:()=>K1,ZodBigIntFormat:()=>Rb,ZodBigInt:()=>v1,ZodBase64URL:()=>jb,ZodBase64:()=>Sb,ZodArray:()=>_B,ZodAny:()=>kB,TimePrecision:()=>hQ,NEVER:()=>V9,$output:()=>TQ,$input:()=>_Q,$brand:()=>q9});var b4={};K6(b4,{version:()=>RG,util:()=>S,treeifyError:()=>C9,toJSONSchema:()=>wb,toDotPath:()=>OV,safeParseAsync:()=>x9,safeParse:()=>g9,safeEncodeAsync:()=>Qf,safeEncode:()=>Wf,safeDecodeAsync:()=>Yf,safeDecode:()=>Gf,registry:()=>Tw,regexes:()=>M6,process:()=>X$,prettifyError:()=>Z9,parseAsync:()=>Ww,parse:()=>Xw,meta:()=>LY,locales:()=>w0,isValidJWT:()=>jV,isValidBase64URL:()=>SV,isValidBase64:()=>eG,initializeContext:()=>x4,globalRegistry:()=>d$,globalConfig:()=>yU,formatError:()=>dU,flattenError:()=>oU,finalize:()=>f4,extractDefs:()=>h4,encodeAsync:()=>Of,encode:()=>bf,describe:()=>HY,decodeAsync:()=>Xf,decode:()=>Nf,createToJSONSchemaMethod:()=>MY,createStandardJSONSchemaMethod:()=>B1,config:()=>k$,clone:()=>o$,_xor:()=>my,_xid:()=>cw,_void:()=>NY,_uuidv7:()=>xw,_uuidv6:()=>gw,_uuidv4:()=>Zw,_uuid:()=>Cw,_url:()=>N0,_uppercase:()=>D1,_unknown:()=>wY,_union:()=>cy,_undefined:()=>UY,_ulid:()=>lw,_uint64:()=>$Y,_uint32:()=>dQ,_tuple:()=>iy,_trim:()=>X1,_transform:()=>sy,_toUpperCase:()=>G1,_toLowerCase:()=>W1,_templateLiteral:()=>Ou,_symbol:()=>IY,_superRefine:()=>JY,_success:()=>Au,_stringbool:()=>zY,_stringFormat:()=>Y1,_string:()=>ZQ,_startsWith:()=>w1,_slugify:()=>Q1,_size:()=>$1,_set:()=>py,_safeParseAsync:()=>eI,_safeParse:()=>aI,_safeEncodeAsync:()=>Lw,_safeEncode:()=>Jw,_safeDecodeAsync:()=>zw,_safeDecode:()=>Hw,_regex:()=>I1,_refine:()=>BY,_record:()=>oy,_readonly:()=>Nu,_property:()=>Ub,_promise:()=>Wu,_positive:()=>ew,_pipe:()=>bu,_parseAsync:()=>tI,_parse:()=>pI,_overwrite:()=>C6,_optional:()=>$u,_number:()=>cQ,_nullable:()=>Iu,_null:()=>DY,_normalize:()=>O1,_nonpositive:()=>$b,_nonoptional:()=>Du,_nonnegative:()=>Ib,_never:()=>bY,_negative:()=>sw,_nativeEnum:()=>ay,_nanoid:()=>fw,_nan:()=>WY,_multipleOf:()=>Z4,_minSize:()=>g4,_minLength:()=>w4,_min:()=>p$,_mime:()=>N1,_maxSize:()=>NI,_maxLength:()=>OI,_max:()=>W6,_map:()=>dy,_mac:()=>xQ,_lte:()=>W6,_lt:()=>r6,_lowercase:()=>U1,_literal:()=>ey,_length:()=>XI,_lazy:()=>Xu,_ksuid:()=>mw,_jwt:()=>aw,_isoTime:()=>uQ,_isoDuration:()=>lQ,_isoDateTime:()=>fQ,_isoDate:()=>yQ,_ipv6:()=>nw,_ipv4:()=>rw,_intersection:()=>ny,_int64:()=>sQ,_int32:()=>oQ,_int:()=>rQ,_includes:()=>A1,_guid:()=>b0,_gte:()=>p$,_gt:()=>n6,_float64:()=>iQ,_float32:()=>nQ,_file:()=>QY,_enum:()=>ty,_endsWith:()=>b1,_encodeAsync:()=>Yw,_encode:()=>Gw,_emoji:()=>hw,_email:()=>_w,_e164:()=>tw,_discriminatedUnion:()=>ry,_default:()=>Uu,_decodeAsync:()=>Bw,_decode:()=>Qw,_date:()=>OY,_custom:()=>YY,_cuid2:()=>uw,_cuid:()=>yw,_coercedString:()=>gQ,_coercedNumber:()=>mQ,_coercedDate:()=>XY,_coercedBoolean:()=>tQ,_coercedBigint:()=>eQ,_cidrv6:()=>ow,_cidrv4:()=>iw,_check:()=>gV,_catch:()=>wu,_boolean:()=>pQ,_bigint:()=>aQ,_base64url:()=>pw,_base64:()=>dw,_array:()=>GY,_any:()=>AY,TimePrecision:()=>hQ,NEVER:()=>V9,JSONSchemaGenerator:()=>AB,JSONSchema:()=>xV,Doc:()=>Vw,$output:()=>TQ,$input:()=>_Q,$constructor:()=>L,$brand:()=>q9,$ZodXor:()=>H8,$ZodXID:()=>lG,$ZodVoid:()=>Q8,$ZodUnknown:()=>W8,$ZodUnion:()=>eU,$ZodUndefined:()=>N8,$ZodUUID:()=>CG,$ZodURL:()=>gG,$ZodULID:()=>uG,$ZodType:()=>o,$ZodTuple:()=>Rw,$ZodTransform:()=>E8,$ZodTemplateLiteral:()=>x8,$ZodSymbol:()=>b8,$ZodSuccess:()=>T8,$ZodStringFormat:()=>Q$,$ZodString:()=>bI,$ZodSet:()=>v8,$ZodRegistry:()=>CQ,$ZodRecord:()=>M8,$ZodRealError:()=>D6,$ZodReadonly:()=>g8,$ZodPromise:()=>f8,$ZodPrefault:()=>P8,$ZodPipe:()=>Z8,$ZodOptional:()=>S8,$ZodObjectJIT:()=>J8,$ZodObject:()=>RV,$ZodNumberFormat:()=>A8,$ZodNumber:()=>kw,$ZodNullable:()=>j8,$ZodNull:()=>O8,$ZodNonOptional:()=>R8,$ZodNever:()=>G8,$ZodNanoID:()=>hG,$ZodNaN:()=>C8,$ZodMap:()=>K8,$ZodMAC:()=>pG,$ZodLiteral:()=>q8,$ZodLazy:()=>y8,$ZodKSUID:()=>cG,$ZodJWT:()=>U8,$ZodIntersection:()=>z8,$ZodISOTime:()=>nG,$ZodISODuration:()=>iG,$ZodISODateTime:()=>mG,$ZodISODate:()=>rG,$ZodIPv6:()=>dG,$ZodIPv4:()=>oG,$ZodGUID:()=>_G,$ZodFunction:()=>h8,$ZodFile:()=>F8,$ZodError:()=>iU,$ZodEnum:()=>V8,$ZodEncodeError:()=>DI,$ZodEmoji:()=>xG,$ZodEmail:()=>ZG,$ZodE164:()=>I8,$ZodDiscriminatedUnion:()=>L8,$ZodDefault:()=>k8,$ZodDate:()=>Y8,$ZodCustomStringFormat:()=>D8,$ZodCustom:()=>u8,$ZodCodec:()=>sU,$ZodCheckUpperCase:()=>qG,$ZodCheckStringFormat:()=>sI,$ZodCheckStartsWith:()=>EG,$ZodCheckSizeEquals:()=>LG,$ZodCheckRegex:()=>vG,$ZodCheckProperty:()=>jG,$ZodCheckOverwrite:()=>PG,$ZodCheckNumberFormat:()=>YG,$ZodCheckMultipleOf:()=>QG,$ZodCheckMinSize:()=>HG,$ZodCheckMinLength:()=>MG,$ZodCheckMimeType:()=>kG,$ZodCheckMaxSize:()=>JG,$ZodCheckMaxLength:()=>zG,$ZodCheckLowerCase:()=>VG,$ZodCheckLessThan:()=>Kw,$ZodCheckLengthEquals:()=>KG,$ZodCheckIncludes:()=>FG,$ZodCheckGreaterThan:()=>vw,$ZodCheckEndsWith:()=>SG,$ZodCheckBigIntFormat:()=>BG,$ZodCheck:()=>J$,$ZodCatch:()=>_8,$ZodCUID2:()=>yG,$ZodCUID:()=>fG,$ZodCIDRv6:()=>aG,$ZodCIDRv4:()=>tG,$ZodBoolean:()=>aU,$ZodBigIntFormat:()=>w8,$ZodBigInt:()=>Pw,$ZodBase64URL:()=>$8,$ZodBase64:()=>sG,$ZodAsyncError:()=>m6,$ZodArray:()=>B8,$ZodAny:()=>X8});var V9=Object.freeze({status:"aborted"});function L($,I,U){function A(N,O){if(!N._zod)Object.defineProperty(N,"_zod",{value:{def:O,constr:b,traits:new Set},enumerable:!1});if(N._zod.traits.has($))return;N._zod.traits.add($),I(N,O);let X=b.prototype,W=Object.keys(X);for(let Q=0;Q<W.length;Q++){let B=W[Q];if(!(B in N))N[B]=X[B].bind(N)}}let D=U?.Parent??Object;class w extends D{}Object.defineProperty(w,"name",{value:$});function b(N){var O;let X=U?.Parent?new w:this;A(X,N),(O=X._zod).deferred??(O.deferred=[]);for(let W of X._zod.deferred)W();return X}return Object.defineProperty(b,"init",{value:A}),Object.defineProperty(b,Symbol.hasInstance,{value:(N)=>{if(U?.Parent&&N instanceof U.Parent)return!0;return N?._zod?.traits?.has($)}}),Object.defineProperty(b,"name",{value:$}),b}var q9=Symbol("zod_brand");class m6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class DI extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var yU={};function k$($){if($)Object.assign(yU,$);return yU}var S={};K6(S,{unwrapMessage:()=>uU,uint8ArrayToHex:()=>Af,uint8ArrayToBase64url:()=>Uf,uint8ArrayToBase64:()=>wV,stringifyPrimitive:()=>E,slugify:()=>S9,shallowClone:()=>k9,safeExtend:()=>th,required:()=>sh,randomString:()=>mh,propertyKeyTypes:()=>mU,promiseAllObject:()=>ch,primitiveTypes:()=>P9,prefixIssues:()=>X6,pick:()=>oh,partial:()=>eh,optionalKeys:()=>R9,omit:()=>dh,objectClone:()=>yh,numKeys:()=>rh,nullish:()=>P4,normalizeParams:()=>j,mergeDefs:()=>T4,merge:()=>ah,jsonStringifyReplacer:()=>iI,joinValues:()=>z,issue:()=>dI,isPlainObject:()=>_4,isObject:()=>AI,hexToUint8Array:()=>Df,getSizableOrigin:()=>rU,getParsedType:()=>nh,getLengthableOrigin:()=>nU,getEnumValues:()=>lU,getElementAtPath:()=>lh,floatSafeRemainder:()=>E9,finalizeIssue:()=>U6,extend:()=>ph,escapeRegex:()=>z6,esc:()=>Nw,defineLazy:()=>s,createTransparentProxy:()=>ih,cloneDef:()=>uh,clone:()=>o$,cleanRegex:()=>cU,cleanEnum:()=>$f,captureStackTrace:()=>Ow,cached:()=>oI,base64urlToUint8Array:()=>If,base64ToUint8Array:()=>AV,assignProp:()=>R4,assertNotEqual:()=>gh,assertNever:()=>hh,assertIs:()=>xh,assertEqual:()=>Zh,assert:()=>fh,allowsEval:()=>j9,aborted:()=>C4,NUMBER_FORMAT_RANGES:()=>T9,Class:()=>bV,BIGINT_FORMAT_RANGES:()=>_9});function Zh($){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((A)=>typeof A==="number");return Object.entries($).filter(([A,D])=>I.indexOf(+A)===-1).map(([A,D])=>D)}function z($,I="|"){return $.map((U)=>E(U)).join(I)}function iI($,I){if(typeof I==="bigint")return I.toString();return I}function oI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function P4($){return $===null||$===void 0}function cU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function E9($,I){let U=($.toString().split(".")[1]||"").length,A=I.toString(),D=(A.split(".")[1]||"").length;if(D===0&&/\d?e-\d?/.test(A)){let O=A.match(/\d?e-(\d?)/);if(O?.[1])D=Number.parseInt(O[1])}let w=U>D?U:D,b=Number.parseInt($.toFixed(w).replace(".","")),N=Number.parseInt(I.toFixed(w).replace(".",""));return b%N/10**w}var DV=Symbol("evaluating");function s($,I,U){let A=void 0;Object.defineProperty($,I,{get(){if(A===DV)return;if(A===void 0)A=DV,A=U();return A},set(D){Object.defineProperty($,I,{value:D})},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 A=Object.getOwnPropertyDescriptors(U);Object.assign(I,A)}return Object.defineProperties({},I)}function uh($){return T4($._zod.def)}function lh($,I){if(!I)return $;return I.reduce((U,A)=>U?.[A],$)}function ch($){let I=Object.keys($),U=I.map((A)=>$[A]);return Promise.all(U).then((A)=>{let D={};for(let w=0;w<I.length;w++)D[I[w]]=A[w];return D})}function mh($=10){let U="";for(let A=0;A<$;A++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Nw($){return JSON.stringify($)}function S9($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ow="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function AI($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var j9=oI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function _4($){if(AI($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(AI(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function k9($){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"]),P9=new Set(["string","number","bigint","boolean","symbol","undefined"]);function z6($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o$($,I,U){let A=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)A._zod.parent=$;return A}function j($){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,A,D){return I??(I=$()),Reflect.get(I,A,D)},set(U,A,D,w){return I??(I=$()),Reflect.set(I,A,D,w)},has(U,A){return I??(I=$()),Reflect.has(I,A)},deleteProperty(U,A){return I??(I=$()),Reflect.deleteProperty(I,A)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,A){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,A)},defineProperty(U,A,D){return I??(I=$()),Reflect.defineProperty(I,A,D)}})}function E($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function R9($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var T9={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]},_9={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function oh($,I){let U=$._zod.def,A=T4($._zod.def,{get shape(){let D={};for(let w in I){if(!(w in U.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;D[w]=U.shape[w]}return R4(this,"shape",D),D},checks:[]});return o$($,A)}function dh($,I){let U=$._zod.def,A=T4($._zod.def,{get shape(){let D={...$._zod.def.shape};for(let w in I){if(!(w in U.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;delete D[w]}return R4(this,"shape",D),D},checks:[]});return o$($,A)}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 D=T4($._zod.def,{get shape(){let w={...$._zod.def.shape,...I};return R4(this,"shape",w),w},checks:[]});return o$($,D)}function th($,I){if(!_4(I))throw new Error("Invalid input to safeExtend: expected a plain object");let U={...$._zod.def,get shape(){let A={...$._zod.def.shape,...I};return R4(this,"shape",A),A},checks:$._zod.def.checks};return o$($,U)}function ah($,I){let U=T4($._zod.def,{get shape(){let A={...$._zod.def.shape,...I._zod.def.shape};return R4(this,"shape",A),A},get catchall(){return I._zod.def.catchall},checks:[]});return o$($,U)}function eh($,I,U){let A=T4(I._zod.def,{get shape(){let D=I._zod.def.shape,w={...D};if(U)for(let b in U){if(!(b in D))throw new Error(`Unrecognized key: "${b}"`);if(!U[b])continue;w[b]=$?new $({type:"optional",innerType:D[b]}):D[b]}else for(let b in D)w[b]=$?new $({type:"optional",innerType:D[b]}):D[b];return R4(this,"shape",w),w},checks:[]});return o$(I,A)}function sh($,I,U){let A=T4(I._zod.def,{get shape(){let D=I._zod.def.shape,w={...D};if(U)for(let b in U){if(!(b in w))throw new Error(`Unrecognized key: "${b}"`);if(!U[b])continue;w[b]=new $({type:"nonoptional",innerType:D[b]})}else for(let b in D)w[b]=new $({type:"nonoptional",innerType:D[b]});return R4(this,"shape",w),w},checks:[]});return o$(I,A)}function C4($,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 X6($,I){return I.map((U)=>{var A;return(A=U).path??(A.path=[]),U.path.unshift($),U})}function uU($){return typeof $==="string"?$:$?.message}function U6($,I,U){let A={...$,path:$.path??[]};if(!$.message){let D=uU($.inst?._zod.def?.error?.($))??uU(I?.error?.($))??uU(U.customError?.($))??uU(U.localeError?.($))??"Invalid input";A.message=D}if(delete A.inst,delete A.continue,!I?.reportInput)delete A.input;return A}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 dI(...$){let[I,U,A]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:A};return{...I}}function $f($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function AV($){let I=atob($),U=new Uint8Array(I.length);for(let A=0;A<I.length;A++)U[A]=I.charCodeAt(A);return U}function wV($){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 AV(I+U)}function Uf($){return wV($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Df($){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 A=0;A<I.length;A+=2)U[A/2]=Number.parseInt(I.slice(A,A+2),16);return U}function Af($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class bV{constructor(...$){}}var NV=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,iI,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},iU=L("$ZodError",NV),D6=L("$ZodError",NV,{Parent:Error});function oU($,I=(U)=>U.message){let U={},A=[];for(let D of $.issues)if(D.path.length>0)U[D.path[0]]=U[D.path[0]]||[],U[D.path[0]].push(I(D));else A.push(I(D));return{formErrors:A,fieldErrors:U}}function dU($,I=(U)=>U.message){let U={_errors:[]},A=(D)=>{for(let w of D.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map((b)=>A({issues:b}));else if(w.code==="invalid_key")A({issues:w.issues});else if(w.code==="invalid_element")A({issues:w.issues});else if(w.path.length===0)U._errors.push(I(w));else{let b=U,N=0;while(N<w.path.length){let O=w.path[N];if(N!==w.path.length-1)b[O]=b[O]||{_errors:[]};else b[O]=b[O]||{_errors:[]},b[O]._errors.push(I(w));b=b[O],N++}}};return A($),U}function C9($,I=(U)=>U.message){let U={errors:[]},A=(D,w=[])=>{var b,N;for(let O of D.issues)if(O.code==="invalid_union"&&O.errors.length)O.errors.map((X)=>A({issues:X},O.path));else if(O.code==="invalid_key")A({issues:O.issues},O.path);else if(O.code==="invalid_element")A({issues:O.issues},O.path);else{let X=[...w,...O.path];if(X.length===0){U.errors.push(I(O));continue}let W=U,Q=0;while(Q<X.length){let B=X[Q],Y=Q===X.length-1;if(typeof B==="string")W.properties??(W.properties={}),(b=W.properties)[B]??(b[B]={errors:[]}),W=W.properties[B];else W.items??(W.items=[]),(N=W.items)[B]??(N[B]={errors:[]}),W=W.items[B];if(Y)W.errors.push(I(O));Q++}}};return A($),U}function OV($){let I=[],U=$.map((A)=>typeof A==="object"?A.key:A);for(let A of U)if(typeof A==="number")I.push(`[${A}]`);else if(typeof A==="symbol")I.push(`[${JSON.stringify(String(A))}]`);else if(/[^\w$]/.test(A))I.push(`[${JSON.stringify(A)}]`);else{if(I.length)I.push(".");I.push(A)}return I.join("")}function Z9($){let I=[],U=[...$.issues].sort((A,D)=>(A.path??[]).length-(D.path??[]).length);for(let A of U)if(I.push(`✖ ${A.message}`),A.path?.length)I.push(` → at ${OV(A.path)}`);return I.join(`
43
+ `)}var pI=($)=>(I,U,A,D)=>{let w=A?Object.assign(A,{async:!1}):{async:!1},b=I._zod.run({value:U,issues:[]},w);if(b instanceof Promise)throw new m6;if(b.issues.length){let N=new(D?.Err??$)(b.issues.map((O)=>U6(O,w,k$())));throw Ow(N,D?.callee),N}return b.value},Xw=pI(D6),tI=($)=>async(I,U,A,D)=>{let w=A?Object.assign(A,{async:!0}):{async:!0},b=I._zod.run({value:U,issues:[]},w);if(b instanceof Promise)b=await b;if(b.issues.length){let N=new(D?.Err??$)(b.issues.map((O)=>U6(O,w,k$())));throw Ow(N,D?.callee),N}return b.value},Ww=tI(D6),aI=($)=>(I,U,A)=>{let D=A?{...A,async:!1}:{async:!1},w=I._zod.run({value:U,issues:[]},D);if(w instanceof Promise)throw new m6;return w.issues.length?{success:!1,error:new($??iU)(w.issues.map((b)=>U6(b,D,k$())))}:{success:!0,data:w.value}},g9=aI(D6),eI=($)=>async(I,U,A)=>{let D=A?Object.assign(A,{async:!0}):{async:!0},w=I._zod.run({value:U,issues:[]},D);if(w instanceof Promise)w=await w;return w.issues.length?{success:!1,error:new $(w.issues.map((b)=>U6(b,D,k$())))}:{success:!0,data:w.value}},x9=eI(D6),Gw=($)=>(I,U,A)=>{let D=A?Object.assign(A,{direction:"backward"}):{direction:"backward"};return pI($)(I,U,D)},bf=Gw(D6),Qw=($)=>(I,U,A)=>{return pI($)(I,U,A)},Nf=Qw(D6),Yw=($)=>async(I,U,A)=>{let D=A?Object.assign(A,{direction:"backward"}):{direction:"backward"};return tI($)(I,U,D)},Of=Yw(D6),Bw=($)=>async(I,U,A)=>{return tI($)(I,U,A)},Xf=Bw(D6),Jw=($)=>(I,U,A)=>{let D=A?Object.assign(A,{direction:"backward"}):{direction:"backward"};return aI($)(I,U,D)},Wf=Jw(D6),Hw=($)=>(I,U,A)=>{return aI($)(I,U,A)},Gf=Hw(D6),Lw=($)=>async(I,U,A)=>{let D=A?Object.assign(A,{direction:"backward"}):{direction:"backward"};return eI($)(I,U,D)},Qf=Lw(D6),zw=($)=>async(I,U,A)=>{return eI($)(I,U,A)},Yf=zw(D6);var M6={};K6(M6,{xid:()=>u9,uuid7:()=>Lf,uuid6:()=>Hf,uuid4:()=>Jf,uuid:()=>wI,uppercase:()=>GG,unicodeEmail:()=>XV,undefined:()=>XG,ulid:()=>y9,time:()=>IG,string:()=>DG,sha512_hex:()=>ff,sha512_base64url:()=>uf,sha512_base64:()=>yf,sha384_hex:()=>gf,sha384_base64url:()=>hf,sha384_base64:()=>xf,sha256_hex:()=>_f,sha256_base64url:()=>Zf,sha256_base64:()=>Cf,sha1_hex:()=>Pf,sha1_base64url:()=>Tf,sha1_base64:()=>Rf,rfc5322Email:()=>Mf,number:()=>bG,null:()=>OG,nanoid:()=>c9,md5_hex:()=>Sf,md5_base64url:()=>kf,md5_base64:()=>jf,mac:()=>p9,lowercase:()=>WG,ksuid:()=>l9,ipv6:()=>d9,ipv4:()=>o9,integer:()=>wG,idnEmail:()=>Kf,html5Email:()=>zf,hostname:()=>qf,hex:()=>Ef,guid:()=>r9,extendedDuration:()=>Bf,emoji:()=>i9,email:()=>n9,e164:()=>s9,duration:()=>m9,domain:()=>Ff,datetime:()=>UG,date:()=>$G,cuid2:()=>f9,cuid:()=>h9,cidrv6:()=>a9,cidrv4:()=>t9,browserEmail:()=>vf,boolean:()=>NG,bigint:()=>AG,base64url:()=>Mw,base64:()=>e9});var h9=/^[cC][^\s-]{8,}$/,f9=/^[0-9a-z]+$/,y9=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,u9=/^[0-9a-vA-V]{20}$/,l9=/^[A-Za-z0-9]{27}$/,c9=/^[a-zA-Z0-9_-]{21}$/,m9=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bf=/^[-+]?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)?)??$/,r9=/^([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})$/,wI=($)=>{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})$`)},Jf=wI(4),Hf=wI(6),Lf=wI(7),n9=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zf=/^[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=/^(([^<>()\[\]\\.,;:\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,}))$/,XV=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Kf=XV,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])?)*$/,Vf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function i9(){return new RegExp(Vf,"u")}var o9=/^(?:(?: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])$/,d9=/^(([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}|:))$/,p9=($)=>{let I=z6($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},t9=/^((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])$/,a9=/^(([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])$/,e9=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mw=/^[A-Za-z0-9_-]*$/,qf=/^(?=.{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,}$/,s9=/^\+(?:[0-9]){6,14}[0-9]$/,WV="(?:(?:\\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])))",$G=new RegExp(`^${WV}$`);function GV($){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 IG($){return new RegExp(`^${GV($)}$`)}function UG($){let I=GV({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let A=`${I}(?:${U.join("|")})`;return new RegExp(`^${WV}T(?:${A})$`)}var DG=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},AG=/^-?\d+n?$/,wG=/^-?\d+$/,bG=/^-?\d+(?:\.\d+)?/,NG=/^(?:true|false)$/i,OG=/^null$/i;var XG=/^undefined$/i;var WG=/^[^A-Z]*$/,GG=/^[^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}$/,jf=pU(22,"=="),kf=tU(22),Pf=/^[0-9a-fA-F]{40}$/,Rf=pU(27,"="),Tf=tU(27),_f=/^[0-9a-fA-F]{64}$/,Cf=pU(43,"="),Zf=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 J$=L("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),YV={number:"number",bigint:"bigint",object:"date"},Kw=L("$ZodCheckLessThan",($,I)=>{J$.init($,I);let U=YV[typeof I.value];$._zod.onattach.push((A)=>{let D=A._zod.bag,w=(I.inclusive?D.maximum:D.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<w)if(I.inclusive)D.maximum=I.value;else D.exclusiveMaximum=I.value}),$._zod.check=(A)=>{if(I.inclusive?A.value<=I.value:A.value<I.value)return;A.issues.push({origin:U,code:"too_big",maximum:I.value,input:A.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),vw=L("$ZodCheckGreaterThan",($,I)=>{J$.init($,I);let U=YV[typeof I.value];$._zod.onattach.push((A)=>{let D=A._zod.bag,w=(I.inclusive?D.minimum:D.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>w)if(I.inclusive)D.minimum=I.value;else D.exclusiveMinimum=I.value}),$._zod.check=(A)=>{if(I.inclusive?A.value>=I.value:A.value>I.value)return;A.issues.push({origin:U,code:"too_small",minimum:I.value,input:A.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),QG=L("$ZodCheckMultipleOf",($,I)=>{J$.init($,I),$._zod.onattach.push((U)=>{var A;(A=U._zod.bag).multipleOf??(A.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):E9(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})}}),YG=L("$ZodCheckNumberFormat",($,I)=>{J$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),A=U?"int":"number",[D,w]=T9[I.format];$._zod.onattach.push((b)=>{let N=b._zod.bag;if(N.format=I.format,N.minimum=D,N.maximum=w,U)N.pattern=wG}),$._zod.check=(b)=>{let N=b.value;if(U){if(!Number.isInteger(N)){b.issues.push({expected:A,format:I.format,code:"invalid_type",continue:!1,input:N,inst:$});return}if(!Number.isSafeInteger(N)){if(N>0)b.issues.push({input:N,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:A,continue:!I.abort});else b.issues.push({input:N,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:A,continue:!I.abort});return}}if(N<D)b.issues.push({origin:"number",input:N,code:"too_small",minimum:D,inclusive:!0,inst:$,continue:!I.abort});if(N>w)b.issues.push({origin:"number",input:N,code:"too_big",maximum:w,inst:$})}}),BG=L("$ZodCheckBigIntFormat",($,I)=>{J$.init($,I);let[U,A]=_9[I.format];$._zod.onattach.push((D)=>{let w=D._zod.bag;w.format=I.format,w.minimum=U,w.maximum=A}),$._zod.check=(D)=>{let w=D.value;if(w<U)D.issues.push({origin:"bigint",input:w,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(w>A)D.issues.push({origin:"bigint",input:w,code:"too_big",maximum:A,inst:$})}}),JG=L("$ZodCheckMaxSize",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!P4(D)&&D.size!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<D)A._zod.bag.maximum=I.maximum}),$._zod.check=(A)=>{let D=A.value;if(D.size<=I.maximum)return;A.issues.push({origin:rU(D),code:"too_big",maximum:I.maximum,inclusive:!0,input:D,inst:$,continue:!I.abort})}}),HG=L("$ZodCheckMinSize",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!P4(D)&&D.size!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>D)A._zod.bag.minimum=I.minimum}),$._zod.check=(A)=>{let D=A.value;if(D.size>=I.minimum)return;A.issues.push({origin:rU(D),code:"too_small",minimum:I.minimum,inclusive:!0,input:D,inst:$,continue:!I.abort})}}),LG=L("$ZodCheckSizeEquals",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!P4(D)&&D.size!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag;D.minimum=I.size,D.maximum=I.size,D.size=I.size}),$._zod.check=(A)=>{let D=A.value,w=D.size;if(w===I.size)return;let b=w>I.size;A.issues.push({origin:rU(D),...b?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:A.value,inst:$,continue:!I.abort})}}),zG=L("$ZodCheckMaxLength",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!P4(D)&&D.length!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<D)A._zod.bag.maximum=I.maximum}),$._zod.check=(A)=>{let D=A.value;if(D.length<=I.maximum)return;let b=nU(D);A.issues.push({origin:b,code:"too_big",maximum:I.maximum,inclusive:!0,input:D,inst:$,continue:!I.abort})}}),MG=L("$ZodCheckMinLength",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!P4(D)&&D.length!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>D)A._zod.bag.minimum=I.minimum}),$._zod.check=(A)=>{let D=A.value;if(D.length>=I.minimum)return;let b=nU(D);A.issues.push({origin:b,code:"too_small",minimum:I.minimum,inclusive:!0,input:D,inst:$,continue:!I.abort})}}),KG=L("$ZodCheckLengthEquals",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(A)=>{let D=A.value;return!P4(D)&&D.length!==void 0}),$._zod.onattach.push((A)=>{let D=A._zod.bag;D.minimum=I.length,D.maximum=I.length,D.length=I.length}),$._zod.check=(A)=>{let D=A.value,w=D.length;if(w===I.length)return;let b=nU(D),N=w>I.length;A.issues.push({origin:b,...N?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:A.value,inst:$,continue:!I.abort})}}),sI=L("$ZodCheckStringFormat",($,I)=>{var U,A;if(J$.init($,I),$._zod.onattach.push((D)=>{let w=D._zod.bag;if(w.format=I.format,I.pattern)w.patterns??(w.patterns=new Set),w.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(D)=>{if(I.pattern.lastIndex=0,I.pattern.test(D.value))return;D.issues.push({origin:"string",code:"invalid_format",format:I.format,input:D.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(A=$._zod).check??(A.check=()=>{})}),vG=L("$ZodCheckRegex",($,I)=>{sI.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})}}),VG=L("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=WG),sI.init($,I)}),qG=L("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=GG),sI.init($,I)}),FG=L("$ZodCheckIncludes",($,I)=>{J$.init($,I);let U=z6(I.includes),A=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=A,$._zod.onattach.push((D)=>{let w=D._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(A)}),$._zod.check=(D)=>{if(D.value.includes(I.includes,I.position))return;D.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:D.value,inst:$,continue:!I.abort})}}),EG=L("$ZodCheckStartsWith",($,I)=>{J$.init($,I);let U=new RegExp(`^${z6(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((A)=>{let D=A._zod.bag;D.patterns??(D.patterns=new Set),D.patterns.add(U)}),$._zod.check=(A)=>{if(A.value.startsWith(I.prefix))return;A.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:A.value,inst:$,continue:!I.abort})}}),SG=L("$ZodCheckEndsWith",($,I)=>{J$.init($,I);let U=new RegExp(`.*${z6(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((A)=>{let D=A._zod.bag;D.patterns??(D.patterns=new Set),D.patterns.add(U)}),$._zod.check=(A)=>{if(A.value.endsWith(I.suffix))return;A.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:A.value,inst:$,continue:!I.abort})}});function QV($,I,U){if($.issues.length)I.issues.push(...X6(U,$.issues))}var jG=L("$ZodCheckProperty",($,I)=>{J$.init($,I),$._zod.check=(U)=>{let A=I.schema._zod.run({value:U.value[I.property],issues:[]},{});if(A instanceof Promise)return A.then((D)=>QV(D,U,I.property));QV(A,U,I.property);return}}),kG=L("$ZodCheckMimeType",($,I)=>{J$.init($,I);let U=new Set(I.mime);$._zod.onattach.push((A)=>{A._zod.bag.mime=I.mime}),$._zod.check=(A)=>{if(U.has(A.value.type))return;A.issues.push({code:"invalid_value",values:I.mime,input:A.value.type,inst:$,continue:!I.abort})}}),PG=L("$ZodCheckOverwrite",($,I)=>{J$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class Vw{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
+ `).filter((w)=>w),A=Math.min(...U.map((w)=>w.length-w.trimStart().length)),D=U.map((w)=>w.slice(A)).map((w)=>" ".repeat(this.indent*2)+w);for(let w of D)this.content.push(w)}compile(){let $=Function,I=this?.args,A=[...(this?.content??[""]).map((D)=>` ${D}`)];return new $(...I,A.join(`
45
+ `))}}var RG={major:4,minor:2,patch:1};var o=L("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=RG;let A=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))A.unshift($);for(let D of A)for(let w of D._zod.onattach)w($);if(A.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let D=(b,N,O)=>{let X=C4(b),W;for(let Q of N){if(Q._zod.def.when){if(!Q._zod.def.when(b))continue}else if(X)continue;let B=b.issues.length,Y=Q._zod.check(b);if(Y instanceof Promise&&O?.async===!1)throw new m6;if(W||Y instanceof Promise)W=(W??Promise.resolve()).then(async()=>{if(await Y,b.issues.length===B)return;if(!X)X=C4(b,B)});else{if(b.issues.length===B)continue;if(!X)X=C4(b,B)}}if(W)return W.then(()=>{return b});return b},w=(b,N,O)=>{if(C4(b))return b.aborted=!0,b;let X=D(N,A,O);if(X instanceof Promise){if(O.async===!1)throw new m6;return X.then((W)=>$._zod.parse(W,O))}return $._zod.parse(X,O)};$._zod.run=(b,N)=>{if(N.skipChecks)return $._zod.parse(b,N);if(N.direction==="backward"){let X=$._zod.parse({value:b.value,issues:[]},{...N,skipChecks:!0});if(X instanceof Promise)return X.then((W)=>{return w(W,b,N)});return w(X,b,N)}let O=$._zod.parse(b,N);if(O instanceof Promise){if(N.async===!1)throw new m6;return O.then((X)=>D(X,A,N))}return D(O,A,N)}}$["~standard"]={validate:(D)=>{try{let w=g9($,D);return w.success?{value:w.data}:{issues:w.error?.issues}}catch(w){return x9($,D).then((b)=>b.success?{value:b.data}:{issues:b.error?.issues})}},vendor:"zod",version:1}}),bI=L("$ZodString",($,I)=>{o.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??DG($._zod.bag),$._zod.parse=(U,A)=>{if(I.coerce)try{U.value=String(U.value)}catch(D){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),Q$=L("$ZodStringFormat",($,I)=>{sI.init($,I),bI.init($,I)}),_G=L("$ZodGUID",($,I)=>{I.pattern??(I.pattern=r9),Q$.init($,I)}),CG=L("$ZodUUID",($,I)=>{if(I.version){let A={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(A===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=wI(A))}else I.pattern??(I.pattern=wI());Q$.init($,I)}),ZG=L("$ZodEmail",($,I)=>{I.pattern??(I.pattern=n9),Q$.init($,I)}),gG=L("$ZodURL",($,I)=>{Q$.init($,I),$._zod.check=(U)=>{try{let A=U.value.trim(),D=new URL(A);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(D.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(D.protocol.endsWith(":")?D.protocol.slice(0,-1):D.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=D.href;else U.value=A;return}catch(A){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),xG=L("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=i9()),Q$.init($,I)}),hG=L("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=c9),Q$.init($,I)}),fG=L("$ZodCUID",($,I)=>{I.pattern??(I.pattern=h9),Q$.init($,I)}),yG=L("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=f9),Q$.init($,I)}),uG=L("$ZodULID",($,I)=>{I.pattern??(I.pattern=y9),Q$.init($,I)}),lG=L("$ZodXID",($,I)=>{I.pattern??(I.pattern=u9),Q$.init($,I)}),cG=L("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=l9),Q$.init($,I)}),mG=L("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=UG(I)),Q$.init($,I)}),rG=L("$ZodISODate",($,I)=>{I.pattern??(I.pattern=$G),Q$.init($,I)}),nG=L("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=IG(I)),Q$.init($,I)}),iG=L("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=m9),Q$.init($,I)}),oG=L("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=o9),Q$.init($,I),$._zod.bag.format="ipv4"}),dG=L("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=d9),Q$.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})}}}),pG=L("$ZodMAC",($,I)=>{I.pattern??(I.pattern=p9(I.delimiter)),Q$.init($,I),$._zod.bag.format="mac"}),tG=L("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=t9),Q$.init($,I)}),aG=L("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=a9),Q$.init($,I),$._zod.check=(U)=>{let A=U.value.split("/");try{if(A.length!==2)throw new Error;let[D,w]=A;if(!w)throw new Error;let b=Number(w);if(`${b}`!==w)throw new Error;if(b<0||b>128)throw new Error;new URL(`http://[${D}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function eG($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var sG=L("$ZodBase64",($,I)=>{I.pattern??(I.pattern=e9),Q$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(eG(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function SV($){if(!Mw.test($))return!1;let I=$.replace(/[-_]/g,(A)=>A==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return eG(U)}var $8=L("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=Mw),Q$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(SV(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),I8=L("$ZodE164",($,I)=>{I.pattern??(I.pattern=s9),Q$.init($,I)});function jV($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[A]=U;if(!A)return!1;let D=JSON.parse(atob(A));if("typ"in D&&D?.typ!=="JWT")return!1;if(!D.alg)return!1;if(I&&(!("alg"in D)||D.alg!==I))return!1;return!0}catch{return!1}}var U8=L("$ZodJWT",($,I)=>{Q$.init($,I),$._zod.check=(U)=>{if(jV(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),D8=L("$ZodCustomStringFormat",($,I)=>{Q$.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})}}),kw=L("$ZodNumber",($,I)=>{o.init($,I),$._zod.pattern=$._zod.bag.pattern??bG,$._zod.parse=(U,A)=>{if(I.coerce)try{U.value=Number(U.value)}catch(b){}let D=U.value;if(typeof D==="number"&&!Number.isNaN(D)&&Number.isFinite(D))return U;let w=typeof D==="number"?Number.isNaN(D)?"NaN":!Number.isFinite(D)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:D,inst:$,...w?{received:w}:{}}),U}}),A8=L("$ZodNumberFormat",($,I)=>{YG.init($,I),kw.init($,I)}),aU=L("$ZodBoolean",($,I)=>{o.init($,I),$._zod.pattern=NG,$._zod.parse=(U,A)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(w){}let D=U.value;if(typeof D==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:D,inst:$}),U}}),Pw=L("$ZodBigInt",($,I)=>{o.init($,I),$._zod.pattern=AG,$._zod.parse=(U,A)=>{if(I.coerce)try{U.value=BigInt(U.value)}catch(D){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),w8=L("$ZodBigIntFormat",($,I)=>{BG.init($,I),Pw.init($,I)}),b8=L("$ZodSymbol",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(typeof D==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:D,inst:$}),U}}),N8=L("$ZodUndefined",($,I)=>{o.init($,I),$._zod.pattern=XG,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,A)=>{let D=U.value;if(typeof D==="undefined")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:D,inst:$}),U}}),O8=L("$ZodNull",($,I)=>{o.init($,I),$._zod.pattern=OG,$._zod.values=new Set([null]),$._zod.parse=(U,A)=>{let D=U.value;if(D===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:D,inst:$}),U}}),X8=L("$ZodAny",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),W8=L("$ZodUnknown",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),G8=L("$ZodNever",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),Q8=L("$ZodVoid",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(typeof D==="undefined")return U;return U.issues.push({expected:"void",code:"invalid_type",input:D,inst:$}),U}}),Y8=L("$ZodDate",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{if(I.coerce)try{U.value=new Date(U.value)}catch(N){}let D=U.value,w=D instanceof Date;if(w&&!Number.isNaN(D.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:D,...w?{received:"Invalid Date"}:{},inst:$}),U}});function JV($,I,U){if($.issues.length)I.issues.push(...X6(U,$.issues));I.value[U]=$.value}var B8=L("$ZodArray",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(!Array.isArray(D))return U.issues.push({expected:"array",code:"invalid_type",input:D,inst:$}),U;U.value=Array(D.length);let w=[];for(let b=0;b<D.length;b++){let N=D[b],O=I.element._zod.run({value:N,issues:[]},A);if(O instanceof Promise)w.push(O.then((X)=>JV(X,U,b)));else JV(O,U,b)}if(w.length)return Promise.all(w).then(()=>U);return U}});function jw($,I,U,A){if($.issues.length)I.issues.push(...X6(U,$.issues));if($.value===void 0){if(U in A)I.value[U]=void 0}else I.value[U]=$.value}function kV($){let I=Object.keys($.shape);for(let A of I)if(!$.shape?.[A]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${A}": expected a Zod schema`);let U=R9($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function PV($,I,U,A,D,w){let b=[],N=D.keySet,O=D.catchall._zod,X=O.def.type;for(let W in I){if(N.has(W))continue;if(X==="never"){b.push(W);continue}let Q=O.run({value:I[W],issues:[]},A);if(Q instanceof Promise)$.push(Q.then((B)=>jw(B,U,W,I)));else jw(Q,U,W,I)}if(b.length)U.issues.push({code:"unrecognized_keys",keys:b,input:I,inst:w});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var RV=L("$ZodObject",($,I)=>{if(o.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let N=I.shape;Object.defineProperty(I,"shape",{get:()=>{let O={...N};return Object.defineProperty(I,"shape",{value:O}),O}})}let A=oI(()=>kV(I));s($._zod,"propValues",()=>{let N=I.shape,O={};for(let X in N){let W=N[X]._zod;if(W.values){O[X]??(O[X]=new Set);for(let Q of W.values)O[X].add(Q)}}return O});let D=AI,w=I.catchall,b;$._zod.parse=(N,O)=>{b??(b=A.value);let X=N.value;if(!D(X))return N.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),N;N.value={};let W=[],Q=b.shape;for(let B of b.keys){let J=Q[B]._zod.run({value:X[B],issues:[]},O);if(J instanceof Promise)W.push(J.then((H)=>jw(H,N,B,X)));else jw(J,N,B,X)}if(!w)return W.length?Promise.all(W).then(()=>N):N;return PV(W,X,N,O,A.value,$)}}),J8=L("$ZodObjectJIT",($,I)=>{RV.init($,I);let U=$._zod.parse,A=oI(()=>kV(I)),D=(B)=>{let Y=new Vw(["shape","payload","ctx"]),J=A.value,H=(k)=>{let h=Nw(k);return`shape[${h}]._zod.run({ value: input[${h}], issues: [] }, ctx)`};Y.write("const input = payload.value;");let v=Object.create(null),V=0;for(let k of J.keys)v[k]=`key_${V++}`;Y.write("const newResult = {};");for(let k of J.keys){let h=v[k],l=Nw(k);Y.write(`const ${h} = ${H(k)};`),Y.write(`
46
46
  if (${h}.issues.length) {
47
47
  payload.issues = payload.issues.concat(${h}.issues.map(iss => ({
48
48
  ...iss,
@@ -59,50 +59,52 @@ 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
+ `)}Y.write("payload.value = newResult;"),Y.write("return payload;");let P=Y.compile();return(k,h)=>P(B,k,h)},w,b=AI,N=!yU.jitless,X=N&&j9.value,W=I.catchall,Q;$._zod.parse=(B,Y)=>{Q??(Q=A.value);let J=B.value;if(!b(J))return B.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),B;if(N&&X&&Y?.async===!1&&Y.jitless!==!0){if(!w)w=D(I.shape);if(B=w(B,Y),!W)return B;return PV([],J,B,Y,Q,$)}return U(B,Y)}});function HV($,I,U,A){for(let w of $)if(w.issues.length===0)return I.value=w.value,I;let D=$.filter((w)=>!C4(w));if(D.length===1)return I.value=D[0].value,D[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((b)=>U6(b,A,k$())))}),I}var eU=L("$ZodUnion",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.options.some((D)=>D._zod.optin==="optional")?"optional":void 0),s($._zod,"optout",()=>I.options.some((D)=>D._zod.optout==="optional")?"optional":void 0),s($._zod,"values",()=>{if(I.options.every((D)=>D._zod.values))return new Set(I.options.flatMap((D)=>Array.from(D._zod.values)));return}),s($._zod,"pattern",()=>{if(I.options.every((D)=>D._zod.pattern)){let D=I.options.map((w)=>w._zod.pattern);return new RegExp(`^(${D.map((w)=>cU(w.source)).join("|")})$`)}return});let U=I.options.length===1,A=I.options[0]._zod.run;$._zod.parse=(D,w)=>{if(U)return A(D,w);let b=!1,N=[];for(let O of I.options){let X=O._zod.run({value:D.value,issues:[]},w);if(X instanceof Promise)N.push(X),b=!0;else{if(X.issues.length===0)return X;N.push(X)}}if(!b)return HV(N,D,$,w);return Promise.all(N).then((O)=>{return HV(O,D,$,w)})}});function LV($,I,U,A){let D=$.filter((w)=>w.issues.length===0);if(D.length===1)return I.value=D[0].value,I;if(D.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((b)=>U6(b,A,k$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var H8=L("$ZodXor",($,I)=>{eU.init($,I),I.inclusive=!1;let U=I.options.length===1,A=I.options[0]._zod.run;$._zod.parse=(D,w)=>{if(U)return A(D,w);let b=!1,N=[];for(let O of I.options){let X=O._zod.run({value:D.value,issues:[]},w);if(X instanceof Promise)N.push(X),b=!0;else N.push(X)}if(!b)return LV(N,D,$,w);return Promise.all(N).then((O)=>{return LV(O,D,$,w)})}}),L8=L("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,eU.init($,I);let U=$._zod.parse;s($._zod,"propValues",()=>{let D={};for(let w of I.options){let b=w._zod.propValues;if(!b||Object.keys(b).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(w)}"`);for(let[N,O]of Object.entries(b)){if(!D[N])D[N]=new Set;for(let X of O)D[N].add(X)}}return D});let A=oI(()=>{let D=I.options,w=new Map;for(let b of D){let N=b._zod.propValues?.[I.discriminator];if(!N||N.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(b)}"`);for(let O of N){if(w.has(O))throw new Error(`Duplicate discriminator value "${String(O)}"`);w.set(O,b)}}return w});$._zod.parse=(D,w)=>{let b=D.value;if(!AI(b))return D.issues.push({code:"invalid_type",expected:"object",input:b,inst:$}),D;let N=A.value.get(b?.[I.discriminator]);if(N)return N._zod.run(D,w);if(I.unionFallback)return U(D,w);return D.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:b,path:[I.discriminator],inst:$}),D}}),z8=L("$ZodIntersection",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{let D=U.value,w=I.left._zod.run({value:D,issues:[]},A),b=I.right._zod.run({value:D,issues:[]},A);if(w instanceof Promise||b instanceof Promise)return Promise.all([w,b]).then(([O,X])=>{return zV(U,O,X)});return zV(U,w,b)}});function TG($,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),A=Object.keys($).filter((w)=>U.indexOf(w)!==-1),D={...$,...I};for(let w of A){let b=TG($[w],I[w]);if(!b.valid)return{valid:!1,mergeErrorPath:[w,...b.mergeErrorPath]};D[w]=b.data}return{valid:!0,data:D}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let A=0;A<$.length;A++){let D=$[A],w=I[A],b=TG(D,w);if(!b.valid)return{valid:!1,mergeErrorPath:[A,...b.mergeErrorPath]};U.push(b.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function zV($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(C4($))return $;let A=TG(I.value,U.value);if(!A.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(A.mergeErrorPath)}`);return $.value=A.data,$}var Rw=L("$ZodTuple",($,I)=>{o.init($,I);let U=I.items;$._zod.parse=(A,D)=>{let w=A.value;if(!Array.isArray(w))return A.issues.push({input:w,inst:$,expected:"tuple",code:"invalid_type"}),A;A.value=[];let b=[],N=[...U].reverse().findIndex((W)=>W._zod.optin!=="optional"),O=N===-1?0:U.length-N;if(!I.rest){let W=w.length>U.length,Q=w.length<O-1;if(W||Q)return A.issues.push({...W?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:w,inst:$,origin:"array"}),A}let X=-1;for(let W of U){if(X++,X>=w.length){if(X>=O)continue}let Q=W._zod.run({value:w[X],issues:[]},D);if(Q instanceof Promise)b.push(Q.then((B)=>qw(B,A,X)));else qw(Q,A,X)}if(I.rest){let W=w.slice(U.length);for(let Q of W){X++;let B=I.rest._zod.run({value:Q,issues:[]},D);if(B instanceof Promise)b.push(B.then((Y)=>qw(Y,A,X)));else qw(B,A,X)}}if(b.length)return Promise.all(b).then(()=>A);return A}});function qw($,I,U){if($.issues.length)I.issues.push(...X6(U,$.issues));I.value[U]=$.value}var M8=L("$ZodRecord",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(!_4(D))return U.issues.push({expected:"record",code:"invalid_type",input:D,inst:$}),U;let w=[],b=I.keyType._zod.values;if(b){U.value={};let N=new Set;for(let X of b)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){N.add(typeof X==="number"?X.toString():X);let W=I.valueType._zod.run({value:D[X],issues:[]},A);if(W instanceof Promise)w.push(W.then((Q)=>{if(Q.issues.length)U.issues.push(...X6(X,Q.issues));U.value[X]=Q.value}));else{if(W.issues.length)U.issues.push(...X6(X,W.issues));U.value[X]=W.value}}let O;for(let X in D)if(!N.has(X))O=O??[],O.push(X);if(O&&O.length>0)U.issues.push({code:"unrecognized_keys",input:D,inst:$,keys:O})}else{U.value={};for(let N of Reflect.ownKeys(D)){if(N==="__proto__")continue;let O=I.keyType._zod.run({value:N,issues:[]},A);if(O instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(O.issues.length){if(I.mode==="loose")U.value[N]=D[N];else U.issues.push({code:"invalid_key",origin:"record",issues:O.issues.map((W)=>U6(W,A,k$())),input:N,path:[N],inst:$});continue}let X=I.valueType._zod.run({value:D[N],issues:[]},A);if(X instanceof Promise)w.push(X.then((W)=>{if(W.issues.length)U.issues.push(...X6(N,W.issues));U.value[O.value]=W.value}));else{if(X.issues.length)U.issues.push(...X6(N,X.issues));U.value[O.value]=X.value}}}if(w.length)return Promise.all(w).then(()=>U);return U}}),K8=L("$ZodMap",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(!(D instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:D,inst:$}),U;let w=[];U.value=new Map;for(let[b,N]of D){let O=I.keyType._zod.run({value:b,issues:[]},A),X=I.valueType._zod.run({value:N,issues:[]},A);if(O instanceof Promise||X instanceof Promise)w.push(Promise.all([O,X]).then(([W,Q])=>{MV(W,Q,U,b,D,$,A)}));else MV(O,X,U,b,D,$,A)}if(w.length)return Promise.all(w).then(()=>U);return U}});function MV($,I,U,A,D,w,b){if($.issues.length)if(mU.has(typeof A))U.issues.push(...X6(A,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:D,inst:w,issues:$.issues.map((N)=>U6(N,b,k$()))});if(I.issues.length)if(mU.has(typeof A))U.issues.push(...X6(A,I.issues));else U.issues.push({origin:"map",code:"invalid_element",input:D,inst:w,key:A,issues:I.issues.map((N)=>U6(N,b,k$()))});U.value.set($.value,I.value)}var v8=L("$ZodSet",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(!(D instanceof Set))return U.issues.push({input:D,inst:$,expected:"set",code:"invalid_type"}),U;let w=[];U.value=new Set;for(let b of D){let N=I.valueType._zod.run({value:b,issues:[]},A);if(N instanceof Promise)w.push(N.then((O)=>KV(O,U)));else KV(N,U)}if(w.length)return Promise.all(w).then(()=>U);return U}});function KV($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var V8=L("$ZodEnum",($,I)=>{o.init($,I);let U=lU(I.entries),A=new Set(U);$._zod.values=A,$._zod.pattern=new RegExp(`^(${U.filter((D)=>mU.has(typeof D)).map((D)=>typeof D==="string"?z6(D):D.toString()).join("|")})$`),$._zod.parse=(D,w)=>{let b=D.value;if(A.has(b))return D;return D.issues.push({code:"invalid_value",values:U,input:b,inst:$}),D}}),q8=L("$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((A)=>typeof A==="string"?z6(A):A?z6(A.toString()):String(A)).join("|")})$`),$._zod.parse=(A,D)=>{let w=A.value;if(U.has(w))return A;return A.issues.push({code:"invalid_value",values:I.values,input:w,inst:$}),A}}),F8=L("$ZodFile",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{let D=U.value;if(D instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:D,inst:$}),U}}),E8=L("$ZodTransform",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{if(A.direction==="backward")throw new DI($.constructor.name);let D=I.transform(U.value,U);if(A.async)return(D instanceof Promise?D:Promise.resolve(D)).then((b)=>{return U.value=b,U});if(D instanceof Promise)throw new m6;return U.value=D,U}});function vV($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var S8=L("$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,A)=>{if(I.innerType._zod.optin==="optional"){let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>vV(w,U.value));return vV(D,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,A)}}),j8=L("$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,A)=>{if(U.value===null)return U;return I.innerType._zod.run(U,A)}}),k8=L("$ZodDefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,A)=>{if(A.direction==="backward")return I.innerType._zod.run(U,A);if(U.value===void 0)return U.value=I.defaultValue,U;let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>VV(w,I));return VV(D,I)}});function VV($,I){if($.value===void 0)$.value=I.defaultValue;return $}var P8=L("$ZodPrefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,A)=>{if(A.direction==="backward")return I.innerType._zod.run(U,A);if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,A)}}),R8=L("$ZodNonOptional",($,I)=>{o.init($,I),s($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((A)=>A!==void 0)):void 0}),$._zod.parse=(U,A)=>{let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>qV(w,$));return qV(D,$)}});function qV($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var T8=L("$ZodSuccess",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{if(A.direction==="backward")throw new DI("ZodSuccess");let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>{return U.value=w.issues.length===0,U});return U.value=D.issues.length===0,U}}),_8=L("$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,A)=>{if(A.direction==="backward")return I.innerType._zod.run(U,A);let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>{if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((b)=>U6(b,A,k$()))},input:U.value}),U.issues=[];return U});if(U.value=D.value,D.issues.length)U.value=I.catchValue({...U,error:{issues:D.issues.map((w)=>U6(w,A,k$()))},input:U.value}),U.issues=[];return U}}),C8=L("$ZodNaN",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{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}}),Z8=L("$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,A)=>{if(A.direction==="backward"){let w=I.out._zod.run(U,A);if(w instanceof Promise)return w.then((b)=>Fw(b,I.in,A));return Fw(w,I.in,A)}let D=I.in._zod.run(U,A);if(D instanceof Promise)return D.then((w)=>Fw(w,I.out,A));return Fw(D,I.out,A)}});function Fw($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var sU=L("$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,A)=>{if((A.direction||"forward")==="forward"){let w=I.in._zod.run(U,A);if(w instanceof Promise)return w.then((b)=>Ew(b,I,A));return Ew(w,I,A)}else{let w=I.out._zod.run(U,A);if(w instanceof Promise)return w.then((b)=>Ew(b,I,A));return Ew(w,I,A)}}});function Ew($,I,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let D=I.transform($.value,$);if(D instanceof Promise)return D.then((w)=>Sw($,w,I.out,U));return Sw($,D,I.out,U)}else{let D=I.reverseTransform($.value,$);if(D instanceof Promise)return D.then((w)=>Sw($,w,I.in,U));return Sw($,D,I.in,U)}}function Sw($,I,U,A){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},A)}var g8=L("$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,A)=>{if(A.direction==="backward")return I.innerType._zod.run(U,A);let D=I.innerType._zod.run(U,A);if(D instanceof Promise)return D.then(FV);return FV(D)}});function FV($){return $.value=Object.freeze($.value),$}var x8=L("$ZodTemplateLiteral",($,I)=>{o.init($,I);let U=[];for(let A of I.parts)if(typeof A==="object"&&A!==null){if(!A._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...A._zod.traits].shift()}`);let D=A._zod.pattern instanceof RegExp?A._zod.pattern.source:A._zod.pattern;if(!D)throw new Error(`Invalid template literal part: ${A._zod.traits}`);let w=D.startsWith("^")?1:0,b=D.endsWith("$")?D.length-1:D.length;U.push(D.slice(w,b))}else if(A===null||P9.has(typeof A))U.push(z6(`${A}`));else throw new Error(`Invalid template literal part: ${A}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(A,D)=>{if(typeof A.value!=="string")return A.issues.push({input:A.value,inst:$,expected:"template_literal",code:"invalid_type"}),A;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(A.value))return A.issues.push({input:A.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),A;return A}}),h8=L("$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(...A){let D=$._def.input?Xw($._def.input,A):A,w=Reflect.apply(U,this,D);if($._def.output)return Xw($._def.output,w);return w}},$.implementAsync=(U)=>{if(typeof U!=="function")throw new Error("implementAsync() must be called with a function");return async function(...A){let D=$._def.input?await Ww($._def.input,A):A,w=await Reflect.apply(U,this,D);if($._def.output)return await Ww($._def.output,w);return w}},$._zod.parse=(U,A)=>{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 A=$.constructor;if(Array.isArray(U[0]))return new A({type:"function",input:new Rw({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new A({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),f8=L("$ZodPromise",($,I)=>{o.init($,I),$._zod.parse=(U,A)=>{return Promise.resolve(U.value).then((D)=>I.innerType._zod.run({value:D,issues:[]},A))}}),y8=L("$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,A)=>{return $._zod.innerType._zod.run(U,A)}}),u8=L("$ZodCustom",($,I)=>{J$.init($,I),o.init($,I),$._zod.parse=(U,A)=>{return U},$._zod.check=(U)=>{let A=U.value,D=I.fn(A);if(D instanceof Promise)return D.then((w)=>EV(w,U,A,$));EV(D,U,A,$);return}});function EV($,I,U,A){if(!$){let D={code:"custom",input:U,inst:A,path:[...A._zod.def.path??[]],continue:!A._zod.def.abort};if(A._zod.def.params)D.params=A._zod.def.params;I.issues.push(dI(D))}}var w0={};K6(w0,{zhTW:()=>PQ,zhCN:()=>kQ,yo:()=>RQ,vi:()=>jQ,ur:()=>SQ,uk:()=>A0,ua:()=>EQ,tr:()=>FQ,th:()=>qQ,ta:()=>VQ,sv:()=>vQ,sl:()=>KQ,ru:()=>MQ,pt:()=>zQ,ps:()=>HQ,pl:()=>LQ,ota:()=>JQ,no:()=>BQ,nl:()=>YQ,ms:()=>QQ,mk:()=>GQ,lt:()=>WQ,ko:()=>XQ,km:()=>I0,kh:()=>OQ,ka:()=>NQ,ja:()=>bQ,it:()=>wQ,is:()=>AQ,id:()=>DQ,hu:()=>UQ,he:()=>IQ,frCA:()=>$Q,fr:()=>s8,fi:()=>e8,fa:()=>a8,es:()=>t8,eo:()=>p8,en:()=>$0,de:()=>d8,da:()=>o8,cs:()=>i8,ca:()=>n8,bg:()=>r8,be:()=>m8,az:()=>c8,ar:()=>l8});var cf=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(D){return $[D]??null}let U=(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&&D.constructor)return D.constructor.name}}return w},A={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(D)=>{switch(D.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${D.expected}، ولكن تم إدخال ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${E(D.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return` أكبر من اللازم: يفترض أن تكون ${D.origin??"القيمة"} ${w} ${D.maximum.toString()} ${b.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${D.origin??"القيمة"} ${w} ${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`أصغر من اللازم: يفترض لـ ${D.origin} أن يكون ${w} ${D.minimum.toString()} ${b.unit}`;return`أصغر من اللازم: يفترض لـ ${D.origin} أن يكون ${w} ${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${D.prefix}"`;if(w.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${w.suffix}"`;if(w.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${w.includes}"`;if(w.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${w.pattern}`;return`${A[w.format]??D.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${D.divisor}`;case"unrecognized_keys":return`معرف${D.keys.length>1?"ات":""} غريب${D.keys.length>1?"ة":""}: ${z(D.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${D.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${D.origin}`;default:return"مدخل غير مقبول"}}};function l8(){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(D){return $[D]??null}let U=(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&&D.constructor)return D.constructor.name}}return w},A={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${D.expected}, daxil olan ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Yanlış dəyər: gözlənilən ${E(D.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Çox böyük: gözlənilən ${D.origin??"dəyər"} ${w}${D.maximum.toString()} ${b.unit??"element"}`;return`Çox böyük: gözlənilən ${D.origin??"dəyər"} ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Çox kiçik: gözlənilən ${D.origin} ${w}${D.minimum.toString()} ${b.unit}`;return`Çox kiçik: gözlənilən ${D.origin} ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Yanlış mətn: "${w.prefix}" ilə başlamalıdır`;if(w.format==="ends_with")return`Yanlış mətn: "${w.suffix}" ilə bitməlidir`;if(w.format==="includes")return`Yanlış mətn: "${w.includes}" daxil olmalıdır`;if(w.format==="regex")return`Yanlış mətn: ${w.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${A[w.format]??D.format}`}case"not_multiple_of":return`Yanlış ədəd: ${D.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${D.keys.length>1?"lar":""}: ${z(D.keys,", ")}`;case"invalid_key":return`${D.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${D.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function c8(){return{localeError:mf()}}function TV($,I,U,A){let D=Math.abs($),w=D%10,b=D%100;if(b>=11&&b<=19)return A;if(w===1)return I;if(w>=2&&w<=4)return U;return A}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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"лік";case"object":{if(Array.isArray(D))return"масіў";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(D)=>{switch(D.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${D.expected}, атрымана ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Няправільны ўвод: чакалася ${E(D.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b){let N=Number(D.maximum),O=TV(N,b.unit.one,b.unit.few,b.unit.many);return`Занадта вялікі: чакалася, што ${D.origin??"значэнне"} павінна ${b.verb} ${w}${D.maximum.toString()} ${O}`}return`Занадта вялікі: чакалася, што ${D.origin??"значэнне"} павінна быць ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b){let N=Number(D.minimum),O=TV(N,b.unit.one,b.unit.few,b.unit.many);return`Занадта малы: чакалася, што ${D.origin} павінна ${b.verb} ${w}${D.minimum.toString()} ${O}`}return`Занадта малы: чакалася, што ${D.origin} павінна быць ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;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`Няправільны ${A[w.format]??D.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${D.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${D.keys.length>1?"ключы":"ключ"}: ${z(D.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${D.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${D.origin}`;default:return"Няправільны ўвод"}}};function m8(){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(A){return $[A]??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(A)=>{switch(A.code){case"invalid_type":return`Невалиден вход: очакван ${A.expected}, получен ${nf(A.input)}`;case"invalid_value":if(A.values.length===1)return`Невалиден вход: очакван ${E(A.values[0])}`;return`Невалидна опция: очаквано едно от ${z(A.values,"|")}`;case"too_big":{let D=A.inclusive?"<=":"<",w=I(A.origin);if(w)return`Твърде голямо: очаква се ${A.origin??"стойност"} да съдържа ${D}${A.maximum.toString()} ${w.unit??"елемента"}`;return`Твърде голямо: очаква се ${A.origin??"стойност"} да бъде ${D}${A.maximum.toString()}`}case"too_small":{let D=A.inclusive?">=":">",w=I(A.origin);if(w)return`Твърде малко: очаква се ${A.origin} да съдържа ${D}${A.minimum.toString()} ${w.unit}`;return`Твърде малко: очаква се ${A.origin} да бъде ${D}${A.minimum.toString()}`}case"invalid_format":{let D=A;if(D.format==="starts_with")return`Невалиден низ: трябва да започва с "${D.prefix}"`;if(D.format==="ends_with")return`Невалиден низ: трябва да завършва с "${D.suffix}"`;if(D.format==="includes")return`Невалиден низ: трябва да включва "${D.includes}"`;if(D.format==="regex")return`Невалиден низ: трябва да съвпада с ${D.pattern}`;let w="Невалиден";if(D.format==="emoji")w="Невалидно";if(D.format==="datetime")w="Невалидно";if(D.format==="date")w="Невалидна";if(D.format==="time")w="Невалидно";if(D.format==="duration")w="Невалидна";return`${w} ${U[D.format]??A.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${A.divisor}`;case"unrecognized_keys":return`Неразпознат${A.keys.length>1?"и":""} ключ${A.keys.length>1?"ове":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${A.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${A.origin}`;default:return"Невалиден вход"}}};function r8(){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(D){return $[D]??null}let U=(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&&D.constructor)return D.constructor.name}}return w},A={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(D)=>{switch(D.code){case"invalid_type":return`Tipus invàlid: s'esperava ${D.expected}, s'ha rebut ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Valor invàlid: s'esperava ${E(D.values[0])}`;return`Opció invàlida: s'esperava una de ${z(D.values," o ")}`;case"too_big":{let w=D.inclusive?"com a màxim":"menys de",b=I(D.origin);if(b)return`Massa gran: s'esperava que ${D.origin??"el valor"} contingués ${w} ${D.maximum.toString()} ${b.unit??"elements"}`;return`Massa gran: s'esperava que ${D.origin??"el valor"} fos ${w} ${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?"com a mínim":"més de",b=I(D.origin);if(b)return`Massa petit: s'esperava que ${D.origin} contingués ${w} ${D.minimum.toString()} ${b.unit}`;return`Massa petit: s'esperava que ${D.origin} fos ${w} ${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Format invàlid: ha de començar amb "${w.prefix}"`;if(w.format==="ends_with")return`Format invàlid: ha d'acabar amb "${w.suffix}"`;if(w.format==="includes")return`Format invàlid: ha d'incloure "${w.includes}"`;if(w.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${w.pattern}`;return`Format invàlid per a ${A[w.format]??D.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${D.divisor}`;case"unrecognized_keys":return`Clau${D.keys.length>1?"s":""} no reconeguda${D.keys.length>1?"s":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${D.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${D.origin}`;default:return"Entrada invàlida"}}};function n8(){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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(D))return"pole";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(D)=>{switch(D.code){case"invalid_type":return`Neplatný vstup: očekáváno ${D.expected}, obdrženo ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Neplatný vstup: očekáváno ${E(D.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Hodnota je příliš velká: ${D.origin??"hodnota"} musí mít ${w}${D.maximum.toString()} ${b.unit??"prvků"}`;return`Hodnota je příliš velká: ${D.origin??"hodnota"} musí být ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Hodnota je příliš malá: ${D.origin??"hodnota"} musí mít ${w}${D.minimum.toString()} ${b.unit??"prvků"}`;return`Hodnota je příliš malá: ${D.origin??"hodnota"} musí být ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Neplatný řetězec: musí začínat na "${w.prefix}"`;if(w.format==="ends_with")return`Neplatný řetězec: musí končit na "${w.suffix}"`;if(w.format==="includes")return`Neplatný řetězec: musí obsahovat "${w.includes}"`;if(w.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${w.pattern}`;return`Neplatný formát ${A[w.format]??D.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${D.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${z(D.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${D.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${D.origin}`;default:return"Neplatný vstup"}}};function i8(){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(b){return $[b]??null}function A(b){return I[b]??b}let D=(b)=>{let N=typeof b;switch(N){case"number":return Number.isNaN(b)?"NaN":"tal";case"object":{if(Array.isArray(b))return"liste";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name;return"objekt"}}return N},w={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(b)=>{switch(b.code){case"invalid_type":return`Ugyldigt input: forventede ${A(b.expected)}, fik ${A(D(b.input))}`;case"invalid_value":if(b.values.length===1)return`Ugyldig værdi: forventede ${E(b.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${z(b.values,"|")}`;case"too_big":{let N=b.inclusive?"<=":"<",O=U(b.origin),X=A(b.origin);if(O)return`For stor: forventede ${X??"value"} ${O.verb} ${N} ${b.maximum.toString()} ${O.unit??"elementer"}`;return`For stor: forventede ${X??"value"} havde ${N} ${b.maximum.toString()}`}case"too_small":{let N=b.inclusive?">=":">",O=U(b.origin),X=A(b.origin);if(O)return`For lille: forventede ${X} ${O.verb} ${N} ${b.minimum.toString()} ${O.unit}`;return`For lille: forventede ${X} havde ${N} ${b.minimum.toString()}`}case"invalid_format":{let N=b;if(N.format==="starts_with")return`Ugyldig streng: skal starte med "${N.prefix}"`;if(N.format==="ends_with")return`Ugyldig streng: skal ende med "${N.suffix}"`;if(N.format==="includes")return`Ugyldig streng: skal indeholde "${N.includes}"`;if(N.format==="regex")return`Ugyldig streng: skal matche mønsteret ${N.pattern}`;return`Ugyldig ${w[N.format]??b.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${z(b.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${b.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${b.origin}`;default:return"Ugyldigt input"}}};function o8(){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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"Zahl";case"object":{if(Array.isArray(D))return"Array";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(D)=>{switch(D.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${D.expected}, erhalten ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Ungültige Eingabe: erwartet ${E(D.values[0])}`;return`Ungültige Option: erwartet eine von ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Zu groß: erwartet, dass ${D.origin??"Wert"} ${w}${D.maximum.toString()} ${b.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${D.origin??"Wert"} ${w}${D.maximum.toString()} ist`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Zu klein: erwartet, dass ${D.origin} ${w}${D.minimum.toString()} ${b.unit} hat`;return`Zu klein: erwartet, dass ${D.origin} ${w}${D.minimum.toString()} ist`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Ungültiger String: muss mit "${w.prefix}" beginnen`;if(w.format==="ends_with")return`Ungültiger String: muss mit "${w.suffix}" enden`;if(w.format==="includes")return`Ungültiger String: muss "${w.includes}" enthalten`;if(w.format==="regex")return`Ungültiger String: muss dem Muster ${w.pattern} entsprechen`;return`Ungültig: ${A[w.format]??D.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${D.divisor} sein`;case"unrecognized_keys":return`${D.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${z(D.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${D.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${D.origin}`;default:return"Ungültige Eingabe"}}};function d8(){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(A){return $[A]??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(A)=>{switch(A.code){case"invalid_type":return`Invalid input: expected ${A.expected}, received ${ef(A.input)}`;case"invalid_value":if(A.values.length===1)return`Invalid input: expected ${E(A.values[0])}`;return`Invalid option: expected one of ${z(A.values,"|")}`;case"too_big":{let D=A.inclusive?"<=":"<",w=I(A.origin);if(w)return`Too big: expected ${A.origin??"value"} to have ${D}${A.maximum.toString()} ${w.unit??"elements"}`;return`Too big: expected ${A.origin??"value"} to be ${D}${A.maximum.toString()}`}case"too_small":{let D=A.inclusive?">=":">",w=I(A.origin);if(w)return`Too small: expected ${A.origin} to have ${D}${A.minimum.toString()} ${w.unit}`;return`Too small: expected ${A.origin} to be ${D}${A.minimum.toString()}`}case"invalid_format":{let D=A;if(D.format==="starts_with")return`Invalid string: must start with "${D.prefix}"`;if(D.format==="ends_with")return`Invalid string: must end with "${D.suffix}"`;if(D.format==="includes")return`Invalid string: must include "${D.includes}"`;if(D.format==="regex")return`Invalid string: must match pattern ${D.pattern}`;return`Invalid ${U[D.format]??A.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${A.divisor}`;case"unrecognized_keys":return`Unrecognized key${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Invalid key in ${A.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${A.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(A){return $[A]??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(A)=>{switch(A.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${A.expected}, riceviĝis ${$y(A.input)}`;case"invalid_value":if(A.values.length===1)return`Nevalida enigo: atendiĝis ${E(A.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${z(A.values,"|")}`;case"too_big":{let D=A.inclusive?"<=":"<",w=I(A.origin);if(w)return`Tro granda: atendiĝis ke ${A.origin??"valoro"} havu ${D}${A.maximum.toString()} ${w.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${A.origin??"valoro"} havu ${D}${A.maximum.toString()}`}case"too_small":{let D=A.inclusive?">=":">",w=I(A.origin);if(w)return`Tro malgranda: atendiĝis ke ${A.origin} havu ${D}${A.minimum.toString()} ${w.unit}`;return`Tro malgranda: atendiĝis ke ${A.origin} estu ${D}${A.minimum.toString()}`}case"invalid_format":{let D=A;if(D.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${D.prefix}"`;if(D.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${D.suffix}"`;if(D.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${D.includes}"`;if(D.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${D.pattern}`;return`Nevalida ${U[D.format]??A.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${A.divisor}`;case"unrecognized_keys":return`Nekonata${A.keys.length>1?"j":""} ŝlosilo${A.keys.length>1?"j":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${A.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${A.origin}`;default:return"Nevalida enigo"}}};function p8(){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(b){return $[b]??null}function A(b){return I[b]??b}let D=(b)=>{let N=typeof b;switch(N){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype)return b.constructor.name;return"object"}}return N},w={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(b)=>{switch(b.code){case"invalid_type":return`Entrada inválida: se esperaba ${A(b.expected)}, recibido ${A(D(b.input))}`;case"invalid_value":if(b.values.length===1)return`Entrada inválida: se esperaba ${E(b.values[0])}`;return`Opción inválida: se esperaba una de ${z(b.values,"|")}`;case"too_big":{let N=b.inclusive?"<=":"<",O=U(b.origin),X=A(b.origin);if(O)return`Demasiado grande: se esperaba que ${X??"valor"} tuviera ${N}${b.maximum.toString()} ${O.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${X??"valor"} fuera ${N}${b.maximum.toString()}`}case"too_small":{let N=b.inclusive?">=":">",O=U(b.origin),X=A(b.origin);if(O)return`Demasiado pequeño: se esperaba que ${X} tuviera ${N}${b.minimum.toString()} ${O.unit}`;return`Demasiado pequeño: se esperaba que ${X} fuera ${N}${b.minimum.toString()}`}case"invalid_format":{let N=b;if(N.format==="starts_with")return`Cadena inválida: debe comenzar con "${N.prefix}"`;if(N.format==="ends_with")return`Cadena inválida: debe terminar en "${N.suffix}"`;if(N.format==="includes")return`Cadena inválida: debe incluir "${N.includes}"`;if(N.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${N.pattern}`;return`Inválido ${w[N.format]??b.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${b.divisor}`;case"unrecognized_keys":return`Llave${b.keys.length>1?"s":""} desconocida${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Llave inválida en ${A(b.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${A(b.origin)}`;default:return"Entrada inválida"}}};function t8(){return{localeError:Uy()}}var Dy=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"عدد";case"object":{if(Array.isArray(D))return"آرایه";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(D)=>{switch(D.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${D.expected} می‌بود، ${U(D.input)} دریافت شد`;case"invalid_value":if(D.values.length===1)return`ورودی نامعتبر: می‌بایست ${E(D.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${z(D.values,"|")} می‌بود`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`خیلی بزرگ: ${D.origin??"مقدار"} باید ${w}${D.maximum.toString()} ${b.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${D.origin??"مقدار"} باید ${w}${D.maximum.toString()} باشد`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`خیلی کوچک: ${D.origin} باید ${w}${D.minimum.toString()} ${b.unit} باشد`;return`خیلی کوچک: ${D.origin} باید ${w}${D.minimum.toString()} باشد`}case"invalid_format":{let w=D;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`${A[w.format]??D.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${D.divisor} باشد`;case"unrecognized_keys":return`کلید${D.keys.length>1?"های":""} ناشناس: ${z(D.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${D.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${D.origin}`;default:return"ورودی نامعتبر"}}};function a8(){return{localeError:Dy()}}var Ay=()=>{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(D){return $[D]??null}let U=(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&&D.constructor)return D.constructor.name}}return w},A={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(D)=>{switch(D.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${D.expected}, oli ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Virheellinen syöte: täytyy olla ${E(D.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Liian suuri: ${b.subject} täytyy olla ${w}${D.maximum.toString()} ${b.unit}`.trim();return`Liian suuri: arvon täytyy olla ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Liian pieni: ${b.subject} täytyy olla ${w}${D.minimum.toString()} ${b.unit}`.trim();return`Liian pieni: arvon täytyy olla ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${w.prefix}"`;if(w.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${w.suffix}"`;if(w.format==="includes")return`Virheellinen syöte: täytyy sisältää "${w.includes}"`;if(w.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${w.pattern}`;return`Virheellinen ${A[w.format]??D.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${D.divisor} monikerta`;case"unrecognized_keys":return`${D.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${z(D.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function e8(){return{localeError:Ay()}}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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"nombre";case"object":{if(Array.isArray(D))return"tableau";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(D)=>{switch(D.code){case"invalid_type":return`Entrée invalide : ${D.expected} attendu, ${U(D.input)} reçu`;case"invalid_value":if(D.values.length===1)return`Entrée invalide : ${E(D.values[0])} attendu`;return`Option invalide : une valeur parmi ${z(D.values,"|")} attendue`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Trop grand : ${D.origin??"valeur"} doit ${b.verb} ${w}${D.maximum.toString()} ${b.unit??"élément(s)"}`;return`Trop grand : ${D.origin??"valeur"} doit être ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Trop petit : ${D.origin} doit ${b.verb} ${w}${D.minimum.toString()} ${b.unit}`;return`Trop petit : ${D.origin} doit être ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Chaîne invalide : doit commencer par "${w.prefix}"`;if(w.format==="ends_with")return`Chaîne invalide : doit se terminer par "${w.suffix}"`;if(w.format==="includes")return`Chaîne invalide : doit inclure "${w.includes}"`;if(w.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${w.pattern}`;return`${A[w.format]??D.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${D.divisor}`;case"unrecognized_keys":return`Clé${D.keys.length>1?"s":""} non reconnue${D.keys.length>1?"s":""} : ${z(D.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${D.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${D.origin}`;default:return"Entrée invalide"}}};function s8(){return{localeError:wy()}}var by=()=>{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(D){return $[D]??null}let U=(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&&D.constructor)return D.constructor.name}}return w},A={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(D)=>{switch(D.code){case"invalid_type":return`Entrée invalide : attendu ${D.expected}, reçu ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Entrée invalide : attendu ${E(D.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"≤":"<",b=I(D.origin);if(b)return`Trop grand : attendu que ${D.origin??"la valeur"} ait ${w}${D.maximum.toString()} ${b.unit}`;return`Trop grand : attendu que ${D.origin??"la valeur"} soit ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?"≥":">",b=I(D.origin);if(b)return`Trop petit : attendu que ${D.origin} ait ${w}${D.minimum.toString()} ${b.unit}`;return`Trop petit : attendu que ${D.origin} soit ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Chaîne invalide : doit commencer par "${w.prefix}"`;if(w.format==="ends_with")return`Chaîne invalide : doit se terminer par "${w.suffix}"`;if(w.format==="includes")return`Chaîne invalide : doit inclure "${w.includes}"`;if(w.format==="regex")return`Chaîne invalide : doit correspondre au motif ${w.pattern}`;return`${A[w.format]??D.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${D.divisor}`;case"unrecognized_keys":return`Clé${D.keys.length>1?"s":""} non reconnue${D.keys.length>1?"s":""} : ${z(D.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${D.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${D.origin}`;default:return"Entrée invalide"}}};function $Q(){return{localeError:by()}}var Ny=()=>{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=(X)=>X?$[X]:void 0,A=(X)=>{let W=U(X);if(W)return W.label;return X??$.unknown.label},D=(X)=>`ה${A(X)}`,w=(X)=>{return(U(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},b=(X)=>{if(!X)return null;return I[X]??null},N=(X)=>{let W=typeof X;switch(W){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name;return"object"}default:return W}},O={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(X)=>{switch(X.code){case"invalid_type":{let W=X.expected,Q=A(W),B=N(X.input),Y=$[B]?.label??B;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${Y}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${E(X.values[0])}`;let W=X.values.map((Y)=>E(Y));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${W[0]} או ${W[1]}`;let Q=W[W.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${W.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let W=b(X.origin),Q=D(X.origin??"value");if(X.origin==="string")return`${W?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${X.maximum.toString()} ${W?.unit??""} ${X.inclusive?"או פחות":"לכל היותר"}`.trim();if(X.origin==="number"){let J=X.inclusive?`קטן או שווה ל-${X.maximum}`:`קטן מ-${X.maximum}`;return`גדול מדי: ${Q} צריך להיות ${J}`}if(X.origin==="array"||X.origin==="set"){let J=X.origin==="set"?"צריכה":"צריך",H=X.inclusive?`${X.maximum} ${W?.unit??""} או פחות`:`פחות מ-${X.maximum} ${W?.unit??""}`;return`גדול מדי: ${Q} ${J} להכיל ${H}`.trim()}let B=X.inclusive?"<=":"<",Y=w(X.origin??"value");if(W?.unit)return`${W.longLabel} מדי: ${Q} ${Y} ${B}${X.maximum.toString()} ${W.unit}`;return`${W?.longLabel??"גדול"} מדי: ${Q} ${Y} ${B}${X.maximum.toString()}`}case"too_small":{let W=b(X.origin),Q=D(X.origin??"value");if(X.origin==="string")return`${W?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${X.minimum.toString()} ${W?.unit??""} ${X.inclusive?"או יותר":"לפחות"}`.trim();if(X.origin==="number"){let J=X.inclusive?`גדול או שווה ל-${X.minimum}`:`גדול מ-${X.minimum}`;return`קטן מדי: ${Q} צריך להיות ${J}`}if(X.origin==="array"||X.origin==="set"){let J=X.origin==="set"?"צריכה":"צריך";if(X.minimum===1&&X.inclusive){let v=X.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${J} להכיל ${v}`}let H=X.inclusive?`${X.minimum} ${W?.unit??""} או יותר`:`יותר מ-${X.minimum} ${W?.unit??""}`;return`קטן מדי: ${Q} ${J} להכיל ${H}`.trim()}let B=X.inclusive?">=":">",Y=w(X.origin??"value");if(W?.unit)return`${W.shortLabel} מדי: ${Q} ${Y} ${B}${X.minimum.toString()} ${W.unit}`;return`${W?.shortLabel??"קטן"} מדי: ${Q} ${Y} ${B}${X.minimum.toString()}`}case"invalid_format":{let W=X;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 Q=O[W.format],B=Q?.label??W.format,J=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${B} לא ${J}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${X.divisor}`;case"unrecognized_keys":return`מפתח${X.keys.length>1?"ות":""} לא מזוה${X.keys.length>1?"ים":"ה"}: ${z(X.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${D(X.origin??"array")}`;default:return"קלט לא תקין"}}};function IQ(){return{localeError:Ny()}}var Oy=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"szám";case"object":{if(Array.isArray(D))return"tömb";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(D)=>{switch(D.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${D.expected}, a kapott érték ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Érvénytelen bemenet: a várt érték ${E(D.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Túl nagy: ${D.origin??"érték"} mérete túl nagy ${w}${D.maximum.toString()} ${b.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${D.origin??"érték"} túl nagy: ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Túl kicsi: a bemeneti érték ${D.origin} mérete túl kicsi ${w}${D.minimum.toString()} ${b.unit}`;return`Túl kicsi: a bemeneti érték ${D.origin} túl kicsi ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Érvénytelen string: "${w.prefix}" értékkel kell kezdődnie`;if(w.format==="ends_with")return`Érvénytelen string: "${w.suffix}" értékkel kell végződnie`;if(w.format==="includes")return`Érvénytelen string: "${w.includes}" értéket kell tartalmaznia`;if(w.format==="regex")return`Érvénytelen string: ${w.pattern} mintának kell megfelelnie`;return`Érvénytelen ${A[w.format]??D.format}`}case"not_multiple_of":return`Érvénytelen szám: ${D.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${D.keys.length>1?"s":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${D.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${D.origin}`;default:return"Érvénytelen bemenet"}}};function UQ(){return{localeError:Oy()}}var Xy=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(D){return $[D]??null}let U=(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&&D.constructor)return D.constructor.name}}return w},A={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Input tidak valid: diharapkan ${D.expected}, diterima ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Input tidak valid: diharapkan ${E(D.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Terlalu besar: diharapkan ${D.origin??"value"} memiliki ${w}${D.maximum.toString()} ${b.unit??"elemen"}`;return`Terlalu besar: diharapkan ${D.origin??"value"} menjadi ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Terlalu kecil: diharapkan ${D.origin} memiliki ${w}${D.minimum.toString()} ${b.unit}`;return`Terlalu kecil: diharapkan ${D.origin} menjadi ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`String tidak valid: harus dimulai dengan "${w.prefix}"`;if(w.format==="ends_with")return`String tidak valid: harus berakhir dengan "${w.suffix}"`;if(w.format==="includes")return`String tidak valid: harus menyertakan "${w.includes}"`;if(w.format==="regex")return`String tidak valid: harus sesuai pola ${w.pattern}`;return`${A[w.format]??D.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${D.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${D.keys.length>1?"s":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${D.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${D.origin}`;default:return"Input tidak valid"}}};function DQ(){return{localeError:Xy()}}var Wy=($)=>{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},Gy=()=>{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(A){return $[A]??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(A)=>{switch(A.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Wy(A.input)} þar sem á að vera ${A.expected}`;case"invalid_value":if(A.values.length===1)return`Rangt gildi: gert ráð fyrir ${E(A.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${z(A.values,"|")}`;case"too_big":{let D=A.inclusive?"<=":"<",w=I(A.origin);if(w)return`Of stórt: gert er ráð fyrir að ${A.origin??"gildi"} hafi ${D}${A.maximum.toString()} ${w.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${A.origin??"gildi"} sé ${D}${A.maximum.toString()}`}case"too_small":{let D=A.inclusive?">=":">",w=I(A.origin);if(w)return`Of lítið: gert er ráð fyrir að ${A.origin} hafi ${D}${A.minimum.toString()} ${w.unit}`;return`Of lítið: gert er ráð fyrir að ${A.origin} sé ${D}${A.minimum.toString()}`}case"invalid_format":{let D=A;if(D.format==="starts_with")return`Ógildur strengur: verður að byrja á "${D.prefix}"`;if(D.format==="ends_with")return`Ógildur strengur: verður að enda á "${D.suffix}"`;if(D.format==="includes")return`Ógildur strengur: verður að innihalda "${D.includes}"`;if(D.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${D.pattern}`;return`Rangt ${U[D.format]??A.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${A.divisor}`;case"unrecognized_keys":return`Óþekkt ${A.keys.length>1?"ir lyklar":"ur lykill"}: ${z(A.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${A.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${A.origin}`;default:return"Rangt gildi"}}};function AQ(){return{localeError:Gy()}}var Qy=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"numero";case"object":{if(Array.isArray(D))return"vettore";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Input non valido: atteso ${D.expected}, ricevuto ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Input non valido: atteso ${E(D.values[0])}`;return`Opzione non valida: atteso uno tra ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Troppo grande: ${D.origin??"valore"} deve avere ${w}${D.maximum.toString()} ${b.unit??"elementi"}`;return`Troppo grande: ${D.origin??"valore"} deve essere ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Troppo piccolo: ${D.origin} deve avere ${w}${D.minimum.toString()} ${b.unit}`;return`Troppo piccolo: ${D.origin} deve essere ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Stringa non valida: deve iniziare con "${w.prefix}"`;if(w.format==="ends_with")return`Stringa non valida: deve terminare con "${w.suffix}"`;if(w.format==="includes")return`Stringa non valida: deve includere "${w.includes}"`;if(w.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${w.pattern}`;return`Invalid ${A[w.format]??D.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${D.divisor}`;case"unrecognized_keys":return`Chiav${D.keys.length>1?"i":"e"} non riconosciut${D.keys.length>1?"e":"a"}: ${z(D.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${D.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${D.origin}`;default:return"Input non valido"}}};function wQ(){return{localeError:Qy()}}var Yy=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"数値";case"object":{if(Array.isArray(D))return"配列";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(D)=>{switch(D.code){case"invalid_type":return`無効な入力: ${D.expected}が期待されましたが、${U(D.input)}が入力されました`;case"invalid_value":if(D.values.length===1)return`無効な入力: ${E(D.values[0])}が期待されました`;return`無効な選択: ${z(D.values,"、")}のいずれかである必要があります`;case"too_big":{let w=D.inclusive?"以下である":"より小さい",b=I(D.origin);if(b)return`大きすぎる値: ${D.origin??"値"}は${D.maximum.toString()}${b.unit??"要素"}${w}必要があります`;return`大きすぎる値: ${D.origin??"値"}は${D.maximum.toString()}${w}必要があります`}case"too_small":{let w=D.inclusive?"以上である":"より大きい",b=I(D.origin);if(b)return`小さすぎる値: ${D.origin}は${D.minimum.toString()}${b.unit}${w}必要があります`;return`小さすぎる値: ${D.origin}は${D.minimum.toString()}${w}必要があります`}case"invalid_format":{let w=D;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`無効な${A[w.format]??D.format}`}case"not_multiple_of":return`無効な数値: ${D.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${D.keys.length>1?"群":""}: ${z(D.keys,"、")}`;case"invalid_key":return`${D.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${D.origin}内の無効な値`;default:return"無効な入力"}}};function bQ(){return{localeError:Yy()}}var By=($)=>{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},Jy=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(A){return $[A]??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(A)=>{switch(A.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${A.expected}, მიღებული ${By(A.input)}`;case"invalid_value":if(A.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${E(A.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${z(A.values,"|")}-დან`;case"too_big":{let D=A.inclusive?"<=":"<",w=I(A.origin);if(w)return`ზედმეტად დიდი: მოსალოდნელი ${A.origin??"მნიშვნელობა"} ${w.verb} ${D}${A.maximum.toString()} ${w.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${A.origin??"მნიშვნელობა"} იყოს ${D}${A.maximum.toString()}`}case"too_small":{let D=A.inclusive?">=":">",w=I(A.origin);if(w)return`ზედმეტად პატარა: მოსალოდნელი ${A.origin} ${w.verb} ${D}${A.minimum.toString()} ${w.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${A.origin} იყოს ${D}${A.minimum.toString()}`}case"invalid_format":{let D=A;if(D.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${D.prefix}"-ით`;if(D.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${D.suffix}"-ით`;if(D.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${D.includes}"-ს`;if(D.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${D.pattern}`;return`არასწორი ${U[D.format]??A.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${A.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${A.keys.length>1?"ები":"ი"}: ${z(A.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${A.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${A.origin}-ში`;default:return"არასწორი შეყვანა"}}};function NQ(){return{localeError:Jy()}}var Hy=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(D))return"អារេ (Array)";if(D===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(D)=>{switch(D.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${D.expected} ប៉ុន្តែទទួលបាន ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${E(D.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`ធំពេក៖ ត្រូវការ ${D.origin??"តម្លៃ"} ${w} ${D.maximum.toString()} ${b.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${D.origin??"តម្លៃ"} ${w} ${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`តូចពេក៖ ត្រូវការ ${D.origin} ${w} ${D.minimum.toString()} ${b.unit}`;return`តូចពេក៖ ត្រូវការ ${D.origin} ${w} ${D.minimum.toString()}`}case"invalid_format":{let w=D;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`មិនត្រឹមត្រូវ៖ ${A[w.format]??D.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${D.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${z(D.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${D.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${D.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function I0(){return{localeError:Hy()}}function OQ(){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(D){return $[D]??null}let U=(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&&D.constructor)return D.constructor.name}}return w},A={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(D)=>{switch(D.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${D.expected}, 받은 타입은 ${U(D.input)}입니다`;case"invalid_value":if(D.values.length===1)return`잘못된 입력: 값은 ${E(D.values[0])} 이어야 합니다`;return`잘못된 옵션: ${z(D.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let w=D.inclusive?"이하":"미만",b=w==="미만"?"이어야 합니다":"여야 합니다",N=I(D.origin),O=N?.unit??"요소";if(N)return`${D.origin??"값"}이 너무 큽니다: ${D.maximum.toString()}${O} ${w}${b}`;return`${D.origin??"값"}이 너무 큽니다: ${D.maximum.toString()} ${w}${b}`}case"too_small":{let w=D.inclusive?"이상":"초과",b=w==="이상"?"이어야 합니다":"여야 합니다",N=I(D.origin),O=N?.unit??"요소";if(N)return`${D.origin??"값"}이 너무 작습니다: ${D.minimum.toString()}${O} ${w}${b}`;return`${D.origin??"값"}이 너무 작습니다: ${D.minimum.toString()} ${w}${b}`}case"invalid_format":{let w=D;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`잘못된 ${A[w.format]??D.format}`}case"not_multiple_of":return`잘못된 숫자: ${D.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${z(D.keys,", ")}`;case"invalid_key":return`잘못된 키: ${D.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${D.origin}`;default:return"잘못된 입력"}}};function XQ(){return{localeError:Ly()}}var zy=($)=>{return D0(typeof $,$)},D0=($,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 _V($){let I=Math.abs($),U=I%10,A=I%100;if(A>=11&&A<=19||U===0)return"many";if(U===1)return"one";return"few"}var My=()=>{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(A,D,w,b){let N=$[A]??null;if(N===null)return N;return{unit:N.unit[D],verb:N.verb[b][w?"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(A)=>{switch(A.code){case"invalid_type":return`Gautas tipas ${zy(A.input)}, o tikėtasi - ${D0(A.expected)}`;case"invalid_value":if(A.values.length===1)return`Privalo būti ${E(A.values[0])}`;return`Privalo būti vienas iš ${z(A.values,"|")} pasirinkimų`;case"too_big":{let D=D0(A.origin),w=I(A.origin,_V(Number(A.maximum)),A.inclusive??!1,"smaller");if(w?.verb)return`${U0(D??A.origin??"reikšmė")} ${w.verb} ${A.maximum.toString()} ${w.unit??"elementų"}`;let b=A.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${U0(D??A.origin??"reikšmė")} turi būti ${b} ${A.maximum.toString()} ${w?.unit}`}case"too_small":{let D=D0(A.origin),w=I(A.origin,_V(Number(A.minimum)),A.inclusive??!1,"bigger");if(w?.verb)return`${U0(D??A.origin??"reikšmė")} ${w.verb} ${A.minimum.toString()} ${w.unit??"elementų"}`;let b=A.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${U0(D??A.origin??"reikšmė")} turi būti ${b} ${A.minimum.toString()} ${w?.unit}`}case"invalid_format":{let D=A;if(D.format==="starts_with")return`Eilutė privalo prasidėti "${D.prefix}"`;if(D.format==="ends_with")return`Eilutė privalo pasibaigti "${D.suffix}"`;if(D.format==="includes")return`Eilutė privalo įtraukti "${D.includes}"`;if(D.format==="regex")return`Eilutė privalo atitikti ${D.pattern}`;return`Neteisingas ${U[D.format]??A.format}`}case"not_multiple_of":return`Skaičius privalo būti ${A.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${A.keys.length>1?"i":"as"} rakt${A.keys.length>1?"ai":"as"}: ${z(A.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let D=D0(A.origin);return`${U0(D??A.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function WQ(){return{localeError:My()}}var Ky=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"број";case"object":{if(Array.isArray(D))return"низа";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(D)=>{switch(D.code){case"invalid_type":return`Грешен внес: се очекува ${D.expected}, примено ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Invalid input: expected ${E(D.values[0])}`;return`Грешана опција: се очекува една ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Премногу голем: се очекува ${D.origin??"вредноста"} да има ${w}${D.maximum.toString()} ${b.unit??"елементи"}`;return`Премногу голем: се очекува ${D.origin??"вредноста"} да биде ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Премногу мал: се очекува ${D.origin} да има ${w}${D.minimum.toString()} ${b.unit}`;return`Премногу мал: се очекува ${D.origin} да биде ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;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`Invalid ${A[w.format]??D.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${D.divisor}`;case"unrecognized_keys":return`${D.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${z(D.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${D.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${D.origin}`;default:return"Грешен внес"}}};function GQ(){return{localeError:Ky()}}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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"nombor";case"object":{if(Array.isArray(D))return"array";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Input tidak sah: dijangka ${D.expected}, diterima ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Input tidak sah: dijangka ${E(D.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Terlalu besar: dijangka ${D.origin??"nilai"} ${b.verb} ${w}${D.maximum.toString()} ${b.unit??"elemen"}`;return`Terlalu besar: dijangka ${D.origin??"nilai"} adalah ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Terlalu kecil: dijangka ${D.origin} ${b.verb} ${w}${D.minimum.toString()} ${b.unit}`;return`Terlalu kecil: dijangka ${D.origin} adalah ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`String tidak sah: mesti bermula dengan "${w.prefix}"`;if(w.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${w.suffix}"`;if(w.format==="includes")return`String tidak sah: mesti mengandungi "${w.includes}"`;if(w.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${w.pattern}`;return`${A[w.format]??D.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${D.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${z(D.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${D.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${D.origin}`;default:return"Input tidak sah"}}};function QQ(){return{localeError:vy()}}var Vy=()=>{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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"getal";case"object":{if(Array.isArray(D))return"array";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(D)=>{switch(D.code){case"invalid_type":return`Ongeldige invoer: verwacht ${D.expected}, ontving ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Ongeldige invoer: verwacht ${E(D.values[0])}`;return`Ongeldige optie: verwacht één van ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Te groot: verwacht dat ${D.origin??"waarde"} ${b.verb} ${w}${D.maximum.toString()} ${b.unit??"elementen"}`;return`Te groot: verwacht dat ${D.origin??"waarde"} ${w}${D.maximum.toString()} is`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Te klein: verwacht dat ${D.origin} ${b.verb} ${w}${D.minimum.toString()} ${b.unit}`;return`Te klein: verwacht dat ${D.origin} ${w}${D.minimum.toString()} is`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Ongeldige tekst: moet met "${w.prefix}" beginnen`;if(w.format==="ends_with")return`Ongeldige tekst: moet op "${w.suffix}" eindigen`;if(w.format==="includes")return`Ongeldige tekst: moet "${w.includes}" bevatten`;if(w.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${w.pattern}`;return`Ongeldig: ${A[w.format]??D.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${D.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${D.keys.length>1?"s":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${D.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${D.origin}`;default:return"Ongeldige invoer"}}};function YQ(){return{localeError:Vy()}}var qy=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"tall";case"object":{if(Array.isArray(D))return"liste";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Ugyldig input: forventet ${D.expected}, fikk ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Ugyldig verdi: forventet ${E(D.values[0])}`;return`Ugyldig valg: forventet en av ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`For stor(t): forventet ${D.origin??"value"} til å ha ${w}${D.maximum.toString()} ${b.unit??"elementer"}`;return`For stor(t): forventet ${D.origin??"value"} til å ha ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`For lite(n): forventet ${D.origin} til å ha ${w}${D.minimum.toString()} ${b.unit}`;return`For lite(n): forventet ${D.origin} til å ha ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Ugyldig streng: må starte med "${w.prefix}"`;if(w.format==="ends_with")return`Ugyldig streng: må ende med "${w.suffix}"`;if(w.format==="includes")return`Ugyldig streng: må inneholde "${w.includes}"`;if(w.format==="regex")return`Ugyldig streng: må matche mønsteret ${w.pattern}`;return`Ugyldig ${A[w.format]??D.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${D.divisor}`;case"unrecognized_keys":return`${D.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${z(D.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${D.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${D.origin}`;default:return"Ugyldig input"}}};function BQ(){return{localeError:qy()}}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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"numara";case"object":{if(Array.isArray(D))return"saf";if(D===null)return"gayb";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(D)=>{switch(D.code){case"invalid_type":return`Fâsit giren: umulan ${D.expected}, alınan ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Fâsit giren: umulan ${E(D.values[0])}`;return`Fâsit tercih: mûteberler ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Fazla büyük: ${D.origin??"value"}, ${w}${D.maximum.toString()} ${b.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${D.origin??"value"}, ${w}${D.maximum.toString()} olmalıydı.`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Fazla küçük: ${D.origin}, ${w}${D.minimum.toString()} ${b.unit} sahip olmalıydı.`;return`Fazla küçük: ${D.origin}, ${w}${D.minimum.toString()} olmalıydı.`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Fâsit metin: "${w.prefix}" ile başlamalı.`;if(w.format==="ends_with")return`Fâsit metin: "${w.suffix}" ile bitmeli.`;if(w.format==="includes")return`Fâsit metin: "${w.includes}" ihtivâ etmeli.`;if(w.format==="regex")return`Fâsit metin: ${w.pattern} nakşına uymalı.`;return`Fâsit ${A[w.format]??D.format}`}case"not_multiple_of":return`Fâsit sayı: ${D.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${D.keys.length>1?"s":""}: ${z(D.keys,", ")}`;case"invalid_key":return`${D.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${D.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function JQ(){return{localeError:Fy()}}var Ey=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"عدد";case"object":{if(Array.isArray(D))return"ارې";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(D)=>{switch(D.code){case"invalid_type":return`ناسم ورودي: باید ${D.expected} وای, مګر ${U(D.input)} ترلاسه شو`;case"invalid_value":if(D.values.length===1)return`ناسم ورودي: باید ${E(D.values[0])} وای`;return`ناسم انتخاب: باید یو له ${z(D.values,"|")} څخه وای`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`ډیر لوی: ${D.origin??"ارزښت"} باید ${w}${D.maximum.toString()} ${b.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${D.origin??"ارزښت"} باید ${w}${D.maximum.toString()} وي`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`ډیر کوچنی: ${D.origin} باید ${w}${D.minimum.toString()} ${b.unit} ولري`;return`ډیر کوچنی: ${D.origin} باید ${w}${D.minimum.toString()} وي`}case"invalid_format":{let w=D;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`${A[w.format]??D.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${D.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${D.keys.length>1?"کلیډونه":"کلیډ"}: ${z(D.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${D.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${D.origin} کې`;default:return"ناسمه ورودي"}}};function HQ(){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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"liczba";case"object":{if(Array.isArray(D))return"tablica";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(D)=>{switch(D.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${D.expected}, otrzymano ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${E(D.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Za duża wartość: oczekiwano, że ${D.origin??"wartość"} będzie mieć ${w}${D.maximum.toString()} ${b.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${D.origin??"wartość"} będzie wynosić ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Za mała wartość: oczekiwano, że ${D.origin??"wartość"} będzie mieć ${w}${D.minimum.toString()} ${b.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${D.origin??"wartość"} będzie wynosić ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${w.prefix}"`;if(w.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${w.suffix}"`;if(w.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${w.includes}"`;if(w.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${w.pattern}`;return`Nieprawidłow(y/a/e) ${A[w.format]??D.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${D.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${D.keys.length>1?"s":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${D.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${D.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function LQ(){return{localeError:Sy()}}var jy=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"número";case"object":{if(Array.isArray(D))return"array";if(D===null)return"nulo";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(D)=>{switch(D.code){case"invalid_type":return`Tipo inválido: esperado ${D.expected}, recebido ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Entrada inválida: esperado ${E(D.values[0])}`;return`Opção inválida: esperada uma das ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Muito grande: esperado que ${D.origin??"valor"} tivesse ${w}${D.maximum.toString()} ${b.unit??"elementos"}`;return`Muito grande: esperado que ${D.origin??"valor"} fosse ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Muito pequeno: esperado que ${D.origin} tivesse ${w}${D.minimum.toString()} ${b.unit}`;return`Muito pequeno: esperado que ${D.origin} fosse ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Texto inválido: deve começar com "${w.prefix}"`;if(w.format==="ends_with")return`Texto inválido: deve terminar com "${w.suffix}"`;if(w.format==="includes")return`Texto inválido: deve incluir "${w.includes}"`;if(w.format==="regex")return`Texto inválido: deve corresponder ao padrão ${w.pattern}`;return`${A[w.format]??D.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${D.divisor}`;case"unrecognized_keys":return`Chave${D.keys.length>1?"s":""} desconhecida${D.keys.length>1?"s":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Chave inválida em ${D.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${D.origin}`;default:return"Campo inválido"}}};function zQ(){return{localeError:jy()}}function CV($,I,U,A){let D=Math.abs($),w=D%10,b=D%100;if(b>=11&&b<=19)return A;if(w===1)return I;if(w>=2&&w<=4)return U;return A}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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"число";case"object":{if(Array.isArray(D))return"массив";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(D)=>{switch(D.code){case"invalid_type":return`Неверный ввод: ожидалось ${D.expected}, получено ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Неверный ввод: ожидалось ${E(D.values[0])}`;return`Неверный вариант: ожидалось одно из ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b){let N=Number(D.maximum),O=CV(N,b.unit.one,b.unit.few,b.unit.many);return`Слишком большое значение: ожидалось, что ${D.origin??"значение"} будет иметь ${w}${D.maximum.toString()} ${O}`}return`Слишком большое значение: ожидалось, что ${D.origin??"значение"} будет ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b){let N=Number(D.minimum),O=CV(N,b.unit.one,b.unit.few,b.unit.many);return`Слишком маленькое значение: ожидалось, что ${D.origin} будет иметь ${w}${D.minimum.toString()} ${O}`}return`Слишком маленькое значение: ожидалось, что ${D.origin} будет ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;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`Неверный ${A[w.format]??D.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${D.divisor}`;case"unrecognized_keys":return`Нераспознанн${D.keys.length>1?"ые":"ый"} ключ${D.keys.length>1?"и":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${D.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${D.origin}`;default:return"Неверные входные данные"}}};function MQ(){return{localeError:ky()}}var Py=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"število";case"object":{if(Array.isArray(D))return"tabela";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(D)=>{switch(D.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${D.expected}, prejeto ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Neveljaven vnos: pričakovano ${E(D.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Preveliko: pričakovano, da bo ${D.origin??"vrednost"} imelo ${w}${D.maximum.toString()} ${b.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${D.origin??"vrednost"} ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Premajhno: pričakovano, da bo ${D.origin} imelo ${w}${D.minimum.toString()} ${b.unit}`;return`Premajhno: pričakovano, da bo ${D.origin} ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Neveljaven niz: mora se začeti z "${w.prefix}"`;if(w.format==="ends_with")return`Neveljaven niz: mora se končati z "${w.suffix}"`;if(w.format==="includes")return`Neveljaven niz: mora vsebovati "${w.includes}"`;if(w.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${w.pattern}`;return`Neveljaven ${A[w.format]??D.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${D.divisor}`;case"unrecognized_keys":return`Neprepoznan${D.keys.length>1?"i ključi":" ključ"}: ${z(D.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${D.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${D.origin}`;default:return"Neveljaven vnos"}}};function KQ(){return{localeError:Py()}}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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"antal";case"object":{if(Array.isArray(D))return"lista";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(D)=>{switch(D.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${D.expected}, fick ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Ogiltig inmatning: förväntat ${E(D.values[0])}`;return`Ogiltigt val: förväntade en av ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`För stor(t): förväntade ${D.origin??"värdet"} att ha ${w}${D.maximum.toString()} ${b.unit??"element"}`;return`För stor(t): förväntat ${D.origin??"värdet"} att ha ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`För lite(t): förväntade ${D.origin??"värdet"} att ha ${w}${D.minimum.toString()} ${b.unit}`;return`För lite(t): förväntade ${D.origin??"värdet"} att ha ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Ogiltig sträng: måste börja med "${w.prefix}"`;if(w.format==="ends_with")return`Ogiltig sträng: måste sluta med "${w.suffix}"`;if(w.format==="includes")return`Ogiltig sträng: måste innehålla "${w.includes}"`;if(w.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${w.pattern}"`;return`Ogiltig(t) ${A[w.format]??D.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${D.divisor}`;case"unrecognized_keys":return`${D.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${z(D.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${D.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${D.origin??"värdet"}`;default:return"Ogiltig input"}}};function vQ(){return{localeError:Ry()}}var Ty=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(D))return"அணி";if(D===null)return"வெறுமை";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${D.expected}, பெறப்பட்டது ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${E(D.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${z(D.values,"|")} இல் ஒன்று`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${D.origin??"மதிப்பு"} ${w}${D.maximum.toString()} ${b.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${D.origin??"மதிப்பு"} ${w}${D.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${D.origin} ${w}${D.minimum.toString()} ${b.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${D.origin} ${w}${D.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let w=D;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`தவறான ${A[w.format]??D.format}`}case"not_multiple_of":return`தவறான எண்: ${D.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${D.keys.length>1?"கள்":""}: ${z(D.keys,", ")}`;case"invalid_key":return`${D.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${D.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function VQ(){return{localeError:Ty()}}var _y=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(D))return"อาร์เรย์ (Array)";if(D===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(D)=>{switch(D.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${D.expected} แต่ได้รับ ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${E(D.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"ไม่เกิน":"น้อยกว่า",b=I(D.origin);if(b)return`เกินกำหนด: ${D.origin??"ค่า"} ควรมี${w} ${D.maximum.toString()} ${b.unit??"รายการ"}`;return`เกินกำหนด: ${D.origin??"ค่า"} ควรมี${w} ${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?"อย่างน้อย":"มากกว่า",b=I(D.origin);if(b)return`น้อยกว่ากำหนด: ${D.origin} ควรมี${w} ${D.minimum.toString()} ${b.unit}`;return`น้อยกว่ากำหนด: ${D.origin} ควรมี${w} ${D.minimum.toString()}`}case"invalid_format":{let w=D;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`รูปแบบไม่ถูกต้อง: ${A[w.format]??D.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${D.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${z(D.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${D.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${D.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function qQ(){return{localeError:_y()}}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},Zy=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(A){return $[A]??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(A)=>{switch(A.code){case"invalid_type":return`Geçersiz değer: beklenen ${A.expected}, alınan ${Cy(A.input)}`;case"invalid_value":if(A.values.length===1)return`Geçersiz değer: beklenen ${E(A.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${z(A.values,"|")}`;case"too_big":{let D=A.inclusive?"<=":"<",w=I(A.origin);if(w)return`Çok büyük: beklenen ${A.origin??"değer"} ${D}${A.maximum.toString()} ${w.unit??"öğe"}`;return`Çok büyük: beklenen ${A.origin??"değer"} ${D}${A.maximum.toString()}`}case"too_small":{let D=A.inclusive?">=":">",w=I(A.origin);if(w)return`Çok küçük: beklenen ${A.origin} ${D}${A.minimum.toString()} ${w.unit}`;return`Çok küçük: beklenen ${A.origin} ${D}${A.minimum.toString()}`}case"invalid_format":{let D=A;if(D.format==="starts_with")return`Geçersiz metin: "${D.prefix}" ile başlamalı`;if(D.format==="ends_with")return`Geçersiz metin: "${D.suffix}" ile bitmeli`;if(D.format==="includes")return`Geçersiz metin: "${D.includes}" içermeli`;if(D.format==="regex")return`Geçersiz metin: ${D.pattern} desenine uymalı`;return`Geçersiz ${U[D.format]??A.format}`}case"not_multiple_of":return`Geçersiz sayı: ${A.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${A.keys.length>1?"lar":""}: ${z(A.keys,", ")}`;case"invalid_key":return`${A.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${A.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function FQ(){return{localeError:Zy()}}var gy=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"число";case"object":{if(Array.isArray(D))return"масив";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(D)=>{switch(D.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${D.expected}, отримано ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Неправильні вхідні дані: очікується ${E(D.values[0])}`;return`Неправильна опція: очікується одне з ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Занадто велике: очікується, що ${D.origin??"значення"} ${b.verb} ${w}${D.maximum.toString()} ${b.unit??"елементів"}`;return`Занадто велике: очікується, що ${D.origin??"значення"} буде ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Занадто мале: очікується, що ${D.origin} ${b.verb} ${w}${D.minimum.toString()} ${b.unit}`;return`Занадто мале: очікується, що ${D.origin} буде ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;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`Неправильний ${A[w.format]??D.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${D.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${D.keys.length>1?"і":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${D.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${D.origin}`;default:return"Неправильні вхідні дані"}}};function A0(){return{localeError:gy()}}function EQ(){return A0()}var xy=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"نمبر";case"object":{if(Array.isArray(D))return"آرے";if(D===null)return"نل";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(D)=>{switch(D.code){case"invalid_type":return`غلط ان پٹ: ${D.expected} متوقع تھا، ${U(D.input)} موصول ہوا`;case"invalid_value":if(D.values.length===1)return`غلط ان پٹ: ${E(D.values[0])} متوقع تھا`;return`غلط آپشن: ${z(D.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`بہت بڑا: ${D.origin??"ویلیو"} کے ${w}${D.maximum.toString()} ${b.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${D.origin??"ویلیو"} کا ${w}${D.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`بہت چھوٹا: ${D.origin} کے ${w}${D.minimum.toString()} ${b.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${D.origin} کا ${w}${D.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let w=D;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`غلط ${A[w.format]??D.format}`}case"not_multiple_of":return`غلط نمبر: ${D.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${D.keys.length>1?"ز":""}: ${z(D.keys,"، ")}`;case"invalid_key":return`${D.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${D.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function SQ(){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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"số";case"object":{if(Array.isArray(D))return"mảng";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(D)=>{switch(D.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${D.expected}, nhận được ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${E(D.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Quá lớn: mong đợi ${D.origin??"giá trị"} ${b.verb} ${w}${D.maximum.toString()} ${b.unit??"phần tử"}`;return`Quá lớn: mong đợi ${D.origin??"giá trị"} ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Quá nhỏ: mong đợi ${D.origin} ${b.verb} ${w}${D.minimum.toString()} ${b.unit}`;return`Quá nhỏ: mong đợi ${D.origin} ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${w.prefix}"`;if(w.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${w.suffix}"`;if(w.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${w.includes}"`;if(w.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${w.pattern}`;return`${A[w.format]??D.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${D.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${z(D.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${D.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${D.origin}`;default:return"Đầu vào không hợp lệ"}}};function jQ(){return{localeError:hy()}}var fy=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(D))return"数组";if(D===null)return"空值(null)";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(D)=>{switch(D.code){case"invalid_type":return`无效输入:期望 ${D.expected},实际接收 ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`无效输入:期望 ${E(D.values[0])}`;return`无效选项:期望以下之一 ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`数值过大:期望 ${D.origin??"值"} ${w}${D.maximum.toString()} ${b.unit??"个元素"}`;return`数值过大:期望 ${D.origin??"值"} ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`数值过小:期望 ${D.origin} ${w}${D.minimum.toString()} ${b.unit}`;return`数值过小:期望 ${D.origin} ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;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`无效${A[w.format]??D.format}`}case"not_multiple_of":return`无效数字:必须是 ${D.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${z(D.keys,", ")}`;case"invalid_key":return`${D.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${D.origin} 中包含无效值(value)`;default:return"无效输入"}}};function kQ(){return{localeError:fy()}}var yy=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(D){return $[D]??null}let U=(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&&D.constructor)return D.constructor.name}}return w},A={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(D)=>{switch(D.code){case"invalid_type":return`無效的輸入值:預期為 ${D.expected},但收到 ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`無效的輸入值:預期為 ${E(D.values[0])}`;return`無效的選項:預期為以下其中之一 ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`數值過大:預期 ${D.origin??"值"} 應為 ${w}${D.maximum.toString()} ${b.unit??"個元素"}`;return`數值過大:預期 ${D.origin??"值"} 應為 ${w}${D.maximum.toString()}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`數值過小:預期 ${D.origin} 應為 ${w}${D.minimum.toString()} ${b.unit}`;return`數值過小:預期 ${D.origin} 應為 ${w}${D.minimum.toString()}`}case"invalid_format":{let w=D;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`無效的 ${A[w.format]??D.format}`}case"not_multiple_of":return`無效的數字:必須為 ${D.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${D.keys.length>1?"們":""}:${z(D.keys,"、")}`;case"invalid_key":return`${D.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${D.origin} 中有無效的值`;default:return"無效的輸入值"}}};function PQ(){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(D){return $[D]??null}let U=(D)=>{let w=typeof D;switch(w){case"number":return Number.isNaN(D)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(D))return"akopọ";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name}}return w},A={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(D)=>{switch(D.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${D.expected}, àmọ̀ a rí ${U(D.input)}`;case"invalid_value":if(D.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${E(D.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${z(D.values,"|")}`;case"too_big":{let w=D.inclusive?"<=":"<",b=I(D.origin);if(b)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${D.origin??"iye"} ${b.verb} ${w}${D.maximum} ${b.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${w}${D.maximum}`}case"too_small":{let w=D.inclusive?">=":">",b=I(D.origin);if(b)return`Kéré ju: a ní láti jẹ́ pé ${D.origin} ${b.verb} ${w}${D.minimum} ${b.unit}`;return`Kéré ju: a ní láti jẹ́ ${w}${D.minimum}`}case"invalid_format":{let w=D;if(w.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${w.prefix}"`;if(w.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${w.suffix}"`;if(w.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${w.includes}"`;if(w.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${w.pattern}`;return`Aṣìṣe: ${A[w.format]??D.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${D.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${z(D.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${D.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${D.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function RQ(){return{localeError:uy()}}var ZV,TQ=Symbol("ZodOutput"),_Q=Symbol("ZodInput");class CQ{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 A={...U,...this._map.get($)};return Object.keys(A).length?A:void 0}return this._map.get($)}has($){return this._map.has($)}}function Tw(){return new CQ}(ZV=globalThis).__zod_globalRegistry??(ZV.__zod_globalRegistry=Tw());var d$=globalThis.__zod_globalRegistry;function ZQ($,I){return new $({type:"string",...j(I)})}function gQ($,I){return new $({type:"string",coerce:!0,...j(I)})}function _w($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...j(I)})}function b0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...j(I)})}function Cw($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...j(I)})}function Zw($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(I)})}function gw($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(I)})}function xw($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(I)})}function N0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...j(I)})}function hw($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...j(I)})}function fw($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(I)})}function yw($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...j(I)})}function uw($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(I)})}function lw($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...j(I)})}function cw($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...j(I)})}function mw($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(I)})}function rw($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(I)})}function nw($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(I)})}function xQ($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...j(I)})}function iw($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(I)})}function ow($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(I)})}function dw($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...j(I)})}function pw($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...j(I)})}function tw($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...j(I)})}function aw($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...j(I)})}var hQ={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function fQ($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(I)})}function yQ($,I){return new $({type:"string",format:"date",check:"string_format",...j(I)})}function uQ($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...j(I)})}function lQ($,I){return new $({type:"string",format:"duration",check:"string_format",...j(I)})}function cQ($,I){return new $({type:"number",checks:[],...j(I)})}function mQ($,I){return new $({type:"number",coerce:!0,checks:[],...j(I)})}function rQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...j(I)})}function nQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...j(I)})}function iQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...j(I)})}function oQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...j(I)})}function dQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...j(I)})}function pQ($,I){return new $({type:"boolean",...j(I)})}function tQ($,I){return new $({type:"boolean",coerce:!0,...j(I)})}function aQ($,I){return new $({type:"bigint",...j(I)})}function eQ($,I){return new $({type:"bigint",coerce:!0,...j(I)})}function sQ($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...j(I)})}function $Y($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...j(I)})}function IY($,I){return new $({type:"symbol",...j(I)})}function UY($,I){return new $({type:"undefined",...j(I)})}function DY($,I){return new $({type:"null",...j(I)})}function AY($){return new $({type:"any"})}function wY($){return new $({type:"unknown"})}function bY($,I){return new $({type:"never",...j(I)})}function NY($,I){return new $({type:"void",...j(I)})}function OY($,I){return new $({type:"date",...j(I)})}function XY($,I){return new $({type:"date",coerce:!0,...j(I)})}function WY($,I){return new $({type:"nan",...j(I)})}function r6($,I){return new Kw({check:"less_than",...j(I),value:$,inclusive:!1})}function W6($,I){return new Kw({check:"less_than",...j(I),value:$,inclusive:!0})}function n6($,I){return new vw({check:"greater_than",...j(I),value:$,inclusive:!1})}function p$($,I){return new vw({check:"greater_than",...j(I),value:$,inclusive:!0})}function ew($){return n6(0,$)}function sw($){return r6(0,$)}function $b($){return W6(0,$)}function Ib($){return p$(0,$)}function Z4($,I){return new QG({check:"multiple_of",...j(I),value:$})}function NI($,I){return new JG({check:"max_size",...j(I),maximum:$})}function g4($,I){return new HG({check:"min_size",...j(I),minimum:$})}function $1($,I){return new LG({check:"size_equals",...j(I),size:$})}function OI($,I){return new zG({check:"max_length",...j(I),maximum:$})}function w4($,I){return new MG({check:"min_length",...j(I),minimum:$})}function XI($,I){return new KG({check:"length_equals",...j(I),length:$})}function I1($,I){return new vG({check:"string_format",format:"regex",...j(I),pattern:$})}function U1($){return new VG({check:"string_format",format:"lowercase",...j($)})}function D1($){return new qG({check:"string_format",format:"uppercase",...j($)})}function A1($,I){return new FG({check:"string_format",format:"includes",...j(I),includes:$})}function w1($,I){return new EG({check:"string_format",format:"starts_with",...j(I),prefix:$})}function b1($,I){return new SG({check:"string_format",format:"ends_with",...j(I),suffix:$})}function Ub($,I,U){return new jG({check:"property",property:$,schema:I,...j(U)})}function N1($,I){return new kG({check:"mime_type",mime:$,...j(I)})}function C6($){return new PG({check:"overwrite",tx:$})}function O1($){return C6((I)=>I.normalize($))}function X1(){return C6(($)=>$.trim())}function W1(){return C6(($)=>$.toLowerCase())}function G1(){return C6(($)=>$.toUpperCase())}function Q1(){return C6(($)=>S9($))}function GY($,I,U){return new $({type:"array",element:I,...j(U)})}function cy($,I,U){return new $({type:"union",options:I,...j(U)})}function my($,I,U){return new $({type:"union",options:I,inclusive:!1,...j(U)})}function ry($,I,U,A){return new $({type:"union",options:U,discriminator:I,...j(A)})}function ny($,I,U){return new $({type:"intersection",left:I,right:U})}function iy($,I,U,A){let D=U instanceof o;return new $({type:"tuple",items:I,rest:D?U:null,...j(D?A:U)})}function oy($,I,U,A){return new $({type:"record",keyType:I,valueType:U,...j(A)})}function dy($,I,U,A){return new $({type:"map",keyType:I,valueType:U,...j(A)})}function py($,I,U){return new $({type:"set",valueType:I,...j(U)})}function ty($,I,U){let A=Array.isArray(I)?Object.fromEntries(I.map((D)=>[D,D])):I;return new $({type:"enum",entries:A,...j(U)})}function ay($,I,U){return new $({type:"enum",entries:I,...j(U)})}function ey($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...j(U)})}function QY($,I){return new $({type:"file",...j(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():k9(U)}})}function Du($,I,U){return new $({type:"nonoptional",innerType:I,...j(U)})}function Au($,I){return new $({type:"success",innerType:I})}function wu($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function bu($,I,U){return new $({type:"pipe",in:I,out:U})}function Nu($,I){return new $({type:"readonly",innerType:I})}function Ou($,I,U){return new $({type:"template_literal",parts:I,...j(U)})}function Xu($,I){return new $({type:"lazy",getter:I})}function Wu($,I){return new $({type:"promise",innerType:I})}function YY($,I,U){let A=j(U);return A.abort??(A.abort=!0),new $({type:"custom",check:"custom",fn:I,...A})}function BY($,I,U){return new $({type:"custom",check:"custom",fn:I,...j(U)})}function JY($){let I=gV((U)=>{return U.addIssue=(A)=>{if(typeof A==="string")U.issues.push(dI(A,U.value,I._zod.def));else{let D=A;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=I),D.continue??(D.continue=!I._zod.def.abort),U.issues.push(dI(D))}},$(U.value,U)});return I}function gV($,I){let U=new J$({check:"custom",...j(I)});return U._zod.check=$,U}function HY($){let I=new J$({check:"describe"});return I._zod.onattach=[(U)=>{let A=d$.get(U)??{};d$.add(U,{...A,description:$})}],I._zod.check=()=>{},I}function LY($){let I=new J$({check:"meta"});return I._zod.onattach=[(U)=>{let A=d$.get(U)??{};d$.add(U,{...A,...$})}],I._zod.check=()=>{},I}function zY($,I){let U=j(I),A=U.truthy??["true","1","yes","on","y","enabled"],D=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")A=A.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y),D=D.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y);let w=new Set(A),b=new Set(D),N=$.Codec??sU,O=$.Boolean??aU,W=new($.String??bI)({type:"string",error:U.error}),Q=new O({type:"boolean",error:U.error}),B=new N({type:"pipe",in:W,out:Q,transform:(Y,J)=>{let H=Y;if(U.case!=="sensitive")H=H.toLowerCase();if(w.has(H))return!0;else if(b.has(H))return!1;else return J.issues.push({code:"invalid_value",expected:"stringbool",values:[...w,...b],input:J.value,inst:B,continue:!1}),{}},reverseTransform:(Y,J)=>{if(Y===!0)return A[0]||"true";else return D[0]||"false"},error:U.error});return B}function Y1($,I,U,A={}){let D=j(A),w={...j(A),check:"string_format",type:"string",format:I,fn:typeof U==="function"?U:(N)=>U.test(N),...D};if(U instanceof RegExp)w.pattern=U;return new $(w)}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 X$($,I,U={path:[],schemaPath:[]}){var A;let D=$._zod.def,w=I.seen.get($);if(w){if(w.count++,U.schemaPath.includes($))w.cycle=U.path;return w.schema}let b={schema:{},count:1,cycle:void 0,path:U.path};I.seen.set($,b);let N=$._zod.toJSONSchema?.();if(N)b.schema=N;else{let W={...U,schemaPath:[...U.schemaPath,$],path:U.path},Q=$._zod.parent;if(Q)b.ref=Q,X$(Q,I,W),I.seen.get(Q).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,b.schema,W);else{let B=b.schema,Y=I.processors[D.type];if(!Y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${D.type}`);Y($,I,B,W)}}let O=I.metadataRegistry.get($);if(O)Object.assign(b.schema,O);if(I.io==="input"&&t$($))delete b.schema.examples,delete b.schema.default;if(I.io==="input"&&b.schema._prefault)(A=b.schema).default??(A.default=b.schema._prefault);return delete b.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 A=(w)=>{let b=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let W=$.external.registry.get(w[0])?.id,Q=$.external.uri??((Y)=>Y);if(W)return{ref:Q(W)};let B=w[1].defId??w[1].schema.id??`schema${$.counter++}`;return w[1].defId=B,{defId:B,ref:`${Q("__shared")}#/${b}/${B}`}}if(w[1]===U)return{ref:"#"};let O=`${"#"}/${b}/`,X=w[1].schema.id??`__schema${$.counter++}`;return{defId:X,ref:O+X}},D=(w)=>{if(w[1].schema.$ref)return;let b=w[1],{ref:N,defId:O}=A(w);if(b.def={...b.schema},O)b.defId=O;let X=b.schema;for(let W in X)delete X[W];X.$ref=N};if($.cycles==="throw")for(let w of $.seen.entries()){let b=w[1];if(b.cycle)throw new Error(`Cycle detected: #/${b.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
65
- ${B}
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let w of $.seen.entries()){let b=w[1];if(I===w[0]){D(w);continue}if($.external){let O=$.external.registry.get(w[0])?.id;if(I!==w[0]&&O){D(w);continue}}if($.metadataRegistry.get(w[0])?.id){D(w);continue}if(b.cycle){D(w);continue}if(b.count>1){if($.reused==="ref"){D(w);continue}}}}function f4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let A=(b)=>{let N=$.seen.get(b),O=N.def??N.schema,X={...O};if(N.ref===null)return;let W=N.ref;if(N.ref=null,W){A(W);let Q=$.seen.get(W).schema;if(Q.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))O.allOf=O.allOf??[],O.allOf.push(Q);else Object.assign(O,Q),Object.assign(O,X)}if(!N.isParent)$.override({zodSchema:b,jsonSchema:O,path:N.path??[]})};for(let b of[...$.seen.entries()].reverse())A(b[0]);let D={};if($.target==="draft-2020-12")D.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")D.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")D.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let b=$.external.registry.get(I)?.id;if(!b)throw new Error("Schema is missing an `id` property");D.$id=$.external.uri(b)}Object.assign(D,U.def??U.schema);let w=$.external?.defs??{};for(let b of $.seen.entries()){let N=b[1];if(N.def&&N.defId)w[N.defId]=N.def}if($.external);else if(Object.keys(w).length>0)if($.target==="draft-2020-12")D.$defs=w;else D.definitions=w;try{let b=JSON.parse(JSON.stringify(D));return Object.defineProperty(b,"~standard",{value:{...I["~standard"],jsonSchema:{input:B1(I,"input"),output:B1(I,"output")}},enumerable:!1,writable:!1}),b}catch(b){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 A=$._zod.def;if(A.type==="transform")return!0;if(A.type==="array")return t$(A.element,U);if(A.type==="set")return t$(A.valueType,U);if(A.type==="lazy")return t$(A.getter(),U);if(A.type==="promise"||A.type==="optional"||A.type==="nonoptional"||A.type==="nullable"||A.type==="readonly"||A.type==="default"||A.type==="prefault")return t$(A.innerType,U);if(A.type==="intersection")return t$(A.left,U)||t$(A.right,U);if(A.type==="record"||A.type==="map")return t$(A.keyType,U)||t$(A.valueType,U);if(A.type==="pipe")return t$(A.in,U)||t$(A.out,U);if(A.type==="object"){for(let D in A.shape)if(t$(A.shape[D],U))return!0;return!1}if(A.type==="union"){for(let D of A.options)if(t$(D,U))return!0;return!1}if(A.type==="tuple"){for(let D of A.items)if(t$(D,U))return!0;if(A.rest&&t$(A.rest,U))return!0;return!1}return!1}var MY=($,I={})=>(U)=>{let A=x4({...U,processors:I});return X$($,A),h4(A,$),f4(A,$)},B1=($,I)=>(U)=>{let{libraryOptions:A,target:D}=U??{},w=x4({...A??{},target:D,io:I,processors:{}});return X$($,w),h4(w,$),f4(w,$)};var Gu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},KY=($,I,U,A)=>{let D=U;D.type="string";let{minimum:w,maximum:b,format:N,patterns:O,contentEncoding:X}=$._zod.bag;if(typeof w==="number")D.minLength=w;if(typeof b==="number")D.maxLength=b;if(N){if(D.format=Gu[N]??N,D.format==="")delete D.format}if(X)D.contentEncoding=X;if(O&&O.size>0){let W=[...O];if(W.length===1)D.pattern=W[0].source;else if(W.length>1)D.allOf=[...W.map((Q)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},vY=($,I,U,A)=>{let D=U,{minimum:w,maximum:b,format:N,multipleOf:O,exclusiveMaximum:X,exclusiveMinimum:W}=$._zod.bag;if(typeof N==="string"&&N.includes("int"))D.type="integer";else D.type="number";if(typeof W==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")D.minimum=W,D.exclusiveMinimum=!0;else D.exclusiveMinimum=W;if(typeof w==="number"){if(D.minimum=w,typeof W==="number"&&I.target!=="draft-04")if(W>=w)delete D.minimum;else delete D.exclusiveMinimum}if(typeof X==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")D.maximum=X,D.exclusiveMaximum=!0;else D.exclusiveMaximum=X;if(typeof b==="number"){if(D.maximum=b,typeof X==="number"&&I.target!=="draft-04")if(X<=b)delete D.maximum;else delete D.exclusiveMaximum}if(typeof O==="number")D.multipleOf=O},VY=($,I,U,A)=>{U.type="boolean"},qY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},FY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},EY=($,I,U,A)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},SY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},jY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},kY=($,I,U,A)=>{U.not={}},PY=($,I,U,A)=>{},RY=($,I,U,A)=>{},TY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},_Y=($,I,U,A)=>{let D=$._zod.def,w=lU(D.entries);if(w.every((b)=>typeof b==="number"))U.type="number";if(w.every((b)=>typeof b==="string"))U.type="string";U.enum=w},CY=($,I,U,A)=>{let D=$._zod.def,w=[];for(let b of D.values)if(b===void 0){if(I.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof b==="bigint")if(I.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else w.push(Number(b));else w.push(b);if(w.length===0);else if(w.length===1){let b=w[0];if(U.type=b===null?"null":typeof b,I.target==="draft-04"||I.target==="openapi-3.0")U.enum=[b];else U.const=b}else{if(w.every((b)=>typeof b==="number"))U.type="number";if(w.every((b)=>typeof b==="string"))U.type="string";if(w.every((b)=>typeof b==="boolean"))U.type="boolean";if(w.every((b)=>b===null))U.type="null";U.enum=w}},ZY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},gY=($,I,U,A)=>{let D=U,w=$._zod.pattern;if(!w)throw new Error("Pattern not found in template literal");D.type="string",D.pattern=w.source},xY=($,I,U,A)=>{let D=U,w={type:"string",format:"binary",contentEncoding:"binary"},{minimum:b,maximum:N,mime:O}=$._zod.bag;if(b!==void 0)w.minLength=b;if(N!==void 0)w.maxLength=N;if(O)if(O.length===1)w.contentMediaType=O[0],Object.assign(D,w);else D.anyOf=O.map((X)=>{return{...w,contentMediaType:X}});else Object.assign(D,w)},hY=($,I,U,A)=>{U.type="boolean"},fY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},yY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},uY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},lY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},cY=($,I,U,A)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},mY=($,I,U,A)=>{let D=U,w=$._zod.def,{minimum:b,maximum:N}=$._zod.bag;if(typeof b==="number")D.minItems=b;if(typeof N==="number")D.maxItems=N;D.type="array",D.items=X$(w.element,I,{...A,path:[...A.path,"items"]})},rY=($,I,U,A)=>{let D=U,w=$._zod.def;D.type="object",D.properties={};let b=w.shape;for(let X in b)D.properties[X]=X$(b[X],I,{...A,path:[...A.path,"properties",X]});let N=new Set(Object.keys(b)),O=new Set([...N].filter((X)=>{let W=w.shape[X]._zod;if(I.io==="input")return W.optin===void 0;else return W.optout===void 0}));if(O.size>0)D.required=Array.from(O);if(w.catchall?._zod.def.type==="never")D.additionalProperties=!1;else if(!w.catchall){if(I.io==="output")D.additionalProperties=!1}else if(w.catchall)D.additionalProperties=X$(w.catchall,I,{...A,path:[...A.path,"additionalProperties"]})},Ab=($,I,U,A)=>{let D=$._zod.def,w=D.inclusive===!1,b=D.options.map((N,O)=>X$(N,I,{...A,path:[...A.path,w?"oneOf":"anyOf",O]}));if(w)U.oneOf=b;else U.anyOf=b},nY=($,I,U,A)=>{let D=$._zod.def,w=X$(D.left,I,{...A,path:[...A.path,"allOf",0]}),b=X$(D.right,I,{...A,path:[...A.path,"allOf",1]}),N=(X)=>("allOf"in X)&&Object.keys(X).length===1,O=[...N(w)?w.allOf:[w],...N(b)?b.allOf:[b]];U.allOf=O},iY=($,I,U,A)=>{let D=U,w=$._zod.def;D.type="array";let b=I.target==="draft-2020-12"?"prefixItems":"items",N=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",O=w.items.map((B,Y)=>X$(B,I,{...A,path:[...A.path,b,Y]})),X=w.rest?X$(w.rest,I,{...A,path:[...A.path,N,...I.target==="openapi-3.0"?[w.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(D.prefixItems=O,X)D.items=X}else if(I.target==="openapi-3.0"){if(D.items={anyOf:O},X)D.items.anyOf.push(X);if(D.minItems=O.length,!X)D.maxItems=O.length}else if(D.items=O,X)D.additionalItems=X;let{minimum:W,maximum:Q}=$._zod.bag;if(typeof W==="number")D.minItems=W;if(typeof Q==="number")D.maxItems=Q},oY=($,I,U,A)=>{let D=U,w=$._zod.def;if(D.type="object",I.target==="draft-07"||I.target==="draft-2020-12")D.propertyNames=X$(w.keyType,I,{...A,path:[...A.path,"propertyNames"]});D.additionalProperties=X$(w.valueType,I,{...A,path:[...A.path,"additionalProperties"]})},dY=($,I,U,A)=>{let D=$._zod.def,w=X$(D.innerType,I,A),b=I.seen.get($);if(I.target==="openapi-3.0")b.ref=D.innerType,U.nullable=!0;else U.anyOf=[w,{type:"null"}]},pY=($,I,U,A)=>{let D=$._zod.def;X$(D.innerType,I,A);let w=I.seen.get($);w.ref=D.innerType},tY=($,I,U,A)=>{let D=$._zod.def;X$(D.innerType,I,A);let w=I.seen.get($);w.ref=D.innerType,U.default=JSON.parse(JSON.stringify(D.defaultValue))},aY=($,I,U,A)=>{let D=$._zod.def;X$(D.innerType,I,A);let w=I.seen.get($);if(w.ref=D.innerType,I.io==="input")U._prefault=JSON.parse(JSON.stringify(D.defaultValue))},eY=($,I,U,A)=>{let D=$._zod.def;X$(D.innerType,I,A);let w=I.seen.get($);w.ref=D.innerType;let b;try{b=D.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}U.default=b},sY=($,I,U,A)=>{let D=$._zod.def,w=I.io==="input"?D.in._zod.def.type==="transform"?D.out:D.in:D.out;X$(w,I,A);let b=I.seen.get($);b.ref=w},$B=($,I,U,A)=>{let D=$._zod.def;X$(D.innerType,I,A);let w=I.seen.get($);w.ref=D.innerType,U.readOnly=!0},IB=($,I,U,A)=>{let D=$._zod.def;X$(D.innerType,I,A);let w=I.seen.get($);w.ref=D.innerType},UB=($,I,U,A)=>{let D=$._zod.def;X$(D.innerType,I,A);let w=I.seen.get($);w.ref=D.innerType},DB=($,I,U,A)=>{let D=$._zod.innerType;X$(D,I,A);let w=I.seen.get($);w.ref=D},Db={string:KY,number:vY,boolean:VY,bigint:qY,symbol:FY,null:EY,undefined:SY,void:jY,never:kY,any:PY,unknown:RY,date:TY,enum:_Y,literal:CY,nan:ZY,template_literal:gY,file:xY,success:hY,custom:fY,function:yY,transform:uY,map:lY,set:cY,array:mY,object:rY,union:Ab,intersection:nY,tuple:iY,record:oY,nullable:dY,nonoptional:pY,default:tY,prefault:aY,catch:eY,pipe:sY,readonly:$B,promise:IB,optional:UB,lazy:DB};function wb($,I){if("_idmap"in $){let A=$,D=x4({...I,processors:Db}),w={};for(let O of A._idmap.entries()){let[X,W]=O;X$(W,D)}let b={},N={registry:A,uri:I?.uri,defs:w};D.external=N;for(let O of A._idmap.entries()){let[X,W]=O;h4(D,W),b[X]=f4(D,W)}if(Object.keys(w).length>0){let O=D.target==="draft-2020-12"?"$defs":"definitions";b.__shared={[O]:w}}return{schemas:b}}let U=x4({...I,processors:Db});return X$($,U),h4(U,$),f4(U,$)}class AB{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:Db,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return X$($,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":A,...D}=U;return D}}var xV={};var O0={};K6(O0,{xor:()=>kq,xid:()=>aV,void:()=>Vq,uuidv7:()=>mV,uuidv6:()=>cV,uuidv4:()=>lV,uuid:()=>uV,url:()=>rV,unknown:()=>WI,union:()=>_b,undefined:()=>Kq,ulid:()=>tV,uint64:()=>zq,uint32:()=>Jq,tuple:()=>fB,transform:()=>Zb,templateLiteral:()=>lq,symbol:()=>Mq,superRefine:()=>X7,success:()=>fq,stringbool:()=>pq,stringFormat:()=>Oq,string:()=>Gb,strictObject:()=>Sq,set:()=>Cq,refine:()=>O7,record:()=>yB,readonly:()=>U7,promise:()=>cq,preprocess:()=>aq,prefault:()=>pB,pipe:()=>Q0,partialRecord:()=>Rq,optional:()=>W0,object:()=>Eq,number:()=>VB,nullish:()=>hq,nullable:()=>G0,null:()=>jB,nonoptional:()=>tB,never:()=>Tb,nativeEnum:()=>Zq,nanoid:()=>oV,nan:()=>yq,meta:()=>oq,map:()=>_q,mac:()=>$q,looseRecord:()=>Tq,looseObject:()=>jq,literal:()=>gq,lazy:()=>w7,ksuid:()=>eV,keyof:()=>Fq,jwt:()=>Nq,json:()=>tq,ipv6:()=>Iq,ipv4:()=>sV,intersection:()=>xB,int64:()=>Lq,int32:()=>Bq,int:()=>Qb,instanceof:()=>dq,httpUrl:()=>nV,hostname:()=>Xq,hex:()=>Wq,hash:()=>Gq,guid:()=>yV,function:()=>mq,float64:()=>Yq,float32:()=>Qq,file:()=>xq,enum:()=>Cb,emoji:()=>iV,email:()=>fV,e164:()=>bq,discriminatedUnion:()=>Pq,describe:()=>iq,date:()=>qq,custom:()=>nq,cuid2:()=>pV,cuid:()=>dV,codec:()=>uq,cidrv6:()=>Dq,cidrv4:()=>Uq,check:()=>rq,catch:()=>sB,boolean:()=>qB,bigint:()=>Hq,base64url:()=>wq,base64:()=>Aq,array:()=>J0,any:()=>vq,_function:()=>mq,_default:()=>oB,_ZodString:()=>Yb,ZodXor:()=>CB,ZodXID:()=>Kb,ZodVoid:()=>TB,ZodUnknown:()=>PB,ZodUnion:()=>L0,ZodUndefined:()=>EB,ZodUUID:()=>i6,ZodURL:()=>Y0,ZodULID:()=>Mb,ZodType:()=>t,ZodTuple:()=>hB,ZodTransform:()=>rB,ZodTemplateLiteral:()=>D7,ZodSymbol:()=>FB,ZodSuccess:()=>aB,ZodStringFormat:()=>Y$,ZodString:()=>L1,ZodSet:()=>lB,ZodRecord:()=>z0,ZodReadonly:()=>I7,ZodPromise:()=>b7,ZodPrefault:()=>dB,ZodPipe:()=>hb,ZodOptional:()=>gb,ZodObject:()=>H0,ZodNumberFormat:()=>GI,ZodNumber:()=>M1,ZodNullable:()=>nB,ZodNull:()=>SB,ZodNonOptional:()=>xb,ZodNever:()=>RB,ZodNanoID:()=>Hb,ZodNaN:()=>$7,ZodMap:()=>uB,ZodMAC:()=>vB,ZodLiteral:()=>cB,ZodLazy:()=>A7,ZodKSUID:()=>vb,ZodJWT:()=>Pb,ZodIntersection:()=>gB,ZodIPv6:()=>qb,ZodIPv4:()=>Vb,ZodGUID:()=>X0,ZodFunction:()=>N7,ZodFile:()=>mB,ZodEnum:()=>H1,ZodEmoji:()=>Jb,ZodEmail:()=>Bb,ZodE164:()=>kb,ZodDiscriminatedUnion:()=>ZB,ZodDefault:()=>iB,ZodDate:()=>B0,ZodCustomStringFormat:()=>z1,ZodCustom:()=>M0,ZodCodec:()=>fb,ZodCatch:()=>eB,ZodCUID2:()=>zb,ZodCUID:()=>Lb,ZodCIDRv6:()=>Eb,ZodCIDRv4:()=>Fb,ZodBoolean:()=>K1,ZodBigIntFormat:()=>Rb,ZodBigInt:()=>v1,ZodBase64URL:()=>jb,ZodBase64:()=>Sb,ZodArray:()=>_B,ZodAny:()=>kB});var bb={};K6(bb,{uppercase:()=>D1,trim:()=>X1,toUpperCase:()=>G1,toLowerCase:()=>W1,startsWith:()=>w1,slugify:()=>Q1,size:()=>$1,regex:()=>I1,property:()=>Ub,positive:()=>ew,overwrite:()=>C6,normalize:()=>O1,nonpositive:()=>$b,nonnegative:()=>Ib,negative:()=>sw,multipleOf:()=>Z4,minSize:()=>g4,minLength:()=>w4,mime:()=>N1,maxSize:()=>NI,maxLength:()=>OI,lte:()=>W6,lt:()=>r6,lowercase:()=>U1,length:()=>XI,includes:()=>A1,gte:()=>p$,gt:()=>n6,endsWith:()=>b1});var J1={};K6(J1,{time:()=>NB,duration:()=>OB,datetime:()=>wB,date:()=>bB,ZodISOTime:()=>Xb,ZodISODuration:()=>Wb,ZodISODateTime:()=>Nb,ZodISODate:()=>Ob});var Nb=L("ZodISODateTime",($,I)=>{mG.init($,I),Y$.init($,I)});function wB($){return fQ(Nb,$)}var Ob=L("ZodISODate",($,I)=>{rG.init($,I),Y$.init($,I)});function bB($){return yQ(Ob,$)}var Xb=L("ZodISOTime",($,I)=>{nG.init($,I),Y$.init($,I)});function NB($){return uQ(Xb,$)}var Wb=L("ZodISODuration",($,I)=>{iG.init($,I),Y$.init($,I)});function OB($){return lQ(Wb,$)}var hV=($,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,iI,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,iI,2)}},isEmpty:{get(){return $.issues.length===0}}})},Yu=L("ZodError",hV),A6=L("ZodError",hV,{Parent:Error});var XB=pI(A6),WB=tI(A6),GB=aI(A6),QB=eI(A6),YB=Gw(A6),BB=Qw(A6),JB=Yw(A6),HB=Bw(A6),LB=Jw(A6),zB=Hw(A6),MB=Lw(A6),KB=zw(A6);var t=L("ZodType",($,I)=>{return o.init($,I),Object.assign($["~standard"],{jsonSchema:{input:B1($,"input"),output:B1($,"output")}}),$.toJSONSchema=MY($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(S.mergeDefs(I,{checks:[...I.checks??[],...U.map((A)=>typeof A==="function"?{_zod:{check:A,def:{check:"custom"},onattach:[]}}:A)]}))},$.clone=(U,A)=>o$($,U,A),$.brand=()=>$,$.register=(U,A)=>{return U.add($,A),$},$.parse=(U,A)=>XB($,U,A,{callee:$.parse}),$.safeParse=(U,A)=>GB($,U,A),$.parseAsync=async(U,A)=>WB($,U,A,{callee:$.parseAsync}),$.safeParseAsync=async(U,A)=>QB($,U,A),$.spa=$.safeParseAsync,$.encode=(U,A)=>YB($,U,A),$.decode=(U,A)=>BB($,U,A),$.encodeAsync=async(U,A)=>JB($,U,A),$.decodeAsync=async(U,A)=>HB($,U,A),$.safeEncode=(U,A)=>LB($,U,A),$.safeDecode=(U,A)=>zB($,U,A),$.safeEncodeAsync=async(U,A)=>MB($,U,A),$.safeDecodeAsync=async(U,A)=>KB($,U,A),$.refine=(U,A)=>$.check(O7(U,A)),$.superRefine=(U)=>$.check(X7(U)),$.overwrite=(U)=>$.check(C6(U)),$.optional=()=>W0($),$.nullable=()=>G0($),$.nullish=()=>W0(G0($)),$.nonoptional=(U)=>tB($,U),$.array=()=>J0($),$.or=(U)=>_b([$,U]),$.and=(U)=>xB($,U),$.transform=(U)=>Q0($,Zb(U)),$.default=(U)=>oB($,U),$.prefault=(U)=>pB($,U),$.catch=(U)=>sB($,U),$.pipe=(U)=>Q0($,U),$.readonly=()=>U7($),$.describe=(U)=>{let A=$.clone();return d$.add(A,{description:U}),A},Object.defineProperty($,"description",{get(){return d$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return d$.get($);let A=$.clone();return d$.add(A,U[0]),A},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),Yb=L("_ZodString",($,I)=>{bI.init($,I),t.init($,I),$._zod.processJSONSchema=(A,D,w)=>KY($,A,D,w);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...A)=>$.check(I1(...A)),$.includes=(...A)=>$.check(A1(...A)),$.startsWith=(...A)=>$.check(w1(...A)),$.endsWith=(...A)=>$.check(b1(...A)),$.min=(...A)=>$.check(w4(...A)),$.max=(...A)=>$.check(OI(...A)),$.length=(...A)=>$.check(XI(...A)),$.nonempty=(...A)=>$.check(w4(1,...A)),$.lowercase=(A)=>$.check(U1(A)),$.uppercase=(A)=>$.check(D1(A)),$.trim=()=>$.check(X1()),$.normalize=(...A)=>$.check(O1(...A)),$.toLowerCase=()=>$.check(W1()),$.toUpperCase=()=>$.check(G1()),$.slugify=()=>$.check(Q1())}),L1=L("ZodString",($,I)=>{bI.init($,I),Yb.init($,I),$.email=(U)=>$.check(_w(Bb,U)),$.url=(U)=>$.check(N0(Y0,U)),$.jwt=(U)=>$.check(aw(Pb,U)),$.emoji=(U)=>$.check(hw(Jb,U)),$.guid=(U)=>$.check(b0(X0,U)),$.uuid=(U)=>$.check(Cw(i6,U)),$.uuidv4=(U)=>$.check(Zw(i6,U)),$.uuidv6=(U)=>$.check(gw(i6,U)),$.uuidv7=(U)=>$.check(xw(i6,U)),$.nanoid=(U)=>$.check(fw(Hb,U)),$.guid=(U)=>$.check(b0(X0,U)),$.cuid=(U)=>$.check(yw(Lb,U)),$.cuid2=(U)=>$.check(uw(zb,U)),$.ulid=(U)=>$.check(lw(Mb,U)),$.base64=(U)=>$.check(dw(Sb,U)),$.base64url=(U)=>$.check(pw(jb,U)),$.xid=(U)=>$.check(cw(Kb,U)),$.ksuid=(U)=>$.check(mw(vb,U)),$.ipv4=(U)=>$.check(rw(Vb,U)),$.ipv6=(U)=>$.check(nw(qb,U)),$.cidrv4=(U)=>$.check(iw(Fb,U)),$.cidrv6=(U)=>$.check(ow(Eb,U)),$.e164=(U)=>$.check(tw(kb,U)),$.datetime=(U)=>$.check(wB(U)),$.date=(U)=>$.check(bB(U)),$.time=(U)=>$.check(NB(U)),$.duration=(U)=>$.check(OB(U))});function Gb($){return ZQ(L1,$)}var Y$=L("ZodStringFormat",($,I)=>{Q$.init($,I),Yb.init($,I)}),Bb=L("ZodEmail",($,I)=>{ZG.init($,I),Y$.init($,I)});function fV($){return _w(Bb,$)}var X0=L("ZodGUID",($,I)=>{_G.init($,I),Y$.init($,I)});function yV($){return b0(X0,$)}var i6=L("ZodUUID",($,I)=>{CG.init($,I),Y$.init($,I)});function uV($){return Cw(i6,$)}function lV($){return Zw(i6,$)}function cV($){return gw(i6,$)}function mV($){return xw(i6,$)}var Y0=L("ZodURL",($,I)=>{gG.init($,I),Y$.init($,I)});function rV($){return N0(Y0,$)}function nV($){return N0(Y0,{protocol:/^https?$/,hostname:M6.domain,...S.normalizeParams($)})}var Jb=L("ZodEmoji",($,I)=>{xG.init($,I),Y$.init($,I)});function iV($){return hw(Jb,$)}var Hb=L("ZodNanoID",($,I)=>{hG.init($,I),Y$.init($,I)});function oV($){return fw(Hb,$)}var Lb=L("ZodCUID",($,I)=>{fG.init($,I),Y$.init($,I)});function dV($){return yw(Lb,$)}var zb=L("ZodCUID2",($,I)=>{yG.init($,I),Y$.init($,I)});function pV($){return uw(zb,$)}var Mb=L("ZodULID",($,I)=>{uG.init($,I),Y$.init($,I)});function tV($){return lw(Mb,$)}var Kb=L("ZodXID",($,I)=>{lG.init($,I),Y$.init($,I)});function aV($){return cw(Kb,$)}var vb=L("ZodKSUID",($,I)=>{cG.init($,I),Y$.init($,I)});function eV($){return mw(vb,$)}var Vb=L("ZodIPv4",($,I)=>{oG.init($,I),Y$.init($,I)});function sV($){return rw(Vb,$)}var vB=L("ZodMAC",($,I)=>{pG.init($,I),Y$.init($,I)});function $q($){return xQ(vB,$)}var qb=L("ZodIPv6",($,I)=>{dG.init($,I),Y$.init($,I)});function Iq($){return nw(qb,$)}var Fb=L("ZodCIDRv4",($,I)=>{tG.init($,I),Y$.init($,I)});function Uq($){return iw(Fb,$)}var Eb=L("ZodCIDRv6",($,I)=>{aG.init($,I),Y$.init($,I)});function Dq($){return ow(Eb,$)}var Sb=L("ZodBase64",($,I)=>{sG.init($,I),Y$.init($,I)});function Aq($){return dw(Sb,$)}var jb=L("ZodBase64URL",($,I)=>{$8.init($,I),Y$.init($,I)});function wq($){return pw(jb,$)}var kb=L("ZodE164",($,I)=>{I8.init($,I),Y$.init($,I)});function bq($){return tw(kb,$)}var Pb=L("ZodJWT",($,I)=>{U8.init($,I),Y$.init($,I)});function Nq($){return aw(Pb,$)}var z1=L("ZodCustomStringFormat",($,I)=>{D8.init($,I),Y$.init($,I)});function Oq($,I,U={}){return Y1(z1,$,I,U)}function Xq($){return Y1(z1,"hostname",M6.hostname,$)}function Wq($){return Y1(z1,"hex",M6.hex,$)}function Gq($,I){let U=I?.enc??"hex",A=`${$}_${U}`,D=M6[A];if(!D)throw new Error(`Unrecognized hash format: ${A}`);return Y1(z1,A,D,I)}var M1=L("ZodNumber",($,I)=>{kw.init($,I),t.init($,I),$._zod.processJSONSchema=(A,D,w)=>vY($,A,D,w),$.gt=(A,D)=>$.check(n6(A,D)),$.gte=(A,D)=>$.check(p$(A,D)),$.min=(A,D)=>$.check(p$(A,D)),$.lt=(A,D)=>$.check(r6(A,D)),$.lte=(A,D)=>$.check(W6(A,D)),$.max=(A,D)=>$.check(W6(A,D)),$.int=(A)=>$.check(Qb(A)),$.safe=(A)=>$.check(Qb(A)),$.positive=(A)=>$.check(n6(0,A)),$.nonnegative=(A)=>$.check(p$(0,A)),$.negative=(A)=>$.check(r6(0,A)),$.nonpositive=(A)=>$.check(W6(0,A)),$.multipleOf=(A,D)=>$.check(Z4(A,D)),$.step=(A,D)=>$.check(Z4(A,D)),$.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 VB($){return cQ(M1,$)}var GI=L("ZodNumberFormat",($,I)=>{A8.init($,I),M1.init($,I)});function Qb($){return rQ(GI,$)}function Qq($){return nQ(GI,$)}function Yq($){return iQ(GI,$)}function Bq($){return oQ(GI,$)}function Jq($){return dQ(GI,$)}var K1=L("ZodBoolean",($,I)=>{aU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>VY($,U,A,D)});function qB($){return pQ(K1,$)}var v1=L("ZodBigInt",($,I)=>{Pw.init($,I),t.init($,I),$._zod.processJSONSchema=(A,D,w)=>qY($,A,D,w),$.gte=(A,D)=>$.check(p$(A,D)),$.min=(A,D)=>$.check(p$(A,D)),$.gt=(A,D)=>$.check(n6(A,D)),$.gte=(A,D)=>$.check(p$(A,D)),$.min=(A,D)=>$.check(p$(A,D)),$.lt=(A,D)=>$.check(r6(A,D)),$.lte=(A,D)=>$.check(W6(A,D)),$.max=(A,D)=>$.check(W6(A,D)),$.positive=(A)=>$.check(n6(BigInt(0),A)),$.negative=(A)=>$.check(r6(BigInt(0),A)),$.nonpositive=(A)=>$.check(W6(BigInt(0),A)),$.nonnegative=(A)=>$.check(p$(BigInt(0),A)),$.multipleOf=(A,D)=>$.check(Z4(A,D));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function Hq($){return aQ(v1,$)}var Rb=L("ZodBigIntFormat",($,I)=>{w8.init($,I),v1.init($,I)});function Lq($){return sQ(Rb,$)}function zq($){return $Y(Rb,$)}var FB=L("ZodSymbol",($,I)=>{b8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>FY($,U,A,D)});function Mq($){return IY(FB,$)}var EB=L("ZodUndefined",($,I)=>{N8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>SY($,U,A,D)});function Kq($){return UY(EB,$)}var SB=L("ZodNull",($,I)=>{O8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>EY($,U,A,D)});function jB($){return DY(SB,$)}var kB=L("ZodAny",($,I)=>{X8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>PY($,U,A,D)});function vq(){return AY(kB)}var PB=L("ZodUnknown",($,I)=>{W8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>RY($,U,A,D)});function WI(){return wY(PB)}var RB=L("ZodNever",($,I)=>{G8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>kY($,U,A,D)});function Tb($){return bY(RB,$)}var TB=L("ZodVoid",($,I)=>{Q8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>jY($,U,A,D)});function Vq($){return NY(TB,$)}var B0=L("ZodDate",($,I)=>{Y8.init($,I),t.init($,I),$._zod.processJSONSchema=(A,D,w)=>TY($,A,D,w),$.min=(A,D)=>$.check(p$(A,D)),$.max=(A,D)=>$.check(W6(A,D));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function qq($){return OY(B0,$)}var _B=L("ZodArray",($,I)=>{B8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>mY($,U,A,D),$.element=I.element,$.min=(U,A)=>$.check(w4(U,A)),$.nonempty=(U)=>$.check(w4(1,U)),$.max=(U,A)=>$.check(OI(U,A)),$.length=(U,A)=>$.check(XI(U,A)),$.unwrap=()=>$.element});function J0($,I){return GY(_B,$,I)}function Fq($){let I=$._zod.def.shape;return Cb(Object.keys(I))}var H0=L("ZodObject",($,I)=>{J8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>rY($,U,A,D),S.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>Cb(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:WI()}),$.loose=()=>$.clone({...$._zod.def,catchall:WI()}),$.strict=()=>$.clone({...$._zod.def,catchall:Tb()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return S.extend($,U)},$.safeExtend=(U)=>{return S.safeExtend($,U)},$.merge=(U)=>S.merge($,U),$.pick=(U)=>S.pick($,U),$.omit=(U)=>S.omit($,U),$.partial=(...U)=>S.partial(gb,$,U[0]),$.required=(...U)=>S.required(xb,$,U[0])});function Eq($,I){let U={type:"object",shape:$??{},...S.normalizeParams(I)};return new H0(U)}function Sq($,I){return new H0({type:"object",shape:$,catchall:Tb(),...S.normalizeParams(I)})}function jq($,I){return new H0({type:"object",shape:$,catchall:WI(),...S.normalizeParams(I)})}var L0=L("ZodUnion",($,I)=>{eU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>Ab($,U,A,D),$.options=I.options});function _b($,I){return new L0({type:"union",options:$,...S.normalizeParams(I)})}var CB=L("ZodXor",($,I)=>{L0.init($,I),H8.init($,I),$._zod.processJSONSchema=(U,A,D)=>Ab($,U,A,D),$.options=I.options});function kq($,I){return new CB({type:"union",options:$,inclusive:!1,...S.normalizeParams(I)})}var ZB=L("ZodDiscriminatedUnion",($,I)=>{L0.init($,I),L8.init($,I)});function Pq($,I,U){return new ZB({type:"union",options:I,discriminator:$,...S.normalizeParams(U)})}var gB=L("ZodIntersection",($,I)=>{z8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>nY($,U,A,D)});function xB($,I){return new gB({type:"intersection",left:$,right:I})}var hB=L("ZodTuple",($,I)=>{Rw.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>iY($,U,A,D),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function fB($,I,U){let A=I instanceof o,D=A?U:I;return new hB({type:"tuple",items:$,rest:A?I:null,...S.normalizeParams(D)})}var z0=L("ZodRecord",($,I)=>{M8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>oY($,U,A,D),$.keyType=I.keyType,$.valueType=I.valueType});function yB($,I,U){return new z0({type:"record",keyType:$,valueType:I,...S.normalizeParams(U)})}function Rq($,I,U){let A=o$($);return A._zod.values=void 0,new z0({type:"record",keyType:A,valueType:I,...S.normalizeParams(U)})}function Tq($,I,U){return new z0({type:"record",keyType:$,valueType:I,mode:"loose",...S.normalizeParams(U)})}var uB=L("ZodMap",($,I)=>{K8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>lY($,U,A,D),$.keyType=I.keyType,$.valueType=I.valueType});function _q($,I,U){return new uB({type:"map",keyType:$,valueType:I,...S.normalizeParams(U)})}var lB=L("ZodSet",($,I)=>{v8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>cY($,U,A,D),$.min=(...U)=>$.check(g4(...U)),$.nonempty=(U)=>$.check(g4(1,U)),$.max=(...U)=>$.check(NI(...U)),$.size=(...U)=>$.check($1(...U))});function Cq($,I){return new lB({type:"set",valueType:$,...S.normalizeParams(I)})}var H1=L("ZodEnum",($,I)=>{V8.init($,I),t.init($,I),$._zod.processJSONSchema=(A,D,w)=>_Y($,A,D,w),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(A,D)=>{let w={};for(let b of A)if(U.has(b))w[b]=I.entries[b];else throw new Error(`Key ${b} not found in enum`);return new H1({...I,checks:[],...S.normalizeParams(D),entries:w})},$.exclude=(A,D)=>{let w={...I.entries};for(let b of A)if(U.has(b))delete w[b];else throw new Error(`Key ${b} not found in enum`);return new H1({...I,checks:[],...S.normalizeParams(D),entries:w})}});function Cb($,I){let U=Array.isArray($)?Object.fromEntries($.map((A)=>[A,A])):$;return new H1({type:"enum",entries:U,...S.normalizeParams(I)})}function Zq($,I){return new H1({type:"enum",entries:$,...S.normalizeParams(I)})}var cB=L("ZodLiteral",($,I)=>{q8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>CY($,U,A,D),$.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 gq($,I){return new cB({type:"literal",values:Array.isArray($)?$:[$],...S.normalizeParams(I)})}var mB=L("ZodFile",($,I)=>{F8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>xY($,U,A,D),$.min=(U,A)=>$.check(g4(U,A)),$.max=(U,A)=>$.check(NI(U,A)),$.mime=(U,A)=>$.check(N1(Array.isArray(U)?U:[U],A))});function xq($){return QY(mB,$)}var rB=L("ZodTransform",($,I)=>{E8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>uY($,U,A,D),$._zod.parse=(U,A)=>{if(A.direction==="backward")throw new DI($.constructor.name);U.addIssue=(w)=>{if(typeof w==="string")U.issues.push(S.issue(w,U.value,I));else{let b=w;if(b.fatal)b.continue=!1;b.code??(b.code="custom"),b.input??(b.input=U.value),b.inst??(b.inst=$),U.issues.push(S.issue(b))}};let D=I.transform(U.value,U);if(D instanceof Promise)return D.then((w)=>{return U.value=w,U});return U.value=D,U}});function Zb($){return new rB({type:"transform",transform:$})}var gb=L("ZodOptional",($,I)=>{S8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>UB($,U,A,D),$.unwrap=()=>$._zod.def.innerType});function W0($){return new gb({type:"optional",innerType:$})}var nB=L("ZodNullable",($,I)=>{j8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>dY($,U,A,D),$.unwrap=()=>$._zod.def.innerType});function G0($){return new nB({type:"nullable",innerType:$})}function hq($){return W0(G0($))}var iB=L("ZodDefault",($,I)=>{k8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>tY($,U,A,D),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function oB($,I){return new iB({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():S.shallowClone(I)}})}var dB=L("ZodPrefault",($,I)=>{P8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>aY($,U,A,D),$.unwrap=()=>$._zod.def.innerType});function pB($,I){return new dB({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():S.shallowClone(I)}})}var xb=L("ZodNonOptional",($,I)=>{R8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>pY($,U,A,D),$.unwrap=()=>$._zod.def.innerType});function tB($,I){return new xb({type:"nonoptional",innerType:$,...S.normalizeParams(I)})}var aB=L("ZodSuccess",($,I)=>{T8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>hY($,U,A,D),$.unwrap=()=>$._zod.def.innerType});function fq($){return new aB({type:"success",innerType:$})}var eB=L("ZodCatch",($,I)=>{_8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>eY($,U,A,D),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function sB($,I){return new eB({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var $7=L("ZodNaN",($,I)=>{C8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>ZY($,U,A,D)});function yq($){return WY($7,$)}var hb=L("ZodPipe",($,I)=>{Z8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>sY($,U,A,D),$.in=I.in,$.out=I.out});function Q0($,I){return new hb({type:"pipe",in:$,out:I})}var fb=L("ZodCodec",($,I)=>{hb.init($,I),sU.init($,I)});function uq($,I,U){return new fb({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var I7=L("ZodReadonly",($,I)=>{g8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>$B($,U,A,D),$.unwrap=()=>$._zod.def.innerType});function U7($){return new I7({type:"readonly",innerType:$})}var D7=L("ZodTemplateLiteral",($,I)=>{x8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>gY($,U,A,D)});function lq($,I){return new D7({type:"template_literal",parts:$,...S.normalizeParams(I)})}var A7=L("ZodLazy",($,I)=>{y8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>DB($,U,A,D),$.unwrap=()=>$._zod.def.getter()});function w7($){return new A7({type:"lazy",getter:$})}var b7=L("ZodPromise",($,I)=>{f8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>IB($,U,A,D),$.unwrap=()=>$._zod.def.innerType});function cq($){return new b7({type:"promise",innerType:$})}var N7=L("ZodFunction",($,I)=>{h8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>yY($,U,A,D)});function mq($){return new N7({type:"function",input:Array.isArray($?.input)?fB($?.input):$?.input??J0(WI()),output:$?.output??WI()})}var M0=L("ZodCustom",($,I)=>{u8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,A,D)=>fY($,U,A,D)});function rq($){let I=new J$({check:"custom"});return I._zod.check=$,I}function nq($,I){return YY(M0,$??(()=>!0),I)}function O7($,I={}){return BY(M0,$,I)}function X7($){return JY($)}var iq=HY,oq=LY;function dq($,I={error:`Input not instance of ${$.name}`}){let U=new M0({type:"custom",check:"custom",fn:(A)=>A instanceof $,abort:!0,...S.normalizeParams(I)});return U._zod.bag.Class=$,U}var pq=(...$)=>zY({Codec:fb,Boolean:K1,String:L1},...$);function tq($){let I=w7(()=>{return _b([Gb($),VB(),qB(),jB(),J0(I),yB(Gb(),I)])});return I}function aq($,I){return Q0(Zb($),I)}var Ju={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 Hu($){k$({customError:$})}function Lu(){return k$().customError}var W7;(function($){})(W7||(W7={}));var _={...O0,...bb,iso:J1};function zu($,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 Mu($,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 A=I.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===A){let D=U[1];if(!D||!I.defs[D])throw new Error(`Reference not found: ${$}`);return I.defs[D]}throw new Error(`Reference not found: ${$}`)}function eq($,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 D=$.$ref;if(I.refs.has(D))return I.refs.get(D);if(I.processing.has(D))return _.lazy(()=>{if(!I.refs.has(D))throw new Error(`Circular reference not resolved: ${D}`);return I.refs.get(D)});I.processing.add(D);let w=Mu(D,I),b=u$(w,I);return I.refs.set(D,b),I.processing.delete(D),b}if($.enum!==void 0){let D=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&D.length===1&&D[0]===null)return _.null();if(D.length===0)return _.never();if(D.length===1)return _.literal(D[0]);if(D.every((b)=>typeof b==="string"))return _.enum(D);let w=D.map((b)=>_.literal(b));if(w.length<2)return w[0];return _.union([w[0],w[1],...w.slice(2)])}if($.const!==void 0)return _.literal($.const);let U=$.type;if(Array.isArray(U)){let D=U.map((w)=>{let b={...$,type:w};return eq(b,I)});if(D.length===0)return _.never();if(D.length===1)return D[0];return _.union(D)}if(!U)return _.any();let A;switch(U){case"string":{let D=_.string();if($.format){let w=$.format;if(w==="email")D=D.check(_.email());else if(w==="uri"||w==="uri-reference")D=D.check(_.url());else if(w==="uuid"||w==="guid")D=D.check(_.uuid());else if(w==="date-time")D=D.check(_.iso.datetime());else if(w==="date")D=D.check(_.iso.date());else if(w==="time")D=D.check(_.iso.time());else if(w==="duration")D=D.check(_.iso.duration());else if(w==="ipv4")D=D.check(_.ipv4());else if(w==="ipv6")D=D.check(_.ipv6());else if(w==="mac")D=D.check(_.mac());else if(w==="cidr")D=D.check(_.cidrv4());else if(w==="cidr-v6")D=D.check(_.cidrv6());else if(w==="base64")D=D.check(_.base64());else if(w==="base64url")D=D.check(_.base64url());else if(w==="e164")D=D.check(_.e164());else if(w==="jwt")D=D.check(_.jwt());else if(w==="emoji")D=D.check(_.emoji());else if(w==="nanoid")D=D.check(_.nanoid());else if(w==="cuid")D=D.check(_.cuid());else if(w==="cuid2")D=D.check(_.cuid2());else if(w==="ulid")D=D.check(_.ulid());else if(w==="xid")D=D.check(_.xid());else if(w==="ksuid")D=D.check(_.ksuid())}if(typeof $.minLength==="number")D=D.min($.minLength);if(typeof $.maxLength==="number")D=D.max($.maxLength);if($.pattern)D=D.regex(new RegExp($.pattern));A=D;break}case"number":case"integer":{let D=U==="integer"?_.number().int():_.number();if(typeof $.minimum==="number")D=D.min($.minimum);if(typeof $.maximum==="number")D=D.max($.maximum);if(typeof $.exclusiveMinimum==="number")D=D.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")D=D.gt($.minimum);if(typeof $.exclusiveMaximum==="number")D=D.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")D=D.lt($.maximum);if(typeof $.multipleOf==="number")D=D.multipleOf($.multipleOf);A=D;break}case"boolean":{A=_.boolean();break}case"null":{A=_.null();break}case"object":{let D={},w=$.properties||{},b=new Set($.required||[]);for(let[O,X]of Object.entries(w)){let W=u$(X,I);D[O]=b.has(O)?W:W.optional()}if($.propertyNames){let O=u$($.propertyNames,I),X=$.additionalProperties&&typeof $.additionalProperties==="object"?u$($.additionalProperties,I):_.any();if(Object.keys(D).length===0){A=_.record(O,X);break}let W=_.object(D).passthrough(),Q=_.looseRecord(O,X);A=_.intersection(W,Q);break}if($.patternProperties){let O=$.patternProperties,X=Object.keys(O),W=[];for(let B of X){let Y=u$(O[B],I),J=_.string().regex(new RegExp(B));W.push(_.looseRecord(J,Y))}let Q=[];if(Object.keys(D).length>0)Q.push(_.object(D).passthrough());if(Q.push(...W),Q.length===0)A=_.object({}).passthrough();else if(Q.length===1)A=Q[0];else{let B=_.intersection(Q[0],Q[1]);for(let Y=2;Y<Q.length;Y++)B=_.intersection(B,Q[Y]);A=B}break}let N=_.object(D);if($.additionalProperties===!1)A=N.strict();else if(typeof $.additionalProperties==="object")A=N.catchall(u$($.additionalProperties,I));else A=N.passthrough();break}case"array":{let{prefixItems:D,items:w}=$;if(D&&Array.isArray(D)){let b=D.map((O)=>u$(O,I)),N=w&&typeof w==="object"&&!Array.isArray(w)?u$(w,I):void 0;if(N)A=_.tuple(b).rest(N);else A=_.tuple(b);if(typeof $.minItems==="number")A=A.check(_.minLength($.minItems));if(typeof $.maxItems==="number")A=A.check(_.maxLength($.maxItems))}else if(Array.isArray(w)){let b=w.map((O)=>u$(O,I)),N=$.additionalItems&&typeof $.additionalItems==="object"?u$($.additionalItems,I):void 0;if(N)A=_.tuple(b).rest(N);else A=_.tuple(b);if(typeof $.minItems==="number")A=A.check(_.minLength($.minItems));if(typeof $.maxItems==="number")A=A.check(_.maxLength($.maxItems))}else if(w!==void 0){let b=u$(w,I),N=_.array(b);if(typeof $.minItems==="number")N=N.min($.minItems);if(typeof $.maxItems==="number")N=N.max($.maxItems);A=N}else A=_.array(_.any());break}default:throw new Error(`Unsupported type: ${U}`)}if($.description)A=A.describe($.description);if($.default!==void 0)A=A.default($.default);return A}function u$($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=eq($,I),A=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let D=$.anyOf.map((b)=>u$(b,I)),w=_.union(D);U=A?_.intersection(U,w):w}if($.oneOf&&Array.isArray($.oneOf)){let D=$.oneOf.map((b)=>u$(b,I)),w=_.xor(D);U=A?_.intersection(U,w):w}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=A?U:_.any();else{let D=A?U:u$($.allOf[0],I),w=A?0:1;for(let b=w;b<$.allOf.length;b++)D=_.intersection(D,u$($.allOf[b],I));U=D}if($.nullable===!0&&I.version==="openapi-3.0")U=_.nullable(U);if($.readOnly===!0)U=_.readonly(U);return U}function sq($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=zu($,I?.defaultTarget),A=$.$defs||$.definitions||{};return u$($,{version:U,defs:A,refs:new Map,processing:new Set,rootSchema:$})}var G7={};K6(G7,{string:()=>Ku,number:()=>vu,date:()=>Fu,boolean:()=>Vu,bigint:()=>qu});function Ku($){return gQ(L1,$)}function vu($){return mQ(M1,$)}function Vu($){return tQ(K1,$)}function qu($){return eQ(v1,$)}function Fu($){return XY(B0,$)}k$($0());var N4=G.enum(["document","record"]),yb=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],ub=["literature","document","record","annotation","artifact"],lb=["molecule","reaction"],V1=50,cb=50;var Q7=G.object({blockType:G.enum(yb).default("paragraph").describe("Type of block to create. Default: paragraph"),content:G.string().describe("Text content for the block"),headingLevel:G.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:G.boolean().optional().describe("Checked state for checkListItem"),title:G.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:G.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:G.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:G.enum(ub).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:G.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:G.string().optional().describe("Cached title of the linked entity"),doi:G.string().optional().describe("DOI for literature references"),smiles:G.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:G.enum(lb).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:G.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:G.string().optional().describe("Optional description or notes for the molecule block"),matrixId:G.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:G.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:G.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:G.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:G.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=G.enum(["text","number","unit","select","boolean"]),Su=G.enum(["mandatory","recommended","optional"]),$F=G.object({key:G.string().min(1).describe("Stable column key"),label:G.string().min(1).describe("Human-readable column label"),type:Eu.describe("Column type"),unit:G.string().optional().describe("Optional display unit"),mandation:Su.describe("Field importance level"),description:G.string().optional().describe("Optional field description"),standardRef:G.string().optional().describe("Optional ontology reference"),options:G.array(G.string()).optional().describe("Allowed values for select columns"),hidden:G.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`).")}),q1=G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.null()])),IF=G.enum(["generic","stoichiometry"]),Y7=G.object({entityType:N4.describe('Entity type: "document" or "record"'),entityId:G.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:G.string().min(1).describe("Matrix label shown in the editor"),columns:G.array($F).max(V1).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:G.array(q1).optional().describe("Matrix rows"),nodeRef:G.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:G.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:G.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:G.string().optional().describe("Insert as CHILD of this container block"),childPosition:G.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:G.boolean().optional().default(!0).describe("Whether the structured matrix block should show its preview")}).refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{if($.kind==="stoichiometry")return!0;return($.columns?.length??0)>=1},{message:'`columns` is required for `kind="generic"` (omit or use `kind="stoichiometry"` for the preset).',path:["columns"]}),K0={name:"insert_matrix",description:"Create a structured data matrix AND insert its linked `structuredMatrix` block in one call.\n\nThe tool performs two writes atomically from the agent's perspective:\n1. Insert a new `data_matrices` row (columns + rows + label). The row starts at `version: 0`; all subsequent edits go through the `*_matrix_rows` / `rebind_matrix_to_node` / `delete_matrix` tools and each bumps `version`.\n2. Insert a `structuredMatrix` block referencing the new matrix id.\n\nTwo binding modes (both valid for records and documents):\n- **Body-level (default)**: omit `nodeRef`. The matrix belongs to the entity and the block lives at the top-level of the document/record body. Use this for free-standing tabular data (reagent inventory, condition sets attached to the whole experiment, etc).\n- **Node-attached**: pass `nodeRef` = procedure node UUID (records only). The matrix is logically scoped to that node and surfaces in `list_procedure_nodes` under that node's `matrixCount`. Use this when the matrix captures data produced inside a specific procedure step (e.g. readings per screening condition).\n\n**Typed presets via `kind`:**\n- `kind=\"generic\"` (default): supply your own `columns`.\n- `kind=\"stoichiometry\"`: choose this whenever you want reaction stoichiometry semantics — mixing reactants, reagents, solvents, catalysts, products and deriving the missing quantities. `columns` is ignored; the server fills the stoichiometry preset (Compound, Role, Phase, Equiv, Limiting, M, ρ, Purity, Stock c, Stock wt%, V, m, n, c, plus three hidden columns: `compoundId` linking to a `chemical` artifact, `cBasis` controlling how `c` is computed, and `cBasisManualVolume` for manual-basis rows).\n - Row shape: `{ compound, compoundId?, role, phase?, equiv?, limiting?, molecularWeight?, density?, purity?, stockMolarity?, stockWtPercent?, volume?, mass?, moles?, concentration?, cBasis?, cBasisManualVolume? }`.\n - **Phase grouping** (`phase` column): free-form text label that groups rows for per-phase volume totals. Use for biphasic syntheses (e.g. `phase: \"aqueous\"` vs `phase: \"oil\"`) or to sum per-mixture volumes within a single-pot reaction (e.g. `phase: \"aqueous\"` for water + dissolved CTAC + TEA). Leave blank for single-phase matrices. The UI renders a totals strip below the table; agents can read back via `get_content` to verify mass/volume balance per phase.\n - **Client-side calc engine auto-derives empty cells on every render. Do NOT pre-compute values you can leave null.** The identities propagated are: `n = m / M`, `n = V · c`, `m = V · ρ · purity` (neat liquids), `n = stockMolarity · V` (aqueous stock), `n = stockWtPercent · ρ_soln · V / M` (wt%-labelled stock), `n_i = equiv_i · n_limiting` (by row), and the reverse `equiv_i = n_i / n_limiting` (so molar ratios surface even when the user only entered masses). Derivation respects user-entered values — any non-null cell is treated as locked and never overwritten.\n - Limiting reactant: set `limiting: true` on exactly one reactant row (the engine also auto-picks the first reactant with enough info if none is flagged). Other reactants should carry `equiv` (molar ratio relative to limiting).\n - Units are fixed: M in g/mol, ρ in g/mL, V in mL, m in g, n in mmol, c in mol/L, purity as a decimal fraction (0–1), stockMolarity in mol/L, stockWtPercent in 0–100.\n - **Stock solution inputs**: for aqueous reagents (e.g. \"2 M NaOH\", \"25 wt% CTAC\"), prefer `stockMolarity` or `stockWtPercent` over `purity`. `purity` describes the dissolved compound itself (a neat liquid descriptor); `stockMolarity`/`stockWtPercent` describe the solution. Use only one of stockMolarity / stockWtPercent per row.\n - **Concentration basis** (`cBasis`, `cBasisManualVolume`): the displayed `c` is `n / V_ref` where the reference volume is picked per row. Defaults — solvent rows use `\"none\"` (c blank), non-solvent rows with a `phase` tag use `\"phase\"` (c relative to V_phase), other non-solvent rows use `\"total\"` (c relative to V_total). Leave `cBasis` null to inherit the default; explicit values are `\"none\" | \"phase\" | \"total\" | \"manual\"`. `\"manual\"` requires `cBasisManualVolume` (mL) and uses that as V_ref. Don't set these unless the user has chosen a non-default basis.\n - Minimal pattern for a reaction: one reactant with `{ role: 'reactant', limiting: true, equiv: 1, molecularWeight, mass OR volume }`; additional reactants with `{ role: 'reactant', equiv, molecularWeight }` (cells left null; the engine fills them from the limiting moles).\n\nIf a procedure node is later deleted, its matrices' `nodeRef` is cleared to null (FK `ON DELETE SET NULL`) and they surface in `list_procedure_nodes` as orphans — rebind via `rebind_matrix_to_node` or drop via `delete_matrix`.\n\nPositioning for the block:\n- `afterBlockId`: insert as SIBLING after the specified block\n- `beforeBlockId`: insert as SIBLING before the specified block\n- `parentBlockId`: insert as CHILD of a container block (e.g. inside a procedure section)\n- Omit all three: append the block at the end of the document. Safe for parallel `insert_matrix` calls — each one appends after the current tail, so agents can batch inserts instead of serialising on `afterBlockId`.\n\nExamples:\n- Body-level matrix appended after an existing block:\n `insert_matrix(entityType=\"record\", entityId=\"...\", afterBlockId=\"...\", label=\"Aqueous phase composition\", columns=[...], rows=[...])`\n- Node-attached matrix nested inside a procedure section:\n `insert_matrix(entityType=\"record\", entityId=\"...\", parentBlockId=\"...\", childPosition=\"last\", label=\"Screening Matrix\", columns=[...], rows=[...], nodeRef=\"...\")`\n\n**Record draft-gate:** matrices on records require the record to be in `draft` status. `completed` / `locked` records return a structured `record_not_draft` error — stop and surface it to the user; agents cannot flip record status themselves."};var B7=G.object({matrixId:G.string().uuid().describe("UUID of the target data_matrix."),rows:G.array(q1).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:G.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 J7=G.object({matrixId:G.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:G.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:G.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:G.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:G.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),V0={name:"attach_matrix",description:["Bind a workspace-owned (orphan) matrix to a provenance owner. Matrices become workspace-owned when their original record/document is deleted — the trigger promotes them instead of cascading. This tool claims them back to a new record or artifact in the same workspace.","Workspace match is enforced server-side: the owner entity MUST live in the same workspace as the matrix. Cross-workspace attach returns an `invalid_matrix_owner` error.","If `nodeRef` is provided and `entityType` is `record`, the matrix is also bound to that procedure node in the same call (combines attach + rebind). The node must belong to the target record.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error.","Only draft records are writable; attaching to a completed/locked record returns `record_not_draft`.","Use `list_matrix_references` first if you want to see which documents/records embed the matrix before attaching."].join(" ")};var F1=G.enum(["procedure","characterization","observation","step"]),E1=G.object({type:G.literal("file"),target:G.enum(["local","server","url"]),path:G.string().min(1),format:G.string().min(1),label:G.string().min(1),instrument:G.string().optional(),metadata:G.record(G.string(),G.union([G.string(),G.number(),G.boolean()])).optional()}),UF=G.object({artifactId:G.string().uuid(),role:G.enum(["input","output","derived_from","referenced"]),context:G.record(G.string(),G.unknown()).optional()}),DF=G.object({matrixId:G.string().uuid()}),q0=G.object({tempId:G.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:G.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:G.string().min(1).describe("Human-readable node label."),type:F1.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:G.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:G.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:G.array(E1).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:G.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:G.array(DF).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:G.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 AF=G.enum(["replace","append"]),H7=G.object({recordId:G.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:G.array(q0).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:AF.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:G.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:G.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 wF=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],ju=["molecule","material","mixture","biomacromolecule"],X6$=G.enum(ju),bF=["active","depleted","archived","draft"],mb=G.enum(wF),S1=G.enum(bF),ku=G.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.'),L7=G.object({id:G.string().uuid().describe("UUID of the artifact to update."),name:G.string().min(1).optional().describe("Display name (skip to keep existing)."),description:G.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:G.array(G.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:G.record(G.string(),G.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:mb.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:S1.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:G.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:G.string().optional().describe("Free-form physical/logical location."),parentId:G.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:G.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)."}),E0={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 NF=G.object({cid:G.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:G.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:G.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:G.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"}),z7=G.object({name:G.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:mb.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:G.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:G.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:G.string().optional().describe("Plain-text description."),tags:G.array(G.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:G.record(G.string(),G.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:S1.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:G.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:G.string().optional().describe("Free-form physical/logical location."),parentId:G.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:G.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:G.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:NF.optional().describe('When set and artifactType is "chemical" with structureClass molecule (or absent), resolve the identifier (cid > inchiKey > cas > name) and auto-fill missing properties from PubChem. Agent-supplied properties always win — enrichment never overwrites. PubChem does NOT index periodic materials, mixtures, biomacromolecules, or reactions, so this is a no-op (logged) for those classes. Failures (no match, PubChem unreachable) do NOT block creation; the artifact is still created with whatever was provided, and the enrichment status is reported in the result.'),linkToNode:G.object({nodeId:G.string().uuid(),role:G.enum(["input","output","derived_from","referenced"]),context:G.record(G.string(),G.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.")}),S0={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 M7=G.object({title:G.string().min(1).max(500).describe("Title for the new document"),content:G.string().optional().describe("Optional initial content in markdown format"),organizationId:G.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:G.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:G.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:G.array(G.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.")}),j0={name:"create_document",description:"Create a new document. By default the document is private to the user in their current workspace. Pass `spaceId` to create it inside a specific space (shared with space members); workspace and organization are then derived from the space automatically. Use this when the user asks you to create a new document, draft, or note. You can optionally provide initial content in markdown format."};var K7=G.object({title:G.string().min(1).max(500).describe("Paper title"),doi:G.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:G.array(G.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:G.string().optional().describe("Journal name"),year:G.number().int().positive().optional().describe("Publication year"),sourceUrl:G.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:G.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:G.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:G.string().uuid().optional().describe("Space within workspace"),fetchFullText:G.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:G.array(G.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).")}),k0={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 v7=G.object({artifactId:G.string().uuid().describe("UUID of the source artifact to derive the matrix from. Reaction artifacts synthesize a stoichiometry matrix from their typed `linkSlots`; other artifact types (protocols, equipment, …) copy a column schema from one of their attached matrices."),workspaceId:G.string().uuid().describe("Workspace scope. Must match the source artifact and (if provided) the target entity."),entityType:G.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:G.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:G.string().uuid().optional().describe('Procedure node UUID. When set with `entityType: "record"` AND the source is a reaction artifact, also ensures a procedure_node ↔ reaction artifact link exists (idempotent — duplicate calls are safe).'),matrixId:G.string().uuid().optional().describe("Optional: UUID of a specific matrix attached to the source artifact to copy from. REQUIRED when the source artifact has multiple attached matrices (non-reaction sources). Passing it on a reaction artifact forces the column-copy path instead of the synthesize-from-linkSlots default."),label:G.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>" for reaction sources, or the source matrix label for column-copy sources.')}),P0={name:"create_matrix_from_artifact",description:["Spawn a new matrix from a source artifact. Two modes, auto-selected by source artifact type (override with `matrixId`):","(1) **Reaction artifact** (default for `artifactType: \"reaction\"`): walks the artifact's typed `linkSlots` (reactant / product / reagent / catalyst / solvent), pulls each linked chemical artifact's name + MW + density, and emits one stoichiometry row per bound slot using the slot's `stoichCoefficient`. Slots without a `defaultArtifactId` are skipped — fill those by hand on the derived matrix.","(2) **Column-copy** (any artifact with attached matrices — protocols, equipment, custom artifact types, or reaction artifacts when `matrixId` is passed): copies the column schema (NOT the rows — pure template) from one of the source artifact's attached matrices to a new matrix on the target. The agent fills the rows. If the source artifact has multiple attached matrices and `matrixId` is omitted, the call returns a structured `ambiguous_matrix_selection` error listing the available matrix IDs so the agent can re-call with a selector. If the source has zero attached matrices and is not a reaction, returns `no_matrices_on_artifact`.","In both modes, `derivedFromArtifactId` is stamped on the new matrix for provenance. Frozen invariant: edits to the source artifact / matrix never propagate forward; this is a one-shot copy at instantiation time.",'When `entityType: "record"` + `nodeRef` are set AND the source is a reaction artifact, 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."',"Returns the new matrix in the same shape as `insert_matrix`."].join(" ")};var V7=G.object({title:G.string().min(1).max(500).describe("Title for the new record."),organizationId:G.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:G.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:G.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:G.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:G.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:G.array(G.string().uuid()).optional().describe("User ids participating in this research activity."),tags:G.array(G.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:G.array(q0).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 rb=G.object({entityType:N4.describe('Entity type: "document" or "record"'),entityId:G.string().uuid().describe("Document or record ID"),blockId:G.string().optional().describe("Block ID to delete (for single delete)"),blockIds:G.array(G.string()).max(cb).optional().describe(`Array of block IDs to delete (batch mode, max ${cb})`)}),Pu=rb.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 q7=G.object({matrixId:G.string().uuid().describe("UUID of the matrix to delete."),version:G.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:G.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=G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),F7=G.object({matrixId:G.string().uuid().describe("UUID of the target data_matrix."),rowIndices:G.array(G.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:G.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}).refine(($)=>{let I=$.rowIndices!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndices` (absolute indices) or `rowMatch` (by column values).",path:["rowIndices"]}),C0={name:"delete_matrix_rows",description:["Remove rows from an existing data matrix, either by absolute `rowIndices` or by `rowMatch` (every column/value in the match must equal the row's current cell). Match mode deletes every row that satisfies the criteria.","**`rowMatch` MUST use `col.key` as each object key, NOT `col.label`** — the schema is visible via `get_content` on the owning entity (`cols: key(Label,type[,unit])` + `{key1,key2,...}` row header).","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","To remove the matrix itself (row + structuredMatrix block) use `delete_matrix`. This tool only prunes rows.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var E7=G.object({nodeId:G.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:G.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).")}),Z0={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 P$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let A=String(U);return A.includes(",")?`"${A}"`:A}).join(",")}`}function nb($){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 XF($,I,U=150){let A=0,D=Math.min($.length,I.length);while(A<D&&$[A]===I[A])A++;let w=0;while(w<D-A&&$.at(1+w)===I.at(1+w))w++;let b=Math.floor(U/2),N=Math.max(0,A-b),O=Math.min($.length,$.length-w+b),X=Math.min(I.length,I.length-w+b),W=N>0?"...":"",Q=O<$.length?"...":"",B=X<I.length?"...":"",Y=`${W}${$.slice(N,O)}${Q}`,J=`${W}${I.slice(N,X)}${B}`;return`--- before
65
+ ${Y}
66
66
  +++ after
67
- ${A}`}function SB($){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 PB($){let{mode:I,found:U,hasMore:b}=$;if(U===0)return`[results:0 found, ${I}]
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 NF($){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 _u($){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 JF($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function EB($){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=JF(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 kB($){if(!$.found)return JSON.stringify({found:!1,error:$.error??"Entity not found"});let I=[],U=$.root,b=U?JF(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 EB(G))I.push(Y)}return I.join(`
74
- `)}function RB($){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(NF($.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(_u($.overview.regions))}}if($.procedureTree)I.push(""),I.push("**Procedure Tree:**"),I.push($.procedureTree);if($.edges&&$.edges.length>0){let U=$.edges.filter((w)=>w.direction==="forward"),b=$.edges.filter((w)=>w.direction==="inverse");if(I.push(""),I.push(`**Connections** (${$.edges.length} edges):`),U.length>0){I.push(""),I.push("*Outgoing (this entity → others):*");for(let w of U)for(let X of EB(w))I.push(X)}if(b.length>0){I.push(""),I.push("*Incoming (others this entity):*");for(let w of b)for(let X of EB(w))I.push(X)}}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 TB($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
67
+ ${J}`}function S7($){let I=[];I.push(`[workspace context | default org:${$.defaults.orgId}${$.defaults.workspaceId?` ws:${$.defaults.workspaceId}`:""}]`);let U=0,A=[];for(let D of $.orgs)for(let w of D.workspaces)if(w.spaces.length===0)A.push(P$([D.name,D.id,w.name,w.id,w.type,"","",""])),U++;else for(let b of w.spaces)A.push(P$([D.name,D.id,w.name,w.id,w.type,b.name,b.id,b.type])),U++;return I.push(`{org,orgId,workspace,wsId,wsType,space,spaceId,spaceType}[${U}]:`),I.push(...A),I.join(`
68
+ `)}function j7($){let{mode:I,found:U,hasMore:A}=$;if(U===0)return`[results:0 found, ${I}]
69
+ No results.`;let D=[I,...A?["hasMore"]:[]].join(", "),w=[`[results:${U} found, ${D}]`];if(I==="library"){let b=$.results,N=b.some((Q)=>Q.literatureMetadata),O=b.some((Q)=>Q.creatorName),X=N?"{type,title,id,relevance,tags,doi,firstAuthor,year,journal":"{type,title,id,relevance,tags",W=O?`${X},creator,snippet}`:`${X},snippet}`;w.push(`${W}[${b.length}]:`);for(let Q of b){let B=Q.bestSnippet??Q.snippet??"",Y=B.length>120?`${B.slice(0,117)}...`:B,J=Q.tags?.join(" | ")??"",H=Q.creatorName??"";if(N){let v=Q.literatureMetadata,V=[Q.entityType,Q.entityTitle,Q.entityId,Q.relevance,J,v?.doi??"",v?.firstAuthor??"",v?.year??"",v?.journal??""];if(O)V.push(H);V.push(Y),w.push(P$(V))}else{let v=[Q.entityType,Q.entityTitle,Q.entityId,Q.relevance,J];if(O)v.push(H);v.push(Y),w.push(P$(v))}}}else{let b=$.results,N=b.some((X)=>X.creatorName),O=N?"{type,title,entityId,blockId,creator,snippet}":"{type,title,entityId,blockId,snippet}";w.push(`${O}[${b.length}]:`);for(let X of b){let W=X.bestSnippet??X.snippet??"",Q=W.length>120?`${W.slice(0,117)}...`:W,B=[X.entityType,X.entityTitle,X.entityId,X.blockId];if(N)B.push(X.creatorName??"");B.push(Q),w.push(P$(B))}}return w.join(`
70
+ `)}function WF($){if($.length===0)return"";let I=[`[toc:${$.length} sections]`,`{title,level,tokens,ownTokens,blockId}[${$.length}]:`];for(let U of $)I.push(P$([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(P$([U.title,U.kind,U.estimatedTokens??0,U.blockCount,U.retrievalHint]));return I.join(`
72
+ `)}function GF($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function _u($){let I=[],U=$.direction==="forward"?"→":"←",A=$.direction==="forward"?"↗":"↙";if($.type==="annotation")A="\uD83D\uDCDD";else if($.type==="citation")A="\uD83D\uDCD6";let D=$.dstEntityType??$.dstScope,w=$.dstTitle||$.dstId.slice(0,8),b=GF(D,$.dstId),N=[$.type,$.direction,`via ${$.provenance}`];if(typeof $.weight==="number"&&$.weight>1)N.push(`shared by ${$.weight} records`);if(I.push(` ${A} ${U} ${D}: ${w} (${b}, ${N.join(" · ")})`),$.text)I.push(` "${$.text}"`);if($.snippet)I.push(` — ${$.snippet}`);return I}function k7($){if(!$.found)return JSON.stringify({found:!1,error:$.error??"Entity not found"});let I=[],U=$.root,A=U?GF(U.type,U.id):"unknown";I.push(`**Situated:** ${U?.type??"entity"} "${U?.title??""}" (${A})`);let D=[`depth ${$.depth??0}`,`${$.nodes?.length??0} nodes`,`${$.edges?.length??0} edges`];if($.truncated)D.push("truncated (busy hop — re-situate a specific node for more)");I.push(`*${D.join(" · ")}*`);let w=$.edges??[];if(w.length===0)return I.push(""),I.push("*No connections within the traversed depth.*"),I.join(`
73
+ `);let b=w.reduce((N,O)=>Math.max(N,O.hop),0);for(let N=1;N<=b;N++){let O=w.filter((X)=>X.hop===N);if(O.length===0)continue;I.push(""),I.push(`*Hop ${N}* (${O.length} edges):`);for(let X of O)for(let W of _u(X))I.push(W)}return I.join(`
74
+ `)}function P7($){let I=[];if(I.push(`**"${$.entityTitle}"** - ${$.entityType}`),$.creatorName)I.push(`*by ${$.creatorName}*`);if($.recordStatus)I.push(`*status: ${$.recordStatus}*`);if($.bibliographic){let U=$.bibliographic,A=[];if(U.authors?.length)A.push(U.authors.length<=3?U.authors.join(", "):`${U.authors[0]} et al.`);if(U.journal)A.push(U.journal);if(U.volume){let D=U.volume;if(U.issue)D+=`(${U.issue})`;if(U.pages)D+=`, ${U.pages}`;A.push(D)}if(U.year)A.push(String(U.year));if(A.length>0)I.push(A.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(WF($.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 R7($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
77
77
  Title: ${$.title}
78
- ID: ${$.documentId}`}function _B($){if(!$.success)return`Failed to import literature: ${$.error}`;if($.alreadyExisted){let U=`Already in library: ${$.title} (id: ${$.literatureId})`;if($.coreEnriched)return`${U}
78
+ ID: ${$.documentId}`}function T7($){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 ZB($){if(!$.success)return`Failed to insert matrix: ${$.error}`;return`Matrix inserted successfully.
83
+ Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function _7($){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 CB($){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 gB($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(YF($.originalText,$.updatedText));let U=nD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
88
-
89
- `)}function xB($){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
- `)}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 hB($){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
- `)}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 fB($){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
- `),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 yB($){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 uB($){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 lB($){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(cB($.schema));return U.join(`
96
- `)}function cB($){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 mB($){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 rB($){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(cB($.schema));return b.join(`
98
- `)}function nB($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function iB($){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 oB($){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 dB($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function pB($){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 tB($){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 aB($){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 eB($){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 sB($){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 $H($){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 IH($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function UH($){if(!$.success)return $.error??"update_edge failed";return`[edge typed | edgeId=${$.edgeId??""}, relation=${$.relationType??""}, direction=${$.direction??""}]`}function wH($){if(!$.success)return $.error??"update_artifact_link_relation failed";return`[link relation typed | artifactLinkId=${$.artifactLinkId??""}, relation=${$.relationType??""}, role=${$.role??""} (unchanged)]`}function bH($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function XH($){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 GF($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function DH($){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,GF(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?GF(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).")}),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:
86
+ Block ID: ${$.blockId}`}function C7($){if(!$.success){if($.errorCode==="ambiguous_matrix_selection"&&$.availableMatrices?.length){let D=$.availableMatrices.map((w)=>` - ${w.id} ${w.label}`).join(`
87
+ `);return[`Failed: ${$.error}`,"","Available matrices on this artifact:",D,"","Re-call with `matrixId` set to one of the above."].join(`
88
+ `)}return`Failed to create matrix from artifact: ${$.error}`}let I=$.rowsCreated??0,A=[`Matrix derived from artifact (${$.mode==="reaction"?"synthesized from linkSlots":"column-copied from source matrix"}).`,`Label: ${$.label}`,`Matrix ID: ${$.matrixId}`,`Source artifact ID: ${$.artifactId}`,`Rows created: ${I}`];if($.sourceMatrixId)A.push(`Source matrix ID: ${$.sourceMatrixId}`);if(I===0)if($.mode==="reaction")A.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.");else A.push("Note: rows are intentionally empty (pure template copy). Use append_matrix_rows to populate.");return A.join(`
89
+ `)}function Z7($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(XF($.originalText,$.updatedText));let U=nb($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
90
+
91
+ `)}function g7($){if(!$.success)return`Insert failed: ${$.error}`;if($.newBlockIds&&$.newBlockIds.length>0){let A=[`Inserted ${$.newBlockIds.length} blocks:`];if($.results){for(let D of $.results)if(D.success&&D.newBlockId){let w=D.blockType??"paragraph",b=D.contentPreview?`: ${D.contentPreview.slice(0,60)}${D.contentPreview.length>60?"...":""}`:"";A.push(` [${w} | ${D.newBlockId}]${b}`)}}return A.join(`
92
+ `)}let I=[`Block inserted. ID: ${$.newBlockId}`];if($.insertedBlock){let{blockType:A,content:D}=$.insertedBlock,w=D.length>200?`${D.slice(0,200)}...`:D;if(I.push(`Type: ${A}`),w)I.push(`Content: ${w}`)}let U=nb($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
93
+ `)}function x7($){if(!$.success)return`Delete failed: ${$.error}`;if($.deletedBlockIds&&$.deletedBlockIds.length>0){let A=[`Deleted ${$.deletedBlockIds.length} blocks:`];if($.results){for(let D of $.results)if(D.success){let w=D.blockType??"?",b=D.contentPreview?`: ${D.contentPreview.slice(0,60)}${D.contentPreview.length>60?"...":""}`:"";A.push(` [${w} | ${D.blockId}]${b}`)}}return A.join(`
94
+ `)}let I=[];if($.deletedBlock){let{blockType:A,contentPreview:D}=$.deletedBlock;if(I.push(`Deleted [${A} | ${$.deletedBlock.blockId}]`),D)I.push(`Was: ${D}`)}else I.push("Block deleted");let U=nb($.positionContext);if(U)I.push(`New adjacency: ${U}`);return I.join(`
95
+ `)}function h7($){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(`
96
+ `),U=$.nodeIdMap?Object.entries($.nodeIdMap):[];if(U.length===0)return I;let A=U.map(([D,w])=>P$([D,w]));return[I,"",`{tempId,nodeId}[${U.length}]:`,...A].join(`
97
+ `)}function f7($){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 y7($){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 u7($){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 A=$.enrichment.populatedKeys,D=A.length===0?"no fields filled (all already present)":`${A.length} field${A.length===1?"":"s"} filled: ${A.join(", ")}`;U.push(`[enrichment | source=pubchem, cid=${$.enrichment.cid}, ${D}]`)}else{let A=$.enrichment.detail?`, detail=${$.enrichment.detail}`:"";U.push(`[enrichment | source=none, reason=${$.enrichment.reason}${A}]`)}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 A=$.warnings.map((D)=>D.class?`${D.key}→${D.suggestion} (${D.class})`:`${D.key}→${D.suggestion}`).join(", ");U.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${A}]`)}if($.schema)U.push(l7($.schema));return U.join(`
98
+ `)}function l7($){let I=$.structureClass?`${$.artifactType}/${$.structureClass}`:$.artifactType,U=$.knownKeys.map((A)=>{let D=A.unit?`[${A.unit}]`:"",w=A.options&&A.options.length>0?`=${A.options.join("|")}`:"",b=A.auto?"*":"";return`${A.key}:${A.type}${D}${w}${b}`}).join(", ");return`[schema | type=${I}, knownKeys: ${U}]`}function c7($){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 D=($.links??[]).map((w)=>w.label?`${w.role}/${w.label}=${w.artifactId}`:`${w.role}=${w.artifactId}`).join(", ");I.push(`[links | ${U} slot${U===1?"":"s"} bound: ${D}]`)}let A=$.pendingSlots?.length??0;if(A>0){let D=($.pendingSlots??[]).map((w)=>{let b=w.filter?.artifactType?`:${w.filter.artifactType}${w.filter.structureClass?`/${w.filter.structureClass}`:""}`:"",N=w.label?`(${w.label})`:"";return`${w.role}${N}${b}`}).join(", ");I.push(`[pending_slots | ${A} slot${A===1?"":"s"} need binding: ${D}]`)}return I.join(`
99
+ `)}function m7($){if(!$.success)return $.error??"update_artifact failed";let I=$.updatedFields?.join(", ")??"no changes",U=$.propertyKeys?.length?`, propertyKeys=${$.propertyKeys.join("|")}`:"",A=[`[artifact updated | id=${$.artifactId??""}, type=${$.artifactType??""}, fields=${I}${U}]`];if($.warnings&&$.warnings.length>0){let D=$.warnings.map((w)=>w.class?`${w.key}→${w.suggestion} (${w.class})`:`${w.key}→${w.suggestion}`).join(", ");A.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${D}]`)}if($.schema)A.push(l7($.schema));return A.join(`
100
+ `)}function r7($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function n7($){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 A=I.map((D)=>P$([D]));return[U,"","[orphanedMatrixIds — rebind or delete via the matrix tools]",`{matrixId}[${I.length}]:`,...A].join(`
101
+ `)}function i7($){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 A=U.join("");if(I.length===0)return A;let D=I.map(([b,N])=>P$([b,N])),w=[A,`{tempId,nodeId}[${I.length}]:`,...D];if($.mode==="replace"&&$.orphanedMatrixIds&&$.orphanedMatrixIds.length>0){w.push(""),w.push("[orphanedMatrixIds — rebind or delete via the matrix tools]"),w.push(`{matrixId}[${$.orphanedMatrixIds.length}]:`);for(let b of $.orphanedMatrixIds)w.push(P$([b]))}return w.join(`
102
+ `)}function o7($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function d7($){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((A)=>P$([A]))].join(`
103
+ `)}function p7($){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((A)=>P$([A]))].join(`
104
+ `)}function t7($){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 a7($){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 e7($){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 s7($){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}]:`],A=I.map((D)=>P$([D.sourceType,D.sourceId,D.sourceTitle??""]));return[...U,...A].join(`
105
+ `)}function $5($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function I5($){if(!$.success)return $.error??"update_edge failed";return`[edge typed | edgeId=${$.edgeId??""}, relation=${$.relationType??""}, direction=${$.direction??""}]`}function U5($){if(!$.success)return $.error??"update_artifact_link_relation failed";return`[link relation typed | artifactLinkId=${$.artifactLinkId??""}, relation=${$.relationType??""}, role=${$.role??""} (unchanged)]`}function D5($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function A5($){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}]:`],A=I.map((D)=>P$([D.linkId,D.artifactId,D.artifactName??"",D.artifactType??"",D.role,D.context&&Object.keys(D.context).length>0?JSON.stringify(D.context):""]));return[...U,...A].join(`
106
+ `)}function OF($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function w5($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],U=$.orphanedMatrices??[],A=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${U.length}]`],D=[];if(I.length>0){D.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount,proseBlockCount}[${I.length}]:`);for(let O of I)D.push(P$([O.id,O.parentId??"",O.order,O.type,O.label,O.copyable?"true":"false",O.matrixCount,O.artifactCount,O.fileCount,O.proseBlockCount]))}else D.push("No procedure nodes.");let w=[];for(let O of I){if(!O.matrices||O.matrices.length===0)continue;for(let X of O.matrices)w.push({nodeId:O.id,matrix:X})}let b=[];if(w.length>0){b.push(""),b.push("[attachedMatrices]"),b.push(`{nodeId,matrixId,label,version,rows,cols}[${w.length}]:`);for(let{nodeId:O,matrix:X}of w)b.push(P$([O,X.id,X.label,X.version,X.rowCount,OF(X.columns)]))}let N=[];if(U.length>0)if(N.push(""),N.push("[orphanedMatrices]"),U.some((X)=>X.version!==void 0&&X.columns!==void 0)){N.push(`{id,label,version,rows,cols,updatedAt}[${U.length}]:`);for(let X of U)N.push(P$([X.id,X.label,X.version??"",X.rowCount??"",X.columns?OF(X.columns):"",X.updatedAt]))}else{N.push(`{id,label,updatedAt}[${U.length}]:`);for(let X of U)N.push(P$([X.id,X.label,X.updatedAt]))}return[...A,...D,...b,...N].join(`
107
+ `)}var Cu=G.object({cid:G.number().int().positive().describe("PubChem Compound ID (CID).")}),b5={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 Zu=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,gu=G.object({inchi_key:G.string().regex(Zu,"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).')}),N5={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 QF=G.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),xu=G.object({cid:G.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:G.array(QF).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:G.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),O5={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=G.enum(["preamble","full"]),X5=G.object({entityId:G.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:G.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},G.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:G.array(G.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:G.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:G.array(G.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:G.array(G.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:G.array(G.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:G.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:G.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:G.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:G.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 W5=G.object({forceRefresh:G.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 ib=G.object({entityType:N4.describe('Entity type: "document" or "record"'),entityId:G.string().uuid().describe("Document or record ID"),afterBlockId:G.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:G.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:G.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:G.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:G.enum(yb).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:G.string().optional().describe("Text content for the new block"),headingLevel:G.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:G.boolean().optional().describe("Checked state for checkListItem"),title:G.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:G.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:G.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:G.enum(ub).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:G.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:G.string().optional().describe("Cached title of the linked entity"),doi:G.string().optional().describe("DOI for literature references"),smiles:G.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:G.enum(lb).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:G.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:G.string().optional().describe("Optional description or notes for the structure block"),matrixId:G.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:G.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:G.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:G.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:G.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:G.array(Q7).max(V1).optional().describe(`Array of blocks to insert in sequence. Max ${V1} blocks. Use this for inserting multiple blocks in one call.`)}),fu=ib.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
108
  1. afterBlockId: Insert as SIBLING after the specified block
107
109
  2. beforeBlockId: Insert as SIBLING before the specified block
108
110
  3. parentBlockId: Insert as CHILD of a container block (e.g., referenceItem inside referenceList)
@@ -173,7 +175,7 @@ To add prose under a procedure node, use the prose container's blockId instead:
173
175
 
174
176
  The procedureTree container itself is fine as a sibling anchor (afterBlockId / beforeBlockId) but never as a parentBlockId (its children are projected sections).
175
177
 
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.
178
+ **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 G5=G.object({recordId:G.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:G.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:G.string().min(1).describe("Human-readable node label."),type:F1.describe("Node type."),afterNodeId:G.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:G.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:G.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:G.array(E1).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 Q5=G.object({templateId:G.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:G.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:G.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:G.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:G.string().optional(),tags:G.array(G.string()).optional(),properties:G.record(G.string(),G.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:S1.optional(),storageRef:G.string().optional(),location:G.string().optional(),parentId:G.string().uuid().optional(),sourceRecordId:G.string().uuid().optional(),slotBindings:G.array(G.object({role:G.string().describe('Slot role from the template (e.g. "reactant").'),label:G.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:G.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 Y5=G.object({nodeId:G.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:G.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:G.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:G.record(G.string(),G.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 B5=G.object({matrixId:G.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 J5=G.object({nodeId:G.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 H5=G.object({recordId:G.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 L5=G.object({matrixId:G.string().uuid().describe("UUID of the target data_matrix."),nodeRef:G.union([G.string().uuid(),G.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:G.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 YF=G.object({nodeId:G.string().uuid().describe("UUID of the node to move/reorder."),parentId:G.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:G.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),z5=G.object({recordId:G.string().uuid().describe("Target record UUID. Must be in draft status."),moves:G.array(YF).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=G.object({cas:G.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),M5={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 K5=G.object({query:G.string().min(1).optional().describe("Search query keywords"),mode:G.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:G.object({type:G.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:G.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:G.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:G.string().uuid().optional().describe("Filter by workspace ID"),spaceId:G.string().uuid().optional().describe("Filter by space ID"),limit:G.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:G.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:G.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:G.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:G.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),artifactType:G.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:G.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),i0={name:"search",description:`Search across literature, documents, records, and artifacts.
177
179
 
178
180
  **Modes:**
179
181
  - \`library\` (default): Returns unique entities ranked by relevance. Use when browsing/discovering.
@@ -225,9 +227,9 @@ Requires \`workspaceId\`. Returns artifact names, types, and retrieval hints.
225
227
  **Retrieval Hints:**
226
228
  Library mode results include \`bestBlockId\` and smart \`retrievalHint\`:
227
229
  - 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."),qH={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 MH=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 FH=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 jH=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}},EH=Object.keys(t0),a0=N.enum(EH);function J1(){return EH.map(($)=>`- \`${$}\` — ${t0[$].gloss} Reading: "${t0[$].reading}". e.g. ${t0[$].example}`).join(`
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
- ${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
- `)};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
- ${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");
230
+ - Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var uu=G.object({name:G.string().optional().describe("Compound name, trade name, or systematic name."),cas:G.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:G.number().int().positive().optional().describe("PubChem CID."),inchi_key:G.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:G.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."),v5={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 V5=G.object({entityId:G.string().describe('Entity ID (UUID or short ref like "rec-a3f7e2b9") to situate — the root of the bounded subgraph.'),depth:G.union([G.literal(1),G.literal(2),G.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 q5=G.object({entityType:N4.describe('Entity type: "document" or "record"'),entityId:G.string().uuid().describe("Document or record ID"),blockId:G.string().describe("Block ID to edit"),oldText:G.string().describe("Exact text to find and replace (must match exactly)"),newText:G.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 F5=G.object({linkId:G.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}},E5=Object.keys(t0),a0=G.enum(E5);function QI(){return E5.map(($)=>`- \`${$}\` — ${t0[$].gloss} Reading: "${t0[$].reading}". e.g. ${t0[$].example}`).join(`
231
+ `)}var ob=G.object({artifactLinkId:G.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:
232
+ ${QI()}`),note:G.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=ob.extend({note:G.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):",QI(),"Re-calling with the same `artifactLinkId` re-types the relation in place."].join(`
233
+ `)};var db=G.object({edgeId:G.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:G.string().uuid().describe("UUID of the document/record the mention lives in (the edge subject)."),sourceEntityType:G.enum(["document","record"]).describe("Type of the source entity (document or record)."),targetEntityId:G.string().uuid().describe("UUID of the mentioned entity (the edge object)."),targetEntityType:G.enum(["literature","document","record","artifact","matrix"]).describe("Type of the mentioned (target) entity."),blockId:G.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:G.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:
234
+ ${QI()}`),note:G.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:G.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=db.extend({edgeId:G.string().uuid(),note:G.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):",QI(),"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(`
235
+ `)};var mu=G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.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=G.object({rowIndex:G.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:mu.optional(),values:q1.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"]}),S5=G.object({matrixId:G.string().uuid().describe("UUID of the target data_matrix."),updates:G.array(ru).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:G.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),$D={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 j5=G.object({nodeId:G.string().uuid().describe("UUID of the existing procedure node to update."),label:G.string().min(1).optional().describe("New label (skip to keep existing)."),type:F1.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:G.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:G.array(E1).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)."}),ID={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 k5=[i0,g0,o0,d0,h0,K0,P0,T0,j0,k0,R0,S0,y0,x0,m0,F0,f0,ID,n0,Z0,v0,$D,E0,C0,r0,V0,l0,_0,u0,p0,c0,e0,s0,v5,b5,N5,M5,O5],nu=k5.map(($)=>$.name),iu=Object.fromEntries(k5.map(($)=>[$.name,$]));function P5($){return{content:[{type:"text",text:$}]}}function R5($){return{content:[{type:"text",text:$}],isError:!0}}function g($,I,U){let{definition:A,schema:D,createExecutor:w,formatOutput:b,formatError:N=(Q)=>Q.message,getLogMessage:O=(Q)=>JSON.stringify(Q).slice(0,100)}=U,X=w(I),W=D.shape;$.tool(A.name,A.description,W,async(Q)=>{let B=Q,Y=O(B);I.log.info(`${A.name}: ${Y}`);try{let J=await X(B),H=b(J,B);return I.log.info(`${A.name}: completed`),P5(H)}catch(J){let H=J instanceof Error?N(J,B):"Unknown error";return I.log.error(`${A.name} failed:`,J),R5(`${A.name} error: ${H}`)}})}function pb($,I,U){let{definition:A,schema:D,createExecutor:w,formatSuccess:b,formatNotFound:N=(B)=>JSON.stringify({found:!1,error:B.error??"Not found"}),formatError:O=(B)=>B.message,getLogMessage:X=(B)=>JSON.stringify(B).slice(0,100)}=U,W=w(I),Q=D.shape;$.tool(A.name,A.description,Q,async(B)=>{let Y=B,J=X(Y);I.log.info(`${A.name}: ${J}`);try{let H=await W(Y);if(!H.found)return I.log.info(`${A.name}: not found`),{content:[{type:"text",text:N(H,Y)}],isError:!0};return I.log.info(`${A.name}: found`),P5(b(H,Y))}catch(H){let v=H instanceof Error?O(H,Y):"Unknown error";return I.log.error(`${A.name} failed:`,H),R5(`${A.name} error: ${v}`)}})}function BF($,I){g($,I,{definition:v0,schema:B7,createExecutor:(U)=>{return async(A)=>{return await U.client.appendMatrixRows(A)}},formatOutput:o7,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function JF($,I){g($,I,{definition:V0,schema:J7,createExecutor:(U)=>{return async(A)=>{return await U.client.attachMatrix(A)}},formatOutput:e7,getLogMessage:(U)=>{let A=U.nodeRef?` + node ${U.nodeRef.slice(0,8)}`:"";return`Attaching matrix ${U.matrixId.slice(0,8)} → ${U.entityType}:${U.entityId.slice(0,8)}${A}`}})}function HF($,I){g($,I,{definition:F0,schema:H7,createExecutor:(U)=>{return async(A)=>{return await U.client.buildProcedureTree(A)}},formatOutput:i7,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:S0,schema:z7,createExecutor:(U)=>{return async(A)=>{return await U.client.createArtifact(A)}},formatOutput:u7,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function zF($,I){g($,I,{definition:j0,schema:M7,createExecutor:(U)=>{return async(A)=>{return await U.client.createDocument(A)}},formatOutput:R7,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function MF($,I){g($,I,{definition:k0,schema:K7,createExecutor:(U)=>{return async(A)=>{return U.client.createLiterature(A)}},formatOutput:T7,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function KF($,I){g($,I,{definition:P0,schema:v7,createExecutor:(U)=>{return async(A)=>{return await U.client.createMatrixFromArtifact(A)}},formatOutput:C7,getLogMessage:(U)=>`Deriving matrix from artifact ${U.artifactId.slice(0,8)}`})}function vF($,I){g($,I,{definition:R0,schema:V7,createExecutor:(U)=>{return async(A)=>{return await U.client.createRecord(A)}},formatOutput:h7,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function VF($,I){g($,I,{definition:T0,schema:rb,createExecutor:(U)=>{return async(A)=>{return await U.client.deleteBlock(A)}},formatOutput:x7,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 qF($,I){g($,I,{definition:_0,schema:q7,createExecutor:(U)=>{return async(A)=>{return await U.client.deleteMatrix(A)}},formatOutput:a7,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function FF($,I){g($,I,{definition:C0,schema:F7,createExecutor:(U)=>{return async(A)=>{return await U.client.deleteMatrixRows(A)}},formatOutput:p7,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:Z0,schema:E7,createExecutor:(U)=>{return async(A)=>{return await U.client.deleteProcedureNode(A)}},formatOutput:n7,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function SF($,I){pb($,I,{definition:g0,schema:X5,createExecutor:(U)=>{return async(A)=>{return U.client.getContent(A)}},formatSuccess:P7,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>{let A=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)}... (${A})`}})}function jF($,I){g($,I,{definition:x0,schema:W5,createExecutor:(U)=>{return async(A)=>{if(U.workspaceContext&&!A.forceRefresh)return U.workspaceContext;let D=await U.client.getWorkspaceContext();return U.workspaceContext=D,D}},formatOutput:S7,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function kF($,I){g($,I,{definition:h0,schema:ib,createExecutor:(U)=>{return async(A)=>{return await U.client.insertBlock(A)}},formatOutput:g7,getLogMessage:(U)=>{let A;if(U.parentBlockId)A=`in:${U.parentBlockId.slice(0,8)}`;else if(U.beforeBlockId)A=`before:${U.beforeBlockId.slice(0,8)}`;else if(U.afterBlockId)A=`after:${U.afterBlockId.slice(0,8)}`;else A="start";if(U.blocks&&U.blocks.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} ${A} (batch: ${U.blocks.length} blocks)`;return`${U.entityType}/${U.entityId.slice(0,8)} ${A} (${U.blockType??"paragraph"})`}})}function PF($,I){g($,I,{definition:K0,schema:Y7,createExecutor:(U)=>{return async(A)=>{return await U.client.insertMatrix(A)}},formatOutput:(U)=>_7(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function RF($,I){g($,I,{definition:f0,schema:G5,createExecutor:(U)=>{return async(A)=>{return await U.client.insertProcedureNode(A)}},formatOutput:f7,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:Q5,createExecutor:(U)=>{return async(A)=>{return await U.client.instantiateArtifactTemplate(A)}},formatOutput:c7,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function _F($,I){g($,I,{definition:u0,schema:Y5,createExecutor:(U)=>{return async(A)=>{return await U.client.linkArtifactToNode(A)}},formatOutput:$5,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:B5,createExecutor:(U)=>{return async(A)=>{return await U.client.listMatrixReferences(A)}},formatOutput:s7,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function ZF($,I){g($,I,{definition:c0,schema:J5,createExecutor:(U)=>{return async(A)=>{return await U.client.listNodeArtifactLinks(A)}},formatOutput:A5,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function gF($,I){g($,I,{definition:m0,schema:H5,createExecutor:(U)=>{return async(A)=>{return await U.client.listProcedureNodes(A)}},formatOutput:w5,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function xF($,I){g($,I,{definition:r0,schema:L5,createExecutor:(U)=>{return async(A)=>{return await U.client.rebindMatrixToNode(A)}},formatOutput:t7,getLogMessage:(U)=>{let A=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${A}`}})}function hF($,I){g($,I,{definition:n0,schema:z5,createExecutor:(U)=>{return async(A)=>{return await U.client.reorderProcedureNodes(A)}},formatOutput:r7,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:K5,createExecutor:(U)=>{return async(A)=>{let D=A.mode??"library",w=A.limit??10;if(A.scope?.type==="artifact"&&D==="library"&&A.workspaceId){let X=await U.client.searchArtifacts({workspaceId:A.workspaceId,query:A.query,artifactType:A.artifactType,artifactStatus:A.artifactStatus,limit:w}),W=X.results.map((Q)=>{let B=Q.description?Q.description.length>100?`${Q.description.slice(0,97)}...`:Q.description:`${Q.artifactType}, ${Q.status}`;return{entityType:"artifact",entityId:Q.id,entityTitle:Q.name,matchCount:1,bestBlockId:"",snippet:B,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${Q.id}")`}}});return{mode:"library",found:W.length,results:W,hasMore:X.hasMore}}let b=await U.client.search({query:A.query,mode:D,entityType:A.scope?.type,entityId:A.scope?.entityId,orgId:A.orgId,workspaceId:A.workspaceId,spaceId:A.spaceId,limit:w,offset:0,authorName:A.authorName,yearMin:A.yearMin,yearMax:A.yearMax,journalName:A.journalName}),N=b.results??[];if(D==="library"){let X=N.map((W)=>{let{bestMatch:Q}=W,B=ou(Q.rank,W.matchCount),Y={entityType:W.entityType,entityId:W.entityId,entityTitle:W.entityTitle,matchCount:W.matchCount,bestBlockId:Q.blockId,snippet:Q.snippet,relevance:B,tags:W.tags,retrievalHint:Q.blockId?{recommended:"blockIds",usage:`blockIds=['${Q.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(W.literatureMetadata)Y.literatureMetadata=W.literatureMetadata;if(W.creatorId)Y.creatorId=W.creatorId;if(W.creatorName)Y.creatorName=W.creatorName;return Y});return{mode:"library",found:X.length,results:X,hasMore:b.hasMore}}let O=N.map((X)=>{let W={entityType:X.entityType,entityId:X.entityId,entityTitle:X.entityTitle,blockId:"blockId"in X?X.blockId:"",snippet:"snippet"in X?X.snippet:"",relevance:"medium",retrievalHint:{recommended:"blockIds",usage:`blockIds=['${"blockId"in X?X.blockId:""}']`}},Q=X.creatorId,B=X.creatorName;if(Q)W.creatorId=Q;if(B)W.creatorName=B;return W});return{mode:"blocks",found:O.length,results:O,hasMore:b.hasMore}}},formatOutput:(U)=>j7(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function yF($,I){pb($,I,{definition:o0,schema:V5,createExecutor:(U)=>{return async(A)=>{return U.client.situate(A)}},formatSuccess:k7,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:q5,createExecutor:(U)=>{return async(A)=>{return await U.client.strReplaceBlock(A)}},formatOutput:Z7,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function lF($,I){g($,I,{definition:p0,schema:F5,createExecutor:(U)=>{return async(A)=>{return await U.client.unlinkArtifactFromNode(A)}},formatOutput:D5,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function cF($,I){g($,I,{definition:E0,schema:L7,createExecutor:(U)=>{return async(A)=>{return await U.client.updateArtifact(A)}},formatOutput:m7,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function mF($,I){g($,I,{definition:e0,schema:ob,createExecutor:(U)=>{return async(A)=>{return await U.client.updateArtifactLinkRelation(A)}},formatOutput:U5,getLogMessage:(U)=>`Typing artifact link ${U.artifactLinkId.slice(0,8)} as "${U.relationType}"`})}function rF($,I){g($,I,{definition:s0,schema:db,createExecutor:(U)=>{return async(A)=>{return await U.client.updateEdge(A)}},formatOutput:I5,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:$D,schema:S5,createExecutor:(U)=>{return async(A)=>{return await U.client.updateMatrixRows(A)}},formatOutput:d7,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function iF($,I){g($,I,{definition:ID,schema:j5,createExecutor:(U)=>{return async(A)=>{return await U.client.updateProcedureNode(A)}},formatOutput:y7,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function oF($,I){I.log.info("Registering tools..."),fF($,I),SF($,I),yF($,I),uF($,I),kF($,I),PF($,I),KF($,I),VF($,I),zF($,I),MF($,I),vF($,I),jF($,I),gF($,I),HF($,I),RF($,I),iF($,I),hF($,I),EF($,I),BF($,I),nF($,I),FF($,I),xF($,I),qF($,I),JF($,I),CF($,I),LF($,I),cF($,I),TF($,I),_F($,I),lF($,I),ZF($,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 A=$[U],D=$[U+1];if((A==="--api-key"||A==="-k")&&D)I.apiKey=D,U++;else if((A==="--api-url"||A==="-u")&&D)I.apiUrl=D,U++;else if(A==="--help"||A==="-h")process.exit(0)}return I}A4.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)A4.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),A4.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var tu=await UV({apiUrl:pu,apiKey:pF}),tF=new pW({name:"sura",version:"0.1.0"});oF(tF,tu);var aF=new aW,eF=async($)=>{A4.info(`Received ${$}, shutting down...`),await aF.close(),process.exit(0)};process.on("SIGTERM",()=>eF("SIGTERM"));process.on("SIGINT",()=>eF("SIGINT"));process.on("uncaughtException",($)=>{A4.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{A4.error("Unhandled rejection:",$)});A4.info("Connecting stdio transport...");await tF.connect(aF);A4.info("SURA MCP Server ready");