@aetherwealth/mcp 0.1.23 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/index.js +65 -53
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @bun
|
|
3
|
-
import{createRequire as ZA}from"node:module";var JA=Object.create;var{getPrototypeOf:zA,defineProperty:VI,getOwnPropertyNames:WA}=Object;var YA=Object.prototype.hasOwnProperty;function LA($){return this[$]}var VA,BA,kW=($,v,D)=>{var I=$!=null&&typeof $==="object";if(I){var U=v?VA??=new WeakMap:BA??=new WeakMap,X=U.get($);if(X)return X}D=$!=null?JA(zA($)):{};let G=v||!$||!$.__esModule?VI(D,"default",{value:$,enumerable:!0}):D;for(let Q of WA($))if(!YA.call(G,Q))VI(G,Q,{get:LA.bind($,Q),enumerable:!0});if(I)U.set($,G);return G};var b=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var KA=($)=>$;function NA($,v){this[$]=KA.bind(null,v)}var T4=($,v)=>{for(var D in v)VI($,D,{get:v[D],enumerable:!0,configurable:!0,set:NA.bind(v,D)})};var AA=ZA(import.meta.url);var _v=b((I7)=>{Object.defineProperty(I7,"__esModule",{value:!0});I7.regexpCode=I7.getEsmExportName=I7.getProperty=I7.safeStringify=I7.stringify=I7.strConcat=I7.addCodeArg=I7.str=I7._=I7.nil=I7._Code=I7.Name=I7.IDENTIFIER=I7._CodeOrName=void 0;class WD{}I7._CodeOrName=WD;I7.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class B1 extends WD{constructor($){super();if(!I7.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}I7.Name=B1;class z4 extends WD{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((v,D)=>`${v}${D}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((v,D)=>{if(D instanceof B1)v[D.str]=(v[D.str]||0)+1;return v},{})}}I7._Code=z4;I7.nil=new z4("");function U7($,...v){let D=[$[0]],I=0;while(I<v.length)S9(D,v[I]),D.push($[++I]);return new z4(D)}I7._=U7;var q9=new z4("+");function D7($,...v){let D=[fv($[0])],I=0;while(I<v.length)D.push(q9),S9(D,v[I]),D.push(q9,fv($[++I]));return n3(D),new z4(D)}I7.str=D7;function S9($,v){if(v instanceof z4)$.push(...v._items);else if(v instanceof B1)$.push(v);else $.push(_3(v))}I7.addCodeArg=S9;function n3($){let v=1;while(v<$.length-1){if($[v]===q9){let D=x3($[v-1],$[v+1]);if(D!==void 0){$.splice(v-1,3,D);continue}$[v++]="+"}v++}}function x3($,v){if(v==='""')return $;if($==='""')return v;if(typeof $=="string"){if(v instanceof B1||$[$.length-1]!=='"')return;if(typeof v!="string")return`${$.slice(0,-1)}${v}"`;if(v[0]==='"')return $.slice(0,-1)+v.slice(1);return}if(typeof v=="string"&&v[0]==='"'&&!($ instanceof B1))return`"${$}${v.slice(1)}`;return}function f3($,v){return v.emptyStr()?$:$.emptyStr()?v:D7`${$}${v}`}I7.strConcat=f3;function _3($){return typeof $=="number"||typeof $=="boolean"||$===null?$:fv(Array.isArray($)?$.join(","):$)}function y3($){return new z4(fv($))}I7.stringify=y3;function fv($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}I7.safeStringify=fv;function l3($){return typeof $=="string"&&I7.IDENTIFIER.test($)?new z4(`.${$}`):U7`[${$}]`}I7.getProperty=l3;function h3($){if(typeof $=="string"&&I7.IDENTIFIER.test($))return new z4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}I7.getEsmExportName=h3;function r3($){return new z4($.toString())}I7.regexpCode=r3});var u9=b((J7)=>{Object.defineProperty(J7,"__esModule",{value:!0});J7.ValueScope=J7.ValueScopeName=J7.Scope=J7.varKinds=J7.UsedValueState=void 0;var r$=_v();class G7 extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var LD;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(LD||(J7.UsedValueState=LD={}));J7.varKinds={const:new r$.Name("const"),let:new r$.Name("let"),var:new r$.Name("var")};class T9{constructor({prefixes:$,parent:v}={}){this._names={},this._prefixes=$,this._parent=v}toName($){return $ instanceof r$.Name?$:this.name($)}name($){return new r$.Name(this._newName($))}_newName($){let v=this._names[$]||this._nameGroup($);return`${$}${v.index++}`}_nameGroup($){var v,D;if(((D=(v=this._parent)===null||v===void 0?void 0:v._prefixes)===null||D===void 0?void 0:D.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}J7.Scope=T9;class E9 extends r$.Name{constructor($,v){super(v);this.prefix=$}setValue($,{property:v,itemIndex:D}){this.value=$,this.scopePath=r$._`.${new r$.Name(v)}[${D}]`}}J7.ValueScopeName=E9;var Dj=r$._`\n`;class Q7 extends T9{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?Dj:r$.nil}}get(){return this._scope}name($){return new E9($,this._newName($))}value($,v){var D;if(v.ref===void 0)throw Error("CodeGen: ref must be passed in value");let I=this.toName($),{prefix:U}=I,X=(D=v.key)!==null&&D!==void 0?D:v.ref,G=this._values[U];if(G){let z=G.get(X);if(z)return z}else G=this._values[U]=new Map;G.set(X,I);let Q=this._scope[U]||(this._scope[U]=[]),J=Q.length;return Q[J]=v.ref,I.setValue(v,{property:U,itemIndex:J}),I}getValue($,v){let D=this._values[$];if(!D)return;return D.get(v)}scopeRefs($,v=this._values){return this._reduceValues(v,(D)=>{if(D.scopePath===void 0)throw Error(`CodeGen: name "${D}" has no value`);return r$._`${$}${D.scopePath}`})}scopeCode($=this._values,v,D){return this._reduceValues($,(I)=>{if(I.value===void 0)throw Error(`CodeGen: name "${I}" has no value`);return I.value.code},v,D)}_reduceValues($,v,D={},I){let U=r$.nil;for(let X in $){let G=$[X];if(!G)continue;let Q=D[X]=D[X]||new Map;G.forEach((J)=>{if(Q.has(J))return;Q.set(J,LD.Started);let z=v(J);if(z){let W=this.opts.es5?J7.varKinds.var:J7.varKinds.const;U=r$._`${U}${W} ${J} = ${z};${this.opts._n}`}else if(z=I===null||I===void 0?void 0:I(J))U=r$._`${U}${z}${this.opts._n}`;else throw new G7(J);Q.set(J,LD.Completed)})}return U}}J7.ValueScope=Q7});var _=b((m$)=>{Object.defineProperty(m$,"__esModule",{value:!0});m$.or=m$.and=m$.not=m$.CodeGen=m$.operators=m$.varKinds=m$.ValueScopeName=m$.ValueScope=m$.Scope=m$.Name=m$.regexpCode=m$.stringify=m$.getProperty=m$.nil=m$.strConcat=m$.str=m$._=void 0;var m=_v(),W4=u9(),v6=_v();Object.defineProperty(m$,"_",{enumerable:!0,get:function(){return v6._}});Object.defineProperty(m$,"str",{enumerable:!0,get:function(){return v6.str}});Object.defineProperty(m$,"strConcat",{enumerable:!0,get:function(){return v6.strConcat}});Object.defineProperty(m$,"nil",{enumerable:!0,get:function(){return v6.nil}});Object.defineProperty(m$,"getProperty",{enumerable:!0,get:function(){return v6.getProperty}});Object.defineProperty(m$,"stringify",{enumerable:!0,get:function(){return v6.stringify}});Object.defineProperty(m$,"regexpCode",{enumerable:!0,get:function(){return v6.regexpCode}});Object.defineProperty(m$,"Name",{enumerable:!0,get:function(){return v6.Name}});var AD=u9();Object.defineProperty(m$,"Scope",{enumerable:!0,get:function(){return AD.Scope}});Object.defineProperty(m$,"ValueScope",{enumerable:!0,get:function(){return AD.ValueScope}});Object.defineProperty(m$,"ValueScopeName",{enumerable:!0,get:function(){return AD.ValueScopeName}});Object.defineProperty(m$,"varKinds",{enumerable:!0,get:function(){return AD.varKinds}});m$.operators={GT:new m._Code(">"),GTE:new m._Code(">="),LT:new m._Code("<"),LTE:new m._Code("<="),EQ:new m._Code("==="),NEQ:new m._Code("!=="),NOT:new m._Code("!"),OR:new m._Code("||"),AND:new m._Code("&&"),ADD:new m._Code("+")};class U6{optimizeNodes(){return this}optimizeNames($,v){return this}}class W7 extends U6{constructor($,v,D){super();this.varKind=$,this.name=v,this.rhs=D}render({es5:$,_n:v}){let D=$?W4.varKinds.var:this.varKind,I=this.rhs===void 0?"":` = ${this.rhs}`;return`${D} ${this.name}${I};`+v}optimizeNames($,v){if(!$[this.name.str])return;if(this.rhs)this.rhs=N1(this.rhs,$,v);return this}get names(){return this.rhs instanceof m._CodeOrName?this.rhs.names:{}}}class C9 extends U6{constructor($,v,D){super();this.lhs=$,this.rhs=v,this.sideEffects=D}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,v){if(this.lhs instanceof m.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=N1(this.rhs,$,v),this}get names(){let $=this.lhs instanceof m.Name?{}:{...this.lhs.names};return ZD($,this.rhs)}}class Y7 extends C9{constructor($,v,D,I){super($,D,I);this.op=v}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class L7 extends U6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class V7 extends U6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class B7 extends U6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class K7 extends U6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,v){return this.code=N1(this.code,$,v),this}get names(){return this.code instanceof m._CodeOrName?this.code.names:{}}}class HD extends U6{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((v,D)=>v+D.render($),"")}optimizeNodes(){let{nodes:$}=this,v=$.length;while(v--){let D=$[v].optimizeNodes();if(Array.isArray(D))$.splice(v,1,...D);else if(D)$[v]=D;else $.splice(v,1)}return $.length>0?this:void 0}optimizeNames($,v){let{nodes:D}=this,I=D.length;while(I--){let U=D[I];if(U.optimizeNames($,v))continue;Qj($,U.names),D.splice(I,1)}return D.length>0?this:void 0}get names(){return this.nodes.reduce(($,v)=>j6($,v.names),{})}}class D6 extends HD{render($){return"{"+$._n+super.render($)+"}"+$._n}}class N7 extends HD{}class yv extends D6{}yv.kind="else";class i4 extends D6{constructor($,v){super(v);this.condition=$}render($){let v=`if(${this.condition})`+super.render($);if(this.else)v+="else "+this.else.render($);return v}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let v=this.else;if(v){let D=v.optimizeNodes();v=this.else=Array.isArray(D)?new yv(D):D}if(v){if($===!1)return v instanceof i4?v:v.nodes;if(this.nodes.length)return this;return new i4(O7($),v instanceof i4?[v]:v.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,v){var D;if(this.else=(D=this.else)===null||D===void 0?void 0:D.optimizeNames($,v),!(super.optimizeNames($,v)||this.else))return;return this.condition=N1(this.condition,$,v),this}get names(){let $=super.names;if(ZD($,this.condition),this.else)j6($,this.else.names);return $}}i4.kind="if";class K1 extends D6{}K1.kind="for";class Z7 extends K1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,v){if(!super.optimizeNames($,v))return;return this.iteration=N1(this.iteration,$,v),this}get names(){return j6(super.names,this.iteration.names)}}class A7 extends K1{constructor($,v,D,I){super();this.varKind=$,this.name=v,this.from=D,this.to=I}render($){let v=$.es5?W4.varKinds.var:this.varKind,{name:D,from:I,to:U}=this;return`for(${v} ${D}=${I}; ${D}<${U}; ${D}++)`+super.render($)}get names(){let $=ZD(super.names,this.from);return ZD($,this.to)}}class g9 extends K1{constructor($,v,D,I){super();this.loop=$,this.varKind=v,this.name=D,this.iterable=I}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,v){if(!super.optimizeNames($,v))return;return this.iterable=N1(this.iterable,$,v),this}get names(){return j6(super.names,this.iterable.names)}}class VD extends D6{constructor($,v,D){super();this.name=$,this.args=v,this.async=D}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}VD.kind="func";class BD extends HD{render($){return"return "+super.render($)}}BD.kind="return";class H7 extends D6{render($){let v="try"+super.render($);if(this.catch)v+=this.catch.render($);if(this.finally)v+=this.finally.render($);return v}optimizeNodes(){var $,v;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(v=this.finally)===null||v===void 0||v.optimizeNodes(),this}optimizeNames($,v){var D,I;return super.optimizeNames($,v),(D=this.catch)===null||D===void 0||D.optimizeNames($,v),(I=this.finally)===null||I===void 0||I.optimizeNames($,v),this}get names(){let $=super.names;if(this.catch)j6($,this.catch.names);if(this.finally)j6($,this.finally.names);return $}}class KD extends D6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}KD.kind="catch";class ND extends D6{render($){return"finally"+super.render($)}}ND.kind="finally";class F7{constructor($,v={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...v,_n:v.lines?`
|
|
4
|
-
`:""},this._extScope=$,this._scope=new W4.Scope({parent:$}),this._nodes=[new N7]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,v){let D=this._extScope.value($,v);return(this._values[D.prefix]||(this._values[D.prefix]=new Set)).add(D),D}getScopeValue($,v){return this._extScope.getValue($,v)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,v,D,I){let U=this._scope.toName(v);if(D!==void 0&&I)this._constants[U.str]=D;return this._leafNode(new W7($,U,D)),U}const($,v,D){return this._def(W4.varKinds.const,$,v,D)}let($,v,D){return this._def(W4.varKinds.let,$,v,D)}var($,v,D){return this._def(W4.varKinds.var,$,v,D)}assign($,v,D){return this._leafNode(new C9($,v,D))}add($,v){return this._leafNode(new Y7($,m$.operators.ADD,v))}code($){if(typeof $=="function")$();else if($!==m.nil)this._leafNode(new K7($));return this}object(...$){let v=["{"];for(let[D,I]of $){if(v.length>1)v.push(",");if(v.push(D),D!==I||this.opts.es5)v.push(":"),(0,m.addCodeArg)(v,I)}return v.push("}"),new m._Code(v)}if($,v,D){if(this._blockNode(new i4($)),v&&D)this.code(v).else().code(D).endIf();else if(v)this.code(v).endIf();else if(D)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new i4($))}else(){return this._elseNode(new yv)}endIf(){return this._endBlockNode(i4,yv)}_for($,v){if(this._blockNode($),v)this.code(v).endFor();return this}for($,v){return this._for(new Z7($),v)}forRange($,v,D,I,U=this.opts.es5?W4.varKinds.var:W4.varKinds.let){let X=this._scope.toName($);return this._for(new A7(U,X,v,D),()=>I(X))}forOf($,v,D,I=W4.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let X=v instanceof m.Name?v:this.var("_arr",v);return this.forRange("_i",0,m._`${X}.length`,(G)=>{this.var(U,m._`${X}[${G}]`),D(U)})}return this._for(new g9("of",I,U,v),()=>D(U))}forIn($,v,D,I=this.opts.es5?W4.varKinds.var:W4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,m._`Object.keys(${v})`,D);let U=this._scope.toName($);return this._for(new g9("in",I,U,v),()=>D(U))}endFor(){return this._endBlockNode(K1)}label($){return this._leafNode(new L7($))}break($){return this._leafNode(new V7($))}return($){let v=new BD;if(this._blockNode(v),this.code($),v.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(BD)}try($,v,D){if(!v&&!D)throw Error('CodeGen: "try" without "catch" and "finally"');let I=new H7;if(this._blockNode(I),this.code($),v){let U=this.name("e");this._currNode=I.catch=new KD(U),v(U)}if(D)this._currNode=I.finally=new ND,this.code(D);return this._endBlockNode(KD,ND)}throw($){return this._leafNode(new B7($))}block($,v){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(v);return this}endBlock($){let v=this._blockStarts.pop();if(v===void 0)throw Error("CodeGen: not in self-balancing block");let D=this._nodes.length-v;if(D<0||$!==void 0&&D!==$)throw Error(`CodeGen: wrong number of nodes: ${D} vs ${$} expected`);return this._nodes.length=v,this}func($,v=m.nil,D,I){if(this._blockNode(new VD($,v,D)),I)this.code(I).endFunc();return this}endFunc(){return this._endBlockNode(VD)}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($,v){let D=this._currNode;if(D instanceof $||v&&D instanceof v)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${v?`${$.kind}/${v.kind}`:$.kind}"`)}_elseNode($){let v=this._currNode;if(!(v instanceof i4))throw Error('CodeGen: "else" without "if"');return this._currNode=v.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let v=this._nodes;v[v.length-1]=$}}m$.CodeGen=F7;function j6($,v){for(let D in v)$[D]=($[D]||0)+(v[D]||0);return $}function ZD($,v){return v instanceof m._CodeOrName?j6($,v.names):$}function N1($,v,D){if($ instanceof m.Name)return I($);if(!U($))return $;return new m._Code($._items.reduce((X,G)=>{if(G instanceof m.Name)G=I(G);if(G instanceof m._Code)X.push(...G._items);else X.push(G);return X},[]));function I(X){let G=D[X.str];if(G===void 0||v[X.str]!==1)return X;return delete v[X.str],G}function U(X){return X instanceof m._Code&&X._items.some((G)=>G instanceof m.Name&&v[G.str]===1&&D[G.str]!==void 0)}}function Qj($,v){for(let D in v)$[D]=($[D]||0)-(v[D]||0)}function O7($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:m._`!${R9($)}`}m$.not=O7;var Jj=j7(m$.operators.AND);function zj(...$){return $.reduce(Jj)}m$.and=zj;var Wj=j7(m$.operators.OR);function Yj(...$){return $.reduce(Wj)}m$.or=Yj;function j7($){return(v,D)=>v===m.nil?D:D===m.nil?v:m._`${R9(v)} ${$} ${R9(D)}`}function R9($){return $ instanceof m.Name?$:m._`(${$})`}});var d=b((E7)=>{Object.defineProperty(E7,"__esModule",{value:!0});E7.checkStrictMode=E7.getErrorPath=E7.Type=E7.useFunc=E7.setEvaluated=E7.evaluatedPropsToName=E7.mergeEvaluated=E7.eachItem=E7.unescapeJsonPointer=E7.escapeJsonPointer=E7.escapeFragment=E7.unescapeFragment=E7.schemaRefOrVal=E7.schemaHasRulesButRef=E7.schemaHasRules=E7.checkUnknownRules=E7.alwaysValidSchema=E7.toHash=void 0;var Q$=_(),Kj=_v();function Nj($){let v={};for(let D of $)v[D]=!0;return v}E7.toHash=Nj;function Zj($,v){if(typeof v=="boolean")return v;if(Object.keys(v).length===0)return!0;return b7($,v),!q7(v,$.self.RULES.all)}E7.alwaysValidSchema=Zj;function b7($,v=$.schema){let{opts:D,self:I}=$;if(!D.strictSchema)return;if(typeof v==="boolean")return;let U=I.RULES.keywords;for(let X in v)if(!U[X])T7($,`unknown keyword: "${X}"`)}E7.checkUnknownRules=b7;function q7($,v){if(typeof $=="boolean")return!$;for(let D in $)if(v[D])return!0;return!1}E7.schemaHasRules=q7;function Aj($,v){if(typeof $=="boolean")return!$;for(let D in $)if(D!=="$ref"&&v.all[D])return!0;return!1}E7.schemaHasRulesButRef=Aj;function Hj({topSchemaRef:$,schemaPath:v},D,I,U){if(!U){if(typeof D=="number"||typeof D=="boolean")return D;if(typeof D=="string")return Q$._`${D}`}return Q$._`${$}${v}${(0,Q$.getProperty)(I)}`}E7.schemaRefOrVal=Hj;function Fj($){return S7(decodeURIComponent($))}E7.unescapeFragment=Fj;function Oj($){return encodeURIComponent(n9($))}E7.escapeFragment=Oj;function n9($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}E7.escapeJsonPointer=n9;function S7($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}E7.unescapeJsonPointer=S7;function jj($,v){if(Array.isArray($))for(let D of $)v(D);else v($)}E7.eachItem=jj;function P7({mergeNames:$,mergeToName:v,mergeValues:D,resultToName:I}){return(U,X,G,Q)=>{let J=G===void 0?X:G instanceof Q$.Name?(X instanceof Q$.Name?$(U,X,G):v(U,X,G),G):X instanceof Q$.Name?(v(U,G,X),X):D(X,G);return Q===Q$.Name&&!(J instanceof Q$.Name)?I(U,J):J}}E7.mergeEvaluated={props:P7({mergeNames:($,v,D)=>$.if(Q$._`${D} !== true && ${v} !== undefined`,()=>{$.if(Q$._`${v} === true`,()=>$.assign(D,!0),()=>$.assign(D,Q$._`${D} || {}`).code(Q$._`Object.assign(${D}, ${v})`))}),mergeToName:($,v,D)=>$.if(Q$._`${D} !== true`,()=>{if(v===!0)$.assign(D,!0);else $.assign(D,Q$._`${D} || {}`),x9($,D,v)}),mergeValues:($,v)=>$===!0?!0:{...$,...v},resultToName:k7}),items:P7({mergeNames:($,v,D)=>$.if(Q$._`${D} !== true && ${v} !== undefined`,()=>$.assign(D,Q$._`${v} === true ? true : ${D} > ${v} ? ${D} : ${v}`)),mergeToName:($,v,D)=>$.if(Q$._`${D} !== true`,()=>$.assign(D,v===!0?!0:Q$._`${D} > ${v} ? ${D} : ${v}`)),mergeValues:($,v)=>$===!0?!0:Math.max($,v),resultToName:($,v)=>$.var("items",v)})};function k7($,v){if(v===!0)return $.var("props",!0);let D=$.var("props",Q$._`{}`);if(v!==void 0)x9($,D,v);return D}E7.evaluatedPropsToName=k7;function x9($,v,D){Object.keys(D).forEach((I)=>$.assign(Q$._`${v}${(0,Q$.getProperty)(I)}`,!0))}E7.setEvaluated=x9;var M7={};function wj($,v){return $.scopeValue("func",{ref:v,code:M7[v.code]||(M7[v.code]=new Kj._Code(v.code))})}E7.useFunc=wj;var i9;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(i9||(E7.Type=i9={}));function Pj($,v,D){if($ instanceof Q$.Name){let I=v===i9.Num;return D?I?Q$._`"[" + ${$} + "]"`:Q$._`"['" + ${$} + "']"`:I?Q$._`"/" + ${$}`:Q$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return D?(0,Q$.getProperty)($).toString():"/"+n9($)}E7.getErrorPath=Pj;function T7($,v,D=$.opts.strictSchema){if(!D)return;if(v=`strict mode: ${v}`,D===!0)throw Error(v);$.self.logger.warn(v)}E7.checkStrictMode=T7});var n4=b((g7)=>{Object.defineProperty(g7,"__esModule",{value:!0});var E$=_(),lj={data:new E$.Name("data"),valCxt:new E$.Name("valCxt"),instancePath:new E$.Name("instancePath"),parentData:new E$.Name("parentData"),parentDataProperty:new E$.Name("parentDataProperty"),rootData:new E$.Name("rootData"),dynamicAnchors:new E$.Name("dynamicAnchors"),vErrors:new E$.Name("vErrors"),errors:new E$.Name("errors"),this:new E$.Name("this"),self:new E$.Name("self"),scope:new E$.Name("scope"),json:new E$.Name("json"),jsonPos:new E$.Name("jsonPos"),jsonLen:new E$.Name("jsonLen"),jsonPart:new E$.Name("jsonPart")};g7.default=lj});var lv=b((n7)=>{Object.defineProperty(n7,"__esModule",{value:!0});n7.extendErrors=n7.resetErrorsCount=n7.reportExtraError=n7.reportError=n7.keyword$DataError=n7.keywordError=void 0;var t=_(),OD=d(),x$=n4();n7.keywordError={message:({keyword:$})=>t.str`must pass "${$}" keyword validation`};n7.keyword$DataError={message:({keyword:$,schemaType:v})=>v?t.str`"${$}" keyword must be ${v} ($data)`:t.str`"${$}" keyword is invalid ($data)`};function rj($,v=n7.keywordError,D,I){let{it:U}=$,{gen:X,compositeRule:G,allErrors:Q}=U,J=i7($,v,D);if(I!==null&&I!==void 0?I:G||Q)R7(X,J);else C7(U,t._`[${J}]`)}n7.reportError=rj;function mj($,v=n7.keywordError,D){let{it:I}=$,{gen:U,compositeRule:X,allErrors:G}=I,Q=i7($,v,D);if(R7(U,Q),!(X||G))C7(I,x$.default.vErrors)}n7.reportExtraError=mj;function cj($,v){$.assign(x$.default.errors,v),$.if(t._`${x$.default.vErrors} !== null`,()=>$.if(v,()=>$.assign(t._`${x$.default.vErrors}.length`,v),()=>$.assign(x$.default.vErrors,null)))}n7.resetErrorsCount=cj;function dj({gen:$,keyword:v,schemaValue:D,data:I,errsCount:U,it:X}){if(U===void 0)throw Error("ajv implementation error");let G=$.name("err");$.forRange("i",U,x$.default.errors,(Q)=>{if($.const(G,t._`${x$.default.vErrors}[${Q}]`),$.if(t._`${G}.instancePath === undefined`,()=>$.assign(t._`${G}.instancePath`,(0,t.strConcat)(x$.default.instancePath,X.errorPath))),$.assign(t._`${G}.schemaPath`,t.str`${X.errSchemaPath}/${v}`),X.opts.verbose)$.assign(t._`${G}.schema`,D),$.assign(t._`${G}.data`,I)})}n7.extendErrors=dj;function R7($,v){let D=$.const("err",v);$.if(t._`${x$.default.vErrors} === null`,()=>$.assign(x$.default.vErrors,t._`[${D}]`),t._`${x$.default.vErrors}.push(${D})`),$.code(t._`${x$.default.errors}++`)}function C7($,v){let{gen:D,validateName:I,schemaEnv:U}=$;if(U.$async)D.throw(t._`new ${$.ValidationError}(${v})`);else D.assign(t._`${I}.errors`,v),D.return(!1)}var w6={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function i7($,v,D){let{createErrors:I}=$.it;if(I===!1)return t._`{}`;return tj($,v,D)}function tj($,v,D={}){let{gen:I,it:U}=$,X=[pj(U,D),oj($,D)];return aj($,v,X),I.object(...X)}function pj({errorPath:$},{instancePath:v}){let D=v?t.str`${$}${(0,OD.getErrorPath)(v,OD.Type.Str)}`:$;return[x$.default.instancePath,(0,t.strConcat)(x$.default.instancePath,D)]}function oj({keyword:$,it:{errSchemaPath:v}},{schemaPath:D,parentSchema:I}){let U=I?v:t.str`${v}/${$}`;if(D)U=t.str`${U}${(0,OD.getErrorPath)(D,OD.Type.Str)}`;return[w6.schemaPath,U]}function aj($,{params:v,message:D},I){let{keyword:U,data:X,schemaValue:G,it:Q}=$,{opts:J,propertyName:z,topSchemaRef:W,schemaPath:Y}=Q;if(I.push([w6.keyword,U],[w6.params,typeof v=="function"?v($):v||t._`{}`]),J.messages)I.push([w6.message,typeof D=="function"?D($):D]);if(J.verbose)I.push([w6.schema,G],[w6.parentSchema,t._`${W}${Y}`],[x$.default.data,X]);if(z)I.push([w6.propertyName,z])}});var l7=b((_7)=>{Object.defineProperty(_7,"__esModule",{value:!0});_7.boolOrEmptySchema=_7.topBoolOrEmptySchema=void 0;var Uw=lv(),Dw=_(),Iw=n4(),Xw={message:"boolean schema is false"};function Gw($){let{gen:v,schema:D,validateName:I}=$;if(D===!1)f7($,!1);else if(typeof D=="object"&&D.$async===!0)v.return(Iw.default.data);else v.assign(Dw._`${I}.errors`,null),v.return(!0)}_7.topBoolOrEmptySchema=Gw;function Qw($,v){let{gen:D,schema:I}=$;if(I===!1)D.var(v,!1),f7($);else D.var(v,!0)}_7.boolOrEmptySchema=Qw;function f7($,v){let{gen:D,data:I}=$,U={gen:D,keyword:"false schema",data:I,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,Uw.reportError)(U,Xw,void 0,v)}});var _9=b((h7)=>{Object.defineProperty(h7,"__esModule",{value:!0});h7.getRules=h7.isJSONType=void 0;var zw=["string","number","integer","boolean","null","object","array"],Ww=new Set(zw);function Yw($){return typeof $=="string"&&Ww.has($)}h7.isJSONType=Yw;function Lw(){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:{}}}h7.getRules=Lw});var y9=b((d7)=>{Object.defineProperty(d7,"__esModule",{value:!0});d7.shouldUseRule=d7.shouldUseGroup=d7.schemaHasRulesForType=void 0;function Bw({schema:$,self:v},D){let I=v.RULES.types[D];return I&&I!==!0&&m7($,I)}d7.schemaHasRulesForType=Bw;function m7($,v){return v.rules.some((D)=>c7($,D))}d7.shouldUseGroup=m7;function c7($,v){var D;return $[v.keyword]!==void 0||((D=v.definition.implements)===null||D===void 0?void 0:D.some((I)=>$[I]!==void 0))}d7.shouldUseRule=c7});var hv=b((e7)=>{Object.defineProperty(e7,"__esModule",{value:!0});e7.reportTypeError=e7.checkDataTypes=e7.checkDataType=e7.coerceAndCheckDataType=e7.getJSONTypes=e7.getSchemaTypes=e7.DataType=void 0;var Zw=_9(),Aw=y9(),Hw=lv(),f=_(),p7=d(),Z1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(Z1||(e7.DataType=Z1={}));function Fw($){let v=o7($.type);if(v.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!v.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)v.push("null")}return v}e7.getSchemaTypes=Fw;function o7($){let v=Array.isArray($)?$:$?[$]:[];if(v.every(Zw.isJSONType))return v;throw Error("type must be JSONType or JSONType[]: "+v.join(","))}e7.getJSONTypes=o7;function Ow($,v){let{gen:D,data:I,opts:U}=$,X=jw(v,U.coerceTypes),G=v.length>0&&!(X.length===0&&v.length===1&&(0,Aw.schemaHasRulesForType)($,v[0]));if(G){let Q=h9(v,I,U.strictNumbers,Z1.Wrong);D.if(Q,()=>{if(X.length)ww($,v,X);else r9($)})}return G}e7.coerceAndCheckDataType=Ow;var a7=new Set(["string","number","integer","boolean","null"]);function jw($,v){return v?$.filter((D)=>a7.has(D)||v==="array"&&D==="array"):[]}function ww($,v,D){let{gen:I,data:U,opts:X}=$,G=I.let("dataType",f._`typeof ${U}`),Q=I.let("coerced",f._`undefined`);if(X.coerceTypes==="array")I.if(f._`${G} == 'object' && Array.isArray(${U}) && ${U}.length == 1`,()=>I.assign(U,f._`${U}[0]`).assign(G,f._`typeof ${U}`).if(h9(v,U,X.strictNumbers),()=>I.assign(Q,U)));I.if(f._`${Q} !== undefined`);for(let z of D)if(a7.has(z)||z==="array"&&X.coerceTypes==="array")J(z);I.else(),r9($),I.endIf(),I.if(f._`${Q} !== undefined`,()=>{I.assign(U,Q),Pw($,Q)});function J(z){switch(z){case"string":I.elseIf(f._`${G} == "number" || ${G} == "boolean"`).assign(Q,f._`"" + ${U}`).elseIf(f._`${U} === null`).assign(Q,f._`""`);return;case"number":I.elseIf(f._`${G} == "boolean" || ${U} === null
|
|
5
|
-
|| (${
|
|
6
|
-
|| (${
|
|
7
|
-
|| ${G} === "boolean" || ${U} === null`).assign(Q,f._`[${U}]`)}}}function Pw({gen:$,parentData:v,parentDataProperty:D},I){$.if(f._`${v} !== undefined`,()=>$.assign(f._`${v}[${D}]`,I))}function l9($,v,D,I=Z1.Correct){let U=I===Z1.Correct?f.operators.EQ:f.operators.NEQ,X;switch($){case"null":return f._`${v} ${U} null`;case"array":X=f._`Array.isArray(${v})`;break;case"object":X=f._`${v} && typeof ${v} == "object" && !Array.isArray(${v})`;break;case"integer":X=G(f._`!(${v} % 1) && !isNaN(${v})`);break;case"number":X=G();break;default:return f._`typeof ${v} ${U} ${$}`}return I===Z1.Correct?X:(0,f.not)(X);function G(Q=f.nil){return(0,f.and)(f._`typeof ${v} == "number"`,Q,D?f._`isFinite(${v})`:f.nil)}}e7.checkDataType=l9;function h9($,v,D,I){if($.length===1)return l9($[0],v,D,I);let U,X=(0,p7.toHash)($);if(X.array&&X.object){let G=f._`typeof ${v} != "object"`;U=X.null?G:f._`!${v} || ${G}`,delete X.null,delete X.array,delete X.object}else U=f.nil;if(X.number)delete X.integer;for(let G in X)U=(0,f.and)(U,l9(G,v,D,I));return U}e7.checkDataTypes=h9;var Mw={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:v})=>typeof $=="string"?f._`{type: ${$}}`:f._`{type: ${v}}`};function r9($){let v=bw($);(0,Hw.reportError)(v,Mw)}e7.reportTypeError=r9;function bw($){let{gen:v,data:D,schema:I}=$,U=(0,p7.schemaRefOrVal)($,I,"type");return{gen:v,keyword:"type",data:D,schema:I.type,schemaCode:U,schemaValue:U,parentSchema:I,params:{},it:$}}});var DL=b((vL)=>{Object.defineProperty(vL,"__esModule",{value:!0});vL.assignDefaults=void 0;var A1=_(),gw=d();function Rw($,v){let{properties:D,items:I}=$.schema;if(v==="object"&&D)for(let U in D)$L($,U,D[U].default);else if(v==="array"&&Array.isArray(I))I.forEach((U,X)=>$L($,X,U.default))}vL.assignDefaults=Rw;function $L($,v,D){let{gen:I,compositeRule:U,data:X,opts:G}=$;if(D===void 0)return;let Q=A1._`${X}${(0,A1.getProperty)(v)}`;if(U){(0,gw.checkStrictMode)($,`default is ignored for: ${Q}`);return}let J=A1._`${Q} === undefined`;if(G.useDefaults==="empty")J=A1._`${J} || ${Q} === null || ${Q} === ""`;I.if(J,A1._`${Q} = ${(0,A1.stringify)(D)}`)}});var I4=b((GL)=>{Object.defineProperty(GL,"__esModule",{value:!0});GL.validateUnion=GL.validateArray=GL.usePattern=GL.callValidateCode=GL.schemaProperties=GL.allSchemaProperties=GL.noPropertyInData=GL.propertyInData=GL.isOwnProperty=GL.hasPropFunc=GL.reportMissingProp=GL.checkMissingProp=GL.checkReportMissingProp=void 0;var J$=_(),m9=d(),I6=n4(),Cw=d();function iw($,v){let{gen:D,data:I,it:U}=$;D.if(d9(D,I,v,U.opts.ownProperties),()=>{$.setParams({missingProperty:J$._`${v}`},!0),$.error()})}GL.checkReportMissingProp=iw;function nw({gen:$,data:v,it:{opts:D}},I,U){return(0,J$.or)(...I.map((X)=>(0,J$.and)(d9($,v,X,D.ownProperties),J$._`${U} = ${X}`)))}GL.checkMissingProp=nw;function xw($,v){$.setParams({missingProperty:v},!0),$.error()}GL.reportMissingProp=xw;function IL($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:J$._`Object.prototype.hasOwnProperty`})}GL.hasPropFunc=IL;function c9($,v,D){return J$._`${IL($)}.call(${v}, ${D})`}GL.isOwnProperty=c9;function fw($,v,D,I){let U=J$._`${v}${(0,J$.getProperty)(D)} !== undefined`;return I?J$._`${U} && ${c9($,v,D)}`:U}GL.propertyInData=fw;function d9($,v,D,I){let U=J$._`${v}${(0,J$.getProperty)(D)} === undefined`;return I?(0,J$.or)(U,(0,J$.not)(c9($,v,D))):U}GL.noPropertyInData=d9;function XL($){return $?Object.keys($).filter((v)=>v!=="__proto__"):[]}GL.allSchemaProperties=XL;function _w($,v){return XL(v).filter((D)=>!(0,m9.alwaysValidSchema)($,v[D]))}GL.schemaProperties=_w;function yw({schemaCode:$,data:v,it:{gen:D,topSchemaRef:I,schemaPath:U,errorPath:X},it:G},Q,J,z){let W=z?J$._`${$}, ${v}, ${I}${U}`:v,Y=[[I6.default.instancePath,(0,J$.strConcat)(I6.default.instancePath,X)],[I6.default.parentData,G.parentData],[I6.default.parentDataProperty,G.parentDataProperty],[I6.default.rootData,I6.default.rootData]];if(G.opts.dynamicRef)Y.push([I6.default.dynamicAnchors,I6.default.dynamicAnchors]);let L=J$._`${W}, ${D.object(...Y)}`;return J!==J$.nil?J$._`${Q}.call(${J}, ${L})`:J$._`${Q}(${L})`}GL.callValidateCode=yw;var lw=J$._`new RegExp`;function hw({gen:$,it:{opts:v}},D){let I=v.unicodeRegExp?"u":"",{regExp:U}=v.code,X=U(D,I);return $.scopeValue("pattern",{key:X.toString(),ref:X,code:J$._`${U.code==="new RegExp"?lw:(0,Cw.useFunc)($,U)}(${D}, ${I})`})}GL.usePattern=hw;function rw($){let{gen:v,data:D,keyword:I,it:U}=$,X=v.name("valid");if(U.allErrors){let Q=v.let("valid",!0);return G(()=>v.assign(Q,!1)),Q}return v.var(X,!0),G(()=>v.break()),X;function G(Q){let J=v.const("len",J$._`${D}.length`);v.forRange("i",0,J,(z)=>{$.subschema({keyword:I,dataProp:z,dataPropType:m9.Type.Num},X),v.if((0,J$.not)(X),Q)})}}GL.validateArray=rw;function mw($){let{gen:v,schema:D,keyword:I,it:U}=$;if(!Array.isArray(D))throw Error("ajv implementation error");if(D.some((J)=>(0,m9.alwaysValidSchema)(U,J))&&!U.opts.unevaluated)return;let G=v.let("valid",!1),Q=v.name("_valid");v.block(()=>D.forEach((J,z)=>{let W=$.subschema({keyword:I,schemaProp:z,compositeRule:!0},Q);if(v.assign(G,J$._`${G} || ${Q}`),!$.mergeValidEvaluated(W,Q))v.if((0,J$.not)(G))})),$.result(G,()=>$.reset(),()=>$.error(!0))}GL.validateUnion=mw});var LL=b((WL)=>{Object.defineProperty(WL,"__esModule",{value:!0});WL.validateKeywordUsage=WL.validSchemaType=WL.funcKeywordCode=WL.macroKeywordCode=void 0;var f$=_(),P6=n4(),IP=I4(),XP=lv();function GP($,v){let{gen:D,keyword:I,schema:U,parentSchema:X,it:G}=$,Q=v.macro.call(G.self,U,X,G),J=zL(D,I,Q);if(G.opts.validateSchema!==!1)G.self.validateSchema(Q,!0);let z=D.name("valid");$.subschema({schema:Q,schemaPath:f$.nil,errSchemaPath:`${G.errSchemaPath}/${I}`,topSchemaRef:J,compositeRule:!0},z),$.pass(z,()=>$.error(!0))}WL.macroKeywordCode=GP;function QP($,v){var D;let{gen:I,keyword:U,schema:X,parentSchema:G,$data:Q,it:J}=$;zP(J,v);let z=!Q&&v.compile?v.compile.call(J.self,X,G,J):v.validate,W=zL(I,U,z),Y=I.let("valid");$.block$data(Y,L),$.ok((D=v.valid)!==null&&D!==void 0?D:Y);function L(){if(v.errors===!1){if(N(),v.modifying)JL($);A(()=>$.error())}else{let F=v.async?V():B();if(v.modifying)JL($);A(()=>JP($,F))}}function V(){let F=I.let("ruleErrs",null);return I.try(()=>N(f$._`await `),(S)=>I.assign(Y,!1).if(f$._`${S} instanceof ${J.ValidationError}`,()=>I.assign(F,f$._`${S}.errors`),()=>I.throw(S))),F}function B(){let F=f$._`${W}.errors`;return I.assign(F,null),N(f$.nil),F}function N(F=v.async?f$._`await `:f$.nil){let S=J.opts.passContext?P6.default.this:P6.default.self,E=!(("compile"in v)&&!Q||v.schema===!1);I.assign(Y,f$._`${F}${(0,IP.callValidateCode)($,W,S,E)}`,v.modifying)}function A(F){var S;I.if((0,f$.not)((S=v.valid)!==null&&S!==void 0?S:Y),F)}}WL.funcKeywordCode=QP;function JL($){let{gen:v,data:D,it:I}=$;v.if(I.parentData,()=>v.assign(D,f$._`${I.parentData}[${I.parentDataProperty}]`))}function JP($,v){let{gen:D}=$;D.if(f$._`Array.isArray(${v})`,()=>{D.assign(P6.default.vErrors,f$._`${P6.default.vErrors} === null ? ${v} : ${P6.default.vErrors}.concat(${v})`).assign(P6.default.errors,f$._`${P6.default.vErrors}.length`),(0,XP.extendErrors)($)},()=>$.error())}function zP({schemaEnv:$},v){if(v.async&&!$.$async)throw Error("async keyword in sync schema")}function zL($,v,D){if(D===void 0)throw Error(`keyword "${v}" failed to compile`);return $.scopeValue("keyword",typeof D=="function"?{ref:D}:{ref:D,code:(0,f$.stringify)(D)})}function WP($,v,D=!1){return!v.length||v.some((I)=>I==="array"?Array.isArray($):I==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==I||D&&typeof $>"u")}WL.validSchemaType=WP;function YP({schema:$,opts:v,self:D,errSchemaPath:I},U,X){if(Array.isArray(U.keyword)?!U.keyword.includes(X):U.keyword!==X)throw Error("ajv implementation error");let G=U.dependencies;if(G===null||G===void 0?void 0:G.some((Q)=>!Object.prototype.hasOwnProperty.call($,Q)))throw Error(`parent schema must have dependencies of ${X}: ${G.join(",")}`);if(U.validateSchema){if(!U.validateSchema($[X])){let J=`keyword "${X}" value is invalid at path "${I}": `+D.errorsText(U.validateSchema.errors);if(v.validateSchema==="log")D.logger.error(J);else throw Error(J)}}}WL.validateKeywordUsage=YP});var NL=b((BL)=>{Object.defineProperty(BL,"__esModule",{value:!0});BL.extendSubschemaMode=BL.extendSubschemaData=BL.getSubschema=void 0;var w4=_(),VL=d();function KP($,{keyword:v,schemaProp:D,schema:I,schemaPath:U,errSchemaPath:X,topSchemaRef:G}){if(v!==void 0&&I!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(v!==void 0){let Q=$.schema[v];return D===void 0?{schema:Q,schemaPath:w4._`${$.schemaPath}${(0,w4.getProperty)(v)}`,errSchemaPath:`${$.errSchemaPath}/${v}`}:{schema:Q[D],schemaPath:w4._`${$.schemaPath}${(0,w4.getProperty)(v)}${(0,w4.getProperty)(D)}`,errSchemaPath:`${$.errSchemaPath}/${v}/${(0,VL.escapeFragment)(D)}`}}if(I!==void 0){if(U===void 0||X===void 0||G===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:I,schemaPath:U,topSchemaRef:G,errSchemaPath:X}}throw Error('either "keyword" or "schema" must be passed')}BL.getSubschema=KP;function NP($,v,{dataProp:D,dataPropType:I,data:U,dataTypes:X,propertyName:G}){if(U!==void 0&&D!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Q}=v;if(D!==void 0){let{errorPath:z,dataPathArr:W,opts:Y}=v,L=Q.let("data",w4._`${v.data}${(0,w4.getProperty)(D)}`,!0);J(L),$.errorPath=w4.str`${z}${(0,VL.getErrorPath)(D,I,Y.jsPropertySyntax)}`,$.parentDataProperty=w4._`${D}`,$.dataPathArr=[...W,$.parentDataProperty]}if(U!==void 0){let z=U instanceof w4.Name?U:Q.let("data",U,!0);if(J(z),G!==void 0)$.propertyName=G}if(X)$.dataTypes=X;function J(z){$.data=z,$.dataLevel=v.dataLevel+1,$.dataTypes=[],v.definedProperties=new Set,$.parentData=v.data,$.dataNames=[...v.dataNames,z]}}BL.extendSubschemaData=NP;function ZP($,{jtdDiscriminator:v,jtdMetadata:D,compositeRule:I,createErrors:U,allErrors:X}){if(I!==void 0)$.compositeRule=I;if(U!==void 0)$.createErrors=U;if(X!==void 0)$.allErrors=X;$.jtdDiscriminator=v,$.jtdMetadata=D}BL.extendSubschemaMode=ZP});var t9=b((X_,ZL)=>{ZL.exports=function $(v,D){if(v===D)return!0;if(v&&D&&typeof v=="object"&&typeof D=="object"){if(v.constructor!==D.constructor)return!1;var I,U,X;if(Array.isArray(v)){if(I=v.length,I!=D.length)return!1;for(U=I;U--!==0;)if(!$(v[U],D[U]))return!1;return!0}if(v.constructor===RegExp)return v.source===D.source&&v.flags===D.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===D.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===D.toString();if(X=Object.keys(v),I=X.length,I!==Object.keys(D).length)return!1;for(U=I;U--!==0;)if(!Object.prototype.hasOwnProperty.call(D,X[U]))return!1;for(U=I;U--!==0;){var G=X[U];if(!$(v[G],D[G]))return!1}return!0}return v!==v&&D!==D}});var HL=b((G_,AL)=>{var X6=AL.exports=function($,v,D){if(typeof v=="function")D=v,v={};D=v.cb||D;var I=typeof D=="function"?D:D.pre||function(){},U=D.post||function(){};jD(v,I,U,$,"",$)};X6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};X6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};X6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};X6.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 jD($,v,D,I,U,X,G,Q,J,z){if(I&&typeof I=="object"&&!Array.isArray(I)){v(I,U,X,G,Q,J,z);for(var W in I){var Y=I[W];if(Array.isArray(Y)){if(W in X6.arrayKeywords)for(var L=0;L<Y.length;L++)jD($,v,D,Y[L],U+"/"+W+"/"+L,X,U,W,I,L)}else if(W in X6.propsKeywords){if(Y&&typeof Y=="object")for(var V in Y)jD($,v,D,Y[V],U+"/"+W+"/"+FP(V),X,U,W,I,V)}else if(W in X6.keywords||$.allKeys&&!(W in X6.skipKeywords))jD($,v,D,Y,U+"/"+W,X,U,W,I)}D(I,U,X,G,Q,J,z)}}function FP($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var rv=b((wL)=>{Object.defineProperty(wL,"__esModule",{value:!0});wL.getSchemaRefs=wL.resolveUrl=wL.normalizeId=wL._getFullPath=wL.getFullPath=wL.inlineRef=void 0;var OP=d(),jP=t9(),wP=HL(),PP=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function MP($,v=!0){if(typeof $=="boolean")return!0;if(v===!0)return!p9($);if(!v)return!1;return FL($)<=v}wL.inlineRef=MP;var bP=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function p9($){for(let v in $){if(bP.has(v))return!0;let D=$[v];if(Array.isArray(D)&&D.some(p9))return!0;if(typeof D=="object"&&p9(D))return!0}return!1}function FL($){let v=0;for(let D in $){if(D==="$ref")return 1/0;if(v++,PP.has(D))continue;if(typeof $[D]=="object")(0,OP.eachItem)($[D],(I)=>v+=FL(I));if(v===1/0)return 1/0}return v}function OL($,v="",D){if(D!==!1)v=H1(v);let I=$.parse(v);return jL($,I)}wL.getFullPath=OL;function jL($,v){return $.serialize(v).split("#")[0]+"#"}wL._getFullPath=jL;var qP=/#\/?$/;function H1($){return $?$.replace(qP,""):""}wL.normalizeId=H1;function SP($,v,D){return D=H1(D),$.resolve(v,D)}wL.resolveUrl=SP;var kP=/^[a-z_][-a-z0-9._]*$/i;function TP($,v){if(typeof $=="boolean")return{};let{schemaId:D,uriResolver:I}=this.opts,U=H1($[D]||v),X={"":U},G=OL(I,U,!1),Q={},J=new Set;return wP($,{allKeys:!0},(Y,L,V,B)=>{if(B===void 0)return;let N=G+L,A=X[B];if(typeof Y[D]=="string")A=F.call(this,Y[D]);S.call(this,Y.$anchor),S.call(this,Y.$dynamicAnchor),X[L]=A;function F(E){let g=this.opts.uriResolver.resolve;if(E=H1(A?g(A,E):E),J.has(E))throw W(E);J.add(E);let k=this.refs[E];if(typeof k=="string")k=this.refs[k];if(typeof k=="object")z(Y,k.schema,E);else if(E!==H1(N))if(E[0]==="#")z(Y,Q[E],E),Q[E]=Y;else this.refs[E]=N;return E}function S(E){if(typeof E=="string"){if(!kP.test(E))throw Error(`invalid anchor "${E}"`);F.call(this,`#${E}`)}}}),Q;function z(Y,L,V){if(L!==void 0&&!jP(Y,L))throw W(V)}function W(Y){return Error(`reference "${Y}" resolves to more than one schema`)}}wL.getSchemaRefs=TP});var dv=b((fL)=>{Object.defineProperty(fL,"__esModule",{value:!0});fL.getData=fL.KeywordCxt=fL.validateFunctionCode=void 0;var kL=l7(),ML=hv(),a9=y9(),wD=hv(),iP=DL(),cv=LL(),o9=NL(),u=_(),n=n4(),nP=rv(),x4=d(),mv=lv();function xP($){if(uL($)){if(gL($),EL($)){yP($);return}}TL($,()=>(0,kL.topBoolOrEmptySchema)($))}fL.validateFunctionCode=xP;function TL({gen:$,validateName:v,schema:D,schemaEnv:I,opts:U},X){if(U.code.es5)$.func(v,u._`${n.default.data}, ${n.default.valCxt}`,I.$async,()=>{$.code(u._`"use strict"; ${bL(D,U)}`),_P($,U),$.code(X)});else $.func(v,u._`${n.default.data}, ${fP(U)}`,I.$async,()=>$.code(bL(D,U)).code(X))}function fP($){return u._`{${n.default.instancePath}="", ${n.default.parentData}, ${n.default.parentDataProperty}, ${n.default.rootData}=${n.default.data}${$.dynamicRef?u._`, ${n.default.dynamicAnchors}={}`:u.nil}}={}`}function _P($,v){$.if(n.default.valCxt,()=>{if($.var(n.default.instancePath,u._`${n.default.valCxt}.${n.default.instancePath}`),$.var(n.default.parentData,u._`${n.default.valCxt}.${n.default.parentData}`),$.var(n.default.parentDataProperty,u._`${n.default.valCxt}.${n.default.parentDataProperty}`),$.var(n.default.rootData,u._`${n.default.valCxt}.${n.default.rootData}`),v.dynamicRef)$.var(n.default.dynamicAnchors,u._`${n.default.valCxt}.${n.default.dynamicAnchors}`)},()=>{if($.var(n.default.instancePath,u._`""`),$.var(n.default.parentData,u._`undefined`),$.var(n.default.parentDataProperty,u._`undefined`),$.var(n.default.rootData,n.default.data),v.dynamicRef)$.var(n.default.dynamicAnchors,u._`{}`)})}function yP($){let{schema:v,opts:D,gen:I}=$;TL($,()=>{if(D.$comment&&v.$comment)CL($);if(cP($),I.let(n.default.vErrors,null),I.let(n.default.errors,0),D.unevaluated)lP($);RL($),pP($)});return}function lP($){let{gen:v,validateName:D}=$;$.evaluated=v.const("evaluated",u._`${D}.evaluated`),v.if(u._`${$.evaluated}.dynamicProps`,()=>v.assign(u._`${$.evaluated}.props`,u._`undefined`)),v.if(u._`${$.evaluated}.dynamicItems`,()=>v.assign(u._`${$.evaluated}.items`,u._`undefined`))}function bL($,v){let D=typeof $=="object"&&$[v.schemaId];return D&&(v.code.source||v.code.process)?u._`/*# sourceURL=${D} */`:u.nil}function hP($,v){if(uL($)){if(gL($),EL($)){rP($,v);return}}(0,kL.boolOrEmptySchema)($,v)}function EL({schema:$,self:v}){if(typeof $=="boolean")return!$;for(let D in $)if(v.RULES.all[D])return!0;return!1}function uL($){return typeof $.schema!="boolean"}function rP($,v){let{schema:D,gen:I,opts:U}=$;if(U.$comment&&D.$comment)CL($);dP($),tP($);let X=I.const("_errs",n.default.errors);RL($,X),I.var(v,u._`${X} === ${n.default.errors}`)}function gL($){(0,x4.checkUnknownRules)($),mP($)}function RL($,v){if($.opts.jtd)return qL($,[],!1,v);let D=(0,ML.getSchemaTypes)($.schema),I=(0,ML.coerceAndCheckDataType)($,D);qL($,D,!I,v)}function mP($){let{schema:v,errSchemaPath:D,opts:I,self:U}=$;if(v.$ref&&I.ignoreKeywordsWithRef&&(0,x4.schemaHasRulesButRef)(v,U.RULES))U.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function cP($){let{schema:v,opts:D}=$;if(v.default!==void 0&&D.useDefaults&&D.strictSchema)(0,x4.checkStrictMode)($,"default is ignored in the schema root")}function dP($){let v=$.schema[$.opts.schemaId];if(v)$.baseId=(0,nP.resolveUrl)($.opts.uriResolver,$.baseId,v)}function tP($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function CL({gen:$,schemaEnv:v,schema:D,errSchemaPath:I,opts:U}){let X=D.$comment;if(U.$comment===!0)$.code(u._`${n.default.self}.logger.log(${X})`);else if(typeof U.$comment=="function"){let G=u.str`${I}/$comment`,Q=$.scopeValue("root",{ref:v.root});$.code(u._`${n.default.self}.opts.$comment(${X}, ${G}, ${Q}.schema)`)}}function pP($){let{gen:v,schemaEnv:D,validateName:I,ValidationError:U,opts:X}=$;if(D.$async)v.if(u._`${n.default.errors} === 0`,()=>v.return(n.default.data),()=>v.throw(u._`new ${U}(${n.default.vErrors})`));else{if(v.assign(u._`${I}.errors`,n.default.vErrors),X.unevaluated)oP($);v.return(u._`${n.default.errors} === 0`)}}function oP({gen:$,evaluated:v,props:D,items:I}){if(D instanceof u.Name)$.assign(u._`${v}.props`,D);if(I instanceof u.Name)$.assign(u._`${v}.items`,I)}function qL($,v,D,I){let{gen:U,schema:X,data:G,allErrors:Q,opts:J,self:z}=$,{RULES:W}=z;if(X.$ref&&(J.ignoreKeywordsWithRef||!(0,x4.schemaHasRulesButRef)(X,W))){U.block(()=>nL($,"$ref",W.all.$ref.definition));return}if(!J.jtd)aP($,v);U.block(()=>{for(let L of W.rules)Y(L);Y(W.post)});function Y(L){if(!(0,a9.shouldUseGroup)(X,L))return;if(L.type){if(U.if((0,wD.checkDataType)(L.type,G,J.strictNumbers)),SL($,L),v.length===1&&v[0]===L.type&&D)U.else(),(0,wD.reportTypeError)($);U.endIf()}else SL($,L);if(!Q)U.if(u._`${n.default.errors} === ${I||0}`)}}function SL($,v){let{gen:D,schema:I,opts:{useDefaults:U}}=$;if(U)(0,iP.assignDefaults)($,v.type);D.block(()=>{for(let X of v.rules)if((0,a9.shouldUseRule)(I,X))nL($,X.keyword,X.definition,v.type)})}function aP($,v){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(eP($,v),!$.opts.allowUnionTypes)sP($,v);$M($,$.dataTypes)}function eP($,v){if(!v.length)return;if(!$.dataTypes.length){$.dataTypes=v;return}v.forEach((D)=>{if(!iL($.dataTypes,D))e9($,`type "${D}" not allowed by context "${$.dataTypes.join(",")}"`)}),UM($,v)}function sP($,v){if(v.length>1&&!(v.length===2&&v.includes("null")))e9($,"use allowUnionTypes to allow union type keyword")}function $M($,v){let D=$.self.RULES.all;for(let I in D){let U=D[I];if(typeof U=="object"&&(0,a9.shouldUseRule)($.schema,U)){let{type:X}=U.definition;if(X.length&&!X.some((G)=>vM(v,G)))e9($,`missing type "${X.join(",")}" for keyword "${I}"`)}}}function vM($,v){return $.includes(v)||v==="number"&&$.includes("integer")}function iL($,v){return $.includes(v)||v==="integer"&&$.includes("number")}function UM($,v){let D=[];for(let I of $.dataTypes)if(iL(v,I))D.push(I);else if(v.includes("integer")&&I==="number")D.push("integer");$.dataTypes=D}function e9($,v){let D=$.schemaEnv.baseId+$.errSchemaPath;v+=` at "${D}" (strictTypes)`,(0,x4.checkStrictMode)($,v,$.opts.strictTypes)}class s9{constructor($,v,D){if((0,cv.validateKeywordUsage)($,v,D),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=D,this.data=$.data,this.schema=$.schema[D],this.$data=v.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,x4.schemaRefOrVal)($,this.schema,D,this.$data),this.schemaType=v.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=v,this.$data)this.schemaCode=$.gen.const("vSchema",xL(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,cv.validSchemaType)(this.schema,v.schemaType,v.allowUndefined))throw Error(`${D} value must be ${JSON.stringify(v.schemaType)}`);if("code"in v?v.trackErrors:v.errors!==!1)this.errsCount=$.gen.const("_errs",n.default.errors)}result($,v,D){this.failResult((0,u.not)($),v,D)}failResult($,v,D){if(this.gen.if($),D)D();else this.error();if(v){if(this.gen.else(),v(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,v){this.failResult((0,u.not)($),void 0,v)}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:v}=this;this.fail(u._`${v} !== undefined && (${(0,u.or)(this.invalid$data(),$)})`)}error($,v,D){if(v){this.setParams(v),this._error($,D),this.setParams({});return}this._error($,D)}_error($,v){($?mv.reportExtraError:mv.reportError)(this,this.def.error,v)}$dataError(){(0,mv.reportError)(this,this.def.$dataError||mv.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,mv.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,v){if(v)Object.assign(this.params,$);else this.params=$}block$data($,v,D=u.nil){this.gen.block(()=>{this.check$data($,D),v()})}check$data($=u.nil,v=u.nil){if(!this.$data)return;let{gen:D,schemaCode:I,schemaType:U,def:X}=this;if(D.if((0,u.or)(u._`${I} === undefined`,v)),$!==u.nil)D.assign($,!0);if(U.length||X.validateSchema){if(D.elseIf(this.invalid$data()),this.$dataError(),$!==u.nil)D.assign($,!1)}D.else()}invalid$data(){let{gen:$,schemaCode:v,schemaType:D,def:I,it:U}=this;return(0,u.or)(X(),G());function X(){if(D.length){if(!(v instanceof u.Name))throw Error("ajv implementation error");let Q=Array.isArray(D)?D:[D];return u._`${(0,wD.checkDataTypes)(Q,v,U.opts.strictNumbers,wD.DataType.Wrong)}`}return u.nil}function G(){if(I.validateSchema){let Q=$.scopeValue("validate$data",{ref:I.validateSchema});return u._`!${Q}(${v})`}return u.nil}}subschema($,v){let D=(0,o9.getSubschema)(this.it,$);(0,o9.extendSubschemaData)(D,this.it,$),(0,o9.extendSubschemaMode)(D,$);let I={...this.it,...D,items:void 0,props:void 0};return hP(I,v),I}mergeEvaluated($,v){let{it:D,gen:I}=this;if(!D.opts.unevaluated)return;if(D.props!==!0&&$.props!==void 0)D.props=x4.mergeEvaluated.props(I,$.props,D.props,v);if(D.items!==!0&&$.items!==void 0)D.items=x4.mergeEvaluated.items(I,$.items,D.items,v)}mergeValidEvaluated($,v){let{it:D,gen:I}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return I.if(v,()=>this.mergeEvaluated($,u.Name)),!0}}fL.KeywordCxt=s9;function nL($,v,D,I){let U=new s9($,D,v);if("code"in D)D.code(U,I);else if(U.$data&&D.validate)(0,cv.funcKeywordCode)(U,D);else if("macro"in D)(0,cv.macroKeywordCode)(U,D);else if(D.compile||D.validate)(0,cv.funcKeywordCode)(U,D)}var DM=/^\/(?:[^~]|~0|~1)*$/,IM=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function xL($,{dataLevel:v,dataNames:D,dataPathArr:I}){let U,X;if($==="")return n.default.rootData;if($[0]==="/"){if(!DM.test($))throw Error(`Invalid JSON-pointer: ${$}`);U=$,X=n.default.rootData}else{let z=IM.exec($);if(!z)throw Error(`Invalid JSON-pointer: ${$}`);let W=+z[1];if(U=z[2],U==="#"){if(W>=v)throw Error(J("property/index",W));return I[v-W]}if(W>v)throw Error(J("data",W));if(X=D[v-W],!U)return X}let G=X,Q=U.split("/");for(let z of Q)if(z)X=u._`${X}${(0,u.getProperty)((0,x4.unescapeJsonPointer)(z))}`,G=u._`${G} && ${X}`;return G;function J(z,W){return`Cannot access ${z} ${W} levels up, current level is ${v}`}}fL.getData=xL});var PD=b((lL)=>{Object.defineProperty(lL,"__esModule",{value:!0});class yL extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}lL.default=yL});var tv=b((rL)=>{Object.defineProperty(rL,"__esModule",{value:!0});var $z=rv();class hL extends Error{constructor($,v,D,I){super(I||`can't resolve reference ${D} from id ${v}`);this.missingRef=(0,$z.resolveUrl)($,v,D),this.missingSchema=(0,$z.normalizeId)((0,$z.getFullPath)($,this.missingRef))}}rL.default=hL});var bD=b((dL)=>{Object.defineProperty(dL,"__esModule",{value:!0});dL.resolveSchema=dL.getCompilingSchema=dL.resolveRef=dL.compileSchema=dL.SchemaEnv=void 0;var Y4=_(),zM=PD(),M6=n4(),L4=rv(),mL=d(),WM=dv();class pv{constructor($){var v;this.refs={},this.dynamicAnchors={};let D;if(typeof $.schema=="object")D=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(v=$.baseId)!==null&&v!==void 0?v:(0,L4.normalizeId)(D===null||D===void 0?void 0:D[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=D===null||D===void 0?void 0:D.$async,this.refs={}}}dL.SchemaEnv=pv;function Uz($){let v=cL.call(this,$);if(v)return v;let D=(0,L4.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:I,lines:U}=this.opts.code,{ownProperties:X}=this.opts,G=new Y4.CodeGen(this.scope,{es5:I,lines:U,ownProperties:X}),Q;if($.$async)Q=G.scopeValue("Error",{ref:zM.default,code:Y4._`require("ajv/dist/runtime/validation_error").default`});let J=G.scopeName("validate");$.validateName=J;let z={gen:G,allErrors:this.opts.allErrors,data:M6.default.data,parentData:M6.default.parentData,parentDataProperty:M6.default.parentDataProperty,dataNames:[M6.default.data],dataPathArr:[Y4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:G.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,Y4.stringify)($.schema)}:{ref:$.schema}),validateName:J,ValidationError:Q,schema:$.schema,schemaEnv:$,rootId:D,baseId:$.baseId||D,schemaPath:Y4.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:Y4._`""`,opts:this.opts,self:this},W;try{this._compilations.add($),(0,WM.validateFunctionCode)(z),G.optimize(this.opts.code.optimize);let Y=G.toString();if(W=`${G.scopeRefs(M6.default.scope)}return ${Y}`,this.opts.code.process)W=this.opts.code.process(W,$);let V=Function(`${M6.default.self}`,`${M6.default.scope}`,W)(this,this.scope.get());if(this.scope.value(J,{ref:V}),V.errors=null,V.schema=$.schema,V.schemaEnv=$,$.$async)V.$async=!0;if(this.opts.code.source===!0)V.source={validateName:J,validateCode:Y,scopeValues:G._values};if(this.opts.unevaluated){let{props:B,items:N}=z;if(V.evaluated={props:B instanceof Y4.Name?void 0:B,items:N instanceof Y4.Name?void 0:N,dynamicProps:B instanceof Y4.Name,dynamicItems:N instanceof Y4.Name},V.source)V.source.evaluated=(0,Y4.stringify)(V.evaluated)}return $.validate=V,$}catch(Y){if(delete $.validate,delete $.validateName,W)this.logger.error("Error compiling schema, function code:",W);throw Y}finally{this._compilations.delete($)}}dL.compileSchema=Uz;function YM($,v,D){var I;D=(0,L4.resolveUrl)(this.opts.uriResolver,v,D);let U=$.refs[D];if(U)return U;let X=BM.call(this,$,D);if(X===void 0){let G=(I=$.localRefs)===null||I===void 0?void 0:I[D],{schemaId:Q}=this.opts;if(G)X=new pv({schema:G,schemaId:Q,root:$,baseId:v})}if(X===void 0)return;return $.refs[D]=LM.call(this,X)}dL.resolveRef=YM;function LM($){if((0,L4.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:Uz.call(this,$)}function cL($){for(let v of this._compilations)if(VM(v,$))return v}dL.getCompilingSchema=cL;function VM($,v){return $.schema===v.schema&&$.root===v.root&&$.baseId===v.baseId}function BM($,v){let D;while(typeof(D=this.refs[v])=="string")v=D;return D||this.schemas[v]||MD.call(this,$,v)}function MD($,v){let D=this.opts.uriResolver.parse(v),I=(0,L4._getFullPath)(this.opts.uriResolver,D),U=(0,L4.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&I===U)return vz.call(this,D,$);let X=(0,L4.normalizeId)(I),G=this.refs[X]||this.schemas[X];if(typeof G=="string"){let Q=MD.call(this,$,G);if(typeof(Q===null||Q===void 0?void 0:Q.schema)!=="object")return;return vz.call(this,D,Q)}if(typeof(G===null||G===void 0?void 0:G.schema)!=="object")return;if(!G.validate)Uz.call(this,G);if(X===(0,L4.normalizeId)(v)){let{schema:Q}=G,{schemaId:J}=this.opts,z=Q[J];if(z)U=(0,L4.resolveUrl)(this.opts.uriResolver,U,z);return new pv({schema:Q,schemaId:J,root:$,baseId:U})}return vz.call(this,D,G)}dL.resolveSchema=MD;var KM=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function vz($,{baseId:v,schema:D,root:I}){var U;if(((U=$.fragment)===null||U===void 0?void 0:U[0])!=="/")return;for(let Q of $.fragment.slice(1).split("/")){if(typeof D==="boolean")return;let J=D[(0,mL.unescapeFragment)(Q)];if(J===void 0)return;D=J;let z=typeof D==="object"&&D[this.opts.schemaId];if(!KM.has(Q)&&z)v=(0,L4.resolveUrl)(this.opts.uriResolver,v,z)}let X;if(typeof D!="boolean"&&D.$ref&&!(0,mL.schemaHasRulesButRef)(D,this.RULES)){let Q=(0,L4.resolveUrl)(this.opts.uriResolver,v,D.$ref);X=MD.call(this,I,Q)}let{schemaId:G}=this.opts;if(X=X||new pv({schema:D,schemaId:G,root:I,baseId:v}),X.schema!==X.root.schema)return X;return}});var pL=b((L_,FM)=>{FM.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 Xz=b((V_,vV)=>{var OM=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),aL=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),Dz=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),eL=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),jM=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Iz($){let v="",D=0,I=0;for(I=0;I<$.length;I++){if(D=$[I].charCodeAt(0),D===48)continue;if(!(D>=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";v+=$[I];break}for(I+=1;I<$.length;I++){if(D=$[I].charCodeAt(0),!(D>=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";v+=$[I]}return v}var wM=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function oL($){return $.length=0,!0}function PM($,v,D){if($.length){let I=Iz($);if(I!=="")v.push(I);else return D.error=!0,!1;$.length=0}return!0}function MM($){let v=0,D={error:!1,address:"",zone:""},I=[],U=[],X=!1,G=!1,Q=PM;for(let J=0;J<$.length;J++){let z=$[J];if(z==="["||z==="]")continue;if(z===":"){if(X===!0)G=!0;if(!Q(U,I,D))break;if(++v>7){D.error=!0;break}if(J>0&&$[J-1]===":")X=!0;I.push(":");continue}else if(z==="%"){if(!Q(U,I,D))break;Q=oL}else{U.push(z);continue}}if(U.length)if(Q===oL)D.zone=U.join("");else if(G)I.push(U.join(""));else I.push(Iz(U));return D.address=I.join(""),D}function sL($){if(bM($,":")<2)return{host:$,isIPV6:!1};let v=MM($);if(!v.error){let{address:D,address:I}=v;if(v.zone)D+="%"+v.zone,I+="%25"+v.zone;return{host:D,isIPV6:!0,escapedHost:I}}else return{host:$,isIPV6:!1}}function bM($,v){let D=0;for(let I=0;I<$.length;I++)if($[I]===v)D++;return D}function qM($){let v=$,D=[],I=-1,U=0;while(U=v.length){if(U===1)if(v===".")break;else if(v==="/"){D.push("/");break}else{D.push(v);break}else if(U===2){if(v[0]==="."){if(v[1]===".")break;else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"){if(v[1]==="."||v[1]==="/"){D.push("/");break}}}else if(U===3){if(v==="/.."){if(D.length!==0)D.pop();D.push("/");break}}if(v[0]==="."){if(v[1]==="."){if(v[2]==="/"){v=v.slice(3);continue}}else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"){if(v[1]==="."){if(v[2]==="/"){v=v.slice(2);continue}else if(v[2]==="."){if(v[3]==="/"){if(v=v.slice(3),D.length!==0)D.pop();continue}}}}if((I=v.indexOf("/",1))===-1){D.push(v);break}else D.push(v.slice(0,I)),v=v.slice(I)}return D.join("")}var SM={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},kM=/[@/?#:]/g,TM=/[@/?#]/g;function $V($,v){let D=v?TM:kM;return D.lastIndex=0,$.replace(D,(I)=>SM[I])}function EM($,v=!1){if($.indexOf("%")===-1)return $;let D="";for(let I=0;I<$.length;I++){if($[I]==="%"&&I+2<$.length){let U=$.slice(I+1,I+3);if(Dz(U)){let X=U.toUpperCase(),G=String.fromCharCode(parseInt(X,16));if(v&&eL(G))D+=G;else D+="%"+X;I+=2;continue}}D+=$[I]}return D}function uM($){let v="";for(let D=0;D<$.length;D++){if($[D]==="%"&&D+2<$.length){let I=$.slice(D+1,D+3);if(Dz(I)){let U=I.toUpperCase(),X=String.fromCharCode(parseInt(U,16));if(X!=="."&&eL(X))v+=X;else v+="%"+U;D+=2;continue}}if(jM($[D]))v+=$[D];else v+=escape($[D])}return v}function gM($){let v="";for(let D=0;D<$.length;D++){if($[D]==="%"&&D+2<$.length){let I=$.slice(D+1,D+3);if(Dz(I)){v+="%"+I.toUpperCase(),D+=2;continue}}v+=escape($[D])}return v}function RM($){let v=[];if($.userinfo!==void 0)v.push($.userinfo),v.push("@");if($.host!==void 0){let D=unescape($.host);if(!aL(D)){let I=sL(D);if(I.isIPV6===!0)D=`[${I.escapedHost}]`;else D=$V(D,!1)}v.push(D)}if(typeof $.port==="number"||typeof $.port==="string")v.push(":"),v.push(String($.port));return v.length?v.join(""):void 0}vV.exports={nonSimpleDomain:wM,recomposeAuthority:RM,reescapeHostDelimiters:$V,normalizePercentEncoding:EM,normalizePathEncoding:uM,escapePreservingEscapes:gM,removeDotSegments:qM,isIPv4:aL,isUUID:OM,normalizeIPv6:sL,stringArrayToHexStripped:Iz}});var GV=b((B_,XV)=>{var{isUUID:CM}=Xz(),iM=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,nM=["http","https","ws","wss","urn","urn:uuid"];function xM($){return nM.indexOf($)!==-1}function Gz($){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 UV($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function DV($){let v=String($.scheme).toLowerCase()==="https";if($.port===(v?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function fM($){return $.secure=Gz($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function _M($){if($.port===(Gz($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[v,D]=$.resourceName.split("?");$.path=v&&v!=="/"?v:void 0,$.query=D,$.resourceName=void 0}return $.fragment=void 0,$}function yM($,v){if(!$.path)return $.error="URN can not be parsed",$;let D=$.path.match(iM);if(D){let I=v.scheme||$.scheme||"urn";$.nid=D[1].toLowerCase(),$.nss=D[2];let U=`${I}:${v.nid||$.nid}`,X=Qz(U);if($.path=void 0,X)$=X.parse($,v)}else $.error=$.error||"URN can not be parsed.";return $}function lM($,v){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let D=v.scheme||$.scheme||"urn",I=$.nid.toLowerCase(),U=`${D}:${v.nid||I}`,X=Qz(U);if(X)$=X.serialize($,v);let G=$,Q=$.nss;return G.path=`${I||v.nid}:${Q}`,v.skipEscape=!0,G}function hM($,v){let D=$;if(D.uuid=D.nss,D.nss=void 0,!v.tolerant&&(!D.uuid||!CM(D.uuid)))D.error=D.error||"UUID is not valid.";return D}function rM($){let v=$;return v.nss=($.uuid||"").toLowerCase(),v}var IV={scheme:"http",domainHost:!0,parse:UV,serialize:DV},mM={scheme:"https",domainHost:IV.domainHost,parse:UV,serialize:DV},qD={scheme:"ws",domainHost:!0,parse:fM,serialize:_M},cM={scheme:"wss",domainHost:qD.domainHost,parse:qD.parse,serialize:qD.serialize},dM={scheme:"urn",parse:yM,serialize:lM,skipNormalize:!0},tM={scheme:"urn:uuid",parse:hM,serialize:rM,skipNormalize:!0},SD={http:IV,https:mM,ws:qD,wss:cM,urn:dM,"urn:uuid":tM};Object.setPrototypeOf(SD,null);function Qz($){return $&&(SD[$]||SD[$.toLowerCase()])||void 0}XV.exports={wsIsSecure:Gz,SCHEMES:SD,isValidSchemeName:xM,getSchemeHandler:Qz}});var LV=b((K_,kD)=>{var{normalizeIPv6:pM,removeDotSegments:ov,recomposeAuthority:oM,normalizePercentEncoding:aM,normalizePathEncoding:eM,escapePreservingEscapes:sM,reescapeHostDelimiters:$b,isIPv4:vb,nonSimpleDomain:Ub}=Xz(),{SCHEMES:Db,getSchemeHandler:JV}=GV();function Ib($,v){if(typeof $==="string")$=zb($,v);else if(typeof $==="object")$=F1(b6($,v),v);return $}function Xb($,v,D){let I=D?Object.assign({scheme:"null"},D):{scheme:"null"},U=zV(F1($,I),F1(v,I),I,!0);return I.skipEscape=!0,b6(U,I)}function zV($,v,D,I){let U={};if(!I)$=F1(b6($,D),D),v=F1(b6(v,D),D);if(D=D||{},!D.tolerant&&v.scheme)U.scheme=v.scheme,U.userinfo=v.userinfo,U.host=v.host,U.port=v.port,U.path=ov(v.path||""),U.query=v.query;else{if(v.userinfo!==void 0||v.host!==void 0||v.port!==void 0)U.userinfo=v.userinfo,U.host=v.host,U.port=v.port,U.path=ov(v.path||""),U.query=v.query;else{if(!v.path)if(U.path=$.path,v.query!==void 0)U.query=v.query;else U.query=$.query;else{if(v.path[0]==="/")U.path=ov(v.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)U.path="/"+v.path;else if(!$.path)U.path=v.path;else U.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+v.path;U.path=ov(U.path)}U.query=v.query}U.userinfo=$.userinfo,U.host=$.host,U.port=$.port}U.scheme=$.scheme}return U.fragment=v.fragment,U}function Gb($,v,D){let I=QV($,D),U=QV(v,D);return I!==void 0&&U!==void 0&&I.toLowerCase()===U.toLowerCase()}function b6($,v){let D={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:""},I=Object.assign({},v),U=[],X=JV(I.scheme||D.scheme);if(X&&X.serialize)X.serialize(D,I);if(D.path!==void 0)if(!I.skipEscape){if(D.path=sM(D.path),D.scheme!==void 0)D.path=D.path.split("%3A").join(":")}else D.path=aM(D.path);if(I.reference!=="suffix"&&D.scheme)U.push(D.scheme,":");let G=oM(D);if(G!==void 0){if(I.reference!=="suffix")U.push("//");if(U.push(G),D.path&&D.path[0]!=="/")U.push("/")}if(D.path!==void 0){let Q=D.path;if(!I.absolutePath&&(!X||!X.absolutePath))Q=ov(Q);if(G===void 0&&Q[0]==="/"&&Q[1]==="/")Q="/%2F"+Q.slice(2);U.push(Q)}if(D.query!==void 0)U.push("?",D.query);if(D.fragment!==void 0)U.push("#",D.fragment);return U.join("")}var Qb=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Jb($,v){if(v[2]!==void 0&&$.path&&$.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof $.port==="number"&&($.port<0||$.port>65535))return"URI port is malformed.";return}function WV($,v){let D=Object.assign({},v),I={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},U=!1,X=!1;if(D.reference==="suffix")if(D.scheme)$=D.scheme+":"+$;else $="//"+$;let G=$.match(Qb);if(G){if(I.scheme=G[1],I.userinfo=G[3],I.host=G[4],I.port=parseInt(G[5],10),I.path=G[6]||"",I.query=G[7],I.fragment=G[8],isNaN(I.port))I.port=G[5];let Q=Jb(I,G);if(Q!==void 0)I.error=I.error||Q,U=!0;if(I.host)if(vb(I.host)===!1){let W=pM(I.host);I.host=W.host.toLowerCase(),X=W.isIPV6}else X=!0;if(I.scheme===void 0&&I.userinfo===void 0&&I.host===void 0&&I.port===void 0&&I.query===void 0&&!I.path)I.reference="same-document";else if(I.scheme===void 0)I.reference="relative";else if(I.fragment===void 0)I.reference="absolute";else I.reference="uri";if(D.reference&&D.reference!=="suffix"&&D.reference!==I.reference)I.error=I.error||"URI is not a "+D.reference+" reference.";let J=JV(D.scheme||I.scheme);if(!D.unicodeSupport&&(!J||!J.unicodeSupport)){if(I.host&&(D.domainHost||J&&J.domainHost)&&X===!1&&Ub(I.host))try{I.host=URL.domainToASCII(I.host.toLowerCase())}catch(z){I.error=I.error||"Host's domain name can not be converted to ASCII: "+z}}if(!J||J&&!J.skipNormalize){if($.indexOf("%")!==-1){if(I.scheme!==void 0)I.scheme=unescape(I.scheme);if(I.host!==void 0)I.host=$b(unescape(I.host),X)}if(I.path)I.path=eM(I.path);if(I.fragment)try{I.fragment=encodeURI(decodeURIComponent(I.fragment))}catch{I.error=I.error||"URI malformed"}}if(J&&J.parse)J.parse(I,D)}else I.error=I.error||"URI can not be parsed.";return{parsed:I,malformedAuthorityOrPort:U}}function F1($,v){return WV($,v).parsed}function zb($,v){return YV($,v).normalized}function YV($,v){let{parsed:D,malformedAuthorityOrPort:I}=WV($,v);return{normalized:I?$:b6(D,v),malformedAuthorityOrPort:I}}function QV($,v){if(typeof $==="string"){let{normalized:D,malformedAuthorityOrPort:I}=YV($,v);return I?void 0:D}if(typeof $==="object")return b6($,v)}var Jz={SCHEMES:Db,normalize:Ib,resolve:Xb,resolveComponent:zV,equal:Gb,serialize:b6,parse:F1};kD.exports=Jz;kD.exports.default=Jz;kD.exports.fastUri=Jz});var KV=b((BV)=>{Object.defineProperty(BV,"__esModule",{value:!0});var VV=LV();VV.code='require("ajv/dist/runtime/uri").default';BV.default=VV});var wV=b((f4)=>{Object.defineProperty(f4,"__esModule",{value:!0});f4.CodeGen=f4.Name=f4.nil=f4.stringify=f4.str=f4._=f4.KeywordCxt=void 0;var Yb=dv();Object.defineProperty(f4,"KeywordCxt",{enumerable:!0,get:function(){return Yb.KeywordCxt}});var O1=_();Object.defineProperty(f4,"_",{enumerable:!0,get:function(){return O1._}});Object.defineProperty(f4,"str",{enumerable:!0,get:function(){return O1.str}});Object.defineProperty(f4,"stringify",{enumerable:!0,get:function(){return O1.stringify}});Object.defineProperty(f4,"nil",{enumerable:!0,get:function(){return O1.nil}});Object.defineProperty(f4,"Name",{enumerable:!0,get:function(){return O1.Name}});Object.defineProperty(f4,"CodeGen",{enumerable:!0,get:function(){return O1.CodeGen}});var Lb=PD(),FV=tv(),Vb=_9(),av=bD(),Bb=_(),ev=rv(),TD=hv(),Wz=d(),NV=pL(),Kb=KV(),OV=($,v)=>new RegExp($,v);OV.code="new RegExp";var Nb=["removeAdditional","useDefaults","coerceTypes"],Zb=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Ab={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."},Hb={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ZV=200;function Fb($){var v,D,I,U,X,G,Q,J,z,W,Y,L,V,B,N,A,F,S,E,g,k,N$,O$,k4,Q4;let _$=$.strict,C1=(v=$.code)===null||v===void 0?void 0:v.optimize,i1=C1===!0||C1===void 0?1:C1||0,n1=(I=(D=$.code)===null||D===void 0?void 0:D.regExp)!==null&&I!==void 0?I:OV,ZU=(U=$.uriResolver)!==null&&U!==void 0?U:Kb.default;return{strictSchema:(G=(X=$.strictSchema)!==null&&X!==void 0?X:_$)!==null&&G!==void 0?G:!0,strictNumbers:(J=(Q=$.strictNumbers)!==null&&Q!==void 0?Q:_$)!==null&&J!==void 0?J:!0,strictTypes:(W=(z=$.strictTypes)!==null&&z!==void 0?z:_$)!==null&&W!==void 0?W:"log",strictTuples:(L=(Y=$.strictTuples)!==null&&Y!==void 0?Y:_$)!==null&&L!==void 0?L:"log",strictRequired:(B=(V=$.strictRequired)!==null&&V!==void 0?V:_$)!==null&&B!==void 0?B:!1,code:$.code?{...$.code,optimize:i1,regExp:n1}:{optimize:i1,regExp:n1},loopRequired:(N=$.loopRequired)!==null&&N!==void 0?N:ZV,loopEnum:(A=$.loopEnum)!==null&&A!==void 0?A:ZV,meta:(F=$.meta)!==null&&F!==void 0?F:!0,messages:(S=$.messages)!==null&&S!==void 0?S:!0,inlineRefs:(E=$.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(g=$.schemaId)!==null&&g!==void 0?g:"$id",addUsedSchema:(k=$.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(N$=$.validateSchema)!==null&&N$!==void 0?N$:!0,validateFormats:(O$=$.validateFormats)!==null&&O$!==void 0?O$:!0,unicodeRegExp:(k4=$.unicodeRegExp)!==null&&k4!==void 0?k4:!0,int32range:(Q4=$.int32range)!==null&&Q4!==void 0?Q4:!0,uriResolver:ZU}}class ED{constructor($={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...Fb($)};let{es5:v,lines:D}=this.opts.code;this.scope=new Bb.ValueScope({scope:{},prefixes:Zb,es5:v,lines:D}),this.logger=bb($.logger);let I=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,Vb.getRules)(),AV.call(this,Ab,$,"NOT SUPPORTED"),AV.call(this,Hb,$,"DEPRECATED","warn"),this._metaOpts=Pb.call(this),$.formats)jb.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)wb.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);Ob.call(this),$.validateFormats=I}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:v,schemaId:D}=this.opts,I=NV;if(D==="id")I={...NV},I.id=I.$id,delete I.$id;if(v&&$)this.addMetaSchema(I,I[D],!1)}defaultMeta(){let{meta:$,schemaId:v}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[v]||$:void 0}validate($,v){let D;if(typeof $=="string"){if(D=this.getSchema($),!D)throw Error(`no schema with key or ref "${$}"`)}else D=this.compile($);let I=D(v);if(!("$async"in D))this.errors=D.errors;return I}compile($,v){let D=this._addSchema($,v);return D.validate||this._compileSchemaEnv(D)}compileAsync($,v){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:D}=this.opts;return I.call(this,$,v);async function I(z,W){await U.call(this,z.$schema);let Y=this._addSchema(z,W);return Y.validate||X.call(this,Y)}async function U(z){if(z&&!this.getSchema(z))await I.call(this,{$ref:z},!0)}async function X(z){try{return this._compileSchemaEnv(z)}catch(W){if(!(W instanceof FV.default))throw W;return G.call(this,W),await Q.call(this,W.missingSchema),X.call(this,z)}}function G({missingSchema:z,missingRef:W}){if(this.refs[z])throw Error(`AnySchema ${z} is loaded but ${W} cannot be resolved`)}async function Q(z){let W=await J.call(this,z);if(!this.refs[z])await U.call(this,W.$schema);if(!this.refs[z])this.addSchema(W,z,v)}async function J(z){let W=this._loading[z];if(W)return W;try{return await(this._loading[z]=D(z))}finally{delete this._loading[z]}}}addSchema($,v,D,I=this.opts.validateSchema){if(Array.isArray($)){for(let X of $)this.addSchema(X,void 0,D,I);return this}let U;if(typeof $==="object"){let{schemaId:X}=this.opts;if(U=$[X],U!==void 0&&typeof U!="string")throw Error(`schema ${X} must be string`)}return v=(0,ev.normalizeId)(v||U),this._checkUnique(v),this.schemas[v]=this._addSchema($,D,v,I,!0),this}addMetaSchema($,v,D=this.opts.validateSchema){return this.addSchema($,v,!0,D),this}validateSchema($,v){if(typeof $=="boolean")return!0;let D;if(D=$.$schema,D!==void 0&&typeof D!="string")throw Error("$schema must be a string");if(D=D||this.opts.defaultMeta||this.defaultMeta(),!D)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let I=this.validate(D,$);if(!I&&v){let U="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(U);else throw Error(U)}return I}getSchema($){let v;while(typeof(v=HV.call(this,$))=="string")$=v;if(v===void 0){let{schemaId:D}=this.opts,I=new av.SchemaEnv({schema:{},schemaId:D});if(v=av.resolveSchema.call(this,I,$),!v)return;this.refs[$]=v}return v.validate||this._compileSchemaEnv(v)}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 v=HV.call(this,$);if(typeof v=="object")this._cache.delete(v.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let v=$;this._cache.delete(v);let D=$[this.opts.schemaId];if(D)D=(0,ev.normalizeId)(D),delete this.schemas[D],delete this.refs[D];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let v of $)this.addKeyword(v);return this}addKeyword($,v){let D;if(typeof $=="string"){if(D=$,typeof v=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),v.keyword=D}else if(typeof $=="object"&&v===void 0){if(v=$,D=v.keyword,Array.isArray(D)&&!D.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Sb.call(this,D,v),!v)return(0,Wz.eachItem)(D,(U)=>zz.call(this,U)),this;Tb.call(this,v);let I={...v,type:(0,TD.getJSONTypes)(v.type),schemaType:(0,TD.getJSONTypes)(v.schemaType)};return(0,Wz.eachItem)(D,I.type.length===0?(U)=>zz.call(this,U,I):(U)=>I.type.forEach((X)=>zz.call(this,U,I,X))),this}getKeyword($){let v=this.RULES.all[$];return typeof v=="object"?v.definition:!!v}removeKeyword($){let{RULES:v}=this;delete v.keywords[$],delete v.all[$];for(let D of v.rules){let I=D.rules.findIndex((U)=>U.keyword===$);if(I>=0)D.rules.splice(I,1)}return this}addFormat($,v){if(typeof v=="string")v=new RegExp(v);return this.formats[$]=v,this}errorsText($=this.errors,{separator:v=", ",dataVar:D="data"}={}){if(!$||$.length===0)return"No errors";return $.map((I)=>`${D}${I.instancePath} ${I.message}`).reduce((I,U)=>I+v+U)}$dataMetaSchema($,v){let D=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let I of v){let U=I.split("/").slice(1),X=$;for(let G of U)X=X[G];for(let G in D){let Q=D[G];if(typeof Q!="object")continue;let{$data:J}=Q.definition,z=X[G];if(J&&z)X[G]=jV(z)}}return $}_removeAllSchemas($,v){for(let D in $){let I=$[D];if(!v||v.test(D)){if(typeof I=="string")delete $[D];else if(I&&!I.meta)this._cache.delete(I.schema),delete $[D]}}}_addSchema($,v,D,I=this.opts.validateSchema,U=this.opts.addUsedSchema){let X,{schemaId:G}=this.opts;if(typeof $=="object")X=$[G];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let Q=this._cache.get($);if(Q!==void 0)return Q;D=(0,ev.normalizeId)(X||D);let J=ev.getSchemaRefs.call(this,$,D);if(Q=new av.SchemaEnv({schema:$,schemaId:G,meta:v,baseId:D,localRefs:J}),this._cache.set(Q.schema,Q),U&&!D.startsWith("#")){if(D)this._checkUnique(D);this.refs[D]=Q}if(I)this.validateSchema($,!0);return Q}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else av.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let v=this.opts;this.opts=this._metaOpts;try{av.compileSchema.call(this,$)}finally{this.opts=v}}}ED.ValidationError=Lb.default;ED.MissingRefError=FV.default;f4.default=ED;function AV($,v,D,I="error"){for(let U in $){let X=U;if(X in v)this.logger[I](`${D}: option ${U}. ${$[X]}`)}}function HV($){return $=(0,ev.normalizeId)($),this.schemas[$]||this.refs[$]}function Ob(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let v in $)this.addSchema($[v],v)}function jb(){for(let $ in this.opts.formats){let v=this.opts.formats[$];if(v)this.addFormat($,v)}}function wb($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let v in $){let D=$[v];if(!D.keyword)D.keyword=v;this.addKeyword(D)}}function Pb(){let $={...this.opts};for(let v of Nb)delete $[v];return $}var Mb={log(){},warn(){},error(){}};function bb($){if($===!1)return Mb;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var qb=/^[a-z_$][a-z0-9_$:-]*$/i;function Sb($,v){let{RULES:D}=this;if((0,Wz.eachItem)($,(I)=>{if(D.keywords[I])throw Error(`Keyword ${I} is already defined`);if(!qb.test(I))throw Error(`Keyword ${I} has invalid name`)}),!v)return;if(v.$data&&!(("code"in v)||("validate"in v)))throw Error('$data keyword must have "code" or "validate" function')}function zz($,v,D){var I;let U=v===null||v===void 0?void 0:v.post;if(D&&U)throw Error('keyword with "post" flag cannot have "type"');let{RULES:X}=this,G=U?X.post:X.rules.find(({type:J})=>J===D);if(!G)G={type:D,rules:[]},X.rules.push(G);if(X.keywords[$]=!0,!v)return;let Q={keyword:$,definition:{...v,type:(0,TD.getJSONTypes)(v.type),schemaType:(0,TD.getJSONTypes)(v.schemaType)}};if(v.before)kb.call(this,G,Q,v.before);else G.rules.push(Q);X.all[$]=Q,(I=v.implements)===null||I===void 0||I.forEach((J)=>this.addKeyword(J))}function kb($,v,D){let I=$.rules.findIndex((U)=>U.keyword===D);if(I>=0)$.rules.splice(I,0,v);else $.rules.push(v),this.logger.warn(`rule ${D} is not defined`)}function Tb($){let{metaSchema:v}=$;if(v===void 0)return;if($.$data&&this.opts.$data)v=jV(v);$.validateSchema=this.compile(v,!0)}var Eb={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function jV($){return{anyOf:[$,Eb]}}});var MV=b((PV)=>{Object.defineProperty(PV,"__esModule",{value:!0});var Rb={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};PV.default=Rb});var EV=b((kV)=>{Object.defineProperty(kV,"__esModule",{value:!0});kV.callRef=kV.getValidate=void 0;var ib=tv(),bV=I4(),c$=_(),j1=n4(),qV=bD(),uD=d(),nb={keyword:"$ref",schemaType:"string",code($){let{gen:v,schema:D,it:I}=$,{baseId:U,schemaEnv:X,validateName:G,opts:Q,self:J}=I,{root:z}=X;if((D==="#"||D==="#/")&&U===z.baseId)return Y();let W=qV.resolveRef.call(J,z,U,D);if(W===void 0)throw new ib.default(I.opts.uriResolver,U,D);if(W instanceof qV.SchemaEnv)return L(W);return V(W);function Y(){if(X===z)return gD($,G,X,X.$async);let B=v.scopeValue("root",{ref:z});return gD($,c$._`${B}.validate`,z,z.$async)}function L(B){let N=SV($,B);gD($,N,B,B.$async)}function V(B){let N=v.scopeValue("schema",Q.code.source===!0?{ref:B,code:(0,c$.stringify)(B)}:{ref:B}),A=v.name("valid"),F=$.subschema({schema:B,dataTypes:[],schemaPath:c$.nil,topSchemaRef:N,errSchemaPath:D},A);$.mergeEvaluated(F),$.ok(A)}}};function SV($,v){let{gen:D}=$;return v.validate?D.scopeValue("validate",{ref:v.validate}):c$._`${D.scopeValue("wrapper",{ref:v})}.validate`}kV.getValidate=SV;function gD($,v,D,I){let{gen:U,it:X}=$,{allErrors:G,schemaEnv:Q,opts:J}=X,z=J.passContext?j1.default.this:c$.nil;if(I)W();else Y();function W(){if(!Q.$async)throw Error("async schema referenced by sync schema");let B=U.let("valid");U.try(()=>{if(U.code(c$._`await ${(0,bV.callValidateCode)($,v,z)}`),V(v),!G)U.assign(B,!0)},(N)=>{if(U.if(c$._`!(${N} instanceof ${X.ValidationError})`,()=>U.throw(N)),L(N),!G)U.assign(B,!1)}),$.ok(B)}function Y(){$.result((0,bV.callValidateCode)($,v,z),()=>V(v),()=>L(v))}function L(B){let N=c$._`${B}.errors`;U.assign(j1.default.vErrors,c$._`${j1.default.vErrors} === null ? ${N} : ${j1.default.vErrors}.concat(${N})`),U.assign(j1.default.errors,c$._`${j1.default.vErrors}.length`)}function V(B){var N;if(!X.opts.unevaluated)return;let A=(N=D===null||D===void 0?void 0:D.validate)===null||N===void 0?void 0:N.evaluated;if(X.props!==!0)if(A&&!A.dynamicProps){if(A.props!==void 0)X.props=uD.mergeEvaluated.props(U,A.props,X.props)}else{let F=U.var("props",c$._`${B}.evaluated.props`);X.props=uD.mergeEvaluated.props(U,F,X.props,c$.Name)}if(X.items!==!0)if(A&&!A.dynamicItems){if(A.items!==void 0)X.items=uD.mergeEvaluated.items(U,A.items,X.items)}else{let F=U.var("items",c$._`${B}.evaluated.items`);X.items=uD.mergeEvaluated.items(U,F,X.items,c$.Name)}}}kV.callRef=gD;kV.default=nb});var gV=b((uV)=>{Object.defineProperty(uV,"__esModule",{value:!0});var _b=MV(),yb=EV(),lb=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_b.default,yb.default];uV.default=lb});var CV=b((RV)=>{Object.defineProperty(RV,"__esModule",{value:!0});var RD=_(),G6=RD.operators,CD={maximum:{okStr:"<=",ok:G6.LTE,fail:G6.GT},minimum:{okStr:">=",ok:G6.GTE,fail:G6.LT},exclusiveMaximum:{okStr:"<",ok:G6.LT,fail:G6.GTE},exclusiveMinimum:{okStr:">",ok:G6.GT,fail:G6.LTE}},rb={message:({keyword:$,schemaCode:v})=>RD.str`must be ${CD[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>RD._`{comparison: ${CD[$].okStr}, limit: ${v}}`},mb={keyword:Object.keys(CD),type:"number",schemaType:"number",$data:!0,error:rb,code($){let{keyword:v,data:D,schemaCode:I}=$;$.fail$data(RD._`${D} ${CD[v].fail} ${I} || isNaN(${D})`)}};RV.default=mb});var nV=b((iV)=>{Object.defineProperty(iV,"__esModule",{value:!0});var sv=_(),db={message:({schemaCode:$})=>sv.str`must be multiple of ${$}`,params:({schemaCode:$})=>sv._`{multipleOf: ${$}}`},tb={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:db,code($){let{gen:v,data:D,schemaCode:I,it:U}=$,X=U.opts.multipleOfPrecision,G=v.let("res"),Q=X?sv._`Math.abs(Math.round(${G}) - ${G}) > 1e-${X}`:sv._`${G} !== parseInt(${G})`;$.fail$data(sv._`(${I} === 0 || (${G} = ${D}/${I}, ${Q}))`)}};iV.default=tb});var _V=b((fV)=>{Object.defineProperty(fV,"__esModule",{value:!0});function xV($){let v=$.length,D=0,I=0,U;while(I<v)if(D++,U=$.charCodeAt(I++),U>=55296&&U<=56319&&I<v){if(U=$.charCodeAt(I),(U&64512)===56320)I++}return D}fV.default=xV;xV.code='require("ajv/dist/runtime/ucs2length").default'});var lV=b((yV)=>{Object.defineProperty(yV,"__esModule",{value:!0});var q6=_(),ab=d(),eb=_V(),sb={message({keyword:$,schemaCode:v}){let D=$==="maxLength"?"more":"fewer";return q6.str`must NOT have ${D} than ${v} characters`},params:({schemaCode:$})=>q6._`{limit: ${$}}`},$q={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:sb,code($){let{keyword:v,data:D,schemaCode:I,it:U}=$,X=v==="maxLength"?q6.operators.GT:q6.operators.LT,G=U.opts.unicode===!1?q6._`${D}.length`:q6._`${(0,ab.useFunc)($.gen,eb.default)}(${D})`;$.fail$data(q6._`${G} ${X} ${I}`)}};yV.default=$q});var rV=b((hV)=>{Object.defineProperty(hV,"__esModule",{value:!0});var Uq=I4(),Dq=d(),w1=_(),Iq={message:({schemaCode:$})=>w1.str`must match pattern "${$}"`,params:({schemaCode:$})=>w1._`{pattern: ${$}}`},Xq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Iq,code($){let{gen:v,data:D,$data:I,schema:U,schemaCode:X,it:G}=$,Q=G.opts.unicodeRegExp?"u":"";if(I){let{regExp:J}=G.opts.code,z=J.code==="new RegExp"?w1._`new RegExp`:(0,Dq.useFunc)(v,J),W=v.let("valid");v.try(()=>v.assign(W,w1._`${z}(${X}, ${Q}).test(${D})`),()=>v.assign(W,!1)),$.fail$data(w1._`!${W}`)}else{let J=(0,Uq.usePattern)($,U);$.fail$data(w1._`!${J}.test(${D})`)}}};hV.default=Xq});var cV=b((mV)=>{Object.defineProperty(mV,"__esModule",{value:!0});var $U=_(),Qq={message({keyword:$,schemaCode:v}){let D=$==="maxProperties"?"more":"fewer";return $U.str`must NOT have ${D} than ${v} properties`},params:({schemaCode:$})=>$U._`{limit: ${$}}`},Jq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Qq,code($){let{keyword:v,data:D,schemaCode:I}=$,U=v==="maxProperties"?$U.operators.GT:$U.operators.LT;$.fail$data($U._`Object.keys(${D}).length ${U} ${I}`)}};mV.default=Jq});var tV=b((dV)=>{Object.defineProperty(dV,"__esModule",{value:!0});var vU=I4(),UU=_(),Wq=d(),Yq={message:({params:{missingProperty:$}})=>UU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>UU._`{missingProperty: ${$}}`},Lq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Yq,code($){let{gen:v,schema:D,schemaCode:I,data:U,$data:X,it:G}=$,{opts:Q}=G;if(!X&&D.length===0)return;let J=D.length>=Q.loopRequired;if(G.allErrors)z();else W();if(Q.strictRequired){let V=$.parentSchema.properties,{definedProperties:B}=$.it;for(let N of D)if((V===null||V===void 0?void 0:V[N])===void 0&&!B.has(N)){let A=G.schemaEnv.baseId+G.errSchemaPath,F=`required property "${N}" is not defined at "${A}" (strictRequired)`;(0,Wq.checkStrictMode)(G,F,G.opts.strictRequired)}}function z(){if(J||X)$.block$data(UU.nil,Y);else for(let V of D)(0,vU.checkReportMissingProp)($,V)}function W(){let V=v.let("missing");if(J||X){let B=v.let("valid",!0);$.block$data(B,()=>L(V,B)),$.ok(B)}else v.if((0,vU.checkMissingProp)($,D,V)),(0,vU.reportMissingProp)($,V),v.else()}function Y(){v.forOf("prop",I,(V)=>{$.setParams({missingProperty:V}),v.if((0,vU.noPropertyInData)(v,U,V,Q.ownProperties),()=>$.error())})}function L(V,B){$.setParams({missingProperty:V}),v.forOf(V,I,()=>{v.assign(B,(0,vU.propertyInData)(v,U,V,Q.ownProperties)),v.if((0,UU.not)(B),()=>{$.error(),v.break()})},UU.nil)}}};dV.default=Lq});var oV=b((pV)=>{Object.defineProperty(pV,"__esModule",{value:!0});var DU=_(),Bq={message({keyword:$,schemaCode:v}){let D=$==="maxItems"?"more":"fewer";return DU.str`must NOT have ${D} than ${v} items`},params:({schemaCode:$})=>DU._`{limit: ${$}}`},Kq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Bq,code($){let{keyword:v,data:D,schemaCode:I}=$,U=v==="maxItems"?DU.operators.GT:DU.operators.LT;$.fail$data(DU._`${D}.length ${U} ${I}`)}};pV.default=Kq});var iD=b((eV)=>{Object.defineProperty(eV,"__esModule",{value:!0});var aV=t9();aV.code='require("ajv/dist/runtime/equal").default';eV.default=aV});var $B=b((sV)=>{Object.defineProperty(sV,"__esModule",{value:!0});var Yz=hv(),S$=_(),Aq=d(),Hq=iD(),Fq={message:({params:{i:$,j:v}})=>S$.str`must NOT have duplicate items (items ## ${v} and ${$} are identical)`,params:({params:{i:$,j:v}})=>S$._`{i: ${$}, j: ${v}}`},Oq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Fq,code($){let{gen:v,data:D,$data:I,schema:U,parentSchema:X,schemaCode:G,it:Q}=$;if(!I&&!U)return;let J=v.let("valid"),z=X.items?(0,Yz.getSchemaTypes)(X.items):[];$.block$data(J,W,S$._`${G} === false`),$.ok(J);function W(){let B=v.let("i",S$._`${D}.length`),N=v.let("j");$.setParams({i:B,j:N}),v.assign(J,!0),v.if(S$._`${B} > 1`,()=>(Y()?L:V)(B,N))}function Y(){return z.length>0&&!z.some((B)=>B==="object"||B==="array")}function L(B,N){let A=v.name("item"),F=(0,Yz.checkDataTypes)(z,A,Q.opts.strictNumbers,Yz.DataType.Wrong),S=v.const("indices",S$._`{}`);v.for(S$._`;${B}--;`,()=>{if(v.let(A,S$._`${D}[${B}]`),v.if(F,S$._`continue`),z.length>1)v.if(S$._`typeof ${A} == "string"`,S$._`${A} += "_"`);v.if(S$._`typeof ${S}[${A}] == "number"`,()=>{v.assign(N,S$._`${S}[${A}]`),$.error(),v.assign(J,!1).break()}).code(S$._`${S}[${A}] = ${B}`)})}function V(B,N){let A=(0,Aq.useFunc)(v,Hq.default),F=v.name("outer");v.label(F).for(S$._`;${B}--;`,()=>v.for(S$._`${N} = ${B}; ${N}--;`,()=>v.if(S$._`${A}(${D}[${B}], ${D}[${N}])`,()=>{$.error(),v.assign(J,!1).break(F)})))}}};sV.default=Oq});var UB=b((vB)=>{Object.defineProperty(vB,"__esModule",{value:!0});var Lz=_(),wq=d(),Pq=iD(),Mq={message:"must be equal to constant",params:({schemaCode:$})=>Lz._`{allowedValue: ${$}}`},bq={keyword:"const",$data:!0,error:Mq,code($){let{gen:v,data:D,$data:I,schemaCode:U,schema:X}=$;if(I||X&&typeof X=="object")$.fail$data(Lz._`!${(0,wq.useFunc)(v,Pq.default)}(${D}, ${U})`);else $.fail(Lz._`${X} !== ${D}`)}};vB.default=bq});var IB=b((DB)=>{Object.defineProperty(DB,"__esModule",{value:!0});var IU=_(),Sq=d(),kq=iD(),Tq={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>IU._`{allowedValues: ${$}}`},Eq={keyword:"enum",schemaType:"array",$data:!0,error:Tq,code($){let{gen:v,data:D,$data:I,schema:U,schemaCode:X,it:G}=$;if(!I&&U.length===0)throw Error("enum must have non-empty array");let Q=U.length>=G.opts.loopEnum,J,z=()=>J!==null&&J!==void 0?J:J=(0,Sq.useFunc)(v,kq.default),W;if(Q||I)W=v.let("valid"),$.block$data(W,Y);else{if(!Array.isArray(U))throw Error("ajv implementation error");let V=v.const("vSchema",X);W=(0,IU.or)(...U.map((B,N)=>L(V,N)))}$.pass(W);function Y(){v.assign(W,!1),v.forOf("v",X,(V)=>v.if(IU._`${z()}(${D}, ${V})`,()=>v.assign(W,!0).break()))}function L(V,B){let N=U[B];return typeof N==="object"&&N!==null?IU._`${z()}(${D}, ${V}[${B}])`:IU._`${D} === ${N}`}}};DB.default=Eq});var GB=b((XB)=>{Object.defineProperty(XB,"__esModule",{value:!0});var gq=CV(),Rq=nV(),Cq=lV(),iq=rV(),nq=cV(),xq=tV(),fq=oV(),_q=$B(),yq=UB(),lq=IB(),hq=[gq.default,Rq.default,Cq.default,iq.default,nq.default,xq.default,fq.default,_q.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},yq.default,lq.default];XB.default=hq});var Bz=b((JB)=>{Object.defineProperty(JB,"__esModule",{value:!0});JB.validateAdditionalItems=void 0;var S6=_(),Vz=d(),mq={message:({params:{len:$}})=>S6.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>S6._`{limit: ${$}}`},cq={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:mq,code($){let{parentSchema:v,it:D}=$,{items:I}=v;if(!Array.isArray(I)){(0,Vz.checkStrictMode)(D,'"additionalItems" is ignored when "items" is not an array of schemas');return}QB($,I)}};function QB($,v){let{gen:D,schema:I,data:U,keyword:X,it:G}=$;G.items=!0;let Q=D.const("len",S6._`${U}.length`);if(I===!1)$.setParams({len:v.length}),$.pass(S6._`${Q} <= ${v.length}`);else if(typeof I=="object"&&!(0,Vz.alwaysValidSchema)(G,I)){let z=D.var("valid",S6._`${Q} <= ${v.length}`);D.if((0,S6.not)(z),()=>J(z)),$.ok(z)}function J(z){D.forRange("i",v.length,Q,(W)=>{if($.subschema({keyword:X,dataProp:W,dataPropType:Vz.Type.Num},z),!G.allErrors)D.if((0,S6.not)(z),()=>D.break())})}}JB.validateAdditionalItems=QB;JB.default=cq});var Kz=b((LB)=>{Object.defineProperty(LB,"__esModule",{value:!0});LB.validateTuple=void 0;var WB=_(),nD=d(),tq=I4(),pq={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:v,it:D}=$;if(Array.isArray(v))return YB($,"additionalItems",v);if(D.items=!0,(0,nD.alwaysValidSchema)(D,v))return;$.ok((0,tq.validateArray)($))}};function YB($,v,D=$.schema){let{gen:I,parentSchema:U,data:X,keyword:G,it:Q}=$;if(W(U),Q.opts.unevaluated&&D.length&&Q.items!==!0)Q.items=nD.mergeEvaluated.items(I,D.length,Q.items);let J=I.name("valid"),z=I.const("len",WB._`${X}.length`);D.forEach((Y,L)=>{if((0,nD.alwaysValidSchema)(Q,Y))return;I.if(WB._`${z} > ${L}`,()=>$.subschema({keyword:G,schemaProp:L,dataProp:L},J)),$.ok(J)});function W(Y){let{opts:L,errSchemaPath:V}=Q,B=D.length,N=B===Y.minItems&&(B===Y.maxItems||Y[v]===!1);if(L.strictTuples&&!N){let A=`"${G}" is ${B}-tuple, but minItems or maxItems/${v} are not specified or different at path "${V}"`;(0,nD.checkStrictMode)(Q,A,L.strictTuples)}}}LB.validateTuple=YB;LB.default=pq});var KB=b((BB)=>{Object.defineProperty(BB,"__esModule",{value:!0});var aq=Kz(),eq={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,aq.validateTuple)($,"items")};BB.default=eq});var AB=b((ZB)=>{Object.defineProperty(ZB,"__esModule",{value:!0});var NB=_(),$S=d(),vS=I4(),US=Bz(),DS={message:({params:{len:$}})=>NB.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>NB._`{limit: ${$}}`},IS={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:DS,code($){let{schema:v,parentSchema:D,it:I}=$,{prefixItems:U}=D;if(I.items=!0,(0,$S.alwaysValidSchema)(I,v))return;if(U)(0,US.validateAdditionalItems)($,U);else $.ok((0,vS.validateArray)($))}};ZB.default=IS});var FB=b((HB)=>{Object.defineProperty(HB,"__esModule",{value:!0});var X4=_(),xD=d(),GS={message:({params:{min:$,max:v}})=>v===void 0?X4.str`must contain at least ${$} valid item(s)`:X4.str`must contain at least ${$} and no more than ${v} valid item(s)`,params:({params:{min:$,max:v}})=>v===void 0?X4._`{minContains: ${$}}`:X4._`{minContains: ${$}, maxContains: ${v}}`},QS={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:GS,code($){let{gen:v,schema:D,parentSchema:I,data:U,it:X}=$,G,Q,{minContains:J,maxContains:z}=I;if(X.opts.next)G=J===void 0?1:J,Q=z;else G=1;let W=v.const("len",X4._`${U}.length`);if($.setParams({min:G,max:Q}),Q===void 0&&G===0){(0,xD.checkStrictMode)(X,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Q!==void 0&&G>Q){(0,xD.checkStrictMode)(X,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,xD.alwaysValidSchema)(X,D)){let N=X4._`${W} >= ${G}`;if(Q!==void 0)N=X4._`${N} && ${W} <= ${Q}`;$.pass(N);return}X.items=!0;let Y=v.name("valid");if(Q===void 0&&G===1)V(Y,()=>v.if(Y,()=>v.break()));else if(G===0){if(v.let(Y,!0),Q!==void 0)v.if(X4._`${U}.length > 0`,L)}else v.let(Y,!1),L();$.result(Y,()=>$.reset());function L(){let N=v.name("_valid"),A=v.let("count",0);V(N,()=>v.if(N,()=>B(A)))}function V(N,A){v.forRange("i",0,W,(F)=>{$.subschema({keyword:"contains",dataProp:F,dataPropType:xD.Type.Num,compositeRule:!0},N),A()})}function B(N){if(v.code(X4._`${N}++`),Q===void 0)v.if(X4._`${N} >= ${G}`,()=>v.assign(Y,!0).break());else if(v.if(X4._`${N} > ${Q}`,()=>v.assign(Y,!1).break()),G===1)v.assign(Y,!0);else v.if(X4._`${N} >= ${G}`,()=>v.assign(Y,!0))}}};HB.default=QS});var bB=b((wB)=>{Object.defineProperty(wB,"__esModule",{value:!0});wB.validateSchemaDeps=wB.validatePropertyDeps=wB.error=void 0;var Nz=_(),zS=d(),XU=I4();wB.error={message:({params:{property:$,depsCount:v,deps:D}})=>{let I=v===1?"property":"properties";return Nz.str`must have ${I} ${D} when property ${$} is present`},params:({params:{property:$,depsCount:v,deps:D,missingProperty:I}})=>Nz._`{property: ${$},
|
|
8
|
-
missingProperty: ${
|
|
3
|
+
import{createRequire as AH}from"node:module";var BH=Object.create;var{getPrototypeOf:LH,defineProperty:pX,getOwnPropertyNames:KH}=Object;var NH=Object.prototype.hasOwnProperty;function ZH($){return this[$]}var OH,HH,K7=($,v,D)=>{var X=$!=null&&typeof $==="object";if(X){var U=v?OH??=new WeakMap:HH??=new WeakMap,G=U.get($);if(G)return G}D=$!=null?BH(LH($)):{};let J=v||!$||!$.__esModule?pX(D,"default",{value:$,enumerable:!0}):D;for(let Q of KH($))if(!NH.call(J,Q))pX(J,Q,{get:ZH.bind($,Q),enumerable:!0});if(X)U.set($,J);return J};var b=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var FH=($)=>$;function jH($,v){this[$]=FH.bind(null,v)}var R4=($,v)=>{for(var D in v)pX($,D,{get:v[D],enumerable:!0,configurable:!0,set:jH.bind(v,D)})};var wH=AH(import.meta.url);var ev=b((xV)=>{Object.defineProperty(xV,"__esModule",{value:!0});xV.regexpCode=xV.getEsmExportName=xV.getProperty=xV.safeStringify=xV.stringify=xV.strConcat=xV.addCodeArg=xV.str=xV._=xV.nil=xV._Code=xV.Name=xV.IDENTIFIER=xV._CodeOrName=void 0;class yD{}xV._CodeOrName=yD;xV.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class A1 extends yD{constructor($){super();if(!xV.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}xV.Name=A1;class I4 extends yD{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((v,D)=>`${v}${D}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((v,D)=>{if(D instanceof A1)v[D.str]=(v[D.str]||0)+1;return v},{})}}xV._Code=I4;xV.nil=new I4("");function uV($,...v){let D=[$[0]],X=0;while(X<v.length)Sz(D,v[X]),D.push($[++X]);return new I4(D)}xV._=uV;var qz=new I4("+");function CV($,...v){let D=[av($[0])],X=0;while(X<v.length)D.push(qz),Sz(D,v[X]),D.push(qz,av($[++X]));return DM(D),new I4(D)}xV.str=CV;function Sz($,v){if(v instanceof I4)$.push(...v._items);else if(v instanceof A1)$.push(v);else $.push(JM(v))}xV.addCodeArg=Sz;function DM($){let v=1;while(v<$.length-1){if($[v]===qz){let D=XM($[v-1],$[v+1]);if(D!==void 0){$.splice(v-1,3,D);continue}$[v++]="+"}v++}}function XM($,v){if(v==='""')return $;if($==='""')return v;if(typeof $=="string"){if(v instanceof A1||$[$.length-1]!=='"')return;if(typeof v!="string")return`${$.slice(0,-1)}${v}"`;if(v[0]==='"')return $.slice(0,-1)+v.slice(1);return}if(typeof v=="string"&&v[0]==='"'&&!($ instanceof A1))return`"${$}${v.slice(1)}`;return}function GM($,v){return v.emptyStr()?$:$.emptyStr()?v:CV`${$}${v}`}xV.strConcat=GM;function JM($){return typeof $=="number"||typeof $=="boolean"||$===null?$:av(Array.isArray($)?$.join(","):$)}function QM($){return new I4(av($))}xV.stringify=QM;function av($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}xV.safeStringify=av;function WM($){return typeof $=="string"&&xV.IDENTIFIER.test($)?new I4(`.${$}`):uV`[${$}]`}xV.getProperty=WM;function zM($){if(typeof $=="string"&&xV.IDENTIFIER.test($))return new I4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}xV.getEsmExportName=zM;function YM($){return new I4($.toString())}xV.regexpCode=YM});var Rz=b((yV)=>{Object.defineProperty(yV,"__esModule",{value:!0});yV.ValueScope=yV.ValueScopeName=yV.Scope=yV.varKinds=yV.UsedValueState=void 0;var m$=ev();class _V extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var lD;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(lD||(yV.UsedValueState=lD={}));yV.varKinds={const:new m$.Name("const"),let:new m$.Name("let"),var:new m$.Name("var")};class Ez{constructor({prefixes:$,parent:v}={}){this._names={},this._prefixes=$,this._parent=v}toName($){return $ instanceof m$.Name?$:this.name($)}name($){return new m$.Name(this._newName($))}_newName($){let v=this._names[$]||this._nameGroup($);return`${$}${v.index++}`}_nameGroup($){var v,D;if(((D=(v=this._parent)===null||v===void 0?void 0:v._prefixes)===null||D===void 0?void 0:D.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}yV.Scope=Ez;class Tz extends m$.Name{constructor($,v){super(v);this.prefix=$}setValue($,{property:v,itemIndex:D}){this.value=$,this.scopePath=m$._`.${new m$.Name(v)}[${D}]`}}yV.ValueScopeName=Tz;var wM=m$._`\n`;class iV extends Ez{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?wM:m$.nil}}get(){return this._scope}name($){return new Tz($,this._newName($))}value($,v){var D;if(v.ref===void 0)throw Error("CodeGen: ref must be passed in value");let X=this.toName($),{prefix:U}=X,G=(D=v.key)!==null&&D!==void 0?D:v.ref,J=this._values[U];if(J){let z=J.get(G);if(z)return z}else J=this._values[U]=new Map;J.set(G,X);let Q=this._scope[U]||(this._scope[U]=[]),W=Q.length;return Q[W]=v.ref,X.setValue(v,{property:U,itemIndex:W}),X}getValue($,v){let D=this._values[$];if(!D)return;return D.get(v)}scopeRefs($,v=this._values){return this._reduceValues(v,(D)=>{if(D.scopePath===void 0)throw Error(`CodeGen: name "${D}" has no value`);return m$._`${$}${D.scopePath}`})}scopeCode($=this._values,v,D){return this._reduceValues($,(X)=>{if(X.value===void 0)throw Error(`CodeGen: name "${X}" has no value`);return X.value.code},v,D)}_reduceValues($,v,D={},X){let U=m$.nil;for(let G in $){let J=$[G];if(!J)continue;let Q=D[G]=D[G]||new Map;J.forEach((W)=>{if(Q.has(W))return;Q.set(W,lD.Started);let z=v(W);if(z){let Y=this.opts.es5?yV.varKinds.var:yV.varKinds.const;U=m$._`${U}${Y} ${W} = ${z};${this.opts._n}`}else if(z=X===null||X===void 0?void 0:X(W))U=m$._`${U}${z}${this.opts._n}`;else throw new _V(W);Q.set(W,lD.Completed)})}return U}}yV.ValueScope=iV});var l=b((c$)=>{Object.defineProperty(c$,"__esModule",{value:!0});c$.or=c$.and=c$.not=c$.CodeGen=c$.operators=c$.varKinds=c$.ValueScopeName=c$.ValueScope=c$.Scope=c$.Name=c$.regexpCode=c$.stringify=c$.getProperty=c$.nil=c$.strConcat=c$.str=c$._=void 0;var r=ev(),V4=Rz(),z6=ev();Object.defineProperty(c$,"_",{enumerable:!0,get:function(){return z6._}});Object.defineProperty(c$,"str",{enumerable:!0,get:function(){return z6.str}});Object.defineProperty(c$,"strConcat",{enumerable:!0,get:function(){return z6.strConcat}});Object.defineProperty(c$,"nil",{enumerable:!0,get:function(){return z6.nil}});Object.defineProperty(c$,"getProperty",{enumerable:!0,get:function(){return z6.getProperty}});Object.defineProperty(c$,"stringify",{enumerable:!0,get:function(){return z6.stringify}});Object.defineProperty(c$,"regexpCode",{enumerable:!0,get:function(){return z6.regexpCode}});Object.defineProperty(c$,"Name",{enumerable:!0,get:function(){return z6.Name}});var pD=Rz();Object.defineProperty(c$,"Scope",{enumerable:!0,get:function(){return pD.Scope}});Object.defineProperty(c$,"ValueScope",{enumerable:!0,get:function(){return pD.ValueScope}});Object.defineProperty(c$,"ValueScopeName",{enumerable:!0,get:function(){return pD.ValueScopeName}});Object.defineProperty(c$,"varKinds",{enumerable:!0,get:function(){return pD.varKinds}});c$.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class Y6{optimizeNodes(){return this}optimizeNames($,v){return this}}class lV extends Y6{constructor($,v,D){super();this.varKind=$,this.name=v,this.rhs=D}render({es5:$,_n:v}){let D=$?V4.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${D} ${this.name}${X};`+v}optimizeNames($,v){if(!$[this.name.str])return;if(this.rhs)this.rhs=M1(this.rhs,$,v);return this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class Cz extends Y6{constructor($,v,D){super();this.lhs=$,this.rhs=v,this.sideEffects=D}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,v){if(this.lhs instanceof r.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=M1(this.rhs,$,v),this}get names(){let $=this.lhs instanceof r.Name?{}:{...this.lhs.names};return dD($,this.rhs)}}class hV extends Cz{constructor($,v,D,X){super($,D,X);this.op=v}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class mV extends Y6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class cV extends Y6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class rV extends Y6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class dV extends Y6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,v){return this.code=M1(this.code,$,v),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class tD extends Y6{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((v,D)=>v+D.render($),"")}optimizeNodes(){let{nodes:$}=this,v=$.length;while(v--){let D=$[v].optimizeNodes();if(Array.isArray(D))$.splice(v,1,...D);else if(D)$[v]=D;else $.splice(v,1)}return $.length>0?this:void 0}optimizeNames($,v){let{nodes:D}=this,X=D.length;while(X--){let U=D[X];if(U.optimizeNames($,v))continue;qM($,U.names),D.splice(X,1)}return D.length>0?this:void 0}get names(){return this.nodes.reduce(($,v)=>q6($,v.names),{})}}class I6 extends tD{render($){return"{"+$._n+super.render($)+"}"+$._n}}class pV extends tD{}class sv extends I6{}sv.kind="else";class l4 extends I6{constructor($,v){super(v);this.condition=$}render($){let v=`if(${this.condition})`+super.render($);if(this.else)v+="else "+this.else.render($);return v}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let v=this.else;if(v){let D=v.optimizeNodes();v=this.else=Array.isArray(D)?new sv(D):D}if(v){if($===!1)return v instanceof l4?v:v.nodes;if(this.nodes.length)return this;return new l4(sV($),v instanceof l4?[v]:v.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,v){var D;if(this.else=(D=this.else)===null||D===void 0?void 0:D.optimizeNames($,v),!(super.optimizeNames($,v)||this.else))return;return this.condition=M1(this.condition,$,v),this}get names(){let $=super.names;if(dD($,this.condition),this.else)q6($,this.else.names);return $}}l4.kind="if";class w1 extends I6{}w1.kind="for";class tV extends w1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,v){if(!super.optimizeNames($,v))return;return this.iteration=M1(this.iteration,$,v),this}get names(){return q6(super.names,this.iteration.names)}}class oV extends w1{constructor($,v,D,X){super();this.varKind=$,this.name=v,this.from=D,this.to=X}render($){let v=$.es5?V4.varKinds.var:this.varKind,{name:D,from:X,to:U}=this;return`for(${v} ${D}=${X}; ${D}<${U}; ${D}++)`+super.render($)}get names(){let $=dD(super.names,this.from);return dD($,this.to)}}class gz extends w1{constructor($,v,D,X){super();this.loop=$,this.varKind=v,this.name=D,this.iterable=X}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,v){if(!super.optimizeNames($,v))return;return this.iterable=M1(this.iterable,$,v),this}get names(){return q6(super.names,this.iterable.names)}}class hD extends I6{constructor($,v,D){super();this.name=$,this.args=v,this.async=D}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}hD.kind="func";class mD extends tD{render($){return"return "+super.render($)}}mD.kind="return";class aV extends I6{render($){let v="try"+super.render($);if(this.catch)v+=this.catch.render($);if(this.finally)v+=this.finally.render($);return v}optimizeNodes(){var $,v;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(v=this.finally)===null||v===void 0||v.optimizeNodes(),this}optimizeNames($,v){var D,X;return super.optimizeNames($,v),(D=this.catch)===null||D===void 0||D.optimizeNames($,v),(X=this.finally)===null||X===void 0||X.optimizeNames($,v),this}get names(){let $=super.names;if(this.catch)q6($,this.catch.names);if(this.finally)q6($,this.finally.names);return $}}class cD extends I6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}cD.kind="catch";class rD extends I6{render($){return"finally"+super.render($)}}rD.kind="finally";class eV{constructor($,v={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...v,_n:v.lines?`
|
|
4
|
+
`:""},this._extScope=$,this._scope=new V4.Scope({parent:$}),this._nodes=[new pV]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,v){let D=this._extScope.value($,v);return(this._values[D.prefix]||(this._values[D.prefix]=new Set)).add(D),D}getScopeValue($,v){return this._extScope.getValue($,v)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,v,D,X){let U=this._scope.toName(v);if(D!==void 0&&X)this._constants[U.str]=D;return this._leafNode(new lV($,U,D)),U}const($,v,D){return this._def(V4.varKinds.const,$,v,D)}let($,v,D){return this._def(V4.varKinds.let,$,v,D)}var($,v,D){return this._def(V4.varKinds.var,$,v,D)}assign($,v,D){return this._leafNode(new Cz($,v,D))}add($,v){return this._leafNode(new hV($,c$.operators.ADD,v))}code($){if(typeof $=="function")$();else if($!==r.nil)this._leafNode(new dV($));return this}object(...$){let v=["{"];for(let[D,X]of $){if(v.length>1)v.push(",");if(v.push(D),D!==X||this.opts.es5)v.push(":"),(0,r.addCodeArg)(v,X)}return v.push("}"),new r._Code(v)}if($,v,D){if(this._blockNode(new l4($)),v&&D)this.code(v).else().code(D).endIf();else if(v)this.code(v).endIf();else if(D)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new l4($))}else(){return this._elseNode(new sv)}endIf(){return this._endBlockNode(l4,sv)}_for($,v){if(this._blockNode($),v)this.code(v).endFor();return this}for($,v){return this._for(new tV($),v)}forRange($,v,D,X,U=this.opts.es5?V4.varKinds.var:V4.varKinds.let){let G=this._scope.toName($);return this._for(new oV(U,G,v,D),()=>X(G))}forOf($,v,D,X=V4.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let G=v instanceof r.Name?v:this.var("_arr",v);return this.forRange("_i",0,r._`${G}.length`,(J)=>{this.var(U,r._`${G}[${J}]`),D(U)})}return this._for(new gz("of",X,U,v),()=>D(U))}forIn($,v,D,X=this.opts.es5?V4.varKinds.var:V4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,r._`Object.keys(${v})`,D);let U=this._scope.toName($);return this._for(new gz("in",X,U,v),()=>D(U))}endFor(){return this._endBlockNode(w1)}label($){return this._leafNode(new mV($))}break($){return this._leafNode(new cV($))}return($){let v=new mD;if(this._blockNode(v),this.code($),v.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(mD)}try($,v,D){if(!v&&!D)throw Error('CodeGen: "try" without "catch" and "finally"');let X=new aV;if(this._blockNode(X),this.code($),v){let U=this.name("e");this._currNode=X.catch=new cD(U),v(U)}if(D)this._currNode=X.finally=new rD,this.code(D);return this._endBlockNode(cD,rD)}throw($){return this._leafNode(new rV($))}block($,v){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(v);return this}endBlock($){let v=this._blockStarts.pop();if(v===void 0)throw Error("CodeGen: not in self-balancing block");let D=this._nodes.length-v;if(D<0||$!==void 0&&D!==$)throw Error(`CodeGen: wrong number of nodes: ${D} vs ${$} expected`);return this._nodes.length=v,this}func($,v=r.nil,D,X){if(this._blockNode(new hD($,v,D)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(hD)}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($,v){let D=this._currNode;if(D instanceof $||v&&D instanceof v)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${v?`${$.kind}/${v.kind}`:$.kind}"`)}_elseNode($){let v=this._currNode;if(!(v instanceof l4))throw Error('CodeGen: "else" without "if"');return this._currNode=v.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let v=this._nodes;v[v.length-1]=$}}c$.CodeGen=eV;function q6($,v){for(let D in v)$[D]=($[D]||0)+(v[D]||0);return $}function dD($,v){return v instanceof r._CodeOrName?q6($,v.names):$}function M1($,v,D){if($ instanceof r.Name)return X($);if(!U($))return $;return new r._Code($._items.reduce((G,J)=>{if(J instanceof r.Name)J=X(J);if(J instanceof r._Code)G.push(...J._items);else G.push(J);return G},[]));function X(G){let J=D[G.str];if(J===void 0||v[G.str]!==1)return G;return delete v[G.str],J}function U(G){return G instanceof r._Code&&G._items.some((J)=>J instanceof r.Name&&v[J.str]===1&&D[J.str]!==void 0)}}function qM($,v){for(let D in v)$[D]=($[D]||0)-(v[D]||0)}function sV($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:r._`!${uz($)}`}c$.not=sV;var SM=$B(c$.operators.AND);function kM(...$){return $.reduce(SM)}c$.and=kM;var EM=$B(c$.operators.OR);function TM(...$){return $.reduce(EM)}c$.or=TM;function $B($){return(v,D)=>v===r.nil?D:D===r.nil?v:r._`${uz(v)} ${$} ${uz(D)}`}function uz($){return $ instanceof r.Name?$:r._`(${$})`}});var d=b((zB)=>{Object.defineProperty(zB,"__esModule",{value:!0});zB.checkStrictMode=zB.getErrorPath=zB.Type=zB.useFunc=zB.setEvaluated=zB.evaluatedPropsToName=zB.mergeEvaluated=zB.eachItem=zB.unescapeJsonPointer=zB.escapeJsonPointer=zB.escapeFragment=zB.unescapeFragment=zB.schemaRefOrVal=zB.schemaHasRulesButRef=zB.schemaHasRules=zB.checkUnknownRules=zB.alwaysValidSchema=zB.toHash=void 0;var Q$=l(),CM=ev();function xM($){let v={};for(let D of $)v[D]=!0;return v}zB.toHash=xM;function fM($,v){if(typeof v=="boolean")return v;if(Object.keys(v).length===0)return!0;return XB($,v),!GB(v,$.self.RULES.all)}zB.alwaysValidSchema=fM;function XB($,v=$.schema){let{opts:D,self:X}=$;if(!D.strictSchema)return;if(typeof v==="boolean")return;let U=X.RULES.keywords;for(let G in v)if(!U[G])WB($,`unknown keyword: "${G}"`)}zB.checkUnknownRules=XB;function GB($,v){if(typeof $=="boolean")return!$;for(let D in $)if(v[D])return!0;return!1}zB.schemaHasRules=GB;function _M($,v){if(typeof $=="boolean")return!$;for(let D in $)if(D!=="$ref"&&v.all[D])return!0;return!1}zB.schemaHasRulesButRef=_M;function iM({topSchemaRef:$,schemaPath:v},D,X,U){if(!U){if(typeof D=="number"||typeof D=="boolean")return D;if(typeof D=="string")return Q$._`${D}`}return Q$._`${$}${v}${(0,Q$.getProperty)(X)}`}zB.schemaRefOrVal=iM;function yM($){return JB(decodeURIComponent($))}zB.unescapeFragment=yM;function nM($){return encodeURIComponent(fz($))}zB.escapeFragment=nM;function fz($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}zB.escapeJsonPointer=fz;function JB($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}zB.unescapeJsonPointer=JB;function lM($,v){if(Array.isArray($))for(let D of $)v(D);else v($)}zB.eachItem=lM;function UB({mergeNames:$,mergeToName:v,mergeValues:D,resultToName:X}){return(U,G,J,Q)=>{let W=J===void 0?G:J instanceof Q$.Name?(G instanceof Q$.Name?$(U,G,J):v(U,G,J),J):G instanceof Q$.Name?(v(U,J,G),G):D(G,J);return Q===Q$.Name&&!(W instanceof Q$.Name)?X(U,W):W}}zB.mergeEvaluated={props:UB({mergeNames:($,v,D)=>$.if(Q$._`${D} !== true && ${v} !== undefined`,()=>{$.if(Q$._`${v} === true`,()=>$.assign(D,!0),()=>$.assign(D,Q$._`${D} || {}`).code(Q$._`Object.assign(${D}, ${v})`))}),mergeToName:($,v,D)=>$.if(Q$._`${D} !== true`,()=>{if(v===!0)$.assign(D,!0);else $.assign(D,Q$._`${D} || {}`),_z($,D,v)}),mergeValues:($,v)=>$===!0?!0:{...$,...v},resultToName:QB}),items:UB({mergeNames:($,v,D)=>$.if(Q$._`${D} !== true && ${v} !== undefined`,()=>$.assign(D,Q$._`${v} === true ? true : ${D} > ${v} ? ${D} : ${v}`)),mergeToName:($,v,D)=>$.if(Q$._`${D} !== true`,()=>$.assign(D,v===!0?!0:Q$._`${D} > ${v} ? ${D} : ${v}`)),mergeValues:($,v)=>$===!0?!0:Math.max($,v),resultToName:($,v)=>$.var("items",v)})};function QB($,v){if(v===!0)return $.var("props",!0);let D=$.var("props",Q$._`{}`);if(v!==void 0)_z($,D,v);return D}zB.evaluatedPropsToName=QB;function _z($,v,D){Object.keys(D).forEach((X)=>$.assign(Q$._`${v}${(0,Q$.getProperty)(X)}`,!0))}zB.setEvaluated=_z;var DB={};function hM($,v){return $.scopeValue("func",{ref:v,code:DB[v.code]||(DB[v.code]=new CM._Code(v.code))})}zB.useFunc=hM;var xz;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(xz||(zB.Type=xz={}));function mM($,v,D){if($ instanceof Q$.Name){let X=v===xz.Num;return D?X?Q$._`"[" + ${$} + "]"`:Q$._`"['" + ${$} + "']"`:X?Q$._`"/" + ${$}`:Q$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return D?(0,Q$.getProperty)($).toString():"/"+fz($)}zB.getErrorPath=mM;function WB($,v,D=$.opts.strictSchema){if(!D)return;if(v=`strict mode: ${v}`,D===!0)throw Error(v);$.self.logger.warn(v)}zB.checkStrictMode=WB});var h4=b((IB)=>{Object.defineProperty(IB,"__esModule",{value:!0});var T$=l(),WP={data:new T$.Name("data"),valCxt:new T$.Name("valCxt"),instancePath:new T$.Name("instancePath"),parentData:new T$.Name("parentData"),parentDataProperty:new T$.Name("parentDataProperty"),rootData:new T$.Name("rootData"),dynamicAnchors:new T$.Name("dynamicAnchors"),vErrors:new T$.Name("vErrors"),errors:new T$.Name("errors"),this:new T$.Name("this"),self:new T$.Name("self"),scope:new T$.Name("scope"),json:new T$.Name("json"),jsonPos:new T$.Name("jsonPos"),jsonLen:new T$.Name("jsonLen"),jsonPart:new T$.Name("jsonPart")};IB.default=WP});var $0=b((KB)=>{Object.defineProperty(KB,"__esModule",{value:!0});KB.extendErrors=KB.resetErrorsCount=KB.reportExtraError=KB.reportError=KB.keyword$DataError=KB.keywordError=void 0;var p=l(),aD=d(),_$=h4();KB.keywordError={message:({keyword:$})=>p.str`must pass "${$}" keyword validation`};KB.keyword$DataError={message:({keyword:$,schemaType:v})=>v?p.str`"${$}" keyword must be ${v} ($data)`:p.str`"${$}" keyword is invalid ($data)`};function YP($,v=KB.keywordError,D,X){let{it:U}=$,{gen:G,compositeRule:J,allErrors:Q}=U,W=LB($,v,D);if(X!==null&&X!==void 0?X:J||Q)VB(G,W);else BB(U,p._`[${W}]`)}KB.reportError=YP;function IP($,v=KB.keywordError,D){let{it:X}=$,{gen:U,compositeRule:G,allErrors:J}=X,Q=LB($,v,D);if(VB(U,Q),!(G||J))BB(X,_$.default.vErrors)}KB.reportExtraError=IP;function VP($,v){$.assign(_$.default.errors,v),$.if(p._`${_$.default.vErrors} !== null`,()=>$.if(v,()=>$.assign(p._`${_$.default.vErrors}.length`,v),()=>$.assign(_$.default.vErrors,null)))}KB.resetErrorsCount=VP;function BP({gen:$,keyword:v,schemaValue:D,data:X,errsCount:U,it:G}){if(U===void 0)throw Error("ajv implementation error");let J=$.name("err");$.forRange("i",U,_$.default.errors,(Q)=>{if($.const(J,p._`${_$.default.vErrors}[${Q}]`),$.if(p._`${J}.instancePath === undefined`,()=>$.assign(p._`${J}.instancePath`,(0,p.strConcat)(_$.default.instancePath,G.errorPath))),$.assign(p._`${J}.schemaPath`,p.str`${G.errSchemaPath}/${v}`),G.opts.verbose)$.assign(p._`${J}.schema`,D),$.assign(p._`${J}.data`,X)})}KB.extendErrors=BP;function VB($,v){let D=$.const("err",v);$.if(p._`${_$.default.vErrors} === null`,()=>$.assign(_$.default.vErrors,p._`[${D}]`),p._`${_$.default.vErrors}.push(${D})`),$.code(p._`${_$.default.errors}++`)}function BB($,v){let{gen:D,validateName:X,schemaEnv:U}=$;if(U.$async)D.throw(p._`new ${$.ValidationError}(${v})`);else D.assign(p._`${X}.errors`,v),D.return(!1)}var S6={keyword:new p.Name("keyword"),schemaPath:new p.Name("schemaPath"),params:new p.Name("params"),propertyName:new p.Name("propertyName"),message:new p.Name("message"),schema:new p.Name("schema"),parentSchema:new p.Name("parentSchema")};function LB($,v,D){let{createErrors:X}=$.it;if(X===!1)return p._`{}`;return LP($,v,D)}function LP($,v,D={}){let{gen:X,it:U}=$,G=[KP(U,D),NP($,D)];return ZP($,v,G),X.object(...G)}function KP({errorPath:$},{instancePath:v}){let D=v?p.str`${$}${(0,aD.getErrorPath)(v,aD.Type.Str)}`:$;return[_$.default.instancePath,(0,p.strConcat)(_$.default.instancePath,D)]}function NP({keyword:$,it:{errSchemaPath:v}},{schemaPath:D,parentSchema:X}){let U=X?v:p.str`${v}/${$}`;if(D)U=p.str`${U}${(0,aD.getErrorPath)(D,aD.Type.Str)}`;return[S6.schemaPath,U]}function ZP($,{params:v,message:D},X){let{keyword:U,data:G,schemaValue:J,it:Q}=$,{opts:W,propertyName:z,topSchemaRef:Y,schemaPath:I}=Q;if(X.push([S6.keyword,U],[S6.params,typeof v=="function"?v($):v||p._`{}`]),W.messages)X.push([S6.message,typeof D=="function"?D($):D]);if(W.verbose)X.push([S6.schema,J],[S6.parentSchema,p._`${Y}${I}`],[_$.default.data,G]);if(z)X.push([S6.propertyName,z])}});var FB=b((OB)=>{Object.defineProperty(OB,"__esModule",{value:!0});OB.boolOrEmptySchema=OB.topBoolOrEmptySchema=void 0;var AP=$0(),wP=l(),MP=h4(),PP={message:"boolean schema is false"};function bP($){let{gen:v,schema:D,validateName:X}=$;if(D===!1)ZB($,!1);else if(typeof D=="object"&&D.$async===!0)v.return(MP.default.data);else v.assign(wP._`${X}.errors`,null),v.return(!0)}OB.topBoolOrEmptySchema=bP;function qP($,v){let{gen:D,schema:X}=$;if(X===!1)D.var(v,!1),ZB($);else D.var(v,!0)}OB.boolOrEmptySchema=qP;function ZB($,v){let{gen:D,data:X}=$,U={gen:D,keyword:"false schema",data:X,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,AP.reportError)(U,PP,void 0,v)}});var yz=b((jB)=>{Object.defineProperty(jB,"__esModule",{value:!0});jB.getRules=jB.isJSONType=void 0;var kP=["string","number","integer","boolean","null","object","array"],EP=new Set(kP);function TP($){return typeof $=="string"&&EP.has($)}jB.isJSONType=TP;function RP(){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:{}}}jB.getRules=RP});var nz=b((PB)=>{Object.defineProperty(PB,"__esModule",{value:!0});PB.shouldUseRule=PB.shouldUseGroup=PB.schemaHasRulesForType=void 0;function uP({schema:$,self:v},D){let X=v.RULES.types[D];return X&&X!==!0&&wB($,X)}PB.schemaHasRulesForType=uP;function wB($,v){return v.rules.some((D)=>MB($,D))}PB.shouldUseGroup=wB;function MB($,v){var D;return $[v.keyword]!==void 0||((D=v.definition.implements)===null||D===void 0?void 0:D.some((X)=>$[X]!==void 0))}PB.shouldUseRule=MB});var v0=b((EB)=>{Object.defineProperty(EB,"__esModule",{value:!0});EB.reportTypeError=EB.checkDataTypes=EB.checkDataType=EB.coerceAndCheckDataType=EB.getJSONTypes=EB.getSchemaTypes=EB.DataType=void 0;var fP=yz(),_P=nz(),iP=$0(),n=l(),qB=d(),P1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(P1||(EB.DataType=P1={}));function yP($){let v=SB($.type);if(v.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!v.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)v.push("null")}return v}EB.getSchemaTypes=yP;function SB($){let v=Array.isArray($)?$:$?[$]:[];if(v.every(fP.isJSONType))return v;throw Error("type must be JSONType or JSONType[]: "+v.join(","))}EB.getJSONTypes=SB;function nP($,v){let{gen:D,data:X,opts:U}=$,G=lP(v,U.coerceTypes),J=v.length>0&&!(G.length===0&&v.length===1&&(0,_P.schemaHasRulesForType)($,v[0]));if(J){let Q=hz(v,X,U.strictNumbers,P1.Wrong);D.if(Q,()=>{if(G.length)hP($,v,G);else mz($)})}return J}EB.coerceAndCheckDataType=nP;var kB=new Set(["string","number","integer","boolean","null"]);function lP($,v){return v?$.filter((D)=>kB.has(D)||v==="array"&&D==="array"):[]}function hP($,v,D){let{gen:X,data:U,opts:G}=$,J=X.let("dataType",n._`typeof ${U}`),Q=X.let("coerced",n._`undefined`);if(G.coerceTypes==="array")X.if(n._`${J} == 'object' && Array.isArray(${U}) && ${U}.length == 1`,()=>X.assign(U,n._`${U}[0]`).assign(J,n._`typeof ${U}`).if(hz(v,U,G.strictNumbers),()=>X.assign(Q,U)));X.if(n._`${Q} !== undefined`);for(let z of D)if(kB.has(z)||z==="array"&&G.coerceTypes==="array")W(z);X.else(),mz($),X.endIf(),X.if(n._`${Q} !== undefined`,()=>{X.assign(U,Q),mP($,Q)});function W(z){switch(z){case"string":X.elseIf(n._`${J} == "number" || ${J} == "boolean"`).assign(Q,n._`"" + ${U}`).elseIf(n._`${U} === null`).assign(Q,n._`""`);return;case"number":X.elseIf(n._`${J} == "boolean" || ${U} === null
|
|
5
|
+
|| (${J} == "string" && ${U} && ${U} == +${U})`).assign(Q,n._`+${U}`);return;case"integer":X.elseIf(n._`${J} === "boolean" || ${U} === null
|
|
6
|
+
|| (${J} === "string" && ${U} && ${U} == +${U} && !(${U} % 1))`).assign(Q,n._`+${U}`);return;case"boolean":X.elseIf(n._`${U} === "false" || ${U} === 0 || ${U} === null`).assign(Q,!1).elseIf(n._`${U} === "true" || ${U} === 1`).assign(Q,!0);return;case"null":X.elseIf(n._`${U} === "" || ${U} === 0 || ${U} === false`),X.assign(Q,null);return;case"array":X.elseIf(n._`${J} === "string" || ${J} === "number"
|
|
7
|
+
|| ${J} === "boolean" || ${U} === null`).assign(Q,n._`[${U}]`)}}}function mP({gen:$,parentData:v,parentDataProperty:D},X){$.if(n._`${v} !== undefined`,()=>$.assign(n._`${v}[${D}]`,X))}function lz($,v,D,X=P1.Correct){let U=X===P1.Correct?n.operators.EQ:n.operators.NEQ,G;switch($){case"null":return n._`${v} ${U} null`;case"array":G=n._`Array.isArray(${v})`;break;case"object":G=n._`${v} && typeof ${v} == "object" && !Array.isArray(${v})`;break;case"integer":G=J(n._`!(${v} % 1) && !isNaN(${v})`);break;case"number":G=J();break;default:return n._`typeof ${v} ${U} ${$}`}return X===P1.Correct?G:(0,n.not)(G);function J(Q=n.nil){return(0,n.and)(n._`typeof ${v} == "number"`,Q,D?n._`isFinite(${v})`:n.nil)}}EB.checkDataType=lz;function hz($,v,D,X){if($.length===1)return lz($[0],v,D,X);let U,G=(0,qB.toHash)($);if(G.array&&G.object){let J=n._`typeof ${v} != "object"`;U=G.null?J:n._`!${v} || ${J}`,delete G.null,delete G.array,delete G.object}else U=n.nil;if(G.number)delete G.integer;for(let J in G)U=(0,n.and)(U,lz(J,v,D,X));return U}EB.checkDataTypes=hz;var cP={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:v})=>typeof $=="string"?n._`{type: ${$}}`:n._`{type: ${v}}`};function mz($){let v=rP($);(0,iP.reportError)(v,cP)}EB.reportTypeError=mz;function rP($){let{gen:v,data:D,schema:X}=$,U=(0,qB.schemaRefOrVal)($,X,"type");return{gen:v,keyword:"type",data:D,schema:X.type,schemaCode:U,schemaValue:U,parentSchema:X,params:{},it:$}}});var CB=b((gB)=>{Object.defineProperty(gB,"__esModule",{value:!0});gB.assignDefaults=void 0;var b1=l(),sP=d();function $b($,v){let{properties:D,items:X}=$.schema;if(v==="object"&&D)for(let U in D)RB($,U,D[U].default);else if(v==="array"&&Array.isArray(X))X.forEach((U,G)=>RB($,G,U.default))}gB.assignDefaults=$b;function RB($,v,D){let{gen:X,compositeRule:U,data:G,opts:J}=$;if(D===void 0)return;let Q=b1._`${G}${(0,b1.getProperty)(v)}`;if(U){(0,sP.checkStrictMode)($,`default is ignored for: ${Q}`);return}let W=b1._`${Q} === undefined`;if(J.useDefaults==="empty")W=b1._`${W} || ${Q} === null || ${Q} === ""`;X.if(W,b1._`${Q} = ${(0,b1.stringify)(D)}`)}});var X4=b((_B)=>{Object.defineProperty(_B,"__esModule",{value:!0});_B.validateUnion=_B.validateArray=_B.usePattern=_B.callValidateCode=_B.schemaProperties=_B.allSchemaProperties=_B.noPropertyInData=_B.propertyInData=_B.isOwnProperty=_B.hasPropFunc=_B.reportMissingProp=_B.checkMissingProp=_B.checkReportMissingProp=void 0;var W$=l(),cz=d(),V6=h4(),vb=d();function Ub($,v){let{gen:D,data:X,it:U}=$;D.if(dz(D,X,v,U.opts.ownProperties),()=>{$.setParams({missingProperty:W$._`${v}`},!0),$.error()})}_B.checkReportMissingProp=Ub;function Db({gen:$,data:v,it:{opts:D}},X,U){return(0,W$.or)(...X.map((G)=>(0,W$.and)(dz($,v,G,D.ownProperties),W$._`${U} = ${G}`)))}_B.checkMissingProp=Db;function Xb($,v){$.setParams({missingProperty:v},!0),$.error()}_B.reportMissingProp=Xb;function xB($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:W$._`Object.prototype.hasOwnProperty`})}_B.hasPropFunc=xB;function rz($,v,D){return W$._`${xB($)}.call(${v}, ${D})`}_B.isOwnProperty=rz;function Gb($,v,D,X){let U=W$._`${v}${(0,W$.getProperty)(D)} !== undefined`;return X?W$._`${U} && ${rz($,v,D)}`:U}_B.propertyInData=Gb;function dz($,v,D,X){let U=W$._`${v}${(0,W$.getProperty)(D)} === undefined`;return X?(0,W$.or)(U,(0,W$.not)(rz($,v,D))):U}_B.noPropertyInData=dz;function fB($){return $?Object.keys($).filter((v)=>v!=="__proto__"):[]}_B.allSchemaProperties=fB;function Jb($,v){return fB(v).filter((D)=>!(0,cz.alwaysValidSchema)($,v[D]))}_B.schemaProperties=Jb;function Qb({schemaCode:$,data:v,it:{gen:D,topSchemaRef:X,schemaPath:U,errorPath:G},it:J},Q,W,z){let Y=z?W$._`${$}, ${v}, ${X}${U}`:v,I=[[V6.default.instancePath,(0,W$.strConcat)(V6.default.instancePath,G)],[V6.default.parentData,J.parentData],[V6.default.parentDataProperty,J.parentDataProperty],[V6.default.rootData,V6.default.rootData]];if(J.opts.dynamicRef)I.push([V6.default.dynamicAnchors,V6.default.dynamicAnchors]);let V=W$._`${Y}, ${D.object(...I)}`;return W!==W$.nil?W$._`${Q}.call(${W}, ${V})`:W$._`${Q}(${V})`}_B.callValidateCode=Qb;var Wb=W$._`new RegExp`;function zb({gen:$,it:{opts:v}},D){let X=v.unicodeRegExp?"u":"",{regExp:U}=v.code,G=U(D,X);return $.scopeValue("pattern",{key:G.toString(),ref:G,code:W$._`${U.code==="new RegExp"?Wb:(0,vb.useFunc)($,U)}(${D}, ${X})`})}_B.usePattern=zb;function Yb($){let{gen:v,data:D,keyword:X,it:U}=$,G=v.name("valid");if(U.allErrors){let Q=v.let("valid",!0);return J(()=>v.assign(Q,!1)),Q}return v.var(G,!0),J(()=>v.break()),G;function J(Q){let W=v.const("len",W$._`${D}.length`);v.forRange("i",0,W,(z)=>{$.subschema({keyword:X,dataProp:z,dataPropType:cz.Type.Num},G),v.if((0,W$.not)(G),Q)})}}_B.validateArray=Yb;function Ib($){let{gen:v,schema:D,keyword:X,it:U}=$;if(!Array.isArray(D))throw Error("ajv implementation error");if(D.some((W)=>(0,cz.alwaysValidSchema)(U,W))&&!U.opts.unevaluated)return;let J=v.let("valid",!1),Q=v.name("_valid");v.block(()=>D.forEach((W,z)=>{let Y=$.subschema({keyword:X,schemaProp:z,compositeRule:!0},Q);if(v.assign(J,W$._`${J} || ${Q}`),!$.mergeValidEvaluated(Y,Q))v.if((0,W$.not)(J))})),$.result(J,()=>$.reset(),()=>$.error(!0))}_B.validateUnion=Ib});var mB=b((lB)=>{Object.defineProperty(lB,"__esModule",{value:!0});lB.validateKeywordUsage=lB.validSchemaType=lB.funcKeywordCode=lB.macroKeywordCode=void 0;var i$=l(),k6=h4(),Mb=X4(),Pb=$0();function bb($,v){let{gen:D,keyword:X,schema:U,parentSchema:G,it:J}=$,Q=v.macro.call(J.self,U,G,J),W=nB(D,X,Q);if(J.opts.validateSchema!==!1)J.self.validateSchema(Q,!0);let z=D.name("valid");$.subschema({schema:Q,schemaPath:i$.nil,errSchemaPath:`${J.errSchemaPath}/${X}`,topSchemaRef:W,compositeRule:!0},z),$.pass(z,()=>$.error(!0))}lB.macroKeywordCode=bb;function qb($,v){var D;let{gen:X,keyword:U,schema:G,parentSchema:J,$data:Q,it:W}=$;kb(W,v);let z=!Q&&v.compile?v.compile.call(W.self,G,J,W):v.validate,Y=nB(X,U,z),I=X.let("valid");$.block$data(I,V),$.ok((D=v.valid)!==null&&D!==void 0?D:I);function V(){if(v.errors===!1){if(N(),v.modifying)yB($);Z(()=>$.error())}else{let F=v.async?B():L();if(v.modifying)yB($);Z(()=>Sb($,F))}}function B(){let F=X.let("ruleErrs",null);return X.try(()=>N(i$._`await `),(S)=>X.assign(I,!1).if(i$._`${S} instanceof ${W.ValidationError}`,()=>X.assign(F,i$._`${S}.errors`),()=>X.throw(S))),F}function L(){let F=i$._`${Y}.errors`;return X.assign(F,null),N(i$.nil),F}function N(F=v.async?i$._`await `:i$.nil){let S=W.opts.passContext?k6.default.this:k6.default.self,T=!(("compile"in v)&&!Q||v.schema===!1);X.assign(I,i$._`${F}${(0,Mb.callValidateCode)($,Y,S,T)}`,v.modifying)}function Z(F){var S;X.if((0,i$.not)((S=v.valid)!==null&&S!==void 0?S:I),F)}}lB.funcKeywordCode=qb;function yB($){let{gen:v,data:D,it:X}=$;v.if(X.parentData,()=>v.assign(D,i$._`${X.parentData}[${X.parentDataProperty}]`))}function Sb($,v){let{gen:D}=$;D.if(i$._`Array.isArray(${v})`,()=>{D.assign(k6.default.vErrors,i$._`${k6.default.vErrors} === null ? ${v} : ${k6.default.vErrors}.concat(${v})`).assign(k6.default.errors,i$._`${k6.default.vErrors}.length`),(0,Pb.extendErrors)($)},()=>$.error())}function kb({schemaEnv:$},v){if(v.async&&!$.$async)throw Error("async keyword in sync schema")}function nB($,v,D){if(D===void 0)throw Error(`keyword "${v}" failed to compile`);return $.scopeValue("keyword",typeof D=="function"?{ref:D}:{ref:D,code:(0,i$.stringify)(D)})}function Eb($,v,D=!1){return!v.length||v.some((X)=>X==="array"?Array.isArray($):X==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==X||D&&typeof $>"u")}lB.validSchemaType=Eb;function Tb({schema:$,opts:v,self:D,errSchemaPath:X},U,G){if(Array.isArray(U.keyword)?!U.keyword.includes(G):U.keyword!==G)throw Error("ajv implementation error");let J=U.dependencies;if(J===null||J===void 0?void 0:J.some((Q)=>!Object.prototype.hasOwnProperty.call($,Q)))throw Error(`parent schema must have dependencies of ${G}: ${J.join(",")}`);if(U.validateSchema){if(!U.validateSchema($[G])){let W=`keyword "${G}" value is invalid at path "${X}": `+D.errorsText(U.validateSchema.errors);if(v.validateSchema==="log")D.logger.error(W);else throw Error(W)}}}lB.validateKeywordUsage=Tb});var pB=b((rB)=>{Object.defineProperty(rB,"__esModule",{value:!0});rB.extendSubschemaMode=rB.extendSubschemaData=rB.getSubschema=void 0;var q4=l(),cB=d();function Cb($,{keyword:v,schemaProp:D,schema:X,schemaPath:U,errSchemaPath:G,topSchemaRef:J}){if(v!==void 0&&X!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(v!==void 0){let Q=$.schema[v];return D===void 0?{schema:Q,schemaPath:q4._`${$.schemaPath}${(0,q4.getProperty)(v)}`,errSchemaPath:`${$.errSchemaPath}/${v}`}:{schema:Q[D],schemaPath:q4._`${$.schemaPath}${(0,q4.getProperty)(v)}${(0,q4.getProperty)(D)}`,errSchemaPath:`${$.errSchemaPath}/${v}/${(0,cB.escapeFragment)(D)}`}}if(X!==void 0){if(U===void 0||G===void 0||J===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:X,schemaPath:U,topSchemaRef:J,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}rB.getSubschema=Cb;function xb($,v,{dataProp:D,dataPropType:X,data:U,dataTypes:G,propertyName:J}){if(U!==void 0&&D!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Q}=v;if(D!==void 0){let{errorPath:z,dataPathArr:Y,opts:I}=v,V=Q.let("data",q4._`${v.data}${(0,q4.getProperty)(D)}`,!0);W(V),$.errorPath=q4.str`${z}${(0,cB.getErrorPath)(D,X,I.jsPropertySyntax)}`,$.parentDataProperty=q4._`${D}`,$.dataPathArr=[...Y,$.parentDataProperty]}if(U!==void 0){let z=U instanceof q4.Name?U:Q.let("data",U,!0);if(W(z),J!==void 0)$.propertyName=J}if(G)$.dataTypes=G;function W(z){$.data=z,$.dataLevel=v.dataLevel+1,$.dataTypes=[],v.definedProperties=new Set,$.parentData=v.data,$.dataNames=[...v.dataNames,z]}}rB.extendSubschemaData=xb;function fb($,{jtdDiscriminator:v,jtdMetadata:D,compositeRule:X,createErrors:U,allErrors:G}){if(X!==void 0)$.compositeRule=X;if(U!==void 0)$.createErrors=U;if(G!==void 0)$.allErrors=G;$.jtdDiscriminator=v,$.jtdMetadata=D}rB.extendSubschemaMode=fb});var pz=b((fc,tB)=>{tB.exports=function $(v,D){if(v===D)return!0;if(v&&D&&typeof v=="object"&&typeof D=="object"){if(v.constructor!==D.constructor)return!1;var X,U,G;if(Array.isArray(v)){if(X=v.length,X!=D.length)return!1;for(U=X;U--!==0;)if(!$(v[U],D[U]))return!1;return!0}if(v.constructor===RegExp)return v.source===D.source&&v.flags===D.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===D.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===D.toString();if(G=Object.keys(v),X=G.length,X!==Object.keys(D).length)return!1;for(U=X;U--!==0;)if(!Object.prototype.hasOwnProperty.call(D,G[U]))return!1;for(U=X;U--!==0;){var J=G[U];if(!$(v[J],D[J]))return!1}return!0}return v!==v&&D!==D}});var aB=b((_c,oB)=>{var B6=oB.exports=function($,v,D){if(typeof v=="function")D=v,v={};D=v.cb||D;var X=typeof D=="function"?D:D.pre||function(){},U=D.post||function(){};eD(v,X,U,$,"",$)};B6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};B6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};B6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};B6.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 eD($,v,D,X,U,G,J,Q,W,z){if(X&&typeof X=="object"&&!Array.isArray(X)){v(X,U,G,J,Q,W,z);for(var Y in X){var I=X[Y];if(Array.isArray(I)){if(Y in B6.arrayKeywords)for(var V=0;V<I.length;V++)eD($,v,D,I[V],U+"/"+Y+"/"+V,G,U,Y,X,V)}else if(Y in B6.propsKeywords){if(I&&typeof I=="object")for(var B in I)eD($,v,D,I[B],U+"/"+Y+"/"+yb(B),G,U,Y,X,B)}else if(Y in B6.keywords||$.allKeys&&!(Y in B6.skipKeywords))eD($,v,D,I,U+"/"+Y,G,U,Y,X)}D(X,U,G,J,Q,W,z)}}function yb($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var U0=b((vL)=>{Object.defineProperty(vL,"__esModule",{value:!0});vL.getSchemaRefs=vL.resolveUrl=vL.normalizeId=vL._getFullPath=vL.getFullPath=vL.inlineRef=void 0;var nb=d(),lb=pz(),hb=aB(),mb=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function cb($,v=!0){if(typeof $=="boolean")return!0;if(v===!0)return!tz($);if(!v)return!1;return eB($)<=v}vL.inlineRef=cb;var rb=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function tz($){for(let v in $){if(rb.has(v))return!0;let D=$[v];if(Array.isArray(D)&&D.some(tz))return!0;if(typeof D=="object"&&tz(D))return!0}return!1}function eB($){let v=0;for(let D in $){if(D==="$ref")return 1/0;if(v++,mb.has(D))continue;if(typeof $[D]=="object")(0,nb.eachItem)($[D],(X)=>v+=eB(X));if(v===1/0)return 1/0}return v}function sB($,v="",D){if(D!==!1)v=q1(v);let X=$.parse(v);return $L($,X)}vL.getFullPath=sB;function $L($,v){return $.serialize(v).split("#")[0]+"#"}vL._getFullPath=$L;var db=/#\/?$/;function q1($){return $?$.replace(db,""):""}vL.normalizeId=q1;function pb($,v,D){return D=q1(D),$.resolve(v,D)}vL.resolveUrl=pb;var tb=/^[a-z_][-a-z0-9._]*$/i;function ob($,v){if(typeof $=="boolean")return{};let{schemaId:D,uriResolver:X}=this.opts,U=q1($[D]||v),G={"":U},J=sB(X,U,!1),Q={},W=new Set;return hb($,{allKeys:!0},(I,V,B,L)=>{if(L===void 0)return;let N=J+V,Z=G[L];if(typeof I[D]=="string")Z=F.call(this,I[D]);S.call(this,I.$anchor),S.call(this,I.$dynamicAnchor),G[V]=Z;function F(T){let g=this.opts.uriResolver.resolve;if(T=q1(Z?g(Z,T):T),W.has(T))throw Y(T);W.add(T);let k=this.refs[T];if(typeof k=="string")k=this.refs[k];if(typeof k=="object")z(I,k.schema,T);else if(T!==q1(N))if(T[0]==="#")z(I,Q[T],T),Q[T]=I;else this.refs[T]=N;return T}function S(T){if(typeof T=="string"){if(!tb.test(T))throw Error(`invalid anchor "${T}"`);F.call(this,`#${T}`)}}}),Q;function z(I,V,B){if(V!==void 0&&!lb(I,V))throw Y(B)}function Y(I){return Error(`reference "${I}" resolves to more than one schema`)}}vL.getSchemaRefs=ob});var G0=b((ZL)=>{Object.defineProperty(ZL,"__esModule",{value:!0});ZL.getData=ZL.KeywordCxt=ZL.validateFunctionCode=void 0;var QL=FB(),DL=v0(),az=nz(),sD=v0(),Uq=CB(),X0=mB(),oz=pB(),R=l(),_=h4(),Dq=U0(),m4=d(),D0=$0();function Xq($){if(YL($)){if(IL($),zL($)){Qq($);return}}WL($,()=>(0,QL.topBoolOrEmptySchema)($))}ZL.validateFunctionCode=Xq;function WL({gen:$,validateName:v,schema:D,schemaEnv:X,opts:U},G){if(U.code.es5)$.func(v,R._`${_.default.data}, ${_.default.valCxt}`,X.$async,()=>{$.code(R._`"use strict"; ${XL(D,U)}`),Jq($,U),$.code(G)});else $.func(v,R._`${_.default.data}, ${Gq(U)}`,X.$async,()=>$.code(XL(D,U)).code(G))}function Gq($){return R._`{${_.default.instancePath}="", ${_.default.parentData}, ${_.default.parentDataProperty}, ${_.default.rootData}=${_.default.data}${$.dynamicRef?R._`, ${_.default.dynamicAnchors}={}`:R.nil}}={}`}function Jq($,v){$.if(_.default.valCxt,()=>{if($.var(_.default.instancePath,R._`${_.default.valCxt}.${_.default.instancePath}`),$.var(_.default.parentData,R._`${_.default.valCxt}.${_.default.parentData}`),$.var(_.default.parentDataProperty,R._`${_.default.valCxt}.${_.default.parentDataProperty}`),$.var(_.default.rootData,R._`${_.default.valCxt}.${_.default.rootData}`),v.dynamicRef)$.var(_.default.dynamicAnchors,R._`${_.default.valCxt}.${_.default.dynamicAnchors}`)},()=>{if($.var(_.default.instancePath,R._`""`),$.var(_.default.parentData,R._`undefined`),$.var(_.default.parentDataProperty,R._`undefined`),$.var(_.default.rootData,_.default.data),v.dynamicRef)$.var(_.default.dynamicAnchors,R._`{}`)})}function Qq($){let{schema:v,opts:D,gen:X}=$;WL($,()=>{if(D.$comment&&v.$comment)BL($);if(Vq($),X.let(_.default.vErrors,null),X.let(_.default.errors,0),D.unevaluated)Wq($);VL($),Kq($)});return}function Wq($){let{gen:v,validateName:D}=$;$.evaluated=v.const("evaluated",R._`${D}.evaluated`),v.if(R._`${$.evaluated}.dynamicProps`,()=>v.assign(R._`${$.evaluated}.props`,R._`undefined`)),v.if(R._`${$.evaluated}.dynamicItems`,()=>v.assign(R._`${$.evaluated}.items`,R._`undefined`))}function XL($,v){let D=typeof $=="object"&&$[v.schemaId];return D&&(v.code.source||v.code.process)?R._`/*# sourceURL=${D} */`:R.nil}function zq($,v){if(YL($)){if(IL($),zL($)){Yq($,v);return}}(0,QL.boolOrEmptySchema)($,v)}function zL({schema:$,self:v}){if(typeof $=="boolean")return!$;for(let D in $)if(v.RULES.all[D])return!0;return!1}function YL($){return typeof $.schema!="boolean"}function Yq($,v){let{schema:D,gen:X,opts:U}=$;if(U.$comment&&D.$comment)BL($);Bq($),Lq($);let G=X.const("_errs",_.default.errors);VL($,G),X.var(v,R._`${G} === ${_.default.errors}`)}function IL($){(0,m4.checkUnknownRules)($),Iq($)}function VL($,v){if($.opts.jtd)return GL($,[],!1,v);let D=(0,DL.getSchemaTypes)($.schema),X=(0,DL.coerceAndCheckDataType)($,D);GL($,D,!X,v)}function Iq($){let{schema:v,errSchemaPath:D,opts:X,self:U}=$;if(v.$ref&&X.ignoreKeywordsWithRef&&(0,m4.schemaHasRulesButRef)(v,U.RULES))U.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function Vq($){let{schema:v,opts:D}=$;if(v.default!==void 0&&D.useDefaults&&D.strictSchema)(0,m4.checkStrictMode)($,"default is ignored in the schema root")}function Bq($){let v=$.schema[$.opts.schemaId];if(v)$.baseId=(0,Dq.resolveUrl)($.opts.uriResolver,$.baseId,v)}function Lq($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function BL({gen:$,schemaEnv:v,schema:D,errSchemaPath:X,opts:U}){let G=D.$comment;if(U.$comment===!0)$.code(R._`${_.default.self}.logger.log(${G})`);else if(typeof U.$comment=="function"){let J=R.str`${X}/$comment`,Q=$.scopeValue("root",{ref:v.root});$.code(R._`${_.default.self}.opts.$comment(${G}, ${J}, ${Q}.schema)`)}}function Kq($){let{gen:v,schemaEnv:D,validateName:X,ValidationError:U,opts:G}=$;if(D.$async)v.if(R._`${_.default.errors} === 0`,()=>v.return(_.default.data),()=>v.throw(R._`new ${U}(${_.default.vErrors})`));else{if(v.assign(R._`${X}.errors`,_.default.vErrors),G.unevaluated)Nq($);v.return(R._`${_.default.errors} === 0`)}}function Nq({gen:$,evaluated:v,props:D,items:X}){if(D instanceof R.Name)$.assign(R._`${v}.props`,D);if(X instanceof R.Name)$.assign(R._`${v}.items`,X)}function GL($,v,D,X){let{gen:U,schema:G,data:J,allErrors:Q,opts:W,self:z}=$,{RULES:Y}=z;if(G.$ref&&(W.ignoreKeywordsWithRef||!(0,m4.schemaHasRulesButRef)(G,Y))){U.block(()=>KL($,"$ref",Y.all.$ref.definition));return}if(!W.jtd)Zq($,v);U.block(()=>{for(let V of Y.rules)I(V);I(Y.post)});function I(V){if(!(0,az.shouldUseGroup)(G,V))return;if(V.type){if(U.if((0,sD.checkDataType)(V.type,J,W.strictNumbers)),JL($,V),v.length===1&&v[0]===V.type&&D)U.else(),(0,sD.reportTypeError)($);U.endIf()}else JL($,V);if(!Q)U.if(R._`${_.default.errors} === ${X||0}`)}}function JL($,v){let{gen:D,schema:X,opts:{useDefaults:U}}=$;if(U)(0,Uq.assignDefaults)($,v.type);D.block(()=>{for(let G of v.rules)if((0,az.shouldUseRule)(X,G))KL($,G.keyword,G.definition,v.type)})}function Zq($,v){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(Oq($,v),!$.opts.allowUnionTypes)Hq($,v);Fq($,$.dataTypes)}function Oq($,v){if(!v.length)return;if(!$.dataTypes.length){$.dataTypes=v;return}v.forEach((D)=>{if(!LL($.dataTypes,D))ez($,`type "${D}" not allowed by context "${$.dataTypes.join(",")}"`)}),Aq($,v)}function Hq($,v){if(v.length>1&&!(v.length===2&&v.includes("null")))ez($,"use allowUnionTypes to allow union type keyword")}function Fq($,v){let D=$.self.RULES.all;for(let X in D){let U=D[X];if(typeof U=="object"&&(0,az.shouldUseRule)($.schema,U)){let{type:G}=U.definition;if(G.length&&!G.some((J)=>jq(v,J)))ez($,`missing type "${G.join(",")}" for keyword "${X}"`)}}}function jq($,v){return $.includes(v)||v==="number"&&$.includes("integer")}function LL($,v){return $.includes(v)||v==="integer"&&$.includes("number")}function Aq($,v){let D=[];for(let X of $.dataTypes)if(LL(v,X))D.push(X);else if(v.includes("integer")&&X==="number")D.push("integer");$.dataTypes=D}function ez($,v){let D=$.schemaEnv.baseId+$.errSchemaPath;v+=` at "${D}" (strictTypes)`,(0,m4.checkStrictMode)($,v,$.opts.strictTypes)}class sz{constructor($,v,D){if((0,X0.validateKeywordUsage)($,v,D),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=D,this.data=$.data,this.schema=$.schema[D],this.$data=v.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m4.schemaRefOrVal)($,this.schema,D,this.$data),this.schemaType=v.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=v,this.$data)this.schemaCode=$.gen.const("vSchema",NL(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,X0.validSchemaType)(this.schema,v.schemaType,v.allowUndefined))throw Error(`${D} value must be ${JSON.stringify(v.schemaType)}`);if("code"in v?v.trackErrors:v.errors!==!1)this.errsCount=$.gen.const("_errs",_.default.errors)}result($,v,D){this.failResult((0,R.not)($),v,D)}failResult($,v,D){if(this.gen.if($),D)D();else this.error();if(v){if(this.gen.else(),v(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,v){this.failResult((0,R.not)($),void 0,v)}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:v}=this;this.fail(R._`${v} !== undefined && (${(0,R.or)(this.invalid$data(),$)})`)}error($,v,D){if(v){this.setParams(v),this._error($,D),this.setParams({});return}this._error($,D)}_error($,v){($?D0.reportExtraError:D0.reportError)(this,this.def.error,v)}$dataError(){(0,D0.reportError)(this,this.def.$dataError||D0.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,D0.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,v){if(v)Object.assign(this.params,$);else this.params=$}block$data($,v,D=R.nil){this.gen.block(()=>{this.check$data($,D),v()})}check$data($=R.nil,v=R.nil){if(!this.$data)return;let{gen:D,schemaCode:X,schemaType:U,def:G}=this;if(D.if((0,R.or)(R._`${X} === undefined`,v)),$!==R.nil)D.assign($,!0);if(U.length||G.validateSchema){if(D.elseIf(this.invalid$data()),this.$dataError(),$!==R.nil)D.assign($,!1)}D.else()}invalid$data(){let{gen:$,schemaCode:v,schemaType:D,def:X,it:U}=this;return(0,R.or)(G(),J());function G(){if(D.length){if(!(v instanceof R.Name))throw Error("ajv implementation error");let Q=Array.isArray(D)?D:[D];return R._`${(0,sD.checkDataTypes)(Q,v,U.opts.strictNumbers,sD.DataType.Wrong)}`}return R.nil}function J(){if(X.validateSchema){let Q=$.scopeValue("validate$data",{ref:X.validateSchema});return R._`!${Q}(${v})`}return R.nil}}subschema($,v){let D=(0,oz.getSubschema)(this.it,$);(0,oz.extendSubschemaData)(D,this.it,$),(0,oz.extendSubschemaMode)(D,$);let X={...this.it,...D,items:void 0,props:void 0};return zq(X,v),X}mergeEvaluated($,v){let{it:D,gen:X}=this;if(!D.opts.unevaluated)return;if(D.props!==!0&&$.props!==void 0)D.props=m4.mergeEvaluated.props(X,$.props,D.props,v);if(D.items!==!0&&$.items!==void 0)D.items=m4.mergeEvaluated.items(X,$.items,D.items,v)}mergeValidEvaluated($,v){let{it:D,gen:X}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return X.if(v,()=>this.mergeEvaluated($,R.Name)),!0}}ZL.KeywordCxt=sz;function KL($,v,D,X){let U=new sz($,D,v);if("code"in D)D.code(U,X);else if(U.$data&&D.validate)(0,X0.funcKeywordCode)(U,D);else if("macro"in D)(0,X0.macroKeywordCode)(U,D);else if(D.compile||D.validate)(0,X0.funcKeywordCode)(U,D)}var wq=/^\/(?:[^~]|~0|~1)*$/,Mq=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function NL($,{dataLevel:v,dataNames:D,dataPathArr:X}){let U,G;if($==="")return _.default.rootData;if($[0]==="/"){if(!wq.test($))throw Error(`Invalid JSON-pointer: ${$}`);U=$,G=_.default.rootData}else{let z=Mq.exec($);if(!z)throw Error(`Invalid JSON-pointer: ${$}`);let Y=+z[1];if(U=z[2],U==="#"){if(Y>=v)throw Error(W("property/index",Y));return X[v-Y]}if(Y>v)throw Error(W("data",Y));if(G=D[v-Y],!U)return G}let J=G,Q=U.split("/");for(let z of Q)if(z)G=R._`${G}${(0,R.getProperty)((0,m4.unescapeJsonPointer)(z))}`,J=R._`${J} && ${G}`;return J;function W(z,Y){return`Cannot access ${z} ${Y} levels up, current level is ${v}`}}ZL.getData=NL});var $X=b((FL)=>{Object.defineProperty(FL,"__esModule",{value:!0});class HL extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}FL.default=HL});var J0=b((AL)=>{Object.defineProperty(AL,"__esModule",{value:!0});var $5=U0();class jL extends Error{constructor($,v,D,X){super(X||`can't resolve reference ${D} from id ${v}`);this.missingRef=(0,$5.resolveUrl)($,v,D),this.missingSchema=(0,$5.normalizeId)((0,$5.getFullPath)($,this.missingRef))}}AL.default=jL});var UX=b((PL)=>{Object.defineProperty(PL,"__esModule",{value:!0});PL.resolveSchema=PL.getCompilingSchema=PL.resolveRef=PL.compileSchema=PL.SchemaEnv=void 0;var B4=l(),kq=$X(),E6=h4(),L4=U0(),wL=d(),Eq=G0();class Q0{constructor($){var v;this.refs={},this.dynamicAnchors={};let D;if(typeof $.schema=="object")D=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(v=$.baseId)!==null&&v!==void 0?v:(0,L4.normalizeId)(D===null||D===void 0?void 0:D[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=D===null||D===void 0?void 0:D.$async,this.refs={}}}PL.SchemaEnv=Q0;function U5($){let v=ML.call(this,$);if(v)return v;let D=(0,L4.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:X,lines:U}=this.opts.code,{ownProperties:G}=this.opts,J=new B4.CodeGen(this.scope,{es5:X,lines:U,ownProperties:G}),Q;if($.$async)Q=J.scopeValue("Error",{ref:kq.default,code:B4._`require("ajv/dist/runtime/validation_error").default`});let W=J.scopeName("validate");$.validateName=W;let z={gen:J,allErrors:this.opts.allErrors,data:E6.default.data,parentData:E6.default.parentData,parentDataProperty:E6.default.parentDataProperty,dataNames:[E6.default.data],dataPathArr:[B4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:J.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,B4.stringify)($.schema)}:{ref:$.schema}),validateName:W,ValidationError:Q,schema:$.schema,schemaEnv:$,rootId:D,baseId:$.baseId||D,schemaPath:B4.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:B4._`""`,opts:this.opts,self:this},Y;try{this._compilations.add($),(0,Eq.validateFunctionCode)(z),J.optimize(this.opts.code.optimize);let I=J.toString();if(Y=`${J.scopeRefs(E6.default.scope)}return ${I}`,this.opts.code.process)Y=this.opts.code.process(Y,$);let B=Function(`${E6.default.self}`,`${E6.default.scope}`,Y)(this,this.scope.get());if(this.scope.value(W,{ref:B}),B.errors=null,B.schema=$.schema,B.schemaEnv=$,$.$async)B.$async=!0;if(this.opts.code.source===!0)B.source={validateName:W,validateCode:I,scopeValues:J._values};if(this.opts.unevaluated){let{props:L,items:N}=z;if(B.evaluated={props:L instanceof B4.Name?void 0:L,items:N instanceof B4.Name?void 0:N,dynamicProps:L instanceof B4.Name,dynamicItems:N instanceof B4.Name},B.source)B.source.evaluated=(0,B4.stringify)(B.evaluated)}return $.validate=B,$}catch(I){if(delete $.validate,delete $.validateName,Y)this.logger.error("Error compiling schema, function code:",Y);throw I}finally{this._compilations.delete($)}}PL.compileSchema=U5;function Tq($,v,D){var X;D=(0,L4.resolveUrl)(this.opts.uriResolver,v,D);let U=$.refs[D];if(U)return U;let G=uq.call(this,$,D);if(G===void 0){let J=(X=$.localRefs)===null||X===void 0?void 0:X[D],{schemaId:Q}=this.opts;if(J)G=new Q0({schema:J,schemaId:Q,root:$,baseId:v})}if(G===void 0)return;return $.refs[D]=Rq.call(this,G)}PL.resolveRef=Tq;function Rq($){if((0,L4.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:U5.call(this,$)}function ML($){for(let v of this._compilations)if(gq(v,$))return v}PL.getCompilingSchema=ML;function gq($,v){return $.schema===v.schema&&$.root===v.root&&$.baseId===v.baseId}function uq($,v){let D;while(typeof(D=this.refs[v])=="string")v=D;return D||this.schemas[v]||vX.call(this,$,v)}function vX($,v){let D=this.opts.uriResolver.parse(v),X=(0,L4._getFullPath)(this.opts.uriResolver,D),U=(0,L4.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&X===U)return v5.call(this,D,$);let G=(0,L4.normalizeId)(X),J=this.refs[G]||this.schemas[G];if(typeof J=="string"){let Q=vX.call(this,$,J);if(typeof(Q===null||Q===void 0?void 0:Q.schema)!=="object")return;return v5.call(this,D,Q)}if(typeof(J===null||J===void 0?void 0:J.schema)!=="object")return;if(!J.validate)U5.call(this,J);if(G===(0,L4.normalizeId)(v)){let{schema:Q}=J,{schemaId:W}=this.opts,z=Q[W];if(z)U=(0,L4.resolveUrl)(this.opts.uriResolver,U,z);return new Q0({schema:Q,schemaId:W,root:$,baseId:U})}return v5.call(this,D,J)}PL.resolveSchema=vX;var Cq=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function v5($,{baseId:v,schema:D,root:X}){var U;if(((U=$.fragment)===null||U===void 0?void 0:U[0])!=="/")return;for(let Q of $.fragment.slice(1).split("/")){if(typeof D==="boolean")return;let W=D[(0,wL.unescapeFragment)(Q)];if(W===void 0)return;D=W;let z=typeof D==="object"&&D[this.opts.schemaId];if(!Cq.has(Q)&&z)v=(0,L4.resolveUrl)(this.opts.uriResolver,v,z)}let G;if(typeof D!="boolean"&&D.$ref&&!(0,wL.schemaHasRulesButRef)(D,this.RULES)){let Q=(0,L4.resolveUrl)(this.opts.uriResolver,v,D.$ref);G=vX.call(this,X,Q)}let{schemaId:J}=this.opts;if(G=G||new Q0({schema:D,schemaId:J,root:X,baseId:v}),G.schema!==G.root.schema)return G;return}});var qL=b((mc,yq)=>{yq.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 G5=b((cc,gL)=>{var nq=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),kL=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),D5=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),EL=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),lq=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function X5($){let v="",D=0,X=0;for(X=0;X<$.length;X++){if(D=$[X].charCodeAt(0),D===48)continue;if(!(D>=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";v+=$[X];break}for(X+=1;X<$.length;X++){if(D=$[X].charCodeAt(0),!(D>=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";v+=$[X]}return v}var hq=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function SL($){return $.length=0,!0}function mq($,v,D){if($.length){let X=X5($);if(X!=="")v.push(X);else return D.error=!0,!1;$.length=0}return!0}function cq($){let v=0,D={error:!1,address:"",zone:""},X=[],U=[],G=!1,J=!1,Q=mq;for(let W=0;W<$.length;W++){let z=$[W];if(z==="["||z==="]")continue;if(z===":"){if(G===!0)J=!0;if(!Q(U,X,D))break;if(++v>7){D.error=!0;break}if(W>0&&$[W-1]===":")G=!0;X.push(":");continue}else if(z==="%"){if(!Q(U,X,D))break;Q=SL}else{U.push(z);continue}}if(U.length)if(Q===SL)D.zone=U.join("");else if(J)X.push(U.join(""));else X.push(X5(U));return D.address=X.join(""),D}function TL($){if(rq($,":")<2)return{host:$,isIPV6:!1};let v=cq($);if(!v.error){let{address:D,address:X}=v;if(v.zone)D+="%"+v.zone,X+="%25"+v.zone;return{host:D,isIPV6:!0,escapedHost:X}}else return{host:$,isIPV6:!1}}function rq($,v){let D=0;for(let X=0;X<$.length;X++)if($[X]===v)D++;return D}function dq($){let v=$,D=[],X=-1,U=0;while(U=v.length){if(U===1)if(v===".")break;else if(v==="/"){D.push("/");break}else{D.push(v);break}else if(U===2){if(v[0]==="."){if(v[1]===".")break;else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"){if(v[1]==="."||v[1]==="/"){D.push("/");break}}}else if(U===3){if(v==="/.."){if(D.length!==0)D.pop();D.push("/");break}}if(v[0]==="."){if(v[1]==="."){if(v[2]==="/"){v=v.slice(3);continue}}else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"){if(v[1]==="."){if(v[2]==="/"){v=v.slice(2);continue}else if(v[2]==="."){if(v[3]==="/"){if(v=v.slice(3),D.length!==0)D.pop();continue}}}}if((X=v.indexOf("/",1))===-1){D.push(v);break}else D.push(v.slice(0,X)),v=v.slice(X)}return D.join("")}var pq={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},tq=/[@/?#:]/g,oq=/[@/?#]/g;function RL($,v){let D=v?oq:tq;return D.lastIndex=0,$.replace(D,(X)=>pq[X])}function aq($,v=!1){if($.indexOf("%")===-1)return $;let D="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let U=$.slice(X+1,X+3);if(D5(U)){let G=U.toUpperCase(),J=String.fromCharCode(parseInt(G,16));if(v&&EL(J))D+=J;else D+="%"+G;X+=2;continue}}D+=$[X]}return D}function eq($){let v="";for(let D=0;D<$.length;D++){if($[D]==="%"&&D+2<$.length){let X=$.slice(D+1,D+3);if(D5(X)){let U=X.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(G!=="."&&EL(G))v+=G;else v+="%"+U;D+=2;continue}}if(lq($[D]))v+=$[D];else v+=escape($[D])}return v}function sq($){let v="";for(let D=0;D<$.length;D++){if($[D]==="%"&&D+2<$.length){let X=$.slice(D+1,D+3);if(D5(X)){v+="%"+X.toUpperCase(),D+=2;continue}}v+=escape($[D])}return v}function $S($){let v=[];if($.userinfo!==void 0)v.push($.userinfo),v.push("@");if($.host!==void 0){let D=unescape($.host);if(!kL(D)){let X=TL(D);if(X.isIPV6===!0)D=`[${X.escapedHost}]`;else D=RL(D,!1)}v.push(D)}if(typeof $.port==="number"||typeof $.port==="string")v.push(":"),v.push(String($.port));return v.length?v.join(""):void 0}gL.exports={nonSimpleDomain:hq,recomposeAuthority:$S,reescapeHostDelimiters:RL,normalizePercentEncoding:aq,normalizePathEncoding:eq,escapePreservingEscapes:sq,removeDotSegments:dq,isIPv4:kL,isUUID:nq,normalizeIPv6:TL,stringArrayToHexStripped:X5}});var _L=b((rc,fL)=>{var{isUUID:vS}=G5(),US=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,DS=["http","https","ws","wss","urn","urn:uuid"];function XS($){return DS.indexOf($)!==-1}function J5($){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 uL($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function CL($){let v=String($.scheme).toLowerCase()==="https";if($.port===(v?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function GS($){return $.secure=J5($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function JS($){if($.port===(J5($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[v,D]=$.resourceName.split("?");$.path=v&&v!=="/"?v:void 0,$.query=D,$.resourceName=void 0}return $.fragment=void 0,$}function QS($,v){if(!$.path)return $.error="URN can not be parsed",$;let D=$.path.match(US);if(D){let X=v.scheme||$.scheme||"urn";$.nid=D[1].toLowerCase(),$.nss=D[2];let U=`${X}:${v.nid||$.nid}`,G=Q5(U);if($.path=void 0,G)$=G.parse($,v)}else $.error=$.error||"URN can not be parsed.";return $}function WS($,v){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let D=v.scheme||$.scheme||"urn",X=$.nid.toLowerCase(),U=`${D}:${v.nid||X}`,G=Q5(U);if(G)$=G.serialize($,v);let J=$,Q=$.nss;return J.path=`${X||v.nid}:${Q}`,v.skipEscape=!0,J}function zS($,v){let D=$;if(D.uuid=D.nss,D.nss=void 0,!v.tolerant&&(!D.uuid||!vS(D.uuid)))D.error=D.error||"UUID is not valid.";return D}function YS($){let v=$;return v.nss=($.uuid||"").toLowerCase(),v}var xL={scheme:"http",domainHost:!0,parse:uL,serialize:CL},IS={scheme:"https",domainHost:xL.domainHost,parse:uL,serialize:CL},DX={scheme:"ws",domainHost:!0,parse:GS,serialize:JS},VS={scheme:"wss",domainHost:DX.domainHost,parse:DX.parse,serialize:DX.serialize},BS={scheme:"urn",parse:QS,serialize:WS,skipNormalize:!0},LS={scheme:"urn:uuid",parse:zS,serialize:YS,skipNormalize:!0},XX={http:xL,https:IS,ws:DX,wss:VS,urn:BS,"urn:uuid":LS};Object.setPrototypeOf(XX,null);function Q5($){return $&&(XX[$]||XX[$.toLowerCase()])||void 0}fL.exports={wsIsSecure:J5,SCHEMES:XX,isValidSchemeName:XS,getSchemeHandler:Q5}});var mL=b((dc,GX)=>{var{normalizeIPv6:KS,removeDotSegments:W0,recomposeAuthority:NS,normalizePercentEncoding:ZS,normalizePathEncoding:OS,escapePreservingEscapes:HS,reescapeHostDelimiters:FS,isIPv4:jS,nonSimpleDomain:AS}=G5(),{SCHEMES:wS,getSchemeHandler:yL}=_L();function MS($,v){if(typeof $==="string")$=kS($,v);else if(typeof $==="object")$=S1(T6($,v),v);return $}function PS($,v,D){let X=D?Object.assign({scheme:"null"},D):{scheme:"null"},U=nL(S1($,X),S1(v,X),X,!0);return X.skipEscape=!0,T6(U,X)}function nL($,v,D,X){let U={};if(!X)$=S1(T6($,D),D),v=S1(T6(v,D),D);if(D=D||{},!D.tolerant&&v.scheme)U.scheme=v.scheme,U.userinfo=v.userinfo,U.host=v.host,U.port=v.port,U.path=W0(v.path||""),U.query=v.query;else{if(v.userinfo!==void 0||v.host!==void 0||v.port!==void 0)U.userinfo=v.userinfo,U.host=v.host,U.port=v.port,U.path=W0(v.path||""),U.query=v.query;else{if(!v.path)if(U.path=$.path,v.query!==void 0)U.query=v.query;else U.query=$.query;else{if(v.path[0]==="/")U.path=W0(v.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)U.path="/"+v.path;else if(!$.path)U.path=v.path;else U.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+v.path;U.path=W0(U.path)}U.query=v.query}U.userinfo=$.userinfo,U.host=$.host,U.port=$.port}U.scheme=$.scheme}return U.fragment=v.fragment,U}function bS($,v,D){let X=iL($,D),U=iL(v,D);return X!==void 0&&U!==void 0&&X.toLowerCase()===U.toLowerCase()}function T6($,v){let D={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:""},X=Object.assign({},v),U=[],G=yL(X.scheme||D.scheme);if(G&&G.serialize)G.serialize(D,X);if(D.path!==void 0)if(!X.skipEscape){if(D.path=HS(D.path),D.scheme!==void 0)D.path=D.path.split("%3A").join(":")}else D.path=ZS(D.path);if(X.reference!=="suffix"&&D.scheme)U.push(D.scheme,":");let J=NS(D);if(J!==void 0){if(X.reference!=="suffix")U.push("//");if(U.push(J),D.path&&D.path[0]!=="/")U.push("/")}if(D.path!==void 0){let Q=D.path;if(!X.absolutePath&&(!G||!G.absolutePath))Q=W0(Q);if(J===void 0&&Q[0]==="/"&&Q[1]==="/")Q="/%2F"+Q.slice(2);U.push(Q)}if(D.query!==void 0)U.push("?",D.query);if(D.fragment!==void 0)U.push("#",D.fragment);return U.join("")}var qS=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function SS($,v){if(v[2]!==void 0&&$.path&&$.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof $.port==="number"&&($.port<0||$.port>65535))return"URI port is malformed.";return}function lL($,v){let D=Object.assign({},v),X={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},U=!1,G=!1;if(D.reference==="suffix")if(D.scheme)$=D.scheme+":"+$;else $="//"+$;let J=$.match(qS);if(J){if(X.scheme=J[1],X.userinfo=J[3],X.host=J[4],X.port=parseInt(J[5],10),X.path=J[6]||"",X.query=J[7],X.fragment=J[8],isNaN(X.port))X.port=J[5];let Q=SS(X,J);if(Q!==void 0)X.error=X.error||Q,U=!0;if(X.host)if(jS(X.host)===!1){let Y=KS(X.host);X.host=Y.host.toLowerCase(),G=Y.isIPV6}else G=!0;if(X.scheme===void 0&&X.userinfo===void 0&&X.host===void 0&&X.port===void 0&&X.query===void 0&&!X.path)X.reference="same-document";else if(X.scheme===void 0)X.reference="relative";else if(X.fragment===void 0)X.reference="absolute";else X.reference="uri";if(D.reference&&D.reference!=="suffix"&&D.reference!==X.reference)X.error=X.error||"URI is not a "+D.reference+" reference.";let W=yL(D.scheme||X.scheme);if(!D.unicodeSupport&&(!W||!W.unicodeSupport)){if(X.host&&(D.domainHost||W&&W.domainHost)&&G===!1&&AS(X.host))try{X.host=URL.domainToASCII(X.host.toLowerCase())}catch(z){X.error=X.error||"Host's domain name can not be converted to ASCII: "+z}}if(!W||W&&!W.skipNormalize){if($.indexOf("%")!==-1){if(X.scheme!==void 0)X.scheme=unescape(X.scheme);if(X.host!==void 0)X.host=FS(unescape(X.host),G)}if(X.path)X.path=OS(X.path);if(X.fragment)try{X.fragment=encodeURI(decodeURIComponent(X.fragment))}catch{X.error=X.error||"URI malformed"}}if(W&&W.parse)W.parse(X,D)}else X.error=X.error||"URI can not be parsed.";return{parsed:X,malformedAuthorityOrPort:U}}function S1($,v){return lL($,v).parsed}function kS($,v){return hL($,v).normalized}function hL($,v){let{parsed:D,malformedAuthorityOrPort:X}=lL($,v);return{normalized:X?$:T6(D,v),malformedAuthorityOrPort:X}}function iL($,v){if(typeof $==="string"){let{normalized:D,malformedAuthorityOrPort:X}=hL($,v);return X?void 0:D}if(typeof $==="object")return T6($,v)}var W5={SCHEMES:wS,normalize:MS,resolve:PS,resolveComponent:nL,equal:bS,serialize:T6,parse:S1};GX.exports=W5;GX.exports.default=W5;GX.exports.fastUri=W5});var dL=b((rL)=>{Object.defineProperty(rL,"__esModule",{value:!0});var cL=mL();cL.code='require("ajv/dist/runtime/uri").default';rL.default=cL});var vK=b((c4)=>{Object.defineProperty(c4,"__esModule",{value:!0});c4.CodeGen=c4.Name=c4.nil=c4.stringify=c4.str=c4._=c4.KeywordCxt=void 0;var TS=G0();Object.defineProperty(c4,"KeywordCxt",{enumerable:!0,get:function(){return TS.KeywordCxt}});var k1=l();Object.defineProperty(c4,"_",{enumerable:!0,get:function(){return k1._}});Object.defineProperty(c4,"str",{enumerable:!0,get:function(){return k1.str}});Object.defineProperty(c4,"stringify",{enumerable:!0,get:function(){return k1.stringify}});Object.defineProperty(c4,"nil",{enumerable:!0,get:function(){return k1.nil}});Object.defineProperty(c4,"Name",{enumerable:!0,get:function(){return k1.Name}});Object.defineProperty(c4,"CodeGen",{enumerable:!0,get:function(){return k1.CodeGen}});var RS=$X(),eL=J0(),gS=yz(),z0=UX(),uS=l(),Y0=U0(),JX=v0(),Y5=d(),pL=qL(),CS=dL(),sL=($,v)=>new RegExp($,v);sL.code="new RegExp";var xS=["removeAdditional","useDefaults","coerceTypes"],fS=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_S={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."},iS={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},tL=200;function yS($){var v,D,X,U,G,J,Q,W,z,Y,I,V,B,L,N,Z,F,S,T,g,k,N$,j$,T4,Q4;let y$=$.strict,n1=(v=$.code)===null||v===void 0?void 0:v.optimize,l1=n1===!0||n1===void 0?1:n1||0,h1=(X=(D=$.code)===null||D===void 0?void 0:D.regExp)!==null&&X!==void 0?X:sL,P0=(U=$.uriResolver)!==null&&U!==void 0?U:CS.default;return{strictSchema:(J=(G=$.strictSchema)!==null&&G!==void 0?G:y$)!==null&&J!==void 0?J:!0,strictNumbers:(W=(Q=$.strictNumbers)!==null&&Q!==void 0?Q:y$)!==null&&W!==void 0?W:!0,strictTypes:(Y=(z=$.strictTypes)!==null&&z!==void 0?z:y$)!==null&&Y!==void 0?Y:"log",strictTuples:(V=(I=$.strictTuples)!==null&&I!==void 0?I:y$)!==null&&V!==void 0?V:"log",strictRequired:(L=(B=$.strictRequired)!==null&&B!==void 0?B:y$)!==null&&L!==void 0?L:!1,code:$.code?{...$.code,optimize:l1,regExp:h1}:{optimize:l1,regExp:h1},loopRequired:(N=$.loopRequired)!==null&&N!==void 0?N:tL,loopEnum:(Z=$.loopEnum)!==null&&Z!==void 0?Z:tL,meta:(F=$.meta)!==null&&F!==void 0?F:!0,messages:(S=$.messages)!==null&&S!==void 0?S:!0,inlineRefs:(T=$.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(g=$.schemaId)!==null&&g!==void 0?g:"$id",addUsedSchema:(k=$.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(N$=$.validateSchema)!==null&&N$!==void 0?N$:!0,validateFormats:(j$=$.validateFormats)!==null&&j$!==void 0?j$:!0,unicodeRegExp:(T4=$.unicodeRegExp)!==null&&T4!==void 0?T4:!0,int32range:(Q4=$.int32range)!==null&&Q4!==void 0?Q4:!0,uriResolver:P0}}class QX{constructor($={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...yS($)};let{es5:v,lines:D}=this.opts.code;this.scope=new uS.ValueScope({scope:{},prefixes:fS,es5:v,lines:D}),this.logger=rS($.logger);let X=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,gS.getRules)(),oL.call(this,_S,$,"NOT SUPPORTED"),oL.call(this,iS,$,"DEPRECATED","warn"),this._metaOpts=mS.call(this),$.formats)lS.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)hS.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);nS.call(this),$.validateFormats=X}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:v,schemaId:D}=this.opts,X=pL;if(D==="id")X={...pL},X.id=X.$id,delete X.$id;if(v&&$)this.addMetaSchema(X,X[D],!1)}defaultMeta(){let{meta:$,schemaId:v}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[v]||$:void 0}validate($,v){let D;if(typeof $=="string"){if(D=this.getSchema($),!D)throw Error(`no schema with key or ref "${$}"`)}else D=this.compile($);let X=D(v);if(!("$async"in D))this.errors=D.errors;return X}compile($,v){let D=this._addSchema($,v);return D.validate||this._compileSchemaEnv(D)}compileAsync($,v){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:D}=this.opts;return X.call(this,$,v);async function X(z,Y){await U.call(this,z.$schema);let I=this._addSchema(z,Y);return I.validate||G.call(this,I)}async function U(z){if(z&&!this.getSchema(z))await X.call(this,{$ref:z},!0)}async function G(z){try{return this._compileSchemaEnv(z)}catch(Y){if(!(Y instanceof eL.default))throw Y;return J.call(this,Y),await Q.call(this,Y.missingSchema),G.call(this,z)}}function J({missingSchema:z,missingRef:Y}){if(this.refs[z])throw Error(`AnySchema ${z} is loaded but ${Y} cannot be resolved`)}async function Q(z){let Y=await W.call(this,z);if(!this.refs[z])await U.call(this,Y.$schema);if(!this.refs[z])this.addSchema(Y,z,v)}async function W(z){let Y=this._loading[z];if(Y)return Y;try{return await(this._loading[z]=D(z))}finally{delete this._loading[z]}}}addSchema($,v,D,X=this.opts.validateSchema){if(Array.isArray($)){for(let G of $)this.addSchema(G,void 0,D,X);return this}let U;if(typeof $==="object"){let{schemaId:G}=this.opts;if(U=$[G],U!==void 0&&typeof U!="string")throw Error(`schema ${G} must be string`)}return v=(0,Y0.normalizeId)(v||U),this._checkUnique(v),this.schemas[v]=this._addSchema($,D,v,X,!0),this}addMetaSchema($,v,D=this.opts.validateSchema){return this.addSchema($,v,!0,D),this}validateSchema($,v){if(typeof $=="boolean")return!0;let D;if(D=$.$schema,D!==void 0&&typeof D!="string")throw Error("$schema must be a string");if(D=D||this.opts.defaultMeta||this.defaultMeta(),!D)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let X=this.validate(D,$);if(!X&&v){let U="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(U);else throw Error(U)}return X}getSchema($){let v;while(typeof(v=aL.call(this,$))=="string")$=v;if(v===void 0){let{schemaId:D}=this.opts,X=new z0.SchemaEnv({schema:{},schemaId:D});if(v=z0.resolveSchema.call(this,X,$),!v)return;this.refs[$]=v}return v.validate||this._compileSchemaEnv(v)}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 v=aL.call(this,$);if(typeof v=="object")this._cache.delete(v.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let v=$;this._cache.delete(v);let D=$[this.opts.schemaId];if(D)D=(0,Y0.normalizeId)(D),delete this.schemas[D],delete this.refs[D];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let v of $)this.addKeyword(v);return this}addKeyword($,v){let D;if(typeof $=="string"){if(D=$,typeof v=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),v.keyword=D}else if(typeof $=="object"&&v===void 0){if(v=$,D=v.keyword,Array.isArray(D)&&!D.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(pS.call(this,D,v),!v)return(0,Y5.eachItem)(D,(U)=>z5.call(this,U)),this;oS.call(this,v);let X={...v,type:(0,JX.getJSONTypes)(v.type),schemaType:(0,JX.getJSONTypes)(v.schemaType)};return(0,Y5.eachItem)(D,X.type.length===0?(U)=>z5.call(this,U,X):(U)=>X.type.forEach((G)=>z5.call(this,U,X,G))),this}getKeyword($){let v=this.RULES.all[$];return typeof v=="object"?v.definition:!!v}removeKeyword($){let{RULES:v}=this;delete v.keywords[$],delete v.all[$];for(let D of v.rules){let X=D.rules.findIndex((U)=>U.keyword===$);if(X>=0)D.rules.splice(X,1)}return this}addFormat($,v){if(typeof v=="string")v=new RegExp(v);return this.formats[$]=v,this}errorsText($=this.errors,{separator:v=", ",dataVar:D="data"}={}){if(!$||$.length===0)return"No errors";return $.map((X)=>`${D}${X.instancePath} ${X.message}`).reduce((X,U)=>X+v+U)}$dataMetaSchema($,v){let D=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let X of v){let U=X.split("/").slice(1),G=$;for(let J of U)G=G[J];for(let J in D){let Q=D[J];if(typeof Q!="object")continue;let{$data:W}=Q.definition,z=G[J];if(W&&z)G[J]=$K(z)}}return $}_removeAllSchemas($,v){for(let D in $){let X=$[D];if(!v||v.test(D)){if(typeof X=="string")delete $[D];else if(X&&!X.meta)this._cache.delete(X.schema),delete $[D]}}}_addSchema($,v,D,X=this.opts.validateSchema,U=this.opts.addUsedSchema){let G,{schemaId:J}=this.opts;if(typeof $=="object")G=$[J];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let Q=this._cache.get($);if(Q!==void 0)return Q;D=(0,Y0.normalizeId)(G||D);let W=Y0.getSchemaRefs.call(this,$,D);if(Q=new z0.SchemaEnv({schema:$,schemaId:J,meta:v,baseId:D,localRefs:W}),this._cache.set(Q.schema,Q),U&&!D.startsWith("#")){if(D)this._checkUnique(D);this.refs[D]=Q}if(X)this.validateSchema($,!0);return Q}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else z0.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let v=this.opts;this.opts=this._metaOpts;try{z0.compileSchema.call(this,$)}finally{this.opts=v}}}QX.ValidationError=RS.default;QX.MissingRefError=eL.default;c4.default=QX;function oL($,v,D,X="error"){for(let U in $){let G=U;if(G in v)this.logger[X](`${D}: option ${U}. ${$[G]}`)}}function aL($){return $=(0,Y0.normalizeId)($),this.schemas[$]||this.refs[$]}function nS(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let v in $)this.addSchema($[v],v)}function lS(){for(let $ in this.opts.formats){let v=this.opts.formats[$];if(v)this.addFormat($,v)}}function hS($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let v in $){let D=$[v];if(!D.keyword)D.keyword=v;this.addKeyword(D)}}function mS(){let $={...this.opts};for(let v of xS)delete $[v];return $}var cS={log(){},warn(){},error(){}};function rS($){if($===!1)return cS;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var dS=/^[a-z_$][a-z0-9_$:-]*$/i;function pS($,v){let{RULES:D}=this;if((0,Y5.eachItem)($,(X)=>{if(D.keywords[X])throw Error(`Keyword ${X} is already defined`);if(!dS.test(X))throw Error(`Keyword ${X} has invalid name`)}),!v)return;if(v.$data&&!(("code"in v)||("validate"in v)))throw Error('$data keyword must have "code" or "validate" function')}function z5($,v,D){var X;let U=v===null||v===void 0?void 0:v.post;if(D&&U)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,J=U?G.post:G.rules.find(({type:W})=>W===D);if(!J)J={type:D,rules:[]},G.rules.push(J);if(G.keywords[$]=!0,!v)return;let Q={keyword:$,definition:{...v,type:(0,JX.getJSONTypes)(v.type),schemaType:(0,JX.getJSONTypes)(v.schemaType)}};if(v.before)tS.call(this,J,Q,v.before);else J.rules.push(Q);G.all[$]=Q,(X=v.implements)===null||X===void 0||X.forEach((W)=>this.addKeyword(W))}function tS($,v,D){let X=$.rules.findIndex((U)=>U.keyword===D);if(X>=0)$.rules.splice(X,0,v);else $.rules.push(v),this.logger.warn(`rule ${D} is not defined`)}function oS($){let{metaSchema:v}=$;if(v===void 0)return;if($.$data&&this.opts.$data)v=$K(v);$.validateSchema=this.compile(v,!0)}var aS={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $K($){return{anyOf:[$,aS]}}});var DK=b((UK)=>{Object.defineProperty(UK,"__esModule",{value:!0});var $k={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};UK.default=$k});var zK=b((QK)=>{Object.defineProperty(QK,"__esModule",{value:!0});QK.callRef=QK.getValidate=void 0;var Uk=J0(),XK=X4(),r$=l(),E1=h4(),GK=UX(),WX=d(),Dk={keyword:"$ref",schemaType:"string",code($){let{gen:v,schema:D,it:X}=$,{baseId:U,schemaEnv:G,validateName:J,opts:Q,self:W}=X,{root:z}=G;if((D==="#"||D==="#/")&&U===z.baseId)return I();let Y=GK.resolveRef.call(W,z,U,D);if(Y===void 0)throw new Uk.default(X.opts.uriResolver,U,D);if(Y instanceof GK.SchemaEnv)return V(Y);return B(Y);function I(){if(G===z)return zX($,J,G,G.$async);let L=v.scopeValue("root",{ref:z});return zX($,r$._`${L}.validate`,z,z.$async)}function V(L){let N=JK($,L);zX($,N,L,L.$async)}function B(L){let N=v.scopeValue("schema",Q.code.source===!0?{ref:L,code:(0,r$.stringify)(L)}:{ref:L}),Z=v.name("valid"),F=$.subschema({schema:L,dataTypes:[],schemaPath:r$.nil,topSchemaRef:N,errSchemaPath:D},Z);$.mergeEvaluated(F),$.ok(Z)}}};function JK($,v){let{gen:D}=$;return v.validate?D.scopeValue("validate",{ref:v.validate}):r$._`${D.scopeValue("wrapper",{ref:v})}.validate`}QK.getValidate=JK;function zX($,v,D,X){let{gen:U,it:G}=$,{allErrors:J,schemaEnv:Q,opts:W}=G,z=W.passContext?E1.default.this:r$.nil;if(X)Y();else I();function Y(){if(!Q.$async)throw Error("async schema referenced by sync schema");let L=U.let("valid");U.try(()=>{if(U.code(r$._`await ${(0,XK.callValidateCode)($,v,z)}`),B(v),!J)U.assign(L,!0)},(N)=>{if(U.if(r$._`!(${N} instanceof ${G.ValidationError})`,()=>U.throw(N)),V(N),!J)U.assign(L,!1)}),$.ok(L)}function I(){$.result((0,XK.callValidateCode)($,v,z),()=>B(v),()=>V(v))}function V(L){let N=r$._`${L}.errors`;U.assign(E1.default.vErrors,r$._`${E1.default.vErrors} === null ? ${N} : ${E1.default.vErrors}.concat(${N})`),U.assign(E1.default.errors,r$._`${E1.default.vErrors}.length`)}function B(L){var N;if(!G.opts.unevaluated)return;let Z=(N=D===null||D===void 0?void 0:D.validate)===null||N===void 0?void 0:N.evaluated;if(G.props!==!0)if(Z&&!Z.dynamicProps){if(Z.props!==void 0)G.props=WX.mergeEvaluated.props(U,Z.props,G.props)}else{let F=U.var("props",r$._`${L}.evaluated.props`);G.props=WX.mergeEvaluated.props(U,F,G.props,r$.Name)}if(G.items!==!0)if(Z&&!Z.dynamicItems){if(Z.items!==void 0)G.items=WX.mergeEvaluated.items(U,Z.items,G.items)}else{let F=U.var("items",r$._`${L}.evaluated.items`);G.items=WX.mergeEvaluated.items(U,F,G.items,r$.Name)}}}QK.callRef=zX;QK.default=Dk});var IK=b((YK)=>{Object.defineProperty(YK,"__esModule",{value:!0});var Jk=DK(),Qk=zK(),Wk=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Jk.default,Qk.default];YK.default=Wk});var BK=b((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});var YX=l(),L6=YX.operators,IX={maximum:{okStr:"<=",ok:L6.LTE,fail:L6.GT},minimum:{okStr:">=",ok:L6.GTE,fail:L6.LT},exclusiveMaximum:{okStr:"<",ok:L6.LT,fail:L6.GTE},exclusiveMinimum:{okStr:">",ok:L6.GT,fail:L6.LTE}},Yk={message:({keyword:$,schemaCode:v})=>YX.str`must be ${IX[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>YX._`{comparison: ${IX[$].okStr}, limit: ${v}}`},Ik={keyword:Object.keys(IX),type:"number",schemaType:"number",$data:!0,error:Yk,code($){let{keyword:v,data:D,schemaCode:X}=$;$.fail$data(YX._`${D} ${IX[v].fail} ${X} || isNaN(${D})`)}};VK.default=Ik});var KK=b((LK)=>{Object.defineProperty(LK,"__esModule",{value:!0});var I0=l(),Bk={message:({schemaCode:$})=>I0.str`must be multiple of ${$}`,params:({schemaCode:$})=>I0._`{multipleOf: ${$}}`},Lk={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Bk,code($){let{gen:v,data:D,schemaCode:X,it:U}=$,G=U.opts.multipleOfPrecision,J=v.let("res"),Q=G?I0._`Math.abs(Math.round(${J}) - ${J}) > 1e-${G}`:I0._`${J} !== parseInt(${J})`;$.fail$data(I0._`(${X} === 0 || (${J} = ${D}/${X}, ${Q}))`)}};LK.default=Lk});var OK=b((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});function NK($){let v=$.length,D=0,X=0,U;while(X<v)if(D++,U=$.charCodeAt(X++),U>=55296&&U<=56319&&X<v){if(U=$.charCodeAt(X),(U&64512)===56320)X++}return D}ZK.default=NK;NK.code='require("ajv/dist/runtime/ucs2length").default'});var FK=b((HK)=>{Object.defineProperty(HK,"__esModule",{value:!0});var R6=l(),Zk=d(),Ok=OK(),Hk={message({keyword:$,schemaCode:v}){let D=$==="maxLength"?"more":"fewer";return R6.str`must NOT have ${D} than ${v} characters`},params:({schemaCode:$})=>R6._`{limit: ${$}}`},Fk={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Hk,code($){let{keyword:v,data:D,schemaCode:X,it:U}=$,G=v==="maxLength"?R6.operators.GT:R6.operators.LT,J=U.opts.unicode===!1?R6._`${D}.length`:R6._`${(0,Zk.useFunc)($.gen,Ok.default)}(${D})`;$.fail$data(R6._`${J} ${G} ${X}`)}};HK.default=Fk});var AK=b((jK)=>{Object.defineProperty(jK,"__esModule",{value:!0});var Ak=X4(),wk=d(),T1=l(),Mk={message:({schemaCode:$})=>T1.str`must match pattern "${$}"`,params:({schemaCode:$})=>T1._`{pattern: ${$}}`},Pk={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Mk,code($){let{gen:v,data:D,$data:X,schema:U,schemaCode:G,it:J}=$,Q=J.opts.unicodeRegExp?"u":"";if(X){let{regExp:W}=J.opts.code,z=W.code==="new RegExp"?T1._`new RegExp`:(0,wk.useFunc)(v,W),Y=v.let("valid");v.try(()=>v.assign(Y,T1._`${z}(${G}, ${Q}).test(${D})`),()=>v.assign(Y,!1)),$.fail$data(T1._`!${Y}`)}else{let W=(0,Ak.usePattern)($,U);$.fail$data(T1._`!${W}.test(${D})`)}}};jK.default=Pk});var MK=b((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});var V0=l(),qk={message({keyword:$,schemaCode:v}){let D=$==="maxProperties"?"more":"fewer";return V0.str`must NOT have ${D} than ${v} properties`},params:({schemaCode:$})=>V0._`{limit: ${$}}`},Sk={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:qk,code($){let{keyword:v,data:D,schemaCode:X}=$,U=v==="maxProperties"?V0.operators.GT:V0.operators.LT;$.fail$data(V0._`Object.keys(${D}).length ${U} ${X}`)}};wK.default=Sk});var bK=b((PK)=>{Object.defineProperty(PK,"__esModule",{value:!0});var B0=X4(),L0=l(),Ek=d(),Tk={message:({params:{missingProperty:$}})=>L0.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>L0._`{missingProperty: ${$}}`},Rk={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Tk,code($){let{gen:v,schema:D,schemaCode:X,data:U,$data:G,it:J}=$,{opts:Q}=J;if(!G&&D.length===0)return;let W=D.length>=Q.loopRequired;if(J.allErrors)z();else Y();if(Q.strictRequired){let B=$.parentSchema.properties,{definedProperties:L}=$.it;for(let N of D)if((B===null||B===void 0?void 0:B[N])===void 0&&!L.has(N)){let Z=J.schemaEnv.baseId+J.errSchemaPath,F=`required property "${N}" is not defined at "${Z}" (strictRequired)`;(0,Ek.checkStrictMode)(J,F,J.opts.strictRequired)}}function z(){if(W||G)$.block$data(L0.nil,I);else for(let B of D)(0,B0.checkReportMissingProp)($,B)}function Y(){let B=v.let("missing");if(W||G){let L=v.let("valid",!0);$.block$data(L,()=>V(B,L)),$.ok(L)}else v.if((0,B0.checkMissingProp)($,D,B)),(0,B0.reportMissingProp)($,B),v.else()}function I(){v.forOf("prop",X,(B)=>{$.setParams({missingProperty:B}),v.if((0,B0.noPropertyInData)(v,U,B,Q.ownProperties),()=>$.error())})}function V(B,L){$.setParams({missingProperty:B}),v.forOf(B,X,()=>{v.assign(L,(0,B0.propertyInData)(v,U,B,Q.ownProperties)),v.if((0,L0.not)(L),()=>{$.error(),v.break()})},L0.nil)}}};PK.default=Rk});var SK=b((qK)=>{Object.defineProperty(qK,"__esModule",{value:!0});var K0=l(),uk={message({keyword:$,schemaCode:v}){let D=$==="maxItems"?"more":"fewer";return K0.str`must NOT have ${D} than ${v} items`},params:({schemaCode:$})=>K0._`{limit: ${$}}`},Ck={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:uk,code($){let{keyword:v,data:D,schemaCode:X}=$,U=v==="maxItems"?K0.operators.GT:K0.operators.LT;$.fail$data(K0._`${D}.length ${U} ${X}`)}};qK.default=Ck});var VX=b((EK)=>{Object.defineProperty(EK,"__esModule",{value:!0});var kK=pz();kK.code='require("ajv/dist/runtime/equal").default';EK.default=kK});var RK=b((TK)=>{Object.defineProperty(TK,"__esModule",{value:!0});var I5=v0(),S$=l(),_k=d(),ik=VX(),yk={message:({params:{i:$,j:v}})=>S$.str`must NOT have duplicate items (items ## ${v} and ${$} are identical)`,params:({params:{i:$,j:v}})=>S$._`{i: ${$}, j: ${v}}`},nk={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:yk,code($){let{gen:v,data:D,$data:X,schema:U,parentSchema:G,schemaCode:J,it:Q}=$;if(!X&&!U)return;let W=v.let("valid"),z=G.items?(0,I5.getSchemaTypes)(G.items):[];$.block$data(W,Y,S$._`${J} === false`),$.ok(W);function Y(){let L=v.let("i",S$._`${D}.length`),N=v.let("j");$.setParams({i:L,j:N}),v.assign(W,!0),v.if(S$._`${L} > 1`,()=>(I()?V:B)(L,N))}function I(){return z.length>0&&!z.some((L)=>L==="object"||L==="array")}function V(L,N){let Z=v.name("item"),F=(0,I5.checkDataTypes)(z,Z,Q.opts.strictNumbers,I5.DataType.Wrong),S=v.const("indices",S$._`{}`);v.for(S$._`;${L}--;`,()=>{if(v.let(Z,S$._`${D}[${L}]`),v.if(F,S$._`continue`),z.length>1)v.if(S$._`typeof ${Z} == "string"`,S$._`${Z} += "_"`);v.if(S$._`typeof ${S}[${Z}] == "number"`,()=>{v.assign(N,S$._`${S}[${Z}]`),$.error(),v.assign(W,!1).break()}).code(S$._`${S}[${Z}] = ${L}`)})}function B(L,N){let Z=(0,_k.useFunc)(v,ik.default),F=v.name("outer");v.label(F).for(S$._`;${L}--;`,()=>v.for(S$._`${N} = ${L}; ${N}--;`,()=>v.if(S$._`${Z}(${D}[${L}], ${D}[${N}])`,()=>{$.error(),v.assign(W,!1).break(F)})))}}};TK.default=nk});var uK=b((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});var V5=l(),hk=d(),mk=VX(),ck={message:"must be equal to constant",params:({schemaCode:$})=>V5._`{allowedValue: ${$}}`},rk={keyword:"const",$data:!0,error:ck,code($){let{gen:v,data:D,$data:X,schemaCode:U,schema:G}=$;if(X||G&&typeof G=="object")$.fail$data(V5._`!${(0,hk.useFunc)(v,mk.default)}(${D}, ${U})`);else $.fail(V5._`${G} !== ${D}`)}};gK.default=rk});var xK=b((CK)=>{Object.defineProperty(CK,"__esModule",{value:!0});var N0=l(),pk=d(),tk=VX(),ok={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>N0._`{allowedValues: ${$}}`},ak={keyword:"enum",schemaType:"array",$data:!0,error:ok,code($){let{gen:v,data:D,$data:X,schema:U,schemaCode:G,it:J}=$;if(!X&&U.length===0)throw Error("enum must have non-empty array");let Q=U.length>=J.opts.loopEnum,W,z=()=>W!==null&&W!==void 0?W:W=(0,pk.useFunc)(v,tk.default),Y;if(Q||X)Y=v.let("valid"),$.block$data(Y,I);else{if(!Array.isArray(U))throw Error("ajv implementation error");let B=v.const("vSchema",G);Y=(0,N0.or)(...U.map((L,N)=>V(B,N)))}$.pass(Y);function I(){v.assign(Y,!1),v.forOf("v",G,(B)=>v.if(N0._`${z()}(${D}, ${B})`,()=>v.assign(Y,!0).break()))}function V(B,L){let N=U[L];return typeof N==="object"&&N!==null?N0._`${z()}(${D}, ${B}[${L}])`:N0._`${D} === ${N}`}}};CK.default=ak});var _K=b((fK)=>{Object.defineProperty(fK,"__esModule",{value:!0});var sk=BK(),$E=KK(),vE=FK(),UE=AK(),DE=MK(),XE=bK(),GE=SK(),JE=RK(),QE=uK(),WE=xK(),zE=[sk.default,$E.default,vE.default,UE.default,DE.default,XE.default,GE.default,JE.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},QE.default,WE.default];fK.default=zE});var L5=b((yK)=>{Object.defineProperty(yK,"__esModule",{value:!0});yK.validateAdditionalItems=void 0;var g6=l(),B5=d(),IE={message:({params:{len:$}})=>g6.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>g6._`{limit: ${$}}`},VE={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:IE,code($){let{parentSchema:v,it:D}=$,{items:X}=v;if(!Array.isArray(X)){(0,B5.checkStrictMode)(D,'"additionalItems" is ignored when "items" is not an array of schemas');return}iK($,X)}};function iK($,v){let{gen:D,schema:X,data:U,keyword:G,it:J}=$;J.items=!0;let Q=D.const("len",g6._`${U}.length`);if(X===!1)$.setParams({len:v.length}),$.pass(g6._`${Q} <= ${v.length}`);else if(typeof X=="object"&&!(0,B5.alwaysValidSchema)(J,X)){let z=D.var("valid",g6._`${Q} <= ${v.length}`);D.if((0,g6.not)(z),()=>W(z)),$.ok(z)}function W(z){D.forRange("i",v.length,Q,(Y)=>{if($.subschema({keyword:G,dataProp:Y,dataPropType:B5.Type.Num},z),!J.allErrors)D.if((0,g6.not)(z),()=>D.break())})}}yK.validateAdditionalItems=iK;yK.default=VE});var K5=b((mK)=>{Object.defineProperty(mK,"__esModule",{value:!0});mK.validateTuple=void 0;var lK=l(),BX=d(),LE=X4(),KE={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:v,it:D}=$;if(Array.isArray(v))return hK($,"additionalItems",v);if(D.items=!0,(0,BX.alwaysValidSchema)(D,v))return;$.ok((0,LE.validateArray)($))}};function hK($,v,D=$.schema){let{gen:X,parentSchema:U,data:G,keyword:J,it:Q}=$;if(Y(U),Q.opts.unevaluated&&D.length&&Q.items!==!0)Q.items=BX.mergeEvaluated.items(X,D.length,Q.items);let W=X.name("valid"),z=X.const("len",lK._`${G}.length`);D.forEach((I,V)=>{if((0,BX.alwaysValidSchema)(Q,I))return;X.if(lK._`${z} > ${V}`,()=>$.subschema({keyword:J,schemaProp:V,dataProp:V},W)),$.ok(W)});function Y(I){let{opts:V,errSchemaPath:B}=Q,L=D.length,N=L===I.minItems&&(L===I.maxItems||I[v]===!1);if(V.strictTuples&&!N){let Z=`"${J}" is ${L}-tuple, but minItems or maxItems/${v} are not specified or different at path "${B}"`;(0,BX.checkStrictMode)(Q,Z,V.strictTuples)}}}mK.validateTuple=hK;mK.default=KE});var dK=b((rK)=>{Object.defineProperty(rK,"__esModule",{value:!0});var ZE=K5(),OE={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,ZE.validateTuple)($,"items")};rK.default=OE});var oK=b((tK)=>{Object.defineProperty(tK,"__esModule",{value:!0});var pK=l(),FE=d(),jE=X4(),AE=L5(),wE={message:({params:{len:$}})=>pK.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>pK._`{limit: ${$}}`},ME={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:wE,code($){let{schema:v,parentSchema:D,it:X}=$,{prefixItems:U}=D;if(X.items=!0,(0,FE.alwaysValidSchema)(X,v))return;if(U)(0,AE.validateAdditionalItems)($,U);else $.ok((0,jE.validateArray)($))}};tK.default=ME});var eK=b((aK)=>{Object.defineProperty(aK,"__esModule",{value:!0});var G4=l(),LX=d(),bE={message:({params:{min:$,max:v}})=>v===void 0?G4.str`must contain at least ${$} valid item(s)`:G4.str`must contain at least ${$} and no more than ${v} valid item(s)`,params:({params:{min:$,max:v}})=>v===void 0?G4._`{minContains: ${$}}`:G4._`{minContains: ${$}, maxContains: ${v}}`},qE={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:bE,code($){let{gen:v,schema:D,parentSchema:X,data:U,it:G}=$,J,Q,{minContains:W,maxContains:z}=X;if(G.opts.next)J=W===void 0?1:W,Q=z;else J=1;let Y=v.const("len",G4._`${U}.length`);if($.setParams({min:J,max:Q}),Q===void 0&&J===0){(0,LX.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Q!==void 0&&J>Q){(0,LX.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,LX.alwaysValidSchema)(G,D)){let N=G4._`${Y} >= ${J}`;if(Q!==void 0)N=G4._`${N} && ${Y} <= ${Q}`;$.pass(N);return}G.items=!0;let I=v.name("valid");if(Q===void 0&&J===1)B(I,()=>v.if(I,()=>v.break()));else if(J===0){if(v.let(I,!0),Q!==void 0)v.if(G4._`${U}.length > 0`,V)}else v.let(I,!1),V();$.result(I,()=>$.reset());function V(){let N=v.name("_valid"),Z=v.let("count",0);B(N,()=>v.if(N,()=>L(Z)))}function B(N,Z){v.forRange("i",0,Y,(F)=>{$.subschema({keyword:"contains",dataProp:F,dataPropType:LX.Type.Num,compositeRule:!0},N),Z()})}function L(N){if(v.code(G4._`${N}++`),Q===void 0)v.if(G4._`${N} >= ${J}`,()=>v.assign(I,!0).break());else if(v.if(G4._`${N} > ${Q}`,()=>v.assign(I,!1).break()),J===1)v.assign(I,!0);else v.if(G4._`${N} >= ${J}`,()=>v.assign(I,!0))}}};aK.default=qE});var XN=b((vN)=>{Object.defineProperty(vN,"__esModule",{value:!0});vN.validateSchemaDeps=vN.validatePropertyDeps=vN.error=void 0;var N5=l(),kE=d(),Z0=X4();vN.error={message:({params:{property:$,depsCount:v,deps:D}})=>{let X=v===1?"property":"properties";return N5.str`must have ${X} ${D} when property ${$} is present`},params:({params:{property:$,depsCount:v,deps:D,missingProperty:X}})=>N5._`{property: ${$},
|
|
8
|
+
missingProperty: ${X},
|
|
9
9
|
depsCount: ${v},
|
|
10
|
-
deps: ${D}}`};var WS={keyword:"dependencies",type:"object",schemaType:"object",error:wB.error,code($){let[v,D]=YS($);OB($,v),jB($,D)}};function YS({schema:$}){let v={},D={};for(let I in $){if(I==="__proto__")continue;let U=Array.isArray($[I])?v:D;U[I]=$[I]}return[v,D]}function OB($,v=$.schema){let{gen:D,data:I,it:U}=$;if(Object.keys(v).length===0)return;let X=D.let("missing");for(let G in v){let Q=v[G];if(Q.length===0)continue;let J=(0,XU.propertyInData)(D,I,G,U.opts.ownProperties);if($.setParams({property:G,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)D.if(J,()=>{for(let z of Q)(0,XU.checkReportMissingProp)($,z)});else D.if(Nz._`${J} && (${(0,XU.checkMissingProp)($,Q,X)})`),(0,XU.reportMissingProp)($,X),D.else()}}wB.validatePropertyDeps=OB;function jB($,v=$.schema){let{gen:D,data:I,keyword:U,it:X}=$,G=D.name("valid");for(let Q in v){if((0,zS.alwaysValidSchema)(X,v[Q]))continue;D.if((0,XU.propertyInData)(D,I,Q,X.opts.ownProperties),()=>{let J=$.subschema({keyword:U,schemaProp:Q},G);$.mergeValidEvaluated(J,G)},()=>D.var(G,!0)),$.ok(G)}}wB.validateSchemaDeps=jB;wB.default=WS});var kB=b((SB)=>{Object.defineProperty(SB,"__esModule",{value:!0});var qB=_(),BS=d(),KS={message:"property name must be valid",params:({params:$})=>qB._`{propertyName: ${$.propertyName}}`},NS={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:KS,code($){let{gen:v,schema:D,data:I,it:U}=$;if((0,BS.alwaysValidSchema)(U,D))return;let X=v.name("valid");v.forIn("key",I,(G)=>{$.setParams({propertyName:G}),$.subschema({keyword:"propertyNames",data:G,dataTypes:["string"],propertyName:G,compositeRule:!0},X),v.if((0,qB.not)(X),()=>{if($.error(!0),!U.allErrors)v.break()})}),$.ok(X)}};SB.default=NS});var Zz=b((TB)=>{Object.defineProperty(TB,"__esModule",{value:!0});var fD=I4(),V4=_(),AS=n4(),_D=d(),HS={message:"must NOT have additional properties",params:({params:$})=>V4._`{additionalProperty: ${$.additionalProperty}}`},FS={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:HS,code($){let{gen:v,schema:D,parentSchema:I,data:U,errsCount:X,it:G}=$;if(!X)throw Error("ajv implementation error");let{allErrors:Q,opts:J}=G;if(G.props=!0,J.removeAdditional!=="all"&&(0,_D.alwaysValidSchema)(G,D))return;let z=(0,fD.allSchemaProperties)(I.properties),W=(0,fD.allSchemaProperties)(I.patternProperties);Y(),$.ok(V4._`${X} === ${AS.default.errors}`);function Y(){v.forIn("key",U,(A)=>{if(!z.length&&!W.length)B(A);else v.if(L(A),()=>B(A))})}function L(A){let F;if(z.length>8){let S=(0,_D.schemaRefOrVal)(G,I.properties,"properties");F=(0,fD.isOwnProperty)(v,S,A)}else if(z.length)F=(0,V4.or)(...z.map((S)=>V4._`${A} === ${S}`));else F=V4.nil;if(W.length)F=(0,V4.or)(F,...W.map((S)=>V4._`${(0,fD.usePattern)($,S)}.test(${A})`));return(0,V4.not)(F)}function V(A){v.code(V4._`delete ${U}[${A}]`)}function B(A){if(J.removeAdditional==="all"||J.removeAdditional&&D===!1){V(A);return}if(D===!1){if($.setParams({additionalProperty:A}),$.error(),!Q)v.break();return}if(typeof D=="object"&&!(0,_D.alwaysValidSchema)(G,D)){let F=v.name("valid");if(J.removeAdditional==="failing")N(A,F,!1),v.if((0,V4.not)(F),()=>{$.reset(),V(A)});else if(N(A,F),!Q)v.if((0,V4.not)(F),()=>v.break())}}function N(A,F,S){let E={keyword:"additionalProperties",dataProp:A,dataPropType:_D.Type.Str};if(S===!1)Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(E,F)}}};TB.default=FS});var RB=b((gB)=>{Object.defineProperty(gB,"__esModule",{value:!0});var jS=dv(),EB=I4(),Az=d(),uB=Zz(),wS={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:v,schema:D,parentSchema:I,data:U,it:X}=$;if(X.opts.removeAdditional==="all"&&I.additionalProperties===void 0)uB.default.code(new jS.KeywordCxt(X,uB.default,"additionalProperties"));let G=(0,EB.allSchemaProperties)(D);for(let Y of G)X.definedProperties.add(Y);if(X.opts.unevaluated&&G.length&&X.props!==!0)X.props=Az.mergeEvaluated.props(v,(0,Az.toHash)(G),X.props);let Q=G.filter((Y)=>!(0,Az.alwaysValidSchema)(X,D[Y]));if(Q.length===0)return;let J=v.name("valid");for(let Y of Q){if(z(Y))W(Y);else{if(v.if((0,EB.propertyInData)(v,U,Y,X.opts.ownProperties)),W(Y),!X.allErrors)v.else().var(J,!0);v.endIf()}$.it.definedProperties.add(Y),$.ok(J)}function z(Y){return X.opts.useDefaults&&!X.compositeRule&&D[Y].default!==void 0}function W(Y){$.subschema({keyword:"properties",schemaProp:Y,dataProp:Y},J)}}};gB.default=wS});var fB=b((xB)=>{Object.defineProperty(xB,"__esModule",{value:!0});var CB=I4(),yD=_(),iB=d(),nB=d(),MS={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:v,schema:D,data:I,parentSchema:U,it:X}=$,{opts:G}=X,Q=(0,CB.allSchemaProperties)(D),J=Q.filter((N)=>(0,iB.alwaysValidSchema)(X,D[N]));if(Q.length===0||J.length===Q.length&&(!X.opts.unevaluated||X.props===!0))return;let z=G.strictSchema&&!G.allowMatchingProperties&&U.properties,W=v.name("valid");if(X.props!==!0&&!(X.props instanceof yD.Name))X.props=(0,nB.evaluatedPropsToName)(v,X.props);let{props:Y}=X;L();function L(){for(let N of Q){if(z)V(N);if(X.allErrors)B(N);else v.var(W,!0),B(N),v.if(W)}}function V(N){for(let A in z)if(new RegExp(N).test(A))(0,iB.checkStrictMode)(X,`property ${A} matches pattern ${N} (use allowMatchingProperties)`)}function B(N){v.forIn("key",I,(A)=>{v.if(yD._`${(0,CB.usePattern)($,N)}.test(${A})`,()=>{let F=J.includes(N);if(!F)$.subschema({keyword:"patternProperties",schemaProp:N,dataProp:A,dataPropType:nB.Type.Str},W);if(X.opts.unevaluated&&Y!==!0)v.assign(yD._`${Y}[${A}]`,!0);else if(!F&&!X.allErrors)v.if((0,yD.not)(W),()=>v.break())})})}}};xB.default=MS});var yB=b((_B)=>{Object.defineProperty(_B,"__esModule",{value:!0});var qS=d(),SS={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:v,schema:D,it:I}=$;if((0,qS.alwaysValidSchema)(I,D)){$.fail();return}let U=v.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},U),$.failResult(U,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};_B.default=SS});var hB=b((lB)=>{Object.defineProperty(lB,"__esModule",{value:!0});var TS=I4(),ES={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:TS.validateUnion,error:{message:"must match a schema in anyOf"}};lB.default=ES});var mB=b((rB)=>{Object.defineProperty(rB,"__esModule",{value:!0});var lD=_(),gS=d(),RS={message:"must match exactly one schema in oneOf",params:({params:$})=>lD._`{passingSchemas: ${$.passing}}`},CS={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:RS,code($){let{gen:v,schema:D,parentSchema:I,it:U}=$;if(!Array.isArray(D))throw Error("ajv implementation error");if(U.opts.discriminator&&I.discriminator)return;let X=D,G=v.let("valid",!1),Q=v.let("passing",null),J=v.name("_valid");$.setParams({passing:Q}),v.block(z),$.result(G,()=>$.reset(),()=>$.error(!0));function z(){X.forEach((W,Y)=>{let L;if((0,gS.alwaysValidSchema)(U,W))v.var(J,!0);else L=$.subschema({keyword:"oneOf",schemaProp:Y,compositeRule:!0},J);if(Y>0)v.if(lD._`${J} && ${G}`).assign(G,!1).assign(Q,lD._`[${Q}, ${Y}]`).else();v.if(J,()=>{if(v.assign(G,!0),v.assign(Q,Y),L)$.mergeEvaluated(L,lD.Name)})})}}};rB.default=CS});var dB=b((cB)=>{Object.defineProperty(cB,"__esModule",{value:!0});var nS=d(),xS={keyword:"allOf",schemaType:"array",code($){let{gen:v,schema:D,it:I}=$;if(!Array.isArray(D))throw Error("ajv implementation error");let U=v.name("valid");D.forEach((X,G)=>{if((0,nS.alwaysValidSchema)(I,X))return;let Q=$.subschema({keyword:"allOf",schemaProp:G},U);$.ok(U),$.mergeEvaluated(Q)})}};cB.default=xS});var aB=b((oB)=>{Object.defineProperty(oB,"__esModule",{value:!0});var hD=_(),pB=d(),_S={message:({params:$})=>hD.str`must match "${$.ifClause}" schema`,params:({params:$})=>hD._`{failingKeyword: ${$.ifClause}}`},yS={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:_S,code($){let{gen:v,parentSchema:D,it:I}=$;if(D.then===void 0&&D.else===void 0)(0,pB.checkStrictMode)(I,'"if" without "then" and "else" is ignored');let U=tB(I,"then"),X=tB(I,"else");if(!U&&!X)return;let G=v.let("valid",!0),Q=v.name("_valid");if(J(),$.reset(),U&&X){let W=v.let("ifClause");$.setParams({ifClause:W}),v.if(Q,z("then",W),z("else",W))}else if(U)v.if(Q,z("then"));else v.if((0,hD.not)(Q),z("else"));$.pass(G,()=>$.error(!0));function J(){let W=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Q);$.mergeEvaluated(W)}function z(W,Y){return()=>{let L=$.subschema({keyword:W},Q);if(v.assign(G,Q),$.mergeValidEvaluated(L,G),Y)v.assign(Y,hD._`${W}`);else $.setParams({ifClause:W})}}}};function tB($,v){let D=$.schema[v];return D!==void 0&&!(0,pB.alwaysValidSchema)($,D)}oB.default=yS});var sB=b((eB)=>{Object.defineProperty(eB,"__esModule",{value:!0});var hS=d(),rS={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:v,it:D}){if(v.if===void 0)(0,hS.checkStrictMode)(D,`"${$}" without "if" is ignored`)}};eB.default=rS});var vK=b(($K)=>{Object.defineProperty($K,"__esModule",{value:!0});var cS=Bz(),dS=KB(),tS=Kz(),pS=AB(),oS=FB(),aS=bB(),eS=kB(),sS=Zz(),$k=RB(),vk=fB(),Uk=yB(),Dk=hB(),Ik=mB(),Xk=dB(),Gk=aB(),Qk=sB();function Jk($=!1){let v=[Uk.default,Dk.default,Ik.default,Xk.default,Gk.default,Qk.default,eS.default,sS.default,aS.default,$k.default,vk.default];if($)v.push(dS.default,pS.default);else v.push(cS.default,tS.default);return v.push(oS.default),v}$K.default=Jk});var DK=b((UK)=>{Object.defineProperty(UK,"__esModule",{value:!0});var B$=_(),Wk={message:({schemaCode:$})=>B$.str`must match format "${$}"`,params:({schemaCode:$})=>B$._`{format: ${$}}`},Yk={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Wk,code($,v){let{gen:D,data:I,$data:U,schema:X,schemaCode:G,it:Q}=$,{opts:J,errSchemaPath:z,schemaEnv:W,self:Y}=Q;if(!J.validateFormats)return;if(U)L();else V();function L(){let B=D.scopeValue("formats",{ref:Y.formats,code:J.code.formats}),N=D.const("fDef",B$._`${B}[${G}]`),A=D.let("fType"),F=D.let("format");D.if(B$._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>D.assign(A,B$._`${N}.type || "string"`).assign(F,B$._`${N}.validate`),()=>D.assign(A,B$._`"string"`).assign(F,N)),$.fail$data((0,B$.or)(S(),E()));function S(){if(J.strictSchema===!1)return B$.nil;return B$._`${G} && !${F}`}function E(){let g=W.$async?B$._`(${N}.async ? await ${F}(${I}) : ${F}(${I}))`:B$._`${F}(${I})`,k=B$._`(typeof ${F} == "function" ? ${g} : ${F}.test(${I}))`;return B$._`${F} && ${F} !== true && ${A} === ${v} && !${k}`}}function V(){let B=Y.formats[X];if(!B){S();return}if(B===!0)return;let[N,A,F]=E(B);if(N===v)$.pass(g());function S(){if(J.strictSchema===!1){Y.logger.warn(k());return}throw Error(k());function k(){return`unknown format "${X}" ignored in schema at path "${z}"`}}function E(k){let N$=k instanceof RegExp?(0,B$.regexpCode)(k):J.code.formats?B$._`${J.code.formats}${(0,B$.getProperty)(X)}`:void 0,O$=D.scopeValue("formats",{key:X,ref:k,code:N$});if(typeof k=="object"&&!(k instanceof RegExp))return[k.type||"string",k.validate,B$._`${O$}.validate`];return["string",k,O$]}function g(){if(typeof B=="object"&&!(B instanceof RegExp)&&B.async){if(!W.$async)throw Error("async format in sync schema");return B$._`await ${F}(${I})`}return typeof A=="function"?B$._`${F}(${I})`:B$._`${F}.test(${I})`}}}};UK.default=Yk});var XK=b((IK)=>{Object.defineProperty(IK,"__esModule",{value:!0});var Vk=DK(),Bk=[Vk.default];IK.default=Bk});var JK=b((GK)=>{Object.defineProperty(GK,"__esModule",{value:!0});GK.contentVocabulary=GK.metadataVocabulary=void 0;GK.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];GK.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var YK=b((WK)=>{Object.defineProperty(WK,"__esModule",{value:!0});var Zk=gV(),Ak=GB(),Hk=vK(),Fk=XK(),zK=JK(),Ok=[Zk.default,Ak.default,(0,Hk.default)(),Fk.default,zK.metadataVocabulary,zK.contentVocabulary];WK.default=Ok});var KK=b((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});VK.DiscrError=void 0;var LK;(function($){$.Tag="tag",$.Mapping="mapping"})(LK||(VK.DiscrError=LK={}))});var AK=b((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});var P1=_(),Hz=KK(),NK=bD(),wk=tv(),Pk=d(),Mk={message:({params:{discrError:$,tagName:v}})=>$===Hz.DiscrError.Tag?`tag "${v}" must be string`:`value of tag "${v}" must be in oneOf`,params:({params:{discrError:$,tag:v,tagName:D}})=>P1._`{error: ${$}, tag: ${D}, tagValue: ${v}}`},bk={keyword:"discriminator",type:"object",schemaType:"object",error:Mk,code($){let{gen:v,data:D,schema:I,parentSchema:U,it:X}=$,{oneOf:G}=U;if(!X.opts.discriminator)throw Error("discriminator: requires discriminator option");let Q=I.propertyName;if(typeof Q!="string")throw Error("discriminator: requires propertyName");if(I.mapping)throw Error("discriminator: mapping is not supported");if(!G)throw Error("discriminator: requires oneOf keyword");let J=v.let("valid",!1),z=v.const("tag",P1._`${D}${(0,P1.getProperty)(Q)}`);v.if(P1._`typeof ${z} == "string"`,()=>W(),()=>$.error(!1,{discrError:Hz.DiscrError.Tag,tag:z,tagName:Q})),$.ok(J);function W(){let V=L();v.if(!1);for(let B in V)v.elseIf(P1._`${z} === ${B}`),v.assign(J,Y(V[B]));v.else(),$.error(!1,{discrError:Hz.DiscrError.Mapping,tag:z,tagName:Q}),v.endIf()}function Y(V){let B=v.name("valid"),N=$.subschema({keyword:"oneOf",schemaProp:V},B);return $.mergeEvaluated(N,P1.Name),B}function L(){var V;let B={},N=F(U),A=!0;for(let g=0;g<G.length;g++){let k=G[g];if((k===null||k===void 0?void 0:k.$ref)&&!(0,Pk.schemaHasRulesButRef)(k,X.self.RULES)){let O$=k.$ref;if(k=NK.resolveRef.call(X.self,X.schemaEnv.root,X.baseId,O$),k instanceof NK.SchemaEnv)k=k.schema;if(k===void 0)throw new wk.default(X.opts.uriResolver,X.baseId,O$)}let N$=(V=k===null||k===void 0?void 0:k.properties)===null||V===void 0?void 0:V[Q];if(typeof N$!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Q}"`);A=A&&(N||F(k)),S(N$,g)}if(!A)throw Error(`discriminator: "${Q}" must be required`);return B;function F({required:g}){return Array.isArray(g)&&g.includes(Q)}function S(g,k){if(g.const)E(g.const,k);else if(g.enum)for(let N$ of g.enum)E(N$,k);else throw Error(`discriminator: "properties/${Q}" must have "const" or "enum"`)}function E(g,k){if(typeof g!="string"||g in B)throw Error(`discriminator: "${Q}" values must be unique strings`);B[g]=k}}}};ZK.default=bk});var HK=b((zy,Sk)=>{Sk.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 Oz=b((d$,Fz)=>{Object.defineProperty(d$,"__esModule",{value:!0});d$.MissingRefError=d$.ValidationError=d$.CodeGen=d$.Name=d$.nil=d$.stringify=d$.str=d$._=d$.KeywordCxt=d$.Ajv=void 0;var kk=wV(),Tk=YK(),Ek=AK(),FK=HK(),uk=["/properties"],rD="http://json-schema.org/draft-07/schema";class GU extends kk.default{_addVocabularies(){if(super._addVocabularies(),Tk.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(Ek.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(FK,uk):FK;this.addMetaSchema($,rD,!1),this.refs["http://json-schema.org/schema"]=rD}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(rD)?rD:void 0)}}d$.Ajv=GU;Fz.exports=d$=GU;Fz.exports.Ajv=GU;Object.defineProperty(d$,"__esModule",{value:!0});d$.default=GU;var gk=dv();Object.defineProperty(d$,"KeywordCxt",{enumerable:!0,get:function(){return gk.KeywordCxt}});var M1=_();Object.defineProperty(d$,"_",{enumerable:!0,get:function(){return M1._}});Object.defineProperty(d$,"str",{enumerable:!0,get:function(){return M1.str}});Object.defineProperty(d$,"stringify",{enumerable:!0,get:function(){return M1.stringify}});Object.defineProperty(d$,"nil",{enumerable:!0,get:function(){return M1.nil}});Object.defineProperty(d$,"Name",{enumerable:!0,get:function(){return M1.Name}});Object.defineProperty(d$,"CodeGen",{enumerable:!0,get:function(){return M1.CodeGen}});var Rk=PD();Object.defineProperty(d$,"ValidationError",{enumerable:!0,get:function(){return Rk.default}});var Ck=tv();Object.defineProperty(d$,"MissingRefError",{enumerable:!0,get:function(){return Ck.default}})});var TK=b((SK)=>{Object.defineProperty(SK,"__esModule",{value:!0});SK.formatNames=SK.fastFormats=SK.fullFormats=void 0;function P4($,v){return{validate:$,compare:v}}SK.fullFormats={date:P4(PK,Mz),time:P4(wz(!0),bz),"date-time":P4(OK(!0),bK),"iso-time":P4(wz(),MK),"iso-date-time":P4(OK(),qK),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:hk,"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:ok,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:rk,int32:{type:"number",validate:dk},int64:{type:"number",validate:tk},float:{type:"number",validate:wK},double:{type:"number",validate:wK},password:!0,binary:!0};SK.fastFormats={...SK.fullFormats,date:P4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Mz),time:P4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,bz),"date-time":P4(/^\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,bK),"iso-time":P4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,MK),"iso-date-time":P4(/^\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,qK),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};SK.formatNames=Object.keys(SK.fullFormats);function xk($){return $%4===0&&($%100!==0||$%400===0)}var fk=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,_k=[0,31,28,31,30,31,30,31,31,30,31,30,31];function PK($){let v=fk.exec($);if(!v)return!1;let D=+v[1],I=+v[2],U=+v[3];return I>=1&&I<=12&&U>=1&&U<=(I===2&&xk(D)?29:_k[I])}function Mz($,v){if(!($&&v))return;if($>v)return 1;if($<v)return-1;return 0}var jz=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function wz($){return function(D){let I=jz.exec(D);if(!I)return!1;let U=+I[1],X=+I[2],G=+I[3],Q=I[4],J=I[5]==="-"?-1:1,z=+(I[6]||0),W=+(I[7]||0);if(z>23||W>59||$&&!Q)return!1;if(U<=23&&X<=59&&G<60)return!0;let Y=X-W*J,L=U-z*J-(Y<0?1:0);return(L===23||L===-1)&&(Y===59||Y===-1)&&G<61}}function bz($,v){if(!($&&v))return;let D=new Date("2020-01-01T"+$).valueOf(),I=new Date("2020-01-01T"+v).valueOf();if(!(D&&I))return;return D-I}function MK($,v){if(!($&&v))return;let D=jz.exec($),I=jz.exec(v);if(!(D&&I))return;if($=D[1]+D[2]+D[3],v=I[1]+I[2]+I[3],$>v)return 1;if($<v)return-1;return 0}var Pz=/t|\s/i;function OK($){let v=wz($);return function(I){let U=I.split(Pz);return U.length===2&&PK(U[0])&&v(U[1])}}function bK($,v){if(!($&&v))return;let D=new Date($).valueOf(),I=new Date(v).valueOf();if(!(D&&I))return;return D-I}function qK($,v){if(!($&&v))return;let[D,I]=$.split(Pz),[U,X]=v.split(Pz),G=Mz(D,U);if(G===void 0)return;return G||bz(I,X)}var yk=/\/|:/,lk=/^(?:[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 hk($){return yk.test($)&&lk.test($)}var jK=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function rk($){return jK.lastIndex=0,jK.test($)}var mk=-2147483648,ck=2147483647;function dk($){return Number.isInteger($)&&$<=ck&&$>=mk}function tk($){return Number.isInteger($)}function wK(){return!0}var pk=/[^\\]\\Z/;function ok($){if(pk.test($))return!1;try{return new RegExp($),!0}catch(v){return!1}}});var uK=b((EK)=>{Object.defineProperty(EK,"__esModule",{value:!0});EK.formatLimitDefinition=void 0;var ek=Oz(),B4=_(),Q6=B4.operators,mD={formatMaximum:{okStr:"<=",ok:Q6.LTE,fail:Q6.GT},formatMinimum:{okStr:">=",ok:Q6.GTE,fail:Q6.LT},formatExclusiveMaximum:{okStr:"<",ok:Q6.LT,fail:Q6.GTE},formatExclusiveMinimum:{okStr:">",ok:Q6.GT,fail:Q6.LTE}},sk={message:({keyword:$,schemaCode:v})=>B4.str`should be ${mD[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>B4._`{comparison: ${mD[$].okStr}, limit: ${v}}`};EK.formatLimitDefinition={keyword:Object.keys(mD),type:"string",schemaType:"string",$data:!0,error:sk,code($){let{gen:v,data:D,schemaCode:I,keyword:U,it:X}=$,{opts:G,self:Q}=X;if(!G.validateFormats)return;let J=new ek.KeywordCxt(X,Q.RULES.all.format.definition,"format");if(J.$data)z();else W();function z(){let L=v.scopeValue("formats",{ref:Q.formats,code:G.code.formats}),V=v.const("fmt",B4._`${L}[${J.schemaCode}]`);$.fail$data((0,B4.or)(B4._`typeof ${V} != "object"`,B4._`${V} instanceof RegExp`,B4._`typeof ${V}.compare != "function"`,Y(V)))}function W(){let L=J.schema,V=Q.formats[L];if(!V||V===!0)return;if(typeof V!="object"||V instanceof RegExp||typeof V.compare!="function")throw Error(`"${U}": format "${L}" does not define "compare" function`);let B=v.scopeValue("formats",{key:L,ref:V,code:G.code.formats?B4._`${G.code.formats}${(0,B4.getProperty)(L)}`:void 0});$.fail$data(Y(B))}function Y(L){return B4._`${L}.compare(${D}, ${I}) ${mD[U].fail} 0`}},dependencies:["format"]};var $T=($)=>{return $.addKeyword(EK.formatLimitDefinition),$};EK.default=$T});var iK=b((QU,CK)=>{Object.defineProperty(QU,"__esModule",{value:!0});var b1=TK(),UT=uK(),kz=_(),gK=new kz.Name("fullFormats"),DT=new kz.Name("fastFormats"),Tz=($,v={keywords:!0})=>{if(Array.isArray(v))return RK($,v,b1.fullFormats,gK),$;let[D,I]=v.mode==="fast"?[b1.fastFormats,DT]:[b1.fullFormats,gK],U=v.formats||b1.formatNames;if(RK($,U,D,I),v.keywords)(0,UT.default)($);return $};Tz.get=($,v="full")=>{let I=(v==="fast"?b1.fastFormats:b1.fullFormats)[$];if(!I)throw Error(`Unknown format "${$}"`);return I};function RK($,v,D,I){var U,X;(U=(X=$.opts.code).formats)!==null&&U!==void 0||(X.formats=kz._`require("ajv-formats/dist/formats").${I}`);for(let G of v)$.addFormat(G,D[G])}CK.exports=QU=Tz;Object.defineProperty(QU,"__esModule",{value:!0});QU.default=Tz});var BI="https://api.aetherwealth.ai",KI="http://localhost:9006",Y6="127.0.0.1",AU=["localhost","127.0.0.1","[::1]"];var TW=`https://registry.npmjs.org/${encodeURIComponent("@aetherwealth/mcp")}/latest`,NI="npm install -g @aetherwealth/mcp@latest";function HA($){let v=$.NODE_ENV;return v==="development"||v==="test"}function EW($){let v=$.AETHER_BASE_URL,D="";if(v&&v.trim().length>0)D=v.trim();else if(HA($))D=KI;else D=BI;let I;try{I=new URL(D)}catch{return{config:null,errors:[`AETHER_BASE_URL is not a valid URL: "${D}"`]}}if(I.protocol!=="https:"&&!FA(I.hostname))return{config:null,errors:[`AETHER_BASE_URL must use https (loopback hosts exempt): "${D}"`]};let U=D.replace(/\/$/,"");return{config:{baseUrl:U,trpcUrl:`${U}/trpc`,host:I.host},errors:[]}}function FA($){return AU.includes($)}import{timingSafeEqual as sN}from"node:crypto";import{createServer as Uu}from"node:http";var h={};T4(h,{xor:()=>K5,xid:()=>_Y,void:()=>Y5,uuidv7:()=>uY,uuidv6:()=>EY,uuidv4:()=>TY,uuid:()=>kY,util:()=>w,url:()=>gY,uppercase:()=>y6,unknown:()=>U$,union:()=>D$,undefined:()=>z5,ulid:()=>fY,uint64:()=>Q5,uint32:()=>I5,tuple:()=>uJ,trim:()=>d6,treeifyError:()=>kI,transform:()=>r0,toUpperCase:()=>p6,toLowerCase:()=>t6,toJSONSchema:()=>Z0,templateLiteral:()=>q5,symbol:()=>J5,superRefine:()=>X9,success:()=>w5,stringbool:()=>R5,stringFormat:()=>aY,string:()=>H,strictObject:()=>B5,startsWith:()=>h6,slugify:()=>o6,size:()=>Z6,setErrorMap:()=>cF,set:()=>H5,safeParseAsync:()=>WJ,safeParse:()=>zJ,safeEncodeAsync:()=>ZJ,safeEncode:()=>KJ,safeDecodeAsync:()=>AJ,safeDecode:()=>NJ,registry:()=>lU,regexes:()=>a$,regex:()=>f6,refine:()=>I9,record:()=>s,readonly:()=>eJ,property:()=>V0,promise:()=>S5,prettifyError:()=>TI,preprocess:()=>jv,prefault:()=>rJ,positive:()=>z0,pipe:()=>P0,partialRecord:()=>N5,parseAsync:()=>JJ,parse:()=>QJ,overwrite:()=>J4,optional:()=>G$,object:()=>q,number:()=>p,nullish:()=>j5,nullable:()=>Yv,null:()=>Bv,normalize:()=>c6,nonpositive:()=>Y0,nonoptional:()=>mJ,nonnegative:()=>L0,never:()=>h0,negative:()=>W0,nativeEnum:()=>F5,nanoid:()=>iY,nan:()=>P5,multipleOf:()=>m4,minSize:()=>O4,minLength:()=>u4,mime:()=>m6,meta:()=>u5,maxSize:()=>c4,maxLength:()=>A6,map:()=>A5,mac:()=>hY,lte:()=>e$,lt:()=>H4,lowercase:()=>_6,looseRecord:()=>Z5,looseObject:()=>w$,locales:()=>Gv,literal:()=>T,length:()=>H6,lazy:()=>v9,ksuid:()=>yY,keyof:()=>V5,jwt:()=>oY,json:()=>C5,iso:()=>o4,ipv6:()=>rY,ipv4:()=>lY,invertCodec:()=>b5,intersection:()=>G1,int64:()=>G5,int32:()=>D5,int:()=>w0,instanceof:()=>g5,includes:()=>l6,httpUrl:()=>RY,hostname:()=>eY,hex:()=>sY,hash:()=>$5,guid:()=>SY,gte:()=>i$,gt:()=>F4,globalRegistry:()=>j$,getErrorMap:()=>dF,function:()=>k5,fromJSONSchema:()=>n5,formatError:()=>c1,float64:()=>U5,float32:()=>v5,flattenError:()=>m1,file:()=>O5,exactOptional:()=>fJ,enum:()=>P$,endsWith:()=>r6,encodeAsync:()=>VJ,encode:()=>YJ,emoji:()=>CY,email:()=>qY,e164:()=>pY,discriminatedUnion:()=>Av,describe:()=>E5,decodeAsync:()=>BJ,decode:()=>LJ,date:()=>L5,custom:()=>d0,cuid2:()=>xY,cuid:()=>nY,core:()=>g4,config:()=>L$,coerce:()=>Q9,codec:()=>M5,clone:()=>R$,cidrv6:()=>cY,cidrv4:()=>mY,check:()=>T5,catch:()=>tJ,boolean:()=>V$,bigint:()=>X5,base64url:()=>tY,base64:()=>dY,array:()=>l,any:()=>W5,_function:()=>k5,_default:()=>lJ,_ZodString:()=>M0,ZodXor:()=>SJ,ZodXID:()=>u0,ZodVoid:()=>bJ,ZodUnknown:()=>PJ,ZodUnion:()=>Zv,ZodUndefined:()=>OJ,ZodUUID:()=>j4,ZodURL:()=>Vv,ZodULID:()=>E0,ZodType:()=>x,ZodTuple:()=>EJ,ZodTransform:()=>nJ,ZodTemplateLiteral:()=>sJ,ZodSymbol:()=>FJ,ZodSuccess:()=>cJ,ZodStringFormat:()=>v$,ZodString:()=>v1,ZodSet:()=>RJ,ZodRecord:()=>s6,ZodRealError:()=>h$,ZodReadonly:()=>aJ,ZodPromise:()=>U9,ZodPreprocess:()=>oJ,ZodPrefault:()=>hJ,ZodPipe:()=>Hv,ZodOptional:()=>m0,ZodObject:()=>Nv,ZodNumberFormat:()=>F6,ZodNumber:()=>D1,ZodNullable:()=>_J,ZodNull:()=>jJ,ZodNonOptional:()=>c0,ZodNever:()=>MJ,ZodNanoID:()=>S0,ZodNaN:()=>pJ,ZodMap:()=>gJ,ZodMAC:()=>HJ,ZodLiteral:()=>CJ,ZodLazy:()=>$9,ZodKSUID:()=>g0,ZodJWT:()=>y0,ZodIssueCode:()=>mF,ZodIntersection:()=>TJ,ZodISOTime:()=>O0,ZodISODuration:()=>j0,ZodISODateTime:()=>H0,ZodISODate:()=>F0,ZodIPv6:()=>C0,ZodIPv4:()=>R0,ZodGUID:()=>Wv,ZodFunction:()=>D9,ZodFirstPartyTypeKind:()=>G9,ZodFile:()=>iJ,ZodExactOptional:()=>xJ,ZodError:()=>hF,ZodEnum:()=>$1,ZodEmoji:()=>q0,ZodEmail:()=>b0,ZodE164:()=>_0,ZodDiscriminatedUnion:()=>kJ,ZodDefault:()=>yJ,ZodDate:()=>Kv,ZodCustomStringFormat:()=>U1,ZodCustom:()=>Ov,ZodCodec:()=>Fv,ZodCatch:()=>dJ,ZodCUID2:()=>T0,ZodCUID:()=>k0,ZodCIDRv6:()=>n0,ZodCIDRv4:()=>i0,ZodBoolean:()=>I1,ZodBigIntFormat:()=>l0,ZodBigInt:()=>X1,ZodBase64URL:()=>f0,ZodBase64:()=>x0,ZodArray:()=>qJ,ZodAny:()=>wJ,TimePrecision:()=>i8,NEVER:()=>ZI,$output:()=>T8,$input:()=>E8,$brand:()=>AI});var g4={};T4(g4,{version:()=>PX,util:()=>w,treeifyError:()=>kI,toJSONSchema:()=>Z0,toDotPath:()=>xW,safeParseAsync:()=>p1,safeParse:()=>C6,safeEncodeAsync:()=>mW,safeEncode:()=>hW,safeDecodeAsync:()=>cW,safeDecode:()=>rW,registry:()=>lU,regexes:()=>a$,process:()=>e,prettifyError:()=>TI,parseAsync:()=>t1,parse:()=>d1,meta:()=>NQ,locales:()=>Gv,isValidJWT:()=>BY,isValidBase64URL:()=>VY,isValidBase64:()=>cX,initializeContext:()=>d4,globalRegistry:()=>j$,globalConfig:()=>L6,formatError:()=>c1,flattenError:()=>m1,finalize:()=>p4,extractDefs:()=>t4,encodeAsync:()=>yW,encode:()=>fW,describe:()=>KQ,decodeAsync:()=>lW,decode:()=>_W,createToJSONSchemaMethod:()=>AQ,createStandardJSONSchemaMethod:()=>e6,config:()=>L$,clone:()=>R$,_xor:()=>HF,_xid:()=>sU,_void:()=>GQ,_uuidv7:()=>dU,_uuidv6:()=>cU,_uuidv4:()=>mU,_uuid:()=>rU,_url:()=>Jv,_uppercase:()=>y6,_unknown:()=>IQ,_union:()=>AF,_undefined:()=>vQ,_ulid:()=>eU,_uint64:()=>s8,_uint32:()=>d8,_tuple:()=>jF,_trim:()=>d6,_transform:()=>kF,_toUpperCase:()=>p6,_toLowerCase:()=>t6,_templateLiteral:()=>xF,_symbol:()=>$Q,_superRefine:()=>BQ,_success:()=>RF,_stringbool:()=>ZQ,_stringFormat:()=>a6,_string:()=>g8,_startsWith:()=>h6,_slugify:()=>o6,_size:()=>Z6,_set:()=>MF,_safeParseAsync:()=>i6,_safeParse:()=>R6,_safeEncodeAsync:()=>qU,_safeEncode:()=>MU,_safeDecodeAsync:()=>SU,_safeDecode:()=>bU,_regex:()=>f6,_refine:()=>VQ,_record:()=>wF,_readonly:()=>nF,_property:()=>V0,_promise:()=>_F,_positive:()=>z0,_pipe:()=>iF,_parseAsync:()=>g6,_parse:()=>u6,_overwrite:()=>J4,_optional:()=>TF,_number:()=>y8,_nullable:()=>EF,_null:()=>UQ,_normalize:()=>c6,_nonpositive:()=>Y0,_nonoptional:()=>gF,_nonnegative:()=>L0,_never:()=>XQ,_negative:()=>W0,_nativeEnum:()=>qF,_nanoid:()=>pU,_nan:()=>zQ,_multipleOf:()=>m4,_minSize:()=>O4,_minLength:()=>u4,_min:()=>i$,_mime:()=>m6,_maxSize:()=>c4,_maxLength:()=>A6,_max:()=>e$,_map:()=>PF,_mac:()=>C8,_lte:()=>e$,_lt:()=>H4,_lowercase:()=>_6,_literal:()=>SF,_length:()=>H6,_lazy:()=>fF,_ksuid:()=>$0,_jwt:()=>J0,_isoTime:()=>f8,_isoDuration:()=>_8,_isoDateTime:()=>n8,_isoDate:()=>x8,_ipv6:()=>U0,_ipv4:()=>v0,_intersection:()=>OF,_int64:()=>e8,_int32:()=>c8,_int:()=>h8,_includes:()=>l6,_guid:()=>Qv,_gte:()=>i$,_gt:()=>F4,_float64:()=>m8,_float32:()=>r8,_file:()=>YQ,_enum:()=>bF,_endsWith:()=>r6,_encodeAsync:()=>wU,_encode:()=>OU,_emoji:()=>tU,_email:()=>hU,_e164:()=>Q0,_discriminatedUnion:()=>FF,_default:()=>uF,_decodeAsync:()=>PU,_decode:()=>jU,_date:()=>QQ,_custom:()=>LQ,_cuid2:()=>aU,_cuid:()=>oU,_coercedString:()=>R8,_coercedNumber:()=>l8,_coercedDate:()=>JQ,_coercedBoolean:()=>p8,_coercedBigint:()=>a8,_cidrv6:()=>I0,_cidrv4:()=>D0,_check:()=>wY,_catch:()=>CF,_boolean:()=>t8,_bigint:()=>o8,_base64url:()=>G0,_base64:()=>X0,_array:()=>WQ,_any:()=>DQ,TimePrecision:()=>i8,NEVER:()=>ZI,JSONSchemaGenerator:()=>UJ,JSONSchema:()=>PY,Doc:()=>uU,$output:()=>T8,$input:()=>E8,$constructor:()=>K,$brand:()=>AI,$ZodXor:()=>WG,$ZodXID:()=>CX,$ZodVoid:()=>GG,$ZodUnknown:()=>IG,$ZodUnion:()=>$v,$ZodUndefined:()=>vG,$ZodUUID:()=>qX,$ZodURL:()=>kX,$ZodULID:()=>RX,$ZodType:()=>i,$ZodTuple:()=>fU,$ZodTransform:()=>HG,$ZodTemplateLiteral:()=>TG,$ZodSymbol:()=>$G,$ZodSuccess:()=>MG,$ZodStringFormat:()=>$$,$ZodString:()=>N6,$ZodSet:()=>KG,$ZodRegistry:()=>u8,$ZodRecord:()=>VG,$ZodRealError:()=>l$,$ZodReadonly:()=>kG,$ZodPromise:()=>uG,$ZodPreprocess:()=>SG,$ZodPrefault:()=>wG,$ZodPipe:()=>yU,$ZodOptional:()=>_U,$ZodObjectJIT:()=>zG,$ZodObject:()=>ZY,$ZodNumberFormat:()=>eX,$ZodNumber:()=>nU,$ZodNullable:()=>OG,$ZodNull:()=>UG,$ZodNonOptional:()=>PG,$ZodNever:()=>XG,$ZodNanoID:()=>EX,$ZodNaN:()=>qG,$ZodMap:()=>BG,$ZodMAC:()=>hX,$ZodLiteral:()=>ZG,$ZodLazy:()=>gG,$ZodKSUID:()=>iX,$ZodJWT:()=>oX,$ZodIntersection:()=>LG,$ZodISOTime:()=>fX,$ZodISODuration:()=>_X,$ZodISODateTime:()=>nX,$ZodISODate:()=>xX,$ZodIPv6:()=>lX,$ZodIPv4:()=>yX,$ZodGUID:()=>bX,$ZodFunction:()=>EG,$ZodFile:()=>AG,$ZodExactOptional:()=>FG,$ZodError:()=>r1,$ZodEnum:()=>NG,$ZodEncodeError:()=>V6,$ZodEmoji:()=>TX,$ZodEmail:()=>SX,$ZodE164:()=>pX,$ZodDiscriminatedUnion:()=>YG,$ZodDefault:()=>jG,$ZodDate:()=>QG,$ZodCustomStringFormat:()=>aX,$ZodCustom:()=>RG,$ZodCodec:()=>vv,$ZodCheckUpperCase:()=>ZX,$ZodCheckStringFormat:()=>n6,$ZodCheckStartsWith:()=>HX,$ZodCheckSizeEquals:()=>YX,$ZodCheckRegex:()=>KX,$ZodCheckProperty:()=>OX,$ZodCheckOverwrite:()=>wX,$ZodCheckNumberFormat:()=>QX,$ZodCheckMultipleOf:()=>GX,$ZodCheckMinSize:()=>WX,$ZodCheckMinLength:()=>VX,$ZodCheckMimeType:()=>jX,$ZodCheckMaxSize:()=>zX,$ZodCheckMaxLength:()=>LX,$ZodCheckLowerCase:()=>NX,$ZodCheckLessThan:()=>TU,$ZodCheckLengthEquals:()=>BX,$ZodCheckIncludes:()=>AX,$ZodCheckGreaterThan:()=>EU,$ZodCheckEndsWith:()=>FX,$ZodCheckBigIntFormat:()=>JX,$ZodCheck:()=>X$,$ZodCatch:()=>bG,$ZodCUID2:()=>gX,$ZodCUID:()=>uX,$ZodCIDRv6:()=>mX,$ZodCIDRv4:()=>rX,$ZodBoolean:()=>s1,$ZodBigIntFormat:()=>sX,$ZodBigInt:()=>xU,$ZodBase64URL:()=>tX,$ZodBase64:()=>dX,$ZodAsyncError:()=>A4,$ZodArray:()=>JG,$ZodAny:()=>DG});var uW,ZI=Object.freeze({status:"aborted"});function K($,v,D){function I(Q,J){if(!Q._zod)Object.defineProperty(Q,"_zod",{value:{def:J,constr:G,traits:new Set},enumerable:!1});if(Q._zod.traits.has($))return;Q._zod.traits.add($),v(Q,J);let z=G.prototype,W=Object.keys(z);for(let Y=0;Y<W.length;Y++){let L=W[Y];if(!(L in Q))Q[L]=z[L].bind(Q)}}let U=D?.Parent??Object;class X extends U{}Object.defineProperty(X,"name",{value:$});function G(Q){var J;let z=D?.Parent?new X:this;I(z,Q),(J=z._zod).deferred??(J.deferred=[]);for(let W of z._zod.deferred)W();return z}return Object.defineProperty(G,"init",{value:I}),Object.defineProperty(G,Symbol.hasInstance,{value:(Q)=>{if(D?.Parent&&Q instanceof D.Parent)return!0;return Q?._zod?.traits?.has($)}}),Object.defineProperty(G,"name",{value:$}),G}var AI=Symbol("zod_brand");class A4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class V6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(uW=globalThis).__zod_globalConfig??(uW.__zod_globalConfig={});var L6=globalThis.__zod_globalConfig;function L$($){if($)Object.assign(L6,$);return L6}var w={};T4(w,{unwrapMessage:()=>x1,uint8ArrayToHex:()=>mA,uint8ArrayToBase64url:()=>hA,uint8ArrayToBase64:()=>CW,stringifyPrimitive:()=>O,slugify:()=>OI,shallowClone:()=>wI,safeExtend:()=>nA,required:()=>_A,randomString:()=>TA,propertyKeyTypes:()=>y1,promiseAllObject:()=>kA,primitiveTypes:()=>PI,prefixIssues:()=>y$,pick:()=>RA,partial:()=>fA,parsedType:()=>j,optionalKeys:()=>MI,omit:()=>CA,objectClone:()=>bA,numKeys:()=>EA,nullish:()=>y4,normalizeParams:()=>P,mergeDefs:()=>E4,merge:()=>xA,jsonStringifyReplacer:()=>k6,joinValues:()=>Z,issue:()=>E6,isPlainObject:()=>h4,isObject:()=>B6,hexToUint8Array:()=>rA,getSizableOrigin:()=>l1,getParsedType:()=>uA,getLengthableOrigin:()=>h1,getEnumValues:()=>f1,getElementAtPath:()=>SA,floatSafeRemainder:()=>FI,finalizeIssue:()=>C$,extend:()=>iA,explicitlyAborted:()=>SI,escapeRegex:()=>v4,esc:()=>HU,defineLazy:()=>y,createTransparentProxy:()=>gA,cloneDef:()=>qA,clone:()=>R$,cleanRegex:()=>_1,cleanEnum:()=>yA,captureStackTrace:()=>FU,cached:()=>T6,base64urlToUint8Array:()=>lA,base64ToUint8Array:()=>RW,assignProp:()=>l4,assertNotEqual:()=>jA,assertNever:()=>PA,assertIs:()=>wA,assertEqual:()=>OA,assert:()=>MA,allowsEval:()=>jI,aborted:()=>r4,NUMBER_FORMAT_RANGES:()=>bI,Class:()=>iW,BIGINT_FORMAT_RANGES:()=>qI});function OA($){return $}function jA($){return $}function wA($){}function PA($){throw Error("Unexpected value in exhaustive check")}function MA($){}function f1($){let v=Object.values($).filter((I)=>typeof I==="number");return Object.entries($).filter(([I,U])=>v.indexOf(+I)===-1).map(([I,U])=>U)}function Z($,v="|"){return $.map((D)=>O(D)).join(v)}function k6($,v){if(typeof v==="bigint")return v.toString();return v}function T6($){return{get value(){{let D=$();return Object.defineProperty(this,"value",{value:D}),D}throw Error("cached value already set")}}}function y4($){return $===null||$===void 0}function _1($){let v=$.startsWith("^")?1:0,D=$.endsWith("$")?$.length-1:$.length;return $.slice(v,D)}function FI($,v){let D=$/v,I=Math.round(D),U=Number.EPSILON*Math.max(Math.abs(D),1);if(Math.abs(D-I)<U)return 0;return D-I}var gW=Symbol("evaluating");function y($,v,D){let I=void 0;Object.defineProperty($,v,{get(){if(I===gW)return;if(I===void 0)I=gW,I=D();return I},set(U){Object.defineProperty($,v,{value:U})},configurable:!0})}function bA($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function l4($,v,D){Object.defineProperty($,v,{value:D,writable:!0,enumerable:!0,configurable:!0})}function E4(...$){let v={};for(let D of $){let I=Object.getOwnPropertyDescriptors(D);Object.assign(v,I)}return Object.defineProperties({},v)}function qA($){return E4($._zod.def)}function SA($,v){if(!v)return $;return v.reduce((D,I)=>D?.[I],$)}function kA($){let v=Object.keys($),D=v.map((I)=>$[I]);return Promise.all(D).then((I)=>{let U={};for(let X=0;X<v.length;X++)U[v[X]]=I[X];return U})}function TA($=10){let D="";for(let I=0;I<$;I++)D+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return D}function HU($){return JSON.stringify($)}function OI($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var FU="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function B6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var jI=T6(()=>{if(L6.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function h4($){if(B6($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let D=v.prototype;if(B6(D)===!1)return!1;if(Object.prototype.hasOwnProperty.call(D,"isPrototypeOf")===!1)return!1;return!0}function wI($){if(h4($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function EA($){let v=0;for(let D in $)if(Object.prototype.hasOwnProperty.call($,D))v++;return v}var uA=($)=>{let v=typeof $;switch(v){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<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},y1=new Set(["string","number","symbol"]),PI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function v4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R$($,v,D){let I=new $._zod.constr(v??$._zod.def);if(!v||D?.parent)I._zod.parent=$;return I}function P($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function gA($){let v;return new Proxy({},{get(D,I,U){return v??(v=$()),Reflect.get(v,I,U)},set(D,I,U,X){return v??(v=$()),Reflect.set(v,I,U,X)},has(D,I){return v??(v=$()),Reflect.has(v,I)},deleteProperty(D,I){return v??(v=$()),Reflect.deleteProperty(v,I)},ownKeys(D){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(D,I){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,I)},defineProperty(D,I,U){return v??(v=$()),Reflect.defineProperty(v,I,U)}})}function O($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function MI($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var bI={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]},qI={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function RA($,v){let D=$._zod.def,I=D.checks;if(I&&I.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let X=E4($._zod.def,{get shape(){let G={};for(let Q in v){if(!(Q in D.shape))throw Error(`Unrecognized key: "${Q}"`);if(!v[Q])continue;G[Q]=D.shape[Q]}return l4(this,"shape",G),G},checks:[]});return R$($,X)}function CA($,v){let D=$._zod.def,I=D.checks;if(I&&I.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let X=E4($._zod.def,{get shape(){let G={...$._zod.def.shape};for(let Q in v){if(!(Q in D.shape))throw Error(`Unrecognized key: "${Q}"`);if(!v[Q])continue;delete G[Q]}return l4(this,"shape",G),G},checks:[]});return R$($,X)}function iA($,v){if(!h4(v))throw Error("Invalid input to extend: expected a plain object");let D=$._zod.def.checks;if(D&&D.length>0){let X=$._zod.def.shape;for(let G in v)if(Object.getOwnPropertyDescriptor(X,G)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let U=E4($._zod.def,{get shape(){let X={...$._zod.def.shape,...v};return l4(this,"shape",X),X}});return R$($,U)}function nA($,v){if(!h4(v))throw Error("Invalid input to safeExtend: expected a plain object");let D=E4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v};return l4(this,"shape",I),I}});return R$($,D)}function xA($,v){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let D=E4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v._zod.def.shape};return l4(this,"shape",I),I},get catchall(){return v._zod.def.catchall},checks:v._zod.def.checks??[]});return R$($,D)}function fA($,v,D){let U=v._zod.def.checks;if(U&&U.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let G=E4(v._zod.def,{get shape(){let Q=v._zod.def.shape,J={...Q};if(D)for(let z in D){if(!(z in Q))throw Error(`Unrecognized key: "${z}"`);if(!D[z])continue;J[z]=$?new $({type:"optional",innerType:Q[z]}):Q[z]}else for(let z in Q)J[z]=$?new $({type:"optional",innerType:Q[z]}):Q[z];return l4(this,"shape",J),J},checks:[]});return R$(v,G)}function _A($,v,D){let I=E4(v._zod.def,{get shape(){let U=v._zod.def.shape,X={...U};if(D)for(let G in D){if(!(G in X))throw Error(`Unrecognized key: "${G}"`);if(!D[G])continue;X[G]=new $({type:"nonoptional",innerType:U[G]})}else for(let G in U)X[G]=new $({type:"nonoptional",innerType:U[G]});return l4(this,"shape",X),X}});return R$(v,I)}function r4($,v=0){if($.aborted===!0)return!0;for(let D=v;D<$.issues.length;D++)if($.issues[D]?.continue!==!0)return!0;return!1}function SI($,v=0){if($.aborted===!0)return!0;for(let D=v;D<$.issues.length;D++)if($.issues[D]?.continue===!1)return!0;return!1}function y$($,v){return v.map((D)=>{var I;return(I=D).path??(I.path=[]),D.path.unshift($),D})}function x1($){return typeof $==="string"?$:$?.message}function C$($,v,D){let I=$.message?$.message:x1($.inst?._zod.def?.error?.($))??x1(v?.error?.($))??x1(D.customError?.($))??x1(D.localeError?.($))??"Invalid input",{inst:U,continue:X,input:G,...Q}=$;if(Q.path??(Q.path=[]),Q.message=I,v?.reportInput)Q.input=G;return Q}function l1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function h1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function j($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let D=$;if(D&&Object.getPrototypeOf(D)!==Object.prototype&&"constructor"in D&&D.constructor)return D.constructor.name}}return v}function E6(...$){let[v,D,I]=$;if(typeof v==="string")return{message:v,code:"custom",input:D,inst:I};return{...v}}function yA($){return Object.entries($).filter(([v,D])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function RW($){let v=atob($),D=new Uint8Array(v.length);for(let I=0;I<v.length;I++)D[I]=v.charCodeAt(I);return D}function CW($){let v="";for(let D=0;D<$.length;D++)v+=String.fromCharCode($[D]);return btoa(v)}function lA($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),D="=".repeat((4-v.length%4)%4);return RW(v+D)}function hA($){return CW($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function rA($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let D=new Uint8Array(v.length/2);for(let I=0;I<v.length;I+=2)D[I/2]=Number.parseInt(v.slice(I,I+2),16);return D}function mA($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class iW{constructor(...$){}}var nW=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,k6,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},r1=K("$ZodError",nW),l$=K("$ZodError",nW,{Parent:Error});function m1($,v=(D)=>D.message){let D={},I=[];for(let U of $.issues)if(U.path.length>0)D[U.path[0]]=D[U.path[0]]||[],D[U.path[0]].push(v(U));else I.push(v(U));return{formErrors:I,fieldErrors:D}}function c1($,v=(D)=>D.message){let D={_errors:[]},I=(U,X=[])=>{for(let G of U.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((Q)=>I({issues:Q},[...X,...G.path]));else if(G.code==="invalid_key")I({issues:G.issues},[...X,...G.path]);else if(G.code==="invalid_element")I({issues:G.issues},[...X,...G.path]);else{let Q=[...X,...G.path];if(Q.length===0)D._errors.push(v(G));else{let J=D,z=0;while(z<Q.length){let W=Q[z];if(z!==Q.length-1)J[W]=J[W]||{_errors:[]};else J[W]=J[W]||{_errors:[]},J[W]._errors.push(v(G));J=J[W],z++}}}};return I($),D}function kI($,v=(D)=>D.message){let D={errors:[]},I=(U,X=[])=>{var G,Q;for(let J of U.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((z)=>I({issues:z},[...X,...J.path]));else if(J.code==="invalid_key")I({issues:J.issues},[...X,...J.path]);else if(J.code==="invalid_element")I({issues:J.issues},[...X,...J.path]);else{let z=[...X,...J.path];if(z.length===0){D.errors.push(v(J));continue}let W=D,Y=0;while(Y<z.length){let L=z[Y],V=Y===z.length-1;if(typeof L==="string")W.properties??(W.properties={}),(G=W.properties)[L]??(G[L]={errors:[]}),W=W.properties[L];else W.items??(W.items=[]),(Q=W.items)[L]??(Q[L]={errors:[]}),W=W.items[L];if(V)W.errors.push(v(J));Y++}}};return I($),D}function xW($){let v=[],D=$.map((I)=>typeof I==="object"?I.key:I);for(let I of D)if(typeof I==="number")v.push(`[${I}]`);else if(typeof I==="symbol")v.push(`[${JSON.stringify(String(I))}]`);else if(/[^\w$]/.test(I))v.push(`[${JSON.stringify(I)}]`);else{if(v.length)v.push(".");v.push(I)}return v.join("")}function TI($){let v=[],D=[...$.issues].sort((I,U)=>(I.path??[]).length-(U.path??[]).length);for(let I of D)if(v.push(`✖ ${I.message}`),I.path?.length)v.push(` → at ${xW(I.path)}`);return v.join(`
|
|
11
|
-
`)}var u6=($)=>(v,D,I,U)=>{let X=I?{...I,async:!1}:{async:!1},G=v._zod.run({value:D,issues:[]},X);if(G instanceof Promise)throw new A4;if(G.issues.length){let Q=new(U?.Err??$)(G.issues.map((J)=>C$(J,X,L$())));throw FU(Q,U?.callee),Q}return G.value},d1=u6(l$),g6=($)=>async(v,D,I,U)=>{let X=I?{...I,async:!0}:{async:!0},G=v._zod.run({value:D,issues:[]},X);if(G instanceof Promise)G=await G;if(G.issues.length){let Q=new(U?.Err??$)(G.issues.map((J)=>C$(J,X,L$())));throw FU(Q,U?.callee),Q}return G.value},t1=g6(l$),R6=($)=>(v,D,I)=>{let U=I?{...I,async:!1}:{async:!1},X=v._zod.run({value:D,issues:[]},U);if(X instanceof Promise)throw new A4;return X.issues.length?{success:!1,error:new($??r1)(X.issues.map((G)=>C$(G,U,L$())))}:{success:!0,data:X.value}},C6=R6(l$),i6=($)=>async(v,D,I)=>{let U=I?{...I,async:!0}:{async:!0},X=v._zod.run({value:D,issues:[]},U);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((G)=>C$(G,U,L$())))}:{success:!0,data:X.value}},p1=i6(l$),OU=($)=>(v,D,I)=>{let U=I?{...I,direction:"backward"}:{direction:"backward"};return u6($)(v,D,U)},fW=OU(l$),jU=($)=>(v,D,I)=>{return u6($)(v,D,I)},_W=jU(l$),wU=($)=>async(v,D,I)=>{let U=I?{...I,direction:"backward"}:{direction:"backward"};return g6($)(v,D,U)},yW=wU(l$),PU=($)=>async(v,D,I)=>{return g6($)(v,D,I)},lW=PU(l$),MU=($)=>(v,D,I)=>{let U=I?{...I,direction:"backward"}:{direction:"backward"};return R6($)(v,D,U)},hW=MU(l$),bU=($)=>(v,D,I)=>{return R6($)(v,D,I)},rW=bU(l$),qU=($)=>async(v,D,I)=>{let U=I?{...I,direction:"backward"}:{direction:"backward"};return i6($)(v,D,U)},mW=qU(l$),SU=($)=>async(v,D,I)=>{return i6($)(v,D,I)},cW=SU(l$);var a$={};T4(a$,{xid:()=>RI,uuid7:()=>oA,uuid6:()=>pA,uuid4:()=>tA,uuid:()=>K6,uppercase:()=>XX,unicodeEmail:()=>dW,undefined:()=>DX,ulid:()=>gI,time:()=>oI,string:()=>eI,sha512_hex:()=>ZH,sha512_base64url:()=>HH,sha512_base64:()=>AH,sha384_hex:()=>BH,sha384_base64url:()=>NH,sha384_base64:()=>KH,sha256_hex:()=>YH,sha256_base64url:()=>VH,sha256_base64:()=>LH,sha1_hex:()=>JH,sha1_base64url:()=>WH,sha1_base64:()=>zH,rfc5322Email:()=>eA,number:()=>o1,null:()=>UX,nanoid:()=>iI,md5_hex:()=>XH,md5_base64url:()=>QH,md5_base64:()=>GH,mac:()=>hI,lowercase:()=>IX,ksuid:()=>CI,ipv6:()=>lI,ipv4:()=>yI,integer:()=>$X,idnEmail:()=>sA,httpProtocol:()=>dI,html5Email:()=>aA,hostname:()=>UH,hex:()=>IH,guid:()=>xI,extendedDuration:()=>dA,emoji:()=>_I,email:()=>fI,e164:()=>tI,duration:()=>nI,domain:()=>DH,datetime:()=>aI,date:()=>pI,cuid2:()=>uI,cuid:()=>EI,cidrv6:()=>mI,cidrv4:()=>rI,browserEmail:()=>$H,boolean:()=>vX,bigint:()=>sI,base64url:()=>kU,base64:()=>cI});var EI=/^[cC][0-9a-z]{6,}$/,uI=/^[0-9a-z]+$/,gI=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RI=/^[0-9a-vA-V]{20}$/,CI=/^[A-Za-z0-9]{27}$/,iI=/^[a-zA-Z0-9_-]{21}$/,nI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dA=/^[-+]?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)?)??$/,xI=/^([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})$/,K6=($)=>{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})$`)},tA=K6(4),pA=K6(6),oA=K6(7),fI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aA=/^[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])?)*$/,eA=/^(([^<>()\[\]\\.,;:\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,}))$/,dW=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,sA=dW,$H=/^[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])?)*$/,vH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _I(){return new RegExp(vH,"u")}var yI=/^(?:(?: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])$/,lI=/^(([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}|:))$/,hI=($)=>{let v=v4($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},rI=/^((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])$/,mI=/^(([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])$/,cI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kU=/^[A-Za-z0-9_-]*$/,UH=/^(?=.{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])?)*\.?$/,DH=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,dI=/^https?$/,tI=/^\+[1-9]\d{6,14}$/,tW="(?:(?:\\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])))",pI=new RegExp(`^${tW}$`);function pW($){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 oI($){return new RegExp(`^${pW($)}$`)}function aI($){let v=pW({precision:$.precision}),D=["Z"];if($.local)D.push("");if($.offset)D.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let I=`${v}(?:${D.join("|")})`;return new RegExp(`^${tW}T(?:${I})$`)}var eI=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},sI=/^-?\d+n?$/,$X=/^-?\d+$/,o1=/^-?\d+(?:\.\d+)?$/,vX=/^(?:true|false)$/i,UX=/^null$/i;var DX=/^undefined$/i;var IX=/^[^A-Z]*$/,XX=/^[^a-z]*$/,IH=/^[0-9a-fA-F]*$/;function a1($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function e1($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var XH=/^[0-9a-fA-F]{32}$/,GH=a1(22,"=="),QH=e1(22),JH=/^[0-9a-fA-F]{40}$/,zH=a1(27,"="),WH=e1(27),YH=/^[0-9a-fA-F]{64}$/,LH=a1(43,"="),VH=e1(43),BH=/^[0-9a-fA-F]{96}$/,KH=a1(64,""),NH=e1(64),ZH=/^[0-9a-fA-F]{128}$/,AH=a1(86,"=="),HH=e1(86);var X$=K("$ZodCheck",($,v)=>{var D;$._zod??($._zod={}),$._zod.def=v,(D=$._zod).onattach??(D.onattach=[])}),aW={number:"number",bigint:"bigint",object:"date"},TU=K("$ZodCheckLessThan",($,v)=>{X$.init($,v);let D=aW[typeof v.value];$._zod.onattach.push((I)=>{let U=I._zod.bag,X=(v.inclusive?U.maximum:U.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<X)if(v.inclusive)U.maximum=v.value;else U.exclusiveMaximum=v.value}),$._zod.check=(I)=>{if(v.inclusive?I.value<=v.value:I.value<v.value)return;I.issues.push({origin:D,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:I.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),EU=K("$ZodCheckGreaterThan",($,v)=>{X$.init($,v);let D=aW[typeof v.value];$._zod.onattach.push((I)=>{let U=I._zod.bag,X=(v.inclusive?U.minimum:U.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>X)if(v.inclusive)U.minimum=v.value;else U.exclusiveMinimum=v.value}),$._zod.check=(I)=>{if(v.inclusive?I.value>=v.value:I.value>v.value)return;I.issues.push({origin:D,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:I.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),GX=K("$ZodCheckMultipleOf",($,v)=>{X$.init($,v),$._zod.onattach.push((D)=>{var I;(I=D._zod.bag).multipleOf??(I.multipleOf=v.value)}),$._zod.check=(D)=>{if(typeof D.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof D.value==="bigint"?D.value%v.value===BigInt(0):FI(D.value,v.value)===0)return;D.issues.push({origin:typeof D.value,code:"not_multiple_of",divisor:v.value,input:D.value,inst:$,continue:!v.abort})}}),QX=K("$ZodCheckNumberFormat",($,v)=>{X$.init($,v),v.format=v.format||"float64";let D=v.format?.includes("int"),I=D?"int":"number",[U,X]=bI[v.format];$._zod.onattach.push((G)=>{let Q=G._zod.bag;if(Q.format=v.format,Q.minimum=U,Q.maximum=X,D)Q.pattern=$X}),$._zod.check=(G)=>{let Q=G.value;if(D){if(!Number.isInteger(Q)){G.issues.push({expected:I,format:v.format,code:"invalid_type",continue:!1,input:Q,inst:$});return}if(!Number.isSafeInteger(Q)){if(Q>0)G.issues.push({input:Q,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:I,inclusive:!0,continue:!v.abort});else G.issues.push({input:Q,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:I,inclusive:!0,continue:!v.abort});return}}if(Q<U)G.issues.push({origin:"number",input:Q,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(Q>X)G.issues.push({origin:"number",input:Q,code:"too_big",maximum:X,inclusive:!0,inst:$,continue:!v.abort})}}),JX=K("$ZodCheckBigIntFormat",($,v)=>{X$.init($,v);let[D,I]=qI[v.format];$._zod.onattach.push((U)=>{let X=U._zod.bag;X.format=v.format,X.minimum=D,X.maximum=I}),$._zod.check=(U)=>{let X=U.value;if(X<D)U.issues.push({origin:"bigint",input:X,code:"too_small",minimum:D,inclusive:!0,inst:$,continue:!v.abort});if(X>I)U.issues.push({origin:"bigint",input:X,code:"too_big",maximum:I,inclusive:!0,inst:$,continue:!v.abort})}}),zX=K("$ZodCheckMaxSize",($,v)=>{var D;X$.init($,v),(D=$._zod.def).when??(D.when=(I)=>{let U=I.value;return!y4(U)&&U.size!==void 0}),$._zod.onattach.push((I)=>{let U=I._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<U)I._zod.bag.maximum=v.maximum}),$._zod.check=(I)=>{let U=I.value;if(U.size<=v.maximum)return;I.issues.push({origin:l1(U),code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),WX=K("$ZodCheckMinSize",($,v)=>{var D;X$.init($,v),(D=$._zod.def).when??(D.when=(I)=>{let U=I.value;return!y4(U)&&U.size!==void 0}),$._zod.onattach.push((I)=>{let U=I._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>U)I._zod.bag.minimum=v.minimum}),$._zod.check=(I)=>{let U=I.value;if(U.size>=v.minimum)return;I.issues.push({origin:l1(U),code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),YX=K("$ZodCheckSizeEquals",($,v)=>{var D;X$.init($,v),(D=$._zod.def).when??(D.when=(I)=>{let U=I.value;return!y4(U)&&U.size!==void 0}),$._zod.onattach.push((I)=>{let U=I._zod.bag;U.minimum=v.size,U.maximum=v.size,U.size=v.size}),$._zod.check=(I)=>{let U=I.value,X=U.size;if(X===v.size)return;let G=X>v.size;I.issues.push({origin:l1(U),...G?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:I.value,inst:$,continue:!v.abort})}}),LX=K("$ZodCheckMaxLength",($,v)=>{var D;X$.init($,v),(D=$._zod.def).when??(D.when=(I)=>{let U=I.value;return!y4(U)&&U.length!==void 0}),$._zod.onattach.push((I)=>{let U=I._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<U)I._zod.bag.maximum=v.maximum}),$._zod.check=(I)=>{let U=I.value;if(U.length<=v.maximum)return;let G=h1(U);I.issues.push({origin:G,code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),VX=K("$ZodCheckMinLength",($,v)=>{var D;X$.init($,v),(D=$._zod.def).when??(D.when=(I)=>{let U=I.value;return!y4(U)&&U.length!==void 0}),$._zod.onattach.push((I)=>{let U=I._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>U)I._zod.bag.minimum=v.minimum}),$._zod.check=(I)=>{let U=I.value;if(U.length>=v.minimum)return;let G=h1(U);I.issues.push({origin:G,code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),BX=K("$ZodCheckLengthEquals",($,v)=>{var D;X$.init($,v),(D=$._zod.def).when??(D.when=(I)=>{let U=I.value;return!y4(U)&&U.length!==void 0}),$._zod.onattach.push((I)=>{let U=I._zod.bag;U.minimum=v.length,U.maximum=v.length,U.length=v.length}),$._zod.check=(I)=>{let U=I.value,X=U.length;if(X===v.length)return;let G=h1(U),Q=X>v.length;I.issues.push({origin:G,...Q?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:I.value,inst:$,continue:!v.abort})}}),n6=K("$ZodCheckStringFormat",($,v)=>{var D,I;if(X$.init($,v),$._zod.onattach.push((U)=>{let X=U._zod.bag;if(X.format=v.format,v.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(v.pattern)}),v.pattern)(D=$._zod).check??(D.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:v.format,input:U.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(I=$._zod).check??(I.check=()=>{})}),KX=K("$ZodCheckRegex",($,v)=>{n6.init($,v),$._zod.check=(D)=>{if(v.pattern.lastIndex=0,v.pattern.test(D.value))return;D.issues.push({origin:"string",code:"invalid_format",format:"regex",input:D.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),NX=K("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=IX),n6.init($,v)}),ZX=K("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=XX),n6.init($,v)}),AX=K("$ZodCheckIncludes",($,v)=>{X$.init($,v);let D=v4(v.includes),I=new RegExp(typeof v.position==="number"?`^.{${v.position}}${D}`:D);v.pattern=I,$._zod.onattach.push((U)=>{let X=U._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(I)}),$._zod.check=(U)=>{if(U.value.includes(v.includes,v.position))return;U.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:U.value,inst:$,continue:!v.abort})}}),HX=K("$ZodCheckStartsWith",($,v)=>{X$.init($,v);let D=new RegExp(`^${v4(v.prefix)}.*`);v.pattern??(v.pattern=D),$._zod.onattach.push((I)=>{let U=I._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(D)}),$._zod.check=(I)=>{if(I.value.startsWith(v.prefix))return;I.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:I.value,inst:$,continue:!v.abort})}}),FX=K("$ZodCheckEndsWith",($,v)=>{X$.init($,v);let D=new RegExp(`.*${v4(v.suffix)}$`);v.pattern??(v.pattern=D),$._zod.onattach.push((I)=>{let U=I._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(D)}),$._zod.check=(I)=>{if(I.value.endsWith(v.suffix))return;I.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:I.value,inst:$,continue:!v.abort})}});function oW($,v,D){if($.issues.length)v.issues.push(...y$(D,$.issues))}var OX=K("$ZodCheckProperty",($,v)=>{X$.init($,v),$._zod.check=(D)=>{let I=v.schema._zod.run({value:D.value[v.property],issues:[]},{});if(I instanceof Promise)return I.then((U)=>oW(U,D,v.property));oW(I,D,v.property);return}}),jX=K("$ZodCheckMimeType",($,v)=>{X$.init($,v);let D=new Set(v.mime);$._zod.onattach.push((I)=>{I._zod.bag.mime=v.mime}),$._zod.check=(I)=>{if(D.has(I.value.type))return;I.issues.push({code:"invalid_value",values:v.mime,input:I.value.type,inst:$,continue:!v.abort})}}),wX=K("$ZodCheckOverwrite",($,v)=>{X$.init($,v),$._zod.check=(D)=>{D.value=v.tx(D.value)}});class uU{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 D=$.split(`
|
|
12
|
-
|
|
13
|
-
`))}}var PX={major:4,minor:4,patch:3};var i=K("$ZodType",($,v)=>{var D;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=PX;let I=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))I.unshift($);for(let U of I)for(let X of U._zod.onattach)X($);if(I.length===0)(D=$._zod).deferred??(D.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(G,Q,J)=>{let z=r4(G),W;for(let Y of Q){if(Y._zod.def.when){if(SI(G))continue;if(!Y._zod.def.when(G))continue}else if(z)continue;let L=G.issues.length,V=Y._zod.check(G);if(V instanceof Promise&&J?.async===!1)throw new A4;if(W||V instanceof Promise)W=(W??Promise.resolve()).then(async()=>{if(await V,G.issues.length===L)return;if(!z)z=r4(G,L)});else{if(G.issues.length===L)continue;if(!z)z=r4(G,L)}}if(W)return W.then(()=>{return G});return G},X=(G,Q,J)=>{if(r4(G))return G.aborted=!0,G;let z=U(Q,I,J);if(z instanceof Promise){if(J.async===!1)throw new A4;return z.then((W)=>$._zod.parse(W,J))}return $._zod.parse(z,J)};$._zod.run=(G,Q)=>{if(Q.skipChecks)return $._zod.parse(G,Q);if(Q.direction==="backward"){let z=$._zod.parse({value:G.value,issues:[]},{...Q,skipChecks:!0});if(z instanceof Promise)return z.then((W)=>{return X(W,G,Q)});return X(z,G,Q)}let J=$._zod.parse(G,Q);if(J instanceof Promise){if(Q.async===!1)throw new A4;return J.then((z)=>U(z,I,Q))}return U(J,I,Q)}}y($,"~standard",()=>({validate:(U)=>{try{let X=C6($,U);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return p1($,U).then((G)=>G.success?{value:G.data}:{issues:G.error?.issues})}},vendor:"zod",version:1}))}),N6=K("$ZodString",($,v)=>{i.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??eI($._zod.bag),$._zod.parse=(D,I)=>{if(v.coerce)try{D.value=String(D.value)}catch(U){}if(typeof D.value==="string")return D;return D.issues.push({expected:"string",code:"invalid_type",input:D.value,inst:$}),D}}),$$=K("$ZodStringFormat",($,v)=>{n6.init($,v),N6.init($,v)}),bX=K("$ZodGUID",($,v)=>{v.pattern??(v.pattern=xI),$$.init($,v)}),qX=K("$ZodUUID",($,v)=>{if(v.version){let I={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(I===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=K6(I))}else v.pattern??(v.pattern=K6());$$.init($,v)}),SX=K("$ZodEmail",($,v)=>{v.pattern??(v.pattern=fI),$$.init($,v)}),kX=K("$ZodURL",($,v)=>{$$.init($,v),$._zod.check=(D)=>{try{let I=D.value.trim();if(!v.normalize&&v.protocol?.source===dI.source){if(!/^https?:\/\//i.test(I)){D.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:D.value,inst:$,continue:!v.abort});return}}let U=new URL(I);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(U.hostname))D.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:D.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))D.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:D.value,inst:$,continue:!v.abort})}if(v.normalize)D.value=U.href;else D.value=I;return}catch(I){D.issues.push({code:"invalid_format",format:"url",input:D.value,inst:$,continue:!v.abort})}}}),TX=K("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=_I()),$$.init($,v)}),EX=K("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=iI),$$.init($,v)}),uX=K("$ZodCUID",($,v)=>{v.pattern??(v.pattern=EI),$$.init($,v)}),gX=K("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=uI),$$.init($,v)}),RX=K("$ZodULID",($,v)=>{v.pattern??(v.pattern=gI),$$.init($,v)}),CX=K("$ZodXID",($,v)=>{v.pattern??(v.pattern=RI),$$.init($,v)}),iX=K("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=CI),$$.init($,v)}),nX=K("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=aI(v)),$$.init($,v)}),xX=K("$ZodISODate",($,v)=>{v.pattern??(v.pattern=pI),$$.init($,v)}),fX=K("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=oI(v)),$$.init($,v)}),_X=K("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=nI),$$.init($,v)}),yX=K("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=yI),$$.init($,v),$._zod.bag.format="ipv4"}),lX=K("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=lI),$$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(D)=>{try{new URL(`http://[${D.value}]`)}catch{D.issues.push({code:"invalid_format",format:"ipv6",input:D.value,inst:$,continue:!v.abort})}}}),hX=K("$ZodMAC",($,v)=>{v.pattern??(v.pattern=hI(v.delimiter)),$$.init($,v),$._zod.bag.format="mac"}),rX=K("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=rI),$$.init($,v)}),mX=K("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=mI),$$.init($,v),$._zod.check=(D)=>{let I=D.value.split("/");try{if(I.length!==2)throw Error();let[U,X]=I;if(!X)throw Error();let G=Number(X);if(`${G}`!==X)throw Error();if(G<0||G>128)throw Error();new URL(`http://[${U}]`)}catch{D.issues.push({code:"invalid_format",format:"cidrv6",input:D.value,inst:$,continue:!v.abort})}}});function cX($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var dX=K("$ZodBase64",($,v)=>{v.pattern??(v.pattern=cI),$$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(D)=>{if(cX(D.value))return;D.issues.push({code:"invalid_format",format:"base64",input:D.value,inst:$,continue:!v.abort})}});function VY($){if(!kU.test($))return!1;let v=$.replace(/[-_]/g,(I)=>I==="-"?"+":"/"),D=v.padEnd(Math.ceil(v.length/4)*4,"=");return cX(D)}var tX=K("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=kU),$$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(D)=>{if(VY(D.value))return;D.issues.push({code:"invalid_format",format:"base64url",input:D.value,inst:$,continue:!v.abort})}}),pX=K("$ZodE164",($,v)=>{v.pattern??(v.pattern=tI),$$.init($,v)});function BY($,v=null){try{let D=$.split(".");if(D.length!==3)return!1;let[I]=D;if(!I)return!1;let U=JSON.parse(atob(I));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(v&&(!("alg"in U)||U.alg!==v))return!1;return!0}catch{return!1}}var oX=K("$ZodJWT",($,v)=>{$$.init($,v),$._zod.check=(D)=>{if(BY(D.value,v.alg))return;D.issues.push({code:"invalid_format",format:"jwt",input:D.value,inst:$,continue:!v.abort})}}),aX=K("$ZodCustomStringFormat",($,v)=>{$$.init($,v),$._zod.check=(D)=>{if(v.fn(D.value))return;D.issues.push({code:"invalid_format",format:v.format,input:D.value,inst:$,continue:!v.abort})}}),nU=K("$ZodNumber",($,v)=>{i.init($,v),$._zod.pattern=$._zod.bag.pattern??o1,$._zod.parse=(D,I)=>{if(v.coerce)try{D.value=Number(D.value)}catch(G){}let U=D.value;if(typeof U==="number"&&!Number.isNaN(U)&&Number.isFinite(U))return D;let X=typeof U==="number"?Number.isNaN(U)?"NaN":!Number.isFinite(U)?"Infinity":void 0:void 0;return D.issues.push({expected:"number",code:"invalid_type",input:U,inst:$,...X?{received:X}:{}}),D}}),eX=K("$ZodNumberFormat",($,v)=>{QX.init($,v),nU.init($,v)}),s1=K("$ZodBoolean",($,v)=>{i.init($,v),$._zod.pattern=vX,$._zod.parse=(D,I)=>{if(v.coerce)try{D.value=Boolean(D.value)}catch(X){}let U=D.value;if(typeof U==="boolean")return D;return D.issues.push({expected:"boolean",code:"invalid_type",input:U,inst:$}),D}}),xU=K("$ZodBigInt",($,v)=>{i.init($,v),$._zod.pattern=sI,$._zod.parse=(D,I)=>{if(v.coerce)try{D.value=BigInt(D.value)}catch(U){}if(typeof D.value==="bigint")return D;return D.issues.push({expected:"bigint",code:"invalid_type",input:D.value,inst:$}),D}}),sX=K("$ZodBigIntFormat",($,v)=>{JX.init($,v),xU.init($,v)}),$G=K("$ZodSymbol",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{let U=D.value;if(typeof U==="symbol")return D;return D.issues.push({expected:"symbol",code:"invalid_type",input:U,inst:$}),D}}),vG=K("$ZodUndefined",($,v)=>{i.init($,v),$._zod.pattern=DX,$._zod.values=new Set([void 0]),$._zod.parse=(D,I)=>{let U=D.value;if(typeof U>"u")return D;return D.issues.push({expected:"undefined",code:"invalid_type",input:U,inst:$}),D}}),UG=K("$ZodNull",($,v)=>{i.init($,v),$._zod.pattern=UX,$._zod.values=new Set([null]),$._zod.parse=(D,I)=>{let U=D.value;if(U===null)return D;return D.issues.push({expected:"null",code:"invalid_type",input:U,inst:$}),D}}),DG=K("$ZodAny",($,v)=>{i.init($,v),$._zod.parse=(D)=>D}),IG=K("$ZodUnknown",($,v)=>{i.init($,v),$._zod.parse=(D)=>D}),XG=K("$ZodNever",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{return D.issues.push({expected:"never",code:"invalid_type",input:D.value,inst:$}),D}}),GG=K("$ZodVoid",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{let U=D.value;if(typeof U>"u")return D;return D.issues.push({expected:"void",code:"invalid_type",input:U,inst:$}),D}}),QG=K("$ZodDate",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{if(v.coerce)try{D.value=new Date(D.value)}catch(Q){}let U=D.value,X=U instanceof Date;if(X&&!Number.isNaN(U.getTime()))return D;return D.issues.push({expected:"date",code:"invalid_type",input:U,...X?{received:"Invalid Date"}:{},inst:$}),D}});function sW($,v,D){if($.issues.length)v.issues.push(...y$(D,$.issues));v.value[D]=$.value}var JG=K("$ZodArray",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{let U=D.value;if(!Array.isArray(U))return D.issues.push({expected:"array",code:"invalid_type",input:U,inst:$}),D;D.value=Array(U.length);let X=[];for(let G=0;G<U.length;G++){let Q=U[G],J=v.element._zod.run({value:Q,issues:[]},I);if(J instanceof Promise)X.push(J.then((z)=>sW(z,D,G)));else sW(J,D,G)}if(X.length)return Promise.all(X).then(()=>D);return D}});function iU($,v,D,I,U,X){let G=D in I;if($.issues.length){if(U&&X&&!G)return;v.issues.push(...y$(D,$.issues))}if(!G&&!U){if(!$.issues.length)v.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[D]});return}if($.value===void 0){if(G)v.value[D]=void 0}else v.value[D]=$.value}function KY($){let v=Object.keys($.shape);for(let I of v)if(!$.shape?.[I]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${I}": expected a Zod schema`);let D=MI($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(D)}}function NY($,v,D,I,U,X){let G=[],Q=U.keySet,J=U.catchall._zod,z=J.def.type,W=J.optin==="optional",Y=J.optout==="optional";for(let L in v){if(L==="__proto__")continue;if(Q.has(L))continue;if(z==="never"){G.push(L);continue}let V=J.run({value:v[L],issues:[]},I);if(V instanceof Promise)$.push(V.then((B)=>iU(B,D,L,v,W,Y)));else iU(V,D,L,v,W,Y)}if(G.length)D.issues.push({code:"unrecognized_keys",keys:G,input:v,inst:X});if(!$.length)return D;return Promise.all($).then(()=>{return D})}var ZY=K("$ZodObject",($,v)=>{if(i.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let Q=v.shape;Object.defineProperty(v,"shape",{get:()=>{let J={...Q};return Object.defineProperty(v,"shape",{value:J}),J}})}let I=T6(()=>KY(v));y($._zod,"propValues",()=>{let Q=v.shape,J={};for(let z in Q){let W=Q[z]._zod;if(W.values){J[z]??(J[z]=new Set);for(let Y of W.values)J[z].add(Y)}}return J});let U=B6,X=v.catchall,G;$._zod.parse=(Q,J)=>{G??(G=I.value);let z=Q.value;if(!U(z))return Q.issues.push({expected:"object",code:"invalid_type",input:z,inst:$}),Q;Q.value={};let W=[],Y=G.shape;for(let L of G.keys){let V=Y[L],B=V._zod.optin==="optional",N=V._zod.optout==="optional",A=V._zod.run({value:z[L],issues:[]},J);if(A instanceof Promise)W.push(A.then((F)=>iU(F,Q,L,z,B,N)));else iU(A,Q,L,z,B,N)}if(!X)return W.length?Promise.all(W).then(()=>Q):Q;return NY(W,z,Q,J,I.value,$)}}),zG=K("$ZodObjectJIT",($,v)=>{ZY.init($,v);let D=$._zod.parse,I=T6(()=>KY(v)),U=(L)=>{let V=new uU(["shape","payload","ctx"]),B=I.value,N=(E)=>{let g=HU(E);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};V.write("const input = payload.value;");let A=Object.create(null),F=0;for(let E of B.keys)A[E]=`key_${F++}`;V.write("const newResult = {};");for(let E of B.keys){let g=A[E],k=HU(E),N$=L[E],O$=N$?._zod?.optin==="optional",k4=N$?._zod?.optout==="optional";if(V.write(`const ${g} = ${N(E)};`),O$&&k4)V.write(`
|
|
10
|
+
deps: ${D}}`};var EE={keyword:"dependencies",type:"object",schemaType:"object",error:vN.error,code($){let[v,D]=TE($);sK($,v),$N($,D)}};function TE({schema:$}){let v={},D={};for(let X in $){if(X==="__proto__")continue;let U=Array.isArray($[X])?v:D;U[X]=$[X]}return[v,D]}function sK($,v=$.schema){let{gen:D,data:X,it:U}=$;if(Object.keys(v).length===0)return;let G=D.let("missing");for(let J in v){let Q=v[J];if(Q.length===0)continue;let W=(0,Z0.propertyInData)(D,X,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)D.if(W,()=>{for(let z of Q)(0,Z0.checkReportMissingProp)($,z)});else D.if(N5._`${W} && (${(0,Z0.checkMissingProp)($,Q,G)})`),(0,Z0.reportMissingProp)($,G),D.else()}}vN.validatePropertyDeps=sK;function $N($,v=$.schema){let{gen:D,data:X,keyword:U,it:G}=$,J=D.name("valid");for(let Q in v){if((0,kE.alwaysValidSchema)(G,v[Q]))continue;D.if((0,Z0.propertyInData)(D,X,Q,G.opts.ownProperties),()=>{let W=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(W,J)},()=>D.var(J,!0)),$.ok(J)}}vN.validateSchemaDeps=$N;vN.default=EE});var QN=b((JN)=>{Object.defineProperty(JN,"__esModule",{value:!0});var GN=l(),uE=d(),CE={message:"property name must be valid",params:({params:$})=>GN._`{propertyName: ${$.propertyName}}`},xE={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:CE,code($){let{gen:v,schema:D,data:X,it:U}=$;if((0,uE.alwaysValidSchema)(U,D))return;let G=v.name("valid");v.forIn("key",X,(J)=>{$.setParams({propertyName:J}),$.subschema({keyword:"propertyNames",data:J,dataTypes:["string"],propertyName:J,compositeRule:!0},G),v.if((0,GN.not)(G),()=>{if($.error(!0),!U.allErrors)v.break()})}),$.ok(G)}};JN.default=xE});var Z5=b((WN)=>{Object.defineProperty(WN,"__esModule",{value:!0});var KX=X4(),K4=l(),_E=h4(),NX=d(),iE={message:"must NOT have additional properties",params:({params:$})=>K4._`{additionalProperty: ${$.additionalProperty}}`},yE={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:iE,code($){let{gen:v,schema:D,parentSchema:X,data:U,errsCount:G,it:J}=$;if(!G)throw Error("ajv implementation error");let{allErrors:Q,opts:W}=J;if(J.props=!0,W.removeAdditional!=="all"&&(0,NX.alwaysValidSchema)(J,D))return;let z=(0,KX.allSchemaProperties)(X.properties),Y=(0,KX.allSchemaProperties)(X.patternProperties);I(),$.ok(K4._`${G} === ${_E.default.errors}`);function I(){v.forIn("key",U,(Z)=>{if(!z.length&&!Y.length)L(Z);else v.if(V(Z),()=>L(Z))})}function V(Z){let F;if(z.length>8){let S=(0,NX.schemaRefOrVal)(J,X.properties,"properties");F=(0,KX.isOwnProperty)(v,S,Z)}else if(z.length)F=(0,K4.or)(...z.map((S)=>K4._`${Z} === ${S}`));else F=K4.nil;if(Y.length)F=(0,K4.or)(F,...Y.map((S)=>K4._`${(0,KX.usePattern)($,S)}.test(${Z})`));return(0,K4.not)(F)}function B(Z){v.code(K4._`delete ${U}[${Z}]`)}function L(Z){if(W.removeAdditional==="all"||W.removeAdditional&&D===!1){B(Z);return}if(D===!1){if($.setParams({additionalProperty:Z}),$.error(),!Q)v.break();return}if(typeof D=="object"&&!(0,NX.alwaysValidSchema)(J,D)){let F=v.name("valid");if(W.removeAdditional==="failing")N(Z,F,!1),v.if((0,K4.not)(F),()=>{$.reset(),B(Z)});else if(N(Z,F),!Q)v.if((0,K4.not)(F),()=>v.break())}}function N(Z,F,S){let T={keyword:"additionalProperties",dataProp:Z,dataPropType:NX.Type.Str};if(S===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(T,F)}}};WN.default=yE});var VN=b((IN)=>{Object.defineProperty(IN,"__esModule",{value:!0});var lE=G0(),zN=X4(),O5=d(),YN=Z5(),hE={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:v,schema:D,parentSchema:X,data:U,it:G}=$;if(G.opts.removeAdditional==="all"&&X.additionalProperties===void 0)YN.default.code(new lE.KeywordCxt(G,YN.default,"additionalProperties"));let J=(0,zN.allSchemaProperties)(D);for(let I of J)G.definedProperties.add(I);if(G.opts.unevaluated&&J.length&&G.props!==!0)G.props=O5.mergeEvaluated.props(v,(0,O5.toHash)(J),G.props);let Q=J.filter((I)=>!(0,O5.alwaysValidSchema)(G,D[I]));if(Q.length===0)return;let W=v.name("valid");for(let I of Q){if(z(I))Y(I);else{if(v.if((0,zN.propertyInData)(v,U,I,G.opts.ownProperties)),Y(I),!G.allErrors)v.else().var(W,!0);v.endIf()}$.it.definedProperties.add(I),$.ok(W)}function z(I){return G.opts.useDefaults&&!G.compositeRule&&D[I].default!==void 0}function Y(I){$.subschema({keyword:"properties",schemaProp:I,dataProp:I},W)}}};IN.default=hE});var ZN=b((NN)=>{Object.defineProperty(NN,"__esModule",{value:!0});var BN=X4(),ZX=l(),LN=d(),KN=d(),cE={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:v,schema:D,data:X,parentSchema:U,it:G}=$,{opts:J}=G,Q=(0,BN.allSchemaProperties)(D),W=Q.filter((N)=>(0,LN.alwaysValidSchema)(G,D[N]));if(Q.length===0||W.length===Q.length&&(!G.opts.unevaluated||G.props===!0))return;let z=J.strictSchema&&!J.allowMatchingProperties&&U.properties,Y=v.name("valid");if(G.props!==!0&&!(G.props instanceof ZX.Name))G.props=(0,KN.evaluatedPropsToName)(v,G.props);let{props:I}=G;V();function V(){for(let N of Q){if(z)B(N);if(G.allErrors)L(N);else v.var(Y,!0),L(N),v.if(Y)}}function B(N){for(let Z in z)if(new RegExp(N).test(Z))(0,LN.checkStrictMode)(G,`property ${Z} matches pattern ${N} (use allowMatchingProperties)`)}function L(N){v.forIn("key",X,(Z)=>{v.if(ZX._`${(0,BN.usePattern)($,N)}.test(${Z})`,()=>{let F=W.includes(N);if(!F)$.subschema({keyword:"patternProperties",schemaProp:N,dataProp:Z,dataPropType:KN.Type.Str},Y);if(G.opts.unevaluated&&I!==!0)v.assign(ZX._`${I}[${Z}]`,!0);else if(!F&&!G.allErrors)v.if((0,ZX.not)(Y),()=>v.break())})})}}};NN.default=cE});var HN=b((ON)=>{Object.defineProperty(ON,"__esModule",{value:!0});var dE=d(),pE={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:v,schema:D,it:X}=$;if((0,dE.alwaysValidSchema)(X,D)){$.fail();return}let U=v.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},U),$.failResult(U,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};ON.default=pE});var jN=b((FN)=>{Object.defineProperty(FN,"__esModule",{value:!0});var oE=X4(),aE={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:oE.validateUnion,error:{message:"must match a schema in anyOf"}};FN.default=aE});var wN=b((AN)=>{Object.defineProperty(AN,"__esModule",{value:!0});var OX=l(),sE=d(),$T={message:"must match exactly one schema in oneOf",params:({params:$})=>OX._`{passingSchemas: ${$.passing}}`},vT={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:$T,code($){let{gen:v,schema:D,parentSchema:X,it:U}=$;if(!Array.isArray(D))throw Error("ajv implementation error");if(U.opts.discriminator&&X.discriminator)return;let G=D,J=v.let("valid",!1),Q=v.let("passing",null),W=v.name("_valid");$.setParams({passing:Q}),v.block(z),$.result(J,()=>$.reset(),()=>$.error(!0));function z(){G.forEach((Y,I)=>{let V;if((0,sE.alwaysValidSchema)(U,Y))v.var(W,!0);else V=$.subschema({keyword:"oneOf",schemaProp:I,compositeRule:!0},W);if(I>0)v.if(OX._`${W} && ${J}`).assign(J,!1).assign(Q,OX._`[${Q}, ${I}]`).else();v.if(W,()=>{if(v.assign(J,!0),v.assign(Q,I),V)$.mergeEvaluated(V,OX.Name)})})}}};AN.default=vT});var PN=b((MN)=>{Object.defineProperty(MN,"__esModule",{value:!0});var DT=d(),XT={keyword:"allOf",schemaType:"array",code($){let{gen:v,schema:D,it:X}=$;if(!Array.isArray(D))throw Error("ajv implementation error");let U=v.name("valid");D.forEach((G,J)=>{if((0,DT.alwaysValidSchema)(X,G))return;let Q=$.subschema({keyword:"allOf",schemaProp:J},U);$.ok(U),$.mergeEvaluated(Q)})}};MN.default=XT});var kN=b((SN)=>{Object.defineProperty(SN,"__esModule",{value:!0});var HX=l(),qN=d(),JT={message:({params:$})=>HX.str`must match "${$.ifClause}" schema`,params:({params:$})=>HX._`{failingKeyword: ${$.ifClause}}`},QT={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:JT,code($){let{gen:v,parentSchema:D,it:X}=$;if(D.then===void 0&&D.else===void 0)(0,qN.checkStrictMode)(X,'"if" without "then" and "else" is ignored');let U=bN(X,"then"),G=bN(X,"else");if(!U&&!G)return;let J=v.let("valid",!0),Q=v.name("_valid");if(W(),$.reset(),U&&G){let Y=v.let("ifClause");$.setParams({ifClause:Y}),v.if(Q,z("then",Y),z("else",Y))}else if(U)v.if(Q,z("then"));else v.if((0,HX.not)(Q),z("else"));$.pass(J,()=>$.error(!0));function W(){let Y=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Q);$.mergeEvaluated(Y)}function z(Y,I){return()=>{let V=$.subschema({keyword:Y},Q);if(v.assign(J,Q),$.mergeValidEvaluated(V,J),I)v.assign(I,HX._`${Y}`);else $.setParams({ifClause:Y})}}}};function bN($,v){let D=$.schema[v];return D!==void 0&&!(0,qN.alwaysValidSchema)($,D)}SN.default=QT});var TN=b((EN)=>{Object.defineProperty(EN,"__esModule",{value:!0});var zT=d(),YT={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:v,it:D}){if(v.if===void 0)(0,zT.checkStrictMode)(D,`"${$}" without "if" is ignored`)}};EN.default=YT});var gN=b((RN)=>{Object.defineProperty(RN,"__esModule",{value:!0});var VT=L5(),BT=dK(),LT=K5(),KT=oK(),NT=eK(),ZT=XN(),OT=QN(),HT=Z5(),FT=VN(),jT=ZN(),AT=HN(),wT=jN(),MT=wN(),PT=PN(),bT=kN(),qT=TN();function ST($=!1){let v=[AT.default,wT.default,MT.default,PT.default,bT.default,qT.default,OT.default,HT.default,ZT.default,FT.default,jT.default];if($)v.push(BT.default,KT.default);else v.push(VT.default,LT.default);return v.push(NT.default),v}RN.default=ST});var CN=b((uN)=>{Object.defineProperty(uN,"__esModule",{value:!0});var L$=l(),ET={message:({schemaCode:$})=>L$.str`must match format "${$}"`,params:({schemaCode:$})=>L$._`{format: ${$}}`},TT={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:ET,code($,v){let{gen:D,data:X,$data:U,schema:G,schemaCode:J,it:Q}=$,{opts:W,errSchemaPath:z,schemaEnv:Y,self:I}=Q;if(!W.validateFormats)return;if(U)V();else B();function V(){let L=D.scopeValue("formats",{ref:I.formats,code:W.code.formats}),N=D.const("fDef",L$._`${L}[${J}]`),Z=D.let("fType"),F=D.let("format");D.if(L$._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>D.assign(Z,L$._`${N}.type || "string"`).assign(F,L$._`${N}.validate`),()=>D.assign(Z,L$._`"string"`).assign(F,N)),$.fail$data((0,L$.or)(S(),T()));function S(){if(W.strictSchema===!1)return L$.nil;return L$._`${J} && !${F}`}function T(){let g=Y.$async?L$._`(${N}.async ? await ${F}(${X}) : ${F}(${X}))`:L$._`${F}(${X})`,k=L$._`(typeof ${F} == "function" ? ${g} : ${F}.test(${X}))`;return L$._`${F} && ${F} !== true && ${Z} === ${v} && !${k}`}}function B(){let L=I.formats[G];if(!L){S();return}if(L===!0)return;let[N,Z,F]=T(L);if(N===v)$.pass(g());function S(){if(W.strictSchema===!1){I.logger.warn(k());return}throw Error(k());function k(){return`unknown format "${G}" ignored in schema at path "${z}"`}}function T(k){let N$=k instanceof RegExp?(0,L$.regexpCode)(k):W.code.formats?L$._`${W.code.formats}${(0,L$.getProperty)(G)}`:void 0,j$=D.scopeValue("formats",{key:G,ref:k,code:N$});if(typeof k=="object"&&!(k instanceof RegExp))return[k.type||"string",k.validate,L$._`${j$}.validate`];return["string",k,j$]}function g(){if(typeof L=="object"&&!(L instanceof RegExp)&&L.async){if(!Y.$async)throw Error("async format in sync schema");return L$._`await ${F}(${X})`}return typeof Z=="function"?L$._`${F}(${X})`:L$._`${F}.test(${X})`}}}};uN.default=TT});var fN=b((xN)=>{Object.defineProperty(xN,"__esModule",{value:!0});var gT=CN(),uT=[gT.default];xN.default=uT});var yN=b((_N)=>{Object.defineProperty(_N,"__esModule",{value:!0});_N.contentVocabulary=_N.metadataVocabulary=void 0;_N.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];_N.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var hN=b((lN)=>{Object.defineProperty(lN,"__esModule",{value:!0});var fT=IK(),_T=_K(),iT=gN(),yT=fN(),nN=yN(),nT=[fT.default,_T.default,(0,iT.default)(),yT.default,nN.metadataVocabulary,nN.contentVocabulary];lN.default=nT});var dN=b((cN)=>{Object.defineProperty(cN,"__esModule",{value:!0});cN.DiscrError=void 0;var mN;(function($){$.Tag="tag",$.Mapping="mapping"})(mN||(cN.DiscrError=mN={}))});var oN=b((tN)=>{Object.defineProperty(tN,"__esModule",{value:!0});var R1=l(),H5=dN(),pN=UX(),hT=J0(),mT=d(),cT={message:({params:{discrError:$,tagName:v}})=>$===H5.DiscrError.Tag?`tag "${v}" must be string`:`value of tag "${v}" must be in oneOf`,params:({params:{discrError:$,tag:v,tagName:D}})=>R1._`{error: ${$}, tag: ${D}, tagValue: ${v}}`},rT={keyword:"discriminator",type:"object",schemaType:"object",error:cT,code($){let{gen:v,data:D,schema:X,parentSchema:U,it:G}=$,{oneOf:J}=U;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let Q=X.propertyName;if(typeof Q!="string")throw Error("discriminator: requires propertyName");if(X.mapping)throw Error("discriminator: mapping is not supported");if(!J)throw Error("discriminator: requires oneOf keyword");let W=v.let("valid",!1),z=v.const("tag",R1._`${D}${(0,R1.getProperty)(Q)}`);v.if(R1._`typeof ${z} == "string"`,()=>Y(),()=>$.error(!1,{discrError:H5.DiscrError.Tag,tag:z,tagName:Q})),$.ok(W);function Y(){let B=V();v.if(!1);for(let L in B)v.elseIf(R1._`${z} === ${L}`),v.assign(W,I(B[L]));v.else(),$.error(!1,{discrError:H5.DiscrError.Mapping,tag:z,tagName:Q}),v.endIf()}function I(B){let L=v.name("valid"),N=$.subschema({keyword:"oneOf",schemaProp:B},L);return $.mergeEvaluated(N,R1.Name),L}function V(){var B;let L={},N=F(U),Z=!0;for(let g=0;g<J.length;g++){let k=J[g];if((k===null||k===void 0?void 0:k.$ref)&&!(0,mT.schemaHasRulesButRef)(k,G.self.RULES)){let j$=k.$ref;if(k=pN.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,j$),k instanceof pN.SchemaEnv)k=k.schema;if(k===void 0)throw new hT.default(G.opts.uriResolver,G.baseId,j$)}let N$=(B=k===null||k===void 0?void 0:k.properties)===null||B===void 0?void 0:B[Q];if(typeof N$!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Q}"`);Z=Z&&(N||F(k)),S(N$,g)}if(!Z)throw Error(`discriminator: "${Q}" must be required`);return L;function F({required:g}){return Array.isArray(g)&&g.includes(Q)}function S(g,k){if(g.const)T(g.const,k);else if(g.enum)for(let N$ of g.enum)T(N$,k);else throw Error(`discriminator: "properties/${Q}" must have "const" or "enum"`)}function T(g,k){if(typeof g!="string"||g in L)throw Error(`discriminator: "${Q}" values must be unique strings`);L[g]=k}}}};tN.default=rT});var aN=b((nr,pT)=>{pT.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 j5=b((d$,F5)=>{Object.defineProperty(d$,"__esModule",{value:!0});d$.MissingRefError=d$.ValidationError=d$.CodeGen=d$.Name=d$.nil=d$.stringify=d$.str=d$._=d$.KeywordCxt=d$.Ajv=void 0;var tT=vK(),oT=hN(),aT=oN(),eN=aN(),eT=["/properties"],FX="http://json-schema.org/draft-07/schema";class O0 extends tT.default{_addVocabularies(){if(super._addVocabularies(),oT.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(aT.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(eN,eT):eN;this.addMetaSchema($,FX,!1),this.refs["http://json-schema.org/schema"]=FX}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(FX)?FX:void 0)}}d$.Ajv=O0;F5.exports=d$=O0;F5.exports.Ajv=O0;Object.defineProperty(d$,"__esModule",{value:!0});d$.default=O0;var sT=G0();Object.defineProperty(d$,"KeywordCxt",{enumerable:!0,get:function(){return sT.KeywordCxt}});var g1=l();Object.defineProperty(d$,"_",{enumerable:!0,get:function(){return g1._}});Object.defineProperty(d$,"str",{enumerable:!0,get:function(){return g1.str}});Object.defineProperty(d$,"stringify",{enumerable:!0,get:function(){return g1.stringify}});Object.defineProperty(d$,"nil",{enumerable:!0,get:function(){return g1.nil}});Object.defineProperty(d$,"Name",{enumerable:!0,get:function(){return g1.Name}});Object.defineProperty(d$,"CodeGen",{enumerable:!0,get:function(){return g1.CodeGen}});var $2=$X();Object.defineProperty(d$,"ValidationError",{enumerable:!0,get:function(){return $2.default}});var v2=J0();Object.defineProperty(d$,"MissingRefError",{enumerable:!0,get:function(){return v2.default}})});var WZ=b((JZ)=>{Object.defineProperty(JZ,"__esModule",{value:!0});JZ.formatNames=JZ.fastFormats=JZ.fullFormats=void 0;function S4($,v){return{validate:$,compare:v}}JZ.fullFormats={date:S4(UZ,P5),time:S4(w5(!0),b5),"date-time":S4(sN(!0),XZ),"iso-time":S4(w5(),DZ),"iso-date-time":S4(sN(),GZ),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:z2,"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:N2,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:Y2,int32:{type:"number",validate:B2},int64:{type:"number",validate:L2},float:{type:"number",validate:vZ},double:{type:"number",validate:vZ},password:!0,binary:!0};JZ.fastFormats={...JZ.fullFormats,date:S4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,P5),time:S4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b5),"date-time":S4(/^\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,XZ),"iso-time":S4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,DZ),"iso-date-time":S4(/^\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,GZ),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};JZ.formatNames=Object.keys(JZ.fullFormats);function X2($){return $%4===0&&($%100!==0||$%400===0)}var G2=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,J2=[0,31,28,31,30,31,30,31,31,30,31,30,31];function UZ($){let v=G2.exec($);if(!v)return!1;let D=+v[1],X=+v[2],U=+v[3];return X>=1&&X<=12&&U>=1&&U<=(X===2&&X2(D)?29:J2[X])}function P5($,v){if(!($&&v))return;if($>v)return 1;if($<v)return-1;return 0}var A5=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function w5($){return function(D){let X=A5.exec(D);if(!X)return!1;let U=+X[1],G=+X[2],J=+X[3],Q=X[4],W=X[5]==="-"?-1:1,z=+(X[6]||0),Y=+(X[7]||0);if(z>23||Y>59||$&&!Q)return!1;if(U<=23&&G<=59&&J<60)return!0;let I=G-Y*W,V=U-z*W-(I<0?1:0);return(V===23||V===-1)&&(I===59||I===-1)&&J<61}}function b5($,v){if(!($&&v))return;let D=new Date("2020-01-01T"+$).valueOf(),X=new Date("2020-01-01T"+v).valueOf();if(!(D&&X))return;return D-X}function DZ($,v){if(!($&&v))return;let D=A5.exec($),X=A5.exec(v);if(!(D&&X))return;if($=D[1]+D[2]+D[3],v=X[1]+X[2]+X[3],$>v)return 1;if($<v)return-1;return 0}var M5=/t|\s/i;function sN($){let v=w5($);return function(X){let U=X.split(M5);return U.length===2&&UZ(U[0])&&v(U[1])}}function XZ($,v){if(!($&&v))return;let D=new Date($).valueOf(),X=new Date(v).valueOf();if(!(D&&X))return;return D-X}function GZ($,v){if(!($&&v))return;let[D,X]=$.split(M5),[U,G]=v.split(M5),J=P5(D,U);if(J===void 0)return;return J||b5(X,G)}var Q2=/\/|:/,W2=/^(?:[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 z2($){return Q2.test($)&&W2.test($)}var $Z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Y2($){return $Z.lastIndex=0,$Z.test($)}var I2=-2147483648,V2=2147483647;function B2($){return Number.isInteger($)&&$<=V2&&$>=I2}function L2($){return Number.isInteger($)}function vZ(){return!0}var K2=/[^\\]\\Z/;function N2($){if(K2.test($))return!1;try{return new RegExp($),!0}catch(v){return!1}}});var YZ=b((zZ)=>{Object.defineProperty(zZ,"__esModule",{value:!0});zZ.formatLimitDefinition=void 0;var O2=j5(),N4=l(),K6=N4.operators,jX={formatMaximum:{okStr:"<=",ok:K6.LTE,fail:K6.GT},formatMinimum:{okStr:">=",ok:K6.GTE,fail:K6.LT},formatExclusiveMaximum:{okStr:"<",ok:K6.LT,fail:K6.GTE},formatExclusiveMinimum:{okStr:">",ok:K6.GT,fail:K6.LTE}},H2={message:({keyword:$,schemaCode:v})=>N4.str`should be ${jX[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>N4._`{comparison: ${jX[$].okStr}, limit: ${v}}`};zZ.formatLimitDefinition={keyword:Object.keys(jX),type:"string",schemaType:"string",$data:!0,error:H2,code($){let{gen:v,data:D,schemaCode:X,keyword:U,it:G}=$,{opts:J,self:Q}=G;if(!J.validateFormats)return;let W=new O2.KeywordCxt(G,Q.RULES.all.format.definition,"format");if(W.$data)z();else Y();function z(){let V=v.scopeValue("formats",{ref:Q.formats,code:J.code.formats}),B=v.const("fmt",N4._`${V}[${W.schemaCode}]`);$.fail$data((0,N4.or)(N4._`typeof ${B} != "object"`,N4._`${B} instanceof RegExp`,N4._`typeof ${B}.compare != "function"`,I(B)))}function Y(){let V=W.schema,B=Q.formats[V];if(!B||B===!0)return;if(typeof B!="object"||B instanceof RegExp||typeof B.compare!="function")throw Error(`"${U}": format "${V}" does not define "compare" function`);let L=v.scopeValue("formats",{key:V,ref:B,code:J.code.formats?N4._`${J.code.formats}${(0,N4.getProperty)(V)}`:void 0});$.fail$data(I(L))}function I(V){return N4._`${V}.compare(${D}, ${X}) ${jX[U].fail} 0`}},dependencies:["format"]};var F2=($)=>{return $.addKeyword(zZ.formatLimitDefinition),$};zZ.default=F2});var LZ=b((H0,BZ)=>{Object.defineProperty(H0,"__esModule",{value:!0});var u1=WZ(),A2=YZ(),k5=l(),IZ=new k5.Name("fullFormats"),w2=new k5.Name("fastFormats"),E5=($,v={keywords:!0})=>{if(Array.isArray(v))return VZ($,v,u1.fullFormats,IZ),$;let[D,X]=v.mode==="fast"?[u1.fastFormats,w2]:[u1.fullFormats,IZ],U=v.formats||u1.formatNames;if(VZ($,U,D,X),v.keywords)(0,A2.default)($);return $};E5.get=($,v="full")=>{let X=(v==="fast"?u1.fastFormats:u1.fullFormats)[$];if(!X)throw Error(`Unknown format "${$}"`);return X};function VZ($,v,D,X){var U,G;(U=(G=$.opts.code).formats)!==null&&U!==void 0||(G.formats=k5._`require("ajv-formats/dist/formats").${X}`);for(let J of v)$.addFormat(J,D[J])}BZ.exports=H0=E5;Object.defineProperty(H0,"__esModule",{value:!0});H0.default=E5});var r4="/auth/api";import{spawn as MH}from"node:child_process";function PH($,v){if($==="darwin")return{command:"open",args:[v]};if($==="win32")return{command:"cmd",args:["/c","start","",v]};return{command:"xdg-open",args:[v]}}function b0($,v=process.platform){return new Promise((D)=>{let{command:X,args:U}=PH(v,$);try{let G=MH(X,U,{stdio:"ignore",detached:!0});G.once("spawn",()=>{G.unref(),D(!0)}),G.once("error",()=>D(!1))}catch{D(!1)}})}import{chmod as bH,mkdir as qH,readFile as SH,rm as kH,writeFile as EH}from"node:fs/promises";import{homedir as TH}from"node:os";import{dirname as RH,join as N7}from"node:path";function Z7($){if(typeof $!=="object"||$===null)return null;let{accessToken:v,expiresAt:D}=$;if(typeof v==="string"&&typeof D==="number")return{accessToken:v,expiresAt:D};return null}function gH($){try{return Z7(JSON.parse($))}catch{return null}}class O7{Entry;keychainService;constructor($,v){this.Entry=$;this.keychainService=v}async get($){try{return gH(new this.Entry(this.keychainService,$).getPassword())}catch{return null}}async set($,v){new this.Entry(this.keychainService,$).setPassword(JSON.stringify(v))}async clear($){try{new this.Entry(this.keychainService,$).deletePassword()}catch{}}}class tX{filePath;constructor($){this.filePath=$}async readAll(){try{let $=JSON.parse(await SH(this.filePath,"utf8"));if(typeof $!=="object"||$===null)return{};return $}catch{return{}}}async writeAll($){await qH(RH(this.filePath),{recursive:!0,mode:448}),await EH(this.filePath,JSON.stringify($,null,2),{mode:384}),await bH(this.filePath,384)}async get($){return Z7((await this.readAll())[$])}async set($,v){let D=await this.readAll();D[$]=v,await this.writeAll(D)}async clear($){let v=await this.readAll();if(!($ in v))return;if(delete v[$],Object.keys(v).length===0){await kH(this.filePath,{force:!0});return}await this.writeAll(v)}}function q0($,v=process.env){let D=v.XDG_CONFIG_HOME||N7(TH(),".config");return N7(D,$,"credentials.json")}async function S0($){let v=$.credentialsFilePath,D=Boolean($.forceFileEnvVar&&process.env[$.forceFileEnvVar]);if($.forceFile||D)return new tX(v);try{let X=$.loadKeyring??(()=>import("@napi-rs/keyring")),{Entry:U}=await X();return new O7(U,$.keychainService)}catch{return new tX(v)}}async function H4($){let v=await $.text();if(!v)return{};try{let D=JSON.parse(v);return typeof D==="object"&&D!==null?D:{}}catch{return{}}}var uH=`${r4}/.well-known/openid-configuration`;async function k0($,v=fetch){let D=`${$.replace(/\/$/,"")}${uH}`,X;try{X=await v(D)}catch(Q){throw Error(`OAuth discovery request failed for ${D}`,{cause:Q})}if(!X.ok)throw Error(`OAuth discovery returned ${X.status} for ${D}`);let U=await H4(X),G=U.authorization_endpoint,J=U.token_endpoint;if(typeof G!=="string"||typeof J!=="string")throw Error(`OAuth discovery at ${D} is missing authorization_endpoint or token_endpoint`);return H7($,G,D),H7($,J,D),{authorizationEndpoint:G,tokenEndpoint:J}}function H7($,v,D){let X;try{X=new URL(v).origin}catch{throw Error(`OAuth discovery at ${D} returned an invalid endpoint: ${v}`)}if(X!==new URL($).origin)throw Error(`OAuth discovery at ${D} returned a cross-origin endpoint: ${v}`)}var g4="127.0.0.1",oX=["localhost","127.0.0.1","[::1]"];function u4($){return oX.includes($)}function E0($,v){return`http://${g4}:${v}${$}`}import{createServer as CH}from"node:http";function j7($){let v=$.ok?"accent":"danger",D=$.ok?"✓":"!";return`<!doctype html><html lang="en"><head><meta charset="utf-8">
|
|
11
|
+
<title>${$.title}</title><meta name="viewport" content="width=device-width, initial-scale=1">
|
|
12
|
+
<style>
|
|
13
|
+
:root{--bg:40 30% 97%;--fg:220 30% 18%;--card:40 35% 99%;--muted:35 15% 42%;--border:35 18% 80%;--accent:326 44% 46%;--danger:0 65% 45%}
|
|
14
|
+
@media(prefers-color-scheme:dark){:root{--bg:226 37% 9%;--fg:230 50% 92%;--card:226 28% 13%;--muted:215 20% 65%;--border:226 11% 29%;--accent:326 39% 53%;--danger:0 70% 62%}}
|
|
15
|
+
*{box-sizing:border-box}html,body{height:100%}
|
|
16
|
+
body{margin:0;display:flex;align-items:center;justify-content:center;padding:1.5rem;background:radial-gradient(40rem 40rem at 50% 28%,hsl(var(--accent)/.06),transparent 62%),hsl(var(--bg));color:hsl(var(--fg));font:16px/1.5 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
|
|
17
|
+
.card{width:100%;max-width:23rem;text-align:center;padding:2.5rem 2rem;border-radius:1rem;background:hsl(var(--card)/.6);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);border:1px solid hsl(var(--fg)/.08);box-shadow:0 24px 64px -30px rgb(0 0 0 / .5)}
|
|
18
|
+
.badge{width:3rem;height:3rem;margin:0 auto 1.25rem;border-radius:9999px;display:flex;align-items:center;justify-content:center;font-size:1.4rem;font-weight:700;background:hsl(var(--${v})/.15);color:hsl(var(--${v}))}
|
|
19
|
+
h1{margin:0 0 .5rem;font-size:1.25rem;font-weight:700;letter-spacing:-.01em}
|
|
20
|
+
p{margin:0;color:hsl(var(--muted));font-size:.95rem}
|
|
21
|
+
.brand{margin-top:1.5rem;font:600 10px/1 'Inter',-apple-system,sans-serif;letter-spacing:.2em;text-transform:uppercase;color:hsl(var(--muted))}
|
|
22
|
+
</style></head>
|
|
23
|
+
<body><main class="card"><div class="badge">${D}</div><h1>${$.heading}</h1><p>${$.detail}</p><div class="brand">Aether Wealth</div></main></body></html>`}var xH=j7({title:"Signed in · Aether Wealth",heading:"Signed in to Aether Wealth",detail:"You can close this tab and return to your assistant.",ok:!0}),F7=j7({title:"Sign-in failed · Aether Wealth",heading:"Sign-in failed",detail:"You can close this tab and try again from your assistant.",ok:!1});function fH($,v){return new Promise((D)=>{let X=(U)=>{$.removeListener("error",X),D({ok:!1,...U.code==="EADDRINUSE"?{}:{error:U}})};$.once("error",X),$.listen(v,g4,()=>{$.removeListener("error",X),D({ok:!0})})})}async function _H($,v){let D;for(let U of v){let G=await fH($,U);if(G.ok)return U;if(G.error)D=G.error}let X=D?`: ${D.message}`:"";throw Error(`could not bind any loopback port (${v.join(", ")}) for OAuth redirect${X}`)}async function T0($,v){let D=null,X=null,U=null,G=(W)=>{if(D)return;if(D=W,W?.ok)X?.(W.value);else if(W)U?.(W.error)},J=CH((W,z)=>{let Y=new URL(W.url??"/",`http://${g4}`);if(Y.pathname!==v){z.writeHead(404).end("not found");return}let I=Y.searchParams.get("error"),V=Y.searchParams.get("code"),B=Y.searchParams.get("state");if(I){z.writeHead(400,{"content-type":"text/html"}).end(F7),G({ok:!1,error:Error(`authorization denied: ${I}`)});return}if(!V||!B){z.writeHead(400,{"content-type":"text/html"}).end(F7),G({ok:!1,error:Error("callback missing code or state")});return}z.writeHead(200,{"content-type":"text/html"}).end(xH),G({ok:!0,value:{code:V,state:B}})}),Q=await _H(J,$);return{redirectUri:E0(v,Q),waitForCode(W){return new Promise((z,Y)=>{let I=setTimeout(()=>Y(Error("timed out waiting for the browser sign-in to complete")),W);if(I.unref(),X=(V)=>{clearTimeout(I),z(V)},U=(V)=>{clearTimeout(I),Y(V)},D?.ok)X(D.value);else if(D)U(D.error)})},close(){return new Promise((W)=>J.close(()=>W()))}}}import{createHash as iH,randomBytes as A7}from"node:crypto";function aX($){return $.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function R0($={}){let v=aX(($.randomBytesImpl??A7)(32)),D=$.hashImpl?$.hashImpl(v):iH("sha256").update(v).digest();return{verifier:v,challenge:aX(D),method:"S256"}}function g0($=A7){return aX($(16))}var eX=300000;async function u0($){let v=$.fetchImpl??fetch,D=$.log??(()=>{}),X=$.now??Date.now,{clientId:U,redirectPorts:G,redirectPath:J,scopes:Q}=$.identity,W=await k0($.authBaseUrl,v),z=R0(),Y=g0(),I=await T0(G,J);try{let V=yH($.authBaseUrl),B=sX(W.authorizationEndpoint,{clientId:U,redirectUri:I.redirectUri,scope:Q.join(" "),state:Y,codeChallenge:z.challenge,...V?{prompt:"consent"}:{}});if(D(`Opening your browser to sign in. If it doesn't open, visit:
|
|
24
|
+
${B}
|
|
25
|
+
`),!await($.openBrowserImpl??b0)(B))D(`Could not open a browser automatically — open the URL above manually.
|
|
26
|
+
`);let{code:N,state:Z}=await I.waitForCode(eX);if(Z!==Y)throw Error("OAuth state mismatch — aborting login (possible CSRF).");return await $G(W.tokenEndpoint,{code:N,codeVerifier:z.verifier,redirectUri:I.redirectUri,clientId:U},v,X)}finally{await I.close()}}function sX($,v){let D=new URL($);if(D.searchParams.set("response_type","code"),D.searchParams.set("client_id",v.clientId),D.searchParams.set("redirect_uri",v.redirectUri),D.searchParams.set("scope",v.scope),D.searchParams.set("state",v.state),D.searchParams.set("code_challenge",v.codeChallenge),D.searchParams.set("code_challenge_method","S256"),v.prompt)D.searchParams.set("prompt",v.prompt);return D.toString()}function yH($){try{return u4(new URL($).hostname)}catch{return!1}}async function $G($,v,D=fetch,X=Date.now){let U=new URLSearchParams({grant_type:"authorization_code",code:v.code,redirect_uri:v.redirectUri,client_id:v.clientId,code_verifier:v.codeVerifier}),G=await D($,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:U.toString()}),J=await H4(G),Q=J.access_token,W=J.expires_in;if(!G.ok||typeof Q!=="string")throw Error(`OAuth token exchange failed: ${nH(J,G.status)}`);if(typeof W!=="number"||W<=0)throw Error("OAuth token exchange returned no valid expires_in");return{accessToken:Q,expiresAt:X()+W*1000}}function nH($,v){if(typeof $.error_description==="string")return $.error_description;if(typeof $.error==="string")return $.error;return`HTTP ${v}`}var m1=`${r4}/oauth2/userinfo`;async function vG($,v,D=fetch){let X=`${$.replace(/\/$/,"")}${m1}`,U;try{U=await D(X,{method:"GET",headers:{authorization:`Bearer ${v}`,accept:"application/json"}})}catch(z){throw Error(`Could not reach the Aether Wealth userinfo endpoint at ${X}`,{cause:z})}if(!U.ok)throw Error(`Aether Wealth userinfo request failed (HTTP ${U.status})`);let G=await H4(U),J=G.sub;if(typeof J!=="string"||J.length===0)throw Error("Aether Wealth userinfo response did not include a user id");let Q=typeof G.email==="string"?G.email:void 0,W=typeof G.name==="string"?G.name:void 0;return{sub:J,...Q?{email:Q}:{},...W?{name:W}:{}}}async function C0($,v,D=fetch){return(await vG($,v,D)).sub}class c1{target;store;identity;deps;constructor($,v,D,X={}){this.target=$;this.store=v;this.identity=D;this.deps=X}cachedUserId=null;async getStoredCredential(){let $=await this.store.get(this.target.host);if(!$)return null;let v=(this.deps.now??Date.now)();if($.expiresAt<=v)return await this.store.clear(this.target.host),null;return $}async getAccessToken(){return(await this.getStoredCredential())?.accessToken??null}async getUserId(){let $=await this.getAccessToken();if(!$)throw Error('Not signed in to Aether Wealth. Call "login" first.');if(this.cachedUserId?.token===$)return this.cachedUserId.userId;let v=await C0(this.target.baseUrl,$);return this.cachedUserId={token:$,userId:v},v}async login(){let $=await(this.deps.runLoginImpl??u0)({authBaseUrl:this.target.baseUrl,identity:this.identity,...this.deps.log?{log:this.deps.log}:{},...this.deps.now?{now:this.deps.now}:{}});await this.store.set(this.target.host,{accessToken:$.accessToken,expiresAt:$.expiresAt})}async logout(){await this.store.clear(this.target.host)}}var{create:lH,defineProperty:w7,getOwnPropertyDescriptor:hH,getOwnPropertyNames:M7,getPrototypeOf:mH}=Object,cH=Object.prototype.hasOwnProperty,W4=($,v)=>function(){return v||(0,$[M7($)[0]])((v={exports:{}}).exports,v),v.exports},rH=($,v,D,X)=>{if(v&&typeof v==="object"||typeof v==="function"){for(var U=M7(v),G=0,J=U.length,Q;G<J;G++)if(Q=U[G],!cH.call($,Q)&&Q!==D)w7($,Q,{get:((W)=>v[W]).bind(null,Q),enumerable:!(X=hH(v,Q))||X.enumerable})}return $},$$=($,v,D)=>(D=$!=null?lH(mH($)):{},rH(v||!$||!$.__esModule?w7(D,"default",{value:$,enumerable:!0}):D,$)),P7=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,v){function D(X){return v.exports=D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},v.exports.__esModule=!0,v.exports.default=v.exports,D(X)}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),dH=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,v){var D=P7().default;function X(U,G){if(D(U)!="object"||!U)return U;var J=U[Symbol.toPrimitive];if(J!==void 0){var Q=J.call(U,G||"default");if(D(Q)!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(G==="string"?String:Number)(U)}v.exports=X,v.exports.__esModule=!0,v.exports.default=v.exports}}),pH=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,v){var D=P7().default,X=dH();function U(G){var J=X(G,"string");return D(J)=="symbol"?J:J+""}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}}),F4=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,v){var D=pH();function X(U,G,J){return(G=D(G))in U?Object.defineProperty(U,G,{value:J,enumerable:!0,configurable:!0,writable:!0}):U[G]=J,U}v.exports=X,v.exports.__esModule=!0,v.exports.default=v.exports}}),H$=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,v){var D=F4();function X(G,J){var Q=Object.keys(G);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(G);J&&(W=W.filter(function(z){return Object.getOwnPropertyDescriptor(G,z).enumerable})),Q.push.apply(Q,W)}return Q}function U(G){for(var J=1;J<arguments.length;J++){var Q=arguments[J]!=null?arguments[J]:{};J%2?X(Object(Q),!0).forEach(function(W){D(G,W,Q[W])}):Object.getOwnPropertyDescriptors?Object.defineProperties(G,Object.getOwnPropertyDescriptors(Q)):X(Object(Q)).forEach(function(W){Object.defineProperty(G,W,Object.getOwnPropertyDescriptor(Q,W))})}return G}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}});function z4($){let v={subscribe(D){let X=null,U=!1,G=!1,J=!1;function Q(){if(X===null){J=!0;return}if(G)return;if(G=!0,typeof X==="function")X();else if(X)X.unsubscribe()}if(X=$({next(W){var z;if(U)return;(z=D.next)===null||z===void 0||z.call(D,W)},error(W){var z;if(U)return;U=!0,(z=D.error)===null||z===void 0||z.call(D,W),Q()},complete(){var W;if(U)return;U=!0,(W=D.complete)===null||W===void 0||W.call(D),Q()}}),J)Q();return{unsubscribe:Q}},pipe(...D){return D.reduce(tH,v)}};return v}function tH($,v){return v($)}function UG($){let v=new AbortController;return new Promise((X,U)=>{let G=!1;function J(){if(G)return;G=!0,Q.unsubscribe()}v.signal.addEventListener("abort",()=>{U(v.signal.reason)});let Q=$.subscribe({next(W){G=!0,X(W),J()},error(W){U(W)},complete(){v.abort(),J()}})})}function DG($){return(v)=>{let D=0,X=null,U=[];function G(){if(X)return;X=v.subscribe({next(Q){for(let z of U){var W;(W=z.next)===null||W===void 0||W.call(z,Q)}},error(Q){for(let z of U){var W;(W=z.error)===null||W===void 0||W.call(z,Q)}},complete(){for(let W of U){var Q;(Q=W.complete)===null||Q===void 0||Q.call(W)}}})}function J(){if(D===0&&X){let Q=X;X=null,Q.unsubscribe()}}return z4((Q)=>{return D++,U.push(Q),G(),{unsubscribe(){D--,J();let W=U.findIndex((z)=>z===Q);if(W>-1)U.splice(W,1)}}})}}var QC=Symbol();function x0($){let v=$,D=[],X=(J)=>{if(v!==void 0)J.next(v);D.push(J)},U=(J)=>{D.splice(D.indexOf(J),1)},G=z4((J)=>{return X(J),()=>{U(J)}});return G.next=(J)=>{if(v===J)return;v=J;for(let Q of D)Q.next(J)},G.get=()=>v,G}function b7($){return z4((v)=>{function D(U=0,G=$.op){let J=$.links[U];if(!J)throw Error("No more links to execute - did you forget to add an ending link?");return J({op:G,next(W){return D(U+1,W)}})}return D().subscribe(v)})}function C4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function f0(){return Object.create(null)}var u6={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 q7=[u6.BAD_GATEWAY,u6.SERVICE_UNAVAILABLE,u6.GATEWAY_TIMEOUT,u6.INTERNAL_SERVER_ERROR];var{create:aH,defineProperty:k7,getOwnPropertyDescriptor:eH,getOwnPropertyNames:E7,getPrototypeOf:sH}=Object,$3=Object.prototype.hasOwnProperty,r1=($,v)=>function(){return v||(0,$[E7($)[0]])((v={exports:{}}).exports,v),v.exports},v3=($,v,D,X)=>{if(v&&typeof v==="object"||typeof v==="function"){for(var U=E7(v),G=0,J=U.length,Q;G<J;G++)if(Q=U[G],!$3.call($,Q)&&Q!==D)k7($,Q,{get:((W)=>v[W]).bind(null,Q),enumerable:!(X=eH(v,Q))||X.enumerable})}return $},d1=($,v,D)=>(D=$!=null?aH(sH($)):{},v3(v||!$||!$.__esModule?k7(D,"default",{value:$,enumerable:!0}):D,$)),T7=()=>{},S7=($)=>{if(Object.freeze)Object.freeze($)};function R7($,v,D){var X;let U=v.join(".");return(X=D[U])!==null&&X!==void 0||(D[U]=new Proxy(T7,{get(G,J){if(typeof J!=="string"||J==="then")return;return R7($,[...v,J],D)},apply(G,J,Q){let W=v[v.length-1];if(W==="valueOf"||W==="toString"||W==="toJSON")return`tRPC.proxy(${v.slice(0,-1).join(".")})`;let z={args:Q,path:v};if(W==="call")z={args:Q.length>=2?[Q[1]]:[],path:v.slice(0,-1)};else if(W==="apply")z={args:Q.length>=2?Q[1]:[],path:v.slice(0,-1)};return S7(z.args),S7(z.path),$(z)}})),D[U]}var _0=($)=>R7($,[],f0()),XG=($)=>{return new Proxy(T7,{get(v,D){if(D==="then")return;return $(D)}})};var g7=r1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,v){function D(X){return v.exports=D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},v.exports.__esModule=!0,v.exports.default=v.exports,D(X)}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),U3=r1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,v){var D=g7().default;function X(U,G){if(D(U)!="object"||!U)return U;var J=U[Symbol.toPrimitive];if(J!==void 0){var Q=J.call(U,G||"default");if(D(Q)!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(G==="string"?String:Number)(U)}v.exports=X,v.exports.__esModule=!0,v.exports.default=v.exports}}),D3=r1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,v){var D=g7().default,X=U3();function U(G){var J=X(G,"string");return D(J)=="symbol"?J:J+""}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}}),GG=r1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,v){var D=D3();function X(U,G,J){return(G=D(G))in U?Object.defineProperty(U,G,{value:J,enumerable:!0,configurable:!0,writable:!0}):U[G]=J,U}v.exports=X,v.exports.__esModule=!0,v.exports.default=v.exports}}),i0=r1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,v){var D=GG();function X(G,J){var Q=Object.keys(G);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(G);J&&(W=W.filter(function(z){return Object.getOwnPropertyDescriptor(G,z).enumerable})),Q.push.apply(Q,W)}return Q}function U(G){for(var J=1;J<arguments.length;J++){var Q=arguments[J]!=null?arguments[J]:{};J%2?X(Object(Q),!0).forEach(function(W){D(G,W,Q[W])}):Object.getOwnPropertyDescriptors?Object.defineProperties(G,Object.getOwnPropertyDescriptors(Q)):X(Object(Q)).forEach(function(W){Object.defineProperty(G,W,Object.getOwnPropertyDescriptor(Q,W))})}return G}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}}),AC=d1(i0(),1);var bC=d1(GG(),1);var y0=d1(i0(),1);function J3($,v){if("error"in $){let X=v.deserialize($.error);return{ok:!1,error:(0,y0.default)((0,y0.default)({},$),{},{error:X})}}return{ok:!0,result:(0,y0.default)((0,y0.default)({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:v.deserialize($.result.data)})}}var JG=class extends Error{constructor(){super("Unable to transform response from server")}};function QG($,v){let D;try{D=J3($,v)}catch(X){throw new JG}if(!D.ok&&(!C4(D.error.error)||typeof D.error.error.code!=="number"))throw new JG;if(D.ok&&!C4(D.result))throw new JG;return D}var qC=d1(i0(),1);var SC=Symbol();var n0=$$(F4(),1),C6=$$(H$(),1);function u7($){return $ instanceof j4}function Y3($){return C4($)&&C4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function I3($,v){if(typeof $==="string")return $;if(C4($)&&typeof $.message==="string")return $.message;return v}var j4=class $ extends Error{constructor(v,D){var X,U;let G=D===null||D===void 0?void 0:D.cause;super(v,{cause:G});(0,n0.default)(this,"cause",void 0),(0,n0.default)(this,"shape",void 0),(0,n0.default)(this,"data",void 0),(0,n0.default)(this,"meta",void 0),this.meta=D===null||D===void 0?void 0:D.meta,this.cause=G,this.shape=D===null||D===void 0||(X=D.result)===null||X===void 0?void 0:X.error,this.data=D===null||D===void 0||(U=D.result)===null||U===void 0?void 0:U.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(v,D={}){let X=v;if(u7(X)){if(D.meta)X.meta=(0,C6.default)((0,C6.default)({},X.meta),D.meta);return X}if(Y3(X))return new $(X.error.message,(0,C6.default)((0,C6.default)({},D),{},{result:X,cause:D.cause}));return new $(I3(X,"Unknown error"),(0,C6.default)((0,C6.default)({},D),{},{cause:X}))}};function l0($){let v=$;if(!v)return{input:{serialize:(D)=>D,deserialize:(D)=>D},output:{serialize:(D)=>D,deserialize:(D)=>D}};if("input"in v)return v;return{input:v,output:v}}var C7=($)=>typeof $==="function";function x7($){if($)return $;if(typeof window<"u"&&C7(window.fetch))return window.fetch;if(typeof globalThis<"u"&&C7(globalThis.fetch))return globalThis.fetch;throw Error("No fetch implementation found")}var p1=$$(H$());function h0($){return{url:$.url.toString(),fetch:$.fetch,transformer:l0($.transformer),methodOverride:$.methodOverride}}function V3($){let v={};for(let D=0;D<$.length;D++){let X=$[D];v[D]=X}return v}var B3={query:"GET",mutation:"POST",subscription:"PATCH"};function f7($){return"input"in $?$.transformer.input.serialize($.input):V3($.inputs.map((v)=>$.transformer.input.serialize(v)))}var t1=($)=>{let v=$.url.split("?"),X=v[0].replace(/\/$/,"")+"/"+$.path,U=[];if(v[1])U.push(v[1]);if("inputs"in $)U.push("batch=1");if($.type==="query"||$.type==="subscription"){let G=f7($);if(G!==void 0&&$.methodOverride!=="POST")U.push(`input=${encodeURIComponent(JSON.stringify(G))}`)}if(U.length)X+="?"+U.join("&");return X},_7=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let v=f7($);return v!==void 0?JSON.stringify(v):void 0},WG=($)=>{return y7((0,p1.default)((0,p1.default)({},$),{},{contentTypeHeader:"application/json",getUrl:t1,getBody:_7}))},L3=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},K3=($)=>{var v;if(!($===null||$===void 0?void 0:$.aborted))return;if((v=$.throwIfAborted)===null||v===void 0||v.call($),typeof DOMException<"u")throw new DOMException("AbortError","AbortError");throw new L3};async function i7($){var v,D;K3($.signal);let X=$.getUrl($),U=$.getBody($),G=(v=$.methodOverride)!==null&&v!==void 0?v:B3[$.type],J=await(async()=>{let W=await $.headers();if(Symbol.iterator in W)return Object.fromEntries(W);return W})(),Q=(0,p1.default)((0,p1.default)((0,p1.default)({},$.contentTypeHeader&&G!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(D=$.trpcAcceptHeaderKey)!==null&&D!==void 0?D:"trpc-accept"]:$.trpcAcceptHeader}:void 0),J);return x7($.fetch)(X,{method:G,signal:$.signal,body:U,headers:Q})}async function y7($){let v={},D=await i7($);v.response=D;let X=await D.json();return v.responseJSON=X,{json:X,meta:v}}var fx=$$(H$(),1);var n7=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function zG($){let v=null,D=null,X=()=>{clearTimeout(D),D=null,v=null};function U(Q){let W=[[]],z=0;while(!0){let V=Q[z];if(!V)break;let B=W[W.length-1];if(V.aborted){var Y;(Y=V.reject)===null||Y===void 0||Y.call(V,Error("Aborted")),z++;continue}if($.validate(B.concat(V).map((N)=>N.key))){B.push(V),z++;continue}if(B.length===0){var I;(I=V.reject)===null||I===void 0||I.call(V,Error("Input is too big for a single dispatch")),z++;continue}W.push([])}return W}function G(){let Q=U(v);X();for(let W of Q){if(!W.length)continue;let z={items:W};for(let I of W)I.batch=z;$.fetch(z.items.map((I)=>I.key)).then(async(I)=>{await Promise.all(I.map(async(B,L)=>{let N=z.items[L];try{var Z;let S=await Promise.resolve(B);(Z=N.resolve)===null||Z===void 0||Z.call(N,S)}catch(S){var F;(F=N.reject)===null||F===void 0||F.call(N,S)}N.batch=null,N.reject=null,N.resolve=null}));for(let B of z.items){var V;(V=B.reject)===null||V===void 0||V.call(B,Error("Missing result")),B.batch=null}}).catch((I)=>{for(let B of z.items){var V;(V=B.reject)===null||V===void 0||V.call(B,I),B.batch=null}})}}function J(Q){var W;let z={aborted:!1,key:Q,batch:null,resolve:n7,reject:n7},Y=new Promise((I,V)=>{var B;z.reject=V,z.resolve=I,(B=v)!==null&&B!==void 0||(v=[]),v.push(z)});return(W=D)!==null&&W!==void 0||(D=setTimeout(G)),Y}return{load:J}}function l7(...$){let v=new AbortController,D=$.length,X=0,U=()=>{if(++X===D)v.abort()};for(let G of $)if(G===null||G===void 0?void 0:G.aborted)U();else G===null||G===void 0||G.addEventListener("abort",U,{once:!0});return v.signal}var m0=$$(H$(),1);function YG($){var v,D;let X=h0($),U=(v=$.maxURLLength)!==null&&v!==void 0?v:1/0,G=(D=$.maxItems)!==null&&D!==void 0?D:1/0;return()=>{let J=(Y)=>{return{validate(I){if(U===1/0&&G===1/0)return!0;if(I.length>G)return!1;let V=I.map((N)=>N.path).join(","),B=I.map((N)=>N.input);return t1((0,m0.default)((0,m0.default)({},X),{},{type:Y,path:V,inputs:B,signal:null})).length<=U},async fetch(I){let V=I.map((S)=>S.path).join(","),B=I.map((S)=>S.input),L=l7(...I.map((S)=>S.signal)),N=await WG((0,m0.default)((0,m0.default)({},X),{},{path:V,inputs:B,type:Y,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({opList:I});return $.headers},signal:L}));return(Array.isArray(N.json)?N.json:I.map(()=>N.json)).map((S)=>({meta:N.meta,json:S}))}}},Q=zG(J("query")),W=zG(J("mutation")),z={query:Q,mutation:W};return({op:Y})=>{return z4((I)=>{if(Y.type==="subscription")throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let B=z[Y.type].load(Y),L=void 0;return B.then((N)=>{L=N;let Z=QG(N.json,X.transformer.output);if(!Z.ok){I.error(j4.from(Z.error,{meta:N.meta}));return}I.next({context:N.meta,result:Z.result}),I.complete()}).catch((N)=>{I.error(j4.from(N,{meta:L===null||L===void 0?void 0:L.meta}))}),()=>{}})}}}var rx=$$(H$(),1);var IG=($,...v)=>{return typeof $==="function"?$(...v):$},ex=$$(F4(),1);function N3(){let $,v;return{promise:new Promise((X,U)=>{$=X,v=U}),resolve:$,reject:v}}async function Z3($){let v=await IG($.url);if(!$.connectionParams)return v;let X=`${v.includes("?")?"&":"?"}connectionParams=1`;return v+X}async function O3($,v){let D={method:"connectionParams",data:await IG($)};return v.encode(D)}var sx=$$(F4(),1);var d4=$$(F4(),1);function H3($){let{promise:v,resolve:D,reject:X}=N3();return $.addEventListener("open",()=>{$.removeEventListener("error",X),D()}),$.addEventListener("error",X),v}function F3($,{intervalMs:v,pongTimeoutMs:D}){let X,U;function G(){X=setTimeout(()=>{$.send("PING"),U=setTimeout(()=>{$.close()},D)},v)}function J(){clearTimeout(X),G()}function Q(){clearTimeout(U),J()}$.addEventListener("open",G),$.addEventListener("message",({data:W})=>{if(clearTimeout(X),G(),W==="PONG")Q()}),$.addEventListener("close",()=>{clearTimeout(X),clearTimeout(U)})}var j3=class ${constructor(v){var D;if((0,d4.default)(this,"id",++$.connectCount),(0,d4.default)(this,"WebSocketPonyfill",void 0),(0,d4.default)(this,"urlOptions",void 0),(0,d4.default)(this,"keepAliveOpts",void 0),(0,d4.default)(this,"encoder",void 0),(0,d4.default)(this,"wsObservable",x0(null)),(0,d4.default)(this,"openPromise",null),this.WebSocketPonyfill=(D=v.WebSocketPonyfill)!==null&&D!==void 0?D:WebSocket,!this.WebSocketPonyfill)throw 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=v.urlOptions,this.keepAliveOpts=v.keepAlive,this.encoder=v.encoder}get ws(){return this.wsObservable.get()}set ws(v){this.wsObservable.next(v)}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 v=this;if(v.openPromise)return v.openPromise;v.id=++$.connectCount;let D=Z3(v.urlOptions).then((X)=>new v.WebSocketPonyfill(X));v.openPromise=D.then(async(X)=>{if(v.ws=X,X.binaryType="arraybuffer",X.addEventListener("message",function({data:U}){if(U==="PING")this.send("PONG")}),v.keepAliveOpts.enabled)F3(X,v.keepAliveOpts);if(X.addEventListener("close",()=>{if(v.ws===X)v.ws=null}),await H3(X),v.urlOptions.connectionParams)X.send(await O3(v.urlOptions.connectionParams,v.encoder))});try{await v.openPromise}finally{v.openPromise=null}}async close(){var v=this;try{await v.openPromise}finally{var D;(D=v.ws)===null||D===void 0||D.close()}}};(0,d4.default)(j3,"connectCount",0);var $f=$$(F4(),1),vf=$$(H$(),1);var VG=$$(F4(),1),h7=$$(H$(),1),A3=class{constructor($){(0,VG.default)(this,"links",void 0),(0,VG.default)(this,"runtime",void 0),(0,VG.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((v)=>v(this.runtime))}$request($){var v;return b7({links:this.links,op:(0,h7.default)((0,h7.default)({},$),{},{context:(v=$.context)!==null&&v!==void 0?v:{},id:++this.requestId})}).pipe(DG())}async requestAsPromise($){var v=this;try{let D=v.$request($);return(await UG(D)).result.data}catch(D){throw j4.from(D)}}query($,v,D){return this.requestAsPromise({type:"query",path:$,input:v,context:D===null||D===void 0?void 0:D.context,signal:D===null||D===void 0?void 0:D.signal})}mutation($,v,D){return this.requestAsPromise({type:"mutation",path:$,input:v,context:D===null||D===void 0?void 0:D.context,signal:D===null||D===void 0?void 0:D.signal})}subscription($,v,D){return this.$request({type:"subscription",path:$,input:v,context:D.context,signal:D.signal}).subscribe({next(U){switch(U.result.type){case"state":{var G;(G=D.onConnectionStateChange)===null||G===void 0||G.call(D,U.result);break}case"started":{var J;(J=D.onStarted)===null||J===void 0||J.call(D,{context:U.context});break}case"stopped":{var Q;(Q=D.onStopped)===null||Q===void 0||Q.call(D);break}case"data":case void 0:{var W;(W=D.onData)===null||W===void 0||W.call(D,U.result.data);break}}},error(U){var G;(G=D.onError)===null||G===void 0||G.call(D,U)},complete(){var U;(U=D.onComplete)===null||U===void 0||U.call(D)}})}};var w3=Symbol.for("trpc_untypedClient"),M3={query:"query",mutate:"mutation",subscribe:"subscription"},P3=($)=>{return M3[$]};function b3($){let v=_0(({path:D,args:X})=>{let U=[...D],G=P3(U.pop()),J=U.join(".");return $[G](J,...X)});return XG((D)=>{if(D===w3)return $;return v[D]})}function r7($){let v=new A3($);return b3(v)}var Ef=$$(H$(),1);var m7=$$(H$(),1);function q3($,v){if(!v)return $;if($!=null&&typeof $!=="object")return $;return(0,m7.default)((0,m7.default)({},$!==null&&$!==void 0?$:{}),{},{lastEventId:v})}var S3=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,v){function D(U){var G,J,Q,W=2;for(typeof Symbol<"u"&&(J=Symbol.asyncIterator,Q=Symbol.iterator);W--;){if(J&&(G=U[J])!=null)return G.call(U);if(Q&&(G=U[Q])!=null)return new X(G.call(U));J="@@asyncIterator",Q="@@iterator"}throw TypeError("Object is not async iterable")}function X(U){function G(J){if(Object(J)!==J)return Promise.reject(TypeError(J+" is not an object."));var Q=J.done;return Promise.resolve(J.value).then(function(W){return{value:W,done:Q}})}return X=function(Q){this.s=Q,this.n=Q.next},X.prototype={s:null,n:null,next:function(){return G(this.n.apply(this.s,arguments))},return:function(Q){var W=this.s.return;return W===void 0?Promise.resolve({value:Q,done:!0}):G(W.apply(this.s,arguments))},throw:function(Q){var W=this.s.return;return W===void 0?Promise.reject(Q):G(W.apply(this.s,arguments))}},new X(U)}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),Tf=$$(S3(),1);var c7=$$(H$(),1);function d7($){return()=>{return(v)=>{return z4((D)=>{let X,U=void 0,G=void 0;Q(1);function J(){let W=v.op;if(!G)return W;return(0,c7.default)((0,c7.default)({},W),{},{input:q3(W.input,G)})}function Q(W){let z=J();X=v.next(z).subscribe({error(Y){var I,V;if(!$.retry({op:z,attempts:W,error:Y})){D.error(Y);return}let L=(I=(V=$.retryDelayMs)===null||V===void 0?void 0:V.call($,W))!==null&&I!==void 0?I:0;if(L<=0){Q(W+1);return}U=setTimeout(()=>Q(W+1),L)},next(Y){if((!Y.result.type||Y.result.type==="data")&&Y.result.id)G=Y.result.id;D.next(Y)},complete(){D.complete()}})}return()=>{X.unsubscribe(),clearTimeout(U)}})}}}var k3=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,v){function D(){var X=typeof SuppressedError=="function"?SuppressedError:function(Q,W){var z=Error();return z.name="SuppressedError",z.error=Q,z.suppressed=W,z},U={},G=[];function J(Q,W){if(W!=null){if(Object(W)!==W)throw TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(Q)var z=W[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(z===void 0&&(z=W[Symbol.dispose||Symbol.for("Symbol.dispose")],Q))var Y=z;if(typeof z!="function")throw TypeError("Object is not disposable.");Y&&(z=function(){try{Y.call(W)}catch(V){return Promise.reject(V)}}),G.push({v:W,d:z,a:Q})}else Q&&G.push({d:W,a:Q});return W}return{e:U,u:J.bind(null,!1),a:J.bind(null,!0),d:function(){var W,z=this.e,Y=0;function I(){for(;W=G.pop();)try{if(!W.a&&Y===1)return Y=0,G.push(W),Promise.resolve().then(I);if(W.d){var B=W.d.call(W.v);if(W.a)return Y|=2,Promise.resolve(B).then(I,V)}else Y|=1}catch(L){return V(L)}if(Y===1)return z!==U?Promise.reject(z):Promise.resolve();if(z!==U)throw z}function V(B){return z=z!==U?new X(B,z):B,I()}return I()}}}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),p7=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,v){function D(X,U){this.v=X,this.k=U}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),E3=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,v){var D=p7();function X(U){return new D(U,0)}v.exports=X,v.exports.__esModule=!0,v.exports.default=v.exports}}),T3=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,v){var D=p7();function X(G){return function(){return new U(G.apply(this,arguments))}}function U(G){var J,Q;function W(Y,I){try{var V=G[Y](I),B=V.value,L=B instanceof D;Promise.resolve(L?B.v:B).then(function(N){if(L){var Z=Y==="return"?"return":"next";if(!B.k||N.done)return W(Z,N);N=G[Z](N).value}z(V.done?"return":"normal",N)},function(N){W("throw",N)})}catch(N){z("throw",N)}}function z(Y,I){switch(Y){case"return":J.resolve({value:I,done:!0});break;case"throw":J.reject(I);break;default:J.resolve({value:I,done:!1})}(J=J.next)?W(J.key,J.arg):Q=null}this._invoke=function(Y,I){return new Promise(function(V,B){var L={key:Y,arg:I,resolve:V,reject:B,next:null};Q?Q=Q.next=L:(J=Q=L,W(Y,I))})},typeof G.return!="function"&&(this.return=void 0)}U.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},U.prototype.next=function(G){return this._invoke("next",G)},U.prototype.throw=function(G){return this._invoke("throw",G)},U.prototype.return=function(G){return this._invoke("return",G)},v.exports=X,v.exports.__esModule=!0,v.exports.default=v.exports}}),Rf=$$(k3(),1),gf=$$(E3(),1),uf=$$(T3(),1),Cf=$$(H$(),1);var R3=4,g3=300,u3=4000;function BG($){if(!($ instanceof j4))return!1;let v=$.data;return v?.code==="TOO_MANY_REQUESTS"||v?.httpStatus===429}function p4($,v,D={}){return r7({links:[d7({retry:({op:X,error:U,attempts:G})=>X.type==="query"&&G<R3&&BG(U),retryDelayMs:(X)=>Math.min(g3*2**X,u3)}),YG({url:$,...D.fetch?{fetch:D.fetch}:{},headers:async()=>{let X=await v();return X?{authorization:`Bearer ${X}`}:{}}})]})}function c0($){let v=/^(\d+)\.(\d+)\.(\d+)/.exec($.trim());if(!v)return null;return[Number(v[1]),Number(v[2]),Number(v[3])]}function r0($,v){let D=c0($),X=c0(v);if(!D||!X)return 0;for(let U=0;U<3;U++){let G=D[U],J=X[U];if(G!==J)return G<J?-1:1}return 0}function LG($){let{ownVersion:v,minVersion:D,latestVersion:X}=$;if(D&&r0(v,D)<0)return{blocked:!0,blockedMessage:`This Aether Wealth MCP (v${v}) is below the minimum supported version (v${D}) and can no longer be used. Update it and restart your MCP client:
|
|
27
|
+
npm install -g @aetherwealth/mcp@latest`};if(X&&r0(v,X)<0)return{blocked:!1,nudge:`A newer Aether Wealth MCP is available (v${v} -> v${X}). Update for the latest tools:
|
|
28
|
+
npm install -g @aetherwealth/mcp@latest`};return{blocked:!1}}async function d0($){let v=`https://registry.npmjs.org/${encodeURIComponent($)}/latest`,D=new AbortController,X=setTimeout(()=>D.abort(),4000);try{let U=await fetch(v,{signal:D.signal});if(!U.ok)return null;let G=await U.json();return typeof G.version==="string"?G.version:null}catch{return null}finally{clearTimeout(X)}}var t7=5000;function o7($,v,D){return new Promise((X)=>{let U=setTimeout(()=>X(D),v),G=(J)=>{clearTimeout(U),X(J)};$.then(G,()=>G(D))})}async function p0($){let[v,D]=await Promise.all([o7($.fetchMinVersion(),t7,null),o7($.fetchLatestVersion(),t7,null)]);return LG({ownVersion:$.ownVersion,minVersion:v,latestVersion:D})}var a7="https://api.aetherwealth.ai",e7="http://localhost:9006",x4="https://app.aetherwealth.ai";function C3($){let v=$.NODE_ENV;return v==="development"||v==="test"}function s7($){let v=$.AETHER_BASE_URL,D="";if(v&&v.trim().length>0)D=v.trim();else if(C3($))D=e7;else D=a7;let X;try{X=new URL(D)}catch{return{config:null,errors:[`AETHER_BASE_URL is not a valid URL: "${D}"`]}}if(X.protocol!=="https:"&&!u4(X.hostname))return{config:null,errors:[`AETHER_BASE_URL must use https (loopback hosts exempt): "${D}"`]};let U=D.replace(/\/$/,"");return{config:{baseUrl:U,trpcUrl:`${U}/trpc`,host:X.host},errors:[]}}var $Y="@aetherwealth/mcp";function vY($={}){let v=$.maxPerWindow??120,D=$.now??Date.now,X=new Map;return{check(U){let G=U.startsWith("ip:")?v*4:v,J=D(),Q=X.get(U);if(!Q||J-Q.windowStart>=60000){if(X.size>=1e4){let W=X.keys().next().value;if(W!==void 0)X.delete(W)}return X.delete(U),X.set(U,{windowStart:J,count:1}),{allowed:!0}}if(Q.count>=G)return{allowed:!1,retryAfterSeconds:Math.max(1,Math.ceil((Q.windowStart+60000-J)/1000))};return Q.count+=1,{allowed:!0}}}}function UY($){let v=async()=>{throw Error("hosted mode: tool invoked without a per-request context (wiring bug)")};return{session:{getAccessToken:v,getUserId:v,login:v,logout:v},trpc:p4($,v)}}var x3=60000,f3=1000,_3=4000;function DY($){let v=$.fetchImpl??fetch,D=$.now??Date.now,X=$.ttlMs??x3,U=`${$.baseUrl.replace(/\/$/,"")}${m1}`,G=new Map,J=new Map,Q=async(W)=>{let z=await i3(U,W,v);if(!z.ok)return z;if(G.size>=f3){let Y=G.keys().next().value;if(Y!==void 0)G.delete(Y)}return G.set(W,{userId:z.userId,expiresAt:D()+X}),z};return{async verify(W){let z=G.get(W);if(z&&z.expiresAt>D())return{ok:!0,userId:z.userId};G.delete(W);let Y=J.get(W);if(Y)return Y;let I=Q(W);J.set(W,I);try{return await I}finally{J.delete(W)}},invalidate(W){G.delete(W)}}}async function i3($,v,D){let X=new AbortController,U=setTimeout(()=>X.abort(),_3),G;try{G=await D($,{method:"GET",headers:{authorization:`Bearer ${v}`,accept:"application/json"},signal:X.signal})}catch(Q){throw Error(`token verification could not reach userinfo at ${$}`,{cause:Q})}finally{clearTimeout(U)}if(G.status===401||G.status===403)return{ok:!1};if(!G.ok)throw Error(`token verification failed upstream (HTTP ${G.status})`);let J=(await H4(G)).sub;if(typeof J!=="string"||J.length===0)throw Error("userinfo response did not include a user id");return{ok:!0,userId:J}}import{timingSafeEqual as oO}from"node:crypto";import{createServer as Tg}from"node:http";var c={};R4(c,{xor:()=>nI,xid:()=>VI,void:()=>fI,uuidv7:()=>XI,uuidv6:()=>DI,uuidv4:()=>UI,uuid:()=>vI,util:()=>w,url:()=>GI,uppercase:()=>p6,unknown:()=>D$,union:()=>X$,undefined:()=>CI,ulid:()=>II,uint64:()=>gI,uint32:()=>EI,tuple:()=>EW,trim:()=>$1,treeifyError:()=>qG,transform:()=>FD,toUpperCase:()=>U1,toLowerCase:()=>v1,toJSONSchema:()=>dU,templateLiteral:()=>sI,symbol:()=>uI,superRefine:()=>Dz,success:()=>tI,stringbool:()=>JV,stringFormat:()=>wI,string:()=>H,strictObject:()=>yI,startsWith:()=>o6,slugify:()=>D1,size:()=>A6,setErrorMap:()=>IA,set:()=>cI,safeParseAsync:()=>WW,safeParse:()=>QW,safeEncodeAsync:()=>KW,safeEncode:()=>BW,safeDecodeAsync:()=>NW,safeDecode:()=>LW,registry:()=>OU,regexes:()=>a$,regex:()=>r6,refine:()=>Uz,record:()=>s,readonly:()=>oW,property:()=>hU,promise:()=>$V,prettifyError:()=>SG,preprocess:()=>uv,prefault:()=>lW,positive:()=>iU,pipe:()=>$D,partialRecord:()=>lI,parseAsync:()=>JW,parse:()=>GW,overwrite:()=>Y4,optional:()=>J$,object:()=>q,number:()=>t,nullish:()=>pI,nullable:()=>wv,null:()=>bv,normalize:()=>s6,nonpositive:()=>nU,nonoptional:()=>hW,nonnegative:()=>lU,never:()=>HD,negative:()=>yU,nativeEnum:()=>rI,nanoid:()=>WI,nan:()=>oI,multipleOf:()=>s4,minSize:()=>P4,minLength:()=>_4,mime:()=>e6,meta:()=>XV,maxSize:()=>$6,maxLength:()=>w6,map:()=>mI,mac:()=>KI,lte:()=>e$,lt:()=>w4,lowercase:()=>d6,looseRecord:()=>hI,looseObject:()=>w$,locales:()=>Ov,literal:()=>E,length:()=>M6,lazy:()=>sW,ksuid:()=>BI,keyof:()=>iI,jwt:()=>AI,json:()=>QV,iso:()=>X6,ipv6:()=>NI,ipv4:()=>LI,invertCodec:()=>eI,intersection:()=>B1,int64:()=>RI,int32:()=>kI,int:()=>sU,instanceof:()=>GV,includes:()=>t6,httpUrl:()=>JI,hostname:()=>MI,hex:()=>PI,hash:()=>bI,guid:()=>$I,gte:()=>x$,gt:()=>M4,globalRegistry:()=>A$,getErrorMap:()=>VA,function:()=>vV,fromJSONSchema:()=>zV,formatError:()=>Xv,float64:()=>SI,float32:()=>qI,flattenError:()=>Dv,file:()=>dI,exactOptional:()=>fW,enum:()=>M$,endsWith:()=>a6,encodeAsync:()=>IW,encode:()=>zW,emoji:()=>QI,email:()=>sY,e164:()=>jI,discriminatedUnion:()=>Ev,describe:()=>DV,decodeAsync:()=>VW,decode:()=>YW,date:()=>_I,custom:()=>wD,cuid2:()=>YI,cuid:()=>zI,core:()=>i4,config:()=>V$,coerce:()=>Gz,codec:()=>aI,clone:()=>u$,cidrv6:()=>OI,cidrv4:()=>ZI,check:()=>UV,catch:()=>rW,boolean:()=>B$,bigint:()=>TI,base64url:()=>FI,base64:()=>HI,array:()=>m,any:()=>xI,_function:()=>vV,_default:()=>yW,_ZodString:()=>vD,ZodXor:()=>bW,ZodXID:()=>WD,ZodVoid:()=>MW,ZodUnknown:()=>AW,ZodUnion:()=>kv,ZodUndefined:()=>HW,ZodUUID:()=>b4,ZodURL:()=>Pv,ZodULID:()=>QD,ZodType:()=>y,ZodTuple:()=>kW,ZodTransform:()=>CW,ZodTemplateLiteral:()=>aW,ZodSymbol:()=>OW,ZodSuccess:()=>mW,ZodStringFormat:()=>U$,ZodString:()=>W1,ZodSet:()=>RW,ZodRecord:()=>J1,ZodRealError:()=>h$,ZodReadonly:()=>tW,ZodPromise:()=>$z,ZodPreprocess:()=>pW,ZodPrefault:()=>nW,ZodPipe:()=>Tv,ZodOptional:()=>jD,ZodObject:()=>Sv,ZodNumberFormat:()=>P6,ZodNumber:()=>Y1,ZodNullable:()=>_W,ZodNull:()=>FW,ZodNonOptional:()=>AD,ZodNever:()=>wW,ZodNanoID:()=>XD,ZodNaN:()=>dW,ZodMap:()=>TW,ZodMAC:()=>ZW,ZodLiteral:()=>gW,ZodLazy:()=>eW,ZodKSUID:()=>zD,ZodJWT:()=>ZD,ZodIssueCode:()=>YA,ZodIntersection:()=>SW,ZodISOTime:()=>aU,ZodISODuration:()=>eU,ZodISODateTime:()=>tU,ZodISODate:()=>oU,ZodIPv6:()=>ID,ZodIPv4:()=>YD,ZodGUID:()=>Av,ZodFunction:()=>vz,ZodFirstPartyTypeKind:()=>Xz,ZodFile:()=>uW,ZodExactOptional:()=>xW,ZodError:()=>WA,ZodEnum:()=>Q1,ZodEmoji:()=>DD,ZodEmail:()=>UD,ZodE164:()=>ND,ZodDiscriminatedUnion:()=>qW,ZodDefault:()=>iW,ZodDate:()=>qv,ZodCustomStringFormat:()=>z1,ZodCustom:()=>gv,ZodCodec:()=>Rv,ZodCatch:()=>cW,ZodCUID2:()=>JD,ZodCUID:()=>GD,ZodCIDRv6:()=>BD,ZodCIDRv4:()=>VD,ZodBoolean:()=>I1,ZodBigIntFormat:()=>OD,ZodBigInt:()=>V1,ZodBase64URL:()=>KD,ZodBase64:()=>LD,ZodArray:()=>PW,ZodAny:()=>jW,TimePrecision:()=>uQ,NEVER:()=>KG,$output:()=>SQ,$input:()=>kQ,$brand:()=>NG});var i4={};R4(i4,{version:()=>AJ,util:()=>w,treeifyError:()=>qG,toJSONSchema:()=>dU,toDotPath:()=>YY,safeParseAsync:()=>Qv,safeParse:()=>l6,safeEncodeAsync:()=>ZY,safeEncode:()=>KY,safeDecodeAsync:()=>OY,safeDecode:()=>NY,registry:()=>OU,regexes:()=>a$,process:()=>e,prettifyError:()=>SG,parseAsync:()=>Jv,parse:()=>Gv,meta:()=>L9,locales:()=>Ov,isValidJWT:()=>yY,isValidBase64URL:()=>iY,isValidBase64:()=>mJ,initializeContext:()=>v6,globalRegistry:()=>A$,globalConfig:()=>Z6,formatError:()=>Xv,flattenError:()=>Dv,finalize:()=>D6,extractDefs:()=>U6,encodeAsync:()=>BY,encode:()=>IY,describe:()=>B9,decodeAsync:()=>LY,decode:()=>VY,createToJSONSchemaMethod:()=>N9,createStandardJSONSchemaMethod:()=>G1,config:()=>V$,clone:()=>u$,_xor:()=>_j,_xid:()=>kU,_void:()=>X9,_uuidv7:()=>wU,_uuidv6:()=>AU,_uuidv4:()=>jU,_uuid:()=>FU,_url:()=>Fv,_uppercase:()=>p6,_unknown:()=>U9,_union:()=>fj,_undefined:()=>sQ,_ulid:()=>SU,_uint64:()=>aQ,_uint32:()=>cQ,_tuple:()=>nj,_trim:()=>$1,_transform:()=>pj,_toUpperCase:()=>U1,_toLowerCase:()=>v1,_templateLiteral:()=>DA,_symbol:()=>eQ,_superRefine:()=>V9,_success:()=>sj,_stringbool:()=>K9,_stringFormat:()=>X1,_string:()=>TQ,_startsWith:()=>o6,_slugify:()=>D1,_size:()=>A6,_set:()=>mj,_safeParseAsync:()=>h6,_safeParse:()=>n6,_safeEncodeAsync:()=>DU,_safeEncode:()=>vU,_safeDecodeAsync:()=>XU,_safeDecode:()=>UU,_regex:()=>r6,_refine:()=>I9,_record:()=>lj,_readonly:()=>UA,_property:()=>hU,_promise:()=>GA,_positive:()=>iU,_pipe:()=>vA,_parseAsync:()=>y6,_parse:()=>i6,_overwrite:()=>Y4,_optional:()=>tj,_number:()=>iQ,_nullable:()=>oj,_null:()=>$9,_normalize:()=>s6,_nonpositive:()=>nU,_nonoptional:()=>ej,_nonnegative:()=>lU,_never:()=>D9,_negative:()=>yU,_nativeEnum:()=>rj,_nanoid:()=>PU,_nan:()=>Q9,_multipleOf:()=>s4,_minSize:()=>P4,_minLength:()=>_4,_min:()=>x$,_mime:()=>e6,_maxSize:()=>$6,_maxLength:()=>w6,_max:()=>e$,_map:()=>hj,_mac:()=>gQ,_lte:()=>e$,_lt:()=>w4,_lowercase:()=>d6,_literal:()=>dj,_length:()=>M6,_lazy:()=>XA,_ksuid:()=>EU,_jwt:()=>_U,_isoTime:()=>fQ,_isoDuration:()=>_Q,_isoDateTime:()=>CQ,_isoDate:()=>xQ,_ipv6:()=>RU,_ipv4:()=>TU,_intersection:()=>yj,_int64:()=>oQ,_int32:()=>mQ,_int:()=>nQ,_includes:()=>t6,_guid:()=>Hv,_gte:()=>x$,_gt:()=>M4,_float64:()=>hQ,_float32:()=>lQ,_file:()=>z9,_enum:()=>cj,_endsWith:()=>a6,_encodeAsync:()=>s0,_encode:()=>a0,_emoji:()=>MU,_email:()=>HU,_e164:()=>fU,_discriminatedUnion:()=>ij,_default:()=>aj,_decodeAsync:()=>$U,_decode:()=>e0,_date:()=>G9,_custom:()=>Y9,_cuid2:()=>qU,_cuid:()=>bU,_coercedString:()=>RQ,_coercedNumber:()=>yQ,_coercedDate:()=>J9,_coercedBoolean:()=>dQ,_coercedBigint:()=>tQ,_cidrv6:()=>uU,_cidrv4:()=>gU,_check:()=>tY,_catch:()=>$A,_boolean:()=>rQ,_bigint:()=>pQ,_base64url:()=>xU,_base64:()=>CU,_array:()=>W9,_any:()=>v9,TimePrecision:()=>uQ,NEVER:()=>KG,JSONSchemaGenerator:()=>$W,JSONSchema:()=>oY,Doc:()=>WU,$output:()=>SQ,$input:()=>kQ,$constructor:()=>K,$brand:()=>NG,$ZodXor:()=>W8,$ZodXID:()=>gJ,$ZodVoid:()=>X8,$ZodUnknown:()=>U8,$ZodUnion:()=>Vv,$ZodUndefined:()=>sJ,$ZodUUID:()=>PJ,$ZodURL:()=>qJ,$ZodULID:()=>RJ,$ZodType:()=>f,$ZodTuple:()=>KU,$ZodTransform:()=>Z8,$ZodTemplateLiteral:()=>S8,$ZodSymbol:()=>eJ,$ZodSuccess:()=>w8,$ZodStringFormat:()=>v$,$ZodString:()=>j6,$ZodSet:()=>B8,$ZodRegistry:()=>EQ,$ZodRecord:()=>I8,$ZodRealError:()=>l$,$ZodReadonly:()=>q8,$ZodPromise:()=>E8,$ZodPreprocess:()=>b8,$ZodPrefault:()=>j8,$ZodPipe:()=>ZU,$ZodOptional:()=>NU,$ZodObjectJIT:()=>Q8,$ZodObject:()=>hY,$ZodNumberFormat:()=>oJ,$ZodNumber:()=>BU,$ZodNullable:()=>H8,$ZodNull:()=>$8,$ZodNonOptional:()=>A8,$ZodNever:()=>D8,$ZodNanoID:()=>kJ,$ZodNaN:()=>P8,$ZodMap:()=>V8,$ZodMAC:()=>nJ,$ZodLiteral:()=>K8,$ZodLazy:()=>T8,$ZodKSUID:()=>uJ,$ZodJWT:()=>pJ,$ZodIntersection:()=>Y8,$ZodISOTime:()=>fJ,$ZodISODuration:()=>_J,$ZodISODateTime:()=>CJ,$ZodISODate:()=>xJ,$ZodIPv6:()=>yJ,$ZodIPv4:()=>iJ,$ZodGUID:()=>MJ,$ZodFunction:()=>k8,$ZodFile:()=>N8,$ZodExactOptional:()=>O8,$ZodError:()=>Uv,$ZodEnum:()=>L8,$ZodEncodeError:()=>O6,$ZodEmoji:()=>SJ,$ZodEmail:()=>bJ,$ZodE164:()=>dJ,$ZodDiscriminatedUnion:()=>z8,$ZodDefault:()=>F8,$ZodDate:()=>G8,$ZodCustomStringFormat:()=>tJ,$ZodCustom:()=>R8,$ZodCodec:()=>Bv,$ZodCheckUpperCase:()=>KJ,$ZodCheckStringFormat:()=>m6,$ZodCheckStartsWith:()=>ZJ,$ZodCheckSizeEquals:()=>zJ,$ZodCheckRegex:()=>BJ,$ZodCheckProperty:()=>HJ,$ZodCheckOverwrite:()=>jJ,$ZodCheckNumberFormat:()=>GJ,$ZodCheckMultipleOf:()=>XJ,$ZodCheckMinSize:()=>WJ,$ZodCheckMinLength:()=>IJ,$ZodCheckMimeType:()=>FJ,$ZodCheckMaxSize:()=>QJ,$ZodCheckMaxLength:()=>YJ,$ZodCheckLowerCase:()=>LJ,$ZodCheckLessThan:()=>JU,$ZodCheckLengthEquals:()=>VJ,$ZodCheckIncludes:()=>NJ,$ZodCheckGreaterThan:()=>QU,$ZodCheckEndsWith:()=>OJ,$ZodCheckBigIntFormat:()=>JJ,$ZodCheck:()=>G$,$ZodCatch:()=>M8,$ZodCUID2:()=>TJ,$ZodCUID:()=>EJ,$ZodCIDRv6:()=>hJ,$ZodCIDRv4:()=>lJ,$ZodBoolean:()=>Iv,$ZodBigIntFormat:()=>aJ,$ZodBigInt:()=>LU,$ZodBase64URL:()=>rJ,$ZodBase64:()=>cJ,$ZodAsyncError:()=>A4,$ZodArray:()=>J8,$ZodAny:()=>v8});var XY,KG=Object.freeze({status:"aborted"});function K($,v,D){function X(Q,W){if(!Q._zod)Object.defineProperty(Q,"_zod",{value:{def:W,constr:J,traits:new Set},enumerable:!1});if(Q._zod.traits.has($))return;Q._zod.traits.add($),v(Q,W);let z=J.prototype,Y=Object.keys(z);for(let I=0;I<Y.length;I++){let V=Y[I];if(!(V in Q))Q[V]=z[V].bind(Q)}}let U=D?.Parent??Object;class G extends U{}Object.defineProperty(G,"name",{value:$});function J(Q){var W;let z=D?.Parent?new G:this;X(z,Q),(W=z._zod).deferred??(W.deferred=[]);for(let Y of z._zod.deferred)Y();return z}return Object.defineProperty(J,"init",{value:X}),Object.defineProperty(J,Symbol.hasInstance,{value:(Q)=>{if(D?.Parent&&Q instanceof D.Parent)return!0;return Q?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}var NG=Symbol("zod_brand");class A4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(XY=globalThis).__zod_globalConfig??(XY.__zod_globalConfig={});var Z6=globalThis.__zod_globalConfig;function V$($){if($)Object.assign(Z6,$);return Z6}var w={};R4(w,{unwrapMessage:()=>o1,uint8ArrayToHex:()=>YF,uint8ArrayToBase64url:()=>WF,uint8ArrayToBase64:()=>QY,stringifyPrimitive:()=>j,slugify:()=>HG,shallowClone:()=>jG,safeExtend:()=>UF,required:()=>GF,randomString:()=>t3,propertyKeyTypes:()=>s1,promiseAllObject:()=>p3,primitiveTypes:()=>AG,prefixIssues:()=>n$,pick:()=>s3,partial:()=>XF,parsedType:()=>A,optionalKeys:()=>wG,omit:()=>$F,objectClone:()=>c3,numKeys:()=>o3,nullish:()=>t4,normalizeParams:()=>M,mergeDefs:()=>f4,merge:()=>DF,jsonStringifyReplacer:()=>x6,joinValues:()=>O,issue:()=>_6,isPlainObject:()=>a4,isObject:()=>H6,hexToUint8Array:()=>zF,getSizableOrigin:()=>$v,getParsedType:()=>a3,getLengthableOrigin:()=>vv,getEnumValues:()=>a1,getElementAtPath:()=>d3,floatSafeRemainder:()=>OG,finalizeIssue:()=>C$,extend:()=>vF,explicitlyAborted:()=>bG,escapeRegex:()=>v4,esc:()=>t0,defineLazy:()=>h,createTransparentProxy:()=>e3,cloneDef:()=>r3,clone:()=>u$,cleanRegex:()=>e1,cleanEnum:()=>JF,captureStackTrace:()=>o0,cached:()=>f6,base64urlToUint8Array:()=>QF,base64ToUint8Array:()=>JY,assignProp:()=>o4,assertNotEqual:()=>n3,assertNever:()=>h3,assertIs:()=>l3,assertEqual:()=>y3,assert:()=>m3,allowsEval:()=>FG,aborted:()=>e4,NUMBER_FORMAT_RANGES:()=>MG,Class:()=>WY,BIGINT_FORMAT_RANGES:()=>PG});function y3($){return $}function n3($){return $}function l3($){}function h3($){throw Error("Unexpected value in exhaustive check")}function m3($){}function a1($){let v=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,U])=>v.indexOf(+X)===-1).map(([X,U])=>U)}function O($,v="|"){return $.map((D)=>j(D)).join(v)}function x6($,v){if(typeof v==="bigint")return v.toString();return v}function f6($){return{get value(){{let D=$();return Object.defineProperty(this,"value",{value:D}),D}throw Error("cached value already set")}}}function t4($){return $===null||$===void 0}function e1($){let v=$.startsWith("^")?1:0,D=$.endsWith("$")?$.length-1:$.length;return $.slice(v,D)}function OG($,v){let D=$/v,X=Math.round(D),U=Number.EPSILON*Math.max(Math.abs(D),1);if(Math.abs(D-X)<U)return 0;return D-X}var GY=Symbol("evaluating");function h($,v,D){let X=void 0;Object.defineProperty($,v,{get(){if(X===GY)return;if(X===void 0)X=GY,X=D();return X},set(U){Object.defineProperty($,v,{value:U})},configurable:!0})}function c3($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function o4($,v,D){Object.defineProperty($,v,{value:D,writable:!0,enumerable:!0,configurable:!0})}function f4(...$){let v={};for(let D of $){let X=Object.getOwnPropertyDescriptors(D);Object.assign(v,X)}return Object.defineProperties({},v)}function r3($){return f4($._zod.def)}function d3($,v){if(!v)return $;return v.reduce((D,X)=>D?.[X],$)}function p3($){let v=Object.keys($),D=v.map((X)=>$[X]);return Promise.all(D).then((X)=>{let U={};for(let G=0;G<v.length;G++)U[v[G]]=X[G];return U})}function t3($=10){let D="";for(let X=0;X<$;X++)D+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return D}function t0($){return JSON.stringify($)}function HG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var o0="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function H6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var FG=f6(()=>{if(Z6.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function a4($){if(H6($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let D=v.prototype;if(H6(D)===!1)return!1;if(Object.prototype.hasOwnProperty.call(D,"isPrototypeOf")===!1)return!1;return!0}function jG($){if(a4($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function o3($){let v=0;for(let D in $)if(Object.prototype.hasOwnProperty.call($,D))v++;return v}var a3=($)=>{let v=typeof $;switch(v){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<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},s1=new Set(["string","number","symbol"]),AG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function v4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function u$($,v,D){let X=new $._zod.constr(v??$._zod.def);if(!v||D?.parent)X._zod.parent=$;return X}function M($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function e3($){let v;return new Proxy({},{get(D,X,U){return v??(v=$()),Reflect.get(v,X,U)},set(D,X,U,G){return v??(v=$()),Reflect.set(v,X,U,G)},has(D,X){return v??(v=$()),Reflect.has(v,X)},deleteProperty(D,X){return v??(v=$()),Reflect.deleteProperty(v,X)},ownKeys(D){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(D,X){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,X)},defineProperty(D,X,U){return v??(v=$()),Reflect.defineProperty(v,X,U)}})}function j($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function wG($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var MG={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]},PG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function s3($,v){let D=$._zod.def,X=D.checks;if(X&&X.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let G=f4($._zod.def,{get shape(){let J={};for(let Q in v){if(!(Q in D.shape))throw Error(`Unrecognized key: "${Q}"`);if(!v[Q])continue;J[Q]=D.shape[Q]}return o4(this,"shape",J),J},checks:[]});return u$($,G)}function $F($,v){let D=$._zod.def,X=D.checks;if(X&&X.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let G=f4($._zod.def,{get shape(){let J={...$._zod.def.shape};for(let Q in v){if(!(Q in D.shape))throw Error(`Unrecognized key: "${Q}"`);if(!v[Q])continue;delete J[Q]}return o4(this,"shape",J),J},checks:[]});return u$($,G)}function vF($,v){if(!a4(v))throw Error("Invalid input to extend: expected a plain object");let D=$._zod.def.checks;if(D&&D.length>0){let G=$._zod.def.shape;for(let J in v)if(Object.getOwnPropertyDescriptor(G,J)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let U=f4($._zod.def,{get shape(){let G={...$._zod.def.shape,...v};return o4(this,"shape",G),G}});return u$($,U)}function UF($,v){if(!a4(v))throw Error("Invalid input to safeExtend: expected a plain object");let D=f4($._zod.def,{get shape(){let X={...$._zod.def.shape,...v};return o4(this,"shape",X),X}});return u$($,D)}function DF($,v){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let D=f4($._zod.def,{get shape(){let X={...$._zod.def.shape,...v._zod.def.shape};return o4(this,"shape",X),X},get catchall(){return v._zod.def.catchall},checks:v._zod.def.checks??[]});return u$($,D)}function XF($,v,D){let U=v._zod.def.checks;if(U&&U.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let J=f4(v._zod.def,{get shape(){let Q=v._zod.def.shape,W={...Q};if(D)for(let z in D){if(!(z in Q))throw Error(`Unrecognized key: "${z}"`);if(!D[z])continue;W[z]=$?new $({type:"optional",innerType:Q[z]}):Q[z]}else for(let z in Q)W[z]=$?new $({type:"optional",innerType:Q[z]}):Q[z];return o4(this,"shape",W),W},checks:[]});return u$(v,J)}function GF($,v,D){let X=f4(v._zod.def,{get shape(){let U=v._zod.def.shape,G={...U};if(D)for(let J in D){if(!(J in G))throw Error(`Unrecognized key: "${J}"`);if(!D[J])continue;G[J]=new $({type:"nonoptional",innerType:U[J]})}else for(let J in U)G[J]=new $({type:"nonoptional",innerType:U[J]});return o4(this,"shape",G),G}});return u$(v,X)}function e4($,v=0){if($.aborted===!0)return!0;for(let D=v;D<$.issues.length;D++)if($.issues[D]?.continue!==!0)return!0;return!1}function bG($,v=0){if($.aborted===!0)return!0;for(let D=v;D<$.issues.length;D++)if($.issues[D]?.continue===!1)return!0;return!1}function n$($,v){return v.map((D)=>{var X;return(X=D).path??(X.path=[]),D.path.unshift($),D})}function o1($){return typeof $==="string"?$:$?.message}function C$($,v,D){let X=$.message?$.message:o1($.inst?._zod.def?.error?.($))??o1(v?.error?.($))??o1(D.customError?.($))??o1(D.localeError?.($))??"Invalid input",{inst:U,continue:G,input:J,...Q}=$;if(Q.path??(Q.path=[]),Q.message=X,v?.reportInput)Q.input=J;return Q}function $v($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function vv($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function A($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let D=$;if(D&&Object.getPrototypeOf(D)!==Object.prototype&&"constructor"in D&&D.constructor)return D.constructor.name}}return v}function _6(...$){let[v,D,X]=$;if(typeof v==="string")return{message:v,code:"custom",input:D,inst:X};return{...v}}function JF($){return Object.entries($).filter(([v,D])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function JY($){let v=atob($),D=new Uint8Array(v.length);for(let X=0;X<v.length;X++)D[X]=v.charCodeAt(X);return D}function QY($){let v="";for(let D=0;D<$.length;D++)v+=String.fromCharCode($[D]);return btoa(v)}function QF($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),D="=".repeat((4-v.length%4)%4);return JY(v+D)}function WF($){return QY($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function zF($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let D=new Uint8Array(v.length/2);for(let X=0;X<v.length;X+=2)D[X/2]=Number.parseInt(v.slice(X,X+2),16);return D}function YF($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class WY{constructor(...$){}}var zY=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,x6,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Uv=K("$ZodError",zY),l$=K("$ZodError",zY,{Parent:Error});function Dv($,v=(D)=>D.message){let D={},X=[];for(let U of $.issues)if(U.path.length>0)D[U.path[0]]=D[U.path[0]]||[],D[U.path[0]].push(v(U));else X.push(v(U));return{formErrors:X,fieldErrors:D}}function Xv($,v=(D)=>D.message){let D={_errors:[]},X=(U,G=[])=>{for(let J of U.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((Q)=>X({issues:Q},[...G,...J.path]));else if(J.code==="invalid_key")X({issues:J.issues},[...G,...J.path]);else if(J.code==="invalid_element")X({issues:J.issues},[...G,...J.path]);else{let Q=[...G,...J.path];if(Q.length===0)D._errors.push(v(J));else{let W=D,z=0;while(z<Q.length){let Y=Q[z];if(z!==Q.length-1)W[Y]=W[Y]||{_errors:[]};else W[Y]=W[Y]||{_errors:[]},W[Y]._errors.push(v(J));W=W[Y],z++}}}};return X($),D}function qG($,v=(D)=>D.message){let D={errors:[]},X=(U,G=[])=>{var J,Q;for(let W of U.issues)if(W.code==="invalid_union"&&W.errors.length)W.errors.map((z)=>X({issues:z},[...G,...W.path]));else if(W.code==="invalid_key")X({issues:W.issues},[...G,...W.path]);else if(W.code==="invalid_element")X({issues:W.issues},[...G,...W.path]);else{let z=[...G,...W.path];if(z.length===0){D.errors.push(v(W));continue}let Y=D,I=0;while(I<z.length){let V=z[I],B=I===z.length-1;if(typeof V==="string")Y.properties??(Y.properties={}),(J=Y.properties)[V]??(J[V]={errors:[]}),Y=Y.properties[V];else Y.items??(Y.items=[]),(Q=Y.items)[V]??(Q[V]={errors:[]}),Y=Y.items[V];if(B)Y.errors.push(v(W));I++}}};return X($),D}function YY($){let v=[],D=$.map((X)=>typeof X==="object"?X.key:X);for(let X of D)if(typeof X==="number")v.push(`[${X}]`);else if(typeof X==="symbol")v.push(`[${JSON.stringify(String(X))}]`);else if(/[^\w$]/.test(X))v.push(`[${JSON.stringify(X)}]`);else{if(v.length)v.push(".");v.push(X)}return v.join("")}function SG($){let v=[],D=[...$.issues].sort((X,U)=>(X.path??[]).length-(U.path??[]).length);for(let X of D)if(v.push(`✖ ${X.message}`),X.path?.length)v.push(` → at ${YY(X.path)}`);return v.join(`
|
|
29
|
+
`)}var i6=($)=>(v,D,X,U)=>{let G=X?{...X,async:!1}:{async:!1},J=v._zod.run({value:D,issues:[]},G);if(J instanceof Promise)throw new A4;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((W)=>C$(W,G,V$())));throw o0(Q,U?.callee),Q}return J.value},Gv=i6(l$),y6=($)=>async(v,D,X,U)=>{let G=X?{...X,async:!0}:{async:!0},J=v._zod.run({value:D,issues:[]},G);if(J instanceof Promise)J=await J;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((W)=>C$(W,G,V$())));throw o0(Q,U?.callee),Q}return J.value},Jv=y6(l$),n6=($)=>(v,D,X)=>{let U=X?{...X,async:!1}:{async:!1},G=v._zod.run({value:D,issues:[]},U);if(G instanceof Promise)throw new A4;return G.issues.length?{success:!1,error:new($??Uv)(G.issues.map((J)=>C$(J,U,V$())))}:{success:!0,data:G.value}},l6=n6(l$),h6=($)=>async(v,D,X)=>{let U=X?{...X,async:!0}:{async:!0},G=v._zod.run({value:D,issues:[]},U);if(G instanceof Promise)G=await G;return G.issues.length?{success:!1,error:new $(G.issues.map((J)=>C$(J,U,V$())))}:{success:!0,data:G.value}},Qv=h6(l$),a0=($)=>(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return i6($)(v,D,U)},IY=a0(l$),e0=($)=>(v,D,X)=>{return i6($)(v,D,X)},VY=e0(l$),s0=($)=>async(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return y6($)(v,D,U)},BY=s0(l$),$U=($)=>async(v,D,X)=>{return y6($)(v,D,X)},LY=$U(l$),vU=($)=>(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return n6($)(v,D,U)},KY=vU(l$),UU=($)=>(v,D,X)=>{return n6($)(v,D,X)},NY=UU(l$),DU=($)=>async(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return h6($)(v,D,U)},ZY=DU(l$),XU=($)=>async(v,D,X)=>{return h6($)(v,D,X)},OY=XU(l$);var a$={};R4(a$,{xid:()=>RG,uuid7:()=>KF,uuid6:()=>LF,uuid4:()=>BF,uuid:()=>F6,uppercase:()=>DJ,unicodeEmail:()=>HY,undefined:()=>vJ,ulid:()=>TG,time:()=>pG,string:()=>oG,sha512_hex:()=>xF,sha512_base64url:()=>_F,sha512_base64:()=>fF,sha384_hex:()=>gF,sha384_base64url:()=>CF,sha384_base64:()=>uF,sha256_hex:()=>EF,sha256_base64url:()=>RF,sha256_base64:()=>TF,sha1_hex:()=>qF,sha1_base64url:()=>kF,sha1_base64:()=>SF,rfc5322Email:()=>ZF,number:()=>Wv,null:()=>$J,nanoid:()=>uG,md5_hex:()=>MF,md5_base64url:()=>bF,md5_base64:()=>PF,mac:()=>nG,lowercase:()=>UJ,ksuid:()=>gG,ipv6:()=>yG,ipv4:()=>iG,integer:()=>eG,idnEmail:()=>OF,httpProtocol:()=>cG,html5Email:()=>NF,hostname:()=>jF,hex:()=>wF,guid:()=>xG,extendedDuration:()=>VF,emoji:()=>_G,email:()=>fG,e164:()=>rG,duration:()=>CG,domain:()=>AF,datetime:()=>tG,date:()=>dG,cuid2:()=>EG,cuid:()=>kG,cidrv6:()=>hG,cidrv4:()=>lG,browserEmail:()=>HF,boolean:()=>sG,bigint:()=>aG,base64url:()=>GU,base64:()=>mG});var kG=/^[cC][0-9a-z]{6,}$/,EG=/^[0-9a-z]+$/,TG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RG=/^[0-9a-vA-V]{20}$/,gG=/^[A-Za-z0-9]{27}$/,uG=/^[a-zA-Z0-9_-]{21}$/,CG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VF=/^[-+]?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)?)??$/,xG=/^([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})$/,F6=($)=>{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})$`)},BF=F6(4),LF=F6(6),KF=F6(7),fG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,NF=/^[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])?)*$/,ZF=/^(([^<>()\[\]\\.,;:\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,}))$/,HY=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,OF=HY,HF=/^[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])?)*$/,FF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _G(){return new RegExp(FF,"u")}var iG=/^(?:(?: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])$/,yG=/^(([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}|:))$/,nG=($)=>{let v=v4($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},lG=/^((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])$/,hG=/^(([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])$/,mG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,GU=/^[A-Za-z0-9_-]*$/,jF=/^(?=.{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])?)*\.?$/,AF=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,cG=/^https?$/,rG=/^\+[1-9]\d{6,14}$/,FY="(?:(?:\\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])))",dG=new RegExp(`^${FY}$`);function jY($){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 pG($){return new RegExp(`^${jY($)}$`)}function tG($){let v=jY({precision:$.precision}),D=["Z"];if($.local)D.push("");if($.offset)D.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let X=`${v}(?:${D.join("|")})`;return new RegExp(`^${FY}T(?:${X})$`)}var oG=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},aG=/^-?\d+n?$/,eG=/^-?\d+$/,Wv=/^-?\d+(?:\.\d+)?$/,sG=/^(?:true|false)$/i,$J=/^null$/i;var vJ=/^undefined$/i;var UJ=/^[^A-Z]*$/,DJ=/^[^a-z]*$/,wF=/^[0-9a-fA-F]*$/;function zv($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function Yv($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var MF=/^[0-9a-fA-F]{32}$/,PF=zv(22,"=="),bF=Yv(22),qF=/^[0-9a-fA-F]{40}$/,SF=zv(27,"="),kF=Yv(27),EF=/^[0-9a-fA-F]{64}$/,TF=zv(43,"="),RF=Yv(43),gF=/^[0-9a-fA-F]{96}$/,uF=zv(64,""),CF=Yv(64),xF=/^[0-9a-fA-F]{128}$/,fF=zv(86,"=="),_F=Yv(86);var G$=K("$ZodCheck",($,v)=>{var D;$._zod??($._zod={}),$._zod.def=v,(D=$._zod).onattach??(D.onattach=[])}),wY={number:"number",bigint:"bigint",object:"date"},JU=K("$ZodCheckLessThan",($,v)=>{G$.init($,v);let D=wY[typeof v.value];$._zod.onattach.push((X)=>{let U=X._zod.bag,G=(v.inclusive?U.maximum:U.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<G)if(v.inclusive)U.maximum=v.value;else U.exclusiveMaximum=v.value}),$._zod.check=(X)=>{if(v.inclusive?X.value<=v.value:X.value<v.value)return;X.issues.push({origin:D,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:X.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),QU=K("$ZodCheckGreaterThan",($,v)=>{G$.init($,v);let D=wY[typeof v.value];$._zod.onattach.push((X)=>{let U=X._zod.bag,G=(v.inclusive?U.minimum:U.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>G)if(v.inclusive)U.minimum=v.value;else U.exclusiveMinimum=v.value}),$._zod.check=(X)=>{if(v.inclusive?X.value>=v.value:X.value>v.value)return;X.issues.push({origin:D,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:X.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),XJ=K("$ZodCheckMultipleOf",($,v)=>{G$.init($,v),$._zod.onattach.push((D)=>{var X;(X=D._zod.bag).multipleOf??(X.multipleOf=v.value)}),$._zod.check=(D)=>{if(typeof D.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof D.value==="bigint"?D.value%v.value===BigInt(0):OG(D.value,v.value)===0)return;D.issues.push({origin:typeof D.value,code:"not_multiple_of",divisor:v.value,input:D.value,inst:$,continue:!v.abort})}}),GJ=K("$ZodCheckNumberFormat",($,v)=>{G$.init($,v),v.format=v.format||"float64";let D=v.format?.includes("int"),X=D?"int":"number",[U,G]=MG[v.format];$._zod.onattach.push((J)=>{let Q=J._zod.bag;if(Q.format=v.format,Q.minimum=U,Q.maximum=G,D)Q.pattern=eG}),$._zod.check=(J)=>{let Q=J.value;if(D){if(!Number.isInteger(Q)){J.issues.push({expected:X,format:v.format,code:"invalid_type",continue:!1,input:Q,inst:$});return}if(!Number.isSafeInteger(Q)){if(Q>0)J.issues.push({input:Q,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,inclusive:!0,continue:!v.abort});else J.issues.push({input:Q,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,inclusive:!0,continue:!v.abort});return}}if(Q<U)J.issues.push({origin:"number",input:Q,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(Q>G)J.issues.push({origin:"number",input:Q,code:"too_big",maximum:G,inclusive:!0,inst:$,continue:!v.abort})}}),JJ=K("$ZodCheckBigIntFormat",($,v)=>{G$.init($,v);let[D,X]=PG[v.format];$._zod.onattach.push((U)=>{let G=U._zod.bag;G.format=v.format,G.minimum=D,G.maximum=X}),$._zod.check=(U)=>{let G=U.value;if(G<D)U.issues.push({origin:"bigint",input:G,code:"too_small",minimum:D,inclusive:!0,inst:$,continue:!v.abort});if(G>X)U.issues.push({origin:"bigint",input:G,code:"too_big",maximum:X,inclusive:!0,inst:$,continue:!v.abort})}}),QJ=K("$ZodCheckMaxSize",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!t4(U)&&U.size!==void 0}),$._zod.onattach.push((X)=>{let U=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<U)X._zod.bag.maximum=v.maximum}),$._zod.check=(X)=>{let U=X.value;if(U.size<=v.maximum)return;X.issues.push({origin:$v(U),code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),WJ=K("$ZodCheckMinSize",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!t4(U)&&U.size!==void 0}),$._zod.onattach.push((X)=>{let U=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>U)X._zod.bag.minimum=v.minimum}),$._zod.check=(X)=>{let U=X.value;if(U.size>=v.minimum)return;X.issues.push({origin:$v(U),code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),zJ=K("$ZodCheckSizeEquals",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!t4(U)&&U.size!==void 0}),$._zod.onattach.push((X)=>{let U=X._zod.bag;U.minimum=v.size,U.maximum=v.size,U.size=v.size}),$._zod.check=(X)=>{let U=X.value,G=U.size;if(G===v.size)return;let J=G>v.size;X.issues.push({origin:$v(U),...J?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!v.abort})}}),YJ=K("$ZodCheckMaxLength",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!t4(U)&&U.length!==void 0}),$._zod.onattach.push((X)=>{let U=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<U)X._zod.bag.maximum=v.maximum}),$._zod.check=(X)=>{let U=X.value;if(U.length<=v.maximum)return;let J=vv(U);X.issues.push({origin:J,code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),IJ=K("$ZodCheckMinLength",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!t4(U)&&U.length!==void 0}),$._zod.onattach.push((X)=>{let U=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>U)X._zod.bag.minimum=v.minimum}),$._zod.check=(X)=>{let U=X.value;if(U.length>=v.minimum)return;let J=vv(U);X.issues.push({origin:J,code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),VJ=K("$ZodCheckLengthEquals",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!t4(U)&&U.length!==void 0}),$._zod.onattach.push((X)=>{let U=X._zod.bag;U.minimum=v.length,U.maximum=v.length,U.length=v.length}),$._zod.check=(X)=>{let U=X.value,G=U.length;if(G===v.length)return;let J=vv(U),Q=G>v.length;X.issues.push({origin:J,...Q?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!v.abort})}}),m6=K("$ZodCheckStringFormat",($,v)=>{var D,X;if(G$.init($,v),$._zod.onattach.push((U)=>{let G=U._zod.bag;if(G.format=v.format,v.pattern)G.patterns??(G.patterns=new Set),G.patterns.add(v.pattern)}),v.pattern)(D=$._zod).check??(D.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:v.format,input:U.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(X=$._zod).check??(X.check=()=>{})}),BJ=K("$ZodCheckRegex",($,v)=>{m6.init($,v),$._zod.check=(D)=>{if(v.pattern.lastIndex=0,v.pattern.test(D.value))return;D.issues.push({origin:"string",code:"invalid_format",format:"regex",input:D.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),LJ=K("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=UJ),m6.init($,v)}),KJ=K("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=DJ),m6.init($,v)}),NJ=K("$ZodCheckIncludes",($,v)=>{G$.init($,v);let D=v4(v.includes),X=new RegExp(typeof v.position==="number"?`^.{${v.position}}${D}`:D);v.pattern=X,$._zod.onattach.push((U)=>{let G=U._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(X)}),$._zod.check=(U)=>{if(U.value.includes(v.includes,v.position))return;U.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:U.value,inst:$,continue:!v.abort})}}),ZJ=K("$ZodCheckStartsWith",($,v)=>{G$.init($,v);let D=new RegExp(`^${v4(v.prefix)}.*`);v.pattern??(v.pattern=D),$._zod.onattach.push((X)=>{let U=X._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(D)}),$._zod.check=(X)=>{if(X.value.startsWith(v.prefix))return;X.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:X.value,inst:$,continue:!v.abort})}}),OJ=K("$ZodCheckEndsWith",($,v)=>{G$.init($,v);let D=new RegExp(`.*${v4(v.suffix)}$`);v.pattern??(v.pattern=D),$._zod.onattach.push((X)=>{let U=X._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(D)}),$._zod.check=(X)=>{if(X.value.endsWith(v.suffix))return;X.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:X.value,inst:$,continue:!v.abort})}});function AY($,v,D){if($.issues.length)v.issues.push(...n$(D,$.issues))}var HJ=K("$ZodCheckProperty",($,v)=>{G$.init($,v),$._zod.check=(D)=>{let X=v.schema._zod.run({value:D.value[v.property],issues:[]},{});if(X instanceof Promise)return X.then((U)=>AY(U,D,v.property));AY(X,D,v.property);return}}),FJ=K("$ZodCheckMimeType",($,v)=>{G$.init($,v);let D=new Set(v.mime);$._zod.onattach.push((X)=>{X._zod.bag.mime=v.mime}),$._zod.check=(X)=>{if(D.has(X.value.type))return;X.issues.push({code:"invalid_value",values:v.mime,input:X.value.type,inst:$,continue:!v.abort})}}),jJ=K("$ZodCheckOverwrite",($,v)=>{G$.init($,v),$._zod.check=(D)=>{D.value=v.tx(D.value)}});class WU{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 D=$.split(`
|
|
30
|
+
`).filter((G)=>G),X=Math.min(...D.map((G)=>G.length-G.trimStart().length)),U=D.map((G)=>G.slice(X)).map((G)=>" ".repeat(this.indent*2)+G);for(let G of U)this.content.push(G)}compile(){let $=Function,v=this?.args,X=[...(this?.content??[""]).map((U)=>` ${U}`)];return new $(...v,X.join(`
|
|
31
|
+
`))}}var AJ={major:4,minor:4,patch:3};var f=K("$ZodType",($,v)=>{var D;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=AJ;let X=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))X.unshift($);for(let U of X)for(let G of U._zod.onattach)G($);if(X.length===0)(D=$._zod).deferred??(D.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(J,Q,W)=>{let z=e4(J),Y;for(let I of Q){if(I._zod.def.when){if(bG(J))continue;if(!I._zod.def.when(J))continue}else if(z)continue;let V=J.issues.length,B=I._zod.check(J);if(B instanceof Promise&&W?.async===!1)throw new A4;if(Y||B instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await B,J.issues.length===V)return;if(!z)z=e4(J,V)});else{if(J.issues.length===V)continue;if(!z)z=e4(J,V)}}if(Y)return Y.then(()=>{return J});return J},G=(J,Q,W)=>{if(e4(J))return J.aborted=!0,J;let z=U(Q,X,W);if(z instanceof Promise){if(W.async===!1)throw new A4;return z.then((Y)=>$._zod.parse(Y,W))}return $._zod.parse(z,W)};$._zod.run=(J,Q)=>{if(Q.skipChecks)return $._zod.parse(J,Q);if(Q.direction==="backward"){let z=$._zod.parse({value:J.value,issues:[]},{...Q,skipChecks:!0});if(z instanceof Promise)return z.then((Y)=>{return G(Y,J,Q)});return G(z,J,Q)}let W=$._zod.parse(J,Q);if(W instanceof Promise){if(Q.async===!1)throw new A4;return W.then((z)=>U(z,X,Q))}return U(W,X,Q)}}h($,"~standard",()=>({validate:(U)=>{try{let G=l6($,U);return G.success?{value:G.data}:{issues:G.error?.issues}}catch(G){return Qv($,U).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),j6=K("$ZodString",($,v)=>{f.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??oG($._zod.bag),$._zod.parse=(D,X)=>{if(v.coerce)try{D.value=String(D.value)}catch(U){}if(typeof D.value==="string")return D;return D.issues.push({expected:"string",code:"invalid_type",input:D.value,inst:$}),D}}),v$=K("$ZodStringFormat",($,v)=>{m6.init($,v),j6.init($,v)}),MJ=K("$ZodGUID",($,v)=>{v.pattern??(v.pattern=xG),v$.init($,v)}),PJ=K("$ZodUUID",($,v)=>{if(v.version){let X={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(X===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=F6(X))}else v.pattern??(v.pattern=F6());v$.init($,v)}),bJ=K("$ZodEmail",($,v)=>{v.pattern??(v.pattern=fG),v$.init($,v)}),qJ=K("$ZodURL",($,v)=>{v$.init($,v),$._zod.check=(D)=>{try{let X=D.value.trim();if(!v.normalize&&v.protocol?.source===cG.source){if(!/^https?:\/\//i.test(X)){D.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:D.value,inst:$,continue:!v.abort});return}}let U=new URL(X);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(U.hostname))D.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:D.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))D.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:D.value,inst:$,continue:!v.abort})}if(v.normalize)D.value=U.href;else D.value=X;return}catch(X){D.issues.push({code:"invalid_format",format:"url",input:D.value,inst:$,continue:!v.abort})}}}),SJ=K("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=_G()),v$.init($,v)}),kJ=K("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=uG),v$.init($,v)}),EJ=K("$ZodCUID",($,v)=>{v.pattern??(v.pattern=kG),v$.init($,v)}),TJ=K("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=EG),v$.init($,v)}),RJ=K("$ZodULID",($,v)=>{v.pattern??(v.pattern=TG),v$.init($,v)}),gJ=K("$ZodXID",($,v)=>{v.pattern??(v.pattern=RG),v$.init($,v)}),uJ=K("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=gG),v$.init($,v)}),CJ=K("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=tG(v)),v$.init($,v)}),xJ=K("$ZodISODate",($,v)=>{v.pattern??(v.pattern=dG),v$.init($,v)}),fJ=K("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=pG(v)),v$.init($,v)}),_J=K("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=CG),v$.init($,v)}),iJ=K("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=iG),v$.init($,v),$._zod.bag.format="ipv4"}),yJ=K("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=yG),v$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(D)=>{try{new URL(`http://[${D.value}]`)}catch{D.issues.push({code:"invalid_format",format:"ipv6",input:D.value,inst:$,continue:!v.abort})}}}),nJ=K("$ZodMAC",($,v)=>{v.pattern??(v.pattern=nG(v.delimiter)),v$.init($,v),$._zod.bag.format="mac"}),lJ=K("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=lG),v$.init($,v)}),hJ=K("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=hG),v$.init($,v),$._zod.check=(D)=>{let X=D.value.split("/");try{if(X.length!==2)throw Error();let[U,G]=X;if(!G)throw Error();let J=Number(G);if(`${J}`!==G)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${U}]`)}catch{D.issues.push({code:"invalid_format",format:"cidrv6",input:D.value,inst:$,continue:!v.abort})}}});function mJ($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var cJ=K("$ZodBase64",($,v)=>{v.pattern??(v.pattern=mG),v$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(D)=>{if(mJ(D.value))return;D.issues.push({code:"invalid_format",format:"base64",input:D.value,inst:$,continue:!v.abort})}});function iY($){if(!GU.test($))return!1;let v=$.replace(/[-_]/g,(X)=>X==="-"?"+":"/"),D=v.padEnd(Math.ceil(v.length/4)*4,"=");return mJ(D)}var rJ=K("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=GU),v$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(D)=>{if(iY(D.value))return;D.issues.push({code:"invalid_format",format:"base64url",input:D.value,inst:$,continue:!v.abort})}}),dJ=K("$ZodE164",($,v)=>{v.pattern??(v.pattern=rG),v$.init($,v)});function yY($,v=null){try{let D=$.split(".");if(D.length!==3)return!1;let[X]=D;if(!X)return!1;let U=JSON.parse(atob(X));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(v&&(!("alg"in U)||U.alg!==v))return!1;return!0}catch{return!1}}var pJ=K("$ZodJWT",($,v)=>{v$.init($,v),$._zod.check=(D)=>{if(yY(D.value,v.alg))return;D.issues.push({code:"invalid_format",format:"jwt",input:D.value,inst:$,continue:!v.abort})}}),tJ=K("$ZodCustomStringFormat",($,v)=>{v$.init($,v),$._zod.check=(D)=>{if(v.fn(D.value))return;D.issues.push({code:"invalid_format",format:v.format,input:D.value,inst:$,continue:!v.abort})}}),BU=K("$ZodNumber",($,v)=>{f.init($,v),$._zod.pattern=$._zod.bag.pattern??Wv,$._zod.parse=(D,X)=>{if(v.coerce)try{D.value=Number(D.value)}catch(J){}let U=D.value;if(typeof U==="number"&&!Number.isNaN(U)&&Number.isFinite(U))return D;let G=typeof U==="number"?Number.isNaN(U)?"NaN":!Number.isFinite(U)?"Infinity":void 0:void 0;return D.issues.push({expected:"number",code:"invalid_type",input:U,inst:$,...G?{received:G}:{}}),D}}),oJ=K("$ZodNumberFormat",($,v)=>{GJ.init($,v),BU.init($,v)}),Iv=K("$ZodBoolean",($,v)=>{f.init($,v),$._zod.pattern=sG,$._zod.parse=(D,X)=>{if(v.coerce)try{D.value=Boolean(D.value)}catch(G){}let U=D.value;if(typeof U==="boolean")return D;return D.issues.push({expected:"boolean",code:"invalid_type",input:U,inst:$}),D}}),LU=K("$ZodBigInt",($,v)=>{f.init($,v),$._zod.pattern=aG,$._zod.parse=(D,X)=>{if(v.coerce)try{D.value=BigInt(D.value)}catch(U){}if(typeof D.value==="bigint")return D;return D.issues.push({expected:"bigint",code:"invalid_type",input:D.value,inst:$}),D}}),aJ=K("$ZodBigIntFormat",($,v)=>{JJ.init($,v),LU.init($,v)}),eJ=K("$ZodSymbol",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{let U=D.value;if(typeof U==="symbol")return D;return D.issues.push({expected:"symbol",code:"invalid_type",input:U,inst:$}),D}}),sJ=K("$ZodUndefined",($,v)=>{f.init($,v),$._zod.pattern=vJ,$._zod.values=new Set([void 0]),$._zod.parse=(D,X)=>{let U=D.value;if(typeof U>"u")return D;return D.issues.push({expected:"undefined",code:"invalid_type",input:U,inst:$}),D}}),$8=K("$ZodNull",($,v)=>{f.init($,v),$._zod.pattern=$J,$._zod.values=new Set([null]),$._zod.parse=(D,X)=>{let U=D.value;if(U===null)return D;return D.issues.push({expected:"null",code:"invalid_type",input:U,inst:$}),D}}),v8=K("$ZodAny",($,v)=>{f.init($,v),$._zod.parse=(D)=>D}),U8=K("$ZodUnknown",($,v)=>{f.init($,v),$._zod.parse=(D)=>D}),D8=K("$ZodNever",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{return D.issues.push({expected:"never",code:"invalid_type",input:D.value,inst:$}),D}}),X8=K("$ZodVoid",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{let U=D.value;if(typeof U>"u")return D;return D.issues.push({expected:"void",code:"invalid_type",input:U,inst:$}),D}}),G8=K("$ZodDate",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{if(v.coerce)try{D.value=new Date(D.value)}catch(Q){}let U=D.value,G=U instanceof Date;if(G&&!Number.isNaN(U.getTime()))return D;return D.issues.push({expected:"date",code:"invalid_type",input:U,...G?{received:"Invalid Date"}:{},inst:$}),D}});function PY($,v,D){if($.issues.length)v.issues.push(...n$(D,$.issues));v.value[D]=$.value}var J8=K("$ZodArray",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{let U=D.value;if(!Array.isArray(U))return D.issues.push({expected:"array",code:"invalid_type",input:U,inst:$}),D;D.value=Array(U.length);let G=[];for(let J=0;J<U.length;J++){let Q=U[J],W=v.element._zod.run({value:Q,issues:[]},X);if(W instanceof Promise)G.push(W.then((z)=>PY(z,D,J)));else PY(W,D,J)}if(G.length)return Promise.all(G).then(()=>D);return D}});function VU($,v,D,X,U,G){let J=D in X;if($.issues.length){if(U&&G&&!J)return;v.issues.push(...n$(D,$.issues))}if(!J&&!U){if(!$.issues.length)v.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[D]});return}if($.value===void 0){if(J)v.value[D]=void 0}else v.value[D]=$.value}function nY($){let v=Object.keys($.shape);for(let X of v)if(!$.shape?.[X]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${X}": expected a Zod schema`);let D=wG($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(D)}}function lY($,v,D,X,U,G){let J=[],Q=U.keySet,W=U.catchall._zod,z=W.def.type,Y=W.optin==="optional",I=W.optout==="optional";for(let V in v){if(V==="__proto__")continue;if(Q.has(V))continue;if(z==="never"){J.push(V);continue}let B=W.run({value:v[V],issues:[]},X);if(B instanceof Promise)$.push(B.then((L)=>VU(L,D,V,v,Y,I)));else VU(B,D,V,v,Y,I)}if(J.length)D.issues.push({code:"unrecognized_keys",keys:J,input:v,inst:G});if(!$.length)return D;return Promise.all($).then(()=>{return D})}var hY=K("$ZodObject",($,v)=>{if(f.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let Q=v.shape;Object.defineProperty(v,"shape",{get:()=>{let W={...Q};return Object.defineProperty(v,"shape",{value:W}),W}})}let X=f6(()=>nY(v));h($._zod,"propValues",()=>{let Q=v.shape,W={};for(let z in Q){let Y=Q[z]._zod;if(Y.values){W[z]??(W[z]=new Set);for(let I of Y.values)W[z].add(I)}}return W});let U=H6,G=v.catchall,J;$._zod.parse=(Q,W)=>{J??(J=X.value);let z=Q.value;if(!U(z))return Q.issues.push({expected:"object",code:"invalid_type",input:z,inst:$}),Q;Q.value={};let Y=[],I=J.shape;for(let V of J.keys){let B=I[V],L=B._zod.optin==="optional",N=B._zod.optout==="optional",Z=B._zod.run({value:z[V],issues:[]},W);if(Z instanceof Promise)Y.push(Z.then((F)=>VU(F,Q,V,z,L,N)));else VU(Z,Q,V,z,L,N)}if(!G)return Y.length?Promise.all(Y).then(()=>Q):Q;return lY(Y,z,Q,W,X.value,$)}}),Q8=K("$ZodObjectJIT",($,v)=>{hY.init($,v);let D=$._zod.parse,X=f6(()=>nY(v)),U=(V)=>{let B=new WU(["shape","payload","ctx"]),L=X.value,N=(T)=>{let g=t0(T);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};B.write("const input = payload.value;");let Z=Object.create(null),F=0;for(let T of L.keys)Z[T]=`key_${F++}`;B.write("const newResult = {};");for(let T of L.keys){let g=Z[T],k=t0(T),N$=V[T],j$=N$?._zod?.optin==="optional",T4=N$?._zod?.optout==="optional";if(B.write(`const ${g} = ${N(T)};`),j$&&T4)B.write(`
|
|
14
32
|
if (${g}.issues.length) {
|
|
15
33
|
if (${k} in input) {
|
|
16
34
|
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
@@ -28,7 +46,7 @@ import{createRequire as ZA}from"node:module";var JA=Object.create;var{getPrototy
|
|
|
28
46
|
newResult[${k}] = ${g}.value;
|
|
29
47
|
}
|
|
30
48
|
|
|
31
|
-
`);else if(!
|
|
49
|
+
`);else if(!j$)B.write(`
|
|
32
50
|
const ${g}_present = ${k} in input;
|
|
33
51
|
if (${g}.issues.length) {
|
|
34
52
|
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
@@ -53,7 +71,7 @@ import{createRequire as ZA}from"node:module";var JA=Object.create;var{getPrototy
|
|
|
53
71
|
}
|
|
54
72
|
}
|
|
55
73
|
|
|
56
|
-
`);else
|
|
74
|
+
`);else B.write(`
|
|
57
75
|
if (${g}.issues.length) {
|
|
58
76
|
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
59
77
|
...iss,
|
|
@@ -69,56 +87,50 @@ import{createRequire as ZA}from"node:module";var JA=Object.create;var{getPrototy
|
|
|
69
87
|
newResult[${k}] = ${g}.value;
|
|
70
88
|
}
|
|
71
89
|
|
|
72
|
-
`)}V.write("payload.value = newResult;"),V.write("return payload;");let S=V.compile();return(E,g)=>S(L,E,g)},X,G=B6,Q=!L6.jitless,z=Q&&jI.value,W=v.catchall,Y;$._zod.parse=(L,V)=>{Y??(Y=I.value);let B=L.value;if(!G(B))return L.issues.push({expected:"object",code:"invalid_type",input:B,inst:$}),L;if(Q&&z&&V?.async===!1&&V.jitless!==!0){if(!X)X=U(v.shape);if(L=X(L,V),!W)return L;return NY([],B,L,V,Y,$)}return D(L,V)}});function $Y($,v,D,I){for(let X of $)if(X.issues.length===0)return v.value=X.value,v;let U=$.filter((X)=>!r4(X));if(U.length===1)return v.value=U[0].value,U[0];return v.issues.push({code:"invalid_union",input:v.value,inst:D,errors:$.map((X)=>X.issues.map((G)=>C$(G,I,L$())))}),v}var $v=K("$ZodUnion",($,v)=>{i.init($,v),y($._zod,"optin",()=>v.options.some((I)=>I._zod.optin==="optional")?"optional":void 0),y($._zod,"optout",()=>v.options.some((I)=>I._zod.optout==="optional")?"optional":void 0),y($._zod,"values",()=>{if(v.options.every((I)=>I._zod.values))return new Set(v.options.flatMap((I)=>Array.from(I._zod.values)));return}),y($._zod,"pattern",()=>{if(v.options.every((I)=>I._zod.pattern)){let I=v.options.map((U)=>U._zod.pattern);return new RegExp(`^(${I.map((U)=>_1(U.source)).join("|")})$`)}return});let D=v.options.length===1?v.options[0]._zod.run:null;$._zod.parse=(I,U)=>{if(D)return D(I,U);let X=!1,G=[];for(let Q of v.options){let J=Q._zod.run({value:I.value,issues:[]},U);if(J instanceof Promise)G.push(J),X=!0;else{if(J.issues.length===0)return J;G.push(J)}}if(!X)return $Y(G,I,$,U);return Promise.all(G).then((Q)=>{return $Y(Q,I,$,U)})}});function vY($,v,D,I){let U=$.filter((X)=>X.issues.length===0);if(U.length===1)return v.value=U[0].value,v;if(U.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:D,errors:$.map((X)=>X.issues.map((G)=>C$(G,I,L$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:D,errors:[],inclusive:!1});return v}var WG=K("$ZodXor",($,v)=>{$v.init($,v),v.inclusive=!1;let D=v.options.length===1?v.options[0]._zod.run:null;$._zod.parse=(I,U)=>{if(D)return D(I,U);let X=!1,G=[];for(let Q of v.options){let J=Q._zod.run({value:I.value,issues:[]},U);if(J instanceof Promise)G.push(J),X=!0;else G.push(J)}if(!X)return vY(G,I,$,U);return Promise.all(G).then((Q)=>{return vY(Q,I,$,U)})}}),YG=K("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,$v.init($,v);let D=$._zod.parse;y($._zod,"propValues",()=>{let U={};for(let X of v.options){let G=X._zod.propValues;if(!G||Object.keys(G).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(X)}"`);for(let[Q,J]of Object.entries(G)){if(!U[Q])U[Q]=new Set;for(let z of J)U[Q].add(z)}}return U});let I=T6(()=>{let U=v.options,X=new Map;for(let G of U){let Q=G._zod.propValues?.[v.discriminator];if(!Q||Q.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(G)}"`);for(let J of Q){if(X.has(J))throw Error(`Duplicate discriminator value "${String(J)}"`);X.set(J,G)}}return X});$._zod.parse=(U,X)=>{let G=U.value;if(!B6(G))return U.issues.push({code:"invalid_type",expected:"object",input:G,inst:$}),U;let Q=I.value.get(G?.[v.discriminator]);if(Q)return Q._zod.run(U,X);if(v.unionFallback||X.direction==="backward")return D(U,X);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,options:Array.from(I.value.keys()),input:G,path:[v.discriminator],inst:$}),U}}),LG=K("$ZodIntersection",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{let U=D.value,X=v.left._zod.run({value:U,issues:[]},I),G=v.right._zod.run({value:U,issues:[]},I);if(X instanceof Promise||G instanceof Promise)return Promise.all([X,G]).then(([J,z])=>{return UY(D,J,z)});return UY(D,X,G)}});function MX($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(h4($)&&h4(v)){let D=Object.keys(v),I=Object.keys($).filter((X)=>D.indexOf(X)!==-1),U={...$,...v};for(let X of I){let G=MX($[X],v[X]);if(!G.valid)return{valid:!1,mergeErrorPath:[X,...G.mergeErrorPath]};U[X]=G.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let D=[];for(let I=0;I<$.length;I++){let U=$[I],X=v[I],G=MX(U,X);if(!G.valid)return{valid:!1,mergeErrorPath:[I,...G.mergeErrorPath]};D.push(G.data)}return{valid:!0,data:D}}return{valid:!1,mergeErrorPath:[]}}function UY($,v,D){let I=new Map,U;for(let Q of v.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let J of Q.keys){if(!I.has(J))I.set(J,{});I.get(J).l=!0}}else $.issues.push(Q);for(let Q of D.issues)if(Q.code==="unrecognized_keys")for(let J of Q.keys){if(!I.has(J))I.set(J,{});I.get(J).r=!0}else $.issues.push(Q);let X=[...I].filter(([,Q])=>Q.l&&Q.r).map(([Q])=>Q);if(X.length&&U)$.issues.push({...U,keys:X});if(r4($))return $;let G=MX(v.value,D.value);if(!G.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(G.mergeErrorPath)}`);return $.value=G.data,$}var fU=K("$ZodTuple",($,v)=>{i.init($,v);let D=v.items;$._zod.parse=(I,U)=>{let X=I.value;if(!Array.isArray(X))return I.issues.push({input:X,inst:$,expected:"tuple",code:"invalid_type"}),I;I.value=[];let G=[],Q=DY(D,"optin"),J=DY(D,"optout");if(!v.rest){if(X.length<Q)return I.issues.push({code:"too_small",minimum:Q,inclusive:!0,input:X,inst:$,origin:"array"}),I;if(X.length>D.length)I.issues.push({code:"too_big",maximum:D.length,inclusive:!0,input:X,inst:$,origin:"array"})}let z=Array(D.length);for(let W=0;W<D.length;W++){let Y=D[W]._zod.run({value:X[W],issues:[]},U);if(Y instanceof Promise)G.push(Y.then((L)=>{z[W]=L}));else z[W]=Y}if(v.rest){let W=D.length-1,Y=X.slice(D.length);for(let L of Y){W++;let V=v.rest._zod.run({value:L,issues:[]},U);if(V instanceof Promise)G.push(V.then((B)=>IY(B,I,W)));else IY(V,I,W)}}if(G.length)return Promise.all(G).then(()=>XY(z,I,D,X,J));return XY(z,I,D,X,J)}});function DY($,v){for(let D=$.length-1;D>=0;D--)if($[D]._zod[v]!=="optional")return D+1;return 0}function IY($,v,D){if($.issues.length)v.issues.push(...y$(D,$.issues));v.value[D]=$.value}function XY($,v,D,I,U){for(let X=0;X<D.length;X++){let G=$[X],Q=X<I.length;if(G.issues.length){if(!Q&&X>=U){v.value.length=X;break}v.issues.push(...y$(X,G.issues))}v.value[X]=G.value}for(let X=v.value.length-1;X>=I.length;X--)if(D[X]._zod.optout==="optional"&&v.value[X]===void 0)v.value.length=X;else break;return v}var VG=K("$ZodRecord",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{let U=D.value;if(!h4(U))return D.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),D;let X=[],G=v.keyType._zod.values;if(G){D.value={};let Q=new Set;for(let z of G)if(typeof z==="string"||typeof z==="number"||typeof z==="symbol"){Q.add(typeof z==="number"?z.toString():z);let W=v.keyType._zod.run({value:z,issues:[]},I);if(W instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(W.issues.length){D.issues.push({code:"invalid_key",origin:"record",issues:W.issues.map((V)=>C$(V,I,L$())),input:z,path:[z],inst:$});continue}let Y=W.value,L=v.valueType._zod.run({value:U[z],issues:[]},I);if(L instanceof Promise)X.push(L.then((V)=>{if(V.issues.length)D.issues.push(...y$(z,V.issues));D.value[Y]=V.value}));else{if(L.issues.length)D.issues.push(...y$(z,L.issues));D.value[Y]=L.value}}let J;for(let z in U)if(!Q.has(z))J=J??[],J.push(z);if(J&&J.length>0)D.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:J})}else{D.value={};for(let Q of Reflect.ownKeys(U)){if(Q==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(U,Q))continue;let J=v.keyType._zod.run({value:Q,issues:[]},I);if(J instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof Q==="string"&&o1.test(Q)&&J.issues.length){let Y=v.keyType._zod.run({value:Number(Q),issues:[]},I);if(Y instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Y.issues.length===0)J=Y}if(J.issues.length){if(v.mode==="loose")D.value[Q]=U[Q];else D.issues.push({code:"invalid_key",origin:"record",issues:J.issues.map((Y)=>C$(Y,I,L$())),input:Q,path:[Q],inst:$});continue}let W=v.valueType._zod.run({value:U[Q],issues:[]},I);if(W instanceof Promise)X.push(W.then((Y)=>{if(Y.issues.length)D.issues.push(...y$(Q,Y.issues));D.value[J.value]=Y.value}));else{if(W.issues.length)D.issues.push(...y$(Q,W.issues));D.value[J.value]=W.value}}}if(X.length)return Promise.all(X).then(()=>D);return D}}),BG=K("$ZodMap",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{let U=D.value;if(!(U instanceof Map))return D.issues.push({expected:"map",code:"invalid_type",input:U,inst:$}),D;let X=[];D.value=new Map;for(let[G,Q]of U){let J=v.keyType._zod.run({value:G,issues:[]},I),z=v.valueType._zod.run({value:Q,issues:[]},I);if(J instanceof Promise||z instanceof Promise)X.push(Promise.all([J,z]).then(([W,Y])=>{GY(W,Y,D,G,U,$,I)}));else GY(J,z,D,G,U,$,I)}if(X.length)return Promise.all(X).then(()=>D);return D}});function GY($,v,D,I,U,X,G){if($.issues.length)if(y1.has(typeof I))D.issues.push(...y$(I,$.issues));else D.issues.push({code:"invalid_key",origin:"map",input:U,inst:X,issues:$.issues.map((Q)=>C$(Q,G,L$()))});if(v.issues.length)if(y1.has(typeof I))D.issues.push(...y$(I,v.issues));else D.issues.push({origin:"map",code:"invalid_element",input:U,inst:X,key:I,issues:v.issues.map((Q)=>C$(Q,G,L$()))});D.value.set($.value,v.value)}var KG=K("$ZodSet",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{let U=D.value;if(!(U instanceof Set))return D.issues.push({input:U,inst:$,expected:"set",code:"invalid_type"}),D;let X=[];D.value=new Set;for(let G of U){let Q=v.valueType._zod.run({value:G,issues:[]},I);if(Q instanceof Promise)X.push(Q.then((J)=>QY(J,D)));else QY(Q,D)}if(X.length)return Promise.all(X).then(()=>D);return D}});function QY($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var NG=K("$ZodEnum",($,v)=>{i.init($,v);let D=f1(v.entries),I=new Set(D);$._zod.values=I,$._zod.pattern=new RegExp(`^(${D.filter((U)=>y1.has(typeof U)).map((U)=>typeof U==="string"?v4(U):U.toString()).join("|")})$`),$._zod.parse=(U,X)=>{let G=U.value;if(I.has(G))return U;return U.issues.push({code:"invalid_value",values:D,input:G,inst:$}),U}}),ZG=K("$ZodLiteral",($,v)=>{if(i.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let D=new Set(v.values);$._zod.values=D,$._zod.pattern=new RegExp(`^(${v.values.map((I)=>typeof I==="string"?v4(I):I?v4(I.toString()):String(I)).join("|")})$`),$._zod.parse=(I,U)=>{let X=I.value;if(D.has(X))return I;return I.issues.push({code:"invalid_value",values:v.values,input:X,inst:$}),I}}),AG=K("$ZodFile",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{let U=D.value;if(U instanceof File)return D;return D.issues.push({expected:"file",code:"invalid_type",input:U,inst:$}),D}}),HG=K("$ZodTransform",($,v)=>{i.init($,v),$._zod.optin="optional",$._zod.parse=(D,I)=>{if(I.direction==="backward")throw new V6($.constructor.name);let U=v.transform(D.value,D);if(I.async)return(U instanceof Promise?U:Promise.resolve(U)).then((G)=>{return D.value=G,D.fallback=!0,D});if(U instanceof Promise)throw new A4;return D.value=U,D.fallback=!0,D}});function JY($,v){if(v===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}var _U=K("$ZodOptional",($,v)=>{i.init($,v),$._zod.optin="optional",$._zod.optout="optional",y($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),y($._zod,"pattern",()=>{let D=v.innerType._zod.pattern;return D?new RegExp(`^(${_1(D.source)})?$`):void 0}),$._zod.parse=(D,I)=>{if(v.innerType._zod.optin==="optional"){let U=D.value,X=v.innerType._zod.run(D,I);if(X instanceof Promise)return X.then((G)=>JY(G,U));return JY(X,U)}if(D.value===void 0)return D;return v.innerType._zod.run(D,I)}}),FG=K("$ZodExactOptional",($,v)=>{_U.init($,v),y($._zod,"values",()=>v.innerType._zod.values),y($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(D,I)=>{return v.innerType._zod.run(D,I)}}),OG=K("$ZodNullable",($,v)=>{i.init($,v),y($._zod,"optin",()=>v.innerType._zod.optin),y($._zod,"optout",()=>v.innerType._zod.optout),y($._zod,"pattern",()=>{let D=v.innerType._zod.pattern;return D?new RegExp(`^(${_1(D.source)}|null)$`):void 0}),y($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(D,I)=>{if(D.value===null)return D;return v.innerType._zod.run(D,I)}}),jG=K("$ZodDefault",($,v)=>{i.init($,v),$._zod.optin="optional",y($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(D,I)=>{if(I.direction==="backward")return v.innerType._zod.run(D,I);if(D.value===void 0)return D.value=v.defaultValue,D;let U=v.innerType._zod.run(D,I);if(U instanceof Promise)return U.then((X)=>zY(X,v));return zY(U,v)}});function zY($,v){if($.value===void 0)$.value=v.defaultValue;return $}var wG=K("$ZodPrefault",($,v)=>{i.init($,v),$._zod.optin="optional",y($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(D,I)=>{if(I.direction==="backward")return v.innerType._zod.run(D,I);if(D.value===void 0)D.value=v.defaultValue;return v.innerType._zod.run(D,I)}}),PG=K("$ZodNonOptional",($,v)=>{i.init($,v),y($._zod,"values",()=>{let D=v.innerType._zod.values;return D?new Set([...D].filter((I)=>I!==void 0)):void 0}),$._zod.parse=(D,I)=>{let U=v.innerType._zod.run(D,I);if(U instanceof Promise)return U.then((X)=>WY(X,$));return WY(U,$)}});function WY($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var MG=K("$ZodSuccess",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{if(I.direction==="backward")throw new V6("ZodSuccess");let U=v.innerType._zod.run(D,I);if(U instanceof Promise)return U.then((X)=>{return D.value=X.issues.length===0,D});return D.value=U.issues.length===0,D}}),bG=K("$ZodCatch",($,v)=>{i.init($,v),$._zod.optin="optional",y($._zod,"optout",()=>v.innerType._zod.optout),y($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(D,I)=>{if(I.direction==="backward")return v.innerType._zod.run(D,I);let U=v.innerType._zod.run(D,I);if(U instanceof Promise)return U.then((X)=>{if(D.value=X.value,X.issues.length)D.value=v.catchValue({...D,error:{issues:X.issues.map((G)=>C$(G,I,L$()))},input:D.value}),D.issues=[],D.fallback=!0;return D});if(D.value=U.value,U.issues.length)D.value=v.catchValue({...D,error:{issues:U.issues.map((X)=>C$(X,I,L$()))},input:D.value}),D.issues=[],D.fallback=!0;return D}}),qG=K("$ZodNaN",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{if(typeof D.value!=="number"||!Number.isNaN(D.value))return D.issues.push({input:D.value,inst:$,expected:"nan",code:"invalid_type"}),D;return D}}),yU=K("$ZodPipe",($,v)=>{i.init($,v),y($._zod,"values",()=>v.in._zod.values),y($._zod,"optin",()=>v.in._zod.optin),y($._zod,"optout",()=>v.out._zod.optout),y($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(D,I)=>{if(I.direction==="backward"){let X=v.out._zod.run(D,I);if(X instanceof Promise)return X.then((G)=>gU(G,v.in,I));return gU(X,v.in,I)}let U=v.in._zod.run(D,I);if(U instanceof Promise)return U.then((X)=>gU(X,v.out,I));return gU(U,v.out,I)}});function gU($,v,D){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},D)}var vv=K("$ZodCodec",($,v)=>{i.init($,v),y($._zod,"values",()=>v.in._zod.values),y($._zod,"optin",()=>v.in._zod.optin),y($._zod,"optout",()=>v.out._zod.optout),y($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(D,I)=>{if((I.direction||"forward")==="forward"){let X=v.in._zod.run(D,I);if(X instanceof Promise)return X.then((G)=>RU(G,v,I));return RU(X,v,I)}else{let X=v.out._zod.run(D,I);if(X instanceof Promise)return X.then((G)=>RU(G,v,I));return RU(X,v,I)}}});function RU($,v,D){if($.issues.length)return $.aborted=!0,$;if((D.direction||"forward")==="forward"){let U=v.transform($.value,$);if(U instanceof Promise)return U.then((X)=>CU($,X,v.out,D));return CU($,U,v.out,D)}else{let U=v.reverseTransform($.value,$);if(U instanceof Promise)return U.then((X)=>CU($,X,v.in,D));return CU($,U,v.in,D)}}function CU($,v,D,I){if($.issues.length)return $.aborted=!0,$;return D._zod.run({value:v,issues:$.issues},I)}var SG=K("$ZodPreprocess",($,v)=>{yU.init($,v)}),kG=K("$ZodReadonly",($,v)=>{i.init($,v),y($._zod,"propValues",()=>v.innerType._zod.propValues),y($._zod,"values",()=>v.innerType._zod.values),y($._zod,"optin",()=>v.innerType?._zod?.optin),y($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(D,I)=>{if(I.direction==="backward")return v.innerType._zod.run(D,I);let U=v.innerType._zod.run(D,I);if(U instanceof Promise)return U.then(YY);return YY(U)}});function YY($){return $.value=Object.freeze($.value),$}var TG=K("$ZodTemplateLiteral",($,v)=>{i.init($,v);let D=[];for(let I of v.parts)if(typeof I==="object"&&I!==null){if(!I._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...I._zod.traits].shift()}`);let U=I._zod.pattern instanceof RegExp?I._zod.pattern.source:I._zod.pattern;if(!U)throw Error(`Invalid template literal part: ${I._zod.traits}`);let X=U.startsWith("^")?1:0,G=U.endsWith("$")?U.length-1:U.length;D.push(U.slice(X,G))}else if(I===null||PI.has(typeof I))D.push(v4(`${I}`));else throw Error(`Invalid template literal part: ${I}`);$._zod.pattern=new RegExp(`^${D.join("")}$`),$._zod.parse=(I,U)=>{if(typeof I.value!=="string")return I.issues.push({input:I.value,inst:$,expected:"string",code:"invalid_type"}),I;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(I.value))return I.issues.push({input:I.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),I;return I}}),EG=K("$ZodFunction",($,v)=>{return i.init($,v),$._def=v,$._zod.def=v,$.implement=(D)=>{if(typeof D!=="function")throw Error("implement() must be called with a function");return function(...I){let U=$._def.input?d1($._def.input,I):I,X=Reflect.apply(D,this,U);if($._def.output)return d1($._def.output,X);return X}},$.implementAsync=(D)=>{if(typeof D!=="function")throw Error("implementAsync() must be called with a function");return async function(...I){let U=$._def.input?await t1($._def.input,I):I,X=await Reflect.apply(D,this,U);if($._def.output)return await t1($._def.output,X);return X}},$._zod.parse=(D,I)=>{if(typeof D.value!=="function")return D.issues.push({code:"invalid_type",expected:"function",input:D.value,inst:$}),D;if($._def.output&&$._def.output._zod.def.type==="promise")D.value=$.implementAsync(D.value);else D.value=$.implement(D.value);return D},$.input=(...D)=>{let I=$.constructor;if(Array.isArray(D[0]))return new I({type:"function",input:new fU({type:"tuple",items:D[0],rest:D[1]}),output:$._def.output});return new I({type:"function",input:D[0],output:$._def.output})},$.output=(D)=>{return new $.constructor({type:"function",input:$._def.input,output:D})},$}),uG=K("$ZodPromise",($,v)=>{i.init($,v),$._zod.parse=(D,I)=>{return Promise.resolve(D.value).then((U)=>v.innerType._zod.run({value:U,issues:[]},I))}}),gG=K("$ZodLazy",($,v)=>{i.init($,v),y($._zod,"innerType",()=>{let D=v;if(!D._cachedInner)D._cachedInner=v.getter();return D._cachedInner}),y($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),y($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),y($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),y($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(D,I)=>{return $._zod.innerType._zod.run(D,I)}}),RG=K("$ZodCustom",($,v)=>{X$.init($,v),i.init($,v),$._zod.parse=(D,I)=>{return D},$._zod.check=(D)=>{let I=D.value,U=v.fn(I);if(U instanceof Promise)return U.then((X)=>LY(X,D,I,$));LY(U,D,I,$);return}});function LY($,v,D,I){if(!$){let U={code:"custom",input:D,inst:I,path:[...I._zod.def.path??[]],continue:!I._zod.def.abort};if(I._zod.def.params)U.params=I._zod.def.params;v.issues.push(E6(U))}}var Gv={};T4(Gv,{zhTW:()=>S8,zhCN:()=>q8,yo:()=>k8,vi:()=>b8,uz:()=>M8,ur:()=>P8,uk:()=>Xv,ua:()=>w8,tr:()=>j8,th:()=>O8,ta:()=>F8,sv:()=>H8,sl:()=>A8,ru:()=>Z8,ro:()=>N8,pt:()=>K8,ps:()=>V8,pl:()=>B8,ota:()=>L8,no:()=>Y8,nl:()=>W8,ms:()=>z8,mk:()=>J8,lt:()=>Q8,ko:()=>G8,km:()=>Dv,kh:()=>X8,ka:()=>I8,ja:()=>D8,it:()=>U8,is:()=>v8,id:()=>$8,hy:()=>sG,hu:()=>eG,hr:()=>aG,he:()=>oG,frCA:()=>pG,fr:()=>tG,fi:()=>dG,fa:()=>cG,es:()=>mG,eo:()=>rG,en:()=>Uv,el:()=>hG,de:()=>lG,da:()=>yG,cs:()=>_G,ca:()=>fG,bg:()=>xG,be:()=>nG,az:()=>iG,ar:()=>CG});var OH=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function v(U){return $[U]??null}let D={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:"مدخل"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${U.expected}، ولكن تم إدخال ${Q}`;return`مدخلات غير مقبولة: يفترض إدخال ${X}، ولكن تم إدخال ${Q}`}case"invalid_value":if(U.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${O(U.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return` أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${X} ${U.maximum.toString()} ${G.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${X} ${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${X} ${U.minimum.toString()} ${G.unit}`;return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${X} ${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${U.prefix}"`;if(X.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${X.suffix}"`;if(X.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${X.includes}"`;if(X.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${X.pattern}`;return`${D[X.format]??U.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${U.divisor}`;case"unrecognized_keys":return`معرف${U.keys.length>1?"ات":""} غريب${U.keys.length>1?"ة":""}: ${Z(U.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${U.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${U.origin}`;default:return"مدخل غير مقبول"}}};function CG(){return{localeError:OH()}}var jH=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Yanlış dəyər: gözlənilən instanceof ${U.expected}, daxil olan ${Q}`;return`Yanlış dəyər: gözlənilən ${X}, daxil olan ${Q}`}case"invalid_value":if(U.values.length===1)return`Yanlış dəyər: gözlənilən ${O(U.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${X}${U.maximum.toString()} ${G.unit??"element"}`;return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Çox kiçik: gözlənilən ${U.origin} ${X}${U.minimum.toString()} ${G.unit}`;return`Çox kiçik: gözlənilən ${U.origin} ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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ış ${D[X.format]??U.format}`}case"not_multiple_of":return`Yanlış ədəd: ${U.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${U.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function iG(){return{localeError:jH()}}function AY($,v,D,I){let U=Math.abs($),X=U%10,G=U%100;if(G>=11&&G<=19)return I;if(X===1)return v;if(X>=2&&X<=4)return D;return I}var wH=()=>{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 v(U){return $[U]??null}let D={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:"увод"},I={nan:"NaN",number:"лік",array:"масіў"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Няправільны ўвод: чакаўся instanceof ${U.expected}, атрымана ${Q}`;return`Няправільны ўвод: чакаўся ${X}, атрымана ${Q}`}case"invalid_value":if(U.values.length===1)return`Няправільны ўвод: чакалася ${O(U.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G){let Q=Number(U.maximum),J=AY(Q,G.unit.one,G.unit.few,G.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${G.verb} ${X}${U.maximum.toString()} ${J}`}return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна быць ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G){let Q=Number(U.minimum),J=AY(Q,G.unit.one,G.unit.few,G.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${G.verb} ${X}${U.minimum.toString()} ${J}`}return`Занадта малы: чакалася, што ${U.origin} павінна быць ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`Няправільны ${D[X.format]??U.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${U.keys.length>1?"ключы":"ключ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${U.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${U.origin}`;default:return"Няправільны ўвод"}}};function nG(){return{localeError:wH()}}var PH=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function v(U){return $[U]??null}let D={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:"вход"},I={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Невалиден вход: очакван instanceof ${U.expected}, получен ${Q}`;return`Невалиден вход: очакван ${X}, получен ${Q}`}case"invalid_value":if(U.values.length===1)return`Невалиден вход: очакван ${O(U.values[0])}`;return`Невалидна опция: очаквано едно от ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Твърде голямо: очаква се ${U.origin??"стойност"} да съдържа ${X}${U.maximum.toString()} ${G.unit??"елемента"}`;return`Твърде голямо: очаква се ${U.origin??"стойност"} да бъде ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Твърде малко: очаква се ${U.origin} да съдържа ${X}${U.minimum.toString()} ${G.unit}`;return`Твърде малко: очаква се ${U.origin} да бъде ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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}`;let G="Невалиден";if(X.format==="emoji")G="Невалидно";if(X.format==="datetime")G="Невалидно";if(X.format==="date")G="Невалидна";if(X.format==="time")G="Невалидно";if(X.format==="duration")G="Невалидна";return`${G} ${D[X.format]??U.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${U.divisor}`;case"unrecognized_keys":return`Неразпознат${U.keys.length>1?"и":""} ключ${U.keys.length>1?"ове":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${U.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${U.origin}`;default:return"Невалиден вход"}}};function xG(){return{localeError:PH()}}var MH=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Tipus invàlid: s'esperava instanceof ${U.expected}, s'ha rebut ${Q}`;return`Tipus invàlid: s'esperava ${X}, s'ha rebut ${Q}`}case"invalid_value":if(U.values.length===1)return`Valor invàlid: s'esperava ${O(U.values[0])}`;return`Opció invàlida: s'esperava una de ${Z(U.values," o ")}`;case"too_big":{let X=U.inclusive?"com a màxim":"menys de",G=v(U.origin);if(G)return`Massa gran: s'esperava que ${U.origin??"el valor"} contingués ${X} ${U.maximum.toString()} ${G.unit??"elements"}`;return`Massa gran: s'esperava que ${U.origin??"el valor"} fos ${X} ${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?"com a mínim":"més de",G=v(U.origin);if(G)return`Massa petit: s'esperava que ${U.origin} contingués ${X} ${U.minimum.toString()} ${G.unit}`;return`Massa petit: s'esperava que ${U.origin} fos ${X} ${U.minimum.toString()}`}case"invalid_format":{let X=U;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 ${D[X.format]??U.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${U.divisor}`;case"unrecognized_keys":return`Clau${U.keys.length>1?"s":""} no reconeguda${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${U.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${U.origin}`;default:return"Entrada invàlida"}}};function fG(){return{localeError:MH()}}var bH=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Neplatný vstup: očekáváno instanceof ${U.expected}, obdrženo ${Q}`;return`Neplatný vstup: očekáváno ${X}, obdrženo ${Q}`}case"invalid_value":if(U.values.length===1)return`Neplatný vstup: očekáváno ${O(U.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí mít ${X}${U.maximum.toString()} ${G.unit??"prvků"}`;return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí být ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí mít ${X}${U.minimum.toString()} ${G.unit??"prvků"}`;return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí být ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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 ${D[X.format]??U.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${U.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${Z(U.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${U.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${U.origin}`;default:return"Neplatný vstup"}}};function _G(){return{localeError:bH()}}var qH=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Ugyldigt input: forventede instanceof ${U.expected}, fik ${Q}`;return`Ugyldigt input: forventede ${X}, fik ${Q}`}case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${O(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin),Q=I[U.origin]??U.origin;if(G)return`For stor: forventede ${Q??"value"} ${G.verb} ${X} ${U.maximum.toString()} ${G.unit??"elementer"}`;return`For stor: forventede ${Q??"value"} havde ${X} ${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin),Q=I[U.origin]??U.origin;if(G)return`For lille: forventede ${Q} ${G.verb} ${X} ${U.minimum.toString()} ${G.unit}`;return`For lille: forventede ${Q} havde ${X} ${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Ugyldig streng: skal starte med "${X.prefix}"`;if(X.format==="ends_with")return`Ugyldig streng: skal ende med "${X.suffix}"`;if(X.format==="includes")return`Ugyldig streng: skal indeholde "${X.includes}"`;if(X.format==="regex")return`Ugyldig streng: skal matche mønsteret ${X.pattern}`;return`Ugyldig ${D[X.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function yG(){return{localeError:qH()}}var SH=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"Zahl",array:"Array"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Ungültige Eingabe: erwartet instanceof ${U.expected}, erhalten ${Q}`;return`Ungültige Eingabe: erwartet ${X}, erhalten ${Q}`}case"invalid_value":if(U.values.length===1)return`Ungültige Eingabe: erwartet ${O(U.values[0])}`;return`Ungültige Option: erwartet eine von ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${X}${U.maximum.toString()} ${G.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${X}${U.maximum.toString()} ist`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Zu klein: erwartet, dass ${U.origin} ${X}${U.minimum.toString()} ${G.unit} hat`;return`Zu klein: erwartet, dass ${U.origin} ${X}${U.minimum.toString()} ist`}case"invalid_format":{let X=U;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: ${D[X.format]??U.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${U.divisor} sein`;case"unrecognized_keys":return`${U.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${U.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${U.origin}`;default:return"Ungültige Eingabe"}}};function lG(){return{localeError:SH()}}var kH=()=>{let $={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function v(U){return $[U]??null}let D={regex:"είσοδος",email:"διεύθυνση 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",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(typeof U.expected==="string"&&/^[A-Z]/.test(U.expected))return`Μη έγκυρη είσοδος: αναμενόταν instanceof ${U.expected}, λήφθηκε ${Q}`;return`Μη έγκυρη είσοδος: αναμενόταν ${X}, λήφθηκε ${Q}`}case"invalid_value":if(U.values.length===1)return`Μη έγκυρη είσοδος: αναμενόταν ${O(U.values[0])}`;return`Μη έγκυρη επιλογή: αναμενόταν ένα από ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Πολύ μεγάλο: αναμενόταν ${U.origin??"τιμή"} να έχει ${X}${U.maximum.toString()} ${G.unit??"στοιχεία"}`;return`Πολύ μεγάλο: αναμενόταν ${U.origin??"τιμή"} να είναι ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Πολύ μικρό: αναμενόταν ${U.origin} να έχει ${X}${U.minimum.toString()} ${G.unit}`;return`Πολύ μικρό: αναμενόταν ${U.origin} να είναι ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`Μη έγκυρο: ${D[X.format]??U.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${U.divisor}`;case"unrecognized_keys":return`Άγνωστ${U.keys.length>1?"α":"ο"} κλειδ${U.keys.length>1?"ιά":"ί"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${U.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${U.origin}`;default:return"Μη έγκυρη είσοδος"}}};function hG(){return{localeError:kH()}}var TH=()=>{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"},map:{unit:"entries",verb:"to have"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;return`Invalid input: expected ${X}, received ${Q}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${O(U.values[0])}`;return`Invalid option: expected one of ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Too big: expected ${U.origin??"value"} to have ${X}${U.maximum.toString()} ${G.unit??"elements"}`;return`Too big: expected ${U.origin??"value"} to be ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Too small: expected ${U.origin} to have ${X}${U.minimum.toString()} ${G.unit}`;return`Too small: expected ${U.origin} to be ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Invalid string: must start with "${X.prefix}"`;if(X.format==="ends_with")return`Invalid string: must end with "${X.suffix}"`;if(X.format==="includes")return`Invalid string: must include "${X.includes}"`;if(X.format==="regex")return`Invalid string: must match pattern ${X.pattern}`;return`Invalid ${D[X.format]??U.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${U.divisor}`;case"unrecognized_keys":return`Unrecognized key${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Invalid key in ${U.origin}`;case"invalid_union":if(U.options&&Array.isArray(U.options)&&U.options.length>0)return`Invalid discriminator value. Expected ${U.options.map((G)=>`'${G}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${U.origin}`;default:return"Invalid input"}}};function Uv(){return{localeError:TH()}}var EH=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Nevalida enigo: atendiĝis instanceof ${U.expected}, riceviĝis ${Q}`;return`Nevalida enigo: atendiĝis ${X}, riceviĝis ${Q}`}case"invalid_value":if(U.values.length===1)return`Nevalida enigo: atendiĝis ${O(U.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${X}${U.maximum.toString()} ${G.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Tro malgranda: atendiĝis ke ${U.origin} havu ${X}${U.minimum.toString()} ${G.unit}`;return`Tro malgranda: atendiĝis ke ${U.origin} estu ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${X.prefix}"`;if(X.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${X.suffix}"`;if(X.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${X.includes}"`;if(X.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${X.pattern}`;return`Nevalida ${D[X.format]??U.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${U.divisor}`;case"unrecognized_keys":return`Nekonata${U.keys.length>1?"j":""} ŝlosilo${U.keys.length>1?"j":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${U.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${U.origin}`;default:return"Nevalida enigo"}}};function rG(){return{localeError:EH()}}var uH=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",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"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Entrada inválida: se esperaba instanceof ${U.expected}, recibido ${Q}`;return`Entrada inválida: se esperaba ${X}, recibido ${Q}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${O(U.values[0])}`;return`Opción inválida: se esperaba una de ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin),Q=I[U.origin]??U.origin;if(G)return`Demasiado grande: se esperaba que ${Q??"valor"} tuviera ${X}${U.maximum.toString()} ${G.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${Q??"valor"} fuera ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin),Q=I[U.origin]??U.origin;if(G)return`Demasiado pequeño: se esperaba que ${Q} tuviera ${X}${U.minimum.toString()} ${G.unit}`;return`Demasiado pequeño: se esperaba que ${Q} fuera ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Cadena inválida: debe comenzar con "${X.prefix}"`;if(X.format==="ends_with")return`Cadena inválida: debe terminar en "${X.suffix}"`;if(X.format==="includes")return`Cadena inválida: debe incluir "${X.includes}"`;if(X.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${X.pattern}`;return`Inválido ${D[X.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${I[U.origin]??U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${I[U.origin]??U.origin}`;default:return"Entrada inválida"}}};function mG(){return{localeError:uH()}}var gH=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function v(U){return $[U]??null}let D={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:"ورودی"},I={nan:"NaN",number:"عدد",array:"آرایه"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`ورودی نامعتبر: میبایست instanceof ${U.expected} میبود، ${Q} دریافت شد`;return`ورودی نامعتبر: میبایست ${X} میبود، ${Q} دریافت شد`}case"invalid_value":if(U.values.length===1)return`ورودی نامعتبر: میبایست ${O(U.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${Z(U.values,"|")} میبود`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${X}${U.maximum.toString()} ${G.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${X}${U.maximum.toString()} باشد`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`خیلی کوچک: ${U.origin} باید ${X}${U.minimum.toString()} ${G.unit} باشد`;return`خیلی کوچک: ${U.origin} باید ${X}${U.minimum.toString()} باشد`}case"invalid_format":{let X=U;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`${D[X.format]??U.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${U.divisor} باشد`;case"unrecognized_keys":return`کلید${U.keys.length>1?"های":""} ناشناس: ${Z(U.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${U.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${U.origin}`;default:return"ورودی نامعتبر"}}};function cG(){return{localeError:gH()}}var RH=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Virheellinen tyyppi: odotettiin instanceof ${U.expected}, oli ${Q}`;return`Virheellinen tyyppi: odotettiin ${X}, oli ${Q}`}case"invalid_value":if(U.values.length===1)return`Virheellinen syöte: täytyy olla ${O(U.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Liian suuri: ${G.subject} täytyy olla ${X}${U.maximum.toString()} ${G.unit}`.trim();return`Liian suuri: arvon täytyy olla ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Liian pieni: ${G.subject} täytyy olla ${X}${U.minimum.toString()} ${G.unit}`.trim();return`Liian pieni: arvon täytyy olla ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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 ${D[X.format]??U.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${U.divisor} monikerta`;case"unrecognized_keys":return`${U.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Z(U.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 dG(){return{localeError:RH()}}var CH=()=>{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 v(U){return $[U]??null}let D={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"},I={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : instanceof ${U.expected} attendu, ${Q} reçu`;return`Entrée invalide : ${X} attendu, ${Q} reçu`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : ${O(U.values[0])} attendu`;return`Option invalide : une valeur parmi ${Z(U.values,"|")} attendue`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Trop grand : ${I[U.origin]??"valeur"} doit ${G.verb} ${X}${U.maximum.toString()} ${G.unit??"élément(s)"}`;return`Trop grand : ${I[U.origin]??"valeur"} doit être ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Trop petit : ${I[U.origin]??"valeur"} doit ${G.verb} ${X}${U.minimum.toString()} ${G.unit}`;return`Trop petit : ${I[U.origin]??"valeur"} doit être ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`${D[X.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${Z(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function tG(){return{localeError:CH()}}var iH=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : attendu instanceof ${U.expected}, reçu ${Q}`;return`Entrée invalide : attendu ${X}, reçu ${Q}`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : attendu ${O(U.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"≤":"<",G=v(U.origin);if(G)return`Trop grand : attendu que ${U.origin??"la valeur"} ait ${X}${U.maximum.toString()} ${G.unit}`;return`Trop grand : attendu que ${U.origin??"la valeur"} soit ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?"≥":">",G=v(U.origin);if(G)return`Trop petit : attendu que ${U.origin} ait ${X}${U.minimum.toString()} ${G.unit}`;return`Trop petit : attendu que ${U.origin} soit ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`${D[X.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${Z(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function pG(){return{localeError:iH()}}var nH=()=>{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"}},v={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},D=(z)=>z?$[z]:void 0,I=(z)=>{let W=D(z);if(W)return W.label;return z??$.unknown.label},U=(z)=>`ה${I(z)}`,X=(z)=>{return(D(z)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},G=(z)=>{if(!z)return null;return v[z]??null},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"}},J={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let W=z.expected,Y=J[W??""]??I(W),L=j(z.input),V=J[L]??$[L]?.label??L;if(/^[A-Z]/.test(z.expected))return`קלט לא תקין: צריך להיות instanceof ${z.expected}, התקבל ${V}`;return`קלט לא תקין: צריך להיות ${Y}, התקבל ${V}`}case"invalid_value":{if(z.values.length===1)return`ערך לא תקין: הערך חייב להיות ${O(z.values[0])}`;let W=z.values.map((V)=>O(V));if(z.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${W[0]} או ${W[1]}`;let Y=W[W.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${W.slice(0,-1).join(", ")} או ${Y}`}case"too_big":{let W=G(z.origin),Y=U(z.origin??"value");if(z.origin==="string")return`${W?.longLabel??"ארוך"} מדי: ${Y} צריכה להכיל ${z.maximum.toString()} ${W?.unit??""} ${z.inclusive?"או פחות":"לכל היותר"}`.trim();if(z.origin==="number"){let B=z.inclusive?`קטן או שווה ל-${z.maximum}`:`קטן מ-${z.maximum}`;return`גדול מדי: ${Y} צריך להיות ${B}`}if(z.origin==="array"||z.origin==="set"){let B=z.origin==="set"?"צריכה":"צריך",N=z.inclusive?`${z.maximum} ${W?.unit??""} או פחות`:`פחות מ-${z.maximum} ${W?.unit??""}`;return`גדול מדי: ${Y} ${B} להכיל ${N}`.trim()}let L=z.inclusive?"<=":"<",V=X(z.origin??"value");if(W?.unit)return`${W.longLabel} מדי: ${Y} ${V} ${L}${z.maximum.toString()} ${W.unit}`;return`${W?.longLabel??"גדול"} מדי: ${Y} ${V} ${L}${z.maximum.toString()}`}case"too_small":{let W=G(z.origin),Y=U(z.origin??"value");if(z.origin==="string")return`${W?.shortLabel??"קצר"} מדי: ${Y} צריכה להכיל ${z.minimum.toString()} ${W?.unit??""} ${z.inclusive?"או יותר":"לפחות"}`.trim();if(z.origin==="number"){let B=z.inclusive?`גדול או שווה ל-${z.minimum}`:`גדול מ-${z.minimum}`;return`קטן מדי: ${Y} צריך להיות ${B}`}if(z.origin==="array"||z.origin==="set"){let B=z.origin==="set"?"צריכה":"צריך";if(z.minimum===1&&z.inclusive){let A=z.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Y} ${B} להכיל ${A}`}let N=z.inclusive?`${z.minimum} ${W?.unit??""} או יותר`:`יותר מ-${z.minimum} ${W?.unit??""}`;return`קטן מדי: ${Y} ${B} להכיל ${N}`.trim()}let L=z.inclusive?">=":">",V=X(z.origin??"value");if(W?.unit)return`${W.shortLabel} מדי: ${Y} ${V} ${L}${z.minimum.toString()} ${W.unit}`;return`${W?.shortLabel??"קטן"} מדי: ${Y} ${V} ${L}${z.minimum.toString()}`}case"invalid_format":{let W=z;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 Y=Q[W.format],L=Y?.label??W.format,B=(Y?.gender??"m")==="f"?"תקינה":"תקין";return`${L} לא ${B}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${z.divisor}`;case"unrecognized_keys":return`מפתח${z.keys.length>1?"ות":""} לא מזוה${z.keys.length>1?"ים":"ה"}: ${Z(z.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(z.origin??"array")}`;default:return"קלט לא תקין"}}};function oG(){return{localeError:nH()}}var xH=()=>{let $={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function v(U){return $[U]??null}let D={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},I={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Neispravan unos: očekuje se instanceof ${U.expected}, a primljeno je ${Q}`;return`Neispravan unos: očekuje se ${X}, a primljeno je ${Q}`}case"invalid_value":if(U.values.length===1)return`Neispravna vrijednost: očekivano ${O(U.values[0])}`;return`Neispravna opcija: očekivano jedno od ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin),Q=I[U.origin]??U.origin;if(G)return`Preveliko: očekivano da ${Q??"vrijednost"} ima ${X}${U.maximum.toString()} ${G.unit??"elemenata"}`;return`Preveliko: očekivano da ${Q??"vrijednost"} bude ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin),Q=I[U.origin]??U.origin;if(G)return`Premalo: očekivano da ${Q} ima ${X}${U.minimum.toString()} ${G.unit}`;return`Premalo: očekivano da ${Q} bude ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Neispravan tekst: mora započinjati s "${X.prefix}"`;if(X.format==="ends_with")return`Neispravan tekst: mora završavati s "${X.suffix}"`;if(X.format==="includes")return`Neispravan tekst: mora sadržavati "${X.includes}"`;if(X.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${X.pattern}`;return`Neispravna ${D[X.format]??U.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${U.divisor}`;case"unrecognized_keys":return`Neprepoznat${U.keys.length>1?"i ključevi":" ključ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${I[U.origin]??U.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${I[U.origin]??U.origin}`;default:return"Neispravan unos"}}};function aG(){return{localeError:xH()}}var fH=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"szám",array:"tömb"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Érvénytelen bemenet: a várt érték instanceof ${U.expected}, a kapott érték ${Q}`;return`Érvénytelen bemenet: a várt érték ${X}, a kapott érték ${Q}`}case"invalid_value":if(U.values.length===1)return`Érvénytelen bemenet: a várt érték ${O(U.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Túl nagy: ${U.origin??"érték"} mérete túl nagy ${X}${U.maximum.toString()} ${G.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${U.origin??"érték"} túl nagy: ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Túl kicsi: a bemeneti érték ${U.origin} mérete túl kicsi ${X}${U.minimum.toString()} ${G.unit}`;return`Túl kicsi: a bemeneti érték ${U.origin} túl kicsi ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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 ${D[X.format]??U.format}`}case"not_multiple_of":return`Érvénytelen szám: ${U.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${U.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${U.origin}`;default:return"Érvénytelen bemenet"}}};function eG(){return{localeError:fH()}}function HY($,v,D){return Math.abs($)===1?v:D}function x6($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],D=$[$.length-1];return $+(v.includes(D)?"ն":"ը")}var _H=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function v(U){return $[U]??null}let D={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:"մուտք"},I={nan:"NaN",number:"թիվ",array:"զանգված"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${U.expected}, ստացվել է ${Q}`;return`Սխալ մուտքագրում․ սպասվում էր ${X}, ստացվել է ${Q}`}case"invalid_value":if(U.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${O(U.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G){let Q=Number(U.maximum),J=HY(Q,G.unit.one,G.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${x6(U.origin??"արժեք")} կունենա ${X}${U.maximum.toString()} ${J}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${x6(U.origin??"արժեք")} լինի ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G){let Q=Number(U.minimum),J=HY(Q,G.unit.one,G.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${x6(U.origin)} կունենա ${X}${U.minimum.toString()} ${J}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${x6(U.origin)} լինի ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`Սխալ ${D[X.format]??U.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${U.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${U.keys.length>1?"ներ":""}. ${Z(U.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${x6(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${x6(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function sG(){return{localeError:_H()}}var yH=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Input tidak valid: diharapkan instanceof ${U.expected}, diterima ${Q}`;return`Input tidak valid: diharapkan ${X}, diterima ${Q}`}case"invalid_value":if(U.values.length===1)return`Input tidak valid: diharapkan ${O(U.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Terlalu besar: diharapkan ${U.origin??"value"} memiliki ${X}${U.maximum.toString()} ${G.unit??"elemen"}`;return`Terlalu besar: diharapkan ${U.origin??"value"} menjadi ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Terlalu kecil: diharapkan ${U.origin} memiliki ${X}${U.minimum.toString()} ${G.unit}`;return`Terlalu kecil: diharapkan ${U.origin} menjadi ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`${D[X.format]??U.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${U.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${U.origin}`;default:return"Input tidak valid"}}};function $8(){return{localeError:yH()}}var lH=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"númer",array:"fylki"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Rangt gildi: Þú slóst inn ${Q} þar sem á að vera instanceof ${U.expected}`;return`Rangt gildi: Þú slóst inn ${Q} þar sem á að vera ${X}`}case"invalid_value":if(U.values.length===1)return`Rangt gildi: gert ráð fyrir ${O(U.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} hafi ${X}${U.maximum.toString()} ${G.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} sé ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Of lítið: gert er ráð fyrir að ${U.origin} hafi ${X}${U.minimum.toString()} ${G.unit}`;return`Of lítið: gert er ráð fyrir að ${U.origin} sé ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Ógildur strengur: verður að byrja á "${X.prefix}"`;if(X.format==="ends_with")return`Ógildur strengur: verður að enda á "${X.suffix}"`;if(X.format==="includes")return`Ógildur strengur: verður að innihalda "${X.includes}"`;if(X.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${X.pattern}`;return`Rangt ${D[X.format]??U.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${U.divisor}`;case"unrecognized_keys":return`Óþekkt ${U.keys.length>1?"ir lyklar":"ur lykill"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${U.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${U.origin}`;default:return"Rangt gildi"}}};function v8(){return{localeError:lH()}}var hH=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"numero",array:"vettore"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Input non valido: atteso instanceof ${U.expected}, ricevuto ${Q}`;return`Input non valido: atteso ${X}, ricevuto ${Q}`}case"invalid_value":if(U.values.length===1)return`Input non valido: atteso ${O(U.values[0])}`;return`Opzione non valida: atteso uno tra ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Troppo grande: ${U.origin??"valore"} deve avere ${X}${U.maximum.toString()} ${G.unit??"elementi"}`;return`Troppo grande: ${U.origin??"valore"} deve essere ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Troppo piccolo: ${U.origin} deve avere ${X}${U.minimum.toString()} ${G.unit}`;return`Troppo piccolo: ${U.origin} deve essere ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`Input non valido: ${D[X.format]??U.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${U.divisor}`;case"unrecognized_keys":return`Chiav${U.keys.length>1?"i":"e"} non riconosciut${U.keys.length>1?"e":"a"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${U.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${U.origin}`;default:return"Input non valido"}}};function U8(){return{localeError:hH()}}var rH=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function v(U){return $[U]??null}let D={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:"入力値"},I={nan:"NaN",number:"数値",array:"配列"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`無効な入力: instanceof ${U.expected}が期待されましたが、${Q}が入力されました`;return`無効な入力: ${X}が期待されましたが、${Q}が入力されました`}case"invalid_value":if(U.values.length===1)return`無効な入力: ${O(U.values[0])}が期待されました`;return`無効な選択: ${Z(U.values,"、")}のいずれかである必要があります`;case"too_big":{let X=U.inclusive?"以下である":"より小さい",G=v(U.origin);if(G)return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${G.unit??"要素"}${X}必要があります`;return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${X}必要があります`}case"too_small":{let X=U.inclusive?"以上である":"より大きい",G=v(U.origin);if(G)return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${G.unit}${X}必要があります`;return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${X}必要があります`}case"invalid_format":{let X=U;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`無効な${D[X.format]??U.format}`}case"not_multiple_of":return`無効な数値: ${U.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${U.keys.length>1?"群":""}: ${Z(U.keys,"、")}`;case"invalid_key":return`${U.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${U.origin}内の無効な値`;default:return"無効な入力"}}};function D8(){return{localeError:rH()}}var mH=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function v(U){return $[U]??null}let D={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:"შეყვანა"},I={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${U.expected}, მიღებული ${Q}`;return`არასწორი შეყვანა: მოსალოდნელი ${X}, მიღებული ${Q}`}case"invalid_value":if(U.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${O(U.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${Z(U.values,"|")}-დან`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} ${G.verb} ${X}${U.maximum.toString()} ${G.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} იყოს ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} ${G.verb} ${X}${U.minimum.toString()} ${G.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} იყოს ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`არასწორი ${D[X.format]??U.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${U.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${U.keys.length>1?"ები":"ი"}: ${Z(U.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${U.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${U.origin}-ში`;default:return"არასწორი შეყვანა"}}};function I8(){return{localeError:mH()}}var cH=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function v(U){return $[U]??null}let D={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:"ទិន្នន័យបញ្ចូល"},I={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${U.expected} ប៉ុន្តែទទួលបាន ${Q}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${X} ប៉ុន្តែទទួលបាន ${Q}`}case"invalid_value":if(U.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${O(U.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${X} ${U.maximum.toString()} ${G.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${X} ${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`តូចពេក៖ ត្រូវការ ${U.origin} ${X} ${U.minimum.toString()} ${G.unit}`;return`តូចពេក៖ ត្រូវការ ${U.origin} ${X} ${U.minimum.toString()}`}case"invalid_format":{let X=U;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`មិនត្រឹមត្រូវ៖ ${D[X.format]??U.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${U.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${Z(U.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Dv(){return{localeError:cH()}}function X8(){return Dv()}var dH=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function v(U){return $[U]??null}let D={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:"입력"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`잘못된 입력: 예상 타입은 instanceof ${U.expected}, 받은 타입은 ${Q}입니다`;return`잘못된 입력: 예상 타입은 ${X}, 받은 타입은 ${Q}입니다`}case"invalid_value":if(U.values.length===1)return`잘못된 입력: 값은 ${O(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${Z(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let X=U.inclusive?"이하":"미만",G=X==="미만"?"이어야 합니다":"여야 합니다",Q=v(U.origin),J=Q?.unit??"요소";if(Q)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${J} ${X}${G}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${X}${G}`}case"too_small":{let X=U.inclusive?"이상":"초과",G=X==="이상"?"이어야 합니다":"여야 합니다",Q=v(U.origin),J=Q?.unit??"요소";if(Q)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${J} ${X}${G}`;return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()} ${X}${G}`}case"invalid_format":{let X=U;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`잘못된 ${D[X.format]??U.format}`}case"not_multiple_of":return`잘못된 숫자: ${U.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${Z(U.keys,", ")}`;case"invalid_key":return`잘못된 키: ${U.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${U.origin}`;default:return"잘못된 입력"}}};function G8(){return{localeError:dH()}}var Iv=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function FY($){let v=Math.abs($),D=v%10,I=v%100;if(I>=11&&I<=19||D===0)return"many";if(D===1)return"one";return"few"}var tH=()=>{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 v(U,X,G,Q){let J=$[U]??null;if(J===null)return J;return{unit:J.unit[X],verb:J.verb[Q][G?"inclusive":"notInclusive"]}}let D={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"},I={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Gautas tipas ${Q}, o tikėtasi - instanceof ${U.expected}`;return`Gautas tipas ${Q}, o tikėtasi - ${X}`}case"invalid_value":if(U.values.length===1)return`Privalo būti ${O(U.values[0])}`;return`Privalo būti vienas iš ${Z(U.values,"|")} pasirinkimų`;case"too_big":{let X=I[U.origin]??U.origin,G=v(U.origin,FY(Number(U.maximum)),U.inclusive??!1,"smaller");if(G?.verb)return`${Iv(X??U.origin??"reikšmė")} ${G.verb} ${U.maximum.toString()} ${G.unit??"elementų"}`;let Q=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Iv(X??U.origin??"reikšmė")} turi būti ${Q} ${U.maximum.toString()} ${G?.unit}`}case"too_small":{let X=I[U.origin]??U.origin,G=v(U.origin,FY(Number(U.minimum)),U.inclusive??!1,"bigger");if(G?.verb)return`${Iv(X??U.origin??"reikšmė")} ${G.verb} ${U.minimum.toString()} ${G.unit??"elementų"}`;let Q=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Iv(X??U.origin??"reikšmė")} turi būti ${Q} ${U.minimum.toString()} ${G?.unit}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Eilutė privalo prasidėti "${X.prefix}"`;if(X.format==="ends_with")return`Eilutė privalo pasibaigti "${X.suffix}"`;if(X.format==="includes")return`Eilutė privalo įtraukti "${X.includes}"`;if(X.format==="regex")return`Eilutė privalo atitikti ${X.pattern}`;return`Neteisingas ${D[X.format]??U.format}`}case"not_multiple_of":return`Skaičius privalo būti ${U.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${U.keys.length>1?"i":"as"} rakt${U.keys.length>1?"ai":"as"}: ${Z(U.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let X=I[U.origin]??U.origin;return`${Iv(X??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Q8(){return{localeError:tH()}}var pH=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function v(U){return $[U]??null}let D={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:"внес"},I={nan:"NaN",number:"број",array:"низа"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Грешен внес: се очекува instanceof ${U.expected}, примено ${Q}`;return`Грешен внес: се очекува ${X}, примено ${Q}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${O(U.values[0])}`;return`Грешана опција: се очекува една ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Премногу голем: се очекува ${U.origin??"вредноста"} да има ${X}${U.maximum.toString()} ${G.unit??"елементи"}`;return`Премногу голем: се очекува ${U.origin??"вредноста"} да биде ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Премногу мал: се очекува ${U.origin} да има ${X}${U.minimum.toString()} ${G.unit}`;return`Премногу мал: се очекува ${U.origin} да биде ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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 ${D[X.format]??U.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${U.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${U.origin}`;default:return"Грешен внес"}}};function J8(){return{localeError:pH()}}var oH=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"nombor"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Input tidak sah: dijangka instanceof ${U.expected}, diterima ${Q}`;return`Input tidak sah: dijangka ${X}, diterima ${Q}`}case"invalid_value":if(U.values.length===1)return`Input tidak sah: dijangka ${O(U.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Terlalu besar: dijangka ${U.origin??"nilai"} ${G.verb} ${X}${U.maximum.toString()} ${G.unit??"elemen"}`;return`Terlalu besar: dijangka ${U.origin??"nilai"} adalah ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Terlalu kecil: dijangka ${U.origin} ${G.verb} ${X}${U.minimum.toString()} ${G.unit}`;return`Terlalu kecil: dijangka ${U.origin} adalah ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`${D[X.format]??U.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Z(U.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${U.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${U.origin}`;default:return"Input tidak sah"}}};function z8(){return{localeError:oH()}}var aH=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"getal"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Ongeldige invoer: verwacht instanceof ${U.expected}, ontving ${Q}`;return`Ongeldige invoer: verwacht ${X}, ontving ${Q}`}case"invalid_value":if(U.values.length===1)return`Ongeldige invoer: verwacht ${O(U.values[0])}`;return`Ongeldige optie: verwacht één van ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin),Q=U.origin==="date"?"laat":U.origin==="string"?"lang":"groot";if(G)return`Te ${Q}: verwacht dat ${U.origin??"waarde"} ${X}${U.maximum.toString()} ${G.unit??"elementen"} ${G.verb}`;return`Te ${Q}: verwacht dat ${U.origin??"waarde"} ${X}${U.maximum.toString()} is`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin),Q=U.origin==="date"?"vroeg":U.origin==="string"?"kort":"klein";if(G)return`Te ${Q}: verwacht dat ${U.origin} ${X}${U.minimum.toString()} ${G.unit} ${G.verb}`;return`Te ${Q}: verwacht dat ${U.origin} ${X}${U.minimum.toString()} is`}case"invalid_format":{let X=U;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: ${D[X.format]??U.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${U.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${U.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${U.origin}`;default:return"Ongeldige invoer"}}};function W8(){return{localeError:aH()}}var eH=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"tall",array:"liste"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Ugyldig input: forventet instanceof ${U.expected}, fikk ${Q}`;return`Ugyldig input: forventet ${X}, fikk ${Q}`}case"invalid_value":if(U.values.length===1)return`Ugyldig verdi: forventet ${O(U.values[0])}`;return`Ugyldig valg: forventet en av ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`For stor(t): forventet ${U.origin??"value"} til å ha ${X}${U.maximum.toString()} ${G.unit??"elementer"}`;return`For stor(t): forventet ${U.origin??"value"} til å ha ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`For lite(n): forventet ${U.origin} til å ha ${X}${U.minimum.toString()} ${G.unit}`;return`For lite(n): forventet ${U.origin} til å ha ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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 ${D[X.format]??U.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${U.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${U.origin}`;default:return"Ugyldig input"}}};function Y8(){return{localeError:eH()}}var sH=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Fâsit giren: umulan instanceof ${U.expected}, alınan ${Q}`;return`Fâsit giren: umulan ${X}, alınan ${Q}`}case"invalid_value":if(U.values.length===1)return`Fâsit giren: umulan ${O(U.values[0])}`;return`Fâsit tercih: mûteberler ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Fazla büyük: ${U.origin??"value"}, ${X}${U.maximum.toString()} ${G.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${U.origin??"value"}, ${X}${U.maximum.toString()} olmalıydı.`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Fazla küçük: ${U.origin}, ${X}${U.minimum.toString()} ${G.unit} sahip olmalıydı.`;return`Fazla küçük: ${U.origin}, ${X}${U.minimum.toString()} olmalıydı.`}case"invalid_format":{let X=U;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 ${D[X.format]??U.format}`}case"not_multiple_of":return`Fâsit sayı: ${U.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${U.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function L8(){return{localeError:sH()}}var $F=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function v(U){return $[U]??null}let D={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:"ورودي"},I={nan:"NaN",number:"عدد",array:"ارې"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`ناسم ورودي: باید instanceof ${U.expected} وای, مګر ${Q} ترلاسه شو`;return`ناسم ورودي: باید ${X} وای, مګر ${Q} ترلاسه شو`}case"invalid_value":if(U.values.length===1)return`ناسم ورودي: باید ${O(U.values[0])} وای`;return`ناسم انتخاب: باید یو له ${Z(U.values,"|")} څخه وای`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`ډیر لوی: ${U.origin??"ارزښت"} باید ${X}${U.maximum.toString()} ${G.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${U.origin??"ارزښت"} باید ${X}${U.maximum.toString()} وي`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`ډیر کوچنی: ${U.origin} باید ${X}${U.minimum.toString()} ${G.unit} ولري`;return`ډیر کوچنی: ${U.origin} باید ${X}${U.minimum.toString()} وي`}case"invalid_format":{let X=U;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`${D[X.format]??U.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${U.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${U.keys.length>1?"کلیډونه":"کلیډ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${U.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${U.origin} کې`;default:return"ناسمه ورودي"}}};function V8(){return{localeError:$F()}}var vF=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"liczba",array:"tablica"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${U.expected}, otrzymano ${Q}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${X}, otrzymano ${Q}`}case"invalid_value":if(U.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${O(U.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Za duża wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${X}${U.maximum.toString()} ${G.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Za mała wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${X}${U.minimum.toString()} ${G.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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) ${D[X.format]??U.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${U.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${U.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${U.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function B8(){return{localeError:vF()}}var UF=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"número",null:"nulo"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Tipo inválido: esperado instanceof ${U.expected}, recebido ${Q}`;return`Tipo inválido: esperado ${X}, recebido ${Q}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: esperado ${O(U.values[0])}`;return`Opção inválida: esperada uma das ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Muito grande: esperado que ${U.origin??"valor"} tivesse ${X}${U.maximum.toString()} ${G.unit??"elementos"}`;return`Muito grande: esperado que ${U.origin??"valor"} fosse ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Muito pequeno: esperado que ${U.origin} tivesse ${X}${U.minimum.toString()} ${G.unit}`;return`Muito pequeno: esperado que ${U.origin} fosse ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`${D[X.format]??U.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Chave${U.keys.length>1?"s":""} desconhecida${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Chave inválida em ${U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${U.origin}`;default:return"Campo inválido"}}};function K8(){return{localeError:UF()}}var DF=()=>{let $={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function v(U){return $[U]??null}let D={regex:"intrare",email:"adresă de 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:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},I={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;return`Intrare invalidă: așteptat ${X}, primit ${Q}`}case"invalid_value":if(U.values.length===1)return`Intrare invalidă: așteptat ${O(U.values[0])}`;return`Opțiune invalidă: așteptat una dintre ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Prea mare: așteptat ca ${U.origin??"valoarea"} ${G.verb} ${X}${U.maximum.toString()} ${G.unit??"elemente"}`;return`Prea mare: așteptat ca ${U.origin??"valoarea"} să fie ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Prea mic: așteptat ca ${U.origin} ${G.verb} ${X}${U.minimum.toString()} ${G.unit}`;return`Prea mic: așteptat ca ${U.origin} să fie ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Șir invalid: trebuie să înceapă cu "${X.prefix}"`;if(X.format==="ends_with")return`Șir invalid: trebuie să se termine cu "${X.suffix}"`;if(X.format==="includes")return`Șir invalid: trebuie să includă "${X.includes}"`;if(X.format==="regex")return`Șir invalid: trebuie să se potrivească cu modelul ${X.pattern}`;return`Format invalid: ${D[X.format]??U.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${U.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${Z(U.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${U.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${U.origin}`;default:return"Intrare invalidă"}}};function N8(){return{localeError:DF()}}function OY($,v,D,I){let U=Math.abs($),X=U%10,G=U%100;if(G>=11&&G<=19)return I;if(X===1)return v;if(X>=2&&X<=4)return D;return I}var IF=()=>{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 v(U){return $[U]??null}let D={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:"ввод"},I={nan:"NaN",number:"число",array:"массив"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Неверный ввод: ожидалось instanceof ${U.expected}, получено ${Q}`;return`Неверный ввод: ожидалось ${X}, получено ${Q}`}case"invalid_value":if(U.values.length===1)return`Неверный ввод: ожидалось ${O(U.values[0])}`;return`Неверный вариант: ожидалось одно из ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G){let Q=Number(U.maximum),J=OY(Q,G.unit.one,G.unit.few,G.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${X}${U.maximum.toString()} ${J}`}return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G){let Q=Number(U.minimum),J=OY(Q,G.unit.one,G.unit.few,G.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${X}${U.minimum.toString()} ${J}`}return`Слишком маленькое значение: ожидалось, что ${U.origin} будет ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`Неверный ${D[X.format]??U.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспознанн${U.keys.length>1?"ые":"ый"} ключ${U.keys.length>1?"и":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${U.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${U.origin}`;default:return"Неверные входные данные"}}};function Z8(){return{localeError:IF()}}var XF=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"število",array:"tabela"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Neveljaven vnos: pričakovano instanceof ${U.expected}, prejeto ${Q}`;return`Neveljaven vnos: pričakovano ${X}, prejeto ${Q}`}case"invalid_value":if(U.values.length===1)return`Neveljaven vnos: pričakovano ${O(U.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} imelo ${X}${U.maximum.toString()} ${G.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Premajhno: pričakovano, da bo ${U.origin} imelo ${X}${U.minimum.toString()} ${G.unit}`;return`Premajhno: pričakovano, da bo ${U.origin} ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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 ${D[X.format]??U.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${U.divisor}`;case"unrecognized_keys":return`Neprepoznan${U.keys.length>1?"i ključi":" ključ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${U.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${U.origin}`;default:return"Neveljaven vnos"}}};function A8(){return{localeError:XF()}}var GF=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"antal",array:"lista"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Ogiltig inmatning: förväntat instanceof ${U.expected}, fick ${Q}`;return`Ogiltig inmatning: förväntat ${X}, fick ${Q}`}case"invalid_value":if(U.values.length===1)return`Ogiltig inmatning: förväntat ${O(U.values[0])}`;return`Ogiltigt val: förväntade en av ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`För stor(t): förväntade ${U.origin??"värdet"} att ha ${X}${U.maximum.toString()} ${G.unit??"element"}`;return`För stor(t): förväntat ${U.origin??"värdet"} att ha ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${X}${U.minimum.toString()} ${G.unit}`;return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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) ${D[X.format]??U.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${U.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${U.origin??"värdet"}`;default:return"Ogiltig input"}}};function H8(){return{localeError:GF()}}var QF=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${U.expected}, பெறப்பட்டது ${Q}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${X}, பெறப்பட்டது ${Q}`}case"invalid_value":if(U.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${O(U.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${Z(U.values,"|")} இல் ஒன்று`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${X}${U.maximum.toString()} ${G.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${X}${U.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${X}${U.minimum.toString()} ${G.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${X}${U.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let X=U;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`தவறான ${D[X.format]??U.format}`}case"not_multiple_of":return`தவறான எண்: ${U.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${U.keys.length>1?"கள்":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${U.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function F8(){return{localeError:QF()}}var JF=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function v(U){return $[U]??null}let D={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:"ข้อมูลที่ป้อน"},I={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${U.expected} แต่ได้รับ ${Q}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${X} แต่ได้รับ ${Q}`}case"invalid_value":if(U.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${O(U.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"ไม่เกิน":"น้อยกว่า",G=v(U.origin);if(G)return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${X} ${U.maximum.toString()} ${G.unit??"รายการ"}`;return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${X} ${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?"อย่างน้อย":"มากกว่า",G=v(U.origin);if(G)return`น้อยกว่ากำหนด: ${U.origin} ควรมี${X} ${U.minimum.toString()} ${G.unit}`;return`น้อยกว่ากำหนด: ${U.origin} ควรมี${X} ${U.minimum.toString()}`}case"invalid_format":{let X=U;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`รูปแบบไม่ถูกต้อง: ${D[X.format]??U.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${U.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${Z(U.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${U.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${U.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function O8(){return{localeError:JF()}}var zF=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function v(U){return $[U]??null}let D={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"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Geçersiz değer: beklenen instanceof ${U.expected}, alınan ${Q}`;return`Geçersiz değer: beklenen ${X}, alınan ${Q}`}case"invalid_value":if(U.values.length===1)return`Geçersiz değer: beklenen ${O(U.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Çok büyük: beklenen ${U.origin??"değer"} ${X}${U.maximum.toString()} ${G.unit??"öğe"}`;return`Çok büyük: beklenen ${U.origin??"değer"} ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Çok küçük: beklenen ${U.origin} ${X}${U.minimum.toString()} ${G.unit}`;return`Çok küçük: beklenen ${U.origin} ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Geçersiz metin: "${X.prefix}" ile başlamalı`;if(X.format==="ends_with")return`Geçersiz metin: "${X.suffix}" ile bitmeli`;if(X.format==="includes")return`Geçersiz metin: "${X.includes}" içermeli`;if(X.format==="regex")return`Geçersiz metin: ${X.pattern} desenine uymalı`;return`Geçersiz ${D[X.format]??U.format}`}case"not_multiple_of":return`Geçersiz sayı: ${U.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${U.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function j8(){return{localeError:zF()}}var WF=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function v(U){return $[U]??null}let D={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:"вхідні дані"},I={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Неправильні вхідні дані: очікується instanceof ${U.expected}, отримано ${Q}`;return`Неправильні вхідні дані: очікується ${X}, отримано ${Q}`}case"invalid_value":if(U.values.length===1)return`Неправильні вхідні дані: очікується ${O(U.values[0])}`;return`Неправильна опція: очікується одне з ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Занадто велике: очікується, що ${U.origin??"значення"} ${G.verb} ${X}${U.maximum.toString()} ${G.unit??"елементів"}`;return`Занадто велике: очікується, що ${U.origin??"значення"} буде ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Занадто мале: очікується, що ${U.origin} ${G.verb} ${X}${U.minimum.toString()} ${G.unit}`;return`Занадто мале: очікується, що ${U.origin} буде ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`Неправильний ${D[X.format]??U.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${U.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${U.keys.length>1?"і":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${U.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${U.origin}`;default:return"Неправильні вхідні дані"}}};function Xv(){return{localeError:WF()}}function w8(){return Xv()}var YF=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function v(U){return $[U]??null}let D={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:"ان پٹ"},I={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`غلط ان پٹ: instanceof ${U.expected} متوقع تھا، ${Q} موصول ہوا`;return`غلط ان پٹ: ${X} متوقع تھا، ${Q} موصول ہوا`}case"invalid_value":if(U.values.length===1)return`غلط ان پٹ: ${O(U.values[0])} متوقع تھا`;return`غلط آپشن: ${Z(U.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`بہت بڑا: ${U.origin??"ویلیو"} کے ${X}${U.maximum.toString()} ${G.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${U.origin??"ویلیو"} کا ${X}${U.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`بہت چھوٹا: ${U.origin} کے ${X}${U.minimum.toString()} ${G.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${U.origin} کا ${X}${U.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let X=U;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`غلط ${D[X.format]??U.format}`}case"not_multiple_of":return`غلط نمبر: ${U.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${U.keys.length>1?"ز":""}: ${Z(U.keys,"، ")}`;case"invalid_key":return`${U.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${U.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function P8(){return{localeError:YF()}}var LF=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function v(U){return $[U]??null}let D={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},I={nan:"NaN",number:"raqam",array:"massiv"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${U.expected}, qabul qilingan ${Q}`;return`Noto‘g‘ri kirish: kutilgan ${X}, qabul qilingan ${Q}`}case"invalid_value":if(U.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${O(U.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Juda katta: kutilgan ${U.origin??"qiymat"} ${X}${U.maximum.toString()} ${G.unit} ${G.verb}`;return`Juda katta: kutilgan ${U.origin??"qiymat"} ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Juda kichik: kutilgan ${U.origin} ${X}${U.minimum.toString()} ${G.unit} ${G.verb}`;return`Juda kichik: kutilgan ${U.origin} ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;if(X.format==="starts_with")return`Noto‘g‘ri satr: "${X.prefix}" bilan boshlanishi kerak`;if(X.format==="ends_with")return`Noto‘g‘ri satr: "${X.suffix}" bilan tugashi kerak`;if(X.format==="includes")return`Noto‘g‘ri satr: "${X.includes}" ni o‘z ichiga olishi kerak`;if(X.format==="regex")return`Noto‘g‘ri satr: ${X.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${D[X.format]??U.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${U.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${U.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function M8(){return{localeError:LF()}}var VF=()=>{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 v(U){return $[U]??null}let D={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"},I={nan:"NaN",number:"số",array:"mảng"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${U.expected}, nhận được ${Q}`;return`Đầu vào không hợp lệ: mong đợi ${X}, nhận được ${Q}`}case"invalid_value":if(U.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${O(U.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${G.verb} ${X}${U.maximum.toString()} ${G.unit??"phần tử"}`;return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Quá nhỏ: mong đợi ${U.origin} ${G.verb} ${X}${U.minimum.toString()} ${G.unit}`;return`Quá nhỏ: mong đợi ${U.origin} ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`${D[X.format]??U.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 ${U.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${Z(U.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${U.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 ${U.origin}`;default:return"Đầu vào không hợp lệ"}}};function b8(){return{localeError:VF()}}var BF=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function v(U){return $[U]??null}let D={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:"输入"},I={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`无效输入:期望 instanceof ${U.expected},实际接收 ${Q}`;return`无效输入:期望 ${X},实际接收 ${Q}`}case"invalid_value":if(U.values.length===1)return`无效输入:期望 ${O(U.values[0])}`;return`无效选项:期望以下之一 ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`数值过大:期望 ${U.origin??"值"} ${X}${U.maximum.toString()} ${G.unit??"个元素"}`;return`数值过大:期望 ${U.origin??"值"} ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`数值过小:期望 ${U.origin} ${X}${U.minimum.toString()} ${G.unit}`;return`数值过小:期望 ${U.origin} ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`无效${D[X.format]??U.format}`}case"not_multiple_of":return`无效数字:必须是 ${U.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${U.origin} 中包含无效值(value)`;default:return"无效输入"}}};function q8(){return{localeError:BF()}}var KF=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function v(U){return $[U]??null}let D={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:"輸入"},I={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`無效的輸入值:預期為 instanceof ${U.expected},但收到 ${Q}`;return`無效的輸入值:預期為 ${X},但收到 ${Q}`}case"invalid_value":if(U.values.length===1)return`無效的輸入值:預期為 ${O(U.values[0])}`;return`無效的選項:預期為以下其中之一 ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`數值過大:預期 ${U.origin??"值"} 應為 ${X}${U.maximum.toString()} ${G.unit??"個元素"}`;return`數值過大:預期 ${U.origin??"值"} 應為 ${X}${U.maximum.toString()}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`數值過小:預期 ${U.origin} 應為 ${X}${U.minimum.toString()} ${G.unit}`;return`數值過小:預期 ${U.origin} 應為 ${X}${U.minimum.toString()}`}case"invalid_format":{let X=U;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`無效的 ${D[X.format]??U.format}`}case"not_multiple_of":return`無效的數字:必須為 ${U.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${U.keys.length>1?"們":""}:${Z(U.keys,"、")}`;case"invalid_key":return`${U.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${U.origin} 中有無效的值`;default:return"無效的輸入值"}}};function S8(){return{localeError:KF()}}var NF=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function v(U){return $[U]??null}let D={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é"},I={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(U)=>{switch(U.code){case"invalid_type":{let X=I[U.expected]??U.expected,G=j(U.input),Q=I[G]??G;if(/^[A-Z]/.test(U.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${U.expected}, àmọ̀ a rí ${Q}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${X}, àmọ̀ a rí ${Q}`}case"invalid_value":if(U.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${O(U.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${Z(U.values,"|")}`;case"too_big":{let X=U.inclusive?"<=":"<",G=v(U.origin);if(G)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${U.origin??"iye"} ${G.verb} ${X}${U.maximum} ${G.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${X}${U.maximum}`}case"too_small":{let X=U.inclusive?">=":">",G=v(U.origin);if(G)return`Kéré ju: a ní láti jẹ́ pé ${U.origin} ${G.verb} ${X}${U.minimum} ${G.unit}`;return`Kéré ju: a ní láti jẹ́ ${X}${U.minimum}`}case"invalid_format":{let X=U;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: ${D[X.format]??U.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${U.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${Z(U.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${U.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${U.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function k8(){return{localeError:NF()}}var jY,T8=Symbol("ZodOutput"),E8=Symbol("ZodInput");class u8{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let D=v[0];if(this._map.set($,D),D&&typeof D==="object"&&"id"in D)this._idmap.set(D.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let D={...this.get(v)??{}};delete D.id;let I={...D,...this._map.get($)};return Object.keys(I).length?I:void 0}return this._map.get($)}has($){return this._map.has($)}}function lU(){return new u8}(jY=globalThis).__zod_globalRegistry??(jY.__zod_globalRegistry=lU());var j$=globalThis.__zod_globalRegistry;function g8($,v){return new $({type:"string",...P(v)})}function R8($,v){return new $({type:"string",coerce:!0,...P(v)})}function hU($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...P(v)})}function Qv($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...P(v)})}function rU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...P(v)})}function mU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(v)})}function cU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(v)})}function dU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(v)})}function Jv($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...P(v)})}function tU($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...P(v)})}function pU($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(v)})}function oU($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...P(v)})}function aU($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(v)})}function eU($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...P(v)})}function sU($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...P(v)})}function $0($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(v)})}function v0($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(v)})}function U0($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(v)})}function C8($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...P(v)})}function D0($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(v)})}function I0($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(v)})}function X0($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...P(v)})}function G0($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...P(v)})}function Q0($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...P(v)})}function J0($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...P(v)})}var i8={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function n8($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(v)})}function x8($,v){return new $({type:"string",format:"date",check:"string_format",...P(v)})}function f8($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...P(v)})}function _8($,v){return new $({type:"string",format:"duration",check:"string_format",...P(v)})}function y8($,v){return new $({type:"number",checks:[],...P(v)})}function l8($,v){return new $({type:"number",coerce:!0,checks:[],...P(v)})}function h8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...P(v)})}function r8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...P(v)})}function m8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...P(v)})}function c8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...P(v)})}function d8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...P(v)})}function t8($,v){return new $({type:"boolean",...P(v)})}function p8($,v){return new $({type:"boolean",coerce:!0,...P(v)})}function o8($,v){return new $({type:"bigint",...P(v)})}function a8($,v){return new $({type:"bigint",coerce:!0,...P(v)})}function e8($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(v)})}function s8($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(v)})}function $Q($,v){return new $({type:"symbol",...P(v)})}function vQ($,v){return new $({type:"undefined",...P(v)})}function UQ($,v){return new $({type:"null",...P(v)})}function DQ($){return new $({type:"any"})}function IQ($){return new $({type:"unknown"})}function XQ($,v){return new $({type:"never",...P(v)})}function GQ($,v){return new $({type:"void",...P(v)})}function QQ($,v){return new $({type:"date",...P(v)})}function JQ($,v){return new $({type:"date",coerce:!0,...P(v)})}function zQ($,v){return new $({type:"nan",...P(v)})}function H4($,v){return new TU({check:"less_than",...P(v),value:$,inclusive:!1})}function e$($,v){return new TU({check:"less_than",...P(v),value:$,inclusive:!0})}function F4($,v){return new EU({check:"greater_than",...P(v),value:$,inclusive:!1})}function i$($,v){return new EU({check:"greater_than",...P(v),value:$,inclusive:!0})}function z0($){return F4(0,$)}function W0($){return H4(0,$)}function Y0($){return e$(0,$)}function L0($){return i$(0,$)}function m4($,v){return new GX({check:"multiple_of",...P(v),value:$})}function c4($,v){return new zX({check:"max_size",...P(v),maximum:$})}function O4($,v){return new WX({check:"min_size",...P(v),minimum:$})}function Z6($,v){return new YX({check:"size_equals",...P(v),size:$})}function A6($,v){return new LX({check:"max_length",...P(v),maximum:$})}function u4($,v){return new VX({check:"min_length",...P(v),minimum:$})}function H6($,v){return new BX({check:"length_equals",...P(v),length:$})}function f6($,v){return new KX({check:"string_format",format:"regex",...P(v),pattern:$})}function _6($){return new NX({check:"string_format",format:"lowercase",...P($)})}function y6($){return new ZX({check:"string_format",format:"uppercase",...P($)})}function l6($,v){return new AX({check:"string_format",format:"includes",...P(v),includes:$})}function h6($,v){return new HX({check:"string_format",format:"starts_with",...P(v),prefix:$})}function r6($,v){return new FX({check:"string_format",format:"ends_with",...P(v),suffix:$})}function V0($,v,D){return new OX({check:"property",property:$,schema:v,...P(D)})}function m6($,v){return new jX({check:"mime_type",mime:$,...P(v)})}function J4($){return new wX({check:"overwrite",tx:$})}function c6($){return J4((v)=>v.normalize($))}function d6(){return J4(($)=>$.trim())}function t6(){return J4(($)=>$.toLowerCase())}function p6(){return J4(($)=>$.toUpperCase())}function o6(){return J4(($)=>OI($))}function WQ($,v,D){return new $({type:"array",element:v,...P(D)})}function AF($,v,D){return new $({type:"union",options:v,...P(D)})}function HF($,v,D){return new $({type:"union",options:v,inclusive:!1,...P(D)})}function FF($,v,D,I){return new $({type:"union",options:D,discriminator:v,...P(I)})}function OF($,v,D){return new $({type:"intersection",left:v,right:D})}function jF($,v,D,I){let U=D instanceof i;return new $({type:"tuple",items:v,rest:U?D:null,...P(U?I:D)})}function wF($,v,D,I){return new $({type:"record",keyType:v,valueType:D,...P(I)})}function PF($,v,D,I){return new $({type:"map",keyType:v,valueType:D,...P(I)})}function MF($,v,D){return new $({type:"set",valueType:v,...P(D)})}function bF($,v,D){let I=Array.isArray(v)?Object.fromEntries(v.map((U)=>[U,U])):v;return new $({type:"enum",entries:I,...P(D)})}function qF($,v,D){return new $({type:"enum",entries:v,...P(D)})}function SF($,v,D){return new $({type:"literal",values:Array.isArray(v)?v:[v],...P(D)})}function YQ($,v){return new $({type:"file",...P(v)})}function kF($,v){return new $({type:"transform",transform:v})}function TF($,v){return new $({type:"optional",innerType:v})}function EF($,v){return new $({type:"nullable",innerType:v})}function uF($,v,D){return new $({type:"default",innerType:v,get defaultValue(){return typeof D==="function"?D():wI(D)}})}function gF($,v,D){return new $({type:"nonoptional",innerType:v,...P(D)})}function RF($,v){return new $({type:"success",innerType:v})}function CF($,v,D){return new $({type:"catch",innerType:v,catchValue:typeof D==="function"?D:()=>D})}function iF($,v,D){return new $({type:"pipe",in:v,out:D})}function nF($,v){return new $({type:"readonly",innerType:v})}function xF($,v,D){return new $({type:"template_literal",parts:v,...P(D)})}function fF($,v){return new $({type:"lazy",getter:v})}function _F($,v){return new $({type:"promise",innerType:v})}function LQ($,v,D){let I=P(D);return I.abort??(I.abort=!0),new $({type:"custom",check:"custom",fn:v,...I})}function VQ($,v,D){return new $({type:"custom",check:"custom",fn:v,...P(D)})}function BQ($,v){let D=wY((I)=>{return I.addIssue=(U)=>{if(typeof U==="string")I.issues.push(E6(U,I.value,D._zod.def));else{let X=U;if(X.fatal)X.continue=!1;X.code??(X.code="custom"),X.input??(X.input=I.value),X.inst??(X.inst=D),X.continue??(X.continue=!D._zod.def.abort),I.issues.push(E6(X))}},$(I.value,I)},v);return D}function wY($,v){let D=new X$({check:"custom",...P(v)});return D._zod.check=$,D}function KQ($){let v=new X$({check:"describe"});return v._zod.onattach=[(D)=>{let I=j$.get(D)??{};j$.add(D,{...I,description:$})}],v._zod.check=()=>{},v}function NQ($){let v=new X$({check:"meta"});return v._zod.onattach=[(D)=>{let I=j$.get(D)??{};j$.add(D,{...I,...$})}],v._zod.check=()=>{},v}function ZQ($,v){let D=P(v),I=D.truthy??["true","1","yes","on","y","enabled"],U=D.falsy??["false","0","no","off","n","disabled"];if(D.case!=="sensitive")I=I.map((V)=>typeof V==="string"?V.toLowerCase():V),U=U.map((V)=>typeof V==="string"?V.toLowerCase():V);let X=new Set(I),G=new Set(U),Q=$.Codec??vv,J=$.Boolean??s1,W=new($.String??N6)({type:"string",error:D.error}),Y=new J({type:"boolean",error:D.error}),L=new Q({type:"pipe",in:W,out:Y,transform:(V,B)=>{let N=V;if(D.case!=="sensitive")N=N.toLowerCase();if(X.has(N))return!0;else if(G.has(N))return!1;else return B.issues.push({code:"invalid_value",expected:"stringbool",values:[...X,...G],input:B.value,inst:L,continue:!1}),{}},reverseTransform:(V,B)=>{if(V===!0)return I[0]||"true";else return U[0]||"false"},error:D.error});return L}function a6($,v,D,I={}){let U=P(I),X={...P(I),check:"string_format",type:"string",format:v,fn:typeof D==="function"?D:(Q)=>D.test(Q),...U};if(D instanceof RegExp)X.pattern=D;return new $(X)}function d4($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??j$,target:v,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function e($,v,D={path:[],schemaPath:[]}){var I;let U=$._zod.def,X=v.seen.get($);if(X){if(X.count++,D.schemaPath.includes($))X.cycle=D.path;return X.schema}let G={schema:{},count:1,cycle:void 0,path:D.path};v.seen.set($,G);let Q=$._zod.toJSONSchema?.();if(Q)G.schema=Q;else{let W={...D,schemaPath:[...D.schemaPath,$],path:D.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,G.schema,W);else{let L=G.schema,V=v.processors[U.type];if(!V)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);V($,v,L,W)}let Y=$._zod.parent;if(Y){if(!G.ref)G.ref=Y;e(Y,v,W),v.seen.get(Y).isParent=!0}}let J=v.metadataRegistry.get($);if(J)Object.assign(G.schema,J);if(v.io==="input"&&n$($))delete G.schema.examples,delete G.schema.default;if(v.io==="input"&&"_prefault"in G.schema)(I=G.schema).default??(I.default=G.schema._prefault);return delete G.schema._prefault,v.seen.get($).schema}function t4($,v){let D=$.seen.get(v);if(!D)throw Error("Unprocessed schema. This is a bug in Zod.");let I=new Map;for(let G of $.seen.entries()){let Q=$.metadataRegistry.get(G[0])?.id;if(Q){let J=I.get(Q);if(J&&J!==G[0])throw Error(`Duplicate schema id "${Q}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);I.set(Q,G[0])}}let U=(G)=>{let Q=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let Y=$.external.registry.get(G[0])?.id,L=$.external.uri??((B)=>B);if(Y)return{ref:L(Y)};let V=G[1].defId??G[1].schema.id??`schema${$.counter++}`;return G[1].defId=V,{defId:V,ref:`${L("__shared")}#/${Q}/${V}`}}if(G[1]===D)return{ref:"#"};let z=`${"#"}/${Q}/`,W=G[1].schema.id??`__schema${$.counter++}`;return{defId:W,ref:z+W}},X=(G)=>{if(G[1].schema.$ref)return;let Q=G[1],{ref:J,defId:z}=U(G);if(Q.def={...Q.schema},z)Q.defId=z;let W=Q.schema;for(let Y in W)delete W[Y];W.$ref=J};if($.cycles==="throw")for(let G of $.seen.entries()){let Q=G[1];if(Q.cycle)throw Error(`Cycle detected: #/${Q.cycle?.join("/")}/<root>
|
|
90
|
+
`)}B.write("payload.value = newResult;"),B.write("return payload;");let S=B.compile();return(T,g)=>S(V,T,g)},G,J=H6,Q=!Z6.jitless,z=Q&&FG.value,Y=v.catchall,I;$._zod.parse=(V,B)=>{I??(I=X.value);let L=V.value;if(!J(L))return V.issues.push({expected:"object",code:"invalid_type",input:L,inst:$}),V;if(Q&&z&&B?.async===!1&&B.jitless!==!0){if(!G)G=U(v.shape);if(V=G(V,B),!Y)return V;return lY([],L,V,B,I,$)}return D(V,B)}});function bY($,v,D,X){for(let G of $)if(G.issues.length===0)return v.value=G.value,v;let U=$.filter((G)=>!e4(G));if(U.length===1)return v.value=U[0].value,U[0];return v.issues.push({code:"invalid_union",input:v.value,inst:D,errors:$.map((G)=>G.issues.map((J)=>C$(J,X,V$())))}),v}var Vv=K("$ZodUnion",($,v)=>{f.init($,v),h($._zod,"optin",()=>v.options.some((X)=>X._zod.optin==="optional")?"optional":void 0),h($._zod,"optout",()=>v.options.some((X)=>X._zod.optout==="optional")?"optional":void 0),h($._zod,"values",()=>{if(v.options.every((X)=>X._zod.values))return new Set(v.options.flatMap((X)=>Array.from(X._zod.values)));return}),h($._zod,"pattern",()=>{if(v.options.every((X)=>X._zod.pattern)){let X=v.options.map((U)=>U._zod.pattern);return new RegExp(`^(${X.map((U)=>e1(U.source)).join("|")})$`)}return});let D=v.options.length===1?v.options[0]._zod.run:null;$._zod.parse=(X,U)=>{if(D)return D(X,U);let G=!1,J=[];for(let Q of v.options){let W=Q._zod.run({value:X.value,issues:[]},U);if(W instanceof Promise)J.push(W),G=!0;else{if(W.issues.length===0)return W;J.push(W)}}if(!G)return bY(J,X,$,U);return Promise.all(J).then((Q)=>{return bY(Q,X,$,U)})}});function qY($,v,D,X){let U=$.filter((G)=>G.issues.length===0);if(U.length===1)return v.value=U[0].value,v;if(U.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:D,errors:$.map((G)=>G.issues.map((J)=>C$(J,X,V$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:D,errors:[],inclusive:!1});return v}var W8=K("$ZodXor",($,v)=>{Vv.init($,v),v.inclusive=!1;let D=v.options.length===1?v.options[0]._zod.run:null;$._zod.parse=(X,U)=>{if(D)return D(X,U);let G=!1,J=[];for(let Q of v.options){let W=Q._zod.run({value:X.value,issues:[]},U);if(W instanceof Promise)J.push(W),G=!0;else J.push(W)}if(!G)return qY(J,X,$,U);return Promise.all(J).then((Q)=>{return qY(Q,X,$,U)})}}),z8=K("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,Vv.init($,v);let D=$._zod.parse;h($._zod,"propValues",()=>{let U={};for(let G of v.options){let J=G._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(G)}"`);for(let[Q,W]of Object.entries(J)){if(!U[Q])U[Q]=new Set;for(let z of W)U[Q].add(z)}}return U});let X=f6(()=>{let U=v.options,G=new Map;for(let J of U){let Q=J._zod.propValues?.[v.discriminator];if(!Q||Q.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(J)}"`);for(let W of Q){if(G.has(W))throw Error(`Duplicate discriminator value "${String(W)}"`);G.set(W,J)}}return G});$._zod.parse=(U,G)=>{let J=U.value;if(!H6(J))return U.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),U;let Q=X.value.get(J?.[v.discriminator]);if(Q)return Q._zod.run(U,G);if(v.unionFallback||G.direction==="backward")return D(U,G);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,options:Array.from(X.value.keys()),input:J,path:[v.discriminator],inst:$}),U}}),Y8=K("$ZodIntersection",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{let U=D.value,G=v.left._zod.run({value:U,issues:[]},X),J=v.right._zod.run({value:U,issues:[]},X);if(G instanceof Promise||J instanceof Promise)return Promise.all([G,J]).then(([W,z])=>{return SY(D,W,z)});return SY(D,G,J)}});function wJ($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(a4($)&&a4(v)){let D=Object.keys(v),X=Object.keys($).filter((G)=>D.indexOf(G)!==-1),U={...$,...v};for(let G of X){let J=wJ($[G],v[G]);if(!J.valid)return{valid:!1,mergeErrorPath:[G,...J.mergeErrorPath]};U[G]=J.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let D=[];for(let X=0;X<$.length;X++){let U=$[X],G=v[X],J=wJ(U,G);if(!J.valid)return{valid:!1,mergeErrorPath:[X,...J.mergeErrorPath]};D.push(J.data)}return{valid:!0,data:D}}return{valid:!1,mergeErrorPath:[]}}function SY($,v,D){let X=new Map,U;for(let Q of v.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let W of Q.keys){if(!X.has(W))X.set(W,{});X.get(W).l=!0}}else $.issues.push(Q);for(let Q of D.issues)if(Q.code==="unrecognized_keys")for(let W of Q.keys){if(!X.has(W))X.set(W,{});X.get(W).r=!0}else $.issues.push(Q);let G=[...X].filter(([,Q])=>Q.l&&Q.r).map(([Q])=>Q);if(G.length&&U)$.issues.push({...U,keys:G});if(e4($))return $;let J=wJ(v.value,D.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}var KU=K("$ZodTuple",($,v)=>{f.init($,v);let D=v.items;$._zod.parse=(X,U)=>{let G=X.value;if(!Array.isArray(G))return X.issues.push({input:G,inst:$,expected:"tuple",code:"invalid_type"}),X;X.value=[];let J=[],Q=kY(D,"optin"),W=kY(D,"optout");if(!v.rest){if(G.length<Q)return X.issues.push({code:"too_small",minimum:Q,inclusive:!0,input:G,inst:$,origin:"array"}),X;if(G.length>D.length)X.issues.push({code:"too_big",maximum:D.length,inclusive:!0,input:G,inst:$,origin:"array"})}let z=Array(D.length);for(let Y=0;Y<D.length;Y++){let I=D[Y]._zod.run({value:G[Y],issues:[]},U);if(I instanceof Promise)J.push(I.then((V)=>{z[Y]=V}));else z[Y]=I}if(v.rest){let Y=D.length-1,I=G.slice(D.length);for(let V of I){Y++;let B=v.rest._zod.run({value:V,issues:[]},U);if(B instanceof Promise)J.push(B.then((L)=>EY(L,X,Y)));else EY(B,X,Y)}}if(J.length)return Promise.all(J).then(()=>TY(z,X,D,G,W));return TY(z,X,D,G,W)}});function kY($,v){for(let D=$.length-1;D>=0;D--)if($[D]._zod[v]!=="optional")return D+1;return 0}function EY($,v,D){if($.issues.length)v.issues.push(...n$(D,$.issues));v.value[D]=$.value}function TY($,v,D,X,U){for(let G=0;G<D.length;G++){let J=$[G],Q=G<X.length;if(J.issues.length){if(!Q&&G>=U){v.value.length=G;break}v.issues.push(...n$(G,J.issues))}v.value[G]=J.value}for(let G=v.value.length-1;G>=X.length;G--)if(D[G]._zod.optout==="optional"&&v.value[G]===void 0)v.value.length=G;else break;return v}var I8=K("$ZodRecord",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{let U=D.value;if(!a4(U))return D.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),D;let G=[],J=v.keyType._zod.values;if(J){D.value={};let Q=new Set;for(let z of J)if(typeof z==="string"||typeof z==="number"||typeof z==="symbol"){Q.add(typeof z==="number"?z.toString():z);let Y=v.keyType._zod.run({value:z,issues:[]},X);if(Y instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Y.issues.length){D.issues.push({code:"invalid_key",origin:"record",issues:Y.issues.map((B)=>C$(B,X,V$())),input:z,path:[z],inst:$});continue}let I=Y.value,V=v.valueType._zod.run({value:U[z],issues:[]},X);if(V instanceof Promise)G.push(V.then((B)=>{if(B.issues.length)D.issues.push(...n$(z,B.issues));D.value[I]=B.value}));else{if(V.issues.length)D.issues.push(...n$(z,V.issues));D.value[I]=V.value}}let W;for(let z in U)if(!Q.has(z))W=W??[],W.push(z);if(W&&W.length>0)D.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:W})}else{D.value={};for(let Q of Reflect.ownKeys(U)){if(Q==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(U,Q))continue;let W=v.keyType._zod.run({value:Q,issues:[]},X);if(W instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof Q==="string"&&Wv.test(Q)&&W.issues.length){let I=v.keyType._zod.run({value:Number(Q),issues:[]},X);if(I instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(I.issues.length===0)W=I}if(W.issues.length){if(v.mode==="loose")D.value[Q]=U[Q];else D.issues.push({code:"invalid_key",origin:"record",issues:W.issues.map((I)=>C$(I,X,V$())),input:Q,path:[Q],inst:$});continue}let Y=v.valueType._zod.run({value:U[Q],issues:[]},X);if(Y instanceof Promise)G.push(Y.then((I)=>{if(I.issues.length)D.issues.push(...n$(Q,I.issues));D.value[W.value]=I.value}));else{if(Y.issues.length)D.issues.push(...n$(Q,Y.issues));D.value[W.value]=Y.value}}}if(G.length)return Promise.all(G).then(()=>D);return D}}),V8=K("$ZodMap",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{let U=D.value;if(!(U instanceof Map))return D.issues.push({expected:"map",code:"invalid_type",input:U,inst:$}),D;let G=[];D.value=new Map;for(let[J,Q]of U){let W=v.keyType._zod.run({value:J,issues:[]},X),z=v.valueType._zod.run({value:Q,issues:[]},X);if(W instanceof Promise||z instanceof Promise)G.push(Promise.all([W,z]).then(([Y,I])=>{RY(Y,I,D,J,U,$,X)}));else RY(W,z,D,J,U,$,X)}if(G.length)return Promise.all(G).then(()=>D);return D}});function RY($,v,D,X,U,G,J){if($.issues.length)if(s1.has(typeof X))D.issues.push(...n$(X,$.issues));else D.issues.push({code:"invalid_key",origin:"map",input:U,inst:G,issues:$.issues.map((Q)=>C$(Q,J,V$()))});if(v.issues.length)if(s1.has(typeof X))D.issues.push(...n$(X,v.issues));else D.issues.push({origin:"map",code:"invalid_element",input:U,inst:G,key:X,issues:v.issues.map((Q)=>C$(Q,J,V$()))});D.value.set($.value,v.value)}var B8=K("$ZodSet",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{let U=D.value;if(!(U instanceof Set))return D.issues.push({input:U,inst:$,expected:"set",code:"invalid_type"}),D;let G=[];D.value=new Set;for(let J of U){let Q=v.valueType._zod.run({value:J,issues:[]},X);if(Q instanceof Promise)G.push(Q.then((W)=>gY(W,D)));else gY(Q,D)}if(G.length)return Promise.all(G).then(()=>D);return D}});function gY($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var L8=K("$ZodEnum",($,v)=>{f.init($,v);let D=a1(v.entries),X=new Set(D);$._zod.values=X,$._zod.pattern=new RegExp(`^(${D.filter((U)=>s1.has(typeof U)).map((U)=>typeof U==="string"?v4(U):U.toString()).join("|")})$`),$._zod.parse=(U,G)=>{let J=U.value;if(X.has(J))return U;return U.issues.push({code:"invalid_value",values:D,input:J,inst:$}),U}}),K8=K("$ZodLiteral",($,v)=>{if(f.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let D=new Set(v.values);$._zod.values=D,$._zod.pattern=new RegExp(`^(${v.values.map((X)=>typeof X==="string"?v4(X):X?v4(X.toString()):String(X)).join("|")})$`),$._zod.parse=(X,U)=>{let G=X.value;if(D.has(G))return X;return X.issues.push({code:"invalid_value",values:v.values,input:G,inst:$}),X}}),N8=K("$ZodFile",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{let U=D.value;if(U instanceof File)return D;return D.issues.push({expected:"file",code:"invalid_type",input:U,inst:$}),D}}),Z8=K("$ZodTransform",($,v)=>{f.init($,v),$._zod.optin="optional",$._zod.parse=(D,X)=>{if(X.direction==="backward")throw new O6($.constructor.name);let U=v.transform(D.value,D);if(X.async)return(U instanceof Promise?U:Promise.resolve(U)).then((J)=>{return D.value=J,D.fallback=!0,D});if(U instanceof Promise)throw new A4;return D.value=U,D.fallback=!0,D}});function uY($,v){if(v===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}var NU=K("$ZodOptional",($,v)=>{f.init($,v),$._zod.optin="optional",$._zod.optout="optional",h($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),h($._zod,"pattern",()=>{let D=v.innerType._zod.pattern;return D?new RegExp(`^(${e1(D.source)})?$`):void 0}),$._zod.parse=(D,X)=>{if(v.innerType._zod.optin==="optional"){let U=D.value,G=v.innerType._zod.run(D,X);if(G instanceof Promise)return G.then((J)=>uY(J,U));return uY(G,U)}if(D.value===void 0)return D;return v.innerType._zod.run(D,X)}}),O8=K("$ZodExactOptional",($,v)=>{NU.init($,v),h($._zod,"values",()=>v.innerType._zod.values),h($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(D,X)=>{return v.innerType._zod.run(D,X)}}),H8=K("$ZodNullable",($,v)=>{f.init($,v),h($._zod,"optin",()=>v.innerType._zod.optin),h($._zod,"optout",()=>v.innerType._zod.optout),h($._zod,"pattern",()=>{let D=v.innerType._zod.pattern;return D?new RegExp(`^(${e1(D.source)}|null)$`):void 0}),h($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(D,X)=>{if(D.value===null)return D;return v.innerType._zod.run(D,X)}}),F8=K("$ZodDefault",($,v)=>{f.init($,v),$._zod.optin="optional",h($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(D,X)=>{if(X.direction==="backward")return v.innerType._zod.run(D,X);if(D.value===void 0)return D.value=v.defaultValue,D;let U=v.innerType._zod.run(D,X);if(U instanceof Promise)return U.then((G)=>CY(G,v));return CY(U,v)}});function CY($,v){if($.value===void 0)$.value=v.defaultValue;return $}var j8=K("$ZodPrefault",($,v)=>{f.init($,v),$._zod.optin="optional",h($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(D,X)=>{if(X.direction==="backward")return v.innerType._zod.run(D,X);if(D.value===void 0)D.value=v.defaultValue;return v.innerType._zod.run(D,X)}}),A8=K("$ZodNonOptional",($,v)=>{f.init($,v),h($._zod,"values",()=>{let D=v.innerType._zod.values;return D?new Set([...D].filter((X)=>X!==void 0)):void 0}),$._zod.parse=(D,X)=>{let U=v.innerType._zod.run(D,X);if(U instanceof Promise)return U.then((G)=>xY(G,$));return xY(U,$)}});function xY($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var w8=K("$ZodSuccess",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{if(X.direction==="backward")throw new O6("ZodSuccess");let U=v.innerType._zod.run(D,X);if(U instanceof Promise)return U.then((G)=>{return D.value=G.issues.length===0,D});return D.value=U.issues.length===0,D}}),M8=K("$ZodCatch",($,v)=>{f.init($,v),$._zod.optin="optional",h($._zod,"optout",()=>v.innerType._zod.optout),h($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(D,X)=>{if(X.direction==="backward")return v.innerType._zod.run(D,X);let U=v.innerType._zod.run(D,X);if(U instanceof Promise)return U.then((G)=>{if(D.value=G.value,G.issues.length)D.value=v.catchValue({...D,error:{issues:G.issues.map((J)=>C$(J,X,V$()))},input:D.value}),D.issues=[],D.fallback=!0;return D});if(D.value=U.value,U.issues.length)D.value=v.catchValue({...D,error:{issues:U.issues.map((G)=>C$(G,X,V$()))},input:D.value}),D.issues=[],D.fallback=!0;return D}}),P8=K("$ZodNaN",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{if(typeof D.value!=="number"||!Number.isNaN(D.value))return D.issues.push({input:D.value,inst:$,expected:"nan",code:"invalid_type"}),D;return D}}),ZU=K("$ZodPipe",($,v)=>{f.init($,v),h($._zod,"values",()=>v.in._zod.values),h($._zod,"optin",()=>v.in._zod.optin),h($._zod,"optout",()=>v.out._zod.optout),h($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(D,X)=>{if(X.direction==="backward"){let G=v.out._zod.run(D,X);if(G instanceof Promise)return G.then((J)=>zU(J,v.in,X));return zU(G,v.in,X)}let U=v.in._zod.run(D,X);if(U instanceof Promise)return U.then((G)=>zU(G,v.out,X));return zU(U,v.out,X)}});function zU($,v,D){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},D)}var Bv=K("$ZodCodec",($,v)=>{f.init($,v),h($._zod,"values",()=>v.in._zod.values),h($._zod,"optin",()=>v.in._zod.optin),h($._zod,"optout",()=>v.out._zod.optout),h($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(D,X)=>{if((X.direction||"forward")==="forward"){let G=v.in._zod.run(D,X);if(G instanceof Promise)return G.then((J)=>YU(J,v,X));return YU(G,v,X)}else{let G=v.out._zod.run(D,X);if(G instanceof Promise)return G.then((J)=>YU(J,v,X));return YU(G,v,X)}}});function YU($,v,D){if($.issues.length)return $.aborted=!0,$;if((D.direction||"forward")==="forward"){let U=v.transform($.value,$);if(U instanceof Promise)return U.then((G)=>IU($,G,v.out,D));return IU($,U,v.out,D)}else{let U=v.reverseTransform($.value,$);if(U instanceof Promise)return U.then((G)=>IU($,G,v.in,D));return IU($,U,v.in,D)}}function IU($,v,D,X){if($.issues.length)return $.aborted=!0,$;return D._zod.run({value:v,issues:$.issues},X)}var b8=K("$ZodPreprocess",($,v)=>{ZU.init($,v)}),q8=K("$ZodReadonly",($,v)=>{f.init($,v),h($._zod,"propValues",()=>v.innerType._zod.propValues),h($._zod,"values",()=>v.innerType._zod.values),h($._zod,"optin",()=>v.innerType?._zod?.optin),h($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(D,X)=>{if(X.direction==="backward")return v.innerType._zod.run(D,X);let U=v.innerType._zod.run(D,X);if(U instanceof Promise)return U.then(fY);return fY(U)}});function fY($){return $.value=Object.freeze($.value),$}var S8=K("$ZodTemplateLiteral",($,v)=>{f.init($,v);let D=[];for(let X of v.parts)if(typeof X==="object"&&X!==null){if(!X._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...X._zod.traits].shift()}`);let U=X._zod.pattern instanceof RegExp?X._zod.pattern.source:X._zod.pattern;if(!U)throw Error(`Invalid template literal part: ${X._zod.traits}`);let G=U.startsWith("^")?1:0,J=U.endsWith("$")?U.length-1:U.length;D.push(U.slice(G,J))}else if(X===null||AG.has(typeof X))D.push(v4(`${X}`));else throw Error(`Invalid template literal part: ${X}`);$._zod.pattern=new RegExp(`^${D.join("")}$`),$._zod.parse=(X,U)=>{if(typeof X.value!=="string")return X.issues.push({input:X.value,inst:$,expected:"string",code:"invalid_type"}),X;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(X.value))return X.issues.push({input:X.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),X;return X}}),k8=K("$ZodFunction",($,v)=>{return f.init($,v),$._def=v,$._zod.def=v,$.implement=(D)=>{if(typeof D!=="function")throw Error("implement() must be called with a function");return function(...X){let U=$._def.input?Gv($._def.input,X):X,G=Reflect.apply(D,this,U);if($._def.output)return Gv($._def.output,G);return G}},$.implementAsync=(D)=>{if(typeof D!=="function")throw Error("implementAsync() must be called with a function");return async function(...X){let U=$._def.input?await Jv($._def.input,X):X,G=await Reflect.apply(D,this,U);if($._def.output)return await Jv($._def.output,G);return G}},$._zod.parse=(D,X)=>{if(typeof D.value!=="function")return D.issues.push({code:"invalid_type",expected:"function",input:D.value,inst:$}),D;if($._def.output&&$._def.output._zod.def.type==="promise")D.value=$.implementAsync(D.value);else D.value=$.implement(D.value);return D},$.input=(...D)=>{let X=$.constructor;if(Array.isArray(D[0]))return new X({type:"function",input:new KU({type:"tuple",items:D[0],rest:D[1]}),output:$._def.output});return new X({type:"function",input:D[0],output:$._def.output})},$.output=(D)=>{return new $.constructor({type:"function",input:$._def.input,output:D})},$}),E8=K("$ZodPromise",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{return Promise.resolve(D.value).then((U)=>v.innerType._zod.run({value:U,issues:[]},X))}}),T8=K("$ZodLazy",($,v)=>{f.init($,v),h($._zod,"innerType",()=>{let D=v;if(!D._cachedInner)D._cachedInner=v.getter();return D._cachedInner}),h($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),h($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),h($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),h($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(D,X)=>{return $._zod.innerType._zod.run(D,X)}}),R8=K("$ZodCustom",($,v)=>{G$.init($,v),f.init($,v),$._zod.parse=(D,X)=>{return D},$._zod.check=(D)=>{let X=D.value,U=v.fn(X);if(U instanceof Promise)return U.then((G)=>_Y(G,D,X,$));_Y(U,D,X,$);return}});function _Y($,v,D,X){if(!$){let U={code:"custom",input:D,inst:X,path:[...X._zod.def.path??[]],continue:!X._zod.def.abort};if(X._zod.def.params)U.params=X._zod.def.params;v.issues.push(_6(U))}}var Ov={};R4(Ov,{zhTW:()=>bQ,zhCN:()=>PQ,yo:()=>qQ,vi:()=>MQ,uz:()=>wQ,ur:()=>AQ,uk:()=>Zv,ua:()=>jQ,tr:()=>FQ,th:()=>HQ,ta:()=>OQ,sv:()=>ZQ,sl:()=>NQ,ru:()=>KQ,ro:()=>LQ,pt:()=>BQ,ps:()=>IQ,pl:()=>VQ,ota:()=>YQ,no:()=>zQ,nl:()=>WQ,ms:()=>QQ,mk:()=>JQ,lt:()=>GQ,ko:()=>XQ,km:()=>Kv,kh:()=>DQ,ka:()=>UQ,ja:()=>vQ,it:()=>$Q,is:()=>s8,id:()=>e8,hy:()=>a8,hu:()=>o8,hr:()=>t8,he:()=>p8,frCA:()=>d8,fr:()=>r8,fi:()=>c8,fa:()=>m8,es:()=>h8,eo:()=>l8,en:()=>Lv,el:()=>n8,de:()=>y8,da:()=>i8,cs:()=>_8,ca:()=>f8,bg:()=>x8,be:()=>C8,az:()=>u8,ar:()=>g8});var yF=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function v(U){return $[U]??null}let D={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:"مدخل"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${U.expected}، ولكن تم إدخال ${Q}`;return`مدخلات غير مقبولة: يفترض إدخال ${G}، ولكن تم إدخال ${Q}`}case"invalid_value":if(U.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${j(U.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return` أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${G} ${U.maximum.toString()} ${J.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${G} ${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${G} ${U.minimum.toString()} ${J.unit}`;return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${G} ${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${U.prefix}"`;if(G.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${G.suffix}"`;if(G.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${G.includes}"`;if(G.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${G.pattern}`;return`${D[G.format]??U.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${U.divisor}`;case"unrecognized_keys":return`معرف${U.keys.length>1?"ات":""} غريب${U.keys.length>1?"ة":""}: ${O(U.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${U.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${U.origin}`;default:return"مدخل غير مقبول"}}};function g8(){return{localeError:yF()}}var nF=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Yanlış dəyər: gözlənilən instanceof ${U.expected}, daxil olan ${Q}`;return`Yanlış dəyər: gözlənilən ${G}, daxil olan ${Q}`}case"invalid_value":if(U.values.length===1)return`Yanlış dəyər: gözlənilən ${j(U.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${G}${U.maximum.toString()} ${J.unit??"element"}`;return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Çox kiçik: gözlənilən ${U.origin} ${G}${U.minimum.toString()} ${J.unit}`;return`Çox kiçik: gözlənilən ${U.origin} ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Yanlış mətn: "${G.prefix}" ilə başlamalıdır`;if(G.format==="ends_with")return`Yanlış mətn: "${G.suffix}" ilə bitməlidir`;if(G.format==="includes")return`Yanlış mətn: "${G.includes}" daxil olmalıdır`;if(G.format==="regex")return`Yanlış mətn: ${G.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${D[G.format]??U.format}`}case"not_multiple_of":return`Yanlış ədəd: ${U.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${U.keys.length>1?"lar":""}: ${O(U.keys,", ")}`;case"invalid_key":return`${U.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${U.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function u8(){return{localeError:nF()}}function mY($,v,D,X){let U=Math.abs($),G=U%10,J=U%100;if(J>=11&&J<=19)return X;if(G===1)return v;if(G>=2&&G<=4)return D;return X}var lF=()=>{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 v(U){return $[U]??null}let D={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:"увод"},X={nan:"NaN",number:"лік",array:"масіў"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Няправільны ўвод: чакаўся instanceof ${U.expected}, атрымана ${Q}`;return`Няправільны ўвод: чакаўся ${G}, атрымана ${Q}`}case"invalid_value":if(U.values.length===1)return`Няправільны ўвод: чакалася ${j(U.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J){let Q=Number(U.maximum),W=mY(Q,J.unit.one,J.unit.few,J.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${J.verb} ${G}${U.maximum.toString()} ${W}`}return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна быць ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J){let Q=Number(U.minimum),W=mY(Q,J.unit.one,J.unit.few,J.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${J.verb} ${G}${U.minimum.toString()} ${W}`}return`Занадта малы: чакалася, што ${U.origin} павінна быць ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${G.prefix}"`;if(G.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${G.suffix}"`;if(G.format==="includes")return`Няправільны радок: павінен змяшчаць "${G.includes}"`;if(G.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${G.pattern}`;return`Няправільны ${D[G.format]??U.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${U.keys.length>1?"ключы":"ключ"}: ${O(U.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${U.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${U.origin}`;default:return"Няправільны ўвод"}}};function C8(){return{localeError:lF()}}var hF=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function v(U){return $[U]??null}let D={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:"вход"},X={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Невалиден вход: очакван instanceof ${U.expected}, получен ${Q}`;return`Невалиден вход: очакван ${G}, получен ${Q}`}case"invalid_value":if(U.values.length===1)return`Невалиден вход: очакван ${j(U.values[0])}`;return`Невалидна опция: очаквано едно от ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Твърде голямо: очаква се ${U.origin??"стойност"} да съдържа ${G}${U.maximum.toString()} ${J.unit??"елемента"}`;return`Твърде голямо: очаква се ${U.origin??"стойност"} да бъде ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Твърде малко: очаква се ${U.origin} да съдържа ${G}${U.minimum.toString()} ${J.unit}`;return`Твърде малко: очаква се ${U.origin} да бъде ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Невалиден низ: трябва да започва с "${G.prefix}"`;if(G.format==="ends_with")return`Невалиден низ: трябва да завършва с "${G.suffix}"`;if(G.format==="includes")return`Невалиден низ: трябва да включва "${G.includes}"`;if(G.format==="regex")return`Невалиден низ: трябва да съвпада с ${G.pattern}`;let J="Невалиден";if(G.format==="emoji")J="Невалидно";if(G.format==="datetime")J="Невалидно";if(G.format==="date")J="Невалидна";if(G.format==="time")J="Невалидно";if(G.format==="duration")J="Невалидна";return`${J} ${D[G.format]??U.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${U.divisor}`;case"unrecognized_keys":return`Неразпознат${U.keys.length>1?"и":""} ключ${U.keys.length>1?"ове":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${U.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${U.origin}`;default:return"Невалиден вход"}}};function x8(){return{localeError:hF()}}var mF=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Tipus invàlid: s'esperava instanceof ${U.expected}, s'ha rebut ${Q}`;return`Tipus invàlid: s'esperava ${G}, s'ha rebut ${Q}`}case"invalid_value":if(U.values.length===1)return`Valor invàlid: s'esperava ${j(U.values[0])}`;return`Opció invàlida: s'esperava una de ${O(U.values," o ")}`;case"too_big":{let G=U.inclusive?"com a màxim":"menys de",J=v(U.origin);if(J)return`Massa gran: s'esperava que ${U.origin??"el valor"} contingués ${G} ${U.maximum.toString()} ${J.unit??"elements"}`;return`Massa gran: s'esperava que ${U.origin??"el valor"} fos ${G} ${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?"com a mínim":"més de",J=v(U.origin);if(J)return`Massa petit: s'esperava que ${U.origin} contingués ${G} ${U.minimum.toString()} ${J.unit}`;return`Massa petit: s'esperava que ${U.origin} fos ${G} ${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Format invàlid: ha de començar amb "${G.prefix}"`;if(G.format==="ends_with")return`Format invàlid: ha d'acabar amb "${G.suffix}"`;if(G.format==="includes")return`Format invàlid: ha d'incloure "${G.includes}"`;if(G.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${G.pattern}`;return`Format invàlid per a ${D[G.format]??U.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${U.divisor}`;case"unrecognized_keys":return`Clau${U.keys.length>1?"s":""} no reconeguda${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${U.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${U.origin}`;default:return"Entrada invàlida"}}};function f8(){return{localeError:mF()}}var cF=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Neplatný vstup: očekáváno instanceof ${U.expected}, obdrženo ${Q}`;return`Neplatný vstup: očekáváno ${G}, obdrženo ${Q}`}case"invalid_value":if(U.values.length===1)return`Neplatný vstup: očekáváno ${j(U.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí mít ${G}${U.maximum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí být ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí mít ${G}${U.minimum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí být ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Neplatný řetězec: musí začínat na "${G.prefix}"`;if(G.format==="ends_with")return`Neplatný řetězec: musí končit na "${G.suffix}"`;if(G.format==="includes")return`Neplatný řetězec: musí obsahovat "${G.includes}"`;if(G.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${G.pattern}`;return`Neplatný formát ${D[G.format]??U.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${U.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${O(U.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${U.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${U.origin}`;default:return"Neplatný vstup"}}};function _8(){return{localeError:cF()}}var rF=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Ugyldigt input: forventede instanceof ${U.expected}, fik ${Q}`;return`Ugyldigt input: forventede ${G}, fik ${Q}`}case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${j(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin),Q=X[U.origin]??U.origin;if(J)return`For stor: forventede ${Q??"value"} ${J.verb} ${G} ${U.maximum.toString()} ${J.unit??"elementer"}`;return`For stor: forventede ${Q??"value"} havde ${G} ${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin),Q=X[U.origin]??U.origin;if(J)return`For lille: forventede ${Q} ${J.verb} ${G} ${U.minimum.toString()} ${J.unit}`;return`For lille: forventede ${Q} havde ${G} ${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Ugyldig streng: skal starte med "${G.prefix}"`;if(G.format==="ends_with")return`Ugyldig streng: skal ende med "${G.suffix}"`;if(G.format==="includes")return`Ugyldig streng: skal indeholde "${G.includes}"`;if(G.format==="regex")return`Ugyldig streng: skal matche mønsteret ${G.pattern}`;return`Ugyldig ${D[G.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${O(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function i8(){return{localeError:rF()}}var dF=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"Zahl",array:"Array"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Ungültige Eingabe: erwartet instanceof ${U.expected}, erhalten ${Q}`;return`Ungültige Eingabe: erwartet ${G}, erhalten ${Q}`}case"invalid_value":if(U.values.length===1)return`Ungültige Eingabe: erwartet ${j(U.values[0])}`;return`Ungültige Option: erwartet eine von ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${G}${U.maximum.toString()} ${J.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${G}${U.maximum.toString()} ist`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Zu klein: erwartet, dass ${U.origin} ${G}${U.minimum.toString()} ${J.unit} hat`;return`Zu klein: erwartet, dass ${U.origin} ${G}${U.minimum.toString()} ist`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Ungültiger String: muss mit "${G.prefix}" beginnen`;if(G.format==="ends_with")return`Ungültiger String: muss mit "${G.suffix}" enden`;if(G.format==="includes")return`Ungültiger String: muss "${G.includes}" enthalten`;if(G.format==="regex")return`Ungültiger String: muss dem Muster ${G.pattern} entsprechen`;return`Ungültig: ${D[G.format]??U.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${U.divisor} sein`;case"unrecognized_keys":return`${U.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${O(U.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${U.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${U.origin}`;default:return"Ungültige Eingabe"}}};function y8(){return{localeError:dF()}}var pF=()=>{let $={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function v(U){return $[U]??null}let D={regex:"είσοδος",email:"διεύθυνση 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",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(typeof U.expected==="string"&&/^[A-Z]/.test(U.expected))return`Μη έγκυρη είσοδος: αναμενόταν instanceof ${U.expected}, λήφθηκε ${Q}`;return`Μη έγκυρη είσοδος: αναμενόταν ${G}, λήφθηκε ${Q}`}case"invalid_value":if(U.values.length===1)return`Μη έγκυρη είσοδος: αναμενόταν ${j(U.values[0])}`;return`Μη έγκυρη επιλογή: αναμενόταν ένα από ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Πολύ μεγάλο: αναμενόταν ${U.origin??"τιμή"} να έχει ${G}${U.maximum.toString()} ${J.unit??"στοιχεία"}`;return`Πολύ μεγάλο: αναμενόταν ${U.origin??"τιμή"} να είναι ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Πολύ μικρό: αναμενόταν ${U.origin} να έχει ${G}${U.minimum.toString()} ${J.unit}`;return`Πολύ μικρό: αναμενόταν ${U.origin} να είναι ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${G.prefix}"`;if(G.format==="ends_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${G.suffix}"`;if(G.format==="includes")return`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${G.includes}"`;if(G.format==="regex")return`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${G.pattern}`;return`Μη έγκυρο: ${D[G.format]??U.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${U.divisor}`;case"unrecognized_keys":return`Άγνωστ${U.keys.length>1?"α":"ο"} κλειδ${U.keys.length>1?"ιά":"ί"}: ${O(U.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${U.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${U.origin}`;default:return"Μη έγκυρη είσοδος"}}};function n8(){return{localeError:pF()}}var tF=()=>{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"},map:{unit:"entries",verb:"to have"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;return`Invalid input: expected ${G}, received ${Q}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${j(U.values[0])}`;return`Invalid option: expected one of ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Too big: expected ${U.origin??"value"} to have ${G}${U.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${U.origin??"value"} to be ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Too small: expected ${U.origin} to have ${G}${U.minimum.toString()} ${J.unit}`;return`Too small: expected ${U.origin} to be ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Invalid string: must start with "${G.prefix}"`;if(G.format==="ends_with")return`Invalid string: must end with "${G.suffix}"`;if(G.format==="includes")return`Invalid string: must include "${G.includes}"`;if(G.format==="regex")return`Invalid string: must match pattern ${G.pattern}`;return`Invalid ${D[G.format]??U.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${U.divisor}`;case"unrecognized_keys":return`Unrecognized key${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Invalid key in ${U.origin}`;case"invalid_union":if(U.options&&Array.isArray(U.options)&&U.options.length>0)return`Invalid discriminator value. Expected ${U.options.map((J)=>`'${J}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${U.origin}`;default:return"Invalid input"}}};function Lv(){return{localeError:tF()}}var oF=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Nevalida enigo: atendiĝis instanceof ${U.expected}, riceviĝis ${Q}`;return`Nevalida enigo: atendiĝis ${G}, riceviĝis ${Q}`}case"invalid_value":if(U.values.length===1)return`Nevalida enigo: atendiĝis ${j(U.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${G}${U.maximum.toString()} ${J.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Tro malgranda: atendiĝis ke ${U.origin} havu ${G}${U.minimum.toString()} ${J.unit}`;return`Tro malgranda: atendiĝis ke ${U.origin} estu ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${G.prefix}"`;if(G.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${G.suffix}"`;if(G.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${G.includes}"`;if(G.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${G.pattern}`;return`Nevalida ${D[G.format]??U.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${U.divisor}`;case"unrecognized_keys":return`Nekonata${U.keys.length>1?"j":""} ŝlosilo${U.keys.length>1?"j":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${U.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${U.origin}`;default:return"Nevalida enigo"}}};function l8(){return{localeError:oF()}}var aF=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",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"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Entrada inválida: se esperaba instanceof ${U.expected}, recibido ${Q}`;return`Entrada inválida: se esperaba ${G}, recibido ${Q}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${j(U.values[0])}`;return`Opción inválida: se esperaba una de ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin),Q=X[U.origin]??U.origin;if(J)return`Demasiado grande: se esperaba que ${Q??"valor"} tuviera ${G}${U.maximum.toString()} ${J.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${Q??"valor"} fuera ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin),Q=X[U.origin]??U.origin;if(J)return`Demasiado pequeño: se esperaba que ${Q} tuviera ${G}${U.minimum.toString()} ${J.unit}`;return`Demasiado pequeño: se esperaba que ${Q} fuera ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Cadena inválida: debe comenzar con "${G.prefix}"`;if(G.format==="ends_with")return`Cadena inválida: debe terminar en "${G.suffix}"`;if(G.format==="includes")return`Cadena inválida: debe incluir "${G.includes}"`;if(G.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${G.pattern}`;return`Inválido ${D[G.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${X[U.origin]??U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${X[U.origin]??U.origin}`;default:return"Entrada inválida"}}};function h8(){return{localeError:aF()}}var eF=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function v(U){return $[U]??null}let D={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:"ورودی"},X={nan:"NaN",number:"عدد",array:"آرایه"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`ورودی نامعتبر: میبایست instanceof ${U.expected} میبود، ${Q} دریافت شد`;return`ورودی نامعتبر: میبایست ${G} میبود، ${Q} دریافت شد`}case"invalid_value":if(U.values.length===1)return`ورودی نامعتبر: میبایست ${j(U.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${O(U.values,"|")} میبود`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${G}${U.maximum.toString()} ${J.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${G}${U.maximum.toString()} باشد`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`خیلی کوچک: ${U.origin} باید ${G}${U.minimum.toString()} ${J.unit} باشد`;return`خیلی کوچک: ${U.origin} باید ${G}${U.minimum.toString()} باشد`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`رشته نامعتبر: باید با "${G.prefix}" شروع شود`;if(G.format==="ends_with")return`رشته نامعتبر: باید با "${G.suffix}" تمام شود`;if(G.format==="includes")return`رشته نامعتبر: باید شامل "${G.includes}" باشد`;if(G.format==="regex")return`رشته نامعتبر: باید با الگوی ${G.pattern} مطابقت داشته باشد`;return`${D[G.format]??U.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${U.divisor} باشد`;case"unrecognized_keys":return`کلید${U.keys.length>1?"های":""} ناشناس: ${O(U.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${U.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${U.origin}`;default:return"ورودی نامعتبر"}}};function m8(){return{localeError:eF()}}var sF=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Virheellinen tyyppi: odotettiin instanceof ${U.expected}, oli ${Q}`;return`Virheellinen tyyppi: odotettiin ${G}, oli ${Q}`}case"invalid_value":if(U.values.length===1)return`Virheellinen syöte: täytyy olla ${j(U.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Liian suuri: ${J.subject} täytyy olla ${G}${U.maximum.toString()} ${J.unit}`.trim();return`Liian suuri: arvon täytyy olla ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Liian pieni: ${J.subject} täytyy olla ${G}${U.minimum.toString()} ${J.unit}`.trim();return`Liian pieni: arvon täytyy olla ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${G.prefix}"`;if(G.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${G.suffix}"`;if(G.format==="includes")return`Virheellinen syöte: täytyy sisältää "${G.includes}"`;if(G.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${G.pattern}`;return`Virheellinen ${D[G.format]??U.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${U.divisor} monikerta`;case"unrecognized_keys":return`${U.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${O(U.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 c8(){return{localeError:sF()}}var $j=()=>{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 v(U){return $[U]??null}let D={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"},X={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : instanceof ${U.expected} attendu, ${Q} reçu`;return`Entrée invalide : ${G} attendu, ${Q} reçu`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : ${j(U.values[0])} attendu`;return`Option invalide : une valeur parmi ${O(U.values,"|")} attendue`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Trop grand : ${X[U.origin]??"valeur"} doit ${J.verb} ${G}${U.maximum.toString()} ${J.unit??"élément(s)"}`;return`Trop grand : ${X[U.origin]??"valeur"} doit être ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Trop petit : ${X[U.origin]??"valeur"} doit ${J.verb} ${G}${U.minimum.toString()} ${J.unit}`;return`Trop petit : ${X[U.origin]??"valeur"} doit être ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Chaîne invalide : doit commencer par "${G.prefix}"`;if(G.format==="ends_with")return`Chaîne invalide : doit se terminer par "${G.suffix}"`;if(G.format==="includes")return`Chaîne invalide : doit inclure "${G.includes}"`;if(G.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${G.pattern}`;return`${D[G.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${O(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function r8(){return{localeError:$j()}}var vj=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : attendu instanceof ${U.expected}, reçu ${Q}`;return`Entrée invalide : attendu ${G}, reçu ${Q}`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : attendu ${j(U.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"≤":"<",J=v(U.origin);if(J)return`Trop grand : attendu que ${U.origin??"la valeur"} ait ${G}${U.maximum.toString()} ${J.unit}`;return`Trop grand : attendu que ${U.origin??"la valeur"} soit ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?"≥":">",J=v(U.origin);if(J)return`Trop petit : attendu que ${U.origin} ait ${G}${U.minimum.toString()} ${J.unit}`;return`Trop petit : attendu que ${U.origin} soit ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Chaîne invalide : doit commencer par "${G.prefix}"`;if(G.format==="ends_with")return`Chaîne invalide : doit se terminer par "${G.suffix}"`;if(G.format==="includes")return`Chaîne invalide : doit inclure "${G.includes}"`;if(G.format==="regex")return`Chaîne invalide : doit correspondre au motif ${G.pattern}`;return`${D[G.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${O(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function d8(){return{localeError:vj()}}var Uj=()=>{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"}},v={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},D=(z)=>z?$[z]:void 0,X=(z)=>{let Y=D(z);if(Y)return Y.label;return z??$.unknown.label},U=(z)=>`ה${X(z)}`,G=(z)=>{return(D(z)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},J=(z)=>{if(!z)return null;return v[z]??null},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"}},W={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let Y=z.expected,I=W[Y??""]??X(Y),V=A(z.input),B=W[V]??$[V]?.label??V;if(/^[A-Z]/.test(z.expected))return`קלט לא תקין: צריך להיות instanceof ${z.expected}, התקבל ${B}`;return`קלט לא תקין: צריך להיות ${I}, התקבל ${B}`}case"invalid_value":{if(z.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(z.values[0])}`;let Y=z.values.map((B)=>j(B));if(z.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Y[0]} או ${Y[1]}`;let I=Y[Y.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Y.slice(0,-1).join(", ")} או ${I}`}case"too_big":{let Y=J(z.origin),I=U(z.origin??"value");if(z.origin==="string")return`${Y?.longLabel??"ארוך"} מדי: ${I} צריכה להכיל ${z.maximum.toString()} ${Y?.unit??""} ${z.inclusive?"או פחות":"לכל היותר"}`.trim();if(z.origin==="number"){let L=z.inclusive?`קטן או שווה ל-${z.maximum}`:`קטן מ-${z.maximum}`;return`גדול מדי: ${I} צריך להיות ${L}`}if(z.origin==="array"||z.origin==="set"){let L=z.origin==="set"?"צריכה":"צריך",N=z.inclusive?`${z.maximum} ${Y?.unit??""} או פחות`:`פחות מ-${z.maximum} ${Y?.unit??""}`;return`גדול מדי: ${I} ${L} להכיל ${N}`.trim()}let V=z.inclusive?"<=":"<",B=G(z.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${I} ${B} ${V}${z.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${I} ${B} ${V}${z.maximum.toString()}`}case"too_small":{let Y=J(z.origin),I=U(z.origin??"value");if(z.origin==="string")return`${Y?.shortLabel??"קצר"} מדי: ${I} צריכה להכיל ${z.minimum.toString()} ${Y?.unit??""} ${z.inclusive?"או יותר":"לפחות"}`.trim();if(z.origin==="number"){let L=z.inclusive?`גדול או שווה ל-${z.minimum}`:`גדול מ-${z.minimum}`;return`קטן מדי: ${I} צריך להיות ${L}`}if(z.origin==="array"||z.origin==="set"){let L=z.origin==="set"?"צריכה":"צריך";if(z.minimum===1&&z.inclusive){let Z=z.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${I} ${L} להכיל ${Z}`}let N=z.inclusive?`${z.minimum} ${Y?.unit??""} או יותר`:`יותר מ-${z.minimum} ${Y?.unit??""}`;return`קטן מדי: ${I} ${L} להכיל ${N}`.trim()}let V=z.inclusive?">=":">",B=G(z.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${I} ${B} ${V}${z.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${I} ${B} ${V}${z.minimum.toString()}`}case"invalid_format":{let Y=z;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 I=Q[Y.format],V=I?.label??Y.format,L=(I?.gender??"m")==="f"?"תקינה":"תקין";return`${V} לא ${L}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${z.divisor}`;case"unrecognized_keys":return`מפתח${z.keys.length>1?"ות":""} לא מזוה${z.keys.length>1?"ים":"ה"}: ${O(z.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(z.origin??"array")}`;default:return"קלט לא תקין"}}};function p8(){return{localeError:Uj()}}var Dj=()=>{let $={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function v(U){return $[U]??null}let D={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},X={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Neispravan unos: očekuje se instanceof ${U.expected}, a primljeno je ${Q}`;return`Neispravan unos: očekuje se ${G}, a primljeno je ${Q}`}case"invalid_value":if(U.values.length===1)return`Neispravna vrijednost: očekivano ${j(U.values[0])}`;return`Neispravna opcija: očekivano jedno od ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin),Q=X[U.origin]??U.origin;if(J)return`Preveliko: očekivano da ${Q??"vrijednost"} ima ${G}${U.maximum.toString()} ${J.unit??"elemenata"}`;return`Preveliko: očekivano da ${Q??"vrijednost"} bude ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin),Q=X[U.origin]??U.origin;if(J)return`Premalo: očekivano da ${Q} ima ${G}${U.minimum.toString()} ${J.unit}`;return`Premalo: očekivano da ${Q} bude ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Neispravan tekst: mora započinjati s "${G.prefix}"`;if(G.format==="ends_with")return`Neispravan tekst: mora završavati s "${G.suffix}"`;if(G.format==="includes")return`Neispravan tekst: mora sadržavati "${G.includes}"`;if(G.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${G.pattern}`;return`Neispravna ${D[G.format]??U.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${U.divisor}`;case"unrecognized_keys":return`Neprepoznat${U.keys.length>1?"i ključevi":" ključ"}: ${O(U.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${X[U.origin]??U.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${X[U.origin]??U.origin}`;default:return"Neispravan unos"}}};function t8(){return{localeError:Dj()}}var Xj=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"szám",array:"tömb"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Érvénytelen bemenet: a várt érték instanceof ${U.expected}, a kapott érték ${Q}`;return`Érvénytelen bemenet: a várt érték ${G}, a kapott érték ${Q}`}case"invalid_value":if(U.values.length===1)return`Érvénytelen bemenet: a várt érték ${j(U.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Túl nagy: ${U.origin??"érték"} mérete túl nagy ${G}${U.maximum.toString()} ${J.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${U.origin??"érték"} túl nagy: ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Túl kicsi: a bemeneti érték ${U.origin} mérete túl kicsi ${G}${U.minimum.toString()} ${J.unit}`;return`Túl kicsi: a bemeneti érték ${U.origin} túl kicsi ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Érvénytelen string: "${G.prefix}" értékkel kell kezdődnie`;if(G.format==="ends_with")return`Érvénytelen string: "${G.suffix}" értékkel kell végződnie`;if(G.format==="includes")return`Érvénytelen string: "${G.includes}" értéket kell tartalmaznia`;if(G.format==="regex")return`Érvénytelen string: ${G.pattern} mintának kell megfelelnie`;return`Érvénytelen ${D[G.format]??U.format}`}case"not_multiple_of":return`Érvénytelen szám: ${U.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${U.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${U.origin}`;default:return"Érvénytelen bemenet"}}};function o8(){return{localeError:Xj()}}function cY($,v,D){return Math.abs($)===1?v:D}function c6($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],D=$[$.length-1];return $+(v.includes(D)?"ն":"ը")}var Gj=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function v(U){return $[U]??null}let D={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:"մուտք"},X={nan:"NaN",number:"թիվ",array:"զանգված"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${U.expected}, ստացվել է ${Q}`;return`Սխալ մուտքագրում․ սպասվում էր ${G}, ստացվել է ${Q}`}case"invalid_value":if(U.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${j(U.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J){let Q=Number(U.maximum),W=cY(Q,J.unit.one,J.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${c6(U.origin??"արժեք")} կունենա ${G}${U.maximum.toString()} ${W}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${c6(U.origin??"արժեք")} լինի ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J){let Q=Number(U.minimum),W=cY(Q,J.unit.one,J.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${c6(U.origin)} կունենա ${G}${U.minimum.toString()} ${W}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${c6(U.origin)} լինի ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${G.prefix}"-ով`;if(G.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${G.suffix}"-ով`;if(G.format==="includes")return`Սխալ տող․ պետք է պարունակի "${G.includes}"`;if(G.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${G.pattern} ձևաչափին`;return`Սխալ ${D[G.format]??U.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${U.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${U.keys.length>1?"ներ":""}. ${O(U.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${c6(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${c6(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function a8(){return{localeError:Gj()}}var Jj=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Input tidak valid: diharapkan instanceof ${U.expected}, diterima ${Q}`;return`Input tidak valid: diharapkan ${G}, diterima ${Q}`}case"invalid_value":if(U.values.length===1)return`Input tidak valid: diharapkan ${j(U.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Terlalu besar: diharapkan ${U.origin??"value"} memiliki ${G}${U.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: diharapkan ${U.origin??"value"} menjadi ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Terlalu kecil: diharapkan ${U.origin} memiliki ${G}${U.minimum.toString()} ${J.unit}`;return`Terlalu kecil: diharapkan ${U.origin} menjadi ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`String tidak valid: harus dimulai dengan "${G.prefix}"`;if(G.format==="ends_with")return`String tidak valid: harus berakhir dengan "${G.suffix}"`;if(G.format==="includes")return`String tidak valid: harus menyertakan "${G.includes}"`;if(G.format==="regex")return`String tidak valid: harus sesuai pola ${G.pattern}`;return`${D[G.format]??U.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${U.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${U.origin}`;default:return"Input tidak valid"}}};function e8(){return{localeError:Jj()}}var Qj=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"númer",array:"fylki"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Rangt gildi: Þú slóst inn ${Q} þar sem á að vera instanceof ${U.expected}`;return`Rangt gildi: Þú slóst inn ${Q} þar sem á að vera ${G}`}case"invalid_value":if(U.values.length===1)return`Rangt gildi: gert ráð fyrir ${j(U.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} hafi ${G}${U.maximum.toString()} ${J.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} sé ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Of lítið: gert er ráð fyrir að ${U.origin} hafi ${G}${U.minimum.toString()} ${J.unit}`;return`Of lítið: gert er ráð fyrir að ${U.origin} sé ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Ógildur strengur: verður að byrja á "${G.prefix}"`;if(G.format==="ends_with")return`Ógildur strengur: verður að enda á "${G.suffix}"`;if(G.format==="includes")return`Ógildur strengur: verður að innihalda "${G.includes}"`;if(G.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${G.pattern}`;return`Rangt ${D[G.format]??U.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${U.divisor}`;case"unrecognized_keys":return`Óþekkt ${U.keys.length>1?"ir lyklar":"ur lykill"}: ${O(U.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${U.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${U.origin}`;default:return"Rangt gildi"}}};function s8(){return{localeError:Qj()}}var Wj=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"numero",array:"vettore"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Input non valido: atteso instanceof ${U.expected}, ricevuto ${Q}`;return`Input non valido: atteso ${G}, ricevuto ${Q}`}case"invalid_value":if(U.values.length===1)return`Input non valido: atteso ${j(U.values[0])}`;return`Opzione non valida: atteso uno tra ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Troppo grande: ${U.origin??"valore"} deve avere ${G}${U.maximum.toString()} ${J.unit??"elementi"}`;return`Troppo grande: ${U.origin??"valore"} deve essere ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Troppo piccolo: ${U.origin} deve avere ${G}${U.minimum.toString()} ${J.unit}`;return`Troppo piccolo: ${U.origin} deve essere ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Stringa non valida: deve iniziare con "${G.prefix}"`;if(G.format==="ends_with")return`Stringa non valida: deve terminare con "${G.suffix}"`;if(G.format==="includes")return`Stringa non valida: deve includere "${G.includes}"`;if(G.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${G.pattern}`;return`Input non valido: ${D[G.format]??U.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${U.divisor}`;case"unrecognized_keys":return`Chiav${U.keys.length>1?"i":"e"} non riconosciut${U.keys.length>1?"e":"a"}: ${O(U.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${U.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${U.origin}`;default:return"Input non valido"}}};function $Q(){return{localeError:Wj()}}var zj=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function v(U){return $[U]??null}let D={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:"入力値"},X={nan:"NaN",number:"数値",array:"配列"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`無効な入力: instanceof ${U.expected}が期待されましたが、${Q}が入力されました`;return`無効な入力: ${G}が期待されましたが、${Q}が入力されました`}case"invalid_value":if(U.values.length===1)return`無効な入力: ${j(U.values[0])}が期待されました`;return`無効な選択: ${O(U.values,"、")}のいずれかである必要があります`;case"too_big":{let G=U.inclusive?"以下である":"より小さい",J=v(U.origin);if(J)return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${J.unit??"要素"}${G}必要があります`;return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${G}必要があります`}case"too_small":{let G=U.inclusive?"以上である":"より大きい",J=v(U.origin);if(J)return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${J.unit}${G}必要があります`;return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${G}必要があります`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`無効な文字列: "${G.prefix}"で始まる必要があります`;if(G.format==="ends_with")return`無効な文字列: "${G.suffix}"で終わる必要があります`;if(G.format==="includes")return`無効な文字列: "${G.includes}"を含む必要があります`;if(G.format==="regex")return`無効な文字列: パターン${G.pattern}に一致する必要があります`;return`無効な${D[G.format]??U.format}`}case"not_multiple_of":return`無効な数値: ${U.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${U.keys.length>1?"群":""}: ${O(U.keys,"、")}`;case"invalid_key":return`${U.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${U.origin}内の無効な値`;default:return"無効な入力"}}};function vQ(){return{localeError:zj()}}var Yj=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function v(U){return $[U]??null}let D={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:"შეყვანა"},X={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${U.expected}, მიღებული ${Q}`;return`არასწორი შეყვანა: მოსალოდნელი ${G}, მიღებული ${Q}`}case"invalid_value":if(U.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${j(U.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${O(U.values,"|")}-დან`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} ${J.verb} ${G}${U.maximum.toString()} ${J.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} იყოს ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} ${J.verb} ${G}${U.minimum.toString()} ${J.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} იყოს ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`არასწორი ველი: უნდა იწყებოდეს "${G.prefix}"-ით`;if(G.format==="ends_with")return`არასწორი ველი: უნდა მთავრდებოდეს "${G.suffix}"-ით`;if(G.format==="includes")return`არასწორი ველი: უნდა შეიცავდეს "${G.includes}"-ს`;if(G.format==="regex")return`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${G.pattern}`;return`არასწორი ${D[G.format]??U.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${U.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${U.keys.length>1?"ები":"ი"}: ${O(U.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${U.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${U.origin}-ში`;default:return"არასწორი შეყვანა"}}};function UQ(){return{localeError:Yj()}}var Ij=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function v(U){return $[U]??null}let D={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:"ទិន្នន័យបញ្ចូល"},X={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${U.expected} ប៉ុន្តែទទួលបាន ${Q}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${G} ប៉ុន្តែទទួលបាន ${Q}`}case"invalid_value":if(U.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${j(U.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${G} ${U.maximum.toString()} ${J.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${G} ${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`តូចពេក៖ ត្រូវការ ${U.origin} ${G} ${U.minimum.toString()} ${J.unit}`;return`តូចពេក៖ ត្រូវការ ${U.origin} ${G} ${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${G.prefix}"`;if(G.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${G.suffix}"`;if(G.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${G.includes}"`;if(G.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${G.pattern}`;return`មិនត្រឹមត្រូវ៖ ${D[G.format]??U.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${U.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${O(U.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Kv(){return{localeError:Ij()}}function DQ(){return Kv()}var Vj=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function v(U){return $[U]??null}let D={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:"입력"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`잘못된 입력: 예상 타입은 instanceof ${U.expected}, 받은 타입은 ${Q}입니다`;return`잘못된 입력: 예상 타입은 ${G}, 받은 타입은 ${Q}입니다`}case"invalid_value":if(U.values.length===1)return`잘못된 입력: 값은 ${j(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${O(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let G=U.inclusive?"이하":"미만",J=G==="미만"?"이어야 합니다":"여야 합니다",Q=v(U.origin),W=Q?.unit??"요소";if(Q)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${W} ${G}${J}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${G}${J}`}case"too_small":{let G=U.inclusive?"이상":"초과",J=G==="이상"?"이어야 합니다":"여야 합니다",Q=v(U.origin),W=Q?.unit??"요소";if(Q)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${W} ${G}${J}`;return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()} ${G}${J}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`잘못된 문자열: "${G.prefix}"(으)로 시작해야 합니다`;if(G.format==="ends_with")return`잘못된 문자열: "${G.suffix}"(으)로 끝나야 합니다`;if(G.format==="includes")return`잘못된 문자열: "${G.includes}"을(를) 포함해야 합니다`;if(G.format==="regex")return`잘못된 문자열: 정규식 ${G.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${D[G.format]??U.format}`}case"not_multiple_of":return`잘못된 숫자: ${U.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${O(U.keys,", ")}`;case"invalid_key":return`잘못된 키: ${U.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${U.origin}`;default:return"잘못된 입력"}}};function XQ(){return{localeError:Vj()}}var Nv=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function rY($){let v=Math.abs($),D=v%10,X=v%100;if(X>=11&&X<=19||D===0)return"many";if(D===1)return"one";return"few"}var Bj=()=>{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 v(U,G,J,Q){let W=$[U]??null;if(W===null)return W;return{unit:W.unit[G],verb:W.verb[Q][J?"inclusive":"notInclusive"]}}let D={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"},X={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Gautas tipas ${Q}, o tikėtasi - instanceof ${U.expected}`;return`Gautas tipas ${Q}, o tikėtasi - ${G}`}case"invalid_value":if(U.values.length===1)return`Privalo būti ${j(U.values[0])}`;return`Privalo būti vienas iš ${O(U.values,"|")} pasirinkimų`;case"too_big":{let G=X[U.origin]??U.origin,J=v(U.origin,rY(Number(U.maximum)),U.inclusive??!1,"smaller");if(J?.verb)return`${Nv(G??U.origin??"reikšmė")} ${J.verb} ${U.maximum.toString()} ${J.unit??"elementų"}`;let Q=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Nv(G??U.origin??"reikšmė")} turi būti ${Q} ${U.maximum.toString()} ${J?.unit}`}case"too_small":{let G=X[U.origin]??U.origin,J=v(U.origin,rY(Number(U.minimum)),U.inclusive??!1,"bigger");if(J?.verb)return`${Nv(G??U.origin??"reikšmė")} ${J.verb} ${U.minimum.toString()} ${J.unit??"elementų"}`;let Q=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Nv(G??U.origin??"reikšmė")} turi būti ${Q} ${U.minimum.toString()} ${J?.unit}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Eilutė privalo prasidėti "${G.prefix}"`;if(G.format==="ends_with")return`Eilutė privalo pasibaigti "${G.suffix}"`;if(G.format==="includes")return`Eilutė privalo įtraukti "${G.includes}"`;if(G.format==="regex")return`Eilutė privalo atitikti ${G.pattern}`;return`Neteisingas ${D[G.format]??U.format}`}case"not_multiple_of":return`Skaičius privalo būti ${U.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${U.keys.length>1?"i":"as"} rakt${U.keys.length>1?"ai":"as"}: ${O(U.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let G=X[U.origin]??U.origin;return`${Nv(G??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function GQ(){return{localeError:Bj()}}var Lj=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function v(U){return $[U]??null}let D={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:"внес"},X={nan:"NaN",number:"број",array:"низа"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Грешен внес: се очекува instanceof ${U.expected}, примено ${Q}`;return`Грешен внес: се очекува ${G}, примено ${Q}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${j(U.values[0])}`;return`Грешана опција: се очекува една ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Премногу голем: се очекува ${U.origin??"вредноста"} да има ${G}${U.maximum.toString()} ${J.unit??"елементи"}`;return`Премногу голем: се очекува ${U.origin??"вредноста"} да биде ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Премногу мал: се очекува ${U.origin} да има ${G}${U.minimum.toString()} ${J.unit}`;return`Премногу мал: се очекува ${U.origin} да биде ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Неважечка низа: мора да започнува со "${G.prefix}"`;if(G.format==="ends_with")return`Неважечка низа: мора да завршува со "${G.suffix}"`;if(G.format==="includes")return`Неважечка низа: мора да вклучува "${G.includes}"`;if(G.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${G.pattern}`;return`Invalid ${D[G.format]??U.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${O(U.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${U.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${U.origin}`;default:return"Грешен внес"}}};function JQ(){return{localeError:Lj()}}var Kj=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"nombor"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Input tidak sah: dijangka instanceof ${U.expected}, diterima ${Q}`;return`Input tidak sah: dijangka ${G}, diterima ${Q}`}case"invalid_value":if(U.values.length===1)return`Input tidak sah: dijangka ${j(U.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Terlalu besar: dijangka ${U.origin??"nilai"} ${J.verb} ${G}${U.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: dijangka ${U.origin??"nilai"} adalah ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Terlalu kecil: dijangka ${U.origin} ${J.verb} ${G}${U.minimum.toString()} ${J.unit}`;return`Terlalu kecil: dijangka ${U.origin} adalah ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`String tidak sah: mesti bermula dengan "${G.prefix}"`;if(G.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${G.suffix}"`;if(G.format==="includes")return`String tidak sah: mesti mengandungi "${G.includes}"`;if(G.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${G.pattern}`;return`${D[G.format]??U.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${O(U.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${U.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${U.origin}`;default:return"Input tidak sah"}}};function QQ(){return{localeError:Kj()}}var Nj=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"getal"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Ongeldige invoer: verwacht instanceof ${U.expected}, ontving ${Q}`;return`Ongeldige invoer: verwacht ${G}, ontving ${Q}`}case"invalid_value":if(U.values.length===1)return`Ongeldige invoer: verwacht ${j(U.values[0])}`;return`Ongeldige optie: verwacht één van ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin),Q=U.origin==="date"?"laat":U.origin==="string"?"lang":"groot";if(J)return`Te ${Q}: verwacht dat ${U.origin??"waarde"} ${G}${U.maximum.toString()} ${J.unit??"elementen"} ${J.verb}`;return`Te ${Q}: verwacht dat ${U.origin??"waarde"} ${G}${U.maximum.toString()} is`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin),Q=U.origin==="date"?"vroeg":U.origin==="string"?"kort":"klein";if(J)return`Te ${Q}: verwacht dat ${U.origin} ${G}${U.minimum.toString()} ${J.unit} ${J.verb}`;return`Te ${Q}: verwacht dat ${U.origin} ${G}${U.minimum.toString()} is`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Ongeldige tekst: moet met "${G.prefix}" beginnen`;if(G.format==="ends_with")return`Ongeldige tekst: moet op "${G.suffix}" eindigen`;if(G.format==="includes")return`Ongeldige tekst: moet "${G.includes}" bevatten`;if(G.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${G.pattern}`;return`Ongeldig: ${D[G.format]??U.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${U.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${U.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${U.origin}`;default:return"Ongeldige invoer"}}};function WQ(){return{localeError:Nj()}}var Zj=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"tall",array:"liste"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Ugyldig input: forventet instanceof ${U.expected}, fikk ${Q}`;return`Ugyldig input: forventet ${G}, fikk ${Q}`}case"invalid_value":if(U.values.length===1)return`Ugyldig verdi: forventet ${j(U.values[0])}`;return`Ugyldig valg: forventet en av ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`For stor(t): forventet ${U.origin??"value"} til å ha ${G}${U.maximum.toString()} ${J.unit??"elementer"}`;return`For stor(t): forventet ${U.origin??"value"} til å ha ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`For lite(n): forventet ${U.origin} til å ha ${G}${U.minimum.toString()} ${J.unit}`;return`For lite(n): forventet ${U.origin} til å ha ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Ugyldig streng: må starte med "${G.prefix}"`;if(G.format==="ends_with")return`Ugyldig streng: må ende med "${G.suffix}"`;if(G.format==="includes")return`Ugyldig streng: må inneholde "${G.includes}"`;if(G.format==="regex")return`Ugyldig streng: må matche mønsteret ${G.pattern}`;return`Ugyldig ${D[G.format]??U.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${O(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${U.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${U.origin}`;default:return"Ugyldig input"}}};function zQ(){return{localeError:Zj()}}var Oj=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Fâsit giren: umulan instanceof ${U.expected}, alınan ${Q}`;return`Fâsit giren: umulan ${G}, alınan ${Q}`}case"invalid_value":if(U.values.length===1)return`Fâsit giren: umulan ${j(U.values[0])}`;return`Fâsit tercih: mûteberler ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Fazla büyük: ${U.origin??"value"}, ${G}${U.maximum.toString()} ${J.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${U.origin??"value"}, ${G}${U.maximum.toString()} olmalıydı.`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Fazla küçük: ${U.origin}, ${G}${U.minimum.toString()} ${J.unit} sahip olmalıydı.`;return`Fazla küçük: ${U.origin}, ${G}${U.minimum.toString()} olmalıydı.`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Fâsit metin: "${G.prefix}" ile başlamalı.`;if(G.format==="ends_with")return`Fâsit metin: "${G.suffix}" ile bitmeli.`;if(G.format==="includes")return`Fâsit metin: "${G.includes}" ihtivâ etmeli.`;if(G.format==="regex")return`Fâsit metin: ${G.pattern} nakşına uymalı.`;return`Fâsit ${D[G.format]??U.format}`}case"not_multiple_of":return`Fâsit sayı: ${U.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`${U.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${U.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function YQ(){return{localeError:Oj()}}var Hj=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function v(U){return $[U]??null}let D={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:"ورودي"},X={nan:"NaN",number:"عدد",array:"ارې"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`ناسم ورودي: باید instanceof ${U.expected} وای, مګر ${Q} ترلاسه شو`;return`ناسم ورودي: باید ${G} وای, مګر ${Q} ترلاسه شو`}case"invalid_value":if(U.values.length===1)return`ناسم ورودي: باید ${j(U.values[0])} وای`;return`ناسم انتخاب: باید یو له ${O(U.values,"|")} څخه وای`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`ډیر لوی: ${U.origin??"ارزښت"} باید ${G}${U.maximum.toString()} ${J.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${U.origin??"ارزښت"} باید ${G}${U.maximum.toString()} وي`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`ډیر کوچنی: ${U.origin} باید ${G}${U.minimum.toString()} ${J.unit} ولري`;return`ډیر کوچنی: ${U.origin} باید ${G}${U.minimum.toString()} وي`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`ناسم متن: باید د "${G.prefix}" سره پیل شي`;if(G.format==="ends_with")return`ناسم متن: باید د "${G.suffix}" سره پای ته ورسيږي`;if(G.format==="includes")return`ناسم متن: باید "${G.includes}" ولري`;if(G.format==="regex")return`ناسم متن: باید د ${G.pattern} سره مطابقت ولري`;return`${D[G.format]??U.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${U.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${U.keys.length>1?"کلیډونه":"کلیډ"}: ${O(U.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${U.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${U.origin} کې`;default:return"ناسمه ورودي"}}};function IQ(){return{localeError:Hj()}}var Fj=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"liczba",array:"tablica"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${U.expected}, otrzymano ${Q}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${G}, otrzymano ${Q}`}case"invalid_value":if(U.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${j(U.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Za duża wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${G}${U.maximum.toString()} ${J.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Za mała wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${G}${U.minimum.toString()} ${J.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${G.prefix}"`;if(G.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${G.suffix}"`;if(G.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${G.includes}"`;if(G.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${G.pattern}`;return`Nieprawidłow(y/a/e) ${D[G.format]??U.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${U.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${U.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${U.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function VQ(){return{localeError:Fj()}}var jj=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"número",null:"nulo"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Tipo inválido: esperado instanceof ${U.expected}, recebido ${Q}`;return`Tipo inválido: esperado ${G}, recebido ${Q}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: esperado ${j(U.values[0])}`;return`Opção inválida: esperada uma das ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Muito grande: esperado que ${U.origin??"valor"} tivesse ${G}${U.maximum.toString()} ${J.unit??"elementos"}`;return`Muito grande: esperado que ${U.origin??"valor"} fosse ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Muito pequeno: esperado que ${U.origin} tivesse ${G}${U.minimum.toString()} ${J.unit}`;return`Muito pequeno: esperado que ${U.origin} fosse ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Texto inválido: deve começar com "${G.prefix}"`;if(G.format==="ends_with")return`Texto inválido: deve terminar com "${G.suffix}"`;if(G.format==="includes")return`Texto inválido: deve incluir "${G.includes}"`;if(G.format==="regex")return`Texto inválido: deve corresponder ao padrão ${G.pattern}`;return`${D[G.format]??U.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Chave${U.keys.length>1?"s":""} desconhecida${U.keys.length>1?"s":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Chave inválida em ${U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${U.origin}`;default:return"Campo inválido"}}};function BQ(){return{localeError:jj()}}var Aj=()=>{let $={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function v(U){return $[U]??null}let D={regex:"intrare",email:"adresă de 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:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},X={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;return`Intrare invalidă: așteptat ${G}, primit ${Q}`}case"invalid_value":if(U.values.length===1)return`Intrare invalidă: așteptat ${j(U.values[0])}`;return`Opțiune invalidă: așteptat una dintre ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Prea mare: așteptat ca ${U.origin??"valoarea"} ${J.verb} ${G}${U.maximum.toString()} ${J.unit??"elemente"}`;return`Prea mare: așteptat ca ${U.origin??"valoarea"} să fie ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Prea mic: așteptat ca ${U.origin} ${J.verb} ${G}${U.minimum.toString()} ${J.unit}`;return`Prea mic: așteptat ca ${U.origin} să fie ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Șir invalid: trebuie să înceapă cu "${G.prefix}"`;if(G.format==="ends_with")return`Șir invalid: trebuie să se termine cu "${G.suffix}"`;if(G.format==="includes")return`Șir invalid: trebuie să includă "${G.includes}"`;if(G.format==="regex")return`Șir invalid: trebuie să se potrivească cu modelul ${G.pattern}`;return`Format invalid: ${D[G.format]??U.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${U.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${O(U.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${U.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${U.origin}`;default:return"Intrare invalidă"}}};function LQ(){return{localeError:Aj()}}function dY($,v,D,X){let U=Math.abs($),G=U%10,J=U%100;if(J>=11&&J<=19)return X;if(G===1)return v;if(G>=2&&G<=4)return D;return X}var wj=()=>{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 v(U){return $[U]??null}let D={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:"ввод"},X={nan:"NaN",number:"число",array:"массив"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Неверный ввод: ожидалось instanceof ${U.expected}, получено ${Q}`;return`Неверный ввод: ожидалось ${G}, получено ${Q}`}case"invalid_value":if(U.values.length===1)return`Неверный ввод: ожидалось ${j(U.values[0])}`;return`Неверный вариант: ожидалось одно из ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J){let Q=Number(U.maximum),W=dY(Q,J.unit.one,J.unit.few,J.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${G}${U.maximum.toString()} ${W}`}return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J){let Q=Number(U.minimum),W=dY(Q,J.unit.one,J.unit.few,J.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${G}${U.minimum.toString()} ${W}`}return`Слишком маленькое значение: ожидалось, что ${U.origin} будет ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Неверная строка: должна начинаться с "${G.prefix}"`;if(G.format==="ends_with")return`Неверная строка: должна заканчиваться на "${G.suffix}"`;if(G.format==="includes")return`Неверная строка: должна содержать "${G.includes}"`;if(G.format==="regex")return`Неверная строка: должна соответствовать шаблону ${G.pattern}`;return`Неверный ${D[G.format]??U.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспознанн${U.keys.length>1?"ые":"ый"} ключ${U.keys.length>1?"и":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${U.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${U.origin}`;default:return"Неверные входные данные"}}};function KQ(){return{localeError:wj()}}var Mj=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"število",array:"tabela"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Neveljaven vnos: pričakovano instanceof ${U.expected}, prejeto ${Q}`;return`Neveljaven vnos: pričakovano ${G}, prejeto ${Q}`}case"invalid_value":if(U.values.length===1)return`Neveljaven vnos: pričakovano ${j(U.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} imelo ${G}${U.maximum.toString()} ${J.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Premajhno: pričakovano, da bo ${U.origin} imelo ${G}${U.minimum.toString()} ${J.unit}`;return`Premajhno: pričakovano, da bo ${U.origin} ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Neveljaven niz: mora se začeti z "${G.prefix}"`;if(G.format==="ends_with")return`Neveljaven niz: mora se končati z "${G.suffix}"`;if(G.format==="includes")return`Neveljaven niz: mora vsebovati "${G.includes}"`;if(G.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${G.pattern}`;return`Neveljaven ${D[G.format]??U.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${U.divisor}`;case"unrecognized_keys":return`Neprepoznan${U.keys.length>1?"i ključi":" ključ"}: ${O(U.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${U.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${U.origin}`;default:return"Neveljaven vnos"}}};function NQ(){return{localeError:Mj()}}var Pj=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"antal",array:"lista"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Ogiltig inmatning: förväntat instanceof ${U.expected}, fick ${Q}`;return`Ogiltig inmatning: förväntat ${G}, fick ${Q}`}case"invalid_value":if(U.values.length===1)return`Ogiltig inmatning: förväntat ${j(U.values[0])}`;return`Ogiltigt val: förväntade en av ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`För stor(t): förväntade ${U.origin??"värdet"} att ha ${G}${U.maximum.toString()} ${J.unit??"element"}`;return`För stor(t): förväntat ${U.origin??"värdet"} att ha ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${G}${U.minimum.toString()} ${J.unit}`;return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Ogiltig sträng: måste börja med "${G.prefix}"`;if(G.format==="ends_with")return`Ogiltig sträng: måste sluta med "${G.suffix}"`;if(G.format==="includes")return`Ogiltig sträng: måste innehålla "${G.includes}"`;if(G.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${G.pattern}"`;return`Ogiltig(t) ${D[G.format]??U.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${O(U.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${U.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${U.origin??"värdet"}`;default:return"Ogiltig input"}}};function ZQ(){return{localeError:Pj()}}var bj=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${U.expected}, பெறப்பட்டது ${Q}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${G}, பெறப்பட்டது ${Q}`}case"invalid_value":if(U.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${j(U.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${O(U.values,"|")} இல் ஒன்று`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${G}${U.maximum.toString()} ${J.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${G}${U.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${G}${U.minimum.toString()} ${J.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${G}${U.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`தவறான சரம்: "${G.prefix}" இல் தொடங்க வேண்டும்`;if(G.format==="ends_with")return`தவறான சரம்: "${G.suffix}" இல் முடிவடைய வேண்டும்`;if(G.format==="includes")return`தவறான சரம்: "${G.includes}" ஐ உள்ளடக்க வேண்டும்`;if(G.format==="regex")return`தவறான சரம்: ${G.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${D[G.format]??U.format}`}case"not_multiple_of":return`தவறான எண்: ${U.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${U.keys.length>1?"கள்":""}: ${O(U.keys,", ")}`;case"invalid_key":return`${U.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${U.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function OQ(){return{localeError:bj()}}var qj=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function v(U){return $[U]??null}let D={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:"ข้อมูลที่ป้อน"},X={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${U.expected} แต่ได้รับ ${Q}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${G} แต่ได้รับ ${Q}`}case"invalid_value":if(U.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${j(U.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"ไม่เกิน":"น้อยกว่า",J=v(U.origin);if(J)return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${G} ${U.maximum.toString()} ${J.unit??"รายการ"}`;return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${G} ${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?"อย่างน้อย":"มากกว่า",J=v(U.origin);if(J)return`น้อยกว่ากำหนด: ${U.origin} ควรมี${G} ${U.minimum.toString()} ${J.unit}`;return`น้อยกว่ากำหนด: ${U.origin} ควรมี${G} ${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${G.prefix}"`;if(G.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${G.suffix}"`;if(G.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${G.includes}" อยู่ในข้อความ`;if(G.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${G.pattern}`;return`รูปแบบไม่ถูกต้อง: ${D[G.format]??U.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${U.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${O(U.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${U.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${U.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function HQ(){return{localeError:qj()}}var Sj=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function v(U){return $[U]??null}let D={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"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Geçersiz değer: beklenen instanceof ${U.expected}, alınan ${Q}`;return`Geçersiz değer: beklenen ${G}, alınan ${Q}`}case"invalid_value":if(U.values.length===1)return`Geçersiz değer: beklenen ${j(U.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Çok büyük: beklenen ${U.origin??"değer"} ${G}${U.maximum.toString()} ${J.unit??"öğe"}`;return`Çok büyük: beklenen ${U.origin??"değer"} ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Çok küçük: beklenen ${U.origin} ${G}${U.minimum.toString()} ${J.unit}`;return`Çok küçük: beklenen ${U.origin} ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Geçersiz metin: "${G.prefix}" ile başlamalı`;if(G.format==="ends_with")return`Geçersiz metin: "${G.suffix}" ile bitmeli`;if(G.format==="includes")return`Geçersiz metin: "${G.includes}" içermeli`;if(G.format==="regex")return`Geçersiz metin: ${G.pattern} desenine uymalı`;return`Geçersiz ${D[G.format]??U.format}`}case"not_multiple_of":return`Geçersiz sayı: ${U.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${U.keys.length>1?"lar":""}: ${O(U.keys,", ")}`;case"invalid_key":return`${U.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${U.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function FQ(){return{localeError:Sj()}}var kj=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function v(U){return $[U]??null}let D={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:"вхідні дані"},X={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Неправильні вхідні дані: очікується instanceof ${U.expected}, отримано ${Q}`;return`Неправильні вхідні дані: очікується ${G}, отримано ${Q}`}case"invalid_value":if(U.values.length===1)return`Неправильні вхідні дані: очікується ${j(U.values[0])}`;return`Неправильна опція: очікується одне з ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Занадто велике: очікується, що ${U.origin??"значення"} ${J.verb} ${G}${U.maximum.toString()} ${J.unit??"елементів"}`;return`Занадто велике: очікується, що ${U.origin??"значення"} буде ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Занадто мале: очікується, що ${U.origin} ${J.verb} ${G}${U.minimum.toString()} ${J.unit}`;return`Занадто мале: очікується, що ${U.origin} буде ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Неправильний рядок: повинен починатися з "${G.prefix}"`;if(G.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${G.suffix}"`;if(G.format==="includes")return`Неправильний рядок: повинен містити "${G.includes}"`;if(G.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${G.pattern}`;return`Неправильний ${D[G.format]??U.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${U.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${U.keys.length>1?"і":""}: ${O(U.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${U.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${U.origin}`;default:return"Неправильні вхідні дані"}}};function Zv(){return{localeError:kj()}}function jQ(){return Zv()}var Ej=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function v(U){return $[U]??null}let D={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:"ان پٹ"},X={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`غلط ان پٹ: instanceof ${U.expected} متوقع تھا، ${Q} موصول ہوا`;return`غلط ان پٹ: ${G} متوقع تھا، ${Q} موصول ہوا`}case"invalid_value":if(U.values.length===1)return`غلط ان پٹ: ${j(U.values[0])} متوقع تھا`;return`غلط آپشن: ${O(U.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`بہت بڑا: ${U.origin??"ویلیو"} کے ${G}${U.maximum.toString()} ${J.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${U.origin??"ویلیو"} کا ${G}${U.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`بہت چھوٹا: ${U.origin} کے ${G}${U.minimum.toString()} ${J.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${U.origin} کا ${G}${U.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`غلط سٹرنگ: "${G.prefix}" سے شروع ہونا چاہیے`;if(G.format==="ends_with")return`غلط سٹرنگ: "${G.suffix}" پر ختم ہونا چاہیے`;if(G.format==="includes")return`غلط سٹرنگ: "${G.includes}" شامل ہونا چاہیے`;if(G.format==="regex")return`غلط سٹرنگ: پیٹرن ${G.pattern} سے میچ ہونا چاہیے`;return`غلط ${D[G.format]??U.format}`}case"not_multiple_of":return`غلط نمبر: ${U.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${U.keys.length>1?"ز":""}: ${O(U.keys,"، ")}`;case"invalid_key":return`${U.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${U.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function AQ(){return{localeError:Ej()}}var Tj=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function v(U){return $[U]??null}let D={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},X={nan:"NaN",number:"raqam",array:"massiv"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${U.expected}, qabul qilingan ${Q}`;return`Noto‘g‘ri kirish: kutilgan ${G}, qabul qilingan ${Q}`}case"invalid_value":if(U.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${j(U.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Juda katta: kutilgan ${U.origin??"qiymat"} ${G}${U.maximum.toString()} ${J.unit} ${J.verb}`;return`Juda katta: kutilgan ${U.origin??"qiymat"} ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Juda kichik: kutilgan ${U.origin} ${G}${U.minimum.toString()} ${J.unit} ${J.verb}`;return`Juda kichik: kutilgan ${U.origin} ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Noto‘g‘ri satr: "${G.prefix}" bilan boshlanishi kerak`;if(G.format==="ends_with")return`Noto‘g‘ri satr: "${G.suffix}" bilan tugashi kerak`;if(G.format==="includes")return`Noto‘g‘ri satr: "${G.includes}" ni o‘z ichiga olishi kerak`;if(G.format==="regex")return`Noto‘g‘ri satr: ${G.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${D[G.format]??U.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${U.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${U.keys.length>1?"lar":""}: ${O(U.keys,", ")}`;case"invalid_key":return`${U.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${U.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function wQ(){return{localeError:Tj()}}var Rj=()=>{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 v(U){return $[U]??null}let D={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"},X={nan:"NaN",number:"số",array:"mảng"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${U.expected}, nhận được ${Q}`;return`Đầu vào không hợp lệ: mong đợi ${G}, nhận được ${Q}`}case"invalid_value":if(U.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${j(U.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${J.verb} ${G}${U.maximum.toString()} ${J.unit??"phần tử"}`;return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Quá nhỏ: mong đợi ${U.origin} ${J.verb} ${G}${U.minimum.toString()} ${J.unit}`;return`Quá nhỏ: mong đợi ${U.origin} ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${G.prefix}"`;if(G.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${G.suffix}"`;if(G.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${G.includes}"`;if(G.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${G.pattern}`;return`${D[G.format]??U.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 ${U.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${O(U.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${U.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 ${U.origin}`;default:return"Đầu vào không hợp lệ"}}};function MQ(){return{localeError:Rj()}}var gj=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function v(U){return $[U]??null}let D={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:"输入"},X={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`无效输入:期望 instanceof ${U.expected},实际接收 ${Q}`;return`无效输入:期望 ${G},实际接收 ${Q}`}case"invalid_value":if(U.values.length===1)return`无效输入:期望 ${j(U.values[0])}`;return`无效选项:期望以下之一 ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`数值过大:期望 ${U.origin??"值"} ${G}${U.maximum.toString()} ${J.unit??"个元素"}`;return`数值过大:期望 ${U.origin??"值"} ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`数值过小:期望 ${U.origin} ${G}${U.minimum.toString()} ${J.unit}`;return`数值过小:期望 ${U.origin} ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`无效字符串:必须以 "${G.prefix}" 开头`;if(G.format==="ends_with")return`无效字符串:必须以 "${G.suffix}" 结尾`;if(G.format==="includes")return`无效字符串:必须包含 "${G.includes}"`;if(G.format==="regex")return`无效字符串:必须满足正则表达式 ${G.pattern}`;return`无效${D[G.format]??U.format}`}case"not_multiple_of":return`无效数字:必须是 ${U.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${O(U.keys,", ")}`;case"invalid_key":return`${U.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${U.origin} 中包含无效值(value)`;default:return"无效输入"}}};function PQ(){return{localeError:gj()}}var uj=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function v(U){return $[U]??null}let D={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:"輸入"},X={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`無效的輸入值:預期為 instanceof ${U.expected},但收到 ${Q}`;return`無效的輸入值:預期為 ${G},但收到 ${Q}`}case"invalid_value":if(U.values.length===1)return`無效的輸入值:預期為 ${j(U.values[0])}`;return`無效的選項:預期為以下其中之一 ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`數值過大:預期 ${U.origin??"值"} 應為 ${G}${U.maximum.toString()} ${J.unit??"個元素"}`;return`數值過大:預期 ${U.origin??"值"} 應為 ${G}${U.maximum.toString()}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`數值過小:預期 ${U.origin} 應為 ${G}${U.minimum.toString()} ${J.unit}`;return`數值過小:預期 ${U.origin} 應為 ${G}${U.minimum.toString()}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`無效的字串:必須以 "${G.prefix}" 開頭`;if(G.format==="ends_with")return`無效的字串:必須以 "${G.suffix}" 結尾`;if(G.format==="includes")return`無效的字串:必須包含 "${G.includes}"`;if(G.format==="regex")return`無效的字串:必須符合格式 ${G.pattern}`;return`無效的 ${D[G.format]??U.format}`}case"not_multiple_of":return`無效的數字:必須為 ${U.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${U.keys.length>1?"們":""}:${O(U.keys,"、")}`;case"invalid_key":return`${U.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${U.origin} 中有無效的值`;default:return"無效的輸入值"}}};function bQ(){return{localeError:uj()}}var Cj=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function v(U){return $[U]??null}let D={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é"},X={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(U)=>{switch(U.code){case"invalid_type":{let G=X[U.expected]??U.expected,J=A(U.input),Q=X[J]??J;if(/^[A-Z]/.test(U.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${U.expected}, àmọ̀ a rí ${Q}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${G}, àmọ̀ a rí ${Q}`}case"invalid_value":if(U.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${j(U.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${O(U.values,"|")}`;case"too_big":{let G=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${U.origin??"iye"} ${J.verb} ${G}${U.maximum} ${J.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${G}${U.maximum}`}case"too_small":{let G=U.inclusive?">=":">",J=v(U.origin);if(J)return`Kéré ju: a ní láti jẹ́ pé ${U.origin} ${J.verb} ${G}${U.minimum} ${J.unit}`;return`Kéré ju: a ní láti jẹ́ ${G}${U.minimum}`}case"invalid_format":{let G=U;if(G.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${G.prefix}"`;if(G.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${G.suffix}"`;if(G.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${G.includes}"`;if(G.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${G.pattern}`;return`Aṣìṣe: ${D[G.format]??U.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${U.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${O(U.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${U.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${U.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function qQ(){return{localeError:Cj()}}var pY,SQ=Symbol("ZodOutput"),kQ=Symbol("ZodInput");class EQ{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let D=v[0];if(this._map.set($,D),D&&typeof D==="object"&&"id"in D)this._idmap.set(D.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let D={...this.get(v)??{}};delete D.id;let X={...D,...this._map.get($)};return Object.keys(X).length?X:void 0}return this._map.get($)}has($){return this._map.has($)}}function OU(){return new EQ}(pY=globalThis).__zod_globalRegistry??(pY.__zod_globalRegistry=OU());var A$=globalThis.__zod_globalRegistry;function TQ($,v){return new $({type:"string",...M(v)})}function RQ($,v){return new $({type:"string",coerce:!0,...M(v)})}function HU($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...M(v)})}function Hv($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...M(v)})}function FU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...M(v)})}function jU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...M(v)})}function AU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...M(v)})}function wU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...M(v)})}function Fv($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...M(v)})}function MU($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...M(v)})}function PU($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...M(v)})}function bU($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...M(v)})}function qU($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...M(v)})}function SU($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...M(v)})}function kU($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...M(v)})}function EU($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...M(v)})}function TU($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...M(v)})}function RU($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...M(v)})}function gQ($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...M(v)})}function gU($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...M(v)})}function uU($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...M(v)})}function CU($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...M(v)})}function xU($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...M(v)})}function fU($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...M(v)})}function _U($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...M(v)})}var uQ={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function CQ($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...M(v)})}function xQ($,v){return new $({type:"string",format:"date",check:"string_format",...M(v)})}function fQ($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...M(v)})}function _Q($,v){return new $({type:"string",format:"duration",check:"string_format",...M(v)})}function iQ($,v){return new $({type:"number",checks:[],...M(v)})}function yQ($,v){return new $({type:"number",coerce:!0,checks:[],...M(v)})}function nQ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...M(v)})}function lQ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...M(v)})}function hQ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...M(v)})}function mQ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...M(v)})}function cQ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...M(v)})}function rQ($,v){return new $({type:"boolean",...M(v)})}function dQ($,v){return new $({type:"boolean",coerce:!0,...M(v)})}function pQ($,v){return new $({type:"bigint",...M(v)})}function tQ($,v){return new $({type:"bigint",coerce:!0,...M(v)})}function oQ($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...M(v)})}function aQ($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...M(v)})}function eQ($,v){return new $({type:"symbol",...M(v)})}function sQ($,v){return new $({type:"undefined",...M(v)})}function $9($,v){return new $({type:"null",...M(v)})}function v9($){return new $({type:"any"})}function U9($){return new $({type:"unknown"})}function D9($,v){return new $({type:"never",...M(v)})}function X9($,v){return new $({type:"void",...M(v)})}function G9($,v){return new $({type:"date",...M(v)})}function J9($,v){return new $({type:"date",coerce:!0,...M(v)})}function Q9($,v){return new $({type:"nan",...M(v)})}function w4($,v){return new JU({check:"less_than",...M(v),value:$,inclusive:!1})}function e$($,v){return new JU({check:"less_than",...M(v),value:$,inclusive:!0})}function M4($,v){return new QU({check:"greater_than",...M(v),value:$,inclusive:!1})}function x$($,v){return new QU({check:"greater_than",...M(v),value:$,inclusive:!0})}function iU($){return M4(0,$)}function yU($){return w4(0,$)}function nU($){return e$(0,$)}function lU($){return x$(0,$)}function s4($,v){return new XJ({check:"multiple_of",...M(v),value:$})}function $6($,v){return new QJ({check:"max_size",...M(v),maximum:$})}function P4($,v){return new WJ({check:"min_size",...M(v),minimum:$})}function A6($,v){return new zJ({check:"size_equals",...M(v),size:$})}function w6($,v){return new YJ({check:"max_length",...M(v),maximum:$})}function _4($,v){return new IJ({check:"min_length",...M(v),minimum:$})}function M6($,v){return new VJ({check:"length_equals",...M(v),length:$})}function r6($,v){return new BJ({check:"string_format",format:"regex",...M(v),pattern:$})}function d6($){return new LJ({check:"string_format",format:"lowercase",...M($)})}function p6($){return new KJ({check:"string_format",format:"uppercase",...M($)})}function t6($,v){return new NJ({check:"string_format",format:"includes",...M(v),includes:$})}function o6($,v){return new ZJ({check:"string_format",format:"starts_with",...M(v),prefix:$})}function a6($,v){return new OJ({check:"string_format",format:"ends_with",...M(v),suffix:$})}function hU($,v,D){return new HJ({check:"property",property:$,schema:v,...M(D)})}function e6($,v){return new FJ({check:"mime_type",mime:$,...M(v)})}function Y4($){return new jJ({check:"overwrite",tx:$})}function s6($){return Y4((v)=>v.normalize($))}function $1(){return Y4(($)=>$.trim())}function v1(){return Y4(($)=>$.toLowerCase())}function U1(){return Y4(($)=>$.toUpperCase())}function D1(){return Y4(($)=>HG($))}function W9($,v,D){return new $({type:"array",element:v,...M(D)})}function fj($,v,D){return new $({type:"union",options:v,...M(D)})}function _j($,v,D){return new $({type:"union",options:v,inclusive:!1,...M(D)})}function ij($,v,D,X){return new $({type:"union",options:D,discriminator:v,...M(X)})}function yj($,v,D){return new $({type:"intersection",left:v,right:D})}function nj($,v,D,X){let U=D instanceof f;return new $({type:"tuple",items:v,rest:U?D:null,...M(U?X:D)})}function lj($,v,D,X){return new $({type:"record",keyType:v,valueType:D,...M(X)})}function hj($,v,D,X){return new $({type:"map",keyType:v,valueType:D,...M(X)})}function mj($,v,D){return new $({type:"set",valueType:v,...M(D)})}function cj($,v,D){let X=Array.isArray(v)?Object.fromEntries(v.map((U)=>[U,U])):v;return new $({type:"enum",entries:X,...M(D)})}function rj($,v,D){return new $({type:"enum",entries:v,...M(D)})}function dj($,v,D){return new $({type:"literal",values:Array.isArray(v)?v:[v],...M(D)})}function z9($,v){return new $({type:"file",...M(v)})}function pj($,v){return new $({type:"transform",transform:v})}function tj($,v){return new $({type:"optional",innerType:v})}function oj($,v){return new $({type:"nullable",innerType:v})}function aj($,v,D){return new $({type:"default",innerType:v,get defaultValue(){return typeof D==="function"?D():jG(D)}})}function ej($,v,D){return new $({type:"nonoptional",innerType:v,...M(D)})}function sj($,v){return new $({type:"success",innerType:v})}function $A($,v,D){return new $({type:"catch",innerType:v,catchValue:typeof D==="function"?D:()=>D})}function vA($,v,D){return new $({type:"pipe",in:v,out:D})}function UA($,v){return new $({type:"readonly",innerType:v})}function DA($,v,D){return new $({type:"template_literal",parts:v,...M(D)})}function XA($,v){return new $({type:"lazy",getter:v})}function GA($,v){return new $({type:"promise",innerType:v})}function Y9($,v,D){let X=M(D);return X.abort??(X.abort=!0),new $({type:"custom",check:"custom",fn:v,...X})}function I9($,v,D){return new $({type:"custom",check:"custom",fn:v,...M(D)})}function V9($,v){let D=tY((X)=>{return X.addIssue=(U)=>{if(typeof U==="string")X.issues.push(_6(U,X.value,D._zod.def));else{let G=U;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=X.value),G.inst??(G.inst=D),G.continue??(G.continue=!D._zod.def.abort),X.issues.push(_6(G))}},$(X.value,X)},v);return D}function tY($,v){let D=new G$({check:"custom",...M(v)});return D._zod.check=$,D}function B9($){let v=new G$({check:"describe"});return v._zod.onattach=[(D)=>{let X=A$.get(D)??{};A$.add(D,{...X,description:$})}],v._zod.check=()=>{},v}function L9($){let v=new G$({check:"meta"});return v._zod.onattach=[(D)=>{let X=A$.get(D)??{};A$.add(D,{...X,...$})}],v._zod.check=()=>{},v}function K9($,v){let D=M(v),X=D.truthy??["true","1","yes","on","y","enabled"],U=D.falsy??["false","0","no","off","n","disabled"];if(D.case!=="sensitive")X=X.map((B)=>typeof B==="string"?B.toLowerCase():B),U=U.map((B)=>typeof B==="string"?B.toLowerCase():B);let G=new Set(X),J=new Set(U),Q=$.Codec??Bv,W=$.Boolean??Iv,Y=new($.String??j6)({type:"string",error:D.error}),I=new W({type:"boolean",error:D.error}),V=new Q({type:"pipe",in:Y,out:I,transform:(B,L)=>{let N=B;if(D.case!=="sensitive")N=N.toLowerCase();if(G.has(N))return!0;else if(J.has(N))return!1;else return L.issues.push({code:"invalid_value",expected:"stringbool",values:[...G,...J],input:L.value,inst:V,continue:!1}),{}},reverseTransform:(B,L)=>{if(B===!0)return X[0]||"true";else return U[0]||"false"},error:D.error});return V}function X1($,v,D,X={}){let U=M(X),G={...M(X),check:"string_format",type:"string",format:v,fn:typeof D==="function"?D:(Q)=>D.test(Q),...U};if(D instanceof RegExp)G.pattern=D;return new $(G)}function v6($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??A$,target:v,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function e($,v,D={path:[],schemaPath:[]}){var X;let U=$._zod.def,G=v.seen.get($);if(G){if(G.count++,D.schemaPath.includes($))G.cycle=D.path;return G.schema}let J={schema:{},count:1,cycle:void 0,path:D.path};v.seen.set($,J);let Q=$._zod.toJSONSchema?.();if(Q)J.schema=Q;else{let Y={...D,schemaPath:[...D.schemaPath,$],path:D.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,J.schema,Y);else{let V=J.schema,B=v.processors[U.type];if(!B)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);B($,v,V,Y)}let I=$._zod.parent;if(I){if(!J.ref)J.ref=I;e(I,v,Y),v.seen.get(I).isParent=!0}}let W=v.metadataRegistry.get($);if(W)Object.assign(J.schema,W);if(v.io==="input"&&f$($))delete J.schema.examples,delete J.schema.default;if(v.io==="input"&&"_prefault"in J.schema)(X=J.schema).default??(X.default=J.schema._prefault);return delete J.schema._prefault,v.seen.get($).schema}function U6($,v){let D=$.seen.get(v);if(!D)throw Error("Unprocessed schema. This is a bug in Zod.");let X=new Map;for(let J of $.seen.entries()){let Q=$.metadataRegistry.get(J[0])?.id;if(Q){let W=X.get(Q);if(W&&W!==J[0])throw Error(`Duplicate schema id "${Q}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);X.set(Q,J[0])}}let U=(J)=>{let Q=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let I=$.external.registry.get(J[0])?.id,V=$.external.uri??((L)=>L);if(I)return{ref:V(I)};let B=J[1].defId??J[1].schema.id??`schema${$.counter++}`;return J[1].defId=B,{defId:B,ref:`${V("__shared")}#/${Q}/${B}`}}if(J[1]===D)return{ref:"#"};let z=`${"#"}/${Q}/`,Y=J[1].schema.id??`__schema${$.counter++}`;return{defId:Y,ref:z+Y}},G=(J)=>{if(J[1].schema.$ref)return;let Q=J[1],{ref:W,defId:z}=U(J);if(Q.def={...Q.schema},z)Q.defId=z;let Y=Q.schema;for(let I in Y)delete Y[I];Y.$ref=W};if($.cycles==="throw")for(let J of $.seen.entries()){let Q=J[1];if(Q.cycle)throw Error(`Cycle detected: #/${Q.cycle?.join("/")}/<root>
|
|
73
91
|
|
|
74
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let G of $.seen.entries()){let Q=G[1];if(v===G[0]){X(G);continue}if($.external){let z=$.external.registry.get(G[0])?.id;if(v!==G[0]&&z){X(G);continue}}if($.metadataRegistry.get(G[0])?.id){X(G);continue}if(Q.cycle){X(G);continue}if(Q.count>1){if($.reused==="ref"){X(G);continue}}}}function p4($,v){let D=$.seen.get(v);if(!D)throw Error("Unprocessed schema. This is a bug in Zod.");let I=(Q)=>{let J=$.seen.get(Q);if(J.ref===null)return;let z=J.def??J.schema,W={...z},Y=J.ref;if(J.ref=null,Y){I(Y);let V=$.seen.get(Y),B=V.schema;if(B.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))z.allOf=z.allOf??[],z.allOf.push(B);else Object.assign(z,B);if(Object.assign(z,W),Q._zod.parent===Y)for(let A in z){if(A==="$ref"||A==="allOf")continue;if(!(A in W))delete z[A]}if(B.$ref&&V.def)for(let A in z){if(A==="$ref"||A==="allOf")continue;if(A in V.def&&JSON.stringify(z[A])===JSON.stringify(V.def[A]))delete z[A]}}let L=Q._zod.parent;if(L&&L!==Y){I(L);let V=$.seen.get(L);if(V?.schema.$ref){if(z.$ref=V.schema.$ref,V.def)for(let B in z){if(B==="$ref"||B==="allOf")continue;if(B in V.def&&JSON.stringify(z[B])===JSON.stringify(V.def[B]))delete z[B]}}}$.override({zodSchema:Q,jsonSchema:z,path:J.path??[]})};for(let Q of[...$.seen.entries()].reverse())I(Q[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Q=$.external.registry.get(v)?.id;if(!Q)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(Q)}Object.assign(U,D.def??D.schema);let X=$.metadataRegistry.get(v)?.id;if(X!==void 0&&U.id===X)delete U.id;let G=$.external?.defs??{};for(let Q of $.seen.entries()){let J=Q[1];if(J.def&&J.defId){if(J.def.id===J.defId)delete J.def.id;G[J.defId]=J.def}}if($.external);else if(Object.keys(G).length>0)if($.target==="draft-2020-12")U.$defs=G;else U.definitions=G;try{let Q=JSON.parse(JSON.stringify(U));return Object.defineProperty(Q,"~standard",{value:{...v["~standard"],jsonSchema:{input:e6(v,"input",$.processors),output:e6(v,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function n$($,v){let D=v??{seen:new Set};if(D.seen.has($))return!1;D.seen.add($);let I=$._zod.def;if(I.type==="transform")return!0;if(I.type==="array")return n$(I.element,D);if(I.type==="set")return n$(I.valueType,D);if(I.type==="lazy")return n$(I.getter(),D);if(I.type==="promise"||I.type==="optional"||I.type==="nonoptional"||I.type==="nullable"||I.type==="readonly"||I.type==="default"||I.type==="prefault")return n$(I.innerType,D);if(I.type==="intersection")return n$(I.left,D)||n$(I.right,D);if(I.type==="record"||I.type==="map")return n$(I.keyType,D)||n$(I.valueType,D);if(I.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return n$(I.in,D)||n$(I.out,D)}if(I.type==="object"){for(let U in I.shape)if(n$(I.shape[U],D))return!0;return!1}if(I.type==="union"){for(let U of I.options)if(n$(U,D))return!0;return!1}if(I.type==="tuple"){for(let U of I.items)if(n$(U,D))return!0;if(I.rest&&n$(I.rest,D))return!0;return!1}return!1}var AQ=($,v={})=>(D)=>{let I=d4({...D,processors:v});return e($,I),t4(I,$),p4(I,$)},e6=($,v,D={})=>(I)=>{let{libraryOptions:U,target:X}=I??{},G=d4({...U??{},target:X,io:v,processors:D});return e($,G),t4(G,$),p4(G,$)};var yF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},HQ=($,v,D,I)=>{let U=D;U.type="string";let{minimum:X,maximum:G,format:Q,patterns:J,contentEncoding:z}=$._zod.bag;if(typeof X==="number")U.minLength=X;if(typeof G==="number")U.maxLength=G;if(Q){if(U.format=yF[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(z)U.contentEncoding=z;if(J&&J.size>0){let W=[...J];if(W.length===1)U.pattern=W[0].source;else if(W.length>1)U.allOf=[...W.map((Y)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:Y.source}))]}},FQ=($,v,D,I)=>{let U=D,{minimum:X,maximum:G,format:Q,multipleOf:J,exclusiveMaximum:z,exclusiveMinimum:W}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let Y=typeof W==="number"&&W>=(X??Number.NEGATIVE_INFINITY),L=typeof z==="number"&&z<=(G??Number.POSITIVE_INFINITY),V=v.target==="draft-04"||v.target==="openapi-3.0";if(Y)if(V)U.minimum=W,U.exclusiveMinimum=!0;else U.exclusiveMinimum=W;else if(typeof X==="number")U.minimum=X;if(L)if(V)U.maximum=z,U.exclusiveMaximum=!0;else U.exclusiveMaximum=z;else if(typeof G==="number")U.maximum=G;if(typeof J==="number")U.multipleOf=J},OQ=($,v,D,I)=>{D.type="boolean"},jQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},wQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},PQ=($,v,D,I)=>{if(v.target==="openapi-3.0")D.type="string",D.nullable=!0,D.enum=[null];else D.type="null"},MQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},bQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},qQ=($,v,D,I)=>{D.not={}},SQ=($,v,D,I)=>{},kQ=($,v,D,I)=>{},TQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},EQ=($,v,D,I)=>{let U=$._zod.def,X=f1(U.entries);if(X.every((G)=>typeof G==="number"))D.type="number";if(X.every((G)=>typeof G==="string"))D.type="string";D.enum=X},uQ=($,v,D,I)=>{let U=$._zod.def,X=[];for(let G of U.values)if(G===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof G==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else X.push(Number(G));else X.push(G);if(X.length===0);else if(X.length===1){let G=X[0];if(D.type=G===null?"null":typeof G,v.target==="draft-04"||v.target==="openapi-3.0")D.enum=[G];else D.const=G}else{if(X.every((G)=>typeof G==="number"))D.type="number";if(X.every((G)=>typeof G==="string"))D.type="string";if(X.every((G)=>typeof G==="boolean"))D.type="boolean";if(X.every((G)=>G===null))D.type="null";D.enum=X}},gQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},RQ=($,v,D,I)=>{let U=D,X=$._zod.pattern;if(!X)throw Error("Pattern not found in template literal");U.type="string",U.pattern=X.source},CQ=($,v,D,I)=>{let U=D,X={type:"string",format:"binary",contentEncoding:"binary"},{minimum:G,maximum:Q,mime:J}=$._zod.bag;if(G!==void 0)X.minLength=G;if(Q!==void 0)X.maxLength=Q;if(J)if(J.length===1)X.contentMediaType=J[0],Object.assign(U,X);else Object.assign(U,X),U.anyOf=J.map((z)=>({contentMediaType:z}));else Object.assign(U,X)},iQ=($,v,D,I)=>{D.type="boolean"},nQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},xQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},fQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},_Q=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},yQ=($,v,D,I)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},lQ=($,v,D,I)=>{let U=D,X=$._zod.def,{minimum:G,maximum:Q}=$._zod.bag;if(typeof G==="number")U.minItems=G;if(typeof Q==="number")U.maxItems=Q;U.type="array",U.items=e(X.element,v,{...I,path:[...I.path,"items"]})},hQ=($,v,D,I)=>{let U=D,X=$._zod.def;U.type="object",U.properties={};let G=X.shape;for(let z in G)U.properties[z]=e(G[z],v,{...I,path:[...I.path,"properties",z]});let Q=new Set(Object.keys(G)),J=new Set([...Q].filter((z)=>{let W=X.shape[z]._zod;if(v.io==="input")return W.optin===void 0;else return W.optout===void 0}));if(J.size>0)U.required=Array.from(J);if(X.catchall?._zod.def.type==="never")U.additionalProperties=!1;else if(!X.catchall){if(v.io==="output")U.additionalProperties=!1}else if(X.catchall)U.additionalProperties=e(X.catchall,v,{...I,path:[...I.path,"additionalProperties"]})},K0=($,v,D,I)=>{let U=$._zod.def,X=U.inclusive===!1,G=U.options.map((Q,J)=>e(Q,v,{...I,path:[...I.path,X?"oneOf":"anyOf",J]}));if(X)D.oneOf=G;else D.anyOf=G},rQ=($,v,D,I)=>{let U=$._zod.def,X=e(U.left,v,{...I,path:[...I.path,"allOf",0]}),G=e(U.right,v,{...I,path:[...I.path,"allOf",1]}),Q=(z)=>("allOf"in z)&&Object.keys(z).length===1,J=[...Q(X)?X.allOf:[X],...Q(G)?G.allOf:[G]];D.allOf=J},mQ=($,v,D,I)=>{let U=D,X=$._zod.def;U.type="array";let G=v.target==="draft-2020-12"?"prefixItems":"items",Q=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",J=X.items.map((L,V)=>e(L,v,{...I,path:[...I.path,G,V]})),z=X.rest?e(X.rest,v,{...I,path:[...I.path,Q,...v.target==="openapi-3.0"?[X.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(U.prefixItems=J,z)U.items=z}else if(v.target==="openapi-3.0"){if(U.items={anyOf:J},z)U.items.anyOf.push(z);if(U.minItems=J.length,!z)U.maxItems=J.length}else if(U.items=J,z)U.additionalItems=z;let{minimum:W,maximum:Y}=$._zod.bag;if(typeof W==="number")U.minItems=W;if(typeof Y==="number")U.maxItems=Y},cQ=($,v,D,I)=>{let U=D,X=$._zod.def;U.type="object";let G=X.keyType,J=G._zod.bag?.patterns;if(X.mode==="loose"&&J&&J.size>0){let W=e(X.valueType,v,{...I,path:[...I.path,"patternProperties","*"]});U.patternProperties={};for(let Y of J)U.patternProperties[Y.source]=W}else{if(v.target==="draft-07"||v.target==="draft-2020-12")U.propertyNames=e(X.keyType,v,{...I,path:[...I.path,"propertyNames"]});U.additionalProperties=e(X.valueType,v,{...I,path:[...I.path,"additionalProperties"]})}let z=G._zod.values;if(z){let W=[...z].filter((Y)=>typeof Y==="string"||typeof Y==="number");if(W.length>0)U.required=W}},dQ=($,v,D,I)=>{let U=$._zod.def,X=e(U.innerType,v,I),G=v.seen.get($);if(v.target==="openapi-3.0")G.ref=U.innerType,D.nullable=!0;else D.anyOf=[X,{type:"null"}]},tQ=($,v,D,I)=>{let U=$._zod.def;e(U.innerType,v,I);let X=v.seen.get($);X.ref=U.innerType},pQ=($,v,D,I)=>{let U=$._zod.def;e(U.innerType,v,I);let X=v.seen.get($);X.ref=U.innerType,D.default=JSON.parse(JSON.stringify(U.defaultValue))},oQ=($,v,D,I)=>{let U=$._zod.def;e(U.innerType,v,I);let X=v.seen.get($);if(X.ref=U.innerType,v.io==="input")D._prefault=JSON.parse(JSON.stringify(U.defaultValue))},aQ=($,v,D,I)=>{let U=$._zod.def;e(U.innerType,v,I);let X=v.seen.get($);X.ref=U.innerType;let G;try{G=U.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}D.default=G},eQ=($,v,D,I)=>{let U=$._zod.def,X=U.in._zod.traits.has("$ZodTransform"),G=v.io==="input"?X?U.out:U.in:U.out;e(G,v,I);let Q=v.seen.get($);Q.ref=G},sQ=($,v,D,I)=>{let U=$._zod.def;e(U.innerType,v,I);let X=v.seen.get($);X.ref=U.innerType,D.readOnly=!0},$J=($,v,D,I)=>{let U=$._zod.def;e(U.innerType,v,I);let X=v.seen.get($);X.ref=U.innerType},N0=($,v,D,I)=>{let U=$._zod.def;e(U.innerType,v,I);let X=v.seen.get($);X.ref=U.innerType},vJ=($,v,D,I)=>{let U=$._zod.innerType;e(U,v,I);let X=v.seen.get($);X.ref=U},B0={string:HQ,number:FQ,boolean:OQ,bigint:jQ,symbol:wQ,null:PQ,undefined:MQ,void:bQ,never:qQ,any:SQ,unknown:kQ,date:TQ,enum:EQ,literal:uQ,nan:gQ,template_literal:RQ,file:CQ,success:iQ,custom:nQ,function:xQ,transform:fQ,map:_Q,set:yQ,array:lQ,object:hQ,union:K0,intersection:rQ,tuple:mQ,record:cQ,nullable:dQ,nonoptional:tQ,default:pQ,prefault:oQ,catch:aQ,pipe:eQ,readonly:sQ,promise:$J,optional:N0,lazy:vJ};function Z0($,v){if("_idmap"in $){let I=$,U=d4({...v,processors:B0}),X={};for(let J of I._idmap.entries()){let[z,W]=J;e(W,U)}let G={},Q={registry:I,uri:v?.uri,defs:X};U.external=Q;for(let J of I._idmap.entries()){let[z,W]=J;t4(U,W),G[z]=p4(U,W)}if(Object.keys(X).length>0){let J=U.target==="draft-2020-12"?"$defs":"definitions";G.__shared={[J]:X}}return{schemas:G}}let D=d4({...v,processors:B0});return e($,D),t4(D,$),p4(D,$)}class UJ{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 v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=d4({processors:B0,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return e($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}t4(this.ctx,$);let D=p4(this.ctx,$),{"~standard":I,...U}=D;return U}}var PY={};var zv={};T4(zv,{xor:()=>K5,xid:()=>_Y,void:()=>Y5,uuidv7:()=>uY,uuidv6:()=>EY,uuidv4:()=>TY,uuid:()=>kY,url:()=>gY,unknown:()=>U$,union:()=>D$,undefined:()=>z5,ulid:()=>fY,uint64:()=>Q5,uint32:()=>I5,tuple:()=>uJ,transform:()=>r0,templateLiteral:()=>q5,symbol:()=>J5,superRefine:()=>X9,success:()=>w5,stringbool:()=>R5,stringFormat:()=>aY,string:()=>H,strictObject:()=>B5,set:()=>H5,refine:()=>I9,record:()=>s,readonly:()=>eJ,promise:()=>S5,preprocess:()=>jv,prefault:()=>rJ,pipe:()=>P0,partialRecord:()=>N5,optional:()=>G$,object:()=>q,number:()=>p,nullish:()=>j5,nullable:()=>Yv,null:()=>Bv,nonoptional:()=>mJ,never:()=>h0,nativeEnum:()=>F5,nanoid:()=>iY,nan:()=>P5,meta:()=>u5,map:()=>A5,mac:()=>hY,looseRecord:()=>Z5,looseObject:()=>w$,literal:()=>T,lazy:()=>v9,ksuid:()=>yY,keyof:()=>V5,jwt:()=>oY,json:()=>C5,ipv6:()=>rY,ipv4:()=>lY,invertCodec:()=>b5,intersection:()=>G1,int64:()=>G5,int32:()=>D5,int:()=>w0,instanceof:()=>g5,httpUrl:()=>RY,hostname:()=>eY,hex:()=>sY,hash:()=>$5,guid:()=>SY,function:()=>k5,float64:()=>U5,float32:()=>v5,file:()=>O5,exactOptional:()=>fJ,enum:()=>P$,emoji:()=>CY,email:()=>qY,e164:()=>pY,discriminatedUnion:()=>Av,describe:()=>E5,date:()=>L5,custom:()=>d0,cuid2:()=>xY,cuid:()=>nY,codec:()=>M5,cidrv6:()=>cY,cidrv4:()=>mY,check:()=>T5,catch:()=>tJ,boolean:()=>V$,bigint:()=>X5,base64url:()=>tY,base64:()=>dY,array:()=>l,any:()=>W5,_function:()=>k5,_default:()=>lJ,_ZodString:()=>M0,ZodXor:()=>SJ,ZodXID:()=>u0,ZodVoid:()=>bJ,ZodUnknown:()=>PJ,ZodUnion:()=>Zv,ZodUndefined:()=>OJ,ZodUUID:()=>j4,ZodURL:()=>Vv,ZodULID:()=>E0,ZodType:()=>x,ZodTuple:()=>EJ,ZodTransform:()=>nJ,ZodTemplateLiteral:()=>sJ,ZodSymbol:()=>FJ,ZodSuccess:()=>cJ,ZodStringFormat:()=>v$,ZodString:()=>v1,ZodSet:()=>RJ,ZodRecord:()=>s6,ZodReadonly:()=>aJ,ZodPromise:()=>U9,ZodPreprocess:()=>oJ,ZodPrefault:()=>hJ,ZodPipe:()=>Hv,ZodOptional:()=>m0,ZodObject:()=>Nv,ZodNumberFormat:()=>F6,ZodNumber:()=>D1,ZodNullable:()=>_J,ZodNull:()=>jJ,ZodNonOptional:()=>c0,ZodNever:()=>MJ,ZodNanoID:()=>S0,ZodNaN:()=>pJ,ZodMap:()=>gJ,ZodMAC:()=>HJ,ZodLiteral:()=>CJ,ZodLazy:()=>$9,ZodKSUID:()=>g0,ZodJWT:()=>y0,ZodIntersection:()=>TJ,ZodIPv6:()=>C0,ZodIPv4:()=>R0,ZodGUID:()=>Wv,ZodFunction:()=>D9,ZodFile:()=>iJ,ZodExactOptional:()=>xJ,ZodEnum:()=>$1,ZodEmoji:()=>q0,ZodEmail:()=>b0,ZodE164:()=>_0,ZodDiscriminatedUnion:()=>kJ,ZodDefault:()=>yJ,ZodDate:()=>Kv,ZodCustomStringFormat:()=>U1,ZodCustom:()=>Ov,ZodCodec:()=>Fv,ZodCatch:()=>dJ,ZodCUID2:()=>T0,ZodCUID:()=>k0,ZodCIDRv6:()=>n0,ZodCIDRv4:()=>i0,ZodBoolean:()=>I1,ZodBigIntFormat:()=>l0,ZodBigInt:()=>X1,ZodBase64URL:()=>f0,ZodBase64:()=>x0,ZodArray:()=>qJ,ZodAny:()=>wJ});var A0={};T4(A0,{uppercase:()=>y6,trim:()=>d6,toUpperCase:()=>p6,toLowerCase:()=>t6,startsWith:()=>h6,slugify:()=>o6,size:()=>Z6,regex:()=>f6,property:()=>V0,positive:()=>z0,overwrite:()=>J4,normalize:()=>c6,nonpositive:()=>Y0,nonnegative:()=>L0,negative:()=>W0,multipleOf:()=>m4,minSize:()=>O4,minLength:()=>u4,mime:()=>m6,maxSize:()=>c4,maxLength:()=>A6,lte:()=>e$,lt:()=>H4,lowercase:()=>_6,length:()=>H6,includes:()=>l6,gte:()=>i$,gt:()=>F4,endsWith:()=>r6});var o4={};T4(o4,{time:()=>XJ,duration:()=>GJ,datetime:()=>DJ,date:()=>IJ,ZodISOTime:()=>O0,ZodISODuration:()=>j0,ZodISODateTime:()=>H0,ZodISODate:()=>F0});var H0=K("ZodISODateTime",($,v)=>{nX.init($,v),v$.init($,v)});function DJ($){return n8(H0,$)}var F0=K("ZodISODate",($,v)=>{xX.init($,v),v$.init($,v)});function IJ($){return x8(F0,$)}var O0=K("ZodISOTime",($,v)=>{fX.init($,v),v$.init($,v)});function XJ($){return f8(O0,$)}var j0=K("ZodISODuration",($,v)=>{_X.init($,v),v$.init($,v)});function GJ($){return _8(j0,$)}var MY=($,v)=>{r1.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(D)=>c1($,D)},flatten:{value:(D)=>m1($,D)},addIssue:{value:(D)=>{$.issues.push(D),$.message=JSON.stringify($.issues,k6,2)}},addIssues:{value:(D)=>{$.issues.push(...D),$.message=JSON.stringify($.issues,k6,2)}},isEmpty:{get(){return $.issues.length===0}}})},hF=K("ZodError",MY),h$=K("ZodError",MY,{Parent:Error});var QJ=u6(h$),JJ=g6(h$),zJ=R6(h$),WJ=i6(h$),YJ=OU(h$),LJ=jU(h$),VJ=wU(h$),BJ=PU(h$),KJ=MU(h$),NJ=bU(h$),ZJ=qU(h$),AJ=SU(h$);var bY=new WeakMap;function Lv($,v,D){let I=Object.getPrototypeOf($),U=bY.get(I);if(!U)U=new Set,bY.set(I,U);if(U.has(v))return;U.add(v);for(let X in D){let G=D[X];Object.defineProperty(I,X,{configurable:!0,enumerable:!1,get(){let Q=G.bind(this);return Object.defineProperty(this,X,{configurable:!0,writable:!0,enumerable:!0,value:Q}),Q},set(Q){Object.defineProperty(this,X,{configurable:!0,writable:!0,enumerable:!0,value:Q})}})}}var x=K("ZodType",($,v)=>{return i.init($,v),Object.assign($["~standard"],{jsonSchema:{input:e6($,"input"),output:e6($,"output")}}),$.toJSONSchema=AQ($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.parse=(D,I)=>QJ($,D,I,{callee:$.parse}),$.safeParse=(D,I)=>zJ($,D,I),$.parseAsync=async(D,I)=>JJ($,D,I,{callee:$.parseAsync}),$.safeParseAsync=async(D,I)=>WJ($,D,I),$.spa=$.safeParseAsync,$.encode=(D,I)=>YJ($,D,I),$.decode=(D,I)=>LJ($,D,I),$.encodeAsync=async(D,I)=>VJ($,D,I),$.decodeAsync=async(D,I)=>BJ($,D,I),$.safeEncode=(D,I)=>KJ($,D,I),$.safeDecode=(D,I)=>NJ($,D,I),$.safeEncodeAsync=async(D,I)=>ZJ($,D,I),$.safeDecodeAsync=async(D,I)=>AJ($,D,I),Lv($,"ZodType",{check(...D){let I=this.def;return this.clone(w.mergeDefs(I,{checks:[...I.checks??[],...D.map((U)=>typeof U==="function"?{_zod:{check:U,def:{check:"custom"},onattach:[]}}:U)]}),{parent:!0})},with(...D){return this.check(...D)},clone(D,I){return R$(this,D,I)},brand(){return this},register(D,I){return D.add(this,I),this},refine(D,I){return this.check(I9(D,I))},superRefine(D,I){return this.check(X9(D,I))},overwrite(D){return this.check(J4(D))},optional(){return G$(this)},exactOptional(){return fJ(this)},nullable(){return Yv(this)},nullish(){return G$(Yv(this))},nonoptional(D){return mJ(this,D)},array(){return l(this)},or(D){return D$([this,D])},and(D){return G1(this,D)},transform(D){return P0(this,r0(D))},default(D){return lJ(this,D)},prefault(D){return rJ(this,D)},catch(D){return tJ(this,D)},pipe(D){return P0(this,D)},readonly(){return eJ(this)},describe(D){let I=this.clone();return j$.add(I,{description:D}),I},meta(...D){if(D.length===0)return j$.get(this);let I=this.clone();return j$.add(I,D[0]),I},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(D){return D(this)}}),Object.defineProperty($,"description",{get(){return j$.get($)?.description},configurable:!0}),$}),M0=K("_ZodString",($,v)=>{N6.init($,v),x.init($,v),$._zod.processJSONSchema=(I,U,X)=>HQ($,I,U,X);let D=$._zod.bag;$.format=D.format??null,$.minLength=D.minimum??null,$.maxLength=D.maximum??null,Lv($,"_ZodString",{regex(...I){return this.check(f6(...I))},includes(...I){return this.check(l6(...I))},startsWith(...I){return this.check(h6(...I))},endsWith(...I){return this.check(r6(...I))},min(...I){return this.check(u4(...I))},max(...I){return this.check(A6(...I))},length(...I){return this.check(H6(...I))},nonempty(...I){return this.check(u4(1,...I))},lowercase(I){return this.check(_6(I))},uppercase(I){return this.check(y6(I))},trim(){return this.check(d6())},normalize(...I){return this.check(c6(...I))},toLowerCase(){return this.check(t6())},toUpperCase(){return this.check(p6())},slugify(){return this.check(o6())}})}),v1=K("ZodString",($,v)=>{N6.init($,v),M0.init($,v),$.email=(D)=>$.check(hU(b0,D)),$.url=(D)=>$.check(Jv(Vv,D)),$.jwt=(D)=>$.check(J0(y0,D)),$.emoji=(D)=>$.check(tU(q0,D)),$.guid=(D)=>$.check(Qv(Wv,D)),$.uuid=(D)=>$.check(rU(j4,D)),$.uuidv4=(D)=>$.check(mU(j4,D)),$.uuidv6=(D)=>$.check(cU(j4,D)),$.uuidv7=(D)=>$.check(dU(j4,D)),$.nanoid=(D)=>$.check(pU(S0,D)),$.guid=(D)=>$.check(Qv(Wv,D)),$.cuid=(D)=>$.check(oU(k0,D)),$.cuid2=(D)=>$.check(aU(T0,D)),$.ulid=(D)=>$.check(eU(E0,D)),$.base64=(D)=>$.check(X0(x0,D)),$.base64url=(D)=>$.check(G0(f0,D)),$.xid=(D)=>$.check(sU(u0,D)),$.ksuid=(D)=>$.check($0(g0,D)),$.ipv4=(D)=>$.check(v0(R0,D)),$.ipv6=(D)=>$.check(U0(C0,D)),$.cidrv4=(D)=>$.check(D0(i0,D)),$.cidrv6=(D)=>$.check(I0(n0,D)),$.e164=(D)=>$.check(Q0(_0,D)),$.datetime=(D)=>$.check(DJ(D)),$.date=(D)=>$.check(IJ(D)),$.time=(D)=>$.check(XJ(D)),$.duration=(D)=>$.check(GJ(D))});function H($){return g8(v1,$)}var v$=K("ZodStringFormat",($,v)=>{$$.init($,v),M0.init($,v)}),b0=K("ZodEmail",($,v)=>{SX.init($,v),v$.init($,v)});function qY($){return hU(b0,$)}var Wv=K("ZodGUID",($,v)=>{bX.init($,v),v$.init($,v)});function SY($){return Qv(Wv,$)}var j4=K("ZodUUID",($,v)=>{qX.init($,v),v$.init($,v)});function kY($){return rU(j4,$)}function TY($){return mU(j4,$)}function EY($){return cU(j4,$)}function uY($){return dU(j4,$)}var Vv=K("ZodURL",($,v)=>{kX.init($,v),v$.init($,v)});function gY($){return Jv(Vv,$)}function RY($){return Jv(Vv,{protocol:a$.httpProtocol,hostname:a$.domain,...w.normalizeParams($)})}var q0=K("ZodEmoji",($,v)=>{TX.init($,v),v$.init($,v)});function CY($){return tU(q0,$)}var S0=K("ZodNanoID",($,v)=>{EX.init($,v),v$.init($,v)});function iY($){return pU(S0,$)}var k0=K("ZodCUID",($,v)=>{uX.init($,v),v$.init($,v)});function nY($){return oU(k0,$)}var T0=K("ZodCUID2",($,v)=>{gX.init($,v),v$.init($,v)});function xY($){return aU(T0,$)}var E0=K("ZodULID",($,v)=>{RX.init($,v),v$.init($,v)});function fY($){return eU(E0,$)}var u0=K("ZodXID",($,v)=>{CX.init($,v),v$.init($,v)});function _Y($){return sU(u0,$)}var g0=K("ZodKSUID",($,v)=>{iX.init($,v),v$.init($,v)});function yY($){return $0(g0,$)}var R0=K("ZodIPv4",($,v)=>{yX.init($,v),v$.init($,v)});function lY($){return v0(R0,$)}var HJ=K("ZodMAC",($,v)=>{hX.init($,v),v$.init($,v)});function hY($){return C8(HJ,$)}var C0=K("ZodIPv6",($,v)=>{lX.init($,v),v$.init($,v)});function rY($){return U0(C0,$)}var i0=K("ZodCIDRv4",($,v)=>{rX.init($,v),v$.init($,v)});function mY($){return D0(i0,$)}var n0=K("ZodCIDRv6",($,v)=>{mX.init($,v),v$.init($,v)});function cY($){return I0(n0,$)}var x0=K("ZodBase64",($,v)=>{dX.init($,v),v$.init($,v)});function dY($){return X0(x0,$)}var f0=K("ZodBase64URL",($,v)=>{tX.init($,v),v$.init($,v)});function tY($){return G0(f0,$)}var _0=K("ZodE164",($,v)=>{pX.init($,v),v$.init($,v)});function pY($){return Q0(_0,$)}var y0=K("ZodJWT",($,v)=>{oX.init($,v),v$.init($,v)});function oY($){return J0(y0,$)}var U1=K("ZodCustomStringFormat",($,v)=>{aX.init($,v),v$.init($,v)});function aY($,v,D={}){return a6(U1,$,v,D)}function eY($){return a6(U1,"hostname",a$.hostname,$)}function sY($){return a6(U1,"hex",a$.hex,$)}function $5($,v){let D=v?.enc??"hex",I=`${$}_${D}`,U=a$[I];if(!U)throw Error(`Unrecognized hash format: ${I}`);return a6(U1,I,U,v)}var D1=K("ZodNumber",($,v)=>{nU.init($,v),x.init($,v),$._zod.processJSONSchema=(I,U,X)=>FQ($,I,U,X),Lv($,"ZodNumber",{gt(I,U){return this.check(F4(I,U))},gte(I,U){return this.check(i$(I,U))},min(I,U){return this.check(i$(I,U))},lt(I,U){return this.check(H4(I,U))},lte(I,U){return this.check(e$(I,U))},max(I,U){return this.check(e$(I,U))},int(I){return this.check(w0(I))},safe(I){return this.check(w0(I))},positive(I){return this.check(F4(0,I))},nonnegative(I){return this.check(i$(0,I))},negative(I){return this.check(H4(0,I))},nonpositive(I){return this.check(e$(0,I))},multipleOf(I,U){return this.check(m4(I,U))},step(I,U){return this.check(m4(I,U))},finite(){return this}});let D=$._zod.bag;$.minValue=Math.max(D.minimum??Number.NEGATIVE_INFINITY,D.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(D.maximum??Number.POSITIVE_INFINITY,D.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(D.format??"").includes("int")||Number.isSafeInteger(D.multipleOf??0.5),$.isFinite=!0,$.format=D.format??null});function p($){return y8(D1,$)}var F6=K("ZodNumberFormat",($,v)=>{eX.init($,v),D1.init($,v)});function w0($){return h8(F6,$)}function v5($){return r8(F6,$)}function U5($){return m8(F6,$)}function D5($){return c8(F6,$)}function I5($){return d8(F6,$)}var I1=K("ZodBoolean",($,v)=>{s1.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>OQ($,D,I,U)});function V$($){return t8(I1,$)}var X1=K("ZodBigInt",($,v)=>{xU.init($,v),x.init($,v),$._zod.processJSONSchema=(I,U,X)=>jQ($,I,U,X),$.gte=(I,U)=>$.check(i$(I,U)),$.min=(I,U)=>$.check(i$(I,U)),$.gt=(I,U)=>$.check(F4(I,U)),$.gte=(I,U)=>$.check(i$(I,U)),$.min=(I,U)=>$.check(i$(I,U)),$.lt=(I,U)=>$.check(H4(I,U)),$.lte=(I,U)=>$.check(e$(I,U)),$.max=(I,U)=>$.check(e$(I,U)),$.positive=(I)=>$.check(F4(BigInt(0),I)),$.negative=(I)=>$.check(H4(BigInt(0),I)),$.nonpositive=(I)=>$.check(e$(BigInt(0),I)),$.nonnegative=(I)=>$.check(i$(BigInt(0),I)),$.multipleOf=(I,U)=>$.check(m4(I,U));let D=$._zod.bag;$.minValue=D.minimum??null,$.maxValue=D.maximum??null,$.format=D.format??null});function X5($){return o8(X1,$)}var l0=K("ZodBigIntFormat",($,v)=>{sX.init($,v),X1.init($,v)});function G5($){return e8(l0,$)}function Q5($){return s8(l0,$)}var FJ=K("ZodSymbol",($,v)=>{$G.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>wQ($,D,I,U)});function J5($){return $Q(FJ,$)}var OJ=K("ZodUndefined",($,v)=>{vG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>MQ($,D,I,U)});function z5($){return vQ(OJ,$)}var jJ=K("ZodNull",($,v)=>{UG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>PQ($,D,I,U)});function Bv($){return UQ(jJ,$)}var wJ=K("ZodAny",($,v)=>{DG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>SQ($,D,I,U)});function W5(){return DQ(wJ)}var PJ=K("ZodUnknown",($,v)=>{IG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>kQ($,D,I,U)});function U$(){return IQ(PJ)}var MJ=K("ZodNever",($,v)=>{XG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>qQ($,D,I,U)});function h0($){return XQ(MJ,$)}var bJ=K("ZodVoid",($,v)=>{GG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>bQ($,D,I,U)});function Y5($){return GQ(bJ,$)}var Kv=K("ZodDate",($,v)=>{QG.init($,v),x.init($,v),$._zod.processJSONSchema=(I,U,X)=>TQ($,I,U,X),$.min=(I,U)=>$.check(i$(I,U)),$.max=(I,U)=>$.check(e$(I,U));let D=$._zod.bag;$.minDate=D.minimum?new Date(D.minimum):null,$.maxDate=D.maximum?new Date(D.maximum):null});function L5($){return QQ(Kv,$)}var qJ=K("ZodArray",($,v)=>{JG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>lQ($,D,I,U),$.element=v.element,Lv($,"ZodArray",{min(D,I){return this.check(u4(D,I))},nonempty(D){return this.check(u4(1,D))},max(D,I){return this.check(A6(D,I))},length(D,I){return this.check(H6(D,I))},unwrap(){return this.element}})});function l($,v){return WQ(qJ,$,v)}function V5($){let v=$._zod.def.shape;return P$(Object.keys(v))}var Nv=K("ZodObject",($,v)=>{zG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>hQ($,D,I,U),w.defineLazy($,"shape",()=>{return v.shape}),Lv($,"ZodObject",{keyof(){return P$(Object.keys(this._zod.def.shape))},catchall(D){return this.clone({...this._zod.def,catchall:D})},passthrough(){return this.clone({...this._zod.def,catchall:U$()})},loose(){return this.clone({...this._zod.def,catchall:U$()})},strict(){return this.clone({...this._zod.def,catchall:h0()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(D){return w.extend(this,D)},safeExtend(D){return w.safeExtend(this,D)},merge(D){return w.merge(this,D)},pick(D){return w.pick(this,D)},omit(D){return w.omit(this,D)},partial(...D){return w.partial(m0,this,D[0])},required(...D){return w.required(c0,this,D[0])}})});function q($,v){let D={type:"object",shape:$??{},...w.normalizeParams(v)};return new Nv(D)}function B5($,v){return new Nv({type:"object",shape:$,catchall:h0(),...w.normalizeParams(v)})}function w$($,v){return new Nv({type:"object",shape:$,catchall:U$(),...w.normalizeParams(v)})}var Zv=K("ZodUnion",($,v)=>{$v.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>K0($,D,I,U),$.options=v.options});function D$($,v){return new Zv({type:"union",options:$,...w.normalizeParams(v)})}var SJ=K("ZodXor",($,v)=>{Zv.init($,v),WG.init($,v),$._zod.processJSONSchema=(D,I,U)=>K0($,D,I,U),$.options=v.options});function K5($,v){return new SJ({type:"union",options:$,inclusive:!1,...w.normalizeParams(v)})}var kJ=K("ZodDiscriminatedUnion",($,v)=>{Zv.init($,v),YG.init($,v)});function Av($,v,D){return new kJ({type:"union",options:v,discriminator:$,...w.normalizeParams(D)})}var TJ=K("ZodIntersection",($,v)=>{LG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>rQ($,D,I,U)});function G1($,v){return new TJ({type:"intersection",left:$,right:v})}var EJ=K("ZodTuple",($,v)=>{fU.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>mQ($,D,I,U),$.rest=(D)=>$.clone({...$._zod.def,rest:D})});function uJ($,v,D){let I=v instanceof i,U=I?D:v;return new EJ({type:"tuple",items:$,rest:I?v:null,...w.normalizeParams(U)})}var s6=K("ZodRecord",($,v)=>{VG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>cQ($,D,I,U),$.keyType=v.keyType,$.valueType=v.valueType});function s($,v,D){if(!v||!v._zod)return new s6({type:"record",keyType:H(),valueType:$,...w.normalizeParams(v)});return new s6({type:"record",keyType:$,valueType:v,...w.normalizeParams(D)})}function N5($,v,D){let I=R$($);return I._zod.values=void 0,new s6({type:"record",keyType:I,valueType:v,...w.normalizeParams(D)})}function Z5($,v,D){return new s6({type:"record",keyType:$,valueType:v,mode:"loose",...w.normalizeParams(D)})}var gJ=K("ZodMap",($,v)=>{BG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>_Q($,D,I,U),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...D)=>$.check(O4(...D)),$.nonempty=(D)=>$.check(O4(1,D)),$.max=(...D)=>$.check(c4(...D)),$.size=(...D)=>$.check(Z6(...D))});function A5($,v,D){return new gJ({type:"map",keyType:$,valueType:v,...w.normalizeParams(D)})}var RJ=K("ZodSet",($,v)=>{KG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>yQ($,D,I,U),$.min=(...D)=>$.check(O4(...D)),$.nonempty=(D)=>$.check(O4(1,D)),$.max=(...D)=>$.check(c4(...D)),$.size=(...D)=>$.check(Z6(...D))});function H5($,v){return new RJ({type:"set",valueType:$,...w.normalizeParams(v)})}var $1=K("ZodEnum",($,v)=>{NG.init($,v),x.init($,v),$._zod.processJSONSchema=(I,U,X)=>EQ($,I,U,X),$.enum=v.entries,$.options=Object.values(v.entries);let D=new Set(Object.keys(v.entries));$.extract=(I,U)=>{let X={};for(let G of I)if(D.has(G))X[G]=v.entries[G];else throw Error(`Key ${G} not found in enum`);return new $1({...v,checks:[],...w.normalizeParams(U),entries:X})},$.exclude=(I,U)=>{let X={...v.entries};for(let G of I)if(D.has(G))delete X[G];else throw Error(`Key ${G} not found in enum`);return new $1({...v,checks:[],...w.normalizeParams(U),entries:X})}});function P$($,v){let D=Array.isArray($)?Object.fromEntries($.map((I)=>[I,I])):$;return new $1({type:"enum",entries:D,...w.normalizeParams(v)})}function F5($,v){return new $1({type:"enum",entries:$,...w.normalizeParams(v)})}var CJ=K("ZodLiteral",($,v)=>{ZG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>uQ($,D,I,U),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function T($,v){return new CJ({type:"literal",values:Array.isArray($)?$:[$],...w.normalizeParams(v)})}var iJ=K("ZodFile",($,v)=>{AG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>CQ($,D,I,U),$.min=(D,I)=>$.check(O4(D,I)),$.max=(D,I)=>$.check(c4(D,I)),$.mime=(D,I)=>$.check(m6(Array.isArray(D)?D:[D],I))});function O5($){return YQ(iJ,$)}var nJ=K("ZodTransform",($,v)=>{HG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>fQ($,D,I,U),$._zod.parse=(D,I)=>{if(I.direction==="backward")throw new V6($.constructor.name);D.addIssue=(X)=>{if(typeof X==="string")D.issues.push(w.issue(X,D.value,v));else{let G=X;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=D.value),G.inst??(G.inst=$),D.issues.push(w.issue(G))}};let U=v.transform(D.value,D);if(U instanceof Promise)return U.then((X)=>{return D.value=X,D.fallback=!0,D});return D.value=U,D.fallback=!0,D}});function r0($){return new nJ({type:"transform",transform:$})}var m0=K("ZodOptional",($,v)=>{_U.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>N0($,D,I,U),$.unwrap=()=>$._zod.def.innerType});function G$($){return new m0({type:"optional",innerType:$})}var xJ=K("ZodExactOptional",($,v)=>{FG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>N0($,D,I,U),$.unwrap=()=>$._zod.def.innerType});function fJ($){return new xJ({type:"optional",innerType:$})}var _J=K("ZodNullable",($,v)=>{OG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>dQ($,D,I,U),$.unwrap=()=>$._zod.def.innerType});function Yv($){return new _J({type:"nullable",innerType:$})}function j5($){return G$(Yv($))}var yJ=K("ZodDefault",($,v)=>{jG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>pQ($,D,I,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function lJ($,v){return new yJ({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():w.shallowClone(v)}})}var hJ=K("ZodPrefault",($,v)=>{wG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>oQ($,D,I,U),$.unwrap=()=>$._zod.def.innerType});function rJ($,v){return new hJ({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():w.shallowClone(v)}})}var c0=K("ZodNonOptional",($,v)=>{PG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>tQ($,D,I,U),$.unwrap=()=>$._zod.def.innerType});function mJ($,v){return new c0({type:"nonoptional",innerType:$,...w.normalizeParams(v)})}var cJ=K("ZodSuccess",($,v)=>{MG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>iQ($,D,I,U),$.unwrap=()=>$._zod.def.innerType});function w5($){return new cJ({type:"success",innerType:$})}var dJ=K("ZodCatch",($,v)=>{bG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>aQ($,D,I,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function tJ($,v){return new dJ({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var pJ=K("ZodNaN",($,v)=>{qG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>gQ($,D,I,U)});function P5($){return zQ(pJ,$)}var Hv=K("ZodPipe",($,v)=>{yU.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>eQ($,D,I,U),$.in=v.in,$.out=v.out});function P0($,v){return new Hv({type:"pipe",in:$,out:v})}var Fv=K("ZodCodec",($,v)=>{Hv.init($,v),vv.init($,v)});function M5($,v,D){return new Fv({type:"pipe",in:$,out:v,transform:D.decode,reverseTransform:D.encode})}function b5($){let v=$._zod.def;return new Fv({type:"pipe",in:v.out,out:v.in,transform:v.reverseTransform,reverseTransform:v.transform})}var oJ=K("ZodPreprocess",($,v)=>{Hv.init($,v),SG.init($,v)}),aJ=K("ZodReadonly",($,v)=>{kG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>sQ($,D,I,U),$.unwrap=()=>$._zod.def.innerType});function eJ($){return new aJ({type:"readonly",innerType:$})}var sJ=K("ZodTemplateLiteral",($,v)=>{TG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>RQ($,D,I,U)});function q5($,v){return new sJ({type:"template_literal",parts:$,...w.normalizeParams(v)})}var $9=K("ZodLazy",($,v)=>{gG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>vJ($,D,I,U),$.unwrap=()=>$._zod.def.getter()});function v9($){return new $9({type:"lazy",getter:$})}var U9=K("ZodPromise",($,v)=>{uG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>$J($,D,I,U),$.unwrap=()=>$._zod.def.innerType});function S5($){return new U9({type:"promise",innerType:$})}var D9=K("ZodFunction",($,v)=>{EG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>xQ($,D,I,U)});function k5($){return new D9({type:"function",input:Array.isArray($?.input)?uJ($?.input):$?.input??l(U$()),output:$?.output??U$()})}var Ov=K("ZodCustom",($,v)=>{RG.init($,v),x.init($,v),$._zod.processJSONSchema=(D,I,U)=>nQ($,D,I,U)});function T5($){let v=new X$({check:"custom"});return v._zod.check=$,v}function d0($,v){return LQ(Ov,$??(()=>!0),v)}function I9($,v={}){return VQ(Ov,$,v)}function X9($,v){return BQ($,v)}var E5=KQ,u5=NQ;function g5($,v={}){let D=new Ov({type:"custom",check:"custom",fn:(I)=>I instanceof $,abort:!0,...w.normalizeParams(v)});return D._zod.bag.Class=$,D._zod.check=(I)=>{if(!(I.value instanceof $))I.issues.push({code:"invalid_type",expected:$.name,input:I.value,inst:D,path:[...D._zod.def.path??[]]})},D}var R5=(...$)=>ZQ({Codec:Fv,Boolean:I1,String:v1},...$);function C5($){let v=v9(()=>{return D$([H($),p(),V$(),Bv(),l(v),s(H(),v)])});return v}function jv($,v){return new oJ({type:"pipe",in:r0($),out:v})}var mF={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 cF($){L$({customError:$})}function dF(){return L$().customError}var G9;(function($){})(G9||(G9={}));var M={...zv,...A0,iso:o4},tF=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function pF($,v){let D=$.$schema;if(D==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(D==="http://json-schema.org/draft-07/schema#")return"draft-7";if(D==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function oF($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let D=$.slice(1).split("/").filter(Boolean);if(D.length===0)return v.rootSchema;let I=v.version==="draft-2020-12"?"$defs":"definitions";if(D[0]===I){let U=D[1];if(!U||!v.defs[U])throw Error(`Reference not found: ${$}`);return v.defs[U]}throw Error(`Reference not found: ${$}`)}function i5($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return M.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let U=$.$ref;if(v.refs.has(U))return v.refs.get(U);if(v.processing.has(U))return M.lazy(()=>{if(!v.refs.has(U))throw Error(`Circular reference not resolved: ${U}`);return v.refs.get(U)});v.processing.add(U);let X=oF(U,v),G=T$(X,v);return v.refs.set(U,G),v.processing.delete(U),G}if($.enum!==void 0){let U=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&U.length===1&&U[0]===null)return M.null();if(U.length===0)return M.never();if(U.length===1)return M.literal(U[0]);if(U.every((G)=>typeof G==="string"))return M.enum(U);let X=U.map((G)=>M.literal(G));if(X.length<2)return X[0];return M.union([X[0],X[1],...X.slice(2)])}if($.const!==void 0)return M.literal($.const);let D=$.type;if(Array.isArray(D)){let U=D.map((X)=>{let G={...$,type:X};return i5(G,v)});if(U.length===0)return M.never();if(U.length===1)return U[0];return M.union(U)}if(!D)return M.any();let I;switch(D){case"string":{let U=M.string();if($.format){let X=$.format;if(X==="email")U=U.check(M.email());else if(X==="uri"||X==="uri-reference")U=U.check(M.url());else if(X==="uuid"||X==="guid")U=U.check(M.uuid());else if(X==="date-time")U=U.check(M.iso.datetime());else if(X==="date")U=U.check(M.iso.date());else if(X==="time")U=U.check(M.iso.time());else if(X==="duration")U=U.check(M.iso.duration());else if(X==="ipv4")U=U.check(M.ipv4());else if(X==="ipv6")U=U.check(M.ipv6());else if(X==="mac")U=U.check(M.mac());else if(X==="cidr")U=U.check(M.cidrv4());else if(X==="cidr-v6")U=U.check(M.cidrv6());else if(X==="base64")U=U.check(M.base64());else if(X==="base64url")U=U.check(M.base64url());else if(X==="e164")U=U.check(M.e164());else if(X==="jwt")U=U.check(M.jwt());else if(X==="emoji")U=U.check(M.emoji());else if(X==="nanoid")U=U.check(M.nanoid());else if(X==="cuid")U=U.check(M.cuid());else if(X==="cuid2")U=U.check(M.cuid2());else if(X==="ulid")U=U.check(M.ulid());else if(X==="xid")U=U.check(M.xid());else if(X==="ksuid")U=U.check(M.ksuid())}if(typeof $.minLength==="number")U=U.min($.minLength);if(typeof $.maxLength==="number")U=U.max($.maxLength);if($.pattern)U=U.regex(new RegExp($.pattern));I=U;break}case"number":case"integer":{let U=D==="integer"?M.number().int():M.number();if(typeof $.minimum==="number")U=U.min($.minimum);if(typeof $.maximum==="number")U=U.max($.maximum);if(typeof $.exclusiveMinimum==="number")U=U.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")U=U.gt($.minimum);if(typeof $.exclusiveMaximum==="number")U=U.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")U=U.lt($.maximum);if(typeof $.multipleOf==="number")U=U.multipleOf($.multipleOf);I=U;break}case"boolean":{I=M.boolean();break}case"null":{I=M.null();break}case"object":{let U={},X=$.properties||{},G=new Set($.required||[]);for(let[J,z]of Object.entries(X)){let W=T$(z,v);U[J]=G.has(J)?W:W.optional()}if($.propertyNames){let J=T$($.propertyNames,v),z=$.additionalProperties&&typeof $.additionalProperties==="object"?T$($.additionalProperties,v):M.any();if(Object.keys(U).length===0){I=M.record(J,z);break}let W=M.object(U).passthrough(),Y=M.looseRecord(J,z);I=M.intersection(W,Y);break}if($.patternProperties){let J=$.patternProperties,z=Object.keys(J),W=[];for(let L of z){let V=T$(J[L],v),B=M.string().regex(new RegExp(L));W.push(M.looseRecord(B,V))}let Y=[];if(Object.keys(U).length>0)Y.push(M.object(U).passthrough());if(Y.push(...W),Y.length===0)I=M.object({}).passthrough();else if(Y.length===1)I=Y[0];else{let L=M.intersection(Y[0],Y[1]);for(let V=2;V<Y.length;V++)L=M.intersection(L,Y[V]);I=L}break}let Q=M.object(U);if($.additionalProperties===!1)I=Q.strict();else if(typeof $.additionalProperties==="object")I=Q.catchall(T$($.additionalProperties,v));else I=Q.passthrough();break}case"array":{let{prefixItems:U,items:X}=$;if(U&&Array.isArray(U)){let G=U.map((J)=>T$(J,v)),Q=X&&typeof X==="object"&&!Array.isArray(X)?T$(X,v):void 0;if(Q)I=M.tuple(G).rest(Q);else I=M.tuple(G);if(typeof $.minItems==="number")I=I.check(M.minLength($.minItems));if(typeof $.maxItems==="number")I=I.check(M.maxLength($.maxItems))}else if(Array.isArray(X)){let G=X.map((J)=>T$(J,v)),Q=$.additionalItems&&typeof $.additionalItems==="object"?T$($.additionalItems,v):void 0;if(Q)I=M.tuple(G).rest(Q);else I=M.tuple(G);if(typeof $.minItems==="number")I=I.check(M.minLength($.minItems));if(typeof $.maxItems==="number")I=I.check(M.maxLength($.maxItems))}else if(X!==void 0){let G=T$(X,v),Q=M.array(G);if(typeof $.minItems==="number")Q=Q.min($.minItems);if(typeof $.maxItems==="number")Q=Q.max($.maxItems);I=Q}else I=M.array(M.any());break}default:throw Error(`Unsupported type: ${D}`)}return I}function T$($,v){if(typeof $==="boolean")return $?M.any():M.never();let D=i5($,v),I=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let Q=$.anyOf.map((z)=>T$(z,v)),J=M.union(Q);D=I?M.intersection(D,J):J}if($.oneOf&&Array.isArray($.oneOf)){let Q=$.oneOf.map((z)=>T$(z,v)),J=M.xor(Q);D=I?M.intersection(D,J):J}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)D=I?D:M.any();else{let Q=I?D:T$($.allOf[0],v),J=I?0:1;for(let z=J;z<$.allOf.length;z++)Q=M.intersection(Q,T$($.allOf[z],v));D=Q}if($.nullable===!0&&v.version==="openapi-3.0")D=M.nullable(D);if($.readOnly===!0)D=M.readonly(D);if($.default!==void 0)D=D.default($.default);let U={},X=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let Q of X)if(Q in $)U[Q]=$[Q];let G=["contentEncoding","contentMediaType","contentSchema"];for(let Q of G)if(Q in $)U[Q]=$[Q];for(let Q of Object.keys($))if(!tF.has(Q))U[Q]=$[Q];if(Object.keys(U).length>0)v.registry.add(D,U);if($.description)D=D.describe($.description);return D}function n5($,v){if(typeof $==="boolean")return $?M.any():M.never();let D;try{D=JSON.parse(JSON.stringify($))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let I=pF(D,v?.defaultTarget),U=D.$defs||D.definitions||{},X={version:I,defs:U,refs:new Map,processing:new Set,rootSchema:D,registry:v?.registry??j$};return T$(D,X)}var Q9={};T4(Q9,{string:()=>aF,number:()=>eF,date:()=>vO,boolean:()=>sF,bigint:()=>$O});function aF($){return R8(v1,$)}function eF($){return l8(D1,$)}function sF($){return p8(I1,$)}function $O($){return a8(X1,$)}function vO($){return JQ(Kv,$)}L$(Uv());var J9="2025-11-25",x5="2025-03-26",J1=[J9,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],a4="io.modelcontextprotocol/related-task",p0="2.0",Z$=d0(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),f5=D$([H(),p().int()]),_5=H(),nC=w$({ttl:p().optional(),pollInterval:p().optional()}),UO=q({ttl:p().optional()}),DO=q({taskId:H()}),z9=w$({progressToken:f5.optional(),[a4]:DO.optional()}),s$=q({_meta:z9.optional()}),wv=s$.extend({task:UO.optional()}),y5=($)=>wv.safeParse($).success,M$=q({method:H(),params:s$.loose().optional()}),U4=q({_meta:z9.optional()}),D4=q({method:H(),params:U4.loose().optional()}),b$=w$({_meta:z9.optional()}),o0=D$([H(),p().int()]),l5=q({jsonrpc:T(p0),id:o0,...M$.shape}).strict(),e4=($)=>l5.safeParse($).success,h5=q({jsonrpc:T(p0),...D4.shape}).strict(),r5=($)=>h5.safeParse($).success,W9=q({jsonrpc:T(p0),id:o0,result:b$}).strict(),R4=($)=>W9.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 Y9=q({jsonrpc:T(p0),id:o0.optional(),error:q({code:p().int(),message:H(),data:U$().optional()})}).strict();var z1=($)=>Y9.safeParse($).success;var Pv=D$([l5,h5,W9,Y9]),xC=D$([W9,Y9]),a0=b$.strict(),IO=U4.extend({requestId:o0.optional(),reason:H().optional()}),e0=D4.extend({method:T("notifications/cancelled"),params:IO}),XO=q({src:H(),mimeType:H().optional(),sizes:l(H()).optional(),theme:P$(["light","dark"]).optional()}),Mv=q({icons:l(XO).optional()}),Q1=q({name:H(),title:H().optional()}),m5=Q1.extend({...Q1.shape,...Mv.shape,version:H(),websiteUrl:H().optional(),description:H().optional()}),GO=G1(q({applyDefaults:V$().optional()}),s(H(),U$())),QO=jv(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},G1(q({form:GO.optional(),url:Z$.optional()}),s(H(),U$()).optional())),JO=w$({list:Z$.optional(),cancel:Z$.optional(),requests:w$({sampling:w$({createMessage:Z$.optional()}).optional(),elicitation:w$({create:Z$.optional()}).optional()}).optional()}),zO=w$({list:Z$.optional(),cancel:Z$.optional(),requests:w$({tools:w$({call:Z$.optional()}).optional()}).optional()}),WO=q({experimental:s(H(),Z$).optional(),sampling:q({context:Z$.optional(),tools:Z$.optional()}).optional(),elicitation:QO.optional(),roots:q({listChanged:V$().optional()}).optional(),tasks:JO.optional(),extensions:s(H(),Z$).optional()}),YO=s$.extend({protocolVersion:H(),capabilities:WO,clientInfo:m5}),s0=M$.extend({method:T("initialize"),params:YO}),L9=($)=>s0.safeParse($).success,LO=q({experimental:s(H(),Z$).optional(),logging:Z$.optional(),completions:Z$.optional(),prompts:q({listChanged:V$().optional()}).optional(),resources:q({subscribe:V$().optional(),listChanged:V$().optional()}).optional(),tools:q({listChanged:V$().optional()}).optional(),tasks:zO.optional(),extensions:s(H(),Z$).optional()}),VO=b$.extend({protocolVersion:H(),capabilities:LO,serverInfo:m5,instructions:H().optional()}),V9=D4.extend({method:T("notifications/initialized"),params:U4.optional()});var $D=M$.extend({method:T("ping"),params:s$.optional()}),BO=q({progress:p(),total:G$(p()),message:G$(H())}),KO=q({...U4.shape,...BO.shape,progressToken:f5}),vD=D4.extend({method:T("notifications/progress"),params:KO}),NO=s$.extend({cursor:_5.optional()}),bv=M$.extend({params:NO.optional()}),qv=b$.extend({nextCursor:_5.optional()}),ZO=P$(["working","input_required","completed","failed","cancelled"]),Sv=q({taskId:H(),status:ZO,ttl:D$([p(),Bv()]),createdAt:H(),lastUpdatedAt:H(),pollInterval:G$(p()),statusMessage:G$(H())}),W1=b$.extend({task:Sv}),AO=U4.merge(Sv),kv=D4.extend({method:T("notifications/tasks/status"),params:AO}),UD=M$.extend({method:T("tasks/get"),params:s$.extend({taskId:H()})}),DD=b$.merge(Sv),ID=M$.extend({method:T("tasks/result"),params:s$.extend({taskId:H()})}),fC=b$.loose(),XD=bv.extend({method:T("tasks/list")}),GD=qv.extend({tasks:l(Sv)}),QD=M$.extend({method:T("tasks/cancel"),params:s$.extend({taskId:H()})}),c5=b$.merge(Sv),d5=q({uri:H(),mimeType:G$(H()),_meta:s(H(),U$()).optional()}),t5=d5.extend({text:H()}),B9=H().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),p5=d5.extend({blob:B9}),Tv=P$(["user","assistant"]),Y1=q({audience:l(Tv).optional(),priority:p().min(0).max(1).optional(),lastModified:o4.datetime({offset:!0}).optional()}),o5=q({...Q1.shape,...Mv.shape,uri:H(),description:G$(H()),mimeType:G$(H()),size:G$(p()),annotations:Y1.optional(),_meta:G$(w$({}))}),HO=q({...Q1.shape,...Mv.shape,uriTemplate:H(),description:G$(H()),mimeType:G$(H()),annotations:Y1.optional(),_meta:G$(w$({}))}),Ev=bv.extend({method:T("resources/list")}),FO=qv.extend({resources:l(o5)}),OO=bv.extend({method:T("resources/templates/list")}),jO=qv.extend({resourceTemplates:l(HO)}),K9=s$.extend({uri:H()}),wO=K9,uv=M$.extend({method:T("resources/read"),params:wO}),PO=b$.extend({contents:l(D$([t5,p5]))}),MO=D4.extend({method:T("notifications/resources/list_changed"),params:U4.optional()}),bO=K9,qO=M$.extend({method:T("resources/subscribe"),params:bO}),SO=K9,kO=M$.extend({method:T("resources/unsubscribe"),params:SO}),TO=U4.extend({uri:H()}),EO=D4.extend({method:T("notifications/resources/updated"),params:TO}),uO=q({name:H(),description:G$(H()),required:G$(V$())}),gO=q({...Q1.shape,...Mv.shape,description:G$(H()),arguments:G$(l(uO)),_meta:G$(w$({}))}),gv=bv.extend({method:T("prompts/list")}),RO=qv.extend({prompts:l(gO)}),CO=s$.extend({name:H(),arguments:s(H(),H()).optional()}),Rv=M$.extend({method:T("prompts/get"),params:CO}),N9=q({type:T("text"),text:H(),annotations:Y1.optional(),_meta:s(H(),U$()).optional()}),Z9=q({type:T("image"),data:B9,mimeType:H(),annotations:Y1.optional(),_meta:s(H(),U$()).optional()}),A9=q({type:T("audio"),data:B9,mimeType:H(),annotations:Y1.optional(),_meta:s(H(),U$()).optional()}),iO=q({type:T("tool_use"),name:H(),id:H(),input:s(H(),U$()),_meta:s(H(),U$()).optional()}),nO=q({type:T("resource"),resource:D$([t5,p5]),annotations:Y1.optional(),_meta:s(H(),U$()).optional()}),xO=o5.extend({type:T("resource_link")}),H9=D$([N9,Z9,A9,xO,nO]),fO=q({role:Tv,content:H9}),_O=b$.extend({description:H().optional(),messages:l(fO)}),yO=D4.extend({method:T("notifications/prompts/list_changed"),params:U4.optional()}),lO=q({title:H().optional(),readOnlyHint:V$().optional(),destructiveHint:V$().optional(),idempotentHint:V$().optional(),openWorldHint:V$().optional()}),hO=q({taskSupport:P$(["required","optional","forbidden"]).optional()}),a5=q({...Q1.shape,...Mv.shape,description:H().optional(),inputSchema:q({type:T("object"),properties:s(H(),Z$).optional(),required:l(H()).optional()}).catchall(U$()),outputSchema:q({type:T("object"),properties:s(H(),Z$).optional(),required:l(H()).optional()}).catchall(U$()).optional(),annotations:lO.optional(),execution:hO.optional(),_meta:s(H(),U$()).optional()}),Cv=bv.extend({method:T("tools/list")}),rO=qv.extend({tools:l(a5)}),JD=b$.extend({content:l(H9).default([]),structuredContent:s(H(),U$()).optional(),isError:V$().optional()}),_C=JD.or(b$.extend({toolResult:U$()})),mO=wv.extend({name:H(),arguments:s(H(),U$()).optional()}),O6=M$.extend({method:T("tools/call"),params:mO}),cO=D4.extend({method:T("notifications/tools/list_changed"),params:U4.optional()}),yC=q({autoRefresh:V$().default(!0),debounceMs:p().int().nonnegative().default(300)}),iv=P$(["debug","info","notice","warning","error","critical","alert","emergency"]),dO=s$.extend({level:iv}),F9=M$.extend({method:T("logging/setLevel"),params:dO}),tO=U4.extend({level:iv,logger:H().optional(),data:U$()}),pO=D4.extend({method:T("notifications/message"),params:tO}),oO=q({name:H().optional()}),aO=q({hints:l(oO).optional(),costPriority:p().min(0).max(1).optional(),speedPriority:p().min(0).max(1).optional(),intelligencePriority:p().min(0).max(1).optional()}),eO=q({mode:P$(["auto","required","none"]).optional()}),sO=q({type:T("tool_result"),toolUseId:H().describe("The unique identifier for the corresponding tool call."),content:l(H9).default([]),structuredContent:q({}).loose().optional(),isError:V$().optional(),_meta:s(H(),U$()).optional()}),$3=Av("type",[N9,Z9,A9]),t0=Av("type",[N9,Z9,A9,iO,sO]),v3=q({role:Tv,content:D$([t0,l(t0)]),_meta:s(H(),U$()).optional()}),U3=wv.extend({messages:l(v3),modelPreferences:aO.optional(),systemPrompt:H().optional(),includeContext:P$(["none","thisServer","allServers"]).optional(),temperature:p().optional(),maxTokens:p().int(),stopSequences:l(H()).optional(),metadata:Z$.optional(),tools:l(a5).optional(),toolChoice:eO.optional()}),D3=M$.extend({method:T("sampling/createMessage"),params:U3}),nv=b$.extend({model:H(),stopReason:G$(P$(["endTurn","stopSequence","maxTokens"]).or(H())),role:Tv,content:$3}),O9=b$.extend({model:H(),stopReason:G$(P$(["endTurn","stopSequence","maxTokens","toolUse"]).or(H())),role:Tv,content:D$([t0,l(t0)])}),I3=q({type:T("boolean"),title:H().optional(),description:H().optional(),default:V$().optional()}),X3=q({type:T("string"),title:H().optional(),description:H().optional(),minLength:p().optional(),maxLength:p().optional(),format:P$(["email","uri","date","date-time"]).optional(),default:H().optional()}),G3=q({type:P$(["number","integer"]),title:H().optional(),description:H().optional(),minimum:p().optional(),maximum:p().optional(),default:p().optional()}),Q3=q({type:T("string"),title:H().optional(),description:H().optional(),enum:l(H()),default:H().optional()}),J3=q({type:T("string"),title:H().optional(),description:H().optional(),oneOf:l(q({const:H(),title:H()})),default:H().optional()}),z3=q({type:T("string"),title:H().optional(),description:H().optional(),enum:l(H()),enumNames:l(H()).optional(),default:H().optional()}),W3=D$([Q3,J3]),Y3=q({type:T("array"),title:H().optional(),description:H().optional(),minItems:p().optional(),maxItems:p().optional(),items:q({type:T("string"),enum:l(H())}),default:l(H()).optional()}),L3=q({type:T("array"),title:H().optional(),description:H().optional(),minItems:p().optional(),maxItems:p().optional(),items:q({anyOf:l(q({const:H(),title:H()}))}),default:l(H()).optional()}),V3=D$([Y3,L3]),B3=D$([z3,W3,V3]),K3=D$([B3,I3,X3,G3]),N3=wv.extend({mode:T("form").optional(),message:H(),requestedSchema:q({type:T("object"),properties:s(H(),K3),required:l(H()).optional()})}),Z3=wv.extend({mode:T("url"),message:H(),elicitationId:H(),url:H().url()}),A3=D$([N3,Z3]),H3=M$.extend({method:T("elicitation/create"),params:A3}),F3=U4.extend({elicitationId:H()}),O3=D4.extend({method:T("notifications/elicitation/complete"),params:F3}),L1=b$.extend({action:P$(["accept","decline","cancel"]),content:jv(($)=>$===null?void 0:$,s(H(),D$([H(),p(),V$(),l(H())])).optional())}),j3=q({type:T("ref/resource"),uri:H()});var w3=q({type:T("ref/prompt"),name:H()}),P3=s$.extend({ref:D$([w3,j3]),argument:q({name:H(),value:H()}),context:q({arguments:s(H(),H()).optional()}).optional()}),M3=M$.extend({method:T("completion/complete"),params:P3});var b3=b$.extend({completion:w$({values:l(H()).max(100),total:G$(p().int()),hasMore:G$(V$())})}),q3=q({uri:H().startsWith("file://"),name:H().optional(),_meta:s(H(),U$()).optional()}),S3=M$.extend({method:T("roots/list"),params:s$.optional()}),j9=b$.extend({roots:l(q3)}),k3=D4.extend({method:T("notifications/roots/list_changed"),params:U4.optional()}),lC=D$([$D,s0,M3,F9,Rv,gv,Ev,OO,uv,qO,kO,O6,Cv,UD,ID,XD,QD]),hC=D$([e0,vD,V9,k3,kv]),rC=D$([a0,nv,O9,L1,j9,DD,GD,W1]),mC=D$([$D,D3,H3,S3,UD,ID,XD,QD]),cC=D$([e0,vD,pO,EO,MO,cO,yO,kv,O3]),dC=D$([a0,VO,b3,_O,RO,FO,jO,PO,JD,rO,DD,GD,W1]);class R extends Error{constructor($,v,D){super(`MCP error ${$}: ${v}`);this.code=$,this.data=D,this.name="McpError"}static fromError($,v,D){if($===C.UrlElicitationRequired&&D){let I=D;if(I.elicitations)return new e5(I.elicitations,v)}return new R($,v,D)}}class e5 extends R{constructor($,v=`URL elicitation${$.length>1?"s":""} required`){super(C.UrlElicitationRequired,v,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}class w9{constructor($={}){this._started=!1,this._hasHandledRequest=!1,this._streamMapping=new Map,this._requestToStreamMapping=new Map,this._requestResponseMap=new Map,this._initialized=!1,this._enableJsonResponse=!1,this._standaloneSseStreamId="_GET_stream",this.sessionIdGenerator=$.sessionIdGenerator,this._enableJsonResponse=$.enableJsonResponse??!1,this._eventStore=$.eventStore,this._onsessioninitialized=$.onsessioninitialized,this._onsessionclosed=$.onsessionclosed,this._allowedHosts=$.allowedHosts,this._allowedOrigins=$.allowedOrigins,this._enableDnsRebindingProtection=$.enableDnsRebindingProtection??!1,this._retryInterval=$.retryInterval}async start(){if(this._started)throw Error("Transport already started");this._started=!0}createJsonErrorResponse($,v,D,I){let U={code:v,message:D};if(I?.data!==void 0)U.data=I.data;return new Response(JSON.stringify({jsonrpc:"2.0",error:U,id:null}),{status:$,headers:{"Content-Type":"application/json",...I?.headers}})}validateRequestHeaders($){if(!this._enableDnsRebindingProtection)return;if(this._allowedHosts&&this._allowedHosts.length>0){let v=$.headers.get("host");if(!v||!this._allowedHosts.includes(v)){let D=`Invalid Host header: ${v}`;return this.onerror?.(Error(D)),this.createJsonErrorResponse(403,-32000,D)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let v=$.headers.get("origin");if(v&&!this._allowedOrigins.includes(v)){let D=`Invalid Origin header: ${v}`;return this.onerror?.(Error(D)),this.createJsonErrorResponse(403,-32000,D)}}return}async handleRequest($,v){if(!this.sessionIdGenerator&&this._hasHandledRequest)throw Error("Stateless transport cannot be reused across requests. Create a new transport per request.");this._hasHandledRequest=!0;let D=this.validateRequestHeaders($);if(D)return D;switch($.method){case"POST":return this.handlePostRequest($,v);case"GET":return this.handleGetRequest($);case"DELETE":return this.handleDeleteRequest($);default:return this.handleUnsupportedRequest()}}async writePrimingEvent($,v,D,I){if(!this._eventStore)return;if(I<"2025-11-25")return;let U=await this._eventStore.storeEvent(D,{}),X=`id: ${U}
|
|
92
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let Q=J[1];if(v===J[0]){G(J);continue}if($.external){let z=$.external.registry.get(J[0])?.id;if(v!==J[0]&&z){G(J);continue}}if($.metadataRegistry.get(J[0])?.id){G(J);continue}if(Q.cycle){G(J);continue}if(Q.count>1){if($.reused==="ref"){G(J);continue}}}}function D6($,v){let D=$.seen.get(v);if(!D)throw Error("Unprocessed schema. This is a bug in Zod.");let X=(Q)=>{let W=$.seen.get(Q);if(W.ref===null)return;let z=W.def??W.schema,Y={...z},I=W.ref;if(W.ref=null,I){X(I);let B=$.seen.get(I),L=B.schema;if(L.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))z.allOf=z.allOf??[],z.allOf.push(L);else Object.assign(z,L);if(Object.assign(z,Y),Q._zod.parent===I)for(let Z in z){if(Z==="$ref"||Z==="allOf")continue;if(!(Z in Y))delete z[Z]}if(L.$ref&&B.def)for(let Z in z){if(Z==="$ref"||Z==="allOf")continue;if(Z in B.def&&JSON.stringify(z[Z])===JSON.stringify(B.def[Z]))delete z[Z]}}let V=Q._zod.parent;if(V&&V!==I){X(V);let B=$.seen.get(V);if(B?.schema.$ref){if(z.$ref=B.schema.$ref,B.def)for(let L in z){if(L==="$ref"||L==="allOf")continue;if(L in B.def&&JSON.stringify(z[L])===JSON.stringify(B.def[L]))delete z[L]}}}$.override({zodSchema:Q,jsonSchema:z,path:W.path??[]})};for(let Q of[...$.seen.entries()].reverse())X(Q[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Q=$.external.registry.get(v)?.id;if(!Q)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(Q)}Object.assign(U,D.def??D.schema);let G=$.metadataRegistry.get(v)?.id;if(G!==void 0&&U.id===G)delete U.id;let J=$.external?.defs??{};for(let Q of $.seen.entries()){let W=Q[1];if(W.def&&W.defId){if(W.def.id===W.defId)delete W.def.id;J[W.defId]=W.def}}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")U.$defs=J;else U.definitions=J;try{let Q=JSON.parse(JSON.stringify(U));return Object.defineProperty(Q,"~standard",{value:{...v["~standard"],jsonSchema:{input:G1(v,"input",$.processors),output:G1(v,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function f$($,v){let D=v??{seen:new Set};if(D.seen.has($))return!1;D.seen.add($);let X=$._zod.def;if(X.type==="transform")return!0;if(X.type==="array")return f$(X.element,D);if(X.type==="set")return f$(X.valueType,D);if(X.type==="lazy")return f$(X.getter(),D);if(X.type==="promise"||X.type==="optional"||X.type==="nonoptional"||X.type==="nullable"||X.type==="readonly"||X.type==="default"||X.type==="prefault")return f$(X.innerType,D);if(X.type==="intersection")return f$(X.left,D)||f$(X.right,D);if(X.type==="record"||X.type==="map")return f$(X.keyType,D)||f$(X.valueType,D);if(X.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return f$(X.in,D)||f$(X.out,D)}if(X.type==="object"){for(let U in X.shape)if(f$(X.shape[U],D))return!0;return!1}if(X.type==="union"){for(let U of X.options)if(f$(U,D))return!0;return!1}if(X.type==="tuple"){for(let U of X.items)if(f$(U,D))return!0;if(X.rest&&f$(X.rest,D))return!0;return!1}return!1}var N9=($,v={})=>(D)=>{let X=v6({...D,processors:v});return e($,X),U6(X,$),D6(X,$)},G1=($,v,D={})=>(X)=>{let{libraryOptions:U,target:G}=X??{},J=v6({...U??{},target:G,io:v,processors:D});return e($,J),U6(J,$),D6(J,$)};var JA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Z9=($,v,D,X)=>{let U=D;U.type="string";let{minimum:G,maximum:J,format:Q,patterns:W,contentEncoding:z}=$._zod.bag;if(typeof G==="number")U.minLength=G;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=JA[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(z)U.contentEncoding=z;if(W&&W.size>0){let Y=[...W];if(Y.length===1)U.pattern=Y[0].source;else if(Y.length>1)U.allOf=[...Y.map((I)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:I.source}))]}},O9=($,v,D,X)=>{let U=D,{minimum:G,maximum:J,format:Q,multipleOf:W,exclusiveMaximum:z,exclusiveMinimum:Y}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let I=typeof Y==="number"&&Y>=(G??Number.NEGATIVE_INFINITY),V=typeof z==="number"&&z<=(J??Number.POSITIVE_INFINITY),B=v.target==="draft-04"||v.target==="openapi-3.0";if(I)if(B)U.minimum=Y,U.exclusiveMinimum=!0;else U.exclusiveMinimum=Y;else if(typeof G==="number")U.minimum=G;if(V)if(B)U.maximum=z,U.exclusiveMaximum=!0;else U.exclusiveMaximum=z;else if(typeof J==="number")U.maximum=J;if(typeof W==="number")U.multipleOf=W},H9=($,v,D,X)=>{D.type="boolean"},F9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},j9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},A9=($,v,D,X)=>{if(v.target==="openapi-3.0")D.type="string",D.nullable=!0,D.enum=[null];else D.type="null"},w9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},M9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},P9=($,v,D,X)=>{D.not={}},b9=($,v,D,X)=>{},q9=($,v,D,X)=>{},S9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},k9=($,v,D,X)=>{let U=$._zod.def,G=a1(U.entries);if(G.every((J)=>typeof J==="number"))D.type="number";if(G.every((J)=>typeof J==="string"))D.type="string";D.enum=G},E9=($,v,D,X)=>{let U=$._zod.def,G=[];for(let J of U.values)if(J===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof J==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else G.push(Number(J));else G.push(J);if(G.length===0);else if(G.length===1){let J=G[0];if(D.type=J===null?"null":typeof J,v.target==="draft-04"||v.target==="openapi-3.0")D.enum=[J];else D.const=J}else{if(G.every((J)=>typeof J==="number"))D.type="number";if(G.every((J)=>typeof J==="string"))D.type="string";if(G.every((J)=>typeof J==="boolean"))D.type="boolean";if(G.every((J)=>J===null))D.type="null";D.enum=G}},T9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},R9=($,v,D,X)=>{let U=D,G=$._zod.pattern;if(!G)throw Error("Pattern not found in template literal");U.type="string",U.pattern=G.source},g9=($,v,D,X)=>{let U=D,G={type:"string",format:"binary",contentEncoding:"binary"},{minimum:J,maximum:Q,mime:W}=$._zod.bag;if(J!==void 0)G.minLength=J;if(Q!==void 0)G.maxLength=Q;if(W)if(W.length===1)G.contentMediaType=W[0],Object.assign(U,G);else Object.assign(U,G),U.anyOf=W.map((z)=>({contentMediaType:z}));else Object.assign(U,G)},u9=($,v,D,X)=>{D.type="boolean"},C9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},x9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},f9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},_9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},i9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},y9=($,v,D,X)=>{let U=D,G=$._zod.def,{minimum:J,maximum:Q}=$._zod.bag;if(typeof J==="number")U.minItems=J;if(typeof Q==="number")U.maxItems=Q;U.type="array",U.items=e(G.element,v,{...X,path:[...X.path,"items"]})},n9=($,v,D,X)=>{let U=D,G=$._zod.def;U.type="object",U.properties={};let J=G.shape;for(let z in J)U.properties[z]=e(J[z],v,{...X,path:[...X.path,"properties",z]});let Q=new Set(Object.keys(J)),W=new Set([...Q].filter((z)=>{let Y=G.shape[z]._zod;if(v.io==="input")return Y.optin===void 0;else return Y.optout===void 0}));if(W.size>0)U.required=Array.from(W);if(G.catchall?._zod.def.type==="never")U.additionalProperties=!1;else if(!G.catchall){if(v.io==="output")U.additionalProperties=!1}else if(G.catchall)U.additionalProperties=e(G.catchall,v,{...X,path:[...X.path,"additionalProperties"]})},cU=($,v,D,X)=>{let U=$._zod.def,G=U.inclusive===!1,J=U.options.map((Q,W)=>e(Q,v,{...X,path:[...X.path,G?"oneOf":"anyOf",W]}));if(G)D.oneOf=J;else D.anyOf=J},l9=($,v,D,X)=>{let U=$._zod.def,G=e(U.left,v,{...X,path:[...X.path,"allOf",0]}),J=e(U.right,v,{...X,path:[...X.path,"allOf",1]}),Q=(z)=>("allOf"in z)&&Object.keys(z).length===1,W=[...Q(G)?G.allOf:[G],...Q(J)?J.allOf:[J]];D.allOf=W},h9=($,v,D,X)=>{let U=D,G=$._zod.def;U.type="array";let J=v.target==="draft-2020-12"?"prefixItems":"items",Q=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",W=G.items.map((V,B)=>e(V,v,{...X,path:[...X.path,J,B]})),z=G.rest?e(G.rest,v,{...X,path:[...X.path,Q,...v.target==="openapi-3.0"?[G.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(U.prefixItems=W,z)U.items=z}else if(v.target==="openapi-3.0"){if(U.items={anyOf:W},z)U.items.anyOf.push(z);if(U.minItems=W.length,!z)U.maxItems=W.length}else if(U.items=W,z)U.additionalItems=z;let{minimum:Y,maximum:I}=$._zod.bag;if(typeof Y==="number")U.minItems=Y;if(typeof I==="number")U.maxItems=I},m9=($,v,D,X)=>{let U=D,G=$._zod.def;U.type="object";let J=G.keyType,W=J._zod.bag?.patterns;if(G.mode==="loose"&&W&&W.size>0){let Y=e(G.valueType,v,{...X,path:[...X.path,"patternProperties","*"]});U.patternProperties={};for(let I of W)U.patternProperties[I.source]=Y}else{if(v.target==="draft-07"||v.target==="draft-2020-12")U.propertyNames=e(G.keyType,v,{...X,path:[...X.path,"propertyNames"]});U.additionalProperties=e(G.valueType,v,{...X,path:[...X.path,"additionalProperties"]})}let z=J._zod.values;if(z){let Y=[...z].filter((I)=>typeof I==="string"||typeof I==="number");if(Y.length>0)U.required=Y}},c9=($,v,D,X)=>{let U=$._zod.def,G=e(U.innerType,v,X),J=v.seen.get($);if(v.target==="openapi-3.0")J.ref=U.innerType,D.nullable=!0;else D.anyOf=[G,{type:"null"}]},r9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},d9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType,D.default=JSON.parse(JSON.stringify(U.defaultValue))},p9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);if(G.ref=U.innerType,v.io==="input")D._prefault=JSON.parse(JSON.stringify(U.defaultValue))},t9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType;let J;try{J=U.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}D.default=J},o9=($,v,D,X)=>{let U=$._zod.def,G=U.in._zod.traits.has("$ZodTransform"),J=v.io==="input"?G?U.out:U.in:U.out;e(J,v,X);let Q=v.seen.get($);Q.ref=J},a9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType,D.readOnly=!0},e9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},rU=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},s9=($,v,D,X)=>{let U=$._zod.innerType;e(U,v,X);let G=v.seen.get($);G.ref=U},mU={string:Z9,number:O9,boolean:H9,bigint:F9,symbol:j9,null:A9,undefined:w9,void:M9,never:P9,any:b9,unknown:q9,date:S9,enum:k9,literal:E9,nan:T9,template_literal:R9,file:g9,success:u9,custom:C9,function:x9,transform:f9,map:_9,set:i9,array:y9,object:n9,union:cU,intersection:l9,tuple:h9,record:m9,nullable:c9,nonoptional:r9,default:d9,prefault:p9,catch:t9,pipe:o9,readonly:a9,promise:e9,optional:rU,lazy:s9};function dU($,v){if("_idmap"in $){let X=$,U=v6({...v,processors:mU}),G={};for(let W of X._idmap.entries()){let[z,Y]=W;e(Y,U)}let J={},Q={registry:X,uri:v?.uri,defs:G};U.external=Q;for(let W of X._idmap.entries()){let[z,Y]=W;U6(U,Y),J[z]=D6(U,Y)}if(Object.keys(G).length>0){let W=U.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[W]:G}}return{schemas:J}}let D=v6({...v,processors:mU});return e($,D),U6(D,$),D6(D,$)}class $W{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 v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=v6({processors:mU,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return e($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}U6(this.ctx,$);let D=D6(this.ctx,$),{"~standard":X,...U}=D;return U}}var oY={};var jv={};R4(jv,{xor:()=>nI,xid:()=>VI,void:()=>fI,uuidv7:()=>XI,uuidv6:()=>DI,uuidv4:()=>UI,uuid:()=>vI,url:()=>GI,unknown:()=>D$,union:()=>X$,undefined:()=>CI,ulid:()=>II,uint64:()=>gI,uint32:()=>EI,tuple:()=>EW,transform:()=>FD,templateLiteral:()=>sI,symbol:()=>uI,superRefine:()=>Dz,success:()=>tI,stringbool:()=>JV,stringFormat:()=>wI,string:()=>H,strictObject:()=>yI,set:()=>cI,refine:()=>Uz,record:()=>s,readonly:()=>oW,promise:()=>$V,preprocess:()=>uv,prefault:()=>lW,pipe:()=>$D,partialRecord:()=>lI,optional:()=>J$,object:()=>q,number:()=>t,nullish:()=>pI,nullable:()=>wv,null:()=>bv,nonoptional:()=>hW,never:()=>HD,nativeEnum:()=>rI,nanoid:()=>WI,nan:()=>oI,meta:()=>XV,map:()=>mI,mac:()=>KI,looseRecord:()=>hI,looseObject:()=>w$,literal:()=>E,lazy:()=>sW,ksuid:()=>BI,keyof:()=>iI,jwt:()=>AI,json:()=>QV,ipv6:()=>NI,ipv4:()=>LI,invertCodec:()=>eI,intersection:()=>B1,int64:()=>RI,int32:()=>kI,int:()=>sU,instanceof:()=>GV,httpUrl:()=>JI,hostname:()=>MI,hex:()=>PI,hash:()=>bI,guid:()=>$I,function:()=>vV,float64:()=>SI,float32:()=>qI,file:()=>dI,exactOptional:()=>fW,enum:()=>M$,emoji:()=>QI,email:()=>sY,e164:()=>jI,discriminatedUnion:()=>Ev,describe:()=>DV,date:()=>_I,custom:()=>wD,cuid2:()=>YI,cuid:()=>zI,codec:()=>aI,cidrv6:()=>OI,cidrv4:()=>ZI,check:()=>UV,catch:()=>rW,boolean:()=>B$,bigint:()=>TI,base64url:()=>FI,base64:()=>HI,array:()=>m,any:()=>xI,_function:()=>vV,_default:()=>yW,_ZodString:()=>vD,ZodXor:()=>bW,ZodXID:()=>WD,ZodVoid:()=>MW,ZodUnknown:()=>AW,ZodUnion:()=>kv,ZodUndefined:()=>HW,ZodUUID:()=>b4,ZodURL:()=>Pv,ZodULID:()=>QD,ZodType:()=>y,ZodTuple:()=>kW,ZodTransform:()=>CW,ZodTemplateLiteral:()=>aW,ZodSymbol:()=>OW,ZodSuccess:()=>mW,ZodStringFormat:()=>U$,ZodString:()=>W1,ZodSet:()=>RW,ZodRecord:()=>J1,ZodReadonly:()=>tW,ZodPromise:()=>$z,ZodPreprocess:()=>pW,ZodPrefault:()=>nW,ZodPipe:()=>Tv,ZodOptional:()=>jD,ZodObject:()=>Sv,ZodNumberFormat:()=>P6,ZodNumber:()=>Y1,ZodNullable:()=>_W,ZodNull:()=>FW,ZodNonOptional:()=>AD,ZodNever:()=>wW,ZodNanoID:()=>XD,ZodNaN:()=>dW,ZodMap:()=>TW,ZodMAC:()=>ZW,ZodLiteral:()=>gW,ZodLazy:()=>eW,ZodKSUID:()=>zD,ZodJWT:()=>ZD,ZodIntersection:()=>SW,ZodIPv6:()=>ID,ZodIPv4:()=>YD,ZodGUID:()=>Av,ZodFunction:()=>vz,ZodFile:()=>uW,ZodExactOptional:()=>xW,ZodEnum:()=>Q1,ZodEmoji:()=>DD,ZodEmail:()=>UD,ZodE164:()=>ND,ZodDiscriminatedUnion:()=>qW,ZodDefault:()=>iW,ZodDate:()=>qv,ZodCustomStringFormat:()=>z1,ZodCustom:()=>gv,ZodCodec:()=>Rv,ZodCatch:()=>cW,ZodCUID2:()=>JD,ZodCUID:()=>GD,ZodCIDRv6:()=>BD,ZodCIDRv4:()=>VD,ZodBoolean:()=>I1,ZodBigIntFormat:()=>OD,ZodBigInt:()=>V1,ZodBase64URL:()=>KD,ZodBase64:()=>LD,ZodArray:()=>PW,ZodAny:()=>jW});var pU={};R4(pU,{uppercase:()=>p6,trim:()=>$1,toUpperCase:()=>U1,toLowerCase:()=>v1,startsWith:()=>o6,slugify:()=>D1,size:()=>A6,regex:()=>r6,property:()=>hU,positive:()=>iU,overwrite:()=>Y4,normalize:()=>s6,nonpositive:()=>nU,nonnegative:()=>lU,negative:()=>yU,multipleOf:()=>s4,minSize:()=>P4,minLength:()=>_4,mime:()=>e6,maxSize:()=>$6,maxLength:()=>w6,lte:()=>e$,lt:()=>w4,lowercase:()=>d6,length:()=>M6,includes:()=>t6,gte:()=>x$,gt:()=>M4,endsWith:()=>a6});var X6={};R4(X6,{time:()=>DW,duration:()=>XW,datetime:()=>vW,date:()=>UW,ZodISOTime:()=>aU,ZodISODuration:()=>eU,ZodISODateTime:()=>tU,ZodISODate:()=>oU});var tU=K("ZodISODateTime",($,v)=>{CJ.init($,v),U$.init($,v)});function vW($){return CQ(tU,$)}var oU=K("ZodISODate",($,v)=>{xJ.init($,v),U$.init($,v)});function UW($){return xQ(oU,$)}var aU=K("ZodISOTime",($,v)=>{fJ.init($,v),U$.init($,v)});function DW($){return fQ(aU,$)}var eU=K("ZodISODuration",($,v)=>{_J.init($,v),U$.init($,v)});function XW($){return _Q(eU,$)}var aY=($,v)=>{Uv.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(D)=>Xv($,D)},flatten:{value:(D)=>Dv($,D)},addIssue:{value:(D)=>{$.issues.push(D),$.message=JSON.stringify($.issues,x6,2)}},addIssues:{value:(D)=>{$.issues.push(...D),$.message=JSON.stringify($.issues,x6,2)}},isEmpty:{get(){return $.issues.length===0}}})},WA=K("ZodError",aY),h$=K("ZodError",aY,{Parent:Error});var GW=i6(h$),JW=y6(h$),QW=n6(h$),WW=h6(h$),zW=a0(h$),YW=e0(h$),IW=s0(h$),VW=$U(h$),BW=vU(h$),LW=UU(h$),KW=DU(h$),NW=XU(h$);var eY=new WeakMap;function Mv($,v,D){let X=Object.getPrototypeOf($),U=eY.get(X);if(!U)U=new Set,eY.set(X,U);if(U.has(v))return;U.add(v);for(let G in D){let J=D[G];Object.defineProperty(X,G,{configurable:!0,enumerable:!1,get(){let Q=J.bind(this);return Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:Q}),Q},set(Q){Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:Q})}})}}var y=K("ZodType",($,v)=>{return f.init($,v),Object.assign($["~standard"],{jsonSchema:{input:G1($,"input"),output:G1($,"output")}}),$.toJSONSchema=N9($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.parse=(D,X)=>GW($,D,X,{callee:$.parse}),$.safeParse=(D,X)=>QW($,D,X),$.parseAsync=async(D,X)=>JW($,D,X,{callee:$.parseAsync}),$.safeParseAsync=async(D,X)=>WW($,D,X),$.spa=$.safeParseAsync,$.encode=(D,X)=>zW($,D,X),$.decode=(D,X)=>YW($,D,X),$.encodeAsync=async(D,X)=>IW($,D,X),$.decodeAsync=async(D,X)=>VW($,D,X),$.safeEncode=(D,X)=>BW($,D,X),$.safeDecode=(D,X)=>LW($,D,X),$.safeEncodeAsync=async(D,X)=>KW($,D,X),$.safeDecodeAsync=async(D,X)=>NW($,D,X),Mv($,"ZodType",{check(...D){let X=this.def;return this.clone(w.mergeDefs(X,{checks:[...X.checks??[],...D.map((U)=>typeof U==="function"?{_zod:{check:U,def:{check:"custom"},onattach:[]}}:U)]}),{parent:!0})},with(...D){return this.check(...D)},clone(D,X){return u$(this,D,X)},brand(){return this},register(D,X){return D.add(this,X),this},refine(D,X){return this.check(Uz(D,X))},superRefine(D,X){return this.check(Dz(D,X))},overwrite(D){return this.check(Y4(D))},optional(){return J$(this)},exactOptional(){return fW(this)},nullable(){return wv(this)},nullish(){return J$(wv(this))},nonoptional(D){return hW(this,D)},array(){return m(this)},or(D){return X$([this,D])},and(D){return B1(this,D)},transform(D){return $D(this,FD(D))},default(D){return yW(this,D)},prefault(D){return lW(this,D)},catch(D){return rW(this,D)},pipe(D){return $D(this,D)},readonly(){return oW(this)},describe(D){let X=this.clone();return A$.add(X,{description:D}),X},meta(...D){if(D.length===0)return A$.get(this);let X=this.clone();return A$.add(X,D[0]),X},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(D){return D(this)}}),Object.defineProperty($,"description",{get(){return A$.get($)?.description},configurable:!0}),$}),vD=K("_ZodString",($,v)=>{j6.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>Z9($,X,U,G);let D=$._zod.bag;$.format=D.format??null,$.minLength=D.minimum??null,$.maxLength=D.maximum??null,Mv($,"_ZodString",{regex(...X){return this.check(r6(...X))},includes(...X){return this.check(t6(...X))},startsWith(...X){return this.check(o6(...X))},endsWith(...X){return this.check(a6(...X))},min(...X){return this.check(_4(...X))},max(...X){return this.check(w6(...X))},length(...X){return this.check(M6(...X))},nonempty(...X){return this.check(_4(1,...X))},lowercase(X){return this.check(d6(X))},uppercase(X){return this.check(p6(X))},trim(){return this.check($1())},normalize(...X){return this.check(s6(...X))},toLowerCase(){return this.check(v1())},toUpperCase(){return this.check(U1())},slugify(){return this.check(D1())}})}),W1=K("ZodString",($,v)=>{j6.init($,v),vD.init($,v),$.email=(D)=>$.check(HU(UD,D)),$.url=(D)=>$.check(Fv(Pv,D)),$.jwt=(D)=>$.check(_U(ZD,D)),$.emoji=(D)=>$.check(MU(DD,D)),$.guid=(D)=>$.check(Hv(Av,D)),$.uuid=(D)=>$.check(FU(b4,D)),$.uuidv4=(D)=>$.check(jU(b4,D)),$.uuidv6=(D)=>$.check(AU(b4,D)),$.uuidv7=(D)=>$.check(wU(b4,D)),$.nanoid=(D)=>$.check(PU(XD,D)),$.guid=(D)=>$.check(Hv(Av,D)),$.cuid=(D)=>$.check(bU(GD,D)),$.cuid2=(D)=>$.check(qU(JD,D)),$.ulid=(D)=>$.check(SU(QD,D)),$.base64=(D)=>$.check(CU(LD,D)),$.base64url=(D)=>$.check(xU(KD,D)),$.xid=(D)=>$.check(kU(WD,D)),$.ksuid=(D)=>$.check(EU(zD,D)),$.ipv4=(D)=>$.check(TU(YD,D)),$.ipv6=(D)=>$.check(RU(ID,D)),$.cidrv4=(D)=>$.check(gU(VD,D)),$.cidrv6=(D)=>$.check(uU(BD,D)),$.e164=(D)=>$.check(fU(ND,D)),$.datetime=(D)=>$.check(vW(D)),$.date=(D)=>$.check(UW(D)),$.time=(D)=>$.check(DW(D)),$.duration=(D)=>$.check(XW(D))});function H($){return TQ(W1,$)}var U$=K("ZodStringFormat",($,v)=>{v$.init($,v),vD.init($,v)}),UD=K("ZodEmail",($,v)=>{bJ.init($,v),U$.init($,v)});function sY($){return HU(UD,$)}var Av=K("ZodGUID",($,v)=>{MJ.init($,v),U$.init($,v)});function $I($){return Hv(Av,$)}var b4=K("ZodUUID",($,v)=>{PJ.init($,v),U$.init($,v)});function vI($){return FU(b4,$)}function UI($){return jU(b4,$)}function DI($){return AU(b4,$)}function XI($){return wU(b4,$)}var Pv=K("ZodURL",($,v)=>{qJ.init($,v),U$.init($,v)});function GI($){return Fv(Pv,$)}function JI($){return Fv(Pv,{protocol:a$.httpProtocol,hostname:a$.domain,...w.normalizeParams($)})}var DD=K("ZodEmoji",($,v)=>{SJ.init($,v),U$.init($,v)});function QI($){return MU(DD,$)}var XD=K("ZodNanoID",($,v)=>{kJ.init($,v),U$.init($,v)});function WI($){return PU(XD,$)}var GD=K("ZodCUID",($,v)=>{EJ.init($,v),U$.init($,v)});function zI($){return bU(GD,$)}var JD=K("ZodCUID2",($,v)=>{TJ.init($,v),U$.init($,v)});function YI($){return qU(JD,$)}var QD=K("ZodULID",($,v)=>{RJ.init($,v),U$.init($,v)});function II($){return SU(QD,$)}var WD=K("ZodXID",($,v)=>{gJ.init($,v),U$.init($,v)});function VI($){return kU(WD,$)}var zD=K("ZodKSUID",($,v)=>{uJ.init($,v),U$.init($,v)});function BI($){return EU(zD,$)}var YD=K("ZodIPv4",($,v)=>{iJ.init($,v),U$.init($,v)});function LI($){return TU(YD,$)}var ZW=K("ZodMAC",($,v)=>{nJ.init($,v),U$.init($,v)});function KI($){return gQ(ZW,$)}var ID=K("ZodIPv6",($,v)=>{yJ.init($,v),U$.init($,v)});function NI($){return RU(ID,$)}var VD=K("ZodCIDRv4",($,v)=>{lJ.init($,v),U$.init($,v)});function ZI($){return gU(VD,$)}var BD=K("ZodCIDRv6",($,v)=>{hJ.init($,v),U$.init($,v)});function OI($){return uU(BD,$)}var LD=K("ZodBase64",($,v)=>{cJ.init($,v),U$.init($,v)});function HI($){return CU(LD,$)}var KD=K("ZodBase64URL",($,v)=>{rJ.init($,v),U$.init($,v)});function FI($){return xU(KD,$)}var ND=K("ZodE164",($,v)=>{dJ.init($,v),U$.init($,v)});function jI($){return fU(ND,$)}var ZD=K("ZodJWT",($,v)=>{pJ.init($,v),U$.init($,v)});function AI($){return _U(ZD,$)}var z1=K("ZodCustomStringFormat",($,v)=>{tJ.init($,v),U$.init($,v)});function wI($,v,D={}){return X1(z1,$,v,D)}function MI($){return X1(z1,"hostname",a$.hostname,$)}function PI($){return X1(z1,"hex",a$.hex,$)}function bI($,v){let D=v?.enc??"hex",X=`${$}_${D}`,U=a$[X];if(!U)throw Error(`Unrecognized hash format: ${X}`);return X1(z1,X,U,v)}var Y1=K("ZodNumber",($,v)=>{BU.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>O9($,X,U,G),Mv($,"ZodNumber",{gt(X,U){return this.check(M4(X,U))},gte(X,U){return this.check(x$(X,U))},min(X,U){return this.check(x$(X,U))},lt(X,U){return this.check(w4(X,U))},lte(X,U){return this.check(e$(X,U))},max(X,U){return this.check(e$(X,U))},int(X){return this.check(sU(X))},safe(X){return this.check(sU(X))},positive(X){return this.check(M4(0,X))},nonnegative(X){return this.check(x$(0,X))},negative(X){return this.check(w4(0,X))},nonpositive(X){return this.check(e$(0,X))},multipleOf(X,U){return this.check(s4(X,U))},step(X,U){return this.check(s4(X,U))},finite(){return this}});let D=$._zod.bag;$.minValue=Math.max(D.minimum??Number.NEGATIVE_INFINITY,D.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(D.maximum??Number.POSITIVE_INFINITY,D.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(D.format??"").includes("int")||Number.isSafeInteger(D.multipleOf??0.5),$.isFinite=!0,$.format=D.format??null});function t($){return iQ(Y1,$)}var P6=K("ZodNumberFormat",($,v)=>{oJ.init($,v),Y1.init($,v)});function sU($){return nQ(P6,$)}function qI($){return lQ(P6,$)}function SI($){return hQ(P6,$)}function kI($){return mQ(P6,$)}function EI($){return cQ(P6,$)}var I1=K("ZodBoolean",($,v)=>{Iv.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>H9($,D,X,U)});function B$($){return rQ(I1,$)}var V1=K("ZodBigInt",($,v)=>{LU.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>F9($,X,U,G),$.gte=(X,U)=>$.check(x$(X,U)),$.min=(X,U)=>$.check(x$(X,U)),$.gt=(X,U)=>$.check(M4(X,U)),$.gte=(X,U)=>$.check(x$(X,U)),$.min=(X,U)=>$.check(x$(X,U)),$.lt=(X,U)=>$.check(w4(X,U)),$.lte=(X,U)=>$.check(e$(X,U)),$.max=(X,U)=>$.check(e$(X,U)),$.positive=(X)=>$.check(M4(BigInt(0),X)),$.negative=(X)=>$.check(w4(BigInt(0),X)),$.nonpositive=(X)=>$.check(e$(BigInt(0),X)),$.nonnegative=(X)=>$.check(x$(BigInt(0),X)),$.multipleOf=(X,U)=>$.check(s4(X,U));let D=$._zod.bag;$.minValue=D.minimum??null,$.maxValue=D.maximum??null,$.format=D.format??null});function TI($){return pQ(V1,$)}var OD=K("ZodBigIntFormat",($,v)=>{aJ.init($,v),V1.init($,v)});function RI($){return oQ(OD,$)}function gI($){return aQ(OD,$)}var OW=K("ZodSymbol",($,v)=>{eJ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>j9($,D,X,U)});function uI($){return eQ(OW,$)}var HW=K("ZodUndefined",($,v)=>{sJ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>w9($,D,X,U)});function CI($){return sQ(HW,$)}var FW=K("ZodNull",($,v)=>{$8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>A9($,D,X,U)});function bv($){return $9(FW,$)}var jW=K("ZodAny",($,v)=>{v8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>b9($,D,X,U)});function xI(){return v9(jW)}var AW=K("ZodUnknown",($,v)=>{U8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>q9($,D,X,U)});function D$(){return U9(AW)}var wW=K("ZodNever",($,v)=>{D8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>P9($,D,X,U)});function HD($){return D9(wW,$)}var MW=K("ZodVoid",($,v)=>{X8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>M9($,D,X,U)});function fI($){return X9(MW,$)}var qv=K("ZodDate",($,v)=>{G8.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>S9($,X,U,G),$.min=(X,U)=>$.check(x$(X,U)),$.max=(X,U)=>$.check(e$(X,U));let D=$._zod.bag;$.minDate=D.minimum?new Date(D.minimum):null,$.maxDate=D.maximum?new Date(D.maximum):null});function _I($){return G9(qv,$)}var PW=K("ZodArray",($,v)=>{J8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>y9($,D,X,U),$.element=v.element,Mv($,"ZodArray",{min(D,X){return this.check(_4(D,X))},nonempty(D){return this.check(_4(1,D))},max(D,X){return this.check(w6(D,X))},length(D,X){return this.check(M6(D,X))},unwrap(){return this.element}})});function m($,v){return W9(PW,$,v)}function iI($){let v=$._zod.def.shape;return M$(Object.keys(v))}var Sv=K("ZodObject",($,v)=>{Q8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>n9($,D,X,U),w.defineLazy($,"shape",()=>{return v.shape}),Mv($,"ZodObject",{keyof(){return M$(Object.keys(this._zod.def.shape))},catchall(D){return this.clone({...this._zod.def,catchall:D})},passthrough(){return this.clone({...this._zod.def,catchall:D$()})},loose(){return this.clone({...this._zod.def,catchall:D$()})},strict(){return this.clone({...this._zod.def,catchall:HD()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(D){return w.extend(this,D)},safeExtend(D){return w.safeExtend(this,D)},merge(D){return w.merge(this,D)},pick(D){return w.pick(this,D)},omit(D){return w.omit(this,D)},partial(...D){return w.partial(jD,this,D[0])},required(...D){return w.required(AD,this,D[0])}})});function q($,v){let D={type:"object",shape:$??{},...w.normalizeParams(v)};return new Sv(D)}function yI($,v){return new Sv({type:"object",shape:$,catchall:HD(),...w.normalizeParams(v)})}function w$($,v){return new Sv({type:"object",shape:$,catchall:D$(),...w.normalizeParams(v)})}var kv=K("ZodUnion",($,v)=>{Vv.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>cU($,D,X,U),$.options=v.options});function X$($,v){return new kv({type:"union",options:$,...w.normalizeParams(v)})}var bW=K("ZodXor",($,v)=>{kv.init($,v),W8.init($,v),$._zod.processJSONSchema=(D,X,U)=>cU($,D,X,U),$.options=v.options});function nI($,v){return new bW({type:"union",options:$,inclusive:!1,...w.normalizeParams(v)})}var qW=K("ZodDiscriminatedUnion",($,v)=>{kv.init($,v),z8.init($,v)});function Ev($,v,D){return new qW({type:"union",options:v,discriminator:$,...w.normalizeParams(D)})}var SW=K("ZodIntersection",($,v)=>{Y8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>l9($,D,X,U)});function B1($,v){return new SW({type:"intersection",left:$,right:v})}var kW=K("ZodTuple",($,v)=>{KU.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>h9($,D,X,U),$.rest=(D)=>$.clone({...$._zod.def,rest:D})});function EW($,v,D){let X=v instanceof f,U=X?D:v;return new kW({type:"tuple",items:$,rest:X?v:null,...w.normalizeParams(U)})}var J1=K("ZodRecord",($,v)=>{I8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>m9($,D,X,U),$.keyType=v.keyType,$.valueType=v.valueType});function s($,v,D){if(!v||!v._zod)return new J1({type:"record",keyType:H(),valueType:$,...w.normalizeParams(v)});return new J1({type:"record",keyType:$,valueType:v,...w.normalizeParams(D)})}function lI($,v,D){let X=u$($);return X._zod.values=void 0,new J1({type:"record",keyType:X,valueType:v,...w.normalizeParams(D)})}function hI($,v,D){return new J1({type:"record",keyType:$,valueType:v,mode:"loose",...w.normalizeParams(D)})}var TW=K("ZodMap",($,v)=>{V8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>_9($,D,X,U),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...D)=>$.check(P4(...D)),$.nonempty=(D)=>$.check(P4(1,D)),$.max=(...D)=>$.check($6(...D)),$.size=(...D)=>$.check(A6(...D))});function mI($,v,D){return new TW({type:"map",keyType:$,valueType:v,...w.normalizeParams(D)})}var RW=K("ZodSet",($,v)=>{B8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>i9($,D,X,U),$.min=(...D)=>$.check(P4(...D)),$.nonempty=(D)=>$.check(P4(1,D)),$.max=(...D)=>$.check($6(...D)),$.size=(...D)=>$.check(A6(...D))});function cI($,v){return new RW({type:"set",valueType:$,...w.normalizeParams(v)})}var Q1=K("ZodEnum",($,v)=>{L8.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>k9($,X,U,G),$.enum=v.entries,$.options=Object.values(v.entries);let D=new Set(Object.keys(v.entries));$.extract=(X,U)=>{let G={};for(let J of X)if(D.has(J))G[J]=v.entries[J];else throw Error(`Key ${J} not found in enum`);return new Q1({...v,checks:[],...w.normalizeParams(U),entries:G})},$.exclude=(X,U)=>{let G={...v.entries};for(let J of X)if(D.has(J))delete G[J];else throw Error(`Key ${J} not found in enum`);return new Q1({...v,checks:[],...w.normalizeParams(U),entries:G})}});function M$($,v){let D=Array.isArray($)?Object.fromEntries($.map((X)=>[X,X])):$;return new Q1({type:"enum",entries:D,...w.normalizeParams(v)})}function rI($,v){return new Q1({type:"enum",entries:$,...w.normalizeParams(v)})}var gW=K("ZodLiteral",($,v)=>{K8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>E9($,D,X,U),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function E($,v){return new gW({type:"literal",values:Array.isArray($)?$:[$],...w.normalizeParams(v)})}var uW=K("ZodFile",($,v)=>{N8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>g9($,D,X,U),$.min=(D,X)=>$.check(P4(D,X)),$.max=(D,X)=>$.check($6(D,X)),$.mime=(D,X)=>$.check(e6(Array.isArray(D)?D:[D],X))});function dI($){return z9(uW,$)}var CW=K("ZodTransform",($,v)=>{Z8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>f9($,D,X,U),$._zod.parse=(D,X)=>{if(X.direction==="backward")throw new O6($.constructor.name);D.addIssue=(G)=>{if(typeof G==="string")D.issues.push(w.issue(G,D.value,v));else{let J=G;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=D.value),J.inst??(J.inst=$),D.issues.push(w.issue(J))}};let U=v.transform(D.value,D);if(U instanceof Promise)return U.then((G)=>{return D.value=G,D.fallback=!0,D});return D.value=U,D.fallback=!0,D}});function FD($){return new CW({type:"transform",transform:$})}var jD=K("ZodOptional",($,v)=>{NU.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>rU($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function J$($){return new jD({type:"optional",innerType:$})}var xW=K("ZodExactOptional",($,v)=>{O8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>rU($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function fW($){return new xW({type:"optional",innerType:$})}var _W=K("ZodNullable",($,v)=>{H8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>c9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function wv($){return new _W({type:"nullable",innerType:$})}function pI($){return J$(wv($))}var iW=K("ZodDefault",($,v)=>{F8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>d9($,D,X,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function yW($,v){return new iW({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():w.shallowClone(v)}})}var nW=K("ZodPrefault",($,v)=>{j8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>p9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function lW($,v){return new nW({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():w.shallowClone(v)}})}var AD=K("ZodNonOptional",($,v)=>{A8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>r9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function hW($,v){return new AD({type:"nonoptional",innerType:$,...w.normalizeParams(v)})}var mW=K("ZodSuccess",($,v)=>{w8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>u9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function tI($){return new mW({type:"success",innerType:$})}var cW=K("ZodCatch",($,v)=>{M8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>t9($,D,X,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function rW($,v){return new cW({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var dW=K("ZodNaN",($,v)=>{P8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>T9($,D,X,U)});function oI($){return Q9(dW,$)}var Tv=K("ZodPipe",($,v)=>{ZU.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>o9($,D,X,U),$.in=v.in,$.out=v.out});function $D($,v){return new Tv({type:"pipe",in:$,out:v})}var Rv=K("ZodCodec",($,v)=>{Tv.init($,v),Bv.init($,v)});function aI($,v,D){return new Rv({type:"pipe",in:$,out:v,transform:D.decode,reverseTransform:D.encode})}function eI($){let v=$._zod.def;return new Rv({type:"pipe",in:v.out,out:v.in,transform:v.reverseTransform,reverseTransform:v.transform})}var pW=K("ZodPreprocess",($,v)=>{Tv.init($,v),b8.init($,v)}),tW=K("ZodReadonly",($,v)=>{q8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>a9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function oW($){return new tW({type:"readonly",innerType:$})}var aW=K("ZodTemplateLiteral",($,v)=>{S8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>R9($,D,X,U)});function sI($,v){return new aW({type:"template_literal",parts:$,...w.normalizeParams(v)})}var eW=K("ZodLazy",($,v)=>{T8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>s9($,D,X,U),$.unwrap=()=>$._zod.def.getter()});function sW($){return new eW({type:"lazy",getter:$})}var $z=K("ZodPromise",($,v)=>{E8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>e9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function $V($){return new $z({type:"promise",innerType:$})}var vz=K("ZodFunction",($,v)=>{k8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>x9($,D,X,U)});function vV($){return new vz({type:"function",input:Array.isArray($?.input)?EW($?.input):$?.input??m(D$()),output:$?.output??D$()})}var gv=K("ZodCustom",($,v)=>{R8.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>C9($,D,X,U)});function UV($){let v=new G$({check:"custom"});return v._zod.check=$,v}function wD($,v){return Y9(gv,$??(()=>!0),v)}function Uz($,v={}){return I9(gv,$,v)}function Dz($,v){return V9($,v)}var DV=B9,XV=L9;function GV($,v={}){let D=new gv({type:"custom",check:"custom",fn:(X)=>X instanceof $,abort:!0,...w.normalizeParams(v)});return D._zod.bag.Class=$,D._zod.check=(X)=>{if(!(X.value instanceof $))X.issues.push({code:"invalid_type",expected:$.name,input:X.value,inst:D,path:[...D._zod.def.path??[]]})},D}var JV=(...$)=>K9({Codec:Rv,Boolean:I1,String:W1},...$);function QV($){let v=sW(()=>{return X$([H($),t(),B$(),bv(),m(v),s(H(),v)])});return v}function uv($,v){return new pW({type:"pipe",in:FD($),out:v})}var YA={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 IA($){V$({customError:$})}function VA(){return V$().customError}var Xz;(function($){})(Xz||(Xz={}));var P={...jv,...pU,iso:X6},BA=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function LA($,v){let D=$.$schema;if(D==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(D==="http://json-schema.org/draft-07/schema#")return"draft-7";if(D==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function KA($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let D=$.slice(1).split("/").filter(Boolean);if(D.length===0)return v.rootSchema;let X=v.version==="draft-2020-12"?"$defs":"definitions";if(D[0]===X){let U=D[1];if(!U||!v.defs[U])throw Error(`Reference not found: ${$}`);return v.defs[U]}throw Error(`Reference not found: ${$}`)}function WV($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return P.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let U=$.$ref;if(v.refs.has(U))return v.refs.get(U);if(v.processing.has(U))return P.lazy(()=>{if(!v.refs.has(U))throw Error(`Circular reference not resolved: ${U}`);return v.refs.get(U)});v.processing.add(U);let G=KA(U,v),J=E$(G,v);return v.refs.set(U,J),v.processing.delete(U),J}if($.enum!==void 0){let U=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&U.length===1&&U[0]===null)return P.null();if(U.length===0)return P.never();if(U.length===1)return P.literal(U[0]);if(U.every((J)=>typeof J==="string"))return P.enum(U);let G=U.map((J)=>P.literal(J));if(G.length<2)return G[0];return P.union([G[0],G[1],...G.slice(2)])}if($.const!==void 0)return P.literal($.const);let D=$.type;if(Array.isArray(D)){let U=D.map((G)=>{let J={...$,type:G};return WV(J,v)});if(U.length===0)return P.never();if(U.length===1)return U[0];return P.union(U)}if(!D)return P.any();let X;switch(D){case"string":{let U=P.string();if($.format){let G=$.format;if(G==="email")U=U.check(P.email());else if(G==="uri"||G==="uri-reference")U=U.check(P.url());else if(G==="uuid"||G==="guid")U=U.check(P.uuid());else if(G==="date-time")U=U.check(P.iso.datetime());else if(G==="date")U=U.check(P.iso.date());else if(G==="time")U=U.check(P.iso.time());else if(G==="duration")U=U.check(P.iso.duration());else if(G==="ipv4")U=U.check(P.ipv4());else if(G==="ipv6")U=U.check(P.ipv6());else if(G==="mac")U=U.check(P.mac());else if(G==="cidr")U=U.check(P.cidrv4());else if(G==="cidr-v6")U=U.check(P.cidrv6());else if(G==="base64")U=U.check(P.base64());else if(G==="base64url")U=U.check(P.base64url());else if(G==="e164")U=U.check(P.e164());else if(G==="jwt")U=U.check(P.jwt());else if(G==="emoji")U=U.check(P.emoji());else if(G==="nanoid")U=U.check(P.nanoid());else if(G==="cuid")U=U.check(P.cuid());else if(G==="cuid2")U=U.check(P.cuid2());else if(G==="ulid")U=U.check(P.ulid());else if(G==="xid")U=U.check(P.xid());else if(G==="ksuid")U=U.check(P.ksuid())}if(typeof $.minLength==="number")U=U.min($.minLength);if(typeof $.maxLength==="number")U=U.max($.maxLength);if($.pattern)U=U.regex(new RegExp($.pattern));X=U;break}case"number":case"integer":{let U=D==="integer"?P.number().int():P.number();if(typeof $.minimum==="number")U=U.min($.minimum);if(typeof $.maximum==="number")U=U.max($.maximum);if(typeof $.exclusiveMinimum==="number")U=U.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")U=U.gt($.minimum);if(typeof $.exclusiveMaximum==="number")U=U.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")U=U.lt($.maximum);if(typeof $.multipleOf==="number")U=U.multipleOf($.multipleOf);X=U;break}case"boolean":{X=P.boolean();break}case"null":{X=P.null();break}case"object":{let U={},G=$.properties||{},J=new Set($.required||[]);for(let[W,z]of Object.entries(G)){let Y=E$(z,v);U[W]=J.has(W)?Y:Y.optional()}if($.propertyNames){let W=E$($.propertyNames,v),z=$.additionalProperties&&typeof $.additionalProperties==="object"?E$($.additionalProperties,v):P.any();if(Object.keys(U).length===0){X=P.record(W,z);break}let Y=P.object(U).passthrough(),I=P.looseRecord(W,z);X=P.intersection(Y,I);break}if($.patternProperties){let W=$.patternProperties,z=Object.keys(W),Y=[];for(let V of z){let B=E$(W[V],v),L=P.string().regex(new RegExp(V));Y.push(P.looseRecord(L,B))}let I=[];if(Object.keys(U).length>0)I.push(P.object(U).passthrough());if(I.push(...Y),I.length===0)X=P.object({}).passthrough();else if(I.length===1)X=I[0];else{let V=P.intersection(I[0],I[1]);for(let B=2;B<I.length;B++)V=P.intersection(V,I[B]);X=V}break}let Q=P.object(U);if($.additionalProperties===!1)X=Q.strict();else if(typeof $.additionalProperties==="object")X=Q.catchall(E$($.additionalProperties,v));else X=Q.passthrough();break}case"array":{let{prefixItems:U,items:G}=$;if(U&&Array.isArray(U)){let J=U.map((W)=>E$(W,v)),Q=G&&typeof G==="object"&&!Array.isArray(G)?E$(G,v):void 0;if(Q)X=P.tuple(J).rest(Q);else X=P.tuple(J);if(typeof $.minItems==="number")X=X.check(P.minLength($.minItems));if(typeof $.maxItems==="number")X=X.check(P.maxLength($.maxItems))}else if(Array.isArray(G)){let J=G.map((W)=>E$(W,v)),Q=$.additionalItems&&typeof $.additionalItems==="object"?E$($.additionalItems,v):void 0;if(Q)X=P.tuple(J).rest(Q);else X=P.tuple(J);if(typeof $.minItems==="number")X=X.check(P.minLength($.minItems));if(typeof $.maxItems==="number")X=X.check(P.maxLength($.maxItems))}else if(G!==void 0){let J=E$(G,v),Q=P.array(J);if(typeof $.minItems==="number")Q=Q.min($.minItems);if(typeof $.maxItems==="number")Q=Q.max($.maxItems);X=Q}else X=P.array(P.any());break}default:throw Error(`Unsupported type: ${D}`)}return X}function E$($,v){if(typeof $==="boolean")return $?P.any():P.never();let D=WV($,v),X=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let Q=$.anyOf.map((z)=>E$(z,v)),W=P.union(Q);D=X?P.intersection(D,W):W}if($.oneOf&&Array.isArray($.oneOf)){let Q=$.oneOf.map((z)=>E$(z,v)),W=P.xor(Q);D=X?P.intersection(D,W):W}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)D=X?D:P.any();else{let Q=X?D:E$($.allOf[0],v),W=X?0:1;for(let z=W;z<$.allOf.length;z++)Q=P.intersection(Q,E$($.allOf[z],v));D=Q}if($.nullable===!0&&v.version==="openapi-3.0")D=P.nullable(D);if($.readOnly===!0)D=P.readonly(D);if($.default!==void 0)D=D.default($.default);let U={},G=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let Q of G)if(Q in $)U[Q]=$[Q];let J=["contentEncoding","contentMediaType","contentSchema"];for(let Q of J)if(Q in $)U[Q]=$[Q];for(let Q of Object.keys($))if(!BA.has(Q))U[Q]=$[Q];if(Object.keys(U).length>0)v.registry.add(D,U);if($.description)D=D.describe($.description);return D}function zV($,v){if(typeof $==="boolean")return $?P.any():P.never();let D;try{D=JSON.parse(JSON.stringify($))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let X=LA(D,v?.defaultTarget),U=D.$defs||D.definitions||{},G={version:X,defs:U,refs:new Map,processing:new Set,rootSchema:D,registry:v?.registry??A$};return E$(D,G)}var Gz={};R4(Gz,{string:()=>NA,number:()=>ZA,date:()=>FA,boolean:()=>OA,bigint:()=>HA});function NA($){return RQ(W1,$)}function ZA($){return yQ(Y1,$)}function OA($){return dQ(I1,$)}function HA($){return tQ(V1,$)}function FA($){return J9(qv,$)}V$(Lv());var Jz="2025-11-25",YV="2025-03-26",K1=[Jz,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],G6="io.modelcontextprotocol/related-task",PD="2.0",Z$=wD(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),IV=X$([H(),t().int()]),VV=H(),Vn=w$({ttl:t().optional(),pollInterval:t().optional()}),jA=q({ttl:t().optional()}),AA=q({taskId:H()}),Qz=w$({progressToken:IV.optional(),[G6]:AA.optional()}),s$=q({_meta:Qz.optional()}),Cv=s$.extend({task:jA.optional()}),BV=($)=>Cv.safeParse($).success,P$=q({method:H(),params:s$.loose().optional()}),U4=q({_meta:Qz.optional()}),D4=q({method:H(),params:U4.loose().optional()}),b$=w$({_meta:Qz.optional()}),bD=X$([H(),t().int()]),LV=q({jsonrpc:E(PD),id:bD,...P$.shape}).strict(),J6=($)=>LV.safeParse($).success,KV=q({jsonrpc:E(PD),...D4.shape}).strict(),NV=($)=>KV.safeParse($).success,Wz=q({jsonrpc:E(PD),id:bD,result:b$}).strict(),y4=($)=>Wz.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 zz=q({jsonrpc:E(PD),id:bD.optional(),error:q({code:t().int(),message:H(),data:D$().optional()})}).strict();var N1=($)=>zz.safeParse($).success;var xv=X$([LV,KV,Wz,zz]),Bn=X$([Wz,zz]),qD=b$.strict(),wA=U4.extend({requestId:bD.optional(),reason:H().optional()}),SD=D4.extend({method:E("notifications/cancelled"),params:wA}),MA=q({src:H(),mimeType:H().optional(),sizes:m(H()).optional(),theme:M$(["light","dark"]).optional()}),fv=q({icons:m(MA).optional()}),L1=q({name:H(),title:H().optional()}),ZV=L1.extend({...L1.shape,...fv.shape,version:H(),websiteUrl:H().optional(),description:H().optional()}),PA=B1(q({applyDefaults:B$().optional()}),s(H(),D$())),bA=uv(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},B1(q({form:PA.optional(),url:Z$.optional()}),s(H(),D$()).optional())),qA=w$({list:Z$.optional(),cancel:Z$.optional(),requests:w$({sampling:w$({createMessage:Z$.optional()}).optional(),elicitation:w$({create:Z$.optional()}).optional()}).optional()}),SA=w$({list:Z$.optional(),cancel:Z$.optional(),requests:w$({tools:w$({call:Z$.optional()}).optional()}).optional()}),kA=q({experimental:s(H(),Z$).optional(),sampling:q({context:Z$.optional(),tools:Z$.optional()}).optional(),elicitation:bA.optional(),roots:q({listChanged:B$().optional()}).optional(),tasks:qA.optional(),extensions:s(H(),Z$).optional()}),EA=s$.extend({protocolVersion:H(),capabilities:kA,clientInfo:ZV}),kD=P$.extend({method:E("initialize"),params:EA}),Yz=($)=>kD.safeParse($).success,TA=q({experimental:s(H(),Z$).optional(),logging:Z$.optional(),completions:Z$.optional(),prompts:q({listChanged:B$().optional()}).optional(),resources:q({subscribe:B$().optional(),listChanged:B$().optional()}).optional(),tools:q({listChanged:B$().optional()}).optional(),tasks:SA.optional(),extensions:s(H(),Z$).optional()}),RA=b$.extend({protocolVersion:H(),capabilities:TA,serverInfo:ZV,instructions:H().optional()}),Iz=D4.extend({method:E("notifications/initialized"),params:U4.optional()});var ED=P$.extend({method:E("ping"),params:s$.optional()}),gA=q({progress:t(),total:J$(t()),message:J$(H())}),uA=q({...U4.shape,...gA.shape,progressToken:IV}),TD=D4.extend({method:E("notifications/progress"),params:uA}),CA=s$.extend({cursor:VV.optional()}),_v=P$.extend({params:CA.optional()}),iv=b$.extend({nextCursor:VV.optional()}),xA=M$(["working","input_required","completed","failed","cancelled"]),yv=q({taskId:H(),status:xA,ttl:X$([t(),bv()]),createdAt:H(),lastUpdatedAt:H(),pollInterval:J$(t()),statusMessage:J$(H())}),Z1=b$.extend({task:yv}),fA=U4.merge(yv),nv=D4.extend({method:E("notifications/tasks/status"),params:fA}),RD=P$.extend({method:E("tasks/get"),params:s$.extend({taskId:H()})}),gD=b$.merge(yv),uD=P$.extend({method:E("tasks/result"),params:s$.extend({taskId:H()})}),Ln=b$.loose(),CD=_v.extend({method:E("tasks/list")}),xD=iv.extend({tasks:m(yv)}),fD=P$.extend({method:E("tasks/cancel"),params:s$.extend({taskId:H()})}),OV=b$.merge(yv),HV=q({uri:H(),mimeType:J$(H()),_meta:s(H(),D$()).optional()}),FV=HV.extend({text:H()}),Vz=H().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),jV=HV.extend({blob:Vz}),lv=M$(["user","assistant"]),O1=q({audience:m(lv).optional(),priority:t().min(0).max(1).optional(),lastModified:X6.datetime({offset:!0}).optional()}),AV=q({...L1.shape,...fv.shape,uri:H(),description:J$(H()),mimeType:J$(H()),size:J$(t()),annotations:O1.optional(),_meta:J$(w$({}))}),_A=q({...L1.shape,...fv.shape,uriTemplate:H(),description:J$(H()),mimeType:J$(H()),annotations:O1.optional(),_meta:J$(w$({}))}),hv=_v.extend({method:E("resources/list")}),iA=iv.extend({resources:m(AV)}),yA=_v.extend({method:E("resources/templates/list")}),nA=iv.extend({resourceTemplates:m(_A)}),Bz=s$.extend({uri:H()}),lA=Bz,mv=P$.extend({method:E("resources/read"),params:lA}),hA=b$.extend({contents:m(X$([FV,jV]))}),mA=D4.extend({method:E("notifications/resources/list_changed"),params:U4.optional()}),cA=Bz,rA=P$.extend({method:E("resources/subscribe"),params:cA}),dA=Bz,pA=P$.extend({method:E("resources/unsubscribe"),params:dA}),tA=U4.extend({uri:H()}),oA=D4.extend({method:E("notifications/resources/updated"),params:tA}),aA=q({name:H(),description:J$(H()),required:J$(B$())}),eA=q({...L1.shape,...fv.shape,description:J$(H()),arguments:J$(m(aA)),_meta:J$(w$({}))}),cv=_v.extend({method:E("prompts/list")}),sA=iv.extend({prompts:m(eA)}),$w=s$.extend({name:H(),arguments:s(H(),H()).optional()}),rv=P$.extend({method:E("prompts/get"),params:$w}),Lz=q({type:E("text"),text:H(),annotations:O1.optional(),_meta:s(H(),D$()).optional()}),Kz=q({type:E("image"),data:Vz,mimeType:H(),annotations:O1.optional(),_meta:s(H(),D$()).optional()}),Nz=q({type:E("audio"),data:Vz,mimeType:H(),annotations:O1.optional(),_meta:s(H(),D$()).optional()}),vw=q({type:E("tool_use"),name:H(),id:H(),input:s(H(),D$()),_meta:s(H(),D$()).optional()}),Uw=q({type:E("resource"),resource:X$([FV,jV]),annotations:O1.optional(),_meta:s(H(),D$()).optional()}),Dw=AV.extend({type:E("resource_link")}),Zz=X$([Lz,Kz,Nz,Dw,Uw]),Xw=q({role:lv,content:Zz}),Gw=b$.extend({description:H().optional(),messages:m(Xw)}),Jw=D4.extend({method:E("notifications/prompts/list_changed"),params:U4.optional()}),Qw=q({title:H().optional(),readOnlyHint:B$().optional(),destructiveHint:B$().optional(),idempotentHint:B$().optional(),openWorldHint:B$().optional()}),Ww=q({taskSupport:M$(["required","optional","forbidden"]).optional()}),wV=q({...L1.shape,...fv.shape,description:H().optional(),inputSchema:q({type:E("object"),properties:s(H(),Z$).optional(),required:m(H()).optional()}).catchall(D$()),outputSchema:q({type:E("object"),properties:s(H(),Z$).optional(),required:m(H()).optional()}).catchall(D$()).optional(),annotations:Qw.optional(),execution:Ww.optional(),_meta:s(H(),D$()).optional()}),dv=_v.extend({method:E("tools/list")}),zw=iv.extend({tools:m(wV)}),_D=b$.extend({content:m(Zz).default([]),structuredContent:s(H(),D$()).optional(),isError:B$().optional()}),Kn=_D.or(b$.extend({toolResult:D$()})),Yw=Cv.extend({name:H(),arguments:s(H(),D$()).optional()}),b6=P$.extend({method:E("tools/call"),params:Yw}),Iw=D4.extend({method:E("notifications/tools/list_changed"),params:U4.optional()}),Nn=q({autoRefresh:B$().default(!0),debounceMs:t().int().nonnegative().default(300)}),pv=M$(["debug","info","notice","warning","error","critical","alert","emergency"]),Vw=s$.extend({level:pv}),Oz=P$.extend({method:E("logging/setLevel"),params:Vw}),Bw=U4.extend({level:pv,logger:H().optional(),data:D$()}),Lw=D4.extend({method:E("notifications/message"),params:Bw}),Kw=q({name:H().optional()}),Nw=q({hints:m(Kw).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),Zw=q({mode:M$(["auto","required","none"]).optional()}),Ow=q({type:E("tool_result"),toolUseId:H().describe("The unique identifier for the corresponding tool call."),content:m(Zz).default([]),structuredContent:q({}).loose().optional(),isError:B$().optional(),_meta:s(H(),D$()).optional()}),Hw=Ev("type",[Lz,Kz,Nz]),MD=Ev("type",[Lz,Kz,Nz,vw,Ow]),Fw=q({role:lv,content:X$([MD,m(MD)]),_meta:s(H(),D$()).optional()}),jw=Cv.extend({messages:m(Fw),modelPreferences:Nw.optional(),systemPrompt:H().optional(),includeContext:M$(["none","thisServer","allServers"]).optional(),temperature:t().optional(),maxTokens:t().int(),stopSequences:m(H()).optional(),metadata:Z$.optional(),tools:m(wV).optional(),toolChoice:Zw.optional()}),Aw=P$.extend({method:E("sampling/createMessage"),params:jw}),tv=b$.extend({model:H(),stopReason:J$(M$(["endTurn","stopSequence","maxTokens"]).or(H())),role:lv,content:Hw}),Hz=b$.extend({model:H(),stopReason:J$(M$(["endTurn","stopSequence","maxTokens","toolUse"]).or(H())),role:lv,content:X$([MD,m(MD)])}),ww=q({type:E("boolean"),title:H().optional(),description:H().optional(),default:B$().optional()}),Mw=q({type:E("string"),title:H().optional(),description:H().optional(),minLength:t().optional(),maxLength:t().optional(),format:M$(["email","uri","date","date-time"]).optional(),default:H().optional()}),Pw=q({type:M$(["number","integer"]),title:H().optional(),description:H().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),bw=q({type:E("string"),title:H().optional(),description:H().optional(),enum:m(H()),default:H().optional()}),qw=q({type:E("string"),title:H().optional(),description:H().optional(),oneOf:m(q({const:H(),title:H()})),default:H().optional()}),Sw=q({type:E("string"),title:H().optional(),description:H().optional(),enum:m(H()),enumNames:m(H()).optional(),default:H().optional()}),kw=X$([bw,qw]),Ew=q({type:E("array"),title:H().optional(),description:H().optional(),minItems:t().optional(),maxItems:t().optional(),items:q({type:E("string"),enum:m(H())}),default:m(H()).optional()}),Tw=q({type:E("array"),title:H().optional(),description:H().optional(),minItems:t().optional(),maxItems:t().optional(),items:q({anyOf:m(q({const:H(),title:H()}))}),default:m(H()).optional()}),Rw=X$([Ew,Tw]),gw=X$([Sw,kw,Rw]),uw=X$([gw,ww,Mw,Pw]),Cw=Cv.extend({mode:E("form").optional(),message:H(),requestedSchema:q({type:E("object"),properties:s(H(),uw),required:m(H()).optional()})}),xw=Cv.extend({mode:E("url"),message:H(),elicitationId:H(),url:H().url()}),fw=X$([Cw,xw]),_w=P$.extend({method:E("elicitation/create"),params:fw}),iw=U4.extend({elicitationId:H()}),yw=D4.extend({method:E("notifications/elicitation/complete"),params:iw}),H1=b$.extend({action:M$(["accept","decline","cancel"]),content:uv(($)=>$===null?void 0:$,s(H(),X$([H(),t(),B$(),m(H())])).optional())}),nw=q({type:E("ref/resource"),uri:H()});var lw=q({type:E("ref/prompt"),name:H()}),hw=s$.extend({ref:X$([lw,nw]),argument:q({name:H(),value:H()}),context:q({arguments:s(H(),H()).optional()}).optional()}),mw=P$.extend({method:E("completion/complete"),params:hw});var cw=b$.extend({completion:w$({values:m(H()).max(100),total:J$(t().int()),hasMore:J$(B$())})}),rw=q({uri:H().startsWith("file://"),name:H().optional(),_meta:s(H(),D$()).optional()}),dw=P$.extend({method:E("roots/list"),params:s$.optional()}),Fz=b$.extend({roots:m(rw)}),pw=D4.extend({method:E("notifications/roots/list_changed"),params:U4.optional()}),Zn=X$([ED,kD,mw,Oz,rv,cv,hv,yA,mv,rA,pA,b6,dv,RD,uD,CD,fD]),On=X$([SD,TD,Iz,pw,nv]),Hn=X$([qD,tv,Hz,H1,Fz,gD,xD,Z1]),Fn=X$([ED,Aw,_w,dw,RD,uD,CD,fD]),jn=X$([SD,TD,Lw,oA,mA,Iw,Jw,nv,yw]),An=X$([qD,RA,cw,Gw,sA,iA,nA,hA,_D,zw,gD,xD,Z1]);class u extends Error{constructor($,v,D){super(`MCP error ${$}: ${v}`);this.code=$,this.data=D,this.name="McpError"}static fromError($,v,D){if($===C.UrlElicitationRequired&&D){let X=D;if(X.elicitations)return new MV(X.elicitations,v)}return new u($,v,D)}}class MV extends u{constructor($,v=`URL elicitation${$.length>1?"s":""} required`){super(C.UrlElicitationRequired,v,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}class jz{constructor($={}){this._started=!1,this._hasHandledRequest=!1,this._streamMapping=new Map,this._requestToStreamMapping=new Map,this._requestResponseMap=new Map,this._initialized=!1,this._enableJsonResponse=!1,this._standaloneSseStreamId="_GET_stream",this.sessionIdGenerator=$.sessionIdGenerator,this._enableJsonResponse=$.enableJsonResponse??!1,this._eventStore=$.eventStore,this._onsessioninitialized=$.onsessioninitialized,this._onsessionclosed=$.onsessionclosed,this._allowedHosts=$.allowedHosts,this._allowedOrigins=$.allowedOrigins,this._enableDnsRebindingProtection=$.enableDnsRebindingProtection??!1,this._retryInterval=$.retryInterval}async start(){if(this._started)throw Error("Transport already started");this._started=!0}createJsonErrorResponse($,v,D,X){let U={code:v,message:D};if(X?.data!==void 0)U.data=X.data;return new Response(JSON.stringify({jsonrpc:"2.0",error:U,id:null}),{status:$,headers:{"Content-Type":"application/json",...X?.headers}})}validateRequestHeaders($){if(!this._enableDnsRebindingProtection)return;if(this._allowedHosts&&this._allowedHosts.length>0){let v=$.headers.get("host");if(!v||!this._allowedHosts.includes(v)){let D=`Invalid Host header: ${v}`;return this.onerror?.(Error(D)),this.createJsonErrorResponse(403,-32000,D)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let v=$.headers.get("origin");if(v&&!this._allowedOrigins.includes(v)){let D=`Invalid Origin header: ${v}`;return this.onerror?.(Error(D)),this.createJsonErrorResponse(403,-32000,D)}}return}async handleRequest($,v){if(!this.sessionIdGenerator&&this._hasHandledRequest)throw Error("Stateless transport cannot be reused across requests. Create a new transport per request.");this._hasHandledRequest=!0;let D=this.validateRequestHeaders($);if(D)return D;switch($.method){case"POST":return this.handlePostRequest($,v);case"GET":return this.handleGetRequest($);case"DELETE":return this.handleDeleteRequest($);default:return this.handleUnsupportedRequest()}}async writePrimingEvent($,v,D,X){if(!this._eventStore)return;if(X<"2025-11-25")return;let U=await this._eventStore.storeEvent(D,{}),G=`id: ${U}
|
|
75
93
|
data:
|
|
76
94
|
|
|
77
|
-
`;if(this._retryInterval!==void 0)
|
|
95
|
+
`;if(this._retryInterval!==void 0)G=`id: ${U}
|
|
78
96
|
retry: ${this._retryInterval}
|
|
79
97
|
data:
|
|
80
98
|
|
|
81
|
-
`;$.enqueue(v.encode(
|
|
82
|
-
`;if(
|
|
99
|
+
`;$.enqueue(v.encode(G))}async handleGetRequest($){if(!$.headers.get("accept")?.includes("text/event-stream"))return this.onerror?.(Error("Not Acceptable: Client must accept text/event-stream")),this.createJsonErrorResponse(406,-32000,"Not Acceptable: Client must accept text/event-stream");let D=this.validateSession($);if(D)return D;let X=this.validateProtocolVersion($);if(X)return X;if(this._eventStore){let W=$.headers.get("last-event-id");if(W)return this.replayEvents(W)}if(this._streamMapping.get(this._standaloneSseStreamId)!==void 0)return this.onerror?.(Error("Conflict: Only one SSE stream is allowed per session")),this.createJsonErrorResponse(409,-32000,"Conflict: Only one SSE stream is allowed per session");let U=new TextEncoder,G,J=new ReadableStream({start:(W)=>{G=W},cancel:()=>{this._streamMapping.delete(this._standaloneSseStreamId)}}),Q={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};if(this.sessionId!==void 0)Q["mcp-session-id"]=this.sessionId;return this._streamMapping.set(this._standaloneSseStreamId,{controller:G,encoder:U,cleanup:()=>{this._streamMapping.delete(this._standaloneSseStreamId);try{G.close()}catch{}}}),new Response(J,{headers:Q})}async replayEvents($){if(!this._eventStore)return this.onerror?.(Error("Event store not configured")),this.createJsonErrorResponse(400,-32000,"Event store not configured");try{let v;if(this._eventStore.getStreamIdForEventId){if(v=await this._eventStore.getStreamIdForEventId($),!v)return this.onerror?.(Error("Invalid event ID format")),this.createJsonErrorResponse(400,-32000,"Invalid event ID format");if(this._streamMapping.get(v)!==void 0)return this.onerror?.(Error("Conflict: Stream already has an active connection")),this.createJsonErrorResponse(409,-32000,"Conflict: Stream already has an active connection")}let D={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};if(this.sessionId!==void 0)D["mcp-session-id"]=this.sessionId;let X=new TextEncoder,U,G=new ReadableStream({start:(Q)=>{U=Q},cancel:()=>{}}),J=await this._eventStore.replayEventsAfter($,{send:async(Q,W)=>{if(!this.writeSSEEvent(U,X,W,Q)){this.onerror?.(Error("Failed replay events"));try{U.close()}catch{}}}});return this._streamMapping.set(J,{controller:U,encoder:X,cleanup:()=>{this._streamMapping.delete(J);try{U.close()}catch{}}}),new Response(G,{headers:D})}catch(v){return this.onerror?.(v),this.createJsonErrorResponse(500,-32000,"Error replaying events")}}writeSSEEvent($,v,D,X){try{let U=`event: message
|
|
100
|
+
`;if(X)U+=`id: ${X}
|
|
83
101
|
`;return U+=`data: ${JSON.stringify(D)}
|
|
84
102
|
|
|
85
|
-
`,$.enqueue(v.encode(U)),!0}catch(U){return this.onerror?.(U),!1}}handleUnsupportedRequest(){return this.onerror?.(Error("Method not allowed.")),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32000,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest($,v){try{let D=$.headers.get("accept");if(!D?.includes("application/json")||!D.includes("text/event-stream"))return this.onerror?.(Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32000,"Not Acceptable: Client must accept both application/json and text/event-stream");let I=$.headers.get("content-type");if(!I||!I.includes("application/json"))return this.onerror?.(Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32000,"Unsupported Media Type: Content-Type must be application/json");let U={headers:Object.fromEntries($.headers.entries()),url:new URL($.url)},X;if(v?.parsedBody!==void 0)X=v.parsedBody;else try{X=await $.json()}catch{return this.onerror?.(Error("Parse error: Invalid JSON")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}let G;try{if(Array.isArray(X))G=X.map((A)=>Pv.parse(A));else G=[Pv.parse(X)]}catch{return this.onerror?.(Error("Parse error: Invalid JSON-RPC message")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}let Q=G.some(L9);if(Q){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(G.length>1)return this.onerror?.(Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");if(this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized)await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!Q){let A=this.validateSession($);if(A)return A;let F=this.validateProtocolVersion($);if(F)return F}if(!G.some(e4)){for(let A of G)this.onmessage?.(A,{authInfo:v?.authInfo,requestInfo:U});return new Response(null,{status:202})}let z=crypto.randomUUID(),W=G.find((A)=>L9(A)),Y=W?W.params.protocolVersion:$.headers.get("mcp-protocol-version")??x5;if(this._enableJsonResponse)return new Promise((A)=>{this._streamMapping.set(z,{resolveJson:A,cleanup:()=>{this._streamMapping.delete(z)}});for(let F of G)if(e4(F))this._requestToStreamMapping.set(F.id,z);for(let F of G)this.onmessage?.(F,{authInfo:v?.authInfo,requestInfo:U})});let L=new TextEncoder,V,B=new ReadableStream({start:(A)=>{V=A},cancel:()=>{this._streamMapping.delete(z)}}),N={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};if(this.sessionId!==void 0)N["mcp-session-id"]=this.sessionId;for(let A of G)if(e4(A))this._streamMapping.set(z,{controller:V,encoder:L,cleanup:()=>{this._streamMapping.delete(z);try{V.close()}catch{}}}),this._requestToStreamMapping.set(A.id,z);await this.writePrimingEvent(V,L,z,Y);for(let A of G){let F,S;if(e4(A)&&this._eventStore&&Y>="2025-11-25")F=()=>{this.closeSSEStream(A.id)},S=()=>{this.closeStandaloneSSEStream()};this.onmessage?.(A,{authInfo:v?.authInfo,requestInfo:U,closeSSEStream:F,closeStandaloneSSEStream:S})}return new Response(B,{status:200,headers:N})}catch(D){return this.onerror?.(D),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(D)})}}async handleDeleteRequest($){let v=this.validateSession($);if(v)return v;let D=this.validateProtocolVersion($);if(D)return D;return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),await this.close(),new Response(null,{status:200})}validateSession($){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32000,"Bad Request: Server not initialized");let v=$.headers.get("mcp-session-id");if(!v)return this.onerror?.(Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32000,"Bad Request: Mcp-Session-Id header is required");if(v!==this.sessionId)return this.onerror?.(Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found");return}validateProtocolVersion($){let v=$.headers.get("mcp-protocol-version");if(v!==null&&!J1.includes(v))return this.onerror?.(Error(`Bad Request: Unsupported protocol version: ${v} (supported versions: ${J1.join(", ")})`)),this.createJsonErrorResponse(400,-32000,`Bad Request: Unsupported protocol version: ${v} (supported versions: ${J1.join(", ")})`);return}async close(){this._streamMapping.forEach(({cleanup:$})=>{$()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}closeSSEStream($){let v=this._requestToStreamMapping.get($);if(!v)return;let D=this._streamMapping.get(v);if(D)D.cleanup()}closeStandaloneSSEStream(){let $=this._streamMapping.get(this._standaloneSseStreamId);if($)$.cleanup()}async send($,v){let D=v?.relatedRequestId;if(R4($)||z1($))D=$.id;if(D===void 0){if(R4($)||z1($))throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let X;if(this._eventStore)X=await this._eventStore.storeEvent(this._standaloneSseStreamId,$);let G=this._streamMapping.get(this._standaloneSseStreamId);if(G===void 0)return;if(G.controller&&G.encoder)this.writeSSEEvent(G.controller,G.encoder,$,X);return}let I=this._requestToStreamMapping.get(D);if(!I)throw Error(`No connection established for request ID: ${String(D)}`);let U=this._streamMapping.get(I);if(!this._enableJsonResponse&&U?.controller&&U?.encoder){let X;if(this._eventStore)X=await this._eventStore.storeEvent(I,$);this.writeSSEEvent(U.controller,U.encoder,$,X)}if(R4($)||z1($)){this._requestResponseMap.set(D,$);let X=Array.from(this._requestToStreamMapping.entries()).filter(([Q,J])=>J===I).map(([Q])=>Q);if(X.every((Q)=>this._requestResponseMap.has(Q))){if(!U)throw Error(`No connection established for request ID: ${String(D)}`);if(this._enableJsonResponse&&U.resolveJson){let Q={"Content-Type":"application/json"};if(this.sessionId!==void 0)Q["mcp-session-id"]=this.sessionId;let J=X.map((z)=>this._requestResponseMap.get(z));if(J.length===1)U.resolveJson(new Response(JSON.stringify(J[0]),{status:200,headers:Q}));else U.resolveJson(new Response(JSON.stringify(J),{status:200,headers:Q}))}else U.cleanup();for(let Q of X)this._requestResponseMap.delete(Q),this._requestToStreamMapping.delete(Q)}}}}function V1($){return!!$._zod}function s4($,v){if(V1($))return C6($,v);return $.safeParse(v)}function zD($){if(!$)return;let v;if(V1($))v=$._zod?.def?.shape;else v=$.shape;if(!v)return;if(typeof v==="function")try{return v()}catch{return}return v}function s5($){if(V1($)){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 D=$._def;if(D){if(D.value!==void 0)return D.value;if(Array.isArray(D.values)&&D.values.length>0)return D.values[0]}let I=$.value;if(I!==void 0)return I;return}function $6($){return $==="completed"||$==="failed"||$==="cancelled"}var T3=Symbol("Let zodToJsonSchema decide on which parser to use");var gi=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function P9($){let D=zD($)?.method;if(!D)throw Error("Schema is missing a method literal");let I=s5(D);if(typeof I!=="string")throw Error("Schema method literal must be a string");return I}function M9($,v){let D=s4($,v);if(!D.success)throw D.error;return D.data}var i3=60000;class b9{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(e0,(v)=>{this._oncancel(v)}),this.setNotificationHandler(vD,(v)=>{this._onprogress(v)}),this.setRequestHandler($D,(v)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(UD,async(v,D)=>{let I=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!I)throw new R(C.InvalidParams,"Failed to retrieve task: Task not found");return{...I}}),this.setRequestHandler(ID,async(v,D)=>{let I=async()=>{let U=v.params.taskId;if(this._taskMessageQueue){let G;while(G=await this._taskMessageQueue.dequeue(U,D.sessionId)){if(G.type==="response"||G.type==="error"){let Q=G.message,J=Q.id,z=this._requestResolvers.get(J);if(z)if(this._requestResolvers.delete(J),G.type==="response")z(Q);else{let W=Q,Y=new R(W.error.code,W.error.message,W.error.data);z(Y)}else{let W=G.type==="response"?"Response":"Error";this._onerror(Error(`${W} handler missing for request ${J}`))}continue}await this._transport?.send(G.message,{relatedRequestId:D.requestId})}}let X=await this._taskStore.getTask(U,D.sessionId);if(!X)throw new R(C.InvalidParams,`Task not found: ${U}`);if(!$6(X.status))return await this._waitForTaskUpdate(U,D.signal),await I();if($6(X.status)){let G=await this._taskStore.getTaskResult(U,D.sessionId);return this._clearTaskQueue(U),{...G,_meta:{...G._meta,[a4]:{taskId:U}}}}return await I()};return await I()}),this.setRequestHandler(XD,async(v,D)=>{try{let{tasks:I,nextCursor:U}=await this._taskStore.listTasks(v.params?.cursor,D.sessionId);return{tasks:I,nextCursor:U,_meta:{}}}catch(I){throw new R(C.InvalidParams,`Failed to list tasks: ${I instanceof Error?I.message:String(I)}`)}}),this.setRequestHandler(QD,async(v,D)=>{try{let I=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!I)throw new R(C.InvalidParams,`Task not found: ${v.params.taskId}`);if($6(I.status))throw new R(C.InvalidParams,`Cannot cancel task in terminal status: ${I.status}`);await this._taskStore.updateTaskStatus(v.params.taskId,"cancelled","Client cancelled task execution.",D.sessionId),this._clearTaskQueue(v.params.taskId);let U=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!U)throw new R(C.InvalidParams,`Task not found after cancellation: ${v.params.taskId}`);return{_meta:{},...U}}catch(I){if(I instanceof R)throw I;throw new R(C.InvalidRequest,`Failed to cancel task: ${I instanceof Error?I.message:String(I)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,v,D,I,U=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(I,v),startTime:Date.now(),timeout:v,maxTotalTimeout:D,resetTimeoutOnProgress:U,onTimeout:I})}_resetTimeout($){let v=this._timeoutInfo.get($);if(!v)return!1;let D=Date.now()-v.startTime;if(v.maxTotalTimeout&&D>=v.maxTotalTimeout)throw this._timeoutInfo.delete($),R.fromError(C.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:v.maxTotalTimeout,totalElapsed:D});return clearTimeout(v.timeoutId),v.timeoutId=setTimeout(v.onTimeout,v.timeout),!0}_cleanupTimeout($){let v=this._timeoutInfo.get($);if(v)clearTimeout(v.timeoutId),this._timeoutInfo.delete($)}async connect($){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=$;let v=this.transport?.onclose;this._transport.onclose=()=>{v?.(),this._onclose()};let D=this.transport?.onerror;this._transport.onerror=(U)=>{D?.(U),this._onerror(U)};let I=this._transport?.onmessage;this._transport.onmessage=(U,X)=>{if(I?.(U,X),R4(U)||z1(U))this._onresponse(U);else if(e4(U))this._onrequest(U,X);else if(r5(U))this._onnotification(U);else this._onerror(Error(`Unknown message type: ${JSON.stringify(U)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let D of this._timeoutInfo.values())clearTimeout(D.timeoutId);this._timeoutInfo.clear();for(let D of this._requestHandlerAbortControllers.values())D.abort();this._requestHandlerAbortControllers.clear();let v=R.fromError(C.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let D of $.values())D(v)}_onerror($){this.onerror?.($)}_onnotification($){let v=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(v===void 0)return;Promise.resolve().then(()=>v($)).catch((D)=>this._onerror(Error(`Uncaught error in notification handler: ${D}`)))}_onrequest($,v){let D=this._requestHandlers.get($.method)??this.fallbackRequestHandler,I=this._transport,U=$.params?._meta?.[a4]?.taskId;if(D===void 0){let z={jsonrpc:"2.0",id:$.id,error:{code:C.MethodNotFound,message:"Method not found"}};if(U&&this._taskMessageQueue)this._enqueueTaskMessage(U,{type:"error",message:z,timestamp:Date.now()},I?.sessionId).catch((W)=>this._onerror(Error(`Failed to enqueue error response: ${W}`)));else I?.send(z).catch((W)=>this._onerror(Error(`Failed to send an error response: ${W}`)));return}let X=new AbortController;this._requestHandlerAbortControllers.set($.id,X);let G=y5($.params)?$.params.task:void 0,Q=this._taskStore?this.requestTaskStore($,I?.sessionId):void 0,J={signal:X.signal,sessionId:I?.sessionId,_meta:$.params?._meta,sendNotification:async(z)=>{if(X.signal.aborted)return;let W={relatedRequestId:$.id};if(U)W.relatedTask={taskId:U};await this.notification(z,W)},sendRequest:async(z,W,Y)=>{if(X.signal.aborted)throw new R(C.ConnectionClosed,"Request was cancelled");let L={...Y,relatedRequestId:$.id};if(U&&!L.relatedTask)L.relatedTask={taskId:U};let V=L.relatedTask?.taskId??U;if(V&&Q)await Q.updateTaskStatus(V,"input_required");return await this.request(z,W,L)},authInfo:v?.authInfo,requestId:$.id,requestInfo:v?.requestInfo,taskId:U,taskStore:Q,taskRequestedTtl:G?.ttl,closeSSEStream:v?.closeSSEStream,closeStandaloneSSEStream:v?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(G)this.assertTaskHandlerCapability($.method)}).then(()=>D($,J)).then(async(z)=>{if(X.signal.aborted)return;let W={result:z,jsonrpc:"2.0",id:$.id};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"response",message:W,timestamp:Date.now()},I?.sessionId);else await I?.send(W)},async(z)=>{if(X.signal.aborted)return;let W={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(z.code)?z.code:C.InternalError,message:z.message??"Internal error",...z.data!==void 0&&{data:z.data}}};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"error",message:W,timestamp:Date.now()},I?.sessionId);else await I?.send(W)}).catch((z)=>this._onerror(Error(`Failed to send response: ${z}`))).finally(()=>{if(this._requestHandlerAbortControllers.get($.id)===X)this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:v,...D}=$.params,I=Number(v),U=this._progressHandlers.get(I);if(!U){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let X=this._responseHandlers.get(I),G=this._timeoutInfo.get(I);if(G&&X&&G.resetTimeoutOnProgress)try{this._resetTimeout(I)}catch(Q){this._responseHandlers.delete(I),this._progressHandlers.delete(I),this._cleanupTimeout(I),X(Q);return}U(D)}_onresponse($){let v=Number($.id),D=this._requestResolvers.get(v);if(D){if(this._requestResolvers.delete(v),R4($))D($);else{let X=new R($.error.code,$.error.message,$.error.data);D(X)}return}let I=this._responseHandlers.get(v);if(I===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(v),this._cleanupTimeout(v);let U=!1;if(R4($)&&$.result&&typeof $.result==="object"){let X=$.result;if(X.task&&typeof X.task==="object"){let G=X.task;if(typeof G.taskId==="string")U=!0,this._taskProgressTokens.set(G.taskId,v)}}if(!U)this._progressHandlers.delete(v);if(R4($))I($);else{let X=R.fromError($.error.code,$.error.message,$.error.data);I(X)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,v,D){let{task:I}=D??{};if(!I){try{yield{type:"result",result:await this.request($,v,D)}}catch(X){yield{type:"error",error:X instanceof R?X:new R(C.InternalError,String(X))}}return}let U;try{let X=await this.request($,W1,D);if(X.task)U=X.task.taskId,yield{type:"taskCreated",task:X.task};else throw new R(C.InternalError,"Task creation did not return a task");while(!0){let G=await this.getTask({taskId:U},D);if(yield{type:"taskStatus",task:G},$6(G.status)){if(G.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:U},v,D)};else if(G.status==="failed")yield{type:"error",error:new R(C.InternalError,`Task ${U} failed`)};else if(G.status==="cancelled")yield{type:"error",error:new R(C.InternalError,`Task ${U} was cancelled`)};return}if(G.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:U},v,D)};return}let Q=G.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((J)=>setTimeout(J,Q)),D?.signal?.throwIfAborted()}}catch(X){yield{type:"error",error:X instanceof R?X:new R(C.InternalError,String(X))}}}request($,v,D){let{relatedRequestId:I,resumptionToken:U,onresumptiontoken:X,task:G,relatedTask:Q}=D??{};return new Promise((J,z)=>{let W=(F)=>{z(F)};if(!this._transport){W(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),G)this.assertTaskCapability($.method)}catch(F){W(F);return}D?.signal?.throwIfAborted();let Y=this._requestMessageId++,L={...$,jsonrpc:"2.0",id:Y};if(D?.onprogress)this._progressHandlers.set(Y,D.onprogress),L.params={...$.params,_meta:{...$.params?._meta||{},progressToken:Y}};if(G)L.params={...L.params,task:G};if(Q)L.params={...L.params,_meta:{...L.params?._meta||{},[a4]:Q}};let V=(F)=>{this._responseHandlers.delete(Y),this._progressHandlers.delete(Y),this._cleanupTimeout(Y),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:Y,reason:String(F)}},{relatedRequestId:I,resumptionToken:U,onresumptiontoken:X}).catch((E)=>this._onerror(Error(`Failed to send cancellation: ${E}`)));let S=F instanceof R?F:new R(C.RequestTimeout,String(F));z(S)};this._responseHandlers.set(Y,(F)=>{if(D?.signal?.aborted)return;if(F instanceof Error)return z(F);try{let S=s4(v,F.result);if(!S.success)z(S.error);else J(S.data)}catch(S){z(S)}}),D?.signal?.addEventListener("abort",()=>{V(D?.signal?.reason)});let B=D?.timeout??i3,N=()=>V(R.fromError(C.RequestTimeout,"Request timed out",{timeout:B}));this._setupTimeout(Y,B,D?.maxTotalTimeout,N,D?.resetTimeoutOnProgress??!1);let A=Q?.taskId;if(A){let F=(S)=>{let E=this._responseHandlers.get(Y);if(E)E(S);else this._onerror(Error(`Response handler missing for side-channeled request ${Y}`))};this._requestResolvers.set(Y,F),this._enqueueTaskMessage(A,{type:"request",message:L,timestamp:Date.now()}).catch((S)=>{this._cleanupTimeout(Y),z(S)})}else this._transport.send(L,{relatedRequestId:I,resumptionToken:U,onresumptiontoken:X}).catch((F)=>{this._cleanupTimeout(Y),z(F)})})}async getTask($,v){return this.request({method:"tasks/get",params:$},DD,v)}async getTaskResult($,v,D){return this.request({method:"tasks/result",params:$},v,D)}async listTasks($,v){return this.request({method:"tasks/list",params:$},GD,v)}async cancelTask($,v){return this.request({method:"tasks/cancel",params:$},c5,v)}async notification($,v){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability($.method);let D=v?.relatedTask?.taskId;if(D){let G={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[a4]:v.relatedTask}}};await this._enqueueTaskMessage(D,{type:"notification",message:G,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!v?.relatedRequestId&&!v?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let G={...$,jsonrpc:"2.0"};if(v?.relatedTask)G={...G,params:{...G.params,_meta:{...G.params?._meta||{},[a4]:v.relatedTask}}};this._transport?.send(G,v).catch((Q)=>this._onerror(Q))});return}let X={...$,jsonrpc:"2.0"};if(v?.relatedTask)X={...X,params:{...X.params,_meta:{...X.params?._meta||{},[a4]:v.relatedTask}}};await this._transport.send(X,v)}setRequestHandler($,v){let D=P9($);this.assertRequestHandlerCapability(D),this._requestHandlers.set(D,(I,U)=>{let X=M9($,I);return Promise.resolve(v(X,U))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,v){let D=P9($);this._notificationHandlers.set(D,(I)=>{let U=M9($,I);return Promise.resolve(v(U))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let v=this._taskProgressTokens.get($);if(v!==void 0)this._progressHandlers.delete(v),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,v,D){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let I=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,v,D,I)}async _clearTaskQueue($,v){if(this._taskMessageQueue){let D=await this._taskMessageQueue.dequeueAll($,v);for(let I of D)if(I.type==="request"&&e4(I.message)){let U=I.message.id,X=this._requestResolvers.get(U);if(X)X(new R(C.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(U);else this._onerror(Error(`Resolver missing for request ${U} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,v){let D=this._options?.defaultTaskPollInterval??1000;try{let I=await this._taskStore?.getTask($);if(I?.pollInterval)D=I.pollInterval}catch{}return new Promise((I,U)=>{if(v.aborted){U(new R(C.InvalidRequest,"Request cancelled"));return}let X=setTimeout(I,D);v.addEventListener("abort",()=>{clearTimeout(X),U(new R(C.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,v){let D=this._taskStore;if(!D)throw Error("No task store configured");return{createTask:async(I)=>{if(!$)throw Error("No request provided");return await D.createTask(I,$.id,{method:$.method,params:$.params},v)},getTask:async(I)=>{let U=await D.getTask(I,v);if(!U)throw new R(C.InvalidParams,"Failed to retrieve task: Task not found");return U},storeTaskResult:async(I,U,X)=>{await D.storeTaskResult(I,U,X,v);let G=await D.getTask(I,v);if(G){let Q=kv.parse({method:"notifications/tasks/status",params:G});if(await this.notification(Q),$6(G.status))this._cleanupTaskProgressHandler(I)}},getTaskResult:(I)=>{return D.getTaskResult(I,v)},updateTaskStatus:async(I,U,X)=>{let G=await D.getTask(I,v);if(!G)throw new R(C.InvalidParams,`Task "${I}" not found - it may have been cleaned up`);if($6(G.status))throw new R(C.InvalidParams,`Cannot update task "${I}" from terminal status "${G.status}" to "${U}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await D.updateTaskStatus(I,U,X,v);let Q=await D.getTask(I,v);if(Q){let J=kv.parse({method:"notifications/tasks/status",params:Q});if(await this.notification(J),$6(Q.status))this._cleanupTaskProgressHandler(I)}},listTasks:(I)=>{return D.listTasks(I,v)}}}}function $7($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function v7($,v){let D={...$};for(let I in v){let U=I,X=v[U];if(X===void 0)continue;let G=D[U];if($7(G)&&$7(X))D[U]={...G,...X};else D[U]=X}return D}var nK=kW(Oz(),1),xK=kW(iK(),1);function IT(){let $=new nK.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return xK.default($),$}class Ez{constructor($){this._ajv=$??IT()}getValidator($){let v="$id"in $&&typeof $.$id==="string"?this._ajv.getSchema($.$id)??this._ajv.compile($):this._ajv.compile($);return(D)=>{if(v(D))return{valid:!0,data:D,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(v.errors)}}}}class uz{constructor($){this._server=$}requestStream($,v,D){return this._server.requestStream($,v,D)}createMessageStream($,v){let D=this._server.getClientCapabilities();if(($.tools||$.toolChoice)&&!D?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if($.messages.length>0){let I=$.messages[$.messages.length-1],U=Array.isArray(I.content)?I.content:[I.content],X=U.some((z)=>z.type==="tool_result"),G=$.messages.length>1?$.messages[$.messages.length-2]:void 0,Q=G?Array.isArray(G.content)?G.content:[G.content]:[],J=Q.some((z)=>z.type==="tool_use");if(X){if(U.some((z)=>z.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!J)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(J){let z=new Set(Q.filter((Y)=>Y.type==="tool_use").map((Y)=>Y.id)),W=new Set(U.filter((Y)=>Y.type==="tool_result").map((Y)=>Y.toolUseId));if(z.size!==W.size||![...z].every((Y)=>W.has(Y)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:$},nv,v)}elicitInputStream($,v){let D=this._server.getClientCapabilities(),I=$.mode??"form";switch(I){case"url":{if(!D?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!D?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let U=I==="form"&&$.mode===void 0?{...$,mode:"form"}:$;return this.requestStream({method:"elicitation/create",params:U},L1,v)}async getTask($,v){return this._server.getTask({taskId:$},v)}async getTaskResult($,v,D){return this._server.getTaskResult({taskId:$},v,D)}async listTasks($,v){return this._server.listTasks($?{cursor:$}:void 0,v)}async cancelTask($,v){return this._server.cancelTask({taskId:$},v)}}function fK($,v,D){if(!$)throw Error(`${D} does not support task creation (required for ${v})`);switch(v){case"tools/call":if(!$.tools?.call)throw Error(`${D} does not support task creation for tools/call (required for ${v})`);break;default:break}}function _K($,v,D){if(!$)throw Error(`${D} does not support task creation (required for ${v})`);switch(v){case"sampling/createMessage":if(!$.sampling?.createMessage)throw Error(`${D} does not support task creation for sampling/createMessage (required for ${v})`);break;case"elicitation/create":if(!$.elicitation?.create)throw Error(`${D} does not support task creation for elicitation/create (required for ${v})`);break;default:break}}class JU extends b9{constructor($,v){super(v);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(iv.options.map((D,I)=>[D,I])),this.isMessageIgnored=(D,I)=>{let U=this._loggingLevels.get(I);return U?this.LOG_LEVEL_SEVERITY.get(D)<this.LOG_LEVEL_SEVERITY.get(U):!1},this._capabilities=v?.capabilities??{},this._instructions=v?.instructions,this._jsonSchemaValidator=v?.jsonSchemaValidator??new Ez,this.setRequestHandler(s0,(D)=>this._oninitialize(D)),this.setNotificationHandler(V9,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(F9,async(D,I)=>{let U=I.sessionId||I.requestInfo?.headers["mcp-session-id"]||void 0,{level:X}=D.params,G=iv.safeParse(X);if(G.success)this._loggingLevels.set(U,G.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new uz(this)};return this._experimental}registerCapabilities($){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=v7(this._capabilities,$)}setRequestHandler($,v){let I=zD($)?.method;if(!I)throw Error("Schema is missing a method literal");let U;if(V1(I)){let G=I;U=G._zod?.def?.value??G.value}else{let G=I;U=G._def?.value??G.value}if(typeof U!=="string")throw Error("Schema method literal must be a string");if(U==="tools/call"){let G=async(Q,J)=>{let z=s4(O6,Q);if(!z.success){let V=z.error instanceof Error?z.error.message:String(z.error);throw new R(C.InvalidParams,`Invalid tools/call request: ${V}`)}let{params:W}=z.data,Y=await Promise.resolve(v(Q,J));if(W.task){let V=s4(W1,Y);if(!V.success){let B=V.error instanceof Error?V.error.message:String(V.error);throw new R(C.InvalidParams,`Invalid task creation result: ${B}`)}return V.data}let L=s4(JD,Y);if(!L.success){let V=L.error instanceof Error?L.error.message:String(L.error);throw new R(C.InvalidParams,`Invalid tools/call result: ${V}`)}return L.data};return super.setRequestHandler($,G)}return super.setRequestHandler($,v)}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw 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 Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw 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 Error(`Server does not support tasks capability (required for ${$})`);break;case"ping":case"initialize":break}}assertTaskCapability($){_K(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;fK(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let v=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:J1.includes(v)?v:J9,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"},a0)}async createMessage($,v){if($.tools||$.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if($.messages.length>0){let D=$.messages[$.messages.length-1],I=Array.isArray(D.content)?D.content:[D.content],U=I.some((J)=>J.type==="tool_result"),X=$.messages.length>1?$.messages[$.messages.length-2]:void 0,G=X?Array.isArray(X.content)?X.content:[X.content]:[],Q=G.some((J)=>J.type==="tool_use");if(U){if(I.some((J)=>J.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!Q)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(Q){let J=new Set(G.filter((W)=>W.type==="tool_use").map((W)=>W.id)),z=new Set(I.filter((W)=>W.type==="tool_result").map((W)=>W.toolUseId));if(J.size!==z.size||![...J].every((W)=>z.has(W)))throw 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:$},O9,v);return this.request({method:"sampling/createMessage",params:$},nv,v)}async elicitInput($,v){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let I=$;return this.request({method:"elicitation/create",params:I},L1,v)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let I=$.mode==="form"?$:{...$,mode:"form"},U=await this.request({method:"elicitation/create",params:I},L1,v);if(U.action==="accept"&&U.content&&I.requestedSchema)try{let G=this._jsonSchemaValidator.getValidator(I.requestedSchema)(U.content);if(!G.valid)throw new R(C.InvalidParams,`Elicitation response content does not match requested schema: ${G.errorMessage}`)}catch(X){if(X instanceof R)throw X;throw new R(C.InternalError,`Error validating elicitation response: ${X instanceof Error?X.message:String(X)}`)}return U}}}createElicitationCompletionNotifier($,v){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},v)}async listRoots($,v){return this.request({method:"roots/list",params:$},j9,v)}async sendLoggingMessage($,v){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,v))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"})}}function gz(){return[{name:"getting_started",description:"Brief the LLM on what the Aether Wealth MCP exposes and the sign-in-first flow.",handler:()=>[{role:"user",content:{type:"text",text:["You are connected to the Aether Wealth MCP, which reads and updates the user's trading journal over an authenticated connection.","","Auth tools:"," • login — sign in. Opens the browser; the user authenticates and approves access. Call this first if a data tool reports the user is not signed in."," • logout — sign out on this device.","","Data tools:"," • list_trades — list the user's trades, filtered by account, status, pair, or date range."," • import_trades — import up to 500 trades into one account in a single call."," • delete_trade / delete_trades — permanently delete one trade or all matching trades on an account.","","Recommended flow:"," 1. Try the data tool the user asked for (e.g. list_trades).",' 2. If it reports "not signed in", call login, wait for the user to finish in the browser, then retry.'].join(`
|
|
86
|
-
`)}}]}]}function Rz(){return[]}function r($){return $}var XT='Not signed in to Aether Wealth. Call the "login" tool to authenticate, then retry.';async function c($){if(!await $.session.getAccessToken())throw Error(XT)}var yK={type:"integer",minimum:1,maximum:200,description:"Max rows to return"},lK={type:"integer",minimum:1,description:"Page number (1-indexed)"};function cD($,v){if(v===null||v===void 0){if($.required&&$.required.length>0)return{ok:!1,reason:`missing required: ${$.required.join(", ")}`};return{ok:!0,args:{}}}if(typeof v!=="object"||Array.isArray(v))return{ok:!1,reason:"args must be an object"};let D=v,I=GT($,D)??QT($,D);return I?{ok:!1,reason:I}:{ok:!0,args:D}}function GT($,v){for(let D of $.required??[])if(!(D in v)||v[D]===void 0||v[D]===null)return`missing required: ${D}`;return null}function QT($,v){if($.additionalProperties!==!1)return null;for(let D of Object.keys(v))if(!(D in $.properties))return`unknown property: ${D}`;return null}function Cz($){return{triggerType:$.triggerType??"close",isPersistent:$.isPersistent??!1,notifyEmail:$.notifyEmail??!0,notifyPush:$.notifyPush??!0,...$.message===void 0?{}:{message:$.message},...$.expiresAt===void 0?{}:{expiresAt:$.expiresAt}}}function hK($){return{...$.includeArchived===void 0?{}:{includeArchived:$.includeArchived},...$.pair===void 0?{}:{pair:$.pair}}}function JT($){return{id:$.id,...$.price===void 0?{}:{price:$.price},...$.price1===void 0?{}:{price1:$.price1},...$.price2===void 0?{}:{price2:$.price2},...$.time1===void 0?{}:{time1:$.time1},...$.time2===void 0?{}:{time2:$.time2},...$.condition===void 0?{}:{condition:$.condition},...$.triggerType===void 0?{}:{triggerType:$.triggerType},...$.timeframe===void 0?{}:{timeframe:$.timeframe},...$.isActive===void 0?{}:{isActive:$.isActive},...$.isArchived===void 0?{}:{isArchived:$.isArchived},...$.isPersistent===void 0?{}:{isPersistent:$.isPersistent},...$.notifyEmail===void 0?{}:{notifyEmail:$.notifyEmail},...$.notifyPush===void 0?{}:{notifyPush:$.notifyPush},...$.message===void 0?{}:{message:$.message},...$.expiresAt===void 0?{}:{expiresAt:$.expiresAt}}}function zT($){return{id:$.id,...$.condition===void 0?{}:{condition:$.condition},...$.dedupMode===void 0?{}:{dedupMode:$.dedupMode},...$.triggerType===void 0?{}:{triggerType:$.triggerType},...$.isActive===void 0?{}:{isActive:$.isActive},...$.isArchived===void 0?{}:{isArchived:$.isArchived},...$.isPersistent===void 0?{}:{isPersistent:$.isPersistent},...$.notifyEmail===void 0?{}:{notifyEmail:$.notifyEmail},...$.notifyPush===void 0?{}:{notifyPush:$.notifyPush},...$.message===void 0?{}:{message:$.message},...$.expiresAt===void 0?{}:{expiresAt:$.expiresAt}}}var iz={type:"string",enum:["above","below","crosses"]},zU={triggerType:{type:"string",enum:["close","wick"],description:"default: close"},isPersistent:{type:"boolean",description:"Re-arm after firing. default: false"},notifyEmail:{type:"boolean",description:"default: true"},notifyPush:{type:"boolean",description:"default: true"},message:{type:"string"},expiresAt:{type:"string",description:"ISO 8601 datetime"}},rK=[r({name:"list_alerts",description:"List your price + trendline alerts. Optionally include archived or filter by pair. Requires sign-in.",inputSchema:{type:"object",properties:{includeArchived:{type:"boolean"},pair:{type:"string"}},additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.alerts.list.query(hK($))}}),r({name:"create_price_alert",description:"Create a price-level alert (fires when price is above/below/crosses a level). Requires sign-in.",inputSchema:{type:"object",properties:{pair:{type:"string",description:"e.g. EURUSD, BTCUSD"},timeframe:{type:"string",description:"e.g. 1h, 4h, 1d"},price:{type:"number"},condition:iz,...zU},required:["pair","timeframe","price","condition"],additionalProperties:!1},handler:async($,v)=>{await c(v);let D={pair:$.pair,timeframe:$.timeframe,price:$.price,condition:$.condition,...Cz($)};return v.trpc.alerts.createPrice.mutate(D)}}),r({name:"create_trendline_alert",description:"Create a trendline alert (fires when price crosses a line defined by two points). Requires sign-in.",inputSchema:{type:"object",properties:{pair:{type:"string"},timeframe:{type:"string"},price1:{type:"number"},time1:{type:"string",description:"ISO 8601 datetime of point 1"},price2:{type:"number"},time2:{type:"string",description:"ISO 8601 datetime of point 2"},condition:iz,...zU},required:["pair","timeframe","price1","time1","price2","time2","condition"],additionalProperties:!1},handler:async($,v)=>{await c(v);let D={pair:$.pair,timeframe:$.timeframe,price1:$.price1,time1:$.time1,price2:$.price2,time2:$.time2,condition:$.condition,...Cz($)};return v.trpc.alerts.createTrendline.mutate(D)}}),r({name:"update_alert",description:"Update a price/trendline alert (e.g. change level, archive, mute). Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"},price:{type:"number"},price1:{type:"number"},price2:{type:"number"},time1:{type:"string"},time2:{type:"string"},condition:iz,timeframe:{type:"string"},isActive:{type:"boolean"},isArchived:{type:"boolean"},...zU},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.alerts.update.mutate(JT($))}}),r({name:"delete_alert",description:"Delete a price/trendline alert by id. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.alerts.delete.mutate({id:$.id})}}),r({name:"list_indicator_alerts",description:"List your indicator-based alerts. Optionally include archived or filter by pair. Requires sign-in.",inputSchema:{type:"object",properties:{includeArchived:{type:"boolean"},pair:{type:"string"}},additionalProperties:!1},handler:async($,v)=>{await c(v);let D=hK($);return v.trpc.alerts.indicator.list.query(D)}}),r({name:"create_indicator_alert",description:"Create an indicator alert (fires on an indicator output condition, e.g. RSI crosses 70). `condition` is { op, threshold } or { op, other }. Requires sign-in.",inputSchema:{type:"object",properties:{pair:{type:"string"},timeframe:{type:"string"},indicatorType:{type:"string",description:"e.g. rsi, ema, macd"},indicatorParams:{type:"object",description:"Indicator settings, e.g. { length: 14 }"},outputSeries:{type:"string",description:"Which output series to watch"},condition:{type:"object",description:"{ op: gt|gte|lt|lte|eq|crosses_above|crosses_below, threshold } or { op: *_series, other }"},dedupMode:{type:"string",enum:["edge","continuous"],description:"default: edge"},...zU},required:["pair","timeframe","indicatorType","indicatorParams","outputSeries","condition"],additionalProperties:!1},handler:async($,v)=>{await c(v);let D={pair:$.pair,timeframe:$.timeframe,indicatorType:$.indicatorType,indicatorParams:$.indicatorParams,outputSeries:$.outputSeries,condition:$.condition,dedupMode:$.dedupMode??"edge",...Cz($)};return v.trpc.alerts.indicator.create.mutate(D)}}),r({name:"update_indicator_alert",description:"Update an indicator alert (condition, dedup, archive, mute). Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"},condition:{type:"object"},dedupMode:{type:"string",enum:["edge","continuous"]},isActive:{type:"boolean"},isArchived:{type:"boolean"},...zU},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.alerts.indicator.update.mutate(zT($))}}),r({name:"delete_indicator_alert",description:"Delete an indicator alert by id. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.alerts.indicator.delete.mutate({id:$.id})}})];var mK=[r({name:"login",description:"Sign in to Aether Wealth. Opens your browser to authenticate; once you approve, the MCP stores a per-user token and the data tools become available.",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await v.session.login(),{status:"signed_in",message:"Signed in to Aether Wealth."}}}),r({name:"logout",description:"Sign out of Aether Wealth on this device. Clears the stored access token.",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await v.session.logout(),{status:"signed_out",message:"Signed out on this device."}}})];var K$=($,v,D,I)=>{return{id:$,displayName:`${$.slice(0,3)}/${$.slice(3)}`,kind:"forex",exchange:"FX",region:"GLOBAL",category:D,pipSize:I?.pipSize??0.0001,priceDecimals:I?.priceDecimals??5,contractSize:1e5,providers:{twelvedata:v}}},WT=[K$("AUDUSD","AUD/USD","Forex Majors"),K$("EURUSD","EUR/USD","Forex Majors"),K$("GBPUSD","GBP/USD","Forex Majors"),K$("USDCAD","USD/CAD","Forex Majors"),K$("USDCHF","USD/CHF","Forex Majors"),K$("USDJPY","USD/JPY","Forex Majors",{pipSize:0.01,priceDecimals:3}),K$("AUDCAD","AUD/CAD","Forex Minors"),K$("AUDCHF","AUD/CHF","Forex Minors"),K$("AUDJPY","AUD/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),K$("AUDNZD","AUD/NZD","Forex Minors"),K$("EURAUD","EUR/AUD","Forex Minors"),K$("EURCAD","EUR/CAD","Forex Minors"),K$("EURCHF","EUR/CHF","Forex Minors"),K$("EURGBP","EUR/GBP","Forex Minors"),K$("EURJPY","EUR/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),K$("EURNZD","EUR/NZD","Forex Minors"),K$("GBPAUD","GBP/AUD","Forex Minors"),K$("GBPCAD","GBP/CAD","Forex Minors"),K$("GBPCHF","GBP/CHF","Forex Minors"),K$("GBPJPY","GBP/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),K$("GBPNZD","GBP/NZD","Forex Minors")],YT=[{id:"XAUUSD",displayName:"Gold",kind:"metal",exchange:"OTC",region:"GLOBAL",category:"Metals",pipSize:0.01,priceDecimals:2,contractSize:100,providers:{twelvedata:"XAU/USD"}},{id:"XAGUSD",displayName:"Silver",kind:"metal",exchange:"OTC",region:"GLOBAL",category:"Metals",pipSize:0.001,priceDecimals:3,contractSize:5000,providers:{twelvedata:"XAG/USD"}}];function u$($,v,D=!1){return{id:$,displayName:`${$.slice(0,-3)}/USD`,kind:"crypto",exchange:"CRYPTO",region:"GLOBAL",category:"Crypto",pipSize:D?0.0001:0.01,priceDecimals:D?5:2,contractSize:1,providers:{twelvedata:v}}}var LT=[u$("BTCUSD","BTC/USD"),u$("ETHUSD","ETH/USD"),u$("SOLUSD","SOL/USD"),u$("BNBUSD","BNB/USD"),u$("AVAXUSD","AVAX/USD"),u$("LINKUSD","LINK/USD"),u$("LTCUSD","LTC/USD"),u$("BCHUSD","BCH/USD"),u$("ATOMUSD","ATOM/USD"),u$("TONUSD","TON/USD"),u$("DOTUSD","DOT/USD"),u$("XRPUSD","XRP/USD",!0),u$("ADAUSD","ADA/USD",!0),u$("DOGEUSD","DOGE/USD",!0),u$("TRXUSD","TRX/USD",!0),u$("POLUSD","POL/USD",!0)],VT=[{id:"NAS100",displayName:"Nasdaq 100",kind:"index",exchange:"NASDAQ",region:"US",category:"Indices",pipSize:0.01,priceDecimals:2,contractSize:20,providers:{twelvedata:"QQQ"}}],BT=[{id:"USOIL",displayName:"WTI Crude",kind:"commodity",exchange:"NYMEX",region:"US",category:"Commodities",pipSize:0.01,priceDecimals:2,contractSize:1000,providers:{twelvedata:"WTI/USD"}}];function M4($,v,D){return{id:$,displayName:D,kind:"stock",exchange:"NSE",region:"IN",category:"Indian Stocks",pipSize:0.05,priceDecimals:2,contractSize:1,providers:{twelvedata:v}}}var KT=[{id:"NIFTYBEES",displayName:"NIFTY 50 ETF",kind:"index",exchange:"BSE",region:"IN",category:"Indian Indices",pipSize:0.01,priceDecimals:2,contractSize:1,providers:{twelvedata:"NIFTYBEES:BSE"}},{id:"BANKBEES",displayName:"BANK NIFTY ETF",kind:"index",exchange:"BSE",region:"IN",category:"Indian Indices",pipSize:0.01,priceDecimals:2,contractSize:1,providers:{twelvedata:"BANKBEES:BSE"}},M4("RELIANCE","RELIANCE:NSE","Reliance Industries"),M4("TCS","TCS:NSE","Tata Consultancy Services"),M4("HDFCBANK","HDFCBANK:NSE","HDFC Bank"),M4("INFY","INFY:NSE","Infosys"),M4("ICICIBANK","ICICIBANK:NSE","ICICI Bank"),M4("BHARTIARTL","BHARTIARTL:NSE","Bharti Airtel"),M4("LT","LT:NSE","Larsen & Toubro"),M4("SBIN","SBIN:NSE","State Bank of India"),M4("AXISBANK","AXISBANK:NSE","Axis Bank"),M4("KOTAKBANK","KOTAKBANK:NSE","Kotak Mahindra Bank")],dD=Object.freeze([...WT,...YT,...LT,...VT,...BT,...KT]);class WU{byKey;instruments;providerNames;constructor($){this.instruments=Object.freeze([...$]);let v=new Map,D=new Set;for(let I of $){if(nz(v,I.id,I,"id"),I.displayName!==I.id)nz(v,I.displayName,I,"displayName");for(let[U,X]of Object.entries(I.providers))if(D.add(U),nz(v,cK(U,X),I,"provider"),!v.has(X))v.set(X,I)}this.byKey=v,this.providerNames=D}resolve($){let v=this.byKey.get($);if(v)return v;let D=$.toUpperCase();if(D!==$){let U=this.byKey.get(D);if(U)return U}let I=$.toLowerCase();if(I!==$)return this.byKey.get(I)??null;return null}require($){let v=this.resolve($);if(!v)throw Error(`Unknown instrument: ${JSON.stringify($)}. Add it to INSTRUMENTS env var or check the key you passed in.`);return v}resolveByProvider($,v){return this.byKey.get(cK($,v))??null}list(){return this.instruments}byKind($){return this.instruments.filter((v)=>v.kind===$)}byExchange($){return this.instruments.filter((v)=>v.exchange===$)}byRegion($){return this.instruments.filter((v)=>v.region===$)}byCategory($){return this.instruments.filter((v)=>v.category===$)}groupByCategory(){let $=new Map;for(let v of this.instruments){let D=$.get(v.category);if(D)D.push(v);else $.set(v.category,[v])}return Array.from($.entries()).map(([v,D])=>({category:v,instruments:D}))}has($){return this.byKey.has($)}stats(){return{instrumentCount:this.instruments.length,providerCount:this.providerNames.size,providers:Array.from(this.providerNames).sort()}}}function cK($,v){return`${$}:${v}`}function nz($,v,D,I){if(I==="provider"){if($.has(v))throw Error(`Duplicate provider symbol ${JSON.stringify(v)} declared by multiple instruments in INSTRUMENTS`)}else if($.has(v))throw Error(`Duplicate instrument ${I} ${JSON.stringify(v)} in INSTRUMENTS (already mapped to ${$.get(v)?.id}, now also to ${D.id})`);$.set(v,D)}var ZT=["forex","metal","crypto","index","commodity","stock","bond"],AT=h.object({kind:h.enum(ZT),displayName:h.string().min(1).optional(),exchange:h.string().min(1).optional(),region:h.string().min(1).optional(),category:h.string().min(1).optional(),pipSize:h.number().positive().optional(),priceDecimals:h.number().int().min(0).max(12).optional(),contractSize:h.number().positive().optional(),providers:h.record(h.string().min(1),h.string().min(1))}),ty=h.record(h.string().min(1),AT).refine(($)=>Object.keys($).length>0,{message:"INSTRUMENTS must contain at least one entry"});var HT=Object.freeze({AUDUSD:{quote:"https://logo.twelvedata.com/forex/usd.png",base:"https://logo.twelvedata.com/forex/aud.png"},EURUSD:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/usd.png"},GBPUSD:{quote:"https://logo.twelvedata.com/forex/usd.png",base:"https://logo.twelvedata.com/forex/gbp.png"},USDCAD:{base:"https://logo.twelvedata.com/forex/usd.png",quote:"https://logo.twelvedata.com/forex/cad.png"},USDCHF:{base:"https://logo.twelvedata.com/forex/usd.png",quote:"https://logo.twelvedata.com/forex/chf.png"},USDJPY:{base:"https://logo.twelvedata.com/forex/usd.png",quote:"https://logo.twelvedata.com/forex/jpy.png"},AUDCAD:{base:"https://logo.twelvedata.com/forex/aud.png",quote:"https://logo.twelvedata.com/forex/cad.png"},AUDCHF:{base:"https://logo.twelvedata.com/forex/aud.png",quote:"https://logo.twelvedata.com/forex/chf.png"},AUDJPY:{base:"https://logo.twelvedata.com/forex/aud.png",quote:"https://logo.twelvedata.com/forex/jpy.png"},AUDNZD:{base:"https://logo.twelvedata.com/forex/aud.png",quote:"https://logo.twelvedata.com/forex/nzd.png"},EURAUD:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/aud.png"},EURCAD:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/cad.png"},EURCHF:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/chf.png"},EURGBP:{quote:"https://logo.twelvedata.com/forex/gbp.png",base:"https://logo.twelvedata.com/forex/eur.png"},EURJPY:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/jpy.png"},EURNZD:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/nzd.png"},GBPAUD:{base:"https://logo.twelvedata.com/forex/gbp.png",quote:"https://logo.twelvedata.com/forex/aud.png"},GBPCAD:{base:"https://logo.twelvedata.com/forex/gbp.png",quote:"https://logo.twelvedata.com/forex/cad.png"},GBPCHF:{quote:"https://logo.twelvedata.com/forex/chf.png",base:"https://logo.twelvedata.com/forex/gbp.png"},GBPJPY:{base:"https://logo.twelvedata.com/forex/gbp.png",quote:"https://logo.twelvedata.com/forex/jpy.png"},GBPNZD:{base:"https://logo.twelvedata.com/forex/gbp.png",quote:"https://logo.twelvedata.com/forex/nzd.png"},BTCUSD:{base:"https://logo.twelvedata.com/crypto/btc.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},ETHUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/eth.png"},SOLUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/sol.png"},BNBUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/bnb.png"},AVAXUSD:{url:"https://assets.coingecko.com/coins/images/12559/large/Avalanche_Circle_RedWhite_Trans.png"},LINKUSD:{base:"https://logo.twelvedata.com/crypto/link.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},LTCUSD:{base:"https://logo.twelvedata.com/crypto/ltc.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},BCHUSD:{base:"https://logo.twelvedata.com/crypto/bch.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},ATOMUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/atom.png"},TONUSD:{url:"https://assets.coingecko.com/coins/images/17980/large/ton_symbol.png"},DOTUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/dot.png"},XRPUSD:{base:"https://logo.twelvedata.com/crypto/xrp.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},ADAUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/ada.png"},DOGEUSD:{base:"https://logo.twelvedata.com/crypto/doge.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},TRXUSD:{base:"https://logo.twelvedata.com/crypto/trx.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},POLUSD:{url:"https://assets.coingecko.com/coins/images/4713/large/polygon.png"},RELIANCE:{url:"https://api.twelvedata.com/logo/ril.com"},TCS:{url:"https://api.twelvedata.com/logo/tcs.com"},HDFCBANK:{url:"https://api.twelvedata.com/logo/hdfcbank.com"},INFY:{url:"https://api.twelvedata.com/logo/infosys.com"},ICICIBANK:{url:"https://api.twelvedata.com/logo/icicibank.com"},BHARTIARTL:{url:"https://api.twelvedata.com/logo/airtel.in"},LT:{url:"https://api.twelvedata.com/logo/larsentoubro.com"},SBIN:{url:"https://api.twelvedata.com/logo/sbi.co.in"},AXISBANK:{url:"https://api.twelvedata.com/logo/axisbank.com"},KOTAKBANK:{url:"https://api.twelvedata.com/logo/kotak.com"}});function xz($,v){return Number(v.toFixed($.priceDecimals))}var g$="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif",fz=11,_z=15,yz=11,lz=13,dK=12,tD=17,tK=26,pK=0.85,oK=20,aK=8,eK=64,sK=26,q1=18,pD=16,$N=20,vN=300,hz=120,UN=1280,DN=720,IN=2,XN=!0,GN=320,QN=2560,JN=240,zN=1440,WN=1,YN=3,oD={dark:{background:"#0F0F0F",text:"#D9D9D9",mutedText:"#8A8D96",grid:"rgba(242, 242, 242, 0.06)",axisBorder:"#2B2B43",upCandle:"#10b981",downCandle:"#ef4444",markerText:"#F2F2F2",headerText:"#E8E8EA",badgeBg:"rgba(255, 255, 255, 0.08)",badgeText:"#A6AAB4",watermarkText:"#D9D9D9",tagText:"#FFFFFF",entryTag:"#363C4E"},light:{background:"#FFFFFF",text:"#191919",mutedText:"#6A6E78",grid:"rgba(0, 0, 0, 0.06)",axisBorder:"#E0E3EB",upCandle:"#10b981",downCandle:"#ef4444",markerText:"#191919",headerText:"#131722",badgeBg:"rgba(0, 0, 0, 0.06)",badgeText:"#5F6470",watermarkText:"#191919",tagText:"#FFFFFF",entryTag:"#68707F"}},rz=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function LN($,v){if(!Number.isFinite(v))return"0.00000";if(!$)return v.toFixed(5);return xz($,v).toFixed($.priceDecimals)}function VN($,v,D){let I=new Date(v*1000);if(wT($)){if(D===void 0||qT(D,v))return MT(I);return PT(I)}return bT(I)}function wT($){let v=$.trim();if(v.length===0)return!0;if(/^\d*[DWM]$/.test(v))return!1;if(/(d|w|mo|month)/i.test(v))return!1;return!0}function YU($,v,D){let U=`${$>0?"+":""}${$.toFixed(D)}`;if(v===null||!Number.isFinite(v))return U;let X=v>0?"+":"";return`${U} (${X}${v.toFixed(2)}%)`}function PT($){return`${aD($.getUTCHours())}:${aD($.getUTCMinutes())}`}function MT($){return`${aD($.getUTCDate())} ${rz[$.getUTCMonth()]}`}function bT($){return`${aD($.getUTCDate())} ${rz[$.getUTCMonth()]} '${String($.getUTCFullYear()).slice(-2)}`}function qT($,v){let D=new Date($*1000),I=new Date(v*1000);return D.getUTCFullYear()!==I.getUTCFullYear()||D.getUTCMonth()!==I.getUTCMonth()||D.getUTCDate()!==I.getUTCDate()}function aD($){return String($).padStart(2,"0")}var BN="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAARw0lEQVR4nN1bd1hU17af/BUHYShKmRmGmYGhg7ShM/Q+9F6GIkgNvfeOgDQVkFjBhsZo1Ch2Rb1G7MZoLDHN3HuTl7ybe/Ni/rj3vu+7v/edM8NQBAUdMHnn+9Y3cObM2Wv99m+tvfbae1Mor77ekVOkW1EV6E1UBfoYlUZ/LKfA+E2OxsDvShQYv1FpjEekjgr0RjlFuuU8bHvp9c4yGiNKjkZ/8taNe00hOotKY0YQtlAWcr1LY+nIKdCvv20DZMcO+vi7iurceRm/TJ7uRKUxfnzrSsueDX9brsh0f6nxyxWZbnI0+r/ftrKLJ/R/LZPXcJmd9orqXCqN8dOioK9An6kI5BWZb40J79I0eTPtf2cxfV5eiQm6pi54uibg8kxAU9GSArH8rQBBvzotMC6jMaIXq9fllTRhaLgKkWG+yMuIRm1BIlpr0pEQFwkW24h8ZrmiWJaUCYoa4ZO9vwhD3QQAiiosKChrQpOlA29XO8QEuqIg2R+bWzOwb1MVUpLioaLGlTJlyQCgMR6R1lNpGvxFb0wChqo6B86OthCF+SIl0g31WQE4uq0cw4N14Ns4StiwpC5hQaEq0JuXwvjJ/zWgw+PBy8UGEf72WBPuhIG6GFw8tBYZaUmS52YGzUlxcrCDvq6+rHRrIAAYWyoGEMLVNYMwMBwVZWWoKstHXroIWXEeaM31wrXDDehqzYOKmvacbPB0toY+T0c2esnTz1PkFOhfLAXdiMgfn5CCgf5+7Nm1E/tGduPQhx/g+LEjODAyhLbKTDRkumP8gzyMbK4Gi2O06C5BpdEfU+QUGM8X23illRzk5hehr28DWpoa0dHehg29Pdi6ZRNG9uzE6PGjuHL5Ao7s24yukmCc2CTC0IYicHVNXgBhuSx1U2A8pywF9dOz3kNrSzPKSorR1FCPzo529G/cgG1bNmPv7l04dHA/To4exe3r1zF+cRTrKyMxUOaD3uYM8PRNJSAsjo6Uxe79sIg4VFVVIicnG+Xlpaivq8Ha1mb0dHdicFM/dg3vwMED+0lXOHtqFLdvXseDu+PY2pKEqmQ7NFUkgcUxXDT9KItpPN/GBQUF+UhKTkRWdiYKiwpQUVmOxvo6dLStxcb1PSQL9u3dgyMfHcK5Mydx9U8X8PDze/jy8S205YciQWiJ0vcioUbn/rEA0GDqYXVKKmJjY5GYmIj09HTk5OSgqKgI1VVVaG5qRE9XJwYH+jE8tAMfHTyAM6dHMX7lEu7eHMdXX36Bp/fHkRRsDz9nM8THCMmEava5xe8QAB+/INL48PAIxMfHIzk5mQQhLy8PZWWlqKurQTvJgl4JC3bj+PGj+OTyGD69dQOf37uLv/33Dzh2aARUeXWYmZsj0N/5j8EAQ2M+oqOj4evri5CQEPJvAoSUlBRkZ2ejqKgQ1dWVaG5uRDcRCwb6sZNkwYe4dPE87ty+js8ffIrHD+/jHz//hPSMbPK97q52sLIw+30CQJXQkhjvvX384e3tDS8vLwQGBiI8PBwxMTFISkpCRkYG8vPzUEnEgsZ6rFsnHhF2bNuKgwc+wOmTx3H1k0u4d/cWHn7+Gf783Td4+sUj6BtZke/39XAEnSmJBzJwBYqse9/U3BY+Pj5wdnYmAfD39ydZEBUVhYSEBKSnpSMvPw/lFWWor69FW7vYDba8P0gOiUePHMLYhTO4dXOcBODJowd4/uvfMbh5K/l+JosHB77l74sBVElPqKhx4OruAUeBAAJnZ3h4eJBuEBQUhMjISCQkiINhbm4uSkvFcaBtbSt6e7rIIXF4x3Yc2L8Pp06MYvyTK/js0zt49Og+vv7qCf7r+7/AycVHDLKRCTgc3Rl60F8rQFJk2ftGplZwcnaGja0tHJ0c4ebmBj8/PwQECBEcHIzw8DDEx8UhIz0dBfn5KC0pRk1NFTkk9m1cj+3btmBkz24cPnQQ586cxvVrV/Hg/qd4/Og+fv3lZ2zbvoNsR2kFC4b6RjLJCimyMn6lujYcHBxhbWcDG1sbODk5keLg6Ah/YQA5BG4aHMDxY0dx+eIYbt+8gRvXxnHu7GmM7N2N9zcNYFN/H4a2b8O+kb34+MhHuDR2HnduXSfzgmfffknGA3MrJ7EraPKgrsGRts9k66OpLBZ62uy3A4CRkTns7e1hbWMDO3s7WPP5EAqFaG1twcULp/H44V08uH8HDz67i/uf3cXDR/fx7NnXeP78F/zvv/+JH3/4HufPniEBGB7ajg8P7MeJ0WO4cvmi2BUeimNBbV0j2R5NmQUlFU1pINRk6yE11BJs5sS8gb50AKxQ48LewRGODvawt+HDy8MDjbXVOHVsBKeO70RnezXWpIhId3BxdYGzswDu7m4IDAxAdnYmurvW4cqfLuOXf/wd3337DZkVEsmRODs8jWtXP8G9u7fx/V+/w6VLY1MqR/Q3TooosgDA1MQS3p5u8HRzRFZqInZu7sTWjbVITQyDvZ01LCwsYWHFh429Hdw8PeBLxoUAkiFe3l7w9HRHYKAQFRXlJBA//PUvOHvmFDltPnb0CC6cP0vGAyIWPPv2Kewc3KSzxAkAZn4uGQCqGlwE+LkjOswPDaVp6GsvRGKcENbWVrCzIwKhB7y8PCEMCEB4RAR8/YSwsnGEtq4pGCx9MLUMwNY2hL6hGVaZWUDo74udw0N49s3XOH3yBPaP7MHJ0eO4fPECbty4hp9+/DMys7LEzFPnkAa/CQsobwoAEfjKs2Owvn41St+LhrOTAxydnMUJUFgYIiIikZaWhsioGBivsoHiiomS+HSZMGKlOhf6BqZY19GGL58+wdHDH5EJ0tnTJ3H50hieffMUfRt7yGe1uEZQZ/Beq+dlAoAm2wANxYnYsjYJSTF+cHZxRWhoKFJSkpCamoKMjHRUVlbAxy8YCsqsV75vam+qaXDQ29uD+/fukgnSsaOHce7MKTJFPjF6iHxGg8mDm4fX0gOwXFKcyFwdgeGuNESH+iMwMASZ6WtQXFyI4uIiVFSUobNrHRwEnrP29MvfLw5ydKYO2fvE6LB71zBGj32MG9ev4fLFk1CXTI+9fXykMWFJAFguMd7MzAw7egqQGBsKUXwcykuL0VBfS1Z8WluasG/vXghcfclniWWwhfYQsaBCfDo5e+HK5UvYvXOYLJxcGruAK2MnwNM1Jr/X0TNGYlIi2DqmS8cAFTVttNXnovC9ZORkp6G5sR5trS3o7lxHzvGJoStpdfo0Q15XCOC6uroxeuwomSqfOnECF899DAPDyVIZEWjDwqNmZ9grgKcsTCHxy0qLs9BcU4SinEx0tjWjp6sLgwN9GOjbgLEL59DXt0lK5TeJ0BOu4OcfRgKwZfMgjhz+CKMf7yN7fuI5HV0TpKamwlEgjgcTQJBsJdp/iQ6UhSojEsWht6MOpbmZ6O1oRt+GXmx+fxCbBzfh8KEPcfv2TZiY2U37zZsKMVTuHN4pLpzs24uDH+wCgzm5NqCsyoarqxtWr04FU2uyfqhB54AxMXWeIzOkzM948aetnQAbu5pQXpSP7rY6bOzpJosZhGLbt27F0yeP0NLSIRPqT3MDGgOta9uweXAAQ0PbsWtoEMtnGMTi6JMVqIDA8Gn3LcxNwX5h5rgAAKgS+iirctFQW4j6mgqsba5FT+da9PZ0o79vA/o3rifH66++fAq+3WSWJhPjJe1XVNRgfU83OVdoaqx84XtibiAQuJA5h6GJtfR7VTU2gn1dXx+A5RJDIqMi0Lm2BlVVZWhrqUd7aws62teiq7MDvd3duHl9HAc+OPDaKemrACgoLEZbayuGtg0iQRQtYdl0kM0srMm6Q3hEzLT7Xq6OMDYymT8Ay2es13N5xmhuKENZaTGqq8pQX1uOutoqNNTVorGhDut7u3H3zi0UFpVL6S/rJa28vEI01Nfj/Q3t4FvZzsoytrYROeESiUSw5Auk9y0tLeHsZDd/APT1DaGrayD9PzEhGtWVJcjLyUVJUSFKiwkpQmlpMUqKC7Ghtxu3blyDrzBMqhixL0BWxtNZBigvr0BNdSWaaormZAnBCBtbe7L+KEpIlgJkaWmF4AD3+QNAnUJfXX1TlJfkIC01FZkZacjOykBWZgayszKRlZVB3hvo30gWMy2moK6qzobyCtYbucOEAbYOrigoKERLYyX8/bxn7f0JYXEMyBIcUXozs3Qg79nb2sLHQzB/AOSmSEiQEFnpaxAXH4vkpASsTkokKUYUOOPjRUhMEJE5+/DQVugZWEh/p7xCE1wO742qtxPARccmIDcnF2XFWdLJ1Iv7DiQ7Ulaw4OrqjnhRPDkBI+4F+7rAhm+1cADUGNqIjwtDaGgIQsPCEBUVidiYaISGEvfCEBQUTH7X0NiATf09JFum9o7VKhOwtF5vLX/iHabmdkhLz0RNRSH41hLff8VvjYwtEBkRjpTkZOjorkJKrBAr1dgLB8Dc3Aox0WHiAoZQiKDgYLLEHRAYQE53iYIGQbeSkjJ0r2uBkan5NOUZDA7C/QRQkOQE8y1iTvxenamL2PgklBVkI8hfXBGej7C5hggJCkR0VDRyMuPh4yF2hQUDIBC4QCBwhrm5NRlcPDw8wbe2h6GJOZl+anEMYGxigcTE1ejuaIaNjY3UgAljPQV85CSHQI42mRjNXOqeLUao0nkIDY9CYUE2fL08FuQyKqpseHp6IS05Dk0lcVBeqblwAJRXakFP31Q61hILk3RNHrnfb6bSXt7+qK0pQ4CvJAma8a68ZCFaiqPA5hi8NChO3NfRNSNjTGpqIqwsxaAuBABCZx9fTxStCYIt3xIK0n2JCwFAlUMaPLOBabs1JH/rGVoiI30NkkUh0w2UZmma6CiLxJYWEYJ9BeDzLcHVNpS6BhHYiHzfxMwaoSEhSE2Oh4+nJ+isuVPYWV1H8qmixkZssAAGPB609UyhxTVYOAAr1LlQZ+hMq9TMHXm14Ovnj8yUGOjyZt/BtUKNjY7qeAw2xkDoYgVvdwGiQv3g4+WOAH8fRIQFITDADzY2tmBoTra7EAAIoTO4ELpagcsWT4IMjMyhzTNeOACKKiworWTPWxEdPRPERocjwMtpTnoSZbHmqmQ0VcRBSTKcqahqQYOhDRpR41+gsUQsmaqbuYkhIn35MNabZI7JKkuy6DonAFQFxq+zf0lf8JZYjo4RhJ4C6OnNTTlCEkWBOLSnGqIY/xcCIk2ys3SqkURFiXA3BSUiuE7Xi2h3lZE+RAF8JAQ6gK2lPbkhW4lJrkEwWHpz6M74H4qst8kSBjjbWWGl2uSG6KmgTgRVI2NT7NlajWtnNqKiKBm6eqbzpjxhtIGeHoI8rJEV44QCkTO8Hc2xQlXc5gSoDBYP9vaOc2aNVGK7LFWBfkFWxk8EIVV1LVhbmEJxji0tUxUKEnrj+th2/PPnq7h1aSvaGrKQtjoaaaJQJEf7IiLYA36+roiL9MKaBG9U5gShozgQ7fmeaMz0RLSPJQymUH6qaLH1ydT4pRslqcQBIxkyYKLH1TTYMDY0gqLEt2fr3UkgmOSCyNkjG/Cf387iP7/sxvP7bfj6QiXuHC7B5T25ODaQgP3tYegr80NRrANi/CywylAXNGnhZXqQJuoDRKXoFayqoxCnq2QLwPRcgsvVlYIwO52ZL6SxhVnROLItH1f2rMH5wViMNAegM8cF5QkOSAnkI9LbCj6OZlipJplxSowkYoSyKguqGpw55wzTRIlpRm6XJ4/CyRoAScOEPyqteHWEf3GrvCYMDM0Q5O+OjMQAlGcEoWi1Jynp0QLECK3hZG0CcxMTMugyNLXJxRRlSRx4lfFUGuOh9MAEcbRsMRjwOut2hFvMdW6AGB00mDpgsXnQ4miDweRAjc4RM2zGkPiqdqny9NCZR2bGF8sV3qQ8RoAxMd6/0qj5Aq7AuPLCWcJ3FdU5i3VoavFk4QwTH5pi6cxxZlDDhTha9vYNWzTA/rVMni546dnBZfJ0x//HByfdXmr81DOExNGyt620zESBcYVwccoCr3eIo2VEuvjH7XXGQ6q8RhjlTS85GsOCOGBEpI4kIEtwyuQ1evk5eXxenn5ejsaol1NkmM/HuP8DM+9LH586V+cAAAAASUVORK5CYII=";function KN($){return $.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Y$($){return`<line${k1($)} />`}function H$($){return`<rect${k1($)} />`}function t$($,v){return`<text${k1(v)}>${KN($)}</text>`}function NN($){return`<image${k1($)} />`}function ZN($,v){let D=$.map((I)=>`${mz(I.x)},${mz(I.y)}`).join(" ");return`<polygon${k1({...v,points:D})} />`}function o($,v={}){if($.length===0)return"";return`<g${k1(v)}>${$}</g>`}function AN($,v,D){return[`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${v}" viewBox="0 0 ${$} ${v}" fill="none">`,D,"</svg>"].join("")}function S1($,v=11){return Math.max(10,Math.round($.length*v*0.58))}function k1($){let v=Object.entries($).filter(([,D])=>D!==void 0&&D!==!1).map(([D,I])=>{if(I===!0)return`${D}="true"`;if(typeof I==="number")return`${D}="${mz(I)}"`;if(typeof I==="string")return`${D}="${KN(I)}"`;return""}).filter((D)=>D.length>0).join(" ");return v.length>0?` ${v}`:""}function mz($){let v=Math.round($*100)/100;return Number.isInteger(v)?String(v):v.toFixed(2)}var eD=16,ST=9,kT=12,TT=8,ET=8;function HN($,v){let D=[],I=$.plotLeft,U=$.instrument?.displayName??$.pair;D.push(t$(U,{x:I,y:eD,fill:v.headerText,"font-size":_z,"font-weight":700,"letter-spacing":0.2,"font-family":g$})),I+=S1(U,_z)+ST;let X=$.timeframe,G=S1(X,yz)+ET*2,Q=eD-tD+4;D.push(H$({x:I,y:Q,width:G,height:tD,rx:4,fill:v.badgeBg})),D.push(t$(X,{x:I+G/2,y:Q+tD/2+0.5,fill:v.badgeText,"font-size":yz,"font-weight":600,"text-anchor":"middle","dominant-baseline":"middle","font-family":g$})),I+=G+kT;let J=$.visibleCandles,z=J[J.length-1].close,W=J[0].open,Y=z-W,L=W===0?null:Y/W*100,V=Y>=0?v.upCandle:v.downCandle,B=$.formatPrice(z);D.push(t$(B,{x:I,y:eD,fill:V,"font-size":lz,"font-weight":600,"font-family":g$})),I+=S1(B,lz)+TT;let N=$.instrument?.priceDecimals??5;return D.push(t$(YU(Y,L,N),{x:I,y:eD,fill:V,"font-size":dK,"font-weight":500,"font-family":g$})),o(D.join(""))}function FN($,v){if(!v)return"";let D=tK;return NN({href:BN,x:$.plotRight-D-8,y:$.plotBottom-D-8,width:D,height:D,opacity:pK})}var uT=["price","priceHigh","priceLow","price1","price2","entry","stop","target"];function jN($,v){let D=$.candles.slice(-$.bars),I=aK,U=oK,X=Math.max(I+1,$.width-eK),G=Math.max(U+1,$.height-sK),Q=X-I,J=G-U,z=Q/Math.max(1,D.length),W=Math.min(...D.map((a)=>a.low)),Y=Math.max(...D.map((a)=>a.high)),L=Y-W,V=L>0?L*0.06:Math.max(Math.abs(Y)*0.006,0.000001),B=W-V,N=Y+V,A=Math.max(N-B,0.000001),F=L>0?Math.max(A,L/0.6):A,S=nT($.shapes),E=S.length>0?Math.min(...S):Number.POSITIVE_INFINITY,g=S.length>0?Math.max(...S):Number.NEGATIVE_INFINITY,k=Number.isFinite(E)&&E<B?B-E:0,N$=Number.isFinite(g)&&g>N?g-N:0,O$=Math.max(0,F-A),k4=k+N$,Q4=B,_$=N;if(k4<=O$)Q4-=k,_$+=N$;else if(k>0&&N$===0)Q4-=Math.min(k,O$);else if(N$>0&&k===0)_$+=Math.min(N$,O$);else if(k4>0){let a=O$/k4;Q4-=k*a,_$+=N$*a}let C1=Math.max(_$-Q4,0.000001),i1=yT(D),n1=D.length-1;function ZU(a){return U+(_$-a)/C1*J}function UA(a){if(!Number.isFinite(a))return{y:G,clamped:!0,edge:"bottom"};if(a>_$)return{y:U,clamped:!0,edge:"top"};if(a<Q4)return{y:G,clamped:!0,edge:"bottom"};return{y:ZU(a),clamped:!1,edge:null}}function LI(a){return I+(a+0.5)*z}function PW(a){return iT(D,n1,i1,a)}function MW(a){return LI(PW(a))}function bW(a){return n1-a}function DA(a,qW,GA){let SW=fT(a,qW);if(SW!==void 0)return MW(SW);let QA=_T(a,qW)??GA;return LI(bW(QA))}function IA(a=6){return gT(Q4,_$,a)}function XA(a=7){return CT(D.length,a)}return{pair:$.pair,timeframe:$.timeframe,theme:$.theme,width:$.width,height:$.height,plotLeft:I,plotTop:U,plotRight:X,plotBottom:G,plotWidth:Q,plotHeight:J,slot:z,visibleCandles:D,instrument:v,priceRange:{min:Q4,max:_$,candleMin:W,candleMax:Y},averageSpacing:i1,formatPrice(a){return LN(v,a)},priceToY:ZU,projectPrice:UA,indexToX:LI,timeToIndex:PW,timeToX:MW,barsBackToIndex:bW,resolveEndpointX:DA,nicePriceTicks:IA,niceTimeTickIndices:XA}}var ON=3;function gT($,v,D=6){let I=lT($,v,D),U=Math.ceil($/I)*I,X=Math.floor(v/I)*I,G=hT(I),Q=[];if(X>=U){let J=Math.round((X-U)/I);for(let z=0;z<=J;z+=1)Q.push(Number((U+z*I).toFixed(G+2)))}if(Q.length<ON)return RT($,v,ON+2);return Q}function RT($,v,D){if(v<=$||D<2)return[$];let I=[];for(let U=0;U<D;U+=1)I.push($+(v-$)*U/(D-1));return I}function CT($,v=7){if($<=0)return[];if($<=v)return Array.from({length:$},(U,X)=>X);let D=new Set,I=($-1)/Math.max(1,v-1);for(let U=0;U<v;U+=1)D.add(Math.round(U*I));return D.add(0),D.add($-1),Array.from(D).sort((U,X)=>U-X)}function iT($,v,D,I){if($.length===1){let G=$[0].time;return(I-G)/D}let U=$[0],X=$[v];if(I<=U.time)return(I-U.time)/D;if(I>=X.time)return v+(I-X.time)/D;return xT($,v,I)}function nT($){let v=[];for(let D of $)for(let I of uT){let U=D[I];if(typeof U==="number"&&Number.isFinite(U))v.push(U)}return v}function xT($,v,D){let I=0,U=v;while(I<=U){let W=Math.floor((I+U)/2),Y=$[W];if(Y.time===D)return W;if(Y.time<D)I=W+1;else U=W-1}let X=Math.min(v,I),G=Math.max(0,X-1),Q=$[G],z=$[X].time-Q.time;if(z<=0)return G;return G+(D-Q.time)/z}function fT($,v){if(v==="start")return $.time1??$.entryTime;return $.time2}function _T($,v){if(v==="start")return $.barsBack1;return $.barsBack2}function yT($){if($.length<2)return 1;let v=0,D=0;for(let I=1;I<$.length;I+=1){let U=$[I].time-$[I-1].time;if(U>0)v+=U,D+=1}if(D===0)return 1;return v/D}function lT($,v,D){let U=Math.max(v-$,0.000001)/Math.max(1,D-1),X=Math.floor(Math.log10(U)),G=[X-1,X,X+1],Q=[1,2,2.5,5,10],J=U,z=Number.POSITIVE_INFINITY;for(let W of G){let Y=10**W;for(let L of Q){let V=L*Y,B=Math.ceil($/V),N=Math.floor(v/V),A=N>=B?N-B+1:1,F=Math.abs(A-D);if(F<z)z=F,J=V}}return J}function hT($){let v=0,D=$;while(v<10&&Math.abs(Math.round(D)-D)>0.00000001)D*=10,v+=1;return v}function J6($){return oD[$]}function wN($,v){let D=J6($.theme),I=rT($.nicePriceTicks(),$.formatPrice),U=$.niceTimeTickIndices(),X=[],G=[],Q=$.visibleCandles[$.visibleCandles.length-1],J=$.priceToY(Q.close),z=Q.close>=Q.open?D.upCandle:D.downCandle,W=$.formatPrice(Q.close);for(let N of I){let A=$.priceToY(N);X.push(Y$({x1:$.plotLeft,y1:Math.round(A)+0.5,x2:$.plotRight,y2:Math.round(A)+0.5,stroke:D.grid,"stroke-width":1}));let F=$.formatPrice(N);if(F!==W)G.push(t$(F,{x:$.width-6,y:A,fill:D.text,"font-size":fz,"font-family":g$,"text-anchor":"end","dominant-baseline":"middle"}))}for(let N of U){let A=$.visibleCandles[N];if(!A)continue;let F=$.indexToX(N),E=(N>0?$.visibleCandles[N-1]:void 0)?.time;X.push(Y$({x1:Math.round(F)+0.5,y1:$.plotTop,x2:Math.round(F)+0.5,y2:$.plotBottom,stroke:D.grid,"stroke-width":1})),G.push(t$(VN($.timeframe,A.time,E),{x:F,y:$.height-8,fill:D.text,"font-size":fz,"font-family":g$,"text-anchor":"middle"}))}G.push(Y$({x1:Math.round($.plotRight)+0.5,y1:$.plotTop,x2:Math.round($.plotRight)+0.5,y2:$.plotBottom,stroke:D.axisBorder,"stroke-width":1})),G.push(Y$({x1:$.plotLeft,y1:Math.round($.plotBottom)+0.5,x2:$.width,y2:Math.round($.plotBottom)+0.5,stroke:D.axisBorder,"stroke-width":1}));let Y=Y$({x1:$.plotLeft,y1:Math.round(J)+0.5,x2:$.plotRight,y2:Math.round(J)+0.5,stroke:z,"stroke-width":1,"stroke-dasharray":"4 4"}),L={y:J,label:$.formatPrice(Q.close),fill:z,height:q1},V=HN($,D),B=FN($,v);return{gridSvg:o(X.join(""),{"shape-rendering":"crispEdges"}),axesSvg:G.join(""),lastPriceSvg:Y,lastPriceTag:L,headerSvg:V,watermarkSvg:B}}function rT($,v){let D=new Set,I=[];for(let U of $){let X=v(U);if(!D.has(X))D.add(X),I.push(U)}return I}function PN($){let v=Math.max(1,Math.round($.slot*0.7)),D=[];for(let I=0;I<$.visibleCandles.length;I+=1){let U=$.visibleCandles[I];if(!U)continue;let X=U.close>=U.open?"#10b981":"#ef4444",G=$.indexToX(I),Q=Math.round(G)+0.5,J=$.priceToY(U.high),z=$.priceToY(U.low),W=$.priceToY(U.open),Y=$.priceToY(U.close),L=Math.min(W,Y),V=Math.max(W,Y),B=Math.max(1,Math.round(V-L)),N=Math.round(G-v/2),A=Math.round(L);D.push(Y$({x1:Q,y1:Math.round(J)+0.5,x2:Q,y2:Math.round(z)+0.5,stroke:X,"stroke-width":1})),D.push(H$({x:N,y:A,width:v,height:B,fill:X}))}return o(D.join(""),{"shape-rendering":"crispEdges"})}function MN($,v){if(v.length===0)return"";let D=J6($.theme);return mT(v,$.plotTop+2,$.plotBottom-2).map((U)=>o([H$({x:$.plotRight+1,y:Math.round(U.y-U.height/2),width:$.width-$.plotRight-1,height:U.height,fill:U.fill}),t$(U.label,{x:$.width-6,y:U.y,fill:D.tagText,"font-size":U.height>=q1?11:10,"font-family":g$,"font-weight":600,"text-anchor":"end","dominant-baseline":"middle"})].join(""),{"shape-rendering":"crispEdges"})).join("")}function mT($,v,D){let I=$.map((G)=>({...G})).sort((G,Q)=>G.y-Q.y);if(I.length===0)return I;for(let G=1;G<I.length;G+=1){let Q=I[G-1],J=I[G],z=Q.y+(Q.height+J.height)/2;if(J.y<z)J.y=z}let U=I[I.length-1];if(U.y>D){U.y=D;for(let G=I.length-2;G>=0;G-=1){let Q=I[G+1],J=I[G],z=Q.y-(Q.height+J.height)/2;if(J.y>z)J.y=z}}let X=I[0];if(X.y<v)X.y=v;return I}function cz($){let v=tT($.candles);if(v.length===0)throw Error("Cannot render chart: candles is empty");return{pair:$.pair,timeframe:$.timeframe,candles:v,shapes:$.shapes??[],theme:$.theme??"dark",width:bN($.width,UN,GN,QN),height:bN($.height,DN,JN,zN),bars:cT($.bars??hz),scale:dT($.scale),watermark:$.watermark??XN,...$.fontFiles?{fontFiles:$.fontFiles}:{}}}function cT($){if(!Number.isFinite($))return hz;return dz(Math.round($),$N,vN)}function dT($){if($===void 0||!Number.isFinite($)||$<=0)return IN;return dz($,WN,YN)}function bN($,v,D,I){if($===void 0||!Number.isFinite($)||$<=0)return v;return dz(Math.round($),D,I)}function dz($,v,D){return Math.min(D,Math.max(v,$))}function tT($){return $.filter((v)=>Number.isFinite(v.time)&&Number.isFinite(v.open)&&Number.isFinite(v.high)&&Number.isFinite(v.low)&&Number.isFinite(v.close)).sort((v,D)=>v.time-D.time)}import{createRequire as pT}from"node:module";var oT=pT(import.meta.url);function qN($,v,D,I){let{Resvg:U}=aT();return new U($,{fitTo:{mode:"width",value:Math.round(v*D)},font:{loadSystemFonts:!0,defaultFontFamily:"Inter",...I?{fontFiles:I}:{}},background:"rgba(0,0,0,0)"}).render().asPng()}function aT(){try{return oT("@resvg/resvg-js")}catch($){let v=$ instanceof Error?$.message:String($);throw Error(`chart-render: @resvg/resvg-js could not be loaded for PNG rasterization (${v})`)}}var eT={horizontal_line:"horizontal_line",line:"horizontal_line",hline:"horizontal_line",horizontal:"horizontal_line",horz_line:"horizontal_line",horizontal_ray:"horizontal_ray",hray:"horizontal_ray",horz_ray:"horizontal_ray",horizontalray:"horizontal_ray",h_ray:"horizontal_ray",vertical_line:"vertical_line",vertical:"vertical_line",vline:"vertical_line",vert_line:"vertical_line",vertline:"vertical_line",verticalline:"vertical_line",cross_line:"cross_line",crossline:"cross_line",cross:"cross_line",zone:"zone",horizontal_range:"zone",range:"zone",supply_demand_zone:"zone",rectangle:"rectangle",rect:"rectangle",box:"rectangle",trendline:"trendline",trend:"trendline",trend_line:"trendline",ray:"ray",trend_ray:"ray",right_ray:"right_ray",ray_right:"right_ray",rightray:"right_ray","right-ray":"right_ray",left_ray:"left_ray",ray_left:"left_ray",leftray:"left_ray","left-ray":"left_ray",extended_line:"extended_line",extendedline:"extended_line",extended:"extended_line",extend_line:"extended_line",info_line:"info_line",infoline:"info_line",info:"info_line",trend_angle:"trend_angle",trendangle:"trend_angle",angle:"trend_angle",position:"position",trade:"position",long:"position",short:"position",long_position:"position",short_position:"position"},sT={horizontal_line:{required:[{field:"price",message:"price is required for horizontal_line"}],describe:($)=>`Drew horizontal line at ${$.price}${$.label?` (${$.label})`:""}`},horizontal_ray:{required:[{field:"price",message:"price is required for horizontal_ray"}],describe:($)=>`Drew horizontal ray at ${$.price}${$.label?` (${$.label})`:""}`},vertical_line:{required:[],describe:($)=>{let v=$.time1??$.time2;return`Drew vertical line${v?` at ${v}`:""}${$.label?` (${$.label})`:""}`}},cross_line:{required:[{field:"price",message:"price is required for cross_line"}],describe:($)=>`Drew cross line at ${$.price}${$.label?` (${$.label})`:""}`},zone:{required:[{field:"priceHigh",message:"priceHigh is required for zone"},{field:"priceLow",message:"priceLow is required for zone"}],describe:($)=>`Drew zone from ${$.priceLow} to ${$.priceHigh}${$.label?` (${$.label})`:""}`},rectangle:{required:[{field:"priceHigh",message:"priceHigh is required for rectangle"},{field:"priceLow",message:"priceLow is required for rectangle"}],describe:($)=>`Drew rectangle from ${$.priceLow} to ${$.priceHigh}${$.label?` (${$.label})`:""}`},trendline:{required:[{field:"price1",message:"price1 is required for trendline"},{field:"price2",message:"price2 is required for trendline"}],describe:($)=>`Drew trendline from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},ray:{required:[{field:"price1",message:"price1 is required for ray"},{field:"price2",message:"price2 is required for ray"}],describe:($)=>`Drew ray from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},right_ray:{required:[{field:"price1",message:"price1 is required for right_ray"},{field:"price2",message:"price2 is required for right_ray"}],describe:($)=>`Drew right ray from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},left_ray:{required:[{field:"price1",message:"price1 is required for left_ray"},{field:"price2",message:"price2 is required for left_ray"}],describe:($)=>`Drew left ray from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},extended_line:{required:[{field:"price1",message:"price1 is required for extended_line"},{field:"price2",message:"price2 is required for extended_line"}],describe:($)=>`Drew extended line from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},info_line:{required:[{field:"price1",message:"price1 is required for info_line"},{field:"price2",message:"price2 is required for info_line"}],describe:($)=>`Drew info line from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},trend_angle:{required:[{field:"price1",message:"price1 is required for trend_angle"},{field:"price2",message:"price2 is required for trend_angle"}],describe:($)=>`Drew trend angle from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},position:{required:[{field:"direction",message:'direction ("long" or "short") is required for position'},{field:"entry",message:"entry is required for position"},{field:"stop",message:"stop is required for position"},{field:"target",message:"target is required for position"}],describe:($)=>`Drew ${$.direction} position — entry ${$.entry}, stop ${$.stop}, target ${$.target}${$.label?` (${$.label})`:""}`}};var $E=["horizontal_line","horizontal_ray","vertical_line","cross_line","zone","rectangle","trendline","trend_line","ray","right_ray","left_ray","extended_line","info_line","trend_angle","position"];function LU($){if(typeof $!=="string")return null;let v=$.trim().toLowerCase();return eT[v]??null}function TN($){return`Unknown shape type: "${String($)}". Supported types: ${$E.join(", ")}`}function tz($){if(typeof $==="number"&&Number.isFinite($))return $;if(typeof $==="string"){let v=$.trim();if(v.length===0)return;let D=Number(v);if(Number.isFinite(D))return D}return}function vE($){if(typeof $!=="string")return;let v=$.trim().toLowerCase();if(v==="long"||v==="buy")return"long";if(v==="short"||v==="sell")return"short";return}function p$($,v){for(let D of v){let I=tz($[D]);if(I!==void 0)return I}return}function b4($,v,D){let I=$[v];if(!I||typeof I!=="object"||Array.isArray(I))return;return p$(I,D)}function UE($){if(typeof $.type!=="string")return null;let v=$.type.trim().toLowerCase();return v.length>0?v:null}function K4($,v,D){if($[v]!==void 0||D===void 0)return;$[v]=D}function pz($,v,D){K4($,v,D===void 0?void 0:Math.trunc(D))}function DE($,v){if($.direction)return;if(v==="long"||v==="short"){$.direction=v;return}if(v==="long_position"||v==="short_position"){$.direction=v==="long_position"?"long":"short";return}$.direction=vE($.side)}function IE($){return p$($,["level","y","value","priceLevel","linePrice"])??b4($,"point1",["price","y","value"])??b4($,"from",["price","y","value"])}function SN($,v){if(v==="start")return p$($,["startPrice","fromPrice","priceA","p1"])??b4($,"point1",["price","y","value"])??b4($,"from",["price","y","value"]);return p$($,["endPrice","toPrice","priceB","p2"])??b4($,"point2",["price","y","value"])??b4($,"to",["price","y","value"])}function kN($,v){if(v==="start")return p$($,["time","startTime","fromTime","timestamp","t1"])??b4($,"point1",["time","t","timestamp"])??b4($,"from",["time","t","timestamp"]);return p$($,["endTime","toTime","t2"])??b4($,"point2",["time","t","timestamp"])??b4($,"to",["time","t","timestamp"])}function XE($){K4($,"price",IE($)),K4($,"priceHigh",p$($,["high","upper","top","max","priceTop","priceUpper"])),K4($,"priceLow",p$($,["low","lower","bottom","min","priceBottom","priceLower"])),K4($,"price1",SN($,"start")),K4($,"price2",SN($,"end"))}function GE($){pz($,"time1",kN($,"start")),pz($,"time2",kN($,"end")),K4($,"barsBack1",p$($,["barsBack","barBack","lookback","bars"])),K4($,"barsBack2",p$($,["barsBackEnd","barBackEnd","lookbackEnd"]))}function QE($){K4($,"entry",p$($,["entryPrice","open","openPrice"])),K4($,"stop",p$($,["stopLoss","sl","stopPrice"])),K4($,"target",p$($,["takeProfit","tp","targetPrice","tpPrice"])),pz($,"entryTime",p$($,["entryTimestamp"]))}function JE($){let v=tz($.priceHigh),D=tz($.priceLow);if(v!==void 0&&D!==void 0&&v<D)$.priceHigh=D,$.priceLow=v}function EN($){if(typeof $!=="object"||$===null||Array.isArray($))return $;let v={...$},D=UE(v),I=LU(D);if(I)v.type=I;return DE(v,D),XE(v),GE(v),QE(v),JE(v),v}function uN($){return sT[$].required}var zE=h.object({type:h.string().describe('Shape type: "horizontal_line", "horizontal_ray", "vertical_line", "cross_line", "zone", "rectangle", "trendline", "ray", "right_ray", "left_ray", "extended_line", "info_line", "trend_angle", or "position"'),price:h.coerce.number().optional().describe("Price level (required for horizontal_line, horizontal_ray, cross_line)"),priceHigh:h.coerce.number().optional().describe("Upper price boundary (required for zone/rectangle)"),priceLow:h.coerce.number().optional().describe("Lower price boundary (required for zone/rectangle)"),price1:h.coerce.number().optional().describe("First point price (required for trendline/ray/right_ray/left_ray/extended_line/info_line/trend_angle)"),price2:h.coerce.number().optional().describe("Second point price (required for trendline/ray/right_ray/left_ray/extended_line/info_line/trend_angle)"),time1:h.number().int().optional().describe("Absolute time (epoch seconds) of the first endpoint for trendline/rays or anchor for vertical_line. PREFERRED over barsBack1."),time2:h.number().int().optional().describe("Absolute time (epoch seconds) of the second endpoint (trendline/rays) or right edge of a zone. PREFERRED over barsBack2."),barsBack1:h.number().optional().describe("FALLBACK only — bars back from the current bar for first endpoint/anchor (trendline, rays, vertical_line). Use time1 when possible."),barsBack2:h.number().optional().describe("FALLBACK only — bars back from the current bar for second endpoint / zone right edge. Use time2 when possible."),direction:h.enum(["long","short"]).optional().describe('Position direction (required for position): "long" or "short"'),entry:h.coerce.number().optional().describe("Entry price (required for position)"),stop:h.coerce.number().optional().describe("Stop-loss price (required for position)"),target:h.coerce.number().optional().describe("Take-profit price (required for position)"),entryTime:h.number().int().optional().describe("Absolute time (epoch seconds) for the position entry anchor. Defaults to the current bar."),label:h.string().optional().describe('Label text, e.g. "Support", "Resistance", "Demand Zone", "Long EURCHF"'),color:h.string().optional().describe('Color hex, e.g. "#22c55e" green, "#ef4444" red, "#3b82f6" blue')}).superRefine(($,v)=>{let D=LU($.type);if(!D){v.addIssue({code:"custom",message:TN($.type),path:["type"]});return}for(let I of uN(D))if($[I.field]===void 0)v.addIssue({code:"custom",message:I.message,path:[I.field]})}),gN=h.preprocess(EN,zE),Yh=h.object({shapes:h.array(gN).min(1)});function RN($){let v=[],D=[];for(let[I,U]of $.entries()){let X=gN.safeParse(U);if(X.success)v.push(X.data);else D.push({index:I,reason:X.error.issues[0]?.message??"invalid shape"})}return{valid:v,invalid:D}}function $4($,v,D){let I={type:$.type,ok:!0,...D?{reason:D}:{},...$.label?{label:$.label}:{}};return{underlaySvg:v.underlaySvg??"",lineSvg:v.lineSvg??"",positionSvg:v.positionSvg??"",chromeSvg:v.chromeSvg??"",gutterTags:v.gutterTags??[],report:I}}function A$($,v){let D={type:$.type,ok:!1,reason:v,...$.label?{label:$.label}:{}};return{underlaySvg:"",lineSvg:"",positionSvg:"",chromeSvg:"",gutterTags:[],report:D}}function k$($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function o$($,v){return $.color&&$.color.trim().length>0?$.color:v}function z$($,v,D,I){let U=$.projectPrice(D);if(!U.clamped||U.edge===null)return"";let X=J6($.theme),G=W$(v,$.plotLeft+10,$.plotRight-10),Q=U.edge==="top"?$.plotTop+4:$.plotBottom-4,J=U.edge==="top"?[{x:G,y:Q},{x:G-5,y:Q+7},{x:G+5,y:Q+7}]:[{x:G,y:Q},{x:G-5,y:Q-7},{x:G+5,y:Q-7}],z=U.edge==="top"?Q+16:Q-10;return o([ZN(J,{fill:I}),t$($.formatPrice(D),{x:G,y:z,fill:X.markerText,"font-size":10,"font-family":g$,"text-anchor":"middle"})].join(""))}function oz($,v,D,I,U){let X=S1(D,10)+10;return o([H$({x:$,y:v-10,width:X,height:16,fill:I,"fill-opacity":0.85}),t$(D,{x:$+5,y:v+1,fill:U,"font-size":10,"font-family":g$})].join(""),{"shape-rendering":"crispEdges"})}function N4($,v,D,I,U="start"){return t$(D,{x:$,y:v,fill:I,"font-size":10,"font-family":g$,"text-anchor":U})}function W$($,v,D){return Math.min(D,Math.max(v,$))}var iN="price out of visible range (clamped)";function az($,v){if(v.type==="zone")return WE($,v);if(v.type==="rectangle")return YE($,v);return A$(v,`Unsupported area shape: ${v.type}`)}function WE($,v){let D=nN($,v,"zone");if(D.kind==="error")return D.fragments;let I=o$(v,"#3b82f6"),U=W$(D.top+12,$.plotTop+12,$.plotBottom-6),X=(D.left+D.right)/2;return $4(v,{underlaySvg:o(H$({x:D.left,y:D.top,width:D.right-D.left,height:D.bottom-D.top,fill:I,"fill-opacity":0.12}),{"shape-rendering":"crispEdges"}),lineSvg:o([Y$({x1:D.left,y1:Math.round(D.top)+0.5,x2:D.right,y2:Math.round(D.top)+0.5,stroke:I,"stroke-width":1}),Y$({x1:D.left,y1:Math.round(D.bottom)+0.5,x2:D.right,y2:Math.round(D.bottom)+0.5,stroke:I,"stroke-width":1}),v.label?N4(D.left+4,U,v.label,I):"",z$($,X,D.highPrice,I),z$($,X,D.lowPrice,I)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?iN:void 0)}function YE($,v){let D=nN($,v,"rectangle");if(D.kind==="error")return D.fragments;let I=o$(v,"#f59e0b"),U=W$(D.top+12,$.plotTop+12,$.plotBottom-6),X=(D.left+D.right)/2;return $4(v,{underlaySvg:o(H$({x:D.left,y:D.top,width:D.right-D.left,height:D.bottom-D.top,fill:I,"fill-opacity":0.12}),{"shape-rendering":"crispEdges"}),lineSvg:o([H$({x:D.left,y:D.top,width:D.right-D.left,height:D.bottom-D.top,fill:"none",stroke:I,"stroke-width":1}),v.label?N4(D.left+4,U,v.label,I):"",z$($,X,D.highPrice,I),z$($,X,D.lowPrice,I)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?iN:void 0)}function nN($,v,D){let I=k$(v.priceHigh),U=k$(v.priceLow);if(I===void 0)return{kind:"error",fragments:A$(v,`priceHigh is required for ${D}`)};if(U===void 0)return{kind:"error",fragments:A$(v,`priceLow is required for ${D}`)};let X=$.projectPrice(I),G=$.projectPrice(U),Q=D==="zone"&&!CN(v)?$.plotLeft:W$($.resolveEndpointX(v,"start",24),$.plotLeft,$.plotRight),J=D==="zone"&&!CN(v)?$.plotRight:W$($.resolveEndpointX(v,"end",4),$.plotLeft,$.plotRight),z=Math.min(X.y,G.y),W=Math.max(X.y,G.y);return{kind:"ok",left:Math.min(Q,J),right:Math.max(Q,J),top:z,bottom:W,highPrice:I,lowPrice:U,clamped:X.clamped||G.clamped}}function CN($){return $.time1!==void 0||$.time2!==void 0||$.barsBack1!==void 0||$.barsBack2!==void 0}function sD($,v,D){if(Math.abs(D.x-v.x)<0.000001)return v.y;let I=(D.y-v.y)/(D.x-v.x);return v.y+($-v.x)*I}function xN($,v,D){if(Math.abs(v.x-$.x)<0.000001)return{start:{x:$.x,y:$.y},end:{x:$.x,y:v.y}};return{start:{x:$.x,y:$.y},end:{x:D,y:sD(D,$,v)}}}function fN($,v,D){if(Math.abs(v.x-$.x)<0.000001)return{start:{x:$.x,y:$.y},end:{x:$.x,y:v.y}};return{start:{x:$.x,y:$.y},end:{x:D,y:sD(D,$,v)}}}function _N($,v,D,I,U,X){if(Math.abs(v.x-$.x)<0.000001)return{start:{x:$.x,y:U},end:{x:$.x,y:X}};return{start:{x:D,y:sD(D,$,v)},end:{x:I,y:sD(I,$,v)}}}function ez($,v){return{x:($.x+v.x)/2,y:($.y+v.y)/2}}var T1="price out of visible range (clamped)";function G4($,v){switch(v.type){case"horizontal_line":return LE($,v);case"horizontal_ray":return VE($,v);case"vertical_line":return BE($,v);case"cross_line":return KE($,v);case"trendline":return NE($,v);case"ray":case"right_ray":return ZE($,v);case"left_ray":return AE($,v);case"extended_line":return HE($,v);case"info_line":return FE($,v);case"trend_angle":return OE($,v);default:return A$(v,`Unsupported line shape: ${v.type}`)}}function LE($,v){let D=k$(v.price);if(D===void 0)return A$(v,"price is required for horizontal_line");let I=o$(v,"#3b82f6"),U=$.projectPrice(D),X=[Y$({x1:$.plotLeft,y1:Math.round(U.y)+0.5,x2:$.plotRight,y2:Math.round(U.y)+0.5,stroke:I,"stroke-width":1}),v.label?N4($.plotLeft+4,W$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,I):"",z$($,$.plotRight-12,D,I)].join("");return $4(v,{lineSvg:o(X,{"shape-rendering":"crispEdges"}),gutterTags:[{y:U.y,label:$.formatPrice(D),fill:I,height:q1}]},U.clamped?T1:void 0)}function VE($,v){let D=k$(v.price);if(D===void 0)return A$(v,"price is required for horizontal_ray");let I=o$(v,"#3b82f6"),U=$.projectPrice(D),X=$.resolveEndpointX(v,"start",0),G=W$(X+4,$.plotLeft+4,$.plotRight-60);return $4(v,{lineSvg:o([Y$({x1:W$(X,$.plotLeft,$.plotRight),y1:Math.round(U.y)+0.5,x2:$.plotRight,y2:Math.round(U.y)+0.5,stroke:I,"stroke-width":1}),v.label?N4(G,W$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,I):"",z$($,X,D,I)].join(""),{"shape-rendering":"crispEdges"})},U.clamped?T1:void 0)}function BE($,v){let D=o$(v,"#f59e0b"),I=$.resolveEndpointX(v,"start",0),U=W$(I,$.plotLeft,$.plotRight);return $4(v,{lineSvg:o([Y$({x1:Math.round(U)+0.5,y1:$.plotTop,x2:Math.round(U)+0.5,y2:$.plotBottom,stroke:D,"stroke-width":1,"stroke-dasharray":"4 4"}),v.label?N4(U+4,$.plotTop+12,v.label,D):""].join(""),{"shape-rendering":"crispEdges"})})}function KE($,v){let D=k$(v.price);if(D===void 0)return A$(v,"price is required for cross_line");let I=o$(v,"#38bdf8"),U=$.projectPrice(D),X=W$($.resolveEndpointX(v,"start",0),$.plotLeft,$.plotRight);return $4(v,{lineSvg:o([Y$({x1:$.plotLeft,y1:Math.round(U.y)+0.5,x2:$.plotRight,y2:Math.round(U.y)+0.5,stroke:I,"stroke-width":1,"stroke-dasharray":"4 4"}),Y$({x1:Math.round(X)+0.5,y1:$.plotTop,x2:Math.round(X)+0.5,y2:$.plotBottom,stroke:I,"stroke-width":1,"stroke-dasharray":"4 4"}),v.label?N4(X+4,W$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,I):"",z$($,X,D,I)].join(""),{"shape-rendering":"crispEdges"})},U.clamped?T1:void 0)}function NE($,v){let D=E1($,v,"trendline");if(D.kind==="error")return D.fragments;return jE($,v,D.first,D.second,"#f59e0b","4 4")}function ZE($,v){let D=E1($,v,v.type);if(D.kind==="error")return D.fragments;let I=o$(v,"#f59e0b"),U=xN(D.first,D.second,$.plotRight);return $I($,v,U.start,U.end,I,"4 4",[z$($,D.first.x,D.price1,I),z$($,D.second.x,D.price2,I)])}function AE($,v){let D=E1($,v,"left_ray");if(D.kind==="error")return D.fragments;let I=o$(v,"#f59e0b"),U=fN(D.first,D.second,$.plotLeft);return $I($,v,U.start,U.end,I,"4 4",[z$($,D.first.x,D.price1,I),z$($,D.second.x,D.price2,I)])}function HE($,v){let D=E1($,v,"extended_line");if(D.kind==="error")return D.fragments;let I=o$(v,"#f59e0b"),U=_N(D.first,D.second,$.plotLeft,$.plotRight,$.plotTop,$.plotBottom);return $I($,v,U.start,U.end,I,"4 4",[z$($,D.first.x,D.price1,I),z$($,D.second.x,D.price2,I)])}function FE($,v){let D=E1($,v,"info_line");if(D.kind==="error")return D.fragments;let I=o$(v,"#22c55e"),U=D.price2-D.price1,X=D.price1===0?null:U/D.price1*100,G=$.instrument?.priceDecimals??5,Q=v.label?`${v.label} · ${YU(U,X,G)}`:YU(U,X,G),J=ez(D.first,D.second);return $4(v,{lineSvg:o([Y$({x1:D.first.x,y1:D.first.y,x2:D.second.x,y2:D.second.y,stroke:I,"stroke-width":1}),oz(W$(J.x-30,$.plotLeft+2,$.plotRight-120),W$(J.y-6,$.plotTop+12,$.plotBottom-12),Q,I,"#FFFFFF"),z$($,D.first.x,D.price1,I),z$($,D.second.x,D.price2,I)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?T1:void 0)}function OE($,v){let D=E1($,v,"trend_angle");if(D.kind==="error")return D.fragments;let I=o$(v,"#a855f7"),U=Math.atan2(D.first.y-D.second.y,D.second.x-D.first.x)*180/Math.PI,X=v.label?`${v.label} · ${U.toFixed(1)}°`:`${U.toFixed(1)}°`,G=ez(D.first,D.second);return $4(v,{lineSvg:o([Y$({x1:D.first.x,y1:D.first.y,x2:D.second.x,y2:D.second.y,stroke:I,"stroke-width":1}),oz(W$(G.x-26,$.plotLeft+2,$.plotRight-100),W$(G.y-6,$.plotTop+12,$.plotBottom-12),X,I,"#FFFFFF"),z$($,D.first.x,D.price1,I),z$($,D.second.x,D.price2,I)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?T1:void 0)}function jE($,v,D,I,U,X){let G=o$(v,U);return $I($,v,D,I,G,X,[z$($,D.x,k$(v.price1)??0,G),z$($,I.x,k$(v.price2)??0,G)])}function $I($,v,D,I,U,X,G){let Q=W$(I.x+4,$.plotLeft+4,$.plotRight-70),J=W$(I.y-4,$.plotTop+12,$.plotBottom-4),z=k$(v.price1),W=k$(v.price2),Y=z!==void 0&&$.projectPrice(z).clamped||W!==void 0&&$.projectPrice(W).clamped;return $4(v,{lineSvg:o([Y$({x1:D.x,y1:D.y,x2:I.x,y2:I.y,stroke:U,"stroke-width":1,...X?{"stroke-dasharray":X}:{}}),v.label?N4(Q,J,v.label,U):"",...G].join(""),{"shape-rendering":"crispEdges"})},Y?T1:void 0)}function E1($,v,D){let I=k$(v.price1),U=k$(v.price2);if(I===void 0)return{kind:"error",fragments:A$(v,`price1 is required for ${D}`)};if(U===void 0)return{kind:"error",fragments:A$(v,`price2 is required for ${D}`)};let X=$.projectPrice(I),G=$.projectPrice(U),Q={x:W$($.resolveEndpointX(v,"start",50),$.plotLeft,$.plotRight),y:X.y},J={x:W$($.resolveEndpointX(v,"end",0),$.plotLeft,$.plotRight),y:G.y};return{kind:"ok",first:Q,second:J,price1:I,price2:U,clamped:X.clamped||G.clamped}}var wE="price out of visible range (clamped)";function yN($,v){if(v.direction!=="long"&&v.direction!=="short")return A$(v,'direction ("long" or "short") is required for position');let D=k$(v.entry),I=k$(v.stop),U=k$(v.target);if(D===void 0)return A$(v,"entry is required for position");if(I===void 0)return A$(v,"stop is required for position");if(U===void 0)return A$(v,"target is required for position");let X=J6($.theme),G=W$($.resolveEndpointX(v,"start",0),$.plotLeft,$.plotRight),Q=$.projectPrice(D),J=$.projectPrice(I),z=$.projectPrice(U),W=Math.min(Q.y,z.y),Y=Math.max(Q.y,z.y),L=Math.min(Q.y,J.y),V=Math.max(Q.y,J.y),B=W$(Math.min(W,L)+12,$.plotTop+12,$.plotBottom-8),N=Q.clamped||J.clamped||z.clamped;return $4(v,{positionSvg:o([H$({x:G,y:W,width:$.plotRight-G,height:Y-W,fill:"#10b981","fill-opacity":0.12}),H$({x:G,y:L,width:$.plotRight-G,height:V-L,fill:"#ef4444","fill-opacity":0.12}),Y$({x1:G,y1:Math.round(Q.y)+0.5,x2:$.plotRight,y2:Math.round(Q.y)+0.5,stroke:X.entryTag,"stroke-width":1}),Y$({x1:G,y1:Math.round(J.y)+0.5,x2:$.plotRight,y2:Math.round(J.y)+0.5,stroke:"#ef4444","stroke-width":1}),Y$({x1:G,y1:Math.round(z.y)+0.5,x2:$.plotRight,y2:Math.round(z.y)+0.5,stroke:"#10b981","stroke-width":1}),v.label?N4(G+4,B,v.label,X.text):"",z$($,G,D,X.entryTag),z$($,G,I,"#ef4444"),z$($,G,U,"#10b981")].join(""),{"shape-rendering":"crispEdges"}),gutterTags:[{y:Q.y,label:`Entry ${$.formatPrice(D)}`,fill:X.entryTag,height:pD},{y:J.y,label:`SL ${$.formatPrice(I)}`,fill:"#ef4444",height:pD},{y:z.y,label:`TP ${$.formatPrice(U)}`,fill:"#10b981",height:pD}]},N?wE:void 0)}var PE={horizontal_line:G4,horizontal_ray:G4,vertical_line:G4,cross_line:G4,zone:az,rectangle:az,trendline:G4,ray:G4,right_ray:G4,left_ray:G4,extended_line:G4,info_line:G4,trend_angle:G4,position:yN};function lN($,v){let D=[],I=[],U=[],X=[],G=[],Q=[],J=0,z=0;for(let W of v){let Y=ME($,W);if(D.push(Y.underlaySvg),I.push(Y.lineSvg),U.push(Y.positionSvg),X.push(Y.chromeSvg),G.push(...Y.gutterTags),Q.push(Y.report),Y.report.ok)J+=1;else z+=1}return{underlaySvg:D.join(""),lineSvg:I.join(""),positionSvg:U.join(""),chromeSvg:X.join(""),gutterTags:G,reports:Q,drawn:J,skipped:z}}function ME($,v){let D=LU(v.type);if(!D)return A$(v,`Unknown shape type: ${String(v.type)}`);let I=PE[D];if(!I)return A$(v,`Unsupported shape type: ${D}`);let U=D===v.type?v:{...v,type:D};return I($,U)}var sz;function hN($){let v=cz($),D=bE(v.pair),I=jN(v,D),U=oD[v.theme],X=lN(I,v.shapes),G=wN(I,v.watermark),Q=`plot-clip-${kE(I)}`,J=`<defs><clipPath id="${Q}">${H$({x:I.plotLeft,y:I.plotTop,width:I.plotWidth,height:I.plotHeight})}</clipPath></defs>`,z={"clip-path":`url(#${Q})`},W=o(G.gridSvg,z),Y=o(X.underlaySvg,z),L=o(PN(I),z),V=o(X.lineSvg,z),B=o(X.positionSvg,z),N=MN(I,[...X.gutterTags,G.lastPriceTag]);return{svg:AN(I.width,I.height,[H$({x:0,y:0,width:I.width,height:I.height,fill:U.background}),J,W,Y,L,V,B,G.axesSvg,X.chromeSvg,G.lastPriceSvg,N,G.headerSvg,G.watermarkSvg,SE()].join("")),width:I.width,height:I.height,drawn:X.drawn,skipped:X.skipped,shapes:X.reports,priceRange:{min:I.priceRange.min,max:I.priceRange.max}}}function $W($){let v=hN($),D=cz($);return{...v,png:qN(v.svg,v.width,D.scale,D.fontFiles)}}function bE($){return qE().resolve($)}function qE(){if(sz===void 0)sz=new WU([...dD]);return sz}function SE(){return`<style>text{font-family:${g$};white-space:pre}</style>`}function kE($){let v=$.visibleCandles,D=v[0]?.time??0,I=v[v.length-1]?.time??0,U=`${$.pair}|${$.timeframe}|${$.width}x${$.height}|${v.length}|${D}|${I}`,X=2166136261;for(let G=0;G<U.length;G+=1)X^=U.charCodeAt(G),X=Math.imul(X,16777619);return(X>>>0).toString(36)}var rN=120,vW=20,UW=200;function TE($,v,D){return Math.max(v,Math.min(D,$))}var EE="Render an annotated candlestick chart image (PNG) for a pair + timeframe. Fetches recent candles and draws optional shapes (support/resistance lines, zones, trendlines, a long/short position) using the same vocabulary as draw_chart_shape. Returns the chart as an image plus a text summary. PREFER absolute time anchors (time1/time2/entryTime, epoch seconds from get_candles) over barsBack*.",uE="Optional annotations. Each item is {type, ...}: horizontal_line/horizontal_ray/cross_line need `price`; zone/rectangle need `priceHigh`+`priceLow`; trendline/ray/right_ray/left_ray/extended_line/info_line/trend_angle need `price1`+`price2` (prefer `time1`+`time2` epoch seconds); position needs `direction` (long/short)+`entry`+`stop`+`target`. Optional `label` and `color` (hex).",mN=[r({name:"render_chart",description:EE,inputSchema:{type:"object",properties:{pair:{type:"string",description:"Canonical instrument id, e.g. EURUSD (case-insensitive)"},timeframe:{type:"string",description:"e.g. 1m, 5m, 15m, 30m, 1h, 4h, 1d (or an integer multiple)"},shapes:{type:"array",description:uE,items:{type:"object"}},bars:{type:"integer",minimum:vW,maximum:UW,description:`Most-recent candles to show (${vW}-${UW}, default ${rN})`},theme:{type:"string",enum:["dark","light"],description:"Color theme (default dark)"},width:{type:"integer",minimum:320,maximum:2560,description:"Image width in px (320-2560, default 1280)"},height:{type:"integer",minimum:240,maximum:1440,description:"Image height in px (240-1440, default 720)"}},required:["pair","timeframe"],additionalProperties:!1},handler:async($,v)=>{await c(v);let D=TE($.bars??rN,vW,UW),{candles:I}=await v.trpc.marketData.candles.query({pair:$.pair,timeframe:$.timeframe,limit:D});if(I.length===0)throw Error(`No candles available for ${$.pair} ${$.timeframe}. Check the pair/timeframe with get_market_config.`);let{valid:U,invalid:X}=RN($.shapes??[]),G=$W({pair:$.pair,timeframe:$.timeframe,candles:I,shapes:U,bars:D,...$.theme?{theme:$.theme}:{},...$.width?{width:$.width}:{},...$.height?{height:$.height}:{}}),Q=G.shapes.filter((Y)=>!Y.ok),J=[...X.map((Y)=>`shape ${Y.index}: ${Y.reason}`),...Q.map((Y)=>`${Y.type}: ${Y.reason??"undrawable"}`)],z=J.length>0?` (${J.length} skipped)
|
|
87
|
-
Skipped: ${J.join("; ")}`:"",W=`Rendered ${$.pair} ${$.timeframe} — ${I.length} candles, drew ${G.drawn} shape${G.drawn===1?"":"s"}. Price range ${G.priceRange.min}–${G.priceRange.max}.${z}`;return{content:[{type:"image",data:Buffer.from(G.png).toString("base64"),mimeType:"image/png"},{type:"text",text:W}]}}})];var gE="momentum: rsi, macd, stoch, stochf, stochrsi, cci, cmo, mom, roc, rocr, willr, mfi, ultosc, ppo, apo, bop, aroon, aroonosc; trend: adx, adxr, dx, plus_di, minus_di, plus_dm, minus_dm, sar, supertrend; moving averages: sma, ema, wma, dema, tema, trima, kama, t3ma, mama, vwap, midpoint, midprice; bands: bbands, keltner, percent_b; volatility: atr, natr, trange; volume: obv, ad, adosc; stats: linearreg, linearregslope, linearregangle, linearregintercept, stddev, var, tsf";function RE($){return{pair:$.pair,interval:$.interval,indicators:$.indicators.map((v)=>({name:v.name,...v.params===void 0?{}:{params:v.params}})),...$.outputsize===void 0?{}:{outputsize:$.outputsize}}}var cN=[r({name:"get_indicators",description:"Compute Twelve Data technical indicators for a pair + timeframe (requires sign-in). "+`Pass up to 8 indicators by name; params are optional and default sensibly. Names — ${gE}. Bad names/params return an error listing valid options. At most 2 distinct pairs per user at a time.`,inputSchema:{type:"object",properties:{pair:{type:"string",description:"Canonical id, e.g. EURUSD, XAUUSD, BTCUSD (case-insensitive)"},interval:{type:"string",description:"One of 1m, 5m, 15m, 30m, 45m, 1h, 2h, 4h, 1d"},indicators:{type:"array",minItems:1,maxItems:8,description:"Up to 8 indicators to compute on the pair",items:{type:"object",properties:{name:{type:"string",description:"Indicator name, e.g. rsi, macd, ema, bbands, atr, adx"},params:{type:"object",description:'Optional params, e.g. {"time_period": 14} or MACD {"fast_period":12,"slow_period":26}. Defaults applied when omitted.'}},required:["name"],additionalProperties:!1}},outputsize:{type:"integer",minimum:1,maximum:500,description:"Bars to return per indicator (default 30)"}},required:["pair","interval","indicators"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.technicalIndicators.get.query(RE($))}})];var CE="http://127.0.0.1:9003",iE=["horizontal_line","horizontal_ray","vertical_line","cross_line","zone","rectangle","trendline","ray","right_ray","left_ray","extended_line","info_line","trend_angle","position"];function nE(){return{url:process.env.AETHER_APP_PUSH_URL?.trim()||CE,secret:process.env.AI_LIVE_PUSH_SECRET?.trim()||void 0}}async function vI($,v,D){let{url:I,secret:U}=nE(),X=`${I.replace(/\/$/,"")}/api/ai/live/push`,G;try{G=await fetch(X,{method:"POST",headers:{"content-type":"application/json",...U?{"x-live-push-secret":U}:{}},body:JSON.stringify({userId:$,tool:v,args:D})})}catch(z){throw Error(`Could not reach the Aether Wealth app at ${X}. Is the dashboard running?`,{cause:z})}if(!G.ok)throw Error(`Live-chart push rejected (HTTP ${G.status}).`);let Q=await G.json().catch(()=>({})),J=typeof Q.delivered==="number"?Q.delivered:0;return{ok:!0,tool:v,delivered:J,message:J>0?`Dispatched to ${J} open chart tab(s).`:"Dispatched, but no open Aether Wealth chart tab is listening — open the dashboard in your browser, then retry."}}var dN=[r({name:"chart_select_pair",description:"Switch the user's open Aether Wealth chart to a trading pair. Use the canonical id (case-insensitive), e.g. XAUUSD for gold, EURUSD, BTCUSD. Drives the live browser chart, not backend state.",inputSchema:{type:"object",properties:{pair:{type:"string",description:"Canonical pair id, e.g. XAUUSD (gold), EURUSD, BTCUSD"}},required:["pair"],additionalProperties:!1},handler:async($,v)=>{await c(v);let D=await v.session.getUserId();return vI(D,"select_pair",{pair:$.pair})}}),r({name:"chart_change_timeframe",description:"Change the timeframe/resolution of the user's open Aether Wealth chart, e.g. 1m, 5m, 15m, 30m, 1h, 4h, 1d.",inputSchema:{type:"object",properties:{timeframe:{type:"string",description:"e.g. 1m, 5m, 15m, 30m, 1h, 4h, 1d"}},required:["timeframe"],additionalProperties:!1},handler:async($,v)=>{await c(v);let D=await v.session.getUserId();return vI(D,"change_timeframe",{timeframe:$.timeframe})}}),r({name:"chart_draw_shapes",description:"Draw one or more shapes on the user's OPEN Aether Wealth chart. For key levels use multiple `horizontal_line` shapes, each with `price` and a short `label`. For a fair-value-gap / supply-demand zone use a `zone` with `priceHigh` + `priceLow`. For a trade idea use a `position` with `direction` + `entry`/`stop`/`target`. Prices are in the instrument's price units; `time1`/`time2`/`entryTime` are optional epoch seconds. Switch to the intended pair + timeframe first.",inputSchema:{type:"object",properties:{shapes:{type:"array",description:"Shapes to draw in one batch.",items:{type:"object",properties:{type:{type:"string",enum:[...iE]},label:{type:"string"},color:{type:"string",description:"hex, e.g. #22c55e"},price:{type:"number"},priceHigh:{type:"number"},priceLow:{type:"number"},price1:{type:"number"},price2:{type:"number"},time1:{type:"number",description:"epoch seconds"},time2:{type:"number",description:"epoch seconds"},direction:{type:"string",enum:["long","short"]},entry:{type:"number"},stop:{type:"number"},target:{type:"number"},entryTime:{type:"number",description:"epoch seconds"}},required:["type"],additionalProperties:!1}}},required:["shapes"],additionalProperties:!1},handler:async($,v)=>{await c(v);let D=await v.session.getUserId();return vI(D,"draw_chart_shape",{shapes:$.shapes})}}),r({name:"chart_remove_drawings",description:"Remove AI-drawn shapes from the user's open Aether Wealth chart. `target` defaults to 'all' (clear everything the assistant drew); also accepts 'last', 'focused', or a specific shape id.",inputSchema:{type:"object",properties:{target:{type:"string",description:"'all' (default), 'last', 'focused', or a shape id"}},additionalProperties:!1},handler:async($,v)=>{await c(v);let D=await v.session.getUserId();return vI(D,"remove_chart_drawings",{target:$.target??"all"})}})];function xE($){return{...$.currency===void 0?{}:{currency:$.currency},...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to},...$.indicator===void 0?{}:{indicator:$.indicator},...$.impactMin===void 0?{}:{impactMin:$.impactMin},...$.view===void 0?{}:{view:$.view}}}function fE($){return{currency:$.currency,indicator:$.indicator,...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to},...$.limit===void 0?{}:{limit:$.limit}}}function _E($){return{pair:$.pair,timeframe:$.timeframe,...$.limit===void 0?{}:{limit:$.limit},...$.offset===void 0?{}:{offset:$.offset}}}var tN=[r({name:"get_candles",description:"Get OHLC candles for a pair + timeframe. Returns up to 200 bars per request (newest 200 by default). Use offset to page further back through history — the store keeps thousands of bars (e.g. limit=200 offset=200 returns bars 201-400 back from the latest). Timeframe may be a base (1m, 5m, 15m, 30m, 1h, 4h, 1d) or any integer multiple of one (e.g. 2h, 3h, 12h, 90m), aggregated server-side; invalid or unsupported timeframes return an error, not an empty list.",inputSchema:{type:"object",properties:{pair:{type:"string",description:"e.g. EURUSD, BTCUSD (canonical id; case-insensitive)"},timeframe:{type:"string",description:"A base (1m, 5m, 15m, 30m, 1h, 4h, 1d) or an integer multiple of one (e.g. 2h, 3h, 12h, 90m). No fractional (2.5h) or sub-minute values."},limit:{type:"integer",minimum:1,maximum:200,description:"Maximum candles to return (1-200). Omit for the newest 200."},offset:{type:"integer",minimum:0,maximum:4800,description:"Number of the most-recent candles to skip before applying limit — pages backward through history (0–4800). On aggregated timeframes (e.g. 2h, 3h) the reachable depth is lower (≈ 4800 ÷ the aggregation factor) since fewer bars exist; a deeper offset returns fewer or no bars."}},required:["pair","timeframe"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.marketData.candles.query(_E($))}}),r({name:"list_economic_calendar",description:'List economic calendar events. Filter by currency, date range, release, or minimum impact (1-5). Currency and indicator/release are validated against the catalog: unknown values return an error listing valid options, so an empty result always means "no events" rather than "bad input".',inputSchema:{type:"object",properties:{currency:{type:"array",items:{type:"string"},description:'ISO currency codes, e.g. ["USD","EUR"]'},from:{type:"string",description:"ISO 8601 date or datetime"},to:{type:"string",description:"ISO 8601 date or datetime"},indicator:{type:"string",description:"release slug, e.g. cpi"},impactMin:{type:"integer",minimum:1,maximum:5},view:{type:"string",enum:["minimal","rich"]}},additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.marketData.listCalendar.query(xE($))}}),r({name:"get_macro_series",description:"Get a macro indicator time series (e.g. USD cpi). Currency and indicator are validated against the catalog: unknown values return an error listing valid options (case-insensitive).",inputSchema:{type:"object",properties:{currency:{type:"string",description:"ISO currency code, e.g. USD"},indicator:{type:"string",description:"release slug, e.g. cpi"},from:{type:"string",description:"ISO 8601 date or datetime"},to:{type:"string",description:"ISO 8601 date or datetime"},limit:{type:"integer",minimum:1,maximum:1000}},required:["currency","indicator"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.marketData.listIndicatorSeries.query(fE($))}}),r({name:"get_market_config",description:"Get the catalog of supported instruments + timeframes (useful before calling other tools).",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.marketData.getConfig.query()}})];function yE($){return{...$.accountId===void 0?{}:{accountId:$.accountId},...$.status===void 0||$.status==="ALL"?{}:{status:$.status},...$.pair===void 0?{}:{pair:$.pair},...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to},...$.page===void 0?{}:{page:$.page},...$.limit===void 0?{}:{limit:$.limit}}}function oN($){return{...$.stopLoss===void 0?{}:{stopLoss:$.stopLoss},...$.takeProfit===void 0?{}:{takeProfit:$.takeProfit},...$.lotSize===void 0?{}:{lotSize:$.lotSize},...$.notes===void 0?{}:{notes:$.notes},...$.timeframe===void 0?{}:{timeframe:$.timeframe},...$.riskPercent===void 0?{}:{riskPercent:$.riskPercent},...$.tags===void 0?{}:{tags:$.tags}}}function lE($){return{accountId:$.accountId,pair:$.pair,direction:$.direction,entryPrice:$.entryPrice,entryTime:$.entryTime,...oN($)}}function hE($){return{id:$.id,...$.pair===void 0?{}:{pair:$.pair},...$.direction===void 0?{}:{direction:$.direction},...$.entryPrice===void 0?{}:{entryPrice:$.entryPrice},...$.entryTime===void 0?{}:{entryTime:$.entryTime},...oN($)}}function rE($){return{id:$.id,exitPrice:$.exitPrice,exitTime:$.exitTime,...$.fees===void 0?{}:{fees:$.fees},...$.swap===void 0?{}:{swap:$.swap},...$.notes===void 0?{}:{notes:$.notes}}}function mE($){return{accountId:$.accountId,status:$.status}}function cE($){return{pair:$.pair,direction:$.direction,entryPrice:$.entryPrice,lotSize:$.lotSize,entryTime:$.entryTime,...$.exitPrice===void 0?{}:{exitPrice:$.exitPrice},...$.stopLoss===void 0?{}:{stopLoss:$.stopLoss},...$.takeProfit===void 0?{}:{takeProfit:$.takeProfit},...$.exitTime===void 0?{}:{exitTime:$.exitTime},...$.notes===void 0?{}:{notes:$.notes},...$.timeframe===void 0?{}:{timeframe:$.timeframe},...$.emotionalTag===void 0?{}:{emotionalTag:$.emotionalTag},...$.fees===void 0?{}:{fees:$.fees},...$.swap===void 0?{}:{swap:$.swap},...$.reportedPnl===void 0?{}:{reportedPnl:$.reportedPnl},...$.tags===void 0?{}:{tags:$.tags}}}function dE($){return{accountId:$.accountId,trades:$.trades.map(cE)}}function tE($){return{...$.accountId===void 0?{}:{accountId:$.accountId},...$.pair===void 0?{}:{pair:$.pair},...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to}}}var pN={stopLoss:{type:"number"},takeProfit:{type:"number"},lotSize:{type:"number"},notes:{type:"string"},timeframe:{type:"string",description:"e.g. 1h, 4h, 1d"},riskPercent:{type:"number"},tags:{type:"array",items:{type:"string"}}},pE={pair:{type:"string",description:"e.g. EURUSD, BTCUSD"},direction:{type:"string",enum:["LONG","SHORT"]},entryPrice:{type:"number"},exitPrice:{type:"number"},stopLoss:{type:"number"},takeProfit:{type:"number"},lotSize:{type:"number"},entryTime:{type:"string",description:"ISO 8601 datetime"},exitTime:{type:"string",description:"ISO 8601 datetime"},notes:{type:"string"},timeframe:{type:"string",description:"e.g. 1h, 4h, 1d"},emotionalTag:{type:"string"},fees:{type:"number"},swap:{type:"number"},reportedPnl:{type:"number",description:"Broker-reported P&L to store instead of recalculated P&L"},tags:{type:"array",items:{type:"string"}}},aN=[r({name:"list_trades",description:"List the authenticated user's trades. Filter by account, status, pair, or date range (ISO 8601). Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"},status:{type:"string",enum:["OPEN","CLOSED","CANCELLED","ALL"]},pair:{type:"string",description:"e.g. EURUSD, BTCUSD"},from:{type:"string",description:"ISO 8601 datetime (inclusive lower bound)"},to:{type:"string",description:"ISO 8601 datetime (inclusive upper bound)"},page:lK,limit:yK},additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.trades.list.query(yE($))}}),r({name:"get_trade",description:"Get a single trade by id. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.trades.get.query({id:$.id})}}),r({name:"list_accounts",description:"List the user's trading accounts (use an account's id when creating a trade). Requires sign-in.",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.accounts.list.query()}}),r({name:"trade_stats",description:"Trading performance statistics (win rate, PnL, etc.). Filter by account, pair, or date range. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"},pair:{type:"string"},from:{type:"string",description:"ISO 8601 datetime"},to:{type:"string",description:"ISO 8601 datetime"}},additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.analytics.stats.query(tE($))}}),r({name:"create_trade",description:"Record a new trade. Requires sign-in. Use list_accounts to find the accountId.",inputSchema:{type:"object",properties:{accountId:{type:"string",description:"Trading account id (see list_accounts)"},pair:{type:"string",description:"e.g. EURUSD, BTCUSD"},direction:{type:"string",enum:["LONG","SHORT"]},entryPrice:{type:"number"},entryTime:{type:"string",description:"ISO 8601 datetime"},...pN},required:["accountId","pair","direction","entryPrice","entryTime"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.trades.create.mutate(lE($))}}),r({name:"update_trade",description:"Update fields on an existing trade. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"},pair:{type:"string"},direction:{type:"string",enum:["LONG","SHORT"]},entryPrice:{type:"number"},entryTime:{type:"string",description:"ISO 8601 datetime"},...pN},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.trades.update.mutate(hE($))}}),r({name:"close_trade",description:"Close an open trade with an exit price + time. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"},exitPrice:{type:"number"},exitTime:{type:"string",description:"ISO 8601 datetime"},fees:{type:"number"},swap:{type:"number"},notes:{type:"string"}},required:["id","exitPrice","exitTime"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.trades.close.mutate(rE($))}}),r({name:"delete_trade",description:"Permanently delete a single trade by id. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.trades.delete.mutate({id:$.id})}}),r({name:"delete_trades",description:"Permanently delete trades on a specific account. Requires explicit status (OPEN, CLOSED, CANCELLED, or ALL). This cannot be undone. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string",description:"Trading account id to delete from"},status:{type:"string",enum:["OPEN","CLOSED","CANCELLED","ALL"]}},required:["accountId","status"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.trades.deleteMany.mutate(mE($))}}),r({name:"import_trades",description:"Import up to 500 trades into one account. Rows with both exitPrice and exitTime are imported as closed trades. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string",description:"Trading account id to import into"},trades:{type:"array",minItems:1,maxItems:500,items:{type:"object",properties:pE,required:["pair","direction","entryPrice","lotSize","entryTime"],additionalProperties:!1}}},required:["accountId","trades"],additionalProperties:!1},handler:async($,v)=>{return await c(v),v.trpc.trading.trades.importMany.mutate(dE($))}})];function DW(){return[...mK,...aN,...rK,...tN,...cN,...mN,...dN]}var oE="aether-wealth-mcp",aE="0.1.23";function eN($){let v=new JU({name:oE,version:aE},{capabilities:{tools:{listChanged:!1},resources:{listChanged:!1,subscribe:!1},prompts:{listChanged:!1}}});return eE(v,$),v}function eE($,v){let D=!1,I=(X)=>{let G=v.clientGate?.nudge;if(G&&!D)return D=!0,`${G}
|
|
103
|
+
`,$.enqueue(v.encode(U)),!0}catch(U){return this.onerror?.(U),!1}}handleUnsupportedRequest(){return this.onerror?.(Error("Method not allowed.")),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32000,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest($,v){try{let D=$.headers.get("accept");if(!D?.includes("application/json")||!D.includes("text/event-stream"))return this.onerror?.(Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32000,"Not Acceptable: Client must accept both application/json and text/event-stream");let X=$.headers.get("content-type");if(!X||!X.includes("application/json"))return this.onerror?.(Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32000,"Unsupported Media Type: Content-Type must be application/json");let U={headers:Object.fromEntries($.headers.entries()),url:new URL($.url)},G;if(v?.parsedBody!==void 0)G=v.parsedBody;else try{G=await $.json()}catch{return this.onerror?.(Error("Parse error: Invalid JSON")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}let J;try{if(Array.isArray(G))J=G.map((Z)=>xv.parse(Z));else J=[xv.parse(G)]}catch{return this.onerror?.(Error("Parse error: Invalid JSON-RPC message")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}let Q=J.some(Yz);if(Q){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(J.length>1)return this.onerror?.(Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");if(this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized)await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!Q){let Z=this.validateSession($);if(Z)return Z;let F=this.validateProtocolVersion($);if(F)return F}if(!J.some(J6)){for(let Z of J)this.onmessage?.(Z,{authInfo:v?.authInfo,requestInfo:U});return new Response(null,{status:202})}let z=crypto.randomUUID(),Y=J.find((Z)=>Yz(Z)),I=Y?Y.params.protocolVersion:$.headers.get("mcp-protocol-version")??YV;if(this._enableJsonResponse)return new Promise((Z)=>{this._streamMapping.set(z,{resolveJson:Z,cleanup:()=>{this._streamMapping.delete(z)}});for(let F of J)if(J6(F))this._requestToStreamMapping.set(F.id,z);for(let F of J)this.onmessage?.(F,{authInfo:v?.authInfo,requestInfo:U})});let V=new TextEncoder,B,L=new ReadableStream({start:(Z)=>{B=Z},cancel:()=>{this._streamMapping.delete(z)}}),N={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};if(this.sessionId!==void 0)N["mcp-session-id"]=this.sessionId;for(let Z of J)if(J6(Z))this._streamMapping.set(z,{controller:B,encoder:V,cleanup:()=>{this._streamMapping.delete(z);try{B.close()}catch{}}}),this._requestToStreamMapping.set(Z.id,z);await this.writePrimingEvent(B,V,z,I);for(let Z of J){let F,S;if(J6(Z)&&this._eventStore&&I>="2025-11-25")F=()=>{this.closeSSEStream(Z.id)},S=()=>{this.closeStandaloneSSEStream()};this.onmessage?.(Z,{authInfo:v?.authInfo,requestInfo:U,closeSSEStream:F,closeStandaloneSSEStream:S})}return new Response(L,{status:200,headers:N})}catch(D){return this.onerror?.(D),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(D)})}}async handleDeleteRequest($){let v=this.validateSession($);if(v)return v;let D=this.validateProtocolVersion($);if(D)return D;return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),await this.close(),new Response(null,{status:200})}validateSession($){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32000,"Bad Request: Server not initialized");let v=$.headers.get("mcp-session-id");if(!v)return this.onerror?.(Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32000,"Bad Request: Mcp-Session-Id header is required");if(v!==this.sessionId)return this.onerror?.(Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found");return}validateProtocolVersion($){let v=$.headers.get("mcp-protocol-version");if(v!==null&&!K1.includes(v))return this.onerror?.(Error(`Bad Request: Unsupported protocol version: ${v} (supported versions: ${K1.join(", ")})`)),this.createJsonErrorResponse(400,-32000,`Bad Request: Unsupported protocol version: ${v} (supported versions: ${K1.join(", ")})`);return}async close(){this._streamMapping.forEach(({cleanup:$})=>{$()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}closeSSEStream($){let v=this._requestToStreamMapping.get($);if(!v)return;let D=this._streamMapping.get(v);if(D)D.cleanup()}closeStandaloneSSEStream(){let $=this._streamMapping.get(this._standaloneSseStreamId);if($)$.cleanup()}async send($,v){let D=v?.relatedRequestId;if(y4($)||N1($))D=$.id;if(D===void 0){if(y4($)||N1($))throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let G;if(this._eventStore)G=await this._eventStore.storeEvent(this._standaloneSseStreamId,$);let J=this._streamMapping.get(this._standaloneSseStreamId);if(J===void 0)return;if(J.controller&&J.encoder)this.writeSSEEvent(J.controller,J.encoder,$,G);return}let X=this._requestToStreamMapping.get(D);if(!X)throw Error(`No connection established for request ID: ${String(D)}`);let U=this._streamMapping.get(X);if(!this._enableJsonResponse&&U?.controller&&U?.encoder){let G;if(this._eventStore)G=await this._eventStore.storeEvent(X,$);this.writeSSEEvent(U.controller,U.encoder,$,G)}if(y4($)||N1($)){this._requestResponseMap.set(D,$);let G=Array.from(this._requestToStreamMapping.entries()).filter(([Q,W])=>W===X).map(([Q])=>Q);if(G.every((Q)=>this._requestResponseMap.has(Q))){if(!U)throw Error(`No connection established for request ID: ${String(D)}`);if(this._enableJsonResponse&&U.resolveJson){let Q={"Content-Type":"application/json"};if(this.sessionId!==void 0)Q["mcp-session-id"]=this.sessionId;let W=G.map((z)=>this._requestResponseMap.get(z));if(W.length===1)U.resolveJson(new Response(JSON.stringify(W[0]),{status:200,headers:Q}));else U.resolveJson(new Response(JSON.stringify(W),{status:200,headers:Q}))}else U.cleanup();for(let Q of G)this._requestResponseMap.delete(Q),this._requestToStreamMapping.delete(Q)}}}}var Az="/.well-known/oauth-protected-resource",tw={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, DELETE, OPTIONS","access-control-allow-headers":"authorization, content-type, accept, mcp-protocol-version, mcp-session-id, last-event-id","access-control-expose-headers":"mcp-session-id, www-authenticate, retry-after","access-control-max-age":"86400"};function PV($,v,D,X,U){if($.method==="OPTIONS")return new Response(null,{status:204});if($.method==="GET"&&U.has(v.pathname))return F1(200,{resource:`${D.publicOrigin}${X}`,authorization_servers:[D.authorizationServerIssuer],bearer_methods_supported:["header"]});return null}function wz($,v){let D=[...v?[`error="${v}"`]:[],`resource_metadata="${$.publicOrigin}/.well-known/oauth-protected-resource"`];return new Response(JSON.stringify({error:v??"unauthorized"}),{status:401,headers:{"www-authenticate":`Bearer ${D.join(", ")}`,"content-type":"application/json"}})}function bV($){let v=$.headers.get("authorization");if(!v?.startsWith("Bearer "))return null;let D=v.slice(7).trim();return D.length>0?D:null}function F1($,v){return new Response(JSON.stringify(v),{status:$,headers:{"content-type":"application/json"}})}function qV($){let v=new Headers($.headers);for(let[D,X]of Object.entries(tw))v.set(D,X);return new Response($.body,{status:$.status,statusText:$.statusText,headers:v})}function SV($,v){let D=$.headers.get("cf-connecting-ip")??$.headers.get("x-forwarded-for")??"unknown";return v?[`ip:${D}`,`tok:${v}`]:[`ip:${D}`]}class kV{token;userId;constructor($,v){this.token=$;this.userId=v}async getAccessToken(){return this.token}async getUserId(){return this.userId}async login(){throw Error("In hosted mode, sign-in is handled by your MCP client, not a tool.")}async logout(){throw Error("In hosted mode, sign-out is handled by your MCP client, not a tool.")}}function EV($){let v=async(D,X)=>{let U=await fetch(D,X);if(U.status===401)$.onUnauthorized?.();return U};return{session:new kV($.token,$.userId),trpc:p4($.trpcUrl,async()=>$.token,{fetch:v})}}function j1($){return!!$._zod}function Q6($,v){if(j1($))return l6($,v);return $.safeParse(v)}function iD($){if(!$)return;let v;if(j1($))v=$._zod?.def?.shape;else v=$.shape;if(!v)return;if(typeof v==="function")try{return v()}catch{return}return v}function TV($){if(j1($)){let G=$._zod?.def;if(G){if(G.value!==void 0)return G.value;if(Array.isArray(G.values)&&G.values.length>0)return G.values[0]}}let D=$._def;if(D){if(D.value!==void 0)return D.value;if(Array.isArray(D.values)&&D.values.length>0)return D.values[0]}let X=$.value;if(X!==void 0)return X;return}function W6($){return $==="completed"||$==="failed"||$==="cancelled"}var ow=Symbol("Let zodToJsonSchema decide on which parser to use");var Bl=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Mz($){let D=iD($)?.method;if(!D)throw Error("Schema is missing a method literal");let X=TV(D);if(typeof X!=="string")throw Error("Schema method literal must be a string");return X}function Pz($,v){let D=Q6($,v);if(!D.success)throw D.error;return D.data}var UM=60000;class bz{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(SD,(v)=>{this._oncancel(v)}),this.setNotificationHandler(TD,(v)=>{this._onprogress(v)}),this.setRequestHandler(ED,(v)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(RD,async(v,D)=>{let X=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!X)throw new u(C.InvalidParams,"Failed to retrieve task: Task not found");return{...X}}),this.setRequestHandler(uD,async(v,D)=>{let X=async()=>{let U=v.params.taskId;if(this._taskMessageQueue){let J;while(J=await this._taskMessageQueue.dequeue(U,D.sessionId)){if(J.type==="response"||J.type==="error"){let Q=J.message,W=Q.id,z=this._requestResolvers.get(W);if(z)if(this._requestResolvers.delete(W),J.type==="response")z(Q);else{let Y=Q,I=new u(Y.error.code,Y.error.message,Y.error.data);z(I)}else{let Y=J.type==="response"?"Response":"Error";this._onerror(Error(`${Y} handler missing for request ${W}`))}continue}await this._transport?.send(J.message,{relatedRequestId:D.requestId})}}let G=await this._taskStore.getTask(U,D.sessionId);if(!G)throw new u(C.InvalidParams,`Task not found: ${U}`);if(!W6(G.status))return await this._waitForTaskUpdate(U,D.signal),await X();if(W6(G.status)){let J=await this._taskStore.getTaskResult(U,D.sessionId);return this._clearTaskQueue(U),{...J,_meta:{...J._meta,[G6]:{taskId:U}}}}return await X()};return await X()}),this.setRequestHandler(CD,async(v,D)=>{try{let{tasks:X,nextCursor:U}=await this._taskStore.listTasks(v.params?.cursor,D.sessionId);return{tasks:X,nextCursor:U,_meta:{}}}catch(X){throw new u(C.InvalidParams,`Failed to list tasks: ${X instanceof Error?X.message:String(X)}`)}}),this.setRequestHandler(fD,async(v,D)=>{try{let X=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!X)throw new u(C.InvalidParams,`Task not found: ${v.params.taskId}`);if(W6(X.status))throw new u(C.InvalidParams,`Cannot cancel task in terminal status: ${X.status}`);await this._taskStore.updateTaskStatus(v.params.taskId,"cancelled","Client cancelled task execution.",D.sessionId),this._clearTaskQueue(v.params.taskId);let U=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!U)throw new u(C.InvalidParams,`Task not found after cancellation: ${v.params.taskId}`);return{_meta:{},...U}}catch(X){if(X instanceof u)throw X;throw new u(C.InvalidRequest,`Failed to cancel task: ${X instanceof Error?X.message:String(X)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,v,D,X,U=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(X,v),startTime:Date.now(),timeout:v,maxTotalTimeout:D,resetTimeoutOnProgress:U,onTimeout:X})}_resetTimeout($){let v=this._timeoutInfo.get($);if(!v)return!1;let D=Date.now()-v.startTime;if(v.maxTotalTimeout&&D>=v.maxTotalTimeout)throw this._timeoutInfo.delete($),u.fromError(C.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:v.maxTotalTimeout,totalElapsed:D});return clearTimeout(v.timeoutId),v.timeoutId=setTimeout(v.onTimeout,v.timeout),!0}_cleanupTimeout($){let v=this._timeoutInfo.get($);if(v)clearTimeout(v.timeoutId),this._timeoutInfo.delete($)}async connect($){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=$;let v=this.transport?.onclose;this._transport.onclose=()=>{v?.(),this._onclose()};let D=this.transport?.onerror;this._transport.onerror=(U)=>{D?.(U),this._onerror(U)};let X=this._transport?.onmessage;this._transport.onmessage=(U,G)=>{if(X?.(U,G),y4(U)||N1(U))this._onresponse(U);else if(J6(U))this._onrequest(U,G);else if(NV(U))this._onnotification(U);else this._onerror(Error(`Unknown message type: ${JSON.stringify(U)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let D of this._timeoutInfo.values())clearTimeout(D.timeoutId);this._timeoutInfo.clear();for(let D of this._requestHandlerAbortControllers.values())D.abort();this._requestHandlerAbortControllers.clear();let v=u.fromError(C.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let D of $.values())D(v)}_onerror($){this.onerror?.($)}_onnotification($){let v=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(v===void 0)return;Promise.resolve().then(()=>v($)).catch((D)=>this._onerror(Error(`Uncaught error in notification handler: ${D}`)))}_onrequest($,v){let D=this._requestHandlers.get($.method)??this.fallbackRequestHandler,X=this._transport,U=$.params?._meta?.[G6]?.taskId;if(D===void 0){let z={jsonrpc:"2.0",id:$.id,error:{code:C.MethodNotFound,message:"Method not found"}};if(U&&this._taskMessageQueue)this._enqueueTaskMessage(U,{type:"error",message:z,timestamp:Date.now()},X?.sessionId).catch((Y)=>this._onerror(Error(`Failed to enqueue error response: ${Y}`)));else X?.send(z).catch((Y)=>this._onerror(Error(`Failed to send an error response: ${Y}`)));return}let G=new AbortController;this._requestHandlerAbortControllers.set($.id,G);let J=BV($.params)?$.params.task:void 0,Q=this._taskStore?this.requestTaskStore($,X?.sessionId):void 0,W={signal:G.signal,sessionId:X?.sessionId,_meta:$.params?._meta,sendNotification:async(z)=>{if(G.signal.aborted)return;let Y={relatedRequestId:$.id};if(U)Y.relatedTask={taskId:U};await this.notification(z,Y)},sendRequest:async(z,Y,I)=>{if(G.signal.aborted)throw new u(C.ConnectionClosed,"Request was cancelled");let V={...I,relatedRequestId:$.id};if(U&&!V.relatedTask)V.relatedTask={taskId:U};let B=V.relatedTask?.taskId??U;if(B&&Q)await Q.updateTaskStatus(B,"input_required");return await this.request(z,Y,V)},authInfo:v?.authInfo,requestId:$.id,requestInfo:v?.requestInfo,taskId:U,taskStore:Q,taskRequestedTtl:J?.ttl,closeSSEStream:v?.closeSSEStream,closeStandaloneSSEStream:v?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(J)this.assertTaskHandlerCapability($.method)}).then(()=>D($,W)).then(async(z)=>{if(G.signal.aborted)return;let Y={result:z,jsonrpc:"2.0",id:$.id};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"response",message:Y,timestamp:Date.now()},X?.sessionId);else await X?.send(Y)},async(z)=>{if(G.signal.aborted)return;let Y={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(z.code)?z.code:C.InternalError,message:z.message??"Internal error",...z.data!==void 0&&{data:z.data}}};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"error",message:Y,timestamp:Date.now()},X?.sessionId);else await X?.send(Y)}).catch((z)=>this._onerror(Error(`Failed to send response: ${z}`))).finally(()=>{if(this._requestHandlerAbortControllers.get($.id)===G)this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:v,...D}=$.params,X=Number(v),U=this._progressHandlers.get(X);if(!U){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let G=this._responseHandlers.get(X),J=this._timeoutInfo.get(X);if(J&&G&&J.resetTimeoutOnProgress)try{this._resetTimeout(X)}catch(Q){this._responseHandlers.delete(X),this._progressHandlers.delete(X),this._cleanupTimeout(X),G(Q);return}U(D)}_onresponse($){let v=Number($.id),D=this._requestResolvers.get(v);if(D){if(this._requestResolvers.delete(v),y4($))D($);else{let G=new u($.error.code,$.error.message,$.error.data);D(G)}return}let X=this._responseHandlers.get(v);if(X===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(v),this._cleanupTimeout(v);let U=!1;if(y4($)&&$.result&&typeof $.result==="object"){let G=$.result;if(G.task&&typeof G.task==="object"){let J=G.task;if(typeof J.taskId==="string")U=!0,this._taskProgressTokens.set(J.taskId,v)}}if(!U)this._progressHandlers.delete(v);if(y4($))X($);else{let G=u.fromError($.error.code,$.error.message,$.error.data);X(G)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,v,D){let{task:X}=D??{};if(!X){try{yield{type:"result",result:await this.request($,v,D)}}catch(G){yield{type:"error",error:G instanceof u?G:new u(C.InternalError,String(G))}}return}let U;try{let G=await this.request($,Z1,D);if(G.task)U=G.task.taskId,yield{type:"taskCreated",task:G.task};else throw new u(C.InternalError,"Task creation did not return a task");while(!0){let J=await this.getTask({taskId:U},D);if(yield{type:"taskStatus",task:J},W6(J.status)){if(J.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:U},v,D)};else if(J.status==="failed")yield{type:"error",error:new u(C.InternalError,`Task ${U} failed`)};else if(J.status==="cancelled")yield{type:"error",error:new u(C.InternalError,`Task ${U} was cancelled`)};return}if(J.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:U},v,D)};return}let Q=J.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((W)=>setTimeout(W,Q)),D?.signal?.throwIfAborted()}}catch(G){yield{type:"error",error:G instanceof u?G:new u(C.InternalError,String(G))}}}request($,v,D){let{relatedRequestId:X,resumptionToken:U,onresumptiontoken:G,task:J,relatedTask:Q}=D??{};return new Promise((W,z)=>{let Y=(F)=>{z(F)};if(!this._transport){Y(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),J)this.assertTaskCapability($.method)}catch(F){Y(F);return}D?.signal?.throwIfAborted();let I=this._requestMessageId++,V={...$,jsonrpc:"2.0",id:I};if(D?.onprogress)this._progressHandlers.set(I,D.onprogress),V.params={...$.params,_meta:{...$.params?._meta||{},progressToken:I}};if(J)V.params={...V.params,task:J};if(Q)V.params={...V.params,_meta:{...V.params?._meta||{},[G6]:Q}};let B=(F)=>{this._responseHandlers.delete(I),this._progressHandlers.delete(I),this._cleanupTimeout(I),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:I,reason:String(F)}},{relatedRequestId:X,resumptionToken:U,onresumptiontoken:G}).catch((T)=>this._onerror(Error(`Failed to send cancellation: ${T}`)));let S=F instanceof u?F:new u(C.RequestTimeout,String(F));z(S)};this._responseHandlers.set(I,(F)=>{if(D?.signal?.aborted)return;if(F instanceof Error)return z(F);try{let S=Q6(v,F.result);if(!S.success)z(S.error);else W(S.data)}catch(S){z(S)}}),D?.signal?.addEventListener("abort",()=>{B(D?.signal?.reason)});let L=D?.timeout??UM,N=()=>B(u.fromError(C.RequestTimeout,"Request timed out",{timeout:L}));this._setupTimeout(I,L,D?.maxTotalTimeout,N,D?.resetTimeoutOnProgress??!1);let Z=Q?.taskId;if(Z){let F=(S)=>{let T=this._responseHandlers.get(I);if(T)T(S);else this._onerror(Error(`Response handler missing for side-channeled request ${I}`))};this._requestResolvers.set(I,F),this._enqueueTaskMessage(Z,{type:"request",message:V,timestamp:Date.now()}).catch((S)=>{this._cleanupTimeout(I),z(S)})}else this._transport.send(V,{relatedRequestId:X,resumptionToken:U,onresumptiontoken:G}).catch((F)=>{this._cleanupTimeout(I),z(F)})})}async getTask($,v){return this.request({method:"tasks/get",params:$},gD,v)}async getTaskResult($,v,D){return this.request({method:"tasks/result",params:$},v,D)}async listTasks($,v){return this.request({method:"tasks/list",params:$},xD,v)}async cancelTask($,v){return this.request({method:"tasks/cancel",params:$},OV,v)}async notification($,v){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability($.method);let D=v?.relatedTask?.taskId;if(D){let J={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[G6]:v.relatedTask}}};await this._enqueueTaskMessage(D,{type:"notification",message:J,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!v?.relatedRequestId&&!v?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let J={...$,jsonrpc:"2.0"};if(v?.relatedTask)J={...J,params:{...J.params,_meta:{...J.params?._meta||{},[G6]:v.relatedTask}}};this._transport?.send(J,v).catch((Q)=>this._onerror(Q))});return}let G={...$,jsonrpc:"2.0"};if(v?.relatedTask)G={...G,params:{...G.params,_meta:{...G.params?._meta||{},[G6]:v.relatedTask}}};await this._transport.send(G,v)}setRequestHandler($,v){let D=Mz($);this.assertRequestHandlerCapability(D),this._requestHandlers.set(D,(X,U)=>{let G=Pz($,X);return Promise.resolve(v(G,U))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,v){let D=Mz($);this._notificationHandlers.set(D,(X)=>{let U=Pz($,X);return Promise.resolve(v(U))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let v=this._taskProgressTokens.get($);if(v!==void 0)this._progressHandlers.delete(v),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,v,D){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let X=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,v,D,X)}async _clearTaskQueue($,v){if(this._taskMessageQueue){let D=await this._taskMessageQueue.dequeueAll($,v);for(let X of D)if(X.type==="request"&&J6(X.message)){let U=X.message.id,G=this._requestResolvers.get(U);if(G)G(new u(C.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(U);else this._onerror(Error(`Resolver missing for request ${U} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,v){let D=this._options?.defaultTaskPollInterval??1000;try{let X=await this._taskStore?.getTask($);if(X?.pollInterval)D=X.pollInterval}catch{}return new Promise((X,U)=>{if(v.aborted){U(new u(C.InvalidRequest,"Request cancelled"));return}let G=setTimeout(X,D);v.addEventListener("abort",()=>{clearTimeout(G),U(new u(C.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,v){let D=this._taskStore;if(!D)throw Error("No task store configured");return{createTask:async(X)=>{if(!$)throw Error("No request provided");return await D.createTask(X,$.id,{method:$.method,params:$.params},v)},getTask:async(X)=>{let U=await D.getTask(X,v);if(!U)throw new u(C.InvalidParams,"Failed to retrieve task: Task not found");return U},storeTaskResult:async(X,U,G)=>{await D.storeTaskResult(X,U,G,v);let J=await D.getTask(X,v);if(J){let Q=nv.parse({method:"notifications/tasks/status",params:J});if(await this.notification(Q),W6(J.status))this._cleanupTaskProgressHandler(X)}},getTaskResult:(X)=>{return D.getTaskResult(X,v)},updateTaskStatus:async(X,U,G)=>{let J=await D.getTask(X,v);if(!J)throw new u(C.InvalidParams,`Task "${X}" not found - it may have been cleaned up`);if(W6(J.status))throw new u(C.InvalidParams,`Cannot update task "${X}" from terminal status "${J.status}" to "${U}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await D.updateTaskStatus(X,U,G,v);let Q=await D.getTask(X,v);if(Q){let W=nv.parse({method:"notifications/tasks/status",params:Q});if(await this.notification(W),W6(Q.status))this._cleanupTaskProgressHandler(X)}},listTasks:(X)=>{return D.listTasks(X,v)}}}}function RV($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function gV($,v){let D={...$};for(let X in v){let U=X,G=v[U];if(G===void 0)continue;let J=D[U];if(RV(J)&&RV(G))D[U]={...J,...G};else D[U]=G}return D}var KZ=K7(j5(),1),NZ=K7(LZ(),1);function M2(){let $=new KZ.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return NZ.default($),$}class T5{constructor($){this._ajv=$??M2()}getValidator($){let v="$id"in $&&typeof $.$id==="string"?this._ajv.getSchema($.$id)??this._ajv.compile($):this._ajv.compile($);return(D)=>{if(v(D))return{valid:!0,data:D,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(v.errors)}}}}class R5{constructor($){this._server=$}requestStream($,v,D){return this._server.requestStream($,v,D)}createMessageStream($,v){let D=this._server.getClientCapabilities();if(($.tools||$.toolChoice)&&!D?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if($.messages.length>0){let X=$.messages[$.messages.length-1],U=Array.isArray(X.content)?X.content:[X.content],G=U.some((z)=>z.type==="tool_result"),J=$.messages.length>1?$.messages[$.messages.length-2]:void 0,Q=J?Array.isArray(J.content)?J.content:[J.content]:[],W=Q.some((z)=>z.type==="tool_use");if(G){if(U.some((z)=>z.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!W)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(W){let z=new Set(Q.filter((I)=>I.type==="tool_use").map((I)=>I.id)),Y=new Set(U.filter((I)=>I.type==="tool_result").map((I)=>I.toolUseId));if(z.size!==Y.size||![...z].every((I)=>Y.has(I)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:$},tv,v)}elicitInputStream($,v){let D=this._server.getClientCapabilities(),X=$.mode??"form";switch(X){case"url":{if(!D?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!D?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let U=X==="form"&&$.mode===void 0?{...$,mode:"form"}:$;return this.requestStream({method:"elicitation/create",params:U},H1,v)}async getTask($,v){return this._server.getTask({taskId:$},v)}async getTaskResult($,v,D){return this._server.getTaskResult({taskId:$},v,D)}async listTasks($,v){return this._server.listTasks($?{cursor:$}:void 0,v)}async cancelTask($,v){return this._server.cancelTask({taskId:$},v)}}function ZZ($,v,D){if(!$)throw Error(`${D} does not support task creation (required for ${v})`);switch(v){case"tools/call":if(!$.tools?.call)throw Error(`${D} does not support task creation for tools/call (required for ${v})`);break;default:break}}function OZ($,v,D){if(!$)throw Error(`${D} does not support task creation (required for ${v})`);switch(v){case"sampling/createMessage":if(!$.sampling?.createMessage)throw Error(`${D} does not support task creation for sampling/createMessage (required for ${v})`);break;case"elicitation/create":if(!$.elicitation?.create)throw Error(`${D} does not support task creation for elicitation/create (required for ${v})`);break;default:break}}class F0 extends bz{constructor($,v){super(v);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(pv.options.map((D,X)=>[D,X])),this.isMessageIgnored=(D,X)=>{let U=this._loggingLevels.get(X);return U?this.LOG_LEVEL_SEVERITY.get(D)<this.LOG_LEVEL_SEVERITY.get(U):!1},this._capabilities=v?.capabilities??{},this._instructions=v?.instructions,this._jsonSchemaValidator=v?.jsonSchemaValidator??new T5,this.setRequestHandler(kD,(D)=>this._oninitialize(D)),this.setNotificationHandler(Iz,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(Oz,async(D,X)=>{let U=X.sessionId||X.requestInfo?.headers["mcp-session-id"]||void 0,{level:G}=D.params,J=pv.safeParse(G);if(J.success)this._loggingLevels.set(U,J.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new R5(this)};return this._experimental}registerCapabilities($){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=gV(this._capabilities,$)}setRequestHandler($,v){let X=iD($)?.method;if(!X)throw Error("Schema is missing a method literal");let U;if(j1(X)){let J=X;U=J._zod?.def?.value??J.value}else{let J=X;U=J._def?.value??J.value}if(typeof U!=="string")throw Error("Schema method literal must be a string");if(U==="tools/call"){let J=async(Q,W)=>{let z=Q6(b6,Q);if(!z.success){let B=z.error instanceof Error?z.error.message:String(z.error);throw new u(C.InvalidParams,`Invalid tools/call request: ${B}`)}let{params:Y}=z.data,I=await Promise.resolve(v(Q,W));if(Y.task){let B=Q6(Z1,I);if(!B.success){let L=B.error instanceof Error?B.error.message:String(B.error);throw new u(C.InvalidParams,`Invalid task creation result: ${L}`)}return B.data}let V=Q6(_D,I);if(!V.success){let B=V.error instanceof Error?V.error.message:String(V.error);throw new u(C.InvalidParams,`Invalid tools/call result: ${B}`)}return V.data};return super.setRequestHandler($,J)}return super.setRequestHandler($,v)}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw 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 Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw 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 Error(`Server does not support tasks capability (required for ${$})`);break;case"ping":case"initialize":break}}assertTaskCapability($){OZ(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;ZZ(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let v=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:K1.includes(v)?v:Jz,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"},qD)}async createMessage($,v){if($.tools||$.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if($.messages.length>0){let D=$.messages[$.messages.length-1],X=Array.isArray(D.content)?D.content:[D.content],U=X.some((W)=>W.type==="tool_result"),G=$.messages.length>1?$.messages[$.messages.length-2]:void 0,J=G?Array.isArray(G.content)?G.content:[G.content]:[],Q=J.some((W)=>W.type==="tool_use");if(U){if(X.some((W)=>W.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!Q)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(Q){let W=new Set(J.filter((Y)=>Y.type==="tool_use").map((Y)=>Y.id)),z=new Set(X.filter((Y)=>Y.type==="tool_result").map((Y)=>Y.toolUseId));if(W.size!==z.size||![...W].every((Y)=>z.has(Y)))throw 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:$},Hz,v);return this.request({method:"sampling/createMessage",params:$},tv,v)}async elicitInput($,v){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let X=$;return this.request({method:"elicitation/create",params:X},H1,v)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let X=$.mode==="form"?$:{...$,mode:"form"},U=await this.request({method:"elicitation/create",params:X},H1,v);if(U.action==="accept"&&U.content&&X.requestedSchema)try{let J=this._jsonSchemaValidator.getValidator(X.requestedSchema)(U.content);if(!J.valid)throw new u(C.InvalidParams,`Elicitation response content does not match requested schema: ${J.errorMessage}`)}catch(G){if(G instanceof u)throw G;throw new u(C.InternalError,`Error validating elicitation response: ${G instanceof Error?G.message:String(G)}`)}return U}}}createElicitationCompletionNotifier($,v){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},v)}async listRoots($,v){return this.request({method:"roots/list",params:$},Fz,v)}async sendLoggingMessage($,v){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,v))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 g5=[{name:"Trading journal",what:"Log, tag, and review trades across every account and market.",mcp:["list_trades","get_trade","create_trade","update_trade","close_trade","delete_trade","delete_trades","import_trades","trade_stats","list_accounts"],dashboardOnly:["the visual journal with tag and emotion analytics","per-trade chart markers and replay"]},{name:"Alerts",what:"Price, trendline, and indicator alerts that watch the market for you.",mcp:["list_alerts","create_price_alert","create_trendline_alert","create_indicator_alert","list_indicator_alerts","update_indicator_alert","delete_indicator_alert","update_alert","delete_alert"],dashboardOnly:["drawing an alert directly on the chart","the alert inbox and history"]},{name:"Market data & indicators",what:"OHLC candles, technical indicators, and instrument config across markets.",mcp:["get_candles","get_indicators","get_market_config"],dashboardOnly:["the live, interactive multi-market chart"]},{name:"Macro & economic calendar",what:"Scheduled economic events and macro time series.",mcp:["list_economic_calendar","get_macro_series","get_macro_indicator"],dashboardOnly:["the filterable calendar view with per-event alerts"]},{name:"FX macro context",what:"Per-currency and per-pair macro context — recent releases and surprises, model predictions, cross-market risk sentiment, and the source documents (news, press releases) behind them.",mcp:["get_fx_pair_context","get_fx_currency_context","get_fx_predictions","get_fx_risk_sentiment","get_fx_documents","get_fx_sync_state"],dashboardOnly:[]},{name:"Charts",what:"Render a chart image, or drive the chart the user already has open.",mcp:["render_chart","chart_select_pair","chart_change_timeframe","chart_draw_shapes","chart_remove_drawings"],dashboardOnly:["the full charting workspace with drawing tools and saved layouts"]},{name:"Pine Studio",what:"Author and backtest TradingView-style strategies on live data.",mcp:[],dashboardOnly:["the Pine editor, backtests, and turning a script into an alert"]},{name:"Aether Intelligence",what:"The in-app assistant that already sees the chart and the journal.",mcp:[],dashboardOnly:["the in-app chat that can mark up the chart as it answers"]}];function HZ(){let $=["AETHER WEALTH — capability map for assistants","","Aether Wealth is a multi-market trading workspace: charts, a trading journal,","alerts, an economic calendar, and an in-app AI assistant. You reach it two ways:","this MCP server (the tools below) and the web dashboard at",`${x4}. Call get_context first to snapshot the user's live state`,"(accounts, open trades, recent stats, active alerts) before you advise. When a",'task requires something marked "dashboard only", suggest the user open the',"dashboard rather than attempting it over MCP.",""];for(let v of g5)$.push(`## ${v.name}`),$.push(v.what),$.push(v.mcp.length>0?` MCP tools: ${v.mcp.join(", ")}`:" MCP tools: none yet"),$.push(` Dashboard only: ${v.dashboardOnly.join("; ")}`),$.push("");return $.join(`
|
|
104
|
+
`).trimEnd()}var AX=["Aether Wealth spans a trading journal, alerts, market data and indicators, a","macro calendar, charts, Pine Studio, and the Aether Intelligence assistant. Many","of these are callable over MCP; some are dashboard-only."].join(" ");function u5($={}){let v=$.hosted??!1,D=v?["Authentication is handled by the MCP connection itself — there are no sign-in tools to call. If calls fail with an authorization error, the user must re-authorize this connection in their MCP client settings."]:["Auth tools:"," • login — sign in. Opens the browser; the user authenticates and approves access. Call this first if a data tool reports the user is not signed in."," • logout — sign out on this device."],X=v?" 3. If it fails with an authorization error, tell the user to re-authorize the Aether Wealth connection in their MCP client, then retry.":' 3. If it reports "not signed in", call login, wait for the user to finish in the browser, then retry.';return[{name:"getting_started",description:"Brief the LLM on what the Aether Wealth MCP exposes and the sign-in-first flow.",handler:()=>[{role:"user",content:{type:"text",text:["You are connected to the Aether Wealth MCP — programmatic access to the user's trading journal, alerts, market data, indicators, charts, and live-chart controls, over an authenticated connection.","",...D,"","Context:"," • get_context — snapshot accounts, open trades, recent stats, and active alerts in one call. Call it first to ground your suggestions.","","Domains (partial — see the aetherwealth://capabilities resource for the full set):"," • Journal: list_trades, get_trade, create_trade, update_trade, close_trade, delete_trade, delete_trades, import_trades, trade_stats, list_accounts"," • Alerts: list_alerts, create_price_alert, create_trendline_alert, create_indicator_alert, list_indicator_alerts, update_indicator_alert, delete_indicator_alert, update_alert, delete_alert"," • Market data + indicators: get_candles, get_market_config, get_indicators"," • Macro: list_economic_calendar, get_macro_series, get_macro_indicator"," • FX macro context: get_fx_pair_context, get_fx_currency_context, get_fx_predictions, get_fx_risk_sentiment, get_fx_documents, get_fx_sync_state"," • Charts: render_chart, chart_select_pair, chart_change_timeframe, chart_draw_shapes, chart_remove_drawings","","Recommended flow:"," 1. Call get_context to load live state."," 2. Try the data tool the user asked for (e.g. list_trades).",X].join(`
|
|
105
|
+
`)}}]},{name:"dashboard_context",description:"Brief the LLM on the full Aether Wealth surface, grounding in live state, and when to suggest the dashboard.",handler:()=>[{role:"user",content:{type:"text",text:["You are connected to Aether Wealth, a multi-market trading workspace.",AX,"","Before you advise, call get_context to load the user's live state (accounts, open trades, recent stats, active alerts) so your suggestions fit what they are actually doing. The aetherwealth://capabilities resource, if your client attaches it, is the full surface map — which actions are MCP-callable vs dashboard-only.","","When the user needs something that is dashboard-only (the full charting workspace and saved layouts, the Pine editor, the full journal UI, the Aether Intelligence assistant),",`tell them to open the dashboard at ${x4} rather than attempting it over MCP.`].join(`
|
|
106
|
+
`)}}]}]}function C5(){return[{uri:"aetherwealth://capabilities",name:"Aether Wealth capabilities",description:"What Aether Wealth can do across all surfaces, and which actions are MCP-callable vs dashboard-only. Attach for product context.",mimeType:"text/markdown",handler:async()=>({text:HZ()})}]}function FZ($){return $.trading.accounts.list.query()}function x5($){return{triggerType:$.triggerType??"close",isPersistent:$.isPersistent??!1,notifyEmail:$.notifyEmail??!0,notifyPush:$.notifyPush??!0,...$.message===void 0?{}:{message:$.message},...$.expiresAt===void 0?{}:{expiresAt:$.expiresAt}}}function jZ($){return{...$.includeArchived===void 0?{}:{includeArchived:$.includeArchived},...$.pair===void 0?{}:{pair:$.pair}}}function P2($){return{id:$.id,...$.price===void 0?{}:{price:$.price},...$.price1===void 0?{}:{price1:$.price1},...$.price2===void 0?{}:{price2:$.price2},...$.time1===void 0?{}:{time1:$.time1},...$.time2===void 0?{}:{time2:$.time2},...$.condition===void 0?{}:{condition:$.condition},...$.triggerType===void 0?{}:{triggerType:$.triggerType},...$.timeframe===void 0?{}:{timeframe:$.timeframe},...$.isActive===void 0?{}:{isActive:$.isActive},...$.isArchived===void 0?{}:{isArchived:$.isArchived},...$.isPersistent===void 0?{}:{isPersistent:$.isPersistent},...$.notifyEmail===void 0?{}:{notifyEmail:$.notifyEmail},...$.notifyPush===void 0?{}:{notifyPush:$.notifyPush},...$.message===void 0?{}:{message:$.message},...$.expiresAt===void 0?{}:{expiresAt:$.expiresAt}}}function b2($){return{id:$.id,...$.condition===void 0?{}:{condition:$.condition},...$.dedupMode===void 0?{}:{dedupMode:$.dedupMode},...$.triggerType===void 0?{}:{triggerType:$.triggerType},...$.isActive===void 0?{}:{isActive:$.isActive},...$.isArchived===void 0?{}:{isArchived:$.isArchived},...$.isPersistent===void 0?{}:{isPersistent:$.isPersistent},...$.notifyEmail===void 0?{}:{notifyEmail:$.notifyEmail},...$.notifyPush===void 0?{}:{notifyPush:$.notifyPush},...$.message===void 0?{}:{message:$.message},...$.expiresAt===void 0?{}:{expiresAt:$.expiresAt}}}function AZ($,v){return $.alerts.list.query(jZ(v))}function wZ($,v){let D={pair:v.pair,timeframe:v.timeframe,price:v.price,condition:v.condition,...x5(v)};return $.alerts.createPrice.mutate(D)}function MZ($,v){let D={pair:v.pair,timeframe:v.timeframe,price1:v.price1,time1:v.time1,price2:v.price2,time2:v.time2,condition:v.condition,...x5(v)};return $.alerts.createTrendline.mutate(D)}function PZ($,v){return $.alerts.update.mutate(P2(v))}function bZ($,v){return $.alerts.delete.mutate({id:v.id})}function qZ($,v){let D=jZ(v);return $.alerts.indicator.list.query(D)}function SZ($,v){let D={pair:v.pair,timeframe:v.timeframe,indicatorType:v.indicatorType,indicatorParams:v.indicatorParams,outputSeries:v.outputSeries,condition:v.condition,dedupMode:v.dedupMode??"edge",...x5(v)};return $.alerts.indicator.create.mutate(D)}function kZ($,v){return $.alerts.indicator.update.mutate(b2(v))}function EZ($,v){return $.alerts.indicator.delete.mutate({id:v.id})}function q2($){return{pair:$.pair,interval:$.interval,indicators:$.indicators.map((v)=>({name:v.name,...v.params===void 0?{}:{params:v.params}})),...$.outputsize===void 0?{}:{outputsize:$.outputsize}}}function TZ($,v){return $.technicalIndicators.get.query(q2(v))}var RZ=["3m","6m","12m","24m","all"];function S2($){return{...$.currency===void 0?{}:{currency:$.currency},...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to},...$.indicator===void 0?{}:{indicator:$.indicator},...$.impactMin===void 0?{}:{impactMin:$.impactMin},...$.view===void 0?{}:{view:$.view}}}function k2($){return{currency:$.currency,indicator:$.indicator,...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to},...$.limit===void 0?{}:{limit:$.limit}}}function E2($){return{currency:$.currency,indicator:$.indicator,...$.range===void 0?{}:{range:$.range}}}function T2($){return{pair:$.pair,timeframe:$.timeframe,...$.limit===void 0?{}:{limit:$.limit},...$.offset===void 0?{}:{offset:$.offset}}}function wX($,v){return $.marketData.candles.query(T2(v))}function gZ($,v){return $.marketData.listCalendar.query(S2(v))}function uZ($,v){return $.marketData.listIndicatorSeries.query(k2(v))}function CZ($,v){return $.macroIndicator.list.query(E2(v))}function xZ($){return $.marketData.getConfig.query()}function R2($){return{...$.accountId===void 0?{}:{accountId:$.accountId},...$.pair===void 0?{}:{pair:$.pair},...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to}}}function fZ($,v){return $.trading.analytics.stats.query(R2(v))}function g2($){return{...$.accountId===void 0?{}:{accountId:$.accountId},...$.status===void 0||$.status==="ALL"?{}:{status:$.status},...$.pair===void 0?{}:{pair:$.pair},...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to},...$.page===void 0?{}:{page:$.page},...$.limit===void 0?{}:{limit:$.limit}}}function _Z($){return{...$.stopLoss===void 0?{}:{stopLoss:$.stopLoss},...$.takeProfit===void 0?{}:{takeProfit:$.takeProfit},...$.lotSize===void 0?{}:{lotSize:$.lotSize},...$.notes===void 0?{}:{notes:$.notes},...$.timeframe===void 0?{}:{timeframe:$.timeframe},...$.riskPercent===void 0?{}:{riskPercent:$.riskPercent},...$.tags===void 0?{}:{tags:$.tags}}}function u2($){return{accountId:$.accountId,pair:$.pair,direction:$.direction,entryPrice:$.entryPrice,entryTime:$.entryTime,..._Z($)}}function C2($){return{id:$.id,...$.pair===void 0?{}:{pair:$.pair},...$.direction===void 0?{}:{direction:$.direction},...$.entryPrice===void 0?{}:{entryPrice:$.entryPrice},...$.entryTime===void 0?{}:{entryTime:$.entryTime},..._Z($)}}function x2($){return{id:$.id,exitPrice:$.exitPrice,exitTime:$.exitTime,...$.fees===void 0?{}:{fees:$.fees},...$.swap===void 0?{}:{swap:$.swap},...$.notes===void 0?{}:{notes:$.notes}}}function f2($){return{accountId:$.accountId,status:$.status}}function _2($){return{pair:$.pair,direction:$.direction,entryPrice:$.entryPrice,lotSize:$.lotSize,entryTime:$.entryTime,...$.exitPrice===void 0?{}:{exitPrice:$.exitPrice},...$.stopLoss===void 0?{}:{stopLoss:$.stopLoss},...$.takeProfit===void 0?{}:{takeProfit:$.takeProfit},...$.exitTime===void 0?{}:{exitTime:$.exitTime},...$.notes===void 0?{}:{notes:$.notes},...$.timeframe===void 0?{}:{timeframe:$.timeframe},...$.emotionalTag===void 0?{}:{emotionalTag:$.emotionalTag},...$.fees===void 0?{}:{fees:$.fees},...$.swap===void 0?{}:{swap:$.swap},...$.reportedPnl===void 0?{}:{reportedPnl:$.reportedPnl},...$.tags===void 0?{}:{tags:$.tags}}}function i2($){return{accountId:$.accountId,trades:$.trades.map(_2)}}function iZ($,v){return $.trading.trades.list.query(g2(v))}function yZ($,v){return $.trading.trades.get.query({id:v.id})}function nZ($,v){return $.trading.trades.create.mutate(u2(v))}function lZ($,v){return $.trading.trades.update.mutate(C2(v))}function hZ($,v){return $.trading.trades.close.mutate(x2(v))}function mZ($,v){return $.trading.trades.delete.mutate({id:v.id})}function cZ($,v){return $.trading.trades.deleteMany.mutate(f2(v))}function rZ($,v){return $.trading.trades.importMany.mutate(i2(v))}function x($){return $}var f5='Not signed in to Aether Wealth. Call the "login" tool to authenticate, then retry.';async function i($){if(!await $.session.getAccessToken())throw Error(f5)}var dZ={type:"integer",minimum:1,maximum:200,description:"Max rows to return"},pZ={type:"integer",minimum:1,description:"Page number (1-indexed)"};function MX($,v){if(v===null||v===void 0){if($.required&&$.required.length>0)return{ok:!1,reason:`missing required: ${$.required.join(", ")}`};return{ok:!0,args:{}}}if(typeof v!=="object"||Array.isArray(v))return{ok:!1,reason:"args must be an object"};let D=v,X=y2($,D)??n2($,D);return X?{ok:!1,reason:X}:{ok:!0,args:D}}function y2($,v){for(let D of $.required??[])if(!(D in v)||v[D]===void 0||v[D]===null)return`missing required: ${D}`;return null}function n2($,v){if($.additionalProperties!==!1)return null;for(let D of Object.keys(v))if(!(D in $.properties))return`unknown property: ${D}`;return null}var _5={type:"string",enum:["above","below","crosses"]},j0={triggerType:{type:"string",enum:["close","wick"],description:"default: close"},isPersistent:{type:"boolean",description:"Re-arm after firing. default: false"},notifyEmail:{type:"boolean",description:"default: true"},notifyPush:{type:"boolean",description:"default: true"},message:{type:"string"},expiresAt:{type:"string",description:"ISO 8601 datetime"}},PX=[x({name:"list_alerts",description:"List your price + trendline alerts. Optionally include archived or filter by pair. Requires sign-in.",inputSchema:{type:"object",properties:{includeArchived:{type:"boolean"},pair:{type:"string"}},additionalProperties:!1},handler:async($,v)=>{return await i(v),AZ(v.trpc,$)}}),x({name:"create_price_alert",description:"Create a price-level alert (fires when price is above/below/crosses a level). Requires sign-in.",inputSchema:{type:"object",properties:{pair:{type:"string",description:"e.g. EURUSD, BTCUSD"},timeframe:{type:"string",description:"e.g. 1h, 4h, 1d"},price:{type:"number"},condition:_5,...j0},required:["pair","timeframe","price","condition"],additionalProperties:!1},handler:async($,v)=>{return await i(v),wZ(v.trpc,$)}}),x({name:"create_trendline_alert",description:"Create a trendline alert (fires when price crosses a line defined by two points). Requires sign-in.",inputSchema:{type:"object",properties:{pair:{type:"string"},timeframe:{type:"string"},price1:{type:"number"},time1:{type:"string",description:"ISO 8601 datetime of point 1"},price2:{type:"number"},time2:{type:"string",description:"ISO 8601 datetime of point 2"},condition:_5,...j0},required:["pair","timeframe","price1","time1","price2","time2","condition"],additionalProperties:!1},handler:async($,v)=>{return await i(v),MZ(v.trpc,$)}}),x({name:"update_alert",description:"Update a price/trendline alert (e.g. change level, archive, mute). Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"},price:{type:"number"},price1:{type:"number"},price2:{type:"number"},time1:{type:"string"},time2:{type:"string"},condition:_5,timeframe:{type:"string"},isActive:{type:"boolean"},isArchived:{type:"boolean"},...j0},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await i(v),PZ(v.trpc,$)}}),x({name:"delete_alert",description:"Delete a price/trendline alert by id. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await i(v),bZ(v.trpc,$)}}),x({name:"list_indicator_alerts",description:"List your indicator-based alerts. Optionally include archived or filter by pair. Requires sign-in.",inputSchema:{type:"object",properties:{includeArchived:{type:"boolean"},pair:{type:"string"}},additionalProperties:!1},handler:async($,v)=>{return await i(v),qZ(v.trpc,$)}}),x({name:"create_indicator_alert",description:"Create an indicator alert (fires on an indicator output condition, e.g. RSI crosses 70). `condition` is { op, threshold } or { op, other }. Requires sign-in.",inputSchema:{type:"object",properties:{pair:{type:"string"},timeframe:{type:"string"},indicatorType:{type:"string",description:"e.g. rsi, ema, macd"},indicatorParams:{type:"object",description:"Indicator settings, e.g. { length: 14 }"},outputSeries:{type:"string",description:"Which output series to watch"},condition:{type:"object",description:"{ op: gt|gte|lt|lte|eq|crosses_above|crosses_below, threshold } or { op: *_series, other }"},dedupMode:{type:"string",enum:["edge","continuous"],description:"default: edge"},...j0},required:["pair","timeframe","indicatorType","indicatorParams","outputSeries","condition"],additionalProperties:!1},handler:async($,v)=>{return await i(v),SZ(v.trpc,$)}}),x({name:"update_indicator_alert",description:"Update an indicator alert (condition, dedup, archive, mute). Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"},condition:{type:"object"},dedupMode:{type:"string",enum:["edge","continuous"]},isActive:{type:"boolean"},isArchived:{type:"boolean"},...j0},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await i(v),kZ(v.trpc,$)}}),x({name:"delete_indicator_alert",description:"Delete an indicator alert by id. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await i(v),EZ(v.trpc,$)}})];var bX=[x({name:"login",description:"Sign in to Aether Wealth. Opens your browser to authenticate; once you approve, the MCP stores a per-user token and the data tools become available.",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await v.session.login(),{status:"signed_in",message:"Signed in to Aether Wealth."}}}),x({name:"logout",description:"Sign out of Aether Wealth on this device. Clears the stored access token.",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await v.session.logout(),{status:"signed_out",message:"Signed out on this device."}}})];var K$=($,v,D,X)=>{return{id:$,displayName:`${$.slice(0,3)}/${$.slice(3)}`,kind:"forex",exchange:"FX",region:"GLOBAL",category:D,pipSize:X?.pipSize??0.0001,priceDecimals:X?.priceDecimals??5,contractSize:1e5,providers:{twelvedata:v}}},l2=[K$("AUDUSD","AUD/USD","Forex Majors"),K$("EURUSD","EUR/USD","Forex Majors"),K$("GBPUSD","GBP/USD","Forex Majors"),K$("USDCAD","USD/CAD","Forex Majors"),K$("USDCHF","USD/CHF","Forex Majors"),K$("USDJPY","USD/JPY","Forex Majors",{pipSize:0.01,priceDecimals:3}),K$("AUDCAD","AUD/CAD","Forex Minors"),K$("AUDCHF","AUD/CHF","Forex Minors"),K$("AUDJPY","AUD/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),K$("AUDNZD","AUD/NZD","Forex Minors"),K$("EURAUD","EUR/AUD","Forex Minors"),K$("EURCAD","EUR/CAD","Forex Minors"),K$("EURCHF","EUR/CHF","Forex Minors"),K$("EURGBP","EUR/GBP","Forex Minors"),K$("EURJPY","EUR/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),K$("EURNZD","EUR/NZD","Forex Minors"),K$("GBPAUD","GBP/AUD","Forex Minors"),K$("GBPCAD","GBP/CAD","Forex Minors"),K$("GBPCHF","GBP/CHF","Forex Minors"),K$("GBPJPY","GBP/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),K$("GBPNZD","GBP/NZD","Forex Minors")],h2=[{id:"XAUUSD",displayName:"Gold",kind:"metal",exchange:"OTC",region:"GLOBAL",category:"Metals",pipSize:0.01,priceDecimals:2,contractSize:100,providers:{twelvedata:"XAU/USD"}},{id:"XAGUSD",displayName:"Silver",kind:"metal",exchange:"OTC",region:"GLOBAL",category:"Metals",pipSize:0.001,priceDecimals:3,contractSize:5000,providers:{twelvedata:"XAG/USD"}}];function R$($,v,D=!1){return{id:$,displayName:`${$.slice(0,-3)}/USD`,kind:"crypto",exchange:"CRYPTO",region:"GLOBAL",category:"Crypto",pipSize:D?0.0001:0.01,priceDecimals:D?5:2,contractSize:1,providers:{twelvedata:v}}}var m2=[R$("BTCUSD","BTC/USD"),R$("ETHUSD","ETH/USD"),R$("SOLUSD","SOL/USD"),R$("BNBUSD","BNB/USD"),R$("AVAXUSD","AVAX/USD"),R$("LINKUSD","LINK/USD"),R$("LTCUSD","LTC/USD"),R$("BCHUSD","BCH/USD"),R$("ATOMUSD","ATOM/USD"),R$("TONUSD","TON/USD"),R$("DOTUSD","DOT/USD"),R$("XRPUSD","XRP/USD",!0),R$("ADAUSD","ADA/USD",!0),R$("DOGEUSD","DOGE/USD",!0),R$("TRXUSD","TRX/USD",!0),R$("POLUSD","POL/USD",!0)],c2=[{id:"NAS100",displayName:"Nasdaq 100",kind:"index",exchange:"NASDAQ",region:"US",category:"Indices",pipSize:0.01,priceDecimals:2,contractSize:20,providers:{twelvedata:"QQQ"}}],r2=[{id:"USOIL",displayName:"WTI Crude",kind:"commodity",exchange:"NYMEX",region:"US",category:"Commodities",pipSize:0.01,priceDecimals:2,contractSize:1000,providers:{twelvedata:"WTI/USD"}}];function k4($,v,D){return{id:$,displayName:D,kind:"stock",exchange:"NSE",region:"IN",category:"Indian Stocks",pipSize:0.05,priceDecimals:2,contractSize:1,providers:{twelvedata:v}}}var d2=[{id:"NIFTYBEES",displayName:"NIFTY 50 ETF",kind:"index",exchange:"BSE",region:"IN",category:"Indian Indices",pipSize:0.01,priceDecimals:2,contractSize:1,providers:{twelvedata:"NIFTYBEES:BSE"}},{id:"BANKBEES",displayName:"BANK NIFTY ETF",kind:"index",exchange:"BSE",region:"IN",category:"Indian Indices",pipSize:0.01,priceDecimals:2,contractSize:1,providers:{twelvedata:"BANKBEES:BSE"}},k4("RELIANCE","RELIANCE:NSE","Reliance Industries"),k4("TCS","TCS:NSE","Tata Consultancy Services"),k4("HDFCBANK","HDFCBANK:NSE","HDFC Bank"),k4("INFY","INFY:NSE","Infosys"),k4("ICICIBANK","ICICIBANK:NSE","ICICI Bank"),k4("BHARTIARTL","BHARTIARTL:NSE","Bharti Airtel"),k4("LT","LT:NSE","Larsen & Toubro"),k4("SBIN","SBIN:NSE","State Bank of India"),k4("AXISBANK","AXISBANK:NSE","Axis Bank"),k4("KOTAKBANK","KOTAKBANK:NSE","Kotak Mahindra Bank")],qX=Object.freeze([...l2,...h2,...m2,...c2,...r2,...d2]);class A0{byKey;instruments;providerNames;constructor($){this.instruments=Object.freeze([...$]);let v=new Map,D=new Set;for(let X of $){if(i5(v,X.id,X,"id"),X.displayName!==X.id)i5(v,X.displayName,X,"displayName");for(let[U,G]of Object.entries(X.providers))if(D.add(U),i5(v,tZ(U,G),X,"provider"),!v.has(G))v.set(G,X)}this.byKey=v,this.providerNames=D}resolve($){let v=this.byKey.get($);if(v)return v;let D=$.toUpperCase();if(D!==$){let U=this.byKey.get(D);if(U)return U}let X=$.toLowerCase();if(X!==$)return this.byKey.get(X)??null;return null}require($){let v=this.resolve($);if(!v)throw Error(`Unknown instrument: ${JSON.stringify($)}. Add it to INSTRUMENTS env var or check the key you passed in.`);return v}resolveByProvider($,v){return this.byKey.get(tZ($,v))??null}list(){return this.instruments}byKind($){return this.instruments.filter((v)=>v.kind===$)}byExchange($){return this.instruments.filter((v)=>v.exchange===$)}byRegion($){return this.instruments.filter((v)=>v.region===$)}byCategory($){return this.instruments.filter((v)=>v.category===$)}groupByCategory(){let $=new Map;for(let v of this.instruments){let D=$.get(v.category);if(D)D.push(v);else $.set(v.category,[v])}return Array.from($.entries()).map(([v,D])=>({category:v,instruments:D}))}has($){return this.byKey.has($)}stats(){return{instrumentCount:this.instruments.length,providerCount:this.providerNames.size,providers:Array.from(this.providerNames).sort()}}}function tZ($,v){return`${$}:${v}`}function i5($,v,D,X){if(X==="provider"){if($.has(v))throw Error(`Duplicate provider symbol ${JSON.stringify(v)} declared by multiple instruments in INSTRUMENTS`)}else if($.has(v))throw Error(`Duplicate instrument ${X} ${JSON.stringify(v)} in INSTRUMENTS (already mapped to ${$.get(v)?.id}, now also to ${D.id})`);$.set(v,D)}var t2=["forex","metal","crypto","index","commodity","stock","bond"],o2=c.object({kind:c.enum(t2),displayName:c.string().min(1).optional(),exchange:c.string().min(1).optional(),region:c.string().min(1).optional(),category:c.string().min(1).optional(),pipSize:c.number().positive().optional(),priceDecimals:c.number().int().min(0).max(12).optional(),contractSize:c.number().positive().optional(),providers:c.record(c.string().min(1),c.string().min(1))}),td=c.record(c.string().min(1),o2).refine(($)=>Object.keys($).length>0,{message:"INSTRUMENTS must contain at least one entry"});var a2=Object.freeze({AUDUSD:{quote:"https://logo.twelvedata.com/forex/usd.png",base:"https://logo.twelvedata.com/forex/aud.png"},EURUSD:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/usd.png"},GBPUSD:{quote:"https://logo.twelvedata.com/forex/usd.png",base:"https://logo.twelvedata.com/forex/gbp.png"},USDCAD:{base:"https://logo.twelvedata.com/forex/usd.png",quote:"https://logo.twelvedata.com/forex/cad.png"},USDCHF:{base:"https://logo.twelvedata.com/forex/usd.png",quote:"https://logo.twelvedata.com/forex/chf.png"},USDJPY:{base:"https://logo.twelvedata.com/forex/usd.png",quote:"https://logo.twelvedata.com/forex/jpy.png"},AUDCAD:{base:"https://logo.twelvedata.com/forex/aud.png",quote:"https://logo.twelvedata.com/forex/cad.png"},AUDCHF:{base:"https://logo.twelvedata.com/forex/aud.png",quote:"https://logo.twelvedata.com/forex/chf.png"},AUDJPY:{base:"https://logo.twelvedata.com/forex/aud.png",quote:"https://logo.twelvedata.com/forex/jpy.png"},AUDNZD:{base:"https://logo.twelvedata.com/forex/aud.png",quote:"https://logo.twelvedata.com/forex/nzd.png"},EURAUD:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/aud.png"},EURCAD:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/cad.png"},EURCHF:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/chf.png"},EURGBP:{quote:"https://logo.twelvedata.com/forex/gbp.png",base:"https://logo.twelvedata.com/forex/eur.png"},EURJPY:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/jpy.png"},EURNZD:{base:"https://logo.twelvedata.com/forex/eur.png",quote:"https://logo.twelvedata.com/forex/nzd.png"},GBPAUD:{base:"https://logo.twelvedata.com/forex/gbp.png",quote:"https://logo.twelvedata.com/forex/aud.png"},GBPCAD:{base:"https://logo.twelvedata.com/forex/gbp.png",quote:"https://logo.twelvedata.com/forex/cad.png"},GBPCHF:{quote:"https://logo.twelvedata.com/forex/chf.png",base:"https://logo.twelvedata.com/forex/gbp.png"},GBPJPY:{base:"https://logo.twelvedata.com/forex/gbp.png",quote:"https://logo.twelvedata.com/forex/jpy.png"},GBPNZD:{base:"https://logo.twelvedata.com/forex/gbp.png",quote:"https://logo.twelvedata.com/forex/nzd.png"},BTCUSD:{base:"https://logo.twelvedata.com/crypto/btc.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},ETHUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/eth.png"},SOLUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/sol.png"},BNBUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/bnb.png"},AVAXUSD:{url:"https://assets.coingecko.com/coins/images/12559/large/Avalanche_Circle_RedWhite_Trans.png"},LINKUSD:{base:"https://logo.twelvedata.com/crypto/link.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},LTCUSD:{base:"https://logo.twelvedata.com/crypto/ltc.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},BCHUSD:{base:"https://logo.twelvedata.com/crypto/bch.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},ATOMUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/atom.png"},TONUSD:{url:"https://assets.coingecko.com/coins/images/17980/large/ton_symbol.png"},DOTUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/dot.png"},XRPUSD:{base:"https://logo.twelvedata.com/crypto/xrp.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},ADAUSD:{quote:"https://logo.twelvedata.com/crypto/usd.png",base:"https://logo.twelvedata.com/crypto/ada.png"},DOGEUSD:{base:"https://logo.twelvedata.com/crypto/doge.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},TRXUSD:{base:"https://logo.twelvedata.com/crypto/trx.png",quote:"https://logo.twelvedata.com/crypto/usd.png"},POLUSD:{url:"https://assets.coingecko.com/coins/images/4713/large/polygon.png"},RELIANCE:{url:"https://api.twelvedata.com/logo/ril.com"},TCS:{url:"https://api.twelvedata.com/logo/tcs.com"},HDFCBANK:{url:"https://api.twelvedata.com/logo/hdfcbank.com"},INFY:{url:"https://api.twelvedata.com/logo/infosys.com"},ICICIBANK:{url:"https://api.twelvedata.com/logo/icicibank.com"},BHARTIARTL:{url:"https://api.twelvedata.com/logo/airtel.in"},LT:{url:"https://api.twelvedata.com/logo/larsentoubro.com"},SBIN:{url:"https://api.twelvedata.com/logo/sbi.co.in"},AXISBANK:{url:"https://api.twelvedata.com/logo/axisbank.com"},KOTAKBANK:{url:"https://api.twelvedata.com/logo/kotak.com"}});function y5($,v){return Number(v.toFixed($.priceDecimals))}var g$="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif",n5=11,l5=15,h5=11,m5=13,oZ=12,SX=17,aZ=26,eZ=0.85,sZ=20,$O=8,vO=64,UO=26,C1=18,kX=16,DO=20,XO=300,c5=120,GO=1280,JO=720,QO=2,WO=!0,zO=320,YO=2560,IO=240,VO=1440,BO=1,LO=3,EX={dark:{background:"#0F0F0F",text:"#D9D9D9",mutedText:"#8A8D96",grid:"rgba(242, 242, 242, 0.06)",axisBorder:"#2B2B43",upCandle:"#10b981",downCandle:"#ef4444",markerText:"#F2F2F2",headerText:"#E8E8EA",badgeBg:"rgba(255, 255, 255, 0.08)",badgeText:"#A6AAB4",watermarkText:"#D9D9D9",tagText:"#FFFFFF",entryTag:"#363C4E"},light:{background:"#FFFFFF",text:"#191919",mutedText:"#6A6E78",grid:"rgba(0, 0, 0, 0.06)",axisBorder:"#E0E3EB",upCandle:"#10b981",downCandle:"#ef4444",markerText:"#191919",headerText:"#131722",badgeBg:"rgba(0, 0, 0, 0.06)",badgeText:"#5F6470",watermarkText:"#191919",tagText:"#FFFFFF",entryTag:"#68707F"}},r5=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function KO($,v){if(!Number.isFinite(v))return"0.00000";if(!$)return v.toFixed(5);return y5($,v).toFixed($.priceDecimals)}function NO($,v,D){let X=new Date(v*1000);if(vR($)){if(D===void 0||GR(D,v))return DR(X);return UR(X)}return XR(X)}function vR($){let v=$.trim();if(v.length===0)return!0;if(/^\d*[DWM]$/.test(v))return!1;if(/(d|w|mo|month)/i.test(v))return!1;return!0}function w0($,v,D){let U=`${$>0?"+":""}${$.toFixed(D)}`;if(v===null||!Number.isFinite(v))return U;let G=v>0?"+":"";return`${U} (${G}${v.toFixed(2)}%)`}function UR($){return`${TX($.getUTCHours())}:${TX($.getUTCMinutes())}`}function DR($){return`${TX($.getUTCDate())} ${r5[$.getUTCMonth()]}`}function XR($){return`${TX($.getUTCDate())} ${r5[$.getUTCMonth()]} '${String($.getUTCFullYear()).slice(-2)}`}function GR($,v){let D=new Date($*1000),X=new Date(v*1000);return D.getUTCFullYear()!==X.getUTCFullYear()||D.getUTCMonth()!==X.getUTCMonth()||D.getUTCDate()!==X.getUTCDate()}function TX($){return String($).padStart(2,"0")}var ZO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAARw0lEQVR4nN1bd1hU17af/BUHYShKmRmGmYGhg7ShM/Q+9F6GIkgNvfeOgDQVkFjBhsZo1Ch2Rb1G7MZoLDHN3HuTl7ybe/Ni/rj3vu+7v/edM8NQBAUdMHnn+9Y3cObM2Wv99m+tvfbae1Mor77ekVOkW1EV6E1UBfoYlUZ/LKfA+E2OxsDvShQYv1FpjEekjgr0RjlFuuU8bHvp9c4yGiNKjkZ/8taNe00hOotKY0YQtlAWcr1LY+nIKdCvv20DZMcO+vi7iurceRm/TJ7uRKUxfnzrSsueDX9brsh0f6nxyxWZbnI0+r/ftrKLJ/R/LZPXcJmd9orqXCqN8dOioK9An6kI5BWZb40J79I0eTPtf2cxfV5eiQm6pi54uibg8kxAU9GSArH8rQBBvzotMC6jMaIXq9fllTRhaLgKkWG+yMuIRm1BIlpr0pEQFwkW24h8ZrmiWJaUCYoa4ZO9vwhD3QQAiiosKChrQpOlA29XO8QEuqIg2R+bWzOwb1MVUpLioaLGlTJlyQCgMR6R1lNpGvxFb0wChqo6B86OthCF+SIl0g31WQE4uq0cw4N14Ns4StiwpC5hQaEq0JuXwvjJ/zWgw+PBy8UGEf72WBPuhIG6GFw8tBYZaUmS52YGzUlxcrCDvq6+rHRrIAAYWyoGEMLVNYMwMBwVZWWoKstHXroIWXEeaM31wrXDDehqzYOKmvacbPB0toY+T0c2esnTz1PkFOhfLAXdiMgfn5CCgf5+7Nm1E/tGduPQhx/g+LEjODAyhLbKTDRkumP8gzyMbK4Gi2O06C5BpdEfU+QUGM8X23illRzk5hehr28DWpoa0dHehg29Pdi6ZRNG9uzE6PGjuHL5Ao7s24yukmCc2CTC0IYicHVNXgBhuSx1U2A8pywF9dOz3kNrSzPKSorR1FCPzo529G/cgG1bNmPv7l04dHA/To4exe3r1zF+cRTrKyMxUOaD3uYM8PRNJSAsjo6Uxe79sIg4VFVVIicnG+Xlpaivq8Ha1mb0dHdicFM/dg3vwMED+0lXOHtqFLdvXseDu+PY2pKEqmQ7NFUkgcUxXDT9KItpPN/GBQUF+UhKTkRWdiYKiwpQUVmOxvo6dLStxcb1PSQL9u3dgyMfHcK5Mydx9U8X8PDze/jy8S205YciQWiJ0vcioUbn/rEA0GDqYXVKKmJjY5GYmIj09HTk5OSgqKgI1VVVaG5qRE9XJwYH+jE8tAMfHTyAM6dHMX7lEu7eHMdXX36Bp/fHkRRsDz9nM8THCMmEava5xe8QAB+/INL48PAIxMfHIzk5mQQhLy8PZWWlqKurQTvJgl4JC3bj+PGj+OTyGD69dQOf37uLv/33Dzh2aARUeXWYmZsj0N/5j8EAQ2M+oqOj4evri5CQEPJvAoSUlBRkZ2ejqKgQ1dWVaG5uRDcRCwb6sZNkwYe4dPE87ty+js8ffIrHD+/jHz//hPSMbPK97q52sLIw+30CQJXQkhjvvX384e3tDS8vLwQGBiI8PBwxMTFISkpCRkYG8vPzUEnEgsZ6rFsnHhF2bNuKgwc+wOmTx3H1k0u4d/cWHn7+Gf783Td4+sUj6BtZke/39XAEnSmJBzJwBYqse9/U3BY+Pj5wdnYmAfD39ydZEBUVhYSEBKSnpSMvPw/lFWWor69FW7vYDba8P0gOiUePHMLYhTO4dXOcBODJowd4/uvfMbh5K/l+JosHB77l74sBVElPqKhx4OruAUeBAAJnZ3h4eJBuEBQUhMjISCQkiINhbm4uSkvFcaBtbSt6e7rIIXF4x3Yc2L8Pp06MYvyTK/js0zt49Og+vv7qCf7r+7/AycVHDLKRCTgc3Rl60F8rQFJk2ftGplZwcnaGja0tHJ0c4ebmBj8/PwQECBEcHIzw8DDEx8UhIz0dBfn5KC0pRk1NFTkk9m1cj+3btmBkz24cPnQQ586cxvVrV/Hg/qd4/Og+fv3lZ2zbvoNsR2kFC4b6RjLJCimyMn6lujYcHBxhbWcDG1sbODk5keLg6Ah/YQA5BG4aHMDxY0dx+eIYbt+8gRvXxnHu7GmM7N2N9zcNYFN/H4a2b8O+kb34+MhHuDR2HnduXSfzgmfffknGA3MrJ7EraPKgrsGRts9k66OpLBZ62uy3A4CRkTns7e1hbWMDO3s7WPP5EAqFaG1twcULp/H44V08uH8HDz67i/uf3cXDR/fx7NnXeP78F/zvv/+JH3/4HufPniEBGB7ajg8P7MeJ0WO4cvmi2BUeimNBbV0j2R5NmQUlFU1pINRk6yE11BJs5sS8gb50AKxQ48LewRGODvawt+HDy8MDjbXVOHVsBKeO70RnezXWpIhId3BxdYGzswDu7m4IDAxAdnYmurvW4cqfLuOXf/wd3337DZkVEsmRODs8jWtXP8G9u7fx/V+/w6VLY1MqR/Q3TooosgDA1MQS3p5u8HRzRFZqInZu7sTWjbVITQyDvZ01LCwsYWHFh429Hdw8PeBLxoUAkiFe3l7w9HRHYKAQFRXlJBA//PUvOHvmFDltPnb0CC6cP0vGAyIWPPv2Kewc3KSzxAkAZn4uGQCqGlwE+LkjOswPDaVp6GsvRGKcENbWVrCzIwKhB7y8PCEMCEB4RAR8/YSwsnGEtq4pGCx9MLUMwNY2hL6hGVaZWUDo74udw0N49s3XOH3yBPaP7MHJ0eO4fPECbty4hp9+/DMys7LEzFPnkAa/CQsobwoAEfjKs2Owvn41St+LhrOTAxydnMUJUFgYIiIikZaWhsioGBivsoHiiomS+HSZMGKlOhf6BqZY19GGL58+wdHDH5EJ0tnTJ3H50hieffMUfRt7yGe1uEZQZ/Beq+dlAoAm2wANxYnYsjYJSTF+cHZxRWhoKFJSkpCamoKMjHRUVlbAxy8YCsqsV75vam+qaXDQ29uD+/fukgnSsaOHce7MKTJFPjF6iHxGg8mDm4fX0gOwXFKcyFwdgeGuNESH+iMwMASZ6WtQXFyI4uIiVFSUobNrHRwEnrP29MvfLw5ydKYO2fvE6LB71zBGj32MG9ev4fLFk1CXTI+9fXykMWFJAFguMd7MzAw7egqQGBsKUXwcykuL0VBfS1Z8WluasG/vXghcfclniWWwhfYQsaBCfDo5e+HK5UvYvXOYLJxcGruAK2MnwNM1Jr/X0TNGYlIi2DqmS8cAFTVttNXnovC9ZORkp6G5sR5trS3o7lxHzvGJoStpdfo0Q15XCOC6uroxeuwomSqfOnECF899DAPDyVIZEWjDwqNmZ9grgKcsTCHxy0qLs9BcU4SinEx0tjWjp6sLgwN9GOjbgLEL59DXt0lK5TeJ0BOu4OcfRgKwZfMgjhz+CKMf7yN7fuI5HV0TpKamwlEgjgcTQJBsJdp/iQ6UhSojEsWht6MOpbmZ6O1oRt+GXmx+fxCbBzfh8KEPcfv2TZiY2U37zZsKMVTuHN4pLpzs24uDH+wCgzm5NqCsyoarqxtWr04FU2uyfqhB54AxMXWeIzOkzM948aetnQAbu5pQXpSP7rY6bOzpJosZhGLbt27F0yeP0NLSIRPqT3MDGgOta9uweXAAQ0PbsWtoEMtnGMTi6JMVqIDA8Gn3LcxNwX5h5rgAAKgS+iirctFQW4j6mgqsba5FT+da9PZ0o79vA/o3rifH66++fAq+3WSWJhPjJe1XVNRgfU83OVdoaqx84XtibiAQuJA5h6GJtfR7VTU2gn1dXx+A5RJDIqMi0Lm2BlVVZWhrqUd7aws62teiq7MDvd3duHl9HAc+OPDaKemrACgoLEZbayuGtg0iQRQtYdl0kM0srMm6Q3hEzLT7Xq6OMDYymT8Ay2es13N5xmhuKENZaTGqq8pQX1uOutoqNNTVorGhDut7u3H3zi0UFpVL6S/rJa28vEI01Nfj/Q3t4FvZzsoytrYROeESiUSw5Auk9y0tLeHsZDd/APT1DaGrayD9PzEhGtWVJcjLyUVJUSFKiwkpQmlpMUqKC7Ghtxu3blyDrzBMqhixL0BWxtNZBigvr0BNdSWaaormZAnBCBtbe7L+KEpIlgJkaWmF4AD3+QNAnUJfXX1TlJfkIC01FZkZacjOykBWZgayszKRlZVB3hvo30gWMy2moK6qzobyCtYbucOEAbYOrigoKERLYyX8/bxn7f0JYXEMyBIcUXozs3Qg79nb2sLHQzB/AOSmSEiQEFnpaxAXH4vkpASsTkokKUYUOOPjRUhMEJE5+/DQVugZWEh/p7xCE1wO742qtxPARccmIDcnF2XFWdLJ1Iv7DiQ7Ulaw4OrqjnhRPDkBI+4F+7rAhm+1cADUGNqIjwtDaGgIQsPCEBUVidiYaISGEvfCEBQUTH7X0NiATf09JFum9o7VKhOwtF5vLX/iHabmdkhLz0RNRSH41hLff8VvjYwtEBkRjpTkZOjorkJKrBAr1dgLB8Dc3Aox0WHiAoZQiKDgYLLEHRAYQE53iYIGQbeSkjJ0r2uBkan5NOUZDA7C/QRQkOQE8y1iTvxenamL2PgklBVkI8hfXBGej7C5hggJCkR0VDRyMuPh4yF2hQUDIBC4QCBwhrm5NRlcPDw8wbe2h6GJOZl+anEMYGxigcTE1ejuaIaNjY3UgAljPQV85CSHQI42mRjNXOqeLUao0nkIDY9CYUE2fL08FuQyKqpseHp6IS05Dk0lcVBeqblwAJRXakFP31Q61hILk3RNHrnfb6bSXt7+qK0pQ4CvJAma8a68ZCFaiqPA5hi8NChO3NfRNSNjTGpqIqwsxaAuBABCZx9fTxStCYIt3xIK0n2JCwFAlUMaPLOBabs1JH/rGVoiI30NkkUh0w2UZmma6CiLxJYWEYJ9BeDzLcHVNpS6BhHYiHzfxMwaoSEhSE2Oh4+nJ+isuVPYWV1H8qmixkZssAAGPB609UyhxTVYOAAr1LlQZ+hMq9TMHXm14Ovnj8yUGOjyZt/BtUKNjY7qeAw2xkDoYgVvdwGiQv3g4+WOAH8fRIQFITDADzY2tmBoTra7EAAIoTO4ELpagcsWT4IMjMyhzTNeOACKKiworWTPWxEdPRPERocjwMtpTnoSZbHmqmQ0VcRBSTKcqahqQYOhDRpR41+gsUQsmaqbuYkhIn35MNabZI7JKkuy6DonAFQFxq+zf0lf8JZYjo4RhJ4C6OnNTTlCEkWBOLSnGqIY/xcCIk2ys3SqkURFiXA3BSUiuE7Xi2h3lZE+RAF8JAQ6gK2lPbkhW4lJrkEwWHpz6M74H4qst8kSBjjbWWGl2uSG6KmgTgRVI2NT7NlajWtnNqKiKBm6eqbzpjxhtIGeHoI8rJEV44QCkTO8Hc2xQlXc5gSoDBYP9vaOc2aNVGK7LFWBfkFWxk8EIVV1LVhbmEJxji0tUxUKEnrj+th2/PPnq7h1aSvaGrKQtjoaaaJQJEf7IiLYA36+roiL9MKaBG9U5gShozgQ7fmeaMz0RLSPJQymUH6qaLH1ydT4pRslqcQBIxkyYKLH1TTYMDY0gqLEt2fr3UkgmOSCyNkjG/Cf387iP7/sxvP7bfj6QiXuHC7B5T25ODaQgP3tYegr80NRrANi/CywylAXNGnhZXqQJuoDRKXoFayqoxCnq2QLwPRcgsvVlYIwO52ZL6SxhVnROLItH1f2rMH5wViMNAegM8cF5QkOSAnkI9LbCj6OZlipJplxSowkYoSyKguqGpw55wzTRIlpRm6XJ4/CyRoAScOEPyqteHWEf3GrvCYMDM0Q5O+OjMQAlGcEoWi1Jynp0QLECK3hZG0CcxMTMugyNLXJxRRlSRx4lfFUGuOh9MAEcbRsMRjwOut2hFvMdW6AGB00mDpgsXnQ4miDweRAjc4RM2zGkPiqdqny9NCZR2bGF8sV3qQ8RoAxMd6/0qj5Aq7AuPLCWcJ3FdU5i3VoavFk4QwTH5pi6cxxZlDDhTha9vYNWzTA/rVMni546dnBZfJ0x//HByfdXmr81DOExNGyt620zESBcYVwccoCr3eIo2VEuvjH7XXGQ6q8RhjlTS85GsOCOGBEpI4kIEtwyuQ1evk5eXxenn5ejsaol1NkmM/HuP8DM+9LH586V+cAAAAASUVORK5CYII=";function OO($){return $.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function I$($){return`<line${f1($)} />`}function F$($){return`<rect${f1($)} />`}function p$($,v){return`<text${f1(v)}>${OO($)}</text>`}function HO($){return`<image${f1($)} />`}function FO($,v){let D=$.map((X)=>`${d5(X.x)},${d5(X.y)}`).join(" ");return`<polygon${f1({...v,points:D})} />`}function o($,v={}){if($.length===0)return"";return`<g${f1(v)}>${$}</g>`}function jO($,v,D){return[`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${v}" viewBox="0 0 ${$} ${v}" fill="none">`,D,"</svg>"].join("")}function x1($,v=11){return Math.max(10,Math.round($.length*v*0.58))}function f1($){let v=Object.entries($).filter(([,D])=>D!==void 0&&D!==!1).map(([D,X])=>{if(X===!0)return`${D}="true"`;if(typeof X==="number")return`${D}="${d5(X)}"`;if(typeof X==="string")return`${D}="${OO(X)}"`;return""}).filter((D)=>D.length>0).join(" ");return v.length>0?` ${v}`:""}function d5($){let v=Math.round($*100)/100;return Number.isInteger(v)?String(v):v.toFixed(2)}var RX=16,JR=9,QR=12,WR=8,zR=8;function AO($,v){let D=[],X=$.plotLeft,U=$.instrument?.displayName??$.pair;D.push(p$(U,{x:X,y:RX,fill:v.headerText,"font-size":l5,"font-weight":700,"letter-spacing":0.2,"font-family":g$})),X+=x1(U,l5)+JR;let G=$.timeframe,J=x1(G,h5)+zR*2,Q=RX-SX+4;D.push(F$({x:X,y:Q,width:J,height:SX,rx:4,fill:v.badgeBg})),D.push(p$(G,{x:X+J/2,y:Q+SX/2+0.5,fill:v.badgeText,"font-size":h5,"font-weight":600,"text-anchor":"middle","dominant-baseline":"middle","font-family":g$})),X+=J+QR;let W=$.visibleCandles,z=W[W.length-1].close,Y=W[0].open,I=z-Y,V=Y===0?null:I/Y*100,B=I>=0?v.upCandle:v.downCandle,L=$.formatPrice(z);D.push(p$(L,{x:X,y:RX,fill:B,"font-size":m5,"font-weight":600,"font-family":g$})),X+=x1(L,m5)+WR;let N=$.instrument?.priceDecimals??5;return D.push(p$(w0(I,V,N),{x:X,y:RX,fill:B,"font-size":oZ,"font-weight":500,"font-family":g$})),o(D.join(""))}function wO($,v){if(!v)return"";let D=aZ;return HO({href:ZO,x:$.plotRight-D-8,y:$.plotBottom-D-8,width:D,height:D,opacity:eZ})}var YR=["price","priceHigh","priceLow","price1","price2","entry","stop","target"];function PO($,v){let D=$.candles.slice(-$.bars),X=$O,U=sZ,G=Math.max(X+1,$.width-vO),J=Math.max(U+1,$.height-UO),Q=G-X,W=J-U,z=Q/Math.max(1,D.length),Y=Math.min(...D.map((a)=>a.low)),I=Math.max(...D.map((a)=>a.high)),V=I-Y,B=V>0?V*0.06:Math.max(Math.abs(I)*0.006,0.000001),L=Y-B,N=I+B,Z=Math.max(N-L,0.000001),F=V>0?Math.max(Z,V/0.6):Z,S=KR($.shapes),T=S.length>0?Math.min(...S):Number.POSITIVE_INFINITY,g=S.length>0?Math.max(...S):Number.NEGATIVE_INFINITY,k=Number.isFinite(T)&&T<L?L-T:0,N$=Number.isFinite(g)&&g>N?g-N:0,j$=Math.max(0,F-Z),T4=k+N$,Q4=L,y$=N;if(T4<=j$)Q4-=k,y$+=N$;else if(k>0&&N$===0)Q4-=Math.min(k,j$);else if(N$>0&&k===0)y$+=Math.min(N$,j$);else if(T4>0){let a=j$/T4;Q4-=k*a,y$+=N$*a}let n1=Math.max(y$-Q4,0.000001),l1=HR(D),h1=D.length-1;function P0(a){return U+(y$-a)/n1*W}function QH(a){if(!Number.isFinite(a))return{y:J,clamped:!0,edge:"bottom"};if(a>y$)return{y:U,clamped:!0,edge:"top"};if(a<Q4)return{y:J,clamped:!0,edge:"bottom"};return{y:P0(a),clamped:!1,edge:null}}function dX(a){return X+(a+0.5)*z}function Y7(a){return LR(D,h1,l1,a)}function I7(a){return dX(Y7(a))}function V7(a){return h1-a}function WH(a,B7,IH){let L7=ZR(a,B7);if(L7!==void 0)return I7(L7);let VH=OR(a,B7)??IH;return dX(V7(VH))}function zH(a=6){return IR(Q4,y$,a)}function YH(a=7){return BR(D.length,a)}return{pair:$.pair,timeframe:$.timeframe,theme:$.theme,width:$.width,height:$.height,plotLeft:X,plotTop:U,plotRight:G,plotBottom:J,plotWidth:Q,plotHeight:W,slot:z,visibleCandles:D,instrument:v,priceRange:{min:Q4,max:y$,candleMin:Y,candleMax:I},averageSpacing:l1,formatPrice(a){return KO(v,a)},priceToY:P0,projectPrice:QH,indexToX:dX,timeToIndex:Y7,timeToX:I7,barsBackToIndex:V7,resolveEndpointX:WH,nicePriceTicks:zH,niceTimeTickIndices:YH}}var MO=3;function IR($,v,D=6){let X=FR($,v,D),U=Math.ceil($/X)*X,G=Math.floor(v/X)*X,J=jR(X),Q=[];if(G>=U){let W=Math.round((G-U)/X);for(let z=0;z<=W;z+=1)Q.push(Number((U+z*X).toFixed(J+2)))}if(Q.length<MO)return VR($,v,MO+2);return Q}function VR($,v,D){if(v<=$||D<2)return[$];let X=[];for(let U=0;U<D;U+=1)X.push($+(v-$)*U/(D-1));return X}function BR($,v=7){if($<=0)return[];if($<=v)return Array.from({length:$},(U,G)=>G);let D=new Set,X=($-1)/Math.max(1,v-1);for(let U=0;U<v;U+=1)D.add(Math.round(U*X));return D.add(0),D.add($-1),Array.from(D).sort((U,G)=>U-G)}function LR($,v,D,X){if($.length===1){let J=$[0].time;return(X-J)/D}let U=$[0],G=$[v];if(X<=U.time)return(X-U.time)/D;if(X>=G.time)return v+(X-G.time)/D;return NR($,v,X)}function KR($){let v=[];for(let D of $)for(let X of YR){let U=D[X];if(typeof U==="number"&&Number.isFinite(U))v.push(U)}return v}function NR($,v,D){let X=0,U=v;while(X<=U){let Y=Math.floor((X+U)/2),I=$[Y];if(I.time===D)return Y;if(I.time<D)X=Y+1;else U=Y-1}let G=Math.min(v,X),J=Math.max(0,G-1),Q=$[J],z=$[G].time-Q.time;if(z<=0)return J;return J+(D-Q.time)/z}function ZR($,v){if(v==="start")return $.time1??$.entryTime;return $.time2}function OR($,v){if(v==="start")return $.barsBack1;return $.barsBack2}function HR($){if($.length<2)return 1;let v=0,D=0;for(let X=1;X<$.length;X+=1){let U=$[X].time-$[X-1].time;if(U>0)v+=U,D+=1}if(D===0)return 1;return v/D}function FR($,v,D){let U=Math.max(v-$,0.000001)/Math.max(1,D-1),G=Math.floor(Math.log10(U)),J=[G-1,G,G+1],Q=[1,2,2.5,5,10],W=U,z=Number.POSITIVE_INFINITY;for(let Y of J){let I=10**Y;for(let V of Q){let B=V*I,L=Math.ceil($/B),N=Math.floor(v/B),Z=N>=L?N-L+1:1,F=Math.abs(Z-D);if(F<z)z=F,W=B}}return W}function jR($){let v=0,D=$;while(v<10&&Math.abs(Math.round(D)-D)>0.00000001)D*=10,v+=1;return v}function N6($){return EX[$]}function bO($,v){let D=N6($.theme),X=AR($.nicePriceTicks(),$.formatPrice),U=$.niceTimeTickIndices(),G=[],J=[],Q=$.visibleCandles[$.visibleCandles.length-1],W=$.priceToY(Q.close),z=Q.close>=Q.open?D.upCandle:D.downCandle,Y=$.formatPrice(Q.close);for(let N of X){let Z=$.priceToY(N);G.push(I$({x1:$.plotLeft,y1:Math.round(Z)+0.5,x2:$.plotRight,y2:Math.round(Z)+0.5,stroke:D.grid,"stroke-width":1}));let F=$.formatPrice(N);if(F!==Y)J.push(p$(F,{x:$.width-6,y:Z,fill:D.text,"font-size":n5,"font-family":g$,"text-anchor":"end","dominant-baseline":"middle"}))}for(let N of U){let Z=$.visibleCandles[N];if(!Z)continue;let F=$.indexToX(N),T=(N>0?$.visibleCandles[N-1]:void 0)?.time;G.push(I$({x1:Math.round(F)+0.5,y1:$.plotTop,x2:Math.round(F)+0.5,y2:$.plotBottom,stroke:D.grid,"stroke-width":1})),J.push(p$(NO($.timeframe,Z.time,T),{x:F,y:$.height-8,fill:D.text,"font-size":n5,"font-family":g$,"text-anchor":"middle"}))}J.push(I$({x1:Math.round($.plotRight)+0.5,y1:$.plotTop,x2:Math.round($.plotRight)+0.5,y2:$.plotBottom,stroke:D.axisBorder,"stroke-width":1})),J.push(I$({x1:$.plotLeft,y1:Math.round($.plotBottom)+0.5,x2:$.width,y2:Math.round($.plotBottom)+0.5,stroke:D.axisBorder,"stroke-width":1}));let I=I$({x1:$.plotLeft,y1:Math.round(W)+0.5,x2:$.plotRight,y2:Math.round(W)+0.5,stroke:z,"stroke-width":1,"stroke-dasharray":"4 4"}),V={y:W,label:$.formatPrice(Q.close),fill:z,height:C1},B=AO($,D),L=wO($,v);return{gridSvg:o(G.join(""),{"shape-rendering":"crispEdges"}),axesSvg:J.join(""),lastPriceSvg:I,lastPriceTag:V,headerSvg:B,watermarkSvg:L}}function AR($,v){let D=new Set,X=[];for(let U of $){let G=v(U);if(!D.has(G))D.add(G),X.push(U)}return X}function qO($){let v=Math.max(1,Math.round($.slot*0.7)),D=[];for(let X=0;X<$.visibleCandles.length;X+=1){let U=$.visibleCandles[X];if(!U)continue;let G=U.close>=U.open?"#10b981":"#ef4444",J=$.indexToX(X),Q=Math.round(J)+0.5,W=$.priceToY(U.high),z=$.priceToY(U.low),Y=$.priceToY(U.open),I=$.priceToY(U.close),V=Math.min(Y,I),B=Math.max(Y,I),L=Math.max(1,Math.round(B-V)),N=Math.round(J-v/2),Z=Math.round(V);D.push(I$({x1:Q,y1:Math.round(W)+0.5,x2:Q,y2:Math.round(z)+0.5,stroke:G,"stroke-width":1})),D.push(F$({x:N,y:Z,width:v,height:L,fill:G}))}return o(D.join(""),{"shape-rendering":"crispEdges"})}function SO($,v){if(v.length===0)return"";let D=N6($.theme);return wR(v,$.plotTop+2,$.plotBottom-2).map((U)=>o([F$({x:$.plotRight+1,y:Math.round(U.y-U.height/2),width:$.width-$.plotRight-1,height:U.height,fill:U.fill}),p$(U.label,{x:$.width-6,y:U.y,fill:D.tagText,"font-size":U.height>=C1?11:10,"font-family":g$,"font-weight":600,"text-anchor":"end","dominant-baseline":"middle"})].join(""),{"shape-rendering":"crispEdges"})).join("")}function wR($,v,D){let X=$.map((J)=>({...J})).sort((J,Q)=>J.y-Q.y);if(X.length===0)return X;for(let J=1;J<X.length;J+=1){let Q=X[J-1],W=X[J],z=Q.y+(Q.height+W.height)/2;if(W.y<z)W.y=z}let U=X[X.length-1];if(U.y>D){U.y=D;for(let J=X.length-2;J>=0;J-=1){let Q=X[J+1],W=X[J],z=Q.y-(Q.height+W.height)/2;if(W.y>z)W.y=z}}let G=X[0];if(G.y<v)G.y=v;return X}function p5($){let v=bR($.candles);if(v.length===0)throw Error("Cannot render chart: candles is empty");return{pair:$.pair,timeframe:$.timeframe,candles:v,shapes:$.shapes??[],theme:$.theme??"dark",width:kO($.width,GO,zO,YO),height:kO($.height,JO,IO,VO),bars:MR($.bars??c5),scale:PR($.scale),watermark:$.watermark??WO,...$.fontFiles?{fontFiles:$.fontFiles}:{}}}function MR($){if(!Number.isFinite($))return c5;return t5(Math.round($),DO,XO)}function PR($){if($===void 0||!Number.isFinite($)||$<=0)return QO;return t5($,BO,LO)}function kO($,v,D,X){if($===void 0||!Number.isFinite($)||$<=0)return v;return t5(Math.round($),D,X)}function t5($,v,D){return Math.min(D,Math.max(v,$))}function bR($){return $.filter((v)=>Number.isFinite(v.time)&&Number.isFinite(v.open)&&Number.isFinite(v.high)&&Number.isFinite(v.low)&&Number.isFinite(v.close)).sort((v,D)=>v.time-D.time)}import{createRequire as qR}from"node:module";var SR=qR(import.meta.url);function EO($,v,D,X){let{Resvg:U}=kR();return new U($,{fitTo:{mode:"width",value:Math.round(v*D)},font:{loadSystemFonts:!0,defaultFontFamily:"Inter",...X?{fontFiles:X}:{}},background:"rgba(0,0,0,0)"}).render().asPng()}function kR(){try{return SR("@resvg/resvg-js")}catch($){let v=$ instanceof Error?$.message:String($);throw Error(`chart-render: @resvg/resvg-js could not be loaded for PNG rasterization (${v})`)}}var ER={horizontal_line:"horizontal_line",line:"horizontal_line",hline:"horizontal_line",horizontal:"horizontal_line",horz_line:"horizontal_line",horizontal_ray:"horizontal_ray",hray:"horizontal_ray",horz_ray:"horizontal_ray",horizontalray:"horizontal_ray",h_ray:"horizontal_ray",vertical_line:"vertical_line",vertical:"vertical_line",vline:"vertical_line",vert_line:"vertical_line",vertline:"vertical_line",verticalline:"vertical_line",cross_line:"cross_line",crossline:"cross_line",cross:"cross_line",zone:"zone",horizontal_range:"zone",range:"zone",supply_demand_zone:"zone",rectangle:"rectangle",rect:"rectangle",box:"rectangle",trendline:"trendline",trend:"trendline",trend_line:"trendline",ray:"ray",trend_ray:"ray",right_ray:"right_ray",ray_right:"right_ray",rightray:"right_ray","right-ray":"right_ray",left_ray:"left_ray",ray_left:"left_ray",leftray:"left_ray","left-ray":"left_ray",extended_line:"extended_line",extendedline:"extended_line",extended:"extended_line",extend_line:"extended_line",info_line:"info_line",infoline:"info_line",info:"info_line",trend_angle:"trend_angle",trendangle:"trend_angle",angle:"trend_angle",position:"position",trade:"position",long:"position",short:"position",long_position:"position",short_position:"position"},TR={horizontal_line:{required:[{field:"price",message:"price is required for horizontal_line"}],describe:($)=>`Drew horizontal line at ${$.price}${$.label?` (${$.label})`:""}`},horizontal_ray:{required:[{field:"price",message:"price is required for horizontal_ray"}],describe:($)=>`Drew horizontal ray at ${$.price}${$.label?` (${$.label})`:""}`},vertical_line:{required:[],describe:($)=>{let v=$.time1??$.time2;return`Drew vertical line${v?` at ${v}`:""}${$.label?` (${$.label})`:""}`}},cross_line:{required:[{field:"price",message:"price is required for cross_line"}],describe:($)=>`Drew cross line at ${$.price}${$.label?` (${$.label})`:""}`},zone:{required:[{field:"priceHigh",message:"priceHigh is required for zone"},{field:"priceLow",message:"priceLow is required for zone"}],describe:($)=>`Drew zone from ${$.priceLow} to ${$.priceHigh}${$.label?` (${$.label})`:""}`},rectangle:{required:[{field:"priceHigh",message:"priceHigh is required for rectangle"},{field:"priceLow",message:"priceLow is required for rectangle"}],describe:($)=>`Drew rectangle from ${$.priceLow} to ${$.priceHigh}${$.label?` (${$.label})`:""}`},trendline:{required:[{field:"price1",message:"price1 is required for trendline"},{field:"price2",message:"price2 is required for trendline"}],describe:($)=>`Drew trendline from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},ray:{required:[{field:"price1",message:"price1 is required for ray"},{field:"price2",message:"price2 is required for ray"}],describe:($)=>`Drew ray from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},right_ray:{required:[{field:"price1",message:"price1 is required for right_ray"},{field:"price2",message:"price2 is required for right_ray"}],describe:($)=>`Drew right ray from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},left_ray:{required:[{field:"price1",message:"price1 is required for left_ray"},{field:"price2",message:"price2 is required for left_ray"}],describe:($)=>`Drew left ray from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},extended_line:{required:[{field:"price1",message:"price1 is required for extended_line"},{field:"price2",message:"price2 is required for extended_line"}],describe:($)=>`Drew extended line from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},info_line:{required:[{field:"price1",message:"price1 is required for info_line"},{field:"price2",message:"price2 is required for info_line"}],describe:($)=>`Drew info line from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},trend_angle:{required:[{field:"price1",message:"price1 is required for trend_angle"},{field:"price2",message:"price2 is required for trend_angle"}],describe:($)=>`Drew trend angle from ${$.price1} to ${$.price2}${$.label?` (${$.label})`:""}`},position:{required:[{field:"direction",message:'direction ("long" or "short") is required for position'},{field:"entry",message:"entry is required for position"},{field:"stop",message:"stop is required for position"},{field:"target",message:"target is required for position"}],describe:($)=>`Drew ${$.direction} position — entry ${$.entry}, stop ${$.stop}, target ${$.target}${$.label?` (${$.label})`:""}`}};var RR=["horizontal_line","horizontal_ray","vertical_line","cross_line","zone","rectangle","trendline","trend_line","ray","right_ray","left_ray","extended_line","info_line","trend_angle","position"];function M0($){if(typeof $!=="string")return null;let v=$.trim().toLowerCase();return ER[v]??null}function gO($){return`Unknown shape type: "${String($)}". Supported types: ${RR.join(", ")}`}function o5($){if(typeof $==="number"&&Number.isFinite($))return $;if(typeof $==="string"){let v=$.trim();if(v.length===0)return;let D=Number(v);if(Number.isFinite(D))return D}return}function gR($){if(typeof $!=="string")return;let v=$.trim().toLowerCase();if(v==="long"||v==="buy")return"long";if(v==="short"||v==="sell")return"short";return}function t$($,v){for(let D of v){let X=o5($[D]);if(X!==void 0)return X}return}function E4($,v,D){let X=$[v];if(!X||typeof X!=="object"||Array.isArray(X))return;return t$(X,D)}function uR($){if(typeof $.type!=="string")return null;let v=$.type.trim().toLowerCase();return v.length>0?v:null}function Z4($,v,D){if($[v]!==void 0||D===void 0)return;$[v]=D}function a5($,v,D){Z4($,v,D===void 0?void 0:Math.trunc(D))}function CR($,v){if($.direction)return;if(v==="long"||v==="short"){$.direction=v;return}if(v==="long_position"||v==="short_position"){$.direction=v==="long_position"?"long":"short";return}$.direction=gR($.side)}function xR($){return t$($,["level","y","value","priceLevel","linePrice"])??E4($,"point1",["price","y","value"])??E4($,"from",["price","y","value"])}function TO($,v){if(v==="start")return t$($,["startPrice","fromPrice","priceA","p1"])??E4($,"point1",["price","y","value"])??E4($,"from",["price","y","value"]);return t$($,["endPrice","toPrice","priceB","p2"])??E4($,"point2",["price","y","value"])??E4($,"to",["price","y","value"])}function RO($,v){if(v==="start")return t$($,["time","startTime","fromTime","timestamp","t1"])??E4($,"point1",["time","t","timestamp"])??E4($,"from",["time","t","timestamp"]);return t$($,["endTime","toTime","t2"])??E4($,"point2",["time","t","timestamp"])??E4($,"to",["time","t","timestamp"])}function fR($){Z4($,"price",xR($)),Z4($,"priceHigh",t$($,["high","upper","top","max","priceTop","priceUpper"])),Z4($,"priceLow",t$($,["low","lower","bottom","min","priceBottom","priceLower"])),Z4($,"price1",TO($,"start")),Z4($,"price2",TO($,"end"))}function _R($){a5($,"time1",RO($,"start")),a5($,"time2",RO($,"end")),Z4($,"barsBack1",t$($,["barsBack","barBack","lookback","bars"])),Z4($,"barsBack2",t$($,["barsBackEnd","barBackEnd","lookbackEnd"]))}function iR($){Z4($,"entry",t$($,["entryPrice","open","openPrice"])),Z4($,"stop",t$($,["stopLoss","sl","stopPrice"])),Z4($,"target",t$($,["takeProfit","tp","targetPrice","tpPrice"])),a5($,"entryTime",t$($,["entryTimestamp"]))}function yR($){let v=o5($.priceHigh),D=o5($.priceLow);if(v!==void 0&&D!==void 0&&v<D)$.priceHigh=D,$.priceLow=v}function uO($){if(typeof $!=="object"||$===null||Array.isArray($))return $;let v={...$},D=uR(v),X=M0(D);if(X)v.type=X;return CR(v,D),fR(v),_R(v),iR(v),yR(v),v}function CO($){return TR[$].required}var nR=c.object({type:c.string().describe('Shape type: "horizontal_line", "horizontal_ray", "vertical_line", "cross_line", "zone", "rectangle", "trendline", "ray", "right_ray", "left_ray", "extended_line", "info_line", "trend_angle", or "position"'),price:c.coerce.number().optional().describe("Price level (required for horizontal_line, horizontal_ray, cross_line)"),priceHigh:c.coerce.number().optional().describe("Upper price boundary (required for zone/rectangle)"),priceLow:c.coerce.number().optional().describe("Lower price boundary (required for zone/rectangle)"),price1:c.coerce.number().optional().describe("First point price (required for trendline/ray/right_ray/left_ray/extended_line/info_line/trend_angle)"),price2:c.coerce.number().optional().describe("Second point price (required for trendline/ray/right_ray/left_ray/extended_line/info_line/trend_angle)"),time1:c.number().int().optional().describe("Absolute time (epoch seconds) of the first endpoint for trendline/rays or anchor for vertical_line. PREFERRED over barsBack1."),time2:c.number().int().optional().describe("Absolute time (epoch seconds) of the second endpoint (trendline/rays) or right edge of a zone. PREFERRED over barsBack2."),barsBack1:c.number().optional().describe("FALLBACK only — bars back from the current bar for first endpoint/anchor (trendline, rays, vertical_line). Use time1 when possible."),barsBack2:c.number().optional().describe("FALLBACK only — bars back from the current bar for second endpoint / zone right edge. Use time2 when possible."),direction:c.enum(["long","short"]).optional().describe('Position direction (required for position): "long" or "short"'),entry:c.coerce.number().optional().describe("Entry price (required for position)"),stop:c.coerce.number().optional().describe("Stop-loss price (required for position)"),target:c.coerce.number().optional().describe("Take-profit price (required for position)"),entryTime:c.number().int().optional().describe("Absolute time (epoch seconds) for the position entry anchor. Defaults to the current bar."),label:c.string().optional().describe('Label text, e.g. "Support", "Resistance", "Demand Zone", "Long EURCHF"'),color:c.string().optional().describe('Color hex, e.g. "#22c55e" green, "#ef4444" red, "#3b82f6" blue')}).superRefine(($,v)=>{let D=M0($.type);if(!D){v.addIssue({code:"custom",message:gO($.type),path:["type"]});return}for(let X of CO(D))if($[X.field]===void 0)v.addIssue({code:"custom",message:X.message,path:[X.field]})}),xO=c.preprocess(uO,nR),Vt=c.object({shapes:c.array(xO).min(1)});function fO($){let v=[],D=[];for(let[X,U]of $.entries()){let G=xO.safeParse(U);if(G.success)v.push(G.data);else D.push({index:X,reason:G.error.issues[0]?.message??"invalid shape"})}return{valid:v,invalid:D}}function $4($,v,D){let X={type:$.type,ok:!0,...D?{reason:D}:{},...$.label?{label:$.label}:{}};return{underlaySvg:v.underlaySvg??"",lineSvg:v.lineSvg??"",positionSvg:v.positionSvg??"",chromeSvg:v.chromeSvg??"",gutterTags:v.gutterTags??[],report:X}}function O$($,v){let D={type:$.type,ok:!1,reason:v,...$.label?{label:$.label}:{}};return{underlaySvg:"",lineSvg:"",positionSvg:"",chromeSvg:"",gutterTags:[],report:D}}function k$($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function o$($,v){return $.color&&$.color.trim().length>0?$.color:v}function z$($,v,D,X){let U=$.projectPrice(D);if(!U.clamped||U.edge===null)return"";let G=N6($.theme),J=Y$(v,$.plotLeft+10,$.plotRight-10),Q=U.edge==="top"?$.plotTop+4:$.plotBottom-4,W=U.edge==="top"?[{x:J,y:Q},{x:J-5,y:Q+7},{x:J+5,y:Q+7}]:[{x:J,y:Q},{x:J-5,y:Q-7},{x:J+5,y:Q-7}],z=U.edge==="top"?Q+16:Q-10;return o([FO(W,{fill:X}),p$($.formatPrice(D),{x:J,y:z,fill:G.markerText,"font-size":10,"font-family":g$,"text-anchor":"middle"})].join(""))}function e5($,v,D,X,U){let G=x1(D,10)+10;return o([F$({x:$,y:v-10,width:G,height:16,fill:X,"fill-opacity":0.85}),p$(D,{x:$+5,y:v+1,fill:U,"font-size":10,"font-family":g$})].join(""),{"shape-rendering":"crispEdges"})}function O4($,v,D,X,U="start"){return p$(D,{x:$,y:v,fill:X,"font-size":10,"font-family":g$,"text-anchor":U})}function Y$($,v,D){return Math.min(D,Math.max(v,$))}var iO="price out of visible range (clamped)";function s5($,v){if(v.type==="zone")return lR($,v);if(v.type==="rectangle")return hR($,v);return O$(v,`Unsupported area shape: ${v.type}`)}function lR($,v){let D=yO($,v,"zone");if(D.kind==="error")return D.fragments;let X=o$(v,"#3b82f6"),U=Y$(D.top+12,$.plotTop+12,$.plotBottom-6),G=(D.left+D.right)/2;return $4(v,{underlaySvg:o(F$({x:D.left,y:D.top,width:D.right-D.left,height:D.bottom-D.top,fill:X,"fill-opacity":0.12}),{"shape-rendering":"crispEdges"}),lineSvg:o([I$({x1:D.left,y1:Math.round(D.top)+0.5,x2:D.right,y2:Math.round(D.top)+0.5,stroke:X,"stroke-width":1}),I$({x1:D.left,y1:Math.round(D.bottom)+0.5,x2:D.right,y2:Math.round(D.bottom)+0.5,stroke:X,"stroke-width":1}),v.label?O4(D.left+4,U,v.label,X):"",z$($,G,D.highPrice,X),z$($,G,D.lowPrice,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?iO:void 0)}function hR($,v){let D=yO($,v,"rectangle");if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=Y$(D.top+12,$.plotTop+12,$.plotBottom-6),G=(D.left+D.right)/2;return $4(v,{underlaySvg:o(F$({x:D.left,y:D.top,width:D.right-D.left,height:D.bottom-D.top,fill:X,"fill-opacity":0.12}),{"shape-rendering":"crispEdges"}),lineSvg:o([F$({x:D.left,y:D.top,width:D.right-D.left,height:D.bottom-D.top,fill:"none",stroke:X,"stroke-width":1}),v.label?O4(D.left+4,U,v.label,X):"",z$($,G,D.highPrice,X),z$($,G,D.lowPrice,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?iO:void 0)}function yO($,v,D){let X=k$(v.priceHigh),U=k$(v.priceLow);if(X===void 0)return{kind:"error",fragments:O$(v,`priceHigh is required for ${D}`)};if(U===void 0)return{kind:"error",fragments:O$(v,`priceLow is required for ${D}`)};let G=$.projectPrice(X),J=$.projectPrice(U),Q=D==="zone"&&!_O(v)?$.plotLeft:Y$($.resolveEndpointX(v,"start",24),$.plotLeft,$.plotRight),W=D==="zone"&&!_O(v)?$.plotRight:Y$($.resolveEndpointX(v,"end",4),$.plotLeft,$.plotRight),z=Math.min(G.y,J.y),Y=Math.max(G.y,J.y);return{kind:"ok",left:Math.min(Q,W),right:Math.max(Q,W),top:z,bottom:Y,highPrice:X,lowPrice:U,clamped:G.clamped||J.clamped}}function _O($){return $.time1!==void 0||$.time2!==void 0||$.barsBack1!==void 0||$.barsBack2!==void 0}function gX($,v,D){if(Math.abs(D.x-v.x)<0.000001)return v.y;let X=(D.y-v.y)/(D.x-v.x);return v.y+($-v.x)*X}function nO($,v,D){if(Math.abs(v.x-$.x)<0.000001)return{start:{x:$.x,y:$.y},end:{x:$.x,y:v.y}};return{start:{x:$.x,y:$.y},end:{x:D,y:gX(D,$,v)}}}function lO($,v,D){if(Math.abs(v.x-$.x)<0.000001)return{start:{x:$.x,y:$.y},end:{x:$.x,y:v.y}};return{start:{x:$.x,y:$.y},end:{x:D,y:gX(D,$,v)}}}function hO($,v,D,X,U,G){if(Math.abs(v.x-$.x)<0.000001)return{start:{x:$.x,y:U},end:{x:$.x,y:G}};return{start:{x:D,y:gX(D,$,v)},end:{x:X,y:gX(X,$,v)}}}function $7($,v){return{x:($.x+v.x)/2,y:($.y+v.y)/2}}var _1="price out of visible range (clamped)";function J4($,v){switch(v.type){case"horizontal_line":return mR($,v);case"horizontal_ray":return cR($,v);case"vertical_line":return rR($,v);case"cross_line":return dR($,v);case"trendline":return pR($,v);case"ray":case"right_ray":return tR($,v);case"left_ray":return oR($,v);case"extended_line":return aR($,v);case"info_line":return eR($,v);case"trend_angle":return sR($,v);default:return O$(v,`Unsupported line shape: ${v.type}`)}}function mR($,v){let D=k$(v.price);if(D===void 0)return O$(v,"price is required for horizontal_line");let X=o$(v,"#3b82f6"),U=$.projectPrice(D),G=[I$({x1:$.plotLeft,y1:Math.round(U.y)+0.5,x2:$.plotRight,y2:Math.round(U.y)+0.5,stroke:X,"stroke-width":1}),v.label?O4($.plotLeft+4,Y$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,X):"",z$($,$.plotRight-12,D,X)].join("");return $4(v,{lineSvg:o(G,{"shape-rendering":"crispEdges"}),gutterTags:[{y:U.y,label:$.formatPrice(D),fill:X,height:C1}]},U.clamped?_1:void 0)}function cR($,v){let D=k$(v.price);if(D===void 0)return O$(v,"price is required for horizontal_ray");let X=o$(v,"#3b82f6"),U=$.projectPrice(D),G=$.resolveEndpointX(v,"start",0),J=Y$(G+4,$.plotLeft+4,$.plotRight-60);return $4(v,{lineSvg:o([I$({x1:Y$(G,$.plotLeft,$.plotRight),y1:Math.round(U.y)+0.5,x2:$.plotRight,y2:Math.round(U.y)+0.5,stroke:X,"stroke-width":1}),v.label?O4(J,Y$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,X):"",z$($,G,D,X)].join(""),{"shape-rendering":"crispEdges"})},U.clamped?_1:void 0)}function rR($,v){let D=o$(v,"#f59e0b"),X=$.resolveEndpointX(v,"start",0),U=Y$(X,$.plotLeft,$.plotRight);return $4(v,{lineSvg:o([I$({x1:Math.round(U)+0.5,y1:$.plotTop,x2:Math.round(U)+0.5,y2:$.plotBottom,stroke:D,"stroke-width":1,"stroke-dasharray":"4 4"}),v.label?O4(U+4,$.plotTop+12,v.label,D):""].join(""),{"shape-rendering":"crispEdges"})})}function dR($,v){let D=k$(v.price);if(D===void 0)return O$(v,"price is required for cross_line");let X=o$(v,"#38bdf8"),U=$.projectPrice(D),G=Y$($.resolveEndpointX(v,"start",0),$.plotLeft,$.plotRight);return $4(v,{lineSvg:o([I$({x1:$.plotLeft,y1:Math.round(U.y)+0.5,x2:$.plotRight,y2:Math.round(U.y)+0.5,stroke:X,"stroke-width":1,"stroke-dasharray":"4 4"}),I$({x1:Math.round(G)+0.5,y1:$.plotTop,x2:Math.round(G)+0.5,y2:$.plotBottom,stroke:X,"stroke-width":1,"stroke-dasharray":"4 4"}),v.label?O4(G+4,Y$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,X):"",z$($,G,D,X)].join(""),{"shape-rendering":"crispEdges"})},U.clamped?_1:void 0)}function pR($,v){let D=i1($,v,"trendline");if(D.kind==="error")return D.fragments;return $g($,v,D.first,D.second,"#f59e0b","4 4")}function tR($,v){let D=i1($,v,v.type);if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=nO(D.first,D.second,$.plotRight);return uX($,v,U.start,U.end,X,"4 4",[z$($,D.first.x,D.price1,X),z$($,D.second.x,D.price2,X)])}function oR($,v){let D=i1($,v,"left_ray");if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=lO(D.first,D.second,$.plotLeft);return uX($,v,U.start,U.end,X,"4 4",[z$($,D.first.x,D.price1,X),z$($,D.second.x,D.price2,X)])}function aR($,v){let D=i1($,v,"extended_line");if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=hO(D.first,D.second,$.plotLeft,$.plotRight,$.plotTop,$.plotBottom);return uX($,v,U.start,U.end,X,"4 4",[z$($,D.first.x,D.price1,X),z$($,D.second.x,D.price2,X)])}function eR($,v){let D=i1($,v,"info_line");if(D.kind==="error")return D.fragments;let X=o$(v,"#22c55e"),U=D.price2-D.price1,G=D.price1===0?null:U/D.price1*100,J=$.instrument?.priceDecimals??5,Q=v.label?`${v.label} · ${w0(U,G,J)}`:w0(U,G,J),W=$7(D.first,D.second);return $4(v,{lineSvg:o([I$({x1:D.first.x,y1:D.first.y,x2:D.second.x,y2:D.second.y,stroke:X,"stroke-width":1}),e5(Y$(W.x-30,$.plotLeft+2,$.plotRight-120),Y$(W.y-6,$.plotTop+12,$.plotBottom-12),Q,X,"#FFFFFF"),z$($,D.first.x,D.price1,X),z$($,D.second.x,D.price2,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?_1:void 0)}function sR($,v){let D=i1($,v,"trend_angle");if(D.kind==="error")return D.fragments;let X=o$(v,"#a855f7"),U=Math.atan2(D.first.y-D.second.y,D.second.x-D.first.x)*180/Math.PI,G=v.label?`${v.label} · ${U.toFixed(1)}°`:`${U.toFixed(1)}°`,J=$7(D.first,D.second);return $4(v,{lineSvg:o([I$({x1:D.first.x,y1:D.first.y,x2:D.second.x,y2:D.second.y,stroke:X,"stroke-width":1}),e5(Y$(J.x-26,$.plotLeft+2,$.plotRight-100),Y$(J.y-6,$.plotTop+12,$.plotBottom-12),G,X,"#FFFFFF"),z$($,D.first.x,D.price1,X),z$($,D.second.x,D.price2,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?_1:void 0)}function $g($,v,D,X,U,G){let J=o$(v,U);return uX($,v,D,X,J,G,[z$($,D.x,k$(v.price1)??0,J),z$($,X.x,k$(v.price2)??0,J)])}function uX($,v,D,X,U,G,J){let Q=Y$(X.x+4,$.plotLeft+4,$.plotRight-70),W=Y$(X.y-4,$.plotTop+12,$.plotBottom-4),z=k$(v.price1),Y=k$(v.price2),I=z!==void 0&&$.projectPrice(z).clamped||Y!==void 0&&$.projectPrice(Y).clamped;return $4(v,{lineSvg:o([I$({x1:D.x,y1:D.y,x2:X.x,y2:X.y,stroke:U,"stroke-width":1,...G?{"stroke-dasharray":G}:{}}),v.label?O4(Q,W,v.label,U):"",...J].join(""),{"shape-rendering":"crispEdges"})},I?_1:void 0)}function i1($,v,D){let X=k$(v.price1),U=k$(v.price2);if(X===void 0)return{kind:"error",fragments:O$(v,`price1 is required for ${D}`)};if(U===void 0)return{kind:"error",fragments:O$(v,`price2 is required for ${D}`)};let G=$.projectPrice(X),J=$.projectPrice(U),Q={x:Y$($.resolveEndpointX(v,"start",50),$.plotLeft,$.plotRight),y:G.y},W={x:Y$($.resolveEndpointX(v,"end",0),$.plotLeft,$.plotRight),y:J.y};return{kind:"ok",first:Q,second:W,price1:X,price2:U,clamped:G.clamped||J.clamped}}var vg="price out of visible range (clamped)";function mO($,v){if(v.direction!=="long"&&v.direction!=="short")return O$(v,'direction ("long" or "short") is required for position');let D=k$(v.entry),X=k$(v.stop),U=k$(v.target);if(D===void 0)return O$(v,"entry is required for position");if(X===void 0)return O$(v,"stop is required for position");if(U===void 0)return O$(v,"target is required for position");let G=N6($.theme),J=Y$($.resolveEndpointX(v,"start",0),$.plotLeft,$.plotRight),Q=$.projectPrice(D),W=$.projectPrice(X),z=$.projectPrice(U),Y=Math.min(Q.y,z.y),I=Math.max(Q.y,z.y),V=Math.min(Q.y,W.y),B=Math.max(Q.y,W.y),L=Y$(Math.min(Y,V)+12,$.plotTop+12,$.plotBottom-8),N=Q.clamped||W.clamped||z.clamped;return $4(v,{positionSvg:o([F$({x:J,y:Y,width:$.plotRight-J,height:I-Y,fill:"#10b981","fill-opacity":0.12}),F$({x:J,y:V,width:$.plotRight-J,height:B-V,fill:"#ef4444","fill-opacity":0.12}),I$({x1:J,y1:Math.round(Q.y)+0.5,x2:$.plotRight,y2:Math.round(Q.y)+0.5,stroke:G.entryTag,"stroke-width":1}),I$({x1:J,y1:Math.round(W.y)+0.5,x2:$.plotRight,y2:Math.round(W.y)+0.5,stroke:"#ef4444","stroke-width":1}),I$({x1:J,y1:Math.round(z.y)+0.5,x2:$.plotRight,y2:Math.round(z.y)+0.5,stroke:"#10b981","stroke-width":1}),v.label?O4(J+4,L,v.label,G.text):"",z$($,J,D,G.entryTag),z$($,J,X,"#ef4444"),z$($,J,U,"#10b981")].join(""),{"shape-rendering":"crispEdges"}),gutterTags:[{y:Q.y,label:`Entry ${$.formatPrice(D)}`,fill:G.entryTag,height:kX},{y:W.y,label:`SL ${$.formatPrice(X)}`,fill:"#ef4444",height:kX},{y:z.y,label:`TP ${$.formatPrice(U)}`,fill:"#10b981",height:kX}]},N?vg:void 0)}var Ug={horizontal_line:J4,horizontal_ray:J4,vertical_line:J4,cross_line:J4,zone:s5,rectangle:s5,trendline:J4,ray:J4,right_ray:J4,left_ray:J4,extended_line:J4,info_line:J4,trend_angle:J4,position:mO};function cO($,v){let D=[],X=[],U=[],G=[],J=[],Q=[],W=0,z=0;for(let Y of v){let I=Dg($,Y);if(D.push(I.underlaySvg),X.push(I.lineSvg),U.push(I.positionSvg),G.push(I.chromeSvg),J.push(...I.gutterTags),Q.push(I.report),I.report.ok)W+=1;else z+=1}return{underlaySvg:D.join(""),lineSvg:X.join(""),positionSvg:U.join(""),chromeSvg:G.join(""),gutterTags:J,reports:Q,drawn:W,skipped:z}}function Dg($,v){let D=M0(v.type);if(!D)return O$(v,`Unknown shape type: ${String(v.type)}`);let X=Ug[D];if(!X)return O$(v,`Unsupported shape type: ${D}`);let U=D===v.type?v:{...v,type:D};return X($,U)}var v7;function rO($){let v=p5($),D=Xg(v.pair),X=PO(v,D),U=EX[v.theme],G=cO(X,v.shapes),J=bO(X,v.watermark),Q=`plot-clip-${Qg(X)}`,W=`<defs><clipPath id="${Q}">${F$({x:X.plotLeft,y:X.plotTop,width:X.plotWidth,height:X.plotHeight})}</clipPath></defs>`,z={"clip-path":`url(#${Q})`},Y=o(J.gridSvg,z),I=o(G.underlaySvg,z),V=o(qO(X),z),B=o(G.lineSvg,z),L=o(G.positionSvg,z),N=SO(X,[...G.gutterTags,J.lastPriceTag]);return{svg:jO(X.width,X.height,[F$({x:0,y:0,width:X.width,height:X.height,fill:U.background}),W,Y,I,V,B,L,J.axesSvg,G.chromeSvg,J.lastPriceSvg,N,J.headerSvg,J.watermarkSvg,Jg()].join("")),width:X.width,height:X.height,drawn:G.drawn,skipped:G.skipped,shapes:G.reports,priceRange:{min:X.priceRange.min,max:X.priceRange.max}}}function U7($){let v=rO($),D=p5($);return{...v,png:EO(v.svg,v.width,D.scale,D.fontFiles)}}function Xg($){return Gg().resolve($)}function Gg(){if(v7===void 0)v7=new A0([...qX]);return v7}function Jg(){return`<style>text{font-family:${g$};white-space:pre}</style>`}function Qg($){let v=$.visibleCandles,D=v[0]?.time??0,X=v[v.length-1]?.time??0,U=`${$.pair}|${$.timeframe}|${$.width}x${$.height}|${v.length}|${D}|${X}`,G=2166136261;for(let J=0;J<U.length;J+=1)G^=U.charCodeAt(J),G=Math.imul(G,16777619);return(G>>>0).toString(36)}var dO=120,D7=20,X7=200;function Wg($,v,D){return Math.max(v,Math.min(D,$))}var zg="Render an annotated candlestick chart image (PNG) for a pair + timeframe. Fetches recent candles and draws optional shapes (support/resistance lines, zones, trendlines, a long/short position) using the same vocabulary as draw_chart_shape. Returns the chart as an image plus a text summary. PREFER absolute time anchors (time1/time2/entryTime, epoch seconds from get_candles) over barsBack*.",Yg="Optional annotations. Each item is {type, ...}: horizontal_line/horizontal_ray/cross_line need `price`; zone/rectangle need `priceHigh`+`priceLow`; trendline/ray/right_ray/left_ray/extended_line/info_line/trend_angle need `price1`+`price2` (prefer `time1`+`time2` epoch seconds); position needs `direction` (long/short)+`entry`+`stop`+`target`. Optional `label` and `color` (hex).",CX=[x({name:"render_chart",description:zg,inputSchema:{type:"object",properties:{pair:{type:"string",description:"Canonical instrument id, e.g. EURUSD (case-insensitive)"},timeframe:{type:"string",description:"e.g. 1m, 5m, 15m, 30m, 1h, 4h, 1d (or an integer multiple)"},shapes:{type:"array",description:Yg,items:{type:"object"}},bars:{type:"integer",minimum:D7,maximum:X7,description:`Most-recent candles to show (${D7}-${X7}, default ${dO})`},theme:{type:"string",enum:["dark","light"],description:"Color theme (default dark)"},width:{type:"integer",minimum:320,maximum:2560,description:"Image width in px (320-2560, default 1280)"},height:{type:"integer",minimum:240,maximum:1440,description:"Image height in px (240-1440, default 720)"}},required:["pair","timeframe"],additionalProperties:!1},handler:async($,v)=>{await i(v);let D=Wg($.bars??dO,D7,X7),{candles:X}=await wX(v.trpc,{pair:$.pair,timeframe:$.timeframe,limit:D});if(X.length===0)throw Error(`No candles available for ${$.pair} ${$.timeframe}. Check the pair/timeframe with get_market_config.`);let{valid:U,invalid:G}=fO($.shapes??[]),J=U7({pair:$.pair,timeframe:$.timeframe,candles:X,shapes:U,bars:D,...$.theme?{theme:$.theme}:{},...$.width?{width:$.width}:{},...$.height?{height:$.height}:{}}),Q=J.shapes.filter((I)=>!I.ok),W=[...G.map((I)=>`shape ${I.index}: ${I.reason}`),...Q.map((I)=>`${I.type}: ${I.reason??"undrawable"}`)],z=W.length>0?` (${W.length} skipped)
|
|
107
|
+
Skipped: ${W.join("; ")}`:"",Y=`Rendered ${$.pair} ${$.timeframe} — ${X.length} candles, drew ${J.drawn} shape${J.drawn===1?"":"s"}. Price range ${J.priceRange.min}–${J.priceRange.max}.${z}`;return{content:[{type:"image",data:Buffer.from(J.png).toString("base64"),mimeType:"image/png"},{type:"text",text:Y}]}}})];async function xX($){try{return{ok:!0,value:await $}}catch(v){return{ok:!1,error:v instanceof Error?v.message:String(v)}}}function Ig($){return/unauthor|forbidden|401|403|sign[ -]?in|token|credential/i.test($)}var Vg="The Aether Wealth backend is unreachable right now. Try again shortly.",Bg=g5.flatMap(($)=>$.dashboardOnly.map((v)=>`${$.name}: ${v}`)),fX=[x({name:"get_context",description:"Snapshot the user's live Aether Wealth state in one call — accounts, open trades, recent performance stats, and active alerts — plus the map of dashboard-only actions. Call this first to ground suggestions in what the user is actually doing. Requires sign-in.",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{await i(v);let D=await Promise.all([xX(v.trpc.trading.accounts.list.query()),xX(v.trpc.trading.trades.list.query({status:"OPEN",limit:200})),xX(v.trpc.trading.analytics.stats.query({})),xX(v.trpc.alerts.list.query({}))]);if(D.every((W)=>!W.ok)){let W=D.every((z)=>!z.ok&&Ig(z.error));throw Error(W?f5:Vg)}let[X,U,G,J]=D,Q=(W)=>W.ok?W.value:{error:W.error};return{accounts:Q(X),openTrades:Q(U),stats:Q(G),alerts:Q(J),dashboard:{url:x4,dashboardOnly:Bg,note:`These actions are not available over MCP. When the user needs one, suggest they open the dashboard at ${x4}.`}}}})];var Lg=["news","press_release"];function Kg($){return{pair:$.pair,...$.limit===void 0?{}:{limit:$.limit}}}function Ng($){return{currency:$.currency,...$.limit===void 0?{}:{limit:$.limit}}}function Zg($){return{currency:$.currency,...$.indicator===void 0?{}:{indicator:$.indicator},...$.limit===void 0?{}:{limit:$.limit}}}function Og($){return{...$.limit===void 0?{}:{limit:$.limit}}}function Hg($){return{currency:$.currency,...$.documentType===void 0?{}:{documentType:$.documentType},...$.limit===void 0?{}:{limit:$.limit}}}var _X={type:"integer",minimum:1,maximum:250,description:"Max rows to return (1-250, default 120)."},iX=[x({name:"get_fx_pair_context",description:"Macro context for a currency PAIR (e.g. EURUSD) — the per-currency macro state for both legs (recent releases, surprises, derived trend). Use for a pair-level macro read; for one currency use get_fx_currency_context. Distinct from get_macro_series (raw calendar history) and get_macro_indicator (one curated series).",inputSchema:{type:"object",properties:{pair:{type:"string",description:"6-letter currency pair, e.g. EURUSD (case-insensitive)"},limit:_X},required:["pair"],additionalProperties:!1},handler:async($,v)=>{return await i(v),v.trpc.fxMacroData.pairContext.query(Kg($))}}),x({name:"get_fx_currency_context",description:"Macro context for a single CURRENCY (e.g. USD) — recent economic releases, surprises, and the derived macro state for that currency.",inputSchema:{type:"object",properties:{currency:{type:"string",description:"ISO currency code, e.g. USD (case-insensitive)"},limit:_X},required:["currency"],additionalProperties:!1},handler:async($,v)=>{return await i(v),v.trpc.fxMacroData.currencyContext.query(Ng($))}}),x({name:"get_fx_predictions",description:"Model forecasts / predictions for a currency's upcoming macro releases. Optionally filter to one indicator by release slug (e.g. cpi).",inputSchema:{type:"object",properties:{currency:{type:"string",description:"ISO currency code, e.g. USD (case-insensitive)"},indicator:{type:"string",description:"Optional release slug filter, e.g. cpi"},limit:_X},required:["currency"],additionalProperties:!1},handler:async($,v)=>{return await i(v),v.trpc.fxMacroData.predictions.query(Zg($))}}),x({name:"get_fx_risk_sentiment",description:"Cross-market risk-on / risk-off sentiment series (not currency-scoped). Use to gauge broad market risk appetite.",inputSchema:{type:"object",properties:{limit:_X},additionalProperties:!1},handler:async($,v)=>{return await i(v),v.trpc.fxMacroData.riskSentiment.query(Og($))}}),x({name:"get_fx_documents",description:"Source documents behind the FX macro data for a currency — news items and press releases. Filter by documentType.",inputSchema:{type:"object",properties:{currency:{type:"string",description:"ISO currency code, e.g. USD (case-insensitive)"},documentType:{type:"string",enum:[...Lg],description:"Optional filter: news or press_release"},limit:{type:"integer",minimum:1,maximum:100,description:"Max rows to return (1-100, default 50)."}},required:["currency"],additionalProperties:!1},handler:async($,v)=>{return await i(v),v.trpc.fxMacroData.documents.query(Hg($))}}),x({name:"get_fx_sync_state",description:"Ingestion/sync status of the FX macro datasets (per dataset family: status, freshness, last success, next refresh). Diagnostic — check data freshness before relying on the other get_fx_* tools.",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await i(v),v.trpc.fxMacroData.syncState.query()}})];var Fg="momentum: rsi, macd, stoch, stochf, stochrsi, cci, cmo, mom, roc, rocr, willr, mfi, ultosc, ppo, apo, bop, aroon, aroonosc; trend: adx, adxr, dx, plus_di, minus_di, plus_dm, minus_dm, sar, supertrend; moving averages: sma, ema, wma, dema, tema, trima, kama, t3ma, mama, vwap, midpoint, midprice; bands: bbands, keltner, percent_b; volatility: atr, natr, trange; volume: obv, ad, adosc; stats: linearreg, linearregslope, linearregangle, linearregintercept, stddev, var, tsf",yX=[x({name:"get_indicators",description:"Compute Twelve Data technical indicators for a pair + timeframe (requires sign-in). "+`Pass up to 8 indicators by name; params are optional and default sensibly. Names — ${Fg}. Bad names/params return an error listing valid options. At most 2 distinct pairs per user at a time.`,inputSchema:{type:"object",properties:{pair:{type:"string",description:"Canonical id, e.g. EURUSD, XAUUSD, BTCUSD (case-insensitive)"},interval:{type:"string",description:"One of 1m, 5m, 15m, 30m, 45m, 1h, 2h, 4h, 1d"},indicators:{type:"array",minItems:1,maxItems:8,description:"Up to 8 indicators to compute on the pair",items:{type:"object",properties:{name:{type:"string",description:"Indicator name, e.g. rsi, macd, ema, bbands, atr, adx"},params:{type:"object",description:'Optional params, e.g. {"time_period": 14} or MACD {"fast_period":12,"slow_period":26}. Defaults applied when omitted.'}},required:["name"],additionalProperties:!1}},outputsize:{type:"integer",minimum:1,maximum:500,description:"Bars to return per indicator (default 30)"}},required:["pair","interval","indicators"],additionalProperties:!1},handler:async($,v)=>{return await i(v),TZ(v.trpc,$)}})];var jg="http://127.0.0.1:9003",Ag=["horizontal_line","horizontal_ray","vertical_line","cross_line","zone","rectangle","trendline","ray","right_ray","left_ray","extended_line","info_line","trend_angle","position"];function wg(){return{url:process.env.AETHER_APP_PUSH_URL?.trim()||jg,secret:process.env.AI_LIVE_PUSH_SECRET?.trim()||void 0}}async function nX($,v,D){let{url:X,secret:U}=wg(),G=`${X.replace(/\/$/,"")}/api/ai/live/push`,J;try{J=await fetch(G,{method:"POST",headers:{"content-type":"application/json",...U?{"x-live-push-secret":U}:{}},body:JSON.stringify({userId:$,tool:v,args:D})})}catch(z){throw Error(`Could not reach the Aether Wealth app at ${G}. Is the dashboard running?`,{cause:z})}if(!J.ok)throw Error(`Live-chart push rejected (HTTP ${J.status}).`);let Q=await J.json().catch(()=>({})),W=typeof Q.delivered==="number"?Q.delivered:0;return{ok:!0,tool:v,delivered:W,message:W>0?`Dispatched to ${W} open chart tab(s).`:"Dispatched, but no open Aether Wealth chart tab is listening — open the dashboard in your browser, then retry."}}var lX=[x({name:"chart_select_pair",description:"Switch the user's open Aether Wealth chart to a trading pair. Use the canonical id (case-insensitive), e.g. XAUUSD for gold, EURUSD, BTCUSD. Drives the live browser chart, not backend state.",inputSchema:{type:"object",properties:{pair:{type:"string",description:"Canonical pair id, e.g. XAUUSD (gold), EURUSD, BTCUSD"}},required:["pair"],additionalProperties:!1},handler:async($,v)=>{await i(v);let D=await v.session.getUserId();return nX(D,"select_pair",{pair:$.pair})}}),x({name:"chart_change_timeframe",description:"Change the timeframe/resolution of the user's open Aether Wealth chart, e.g. 1m, 5m, 15m, 30m, 1h, 4h, 1d.",inputSchema:{type:"object",properties:{timeframe:{type:"string",description:"e.g. 1m, 5m, 15m, 30m, 1h, 4h, 1d"}},required:["timeframe"],additionalProperties:!1},handler:async($,v)=>{await i(v);let D=await v.session.getUserId();return nX(D,"change_timeframe",{timeframe:$.timeframe})}}),x({name:"chart_draw_shapes",description:"Draw one or more shapes on the user's OPEN Aether Wealth chart. For key levels use multiple `horizontal_line` shapes, each with `price` and a short `label`. For a fair-value-gap / supply-demand zone use a `zone` with `priceHigh` + `priceLow`. For a trade idea use a `position` with `direction` + `entry`/`stop`/`target`. Prices are in the instrument's price units; `time1`/`time2`/`entryTime` are optional epoch seconds. Switch to the intended pair + timeframe first.",inputSchema:{type:"object",properties:{shapes:{type:"array",description:"Shapes to draw in one batch.",items:{type:"object",properties:{type:{type:"string",enum:[...Ag]},label:{type:"string"},color:{type:"string",description:"hex, e.g. #22c55e"},price:{type:"number"},priceHigh:{type:"number"},priceLow:{type:"number"},price1:{type:"number"},price2:{type:"number"},time1:{type:"number",description:"epoch seconds"},time2:{type:"number",description:"epoch seconds"},direction:{type:"string",enum:["long","short"]},entry:{type:"number"},stop:{type:"number"},target:{type:"number"},entryTime:{type:"number",description:"epoch seconds"}},required:["type"],additionalProperties:!1}}},required:["shapes"],additionalProperties:!1},handler:async($,v)=>{await i(v);let D=await v.session.getUserId();return nX(D,"draw_chart_shape",{shapes:$.shapes})}}),x({name:"chart_remove_drawings",description:"Remove AI-drawn shapes from the user's open Aether Wealth chart. `target` defaults to 'all' (clear everything the assistant drew); also accepts 'last', 'focused', or a specific shape id.",inputSchema:{type:"object",properties:{target:{type:"string",description:"'all' (default), 'last', 'focused', or a shape id"}},additionalProperties:!1},handler:async($,v)=>{await i(v);let D=await v.session.getUserId();return nX(D,"remove_chart_drawings",{target:$.target??"all"})}})];var hX=[x({name:"get_candles",description:"Get OHLC candles for a pair + timeframe. Returns up to 200 bars per request (newest 200 by default). Use offset to page further back through history — the store keeps thousands of bars (e.g. limit=200 offset=200 returns bars 201-400 back from the latest). Timeframe may be a base (1m, 5m, 15m, 30m, 1h, 4h, 1d) or any integer multiple of one (e.g. 2h, 3h, 12h, 90m), aggregated server-side; invalid or unsupported timeframes return an error, not an empty list.",inputSchema:{type:"object",properties:{pair:{type:"string",description:"e.g. EURUSD, BTCUSD (canonical id; case-insensitive)"},timeframe:{type:"string",description:"A base (1m, 5m, 15m, 30m, 1h, 4h, 1d) or an integer multiple of one (e.g. 2h, 3h, 12h, 90m). No fractional (2.5h) or sub-minute values."},limit:{type:"integer",minimum:1,maximum:200,description:"Maximum candles to return (1-200). Omit for the newest 200."},offset:{type:"integer",minimum:0,maximum:4800,description:"Number of the most-recent candles to skip before applying limit — pages backward through history (0–4800). On aggregated timeframes (e.g. 2h, 3h) the reachable depth is lower (≈ 4800 ÷ the aggregation factor) since fewer bars exist; a deeper offset returns fewer or no bars."}},required:["pair","timeframe"],additionalProperties:!1},handler:async($,v)=>{return await i(v),wX(v.trpc,$)}}),x({name:"list_economic_calendar",description:'List economic calendar events. Filter by currency, date range, release, or minimum impact (1-5). Currency and indicator/release are validated against the catalog: unknown values return an error listing valid options, so an empty result always means "no events" rather than "bad input".',inputSchema:{type:"object",properties:{currency:{type:"array",items:{type:"string"},description:'ISO currency codes, e.g. ["USD","EUR"]'},from:{type:"string",description:"ISO 8601 date or datetime"},to:{type:"string",description:"ISO 8601 date or datetime"},indicator:{type:"string",description:"release slug, e.g. cpi"},impactMin:{type:"integer",minimum:1,maximum:5},view:{type:"string",enum:["minimal","rich"]}},additionalProperties:!1},handler:async($,v)=>{return await i(v),gZ(v.trpc,$)}}),x({name:"get_macro_series",description:"Get a macro indicator time series (e.g. USD cpi). Currency and indicator are validated against the catalog: unknown values return an error listing valid options (case-insensitive).",inputSchema:{type:"object",properties:{currency:{type:"string",description:"ISO currency code, e.g. USD"},indicator:{type:"string",description:"release slug, e.g. cpi"},from:{type:"string",description:"ISO 8601 date or datetime"},to:{type:"string",description:"ISO 8601 date or datetime"},limit:{type:"integer",minimum:1,maximum:1000}},required:["currency","indicator"],additionalProperties:!1},handler:async($,v)=>{return await i(v),uZ(v.trpc,$)}}),x({name:"get_macro_indicator",description:"Get a curated macro indicator series from FXMacroData (live + cached) with unit/frequency metadata and the central-bank target where available — use get_macro_series for raw historical calendar values. Range defaults to 12m; returns a null result when the macro data provider is not configured.",inputSchema:{type:"object",properties:{currency:{type:"string",description:"ISO currency code, e.g. USD"},indicator:{type:"string",description:"indicator slug in lowercase snake_case, e.g. cpi"},range:{type:"string",enum:[...RZ],description:"Lookback window (default 12m)"}},required:["currency","indicator"],additionalProperties:!1},handler:async($,v)=>{return await i(v),CZ(v.trpc,$)}}),x({name:"get_market_config",description:"Get the catalog of supported instruments + timeframes (useful before calling other tools).",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await i(v),xZ(v.trpc)}})];var pO={stopLoss:{type:"number"},takeProfit:{type:"number"},lotSize:{type:"number"},notes:{type:"string"},timeframe:{type:"string",description:"e.g. 1h, 4h, 1d"},riskPercent:{type:"number"},tags:{type:"array",items:{type:"string"}}},Mg={pair:{type:"string",description:"e.g. EURUSD, BTCUSD"},direction:{type:"string",enum:["LONG","SHORT"]},entryPrice:{type:"number"},exitPrice:{type:"number"},stopLoss:{type:"number"},takeProfit:{type:"number"},lotSize:{type:"number"},entryTime:{type:"string",description:"ISO 8601 datetime"},exitTime:{type:"string",description:"ISO 8601 datetime"},notes:{type:"string"},timeframe:{type:"string",description:"e.g. 1h, 4h, 1d"},emotionalTag:{type:"string"},fees:{type:"number"},swap:{type:"number"},reportedPnl:{type:"number",description:"Broker-reported P&L to store instead of recalculated P&L"},tags:{type:"array",items:{type:"string"}}},mX=[x({name:"list_trades",description:"List the authenticated user's trades. Filter by account, status, pair, or date range (ISO 8601). Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"},status:{type:"string",enum:["OPEN","CLOSED","CANCELLED","ALL"]},pair:{type:"string",description:"e.g. EURUSD, BTCUSD"},from:{type:"string",description:"ISO 8601 datetime (inclusive lower bound)"},to:{type:"string",description:"ISO 8601 datetime (inclusive upper bound)"},page:pZ,limit:dZ},additionalProperties:!1},handler:async($,v)=>{return await i(v),iZ(v.trpc,$)}}),x({name:"get_trade",description:"Get a single trade by id. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await i(v),yZ(v.trpc,$)}}),x({name:"list_accounts",description:"List the user's trading accounts (use an account's id when creating a trade). Requires sign-in.",inputSchema:{type:"object",properties:{},additionalProperties:!1},handler:async($,v)=>{return await i(v),FZ(v.trpc)}}),x({name:"trade_stats",description:"Trading performance statistics (win rate, PnL, etc.). Filter by account, pair, or date range. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"},pair:{type:"string"},from:{type:"string",description:"ISO 8601 datetime"},to:{type:"string",description:"ISO 8601 datetime"}},additionalProperties:!1},handler:async($,v)=>{return await i(v),fZ(v.trpc,$)}}),x({name:"create_trade",description:"Record a new trade. Requires sign-in. Use list_accounts to find the accountId.",inputSchema:{type:"object",properties:{accountId:{type:"string",description:"Trading account id (see list_accounts)"},pair:{type:"string",description:"e.g. EURUSD, BTCUSD"},direction:{type:"string",enum:["LONG","SHORT"]},entryPrice:{type:"number"},entryTime:{type:"string",description:"ISO 8601 datetime"},...pO},required:["accountId","pair","direction","entryPrice","entryTime"],additionalProperties:!1},handler:async($,v)=>{return await i(v),nZ(v.trpc,$)}}),x({name:"update_trade",description:"Update fields on an existing trade. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"},pair:{type:"string"},direction:{type:"string",enum:["LONG","SHORT"]},entryPrice:{type:"number"},entryTime:{type:"string",description:"ISO 8601 datetime"},...pO},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await i(v),lZ(v.trpc,$)}}),x({name:"close_trade",description:"Close an open trade with an exit price + time. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"},exitPrice:{type:"number"},exitTime:{type:"string",description:"ISO 8601 datetime"},fees:{type:"number"},swap:{type:"number"},notes:{type:"string"}},required:["id","exitPrice","exitTime"],additionalProperties:!1},handler:async($,v)=>{return await i(v),hZ(v.trpc,$)}}),x({name:"delete_trade",description:"Permanently delete a single trade by id. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await i(v),mZ(v.trpc,$)}}),x({name:"delete_trades",description:"Permanently delete trades on a specific account. Requires explicit status (OPEN, CLOSED, CANCELLED, or ALL). This cannot be undone. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string",description:"Trading account id to delete from"},status:{type:"string",enum:["OPEN","CLOSED","CANCELLED","ALL"]}},required:["accountId","status"],additionalProperties:!1},handler:async($,v)=>{return await i(v),cZ(v.trpc,$)}}),x({name:"import_trades",description:"Import up to 500 trades into one account. Rows with both exitPrice and exitTime are imported as closed trades. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string",description:"Trading account id to import into"},trades:{type:"array",minItems:1,maxItems:500,items:{type:"object",properties:Mg,required:["pair","direction","entryPrice","lotSize","entryTime"],additionalProperties:!1}}},required:["accountId","trades"],additionalProperties:!1},handler:async($,v)=>{return await i(v),rZ(v.trpc,$)}})];function G7($={}){let v=$.includeAuthTools??!0,D=$.includeLiveChartTools??!0;return[...v?bX:[],...fX,...mX,...PX,...hX,...iX,...yX,...CX,...D?lX:[]]}var Pg="aether-wealth-mcp",bg="0.1.27";function tO($,v){let D=new F0({name:Pg,version:bg},{capabilities:{tools:{listChanged:!1},resources:{listChanged:!1,subscribe:!1},prompts:{listChanged:!1}}});return qg(D,$,v??$.toolContext),D}function qg($,v,D){let X=!1,U=(J)=>{let Q=v.clientGate?.nudge;if(Q&&!X)return X=!0,`${Q}
|
|
88
108
|
|
|
89
|
-
${
|
|
109
|
+
${J}`;return J},G=(J)=>{let Q=v.clientGate?.nudge;if(!Q||X)return J;X=!0;let W=J.find((z)=>z.type==="text");if(W)return J.map((z)=>z===W?{type:"text",text:`${Q}
|
|
90
110
|
|
|
91
|
-
${
|
|
92
|
-
`);let
|
|
93
|
-
`),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*{box-sizing:border-box}html,body{height:100%}
|
|
99
|
-
body{margin:0;display:flex;align-items:center;justify-content:center;padding:1.5rem;background:radial-gradient(40rem 40rem at 50% 28%,hsl(var(--accent)/.06),transparent 62%),hsl(var(--bg));color:hsl(var(--fg));font:16px/1.5 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
|
|
100
|
-
.card{width:100%;max-width:23rem;text-align:center;padding:2.5rem 2rem;border-radius:1rem;background:hsl(var(--card)/.6);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);border:1px solid hsl(var(--fg)/.08);box-shadow:0 24px 64px -30px rgb(0 0 0 / .5)}
|
|
101
|
-
.badge{width:3rem;height:3rem;margin:0 auto 1.25rem;border-radius:9999px;display:flex;align-items:center;justify-content:center;font-size:1.4rem;font-weight:700;background:hsl(var(--${v})/.15);color:hsl(var(--${v}))}
|
|
102
|
-
h1{margin:0 0 .5rem;font-size:1.25rem;font-weight:700;letter-spacing:-.01em}
|
|
103
|
-
p{margin:0;color:hsl(var(--muted));font-size:.95rem}
|
|
104
|
-
.brand{margin-top:1.5rem;font:600 10px/1 'Inter',-apple-system,sans-serif;letter-spacing:.2em;text-transform:uppercase;color:hsl(var(--muted))}
|
|
105
|
-
</style></head>
|
|
106
|
-
<body><main class="card"><div class="badge">${D}</div><h1>${$.heading}</h1><p>${$.detail}</p><div class="brand">Aether Wealth</div></main></body></html>`}var bu=KZ({title:"Signed in · Aether Wealth",heading:"Signed in to Aether Wealth",detail:"You can close this tab and return to your assistant.",ok:!0}),BZ=KZ({title:"Sign-in failed · Aether Wealth",heading:"Sign-in failed",detail:"You can close this tab and try again from your assistant.",ok:!1});function qu($,v){return new Promise((D)=>{let I=(U)=>{$.removeListener("error",I),D({ok:!1,...U.code==="EADDRINUSE"?{}:{error:U}})};$.once("error",I),$.listen(v,Y6,()=>{$.removeListener("error",I),D({ok:!0})})})}async function Su($,v){let D;for(let U of v){let X=await qu($,U);if(X.ok)return U;if(X.error)D=X.error}let I=D?`: ${D.message}`:"";throw Error(`could not bind any loopback port (${v.join(", ")}) for OAuth redirect${I}`)}async function NZ($,v){let D=null,I=null,U=null,X=(J)=>{if(D)return;if(D=J,J?.ok)I?.(J.value);else if(J)U?.(J.error)},G=Mu((J,z)=>{let W=new URL(J.url??"/",`http://${Y6}`);if(W.pathname!==v){z.writeHead(404).end("not found");return}let Y=W.searchParams.get("error"),L=W.searchParams.get("code"),V=W.searchParams.get("state");if(Y){z.writeHead(400,{"content-type":"text/html"}).end(BZ),X({ok:!1,error:Error(`authorization denied: ${Y}`)});return}if(!L||!V){z.writeHead(400,{"content-type":"text/html"}).end(BZ),X({ok:!1,error:Error("callback missing code or state")});return}z.writeHead(200,{"content-type":"text/html"}).end(bu),X({ok:!0,value:{code:L,state:V}})}),Q=await Su(G,$);return{redirectUri:YZ(Q),waitForCode(J){return new Promise((z,W)=>{let Y=setTimeout(()=>W(Error("timed out waiting for the browser sign-in to complete")),J);if(Y.unref(),I=(L)=>{clearTimeout(Y),z(L)},U=(L)=>{clearTimeout(Y),W(L)},D?.ok)I(D.value);else if(D)U(D.error)})},close(){return new Promise((J)=>G.close(()=>J()))}}}import{createHash as ku,randomBytes as ZZ}from"node:crypto";function JW($){return $.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function AZ($={}){let v=JW(($.randomBytesImpl??ZZ)(32)),D=$.hashImpl?$.hashImpl(v):ku("sha256").update(v).digest();return{verifier:v,challenge:JW(D),method:"S256"}}function HZ($=ZZ){return JW($(16))}var Tu=300000;async function FZ($){let v=$.fetchImpl??fetch,D=$.log??(()=>{}),I=$.now??Date.now,U=await VZ($.authBaseUrl,v),X=AZ(),G=HZ(),Q=await NZ(zZ,QW);try{let J=uu($.authBaseUrl),z=Eu(U.authorizationEndpoint,{clientId:GW,redirectUri:Q.redirectUri,scope:WZ.join(" "),state:G,codeChallenge:X.challenge,...J?{prompt:"consent"}:{}});if(D(`Opening your browser to sign in. If it doesn't open, visit:
|
|
107
|
-
${z}
|
|
108
|
-
`),!await($.openBrowserImpl??JZ)(z))D(`Could not open a browser automatically — open the URL above manually.
|
|
109
|
-
`);let{code:Y,state:L}=await Q.waitForCode(Tu);if(L!==G)throw Error("OAuth state mismatch — aborting login (possible CSRF).");return await gu(U.tokenEndpoint,{code:Y,codeVerifier:X.verifier,redirectUri:Q.redirectUri,clientId:GW},v,I)}finally{await Q.close()}}function Eu($,v){let D=new URL($);if(D.searchParams.set("response_type","code"),D.searchParams.set("client_id",v.clientId),D.searchParams.set("redirect_uri",v.redirectUri),D.searchParams.set("scope",v.scope),D.searchParams.set("state",v.state),D.searchParams.set("code_challenge",v.codeChallenge),D.searchParams.set("code_challenge_method","S256"),v.prompt)D.searchParams.set("prompt",v.prompt);return D.toString()}function uu($){try{return QZ(new URL($).hostname)}catch{return!1}}async function gu($,v,D=fetch,I=Date.now){let U=new URLSearchParams({grant_type:"authorization_code",code:v.code,redirect_uri:v.redirectUri,client_id:v.clientId,code_verifier:v.codeVerifier}),X=await D($,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:U.toString()}),G=await u1(X),Q=G.access_token,J=G.expires_in;if(!X.ok||typeof Q!=="string")throw Error(`OAuth token exchange failed: ${Ru(G,X.status)}`);if(typeof J!=="number"||J<=0)throw Error("OAuth token exchange returned no valid expires_in");return{accessToken:Q,expiresAt:I()+J*1000}}function Ru($,v){if(typeof $.error_description==="string")return $.error_description;if(typeof $.error==="string")return $.error;return`HTTP ${v}`}var Cu="/auth/api/oauth2/userinfo";async function OZ($,v,D=fetch){let I=`${$.replace(/\/$/,"")}${Cu}`,U;try{U=await D(I,{method:"GET",headers:{authorization:`Bearer ${v}`,accept:"application/json"}})}catch(G){throw Error(`Could not reach the Aether Wealth userinfo endpoint at ${I}`,{cause:G})}if(!U.ok)throw Error(`Aether Wealth userinfo request failed (HTTP ${U.status})`);let X=(await u1(U)).sub;if(typeof X!=="string"||X.length===0)throw Error("Aether Wealth userinfo response did not include a user id");return X}class zW{config;store;deps;constructor($,v,D={}){this.config=$;this.store=v;this.deps=D}cachedUserId=null;async getAccessToken(){let $=await this.store.get(this.config.host);if(!$)return null;let v=(this.deps.now??Date.now)();if($.expiresAt<=v)return await this.store.clear(this.config.host),null;return $.accessToken}async getUserId(){let $=await this.getAccessToken();if(!$)throw Error('Not signed in to Aether Wealth. Call "login" first.');if(this.cachedUserId?.token===$)return this.cachedUserId.userId;let v=await OZ(this.config.baseUrl,$);return this.cachedUserId={token:$,userId:v},v}async login(){let $=await(this.deps.runLoginImpl??FZ)({authBaseUrl:this.config.baseUrl,...this.deps.log?{log:this.deps.log}:{},...this.deps.now?{now:this.deps.now}:{}});await this.store.set(this.config.host,{accessToken:$.accessToken,expiresAt:$.expiresAt})}async logout(){await this.store.clear(this.config.host)}}var jZ="aether-wealth-mcp",WW="0.1.23";function iu($){return{toolContext:$.toolContext,tools:new Map(($.tools??DW()).map((v)=>[v.name,v])),resources:new Map(($.resources??Rz()).map((v)=>[v.uri,v])),prompts:new Map(($.prompts??gz()).map((v)=>[v.name,v])),...$.clientGate?{clientGate:$.clientGate}:{},log:$.log??((v)=>{process.stderr.write(v)})}}function nu($){let v=new JU({name:jZ,version:WW},{capabilities:{tools:{listChanged:!1},resources:{listChanged:!1,subscribe:!1},prompts:{listChanged:!1}}});return xu(v,$),v}class YW{server;bundle;constructor($){this.bundle=iu($),this.server=nu(this.bundle),this.server.oninitialized=()=>{this.bundle.log(`${jZ} initialized
|
|
110
|
-
`)}}async connect($){await this.server.connect($)}async close(){await this.server.close()}isInitialized(){return this.server.getClientVersion()!==void 0}getRegistryBundle(){return this.bundle}}function xu($,v){let D=!1,I=(X)=>{let G=v.clientGate?.nudge;if(G&&!D)return D=!0,`${G}
|
|
111
|
+
${W.text}`}:z);return[{type:"text",text:Q},...J]};$.setRequestHandler(dv,async()=>({tools:Array.from(v.tools.values()).map((J)=>({name:J.name,description:J.description,inputSchema:J.inputSchema}))})),$.setRequestHandler(b6,async(J)=>{if(v.clientGate?.blocked)return{content:[{type:"text",text:v.clientGate.blockedMessage??"Update required."}],isError:!0};let{name:Q,arguments:W}=J.params,z=v.tools.get(Q);if(!z)throw new u(C.MethodNotFound,`tool not found: ${Q}`);let Y=MX(z.inputSchema,W);if(!Y.ok)throw new u(C.InvalidParams,`invalid arguments for ${Q}: ${Y.reason}`);try{let I=await z.handler(Y.args,D),V=Sg(I);if(V)return{content:G(V.content),isError:!1};return{content:[{type:"text",text:U(kg(I))}],isError:!1}}catch(I){return{content:[{type:"text",text:Eg(I)}],isError:!0}}}),$.setRequestHandler(hv,async()=>({resources:Array.from(v.resources.values()).map((J)=>({uri:J.uri,name:J.name,description:J.description,mimeType:J.mimeType}))})),$.setRequestHandler(mv,async(J)=>{let{uri:Q}=J.params,W=v.resources.get(Q);if(!W)throw new u(C.MethodNotFound,`resource not found: ${Q}`);let z=await W.handler(D);return{contents:[{uri:Q,mimeType:W.mimeType,text:z.text}]}}),$.setRequestHandler(cv,async()=>({prompts:Array.from(v.prompts.values()).map((J)=>({name:J.name,description:J.description,...J.arguments?{arguments:J.arguments}:{}}))})),$.setRequestHandler(rv,async(J)=>{let{name:Q,arguments:W}=J.params,z=v.prompts.get(Q);if(!z)throw new u(C.MethodNotFound,`prompt not found: ${Q}`);let Y={};for(let[V,B]of Object.entries(W??{}))if(typeof B==="string")Y[V]=B;for(let V of z.arguments??[])if(V.required&&!(V.name in Y))throw new u(C.InvalidParams,`prompts/get: missing required argument: ${V.name}`);let I=z.handler(Y);return{description:z.description,messages:I}})}function Sg($){if(typeof $!=="object"||$===null)return null;let v=$.content;if(!Array.isArray(v)||v.length===0)return null;return v.every((X)=>typeof X==="object"&&X!==null&&typeof X.type==="string")?$:null}function kg($){if(typeof $==="string")return $;return JSON.stringify($,null,2)}function Eg($){if(!($ instanceof Error))return String($);let v=$,D=[`${v.name??"Error"}: ${v.message}`];if(typeof v.status==="number")D.push(`status=${v.status}`);if(v.code)D.push(`code=${v.code}`);if(v.method&&v.path)D.push(`request=${v.method} ${v.path}`);return D.join(" | ")}var Rg="/mcp",gg="/healthz";async function J7($,v){let D=v.path??Rg,X=v.hostname??g4,U=v.log??((W)=>{process.stderr.write(W)}),G=v.oauth;if(G&&v.bearerToken)throw Error("startHttpServer: `bearerToken` and `oauth` are mutually exclusive");if(!G&&!v.bearerToken)U(`[http] WARNING: no auth configured; binding to ${X}:${v.port}${D} unauthenticated
|
|
112
|
+
`);let J=ug({path:D,bundle:$.getRegistryBundle(),log:U,...G?{oauth:G}:{},...v.bearerToken?{bearerToken:v.bearerToken}:{}});if(globalThis.Bun?.serve)return fg(J,v,X);return _g(J,v,X)}async function eO($,v,D,X){let U=tO(v,D),G=new jz({enableJsonResponse:!0});try{return await U.connect(G),await G.handleRequest($)}catch(J){return X(`[http] dispatch error: ${Q7(J)}
|
|
113
|
+
`),F1(500,{error:"internal error"})}finally{await G.close().catch(aO),await U.close().catch(aO)}}function ug($){let{path:v,bundle:D,log:X,oauth:U,bearerToken:G}=$,J=new Set([Az,`${Az}${v}`]),Q=async(W)=>{let z=new URL(W.url),Y=Cg(W,z,v,U,J);if(Y)return Y;if(U)return xg(W,U,D,X);if(G&&!cg(W,G))return new Response("unauthorized",{status:401});return eO(W,D,void 0,X)};return U?async(W)=>qV(await Q(W)):Q}function Cg($,v,D,X,U){if(v.pathname===gg&&$.method==="GET")return F1(200,{ok:!0});if(X){let G=PV($,v,X,D,U);if(G)return G}if(v.pathname!==D)return new Response("not found",{status:404});if($.method==="GET"&&!X)return F1(200,{ok:!0,transport:"streamable-http"});return null}async function xg($,v,D,X){let U=bV($);for(let Q of SV($,U)){let W=v.rateLimiter.check(Q);if(!W.allowed)return new Response(JSON.stringify({error:"rate_limited"}),{status:429,headers:{"content-type":"application/json","retry-after":String(W.retryAfterSeconds)}})}if(!U)return wz(v);let G;try{G=await v.tokenVerifier.verify(U)}catch(Q){return X(`[http] token verification unavailable: ${Q7(Q)}
|
|
114
|
+
`),F1(502,{error:"token verification unavailable"})}if(!G.ok)return wz(v,"invalid_token");let J=EV({token:U,userId:G.userId,trpcUrl:v.trpcUrl,onUnauthorized:()=>v.tokenVerifier.invalidate(U)});return eO($,D,J,X)}function fg($,v,D){let U=globalThis.Bun.serve({port:v.port,hostname:D,fetch:$});return{port:U.port??v.port,close:async()=>{await U.stop()}}}async function _g($,v,D){let X=Tg((J,Q)=>{ig(J,Q,$).catch(()=>{})});return await new Promise((J,Q)=>{X.once("error",Q),X.listen(v.port,D,()=>{X.off("error",Q),J()})}),{port:X.address()?.port??v.port,close:()=>new Promise((J,Q)=>{X.close((W)=>{if(W)Q(W);else J()})})}}async function ig($,v,D){try{let X=await yg($),U=await D(X);await mg(U,v)}catch(X){if(!v.headersSent){v.statusCode=500,v.setHeader("content-type","application/json"),v.end(JSON.stringify({error:Q7(X)}));return}v.end()}}async function yg($){let v=ng($),D=lg($),X=$.method??"GET",U={method:X,headers:D},G=await hg($,X);if(G)U.body=G,U.duplex="half";return new Request(v,U)}function ng($){let v=$.socket,D=$.headers["x-forwarded-proto"]??(v?.encrypted?"https":"http"),X=$.headers.host??"localhost";return new URL($.url??"/",`${D}://${X}`).toString()}function lg($){let v=new Headers;for(let[D,X]of Object.entries($.headers)){if(X===void 0)continue;if(Array.isArray(X))for(let U of X)v.append(D,U);else v.append(D,X)}return v}async function hg($,v){if(v==="GET"||v==="HEAD")return;let D=[];for await(let X of $)D.push(Buffer.isBuffer(X)?X:Buffer.from(X));return D.length>0?Buffer.concat(D):void 0}async function mg($,v){if(v.statusCode=$.status,$.headers.forEach((X,U)=>{v.setHeader(U,X)}),!$.body){v.end();return}let D=$.body.getReader();try{while(!0){let{value:X,done:U}=await D.read();if(U)break;if(X)v.write(Buffer.from(X))}}finally{D.releaseLock(),v.end()}}function cg($,v){let D=$.headers.get("authorization");if(!D)return!1;if(!D.startsWith("Bearer "))return!1;let X=D.slice(7),U=Buffer.from(X,"utf8"),G=Buffer.from(v,"utf8");if(U.length!==G.length){let J=Buffer.alloc(G.length);return U.copy(J,0,0,Math.min(U.length,G.length)),oO(J,G),!1}return oO(U,G)}function Q7($){if($ instanceof Error)return $.message;return String($)}function aO(){return}var rg="aether-wealth-mcp",dg=[33417,33418,33419],pg="/callback",tg=["trades:read","trades:write","accounts:read","alerts:read","alerts:write"],og="aether-wealth-mcp",ag="AETHER_MCP_CREDENTIALS_FILE",y1={clientId:rg,redirectPorts:dg,redirectPath:pg,scopes:tg,keychainService:og,credentialsFilePath:q0("aether-wealth-mcp"),forceFileEnvVar:ag};function sO($={}){let v=$.hosted??!1,D=v?["Authentication is handled by the MCP connection itself — there are no sign-in tools to call. If calls fail with an authorization error, the user must re-authorize this connection in their MCP client settings."]:["Auth tools:"," • login — sign in. Opens the browser; the user authenticates and approves access. Call this first if a data tool reports the user is not signed in."," • logout — sign out on this device."],X=v?" 3. If it fails with an authorization error, tell the user to re-authorize the Aether Wealth connection in their MCP client, then retry.":' 3. If it reports "not signed in", call login, wait for the user to finish in the browser, then retry.';return[{name:"getting_started",description:"Brief the LLM on what the Aether Wealth MCP exposes and the sign-in-first flow.",handler:()=>[{role:"user",content:{type:"text",text:["You are connected to the Aether Wealth MCP — programmatic access to the user's trading journal, alerts, market data, indicators, charts, and live-chart controls, over an authenticated connection.","",...D,"","Context:"," • get_context — snapshot accounts, open trades, recent stats, and active alerts in one call. Call it first to ground your suggestions.","","Domains (partial — see the aetherwealth://capabilities resource for the full set):"," • Journal: list_trades, get_trade, create_trade, update_trade, close_trade, delete_trade, delete_trades, import_trades, trade_stats, list_accounts"," • Alerts: list_alerts, create_price_alert, create_trendline_alert, create_indicator_alert, list_indicator_alerts, update_indicator_alert, delete_indicator_alert, update_alert, delete_alert"," • Market data + indicators: get_candles, get_market_config, get_indicators"," • Macro: list_economic_calendar, get_macro_series, get_macro_indicator"," • FX macro context: get_fx_pair_context, get_fx_currency_context, get_fx_predictions, get_fx_risk_sentiment, get_fx_documents, get_fx_sync_state"," • Charts: render_chart, chart_select_pair, chart_change_timeframe, chart_draw_shapes, chart_remove_drawings","","Recommended flow:"," 1. Call get_context to load live state."," 2. Try the data tool the user asked for (e.g. list_trades).",X].join(`
|
|
115
|
+
`)}}]},{name:"dashboard_context",description:"Brief the LLM on the full Aether Wealth surface, grounding in live state, and when to suggest the dashboard.",handler:()=>[{role:"user",content:{type:"text",text:["You are connected to Aether Wealth, a multi-market trading workspace.",AX,"","Before you advise, call get_context to load the user's live state (accounts, open trades, recent stats, active alerts) so your suggestions fit what they are actually doing. The aetherwealth://capabilities resource, if your client attaches it, is the full surface map — which actions are MCP-callable vs dashboard-only.","","When the user needs something that is dashboard-only (the full charting workspace and saved layouts, the Pine editor, the full journal UI, the Aether Intelligence assistant),",`tell them to open the dashboard at ${x4} rather than attempting it over MCP.`].join(`
|
|
116
|
+
`)}}]}]}var $H="aether-wealth-mcp",W7="0.1.27";function eg($){return{toolContext:$.toolContext,tools:new Map(($.tools??G7()).map((v)=>[v.name,v])),resources:new Map(($.resources??C5()).map((v)=>[v.uri,v])),prompts:new Map(($.prompts??u5()).map((v)=>[v.name,v])),...$.clientGate?{clientGate:$.clientGate}:{},log:$.log??((v)=>{process.stderr.write(v)})}}function sg($,v){let D=new F0({name:$H,version:W7},{capabilities:{tools:{listChanged:!1},resources:{listChanged:!1,subscribe:!1},prompts:{listChanged:!1}}});return $u(D,$,v??$.toolContext),D}class cX{server;bundle;constructor($){this.bundle=eg($),this.server=sg(this.bundle),this.server.oninitialized=()=>{this.bundle.log(`${$H} initialized
|
|
117
|
+
`)}}async connect($){await this.server.connect($)}async close(){await this.server.close()}isInitialized(){return this.server.getClientVersion()!==void 0}getRegistryBundle(){return this.bundle}}function $u($,v,D){let X=!1,U=(J)=>{let Q=v.clientGate?.nudge;if(Q&&!X)return X=!0,`${Q}
|
|
111
118
|
|
|
112
|
-
${
|
|
119
|
+
${J}`;return J},G=(J)=>{let Q=v.clientGate?.nudge;if(!Q||X)return J;X=!0;let W=J.find((z)=>z.type==="text");if(W)return J.map((z)=>z===W?{type:"text",text:`${Q}
|
|
113
120
|
|
|
114
|
-
${
|
|
115
|
-
`);if($===-1)return null;let v=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),
|
|
116
|
-
`}class UI{constructor($=PZ.stdin,v=PZ.stdout){this._stdin=$,this._stdout=v,this._readBuffer=new LW,this._started=!1,this._ondata=(D)=>{this._readBuffer.append(D),this.processReadBuffer()},this._onerror=(D)=>{this.onerror?.(D)}}async start(){if(this._started)throw 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((v)=>{let D=wZ($);if(this._stdout.write(D))v();else this._stdout.once("drain",v)})}}var{create:hu,defineProperty:MZ,getOwnPropertyDescriptor:ru,getOwnPropertyNames:bZ,getPrototypeOf:mu}=Object,cu=Object.prototype.hasOwnProperty,Z4=($,v)=>function(){return v||(0,$[bZ($)[0]])((v={exports:{}}).exports,v),v.exports},du=($,v,D,I)=>{if(v&&typeof v==="object"||typeof v==="function"){for(var U=bZ(v),X=0,G=U.length,Q;X<G;X++)if(Q=U[X],!cu.call($,Q)&&Q!==D)MZ($,Q,{get:((J)=>v[J]).bind(null,Q),enumerable:!(I=ru(v,Q))||I.enumerable})}return $},I$=($,v,D)=>(D=$!=null?hu(mu($)):{},du(v||!$||!$.__esModule?MZ(D,"default",{value:$,enumerable:!0}):D,$)),qZ=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,v){function D(I){return v.exports=D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},v.exports.__esModule=!0,v.exports.default=v.exports,D(I)}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),tu=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,v){var D=qZ().default;function I(U,X){if(D(U)!="object"||!U)return U;var G=U[Symbol.toPrimitive];if(G!==void 0){var Q=G.call(U,X||"default");if(D(Q)!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(U)}v.exports=I,v.exports.__esModule=!0,v.exports.default=v.exports}}),pu=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,v){var D=qZ().default,I=tu();function U(X){var G=I(X,"string");return D(G)=="symbol"?G:G+""}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}}),q4=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,v){var D=pu();function I(U,X,G){return(X=D(X))in U?Object.defineProperty(U,X,{value:G,enumerable:!0,configurable:!0,writable:!0}):U[X]=G,U}v.exports=I,v.exports.__esModule=!0,v.exports.default=v.exports}}),F$=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,v){var D=q4();function I(X,G){var Q=Object.keys(X);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(X);G&&(J=J.filter(function(z){return Object.getOwnPropertyDescriptor(X,z).enumerable})),Q.push.apply(Q,J)}return Q}function U(X){for(var G=1;G<arguments.length;G++){var Q=arguments[G]!=null?arguments[G]:{};G%2?I(Object(Q),!0).forEach(function(J){D(X,J,Q[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(Q)):I(Object(Q)).forEach(function(J){Object.defineProperty(X,J,Object.getOwnPropertyDescriptor(Q,J))})}return X}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}});function S4($){let v={subscribe(D){let I=null,U=!1,X=!1,G=!1;function Q(){if(I===null){G=!0;return}if(X)return;if(X=!0,typeof I==="function")I();else if(I)I.unsubscribe()}if(I=$({next(J){var z;if(U)return;(z=D.next)===null||z===void 0||z.call(D,J)},error(J){var z;if(U)return;U=!0,(z=D.error)===null||z===void 0||z.call(D,J),Q()},complete(){var J;if(U)return;U=!0,(J=D.complete)===null||J===void 0||J.call(D),Q()}}),G)Q();return{unsubscribe:Q}},pipe(...D){return D.reduce(ou,v)}};return v}function ou($,v){return v($)}function VW($){let v=new AbortController;return new Promise((I,U)=>{let X=!1;function G(){if(X)return;X=!0,Q.unsubscribe()}v.signal.addEventListener("abort",()=>{U(v.signal.reason)});let Q=$.subscribe({next(J){X=!0,I(J),G()},error(J){U(J)},complete(){v.abort(),G()}})})}function BW($){return(v)=>{let D=0,I=null,U=[];function X(){if(I)return;I=v.subscribe({next(Q){for(let z of U){var J;(J=z.next)===null||J===void 0||J.call(z,Q)}},error(Q){for(let z of U){var J;(J=z.error)===null||J===void 0||J.call(z,Q)}},complete(){for(let J of U){var Q;(Q=J.complete)===null||Q===void 0||Q.call(J)}}})}function G(){if(D===0&&I){let Q=I;I=null,Q.unsubscribe()}}return S4((Q)=>{return D++,U.push(Q),X(),{unsubscribe(){D--,G();let J=U.findIndex((z)=>z===Q);if(J>-1)U.splice(J,1)}}})}}var Sm=Symbol();function DI($){let v=$,D=[],I=(G)=>{if(v!==void 0)G.next(v);D.push(G)},U=(G)=>{D.splice(D.indexOf(G),1)},X=S4((G)=>{return I(G),()=>{U(G)}});return X.next=(G)=>{if(v===G)return;v=G;for(let Q of D)Q.next(G)},X.get=()=>v,X}function SZ($){return S4((v)=>{function D(U=0,X=$.op){let G=$.links[U];if(!G)throw Error("No more links to execute - did you forget to add an ending link?");return G({op:X,next(J){return D(U+1,J)}})}return D().subscribe(v)})}function _4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function II(){return Object.create(null)}var g1={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 kZ=[g1.BAD_GATEWAY,g1.SERVICE_UNAVAILABLE,g1.GATEWAY_TIMEOUT,g1.INTERNAL_SERVER_ERROR];var{create:eu,defineProperty:EZ,getOwnPropertyDescriptor:su,getOwnPropertyNames:uZ,getPrototypeOf:$g}=Object,vg=Object.prototype.hasOwnProperty,VU=($,v)=>function(){return v||(0,$[uZ($)[0]])((v={exports:{}}).exports,v),v.exports},Ug=($,v,D,I)=>{if(v&&typeof v==="object"||typeof v==="function"){for(var U=uZ(v),X=0,G=U.length,Q;X<G;X++)if(Q=U[X],!vg.call($,Q)&&Q!==D)EZ($,Q,{get:((J)=>v[J]).bind(null,Q),enumerable:!(I=su(v,Q))||I.enumerable})}return $},BU=($,v,D)=>(D=$!=null?eu($g($)):{},Ug(v||!$||!$.__esModule?EZ(D,"default",{value:$,enumerable:!0}):D,$)),gZ=()=>{},TZ=($)=>{if(Object.freeze)Object.freeze($)};function RZ($,v,D){var I;let U=v.join(".");return(I=D[U])!==null&&I!==void 0||(D[U]=new Proxy(gZ,{get(X,G){if(typeof G!=="string"||G==="then")return;return RZ($,[...v,G],D)},apply(X,G,Q){let J=v[v.length-1];if(J==="valueOf"||J==="toString"||J==="toJSON")return`tRPC.proxy(${v.slice(0,-1).join(".")})`;let z={args:Q,path:v};if(J==="call")z={args:Q.length>=2?[Q[1]]:[],path:v.slice(0,-1)};else if(J==="apply")z={args:Q.length>=2?Q[1]:[],path:v.slice(0,-1)};return TZ(z.args),TZ(z.path),$(z)}})),D[U]}var XI=($)=>RZ($,[],II()),KW=($)=>{return new Proxy(gZ,{get(v,D){if(D==="then")return;return $(D)}})};var CZ=VU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,v){function D(I){return v.exports=D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},v.exports.__esModule=!0,v.exports.default=v.exports,D(I)}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),Dg=VU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,v){var D=CZ().default;function I(U,X){if(D(U)!="object"||!U)return U;var G=U[Symbol.toPrimitive];if(G!==void 0){var Q=G.call(U,X||"default");if(D(Q)!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(U)}v.exports=I,v.exports.__esModule=!0,v.exports.default=v.exports}}),Ig=VU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,v){var D=CZ().default,I=Dg();function U(X){var G=I(X,"string");return D(G)=="symbol"?G:G+""}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}}),NW=VU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,v){var D=Ig();function I(U,X,G){return(X=D(X))in U?Object.defineProperty(U,X,{value:G,enumerable:!0,configurable:!0,writable:!0}):U[X]=G,U}v.exports=I,v.exports.__esModule=!0,v.exports.default=v.exports}}),GI=VU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,v){var D=NW();function I(X,G){var Q=Object.keys(X);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(X);G&&(J=J.filter(function(z){return Object.getOwnPropertyDescriptor(X,z).enumerable})),Q.push.apply(Q,J)}return Q}function U(X){for(var G=1;G<arguments.length;G++){var Q=arguments[G]!=null?arguments[G]:{};G%2?I(Object(Q),!0).forEach(function(J){D(X,J,Q[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(Q)):I(Object(Q)).forEach(function(J){Object.defineProperty(X,J,Object.getOwnPropertyDescriptor(Q,J))})}return X}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}}),hm=BU(GI(),1);var dm=BU(NW(),1);var QI=BU(GI(),1);function Qg($,v){if("error"in $){let I=v.deserialize($.error);return{ok:!1,error:(0,QI.default)((0,QI.default)({},$),{},{error:I})}}return{ok:!0,result:(0,QI.default)((0,QI.default)({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:v.deserialize($.result.data)})}}var ZW=class extends Error{constructor(){super("Unable to transform response from server")}};function AW($,v){let D;try{D=Qg($,v)}catch(I){throw new ZW}if(!D.ok&&(!_4(D.error.error)||typeof D.error.error.code!=="number"))throw new ZW;if(D.ok&&!_4(D.result))throw new ZW;return D}var tm=BU(GI(),1);var pm=Symbol();var JI=I$(q4(),1),R1=I$(F$(),1);function iZ($){return $ instanceof z6}function Yg($){return _4($)&&_4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function Lg($,v){if(typeof $==="string")return $;if(_4($)&&typeof $.message==="string")return $.message;return v}var z6=class $ extends Error{constructor(v,D){var I,U;let X=D===null||D===void 0?void 0:D.cause;super(v,{cause:X});(0,JI.default)(this,"cause",void 0),(0,JI.default)(this,"shape",void 0),(0,JI.default)(this,"data",void 0),(0,JI.default)(this,"meta",void 0),this.meta=D===null||D===void 0?void 0:D.meta,this.cause=X,this.shape=D===null||D===void 0||(I=D.result)===null||I===void 0?void 0:I.error,this.data=D===null||D===void 0||(U=D.result)===null||U===void 0?void 0:U.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(v,D={}){let I=v;if(iZ(I)){if(D.meta)I.meta=(0,R1.default)((0,R1.default)({},I.meta),D.meta);return I}if(Yg(I))return new $(I.error.message,(0,R1.default)((0,R1.default)({},D),{},{result:I,cause:D.cause}));return new $(Lg(I,"Unknown error"),(0,R1.default)((0,R1.default)({},D),{},{cause:I}))}};function zI($){let v=$;if(!v)return{input:{serialize:(D)=>D,deserialize:(D)=>D},output:{serialize:(D)=>D,deserialize:(D)=>D}};if("input"in v)return v;return{input:v,output:v}}var nZ=($)=>typeof $==="function";function xZ($){if($)return $;if(typeof window<"u"&&nZ(window.fetch))return window.fetch;if(typeof globalThis<"u"&&nZ(globalThis.fetch))return globalThis.fetch;throw Error("No fetch implementation found")}var KU=I$(F$());function WI($){return{url:$.url.toString(),fetch:$.fetch,transformer:zI($.transformer),methodOverride:$.methodOverride}}function Vg($){let v={};for(let D=0;D<$.length;D++){let I=$[D];v[D]=I}return v}var Bg={query:"GET",mutation:"POST",subscription:"PATCH"};function fZ($){return"input"in $?$.transformer.input.serialize($.input):Vg($.inputs.map((v)=>$.transformer.input.serialize(v)))}var NU=($)=>{let v=$.url.split("?"),I=v[0].replace(/\/$/,"")+"/"+$.path,U=[];if(v[1])U.push(v[1]);if("inputs"in $)U.push("batch=1");if($.type==="query"||$.type==="subscription"){let X=fZ($);if(X!==void 0&&$.methodOverride!=="POST")U.push(`input=${encodeURIComponent(JSON.stringify(X))}`)}if(U.length)I+="?"+U.join("&");return I},_Z=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let v=fZ($);return v!==void 0?JSON.stringify(v):void 0},HW=($)=>{return lZ((0,KU.default)((0,KU.default)({},$),{},{contentTypeHeader:"application/json",getUrl:NU,getBody:_Z}))},Kg=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},Ng=($)=>{var v;if(!($===null||$===void 0?void 0:$.aborted))return;if((v=$.throwIfAborted)===null||v===void 0||v.call($),typeof DOMException<"u")throw new DOMException("AbortError","AbortError");throw new Kg};async function yZ($){var v,D;Ng($.signal);let I=$.getUrl($),U=$.getBody($),X=(v=$.methodOverride)!==null&&v!==void 0?v:Bg[$.type],G=await(async()=>{let J=await $.headers();if(Symbol.iterator in J)return Object.fromEntries(J);return J})(),Q=(0,KU.default)((0,KU.default)((0,KU.default)({},$.contentTypeHeader&&X!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(D=$.trpcAcceptHeaderKey)!==null&&D!==void 0?D:"trpc-accept"]:$.trpcAcceptHeader}:void 0),G);return xZ($.fetch)(I,{method:X,signal:$.signal,body:U,headers:Q})}async function lZ($){let v={},D=await yZ($);v.response=D;let I=await D.json();return v.responseJSON=I,{json:I,meta:v}}var Id=I$(F$(),1);var hZ=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function FW($){let v=null,D=null,I=()=>{clearTimeout(D),D=null,v=null};function U(Q){let J=[[]],z=0;while(!0){let L=Q[z];if(!L)break;let V=J[J.length-1];if(L.aborted){var W;(W=L.reject)===null||W===void 0||W.call(L,Error("Aborted")),z++;continue}if($.validate(V.concat(L).map((N)=>N.key))){V.push(L),z++;continue}if(V.length===0){var Y;(Y=L.reject)===null||Y===void 0||Y.call(L,Error("Input is too big for a single dispatch")),z++;continue}J.push([])}return J}function X(){let Q=U(v);I();for(let J of Q){if(!J.length)continue;let z={items:J};for(let Y of J)Y.batch=z;$.fetch(z.items.map((Y)=>Y.key)).then(async(Y)=>{await Promise.all(Y.map(async(V,B)=>{let N=z.items[B];try{var A;let S=await Promise.resolve(V);(A=N.resolve)===null||A===void 0||A.call(N,S)}catch(S){var F;(F=N.reject)===null||F===void 0||F.call(N,S)}N.batch=null,N.reject=null,N.resolve=null}));for(let V of z.items){var L;(L=V.reject)===null||L===void 0||L.call(V,Error("Missing result")),V.batch=null}}).catch((Y)=>{for(let V of z.items){var L;(L=V.reject)===null||L===void 0||L.call(V,Y),V.batch=null}})}}function G(Q){var J;let z={aborted:!1,key:Q,batch:null,resolve:hZ,reject:hZ},W=new Promise((Y,L)=>{var V;z.reject=L,z.resolve=Y,(V=v)!==null&&V!==void 0||(v=[]),v.push(z)});return(J=D)!==null&&J!==void 0||(D=setTimeout(X)),W}return{load:G}}function rZ(...$){let v=new AbortController,D=$.length,I=0,U=()=>{if(++I===D)v.abort()};for(let X of $)if(X===null||X===void 0?void 0:X.aborted)U();else X===null||X===void 0||X.addEventListener("abort",U,{once:!0});return v.signal}var YI=I$(F$(),1);function OW($){var v,D;let I=WI($),U=(v=$.maxURLLength)!==null&&v!==void 0?v:1/0,X=(D=$.maxItems)!==null&&D!==void 0?D:1/0;return()=>{let G=(W)=>{return{validate(Y){if(U===1/0&&X===1/0)return!0;if(Y.length>X)return!1;let L=Y.map((N)=>N.path).join(","),V=Y.map((N)=>N.input);return NU((0,YI.default)((0,YI.default)({},I),{},{type:W,path:L,inputs:V,signal:null})).length<=U},async fetch(Y){let L=Y.map((S)=>S.path).join(","),V=Y.map((S)=>S.input),B=rZ(...Y.map((S)=>S.signal)),N=await HW((0,YI.default)((0,YI.default)({},I),{},{path:L,inputs:V,type:W,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({opList:Y});return $.headers},signal:B}));return(Array.isArray(N.json)?N.json:Y.map(()=>N.json)).map((S)=>({meta:N.meta,json:S}))}}},Q=FW(G("query")),J=FW(G("mutation")),z={query:Q,mutation:J};return({op:W})=>{return S4((Y)=>{if(W.type==="subscription")throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let V=z[W.type].load(W),B=void 0;return V.then((N)=>{B=N;let A=AW(N.json,I.transformer.output);if(!A.ok){Y.error(z6.from(A.error,{meta:N.meta}));return}Y.next({context:N.meta,result:A.result}),Y.complete()}).catch((N)=>{Y.error(z6.from(N,{meta:B===null||B===void 0?void 0:B.meta}))}),()=>{}})}}}var Vd=I$(F$(),1);var jW=($,...v)=>{return typeof $==="function"?$(...v):$},Hd=I$(q4(),1);function Zg(){let $,v;return{promise:new Promise((I,U)=>{$=I,v=U}),resolve:$,reject:v}}async function Ag($){let v=await jW($.url);if(!$.connectionParams)return v;let I=`${v.includes("?")?"&":"?"}connectionParams=1`;return v+I}async function Hg($,v){let D={method:"connectionParams",data:await jW($)};return v.encode(D)}var Fd=I$(q4(),1);var W6=I$(q4(),1);function Fg($){let{promise:v,resolve:D,reject:I}=Zg();return $.addEventListener("open",()=>{$.removeEventListener("error",I),D()}),$.addEventListener("error",I),v}function Og($,{intervalMs:v,pongTimeoutMs:D}){let I,U;function X(){I=setTimeout(()=>{$.send("PING"),U=setTimeout(()=>{$.close()},D)},v)}function G(){clearTimeout(I),X()}function Q(){clearTimeout(U),G()}$.addEventListener("open",X),$.addEventListener("message",({data:J})=>{if(clearTimeout(I),X(),J==="PONG")Q()}),$.addEventListener("close",()=>{clearTimeout(I),clearTimeout(U)})}var jg=class ${constructor(v){var D;if((0,W6.default)(this,"id",++$.connectCount),(0,W6.default)(this,"WebSocketPonyfill",void 0),(0,W6.default)(this,"urlOptions",void 0),(0,W6.default)(this,"keepAliveOpts",void 0),(0,W6.default)(this,"encoder",void 0),(0,W6.default)(this,"wsObservable",DI(null)),(0,W6.default)(this,"openPromise",null),this.WebSocketPonyfill=(D=v.WebSocketPonyfill)!==null&&D!==void 0?D:WebSocket,!this.WebSocketPonyfill)throw 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=v.urlOptions,this.keepAliveOpts=v.keepAlive,this.encoder=v.encoder}get ws(){return this.wsObservable.get()}set ws(v){this.wsObservable.next(v)}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 v=this;if(v.openPromise)return v.openPromise;v.id=++$.connectCount;let D=Ag(v.urlOptions).then((I)=>new v.WebSocketPonyfill(I));v.openPromise=D.then(async(I)=>{if(v.ws=I,I.binaryType="arraybuffer",I.addEventListener("message",function({data:U}){if(U==="PING")this.send("PONG")}),v.keepAliveOpts.enabled)Og(I,v.keepAliveOpts);if(I.addEventListener("close",()=>{if(v.ws===I)v.ws=null}),await Fg(I),v.urlOptions.connectionParams)I.send(await Hg(v.urlOptions.connectionParams,v.encoder))});try{await v.openPromise}finally{v.openPromise=null}}async close(){var v=this;try{await v.openPromise}finally{var D;(D=v.ws)===null||D===void 0||D.close()}}};(0,W6.default)(jg,"connectCount",0);var Od=I$(q4(),1),jd=I$(F$(),1);var wW=I$(q4(),1),mZ=I$(F$(),1),wg=class{constructor($){(0,wW.default)(this,"links",void 0),(0,wW.default)(this,"runtime",void 0),(0,wW.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((v)=>v(this.runtime))}$request($){var v;return SZ({links:this.links,op:(0,mZ.default)((0,mZ.default)({},$),{},{context:(v=$.context)!==null&&v!==void 0?v:{},id:++this.requestId})}).pipe(BW())}async requestAsPromise($){var v=this;try{let D=v.$request($);return(await VW(D)).result.data}catch(D){throw z6.from(D)}}query($,v,D){return this.requestAsPromise({type:"query",path:$,input:v,context:D===null||D===void 0?void 0:D.context,signal:D===null||D===void 0?void 0:D.signal})}mutation($,v,D){return this.requestAsPromise({type:"mutation",path:$,input:v,context:D===null||D===void 0?void 0:D.context,signal:D===null||D===void 0?void 0:D.signal})}subscription($,v,D){return this.$request({type:"subscription",path:$,input:v,context:D.context,signal:D.signal}).subscribe({next(U){switch(U.result.type){case"state":{var X;(X=D.onConnectionStateChange)===null||X===void 0||X.call(D,U.result);break}case"started":{var G;(G=D.onStarted)===null||G===void 0||G.call(D,{context:U.context});break}case"stopped":{var Q;(Q=D.onStopped)===null||Q===void 0||Q.call(D);break}case"data":case void 0:{var J;(J=D.onData)===null||J===void 0||J.call(D,U.result.data);break}}},error(U){var X;(X=D.onError)===null||X===void 0||X.call(D,U)},complete(){var U;(U=D.onComplete)===null||U===void 0||U.call(D)}})}};var Pg=Symbol.for("trpc_untypedClient"),Mg={query:"query",mutate:"mutation",subscribe:"subscription"},bg=($)=>{return Mg[$]};function qg($){let v=XI(({path:D,args:I})=>{let U=[...D],X=bg(U.pop()),G=U.join(".");return $[X](G,...I)});return KW((D)=>{if(D===Pg)return $;return v[D]})}function cZ($){let v=new wg($);return qg(v)}var ad=I$(F$(),1);var ed=I$(F$(),1);var Sg=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,v){function D(U){var X,G,Q,J=2;for(typeof Symbol<"u"&&(G=Symbol.asyncIterator,Q=Symbol.iterator);J--;){if(G&&(X=U[G])!=null)return X.call(U);if(Q&&(X=U[Q])!=null)return new I(X.call(U));G="@@asyncIterator",Q="@@iterator"}throw TypeError("Object is not async iterable")}function I(U){function X(G){if(Object(G)!==G)return Promise.reject(TypeError(G+" is not an object."));var Q=G.done;return Promise.resolve(G.value).then(function(J){return{value:J,done:Q}})}return I=function(Q){this.s=Q,this.n=Q.next},I.prototype={s:null,n:null,next:function(){return X(this.n.apply(this.s,arguments))},return:function(Q){var J=this.s.return;return J===void 0?Promise.resolve({value:Q,done:!0}):X(J.apply(this.s,arguments))},throw:function(Q){var J=this.s.return;return J===void 0?Promise.reject(Q):X(J.apply(this.s,arguments))}},new I(U)}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),sd=I$(Sg(),1);var $t=I$(F$(),1);var kg=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,v){function D(){var I=typeof SuppressedError=="function"?SuppressedError:function(Q,J){var z=Error();return z.name="SuppressedError",z.error=Q,z.suppressed=J,z},U={},X=[];function G(Q,J){if(J!=null){if(Object(J)!==J)throw TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(Q)var z=J[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(z===void 0&&(z=J[Symbol.dispose||Symbol.for("Symbol.dispose")],Q))var W=z;if(typeof z!="function")throw TypeError("Object is not disposable.");W&&(z=function(){try{W.call(J)}catch(L){return Promise.reject(L)}}),X.push({v:J,d:z,a:Q})}else Q&&X.push({d:J,a:Q});return J}return{e:U,u:G.bind(null,!1),a:G.bind(null,!0),d:function(){var J,z=this.e,W=0;function Y(){for(;J=X.pop();)try{if(!J.a&&W===1)return W=0,X.push(J),Promise.resolve().then(Y);if(J.d){var V=J.d.call(J.v);if(J.a)return W|=2,Promise.resolve(V).then(Y,L)}else W|=1}catch(B){return L(B)}if(W===1)return z!==U?Promise.reject(z):Promise.resolve();if(z!==U)throw z}function L(V){return z=z!==U?new I(V,z):V,Y()}return Y()}}}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),dZ=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,v){function D(I,U){this.v=I,this.k=U}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),Tg=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,v){var D=dZ();function I(U){return new D(U,0)}v.exports=I,v.exports.__esModule=!0,v.exports.default=v.exports}}),Eg=Z4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,v){var D=dZ();function I(X){return function(){return new U(X.apply(this,arguments))}}function U(X){var G,Q;function J(W,Y){try{var L=X[W](Y),V=L.value,B=V instanceof D;Promise.resolve(B?V.v:V).then(function(N){if(B){var A=W==="return"?"return":"next";if(!V.k||N.done)return J(A,N);N=X[A](N).value}z(L.done?"return":"normal",N)},function(N){J("throw",N)})}catch(N){z("throw",N)}}function z(W,Y){switch(W){case"return":G.resolve({value:Y,done:!0});break;case"throw":G.reject(Y);break;default:G.resolve({value:Y,done:!1})}(G=G.next)?J(G.key,G.arg):Q=null}this._invoke=function(W,Y){return new Promise(function(L,V){var B={key:W,arg:Y,resolve:L,reject:V,next:null};Q?Q=Q.next=B:(G=Q=B,J(W,Y))})},typeof X.return!="function"&&(this.return=void 0)}U.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},U.prototype.next=function(X){return this._invoke("next",X)},U.prototype.throw=function(X){return this._invoke("throw",X)},U.prototype.return=function(X){return this._invoke("return",X)},v.exports=I,v.exports.__esModule=!0,v.exports.default=v.exports}}),vt=I$(kg(),1),Ut=I$(Tg(),1),Dt=I$(Eg(),1),It=I$(F$(),1);function tZ($,v){return cZ({links:[OW({url:$,headers:async()=>{let D=await v();return D?{authorization:`Bearer ${D}`}:{}}})]})}var ug=4000;function pZ($){let v=/^(\d+)\.(\d+)\.(\d+)/.exec($.trim());if(!v)return null;return[Number(v[1]),Number(v[2]),Number(v[3])]}function oZ($,v){let D=pZ($),I=pZ(v);if(!D||!I)return 0;for(let U=0;U<3;U++){let X=D[U],G=I[U];if(X!==G)return X<G?-1:1}return 0}function gg($){let{ownVersion:v,minVersion:D,latestVersion:I}=$;if(D&&oZ(v,D)<0)return{blocked:!0,blockedMessage:`This Aether Wealth MCP (v${v}) is below the minimum supported version (v${D}) and can no longer be used. Update it and restart your MCP client:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
`);
|
|
120
|
-
`);return
|
|
121
|
-
`),
|
|
122
|
-
`);let X=
|
|
123
|
-
`),
|
|
124
|
-
`),process.
|
|
121
|
+
${W.text}`}:z);return[{type:"text",text:Q},...J]};$.setRequestHandler(dv,async()=>({tools:Array.from(v.tools.values()).map((J)=>({name:J.name,description:J.description,inputSchema:J.inputSchema}))})),$.setRequestHandler(b6,async(J)=>{if(v.clientGate?.blocked)return{content:[{type:"text",text:v.clientGate.blockedMessage??"Update required."}],isError:!0};let{name:Q,arguments:W}=J.params,z=v.tools.get(Q);if(!z)throw new u(C.MethodNotFound,`tool not found: ${Q}`);let Y=MX(z.inputSchema,W);if(!Y.ok)throw new u(C.InvalidParams,`invalid arguments for ${Q}: ${Y.reason}`);try{let I=await z.handler(Y.args,D),V=vu(I);if(V)return{content:G(V.content),isError:!1};return{content:[{type:"text",text:U(Uu(I))}],isError:!1}}catch(I){return{content:[{type:"text",text:Du(I)}],isError:!0}}}),$.setRequestHandler(hv,async()=>({resources:Array.from(v.resources.values()).map((J)=>({uri:J.uri,name:J.name,description:J.description,mimeType:J.mimeType}))})),$.setRequestHandler(mv,async(J)=>{let{uri:Q}=J.params,W=v.resources.get(Q);if(!W)throw new u(C.MethodNotFound,`resource not found: ${Q}`);let z=await W.handler(D);return{contents:[{uri:Q,mimeType:W.mimeType,text:z.text}]}}),$.setRequestHandler(cv,async()=>({prompts:Array.from(v.prompts.values()).map((J)=>({name:J.name,description:J.description,...J.arguments?{arguments:J.arguments}:{}}))})),$.setRequestHandler(rv,async(J)=>{let{name:Q,arguments:W}=J.params,z=v.prompts.get(Q);if(!z)throw new u(C.MethodNotFound,`prompt not found: ${Q}`);let Y={};for(let[V,B]of Object.entries(W??{}))if(typeof B==="string")Y[V]=B;for(let V of z.arguments??[])if(V.required&&!(V.name in Y))throw new u(C.InvalidParams,`prompts/get: missing required argument: ${V.name}`);let I=z.handler(Y);return{description:z.description,messages:I}})}function vu($){if(typeof $!=="object"||$===null)return null;let v=$.content;if(!Array.isArray(v)||v.length===0)return null;return v.every((X)=>typeof X==="object"&&X!==null&&typeof X.type==="string")?$:null}function Uu($){if(typeof $==="string")return $;return JSON.stringify($,null,2)}function Du($){if(!($ instanceof Error))return String($);let v=$,D=[`${v.name??"Error"}: ${v.message}`];if(typeof v.status==="number")D.push(`status=${v.status}`);if(v.code)D.push(`code=${v.code}`);if(v.method&&v.path)D.push(`request=${v.method} ${v.path}`);return D.join(" | ")}function vH($={}){let v=$.includeAuthTools??!0,D=$.includeLiveChartTools??!0;return[...v?bX:[],...fX,...mX,...PX,...hX,...iX,...yX,...CX,...D?lX:[]]}import DH from"node:process";class z7{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
|
|
122
|
+
`);if($===-1)return null;let v=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),Xu(v)}clear(){this._buffer=void 0}}function Xu($){return xv.parse(JSON.parse($))}function UH($){return JSON.stringify($)+`
|
|
123
|
+
`}class rX{constructor($=DH.stdin,v=DH.stdout){this._stdin=$,this._stdout=v,this._readBuffer=new z7,this._started=!1,this._ondata=(D)=>{this._readBuffer.append(D),this.processReadBuffer()},this._onerror=(D)=>{this.onerror?.(D)}}async start(){if(this._started)throw 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((v)=>{let D=UH($);if(this._stdout.write(D))v();else this._stdout.once("drain",v)})}}async function Gu(){let{config:$,errors:v}=s7(process.env);if(!$){process.stderr.write(`aether-wealth-mcp: missing required environment:
|
|
124
|
+
`);for(let Q of v)process.stderr.write(` - ${Q}
|
|
125
|
+
`);return 2}let D=(process.env.MCP_TRANSPORT??"stdio").toLowerCase(),X=(process.env.MCP_HTTP_AUTH??"").trim().toLowerCase()||"static";if(D==="http"&&X!=="static"&&X!=="oauth")return process.stderr.write(`aether-wealth-mcp: MCP_HTTP_AUTH="${process.env.MCP_HTTP_AUTH}" must be "static" or "oauth"
|
|
126
|
+
`),2;if(D!=="http"&&X==="oauth")return process.stderr.write(`aether-wealth-mcp: MCP_HTTP_AUTH=oauth (hosted mode) requires MCP_TRANSPORT=http
|
|
127
|
+
`),2;if(D==="http"&&X==="oauth")return Wu($);let U=await Ju($),G=await p0({ownVersion:W7,fetchMinVersion:()=>U.trpc.meta.clientRequirements.query().then((Q)=>Q.minMcpVersion),fetchLatestVersion:()=>d0($Y)}),J=new cX({toolContext:U,clientGate:G});if(D==="http")return Qu(J,$);return zu(J,$)}async function Ju($){let v=await S0({keychainService:y1.keychainService,credentialsFilePath:y1.credentialsFilePath,...y1.forceFileEnvVar?{forceFileEnvVar:y1.forceFileEnvVar}:{}}),D=new c1($,v,y1,{log:(U)=>process.stderr.write(U)}),X=p4($.trpcUrl,()=>D.getAccessToken());return{session:D,trpc:X}}function GH(){let $=process.env.MCP_HTTP_PORT,v=$?Number($):9099;if(!Number.isFinite(v)||v<0||v>65535)return process.stderr.write(`aether-wealth-mcp: MCP_HTTP_PORT="${$}" is not a valid port
|
|
128
|
+
`),null;return v}function JH($,v){let D=async(X)=>{process.stderr.write(`aether-wealth-mcp: ${X} received, shutting down
|
|
129
|
+
`),await $.close(),await v.close(),process.exit(0)};process.on("SIGINT",D),process.on("SIGTERM",D)}async function Qu($,v){let D=GH();if(D===null)return 2;let X=await J7($,{port:D,...process.env.MCP_HTTP_HOST?{hostname:process.env.MCP_HTTP_HOST}:{},...process.env.MCP_HTTP_PATH?{path:process.env.MCP_HTTP_PATH}:{},...process.env.MCP_HTTP_BEARER?{bearerToken:process.env.MCP_HTTP_BEARER}:{}});return process.stderr.write(`aether-wealth-mcp: ready (transport=http, port=${X.port}, base=${v.baseUrl})
|
|
130
|
+
`),JH(X,$),0}async function Wu($){if(process.env.MCP_HTTP_BEARER?.trim())return process.stderr.write(`aether-wealth-mcp: MCP_HTTP_BEARER cannot be combined with MCP_HTTP_AUTH=oauth \u2014 unset one
|
|
131
|
+
`),2;let v=(process.env.MCP_PUBLIC_ORIGIN??"").trim().replace(/\/$/,"");if(!v)return process.stderr.write(`aether-wealth-mcp: MCP_PUBLIC_ORIGIN is required when MCP_HTTP_AUTH=oauth
|
|
132
|
+
`),2;let D;try{D=new URL(v)}catch{return process.stderr.write(`aether-wealth-mcp: MCP_PUBLIC_ORIGIN is not a valid URL: "${v}"
|
|
133
|
+
`),2}if(D.protocol!=="https:"&&!u4(D.hostname))return process.stderr.write(`aether-wealth-mcp: MCP_PUBLIC_ORIGIN must use https (loopback exempt): "${v}"
|
|
134
|
+
`),2;let X=GH();if(X===null)return 2;let U=Boolean(process.env.AETHER_APP_PUSH_URL?.trim()),G=new cX({toolContext:UY($.trpcUrl),tools:vH({includeAuthTools:!1,includeLiveChartTools:U}),prompts:sO({hosted:!0})}),J=await J7(G,{port:X,hostname:process.env.MCP_HTTP_HOST??"0.0.0.0",...process.env.MCP_HTTP_PATH?{path:process.env.MCP_HTTP_PATH}:{},oauth:{publicOrigin:v,authorizationServerIssuer:`${$.baseUrl}${r4}`,trpcUrl:$.trpcUrl,tokenVerifier:DY({baseUrl:$.baseUrl}),rateLimiter:vY({...Number.isFinite(Number(process.env.MCP_RATE_LIMIT_MAX))&&Number(process.env.MCP_RATE_LIMIT_MAX)>0?{maxPerWindow:Number(process.env.MCP_RATE_LIMIT_MAX)}:{}})}});return process.stderr.write(`aether-wealth-mcp: ready (transport=http, auth=oauth, port=${J.port}, base=${$.baseUrl}, origin=${v}, liveChart=${U})
|
|
135
|
+
`),JH(J,G),0}async function zu($,v){let D=new rX;return await $.connect(D),process.stderr.write(`aether-wealth-mcp: ready (transport=stdio, base=${v.baseUrl})
|
|
136
|
+
`),process.stdin.on("end",()=>{process.exit(0)}),0}var XH=await Gu();if(XH!==0)process.exit(XH);
|