@aetherwealth/mcp 0.1.35 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  // @bun
3
- import{createRequire as nA}from"node:module";var TA=Object.create;var{getPrototypeOf:EA,defineProperty:aX,getOwnPropertyNames:uA}=Object;var RA=Object.prototype.hasOwnProperty;function gA($){return this[$]}var CA,xA,H5=($,v,D)=>{var X=$!=null&&typeof $==="object";if(X){var U=v?CA??=new WeakMap:xA??=new WeakMap,G=U.get($);if(G)return G}D=$!=null?TA(EA($)):{};let J=v||!$||!$.__esModule?aX(D,"default",{value:$,enumerable:!0}):D;for(let Q of uA($))if(!RA.call(J,Q))aX(J,Q,{get:gA.bind($,Q),enumerable:!0});if(X)U.set($,J);return J};var b=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var iA=($)=>$;function fA($,v){this[$]=iA.bind(null,v)}var R4=($,v)=>{for(var D in v)aX($,D,{get:v[D],enumerable:!0,configurable:!0,set:fA.bind(v,D)})};var _A=nA(import.meta.url);var sv=b((yB)=>{Object.defineProperty(yB,"__esModule",{value:!0});yB.regexpCode=yB.getEsmExportName=yB.getProperty=yB.safeStringify=yB.stringify=yB.strConcat=yB.addCodeArg=yB.str=yB._=yB.nil=yB._Code=yB.Name=yB.IDENTIFIER=yB._CodeOrName=void 0;class lD{}yB._CodeOrName=lD;yB.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class w1 extends lD{constructor($){super();if(!yB.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}}}yB.Name=w1;class Y4 extends lD{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 w1)v[D.str]=(v[D.str]||0)+1;return v},{})}}yB._Code=Y4;yB.nil=new Y4("");function nB($,...v){let D=[$[0]],X=0;while(X<v.length)EW(D,v[X]),D.push($[++X]);return new Y4(D)}yB._=nB;var TW=new Y4("+");function _B($,...v){let D=[ev($[0])],X=0;while(X<v.length)D.push(TW),EW(D,v[X]),D.push(TW,ev($[++X]));return FM(D),new Y4(D)}yB.str=_B;function EW($,v){if(v instanceof Y4)$.push(...v._items);else if(v instanceof w1)$.push(v);else $.push(MM(v))}yB.addCodeArg=EW;function FM($){let v=1;while(v<$.length-1){if($[v]===TW){let D=jM($[v-1],$[v+1]);if(D!==void 0){$.splice(v-1,3,D);continue}$[v++]="+"}v++}}function jM($,v){if(v==='""')return $;if($==='""')return v;if(typeof $=="string"){if(v instanceof w1||$[$.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 w1))return`"${$}${v.slice(1)}`;return}function wM($,v){return v.emptyStr()?$:$.emptyStr()?v:_B`${$}${v}`}yB.strConcat=wM;function MM($){return typeof $=="number"||typeof $=="boolean"||$===null?$:ev(Array.isArray($)?$.join(","):$)}function PM($){return new Y4(ev($))}yB.stringify=PM;function ev($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}yB.safeStringify=ev;function bM($){return typeof $=="string"&&yB.IDENTIFIER.test($)?new Y4(`.${$}`):nB`[${$}]`}yB.getProperty=bM;function qM($){if(typeof $=="string"&&yB.IDENTIFIER.test($))return new Y4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}yB.getEsmExportName=qM;function SM($){return new Y4($.toString())}yB.regexpCode=SM});var CW=b((rB)=>{Object.defineProperty(rB,"__esModule",{value:!0});rB.ValueScope=rB.ValueScopeName=rB.Scope=rB.varKinds=rB.UsedValueState=void 0;var m$=sv();class hB extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var mD;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(mD||(rB.UsedValueState=mD={}));rB.varKinds={const:new m$.Name("const"),let:new m$.Name("let"),var:new m$.Name("var")};class RW{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}}}rB.Scope=RW;class gW extends m$.Name{constructor($,v){super(v);this.prefix=$}setValue($,{property:v,itemIndex:D}){this.value=$,this.scopePath=m$._`.${new m$.Name(v)}[${D}]`}}rB.ValueScopeName=gW;var yM=m$._`\n`;class mB extends RW{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?yM:m$.nil}}get(){return this._scope}name($){return new gW($,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 W=J.get(G);if(W)return W}else J=this._values[U]=new Map;J.set(G,X);let Q=this._scope[U]||(this._scope[U]=[]),I=Q.length;return Q[I]=v.ref,X.setValue(v,{property:U,itemIndex:I}),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((I)=>{if(Q.has(I))return;Q.set(I,mD.Started);let W=v(I);if(W){let z=this.opts.es5?rB.varKinds.var:rB.varKinds.const;U=m$._`${U}${z} ${I} = ${W};${this.opts._n}`}else if(W=X===null||X===void 0?void 0:X(I))U=m$._`${U}${W}${this.opts._n}`;else throw new hB(I);Q.set(I,mD.Completed)})}return U}}rB.ValueScope=mB});var l=b((r$)=>{Object.defineProperty(r$,"__esModule",{value:!0});r$.or=r$.and=r$.not=r$.CodeGen=r$.operators=r$.varKinds=r$.ValueScopeName=r$.ValueScope=r$.Scope=r$.Name=r$.regexpCode=r$.stringify=r$.getProperty=r$.nil=r$.strConcat=r$.str=r$._=void 0;var c=sv(),B4=CW(),W6=sv();Object.defineProperty(r$,"_",{enumerable:!0,get:function(){return W6._}});Object.defineProperty(r$,"str",{enumerable:!0,get:function(){return W6.str}});Object.defineProperty(r$,"strConcat",{enumerable:!0,get:function(){return W6.strConcat}});Object.defineProperty(r$,"nil",{enumerable:!0,get:function(){return W6.nil}});Object.defineProperty(r$,"getProperty",{enumerable:!0,get:function(){return W6.getProperty}});Object.defineProperty(r$,"stringify",{enumerable:!0,get:function(){return W6.stringify}});Object.defineProperty(r$,"regexpCode",{enumerable:!0,get:function(){return W6.regexpCode}});Object.defineProperty(r$,"Name",{enumerable:!0,get:function(){return W6.Name}});var oD=CW();Object.defineProperty(r$,"Scope",{enumerable:!0,get:function(){return oD.Scope}});Object.defineProperty(r$,"ValueScope",{enumerable:!0,get:function(){return oD.ValueScope}});Object.defineProperty(r$,"ValueScopeName",{enumerable:!0,get:function(){return oD.ValueScopeName}});Object.defineProperty(r$,"varKinds",{enumerable:!0,get:function(){return oD.varKinds}});r$.operators={GT:new c._Code(">"),GTE:new c._Code(">="),LT:new c._Code("<"),LTE:new c._Code("<="),EQ:new c._Code("==="),NEQ:new c._Code("!=="),NOT:new c._Code("!"),OR:new c._Code("||"),AND:new c._Code("&&"),ADD:new c._Code("+")};class z6{optimizeNodes(){return this}optimizeNames($,v){return this}}class dB extends z6{constructor($,v,D){super();this.varKind=$,this.name=v,this.rhs=D}render({es5:$,_n:v}){let D=$?B4.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=P1(this.rhs,$,v);return this}get names(){return this.rhs instanceof c._CodeOrName?this.rhs.names:{}}}class fW extends z6{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 c.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=P1(this.rhs,$,v),this}get names(){let $=this.lhs instanceof c.Name?{}:{...this.lhs.names};return tD($,this.rhs)}}class pB extends fW{constructor($,v,D,X){super($,D,X);this.op=v}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class tB extends z6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class oB extends z6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class aB extends z6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class eB extends z6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,v){return this.code=P1(this.code,$,v),this}get names(){return this.code instanceof c._CodeOrName?this.code.names:{}}}class aD extends z6{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;rM($,U.names),D.splice(X,1)}return D.length>0?this:void 0}get names(){return this.nodes.reduce(($,v)=>q6($,v.names),{})}}class Y6 extends aD{render($){return"{"+$._n+super.render($)+"}"+$._n}}class sB extends aD{}class $0 extends Y6{}$0.kind="else";class l4 extends Y6{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 $0(D):D}if(v){if($===!1)return v instanceof l4?v:v.nodes;if(this.nodes.length)return this;return new l4(XV($),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=P1(this.condition,$,v),this}get names(){let $=super.names;if(tD($,this.condition),this.else)q6($,this.else.names);return $}}l4.kind="if";class M1 extends Y6{}M1.kind="for";class $V extends M1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,v){if(!super.optimizeNames($,v))return;return this.iteration=P1(this.iteration,$,v),this}get names(){return q6(super.names,this.iteration.names)}}class vV extends M1{constructor($,v,D,X){super();this.varKind=$,this.name=v,this.from=D,this.to=X}render($){let v=$.es5?B4.varKinds.var:this.varKind,{name:D,from:X,to:U}=this;return`for(${v} ${D}=${X}; ${D}<${U}; ${D}++)`+super.render($)}get names(){let $=tD(super.names,this.from);return tD($,this.to)}}class xW extends M1{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=P1(this.iterable,$,v),this}get names(){return q6(super.names,this.iterable.names)}}class rD extends Y6{constructor($,v,D){super();this.name=$,this.args=v,this.async=D}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}rD.kind="func";class cD extends aD{render($){return"return "+super.render($)}}cD.kind="return";class UV extends Y6{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 dD extends Y6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}dD.kind="catch";class pD extends Y6{render($){return"finally"+super.render($)}}pD.kind="finally";class DV{constructor($,v={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...v,_n:v.lines?`
4
- `:""},this._extScope=$,this._scope=new B4.Scope({parent:$}),this._nodes=[new sB]}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 dB($,U,D)),U}const($,v,D){return this._def(B4.varKinds.const,$,v,D)}let($,v,D){return this._def(B4.varKinds.let,$,v,D)}var($,v,D){return this._def(B4.varKinds.var,$,v,D)}assign($,v,D){return this._leafNode(new fW($,v,D))}add($,v){return this._leafNode(new pB($,r$.operators.ADD,v))}code($){if(typeof $=="function")$();else if($!==c.nil)this._leafNode(new eB($));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,c.addCodeArg)(v,X)}return v.push("}"),new c._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 $0)}endIf(){return this._endBlockNode(l4,$0)}_for($,v){if(this._blockNode($),v)this.code(v).endFor();return this}for($,v){return this._for(new $V($),v)}forRange($,v,D,X,U=this.opts.es5?B4.varKinds.var:B4.varKinds.let){let G=this._scope.toName($);return this._for(new vV(U,G,v,D),()=>X(G))}forOf($,v,D,X=B4.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let G=v instanceof c.Name?v:this.var("_arr",v);return this.forRange("_i",0,c._`${G}.length`,(J)=>{this.var(U,c._`${G}[${J}]`),D(U)})}return this._for(new xW("of",X,U,v),()=>D(U))}forIn($,v,D,X=this.opts.es5?B4.varKinds.var:B4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,c._`Object.keys(${v})`,D);let U=this._scope.toName($);return this._for(new xW("in",X,U,v),()=>D(U))}endFor(){return this._endBlockNode(M1)}label($){return this._leafNode(new tB($))}break($){return this._leafNode(new oB($))}return($){let v=new cD;if(this._blockNode(v),this.code($),v.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(cD)}try($,v,D){if(!v&&!D)throw Error('CodeGen: "try" without "catch" and "finally"');let X=new UV;if(this._blockNode(X),this.code($),v){let U=this.name("e");this._currNode=X.catch=new dD(U),v(U)}if(D)this._currNode=X.finally=new pD,this.code(D);return this._endBlockNode(dD,pD)}throw($){return this._leafNode(new aB($))}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=c.nil,D,X){if(this._blockNode(new rD($,v,D)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(rD)}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]=$}}r$.CodeGen=DV;function q6($,v){for(let D in v)$[D]=($[D]||0)+(v[D]||0);return $}function tD($,v){return v instanceof c._CodeOrName?q6($,v.names):$}function P1($,v,D){if($ instanceof c.Name)return X($);if(!U($))return $;return new c._Code($._items.reduce((G,J)=>{if(J instanceof c.Name)J=X(J);if(J instanceof c._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 c._Code&&G._items.some((J)=>J instanceof c.Name&&v[J.str]===1&&D[J.str]!==void 0)}}function rM($,v){for(let D in v)$[D]=($[D]||0)-(v[D]||0)}function XV($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:c._`!${iW($)}`}r$.not=XV;var cM=GV(r$.operators.AND);function dM(...$){return $.reduce(cM)}r$.and=dM;var pM=GV(r$.operators.OR);function tM(...$){return $.reduce(pM)}r$.or=tM;function GV($){return(v,D)=>v===c.nil?D:D===c.nil?v:c._`${iW(v)} ${$} ${iW(D)}`}function iW($){return $ instanceof c.Name?$:c._`(${$})`}});var d=b((LV)=>{Object.defineProperty(LV,"__esModule",{value:!0});LV.checkStrictMode=LV.getErrorPath=LV.Type=LV.useFunc=LV.setEvaluated=LV.evaluatedPropsToName=LV.mergeEvaluated=LV.eachItem=LV.unescapeJsonPointer=LV.escapeJsonPointer=LV.escapeFragment=LV.unescapeFragment=LV.schemaRefOrVal=LV.schemaHasRulesButRef=LV.schemaHasRules=LV.checkUnknownRules=LV.alwaysValidSchema=LV.toHash=void 0;var Q$=l(),sM=sv();function $P($){let v={};for(let D of $)v[D]=!0;return v}LV.toHash=$P;function vP($,v){if(typeof v=="boolean")return v;if(Object.keys(v).length===0)return!0;return WV($,v),!zV(v,$.self.RULES.all)}LV.alwaysValidSchema=vP;function WV($,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])VV($,`unknown keyword: "${G}"`)}LV.checkUnknownRules=WV;function zV($,v){if(typeof $=="boolean")return!$;for(let D in $)if(v[D])return!0;return!1}LV.schemaHasRules=zV;function UP($,v){if(typeof $=="boolean")return!$;for(let D in $)if(D!=="$ref"&&v.all[D])return!0;return!1}LV.schemaHasRulesButRef=UP;function DP({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)}`}LV.schemaRefOrVal=DP;function XP($){return YV(decodeURIComponent($))}LV.unescapeFragment=XP;function GP($){return encodeURIComponent(_W($))}LV.escapeFragment=GP;function _W($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}LV.escapeJsonPointer=_W;function YV($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}LV.unescapeJsonPointer=YV;function JP($,v){if(Array.isArray($))for(let D of $)v(D);else v($)}LV.eachItem=JP;function QV({mergeNames:$,mergeToName:v,mergeValues:D,resultToName:X}){return(U,G,J,Q)=>{let I=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&&!(I instanceof Q$.Name)?X(U,I):I}}LV.mergeEvaluated={props:QV({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} || {}`),yW($,D,v)}),mergeValues:($,v)=>$===!0?!0:{...$,...v},resultToName:BV}),items:QV({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 BV($,v){if(v===!0)return $.var("props",!0);let D=$.var("props",Q$._`{}`);if(v!==void 0)yW($,D,v);return D}LV.evaluatedPropsToName=BV;function yW($,v,D){Object.keys(D).forEach((X)=>$.assign(Q$._`${v}${(0,Q$.getProperty)(X)}`,!0))}LV.setEvaluated=yW;var IV={};function QP($,v){return $.scopeValue("func",{ref:v,code:IV[v.code]||(IV[v.code]=new sM._Code(v.code))})}LV.useFunc=QP;var nW;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(nW||(LV.Type=nW={}));function IP($,v,D){if($ instanceof Q$.Name){let X=v===nW.Num;return D?X?Q$._`"[" + ${$} + "]"`:Q$._`"['" + ${$} + "']"`:X?Q$._`"/" + ${$}`:Q$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return D?(0,Q$.getProperty)($).toString():"/"+_W($)}LV.getErrorPath=IP;function VV($,v,D=$.opts.strictSchema){if(!D)return;if(v=`strict mode: ${v}`,D===!0)throw Error(v);$.self.logger.warn(v)}LV.checkStrictMode=VV});var h4=b((NV)=>{Object.defineProperty(NV,"__esModule",{value:!0});var E$=l(),bP={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")};NV.default=bP});var v0=b((HV)=>{Object.defineProperty(HV,"__esModule",{value:!0});HV.extendErrors=HV.resetErrorsCount=HV.reportExtraError=HV.reportError=HV.keyword$DataError=HV.keywordError=void 0;var p=l(),sD=d(),f$=h4();HV.keywordError={message:({keyword:$})=>p.str`must pass "${$}" keyword validation`};HV.keyword$DataError={message:({keyword:$,schemaType:v})=>v?p.str`"${$}" keyword must be ${v} ($data)`:p.str`"${$}" keyword is invalid ($data)`};function SP($,v=HV.keywordError,D,X){let{it:U}=$,{gen:G,compositeRule:J,allErrors:Q}=U,I=AV($,v,D);if(X!==null&&X!==void 0?X:J||Q)ZV(G,I);else OV(U,p._`[${I}]`)}HV.reportError=SP;function kP($,v=HV.keywordError,D){let{it:X}=$,{gen:U,compositeRule:G,allErrors:J}=X,Q=AV($,v,D);if(ZV(U,Q),!(G||J))OV(X,f$.default.vErrors)}HV.reportExtraError=kP;function TP($,v){$.assign(f$.default.errors,v),$.if(p._`${f$.default.vErrors} !== null`,()=>$.if(v,()=>$.assign(p._`${f$.default.vErrors}.length`,v),()=>$.assign(f$.default.vErrors,null)))}HV.resetErrorsCount=TP;function EP({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,f$.default.errors,(Q)=>{if($.const(J,p._`${f$.default.vErrors}[${Q}]`),$.if(p._`${J}.instancePath === undefined`,()=>$.assign(p._`${J}.instancePath`,(0,p.strConcat)(f$.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)})}HV.extendErrors=EP;function ZV($,v){let D=$.const("err",v);$.if(p._`${f$.default.vErrors} === null`,()=>$.assign(f$.default.vErrors,p._`[${D}]`),p._`${f$.default.vErrors}.push(${D})`),$.code(p._`${f$.default.errors}++`)}function OV($,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 AV($,v,D){let{createErrors:X}=$.it;if(X===!1)return p._`{}`;return uP($,v,D)}function uP($,v,D={}){let{gen:X,it:U}=$,G=[RP(U,D),gP($,D)];return CP($,v,G),X.object(...G)}function RP({errorPath:$},{instancePath:v}){let D=v?p.str`${$}${(0,sD.getErrorPath)(v,sD.Type.Str)}`:$;return[f$.default.instancePath,(0,p.strConcat)(f$.default.instancePath,D)]}function gP({keyword:$,it:{errSchemaPath:v}},{schemaPath:D,parentSchema:X}){let U=X?v:p.str`${v}/${$}`;if(D)U=p.str`${U}${(0,sD.getErrorPath)(D,sD.Type.Str)}`;return[S6.schemaPath,U]}function CP($,{params:v,message:D},X){let{keyword:U,data:G,schemaValue:J,it:Q}=$,{opts:I,propertyName:W,topSchemaRef:z,schemaPath:Y}=Q;if(X.push([S6.keyword,U],[S6.params,typeof v=="function"?v($):v||p._`{}`]),I.messages)X.push([S6.message,typeof D=="function"?D($):D]);if(I.verbose)X.push([S6.schema,J],[S6.parentSchema,p._`${z}${Y}`],[f$.default.data,G]);if(W)X.push([S6.propertyName,W])}});var PV=b((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});wV.boolOrEmptySchema=wV.topBoolOrEmptySchema=void 0;var _P=v0(),yP=l(),lP=h4(),hP={message:"boolean schema is false"};function mP($){let{gen:v,schema:D,validateName:X}=$;if(D===!1)jV($,!1);else if(typeof D=="object"&&D.$async===!0)v.return(lP.default.data);else v.assign(yP._`${X}.errors`,null),v.return(!0)}wV.topBoolOrEmptySchema=mP;function rP($,v){let{gen:D,schema:X}=$;if(X===!1)D.var(v,!1),jV($);else D.var(v,!0)}wV.boolOrEmptySchema=rP;function jV($,v){let{gen:D,data:X}=$,U={gen:D,keyword:"false schema",data:X,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,_P.reportError)(U,hP,void 0,v)}});var hW=b((bV)=>{Object.defineProperty(bV,"__esModule",{value:!0});bV.getRules=bV.isJSONType=void 0;var dP=["string","number","integer","boolean","null","object","array"],pP=new Set(dP);function tP($){return typeof $=="string"&&pP.has($)}bV.isJSONType=tP;function oP(){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:{}}}bV.getRules=oP});var mW=b((TV)=>{Object.defineProperty(TV,"__esModule",{value:!0});TV.shouldUseRule=TV.shouldUseGroup=TV.schemaHasRulesForType=void 0;function eP({schema:$,self:v},D){let X=v.RULES.types[D];return X&&X!==!0&&SV($,X)}TV.schemaHasRulesForType=eP;function SV($,v){return v.rules.some((D)=>kV($,D))}TV.shouldUseGroup=SV;function kV($,v){var D;return $[v.keyword]!==void 0||((D=v.definition.implements)===null||D===void 0?void 0:D.some((X)=>$[X]!==void 0))}TV.shouldUseRule=kV});var U0=b((CV)=>{Object.defineProperty(CV,"__esModule",{value:!0});CV.reportTypeError=CV.checkDataTypes=CV.checkDataType=CV.coerceAndCheckDataType=CV.getJSONTypes=CV.getSchemaTypes=CV.DataType=void 0;var vb=hW(),Ub=mW(),Db=v0(),y=l(),uV=d(),b1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(b1||(CV.DataType=b1={}));function Xb($){let v=RV($.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}CV.getSchemaTypes=Xb;function RV($){let v=Array.isArray($)?$:$?[$]:[];if(v.every(vb.isJSONType))return v;throw Error("type must be JSONType or JSONType[]: "+v.join(","))}CV.getJSONTypes=RV;function Gb($,v){let{gen:D,data:X,opts:U}=$,G=Jb(v,U.coerceTypes),J=v.length>0&&!(G.length===0&&v.length===1&&(0,Ub.schemaHasRulesForType)($,v[0]));if(J){let Q=cW(v,X,U.strictNumbers,b1.Wrong);D.if(Q,()=>{if(G.length)Qb($,v,G);else dW($)})}return J}CV.coerceAndCheckDataType=Gb;var gV=new Set(["string","number","integer","boolean","null"]);function Jb($,v){return v?$.filter((D)=>gV.has(D)||v==="array"&&D==="array"):[]}function Qb($,v,D){let{gen:X,data:U,opts:G}=$,J=X.let("dataType",y._`typeof ${U}`),Q=X.let("coerced",y._`undefined`);if(G.coerceTypes==="array")X.if(y._`${J} == 'object' && Array.isArray(${U}) && ${U}.length == 1`,()=>X.assign(U,y._`${U}[0]`).assign(J,y._`typeof ${U}`).if(cW(v,U,G.strictNumbers),()=>X.assign(Q,U)));X.if(y._`${Q} !== undefined`);for(let W of D)if(gV.has(W)||W==="array"&&G.coerceTypes==="array")I(W);X.else(),dW($),X.endIf(),X.if(y._`${Q} !== undefined`,()=>{X.assign(U,Q),Ib($,Q)});function I(W){switch(W){case"string":X.elseIf(y._`${J} == "number" || ${J} == "boolean"`).assign(Q,y._`"" + ${U}`).elseIf(y._`${U} === null`).assign(Q,y._`""`);return;case"number":X.elseIf(y._`${J} == "boolean" || ${U} === null
5
- || (${J} == "string" && ${U} && ${U} == +${U})`).assign(Q,y._`+${U}`);return;case"integer":X.elseIf(y._`${J} === "boolean" || ${U} === null
6
- || (${J} === "string" && ${U} && ${U} == +${U} && !(${U} % 1))`).assign(Q,y._`+${U}`);return;case"boolean":X.elseIf(y._`${U} === "false" || ${U} === 0 || ${U} === null`).assign(Q,!1).elseIf(y._`${U} === "true" || ${U} === 1`).assign(Q,!0);return;case"null":X.elseIf(y._`${U} === "" || ${U} === 0 || ${U} === false`),X.assign(Q,null);return;case"array":X.elseIf(y._`${J} === "string" || ${J} === "number"
7
- || ${J} === "boolean" || ${U} === null`).assign(Q,y._`[${U}]`)}}}function Ib({gen:$,parentData:v,parentDataProperty:D},X){$.if(y._`${v} !== undefined`,()=>$.assign(y._`${v}[${D}]`,X))}function rW($,v,D,X=b1.Correct){let U=X===b1.Correct?y.operators.EQ:y.operators.NEQ,G;switch($){case"null":return y._`${v} ${U} null`;case"array":G=y._`Array.isArray(${v})`;break;case"object":G=y._`${v} && typeof ${v} == "object" && !Array.isArray(${v})`;break;case"integer":G=J(y._`!(${v} % 1) && !isNaN(${v})`);break;case"number":G=J();break;default:return y._`typeof ${v} ${U} ${$}`}return X===b1.Correct?G:(0,y.not)(G);function J(Q=y.nil){return(0,y.and)(y._`typeof ${v} == "number"`,Q,D?y._`isFinite(${v})`:y.nil)}}CV.checkDataType=rW;function cW($,v,D,X){if($.length===1)return rW($[0],v,D,X);let U,G=(0,uV.toHash)($);if(G.array&&G.object){let J=y._`typeof ${v} != "object"`;U=G.null?J:y._`!${v} || ${J}`,delete G.null,delete G.array,delete G.object}else U=y.nil;if(G.number)delete G.integer;for(let J in G)U=(0,y.and)(U,rW(J,v,D,X));return U}CV.checkDataTypes=cW;var Wb={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:v})=>typeof $=="string"?y._`{type: ${$}}`:y._`{type: ${v}}`};function dW($){let v=zb($);(0,Db.reportError)(v,Wb)}CV.reportTypeError=dW;function zb($){let{gen:v,data:D,schema:X}=$,U=(0,uV.schemaRefOrVal)($,X,"type");return{gen:v,keyword:"type",data:D,schema:X.type,schemaCode:U,schemaValue:U,parentSchema:X,params:{},it:$}}});var _V=b((fV)=>{Object.defineProperty(fV,"__esModule",{value:!0});fV.assignDefaults=void 0;var q1=l(),Zb=d();function Ob($,v){let{properties:D,items:X}=$.schema;if(v==="object"&&D)for(let U in D)iV($,U,D[U].default);else if(v==="array"&&Array.isArray(X))X.forEach((U,G)=>iV($,G,U.default))}fV.assignDefaults=Ob;function iV($,v,D){let{gen:X,compositeRule:U,data:G,opts:J}=$;if(D===void 0)return;let Q=q1._`${G}${(0,q1.getProperty)(v)}`;if(U){(0,Zb.checkStrictMode)($,`default is ignored for: ${Q}`);return}let I=q1._`${Q} === undefined`;if(J.useDefaults==="empty")I=q1._`${I} || ${Q} === null || ${Q} === ""`;X.if(I,q1._`${Q} = ${(0,q1.stringify)(D)}`)}});var X4=b((hV)=>{Object.defineProperty(hV,"__esModule",{value:!0});hV.validateUnion=hV.validateArray=hV.usePattern=hV.callValidateCode=hV.schemaProperties=hV.allSchemaProperties=hV.noPropertyInData=hV.propertyInData=hV.isOwnProperty=hV.hasPropFunc=hV.reportMissingProp=hV.checkMissingProp=hV.checkReportMissingProp=void 0;var I$=l(),pW=d(),B6=h4(),Ab=d();function Hb($,v){let{gen:D,data:X,it:U}=$;D.if(oW(D,X,v,U.opts.ownProperties),()=>{$.setParams({missingProperty:I$._`${v}`},!0),$.error()})}hV.checkReportMissingProp=Hb;function Fb({gen:$,data:v,it:{opts:D}},X,U){return(0,I$.or)(...X.map((G)=>(0,I$.and)(oW($,v,G,D.ownProperties),I$._`${U} = ${G}`)))}hV.checkMissingProp=Fb;function jb($,v){$.setParams({missingProperty:v},!0),$.error()}hV.reportMissingProp=jb;function yV($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:I$._`Object.prototype.hasOwnProperty`})}hV.hasPropFunc=yV;function tW($,v,D){return I$._`${yV($)}.call(${v}, ${D})`}hV.isOwnProperty=tW;function wb($,v,D,X){let U=I$._`${v}${(0,I$.getProperty)(D)} !== undefined`;return X?I$._`${U} && ${tW($,v,D)}`:U}hV.propertyInData=wb;function oW($,v,D,X){let U=I$._`${v}${(0,I$.getProperty)(D)} === undefined`;return X?(0,I$.or)(U,(0,I$.not)(tW($,v,D))):U}hV.noPropertyInData=oW;function lV($){return $?Object.keys($).filter((v)=>v!=="__proto__"):[]}hV.allSchemaProperties=lV;function Mb($,v){return lV(v).filter((D)=>!(0,pW.alwaysValidSchema)($,v[D]))}hV.schemaProperties=Mb;function Pb({schemaCode:$,data:v,it:{gen:D,topSchemaRef:X,schemaPath:U,errorPath:G},it:J},Q,I,W){let z=W?I$._`${$}, ${v}, ${X}${U}`:v,Y=[[B6.default.instancePath,(0,I$.strConcat)(B6.default.instancePath,G)],[B6.default.parentData,J.parentData],[B6.default.parentDataProperty,J.parentDataProperty],[B6.default.rootData,B6.default.rootData]];if(J.opts.dynamicRef)Y.push([B6.default.dynamicAnchors,B6.default.dynamicAnchors]);let B=I$._`${z}, ${D.object(...Y)}`;return I!==I$.nil?I$._`${Q}.call(${I}, ${B})`:I$._`${Q}(${B})`}hV.callValidateCode=Pb;var bb=I$._`new RegExp`;function qb({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:I$._`${U.code==="new RegExp"?bb:(0,Ab.useFunc)($,U)}(${D}, ${X})`})}hV.usePattern=qb;function Sb($){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 I=v.const("len",I$._`${D}.length`);v.forRange("i",0,I,(W)=>{$.subschema({keyword:X,dataProp:W,dataPropType:pW.Type.Num},G),v.if((0,I$.not)(G),Q)})}}hV.validateArray=Sb;function kb($){let{gen:v,schema:D,keyword:X,it:U}=$;if(!Array.isArray(D))throw Error("ajv implementation error");if(D.some((I)=>(0,pW.alwaysValidSchema)(U,I))&&!U.opts.unevaluated)return;let J=v.let("valid",!1),Q=v.name("_valid");v.block(()=>D.forEach((I,W)=>{let z=$.subschema({keyword:X,schemaProp:W,compositeRule:!0},Q);if(v.assign(J,I$._`${J} || ${Q}`),!$.mergeValidEvaluated(z,Q))v.if((0,I$.not)(J))})),$.result(J,()=>$.reset(),()=>$.error(!0))}hV.validateUnion=kb});var tV=b((dV)=>{Object.defineProperty(dV,"__esModule",{value:!0});dV.validateKeywordUsage=dV.validSchemaType=dV.funcKeywordCode=dV.macroKeywordCode=void 0;var n$=l(),k6=h4(),lb=X4(),hb=v0();function mb($,v){let{gen:D,keyword:X,schema:U,parentSchema:G,it:J}=$,Q=v.macro.call(J.self,U,G,J),I=cV(D,X,Q);if(J.opts.validateSchema!==!1)J.self.validateSchema(Q,!0);let W=D.name("valid");$.subschema({schema:Q,schemaPath:n$.nil,errSchemaPath:`${J.errSchemaPath}/${X}`,topSchemaRef:I,compositeRule:!0},W),$.pass(W,()=>$.error(!0))}dV.macroKeywordCode=mb;function rb($,v){var D;let{gen:X,keyword:U,schema:G,parentSchema:J,$data:Q,it:I}=$;db(I,v);let W=!Q&&v.compile?v.compile.call(I.self,G,J,I):v.validate,z=cV(X,U,W),Y=X.let("valid");$.block$data(Y,B),$.ok((D=v.valid)!==null&&D!==void 0?D:Y);function B(){if(v.errors===!1){if(N(),v.modifying)rV($);Z(()=>$.error())}else{let H=v.async?V():L();if(v.modifying)rV($);Z(()=>cb($,H))}}function V(){let H=X.let("ruleErrs",null);return X.try(()=>N(n$._`await `),(S)=>X.assign(Y,!1).if(n$._`${S} instanceof ${I.ValidationError}`,()=>X.assign(H,n$._`${S}.errors`),()=>X.throw(S))),H}function L(){let H=n$._`${z}.errors`;return X.assign(H,null),N(n$.nil),H}function N(H=v.async?n$._`await `:n$.nil){let S=I.opts.passContext?k6.default.this:k6.default.self,R=!(("compile"in v)&&!Q||v.schema===!1);X.assign(Y,n$._`${H}${(0,lb.callValidateCode)($,z,S,R)}`,v.modifying)}function Z(H){var S;X.if((0,n$.not)((S=v.valid)!==null&&S!==void 0?S:Y),H)}}dV.funcKeywordCode=rb;function rV($){let{gen:v,data:D,it:X}=$;v.if(X.parentData,()=>v.assign(D,n$._`${X.parentData}[${X.parentDataProperty}]`))}function cb($,v){let{gen:D}=$;D.if(n$._`Array.isArray(${v})`,()=>{D.assign(k6.default.vErrors,n$._`${k6.default.vErrors} === null ? ${v} : ${k6.default.vErrors}.concat(${v})`).assign(k6.default.errors,n$._`${k6.default.vErrors}.length`),(0,hb.extendErrors)($)},()=>$.error())}function db({schemaEnv:$},v){if(v.async&&!$.$async)throw Error("async keyword in sync schema")}function cV($,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,n$.stringify)(D)})}function pb($,v,D=!1){return!v.length||v.some((X)=>X==="array"?Array.isArray($):X==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==X||D&&typeof $>"u")}dV.validSchemaType=pb;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 I=`keyword "${G}" value is invalid at path "${X}": `+D.errorsText(U.validateSchema.errors);if(v.validateSchema==="log")D.logger.error(I);else throw Error(I)}}}dV.validateKeywordUsage=tb});var sV=b((aV)=>{Object.defineProperty(aV,"__esModule",{value:!0});aV.extendSubschemaMode=aV.extendSubschemaData=aV.getSubschema=void 0;var S4=l(),oV=d();function sb($,{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:S4._`${$.schemaPath}${(0,S4.getProperty)(v)}`,errSchemaPath:`${$.errSchemaPath}/${v}`}:{schema:Q[D],schemaPath:S4._`${$.schemaPath}${(0,S4.getProperty)(v)}${(0,S4.getProperty)(D)}`,errSchemaPath:`${$.errSchemaPath}/${v}/${(0,oV.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')}aV.getSubschema=sb;function $q($,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:W,dataPathArr:z,opts:Y}=v,B=Q.let("data",S4._`${v.data}${(0,S4.getProperty)(D)}`,!0);I(B),$.errorPath=S4.str`${W}${(0,oV.getErrorPath)(D,X,Y.jsPropertySyntax)}`,$.parentDataProperty=S4._`${D}`,$.dataPathArr=[...z,$.parentDataProperty]}if(U!==void 0){let W=U instanceof S4.Name?U:Q.let("data",U,!0);if(I(W),J!==void 0)$.propertyName=J}if(G)$.dataTypes=G;function I(W){$.data=W,$.dataLevel=v.dataLevel+1,$.dataTypes=[],v.definedProperties=new Set,$.parentData=v.data,$.dataNames=[...v.dataNames,W]}}aV.extendSubschemaData=$q;function vq($,{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}aV.extendSubschemaMode=vq});var aW=b((Vc,$L)=>{$L.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 UL=b((Lc,vL)=>{var V6=vL.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(){};$X(v,X,U,$,"",$)};V6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};V6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};V6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};V6.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 $X($,v,D,X,U,G,J,Q,I,W){if(X&&typeof X=="object"&&!Array.isArray(X)){v(X,U,G,J,Q,I,W);for(var z in X){var Y=X[z];if(Array.isArray(Y)){if(z in V6.arrayKeywords)for(var B=0;B<Y.length;B++)$X($,v,D,Y[B],U+"/"+z+"/"+B,G,U,z,X,B)}else if(z in V6.propsKeywords){if(Y&&typeof Y=="object")for(var V in Y)$X($,v,D,Y[V],U+"/"+z+"/"+Xq(V),G,U,z,X,V)}else if(z in V6.keywords||$.allKeys&&!(z in V6.skipKeywords))$X($,v,D,Y,U+"/"+z,G,U,z,X)}D(X,U,G,J,Q,I,W)}}function Xq($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var D0=b((JL)=>{Object.defineProperty(JL,"__esModule",{value:!0});JL.getSchemaRefs=JL.resolveUrl=JL.normalizeId=JL._getFullPath=JL.getFullPath=JL.inlineRef=void 0;var Gq=d(),Jq=aW(),Qq=UL(),Iq=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Wq($,v=!0){if(typeof $=="boolean")return!0;if(v===!0)return!eW($);if(!v)return!1;return DL($)<=v}JL.inlineRef=Wq;var zq=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function eW($){for(let v in $){if(zq.has(v))return!0;let D=$[v];if(Array.isArray(D)&&D.some(eW))return!0;if(typeof D=="object"&&eW(D))return!0}return!1}function DL($){let v=0;for(let D in $){if(D==="$ref")return 1/0;if(v++,Iq.has(D))continue;if(typeof $[D]=="object")(0,Gq.eachItem)($[D],(X)=>v+=DL(X));if(v===1/0)return 1/0}return v}function XL($,v="",D){if(D!==!1)v=S1(v);let X=$.parse(v);return GL($,X)}JL.getFullPath=XL;function GL($,v){return $.serialize(v).split("#")[0]+"#"}JL._getFullPath=GL;var Yq=/#\/?$/;function S1($){return $?$.replace(Yq,""):""}JL.normalizeId=S1;function Bq($,v,D){return D=S1(D),$.resolve(v,D)}JL.resolveUrl=Bq;var Vq=/^[a-z_][-a-z0-9._]*$/i;function Lq($,v){if(typeof $=="boolean")return{};let{schemaId:D,uriResolver:X}=this.opts,U=S1($[D]||v),G={"":U},J=XL(X,U,!1),Q={},I=new Set;return Qq($,{allKeys:!0},(Y,B,V,L)=>{if(L===void 0)return;let N=J+B,Z=G[L];if(typeof Y[D]=="string")Z=H.call(this,Y[D]);S.call(this,Y.$anchor),S.call(this,Y.$dynamicAnchor),G[B]=Z;function H(R){let C=this.opts.uriResolver.resolve;if(R=S1(Z?C(Z,R):R),I.has(R))throw z(R);I.add(R);let k=this.refs[R];if(typeof k=="string")k=this.refs[k];if(typeof k=="object")W(Y,k.schema,R);else if(R!==S1(N))if(R[0]==="#")W(Y,Q[R],R),Q[R]=Y;else this.refs[R]=N;return R}function S(R){if(typeof R=="string"){if(!Vq.test(R))throw Error(`invalid anchor "${R}"`);H.call(this,`#${R}`)}}}),Q;function W(Y,B,V){if(B!==void 0&&!Jq(Y,B))throw z(V)}function z(Y){return Error(`reference "${Y}" resolves to more than one schema`)}}JL.getSchemaRefs=Lq});var J0=b((jL)=>{Object.defineProperty(jL,"__esModule",{value:!0});jL.getData=jL.KeywordCxt=jL.validateFunctionCode=void 0;var BL=PV(),IL=U0(),$z=mW(),vX=U0(),Hq=_V(),G0=tV(),sW=sV(),g=l(),n=h4(),Fq=D0(),m4=d(),X0=v0();function jq($){if(KL($)){if(NL($),LL($)){Pq($);return}}VL($,()=>(0,BL.topBoolOrEmptySchema)($))}jL.validateFunctionCode=jq;function VL({gen:$,validateName:v,schema:D,schemaEnv:X,opts:U},G){if(U.code.es5)$.func(v,g._`${n.default.data}, ${n.default.valCxt}`,X.$async,()=>{$.code(g._`"use strict"; ${WL(D,U)}`),Mq($,U),$.code(G)});else $.func(v,g._`${n.default.data}, ${wq(U)}`,X.$async,()=>$.code(WL(D,U)).code(G))}function wq($){return g._`{${n.default.instancePath}="", ${n.default.parentData}, ${n.default.parentDataProperty}, ${n.default.rootData}=${n.default.data}${$.dynamicRef?g._`, ${n.default.dynamicAnchors}={}`:g.nil}}={}`}function Mq($,v){$.if(n.default.valCxt,()=>{if($.var(n.default.instancePath,g._`${n.default.valCxt}.${n.default.instancePath}`),$.var(n.default.parentData,g._`${n.default.valCxt}.${n.default.parentData}`),$.var(n.default.parentDataProperty,g._`${n.default.valCxt}.${n.default.parentDataProperty}`),$.var(n.default.rootData,g._`${n.default.valCxt}.${n.default.rootData}`),v.dynamicRef)$.var(n.default.dynamicAnchors,g._`${n.default.valCxt}.${n.default.dynamicAnchors}`)},()=>{if($.var(n.default.instancePath,g._`""`),$.var(n.default.parentData,g._`undefined`),$.var(n.default.parentDataProperty,g._`undefined`),$.var(n.default.rootData,n.default.data),v.dynamicRef)$.var(n.default.dynamicAnchors,g._`{}`)})}function Pq($){let{schema:v,opts:D,gen:X}=$;VL($,()=>{if(D.$comment&&v.$comment)OL($);if(Tq($),X.let(n.default.vErrors,null),X.let(n.default.errors,0),D.unevaluated)bq($);ZL($),Rq($)});return}function bq($){let{gen:v,validateName:D}=$;$.evaluated=v.const("evaluated",g._`${D}.evaluated`),v.if(g._`${$.evaluated}.dynamicProps`,()=>v.assign(g._`${$.evaluated}.props`,g._`undefined`)),v.if(g._`${$.evaluated}.dynamicItems`,()=>v.assign(g._`${$.evaluated}.items`,g._`undefined`))}function WL($,v){let D=typeof $=="object"&&$[v.schemaId];return D&&(v.code.source||v.code.process)?g._`/*# sourceURL=${D} */`:g.nil}function qq($,v){if(KL($)){if(NL($),LL($)){Sq($,v);return}}(0,BL.boolOrEmptySchema)($,v)}function LL({schema:$,self:v}){if(typeof $=="boolean")return!$;for(let D in $)if(v.RULES.all[D])return!0;return!1}function KL($){return typeof $.schema!="boolean"}function Sq($,v){let{schema:D,gen:X,opts:U}=$;if(U.$comment&&D.$comment)OL($);Eq($),uq($);let G=X.const("_errs",n.default.errors);ZL($,G),X.var(v,g._`${G} === ${n.default.errors}`)}function NL($){(0,m4.checkUnknownRules)($),kq($)}function ZL($,v){if($.opts.jtd)return zL($,[],!1,v);let D=(0,IL.getSchemaTypes)($.schema),X=(0,IL.coerceAndCheckDataType)($,D);zL($,D,!X,v)}function kq($){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 Tq($){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 Eq($){let v=$.schema[$.opts.schemaId];if(v)$.baseId=(0,Fq.resolveUrl)($.opts.uriResolver,$.baseId,v)}function uq($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function OL({gen:$,schemaEnv:v,schema:D,errSchemaPath:X,opts:U}){let G=D.$comment;if(U.$comment===!0)$.code(g._`${n.default.self}.logger.log(${G})`);else if(typeof U.$comment=="function"){let J=g.str`${X}/$comment`,Q=$.scopeValue("root",{ref:v.root});$.code(g._`${n.default.self}.opts.$comment(${G}, ${J}, ${Q}.schema)`)}}function Rq($){let{gen:v,schemaEnv:D,validateName:X,ValidationError:U,opts:G}=$;if(D.$async)v.if(g._`${n.default.errors} === 0`,()=>v.return(n.default.data),()=>v.throw(g._`new ${U}(${n.default.vErrors})`));else{if(v.assign(g._`${X}.errors`,n.default.vErrors),G.unevaluated)gq($);v.return(g._`${n.default.errors} === 0`)}}function gq({gen:$,evaluated:v,props:D,items:X}){if(D instanceof g.Name)$.assign(g._`${v}.props`,D);if(X instanceof g.Name)$.assign(g._`${v}.items`,X)}function zL($,v,D,X){let{gen:U,schema:G,data:J,allErrors:Q,opts:I,self:W}=$,{RULES:z}=W;if(G.$ref&&(I.ignoreKeywordsWithRef||!(0,m4.schemaHasRulesButRef)(G,z))){U.block(()=>HL($,"$ref",z.all.$ref.definition));return}if(!I.jtd)Cq($,v);U.block(()=>{for(let B of z.rules)Y(B);Y(z.post)});function Y(B){if(!(0,$z.shouldUseGroup)(G,B))return;if(B.type){if(U.if((0,vX.checkDataType)(B.type,J,I.strictNumbers)),YL($,B),v.length===1&&v[0]===B.type&&D)U.else(),(0,vX.reportTypeError)($);U.endIf()}else YL($,B);if(!Q)U.if(g._`${n.default.errors} === ${X||0}`)}}function YL($,v){let{gen:D,schema:X,opts:{useDefaults:U}}=$;if(U)(0,Hq.assignDefaults)($,v.type);D.block(()=>{for(let G of v.rules)if((0,$z.shouldUseRule)(X,G))HL($,G.keyword,G.definition,v.type)})}function Cq($,v){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(xq($,v),!$.opts.allowUnionTypes)iq($,v);fq($,$.dataTypes)}function xq($,v){if(!v.length)return;if(!$.dataTypes.length){$.dataTypes=v;return}v.forEach((D)=>{if(!AL($.dataTypes,D))vz($,`type "${D}" not allowed by context "${$.dataTypes.join(",")}"`)}),_q($,v)}function iq($,v){if(v.length>1&&!(v.length===2&&v.includes("null")))vz($,"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,$z.shouldUseRule)($.schema,U)){let{type:G}=U.definition;if(G.length&&!G.some((J)=>nq(v,J)))vz($,`missing type "${G.join(",")}" for keyword "${X}"`)}}}function nq($,v){return $.includes(v)||v==="number"&&$.includes("integer")}function AL($,v){return $.includes(v)||v==="integer"&&$.includes("number")}function _q($,v){let D=[];for(let X of $.dataTypes)if(AL(v,X))D.push(X);else if(v.includes("integer")&&X==="number")D.push("integer");$.dataTypes=D}function vz($,v){let D=$.schemaEnv.baseId+$.errSchemaPath;v+=` at "${D}" (strictTypes)`,(0,m4.checkStrictMode)($,v,$.opts.strictTypes)}class Uz{constructor($,v,D){if((0,G0.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",FL(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,G0.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,g.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,g.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(g._`${v} !== undefined && (${(0,g.or)(this.invalid$data(),$)})`)}error($,v,D){if(v){this.setParams(v),this._error($,D),this.setParams({});return}this._error($,D)}_error($,v){($?X0.reportExtraError:X0.reportError)(this,this.def.error,v)}$dataError(){(0,X0.reportError)(this,this.def.$dataError||X0.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,X0.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=g.nil){this.gen.block(()=>{this.check$data($,D),v()})}check$data($=g.nil,v=g.nil){if(!this.$data)return;let{gen:D,schemaCode:X,schemaType:U,def:G}=this;if(D.if((0,g.or)(g._`${X} === undefined`,v)),$!==g.nil)D.assign($,!0);if(U.length||G.validateSchema){if(D.elseIf(this.invalid$data()),this.$dataError(),$!==g.nil)D.assign($,!1)}D.else()}invalid$data(){let{gen:$,schemaCode:v,schemaType:D,def:X,it:U}=this;return(0,g.or)(G(),J());function G(){if(D.length){if(!(v instanceof g.Name))throw Error("ajv implementation error");let Q=Array.isArray(D)?D:[D];return g._`${(0,vX.checkDataTypes)(Q,v,U.opts.strictNumbers,vX.DataType.Wrong)}`}return g.nil}function J(){if(X.validateSchema){let Q=$.scopeValue("validate$data",{ref:X.validateSchema});return g._`!${Q}(${v})`}return g.nil}}subschema($,v){let D=(0,sW.getSubschema)(this.it,$);(0,sW.extendSubschemaData)(D,this.it,$),(0,sW.extendSubschemaMode)(D,$);let X={...this.it,...D,items:void 0,props:void 0};return qq(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($,g.Name)),!0}}jL.KeywordCxt=Uz;function HL($,v,D,X){let U=new Uz($,D,v);if("code"in D)D.code(U,X);else if(U.$data&&D.validate)(0,G0.funcKeywordCode)(U,D);else if("macro"in D)(0,G0.macroKeywordCode)(U,D);else if(D.compile||D.validate)(0,G0.funcKeywordCode)(U,D)}var yq=/^\/(?:[^~]|~0|~1)*$/,lq=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function FL($,{dataLevel:v,dataNames:D,dataPathArr:X}){let U,G;if($==="")return n.default.rootData;if($[0]==="/"){if(!yq.test($))throw Error(`Invalid JSON-pointer: ${$}`);U=$,G=n.default.rootData}else{let W=lq.exec($);if(!W)throw Error(`Invalid JSON-pointer: ${$}`);let z=+W[1];if(U=W[2],U==="#"){if(z>=v)throw Error(I("property/index",z));return X[v-z]}if(z>v)throw Error(I("data",z));if(G=D[v-z],!U)return G}let J=G,Q=U.split("/");for(let W of Q)if(W)G=g._`${G}${(0,g.getProperty)((0,m4.unescapeJsonPointer)(W))}`,J=g._`${J} && ${G}`;return J;function I(W,z){return`Cannot access ${W} ${z} levels up, current level is ${v}`}}jL.getData=FL});var UX=b((PL)=>{Object.defineProperty(PL,"__esModule",{value:!0});class ML extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}PL.default=ML});var Q0=b((qL)=>{Object.defineProperty(qL,"__esModule",{value:!0});var Dz=D0();class bL extends Error{constructor($,v,D,X){super(X||`can't resolve reference ${D} from id ${v}`);this.missingRef=(0,Dz.resolveUrl)($,v,D),this.missingSchema=(0,Dz.normalizeId)((0,Dz.getFullPath)($,this.missingRef))}}qL.default=bL});var XX=b((TL)=>{Object.defineProperty(TL,"__esModule",{value:!0});TL.resolveSchema=TL.getCompilingSchema=TL.resolveRef=TL.compileSchema=TL.SchemaEnv=void 0;var V4=l(),dq=UX(),T6=h4(),L4=D0(),SL=d(),pq=J0();class I0{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={}}}TL.SchemaEnv=I0;function Gz($){let v=kL.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 V4.CodeGen(this.scope,{es5:X,lines:U,ownProperties:G}),Q;if($.$async)Q=J.scopeValue("Error",{ref:dq.default,code:V4._`require("ajv/dist/runtime/validation_error").default`});let I=J.scopeName("validate");$.validateName=I;let W={gen:J,allErrors:this.opts.allErrors,data:T6.default.data,parentData:T6.default.parentData,parentDataProperty:T6.default.parentDataProperty,dataNames:[T6.default.data],dataPathArr:[V4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:J.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,V4.stringify)($.schema)}:{ref:$.schema}),validateName:I,ValidationError:Q,schema:$.schema,schemaEnv:$,rootId:D,baseId:$.baseId||D,schemaPath:V4.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:V4._`""`,opts:this.opts,self:this},z;try{this._compilations.add($),(0,pq.validateFunctionCode)(W),J.optimize(this.opts.code.optimize);let Y=J.toString();if(z=`${J.scopeRefs(T6.default.scope)}return ${Y}`,this.opts.code.process)z=this.opts.code.process(z,$);let V=Function(`${T6.default.self}`,`${T6.default.scope}`,z)(this,this.scope.get());if(this.scope.value(I,{ref:V}),V.errors=null,V.schema=$.schema,V.schemaEnv=$,$.$async)V.$async=!0;if(this.opts.code.source===!0)V.source={validateName:I,validateCode:Y,scopeValues:J._values};if(this.opts.unevaluated){let{props:L,items:N}=W;if(V.evaluated={props:L instanceof V4.Name?void 0:L,items:N instanceof V4.Name?void 0:N,dynamicProps:L instanceof V4.Name,dynamicItems:N instanceof V4.Name},V.source)V.source.evaluated=(0,V4.stringify)(V.evaluated)}return $.validate=V,$}catch(Y){if(delete $.validate,delete $.validateName,z)this.logger.error("Error compiling schema, function code:",z);throw Y}finally{this._compilations.delete($)}}TL.compileSchema=Gz;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=eq.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 I0({schema:J,schemaId:Q,root:$,baseId:v})}if(G===void 0)return;return $.refs[D]=oq.call(this,G)}TL.resolveRef=tq;function oq($){if((0,L4.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:Gz.call(this,$)}function kL($){for(let v of this._compilations)if(aq(v,$))return v}TL.getCompilingSchema=kL;function aq($,v){return $.schema===v.schema&&$.root===v.root&&$.baseId===v.baseId}function eq($,v){let D;while(typeof(D=this.refs[v])=="string")v=D;return D||this.schemas[v]||DX.call(this,$,v)}function DX($,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 Xz.call(this,D,$);let G=(0,L4.normalizeId)(X),J=this.refs[G]||this.schemas[G];if(typeof J=="string"){let Q=DX.call(this,$,J);if(typeof(Q===null||Q===void 0?void 0:Q.schema)!=="object")return;return Xz.call(this,D,Q)}if(typeof(J===null||J===void 0?void 0:J.schema)!=="object")return;if(!J.validate)Gz.call(this,J);if(G===(0,L4.normalizeId)(v)){let{schema:Q}=J,{schemaId:I}=this.opts,W=Q[I];if(W)U=(0,L4.resolveUrl)(this.opts.uriResolver,U,W);return new I0({schema:Q,schemaId:I,root:$,baseId:U})}return Xz.call(this,D,J)}TL.resolveSchema=DX;var sq=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Xz($,{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 I=D[(0,SL.unescapeFragment)(Q)];if(I===void 0)return;D=I;let W=typeof D==="object"&&D[this.opts.schemaId];if(!sq.has(Q)&&W)v=(0,L4.resolveUrl)(this.opts.uriResolver,v,W)}let G;if(typeof D!="boolean"&&D.$ref&&!(0,SL.schemaHasRulesButRef)(D,this.RULES)){let Q=(0,L4.resolveUrl)(this.opts.uriResolver,v,D.$ref);G=DX.call(this,X,Q)}let{schemaId:J}=this.opts;if(G=G||new I0({schema:D,schemaId:J,root:X,baseId:v}),G.schema!==G.root.schema)return G;return}});var uL=b((Hc,XS)=>{XS.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 Iz=b((Fc,fL)=>{var GS=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),gL=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),Jz=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),CL=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),JS=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Qz($){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 QS=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function RL($){return $.length=0,!0}function IS($,v,D){if($.length){let X=Qz($);if(X!=="")v.push(X);else return D.error=!0,!1;$.length=0}return!0}function WS($){let v=0,D={error:!1,address:"",zone:""},X=[],U=[],G=!1,J=!1,Q=IS;for(let I=0;I<$.length;I++){let W=$[I];if(W==="["||W==="]")continue;if(W===":"){if(G===!0)J=!0;if(!Q(U,X,D))break;if(++v>7){D.error=!0;break}if(I>0&&$[I-1]===":")G=!0;X.push(":");continue}else if(W==="%"){if(!Q(U,X,D))break;Q=RL}else{U.push(W);continue}}if(U.length)if(Q===RL)D.zone=U.join("");else if(J)X.push(U.join(""));else X.push(Qz(U));return D.address=X.join(""),D}function xL($){if(zS($,":")<2)return{host:$,isIPV6:!1};let v=WS($);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 zS($,v){let D=0;for(let X=0;X<$.length;X++)if($[X]===v)D++;return D}function YS($){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 BS={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},VS=/[@/?#:]/g,LS=/[@/?#]/g;function iL($,v){let D=v?LS:VS;return D.lastIndex=0,$.replace(D,(X)=>BS[X])}function KS($,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(Jz(U)){let G=U.toUpperCase(),J=String.fromCharCode(parseInt(G,16));if(v&&CL(J))D+=J;else D+="%"+G;X+=2;continue}}D+=$[X]}return D}function NS($){let v="";for(let D=0;D<$.length;D++){if($[D]==="%"&&D+2<$.length){let X=$.slice(D+1,D+3);if(Jz(X)){let U=X.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(G!=="."&&CL(G))v+=G;else v+="%"+U;D+=2;continue}}if(JS($[D]))v+=$[D];else v+=escape($[D])}return v}function ZS($){let v="";for(let D=0;D<$.length;D++){if($[D]==="%"&&D+2<$.length){let X=$.slice(D+1,D+3);if(Jz(X)){v+="%"+X.toUpperCase(),D+=2;continue}}v+=escape($[D])}return v}function OS($){let v=[];if($.userinfo!==void 0)v.push($.userinfo),v.push("@");if($.host!==void 0){let D=unescape($.host);if(!gL(D)){let X=xL(D);if(X.isIPV6===!0)D=`[${X.escapedHost}]`;else D=iL(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}fL.exports={nonSimpleDomain:QS,recomposeAuthority:OS,reescapeHostDelimiters:iL,normalizePercentEncoding:KS,normalizePathEncoding:NS,escapePreservingEscapes:ZS,removeDotSegments:YS,isIPv4:gL,isUUID:GS,normalizeIPv6:xL,stringArrayToHexStripped:Qz}});var hL=b((jc,lL)=>{var{isUUID:AS}=Iz(),HS=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,FS=["http","https","ws","wss","urn","urn:uuid"];function jS($){return FS.indexOf($)!==-1}function Wz($){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 nL($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function _L($){let v=String($.scheme).toLowerCase()==="https";if($.port===(v?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function wS($){return $.secure=Wz($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function MS($){if($.port===(Wz($)?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 PS($,v){if(!$.path)return $.error="URN can not be parsed",$;let D=$.path.match(HS);if(D){let X=v.scheme||$.scheme||"urn";$.nid=D[1].toLowerCase(),$.nss=D[2];let U=`${X}:${v.nid||$.nid}`,G=zz(U);if($.path=void 0,G)$=G.parse($,v)}else $.error=$.error||"URN can not be parsed.";return $}function bS($,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=zz(U);if(G)$=G.serialize($,v);let J=$,Q=$.nss;return J.path=`${X||v.nid}:${Q}`,v.skipEscape=!0,J}function qS($,v){let D=$;if(D.uuid=D.nss,D.nss=void 0,!v.tolerant&&(!D.uuid||!AS(D.uuid)))D.error=D.error||"UUID is not valid.";return D}function SS($){let v=$;return v.nss=($.uuid||"").toLowerCase(),v}var yL={scheme:"http",domainHost:!0,parse:nL,serialize:_L},kS={scheme:"https",domainHost:yL.domainHost,parse:nL,serialize:_L},GX={scheme:"ws",domainHost:!0,parse:wS,serialize:MS},TS={scheme:"wss",domainHost:GX.domainHost,parse:GX.parse,serialize:GX.serialize},ES={scheme:"urn",parse:PS,serialize:bS,skipNormalize:!0},uS={scheme:"urn:uuid",parse:qS,serialize:SS,skipNormalize:!0},JX={http:yL,https:kS,ws:GX,wss:TS,urn:ES,"urn:uuid":uS};Object.setPrototypeOf(JX,null);function zz($){return $&&(JX[$]||JX[$.toLowerCase()])||void 0}lL.exports={wsIsSecure:Wz,SCHEMES:JX,isValidSchemeName:jS,getSchemeHandler:zz}});var tL=b((wc,QX)=>{var{normalizeIPv6:RS,removeDotSegments:W0,recomposeAuthority:gS,normalizePercentEncoding:CS,normalizePathEncoding:xS,escapePreservingEscapes:iS,reescapeHostDelimiters:fS,isIPv4:nS,nonSimpleDomain:_S}=Iz(),{SCHEMES:yS,getSchemeHandler:rL}=hL();function lS($,v){if(typeof $==="string")$=dS($,v);else if(typeof $==="object")$=k1(E6($,v),v);return $}function hS($,v,D){let X=D?Object.assign({scheme:"null"},D):{scheme:"null"},U=cL(k1($,X),k1(v,X),X,!0);return X.skipEscape=!0,E6(U,X)}function cL($,v,D,X){let U={};if(!X)$=k1(E6($,D),D),v=k1(E6(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 mS($,v,D){let X=mL($,D),U=mL(v,D);return X!==void 0&&U!==void 0&&X.toLowerCase()===U.toLowerCase()}function E6($,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=rL(X.scheme||D.scheme);if(G&&G.serialize)G.serialize(D,X);if(D.path!==void 0)if(!X.skipEscape){if(D.path=iS(D.path),D.scheme!==void 0)D.path=D.path.split("%3A").join(":")}else D.path=CS(D.path);if(X.reference!=="suffix"&&D.scheme)U.push(D.scheme,":");let J=gS(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 rS=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function cS($,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 dL($,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(rS);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=cS(X,J);if(Q!==void 0)X.error=X.error||Q,U=!0;if(X.host)if(nS(X.host)===!1){let z=RS(X.host);X.host=z.host.toLowerCase(),G=z.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 I=rL(D.scheme||X.scheme);if(!D.unicodeSupport&&(!I||!I.unicodeSupport)){if(X.host&&(D.domainHost||I&&I.domainHost)&&G===!1&&_S(X.host))try{X.host=URL.domainToASCII(X.host.toLowerCase())}catch(W){X.error=X.error||"Host's domain name can not be converted to ASCII: "+W}}if(!I||I&&!I.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=xS(X.path);if(X.fragment)try{X.fragment=encodeURI(decodeURIComponent(X.fragment))}catch{X.error=X.error||"URI malformed"}}if(I&&I.parse)I.parse(X,D)}else X.error=X.error||"URI can not be parsed.";return{parsed:X,malformedAuthorityOrPort:U}}function k1($,v){return dL($,v).parsed}function dS($,v){return pL($,v).normalized}function pL($,v){let{parsed:D,malformedAuthorityOrPort:X}=dL($,v);return{normalized:X?$:E6(D,v),malformedAuthorityOrPort:X}}function mL($,v){if(typeof $==="string"){let{normalized:D,malformedAuthorityOrPort:X}=pL($,v);return X?void 0:D}if(typeof $==="object")return E6($,v)}var Yz={SCHEMES:yS,normalize:lS,resolve:hS,resolveComponent:cL,equal:mS,serialize:E6,parse:k1};QX.exports=Yz;QX.exports.default=Yz;QX.exports.fastUri=Yz});var eL=b((aL)=>{Object.defineProperty(aL,"__esModule",{value:!0});var oL=tL();oL.code='require("ajv/dist/runtime/uri").default';aL.default=oL});var JK=b((r4)=>{Object.defineProperty(r4,"__esModule",{value:!0});r4.CodeGen=r4.Name=r4.nil=r4.stringify=r4.str=r4._=r4.KeywordCxt=void 0;var tS=J0();Object.defineProperty(r4,"KeywordCxt",{enumerable:!0,get:function(){return tS.KeywordCxt}});var T1=l();Object.defineProperty(r4,"_",{enumerable:!0,get:function(){return T1._}});Object.defineProperty(r4,"str",{enumerable:!0,get:function(){return T1.str}});Object.defineProperty(r4,"stringify",{enumerable:!0,get:function(){return T1.stringify}});Object.defineProperty(r4,"nil",{enumerable:!0,get:function(){return T1.nil}});Object.defineProperty(r4,"Name",{enumerable:!0,get:function(){return T1.Name}});Object.defineProperty(r4,"CodeGen",{enumerable:!0,get:function(){return T1.CodeGen}});var oS=UX(),DK=Q0(),aS=hW(),z0=XX(),eS=l(),Y0=D0(),IX=U0(),Vz=d(),sL=uL(),sS=eL(),XK=($,v)=>new RegExp($,v);XK.code="new RegExp";var $k=["removeAdditional","useDefaults","coerceTypes"],vk=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Uk={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."},Dk={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},$K=200;function Xk($){var v,D,X,U,G,J,Q,I,W,z,Y,B,V,L,N,Z,H,S,R,C,k,N$,F$,u4,Q4;let _$=$.strict,l1=(v=$.code)===null||v===void 0?void 0:v.optimize,h1=l1===!0||l1===void 0?1:l1||0,m1=(X=(D=$.code)===null||D===void 0?void 0:D.regExp)!==null&&X!==void 0?X:XK,b0=(U=$.uriResolver)!==null&&U!==void 0?U:sS.default;return{strictSchema:(J=(G=$.strictSchema)!==null&&G!==void 0?G:_$)!==null&&J!==void 0?J:!0,strictNumbers:(I=(Q=$.strictNumbers)!==null&&Q!==void 0?Q:_$)!==null&&I!==void 0?I:!0,strictTypes:(z=(W=$.strictTypes)!==null&&W!==void 0?W:_$)!==null&&z!==void 0?z:"log",strictTuples:(B=(Y=$.strictTuples)!==null&&Y!==void 0?Y:_$)!==null&&B!==void 0?B:"log",strictRequired:(L=(V=$.strictRequired)!==null&&V!==void 0?V:_$)!==null&&L!==void 0?L:!1,code:$.code?{...$.code,optimize:h1,regExp:m1}:{optimize:h1,regExp:m1},loopRequired:(N=$.loopRequired)!==null&&N!==void 0?N:$K,loopEnum:(Z=$.loopEnum)!==null&&Z!==void 0?Z:$K,meta:(H=$.meta)!==null&&H!==void 0?H:!0,messages:(S=$.messages)!==null&&S!==void 0?S:!0,inlineRefs:(R=$.inlineRefs)!==null&&R!==void 0?R:!0,schemaId:(C=$.schemaId)!==null&&C!==void 0?C:"$id",addUsedSchema:(k=$.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(N$=$.validateSchema)!==null&&N$!==void 0?N$:!0,validateFormats:(F$=$.validateFormats)!==null&&F$!==void 0?F$:!0,unicodeRegExp:(u4=$.unicodeRegExp)!==null&&u4!==void 0?u4:!0,int32range:(Q4=$.int32range)!==null&&Q4!==void 0?Q4:!0,uriResolver:b0}}class WX{constructor($={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...Xk($)};let{es5:v,lines:D}=this.opts.code;this.scope=new eS.ValueScope({scope:{},prefixes:vk,es5:v,lines:D}),this.logger=zk($.logger);let X=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,aS.getRules)(),vK.call(this,Uk,$,"NOT SUPPORTED"),vK.call(this,Dk,$,"DEPRECATED","warn"),this._metaOpts=Ik.call(this),$.formats)Jk.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)Qk.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);Gk.call(this),$.validateFormats=X}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:v,schemaId:D}=this.opts,X=sL;if(D==="id")X={...sL},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(W,z){await U.call(this,W.$schema);let Y=this._addSchema(W,z);return Y.validate||G.call(this,Y)}async function U(W){if(W&&!this.getSchema(W))await X.call(this,{$ref:W},!0)}async function G(W){try{return this._compileSchemaEnv(W)}catch(z){if(!(z instanceof DK.default))throw z;return J.call(this,z),await Q.call(this,z.missingSchema),G.call(this,W)}}function J({missingSchema:W,missingRef:z}){if(this.refs[W])throw Error(`AnySchema ${W} is loaded but ${z} cannot be resolved`)}async function Q(W){let z=await I.call(this,W);if(!this.refs[W])await U.call(this,z.$schema);if(!this.refs[W])this.addSchema(z,W,v)}async function I(W){let z=this._loading[W];if(z)return z;try{return await(this._loading[W]=D(W))}finally{delete this._loading[W]}}}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=UK.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=UK.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(Bk.call(this,D,v),!v)return(0,Vz.eachItem)(D,(U)=>Bz.call(this,U)),this;Lk.call(this,v);let X={...v,type:(0,IX.getJSONTypes)(v.type),schemaType:(0,IX.getJSONTypes)(v.schemaType)};return(0,Vz.eachItem)(D,X.type.length===0?(U)=>Bz.call(this,U,X):(U)=>X.type.forEach((G)=>Bz.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:I}=Q.definition,W=G[J];if(I&&W)G[J]=GK(W)}}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 I=Y0.getSchemaRefs.call(this,$,D);if(Q=new z0.SchemaEnv({schema:$,schemaId:J,meta:v,baseId:D,localRefs:I}),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}}}WX.ValidationError=oS.default;WX.MissingRefError=DK.default;r4.default=WX;function vK($,v,D,X="error"){for(let U in $){let G=U;if(G in v)this.logger[X](`${D}: option ${U}. ${$[G]}`)}}function UK($){return $=(0,Y0.normalizeId)($),this.schemas[$]||this.refs[$]}function Gk(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let v in $)this.addSchema($[v],v)}function Jk(){for(let $ in this.opts.formats){let v=this.opts.formats[$];if(v)this.addFormat($,v)}}function Qk($){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 Ik(){let $={...this.opts};for(let v of $k)delete $[v];return $}var Wk={log(){},warn(){},error(){}};function zk($){if($===!1)return Wk;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var Yk=/^[a-z_$][a-z0-9_$:-]*$/i;function Bk($,v){let{RULES:D}=this;if((0,Vz.eachItem)($,(X)=>{if(D.keywords[X])throw Error(`Keyword ${X} is already defined`);if(!Yk.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 Bz($,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:I})=>I===D);if(!J)J={type:D,rules:[]},G.rules.push(J);if(G.keywords[$]=!0,!v)return;let Q={keyword:$,definition:{...v,type:(0,IX.getJSONTypes)(v.type),schemaType:(0,IX.getJSONTypes)(v.schemaType)}};if(v.before)Vk.call(this,J,Q,v.before);else J.rules.push(Q);G.all[$]=Q,(X=v.implements)===null||X===void 0||X.forEach((I)=>this.addKeyword(I))}function Vk($,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 Lk($){let{metaSchema:v}=$;if(v===void 0)return;if($.$data&&this.opts.$data)v=GK(v);$.validateSchema=this.compile(v,!0)}var Kk={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function GK($){return{anyOf:[$,Kk]}}});var IK=b((QK)=>{Object.defineProperty(QK,"__esModule",{value:!0});var Ok={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};QK.default=Ok});var LK=b((BK)=>{Object.defineProperty(BK,"__esModule",{value:!0});BK.callRef=BK.getValidate=void 0;var Hk=Q0(),WK=X4(),c$=l(),E1=h4(),zK=XX(),zX=d(),Fk={keyword:"$ref",schemaType:"string",code($){let{gen:v,schema:D,it:X}=$,{baseId:U,schemaEnv:G,validateName:J,opts:Q,self:I}=X,{root:W}=G;if((D==="#"||D==="#/")&&U===W.baseId)return Y();let z=zK.resolveRef.call(I,W,U,D);if(z===void 0)throw new Hk.default(X.opts.uriResolver,U,D);if(z instanceof zK.SchemaEnv)return B(z);return V(z);function Y(){if(G===W)return YX($,J,G,G.$async);let L=v.scopeValue("root",{ref:W});return YX($,c$._`${L}.validate`,W,W.$async)}function B(L){let N=YK($,L);YX($,N,L,L.$async)}function V(L){let N=v.scopeValue("schema",Q.code.source===!0?{ref:L,code:(0,c$.stringify)(L)}:{ref:L}),Z=v.name("valid"),H=$.subschema({schema:L,dataTypes:[],schemaPath:c$.nil,topSchemaRef:N,errSchemaPath:D},Z);$.mergeEvaluated(H),$.ok(Z)}}};function YK($,v){let{gen:D}=$;return v.validate?D.scopeValue("validate",{ref:v.validate}):c$._`${D.scopeValue("wrapper",{ref:v})}.validate`}BK.getValidate=YK;function YX($,v,D,X){let{gen:U,it:G}=$,{allErrors:J,schemaEnv:Q,opts:I}=G,W=I.passContext?E1.default.this:c$.nil;if(X)z();else Y();function z(){if(!Q.$async)throw Error("async schema referenced by sync schema");let L=U.let("valid");U.try(()=>{if(U.code(c$._`await ${(0,WK.callValidateCode)($,v,W)}`),V(v),!J)U.assign(L,!0)},(N)=>{if(U.if(c$._`!(${N} instanceof ${G.ValidationError})`,()=>U.throw(N)),B(N),!J)U.assign(L,!1)}),$.ok(L)}function Y(){$.result((0,WK.callValidateCode)($,v,W),()=>V(v),()=>B(v))}function B(L){let N=c$._`${L}.errors`;U.assign(E1.default.vErrors,c$._`${E1.default.vErrors} === null ? ${N} : ${E1.default.vErrors}.concat(${N})`),U.assign(E1.default.errors,c$._`${E1.default.vErrors}.length`)}function V(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=zX.mergeEvaluated.props(U,Z.props,G.props)}else{let H=U.var("props",c$._`${L}.evaluated.props`);G.props=zX.mergeEvaluated.props(U,H,G.props,c$.Name)}if(G.items!==!0)if(Z&&!Z.dynamicItems){if(Z.items!==void 0)G.items=zX.mergeEvaluated.items(U,Z.items,G.items)}else{let H=U.var("items",c$._`${L}.evaluated.items`);G.items=zX.mergeEvaluated.items(U,H,G.items,c$.Name)}}}BK.callRef=YX;BK.default=Fk});var NK=b((KK)=>{Object.defineProperty(KK,"__esModule",{value:!0});var Mk=IK(),Pk=LK(),bk=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Mk.default,Pk.default];KK.default=bk});var OK=b((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});var BX=l(),L6=BX.operators,VX={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}},Sk={message:({keyword:$,schemaCode:v})=>BX.str`must be ${VX[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>BX._`{comparison: ${VX[$].okStr}, limit: ${v}}`},kk={keyword:Object.keys(VX),type:"number",schemaType:"number",$data:!0,error:Sk,code($){let{keyword:v,data:D,schemaCode:X}=$;$.fail$data(BX._`${D} ${VX[v].fail} ${X} || isNaN(${D})`)}};ZK.default=kk});var HK=b((AK)=>{Object.defineProperty(AK,"__esModule",{value:!0});var B0=l(),Ek={message:({schemaCode:$})=>B0.str`must be multiple of ${$}`,params:({schemaCode:$})=>B0._`{multipleOf: ${$}}`},uk={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Ek,code($){let{gen:v,data:D,schemaCode:X,it:U}=$,G=U.opts.multipleOfPrecision,J=v.let("res"),Q=G?B0._`Math.abs(Math.round(${J}) - ${J}) > 1e-${G}`:B0._`${J} !== parseInt(${J})`;$.fail$data(B0._`(${X} === 0 || (${J} = ${D}/${X}, ${Q}))`)}};AK.default=uk});var wK=b((jK)=>{Object.defineProperty(jK,"__esModule",{value:!0});function FK($){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}jK.default=FK;FK.code='require("ajv/dist/runtime/ucs2length").default'});var PK=b((MK)=>{Object.defineProperty(MK,"__esModule",{value:!0});var u6=l(),Ck=d(),xk=wK(),ik={message({keyword:$,schemaCode:v}){let D=$==="maxLength"?"more":"fewer";return u6.str`must NOT have ${D} than ${v} characters`},params:({schemaCode:$})=>u6._`{limit: ${$}}`},fk={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ik,code($){let{keyword:v,data:D,schemaCode:X,it:U}=$,G=v==="maxLength"?u6.operators.GT:u6.operators.LT,J=U.opts.unicode===!1?u6._`${D}.length`:u6._`${(0,Ck.useFunc)($.gen,xk.default)}(${D})`;$.fail$data(u6._`${J} ${G} ${X}`)}};MK.default=fk});var qK=b((bK)=>{Object.defineProperty(bK,"__esModule",{value:!0});var _k=X4(),yk=d(),u1=l(),lk={message:({schemaCode:$})=>u1.str`must match pattern "${$}"`,params:({schemaCode:$})=>u1._`{pattern: ${$}}`},hk={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:lk,code($){let{gen:v,data:D,$data:X,schema:U,schemaCode:G,it:J}=$,Q=J.opts.unicodeRegExp?"u":"";if(X){let{regExp:I}=J.opts.code,W=I.code==="new RegExp"?u1._`new RegExp`:(0,yk.useFunc)(v,I),z=v.let("valid");v.try(()=>v.assign(z,u1._`${W}(${G}, ${Q}).test(${D})`),()=>v.assign(z,!1)),$.fail$data(u1._`!${z}`)}else{let I=(0,_k.usePattern)($,U);$.fail$data(u1._`!${I}.test(${D})`)}}};bK.default=hk});var kK=b((SK)=>{Object.defineProperty(SK,"__esModule",{value:!0});var V0=l(),rk={message({keyword:$,schemaCode:v}){let D=$==="maxProperties"?"more":"fewer";return V0.str`must NOT have ${D} than ${v} properties`},params:({schemaCode:$})=>V0._`{limit: ${$}}`},ck={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:rk,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}`)}};SK.default=ck});var EK=b((TK)=>{Object.defineProperty(TK,"__esModule",{value:!0});var L0=X4(),K0=l(),pk=d(),tk={message:({params:{missingProperty:$}})=>K0.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>K0._`{missingProperty: ${$}}`},ok={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 I=D.length>=Q.loopRequired;if(J.allErrors)W();else z();if(Q.strictRequired){let V=$.parentSchema.properties,{definedProperties:L}=$.it;for(let N of D)if((V===null||V===void 0?void 0:V[N])===void 0&&!L.has(N)){let Z=J.schemaEnv.baseId+J.errSchemaPath,H=`required property "${N}" is not defined at "${Z}" (strictRequired)`;(0,pk.checkStrictMode)(J,H,J.opts.strictRequired)}}function W(){if(I||G)$.block$data(K0.nil,Y);else for(let V of D)(0,L0.checkReportMissingProp)($,V)}function z(){let V=v.let("missing");if(I||G){let L=v.let("valid",!0);$.block$data(L,()=>B(V,L)),$.ok(L)}else v.if((0,L0.checkMissingProp)($,D,V)),(0,L0.reportMissingProp)($,V),v.else()}function Y(){v.forOf("prop",X,(V)=>{$.setParams({missingProperty:V}),v.if((0,L0.noPropertyInData)(v,U,V,Q.ownProperties),()=>$.error())})}function B(V,L){$.setParams({missingProperty:V}),v.forOf(V,X,()=>{v.assign(L,(0,L0.propertyInData)(v,U,V,Q.ownProperties)),v.if((0,K0.not)(L),()=>{$.error(),v.break()})},K0.nil)}}};TK.default=ok});var RK=b((uK)=>{Object.defineProperty(uK,"__esModule",{value:!0});var N0=l(),ek={message({keyword:$,schemaCode:v}){let D=$==="maxItems"?"more":"fewer";return N0.str`must NOT have ${D} than ${v} items`},params:({schemaCode:$})=>N0._`{limit: ${$}}`},sk={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ek,code($){let{keyword:v,data:D,schemaCode:X}=$,U=v==="maxItems"?N0.operators.GT:N0.operators.LT;$.fail$data(N0._`${D}.length ${U} ${X}`)}};uK.default=sk});var LX=b((CK)=>{Object.defineProperty(CK,"__esModule",{value:!0});var gK=aW();gK.code='require("ajv/dist/runtime/equal").default';CK.default=gK});var iK=b((xK)=>{Object.defineProperty(xK,"__esModule",{value:!0});var Lz=U0(),S$=l(),UT=d(),DT=LX(),XT={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}}`},GT={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:XT,code($){let{gen:v,data:D,$data:X,schema:U,parentSchema:G,schemaCode:J,it:Q}=$;if(!X&&!U)return;let I=v.let("valid"),W=G.items?(0,Lz.getSchemaTypes)(G.items):[];$.block$data(I,z,S$._`${J} === false`),$.ok(I);function z(){let L=v.let("i",S$._`${D}.length`),N=v.let("j");$.setParams({i:L,j:N}),v.assign(I,!0),v.if(S$._`${L} > 1`,()=>(Y()?B:V)(L,N))}function Y(){return W.length>0&&!W.some((L)=>L==="object"||L==="array")}function B(L,N){let Z=v.name("item"),H=(0,Lz.checkDataTypes)(W,Z,Q.opts.strictNumbers,Lz.DataType.Wrong),S=v.const("indices",S$._`{}`);v.for(S$._`;${L}--;`,()=>{if(v.let(Z,S$._`${D}[${L}]`),v.if(H,S$._`continue`),W.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(I,!1).break()}).code(S$._`${S}[${Z}] = ${L}`)})}function V(L,N){let Z=(0,UT.useFunc)(v,DT.default),H=v.name("outer");v.label(H).for(S$._`;${L}--;`,()=>v.for(S$._`${N} = ${L}; ${N}--;`,()=>v.if(S$._`${Z}(${D}[${L}], ${D}[${N}])`,()=>{$.error(),v.assign(I,!1).break(H)})))}}};xK.default=GT});var nK=b((fK)=>{Object.defineProperty(fK,"__esModule",{value:!0});var Kz=l(),QT=d(),IT=LX(),WT={message:"must be equal to constant",params:({schemaCode:$})=>Kz._`{allowedValue: ${$}}`},zT={keyword:"const",$data:!0,error:WT,code($){let{gen:v,data:D,$data:X,schemaCode:U,schema:G}=$;if(X||G&&typeof G=="object")$.fail$data(Kz._`!${(0,QT.useFunc)(v,IT.default)}(${D}, ${U})`);else $.fail(Kz._`${G} !== ${D}`)}};fK.default=zT});var yK=b((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var Z0=l(),BT=d(),VT=LX(),LT={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>Z0._`{allowedValues: ${$}}`},KT={keyword:"enum",schemaType:"array",$data:!0,error:LT,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,I,W=()=>I!==null&&I!==void 0?I:I=(0,BT.useFunc)(v,VT.default),z;if(Q||X)z=v.let("valid"),$.block$data(z,Y);else{if(!Array.isArray(U))throw Error("ajv implementation error");let V=v.const("vSchema",G);z=(0,Z0.or)(...U.map((L,N)=>B(V,N)))}$.pass(z);function Y(){v.assign(z,!1),v.forOf("v",G,(V)=>v.if(Z0._`${W()}(${D}, ${V})`,()=>v.assign(z,!0).break()))}function B(V,L){let N=U[L];return typeof N==="object"&&N!==null?Z0._`${W()}(${D}, ${V}[${L}])`:Z0._`${D} === ${N}`}}};_K.default=KT});var hK=b((lK)=>{Object.defineProperty(lK,"__esModule",{value:!0});var ZT=OK(),OT=HK(),AT=PK(),HT=qK(),FT=kK(),jT=EK(),wT=RK(),MT=iK(),PT=nK(),bT=yK(),qT=[ZT.default,OT.default,AT.default,HT.default,FT.default,jT.default,wT.default,MT.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},PT.default,bT.default];lK.default=qT});var Zz=b((rK)=>{Object.defineProperty(rK,"__esModule",{value:!0});rK.validateAdditionalItems=void 0;var R6=l(),Nz=d(),kT={message:({params:{len:$}})=>R6.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>R6._`{limit: ${$}}`},TT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:kT,code($){let{parentSchema:v,it:D}=$,{items:X}=v;if(!Array.isArray(X)){(0,Nz.checkStrictMode)(D,'"additionalItems" is ignored when "items" is not an array of schemas');return}mK($,X)}};function mK($,v){let{gen:D,schema:X,data:U,keyword:G,it:J}=$;J.items=!0;let Q=D.const("len",R6._`${U}.length`);if(X===!1)$.setParams({len:v.length}),$.pass(R6._`${Q} <= ${v.length}`);else if(typeof X=="object"&&!(0,Nz.alwaysValidSchema)(J,X)){let W=D.var("valid",R6._`${Q} <= ${v.length}`);D.if((0,R6.not)(W),()=>I(W)),$.ok(W)}function I(W){D.forRange("i",v.length,Q,(z)=>{if($.subschema({keyword:G,dataProp:z,dataPropType:Nz.Type.Num},W),!J.allErrors)D.if((0,R6.not)(W),()=>D.break())})}}rK.validateAdditionalItems=mK;rK.default=TT});var Oz=b((tK)=>{Object.defineProperty(tK,"__esModule",{value:!0});tK.validateTuple=void 0;var dK=l(),KX=d(),uT=X4(),RT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:v,it:D}=$;if(Array.isArray(v))return pK($,"additionalItems",v);if(D.items=!0,(0,KX.alwaysValidSchema)(D,v))return;$.ok((0,uT.validateArray)($))}};function pK($,v,D=$.schema){let{gen:X,parentSchema:U,data:G,keyword:J,it:Q}=$;if(z(U),Q.opts.unevaluated&&D.length&&Q.items!==!0)Q.items=KX.mergeEvaluated.items(X,D.length,Q.items);let I=X.name("valid"),W=X.const("len",dK._`${G}.length`);D.forEach((Y,B)=>{if((0,KX.alwaysValidSchema)(Q,Y))return;X.if(dK._`${W} > ${B}`,()=>$.subschema({keyword:J,schemaProp:B,dataProp:B},I)),$.ok(I)});function z(Y){let{opts:B,errSchemaPath:V}=Q,L=D.length,N=L===Y.minItems&&(L===Y.maxItems||Y[v]===!1);if(B.strictTuples&&!N){let Z=`"${J}" is ${L}-tuple, but minItems or maxItems/${v} are not specified or different at path "${V}"`;(0,KX.checkStrictMode)(Q,Z,B.strictTuples)}}}tK.validateTuple=pK;tK.default=RT});var eK=b((aK)=>{Object.defineProperty(aK,"__esModule",{value:!0});var CT=Oz(),xT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,CT.validateTuple)($,"items")};aK.default=xT});var vN=b(($N)=>{Object.defineProperty($N,"__esModule",{value:!0});var sK=l(),fT=d(),nT=X4(),_T=Zz(),yT={message:({params:{len:$}})=>sK.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>sK._`{limit: ${$}}`},lT={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:yT,code($){let{schema:v,parentSchema:D,it:X}=$,{prefixItems:U}=D;if(X.items=!0,(0,fT.alwaysValidSchema)(X,v))return;if(U)(0,_T.validateAdditionalItems)($,U);else $.ok((0,nT.validateArray)($))}};$N.default=lT});var DN=b((UN)=>{Object.defineProperty(UN,"__esModule",{value:!0});var G4=l(),NX=d(),mT={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}}`},rT={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:mT,code($){let{gen:v,schema:D,parentSchema:X,data:U,it:G}=$,J,Q,{minContains:I,maxContains:W}=X;if(G.opts.next)J=I===void 0?1:I,Q=W;else J=1;let z=v.const("len",G4._`${U}.length`);if($.setParams({min:J,max:Q}),Q===void 0&&J===0){(0,NX.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Q!==void 0&&J>Q){(0,NX.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,NX.alwaysValidSchema)(G,D)){let N=G4._`${z} >= ${J}`;if(Q!==void 0)N=G4._`${N} && ${z} <= ${Q}`;$.pass(N);return}G.items=!0;let Y=v.name("valid");if(Q===void 0&&J===1)V(Y,()=>v.if(Y,()=>v.break()));else if(J===0){if(v.let(Y,!0),Q!==void 0)v.if(G4._`${U}.length > 0`,B)}else v.let(Y,!1),B();$.result(Y,()=>$.reset());function B(){let N=v.name("_valid"),Z=v.let("count",0);V(N,()=>v.if(N,()=>L(Z)))}function V(N,Z){v.forRange("i",0,z,(H)=>{$.subschema({keyword:"contains",dataProp:H,dataPropType:NX.Type.Num,compositeRule:!0},N),Z()})}function L(N){if(v.code(G4._`${N}++`),Q===void 0)v.if(G4._`${N} >= ${J}`,()=>v.assign(Y,!0).break());else if(v.if(G4._`${N} > ${Q}`,()=>v.assign(Y,!1).break()),J===1)v.assign(Y,!0);else v.if(G4._`${N} >= ${J}`,()=>v.assign(Y,!0))}}};UN.default=rT});var WN=b((JN)=>{Object.defineProperty(JN,"__esModule",{value:!0});JN.validateSchemaDeps=JN.validatePropertyDeps=JN.error=void 0;var Az=l(),dT=d(),O0=X4();JN.error={message:({params:{property:$,depsCount:v,deps:D}})=>{let X=v===1?"property":"properties";return Az.str`must have ${X} ${D} when property ${$} is present`},params:({params:{property:$,depsCount:v,deps:D,missingProperty:X}})=>Az._`{property: ${$},
3
+ import{createRequire as hH}from"node:module";var CH=Object.create;var{getPrototypeOf:uH,defineProperty:sX,getOwnPropertyNames:xH}=Object;var fH=Object.prototype.hasOwnProperty;function _H($){return this[$]}var iH,yH,w7=($,v,D)=>{var X=$!=null&&typeof $==="object";if(X){var U=v?iH??=new WeakMap:yH??=new WeakMap,G=U.get($);if(G)return G}D=$!=null?CH(uH($)):{};let J=v||!$||!$.__esModule?sX(D,"default",{value:$,enumerable:!0}):D;for(let Q of xH($))if(!fH.call(J,Q))sX(J,Q,{get:_H.bind($,Q),enumerable:!0});if(X)U.set($,J);return J};var b=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var nH=($)=>$;function lH($,v){this[$]=nH.bind(null,v)}var C4=($,v)=>{for(var D in v)sX($,D,{get:v[D],enumerable:!0,configurable:!0,set:lH.bind(v,D)})};var mH=hH(import.meta.url);var $0=b((mV)=>{Object.defineProperty(mV,"__esModule",{value:!0});mV.regexpCode=mV.getEsmExportName=mV.getProperty=mV.safeStringify=mV.stringify=mV.strConcat=mV.addCodeArg=mV.str=mV._=mV.nil=mV._Code=mV.Name=mV.IDENTIFIER=mV._CodeOrName=void 0;class hD{}mV._CodeOrName=hD;mV.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class M1 extends hD{constructor($){super();if(!mV.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}}}mV.Name=M1;class V4 extends hD{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 M1)v[D.str]=(v[D.str]||0)+1;return v},{})}}mV._Code=V4;mV.nil=new V4("");function lV($,...v){let D=[$[0]],X=0;while(X<v.length)gz(D,v[X]),D.push($[++X]);return new V4(D)}mV._=lV;var Rz=new V4("+");function hV($,...v){let D=[sv($[0])],X=0;while(X<v.length)D.push(Rz),gz(D,v[X]),D.push(Rz,sv($[++X]));return PM(D),new V4(D)}mV.str=hV;function gz($,v){if(v instanceof V4)$.push(...v._items);else if(v instanceof M1)$.push(v);else $.push(SM(v))}mV.addCodeArg=gz;function PM($){let v=1;while(v<$.length-1){if($[v]===Rz){let D=bM($[v-1],$[v+1]);if(D!==void 0){$.splice(v-1,3,D);continue}$[v++]="+"}v++}}function bM($,v){if(v==='""')return $;if($==='""')return v;if(typeof $=="string"){if(v instanceof M1||$[$.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 M1))return`"${$}${v.slice(1)}`;return}function qM($,v){return v.emptyStr()?$:$.emptyStr()?v:hV`${$}${v}`}mV.strConcat=qM;function SM($){return typeof $=="number"||typeof $=="boolean"||$===null?$:sv(Array.isArray($)?$.join(","):$)}function kM($){return new V4(sv($))}mV.stringify=kM;function sv($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}mV.safeStringify=sv;function EM($){return typeof $=="string"&&mV.IDENTIFIER.test($)?new V4(`.${$}`):lV`[${$}]`}mV.getProperty=EM;function TM($){if(typeof $=="string"&&mV.IDENTIFIER.test($))return new V4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}mV.getEsmExportName=TM;function RM($){return new V4($.toString())}mV.regexpCode=RM});var fz=b((pV)=>{Object.defineProperty(pV,"__esModule",{value:!0});pV.ValueScope=pV.ValueScopeName=pV.Scope=pV.varKinds=pV.UsedValueState=void 0;var m$=$0();class rV extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var cD;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(cD||(pV.UsedValueState=cD={}));pV.varKinds={const:new m$.Name("const"),let:new m$.Name("let"),var:new m$.Name("var")};class uz{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}}}pV.Scope=uz;class xz extends m$.Name{constructor($,v){super(v);this.prefix=$}setValue($,{property:v,itemIndex:D}){this.value=$,this.scopePath=m$._`.${new m$.Name(v)}[${D}]`}}pV.ValueScopeName=xz;var cM=m$._`\n`;class dV extends uz{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?cM:m$.nil}}get(){return this._scope}name($){return new xz($,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,cD.Started);let z=v(W);if(z){let Y=this.opts.es5?pV.varKinds.var:pV.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 rV(W);Q.set(W,cD.Completed)})}return U}}pV.ValueScope=dV});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=$0(),K4=fz(),Y6=$0();Object.defineProperty(c$,"_",{enumerable:!0,get:function(){return Y6._}});Object.defineProperty(c$,"str",{enumerable:!0,get:function(){return Y6.str}});Object.defineProperty(c$,"strConcat",{enumerable:!0,get:function(){return Y6.strConcat}});Object.defineProperty(c$,"nil",{enumerable:!0,get:function(){return Y6.nil}});Object.defineProperty(c$,"getProperty",{enumerable:!0,get:function(){return Y6.getProperty}});Object.defineProperty(c$,"stringify",{enumerable:!0,get:function(){return Y6.stringify}});Object.defineProperty(c$,"regexpCode",{enumerable:!0,get:function(){return Y6.regexpCode}});Object.defineProperty(c$,"Name",{enumerable:!0,get:function(){return Y6.Name}});var aD=fz();Object.defineProperty(c$,"Scope",{enumerable:!0,get:function(){return aD.Scope}});Object.defineProperty(c$,"ValueScope",{enumerable:!0,get:function(){return aD.ValueScope}});Object.defineProperty(c$,"ValueScopeName",{enumerable:!0,get:function(){return aD.ValueScopeName}});Object.defineProperty(c$,"varKinds",{enumerable:!0,get:function(){return aD.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 I6{optimizeNodes(){return this}optimizeNames($,v){return this}}class oV extends I6{constructor($,v,D){super();this.varKind=$,this.name=v,this.rhs=D}render({es5:$,_n:v}){let D=$?K4.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=b1(this.rhs,$,v);return this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class yz extends I6{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=b1(this.rhs,$,v),this}get names(){let $=this.lhs instanceof r.Name?{}:{...this.lhs.names};return oD($,this.rhs)}}class aV extends yz{constructor($,v,D,X){super($,D,X);this.op=v}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class eV extends I6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class sV extends I6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class $K extends I6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class vK extends I6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,v){return this.code=b1(this.code,$,v),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class eD extends I6{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;tM($,U.names),D.splice(X,1)}return D.length>0?this:void 0}get names(){return this.nodes.reduce(($,v)=>S6($,v.names),{})}}class V6 extends eD{render($){return"{"+$._n+super.render($)+"}"+$._n}}class UK extends eD{}class v0 extends V6{}v0.kind="else";class h4 extends V6{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 v0(D):D}if(v){if($===!1)return v instanceof h4?v:v.nodes;if(this.nodes.length)return this;return new h4(QK($),v instanceof h4?[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=b1(this.condition,$,v),this}get names(){let $=super.names;if(oD($,this.condition),this.else)S6($,this.else.names);return $}}h4.kind="if";class P1 extends V6{}P1.kind="for";class DK extends P1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,v){if(!super.optimizeNames($,v))return;return this.iteration=b1(this.iteration,$,v),this}get names(){return S6(super.names,this.iteration.names)}}class XK extends P1{constructor($,v,D,X){super();this.varKind=$,this.name=v,this.from=D,this.to=X}render($){let v=$.es5?K4.varKinds.var:this.varKind,{name:D,from:X,to:U}=this;return`for(${v} ${D}=${X}; ${D}<${U}; ${D}++)`+super.render($)}get names(){let $=oD(super.names,this.from);return oD($,this.to)}}class _z extends P1{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=b1(this.iterable,$,v),this}get names(){return S6(super.names,this.iterable.names)}}class rD extends V6{constructor($,v,D){super();this.name=$,this.args=v,this.async=D}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}rD.kind="func";class dD extends eD{render($){return"return "+super.render($)}}dD.kind="return";class GK extends V6{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)S6($,this.catch.names);if(this.finally)S6($,this.finally.names);return $}}class pD extends V6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}pD.kind="catch";class tD extends V6{render($){return"finally"+super.render($)}}tD.kind="finally";class JK{constructor($,v={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...v,_n:v.lines?`
4
+ `:""},this._extScope=$,this._scope=new K4.Scope({parent:$}),this._nodes=[new UK]}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 oV($,U,D)),U}const($,v,D){return this._def(K4.varKinds.const,$,v,D)}let($,v,D){return this._def(K4.varKinds.let,$,v,D)}var($,v,D){return this._def(K4.varKinds.var,$,v,D)}assign($,v,D){return this._leafNode(new yz($,v,D))}add($,v){return this._leafNode(new aV($,c$.operators.ADD,v))}code($){if(typeof $=="function")$();else if($!==r.nil)this._leafNode(new vK($));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 h4($)),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 h4($))}else(){return this._elseNode(new v0)}endIf(){return this._endBlockNode(h4,v0)}_for($,v){if(this._blockNode($),v)this.code(v).endFor();return this}for($,v){return this._for(new DK($),v)}forRange($,v,D,X,U=this.opts.es5?K4.varKinds.var:K4.varKinds.let){let G=this._scope.toName($);return this._for(new XK(U,G,v,D),()=>X(G))}forOf($,v,D,X=K4.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 _z("of",X,U,v),()=>D(U))}forIn($,v,D,X=this.opts.es5?K4.varKinds.var:K4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,r._`Object.keys(${v})`,D);let U=this._scope.toName($);return this._for(new _z("in",X,U,v),()=>D(U))}endFor(){return this._endBlockNode(P1)}label($){return this._leafNode(new eV($))}break($){return this._leafNode(new sV($))}return($){let v=new dD;if(this._blockNode(v),this.code($),v.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(dD)}try($,v,D){if(!v&&!D)throw Error('CodeGen: "try" without "catch" and "finally"');let X=new GK;if(this._blockNode(X),this.code($),v){let U=this.name("e");this._currNode=X.catch=new pD(U),v(U)}if(D)this._currNode=X.finally=new tD,this.code(D);return this._endBlockNode(pD,tD)}throw($){return this._leafNode(new $K($))}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 rD($,v,D)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(rD)}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 h4))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=JK;function S6($,v){for(let D in v)$[D]=($[D]||0)+(v[D]||0);return $}function oD($,v){return v instanceof r._CodeOrName?S6($,v.names):$}function b1($,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 tM($,v){for(let D in v)$[D]=($[D]||0)-(v[D]||0)}function QK($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:r._`!${iz($)}`}c$.not=QK;var oM=WK(c$.operators.AND);function aM(...$){return $.reduce(oM)}c$.and=aM;var eM=WK(c$.operators.OR);function sM(...$){return $.reduce(eM)}c$.or=sM;function WK($){return(v,D)=>v===r.nil?D:D===r.nil?v:r._`${iz(v)} ${$} ${iz(D)}`}function iz($){return $ instanceof r.Name?$:r._`(${$})`}});var d=b((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});ZK.checkStrictMode=ZK.getErrorPath=ZK.Type=ZK.useFunc=ZK.setEvaluated=ZK.evaluatedPropsToName=ZK.mergeEvaluated=ZK.eachItem=ZK.unescapeJsonPointer=ZK.escapeJsonPointer=ZK.escapeFragment=ZK.unescapeFragment=ZK.schemaRefOrVal=ZK.schemaHasRulesButRef=ZK.schemaHasRules=ZK.checkUnknownRules=ZK.alwaysValidSchema=ZK.toHash=void 0;var Q$=l(),DP=$0();function XP($){let v={};for(let D of $)v[D]=!0;return v}ZK.toHash=XP;function GP($,v){if(typeof v=="boolean")return v;if(Object.keys(v).length===0)return!0;return VK($,v),!KK(v,$.self.RULES.all)}ZK.alwaysValidSchema=GP;function VK($,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])NK($,`unknown keyword: "${G}"`)}ZK.checkUnknownRules=VK;function KK($,v){if(typeof $=="boolean")return!$;for(let D in $)if(v[D])return!0;return!1}ZK.schemaHasRules=KK;function JP($,v){if(typeof $=="boolean")return!$;for(let D in $)if(D!=="$ref"&&v.all[D])return!0;return!1}ZK.schemaHasRulesButRef=JP;function QP({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)}`}ZK.schemaRefOrVal=QP;function WP($){return LK(decodeURIComponent($))}ZK.unescapeFragment=WP;function zP($){return encodeURIComponent(lz($))}ZK.escapeFragment=zP;function lz($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}ZK.escapeJsonPointer=lz;function LK($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}ZK.unescapeJsonPointer=LK;function YP($,v){if(Array.isArray($))for(let D of $)v(D);else v($)}ZK.eachItem=YP;function YK({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}}ZK.mergeEvaluated={props:YK({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} || {}`),hz($,D,v)}),mergeValues:($,v)=>$===!0?!0:{...$,...v},resultToName:BK}),items:YK({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 BK($,v){if(v===!0)return $.var("props",!0);let D=$.var("props",Q$._`{}`);if(v!==void 0)hz($,D,v);return D}ZK.evaluatedPropsToName=BK;function hz($,v,D){Object.keys(D).forEach((X)=>$.assign(Q$._`${v}${(0,Q$.getProperty)(X)}`,!0))}ZK.setEvaluated=hz;var IK={};function IP($,v){return $.scopeValue("func",{ref:v,code:IK[v.code]||(IK[v.code]=new DP._Code(v.code))})}ZK.useFunc=IP;var nz;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(nz||(ZK.Type=nz={}));function VP($,v,D){if($ instanceof Q$.Name){let X=v===nz.Num;return D?X?Q$._`"[" + ${$} + "]"`:Q$._`"['" + ${$} + "']"`:X?Q$._`"/" + ${$}`:Q$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return D?(0,Q$.getProperty)($).toString():"/"+lz($)}ZK.getErrorPath=VP;function NK($,v,D=$.opts.strictSchema){if(!D)return;if(v=`strict mode: ${v}`,D===!0)throw Error(v);$.self.logger.warn(v)}ZK.checkStrictMode=NK});var m4=b((HK)=>{Object.defineProperty(HK,"__esModule",{value:!0});var T$=l(),EP={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")};HK.default=EP});var U0=b((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});wK.extendErrors=wK.resetErrorsCount=wK.reportExtraError=wK.reportError=wK.keyword$DataError=wK.keywordError=void 0;var p=l(),$X=d(),_$=m4();wK.keywordError={message:({keyword:$})=>p.str`must pass "${$}" keyword validation`};wK.keyword$DataError={message:({keyword:$,schemaType:v})=>v?p.str`"${$}" keyword must be ${v} ($data)`:p.str`"${$}" keyword is invalid ($data)`};function RP($,v=wK.keywordError,D,X){let{it:U}=$,{gen:G,compositeRule:J,allErrors:Q}=U,W=AK($,v,D);if(X!==null&&X!==void 0?X:J||Q)FK(G,W);else jK(U,p._`[${W}]`)}wK.reportError=RP;function gP($,v=wK.keywordError,D){let{it:X}=$,{gen:U,compositeRule:G,allErrors:J}=X,Q=AK($,v,D);if(FK(U,Q),!(G||J))jK(X,_$.default.vErrors)}wK.reportExtraError=gP;function CP($,v){$.assign(_$.default.errors,v),$.if(p._`${_$.default.vErrors} !== null`,()=>$.if(v,()=>$.assign(p._`${_$.default.vErrors}.length`,v),()=>$.assign(_$.default.vErrors,null)))}wK.resetErrorsCount=CP;function uP({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)})}wK.extendErrors=uP;function FK($,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 jK($,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 k6={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 AK($,v,D){let{createErrors:X}=$.it;if(X===!1)return p._`{}`;return xP($,v,D)}function xP($,v,D={}){let{gen:X,it:U}=$,G=[fP(U,D),_P($,D)];return iP($,v,G),X.object(...G)}function fP({errorPath:$},{instancePath:v}){let D=v?p.str`${$}${(0,$X.getErrorPath)(v,$X.Type.Str)}`:$;return[_$.default.instancePath,(0,p.strConcat)(_$.default.instancePath,D)]}function _P({keyword:$,it:{errSchemaPath:v}},{schemaPath:D,parentSchema:X}){let U=X?v:p.str`${v}/${$}`;if(D)U=p.str`${U}${(0,$X.getErrorPath)(D,$X.Type.Str)}`;return[k6.schemaPath,U]}function iP($,{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([k6.keyword,U],[k6.params,typeof v=="function"?v($):v||p._`{}`]),W.messages)X.push([k6.message,typeof D=="function"?D($):D]);if(W.verbose)X.push([k6.schema,J],[k6.parentSchema,p._`${Y}${I}`],[_$.default.data,G]);if(z)X.push([k6.propertyName,z])}});var SK=b((bK)=>{Object.defineProperty(bK,"__esModule",{value:!0});bK.boolOrEmptySchema=bK.topBoolOrEmptySchema=void 0;var mP=U0(),cP=l(),rP=m4(),dP={message:"boolean schema is false"};function pP($){let{gen:v,schema:D,validateName:X}=$;if(D===!1)PK($,!1);else if(typeof D=="object"&&D.$async===!0)v.return(rP.default.data);else v.assign(cP._`${X}.errors`,null),v.return(!0)}bK.topBoolOrEmptySchema=pP;function tP($,v){let{gen:D,schema:X}=$;if(X===!1)D.var(v,!1),PK($);else D.var(v,!0)}bK.boolOrEmptySchema=tP;function PK($,v){let{gen:D,data:X}=$,U={gen:D,keyword:"false schema",data:X,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,mP.reportError)(U,dP,void 0,v)}});var cz=b((kK)=>{Object.defineProperty(kK,"__esModule",{value:!0});kK.getRules=kK.isJSONType=void 0;var aP=["string","number","integer","boolean","null","object","array"],eP=new Set(aP);function sP($){return typeof $=="string"&&eP.has($)}kK.isJSONType=sP;function $b(){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:{}}}kK.getRules=$b});var rz=b((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});gK.shouldUseRule=gK.shouldUseGroup=gK.schemaHasRulesForType=void 0;function Ub({schema:$,self:v},D){let X=v.RULES.types[D];return X&&X!==!0&&TK($,X)}gK.schemaHasRulesForType=Ub;function TK($,v){return v.rules.some((D)=>RK($,D))}gK.shouldUseGroup=TK;function RK($,v){var D;return $[v.keyword]!==void 0||((D=v.definition.implements)===null||D===void 0?void 0:D.some((X)=>$[X]!==void 0))}gK.shouldUseRule=RK});var D0=b((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});_K.reportTypeError=_K.checkDataTypes=_K.checkDataType=_K.coerceAndCheckDataType=_K.getJSONTypes=_K.getSchemaTypes=_K.DataType=void 0;var Gb=cz(),Jb=rz(),Qb=U0(),n=l(),uK=d(),q1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(q1||(_K.DataType=q1={}));function Wb($){let v=xK($.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}_K.getSchemaTypes=Wb;function xK($){let v=Array.isArray($)?$:$?[$]:[];if(v.every(Gb.isJSONType))return v;throw Error("type must be JSONType or JSONType[]: "+v.join(","))}_K.getJSONTypes=xK;function zb($,v){let{gen:D,data:X,opts:U}=$,G=Yb(v,U.coerceTypes),J=v.length>0&&!(G.length===0&&v.length===1&&(0,Jb.schemaHasRulesForType)($,v[0]));if(J){let Q=pz(v,X,U.strictNumbers,q1.Wrong);D.if(Q,()=>{if(G.length)Ib($,v,G);else tz($)})}return J}_K.coerceAndCheckDataType=zb;var fK=new Set(["string","number","integer","boolean","null"]);function Yb($,v){return v?$.filter((D)=>fK.has(D)||v==="array"&&D==="array"):[]}function Ib($,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(pz(v,U,G.strictNumbers),()=>X.assign(Q,U)));X.if(n._`${Q} !== undefined`);for(let z of D)if(fK.has(z)||z==="array"&&G.coerceTypes==="array")W(z);X.else(),tz($),X.endIf(),X.if(n._`${Q} !== undefined`,()=>{X.assign(U,Q),Vb($,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 Vb({gen:$,parentData:v,parentDataProperty:D},X){$.if(n._`${v} !== undefined`,()=>$.assign(n._`${v}[${D}]`,X))}function dz($,v,D,X=q1.Correct){let U=X===q1.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===q1.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)}}_K.checkDataType=dz;function pz($,v,D,X){if($.length===1)return dz($[0],v,D,X);let U,G=(0,uK.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,dz(J,v,D,X));return U}_K.checkDataTypes=pz;var Kb={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:v})=>typeof $=="string"?n._`{type: ${$}}`:n._`{type: ${v}}`};function tz($){let v=Lb($);(0,Qb.reportError)(v,Kb)}_K.reportTypeError=tz;function Lb($){let{gen:v,data:D,schema:X}=$,U=(0,uK.schemaRefOrVal)($,X,"type");return{gen:v,keyword:"type",data:D,schema:X.type,schemaCode:U,schemaValue:U,parentSchema:X,params:{},it:$}}});var hK=b((nK)=>{Object.defineProperty(nK,"__esModule",{value:!0});nK.assignDefaults=void 0;var S1=l(),jb=d();function Ab($,v){let{properties:D,items:X}=$.schema;if(v==="object"&&D)for(let U in D)yK($,U,D[U].default);else if(v==="array"&&Array.isArray(X))X.forEach((U,G)=>yK($,G,U.default))}nK.assignDefaults=Ab;function yK($,v,D){let{gen:X,compositeRule:U,data:G,opts:J}=$;if(D===void 0)return;let Q=S1._`${G}${(0,S1.getProperty)(v)}`;if(U){(0,jb.checkStrictMode)($,`default is ignored for: ${Q}`);return}let W=S1._`${Q} === undefined`;if(J.useDefaults==="empty")W=S1._`${W} || ${Q} === null || ${Q} === ""`;X.if(W,S1._`${Q} = ${(0,S1.stringify)(D)}`)}});var X4=b((rK)=>{Object.defineProperty(rK,"__esModule",{value:!0});rK.validateUnion=rK.validateArray=rK.usePattern=rK.callValidateCode=rK.schemaProperties=rK.allSchemaProperties=rK.noPropertyInData=rK.propertyInData=rK.isOwnProperty=rK.hasPropFunc=rK.reportMissingProp=rK.checkMissingProp=rK.checkReportMissingProp=void 0;var W$=l(),oz=d(),K6=m4(),wb=d();function Mb($,v){let{gen:D,data:X,it:U}=$;D.if(ez(D,X,v,U.opts.ownProperties),()=>{$.setParams({missingProperty:W$._`${v}`},!0),$.error()})}rK.checkReportMissingProp=Mb;function Pb({gen:$,data:v,it:{opts:D}},X,U){return(0,W$.or)(...X.map((G)=>(0,W$.and)(ez($,v,G,D.ownProperties),W$._`${U} = ${G}`)))}rK.checkMissingProp=Pb;function bb($,v){$.setParams({missingProperty:v},!0),$.error()}rK.reportMissingProp=bb;function mK($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:W$._`Object.prototype.hasOwnProperty`})}rK.hasPropFunc=mK;function az($,v,D){return W$._`${mK($)}.call(${v}, ${D})`}rK.isOwnProperty=az;function qb($,v,D,X){let U=W$._`${v}${(0,W$.getProperty)(D)} !== undefined`;return X?W$._`${U} && ${az($,v,D)}`:U}rK.propertyInData=qb;function ez($,v,D,X){let U=W$._`${v}${(0,W$.getProperty)(D)} === undefined`;return X?(0,W$.or)(U,(0,W$.not)(az($,v,D))):U}rK.noPropertyInData=ez;function cK($){return $?Object.keys($).filter((v)=>v!=="__proto__"):[]}rK.allSchemaProperties=cK;function Sb($,v){return cK(v).filter((D)=>!(0,oz.alwaysValidSchema)($,v[D]))}rK.schemaProperties=Sb;function kb({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=[[K6.default.instancePath,(0,W$.strConcat)(K6.default.instancePath,G)],[K6.default.parentData,J.parentData],[K6.default.parentDataProperty,J.parentDataProperty],[K6.default.rootData,K6.default.rootData]];if(J.opts.dynamicRef)I.push([K6.default.dynamicAnchors,K6.default.dynamicAnchors]);let V=W$._`${Y}, ${D.object(...I)}`;return W!==W$.nil?W$._`${Q}.call(${W}, ${V})`:W$._`${Q}(${V})`}rK.callValidateCode=kb;var Eb=W$._`new RegExp`;function Tb({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"?Eb:(0,wb.useFunc)($,U)}(${D}, ${X})`})}rK.usePattern=Tb;function Rb($){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:oz.Type.Num},G),v.if((0,W$.not)(G),Q)})}}rK.validateArray=Rb;function gb($){let{gen:v,schema:D,keyword:X,it:U}=$;if(!Array.isArray(D))throw Error("ajv implementation error");if(D.some((W)=>(0,oz.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))}rK.validateUnion=gb});var eK=b((oK)=>{Object.defineProperty(oK,"__esModule",{value:!0});oK.validateKeywordUsage=oK.validSchemaType=oK.funcKeywordCode=oK.macroKeywordCode=void 0;var i$=l(),E6=m4(),rb=X4(),db=U0();function pb($,v){let{gen:D,keyword:X,schema:U,parentSchema:G,it:J}=$,Q=v.macro.call(J.self,U,G,J),W=tK(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))}oK.macroKeywordCode=pb;function tb($,v){var D;let{gen:X,keyword:U,schema:G,parentSchema:J,$data:Q,it:W}=$;ab(W,v);let z=!Q&&v.compile?v.compile.call(W.self,G,J,W):v.validate,Y=tK(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)pK($);Z(()=>$.error())}else{let F=v.async?K():L();if(v.modifying)pK($);Z(()=>ob($,F))}}function K(){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?E6.default.this:E6.default.self,g=!(("compile"in v)&&!Q||v.schema===!1);X.assign(I,i$._`${F}${(0,rb.callValidateCode)($,Y,S,g)}`,v.modifying)}function Z(F){var S;X.if((0,i$.not)((S=v.valid)!==null&&S!==void 0?S:I),F)}}oK.funcKeywordCode=tb;function pK($){let{gen:v,data:D,it:X}=$;v.if(X.parentData,()=>v.assign(D,i$._`${X.parentData}[${X.parentDataProperty}]`))}function ob($,v){let{gen:D}=$;D.if(i$._`Array.isArray(${v})`,()=>{D.assign(E6.default.vErrors,i$._`${E6.default.vErrors} === null ? ${v} : ${E6.default.vErrors}.concat(${v})`).assign(E6.default.errors,i$._`${E6.default.vErrors}.length`),(0,db.extendErrors)($)},()=>$.error())}function ab({schemaEnv:$},v){if(v.async&&!$.$async)throw Error("async keyword in sync schema")}function tK($,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")}oK.validSchemaType=eb;function sb({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)}}}oK.validateKeywordUsage=sb});var UL=b(($L)=>{Object.defineProperty($L,"__esModule",{value:!0});$L.extendSubschemaMode=$L.extendSubschemaData=$L.getSubschema=void 0;var k4=l(),sK=d();function Dq($,{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:k4._`${$.schemaPath}${(0,k4.getProperty)(v)}`,errSchemaPath:`${$.errSchemaPath}/${v}`}:{schema:Q[D],schemaPath:k4._`${$.schemaPath}${(0,k4.getProperty)(v)}${(0,k4.getProperty)(D)}`,errSchemaPath:`${$.errSchemaPath}/${v}/${(0,sK.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')}$L.getSubschema=Dq;function Xq($,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",k4._`${v.data}${(0,k4.getProperty)(D)}`,!0);W(V),$.errorPath=k4.str`${z}${(0,sK.getErrorPath)(D,X,I.jsPropertySyntax)}`,$.parentDataProperty=k4._`${D}`,$.dataPathArr=[...Y,$.parentDataProperty]}if(U!==void 0){let z=U instanceof k4.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]}}$L.extendSubschemaData=Xq;function Gq($,{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}$L.extendSubschemaMode=Gq});var sz=b((Zr,DL)=>{DL.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 GL=b((Or,XL)=>{var L6=XL.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(){};vX(v,X,U,$,"",$)};L6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};L6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};L6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};L6.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 vX($,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 L6.arrayKeywords)for(var V=0;V<I.length;V++)vX($,v,D,I[V],U+"/"+Y+"/"+V,G,U,Y,X,V)}else if(Y in L6.propsKeywords){if(I&&typeof I=="object")for(var K in I)vX($,v,D,I[K],U+"/"+Y+"/"+Wq(K),G,U,Y,X,K)}else if(Y in L6.keywords||$.allKeys&&!(Y in L6.skipKeywords))vX($,v,D,I,U+"/"+Y,G,U,Y,X)}D(X,U,G,J,Q,W,z)}}function Wq($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var X0=b((zL)=>{Object.defineProperty(zL,"__esModule",{value:!0});zL.getSchemaRefs=zL.resolveUrl=zL.normalizeId=zL._getFullPath=zL.getFullPath=zL.inlineRef=void 0;var zq=d(),Yq=sz(),Iq=GL(),Vq=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Kq($,v=!0){if(typeof $=="boolean")return!0;if(v===!0)return!$5($);if(!v)return!1;return JL($)<=v}zL.inlineRef=Kq;var Lq=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function $5($){for(let v in $){if(Lq.has(v))return!0;let D=$[v];if(Array.isArray(D)&&D.some($5))return!0;if(typeof D=="object"&&$5(D))return!0}return!1}function JL($){let v=0;for(let D in $){if(D==="$ref")return 1/0;if(v++,Vq.has(D))continue;if(typeof $[D]=="object")(0,zq.eachItem)($[D],(X)=>v+=JL(X));if(v===1/0)return 1/0}return v}function QL($,v="",D){if(D!==!1)v=k1(v);let X=$.parse(v);return WL($,X)}zL.getFullPath=QL;function WL($,v){return $.serialize(v).split("#")[0]+"#"}zL._getFullPath=WL;var Bq=/#\/?$/;function k1($){return $?$.replace(Bq,""):""}zL.normalizeId=k1;function Nq($,v,D){return D=k1(D),$.resolve(v,D)}zL.resolveUrl=Nq;var Zq=/^[a-z_][-a-z0-9._]*$/i;function Oq($,v){if(typeof $=="boolean")return{};let{schemaId:D,uriResolver:X}=this.opts,U=k1($[D]||v),G={"":U},J=QL(X,U,!1),Q={},W=new Set;return Iq($,{allKeys:!0},(I,V,K,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(g){let u=this.opts.uriResolver.resolve;if(g=k1(Z?u(Z,g):g),W.has(g))throw Y(g);W.add(g);let k=this.refs[g];if(typeof k=="string")k=this.refs[k];if(typeof k=="object")z(I,k.schema,g);else if(g!==k1(N))if(g[0]==="#")z(I,Q[g],g),Q[g]=I;else this.refs[g]=N;return g}function S(g){if(typeof g=="string"){if(!Zq.test(g))throw Error(`invalid anchor "${g}"`);F.call(this,`#${g}`)}}}),Q;function z(I,V,K){if(V!==void 0&&!Yq(I,V))throw Y(K)}function Y(I){return Error(`reference "${I}" resolves to more than one schema`)}}zL.getSchemaRefs=Oq});var Q0=b((PL)=>{Object.defineProperty(PL,"__esModule",{value:!0});PL.getData=PL.KeywordCxt=PL.validateFunctionCode=void 0;var BL=SK(),IL=D0(),U5=rz(),UX=D0(),Mq=hK(),J0=eK(),v5=UL(),C=l(),i=m4(),Pq=X0(),c4=d(),G0=U0();function bq($){if(OL($)){if(HL($),ZL($)){kq($);return}}NL($,()=>(0,BL.topBoolOrEmptySchema)($))}PL.validateFunctionCode=bq;function NL({gen:$,validateName:v,schema:D,schemaEnv:X,opts:U},G){if(U.code.es5)$.func(v,C._`${i.default.data}, ${i.default.valCxt}`,X.$async,()=>{$.code(C._`"use strict"; ${VL(D,U)}`),Sq($,U),$.code(G)});else $.func(v,C._`${i.default.data}, ${qq(U)}`,X.$async,()=>$.code(VL(D,U)).code(G))}function qq($){return C._`{${i.default.instancePath}="", ${i.default.parentData}, ${i.default.parentDataProperty}, ${i.default.rootData}=${i.default.data}${$.dynamicRef?C._`, ${i.default.dynamicAnchors}={}`:C.nil}}={}`}function Sq($,v){$.if(i.default.valCxt,()=>{if($.var(i.default.instancePath,C._`${i.default.valCxt}.${i.default.instancePath}`),$.var(i.default.parentData,C._`${i.default.valCxt}.${i.default.parentData}`),$.var(i.default.parentDataProperty,C._`${i.default.valCxt}.${i.default.parentDataProperty}`),$.var(i.default.rootData,C._`${i.default.valCxt}.${i.default.rootData}`),v.dynamicRef)$.var(i.default.dynamicAnchors,C._`${i.default.valCxt}.${i.default.dynamicAnchors}`)},()=>{if($.var(i.default.instancePath,C._`""`),$.var(i.default.parentData,C._`undefined`),$.var(i.default.parentDataProperty,C._`undefined`),$.var(i.default.rootData,i.default.data),v.dynamicRef)$.var(i.default.dynamicAnchors,C._`{}`)})}function kq($){let{schema:v,opts:D,gen:X}=$;NL($,()=>{if(D.$comment&&v.$comment)jL($);if(Cq($),X.let(i.default.vErrors,null),X.let(i.default.errors,0),D.unevaluated)Eq($);FL($),fq($)});return}function Eq($){let{gen:v,validateName:D}=$;$.evaluated=v.const("evaluated",C._`${D}.evaluated`),v.if(C._`${$.evaluated}.dynamicProps`,()=>v.assign(C._`${$.evaluated}.props`,C._`undefined`)),v.if(C._`${$.evaluated}.dynamicItems`,()=>v.assign(C._`${$.evaluated}.items`,C._`undefined`))}function VL($,v){let D=typeof $=="object"&&$[v.schemaId];return D&&(v.code.source||v.code.process)?C._`/*# sourceURL=${D} */`:C.nil}function Tq($,v){if(OL($)){if(HL($),ZL($)){Rq($,v);return}}(0,BL.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 OL($){return typeof $.schema!="boolean"}function Rq($,v){let{schema:D,gen:X,opts:U}=$;if(U.$comment&&D.$comment)jL($);uq($),xq($);let G=X.const("_errs",i.default.errors);FL($,G),X.var(v,C._`${G} === ${i.default.errors}`)}function HL($){(0,c4.checkUnknownRules)($),gq($)}function FL($,v){if($.opts.jtd)return KL($,[],!1,v);let D=(0,IL.getSchemaTypes)($.schema),X=(0,IL.coerceAndCheckDataType)($,D);KL($,D,!X,v)}function gq($){let{schema:v,errSchemaPath:D,opts:X,self:U}=$;if(v.$ref&&X.ignoreKeywordsWithRef&&(0,c4.schemaHasRulesButRef)(v,U.RULES))U.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function Cq($){let{schema:v,opts:D}=$;if(v.default!==void 0&&D.useDefaults&&D.strictSchema)(0,c4.checkStrictMode)($,"default is ignored in the schema root")}function uq($){let v=$.schema[$.opts.schemaId];if(v)$.baseId=(0,Pq.resolveUrl)($.opts.uriResolver,$.baseId,v)}function xq($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function jL({gen:$,schemaEnv:v,schema:D,errSchemaPath:X,opts:U}){let G=D.$comment;if(U.$comment===!0)$.code(C._`${i.default.self}.logger.log(${G})`);else if(typeof U.$comment=="function"){let J=C.str`${X}/$comment`,Q=$.scopeValue("root",{ref:v.root});$.code(C._`${i.default.self}.opts.$comment(${G}, ${J}, ${Q}.schema)`)}}function fq($){let{gen:v,schemaEnv:D,validateName:X,ValidationError:U,opts:G}=$;if(D.$async)v.if(C._`${i.default.errors} === 0`,()=>v.return(i.default.data),()=>v.throw(C._`new ${U}(${i.default.vErrors})`));else{if(v.assign(C._`${X}.errors`,i.default.vErrors),G.unevaluated)_q($);v.return(C._`${i.default.errors} === 0`)}}function _q({gen:$,evaluated:v,props:D,items:X}){if(D instanceof C.Name)$.assign(C._`${v}.props`,D);if(X instanceof C.Name)$.assign(C._`${v}.items`,X)}function KL($,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,c4.schemaHasRulesButRef)(G,Y))){U.block(()=>wL($,"$ref",Y.all.$ref.definition));return}if(!W.jtd)iq($,v);U.block(()=>{for(let V of Y.rules)I(V);I(Y.post)});function I(V){if(!(0,U5.shouldUseGroup)(G,V))return;if(V.type){if(U.if((0,UX.checkDataType)(V.type,J,W.strictNumbers)),LL($,V),v.length===1&&v[0]===V.type&&D)U.else(),(0,UX.reportTypeError)($);U.endIf()}else LL($,V);if(!Q)U.if(C._`${i.default.errors} === ${X||0}`)}}function LL($,v){let{gen:D,schema:X,opts:{useDefaults:U}}=$;if(U)(0,Mq.assignDefaults)($,v.type);D.block(()=>{for(let G of v.rules)if((0,U5.shouldUseRule)(X,G))wL($,G.keyword,G.definition,v.type)})}function iq($,v){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(yq($,v),!$.opts.allowUnionTypes)nq($,v);lq($,$.dataTypes)}function yq($,v){if(!v.length)return;if(!$.dataTypes.length){$.dataTypes=v;return}v.forEach((D)=>{if(!AL($.dataTypes,D))D5($,`type "${D}" not allowed by context "${$.dataTypes.join(",")}"`)}),mq($,v)}function nq($,v){if(v.length>1&&!(v.length===2&&v.includes("null")))D5($,"use allowUnionTypes to allow union type keyword")}function lq($,v){let D=$.self.RULES.all;for(let X in D){let U=D[X];if(typeof U=="object"&&(0,U5.shouldUseRule)($.schema,U)){let{type:G}=U.definition;if(G.length&&!G.some((J)=>hq(v,J)))D5($,`missing type "${G.join(",")}" for keyword "${X}"`)}}}function hq($,v){return $.includes(v)||v==="number"&&$.includes("integer")}function AL($,v){return $.includes(v)||v==="integer"&&$.includes("number")}function mq($,v){let D=[];for(let X of $.dataTypes)if(AL(v,X))D.push(X);else if(v.includes("integer")&&X==="number")D.push("integer");$.dataTypes=D}function D5($,v){let D=$.schemaEnv.baseId+$.errSchemaPath;v+=` at "${D}" (strictTypes)`,(0,c4.checkStrictMode)($,v,$.opts.strictTypes)}class X5{constructor($,v,D){if((0,J0.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,c4.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",ML(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,J0.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",i.default.errors)}result($,v,D){this.failResult((0,C.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,C.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(C._`${v} !== undefined && (${(0,C.or)(this.invalid$data(),$)})`)}error($,v,D){if(v){this.setParams(v),this._error($,D),this.setParams({});return}this._error($,D)}_error($,v){($?G0.reportExtraError:G0.reportError)(this,this.def.error,v)}$dataError(){(0,G0.reportError)(this,this.def.$dataError||G0.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,G0.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=C.nil){this.gen.block(()=>{this.check$data($,D),v()})}check$data($=C.nil,v=C.nil){if(!this.$data)return;let{gen:D,schemaCode:X,schemaType:U,def:G}=this;if(D.if((0,C.or)(C._`${X} === undefined`,v)),$!==C.nil)D.assign($,!0);if(U.length||G.validateSchema){if(D.elseIf(this.invalid$data()),this.$dataError(),$!==C.nil)D.assign($,!1)}D.else()}invalid$data(){let{gen:$,schemaCode:v,schemaType:D,def:X,it:U}=this;return(0,C.or)(G(),J());function G(){if(D.length){if(!(v instanceof C.Name))throw Error("ajv implementation error");let Q=Array.isArray(D)?D:[D];return C._`${(0,UX.checkDataTypes)(Q,v,U.opts.strictNumbers,UX.DataType.Wrong)}`}return C.nil}function J(){if(X.validateSchema){let Q=$.scopeValue("validate$data",{ref:X.validateSchema});return C._`!${Q}(${v})`}return C.nil}}subschema($,v){let D=(0,v5.getSubschema)(this.it,$);(0,v5.extendSubschemaData)(D,this.it,$),(0,v5.extendSubschemaMode)(D,$);let X={...this.it,...D,items:void 0,props:void 0};return Tq(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=c4.mergeEvaluated.props(X,$.props,D.props,v);if(D.items!==!0&&$.items!==void 0)D.items=c4.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($,C.Name)),!0}}PL.KeywordCxt=X5;function wL($,v,D,X){let U=new X5($,D,v);if("code"in D)D.code(U,X);else if(U.$data&&D.validate)(0,J0.funcKeywordCode)(U,D);else if("macro"in D)(0,J0.macroKeywordCode)(U,D);else if(D.compile||D.validate)(0,J0.funcKeywordCode)(U,D)}var cq=/^\/(?:[^~]|~0|~1)*$/,rq=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ML($,{dataLevel:v,dataNames:D,dataPathArr:X}){let U,G;if($==="")return i.default.rootData;if($[0]==="/"){if(!cq.test($))throw Error(`Invalid JSON-pointer: ${$}`);U=$,G=i.default.rootData}else{let z=rq.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=C._`${G}${(0,C.getProperty)((0,c4.unescapeJsonPointer)(z))}`,J=C._`${J} && ${G}`;return J;function W(z,Y){return`Cannot access ${z} ${Y} levels up, current level is ${v}`}}PL.getData=ML});var DX=b((SL)=>{Object.defineProperty(SL,"__esModule",{value:!0});class qL extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}SL.default=qL});var W0=b((EL)=>{Object.defineProperty(EL,"__esModule",{value:!0});var G5=X0();class kL extends Error{constructor($,v,D,X){super(X||`can't resolve reference ${D} from id ${v}`);this.missingRef=(0,G5.resolveUrl)($,v,D),this.missingSchema=(0,G5.normalizeId)((0,G5.getFullPath)($,this.missingRef))}}EL.default=kL});var GX=b((gL)=>{Object.defineProperty(gL,"__esModule",{value:!0});gL.resolveSchema=gL.getCompilingSchema=gL.resolveRef=gL.compileSchema=gL.SchemaEnv=void 0;var L4=l(),aq=DX(),T6=m4(),B4=X0(),TL=d(),eq=Q0();class z0{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,B4.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={}}}gL.SchemaEnv=z0;function Q5($){let v=RL.call(this,$);if(v)return v;let D=(0,B4.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:X,lines:U}=this.opts.code,{ownProperties:G}=this.opts,J=new L4.CodeGen(this.scope,{es5:X,lines:U,ownProperties:G}),Q;if($.$async)Q=J.scopeValue("Error",{ref:aq.default,code:L4._`require("ajv/dist/runtime/validation_error").default`});let W=J.scopeName("validate");$.validateName=W;let z={gen:J,allErrors:this.opts.allErrors,data:T6.default.data,parentData:T6.default.parentData,parentDataProperty:T6.default.parentDataProperty,dataNames:[T6.default.data],dataPathArr:[L4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:J.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,L4.stringify)($.schema)}:{ref:$.schema}),validateName:W,ValidationError:Q,schema:$.schema,schemaEnv:$,rootId:D,baseId:$.baseId||D,schemaPath:L4.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:L4._`""`,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(T6.default.scope)}return ${I}`,this.opts.code.process)Y=this.opts.code.process(Y,$);let K=Function(`${T6.default.self}`,`${T6.default.scope}`,Y)(this,this.scope.get());if(this.scope.value(W,{ref:K}),K.errors=null,K.schema=$.schema,K.schemaEnv=$,$.$async)K.$async=!0;if(this.opts.code.source===!0)K.source={validateName:W,validateCode:I,scopeValues:J._values};if(this.opts.unevaluated){let{props:L,items:N}=z;if(K.evaluated={props:L instanceof L4.Name?void 0:L,items:N instanceof L4.Name?void 0:N,dynamicProps:L instanceof L4.Name,dynamicItems:N instanceof L4.Name},K.source)K.source.evaluated=(0,L4.stringify)(K.evaluated)}return $.validate=K,$}catch(I){if(delete $.validate,delete $.validateName,Y)this.logger.error("Error compiling schema, function code:",Y);throw I}finally{this._compilations.delete($)}}gL.compileSchema=Q5;function sq($,v,D){var X;D=(0,B4.resolveUrl)(this.opts.uriResolver,v,D);let U=$.refs[D];if(U)return U;let G=US.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 z0({schema:J,schemaId:Q,root:$,baseId:v})}if(G===void 0)return;return $.refs[D]=$S.call(this,G)}gL.resolveRef=sq;function $S($){if((0,B4.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:Q5.call(this,$)}function RL($){for(let v of this._compilations)if(vS(v,$))return v}gL.getCompilingSchema=RL;function vS($,v){return $.schema===v.schema&&$.root===v.root&&$.baseId===v.baseId}function US($,v){let D;while(typeof(D=this.refs[v])=="string")v=D;return D||this.schemas[v]||XX.call(this,$,v)}function XX($,v){let D=this.opts.uriResolver.parse(v),X=(0,B4._getFullPath)(this.opts.uriResolver,D),U=(0,B4.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&X===U)return J5.call(this,D,$);let G=(0,B4.normalizeId)(X),J=this.refs[G]||this.schemas[G];if(typeof J=="string"){let Q=XX.call(this,$,J);if(typeof(Q===null||Q===void 0?void 0:Q.schema)!=="object")return;return J5.call(this,D,Q)}if(typeof(J===null||J===void 0?void 0:J.schema)!=="object")return;if(!J.validate)Q5.call(this,J);if(G===(0,B4.normalizeId)(v)){let{schema:Q}=J,{schemaId:W}=this.opts,z=Q[W];if(z)U=(0,B4.resolveUrl)(this.opts.uriResolver,U,z);return new z0({schema:Q,schemaId:W,root:$,baseId:U})}return J5.call(this,D,J)}gL.resolveSchema=XX;var DS=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function J5($,{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,TL.unescapeFragment)(Q)];if(W===void 0)return;D=W;let z=typeof D==="object"&&D[this.opts.schemaId];if(!DS.has(Q)&&z)v=(0,B4.resolveUrl)(this.opts.uriResolver,v,z)}let G;if(typeof D!="boolean"&&D.$ref&&!(0,TL.schemaHasRulesButRef)(D,this.RULES)){let Q=(0,B4.resolveUrl)(this.opts.uriResolver,v,D.$ref);G=XX.call(this,X,Q)}let{schemaId:J}=this.opts;if(G=G||new z0({schema:D,schemaId:J,root:X,baseId:v}),G.schema!==G.root.schema)return G;return}});var uL=b((Mr,WS)=>{WS.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 Y5=b((Pr,nL)=>{var zS=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),fL=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),W5=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),_L=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),YS=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function z5($){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 IS=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function xL($){return $.length=0,!0}function VS($,v,D){if($.length){let X=z5($);if(X!=="")v.push(X);else return D.error=!0,!1;$.length=0}return!0}function KS($){let v=0,D={error:!1,address:"",zone:""},X=[],U=[],G=!1,J=!1,Q=VS;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=xL}else{U.push(z);continue}}if(U.length)if(Q===xL)D.zone=U.join("");else if(J)X.push(U.join(""));else X.push(z5(U));return D.address=X.join(""),D}function iL($){if(LS($,":")<2)return{host:$,isIPV6:!1};let v=KS($);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 LS($,v){let D=0;for(let X=0;X<$.length;X++)if($[X]===v)D++;return D}function BS($){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 NS={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},ZS=/[@/?#:]/g,OS=/[@/?#]/g;function yL($,v){let D=v?OS:ZS;return D.lastIndex=0,$.replace(D,(X)=>NS[X])}function HS($,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(W5(U)){let G=U.toUpperCase(),J=String.fromCharCode(parseInt(G,16));if(v&&_L(J))D+=J;else D+="%"+G;X+=2;continue}}D+=$[X]}return D}function FS($){let v="";for(let D=0;D<$.length;D++){if($[D]==="%"&&D+2<$.length){let X=$.slice(D+1,D+3);if(W5(X)){let U=X.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(G!=="."&&_L(G))v+=G;else v+="%"+U;D+=2;continue}}if(YS($[D]))v+=$[D];else v+=escape($[D])}return v}function jS($){let v="";for(let D=0;D<$.length;D++){if($[D]==="%"&&D+2<$.length){let X=$.slice(D+1,D+3);if(W5(X)){v+="%"+X.toUpperCase(),D+=2;continue}}v+=escape($[D])}return v}function AS($){let v=[];if($.userinfo!==void 0)v.push($.userinfo),v.push("@");if($.host!==void 0){let D=unescape($.host);if(!fL(D)){let X=iL(D);if(X.isIPV6===!0)D=`[${X.escapedHost}]`;else D=yL(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}nL.exports={nonSimpleDomain:IS,recomposeAuthority:AS,reescapeHostDelimiters:yL,normalizePercentEncoding:HS,normalizePathEncoding:FS,escapePreservingEscapes:jS,removeDotSegments:BS,isIPv4:fL,isUUID:zS,normalizeIPv6:iL,stringArrayToHexStripped:z5}});var rL=b((br,cL)=>{var{isUUID:wS}=Y5(),MS=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,PS=["http","https","ws","wss","urn","urn:uuid"];function bS($){return PS.indexOf($)!==-1}function I5($){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 lL($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function hL($){let v=String($.scheme).toLowerCase()==="https";if($.port===(v?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function qS($){return $.secure=I5($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function SS($){if($.port===(I5($)?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 kS($,v){if(!$.path)return $.error="URN can not be parsed",$;let D=$.path.match(MS);if(D){let X=v.scheme||$.scheme||"urn";$.nid=D[1].toLowerCase(),$.nss=D[2];let U=`${X}:${v.nid||$.nid}`,G=V5(U);if($.path=void 0,G)$=G.parse($,v)}else $.error=$.error||"URN can not be parsed.";return $}function ES($,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=V5(U);if(G)$=G.serialize($,v);let J=$,Q=$.nss;return J.path=`${X||v.nid}:${Q}`,v.skipEscape=!0,J}function TS($,v){let D=$;if(D.uuid=D.nss,D.nss=void 0,!v.tolerant&&(!D.uuid||!wS(D.uuid)))D.error=D.error||"UUID is not valid.";return D}function RS($){let v=$;return v.nss=($.uuid||"").toLowerCase(),v}var mL={scheme:"http",domainHost:!0,parse:lL,serialize:hL},gS={scheme:"https",domainHost:mL.domainHost,parse:lL,serialize:hL},JX={scheme:"ws",domainHost:!0,parse:qS,serialize:SS},CS={scheme:"wss",domainHost:JX.domainHost,parse:JX.parse,serialize:JX.serialize},uS={scheme:"urn",parse:kS,serialize:ES,skipNormalize:!0},xS={scheme:"urn:uuid",parse:TS,serialize:RS,skipNormalize:!0},QX={http:mL,https:gS,ws:JX,wss:CS,urn:uS,"urn:uuid":xS};Object.setPrototypeOf(QX,null);function V5($){return $&&(QX[$]||QX[$.toLowerCase()])||void 0}cL.exports={wsIsSecure:I5,SCHEMES:QX,isValidSchemeName:bS,getSchemeHandler:V5}});var eL=b((qr,WX)=>{var{normalizeIPv6:fS,removeDotSegments:Y0,recomposeAuthority:_S,normalizePercentEncoding:iS,normalizePathEncoding:yS,escapePreservingEscapes:nS,reescapeHostDelimiters:lS,isIPv4:hS,nonSimpleDomain:mS}=Y5(),{SCHEMES:cS,getSchemeHandler:pL}=rL();function rS($,v){if(typeof $==="string")$=aS($,v);else if(typeof $==="object")$=E1(R6($,v),v);return $}function dS($,v,D){let X=D?Object.assign({scheme:"null"},D):{scheme:"null"},U=tL(E1($,X),E1(v,X),X,!0);return X.skipEscape=!0,R6(U,X)}function tL($,v,D,X){let U={};if(!X)$=E1(R6($,D),D),v=E1(R6(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=Y0(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=Y0(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=Y0(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=Y0(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 pS($,v,D){let X=dL($,D),U=dL(v,D);return X!==void 0&&U!==void 0&&X.toLowerCase()===U.toLowerCase()}function R6($,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=pL(X.scheme||D.scheme);if(G&&G.serialize)G.serialize(D,X);if(D.path!==void 0)if(!X.skipEscape){if(D.path=nS(D.path),D.scheme!==void 0)D.path=D.path.split("%3A").join(":")}else D.path=iS(D.path);if(X.reference!=="suffix"&&D.scheme)U.push(D.scheme,":");let J=_S(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=Y0(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 tS=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function oS($,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 oL($,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(tS);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=oS(X,J);if(Q!==void 0)X.error=X.error||Q,U=!0;if(X.host)if(hS(X.host)===!1){let Y=fS(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=pL(D.scheme||X.scheme);if(!D.unicodeSupport&&(!W||!W.unicodeSupport)){if(X.host&&(D.domainHost||W&&W.domainHost)&&G===!1&&mS(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=lS(unescape(X.host),G)}if(X.path)X.path=yS(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 E1($,v){return oL($,v).parsed}function aS($,v){return aL($,v).normalized}function aL($,v){let{parsed:D,malformedAuthorityOrPort:X}=oL($,v);return{normalized:X?$:R6(D,v),malformedAuthorityOrPort:X}}function dL($,v){if(typeof $==="string"){let{normalized:D,malformedAuthorityOrPort:X}=aL($,v);return X?void 0:D}if(typeof $==="object")return R6($,v)}var K5={SCHEMES:cS,normalize:rS,resolve:dS,resolveComponent:tL,equal:pS,serialize:R6,parse:E1};WX.exports=K5;WX.exports.default=K5;WX.exports.fastUri=K5});var vB=b(($B)=>{Object.defineProperty($B,"__esModule",{value:!0});var sL=eL();sL.code='require("ajv/dist/runtime/uri").default';$B.default=sL});var zB=b((r4)=>{Object.defineProperty(r4,"__esModule",{value:!0});r4.CodeGen=r4.Name=r4.nil=r4.stringify=r4.str=r4._=r4.KeywordCxt=void 0;var sS=Q0();Object.defineProperty(r4,"KeywordCxt",{enumerable:!0,get:function(){return sS.KeywordCxt}});var T1=l();Object.defineProperty(r4,"_",{enumerable:!0,get:function(){return T1._}});Object.defineProperty(r4,"str",{enumerable:!0,get:function(){return T1.str}});Object.defineProperty(r4,"stringify",{enumerable:!0,get:function(){return T1.stringify}});Object.defineProperty(r4,"nil",{enumerable:!0,get:function(){return T1.nil}});Object.defineProperty(r4,"Name",{enumerable:!0,get:function(){return T1.Name}});Object.defineProperty(r4,"CodeGen",{enumerable:!0,get:function(){return T1.CodeGen}});var $k=DX(),JB=W0(),vk=cz(),I0=GX(),Uk=l(),V0=X0(),zX=D0(),B5=d(),UB=uL(),Dk=vB(),QB=($,v)=>new RegExp($,v);QB.code="new RegExp";var Xk=["removeAdditional","useDefaults","coerceTypes"],Gk=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Jk={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."},Qk={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},DB=200;function Wk($){var v,D,X,U,G,J,Q,W,z,Y,I,V,K,L,N,Z,F,S,g,u,k,N$,j$,g4,Q4;let y$=$.strict,h1=(v=$.code)===null||v===void 0?void 0:v.optimize,m1=h1===!0||h1===void 0?1:h1||0,c1=(X=(D=$.code)===null||D===void 0?void 0:D.regExp)!==null&&X!==void 0?X:QB,q0=(U=$.uriResolver)!==null&&U!==void 0?U:Dk.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=(K=$.strictRequired)!==null&&K!==void 0?K:y$)!==null&&L!==void 0?L:!1,code:$.code?{...$.code,optimize:m1,regExp:c1}:{optimize:m1,regExp:c1},loopRequired:(N=$.loopRequired)!==null&&N!==void 0?N:DB,loopEnum:(Z=$.loopEnum)!==null&&Z!==void 0?Z:DB,meta:(F=$.meta)!==null&&F!==void 0?F:!0,messages:(S=$.messages)!==null&&S!==void 0?S:!0,inlineRefs:(g=$.inlineRefs)!==null&&g!==void 0?g:!0,schemaId:(u=$.schemaId)!==null&&u!==void 0?u:"$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:(g4=$.unicodeRegExp)!==null&&g4!==void 0?g4:!0,int32range:(Q4=$.int32range)!==null&&Q4!==void 0?Q4:!0,uriResolver:q0}}class YX{constructor($={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...Wk($)};let{es5:v,lines:D}=this.opts.code;this.scope=new Uk.ValueScope({scope:{},prefixes:Gk,es5:v,lines:D}),this.logger=Lk($.logger);let X=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,vk.getRules)(),XB.call(this,Jk,$,"NOT SUPPORTED"),XB.call(this,Qk,$,"DEPRECATED","warn"),this._metaOpts=Vk.call(this),$.formats)Yk.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)Ik.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);zk.call(this),$.validateFormats=X}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:v,schemaId:D}=this.opts,X=UB;if(D==="id")X={...UB},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 JB.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,V0.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=GB.call(this,$))=="string")$=v;if(v===void 0){let{schemaId:D}=this.opts,X=new I0.SchemaEnv({schema:{},schemaId:D});if(v=I0.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=GB.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,V0.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(Nk.call(this,D,v),!v)return(0,B5.eachItem)(D,(U)=>L5.call(this,U)),this;Ok.call(this,v);let X={...v,type:(0,zX.getJSONTypes)(v.type),schemaType:(0,zX.getJSONTypes)(v.schemaType)};return(0,B5.eachItem)(D,X.type.length===0?(U)=>L5.call(this,U,X):(U)=>X.type.forEach((G)=>L5.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]=WB(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,V0.normalizeId)(G||D);let W=V0.getSchemaRefs.call(this,$,D);if(Q=new I0.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 I0.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let v=this.opts;this.opts=this._metaOpts;try{I0.compileSchema.call(this,$)}finally{this.opts=v}}}YX.ValidationError=$k.default;YX.MissingRefError=JB.default;r4.default=YX;function XB($,v,D,X="error"){for(let U in $){let G=U;if(G in v)this.logger[X](`${D}: option ${U}. ${$[G]}`)}}function GB($){return $=(0,V0.normalizeId)($),this.schemas[$]||this.refs[$]}function zk(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let v in $)this.addSchema($[v],v)}function Yk(){for(let $ in this.opts.formats){let v=this.opts.formats[$];if(v)this.addFormat($,v)}}function Ik($){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 Vk(){let $={...this.opts};for(let v of Xk)delete $[v];return $}var Kk={log(){},warn(){},error(){}};function Lk($){if($===!1)return Kk;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var Bk=/^[a-z_$][a-z0-9_$:-]*$/i;function Nk($,v){let{RULES:D}=this;if((0,B5.eachItem)($,(X)=>{if(D.keywords[X])throw Error(`Keyword ${X} is already defined`);if(!Bk.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 L5($,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,zX.getJSONTypes)(v.type),schemaType:(0,zX.getJSONTypes)(v.schemaType)}};if(v.before)Zk.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 Zk($,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 Ok($){let{metaSchema:v}=$;if(v===void 0)return;if($.$data&&this.opts.$data)v=WB(v);$.validateSchema=this.compile(v,!0)}var Hk={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function WB($){return{anyOf:[$,Hk]}}});var IB=b((YB)=>{Object.defineProperty(YB,"__esModule",{value:!0});var Ak={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};YB.default=Ak});var ZB=b((BB)=>{Object.defineProperty(BB,"__esModule",{value:!0});BB.callRef=BB.getValidate=void 0;var Mk=W0(),VB=X4(),r$=l(),R1=m4(),KB=GX(),IX=d(),Pk={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=KB.resolveRef.call(W,z,U,D);if(Y===void 0)throw new Mk.default(X.opts.uriResolver,U,D);if(Y instanceof KB.SchemaEnv)return V(Y);return K(Y);function I(){if(G===z)return VX($,J,G,G.$async);let L=v.scopeValue("root",{ref:z});return VX($,r$._`${L}.validate`,z,z.$async)}function V(L){let N=LB($,L);VX($,N,L,L.$async)}function K(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 LB($,v){let{gen:D}=$;return v.validate?D.scopeValue("validate",{ref:v.validate}):r$._`${D.scopeValue("wrapper",{ref:v})}.validate`}BB.getValidate=LB;function VX($,v,D,X){let{gen:U,it:G}=$,{allErrors:J,schemaEnv:Q,opts:W}=G,z=W.passContext?R1.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,VB.callValidateCode)($,v,z)}`),K(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,VB.callValidateCode)($,v,z),()=>K(v),()=>V(v))}function V(L){let N=r$._`${L}.errors`;U.assign(R1.default.vErrors,r$._`${R1.default.vErrors} === null ? ${N} : ${R1.default.vErrors}.concat(${N})`),U.assign(R1.default.errors,r$._`${R1.default.vErrors}.length`)}function K(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=IX.mergeEvaluated.props(U,Z.props,G.props)}else{let F=U.var("props",r$._`${L}.evaluated.props`);G.props=IX.mergeEvaluated.props(U,F,G.props,r$.Name)}if(G.items!==!0)if(Z&&!Z.dynamicItems){if(Z.items!==void 0)G.items=IX.mergeEvaluated.items(U,Z.items,G.items)}else{let F=U.var("items",r$._`${L}.evaluated.items`);G.items=IX.mergeEvaluated.items(U,F,G.items,r$.Name)}}}BB.callRef=VX;BB.default=Pk});var HB=b((OB)=>{Object.defineProperty(OB,"__esModule",{value:!0});var Sk=IB(),kk=ZB(),Ek=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Sk.default,kk.default];OB.default=Ek});var jB=b((FB)=>{Object.defineProperty(FB,"__esModule",{value:!0});var KX=l(),B6=KX.operators,LX={maximum:{okStr:"<=",ok:B6.LTE,fail:B6.GT},minimum:{okStr:">=",ok:B6.GTE,fail:B6.LT},exclusiveMaximum:{okStr:"<",ok:B6.LT,fail:B6.GTE},exclusiveMinimum:{okStr:">",ok:B6.GT,fail:B6.LTE}},Rk={message:({keyword:$,schemaCode:v})=>KX.str`must be ${LX[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>KX._`{comparison: ${LX[$].okStr}, limit: ${v}}`},gk={keyword:Object.keys(LX),type:"number",schemaType:"number",$data:!0,error:Rk,code($){let{keyword:v,data:D,schemaCode:X}=$;$.fail$data(KX._`${D} ${LX[v].fail} ${X} || isNaN(${D})`)}};FB.default=gk});var wB=b((AB)=>{Object.defineProperty(AB,"__esModule",{value:!0});var K0=l(),uk={message:({schemaCode:$})=>K0.str`must be multiple of ${$}`,params:({schemaCode:$})=>K0._`{multipleOf: ${$}}`},xk={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:uk,code($){let{gen:v,data:D,schemaCode:X,it:U}=$,G=U.opts.multipleOfPrecision,J=v.let("res"),Q=G?K0._`Math.abs(Math.round(${J}) - ${J}) > 1e-${G}`:K0._`${J} !== parseInt(${J})`;$.fail$data(K0._`(${X} === 0 || (${J} = ${D}/${X}, ${Q}))`)}};AB.default=xk});var bB=b((PB)=>{Object.defineProperty(PB,"__esModule",{value:!0});function MB($){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}PB.default=MB;MB.code='require("ajv/dist/runtime/ucs2length").default'});var SB=b((qB)=>{Object.defineProperty(qB,"__esModule",{value:!0});var g6=l(),ik=d(),yk=bB(),nk={message({keyword:$,schemaCode:v}){let D=$==="maxLength"?"more":"fewer";return g6.str`must NOT have ${D} than ${v} characters`},params:({schemaCode:$})=>g6._`{limit: ${$}}`},lk={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:nk,code($){let{keyword:v,data:D,schemaCode:X,it:U}=$,G=v==="maxLength"?g6.operators.GT:g6.operators.LT,J=U.opts.unicode===!1?g6._`${D}.length`:g6._`${(0,ik.useFunc)($.gen,yk.default)}(${D})`;$.fail$data(g6._`${J} ${G} ${X}`)}};qB.default=lk});var EB=b((kB)=>{Object.defineProperty(kB,"__esModule",{value:!0});var mk=X4(),ck=d(),g1=l(),rk={message:({schemaCode:$})=>g1.str`must match pattern "${$}"`,params:({schemaCode:$})=>g1._`{pattern: ${$}}`},dk={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:rk,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"?g1._`new RegExp`:(0,ck.useFunc)(v,W),Y=v.let("valid");v.try(()=>v.assign(Y,g1._`${z}(${G}, ${Q}).test(${D})`),()=>v.assign(Y,!1)),$.fail$data(g1._`!${Y}`)}else{let W=(0,mk.usePattern)($,U);$.fail$data(g1._`!${W}.test(${D})`)}}};kB.default=dk});var RB=b((TB)=>{Object.defineProperty(TB,"__esModule",{value:!0});var L0=l(),tk={message({keyword:$,schemaCode:v}){let D=$==="maxProperties"?"more":"fewer";return L0.str`must NOT have ${D} than ${v} properties`},params:({schemaCode:$})=>L0._`{limit: ${$}}`},ok={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:tk,code($){let{keyword:v,data:D,schemaCode:X}=$,U=v==="maxProperties"?L0.operators.GT:L0.operators.LT;$.fail$data(L0._`Object.keys(${D}).length ${U} ${X}`)}};TB.default=ok});var CB=b((gB)=>{Object.defineProperty(gB,"__esModule",{value:!0});var B0=X4(),N0=l(),ek=d(),sk={message:({params:{missingProperty:$}})=>N0.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>N0._`{missingProperty: ${$}}`},$E={keyword:"required",type:"object",schemaType:"array",$data:!0,error:sk,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 K=$.parentSchema.properties,{definedProperties:L}=$.it;for(let N of D)if((K===null||K===void 0?void 0:K[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(N0.nil,I);else for(let K of D)(0,B0.checkReportMissingProp)($,K)}function Y(){let K=v.let("missing");if(W||G){let L=v.let("valid",!0);$.block$data(L,()=>V(K,L)),$.ok(L)}else v.if((0,B0.checkMissingProp)($,D,K)),(0,B0.reportMissingProp)($,K),v.else()}function I(){v.forOf("prop",X,(K)=>{$.setParams({missingProperty:K}),v.if((0,B0.noPropertyInData)(v,U,K,Q.ownProperties),()=>$.error())})}function V(K,L){$.setParams({missingProperty:K}),v.forOf(K,X,()=>{v.assign(L,(0,B0.propertyInData)(v,U,K,Q.ownProperties)),v.if((0,N0.not)(L),()=>{$.error(),v.break()})},N0.nil)}}};gB.default=$E});var xB=b((uB)=>{Object.defineProperty(uB,"__esModule",{value:!0});var Z0=l(),UE={message({keyword:$,schemaCode:v}){let D=$==="maxItems"?"more":"fewer";return Z0.str`must NOT have ${D} than ${v} items`},params:({schemaCode:$})=>Z0._`{limit: ${$}}`},DE={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:UE,code($){let{keyword:v,data:D,schemaCode:X}=$,U=v==="maxItems"?Z0.operators.GT:Z0.operators.LT;$.fail$data(Z0._`${D}.length ${U} ${X}`)}};uB.default=DE});var BX=b((_B)=>{Object.defineProperty(_B,"__esModule",{value:!0});var fB=sz();fB.code='require("ajv/dist/runtime/equal").default';_B.default=fB});var yB=b((iB)=>{Object.defineProperty(iB,"__esModule",{value:!0});var N5=D0(),S$=l(),JE=d(),QE=BX(),WE={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}}`},zE={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:WE,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,N5.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:K)(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,N5.checkDataTypes)(z,Z,Q.opts.strictNumbers,N5.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 K(L,N){let Z=(0,JE.useFunc)(v,QE.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)})))}}};iB.default=zE});var lB=b((nB)=>{Object.defineProperty(nB,"__esModule",{value:!0});var Z5=l(),IE=d(),VE=BX(),KE={message:"must be equal to constant",params:({schemaCode:$})=>Z5._`{allowedValue: ${$}}`},LE={keyword:"const",$data:!0,error:KE,code($){let{gen:v,data:D,$data:X,schemaCode:U,schema:G}=$;if(X||G&&typeof G=="object")$.fail$data(Z5._`!${(0,IE.useFunc)(v,VE.default)}(${D}, ${U})`);else $.fail(Z5._`${G} !== ${D}`)}};nB.default=LE});var mB=b((hB)=>{Object.defineProperty(hB,"__esModule",{value:!0});var O0=l(),NE=d(),ZE=BX(),OE={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>O0._`{allowedValues: ${$}}`},HE={keyword:"enum",schemaType:"array",$data:!0,error:OE,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,NE.useFunc)(v,ZE.default),Y;if(Q||X)Y=v.let("valid"),$.block$data(Y,I);else{if(!Array.isArray(U))throw Error("ajv implementation error");let K=v.const("vSchema",G);Y=(0,O0.or)(...U.map((L,N)=>V(K,N)))}$.pass(Y);function I(){v.assign(Y,!1),v.forOf("v",G,(K)=>v.if(O0._`${z()}(${D}, ${K})`,()=>v.assign(Y,!0).break()))}function V(K,L){let N=U[L];return typeof N==="object"&&N!==null?O0._`${z()}(${D}, ${K}[${L}])`:O0._`${D} === ${N}`}}};hB.default=HE});var rB=b((cB)=>{Object.defineProperty(cB,"__esModule",{value:!0});var jE=jB(),AE=wB(),wE=SB(),ME=EB(),PE=RB(),bE=CB(),qE=xB(),SE=yB(),kE=lB(),EE=mB(),TE=[jE.default,AE.default,wE.default,ME.default,PE.default,bE.default,qE.default,SE.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},kE.default,EE.default];cB.default=TE});var H5=b((pB)=>{Object.defineProperty(pB,"__esModule",{value:!0});pB.validateAdditionalItems=void 0;var C6=l(),O5=d(),gE={message:({params:{len:$}})=>C6.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>C6._`{limit: ${$}}`},CE={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:gE,code($){let{parentSchema:v,it:D}=$,{items:X}=v;if(!Array.isArray(X)){(0,O5.checkStrictMode)(D,'"additionalItems" is ignored when "items" is not an array of schemas');return}dB($,X)}};function dB($,v){let{gen:D,schema:X,data:U,keyword:G,it:J}=$;J.items=!0;let Q=D.const("len",C6._`${U}.length`);if(X===!1)$.setParams({len:v.length}),$.pass(C6._`${Q} <= ${v.length}`);else if(typeof X=="object"&&!(0,O5.alwaysValidSchema)(J,X)){let z=D.var("valid",C6._`${Q} <= ${v.length}`);D.if((0,C6.not)(z),()=>W(z)),$.ok(z)}function W(z){D.forRange("i",v.length,Q,(Y)=>{if($.subschema({keyword:G,dataProp:Y,dataPropType:O5.Type.Num},z),!J.allErrors)D.if((0,C6.not)(z),()=>D.break())})}}pB.validateAdditionalItems=dB;pB.default=CE});var F5=b((eB)=>{Object.defineProperty(eB,"__esModule",{value:!0});eB.validateTuple=void 0;var oB=l(),NX=d(),xE=X4(),fE={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:v,it:D}=$;if(Array.isArray(v))return aB($,"additionalItems",v);if(D.items=!0,(0,NX.alwaysValidSchema)(D,v))return;$.ok((0,xE.validateArray)($))}};function aB($,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=NX.mergeEvaluated.items(X,D.length,Q.items);let W=X.name("valid"),z=X.const("len",oB._`${G}.length`);D.forEach((I,V)=>{if((0,NX.alwaysValidSchema)(Q,I))return;X.if(oB._`${z} > ${V}`,()=>$.subschema({keyword:J,schemaProp:V,dataProp:V},W)),$.ok(W)});function Y(I){let{opts:V,errSchemaPath:K}=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 "${K}"`;(0,NX.checkStrictMode)(Q,Z,V.strictTuples)}}}eB.validateTuple=aB;eB.default=fE});var vN=b(($N)=>{Object.defineProperty($N,"__esModule",{value:!0});var iE=F5(),yE={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,iE.validateTuple)($,"items")};$N.default=yE});var XN=b((DN)=>{Object.defineProperty(DN,"__esModule",{value:!0});var UN=l(),lE=d(),hE=X4(),mE=H5(),cE={message:({params:{len:$}})=>UN.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>UN._`{limit: ${$}}`},rE={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:cE,code($){let{schema:v,parentSchema:D,it:X}=$,{prefixItems:U}=D;if(X.items=!0,(0,lE.alwaysValidSchema)(X,v))return;if(U)(0,mE.validateAdditionalItems)($,U);else $.ok((0,hE.validateArray)($))}};DN.default=rE});var JN=b((GN)=>{Object.defineProperty(GN,"__esModule",{value:!0});var G4=l(),ZX=d(),pE={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}}`},tE={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:pE,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,ZX.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Q!==void 0&&J>Q){(0,ZX.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,ZX.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)K(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);K(N,()=>v.if(N,()=>L(Z)))}function K(N,Z){v.forRange("i",0,Y,(F)=>{$.subschema({keyword:"contains",dataProp:F,dataPropType:ZX.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))}}};GN.default=tE});var VN=b((zN)=>{Object.defineProperty(zN,"__esModule",{value:!0});zN.validateSchemaDeps=zN.validatePropertyDeps=zN.error=void 0;var j5=l(),aE=d(),H0=X4();zN.error={message:({params:{property:$,depsCount:v,deps:D}})=>{let X=v===1?"property":"properties";return j5.str`must have ${X} ${D} when property ${$} is present`},params:({params:{property:$,depsCount:v,deps:D,missingProperty:X}})=>j5._`{property: ${$},
8
8
  missingProperty: ${X},
9
9
  depsCount: ${v},
10
- deps: ${D}}`};var pT={keyword:"dependencies",type:"object",schemaType:"object",error:JN.error,code($){let[v,D]=tT($);XN($,v),GN($,D)}};function tT({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 XN($,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 I=(0,O0.propertyInData)(D,X,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)D.if(I,()=>{for(let W of Q)(0,O0.checkReportMissingProp)($,W)});else D.if(Az._`${I} && (${(0,O0.checkMissingProp)($,Q,G)})`),(0,O0.reportMissingProp)($,G),D.else()}}JN.validatePropertyDeps=XN;function GN($,v=$.schema){let{gen:D,data:X,keyword:U,it:G}=$,J=D.name("valid");for(let Q in v){if((0,dT.alwaysValidSchema)(G,v[Q]))continue;D.if((0,O0.propertyInData)(D,X,Q,G.opts.ownProperties),()=>{let I=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(I,J)},()=>D.var(J,!0)),$.ok(J)}}JN.validateSchemaDeps=GN;JN.default=pT});var BN=b((YN)=>{Object.defineProperty(YN,"__esModule",{value:!0});var zN=l(),eT=d(),sT={message:"property name must be valid",params:({params:$})=>zN._`{propertyName: ${$.propertyName}}`},$E={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:sT,code($){let{gen:v,schema:D,data:X,it:U}=$;if((0,eT.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,zN.not)(G),()=>{if($.error(!0),!U.allErrors)v.break()})}),$.ok(G)}};YN.default=$E});var Hz=b((VN)=>{Object.defineProperty(VN,"__esModule",{value:!0});var ZX=X4(),K4=l(),UE=h4(),OX=d(),DE={message:"must NOT have additional properties",params:({params:$})=>K4._`{additionalProperty: ${$.additionalProperty}}`},XE={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:DE,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:I}=J;if(J.props=!0,I.removeAdditional!=="all"&&(0,OX.alwaysValidSchema)(J,D))return;let W=(0,ZX.allSchemaProperties)(X.properties),z=(0,ZX.allSchemaProperties)(X.patternProperties);Y(),$.ok(K4._`${G} === ${UE.default.errors}`);function Y(){v.forIn("key",U,(Z)=>{if(!W.length&&!z.length)L(Z);else v.if(B(Z),()=>L(Z))})}function B(Z){let H;if(W.length>8){let S=(0,OX.schemaRefOrVal)(J,X.properties,"properties");H=(0,ZX.isOwnProperty)(v,S,Z)}else if(W.length)H=(0,K4.or)(...W.map((S)=>K4._`${Z} === ${S}`));else H=K4.nil;if(z.length)H=(0,K4.or)(H,...z.map((S)=>K4._`${(0,ZX.usePattern)($,S)}.test(${Z})`));return(0,K4.not)(H)}function V(Z){v.code(K4._`delete ${U}[${Z}]`)}function L(Z){if(I.removeAdditional==="all"||I.removeAdditional&&D===!1){V(Z);return}if(D===!1){if($.setParams({additionalProperty:Z}),$.error(),!Q)v.break();return}if(typeof D=="object"&&!(0,OX.alwaysValidSchema)(J,D)){let H=v.name("valid");if(I.removeAdditional==="failing")N(Z,H,!1),v.if((0,K4.not)(H),()=>{$.reset(),V(Z)});else if(N(Z,H),!Q)v.if((0,K4.not)(H),()=>v.break())}}function N(Z,H,S){let R={keyword:"additionalProperties",dataProp:Z,dataPropType:OX.Type.Str};if(S===!1)Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(R,H)}}};VN.default=XE});var ZN=b((NN)=>{Object.defineProperty(NN,"__esModule",{value:!0});var JE=J0(),LN=X4(),Fz=d(),KN=Hz(),QE={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)KN.default.code(new JE.KeywordCxt(G,KN.default,"additionalProperties"));let J=(0,LN.allSchemaProperties)(D);for(let Y of J)G.definedProperties.add(Y);if(G.opts.unevaluated&&J.length&&G.props!==!0)G.props=Fz.mergeEvaluated.props(v,(0,Fz.toHash)(J),G.props);let Q=J.filter((Y)=>!(0,Fz.alwaysValidSchema)(G,D[Y]));if(Q.length===0)return;let I=v.name("valid");for(let Y of Q){if(W(Y))z(Y);else{if(v.if((0,LN.propertyInData)(v,U,Y,G.opts.ownProperties)),z(Y),!G.allErrors)v.else().var(I,!0);v.endIf()}$.it.definedProperties.add(Y),$.ok(I)}function W(Y){return G.opts.useDefaults&&!G.compositeRule&&D[Y].default!==void 0}function z(Y){$.subschema({keyword:"properties",schemaProp:Y,dataProp:Y},I)}}};NN.default=QE});var jN=b((FN)=>{Object.defineProperty(FN,"__esModule",{value:!0});var ON=X4(),AX=l(),AN=d(),HN=d(),WE={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:v,schema:D,data:X,parentSchema:U,it:G}=$,{opts:J}=G,Q=(0,ON.allSchemaProperties)(D),I=Q.filter((N)=>(0,AN.alwaysValidSchema)(G,D[N]));if(Q.length===0||I.length===Q.length&&(!G.opts.unevaluated||G.props===!0))return;let W=J.strictSchema&&!J.allowMatchingProperties&&U.properties,z=v.name("valid");if(G.props!==!0&&!(G.props instanceof AX.Name))G.props=(0,HN.evaluatedPropsToName)(v,G.props);let{props:Y}=G;B();function B(){for(let N of Q){if(W)V(N);if(G.allErrors)L(N);else v.var(z,!0),L(N),v.if(z)}}function V(N){for(let Z in W)if(new RegExp(N).test(Z))(0,AN.checkStrictMode)(G,`property ${Z} matches pattern ${N} (use allowMatchingProperties)`)}function L(N){v.forIn("key",X,(Z)=>{v.if(AX._`${(0,ON.usePattern)($,N)}.test(${Z})`,()=>{let H=I.includes(N);if(!H)$.subschema({keyword:"patternProperties",schemaProp:N,dataProp:Z,dataPropType:HN.Type.Str},z);if(G.opts.unevaluated&&Y!==!0)v.assign(AX._`${Y}[${Z}]`,!0);else if(!H&&!G.allErrors)v.if((0,AX.not)(z),()=>v.break())})})}}};FN.default=WE});var MN=b((wN)=>{Object.defineProperty(wN,"__esModule",{value:!0});var YE=d(),BE={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:v,schema:D,it:X}=$;if((0,YE.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"}};wN.default=BE});var bN=b((PN)=>{Object.defineProperty(PN,"__esModule",{value:!0});var LE=X4(),KE={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:LE.validateUnion,error:{message:"must match a schema in anyOf"}};PN.default=KE});var SN=b((qN)=>{Object.defineProperty(qN,"__esModule",{value:!0});var HX=l(),ZE=d(),OE={message:"must match exactly one schema in oneOf",params:({params:$})=>HX._`{passingSchemas: ${$.passing}}`},AE={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:OE,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),I=v.name("_valid");$.setParams({passing:Q}),v.block(W),$.result(J,()=>$.reset(),()=>$.error(!0));function W(){G.forEach((z,Y)=>{let B;if((0,ZE.alwaysValidSchema)(U,z))v.var(I,!0);else B=$.subschema({keyword:"oneOf",schemaProp:Y,compositeRule:!0},I);if(Y>0)v.if(HX._`${I} && ${J}`).assign(J,!1).assign(Q,HX._`[${Q}, ${Y}]`).else();v.if(I,()=>{if(v.assign(J,!0),v.assign(Q,Y),B)$.mergeEvaluated(B,HX.Name)})})}}};qN.default=AE});var TN=b((kN)=>{Object.defineProperty(kN,"__esModule",{value:!0});var FE=d(),jE={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,FE.alwaysValidSchema)(X,G))return;let Q=$.subschema({keyword:"allOf",schemaProp:J},U);$.ok(U),$.mergeEvaluated(Q)})}};kN.default=jE});var gN=b((RN)=>{Object.defineProperty(RN,"__esModule",{value:!0});var FX=l(),uN=d(),ME={message:({params:$})=>FX.str`must match "${$.ifClause}" schema`,params:({params:$})=>FX._`{failingKeyword: ${$.ifClause}}`},PE={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ME,code($){let{gen:v,parentSchema:D,it:X}=$;if(D.then===void 0&&D.else===void 0)(0,uN.checkStrictMode)(X,'"if" without "then" and "else" is ignored');let U=EN(X,"then"),G=EN(X,"else");if(!U&&!G)return;let J=v.let("valid",!0),Q=v.name("_valid");if(I(),$.reset(),U&&G){let z=v.let("ifClause");$.setParams({ifClause:z}),v.if(Q,W("then",z),W("else",z))}else if(U)v.if(Q,W("then"));else v.if((0,FX.not)(Q),W("else"));$.pass(J,()=>$.error(!0));function I(){let z=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Q);$.mergeEvaluated(z)}function W(z,Y){return()=>{let B=$.subschema({keyword:z},Q);if(v.assign(J,Q),$.mergeValidEvaluated(B,J),Y)v.assign(Y,FX._`${z}`);else $.setParams({ifClause:z})}}}};function EN($,v){let D=$.schema[v];return D!==void 0&&!(0,uN.alwaysValidSchema)($,D)}RN.default=PE});var xN=b((CN)=>{Object.defineProperty(CN,"__esModule",{value:!0});var qE=d(),SE={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:v,it:D}){if(v.if===void 0)(0,qE.checkStrictMode)(D,`"${$}" without "if" is ignored`)}};CN.default=SE});var fN=b((iN)=>{Object.defineProperty(iN,"__esModule",{value:!0});var TE=Zz(),EE=eK(),uE=Oz(),RE=vN(),gE=DN(),CE=WN(),xE=BN(),iE=Hz(),fE=ZN(),nE=jN(),_E=MN(),yE=bN(),lE=SN(),hE=TN(),mE=gN(),rE=xN();function cE($=!1){let v=[_E.default,yE.default,lE.default,hE.default,mE.default,rE.default,xE.default,iE.default,CE.default,fE.default,nE.default];if($)v.push(EE.default,RE.default);else v.push(TE.default,uE.default);return v.push(gE.default),v}iN.default=cE});var _N=b((nN)=>{Object.defineProperty(nN,"__esModule",{value:!0});var L$=l(),pE={message:({schemaCode:$})=>L$.str`must match format "${$}"`,params:({schemaCode:$})=>L$._`{format: ${$}}`},tE={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:pE,code($,v){let{gen:D,data:X,$data:U,schema:G,schemaCode:J,it:Q}=$,{opts:I,errSchemaPath:W,schemaEnv:z,self:Y}=Q;if(!I.validateFormats)return;if(U)B();else V();function B(){let L=D.scopeValue("formats",{ref:Y.formats,code:I.code.formats}),N=D.const("fDef",L$._`${L}[${J}]`),Z=D.let("fType"),H=D.let("format");D.if(L$._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>D.assign(Z,L$._`${N}.type || "string"`).assign(H,L$._`${N}.validate`),()=>D.assign(Z,L$._`"string"`).assign(H,N)),$.fail$data((0,L$.or)(S(),R()));function S(){if(I.strictSchema===!1)return L$.nil;return L$._`${J} && !${H}`}function R(){let C=z.$async?L$._`(${N}.async ? await ${H}(${X}) : ${H}(${X}))`:L$._`${H}(${X})`,k=L$._`(typeof ${H} == "function" ? ${C} : ${H}.test(${X}))`;return L$._`${H} && ${H} !== true && ${Z} === ${v} && !${k}`}}function V(){let L=Y.formats[G];if(!L){S();return}if(L===!0)return;let[N,Z,H]=R(L);if(N===v)$.pass(C());function S(){if(I.strictSchema===!1){Y.logger.warn(k());return}throw Error(k());function k(){return`unknown format "${G}" ignored in schema at path "${W}"`}}function R(k){let N$=k instanceof RegExp?(0,L$.regexpCode)(k):I.code.formats?L$._`${I.code.formats}${(0,L$.getProperty)(G)}`:void 0,F$=D.scopeValue("formats",{key:G,ref:k,code:N$});if(typeof k=="object"&&!(k instanceof RegExp))return[k.type||"string",k.validate,L$._`${F$}.validate`];return["string",k,F$]}function C(){if(typeof L=="object"&&!(L instanceof RegExp)&&L.async){if(!z.$async)throw Error("async format in sync schema");return L$._`await ${H}(${X})`}return typeof Z=="function"?L$._`${H}(${X})`:L$._`${H}.test(${X})`}}}};nN.default=tE});var lN=b((yN)=>{Object.defineProperty(yN,"__esModule",{value:!0});var aE=_N(),eE=[aE.default];yN.default=eE});var rN=b((hN)=>{Object.defineProperty(hN,"__esModule",{value:!0});hN.contentVocabulary=hN.metadataVocabulary=void 0;hN.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];hN.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var pN=b((dN)=>{Object.defineProperty(dN,"__esModule",{value:!0});var vu=NK(),Uu=hK(),Du=fN(),Xu=lN(),cN=rN(),Gu=[vu.default,Uu.default,(0,Du.default)(),Xu.default,cN.metadataVocabulary,cN.contentVocabulary];dN.default=Gu});var eN=b((oN)=>{Object.defineProperty(oN,"__esModule",{value:!0});oN.DiscrError=void 0;var tN;(function($){$.Tag="tag",$.Mapping="mapping"})(tN||(oN.DiscrError=tN={}))});var vZ=b(($Z)=>{Object.defineProperty($Z,"__esModule",{value:!0});var R1=l(),jz=eN(),sN=XX(),Qu=Q0(),Iu=d(),Wu={message:({params:{discrError:$,tagName:v}})=>$===jz.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}}`},zu={keyword:"discriminator",type:"object",schemaType:"object",error:Wu,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 I=v.let("valid",!1),W=v.const("tag",R1._`${D}${(0,R1.getProperty)(Q)}`);v.if(R1._`typeof ${W} == "string"`,()=>z(),()=>$.error(!1,{discrError:jz.DiscrError.Tag,tag:W,tagName:Q})),$.ok(I);function z(){let V=B();v.if(!1);for(let L in V)v.elseIf(R1._`${W} === ${L}`),v.assign(I,Y(V[L]));v.else(),$.error(!1,{discrError:jz.DiscrError.Mapping,tag:W,tagName:Q}),v.endIf()}function Y(V){let L=v.name("valid"),N=$.subschema({keyword:"oneOf",schemaProp:V},L);return $.mergeEvaluated(N,R1.Name),L}function B(){var V;let L={},N=H(U),Z=!0;for(let C=0;C<J.length;C++){let k=J[C];if((k===null||k===void 0?void 0:k.$ref)&&!(0,Iu.schemaHasRulesButRef)(k,G.self.RULES)){let F$=k.$ref;if(k=sN.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,F$),k instanceof sN.SchemaEnv)k=k.schema;if(k===void 0)throw new Qu.default(G.opts.uriResolver,G.baseId,F$)}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}"`);Z=Z&&(N||H(k)),S(N$,C)}if(!Z)throw Error(`discriminator: "${Q}" must be required`);return L;function H({required:C}){return Array.isArray(C)&&C.includes(Q)}function S(C,k){if(C.const)R(C.const,k);else if(C.enum)for(let N$ of C.enum)R(N$,k);else throw Error(`discriminator: "properties/${Q}" must have "const" or "enum"`)}function R(C,k){if(typeof C!="string"||C in L)throw Error(`discriminator: "${Q}" values must be unique strings`);L[C]=k}}}};$Z.default=zu});var UZ=b((Zd,Bu)=>{Bu.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 Mz=b((d$,wz)=>{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 Vu=JK(),Lu=pN(),Ku=vZ(),DZ=UZ(),Nu=["/properties"],jX="http://json-schema.org/draft-07/schema";class A0 extends Vu.default{_addVocabularies(){if(super._addVocabularies(),Lu.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(Ku.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(DZ,Nu):DZ;this.addMetaSchema($,jX,!1),this.refs["http://json-schema.org/schema"]=jX}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(jX)?jX:void 0)}}d$.Ajv=A0;wz.exports=d$=A0;wz.exports.Ajv=A0;Object.defineProperty(d$,"__esModule",{value:!0});d$.default=A0;var Zu=J0();Object.defineProperty(d$,"KeywordCxt",{enumerable:!0,get:function(){return Zu.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 Ou=UX();Object.defineProperty(d$,"ValidationError",{enumerable:!0,get:function(){return Ou.default}});var Au=Q0();Object.defineProperty(d$,"MissingRefError",{enumerable:!0,get:function(){return Au.default}})});var VZ=b((YZ)=>{Object.defineProperty(YZ,"__esModule",{value:!0});YZ.formatNames=YZ.fastFormats=YZ.fullFormats=void 0;function k4($,v){return{validate:$,compare:v}}YZ.fullFormats={date:k4(QZ,Sz),time:k4(bz(!0),kz),"date-time":k4(XZ(!0),WZ),"iso-time":k4(bz(),IZ),"iso-date-time":k4(XZ(),zZ),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:qu,"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:gu,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:Su,int32:{type:"number",validate:Eu},int64:{type:"number",validate:uu},float:{type:"number",validate:JZ},double:{type:"number",validate:JZ},password:!0,binary:!0};YZ.fastFormats={...YZ.fullFormats,date:k4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Sz),time:k4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,kz),"date-time":k4(/^\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,WZ),"iso-time":k4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,IZ),"iso-date-time":k4(/^\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,zZ),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};YZ.formatNames=Object.keys(YZ.fullFormats);function ju($){return $%4===0&&($%100!==0||$%400===0)}var wu=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Mu=[0,31,28,31,30,31,30,31,31,30,31,30,31];function QZ($){let v=wu.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&&ju(D)?29:Mu[X])}function Sz($,v){if(!($&&v))return;if($>v)return 1;if($<v)return-1;return 0}var Pz=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function bz($){return function(D){let X=Pz.exec(D);if(!X)return!1;let U=+X[1],G=+X[2],J=+X[3],Q=X[4],I=X[5]==="-"?-1:1,W=+(X[6]||0),z=+(X[7]||0);if(W>23||z>59||$&&!Q)return!1;if(U<=23&&G<=59&&J<60)return!0;let Y=G-z*I,B=U-W*I-(Y<0?1:0);return(B===23||B===-1)&&(Y===59||Y===-1)&&J<61}}function kz($,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 IZ($,v){if(!($&&v))return;let D=Pz.exec($),X=Pz.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 qz=/t|\s/i;function XZ($){let v=bz($);return function(X){let U=X.split(qz);return U.length===2&&QZ(U[0])&&v(U[1])}}function WZ($,v){if(!($&&v))return;let D=new Date($).valueOf(),X=new Date(v).valueOf();if(!(D&&X))return;return D-X}function zZ($,v){if(!($&&v))return;let[D,X]=$.split(qz),[U,G]=v.split(qz),J=Sz(D,U);if(J===void 0)return;return J||kz(X,G)}var Pu=/\/|:/,bu=/^(?:[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 qu($){return Pu.test($)&&bu.test($)}var GZ=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Su($){return GZ.lastIndex=0,GZ.test($)}var ku=-2147483648,Tu=2147483647;function Eu($){return Number.isInteger($)&&$<=Tu&&$>=ku}function uu($){return Number.isInteger($)}function JZ(){return!0}var Ru=/[^\\]\\Z/;function gu($){if(Ru.test($))return!1;try{return new RegExp($),!0}catch(v){return!1}}});var KZ=b((LZ)=>{Object.defineProperty(LZ,"__esModule",{value:!0});LZ.formatLimitDefinition=void 0;var xu=Mz(),N4=l(),K6=N4.operators,wX={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}},iu={message:({keyword:$,schemaCode:v})=>N4.str`should be ${wX[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>N4._`{comparison: ${wX[$].okStr}, limit: ${v}}`};LZ.formatLimitDefinition={keyword:Object.keys(wX),type:"string",schemaType:"string",$data:!0,error:iu,code($){let{gen:v,data:D,schemaCode:X,keyword:U,it:G}=$,{opts:J,self:Q}=G;if(!J.validateFormats)return;let I=new xu.KeywordCxt(G,Q.RULES.all.format.definition,"format");if(I.$data)W();else z();function W(){let B=v.scopeValue("formats",{ref:Q.formats,code:J.code.formats}),V=v.const("fmt",N4._`${B}[${I.schemaCode}]`);$.fail$data((0,N4.or)(N4._`typeof ${V} != "object"`,N4._`${V} instanceof RegExp`,N4._`typeof ${V}.compare != "function"`,Y(V)))}function z(){let B=I.schema,V=Q.formats[B];if(!V||V===!0)return;if(typeof V!="object"||V instanceof RegExp||typeof V.compare!="function")throw Error(`"${U}": format "${B}" does not define "compare" function`);let L=v.scopeValue("formats",{key:B,ref:V,code:J.code.formats?N4._`${J.code.formats}${(0,N4.getProperty)(B)}`:void 0});$.fail$data(Y(L))}function Y(B){return N4._`${B}.compare(${D}, ${X}) ${wX[U].fail} 0`}},dependencies:["format"]};var fu=($)=>{return $.addKeyword(LZ.formatLimitDefinition),$};LZ.default=fu});var AZ=b((H0,OZ)=>{Object.defineProperty(H0,"__esModule",{value:!0});var C1=VZ(),_u=KZ(),uz=l(),NZ=new uz.Name("fullFormats"),yu=new uz.Name("fastFormats"),Rz=($,v={keywords:!0})=>{if(Array.isArray(v))return ZZ($,v,C1.fullFormats,NZ),$;let[D,X]=v.mode==="fast"?[C1.fastFormats,yu]:[C1.fullFormats,NZ],U=v.formats||C1.formatNames;if(ZZ($,U,D,X),v.keywords)(0,_u.default)($);return $};Rz.get=($,v="full")=>{let X=(v==="fast"?C1.fastFormats:C1.fullFormats)[$];if(!X)throw Error(`Unknown format "${$}"`);return X};function ZZ($,v,D,X){var U,G;(U=(G=$.opts.code).formats)!==null&&U!==void 0||(G.formats=uz._`require("ajv-formats/dist/formats").${X}`);for(let J of v)$.addFormat(J,D[J])}OZ.exports=H0=Rz;Object.defineProperty(H0,"__esModule",{value:!0});H0.default=Rz});var c4="/auth/api";import{spawn as yA}from"node:child_process";function lA($,v){if($==="darwin")return{command:"open",args:[v]};if($==="win32")return{command:"cmd",args:["/c","start","",v]};return{command:"xdg-open",args:[v]}}function q0($,v=process.platform){return new Promise((D)=>{let{command:X,args:U}=lA(v,$);try{let G=yA(X,U,{stdio:"ignore",detached:!0});G.once("spawn",()=>{G.unref(),D(!0)}),G.once("error",()=>D(!1))}catch{D(!1)}})}import{chmod as hA,mkdir as mA,readFile as rA,rename as cA,rm as dA,writeFile as pA}from"node:fs/promises";import{homedir as tA}from"node:os";import{dirname as oA,join as F5}from"node:path";function j5($){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 aA($){try{return j5(JSON.parse($))}catch{return null}}class w5{Entry;keychainService;constructor($,v){this.Entry=$;this.keychainService=v}async get($){try{return aA(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 eX{filePath;constructor($){this.filePath=$}async readAll(){try{let $=JSON.parse(await rA(this.filePath,"utf8"));if(typeof $!=="object"||$===null)return{};return $}catch{return{}}}async writeAll($){await mA(oA(this.filePath),{recursive:!0,mode:448});let v=`${this.filePath}.${process.pid}.tmp`;await pA(v,JSON.stringify($,null,2),{mode:384}),await hA(v,384),await cA(v,this.filePath)}async get($){return j5((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 dA(this.filePath,{force:!0});return}await this.writeAll(v)}}function S0($,v=process.env){let D=v.XDG_CONFIG_HOME||F5(tA(),".config");return F5(D,$,"credentials.json")}async function k0($){let v=$.credentialsFilePath,D=Boolean($.forceFileEnvVar&&process.env[$.forceFileEnvVar]);if($.forceFile||D)return new eX(v);try{let X=$.loadKeyring??(()=>import("@napi-rs/keyring")),{Entry:U}=await X();return new w5(U,$.keychainService)}catch{return new eX(v)}}async function A4($){let v=await $.text();if(!v)return{};try{let D=JSON.parse(v);return typeof D==="object"&&D!==null?D:{}}catch{return{}}}var eA=`${c4}/.well-known/openid-configuration`;async function T0($,v=fetch){let D=`${$.replace(/\/$/,"")}${eA}`,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 A4(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 M5($,G,D),M5($,J,D),{authorizationEndpoint:G,tokenEndpoint:J}}function M5($,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",sX=["localhost","127.0.0.1","[::1]"];function H4($){return sX.includes($)}function E0($){let v;try{v=new URL($)}catch{throw Error(`Invalid base URL: "${$}"`)}if(v.protocol!=="https:"&&!H4(v.hostname))throw Error(`Base URL must use https (loopback hosts exempt): "${$}"`)}function u0($,v){return`http://${g4}:${v}${$}`}import{createServer as sA}from"node:http";function b5($){let v=$.ok?"accent":"danger",D=$.ok?"✓":"!";return`<!doctype html><html lang="en"><head><meta charset="utf-8">
10
+ deps: ${D}}`};var eE={keyword:"dependencies",type:"object",schemaType:"object",error:zN.error,code($){let[v,D]=sE($);QN($,v),WN($,D)}};function sE({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 QN($,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,H0.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,H0.checkReportMissingProp)($,z)});else D.if(j5._`${W} && (${(0,H0.checkMissingProp)($,Q,G)})`),(0,H0.reportMissingProp)($,G),D.else()}}zN.validatePropertyDeps=QN;function WN($,v=$.schema){let{gen:D,data:X,keyword:U,it:G}=$,J=D.name("valid");for(let Q in v){if((0,aE.alwaysValidSchema)(G,v[Q]))continue;D.if((0,H0.propertyInData)(D,X,Q,G.opts.ownProperties),()=>{let W=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(W,J)},()=>D.var(J,!0)),$.ok(J)}}zN.validateSchemaDeps=WN;zN.default=eE});var BN=b((LN)=>{Object.defineProperty(LN,"__esModule",{value:!0});var KN=l(),UT=d(),DT={message:"property name must be valid",params:({params:$})=>KN._`{propertyName: ${$.propertyName}}`},XT={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:DT,code($){let{gen:v,schema:D,data:X,it:U}=$;if((0,UT.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,KN.not)(G),()=>{if($.error(!0),!U.allErrors)v.break()})}),$.ok(G)}};LN.default=XT});var A5=b((NN)=>{Object.defineProperty(NN,"__esModule",{value:!0});var OX=X4(),N4=l(),JT=m4(),HX=d(),QT={message:"must NOT have additional properties",params:({params:$})=>N4._`{additionalProperty: ${$.additionalProperty}}`},WT={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:QT,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,HX.alwaysValidSchema)(J,D))return;let z=(0,OX.allSchemaProperties)(X.properties),Y=(0,OX.allSchemaProperties)(X.patternProperties);I(),$.ok(N4._`${G} === ${JT.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,HX.schemaRefOrVal)(J,X.properties,"properties");F=(0,OX.isOwnProperty)(v,S,Z)}else if(z.length)F=(0,N4.or)(...z.map((S)=>N4._`${Z} === ${S}`));else F=N4.nil;if(Y.length)F=(0,N4.or)(F,...Y.map((S)=>N4._`${(0,OX.usePattern)($,S)}.test(${Z})`));return(0,N4.not)(F)}function K(Z){v.code(N4._`delete ${U}[${Z}]`)}function L(Z){if(W.removeAdditional==="all"||W.removeAdditional&&D===!1){K(Z);return}if(D===!1){if($.setParams({additionalProperty:Z}),$.error(),!Q)v.break();return}if(typeof D=="object"&&!(0,HX.alwaysValidSchema)(J,D)){let F=v.name("valid");if(W.removeAdditional==="failing")N(Z,F,!1),v.if((0,N4.not)(F),()=>{$.reset(),K(Z)});else if(N(Z,F),!Q)v.if((0,N4.not)(F),()=>v.break())}}function N(Z,F,S){let g={keyword:"additionalProperties",dataProp:Z,dataPropType:HX.Type.Str};if(S===!1)Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(g,F)}}};NN.default=WT});var FN=b((HN)=>{Object.defineProperty(HN,"__esModule",{value:!0});var YT=Q0(),ZN=X4(),w5=d(),ON=A5(),IT={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)ON.default.code(new YT.KeywordCxt(G,ON.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=w5.mergeEvaluated.props(v,(0,w5.toHash)(J),G.props);let Q=J.filter((I)=>!(0,w5.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)}}};HN.default=IT});var PN=b((MN)=>{Object.defineProperty(MN,"__esModule",{value:!0});var jN=X4(),FX=l(),AN=d(),wN=d(),KT={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:v,schema:D,data:X,parentSchema:U,it:G}=$,{opts:J}=G,Q=(0,jN.allSchemaProperties)(D),W=Q.filter((N)=>(0,AN.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 FX.Name))G.props=(0,wN.evaluatedPropsToName)(v,G.props);let{props:I}=G;V();function V(){for(let N of Q){if(z)K(N);if(G.allErrors)L(N);else v.var(Y,!0),L(N),v.if(Y)}}function K(N){for(let Z in z)if(new RegExp(N).test(Z))(0,AN.checkStrictMode)(G,`property ${Z} matches pattern ${N} (use allowMatchingProperties)`)}function L(N){v.forIn("key",X,(Z)=>{v.if(FX._`${(0,jN.usePattern)($,N)}.test(${Z})`,()=>{let F=W.includes(N);if(!F)$.subschema({keyword:"patternProperties",schemaProp:N,dataProp:Z,dataPropType:wN.Type.Str},Y);if(G.opts.unevaluated&&I!==!0)v.assign(FX._`${I}[${Z}]`,!0);else if(!F&&!G.allErrors)v.if((0,FX.not)(Y),()=>v.break())})})}}};MN.default=KT});var qN=b((bN)=>{Object.defineProperty(bN,"__esModule",{value:!0});var BT=d(),NT={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:v,schema:D,it:X}=$;if((0,BT.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"}};bN.default=NT});var kN=b((SN)=>{Object.defineProperty(SN,"__esModule",{value:!0});var OT=X4(),HT={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:OT.validateUnion,error:{message:"must match a schema in anyOf"}};SN.default=HT});var TN=b((EN)=>{Object.defineProperty(EN,"__esModule",{value:!0});var jX=l(),jT=d(),AT={message:"must match exactly one schema in oneOf",params:({params:$})=>jX._`{passingSchemas: ${$.passing}}`},wT={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:AT,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,jT.alwaysValidSchema)(U,Y))v.var(W,!0);else V=$.subschema({keyword:"oneOf",schemaProp:I,compositeRule:!0},W);if(I>0)v.if(jX._`${W} && ${J}`).assign(J,!1).assign(Q,jX._`[${Q}, ${I}]`).else();v.if(W,()=>{if(v.assign(J,!0),v.assign(Q,I),V)$.mergeEvaluated(V,jX.Name)})})}}};EN.default=wT});var gN=b((RN)=>{Object.defineProperty(RN,"__esModule",{value:!0});var PT=d(),bT={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,PT.alwaysValidSchema)(X,G))return;let Q=$.subschema({keyword:"allOf",schemaProp:J},U);$.ok(U),$.mergeEvaluated(Q)})}};RN.default=bT});var fN=b((xN)=>{Object.defineProperty(xN,"__esModule",{value:!0});var AX=l(),uN=d(),ST={message:({params:$})=>AX.str`must match "${$.ifClause}" schema`,params:({params:$})=>AX._`{failingKeyword: ${$.ifClause}}`},kT={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ST,code($){let{gen:v,parentSchema:D,it:X}=$;if(D.then===void 0&&D.else===void 0)(0,uN.checkStrictMode)(X,'"if" without "then" and "else" is ignored');let U=CN(X,"then"),G=CN(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,AX.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,AX._`${Y}`);else $.setParams({ifClause:Y})}}}};function CN($,v){let D=$.schema[v];return D!==void 0&&!(0,uN.alwaysValidSchema)($,D)}xN.default=kT});var iN=b((_N)=>{Object.defineProperty(_N,"__esModule",{value:!0});var TT=d(),RT={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:v,it:D}){if(v.if===void 0)(0,TT.checkStrictMode)(D,`"${$}" without "if" is ignored`)}};_N.default=RT});var nN=b((yN)=>{Object.defineProperty(yN,"__esModule",{value:!0});var CT=H5(),uT=vN(),xT=F5(),fT=XN(),_T=JN(),iT=VN(),yT=BN(),nT=A5(),lT=FN(),hT=PN(),mT=qN(),cT=kN(),rT=TN(),dT=gN(),pT=fN(),tT=iN();function oT($=!1){let v=[mT.default,cT.default,rT.default,dT.default,pT.default,tT.default,yT.default,nT.default,iT.default,lT.default,hT.default];if($)v.push(uT.default,fT.default);else v.push(CT.default,xT.default);return v.push(_T.default),v}yN.default=oT});var hN=b((lN)=>{Object.defineProperty(lN,"__esModule",{value:!0});var L$=l(),eT={message:({schemaCode:$})=>L$.str`must match format "${$}"`,params:({schemaCode:$})=>L$._`{format: ${$}}`},sT={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 K();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(),g()));function S(){if(W.strictSchema===!1)return L$.nil;return L$._`${J} && !${F}`}function g(){let u=Y.$async?L$._`(${N}.async ? await ${F}(${X}) : ${F}(${X}))`:L$._`${F}(${X})`,k=L$._`(typeof ${F} == "function" ? ${u} : ${F}.test(${X}))`;return L$._`${F} && ${F} !== true && ${Z} === ${v} && !${k}`}}function K(){let L=I.formats[G];if(!L){S();return}if(L===!0)return;let[N,Z,F]=g(L);if(N===v)$.pass(u());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 g(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 u(){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})`}}}};lN.default=sT});var cN=b((mN)=>{Object.defineProperty(mN,"__esModule",{value:!0});var v2=hN(),U2=[v2.default];mN.default=U2});var pN=b((rN)=>{Object.defineProperty(rN,"__esModule",{value:!0});rN.contentVocabulary=rN.metadataVocabulary=void 0;rN.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];rN.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var aN=b((oN)=>{Object.defineProperty(oN,"__esModule",{value:!0});var G2=HB(),J2=rB(),Q2=nN(),W2=cN(),tN=pN(),z2=[G2.default,J2.default,(0,Q2.default)(),W2.default,tN.metadataVocabulary,tN.contentVocabulary];oN.default=z2});var vZ=b((sN)=>{Object.defineProperty(sN,"__esModule",{value:!0});sN.DiscrError=void 0;var eN;(function($){$.Tag="tag",$.Mapping="mapping"})(eN||(sN.DiscrError=eN={}))});var XZ=b((DZ)=>{Object.defineProperty(DZ,"__esModule",{value:!0});var C1=l(),M5=vZ(),UZ=GX(),I2=W0(),V2=d(),K2={message:({params:{discrError:$,tagName:v}})=>$===M5.DiscrError.Tag?`tag "${v}" must be string`:`value of tag "${v}" must be in oneOf`,params:({params:{discrError:$,tag:v,tagName:D}})=>C1._`{error: ${$}, tag: ${D}, tagValue: ${v}}`},L2={keyword:"discriminator",type:"object",schemaType:"object",error:K2,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",C1._`${D}${(0,C1.getProperty)(Q)}`);v.if(C1._`typeof ${z} == "string"`,()=>Y(),()=>$.error(!1,{discrError:M5.DiscrError.Tag,tag:z,tagName:Q})),$.ok(W);function Y(){let K=V();v.if(!1);for(let L in K)v.elseIf(C1._`${z} === ${L}`),v.assign(W,I(K[L]));v.else(),$.error(!1,{discrError:M5.DiscrError.Mapping,tag:z,tagName:Q}),v.endIf()}function I(K){let L=v.name("valid"),N=$.subschema({keyword:"oneOf",schemaProp:K},L);return $.mergeEvaluated(N,C1.Name),L}function V(){var K;let L={},N=F(U),Z=!0;for(let u=0;u<J.length;u++){let k=J[u];if((k===null||k===void 0?void 0:k.$ref)&&!(0,V2.schemaHasRulesButRef)(k,G.self.RULES)){let j$=k.$ref;if(k=UZ.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,j$),k instanceof UZ.SchemaEnv)k=k.schema;if(k===void 0)throw new I2.default(G.opts.uriResolver,G.baseId,j$)}let N$=(K=k===null||k===void 0?void 0:k.properties)===null||K===void 0?void 0:K[Q];if(typeof N$!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Q}"`);Z=Z&&(N||F(k)),S(N$,u)}if(!Z)throw Error(`discriminator: "${Q}" must be required`);return L;function F({required:u}){return Array.isArray(u)&&u.includes(Q)}function S(u,k){if(u.const)g(u.const,k);else if(u.enum)for(let N$ of u.enum)g(N$,k);else throw Error(`discriminator: "properties/${Q}" must have "const" or "enum"`)}function g(u,k){if(typeof u!="string"||u in L)throw Error(`discriminator: "${Q}" values must be unique strings`);L[u]=k}}}};DZ.default=L2});var GZ=b((jd,N2)=>{N2.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 b5=b((d$,P5)=>{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 Z2=zB(),O2=aN(),H2=XZ(),JZ=GZ(),F2=["/properties"],wX="http://json-schema.org/draft-07/schema";class F0 extends Z2.default{_addVocabularies(){if(super._addVocabularies(),O2.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(H2.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(JZ,F2):JZ;this.addMetaSchema($,wX,!1),this.refs["http://json-schema.org/schema"]=wX}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(wX)?wX:void 0)}}d$.Ajv=F0;P5.exports=d$=F0;P5.exports.Ajv=F0;Object.defineProperty(d$,"__esModule",{value:!0});d$.default=F0;var j2=Q0();Object.defineProperty(d$,"KeywordCxt",{enumerable:!0,get:function(){return j2.KeywordCxt}});var u1=l();Object.defineProperty(d$,"_",{enumerable:!0,get:function(){return u1._}});Object.defineProperty(d$,"str",{enumerable:!0,get:function(){return u1.str}});Object.defineProperty(d$,"stringify",{enumerable:!0,get:function(){return u1.stringify}});Object.defineProperty(d$,"nil",{enumerable:!0,get:function(){return u1.nil}});Object.defineProperty(d$,"Name",{enumerable:!0,get:function(){return u1.Name}});Object.defineProperty(d$,"CodeGen",{enumerable:!0,get:function(){return u1.CodeGen}});var A2=DX();Object.defineProperty(d$,"ValidationError",{enumerable:!0,get:function(){return A2.default}});var w2=W0();Object.defineProperty(d$,"MissingRefError",{enumerable:!0,get:function(){return w2.default}})});var NZ=b((LZ)=>{Object.defineProperty(LZ,"__esModule",{value:!0});LZ.formatNames=LZ.fastFormats=LZ.fullFormats=void 0;function E4($,v){return{validate:$,compare:v}}LZ.fullFormats={date:E4(YZ,E5),time:E4(S5(!0),T5),"date-time":E4(QZ(!0),VZ),"iso-time":E4(S5(),IZ),"iso-date-time":E4(QZ(),KZ),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:T2,"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:_2,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:R2,int32:{type:"number",validate:u2},int64:{type:"number",validate:x2},float:{type:"number",validate:zZ},double:{type:"number",validate:zZ},password:!0,binary:!0};LZ.fastFormats={...LZ.fullFormats,date:E4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,E5),time:E4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,T5),"date-time":E4(/^\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,VZ),"iso-time":E4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,IZ),"iso-date-time":E4(/^\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,KZ),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};LZ.formatNames=Object.keys(LZ.fullFormats);function b2($){return $%4===0&&($%100!==0||$%400===0)}var q2=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,S2=[0,31,28,31,30,31,30,31,31,30,31,30,31];function YZ($){let v=q2.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&&b2(D)?29:S2[X])}function E5($,v){if(!($&&v))return;if($>v)return 1;if($<v)return-1;return 0}var q5=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function S5($){return function(D){let X=q5.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 T5($,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 IZ($,v){if(!($&&v))return;let D=q5.exec($),X=q5.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 k5=/t|\s/i;function QZ($){let v=S5($);return function(X){let U=X.split(k5);return U.length===2&&YZ(U[0])&&v(U[1])}}function VZ($,v){if(!($&&v))return;let D=new Date($).valueOf(),X=new Date(v).valueOf();if(!(D&&X))return;return D-X}function KZ($,v){if(!($&&v))return;let[D,X]=$.split(k5),[U,G]=v.split(k5),J=E5(D,U);if(J===void 0)return;return J||T5(X,G)}var k2=/\/|:/,E2=/^(?:[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 T2($){return k2.test($)&&E2.test($)}var WZ=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function R2($){return WZ.lastIndex=0,WZ.test($)}var g2=-2147483648,C2=2147483647;function u2($){return Number.isInteger($)&&$<=C2&&$>=g2}function x2($){return Number.isInteger($)}function zZ(){return!0}var f2=/[^\\]\\Z/;function _2($){if(f2.test($))return!1;try{return new RegExp($),!0}catch(v){return!1}}});var OZ=b((ZZ)=>{Object.defineProperty(ZZ,"__esModule",{value:!0});ZZ.formatLimitDefinition=void 0;var y2=b5(),Z4=l(),N6=Z4.operators,MX={formatMaximum:{okStr:"<=",ok:N6.LTE,fail:N6.GT},formatMinimum:{okStr:">=",ok:N6.GTE,fail:N6.LT},formatExclusiveMaximum:{okStr:"<",ok:N6.LT,fail:N6.GTE},formatExclusiveMinimum:{okStr:">",ok:N6.GT,fail:N6.LTE}},n2={message:({keyword:$,schemaCode:v})=>Z4.str`should be ${MX[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>Z4._`{comparison: ${MX[$].okStr}, limit: ${v}}`};ZZ.formatLimitDefinition={keyword:Object.keys(MX),type:"string",schemaType:"string",$data:!0,error:n2,code($){let{gen:v,data:D,schemaCode:X,keyword:U,it:G}=$,{opts:J,self:Q}=G;if(!J.validateFormats)return;let W=new y2.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}),K=v.const("fmt",Z4._`${V}[${W.schemaCode}]`);$.fail$data((0,Z4.or)(Z4._`typeof ${K} != "object"`,Z4._`${K} instanceof RegExp`,Z4._`typeof ${K}.compare != "function"`,I(K)))}function Y(){let V=W.schema,K=Q.formats[V];if(!K||K===!0)return;if(typeof K!="object"||K instanceof RegExp||typeof K.compare!="function")throw Error(`"${U}": format "${V}" does not define "compare" function`);let L=v.scopeValue("formats",{key:V,ref:K,code:J.code.formats?Z4._`${J.code.formats}${(0,Z4.getProperty)(V)}`:void 0});$.fail$data(I(L))}function I(V){return Z4._`${V}.compare(${D}, ${X}) ${MX[U].fail} 0`}},dependencies:["format"]};var l2=($)=>{return $.addKeyword(ZZ.formatLimitDefinition),$};ZZ.default=l2});var AZ=b((j0,jZ)=>{Object.defineProperty(j0,"__esModule",{value:!0});var x1=NZ(),m2=OZ(),C5=l(),HZ=new C5.Name("fullFormats"),c2=new C5.Name("fastFormats"),u5=($,v={keywords:!0})=>{if(Array.isArray(v))return FZ($,v,x1.fullFormats,HZ),$;let[D,X]=v.mode==="fast"?[x1.fastFormats,c2]:[x1.fullFormats,HZ],U=v.formats||x1.formatNames;if(FZ($,U,D,X),v.keywords)(0,m2.default)($);return $};u5.get=($,v="full")=>{let X=(v==="fast"?x1.fastFormats:x1.fullFormats)[$];if(!X)throw Error(`Unknown format "${$}"`);return X};function FZ($,v,D,X){var U,G;(U=(G=$.opts.code).formats)!==null&&U!==void 0||(G.formats=C5._`require("ajv-formats/dist/formats").${X}`);for(let J of v)$.addFormat(J,D[J])}jZ.exports=j0=u5;Object.defineProperty(j0,"__esModule",{value:!0});j0.default=u5});var d4="/auth/api";import{spawn as cH}from"node:child_process";function rH($,v){if($==="darwin")return{command:"open",args:[v]};if($==="win32")return{command:"cmd",args:["/c","start","",v]};return{command:"xdg-open",args:[v]}}function S0($,v=process.platform){return new Promise((D)=>{let{command:X,args:U}=rH(v,$);try{let G=cH(X,U,{stdio:"ignore",detached:!0});G.once("spawn",()=>{G.unref(),D(!0)}),G.once("error",()=>D(!1))}catch{D(!1)}})}import{chmod as dH,mkdir as pH,readFile as tH,rename as oH,rm as aH,writeFile as eH}from"node:fs/promises";import{homedir as sH}from"node:os";import{dirname as $3,join as M7}from"node:path";function P7($){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 v3($){try{return P7(JSON.parse($))}catch{return null}}class b7{Entry;keychainService;constructor($,v){this.Entry=$;this.keychainService=v}async get($){try{return v3(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 $G{filePath;constructor($){this.filePath=$}async readAll(){try{let $=JSON.parse(await tH(this.filePath,"utf8"));if(typeof $!=="object"||$===null)return{};return $}catch{return{}}}async writeAll($){await pH($3(this.filePath),{recursive:!0,mode:448});let v=`${this.filePath}.${process.pid}.tmp`;await eH(v,JSON.stringify($,null,2),{mode:384}),await dH(v,384),await oH(v,this.filePath)}async get($){return P7((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 aH(this.filePath,{force:!0});return}await this.writeAll(v)}}function k0($,v=process.env){let D=v.XDG_CONFIG_HOME||M7(sH(),".config");return M7(D,$,"credentials.json")}async function E0($){let v=$.credentialsFilePath,D=Boolean($.forceFileEnvVar&&process.env[$.forceFileEnvVar]);if($.forceFile||D)return new $G(v);try{let X=$.loadKeyring??(()=>import("@napi-rs/keyring")),{Entry:U}=await X();return new b7(U,$.keychainService)}catch{return new $G(v)}}async function F4($){let v=await $.text();if(!v)return{};try{let D=JSON.parse(v);return typeof D==="object"&&D!==null?D:{}}catch{return{}}}var U3=`${d4}/.well-known/openid-configuration`;async function T0($,v=fetch){let D=`${$.replace(/\/$/,"")}${U3}`,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 F4(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 q7($,G,D),q7($,J,D),{authorizationEndpoint:G,tokenEndpoint:J}}function q7($,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 u4="127.0.0.1",vG=["localhost","127.0.0.1","[::1]"];function j4($){return vG.includes($)}function R0($){let v;try{v=new URL($)}catch{throw Error(`Invalid base URL: "${$}"`)}if(v.protocol!=="https:"&&!j4(v.hostname))throw Error(`Base URL must use https (loopback hosts exempt): "${$}"`)}function g0($,v){return`http://${u4}:${v}${$}`}import{createServer as D3}from"node:http";function k7($){let v=$.ok?"accent":"danger",D=$.ok?"✓":"!";return`<!doctype html><html lang="en"><head><meta charset="utf-8">
11
11
  <title>${$.title}</title><meta name="viewport" content="width=device-width, initial-scale=1">
12
12
  <style>
13
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%}
@@ -20,41 +20,41 @@ h1{margin:0 0 .5rem;font-size:1.25rem;font-weight:700;letter-spacing:-.01em}
20
20
  p{margin:0;color:hsl(var(--muted));font-size:.95rem}
21
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
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 $H=b5({title:"Signed in · Aether Wealth",heading:"Signed in to Aether Wealth",detail:"You can close this tab and return to your assistant.",ok:!0}),P5=b5({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 vH($,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 UH($,v){let D;for(let U of v){let G=await vH($,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 R0($,v){let D=null,X=null,U=null,G=(I)=>{if(D)return;if(D=I,I?.ok)X?.(I.value);else if(I)U?.(I.error)},J=sA((I,W)=>{let z=new URL(I.url??"/",`http://${g4}`);if(z.pathname!==v){W.writeHead(404).end("not found");return}let Y=z.searchParams.get("error"),B=z.searchParams.get("code"),V=z.searchParams.get("state");if(Y){W.writeHead(400,{"content-type":"text/html"}).end(P5),G({ok:!1,error:Error(`authorization denied: ${Y}`)});return}if(!B||!V){W.writeHead(400,{"content-type":"text/html"}).end(P5),G({ok:!1,error:Error("callback missing code or state")});return}W.writeHead(200,{"content-type":"text/html"}).end($H),G({ok:!0,value:{code:B,state:V}})}),Q=await UH(J,$);return{redirectUri:u0(v,Q),waitForCode(I){return new Promise((W,z)=>{let Y=setTimeout(()=>z(Error("timed out waiting for the browser sign-in to complete")),I);if(Y.unref(),X=(B)=>{clearTimeout(Y),W(B)},U=(B)=>{clearTimeout(Y),z(B)},D?.ok)X(D.value);else if(D)U(D.error)})},close(){return new Promise((I)=>J.close(()=>I()))}}}import{createHash as DH,randomBytes as q5}from"node:crypto";function $G($){return $.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function g0($={}){let v=$G(($.randomBytesImpl??q5)(32)),D=$.hashImpl?$.hashImpl(v):DH("sha256").update(v).digest();return{verifier:v,challenge:$G(D),method:"S256"}}function C0($=q5){return $G($(16))}var vG=300000;async function x0($){let v=$.fetchImpl??fetch,D=$.log??(()=>{}),X=$.now??Date.now,{clientId:U,redirectPorts:G,redirectPath:J,scopes:Q}=$.identity;E0($.authBaseUrl);let I=await T0($.authBaseUrl,v),W=g0(),z=C0(),Y=await R0(G,J);try{let B=XH($.authBaseUrl),V=UG(I.authorizationEndpoint,{clientId:U,redirectUri:Y.redirectUri,scope:Q.join(" "),state:z,codeChallenge:W.challenge,...B?{prompt:"consent"}:{}});if(D(`Opening your browser to sign in. If it doesn't open, visit:
24
- ${V}
25
- `),!await($.openBrowserImpl??q0)(V))D(`Could not open a browser automatically — open the URL above manually.
26
- `);let{code:N,state:Z}=await Y.waitForCode(vG);if(Z!==z)throw Error("OAuth state mismatch — aborting login (possible CSRF).");return await DG(I.tokenEndpoint,{code:N,codeVerifier:W.verifier,redirectUri:Y.redirectUri,clientId:U},v,X)}finally{await Y.close()}}function UG($,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 XH($){try{return H4(new URL($).hostname)}catch{return!1}}async function DG($,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 A4(G),Q=J.access_token,I=J.expires_in;if(!G.ok||typeof Q!=="string")throw Error(`OAuth token exchange failed: ${GH(J,G.status)}`);if(typeof I!=="number"||I<=0)throw Error("OAuth token exchange returned no valid expires_in");return{accessToken:Q,expiresAt:X()+I*1000}}function GH($,v){if(typeof $.error_description==="string")return $.error_description;if(typeof $.error==="string")return $.error;return`HTTP ${v}`}var r1=`${c4}/oauth2/userinfo`;async function XG($,v,D=fetch){let X=`${$.replace(/\/$/,"")}${r1}`,U;try{U=await D(X,{method:"GET",headers:{authorization:`Bearer ${v}`,accept:"application/json"}})}catch(W){throw Error(`Could not reach the Aether Wealth userinfo endpoint at ${X}`,{cause:W})}if(!U.ok)throw Error(`Aether Wealth userinfo request failed (HTTP ${U.status})`);let G=await A4(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,I=typeof G.name==="string"?G.name:void 0;return{sub:J,...Q?{email:Q}:{},...I?{name:I}:{}}}async function i0($,v,D=fetch){return(await XG($,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 i0(this.target.baseUrl,$);return this.cachedUserId={token:$,userId:v},v}async login(){let $=await(this.deps.runLoginImpl??x0)({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:JH,defineProperty:S5,getOwnPropertyDescriptor:QH,getOwnPropertyNames:k5,getPrototypeOf:IH}=Object,WH=Object.prototype.hasOwnProperty,I4=($,v)=>function(){return v||(0,$[k5($)[0]])((v={exports:{}}).exports,v),v.exports},zH=($,v,D,X)=>{if(v&&typeof v==="object"||typeof v==="function"){for(var U=k5(v),G=0,J=U.length,Q;G<J;G++)if(Q=U[G],!WH.call($,Q)&&Q!==D)S5($,Q,{get:((I)=>v[I]).bind(null,Q),enumerable:!(X=QH(v,Q))||X.enumerable})}return $},$$=($,v,D)=>(D=$!=null?JH(IH($)):{},zH(v||!$||!$.__esModule?S5(D,"default",{value:$,enumerable:!0}):D,$)),T5=I4({"../../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}}),YH=I4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,v){var D=T5().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}}),BH=I4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,v){var D=T5().default,X=YH();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=I4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,v){var D=BH();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}}),A$=I4({"../../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 I=Object.getOwnPropertySymbols(G);J&&(I=I.filter(function(W){return Object.getOwnPropertyDescriptor(G,W).enumerable})),Q.push.apply(Q,I)}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(I){D(G,I,Q[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(G,Object.getOwnPropertyDescriptors(Q)):X(Object(Q)).forEach(function(I){Object.defineProperty(G,I,Object.getOwnPropertyDescriptor(Q,I))})}return G}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}});function W4($){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(I){var W;if(U)return;(W=D.next)===null||W===void 0||W.call(D,I)},error(I){var W;if(U)return;U=!0,(W=D.error)===null||W===void 0||W.call(D,I),Q()},complete(){var I;if(U)return;U=!0,(I=D.complete)===null||I===void 0||I.call(D),Q()}}),J)Q();return{unsubscribe:Q}},pipe(...D){return D.reduce(VH,v)}};return v}function VH($,v){return v($)}function GG($){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(I){G=!0,X(I),J()},error(I){U(I)},complete(){v.abort(),J()}})})}function JG($){return(v)=>{let D=0,X=null,U=[];function G(){if(X)return;X=v.subscribe({next(Q){for(let W of U){var I;(I=W.next)===null||I===void 0||I.call(W,Q)}},error(Q){for(let W of U){var I;(I=W.error)===null||I===void 0||I.call(W,Q)}},complete(){for(let I of U){var Q;(Q=I.complete)===null||Q===void 0||Q.call(I)}}})}function J(){if(D===0&&X){let Q=X;X=null,Q.unsubscribe()}}return W4((Q)=>{return D++,U.push(Q),G(),{unsubscribe(){D--,J();let I=U.findIndex((W)=>W===Q);if(I>-1)U.splice(I,1)}}})}}var xC=Symbol();function f0($){let v=$,D=[],X=(J)=>{if(v!==void 0)J.next(v);D.push(J)},U=(J)=>{D.splice(D.indexOf(J),1)},G=W4((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 E5($){return W4((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(I){return D(U+1,I)}})}return D().subscribe(v)})}function C4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function n0(){return Object.create(null)}var C6={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 u5=[C6.BAD_GATEWAY,C6.SERVICE_UNAVAILABLE,C6.GATEWAY_TIMEOUT,C6.INTERNAL_SERVER_ERROR];var{create:KH,defineProperty:g5,getOwnPropertyDescriptor:NH,getOwnPropertyNames:C5,getPrototypeOf:ZH}=Object,OH=Object.prototype.hasOwnProperty,d1=($,v)=>function(){return v||(0,$[C5($)[0]])((v={exports:{}}).exports,v),v.exports},AH=($,v,D,X)=>{if(v&&typeof v==="object"||typeof v==="function"){for(var U=C5(v),G=0,J=U.length,Q;G<J;G++)if(Q=U[G],!OH.call($,Q)&&Q!==D)g5($,Q,{get:((I)=>v[I]).bind(null,Q),enumerable:!(X=NH(v,Q))||X.enumerable})}return $},p1=($,v,D)=>(D=$!=null?KH(ZH($)):{},AH(v||!$||!$.__esModule?g5(D,"default",{value:$,enumerable:!0}):D,$)),x5=()=>{},R5=($)=>{if(Object.freeze)Object.freeze($)};function i5($,v,D){var X;let U=v.join(".");return(X=D[U])!==null&&X!==void 0||(D[U]=new Proxy(x5,{get(G,J){if(typeof J!=="string"||J==="then")return;return i5($,[...v,J],D)},apply(G,J,Q){let I=v[v.length-1];if(I==="valueOf"||I==="toString"||I==="toJSON")return`tRPC.proxy(${v.slice(0,-1).join(".")})`;let W={args:Q,path:v};if(I==="call")W={args:Q.length>=2?[Q[1]]:[],path:v.slice(0,-1)};else if(I==="apply")W={args:Q.length>=2?Q[1]:[],path:v.slice(0,-1)};return R5(W.args),R5(W.path),$(W)}})),D[U]}var _0=($)=>i5($,[],n0()),QG=($)=>{return new Proxy(x5,{get(v,D){if(D==="then")return;return $(D)}})};var f5=d1({"../../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}}),HH=d1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,v){var D=f5().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}}),FH=d1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,v){var D=f5().default,X=HH();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}}),IG=d1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,v){var D=FH();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}}),y0=d1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,v){var D=IG();function X(G,J){var Q=Object.keys(G);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(G);J&&(I=I.filter(function(W){return Object.getOwnPropertyDescriptor(G,W).enumerable})),Q.push.apply(Q,I)}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(I){D(G,I,Q[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(G,Object.getOwnPropertyDescriptors(Q)):X(Object(Q)).forEach(function(I){Object.defineProperty(G,I,Object.getOwnPropertyDescriptor(Q,I))})}return G}v.exports=U,v.exports.__esModule=!0,v.exports.default=v.exports}}),aC=p1(y0(),1);var vx=p1(IG(),1);var l0=p1(y0(),1);function MH($,v){if("error"in $){let X=v.deserialize($.error);return{ok:!1,error:(0,l0.default)((0,l0.default)({},$),{},{error:X})}}return{ok:!0,result:(0,l0.default)((0,l0.default)({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:v.deserialize($.result.data)})}}var WG=class extends Error{constructor(){super("Unable to transform response from server")}};function zG($,v){let D;try{D=MH($,v)}catch(X){throw new WG}if(!D.ok&&(!C4(D.error.error)||typeof D.error.error.code!=="number"))throw new WG;if(D.ok&&!C4(D.result))throw new WG;return D}var Ux=p1(y0(),1);var Dx=Symbol();var h0=$$(F4(),1),x6=$$(A$(),1);function n5($){return $ instanceof j4}function SH($){return C4($)&&C4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function kH($,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,h0.default)(this,"cause",void 0),(0,h0.default)(this,"shape",void 0),(0,h0.default)(this,"data",void 0),(0,h0.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(n5(X)){if(D.meta)X.meta=(0,x6.default)((0,x6.default)({},X.meta),D.meta);return X}if(SH(X))return new $(X.error.message,(0,x6.default)((0,x6.default)({},D),{},{result:X,cause:D.cause}));return new $(kH(X,"Unknown error"),(0,x6.default)((0,x6.default)({},D),{},{cause:X}))}};function m0($){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 _5=($)=>typeof $==="function";function y5($){if($)return $;if(typeof window<"u"&&_5(window.fetch))return window.fetch;if(typeof globalThis<"u"&&_5(globalThis.fetch))return globalThis.fetch;throw Error("No fetch implementation found")}var t1=$$(A$());function r0($){return{url:$.url.toString(),fetch:$.fetch,transformer:m0($.transformer),methodOverride:$.methodOverride}}function TH($){let v={};for(let D=0;D<$.length;D++){let X=$[D];v[D]=X}return v}var EH={query:"GET",mutation:"POST",subscription:"PATCH"};function l5($){return"input"in $?$.transformer.input.serialize($.input):TH($.inputs.map((v)=>$.transformer.input.serialize(v)))}var o1=($)=>{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=l5($);if(G!==void 0&&$.methodOverride!=="POST")U.push(`input=${encodeURIComponent(JSON.stringify(G))}`)}if(U.length)X+="?"+U.join("&");return X},h5=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let v=l5($);return v!==void 0?JSON.stringify(v):void 0},YG=($)=>{return r5((0,t1.default)((0,t1.default)({},$),{},{contentTypeHeader:"application/json",getUrl:o1,getBody:h5}))},uH=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},RH=($)=>{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 uH};async function m5($){var v,D;RH($.signal);let X=$.getUrl($),U=$.getBody($),G=(v=$.methodOverride)!==null&&v!==void 0?v:EH[$.type],J=await(async()=>{let I=await $.headers();if(Symbol.iterator in I)return Object.fromEntries(I);return I})(),Q=(0,t1.default)((0,t1.default)((0,t1.default)({},$.contentTypeHeader&&G!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(D=$.trpcAcceptHeaderKey)!==null&&D!==void 0?D:"trpc-accept"]:$.trpcAcceptHeader}:void 0),J);return y5($.fetch)(X,{method:G,signal:$.signal,body:U,headers:Q})}async function r5($){let v={},D=await m5($);v.response=D;let X=await D.json();return v.responseJSON=X,{json:X,meta:v}}var Bi=$$(A$(),1);var c5=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function BG($){let v=null,D=null,X=()=>{clearTimeout(D),D=null,v=null};function U(Q){let I=[[]],W=0;while(!0){let B=Q[W];if(!B)break;let V=I[I.length-1];if(B.aborted){var z;(z=B.reject)===null||z===void 0||z.call(B,Error("Aborted")),W++;continue}if($.validate(V.concat(B).map((N)=>N.key))){V.push(B),W++;continue}if(V.length===0){var Y;(Y=B.reject)===null||Y===void 0||Y.call(B,Error("Input is too big for a single dispatch")),W++;continue}I.push([])}return I}function G(){let Q=U(v);X();for(let I of Q){if(!I.length)continue;let W={items:I};for(let Y of I)Y.batch=W;$.fetch(W.items.map((Y)=>Y.key)).then(async(Y)=>{await Promise.all(Y.map(async(V,L)=>{let N=W.items[L];try{var Z;let S=await Promise.resolve(V);(Z=N.resolve)===null||Z===void 0||Z.call(N,S)}catch(S){var H;(H=N.reject)===null||H===void 0||H.call(N,S)}N.batch=null,N.reject=null,N.resolve=null}));for(let V of W.items){var B;(B=V.reject)===null||B===void 0||B.call(V,Error("Missing result")),V.batch=null}}).catch((Y)=>{for(let V of W.items){var B;(B=V.reject)===null||B===void 0||B.call(V,Y),V.batch=null}})}}function J(Q){var I;let W={aborted:!1,key:Q,batch:null,resolve:c5,reject:c5},z=new Promise((Y,B)=>{var V;W.reject=B,W.resolve=Y,(V=v)!==null&&V!==void 0||(v=[]),v.push(W)});return(I=D)!==null&&I!==void 0||(D=setTimeout(G)),z}return{load:J}}function d5(...$){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 c0=$$(A$(),1);function VG($){var v,D;let X=r0($),U=(v=$.maxURLLength)!==null&&v!==void 0?v:1/0,G=(D=$.maxItems)!==null&&D!==void 0?D:1/0;return()=>{let J=(z)=>{return{validate(Y){if(U===1/0&&G===1/0)return!0;if(Y.length>G)return!1;let B=Y.map((N)=>N.path).join(","),V=Y.map((N)=>N.input);return o1((0,c0.default)((0,c0.default)({},X),{},{type:z,path:B,inputs:V,signal:null})).length<=U},async fetch(Y){let B=Y.map((S)=>S.path).join(","),V=Y.map((S)=>S.input),L=d5(...Y.map((S)=>S.signal)),N=await YG((0,c0.default)((0,c0.default)({},X),{},{path:B,inputs:V,type:z,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({opList:Y});return $.headers},signal:L}));return(Array.isArray(N.json)?N.json:Y.map(()=>N.json)).map((S)=>({meta:N.meta,json:S}))}}},Q=BG(J("query")),I=BG(J("mutation")),W={query:Q,mutation:I};return({op:z})=>{return W4((Y)=>{if(z.type==="subscription")throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let V=W[z.type].load(z),L=void 0;return V.then((N)=>{L=N;let Z=zG(N.json,X.transformer.output);if(!Z.ok){Y.error(j4.from(Z.error,{meta:N.meta}));return}Y.next({context:N.meta,result:Z.result}),Y.complete()}).catch((N)=>{Y.error(j4.from(N,{meta:L===null||L===void 0?void 0:L.meta}))}),()=>{}})}}}var Fi=$$(A$(),1);var LG=($,...v)=>{return typeof $==="function"?$(...v):$},qi=$$(F4(),1);function gH(){let $,v;return{promise:new Promise((X,U)=>{$=X,v=U}),resolve:$,reject:v}}async function CH($){let v=await LG($.url);if(!$.connectionParams)return v;let X=`${v.includes("?")?"&":"?"}connectionParams=1`;return v+X}async function xH($,v){let D={method:"connectionParams",data:await LG($)};return v.encode(D)}var Si=$$(F4(),1);var d4=$$(F4(),1);function iH($){let{promise:v,resolve:D,reject:X}=gH();return $.addEventListener("open",()=>{$.removeEventListener("error",X),D()}),$.addEventListener("error",X),v}function fH($,{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:I})=>{if(clearTimeout(X),G(),I==="PONG")Q()}),$.addEventListener("close",()=>{clearTimeout(X),clearTimeout(U)})}var nH=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",f0(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=CH(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)fH(X,v.keepAliveOpts);if(X.addEventListener("close",()=>{if(v.ws===X)v.ws=null}),await iH(X),v.urlOptions.connectionParams)X.send(await xH(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)(nH,"connectCount",0);var ki=$$(F4(),1),Ti=$$(A$(),1);var KG=$$(F4(),1),p5=$$(A$(),1),_H=class{constructor($){(0,KG.default)(this,"links",void 0),(0,KG.default)(this,"runtime",void 0),(0,KG.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((v)=>v(this.runtime))}$request($){var v;return E5({links:this.links,op:(0,p5.default)((0,p5.default)({},$),{},{context:(v=$.context)!==null&&v!==void 0?v:{},id:++this.requestId})}).pipe(JG())}async requestAsPromise($){var v=this;try{let D=v.$request($);return(await GG(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 I;(I=D.onData)===null||I===void 0||I.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 yH=Symbol.for("trpc_untypedClient"),lH={query:"query",mutate:"mutation",subscribe:"subscription"},hH=($)=>{return lH[$]};function mH($){let v=_0(({path:D,args:X})=>{let U=[...D],G=hH(U.pop()),J=U.join(".");return $[G](J,...X)});return QG((D)=>{if(D===yH)return $;return v[D]})}function a5($){let v=new _H($);return mH(v)}var Gf=$$(A$(),1);var t5=$$(A$(),1);function rH($,v){if(!v)return $;if($!=null&&typeof $!=="object")return $;return(0,t5.default)((0,t5.default)({},$!==null&&$!==void 0?$:{}),{},{lastEventId:v})}var cH=I4({"../../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,I=2;for(typeof Symbol<"u"&&(J=Symbol.asyncIterator,Q=Symbol.iterator);I--;){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(I){return{value:I,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 I=this.s.return;return I===void 0?Promise.resolve({value:Q,done:!0}):G(I.apply(this.s,arguments))},throw:function(Q){var I=this.s.return;return I===void 0?Promise.reject(Q):G(I.apply(this.s,arguments))}},new X(U)}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),Jf=$$(cH(),1);var o5=$$(A$(),1);function e5($){return()=>{return(v)=>{return W4((D)=>{let X,U=void 0,G=void 0;Q(1);function J(){let I=v.op;if(!G)return I;return(0,o5.default)((0,o5.default)({},I),{},{input:rH(I.input,G)})}function Q(I){let W=J();X=v.next(W).subscribe({error(z){var Y,B;if(!$.retry({op:W,attempts:I,error:z})){D.error(z);return}let L=(Y=(B=$.retryDelayMs)===null||B===void 0?void 0:B.call($,I))!==null&&Y!==void 0?Y:0;if(L<=0){Q(I+1);return}U=setTimeout(()=>Q(I+1),L)},next(z){if((!z.result.type||z.result.type==="data")&&z.result.id)G=z.result.id;D.next(z)},complete(){D.complete()}})}return()=>{X.unsubscribe(),clearTimeout(U)}})}}}var dH=I4({"../../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,I){var W=Error();return W.name="SuppressedError",W.error=Q,W.suppressed=I,W},U={},G=[];function J(Q,I){if(I!=null){if(Object(I)!==I)throw TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(Q)var W=I[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(W===void 0&&(W=I[Symbol.dispose||Symbol.for("Symbol.dispose")],Q))var z=W;if(typeof W!="function")throw TypeError("Object is not disposable.");z&&(W=function(){try{z.call(I)}catch(B){return Promise.reject(B)}}),G.push({v:I,d:W,a:Q})}else Q&&G.push({d:I,a:Q});return I}return{e:U,u:J.bind(null,!1),a:J.bind(null,!0),d:function(){var I,W=this.e,z=0;function Y(){for(;I=G.pop();)try{if(!I.a&&z===1)return z=0,G.push(I),Promise.resolve().then(Y);if(I.d){var V=I.d.call(I.v);if(I.a)return z|=2,Promise.resolve(V).then(Y,B)}else z|=1}catch(L){return B(L)}if(z===1)return W!==U?Promise.reject(W):Promise.resolve();if(W!==U)throw W}function B(V){return W=W!==U?new X(V,W):V,Y()}return Y()}}}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),s5=I4({"../../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}}),pH=I4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,v){var D=s5();function X(U){return new D(U,0)}v.exports=X,v.exports.__esModule=!0,v.exports.default=v.exports}}),tH=I4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,v){var D=s5();function X(G){return function(){return new U(G.apply(this,arguments))}}function U(G){var J,Q;function I(z,Y){try{var B=G[z](Y),V=B.value,L=V instanceof D;Promise.resolve(L?V.v:V).then(function(N){if(L){var Z=z==="return"?"return":"next";if(!V.k||N.done)return I(Z,N);N=G[Z](N).value}W(B.done?"return":"normal",N)},function(N){I("throw",N)})}catch(N){W("throw",N)}}function W(z,Y){switch(z){case"return":J.resolve({value:Y,done:!0});break;case"throw":J.reject(Y);break;default:J.resolve({value:Y,done:!1})}(J=J.next)?I(J.key,J.arg):Q=null}this._invoke=function(z,Y){return new Promise(function(B,V){var L={key:z,arg:Y,resolve:B,reject:V,next:null};Q?Q=Q.next=L:(J=Q=L,I(z,Y))})},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}}),Qf=$$(dH(),1),If=$$(pH(),1),Wf=$$(tH(),1),zf=$$(A$(),1);var oH=4,aH=300,eH=4000;function NG($){if(!($ instanceof j4))return!1;let v=$.data;return v?.code==="TOO_MANY_REQUESTS"||v?.httpStatus===429}function p4($,v,D={}){return E0($),a5({links:[e5({retry:({op:X,error:U,attempts:G})=>X.type==="query"&&G<oH&&NG(U),retryDelayMs:(X)=>Math.min(aH*2**X,eH)}),VG({url:$,...D.fetch?{fetch:D.fetch}:{},headers:async()=>{let X=await v();return X?{authorization:`Bearer ${X}`}:{}}})]})}function d0($){let v=/^(\d+)\.(\d+)\.(\d+)/.exec($.trim());if(!v)return null;return[Number(v[1]),Number(v[2]),Number(v[3])]}function p0($,v){let D=d0($),X=d0(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 ZG($){let{ownVersion:v,minVersion:D,latestVersion:X}=$;if(D&&p0(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&&p0(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 t0($){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 $7=5000;function v7($,v,D){return new Promise((X)=>{let U=setTimeout(()=>X(D),v),G=(J)=>{clearTimeout(U),X(J)};$.then(G,()=>G(D))})}async function o0($){let[v,D]=await Promise.all([v7($.fetchMinVersion(),$7,null),v7($.fetchLatestVersion(),$7,null)]);return ZG({ownVersion:$.ownVersion,minVersion:v,latestVersion:D})}var U7="https://api.aetherwealth.ai",D7="http://localhost:9006",x4="https://app.aetherwealth.ai";function sH($){let v=$.NODE_ENV;return v==="development"||v==="test"}function X7($){let v=$.AETHER_BASE_URL,D="";if(v&&v.trim().length>0)D=v.trim();else if(sH($))D=D7;else D=U7;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:"&&!H4(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 G7="@aetherwealth/mcp";function J7($={}){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 I=X.keys().next().value;if(I!==void 0)X.delete(I)}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 Q7($){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 $3=60000,v3=1000,U3=4000;function I7($){let v=$.fetchImpl??fetch,D=$.now??Date.now,X=$.ttlMs??$3,U=`${$.baseUrl.replace(/\/$/,"")}${r1}`,G=new Map,J=new Map,Q=async(I)=>{let W=await D3(U,I,v);if(!W.ok)return W;if(G.size>=v3){let z=G.keys().next().value;if(z!==void 0)G.delete(z)}return G.set(I,{userId:W.userId,expiresAt:D()+X}),W};return{async verify(I){let W=G.get(I);if(W&&W.expiresAt>D())return{ok:!0,userId:W.userId};G.delete(I);let z=J.get(I);if(z)return z;let Y=Q(I);J.set(I,Y);try{return await Y}finally{J.delete(I)}},invalidate(I){G.delete(I)}}}async function D3($,v,D){let X=new AbortController,U=setTimeout(()=>X.abort(),U3),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 A4(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 VA}from"node:crypto";import{createServer as Jg}from"node:http";var r={};R4(r,{xor:()=>cY,xid:()=>ZY,void:()=>lY,uuidv7:()=>WY,uuidv6:()=>IY,uuidv4:()=>QY,uuid:()=>JY,util:()=>w,url:()=>zY,uppercase:()=>t6,unknown:()=>D$,union:()=>X$,undefined:()=>_Y,ulid:()=>NY,uint64:()=>fY,uint32:()=>CY,tuple:()=>R9,trim:()=>v1,treeifyError:()=>TG,transform:()=>jD,toUpperCase:()=>D1,toLowerCase:()=>U1,toJSONSchema:()=>tU,templateLiteral:()=>XB,symbol:()=>nY,superRefine:()=>JW,success:()=>$B,stringbool:()=>YB,stringFormat:()=>SY,string:()=>A,strictObject:()=>rY,startsWith:()=>a6,slugify:()=>X1,size:()=>j6,setErrorMap:()=>kj,set:()=>oY,safeParseAsync:()=>Y9,safeParse:()=>z9,safeEncodeAsync:()=>O9,safeEncode:()=>N9,safeDecodeAsync:()=>A9,safeDecode:()=>Z9,registry:()=>HU,regexes:()=>a$,regex:()=>d6,refine:()=>GW,record:()=>s,readonly:()=>s9,property:()=>rU,promise:()=>GB,prettifyError:()=>EG,preprocess:()=>Cv,prefault:()=>r9,positive:()=>yU,pipe:()=>UD,partialRecord:()=>dY,parseAsync:()=>W9,parse:()=>I9,overwrite:()=>z4,optional:()=>J$,object:()=>q,number:()=>t,nullish:()=>sY,nullable:()=>Mv,null:()=>qv,normalize:()=>$1,nonpositive:()=>hU,nonoptional:()=>c9,nonnegative:()=>mU,never:()=>FD,negative:()=>lU,nativeEnum:()=>aY,nanoid:()=>VY,nan:()=>vB,multipleOf:()=>s4,minSize:()=>b4,minLength:()=>f4,mime:()=>s6,meta:()=>WB,maxSize:()=>$6,maxLength:()=>w6,map:()=>tY,mac:()=>HY,lte:()=>e$,lt:()=>M4,lowercase:()=>p6,looseRecord:()=>pY,looseObject:()=>w$,locales:()=>Av,literal:()=>E,length:()=>M6,lazy:()=>UW,ksuid:()=>OY,keyof:()=>mY,jwt:()=>qY,json:()=>BB,iso:()=>X6,ipv6:()=>FY,ipv4:()=>AY,invertCodec:()=>DB,intersection:()=>L1,int64:()=>iY,int32:()=>gY,int:()=>vD,instanceof:()=>zB,includes:()=>o6,httpUrl:()=>YY,hostname:()=>kY,hex:()=>TY,hash:()=>EY,guid:()=>GY,gte:()=>x$,gt:()=>P4,globalRegistry:()=>j$,getErrorMap:()=>Tj,function:()=>JB,fromJSONSchema:()=>LB,formatError:()=>Gv,float64:()=>RY,float32:()=>uY,flattenError:()=>Xv,file:()=>eY,exactOptional:()=>_9,enum:()=>M$,endsWith:()=>e6,encodeAsync:()=>L9,encode:()=>B9,emoji:()=>BY,email:()=>XY,e164:()=>bY,discriminatedUnion:()=>Ev,describe:()=>IB,decodeAsync:()=>K9,decode:()=>V9,date:()=>hY,custom:()=>PD,cuid2:()=>KY,cuid:()=>LY,core:()=>n4,config:()=>B$,coerce:()=>IW,codec:()=>UB,clone:()=>g$,cidrv6:()=>wY,cidrv4:()=>jY,check:()=>QB,catch:()=>t9,boolean:()=>V$,bigint:()=>xY,base64url:()=>PY,base64:()=>MY,array:()=>m,any:()=>yY,_function:()=>JB,_default:()=>h9,_ZodString:()=>DD,ZodXor:()=>k9,ZodXID:()=>zD,ZodVoid:()=>q9,ZodUnknown:()=>P9,ZodUnion:()=>Tv,ZodUndefined:()=>j9,ZodUUID:()=>q4,ZodURL:()=>bv,ZodULID:()=>WD,ZodType:()=>_,ZodTuple:()=>u9,ZodTransform:()=>f9,ZodTemplateLiteral:()=>$W,ZodSymbol:()=>F9,ZodSuccess:()=>d9,ZodStringFormat:()=>U$,ZodString:()=>W1,ZodSet:()=>C9,ZodRecord:()=>Q1,ZodRealError:()=>h$,ZodReadonly:()=>e9,ZodPromise:()=>DW,ZodPreprocess:()=>a9,ZodPrefault:()=>m9,ZodPipe:()=>uv,ZodOptional:()=>wD,ZodObject:()=>kv,ZodNumberFormat:()=>P6,ZodNumber:()=>Y1,ZodNullable:()=>y9,ZodNull:()=>w9,ZodNonOptional:()=>MD,ZodNever:()=>b9,ZodNanoID:()=>JD,ZodNaN:()=>o9,ZodMap:()=>g9,ZodMAC:()=>H9,ZodLiteral:()=>x9,ZodLazy:()=>vW,ZodKSUID:()=>YD,ZodJWT:()=>AD,ZodIssueCode:()=>Sj,ZodIntersection:()=>E9,ZodISOTime:()=>sU,ZodISODuration:()=>$D,ZodISODateTime:()=>aU,ZodISODate:()=>eU,ZodIPv6:()=>VD,ZodIPv4:()=>BD,ZodGUID:()=>wv,ZodFunction:()=>XW,ZodFirstPartyTypeKind:()=>QW,ZodFile:()=>i9,ZodExactOptional:()=>n9,ZodError:()=>bj,ZodEnum:()=>I1,ZodEmoji:()=>GD,ZodEmail:()=>XD,ZodE164:()=>OD,ZodDiscriminatedUnion:()=>T9,ZodDefault:()=>l9,ZodDate:()=>Sv,ZodCustomStringFormat:()=>z1,ZodCustom:()=>gv,ZodCodec:()=>Rv,ZodCatch:()=>p9,ZodCUID2:()=>ID,ZodCUID:()=>QD,ZodCIDRv6:()=>KD,ZodCIDRv4:()=>LD,ZodBoolean:()=>B1,ZodBigIntFormat:()=>HD,ZodBigInt:()=>V1,ZodBase64URL:()=>ZD,ZodBase64:()=>ND,ZodArray:()=>S9,ZodAny:()=>M9,TimePrecision:()=>i8,NEVER:()=>OG,$output:()=>E8,$input:()=>u8,$brand:()=>AG});var n4={};R4(n4,{version:()=>PJ,util:()=>w,treeifyError:()=>TG,toJSONSchema:()=>tU,toDotPath:()=>K7,safeParseAsync:()=>Iv,safeParse:()=>h6,safeEncodeAsync:()=>j7,safeEncode:()=>H7,safeDecodeAsync:()=>w7,safeDecode:()=>F7,registry:()=>HU,regexes:()=>a$,process:()=>e,prettifyError:()=>EG,parseAsync:()=>Qv,parse:()=>Jv,meta:()=>ZI,locales:()=>Av,isValidJWT:()=>r7,isValidBase64URL:()=>m7,isValidBase64:()=>dJ,initializeContext:()=>v6,globalRegistry:()=>j$,globalConfig:()=>Z6,formatError:()=>Gv,flattenError:()=>Xv,finalize:()=>D6,extractDefs:()=>U6,encodeAsync:()=>O7,encode:()=>N7,describe:()=>NI,decodeAsync:()=>A7,decode:()=>Z7,createToJSONSchemaMethod:()=>AI,createStandardJSONSchemaMethod:()=>J1,config:()=>B$,clone:()=>g$,_xor:()=>Uj,_xid:()=>EU,_void:()=>QI,_uuidv7:()=>PU,_uuidv6:()=>MU,_uuidv4:()=>wU,_uuid:()=>jU,_url:()=>Fv,_uppercase:()=>t6,_unknown:()=>GI,_union:()=>vj,_undefined:()=>UI,_ulid:()=>TU,_uint64:()=>$I,_uint32:()=>p8,_tuple:()=>Gj,_trim:()=>v1,_transform:()=>Bj,_toUpperCase:()=>D1,_toLowerCase:()=>U1,_templateLiteral:()=>Fj,_symbol:()=>vI,_superRefine:()=>KI,_success:()=>Zj,_stringbool:()=>OI,_stringFormat:()=>G1,_string:()=>g8,_startsWith:()=>a6,_slugify:()=>X1,_size:()=>j6,_set:()=>Ij,_safeParseAsync:()=>m6,_safeParse:()=>l6,_safeEncodeAsync:()=>GU,_safeEncode:()=>DU,_safeDecodeAsync:()=>JU,_safeDecode:()=>XU,_regex:()=>d6,_refine:()=>LI,_record:()=>Jj,_readonly:()=>Hj,_property:()=>rU,_promise:()=>wj,_positive:()=>yU,_pipe:()=>Aj,_parseAsync:()=>y6,_parse:()=>_6,_overwrite:()=>z4,_optional:()=>Vj,_number:()=>l8,_nullable:()=>Lj,_null:()=>DI,_normalize:()=>$1,_nonpositive:()=>hU,_nonoptional:()=>Nj,_nonnegative:()=>mU,_never:()=>JI,_negative:()=>lU,_nativeEnum:()=>zj,_nanoid:()=>qU,_nan:()=>zI,_multipleOf:()=>s4,_minSize:()=>b4,_minLength:()=>f4,_min:()=>x$,_mime:()=>s6,_maxSize:()=>$6,_maxLength:()=>w6,_max:()=>e$,_map:()=>Qj,_mac:()=>x8,_lte:()=>e$,_lt:()=>M4,_lowercase:()=>p6,_literal:()=>Yj,_length:()=>M6,_lazy:()=>jj,_ksuid:()=>uU,_jwt:()=>_U,_isoTime:()=>_8,_isoDuration:()=>y8,_isoDateTime:()=>f8,_isoDate:()=>n8,_ipv6:()=>gU,_ipv4:()=>RU,_intersection:()=>Xj,_int64:()=>s8,_int32:()=>d8,_int:()=>m8,_includes:()=>o6,_guid:()=>Hv,_gte:()=>x$,_gt:()=>P4,_float64:()=>c8,_float32:()=>r8,_file:()=>BI,_enum:()=>Wj,_endsWith:()=>e6,_encodeAsync:()=>vU,_encode:()=>s0,_emoji:()=>bU,_email:()=>FU,_e164:()=>nU,_discriminatedUnion:()=>Dj,_default:()=>Kj,_decodeAsync:()=>UU,_decode:()=>$U,_date:()=>II,_custom:()=>VI,_cuid2:()=>kU,_cuid:()=>SU,_coercedString:()=>C8,_coercedNumber:()=>h8,_coercedDate:()=>WI,_coercedBoolean:()=>o8,_coercedBigint:()=>e8,_cidrv6:()=>xU,_cidrv4:()=>CU,_check:()=>$Y,_catch:()=>Oj,_boolean:()=>t8,_bigint:()=>a8,_base64url:()=>fU,_base64:()=>iU,_array:()=>YI,_any:()=>XI,TimePrecision:()=>i8,NEVER:()=>OG,JSONSchemaGenerator:()=>D9,JSONSchema:()=>vY,Doc:()=>zU,$output:()=>E8,$input:()=>u8,$constructor:()=>K,$brand:()=>AG,$ZodXor:()=>YQ,$ZodXID:()=>xJ,$ZodVoid:()=>QQ,$ZodUnknown:()=>GQ,$ZodUnion:()=>Vv,$ZodUndefined:()=>UQ,$ZodUUID:()=>SJ,$ZodURL:()=>TJ,$ZodULID:()=>CJ,$ZodType:()=>f,$ZodTuple:()=>ZU,$ZodTransform:()=>HQ,$ZodTemplateLiteral:()=>EQ,$ZodSymbol:()=>vQ,$ZodSuccess:()=>bQ,$ZodStringFormat:()=>v$,$ZodString:()=>F6,$ZodSet:()=>NQ,$ZodRegistry:()=>R8,$ZodRecord:()=>LQ,$ZodRealError:()=>l$,$ZodReadonly:()=>TQ,$ZodPromise:()=>RQ,$ZodPreprocess:()=>kQ,$ZodPrefault:()=>MQ,$ZodPipe:()=>AU,$ZodOptional:()=>OU,$ZodObjectJIT:()=>zQ,$ZodObject:()=>p7,$ZodNumberFormat:()=>sJ,$ZodNumber:()=>KU,$ZodNullable:()=>jQ,$ZodNull:()=>DQ,$ZodNonOptional:()=>PQ,$ZodNever:()=>JQ,$ZodNanoID:()=>uJ,$ZodNaN:()=>SQ,$ZodMap:()=>KQ,$ZodMAC:()=>mJ,$ZodLiteral:()=>OQ,$ZodLazy:()=>gQ,$ZodKSUID:()=>iJ,$ZodJWT:()=>aJ,$ZodIntersection:()=>VQ,$ZodISOTime:()=>_J,$ZodISODuration:()=>yJ,$ZodISODateTime:()=>fJ,$ZodISODate:()=>nJ,$ZodIPv6:()=>hJ,$ZodIPv4:()=>lJ,$ZodGUID:()=>qJ,$ZodFunction:()=>uQ,$ZodFile:()=>AQ,$ZodExactOptional:()=>FQ,$ZodError:()=>Dv,$ZodEnum:()=>ZQ,$ZodEncodeError:()=>O6,$ZodEmoji:()=>EJ,$ZodEmail:()=>kJ,$ZodE164:()=>oJ,$ZodDiscriminatedUnion:()=>BQ,$ZodDefault:()=>wQ,$ZodDate:()=>IQ,$ZodCustomStringFormat:()=>eJ,$ZodCustom:()=>CQ,$ZodCodec:()=>Lv,$ZodCheckUpperCase:()=>OJ,$ZodCheckStringFormat:()=>r6,$ZodCheckStartsWith:()=>HJ,$ZodCheckSizeEquals:()=>BJ,$ZodCheckRegex:()=>NJ,$ZodCheckProperty:()=>jJ,$ZodCheckOverwrite:()=>MJ,$ZodCheckNumberFormat:()=>IJ,$ZodCheckMultipleOf:()=>QJ,$ZodCheckMinSize:()=>YJ,$ZodCheckMinLength:()=>LJ,$ZodCheckMimeType:()=>wJ,$ZodCheckMaxSize:()=>zJ,$ZodCheckMaxLength:()=>VJ,$ZodCheckLowerCase:()=>ZJ,$ZodCheckLessThan:()=>IU,$ZodCheckLengthEquals:()=>KJ,$ZodCheckIncludes:()=>AJ,$ZodCheckGreaterThan:()=>WU,$ZodCheckEndsWith:()=>FJ,$ZodCheckBigIntFormat:()=>WJ,$ZodCheck:()=>G$,$ZodCatch:()=>qQ,$ZodCUID2:()=>gJ,$ZodCUID:()=>RJ,$ZodCIDRv6:()=>cJ,$ZodCIDRv4:()=>rJ,$ZodBoolean:()=>Bv,$ZodBigIntFormat:()=>$Q,$ZodBigInt:()=>NU,$ZodBase64URL:()=>tJ,$ZodBase64:()=>pJ,$ZodAsyncError:()=>w4,$ZodArray:()=>WQ,$ZodAny:()=>XQ});var W7,OG=Object.freeze({status:"aborted"});function K($,v,D){function X(Q,I){if(!Q._zod)Object.defineProperty(Q,"_zod",{value:{def:I,constr:J,traits:new Set},enumerable:!1});if(Q._zod.traits.has($))return;Q._zod.traits.add($),v(Q,I);let W=J.prototype,z=Object.keys(W);for(let Y=0;Y<z.length;Y++){let B=z[Y];if(!(B in Q))Q[B]=W[B].bind(Q)}}let U=D?.Parent??Object;class G extends U{}Object.defineProperty(G,"name",{value:$});function J(Q){var I;let W=D?.Parent?new G:this;X(W,Q),(I=W._zod).deferred??(I.deferred=[]);for(let z of W._zod.deferred)z();return W}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 AG=Symbol("zod_brand");class w4 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"}}(W7=globalThis).__zod_globalConfig??(W7.__zod_globalConfig={});var Z6=globalThis.__zod_globalConfig;function B$($){if($)Object.assign(Z6,$);return Z6}var w={};R4(w,{unwrapMessage:()=>a1,uint8ArrayToHex:()=>S3,uint8ArrayToBase64url:()=>b3,uint8ArrayToBase64:()=>B7,stringifyPrimitive:()=>F,slugify:()=>jG,shallowClone:()=>MG,safeExtend:()=>H3,required:()=>w3,randomString:()=>V3,propertyKeyTypes:()=>$v,promiseAllObject:()=>B3,primitiveTypes:()=>PG,prefixIssues:()=>y$,pick:()=>Z3,partial:()=>j3,parsedType:()=>j,optionalKeys:()=>bG,omit:()=>O3,objectClone:()=>W3,numKeys:()=>L3,nullish:()=>t4,normalizeParams:()=>M,mergeDefs:()=>i4,merge:()=>F3,jsonStringifyReplacer:()=>i6,joinValues:()=>O,issue:()=>n6,isPlainObject:()=>a4,isObject:()=>A6,hexToUint8Array:()=>q3,getSizableOrigin:()=>vv,getParsedType:()=>K3,getLengthableOrigin:()=>Uv,getEnumValues:()=>e1,getElementAtPath:()=>Y3,floatSafeRemainder:()=>FG,finalizeIssue:()=>C$,extend:()=>A3,explicitlyAborted:()=>kG,escapeRegex:()=>v4,esc:()=>a0,defineLazy:()=>h,createTransparentProxy:()=>N3,cloneDef:()=>z3,clone:()=>g$,cleanRegex:()=>s1,cleanEnum:()=>M3,captureStackTrace:()=>e0,cached:()=>f6,base64urlToUint8Array:()=>P3,base64ToUint8Array:()=>Y7,assignProp:()=>o4,assertNotEqual:()=>G3,assertNever:()=>Q3,assertIs:()=>J3,assertEqual:()=>X3,assert:()=>I3,allowsEval:()=>wG,aborted:()=>e4,NUMBER_FORMAT_RANGES:()=>qG,Class:()=>V7,BIGINT_FORMAT_RANGES:()=>SG});function X3($){return $}function G3($){return $}function J3($){}function Q3($){throw Error("Unexpected value in exhaustive check")}function I3($){}function e1($){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)=>F(D)).join(v)}function i6($,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 s1($){let v=$.startsWith("^")?1:0,D=$.endsWith("$")?$.length-1:$.length;return $.slice(v,D)}function FG($,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 z7=Symbol("evaluating");function h($,v,D){let X=void 0;Object.defineProperty($,v,{get(){if(X===z7)return;if(X===void 0)X=z7,X=D();return X},set(U){Object.defineProperty($,v,{value:U})},configurable:!0})}function W3($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function o4($,v,D){Object.defineProperty($,v,{value:D,writable:!0,enumerable:!0,configurable:!0})}function i4(...$){let v={};for(let D of $){let X=Object.getOwnPropertyDescriptors(D);Object.assign(v,X)}return Object.defineProperties({},v)}function z3($){return i4($._zod.def)}function Y3($,v){if(!v)return $;return v.reduce((D,X)=>D?.[X],$)}function B3($){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 V3($=10){let D="";for(let X=0;X<$;X++)D+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return D}function a0($){return JSON.stringify($)}function jG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var e0="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function A6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var wG=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(A6($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let D=v.prototype;if(A6(D)===!1)return!1;if(Object.prototype.hasOwnProperty.call(D,"isPrototypeOf")===!1)return!1;return!0}function MG($){if(a4($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function L3($){let v=0;for(let D in $)if(Object.prototype.hasOwnProperty.call($,D))v++;return v}var K3=($)=>{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}`)}},$v=new Set(["string","number","symbol"]),PG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function v4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g$($,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 N3($){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 F($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function bG($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var qG={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]},SG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Z3($,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=i4($._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 g$($,G)}function O3($,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=i4($._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 g$($,G)}function A3($,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=i4($._zod.def,{get shape(){let G={...$._zod.def.shape,...v};return o4(this,"shape",G),G}});return g$($,U)}function H3($,v){if(!a4(v))throw Error("Invalid input to safeExtend: expected a plain object");let D=i4($._zod.def,{get shape(){let X={...$._zod.def.shape,...v};return o4(this,"shape",X),X}});return g$($,D)}function F3($,v){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let D=i4($._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 g$($,D)}function j3($,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=i4(v._zod.def,{get shape(){let Q=v._zod.def.shape,I={...Q};if(D)for(let W in D){if(!(W in Q))throw Error(`Unrecognized key: "${W}"`);if(!D[W])continue;I[W]=$?new $({type:"optional",innerType:Q[W]}):Q[W]}else for(let W in Q)I[W]=$?new $({type:"optional",innerType:Q[W]}):Q[W];return o4(this,"shape",I),I},checks:[]});return g$(v,J)}function w3($,v,D){let X=i4(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 g$(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 kG($,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 X;return(X=D).path??(X.path=[]),D.path.unshift($),D})}function a1($){return typeof $==="string"?$:$?.message}function C$($,v,D){let X=$.message?$.message:a1($.inst?._zod.def?.error?.($))??a1(v?.error?.($))??a1(D.customError?.($))??a1(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 vv($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function Uv($){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 n6(...$){let[v,D,X]=$;if(typeof v==="string")return{message:v,code:"custom",input:D,inst:X};return{...v}}function M3($){return Object.entries($).filter(([v,D])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function Y7($){let v=atob($),D=new Uint8Array(v.length);for(let X=0;X<v.length;X++)D[X]=v.charCodeAt(X);return D}function B7($){let v="";for(let D=0;D<$.length;D++)v+=String.fromCharCode($[D]);return btoa(v)}function P3($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),D="=".repeat((4-v.length%4)%4);return Y7(v+D)}function b3($){return B7($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function q3($){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 S3($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class V7{constructor(...$){}}var L7=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,i6,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Dv=K("$ZodError",L7),l$=K("$ZodError",L7,{Parent:Error});function Xv($,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 Gv($,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 I=D,W=0;while(W<Q.length){let z=Q[W];if(W!==Q.length-1)I[z]=I[z]||{_errors:[]};else I[z]=I[z]||{_errors:[]},I[z]._errors.push(v(J));I=I[z],W++}}}};return X($),D}function TG($,v=(D)=>D.message){let D={errors:[]},X=(U,G=[])=>{var J,Q;for(let I of U.issues)if(I.code==="invalid_union"&&I.errors.length)I.errors.map((W)=>X({issues:W},[...G,...I.path]));else if(I.code==="invalid_key")X({issues:I.issues},[...G,...I.path]);else if(I.code==="invalid_element")X({issues:I.issues},[...G,...I.path]);else{let W=[...G,...I.path];if(W.length===0){D.errors.push(v(I));continue}let z=D,Y=0;while(Y<W.length){let B=W[Y],V=Y===W.length-1;if(typeof B==="string")z.properties??(z.properties={}),(J=z.properties)[B]??(J[B]={errors:[]}),z=z.properties[B];else z.items??(z.items=[]),(Q=z.items)[B]??(Q[B]={errors:[]}),z=z.items[B];if(V)z.errors.push(v(I));Y++}}};return X($),D}function K7($){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 EG($){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 ${K7(X.path)}`);return v.join(`
29
- `)}var _6=($)=>(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 w4;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((I)=>C$(I,G,B$())));throw e0(Q,U?.callee),Q}return J.value},Jv=_6(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((I)=>C$(I,G,B$())));throw e0(Q,U?.callee),Q}return J.value},Qv=y6(l$),l6=($)=>(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 w4;return G.issues.length?{success:!1,error:new($??Dv)(G.issues.map((J)=>C$(J,U,B$())))}:{success:!0,data:G.value}},h6=l6(l$),m6=($)=>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,B$())))}:{success:!0,data:G.value}},Iv=m6(l$),s0=($)=>(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return _6($)(v,D,U)},N7=s0(l$),$U=($)=>(v,D,X)=>{return _6($)(v,D,X)},Z7=$U(l$),vU=($)=>async(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return y6($)(v,D,U)},O7=vU(l$),UU=($)=>async(v,D,X)=>{return y6($)(v,D,X)},A7=UU(l$),DU=($)=>(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return l6($)(v,D,U)},H7=DU(l$),XU=($)=>(v,D,X)=>{return l6($)(v,D,X)},F7=XU(l$),GU=($)=>async(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return m6($)(v,D,U)},j7=GU(l$),JU=($)=>async(v,D,X)=>{return m6($)(v,D,X)},w7=JU(l$);var a$={};R4(a$,{xid:()=>CG,uuid7:()=>R3,uuid6:()=>u3,uuid4:()=>E3,uuid:()=>H6,uppercase:()=>JJ,unicodeEmail:()=>M7,undefined:()=>XJ,ulid:()=>gG,time:()=>aG,string:()=>sG,sha512_hex:()=>$F,sha512_base64url:()=>UF,sha512_base64:()=>vF,sha384_hex:()=>a3,sha384_base64url:()=>s3,sha384_base64:()=>e3,sha256_hex:()=>p3,sha256_base64url:()=>o3,sha256_base64:()=>t3,sha1_hex:()=>r3,sha1_base64url:()=>d3,sha1_base64:()=>c3,rfc5322Email:()=>C3,number:()=>Wv,null:()=>DJ,nanoid:()=>iG,md5_hex:()=>l3,md5_base64url:()=>m3,md5_base64:()=>h3,mac:()=>mG,lowercase:()=>GJ,ksuid:()=>xG,ipv6:()=>hG,ipv4:()=>lG,integer:()=>vJ,idnEmail:()=>x3,httpProtocol:()=>pG,html5Email:()=>g3,hostname:()=>n3,hex:()=>y3,guid:()=>nG,extendedDuration:()=>T3,emoji:()=>yG,email:()=>_G,e164:()=>tG,duration:()=>fG,domain:()=>_3,datetime:()=>eG,date:()=>oG,cuid2:()=>RG,cuid:()=>uG,cidrv6:()=>cG,cidrv4:()=>rG,browserEmail:()=>i3,boolean:()=>UJ,bigint:()=>$J,base64url:()=>QU,base64:()=>dG});var uG=/^[cC][0-9a-z]{6,}$/,RG=/^[0-9a-z]+$/,gG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,CG=/^[0-9a-vA-V]{20}$/,xG=/^[A-Za-z0-9]{27}$/,iG=/^[a-zA-Z0-9_-]{21}$/,fG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,T3=/^[-+]?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)?)??$/,nG=/^([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})$/,H6=($)=>{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})$`)},E3=H6(4),u3=H6(6),R3=H6(7),_G=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,g3=/^[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])?)*$/,C3=/^(([^<>()\[\]\\.,;:\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,}))$/,M7=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,x3=M7,i3=/^[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])?)*$/,f3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yG(){return new RegExp(f3,"u")}var 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])$/,hG=/^(([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}|:))$/,mG=($)=>{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}$`)},rG=/^((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])$/,cG=/^(([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])$/,dG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,QU=/^[A-Za-z0-9_-]*$/,n3=/^(?=.{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])?)*\.?$/,_3=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,pG=/^https?$/,tG=/^\+[1-9]\d{6,14}$/,P7="(?:(?:\\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])))",oG=new RegExp(`^${P7}$`);function b7($){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 aG($){return new RegExp(`^${b7($)}$`)}function eG($){let v=b7({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(`^${P7}T(?:${X})$`)}var sG=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},$J=/^-?\d+n?$/,vJ=/^-?\d+$/,Wv=/^-?\d+(?:\.\d+)?$/,UJ=/^(?:true|false)$/i,DJ=/^null$/i;var XJ=/^undefined$/i;var GJ=/^[^A-Z]*$/,JJ=/^[^a-z]*$/,y3=/^[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 l3=/^[0-9a-fA-F]{32}$/,h3=zv(22,"=="),m3=Yv(22),r3=/^[0-9a-fA-F]{40}$/,c3=zv(27,"="),d3=Yv(27),p3=/^[0-9a-fA-F]{64}$/,t3=zv(43,"="),o3=Yv(43),a3=/^[0-9a-fA-F]{96}$/,e3=zv(64,""),s3=Yv(64),$F=/^[0-9a-fA-F]{128}$/,vF=zv(86,"=="),UF=Yv(86);var G$=K("$ZodCheck",($,v)=>{var D;$._zod??($._zod={}),$._zod.def=v,(D=$._zod).onattach??(D.onattach=[])}),S7={number:"number",bigint:"bigint",object:"date"},IU=K("$ZodCheckLessThan",($,v)=>{G$.init($,v);let D=S7[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})}}),WU=K("$ZodCheckGreaterThan",($,v)=>{G$.init($,v);let D=S7[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})}}),QJ=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):FG(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})}}),IJ=K("$ZodCheckNumberFormat",($,v)=>{G$.init($,v),v.format=v.format||"float64";let D=v.format?.includes("int"),X=D?"int":"number",[U,G]=qG[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=vJ}),$._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})}}),WJ=K("$ZodCheckBigIntFormat",($,v)=>{G$.init($,v);let[D,X]=SG[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})}}),zJ=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:vv(U),code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),YJ=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:vv(U),code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),BJ=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:vv(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})}}),VJ=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=Uv(U);X.issues.push({origin:J,code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),LJ=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=Uv(U);X.issues.push({origin:J,code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),KJ=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=Uv(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})}}),r6=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=()=>{})}),NJ=K("$ZodCheckRegex",($,v)=>{r6.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})}}),ZJ=K("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=GJ),r6.init($,v)}),OJ=K("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=JJ),r6.init($,v)}),AJ=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})}}),HJ=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})}}),FJ=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 q7($,v,D){if($.issues.length)v.issues.push(...y$(D,$.issues))}var jJ=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)=>q7(U,D,v.property));q7(X,D,v.property);return}}),wJ=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})}}),MJ=K("$ZodCheckOverwrite",($,v)=>{G$.init($,v),$._zod.check=(D)=>{D.value=v.tx(D.value)}});class zU{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(`
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 X3=k7({title:"Signed in · Aether Wealth",heading:"Signed in to Aether Wealth",detail:"You can close this tab and return to your assistant.",ok:!0}),S7=k7({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 G3($,v){return new Promise((D)=>{let X=(U)=>{$.removeListener("error",X),D({ok:!1,...U.code==="EADDRINUSE"?{}:{error:U}})};$.once("error",X),$.listen(v,u4,()=>{$.removeListener("error",X),D({ok:!0})})})}async function J3($,v){let D;for(let U of v){let G=await G3($,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 C0($,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=D3((W,z)=>{let Y=new URL(W.url??"/",`http://${u4}`);if(Y.pathname!==v){z.writeHead(404).end("not found");return}let I=Y.searchParams.get("error"),V=Y.searchParams.get("code"),K=Y.searchParams.get("state");if(I){z.writeHead(400,{"content-type":"text/html"}).end(S7),G({ok:!1,error:Error(`authorization denied: ${I}`)});return}if(!V||!K){z.writeHead(400,{"content-type":"text/html"}).end(S7),G({ok:!1,error:Error("callback missing code or state")});return}z.writeHead(200,{"content-type":"text/html"}).end(X3),G({ok:!0,value:{code:V,state:K}})}),Q=await J3(J,$);return{redirectUri:g0(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 Q3,randomBytes as E7}from"node:crypto";function UG($){return $.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function u0($={}){let v=UG(($.randomBytesImpl??E7)(32)),D=$.hashImpl?$.hashImpl(v):Q3("sha256").update(v).digest();return{verifier:v,challenge:UG(D),method:"S256"}}function x0($=E7){return UG($(16))}var DG=300000;async function f0($){let v=$.fetchImpl??fetch,D=$.log??(()=>{}),X=$.now??Date.now,{clientId:U,redirectPorts:G,redirectPath:J,scopes:Q}=$.identity;R0($.authBaseUrl);let W=await T0($.authBaseUrl,v),z=u0(),Y=x0(),I=await C0(G,J);try{let V=W3($.authBaseUrl),K=XG(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
+ ${K}
25
+ `),!await($.openBrowserImpl??S0)(K))D(`Could not open a browser automatically — open the URL above manually.
26
+ `);let{code:N,state:Z}=await I.waitForCode(DG);if(Z!==Y)throw Error("OAuth state mismatch — aborting login (possible CSRF).");return await GG(W.tokenEndpoint,{code:N,codeVerifier:z.verifier,redirectUri:I.redirectUri,clientId:U},v,X)}finally{await I.close()}}function XG($,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 W3($){try{return j4(new URL($).hostname)}catch{return!1}}async function GG($,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 F4(G),Q=J.access_token,W=J.expires_in;if(!G.ok||typeof Q!=="string")throw Error(`OAuth token exchange failed: ${z3(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 z3($,v){if(typeof $.error_description==="string")return $.error_description;if(typeof $.error==="string")return $.error;return`HTTP ${v}`}var r1=`${d4}/oauth2/userinfo`;async function JG($,v,D=fetch){let X=`${$.replace(/\/$/,"")}${r1}`,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 F4(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 _0($,v,D=fetch){return(await JG($,v,D)).sub}class d1{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 _0(this.target.baseUrl,$);return this.cachedUserId={token:$,userId:v},v}async login(){let $=await(this.deps.runLoginImpl??f0)({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:Y3,defineProperty:T7,getOwnPropertyDescriptor:I3,getOwnPropertyNames:R7,getPrototypeOf:V3}=Object,K3=Object.prototype.hasOwnProperty,W4=($,v)=>function(){return v||(0,$[R7($)[0]])((v={exports:{}}).exports,v),v.exports},L3=($,v,D,X)=>{if(v&&typeof v==="object"||typeof v==="function"){for(var U=R7(v),G=0,J=U.length,Q;G<J;G++)if(Q=U[G],!K3.call($,Q)&&Q!==D)T7($,Q,{get:((W)=>v[W]).bind(null,Q),enumerable:!(X=I3(v,Q))||X.enumerable})}return $},$$=($,v,D)=>(D=$!=null?Y3(V3($)):{},L3(v||!$||!$.__esModule?T7(D,"default",{value:$,enumerable:!0}):D,$)),g7=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}}),B3=W4({"../../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}}),N3=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,v){var D=g7().default,X=B3();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}}),A4=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,v){var D=N3();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=A4();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(Z3,v)}};return v}function Z3($,v){return v($)}function QG($){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 WG($){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 yu=Symbol();function i0($){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 C7($){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 x4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function y0(){return Object.create(null)}var x6={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 u7=[x6.BAD_GATEWAY,x6.SERVICE_UNAVAILABLE,x6.GATEWAY_TIMEOUT,x6.INTERNAL_SERVER_ERROR];var{create:H3,defineProperty:f7,getOwnPropertyDescriptor:F3,getOwnPropertyNames:_7,getPrototypeOf:j3}=Object,A3=Object.prototype.hasOwnProperty,p1=($,v)=>function(){return v||(0,$[_7($)[0]])((v={exports:{}}).exports,v),v.exports},w3=($,v,D,X)=>{if(v&&typeof v==="object"||typeof v==="function"){for(var U=_7(v),G=0,J=U.length,Q;G<J;G++)if(Q=U[G],!A3.call($,Q)&&Q!==D)f7($,Q,{get:((W)=>v[W]).bind(null,Q),enumerable:!(X=F3(v,Q))||X.enumerable})}return $},t1=($,v,D)=>(D=$!=null?H3(j3($)):{},w3(v||!$||!$.__esModule?f7(D,"default",{value:$,enumerable:!0}):D,$)),i7=()=>{},x7=($)=>{if(Object.freeze)Object.freeze($)};function y7($,v,D){var X;let U=v.join(".");return(X=D[U])!==null&&X!==void 0||(D[U]=new Proxy(i7,{get(G,J){if(typeof J!=="string"||J==="then")return;return y7($,[...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 x7(z.args),x7(z.path),$(z)}})),D[U]}var n0=($)=>y7($,[],y0()),zG=($)=>{return new Proxy(i7,{get(v,D){if(D==="then")return;return $(D)}})};var n7=p1({"../../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}}),M3=p1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,v){var D=n7().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}}),P3=p1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,v){var D=n7().default,X=M3();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}}),YG=p1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,v){var D=P3();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}}),l0=p1({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,v){var D=YG();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}}),vx=t1(l0(),1);var Gx=t1(YG(),1);var h0=t1(l0(),1);function S3($,v){if("error"in $){let X=v.deserialize($.error);return{ok:!1,error:(0,h0.default)((0,h0.default)({},$),{},{error:X})}}return{ok:!0,result:(0,h0.default)((0,h0.default)({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:v.deserialize($.result.data)})}}var IG=class extends Error{constructor(){super("Unable to transform response from server")}};function VG($,v){let D;try{D=S3($,v)}catch(X){throw new IG}if(!D.ok&&(!x4(D.error.error)||typeof D.error.error.code!=="number"))throw new IG;if(D.ok&&!x4(D.result))throw new IG;return D}var Jx=t1(l0(),1);var Qx=Symbol();var m0=$$(A4(),1),f6=$$(H$(),1);function l7($){return $ instanceof w4}function R3($){return x4($)&&x4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function g3($,v){if(typeof $==="string")return $;if(x4($)&&typeof $.message==="string")return $.message;return v}var w4=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,m0.default)(this,"cause",void 0),(0,m0.default)(this,"shape",void 0),(0,m0.default)(this,"data",void 0),(0,m0.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(l7(X)){if(D.meta)X.meta=(0,f6.default)((0,f6.default)({},X.meta),D.meta);return X}if(R3(X))return new $(X.error.message,(0,f6.default)((0,f6.default)({},D),{},{result:X,cause:D.cause}));return new $(g3(X,"Unknown error"),(0,f6.default)((0,f6.default)({},D),{},{cause:X}))}};function c0($){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 h7=($)=>typeof $==="function";function m7($){if($)return $;if(typeof window<"u"&&h7(window.fetch))return window.fetch;if(typeof globalThis<"u"&&h7(globalThis.fetch))return globalThis.fetch;throw Error("No fetch implementation found")}var o1=$$(H$());function r0($){return{url:$.url.toString(),fetch:$.fetch,transformer:c0($.transformer),methodOverride:$.methodOverride}}function C3($){let v={};for(let D=0;D<$.length;D++){let X=$[D];v[D]=X}return v}var u3={query:"GET",mutation:"POST",subscription:"PATCH"};function c7($){return"input"in $?$.transformer.input.serialize($.input):C3($.inputs.map((v)=>$.transformer.input.serialize(v)))}var a1=($)=>{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=c7($);if(G!==void 0&&$.methodOverride!=="POST")U.push(`input=${encodeURIComponent(JSON.stringify(G))}`)}if(U.length)X+="?"+U.join("&");return X},r7=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let v=c7($);return v!==void 0?JSON.stringify(v):void 0},KG=($)=>{return p7((0,o1.default)((0,o1.default)({},$),{},{contentTypeHeader:"application/json",getUrl:a1,getBody:r7}))},x3=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},f3=($)=>{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 x3};async function d7($){var v,D;f3($.signal);let X=$.getUrl($),U=$.getBody($),G=(v=$.methodOverride)!==null&&v!==void 0?v:u3[$.type],J=await(async()=>{let W=await $.headers();if(Symbol.iterator in W)return Object.fromEntries(W);return W})(),Q=(0,o1.default)((0,o1.default)((0,o1.default)({},$.contentTypeHeader&&G!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(D=$.trpcAcceptHeaderKey)!==null&&D!==void 0?D:"trpc-accept"]:$.trpcAcceptHeader}:void 0),J);return m7($.fetch)(X,{method:G,signal:$.signal,body:U,headers:Q})}async function p7($){let v={},D=await d7($);v.response=D;let X=await D.json();return v.responseJSON=X,{json:X,meta:v}}var Nf=$$(H$(),1);var t7=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function LG($){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 K=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(K.concat(V).map((N)=>N.key))){K.push(V),z++;continue}if(K.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(K,L)=>{let N=z.items[L];try{var Z;let S=await Promise.resolve(K);(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 K of z.items){var V;(V=K.reject)===null||V===void 0||V.call(K,Error("Missing result")),K.batch=null}}).catch((I)=>{for(let K of z.items){var V;(V=K.reject)===null||V===void 0||V.call(K,I),K.batch=null}})}}function J(Q){var W;let z={aborted:!1,key:Q,batch:null,resolve:t7,reject:t7},Y=new Promise((I,V)=>{var K;z.reject=V,z.resolve=I,(K=v)!==null&&K!==void 0||(v=[]),v.push(z)});return(W=D)!==null&&W!==void 0||(D=setTimeout(G)),Y}return{load:J}}function o7(...$){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 d0=$$(H$(),1);function BG($){var v,D;let X=r0($),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(","),K=I.map((N)=>N.input);return a1((0,d0.default)((0,d0.default)({},X),{},{type:Y,path:V,inputs:K,signal:null})).length<=U},async fetch(I){let V=I.map((S)=>S.path).join(","),K=I.map((S)=>S.input),L=o7(...I.map((S)=>S.signal)),N=await KG((0,d0.default)((0,d0.default)({},X),{},{path:V,inputs:K,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=LG(J("query")),W=LG(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 K=z[Y.type].load(Y),L=void 0;return K.then((N)=>{L=N;let Z=VG(N.json,X.transformer.output);if(!Z.ok){I.error(w4.from(Z.error,{meta:N.meta}));return}I.next({context:N.meta,result:Z.result}),I.complete()}).catch((N)=>{I.error(w4.from(N,{meta:L===null||L===void 0?void 0:L.meta}))}),()=>{}})}}}var Pf=$$(H$(),1);var NG=($,...v)=>{return typeof $==="function"?$(...v):$},Tf=$$(A4(),1);function _3(){let $,v;return{promise:new Promise((X,U)=>{$=X,v=U}),resolve:$,reject:v}}async function i3($){let v=await NG($.url);if(!$.connectionParams)return v;let X=`${v.includes("?")?"&":"?"}connectionParams=1`;return v+X}async function y3($,v){let D={method:"connectionParams",data:await NG($)};return v.encode(D)}var Rf=$$(A4(),1);var p4=$$(A4(),1);function n3($){let{promise:v,resolve:D,reject:X}=_3();return $.addEventListener("open",()=>{$.removeEventListener("error",X),D()}),$.addEventListener("error",X),v}function l3($,{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 h3=class ${constructor(v){var D;if((0,p4.default)(this,"id",++$.connectCount),(0,p4.default)(this,"WebSocketPonyfill",void 0),(0,p4.default)(this,"urlOptions",void 0),(0,p4.default)(this,"keepAliveOpts",void 0),(0,p4.default)(this,"encoder",void 0),(0,p4.default)(this,"wsObservable",i0(null)),(0,p4.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=i3(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)l3(X,v.keepAliveOpts);if(X.addEventListener("close",()=>{if(v.ws===X)v.ws=null}),await n3(X),v.urlOptions.connectionParams)X.send(await y3(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,p4.default)(h3,"connectCount",0);var gf=$$(A4(),1),Cf=$$(H$(),1);var ZG=$$(A4(),1),a7=$$(H$(),1),m3=class{constructor($){(0,ZG.default)(this,"links",void 0),(0,ZG.default)(this,"runtime",void 0),(0,ZG.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((v)=>v(this.runtime))}$request($){var v;return C7({links:this.links,op:(0,a7.default)((0,a7.default)({},$),{},{context:(v=$.context)!==null&&v!==void 0?v:{},id:++this.requestId})}).pipe(WG())}async requestAsPromise($){var v=this;try{let D=v.$request($);return(await QG(D)).result.data}catch(D){throw w4.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 c3=Symbol.for("trpc_untypedClient"),r3={query:"query",mutate:"mutation",subscribe:"subscription"},d3=($)=>{return r3[$]};function p3($){let v=n0(({path:D,args:X})=>{let U=[...D],G=d3(U.pop()),J=U.join(".");return $[G](J,...X)});return zG((D)=>{if(D===c3)return $;return v[D]})}function $Y($){let v=new m3($);return p3(v)}var Y_=$$(H$(),1);var e7=$$(H$(),1);function t3($,v){if(!v)return $;if($!=null&&typeof $!=="object")return $;return(0,e7.default)((0,e7.default)({},$!==null&&$!==void 0?$:{}),{},{lastEventId:v})}var o3=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}}),I_=$$(o3(),1);var s7=$$(H$(),1);function vY($){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,s7.default)((0,s7.default)({},W),{},{input:t3(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 a3=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 K=W.d.call(W.v);if(W.a)return Y|=2,Promise.resolve(K).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(K){return z=z!==U?new X(K,z):K,I()}return I()}}}v.exports=D,v.exports.__esModule=!0,v.exports.default=v.exports}}),UY=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=UY();function X(U){return new D(U,0)}v.exports=X,v.exports.__esModule=!0,v.exports.default=v.exports}}),s3=W4({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,v){var D=UY();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),K=V.value,L=K instanceof D;Promise.resolve(L?K.v:K).then(function(N){if(L){var Z=Y==="return"?"return":"next";if(!K.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,K){var L={key:Y,arg:I,resolve:V,reject:K,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}}),V_=$$(a3(),1),K_=$$(e3(),1),L_=$$(s3(),1),B_=$$(H$(),1);var $F=4,vF=300,UF=4000;function OG($){if(!($ instanceof w4))return!1;let v=$.data;return v?.code==="TOO_MANY_REQUESTS"||v?.httpStatus===429}function t4($,v,D={}){return R0($),$Y({links:[vY({retry:({op:X,error:U,attempts:G})=>X.type==="query"&&G<$F&&OG(U),retryDelayMs:(X)=>Math.min(vF*2**X,UF)}),BG({url:$,...D.fetch?{fetch:D.fetch}:{},headers:async()=>{let X=await v();return X?{authorization:`Bearer ${X}`}:{}}})]})}function p0($){let v=/^(\d+)\.(\d+)\.(\d+)/.exec($.trim());if(!v)return null;return[Number(v[1]),Number(v[2]),Number(v[3])]}function t0($,v){let D=p0($),X=p0(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 HG($){let{ownVersion:v,minVersion:D,latestVersion:X}=$;if(D&&t0(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&&t0(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 o0($){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 DY=5000;function XY($,v,D){return new Promise((X)=>{let U=setTimeout(()=>X(D),v),G=(J)=>{clearTimeout(U),X(J)};$.then(G,()=>G(D))})}async function a0($){let[v,D]=await Promise.all([XY($.fetchMinVersion(),DY,null),XY($.fetchLatestVersion(),DY,null)]);return HG({ownVersion:$.ownVersion,minVersion:v,latestVersion:D})}var GY="https://api.aetherwealth.ai",JY="http://localhost:9006",f4="https://app.aetherwealth.ai";var Y4=typeof __MCPB_BUILD__==="boolean"?__MCPB_BUILD__:!1;function DF($){let v=$.NODE_ENV;return v==="development"||v==="test"}function QY($){let v=$.AETHER_BASE_URL,D="";if(v&&v.trim().length>0)D=v.trim();else if(DF($))D=JY;else D=GY;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:"&&!j4(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 WY="@aetherwealth/mcp";function zY($={}){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 YY($){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:t4($,v)}}var XF=60000,GF=1000,JF=4000;function IY($){let v=$.fetchImpl??fetch,D=$.now??Date.now,X=$.ttlMs??XF,U=`${$.baseUrl.replace(/\/$/,"")}${r1}`,G=new Map,J=new Map,Q=async(W)=>{let z=await QF(U,W,v);if(!z.ok)return z;if(G.size>=GF){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 QF($,v,D){let X=new AbortController,U=setTimeout(()=>X.abort(),JF),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 F4(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 OH}from"node:crypto";import{createServer as YC}from"node:http";var c={};C4(c,{xor:()=>tI,xid:()=>FI,void:()=>cI,uuidv7:()=>VI,uuidv6:()=>II,uuidv4:()=>YI,uuid:()=>zI,util:()=>w,url:()=>KI,uppercase:()=>o6,unknown:()=>D$,union:()=>X$,undefined:()=>hI,ulid:()=>HI,uint64:()=>nI,uint32:()=>_I,tuple:()=>uW,trim:()=>U1,treeifyError:()=>RG,transform:()=>wD,toUpperCase:()=>X1,toLowerCase:()=>D1,toJSONSchema:()=>oU,templateLiteral:()=>QV,symbol:()=>lI,superRefine:()=>Wz,success:()=>DV,stringbool:()=>LV,stringFormat:()=>TI,string:()=>H,strictObject:()=>pI,startsWith:()=>e6,slugify:()=>G1,size:()=>w6,setErrorMap:()=>gA,set:()=>sI,safeParseAsync:()=>KW,safeParse:()=>VW,safeEncodeAsync:()=>FW,safeEncode:()=>OW,safeDecodeAsync:()=>jW,safeDecode:()=>HW,registry:()=>jU,regexes:()=>a$,regex:()=>p6,refine:()=>Qz,record:()=>s,readonly:()=>vz,property:()=>rU,promise:()=>WV,prettifyError:()=>gG,preprocess:()=>xv,prefault:()=>dW,positive:()=>lU,pipe:()=>DD,partialRecord:()=>oI,parseAsync:()=>IW,parse:()=>YW,overwrite:()=>I4,optional:()=>J$,object:()=>q,number:()=>t,nullish:()=>UV,nullable:()=>Pv,null:()=>Sv,normalize:()=>v1,nonpositive:()=>mU,nonoptional:()=>pW,nonnegative:()=>cU,never:()=>AD,negative:()=>hU,nativeEnum:()=>$V,nanoid:()=>NI,nan:()=>XV,multipleOf:()=>$6,minSize:()=>q4,minLength:()=>i4,mime:()=>$1,meta:()=>VV,maxSize:()=>v6,maxLength:()=>M6,map:()=>eI,mac:()=>wI,lte:()=>e$,lt:()=>P4,lowercase:()=>t6,looseRecord:()=>aI,looseObject:()=>w$,locales:()=>Fv,literal:()=>T,length:()=>P6,lazy:()=>Xz,ksuid:()=>jI,keyof:()=>dI,jwt:()=>EI,json:()=>BV,iso:()=>G6,ipv6:()=>MI,ipv4:()=>AI,invertCodec:()=>JV,intersection:()=>B1,int64:()=>yI,int32:()=>fI,int:()=>UD,instanceof:()=>KV,includes:()=>a6,httpUrl:()=>LI,hostname:()=>RI,hex:()=>gI,hash:()=>CI,guid:()=>WI,gte:()=>x$,gt:()=>b4,globalRegistry:()=>A$,getErrorMap:()=>CA,function:()=>zV,fromJSONSchema:()=>ZV,formatError:()=>Jv,float64:()=>xI,float32:()=>uI,flattenError:()=>Gv,file:()=>vV,exactOptional:()=>lW,enum:()=>M$,endsWith:()=>s6,encodeAsync:()=>NW,encode:()=>LW,emoji:()=>BI,email:()=>QI,e164:()=>kI,discriminatedUnion:()=>Rv,describe:()=>IV,decodeAsync:()=>ZW,decode:()=>BW,date:()=>rI,custom:()=>bD,cuid2:()=>OI,cuid:()=>ZI,core:()=>y4,config:()=>V$,coerce:()=>Yz,codec:()=>GV,clone:()=>C$,cidrv6:()=>bI,cidrv4:()=>PI,check:()=>YV,catch:()=>aW,boolean:()=>K$,bigint:()=>iI,base64url:()=>SI,base64:()=>qI,array:()=>m,any:()=>mI,_function:()=>zV,_default:()=>cW,_ZodString:()=>XD,ZodXor:()=>TW,ZodXID:()=>ID,ZodVoid:()=>kW,ZodUnknown:()=>qW,ZodUnion:()=>Tv,ZodUndefined:()=>MW,ZodUUID:()=>S4,ZodURL:()=>qv,ZodULID:()=>YD,ZodType:()=>y,ZodTuple:()=>CW,ZodTransform:()=>yW,ZodTemplateLiteral:()=>Uz,ZodSymbol:()=>wW,ZodSuccess:()=>tW,ZodStringFormat:()=>U$,ZodString:()=>Y1,ZodSet:()=>fW,ZodRecord:()=>W1,ZodRealError:()=>h$,ZodReadonly:()=>$z,ZodPromise:()=>Gz,ZodPreprocess:()=>sW,ZodPrefault:()=>rW,ZodPipe:()=>gv,ZodOptional:()=>MD,ZodObject:()=>Ev,ZodNumberFormat:()=>b6,ZodNumber:()=>V1,ZodNullable:()=>hW,ZodNull:()=>PW,ZodNonOptional:()=>PD,ZodNever:()=>SW,ZodNanoID:()=>QD,ZodNaN:()=>eW,ZodMap:()=>xW,ZodMAC:()=>AW,ZodLiteral:()=>_W,ZodLazy:()=>Dz,ZodKSUID:()=>VD,ZodJWT:()=>FD,ZodIssueCode:()=>RA,ZodIntersection:()=>gW,ZodISOTime:()=>$D,ZodISODuration:()=>vD,ZodISODateTime:()=>eU,ZodISODate:()=>sU,ZodIPv6:()=>LD,ZodIPv4:()=>KD,ZodGUID:()=>Mv,ZodFunction:()=>Jz,ZodFirstPartyTypeKind:()=>zz,ZodFile:()=>iW,ZodExactOptional:()=>nW,ZodError:()=>EA,ZodEnum:()=>z1,ZodEmoji:()=>JD,ZodEmail:()=>GD,ZodE164:()=>HD,ZodDiscriminatedUnion:()=>RW,ZodDefault:()=>mW,ZodDate:()=>kv,ZodCustomStringFormat:()=>I1,ZodCustom:()=>uv,ZodCodec:()=>Cv,ZodCatch:()=>oW,ZodCUID2:()=>zD,ZodCUID:()=>WD,ZodCIDRv6:()=>ND,ZodCIDRv4:()=>BD,ZodBoolean:()=>K1,ZodBigIntFormat:()=>jD,ZodBigInt:()=>L1,ZodBase64URL:()=>OD,ZodBase64:()=>ZD,ZodArray:()=>EW,ZodAny:()=>bW,TimePrecision:()=>i8,NEVER:()=>FG,$output:()=>g8,$input:()=>C8,$brand:()=>jG});var y4={};C4(y4,{version:()=>qJ,util:()=>w,treeifyError:()=>RG,toJSONSchema:()=>oU,toDotPath:()=>OY,safeParseAsync:()=>zv,safeParse:()=>m6,safeEncodeAsync:()=>PY,safeEncode:()=>wY,safeDecodeAsync:()=>bY,safeDecode:()=>MY,registry:()=>jU,regexes:()=>a$,process:()=>e,prettifyError:()=>gG,parseAsync:()=>Wv,parse:()=>Qv,meta:()=>H9,locales:()=>Fv,isValidJWT:()=>pY,isValidBase64URL:()=>dY,isValidBase64:()=>tJ,initializeContext:()=>U6,globalRegistry:()=>A$,globalConfig:()=>O6,formatError:()=>Jv,flattenError:()=>Gv,finalize:()=>X6,extractDefs:()=>D6,encodeAsync:()=>jY,encode:()=>HY,describe:()=>O9,decodeAsync:()=>AY,decode:()=>FY,createToJSONSchemaMethod:()=>j9,createStandardJSONSchemaMethod:()=>Q1,config:()=>V$,clone:()=>C$,_xor:()=>JA,_xid:()=>RU,_void:()=>z9,_uuidv7:()=>bU,_uuidv6:()=>PU,_uuidv4:()=>MU,_uuid:()=>wU,_url:()=>Av,_uppercase:()=>o6,_unknown:()=>Q9,_union:()=>GA,_undefined:()=>X9,_ulid:()=>TU,_uint64:()=>U9,_uint32:()=>o8,_tuple:()=>zA,_trim:()=>U1,_transform:()=>NA,_toUpperCase:()=>X1,_toLowerCase:()=>D1,_templateLiteral:()=>PA,_symbol:()=>D9,_superRefine:()=>Z9,_success:()=>jA,_stringbool:()=>F9,_stringFormat:()=>J1,_string:()=>x8,_startsWith:()=>e6,_slugify:()=>G1,_size:()=>w6,_set:()=>VA,_safeParseAsync:()=>c6,_safeParse:()=>h6,_safeEncodeAsync:()=>JU,_safeEncode:()=>XU,_safeDecodeAsync:()=>QU,_safeDecode:()=>GU,_regex:()=>p6,_refine:()=>N9,_record:()=>YA,_readonly:()=>MA,_property:()=>rU,_promise:()=>qA,_positive:()=>lU,_pipe:()=>wA,_parseAsync:()=>l6,_parse:()=>n6,_overwrite:()=>I4,_optional:()=>ZA,_number:()=>m8,_nullable:()=>OA,_null:()=>G9,_normalize:()=>v1,_nonpositive:()=>mU,_nonoptional:()=>FA,_nonnegative:()=>cU,_never:()=>W9,_negative:()=>hU,_nativeEnum:()=>LA,_nanoid:()=>SU,_nan:()=>V9,_multipleOf:()=>$6,_minSize:()=>q4,_minLength:()=>i4,_min:()=>x$,_mime:()=>$1,_maxSize:()=>v6,_maxLength:()=>M6,_max:()=>e$,_map:()=>IA,_mac:()=>_8,_lte:()=>e$,_lt:()=>P4,_lowercase:()=>t6,_literal:()=>BA,_length:()=>P6,_lazy:()=>bA,_ksuid:()=>gU,_jwt:()=>nU,_isoTime:()=>l8,_isoDuration:()=>h8,_isoDateTime:()=>y8,_isoDate:()=>n8,_ipv6:()=>uU,_ipv4:()=>CU,_intersection:()=>WA,_int64:()=>v9,_int32:()=>t8,_int:()=>r8,_includes:()=>a6,_guid:()=>jv,_gte:()=>x$,_gt:()=>b4,_float64:()=>p8,_float32:()=>d8,_file:()=>L9,_enum:()=>KA,_endsWith:()=>s6,_encodeAsync:()=>UU,_encode:()=>$U,_emoji:()=>qU,_email:()=>AU,_e164:()=>yU,_discriminatedUnion:()=>QA,_default:()=>HA,_decodeAsync:()=>DU,_decode:()=>vU,_date:()=>Y9,_custom:()=>B9,_cuid2:()=>EU,_cuid:()=>kU,_coercedString:()=>f8,_coercedNumber:()=>c8,_coercedDate:()=>I9,_coercedBoolean:()=>e8,_coercedBigint:()=>$9,_cidrv6:()=>fU,_cidrv4:()=>xU,_check:()=>DI,_catch:()=>AA,_boolean:()=>a8,_bigint:()=>s8,_base64url:()=>iU,_base64:()=>_U,_array:()=>K9,_any:()=>J9,TimePrecision:()=>i8,NEVER:()=>FG,JSONSchemaGenerator:()=>GW,JSONSchema:()=>XI,Doc:()=>IU,$output:()=>g8,$input:()=>C8,$constructor:()=>B,$brand:()=>jG,$ZodXor:()=>KQ,$ZodXID:()=>_J,$ZodVoid:()=>zQ,$ZodUnknown:()=>QQ,$ZodUnion:()=>Lv,$ZodUndefined:()=>XQ,$ZodUUID:()=>EJ,$ZodURL:()=>RJ,$ZodULID:()=>fJ,$ZodType:()=>_,$ZodTuple:()=>OU,$ZodTransform:()=>AQ,$ZodTemplateLiteral:()=>gQ,$ZodSymbol:()=>DQ,$ZodSuccess:()=>SQ,$ZodStringFormat:()=>v$,$ZodString:()=>A6,$ZodSet:()=>OQ,$ZodRegistry:()=>u8,$ZodRecord:()=>NQ,$ZodRealError:()=>l$,$ZodReadonly:()=>RQ,$ZodPromise:()=>uQ,$ZodPreprocess:()=>TQ,$ZodPrefault:()=>bQ,$ZodPipe:()=>FU,$ZodOptional:()=>HU,$ZodObjectJIT:()=>VQ,$ZodObject:()=>aY,$ZodNumberFormat:()=>vQ,$ZodNumber:()=>NU,$ZodNullable:()=>MQ,$ZodNull:()=>GQ,$ZodNonOptional:()=>qQ,$ZodNever:()=>WQ,$ZodNanoID:()=>CJ,$ZodNaN:()=>EQ,$ZodMap:()=>ZQ,$ZodMAC:()=>rJ,$ZodLiteral:()=>FQ,$ZodLazy:()=>xQ,$ZodKSUID:()=>iJ,$ZodJWT:()=>sJ,$ZodIntersection:()=>BQ,$ZodISOTime:()=>lJ,$ZodISODuration:()=>hJ,$ZodISODateTime:()=>yJ,$ZodISODate:()=>nJ,$ZodIPv6:()=>cJ,$ZodIPv4:()=>mJ,$ZodGUID:()=>kJ,$ZodFunction:()=>CQ,$ZodFile:()=>jQ,$ZodExactOptional:()=>wQ,$ZodError:()=>Xv,$ZodEnum:()=>HQ,$ZodEncodeError:()=>H6,$ZodEmoji:()=>gJ,$ZodEmail:()=>TJ,$ZodE164:()=>eJ,$ZodDiscriminatedUnion:()=>LQ,$ZodDefault:()=>PQ,$ZodDate:()=>YQ,$ZodCustomStringFormat:()=>$Q,$ZodCustom:()=>fQ,$ZodCodec:()=>Bv,$ZodCheckUpperCase:()=>FJ,$ZodCheckStringFormat:()=>r6,$ZodCheckStartsWith:()=>AJ,$ZodCheckSizeEquals:()=>LJ,$ZodCheckRegex:()=>OJ,$ZodCheckProperty:()=>MJ,$ZodCheckOverwrite:()=>bJ,$ZodCheckNumberFormat:()=>YJ,$ZodCheckMultipleOf:()=>zJ,$ZodCheckMinSize:()=>KJ,$ZodCheckMinLength:()=>NJ,$ZodCheckMimeType:()=>PJ,$ZodCheckMaxSize:()=>VJ,$ZodCheckMaxLength:()=>BJ,$ZodCheckLowerCase:()=>HJ,$ZodCheckLessThan:()=>zU,$ZodCheckLengthEquals:()=>ZJ,$ZodCheckIncludes:()=>jJ,$ZodCheckGreaterThan:()=>YU,$ZodCheckEndsWith:()=>wJ,$ZodCheckBigIntFormat:()=>IJ,$ZodCheck:()=>G$,$ZodCatch:()=>kQ,$ZodCUID2:()=>xJ,$ZodCUID:()=>uJ,$ZodCIDRv6:()=>pJ,$ZodCIDRv4:()=>dJ,$ZodBoolean:()=>Kv,$ZodBigIntFormat:()=>UQ,$ZodBigInt:()=>ZU,$ZodBase64URL:()=>aJ,$ZodBase64:()=>oJ,$ZodAsyncError:()=>M4,$ZodArray:()=>IQ,$ZodAny:()=>JQ});var VY,FG=Object.freeze({status:"aborted"});function B($,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 jG=Symbol("zod_brand");class M4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class H6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(VY=globalThis).__zod_globalConfig??(VY.__zod_globalConfig={});var O6=globalThis.__zod_globalConfig;function V$($){if($)Object.assign(O6,$);return O6}var w={};C4(w,{unwrapMessage:()=>e1,uint8ArrayToHex:()=>RF,uint8ArrayToBase64url:()=>EF,uint8ArrayToBase64:()=>BY,stringifyPrimitive:()=>j,slugify:()=>MG,shallowClone:()=>bG,safeExtend:()=>MF,required:()=>qF,randomString:()=>ZF,propertyKeyTypes:()=>vv,promiseAllObject:()=>NF,primitiveTypes:()=>qG,prefixIssues:()=>n$,pick:()=>jF,partial:()=>bF,parsedType:()=>A,optionalKeys:()=>SG,omit:()=>AF,objectClone:()=>KF,numKeys:()=>OF,nullish:()=>o4,normalizeParams:()=>M,mergeDefs:()=>_4,merge:()=>PF,jsonStringifyReplacer:()=>_6,joinValues:()=>O,issue:()=>y6,isPlainObject:()=>e4,isObject:()=>F6,hexToUint8Array:()=>TF,getSizableOrigin:()=>Uv,getParsedType:()=>HF,getLengthableOrigin:()=>Dv,getEnumValues:()=>s1,getElementAtPath:()=>BF,floatSafeRemainder:()=>wG,finalizeIssue:()=>u$,extend:()=>wF,explicitlyAborted:()=>TG,escapeRegex:()=>v4,esc:()=>e0,defineLazy:()=>h,createTransparentProxy:()=>FF,cloneDef:()=>LF,clone:()=>C$,cleanRegex:()=>$v,cleanEnum:()=>SF,captureStackTrace:()=>s0,cached:()=>i6,base64urlToUint8Array:()=>kF,base64ToUint8Array:()=>LY,assignProp:()=>a4,assertNotEqual:()=>zF,assertNever:()=>IF,assertIs:()=>YF,assertEqual:()=>WF,assert:()=>VF,allowsEval:()=>PG,aborted:()=>s4,NUMBER_FORMAT_RANGES:()=>kG,Class:()=>NY,BIGINT_FORMAT_RANGES:()=>EG});function WF($){return $}function zF($){return $}function YF($){}function IF($){throw Error("Unexpected value in exhaustive check")}function VF($){}function s1($){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 _6($,v){if(typeof v==="bigint")return v.toString();return v}function i6($){return{get value(){{let D=$();return Object.defineProperty(this,"value",{value:D}),D}throw Error("cached value already set")}}}function o4($){return $===null||$===void 0}function $v($){let v=$.startsWith("^")?1:0,D=$.endsWith("$")?$.length-1:$.length;return $.slice(v,D)}function wG($,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 KY=Symbol("evaluating");function h($,v,D){let X=void 0;Object.defineProperty($,v,{get(){if(X===KY)return;if(X===void 0)X=KY,X=D();return X},set(U){Object.defineProperty($,v,{value:U})},configurable:!0})}function KF($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function a4($,v,D){Object.defineProperty($,v,{value:D,writable:!0,enumerable:!0,configurable:!0})}function _4(...$){let v={};for(let D of $){let X=Object.getOwnPropertyDescriptors(D);Object.assign(v,X)}return Object.defineProperties({},v)}function LF($){return _4($._zod.def)}function BF($,v){if(!v)return $;return v.reduce((D,X)=>D?.[X],$)}function NF($){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 ZF($=10){let D="";for(let X=0;X<$;X++)D+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return D}function e0($){return JSON.stringify($)}function MG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var s0="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function F6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var PG=i6(()=>{if(O6.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function e4($){if(F6($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let D=v.prototype;if(F6(D)===!1)return!1;if(Object.prototype.hasOwnProperty.call(D,"isPrototypeOf")===!1)return!1;return!0}function bG($){if(e4($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function OF($){let v=0;for(let D in $)if(Object.prototype.hasOwnProperty.call($,D))v++;return v}var HF=($)=>{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}`)}},vv=new Set(["string","number","symbol"]),qG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function v4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C$($,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 FF($){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 SG($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var kG={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]},EG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function jF($,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=_4($._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 a4(this,"shape",J),J},checks:[]});return C$($,G)}function AF($,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=_4($._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 a4(this,"shape",J),J},checks:[]});return C$($,G)}function wF($,v){if(!e4(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=_4($._zod.def,{get shape(){let G={...$._zod.def.shape,...v};return a4(this,"shape",G),G}});return C$($,U)}function MF($,v){if(!e4(v))throw Error("Invalid input to safeExtend: expected a plain object");let D=_4($._zod.def,{get shape(){let X={...$._zod.def.shape,...v};return a4(this,"shape",X),X}});return C$($,D)}function PF($,v){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let D=_4($._zod.def,{get shape(){let X={...$._zod.def.shape,...v._zod.def.shape};return a4(this,"shape",X),X},get catchall(){return v._zod.def.catchall},checks:v._zod.def.checks??[]});return C$($,D)}function bF($,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=_4(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 a4(this,"shape",W),W},checks:[]});return C$(v,J)}function qF($,v,D){let X=_4(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 a4(this,"shape",G),G}});return C$(v,X)}function s4($,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 TG($,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 e1($){return typeof $==="string"?$:$?.message}function u$($,v,D){let X=$.message?$.message:e1($.inst?._zod.def?.error?.($))??e1(v?.error?.($))??e1(D.customError?.($))??e1(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 Uv($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function Dv($){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 y6(...$){let[v,D,X]=$;if(typeof v==="string")return{message:v,code:"custom",input:D,inst:X};return{...v}}function SF($){return Object.entries($).filter(([v,D])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function LY($){let v=atob($),D=new Uint8Array(v.length);for(let X=0;X<v.length;X++)D[X]=v.charCodeAt(X);return D}function BY($){let v="";for(let D=0;D<$.length;D++)v+=String.fromCharCode($[D]);return btoa(v)}function kF($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),D="=".repeat((4-v.length%4)%4);return LY(v+D)}function EF($){return BY($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function TF($){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 RF($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class NY{constructor(...$){}}var ZY=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,_6,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Xv=B("$ZodError",ZY),l$=B("$ZodError",ZY,{Parent:Error});function Gv($,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 Jv($,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 RG($,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],K=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(K)Y.errors.push(v(W));I++}}};return X($),D}function OY($){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 gG($){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 ${OY(X.path)}`);return v.join(`
29
+ `)}var n6=($)=>(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 M4;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((W)=>u$(W,G,V$())));throw s0(Q,U?.callee),Q}return J.value},Qv=n6(l$),l6=($)=>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)=>u$(W,G,V$())));throw s0(Q,U?.callee),Q}return J.value},Wv=l6(l$),h6=($)=>(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 M4;return G.issues.length?{success:!1,error:new($??Xv)(G.issues.map((J)=>u$(J,U,V$())))}:{success:!0,data:G.value}},m6=h6(l$),c6=($)=>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)=>u$(J,U,V$())))}:{success:!0,data:G.value}},zv=c6(l$),$U=($)=>(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return n6($)(v,D,U)},HY=$U(l$),vU=($)=>(v,D,X)=>{return n6($)(v,D,X)},FY=vU(l$),UU=($)=>async(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return l6($)(v,D,U)},jY=UU(l$),DU=($)=>async(v,D,X)=>{return l6($)(v,D,X)},AY=DU(l$),XU=($)=>(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return h6($)(v,D,U)},wY=XU(l$),GU=($)=>(v,D,X)=>{return h6($)(v,D,X)},MY=GU(l$),JU=($)=>async(v,D,X)=>{let U=X?{...X,direction:"backward"}:{direction:"backward"};return c6($)(v,D,U)},PY=JU(l$),QU=($)=>async(v,D,X)=>{return c6($)(v,D,X)},bY=QU(l$);var a$={};C4(a$,{xid:()=>fG,uuid7:()=>fF,uuid6:()=>xF,uuid4:()=>uF,uuid:()=>j6,uppercase:()=>WJ,unicodeEmail:()=>qY,undefined:()=>JJ,ulid:()=>xG,time:()=>sG,string:()=>vJ,sha512_hex:()=>Xj,sha512_base64url:()=>Jj,sha512_base64:()=>Gj,sha384_hex:()=>vj,sha384_base64url:()=>Dj,sha384_base64:()=>Uj,sha256_hex:()=>eF,sha256_base64url:()=>$j,sha256_base64:()=>sF,sha1_hex:()=>tF,sha1_base64url:()=>aF,sha1_base64:()=>oF,rfc5322Email:()=>iF,number:()=>Yv,null:()=>GJ,nanoid:()=>iG,md5_hex:()=>rF,md5_base64url:()=>pF,md5_base64:()=>dF,mac:()=>rG,lowercase:()=>QJ,ksuid:()=>_G,ipv6:()=>cG,ipv4:()=>mG,integer:()=>DJ,idnEmail:()=>yF,httpProtocol:()=>oG,html5Email:()=>_F,hostname:()=>hF,hex:()=>cF,guid:()=>nG,extendedDuration:()=>CF,emoji:()=>hG,email:()=>lG,e164:()=>aG,duration:()=>yG,domain:()=>mF,datetime:()=>$J,date:()=>eG,cuid2:()=>uG,cuid:()=>CG,cidrv6:()=>pG,cidrv4:()=>dG,browserEmail:()=>nF,boolean:()=>XJ,bigint:()=>UJ,base64url:()=>WU,base64:()=>tG});var CG=/^[cC][0-9a-z]{6,}$/,uG=/^[0-9a-z]+$/,xG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fG=/^[0-9a-vA-V]{20}$/,_G=/^[A-Za-z0-9]{27}$/,iG=/^[a-zA-Z0-9_-]{21}$/,yG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,CF=/^[-+]?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)?)??$/,nG=/^([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})$/,j6=($)=>{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})$`)},uF=j6(4),xF=j6(6),fF=j6(7),lG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_F=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,iF=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qY=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,yF=qY,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])?)*$/,lF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function hG(){return new RegExp(lF,"u")}var mG=/^(?:(?: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])$/,cG=/^(([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}|:))$/,rG=($)=>{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}$`)},dG=/^((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])$/,pG=/^(([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])$/,tG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,WU=/^[A-Za-z0-9_-]*$/,hF=/^(?=.{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])?)*\.?$/,mF=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,oG=/^https?$/,aG=/^\+[1-9]\d{6,14}$/,SY="(?:(?:\\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])))",eG=new RegExp(`^${SY}$`);function kY($){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 sG($){return new RegExp(`^${kY($)}$`)}function $J($){let v=kY({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(`^${SY}T(?:${X})$`)}var vJ=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},UJ=/^-?\d+n?$/,DJ=/^-?\d+$/,Yv=/^-?\d+(?:\.\d+)?$/,XJ=/^(?:true|false)$/i,GJ=/^null$/i;var JJ=/^undefined$/i;var QJ=/^[^A-Z]*$/,WJ=/^[^a-z]*$/,cF=/^[0-9a-fA-F]*$/;function Iv($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function Vv($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var rF=/^[0-9a-fA-F]{32}$/,dF=Iv(22,"=="),pF=Vv(22),tF=/^[0-9a-fA-F]{40}$/,oF=Iv(27,"="),aF=Vv(27),eF=/^[0-9a-fA-F]{64}$/,sF=Iv(43,"="),$j=Vv(43),vj=/^[0-9a-fA-F]{96}$/,Uj=Iv(64,""),Dj=Vv(64),Xj=/^[0-9a-fA-F]{128}$/,Gj=Iv(86,"=="),Jj=Vv(86);var G$=B("$ZodCheck",($,v)=>{var D;$._zod??($._zod={}),$._zod.def=v,(D=$._zod).onattach??(D.onattach=[])}),TY={number:"number",bigint:"bigint",object:"date"},zU=B("$ZodCheckLessThan",($,v)=>{G$.init($,v);let D=TY[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})}}),YU=B("$ZodCheckGreaterThan",($,v)=>{G$.init($,v);let D=TY[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})}}),zJ=B("$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):wG(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})}}),YJ=B("$ZodCheckNumberFormat",($,v)=>{G$.init($,v),v.format=v.format||"float64";let D=v.format?.includes("int"),X=D?"int":"number",[U,G]=kG[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=DJ}),$._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})}}),IJ=B("$ZodCheckBigIntFormat",($,v)=>{G$.init($,v);let[D,X]=EG[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})}}),VJ=B("$ZodCheckMaxSize",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!o4(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:Uv(U),code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),KJ=B("$ZodCheckMinSize",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!o4(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:Uv(U),code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),LJ=B("$ZodCheckSizeEquals",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!o4(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:Uv(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})}}),BJ=B("$ZodCheckMaxLength",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!o4(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=Dv(U);X.issues.push({origin:J,code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),NJ=B("$ZodCheckMinLength",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!o4(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=Dv(U);X.issues.push({origin:J,code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),ZJ=B("$ZodCheckLengthEquals",($,v)=>{var D;G$.init($,v),(D=$._zod.def).when??(D.when=(X)=>{let U=X.value;return!o4(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=Dv(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})}}),r6=B("$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=()=>{})}),OJ=B("$ZodCheckRegex",($,v)=>{r6.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})}}),HJ=B("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=QJ),r6.init($,v)}),FJ=B("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=WJ),r6.init($,v)}),jJ=B("$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})}}),AJ=B("$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})}}),wJ=B("$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 EY($,v,D){if($.issues.length)v.issues.push(...n$(D,$.issues))}var MJ=B("$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)=>EY(U,D,v.property));EY(X,D,v.property);return}}),PJ=B("$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})}}),bJ=B("$ZodCheckOverwrite",($,v)=>{G$.init($,v),$._zod.check=(D)=>{D.value=v.tx(D.value)}});class IU{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
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 PJ={major:4,minor:4,patch:3};var f=K("$ZodType",($,v)=>{var D;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=PJ;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,I)=>{let W=e4(J),z;for(let Y of Q){if(Y._zod.def.when){if(kG(J))continue;if(!Y._zod.def.when(J))continue}else if(W)continue;let B=J.issues.length,V=Y._zod.check(J);if(V instanceof Promise&&I?.async===!1)throw new w4;if(z||V instanceof Promise)z=(z??Promise.resolve()).then(async()=>{if(await V,J.issues.length===B)return;if(!W)W=e4(J,B)});else{if(J.issues.length===B)continue;if(!W)W=e4(J,B)}}if(z)return z.then(()=>{return J});return J},G=(J,Q,I)=>{if(e4(J))return J.aborted=!0,J;let W=U(Q,X,I);if(W instanceof Promise){if(I.async===!1)throw new w4;return W.then((z)=>$._zod.parse(z,I))}return $._zod.parse(W,I)};$._zod.run=(J,Q)=>{if(Q.skipChecks)return $._zod.parse(J,Q);if(Q.direction==="backward"){let W=$._zod.parse({value:J.value,issues:[]},{...Q,skipChecks:!0});if(W instanceof Promise)return W.then((z)=>{return G(z,J,Q)});return G(W,J,Q)}let I=$._zod.parse(J,Q);if(I instanceof Promise){if(Q.async===!1)throw new w4;return I.then((W)=>U(W,X,Q))}return U(I,X,Q)}}h($,"~standard",()=>({validate:(U)=>{try{let G=h6($,U);return G.success?{value:G.data}:{issues:G.error?.issues}}catch(G){return Iv($,U).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),F6=K("$ZodString",($,v)=>{f.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??sG($._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)=>{r6.init($,v),F6.init($,v)}),qJ=K("$ZodGUID",($,v)=>{v.pattern??(v.pattern=nG),v$.init($,v)}),SJ=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=H6(X))}else v.pattern??(v.pattern=H6());v$.init($,v)}),kJ=K("$ZodEmail",($,v)=>{v.pattern??(v.pattern=_G),v$.init($,v)}),TJ=K("$ZodURL",($,v)=>{v$.init($,v),$._zod.check=(D)=>{try{let X=D.value.trim();if(!v.normalize&&v.protocol?.source===pG.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})}}}),EJ=K("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=yG()),v$.init($,v)}),uJ=K("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=iG),v$.init($,v)}),RJ=K("$ZodCUID",($,v)=>{v.pattern??(v.pattern=uG),v$.init($,v)}),gJ=K("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=RG),v$.init($,v)}),CJ=K("$ZodULID",($,v)=>{v.pattern??(v.pattern=gG),v$.init($,v)}),xJ=K("$ZodXID",($,v)=>{v.pattern??(v.pattern=CG),v$.init($,v)}),iJ=K("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=xG),v$.init($,v)}),fJ=K("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=eG(v)),v$.init($,v)}),nJ=K("$ZodISODate",($,v)=>{v.pattern??(v.pattern=oG),v$.init($,v)}),_J=K("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=aG(v)),v$.init($,v)}),yJ=K("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=fG),v$.init($,v)}),lJ=K("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=lG),v$.init($,v),$._zod.bag.format="ipv4"}),hJ=K("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=hG),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})}}}),mJ=K("$ZodMAC",($,v)=>{v.pattern??(v.pattern=mG(v.delimiter)),v$.init($,v),$._zod.bag.format="mac"}),rJ=K("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=rG),v$.init($,v)}),cJ=K("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=cG),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 dJ($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var pJ=K("$ZodBase64",($,v)=>{v.pattern??(v.pattern=dG),v$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(D)=>{if(dJ(D.value))return;D.issues.push({code:"invalid_format",format:"base64",input:D.value,inst:$,continue:!v.abort})}});function m7($){if(!QU.test($))return!1;let v=$.replace(/[-_]/g,(X)=>X==="-"?"+":"/"),D=v.padEnd(Math.ceil(v.length/4)*4,"=");return dJ(D)}var tJ=K("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=QU),v$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(D)=>{if(m7(D.value))return;D.issues.push({code:"invalid_format",format:"base64url",input:D.value,inst:$,continue:!v.abort})}}),oJ=K("$ZodE164",($,v)=>{v.pattern??(v.pattern=tG),v$.init($,v)});function r7($,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 aJ=K("$ZodJWT",($,v)=>{v$.init($,v),$._zod.check=(D)=>{if(r7(D.value,v.alg))return;D.issues.push({code:"invalid_format",format:"jwt",input:D.value,inst:$,continue:!v.abort})}}),eJ=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})}}),KU=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}}),sJ=K("$ZodNumberFormat",($,v)=>{IJ.init($,v),KU.init($,v)}),Bv=K("$ZodBoolean",($,v)=>{f.init($,v),$._zod.pattern=UJ,$._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}}),NU=K("$ZodBigInt",($,v)=>{f.init($,v),$._zod.pattern=$J,$._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}}),$Q=K("$ZodBigIntFormat",($,v)=>{WJ.init($,v),NU.init($,v)}),vQ=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}}),UQ=K("$ZodUndefined",($,v)=>{f.init($,v),$._zod.pattern=XJ,$._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}}),DQ=K("$ZodNull",($,v)=>{f.init($,v),$._zod.pattern=DJ,$._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}}),XQ=K("$ZodAny",($,v)=>{f.init($,v),$._zod.parse=(D)=>D}),GQ=K("$ZodUnknown",($,v)=>{f.init($,v),$._zod.parse=(D)=>D}),JQ=K("$ZodNever",($,v)=>{f.init($,v),$._zod.parse=(D,X)=>{return D.issues.push({expected:"never",code:"invalid_type",input:D.value,inst:$}),D}}),QQ=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}}),IQ=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 T7($,v,D){if($.issues.length)v.issues.push(...y$(D,$.issues));v.value[D]=$.value}var WQ=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],I=v.element._zod.run({value:Q,issues:[]},X);if(I instanceof Promise)G.push(I.then((W)=>T7(W,D,J)));else T7(I,D,J)}if(G.length)return Promise.all(G).then(()=>D);return D}});function LU($,v,D,X,U,G){let J=D in X;if($.issues.length){if(U&&G&&!J)return;v.issues.push(...y$(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 c7($){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=bG($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(D)}}function d7($,v,D,X,U,G){let J=[],Q=U.keySet,I=U.catchall._zod,W=I.def.type,z=I.optin==="optional",Y=I.optout==="optional";for(let B in v){if(B==="__proto__")continue;if(Q.has(B))continue;if(W==="never"){J.push(B);continue}let V=I.run({value:v[B],issues:[]},X);if(V instanceof Promise)$.push(V.then((L)=>LU(L,D,B,v,z,Y)));else LU(V,D,B,v,z,Y)}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 p7=K("$ZodObject",($,v)=>{if(f.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let Q=v.shape;Object.defineProperty(v,"shape",{get:()=>{let I={...Q};return Object.defineProperty(v,"shape",{value:I}),I}})}let X=f6(()=>c7(v));h($._zod,"propValues",()=>{let Q=v.shape,I={};for(let W in Q){let z=Q[W]._zod;if(z.values){I[W]??(I[W]=new Set);for(let Y of z.values)I[W].add(Y)}}return I});let U=A6,G=v.catchall,J;$._zod.parse=(Q,I)=>{J??(J=X.value);let W=Q.value;if(!U(W))return Q.issues.push({expected:"object",code:"invalid_type",input:W,inst:$}),Q;Q.value={};let z=[],Y=J.shape;for(let B of J.keys){let V=Y[B],L=V._zod.optin==="optional",N=V._zod.optout==="optional",Z=V._zod.run({value:W[B],issues:[]},I);if(Z instanceof Promise)z.push(Z.then((H)=>LU(H,Q,B,W,L,N)));else LU(Z,Q,B,W,L,N)}if(!G)return z.length?Promise.all(z).then(()=>Q):Q;return d7(z,W,Q,I,X.value,$)}}),zQ=K("$ZodObjectJIT",($,v)=>{p7.init($,v);let D=$._zod.parse,X=f6(()=>c7(v)),U=(B)=>{let V=new zU(["shape","payload","ctx"]),L=X.value,N=(R)=>{let C=a0(R);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};V.write("const input = payload.value;");let Z=Object.create(null),H=0;for(let R of L.keys)Z[R]=`key_${H++}`;V.write("const newResult = {};");for(let R of L.keys){let C=Z[R],k=a0(R),N$=B[R],F$=N$?._zod?.optin==="optional",u4=N$?._zod?.optout==="optional";if(V.write(`const ${C} = ${N(R)};`),F$&&u4)V.write(`
32
- if (${C}.issues.length) {
31
+ `))}}var qJ={major:4,minor:4,patch:3};var _=B("$ZodType",($,v)=>{var D;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=qJ;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=s4(J),Y;for(let I of Q){if(I._zod.def.when){if(TG(J))continue;if(!I._zod.def.when(J))continue}else if(z)continue;let V=J.issues.length,K=I._zod.check(J);if(K instanceof Promise&&W?.async===!1)throw new M4;if(Y||K instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await K,J.issues.length===V)return;if(!z)z=s4(J,V)});else{if(J.issues.length===V)continue;if(!z)z=s4(J,V)}}if(Y)return Y.then(()=>{return J});return J},G=(J,Q,W)=>{if(s4(J))return J.aborted=!0,J;let z=U(Q,X,W);if(z instanceof Promise){if(W.async===!1)throw new M4;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 M4;return W.then((z)=>U(z,X,Q))}return U(W,X,Q)}}h($,"~standard",()=>({validate:(U)=>{try{let G=m6($,U);return G.success?{value:G.data}:{issues:G.error?.issues}}catch(G){return zv($,U).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),A6=B("$ZodString",($,v)=>{_.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??vJ($._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$=B("$ZodStringFormat",($,v)=>{r6.init($,v),A6.init($,v)}),kJ=B("$ZodGUID",($,v)=>{v.pattern??(v.pattern=nG),v$.init($,v)}),EJ=B("$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=j6(X))}else v.pattern??(v.pattern=j6());v$.init($,v)}),TJ=B("$ZodEmail",($,v)=>{v.pattern??(v.pattern=lG),v$.init($,v)}),RJ=B("$ZodURL",($,v)=>{v$.init($,v),$._zod.check=(D)=>{try{let X=D.value.trim();if(!v.normalize&&v.protocol?.source===oG.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})}}}),gJ=B("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=hG()),v$.init($,v)}),CJ=B("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=iG),v$.init($,v)}),uJ=B("$ZodCUID",($,v)=>{v.pattern??(v.pattern=CG),v$.init($,v)}),xJ=B("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=uG),v$.init($,v)}),fJ=B("$ZodULID",($,v)=>{v.pattern??(v.pattern=xG),v$.init($,v)}),_J=B("$ZodXID",($,v)=>{v.pattern??(v.pattern=fG),v$.init($,v)}),iJ=B("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=_G),v$.init($,v)}),yJ=B("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=$J(v)),v$.init($,v)}),nJ=B("$ZodISODate",($,v)=>{v.pattern??(v.pattern=eG),v$.init($,v)}),lJ=B("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=sG(v)),v$.init($,v)}),hJ=B("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=yG),v$.init($,v)}),mJ=B("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=mG),v$.init($,v),$._zod.bag.format="ipv4"}),cJ=B("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=cG),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})}}}),rJ=B("$ZodMAC",($,v)=>{v.pattern??(v.pattern=rG(v.delimiter)),v$.init($,v),$._zod.bag.format="mac"}),dJ=B("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=dG),v$.init($,v)}),pJ=B("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=pG),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 tJ($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var oJ=B("$ZodBase64",($,v)=>{v.pattern??(v.pattern=tG),v$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(D)=>{if(tJ(D.value))return;D.issues.push({code:"invalid_format",format:"base64",input:D.value,inst:$,continue:!v.abort})}});function dY($){if(!WU.test($))return!1;let v=$.replace(/[-_]/g,(X)=>X==="-"?"+":"/"),D=v.padEnd(Math.ceil(v.length/4)*4,"=");return tJ(D)}var aJ=B("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=WU),v$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(D)=>{if(dY(D.value))return;D.issues.push({code:"invalid_format",format:"base64url",input:D.value,inst:$,continue:!v.abort})}}),eJ=B("$ZodE164",($,v)=>{v.pattern??(v.pattern=aG),v$.init($,v)});function pY($,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 sJ=B("$ZodJWT",($,v)=>{v$.init($,v),$._zod.check=(D)=>{if(pY(D.value,v.alg))return;D.issues.push({code:"invalid_format",format:"jwt",input:D.value,inst:$,continue:!v.abort})}}),$Q=B("$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})}}),NU=B("$ZodNumber",($,v)=>{_.init($,v),$._zod.pattern=$._zod.bag.pattern??Yv,$._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}}),vQ=B("$ZodNumberFormat",($,v)=>{YJ.init($,v),NU.init($,v)}),Kv=B("$ZodBoolean",($,v)=>{_.init($,v),$._zod.pattern=XJ,$._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}}),ZU=B("$ZodBigInt",($,v)=>{_.init($,v),$._zod.pattern=UJ,$._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}}),UQ=B("$ZodBigIntFormat",($,v)=>{IJ.init($,v),ZU.init($,v)}),DQ=B("$ZodSymbol",($,v)=>{_.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}}),XQ=B("$ZodUndefined",($,v)=>{_.init($,v),$._zod.pattern=JJ,$._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}}),GQ=B("$ZodNull",($,v)=>{_.init($,v),$._zod.pattern=GJ,$._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}}),JQ=B("$ZodAny",($,v)=>{_.init($,v),$._zod.parse=(D)=>D}),QQ=B("$ZodUnknown",($,v)=>{_.init($,v),$._zod.parse=(D)=>D}),WQ=B("$ZodNever",($,v)=>{_.init($,v),$._zod.parse=(D,X)=>{return D.issues.push({expected:"never",code:"invalid_type",input:D.value,inst:$}),D}}),zQ=B("$ZodVoid",($,v)=>{_.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}}),YQ=B("$ZodDate",($,v)=>{_.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 gY($,v,D){if($.issues.length)v.issues.push(...n$(D,$.issues));v.value[D]=$.value}var IQ=B("$ZodArray",($,v)=>{_.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)=>gY(z,D,J)));else gY(W,D,J)}if(G.length)return Promise.all(G).then(()=>D);return D}});function BU($,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 tY($){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=SG($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(D)}}function oY($,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 K=W.run({value:v[V],issues:[]},X);if(K instanceof Promise)$.push(K.then((L)=>BU(L,D,V,v,Y,I)));else BU(K,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 aY=B("$ZodObject",($,v)=>{if(_.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=i6(()=>tY(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=F6,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 K=I[V],L=K._zod.optin==="optional",N=K._zod.optout==="optional",Z=K._zod.run({value:z[V],issues:[]},W);if(Z instanceof Promise)Y.push(Z.then((F)=>BU(F,Q,V,z,L,N)));else BU(Z,Q,V,z,L,N)}if(!G)return Y.length?Promise.all(Y).then(()=>Q):Q;return oY(Y,z,Q,W,X.value,$)}}),VQ=B("$ZodObjectJIT",($,v)=>{aY.init($,v);let D=$._zod.parse,X=i6(()=>tY(v)),U=(V)=>{let K=new IU(["shape","payload","ctx"]),L=X.value,N=(g)=>{let u=e0(g);return`shape[${u}]._zod.run({ value: input[${u}], issues: [] }, ctx)`};K.write("const input = payload.value;");let Z=Object.create(null),F=0;for(let g of L.keys)Z[g]=`key_${F++}`;K.write("const newResult = {};");for(let g of L.keys){let u=Z[g],k=e0(g),N$=V[g],j$=N$?._zod?.optin==="optional",g4=N$?._zod?.optout==="optional";if(K.write(`const ${u} = ${N(g)};`),j$&&g4)K.write(`
32
+ if (${u}.issues.length) {
33
33
  if (${k} in input) {
34
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
34
+ payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
35
35
  ...iss,
36
36
  path: iss.path ? [${k}, ...iss.path] : [${k}]
37
37
  })));
38
38
  }
39
39
  }
40
40
 
41
- if (${C}.value === undefined) {
41
+ if (${u}.value === undefined) {
42
42
  if (${k} in input) {
43
43
  newResult[${k}] = undefined;
44
44
  }
45
45
  } else {
46
- newResult[${k}] = ${C}.value;
46
+ newResult[${k}] = ${u}.value;
47
47
  }
48
48
 
49
- `);else if(!F$)V.write(`
50
- const ${C}_present = ${k} in input;
51
- if (${C}.issues.length) {
52
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
49
+ `);else if(!j$)K.write(`
50
+ const ${u}_present = ${k} in input;
51
+ if (${u}.issues.length) {
52
+ payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
53
53
  ...iss,
54
54
  path: iss.path ? [${k}, ...iss.path] : [${k}]
55
55
  })));
56
56
  }
57
- if (!${C}_present && !${C}.issues.length) {
57
+ if (!${u}_present && !${u}.issues.length) {
58
58
  payload.issues.push({
59
59
  code: "invalid_type",
60
60
  expected: "nonoptional",
@@ -63,75 +63,75 @@ ${V}
63
63
  });
64
64
  }
65
65
 
66
- if (${C}_present) {
67
- if (${C}.value === undefined) {
66
+ if (${u}_present) {
67
+ if (${u}.value === undefined) {
68
68
  newResult[${k}] = undefined;
69
69
  } else {
70
- newResult[${k}] = ${C}.value;
70
+ newResult[${k}] = ${u}.value;
71
71
  }
72
72
  }
73
73
 
74
- `);else V.write(`
75
- if (${C}.issues.length) {
76
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
74
+ `);else K.write(`
75
+ if (${u}.issues.length) {
76
+ payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
77
77
  ...iss,
78
78
  path: iss.path ? [${k}, ...iss.path] : [${k}]
79
79
  })));
80
80
  }
81
81
 
82
- if (${C}.value === undefined) {
82
+ if (${u}.value === undefined) {
83
83
  if (${k} in input) {
84
84
  newResult[${k}] = undefined;
85
85
  }
86
86
  } else {
87
- newResult[${k}] = ${C}.value;
87
+ newResult[${k}] = ${u}.value;
88
88
  }
89
89
 
90
- `)}V.write("payload.value = newResult;"),V.write("return payload;");let S=V.compile();return(R,C)=>S(B,R,C)},G,J=A6,Q=!Z6.jitless,W=Q&&wG.value,z=v.catchall,Y;$._zod.parse=(B,V)=>{Y??(Y=X.value);let L=B.value;if(!J(L))return B.issues.push({expected:"object",code:"invalid_type",input:L,inst:$}),B;if(Q&&W&&V?.async===!1&&V.jitless!==!0){if(!G)G=U(v.shape);if(B=G(B,V),!z)return B;return d7([],L,B,V,Y,$)}return D(B,V)}});function E7($,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,B$())))}),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)=>s1(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 I=Q._zod.run({value:X.value,issues:[]},U);if(I instanceof Promise)J.push(I),G=!0;else{if(I.issues.length===0)return I;J.push(I)}}if(!G)return E7(J,X,$,U);return Promise.all(J).then((Q)=>{return E7(Q,X,$,U)})}});function u7($,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,B$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:D,errors:[],inclusive:!1});return v}var YQ=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 I=Q._zod.run({value:X.value,issues:[]},U);if(I instanceof Promise)J.push(I),G=!0;else J.push(I)}if(!G)return u7(J,X,$,U);return Promise.all(J).then((Q)=>{return u7(Q,X,$,U)})}}),BQ=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,I]of Object.entries(J)){if(!U[Q])U[Q]=new Set;for(let W of I)U[Q].add(W)}}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 I of Q){if(G.has(I))throw Error(`Duplicate discriminator value "${String(I)}"`);G.set(I,J)}}return G});$._zod.parse=(U,G)=>{let J=U.value;if(!A6(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}}),VQ=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(([I,W])=>{return R7(D,I,W)});return R7(D,G,J)}});function bJ($,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=bJ($[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=bJ(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 R7($,v,D){let X=new Map,U;for(let Q of v.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let I of Q.keys){if(!X.has(I))X.set(I,{});X.get(I).l=!0}}else $.issues.push(Q);for(let Q of D.issues)if(Q.code==="unrecognized_keys")for(let I of Q.keys){if(!X.has(I))X.set(I,{});X.get(I).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=bJ(v.value,D.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}var ZU=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=g7(D,"optin"),I=g7(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 W=Array(D.length);for(let z=0;z<D.length;z++){let Y=D[z]._zod.run({value:G[z],issues:[]},U);if(Y instanceof Promise)J.push(Y.then((B)=>{W[z]=B}));else W[z]=Y}if(v.rest){let z=D.length-1,Y=G.slice(D.length);for(let B of Y){z++;let V=v.rest._zod.run({value:B,issues:[]},U);if(V instanceof Promise)J.push(V.then((L)=>C7(L,X,z)));else C7(V,X,z)}}if(J.length)return Promise.all(J).then(()=>x7(W,X,D,G,I));return x7(W,X,D,G,I)}});function g7($,v){for(let D=$.length-1;D>=0;D--)if($[D]._zod[v]!=="optional")return D+1;return 0}function C7($,v,D){if($.issues.length)v.issues.push(...y$(D,$.issues));v.value[D]=$.value}function x7($,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(...y$(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 LQ=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 W of J)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){Q.add(typeof W==="number"?W.toString():W);let z=v.keyType._zod.run({value:W,issues:[]},X);if(z instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(z.issues.length){D.issues.push({code:"invalid_key",origin:"record",issues:z.issues.map((V)=>C$(V,X,B$())),input:W,path:[W],inst:$});continue}let Y=z.value,B=v.valueType._zod.run({value:U[W],issues:[]},X);if(B instanceof Promise)G.push(B.then((V)=>{if(V.issues.length)D.issues.push(...y$(W,V.issues));D.value[Y]=V.value}));else{if(B.issues.length)D.issues.push(...y$(W,B.issues));D.value[Y]=B.value}}let I;for(let W in U)if(!Q.has(W))I=I??[],I.push(W);if(I&&I.length>0)D.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:I})}else{D.value={};for(let Q of Reflect.ownKeys(U)){if(Q==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(U,Q))continue;let I=v.keyType._zod.run({value:Q,issues:[]},X);if(I instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof Q==="string"&&Wv.test(Q)&&I.issues.length){let Y=v.keyType._zod.run({value:Number(Q),issues:[]},X);if(Y instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Y.issues.length===0)I=Y}if(I.issues.length){if(v.mode==="loose")D.value[Q]=U[Q];else D.issues.push({code:"invalid_key",origin:"record",issues:I.issues.map((Y)=>C$(Y,X,B$())),input:Q,path:[Q],inst:$});continue}let z=v.valueType._zod.run({value:U[Q],issues:[]},X);if(z instanceof Promise)G.push(z.then((Y)=>{if(Y.issues.length)D.issues.push(...y$(Q,Y.issues));D.value[I.value]=Y.value}));else{if(z.issues.length)D.issues.push(...y$(Q,z.issues));D.value[I.value]=z.value}}}if(G.length)return Promise.all(G).then(()=>D);return D}}),KQ=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 I=v.keyType._zod.run({value:J,issues:[]},X),W=v.valueType._zod.run({value:Q,issues:[]},X);if(I instanceof Promise||W instanceof Promise)G.push(Promise.all([I,W]).then(([z,Y])=>{i7(z,Y,D,J,U,$,X)}));else i7(I,W,D,J,U,$,X)}if(G.length)return Promise.all(G).then(()=>D);return D}});function i7($,v,D,X,U,G,J){if($.issues.length)if($v.has(typeof X))D.issues.push(...y$(X,$.issues));else D.issues.push({code:"invalid_key",origin:"map",input:U,inst:G,issues:$.issues.map((Q)=>C$(Q,J,B$()))});if(v.issues.length)if($v.has(typeof X))D.issues.push(...y$(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,B$()))});D.value.set($.value,v.value)}var NQ=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((I)=>f7(I,D)));else f7(Q,D)}if(G.length)return Promise.all(G).then(()=>D);return D}});function f7($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var ZQ=K("$ZodEnum",($,v)=>{f.init($,v);let D=e1(v.entries),X=new Set(D);$._zod.values=X,$._zod.pattern=new RegExp(`^(${D.filter((U)=>$v.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}}),OQ=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}}),AQ=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}}),HQ=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 w4;return D.value=U,D.fallback=!0,D}});function n7($,v){if(v===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}var OU=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(`^(${s1(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)=>n7(J,U));return n7(G,U)}if(D.value===void 0)return D;return v.innerType._zod.run(D,X)}}),FQ=K("$ZodExactOptional",($,v)=>{OU.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)}}),jQ=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(`^(${s1(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)}}),wQ=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)=>_7(G,v));return _7(U,v)}});function _7($,v){if($.value===void 0)$.value=v.defaultValue;return $}var MQ=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)}}),PQ=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)=>y7(G,$));return y7(U,$)}});function y7($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var bQ=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}}),qQ=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,B$()))},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,B$()))},input:D.value}),D.issues=[],D.fallback=!0;return D}}),SQ=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}}),AU=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)=>YU(J,v.in,X));return YU(G,v.in,X)}let U=v.in._zod.run(D,X);if(U instanceof Promise)return U.then((G)=>YU(G,v.out,X));return YU(U,v.out,X)}});function YU($,v,D){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},D)}var Lv=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)=>BU(J,v,X));return BU(G,v,X)}else{let G=v.out._zod.run(D,X);if(G instanceof Promise)return G.then((J)=>BU(J,v,X));return BU(G,v,X)}}});function BU($,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)=>VU($,G,v.out,D));return VU($,U,v.out,D)}else{let U=v.reverseTransform($.value,$);if(U instanceof Promise)return U.then((G)=>VU($,G,v.in,D));return VU($,U,v.in,D)}}function VU($,v,D,X){if($.issues.length)return $.aborted=!0,$;return D._zod.run({value:v,issues:$.issues},X)}var kQ=K("$ZodPreprocess",($,v)=>{AU.init($,v)}),TQ=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(l7);return l7(U)}});function l7($){return $.value=Object.freeze($.value),$}var EQ=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||PG.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}}),uQ=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?Jv($._def.input,X):X,G=Reflect.apply(D,this,U);if($._def.output)return Jv($._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 Qv($._def.input,X):X,G=await Reflect.apply(D,this,U);if($._def.output)return await Qv($._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 ZU({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})},$}),RQ=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))}}),gQ=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)}}),CQ=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)=>h7(G,D,X,$));h7(U,D,X,$);return}});function h7($,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(n6(U))}}var Av={};R4(Av,{zhTW:()=>k8,zhCN:()=>S8,yo:()=>T8,vi:()=>q8,uz:()=>b8,ur:()=>P8,uk:()=>Ov,ua:()=>M8,tr:()=>w8,th:()=>j8,ta:()=>F8,sv:()=>H8,sl:()=>A8,ru:()=>O8,ro:()=>Z8,pt:()=>N8,ps:()=>L8,pl:()=>K8,ota:()=>V8,no:()=>B8,nl:()=>Y8,ms:()=>z8,mk:()=>W8,lt:()=>I8,ko:()=>Q8,km:()=>Nv,kh:()=>J8,ka:()=>G8,ja:()=>X8,it:()=>D8,is:()=>U8,id:()=>v8,hy:()=>$8,hu:()=>sQ,hr:()=>eQ,he:()=>aQ,frCA:()=>oQ,fr:()=>tQ,fi:()=>pQ,fa:()=>dQ,es:()=>cQ,eo:()=>rQ,en:()=>Kv,el:()=>mQ,de:()=>hQ,da:()=>lQ,cs:()=>yQ,ca:()=>_Q,bg:()=>nQ,be:()=>fQ,az:()=>iQ,ar:()=>xQ});var XF=()=>{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=j(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`مدخلات غير مقبولة: يفترض إدخال ${F(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 xQ(){return{localeError:XF()}}var GF=()=>{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=j(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 ${F(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 iQ(){return{localeError:GF()}}function t7($,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 JF=()=>{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=j(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`Няправільны ўвод: чакалася ${F(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),I=t7(Q,J.unit.one,J.unit.few,J.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${J.verb} ${G}${U.maximum.toString()} ${I}`}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),I=t7(Q,J.unit.one,J.unit.few,J.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${J.verb} ${G}${U.minimum.toString()} ${I}`}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 fQ(){return{localeError:JF()}}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:"емоджи",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=j(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`Невалиден вход: очакван ${F(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 nQ(){return{localeError:QF()}}var IF=()=>{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=j(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 ${F(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 _Q(){return{localeError:IF()}}var WF=()=>{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=j(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 ${F(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 yQ(){return{localeError:WF()}}var zF=()=>{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=j(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 ${F(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 lQ(){return{localeError:zF()}}var YF=()=>{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=j(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 ${F(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 hQ(){return{localeError:YF()}}var BF=()=>{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=j(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`Μη έγκυρη είσοδος: αναμενόταν ${F(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 mQ(){return{localeError:BF()}}var VF=()=>{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=j(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 ${F(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 Kv(){return{localeError:VF()}}var LF=()=>{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=j(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 ${F(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 rQ(){return{localeError:LF()}}var KF=()=>{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=j(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 ${F(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 cQ(){return{localeError:KF()}}var NF=()=>{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=j(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`ورودی نامعتبر: می‌بایست ${F(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 dQ(){return{localeError:NF()}}var ZF=()=>{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=j(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 ${F(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 pQ(){return{localeError:ZF()}}var OF=()=>{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=j(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 : ${F(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 tQ(){return{localeError:OF()}}var AF=()=>{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=j(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 ${F(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 oQ(){return{localeError:AF()}}var HF=()=>{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=(W)=>W?$[W]:void 0,X=(W)=>{let z=D(W);if(z)return z.label;return W??$.unknown.label},U=(W)=>`ה${X(W)}`,G=(W)=>{return(D(W)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},J=(W)=>{if(!W)return null;return v[W]??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"}},I={nan:"NaN"};return(W)=>{switch(W.code){case"invalid_type":{let z=W.expected,Y=I[z??""]??X(z),B=j(W.input),V=I[B]??$[B]?.label??B;if(/^[A-Z]/.test(W.expected))return`קלט לא תקין: צריך להיות instanceof ${W.expected}, התקבל ${V}`;return`קלט לא תקין: צריך להיות ${Y}, התקבל ${V}`}case"invalid_value":{if(W.values.length===1)return`ערך לא תקין: הערך חייב להיות ${F(W.values[0])}`;let z=W.values.map((V)=>F(V));if(W.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${z[0]} או ${z[1]}`;let Y=z[z.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${z.slice(0,-1).join(", ")} או ${Y}`}case"too_big":{let z=J(W.origin),Y=U(W.origin??"value");if(W.origin==="string")return`${z?.longLabel??"ארוך"} מדי: ${Y} צריכה להכיל ${W.maximum.toString()} ${z?.unit??""} ${W.inclusive?"או פחות":"לכל היותר"}`.trim();if(W.origin==="number"){let L=W.inclusive?`קטן או שווה ל-${W.maximum}`:`קטן מ-${W.maximum}`;return`גדול מדי: ${Y} צריך להיות ${L}`}if(W.origin==="array"||W.origin==="set"){let L=W.origin==="set"?"צריכה":"צריך",N=W.inclusive?`${W.maximum} ${z?.unit??""} או פחות`:`פחות מ-${W.maximum} ${z?.unit??""}`;return`גדול מדי: ${Y} ${L} להכיל ${N}`.trim()}let B=W.inclusive?"<=":"<",V=G(W.origin??"value");if(z?.unit)return`${z.longLabel} מדי: ${Y} ${V} ${B}${W.maximum.toString()} ${z.unit}`;return`${z?.longLabel??"גדול"} מדי: ${Y} ${V} ${B}${W.maximum.toString()}`}case"too_small":{let z=J(W.origin),Y=U(W.origin??"value");if(W.origin==="string")return`${z?.shortLabel??"קצר"} מדי: ${Y} צריכה להכיל ${W.minimum.toString()} ${z?.unit??""} ${W.inclusive?"או יותר":"לפחות"}`.trim();if(W.origin==="number"){let L=W.inclusive?`גדול או שווה ל-${W.minimum}`:`גדול מ-${W.minimum}`;return`קטן מדי: ${Y} צריך להיות ${L}`}if(W.origin==="array"||W.origin==="set"){let L=W.origin==="set"?"צריכה":"צריך";if(W.minimum===1&&W.inclusive){let Z=W.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Y} ${L} להכיל ${Z}`}let N=W.inclusive?`${W.minimum} ${z?.unit??""} או יותר`:`יותר מ-${W.minimum} ${z?.unit??""}`;return`קטן מדי: ${Y} ${L} להכיל ${N}`.trim()}let B=W.inclusive?">=":">",V=G(W.origin??"value");if(z?.unit)return`${z.shortLabel} מדי: ${Y} ${V} ${B}${W.minimum.toString()} ${z.unit}`;return`${z?.shortLabel??"קטן"} מדי: ${Y} ${V} ${B}${W.minimum.toString()}`}case"invalid_format":{let z=W;if(z.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${z.prefix}"`;if(z.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${z.suffix}"`;if(z.format==="includes")return`המחרוזת חייבת לכלול "${z.includes}"`;if(z.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${z.pattern}`;let Y=Q[z.format],B=Y?.label??z.format,L=(Y?.gender??"m")==="f"?"תקינה":"תקין";return`${B} לא ${L}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${W.divisor}`;case"unrecognized_keys":return`מפתח${W.keys.length>1?"ות":""} לא מזוה${W.keys.length>1?"ים":"ה"}: ${O(W.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(W.origin??"array")}`;default:return"קלט לא תקין"}}};function aQ(){return{localeError:HF()}}var FF=()=>{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=j(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 ${F(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 eQ(){return{localeError:FF()}}var jF=()=>{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=j(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 ${F(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 sQ(){return{localeError:jF()}}function o7($,v,D){return Math.abs($)===1?v:D}function c6($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],D=$[$.length-1];return $+(v.includes(D)?"ն":"ը")}var wF=()=>{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=j(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`Սխալ մուտքագրում․ սպասվում էր ${F(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),I=o7(Q,J.unit.one,J.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${c6(U.origin??"արժեք")} կունենա ${G}${U.maximum.toString()} ${I}`}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),I=o7(Q,J.unit.one,J.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${c6(U.origin)} կունենա ${G}${U.minimum.toString()} ${I}`}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 $8(){return{localeError:wF()}}var MF=()=>{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=j(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 ${F(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 v8(){return{localeError:MF()}}var PF=()=>{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=j(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 ${F(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 U8(){return{localeError:PF()}}var bF=()=>{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=j(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 ${F(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 D8(){return{localeError:bF()}}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:"絵文字",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=j(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`無効な入力: ${F(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 X8(){return{localeError:qF()}}var SF=()=>{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=j(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`არასწორი შეყვანა: მოსალოდნელი ${F(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 G8(){return{localeError:SF()}}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:"សញ្ញាអារម្មណ៍",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=j(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`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${F(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 Nv(){return{localeError:kF()}}function J8(){return Nv()}var TF=()=>{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=j(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`잘못된 입력: 값은 ${F(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${O(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let G=U.inclusive?"이하":"미만",J=G==="미만"?"이어야 합니다":"여야 합니다",Q=v(U.origin),I=Q?.unit??"요소";if(Q)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${I} ${G}${J}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${G}${J}`}case"too_small":{let G=U.inclusive?"이상":"초과",J=G==="이상"?"이어야 합니다":"여야 합니다",Q=v(U.origin),I=Q?.unit??"요소";if(Q)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${I} ${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 Q8(){return{localeError:TF()}}var Zv=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function a7($){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 EF=()=>{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 I=$[U]??null;if(I===null)return I;return{unit:I.unit[G],verb:I.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=j(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 ${F(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,a7(Number(U.maximum)),U.inclusive??!1,"smaller");if(J?.verb)return`${Zv(G??U.origin??"reikšmė")} ${J.verb} ${U.maximum.toString()} ${J.unit??"elementų"}`;let Q=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Zv(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,a7(Number(U.minimum)),U.inclusive??!1,"bigger");if(J?.verb)return`${Zv(G??U.origin??"reikšmė")} ${J.verb} ${U.minimum.toString()} ${J.unit??"elementų"}`;let Q=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Zv(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`${Zv(G??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function I8(){return{localeError:EF()}}var uF=()=>{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=j(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 ${F(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 W8(){return{localeError:uF()}}var RF=()=>{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=j(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 ${F(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 z8(){return{localeError:RF()}}var gF=()=>{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=j(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 ${F(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 Y8(){return{localeError:gF()}}var CF=()=>{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=j(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 ${F(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 B8(){return{localeError:CF()}}var xF=()=>{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=j(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 ${F(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 V8(){return{localeError:xF()}}var iF=()=>{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=j(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`ناسم ورودي: باید ${F(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 L8(){return{localeError:iF()}}var fF=()=>{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=j(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 ${F(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 K8(){return{localeError:fF()}}var nF=()=>{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=j(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 ${F(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 N8(){return{localeError:nF()}}var _F=()=>{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=j(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 ${F(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 Z8(){return{localeError:_F()}}function e7($,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 yF=()=>{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=j(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`Неверный ввод: ожидалось ${F(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),I=e7(Q,J.unit.one,J.unit.few,J.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${G}${U.maximum.toString()} ${I}`}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),I=e7(Q,J.unit.one,J.unit.few,J.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${G}${U.minimum.toString()} ${I}`}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 O8(){return{localeError:yF()}}var lF=()=>{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=j(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 ${F(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 A8(){return{localeError:lF()}}var hF=()=>{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=j(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 ${F(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 H8(){return{localeError:hF()}}var mF=()=>{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=j(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`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${F(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 F8(){return{localeError:mF()}}var rF=()=>{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=j(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`ค่าไม่ถูกต้อง: ควรเป็น ${F(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 j8(){return{localeError:rF()}}var cF=()=>{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=j(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 ${F(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 w8(){return{localeError:cF()}}var dF=()=>{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=j(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`Неправильні вхідні дані: очікується ${F(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 Ov(){return{localeError:dF()}}function M8(){return Ov()}var pF=()=>{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=j(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`غلط ان پٹ: ${F(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 P8(){return{localeError:pF()}}var tF=()=>{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=j(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 ${F(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 b8(){return{localeError:tF()}}var oF=()=>{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=j(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 ${F(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 q8(){return{localeError:oF()}}var aF=()=>{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=j(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`无效输入:期望 ${F(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 S8(){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:"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=j(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`無效的輸入值:預期為 ${F(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 k8(){return{localeError:eF()}}var sF=()=>{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=j(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 ${F(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 T8(){return{localeError:sF()}}var s7,E8=Symbol("ZodOutput"),u8=Symbol("ZodInput");class R8{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 HU(){return new R8}(s7=globalThis).__zod_globalRegistry??(s7.__zod_globalRegistry=HU());var j$=globalThis.__zod_globalRegistry;function g8($,v){return new $({type:"string",...M(v)})}function C8($,v){return new $({type:"string",coerce:!0,...M(v)})}function FU($,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 jU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...M(v)})}function wU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...M(v)})}function MU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...M(v)})}function PU($,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 bU($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...M(v)})}function qU($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...M(v)})}function SU($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...M(v)})}function kU($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...M(v)})}function TU($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...M(v)})}function EU($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...M(v)})}function uU($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...M(v)})}function RU($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...M(v)})}function gU($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...M(v)})}function x8($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...M(v)})}function CU($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...M(v)})}function xU($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...M(v)})}function iU($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...M(v)})}function fU($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...M(v)})}function nU($,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 i8={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function f8($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...M(v)})}function n8($,v){return new $({type:"string",format:"date",check:"string_format",...M(v)})}function _8($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...M(v)})}function y8($,v){return new $({type:"string",format:"duration",check:"string_format",...M(v)})}function l8($,v){return new $({type:"number",checks:[],...M(v)})}function h8($,v){return new $({type:"number",coerce:!0,checks:[],...M(v)})}function m8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...M(v)})}function r8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...M(v)})}function c8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...M(v)})}function d8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...M(v)})}function p8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...M(v)})}function t8($,v){return new $({type:"boolean",...M(v)})}function o8($,v){return new $({type:"boolean",coerce:!0,...M(v)})}function a8($,v){return new $({type:"bigint",...M(v)})}function e8($,v){return new $({type:"bigint",coerce:!0,...M(v)})}function s8($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...M(v)})}function $I($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...M(v)})}function vI($,v){return new $({type:"symbol",...M(v)})}function UI($,v){return new $({type:"undefined",...M(v)})}function DI($,v){return new $({type:"null",...M(v)})}function XI($){return new $({type:"any"})}function GI($){return new $({type:"unknown"})}function JI($,v){return new $({type:"never",...M(v)})}function QI($,v){return new $({type:"void",...M(v)})}function II($,v){return new $({type:"date",...M(v)})}function WI($,v){return new $({type:"date",coerce:!0,...M(v)})}function zI($,v){return new $({type:"nan",...M(v)})}function M4($,v){return new IU({check:"less_than",...M(v),value:$,inclusive:!1})}function e$($,v){return new IU({check:"less_than",...M(v),value:$,inclusive:!0})}function P4($,v){return new WU({check:"greater_than",...M(v),value:$,inclusive:!1})}function x$($,v){return new WU({check:"greater_than",...M(v),value:$,inclusive:!0})}function yU($){return P4(0,$)}function lU($){return M4(0,$)}function hU($){return e$(0,$)}function mU($){return x$(0,$)}function s4($,v){return new QJ({check:"multiple_of",...M(v),value:$})}function $6($,v){return new zJ({check:"max_size",...M(v),maximum:$})}function b4($,v){return new YJ({check:"min_size",...M(v),minimum:$})}function j6($,v){return new BJ({check:"size_equals",...M(v),size:$})}function w6($,v){return new VJ({check:"max_length",...M(v),maximum:$})}function f4($,v){return new LJ({check:"min_length",...M(v),minimum:$})}function M6($,v){return new KJ({check:"length_equals",...M(v),length:$})}function d6($,v){return new NJ({check:"string_format",format:"regex",...M(v),pattern:$})}function p6($){return new ZJ({check:"string_format",format:"lowercase",...M($)})}function t6($){return new OJ({check:"string_format",format:"uppercase",...M($)})}function o6($,v){return new AJ({check:"string_format",format:"includes",...M(v),includes:$})}function a6($,v){return new HJ({check:"string_format",format:"starts_with",...M(v),prefix:$})}function e6($,v){return new FJ({check:"string_format",format:"ends_with",...M(v),suffix:$})}function rU($,v,D){return new jJ({check:"property",property:$,schema:v,...M(D)})}function s6($,v){return new wJ({check:"mime_type",mime:$,...M(v)})}function z4($){return new MJ({check:"overwrite",tx:$})}function $1($){return z4((v)=>v.normalize($))}function v1(){return z4(($)=>$.trim())}function U1(){return z4(($)=>$.toLowerCase())}function D1(){return z4(($)=>$.toUpperCase())}function X1(){return z4(($)=>jG($))}function YI($,v,D){return new $({type:"array",element:v,...M(D)})}function vj($,v,D){return new $({type:"union",options:v,...M(D)})}function Uj($,v,D){return new $({type:"union",options:v,inclusive:!1,...M(D)})}function Dj($,v,D,X){return new $({type:"union",options:D,discriminator:v,...M(X)})}function Xj($,v,D){return new $({type:"intersection",left:v,right:D})}function Gj($,v,D,X){let U=D instanceof f;return new $({type:"tuple",items:v,rest:U?D:null,...M(U?X:D)})}function Jj($,v,D,X){return new $({type:"record",keyType:v,valueType:D,...M(X)})}function Qj($,v,D,X){return new $({type:"map",keyType:v,valueType:D,...M(X)})}function Ij($,v,D){return new $({type:"set",valueType:v,...M(D)})}function Wj($,v,D){let X=Array.isArray(v)?Object.fromEntries(v.map((U)=>[U,U])):v;return new $({type:"enum",entries:X,...M(D)})}function zj($,v,D){return new $({type:"enum",entries:v,...M(D)})}function Yj($,v,D){return new $({type:"literal",values:Array.isArray(v)?v:[v],...M(D)})}function BI($,v){return new $({type:"file",...M(v)})}function Bj($,v){return new $({type:"transform",transform:v})}function Vj($,v){return new $({type:"optional",innerType:v})}function Lj($,v){return new $({type:"nullable",innerType:v})}function Kj($,v,D){return new $({type:"default",innerType:v,get defaultValue(){return typeof D==="function"?D():MG(D)}})}function Nj($,v,D){return new $({type:"nonoptional",innerType:v,...M(D)})}function Zj($,v){return new $({type:"success",innerType:v})}function Oj($,v,D){return new $({type:"catch",innerType:v,catchValue:typeof D==="function"?D:()=>D})}function Aj($,v,D){return new $({type:"pipe",in:v,out:D})}function Hj($,v){return new $({type:"readonly",innerType:v})}function Fj($,v,D){return new $({type:"template_literal",parts:v,...M(D)})}function jj($,v){return new $({type:"lazy",getter:v})}function wj($,v){return new $({type:"promise",innerType:v})}function VI($,v,D){let X=M(D);return X.abort??(X.abort=!0),new $({type:"custom",check:"custom",fn:v,...X})}function LI($,v,D){return new $({type:"custom",check:"custom",fn:v,...M(D)})}function KI($,v){let D=$Y((X)=>{return X.addIssue=(U)=>{if(typeof U==="string")X.issues.push(n6(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(n6(G))}},$(X.value,X)},v);return D}function $Y($,v){let D=new G$({check:"custom",...M(v)});return D._zod.check=$,D}function NI($){let v=new G$({check:"describe"});return v._zod.onattach=[(D)=>{let X=j$.get(D)??{};j$.add(D,{...X,description:$})}],v._zod.check=()=>{},v}function ZI($){let v=new G$({check:"meta"});return v._zod.onattach=[(D)=>{let X=j$.get(D)??{};j$.add(D,{...X,...$})}],v._zod.check=()=>{},v}function OI($,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((V)=>typeof V==="string"?V.toLowerCase():V),U=U.map((V)=>typeof V==="string"?V.toLowerCase():V);let G=new Set(X),J=new Set(U),Q=$.Codec??Lv,I=$.Boolean??Bv,z=new($.String??F6)({type:"string",error:D.error}),Y=new I({type:"boolean",error:D.error}),B=new Q({type:"pipe",in:z,out:Y,transform:(V,L)=>{let N=V;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:B,continue:!1}),{}},reverseTransform:(V,L)=>{if(V===!0)return X[0]||"true";else return U[0]||"false"},error:D.error});return B}function G1($,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??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 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 z={...D,schemaPath:[...D.schemaPath,$],path:D.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,J.schema,z);else{let B=J.schema,V=v.processors[U.type];if(!V)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);V($,v,B,z)}let Y=$._zod.parent;if(Y){if(!J.ref)J.ref=Y;e(Y,v,z),v.seen.get(Y).isParent=!0}}let I=v.metadataRegistry.get($);if(I)Object.assign(J.schema,I);if(v.io==="input"&&i$($))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 I=X.get(Q);if(I&&I!==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 Y=$.external.registry.get(J[0])?.id,B=$.external.uri??((L)=>L);if(Y)return{ref:B(Y)};let V=J[1].defId??J[1].schema.id??`schema${$.counter++}`;return J[1].defId=V,{defId:V,ref:`${B("__shared")}#/${Q}/${V}`}}if(J[1]===D)return{ref:"#"};let W=`${"#"}/${Q}/`,z=J[1].schema.id??`__schema${$.counter++}`;return{defId:z,ref:W+z}},G=(J)=>{if(J[1].schema.$ref)return;let Q=J[1],{ref:I,defId:W}=U(J);if(Q.def={...Q.schema},W)Q.defId=W;let z=Q.schema;for(let Y in z)delete z[Y];z.$ref=I};if($.cycles==="throw")for(let J of $.seen.entries()){let Q=J[1];if(Q.cycle)throw Error(`Cycle detected: #/${Q.cycle?.join("/")}/<root>
90
+ `)}K.write("payload.value = newResult;"),K.write("return payload;");let S=K.compile();return(g,u)=>S(V,g,u)},G,J=F6,Q=!O6.jitless,z=Q&&PG.value,Y=v.catchall,I;$._zod.parse=(V,K)=>{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&&K?.async===!1&&K.jitless!==!0){if(!G)G=U(v.shape);if(V=G(V,K),!Y)return V;return oY([],L,V,K,I,$)}return D(V,K)}});function CY($,v,D,X){for(let G of $)if(G.issues.length===0)return v.value=G.value,v;let U=$.filter((G)=>!s4(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)=>u$(J,X,V$())))}),v}var Lv=B("$ZodUnion",($,v)=>{_.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)=>$v(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 CY(J,X,$,U);return Promise.all(J).then((Q)=>{return CY(Q,X,$,U)})}});function uY($,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)=>u$(J,X,V$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:D,errors:[],inclusive:!1});return v}var KQ=B("$ZodXor",($,v)=>{Lv.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 uY(J,X,$,U);return Promise.all(J).then((Q)=>{return uY(Q,X,$,U)})}}),LQ=B("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,Lv.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=i6(()=>{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(!F6(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}}),BQ=B("$ZodIntersection",($,v)=>{_.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 xY(D,W,z)});return xY(D,G,J)}});function SJ($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(e4($)&&e4(v)){let D=Object.keys(v),X=Object.keys($).filter((G)=>D.indexOf(G)!==-1),U={...$,...v};for(let G of X){let J=SJ($[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=SJ(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 xY($,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(s4($))return $;let J=SJ(v.value,D.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}var OU=B("$ZodTuple",($,v)=>{_.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=fY(D,"optin"),W=fY(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 K=v.rest._zod.run({value:V,issues:[]},U);if(K instanceof Promise)J.push(K.then((L)=>_Y(L,X,Y)));else _Y(K,X,Y)}}if(J.length)return Promise.all(J).then(()=>iY(z,X,D,G,W));return iY(z,X,D,G,W)}});function fY($,v){for(let D=$.length-1;D>=0;D--)if($[D]._zod[v]!=="optional")return D+1;return 0}function _Y($,v,D){if($.issues.length)v.issues.push(...n$(D,$.issues));v.value[D]=$.value}function iY($,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 NQ=B("$ZodRecord",($,v)=>{_.init($,v),$._zod.parse=(D,X)=>{let U=D.value;if(!e4(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((K)=>u$(K,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((K)=>{if(K.issues.length)D.issues.push(...n$(z,K.issues));D.value[I]=K.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"&&Yv.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)=>u$(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}}),ZQ=B("$ZodMap",($,v)=>{_.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])=>{yY(Y,I,D,J,U,$,X)}));else yY(W,z,D,J,U,$,X)}if(G.length)return Promise.all(G).then(()=>D);return D}});function yY($,v,D,X,U,G,J){if($.issues.length)if(vv.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)=>u$(Q,J,V$()))});if(v.issues.length)if(vv.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)=>u$(Q,J,V$()))});D.value.set($.value,v.value)}var OQ=B("$ZodSet",($,v)=>{_.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)=>nY(W,D)));else nY(Q,D)}if(G.length)return Promise.all(G).then(()=>D);return D}});function nY($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var HQ=B("$ZodEnum",($,v)=>{_.init($,v);let D=s1(v.entries),X=new Set(D);$._zod.values=X,$._zod.pattern=new RegExp(`^(${D.filter((U)=>vv.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}}),FQ=B("$ZodLiteral",($,v)=>{if(_.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}}),jQ=B("$ZodFile",($,v)=>{_.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}}),AQ=B("$ZodTransform",($,v)=>{_.init($,v),$._zod.optin="optional",$._zod.parse=(D,X)=>{if(X.direction==="backward")throw new H6($.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 M4;return D.value=U,D.fallback=!0,D}});function lY($,v){if(v===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}var HU=B("$ZodOptional",($,v)=>{_.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(`^(${$v(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)=>lY(J,U));return lY(G,U)}if(D.value===void 0)return D;return v.innerType._zod.run(D,X)}}),wQ=B("$ZodExactOptional",($,v)=>{HU.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)}}),MQ=B("$ZodNullable",($,v)=>{_.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(`^(${$v(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)}}),PQ=B("$ZodDefault",($,v)=>{_.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)=>hY(G,v));return hY(U,v)}});function hY($,v){if($.value===void 0)$.value=v.defaultValue;return $}var bQ=B("$ZodPrefault",($,v)=>{_.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)}}),qQ=B("$ZodNonOptional",($,v)=>{_.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)=>mY(G,$));return mY(U,$)}});function mY($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var SQ=B("$ZodSuccess",($,v)=>{_.init($,v),$._zod.parse=(D,X)=>{if(X.direction==="backward")throw new H6("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}}),kQ=B("$ZodCatch",($,v)=>{_.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)=>u$(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)=>u$(G,X,V$()))},input:D.value}),D.issues=[],D.fallback=!0;return D}}),EQ=B("$ZodNaN",($,v)=>{_.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}}),FU=B("$ZodPipe",($,v)=>{_.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)=>VU(J,v.in,X));return VU(G,v.in,X)}let U=v.in._zod.run(D,X);if(U instanceof Promise)return U.then((G)=>VU(G,v.out,X));return VU(U,v.out,X)}});function VU($,v,D){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},D)}var Bv=B("$ZodCodec",($,v)=>{_.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)=>KU(J,v,X));return KU(G,v,X)}else{let G=v.out._zod.run(D,X);if(G instanceof Promise)return G.then((J)=>KU(J,v,X));return KU(G,v,X)}}});function KU($,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)=>LU($,G,v.out,D));return LU($,U,v.out,D)}else{let U=v.reverseTransform($.value,$);if(U instanceof Promise)return U.then((G)=>LU($,G,v.in,D));return LU($,U,v.in,D)}}function LU($,v,D,X){if($.issues.length)return $.aborted=!0,$;return D._zod.run({value:v,issues:$.issues},X)}var TQ=B("$ZodPreprocess",($,v)=>{FU.init($,v)}),RQ=B("$ZodReadonly",($,v)=>{_.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(cY);return cY(U)}});function cY($){return $.value=Object.freeze($.value),$}var gQ=B("$ZodTemplateLiteral",($,v)=>{_.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||qG.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}}),CQ=B("$ZodFunction",($,v)=>{return _.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?Qv($._def.input,X):X,G=Reflect.apply(D,this,U);if($._def.output)return Qv($._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 Wv($._def.input,X):X,G=await Reflect.apply(D,this,U);if($._def.output)return await Wv($._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 OU({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})},$}),uQ=B("$ZodPromise",($,v)=>{_.init($,v),$._zod.parse=(D,X)=>{return Promise.resolve(D.value).then((U)=>v.innerType._zod.run({value:U,issues:[]},X))}}),xQ=B("$ZodLazy",($,v)=>{_.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)}}),fQ=B("$ZodCustom",($,v)=>{G$.init($,v),_.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)=>rY(G,D,X,$));rY(U,D,X,$);return}});function rY($,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(y6(U))}}var Fv={};C4(Fv,{zhTW:()=>T8,zhCN:()=>E8,yo:()=>R8,vi:()=>k8,uz:()=>S8,ur:()=>q8,uk:()=>Hv,ua:()=>b8,tr:()=>P8,th:()=>M8,ta:()=>w8,sv:()=>A8,sl:()=>j8,ru:()=>F8,ro:()=>H8,pt:()=>O8,ps:()=>N8,pl:()=>Z8,ota:()=>B8,no:()=>L8,nl:()=>K8,ms:()=>V8,mk:()=>I8,lt:()=>Y8,ko:()=>z8,km:()=>Zv,kh:()=>W8,ka:()=>Q8,ja:()=>J8,it:()=>G8,is:()=>X8,id:()=>D8,hy:()=>U8,hu:()=>v8,hr:()=>$8,he:()=>sQ,frCA:()=>eQ,fr:()=>aQ,fi:()=>oQ,fa:()=>tQ,es:()=>pQ,eo:()=>dQ,en:()=>Nv,el:()=>rQ,de:()=>cQ,da:()=>mQ,cs:()=>hQ,ca:()=>lQ,bg:()=>nQ,be:()=>yQ,az:()=>iQ,ar:()=>_Q});var Wj=()=>{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 _Q(){return{localeError:Wj()}}var zj=()=>{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 iQ(){return{localeError:zj()}}function eY($,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 Yj=()=>{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=eY(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=eY(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 yQ(){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:"масив"};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 nQ(){return{localeError:Ij()}}var Vj=()=>{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 lQ(){return{localeError:Vj()}}var Kj=()=>{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 hQ(){return{localeError:Kj()}}var Lj=()=>{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 mQ(){return{localeError:Lj()}}var Bj=()=>{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 cQ(){return{localeError:Bj()}}var Nj=()=>{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 rQ(){return{localeError:Nj()}}var Zj=()=>{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 Nv(){return{localeError:Zj()}}var Oj=()=>{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 dQ(){return{localeError:Oj()}}var Hj=()=>{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 pQ(){return{localeError:Hj()}}var Fj=()=>{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 tQ(){return{localeError:Fj()}}var jj=()=>{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 oQ(){return{localeError:jj()}}var Aj=()=>{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 aQ(){return{localeError:Aj()}}var wj=()=>{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 eQ(){return{localeError:wj()}}var Mj=()=>{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),K=W[V]??$[V]?.label??V;if(/^[A-Z]/.test(z.expected))return`קלט לא תקין: צריך להיות instanceof ${z.expected}, התקבל ${K}`;return`קלט לא תקין: צריך להיות ${I}, התקבל ${K}`}case"invalid_value":{if(z.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(z.values[0])}`;let Y=z.values.map((K)=>j(K));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?"<=":"<",K=G(z.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${I} ${K} ${V}${z.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${I} ${K} ${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?">=":">",K=G(z.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${I} ${K} ${V}${z.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${I} ${K} ${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 sQ(){return{localeError:Mj()}}var Pj=()=>{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 $8(){return{localeError:Pj()}}var bj=()=>{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 v8(){return{localeError:bj()}}function sY($,v,D){return Math.abs($)===1?v:D}function d6($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],D=$[$.length-1];return $+(v.includes(D)?"ն":"ը")}var qj=()=>{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=sY(Q,J.unit.one,J.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${d6(U.origin??"արժեք")} կունենա ${G}${U.maximum.toString()} ${W}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${d6(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=sY(Q,J.unit.one,J.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${d6(U.origin)} կունենա ${G}${U.minimum.toString()} ${W}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${d6(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`Սխալ բանալի ${d6(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${d6(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function U8(){return{localeError:qj()}}var Sj=()=>{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 D8(){return{localeError:Sj()}}var kj=()=>{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 X8(){return{localeError:kj()}}var Ej=()=>{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 G8(){return{localeError:Ej()}}var Tj=()=>{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 J8(){return{localeError:Tj()}}var Rj=()=>{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 Q8(){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:"អារេ (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 Zv(){return{localeError:gj()}}function W8(){return Zv()}var Cj=()=>{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 z8(){return{localeError:Cj()}}var Ov=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function $I($){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 uj=()=>{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,$I(Number(U.maximum)),U.inclusive??!1,"smaller");if(J?.verb)return`${Ov(G??U.origin??"reikšmė")} ${J.verb} ${U.maximum.toString()} ${J.unit??"elementų"}`;let Q=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Ov(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,$I(Number(U.minimum)),U.inclusive??!1,"bigger");if(J?.verb)return`${Ov(G??U.origin??"reikšmė")} ${J.verb} ${U.minimum.toString()} ${J.unit??"elementų"}`;let Q=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Ov(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`${Ov(G??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Y8(){return{localeError:uj()}}var xj=()=>{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 I8(){return{localeError:xj()}}var fj=()=>{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 V8(){return{localeError:fj()}}var _j=()=>{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 K8(){return{localeError:_j()}}var ij=()=>{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 L8(){return{localeError:ij()}}var yj=()=>{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 B8(){return{localeError:yj()}}var nj=()=>{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 N8(){return{localeError:nj()}}var lj=()=>{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 Z8(){return{localeError:lj()}}var hj=()=>{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 O8(){return{localeError:hj()}}var mj=()=>{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 H8(){return{localeError:mj()}}function vI($,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 cj=()=>{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=vI(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=vI(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 F8(){return{localeError:cj()}}var rj=()=>{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 j8(){return{localeError:rj()}}var dj=()=>{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 A8(){return{localeError:dj()}}var pj=()=>{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 w8(){return{localeError:pj()}}var tj=()=>{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 M8(){return{localeError:tj()}}var oj=()=>{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 P8(){return{localeError:oj()}}var aj=()=>{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 Hv(){return{localeError:aj()}}function b8(){return Hv()}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 q8(){return{localeError:ej()}}var sj=()=>{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 S8(){return{localeError:sj()}}var $A=()=>{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 k8(){return{localeError:$A()}}var vA=()=>{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 E8(){return{localeError:vA()}}var UA=()=>{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 T8(){return{localeError:UA()}}var DA=()=>{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 R8(){return{localeError:DA()}}var UI,g8=Symbol("ZodOutput"),C8=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 X={...D,...this._map.get($)};return Object.keys(X).length?X:void 0}return this._map.get($)}has($){return this._map.has($)}}function jU(){return new u8}(UI=globalThis).__zod_globalRegistry??(UI.__zod_globalRegistry=jU());var A$=globalThis.__zod_globalRegistry;function x8($,v){return new $({type:"string",...M(v)})}function f8($,v){return new $({type:"string",coerce:!0,...M(v)})}function AU($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...M(v)})}function jv($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...M(v)})}function wU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...M(v)})}function MU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...M(v)})}function PU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...M(v)})}function bU($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...M(v)})}function Av($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...M(v)})}function qU($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...M(v)})}function SU($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...M(v)})}function kU($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...M(v)})}function EU($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...M(v)})}function TU($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...M(v)})}function RU($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...M(v)})}function gU($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...M(v)})}function CU($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...M(v)})}function uU($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...M(v)})}function _8($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...M(v)})}function xU($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...M(v)})}function fU($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...M(v)})}function _U($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...M(v)})}function iU($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...M(v)})}function yU($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...M(v)})}function nU($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...M(v)})}var i8={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function y8($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...M(v)})}function n8($,v){return new $({type:"string",format:"date",check:"string_format",...M(v)})}function l8($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...M(v)})}function h8($,v){return new $({type:"string",format:"duration",check:"string_format",...M(v)})}function m8($,v){return new $({type:"number",checks:[],...M(v)})}function c8($,v){return new $({type:"number",coerce:!0,checks:[],...M(v)})}function r8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...M(v)})}function d8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...M(v)})}function p8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...M(v)})}function t8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...M(v)})}function o8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...M(v)})}function a8($,v){return new $({type:"boolean",...M(v)})}function e8($,v){return new $({type:"boolean",coerce:!0,...M(v)})}function s8($,v){return new $({type:"bigint",...M(v)})}function $9($,v){return new $({type:"bigint",coerce:!0,...M(v)})}function v9($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...M(v)})}function U9($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...M(v)})}function D9($,v){return new $({type:"symbol",...M(v)})}function X9($,v){return new $({type:"undefined",...M(v)})}function G9($,v){return new $({type:"null",...M(v)})}function J9($){return new $({type:"any"})}function Q9($){return new $({type:"unknown"})}function W9($,v){return new $({type:"never",...M(v)})}function z9($,v){return new $({type:"void",...M(v)})}function Y9($,v){return new $({type:"date",...M(v)})}function I9($,v){return new $({type:"date",coerce:!0,...M(v)})}function V9($,v){return new $({type:"nan",...M(v)})}function P4($,v){return new zU({check:"less_than",...M(v),value:$,inclusive:!1})}function e$($,v){return new zU({check:"less_than",...M(v),value:$,inclusive:!0})}function b4($,v){return new YU({check:"greater_than",...M(v),value:$,inclusive:!1})}function x$($,v){return new YU({check:"greater_than",...M(v),value:$,inclusive:!0})}function lU($){return b4(0,$)}function hU($){return P4(0,$)}function mU($){return e$(0,$)}function cU($){return x$(0,$)}function $6($,v){return new zJ({check:"multiple_of",...M(v),value:$})}function v6($,v){return new VJ({check:"max_size",...M(v),maximum:$})}function q4($,v){return new KJ({check:"min_size",...M(v),minimum:$})}function w6($,v){return new LJ({check:"size_equals",...M(v),size:$})}function M6($,v){return new BJ({check:"max_length",...M(v),maximum:$})}function i4($,v){return new NJ({check:"min_length",...M(v),minimum:$})}function P6($,v){return new ZJ({check:"length_equals",...M(v),length:$})}function p6($,v){return new OJ({check:"string_format",format:"regex",...M(v),pattern:$})}function t6($){return new HJ({check:"string_format",format:"lowercase",...M($)})}function o6($){return new FJ({check:"string_format",format:"uppercase",...M($)})}function a6($,v){return new jJ({check:"string_format",format:"includes",...M(v),includes:$})}function e6($,v){return new AJ({check:"string_format",format:"starts_with",...M(v),prefix:$})}function s6($,v){return new wJ({check:"string_format",format:"ends_with",...M(v),suffix:$})}function rU($,v,D){return new MJ({check:"property",property:$,schema:v,...M(D)})}function $1($,v){return new PJ({check:"mime_type",mime:$,...M(v)})}function I4($){return new bJ({check:"overwrite",tx:$})}function v1($){return I4((v)=>v.normalize($))}function U1(){return I4(($)=>$.trim())}function D1(){return I4(($)=>$.toLowerCase())}function X1(){return I4(($)=>$.toUpperCase())}function G1(){return I4(($)=>MG($))}function K9($,v,D){return new $({type:"array",element:v,...M(D)})}function GA($,v,D){return new $({type:"union",options:v,...M(D)})}function JA($,v,D){return new $({type:"union",options:v,inclusive:!1,...M(D)})}function QA($,v,D,X){return new $({type:"union",options:D,discriminator:v,...M(X)})}function WA($,v,D){return new $({type:"intersection",left:v,right:D})}function zA($,v,D,X){let U=D instanceof _;return new $({type:"tuple",items:v,rest:U?D:null,...M(U?X:D)})}function YA($,v,D,X){return new $({type:"record",keyType:v,valueType:D,...M(X)})}function IA($,v,D,X){return new $({type:"map",keyType:v,valueType:D,...M(X)})}function VA($,v,D){return new $({type:"set",valueType:v,...M(D)})}function KA($,v,D){let X=Array.isArray(v)?Object.fromEntries(v.map((U)=>[U,U])):v;return new $({type:"enum",entries:X,...M(D)})}function LA($,v,D){return new $({type:"enum",entries:v,...M(D)})}function BA($,v,D){return new $({type:"literal",values:Array.isArray(v)?v:[v],...M(D)})}function L9($,v){return new $({type:"file",...M(v)})}function NA($,v){return new $({type:"transform",transform:v})}function ZA($,v){return new $({type:"optional",innerType:v})}function OA($,v){return new $({type:"nullable",innerType:v})}function HA($,v,D){return new $({type:"default",innerType:v,get defaultValue(){return typeof D==="function"?D():bG(D)}})}function FA($,v,D){return new $({type:"nonoptional",innerType:v,...M(D)})}function jA($,v){return new $({type:"success",innerType:v})}function AA($,v,D){return new $({type:"catch",innerType:v,catchValue:typeof D==="function"?D:()=>D})}function wA($,v,D){return new $({type:"pipe",in:v,out:D})}function MA($,v){return new $({type:"readonly",innerType:v})}function PA($,v,D){return new $({type:"template_literal",parts:v,...M(D)})}function bA($,v){return new $({type:"lazy",getter:v})}function qA($,v){return new $({type:"promise",innerType:v})}function B9($,v,D){let X=M(D);return X.abort??(X.abort=!0),new $({type:"custom",check:"custom",fn:v,...X})}function N9($,v,D){return new $({type:"custom",check:"custom",fn:v,...M(D)})}function Z9($,v){let D=DI((X)=>{return X.addIssue=(U)=>{if(typeof U==="string")X.issues.push(y6(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(y6(G))}},$(X.value,X)},v);return D}function DI($,v){let D=new G$({check:"custom",...M(v)});return D._zod.check=$,D}function O9($){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 H9($){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 F9($,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((K)=>typeof K==="string"?K.toLowerCase():K),U=U.map((K)=>typeof K==="string"?K.toLowerCase():K);let G=new Set(X),J=new Set(U),Q=$.Codec??Bv,W=$.Boolean??Kv,Y=new($.String??A6)({type:"string",error:D.error}),I=new W({type:"boolean",error:D.error}),V=new Q({type:"pipe",in:Y,out:I,transform:(K,L)=>{let N=K;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:(K,L)=>{if(K===!0)return X[0]||"true";else return U[0]||"false"},error:D.error});return V}function J1($,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 U6($){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,K=v.processors[U.type];if(!K)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);K($,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 D6($,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 K=J[1].defId??J[1].schema.id??`schema${$.counter++}`;return J[1].defId=K,{defId:K,ref:`${V("__shared")}#/${Q}/${K}`}}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>
91
91
 
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 W=$.external.registry.get(J[0])?.id;if(v!==J[0]&&W){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 I=$.seen.get(Q);if(I.ref===null)return;let W=I.def??I.schema,z={...W},Y=I.ref;if(I.ref=null,Y){X(Y);let V=$.seen.get(Y),L=V.schema;if(L.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(L);else Object.assign(W,L);if(Object.assign(W,z),Q._zod.parent===Y)for(let Z in W){if(Z==="$ref"||Z==="allOf")continue;if(!(Z in z))delete W[Z]}if(L.$ref&&V.def)for(let Z in W){if(Z==="$ref"||Z==="allOf")continue;if(Z in V.def&&JSON.stringify(W[Z])===JSON.stringify(V.def[Z]))delete W[Z]}}let B=Q._zod.parent;if(B&&B!==Y){X(B);let V=$.seen.get(B);if(V?.schema.$ref){if(W.$ref=V.schema.$ref,V.def)for(let L in W){if(L==="$ref"||L==="allOf")continue;if(L in V.def&&JSON.stringify(W[L])===JSON.stringify(V.def[L]))delete W[L]}}}$.override({zodSchema:Q,jsonSchema:W,path:I.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 I=Q[1];if(I.def&&I.defId){if(I.def.id===I.defId)delete I.def.id;J[I.defId]=I.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:J1(v,"input",$.processors),output:J1(v,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function i$($,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 i$(X.element,D);if(X.type==="set")return i$(X.valueType,D);if(X.type==="lazy")return i$(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 i$(X.innerType,D);if(X.type==="intersection")return i$(X.left,D)||i$(X.right,D);if(X.type==="record"||X.type==="map")return i$(X.keyType,D)||i$(X.valueType,D);if(X.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return i$(X.in,D)||i$(X.out,D)}if(X.type==="object"){for(let U in X.shape)if(i$(X.shape[U],D))return!0;return!1}if(X.type==="union"){for(let U of X.options)if(i$(U,D))return!0;return!1}if(X.type==="tuple"){for(let U of X.items)if(i$(U,D))return!0;if(X.rest&&i$(X.rest,D))return!0;return!1}return!1}var AI=($,v={})=>(D)=>{let X=v6({...D,processors:v});return e($,X),U6(X,$),D6(X,$)},J1=($,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 Mj={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},HI=($,v,D,X)=>{let U=D;U.type="string";let{minimum:G,maximum:J,format:Q,patterns:I,contentEncoding:W}=$._zod.bag;if(typeof G==="number")U.minLength=G;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=Mj[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(W)U.contentEncoding=W;if(I&&I.size>0){let z=[...I];if(z.length===1)U.pattern=z[0].source;else if(z.length>1)U.allOf=[...z.map((Y)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:Y.source}))]}},FI=($,v,D,X)=>{let U=D,{minimum:G,maximum:J,format:Q,multipleOf:I,exclusiveMaximum:W,exclusiveMinimum:z}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let Y=typeof z==="number"&&z>=(G??Number.NEGATIVE_INFINITY),B=typeof W==="number"&&W<=(J??Number.POSITIVE_INFINITY),V=v.target==="draft-04"||v.target==="openapi-3.0";if(Y)if(V)U.minimum=z,U.exclusiveMinimum=!0;else U.exclusiveMinimum=z;else if(typeof G==="number")U.minimum=G;if(B)if(V)U.maximum=W,U.exclusiveMaximum=!0;else U.exclusiveMaximum=W;else if(typeof J==="number")U.maximum=J;if(typeof I==="number")U.multipleOf=I},jI=($,v,D,X)=>{D.type="boolean"},wI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},MI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},PI=($,v,D,X)=>{if(v.target==="openapi-3.0")D.type="string",D.nullable=!0,D.enum=[null];else D.type="null"},bI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},qI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},SI=($,v,D,X)=>{D.not={}},kI=($,v,D,X)=>{},TI=($,v,D,X)=>{},EI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},uI=($,v,D,X)=>{let U=$._zod.def,G=e1(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},RI=($,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}},gI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},CI=($,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},xI=($,v,D,X)=>{let U=D,G={type:"string",format:"binary",contentEncoding:"binary"},{minimum:J,maximum:Q,mime:I}=$._zod.bag;if(J!==void 0)G.minLength=J;if(Q!==void 0)G.maxLength=Q;if(I)if(I.length===1)G.contentMediaType=I[0],Object.assign(U,G);else Object.assign(U,G),U.anyOf=I.map((W)=>({contentMediaType:W}));else Object.assign(U,G)},iI=($,v,D,X)=>{D.type="boolean"},fI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},nI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},_I=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},yI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},lI=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},hI=($,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"]})},mI=($,v,D,X)=>{let U=D,G=$._zod.def;U.type="object",U.properties={};let J=G.shape;for(let W in J)U.properties[W]=e(J[W],v,{...X,path:[...X.path,"properties",W]});let Q=new Set(Object.keys(J)),I=new Set([...Q].filter((W)=>{let z=G.shape[W]._zod;if(v.io==="input")return z.optin===void 0;else return z.optout===void 0}));if(I.size>0)U.required=Array.from(I);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"]})},dU=($,v,D,X)=>{let U=$._zod.def,G=U.inclusive===!1,J=U.options.map((Q,I)=>e(Q,v,{...X,path:[...X.path,G?"oneOf":"anyOf",I]}));if(G)D.oneOf=J;else D.anyOf=J},rI=($,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=(W)=>("allOf"in W)&&Object.keys(W).length===1,I=[...Q(G)?G.allOf:[G],...Q(J)?J.allOf:[J]];D.allOf=I},cI=($,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",I=G.items.map((B,V)=>e(B,v,{...X,path:[...X.path,J,V]})),W=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=I,W)U.items=W}else if(v.target==="openapi-3.0"){if(U.items={anyOf:I},W)U.items.anyOf.push(W);if(U.minItems=I.length,!W)U.maxItems=I.length}else if(U.items=I,W)U.additionalItems=W;let{minimum:z,maximum:Y}=$._zod.bag;if(typeof z==="number")U.minItems=z;if(typeof Y==="number")U.maxItems=Y},dI=($,v,D,X)=>{let U=D,G=$._zod.def;U.type="object";let J=G.keyType,I=J._zod.bag?.patterns;if(G.mode==="loose"&&I&&I.size>0){let z=e(G.valueType,v,{...X,path:[...X.path,"patternProperties","*"]});U.patternProperties={};for(let Y of I)U.patternProperties[Y.source]=z}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 W=J._zod.values;if(W){let z=[...W].filter((Y)=>typeof Y==="string"||typeof Y==="number");if(z.length>0)U.required=z}},pI=($,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"}]},tI=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},oI=($,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))},aI=($,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))},eI=($,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},sI=($,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},$9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType,D.readOnly=!0},v9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},pU=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},U9=($,v,D,X)=>{let U=$._zod.innerType;e(U,v,X);let G=v.seen.get($);G.ref=U},cU={string:HI,number:FI,boolean:jI,bigint:wI,symbol:MI,null:PI,undefined:bI,void:qI,never:SI,any:kI,unknown:TI,date:EI,enum:uI,literal:RI,nan:gI,template_literal:CI,file:xI,success:iI,custom:fI,function:nI,transform:_I,map:yI,set:lI,array:hI,object:mI,union:dU,intersection:rI,tuple:cI,record:dI,nullable:pI,nonoptional:tI,default:oI,prefault:aI,catch:eI,pipe:sI,readonly:$9,promise:v9,optional:pU,lazy:U9};function tU($,v){if("_idmap"in $){let X=$,U=v6({...v,processors:cU}),G={};for(let I of X._idmap.entries()){let[W,z]=I;e(z,U)}let J={},Q={registry:X,uri:v?.uri,defs:G};U.external=Q;for(let I of X._idmap.entries()){let[W,z]=I;U6(U,z),J[W]=D6(U,z)}if(Object.keys(G).length>0){let I=U.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[I]:G}}return{schemas:J}}let D=v6({...v,processors:cU});return e($,D),U6(D,$),D6(D,$)}class D9{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:cU,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 vY={};var jv={};R4(jv,{xor:()=>cY,xid:()=>ZY,void:()=>lY,uuidv7:()=>WY,uuidv6:()=>IY,uuidv4:()=>QY,uuid:()=>JY,url:()=>zY,unknown:()=>D$,union:()=>X$,undefined:()=>_Y,ulid:()=>NY,uint64:()=>fY,uint32:()=>CY,tuple:()=>R9,transform:()=>jD,templateLiteral:()=>XB,symbol:()=>nY,superRefine:()=>JW,success:()=>$B,stringbool:()=>YB,stringFormat:()=>SY,string:()=>A,strictObject:()=>rY,set:()=>oY,refine:()=>GW,record:()=>s,readonly:()=>s9,promise:()=>GB,preprocess:()=>Cv,prefault:()=>r9,pipe:()=>UD,partialRecord:()=>dY,optional:()=>J$,object:()=>q,number:()=>t,nullish:()=>sY,nullable:()=>Mv,null:()=>qv,nonoptional:()=>c9,never:()=>FD,nativeEnum:()=>aY,nanoid:()=>VY,nan:()=>vB,meta:()=>WB,map:()=>tY,mac:()=>HY,looseRecord:()=>pY,looseObject:()=>w$,literal:()=>E,lazy:()=>UW,ksuid:()=>OY,keyof:()=>mY,jwt:()=>qY,json:()=>BB,ipv6:()=>FY,ipv4:()=>AY,invertCodec:()=>DB,intersection:()=>L1,int64:()=>iY,int32:()=>gY,int:()=>vD,instanceof:()=>zB,httpUrl:()=>YY,hostname:()=>kY,hex:()=>TY,hash:()=>EY,guid:()=>GY,function:()=>JB,float64:()=>RY,float32:()=>uY,file:()=>eY,exactOptional:()=>_9,enum:()=>M$,emoji:()=>BY,email:()=>XY,e164:()=>bY,discriminatedUnion:()=>Ev,describe:()=>IB,date:()=>hY,custom:()=>PD,cuid2:()=>KY,cuid:()=>LY,codec:()=>UB,cidrv6:()=>wY,cidrv4:()=>jY,check:()=>QB,catch:()=>t9,boolean:()=>V$,bigint:()=>xY,base64url:()=>PY,base64:()=>MY,array:()=>m,any:()=>yY,_function:()=>JB,_default:()=>h9,_ZodString:()=>DD,ZodXor:()=>k9,ZodXID:()=>zD,ZodVoid:()=>q9,ZodUnknown:()=>P9,ZodUnion:()=>Tv,ZodUndefined:()=>j9,ZodUUID:()=>q4,ZodURL:()=>bv,ZodULID:()=>WD,ZodType:()=>_,ZodTuple:()=>u9,ZodTransform:()=>f9,ZodTemplateLiteral:()=>$W,ZodSymbol:()=>F9,ZodSuccess:()=>d9,ZodStringFormat:()=>U$,ZodString:()=>W1,ZodSet:()=>C9,ZodRecord:()=>Q1,ZodReadonly:()=>e9,ZodPromise:()=>DW,ZodPreprocess:()=>a9,ZodPrefault:()=>m9,ZodPipe:()=>uv,ZodOptional:()=>wD,ZodObject:()=>kv,ZodNumberFormat:()=>P6,ZodNumber:()=>Y1,ZodNullable:()=>y9,ZodNull:()=>w9,ZodNonOptional:()=>MD,ZodNever:()=>b9,ZodNanoID:()=>JD,ZodNaN:()=>o9,ZodMap:()=>g9,ZodMAC:()=>H9,ZodLiteral:()=>x9,ZodLazy:()=>vW,ZodKSUID:()=>YD,ZodJWT:()=>AD,ZodIntersection:()=>E9,ZodIPv6:()=>VD,ZodIPv4:()=>BD,ZodGUID:()=>wv,ZodFunction:()=>XW,ZodFile:()=>i9,ZodExactOptional:()=>n9,ZodEnum:()=>I1,ZodEmoji:()=>GD,ZodEmail:()=>XD,ZodE164:()=>OD,ZodDiscriminatedUnion:()=>T9,ZodDefault:()=>l9,ZodDate:()=>Sv,ZodCustomStringFormat:()=>z1,ZodCustom:()=>gv,ZodCodec:()=>Rv,ZodCatch:()=>p9,ZodCUID2:()=>ID,ZodCUID:()=>QD,ZodCIDRv6:()=>KD,ZodCIDRv4:()=>LD,ZodBoolean:()=>B1,ZodBigIntFormat:()=>HD,ZodBigInt:()=>V1,ZodBase64URL:()=>ZD,ZodBase64:()=>ND,ZodArray:()=>S9,ZodAny:()=>M9});var oU={};R4(oU,{uppercase:()=>t6,trim:()=>v1,toUpperCase:()=>D1,toLowerCase:()=>U1,startsWith:()=>a6,slugify:()=>X1,size:()=>j6,regex:()=>d6,property:()=>rU,positive:()=>yU,overwrite:()=>z4,normalize:()=>$1,nonpositive:()=>hU,nonnegative:()=>mU,negative:()=>lU,multipleOf:()=>s4,minSize:()=>b4,minLength:()=>f4,mime:()=>s6,maxSize:()=>$6,maxLength:()=>w6,lte:()=>e$,lt:()=>M4,lowercase:()=>p6,length:()=>M6,includes:()=>o6,gte:()=>x$,gt:()=>P4,endsWith:()=>e6});var X6={};R4(X6,{time:()=>J9,duration:()=>Q9,datetime:()=>X9,date:()=>G9,ZodISOTime:()=>sU,ZodISODuration:()=>$D,ZodISODateTime:()=>aU,ZodISODate:()=>eU});var aU=K("ZodISODateTime",($,v)=>{fJ.init($,v),U$.init($,v)});function X9($){return f8(aU,$)}var eU=K("ZodISODate",($,v)=>{nJ.init($,v),U$.init($,v)});function G9($){return n8(eU,$)}var sU=K("ZodISOTime",($,v)=>{_J.init($,v),U$.init($,v)});function J9($){return _8(sU,$)}var $D=K("ZodISODuration",($,v)=>{yJ.init($,v),U$.init($,v)});function Q9($){return y8($D,$)}var UY=($,v)=>{Dv.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(D)=>Gv($,D)},flatten:{value:(D)=>Xv($,D)},addIssue:{value:(D)=>{$.issues.push(D),$.message=JSON.stringify($.issues,i6,2)}},addIssues:{value:(D)=>{$.issues.push(...D),$.message=JSON.stringify($.issues,i6,2)}},isEmpty:{get(){return $.issues.length===0}}})},bj=K("ZodError",UY),h$=K("ZodError",UY,{Parent:Error});var I9=_6(h$),W9=y6(h$),z9=l6(h$),Y9=m6(h$),B9=s0(h$),V9=$U(h$),L9=vU(h$),K9=UU(h$),N9=DU(h$),Z9=XU(h$),O9=GU(h$),A9=JU(h$);var DY=new WeakMap;function Pv($,v,D){let X=Object.getPrototypeOf($),U=DY.get(X);if(!U)U=new Set,DY.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 _=K("ZodType",($,v)=>{return f.init($,v),Object.assign($["~standard"],{jsonSchema:{input:J1($,"input"),output:J1($,"output")}}),$.toJSONSchema=AI($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.parse=(D,X)=>I9($,D,X,{callee:$.parse}),$.safeParse=(D,X)=>z9($,D,X),$.parseAsync=async(D,X)=>W9($,D,X,{callee:$.parseAsync}),$.safeParseAsync=async(D,X)=>Y9($,D,X),$.spa=$.safeParseAsync,$.encode=(D,X)=>B9($,D,X),$.decode=(D,X)=>V9($,D,X),$.encodeAsync=async(D,X)=>L9($,D,X),$.decodeAsync=async(D,X)=>K9($,D,X),$.safeEncode=(D,X)=>N9($,D,X),$.safeDecode=(D,X)=>Z9($,D,X),$.safeEncodeAsync=async(D,X)=>O9($,D,X),$.safeDecodeAsync=async(D,X)=>A9($,D,X),Pv($,"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 g$(this,D,X)},brand(){return this},register(D,X){return D.add(this,X),this},refine(D,X){return this.check(GW(D,X))},superRefine(D,X){return this.check(JW(D,X))},overwrite(D){return this.check(z4(D))},optional(){return J$(this)},exactOptional(){return _9(this)},nullable(){return Mv(this)},nullish(){return J$(Mv(this))},nonoptional(D){return c9(this,D)},array(){return m(this)},or(D){return X$([this,D])},and(D){return L1(this,D)},transform(D){return UD(this,jD(D))},default(D){return h9(this,D)},prefault(D){return r9(this,D)},catch(D){return t9(this,D)},pipe(D){return UD(this,D)},readonly(){return s9(this)},describe(D){let X=this.clone();return j$.add(X,{description:D}),X},meta(...D){if(D.length===0)return j$.get(this);let X=this.clone();return j$.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 j$.get($)?.description},configurable:!0}),$}),DD=K("_ZodString",($,v)=>{F6.init($,v),_.init($,v),$._zod.processJSONSchema=(X,U,G)=>HI($,X,U,G);let D=$._zod.bag;$.format=D.format??null,$.minLength=D.minimum??null,$.maxLength=D.maximum??null,Pv($,"_ZodString",{regex(...X){return this.check(d6(...X))},includes(...X){return this.check(o6(...X))},startsWith(...X){return this.check(a6(...X))},endsWith(...X){return this.check(e6(...X))},min(...X){return this.check(f4(...X))},max(...X){return this.check(w6(...X))},length(...X){return this.check(M6(...X))},nonempty(...X){return this.check(f4(1,...X))},lowercase(X){return this.check(p6(X))},uppercase(X){return this.check(t6(X))},trim(){return this.check(v1())},normalize(...X){return this.check($1(...X))},toLowerCase(){return this.check(U1())},toUpperCase(){return this.check(D1())},slugify(){return this.check(X1())}})}),W1=K("ZodString",($,v)=>{F6.init($,v),DD.init($,v),$.email=(D)=>$.check(FU(XD,D)),$.url=(D)=>$.check(Fv(bv,D)),$.jwt=(D)=>$.check(_U(AD,D)),$.emoji=(D)=>$.check(bU(GD,D)),$.guid=(D)=>$.check(Hv(wv,D)),$.uuid=(D)=>$.check(jU(q4,D)),$.uuidv4=(D)=>$.check(wU(q4,D)),$.uuidv6=(D)=>$.check(MU(q4,D)),$.uuidv7=(D)=>$.check(PU(q4,D)),$.nanoid=(D)=>$.check(qU(JD,D)),$.guid=(D)=>$.check(Hv(wv,D)),$.cuid=(D)=>$.check(SU(QD,D)),$.cuid2=(D)=>$.check(kU(ID,D)),$.ulid=(D)=>$.check(TU(WD,D)),$.base64=(D)=>$.check(iU(ND,D)),$.base64url=(D)=>$.check(fU(ZD,D)),$.xid=(D)=>$.check(EU(zD,D)),$.ksuid=(D)=>$.check(uU(YD,D)),$.ipv4=(D)=>$.check(RU(BD,D)),$.ipv6=(D)=>$.check(gU(VD,D)),$.cidrv4=(D)=>$.check(CU(LD,D)),$.cidrv6=(D)=>$.check(xU(KD,D)),$.e164=(D)=>$.check(nU(OD,D)),$.datetime=(D)=>$.check(X9(D)),$.date=(D)=>$.check(G9(D)),$.time=(D)=>$.check(J9(D)),$.duration=(D)=>$.check(Q9(D))});function A($){return g8(W1,$)}var U$=K("ZodStringFormat",($,v)=>{v$.init($,v),DD.init($,v)}),XD=K("ZodEmail",($,v)=>{kJ.init($,v),U$.init($,v)});function XY($){return FU(XD,$)}var wv=K("ZodGUID",($,v)=>{qJ.init($,v),U$.init($,v)});function GY($){return Hv(wv,$)}var q4=K("ZodUUID",($,v)=>{SJ.init($,v),U$.init($,v)});function JY($){return jU(q4,$)}function QY($){return wU(q4,$)}function IY($){return MU(q4,$)}function WY($){return PU(q4,$)}var bv=K("ZodURL",($,v)=>{TJ.init($,v),U$.init($,v)});function zY($){return Fv(bv,$)}function YY($){return Fv(bv,{protocol:a$.httpProtocol,hostname:a$.domain,...w.normalizeParams($)})}var GD=K("ZodEmoji",($,v)=>{EJ.init($,v),U$.init($,v)});function BY($){return bU(GD,$)}var JD=K("ZodNanoID",($,v)=>{uJ.init($,v),U$.init($,v)});function VY($){return qU(JD,$)}var QD=K("ZodCUID",($,v)=>{RJ.init($,v),U$.init($,v)});function LY($){return SU(QD,$)}var ID=K("ZodCUID2",($,v)=>{gJ.init($,v),U$.init($,v)});function KY($){return kU(ID,$)}var WD=K("ZodULID",($,v)=>{CJ.init($,v),U$.init($,v)});function NY($){return TU(WD,$)}var zD=K("ZodXID",($,v)=>{xJ.init($,v),U$.init($,v)});function ZY($){return EU(zD,$)}var YD=K("ZodKSUID",($,v)=>{iJ.init($,v),U$.init($,v)});function OY($){return uU(YD,$)}var BD=K("ZodIPv4",($,v)=>{lJ.init($,v),U$.init($,v)});function AY($){return RU(BD,$)}var H9=K("ZodMAC",($,v)=>{mJ.init($,v),U$.init($,v)});function HY($){return x8(H9,$)}var VD=K("ZodIPv6",($,v)=>{hJ.init($,v),U$.init($,v)});function FY($){return gU(VD,$)}var LD=K("ZodCIDRv4",($,v)=>{rJ.init($,v),U$.init($,v)});function jY($){return CU(LD,$)}var KD=K("ZodCIDRv6",($,v)=>{cJ.init($,v),U$.init($,v)});function wY($){return xU(KD,$)}var ND=K("ZodBase64",($,v)=>{pJ.init($,v),U$.init($,v)});function MY($){return iU(ND,$)}var ZD=K("ZodBase64URL",($,v)=>{tJ.init($,v),U$.init($,v)});function PY($){return fU(ZD,$)}var OD=K("ZodE164",($,v)=>{oJ.init($,v),U$.init($,v)});function bY($){return nU(OD,$)}var AD=K("ZodJWT",($,v)=>{aJ.init($,v),U$.init($,v)});function qY($){return _U(AD,$)}var z1=K("ZodCustomStringFormat",($,v)=>{eJ.init($,v),U$.init($,v)});function SY($,v,D={}){return G1(z1,$,v,D)}function kY($){return G1(z1,"hostname",a$.hostname,$)}function TY($){return G1(z1,"hex",a$.hex,$)}function EY($,v){let D=v?.enc??"hex",X=`${$}_${D}`,U=a$[X];if(!U)throw Error(`Unrecognized hash format: ${X}`);return G1(z1,X,U,v)}var Y1=K("ZodNumber",($,v)=>{KU.init($,v),_.init($,v),$._zod.processJSONSchema=(X,U,G)=>FI($,X,U,G),Pv($,"ZodNumber",{gt(X,U){return this.check(P4(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(M4(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(vD(X))},safe(X){return this.check(vD(X))},positive(X){return this.check(P4(0,X))},nonnegative(X){return this.check(x$(0,X))},negative(X){return this.check(M4(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 l8(Y1,$)}var P6=K("ZodNumberFormat",($,v)=>{sJ.init($,v),Y1.init($,v)});function vD($){return m8(P6,$)}function uY($){return r8(P6,$)}function RY($){return c8(P6,$)}function gY($){return d8(P6,$)}function CY($){return p8(P6,$)}var B1=K("ZodBoolean",($,v)=>{Bv.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>jI($,D,X,U)});function V$($){return t8(B1,$)}var V1=K("ZodBigInt",($,v)=>{NU.init($,v),_.init($,v),$._zod.processJSONSchema=(X,U,G)=>wI($,X,U,G),$.gte=(X,U)=>$.check(x$(X,U)),$.min=(X,U)=>$.check(x$(X,U)),$.gt=(X,U)=>$.check(P4(X,U)),$.gte=(X,U)=>$.check(x$(X,U)),$.min=(X,U)=>$.check(x$(X,U)),$.lt=(X,U)=>$.check(M4(X,U)),$.lte=(X,U)=>$.check(e$(X,U)),$.max=(X,U)=>$.check(e$(X,U)),$.positive=(X)=>$.check(P4(BigInt(0),X)),$.negative=(X)=>$.check(M4(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 xY($){return a8(V1,$)}var HD=K("ZodBigIntFormat",($,v)=>{$Q.init($,v),V1.init($,v)});function iY($){return s8(HD,$)}function fY($){return $I(HD,$)}var F9=K("ZodSymbol",($,v)=>{vQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>MI($,D,X,U)});function nY($){return vI(F9,$)}var j9=K("ZodUndefined",($,v)=>{UQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>bI($,D,X,U)});function _Y($){return UI(j9,$)}var w9=K("ZodNull",($,v)=>{DQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>PI($,D,X,U)});function qv($){return DI(w9,$)}var M9=K("ZodAny",($,v)=>{XQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>kI($,D,X,U)});function yY(){return XI(M9)}var P9=K("ZodUnknown",($,v)=>{GQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>TI($,D,X,U)});function D$(){return GI(P9)}var b9=K("ZodNever",($,v)=>{JQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>SI($,D,X,U)});function FD($){return JI(b9,$)}var q9=K("ZodVoid",($,v)=>{QQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>qI($,D,X,U)});function lY($){return QI(q9,$)}var Sv=K("ZodDate",($,v)=>{IQ.init($,v),_.init($,v),$._zod.processJSONSchema=(X,U,G)=>EI($,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 hY($){return II(Sv,$)}var S9=K("ZodArray",($,v)=>{WQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>hI($,D,X,U),$.element=v.element,Pv($,"ZodArray",{min(D,X){return this.check(f4(D,X))},nonempty(D){return this.check(f4(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 YI(S9,$,v)}function mY($){let v=$._zod.def.shape;return M$(Object.keys(v))}var kv=K("ZodObject",($,v)=>{zQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>mI($,D,X,U),w.defineLazy($,"shape",()=>{return v.shape}),Pv($,"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:FD()})},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(wD,this,D[0])},required(...D){return w.required(MD,this,D[0])}})});function q($,v){let D={type:"object",shape:$??{},...w.normalizeParams(v)};return new kv(D)}function rY($,v){return new kv({type:"object",shape:$,catchall:FD(),...w.normalizeParams(v)})}function w$($,v){return new kv({type:"object",shape:$,catchall:D$(),...w.normalizeParams(v)})}var Tv=K("ZodUnion",($,v)=>{Vv.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>dU($,D,X,U),$.options=v.options});function X$($,v){return new Tv({type:"union",options:$,...w.normalizeParams(v)})}var k9=K("ZodXor",($,v)=>{Tv.init($,v),YQ.init($,v),$._zod.processJSONSchema=(D,X,U)=>dU($,D,X,U),$.options=v.options});function cY($,v){return new k9({type:"union",options:$,inclusive:!1,...w.normalizeParams(v)})}var T9=K("ZodDiscriminatedUnion",($,v)=>{Tv.init($,v),BQ.init($,v)});function Ev($,v,D){return new T9({type:"union",options:v,discriminator:$,...w.normalizeParams(D)})}var E9=K("ZodIntersection",($,v)=>{VQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>rI($,D,X,U)});function L1($,v){return new E9({type:"intersection",left:$,right:v})}var u9=K("ZodTuple",($,v)=>{ZU.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>cI($,D,X,U),$.rest=(D)=>$.clone({...$._zod.def,rest:D})});function R9($,v,D){let X=v instanceof f,U=X?D:v;return new u9({type:"tuple",items:$,rest:X?v:null,...w.normalizeParams(U)})}var Q1=K("ZodRecord",($,v)=>{LQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>dI($,D,X,U),$.keyType=v.keyType,$.valueType=v.valueType});function s($,v,D){if(!v||!v._zod)return new Q1({type:"record",keyType:A(),valueType:$,...w.normalizeParams(v)});return new Q1({type:"record",keyType:$,valueType:v,...w.normalizeParams(D)})}function dY($,v,D){let X=g$($);return X._zod.values=void 0,new Q1({type:"record",keyType:X,valueType:v,...w.normalizeParams(D)})}function pY($,v,D){return new Q1({type:"record",keyType:$,valueType:v,mode:"loose",...w.normalizeParams(D)})}var g9=K("ZodMap",($,v)=>{KQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>yI($,D,X,U),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...D)=>$.check(b4(...D)),$.nonempty=(D)=>$.check(b4(1,D)),$.max=(...D)=>$.check($6(...D)),$.size=(...D)=>$.check(j6(...D))});function tY($,v,D){return new g9({type:"map",keyType:$,valueType:v,...w.normalizeParams(D)})}var C9=K("ZodSet",($,v)=>{NQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>lI($,D,X,U),$.min=(...D)=>$.check(b4(...D)),$.nonempty=(D)=>$.check(b4(1,D)),$.max=(...D)=>$.check($6(...D)),$.size=(...D)=>$.check(j6(...D))});function oY($,v){return new C9({type:"set",valueType:$,...w.normalizeParams(v)})}var I1=K("ZodEnum",($,v)=>{ZQ.init($,v),_.init($,v),$._zod.processJSONSchema=(X,U,G)=>uI($,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 I1({...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 I1({...v,checks:[],...w.normalizeParams(U),entries:G})}});function M$($,v){let D=Array.isArray($)?Object.fromEntries($.map((X)=>[X,X])):$;return new I1({type:"enum",entries:D,...w.normalizeParams(v)})}function aY($,v){return new I1({type:"enum",entries:$,...w.normalizeParams(v)})}var x9=K("ZodLiteral",($,v)=>{OQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>RI($,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 x9({type:"literal",values:Array.isArray($)?$:[$],...w.normalizeParams(v)})}var i9=K("ZodFile",($,v)=>{AQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>xI($,D,X,U),$.min=(D,X)=>$.check(b4(D,X)),$.max=(D,X)=>$.check($6(D,X)),$.mime=(D,X)=>$.check(s6(Array.isArray(D)?D:[D],X))});function eY($){return BI(i9,$)}var f9=K("ZodTransform",($,v)=>{HQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>_I($,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 jD($){return new f9({type:"transform",transform:$})}var wD=K("ZodOptional",($,v)=>{OU.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>pU($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function J$($){return new wD({type:"optional",innerType:$})}var n9=K("ZodExactOptional",($,v)=>{FQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>pU($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function _9($){return new n9({type:"optional",innerType:$})}var y9=K("ZodNullable",($,v)=>{jQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>pI($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function Mv($){return new y9({type:"nullable",innerType:$})}function sY($){return J$(Mv($))}var l9=K("ZodDefault",($,v)=>{wQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>oI($,D,X,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function h9($,v){return new l9({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():w.shallowClone(v)}})}var m9=K("ZodPrefault",($,v)=>{MQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>aI($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function r9($,v){return new m9({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():w.shallowClone(v)}})}var MD=K("ZodNonOptional",($,v)=>{PQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>tI($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function c9($,v){return new MD({type:"nonoptional",innerType:$,...w.normalizeParams(v)})}var d9=K("ZodSuccess",($,v)=>{bQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>iI($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function $B($){return new d9({type:"success",innerType:$})}var p9=K("ZodCatch",($,v)=>{qQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>eI($,D,X,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function t9($,v){return new p9({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var o9=K("ZodNaN",($,v)=>{SQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>gI($,D,X,U)});function vB($){return zI(o9,$)}var uv=K("ZodPipe",($,v)=>{AU.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>sI($,D,X,U),$.in=v.in,$.out=v.out});function UD($,v){return new uv({type:"pipe",in:$,out:v})}var Rv=K("ZodCodec",($,v)=>{uv.init($,v),Lv.init($,v)});function UB($,v,D){return new Rv({type:"pipe",in:$,out:v,transform:D.decode,reverseTransform:D.encode})}function DB($){let v=$._zod.def;return new Rv({type:"pipe",in:v.out,out:v.in,transform:v.reverseTransform,reverseTransform:v.transform})}var a9=K("ZodPreprocess",($,v)=>{uv.init($,v),kQ.init($,v)}),e9=K("ZodReadonly",($,v)=>{TQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>$9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function s9($){return new e9({type:"readonly",innerType:$})}var $W=K("ZodTemplateLiteral",($,v)=>{EQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>CI($,D,X,U)});function XB($,v){return new $W({type:"template_literal",parts:$,...w.normalizeParams(v)})}var vW=K("ZodLazy",($,v)=>{gQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>U9($,D,X,U),$.unwrap=()=>$._zod.def.getter()});function UW($){return new vW({type:"lazy",getter:$})}var DW=K("ZodPromise",($,v)=>{RQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>v9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function GB($){return new DW({type:"promise",innerType:$})}var XW=K("ZodFunction",($,v)=>{uQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>nI($,D,X,U)});function JB($){return new XW({type:"function",input:Array.isArray($?.input)?R9($?.input):$?.input??m(D$()),output:$?.output??D$()})}var gv=K("ZodCustom",($,v)=>{CQ.init($,v),_.init($,v),$._zod.processJSONSchema=(D,X,U)=>fI($,D,X,U)});function QB($){let v=new G$({check:"custom"});return v._zod.check=$,v}function PD($,v){return VI(gv,$??(()=>!0),v)}function GW($,v={}){return LI(gv,$,v)}function JW($,v){return KI($,v)}var IB=NI,WB=ZI;function zB($,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 YB=(...$)=>OI({Codec:Rv,Boolean:B1,String:W1},...$);function BB($){let v=UW(()=>{return X$([A($),t(),V$(),qv(),m(v),s(A(),v)])});return v}function Cv($,v){return new a9({type:"pipe",in:jD($),out:v})}var Sj={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 kj($){B$({customError:$})}function Tj(){return B$().customError}var QW;(function($){})(QW||(QW={}));var P={...jv,...oU,iso:X6},Ej=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 uj($,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 Rj($,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 VB($,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=Rj(U,v),J=T$(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 VB(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[I,W]of Object.entries(G)){let z=T$(W,v);U[I]=J.has(I)?z:z.optional()}if($.propertyNames){let I=T$($.propertyNames,v),W=$.additionalProperties&&typeof $.additionalProperties==="object"?T$($.additionalProperties,v):P.any();if(Object.keys(U).length===0){X=P.record(I,W);break}let z=P.object(U).passthrough(),Y=P.looseRecord(I,W);X=P.intersection(z,Y);break}if($.patternProperties){let I=$.patternProperties,W=Object.keys(I),z=[];for(let B of W){let V=T$(I[B],v),L=P.string().regex(new RegExp(B));z.push(P.looseRecord(L,V))}let Y=[];if(Object.keys(U).length>0)Y.push(P.object(U).passthrough());if(Y.push(...z),Y.length===0)X=P.object({}).passthrough();else if(Y.length===1)X=Y[0];else{let B=P.intersection(Y[0],Y[1]);for(let V=2;V<Y.length;V++)B=P.intersection(B,Y[V]);X=B}break}let Q=P.object(U);if($.additionalProperties===!1)X=Q.strict();else if(typeof $.additionalProperties==="object")X=Q.catchall(T$($.additionalProperties,v));else X=Q.passthrough();break}case"array":{let{prefixItems:U,items:G}=$;if(U&&Array.isArray(U)){let J=U.map((I)=>T$(I,v)),Q=G&&typeof G==="object"&&!Array.isArray(G)?T$(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((I)=>T$(I,v)),Q=$.additionalItems&&typeof $.additionalItems==="object"?T$($.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=T$(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 T$($,v){if(typeof $==="boolean")return $?P.any():P.never();let D=VB($,v),X=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let Q=$.anyOf.map((W)=>T$(W,v)),I=P.union(Q);D=X?P.intersection(D,I):I}if($.oneOf&&Array.isArray($.oneOf)){let Q=$.oneOf.map((W)=>T$(W,v)),I=P.xor(Q);D=X?P.intersection(D,I):I}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)D=X?D:P.any();else{let Q=X?D:T$($.allOf[0],v),I=X?0:1;for(let W=I;W<$.allOf.length;W++)Q=P.intersection(Q,T$($.allOf[W],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(!Ej.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 LB($,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=uj(D,v?.defaultTarget),U=D.$defs||D.definitions||{},G={version:X,defs:U,refs:new Map,processing:new Set,rootSchema:D,registry:v?.registry??j$};return T$(D,G)}var IW={};R4(IW,{string:()=>gj,number:()=>Cj,date:()=>fj,boolean:()=>xj,bigint:()=>ij});function gj($){return C8(W1,$)}function Cj($){return h8(Y1,$)}function xj($){return o8(B1,$)}function ij($){return e8(V1,$)}function fj($){return WI(Sv,$)}B$(Kv());var WW="2025-11-25",KB="2025-03-26",N1=[WW,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],G6="io.modelcontextprotocol/related-task",qD="2.0",Z$=PD(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),NB=X$([A(),t().int()]),ZB=A(),hy=w$({ttl:t().optional(),pollInterval:t().optional()}),nj=q({ttl:t().optional()}),_j=q({taskId:A()}),zW=w$({progressToken:NB.optional(),[G6]:_j.optional()}),s$=q({_meta:zW.optional()}),xv=s$.extend({task:nj.optional()}),OB=($)=>xv.safeParse($).success,P$=q({method:A(),params:s$.loose().optional()}),U4=q({_meta:zW.optional()}),D4=q({method:A(),params:U4.loose().optional()}),b$=w$({_meta:zW.optional()}),SD=X$([A(),t().int()]),AB=q({jsonrpc:E(qD),id:SD,...P$.shape}).strict(),J6=($)=>AB.safeParse($).success,HB=q({jsonrpc:E(qD),...D4.shape}).strict(),FB=($)=>HB.safeParse($).success,YW=q({jsonrpc:E(qD),id:SD,result:b$}).strict(),_4=($)=>YW.safeParse($).success;var i;(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"})(i||(i={}));var BW=q({jsonrpc:E(qD),id:SD.optional(),error:q({code:t().int(),message:A(),data:D$().optional()})}).strict();var Z1=($)=>BW.safeParse($).success;var iv=X$([AB,HB,YW,BW]),my=X$([YW,BW]),kD=b$.strict(),yj=U4.extend({requestId:SD.optional(),reason:A().optional()}),TD=D4.extend({method:E("notifications/cancelled"),params:yj}),lj=q({src:A(),mimeType:A().optional(),sizes:m(A()).optional(),theme:M$(["light","dark"]).optional()}),fv=q({icons:m(lj).optional()}),K1=q({name:A(),title:A().optional()}),jB=K1.extend({...K1.shape,...fv.shape,version:A(),websiteUrl:A().optional(),description:A().optional()}),hj=L1(q({applyDefaults:V$().optional()}),s(A(),D$())),mj=Cv(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},L1(q({form:hj.optional(),url:Z$.optional()}),s(A(),D$()).optional())),rj=w$({list:Z$.optional(),cancel:Z$.optional(),requests:w$({sampling:w$({createMessage:Z$.optional()}).optional(),elicitation:w$({create:Z$.optional()}).optional()}).optional()}),cj=w$({list:Z$.optional(),cancel:Z$.optional(),requests:w$({tools:w$({call:Z$.optional()}).optional()}).optional()}),dj=q({experimental:s(A(),Z$).optional(),sampling:q({context:Z$.optional(),tools:Z$.optional()}).optional(),elicitation:mj.optional(),roots:q({listChanged:V$().optional()}).optional(),tasks:rj.optional(),extensions:s(A(),Z$).optional()}),pj=s$.extend({protocolVersion:A(),capabilities:dj,clientInfo:jB}),ED=P$.extend({method:E("initialize"),params:pj}),VW=($)=>ED.safeParse($).success,tj=q({experimental:s(A(),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:cj.optional(),extensions:s(A(),Z$).optional()}),oj=b$.extend({protocolVersion:A(),capabilities:tj,serverInfo:jB,instructions:A().optional()}),LW=D4.extend({method:E("notifications/initialized"),params:U4.optional()});var uD=P$.extend({method:E("ping"),params:s$.optional()}),aj=q({progress:t(),total:J$(t()),message:J$(A())}),ej=q({...U4.shape,...aj.shape,progressToken:NB}),RD=D4.extend({method:E("notifications/progress"),params:ej}),sj=s$.extend({cursor:ZB.optional()}),nv=P$.extend({params:sj.optional()}),_v=b$.extend({nextCursor:ZB.optional()}),$w=M$(["working","input_required","completed","failed","cancelled"]),yv=q({taskId:A(),status:$w,ttl:X$([t(),qv()]),createdAt:A(),lastUpdatedAt:A(),pollInterval:J$(t()),statusMessage:J$(A())}),O1=b$.extend({task:yv}),vw=U4.merge(yv),lv=D4.extend({method:E("notifications/tasks/status"),params:vw}),gD=P$.extend({method:E("tasks/get"),params:s$.extend({taskId:A()})}),CD=b$.merge(yv),xD=P$.extend({method:E("tasks/result"),params:s$.extend({taskId:A()})}),ry=b$.loose(),iD=nv.extend({method:E("tasks/list")}),fD=_v.extend({tasks:m(yv)}),nD=P$.extend({method:E("tasks/cancel"),params:s$.extend({taskId:A()})}),wB=b$.merge(yv),MB=q({uri:A(),mimeType:J$(A()),_meta:s(A(),D$()).optional()}),PB=MB.extend({text:A()}),KW=A().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),bB=MB.extend({blob:KW}),hv=M$(["user","assistant"]),A1=q({audience:m(hv).optional(),priority:t().min(0).max(1).optional(),lastModified:X6.datetime({offset:!0}).optional()}),qB=q({...K1.shape,...fv.shape,uri:A(),description:J$(A()),mimeType:J$(A()),size:J$(t()),annotations:A1.optional(),_meta:J$(w$({}))}),Uw=q({...K1.shape,...fv.shape,uriTemplate:A(),description:J$(A()),mimeType:J$(A()),annotations:A1.optional(),_meta:J$(w$({}))}),mv=nv.extend({method:E("resources/list")}),Dw=_v.extend({resources:m(qB)}),Xw=nv.extend({method:E("resources/templates/list")}),Gw=_v.extend({resourceTemplates:m(Uw)}),NW=s$.extend({uri:A()}),Jw=NW,rv=P$.extend({method:E("resources/read"),params:Jw}),Qw=b$.extend({contents:m(X$([PB,bB]))}),Iw=D4.extend({method:E("notifications/resources/list_changed"),params:U4.optional()}),Ww=NW,zw=P$.extend({method:E("resources/subscribe"),params:Ww}),Yw=NW,Bw=P$.extend({method:E("resources/unsubscribe"),params:Yw}),Vw=U4.extend({uri:A()}),Lw=D4.extend({method:E("notifications/resources/updated"),params:Vw}),Kw=q({name:A(),description:J$(A()),required:J$(V$())}),Nw=q({...K1.shape,...fv.shape,description:J$(A()),arguments:J$(m(Kw)),_meta:J$(w$({}))}),cv=nv.extend({method:E("prompts/list")}),Zw=_v.extend({prompts:m(Nw)}),Ow=s$.extend({name:A(),arguments:s(A(),A()).optional()}),dv=P$.extend({method:E("prompts/get"),params:Ow}),ZW=q({type:E("text"),text:A(),annotations:A1.optional(),_meta:s(A(),D$()).optional()}),OW=q({type:E("image"),data:KW,mimeType:A(),annotations:A1.optional(),_meta:s(A(),D$()).optional()}),AW=q({type:E("audio"),data:KW,mimeType:A(),annotations:A1.optional(),_meta:s(A(),D$()).optional()}),Aw=q({type:E("tool_use"),name:A(),id:A(),input:s(A(),D$()),_meta:s(A(),D$()).optional()}),Hw=q({type:E("resource"),resource:X$([PB,bB]),annotations:A1.optional(),_meta:s(A(),D$()).optional()}),Fw=qB.extend({type:E("resource_link")}),HW=X$([ZW,OW,AW,Fw,Hw]),jw=q({role:hv,content:HW}),ww=b$.extend({description:A().optional(),messages:m(jw)}),Mw=D4.extend({method:E("notifications/prompts/list_changed"),params:U4.optional()}),Pw=q({title:A().optional(),readOnlyHint:V$().optional(),destructiveHint:V$().optional(),idempotentHint:V$().optional(),openWorldHint:V$().optional()}),bw=q({taskSupport:M$(["required","optional","forbidden"]).optional()}),SB=q({...K1.shape,...fv.shape,description:A().optional(),inputSchema:q({type:E("object"),properties:s(A(),Z$).optional(),required:m(A()).optional()}).catchall(D$()),outputSchema:q({type:E("object"),properties:s(A(),Z$).optional(),required:m(A()).optional()}).catchall(D$()).optional(),annotations:Pw.optional(),execution:bw.optional(),_meta:s(A(),D$()).optional()}),pv=nv.extend({method:E("tools/list")}),qw=_v.extend({tools:m(SB)}),_D=b$.extend({content:m(HW).default([]),structuredContent:s(A(),D$()).optional(),isError:V$().optional()}),cy=_D.or(b$.extend({toolResult:D$()})),Sw=xv.extend({name:A(),arguments:s(A(),D$()).optional()}),b6=P$.extend({method:E("tools/call"),params:Sw}),kw=D4.extend({method:E("notifications/tools/list_changed"),params:U4.optional()}),dy=q({autoRefresh:V$().default(!0),debounceMs:t().int().nonnegative().default(300)}),tv=M$(["debug","info","notice","warning","error","critical","alert","emergency"]),Tw=s$.extend({level:tv}),FW=P$.extend({method:E("logging/setLevel"),params:Tw}),Ew=U4.extend({level:tv,logger:A().optional(),data:D$()}),uw=D4.extend({method:E("notifications/message"),params:Ew}),Rw=q({name:A().optional()}),gw=q({hints:m(Rw).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),Cw=q({mode:M$(["auto","required","none"]).optional()}),xw=q({type:E("tool_result"),toolUseId:A().describe("The unique identifier for the corresponding tool call."),content:m(HW).default([]),structuredContent:q({}).loose().optional(),isError:V$().optional(),_meta:s(A(),D$()).optional()}),iw=Ev("type",[ZW,OW,AW]),bD=Ev("type",[ZW,OW,AW,Aw,xw]),fw=q({role:hv,content:X$([bD,m(bD)]),_meta:s(A(),D$()).optional()}),nw=xv.extend({messages:m(fw),modelPreferences:gw.optional(),systemPrompt:A().optional(),includeContext:M$(["none","thisServer","allServers"]).optional(),temperature:t().optional(),maxTokens:t().int(),stopSequences:m(A()).optional(),metadata:Z$.optional(),tools:m(SB).optional(),toolChoice:Cw.optional()}),_w=P$.extend({method:E("sampling/createMessage"),params:nw}),ov=b$.extend({model:A(),stopReason:J$(M$(["endTurn","stopSequence","maxTokens"]).or(A())),role:hv,content:iw}),jW=b$.extend({model:A(),stopReason:J$(M$(["endTurn","stopSequence","maxTokens","toolUse"]).or(A())),role:hv,content:X$([bD,m(bD)])}),yw=q({type:E("boolean"),title:A().optional(),description:A().optional(),default:V$().optional()}),lw=q({type:E("string"),title:A().optional(),description:A().optional(),minLength:t().optional(),maxLength:t().optional(),format:M$(["email","uri","date","date-time"]).optional(),default:A().optional()}),hw=q({type:M$(["number","integer"]),title:A().optional(),description:A().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),mw=q({type:E("string"),title:A().optional(),description:A().optional(),enum:m(A()),default:A().optional()}),rw=q({type:E("string"),title:A().optional(),description:A().optional(),oneOf:m(q({const:A(),title:A()})),default:A().optional()}),cw=q({type:E("string"),title:A().optional(),description:A().optional(),enum:m(A()),enumNames:m(A()).optional(),default:A().optional()}),dw=X$([mw,rw]),pw=q({type:E("array"),title:A().optional(),description:A().optional(),minItems:t().optional(),maxItems:t().optional(),items:q({type:E("string"),enum:m(A())}),default:m(A()).optional()}),tw=q({type:E("array"),title:A().optional(),description:A().optional(),minItems:t().optional(),maxItems:t().optional(),items:q({anyOf:m(q({const:A(),title:A()}))}),default:m(A()).optional()}),ow=X$([pw,tw]),aw=X$([cw,dw,ow]),ew=X$([aw,yw,lw,hw]),sw=xv.extend({mode:E("form").optional(),message:A(),requestedSchema:q({type:E("object"),properties:s(A(),ew),required:m(A()).optional()})}),$M=xv.extend({mode:E("url"),message:A(),elicitationId:A(),url:A().url()}),vM=X$([sw,$M]),UM=P$.extend({method:E("elicitation/create"),params:vM}),DM=U4.extend({elicitationId:A()}),XM=D4.extend({method:E("notifications/elicitation/complete"),params:DM}),H1=b$.extend({action:M$(["accept","decline","cancel"]),content:Cv(($)=>$===null?void 0:$,s(A(),X$([A(),t(),V$(),m(A())])).optional())}),GM=q({type:E("ref/resource"),uri:A()});var JM=q({type:E("ref/prompt"),name:A()}),QM=s$.extend({ref:X$([JM,GM]),argument:q({name:A(),value:A()}),context:q({arguments:s(A(),A()).optional()}).optional()}),IM=P$.extend({method:E("completion/complete"),params:QM});var WM=b$.extend({completion:w$({values:m(A()).max(100),total:J$(t().int()),hasMore:J$(V$())})}),zM=q({uri:A().startsWith("file://"),name:A().optional(),_meta:s(A(),D$()).optional()}),YM=P$.extend({method:E("roots/list"),params:s$.optional()}),wW=b$.extend({roots:m(zM)}),BM=D4.extend({method:E("notifications/roots/list_changed"),params:U4.optional()}),py=X$([uD,ED,IM,FW,dv,cv,mv,Xw,rv,zw,Bw,b6,pv,gD,xD,iD,nD]),ty=X$([TD,RD,LW,BM,lv]),oy=X$([kD,ov,jW,H1,wW,CD,fD,O1]),ay=X$([uD,_w,UM,YM,gD,xD,iD,nD]),ey=X$([TD,RD,uw,Lw,Iw,kw,Mw,lv,XM]),sy=X$([kD,oj,WM,ww,Zw,Dw,Gw,Qw,_D,qw,CD,fD,O1]);class x extends Error{constructor($,v,D){super(`MCP error ${$}: ${v}`);this.code=$,this.data=D,this.name="McpError"}static fromError($,v,D){if($===i.UrlElicitationRequired&&D){let X=D;if(X.elicitations)return new kB(X.elicitations,v)}return new x($,v,D)}}class kB extends x{constructor($,v=`URL elicitation${$.length>1?"s":""} required`){super(i.UrlElicitationRequired,v,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}class MW{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}
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 X6($,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 K=$.seen.get(I),L=K.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&&K.def)for(let Z in z){if(Z==="$ref"||Z==="allOf")continue;if(Z in K.def&&JSON.stringify(z[Z])===JSON.stringify(K.def[Z]))delete z[Z]}}let V=Q._zod.parent;if(V&&V!==I){X(V);let K=$.seen.get(V);if(K?.schema.$ref){if(z.$ref=K.schema.$ref,K.def)for(let L in z){if(L==="$ref"||L==="allOf")continue;if(L in K.def&&JSON.stringify(z[L])===JSON.stringify(K.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:Q1(v,"input",$.processors),output:Q1(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 j9=($,v={})=>(D)=>{let X=U6({...D,processors:v});return e($,X),D6(X,$),X6(X,$)},Q1=($,v,D={})=>(X)=>{let{libraryOptions:U,target:G}=X??{},J=U6({...U??{},target:G,io:v,processors:D});return e($,J),D6(J,$),X6(J,$)};var SA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},A9=($,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=SA[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}))]}},w9=($,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),K=v.target==="draft-04"||v.target==="openapi-3.0";if(I)if(K)U.minimum=Y,U.exclusiveMinimum=!0;else U.exclusiveMinimum=Y;else if(typeof G==="number")U.minimum=G;if(V)if(K)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},M9=($,v,D,X)=>{D.type="boolean"},P9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},b9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},q9=($,v,D,X)=>{if(v.target==="openapi-3.0")D.type="string",D.nullable=!0,D.enum=[null];else D.type="null"},S9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},k9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},E9=($,v,D,X)=>{D.not={}},T9=($,v,D,X)=>{},R9=($,v,D,X)=>{},g9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},C9=($,v,D,X)=>{let U=$._zod.def,G=s1(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},u9=($,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}},x9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},f9=($,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},_9=($,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)},i9=($,v,D,X)=>{D.type="boolean"},y9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},n9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},l9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},h9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},m9=($,v,D,X)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},c9=($,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"]})},r9=($,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"]})},pU=($,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},d9=($,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},p9=($,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,K)=>e(V,v,{...X,path:[...X.path,J,K]})),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},t9=($,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}},o9=($,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"}]},a9=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},e9=($,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))},s9=($,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))},$W=($,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},vW=($,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},UW=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType,D.readOnly=!0},DW=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},tU=($,v,D,X)=>{let U=$._zod.def;e(U.innerType,v,X);let G=v.seen.get($);G.ref=U.innerType},XW=($,v,D,X)=>{let U=$._zod.innerType;e(U,v,X);let G=v.seen.get($);G.ref=U},dU={string:A9,number:w9,boolean:M9,bigint:P9,symbol:b9,null:q9,undefined:S9,void:k9,never:E9,any:T9,unknown:R9,date:g9,enum:C9,literal:u9,nan:x9,template_literal:f9,file:_9,success:i9,custom:y9,function:n9,transform:l9,map:h9,set:m9,array:c9,object:r9,union:pU,intersection:d9,tuple:p9,record:t9,nullable:o9,nonoptional:a9,default:e9,prefault:s9,catch:$W,pipe:vW,readonly:UW,promise:DW,optional:tU,lazy:XW};function oU($,v){if("_idmap"in $){let X=$,U=U6({...v,processors:dU}),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;D6(U,Y),J[z]=X6(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=U6({...v,processors:dU});return e($,D),D6(D,$),X6(D,$)}class GW{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=U6({processors:dU,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}D6(this.ctx,$);let D=X6(this.ctx,$),{"~standard":X,...U}=D;return U}}var XI={};var wv={};C4(wv,{xor:()=>tI,xid:()=>FI,void:()=>cI,uuidv7:()=>VI,uuidv6:()=>II,uuidv4:()=>YI,uuid:()=>zI,url:()=>KI,unknown:()=>D$,union:()=>X$,undefined:()=>hI,ulid:()=>HI,uint64:()=>nI,uint32:()=>_I,tuple:()=>uW,transform:()=>wD,templateLiteral:()=>QV,symbol:()=>lI,superRefine:()=>Wz,success:()=>DV,stringbool:()=>LV,stringFormat:()=>TI,string:()=>H,strictObject:()=>pI,set:()=>sI,refine:()=>Qz,record:()=>s,readonly:()=>vz,promise:()=>WV,preprocess:()=>xv,prefault:()=>dW,pipe:()=>DD,partialRecord:()=>oI,optional:()=>J$,object:()=>q,number:()=>t,nullish:()=>UV,nullable:()=>Pv,null:()=>Sv,nonoptional:()=>pW,never:()=>AD,nativeEnum:()=>$V,nanoid:()=>NI,nan:()=>XV,meta:()=>VV,map:()=>eI,mac:()=>wI,looseRecord:()=>aI,looseObject:()=>w$,literal:()=>T,lazy:()=>Xz,ksuid:()=>jI,keyof:()=>dI,jwt:()=>EI,json:()=>BV,ipv6:()=>MI,ipv4:()=>AI,invertCodec:()=>JV,intersection:()=>B1,int64:()=>yI,int32:()=>fI,int:()=>UD,instanceof:()=>KV,httpUrl:()=>LI,hostname:()=>RI,hex:()=>gI,hash:()=>CI,guid:()=>WI,function:()=>zV,float64:()=>xI,float32:()=>uI,file:()=>vV,exactOptional:()=>lW,enum:()=>M$,emoji:()=>BI,email:()=>QI,e164:()=>kI,discriminatedUnion:()=>Rv,describe:()=>IV,date:()=>rI,custom:()=>bD,cuid2:()=>OI,cuid:()=>ZI,codec:()=>GV,cidrv6:()=>bI,cidrv4:()=>PI,check:()=>YV,catch:()=>aW,boolean:()=>K$,bigint:()=>iI,base64url:()=>SI,base64:()=>qI,array:()=>m,any:()=>mI,_function:()=>zV,_default:()=>cW,_ZodString:()=>XD,ZodXor:()=>TW,ZodXID:()=>ID,ZodVoid:()=>kW,ZodUnknown:()=>qW,ZodUnion:()=>Tv,ZodUndefined:()=>MW,ZodUUID:()=>S4,ZodURL:()=>qv,ZodULID:()=>YD,ZodType:()=>y,ZodTuple:()=>CW,ZodTransform:()=>yW,ZodTemplateLiteral:()=>Uz,ZodSymbol:()=>wW,ZodSuccess:()=>tW,ZodStringFormat:()=>U$,ZodString:()=>Y1,ZodSet:()=>fW,ZodRecord:()=>W1,ZodReadonly:()=>$z,ZodPromise:()=>Gz,ZodPreprocess:()=>sW,ZodPrefault:()=>rW,ZodPipe:()=>gv,ZodOptional:()=>MD,ZodObject:()=>Ev,ZodNumberFormat:()=>b6,ZodNumber:()=>V1,ZodNullable:()=>hW,ZodNull:()=>PW,ZodNonOptional:()=>PD,ZodNever:()=>SW,ZodNanoID:()=>QD,ZodNaN:()=>eW,ZodMap:()=>xW,ZodMAC:()=>AW,ZodLiteral:()=>_W,ZodLazy:()=>Dz,ZodKSUID:()=>VD,ZodJWT:()=>FD,ZodIntersection:()=>gW,ZodIPv6:()=>LD,ZodIPv4:()=>KD,ZodGUID:()=>Mv,ZodFunction:()=>Jz,ZodFile:()=>iW,ZodExactOptional:()=>nW,ZodEnum:()=>z1,ZodEmoji:()=>JD,ZodEmail:()=>GD,ZodE164:()=>HD,ZodDiscriminatedUnion:()=>RW,ZodDefault:()=>mW,ZodDate:()=>kv,ZodCustomStringFormat:()=>I1,ZodCustom:()=>uv,ZodCodec:()=>Cv,ZodCatch:()=>oW,ZodCUID2:()=>zD,ZodCUID:()=>WD,ZodCIDRv6:()=>ND,ZodCIDRv4:()=>BD,ZodBoolean:()=>K1,ZodBigIntFormat:()=>jD,ZodBigInt:()=>L1,ZodBase64URL:()=>OD,ZodBase64:()=>ZD,ZodArray:()=>EW,ZodAny:()=>bW});var aU={};C4(aU,{uppercase:()=>o6,trim:()=>U1,toUpperCase:()=>X1,toLowerCase:()=>D1,startsWith:()=>e6,slugify:()=>G1,size:()=>w6,regex:()=>p6,property:()=>rU,positive:()=>lU,overwrite:()=>I4,normalize:()=>v1,nonpositive:()=>mU,nonnegative:()=>cU,negative:()=>hU,multipleOf:()=>$6,minSize:()=>q4,minLength:()=>i4,mime:()=>$1,maxSize:()=>v6,maxLength:()=>M6,lte:()=>e$,lt:()=>P4,lowercase:()=>t6,length:()=>P6,includes:()=>a6,gte:()=>x$,gt:()=>b4,endsWith:()=>s6});var G6={};C4(G6,{time:()=>WW,duration:()=>zW,datetime:()=>JW,date:()=>QW,ZodISOTime:()=>$D,ZodISODuration:()=>vD,ZodISODateTime:()=>eU,ZodISODate:()=>sU});var eU=B("ZodISODateTime",($,v)=>{yJ.init($,v),U$.init($,v)});function JW($){return y8(eU,$)}var sU=B("ZodISODate",($,v)=>{nJ.init($,v),U$.init($,v)});function QW($){return n8(sU,$)}var $D=B("ZodISOTime",($,v)=>{lJ.init($,v),U$.init($,v)});function WW($){return l8($D,$)}var vD=B("ZodISODuration",($,v)=>{hJ.init($,v),U$.init($,v)});function zW($){return h8(vD,$)}var GI=($,v)=>{Xv.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(D)=>Jv($,D)},flatten:{value:(D)=>Gv($,D)},addIssue:{value:(D)=>{$.issues.push(D),$.message=JSON.stringify($.issues,_6,2)}},addIssues:{value:(D)=>{$.issues.push(...D),$.message=JSON.stringify($.issues,_6,2)}},isEmpty:{get(){return $.issues.length===0}}})},EA=B("ZodError",GI),h$=B("ZodError",GI,{Parent:Error});var YW=n6(h$),IW=l6(h$),VW=h6(h$),KW=c6(h$),LW=$U(h$),BW=vU(h$),NW=UU(h$),ZW=DU(h$),OW=XU(h$),HW=GU(h$),FW=JU(h$),jW=QU(h$);var JI=new WeakMap;function bv($,v,D){let X=Object.getPrototypeOf($),U=JI.get(X);if(!U)U=new Set,JI.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=B("ZodType",($,v)=>{return _.init($,v),Object.assign($["~standard"],{jsonSchema:{input:Q1($,"input"),output:Q1($,"output")}}),$.toJSONSchema=j9($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.parse=(D,X)=>YW($,D,X,{callee:$.parse}),$.safeParse=(D,X)=>VW($,D,X),$.parseAsync=async(D,X)=>IW($,D,X,{callee:$.parseAsync}),$.safeParseAsync=async(D,X)=>KW($,D,X),$.spa=$.safeParseAsync,$.encode=(D,X)=>LW($,D,X),$.decode=(D,X)=>BW($,D,X),$.encodeAsync=async(D,X)=>NW($,D,X),$.decodeAsync=async(D,X)=>ZW($,D,X),$.safeEncode=(D,X)=>OW($,D,X),$.safeDecode=(D,X)=>HW($,D,X),$.safeEncodeAsync=async(D,X)=>FW($,D,X),$.safeDecodeAsync=async(D,X)=>jW($,D,X),bv($,"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 C$(this,D,X)},brand(){return this},register(D,X){return D.add(this,X),this},refine(D,X){return this.check(Qz(D,X))},superRefine(D,X){return this.check(Wz(D,X))},overwrite(D){return this.check(I4(D))},optional(){return J$(this)},exactOptional(){return lW(this)},nullable(){return Pv(this)},nullish(){return J$(Pv(this))},nonoptional(D){return pW(this,D)},array(){return m(this)},or(D){return X$([this,D])},and(D){return B1(this,D)},transform(D){return DD(this,wD(D))},default(D){return cW(this,D)},prefault(D){return dW(this,D)},catch(D){return aW(this,D)},pipe(D){return DD(this,D)},readonly(){return vz(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}),$}),XD=B("_ZodString",($,v)=>{A6.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>A9($,X,U,G);let D=$._zod.bag;$.format=D.format??null,$.minLength=D.minimum??null,$.maxLength=D.maximum??null,bv($,"_ZodString",{regex(...X){return this.check(p6(...X))},includes(...X){return this.check(a6(...X))},startsWith(...X){return this.check(e6(...X))},endsWith(...X){return this.check(s6(...X))},min(...X){return this.check(i4(...X))},max(...X){return this.check(M6(...X))},length(...X){return this.check(P6(...X))},nonempty(...X){return this.check(i4(1,...X))},lowercase(X){return this.check(t6(X))},uppercase(X){return this.check(o6(X))},trim(){return this.check(U1())},normalize(...X){return this.check(v1(...X))},toLowerCase(){return this.check(D1())},toUpperCase(){return this.check(X1())},slugify(){return this.check(G1())}})}),Y1=B("ZodString",($,v)=>{A6.init($,v),XD.init($,v),$.email=(D)=>$.check(AU(GD,D)),$.url=(D)=>$.check(Av(qv,D)),$.jwt=(D)=>$.check(nU(FD,D)),$.emoji=(D)=>$.check(qU(JD,D)),$.guid=(D)=>$.check(jv(Mv,D)),$.uuid=(D)=>$.check(wU(S4,D)),$.uuidv4=(D)=>$.check(MU(S4,D)),$.uuidv6=(D)=>$.check(PU(S4,D)),$.uuidv7=(D)=>$.check(bU(S4,D)),$.nanoid=(D)=>$.check(SU(QD,D)),$.guid=(D)=>$.check(jv(Mv,D)),$.cuid=(D)=>$.check(kU(WD,D)),$.cuid2=(D)=>$.check(EU(zD,D)),$.ulid=(D)=>$.check(TU(YD,D)),$.base64=(D)=>$.check(_U(ZD,D)),$.base64url=(D)=>$.check(iU(OD,D)),$.xid=(D)=>$.check(RU(ID,D)),$.ksuid=(D)=>$.check(gU(VD,D)),$.ipv4=(D)=>$.check(CU(KD,D)),$.ipv6=(D)=>$.check(uU(LD,D)),$.cidrv4=(D)=>$.check(xU(BD,D)),$.cidrv6=(D)=>$.check(fU(ND,D)),$.e164=(D)=>$.check(yU(HD,D)),$.datetime=(D)=>$.check(JW(D)),$.date=(D)=>$.check(QW(D)),$.time=(D)=>$.check(WW(D)),$.duration=(D)=>$.check(zW(D))});function H($){return x8(Y1,$)}var U$=B("ZodStringFormat",($,v)=>{v$.init($,v),XD.init($,v)}),GD=B("ZodEmail",($,v)=>{TJ.init($,v),U$.init($,v)});function QI($){return AU(GD,$)}var Mv=B("ZodGUID",($,v)=>{kJ.init($,v),U$.init($,v)});function WI($){return jv(Mv,$)}var S4=B("ZodUUID",($,v)=>{EJ.init($,v),U$.init($,v)});function zI($){return wU(S4,$)}function YI($){return MU(S4,$)}function II($){return PU(S4,$)}function VI($){return bU(S4,$)}var qv=B("ZodURL",($,v)=>{RJ.init($,v),U$.init($,v)});function KI($){return Av(qv,$)}function LI($){return Av(qv,{protocol:a$.httpProtocol,hostname:a$.domain,...w.normalizeParams($)})}var JD=B("ZodEmoji",($,v)=>{gJ.init($,v),U$.init($,v)});function BI($){return qU(JD,$)}var QD=B("ZodNanoID",($,v)=>{CJ.init($,v),U$.init($,v)});function NI($){return SU(QD,$)}var WD=B("ZodCUID",($,v)=>{uJ.init($,v),U$.init($,v)});function ZI($){return kU(WD,$)}var zD=B("ZodCUID2",($,v)=>{xJ.init($,v),U$.init($,v)});function OI($){return EU(zD,$)}var YD=B("ZodULID",($,v)=>{fJ.init($,v),U$.init($,v)});function HI($){return TU(YD,$)}var ID=B("ZodXID",($,v)=>{_J.init($,v),U$.init($,v)});function FI($){return RU(ID,$)}var VD=B("ZodKSUID",($,v)=>{iJ.init($,v),U$.init($,v)});function jI($){return gU(VD,$)}var KD=B("ZodIPv4",($,v)=>{mJ.init($,v),U$.init($,v)});function AI($){return CU(KD,$)}var AW=B("ZodMAC",($,v)=>{rJ.init($,v),U$.init($,v)});function wI($){return _8(AW,$)}var LD=B("ZodIPv6",($,v)=>{cJ.init($,v),U$.init($,v)});function MI($){return uU(LD,$)}var BD=B("ZodCIDRv4",($,v)=>{dJ.init($,v),U$.init($,v)});function PI($){return xU(BD,$)}var ND=B("ZodCIDRv6",($,v)=>{pJ.init($,v),U$.init($,v)});function bI($){return fU(ND,$)}var ZD=B("ZodBase64",($,v)=>{oJ.init($,v),U$.init($,v)});function qI($){return _U(ZD,$)}var OD=B("ZodBase64URL",($,v)=>{aJ.init($,v),U$.init($,v)});function SI($){return iU(OD,$)}var HD=B("ZodE164",($,v)=>{eJ.init($,v),U$.init($,v)});function kI($){return yU(HD,$)}var FD=B("ZodJWT",($,v)=>{sJ.init($,v),U$.init($,v)});function EI($){return nU(FD,$)}var I1=B("ZodCustomStringFormat",($,v)=>{$Q.init($,v),U$.init($,v)});function TI($,v,D={}){return J1(I1,$,v,D)}function RI($){return J1(I1,"hostname",a$.hostname,$)}function gI($){return J1(I1,"hex",a$.hex,$)}function CI($,v){let D=v?.enc??"hex",X=`${$}_${D}`,U=a$[X];if(!U)throw Error(`Unrecognized hash format: ${X}`);return J1(I1,X,U,v)}var V1=B("ZodNumber",($,v)=>{NU.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>w9($,X,U,G),bv($,"ZodNumber",{gt(X,U){return this.check(b4(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(P4(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(UD(X))},safe(X){return this.check(UD(X))},positive(X){return this.check(b4(0,X))},nonnegative(X){return this.check(x$(0,X))},negative(X){return this.check(P4(0,X))},nonpositive(X){return this.check(e$(0,X))},multipleOf(X,U){return this.check($6(X,U))},step(X,U){return this.check($6(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 m8(V1,$)}var b6=B("ZodNumberFormat",($,v)=>{vQ.init($,v),V1.init($,v)});function UD($){return r8(b6,$)}function uI($){return d8(b6,$)}function xI($){return p8(b6,$)}function fI($){return t8(b6,$)}function _I($){return o8(b6,$)}var K1=B("ZodBoolean",($,v)=>{Kv.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>M9($,D,X,U)});function K$($){return a8(K1,$)}var L1=B("ZodBigInt",($,v)=>{ZU.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>P9($,X,U,G),$.gte=(X,U)=>$.check(x$(X,U)),$.min=(X,U)=>$.check(x$(X,U)),$.gt=(X,U)=>$.check(b4(X,U)),$.gte=(X,U)=>$.check(x$(X,U)),$.min=(X,U)=>$.check(x$(X,U)),$.lt=(X,U)=>$.check(P4(X,U)),$.lte=(X,U)=>$.check(e$(X,U)),$.max=(X,U)=>$.check(e$(X,U)),$.positive=(X)=>$.check(b4(BigInt(0),X)),$.negative=(X)=>$.check(P4(BigInt(0),X)),$.nonpositive=(X)=>$.check(e$(BigInt(0),X)),$.nonnegative=(X)=>$.check(x$(BigInt(0),X)),$.multipleOf=(X,U)=>$.check($6(X,U));let D=$._zod.bag;$.minValue=D.minimum??null,$.maxValue=D.maximum??null,$.format=D.format??null});function iI($){return s8(L1,$)}var jD=B("ZodBigIntFormat",($,v)=>{UQ.init($,v),L1.init($,v)});function yI($){return v9(jD,$)}function nI($){return U9(jD,$)}var wW=B("ZodSymbol",($,v)=>{DQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>b9($,D,X,U)});function lI($){return D9(wW,$)}var MW=B("ZodUndefined",($,v)=>{XQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>S9($,D,X,U)});function hI($){return X9(MW,$)}var PW=B("ZodNull",($,v)=>{GQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>q9($,D,X,U)});function Sv($){return G9(PW,$)}var bW=B("ZodAny",($,v)=>{JQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>T9($,D,X,U)});function mI(){return J9(bW)}var qW=B("ZodUnknown",($,v)=>{QQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>R9($,D,X,U)});function D$(){return Q9(qW)}var SW=B("ZodNever",($,v)=>{WQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>E9($,D,X,U)});function AD($){return W9(SW,$)}var kW=B("ZodVoid",($,v)=>{zQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>k9($,D,X,U)});function cI($){return z9(kW,$)}var kv=B("ZodDate",($,v)=>{YQ.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>g9($,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 rI($){return Y9(kv,$)}var EW=B("ZodArray",($,v)=>{IQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>c9($,D,X,U),$.element=v.element,bv($,"ZodArray",{min(D,X){return this.check(i4(D,X))},nonempty(D){return this.check(i4(1,D))},max(D,X){return this.check(M6(D,X))},length(D,X){return this.check(P6(D,X))},unwrap(){return this.element}})});function m($,v){return K9(EW,$,v)}function dI($){let v=$._zod.def.shape;return M$(Object.keys(v))}var Ev=B("ZodObject",($,v)=>{VQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>r9($,D,X,U),w.defineLazy($,"shape",()=>{return v.shape}),bv($,"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:AD()})},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(MD,this,D[0])},required(...D){return w.required(PD,this,D[0])}})});function q($,v){let D={type:"object",shape:$??{},...w.normalizeParams(v)};return new Ev(D)}function pI($,v){return new Ev({type:"object",shape:$,catchall:AD(),...w.normalizeParams(v)})}function w$($,v){return new Ev({type:"object",shape:$,catchall:D$(),...w.normalizeParams(v)})}var Tv=B("ZodUnion",($,v)=>{Lv.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>pU($,D,X,U),$.options=v.options});function X$($,v){return new Tv({type:"union",options:$,...w.normalizeParams(v)})}var TW=B("ZodXor",($,v)=>{Tv.init($,v),KQ.init($,v),$._zod.processJSONSchema=(D,X,U)=>pU($,D,X,U),$.options=v.options});function tI($,v){return new TW({type:"union",options:$,inclusive:!1,...w.normalizeParams(v)})}var RW=B("ZodDiscriminatedUnion",($,v)=>{Tv.init($,v),LQ.init($,v)});function Rv($,v,D){return new RW({type:"union",options:v,discriminator:$,...w.normalizeParams(D)})}var gW=B("ZodIntersection",($,v)=>{BQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>d9($,D,X,U)});function B1($,v){return new gW({type:"intersection",left:$,right:v})}var CW=B("ZodTuple",($,v)=>{OU.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>p9($,D,X,U),$.rest=(D)=>$.clone({...$._zod.def,rest:D})});function uW($,v,D){let X=v instanceof _,U=X?D:v;return new CW({type:"tuple",items:$,rest:X?v:null,...w.normalizeParams(U)})}var W1=B("ZodRecord",($,v)=>{NQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>t9($,D,X,U),$.keyType=v.keyType,$.valueType=v.valueType});function s($,v,D){if(!v||!v._zod)return new W1({type:"record",keyType:H(),valueType:$,...w.normalizeParams(v)});return new W1({type:"record",keyType:$,valueType:v,...w.normalizeParams(D)})}function oI($,v,D){let X=C$($);return X._zod.values=void 0,new W1({type:"record",keyType:X,valueType:v,...w.normalizeParams(D)})}function aI($,v,D){return new W1({type:"record",keyType:$,valueType:v,mode:"loose",...w.normalizeParams(D)})}var xW=B("ZodMap",($,v)=>{ZQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>h9($,D,X,U),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...D)=>$.check(q4(...D)),$.nonempty=(D)=>$.check(q4(1,D)),$.max=(...D)=>$.check(v6(...D)),$.size=(...D)=>$.check(w6(...D))});function eI($,v,D){return new xW({type:"map",keyType:$,valueType:v,...w.normalizeParams(D)})}var fW=B("ZodSet",($,v)=>{OQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>m9($,D,X,U),$.min=(...D)=>$.check(q4(...D)),$.nonempty=(D)=>$.check(q4(1,D)),$.max=(...D)=>$.check(v6(...D)),$.size=(...D)=>$.check(w6(...D))});function sI($,v){return new fW({type:"set",valueType:$,...w.normalizeParams(v)})}var z1=B("ZodEnum",($,v)=>{HQ.init($,v),y.init($,v),$._zod.processJSONSchema=(X,U,G)=>C9($,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 z1({...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 z1({...v,checks:[],...w.normalizeParams(U),entries:G})}});function M$($,v){let D=Array.isArray($)?Object.fromEntries($.map((X)=>[X,X])):$;return new z1({type:"enum",entries:D,...w.normalizeParams(v)})}function $V($,v){return new z1({type:"enum",entries:$,...w.normalizeParams(v)})}var _W=B("ZodLiteral",($,v)=>{FQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>u9($,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 T($,v){return new _W({type:"literal",values:Array.isArray($)?$:[$],...w.normalizeParams(v)})}var iW=B("ZodFile",($,v)=>{jQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>_9($,D,X,U),$.min=(D,X)=>$.check(q4(D,X)),$.max=(D,X)=>$.check(v6(D,X)),$.mime=(D,X)=>$.check($1(Array.isArray(D)?D:[D],X))});function vV($){return L9(iW,$)}var yW=B("ZodTransform",($,v)=>{AQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>l9($,D,X,U),$._zod.parse=(D,X)=>{if(X.direction==="backward")throw new H6($.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 wD($){return new yW({type:"transform",transform:$})}var MD=B("ZodOptional",($,v)=>{HU.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>tU($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function J$($){return new MD({type:"optional",innerType:$})}var nW=B("ZodExactOptional",($,v)=>{wQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>tU($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function lW($){return new nW({type:"optional",innerType:$})}var hW=B("ZodNullable",($,v)=>{MQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>o9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function Pv($){return new hW({type:"nullable",innerType:$})}function UV($){return J$(Pv($))}var mW=B("ZodDefault",($,v)=>{PQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>e9($,D,X,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function cW($,v){return new mW({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():w.shallowClone(v)}})}var rW=B("ZodPrefault",($,v)=>{bQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>s9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function dW($,v){return new rW({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():w.shallowClone(v)}})}var PD=B("ZodNonOptional",($,v)=>{qQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>a9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function pW($,v){return new PD({type:"nonoptional",innerType:$,...w.normalizeParams(v)})}var tW=B("ZodSuccess",($,v)=>{SQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>i9($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function DV($){return new tW({type:"success",innerType:$})}var oW=B("ZodCatch",($,v)=>{kQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>$W($,D,X,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function aW($,v){return new oW({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var eW=B("ZodNaN",($,v)=>{EQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>x9($,D,X,U)});function XV($){return V9(eW,$)}var gv=B("ZodPipe",($,v)=>{FU.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>vW($,D,X,U),$.in=v.in,$.out=v.out});function DD($,v){return new gv({type:"pipe",in:$,out:v})}var Cv=B("ZodCodec",($,v)=>{gv.init($,v),Bv.init($,v)});function GV($,v,D){return new Cv({type:"pipe",in:$,out:v,transform:D.decode,reverseTransform:D.encode})}function JV($){let v=$._zod.def;return new Cv({type:"pipe",in:v.out,out:v.in,transform:v.reverseTransform,reverseTransform:v.transform})}var sW=B("ZodPreprocess",($,v)=>{gv.init($,v),TQ.init($,v)}),$z=B("ZodReadonly",($,v)=>{RQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>UW($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function vz($){return new $z({type:"readonly",innerType:$})}var Uz=B("ZodTemplateLiteral",($,v)=>{gQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>f9($,D,X,U)});function QV($,v){return new Uz({type:"template_literal",parts:$,...w.normalizeParams(v)})}var Dz=B("ZodLazy",($,v)=>{xQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>XW($,D,X,U),$.unwrap=()=>$._zod.def.getter()});function Xz($){return new Dz({type:"lazy",getter:$})}var Gz=B("ZodPromise",($,v)=>{uQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>DW($,D,X,U),$.unwrap=()=>$._zod.def.innerType});function WV($){return new Gz({type:"promise",innerType:$})}var Jz=B("ZodFunction",($,v)=>{CQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>n9($,D,X,U)});function zV($){return new Jz({type:"function",input:Array.isArray($?.input)?uW($?.input):$?.input??m(D$()),output:$?.output??D$()})}var uv=B("ZodCustom",($,v)=>{fQ.init($,v),y.init($,v),$._zod.processJSONSchema=(D,X,U)=>y9($,D,X,U)});function YV($){let v=new G$({check:"custom"});return v._zod.check=$,v}function bD($,v){return B9(uv,$??(()=>!0),v)}function Qz($,v={}){return N9(uv,$,v)}function Wz($,v){return Z9($,v)}var IV=O9,VV=H9;function KV($,v={}){let D=new uv({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 LV=(...$)=>F9({Codec:Cv,Boolean:K1,String:Y1},...$);function BV($){let v=Xz(()=>{return X$([H($),t(),K$(),Sv(),m(v),s(H(),v)])});return v}function xv($,v){return new sW({type:"pipe",in:wD($),out:v})}var RA={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 gA($){V$({customError:$})}function CA(){return V$().customError}var zz;(function($){})(zz||(zz={}));var P={...wv,...aU,iso:G6},uA=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 xA($,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 fA($,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 NV($,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=fA(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 NV(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 K=E$(W[V],v),L=P.string().regex(new RegExp(V));Y.push(P.looseRecord(L,K))}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 K=2;K<I.length;K++)V=P.intersection(V,I[K]);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=NV($,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(!uA.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=xA(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 Yz={};C4(Yz,{string:()=>_A,number:()=>iA,date:()=>lA,boolean:()=>yA,bigint:()=>nA});function _A($){return f8(Y1,$)}function iA($){return c8(V1,$)}function yA($){return e8(K1,$)}function nA($){return $9(L1,$)}function lA($){return I9(kv,$)}V$(Nv());var Iz="2025-11-25",OV="2025-03-26",Z1=[Iz,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],J6="io.modelcontextprotocol/related-task",SD="2.0",Z$=bD(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),HV=X$([H(),t().int()]),FV=H(),dn=w$({ttl:t().optional(),pollInterval:t().optional()}),hA=q({ttl:t().optional()}),mA=q({taskId:H()}),Vz=w$({progressToken:HV.optional(),[J6]:mA.optional()}),s$=q({_meta:Vz.optional()}),fv=s$.extend({task:hA.optional()}),jV=($)=>fv.safeParse($).success,P$=q({method:H(),params:s$.loose().optional()}),U4=q({_meta:Vz.optional()}),D4=q({method:H(),params:U4.loose().optional()}),b$=w$({_meta:Vz.optional()}),kD=X$([H(),t().int()]),AV=q({jsonrpc:T(SD),id:kD,...P$.shape}).strict(),Q6=($)=>AV.safeParse($).success,wV=q({jsonrpc:T(SD),...D4.shape}).strict(),MV=($)=>wV.safeParse($).success,Kz=q({jsonrpc:T(SD),id:kD,result:b$}).strict(),n4=($)=>Kz.safeParse($).success;var f;(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"})(f||(f={}));var Lz=q({jsonrpc:T(SD),id:kD.optional(),error:q({code:t().int(),message:H(),data:D$().optional()})}).strict();var O1=($)=>Lz.safeParse($).success;var _v=X$([AV,wV,Kz,Lz]),pn=X$([Kz,Lz]),ED=b$.strict(),cA=U4.extend({requestId:kD.optional(),reason:H().optional()}),TD=D4.extend({method:T("notifications/cancelled"),params:cA}),rA=q({src:H(),mimeType:H().optional(),sizes:m(H()).optional(),theme:M$(["light","dark"]).optional()}),iv=q({icons:m(rA).optional()}),N1=q({name:H(),title:H().optional()}),PV=N1.extend({...N1.shape,...iv.shape,version:H(),websiteUrl:H().optional(),description:H().optional()}),dA=B1(q({applyDefaults:K$().optional()}),s(H(),D$())),pA=xv(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},B1(q({form:dA.optional(),url:Z$.optional()}),s(H(),D$()).optional())),tA=w$({list:Z$.optional(),cancel:Z$.optional(),requests:w$({sampling:w$({createMessage:Z$.optional()}).optional(),elicitation:w$({create:Z$.optional()}).optional()}).optional()}),oA=w$({list:Z$.optional(),cancel:Z$.optional(),requests:w$({tools:w$({call:Z$.optional()}).optional()}).optional()}),aA=q({experimental:s(H(),Z$).optional(),sampling:q({context:Z$.optional(),tools:Z$.optional()}).optional(),elicitation:pA.optional(),roots:q({listChanged:K$().optional()}).optional(),tasks:tA.optional(),extensions:s(H(),Z$).optional()}),eA=s$.extend({protocolVersion:H(),capabilities:aA,clientInfo:PV}),RD=P$.extend({method:T("initialize"),params:eA}),Bz=($)=>RD.safeParse($).success,sA=q({experimental:s(H(),Z$).optional(),logging:Z$.optional(),completions:Z$.optional(),prompts:q({listChanged:K$().optional()}).optional(),resources:q({subscribe:K$().optional(),listChanged:K$().optional()}).optional(),tools:q({listChanged:K$().optional()}).optional(),tasks:oA.optional(),extensions:s(H(),Z$).optional()}),$w=b$.extend({protocolVersion:H(),capabilities:sA,serverInfo:PV,instructions:H().optional()}),Nz=D4.extend({method:T("notifications/initialized"),params:U4.optional()});var gD=P$.extend({method:T("ping"),params:s$.optional()}),vw=q({progress:t(),total:J$(t()),message:J$(H())}),Uw=q({...U4.shape,...vw.shape,progressToken:HV}),CD=D4.extend({method:T("notifications/progress"),params:Uw}),Dw=s$.extend({cursor:FV.optional()}),yv=P$.extend({params:Dw.optional()}),nv=b$.extend({nextCursor:FV.optional()}),Xw=M$(["working","input_required","completed","failed","cancelled"]),lv=q({taskId:H(),status:Xw,ttl:X$([t(),Sv()]),createdAt:H(),lastUpdatedAt:H(),pollInterval:J$(t()),statusMessage:J$(H())}),H1=b$.extend({task:lv}),Gw=U4.merge(lv),hv=D4.extend({method:T("notifications/tasks/status"),params:Gw}),uD=P$.extend({method:T("tasks/get"),params:s$.extend({taskId:H()})}),xD=b$.merge(lv),fD=P$.extend({method:T("tasks/result"),params:s$.extend({taskId:H()})}),tn=b$.loose(),_D=yv.extend({method:T("tasks/list")}),iD=nv.extend({tasks:m(lv)}),yD=P$.extend({method:T("tasks/cancel"),params:s$.extend({taskId:H()})}),bV=b$.merge(lv),qV=q({uri:H(),mimeType:J$(H()),_meta:s(H(),D$()).optional()}),SV=qV.extend({text:H()}),Zz=H().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),kV=qV.extend({blob:Zz}),mv=M$(["user","assistant"]),F1=q({audience:m(mv).optional(),priority:t().min(0).max(1).optional(),lastModified:G6.datetime({offset:!0}).optional()}),EV=q({...N1.shape,...iv.shape,uri:H(),description:J$(H()),mimeType:J$(H()),size:J$(t()),annotations:F1.optional(),_meta:J$(w$({}))}),Jw=q({...N1.shape,...iv.shape,uriTemplate:H(),description:J$(H()),mimeType:J$(H()),annotations:F1.optional(),_meta:J$(w$({}))}),cv=yv.extend({method:T("resources/list")}),Qw=nv.extend({resources:m(EV)}),Ww=yv.extend({method:T("resources/templates/list")}),zw=nv.extend({resourceTemplates:m(Jw)}),Oz=s$.extend({uri:H()}),Yw=Oz,rv=P$.extend({method:T("resources/read"),params:Yw}),Iw=b$.extend({contents:m(X$([SV,kV]))}),Vw=D4.extend({method:T("notifications/resources/list_changed"),params:U4.optional()}),Kw=Oz,Lw=P$.extend({method:T("resources/subscribe"),params:Kw}),Bw=Oz,Nw=P$.extend({method:T("resources/unsubscribe"),params:Bw}),Zw=U4.extend({uri:H()}),Ow=D4.extend({method:T("notifications/resources/updated"),params:Zw}),Hw=q({name:H(),description:J$(H()),required:J$(K$())}),Fw=q({...N1.shape,...iv.shape,description:J$(H()),arguments:J$(m(Hw)),_meta:J$(w$({}))}),dv=yv.extend({method:T("prompts/list")}),jw=nv.extend({prompts:m(Fw)}),Aw=s$.extend({name:H(),arguments:s(H(),H()).optional()}),pv=P$.extend({method:T("prompts/get"),params:Aw}),Hz=q({type:T("text"),text:H(),annotations:F1.optional(),_meta:s(H(),D$()).optional()}),Fz=q({type:T("image"),data:Zz,mimeType:H(),annotations:F1.optional(),_meta:s(H(),D$()).optional()}),jz=q({type:T("audio"),data:Zz,mimeType:H(),annotations:F1.optional(),_meta:s(H(),D$()).optional()}),ww=q({type:T("tool_use"),name:H(),id:H(),input:s(H(),D$()),_meta:s(H(),D$()).optional()}),Mw=q({type:T("resource"),resource:X$([SV,kV]),annotations:F1.optional(),_meta:s(H(),D$()).optional()}),Pw=EV.extend({type:T("resource_link")}),Az=X$([Hz,Fz,jz,Pw,Mw]),bw=q({role:mv,content:Az}),qw=b$.extend({description:H().optional(),messages:m(bw)}),Sw=D4.extend({method:T("notifications/prompts/list_changed"),params:U4.optional()}),kw=q({title:H().optional(),readOnlyHint:K$().optional(),destructiveHint:K$().optional(),idempotentHint:K$().optional(),openWorldHint:K$().optional()}),Ew=q({taskSupport:M$(["required","optional","forbidden"]).optional()}),TV=q({...N1.shape,...iv.shape,description:H().optional(),inputSchema:q({type:T("object"),properties:s(H(),Z$).optional(),required:m(H()).optional()}).catchall(D$()),outputSchema:q({type:T("object"),properties:s(H(),Z$).optional(),required:m(H()).optional()}).catchall(D$()).optional(),annotations:kw.optional(),execution:Ew.optional(),_meta:s(H(),D$()).optional()}),tv=yv.extend({method:T("tools/list")}),Tw=nv.extend({tools:m(TV)}),nD=b$.extend({content:m(Az).default([]),structuredContent:s(H(),D$()).optional(),isError:K$().optional()}),on=nD.or(b$.extend({toolResult:D$()})),Rw=fv.extend({name:H(),arguments:s(H(),D$()).optional()}),q6=P$.extend({method:T("tools/call"),params:Rw}),gw=D4.extend({method:T("notifications/tools/list_changed"),params:U4.optional()}),an=q({autoRefresh:K$().default(!0),debounceMs:t().int().nonnegative().default(300)}),ov=M$(["debug","info","notice","warning","error","critical","alert","emergency"]),Cw=s$.extend({level:ov}),wz=P$.extend({method:T("logging/setLevel"),params:Cw}),uw=U4.extend({level:ov,logger:H().optional(),data:D$()}),xw=D4.extend({method:T("notifications/message"),params:uw}),fw=q({name:H().optional()}),_w=q({hints:m(fw).optional(),costPriority:t().min(0).max(1).optional(),speedPriority:t().min(0).max(1).optional(),intelligencePriority:t().min(0).max(1).optional()}),iw=q({mode:M$(["auto","required","none"]).optional()}),yw=q({type:T("tool_result"),toolUseId:H().describe("The unique identifier for the corresponding tool call."),content:m(Az).default([]),structuredContent:q({}).loose().optional(),isError:K$().optional(),_meta:s(H(),D$()).optional()}),nw=Rv("type",[Hz,Fz,jz]),qD=Rv("type",[Hz,Fz,jz,ww,yw]),lw=q({role:mv,content:X$([qD,m(qD)]),_meta:s(H(),D$()).optional()}),hw=fv.extend({messages:m(lw),modelPreferences:_w.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(TV).optional(),toolChoice:iw.optional()}),mw=P$.extend({method:T("sampling/createMessage"),params:hw}),av=b$.extend({model:H(),stopReason:J$(M$(["endTurn","stopSequence","maxTokens"]).or(H())),role:mv,content:nw}),Mz=b$.extend({model:H(),stopReason:J$(M$(["endTurn","stopSequence","maxTokens","toolUse"]).or(H())),role:mv,content:X$([qD,m(qD)])}),cw=q({type:T("boolean"),title:H().optional(),description:H().optional(),default:K$().optional()}),rw=q({type:T("string"),title:H().optional(),description:H().optional(),minLength:t().optional(),maxLength:t().optional(),format:M$(["email","uri","date","date-time"]).optional(),default:H().optional()}),dw=q({type:M$(["number","integer"]),title:H().optional(),description:H().optional(),minimum:t().optional(),maximum:t().optional(),default:t().optional()}),pw=q({type:T("string"),title:H().optional(),description:H().optional(),enum:m(H()),default:H().optional()}),tw=q({type:T("string"),title:H().optional(),description:H().optional(),oneOf:m(q({const:H(),title:H()})),default:H().optional()}),ow=q({type:T("string"),title:H().optional(),description:H().optional(),enum:m(H()),enumNames:m(H()).optional(),default:H().optional()}),aw=X$([pw,tw]),ew=q({type:T("array"),title:H().optional(),description:H().optional(),minItems:t().optional(),maxItems:t().optional(),items:q({type:T("string"),enum:m(H())}),default:m(H()).optional()}),sw=q({type:T("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()}),$M=X$([ew,sw]),vM=X$([ow,aw,$M]),UM=X$([vM,cw,rw,dw]),DM=fv.extend({mode:T("form").optional(),message:H(),requestedSchema:q({type:T("object"),properties:s(H(),UM),required:m(H()).optional()})}),XM=fv.extend({mode:T("url"),message:H(),elicitationId:H(),url:H().url()}),GM=X$([DM,XM]),JM=P$.extend({method:T("elicitation/create"),params:GM}),QM=U4.extend({elicitationId:H()}),WM=D4.extend({method:T("notifications/elicitation/complete"),params:QM}),j1=b$.extend({action:M$(["accept","decline","cancel"]),content:xv(($)=>$===null?void 0:$,s(H(),X$([H(),t(),K$(),m(H())])).optional())}),zM=q({type:T("ref/resource"),uri:H()});var YM=q({type:T("ref/prompt"),name:H()}),IM=s$.extend({ref:X$([YM,zM]),argument:q({name:H(),value:H()}),context:q({arguments:s(H(),H()).optional()}).optional()}),VM=P$.extend({method:T("completion/complete"),params:IM});var KM=b$.extend({completion:w$({values:m(H()).max(100),total:J$(t().int()),hasMore:J$(K$())})}),LM=q({uri:H().startsWith("file://"),name:H().optional(),_meta:s(H(),D$()).optional()}),BM=P$.extend({method:T("roots/list"),params:s$.optional()}),Pz=b$.extend({roots:m(LM)}),NM=D4.extend({method:T("notifications/roots/list_changed"),params:U4.optional()}),en=X$([gD,RD,VM,wz,pv,dv,cv,Ww,rv,Lw,Nw,q6,tv,uD,fD,_D,yD]),sn=X$([TD,CD,Nz,NM,hv]),$l=X$([ED,av,Mz,j1,Pz,xD,iD,H1]),vl=X$([gD,mw,JM,BM,uD,fD,_D,yD]),Ul=X$([TD,CD,xw,Ow,Vw,gw,Sw,hv,WM]),Dl=X$([ED,$w,KM,qw,jw,Qw,zw,Iw,nD,Tw,xD,iD,H1]);class x extends Error{constructor($,v,D){super(`MCP error ${$}: ${v}`);this.code=$,this.data=D,this.name="McpError"}static fromError($,v,D){if($===f.UrlElicitationRequired&&D){let X=D;if(X.elicitations)return new RV(X.elicitations,v)}return new x($,v,D)}}class RV extends x{constructor($,v=`URL elicitation${$.length>1?"s":""} required`){super(f.UrlElicitationRequired,v,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}class bz{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}
93
93
  data:
94
94
 
95
95
  `;if(this._retryInterval!==void 0)G=`id: ${U}
96
96
  retry: ${this._retryInterval}
97
97
  data:
98
98
 
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 I=$.headers.get("last-event-id");if(I)return this.replayEvents(I)}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:(I)=>{G=I},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,I)=>{if(!this.writeSSEEvent(U,X,I,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
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
100
  `;if(X)U+=`id: ${X}
101
101
  `;return U+=`data: ${JSON.stringify(D)}
102
102
 
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)=>iv.parse(Z));else J=[iv.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(VW);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 H=this.validateProtocolVersion($);if(H)return H}if(!J.some(J6)){for(let Z of J)this.onmessage?.(Z,{authInfo:v?.authInfo,requestInfo:U});return new Response(null,{status:202})}let W=crypto.randomUUID(),z=J.find((Z)=>VW(Z)),Y=z?z.params.protocolVersion:$.headers.get("mcp-protocol-version")??KB;if(this._enableJsonResponse)return new Promise((Z)=>{this._streamMapping.set(W,{resolveJson:Z,cleanup:()=>{this._streamMapping.delete(W)}});for(let H of J)if(J6(H))this._requestToStreamMapping.set(H.id,W);for(let H of J)this.onmessage?.(H,{authInfo:v?.authInfo,requestInfo:U})});let B=new TextEncoder,V,L=new ReadableStream({start:(Z)=>{V=Z},cancel:()=>{this._streamMapping.delete(W)}}),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(W,{controller:V,encoder:B,cleanup:()=>{this._streamMapping.delete(W);try{V.close()}catch{}}}),this._requestToStreamMapping.set(Z.id,W);await this.writePrimingEvent(V,B,W,Y);for(let Z of J){let H,S;if(J6(Z)&&this._eventStore&&Y>="2025-11-25")H=()=>{this.closeSSEStream(Z.id)},S=()=>{this.closeStandaloneSSEStream()};this.onmessage?.(Z,{authInfo:v?.authInfo,requestInfo:U,closeSSEStream:H,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&&!N1.includes(v))return this.onerror?.(Error(`Bad Request: Unsupported protocol version: ${v} (supported versions: ${N1.join(", ")})`)),this.createJsonErrorResponse(400,-32000,`Bad Request: Unsupported protocol version: ${v} (supported versions: ${N1.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(_4($)||Z1($))D=$.id;if(D===void 0){if(_4($)||Z1($))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(_4($)||Z1($)){this._requestResponseMap.set(D,$);let G=Array.from(this._requestToStreamMapping.entries()).filter(([Q,I])=>I===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 I=G.map((W)=>this._requestResponseMap.get(W));if(I.length===1)U.resolveJson(new Response(JSON.stringify(I[0]),{status:200,headers:Q}));else U.resolveJson(new Response(JSON.stringify(I),{status:200,headers:Q}))}else U.cleanup();for(let Q of G)this._requestResponseMap.delete(Q),this._requestToStreamMapping.delete(Q)}}}}var PW="/.well-known/oauth-protected-resource",VM={"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 TB($,v,D,X){if($.method==="OPTIONS")return new Response(null,{status:204});if($.method==="GET"&&X.has(v.pathname)){let U=v.pathname.slice(37);return F1(200,{resource:`${D.publicOrigin}${U}`,authorization_servers:[D.authorizationServerIssuer],bearer_methods_supported:["header"]})}return null}function bW($,v,D=""){let X=[...v?[`error="${v}"`]:[],`resource_metadata="${$.publicOrigin}/.well-known/oauth-protected-resource${D}"`];return new Response(JSON.stringify({error:v??"unauthorized"}),{status:401,headers:{"www-authenticate":`Bearer ${X.join(", ")}`,"content-type":"application/json"}})}function EB($){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 uB($){let v=new Headers($.headers);for(let[D,X]of Object.entries(VM))v.set(D,X);return new Response($.body,{status:$.status,statusText:$.statusText,headers:v})}function RB($,v){let D=$.headers.get("cf-connecting-ip")??$.headers.get("x-forwarded-for")??"unknown";return v?[`ip:${D}`,`tok:${v}`]:[`ip:${D}`]}class gB{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 CB($){let v=async(D,X)=>{let U=await fetch(D,X);if(U.status===401)$.onUnauthorized?.();return U};return{session:new gB($.token,$.userId),trpc:p4($.trpcUrl,async()=>$.token,{fetch:v})}}function j1($){return!!$._zod}function Q6($,v){if(j1($))return h6($,v);return $.safeParse(v)}function yD($){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 xB($){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 I6($){return $==="completed"||$==="failed"||$==="cancelled"}var LM=Symbol("Let zodToJsonSchema decide on which parser to use");var hl=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qW($){let D=yD($)?.method;if(!D)throw Error("Schema is missing a method literal");let X=xB(D);if(typeof X!=="string")throw Error("Schema method literal must be a string");return X}function SW($,v){let D=Q6($,v);if(!D.success)throw D.error;return D.data}var HM=60000;class kW{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(TD,(v)=>{this._oncancel(v)}),this.setNotificationHandler(RD,(v)=>{this._onprogress(v)}),this.setRequestHandler(uD,(v)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(gD,async(v,D)=>{let X=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!X)throw new x(i.InvalidParams,"Failed to retrieve task: Task not found");return{...X}}),this.setRequestHandler(xD,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,I=Q.id,W=this._requestResolvers.get(I);if(W)if(this._requestResolvers.delete(I),J.type==="response")W(Q);else{let z=Q,Y=new x(z.error.code,z.error.message,z.error.data);W(Y)}else{let z=J.type==="response"?"Response":"Error";this._onerror(Error(`${z} handler missing for request ${I}`))}continue}await this._transport?.send(J.message,{relatedRequestId:D.requestId})}}let G=await this._taskStore.getTask(U,D.sessionId);if(!G)throw new x(i.InvalidParams,`Task not found: ${U}`);if(!I6(G.status))return await this._waitForTaskUpdate(U,D.signal),await X();if(I6(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(iD,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 x(i.InvalidParams,`Failed to list tasks: ${X instanceof Error?X.message:String(X)}`)}}),this.setRequestHandler(nD,async(v,D)=>{try{let X=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!X)throw new x(i.InvalidParams,`Task not found: ${v.params.taskId}`);if(I6(X.status))throw new x(i.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 x(i.InvalidParams,`Task not found after cancellation: ${v.params.taskId}`);return{_meta:{},...U}}catch(X){if(X instanceof x)throw X;throw new x(i.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($),x.fromError(i.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),_4(U)||Z1(U))this._onresponse(U);else if(J6(U))this._onrequest(U,G);else if(FB(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=x.fromError(i.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 W={jsonrpc:"2.0",id:$.id,error:{code:i.MethodNotFound,message:"Method not found"}};if(U&&this._taskMessageQueue)this._enqueueTaskMessage(U,{type:"error",message:W,timestamp:Date.now()},X?.sessionId).catch((z)=>this._onerror(Error(`Failed to enqueue error response: ${z}`)));else X?.send(W).catch((z)=>this._onerror(Error(`Failed to send an error response: ${z}`)));return}let G=new AbortController;this._requestHandlerAbortControllers.set($.id,G);let J=OB($.params)?$.params.task:void 0,Q=this._taskStore?this.requestTaskStore($,X?.sessionId):void 0,I={signal:G.signal,sessionId:X?.sessionId,_meta:$.params?._meta,sendNotification:async(W)=>{if(G.signal.aborted)return;let z={relatedRequestId:$.id};if(U)z.relatedTask={taskId:U};await this.notification(W,z)},sendRequest:async(W,z,Y)=>{if(G.signal.aborted)throw new x(i.ConnectionClosed,"Request was cancelled");let B={...Y,relatedRequestId:$.id};if(U&&!B.relatedTask)B.relatedTask={taskId:U};let V=B.relatedTask?.taskId??U;if(V&&Q)await Q.updateTaskStatus(V,"input_required");return await this.request(W,z,B)},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($,I)).then(async(W)=>{if(G.signal.aborted)return;let z={result:W,jsonrpc:"2.0",id:$.id};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"response",message:z,timestamp:Date.now()},X?.sessionId);else await X?.send(z)},async(W)=>{if(G.signal.aborted)return;let z={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(W.code)?W.code:i.InternalError,message:W.message??"Internal error",...W.data!==void 0&&{data:W.data}}};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"error",message:z,timestamp:Date.now()},X?.sessionId);else await X?.send(z)}).catch((W)=>this._onerror(Error(`Failed to send response: ${W}`))).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),_4($))D($);else{let G=new x($.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(_4($)&&$.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(_4($))X($);else{let G=x.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 x?G:new x(i.InternalError,String(G))}}return}let U;try{let G=await this.request($,O1,D);if(G.task)U=G.task.taskId,yield{type:"taskCreated",task:G.task};else throw new x(i.InternalError,"Task creation did not return a task");while(!0){let J=await this.getTask({taskId:U},D);if(yield{type:"taskStatus",task:J},I6(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 x(i.InternalError,`Task ${U} failed`)};else if(J.status==="cancelled")yield{type:"error",error:new x(i.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((I)=>setTimeout(I,Q)),D?.signal?.throwIfAborted()}}catch(G){yield{type:"error",error:G instanceof x?G:new x(i.InternalError,String(G))}}}request($,v,D){let{relatedRequestId:X,resumptionToken:U,onresumptiontoken:G,task:J,relatedTask:Q}=D??{};return new Promise((I,W)=>{let z=(H)=>{W(H)};if(!this._transport){z(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),J)this.assertTaskCapability($.method)}catch(H){z(H);return}D?.signal?.throwIfAborted();let Y=this._requestMessageId++,B={...$,jsonrpc:"2.0",id:Y};if(D?.onprogress)this._progressHandlers.set(Y,D.onprogress),B.params={...$.params,_meta:{...$.params?._meta||{},progressToken:Y}};if(J)B.params={...B.params,task:J};if(Q)B.params={...B.params,_meta:{...B.params?._meta||{},[G6]:Q}};let V=(H)=>{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(H)}},{relatedRequestId:X,resumptionToken:U,onresumptiontoken:G}).catch((R)=>this._onerror(Error(`Failed to send cancellation: ${R}`)));let S=H instanceof x?H:new x(i.RequestTimeout,String(H));W(S)};this._responseHandlers.set(Y,(H)=>{if(D?.signal?.aborted)return;if(H instanceof Error)return W(H);try{let S=Q6(v,H.result);if(!S.success)W(S.error);else I(S.data)}catch(S){W(S)}}),D?.signal?.addEventListener("abort",()=>{V(D?.signal?.reason)});let L=D?.timeout??HM,N=()=>V(x.fromError(i.RequestTimeout,"Request timed out",{timeout:L}));this._setupTimeout(Y,L,D?.maxTotalTimeout,N,D?.resetTimeoutOnProgress??!1);let Z=Q?.taskId;if(Z){let H=(S)=>{let R=this._responseHandlers.get(Y);if(R)R(S);else this._onerror(Error(`Response handler missing for side-channeled request ${Y}`))};this._requestResolvers.set(Y,H),this._enqueueTaskMessage(Z,{type:"request",message:B,timestamp:Date.now()}).catch((S)=>{this._cleanupTimeout(Y),W(S)})}else this._transport.send(B,{relatedRequestId:X,resumptionToken:U,onresumptiontoken:G}).catch((H)=>{this._cleanupTimeout(Y),W(H)})})}async getTask($,v){return this.request({method:"tasks/get",params:$},CD,v)}async getTaskResult($,v,D){return this.request({method:"tasks/result",params:$},v,D)}async listTasks($,v){return this.request({method:"tasks/list",params:$},fD,v)}async cancelTask($,v){return this.request({method:"tasks/cancel",params:$},wB,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=qW($);this.assertRequestHandlerCapability(D),this._requestHandlers.set(D,(X,U)=>{let G=SW($,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=qW($);this._notificationHandlers.set(D,(X)=>{let U=SW($,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 x(i.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 x(i.InvalidRequest,"Request cancelled"));return}let G=setTimeout(X,D);v.addEventListener("abort",()=>{clearTimeout(G),U(new x(i.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 x(i.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=lv.parse({method:"notifications/tasks/status",params:J});if(await this.notification(Q),I6(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 x(i.InvalidParams,`Task "${X}" not found - it may have been cleaned up`);if(I6(J.status))throw new x(i.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 I=lv.parse({method:"notifications/tasks/status",params:Q});if(await this.notification(I),I6(Q.status))this._cleanupTaskProgressHandler(X)}},listTasks:(X)=>{return D.listTasks(X,v)}}}}function iB($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function fB($,v){let D={...$};for(let X in v){let U=X,G=v[U];if(G===void 0)continue;let J=D[U];if(iB(J)&&iB(G))D[U]={...J,...G};else D[U]=G}return D}var HZ=H5(Mz(),1),FZ=H5(AZ(),1);function lu(){let $=new HZ.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return FZ.default($),$}class gz{constructor($){this._ajv=$??lu()}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 Cz{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((W)=>W.type==="tool_result"),J=$.messages.length>1?$.messages[$.messages.length-2]:void 0,Q=J?Array.isArray(J.content)?J.content:[J.content]:[],I=Q.some((W)=>W.type==="tool_use");if(G){if(U.some((W)=>W.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!I)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(I){let W=new Set(Q.filter((Y)=>Y.type==="tool_use").map((Y)=>Y.id)),z=new Set(U.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")}}return this.requestStream({method:"sampling/createMessage",params:$},ov,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 jZ($,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 wZ($,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 kW{constructor($,v){super(v);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(tv.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 gz,this.setRequestHandler(ED,(D)=>this._oninitialize(D)),this.setNotificationHandler(LW,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(FW,async(D,X)=>{let U=X.sessionId||X.requestInfo?.headers["mcp-session-id"]||void 0,{level:G}=D.params,J=tv.safeParse(G);if(J.success)this._loggingLevels.set(U,J.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new Cz(this)};return this._experimental}registerCapabilities($){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=fB(this._capabilities,$)}setRequestHandler($,v){let X=yD($)?.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,I)=>{let W=Q6(b6,Q);if(!W.success){let V=W.error instanceof Error?W.error.message:String(W.error);throw new x(i.InvalidParams,`Invalid tools/call request: ${V}`)}let{params:z}=W.data,Y=await Promise.resolve(v(Q,I));if(z.task){let V=Q6(O1,Y);if(!V.success){let L=V.error instanceof Error?V.error.message:String(V.error);throw new x(i.InvalidParams,`Invalid task creation result: ${L}`)}return V.data}let B=Q6(_D,Y);if(!B.success){let V=B.error instanceof Error?B.error.message:String(B.error);throw new x(i.InvalidParams,`Invalid tools/call result: ${V}`)}return B.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($){wZ(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;jZ(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let v=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:N1.includes(v)?v:WW,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"},kD)}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((I)=>I.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((I)=>I.type==="tool_use");if(U){if(X.some((I)=>I.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 I=new Set(J.filter((z)=>z.type==="tool_use").map((z)=>z.id)),W=new Set(X.filter((z)=>z.type==="tool_result").map((z)=>z.toolUseId));if(I.size!==W.size||![...I].every((z)=>W.has(z)))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:$},jW,v);return this.request({method:"sampling/createMessage",params:$},ov,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 x(i.InvalidParams,`Elicitation response content does not match requested schema: ${J.errorMessage}`)}catch(G){if(G instanceof x)throw G;throw new x(i.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:$},wW,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 xz=[{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","create_account"],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 MZ(){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 xz)$.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 MX=["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 iz($={}){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, list_accounts, create_account, create_trade, update_trade, close_trade, delete_trade, delete_trades, import_trades, trade_stats"," • 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"," • Broker execution: propose_trade creates a user-confirmed intent; execute_trade only applies to email_otp/app_otp/auto intents. For push intents, do not ask for a code — use trade_intent_status to check the app approval outcome.","","Deletion rule:"," • delete_trade and delete_trades are permanent and only work on demo accounts. Live-account trade deletes are blocked by the backend.","","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.",MX,"","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 fz(){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:MZ()})}]}function hu($){return{...$.broker===void 0?{}:{broker:$.broker},...$.accountType===void 0?{}:{accountType:$.accountType},...$.initialBalance===void 0?{}:{initialBalance:$.initialBalance},...$.currency===void 0?{}:{currency:$.currency},...$.notes===void 0?{}:{notes:$.notes},...$.defaultRiskAmount===void 0?{}:{defaultRiskAmount:$.defaultRiskAmount}}}function mu($){return{name:$.name,...hu($)}}function PZ($){return $.trading.accounts.list.query()}function bZ($,v){return $.trading.accounts.create.mutate(mu(v))}function nz($){return{triggerType:$.triggerType??"close",isPersistent:$.isPersistent??!1,notifyEmail:$.notifyEmail??!0,notifyPush:$.notifyPush??!0,...$.message===void 0?{}:{message:$.message},...$.expiresAt===void 0?{}:{expiresAt:$.expiresAt}}}function qZ($){return{...$.includeArchived===void 0?{}:{includeArchived:$.includeArchived},...$.pair===void 0?{}:{pair:$.pair}}}function ru($){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 cu($){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 SZ($,v){return $.alerts.list.query(qZ(v))}function kZ($,v){let D={pair:v.pair,timeframe:v.timeframe,price:v.price,condition:v.condition,...nz(v)};return $.alerts.createPrice.mutate(D)}function TZ($,v){let D={pair:v.pair,timeframe:v.timeframe,price1:v.price1,time1:v.time1,price2:v.price2,time2:v.time2,condition:v.condition,...nz(v)};return $.alerts.createTrendline.mutate(D)}function EZ($,v){return $.alerts.update.mutate(ru(v))}function uZ($,v){return $.alerts.delete.mutate({id:v.id})}function RZ($,v){let D=qZ(v);return $.alerts.indicator.list.query(D)}function gZ($,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",...nz(v)};return $.alerts.indicator.create.mutate(D)}function CZ($,v){return $.alerts.indicator.update.mutate(cu(v))}function xZ($,v){return $.alerts.indicator.delete.mutate({id:v.id})}function du($){return{accountId:$.accountId,region:$.region,providerAccountRef:$.providerAccountRef,providerToken:$.providerToken,...$.provider===void 0?{}:{provider:$.provider},...$.approvalMode===void 0?{}:{approvalMode:$.approvalMode}}}function _z($){return{accountId:$.accountId}}function pu($){return{accountId:$.accountId,approvalMode:$.approvalMode,...$.totpCode===void 0?{}:{totpCode:$.totpCode}}}function tu($){return{accountId:$.accountId,symbol:$.symbol,direction:$.direction,stopLoss:$.stopLoss,...$.orderType===void 0?{}:{orderType:$.orderType},...$.entryPrice===void 0?{}:{entryPrice:$.entryPrice},...$.takeProfit===void 0?{}:{takeProfit:$.takeProfit},...$.riskPercent===void 0?{}:{riskPercent:$.riskPercent},...$.riskAmount===void 0?{}:{riskAmount:$.riskAmount}}}function ou($){return{intentId:$.intentId,...$.code===void 0?{}:{code:$.code}}}function au($){return{intentId:$.intentId}}function eu($){return{intentId:$.intentId}}function su($){return{accountId:$.accountId,positionId:$.positionId,...$.volume===void 0?{}:{volume:$.volume}}}function $R($){return{accountId:$.accountId,positionId:$.positionId,...$.stopLoss===void 0?{}:{stopLoss:$.stopLoss},...$.takeProfit===void 0?{}:{takeProfit:$.takeProfit}}}function iZ($,v){return $.execution.connect.mutate(du(v))}function fZ($,v){return $.execution.status.query(_z(v))}function nZ($,v){return $.execution.setApprovalMode.mutate(pu(v))}function _Z($,v){return $.execution.account.query(_z(v))}function yZ($,v){return $.execution.positions.query(_z(v))}function lZ($,v){return $.execution.propose.mutate(tu(v))}function hZ($,v){return $.execution.execute.mutate(ou(v))}function mZ($,v){return $.execution.cancel.mutate(au(v))}function rZ($,v){return $.execution.intentStatus.query(eu(v))}function cZ($,v){return $.execution.closePosition.mutate(su(v))}function dZ($,v){return $.execution.modifyPosition.mutate($R(v))}function vR($){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 pZ($,v){return $.technicalIndicators.get.query(vR(v))}var tZ=["3m","6m","12m","24m","all"];function UR($){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 DR($){return{currency:$.currency,indicator:$.indicator,...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to},...$.limit===void 0?{}:{limit:$.limit}}}function XR($){return{currency:$.currency,indicator:$.indicator,...$.range===void 0?{}:{range:$.range}}}function GR($){return{pair:$.pair,timeframe:$.timeframe,...$.limit===void 0?{}:{limit:$.limit},...$.offset===void 0?{}:{offset:$.offset}}}function PX($,v){return $.marketData.candles.query(GR(v))}function oZ($,v){return $.marketData.listCalendar.query(UR(v))}function aZ($,v){return $.marketData.listIndicatorSeries.query(DR(v))}function eZ($,v){return $.macroIndicator.list.query(XR(v))}function sZ($){return $.marketData.getConfig.query()}function JR($){return{...$.accountId===void 0?{}:{accountId:$.accountId},...$.pair===void 0?{}:{pair:$.pair},...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to}}}function $O($,v){return $.trading.analytics.stats.query(JR(v))}function QR($){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 vO($){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 IR($){return{accountId:$.accountId,pair:$.pair,direction:$.direction,entryPrice:$.entryPrice,entryTime:$.entryTime,...vO($)}}function WR($){return{id:$.id,...$.pair===void 0?{}:{pair:$.pair},...$.direction===void 0?{}:{direction:$.direction},...$.entryPrice===void 0?{}:{entryPrice:$.entryPrice},...$.entryTime===void 0?{}:{entryTime:$.entryTime},...vO($)}}function zR($){return{id:$.id,exitPrice:$.exitPrice,exitTime:$.exitTime,...$.fees===void 0?{}:{fees:$.fees},...$.swap===void 0?{}:{swap:$.swap},...$.notes===void 0?{}:{notes:$.notes}}}function YR($){return{accountId:$.accountId,status:$.status}}function BR($){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 VR($){return{accountId:$.accountId,trades:$.trades.map(BR)}}function UO($,v){return $.trading.trades.list.query(QR(v))}function DO($,v){return $.trading.trades.get.query({id:v.id})}function XO($,v){return $.trading.trades.create.mutate(IR(v))}function GO($,v){return $.trading.trades.update.mutate(WR(v))}function JO($,v){return $.trading.trades.close.mutate(zR(v))}function QO($,v){return $.trading.trades.delete.mutate({id:v.id})}function IO($,v){return $.trading.trades.deleteMany.mutate(YR(v))}function WO($,v){return $.trading.trades.importMany.mutate(VR(v))}function T($){return $}var yz='Not signed in to Aether Wealth. Call the "login" tool to authenticate, then retry.';async function u($){if(!await $.session.getAccessToken())throw Error(yz)}var zO={type:"integer",minimum:1,maximum:200,description:"Max rows to return"},YO={type:"integer",minimum:1,description:"Page number (1-indexed)"};function bX($,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=LR($,D)??KR($,D);return X?{ok:!1,reason:X}:{ok:!0,args:D}}function LR($,v){for(let D of $.required??[])if(!(D in v)||v[D]===void 0||v[D]===null)return`missing required: ${D}`;return null}function KR($,v){if($.additionalProperties!==!1)return null;for(let D of Object.keys(v))if(!(D in $.properties))return`unknown property: ${D}`;return null}var lz={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"}},qX=[T({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 u(v),SZ(v.trpc,$)}}),T({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:lz,...j0},required:["pair","timeframe","price","condition"],additionalProperties:!1},handler:async($,v)=>{return await u(v),kZ(v.trpc,$)}}),T({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:lz,...j0},required:["pair","timeframe","price1","time1","price2","time2","condition"],additionalProperties:!1},handler:async($,v)=>{return await u(v),TZ(v.trpc,$)}}),T({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:lz,timeframe:{type:"string"},isActive:{type:"boolean"},isArchived:{type:"boolean"},...j0},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await u(v),EZ(v.trpc,$)}}),T({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 u(v),uZ(v.trpc,$)}}),T({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 u(v),RZ(v.trpc,$)}}),T({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 u(v),gZ(v.trpc,$)}}),T({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 u(v),CZ(v.trpc,$)}}),T({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 u(v),xZ(v.trpc,$)}})];var SX=[T({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."}}}),T({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}}},NR=[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")],ZR=[{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 OR=[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)],AR=[{id:"NAS100",displayName:"Nasdaq 100",kind:"index",exchange:"NASDAQ",region:"US",category:"Indices",pipSize:0.01,priceDecimals:2,contractSize:20,providers:{twelvedata:"QQQ"}}],HR=[{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 T4($,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 FR=[{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"}},T4("RELIANCE","RELIANCE:NSE","Reliance Industries"),T4("TCS","TCS:NSE","Tata Consultancy Services"),T4("HDFCBANK","HDFCBANK:NSE","HDFC Bank"),T4("INFY","INFY:NSE","Infosys"),T4("ICICIBANK","ICICIBANK:NSE","ICICI Bank"),T4("BHARTIARTL","BHARTIARTL:NSE","Bharti Airtel"),T4("LT","LT:NSE","Larsen & Toubro"),T4("SBIN","SBIN:NSE","State Bank of India"),T4("AXISBANK","AXISBANK:NSE","Axis Bank"),T4("KOTAKBANK","KOTAKBANK:NSE","Kotak Mahindra Bank")],kX=Object.freeze([...NR,...ZR,...OR,...AR,...HR,...FR]);class w0{byKey;instruments;providerNames;constructor($){this.instruments=Object.freeze([...$]);let v=new Map,D=new Set;for(let X of $){if(hz(v,X.id,X,"id"),X.displayName!==X.id)hz(v,X.displayName,X,"displayName");for(let[U,G]of Object.entries(X.providers))if(D.add(U),hz(v,BO(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(BO($,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 BO($,v){return`${$}:${v}`}function hz($,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 wR=["forex","metal","crypto","index","commodity","stock","bond"],MR=r.object({kind:r.enum(wR),displayName:r.string().min(1).optional(),exchange:r.string().min(1).optional(),region:r.string().min(1).optional(),category:r.string().min(1).optional(),pipSize:r.number().positive().optional(),priceDecimals:r.number().int().min(0).max(12).optional(),contractSize:r.number().positive().optional(),providers:r.record(r.string().min(1),r.string().min(1))}),qp=r.record(r.string().min(1),MR).refine(($)=>Object.keys($).length>0,{message:"INSTRUMENTS must contain at least one entry"});var PR=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 mz($,v){return Number(v.toFixed($.priceDecimals))}var R$="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif",rz=11,cz=15,dz=11,pz=13,VO=12,TX=17,LO=26,KO=0.85,NO=20,ZO=8,OO=64,AO=26,x1=18,EX=16,HO=20,FO=300,tz=120,jO=1280,wO=720,MO=2,PO=!0,bO=320,qO=2560,SO=240,kO=1440,TO=1,EO=3,uX={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"}},oz=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function uO($,v){if(!Number.isFinite(v))return"0.00000";if(!$)return v.toFixed(5);return mz($,v).toFixed($.priceDecimals)}function RO($,v,D){let X=new Date(v*1000);if(kR($)){if(D===void 0||RR(D,v))return ER(X);return TR(X)}return uR(X)}function kR($){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 M0($,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 TR($){return`${RX($.getUTCHours())}:${RX($.getUTCMinutes())}`}function ER($){return`${RX($.getUTCDate())} ${oz[$.getUTCMonth()]}`}function uR($){return`${RX($.getUTCDate())} ${oz[$.getUTCMonth()]} '${String($.getUTCFullYear()).slice(-2)}`}function RR($,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 RX($){return String($).padStart(2,"0")}var gO="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 CO($){return $.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function Y$($){return`<line${f1($)} />`}function H$($){return`<rect${f1($)} />`}function p$($,v){return`<text${f1(v)}>${CO($)}</text>`}function xO($){return`<image${f1($)} />`}function iO($,v){let D=$.map((X)=>`${az(X.x)},${az(X.y)}`).join(" ");return`<polygon${f1({...v,points:D})} />`}function o($,v={}){if($.length===0)return"";return`<g${f1(v)}>${$}</g>`}function fO($,v,D){return[`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${v}" viewBox="0 0 ${$} ${v}" fill="none">`,D,"</svg>"].join("")}function i1($,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}="${az(X)}"`;if(typeof X==="string")return`${D}="${CO(X)}"`;return""}).filter((D)=>D.length>0).join(" ");return v.length>0?` ${v}`:""}function az($){let v=Math.round($*100)/100;return Number.isInteger(v)?String(v):v.toFixed(2)}var gX=16,gR=9,CR=12,xR=8,iR=8;function nO($,v){let D=[],X=$.plotLeft,U=$.instrument?.displayName??$.pair;D.push(p$(U,{x:X,y:gX,fill:v.headerText,"font-size":cz,"font-weight":700,"letter-spacing":0.2,"font-family":R$})),X+=i1(U,cz)+gR;let G=$.timeframe,J=i1(G,dz)+iR*2,Q=gX-TX+4;D.push(H$({x:X,y:Q,width:J,height:TX,rx:4,fill:v.badgeBg})),D.push(p$(G,{x:X+J/2,y:Q+TX/2+0.5,fill:v.badgeText,"font-size":dz,"font-weight":600,"text-anchor":"middle","dominant-baseline":"middle","font-family":R$})),X+=J+CR;let I=$.visibleCandles,W=I[I.length-1].close,z=I[0].open,Y=W-z,B=z===0?null:Y/z*100,V=Y>=0?v.upCandle:v.downCandle,L=$.formatPrice(W);D.push(p$(L,{x:X,y:gX,fill:V,"font-size":pz,"font-weight":600,"font-family":R$})),X+=i1(L,pz)+xR;let N=$.instrument?.priceDecimals??5;return D.push(p$(M0(Y,B,N),{x:X,y:gX,fill:V,"font-size":VO,"font-weight":500,"font-family":R$})),o(D.join(""))}function _O($,v){if(!v)return"";let D=LO;return xO({href:gO,x:$.plotRight-D-8,y:$.plotBottom-D-8,width:D,height:D,opacity:KO})}var fR=["price","priceHigh","priceLow","price1","price2","entry","stop","target"];function lO($,v){let D=$.candles.slice(-$.bars),X=ZO,U=NO,G=Math.max(X+1,$.width-OO),J=Math.max(U+1,$.height-AO),Q=G-X,I=J-U,W=Q/Math.max(1,D.length),z=Math.min(...D.map((a)=>a.low)),Y=Math.max(...D.map((a)=>a.high)),B=Y-z,V=B>0?B*0.06:Math.max(Math.abs(Y)*0.006,0.000001),L=z-V,N=Y+V,Z=Math.max(N-L,0.000001),H=B>0?Math.max(Z,B/0.6):Z,S=hR($.shapes),R=S.length>0?Math.min(...S):Number.POSITIVE_INFINITY,C=S.length>0?Math.max(...S):Number.NEGATIVE_INFINITY,k=Number.isFinite(R)&&R<L?L-R:0,N$=Number.isFinite(C)&&C>N?C-N:0,F$=Math.max(0,H-Z),u4=k+N$,Q4=L,_$=N;if(u4<=F$)Q4-=k,_$+=N$;else if(k>0&&N$===0)Q4-=Math.min(k,F$);else if(N$>0&&k===0)_$+=Math.min(N$,F$);else if(u4>0){let a=F$/u4;Q4-=k*a,_$+=N$*a}let l1=Math.max(_$-Q4,0.000001),h1=dR(D),m1=D.length-1;function b0(a){return U+(_$-a)/l1*I}function MA(a){if(!Number.isFinite(a))return{y:J,clamped:!0,edge:"bottom"};if(a>_$)return{y:U,clamped:!0,edge:"top"};if(a<Q4)return{y:J,clamped:!0,edge:"bottom"};return{y:b0(a),clamped:!1,edge:null}}function oX(a){return X+(a+0.5)*W}function K5(a){return lR(D,m1,h1,a)}function N5(a){return oX(K5(a))}function Z5(a){return m1-a}function PA(a,O5,SA){let A5=rR(a,O5);if(A5!==void 0)return N5(A5);let kA=cR(a,O5)??SA;return oX(Z5(kA))}function bA(a=6){return nR(Q4,_$,a)}function qA(a=7){return yR(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:I,slot:W,visibleCandles:D,instrument:v,priceRange:{min:Q4,max:_$,candleMin:z,candleMax:Y},averageSpacing:h1,formatPrice(a){return uO(v,a)},priceToY:b0,projectPrice:MA,indexToX:oX,timeToIndex:K5,timeToX:N5,barsBackToIndex:Z5,resolveEndpointX:PA,nicePriceTicks:bA,niceTimeTickIndices:qA}}var yO=3;function nR($,v,D=6){let X=pR($,v,D),U=Math.ceil($/X)*X,G=Math.floor(v/X)*X,J=tR(X),Q=[];if(G>=U){let I=Math.round((G-U)/X);for(let W=0;W<=I;W+=1)Q.push(Number((U+W*X).toFixed(J+2)))}if(Q.length<yO)return _R($,v,yO+2);return Q}function _R($,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 yR($,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 mR($,v,X)}function hR($){let v=[];for(let D of $)for(let X of fR){let U=D[X];if(typeof U==="number"&&Number.isFinite(U))v.push(U)}return v}function mR($,v,D){let X=0,U=v;while(X<=U){let z=Math.floor((X+U)/2),Y=$[z];if(Y.time===D)return z;if(Y.time<D)X=z+1;else U=z-1}let G=Math.min(v,X),J=Math.max(0,G-1),Q=$[J],W=$[G].time-Q.time;if(W<=0)return J;return J+(D-Q.time)/W}function rR($,v){if(v==="start")return $.time1??$.entryTime;return $.time2}function cR($,v){if(v==="start")return $.barsBack1;return $.barsBack2}function dR($){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 pR($,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],I=U,W=Number.POSITIVE_INFINITY;for(let z of J){let Y=10**z;for(let B of Q){let V=B*Y,L=Math.ceil($/V),N=Math.floor(v/V),Z=N>=L?N-L+1:1,H=Math.abs(Z-D);if(H<W)W=H,I=V}}return I}function tR($){let v=0,D=$;while(v<10&&Math.abs(Math.round(D)-D)>0.00000001)D*=10,v+=1;return v}function N6($){return uX[$]}function hO($,v){let D=N6($.theme),X=oR($.nicePriceTicks(),$.formatPrice),U=$.niceTimeTickIndices(),G=[],J=[],Q=$.visibleCandles[$.visibleCandles.length-1],I=$.priceToY(Q.close),W=Q.close>=Q.open?D.upCandle:D.downCandle,z=$.formatPrice(Q.close);for(let N of X){let Z=$.priceToY(N);G.push(Y$({x1:$.plotLeft,y1:Math.round(Z)+0.5,x2:$.plotRight,y2:Math.round(Z)+0.5,stroke:D.grid,"stroke-width":1}));let H=$.formatPrice(N);if(H!==z)J.push(p$(H,{x:$.width-6,y:Z,fill:D.text,"font-size":rz,"font-family":R$,"text-anchor":"end","dominant-baseline":"middle"}))}for(let N of U){let Z=$.visibleCandles[N];if(!Z)continue;let H=$.indexToX(N),R=(N>0?$.visibleCandles[N-1]:void 0)?.time;G.push(Y$({x1:Math.round(H)+0.5,y1:$.plotTop,x2:Math.round(H)+0.5,y2:$.plotBottom,stroke:D.grid,"stroke-width":1})),J.push(p$(RO($.timeframe,Z.time,R),{x:H,y:$.height-8,fill:D.text,"font-size":rz,"font-family":R$,"text-anchor":"middle"}))}J.push(Y$({x1:Math.round($.plotRight)+0.5,y1:$.plotTop,x2:Math.round($.plotRight)+0.5,y2:$.plotBottom,stroke:D.axisBorder,"stroke-width":1})),J.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(I)+0.5,x2:$.plotRight,y2:Math.round(I)+0.5,stroke:W,"stroke-width":1,"stroke-dasharray":"4 4"}),B={y:I,label:$.formatPrice(Q.close),fill:W,height:x1},V=nO($,D),L=_O($,v);return{gridSvg:o(G.join(""),{"shape-rendering":"crispEdges"}),axesSvg:J.join(""),lastPriceSvg:Y,lastPriceTag:B,headerSvg:V,watermarkSvg:L}}function oR($,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 mO($){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,I=$.priceToY(U.high),W=$.priceToY(U.low),z=$.priceToY(U.open),Y=$.priceToY(U.close),B=Math.min(z,Y),V=Math.max(z,Y),L=Math.max(1,Math.round(V-B)),N=Math.round(J-v/2),Z=Math.round(B);D.push(Y$({x1:Q,y1:Math.round(I)+0.5,x2:Q,y2:Math.round(W)+0.5,stroke:G,"stroke-width":1})),D.push(H$({x:N,y:Z,width:v,height:L,fill:G}))}return o(D.join(""),{"shape-rendering":"crispEdges"})}function rO($,v){if(v.length===0)return"";let D=N6($.theme);return aR(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}),p$(U.label,{x:$.width-6,y:U.y,fill:D.tagText,"font-size":U.height>=x1?11:10,"font-family":R$,"font-weight":600,"text-anchor":"end","dominant-baseline":"middle"})].join(""),{"shape-rendering":"crispEdges"})).join("")}function aR($,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],I=X[J],W=Q.y+(Q.height+I.height)/2;if(I.y<W)I.y=W}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],I=X[J],W=Q.y-(Q.height+I.height)/2;if(I.y>W)I.y=W}}let G=X[0];if(G.y<v)G.y=v;return X}function ez($){let v=$2($.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:cO($.width,jO,bO,qO),height:cO($.height,wO,SO,kO),bars:eR($.bars??tz),scale:sR($.scale),watermark:$.watermark??PO,...$.fontFiles?{fontFiles:$.fontFiles}:{}}}function eR($){if(!Number.isFinite($))return tz;return sz(Math.round($),HO,FO)}function sR($){if($===void 0||!Number.isFinite($)||$<=0)return MO;return sz($,TO,EO)}function cO($,v,D,X){if($===void 0||!Number.isFinite($)||$<=0)return v;return sz(Math.round($),D,X)}function sz($,v,D){return Math.min(D,Math.max(v,$))}function $2($){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 v2}from"node:module";var U2=v2(import.meta.url);function dO($,v,D,X){let{Resvg:U}=D2();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 D2(){try{return U2("@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 X2={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"},G2={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 J2=["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 P0($){if(typeof $!=="string")return null;let v=$.trim().toLowerCase();return X2[v]??null}function oO($){return`Unknown shape type: "${String($)}". Supported types: ${J2.join(", ")}`}function $5($){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 Q2($){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=$5($[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 I2($){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 v5($,v,D){Z4($,v,D===void 0?void 0:Math.trunc(D))}function W2($,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=Q2($.side)}function z2($){return t$($,["level","y","value","priceLevel","linePrice"])??E4($,"point1",["price","y","value"])??E4($,"from",["price","y","value"])}function pO($,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 tO($,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 Y2($){Z4($,"price",z2($)),Z4($,"priceHigh",t$($,["high","upper","top","max","priceTop","priceUpper"])),Z4($,"priceLow",t$($,["low","lower","bottom","min","priceBottom","priceLower"])),Z4($,"price1",pO($,"start")),Z4($,"price2",pO($,"end"))}function B2($){v5($,"time1",tO($,"start")),v5($,"time2",tO($,"end")),Z4($,"barsBack1",t$($,["barsBack","barBack","lookback","bars"])),Z4($,"barsBack2",t$($,["barsBackEnd","barBackEnd","lookbackEnd"]))}function V2($){Z4($,"entry",t$($,["entryPrice","open","openPrice"])),Z4($,"stop",t$($,["stopLoss","sl","stopPrice"])),Z4($,"target",t$($,["takeProfit","tp","targetPrice","tpPrice"])),v5($,"entryTime",t$($,["entryTimestamp"]))}function L2($){let v=$5($.priceHigh),D=$5($.priceLow);if(v!==void 0&&D!==void 0&&v<D)$.priceHigh=D,$.priceLow=v}function aO($){if(typeof $!=="object"||$===null||Array.isArray($))return $;let v={...$},D=I2(v),X=P0(D);if(X)v.type=X;return W2(v,D),Y2(v),B2(v),V2(v),L2(v),v}function eO($){return G2[$].required}var K2=r.object({type:r.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:r.coerce.number().optional().describe("Price level (required for horizontal_line, horizontal_ray, cross_line)"),priceHigh:r.coerce.number().optional().describe("Upper price boundary (required for zone/rectangle)"),priceLow:r.coerce.number().optional().describe("Lower price boundary (required for zone/rectangle)"),price1:r.coerce.number().optional().describe("First point price (required for trendline/ray/right_ray/left_ray/extended_line/info_line/trend_angle)"),price2:r.coerce.number().optional().describe("Second point price (required for trendline/ray/right_ray/left_ray/extended_line/info_line/trend_angle)"),time1:r.number().int().optional().describe("Absolute time (epoch seconds) of the first endpoint for trendline/rays or anchor for vertical_line. PREFERRED over barsBack1."),time2:r.number().int().optional().describe("Absolute time (epoch seconds) of the second endpoint (trendline/rays) or right edge of a zone. PREFERRED over barsBack2."),barsBack1:r.number().optional().describe("FALLBACK only — bars back from the current bar for first endpoint/anchor (trendline, rays, vertical_line). Use time1 when possible."),barsBack2:r.number().optional().describe("FALLBACK only — bars back from the current bar for second endpoint / zone right edge. Use time2 when possible."),direction:r.enum(["long","short"]).optional().describe('Position direction (required for position): "long" or "short"'),entry:r.coerce.number().optional().describe("Entry price (required for position)"),stop:r.coerce.number().optional().describe("Stop-loss price (required for position)"),target:r.coerce.number().optional().describe("Take-profit price (required for position)"),entryTime:r.number().int().optional().describe("Absolute time (epoch seconds) for the position entry anchor. Defaults to the current bar."),label:r.string().optional().describe('Label text, e.g. "Support", "Resistance", "Demand Zone", "Long EURCHF"'),color:r.string().optional().describe('Color hex, e.g. "#22c55e" green, "#ef4444" red, "#3b82f6" blue')}).superRefine(($,v)=>{let D=P0($.type);if(!D){v.addIssue({code:"custom",message:oO($.type),path:["type"]});return}for(let X of eO(D))if($[X.field]===void 0)v.addIssue({code:"custom",message:X.message,path:[X.field]})}),sO=r.preprocess(aO,K2),mt=r.object({shapes:r.array(sO).min(1)});function $A($){let v=[],D=[];for(let[X,U]of $.entries()){let G=sO.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 W$($,v,D,X){let U=$.projectPrice(D);if(!U.clamped||U.edge===null)return"";let G=N6($.theme),J=z$(v,$.plotLeft+10,$.plotRight-10),Q=U.edge==="top"?$.plotTop+4:$.plotBottom-4,I=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}],W=U.edge==="top"?Q+16:Q-10;return o([iO(I,{fill:X}),p$($.formatPrice(D),{x:J,y:W,fill:G.markerText,"font-size":10,"font-family":R$,"text-anchor":"middle"})].join(""))}function U5($,v,D,X,U){let G=i1(D,10)+10;return o([H$({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":R$})].join(""),{"shape-rendering":"crispEdges"})}function O4($,v,D,X,U="start"){return p$(D,{x:$,y:v,fill:X,"font-size":10,"font-family":R$,"text-anchor":U})}function z$($,v,D){return Math.min(D,Math.max(v,$))}var UA="price out of visible range (clamped)";function D5($,v){if(v.type==="zone")return N2($,v);if(v.type==="rectangle")return Z2($,v);return O$(v,`Unsupported area shape: ${v.type}`)}function N2($,v){let D=DA($,v,"zone");if(D.kind==="error")return D.fragments;let X=o$(v,"#3b82f6"),U=z$(D.top+12,$.plotTop+12,$.plotBottom-6),G=(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:X,"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:X,"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:X,"stroke-width":1}),v.label?O4(D.left+4,U,v.label,X):"",W$($,G,D.highPrice,X),W$($,G,D.lowPrice,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?UA:void 0)}function Z2($,v){let D=DA($,v,"rectangle");if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=z$(D.top+12,$.plotTop+12,$.plotBottom-6),G=(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:X,"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:X,"stroke-width":1}),v.label?O4(D.left+4,U,v.label,X):"",W$($,G,D.highPrice,X),W$($,G,D.lowPrice,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?UA:void 0)}function DA($,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"&&!vA(v)?$.plotLeft:z$($.resolveEndpointX(v,"start",24),$.plotLeft,$.plotRight),I=D==="zone"&&!vA(v)?$.plotRight:z$($.resolveEndpointX(v,"end",4),$.plotLeft,$.plotRight),W=Math.min(G.y,J.y),z=Math.max(G.y,J.y);return{kind:"ok",left:Math.min(Q,I),right:Math.max(Q,I),top:W,bottom:z,highPrice:X,lowPrice:U,clamped:G.clamped||J.clamped}}function vA($){return $.time1!==void 0||$.time2!==void 0||$.barsBack1!==void 0||$.barsBack2!==void 0}function CX($,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 XA($,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:CX(D,$,v)}}}function GA($,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:CX(D,$,v)}}}function JA($,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:CX(D,$,v)},end:{x:X,y:CX(X,$,v)}}}function X5($,v){return{x:($.x+v.x)/2,y:($.y+v.y)/2}}var n1="price out of visible range (clamped)";function J4($,v){switch(v.type){case"horizontal_line":return O2($,v);case"horizontal_ray":return A2($,v);case"vertical_line":return H2($,v);case"cross_line":return F2($,v);case"trendline":return j2($,v);case"ray":case"right_ray":return w2($,v);case"left_ray":return M2($,v);case"extended_line":return P2($,v);case"info_line":return b2($,v);case"trend_angle":return q2($,v);default:return O$(v,`Unsupported line shape: ${v.type}`)}}function O2($,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=[Y$({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,z$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,X):"",W$($,$.plotRight-12,D,X)].join("");return $4(v,{lineSvg:o(G,{"shape-rendering":"crispEdges"}),gutterTags:[{y:U.y,label:$.formatPrice(D),fill:X,height:x1}]},U.clamped?n1:void 0)}function A2($,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=z$(G+4,$.plotLeft+4,$.plotRight-60);return $4(v,{lineSvg:o([Y$({x1:z$(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,z$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,X):"",W$($,G,D,X)].join(""),{"shape-rendering":"crispEdges"})},U.clamped?n1:void 0)}function H2($,v){let D=o$(v,"#f59e0b"),X=$.resolveEndpointX(v,"start",0),U=z$(X,$.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?O4(U+4,$.plotTop+12,v.label,D):""].join(""),{"shape-rendering":"crispEdges"})})}function F2($,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=z$($.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:X,"stroke-width":1,"stroke-dasharray":"4 4"}),Y$({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,z$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,X):"",W$($,G,D,X)].join(""),{"shape-rendering":"crispEdges"})},U.clamped?n1:void 0)}function j2($,v){let D=_1($,v,"trendline");if(D.kind==="error")return D.fragments;return S2($,v,D.first,D.second,"#f59e0b","4 4")}function w2($,v){let D=_1($,v,v.type);if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=XA(D.first,D.second,$.plotRight);return xX($,v,U.start,U.end,X,"4 4",[W$($,D.first.x,D.price1,X),W$($,D.second.x,D.price2,X)])}function M2($,v){let D=_1($,v,"left_ray");if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=GA(D.first,D.second,$.plotLeft);return xX($,v,U.start,U.end,X,"4 4",[W$($,D.first.x,D.price1,X),W$($,D.second.x,D.price2,X)])}function P2($,v){let D=_1($,v,"extended_line");if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=JA(D.first,D.second,$.plotLeft,$.plotRight,$.plotTop,$.plotBottom);return xX($,v,U.start,U.end,X,"4 4",[W$($,D.first.x,D.price1,X),W$($,D.second.x,D.price2,X)])}function b2($,v){let D=_1($,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} · ${M0(U,G,J)}`:M0(U,G,J),I=X5(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:X,"stroke-width":1}),U5(z$(I.x-30,$.plotLeft+2,$.plotRight-120),z$(I.y-6,$.plotTop+12,$.plotBottom-12),Q,X,"#FFFFFF"),W$($,D.first.x,D.price1,X),W$($,D.second.x,D.price2,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?n1:void 0)}function q2($,v){let D=_1($,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=X5(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:X,"stroke-width":1}),U5(z$(J.x-26,$.plotLeft+2,$.plotRight-100),z$(J.y-6,$.plotTop+12,$.plotBottom-12),G,X,"#FFFFFF"),W$($,D.first.x,D.price1,X),W$($,D.second.x,D.price2,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?n1:void 0)}function S2($,v,D,X,U,G){let J=o$(v,U);return xX($,v,D,X,J,G,[W$($,D.x,k$(v.price1)??0,J),W$($,X.x,k$(v.price2)??0,J)])}function xX($,v,D,X,U,G,J){let Q=z$(X.x+4,$.plotLeft+4,$.plotRight-70),I=z$(X.y-4,$.plotTop+12,$.plotBottom-4),W=k$(v.price1),z=k$(v.price2),Y=W!==void 0&&$.projectPrice(W).clamped||z!==void 0&&$.projectPrice(z).clamped;return $4(v,{lineSvg:o([Y$({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,I,v.label,U):"",...J].join(""),{"shape-rendering":"crispEdges"})},Y?n1:void 0)}function _1($,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:z$($.resolveEndpointX(v,"start",50),$.plotLeft,$.plotRight),y:G.y},I={x:z$($.resolveEndpointX(v,"end",0),$.plotLeft,$.plotRight),y:J.y};return{kind:"ok",first:Q,second:I,price1:X,price2:U,clamped:G.clamped||J.clamped}}var k2="price out of visible range (clamped)";function QA($,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=z$($.resolveEndpointX(v,"start",0),$.plotLeft,$.plotRight),Q=$.projectPrice(D),I=$.projectPrice(X),W=$.projectPrice(U),z=Math.min(Q.y,W.y),Y=Math.max(Q.y,W.y),B=Math.min(Q.y,I.y),V=Math.max(Q.y,I.y),L=z$(Math.min(z,B)+12,$.plotTop+12,$.plotBottom-8),N=Q.clamped||I.clamped||W.clamped;return $4(v,{positionSvg:o([H$({x:J,y:z,width:$.plotRight-J,height:Y-z,fill:"#10b981","fill-opacity":0.12}),H$({x:J,y:B,width:$.plotRight-J,height:V-B,fill:"#ef4444","fill-opacity":0.12}),Y$({x1:J,y1:Math.round(Q.y)+0.5,x2:$.plotRight,y2:Math.round(Q.y)+0.5,stroke:G.entryTag,"stroke-width":1}),Y$({x1:J,y1:Math.round(I.y)+0.5,x2:$.plotRight,y2:Math.round(I.y)+0.5,stroke:"#ef4444","stroke-width":1}),Y$({x1:J,y1:Math.round(W.y)+0.5,x2:$.plotRight,y2:Math.round(W.y)+0.5,stroke:"#10b981","stroke-width":1}),v.label?O4(J+4,L,v.label,G.text):"",W$($,J,D,G.entryTag),W$($,J,X,"#ef4444"),W$($,J,U,"#10b981")].join(""),{"shape-rendering":"crispEdges"}),gutterTags:[{y:Q.y,label:`Entry ${$.formatPrice(D)}`,fill:G.entryTag,height:EX},{y:I.y,label:`SL ${$.formatPrice(X)}`,fill:"#ef4444",height:EX},{y:W.y,label:`TP ${$.formatPrice(U)}`,fill:"#10b981",height:EX}]},N?k2:void 0)}var T2={horizontal_line:J4,horizontal_ray:J4,vertical_line:J4,cross_line:J4,zone:D5,rectangle:D5,trendline:J4,ray:J4,right_ray:J4,left_ray:J4,extended_line:J4,info_line:J4,trend_angle:J4,position:QA};function IA($,v){let D=[],X=[],U=[],G=[],J=[],Q=[],I=0,W=0;for(let z of v){let Y=E2($,z);if(D.push(Y.underlaySvg),X.push(Y.lineSvg),U.push(Y.positionSvg),G.push(Y.chromeSvg),J.push(...Y.gutterTags),Q.push(Y.report),Y.report.ok)I+=1;else W+=1}return{underlaySvg:D.join(""),lineSvg:X.join(""),positionSvg:U.join(""),chromeSvg:G.join(""),gutterTags:J,reports:Q,drawn:I,skipped:W}}function E2($,v){let D=P0(v.type);if(!D)return O$(v,`Unknown shape type: ${String(v.type)}`);let X=T2[D];if(!X)return O$(v,`Unsupported shape type: ${D}`);let U=D===v.type?v:{...v,type:D};return X($,U)}var G5;function WA($){let v=ez($),D=u2(v.pair),X=lO(v,D),U=uX[v.theme],G=IA(X,v.shapes),J=hO(X,v.watermark),Q=`plot-clip-${C2(X)}`,I=`<defs><clipPath id="${Q}">${H$({x:X.plotLeft,y:X.plotTop,width:X.plotWidth,height:X.plotHeight})}</clipPath></defs>`,W={"clip-path":`url(#${Q})`},z=o(J.gridSvg,W),Y=o(G.underlaySvg,W),B=o(mO(X),W),V=o(G.lineSvg,W),L=o(G.positionSvg,W),N=rO(X,[...G.gutterTags,J.lastPriceTag]);return{svg:fO(X.width,X.height,[H$({x:0,y:0,width:X.width,height:X.height,fill:U.background}),I,z,Y,B,V,L,J.axesSvg,G.chromeSvg,J.lastPriceSvg,N,J.headerSvg,J.watermarkSvg,g2()].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 J5($){let v=WA($),D=ez($);return{...v,png:dO(v.svg,v.width,D.scale,D.fontFiles)}}function u2($){return R2().resolve($)}function R2(){if(G5===void 0)G5=new w0([...kX]);return G5}function g2(){return`<style>text{font-family:${R$};white-space:pre}</style>`}function C2($){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 zA=120,Q5=20,I5=200;function x2($,v,D){return Math.max(v,Math.min(D,$))}var i2="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*.",f2="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).",iX=[T({name:"render_chart",description:i2,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:f2,items:{type:"object"}},bars:{type:"integer",minimum:Q5,maximum:I5,description:`Most-recent candles to show (${Q5}-${I5}, default ${zA})`},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 u(v);let D=x2($.bars??zA,Q5,I5),{candles:X}=await PX(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}=$A($.shapes??[]),J=J5({pair:$.pair,timeframe:$.timeframe,candles:X,shapes:U,bars:D,...$.theme?{theme:$.theme}:{},...$.width?{width:$.width}:{},...$.height?{height:$.height}:{}}),Q=J.shapes.filter((Y)=>!Y.ok),I=[...G.map((Y)=>`shape ${Y.index}: ${Y.reason}`),...Q.map((Y)=>`${Y.type}: ${Y.reason??"undrawable"}`)],W=I.length>0?` (${I.length} skipped)
107
- Skipped: ${I.join("; ")}`:"",z=`Rendered ${$.pair} ${$.timeframe} — ${X.length} candles, drew ${J.drawn} shape${J.drawn===1?"":"s"}. Price range ${J.priceRange.min}–${J.priceRange.max}.${W}`;return{content:[{type:"image",data:Buffer.from(J.png).toString("base64"),mimeType:"image/png"},{type:"text",text:z}]}}})];async function fX($){try{return{ok:!0,value:await $}}catch(v){return{ok:!1,error:v instanceof Error?v.message:String(v)}}}function n2($){return/unauthor|forbidden|401|403|sign[ -]?in|token|credential/i.test($)}var _2="The Aether Wealth backend is unreachable right now. Try again shortly.",y2=xz.flatMap(($)=>$.dashboardOnly.map((v)=>`${$.name}: ${v}`)),nX=[T({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 u(v);let D=await Promise.all([fX(v.trpc.trading.accounts.list.query()),fX(v.trpc.trading.trades.list.query({status:"OPEN",limit:200})),fX(v.trpc.trading.analytics.stats.query({})),fX(v.trpc.alerts.list.query({}))]);if(D.every((I)=>!I.ok)){let I=D.every((W)=>!W.ok&&n2(W.error));throw Error(I?yz:_2)}let[X,U,G,J]=D,Q=(I)=>I.ok?I.value:{error:I.error};return{accounts:Q(X),openTrades:Q(U),stats:Q(G),alerts:Q(J),dashboard:{url:x4,dashboardOnly:y2,note:`These actions are not available over MCP. When the user needs one, suggest they open the dashboard at ${x4}.`}}}})];function l2(){return{url:process.env.AETHER_APP_PUSH_URL?.trim()||"http://127.0.0.1:9003",secret:process.env.AI_LIVE_PUSH_SECRET?.trim()||void 0}}async function g6($,v,D){let{url:X,secret:U}=l2(),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(W){throw Error(`Could not reach the Aether Wealth app at ${G}. Is the dashboard running?`,{cause:W})}if(!J.ok)throw Error(`Live-chart push rejected (HTTP ${J.status}).`);let Q=await J.json().catch(()=>({})),I=typeof Q.delivered==="number"?Q.delivered:0;return{ok:!0,tool:v,delivered:I,message:I>0?`Dispatched to ${I} open chart tab(s).`:"Dispatched, but no open Aether Wealth chart tab is listening — open the dashboard in your browser, then retry."}}function h2($){return{content:[{type:"text",text:["Push confirmation sent to the user's device.","Do NOT ask the user for a code. This trade executes only when the user taps Approve in the Aether Wealth app.","Use trade_intent_status to check whether it was approved, executed, expired, cancelled, or failed.","",JSON.stringify($,null,2)].join(`
108
- `)}]}}function m2($){if(typeof $!=="object"||$===null)return!1;let v=$.proposal;return typeof v==="object"&&v!==null&&v.approvalMethod==="push"}var _X=[T({name:"get_broker_account",description:"Get the LIVE broker account balance, equity, currency, and connection status for a connected trading account (distinct from list_accounts which lists journal accounts). Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"}},required:["accountId"],additionalProperties:!1},handler:async($,v)=>{return await u(v),_Z(v.trpc,$)}}),T({name:"list_broker_positions",description:"List open broker positions with P&L. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"}},required:["accountId"],additionalProperties:!1},handler:async($,v)=>{return await u(v),yZ(v.trpc,$)}}),T({name:"connect_broker",description:"Attach the user's OWN already-deployed MetaApi account to a journal account. The user creates + deploys their MT5 account in MetaApi's dashboard and generates a scoped token; provide the MetaApi account id (`providerAccountRef`), its region, and the token. We adopt it (no provisioning); the account must already be DEPLOYED and CONNECTED. `providerToken` is sensitive — never expose or log it.",inputSchema:{type:"object",properties:{accountId:{type:"string"},region:{type:"string",enum:["new-york","london"]},providerAccountRef:{type:"string",description:"The MetaApi account id (from the MetaApi dashboard)."},providerToken:{type:"string",description:"The user's scoped MetaApi token for this account. Sensitive — never expose or log it."},approvalMode:{type:"string",enum:["app_otp","email_otp"],description:"Confirmation mode. 'auto' is not selectable here; 'push' is also set later via set_broker_approval_mode because it requires an active app push subscription."}},required:["accountId","region","providerAccountRef","providerToken"],additionalProperties:!1},handler:async($,v)=>{return await u(v),iZ(v.trpc,$)}}),T({name:"broker_connection_status",description:"Get the current live broker connection status. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"}},required:["accountId"],additionalProperties:!1},handler:async($,v)=>{return await u(v),fZ(v.trpc,$)}}),T({name:"set_broker_approval_mode",description:"Change how broker trades are confirmed for a connection between `app_otp` (authenticator), `email_otp`, and `push` (tap-to-approve in the Aether Wealth app; requires an active push subscription). The agent cannot enable `auto` here.",inputSchema:{type:"object",properties:{accountId:{type:"string"},approvalMode:{type:"string",enum:["app_otp","email_otp","push"]}},required:["accountId","approvalMode"],additionalProperties:!1},handler:async($,v)=>{return await u(v),nZ(v.trpc,$)}}),T({name:"propose_trade",description:"Size and PROPOSE a broker trade (does not place it). Provide exactly one of riskPercent or riskAmount; entryPrice is required for limit/stop. Returns the intent id and confirmation method. Push-mode intents are sent to the user's device and must not be executed by the agent. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"},symbol:{type:"string"},direction:{type:"string",enum:["BUY","SELL"]},orderType:{type:"string",enum:["market","limit","stop"]},entryPrice:{type:"number"},stopLoss:{type:"number"},takeProfit:{type:"number"},riskPercent:{type:"number"},riskAmount:{type:"number"}},required:["accountId","symbol","direction","stopLoss"],additionalProperties:!1},handler:async($,v)=>{await u(v);let D=await lZ(v.trpc,$);return m2(D)?h2(D):D}}),T({name:"execute_trade",description:"Place a previously proposed email_otp, app_otp, or auto trade after the required confirmation. Push intents cannot be executed by the agent; the backend enforces this. NEVER guess or fabricate a code.",inputSchema:{type:"object",properties:{intentId:{type:"string"},code:{type:"string"}},required:["intentId"],additionalProperties:!1},handler:async($,v)=>{return await u(v),hZ(v.trpc,$)}}),T({name:"trade_intent_status",description:"Check whether a proposed trade was approved, executed, expired, cancelled, or failed. Especially useful for push-mode intents, which the user approves on their device.",inputSchema:{type:"object",properties:{intentId:{type:"string"}},required:["intentId"],additionalProperties:!1},handler:async($,v)=>{return await u(v),rZ(v.trpc,$)}}),T({name:"cancel_trade_intent",description:"Cancel a previously proposed broker trade. Requires sign-in.",inputSchema:{type:"object",properties:{intentId:{type:"string"}},required:["intentId"],additionalProperties:!1},handler:async($,v)=>{return await u(v),mZ(v.trpc,$)}}),T({name:"close_position",description:"Close an open broker position fully, or partially by passing `volume`.",inputSchema:{type:"object",properties:{accountId:{type:"string"},positionId:{type:"string"},volume:{type:"number"}},required:["accountId","positionId"],additionalProperties:!1},handler:async($,v)=>{return await u(v),cZ(v.trpc,$)}}),T({name:"modify_position",description:"Adjust stop-loss / take-profit on an open position. Stop-loss changes that INCREASE risk are rejected (use the app). Pass null to clear a level.",inputSchema:{type:"object",properties:{accountId:{type:"string"},positionId:{type:"string"},stopLoss:{type:["number","null"]},takeProfit:{type:["number","null"]}},required:["accountId","positionId"],additionalProperties:!1},handler:async($,v)=>{return await u(v),dZ(v.trpc,$)}})],yX=[T({name:"draw_trade_on_chart",description:"Draw a proposed/open trade (entry, stop, target) on the user's OPEN Aether Wealth chart as a position shape. Switch to the intended pair/timeframe first with chart_select_pair.",inputSchema:{type:"object",properties:{direction:{type:"string",enum:["long","short"]},entry:{type:"number"},stopLoss:{type:"number"},takeProfit:{type:"number"},label:{type:"string"}},required:["direction","entry","stopLoss"],additionalProperties:!1},handler:async($,v)=>{await u(v);let D=await v.session.getUserId();return g6(D,"draw_chart_shape",{shapes:[{type:"position",direction:$.direction,entry:$.entry,stop:$.stopLoss,...$.takeProfit===void 0?{}:{target:$.takeProfit},...$.label===void 0?{}:{label:$.label}}]})}})];var r2=["news","press_release"];function c2($){return{pair:$.pair,...$.limit===void 0?{}:{limit:$.limit}}}function d2($){return{currency:$.currency,...$.limit===void 0?{}:{limit:$.limit}}}function p2($){return{currency:$.currency,...$.indicator===void 0?{}:{indicator:$.indicator},...$.limit===void 0?{}:{limit:$.limit}}}function t2($){return{...$.limit===void 0?{}:{limit:$.limit}}}function o2($){return{currency:$.currency,...$.documentType===void 0?{}:{documentType:$.documentType},...$.limit===void 0?{}:{limit:$.limit}}}var lX={type:"integer",minimum:1,maximum:250,description:"Max rows to return (1-250, default 120)."},hX=[T({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:lX},required:["pair"],additionalProperties:!1},handler:async($,v)=>{return await u(v),v.trpc.fxMacroData.pairContext.query(c2($))}}),T({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:lX},required:["currency"],additionalProperties:!1},handler:async($,v)=>{return await u(v),v.trpc.fxMacroData.currencyContext.query(d2($))}}),T({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:lX},required:["currency"],additionalProperties:!1},handler:async($,v)=>{return await u(v),v.trpc.fxMacroData.predictions.query(p2($))}}),T({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:lX},additionalProperties:!1},handler:async($,v)=>{return await u(v),v.trpc.fxMacroData.riskSentiment.query(t2($))}}),T({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:[...r2],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 u(v),v.trpc.fxMacroData.documents.query(o2($))}}),T({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 u(v),v.trpc.fxMacroData.syncState.query()}})];var a2="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",mX=[T({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 — ${a2}. 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 u(v),pZ(v.trpc,$)}})];var e2=["horizontal_line","horizontal_ray","vertical_line","cross_line","zone","rectangle","trendline","ray","right_ray","left_ray","extended_line","info_line","trend_angle","position"],rX=[T({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 u(v);let D=await v.session.getUserId();return g6(D,"select_pair",{pair:$.pair})}}),T({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 u(v);let D=await v.session.getUserId();return g6(D,"change_timeframe",{timeframe:$.timeframe})}}),T({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:[...e2]},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 u(v);let D=await v.session.getUserId();return g6(D,"draw_chart_shape",{shapes:$.shapes})}}),T({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 u(v);let D=await v.session.getUserId();return g6(D,"remove_chart_drawings",{target:$.target??"all"})}})];var cX=[T({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 u(v),PX(v.trpc,$)}}),T({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 u(v),oZ(v.trpc,$)}}),T({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 u(v),aZ(v.trpc,$)}}),T({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:[...tZ],description:"Lookback window (default 12m)"}},required:["currency","indicator"],additionalProperties:!1},handler:async($,v)=>{return await u(v),eZ(v.trpc,$)}}),T({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 u(v),sZ(v.trpc)}})];var YA={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"}}},s2={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"}}},dX=[T({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:YO,limit:zO},additionalProperties:!1},handler:async($,v)=>{return await u(v),UO(v.trpc,$)}}),T({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 u(v),DO(v.trpc,$)}}),T({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 u(v),PZ(v.trpc)}}),T({name:"create_account",description:'Create a trading account in the journal. Use accountType "demo" for paper/demo accounts and "live" for live accounts. Requires sign-in.',inputSchema:{type:"object",properties:{name:{type:"string"},broker:{type:"string"},accountType:{type:"string",description:"default: personal"},initialBalance:{type:"number",description:"default: 0"},currency:{type:"string",description:"3-letter code, default: USD"},notes:{type:"string"},defaultRiskAmount:{type:"number"}},required:["name"],additionalProperties:!1},handler:async($,v)=>{return await u(v),bZ(v.trpc,$)}}),T({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 u(v),$O(v.trpc,$)}}),T({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"},...YA},required:["accountId","pair","direction","entryPrice","entryTime"],additionalProperties:!1},handler:async($,v)=>{return await u(v),XO(v.trpc,$)}}),T({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"},...YA},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await u(v),GO(v.trpc,$)}}),T({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 u(v),JO(v.trpc,$)}}),T({name:"delete_trade",description:"Permanently delete a single trade by id. Only trades on demo accounts can be deleted. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await u(v),QO(v.trpc,$)}}),T({name:"delete_trades",description:"Permanently delete trades on a specific demo 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 u(v),IO(v.trpc,$)}}),T({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:s2,required:["pair","direction","entryPrice","lotSize","entryTime"],additionalProperties:!1}}},required:["accountId","trades"],additionalProperties:!1},handler:async($,v)=>{return await u(v),WO(v.trpc,$)}})];function W5($={}){let v=$.includeAuthTools??!0,D=$.includeLiveChartTools??!0;return[...v?SX:[],...nX,...dX,..._X,...qX,...cX,...hX,...mX,...iX,...D?[...rX,...yX]:[]]}var $g="aether-wealth-mcp",vg="0.1.35";function BA($,v){let D=new F0({name:$g,version:vg},{capabilities:{tools:{listChanged:!1},resources:{listChanged:!1,subscribe:!1},prompts:{listChanged:!1}}});return Ug(D,$,v??$.toolContext),D}function Ug($,v,D){let X=!1,U=(J)=>{let Q=v.clientGate?.nudge;if(Q&&!X)return X=!0,`${Q}
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)=>_v.parse(Z));else J=[_v.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(Bz);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(Q6)){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)=>Bz(Z)),I=Y?Y.params.protocolVersion:$.headers.get("mcp-protocol-version")??OV;if(this._enableJsonResponse)return new Promise((Z)=>{this._streamMapping.set(z,{resolveJson:Z,cleanup:()=>{this._streamMapping.delete(z)}});for(let F of J)if(Q6(F))this._requestToStreamMapping.set(F.id,z);for(let F of J)this.onmessage?.(F,{authInfo:v?.authInfo,requestInfo:U})});let V=new TextEncoder,K,L=new ReadableStream({start:(Z)=>{K=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(Q6(Z))this._streamMapping.set(z,{controller:K,encoder:V,cleanup:()=>{this._streamMapping.delete(z);try{K.close()}catch{}}}),this._requestToStreamMapping.set(Z.id,z);await this.writePrimingEvent(K,V,z,I);for(let Z of J){let F,S;if(Q6(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&&!Z1.includes(v))return this.onerror?.(Error(`Bad Request: Unsupported protocol version: ${v} (supported versions: ${Z1.join(", ")})`)),this.createJsonErrorResponse(400,-32000,`Bad Request: Unsupported protocol version: ${v} (supported versions: ${Z1.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(n4($)||O1($))D=$.id;if(D===void 0){if(n4($)||O1($))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(n4($)||O1($)){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 qz="/.well-known/oauth-protected-resource",ZM={"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 gV($,v,D,X){if($.method==="OPTIONS")return new Response(null,{status:204});if($.method==="GET"&&X.has(v.pathname)){let U=v.pathname.slice(37);return A1(200,{resource:`${D.publicOrigin}${U}`,authorization_servers:[D.authorizationServerIssuer],bearer_methods_supported:["header"]})}return null}function Sz($,v,D=""){let X=[...v?[`error="${v}"`]:[],`resource_metadata="${$.publicOrigin}/.well-known/oauth-protected-resource${D}"`];return new Response(JSON.stringify({error:v??"unauthorized"}),{status:401,headers:{"www-authenticate":`Bearer ${X.join(", ")}`,"content-type":"application/json"}})}function CV($){let v=$.headers.get("authorization");if(!v?.startsWith("Bearer "))return null;let D=v.slice(7).trim();return D.length>0?D:null}function A1($,v){return new Response(JSON.stringify(v),{status:$,headers:{"content-type":"application/json"}})}function uV($){let v=new Headers($.headers);for(let[D,X]of Object.entries(ZM))v.set(D,X);return new Response($.body,{status:$.status,statusText:$.statusText,headers:v})}function xV($,v){let D=$.headers.get("cf-connecting-ip")??$.headers.get("x-forwarded-for")??"unknown";return v?[`ip:${D}`,`tok:${v}`]:[`ip:${D}`]}class fV{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 _V($){let v=async(D,X)=>{let U=await fetch(D,X);if(U.status===401)$.onUnauthorized?.();return U};return{session:new fV($.token,$.userId),trpc:t4($.trpcUrl,async()=>$.token,{fetch:v})}}function w1($){return!!$._zod}function W6($,v){if(w1($))return m6($,v);return $.safeParse(v)}function lD($){if(!$)return;let v;if(w1($))v=$._zod?.def?.shape;else v=$.shape;if(!v)return;if(typeof v==="function")try{return v()}catch{return}return v}function iV($){if(w1($)){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 z6($){return $==="completed"||$==="failed"||$==="cancelled"}var OM=Symbol("Let zodToJsonSchema decide on which parser to use");var dl=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function kz($){let D=lD($)?.method;if(!D)throw Error("Schema is missing a method literal");let X=iV(D);if(typeof X!=="string")throw Error("Schema method literal must be a string");return X}function Ez($,v){let D=W6($,v);if(!D.success)throw D.error;return D.data}var MM=60000;class Tz{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(TD,(v)=>{this._oncancel(v)}),this.setNotificationHandler(CD,(v)=>{this._onprogress(v)}),this.setRequestHandler(gD,(v)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(uD,async(v,D)=>{let X=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!X)throw new x(f.InvalidParams,"Failed to retrieve task: Task not found");return{...X}}),this.setRequestHandler(fD,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 x(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 x(f.InvalidParams,`Task not found: ${U}`);if(!z6(G.status))return await this._waitForTaskUpdate(U,D.signal),await X();if(z6(G.status)){let J=await this._taskStore.getTaskResult(U,D.sessionId);return this._clearTaskQueue(U),{...J,_meta:{...J._meta,[J6]:{taskId:U}}}}return await X()};return await X()}),this.setRequestHandler(_D,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 x(f.InvalidParams,`Failed to list tasks: ${X instanceof Error?X.message:String(X)}`)}}),this.setRequestHandler(yD,async(v,D)=>{try{let X=await this._taskStore.getTask(v.params.taskId,D.sessionId);if(!X)throw new x(f.InvalidParams,`Task not found: ${v.params.taskId}`);if(z6(X.status))throw new x(f.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 x(f.InvalidParams,`Task not found after cancellation: ${v.params.taskId}`);return{_meta:{},...U}}catch(X){if(X instanceof x)throw X;throw new x(f.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($),x.fromError(f.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),n4(U)||O1(U))this._onresponse(U);else if(Q6(U))this._onrequest(U,G);else if(MV(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=x.fromError(f.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?.[J6]?.taskId;if(D===void 0){let z={jsonrpc:"2.0",id:$.id,error:{code:f.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=jV($.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 x(f.ConnectionClosed,"Request was cancelled");let V={...I,relatedRequestId:$.id};if(U&&!V.relatedTask)V.relatedTask={taskId:U};let K=V.relatedTask?.taskId??U;if(K&&Q)await Q.updateTaskStatus(K,"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:f.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),n4($))D($);else{let G=new x($.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(n4($)&&$.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(n4($))X($);else{let G=x.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 x?G:new x(f.InternalError,String(G))}}return}let U;try{let G=await this.request($,H1,D);if(G.task)U=G.task.taskId,yield{type:"taskCreated",task:G.task};else throw new x(f.InternalError,"Task creation did not return a task");while(!0){let J=await this.getTask({taskId:U},D);if(yield{type:"taskStatus",task:J},z6(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 x(f.InternalError,`Task ${U} failed`)};else if(J.status==="cancelled")yield{type:"error",error:new x(f.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 x?G:new x(f.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||{},[J6]:Q}};let K=(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((g)=>this._onerror(Error(`Failed to send cancellation: ${g}`)));let S=F instanceof x?F:new x(f.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=W6(v,F.result);if(!S.success)z(S.error);else W(S.data)}catch(S){z(S)}}),D?.signal?.addEventListener("abort",()=>{K(D?.signal?.reason)});let L=D?.timeout??MM,N=()=>K(x.fromError(f.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 g=this._responseHandlers.get(I);if(g)g(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:$},xD,v)}async getTaskResult($,v,D){return this.request({method:"tasks/result",params:$},v,D)}async listTasks($,v){return this.request({method:"tasks/list",params:$},iD,v)}async cancelTask($,v){return this.request({method:"tasks/cancel",params:$},bV,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||{},[J6]: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||{},[J6]: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||{},[J6]:v.relatedTask}}};await this._transport.send(G,v)}setRequestHandler($,v){let D=kz($);this.assertRequestHandlerCapability(D),this._requestHandlers.set(D,(X,U)=>{let G=Ez($,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=kz($);this._notificationHandlers.set(D,(X)=>{let U=Ez($,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"&&Q6(X.message)){let U=X.message.id,G=this._requestResolvers.get(U);if(G)G(new x(f.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 x(f.InvalidRequest,"Request cancelled"));return}let G=setTimeout(X,D);v.addEventListener("abort",()=>{clearTimeout(G),U(new x(f.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 x(f.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=hv.parse({method:"notifications/tasks/status",params:J});if(await this.notification(Q),z6(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 x(f.InvalidParams,`Task "${X}" not found - it may have been cleaned up`);if(z6(J.status))throw new x(f.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=hv.parse({method:"notifications/tasks/status",params:Q});if(await this.notification(W),z6(Q.status))this._cleanupTaskProgressHandler(X)}},listTasks:(X)=>{return D.listTasks(X,v)}}}}function yV($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function nV($,v){let D={...$};for(let X in v){let U=X,G=v[U];if(G===void 0)continue;let J=D[U];if(yV(J)&&yV(G))D[U]={...J,...G};else D[U]=G}return D}var wZ=w7(b5(),1),MZ=w7(AZ(),1);function r2(){let $=new wZ.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return MZ.default($),$}class x5{constructor($){this._ajv=$??r2()}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 f5{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:$},av,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},j1,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 PZ($,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 bZ($,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 A0 extends Tz{constructor($,v){super(v);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(ov.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 x5,this.setRequestHandler(RD,(D)=>this._oninitialize(D)),this.setNotificationHandler(Nz,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(wz,async(D,X)=>{let U=X.sessionId||X.requestInfo?.headers["mcp-session-id"]||void 0,{level:G}=D.params,J=ov.safeParse(G);if(J.success)this._loggingLevels.set(U,J.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new f5(this)};return this._experimental}registerCapabilities($){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=nV(this._capabilities,$)}setRequestHandler($,v){let X=lD($)?.method;if(!X)throw Error("Schema is missing a method literal");let U;if(w1(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=W6(q6,Q);if(!z.success){let K=z.error instanceof Error?z.error.message:String(z.error);throw new x(f.InvalidParams,`Invalid tools/call request: ${K}`)}let{params:Y}=z.data,I=await Promise.resolve(v(Q,W));if(Y.task){let K=W6(H1,I);if(!K.success){let L=K.error instanceof Error?K.error.message:String(K.error);throw new x(f.InvalidParams,`Invalid task creation result: ${L}`)}return K.data}let V=W6(nD,I);if(!V.success){let K=V.error instanceof Error?V.error.message:String(V.error);throw new x(f.InvalidParams,`Invalid tools/call result: ${K}`)}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($){bZ(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;PZ(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let v=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:Z1.includes(v)?v:Iz,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"},ED)}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:$},Mz,v);return this.request({method:"sampling/createMessage",params:$},av,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},j1,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},j1,v);if(U.action==="accept"&&U.content&&X.requestedSchema)try{let J=this._jsonSchemaValidator.getValidator(X.requestedSchema)(U.content);if(!J.valid)throw new x(f.InvalidParams,`Elicitation response content does not match requested schema: ${J.errorMessage}`)}catch(G){if(G instanceof x)throw G;throw new x(f.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:$},Pz,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 _5=[{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","create_account"],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:Y4?"Use the Aether Wealth dashboard for interactive charts.":"Render a chart image for a pair and timeframe.",mcp:Y4?[]:["render_chart"],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 qZ(){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",`${f4}. 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 _5)$.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 PX=["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 i5($={}){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, and charts 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, list_accounts, create_account, create_trade, update_trade, close_trade, delete_trade, delete_trades, import_trades, trade_stats"," • 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",...Y4?[]:[" • Charts: render_chart"]," • Broker execution: propose_trade, close_position, and modify_position create intents. Email/app modes need a user-provided code; auto mode needs no per-trade code. For push intents, do not ask for a code — use trade_intent_status to check the app approval outcome. disconnect_broker is the instant kill switch and requires no confirmation.","","Deletion rule:"," • delete_trade and delete_trades are permanent and only work on demo accounts. Live-account trade deletes are blocked by the backend.","","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.",PX,"","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 ${f4} rather than attempting it over MCP.`].join(`
106
+ `)}}]}]}function y5(){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:qZ()})}]}function d2($){return{...$.broker===void 0?{}:{broker:$.broker},...$.accountType===void 0?{}:{accountType:$.accountType},...$.initialBalance===void 0?{}:{initialBalance:$.initialBalance},...$.currency===void 0?{}:{currency:$.currency},...$.notes===void 0?{}:{notes:$.notes},...$.defaultRiskAmount===void 0?{}:{defaultRiskAmount:$.defaultRiskAmount}}}function p2($){return{name:$.name,...d2($)}}function SZ($){return $.trading.accounts.list.query()}function kZ($,v){return $.trading.accounts.create.mutate(p2(v))}function n5($){return{triggerType:$.triggerType??"close",isPersistent:$.isPersistent??!1,notifyEmail:$.notifyEmail??!0,notifyPush:$.notifyPush??!0,...$.message===void 0?{}:{message:$.message},...$.expiresAt===void 0?{}:{expiresAt:$.expiresAt}}}function EZ($){return{...$.includeArchived===void 0?{}:{includeArchived:$.includeArchived},...$.pair===void 0?{}:{pair:$.pair}}}function t2($){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 o2($){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 TZ($,v){return $.alerts.list.query(EZ(v))}function RZ($,v){let D={pair:v.pair,timeframe:v.timeframe,price:v.price,condition:v.condition,...n5(v)};return $.alerts.createPrice.mutate(D)}function gZ($,v){let D={pair:v.pair,timeframe:v.timeframe,price1:v.price1,time1:v.time1,price2:v.price2,time2:v.time2,condition:v.condition,...n5(v)};return $.alerts.createTrendline.mutate(D)}function CZ($,v){return $.alerts.update.mutate(t2(v))}function uZ($,v){return $.alerts.delete.mutate({id:v.id})}function xZ($,v){let D=EZ(v);return $.alerts.indicator.list.query(D)}function fZ($,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",...n5(v)};return $.alerts.indicator.create.mutate(D)}function _Z($,v){return $.alerts.indicator.update.mutate(o2(v))}function iZ($,v){return $.alerts.indicator.delete.mutate({id:v.id})}function a2($){return{accountId:$.accountId,region:$.region,providerAccountRef:$.providerAccountRef,providerToken:$.providerToken,...$.provider===void 0?{}:{provider:$.provider},...$.approvalMode===void 0?{}:{approvalMode:$.approvalMode}}}function bX($){return{accountId:$.accountId}}function e2($){return{accountId:$.accountId,approvalMode:$.approvalMode,...$.totpCode===void 0?{}:{totpCode:$.totpCode}}}function s2($){return{accountId:$.accountId,symbol:$.symbol,direction:$.direction,stopLoss:$.stopLoss,...$.orderType===void 0?{}:{orderType:$.orderType},...$.entryPrice===void 0?{}:{entryPrice:$.entryPrice},...$.takeProfit===void 0?{}:{takeProfit:$.takeProfit},...$.riskPercent===void 0?{}:{riskPercent:$.riskPercent},...$.riskAmount===void 0?{}:{riskAmount:$.riskAmount}}}function $R($){return{intentId:$.intentId,...$.code===void 0?{}:{code:$.code}}}function vR($){return{intentId:$.intentId}}function UR($){return{intentId:$.intentId}}function DR($){return{accountId:$.accountId,positionId:$.positionId,...$.volume===void 0?{}:{volume:$.volume}}}function XR($){return{accountId:$.accountId,positionId:$.positionId,...$.stopLoss===void 0?{}:{stopLoss:$.stopLoss},...$.takeProfit===void 0?{}:{takeProfit:$.takeProfit}}}function yZ($,v){return $.execution.connect.mutate(a2(v))}function nZ($,v){return $.execution.status.query(bX(v))}function lZ($,v){return $.execution.disconnect.mutate(bX(v))}function hZ($,v){return $.execution.setApprovalMode.mutate(e2(v))}function mZ($,v){return $.execution.account.query(bX(v))}function cZ($,v){return $.execution.positions.query(bX(v))}function rZ($,v){return $.execution.propose.mutate(s2(v))}function dZ($,v){return $.execution.execute.mutate($R(v))}function pZ($,v){return $.execution.cancel.mutate(vR(v))}function tZ($,v){return $.execution.intentStatus.query(UR(v))}function oZ($,v){return $.execution.closePosition.mutate(DR(v))}function aZ($,v){return $.execution.modifyPosition.mutate(XR(v))}function GR($){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 eZ($,v){return $.technicalIndicators.get.query(GR(v))}var sZ=["3m","6m","12m","24m","all"];function JR($){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 QR($){return{currency:$.currency,indicator:$.indicator,...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to},...$.limit===void 0?{}:{limit:$.limit}}}function WR($){return{currency:$.currency,indicator:$.indicator,...$.range===void 0?{}:{range:$.range}}}function zR($){return{pair:$.pair,timeframe:$.timeframe,...$.limit===void 0?{}:{limit:$.limit},...$.offset===void 0?{}:{offset:$.offset},...$.cursor===void 0?{}:{cursor:$.cursor}}}function qX($,v){return $.marketData.mcpCandles.query(zR(v))}function $O($,v){return $.marketData.listCalendar.query(JR(v))}function vO($,v){return $.marketData.listIndicatorSeries.query(QR(v))}function UO($,v){return $.macroIndicator.list.query(WR(v))}function DO($){return $.marketData.getConfig.query()}function YR($){return{...$.accountId===void 0?{}:{accountId:$.accountId},...$.pair===void 0?{}:{pair:$.pair},...$.from===void 0?{}:{from:$.from},...$.to===void 0?{}:{to:$.to}}}function XO($,v){return $.trading.analytics.stats.query(YR(v))}function IR($){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 GO($){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 VR($){return{accountId:$.accountId,pair:$.pair,direction:$.direction,entryPrice:$.entryPrice,entryTime:$.entryTime,...GO($)}}function KR($){return{id:$.id,...$.pair===void 0?{}:{pair:$.pair},...$.direction===void 0?{}:{direction:$.direction},...$.entryPrice===void 0?{}:{entryPrice:$.entryPrice},...$.entryTime===void 0?{}:{entryTime:$.entryTime},...GO($)}}function LR($){return{id:$.id,exitPrice:$.exitPrice,exitTime:$.exitTime,...$.fees===void 0?{}:{fees:$.fees},...$.swap===void 0?{}:{swap:$.swap},...$.notes===void 0?{}:{notes:$.notes}}}function BR($){return{accountId:$.accountId,status:$.status}}function NR($){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 ZR($){return{accountId:$.accountId,trades:$.trades.map(NR)}}function JO($,v){return $.trading.trades.list.query(IR(v))}function QO($,v){return $.trading.trades.get.query({id:v.id})}function WO($,v){return $.trading.trades.create.mutate(VR(v))}function zO($,v){return $.trading.trades.update.mutate(KR(v))}function YO($,v){return $.trading.trades.close.mutate(LR(v))}function IO($,v){return $.trading.trades.delete.mutate({id:v.id})}function VO($,v){return $.trading.trades.deleteMany.mutate(BR(v))}function KO($,v){return $.trading.trades.importMany.mutate(ZR(v))}function E($){return $}var l5='Not signed in to Aether Wealth. Call the "login" tool to authenticate, then retry.';async function R($){if(!await $.session.getAccessToken())throw Error(l5)}var LO={type:"integer",minimum:1,maximum:200,description:"Max rows to return"},BO={type:"integer",minimum:1,description:"Page number (1-indexed)"};function SX($,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=OR($,D)??HR($,D);return X?{ok:!1,reason:X}:{ok:!0,args:D}}function OR($,v){for(let D of $.required??[])if(!(D in v)||v[D]===void 0||v[D]===null)return`missing required: ${D}`;return null}function HR($,v){if($.additionalProperties!==!1)return null;for(let D of Object.keys(v))if(!(D in $.properties))return`unknown property: ${D}`;return null}var h5={type:"string",enum:["above","below","crosses"]},w0={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"}},kX=[E({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 R(v),TZ(v.trpc,$)}}),E({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:h5,...w0},required:["pair","timeframe","price","condition"],additionalProperties:!1},handler:async($,v)=>{return await R(v),RZ(v.trpc,$)}}),E({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:h5,...w0},required:["pair","timeframe","price1","time1","price2","time2","condition"],additionalProperties:!1},handler:async($,v)=>{return await R(v),gZ(v.trpc,$)}}),E({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:h5,timeframe:{type:"string"},isActive:{type:"boolean"},isArchived:{type:"boolean"},...w0},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await R(v),CZ(v.trpc,$)}}),E({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 R(v),uZ(v.trpc,$)}}),E({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 R(v),xZ(v.trpc,$)}}),E({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"},...w0},required:["pair","timeframe","indicatorType","indicatorParams","outputSeries","condition"],additionalProperties:!1},handler:async($,v)=>{return await R(v),fZ(v.trpc,$)}}),E({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"},...w0},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await R(v),_Z(v.trpc,$)}}),E({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 R(v),iZ(v.trpc,$)}})];var EX=[E({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."}}}),E({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 B$=($,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}}},FR=[B$("AUDUSD","AUD/USD","Forex Majors"),B$("EURUSD","EUR/USD","Forex Majors"),B$("GBPUSD","GBP/USD","Forex Majors"),B$("USDCAD","USD/CAD","Forex Majors"),B$("USDCHF","USD/CHF","Forex Majors"),B$("USDJPY","USD/JPY","Forex Majors",{pipSize:0.01,priceDecimals:3}),B$("AUDCAD","AUD/CAD","Forex Minors"),B$("AUDCHF","AUD/CHF","Forex Minors"),B$("AUDJPY","AUD/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),B$("AUDNZD","AUD/NZD","Forex Minors"),B$("EURAUD","EUR/AUD","Forex Minors"),B$("EURCAD","EUR/CAD","Forex Minors"),B$("EURCHF","EUR/CHF","Forex Minors"),B$("EURGBP","EUR/GBP","Forex Minors"),B$("EURJPY","EUR/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),B$("EURNZD","EUR/NZD","Forex Minors"),B$("GBPAUD","GBP/AUD","Forex Minors"),B$("GBPCAD","GBP/CAD","Forex Minors"),B$("GBPCHF","GBP/CHF","Forex Minors"),B$("GBPJPY","GBP/JPY","Forex Minors",{pipSize:0.01,priceDecimals:3}),B$("GBPNZD","GBP/NZD","Forex Minors")],jR=[{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 AR=[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)],wR=[{id:"NAS100",displayName:"Nasdaq 100",kind:"index",exchange:"NASDAQ",region:"US",category:"Indices",pipSize:0.01,priceDecimals:2,contractSize:20,providers:{twelvedata:"QQQ"}}],MR=[{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 T4($,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 PR=[{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"}},T4("RELIANCE","RELIANCE:NSE","Reliance Industries"),T4("TCS","TCS:NSE","Tata Consultancy Services"),T4("HDFCBANK","HDFCBANK:NSE","HDFC Bank"),T4("INFY","INFY:NSE","Infosys"),T4("ICICIBANK","ICICIBANK:NSE","ICICI Bank"),T4("BHARTIARTL","BHARTIARTL:NSE","Bharti Airtel"),T4("LT","LT:NSE","Larsen & Toubro"),T4("SBIN","SBIN:NSE","State Bank of India"),T4("AXISBANK","AXISBANK:NSE","Axis Bank"),T4("KOTAKBANK","KOTAKBANK:NSE","Kotak Mahindra Bank")],TX=Object.freeze([...FR,...jR,...AR,...wR,...MR,...PR]);class M0{byKey;instruments;providerNames;constructor($){this.instruments=Object.freeze([...$]);let v=new Map,D=new Set;for(let X of $){if(m5(v,X.id,X,"id"),X.displayName!==X.id)m5(v,X.displayName,X,"displayName");for(let[U,G]of Object.entries(X.providers))if(D.add(U),m5(v,NO(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(NO($,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 NO($,v){return`${$}:${v}`}function m5($,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 qR=["forex","metal","crypto","index","commodity","stock","bond"],SR=c.object({kind:c.enum(qR),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))}),Tp=c.record(c.string().min(1),SR).refine(($)=>Object.keys($).length>0,{message:"INSTRUMENTS must contain at least one entry"});var kR=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 c5($,v){return Number(v.toFixed($.priceDecimals))}var g$="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif",r5=11,d5=15,p5=11,t5=13,ZO=12,RX=17,OO=26,HO=0.85,FO=20,jO=8,AO=64,wO=26,f1=18,gX=16,MO=20,PO=300,o5=120,bO=1280,qO=720,SO=2,kO=!0,EO=320,TO=2560,RO=240,gO=1440,CO=1,uO=3,CX={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"}},a5=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xO($,v){if(!Number.isFinite(v))return"0.00000";if(!$)return v.toFixed(5);return c5($,v).toFixed($.priceDecimals)}function fO($,v,D){let X=new Date(v*1000);if(gR($)){if(D===void 0||fR(D,v))return uR(X);return CR(X)}return xR(X)}function gR($){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 P0($,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 CR($){return`${uX($.getUTCHours())}:${uX($.getUTCMinutes())}`}function uR($){return`${uX($.getUTCDate())} ${a5[$.getUTCMonth()]}`}function xR($){return`${uX($.getUTCDate())} ${a5[$.getUTCMonth()]} '${String($.getUTCFullYear()).slice(-2)}`}function fR($,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 uX($){return String($).padStart(2,"0")}var _O="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 iO($){return $.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function I$($){return`<line${i1($)} />`}function F$($){return`<rect${i1($)} />`}function p$($,v){return`<text${i1(v)}>${iO($)}</text>`}function yO($){return`<image${i1($)} />`}function nO($,v){let D=$.map((X)=>`${e5(X.x)},${e5(X.y)}`).join(" ");return`<polygon${i1({...v,points:D})} />`}function o($,v={}){if($.length===0)return"";return`<g${i1(v)}>${$}</g>`}function lO($,v,D){return[`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${v}" viewBox="0 0 ${$} ${v}" fill="none">`,D,"</svg>"].join("")}function _1($,v=11){return Math.max(10,Math.round($.length*v*0.58))}function i1($){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}="${e5(X)}"`;if(typeof X==="string")return`${D}="${iO(X)}"`;return""}).filter((D)=>D.length>0).join(" ");return v.length>0?` ${v}`:""}function e5($){let v=Math.round($*100)/100;return Number.isInteger(v)?String(v):v.toFixed(2)}var xX=16,_R=9,iR=12,yR=8,nR=8;function hO($,v){let D=[],X=$.plotLeft,U=$.instrument?.displayName??$.pair;D.push(p$(U,{x:X,y:xX,fill:v.headerText,"font-size":d5,"font-weight":700,"letter-spacing":0.2,"font-family":g$})),X+=_1(U,d5)+_R;let G=$.timeframe,J=_1(G,p5)+nR*2,Q=xX-RX+4;D.push(F$({x:X,y:Q,width:J,height:RX,rx:4,fill:v.badgeBg})),D.push(p$(G,{x:X+J/2,y:Q+RX/2+0.5,fill:v.badgeText,"font-size":p5,"font-weight":600,"text-anchor":"middle","dominant-baseline":"middle","font-family":g$})),X+=J+iR;let W=$.visibleCandles,z=W[W.length-1].close,Y=W[0].open,I=z-Y,V=Y===0?null:I/Y*100,K=I>=0?v.upCandle:v.downCandle,L=$.formatPrice(z);D.push(p$(L,{x:X,y:xX,fill:K,"font-size":t5,"font-weight":600,"font-family":g$})),X+=_1(L,t5)+yR;let N=$.instrument?.priceDecimals??5;return D.push(p$(P0(I,V,N),{x:X,y:xX,fill:K,"font-size":ZO,"font-weight":500,"font-family":g$})),o(D.join(""))}function mO($,v){if(!v)return"";let D=OO;return yO({href:_O,x:$.plotRight-D-8,y:$.plotBottom-D-8,width:D,height:D,opacity:HO})}var lR=["price","priceHigh","priceLow","price1","price2","entry","stop","target"];function rO($,v){let D=$.candles.slice(-$.bars),X=jO,U=FO,G=Math.max(X+1,$.width-AO),J=Math.max(U+1,$.height-wO),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,K=V>0?V*0.06:Math.max(Math.abs(I)*0.006,0.000001),L=Y-K,N=I+K,Z=Math.max(N-L,0.000001),F=V>0?Math.max(Z,V/0.6):Z,S=dR($.shapes),g=S.length>0?Math.min(...S):Number.POSITIVE_INFINITY,u=S.length>0?Math.max(...S):Number.NEGATIVE_INFINITY,k=Number.isFinite(g)&&g<L?L-g:0,N$=Number.isFinite(u)&&u>N?u-N:0,j$=Math.max(0,F-Z),g4=k+N$,Q4=L,y$=N;if(g4<=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(g4>0){let a=j$/g4;Q4-=k*a,y$+=N$*a}let h1=Math.max(y$-Q4,0.000001),m1=aR(D),c1=D.length-1;function q0(a){return U+(y$-a)/h1*W}function SH(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:q0(a),clamped:!1,edge:null}}function eX(a){return X+(a+0.5)*z}function O7(a){return rR(D,c1,m1,a)}function H7(a){return eX(O7(a))}function F7(a){return c1-a}function kH(a,j7,RH){let A7=tR(a,j7);if(A7!==void 0)return H7(A7);let gH=oR(a,j7)??RH;return eX(F7(gH))}function EH(a=6){return hR(Q4,y$,a)}function TH(a=7){return cR(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:m1,formatPrice(a){return xO(v,a)},priceToY:q0,projectPrice:SH,indexToX:eX,timeToIndex:O7,timeToX:H7,barsBackToIndex:F7,resolveEndpointX:kH,nicePriceTicks:EH,niceTimeTickIndices:TH}}var cO=3;function hR($,v,D=6){let X=eR($,v,D),U=Math.ceil($/X)*X,G=Math.floor(v/X)*X,J=sR(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<cO)return mR($,v,cO+2);return Q}function mR($,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 cR($,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 rR($,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 pR($,v,X)}function dR($){let v=[];for(let D of $)for(let X of lR){let U=D[X];if(typeof U==="number"&&Number.isFinite(U))v.push(U)}return v}function pR($,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 tR($,v){if(v==="start")return $.time1??$.entryTime;return $.time2}function oR($,v){if(v==="start")return $.barsBack1;return $.barsBack2}function aR($){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 eR($,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 K=V*I,L=Math.ceil($/K),N=Math.floor(v/K),Z=N>=L?N-L+1:1,F=Math.abs(Z-D);if(F<z)z=F,W=K}}return W}function sR($){let v=0,D=$;while(v<10&&Math.abs(Math.round(D)-D)>0.00000001)D*=10,v+=1;return v}function Z6($){return CX[$]}function dO($,v){let D=Z6($.theme),X=$g($.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":r5,"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),g=(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$(fO($.timeframe,Z.time,g),{x:F,y:$.height-8,fill:D.text,"font-size":r5,"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:f1},K=hO($,D),L=mO($,v);return{gridSvg:o(G.join(""),{"shape-rendering":"crispEdges"}),axesSvg:J.join(""),lastPriceSvg:I,lastPriceTag:V,headerSvg:K,watermarkSvg:L}}function $g($,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 pO($){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),K=Math.max(Y,I),L=Math.max(1,Math.round(K-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 tO($,v){if(v.length===0)return"";let D=Z6($.theme);return vg(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>=f1?11:10,"font-family":g$,"font-weight":600,"text-anchor":"end","dominant-baseline":"middle"})].join(""),{"shape-rendering":"crispEdges"})).join("")}function vg($,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 s5($){let v=Xg($.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:oO($.width,bO,EO,TO),height:oO($.height,qO,RO,gO),bars:Ug($.bars??o5),scale:Dg($.scale),watermark:$.watermark??kO,...$.fontFiles?{fontFiles:$.fontFiles}:{}}}function Ug($){if(!Number.isFinite($))return o5;return $7(Math.round($),MO,PO)}function Dg($){if($===void 0||!Number.isFinite($)||$<=0)return SO;return $7($,CO,uO)}function oO($,v,D,X){if($===void 0||!Number.isFinite($)||$<=0)return v;return $7(Math.round($),D,X)}function $7($,v,D){return Math.min(D,Math.max(v,$))}function Xg($){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 Gg}from"node:module";var Jg=Gg(import.meta.url);function aO($,v,D,X){let{Resvg:U}=Qg();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 Qg(){try{return Jg("@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 Wg={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"},zg={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 Yg=["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 b0($){if(typeof $!=="string")return null;let v=$.trim().toLowerCase();return Wg[v]??null}function $H($){return`Unknown shape type: "${String($)}". Supported types: ${Yg.join(", ")}`}function v7($){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 Ig($){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=v7($[D]);if(X!==void 0)return X}return}function R4($,v,D){let X=$[v];if(!X||typeof X!=="object"||Array.isArray(X))return;return t$(X,D)}function Vg($){if(typeof $.type!=="string")return null;let v=$.type.trim().toLowerCase();return v.length>0?v:null}function O4($,v,D){if($[v]!==void 0||D===void 0)return;$[v]=D}function U7($,v,D){O4($,v,D===void 0?void 0:Math.trunc(D))}function Kg($,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=Ig($.side)}function Lg($){return t$($,["level","y","value","priceLevel","linePrice"])??R4($,"point1",["price","y","value"])??R4($,"from",["price","y","value"])}function eO($,v){if(v==="start")return t$($,["startPrice","fromPrice","priceA","p1"])??R4($,"point1",["price","y","value"])??R4($,"from",["price","y","value"]);return t$($,["endPrice","toPrice","priceB","p2"])??R4($,"point2",["price","y","value"])??R4($,"to",["price","y","value"])}function sO($,v){if(v==="start")return t$($,["time","startTime","fromTime","timestamp","t1"])??R4($,"point1",["time","t","timestamp"])??R4($,"from",["time","t","timestamp"]);return t$($,["endTime","toTime","t2"])??R4($,"point2",["time","t","timestamp"])??R4($,"to",["time","t","timestamp"])}function Bg($){O4($,"price",Lg($)),O4($,"priceHigh",t$($,["high","upper","top","max","priceTop","priceUpper"])),O4($,"priceLow",t$($,["low","lower","bottom","min","priceBottom","priceLower"])),O4($,"price1",eO($,"start")),O4($,"price2",eO($,"end"))}function Ng($){U7($,"time1",sO($,"start")),U7($,"time2",sO($,"end")),O4($,"barsBack1",t$($,["barsBack","barBack","lookback","bars"])),O4($,"barsBack2",t$($,["barsBackEnd","barBackEnd","lookbackEnd"]))}function Zg($){O4($,"entry",t$($,["entryPrice","open","openPrice"])),O4($,"stop",t$($,["stopLoss","sl","stopPrice"])),O4($,"target",t$($,["takeProfit","tp","targetPrice","tpPrice"])),U7($,"entryTime",t$($,["entryTimestamp"]))}function Og($){let v=v7($.priceHigh),D=v7($.priceLow);if(v!==void 0&&D!==void 0&&v<D)$.priceHigh=D,$.priceLow=v}function vH($){if(typeof $!=="object"||$===null||Array.isArray($))return $;let v={...$},D=Vg(v),X=b0(D);if(X)v.type=X;return Kg(v,D),Bg(v),Ng(v),Zg(v),Og(v),v}function UH($){return zg[$].required}var Hg=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=b0($.type);if(!D){v.addIssue({code:"custom",message:$H($.type),path:["type"]});return}for(let X of UH(D))if($[X.field]===void 0)v.addIssue({code:"custom",message:X.message,path:[X.field]})}),DH=c.preprocess(vH,Hg),pt=c.object({shapes:c.array(DH).min(1)});function XH($){let v=[],D=[];for(let[X,U]of $.entries()){let G=DH.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=Z6($.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([nO(W,{fill:X}),p$($.formatPrice(D),{x:J,y:z,fill:G.markerText,"font-size":10,"font-family":g$,"text-anchor":"middle"})].join(""))}function D7($,v,D,X,U){let G=_1(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 H4($,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 JH="price out of visible range (clamped)";function X7($,v){if(v.type==="zone")return Fg($,v);if(v.type==="rectangle")return jg($,v);return O$(v,`Unsupported area shape: ${v.type}`)}function Fg($,v){let D=QH($,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?H4(D.left+4,U,v.label,X):"",z$($,G,D.highPrice,X),z$($,G,D.lowPrice,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?JH:void 0)}function jg($,v){let D=QH($,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?H4(D.left+4,U,v.label,X):"",z$($,G,D.highPrice,X),z$($,G,D.lowPrice,X)].join(""),{"shape-rendering":"crispEdges"})},D.clamped?JH:void 0)}function QH($,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"&&!GH(v)?$.plotLeft:Y$($.resolveEndpointX(v,"start",24),$.plotLeft,$.plotRight),W=D==="zone"&&!GH(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 GH($){return $.time1!==void 0||$.time2!==void 0||$.barsBack1!==void 0||$.barsBack2!==void 0}function fX($,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 WH($,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:fX(D,$,v)}}}function zH($,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:fX(D,$,v)}}}function YH($,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:fX(D,$,v)},end:{x:X,y:fX(X,$,v)}}}function G7($,v){return{x:($.x+v.x)/2,y:($.y+v.y)/2}}var y1="price out of visible range (clamped)";function J4($,v){switch(v.type){case"horizontal_line":return Ag($,v);case"horizontal_ray":return wg($,v);case"vertical_line":return Mg($,v);case"cross_line":return Pg($,v);case"trendline":return bg($,v);case"ray":case"right_ray":return qg($,v);case"left_ray":return Sg($,v);case"extended_line":return kg($,v);case"info_line":return Eg($,v);case"trend_angle":return Tg($,v);default:return O$(v,`Unsupported line shape: ${v.type}`)}}function Ag($,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?H4($.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:f1}]},U.clamped?y1:void 0)}function wg($,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?H4(J,Y$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,X):"",z$($,G,D,X)].join(""),{"shape-rendering":"crispEdges"})},U.clamped?y1:void 0)}function Mg($,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?H4(U+4,$.plotTop+12,v.label,D):""].join(""),{"shape-rendering":"crispEdges"})})}function Pg($,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?H4(G+4,Y$(U.y-4,$.plotTop+10,$.plotBottom-4),v.label,X):"",z$($,G,D,X)].join(""),{"shape-rendering":"crispEdges"})},U.clamped?y1:void 0)}function bg($,v){let D=n1($,v,"trendline");if(D.kind==="error")return D.fragments;return Rg($,v,D.first,D.second,"#f59e0b","4 4")}function qg($,v){let D=n1($,v,v.type);if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=WH(D.first,D.second,$.plotRight);return _X($,v,U.start,U.end,X,"4 4",[z$($,D.first.x,D.price1,X),z$($,D.second.x,D.price2,X)])}function Sg($,v){let D=n1($,v,"left_ray");if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=zH(D.first,D.second,$.plotLeft);return _X($,v,U.start,U.end,X,"4 4",[z$($,D.first.x,D.price1,X),z$($,D.second.x,D.price2,X)])}function kg($,v){let D=n1($,v,"extended_line");if(D.kind==="error")return D.fragments;let X=o$(v,"#f59e0b"),U=YH(D.first,D.second,$.plotLeft,$.plotRight,$.plotTop,$.plotBottom);return _X($,v,U.start,U.end,X,"4 4",[z$($,D.first.x,D.price1,X),z$($,D.second.x,D.price2,X)])}function Eg($,v){let D=n1($,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} · ${P0(U,G,J)}`:P0(U,G,J),W=G7(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}),D7(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?y1:void 0)}function Tg($,v){let D=n1($,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=G7(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}),D7(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?y1:void 0)}function Rg($,v,D,X,U,G){let J=o$(v,U);return _X($,v,D,X,J,G,[z$($,D.x,k$(v.price1)??0,J),z$($,X.x,k$(v.price2)??0,J)])}function _X($,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?H4(Q,W,v.label,U):"",...J].join(""),{"shape-rendering":"crispEdges"})},I?y1:void 0)}function n1($,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 gg="price out of visible range (clamped)";function IH($,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=Z6($.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),K=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:K-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?H4(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:gX},{y:W.y,label:`SL ${$.formatPrice(X)}`,fill:"#ef4444",height:gX},{y:z.y,label:`TP ${$.formatPrice(U)}`,fill:"#10b981",height:gX}]},N?gg:void 0)}var Cg={horizontal_line:J4,horizontal_ray:J4,vertical_line:J4,cross_line:J4,zone:X7,rectangle:X7,trendline:J4,ray:J4,right_ray:J4,left_ray:J4,extended_line:J4,info_line:J4,trend_angle:J4,position:IH};function VH($,v){let D=[],X=[],U=[],G=[],J=[],Q=[],W=0,z=0;for(let Y of v){let I=ug($,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 ug($,v){let D=b0(v.type);if(!D)return O$(v,`Unknown shape type: ${String(v.type)}`);let X=Cg[D];if(!X)return O$(v,`Unsupported shape type: ${D}`);let U=D===v.type?v:{...v,type:D};return X($,U)}var J7;function KH($){let v=s5($),D=xg(v.pair),X=rO(v,D),U=CX[v.theme],G=VH(X,v.shapes),J=dO(X,v.watermark),Q=`plot-clip-${ig(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(pO(X),z),K=o(G.lineSvg,z),L=o(G.positionSvg,z),N=tO(X,[...G.gutterTags,J.lastPriceTag]);return{svg:lO(X.width,X.height,[F$({x:0,y:0,width:X.width,height:X.height,fill:U.background}),W,Y,I,V,K,L,J.axesSvg,G.chromeSvg,J.lastPriceSvg,N,J.headerSvg,J.watermarkSvg,_g()].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 Q7($){let v=KH($),D=s5($);return{...v,png:aO(v.svg,v.width,D.scale,D.fontFiles)}}function xg($){return fg().resolve($)}function fg(){if(J7===void 0)J7=new M0([...TX]);return J7}function _g(){return`<style>text{font-family:${g$};white-space:pre}</style>`}function ig($){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 LH=120,W7=20,z7=200;function yg($,v,D){return Math.max(v,Math.min(D,$))}var ng="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*.",lg="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).",iX=[E({name:"render_chart",description:ng,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:lg,items:{type:"object"}},bars:{type:"integer",minimum:W7,maximum:z7,description:`Most-recent candles to show (${W7}-${z7}, default ${LH})`},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 R(v);let D=yg($.bars??LH,W7,z7),{candles:X}=await qX(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}=XH($.shapes??[]),J=Q7({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 yX($){try{return{ok:!0,value:await $}}catch(v){return{ok:!1,error:v instanceof Error?v.message:String(v)}}}function hg($){return/unauthor|forbidden|401|403|sign[ -]?in|token|credential/i.test($)}var mg="The Aether Wealth backend is unreachable right now. Try again shortly.",cg=_5.flatMap(($)=>$.dashboardOnly.map((v)=>`${$.name}: ${v}`)),nX=[E({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 R(v);let D=await Promise.all([yX(v.trpc.trading.accounts.list.query()),yX(v.trpc.trading.trades.list.query({status:"OPEN",limit:200})),yX(v.trpc.trading.analytics.stats.query({})),yX(v.trpc.alerts.list.query({}))]);if(D.every((W)=>!W.ok)){let W=D.every((z)=>!z.ok&&hg(z.error));throw Error(W?l5:mg)}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:f4,dashboardOnly:cg,note:`These actions are not available over MCP. When the user needs one, suggest they open the dashboard at ${f4}.`}}}})];function rg(){return{url:process.env.AETHER_APP_PUSH_URL?.trim()||"http://127.0.0.1:9003",secret:process.env.AI_LIVE_PUSH_SECRET?.trim()||void 0}}async function u6($,v,D){let{url:X,secret:U}=rg(),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."}}function Y7($){let v=BH($),D=pg(v?.approvalMethod);return{content:[{type:"text",text:[`Pending broker intent created with approval method: ${v?.approvalMethod??"unknown"}.`,D,"Use trade_intent_status to check whether it was approved, executed, expired, cancelled, or failed.","",JSON.stringify($,null,2)].join(`
108
+ `)}]}}function dg($){return BH($)?.approvalMethod==="push"}function pg($){if($==="email_otp")return"Ask the user for the emailed confirmation code, then call execute_trade with this intentId and code. Never guess or fabricate the code.";if($==="app_otp")return"Ask the user for the current authenticator app code, then call execute_trade with this intentId and code. Never guess or fabricate the code.";if($==="push")return"Do NOT ask the user for a code. This action executes only when the user taps Approve in the Aether Wealth app.";if($==="auto")return"No code is required. Call execute_trade with this intentId to execute the action.";return"Inspect the returned proposal before taking the next step."}function BH($){if(typeof $!=="object"||$===null)return null;let v=$.proposal;if(typeof v!=="object"||v===null)return null;return v}var lX=[E({name:"get_broker_account",description:"Get the LIVE broker account balance, equity, currency, and connection status for a connected trading account (distinct from list_accounts which lists journal accounts). Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"}},required:["accountId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),mZ(v.trpc,$)}}),E({name:"list_broker_positions",description:"List open broker positions with P&L. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"}},required:["accountId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),cZ(v.trpc,$)}}),E({name:"connect_broker",description:"Attach the user's OWN already-deployed MetaApi account to a journal account. The user creates + deploys their MT5 account in MetaApi's dashboard and generates a scoped token; provide the MetaApi account id (`providerAccountRef`), its region, and the token. We adopt it (no provisioning); the account must already be DEPLOYED and CONNECTED. `providerToken` is sensitive — never expose or log it.",inputSchema:{type:"object",properties:{accountId:{type:"string"},region:{type:"string",enum:["new-york","london"]},providerAccountRef:{type:"string",description:"The MetaApi account id (from the MetaApi dashboard)."},providerToken:{type:"string",description:"The user's scoped MetaApi token for this account. Sensitive — never expose or log it."},approvalMode:{type:"string",enum:["app_otp","email_otp"],description:"Confirmation mode. 'auto' is not selectable here; 'push' is also set later via set_broker_approval_mode because it requires an active app push subscription."}},required:["accountId","region","providerAccountRef","providerToken"],additionalProperties:!1},handler:async($,v)=>{return await R(v),yZ(v.trpc,$)}}),E({name:"broker_connection_status",description:"Get the current live broker connection status. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"}},required:["accountId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),nZ(v.trpc,$)}}),E({name:"disconnect_broker",description:"Disarm broker trading for a connected account instantly. Cancels pending intents, keeps executed history, and does not require confirmation because it is the kill switch. Reconnect later with connect_broker. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"}},required:["accountId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),lZ(v.trpc,$)}}),E({name:"set_broker_approval_mode",description:"Change how broker trades are confirmed for a connection between `app_otp` (authenticator), `email_otp`, and `push` (tap-to-approve in the Aether Wealth app; requires an active push subscription). The agent cannot enable `auto` here.",inputSchema:{type:"object",properties:{accountId:{type:"string"},approvalMode:{type:"string",enum:["app_otp","email_otp","push"]}},required:["accountId","approvalMode"],additionalProperties:!1},handler:async($,v)=>{return await R(v),hZ(v.trpc,$)}}),E({name:"propose_trade",description:"Size and PROPOSE a broker trade (does not place it). Provide exactly one of riskPercent or riskAmount; entryPrice is required for limit/stop. Returns the intent id and confirmation method. Push-mode intents are sent to the user's device and must not be executed by the agent. Requires sign-in.",inputSchema:{type:"object",properties:{accountId:{type:"string"},symbol:{type:"string"},direction:{type:"string",enum:["BUY","SELL"]},orderType:{type:"string",enum:["market","limit","stop"]},entryPrice:{type:"number"},stopLoss:{type:"number"},takeProfit:{type:"number"},riskPercent:{type:"number"},riskAmount:{type:"number"}},required:["accountId","symbol","direction","stopLoss"],additionalProperties:!1},handler:async($,v)=>{await R(v);let D=await rZ(v.trpc,$);return dg(D)?Y7(D):D}}),E({name:"execute_trade",description:"Place a previously proposed trade. Email/app modes require the user-provided code; auto mode requires no per-trade code. Push intents cannot be executed by the agent. NEVER guess or fabricate a code.",inputSchema:{type:"object",properties:{intentId:{type:"string"},code:{type:"string"}},required:["intentId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),dZ(v.trpc,$)}}),E({name:"trade_intent_status",description:"Check whether a proposed trade was approved, executed, expired, cancelled, or failed. Especially useful for push-mode intents, which the user approves on their device.",inputSchema:{type:"object",properties:{intentId:{type:"string"}},required:["intentId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),tZ(v.trpc,$)}}),E({name:"cancel_trade_intent",description:"Cancel a previously proposed broker trade. Requires sign-in.",inputSchema:{type:"object",properties:{intentId:{type:"string"}},required:["intentId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),pZ(v.trpc,$)}}),E({name:"close_position",description:"Propose closing an open broker position fully, or partially by passing `volume`. This does not close immediately; it returns a pending confirmation intent. For email_otp/app_otp ask the user for the code and call execute_trade. For push, do not ask for a code — the user taps Approve in the app.",inputSchema:{type:"object",properties:{accountId:{type:"string"},positionId:{type:"string"},volume:{type:"number"}},required:["accountId","positionId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),Y7(await oZ(v.trpc,$))}}),E({name:"modify_position",description:"Propose adjusting stop-loss / take-profit on an open position. Stop-loss changes that INCREASE risk are rejected (use the app). Pass null to clear a level. This returns a pending confirmation intent; for email_otp/app_otp ask for the code and call execute_trade, while push is approved in the app.",inputSchema:{type:"object",properties:{accountId:{type:"string"},positionId:{type:"string"},stopLoss:{type:["number","null"]},takeProfit:{type:["number","null"]}},required:["accountId","positionId"],additionalProperties:!1},handler:async($,v)=>{return await R(v),Y7(await aZ(v.trpc,$))}})],hX=[E({name:"draw_trade_on_chart",description:"Draw a proposed/open trade (entry, stop, target) on the user's OPEN Aether Wealth chart as a position shape. Switch to the intended pair/timeframe first with chart_select_pair.",inputSchema:{type:"object",properties:{direction:{type:"string",enum:["long","short"]},entry:{type:"number"},stopLoss:{type:"number"},takeProfit:{type:"number"},label:{type:"string"}},required:["direction","entry","stopLoss"],additionalProperties:!1},handler:async($,v)=>{await R(v);let D=await v.session.getUserId();return u6(D,"draw_chart_shape",{shapes:[{type:"position",direction:$.direction,entry:$.entry,stop:$.stopLoss,...$.takeProfit===void 0?{}:{target:$.takeProfit},...$.label===void 0?{}:{label:$.label}}]})}})];var tg=["news","press_release"];function og($){return{pair:$.pair,...$.limit===void 0?{}:{limit:$.limit}}}function ag($){return{currency:$.currency,...$.limit===void 0?{}:{limit:$.limit}}}function eg($){return{currency:$.currency,...$.indicator===void 0?{}:{indicator:$.indicator},...$.limit===void 0?{}:{limit:$.limit}}}function sg($){return{...$.limit===void 0?{}:{limit:$.limit}}}function $C($){return{currency:$.currency,...$.documentType===void 0?{}:{documentType:$.documentType},...$.limit===void 0?{}:{limit:$.limit}}}var mX={type:"integer",minimum:1,maximum:250,description:"Max rows to return (1-250, default 120)."},cX=[E({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:mX},required:["pair"],additionalProperties:!1},handler:async($,v)=>{return await R(v),v.trpc.fxMacroData.pairContext.query(og($))}}),E({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:mX},required:["currency"],additionalProperties:!1},handler:async($,v)=>{return await R(v),v.trpc.fxMacroData.currencyContext.query(ag($))}}),E({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:mX},required:["currency"],additionalProperties:!1},handler:async($,v)=>{return await R(v),v.trpc.fxMacroData.predictions.query(eg($))}}),E({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:mX},additionalProperties:!1},handler:async($,v)=>{return await R(v),v.trpc.fxMacroData.riskSentiment.query(sg($))}}),E({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:[...tg],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 R(v),v.trpc.fxMacroData.documents.query($C($))}}),E({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 R(v),v.trpc.fxMacroData.syncState.query()}})];var vC="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",rX=[E({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 — ${vC}. 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 R(v),eZ(v.trpc,$)}})];var UC=["horizontal_line","horizontal_ray","vertical_line","cross_line","zone","rectangle","trendline","ray","right_ray","left_ray","extended_line","info_line","trend_angle","position"],dX=[E({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 R(v);let D=await v.session.getUserId();return u6(D,"select_pair",{pair:$.pair})}}),E({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 R(v);let D=await v.session.getUserId();return u6(D,"change_timeframe",{timeframe:$.timeframe})}}),E({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:[...UC]},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 R(v);let D=await v.session.getUserId();return u6(D,"draw_chart_shape",{shapes:$.shapes})}}),E({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 R(v);let D=await v.session.getUserId();return u6(D,"remove_chart_drawings",{target:$.target??"all"})}})];var pX=[E({name:"get_candles",description:"Get OHLC candles for a pair + timeframe. Returns up to 200 bars plus nextCursor. To page through the complete stored history, pass nextCursor back as cursor until nextCursor is null. Timeframe may be a stored base (1m, 5m, 15m, 30m, 1h, 4h, 1d) or any integer multiple of one (e.g. 3m, 2h, 12h, 90m), aggregated server-side without splitting derived candles across pages. The legacy offset parameter remains available for shallow pagination; do not combine offset and cursor.",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:"Legacy shallow pagination: number of recent candles to skip (0–4800). Use cursor instead for complete history; do not combine offset and cursor."},cursor:{type:"string",minLength:1,maxLength:2048,description:"Opaque nextCursor returned by the previous get_candles page. Omit on the first page; continue until nextCursor is null. Do not combine with offset."}},required:["pair","timeframe"],additionalProperties:!1},handler:async($,v)=>{return await R(v),qX(v.trpc,$)}}),E({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 R(v),$O(v.trpc,$)}}),E({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 R(v),vO(v.trpc,$)}}),E({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:[...sZ],description:"Lookback window (default 12m)"}},required:["currency","indicator"],additionalProperties:!1},handler:async($,v)=>{return await R(v),UO(v.trpc,$)}}),E({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 R(v),DO(v.trpc)}})];var NH={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"}}},DC={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"}}},tX=[E({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:BO,limit:LO},additionalProperties:!1},handler:async($,v)=>{return await R(v),JO(v.trpc,$)}}),E({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 R(v),QO(v.trpc,$)}}),E({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 R(v),SZ(v.trpc)}}),E({name:"create_account",description:'Create a trading account in the journal. Use accountType "demo" for paper/demo accounts and "live" for live accounts. Requires sign-in.',inputSchema:{type:"object",properties:{name:{type:"string"},broker:{type:"string"},accountType:{type:"string",description:"default: personal"},initialBalance:{type:"number",description:"default: 0"},currency:{type:"string",description:"3-letter code, default: USD"},notes:{type:"string"},defaultRiskAmount:{type:"number"}},required:["name"],additionalProperties:!1},handler:async($,v)=>{return await R(v),kZ(v.trpc,$)}}),E({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 R(v),XO(v.trpc,$)}}),E({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"},...NH},required:["accountId","pair","direction","entryPrice","entryTime"],additionalProperties:!1},handler:async($,v)=>{return await R(v),WO(v.trpc,$)}}),E({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"},...NH},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await R(v),zO(v.trpc,$)}}),E({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 R(v),YO(v.trpc,$)}}),E({name:"delete_trade",description:"Permanently delete a single trade by id. Only trades on demo accounts can be deleted. Requires sign-in.",inputSchema:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1},handler:async($,v)=>{return await R(v),IO(v.trpc,$)}}),E({name:"delete_trades",description:"Permanently delete trades on a specific demo 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 R(v),VO(v.trpc,$)}}),E({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:DC,required:["pair","direction","entryPrice","lotSize","entryTime"],additionalProperties:!1}}},required:["accountId","trades"],additionalProperties:!1},handler:async($,v)=>{return await R(v),KO(v.trpc,$)}})];function I7($={}){let v=$.includeAuthTools??!0,D=$.includeLiveChartTools??!1,X=$.includeRenderChartTools??!Y4;return[...v?EX:[],...nX,...tX,...lX,...kX,...pX,...cX,...rX,...X?iX:[],...D?[...dX,...hX]:[]]}var XC="aether-wealth-mcp",GC="0.2.0";function ZH($,v){let D=new A0({name:XC,version:GC},{capabilities:{tools:{listChanged:!1},resources:{listChanged:!1,subscribe:!1},prompts:{listChanged:!1}}});return JC(D,$,v??$.toolContext),D}function JC($,v,D){let X=!1,U=(J)=>{let Q=v.clientGate?.nudge;if(Q&&!X)return X=!0,`${Q}
109
109
 
110
- ${J}`;return J},G=(J)=>{let Q=v.clientGate?.nudge;if(!Q||X)return J;X=!0;let I=J.find((W)=>W.type==="text");if(I)return J.map((W)=>W===I?{type:"text",text:`${Q}
110
+ ${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}
111
111
 
112
- ${I.text}`}:W);return[{type:"text",text:Q},...J]};$.setRequestHandler(pv,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:I}=J.params,W=v.tools.get(Q);if(!W)throw new x(i.MethodNotFound,`tool not found: ${Q}`);let z=bX(W.inputSchema,I);if(!z.ok)throw new x(i.InvalidParams,`invalid arguments for ${Q}: ${z.reason}`);try{let Y=await W.handler(z.args,D),B=Dg(Y);if(B)return{content:G(B.content),isError:!1};return{content:[{type:"text",text:U(Xg(Y))}],isError:!1}}catch(Y){return{content:[{type:"text",text:Gg(Y)}],isError:!0}}}),$.setRequestHandler(mv,async()=>({resources:Array.from(v.resources.values()).map((J)=>({uri:J.uri,name:J.name,description:J.description,mimeType:J.mimeType}))})),$.setRequestHandler(rv,async(J)=>{let{uri:Q}=J.params,I=v.resources.get(Q);if(!I)throw new x(i.MethodNotFound,`resource not found: ${Q}`);let W=await I.handler(D);return{contents:[{uri:Q,mimeType:I.mimeType,text:W.text}]}}),$.setRequestHandler(cv,async()=>({prompts:Array.from(v.prompts.values()).map((J)=>({name:J.name,description:J.description,...J.arguments?{arguments:J.arguments}:{}}))})),$.setRequestHandler(dv,async(J)=>{let{name:Q,arguments:I}=J.params,W=v.prompts.get(Q);if(!W)throw new x(i.MethodNotFound,`prompt not found: ${Q}`);let z={};for(let[B,V]of Object.entries(I??{}))if(typeof V==="string")z[B]=V;for(let B of W.arguments??[])if(B.required&&!(B.name in z))throw new x(i.InvalidParams,`prompts/get: missing required argument: ${B.name}`);let Y=W.handler(z);return{description:W.description,messages:Y}})}function Dg($){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 Xg($){if(typeof $==="string")return $;return JSON.stringify($,null,2)}function Gg($){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 Qg="/mcp",Ig="/healthz",z5="/";async function Y5($,v){let D=v.path??Qg,X=new Set([z5,D]),U=v.hostname??g4,G=v.log??((W)=>{process.stderr.write(W)}),J=v.oauth;if(J&&v.bearerToken)throw Error("startHttpServer: `bearerToken` and `oauth` are mutually exclusive");if(!J&&!v.bearerToken)G(`[http] WARNING: no auth configured; binding to ${U}:${v.port}${D} unauthenticated
113
- `);let Q=Wg({servedPaths:X,bundle:$.getRegistryBundle(),log:G,...J?{oauth:J}:{},...v.bearerToken?{bearerToken:v.bearerToken}:{}});if(globalThis.Bun?.serve)return Bg(Q,v,U);return Vg(Q,v,U)}async function KA($,v,D,X){let U=BA(v,D),G=new MW({enableJsonResponse:!0});try{return await U.connect(G),await G.handleRequest($)}catch(J){return X(`[http] dispatch error: ${B5(J)}
114
- `),F1(500,{error:"internal error"})}finally{await G.close().catch(LA),await U.close().catch(LA)}}function Wg($){let{servedPaths:v,bundle:D,log:X,oauth:U,bearerToken:G}=$,J=new Set([PW,...[...v].filter((I)=>I!==z5).map((I)=>`${PW}${I}`)]),Q=async(I)=>{let W=new URL(I.url),z=zg(I,W,v,U,J);if(z)return z;if(U)return Yg(I,U,D,X);if(G&&!Hg(I,G))return new Response("unauthorized",{status:401});return KA(I,D,void 0,X)};return U?async(I)=>uB(await Q(I)):Q}function zg($,v,D,X,U){if(v.pathname===Ig&&$.method==="GET")return F1(200,{ok:!0});if(X){let G=TB($,v,X,U);if(G)return G}if(!D.has(v.pathname))return new Response("not found",{status:404});if($.method==="GET"&&!X)return F1(200,{ok:!0,transport:"streamable-http"});return null}async function Yg($,v,D,X){let U=EB($),G=new URL($.url).pathname,J=G===z5?"":G;for(let W of RB($,U)){let z=v.rateLimiter.check(W);if(!z.allowed)return new Response(JSON.stringify({error:"rate_limited"}),{status:429,headers:{"content-type":"application/json","retry-after":String(z.retryAfterSeconds)}})}if(!U)return bW(v,void 0,J);let Q;try{Q=await v.tokenVerifier.verify(U)}catch(W){return X(`[http] token verification unavailable: ${B5(W)}
115
- `),F1(502,{error:"token verification unavailable"})}if(!Q.ok)return bW(v,"invalid_token",J);let I=CB({token:U,userId:Q.userId,trpcUrl:v.trpcUrl,onUnauthorized:()=>v.tokenVerifier.invalidate(U)});return KA($,D,I,X)}function Bg($,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 Vg($,v,D){let X=Jg((J,Q)=>{Lg(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((I)=>{if(I)Q(I);else J()})})}}async function Lg($,v,D){try{let X=await Kg($),U=await D(X);await Ag(U,v)}catch(X){if(!v.headersSent){v.statusCode=500,v.setHeader("content-type","application/json"),v.end(JSON.stringify({error:B5(X)}));return}v.end()}}async function Kg($){let v=Ng($),D=Zg($),X=$.method??"GET",U={method:X,headers:D},G=await Og($,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 Zg($){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 Og($,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 Ag($,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 Hg($,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)),VA(J,G),!1}return VA(U,G)}function B5($){if($ instanceof Error)return $.message;return String($)}function LA(){return}var Fg="aether-wealth-mcp",jg=[33417,33418,33419],wg="/callback",Mg=["trades:read","trades:write","accounts:read","alerts:read","alerts:write"],Pg="aether-wealth-mcp",bg="AETHER_MCP_CREDENTIALS_FILE",y1={clientId:Fg,redirectPorts:jg,redirectPath:wg,scopes:Mg,keychainService:Pg,credentialsFilePath:S0("aether-wealth-mcp"),forceFileEnvVar:bg};function NA($={}){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, list_accounts, create_account, create_trade, update_trade, close_trade, delete_trade, delete_trades, import_trades, trade_stats"," • 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"," • Broker execution: propose_trade creates a user-confirmed intent; execute_trade only applies to email_otp/app_otp/auto intents. For push intents, do not ask for a code — use trade_intent_status to check the app approval outcome.","","Deletion rule:"," • delete_trade and delete_trades are permanent and only work on demo accounts. Live-account trade deletes are blocked by the backend.","","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(`
116
- `)}}]},{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.",MX,"","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(`
117
- `)}}]}]}var ZA="aether-wealth-mcp",V5="0.1.35";function qg($){return{toolContext:$.toolContext,tools:new Map(($.tools??W5()).map((v)=>[v.name,v])),resources:new Map(($.resources??fz()).map((v)=>[v.uri,v])),prompts:new Map(($.prompts??iz()).map((v)=>[v.name,v])),...$.clientGate?{clientGate:$.clientGate}:{},log:$.log??((v)=>{process.stderr.write(v)})}}function Sg($,v){let D=new F0({name:ZA,version:V5},{capabilities:{tools:{listChanged:!1},resources:{listChanged:!1,subscribe:!1},prompts:{listChanged:!1}}});return kg(D,$,v??$.toolContext),D}class pX{server;bundle;constructor($){this.bundle=qg($),this.server=Sg(this.bundle),this.server.oninitialized=()=>{this.bundle.log(`${ZA} initialized
118
- `)}}async connect($){await this.server.connect($)}async close(){await this.server.close()}isInitialized(){return this.server.getClientVersion()!==void 0}getRegistryBundle(){return this.bundle}}function kg($,v,D){let X=!1,U=(J)=>{let Q=v.clientGate?.nudge;if(Q&&!X)return X=!0,`${Q}
112
+ ${W.text}`}:z);return[{type:"text",text:Q},...J]};$.setRequestHandler(tv,async()=>({tools:Array.from(v.tools.values()).map((J)=>({name:J.name,description:J.description,inputSchema:J.inputSchema}))})),$.setRequestHandler(q6,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 x(f.MethodNotFound,`tool not found: ${Q}`);let Y=SX(z.inputSchema,W);if(!Y.ok)throw new x(f.InvalidParams,`invalid arguments for ${Q}: ${Y.reason}`);try{let I=await z.handler(Y.args,D),V=QC(I);if(V)return{content:G(V.content),isError:!1};return{content:[{type:"text",text:U(WC(I))}],isError:!1}}catch(I){return{content:[{type:"text",text:zC(I)}],isError:!0}}}),$.setRequestHandler(cv,async()=>({resources:Array.from(v.resources.values()).map((J)=>({uri:J.uri,name:J.name,description:J.description,mimeType:J.mimeType}))})),$.setRequestHandler(rv,async(J)=>{let{uri:Q}=J.params,W=v.resources.get(Q);if(!W)throw new x(f.MethodNotFound,`resource not found: ${Q}`);let z=await W.handler(D);return{contents:[{uri:Q,mimeType:W.mimeType,text:z.text}]}}),$.setRequestHandler(dv,async()=>({prompts:Array.from(v.prompts.values()).map((J)=>({name:J.name,description:J.description,...J.arguments?{arguments:J.arguments}:{}}))})),$.setRequestHandler(pv,async(J)=>{let{name:Q,arguments:W}=J.params,z=v.prompts.get(Q);if(!z)throw new x(f.MethodNotFound,`prompt not found: ${Q}`);let Y={};for(let[V,K]of Object.entries(W??{}))if(typeof K==="string")Y[V]=K;for(let V of z.arguments??[])if(V.required&&!(V.name in Y))throw new x(f.InvalidParams,`prompts/get: missing required argument: ${V.name}`);let I=z.handler(Y);return{description:z.description,messages:I}})}function QC($){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 WC($){if(typeof $==="string")return $;return JSON.stringify($,null,2)}function zC($){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 IC="/mcp",VC="/healthz",V7="/";async function K7($,v){let D=v.path??IC,X=new Set([V7,D]),U=v.hostname??u4,G=v.log??((z)=>{process.stderr.write(z)}),J=v.oauth;if(J&&v.bearerToken)throw Error("startHttpServer: `bearerToken` and `oauth` are mutually exclusive");if(!J&&!v.bearerToken)G(`[http] WARNING: no auth configured; binding to ${U}:${v.port}${D} unauthenticated
113
+ `);let Q=KC({servedPaths:X,bundle:$.getRegistryBundle(),log:G,...J?{oauth:J}:{},...v.bearerToken?{bearerToken:v.bearerToken}:{}});if(globalThis.Bun?.serve)return NC(Q,v,U);return ZC(Q,v,U)}async function FH($,v,D,X){let U=ZH(v,D),G=new bz({enableJsonResponse:!0});try{return await U.connect(G),await G.handleRequest($)}catch(J){return X(`[http] dispatch error: ${L7(J)}
114
+ `),A1(500,{error:"internal error"})}finally{await G.close().catch(HH),await U.close().catch(HH)}}function KC($){let{servedPaths:v,bundle:D,log:X,oauth:U,bearerToken:G}=$,J=new Set([qz,...[...v].filter((W)=>W!==V7).map((W)=>`${qz}${W}`)]),Q=async(W)=>{let z=new URL(W.url),Y=LC(W,z,v,U,J);if(Y)return Y;if(U)return BC(W,U,D,X);if(G&&!MC(W,G))return new Response("unauthorized",{status:401});return FH(W,D,void 0,X)};return U?async(W)=>uV(await Q(W)):Q}function LC($,v,D,X,U){if(v.pathname===VC&&$.method==="GET")return A1(200,{ok:!0});if(X){let G=gV($,v,X,U);if(G)return G}if(!D.has(v.pathname))return new Response("not found",{status:404});if($.method==="GET"&&!X)return A1(200,{ok:!0,transport:"streamable-http"});return null}async function BC($,v,D,X){let U=CV($),G=new URL($.url).pathname,J=G===V7?"":G;for(let z of xV($,U)){let Y=v.rateLimiter.check(z);if(!Y.allowed)return new Response(JSON.stringify({error:"rate_limited"}),{status:429,headers:{"content-type":"application/json","retry-after":String(Y.retryAfterSeconds)}})}if(!U)return Sz(v,void 0,J);let Q;try{Q=await v.tokenVerifier.verify(U)}catch(z){return X(`[http] token verification unavailable: ${L7(z)}
115
+ `),A1(502,{error:"token verification unavailable"})}if(!Q.ok)return Sz(v,"invalid_token",J);let W=_V({token:U,userId:Q.userId,trpcUrl:v.trpcUrl,onUnauthorized:()=>v.tokenVerifier.invalidate(U)});return FH($,D,W,X)}function NC($,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 ZC($,v,D){let X=YC((J,Q)=>{OC(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 OC($,v,D){try{let X=await HC($),U=await D(X);await wC(U,v)}catch(X){if(!v.headersSent){v.statusCode=500,v.setHeader("content-type","application/json"),v.end(JSON.stringify({error:L7(X)}));return}v.end()}}async function HC($){let v=FC($),D=jC($),X=$.method??"GET",U={method:X,headers:D},G=await AC($,X);if(G)U.body=G,U.duplex="half";return new Request(v,U)}function FC($){let v=$.socket,D=$.headers["x-forwarded-proto"]??(v?.encrypted?"https":"http"),X=$.headers.host??"localhost";return new URL($.url??"/",`${D}://${X}`).toString()}function jC($){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 AC($,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 wC($,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 MC($,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)),OH(J,G),!1}return OH(U,G)}function L7($){if($ instanceof Error)return $.message;return String($)}function HH(){return}var PC="aether-wealth-mcp",bC=[33417,33418,33419],qC="/callback",SC=["trades:read","trades:write","accounts:read","alerts:read","alerts:write"],kC="aether-wealth-mcp",EC="AETHER_MCP_CREDENTIALS_FILE",l1={clientId:PC,redirectPorts:bC,redirectPath:qC,scopes:SC,keychainService:kC,credentialsFilePath:k0("aether-wealth-mcp"),forceFileEnvVar:EC};function jH($={}){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, and charts 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, list_accounts, create_account, create_trade, update_trade, close_trade, delete_trade, delete_trades, import_trades, trade_stats"," • 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",...Y4?[]:[" • Charts: render_chart"]," • Broker execution: propose_trade, close_position, and modify_position create intents. Email/app modes need a user-provided code; auto mode needs no per-trade code. For push intents, do not ask for a code — use trade_intent_status to check the app approval outcome. disconnect_broker is the instant kill switch and requires no confirmation.","","Deletion rule:"," • delete_trade and delete_trades are permanent and only work on demo accounts. Live-account trade deletes are blocked by the backend.","","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(`
116
+ `)}}]},{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.",PX,"","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 ${f4} rather than attempting it over MCP.`].join(`
117
+ `)}}]}]}var AH="aether-wealth-mcp",B7="0.2.0";function TC($){return{toolContext:$.toolContext,tools:new Map(($.tools??I7()).map((v)=>[v.name,v])),resources:new Map(($.resources??y5()).map((v)=>[v.uri,v])),prompts:new Map(($.prompts??i5()).map((v)=>[v.name,v])),...$.clientGate?{clientGate:$.clientGate}:{},log:$.log??((v)=>{process.stderr.write(v)})}}function RC($,v){let D=new A0({name:AH,version:B7},{capabilities:{tools:{listChanged:!1},resources:{listChanged:!1,subscribe:!1},prompts:{listChanged:!1}}});return gC(D,$,v??$.toolContext),D}class oX{server;bundle;constructor($){this.bundle=TC($),this.server=RC(this.bundle),this.server.oninitialized=()=>{this.bundle.log(`${AH} initialized
118
+ `)}}async connect($){await this.server.connect($)}async close(){await this.server.close()}isInitialized(){return this.server.getClientVersion()!==void 0}getRegistryBundle(){return this.bundle}}function gC($,v,D){let X=!1,U=(J)=>{let Q=v.clientGate?.nudge;if(Q&&!X)return X=!0,`${Q}
119
119
 
120
- ${J}`;return J},G=(J)=>{let Q=v.clientGate?.nudge;if(!Q||X)return J;X=!0;let I=J.find((W)=>W.type==="text");if(I)return J.map((W)=>W===I?{type:"text",text:`${Q}
120
+ ${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}
121
121
 
122
- ${I.text}`}:W);return[{type:"text",text:Q},...J]};$.setRequestHandler(pv,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:I}=J.params,W=v.tools.get(Q);if(!W)throw new x(i.MethodNotFound,`tool not found: ${Q}`);let z=bX(W.inputSchema,I);if(!z.ok)throw new x(i.InvalidParams,`invalid arguments for ${Q}: ${z.reason}`);try{let Y=await W.handler(z.args,D),B=Tg(Y);if(B)return{content:G(B.content),isError:!1};return{content:[{type:"text",text:U(Eg(Y))}],isError:!1}}catch(Y){return{content:[{type:"text",text:ug(Y)}],isError:!0}}}),$.setRequestHandler(mv,async()=>({resources:Array.from(v.resources.values()).map((J)=>({uri:J.uri,name:J.name,description:J.description,mimeType:J.mimeType}))})),$.setRequestHandler(rv,async(J)=>{let{uri:Q}=J.params,I=v.resources.get(Q);if(!I)throw new x(i.MethodNotFound,`resource not found: ${Q}`);let W=await I.handler(D);return{contents:[{uri:Q,mimeType:I.mimeType,text:W.text}]}}),$.setRequestHandler(cv,async()=>({prompts:Array.from(v.prompts.values()).map((J)=>({name:J.name,description:J.description,...J.arguments?{arguments:J.arguments}:{}}))})),$.setRequestHandler(dv,async(J)=>{let{name:Q,arguments:I}=J.params,W=v.prompts.get(Q);if(!W)throw new x(i.MethodNotFound,`prompt not found: ${Q}`);let z={};for(let[B,V]of Object.entries(I??{}))if(typeof V==="string")z[B]=V;for(let B of W.arguments??[])if(B.required&&!(B.name in z))throw new x(i.InvalidParams,`prompts/get: missing required argument: ${B.name}`);let Y=W.handler(z);return{description:W.description,messages:Y}})}function Tg($){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 Eg($){if(typeof $==="string")return $;return JSON.stringify($,null,2)}function ug($){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 OA($={}){let v=$.includeAuthTools??!0,D=$.includeLiveChartTools??!0;return[...v?SX:[],...nX,...dX,..._X,...qX,...cX,...hX,...mX,...iX,...D?[...rX,...yX]:[]]}import HA from"node:process";class L5{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
123
- `);if($===-1)return null;let v=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),Rg(v)}clear(){this._buffer=void 0}}function Rg($){return iv.parse(JSON.parse($))}function AA($){return JSON.stringify($)+`
124
- `}class tX{constructor($=HA.stdin,v=HA.stdout){this._stdin=$,this._stdout=v,this._readBuffer=new L5,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=AA($);if(this._stdout.write(D))v();else this._stdout.once("drain",v)})}}async function gg(){let{config:$,errors:v}=X7(process.env);if(!$){process.stderr.write(`aether-wealth-mcp: missing required environment:
122
+ ${W.text}`}:z);return[{type:"text",text:Q},...J]};$.setRequestHandler(tv,async()=>({tools:Array.from(v.tools.values()).map((J)=>({name:J.name,description:J.description,inputSchema:J.inputSchema}))})),$.setRequestHandler(q6,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 x(f.MethodNotFound,`tool not found: ${Q}`);let Y=SX(z.inputSchema,W);if(!Y.ok)throw new x(f.InvalidParams,`invalid arguments for ${Q}: ${Y.reason}`);try{let I=await z.handler(Y.args,D),V=CC(I);if(V)return{content:G(V.content),isError:!1};return{content:[{type:"text",text:U(uC(I))}],isError:!1}}catch(I){return{content:[{type:"text",text:xC(I)}],isError:!0}}}),$.setRequestHandler(cv,async()=>({resources:Array.from(v.resources.values()).map((J)=>({uri:J.uri,name:J.name,description:J.description,mimeType:J.mimeType}))})),$.setRequestHandler(rv,async(J)=>{let{uri:Q}=J.params,W=v.resources.get(Q);if(!W)throw new x(f.MethodNotFound,`resource not found: ${Q}`);let z=await W.handler(D);return{contents:[{uri:Q,mimeType:W.mimeType,text:z.text}]}}),$.setRequestHandler(dv,async()=>({prompts:Array.from(v.prompts.values()).map((J)=>({name:J.name,description:J.description,...J.arguments?{arguments:J.arguments}:{}}))})),$.setRequestHandler(pv,async(J)=>{let{name:Q,arguments:W}=J.params,z=v.prompts.get(Q);if(!z)throw new x(f.MethodNotFound,`prompt not found: ${Q}`);let Y={};for(let[V,K]of Object.entries(W??{}))if(typeof K==="string")Y[V]=K;for(let V of z.arguments??[])if(V.required&&!(V.name in Y))throw new x(f.InvalidParams,`prompts/get: missing required argument: ${V.name}`);let I=z.handler(Y);return{description:z.description,messages:I}})}function CC($){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 uC($){if(typeof $==="string")return $;return JSON.stringify($,null,2)}function xC($){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 N7($={}){let v=$.includeAuthTools??!0,D=$.includeLiveChartTools??!1,X=$.includeRenderChartTools??!Y4;return[...v?EX:[],...nX,...tX,...lX,...kX,...pX,...cX,...rX,...X?iX:[],...D?[...dX,...hX]:[]]}import MH from"node:process";class Z7{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
123
+ `);if($===-1)return null;let v=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),fC(v)}clear(){this._buffer=void 0}}function fC($){return _v.parse(JSON.parse($))}function wH($){return JSON.stringify($)+`
124
+ `}class aX{constructor($=MH.stdin,v=MH.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=wH($);if(this._stdout.write(D))v();else this._stdout.once("drain",v)})}}async function _C(){let{config:$,errors:v}=QY(process.env);if(!$){process.stderr.write(`aether-wealth-mcp: missing required environment:
125
125
  `);for(let Q of v)process.stderr.write(` - ${Q}
126
126
  `);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"
127
127
  `),2;if(D!=="http"&&X==="oauth")return process.stderr.write(`aether-wealth-mcp: MCP_HTTP_AUTH=oauth (hosted mode) requires MCP_TRANSPORT=http
128
- `),2;if(D==="http"&&X==="oauth")return ig($);let U=await Cg($),G=await o0({ownVersion:V5,fetchMinVersion:()=>U.trpc.meta.clientRequirements.query().then((Q)=>Q.minMcpVersion),fetchLatestVersion:()=>t0(G7)}),J=new pX({toolContext:U,clientGate:G});if(D==="http")return xg(J,$);return fg(J,$)}async function Cg($){let v=await k0({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 jA(){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
129
- `),null;return v}function wA($,v){let D=async(X)=>{process.stderr.write(`aether-wealth-mcp: ${X} received, shutting down
130
- `),await $.close(),await v.close(),process.exit(0)};process.on("SIGINT",D),process.on("SIGTERM",D)}async function xg($,v){let D=jA();if(D===null)return 2;let X=await Y5($,{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})
131
- `),wA(X,$),0}async function ig($){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
128
+ `),2;if(D==="http"&&X==="oauth")return nC($);let U=await iC($),G=await a0({ownVersion:B7,fetchMinVersion:()=>U.trpc.meta.clientRequirements.query().then((Q)=>Q.minMcpVersion),fetchLatestVersion:()=>o0(WY)}),J=new oX({toolContext:U,clientGate:G,tools:N7({includeLiveChartTools:Boolean(process.env.AETHER_APP_PUSH_URL?.trim())})});if(D==="http")return yC(J,$);return lC(J,$)}async function iC($){let v=await E0({keychainService:l1.keychainService,credentialsFilePath:l1.credentialsFilePath,...l1.forceFileEnvVar?{forceFileEnvVar:l1.forceFileEnvVar}:{}}),D=new d1($,v,l1,{log:(U)=>process.stderr.write(U)}),X=t4($.trpcUrl,()=>D.getAccessToken());return{session:D,trpc:X}}function bH(){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
129
+ `),null;return v}function qH($,v){let D=async(X)=>{process.stderr.write(`aether-wealth-mcp: ${X} received, shutting down
130
+ `),await $.close(),await v.close(),process.exit(0)};process.on("SIGINT",D),process.on("SIGTERM",D)}async function yC($,v){let D=bH();if(D===null)return 2;let X=await K7($,{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})
131
+ `),qH(X,$),0}async function nC($){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
132
132
  `),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
133
133
  `),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}"
134
- `),2}if(D.protocol!=="https:"&&!H4(D.hostname))return process.stderr.write(`aether-wealth-mcp: MCP_PUBLIC_ORIGIN must use https (loopback exempt): "${v}"
135
- `),2;let X=jA();if(X===null)return 2;let U=Boolean(process.env.AETHER_APP_PUSH_URL?.trim()),G=new pX({toolContext:Q7($.trpcUrl),tools:OA({includeAuthTools:!1,includeLiveChartTools:U}),prompts:NA({hosted:!0})}),J=await Y5(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}${c4}`,trpcUrl:$.trpcUrl,tokenVerifier:I7({baseUrl:$.baseUrl}),rateLimiter:J7({...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})
136
- `),wA(J,G),0}async function fg($,v){let D=new tX;return await $.connect(D),process.stderr.write(`aether-wealth-mcp: ready (transport=stdio, base=${v.baseUrl})
137
- `),process.stdin.on("end",()=>{process.exit(0)}),0}var FA=await gg();if(FA!==0)process.exit(FA);
134
+ `),2}if(D.protocol!=="https:"&&!j4(D.hostname))return process.stderr.write(`aether-wealth-mcp: MCP_PUBLIC_ORIGIN must use https (loopback exempt): "${v}"
135
+ `),2;let X=bH();if(X===null)return 2;let U=Boolean(process.env.AETHER_APP_PUSH_URL?.trim()),G=new oX({toolContext:YY($.trpcUrl),tools:N7({includeAuthTools:!1,includeLiveChartTools:U}),prompts:jH({hosted:!0})}),J=await K7(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}${d4}`,trpcUrl:$.trpcUrl,tokenVerifier:IY({baseUrl:$.baseUrl}),rateLimiter:zY({...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})
136
+ `),qH(J,G),0}async function lC($,v){let D=new aX;return await $.connect(D),process.stderr.write(`aether-wealth-mcp: ready (transport=stdio, base=${v.baseUrl})
137
+ `),process.stdin.on("end",()=>{process.exit(0)}),0}var PH=await _C();if(PH!==0)process.exit(PH);