@sequenzy/mcp 0.0.10 → 0.0.12
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 +11 -11
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var Xz=Object.create;var{getPrototypeOf:Yz,defineProperty:e4,getOwnPropertyNames:Wz}=Object;var Gz=Object.prototype.hasOwnProperty;function Jz(Q){return this[Q]}var $z,zz,ZX=(Q,X,Y)=>{var W=Q!=null&&typeof Q==="object";if(W){var G=X?$z??=new WeakMap:zz??=new WeakMap,J=G.get(Q);if(J)return J}Y=Q!=null?Xz(Yz(Q)):{};let $=X||!Q||!Q.__esModule?e4(Y,"default",{value:Q,enumerable:!0}):Y;for(let z of Wz(Q))if(!Gz.call($,z))e4($,z,{get:Jz.bind(Q,z),enumerable:!0});if(W)G.set(Q,$);return $};var N=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports);var Hz=(Q)=>Q;function Bz(Q,X){this[Q]=Hz.bind(null,X)}var NX=(Q,X)=>{for(var Y in X)e4(Q,Y,{get:X[Y],enumerable:!0,configurable:!0,set:Bz.bind(X,Y)})};var $6=N((AG)=>{Object.defineProperty(AG,"__esModule",{value:!0});AG.regexpCode=AG.getEsmExportName=AG.getProperty=AG.safeStringify=AG.stringify=AG.strConcat=AG.addCodeArg=AG.str=AG._=AG.nil=AG._Code=AG.Name=AG.IDENTIFIER=AG._CodeOrName=void 0;class D4{}AG._CodeOrName=D4;AG.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class q1 extends D4{constructor(Q){super();if(!AG.IDENTIFIER.test(Q))throw Error("CodeGen: name must be a valid identifier");this.str=Q}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}AG.Name=q1;class P0 extends D4{constructor(Q){super();this._items=typeof Q==="string"?[Q]:Q}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let Q=this._items[0];return Q===""||Q==='""'}get str(){var Q;return(Q=this._str)!==null&&Q!==void 0?Q:this._str=this._items.reduce((X,Y)=>`${X}${Y}`,"")}get names(){var Q;return(Q=this._names)!==null&&Q!==void 0?Q:this._names=this._items.reduce((X,Y)=>{if(Y instanceof q1)X[Y.str]=(X[Y.str]||0)+1;return X},{})}}AG._Code=P0;AG.nil=new P0("");function KG(Q,...X){let Y=[Q[0]],W=0;while(W<X.length)z9(Y,X[W]),Y.push(Q[++W]);return new P0(Y)}AG._=KG;var $9=new P0("+");function DG(Q,...X){let Y=[J6(Q[0])],W=0;while(W<X.length)Y.push($9),z9(Y,X[W]),Y.push($9,J6(Q[++W]));return bB(Y),new P0(Y)}AG.str=DG;function z9(Q,X){if(X instanceof P0)Q.push(...X._items);else if(X instanceof q1)Q.push(X);else Q.push(TB(X))}AG.addCodeArg=z9;function bB(Q){let X=1;while(X<Q.length-1){if(Q[X]===$9){let Y=EB(Q[X-1],Q[X+1]);if(Y!==void 0){Q.splice(X-1,3,Y);continue}Q[X++]="+"}X++}}function EB(Q,X){if(X==='""')return Q;if(Q==='""')return X;if(typeof Q=="string"){if(X instanceof q1||Q[Q.length-1]!=='"')return;if(typeof X!="string")return`${Q.slice(0,-1)}${X}"`;if(X[0]==='"')return Q.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!(Q instanceof q1))return`"${Q}${X.slice(1)}`;return}function IB(Q,X){return X.emptyStr()?Q:Q.emptyStr()?X:DG`${Q}${X}`}AG.strConcat=IB;function TB(Q){return typeof Q=="number"||typeof Q=="boolean"||Q===null?Q:J6(Array.isArray(Q)?Q.join(","):Q)}function SB(Q){return new P0(J6(Q))}AG.stringify=SB;function J6(Q){return JSON.stringify(Q).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}AG.safeStringify=J6;function RB(Q){return typeof Q=="string"&&AG.IDENTIFIER.test(Q)?new P0(`.${Q}`):KG`[${Q}]`}AG.getProperty=RB;function CB(Q){if(typeof Q=="string"&&AG.IDENTIFIER.test(Q))return new P0(`${Q}`);throw Error(`CodeGen: invalid export name: ${Q}, use explicit $id name mapping`)}AG.getEsmExportName=CB;function kB(Q){return new P0(Q.toString())}AG.regexpCode=kB});var D9=N((OG)=>{Object.defineProperty(OG,"__esModule",{value:!0});OG.ValueScope=OG.ValueScopeName=OG.Scope=OG.varKinds=OG.UsedValueState=void 0;var D0=$6();class UG extends Error{constructor(Q){super(`CodeGen: "code" for ${Q} not defined`);this.value=Q.value}}var F4;(function(Q){Q[Q.Started=0]="Started",Q[Q.Completed=1]="Completed"})(F4||(OG.UsedValueState=F4={}));OG.varKinds={const:new D0.Name("const"),let:new D0.Name("let"),var:new D0.Name("var")};class B9{constructor({prefixes:Q,parent:X}={}){this._names={},this._prefixes=Q,this._parent=X}toName(Q){return Q instanceof D0.Name?Q:this.name(Q)}name(Q){return new D0.Name(this._newName(Q))}_newName(Q){let X=this._names[Q]||this._nameGroup(Q);return`${Q}${X.index++}`}_nameGroup(Q){var X,Y;if(((Y=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||Y===void 0?void 0:Y.has(Q))||this._prefixes&&!this._prefixes.has(Q))throw Error(`CodeGen: prefix "${Q}" is not allowed in this scope`);return this._names[Q]={prefix:Q,index:0}}}OG.Scope=B9;class K9 extends D0.Name{constructor(Q,X){super(X);this.prefix=Q}setValue(Q,{property:X,itemIndex:Y}){this.value=Q,this.scopePath=D0._`.${new D0.Name(X)}[${Y}]`}}OG.ValueScopeName=K9;var iB=D0._`\n`;class LG extends B9{constructor(Q){super(Q);this._values={},this._scope=Q.scope,this.opts={...Q,_n:Q.lines?iB:D0.nil}}get(){return this._scope}name(Q){return new K9(Q,this._newName(Q))}value(Q,X){var Y;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let W=this.toName(Q),{prefix:G}=W,J=(Y=X.key)!==null&&Y!==void 0?Y:X.ref,$=this._values[G];if($){let B=$.get(J);if(B)return B}else $=this._values[G]=new Map;$.set(J,W);let z=this._scope[G]||(this._scope[G]=[]),H=z.length;return z[H]=X.ref,W.setValue(X,{property:G,itemIndex:H}),W}getValue(Q,X){let Y=this._values[Q];if(!Y)return;return Y.get(X)}scopeRefs(Q,X=this._values){return this._reduceValues(X,(Y)=>{if(Y.scopePath===void 0)throw Error(`CodeGen: name "${Y}" has no value`);return D0._`${Q}${Y.scopePath}`})}scopeCode(Q=this._values,X,Y){return this._reduceValues(Q,(W)=>{if(W.value===void 0)throw Error(`CodeGen: name "${W}" has no value`);return W.value.code},X,Y)}_reduceValues(Q,X,Y={},W){let G=D0.nil;for(let J in Q){let $=Q[J];if(!$)continue;let z=Y[J]=Y[J]||new Map;$.forEach((H)=>{if(z.has(H))return;z.set(H,F4.Started);let B=X(H);if(B){let K=this.opts.es5?OG.varKinds.var:OG.varKinds.const;G=D0._`${G}${K} ${H} = ${B};${this.opts._n}`}else if(B=W===null||W===void 0?void 0:W(H))G=D0._`${G}${B}${this.opts._n}`;else throw new UG(H);z.set(H,F4.Completed)})}return G}}OG.ValueScope=LG});var k=N((A0)=>{Object.defineProperty(A0,"__esModule",{value:!0});A0.or=A0.and=A0.not=A0.CodeGen=A0.operators=A0.varKinds=A0.ValueScopeName=A0.ValueScope=A0.Scope=A0.Name=A0.regexpCode=A0.stringify=A0.getProperty=A0.nil=A0.strConcat=A0.str=A0._=void 0;var y=$6(),b0=D9(),a0=$6();Object.defineProperty(A0,"_",{enumerable:!0,get:function(){return a0._}});Object.defineProperty(A0,"str",{enumerable:!0,get:function(){return a0.str}});Object.defineProperty(A0,"strConcat",{enumerable:!0,get:function(){return a0.strConcat}});Object.defineProperty(A0,"nil",{enumerable:!0,get:function(){return a0.nil}});Object.defineProperty(A0,"getProperty",{enumerable:!0,get:function(){return a0.getProperty}});Object.defineProperty(A0,"stringify",{enumerable:!0,get:function(){return a0.stringify}});Object.defineProperty(A0,"regexpCode",{enumerable:!0,get:function(){return a0.regexpCode}});Object.defineProperty(A0,"Name",{enumerable:!0,get:function(){return a0.Name}});var Z4=D9();Object.defineProperty(A0,"Scope",{enumerable:!0,get:function(){return Z4.Scope}});Object.defineProperty(A0,"ValueScope",{enumerable:!0,get:function(){return Z4.ValueScope}});Object.defineProperty(A0,"ValueScopeName",{enumerable:!0,get:function(){return Z4.ValueScopeName}});Object.defineProperty(A0,"varKinds",{enumerable:!0,get:function(){return Z4.varKinds}});A0.operators={GT:new y._Code(">"),GTE:new y._Code(">="),LT:new y._Code("<"),LTE:new y._Code("<="),EQ:new y._Code("==="),NEQ:new y._Code("!=="),NOT:new y._Code("!"),OR:new y._Code("||"),AND:new y._Code("&&"),ADD:new y._Code("+")};class s0{optimizeNodes(){return this}optimizeNames(Q,X){return this}}class VG extends s0{constructor(Q,X,Y){super();this.varKind=Q,this.name=X,this.rhs=Y}render({es5:Q,_n:X}){let Y=Q?b0.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${Y} ${this.name}${W};`+X}optimizeNames(Q,X){if(!Q[this.name.str])return;if(this.rhs)this.rhs=j1(this.rhs,Q,X);return this}get names(){return this.rhs instanceof y._CodeOrName?this.rhs.names:{}}}class U9 extends s0{constructor(Q,X,Y){super();this.lhs=Q,this.rhs=X,this.sideEffects=Y}render({_n:Q}){return`${this.lhs} = ${this.rhs};`+Q}optimizeNames(Q,X){if(this.lhs instanceof y.Name&&!Q[this.lhs.str]&&!this.sideEffects)return;return this.rhs=j1(this.rhs,Q,X),this}get names(){let Q=this.lhs instanceof y.Name?{}:{...this.lhs.names};return V4(Q,this.rhs)}}class ZG extends U9{constructor(Q,X,Y,W){super(Q,Y,W);this.op=X}render({_n:Q}){return`${this.lhs} ${this.op}= ${this.rhs};`+Q}}class NG extends s0{constructor(Q){super();this.label=Q,this.names={}}render({_n:Q}){return`${this.label}:`+Q}}class qG extends s0{constructor(Q){super();this.label=Q,this.names={}}render({_n:Q}){return`break${this.label?` ${this.label}`:""};`+Q}}class wG extends s0{constructor(Q){super();this.error=Q}render({_n:Q}){return`throw ${this.error};`+Q}get names(){return this.error.names}}class jG extends s0{constructor(Q){super();this.code=Q}render({_n:Q}){return`${this.code};`+Q}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Q,X){return this.code=j1(this.code,Q,X),this}get names(){return this.code instanceof y._CodeOrName?this.code.names:{}}}class N4 extends s0{constructor(Q=[]){super();this.nodes=Q}render(Q){return this.nodes.reduce((X,Y)=>X+Y.render(Q),"")}optimizeNodes(){let{nodes:Q}=this,X=Q.length;while(X--){let Y=Q[X].optimizeNodes();if(Array.isArray(Y))Q.splice(X,1,...Y);else if(Y)Q[X]=Y;else Q.splice(X,1)}return Q.length>0?this:void 0}optimizeNames(Q,X){let{nodes:Y}=this,W=Y.length;while(W--){let G=Y[W];if(G.optimizeNames(Q,X))continue;oB(Q,G.names),Y.splice(W,1)}return Y.length>0?this:void 0}get names(){return this.nodes.reduce((Q,X)=>$1(Q,X.names),{})}}class e0 extends N4{render(Q){return"{"+Q._n+super.render(Q)+"}"+Q._n}}class PG extends N4{}class z6 extends e0{}z6.kind="else";class u0 extends e0{constructor(Q,X){super(X);this.condition=Q}render(Q){let X=`if(${this.condition})`+super.render(Q);if(this.else)X+="else "+this.else.render(Q);return X}optimizeNodes(){super.optimizeNodes();let Q=this.condition;if(Q===!0)return this.nodes;let X=this.else;if(X){let Y=X.optimizeNodes();X=this.else=Array.isArray(Y)?new z6(Y):Y}if(X){if(Q===!1)return X instanceof u0?X:X.nodes;if(this.nodes.length)return this;return new u0(SG(Q),X instanceof u0?[X]:X.nodes)}if(Q===!1||!this.nodes.length)return;return this}optimizeNames(Q,X){var Y;if(this.else=(Y=this.else)===null||Y===void 0?void 0:Y.optimizeNames(Q,X),!(super.optimizeNames(Q,X)||this.else))return;return this.condition=j1(this.condition,Q,X),this}get names(){let Q=super.names;if(V4(Q,this.condition),this.else)$1(Q,this.else.names);return Q}}u0.kind="if";class w1 extends e0{}w1.kind="for";class bG extends w1{constructor(Q){super();this.iteration=Q}render(Q){return`for(${this.iteration})`+super.render(Q)}optimizeNames(Q,X){if(!super.optimizeNames(Q,X))return;return this.iteration=j1(this.iteration,Q,X),this}get names(){return $1(super.names,this.iteration.names)}}class EG extends w1{constructor(Q,X,Y,W){super();this.varKind=Q,this.name=X,this.from=Y,this.to=W}render(Q){let X=Q.es5?b0.varKinds.var:this.varKind,{name:Y,from:W,to:G}=this;return`for(${X} ${Y}=${W}; ${Y}<${G}; ${Y}++)`+super.render(Q)}get names(){let Q=V4(super.names,this.from);return V4(Q,this.to)}}class A9 extends w1{constructor(Q,X,Y,W){super();this.loop=Q,this.varKind=X,this.name=Y,this.iterable=W}render(Q){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Q)}optimizeNames(Q,X){if(!super.optimizeNames(Q,X))return;return this.iterable=j1(this.iterable,Q,X),this}get names(){return $1(super.names,this.iterable.names)}}class U4 extends e0{constructor(Q,X,Y){super();this.name=Q,this.args=X,this.async=Y}render(Q){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Q)}}U4.kind="func";class L4 extends N4{render(Q){return"return "+super.render(Q)}}L4.kind="return";class IG extends e0{render(Q){let X="try"+super.render(Q);if(this.catch)X+=this.catch.render(Q);if(this.finally)X+=this.finally.render(Q);return X}optimizeNodes(){var Q,X;return super.optimizeNodes(),(Q=this.catch)===null||Q===void 0||Q.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(Q,X){var Y,W;return super.optimizeNames(Q,X),(Y=this.catch)===null||Y===void 0||Y.optimizeNames(Q,X),(W=this.finally)===null||W===void 0||W.optimizeNames(Q,X),this}get names(){let Q=super.names;if(this.catch)$1(Q,this.catch.names);if(this.finally)$1(Q,this.finally.names);return Q}}class O4 extends e0{constructor(Q){super();this.error=Q}render(Q){return`catch(${this.error})`+super.render(Q)}}O4.kind="catch";class M4 extends e0{render(Q){return"finally"+super.render(Q)}}M4.kind="finally";class TG{constructor(Q,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
3
|
-
`:""},this._extScope=Q,this._scope=new b0.Scope({parent:Q}),this._nodes=[new PG]}toString(){return this._root.render(this.opts)}name(Q){return this._scope.name(Q)}scopeName(Q){return this._extScope.name(Q)}scopeValue(Q,X){let Y=this._extScope.value(Q,X);return(this._values[Y.prefix]||(this._values[Y.prefix]=new Set)).add(Y),Y}getScopeValue(Q,X){return this._extScope.getValue(Q,X)}scopeRefs(Q){return this._extScope.scopeRefs(Q,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(Q,X,Y,W){let G=this._scope.toName(X);if(Y!==void 0&&W)this._constants[G.str]=Y;return this._leafNode(new VG(Q,G,Y)),G}const(Q,X,Y){return this._def(b0.varKinds.const,Q,X,Y)}let(Q,X,Y){return this._def(b0.varKinds.let,Q,X,Y)}var(Q,X,Y){return this._def(b0.varKinds.var,Q,X,Y)}assign(Q,X,Y){return this._leafNode(new U9(Q,X,Y))}add(Q,X){return this._leafNode(new ZG(Q,A0.operators.ADD,X))}code(Q){if(typeof Q=="function")Q();else if(Q!==y.nil)this._leafNode(new jG(Q));return this}object(...Q){let X=["{"];for(let[Y,W]of Q){if(X.length>1)X.push(",");if(X.push(Y),Y!==W||this.opts.es5)X.push(":"),(0,y.addCodeArg)(X,W)}return X.push("}"),new y._Code(X)}if(Q,X,Y){if(this._blockNode(new u0(Q)),X&&Y)this.code(X).else().code(Y).endIf();else if(X)this.code(X).endIf();else if(Y)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(Q){return this._elseNode(new u0(Q))}else(){return this._elseNode(new z6)}endIf(){return this._endBlockNode(u0,z6)}_for(Q,X){if(this._blockNode(Q),X)this.code(X).endFor();return this}for(Q,X){return this._for(new bG(Q),X)}forRange(Q,X,Y,W,G=this.opts.es5?b0.varKinds.var:b0.varKinds.let){let J=this._scope.toName(Q);return this._for(new EG(G,J,X,Y),()=>W(J))}forOf(Q,X,Y,W=b0.varKinds.const){let G=this._scope.toName(Q);if(this.opts.es5){let J=X instanceof y.Name?X:this.var("_arr",X);return this.forRange("_i",0,y._`${J}.length`,($)=>{this.var(G,y._`${J}[${$}]`),Y(G)})}return this._for(new A9("of",W,G,X),()=>Y(G))}forIn(Q,X,Y,W=this.opts.es5?b0.varKinds.var:b0.varKinds.const){if(this.opts.ownProperties)return this.forOf(Q,y._`Object.keys(${X})`,Y);let G=this._scope.toName(Q);return this._for(new A9("in",W,G,X),()=>Y(G))}endFor(){return this._endBlockNode(w1)}label(Q){return this._leafNode(new NG(Q))}break(Q){return this._leafNode(new qG(Q))}return(Q){let X=new L4;if(this._blockNode(X),this.code(Q),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(L4)}try(Q,X,Y){if(!X&&!Y)throw Error('CodeGen: "try" without "catch" and "finally"');let W=new IG;if(this._blockNode(W),this.code(Q),X){let G=this.name("e");this._currNode=W.catch=new O4(G),X(G)}if(Y)this._currNode=W.finally=new M4,this.code(Y);return this._endBlockNode(O4,M4)}throw(Q){return this._leafNode(new wG(Q))}block(Q,X){if(this._blockStarts.push(this._nodes.length),Q)this.code(Q).endBlock(X);return this}endBlock(Q){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let Y=this._nodes.length-X;if(Y<0||Q!==void 0&&Y!==Q)throw Error(`CodeGen: wrong number of nodes: ${Y} vs ${Q} expected`);return this._nodes.length=X,this}func(Q,X=y.nil,Y,W){if(this._blockNode(new U4(Q,X,Y)),W)this.code(W).endFunc();return this}endFunc(){return this._endBlockNode(U4)}optimize(Q=1){while(Q-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(Q){return this._currNode.nodes.push(Q),this}_blockNode(Q){this._currNode.nodes.push(Q),this._nodes.push(Q)}_endBlockNode(Q,X){let Y=this._currNode;if(Y instanceof Q||X&&Y instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${Q.kind}/${X.kind}`:Q.kind}"`)}_elseNode(Q){let X=this._currNode;if(!(X instanceof u0))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=Q,this}get _root(){return this._nodes[0]}get _currNode(){let Q=this._nodes;return Q[Q.length-1]}set _currNode(Q){let X=this._nodes;X[X.length-1]=Q}}A0.CodeGen=TG;function $1(Q,X){for(let Y in X)Q[Y]=(Q[Y]||0)+(X[Y]||0);return Q}function V4(Q,X){return X instanceof y._CodeOrName?$1(Q,X.names):Q}function j1(Q,X,Y){if(Q instanceof y.Name)return W(Q);if(!G(Q))return Q;return new y._Code(Q._items.reduce((J,$)=>{if($ instanceof y.Name)$=W($);if($ instanceof y._Code)J.push(...$._items);else J.push($);return J},[]));function W(J){let $=Y[J.str];if($===void 0||X[J.str]!==1)return J;return delete X[J.str],$}function G(J){return J instanceof y._Code&&J._items.some(($)=>$ instanceof y.Name&&X[$.str]===1&&Y[$.str]!==void 0)}}function oB(Q,X){for(let Y in X)Q[Y]=(Q[Y]||0)-(X[Y]||0)}function SG(Q){return typeof Q=="boolean"||typeof Q=="number"||Q===null?!Q:y._`!${F9(Q)}`}A0.not=SG;var tB=RG(A0.operators.AND);function aB(...Q){return Q.reduce(tB)}A0.and=aB;var sB=RG(A0.operators.OR);function eB(...Q){return Q.reduce(sB)}A0.or=eB;function RG(Q){return(X,Y)=>X===y.nil?Y:Y===y.nil?X:y._`${F9(X)} ${Q} ${F9(Y)}`}function F9(Q){return Q instanceof y.Name?Q:y._`(${Q})`}});var u=N((uG)=>{Object.defineProperty(uG,"__esModule",{value:!0});uG.checkStrictMode=uG.getErrorPath=uG.Type=uG.useFunc=uG.setEvaluated=uG.evaluatedPropsToName=uG.mergeEvaluated=uG.eachItem=uG.unescapeJsonPointer=uG.escapeJsonPointer=uG.escapeFragment=uG.unescapeFragment=uG.schemaRefOrVal=uG.schemaHasRulesButRef=uG.schemaHasRules=uG.checkUnknownRules=uG.alwaysValidSchema=uG.toHash=void 0;var m=k(),WK=$6();function GK(Q){let X={};for(let Y of Q)X[Y]=!0;return X}uG.toHash=GK;function JK(Q,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return xG(Q,X),!_G(X,Q.self.RULES.all)}uG.alwaysValidSchema=JK;function xG(Q,X=Q.schema){let{opts:Y,self:W}=Q;if(!Y.strictSchema)return;if(typeof X==="boolean")return;let G=W.RULES.keywords;for(let J in X)if(!G[J])hG(Q,`unknown keyword: "${J}"`)}uG.checkUnknownRules=xG;function _G(Q,X){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(X[Y])return!0;return!1}uG.schemaHasRules=_G;function $K(Q,X){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(Y!=="$ref"&&X.all[Y])return!0;return!1}uG.schemaHasRulesButRef=$K;function zK({topSchemaRef:Q,schemaPath:X},Y,W,G){if(!G){if(typeof Y=="number"||typeof Y=="boolean")return Y;if(typeof Y=="string")return m._`${Y}`}return m._`${Q}${X}${(0,m.getProperty)(W)}`}uG.schemaRefOrVal=zK;function HK(Q){return yG(decodeURIComponent(Q))}uG.unescapeFragment=HK;function BK(Q){return encodeURIComponent(O9(Q))}uG.escapeFragment=BK;function O9(Q){if(typeof Q=="number")return`${Q}`;return Q.replace(/~/g,"~0").replace(/\//g,"~1")}uG.escapeJsonPointer=O9;function yG(Q){return Q.replace(/~1/g,"/").replace(/~0/g,"~")}uG.unescapeJsonPointer=yG;function KK(Q,X){if(Array.isArray(Q))for(let Y of Q)X(Y);else X(Q)}uG.eachItem=KK;function kG({mergeNames:Q,mergeToName:X,mergeValues:Y,resultToName:W}){return(G,J,$,z)=>{let H=$===void 0?J:$ instanceof m.Name?(J instanceof m.Name?Q(G,J,$):X(G,J,$),$):J instanceof m.Name?(X(G,$,J),J):Y(J,$);return z===m.Name&&!(H instanceof m.Name)?W(G,H):H}}uG.mergeEvaluated={props:kG({mergeNames:(Q,X,Y)=>Q.if(m._`${Y} !== true && ${X} !== undefined`,()=>{Q.if(m._`${X} === true`,()=>Q.assign(Y,!0),()=>Q.assign(Y,m._`${Y} || {}`).code(m._`Object.assign(${Y}, ${X})`))}),mergeToName:(Q,X,Y)=>Q.if(m._`${Y} !== true`,()=>{if(X===!0)Q.assign(Y,!0);else Q.assign(Y,m._`${Y} || {}`),M9(Q,Y,X)}),mergeValues:(Q,X)=>Q===!0?!0:{...Q,...X},resultToName:gG}),items:kG({mergeNames:(Q,X,Y)=>Q.if(m._`${Y} !== true && ${X} !== undefined`,()=>Q.assign(Y,m._`${X} === true ? true : ${Y} > ${X} ? ${Y} : ${X}`)),mergeToName:(Q,X,Y)=>Q.if(m._`${Y} !== true`,()=>Q.assign(Y,X===!0?!0:m._`${Y} > ${X} ? ${Y} : ${X}`)),mergeValues:(Q,X)=>Q===!0?!0:Math.max(Q,X),resultToName:(Q,X)=>Q.var("items",X)})};function gG(Q,X){if(X===!0)return Q.var("props",!0);let Y=Q.var("props",m._`{}`);if(X!==void 0)M9(Q,Y,X);return Y}uG.evaluatedPropsToName=gG;function M9(Q,X,Y){Object.keys(Y).forEach((W)=>Q.assign(m._`${X}${(0,m.getProperty)(W)}`,!0))}uG.setEvaluated=M9;var vG={};function DK(Q,X){return Q.scopeValue("func",{ref:X,code:vG[X.code]||(vG[X.code]=new WK._Code(X.code))})}uG.useFunc=DK;var L9;(function(Q){Q[Q.Num=0]="Num",Q[Q.Str=1]="Str"})(L9||(uG.Type=L9={}));function AK(Q,X,Y){if(Q instanceof m.Name){let W=X===L9.Num;return Y?W?m._`"[" + ${Q} + "]"`:m._`"['" + ${Q} + "']"`:W?m._`"/" + ${Q}`:m._`"/" + ${Q}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Y?(0,m.getProperty)(Q).toString():"/"+O9(Q)}uG.getErrorPath=AK;function hG(Q,X,Y=Q.opts.strictSchema){if(!Y)return;if(X=`strict mode: ${X}`,Y===!0)throw Error(X);Q.self.logger.warn(X)}uG.checkStrictMode=hG});var f0=N((lG)=>{Object.defineProperty(lG,"__esModule",{value:!0});var $0=k(),RK={data:new $0.Name("data"),valCxt:new $0.Name("valCxt"),instancePath:new $0.Name("instancePath"),parentData:new $0.Name("parentData"),parentDataProperty:new $0.Name("parentDataProperty"),rootData:new $0.Name("rootData"),dynamicAnchors:new $0.Name("dynamicAnchors"),vErrors:new $0.Name("vErrors"),errors:new $0.Name("errors"),this:new $0.Name("this"),self:new $0.Name("self"),scope:new $0.Name("scope"),json:new $0.Name("json"),jsonPos:new $0.Name("jsonPos"),jsonLen:new $0.Name("jsonLen"),jsonPart:new $0.Name("jsonPart")};lG.default=RK});var H6=N((iG)=>{Object.defineProperty(iG,"__esModule",{value:!0});iG.extendErrors=iG.resetErrorsCount=iG.reportExtraError=iG.reportError=iG.keyword$DataError=iG.keywordError=void 0;var g=k(),w4=u(),H0=f0();iG.keywordError={message:({keyword:Q})=>g.str`must pass "${Q}" keyword validation`};iG.keyword$DataError={message:({keyword:Q,schemaType:X})=>X?g.str`"${Q}" keyword must be ${X} ($data)`:g.str`"${Q}" keyword is invalid ($data)`};function kK(Q,X=iG.keywordError,Y,W){let{it:G}=Q,{gen:J,compositeRule:$,allErrors:z}=G,H=pG(Q,X,Y);if(W!==null&&W!==void 0?W:$||z)mG(J,H);else cG(G,g._`[${H}]`)}iG.reportError=kK;function vK(Q,X=iG.keywordError,Y){let{it:W}=Q,{gen:G,compositeRule:J,allErrors:$}=W,z=pG(Q,X,Y);if(mG(G,z),!(J||$))cG(W,H0.default.vErrors)}iG.reportExtraError=vK;function xK(Q,X){Q.assign(H0.default.errors,X),Q.if(g._`${H0.default.vErrors} !== null`,()=>Q.if(X,()=>Q.assign(g._`${H0.default.vErrors}.length`,X),()=>Q.assign(H0.default.vErrors,null)))}iG.resetErrorsCount=xK;function _K({gen:Q,keyword:X,schemaValue:Y,data:W,errsCount:G,it:J}){if(G===void 0)throw Error("ajv implementation error");let $=Q.name("err");Q.forRange("i",G,H0.default.errors,(z)=>{if(Q.const($,g._`${H0.default.vErrors}[${z}]`),Q.if(g._`${$}.instancePath === undefined`,()=>Q.assign(g._`${$}.instancePath`,(0,g.strConcat)(H0.default.instancePath,J.errorPath))),Q.assign(g._`${$}.schemaPath`,g.str`${J.errSchemaPath}/${X}`),J.opts.verbose)Q.assign(g._`${$}.schema`,Y),Q.assign(g._`${$}.data`,W)})}iG.extendErrors=_K;function mG(Q,X){let Y=Q.const("err",X);Q.if(g._`${H0.default.vErrors} === null`,()=>Q.assign(H0.default.vErrors,g._`[${Y}]`),g._`${H0.default.vErrors}.push(${Y})`),Q.code(g._`${H0.default.errors}++`)}function cG(Q,X){let{gen:Y,validateName:W,schemaEnv:G}=Q;if(G.$async)Y.throw(g._`new ${Q.ValidationError}(${X})`);else Y.assign(g._`${W}.errors`,X),Y.return(!1)}var z1={keyword:new g.Name("keyword"),schemaPath:new g.Name("schemaPath"),params:new g.Name("params"),propertyName:new g.Name("propertyName"),message:new g.Name("message"),schema:new g.Name("schema"),parentSchema:new g.Name("parentSchema")};function pG(Q,X,Y){let{createErrors:W}=Q.it;if(W===!1)return g._`{}`;return yK(Q,X,Y)}function yK(Q,X,Y={}){let{gen:W,it:G}=Q,J=[gK(G,Y),hK(Q,Y)];return uK(Q,X,J),W.object(...J)}function gK({errorPath:Q},{instancePath:X}){let Y=X?g.str`${Q}${(0,w4.getErrorPath)(X,w4.Type.Str)}`:Q;return[H0.default.instancePath,(0,g.strConcat)(H0.default.instancePath,Y)]}function hK({keyword:Q,it:{errSchemaPath:X}},{schemaPath:Y,parentSchema:W}){let G=W?X:g.str`${X}/${Q}`;if(Y)G=g.str`${G}${(0,w4.getErrorPath)(Y,w4.Type.Str)}`;return[z1.schemaPath,G]}function uK(Q,{params:X,message:Y},W){let{keyword:G,data:J,schemaValue:$,it:z}=Q,{opts:H,propertyName:B,topSchemaRef:K,schemaPath:D}=z;if(W.push([z1.keyword,G],[z1.params,typeof X=="function"?X(Q):X||g._`{}`]),H.messages)W.push([z1.message,typeof Y=="function"?Y(Q):Y]);if(H.verbose)W.push([z1.schema,$],[z1.parentSchema,g._`${K}${D}`],[H0.default.data,J]);if(B)W.push([z1.propertyName,B])}});var tG=N((rG)=>{Object.defineProperty(rG,"__esModule",{value:!0});rG.boolOrEmptySchema=rG.topBoolOrEmptySchema=void 0;var pK=H6(),iK=k(),nK=f0(),dK={message:"boolean schema is false"};function rK(Q){let{gen:X,schema:Y,validateName:W}=Q;if(Y===!1)dG(Q,!1);else if(typeof Y=="object"&&Y.$async===!0)X.return(nK.default.data);else X.assign(iK._`${W}.errors`,null),X.return(!0)}rG.topBoolOrEmptySchema=rK;function oK(Q,X){let{gen:Y,schema:W}=Q;if(W===!1)Y.var(X,!1),dG(Q);else Y.var(X,!0)}rG.boolOrEmptySchema=oK;function dG(Q,X){let{gen:Y,data:W}=Q,G={gen:Y,keyword:"false schema",data:W,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:Q};(0,pK.reportError)(G,dK,void 0,X)}});var Z9=N((aG)=>{Object.defineProperty(aG,"__esModule",{value:!0});aG.getRules=aG.isJSONType=void 0;var aK=["string","number","integer","boolean","null","object","array"],sK=new Set(aK);function eK(Q){return typeof Q=="string"&&sK.has(Q)}aG.isJSONType=eK;function QD(){let Q={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...Q,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},Q.number,Q.string,Q.array,Q.object],post:{rules:[]},all:{},keywords:{}}}aG.getRules=QD});var N9=N((XJ)=>{Object.defineProperty(XJ,"__esModule",{value:!0});XJ.shouldUseRule=XJ.shouldUseGroup=XJ.schemaHasRulesForType=void 0;function YD({schema:Q,self:X},Y){let W=X.RULES.types[Y];return W&&W!==!0&&eG(Q,W)}XJ.schemaHasRulesForType=YD;function eG(Q,X){return X.rules.some((Y)=>QJ(Q,Y))}XJ.shouldUseGroup=eG;function QJ(Q,X){var Y;return Q[X.keyword]!==void 0||((Y=X.definition.implements)===null||Y===void 0?void 0:Y.some((W)=>Q[W]!==void 0))}XJ.shouldUseRule=QJ});var B6=N(($J)=>{Object.defineProperty($J,"__esModule",{value:!0});$J.reportTypeError=$J.checkDataTypes=$J.checkDataType=$J.coerceAndCheckDataType=$J.getJSONTypes=$J.getSchemaTypes=$J.DataType=void 0;var JD=Z9(),$D=N9(),zD=H6(),R=k(),WJ=u(),P1;(function(Q){Q[Q.Correct=0]="Correct",Q[Q.Wrong=1]="Wrong"})(P1||($J.DataType=P1={}));function HD(Q){let X=GJ(Q.type);if(X.includes("null")){if(Q.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&Q.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(Q.nullable===!0)X.push("null")}return X}$J.getSchemaTypes=HD;function GJ(Q){let X=Array.isArray(Q)?Q:Q?[Q]:[];if(X.every(JD.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}$J.getJSONTypes=GJ;function BD(Q,X){let{gen:Y,data:W,opts:G}=Q,J=KD(X,G.coerceTypes),$=X.length>0&&!(J.length===0&&X.length===1&&(0,$D.schemaHasRulesForType)(Q,X[0]));if($){let z=w9(X,W,G.strictNumbers,P1.Wrong);Y.if(z,()=>{if(J.length)DD(Q,X,J);else j9(Q)})}return $}$J.coerceAndCheckDataType=BD;var JJ=new Set(["string","number","integer","boolean","null"]);function KD(Q,X){return X?Q.filter((Y)=>JJ.has(Y)||X==="array"&&Y==="array"):[]}function DD(Q,X,Y){let{gen:W,data:G,opts:J}=Q,$=W.let("dataType",R._`typeof ${G}`),z=W.let("coerced",R._`undefined`);if(J.coerceTypes==="array")W.if(R._`${$} == 'object' && Array.isArray(${G}) && ${G}.length == 1`,()=>W.assign(G,R._`${G}[0]`).assign($,R._`typeof ${G}`).if(w9(X,G,J.strictNumbers),()=>W.assign(z,G)));W.if(R._`${z} !== undefined`);for(let B of Y)if(JJ.has(B)||B==="array"&&J.coerceTypes==="array")H(B);W.else(),j9(Q),W.endIf(),W.if(R._`${z} !== undefined`,()=>{W.assign(G,z),AD(Q,z)});function H(B){switch(B){case"string":W.elseIf(R._`${$} == "number" || ${$} == "boolean"`).assign(z,R._`"" + ${G}`).elseIf(R._`${G} === null`).assign(z,R._`""`);return;case"number":W.elseIf(R._`${$} == "boolean" || ${G} === null
|
|
2
|
+
var Yz=Object.create;var{getPrototypeOf:Wz,defineProperty:QQ,getOwnPropertyNames:Gz}=Object;var Jz=Object.prototype.hasOwnProperty;function $z(Q){return this[Q]}var zz,Hz,NX=(Q,X,Y)=>{var W=Q!=null&&typeof Q==="object";if(W){var G=X?zz??=new WeakMap:Hz??=new WeakMap,J=G.get(Q);if(J)return J}Y=Q!=null?Yz(Wz(Q)):{};let $=X||!Q||!Q.__esModule?QQ(Y,"default",{value:Q,enumerable:!0}):Y;for(let z of Gz(Q))if(!Jz.call($,z))QQ($,z,{get:$z.bind(Q,z),enumerable:!0});if(W)G.set(Q,$);return $};var N=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports);var Kz=(Q)=>Q;function Bz(Q,X){this[Q]=Kz.bind(null,X)}var qX=(Q,X)=>{for(var Y in X)QQ(Q,Y,{get:X[Y],enumerable:!0,configurable:!0,set:Bz.bind(X,Y)})};var $6=N((FG)=>{Object.defineProperty(FG,"__esModule",{value:!0});FG.regexpCode=FG.getEsmExportName=FG.getProperty=FG.safeStringify=FG.stringify=FG.strConcat=FG.addCodeArg=FG.str=FG._=FG.nil=FG._Code=FG.Name=FG.IDENTIFIER=FG._CodeOrName=void 0;class D4{}FG._CodeOrName=D4;FG.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class q1 extends D4{constructor(Q){super();if(!FG.IDENTIFIER.test(Q))throw Error("CodeGen: name must be a valid identifier");this.str=Q}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}FG.Name=q1;class P0 extends D4{constructor(Q){super();this._items=typeof Q==="string"?[Q]:Q}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let Q=this._items[0];return Q===""||Q==='""'}get str(){var Q;return(Q=this._str)!==null&&Q!==void 0?Q:this._str=this._items.reduce((X,Y)=>`${X}${Y}`,"")}get names(){var Q;return(Q=this._names)!==null&&Q!==void 0?Q:this._names=this._items.reduce((X,Y)=>{if(Y instanceof q1)X[Y.str]=(X[Y.str]||0)+1;return X},{})}}FG._Code=P0;FG.nil=new P0("");function DG(Q,...X){let Y=[Q[0]],W=0;while(W<X.length)H9(Y,X[W]),Y.push(Q[++W]);return new P0(Y)}FG._=DG;var z9=new P0("+");function AG(Q,...X){let Y=[J6(Q[0])],W=0;while(W<X.length)Y.push(z9),H9(Y,X[W]),Y.push(z9,J6(Q[++W]));return EK(Y),new P0(Y)}FG.str=AG;function H9(Q,X){if(X instanceof P0)Q.push(...X._items);else if(X instanceof q1)Q.push(X);else Q.push(SK(X))}FG.addCodeArg=H9;function EK(Q){let X=1;while(X<Q.length-1){if(Q[X]===z9){let Y=IK(Q[X-1],Q[X+1]);if(Y!==void 0){Q.splice(X-1,3,Y);continue}Q[X++]="+"}X++}}function IK(Q,X){if(X==='""')return Q;if(Q==='""')return X;if(typeof Q=="string"){if(X instanceof q1||Q[Q.length-1]!=='"')return;if(typeof X!="string")return`${Q.slice(0,-1)}${X}"`;if(X[0]==='"')return Q.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!(Q instanceof q1))return`"${Q}${X.slice(1)}`;return}function TK(Q,X){return X.emptyStr()?Q:Q.emptyStr()?X:AG`${Q}${X}`}FG.strConcat=TK;function SK(Q){return typeof Q=="number"||typeof Q=="boolean"||Q===null?Q:J6(Array.isArray(Q)?Q.join(","):Q)}function RK(Q){return new P0(J6(Q))}FG.stringify=RK;function J6(Q){return JSON.stringify(Q).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}FG.safeStringify=J6;function CK(Q){return typeof Q=="string"&&FG.IDENTIFIER.test(Q)?new P0(`.${Q}`):DG`[${Q}]`}FG.getProperty=CK;function kK(Q){if(typeof Q=="string"&&FG.IDENTIFIER.test(Q))return new P0(`${Q}`);throw Error(`CodeGen: invalid export name: ${Q}, use explicit $id name mapping`)}FG.getEsmExportName=kK;function vK(Q){return new P0(Q.toString())}FG.regexpCode=vK});var A9=N((MG)=>{Object.defineProperty(MG,"__esModule",{value:!0});MG.ValueScope=MG.ValueScopeName=MG.Scope=MG.varKinds=MG.UsedValueState=void 0;var D0=$6();class LG extends Error{constructor(Q){super(`CodeGen: "code" for ${Q} not defined`);this.value=Q.value}}var F4;(function(Q){Q[Q.Started=0]="Started",Q[Q.Completed=1]="Completed"})(F4||(MG.UsedValueState=F4={}));MG.varKinds={const:new D0.Name("const"),let:new D0.Name("let"),var:new D0.Name("var")};class B9{constructor({prefixes:Q,parent:X}={}){this._names={},this._prefixes=Q,this._parent=X}toName(Q){return Q instanceof D0.Name?Q:this.name(Q)}name(Q){return new D0.Name(this._newName(Q))}_newName(Q){let X=this._names[Q]||this._nameGroup(Q);return`${Q}${X.index++}`}_nameGroup(Q){var X,Y;if(((Y=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||Y===void 0?void 0:Y.has(Q))||this._prefixes&&!this._prefixes.has(Q))throw Error(`CodeGen: prefix "${Q}" is not allowed in this scope`);return this._names[Q]={prefix:Q,index:0}}}MG.Scope=B9;class D9 extends D0.Name{constructor(Q,X){super(X);this.prefix=Q}setValue(Q,{property:X,itemIndex:Y}){this.value=Q,this.scopePath=D0._`.${new D0.Name(X)}[${Y}]`}}MG.ValueScopeName=D9;var nK=D0._`\n`;class OG extends B9{constructor(Q){super(Q);this._values={},this._scope=Q.scope,this.opts={...Q,_n:Q.lines?nK:D0.nil}}get(){return this._scope}name(Q){return new D9(Q,this._newName(Q))}value(Q,X){var Y;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let W=this.toName(Q),{prefix:G}=W,J=(Y=X.key)!==null&&Y!==void 0?Y:X.ref,$=this._values[G];if($){let K=$.get(J);if(K)return K}else $=this._values[G]=new Map;$.set(J,W);let z=this._scope[G]||(this._scope[G]=[]),H=z.length;return z[H]=X.ref,W.setValue(X,{property:G,itemIndex:H}),W}getValue(Q,X){let Y=this._values[Q];if(!Y)return;return Y.get(X)}scopeRefs(Q,X=this._values){return this._reduceValues(X,(Y)=>{if(Y.scopePath===void 0)throw Error(`CodeGen: name "${Y}" has no value`);return D0._`${Q}${Y.scopePath}`})}scopeCode(Q=this._values,X,Y){return this._reduceValues(Q,(W)=>{if(W.value===void 0)throw Error(`CodeGen: name "${W}" has no value`);return W.value.code},X,Y)}_reduceValues(Q,X,Y={},W){let G=D0.nil;for(let J in Q){let $=Q[J];if(!$)continue;let z=Y[J]=Y[J]||new Map;$.forEach((H)=>{if(z.has(H))return;z.set(H,F4.Started);let K=X(H);if(K){let B=this.opts.es5?MG.varKinds.var:MG.varKinds.const;G=D0._`${G}${B} ${H} = ${K};${this.opts._n}`}else if(K=W===null||W===void 0?void 0:W(H))G=D0._`${G}${K}${this.opts._n}`;else throw new LG(H);z.set(H,F4.Completed)})}return G}}MG.ValueScope=OG});var k=N((A0)=>{Object.defineProperty(A0,"__esModule",{value:!0});A0.or=A0.and=A0.not=A0.CodeGen=A0.operators=A0.varKinds=A0.ValueScopeName=A0.ValueScope=A0.Scope=A0.Name=A0.regexpCode=A0.stringify=A0.getProperty=A0.nil=A0.strConcat=A0.str=A0._=void 0;var y=$6(),b0=A9(),a0=$6();Object.defineProperty(A0,"_",{enumerable:!0,get:function(){return a0._}});Object.defineProperty(A0,"str",{enumerable:!0,get:function(){return a0.str}});Object.defineProperty(A0,"strConcat",{enumerable:!0,get:function(){return a0.strConcat}});Object.defineProperty(A0,"nil",{enumerable:!0,get:function(){return a0.nil}});Object.defineProperty(A0,"getProperty",{enumerable:!0,get:function(){return a0.getProperty}});Object.defineProperty(A0,"stringify",{enumerable:!0,get:function(){return a0.stringify}});Object.defineProperty(A0,"regexpCode",{enumerable:!0,get:function(){return a0.regexpCode}});Object.defineProperty(A0,"Name",{enumerable:!0,get:function(){return a0.Name}});var Z4=A9();Object.defineProperty(A0,"Scope",{enumerable:!0,get:function(){return Z4.Scope}});Object.defineProperty(A0,"ValueScope",{enumerable:!0,get:function(){return Z4.ValueScope}});Object.defineProperty(A0,"ValueScopeName",{enumerable:!0,get:function(){return Z4.ValueScopeName}});Object.defineProperty(A0,"varKinds",{enumerable:!0,get:function(){return Z4.varKinds}});A0.operators={GT:new y._Code(">"),GTE:new y._Code(">="),LT:new y._Code("<"),LTE:new y._Code("<="),EQ:new y._Code("==="),NEQ:new y._Code("!=="),NOT:new y._Code("!"),OR:new y._Code("||"),AND:new y._Code("&&"),ADD:new y._Code("+")};class s0{optimizeNodes(){return this}optimizeNames(Q,X){return this}}class ZG extends s0{constructor(Q,X,Y){super();this.varKind=Q,this.name=X,this.rhs=Y}render({es5:Q,_n:X}){let Y=Q?b0.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${Y} ${this.name}${W};`+X}optimizeNames(Q,X){if(!Q[this.name.str])return;if(this.rhs)this.rhs=j1(this.rhs,Q,X);return this}get names(){return this.rhs instanceof y._CodeOrName?this.rhs.names:{}}}class L9 extends s0{constructor(Q,X,Y){super();this.lhs=Q,this.rhs=X,this.sideEffects=Y}render({_n:Q}){return`${this.lhs} = ${this.rhs};`+Q}optimizeNames(Q,X){if(this.lhs instanceof y.Name&&!Q[this.lhs.str]&&!this.sideEffects)return;return this.rhs=j1(this.rhs,Q,X),this}get names(){let Q=this.lhs instanceof y.Name?{}:{...this.lhs.names};return V4(Q,this.rhs)}}class NG extends L9{constructor(Q,X,Y,W){super(Q,Y,W);this.op=X}render({_n:Q}){return`${this.lhs} ${this.op}= ${this.rhs};`+Q}}class qG extends s0{constructor(Q){super();this.label=Q,this.names={}}render({_n:Q}){return`${this.label}:`+Q}}class wG extends s0{constructor(Q){super();this.label=Q,this.names={}}render({_n:Q}){return`break${this.label?` ${this.label}`:""};`+Q}}class jG extends s0{constructor(Q){super();this.error=Q}render({_n:Q}){return`throw ${this.error};`+Q}get names(){return this.error.names}}class PG extends s0{constructor(Q){super();this.code=Q}render({_n:Q}){return`${this.code};`+Q}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Q,X){return this.code=j1(this.code,Q,X),this}get names(){return this.code instanceof y._CodeOrName?this.code.names:{}}}class N4 extends s0{constructor(Q=[]){super();this.nodes=Q}render(Q){return this.nodes.reduce((X,Y)=>X+Y.render(Q),"")}optimizeNodes(){let{nodes:Q}=this,X=Q.length;while(X--){let Y=Q[X].optimizeNodes();if(Array.isArray(Y))Q.splice(X,1,...Y);else if(Y)Q[X]=Y;else Q.splice(X,1)}return Q.length>0?this:void 0}optimizeNames(Q,X){let{nodes:Y}=this,W=Y.length;while(W--){let G=Y[W];if(G.optimizeNames(Q,X))continue;tK(Q,G.names),Y.splice(W,1)}return Y.length>0?this:void 0}get names(){return this.nodes.reduce((Q,X)=>$1(Q,X.names),{})}}class e0 extends N4{render(Q){return"{"+Q._n+super.render(Q)+"}"+Q._n}}class bG extends N4{}class z6 extends e0{}z6.kind="else";class u0 extends e0{constructor(Q,X){super(X);this.condition=Q}render(Q){let X=`if(${this.condition})`+super.render(Q);if(this.else)X+="else "+this.else.render(Q);return X}optimizeNodes(){super.optimizeNodes();let Q=this.condition;if(Q===!0)return this.nodes;let X=this.else;if(X){let Y=X.optimizeNodes();X=this.else=Array.isArray(Y)?new z6(Y):Y}if(X){if(Q===!1)return X instanceof u0?X:X.nodes;if(this.nodes.length)return this;return new u0(RG(Q),X instanceof u0?[X]:X.nodes)}if(Q===!1||!this.nodes.length)return;return this}optimizeNames(Q,X){var Y;if(this.else=(Y=this.else)===null||Y===void 0?void 0:Y.optimizeNames(Q,X),!(super.optimizeNames(Q,X)||this.else))return;return this.condition=j1(this.condition,Q,X),this}get names(){let Q=super.names;if(V4(Q,this.condition),this.else)$1(Q,this.else.names);return Q}}u0.kind="if";class w1 extends e0{}w1.kind="for";class EG extends w1{constructor(Q){super();this.iteration=Q}render(Q){return`for(${this.iteration})`+super.render(Q)}optimizeNames(Q,X){if(!super.optimizeNames(Q,X))return;return this.iteration=j1(this.iteration,Q,X),this}get names(){return $1(super.names,this.iteration.names)}}class IG extends w1{constructor(Q,X,Y,W){super();this.varKind=Q,this.name=X,this.from=Y,this.to=W}render(Q){let X=Q.es5?b0.varKinds.var:this.varKind,{name:Y,from:W,to:G}=this;return`for(${X} ${Y}=${W}; ${Y}<${G}; ${Y}++)`+super.render(Q)}get names(){let Q=V4(super.names,this.from);return V4(Q,this.to)}}class F9 extends w1{constructor(Q,X,Y,W){super();this.loop=Q,this.varKind=X,this.name=Y,this.iterable=W}render(Q){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Q)}optimizeNames(Q,X){if(!super.optimizeNames(Q,X))return;return this.iterable=j1(this.iterable,Q,X),this}get names(){return $1(super.names,this.iterable.names)}}class U4 extends e0{constructor(Q,X,Y){super();this.name=Q,this.args=X,this.async=Y}render(Q){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Q)}}U4.kind="func";class L4 extends N4{render(Q){return"return "+super.render(Q)}}L4.kind="return";class TG extends e0{render(Q){let X="try"+super.render(Q);if(this.catch)X+=this.catch.render(Q);if(this.finally)X+=this.finally.render(Q);return X}optimizeNodes(){var Q,X;return super.optimizeNodes(),(Q=this.catch)===null||Q===void 0||Q.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(Q,X){var Y,W;return super.optimizeNames(Q,X),(Y=this.catch)===null||Y===void 0||Y.optimizeNames(Q,X),(W=this.finally)===null||W===void 0||W.optimizeNames(Q,X),this}get names(){let Q=super.names;if(this.catch)$1(Q,this.catch.names);if(this.finally)$1(Q,this.finally.names);return Q}}class O4 extends e0{constructor(Q){super();this.error=Q}render(Q){return`catch(${this.error})`+super.render(Q)}}O4.kind="catch";class M4 extends e0{render(Q){return"finally"+super.render(Q)}}M4.kind="finally";class SG{constructor(Q,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
3
|
+
`:""},this._extScope=Q,this._scope=new b0.Scope({parent:Q}),this._nodes=[new bG]}toString(){return this._root.render(this.opts)}name(Q){return this._scope.name(Q)}scopeName(Q){return this._extScope.name(Q)}scopeValue(Q,X){let Y=this._extScope.value(Q,X);return(this._values[Y.prefix]||(this._values[Y.prefix]=new Set)).add(Y),Y}getScopeValue(Q,X){return this._extScope.getValue(Q,X)}scopeRefs(Q){return this._extScope.scopeRefs(Q,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(Q,X,Y,W){let G=this._scope.toName(X);if(Y!==void 0&&W)this._constants[G.str]=Y;return this._leafNode(new ZG(Q,G,Y)),G}const(Q,X,Y){return this._def(b0.varKinds.const,Q,X,Y)}let(Q,X,Y){return this._def(b0.varKinds.let,Q,X,Y)}var(Q,X,Y){return this._def(b0.varKinds.var,Q,X,Y)}assign(Q,X,Y){return this._leafNode(new L9(Q,X,Y))}add(Q,X){return this._leafNode(new NG(Q,A0.operators.ADD,X))}code(Q){if(typeof Q=="function")Q();else if(Q!==y.nil)this._leafNode(new PG(Q));return this}object(...Q){let X=["{"];for(let[Y,W]of Q){if(X.length>1)X.push(",");if(X.push(Y),Y!==W||this.opts.es5)X.push(":"),(0,y.addCodeArg)(X,W)}return X.push("}"),new y._Code(X)}if(Q,X,Y){if(this._blockNode(new u0(Q)),X&&Y)this.code(X).else().code(Y).endIf();else if(X)this.code(X).endIf();else if(Y)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(Q){return this._elseNode(new u0(Q))}else(){return this._elseNode(new z6)}endIf(){return this._endBlockNode(u0,z6)}_for(Q,X){if(this._blockNode(Q),X)this.code(X).endFor();return this}for(Q,X){return this._for(new EG(Q),X)}forRange(Q,X,Y,W,G=this.opts.es5?b0.varKinds.var:b0.varKinds.let){let J=this._scope.toName(Q);return this._for(new IG(G,J,X,Y),()=>W(J))}forOf(Q,X,Y,W=b0.varKinds.const){let G=this._scope.toName(Q);if(this.opts.es5){let J=X instanceof y.Name?X:this.var("_arr",X);return this.forRange("_i",0,y._`${J}.length`,($)=>{this.var(G,y._`${J}[${$}]`),Y(G)})}return this._for(new F9("of",W,G,X),()=>Y(G))}forIn(Q,X,Y,W=this.opts.es5?b0.varKinds.var:b0.varKinds.const){if(this.opts.ownProperties)return this.forOf(Q,y._`Object.keys(${X})`,Y);let G=this._scope.toName(Q);return this._for(new F9("in",W,G,X),()=>Y(G))}endFor(){return this._endBlockNode(w1)}label(Q){return this._leafNode(new qG(Q))}break(Q){return this._leafNode(new wG(Q))}return(Q){let X=new L4;if(this._blockNode(X),this.code(Q),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(L4)}try(Q,X,Y){if(!X&&!Y)throw Error('CodeGen: "try" without "catch" and "finally"');let W=new TG;if(this._blockNode(W),this.code(Q),X){let G=this.name("e");this._currNode=W.catch=new O4(G),X(G)}if(Y)this._currNode=W.finally=new M4,this.code(Y);return this._endBlockNode(O4,M4)}throw(Q){return this._leafNode(new jG(Q))}block(Q,X){if(this._blockStarts.push(this._nodes.length),Q)this.code(Q).endBlock(X);return this}endBlock(Q){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let Y=this._nodes.length-X;if(Y<0||Q!==void 0&&Y!==Q)throw Error(`CodeGen: wrong number of nodes: ${Y} vs ${Q} expected`);return this._nodes.length=X,this}func(Q,X=y.nil,Y,W){if(this._blockNode(new U4(Q,X,Y)),W)this.code(W).endFunc();return this}endFunc(){return this._endBlockNode(U4)}optimize(Q=1){while(Q-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(Q){return this._currNode.nodes.push(Q),this}_blockNode(Q){this._currNode.nodes.push(Q),this._nodes.push(Q)}_endBlockNode(Q,X){let Y=this._currNode;if(Y instanceof Q||X&&Y instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${Q.kind}/${X.kind}`:Q.kind}"`)}_elseNode(Q){let X=this._currNode;if(!(X instanceof u0))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=Q,this}get _root(){return this._nodes[0]}get _currNode(){let Q=this._nodes;return Q[Q.length-1]}set _currNode(Q){let X=this._nodes;X[X.length-1]=Q}}A0.CodeGen=SG;function $1(Q,X){for(let Y in X)Q[Y]=(Q[Y]||0)+(X[Y]||0);return Q}function V4(Q,X){return X instanceof y._CodeOrName?$1(Q,X.names):Q}function j1(Q,X,Y){if(Q instanceof y.Name)return W(Q);if(!G(Q))return Q;return new y._Code(Q._items.reduce((J,$)=>{if($ instanceof y.Name)$=W($);if($ instanceof y._Code)J.push(...$._items);else J.push($);return J},[]));function W(J){let $=Y[J.str];if($===void 0||X[J.str]!==1)return J;return delete X[J.str],$}function G(J){return J instanceof y._Code&&J._items.some(($)=>$ instanceof y.Name&&X[$.str]===1&&Y[$.str]!==void 0)}}function tK(Q,X){for(let Y in X)Q[Y]=(Q[Y]||0)-(X[Y]||0)}function RG(Q){return typeof Q=="boolean"||typeof Q=="number"||Q===null?!Q:y._`!${U9(Q)}`}A0.not=RG;var aK=CG(A0.operators.AND);function sK(...Q){return Q.reduce(aK)}A0.and=sK;var eK=CG(A0.operators.OR);function QB(...Q){return Q.reduce(eK)}A0.or=QB;function CG(Q){return(X,Y)=>X===y.nil?Y:Y===y.nil?X:y._`${U9(X)} ${Q} ${U9(Y)}`}function U9(Q){return Q instanceof y.Name?Q:y._`(${Q})`}});var u=N((fG)=>{Object.defineProperty(fG,"__esModule",{value:!0});fG.checkStrictMode=fG.getErrorPath=fG.Type=fG.useFunc=fG.setEvaluated=fG.evaluatedPropsToName=fG.mergeEvaluated=fG.eachItem=fG.unescapeJsonPointer=fG.escapeJsonPointer=fG.escapeFragment=fG.unescapeFragment=fG.schemaRefOrVal=fG.schemaHasRulesButRef=fG.schemaHasRules=fG.checkUnknownRules=fG.alwaysValidSchema=fG.toHash=void 0;var m=k(),GB=$6();function JB(Q){let X={};for(let Y of Q)X[Y]=!0;return X}fG.toHash=JB;function $B(Q,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return _G(Q,X),!yG(X,Q.self.RULES.all)}fG.alwaysValidSchema=$B;function _G(Q,X=Q.schema){let{opts:Y,self:W}=Q;if(!Y.strictSchema)return;if(typeof X==="boolean")return;let G=W.RULES.keywords;for(let J in X)if(!G[J])uG(Q,`unknown keyword: "${J}"`)}fG.checkUnknownRules=_G;function yG(Q,X){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(X[Y])return!0;return!1}fG.schemaHasRules=yG;function zB(Q,X){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(Y!=="$ref"&&X.all[Y])return!0;return!1}fG.schemaHasRulesButRef=zB;function HB({topSchemaRef:Q,schemaPath:X},Y,W,G){if(!G){if(typeof Y=="number"||typeof Y=="boolean")return Y;if(typeof Y=="string")return m._`${Y}`}return m._`${Q}${X}${(0,m.getProperty)(W)}`}fG.schemaRefOrVal=HB;function KB(Q){return hG(decodeURIComponent(Q))}fG.unescapeFragment=KB;function BB(Q){return encodeURIComponent(M9(Q))}fG.escapeFragment=BB;function M9(Q){if(typeof Q=="number")return`${Q}`;return Q.replace(/~/g,"~0").replace(/\//g,"~1")}fG.escapeJsonPointer=M9;function hG(Q){return Q.replace(/~1/g,"/").replace(/~0/g,"~")}fG.unescapeJsonPointer=hG;function DB(Q,X){if(Array.isArray(Q))for(let Y of Q)X(Y);else X(Q)}fG.eachItem=DB;function vG({mergeNames:Q,mergeToName:X,mergeValues:Y,resultToName:W}){return(G,J,$,z)=>{let H=$===void 0?J:$ instanceof m.Name?(J instanceof m.Name?Q(G,J,$):X(G,J,$),$):J instanceof m.Name?(X(G,$,J),J):Y(J,$);return z===m.Name&&!(H instanceof m.Name)?W(G,H):H}}fG.mergeEvaluated={props:vG({mergeNames:(Q,X,Y)=>Q.if(m._`${Y} !== true && ${X} !== undefined`,()=>{Q.if(m._`${X} === true`,()=>Q.assign(Y,!0),()=>Q.assign(Y,m._`${Y} || {}`).code(m._`Object.assign(${Y}, ${X})`))}),mergeToName:(Q,X,Y)=>Q.if(m._`${Y} !== true`,()=>{if(X===!0)Q.assign(Y,!0);else Q.assign(Y,m._`${Y} || {}`),V9(Q,Y,X)}),mergeValues:(Q,X)=>Q===!0?!0:{...Q,...X},resultToName:gG}),items:vG({mergeNames:(Q,X,Y)=>Q.if(m._`${Y} !== true && ${X} !== undefined`,()=>Q.assign(Y,m._`${X} === true ? true : ${Y} > ${X} ? ${Y} : ${X}`)),mergeToName:(Q,X,Y)=>Q.if(m._`${Y} !== true`,()=>Q.assign(Y,X===!0?!0:m._`${Y} > ${X} ? ${Y} : ${X}`)),mergeValues:(Q,X)=>Q===!0?!0:Math.max(Q,X),resultToName:(Q,X)=>Q.var("items",X)})};function gG(Q,X){if(X===!0)return Q.var("props",!0);let Y=Q.var("props",m._`{}`);if(X!==void 0)V9(Q,Y,X);return Y}fG.evaluatedPropsToName=gG;function V9(Q,X,Y){Object.keys(Y).forEach((W)=>Q.assign(m._`${X}${(0,m.getProperty)(W)}`,!0))}fG.setEvaluated=V9;var xG={};function AB(Q,X){return Q.scopeValue("func",{ref:X,code:xG[X.code]||(xG[X.code]=new GB._Code(X.code))})}fG.useFunc=AB;var O9;(function(Q){Q[Q.Num=0]="Num",Q[Q.Str=1]="Str"})(O9||(fG.Type=O9={}));function FB(Q,X,Y){if(Q instanceof m.Name){let W=X===O9.Num;return Y?W?m._`"[" + ${Q} + "]"`:m._`"['" + ${Q} + "']"`:W?m._`"/" + ${Q}`:m._`"/" + ${Q}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Y?(0,m.getProperty)(Q).toString():"/"+M9(Q)}fG.getErrorPath=FB;function uG(Q,X,Y=Q.opts.strictSchema){if(!Y)return;if(X=`strict mode: ${X}`,Y===!0)throw Error(X);Q.self.logger.warn(X)}fG.checkStrictMode=uG});var f0=N((mG)=>{Object.defineProperty(mG,"__esModule",{value:!0});var $0=k(),CB={data:new $0.Name("data"),valCxt:new $0.Name("valCxt"),instancePath:new $0.Name("instancePath"),parentData:new $0.Name("parentData"),parentDataProperty:new $0.Name("parentDataProperty"),rootData:new $0.Name("rootData"),dynamicAnchors:new $0.Name("dynamicAnchors"),vErrors:new $0.Name("vErrors"),errors:new $0.Name("errors"),this:new $0.Name("this"),self:new $0.Name("self"),scope:new $0.Name("scope"),json:new $0.Name("json"),jsonPos:new $0.Name("jsonPos"),jsonLen:new $0.Name("jsonLen"),jsonPart:new $0.Name("jsonPart")};mG.default=CB});var H6=N((nG)=>{Object.defineProperty(nG,"__esModule",{value:!0});nG.extendErrors=nG.resetErrorsCount=nG.reportExtraError=nG.reportError=nG.keyword$DataError=nG.keywordError=void 0;var h=k(),w4=u(),H0=f0();nG.keywordError={message:({keyword:Q})=>h.str`must pass "${Q}" keyword validation`};nG.keyword$DataError={message:({keyword:Q,schemaType:X})=>X?h.str`"${Q}" keyword must be ${X} ($data)`:h.str`"${Q}" keyword is invalid ($data)`};function vB(Q,X=nG.keywordError,Y,W){let{it:G}=Q,{gen:J,compositeRule:$,allErrors:z}=G,H=iG(Q,X,Y);if(W!==null&&W!==void 0?W:$||z)cG(J,H);else pG(G,h._`[${H}]`)}nG.reportError=vB;function xB(Q,X=nG.keywordError,Y){let{it:W}=Q,{gen:G,compositeRule:J,allErrors:$}=W,z=iG(Q,X,Y);if(cG(G,z),!(J||$))pG(W,H0.default.vErrors)}nG.reportExtraError=xB;function _B(Q,X){Q.assign(H0.default.errors,X),Q.if(h._`${H0.default.vErrors} !== null`,()=>Q.if(X,()=>Q.assign(h._`${H0.default.vErrors}.length`,X),()=>Q.assign(H0.default.vErrors,null)))}nG.resetErrorsCount=_B;function yB({gen:Q,keyword:X,schemaValue:Y,data:W,errsCount:G,it:J}){if(G===void 0)throw Error("ajv implementation error");let $=Q.name("err");Q.forRange("i",G,H0.default.errors,(z)=>{if(Q.const($,h._`${H0.default.vErrors}[${z}]`),Q.if(h._`${$}.instancePath === undefined`,()=>Q.assign(h._`${$}.instancePath`,(0,h.strConcat)(H0.default.instancePath,J.errorPath))),Q.assign(h._`${$}.schemaPath`,h.str`${J.errSchemaPath}/${X}`),J.opts.verbose)Q.assign(h._`${$}.schema`,Y),Q.assign(h._`${$}.data`,W)})}nG.extendErrors=yB;function cG(Q,X){let Y=Q.const("err",X);Q.if(h._`${H0.default.vErrors} === null`,()=>Q.assign(H0.default.vErrors,h._`[${Y}]`),h._`${H0.default.vErrors}.push(${Y})`),Q.code(h._`${H0.default.errors}++`)}function pG(Q,X){let{gen:Y,validateName:W,schemaEnv:G}=Q;if(G.$async)Y.throw(h._`new ${Q.ValidationError}(${X})`);else Y.assign(h._`${W}.errors`,X),Y.return(!1)}var z1={keyword:new h.Name("keyword"),schemaPath:new h.Name("schemaPath"),params:new h.Name("params"),propertyName:new h.Name("propertyName"),message:new h.Name("message"),schema:new h.Name("schema"),parentSchema:new h.Name("parentSchema")};function iG(Q,X,Y){let{createErrors:W}=Q.it;if(W===!1)return h._`{}`;return hB(Q,X,Y)}function hB(Q,X,Y={}){let{gen:W,it:G}=Q,J=[gB(G,Y),uB(Q,Y)];return fB(Q,X,J),W.object(...J)}function gB({errorPath:Q},{instancePath:X}){let Y=X?h.str`${Q}${(0,w4.getErrorPath)(X,w4.Type.Str)}`:Q;return[H0.default.instancePath,(0,h.strConcat)(H0.default.instancePath,Y)]}function uB({keyword:Q,it:{errSchemaPath:X}},{schemaPath:Y,parentSchema:W}){let G=W?X:h.str`${X}/${Q}`;if(Y)G=h.str`${G}${(0,w4.getErrorPath)(Y,w4.Type.Str)}`;return[z1.schemaPath,G]}function fB(Q,{params:X,message:Y},W){let{keyword:G,data:J,schemaValue:$,it:z}=Q,{opts:H,propertyName:K,topSchemaRef:B,schemaPath:D}=z;if(W.push([z1.keyword,G],[z1.params,typeof X=="function"?X(Q):X||h._`{}`]),H.messages)W.push([z1.message,typeof Y=="function"?Y(Q):Y]);if(H.verbose)W.push([z1.schema,$],[z1.parentSchema,h._`${B}${D}`],[H0.default.data,J]);if(K)W.push([z1.propertyName,K])}});var aG=N((oG)=>{Object.defineProperty(oG,"__esModule",{value:!0});oG.boolOrEmptySchema=oG.topBoolOrEmptySchema=void 0;var iB=H6(),nB=k(),dB=f0(),rB={message:"boolean schema is false"};function oB(Q){let{gen:X,schema:Y,validateName:W}=Q;if(Y===!1)rG(Q,!1);else if(typeof Y=="object"&&Y.$async===!0)X.return(dB.default.data);else X.assign(nB._`${W}.errors`,null),X.return(!0)}oG.topBoolOrEmptySchema=oB;function tB(Q,X){let{gen:Y,schema:W}=Q;if(W===!1)Y.var(X,!1),rG(Q);else Y.var(X,!0)}oG.boolOrEmptySchema=tB;function rG(Q,X){let{gen:Y,data:W}=Q,G={gen:Y,keyword:"false schema",data:W,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:Q};(0,iB.reportError)(G,rB,void 0,X)}});var N9=N((sG)=>{Object.defineProperty(sG,"__esModule",{value:!0});sG.getRules=sG.isJSONType=void 0;var sB=["string","number","integer","boolean","null","object","array"],eB=new Set(sB);function QD(Q){return typeof Q=="string"&&eB.has(Q)}sG.isJSONType=QD;function XD(){let Q={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...Q,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},Q.number,Q.string,Q.array,Q.object],post:{rules:[]},all:{},keywords:{}}}sG.getRules=XD});var q9=N((YJ)=>{Object.defineProperty(YJ,"__esModule",{value:!0});YJ.shouldUseRule=YJ.shouldUseGroup=YJ.schemaHasRulesForType=void 0;function WD({schema:Q,self:X},Y){let W=X.RULES.types[Y];return W&&W!==!0&&QJ(Q,W)}YJ.schemaHasRulesForType=WD;function QJ(Q,X){return X.rules.some((Y)=>XJ(Q,Y))}YJ.shouldUseGroup=QJ;function XJ(Q,X){var Y;return Q[X.keyword]!==void 0||((Y=X.definition.implements)===null||Y===void 0?void 0:Y.some((W)=>Q[W]!==void 0))}YJ.shouldUseRule=XJ});var K6=N((zJ)=>{Object.defineProperty(zJ,"__esModule",{value:!0});zJ.reportTypeError=zJ.checkDataTypes=zJ.checkDataType=zJ.coerceAndCheckDataType=zJ.getJSONTypes=zJ.getSchemaTypes=zJ.DataType=void 0;var $D=N9(),zD=q9(),HD=H6(),R=k(),GJ=u(),P1;(function(Q){Q[Q.Correct=0]="Correct",Q[Q.Wrong=1]="Wrong"})(P1||(zJ.DataType=P1={}));function KD(Q){let X=JJ(Q.type);if(X.includes("null")){if(Q.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&Q.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(Q.nullable===!0)X.push("null")}return X}zJ.getSchemaTypes=KD;function JJ(Q){let X=Array.isArray(Q)?Q:Q?[Q]:[];if(X.every($D.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}zJ.getJSONTypes=JJ;function BD(Q,X){let{gen:Y,data:W,opts:G}=Q,J=DD(X,G.coerceTypes),$=X.length>0&&!(J.length===0&&X.length===1&&(0,zD.schemaHasRulesForType)(Q,X[0]));if($){let z=j9(X,W,G.strictNumbers,P1.Wrong);Y.if(z,()=>{if(J.length)AD(Q,X,J);else P9(Q)})}return $}zJ.coerceAndCheckDataType=BD;var $J=new Set(["string","number","integer","boolean","null"]);function DD(Q,X){return X?Q.filter((Y)=>$J.has(Y)||X==="array"&&Y==="array"):[]}function AD(Q,X,Y){let{gen:W,data:G,opts:J}=Q,$=W.let("dataType",R._`typeof ${G}`),z=W.let("coerced",R._`undefined`);if(J.coerceTypes==="array")W.if(R._`${$} == 'object' && Array.isArray(${G}) && ${G}.length == 1`,()=>W.assign(G,R._`${G}[0]`).assign($,R._`typeof ${G}`).if(j9(X,G,J.strictNumbers),()=>W.assign(z,G)));W.if(R._`${z} !== undefined`);for(let K of Y)if($J.has(K)||K==="array"&&J.coerceTypes==="array")H(K);W.else(),P9(Q),W.endIf(),W.if(R._`${z} !== undefined`,()=>{W.assign(G,z),FD(Q,z)});function H(K){switch(K){case"string":W.elseIf(R._`${$} == "number" || ${$} == "boolean"`).assign(z,R._`"" + ${G}`).elseIf(R._`${G} === null`).assign(z,R._`""`);return;case"number":W.elseIf(R._`${$} == "boolean" || ${G} === null
|
|
4
4
|
|| (${$} == "string" && ${G} && ${G} == +${G})`).assign(z,R._`+${G}`);return;case"integer":W.elseIf(R._`${$} === "boolean" || ${G} === null
|
|
5
5
|
|| (${$} === "string" && ${G} && ${G} == +${G} && !(${G} % 1))`).assign(z,R._`+${G}`);return;case"boolean":W.elseIf(R._`${G} === "false" || ${G} === 0 || ${G} === null`).assign(z,!1).elseIf(R._`${G} === "true" || ${G} === 1`).assign(z,!0);return;case"null":W.elseIf(R._`${G} === "" || ${G} === 0 || ${G} === false`),W.assign(z,null);return;case"array":W.elseIf(R._`${$} === "string" || ${$} === "number"
|
|
6
|
-
|| ${$} === "boolean" || ${G} === null`).assign(z,R._`[${G}]`)}}}function AD({gen:Q,parentData:X,parentDataProperty:Y},W){Q.if(R._`${X} !== undefined`,()=>Q.assign(R._`${X}[${Y}]`,W))}function q9(Q,X,Y,W=P1.Correct){let G=W===P1.Correct?R.operators.EQ:R.operators.NEQ,J;switch(Q){case"null":return R._`${X} ${G} null`;case"array":J=R._`Array.isArray(${X})`;break;case"object":J=R._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":J=$(R._`!(${X} % 1) && !isNaN(${X})`);break;case"number":J=$();break;default:return R._`typeof ${X} ${G} ${Q}`}return W===P1.Correct?J:(0,R.not)(J);function $(z=R.nil){return(0,R.and)(R._`typeof ${X} == "number"`,z,Y?R._`isFinite(${X})`:R.nil)}}$J.checkDataType=q9;function w9(Q,X,Y,W){if(Q.length===1)return q9(Q[0],X,Y,W);let G,J=(0,WJ.toHash)(Q);if(J.array&&J.object){let $=R._`typeof ${X} != "object"`;G=J.null?$:R._`!${X} || ${$}`,delete J.null,delete J.array,delete J.object}else G=R.nil;if(J.number)delete J.integer;for(let $ in J)G=(0,R.and)(G,q9($,X,Y,W));return G}$J.checkDataTypes=w9;var FD={message:({schema:Q})=>`must be ${Q}`,params:({schema:Q,schemaValue:X})=>typeof Q=="string"?R._`{type: ${Q}}`:R._`{type: ${X}}`};function j9(Q){let X=UD(Q);(0,zD.reportError)(X,FD)}$J.reportTypeError=j9;function UD(Q){let{gen:X,data:Y,schema:W}=Q,G=(0,WJ.schemaRefOrVal)(Q,W,"type");return{gen:X,keyword:"type",data:Y,schema:W.type,schemaCode:G,schemaValue:G,parentSchema:W,params:{},it:Q}}});var DJ=N((BJ)=>{Object.defineProperty(BJ,"__esModule",{value:!0});BJ.assignDefaults=void 0;var b1=k(),qD=u();function wD(Q,X){let{properties:Y,items:W}=Q.schema;if(X==="object"&&Y)for(let G in Y)HJ(Q,G,Y[G].default);else if(X==="array"&&Array.isArray(W))W.forEach((G,J)=>HJ(Q,J,G.default))}BJ.assignDefaults=wD;function HJ(Q,X,Y){let{gen:W,compositeRule:G,data:J,opts:$}=Q;if(Y===void 0)return;let z=b1._`${J}${(0,b1.getProperty)(X)}`;if(G){(0,qD.checkStrictMode)(Q,`default is ignored for: ${z}`);return}let H=b1._`${z} === undefined`;if($.useDefaults==="empty")H=b1._`${H} || ${z} === null || ${z} === ""`;W.if(H,b1._`${z} = ${(0,b1.stringify)(Y)}`)}});var N0=N((UJ)=>{Object.defineProperty(UJ,"__esModule",{value:!0});UJ.validateUnion=UJ.validateArray=UJ.usePattern=UJ.callValidateCode=UJ.schemaProperties=UJ.allSchemaProperties=UJ.noPropertyInData=UJ.propertyInData=UJ.isOwnProperty=UJ.hasPropFunc=UJ.reportMissingProp=UJ.checkMissingProp=UJ.checkReportMissingProp=void 0;var n=k(),P9=u(),Q1=f0(),jD=u();function PD(Q,X){let{gen:Y,data:W,it:G}=Q;Y.if(E9(Y,W,X,G.opts.ownProperties),()=>{Q.setParams({missingProperty:n._`${X}`},!0),Q.error()})}UJ.checkReportMissingProp=PD;function bD({gen:Q,data:X,it:{opts:Y}},W,G){return(0,n.or)(...W.map((J)=>(0,n.and)(E9(Q,X,J,Y.ownProperties),n._`${G} = ${J}`)))}UJ.checkMissingProp=bD;function ED(Q,X){Q.setParams({missingProperty:X},!0),Q.error()}UJ.reportMissingProp=ED;function AJ(Q){return Q.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}UJ.hasPropFunc=AJ;function b9(Q,X,Y){return n._`${AJ(Q)}.call(${X}, ${Y})`}UJ.isOwnProperty=b9;function ID(Q,X,Y,W){let G=n._`${X}${(0,n.getProperty)(Y)} !== undefined`;return W?n._`${G} && ${b9(Q,X,Y)}`:G}UJ.propertyInData=ID;function E9(Q,X,Y,W){let G=n._`${X}${(0,n.getProperty)(Y)} === undefined`;return W?(0,n.or)(G,(0,n.not)(b9(Q,X,Y))):G}UJ.noPropertyInData=E9;function FJ(Q){return Q?Object.keys(Q).filter((X)=>X!=="__proto__"):[]}UJ.allSchemaProperties=FJ;function TD(Q,X){return FJ(X).filter((Y)=>!(0,P9.alwaysValidSchema)(Q,X[Y]))}UJ.schemaProperties=TD;function SD({schemaCode:Q,data:X,it:{gen:Y,topSchemaRef:W,schemaPath:G,errorPath:J},it:$},z,H,B){let K=B?n._`${Q}, ${X}, ${W}${G}`:X,D=[[Q1.default.instancePath,(0,n.strConcat)(Q1.default.instancePath,J)],[Q1.default.parentData,$.parentData],[Q1.default.parentDataProperty,$.parentDataProperty],[Q1.default.rootData,Q1.default.rootData]];if($.opts.dynamicRef)D.push([Q1.default.dynamicAnchors,Q1.default.dynamicAnchors]);let U=n._`${K}, ${Y.object(...D)}`;return H!==n.nil?n._`${z}.call(${H}, ${U})`:n._`${z}(${U})`}UJ.callValidateCode=SD;var RD=n._`new RegExp`;function CD({gen:Q,it:{opts:X}},Y){let W=X.unicodeRegExp?"u":"",{regExp:G}=X.code,J=G(Y,W);return Q.scopeValue("pattern",{key:J.toString(),ref:J,code:n._`${G.code==="new RegExp"?RD:(0,jD.useFunc)(Q,G)}(${Y}, ${W})`})}UJ.usePattern=CD;function kD(Q){let{gen:X,data:Y,keyword:W,it:G}=Q,J=X.name("valid");if(G.allErrors){let z=X.let("valid",!0);return $(()=>X.assign(z,!1)),z}return X.var(J,!0),$(()=>X.break()),J;function $(z){let H=X.const("len",n._`${Y}.length`);X.forRange("i",0,H,(B)=>{Q.subschema({keyword:W,dataProp:B,dataPropType:P9.Type.Num},J),X.if((0,n.not)(J),z)})}}UJ.validateArray=kD;function vD(Q){let{gen:X,schema:Y,keyword:W,it:G}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");if(Y.some((H)=>(0,P9.alwaysValidSchema)(G,H))&&!G.opts.unevaluated)return;let $=X.let("valid",!1),z=X.name("_valid");X.block(()=>Y.forEach((H,B)=>{let K=Q.subschema({keyword:W,schemaProp:B,compositeRule:!0},z);if(X.assign($,n._`${$} || ${z}`),!Q.mergeValidEvaluated(K,z))X.if((0,n.not)($))})),Q.result($,()=>Q.reset(),()=>Q.error(!0))}UJ.validateUnion=vD});var NJ=N((VJ)=>{Object.defineProperty(VJ,"__esModule",{value:!0});VJ.validateKeywordUsage=VJ.validSchemaType=VJ.funcKeywordCode=VJ.macroKeywordCode=void 0;var B0=k(),H1=f0(),nD=N0(),dD=H6();function rD(Q,X){let{gen:Y,keyword:W,schema:G,parentSchema:J,it:$}=Q,z=X.macro.call($.self,G,J,$),H=MJ(Y,W,z);if($.opts.validateSchema!==!1)$.self.validateSchema(z,!0);let B=Y.name("valid");Q.subschema({schema:z,schemaPath:B0.nil,errSchemaPath:`${$.errSchemaPath}/${W}`,topSchemaRef:H,compositeRule:!0},B),Q.pass(B,()=>Q.error(!0))}VJ.macroKeywordCode=rD;function oD(Q,X){var Y;let{gen:W,keyword:G,schema:J,parentSchema:$,$data:z,it:H}=Q;aD(H,X);let B=!z&&X.compile?X.compile.call(H.self,J,$,H):X.validate,K=MJ(W,G,B),D=W.let("valid");Q.block$data(D,U),Q.ok((Y=X.valid)!==null&&Y!==void 0?Y:D);function U(){if(X.errors===!1){if(M(),X.modifying)OJ(Q);Z(()=>Q.error())}else{let V=X.async?L():O();if(X.modifying)OJ(Q);Z(()=>tD(Q,V))}}function L(){let V=W.let("ruleErrs",null);return W.try(()=>M(B0._`await `),(T)=>W.assign(D,!1).if(B0._`${T} instanceof ${H.ValidationError}`,()=>W.assign(V,B0._`${T}.errors`),()=>W.throw(T))),V}function O(){let V=B0._`${K}.errors`;return W.assign(V,null),M(B0.nil),V}function M(V=X.async?B0._`await `:B0.nil){let T=H.opts.passContext?H1.default.this:H1.default.self,E=!(("compile"in X)&&!z||X.schema===!1);W.assign(D,B0._`${V}${(0,nD.callValidateCode)(Q,K,T,E)}`,X.modifying)}function Z(V){var T;W.if((0,B0.not)((T=X.valid)!==null&&T!==void 0?T:D),V)}}VJ.funcKeywordCode=oD;function OJ(Q){let{gen:X,data:Y,it:W}=Q;X.if(W.parentData,()=>X.assign(Y,B0._`${W.parentData}[${W.parentDataProperty}]`))}function tD(Q,X){let{gen:Y}=Q;Y.if(B0._`Array.isArray(${X})`,()=>{Y.assign(H1.default.vErrors,B0._`${H1.default.vErrors} === null ? ${X} : ${H1.default.vErrors}.concat(${X})`).assign(H1.default.errors,B0._`${H1.default.vErrors}.length`),(0,dD.extendErrors)(Q)},()=>Q.error())}function aD({schemaEnv:Q},X){if(X.async&&!Q.$async)throw Error("async keyword in sync schema")}function MJ(Q,X,Y){if(Y===void 0)throw Error(`keyword "${X}" failed to compile`);return Q.scopeValue("keyword",typeof Y=="function"?{ref:Y}:{ref:Y,code:(0,B0.stringify)(Y)})}function sD(Q,X,Y=!1){return!X.length||X.some((W)=>W==="array"?Array.isArray(Q):W==="object"?Q&&typeof Q=="object"&&!Array.isArray(Q):typeof Q==W||Y&&typeof Q>"u")}VJ.validSchemaType=sD;function eD({schema:Q,opts:X,self:Y,errSchemaPath:W},G,J){if(Array.isArray(G.keyword)?!G.keyword.includes(J):G.keyword!==J)throw Error("ajv implementation error");let $=G.dependencies;if($===null||$===void 0?void 0:$.some((z)=>!Object.prototype.hasOwnProperty.call(Q,z)))throw Error(`parent schema must have dependencies of ${J}: ${$.join(",")}`);if(G.validateSchema){if(!G.validateSchema(Q[J])){let H=`keyword "${J}" value is invalid at path "${W}": `+Y.errorsText(G.validateSchema.errors);if(X.validateSchema==="log")Y.logger.error(H);else throw Error(H)}}}VJ.validateKeywordUsage=eD});var PJ=N((wJ)=>{Object.defineProperty(wJ,"__esModule",{value:!0});wJ.extendSubschemaMode=wJ.extendSubschemaData=wJ.getSubschema=void 0;var C0=k(),qJ=u();function WA(Q,{keyword:X,schemaProp:Y,schema:W,schemaPath:G,errSchemaPath:J,topSchemaRef:$}){if(X!==void 0&&W!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let z=Q.schema[X];return Y===void 0?{schema:z,schemaPath:C0._`${Q.schemaPath}${(0,C0.getProperty)(X)}`,errSchemaPath:`${Q.errSchemaPath}/${X}`}:{schema:z[Y],schemaPath:C0._`${Q.schemaPath}${(0,C0.getProperty)(X)}${(0,C0.getProperty)(Y)}`,errSchemaPath:`${Q.errSchemaPath}/${X}/${(0,qJ.escapeFragment)(Y)}`}}if(W!==void 0){if(G===void 0||J===void 0||$===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:W,schemaPath:G,topSchemaRef:$,errSchemaPath:J}}throw Error('either "keyword" or "schema" must be passed')}wJ.getSubschema=WA;function GA(Q,X,{dataProp:Y,dataPropType:W,data:G,dataTypes:J,propertyName:$}){if(G!==void 0&&Y!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:z}=X;if(Y!==void 0){let{errorPath:B,dataPathArr:K,opts:D}=X,U=z.let("data",C0._`${X.data}${(0,C0.getProperty)(Y)}`,!0);H(U),Q.errorPath=C0.str`${B}${(0,qJ.getErrorPath)(Y,W,D.jsPropertySyntax)}`,Q.parentDataProperty=C0._`${Y}`,Q.dataPathArr=[...K,Q.parentDataProperty]}if(G!==void 0){let B=G instanceof C0.Name?G:z.let("data",G,!0);if(H(B),$!==void 0)Q.propertyName=$}if(J)Q.dataTypes=J;function H(B){Q.data=B,Q.dataLevel=X.dataLevel+1,Q.dataTypes=[],X.definedProperties=new Set,Q.parentData=X.data,Q.dataNames=[...X.dataNames,B]}}wJ.extendSubschemaData=GA;function JA(Q,{jtdDiscriminator:X,jtdMetadata:Y,compositeRule:W,createErrors:G,allErrors:J}){if(W!==void 0)Q.compositeRule=W;if(G!==void 0)Q.createErrors=G;if(J!==void 0)Q.allErrors=J;Q.jtdDiscriminator=X,Q.jtdMetadata=Y}wJ.extendSubschemaMode=JA});var I9=N((YP,bJ)=>{bJ.exports=function Q(X,Y){if(X===Y)return!0;if(X&&Y&&typeof X=="object"&&typeof Y=="object"){if(X.constructor!==Y.constructor)return!1;var W,G,J;if(Array.isArray(X)){if(W=X.length,W!=Y.length)return!1;for(G=W;G--!==0;)if(!Q(X[G],Y[G]))return!1;return!0}if(X.constructor===RegExp)return X.source===Y.source&&X.flags===Y.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===Y.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===Y.toString();if(J=Object.keys(X),W=J.length,W!==Object.keys(Y).length)return!1;for(G=W;G--!==0;)if(!Object.prototype.hasOwnProperty.call(Y,J[G]))return!1;for(G=W;G--!==0;){var $=J[G];if(!Q(X[$],Y[$]))return!1}return!0}return X!==X&&Y!==Y}});var IJ=N((WP,EJ)=>{var X1=EJ.exports=function(Q,X,Y){if(typeof X=="function")Y=X,X={};Y=X.cb||Y;var W=typeof Y=="function"?Y:Y.pre||function(){},G=Y.post||function(){};j4(X,W,G,Q,"",Q)};X1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};X1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};X1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};X1.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 j4(Q,X,Y,W,G,J,$,z,H,B){if(W&&typeof W=="object"&&!Array.isArray(W)){X(W,G,J,$,z,H,B);for(var K in W){var D=W[K];if(Array.isArray(D)){if(K in X1.arrayKeywords)for(var U=0;U<D.length;U++)j4(Q,X,Y,D[U],G+"/"+K+"/"+U,J,G,K,W,U)}else if(K in X1.propsKeywords){if(D&&typeof D=="object")for(var L in D)j4(Q,X,Y,D[L],G+"/"+K+"/"+HA(L),J,G,K,W,L)}else if(K in X1.keywords||Q.allKeys&&!(K in X1.skipKeywords))j4(Q,X,Y,D,G+"/"+K,J,G,K,W)}Y(W,G,J,$,z,H,B)}}function HA(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}});var K6=N((CJ)=>{Object.defineProperty(CJ,"__esModule",{value:!0});CJ.getSchemaRefs=CJ.resolveUrl=CJ.normalizeId=CJ._getFullPath=CJ.getFullPath=CJ.inlineRef=void 0;var BA=u(),KA=I9(),DA=IJ(),AA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function FA(Q,X=!0){if(typeof Q=="boolean")return!0;if(X===!0)return!T9(Q);if(!X)return!1;return TJ(Q)<=X}CJ.inlineRef=FA;var UA=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function T9(Q){for(let X in Q){if(UA.has(X))return!0;let Y=Q[X];if(Array.isArray(Y)&&Y.some(T9))return!0;if(typeof Y=="object"&&T9(Y))return!0}return!1}function TJ(Q){let X=0;for(let Y in Q){if(Y==="$ref")return 1/0;if(X++,AA.has(Y))continue;if(typeof Q[Y]=="object")(0,BA.eachItem)(Q[Y],(W)=>X+=TJ(W));if(X===1/0)return 1/0}return X}function SJ(Q,X="",Y){if(Y!==!1)X=E1(X);let W=Q.parse(X);return RJ(Q,W)}CJ.getFullPath=SJ;function RJ(Q,X){return Q.serialize(X).split("#")[0]+"#"}CJ._getFullPath=RJ;var LA=/#\/?$/;function E1(Q){return Q?Q.replace(LA,""):""}CJ.normalizeId=E1;function OA(Q,X,Y){return Y=E1(Y),Q.resolve(X,Y)}CJ.resolveUrl=OA;var MA=/^[a-z_][-a-z0-9._]*$/i;function VA(Q,X){if(typeof Q=="boolean")return{};let{schemaId:Y,uriResolver:W}=this.opts,G=E1(Q[Y]||X),J={"":G},$=SJ(W,G,!1),z={},H=new Set;return DA(Q,{allKeys:!0},(D,U,L,O)=>{if(O===void 0)return;let M=$+U,Z=J[O];if(typeof D[Y]=="string")Z=V.call(this,D[Y]);T.call(this,D.$anchor),T.call(this,D.$dynamicAnchor),J[U]=Z;function V(E){let v=this.opts.uriResolver.resolve;if(E=E1(Z?v(Z,E):E),H.has(E))throw K(E);H.add(E);let I=this.refs[E];if(typeof I=="string")I=this.refs[I];if(typeof I=="object")B(D,I.schema,E);else if(E!==E1(M))if(E[0]==="#")B(D,z[E],E),z[E]=D;else this.refs[E]=M;return E}function T(E){if(typeof E=="string"){if(!MA.test(E))throw Error(`invalid anchor "${E}"`);V.call(this,`#${E}`)}}}),z;function B(D,U,L){if(U!==void 0&&!KA(D,U))throw K(L)}function K(D){return Error(`reference "${D}" resolves to more than one schema`)}}CJ.getSchemaRefs=VA});var F6=N((dJ)=>{Object.defineProperty(dJ,"__esModule",{value:!0});dJ.getData=dJ.KeywordCxt=dJ.validateFunctionCode=void 0;var gJ=tG(),vJ=B6(),R9=N9(),P4=B6(),PA=DJ(),A6=NJ(),S9=PJ(),P=k(),S=f0(),bA=K6(),l0=u(),D6=H6();function EA(Q){if(fJ(Q)){if(lJ(Q),uJ(Q)){SA(Q);return}}hJ(Q,()=>(0,gJ.topBoolOrEmptySchema)(Q))}dJ.validateFunctionCode=EA;function hJ({gen:Q,validateName:X,schema:Y,schemaEnv:W,opts:G},J){if(G.code.es5)Q.func(X,P._`${S.default.data}, ${S.default.valCxt}`,W.$async,()=>{Q.code(P._`"use strict"; ${xJ(Y,G)}`),TA(Q,G),Q.code(J)});else Q.func(X,P._`${S.default.data}, ${IA(G)}`,W.$async,()=>Q.code(xJ(Y,G)).code(J))}function IA(Q){return P._`{${S.default.instancePath}="", ${S.default.parentData}, ${S.default.parentDataProperty}, ${S.default.rootData}=${S.default.data}${Q.dynamicRef?P._`, ${S.default.dynamicAnchors}={}`:P.nil}}={}`}function TA(Q,X){Q.if(S.default.valCxt,()=>{if(Q.var(S.default.instancePath,P._`${S.default.valCxt}.${S.default.instancePath}`),Q.var(S.default.parentData,P._`${S.default.valCxt}.${S.default.parentData}`),Q.var(S.default.parentDataProperty,P._`${S.default.valCxt}.${S.default.parentDataProperty}`),Q.var(S.default.rootData,P._`${S.default.valCxt}.${S.default.rootData}`),X.dynamicRef)Q.var(S.default.dynamicAnchors,P._`${S.default.valCxt}.${S.default.dynamicAnchors}`)},()=>{if(Q.var(S.default.instancePath,P._`""`),Q.var(S.default.parentData,P._`undefined`),Q.var(S.default.parentDataProperty,P._`undefined`),Q.var(S.default.rootData,S.default.data),X.dynamicRef)Q.var(S.default.dynamicAnchors,P._`{}`)})}function SA(Q){let{schema:X,opts:Y,gen:W}=Q;hJ(Q,()=>{if(Y.$comment&&X.$comment)cJ(Q);if(xA(Q),W.let(S.default.vErrors,null),W.let(S.default.errors,0),Y.unevaluated)RA(Q);mJ(Q),gA(Q)});return}function RA(Q){let{gen:X,validateName:Y}=Q;Q.evaluated=X.const("evaluated",P._`${Y}.evaluated`),X.if(P._`${Q.evaluated}.dynamicProps`,()=>X.assign(P._`${Q.evaluated}.props`,P._`undefined`)),X.if(P._`${Q.evaluated}.dynamicItems`,()=>X.assign(P._`${Q.evaluated}.items`,P._`undefined`))}function xJ(Q,X){let Y=typeof Q=="object"&&Q[X.schemaId];return Y&&(X.code.source||X.code.process)?P._`/*# sourceURL=${Y} */`:P.nil}function CA(Q,X){if(fJ(Q)){if(lJ(Q),uJ(Q)){kA(Q,X);return}}(0,gJ.boolOrEmptySchema)(Q,X)}function uJ({schema:Q,self:X}){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(X.RULES.all[Y])return!0;return!1}function fJ(Q){return typeof Q.schema!="boolean"}function kA(Q,X){let{schema:Y,gen:W,opts:G}=Q;if(G.$comment&&Y.$comment)cJ(Q);_A(Q),yA(Q);let J=W.const("_errs",S.default.errors);mJ(Q,J),W.var(X,P._`${J} === ${S.default.errors}`)}function lJ(Q){(0,l0.checkUnknownRules)(Q),vA(Q)}function mJ(Q,X){if(Q.opts.jtd)return _J(Q,[],!1,X);let Y=(0,vJ.getSchemaTypes)(Q.schema),W=(0,vJ.coerceAndCheckDataType)(Q,Y);_J(Q,Y,!W,X)}function vA(Q){let{schema:X,errSchemaPath:Y,opts:W,self:G}=Q;if(X.$ref&&W.ignoreKeywordsWithRef&&(0,l0.schemaHasRulesButRef)(X,G.RULES))G.logger.warn(`$ref: keywords ignored in schema at path "${Y}"`)}function xA(Q){let{schema:X,opts:Y}=Q;if(X.default!==void 0&&Y.useDefaults&&Y.strictSchema)(0,l0.checkStrictMode)(Q,"default is ignored in the schema root")}function _A(Q){let X=Q.schema[Q.opts.schemaId];if(X)Q.baseId=(0,bA.resolveUrl)(Q.opts.uriResolver,Q.baseId,X)}function yA(Q){if(Q.schema.$async&&!Q.schemaEnv.$async)throw Error("async schema in sync schema")}function cJ({gen:Q,schemaEnv:X,schema:Y,errSchemaPath:W,opts:G}){let J=Y.$comment;if(G.$comment===!0)Q.code(P._`${S.default.self}.logger.log(${J})`);else if(typeof G.$comment=="function"){let $=P.str`${W}/$comment`,z=Q.scopeValue("root",{ref:X.root});Q.code(P._`${S.default.self}.opts.$comment(${J}, ${$}, ${z}.schema)`)}}function gA(Q){let{gen:X,schemaEnv:Y,validateName:W,ValidationError:G,opts:J}=Q;if(Y.$async)X.if(P._`${S.default.errors} === 0`,()=>X.return(S.default.data),()=>X.throw(P._`new ${G}(${S.default.vErrors})`));else{if(X.assign(P._`${W}.errors`,S.default.vErrors),J.unevaluated)hA(Q);X.return(P._`${S.default.errors} === 0`)}}function hA({gen:Q,evaluated:X,props:Y,items:W}){if(Y instanceof P.Name)Q.assign(P._`${X}.props`,Y);if(W instanceof P.Name)Q.assign(P._`${X}.items`,W)}function _J(Q,X,Y,W){let{gen:G,schema:J,data:$,allErrors:z,opts:H,self:B}=Q,{RULES:K}=B;if(J.$ref&&(H.ignoreKeywordsWithRef||!(0,l0.schemaHasRulesButRef)(J,K))){G.block(()=>iJ(Q,"$ref",K.all.$ref.definition));return}if(!H.jtd)uA(Q,X);G.block(()=>{for(let U of K.rules)D(U);D(K.post)});function D(U){if(!(0,R9.shouldUseGroup)(J,U))return;if(U.type){if(G.if((0,P4.checkDataType)(U.type,$,H.strictNumbers)),yJ(Q,U),X.length===1&&X[0]===U.type&&Y)G.else(),(0,P4.reportTypeError)(Q);G.endIf()}else yJ(Q,U);if(!z)G.if(P._`${S.default.errors} === ${W||0}`)}}function yJ(Q,X){let{gen:Y,schema:W,opts:{useDefaults:G}}=Q;if(G)(0,PA.assignDefaults)(Q,X.type);Y.block(()=>{for(let J of X.rules)if((0,R9.shouldUseRule)(W,J))iJ(Q,J.keyword,J.definition,X.type)})}function uA(Q,X){if(Q.schemaEnv.meta||!Q.opts.strictTypes)return;if(fA(Q,X),!Q.opts.allowUnionTypes)lA(Q,X);mA(Q,Q.dataTypes)}function fA(Q,X){if(!X.length)return;if(!Q.dataTypes.length){Q.dataTypes=X;return}X.forEach((Y)=>{if(!pJ(Q.dataTypes,Y))C9(Q,`type "${Y}" not allowed by context "${Q.dataTypes.join(",")}"`)}),pA(Q,X)}function lA(Q,X){if(X.length>1&&!(X.length===2&&X.includes("null")))C9(Q,"use allowUnionTypes to allow union type keyword")}function mA(Q,X){let Y=Q.self.RULES.all;for(let W in Y){let G=Y[W];if(typeof G=="object"&&(0,R9.shouldUseRule)(Q.schema,G)){let{type:J}=G.definition;if(J.length&&!J.some(($)=>cA(X,$)))C9(Q,`missing type "${J.join(",")}" for keyword "${W}"`)}}}function cA(Q,X){return Q.includes(X)||X==="number"&&Q.includes("integer")}function pJ(Q,X){return Q.includes(X)||X==="integer"&&Q.includes("number")}function pA(Q,X){let Y=[];for(let W of Q.dataTypes)if(pJ(X,W))Y.push(W);else if(X.includes("integer")&&W==="number")Y.push("integer");Q.dataTypes=Y}function C9(Q,X){let Y=Q.schemaEnv.baseId+Q.errSchemaPath;X+=` at "${Y}" (strictTypes)`,(0,l0.checkStrictMode)(Q,X,Q.opts.strictTypes)}class k9{constructor(Q,X,Y){if((0,A6.validateKeywordUsage)(Q,X,Y),this.gen=Q.gen,this.allErrors=Q.allErrors,this.keyword=Y,this.data=Q.data,this.schema=Q.schema[Y],this.$data=X.$data&&Q.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l0.schemaRefOrVal)(Q,this.schema,Y,this.$data),this.schemaType=X.schemaType,this.parentSchema=Q.schema,this.params={},this.it=Q,this.def=X,this.$data)this.schemaCode=Q.gen.const("vSchema",nJ(this.$data,Q));else if(this.schemaCode=this.schemaValue,!(0,A6.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${Y} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=Q.gen.const("_errs",S.default.errors)}result(Q,X,Y){this.failResult((0,P.not)(Q),X,Y)}failResult(Q,X,Y){if(this.gen.if(Q),Y)Y();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(Q,X){this.failResult((0,P.not)(Q),void 0,X)}fail(Q){if(Q===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Q),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Q){if(!this.$data)return this.fail(Q);let{schemaCode:X}=this;this.fail(P._`${X} !== undefined && (${(0,P.or)(this.invalid$data(),Q)})`)}error(Q,X,Y){if(X){this.setParams(X),this._error(Q,Y),this.setParams({});return}this._error(Q,Y)}_error(Q,X){(Q?D6.reportExtraError:D6.reportError)(this,this.def.error,X)}$dataError(){(0,D6.reportError)(this,this.def.$dataError||D6.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,D6.resetErrorsCount)(this.gen,this.errsCount)}ok(Q){if(!this.allErrors)this.gen.if(Q)}setParams(Q,X){if(X)Object.assign(this.params,Q);else this.params=Q}block$data(Q,X,Y=P.nil){this.gen.block(()=>{this.check$data(Q,Y),X()})}check$data(Q=P.nil,X=P.nil){if(!this.$data)return;let{gen:Y,schemaCode:W,schemaType:G,def:J}=this;if(Y.if((0,P.or)(P._`${W} === undefined`,X)),Q!==P.nil)Y.assign(Q,!0);if(G.length||J.validateSchema){if(Y.elseIf(this.invalid$data()),this.$dataError(),Q!==P.nil)Y.assign(Q,!1)}Y.else()}invalid$data(){let{gen:Q,schemaCode:X,schemaType:Y,def:W,it:G}=this;return(0,P.or)(J(),$());function J(){if(Y.length){if(!(X instanceof P.Name))throw Error("ajv implementation error");let z=Array.isArray(Y)?Y:[Y];return P._`${(0,P4.checkDataTypes)(z,X,G.opts.strictNumbers,P4.DataType.Wrong)}`}return P.nil}function $(){if(W.validateSchema){let z=Q.scopeValue("validate$data",{ref:W.validateSchema});return P._`!${z}(${X})`}return P.nil}}subschema(Q,X){let Y=(0,S9.getSubschema)(this.it,Q);(0,S9.extendSubschemaData)(Y,this.it,Q),(0,S9.extendSubschemaMode)(Y,Q);let W={...this.it,...Y,items:void 0,props:void 0};return CA(W,X),W}mergeEvaluated(Q,X){let{it:Y,gen:W}=this;if(!Y.opts.unevaluated)return;if(Y.props!==!0&&Q.props!==void 0)Y.props=l0.mergeEvaluated.props(W,Q.props,Y.props,X);if(Y.items!==!0&&Q.items!==void 0)Y.items=l0.mergeEvaluated.items(W,Q.items,Y.items,X)}mergeValidEvaluated(Q,X){let{it:Y,gen:W}=this;if(Y.opts.unevaluated&&(Y.props!==!0||Y.items!==!0))return W.if(X,()=>this.mergeEvaluated(Q,P.Name)),!0}}dJ.KeywordCxt=k9;function iJ(Q,X,Y,W){let G=new k9(Q,Y,X);if("code"in Y)Y.code(G,W);else if(G.$data&&Y.validate)(0,A6.funcKeywordCode)(G,Y);else if("macro"in Y)(0,A6.macroKeywordCode)(G,Y);else if(Y.compile||Y.validate)(0,A6.funcKeywordCode)(G,Y)}var iA=/^\/(?:[^~]|~0|~1)*$/,nA=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function nJ(Q,{dataLevel:X,dataNames:Y,dataPathArr:W}){let G,J;if(Q==="")return S.default.rootData;if(Q[0]==="/"){if(!iA.test(Q))throw Error(`Invalid JSON-pointer: ${Q}`);G=Q,J=S.default.rootData}else{let B=nA.exec(Q);if(!B)throw Error(`Invalid JSON-pointer: ${Q}`);let K=+B[1];if(G=B[2],G==="#"){if(K>=X)throw Error(H("property/index",K));return W[X-K]}if(K>X)throw Error(H("data",K));if(J=Y[X-K],!G)return J}let $=J,z=G.split("/");for(let B of z)if(B)J=P._`${J}${(0,P.getProperty)((0,l0.unescapeJsonPointer)(B))}`,$=P._`${$} && ${J}`;return $;function H(B,K){return`Cannot access ${B} ${K} levels up, current level is ${X}`}}dJ.getData=nJ});var b4=N((tJ)=>{Object.defineProperty(tJ,"__esModule",{value:!0});class oJ extends Error{constructor(Q){super("validation failed");this.errors=Q,this.ajv=this.validation=!0}}tJ.default=oJ});var U6=N((sJ)=>{Object.defineProperty(sJ,"__esModule",{value:!0});var v9=K6();class aJ extends Error{constructor(Q,X,Y,W){super(W||`can't resolve reference ${Y} from id ${X}`);this.missingRef=(0,v9.resolveUrl)(Q,X,Y),this.missingSchema=(0,v9.normalizeId)((0,v9.getFullPath)(Q,this.missingRef))}}sJ.default=aJ});var I4=N((X7)=>{Object.defineProperty(X7,"__esModule",{value:!0});X7.resolveSchema=X7.getCompilingSchema=X7.resolveRef=X7.compileSchema=X7.SchemaEnv=void 0;var E0=k(),aA=b4(),B1=f0(),I0=K6(),eJ=u(),sA=F6();class L6{constructor(Q){var X;this.refs={},this.dynamicAnchors={};let Y;if(typeof Q.schema=="object")Y=Q.schema;this.schema=Q.schema,this.schemaId=Q.schemaId,this.root=Q.root||this,this.baseId=(X=Q.baseId)!==null&&X!==void 0?X:(0,I0.normalizeId)(Y===null||Y===void 0?void 0:Y[Q.schemaId||"$id"]),this.schemaPath=Q.schemaPath,this.localRefs=Q.localRefs,this.meta=Q.meta,this.$async=Y===null||Y===void 0?void 0:Y.$async,this.refs={}}}X7.SchemaEnv=L6;function _9(Q){let X=Q7.call(this,Q);if(X)return X;let Y=(0,I0.getFullPath)(this.opts.uriResolver,Q.root.baseId),{es5:W,lines:G}=this.opts.code,{ownProperties:J}=this.opts,$=new E0.CodeGen(this.scope,{es5:W,lines:G,ownProperties:J}),z;if(Q.$async)z=$.scopeValue("Error",{ref:aA.default,code:E0._`require("ajv/dist/runtime/validation_error").default`});let H=$.scopeName("validate");Q.validateName=H;let B={gen:$,allErrors:this.opts.allErrors,data:B1.default.data,parentData:B1.default.parentData,parentDataProperty:B1.default.parentDataProperty,dataNames:[B1.default.data],dataPathArr:[E0.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:$.scopeValue("schema",this.opts.code.source===!0?{ref:Q.schema,code:(0,E0.stringify)(Q.schema)}:{ref:Q.schema}),validateName:H,ValidationError:z,schema:Q.schema,schemaEnv:Q,rootId:Y,baseId:Q.baseId||Y,schemaPath:E0.nil,errSchemaPath:Q.schemaPath||(this.opts.jtd?"":"#"),errorPath:E0._`""`,opts:this.opts,self:this},K;try{this._compilations.add(Q),(0,sA.validateFunctionCode)(B),$.optimize(this.opts.code.optimize);let D=$.toString();if(K=`${$.scopeRefs(B1.default.scope)}return ${D}`,this.opts.code.process)K=this.opts.code.process(K,Q);let L=Function(`${B1.default.self}`,`${B1.default.scope}`,K)(this,this.scope.get());if(this.scope.value(H,{ref:L}),L.errors=null,L.schema=Q.schema,L.schemaEnv=Q,Q.$async)L.$async=!0;if(this.opts.code.source===!0)L.source={validateName:H,validateCode:D,scopeValues:$._values};if(this.opts.unevaluated){let{props:O,items:M}=B;if(L.evaluated={props:O instanceof E0.Name?void 0:O,items:M instanceof E0.Name?void 0:M,dynamicProps:O instanceof E0.Name,dynamicItems:M instanceof E0.Name},L.source)L.source.evaluated=(0,E0.stringify)(L.evaluated)}return Q.validate=L,Q}catch(D){if(delete Q.validate,delete Q.validateName,K)this.logger.error("Error compiling schema, function code:",K);throw D}finally{this._compilations.delete(Q)}}X7.compileSchema=_9;function eA(Q,X,Y){var W;Y=(0,I0.resolveUrl)(this.opts.uriResolver,X,Y);let G=Q.refs[Y];if(G)return G;let J=YF.call(this,Q,Y);if(J===void 0){let $=(W=Q.localRefs)===null||W===void 0?void 0:W[Y],{schemaId:z}=this.opts;if($)J=new L6({schema:$,schemaId:z,root:Q,baseId:X})}if(J===void 0)return;return Q.refs[Y]=QF.call(this,J)}X7.resolveRef=eA;function QF(Q){if((0,I0.inlineRef)(Q.schema,this.opts.inlineRefs))return Q.schema;return Q.validate?Q:_9.call(this,Q)}function Q7(Q){for(let X of this._compilations)if(XF(X,Q))return X}X7.getCompilingSchema=Q7;function XF(Q,X){return Q.schema===X.schema&&Q.root===X.root&&Q.baseId===X.baseId}function YF(Q,X){let Y;while(typeof(Y=this.refs[X])=="string")X=Y;return Y||this.schemas[X]||E4.call(this,Q,X)}function E4(Q,X){let Y=this.opts.uriResolver.parse(X),W=(0,I0._getFullPath)(this.opts.uriResolver,Y),G=(0,I0.getFullPath)(this.opts.uriResolver,Q.baseId,void 0);if(Object.keys(Q.schema).length>0&&W===G)return x9.call(this,Y,Q);let J=(0,I0.normalizeId)(W),$=this.refs[J]||this.schemas[J];if(typeof $=="string"){let z=E4.call(this,Q,$);if(typeof(z===null||z===void 0?void 0:z.schema)!=="object")return;return x9.call(this,Y,z)}if(typeof($===null||$===void 0?void 0:$.schema)!=="object")return;if(!$.validate)_9.call(this,$);if(J===(0,I0.normalizeId)(X)){let{schema:z}=$,{schemaId:H}=this.opts,B=z[H];if(B)G=(0,I0.resolveUrl)(this.opts.uriResolver,G,B);return new L6({schema:z,schemaId:H,root:Q,baseId:G})}return x9.call(this,Y,$)}X7.resolveSchema=E4;var WF=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function x9(Q,{baseId:X,schema:Y,root:W}){var G;if(((G=Q.fragment)===null||G===void 0?void 0:G[0])!=="/")return;for(let z of Q.fragment.slice(1).split("/")){if(typeof Y==="boolean")return;let H=Y[(0,eJ.unescapeFragment)(z)];if(H===void 0)return;Y=H;let B=typeof Y==="object"&&Y[this.opts.schemaId];if(!WF.has(z)&&B)X=(0,I0.resolveUrl)(this.opts.uriResolver,X,B)}let J;if(typeof Y!="boolean"&&Y.$ref&&!(0,eJ.schemaHasRulesButRef)(Y,this.RULES)){let z=(0,I0.resolveUrl)(this.opts.uriResolver,X,Y.$ref);J=E4.call(this,W,z)}let{schemaId:$}=this.opts;if(J=J||new L6({schema:Y,schemaId:$,root:W,baseId:X}),J.schema!==J.root.schema)return J;return}});var W7=N((BP,HF)=>{HF.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 g9=N((KP,z7)=>{var BF=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),J7=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function y9(Q){let X="",Y=0,W=0;for(W=0;W<Q.length;W++){if(Y=Q[W].charCodeAt(0),Y===48)continue;if(!(Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102))return"";X+=Q[W];break}for(W+=1;W<Q.length;W++){if(Y=Q[W].charCodeAt(0),!(Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102))return"";X+=Q[W]}return X}var KF=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function G7(Q){return Q.length=0,!0}function DF(Q,X,Y){if(Q.length){let W=y9(Q);if(W!=="")X.push(W);else return Y.error=!0,!1;Q.length=0}return!0}function AF(Q){let X=0,Y={error:!1,address:"",zone:""},W=[],G=[],J=!1,$=!1,z=DF;for(let H=0;H<Q.length;H++){let B=Q[H];if(B==="["||B==="]")continue;if(B===":"){if(J===!0)$=!0;if(!z(G,W,Y))break;if(++X>7){Y.error=!0;break}if(H>0&&Q[H-1]===":")J=!0;W.push(":");continue}else if(B==="%"){if(!z(G,W,Y))break;z=G7}else{G.push(B);continue}}if(G.length)if(z===G7)Y.zone=G.join("");else if($)W.push(G.join(""));else W.push(y9(G));return Y.address=W.join(""),Y}function $7(Q){if(FF(Q,":")<2)return{host:Q,isIPV6:!1};let X=AF(Q);if(!X.error){let{address:Y,address:W}=X;if(X.zone)Y+="%"+X.zone,W+="%25"+X.zone;return{host:Y,isIPV6:!0,escapedHost:W}}else return{host:Q,isIPV6:!1}}function FF(Q,X){let Y=0;for(let W=0;W<Q.length;W++)if(Q[W]===X)Y++;return Y}function UF(Q){let X=Q,Y=[],W=-1,G=0;while(G=X.length){if(G===1)if(X===".")break;else if(X==="/"){Y.push("/");break}else{Y.push(X);break}else if(G===2){if(X[0]==="."){if(X[1]===".")break;else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."||X[1]==="/"){Y.push("/");break}}}else if(G===3){if(X==="/.."){if(Y.length!==0)Y.pop();Y.push("/");break}}if(X[0]==="."){if(X[1]==="."){if(X[2]==="/"){X=X.slice(3);continue}}else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."){if(X[2]==="/"){X=X.slice(2);continue}else if(X[2]==="."){if(X[3]==="/"){if(X=X.slice(3),Y.length!==0)Y.pop();continue}}}}if((W=X.indexOf("/",1))===-1){Y.push(X);break}else Y.push(X.slice(0,W)),X=X.slice(W)}return Y.join("")}function LF(Q,X){let Y=X!==!0?escape:unescape;if(Q.scheme!==void 0)Q.scheme=Y(Q.scheme);if(Q.userinfo!==void 0)Q.userinfo=Y(Q.userinfo);if(Q.host!==void 0)Q.host=Y(Q.host);if(Q.path!==void 0)Q.path=Y(Q.path);if(Q.query!==void 0)Q.query=Y(Q.query);if(Q.fragment!==void 0)Q.fragment=Y(Q.fragment);return Q}function OF(Q){let X=[];if(Q.userinfo!==void 0)X.push(Q.userinfo),X.push("@");if(Q.host!==void 0){let Y=unescape(Q.host);if(!J7(Y)){let W=$7(Y);if(W.isIPV6===!0)Y=`[${W.escapedHost}]`;else Y=Q.host}X.push(Y)}if(typeof Q.port==="number"||typeof Q.port==="string")X.push(":"),X.push(String(Q.port));return X.length?X.join(""):void 0}z7.exports={nonSimpleDomain:KF,recomposeAuthority:OF,normalizeComponentEncoding:LF,removeDotSegments:UF,isIPv4:J7,isUUID:BF,normalizeIPv6:$7,stringArrayToHexStripped:y9}});var A7=N((DP,D7)=>{var{isUUID:MF}=g9(),VF=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,ZF=["http","https","ws","wss","urn","urn:uuid"];function NF(Q){return ZF.indexOf(Q)!==-1}function h9(Q){if(Q.secure===!0)return!0;else if(Q.secure===!1)return!1;else if(Q.scheme)return Q.scheme.length===3&&(Q.scheme[0]==="w"||Q.scheme[0]==="W")&&(Q.scheme[1]==="s"||Q.scheme[1]==="S")&&(Q.scheme[2]==="s"||Q.scheme[2]==="S");else return!1}function H7(Q){if(!Q.host)Q.error=Q.error||"HTTP URIs must have a host.";return Q}function B7(Q){let X=String(Q.scheme).toLowerCase()==="https";if(Q.port===(X?443:80)||Q.port==="")Q.port=void 0;if(!Q.path)Q.path="/";return Q}function qF(Q){return Q.secure=h9(Q),Q.resourceName=(Q.path||"/")+(Q.query?"?"+Q.query:""),Q.path=void 0,Q.query=void 0,Q}function wF(Q){if(Q.port===(h9(Q)?443:80)||Q.port==="")Q.port=void 0;if(typeof Q.secure==="boolean")Q.scheme=Q.secure?"wss":"ws",Q.secure=void 0;if(Q.resourceName){let[X,Y]=Q.resourceName.split("?");Q.path=X&&X!=="/"?X:void 0,Q.query=Y,Q.resourceName=void 0}return Q.fragment=void 0,Q}function jF(Q,X){if(!Q.path)return Q.error="URN can not be parsed",Q;let Y=Q.path.match(VF);if(Y){let W=X.scheme||Q.scheme||"urn";Q.nid=Y[1].toLowerCase(),Q.nss=Y[2];let G=`${W}:${X.nid||Q.nid}`,J=u9(G);if(Q.path=void 0,J)Q=J.parse(Q,X)}else Q.error=Q.error||"URN can not be parsed.";return Q}function PF(Q,X){if(Q.nid===void 0)throw Error("URN without nid cannot be serialized");let Y=X.scheme||Q.scheme||"urn",W=Q.nid.toLowerCase(),G=`${Y}:${X.nid||W}`,J=u9(G);if(J)Q=J.serialize(Q,X);let $=Q,z=Q.nss;return $.path=`${W||X.nid}:${z}`,X.skipEscape=!0,$}function bF(Q,X){let Y=Q;if(Y.uuid=Y.nss,Y.nss=void 0,!X.tolerant&&(!Y.uuid||!MF(Y.uuid)))Y.error=Y.error||"UUID is not valid.";return Y}function EF(Q){let X=Q;return X.nss=(Q.uuid||"").toLowerCase(),X}var K7={scheme:"http",domainHost:!0,parse:H7,serialize:B7},IF={scheme:"https",domainHost:K7.domainHost,parse:H7,serialize:B7},T4={scheme:"ws",domainHost:!0,parse:qF,serialize:wF},TF={scheme:"wss",domainHost:T4.domainHost,parse:T4.parse,serialize:T4.serialize},SF={scheme:"urn",parse:jF,serialize:PF,skipNormalize:!0},RF={scheme:"urn:uuid",parse:bF,serialize:EF,skipNormalize:!0},S4={http:K7,https:IF,ws:T4,wss:TF,urn:SF,"urn:uuid":RF};Object.setPrototypeOf(S4,null);function u9(Q){return Q&&(S4[Q]||S4[Q.toLowerCase()])||void 0}D7.exports={wsIsSecure:h9,SCHEMES:S4,isValidSchemeName:NF,getSchemeHandler:u9}});var L7=N((AP,C4)=>{var{normalizeIPv6:CF,removeDotSegments:O6,recomposeAuthority:kF,normalizeComponentEncoding:R4,isIPv4:vF,nonSimpleDomain:xF}=g9(),{SCHEMES:_F,getSchemeHandler:F7}=A7();function yF(Q,X){if(typeof Q==="string")Q=k0(m0(Q,X),X);else if(typeof Q==="object")Q=m0(k0(Q,X),X);return Q}function gF(Q,X,Y){let W=Y?Object.assign({scheme:"null"},Y):{scheme:"null"},G=U7(m0(Q,W),m0(X,W),W,!0);return W.skipEscape=!0,k0(G,W)}function U7(Q,X,Y,W){let G={};if(!W)Q=m0(k0(Q,Y),Y),X=m0(k0(X,Y),Y);if(Y=Y||{},!Y.tolerant&&X.scheme)G.scheme=X.scheme,G.userinfo=X.userinfo,G.host=X.host,G.port=X.port,G.path=O6(X.path||""),G.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)G.userinfo=X.userinfo,G.host=X.host,G.port=X.port,G.path=O6(X.path||""),G.query=X.query;else{if(!X.path)if(G.path=Q.path,X.query!==void 0)G.query=X.query;else G.query=Q.query;else{if(X.path[0]==="/")G.path=O6(X.path);else{if((Q.userinfo!==void 0||Q.host!==void 0||Q.port!==void 0)&&!Q.path)G.path="/"+X.path;else if(!Q.path)G.path=X.path;else G.path=Q.path.slice(0,Q.path.lastIndexOf("/")+1)+X.path;G.path=O6(G.path)}G.query=X.query}G.userinfo=Q.userinfo,G.host=Q.host,G.port=Q.port}G.scheme=Q.scheme}return G.fragment=X.fragment,G}function hF(Q,X,Y){if(typeof Q==="string")Q=unescape(Q),Q=k0(R4(m0(Q,Y),!0),{...Y,skipEscape:!0});else if(typeof Q==="object")Q=k0(R4(Q,!0),{...Y,skipEscape:!0});if(typeof X==="string")X=unescape(X),X=k0(R4(m0(X,Y),!0),{...Y,skipEscape:!0});else if(typeof X==="object")X=k0(R4(X,!0),{...Y,skipEscape:!0});return Q.toLowerCase()===X.toLowerCase()}function k0(Q,X){let Y={host:Q.host,scheme:Q.scheme,userinfo:Q.userinfo,port:Q.port,path:Q.path,query:Q.query,nid:Q.nid,nss:Q.nss,uuid:Q.uuid,fragment:Q.fragment,reference:Q.reference,resourceName:Q.resourceName,secure:Q.secure,error:""},W=Object.assign({},X),G=[],J=F7(W.scheme||Y.scheme);if(J&&J.serialize)J.serialize(Y,W);if(Y.path!==void 0)if(!W.skipEscape){if(Y.path=escape(Y.path),Y.scheme!==void 0)Y.path=Y.path.split("%3A").join(":")}else Y.path=unescape(Y.path);if(W.reference!=="suffix"&&Y.scheme)G.push(Y.scheme,":");let $=kF(Y);if($!==void 0){if(W.reference!=="suffix")G.push("//");if(G.push($),Y.path&&Y.path[0]!=="/")G.push("/")}if(Y.path!==void 0){let z=Y.path;if(!W.absolutePath&&(!J||!J.absolutePath))z=O6(z);if($===void 0&&z[0]==="/"&&z[1]==="/")z="/%2F"+z.slice(2);G.push(z)}if(Y.query!==void 0)G.push("?",Y.query);if(Y.fragment!==void 0)G.push("#",Y.fragment);return G.join("")}var uF=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function m0(Q,X){let Y=Object.assign({},X),W={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},G=!1;if(Y.reference==="suffix")if(Y.scheme)Q=Y.scheme+":"+Q;else Q="//"+Q;let J=Q.match(uF);if(J){if(W.scheme=J[1],W.userinfo=J[3],W.host=J[4],W.port=parseInt(J[5],10),W.path=J[6]||"",W.query=J[7],W.fragment=J[8],isNaN(W.port))W.port=J[5];if(W.host)if(vF(W.host)===!1){let H=CF(W.host);W.host=H.host.toLowerCase(),G=H.isIPV6}else G=!0;if(W.scheme===void 0&&W.userinfo===void 0&&W.host===void 0&&W.port===void 0&&W.query===void 0&&!W.path)W.reference="same-document";else if(W.scheme===void 0)W.reference="relative";else if(W.fragment===void 0)W.reference="absolute";else W.reference="uri";if(Y.reference&&Y.reference!=="suffix"&&Y.reference!==W.reference)W.error=W.error||"URI is not a "+Y.reference+" reference.";let $=F7(Y.scheme||W.scheme);if(!Y.unicodeSupport&&(!$||!$.unicodeSupport)){if(W.host&&(Y.domainHost||$&&$.domainHost)&&G===!1&&xF(W.host))try{W.host=URL.domainToASCII(W.host.toLowerCase())}catch(z){W.error=W.error||"Host's domain name can not be converted to ASCII: "+z}}if(!$||$&&!$.skipNormalize){if(Q.indexOf("%")!==-1){if(W.scheme!==void 0)W.scheme=unescape(W.scheme);if(W.host!==void 0)W.host=unescape(W.host)}if(W.path)W.path=escape(unescape(W.path));if(W.fragment)W.fragment=encodeURI(decodeURIComponent(W.fragment))}if($&&$.parse)$.parse(W,Y)}else W.error=W.error||"URI can not be parsed.";return W}var f9={SCHEMES:_F,normalize:yF,resolve:gF,resolveComponent:U7,equal:hF,serialize:k0,parse:m0};C4.exports=f9;C4.exports.default=f9;C4.exports.fastUri=f9});var V7=N((M7)=>{Object.defineProperty(M7,"__esModule",{value:!0});var O7=L7();O7.code='require("ajv/dist/runtime/uri").default';M7.default=O7});var E7=N((c0)=>{Object.defineProperty(c0,"__esModule",{value:!0});c0.CodeGen=c0.Name=c0.nil=c0.stringify=c0.str=c0._=c0.KeywordCxt=void 0;var lF=F6();Object.defineProperty(c0,"KeywordCxt",{enumerable:!0,get:function(){return lF.KeywordCxt}});var I1=k();Object.defineProperty(c0,"_",{enumerable:!0,get:function(){return I1._}});Object.defineProperty(c0,"str",{enumerable:!0,get:function(){return I1.str}});Object.defineProperty(c0,"stringify",{enumerable:!0,get:function(){return I1.stringify}});Object.defineProperty(c0,"nil",{enumerable:!0,get:function(){return I1.nil}});Object.defineProperty(c0,"Name",{enumerable:!0,get:function(){return I1.Name}});Object.defineProperty(c0,"CodeGen",{enumerable:!0,get:function(){return I1.CodeGen}});var mF=b4(),j7=U6(),cF=Z9(),M6=I4(),pF=k(),V6=K6(),k4=B6(),m9=u(),Z7=W7(),iF=V7(),P7=(Q,X)=>new RegExp(Q,X);P7.code="new RegExp";var nF=["removeAdditional","useDefaults","coerceTypes"],dF=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),rF={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."},oF={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},N7=200;function tF(Q){var X,Y,W,G,J,$,z,H,B,K,D,U,L,O,M,Z,V,T,E,v,I,R0,x0,t4,a4;let v1=Q.strict,s4=(X=Q.code)===null||X===void 0?void 0:X.optimize,MX=s4===!0||s4===void 0?1:s4||0,VX=(W=(Y=Q.code)===null||Y===void 0?void 0:Y.regExp)!==null&&W!==void 0?W:P7,Qz=(G=Q.uriResolver)!==null&&G!==void 0?G:iF.default;return{strictSchema:($=(J=Q.strictSchema)!==null&&J!==void 0?J:v1)!==null&&$!==void 0?$:!0,strictNumbers:(H=(z=Q.strictNumbers)!==null&&z!==void 0?z:v1)!==null&&H!==void 0?H:!0,strictTypes:(K=(B=Q.strictTypes)!==null&&B!==void 0?B:v1)!==null&&K!==void 0?K:"log",strictTuples:(U=(D=Q.strictTuples)!==null&&D!==void 0?D:v1)!==null&&U!==void 0?U:"log",strictRequired:(O=(L=Q.strictRequired)!==null&&L!==void 0?L:v1)!==null&&O!==void 0?O:!1,code:Q.code?{...Q.code,optimize:MX,regExp:VX}:{optimize:MX,regExp:VX},loopRequired:(M=Q.loopRequired)!==null&&M!==void 0?M:N7,loopEnum:(Z=Q.loopEnum)!==null&&Z!==void 0?Z:N7,meta:(V=Q.meta)!==null&&V!==void 0?V:!0,messages:(T=Q.messages)!==null&&T!==void 0?T:!0,inlineRefs:(E=Q.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(v=Q.schemaId)!==null&&v!==void 0?v:"$id",addUsedSchema:(I=Q.addUsedSchema)!==null&&I!==void 0?I:!0,validateSchema:(R0=Q.validateSchema)!==null&&R0!==void 0?R0:!0,validateFormats:(x0=Q.validateFormats)!==null&&x0!==void 0?x0:!0,unicodeRegExp:(t4=Q.unicodeRegExp)!==null&&t4!==void 0?t4:!0,int32range:(a4=Q.int32range)!==null&&a4!==void 0?a4:!0,uriResolver:Qz}}class v4{constructor(Q={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,Q=this.opts={...Q,...tF(Q)};let{es5:X,lines:Y}=this.opts.code;this.scope=new pF.ValueScope({scope:{},prefixes:dF,es5:X,lines:Y}),this.logger=YU(Q.logger);let W=Q.validateFormats;if(Q.validateFormats=!1,this.RULES=(0,cF.getRules)(),q7.call(this,rF,Q,"NOT SUPPORTED"),q7.call(this,oF,Q,"DEPRECATED","warn"),this._metaOpts=QU.call(this),Q.formats)sF.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Q.keywords)eF.call(this,Q.keywords);if(typeof Q.meta=="object")this.addMetaSchema(Q.meta);aF.call(this),Q.validateFormats=W}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Q,meta:X,schemaId:Y}=this.opts,W=Z7;if(Y==="id")W={...Z7},W.id=W.$id,delete W.$id;if(X&&Q)this.addMetaSchema(W,W[Y],!1)}defaultMeta(){let{meta:Q,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof Q=="object"?Q[X]||Q:void 0}validate(Q,X){let Y;if(typeof Q=="string"){if(Y=this.getSchema(Q),!Y)throw Error(`no schema with key or ref "${Q}"`)}else Y=this.compile(Q);let W=Y(X);if(!("$async"in Y))this.errors=Y.errors;return W}compile(Q,X){let Y=this._addSchema(Q,X);return Y.validate||this._compileSchemaEnv(Y)}compileAsync(Q,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Y}=this.opts;return W.call(this,Q,X);async function W(B,K){await G.call(this,B.$schema);let D=this._addSchema(B,K);return D.validate||J.call(this,D)}async function G(B){if(B&&!this.getSchema(B))await W.call(this,{$ref:B},!0)}async function J(B){try{return this._compileSchemaEnv(B)}catch(K){if(!(K instanceof j7.default))throw K;return $.call(this,K),await z.call(this,K.missingSchema),J.call(this,B)}}function $({missingSchema:B,missingRef:K}){if(this.refs[B])throw Error(`AnySchema ${B} is loaded but ${K} cannot be resolved`)}async function z(B){let K=await H.call(this,B);if(!this.refs[B])await G.call(this,K.$schema);if(!this.refs[B])this.addSchema(K,B,X)}async function H(B){let K=this._loading[B];if(K)return K;try{return await(this._loading[B]=Y(B))}finally{delete this._loading[B]}}}addSchema(Q,X,Y,W=this.opts.validateSchema){if(Array.isArray(Q)){for(let J of Q)this.addSchema(J,void 0,Y,W);return this}let G;if(typeof Q==="object"){let{schemaId:J}=this.opts;if(G=Q[J],G!==void 0&&typeof G!="string")throw Error(`schema ${J} must be string`)}return X=(0,V6.normalizeId)(X||G),this._checkUnique(X),this.schemas[X]=this._addSchema(Q,Y,X,W,!0),this}addMetaSchema(Q,X,Y=this.opts.validateSchema){return this.addSchema(Q,X,!0,Y),this}validateSchema(Q,X){if(typeof Q=="boolean")return!0;let Y;if(Y=Q.$schema,Y!==void 0&&typeof Y!="string")throw Error("$schema must be a string");if(Y=Y||this.opts.defaultMeta||this.defaultMeta(),!Y)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let W=this.validate(Y,Q);if(!W&&X){let G="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(G);else throw Error(G)}return W}getSchema(Q){let X;while(typeof(X=w7.call(this,Q))=="string")Q=X;if(X===void 0){let{schemaId:Y}=this.opts,W=new M6.SchemaEnv({schema:{},schemaId:Y});if(X=M6.resolveSchema.call(this,W,Q),!X)return;this.refs[Q]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(Q){if(Q instanceof RegExp)return this._removeAllSchemas(this.schemas,Q),this._removeAllSchemas(this.refs,Q),this;switch(typeof Q){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=w7.call(this,Q);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[Q],delete this.refs[Q],this}case"object":{let X=Q;this._cache.delete(X);let Y=Q[this.opts.schemaId];if(Y)Y=(0,V6.normalizeId)(Y),delete this.schemas[Y],delete this.refs[Y];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Q){for(let X of Q)this.addKeyword(X);return this}addKeyword(Q,X){let Y;if(typeof Q=="string"){if(Y=Q,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=Y}else if(typeof Q=="object"&&X===void 0){if(X=Q,Y=X.keyword,Array.isArray(Y)&&!Y.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(GU.call(this,Y,X),!X)return(0,m9.eachItem)(Y,(G)=>l9.call(this,G)),this;$U.call(this,X);let W={...X,type:(0,k4.getJSONTypes)(X.type),schemaType:(0,k4.getJSONTypes)(X.schemaType)};return(0,m9.eachItem)(Y,W.type.length===0?(G)=>l9.call(this,G,W):(G)=>W.type.forEach((J)=>l9.call(this,G,W,J))),this}getKeyword(Q){let X=this.RULES.all[Q];return typeof X=="object"?X.definition:!!X}removeKeyword(Q){let{RULES:X}=this;delete X.keywords[Q],delete X.all[Q];for(let Y of X.rules){let W=Y.rules.findIndex((G)=>G.keyword===Q);if(W>=0)Y.rules.splice(W,1)}return this}addFormat(Q,X){if(typeof X=="string")X=new RegExp(X);return this.formats[Q]=X,this}errorsText(Q=this.errors,{separator:X=", ",dataVar:Y="data"}={}){if(!Q||Q.length===0)return"No errors";return Q.map((W)=>`${Y}${W.instancePath} ${W.message}`).reduce((W,G)=>W+X+G)}$dataMetaSchema(Q,X){let Y=this.RULES.all;Q=JSON.parse(JSON.stringify(Q));for(let W of X){let G=W.split("/").slice(1),J=Q;for(let $ of G)J=J[$];for(let $ in Y){let z=Y[$];if(typeof z!="object")continue;let{$data:H}=z.definition,B=J[$];if(H&&B)J[$]=b7(B)}}return Q}_removeAllSchemas(Q,X){for(let Y in Q){let W=Q[Y];if(!X||X.test(Y)){if(typeof W=="string")delete Q[Y];else if(W&&!W.meta)this._cache.delete(W.schema),delete Q[Y]}}}_addSchema(Q,X,Y,W=this.opts.validateSchema,G=this.opts.addUsedSchema){let J,{schemaId:$}=this.opts;if(typeof Q=="object")J=Q[$];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Q!="boolean")throw Error("schema must be object or boolean");let z=this._cache.get(Q);if(z!==void 0)return z;Y=(0,V6.normalizeId)(J||Y);let H=V6.getSchemaRefs.call(this,Q,Y);if(z=new M6.SchemaEnv({schema:Q,schemaId:$,meta:X,baseId:Y,localRefs:H}),this._cache.set(z.schema,z),G&&!Y.startsWith("#")){if(Y)this._checkUnique(Y);this.refs[Y]=z}if(W)this.validateSchema(Q,!0);return z}_checkUnique(Q){if(this.schemas[Q]||this.refs[Q])throw Error(`schema with key or id "${Q}" already exists`)}_compileSchemaEnv(Q){if(Q.meta)this._compileMetaSchema(Q);else M6.compileSchema.call(this,Q);if(!Q.validate)throw Error("ajv implementation error");return Q.validate}_compileMetaSchema(Q){let X=this.opts;this.opts=this._metaOpts;try{M6.compileSchema.call(this,Q)}finally{this.opts=X}}}v4.ValidationError=mF.default;v4.MissingRefError=j7.default;c0.default=v4;function q7(Q,X,Y,W="error"){for(let G in Q){let J=G;if(J in X)this.logger[W](`${Y}: option ${G}. ${Q[J]}`)}}function w7(Q){return Q=(0,V6.normalizeId)(Q),this.schemas[Q]||this.refs[Q]}function aF(){let Q=this.opts.schemas;if(!Q)return;if(Array.isArray(Q))this.addSchema(Q);else for(let X in Q)this.addSchema(Q[X],X)}function sF(){for(let Q in this.opts.formats){let X=this.opts.formats[Q];if(X)this.addFormat(Q,X)}}function eF(Q){if(Array.isArray(Q)){this.addVocabulary(Q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in Q){let Y=Q[X];if(!Y.keyword)Y.keyword=X;this.addKeyword(Y)}}function QU(){let Q={...this.opts};for(let X of nF)delete Q[X];return Q}var XU={log(){},warn(){},error(){}};function YU(Q){if(Q===!1)return XU;if(Q===void 0)return console;if(Q.log&&Q.warn&&Q.error)return Q;throw Error("logger must implement log, warn and error methods")}var WU=/^[a-z_$][a-z0-9_$:-]*$/i;function GU(Q,X){let{RULES:Y}=this;if((0,m9.eachItem)(Q,(W)=>{if(Y.keywords[W])throw Error(`Keyword ${W} is already defined`);if(!WU.test(W))throw Error(`Keyword ${W} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function l9(Q,X,Y){var W;let G=X===null||X===void 0?void 0:X.post;if(Y&&G)throw Error('keyword with "post" flag cannot have "type"');let{RULES:J}=this,$=G?J.post:J.rules.find(({type:H})=>H===Y);if(!$)$={type:Y,rules:[]},J.rules.push($);if(J.keywords[Q]=!0,!X)return;let z={keyword:Q,definition:{...X,type:(0,k4.getJSONTypes)(X.type),schemaType:(0,k4.getJSONTypes)(X.schemaType)}};if(X.before)JU.call(this,$,z,X.before);else $.rules.push(z);J.all[Q]=z,(W=X.implements)===null||W===void 0||W.forEach((H)=>this.addKeyword(H))}function JU(Q,X,Y){let W=Q.rules.findIndex((G)=>G.keyword===Y);if(W>=0)Q.rules.splice(W,0,X);else Q.rules.push(X),this.logger.warn(`rule ${Y} is not defined`)}function $U(Q){let{metaSchema:X}=Q;if(X===void 0)return;if(Q.$data&&this.opts.$data)X=b7(X);Q.validateSchema=this.compile(X,!0)}var zU={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function b7(Q){return{anyOf:[Q,zU]}}});var T7=N((I7)=>{Object.defineProperty(I7,"__esModule",{value:!0});var KU={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};I7.default=KU});var x7=N((k7)=>{Object.defineProperty(k7,"__esModule",{value:!0});k7.callRef=k7.getValidate=void 0;var AU=U6(),S7=N0(),F0=k(),T1=f0(),R7=I4(),x4=u(),FU={keyword:"$ref",schemaType:"string",code(Q){let{gen:X,schema:Y,it:W}=Q,{baseId:G,schemaEnv:J,validateName:$,opts:z,self:H}=W,{root:B}=J;if((Y==="#"||Y==="#/")&&G===B.baseId)return D();let K=R7.resolveRef.call(H,B,G,Y);if(K===void 0)throw new AU.default(W.opts.uriResolver,G,Y);if(K instanceof R7.SchemaEnv)return U(K);return L(K);function D(){if(J===B)return _4(Q,$,J,J.$async);let O=X.scopeValue("root",{ref:B});return _4(Q,F0._`${O}.validate`,B,B.$async)}function U(O){let M=C7(Q,O);_4(Q,M,O,O.$async)}function L(O){let M=X.scopeValue("schema",z.code.source===!0?{ref:O,code:(0,F0.stringify)(O)}:{ref:O}),Z=X.name("valid"),V=Q.subschema({schema:O,dataTypes:[],schemaPath:F0.nil,topSchemaRef:M,errSchemaPath:Y},Z);Q.mergeEvaluated(V),Q.ok(Z)}}};function C7(Q,X){let{gen:Y}=Q;return X.validate?Y.scopeValue("validate",{ref:X.validate}):F0._`${Y.scopeValue("wrapper",{ref:X})}.validate`}k7.getValidate=C7;function _4(Q,X,Y,W){let{gen:G,it:J}=Q,{allErrors:$,schemaEnv:z,opts:H}=J,B=H.passContext?T1.default.this:F0.nil;if(W)K();else D();function K(){if(!z.$async)throw Error("async schema referenced by sync schema");let O=G.let("valid");G.try(()=>{if(G.code(F0._`await ${(0,S7.callValidateCode)(Q,X,B)}`),L(X),!$)G.assign(O,!0)},(M)=>{if(G.if(F0._`!(${M} instanceof ${J.ValidationError})`,()=>G.throw(M)),U(M),!$)G.assign(O,!1)}),Q.ok(O)}function D(){Q.result((0,S7.callValidateCode)(Q,X,B),()=>L(X),()=>U(X))}function U(O){let M=F0._`${O}.errors`;G.assign(T1.default.vErrors,F0._`${T1.default.vErrors} === null ? ${M} : ${T1.default.vErrors}.concat(${M})`),G.assign(T1.default.errors,F0._`${T1.default.vErrors}.length`)}function L(O){var M;if(!J.opts.unevaluated)return;let Z=(M=Y===null||Y===void 0?void 0:Y.validate)===null||M===void 0?void 0:M.evaluated;if(J.props!==!0)if(Z&&!Z.dynamicProps){if(Z.props!==void 0)J.props=x4.mergeEvaluated.props(G,Z.props,J.props)}else{let V=G.var("props",F0._`${O}.evaluated.props`);J.props=x4.mergeEvaluated.props(G,V,J.props,F0.Name)}if(J.items!==!0)if(Z&&!Z.dynamicItems){if(Z.items!==void 0)J.items=x4.mergeEvaluated.items(G,Z.items,J.items)}else{let V=G.var("items",F0._`${O}.evaluated.items`);J.items=x4.mergeEvaluated.items(G,V,J.items,F0.Name)}}}k7.callRef=_4;k7.default=FU});var y7=N((_7)=>{Object.defineProperty(_7,"__esModule",{value:!0});var OU=T7(),MU=x7(),VU=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",OU.default,MU.default];_7.default=VU});var h7=N((g7)=>{Object.defineProperty(g7,"__esModule",{value:!0});var y4=k(),Y1=y4.operators,g4={maximum:{okStr:"<=",ok:Y1.LTE,fail:Y1.GT},minimum:{okStr:">=",ok:Y1.GTE,fail:Y1.LT},exclusiveMaximum:{okStr:"<",ok:Y1.LT,fail:Y1.GTE},exclusiveMinimum:{okStr:">",ok:Y1.GT,fail:Y1.LTE}},NU={message:({keyword:Q,schemaCode:X})=>y4.str`must be ${g4[Q].okStr} ${X}`,params:({keyword:Q,schemaCode:X})=>y4._`{comparison: ${g4[Q].okStr}, limit: ${X}}`},qU={keyword:Object.keys(g4),type:"number",schemaType:"number",$data:!0,error:NU,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q;Q.fail$data(y4._`${Y} ${g4[X].fail} ${W} || isNaN(${Y})`)}};g7.default=qU});var f7=N((u7)=>{Object.defineProperty(u7,"__esModule",{value:!0});var Z6=k(),jU={message:({schemaCode:Q})=>Z6.str`must be multiple of ${Q}`,params:({schemaCode:Q})=>Z6._`{multipleOf: ${Q}}`},PU={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:jU,code(Q){let{gen:X,data:Y,schemaCode:W,it:G}=Q,J=G.opts.multipleOfPrecision,$=X.let("res"),z=J?Z6._`Math.abs(Math.round(${$}) - ${$}) > 1e-${J}`:Z6._`${$} !== parseInt(${$})`;Q.fail$data(Z6._`(${W} === 0 || (${$} = ${Y}/${W}, ${z}))`)}};u7.default=PU});var c7=N((m7)=>{Object.defineProperty(m7,"__esModule",{value:!0});function l7(Q){let X=Q.length,Y=0,W=0,G;while(W<X)if(Y++,G=Q.charCodeAt(W++),G>=55296&&G<=56319&&W<X){if(G=Q.charCodeAt(W),(G&64512)===56320)W++}return Y}m7.default=l7;l7.code='require("ajv/dist/runtime/ucs2length").default'});var i7=N((p7)=>{Object.defineProperty(p7,"__esModule",{value:!0});var K1=k(),IU=u(),TU=c7(),SU={message({keyword:Q,schemaCode:X}){let Y=Q==="maxLength"?"more":"fewer";return K1.str`must NOT have ${Y} than ${X} characters`},params:({schemaCode:Q})=>K1._`{limit: ${Q}}`},RU={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:SU,code(Q){let{keyword:X,data:Y,schemaCode:W,it:G}=Q,J=X==="maxLength"?K1.operators.GT:K1.operators.LT,$=G.opts.unicode===!1?K1._`${Y}.length`:K1._`${(0,IU.useFunc)(Q.gen,TU.default)}(${Y})`;Q.fail$data(K1._`${$} ${J} ${W}`)}};p7.default=RU});var d7=N((n7)=>{Object.defineProperty(n7,"__esModule",{value:!0});var kU=N0(),h4=k(),vU={message:({schemaCode:Q})=>h4.str`must match pattern "${Q}"`,params:({schemaCode:Q})=>h4._`{pattern: ${Q}}`},xU={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:vU,code(Q){let{data:X,$data:Y,schema:W,schemaCode:G,it:J}=Q,$=J.opts.unicodeRegExp?"u":"",z=Y?h4._`(new RegExp(${G}, ${$}))`:(0,kU.usePattern)(Q,W);Q.fail$data(h4._`!${z}.test(${X})`)}};n7.default=xU});var o7=N((r7)=>{Object.defineProperty(r7,"__esModule",{value:!0});var N6=k(),yU={message({keyword:Q,schemaCode:X}){let Y=Q==="maxProperties"?"more":"fewer";return N6.str`must NOT have ${Y} than ${X} properties`},params:({schemaCode:Q})=>N6._`{limit: ${Q}}`},gU={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:yU,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q,G=X==="maxProperties"?N6.operators.GT:N6.operators.LT;Q.fail$data(N6._`Object.keys(${Y}).length ${G} ${W}`)}};r7.default=gU});var a7=N((t7)=>{Object.defineProperty(t7,"__esModule",{value:!0});var q6=N0(),w6=k(),uU=u(),fU={message:({params:{missingProperty:Q}})=>w6.str`must have required property '${Q}'`,params:({params:{missingProperty:Q}})=>w6._`{missingProperty: ${Q}}`},lU={keyword:"required",type:"object",schemaType:"array",$data:!0,error:fU,code(Q){let{gen:X,schema:Y,schemaCode:W,data:G,$data:J,it:$}=Q,{opts:z}=$;if(!J&&Y.length===0)return;let H=Y.length>=z.loopRequired;if($.allErrors)B();else K();if(z.strictRequired){let L=Q.parentSchema.properties,{definedProperties:O}=Q.it;for(let M of Y)if((L===null||L===void 0?void 0:L[M])===void 0&&!O.has(M)){let Z=$.schemaEnv.baseId+$.errSchemaPath,V=`required property "${M}" is not defined at "${Z}" (strictRequired)`;(0,uU.checkStrictMode)($,V,$.opts.strictRequired)}}function B(){if(H||J)Q.block$data(w6.nil,D);else for(let L of Y)(0,q6.checkReportMissingProp)(Q,L)}function K(){let L=X.let("missing");if(H||J){let O=X.let("valid",!0);Q.block$data(O,()=>U(L,O)),Q.ok(O)}else X.if((0,q6.checkMissingProp)(Q,Y,L)),(0,q6.reportMissingProp)(Q,L),X.else()}function D(){X.forOf("prop",W,(L)=>{Q.setParams({missingProperty:L}),X.if((0,q6.noPropertyInData)(X,G,L,z.ownProperties),()=>Q.error())})}function U(L,O){Q.setParams({missingProperty:L}),X.forOf(L,W,()=>{X.assign(O,(0,q6.propertyInData)(X,G,L,z.ownProperties)),X.if((0,w6.not)(O),()=>{Q.error(),X.break()})},w6.nil)}}};t7.default=lU});var e7=N((s7)=>{Object.defineProperty(s7,"__esModule",{value:!0});var j6=k(),cU={message({keyword:Q,schemaCode:X}){let Y=Q==="maxItems"?"more":"fewer";return j6.str`must NOT have ${Y} than ${X} items`},params:({schemaCode:Q})=>j6._`{limit: ${Q}}`},pU={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:cU,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q,G=X==="maxItems"?j6.operators.GT:j6.operators.LT;Q.fail$data(j6._`${Y}.length ${G} ${W}`)}};s7.default=pU});var u4=N((X5)=>{Object.defineProperty(X5,"__esModule",{value:!0});var Q5=I9();Q5.code='require("ajv/dist/runtime/equal").default';X5.default=Q5});var W5=N((Y5)=>{Object.defineProperty(Y5,"__esModule",{value:!0});var c9=B6(),J0=k(),dU=u(),rU=u4(),oU={message:({params:{i:Q,j:X}})=>J0.str`must NOT have duplicate items (items ## ${X} and ${Q} are identical)`,params:({params:{i:Q,j:X}})=>J0._`{i: ${Q}, j: ${X}}`},tU={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:oU,code(Q){let{gen:X,data:Y,$data:W,schema:G,parentSchema:J,schemaCode:$,it:z}=Q;if(!W&&!G)return;let H=X.let("valid"),B=J.items?(0,c9.getSchemaTypes)(J.items):[];Q.block$data(H,K,J0._`${$} === false`),Q.ok(H);function K(){let O=X.let("i",J0._`${Y}.length`),M=X.let("j");Q.setParams({i:O,j:M}),X.assign(H,!0),X.if(J0._`${O} > 1`,()=>(D()?U:L)(O,M))}function D(){return B.length>0&&!B.some((O)=>O==="object"||O==="array")}function U(O,M){let Z=X.name("item"),V=(0,c9.checkDataTypes)(B,Z,z.opts.strictNumbers,c9.DataType.Wrong),T=X.const("indices",J0._`{}`);X.for(J0._`;${O}--;`,()=>{if(X.let(Z,J0._`${Y}[${O}]`),X.if(V,J0._`continue`),B.length>1)X.if(J0._`typeof ${Z} == "string"`,J0._`${Z} += "_"`);X.if(J0._`typeof ${T}[${Z}] == "number"`,()=>{X.assign(M,J0._`${T}[${Z}]`),Q.error(),X.assign(H,!1).break()}).code(J0._`${T}[${Z}] = ${O}`)})}function L(O,M){let Z=(0,dU.useFunc)(X,rU.default),V=X.name("outer");X.label(V).for(J0._`;${O}--;`,()=>X.for(J0._`${M} = ${O}; ${M}--;`,()=>X.if(J0._`${Z}(${Y}[${O}], ${Y}[${M}])`,()=>{Q.error(),X.assign(H,!1).break(V)})))}}};Y5.default=tU});var J5=N((G5)=>{Object.defineProperty(G5,"__esModule",{value:!0});var p9=k(),sU=u(),eU=u4(),QL={message:"must be equal to constant",params:({schemaCode:Q})=>p9._`{allowedValue: ${Q}}`},XL={keyword:"const",$data:!0,error:QL,code(Q){let{gen:X,data:Y,$data:W,schemaCode:G,schema:J}=Q;if(W||J&&typeof J=="object")Q.fail$data(p9._`!${(0,sU.useFunc)(X,eU.default)}(${Y}, ${G})`);else Q.fail(p9._`${J} !== ${Y}`)}};G5.default=XL});var z5=N(($5)=>{Object.defineProperty($5,"__esModule",{value:!0});var P6=k(),WL=u(),GL=u4(),JL={message:"must be equal to one of the allowed values",params:({schemaCode:Q})=>P6._`{allowedValues: ${Q}}`},$L={keyword:"enum",schemaType:"array",$data:!0,error:JL,code(Q){let{gen:X,data:Y,$data:W,schema:G,schemaCode:J,it:$}=Q;if(!W&&G.length===0)throw Error("enum must have non-empty array");let z=G.length>=$.opts.loopEnum,H,B=()=>H!==null&&H!==void 0?H:H=(0,WL.useFunc)(X,GL.default),K;if(z||W)K=X.let("valid"),Q.block$data(K,D);else{if(!Array.isArray(G))throw Error("ajv implementation error");let L=X.const("vSchema",J);K=(0,P6.or)(...G.map((O,M)=>U(L,M)))}Q.pass(K);function D(){X.assign(K,!1),X.forOf("v",J,(L)=>X.if(P6._`${B()}(${Y}, ${L})`,()=>X.assign(K,!0).break()))}function U(L,O){let M=G[O];return typeof M==="object"&&M!==null?P6._`${B()}(${Y}, ${L}[${O}])`:P6._`${Y} === ${M}`}}};$5.default=$L});var B5=N((H5)=>{Object.defineProperty(H5,"__esModule",{value:!0});var HL=h7(),BL=f7(),KL=i7(),DL=d7(),AL=o7(),FL=a7(),UL=e7(),LL=W5(),OL=J5(),ML=z5(),VL=[HL.default,BL.default,KL.default,DL.default,AL.default,FL.default,UL.default,LL.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},OL.default,ML.default];H5.default=VL});var n9=N((D5)=>{Object.defineProperty(D5,"__esModule",{value:!0});D5.validateAdditionalItems=void 0;var D1=k(),i9=u(),NL={message:({params:{len:Q}})=>D1.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>D1._`{limit: ${Q}}`},qL={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:NL,code(Q){let{parentSchema:X,it:Y}=Q,{items:W}=X;if(!Array.isArray(W)){(0,i9.checkStrictMode)(Y,'"additionalItems" is ignored when "items" is not an array of schemas');return}K5(Q,W)}};function K5(Q,X){let{gen:Y,schema:W,data:G,keyword:J,it:$}=Q;$.items=!0;let z=Y.const("len",D1._`${G}.length`);if(W===!1)Q.setParams({len:X.length}),Q.pass(D1._`${z} <= ${X.length}`);else if(typeof W=="object"&&!(0,i9.alwaysValidSchema)($,W)){let B=Y.var("valid",D1._`${z} <= ${X.length}`);Y.if((0,D1.not)(B),()=>H(B)),Q.ok(B)}function H(B){Y.forRange("i",X.length,z,(K)=>{if(Q.subschema({keyword:J,dataProp:K,dataPropType:i9.Type.Num},B),!$.allErrors)Y.if((0,D1.not)(B),()=>Y.break())})}}D5.validateAdditionalItems=K5;D5.default=qL});var d9=N((L5)=>{Object.defineProperty(L5,"__esModule",{value:!0});L5.validateTuple=void 0;var F5=k(),f4=u(),jL=N0(),PL={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Q){let{schema:X,it:Y}=Q;if(Array.isArray(X))return U5(Q,"additionalItems",X);if(Y.items=!0,(0,f4.alwaysValidSchema)(Y,X))return;Q.ok((0,jL.validateArray)(Q))}};function U5(Q,X,Y=Q.schema){let{gen:W,parentSchema:G,data:J,keyword:$,it:z}=Q;if(K(G),z.opts.unevaluated&&Y.length&&z.items!==!0)z.items=f4.mergeEvaluated.items(W,Y.length,z.items);let H=W.name("valid"),B=W.const("len",F5._`${J}.length`);Y.forEach((D,U)=>{if((0,f4.alwaysValidSchema)(z,D))return;W.if(F5._`${B} > ${U}`,()=>Q.subschema({keyword:$,schemaProp:U,dataProp:U},H)),Q.ok(H)});function K(D){let{opts:U,errSchemaPath:L}=z,O=Y.length,M=O===D.minItems&&(O===D.maxItems||D[X]===!1);if(U.strictTuples&&!M){let Z=`"${$}" is ${O}-tuple, but minItems or maxItems/${X} are not specified or different at path "${L}"`;(0,f4.checkStrictMode)(z,Z,U.strictTuples)}}}L5.validateTuple=U5;L5.default=PL});var V5=N((M5)=>{Object.defineProperty(M5,"__esModule",{value:!0});var EL=d9(),IL={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Q)=>(0,EL.validateTuple)(Q,"items")};M5.default=IL});var q5=N((N5)=>{Object.defineProperty(N5,"__esModule",{value:!0});var Z5=k(),SL=u(),RL=N0(),CL=n9(),kL={message:({params:{len:Q}})=>Z5.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>Z5._`{limit: ${Q}}`},vL={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:kL,code(Q){let{schema:X,parentSchema:Y,it:W}=Q,{prefixItems:G}=Y;if(W.items=!0,(0,SL.alwaysValidSchema)(W,X))return;if(G)(0,CL.validateAdditionalItems)(Q,G);else Q.ok((0,RL.validateArray)(Q))}};N5.default=vL});var j5=N((w5)=>{Object.defineProperty(w5,"__esModule",{value:!0});var q0=k(),l4=u(),_L={message:({params:{min:Q,max:X}})=>X===void 0?q0.str`must contain at least ${Q} valid item(s)`:q0.str`must contain at least ${Q} and no more than ${X} valid item(s)`,params:({params:{min:Q,max:X}})=>X===void 0?q0._`{minContains: ${Q}}`:q0._`{minContains: ${Q}, maxContains: ${X}}`},yL={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:_L,code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,it:J}=Q,$,z,{minContains:H,maxContains:B}=W;if(J.opts.next)$=H===void 0?1:H,z=B;else $=1;let K=X.const("len",q0._`${G}.length`);if(Q.setParams({min:$,max:z}),z===void 0&&$===0){(0,l4.checkStrictMode)(J,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(z!==void 0&&$>z){(0,l4.checkStrictMode)(J,'"minContains" > "maxContains" is always invalid'),Q.fail();return}if((0,l4.alwaysValidSchema)(J,Y)){let M=q0._`${K} >= ${$}`;if(z!==void 0)M=q0._`${M} && ${K} <= ${z}`;Q.pass(M);return}J.items=!0;let D=X.name("valid");if(z===void 0&&$===1)L(D,()=>X.if(D,()=>X.break()));else if($===0){if(X.let(D,!0),z!==void 0)X.if(q0._`${G}.length > 0`,U)}else X.let(D,!1),U();Q.result(D,()=>Q.reset());function U(){let M=X.name("_valid"),Z=X.let("count",0);L(M,()=>X.if(M,()=>O(Z)))}function L(M,Z){X.forRange("i",0,K,(V)=>{Q.subschema({keyword:"contains",dataProp:V,dataPropType:l4.Type.Num,compositeRule:!0},M),Z()})}function O(M){if(X.code(q0._`${M}++`),z===void 0)X.if(q0._`${M} >= ${$}`,()=>X.assign(D,!0).break());else if(X.if(q0._`${M} > ${z}`,()=>X.assign(D,!1).break()),$===1)X.assign(D,!0);else X.if(q0._`${M} >= ${$}`,()=>X.assign(D,!0))}}};w5.default=yL});var S5=N((E5)=>{Object.defineProperty(E5,"__esModule",{value:!0});E5.validateSchemaDeps=E5.validatePropertyDeps=E5.error=void 0;var r9=k(),hL=u(),b6=N0();E5.error={message:({params:{property:Q,depsCount:X,deps:Y}})=>{let W=X===1?"property":"properties";return r9.str`must have ${W} ${Y} when property ${Q} is present`},params:({params:{property:Q,depsCount:X,deps:Y,missingProperty:W}})=>r9._`{property: ${Q},
|
|
6
|
+
|| ${$} === "boolean" || ${G} === null`).assign(z,R._`[${G}]`)}}}function FD({gen:Q,parentData:X,parentDataProperty:Y},W){Q.if(R._`${X} !== undefined`,()=>Q.assign(R._`${X}[${Y}]`,W))}function w9(Q,X,Y,W=P1.Correct){let G=W===P1.Correct?R.operators.EQ:R.operators.NEQ,J;switch(Q){case"null":return R._`${X} ${G} null`;case"array":J=R._`Array.isArray(${X})`;break;case"object":J=R._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":J=$(R._`!(${X} % 1) && !isNaN(${X})`);break;case"number":J=$();break;default:return R._`typeof ${X} ${G} ${Q}`}return W===P1.Correct?J:(0,R.not)(J);function $(z=R.nil){return(0,R.and)(R._`typeof ${X} == "number"`,z,Y?R._`isFinite(${X})`:R.nil)}}zJ.checkDataType=w9;function j9(Q,X,Y,W){if(Q.length===1)return w9(Q[0],X,Y,W);let G,J=(0,GJ.toHash)(Q);if(J.array&&J.object){let $=R._`typeof ${X} != "object"`;G=J.null?$:R._`!${X} || ${$}`,delete J.null,delete J.array,delete J.object}else G=R.nil;if(J.number)delete J.integer;for(let $ in J)G=(0,R.and)(G,w9($,X,Y,W));return G}zJ.checkDataTypes=j9;var UD={message:({schema:Q})=>`must be ${Q}`,params:({schema:Q,schemaValue:X})=>typeof Q=="string"?R._`{type: ${Q}}`:R._`{type: ${X}}`};function P9(Q){let X=LD(Q);(0,HD.reportError)(X,UD)}zJ.reportTypeError=P9;function LD(Q){let{gen:X,data:Y,schema:W}=Q,G=(0,GJ.schemaRefOrVal)(Q,W,"type");return{gen:X,keyword:"type",data:Y,schema:W.type,schemaCode:G,schemaValue:G,parentSchema:W,params:{},it:Q}}});var AJ=N((BJ)=>{Object.defineProperty(BJ,"__esModule",{value:!0});BJ.assignDefaults=void 0;var b1=k(),wD=u();function jD(Q,X){let{properties:Y,items:W}=Q.schema;if(X==="object"&&Y)for(let G in Y)KJ(Q,G,Y[G].default);else if(X==="array"&&Array.isArray(W))W.forEach((G,J)=>KJ(Q,J,G.default))}BJ.assignDefaults=jD;function KJ(Q,X,Y){let{gen:W,compositeRule:G,data:J,opts:$}=Q;if(Y===void 0)return;let z=b1._`${J}${(0,b1.getProperty)(X)}`;if(G){(0,wD.checkStrictMode)(Q,`default is ignored for: ${z}`);return}let H=b1._`${z} === undefined`;if($.useDefaults==="empty")H=b1._`${H} || ${z} === null || ${z} === ""`;W.if(H,b1._`${z} = ${(0,b1.stringify)(Y)}`)}});var N0=N((LJ)=>{Object.defineProperty(LJ,"__esModule",{value:!0});LJ.validateUnion=LJ.validateArray=LJ.usePattern=LJ.callValidateCode=LJ.schemaProperties=LJ.allSchemaProperties=LJ.noPropertyInData=LJ.propertyInData=LJ.isOwnProperty=LJ.hasPropFunc=LJ.reportMissingProp=LJ.checkMissingProp=LJ.checkReportMissingProp=void 0;var n=k(),b9=u(),Q1=f0(),PD=u();function bD(Q,X){let{gen:Y,data:W,it:G}=Q;Y.if(I9(Y,W,X,G.opts.ownProperties),()=>{Q.setParams({missingProperty:n._`${X}`},!0),Q.error()})}LJ.checkReportMissingProp=bD;function ED({gen:Q,data:X,it:{opts:Y}},W,G){return(0,n.or)(...W.map((J)=>(0,n.and)(I9(Q,X,J,Y.ownProperties),n._`${G} = ${J}`)))}LJ.checkMissingProp=ED;function ID(Q,X){Q.setParams({missingProperty:X},!0),Q.error()}LJ.reportMissingProp=ID;function FJ(Q){return Q.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}LJ.hasPropFunc=FJ;function E9(Q,X,Y){return n._`${FJ(Q)}.call(${X}, ${Y})`}LJ.isOwnProperty=E9;function TD(Q,X,Y,W){let G=n._`${X}${(0,n.getProperty)(Y)} !== undefined`;return W?n._`${G} && ${E9(Q,X,Y)}`:G}LJ.propertyInData=TD;function I9(Q,X,Y,W){let G=n._`${X}${(0,n.getProperty)(Y)} === undefined`;return W?(0,n.or)(G,(0,n.not)(E9(Q,X,Y))):G}LJ.noPropertyInData=I9;function UJ(Q){return Q?Object.keys(Q).filter((X)=>X!=="__proto__"):[]}LJ.allSchemaProperties=UJ;function SD(Q,X){return UJ(X).filter((Y)=>!(0,b9.alwaysValidSchema)(Q,X[Y]))}LJ.schemaProperties=SD;function RD({schemaCode:Q,data:X,it:{gen:Y,topSchemaRef:W,schemaPath:G,errorPath:J},it:$},z,H,K){let B=K?n._`${Q}, ${X}, ${W}${G}`:X,D=[[Q1.default.instancePath,(0,n.strConcat)(Q1.default.instancePath,J)],[Q1.default.parentData,$.parentData],[Q1.default.parentDataProperty,$.parentDataProperty],[Q1.default.rootData,Q1.default.rootData]];if($.opts.dynamicRef)D.push([Q1.default.dynamicAnchors,Q1.default.dynamicAnchors]);let U=n._`${B}, ${Y.object(...D)}`;return H!==n.nil?n._`${z}.call(${H}, ${U})`:n._`${z}(${U})`}LJ.callValidateCode=RD;var CD=n._`new RegExp`;function kD({gen:Q,it:{opts:X}},Y){let W=X.unicodeRegExp?"u":"",{regExp:G}=X.code,J=G(Y,W);return Q.scopeValue("pattern",{key:J.toString(),ref:J,code:n._`${G.code==="new RegExp"?CD:(0,PD.useFunc)(Q,G)}(${Y}, ${W})`})}LJ.usePattern=kD;function vD(Q){let{gen:X,data:Y,keyword:W,it:G}=Q,J=X.name("valid");if(G.allErrors){let z=X.let("valid",!0);return $(()=>X.assign(z,!1)),z}return X.var(J,!0),$(()=>X.break()),J;function $(z){let H=X.const("len",n._`${Y}.length`);X.forRange("i",0,H,(K)=>{Q.subschema({keyword:W,dataProp:K,dataPropType:b9.Type.Num},J),X.if((0,n.not)(J),z)})}}LJ.validateArray=vD;function xD(Q){let{gen:X,schema:Y,keyword:W,it:G}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");if(Y.some((H)=>(0,b9.alwaysValidSchema)(G,H))&&!G.opts.unevaluated)return;let $=X.let("valid",!1),z=X.name("_valid");X.block(()=>Y.forEach((H,K)=>{let B=Q.subschema({keyword:W,schemaProp:K,compositeRule:!0},z);if(X.assign($,n._`${$} || ${z}`),!Q.mergeValidEvaluated(B,z))X.if((0,n.not)($))})),Q.result($,()=>Q.reset(),()=>Q.error(!0))}LJ.validateUnion=xD});var qJ=N((ZJ)=>{Object.defineProperty(ZJ,"__esModule",{value:!0});ZJ.validateKeywordUsage=ZJ.validSchemaType=ZJ.funcKeywordCode=ZJ.macroKeywordCode=void 0;var K0=k(),H1=f0(),dD=N0(),rD=H6();function oD(Q,X){let{gen:Y,keyword:W,schema:G,parentSchema:J,it:$}=Q,z=X.macro.call($.self,G,J,$),H=VJ(Y,W,z);if($.opts.validateSchema!==!1)$.self.validateSchema(z,!0);let K=Y.name("valid");Q.subschema({schema:z,schemaPath:K0.nil,errSchemaPath:`${$.errSchemaPath}/${W}`,topSchemaRef:H,compositeRule:!0},K),Q.pass(K,()=>Q.error(!0))}ZJ.macroKeywordCode=oD;function tD(Q,X){var Y;let{gen:W,keyword:G,schema:J,parentSchema:$,$data:z,it:H}=Q;sD(H,X);let K=!z&&X.compile?X.compile.call(H.self,J,$,H):X.validate,B=VJ(W,G,K),D=W.let("valid");Q.block$data(D,U),Q.ok((Y=X.valid)!==null&&Y!==void 0?Y:D);function U(){if(X.errors===!1){if(M(),X.modifying)MJ(Q);Z(()=>Q.error())}else{let V=X.async?L():O();if(X.modifying)MJ(Q);Z(()=>aD(Q,V))}}function L(){let V=W.let("ruleErrs",null);return W.try(()=>M(K0._`await `),(T)=>W.assign(D,!1).if(K0._`${T} instanceof ${H.ValidationError}`,()=>W.assign(V,K0._`${T}.errors`),()=>W.throw(T))),V}function O(){let V=K0._`${B}.errors`;return W.assign(V,null),M(K0.nil),V}function M(V=X.async?K0._`await `:K0.nil){let T=H.opts.passContext?H1.default.this:H1.default.self,E=!(("compile"in X)&&!z||X.schema===!1);W.assign(D,K0._`${V}${(0,dD.callValidateCode)(Q,B,T,E)}`,X.modifying)}function Z(V){var T;W.if((0,K0.not)((T=X.valid)!==null&&T!==void 0?T:D),V)}}ZJ.funcKeywordCode=tD;function MJ(Q){let{gen:X,data:Y,it:W}=Q;X.if(W.parentData,()=>X.assign(Y,K0._`${W.parentData}[${W.parentDataProperty}]`))}function aD(Q,X){let{gen:Y}=Q;Y.if(K0._`Array.isArray(${X})`,()=>{Y.assign(H1.default.vErrors,K0._`${H1.default.vErrors} === null ? ${X} : ${H1.default.vErrors}.concat(${X})`).assign(H1.default.errors,K0._`${H1.default.vErrors}.length`),(0,rD.extendErrors)(Q)},()=>Q.error())}function sD({schemaEnv:Q},X){if(X.async&&!Q.$async)throw Error("async keyword in sync schema")}function VJ(Q,X,Y){if(Y===void 0)throw Error(`keyword "${X}" failed to compile`);return Q.scopeValue("keyword",typeof Y=="function"?{ref:Y}:{ref:Y,code:(0,K0.stringify)(Y)})}function eD(Q,X,Y=!1){return!X.length||X.some((W)=>W==="array"?Array.isArray(Q):W==="object"?Q&&typeof Q=="object"&&!Array.isArray(Q):typeof Q==W||Y&&typeof Q>"u")}ZJ.validSchemaType=eD;function QA({schema:Q,opts:X,self:Y,errSchemaPath:W},G,J){if(Array.isArray(G.keyword)?!G.keyword.includes(J):G.keyword!==J)throw Error("ajv implementation error");let $=G.dependencies;if($===null||$===void 0?void 0:$.some((z)=>!Object.prototype.hasOwnProperty.call(Q,z)))throw Error(`parent schema must have dependencies of ${J}: ${$.join(",")}`);if(G.validateSchema){if(!G.validateSchema(Q[J])){let H=`keyword "${J}" value is invalid at path "${W}": `+Y.errorsText(G.validateSchema.errors);if(X.validateSchema==="log")Y.logger.error(H);else throw Error(H)}}}ZJ.validateKeywordUsage=QA});var bJ=N((jJ)=>{Object.defineProperty(jJ,"__esModule",{value:!0});jJ.extendSubschemaMode=jJ.extendSubschemaData=jJ.getSubschema=void 0;var C0=k(),wJ=u();function GA(Q,{keyword:X,schemaProp:Y,schema:W,schemaPath:G,errSchemaPath:J,topSchemaRef:$}){if(X!==void 0&&W!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let z=Q.schema[X];return Y===void 0?{schema:z,schemaPath:C0._`${Q.schemaPath}${(0,C0.getProperty)(X)}`,errSchemaPath:`${Q.errSchemaPath}/${X}`}:{schema:z[Y],schemaPath:C0._`${Q.schemaPath}${(0,C0.getProperty)(X)}${(0,C0.getProperty)(Y)}`,errSchemaPath:`${Q.errSchemaPath}/${X}/${(0,wJ.escapeFragment)(Y)}`}}if(W!==void 0){if(G===void 0||J===void 0||$===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:W,schemaPath:G,topSchemaRef:$,errSchemaPath:J}}throw Error('either "keyword" or "schema" must be passed')}jJ.getSubschema=GA;function JA(Q,X,{dataProp:Y,dataPropType:W,data:G,dataTypes:J,propertyName:$}){if(G!==void 0&&Y!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:z}=X;if(Y!==void 0){let{errorPath:K,dataPathArr:B,opts:D}=X,U=z.let("data",C0._`${X.data}${(0,C0.getProperty)(Y)}`,!0);H(U),Q.errorPath=C0.str`${K}${(0,wJ.getErrorPath)(Y,W,D.jsPropertySyntax)}`,Q.parentDataProperty=C0._`${Y}`,Q.dataPathArr=[...B,Q.parentDataProperty]}if(G!==void 0){let K=G instanceof C0.Name?G:z.let("data",G,!0);if(H(K),$!==void 0)Q.propertyName=$}if(J)Q.dataTypes=J;function H(K){Q.data=K,Q.dataLevel=X.dataLevel+1,Q.dataTypes=[],X.definedProperties=new Set,Q.parentData=X.data,Q.dataNames=[...X.dataNames,K]}}jJ.extendSubschemaData=JA;function $A(Q,{jtdDiscriminator:X,jtdMetadata:Y,compositeRule:W,createErrors:G,allErrors:J}){if(W!==void 0)Q.compositeRule=W;if(G!==void 0)Q.createErrors=G;if(J!==void 0)Q.allErrors=J;Q.jtdDiscriminator=X,Q.jtdMetadata=Y}jJ.extendSubschemaMode=$A});var T9=N((WP,EJ)=>{EJ.exports=function Q(X,Y){if(X===Y)return!0;if(X&&Y&&typeof X=="object"&&typeof Y=="object"){if(X.constructor!==Y.constructor)return!1;var W,G,J;if(Array.isArray(X)){if(W=X.length,W!=Y.length)return!1;for(G=W;G--!==0;)if(!Q(X[G],Y[G]))return!1;return!0}if(X.constructor===RegExp)return X.source===Y.source&&X.flags===Y.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===Y.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===Y.toString();if(J=Object.keys(X),W=J.length,W!==Object.keys(Y).length)return!1;for(G=W;G--!==0;)if(!Object.prototype.hasOwnProperty.call(Y,J[G]))return!1;for(G=W;G--!==0;){var $=J[G];if(!Q(X[$],Y[$]))return!1}return!0}return X!==X&&Y!==Y}});var TJ=N((GP,IJ)=>{var X1=IJ.exports=function(Q,X,Y){if(typeof X=="function")Y=X,X={};Y=X.cb||Y;var W=typeof Y=="function"?Y:Y.pre||function(){},G=Y.post||function(){};j4(X,W,G,Q,"",Q)};X1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};X1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};X1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};X1.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 j4(Q,X,Y,W,G,J,$,z,H,K){if(W&&typeof W=="object"&&!Array.isArray(W)){X(W,G,J,$,z,H,K);for(var B in W){var D=W[B];if(Array.isArray(D)){if(B in X1.arrayKeywords)for(var U=0;U<D.length;U++)j4(Q,X,Y,D[U],G+"/"+B+"/"+U,J,G,B,W,U)}else if(B in X1.propsKeywords){if(D&&typeof D=="object")for(var L in D)j4(Q,X,Y,D[L],G+"/"+B+"/"+KA(L),J,G,B,W,L)}else if(B in X1.keywords||Q.allKeys&&!(B in X1.skipKeywords))j4(Q,X,Y,D,G+"/"+B,J,G,B,W)}Y(W,G,J,$,z,H,K)}}function KA(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}});var B6=N((kJ)=>{Object.defineProperty(kJ,"__esModule",{value:!0});kJ.getSchemaRefs=kJ.resolveUrl=kJ.normalizeId=kJ._getFullPath=kJ.getFullPath=kJ.inlineRef=void 0;var BA=u(),DA=T9(),AA=TJ(),FA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function UA(Q,X=!0){if(typeof Q=="boolean")return!0;if(X===!0)return!S9(Q);if(!X)return!1;return SJ(Q)<=X}kJ.inlineRef=UA;var LA=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function S9(Q){for(let X in Q){if(LA.has(X))return!0;let Y=Q[X];if(Array.isArray(Y)&&Y.some(S9))return!0;if(typeof Y=="object"&&S9(Y))return!0}return!1}function SJ(Q){let X=0;for(let Y in Q){if(Y==="$ref")return 1/0;if(X++,FA.has(Y))continue;if(typeof Q[Y]=="object")(0,BA.eachItem)(Q[Y],(W)=>X+=SJ(W));if(X===1/0)return 1/0}return X}function RJ(Q,X="",Y){if(Y!==!1)X=E1(X);let W=Q.parse(X);return CJ(Q,W)}kJ.getFullPath=RJ;function CJ(Q,X){return Q.serialize(X).split("#")[0]+"#"}kJ._getFullPath=CJ;var OA=/#\/?$/;function E1(Q){return Q?Q.replace(OA,""):""}kJ.normalizeId=E1;function MA(Q,X,Y){return Y=E1(Y),Q.resolve(X,Y)}kJ.resolveUrl=MA;var VA=/^[a-z_][-a-z0-9._]*$/i;function ZA(Q,X){if(typeof Q=="boolean")return{};let{schemaId:Y,uriResolver:W}=this.opts,G=E1(Q[Y]||X),J={"":G},$=RJ(W,G,!1),z={},H=new Set;return AA(Q,{allKeys:!0},(D,U,L,O)=>{if(O===void 0)return;let M=$+U,Z=J[O];if(typeof D[Y]=="string")Z=V.call(this,D[Y]);T.call(this,D.$anchor),T.call(this,D.$dynamicAnchor),J[U]=Z;function V(E){let v=this.opts.uriResolver.resolve;if(E=E1(Z?v(Z,E):E),H.has(E))throw B(E);H.add(E);let I=this.refs[E];if(typeof I=="string")I=this.refs[I];if(typeof I=="object")K(D,I.schema,E);else if(E!==E1(M))if(E[0]==="#")K(D,z[E],E),z[E]=D;else this.refs[E]=M;return E}function T(E){if(typeof E=="string"){if(!VA.test(E))throw Error(`invalid anchor "${E}"`);V.call(this,`#${E}`)}}}),z;function K(D,U,L){if(U!==void 0&&!DA(D,U))throw B(L)}function B(D){return Error(`reference "${D}" resolves to more than one schema`)}}kJ.getSchemaRefs=ZA});var F6=N((rJ)=>{Object.defineProperty(rJ,"__esModule",{value:!0});rJ.getData=rJ.KeywordCxt=rJ.validateFunctionCode=void 0;var gJ=aG(),xJ=K6(),C9=q9(),P4=K6(),bA=AJ(),A6=qJ(),R9=bJ(),P=k(),S=f0(),EA=B6(),l0=u(),D6=H6();function IA(Q){if(lJ(Q)){if(mJ(Q),fJ(Q)){RA(Q);return}}uJ(Q,()=>(0,gJ.topBoolOrEmptySchema)(Q))}rJ.validateFunctionCode=IA;function uJ({gen:Q,validateName:X,schema:Y,schemaEnv:W,opts:G},J){if(G.code.es5)Q.func(X,P._`${S.default.data}, ${S.default.valCxt}`,W.$async,()=>{Q.code(P._`"use strict"; ${_J(Y,G)}`),SA(Q,G),Q.code(J)});else Q.func(X,P._`${S.default.data}, ${TA(G)}`,W.$async,()=>Q.code(_J(Y,G)).code(J))}function TA(Q){return P._`{${S.default.instancePath}="", ${S.default.parentData}, ${S.default.parentDataProperty}, ${S.default.rootData}=${S.default.data}${Q.dynamicRef?P._`, ${S.default.dynamicAnchors}={}`:P.nil}}={}`}function SA(Q,X){Q.if(S.default.valCxt,()=>{if(Q.var(S.default.instancePath,P._`${S.default.valCxt}.${S.default.instancePath}`),Q.var(S.default.parentData,P._`${S.default.valCxt}.${S.default.parentData}`),Q.var(S.default.parentDataProperty,P._`${S.default.valCxt}.${S.default.parentDataProperty}`),Q.var(S.default.rootData,P._`${S.default.valCxt}.${S.default.rootData}`),X.dynamicRef)Q.var(S.default.dynamicAnchors,P._`${S.default.valCxt}.${S.default.dynamicAnchors}`)},()=>{if(Q.var(S.default.instancePath,P._`""`),Q.var(S.default.parentData,P._`undefined`),Q.var(S.default.parentDataProperty,P._`undefined`),Q.var(S.default.rootData,S.default.data),X.dynamicRef)Q.var(S.default.dynamicAnchors,P._`{}`)})}function RA(Q){let{schema:X,opts:Y,gen:W}=Q;uJ(Q,()=>{if(Y.$comment&&X.$comment)pJ(Q);if(_A(Q),W.let(S.default.vErrors,null),W.let(S.default.errors,0),Y.unevaluated)CA(Q);cJ(Q),gA(Q)});return}function CA(Q){let{gen:X,validateName:Y}=Q;Q.evaluated=X.const("evaluated",P._`${Y}.evaluated`),X.if(P._`${Q.evaluated}.dynamicProps`,()=>X.assign(P._`${Q.evaluated}.props`,P._`undefined`)),X.if(P._`${Q.evaluated}.dynamicItems`,()=>X.assign(P._`${Q.evaluated}.items`,P._`undefined`))}function _J(Q,X){let Y=typeof Q=="object"&&Q[X.schemaId];return Y&&(X.code.source||X.code.process)?P._`/*# sourceURL=${Y} */`:P.nil}function kA(Q,X){if(lJ(Q)){if(mJ(Q),fJ(Q)){vA(Q,X);return}}(0,gJ.boolOrEmptySchema)(Q,X)}function fJ({schema:Q,self:X}){if(typeof Q=="boolean")return!Q;for(let Y in Q)if(X.RULES.all[Y])return!0;return!1}function lJ(Q){return typeof Q.schema!="boolean"}function vA(Q,X){let{schema:Y,gen:W,opts:G}=Q;if(G.$comment&&Y.$comment)pJ(Q);yA(Q),hA(Q);let J=W.const("_errs",S.default.errors);cJ(Q,J),W.var(X,P._`${J} === ${S.default.errors}`)}function mJ(Q){(0,l0.checkUnknownRules)(Q),xA(Q)}function cJ(Q,X){if(Q.opts.jtd)return yJ(Q,[],!1,X);let Y=(0,xJ.getSchemaTypes)(Q.schema),W=(0,xJ.coerceAndCheckDataType)(Q,Y);yJ(Q,Y,!W,X)}function xA(Q){let{schema:X,errSchemaPath:Y,opts:W,self:G}=Q;if(X.$ref&&W.ignoreKeywordsWithRef&&(0,l0.schemaHasRulesButRef)(X,G.RULES))G.logger.warn(`$ref: keywords ignored in schema at path "${Y}"`)}function _A(Q){let{schema:X,opts:Y}=Q;if(X.default!==void 0&&Y.useDefaults&&Y.strictSchema)(0,l0.checkStrictMode)(Q,"default is ignored in the schema root")}function yA(Q){let X=Q.schema[Q.opts.schemaId];if(X)Q.baseId=(0,EA.resolveUrl)(Q.opts.uriResolver,Q.baseId,X)}function hA(Q){if(Q.schema.$async&&!Q.schemaEnv.$async)throw Error("async schema in sync schema")}function pJ({gen:Q,schemaEnv:X,schema:Y,errSchemaPath:W,opts:G}){let J=Y.$comment;if(G.$comment===!0)Q.code(P._`${S.default.self}.logger.log(${J})`);else if(typeof G.$comment=="function"){let $=P.str`${W}/$comment`,z=Q.scopeValue("root",{ref:X.root});Q.code(P._`${S.default.self}.opts.$comment(${J}, ${$}, ${z}.schema)`)}}function gA(Q){let{gen:X,schemaEnv:Y,validateName:W,ValidationError:G,opts:J}=Q;if(Y.$async)X.if(P._`${S.default.errors} === 0`,()=>X.return(S.default.data),()=>X.throw(P._`new ${G}(${S.default.vErrors})`));else{if(X.assign(P._`${W}.errors`,S.default.vErrors),J.unevaluated)uA(Q);X.return(P._`${S.default.errors} === 0`)}}function uA({gen:Q,evaluated:X,props:Y,items:W}){if(Y instanceof P.Name)Q.assign(P._`${X}.props`,Y);if(W instanceof P.Name)Q.assign(P._`${X}.items`,W)}function yJ(Q,X,Y,W){let{gen:G,schema:J,data:$,allErrors:z,opts:H,self:K}=Q,{RULES:B}=K;if(J.$ref&&(H.ignoreKeywordsWithRef||!(0,l0.schemaHasRulesButRef)(J,B))){G.block(()=>nJ(Q,"$ref",B.all.$ref.definition));return}if(!H.jtd)fA(Q,X);G.block(()=>{for(let U of B.rules)D(U);D(B.post)});function D(U){if(!(0,C9.shouldUseGroup)(J,U))return;if(U.type){if(G.if((0,P4.checkDataType)(U.type,$,H.strictNumbers)),hJ(Q,U),X.length===1&&X[0]===U.type&&Y)G.else(),(0,P4.reportTypeError)(Q);G.endIf()}else hJ(Q,U);if(!z)G.if(P._`${S.default.errors} === ${W||0}`)}}function hJ(Q,X){let{gen:Y,schema:W,opts:{useDefaults:G}}=Q;if(G)(0,bA.assignDefaults)(Q,X.type);Y.block(()=>{for(let J of X.rules)if((0,C9.shouldUseRule)(W,J))nJ(Q,J.keyword,J.definition,X.type)})}function fA(Q,X){if(Q.schemaEnv.meta||!Q.opts.strictTypes)return;if(lA(Q,X),!Q.opts.allowUnionTypes)mA(Q,X);cA(Q,Q.dataTypes)}function lA(Q,X){if(!X.length)return;if(!Q.dataTypes.length){Q.dataTypes=X;return}X.forEach((Y)=>{if(!iJ(Q.dataTypes,Y))k9(Q,`type "${Y}" not allowed by context "${Q.dataTypes.join(",")}"`)}),iA(Q,X)}function mA(Q,X){if(X.length>1&&!(X.length===2&&X.includes("null")))k9(Q,"use allowUnionTypes to allow union type keyword")}function cA(Q,X){let Y=Q.self.RULES.all;for(let W in Y){let G=Y[W];if(typeof G=="object"&&(0,C9.shouldUseRule)(Q.schema,G)){let{type:J}=G.definition;if(J.length&&!J.some(($)=>pA(X,$)))k9(Q,`missing type "${J.join(",")}" for keyword "${W}"`)}}}function pA(Q,X){return Q.includes(X)||X==="number"&&Q.includes("integer")}function iJ(Q,X){return Q.includes(X)||X==="integer"&&Q.includes("number")}function iA(Q,X){let Y=[];for(let W of Q.dataTypes)if(iJ(X,W))Y.push(W);else if(X.includes("integer")&&W==="number")Y.push("integer");Q.dataTypes=Y}function k9(Q,X){let Y=Q.schemaEnv.baseId+Q.errSchemaPath;X+=` at "${Y}" (strictTypes)`,(0,l0.checkStrictMode)(Q,X,Q.opts.strictTypes)}class v9{constructor(Q,X,Y){if((0,A6.validateKeywordUsage)(Q,X,Y),this.gen=Q.gen,this.allErrors=Q.allErrors,this.keyword=Y,this.data=Q.data,this.schema=Q.schema[Y],this.$data=X.$data&&Q.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l0.schemaRefOrVal)(Q,this.schema,Y,this.$data),this.schemaType=X.schemaType,this.parentSchema=Q.schema,this.params={},this.it=Q,this.def=X,this.$data)this.schemaCode=Q.gen.const("vSchema",dJ(this.$data,Q));else if(this.schemaCode=this.schemaValue,!(0,A6.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${Y} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=Q.gen.const("_errs",S.default.errors)}result(Q,X,Y){this.failResult((0,P.not)(Q),X,Y)}failResult(Q,X,Y){if(this.gen.if(Q),Y)Y();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(Q,X){this.failResult((0,P.not)(Q),void 0,X)}fail(Q){if(Q===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Q),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Q){if(!this.$data)return this.fail(Q);let{schemaCode:X}=this;this.fail(P._`${X} !== undefined && (${(0,P.or)(this.invalid$data(),Q)})`)}error(Q,X,Y){if(X){this.setParams(X),this._error(Q,Y),this.setParams({});return}this._error(Q,Y)}_error(Q,X){(Q?D6.reportExtraError:D6.reportError)(this,this.def.error,X)}$dataError(){(0,D6.reportError)(this,this.def.$dataError||D6.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,D6.resetErrorsCount)(this.gen,this.errsCount)}ok(Q){if(!this.allErrors)this.gen.if(Q)}setParams(Q,X){if(X)Object.assign(this.params,Q);else this.params=Q}block$data(Q,X,Y=P.nil){this.gen.block(()=>{this.check$data(Q,Y),X()})}check$data(Q=P.nil,X=P.nil){if(!this.$data)return;let{gen:Y,schemaCode:W,schemaType:G,def:J}=this;if(Y.if((0,P.or)(P._`${W} === undefined`,X)),Q!==P.nil)Y.assign(Q,!0);if(G.length||J.validateSchema){if(Y.elseIf(this.invalid$data()),this.$dataError(),Q!==P.nil)Y.assign(Q,!1)}Y.else()}invalid$data(){let{gen:Q,schemaCode:X,schemaType:Y,def:W,it:G}=this;return(0,P.or)(J(),$());function J(){if(Y.length){if(!(X instanceof P.Name))throw Error("ajv implementation error");let z=Array.isArray(Y)?Y:[Y];return P._`${(0,P4.checkDataTypes)(z,X,G.opts.strictNumbers,P4.DataType.Wrong)}`}return P.nil}function $(){if(W.validateSchema){let z=Q.scopeValue("validate$data",{ref:W.validateSchema});return P._`!${z}(${X})`}return P.nil}}subschema(Q,X){let Y=(0,R9.getSubschema)(this.it,Q);(0,R9.extendSubschemaData)(Y,this.it,Q),(0,R9.extendSubschemaMode)(Y,Q);let W={...this.it,...Y,items:void 0,props:void 0};return kA(W,X),W}mergeEvaluated(Q,X){let{it:Y,gen:W}=this;if(!Y.opts.unevaluated)return;if(Y.props!==!0&&Q.props!==void 0)Y.props=l0.mergeEvaluated.props(W,Q.props,Y.props,X);if(Y.items!==!0&&Q.items!==void 0)Y.items=l0.mergeEvaluated.items(W,Q.items,Y.items,X)}mergeValidEvaluated(Q,X){let{it:Y,gen:W}=this;if(Y.opts.unevaluated&&(Y.props!==!0||Y.items!==!0))return W.if(X,()=>this.mergeEvaluated(Q,P.Name)),!0}}rJ.KeywordCxt=v9;function nJ(Q,X,Y,W){let G=new v9(Q,Y,X);if("code"in Y)Y.code(G,W);else if(G.$data&&Y.validate)(0,A6.funcKeywordCode)(G,Y);else if("macro"in Y)(0,A6.macroKeywordCode)(G,Y);else if(Y.compile||Y.validate)(0,A6.funcKeywordCode)(G,Y)}var nA=/^\/(?:[^~]|~0|~1)*$/,dA=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function dJ(Q,{dataLevel:X,dataNames:Y,dataPathArr:W}){let G,J;if(Q==="")return S.default.rootData;if(Q[0]==="/"){if(!nA.test(Q))throw Error(`Invalid JSON-pointer: ${Q}`);G=Q,J=S.default.rootData}else{let K=dA.exec(Q);if(!K)throw Error(`Invalid JSON-pointer: ${Q}`);let B=+K[1];if(G=K[2],G==="#"){if(B>=X)throw Error(H("property/index",B));return W[X-B]}if(B>X)throw Error(H("data",B));if(J=Y[X-B],!G)return J}let $=J,z=G.split("/");for(let K of z)if(K)J=P._`${J}${(0,P.getProperty)((0,l0.unescapeJsonPointer)(K))}`,$=P._`${$} && ${J}`;return $;function H(K,B){return`Cannot access ${K} ${B} levels up, current level is ${X}`}}rJ.getData=dJ});var b4=N((aJ)=>{Object.defineProperty(aJ,"__esModule",{value:!0});class tJ extends Error{constructor(Q){super("validation failed");this.errors=Q,this.ajv=this.validation=!0}}aJ.default=tJ});var U6=N((eJ)=>{Object.defineProperty(eJ,"__esModule",{value:!0});var x9=B6();class sJ extends Error{constructor(Q,X,Y,W){super(W||`can't resolve reference ${Y} from id ${X}`);this.missingRef=(0,x9.resolveUrl)(Q,X,Y),this.missingSchema=(0,x9.normalizeId)((0,x9.getFullPath)(Q,this.missingRef))}}eJ.default=sJ});var I4=N((Y7)=>{Object.defineProperty(Y7,"__esModule",{value:!0});Y7.resolveSchema=Y7.getCompilingSchema=Y7.resolveRef=Y7.compileSchema=Y7.SchemaEnv=void 0;var E0=k(),sA=b4(),K1=f0(),I0=B6(),Q7=u(),eA=F6();class L6{constructor(Q){var X;this.refs={},this.dynamicAnchors={};let Y;if(typeof Q.schema=="object")Y=Q.schema;this.schema=Q.schema,this.schemaId=Q.schemaId,this.root=Q.root||this,this.baseId=(X=Q.baseId)!==null&&X!==void 0?X:(0,I0.normalizeId)(Y===null||Y===void 0?void 0:Y[Q.schemaId||"$id"]),this.schemaPath=Q.schemaPath,this.localRefs=Q.localRefs,this.meta=Q.meta,this.$async=Y===null||Y===void 0?void 0:Y.$async,this.refs={}}}Y7.SchemaEnv=L6;function y9(Q){let X=X7.call(this,Q);if(X)return X;let Y=(0,I0.getFullPath)(this.opts.uriResolver,Q.root.baseId),{es5:W,lines:G}=this.opts.code,{ownProperties:J}=this.opts,$=new E0.CodeGen(this.scope,{es5:W,lines:G,ownProperties:J}),z;if(Q.$async)z=$.scopeValue("Error",{ref:sA.default,code:E0._`require("ajv/dist/runtime/validation_error").default`});let H=$.scopeName("validate");Q.validateName=H;let K={gen:$,allErrors:this.opts.allErrors,data:K1.default.data,parentData:K1.default.parentData,parentDataProperty:K1.default.parentDataProperty,dataNames:[K1.default.data],dataPathArr:[E0.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:$.scopeValue("schema",this.opts.code.source===!0?{ref:Q.schema,code:(0,E0.stringify)(Q.schema)}:{ref:Q.schema}),validateName:H,ValidationError:z,schema:Q.schema,schemaEnv:Q,rootId:Y,baseId:Q.baseId||Y,schemaPath:E0.nil,errSchemaPath:Q.schemaPath||(this.opts.jtd?"":"#"),errorPath:E0._`""`,opts:this.opts,self:this},B;try{this._compilations.add(Q),(0,eA.validateFunctionCode)(K),$.optimize(this.opts.code.optimize);let D=$.toString();if(B=`${$.scopeRefs(K1.default.scope)}return ${D}`,this.opts.code.process)B=this.opts.code.process(B,Q);let L=Function(`${K1.default.self}`,`${K1.default.scope}`,B)(this,this.scope.get());if(this.scope.value(H,{ref:L}),L.errors=null,L.schema=Q.schema,L.schemaEnv=Q,Q.$async)L.$async=!0;if(this.opts.code.source===!0)L.source={validateName:H,validateCode:D,scopeValues:$._values};if(this.opts.unevaluated){let{props:O,items:M}=K;if(L.evaluated={props:O instanceof E0.Name?void 0:O,items:M instanceof E0.Name?void 0:M,dynamicProps:O instanceof E0.Name,dynamicItems:M instanceof E0.Name},L.source)L.source.evaluated=(0,E0.stringify)(L.evaluated)}return Q.validate=L,Q}catch(D){if(delete Q.validate,delete Q.validateName,B)this.logger.error("Error compiling schema, function code:",B);throw D}finally{this._compilations.delete(Q)}}Y7.compileSchema=y9;function QF(Q,X,Y){var W;Y=(0,I0.resolveUrl)(this.opts.uriResolver,X,Y);let G=Q.refs[Y];if(G)return G;let J=WF.call(this,Q,Y);if(J===void 0){let $=(W=Q.localRefs)===null||W===void 0?void 0:W[Y],{schemaId:z}=this.opts;if($)J=new L6({schema:$,schemaId:z,root:Q,baseId:X})}if(J===void 0)return;return Q.refs[Y]=XF.call(this,J)}Y7.resolveRef=QF;function XF(Q){if((0,I0.inlineRef)(Q.schema,this.opts.inlineRefs))return Q.schema;return Q.validate?Q:y9.call(this,Q)}function X7(Q){for(let X of this._compilations)if(YF(X,Q))return X}Y7.getCompilingSchema=X7;function YF(Q,X){return Q.schema===X.schema&&Q.root===X.root&&Q.baseId===X.baseId}function WF(Q,X){let Y;while(typeof(Y=this.refs[X])=="string")X=Y;return Y||this.schemas[X]||E4.call(this,Q,X)}function E4(Q,X){let Y=this.opts.uriResolver.parse(X),W=(0,I0._getFullPath)(this.opts.uriResolver,Y),G=(0,I0.getFullPath)(this.opts.uriResolver,Q.baseId,void 0);if(Object.keys(Q.schema).length>0&&W===G)return _9.call(this,Y,Q);let J=(0,I0.normalizeId)(W),$=this.refs[J]||this.schemas[J];if(typeof $=="string"){let z=E4.call(this,Q,$);if(typeof(z===null||z===void 0?void 0:z.schema)!=="object")return;return _9.call(this,Y,z)}if(typeof($===null||$===void 0?void 0:$.schema)!=="object")return;if(!$.validate)y9.call(this,$);if(J===(0,I0.normalizeId)(X)){let{schema:z}=$,{schemaId:H}=this.opts,K=z[H];if(K)G=(0,I0.resolveUrl)(this.opts.uriResolver,G,K);return new L6({schema:z,schemaId:H,root:Q,baseId:G})}return _9.call(this,Y,$)}Y7.resolveSchema=E4;var GF=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _9(Q,{baseId:X,schema:Y,root:W}){var G;if(((G=Q.fragment)===null||G===void 0?void 0:G[0])!=="/")return;for(let z of Q.fragment.slice(1).split("/")){if(typeof Y==="boolean")return;let H=Y[(0,Q7.unescapeFragment)(z)];if(H===void 0)return;Y=H;let K=typeof Y==="object"&&Y[this.opts.schemaId];if(!GF.has(z)&&K)X=(0,I0.resolveUrl)(this.opts.uriResolver,X,K)}let J;if(typeof Y!="boolean"&&Y.$ref&&!(0,Q7.schemaHasRulesButRef)(Y,this.RULES)){let z=(0,I0.resolveUrl)(this.opts.uriResolver,X,Y.$ref);J=E4.call(this,W,z)}let{schemaId:$}=this.opts;if(J=J||new L6({schema:Y,schemaId:$,root:W,baseId:X}),J.schema!==J.root.schema)return J;return}});var G7=N((BP,KF)=>{KF.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 g9=N((DP,H7)=>{var BF=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),$7=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function h9(Q){let X="",Y=0,W=0;for(W=0;W<Q.length;W++){if(Y=Q[W].charCodeAt(0),Y===48)continue;if(!(Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102))return"";X+=Q[W];break}for(W+=1;W<Q.length;W++){if(Y=Q[W].charCodeAt(0),!(Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102))return"";X+=Q[W]}return X}var DF=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function J7(Q){return Q.length=0,!0}function AF(Q,X,Y){if(Q.length){let W=h9(Q);if(W!=="")X.push(W);else return Y.error=!0,!1;Q.length=0}return!0}function FF(Q){let X=0,Y={error:!1,address:"",zone:""},W=[],G=[],J=!1,$=!1,z=AF;for(let H=0;H<Q.length;H++){let K=Q[H];if(K==="["||K==="]")continue;if(K===":"){if(J===!0)$=!0;if(!z(G,W,Y))break;if(++X>7){Y.error=!0;break}if(H>0&&Q[H-1]===":")J=!0;W.push(":");continue}else if(K==="%"){if(!z(G,W,Y))break;z=J7}else{G.push(K);continue}}if(G.length)if(z===J7)Y.zone=G.join("");else if($)W.push(G.join(""));else W.push(h9(G));return Y.address=W.join(""),Y}function z7(Q){if(UF(Q,":")<2)return{host:Q,isIPV6:!1};let X=FF(Q);if(!X.error){let{address:Y,address:W}=X;if(X.zone)Y+="%"+X.zone,W+="%25"+X.zone;return{host:Y,isIPV6:!0,escapedHost:W}}else return{host:Q,isIPV6:!1}}function UF(Q,X){let Y=0;for(let W=0;W<Q.length;W++)if(Q[W]===X)Y++;return Y}function LF(Q){let X=Q,Y=[],W=-1,G=0;while(G=X.length){if(G===1)if(X===".")break;else if(X==="/"){Y.push("/");break}else{Y.push(X);break}else if(G===2){if(X[0]==="."){if(X[1]===".")break;else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."||X[1]==="/"){Y.push("/");break}}}else if(G===3){if(X==="/.."){if(Y.length!==0)Y.pop();Y.push("/");break}}if(X[0]==="."){if(X[1]==="."){if(X[2]==="/"){X=X.slice(3);continue}}else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."){if(X[2]==="/"){X=X.slice(2);continue}else if(X[2]==="."){if(X[3]==="/"){if(X=X.slice(3),Y.length!==0)Y.pop();continue}}}}if((W=X.indexOf("/",1))===-1){Y.push(X);break}else Y.push(X.slice(0,W)),X=X.slice(W)}return Y.join("")}function OF(Q,X){let Y=X!==!0?escape:unescape;if(Q.scheme!==void 0)Q.scheme=Y(Q.scheme);if(Q.userinfo!==void 0)Q.userinfo=Y(Q.userinfo);if(Q.host!==void 0)Q.host=Y(Q.host);if(Q.path!==void 0)Q.path=Y(Q.path);if(Q.query!==void 0)Q.query=Y(Q.query);if(Q.fragment!==void 0)Q.fragment=Y(Q.fragment);return Q}function MF(Q){let X=[];if(Q.userinfo!==void 0)X.push(Q.userinfo),X.push("@");if(Q.host!==void 0){let Y=unescape(Q.host);if(!$7(Y)){let W=z7(Y);if(W.isIPV6===!0)Y=`[${W.escapedHost}]`;else Y=Q.host}X.push(Y)}if(typeof Q.port==="number"||typeof Q.port==="string")X.push(":"),X.push(String(Q.port));return X.length?X.join(""):void 0}H7.exports={nonSimpleDomain:DF,recomposeAuthority:MF,normalizeComponentEncoding:OF,removeDotSegments:LF,isIPv4:$7,isUUID:BF,normalizeIPv6:z7,stringArrayToHexStripped:h9}});var F7=N((AP,A7)=>{var{isUUID:VF}=g9(),ZF=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,NF=["http","https","ws","wss","urn","urn:uuid"];function qF(Q){return NF.indexOf(Q)!==-1}function u9(Q){if(Q.secure===!0)return!0;else if(Q.secure===!1)return!1;else if(Q.scheme)return Q.scheme.length===3&&(Q.scheme[0]==="w"||Q.scheme[0]==="W")&&(Q.scheme[1]==="s"||Q.scheme[1]==="S")&&(Q.scheme[2]==="s"||Q.scheme[2]==="S");else return!1}function K7(Q){if(!Q.host)Q.error=Q.error||"HTTP URIs must have a host.";return Q}function B7(Q){let X=String(Q.scheme).toLowerCase()==="https";if(Q.port===(X?443:80)||Q.port==="")Q.port=void 0;if(!Q.path)Q.path="/";return Q}function wF(Q){return Q.secure=u9(Q),Q.resourceName=(Q.path||"/")+(Q.query?"?"+Q.query:""),Q.path=void 0,Q.query=void 0,Q}function jF(Q){if(Q.port===(u9(Q)?443:80)||Q.port==="")Q.port=void 0;if(typeof Q.secure==="boolean")Q.scheme=Q.secure?"wss":"ws",Q.secure=void 0;if(Q.resourceName){let[X,Y]=Q.resourceName.split("?");Q.path=X&&X!=="/"?X:void 0,Q.query=Y,Q.resourceName=void 0}return Q.fragment=void 0,Q}function PF(Q,X){if(!Q.path)return Q.error="URN can not be parsed",Q;let Y=Q.path.match(ZF);if(Y){let W=X.scheme||Q.scheme||"urn";Q.nid=Y[1].toLowerCase(),Q.nss=Y[2];let G=`${W}:${X.nid||Q.nid}`,J=f9(G);if(Q.path=void 0,J)Q=J.parse(Q,X)}else Q.error=Q.error||"URN can not be parsed.";return Q}function bF(Q,X){if(Q.nid===void 0)throw Error("URN without nid cannot be serialized");let Y=X.scheme||Q.scheme||"urn",W=Q.nid.toLowerCase(),G=`${Y}:${X.nid||W}`,J=f9(G);if(J)Q=J.serialize(Q,X);let $=Q,z=Q.nss;return $.path=`${W||X.nid}:${z}`,X.skipEscape=!0,$}function EF(Q,X){let Y=Q;if(Y.uuid=Y.nss,Y.nss=void 0,!X.tolerant&&(!Y.uuid||!VF(Y.uuid)))Y.error=Y.error||"UUID is not valid.";return Y}function IF(Q){let X=Q;return X.nss=(Q.uuid||"").toLowerCase(),X}var D7={scheme:"http",domainHost:!0,parse:K7,serialize:B7},TF={scheme:"https",domainHost:D7.domainHost,parse:K7,serialize:B7},T4={scheme:"ws",domainHost:!0,parse:wF,serialize:jF},SF={scheme:"wss",domainHost:T4.domainHost,parse:T4.parse,serialize:T4.serialize},RF={scheme:"urn",parse:PF,serialize:bF,skipNormalize:!0},CF={scheme:"urn:uuid",parse:EF,serialize:IF,skipNormalize:!0},S4={http:D7,https:TF,ws:T4,wss:SF,urn:RF,"urn:uuid":CF};Object.setPrototypeOf(S4,null);function f9(Q){return Q&&(S4[Q]||S4[Q.toLowerCase()])||void 0}A7.exports={wsIsSecure:u9,SCHEMES:S4,isValidSchemeName:qF,getSchemeHandler:f9}});var O7=N((FP,C4)=>{var{normalizeIPv6:kF,removeDotSegments:O6,recomposeAuthority:vF,normalizeComponentEncoding:R4,isIPv4:xF,nonSimpleDomain:_F}=g9(),{SCHEMES:yF,getSchemeHandler:U7}=F7();function hF(Q,X){if(typeof Q==="string")Q=k0(m0(Q,X),X);else if(typeof Q==="object")Q=m0(k0(Q,X),X);return Q}function gF(Q,X,Y){let W=Y?Object.assign({scheme:"null"},Y):{scheme:"null"},G=L7(m0(Q,W),m0(X,W),W,!0);return W.skipEscape=!0,k0(G,W)}function L7(Q,X,Y,W){let G={};if(!W)Q=m0(k0(Q,Y),Y),X=m0(k0(X,Y),Y);if(Y=Y||{},!Y.tolerant&&X.scheme)G.scheme=X.scheme,G.userinfo=X.userinfo,G.host=X.host,G.port=X.port,G.path=O6(X.path||""),G.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)G.userinfo=X.userinfo,G.host=X.host,G.port=X.port,G.path=O6(X.path||""),G.query=X.query;else{if(!X.path)if(G.path=Q.path,X.query!==void 0)G.query=X.query;else G.query=Q.query;else{if(X.path[0]==="/")G.path=O6(X.path);else{if((Q.userinfo!==void 0||Q.host!==void 0||Q.port!==void 0)&&!Q.path)G.path="/"+X.path;else if(!Q.path)G.path=X.path;else G.path=Q.path.slice(0,Q.path.lastIndexOf("/")+1)+X.path;G.path=O6(G.path)}G.query=X.query}G.userinfo=Q.userinfo,G.host=Q.host,G.port=Q.port}G.scheme=Q.scheme}return G.fragment=X.fragment,G}function uF(Q,X,Y){if(typeof Q==="string")Q=unescape(Q),Q=k0(R4(m0(Q,Y),!0),{...Y,skipEscape:!0});else if(typeof Q==="object")Q=k0(R4(Q,!0),{...Y,skipEscape:!0});if(typeof X==="string")X=unescape(X),X=k0(R4(m0(X,Y),!0),{...Y,skipEscape:!0});else if(typeof X==="object")X=k0(R4(X,!0),{...Y,skipEscape:!0});return Q.toLowerCase()===X.toLowerCase()}function k0(Q,X){let Y={host:Q.host,scheme:Q.scheme,userinfo:Q.userinfo,port:Q.port,path:Q.path,query:Q.query,nid:Q.nid,nss:Q.nss,uuid:Q.uuid,fragment:Q.fragment,reference:Q.reference,resourceName:Q.resourceName,secure:Q.secure,error:""},W=Object.assign({},X),G=[],J=U7(W.scheme||Y.scheme);if(J&&J.serialize)J.serialize(Y,W);if(Y.path!==void 0)if(!W.skipEscape){if(Y.path=escape(Y.path),Y.scheme!==void 0)Y.path=Y.path.split("%3A").join(":")}else Y.path=unescape(Y.path);if(W.reference!=="suffix"&&Y.scheme)G.push(Y.scheme,":");let $=vF(Y);if($!==void 0){if(W.reference!=="suffix")G.push("//");if(G.push($),Y.path&&Y.path[0]!=="/")G.push("/")}if(Y.path!==void 0){let z=Y.path;if(!W.absolutePath&&(!J||!J.absolutePath))z=O6(z);if($===void 0&&z[0]==="/"&&z[1]==="/")z="/%2F"+z.slice(2);G.push(z)}if(Y.query!==void 0)G.push("?",Y.query);if(Y.fragment!==void 0)G.push("#",Y.fragment);return G.join("")}var fF=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function m0(Q,X){let Y=Object.assign({},X),W={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},G=!1;if(Y.reference==="suffix")if(Y.scheme)Q=Y.scheme+":"+Q;else Q="//"+Q;let J=Q.match(fF);if(J){if(W.scheme=J[1],W.userinfo=J[3],W.host=J[4],W.port=parseInt(J[5],10),W.path=J[6]||"",W.query=J[7],W.fragment=J[8],isNaN(W.port))W.port=J[5];if(W.host)if(xF(W.host)===!1){let H=kF(W.host);W.host=H.host.toLowerCase(),G=H.isIPV6}else G=!0;if(W.scheme===void 0&&W.userinfo===void 0&&W.host===void 0&&W.port===void 0&&W.query===void 0&&!W.path)W.reference="same-document";else if(W.scheme===void 0)W.reference="relative";else if(W.fragment===void 0)W.reference="absolute";else W.reference="uri";if(Y.reference&&Y.reference!=="suffix"&&Y.reference!==W.reference)W.error=W.error||"URI is not a "+Y.reference+" reference.";let $=U7(Y.scheme||W.scheme);if(!Y.unicodeSupport&&(!$||!$.unicodeSupport)){if(W.host&&(Y.domainHost||$&&$.domainHost)&&G===!1&&_F(W.host))try{W.host=URL.domainToASCII(W.host.toLowerCase())}catch(z){W.error=W.error||"Host's domain name can not be converted to ASCII: "+z}}if(!$||$&&!$.skipNormalize){if(Q.indexOf("%")!==-1){if(W.scheme!==void 0)W.scheme=unescape(W.scheme);if(W.host!==void 0)W.host=unescape(W.host)}if(W.path)W.path=escape(unescape(W.path));if(W.fragment)W.fragment=encodeURI(decodeURIComponent(W.fragment))}if($&&$.parse)$.parse(W,Y)}else W.error=W.error||"URI can not be parsed.";return W}var l9={SCHEMES:yF,normalize:hF,resolve:gF,resolveComponent:L7,equal:uF,serialize:k0,parse:m0};C4.exports=l9;C4.exports.default=l9;C4.exports.fastUri=l9});var Z7=N((V7)=>{Object.defineProperty(V7,"__esModule",{value:!0});var M7=O7();M7.code='require("ajv/dist/runtime/uri").default';V7.default=M7});var I7=N((c0)=>{Object.defineProperty(c0,"__esModule",{value:!0});c0.CodeGen=c0.Name=c0.nil=c0.stringify=c0.str=c0._=c0.KeywordCxt=void 0;var mF=F6();Object.defineProperty(c0,"KeywordCxt",{enumerable:!0,get:function(){return mF.KeywordCxt}});var I1=k();Object.defineProperty(c0,"_",{enumerable:!0,get:function(){return I1._}});Object.defineProperty(c0,"str",{enumerable:!0,get:function(){return I1.str}});Object.defineProperty(c0,"stringify",{enumerable:!0,get:function(){return I1.stringify}});Object.defineProperty(c0,"nil",{enumerable:!0,get:function(){return I1.nil}});Object.defineProperty(c0,"Name",{enumerable:!0,get:function(){return I1.Name}});Object.defineProperty(c0,"CodeGen",{enumerable:!0,get:function(){return I1.CodeGen}});var cF=b4(),P7=U6(),pF=N9(),M6=I4(),iF=k(),V6=B6(),k4=K6(),c9=u(),N7=G7(),nF=Z7(),b7=(Q,X)=>new RegExp(Q,X);b7.code="new RegExp";var dF=["removeAdditional","useDefaults","coerceTypes"],rF=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),oF={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."},tF={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},q7=200;function aF(Q){var X,Y,W,G,J,$,z,H,K,B,D,U,L,O,M,Z,V,T,E,v,I,R0,x0,a4,s4;let v1=Q.strict,e4=(X=Q.code)===null||X===void 0?void 0:X.optimize,VX=e4===!0||e4===void 0?1:e4||0,ZX=(W=(Y=Q.code)===null||Y===void 0?void 0:Y.regExp)!==null&&W!==void 0?W:b7,Xz=(G=Q.uriResolver)!==null&&G!==void 0?G:nF.default;return{strictSchema:($=(J=Q.strictSchema)!==null&&J!==void 0?J:v1)!==null&&$!==void 0?$:!0,strictNumbers:(H=(z=Q.strictNumbers)!==null&&z!==void 0?z:v1)!==null&&H!==void 0?H:!0,strictTypes:(B=(K=Q.strictTypes)!==null&&K!==void 0?K:v1)!==null&&B!==void 0?B:"log",strictTuples:(U=(D=Q.strictTuples)!==null&&D!==void 0?D:v1)!==null&&U!==void 0?U:"log",strictRequired:(O=(L=Q.strictRequired)!==null&&L!==void 0?L:v1)!==null&&O!==void 0?O:!1,code:Q.code?{...Q.code,optimize:VX,regExp:ZX}:{optimize:VX,regExp:ZX},loopRequired:(M=Q.loopRequired)!==null&&M!==void 0?M:q7,loopEnum:(Z=Q.loopEnum)!==null&&Z!==void 0?Z:q7,meta:(V=Q.meta)!==null&&V!==void 0?V:!0,messages:(T=Q.messages)!==null&&T!==void 0?T:!0,inlineRefs:(E=Q.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(v=Q.schemaId)!==null&&v!==void 0?v:"$id",addUsedSchema:(I=Q.addUsedSchema)!==null&&I!==void 0?I:!0,validateSchema:(R0=Q.validateSchema)!==null&&R0!==void 0?R0:!0,validateFormats:(x0=Q.validateFormats)!==null&&x0!==void 0?x0:!0,unicodeRegExp:(a4=Q.unicodeRegExp)!==null&&a4!==void 0?a4:!0,int32range:(s4=Q.int32range)!==null&&s4!==void 0?s4:!0,uriResolver:Xz}}class v4{constructor(Q={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,Q=this.opts={...Q,...aF(Q)};let{es5:X,lines:Y}=this.opts.code;this.scope=new iF.ValueScope({scope:{},prefixes:rF,es5:X,lines:Y}),this.logger=WU(Q.logger);let W=Q.validateFormats;if(Q.validateFormats=!1,this.RULES=(0,pF.getRules)(),w7.call(this,oF,Q,"NOT SUPPORTED"),w7.call(this,tF,Q,"DEPRECATED","warn"),this._metaOpts=XU.call(this),Q.formats)eF.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Q.keywords)QU.call(this,Q.keywords);if(typeof Q.meta=="object")this.addMetaSchema(Q.meta);sF.call(this),Q.validateFormats=W}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Q,meta:X,schemaId:Y}=this.opts,W=N7;if(Y==="id")W={...N7},W.id=W.$id,delete W.$id;if(X&&Q)this.addMetaSchema(W,W[Y],!1)}defaultMeta(){let{meta:Q,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof Q=="object"?Q[X]||Q:void 0}validate(Q,X){let Y;if(typeof Q=="string"){if(Y=this.getSchema(Q),!Y)throw Error(`no schema with key or ref "${Q}"`)}else Y=this.compile(Q);let W=Y(X);if(!("$async"in Y))this.errors=Y.errors;return W}compile(Q,X){let Y=this._addSchema(Q,X);return Y.validate||this._compileSchemaEnv(Y)}compileAsync(Q,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Y}=this.opts;return W.call(this,Q,X);async function W(K,B){await G.call(this,K.$schema);let D=this._addSchema(K,B);return D.validate||J.call(this,D)}async function G(K){if(K&&!this.getSchema(K))await W.call(this,{$ref:K},!0)}async function J(K){try{return this._compileSchemaEnv(K)}catch(B){if(!(B instanceof P7.default))throw B;return $.call(this,B),await z.call(this,B.missingSchema),J.call(this,K)}}function $({missingSchema:K,missingRef:B}){if(this.refs[K])throw Error(`AnySchema ${K} is loaded but ${B} cannot be resolved`)}async function z(K){let B=await H.call(this,K);if(!this.refs[K])await G.call(this,B.$schema);if(!this.refs[K])this.addSchema(B,K,X)}async function H(K){let B=this._loading[K];if(B)return B;try{return await(this._loading[K]=Y(K))}finally{delete this._loading[K]}}}addSchema(Q,X,Y,W=this.opts.validateSchema){if(Array.isArray(Q)){for(let J of Q)this.addSchema(J,void 0,Y,W);return this}let G;if(typeof Q==="object"){let{schemaId:J}=this.opts;if(G=Q[J],G!==void 0&&typeof G!="string")throw Error(`schema ${J} must be string`)}return X=(0,V6.normalizeId)(X||G),this._checkUnique(X),this.schemas[X]=this._addSchema(Q,Y,X,W,!0),this}addMetaSchema(Q,X,Y=this.opts.validateSchema){return this.addSchema(Q,X,!0,Y),this}validateSchema(Q,X){if(typeof Q=="boolean")return!0;let Y;if(Y=Q.$schema,Y!==void 0&&typeof Y!="string")throw Error("$schema must be a string");if(Y=Y||this.opts.defaultMeta||this.defaultMeta(),!Y)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let W=this.validate(Y,Q);if(!W&&X){let G="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(G);else throw Error(G)}return W}getSchema(Q){let X;while(typeof(X=j7.call(this,Q))=="string")Q=X;if(X===void 0){let{schemaId:Y}=this.opts,W=new M6.SchemaEnv({schema:{},schemaId:Y});if(X=M6.resolveSchema.call(this,W,Q),!X)return;this.refs[Q]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(Q){if(Q instanceof RegExp)return this._removeAllSchemas(this.schemas,Q),this._removeAllSchemas(this.refs,Q),this;switch(typeof Q){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=j7.call(this,Q);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[Q],delete this.refs[Q],this}case"object":{let X=Q;this._cache.delete(X);let Y=Q[this.opts.schemaId];if(Y)Y=(0,V6.normalizeId)(Y),delete this.schemas[Y],delete this.refs[Y];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Q){for(let X of Q)this.addKeyword(X);return this}addKeyword(Q,X){let Y;if(typeof Q=="string"){if(Y=Q,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=Y}else if(typeof Q=="object"&&X===void 0){if(X=Q,Y=X.keyword,Array.isArray(Y)&&!Y.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(JU.call(this,Y,X),!X)return(0,c9.eachItem)(Y,(G)=>m9.call(this,G)),this;zU.call(this,X);let W={...X,type:(0,k4.getJSONTypes)(X.type),schemaType:(0,k4.getJSONTypes)(X.schemaType)};return(0,c9.eachItem)(Y,W.type.length===0?(G)=>m9.call(this,G,W):(G)=>W.type.forEach((J)=>m9.call(this,G,W,J))),this}getKeyword(Q){let X=this.RULES.all[Q];return typeof X=="object"?X.definition:!!X}removeKeyword(Q){let{RULES:X}=this;delete X.keywords[Q],delete X.all[Q];for(let Y of X.rules){let W=Y.rules.findIndex((G)=>G.keyword===Q);if(W>=0)Y.rules.splice(W,1)}return this}addFormat(Q,X){if(typeof X=="string")X=new RegExp(X);return this.formats[Q]=X,this}errorsText(Q=this.errors,{separator:X=", ",dataVar:Y="data"}={}){if(!Q||Q.length===0)return"No errors";return Q.map((W)=>`${Y}${W.instancePath} ${W.message}`).reduce((W,G)=>W+X+G)}$dataMetaSchema(Q,X){let Y=this.RULES.all;Q=JSON.parse(JSON.stringify(Q));for(let W of X){let G=W.split("/").slice(1),J=Q;for(let $ of G)J=J[$];for(let $ in Y){let z=Y[$];if(typeof z!="object")continue;let{$data:H}=z.definition,K=J[$];if(H&&K)J[$]=E7(K)}}return Q}_removeAllSchemas(Q,X){for(let Y in Q){let W=Q[Y];if(!X||X.test(Y)){if(typeof W=="string")delete Q[Y];else if(W&&!W.meta)this._cache.delete(W.schema),delete Q[Y]}}}_addSchema(Q,X,Y,W=this.opts.validateSchema,G=this.opts.addUsedSchema){let J,{schemaId:$}=this.opts;if(typeof Q=="object")J=Q[$];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Q!="boolean")throw Error("schema must be object or boolean");let z=this._cache.get(Q);if(z!==void 0)return z;Y=(0,V6.normalizeId)(J||Y);let H=V6.getSchemaRefs.call(this,Q,Y);if(z=new M6.SchemaEnv({schema:Q,schemaId:$,meta:X,baseId:Y,localRefs:H}),this._cache.set(z.schema,z),G&&!Y.startsWith("#")){if(Y)this._checkUnique(Y);this.refs[Y]=z}if(W)this.validateSchema(Q,!0);return z}_checkUnique(Q){if(this.schemas[Q]||this.refs[Q])throw Error(`schema with key or id "${Q}" already exists`)}_compileSchemaEnv(Q){if(Q.meta)this._compileMetaSchema(Q);else M6.compileSchema.call(this,Q);if(!Q.validate)throw Error("ajv implementation error");return Q.validate}_compileMetaSchema(Q){let X=this.opts;this.opts=this._metaOpts;try{M6.compileSchema.call(this,Q)}finally{this.opts=X}}}v4.ValidationError=cF.default;v4.MissingRefError=P7.default;c0.default=v4;function w7(Q,X,Y,W="error"){for(let G in Q){let J=G;if(J in X)this.logger[W](`${Y}: option ${G}. ${Q[J]}`)}}function j7(Q){return Q=(0,V6.normalizeId)(Q),this.schemas[Q]||this.refs[Q]}function sF(){let Q=this.opts.schemas;if(!Q)return;if(Array.isArray(Q))this.addSchema(Q);else for(let X in Q)this.addSchema(Q[X],X)}function eF(){for(let Q in this.opts.formats){let X=this.opts.formats[Q];if(X)this.addFormat(Q,X)}}function QU(Q){if(Array.isArray(Q)){this.addVocabulary(Q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in Q){let Y=Q[X];if(!Y.keyword)Y.keyword=X;this.addKeyword(Y)}}function XU(){let Q={...this.opts};for(let X of dF)delete Q[X];return Q}var YU={log(){},warn(){},error(){}};function WU(Q){if(Q===!1)return YU;if(Q===void 0)return console;if(Q.log&&Q.warn&&Q.error)return Q;throw Error("logger must implement log, warn and error methods")}var GU=/^[a-z_$][a-z0-9_$:-]*$/i;function JU(Q,X){let{RULES:Y}=this;if((0,c9.eachItem)(Q,(W)=>{if(Y.keywords[W])throw Error(`Keyword ${W} is already defined`);if(!GU.test(W))throw Error(`Keyword ${W} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function m9(Q,X,Y){var W;let G=X===null||X===void 0?void 0:X.post;if(Y&&G)throw Error('keyword with "post" flag cannot have "type"');let{RULES:J}=this,$=G?J.post:J.rules.find(({type:H})=>H===Y);if(!$)$={type:Y,rules:[]},J.rules.push($);if(J.keywords[Q]=!0,!X)return;let z={keyword:Q,definition:{...X,type:(0,k4.getJSONTypes)(X.type),schemaType:(0,k4.getJSONTypes)(X.schemaType)}};if(X.before)$U.call(this,$,z,X.before);else $.rules.push(z);J.all[Q]=z,(W=X.implements)===null||W===void 0||W.forEach((H)=>this.addKeyword(H))}function $U(Q,X,Y){let W=Q.rules.findIndex((G)=>G.keyword===Y);if(W>=0)Q.rules.splice(W,0,X);else Q.rules.push(X),this.logger.warn(`rule ${Y} is not defined`)}function zU(Q){let{metaSchema:X}=Q;if(X===void 0)return;if(Q.$data&&this.opts.$data)X=E7(X);Q.validateSchema=this.compile(X,!0)}var HU={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function E7(Q){return{anyOf:[Q,HU]}}});var S7=N((T7)=>{Object.defineProperty(T7,"__esModule",{value:!0});var DU={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};T7.default=DU});var _7=N((v7)=>{Object.defineProperty(v7,"__esModule",{value:!0});v7.callRef=v7.getValidate=void 0;var FU=U6(),R7=N0(),F0=k(),T1=f0(),C7=I4(),x4=u(),UU={keyword:"$ref",schemaType:"string",code(Q){let{gen:X,schema:Y,it:W}=Q,{baseId:G,schemaEnv:J,validateName:$,opts:z,self:H}=W,{root:K}=J;if((Y==="#"||Y==="#/")&&G===K.baseId)return D();let B=C7.resolveRef.call(H,K,G,Y);if(B===void 0)throw new FU.default(W.opts.uriResolver,G,Y);if(B instanceof C7.SchemaEnv)return U(B);return L(B);function D(){if(J===K)return _4(Q,$,J,J.$async);let O=X.scopeValue("root",{ref:K});return _4(Q,F0._`${O}.validate`,K,K.$async)}function U(O){let M=k7(Q,O);_4(Q,M,O,O.$async)}function L(O){let M=X.scopeValue("schema",z.code.source===!0?{ref:O,code:(0,F0.stringify)(O)}:{ref:O}),Z=X.name("valid"),V=Q.subschema({schema:O,dataTypes:[],schemaPath:F0.nil,topSchemaRef:M,errSchemaPath:Y},Z);Q.mergeEvaluated(V),Q.ok(Z)}}};function k7(Q,X){let{gen:Y}=Q;return X.validate?Y.scopeValue("validate",{ref:X.validate}):F0._`${Y.scopeValue("wrapper",{ref:X})}.validate`}v7.getValidate=k7;function _4(Q,X,Y,W){let{gen:G,it:J}=Q,{allErrors:$,schemaEnv:z,opts:H}=J,K=H.passContext?T1.default.this:F0.nil;if(W)B();else D();function B(){if(!z.$async)throw Error("async schema referenced by sync schema");let O=G.let("valid");G.try(()=>{if(G.code(F0._`await ${(0,R7.callValidateCode)(Q,X,K)}`),L(X),!$)G.assign(O,!0)},(M)=>{if(G.if(F0._`!(${M} instanceof ${J.ValidationError})`,()=>G.throw(M)),U(M),!$)G.assign(O,!1)}),Q.ok(O)}function D(){Q.result((0,R7.callValidateCode)(Q,X,K),()=>L(X),()=>U(X))}function U(O){let M=F0._`${O}.errors`;G.assign(T1.default.vErrors,F0._`${T1.default.vErrors} === null ? ${M} : ${T1.default.vErrors}.concat(${M})`),G.assign(T1.default.errors,F0._`${T1.default.vErrors}.length`)}function L(O){var M;if(!J.opts.unevaluated)return;let Z=(M=Y===null||Y===void 0?void 0:Y.validate)===null||M===void 0?void 0:M.evaluated;if(J.props!==!0)if(Z&&!Z.dynamicProps){if(Z.props!==void 0)J.props=x4.mergeEvaluated.props(G,Z.props,J.props)}else{let V=G.var("props",F0._`${O}.evaluated.props`);J.props=x4.mergeEvaluated.props(G,V,J.props,F0.Name)}if(J.items!==!0)if(Z&&!Z.dynamicItems){if(Z.items!==void 0)J.items=x4.mergeEvaluated.items(G,Z.items,J.items)}else{let V=G.var("items",F0._`${O}.evaluated.items`);J.items=x4.mergeEvaluated.items(G,V,J.items,F0.Name)}}}v7.callRef=_4;v7.default=UU});var h7=N((y7)=>{Object.defineProperty(y7,"__esModule",{value:!0});var MU=S7(),VU=_7(),ZU=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",MU.default,VU.default];y7.default=ZU});var u7=N((g7)=>{Object.defineProperty(g7,"__esModule",{value:!0});var y4=k(),Y1=y4.operators,h4={maximum:{okStr:"<=",ok:Y1.LTE,fail:Y1.GT},minimum:{okStr:">=",ok:Y1.GTE,fail:Y1.LT},exclusiveMaximum:{okStr:"<",ok:Y1.LT,fail:Y1.GTE},exclusiveMinimum:{okStr:">",ok:Y1.GT,fail:Y1.LTE}},qU={message:({keyword:Q,schemaCode:X})=>y4.str`must be ${h4[Q].okStr} ${X}`,params:({keyword:Q,schemaCode:X})=>y4._`{comparison: ${h4[Q].okStr}, limit: ${X}}`},wU={keyword:Object.keys(h4),type:"number",schemaType:"number",$data:!0,error:qU,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q;Q.fail$data(y4._`${Y} ${h4[X].fail} ${W} || isNaN(${Y})`)}};g7.default=wU});var l7=N((f7)=>{Object.defineProperty(f7,"__esModule",{value:!0});var Z6=k(),PU={message:({schemaCode:Q})=>Z6.str`must be multiple of ${Q}`,params:({schemaCode:Q})=>Z6._`{multipleOf: ${Q}}`},bU={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:PU,code(Q){let{gen:X,data:Y,schemaCode:W,it:G}=Q,J=G.opts.multipleOfPrecision,$=X.let("res"),z=J?Z6._`Math.abs(Math.round(${$}) - ${$}) > 1e-${J}`:Z6._`${$} !== parseInt(${$})`;Q.fail$data(Z6._`(${W} === 0 || (${$} = ${Y}/${W}, ${z}))`)}};f7.default=bU});var p7=N((c7)=>{Object.defineProperty(c7,"__esModule",{value:!0});function m7(Q){let X=Q.length,Y=0,W=0,G;while(W<X)if(Y++,G=Q.charCodeAt(W++),G>=55296&&G<=56319&&W<X){if(G=Q.charCodeAt(W),(G&64512)===56320)W++}return Y}c7.default=m7;m7.code='require("ajv/dist/runtime/ucs2length").default'});var n7=N((i7)=>{Object.defineProperty(i7,"__esModule",{value:!0});var B1=k(),TU=u(),SU=p7(),RU={message({keyword:Q,schemaCode:X}){let Y=Q==="maxLength"?"more":"fewer";return B1.str`must NOT have ${Y} than ${X} characters`},params:({schemaCode:Q})=>B1._`{limit: ${Q}}`},CU={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:RU,code(Q){let{keyword:X,data:Y,schemaCode:W,it:G}=Q,J=X==="maxLength"?B1.operators.GT:B1.operators.LT,$=G.opts.unicode===!1?B1._`${Y}.length`:B1._`${(0,TU.useFunc)(Q.gen,SU.default)}(${Y})`;Q.fail$data(B1._`${$} ${J} ${W}`)}};i7.default=CU});var r7=N((d7)=>{Object.defineProperty(d7,"__esModule",{value:!0});var vU=N0(),g4=k(),xU={message:({schemaCode:Q})=>g4.str`must match pattern "${Q}"`,params:({schemaCode:Q})=>g4._`{pattern: ${Q}}`},_U={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:xU,code(Q){let{data:X,$data:Y,schema:W,schemaCode:G,it:J}=Q,$=J.opts.unicodeRegExp?"u":"",z=Y?g4._`(new RegExp(${G}, ${$}))`:(0,vU.usePattern)(Q,W);Q.fail$data(g4._`!${z}.test(${X})`)}};d7.default=_U});var t7=N((o7)=>{Object.defineProperty(o7,"__esModule",{value:!0});var N6=k(),hU={message({keyword:Q,schemaCode:X}){let Y=Q==="maxProperties"?"more":"fewer";return N6.str`must NOT have ${Y} than ${X} properties`},params:({schemaCode:Q})=>N6._`{limit: ${Q}}`},gU={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:hU,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q,G=X==="maxProperties"?N6.operators.GT:N6.operators.LT;Q.fail$data(N6._`Object.keys(${Y}).length ${G} ${W}`)}};o7.default=gU});var s7=N((a7)=>{Object.defineProperty(a7,"__esModule",{value:!0});var q6=N0(),w6=k(),fU=u(),lU={message:({params:{missingProperty:Q}})=>w6.str`must have required property '${Q}'`,params:({params:{missingProperty:Q}})=>w6._`{missingProperty: ${Q}}`},mU={keyword:"required",type:"object",schemaType:"array",$data:!0,error:lU,code(Q){let{gen:X,schema:Y,schemaCode:W,data:G,$data:J,it:$}=Q,{opts:z}=$;if(!J&&Y.length===0)return;let H=Y.length>=z.loopRequired;if($.allErrors)K();else B();if(z.strictRequired){let L=Q.parentSchema.properties,{definedProperties:O}=Q.it;for(let M of Y)if((L===null||L===void 0?void 0:L[M])===void 0&&!O.has(M)){let Z=$.schemaEnv.baseId+$.errSchemaPath,V=`required property "${M}" is not defined at "${Z}" (strictRequired)`;(0,fU.checkStrictMode)($,V,$.opts.strictRequired)}}function K(){if(H||J)Q.block$data(w6.nil,D);else for(let L of Y)(0,q6.checkReportMissingProp)(Q,L)}function B(){let L=X.let("missing");if(H||J){let O=X.let("valid",!0);Q.block$data(O,()=>U(L,O)),Q.ok(O)}else X.if((0,q6.checkMissingProp)(Q,Y,L)),(0,q6.reportMissingProp)(Q,L),X.else()}function D(){X.forOf("prop",W,(L)=>{Q.setParams({missingProperty:L}),X.if((0,q6.noPropertyInData)(X,G,L,z.ownProperties),()=>Q.error())})}function U(L,O){Q.setParams({missingProperty:L}),X.forOf(L,W,()=>{X.assign(O,(0,q6.propertyInData)(X,G,L,z.ownProperties)),X.if((0,w6.not)(O),()=>{Q.error(),X.break()})},w6.nil)}}};a7.default=mU});var Q5=N((e7)=>{Object.defineProperty(e7,"__esModule",{value:!0});var j6=k(),pU={message({keyword:Q,schemaCode:X}){let Y=Q==="maxItems"?"more":"fewer";return j6.str`must NOT have ${Y} than ${X} items`},params:({schemaCode:Q})=>j6._`{limit: ${Q}}`},iU={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:pU,code(Q){let{keyword:X,data:Y,schemaCode:W}=Q,G=X==="maxItems"?j6.operators.GT:j6.operators.LT;Q.fail$data(j6._`${Y}.length ${G} ${W}`)}};e7.default=iU});var u4=N((Y5)=>{Object.defineProperty(Y5,"__esModule",{value:!0});var X5=T9();X5.code='require("ajv/dist/runtime/equal").default';Y5.default=X5});var G5=N((W5)=>{Object.defineProperty(W5,"__esModule",{value:!0});var p9=K6(),J0=k(),rU=u(),oU=u4(),tU={message:({params:{i:Q,j:X}})=>J0.str`must NOT have duplicate items (items ## ${X} and ${Q} are identical)`,params:({params:{i:Q,j:X}})=>J0._`{i: ${Q}, j: ${X}}`},aU={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:tU,code(Q){let{gen:X,data:Y,$data:W,schema:G,parentSchema:J,schemaCode:$,it:z}=Q;if(!W&&!G)return;let H=X.let("valid"),K=J.items?(0,p9.getSchemaTypes)(J.items):[];Q.block$data(H,B,J0._`${$} === false`),Q.ok(H);function B(){let O=X.let("i",J0._`${Y}.length`),M=X.let("j");Q.setParams({i:O,j:M}),X.assign(H,!0),X.if(J0._`${O} > 1`,()=>(D()?U:L)(O,M))}function D(){return K.length>0&&!K.some((O)=>O==="object"||O==="array")}function U(O,M){let Z=X.name("item"),V=(0,p9.checkDataTypes)(K,Z,z.opts.strictNumbers,p9.DataType.Wrong),T=X.const("indices",J0._`{}`);X.for(J0._`;${O}--;`,()=>{if(X.let(Z,J0._`${Y}[${O}]`),X.if(V,J0._`continue`),K.length>1)X.if(J0._`typeof ${Z} == "string"`,J0._`${Z} += "_"`);X.if(J0._`typeof ${T}[${Z}] == "number"`,()=>{X.assign(M,J0._`${T}[${Z}]`),Q.error(),X.assign(H,!1).break()}).code(J0._`${T}[${Z}] = ${O}`)})}function L(O,M){let Z=(0,rU.useFunc)(X,oU.default),V=X.name("outer");X.label(V).for(J0._`;${O}--;`,()=>X.for(J0._`${M} = ${O}; ${M}--;`,()=>X.if(J0._`${Z}(${Y}[${O}], ${Y}[${M}])`,()=>{Q.error(),X.assign(H,!1).break(V)})))}}};W5.default=aU});var $5=N((J5)=>{Object.defineProperty(J5,"__esModule",{value:!0});var i9=k(),eU=u(),QL=u4(),XL={message:"must be equal to constant",params:({schemaCode:Q})=>i9._`{allowedValue: ${Q}}`},YL={keyword:"const",$data:!0,error:XL,code(Q){let{gen:X,data:Y,$data:W,schemaCode:G,schema:J}=Q;if(W||J&&typeof J=="object")Q.fail$data(i9._`!${(0,eU.useFunc)(X,QL.default)}(${Y}, ${G})`);else Q.fail(i9._`${J} !== ${Y}`)}};J5.default=YL});var H5=N((z5)=>{Object.defineProperty(z5,"__esModule",{value:!0});var P6=k(),GL=u(),JL=u4(),$L={message:"must be equal to one of the allowed values",params:({schemaCode:Q})=>P6._`{allowedValues: ${Q}}`},zL={keyword:"enum",schemaType:"array",$data:!0,error:$L,code(Q){let{gen:X,data:Y,$data:W,schema:G,schemaCode:J,it:$}=Q;if(!W&&G.length===0)throw Error("enum must have non-empty array");let z=G.length>=$.opts.loopEnum,H,K=()=>H!==null&&H!==void 0?H:H=(0,GL.useFunc)(X,JL.default),B;if(z||W)B=X.let("valid"),Q.block$data(B,D);else{if(!Array.isArray(G))throw Error("ajv implementation error");let L=X.const("vSchema",J);B=(0,P6.or)(...G.map((O,M)=>U(L,M)))}Q.pass(B);function D(){X.assign(B,!1),X.forOf("v",J,(L)=>X.if(P6._`${K()}(${Y}, ${L})`,()=>X.assign(B,!0).break()))}function U(L,O){let M=G[O];return typeof M==="object"&&M!==null?P6._`${K()}(${Y}, ${L}[${O}])`:P6._`${Y} === ${M}`}}};z5.default=zL});var B5=N((K5)=>{Object.defineProperty(K5,"__esModule",{value:!0});var KL=u7(),BL=l7(),DL=n7(),AL=r7(),FL=t7(),UL=s7(),LL=Q5(),OL=G5(),ML=$5(),VL=H5(),ZL=[KL.default,BL.default,DL.default,AL.default,FL.default,UL.default,LL.default,OL.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ML.default,VL.default];K5.default=ZL});var d9=N((A5)=>{Object.defineProperty(A5,"__esModule",{value:!0});A5.validateAdditionalItems=void 0;var D1=k(),n9=u(),qL={message:({params:{len:Q}})=>D1.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>D1._`{limit: ${Q}}`},wL={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qL,code(Q){let{parentSchema:X,it:Y}=Q,{items:W}=X;if(!Array.isArray(W)){(0,n9.checkStrictMode)(Y,'"additionalItems" is ignored when "items" is not an array of schemas');return}D5(Q,W)}};function D5(Q,X){let{gen:Y,schema:W,data:G,keyword:J,it:$}=Q;$.items=!0;let z=Y.const("len",D1._`${G}.length`);if(W===!1)Q.setParams({len:X.length}),Q.pass(D1._`${z} <= ${X.length}`);else if(typeof W=="object"&&!(0,n9.alwaysValidSchema)($,W)){let K=Y.var("valid",D1._`${z} <= ${X.length}`);Y.if((0,D1.not)(K),()=>H(K)),Q.ok(K)}function H(K){Y.forRange("i",X.length,z,(B)=>{if(Q.subschema({keyword:J,dataProp:B,dataPropType:n9.Type.Num},K),!$.allErrors)Y.if((0,D1.not)(K),()=>Y.break())})}}A5.validateAdditionalItems=D5;A5.default=wL});var r9=N((O5)=>{Object.defineProperty(O5,"__esModule",{value:!0});O5.validateTuple=void 0;var U5=k(),f4=u(),PL=N0(),bL={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Q){let{schema:X,it:Y}=Q;if(Array.isArray(X))return L5(Q,"additionalItems",X);if(Y.items=!0,(0,f4.alwaysValidSchema)(Y,X))return;Q.ok((0,PL.validateArray)(Q))}};function L5(Q,X,Y=Q.schema){let{gen:W,parentSchema:G,data:J,keyword:$,it:z}=Q;if(B(G),z.opts.unevaluated&&Y.length&&z.items!==!0)z.items=f4.mergeEvaluated.items(W,Y.length,z.items);let H=W.name("valid"),K=W.const("len",U5._`${J}.length`);Y.forEach((D,U)=>{if((0,f4.alwaysValidSchema)(z,D))return;W.if(U5._`${K} > ${U}`,()=>Q.subschema({keyword:$,schemaProp:U,dataProp:U},H)),Q.ok(H)});function B(D){let{opts:U,errSchemaPath:L}=z,O=Y.length,M=O===D.minItems&&(O===D.maxItems||D[X]===!1);if(U.strictTuples&&!M){let Z=`"${$}" is ${O}-tuple, but minItems or maxItems/${X} are not specified or different at path "${L}"`;(0,f4.checkStrictMode)(z,Z,U.strictTuples)}}}O5.validateTuple=L5;O5.default=bL});var Z5=N((V5)=>{Object.defineProperty(V5,"__esModule",{value:!0});var IL=r9(),TL={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Q)=>(0,IL.validateTuple)(Q,"items")};V5.default=TL});var w5=N((q5)=>{Object.defineProperty(q5,"__esModule",{value:!0});var N5=k(),RL=u(),CL=N0(),kL=d9(),vL={message:({params:{len:Q}})=>N5.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>N5._`{limit: ${Q}}`},xL={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:vL,code(Q){let{schema:X,parentSchema:Y,it:W}=Q,{prefixItems:G}=Y;if(W.items=!0,(0,RL.alwaysValidSchema)(W,X))return;if(G)(0,kL.validateAdditionalItems)(Q,G);else Q.ok((0,CL.validateArray)(Q))}};q5.default=xL});var P5=N((j5)=>{Object.defineProperty(j5,"__esModule",{value:!0});var q0=k(),l4=u(),yL={message:({params:{min:Q,max:X}})=>X===void 0?q0.str`must contain at least ${Q} valid item(s)`:q0.str`must contain at least ${Q} and no more than ${X} valid item(s)`,params:({params:{min:Q,max:X}})=>X===void 0?q0._`{minContains: ${Q}}`:q0._`{minContains: ${Q}, maxContains: ${X}}`},hL={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:yL,code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,it:J}=Q,$,z,{minContains:H,maxContains:K}=W;if(J.opts.next)$=H===void 0?1:H,z=K;else $=1;let B=X.const("len",q0._`${G}.length`);if(Q.setParams({min:$,max:z}),z===void 0&&$===0){(0,l4.checkStrictMode)(J,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(z!==void 0&&$>z){(0,l4.checkStrictMode)(J,'"minContains" > "maxContains" is always invalid'),Q.fail();return}if((0,l4.alwaysValidSchema)(J,Y)){let M=q0._`${B} >= ${$}`;if(z!==void 0)M=q0._`${M} && ${B} <= ${z}`;Q.pass(M);return}J.items=!0;let D=X.name("valid");if(z===void 0&&$===1)L(D,()=>X.if(D,()=>X.break()));else if($===0){if(X.let(D,!0),z!==void 0)X.if(q0._`${G}.length > 0`,U)}else X.let(D,!1),U();Q.result(D,()=>Q.reset());function U(){let M=X.name("_valid"),Z=X.let("count",0);L(M,()=>X.if(M,()=>O(Z)))}function L(M,Z){X.forRange("i",0,B,(V)=>{Q.subschema({keyword:"contains",dataProp:V,dataPropType:l4.Type.Num,compositeRule:!0},M),Z()})}function O(M){if(X.code(q0._`${M}++`),z===void 0)X.if(q0._`${M} >= ${$}`,()=>X.assign(D,!0).break());else if(X.if(q0._`${M} > ${z}`,()=>X.assign(D,!1).break()),$===1)X.assign(D,!0);else X.if(q0._`${M} >= ${$}`,()=>X.assign(D,!0))}}};j5.default=hL});var R5=N((I5)=>{Object.defineProperty(I5,"__esModule",{value:!0});I5.validateSchemaDeps=I5.validatePropertyDeps=I5.error=void 0;var o9=k(),uL=u(),b6=N0();I5.error={message:({params:{property:Q,depsCount:X,deps:Y}})=>{let W=X===1?"property":"properties";return o9.str`must have ${W} ${Y} when property ${Q} is present`},params:({params:{property:Q,depsCount:X,deps:Y,missingProperty:W}})=>o9._`{property: ${Q},
|
|
7
7
|
missingProperty: ${W},
|
|
8
8
|
depsCount: ${X},
|
|
9
|
-
deps: ${Y}}`};var uL={keyword:"dependencies",type:"object",schemaType:"object",error:E5.error,code(Q){let[X,Y]=fL(Q);P5(Q,X),b5(Q,Y)}};function fL({schema:Q}){let X={},Y={};for(let W in Q){if(W==="__proto__")continue;let G=Array.isArray(Q[W])?X:Y;G[W]=Q[W]}return[X,Y]}function P5(Q,X=Q.schema){let{gen:Y,data:W,it:G}=Q;if(Object.keys(X).length===0)return;let J=Y.let("missing");for(let $ in X){let z=X[$];if(z.length===0)continue;let H=(0,b6.propertyInData)(Y,W,$,G.opts.ownProperties);if(Q.setParams({property:$,depsCount:z.length,deps:z.join(", ")}),G.allErrors)Y.if(H,()=>{for(let B of z)(0,b6.checkReportMissingProp)(Q,B)});else Y.if(r9._`${H} && (${(0,b6.checkMissingProp)(Q,z,J)})`),(0,b6.reportMissingProp)(Q,J),Y.else()}}E5.validatePropertyDeps=P5;function b5(Q,X=Q.schema){let{gen:Y,data:W,keyword:G,it:J}=Q,$=Y.name("valid");for(let z in X){if((0,hL.alwaysValidSchema)(J,X[z]))continue;Y.if((0,b6.propertyInData)(Y,W,z,J.opts.ownProperties),()=>{let H=Q.subschema({keyword:G,schemaProp:z},$);Q.mergeValidEvaluated(H,$)},()=>Y.var($,!0)),Q.ok($)}}E5.validateSchemaDeps=b5;E5.default=uL});var k5=N((C5)=>{Object.defineProperty(C5,"__esModule",{value:!0});var R5=k(),cL=u(),pL={message:"property name must be valid",params:({params:Q})=>R5._`{propertyName: ${Q.propertyName}}`},iL={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:pL,code(Q){let{gen:X,schema:Y,data:W,it:G}=Q;if((0,cL.alwaysValidSchema)(G,Y))return;let J=X.name("valid");X.forIn("key",W,($)=>{Q.setParams({propertyName:$}),Q.subschema({keyword:"propertyNames",data:$,dataTypes:["string"],propertyName:$,compositeRule:!0},J),X.if((0,R5.not)(J),()=>{if(Q.error(!0),!G.allErrors)X.break()})}),Q.ok(J)}};C5.default=iL});var o9=N((v5)=>{Object.defineProperty(v5,"__esModule",{value:!0});var m4=N0(),T0=k(),dL=f0(),c4=u(),rL={message:"must NOT have additional properties",params:({params:Q})=>T0._`{additionalProperty: ${Q.additionalProperty}}`},oL={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:rL,code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,errsCount:J,it:$}=Q;if(!J)throw Error("ajv implementation error");let{allErrors:z,opts:H}=$;if($.props=!0,H.removeAdditional!=="all"&&(0,c4.alwaysValidSchema)($,Y))return;let B=(0,m4.allSchemaProperties)(W.properties),K=(0,m4.allSchemaProperties)(W.patternProperties);D(),Q.ok(T0._`${J} === ${dL.default.errors}`);function D(){X.forIn("key",G,(Z)=>{if(!B.length&&!K.length)O(Z);else X.if(U(Z),()=>O(Z))})}function U(Z){let V;if(B.length>8){let T=(0,c4.schemaRefOrVal)($,W.properties,"properties");V=(0,m4.isOwnProperty)(X,T,Z)}else if(B.length)V=(0,T0.or)(...B.map((T)=>T0._`${Z} === ${T}`));else V=T0.nil;if(K.length)V=(0,T0.or)(V,...K.map((T)=>T0._`${(0,m4.usePattern)(Q,T)}.test(${Z})`));return(0,T0.not)(V)}function L(Z){X.code(T0._`delete ${G}[${Z}]`)}function O(Z){if(H.removeAdditional==="all"||H.removeAdditional&&Y===!1){L(Z);return}if(Y===!1){if(Q.setParams({additionalProperty:Z}),Q.error(),!z)X.break();return}if(typeof Y=="object"&&!(0,c4.alwaysValidSchema)($,Y)){let V=X.name("valid");if(H.removeAdditional==="failing")M(Z,V,!1),X.if((0,T0.not)(V),()=>{Q.reset(),L(Z)});else if(M(Z,V),!z)X.if((0,T0.not)(V),()=>X.break())}}function M(Z,V,T){let E={keyword:"additionalProperties",dataProp:Z,dataPropType:c4.Type.Str};if(T===!1)Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1});Q.subschema(E,V)}}};v5.default=oL});var g5=N((y5)=>{Object.defineProperty(y5,"__esModule",{value:!0});var aL=F6(),x5=N0(),t9=u(),_5=o9(),sL={keyword:"properties",type:"object",schemaType:"object",code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,it:J}=Q;if(J.opts.removeAdditional==="all"&&W.additionalProperties===void 0)_5.default.code(new aL.KeywordCxt(J,_5.default,"additionalProperties"));let $=(0,x5.allSchemaProperties)(Y);for(let D of $)J.definedProperties.add(D);if(J.opts.unevaluated&&$.length&&J.props!==!0)J.props=t9.mergeEvaluated.props(X,(0,t9.toHash)($),J.props);let z=$.filter((D)=>!(0,t9.alwaysValidSchema)(J,Y[D]));if(z.length===0)return;let H=X.name("valid");for(let D of z){if(B(D))K(D);else{if(X.if((0,x5.propertyInData)(X,G,D,J.opts.ownProperties)),K(D),!J.allErrors)X.else().var(H,!0);X.endIf()}Q.it.definedProperties.add(D),Q.ok(H)}function B(D){return J.opts.useDefaults&&!J.compositeRule&&Y[D].default!==void 0}function K(D){Q.subschema({keyword:"properties",schemaProp:D,dataProp:D},H)}}};y5.default=sL});var m5=N((l5)=>{Object.defineProperty(l5,"__esModule",{value:!0});var h5=N0(),p4=k(),u5=u(),f5=u(),QO={keyword:"patternProperties",type:"object",schemaType:"object",code(Q){let{gen:X,schema:Y,data:W,parentSchema:G,it:J}=Q,{opts:$}=J,z=(0,h5.allSchemaProperties)(Y),H=z.filter((M)=>(0,u5.alwaysValidSchema)(J,Y[M]));if(z.length===0||H.length===z.length&&(!J.opts.unevaluated||J.props===!0))return;let B=$.strictSchema&&!$.allowMatchingProperties&&G.properties,K=X.name("valid");if(J.props!==!0&&!(J.props instanceof p4.Name))J.props=(0,f5.evaluatedPropsToName)(X,J.props);let{props:D}=J;U();function U(){for(let M of z){if(B)L(M);if(J.allErrors)O(M);else X.var(K,!0),O(M),X.if(K)}}function L(M){for(let Z in B)if(new RegExp(M).test(Z))(0,u5.checkStrictMode)(J,`property ${Z} matches pattern ${M} (use allowMatchingProperties)`)}function O(M){X.forIn("key",W,(Z)=>{X.if(p4._`${(0,h5.usePattern)(Q,M)}.test(${Z})`,()=>{let V=H.includes(M);if(!V)Q.subschema({keyword:"patternProperties",schemaProp:M,dataProp:Z,dataPropType:f5.Type.Str},K);if(J.opts.unevaluated&&D!==!0)X.assign(p4._`${D}[${Z}]`,!0);else if(!V&&!J.allErrors)X.if((0,p4.not)(K),()=>X.break())})})}}};l5.default=QO});var p5=N((c5)=>{Object.defineProperty(c5,"__esModule",{value:!0});var YO=u(),WO={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Q){let{gen:X,schema:Y,it:W}=Q;if((0,YO.alwaysValidSchema)(W,Y)){Q.fail();return}let G=X.name("valid");Q.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},G),Q.failResult(G,()=>Q.reset(),()=>Q.error())},error:{message:"must NOT be valid"}};c5.default=WO});var n5=N((i5)=>{Object.defineProperty(i5,"__esModule",{value:!0});var JO=N0(),$O={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:JO.validateUnion,error:{message:"must match a schema in anyOf"}};i5.default=$O});var r5=N((d5)=>{Object.defineProperty(d5,"__esModule",{value:!0});var i4=k(),HO=u(),BO={message:"must match exactly one schema in oneOf",params:({params:Q})=>i4._`{passingSchemas: ${Q.passing}}`},KO={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:BO,code(Q){let{gen:X,schema:Y,parentSchema:W,it:G}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");if(G.opts.discriminator&&W.discriminator)return;let J=Y,$=X.let("valid",!1),z=X.let("passing",null),H=X.name("_valid");Q.setParams({passing:z}),X.block(B),Q.result($,()=>Q.reset(),()=>Q.error(!0));function B(){J.forEach((K,D)=>{let U;if((0,HO.alwaysValidSchema)(G,K))X.var(H,!0);else U=Q.subschema({keyword:"oneOf",schemaProp:D,compositeRule:!0},H);if(D>0)X.if(i4._`${H} && ${$}`).assign($,!1).assign(z,i4._`[${z}, ${D}]`).else();X.if(H,()=>{if(X.assign($,!0),X.assign(z,D),U)Q.mergeEvaluated(U,i4.Name)})})}}};d5.default=KO});var t5=N((o5)=>{Object.defineProperty(o5,"__esModule",{value:!0});var AO=u(),FO={keyword:"allOf",schemaType:"array",code(Q){let{gen:X,schema:Y,it:W}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");let G=X.name("valid");Y.forEach((J,$)=>{if((0,AO.alwaysValidSchema)(W,J))return;let z=Q.subschema({keyword:"allOf",schemaProp:$},G);Q.ok(G),Q.mergeEvaluated(z)})}};o5.default=FO});var Q$=N((e5)=>{Object.defineProperty(e5,"__esModule",{value:!0});var n4=k(),s5=u(),LO={message:({params:Q})=>n4.str`must match "${Q.ifClause}" schema`,params:({params:Q})=>n4._`{failingKeyword: ${Q.ifClause}}`},OO={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:LO,code(Q){let{gen:X,parentSchema:Y,it:W}=Q;if(Y.then===void 0&&Y.else===void 0)(0,s5.checkStrictMode)(W,'"if" without "then" and "else" is ignored');let G=a5(W,"then"),J=a5(W,"else");if(!G&&!J)return;let $=X.let("valid",!0),z=X.name("_valid");if(H(),Q.reset(),G&&J){let K=X.let("ifClause");Q.setParams({ifClause:K}),X.if(z,B("then",K),B("else",K))}else if(G)X.if(z,B("then"));else X.if((0,n4.not)(z),B("else"));Q.pass($,()=>Q.error(!0));function H(){let K=Q.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);Q.mergeEvaluated(K)}function B(K,D){return()=>{let U=Q.subschema({keyword:K},z);if(X.assign($,z),Q.mergeValidEvaluated(U,$),D)X.assign(D,n4._`${K}`);else Q.setParams({ifClause:K})}}}};function a5(Q,X){let Y=Q.schema[X];return Y!==void 0&&!(0,s5.alwaysValidSchema)(Q,Y)}e5.default=OO});var Y$=N((X$)=>{Object.defineProperty(X$,"__esModule",{value:!0});var VO=u(),ZO={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Q,parentSchema:X,it:Y}){if(X.if===void 0)(0,VO.checkStrictMode)(Y,`"${Q}" without "if" is ignored`)}};X$.default=ZO});var G$=N((W$)=>{Object.defineProperty(W$,"__esModule",{value:!0});var qO=n9(),wO=V5(),jO=d9(),PO=q5(),bO=j5(),EO=S5(),IO=k5(),TO=o9(),SO=g5(),RO=m5(),CO=p5(),kO=n5(),vO=r5(),xO=t5(),_O=Q$(),yO=Y$();function gO(Q=!1){let X=[CO.default,kO.default,vO.default,xO.default,_O.default,yO.default,IO.default,TO.default,EO.default,SO.default,RO.default];if(Q)X.push(wO.default,PO.default);else X.push(qO.default,jO.default);return X.push(bO.default),X}W$.default=gO});var $$=N((J$)=>{Object.defineProperty(J$,"__esModule",{value:!0});var s=k(),uO={message:({schemaCode:Q})=>s.str`must match format "${Q}"`,params:({schemaCode:Q})=>s._`{format: ${Q}}`},fO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:uO,code(Q,X){let{gen:Y,data:W,$data:G,schema:J,schemaCode:$,it:z}=Q,{opts:H,errSchemaPath:B,schemaEnv:K,self:D}=z;if(!H.validateFormats)return;if(G)U();else L();function U(){let O=Y.scopeValue("formats",{ref:D.formats,code:H.code.formats}),M=Y.const("fDef",s._`${O}[${$}]`),Z=Y.let("fType"),V=Y.let("format");Y.if(s._`typeof ${M} == "object" && !(${M} instanceof RegExp)`,()=>Y.assign(Z,s._`${M}.type || "string"`).assign(V,s._`${M}.validate`),()=>Y.assign(Z,s._`"string"`).assign(V,M)),Q.fail$data((0,s.or)(T(),E()));function T(){if(H.strictSchema===!1)return s.nil;return s._`${$} && !${V}`}function E(){let v=K.$async?s._`(${M}.async ? await ${V}(${W}) : ${V}(${W}))`:s._`${V}(${W})`,I=s._`(typeof ${V} == "function" ? ${v} : ${V}.test(${W}))`;return s._`${V} && ${V} !== true && ${Z} === ${X} && !${I}`}}function L(){let O=D.formats[J];if(!O){T();return}if(O===!0)return;let[M,Z,V]=E(O);if(M===X)Q.pass(v());function T(){if(H.strictSchema===!1){D.logger.warn(I());return}throw Error(I());function I(){return`unknown format "${J}" ignored in schema at path "${B}"`}}function E(I){let R0=I instanceof RegExp?(0,s.regexpCode)(I):H.code.formats?s._`${H.code.formats}${(0,s.getProperty)(J)}`:void 0,x0=Y.scopeValue("formats",{key:J,ref:I,code:R0});if(typeof I=="object"&&!(I instanceof RegExp))return[I.type||"string",I.validate,s._`${x0}.validate`];return["string",I,x0]}function v(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!K.$async)throw Error("async format in sync schema");return s._`await ${V}(${W})`}return typeof Z=="function"?s._`${V}(${W})`:s._`${V}.test(${W})`}}}};J$.default=fO});var H$=N((z$)=>{Object.defineProperty(z$,"__esModule",{value:!0});var mO=$$(),cO=[mO.default];z$.default=cO});var D$=N((B$)=>{Object.defineProperty(B$,"__esModule",{value:!0});B$.contentVocabulary=B$.metadataVocabulary=void 0;B$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];B$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var U$=N((F$)=>{Object.defineProperty(F$,"__esModule",{value:!0});var nO=y7(),dO=B5(),rO=G$(),oO=H$(),A$=D$(),tO=[nO.default,dO.default,(0,rO.default)(),oO.default,A$.metadataVocabulary,A$.contentVocabulary];F$.default=tO});var V$=N((O$)=>{Object.defineProperty(O$,"__esModule",{value:!0});O$.DiscrError=void 0;var L$;(function(Q){Q.Tag="tag",Q.Mapping="mapping"})(L$||(O$.DiscrError=L$={}))});var q$=N((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});var S1=k(),a9=V$(),Z$=I4(),sO=U6(),eO=u(),QM={message:({params:{discrError:Q,tagName:X}})=>Q===a9.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:Q,tag:X,tagName:Y}})=>S1._`{error: ${Q}, tag: ${Y}, tagValue: ${X}}`},XM={keyword:"discriminator",type:"object",schemaType:"object",error:QM,code(Q){let{gen:X,data:Y,schema:W,parentSchema:G,it:J}=Q,{oneOf:$}=G;if(!J.opts.discriminator)throw Error("discriminator: requires discriminator option");let z=W.propertyName;if(typeof z!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!$)throw Error("discriminator: requires oneOf keyword");let H=X.let("valid",!1),B=X.const("tag",S1._`${Y}${(0,S1.getProperty)(z)}`);X.if(S1._`typeof ${B} == "string"`,()=>K(),()=>Q.error(!1,{discrError:a9.DiscrError.Tag,tag:B,tagName:z})),Q.ok(H);function K(){let L=U();X.if(!1);for(let O in L)X.elseIf(S1._`${B} === ${O}`),X.assign(H,D(L[O]));X.else(),Q.error(!1,{discrError:a9.DiscrError.Mapping,tag:B,tagName:z}),X.endIf()}function D(L){let O=X.name("valid"),M=Q.subschema({keyword:"oneOf",schemaProp:L},O);return Q.mergeEvaluated(M,S1.Name),O}function U(){var L;let O={},M=V(G),Z=!0;for(let v=0;v<$.length;v++){let I=$[v];if((I===null||I===void 0?void 0:I.$ref)&&!(0,eO.schemaHasRulesButRef)(I,J.self.RULES)){let x0=I.$ref;if(I=Z$.resolveRef.call(J.self,J.schemaEnv.root,J.baseId,x0),I instanceof Z$.SchemaEnv)I=I.schema;if(I===void 0)throw new sO.default(J.opts.uriResolver,J.baseId,x0)}let R0=(L=I===null||I===void 0?void 0:I.properties)===null||L===void 0?void 0:L[z];if(typeof R0!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${z}"`);Z=Z&&(M||V(I)),T(R0,v)}if(!Z)throw Error(`discriminator: "${z}" must be required`);return O;function V({required:v}){return Array.isArray(v)&&v.includes(z)}function T(v,I){if(v.const)E(v.const,I);else if(v.enum)for(let R0 of v.enum)E(R0,I);else throw Error(`discriminator: "properties/${z}" must have "const" or "enum"`)}function E(v,I){if(typeof v!="string"||v in O)throw Error(`discriminator: "${z}" values must be unique strings`);O[v]=I}}}};N$.default=XM});var w$=N(($b,WM)=>{WM.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 e9=N((U0,s9)=>{Object.defineProperty(U0,"__esModule",{value:!0});U0.MissingRefError=U0.ValidationError=U0.CodeGen=U0.Name=U0.nil=U0.stringify=U0.str=U0._=U0.KeywordCxt=U0.Ajv=void 0;var GM=E7(),JM=U$(),$M=q$(),j$=w$(),zM=["/properties"],d4="http://json-schema.org/draft-07/schema";class E6 extends GM.default{_addVocabularies(){if(super._addVocabularies(),JM.default.forEach((Q)=>this.addVocabulary(Q)),this.opts.discriminator)this.addKeyword($M.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Q=this.opts.$data?this.$dataMetaSchema(j$,zM):j$;this.addMetaSchema(Q,d4,!1),this.refs["http://json-schema.org/schema"]=d4}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(d4)?d4:void 0)}}U0.Ajv=E6;s9.exports=U0=E6;s9.exports.Ajv=E6;Object.defineProperty(U0,"__esModule",{value:!0});U0.default=E6;var HM=F6();Object.defineProperty(U0,"KeywordCxt",{enumerable:!0,get:function(){return HM.KeywordCxt}});var R1=k();Object.defineProperty(U0,"_",{enumerable:!0,get:function(){return R1._}});Object.defineProperty(U0,"str",{enumerable:!0,get:function(){return R1.str}});Object.defineProperty(U0,"stringify",{enumerable:!0,get:function(){return R1.stringify}});Object.defineProperty(U0,"nil",{enumerable:!0,get:function(){return R1.nil}});Object.defineProperty(U0,"Name",{enumerable:!0,get:function(){return R1.Name}});Object.defineProperty(U0,"CodeGen",{enumerable:!0,get:function(){return R1.CodeGen}});var BM=b4();Object.defineProperty(U0,"ValidationError",{enumerable:!0,get:function(){return BM.default}});var KM=U6();Object.defineProperty(U0,"MissingRefError",{enumerable:!0,get:function(){return KM.default}})});var v$=N((C$)=>{Object.defineProperty(C$,"__esModule",{value:!0});C$.formatNames=C$.fastFormats=C$.fullFormats=void 0;function v0(Q,X){return{validate:Q,compare:X}}C$.fullFormats={date:v0(I$,WX),time:v0(XX(!0),GX),"date-time":v0(P$(!0),S$),"iso-time":v0(XX(),T$),"iso-date-time":v0(P$(),R$),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:VM,"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:bM,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:ZM,int32:{type:"number",validate:wM},int64:{type:"number",validate:jM},float:{type:"number",validate:E$},double:{type:"number",validate:E$},password:!0,binary:!0};C$.fastFormats={...C$.fullFormats,date:v0(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,WX),time:v0(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,GX),"date-time":v0(/^\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,S$),"iso-time":v0(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,T$),"iso-date-time":v0(/^\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,R$),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};C$.formatNames=Object.keys(C$.fullFormats);function FM(Q){return Q%4===0&&(Q%100!==0||Q%400===0)}var UM=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,LM=[0,31,28,31,30,31,30,31,31,30,31,30,31];function I$(Q){let X=UM.exec(Q);if(!X)return!1;let Y=+X[1],W=+X[2],G=+X[3];return W>=1&&W<=12&&G>=1&&G<=(W===2&&FM(Y)?29:LM[W])}function WX(Q,X){if(!(Q&&X))return;if(Q>X)return 1;if(Q<X)return-1;return 0}var QX=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function XX(Q){return function(Y){let W=QX.exec(Y);if(!W)return!1;let G=+W[1],J=+W[2],$=+W[3],z=W[4],H=W[5]==="-"?-1:1,B=+(W[6]||0),K=+(W[7]||0);if(B>23||K>59||Q&&!z)return!1;if(G<=23&&J<=59&&$<60)return!0;let D=J-K*H,U=G-B*H-(D<0?1:0);return(U===23||U===-1)&&(D===59||D===-1)&&$<61}}function GX(Q,X){if(!(Q&&X))return;let Y=new Date("2020-01-01T"+Q).valueOf(),W=new Date("2020-01-01T"+X).valueOf();if(!(Y&&W))return;return Y-W}function T$(Q,X){if(!(Q&&X))return;let Y=QX.exec(Q),W=QX.exec(X);if(!(Y&&W))return;if(Q=Y[1]+Y[2]+Y[3],X=W[1]+W[2]+W[3],Q>X)return 1;if(Q<X)return-1;return 0}var YX=/t|\s/i;function P$(Q){let X=XX(Q);return function(W){let G=W.split(YX);return G.length===2&&I$(G[0])&&X(G[1])}}function S$(Q,X){if(!(Q&&X))return;let Y=new Date(Q).valueOf(),W=new Date(X).valueOf();if(!(Y&&W))return;return Y-W}function R$(Q,X){if(!(Q&&X))return;let[Y,W]=Q.split(YX),[G,J]=X.split(YX),$=WX(Y,G);if($===void 0)return;return $||GX(W,J)}var OM=/\/|:/,MM=/^(?:[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 VM(Q){return OM.test(Q)&&MM.test(Q)}var b$=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function ZM(Q){return b$.lastIndex=0,b$.test(Q)}var NM=-2147483648,qM=2147483647;function wM(Q){return Number.isInteger(Q)&&Q<=qM&&Q>=NM}function jM(Q){return Number.isInteger(Q)}function E$(){return!0}var PM=/[^\\]\\Z/;function bM(Q){if(PM.test(Q))return!1;try{return new RegExp(Q),!0}catch(X){return!1}}});var _$=N((x$)=>{Object.defineProperty(x$,"__esModule",{value:!0});x$.formatLimitDefinition=void 0;var IM=e9(),S0=k(),W1=S0.operators,r4={formatMaximum:{okStr:"<=",ok:W1.LTE,fail:W1.GT},formatMinimum:{okStr:">=",ok:W1.GTE,fail:W1.LT},formatExclusiveMaximum:{okStr:"<",ok:W1.LT,fail:W1.GTE},formatExclusiveMinimum:{okStr:">",ok:W1.GT,fail:W1.LTE}},TM={message:({keyword:Q,schemaCode:X})=>S0.str`should be ${r4[Q].okStr} ${X}`,params:({keyword:Q,schemaCode:X})=>S0._`{comparison: ${r4[Q].okStr}, limit: ${X}}`};x$.formatLimitDefinition={keyword:Object.keys(r4),type:"string",schemaType:"string",$data:!0,error:TM,code(Q){let{gen:X,data:Y,schemaCode:W,keyword:G,it:J}=Q,{opts:$,self:z}=J;if(!$.validateFormats)return;let H=new IM.KeywordCxt(J,z.RULES.all.format.definition,"format");if(H.$data)B();else K();function B(){let U=X.scopeValue("formats",{ref:z.formats,code:$.code.formats}),L=X.const("fmt",S0._`${U}[${H.schemaCode}]`);Q.fail$data((0,S0.or)(S0._`typeof ${L} != "object"`,S0._`${L} instanceof RegExp`,S0._`typeof ${L}.compare != "function"`,D(L)))}function K(){let U=H.schema,L=z.formats[U];if(!L||L===!0)return;if(typeof L!="object"||L instanceof RegExp||typeof L.compare!="function")throw Error(`"${G}": format "${U}" does not define "compare" function`);let O=X.scopeValue("formats",{key:U,ref:L,code:$.code.formats?S0._`${$.code.formats}${(0,S0.getProperty)(U)}`:void 0});Q.fail$data(D(O))}function D(U){return S0._`${U}.compare(${Y}, ${W}) ${r4[G].fail} 0`}},dependencies:["format"]};var SM=(Q)=>{return Q.addKeyword(x$.formatLimitDefinition),Q};x$.default=SM});var u$=N((I6,h$)=>{Object.defineProperty(I6,"__esModule",{value:!0});var C1=v$(),CM=_$(),zX=k(),y$=new zX.Name("fullFormats"),kM=new zX.Name("fastFormats"),HX=(Q,X={keywords:!0})=>{if(Array.isArray(X))return g$(Q,X,C1.fullFormats,y$),Q;let[Y,W]=X.mode==="fast"?[C1.fastFormats,kM]:[C1.fullFormats,y$],G=X.formats||C1.formatNames;if(g$(Q,G,Y,W),X.keywords)(0,CM.default)(Q);return Q};HX.get=(Q,X="full")=>{let W=(X==="fast"?C1.fastFormats:C1.fullFormats)[Q];if(!W)throw Error(`Unknown format "${Q}"`);return W};function g$(Q,X,Y,W){var G,J;(G=(J=Q.opts.code).formats)!==null&&G!==void 0||(J.formats=zX._`require("ajv-formats/dist/formats").${W}`);for(let $ of X)Q.addFormat($,Y[$])}h$.exports=I6=HX;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=HX});var dM=Object.freeze({status:"aborted"});function F(Q,X,Y){function W(z,H){var B;Object.defineProperty(z,"_zod",{value:z._zod??{},enumerable:!1}),(B=z._zod).traits??(B.traits=new Set),z._zod.traits.add(Q),X(z,H);for(let K in $.prototype)if(!(K in z))Object.defineProperty(z,K,{value:$.prototype[K].bind(z)});z._zod.constr=$,z._zod.def=H}let G=Y?.Parent??Object;class J extends G{}Object.defineProperty(J,"name",{value:Q});function $(z){var H;let B=Y?.Parent?new J:this;W(B,z),(H=B._zod).deferred??(H.deferred=[]);for(let K of B._zod.deferred)K();return B}return Object.defineProperty($,"init",{value:W}),Object.defineProperty($,Symbol.hasInstance,{value:(z)=>{if(Y?.Parent&&z instanceof Y.Parent)return!0;return z?._zod?.traits?.has(Q)}}),Object.defineProperty($,"name",{value:Q}),$}var rM=Symbol("zod_brand");class _0 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class x1 extends Error{constructor(Q){super(`Encountered unidirectional transform during encode: ${Q}`);this.name="ZodEncodeError"}}var S6={};function M0(Q){if(Q)Object.assign(S6,Q);return S6}var h={};NX(h,{unwrapMessage:()=>_1,uint8ArrayToHex:()=>xz,uint8ArrayToBase64url:()=>kz,uint8ArrayToBase64:()=>IX,stringifyPrimitive:()=>v6,shallowClone:()=>wX,safeExtend:()=>Ez,required:()=>Sz,randomString:()=>Zz,propertyKeyTypes:()=>GQ,promiseAllObject:()=>Vz,primitiveTypes:()=>jX,prefixIssues:()=>g0,pick:()=>jz,partial:()=>Tz,optionalKeys:()=>JQ,omit:()=>Pz,objectClone:()=>Lz,numKeys:()=>Nz,nullish:()=>y1,normalizeParams:()=>b,mergeDefs:()=>i0,merge:()=>Iz,jsonStringifyReplacer:()=>F1,joinValues:()=>R6,issue:()=>L1,isPlainObject:()=>n0,isObject:()=>G1,hexToUint8Array:()=>vz,getSizableOrigin:()=>bX,getParsedType:()=>qz,getLengthableOrigin:()=>h1,getEnumValues:()=>XQ,getElementAtPath:()=>Mz,floatSafeRemainder:()=>YQ,finalizeIssue:()=>j0,extend:()=>bz,escapeRegex:()=>y0,esc:()=>C6,defineLazy:()=>l,createTransparentProxy:()=>wz,cloneDef:()=>Oz,clone:()=>w0,cleanRegex:()=>g1,cleanEnum:()=>Rz,captureStackTrace:()=>k6,cached:()=>U1,base64urlToUint8Array:()=>Cz,base64ToUint8Array:()=>EX,assignProp:()=>p0,assertNotEqual:()=>Dz,assertNever:()=>Fz,assertIs:()=>Az,assertEqual:()=>Kz,assert:()=>Uz,allowsEval:()=>WQ,aborted:()=>d0,NUMBER_FORMAT_RANGES:()=>$Q,Class:()=>TX,BIGINT_FORMAT_RANGES:()=>PX});function Kz(Q){return Q}function Dz(Q){return Q}function Az(Q){}function Fz(Q){throw Error()}function Uz(Q){}function XQ(Q){let X=Object.values(Q).filter((W)=>typeof W==="number");return Object.entries(Q).filter(([W,G])=>X.indexOf(+W)===-1).map(([W,G])=>G)}function R6(Q,X="|"){return Q.map((Y)=>v6(Y)).join(X)}function F1(Q,X){if(typeof X==="bigint")return X.toString();return X}function U1(Q){return{get value(){{let Y=Q();return Object.defineProperty(this,"value",{value:Y}),Y}throw Error("cached value already set")}}}function y1(Q){return Q===null||Q===void 0}function g1(Q){let X=Q.startsWith("^")?1:0,Y=Q.endsWith("$")?Q.length-1:Q.length;return Q.slice(X,Y)}function YQ(Q,X){let Y=(Q.toString().split(".")[1]||"").length,W=X.toString(),G=(W.split(".")[1]||"").length;if(G===0&&/\d?e-\d?/.test(W)){let H=W.match(/\d?e-(\d?)/);if(H?.[1])G=Number.parseInt(H[1])}let J=Y>G?Y:G,$=Number.parseInt(Q.toFixed(J).replace(".","")),z=Number.parseInt(X.toFixed(J).replace(".",""));return $%z/10**J}var qX=Symbol("evaluating");function l(Q,X,Y){let W=void 0;Object.defineProperty(Q,X,{get(){if(W===qX)return;if(W===void 0)W=qX,W=Y();return W},set(G){Object.defineProperty(Q,X,{value:G})},configurable:!0})}function Lz(Q){return Object.create(Object.getPrototypeOf(Q),Object.getOwnPropertyDescriptors(Q))}function p0(Q,X,Y){Object.defineProperty(Q,X,{value:Y,writable:!0,enumerable:!0,configurable:!0})}function i0(...Q){let X={};for(let Y of Q){let W=Object.getOwnPropertyDescriptors(Y);Object.assign(X,W)}return Object.defineProperties({},X)}function Oz(Q){return i0(Q._zod.def)}function Mz(Q,X){if(!X)return Q;return X.reduce((Y,W)=>Y?.[W],Q)}function Vz(Q){let X=Object.keys(Q),Y=X.map((W)=>Q[W]);return Promise.all(Y).then((W)=>{let G={};for(let J=0;J<X.length;J++)G[X[J]]=W[J];return G})}function Zz(Q=10){let Y="";for(let W=0;W<Q;W++)Y+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Y}function C6(Q){return JSON.stringify(Q)}var k6="captureStackTrace"in Error?Error.captureStackTrace:(...Q)=>{};function G1(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}var WQ=U1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(Q){return!1}});function n0(Q){if(G1(Q)===!1)return!1;let X=Q.constructor;if(X===void 0)return!0;let Y=X.prototype;if(G1(Y)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Y,"isPrototypeOf")===!1)return!1;return!0}function wX(Q){if(n0(Q))return{...Q};if(Array.isArray(Q))return[...Q];return Q}function Nz(Q){let X=0;for(let Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))X++;return X}var qz=(Q)=>{let X=typeof Q;switch(X){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(Q)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Q.then&&typeof Q.then==="function"&&Q.catch&&typeof Q.catch==="function")return"promise";if(typeof Map<"u"&&Q instanceof Map)return"map";if(typeof Set<"u"&&Q instanceof Set)return"set";if(typeof Date<"u"&&Q instanceof Date)return"date";if(typeof File<"u"&&Q instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${X}`)}},GQ=new Set(["string","number","symbol"]),jX=new Set(["string","number","bigint","boolean","symbol","undefined"]);function y0(Q){return Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w0(Q,X,Y){let W=new Q._zod.constr(X??Q._zod.def);if(!X||Y?.parent)W._zod.parent=Q;return W}function b(Q){let X=Q;if(!X)return{};if(typeof X==="string")return{error:()=>X};if(X?.message!==void 0){if(X?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");X.error=X.message}if(delete X.message,typeof X.error==="string")return{...X,error:()=>X.error};return X}function wz(Q){let X;return new Proxy({},{get(Y,W,G){return X??(X=Q()),Reflect.get(X,W,G)},set(Y,W,G,J){return X??(X=Q()),Reflect.set(X,W,G,J)},has(Y,W){return X??(X=Q()),Reflect.has(X,W)},deleteProperty(Y,W){return X??(X=Q()),Reflect.deleteProperty(X,W)},ownKeys(Y){return X??(X=Q()),Reflect.ownKeys(X)},getOwnPropertyDescriptor(Y,W){return X??(X=Q()),Reflect.getOwnPropertyDescriptor(X,W)},defineProperty(Y,W,G){return X??(X=Q()),Reflect.defineProperty(X,W,G)}})}function v6(Q){if(typeof Q==="bigint")return Q.toString()+"n";if(typeof Q==="string")return`"${Q}"`;return`${Q}`}function JQ(Q){return Object.keys(Q).filter((X)=>{return Q[X]._zod.optin==="optional"&&Q[X]._zod.optout==="optional"})}var $Q={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]},PX={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function jz(Q,X){let Y=Q._zod.def,W=i0(Q._zod.def,{get shape(){let G={};for(let J in X){if(!(J in Y.shape))throw Error(`Unrecognized key: "${J}"`);if(!X[J])continue;G[J]=Y.shape[J]}return p0(this,"shape",G),G},checks:[]});return w0(Q,W)}function Pz(Q,X){let Y=Q._zod.def,W=i0(Q._zod.def,{get shape(){let G={...Q._zod.def.shape};for(let J in X){if(!(J in Y.shape))throw Error(`Unrecognized key: "${J}"`);if(!X[J])continue;delete G[J]}return p0(this,"shape",G),G},checks:[]});return w0(Q,W)}function bz(Q,X){if(!n0(X))throw Error("Invalid input to extend: expected a plain object");let Y=Q._zod.def.checks;if(Y&&Y.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let G=i0(Q._zod.def,{get shape(){let J={...Q._zod.def.shape,...X};return p0(this,"shape",J),J},checks:[]});return w0(Q,G)}function Ez(Q,X){if(!n0(X))throw Error("Invalid input to safeExtend: expected a plain object");let Y={...Q._zod.def,get shape(){let W={...Q._zod.def.shape,...X};return p0(this,"shape",W),W},checks:Q._zod.def.checks};return w0(Q,Y)}function Iz(Q,X){let Y=i0(Q._zod.def,{get shape(){let W={...Q._zod.def.shape,...X._zod.def.shape};return p0(this,"shape",W),W},get catchall(){return X._zod.def.catchall},checks:[]});return w0(Q,Y)}function Tz(Q,X,Y){let W=i0(X._zod.def,{get shape(){let G=X._zod.def.shape,J={...G};if(Y)for(let $ in Y){if(!($ in G))throw Error(`Unrecognized key: "${$}"`);if(!Y[$])continue;J[$]=Q?new Q({type:"optional",innerType:G[$]}):G[$]}else for(let $ in G)J[$]=Q?new Q({type:"optional",innerType:G[$]}):G[$];return p0(this,"shape",J),J},checks:[]});return w0(X,W)}function Sz(Q,X,Y){let W=i0(X._zod.def,{get shape(){let G=X._zod.def.shape,J={...G};if(Y)for(let $ in Y){if(!($ in J))throw Error(`Unrecognized key: "${$}"`);if(!Y[$])continue;J[$]=new Q({type:"nonoptional",innerType:G[$]})}else for(let $ in G)J[$]=new Q({type:"nonoptional",innerType:G[$]});return p0(this,"shape",J),J},checks:[]});return w0(X,W)}function d0(Q,X=0){if(Q.aborted===!0)return!0;for(let Y=X;Y<Q.issues.length;Y++)if(Q.issues[Y]?.continue!==!0)return!0;return!1}function g0(Q,X){return X.map((Y)=>{var W;return(W=Y).path??(W.path=[]),Y.path.unshift(Q),Y})}function _1(Q){return typeof Q==="string"?Q:Q?.message}function j0(Q,X,Y){let W={...Q,path:Q.path??[]};if(!Q.message){let G=_1(Q.inst?._zod.def?.error?.(Q))??_1(X?.error?.(Q))??_1(Y.customError?.(Q))??_1(Y.localeError?.(Q))??"Invalid input";W.message=G}if(delete W.inst,delete W.continue,!X?.reportInput)delete W.input;return W}function bX(Q){if(Q instanceof Set)return"set";if(Q instanceof Map)return"map";if(Q instanceof File)return"file";return"unknown"}function h1(Q){if(Array.isArray(Q))return"array";if(typeof Q==="string")return"string";return"unknown"}function L1(...Q){let[X,Y,W]=Q;if(typeof X==="string")return{message:X,code:"custom",input:Y,inst:W};return{...X}}function Rz(Q){return Object.entries(Q).filter(([X,Y])=>{return Number.isNaN(Number.parseInt(X,10))}).map((X)=>X[1])}function EX(Q){let X=atob(Q),Y=new Uint8Array(X.length);for(let W=0;W<X.length;W++)Y[W]=X.charCodeAt(W);return Y}function IX(Q){let X="";for(let Y=0;Y<Q.length;Y++)X+=String.fromCharCode(Q[Y]);return btoa(X)}function Cz(Q){let X=Q.replace(/-/g,"+").replace(/_/g,"/"),Y="=".repeat((4-X.length%4)%4);return EX(X+Y)}function kz(Q){return IX(Q).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function vz(Q){let X=Q.replace(/^0x/,"");if(X.length%2!==0)throw Error("Invalid hex string length");let Y=new Uint8Array(X.length/2);for(let W=0;W<X.length;W+=2)Y[W/2]=Number.parseInt(X.slice(W,W+2),16);return Y}function xz(Q){return Array.from(Q).map((X)=>X.toString(16).padStart(2,"0")).join("")}class TX{constructor(...Q){}}var SX=(Q,X)=>{Q.name="$ZodError",Object.defineProperty(Q,"_zod",{value:Q._zod,enumerable:!1}),Object.defineProperty(Q,"issues",{value:X,enumerable:!1}),Q.message=JSON.stringify(X,F1,2),Object.defineProperty(Q,"toString",{value:()=>Q.message,enumerable:!1})},x6=F("$ZodError",SX),zQ=F("$ZodError",SX,{Parent:Error});function RX(Q,X=(Y)=>Y.message){let Y={},W=[];for(let G of Q.issues)if(G.path.length>0)Y[G.path[0]]=Y[G.path[0]]||[],Y[G.path[0]].push(X(G));else W.push(X(G));return{formErrors:W,fieldErrors:Y}}function CX(Q,X=(Y)=>Y.message){let Y={_errors:[]},W=(G)=>{for(let J of G.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map(($)=>W({issues:$}));else if(J.code==="invalid_key")W({issues:J.issues});else if(J.code==="invalid_element")W({issues:J.issues});else if(J.path.length===0)Y._errors.push(X(J));else{let $=Y,z=0;while(z<J.path.length){let H=J.path[z];if(z!==J.path.length-1)$[H]=$[H]||{_errors:[]};else $[H]=$[H]||{_errors:[]},$[H]._errors.push(X(J));$=$[H],z++}}};return W(Q),Y}var _6=(Q)=>(X,Y,W,G)=>{let J=W?Object.assign(W,{async:!1}):{async:!1},$=X._zod.run({value:Y,issues:[]},J);if($ instanceof Promise)throw new _0;if($.issues.length){let z=new(G?.Err??Q)($.issues.map((H)=>j0(H,J,M0())));throw k6(z,G?.callee),z}return $.value};var y6=(Q)=>async(X,Y,W,G)=>{let J=W?Object.assign(W,{async:!0}):{async:!0},$=X._zod.run({value:Y,issues:[]},J);if($ instanceof Promise)$=await $;if($.issues.length){let z=new(G?.Err??Q)($.issues.map((H)=>j0(H,J,M0())));throw k6(z,G?.callee),z}return $.value};var u1=(Q)=>(X,Y,W)=>{let G=W?{...W,async:!1}:{async:!1},J=X._zod.run({value:Y,issues:[]},G);if(J instanceof Promise)throw new _0;return J.issues.length?{success:!1,error:new(Q??x6)(J.issues.map(($)=>j0($,G,M0())))}:{success:!0,data:J.value}},f1=u1(zQ),l1=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{async:!0}):{async:!0},J=X._zod.run({value:Y,issues:[]},G);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new Q(J.issues.map(($)=>j0($,G,M0())))}:{success:!0,data:J.value}},g6=l1(zQ),kX=(Q)=>(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return _6(Q)(X,Y,G)};var vX=(Q)=>(X,Y,W)=>{return _6(Q)(X,Y,W)};var xX=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return y6(Q)(X,Y,G)};var _X=(Q)=>async(X,Y,W)=>{return y6(Q)(X,Y,W)};var yX=(Q)=>(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return u1(Q)(X,Y,G)};var gX=(Q)=>(X,Y,W)=>{return u1(Q)(X,Y,W)};var hX=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return l1(Q)(X,Y,G)};var uX=(Q)=>async(X,Y,W)=>{return l1(Q)(X,Y,W)};var fX=/^[cC][^\s-]{8,}$/,lX=/^[0-9a-z]+$/,mX=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,cX=/^[0-9a-vA-V]{20}$/,pX=/^[A-Za-z0-9]{27}$/,iX=/^[a-zA-Z0-9_-]{21}$/,nX=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var dX=/^([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})$/,HQ=(Q)=>{if(!Q)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}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var rX=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function oX(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var tX=/^(?:(?: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])$/,aX=/^(([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}|:))$/,sX=/^((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])$/,eX=/^(([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])$/,Q8=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,BQ=/^[A-Za-z0-9_-]*$/,X8=/^(?=.{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])?)*\.?$/;var Y8=/^\+(?:[0-9]){6,14}[0-9]$/,W8="(?:(?:\\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])))",G8=new RegExp(`^${W8}$`);function J8(Q){return typeof Q.precision==="number"?Q.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":Q.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{${Q.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function $8(Q){return new RegExp(`^${J8(Q)}$`)}function z8(Q){let X=J8({precision:Q.precision}),Y=["Z"];if(Q.local)Y.push("");if(Q.offset)Y.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let W=`${X}(?:${Y.join("|")})`;return new RegExp(`^${W8}T(?:${W})$`)}var H8=(Q)=>{let X=Q?`[\\s\\S]{${Q?.minimum??0},${Q?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${X}$`)};var B8=/^-?\d+$/,K8=/^-?\d+(?:\.\d+)?/,D8=/^(?:true|false)$/i,A8=/^null$/i;var F8=/^[^A-Z]*$/,U8=/^[^a-z]*$/;var Q0=F("$ZodCheck",(Q,X)=>{var Y;Q._zod??(Q._zod={}),Q._zod.def=X,(Y=Q._zod).onattach??(Y.onattach=[])}),L8={number:"number",bigint:"bigint",object:"date"},KQ=F("$ZodCheckLessThan",(Q,X)=>{Q0.init(Q,X);let Y=L8[typeof X.value];Q._zod.onattach.push((W)=>{let G=W._zod.bag,J=(X.inclusive?G.maximum:G.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(X.value<J)if(X.inclusive)G.maximum=X.value;else G.exclusiveMaximum=X.value}),Q._zod.check=(W)=>{if(X.inclusive?W.value<=X.value:W.value<X.value)return;W.issues.push({origin:Y,code:"too_big",maximum:X.value,input:W.value,inclusive:X.inclusive,inst:Q,continue:!X.abort})}}),DQ=F("$ZodCheckGreaterThan",(Q,X)=>{Q0.init(Q,X);let Y=L8[typeof X.value];Q._zod.onattach.push((W)=>{let G=W._zod.bag,J=(X.inclusive?G.minimum:G.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(X.value>J)if(X.inclusive)G.minimum=X.value;else G.exclusiveMinimum=X.value}),Q._zod.check=(W)=>{if(X.inclusive?W.value>=X.value:W.value>X.value)return;W.issues.push({origin:Y,code:"too_small",minimum:X.value,input:W.value,inclusive:X.inclusive,inst:Q,continue:!X.abort})}}),O8=F("$ZodCheckMultipleOf",(Q,X)=>{Q0.init(Q,X),Q._zod.onattach.push((Y)=>{var W;(W=Y._zod.bag).multipleOf??(W.multipleOf=X.value)}),Q._zod.check=(Y)=>{if(typeof Y.value!==typeof X.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof Y.value==="bigint"?Y.value%X.value===BigInt(0):YQ(Y.value,X.value)===0)return;Y.issues.push({origin:typeof Y.value,code:"not_multiple_of",divisor:X.value,input:Y.value,inst:Q,continue:!X.abort})}}),M8=F("$ZodCheckNumberFormat",(Q,X)=>{Q0.init(Q,X),X.format=X.format||"float64";let Y=X.format?.includes("int"),W=Y?"int":"number",[G,J]=$Q[X.format];Q._zod.onattach.push(($)=>{let z=$._zod.bag;if(z.format=X.format,z.minimum=G,z.maximum=J,Y)z.pattern=B8}),Q._zod.check=($)=>{let z=$.value;if(Y){if(!Number.isInteger(z)){$.issues.push({expected:W,format:X.format,code:"invalid_type",continue:!1,input:z,inst:Q});return}if(!Number.isSafeInteger(z)){if(z>0)$.issues.push({input:z,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:W,continue:!X.abort});else $.issues.push({input:z,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:W,continue:!X.abort});return}}if(z<G)$.issues.push({origin:"number",input:z,code:"too_small",minimum:G,inclusive:!0,inst:Q,continue:!X.abort});if(z>J)$.issues.push({origin:"number",input:z,code:"too_big",maximum:J,inst:Q})}});var V8=F("$ZodCheckMaxLength",(Q,X)=>{var Y;Q0.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!y1(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag.maximum??Number.POSITIVE_INFINITY;if(X.maximum<G)W._zod.bag.maximum=X.maximum}),Q._zod.check=(W)=>{let G=W.value;if(G.length<=X.maximum)return;let $=h1(G);W.issues.push({origin:$,code:"too_big",maximum:X.maximum,inclusive:!0,input:G,inst:Q,continue:!X.abort})}}),Z8=F("$ZodCheckMinLength",(Q,X)=>{var Y;Q0.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!y1(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(X.minimum>G)W._zod.bag.minimum=X.minimum}),Q._zod.check=(W)=>{let G=W.value;if(G.length>=X.minimum)return;let $=h1(G);W.issues.push({origin:$,code:"too_small",minimum:X.minimum,inclusive:!0,input:G,inst:Q,continue:!X.abort})}}),N8=F("$ZodCheckLengthEquals",(Q,X)=>{var Y;Q0.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!y1(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.minimum=X.length,G.maximum=X.length,G.length=X.length}),Q._zod.check=(W)=>{let G=W.value,J=G.length;if(J===X.length)return;let $=h1(G),z=J>X.length;W.issues.push({origin:$,...z?{code:"too_big",maximum:X.length}:{code:"too_small",minimum:X.length},inclusive:!0,exact:!0,input:W.value,inst:Q,continue:!X.abort})}}),m1=F("$ZodCheckStringFormat",(Q,X)=>{var Y,W;if(Q0.init(Q,X),Q._zod.onattach.push((G)=>{let J=G._zod.bag;if(J.format=X.format,X.pattern)J.patterns??(J.patterns=new Set),J.patterns.add(X.pattern)}),X.pattern)(Y=Q._zod).check??(Y.check=(G)=>{if(X.pattern.lastIndex=0,X.pattern.test(G.value))return;G.issues.push({origin:"string",code:"invalid_format",format:X.format,input:G.value,...X.pattern?{pattern:X.pattern.toString()}:{},inst:Q,continue:!X.abort})});else(W=Q._zod).check??(W.check=()=>{})}),q8=F("$ZodCheckRegex",(Q,X)=>{m1.init(Q,X),Q._zod.check=(Y)=>{if(X.pattern.lastIndex=0,X.pattern.test(Y.value))return;Y.issues.push({origin:"string",code:"invalid_format",format:"regex",input:Y.value,pattern:X.pattern.toString(),inst:Q,continue:!X.abort})}}),w8=F("$ZodCheckLowerCase",(Q,X)=>{X.pattern??(X.pattern=F8),m1.init(Q,X)}),j8=F("$ZodCheckUpperCase",(Q,X)=>{X.pattern??(X.pattern=U8),m1.init(Q,X)}),P8=F("$ZodCheckIncludes",(Q,X)=>{Q0.init(Q,X);let Y=y0(X.includes),W=new RegExp(typeof X.position==="number"?`^.{${X.position}}${Y}`:Y);X.pattern=W,Q._zod.onattach.push((G)=>{let J=G._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(W)}),Q._zod.check=(G)=>{if(G.value.includes(X.includes,X.position))return;G.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:X.includes,input:G.value,inst:Q,continue:!X.abort})}}),b8=F("$ZodCheckStartsWith",(Q,X)=>{Q0.init(Q,X);let Y=new RegExp(`^${y0(X.prefix)}.*`);X.pattern??(X.pattern=Y),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),Q._zod.check=(W)=>{if(W.value.startsWith(X.prefix))return;W.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:X.prefix,input:W.value,inst:Q,continue:!X.abort})}}),E8=F("$ZodCheckEndsWith",(Q,X)=>{Q0.init(Q,X);let Y=new RegExp(`.*${y0(X.suffix)}$`);X.pattern??(X.pattern=Y),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),Q._zod.check=(W)=>{if(W.value.endsWith(X.suffix))return;W.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:X.suffix,input:W.value,inst:Q,continue:!X.abort})}});var I8=F("$ZodCheckOverwrite",(Q,X)=>{Q0.init(Q,X),Q._zod.check=(Y)=>{Y.value=X.tx(Y.value)}});class AQ{constructor(Q=[]){if(this.content=[],this.indent=0,this)this.args=Q}indented(Q){this.indent+=1,Q(this),this.indent-=1}write(Q){if(typeof Q==="function"){Q(this,{execution:"sync"}),Q(this,{execution:"async"});return}let Y=Q.split(`
|
|
9
|
+
deps: ${Y}}`};var fL={keyword:"dependencies",type:"object",schemaType:"object",error:I5.error,code(Q){let[X,Y]=lL(Q);b5(Q,X),E5(Q,Y)}};function lL({schema:Q}){let X={},Y={};for(let W in Q){if(W==="__proto__")continue;let G=Array.isArray(Q[W])?X:Y;G[W]=Q[W]}return[X,Y]}function b5(Q,X=Q.schema){let{gen:Y,data:W,it:G}=Q;if(Object.keys(X).length===0)return;let J=Y.let("missing");for(let $ in X){let z=X[$];if(z.length===0)continue;let H=(0,b6.propertyInData)(Y,W,$,G.opts.ownProperties);if(Q.setParams({property:$,depsCount:z.length,deps:z.join(", ")}),G.allErrors)Y.if(H,()=>{for(let K of z)(0,b6.checkReportMissingProp)(Q,K)});else Y.if(o9._`${H} && (${(0,b6.checkMissingProp)(Q,z,J)})`),(0,b6.reportMissingProp)(Q,J),Y.else()}}I5.validatePropertyDeps=b5;function E5(Q,X=Q.schema){let{gen:Y,data:W,keyword:G,it:J}=Q,$=Y.name("valid");for(let z in X){if((0,uL.alwaysValidSchema)(J,X[z]))continue;Y.if((0,b6.propertyInData)(Y,W,z,J.opts.ownProperties),()=>{let H=Q.subschema({keyword:G,schemaProp:z},$);Q.mergeValidEvaluated(H,$)},()=>Y.var($,!0)),Q.ok($)}}I5.validateSchemaDeps=E5;I5.default=fL});var v5=N((k5)=>{Object.defineProperty(k5,"__esModule",{value:!0});var C5=k(),pL=u(),iL={message:"property name must be valid",params:({params:Q})=>C5._`{propertyName: ${Q.propertyName}}`},nL={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:iL,code(Q){let{gen:X,schema:Y,data:W,it:G}=Q;if((0,pL.alwaysValidSchema)(G,Y))return;let J=X.name("valid");X.forIn("key",W,($)=>{Q.setParams({propertyName:$}),Q.subschema({keyword:"propertyNames",data:$,dataTypes:["string"],propertyName:$,compositeRule:!0},J),X.if((0,C5.not)(J),()=>{if(Q.error(!0),!G.allErrors)X.break()})}),Q.ok(J)}};k5.default=nL});var t9=N((x5)=>{Object.defineProperty(x5,"__esModule",{value:!0});var m4=N0(),T0=k(),rL=f0(),c4=u(),oL={message:"must NOT have additional properties",params:({params:Q})=>T0._`{additionalProperty: ${Q.additionalProperty}}`},tL={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:oL,code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,errsCount:J,it:$}=Q;if(!J)throw Error("ajv implementation error");let{allErrors:z,opts:H}=$;if($.props=!0,H.removeAdditional!=="all"&&(0,c4.alwaysValidSchema)($,Y))return;let K=(0,m4.allSchemaProperties)(W.properties),B=(0,m4.allSchemaProperties)(W.patternProperties);D(),Q.ok(T0._`${J} === ${rL.default.errors}`);function D(){X.forIn("key",G,(Z)=>{if(!K.length&&!B.length)O(Z);else X.if(U(Z),()=>O(Z))})}function U(Z){let V;if(K.length>8){let T=(0,c4.schemaRefOrVal)($,W.properties,"properties");V=(0,m4.isOwnProperty)(X,T,Z)}else if(K.length)V=(0,T0.or)(...K.map((T)=>T0._`${Z} === ${T}`));else V=T0.nil;if(B.length)V=(0,T0.or)(V,...B.map((T)=>T0._`${(0,m4.usePattern)(Q,T)}.test(${Z})`));return(0,T0.not)(V)}function L(Z){X.code(T0._`delete ${G}[${Z}]`)}function O(Z){if(H.removeAdditional==="all"||H.removeAdditional&&Y===!1){L(Z);return}if(Y===!1){if(Q.setParams({additionalProperty:Z}),Q.error(),!z)X.break();return}if(typeof Y=="object"&&!(0,c4.alwaysValidSchema)($,Y)){let V=X.name("valid");if(H.removeAdditional==="failing")M(Z,V,!1),X.if((0,T0.not)(V),()=>{Q.reset(),L(Z)});else if(M(Z,V),!z)X.if((0,T0.not)(V),()=>X.break())}}function M(Z,V,T){let E={keyword:"additionalProperties",dataProp:Z,dataPropType:c4.Type.Str};if(T===!1)Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1});Q.subschema(E,V)}}};x5.default=tL});var g5=N((h5)=>{Object.defineProperty(h5,"__esModule",{value:!0});var sL=F6(),_5=N0(),a9=u(),y5=t9(),eL={keyword:"properties",type:"object",schemaType:"object",code(Q){let{gen:X,schema:Y,parentSchema:W,data:G,it:J}=Q;if(J.opts.removeAdditional==="all"&&W.additionalProperties===void 0)y5.default.code(new sL.KeywordCxt(J,y5.default,"additionalProperties"));let $=(0,_5.allSchemaProperties)(Y);for(let D of $)J.definedProperties.add(D);if(J.opts.unevaluated&&$.length&&J.props!==!0)J.props=a9.mergeEvaluated.props(X,(0,a9.toHash)($),J.props);let z=$.filter((D)=>!(0,a9.alwaysValidSchema)(J,Y[D]));if(z.length===0)return;let H=X.name("valid");for(let D of z){if(K(D))B(D);else{if(X.if((0,_5.propertyInData)(X,G,D,J.opts.ownProperties)),B(D),!J.allErrors)X.else().var(H,!0);X.endIf()}Q.it.definedProperties.add(D),Q.ok(H)}function K(D){return J.opts.useDefaults&&!J.compositeRule&&Y[D].default!==void 0}function B(D){Q.subschema({keyword:"properties",schemaProp:D,dataProp:D},H)}}};h5.default=eL});var c5=N((m5)=>{Object.defineProperty(m5,"__esModule",{value:!0});var u5=N0(),p4=k(),f5=u(),l5=u(),XO={keyword:"patternProperties",type:"object",schemaType:"object",code(Q){let{gen:X,schema:Y,data:W,parentSchema:G,it:J}=Q,{opts:$}=J,z=(0,u5.allSchemaProperties)(Y),H=z.filter((M)=>(0,f5.alwaysValidSchema)(J,Y[M]));if(z.length===0||H.length===z.length&&(!J.opts.unevaluated||J.props===!0))return;let K=$.strictSchema&&!$.allowMatchingProperties&&G.properties,B=X.name("valid");if(J.props!==!0&&!(J.props instanceof p4.Name))J.props=(0,l5.evaluatedPropsToName)(X,J.props);let{props:D}=J;U();function U(){for(let M of z){if(K)L(M);if(J.allErrors)O(M);else X.var(B,!0),O(M),X.if(B)}}function L(M){for(let Z in K)if(new RegExp(M).test(Z))(0,f5.checkStrictMode)(J,`property ${Z} matches pattern ${M} (use allowMatchingProperties)`)}function O(M){X.forIn("key",W,(Z)=>{X.if(p4._`${(0,u5.usePattern)(Q,M)}.test(${Z})`,()=>{let V=H.includes(M);if(!V)Q.subschema({keyword:"patternProperties",schemaProp:M,dataProp:Z,dataPropType:l5.Type.Str},B);if(J.opts.unevaluated&&D!==!0)X.assign(p4._`${D}[${Z}]`,!0);else if(!V&&!J.allErrors)X.if((0,p4.not)(B),()=>X.break())})})}}};m5.default=XO});var i5=N((p5)=>{Object.defineProperty(p5,"__esModule",{value:!0});var WO=u(),GO={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Q){let{gen:X,schema:Y,it:W}=Q;if((0,WO.alwaysValidSchema)(W,Y)){Q.fail();return}let G=X.name("valid");Q.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},G),Q.failResult(G,()=>Q.reset(),()=>Q.error())},error:{message:"must NOT be valid"}};p5.default=GO});var d5=N((n5)=>{Object.defineProperty(n5,"__esModule",{value:!0});var $O=N0(),zO={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:$O.validateUnion,error:{message:"must match a schema in anyOf"}};n5.default=zO});var o5=N((r5)=>{Object.defineProperty(r5,"__esModule",{value:!0});var i4=k(),KO=u(),BO={message:"must match exactly one schema in oneOf",params:({params:Q})=>i4._`{passingSchemas: ${Q.passing}}`},DO={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:BO,code(Q){let{gen:X,schema:Y,parentSchema:W,it:G}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");if(G.opts.discriminator&&W.discriminator)return;let J=Y,$=X.let("valid",!1),z=X.let("passing",null),H=X.name("_valid");Q.setParams({passing:z}),X.block(K),Q.result($,()=>Q.reset(),()=>Q.error(!0));function K(){J.forEach((B,D)=>{let U;if((0,KO.alwaysValidSchema)(G,B))X.var(H,!0);else U=Q.subschema({keyword:"oneOf",schemaProp:D,compositeRule:!0},H);if(D>0)X.if(i4._`${H} && ${$}`).assign($,!1).assign(z,i4._`[${z}, ${D}]`).else();X.if(H,()=>{if(X.assign($,!0),X.assign(z,D),U)Q.mergeEvaluated(U,i4.Name)})})}}};r5.default=DO});var a5=N((t5)=>{Object.defineProperty(t5,"__esModule",{value:!0});var FO=u(),UO={keyword:"allOf",schemaType:"array",code(Q){let{gen:X,schema:Y,it:W}=Q;if(!Array.isArray(Y))throw Error("ajv implementation error");let G=X.name("valid");Y.forEach((J,$)=>{if((0,FO.alwaysValidSchema)(W,J))return;let z=Q.subschema({keyword:"allOf",schemaProp:$},G);Q.ok(G),Q.mergeEvaluated(z)})}};t5.default=UO});var X$=N((Q$)=>{Object.defineProperty(Q$,"__esModule",{value:!0});var n4=k(),e5=u(),OO={message:({params:Q})=>n4.str`must match "${Q.ifClause}" schema`,params:({params:Q})=>n4._`{failingKeyword: ${Q.ifClause}}`},MO={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:OO,code(Q){let{gen:X,parentSchema:Y,it:W}=Q;if(Y.then===void 0&&Y.else===void 0)(0,e5.checkStrictMode)(W,'"if" without "then" and "else" is ignored');let G=s5(W,"then"),J=s5(W,"else");if(!G&&!J)return;let $=X.let("valid",!0),z=X.name("_valid");if(H(),Q.reset(),G&&J){let B=X.let("ifClause");Q.setParams({ifClause:B}),X.if(z,K("then",B),K("else",B))}else if(G)X.if(z,K("then"));else X.if((0,n4.not)(z),K("else"));Q.pass($,()=>Q.error(!0));function H(){let B=Q.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);Q.mergeEvaluated(B)}function K(B,D){return()=>{let U=Q.subschema({keyword:B},z);if(X.assign($,z),Q.mergeValidEvaluated(U,$),D)X.assign(D,n4._`${B}`);else Q.setParams({ifClause:B})}}}};function s5(Q,X){let Y=Q.schema[X];return Y!==void 0&&!(0,e5.alwaysValidSchema)(Q,Y)}Q$.default=MO});var W$=N((Y$)=>{Object.defineProperty(Y$,"__esModule",{value:!0});var ZO=u(),NO={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Q,parentSchema:X,it:Y}){if(X.if===void 0)(0,ZO.checkStrictMode)(Y,`"${Q}" without "if" is ignored`)}};Y$.default=NO});var J$=N((G$)=>{Object.defineProperty(G$,"__esModule",{value:!0});var wO=d9(),jO=Z5(),PO=r9(),bO=w5(),EO=P5(),IO=R5(),TO=v5(),SO=t9(),RO=g5(),CO=c5(),kO=i5(),vO=d5(),xO=o5(),_O=a5(),yO=X$(),hO=W$();function gO(Q=!1){let X=[kO.default,vO.default,xO.default,_O.default,yO.default,hO.default,TO.default,SO.default,IO.default,RO.default,CO.default];if(Q)X.push(jO.default,bO.default);else X.push(wO.default,PO.default);return X.push(EO.default),X}G$.default=gO});var z$=N(($$)=>{Object.defineProperty($$,"__esModule",{value:!0});var s=k(),fO={message:({schemaCode:Q})=>s.str`must match format "${Q}"`,params:({schemaCode:Q})=>s._`{format: ${Q}}`},lO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:fO,code(Q,X){let{gen:Y,data:W,$data:G,schema:J,schemaCode:$,it:z}=Q,{opts:H,errSchemaPath:K,schemaEnv:B,self:D}=z;if(!H.validateFormats)return;if(G)U();else L();function U(){let O=Y.scopeValue("formats",{ref:D.formats,code:H.code.formats}),M=Y.const("fDef",s._`${O}[${$}]`),Z=Y.let("fType"),V=Y.let("format");Y.if(s._`typeof ${M} == "object" && !(${M} instanceof RegExp)`,()=>Y.assign(Z,s._`${M}.type || "string"`).assign(V,s._`${M}.validate`),()=>Y.assign(Z,s._`"string"`).assign(V,M)),Q.fail$data((0,s.or)(T(),E()));function T(){if(H.strictSchema===!1)return s.nil;return s._`${$} && !${V}`}function E(){let v=B.$async?s._`(${M}.async ? await ${V}(${W}) : ${V}(${W}))`:s._`${V}(${W})`,I=s._`(typeof ${V} == "function" ? ${v} : ${V}.test(${W}))`;return s._`${V} && ${V} !== true && ${Z} === ${X} && !${I}`}}function L(){let O=D.formats[J];if(!O){T();return}if(O===!0)return;let[M,Z,V]=E(O);if(M===X)Q.pass(v());function T(){if(H.strictSchema===!1){D.logger.warn(I());return}throw Error(I());function I(){return`unknown format "${J}" ignored in schema at path "${K}"`}}function E(I){let R0=I instanceof RegExp?(0,s.regexpCode)(I):H.code.formats?s._`${H.code.formats}${(0,s.getProperty)(J)}`:void 0,x0=Y.scopeValue("formats",{key:J,ref:I,code:R0});if(typeof I=="object"&&!(I instanceof RegExp))return[I.type||"string",I.validate,s._`${x0}.validate`];return["string",I,x0]}function v(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!B.$async)throw Error("async format in sync schema");return s._`await ${V}(${W})`}return typeof Z=="function"?s._`${V}(${W})`:s._`${V}.test(${W})`}}}};$$.default=lO});var K$=N((H$)=>{Object.defineProperty(H$,"__esModule",{value:!0});var cO=z$(),pO=[cO.default];H$.default=pO});var A$=N((B$)=>{Object.defineProperty(B$,"__esModule",{value:!0});B$.contentVocabulary=B$.metadataVocabulary=void 0;B$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];B$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var L$=N((U$)=>{Object.defineProperty(U$,"__esModule",{value:!0});var dO=h7(),rO=B5(),oO=J$(),tO=K$(),F$=A$(),aO=[dO.default,rO.default,(0,oO.default)(),tO.default,F$.metadataVocabulary,F$.contentVocabulary];U$.default=aO});var Z$=N((M$)=>{Object.defineProperty(M$,"__esModule",{value:!0});M$.DiscrError=void 0;var O$;(function(Q){Q.Tag="tag",Q.Mapping="mapping"})(O$||(M$.DiscrError=O$={}))});var w$=N((q$)=>{Object.defineProperty(q$,"__esModule",{value:!0});var S1=k(),s9=Z$(),N$=I4(),eO=U6(),QM=u(),XM={message:({params:{discrError:Q,tagName:X}})=>Q===s9.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:Q,tag:X,tagName:Y}})=>S1._`{error: ${Q}, tag: ${Y}, tagValue: ${X}}`},YM={keyword:"discriminator",type:"object",schemaType:"object",error:XM,code(Q){let{gen:X,data:Y,schema:W,parentSchema:G,it:J}=Q,{oneOf:$}=G;if(!J.opts.discriminator)throw Error("discriminator: requires discriminator option");let z=W.propertyName;if(typeof z!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!$)throw Error("discriminator: requires oneOf keyword");let H=X.let("valid",!1),K=X.const("tag",S1._`${Y}${(0,S1.getProperty)(z)}`);X.if(S1._`typeof ${K} == "string"`,()=>B(),()=>Q.error(!1,{discrError:s9.DiscrError.Tag,tag:K,tagName:z})),Q.ok(H);function B(){let L=U();X.if(!1);for(let O in L)X.elseIf(S1._`${K} === ${O}`),X.assign(H,D(L[O]));X.else(),Q.error(!1,{discrError:s9.DiscrError.Mapping,tag:K,tagName:z}),X.endIf()}function D(L){let O=X.name("valid"),M=Q.subschema({keyword:"oneOf",schemaProp:L},O);return Q.mergeEvaluated(M,S1.Name),O}function U(){var L;let O={},M=V(G),Z=!0;for(let v=0;v<$.length;v++){let I=$[v];if((I===null||I===void 0?void 0:I.$ref)&&!(0,QM.schemaHasRulesButRef)(I,J.self.RULES)){let x0=I.$ref;if(I=N$.resolveRef.call(J.self,J.schemaEnv.root,J.baseId,x0),I instanceof N$.SchemaEnv)I=I.schema;if(I===void 0)throw new eO.default(J.opts.uriResolver,J.baseId,x0)}let R0=(L=I===null||I===void 0?void 0:I.properties)===null||L===void 0?void 0:L[z];if(typeof R0!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${z}"`);Z=Z&&(M||V(I)),T(R0,v)}if(!Z)throw Error(`discriminator: "${z}" must be required`);return O;function V({required:v}){return Array.isArray(v)&&v.includes(z)}function T(v,I){if(v.const)E(v.const,I);else if(v.enum)for(let R0 of v.enum)E(R0,I);else throw Error(`discriminator: "properties/${z}" must have "const" or "enum"`)}function E(v,I){if(typeof v!="string"||v in O)throw Error(`discriminator: "${z}" values must be unique strings`);O[v]=I}}}};q$.default=YM});var j$=N((zb,GM)=>{GM.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 QX=N((U0,e9)=>{Object.defineProperty(U0,"__esModule",{value:!0});U0.MissingRefError=U0.ValidationError=U0.CodeGen=U0.Name=U0.nil=U0.stringify=U0.str=U0._=U0.KeywordCxt=U0.Ajv=void 0;var JM=I7(),$M=L$(),zM=w$(),P$=j$(),HM=["/properties"],d4="http://json-schema.org/draft-07/schema";class E6 extends JM.default{_addVocabularies(){if(super._addVocabularies(),$M.default.forEach((Q)=>this.addVocabulary(Q)),this.opts.discriminator)this.addKeyword(zM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Q=this.opts.$data?this.$dataMetaSchema(P$,HM):P$;this.addMetaSchema(Q,d4,!1),this.refs["http://json-schema.org/schema"]=d4}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(d4)?d4:void 0)}}U0.Ajv=E6;e9.exports=U0=E6;e9.exports.Ajv=E6;Object.defineProperty(U0,"__esModule",{value:!0});U0.default=E6;var KM=F6();Object.defineProperty(U0,"KeywordCxt",{enumerable:!0,get:function(){return KM.KeywordCxt}});var R1=k();Object.defineProperty(U0,"_",{enumerable:!0,get:function(){return R1._}});Object.defineProperty(U0,"str",{enumerable:!0,get:function(){return R1.str}});Object.defineProperty(U0,"stringify",{enumerable:!0,get:function(){return R1.stringify}});Object.defineProperty(U0,"nil",{enumerable:!0,get:function(){return R1.nil}});Object.defineProperty(U0,"Name",{enumerable:!0,get:function(){return R1.Name}});Object.defineProperty(U0,"CodeGen",{enumerable:!0,get:function(){return R1.CodeGen}});var BM=b4();Object.defineProperty(U0,"ValidationError",{enumerable:!0,get:function(){return BM.default}});var DM=U6();Object.defineProperty(U0,"MissingRefError",{enumerable:!0,get:function(){return DM.default}})});var x$=N((k$)=>{Object.defineProperty(k$,"__esModule",{value:!0});k$.formatNames=k$.fastFormats=k$.fullFormats=void 0;function v0(Q,X){return{validate:Q,compare:X}}k$.fullFormats={date:v0(T$,GX),time:v0(YX(!0),JX),"date-time":v0(b$(!0),R$),"iso-time":v0(YX(),S$),"iso-date-time":v0(b$(),C$),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:ZM,"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:EM,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:NM,int32:{type:"number",validate:jM},int64:{type:"number",validate:PM},float:{type:"number",validate:I$},double:{type:"number",validate:I$},password:!0,binary:!0};k$.fastFormats={...k$.fullFormats,date:v0(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,GX),time:v0(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,JX),"date-time":v0(/^\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,R$),"iso-time":v0(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,S$),"iso-date-time":v0(/^\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,C$),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};k$.formatNames=Object.keys(k$.fullFormats);function UM(Q){return Q%4===0&&(Q%100!==0||Q%400===0)}var LM=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,OM=[0,31,28,31,30,31,30,31,31,30,31,30,31];function T$(Q){let X=LM.exec(Q);if(!X)return!1;let Y=+X[1],W=+X[2],G=+X[3];return W>=1&&W<=12&&G>=1&&G<=(W===2&&UM(Y)?29:OM[W])}function GX(Q,X){if(!(Q&&X))return;if(Q>X)return 1;if(Q<X)return-1;return 0}var XX=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function YX(Q){return function(Y){let W=XX.exec(Y);if(!W)return!1;let G=+W[1],J=+W[2],$=+W[3],z=W[4],H=W[5]==="-"?-1:1,K=+(W[6]||0),B=+(W[7]||0);if(K>23||B>59||Q&&!z)return!1;if(G<=23&&J<=59&&$<60)return!0;let D=J-B*H,U=G-K*H-(D<0?1:0);return(U===23||U===-1)&&(D===59||D===-1)&&$<61}}function JX(Q,X){if(!(Q&&X))return;let Y=new Date("2020-01-01T"+Q).valueOf(),W=new Date("2020-01-01T"+X).valueOf();if(!(Y&&W))return;return Y-W}function S$(Q,X){if(!(Q&&X))return;let Y=XX.exec(Q),W=XX.exec(X);if(!(Y&&W))return;if(Q=Y[1]+Y[2]+Y[3],X=W[1]+W[2]+W[3],Q>X)return 1;if(Q<X)return-1;return 0}var WX=/t|\s/i;function b$(Q){let X=YX(Q);return function(W){let G=W.split(WX);return G.length===2&&T$(G[0])&&X(G[1])}}function R$(Q,X){if(!(Q&&X))return;let Y=new Date(Q).valueOf(),W=new Date(X).valueOf();if(!(Y&&W))return;return Y-W}function C$(Q,X){if(!(Q&&X))return;let[Y,W]=Q.split(WX),[G,J]=X.split(WX),$=GX(Y,G);if($===void 0)return;return $||JX(W,J)}var MM=/\/|:/,VM=/^(?:[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 ZM(Q){return MM.test(Q)&&VM.test(Q)}var E$=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function NM(Q){return E$.lastIndex=0,E$.test(Q)}var qM=-2147483648,wM=2147483647;function jM(Q){return Number.isInteger(Q)&&Q<=wM&&Q>=qM}function PM(Q){return Number.isInteger(Q)}function I$(){return!0}var bM=/[^\\]\\Z/;function EM(Q){if(bM.test(Q))return!1;try{return new RegExp(Q),!0}catch(X){return!1}}});var y$=N((_$)=>{Object.defineProperty(_$,"__esModule",{value:!0});_$.formatLimitDefinition=void 0;var TM=QX(),S0=k(),W1=S0.operators,r4={formatMaximum:{okStr:"<=",ok:W1.LTE,fail:W1.GT},formatMinimum:{okStr:">=",ok:W1.GTE,fail:W1.LT},formatExclusiveMaximum:{okStr:"<",ok:W1.LT,fail:W1.GTE},formatExclusiveMinimum:{okStr:">",ok:W1.GT,fail:W1.LTE}},SM={message:({keyword:Q,schemaCode:X})=>S0.str`should be ${r4[Q].okStr} ${X}`,params:({keyword:Q,schemaCode:X})=>S0._`{comparison: ${r4[Q].okStr}, limit: ${X}}`};_$.formatLimitDefinition={keyword:Object.keys(r4),type:"string",schemaType:"string",$data:!0,error:SM,code(Q){let{gen:X,data:Y,schemaCode:W,keyword:G,it:J}=Q,{opts:$,self:z}=J;if(!$.validateFormats)return;let H=new TM.KeywordCxt(J,z.RULES.all.format.definition,"format");if(H.$data)K();else B();function K(){let U=X.scopeValue("formats",{ref:z.formats,code:$.code.formats}),L=X.const("fmt",S0._`${U}[${H.schemaCode}]`);Q.fail$data((0,S0.or)(S0._`typeof ${L} != "object"`,S0._`${L} instanceof RegExp`,S0._`typeof ${L}.compare != "function"`,D(L)))}function B(){let U=H.schema,L=z.formats[U];if(!L||L===!0)return;if(typeof L!="object"||L instanceof RegExp||typeof L.compare!="function")throw Error(`"${G}": format "${U}" does not define "compare" function`);let O=X.scopeValue("formats",{key:U,ref:L,code:$.code.formats?S0._`${$.code.formats}${(0,S0.getProperty)(U)}`:void 0});Q.fail$data(D(O))}function D(U){return S0._`${U}.compare(${Y}, ${W}) ${r4[G].fail} 0`}},dependencies:["format"]};var RM=(Q)=>{return Q.addKeyword(_$.formatLimitDefinition),Q};_$.default=RM});var f$=N((I6,u$)=>{Object.defineProperty(I6,"__esModule",{value:!0});var C1=x$(),kM=y$(),HX=k(),h$=new HX.Name("fullFormats"),vM=new HX.Name("fastFormats"),KX=(Q,X={keywords:!0})=>{if(Array.isArray(X))return g$(Q,X,C1.fullFormats,h$),Q;let[Y,W]=X.mode==="fast"?[C1.fastFormats,vM]:[C1.fullFormats,h$],G=X.formats||C1.formatNames;if(g$(Q,G,Y,W),X.keywords)(0,kM.default)(Q);return Q};KX.get=(Q,X="full")=>{let W=(X==="fast"?C1.fastFormats:C1.fullFormats)[Q];if(!W)throw Error(`Unknown format "${Q}"`);return W};function g$(Q,X,Y,W){var G,J;(G=(J=Q.opts.code).formats)!==null&&G!==void 0||(J.formats=HX._`require("ajv-formats/dist/formats").${W}`);for(let $ of X)Q.addFormat($,Y[$])}u$.exports=I6=KX;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=KX});var rM=Object.freeze({status:"aborted"});function F(Q,X,Y){function W(z,H){var K;Object.defineProperty(z,"_zod",{value:z._zod??{},enumerable:!1}),(K=z._zod).traits??(K.traits=new Set),z._zod.traits.add(Q),X(z,H);for(let B in $.prototype)if(!(B in z))Object.defineProperty(z,B,{value:$.prototype[B].bind(z)});z._zod.constr=$,z._zod.def=H}let G=Y?.Parent??Object;class J extends G{}Object.defineProperty(J,"name",{value:Q});function $(z){var H;let K=Y?.Parent?new J:this;W(K,z),(H=K._zod).deferred??(H.deferred=[]);for(let B of K._zod.deferred)B();return K}return Object.defineProperty($,"init",{value:W}),Object.defineProperty($,Symbol.hasInstance,{value:(z)=>{if(Y?.Parent&&z instanceof Y.Parent)return!0;return z?._zod?.traits?.has(Q)}}),Object.defineProperty($,"name",{value:Q}),$}var oM=Symbol("zod_brand");class _0 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class x1 extends Error{constructor(Q){super(`Encountered unidirectional transform during encode: ${Q}`);this.name="ZodEncodeError"}}var S6={};function M0(Q){if(Q)Object.assign(S6,Q);return S6}var g={};qX(g,{unwrapMessage:()=>_1,uint8ArrayToHex:()=>_z,uint8ArrayToBase64url:()=>vz,uint8ArrayToBase64:()=>TX,stringifyPrimitive:()=>v6,shallowClone:()=>jX,safeExtend:()=>Iz,required:()=>Rz,randomString:()=>Nz,propertyKeyTypes:()=>JQ,promiseAllObject:()=>Zz,primitiveTypes:()=>PX,prefixIssues:()=>h0,pick:()=>Pz,partial:()=>Sz,optionalKeys:()=>$Q,omit:()=>bz,objectClone:()=>Oz,numKeys:()=>qz,nullish:()=>y1,normalizeParams:()=>b,mergeDefs:()=>i0,merge:()=>Tz,jsonStringifyReplacer:()=>F1,joinValues:()=>R6,issue:()=>L1,isPlainObject:()=>n0,isObject:()=>G1,hexToUint8Array:()=>xz,getSizableOrigin:()=>EX,getParsedType:()=>wz,getLengthableOrigin:()=>g1,getEnumValues:()=>YQ,getElementAtPath:()=>Vz,floatSafeRemainder:()=>WQ,finalizeIssue:()=>j0,extend:()=>Ez,escapeRegex:()=>y0,esc:()=>C6,defineLazy:()=>l,createTransparentProxy:()=>jz,cloneDef:()=>Mz,clone:()=>w0,cleanRegex:()=>h1,cleanEnum:()=>Cz,captureStackTrace:()=>k6,cached:()=>U1,base64urlToUint8Array:()=>kz,base64ToUint8Array:()=>IX,assignProp:()=>p0,assertNotEqual:()=>Az,assertNever:()=>Uz,assertIs:()=>Fz,assertEqual:()=>Dz,assert:()=>Lz,allowsEval:()=>GQ,aborted:()=>d0,NUMBER_FORMAT_RANGES:()=>zQ,Class:()=>SX,BIGINT_FORMAT_RANGES:()=>bX});function Dz(Q){return Q}function Az(Q){return Q}function Fz(Q){}function Uz(Q){throw Error()}function Lz(Q){}function YQ(Q){let X=Object.values(Q).filter((W)=>typeof W==="number");return Object.entries(Q).filter(([W,G])=>X.indexOf(+W)===-1).map(([W,G])=>G)}function R6(Q,X="|"){return Q.map((Y)=>v6(Y)).join(X)}function F1(Q,X){if(typeof X==="bigint")return X.toString();return X}function U1(Q){return{get value(){{let Y=Q();return Object.defineProperty(this,"value",{value:Y}),Y}throw Error("cached value already set")}}}function y1(Q){return Q===null||Q===void 0}function h1(Q){let X=Q.startsWith("^")?1:0,Y=Q.endsWith("$")?Q.length-1:Q.length;return Q.slice(X,Y)}function WQ(Q,X){let Y=(Q.toString().split(".")[1]||"").length,W=X.toString(),G=(W.split(".")[1]||"").length;if(G===0&&/\d?e-\d?/.test(W)){let H=W.match(/\d?e-(\d?)/);if(H?.[1])G=Number.parseInt(H[1])}let J=Y>G?Y:G,$=Number.parseInt(Q.toFixed(J).replace(".","")),z=Number.parseInt(X.toFixed(J).replace(".",""));return $%z/10**J}var wX=Symbol("evaluating");function l(Q,X,Y){let W=void 0;Object.defineProperty(Q,X,{get(){if(W===wX)return;if(W===void 0)W=wX,W=Y();return W},set(G){Object.defineProperty(Q,X,{value:G})},configurable:!0})}function Oz(Q){return Object.create(Object.getPrototypeOf(Q),Object.getOwnPropertyDescriptors(Q))}function p0(Q,X,Y){Object.defineProperty(Q,X,{value:Y,writable:!0,enumerable:!0,configurable:!0})}function i0(...Q){let X={};for(let Y of Q){let W=Object.getOwnPropertyDescriptors(Y);Object.assign(X,W)}return Object.defineProperties({},X)}function Mz(Q){return i0(Q._zod.def)}function Vz(Q,X){if(!X)return Q;return X.reduce((Y,W)=>Y?.[W],Q)}function Zz(Q){let X=Object.keys(Q),Y=X.map((W)=>Q[W]);return Promise.all(Y).then((W)=>{let G={};for(let J=0;J<X.length;J++)G[X[J]]=W[J];return G})}function Nz(Q=10){let Y="";for(let W=0;W<Q;W++)Y+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Y}function C6(Q){return JSON.stringify(Q)}var k6="captureStackTrace"in Error?Error.captureStackTrace:(...Q)=>{};function G1(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}var GQ=U1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(Q){return!1}});function n0(Q){if(G1(Q)===!1)return!1;let X=Q.constructor;if(X===void 0)return!0;let Y=X.prototype;if(G1(Y)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Y,"isPrototypeOf")===!1)return!1;return!0}function jX(Q){if(n0(Q))return{...Q};if(Array.isArray(Q))return[...Q];return Q}function qz(Q){let X=0;for(let Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))X++;return X}var wz=(Q)=>{let X=typeof Q;switch(X){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(Q)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Q.then&&typeof Q.then==="function"&&Q.catch&&typeof Q.catch==="function")return"promise";if(typeof Map<"u"&&Q instanceof Map)return"map";if(typeof Set<"u"&&Q instanceof Set)return"set";if(typeof Date<"u"&&Q instanceof Date)return"date";if(typeof File<"u"&&Q instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${X}`)}},JQ=new Set(["string","number","symbol"]),PX=new Set(["string","number","bigint","boolean","symbol","undefined"]);function y0(Q){return Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w0(Q,X,Y){let W=new Q._zod.constr(X??Q._zod.def);if(!X||Y?.parent)W._zod.parent=Q;return W}function b(Q){let X=Q;if(!X)return{};if(typeof X==="string")return{error:()=>X};if(X?.message!==void 0){if(X?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");X.error=X.message}if(delete X.message,typeof X.error==="string")return{...X,error:()=>X.error};return X}function jz(Q){let X;return new Proxy({},{get(Y,W,G){return X??(X=Q()),Reflect.get(X,W,G)},set(Y,W,G,J){return X??(X=Q()),Reflect.set(X,W,G,J)},has(Y,W){return X??(X=Q()),Reflect.has(X,W)},deleteProperty(Y,W){return X??(X=Q()),Reflect.deleteProperty(X,W)},ownKeys(Y){return X??(X=Q()),Reflect.ownKeys(X)},getOwnPropertyDescriptor(Y,W){return X??(X=Q()),Reflect.getOwnPropertyDescriptor(X,W)},defineProperty(Y,W,G){return X??(X=Q()),Reflect.defineProperty(X,W,G)}})}function v6(Q){if(typeof Q==="bigint")return Q.toString()+"n";if(typeof Q==="string")return`"${Q}"`;return`${Q}`}function $Q(Q){return Object.keys(Q).filter((X)=>{return Q[X]._zod.optin==="optional"&&Q[X]._zod.optout==="optional"})}var zQ={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]},bX={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Pz(Q,X){let Y=Q._zod.def,W=i0(Q._zod.def,{get shape(){let G={};for(let J in X){if(!(J in Y.shape))throw Error(`Unrecognized key: "${J}"`);if(!X[J])continue;G[J]=Y.shape[J]}return p0(this,"shape",G),G},checks:[]});return w0(Q,W)}function bz(Q,X){let Y=Q._zod.def,W=i0(Q._zod.def,{get shape(){let G={...Q._zod.def.shape};for(let J in X){if(!(J in Y.shape))throw Error(`Unrecognized key: "${J}"`);if(!X[J])continue;delete G[J]}return p0(this,"shape",G),G},checks:[]});return w0(Q,W)}function Ez(Q,X){if(!n0(X))throw Error("Invalid input to extend: expected a plain object");let Y=Q._zod.def.checks;if(Y&&Y.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let G=i0(Q._zod.def,{get shape(){let J={...Q._zod.def.shape,...X};return p0(this,"shape",J),J},checks:[]});return w0(Q,G)}function Iz(Q,X){if(!n0(X))throw Error("Invalid input to safeExtend: expected a plain object");let Y={...Q._zod.def,get shape(){let W={...Q._zod.def.shape,...X};return p0(this,"shape",W),W},checks:Q._zod.def.checks};return w0(Q,Y)}function Tz(Q,X){let Y=i0(Q._zod.def,{get shape(){let W={...Q._zod.def.shape,...X._zod.def.shape};return p0(this,"shape",W),W},get catchall(){return X._zod.def.catchall},checks:[]});return w0(Q,Y)}function Sz(Q,X,Y){let W=i0(X._zod.def,{get shape(){let G=X._zod.def.shape,J={...G};if(Y)for(let $ in Y){if(!($ in G))throw Error(`Unrecognized key: "${$}"`);if(!Y[$])continue;J[$]=Q?new Q({type:"optional",innerType:G[$]}):G[$]}else for(let $ in G)J[$]=Q?new Q({type:"optional",innerType:G[$]}):G[$];return p0(this,"shape",J),J},checks:[]});return w0(X,W)}function Rz(Q,X,Y){let W=i0(X._zod.def,{get shape(){let G=X._zod.def.shape,J={...G};if(Y)for(let $ in Y){if(!($ in J))throw Error(`Unrecognized key: "${$}"`);if(!Y[$])continue;J[$]=new Q({type:"nonoptional",innerType:G[$]})}else for(let $ in G)J[$]=new Q({type:"nonoptional",innerType:G[$]});return p0(this,"shape",J),J},checks:[]});return w0(X,W)}function d0(Q,X=0){if(Q.aborted===!0)return!0;for(let Y=X;Y<Q.issues.length;Y++)if(Q.issues[Y]?.continue!==!0)return!0;return!1}function h0(Q,X){return X.map((Y)=>{var W;return(W=Y).path??(W.path=[]),Y.path.unshift(Q),Y})}function _1(Q){return typeof Q==="string"?Q:Q?.message}function j0(Q,X,Y){let W={...Q,path:Q.path??[]};if(!Q.message){let G=_1(Q.inst?._zod.def?.error?.(Q))??_1(X?.error?.(Q))??_1(Y.customError?.(Q))??_1(Y.localeError?.(Q))??"Invalid input";W.message=G}if(delete W.inst,delete W.continue,!X?.reportInput)delete W.input;return W}function EX(Q){if(Q instanceof Set)return"set";if(Q instanceof Map)return"map";if(Q instanceof File)return"file";return"unknown"}function g1(Q){if(Array.isArray(Q))return"array";if(typeof Q==="string")return"string";return"unknown"}function L1(...Q){let[X,Y,W]=Q;if(typeof X==="string")return{message:X,code:"custom",input:Y,inst:W};return{...X}}function Cz(Q){return Object.entries(Q).filter(([X,Y])=>{return Number.isNaN(Number.parseInt(X,10))}).map((X)=>X[1])}function IX(Q){let X=atob(Q),Y=new Uint8Array(X.length);for(let W=0;W<X.length;W++)Y[W]=X.charCodeAt(W);return Y}function TX(Q){let X="";for(let Y=0;Y<Q.length;Y++)X+=String.fromCharCode(Q[Y]);return btoa(X)}function kz(Q){let X=Q.replace(/-/g,"+").replace(/_/g,"/"),Y="=".repeat((4-X.length%4)%4);return IX(X+Y)}function vz(Q){return TX(Q).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xz(Q){let X=Q.replace(/^0x/,"");if(X.length%2!==0)throw Error("Invalid hex string length");let Y=new Uint8Array(X.length/2);for(let W=0;W<X.length;W+=2)Y[W/2]=Number.parseInt(X.slice(W,W+2),16);return Y}function _z(Q){return Array.from(Q).map((X)=>X.toString(16).padStart(2,"0")).join("")}class SX{constructor(...Q){}}var RX=(Q,X)=>{Q.name="$ZodError",Object.defineProperty(Q,"_zod",{value:Q._zod,enumerable:!1}),Object.defineProperty(Q,"issues",{value:X,enumerable:!1}),Q.message=JSON.stringify(X,F1,2),Object.defineProperty(Q,"toString",{value:()=>Q.message,enumerable:!1})},x6=F("$ZodError",RX),HQ=F("$ZodError",RX,{Parent:Error});function CX(Q,X=(Y)=>Y.message){let Y={},W=[];for(let G of Q.issues)if(G.path.length>0)Y[G.path[0]]=Y[G.path[0]]||[],Y[G.path[0]].push(X(G));else W.push(X(G));return{formErrors:W,fieldErrors:Y}}function kX(Q,X=(Y)=>Y.message){let Y={_errors:[]},W=(G)=>{for(let J of G.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map(($)=>W({issues:$}));else if(J.code==="invalid_key")W({issues:J.issues});else if(J.code==="invalid_element")W({issues:J.issues});else if(J.path.length===0)Y._errors.push(X(J));else{let $=Y,z=0;while(z<J.path.length){let H=J.path[z];if(z!==J.path.length-1)$[H]=$[H]||{_errors:[]};else $[H]=$[H]||{_errors:[]},$[H]._errors.push(X(J));$=$[H],z++}}};return W(Q),Y}var _6=(Q)=>(X,Y,W,G)=>{let J=W?Object.assign(W,{async:!1}):{async:!1},$=X._zod.run({value:Y,issues:[]},J);if($ instanceof Promise)throw new _0;if($.issues.length){let z=new(G?.Err??Q)($.issues.map((H)=>j0(H,J,M0())));throw k6(z,G?.callee),z}return $.value};var y6=(Q)=>async(X,Y,W,G)=>{let J=W?Object.assign(W,{async:!0}):{async:!0},$=X._zod.run({value:Y,issues:[]},J);if($ instanceof Promise)$=await $;if($.issues.length){let z=new(G?.Err??Q)($.issues.map((H)=>j0(H,J,M0())));throw k6(z,G?.callee),z}return $.value};var u1=(Q)=>(X,Y,W)=>{let G=W?{...W,async:!1}:{async:!1},J=X._zod.run({value:Y,issues:[]},G);if(J instanceof Promise)throw new _0;return J.issues.length?{success:!1,error:new(Q??x6)(J.issues.map(($)=>j0($,G,M0())))}:{success:!0,data:J.value}},f1=u1(HQ),l1=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{async:!0}):{async:!0},J=X._zod.run({value:Y,issues:[]},G);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new Q(J.issues.map(($)=>j0($,G,M0())))}:{success:!0,data:J.value}},h6=l1(HQ),vX=(Q)=>(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return _6(Q)(X,Y,G)};var xX=(Q)=>(X,Y,W)=>{return _6(Q)(X,Y,W)};var _X=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return y6(Q)(X,Y,G)};var yX=(Q)=>async(X,Y,W)=>{return y6(Q)(X,Y,W)};var hX=(Q)=>(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return u1(Q)(X,Y,G)};var gX=(Q)=>(X,Y,W)=>{return u1(Q)(X,Y,W)};var uX=(Q)=>async(X,Y,W)=>{let G=W?Object.assign(W,{direction:"backward"}):{direction:"backward"};return l1(Q)(X,Y,G)};var fX=(Q)=>async(X,Y,W)=>{return l1(Q)(X,Y,W)};var lX=/^[cC][^\s-]{8,}$/,mX=/^[0-9a-z]+$/,cX=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pX=/^[0-9a-vA-V]{20}$/,iX=/^[A-Za-z0-9]{27}$/,nX=/^[a-zA-Z0-9_-]{21}$/,dX=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var rX=/^([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})$/,KQ=(Q)=>{if(!Q)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}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var oX=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function tX(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var aX=/^(?:(?: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])$/,sX=/^(([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}|:))$/,eX=/^((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])$/,Q8=/^(([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])$/,X8=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,BQ=/^[A-Za-z0-9_-]*$/,Y8=/^(?=.{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])?)*\.?$/;var W8=/^\+(?:[0-9]){6,14}[0-9]$/,G8="(?:(?:\\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])))",J8=new RegExp(`^${G8}$`);function $8(Q){return typeof Q.precision==="number"?Q.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":Q.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{${Q.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function z8(Q){return new RegExp(`^${$8(Q)}$`)}function H8(Q){let X=$8({precision:Q.precision}),Y=["Z"];if(Q.local)Y.push("");if(Q.offset)Y.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let W=`${X}(?:${Y.join("|")})`;return new RegExp(`^${G8}T(?:${W})$`)}var K8=(Q)=>{let X=Q?`[\\s\\S]{${Q?.minimum??0},${Q?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${X}$`)};var B8=/^-?\d+$/,D8=/^-?\d+(?:\.\d+)?/,A8=/^(?:true|false)$/i,F8=/^null$/i;var U8=/^[^A-Z]*$/,L8=/^[^a-z]*$/;var Q0=F("$ZodCheck",(Q,X)=>{var Y;Q._zod??(Q._zod={}),Q._zod.def=X,(Y=Q._zod).onattach??(Y.onattach=[])}),O8={number:"number",bigint:"bigint",object:"date"},DQ=F("$ZodCheckLessThan",(Q,X)=>{Q0.init(Q,X);let Y=O8[typeof X.value];Q._zod.onattach.push((W)=>{let G=W._zod.bag,J=(X.inclusive?G.maximum:G.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(X.value<J)if(X.inclusive)G.maximum=X.value;else G.exclusiveMaximum=X.value}),Q._zod.check=(W)=>{if(X.inclusive?W.value<=X.value:W.value<X.value)return;W.issues.push({origin:Y,code:"too_big",maximum:X.value,input:W.value,inclusive:X.inclusive,inst:Q,continue:!X.abort})}}),AQ=F("$ZodCheckGreaterThan",(Q,X)=>{Q0.init(Q,X);let Y=O8[typeof X.value];Q._zod.onattach.push((W)=>{let G=W._zod.bag,J=(X.inclusive?G.minimum:G.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(X.value>J)if(X.inclusive)G.minimum=X.value;else G.exclusiveMinimum=X.value}),Q._zod.check=(W)=>{if(X.inclusive?W.value>=X.value:W.value>X.value)return;W.issues.push({origin:Y,code:"too_small",minimum:X.value,input:W.value,inclusive:X.inclusive,inst:Q,continue:!X.abort})}}),M8=F("$ZodCheckMultipleOf",(Q,X)=>{Q0.init(Q,X),Q._zod.onattach.push((Y)=>{var W;(W=Y._zod.bag).multipleOf??(W.multipleOf=X.value)}),Q._zod.check=(Y)=>{if(typeof Y.value!==typeof X.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof Y.value==="bigint"?Y.value%X.value===BigInt(0):WQ(Y.value,X.value)===0)return;Y.issues.push({origin:typeof Y.value,code:"not_multiple_of",divisor:X.value,input:Y.value,inst:Q,continue:!X.abort})}}),V8=F("$ZodCheckNumberFormat",(Q,X)=>{Q0.init(Q,X),X.format=X.format||"float64";let Y=X.format?.includes("int"),W=Y?"int":"number",[G,J]=zQ[X.format];Q._zod.onattach.push(($)=>{let z=$._zod.bag;if(z.format=X.format,z.minimum=G,z.maximum=J,Y)z.pattern=B8}),Q._zod.check=($)=>{let z=$.value;if(Y){if(!Number.isInteger(z)){$.issues.push({expected:W,format:X.format,code:"invalid_type",continue:!1,input:z,inst:Q});return}if(!Number.isSafeInteger(z)){if(z>0)$.issues.push({input:z,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:W,continue:!X.abort});else $.issues.push({input:z,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:W,continue:!X.abort});return}}if(z<G)$.issues.push({origin:"number",input:z,code:"too_small",minimum:G,inclusive:!0,inst:Q,continue:!X.abort});if(z>J)$.issues.push({origin:"number",input:z,code:"too_big",maximum:J,inst:Q})}});var Z8=F("$ZodCheckMaxLength",(Q,X)=>{var Y;Q0.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!y1(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag.maximum??Number.POSITIVE_INFINITY;if(X.maximum<G)W._zod.bag.maximum=X.maximum}),Q._zod.check=(W)=>{let G=W.value;if(G.length<=X.maximum)return;let $=g1(G);W.issues.push({origin:$,code:"too_big",maximum:X.maximum,inclusive:!0,input:G,inst:Q,continue:!X.abort})}}),N8=F("$ZodCheckMinLength",(Q,X)=>{var Y;Q0.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!y1(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(X.minimum>G)W._zod.bag.minimum=X.minimum}),Q._zod.check=(W)=>{let G=W.value;if(G.length>=X.minimum)return;let $=g1(G);W.issues.push({origin:$,code:"too_small",minimum:X.minimum,inclusive:!0,input:G,inst:Q,continue:!X.abort})}}),q8=F("$ZodCheckLengthEquals",(Q,X)=>{var Y;Q0.init(Q,X),(Y=Q._zod.def).when??(Y.when=(W)=>{let G=W.value;return!y1(G)&&G.length!==void 0}),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.minimum=X.length,G.maximum=X.length,G.length=X.length}),Q._zod.check=(W)=>{let G=W.value,J=G.length;if(J===X.length)return;let $=g1(G),z=J>X.length;W.issues.push({origin:$,...z?{code:"too_big",maximum:X.length}:{code:"too_small",minimum:X.length},inclusive:!0,exact:!0,input:W.value,inst:Q,continue:!X.abort})}}),m1=F("$ZodCheckStringFormat",(Q,X)=>{var Y,W;if(Q0.init(Q,X),Q._zod.onattach.push((G)=>{let J=G._zod.bag;if(J.format=X.format,X.pattern)J.patterns??(J.patterns=new Set),J.patterns.add(X.pattern)}),X.pattern)(Y=Q._zod).check??(Y.check=(G)=>{if(X.pattern.lastIndex=0,X.pattern.test(G.value))return;G.issues.push({origin:"string",code:"invalid_format",format:X.format,input:G.value,...X.pattern?{pattern:X.pattern.toString()}:{},inst:Q,continue:!X.abort})});else(W=Q._zod).check??(W.check=()=>{})}),w8=F("$ZodCheckRegex",(Q,X)=>{m1.init(Q,X),Q._zod.check=(Y)=>{if(X.pattern.lastIndex=0,X.pattern.test(Y.value))return;Y.issues.push({origin:"string",code:"invalid_format",format:"regex",input:Y.value,pattern:X.pattern.toString(),inst:Q,continue:!X.abort})}}),j8=F("$ZodCheckLowerCase",(Q,X)=>{X.pattern??(X.pattern=U8),m1.init(Q,X)}),P8=F("$ZodCheckUpperCase",(Q,X)=>{X.pattern??(X.pattern=L8),m1.init(Q,X)}),b8=F("$ZodCheckIncludes",(Q,X)=>{Q0.init(Q,X);let Y=y0(X.includes),W=new RegExp(typeof X.position==="number"?`^.{${X.position}}${Y}`:Y);X.pattern=W,Q._zod.onattach.push((G)=>{let J=G._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(W)}),Q._zod.check=(G)=>{if(G.value.includes(X.includes,X.position))return;G.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:X.includes,input:G.value,inst:Q,continue:!X.abort})}}),E8=F("$ZodCheckStartsWith",(Q,X)=>{Q0.init(Q,X);let Y=new RegExp(`^${y0(X.prefix)}.*`);X.pattern??(X.pattern=Y),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),Q._zod.check=(W)=>{if(W.value.startsWith(X.prefix))return;W.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:X.prefix,input:W.value,inst:Q,continue:!X.abort})}}),I8=F("$ZodCheckEndsWith",(Q,X)=>{Q0.init(Q,X);let Y=new RegExp(`.*${y0(X.suffix)}$`);X.pattern??(X.pattern=Y),Q._zod.onattach.push((W)=>{let G=W._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),Q._zod.check=(W)=>{if(W.value.endsWith(X.suffix))return;W.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:X.suffix,input:W.value,inst:Q,continue:!X.abort})}});var T8=F("$ZodCheckOverwrite",(Q,X)=>{Q0.init(Q,X),Q._zod.check=(Y)=>{Y.value=X.tx(Y.value)}});class FQ{constructor(Q=[]){if(this.content=[],this.indent=0,this)this.args=Q}indented(Q){this.indent+=1,Q(this),this.indent-=1}write(Q){if(typeof Q==="function"){Q(this,{execution:"sync"}),Q(this,{execution:"async"});return}let Y=Q.split(`
|
|
10
10
|
`).filter((J)=>J),W=Math.min(...Y.map((J)=>J.length-J.trimStart().length)),G=Y.map((J)=>J.slice(W)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of G)this.content.push(J)}compile(){let Q=Function,X=this?.args,W=[...(this?.content??[""]).map((G)=>` ${G}`)];return new Q(...X,W.join(`
|
|
11
|
-
`))}}var
|
|
11
|
+
`))}}var R8={major:4,minor:1,patch:12};var p=F("$ZodType",(Q,X)=>{var Y;Q??(Q={}),Q._zod.def=X,Q._zod.bag=Q._zod.bag||{},Q._zod.version=R8;let W=[...Q._zod.def.checks??[]];if(Q._zod.traits.has("$ZodCheck"))W.unshift(Q);for(let G of W)for(let J of G._zod.onattach)J(Q);if(W.length===0)(Y=Q._zod).deferred??(Y.deferred=[]),Q._zod.deferred?.push(()=>{Q._zod.run=Q._zod.parse});else{let G=($,z,H)=>{let K=d0($),B;for(let D of z){if(D._zod.def.when){if(!D._zod.def.when($))continue}else if(K)continue;let U=$.issues.length,L=D._zod.check($);if(L instanceof Promise&&H?.async===!1)throw new _0;if(B||L instanceof Promise)B=(B??Promise.resolve()).then(async()=>{if(await L,$.issues.length===U)return;if(!K)K=d0($,U)});else{if($.issues.length===U)continue;if(!K)K=d0($,U)}}if(B)return B.then(()=>{return $});return $},J=($,z,H)=>{if(d0($))return $.aborted=!0,$;let K=G(z,W,H);if(K instanceof Promise){if(H.async===!1)throw new _0;return K.then((B)=>Q._zod.parse(B,H))}return Q._zod.parse(K,H)};Q._zod.run=($,z)=>{if(z.skipChecks)return Q._zod.parse($,z);if(z.direction==="backward"){let K=Q._zod.parse({value:$.value,issues:[]},{...z,skipChecks:!0});if(K instanceof Promise)return K.then((B)=>{return J(B,$,z)});return J(K,$,z)}let H=Q._zod.parse($,z);if(H instanceof Promise){if(z.async===!1)throw new _0;return H.then((K)=>G(K,W,z))}return G(H,W,z)}}Q["~standard"]={validate:(G)=>{try{let J=f1(Q,G);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return h6(Q,G).then(($)=>$.success?{value:$.data}:{issues:$.error?.issues})}},vendor:"zod",version:1}}),l6=F("$ZodString",(Q,X)=>{p.init(Q,X),Q._zod.pattern=[...Q?._zod.bag?.patterns??[]].pop()??K8(Q._zod.bag),Q._zod.parse=(Y,W)=>{if(X.coerce)try{Y.value=String(Y.value)}catch(G){}if(typeof Y.value==="string")return Y;return Y.issues.push({expected:"string",code:"invalid_type",input:Y.value,inst:Q}),Y}}),i=F("$ZodStringFormat",(Q,X)=>{m1.init(Q,X),l6.init(Q,X)}),u8=F("$ZodGUID",(Q,X)=>{X.pattern??(X.pattern=rX),i.init(Q,X)}),f8=F("$ZodUUID",(Q,X)=>{if(X.version){let W={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[X.version];if(W===void 0)throw Error(`Invalid UUID version: "${X.version}"`);X.pattern??(X.pattern=KQ(W))}else X.pattern??(X.pattern=KQ());i.init(Q,X)}),l8=F("$ZodEmail",(Q,X)=>{X.pattern??(X.pattern=oX),i.init(Q,X)}),m8=F("$ZodURL",(Q,X)=>{i.init(Q,X),Q._zod.check=(Y)=>{try{let W=Y.value.trim(),G=new URL(W);if(X.hostname){if(X.hostname.lastIndex=0,!X.hostname.test(G.hostname))Y.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Y8.source,input:Y.value,inst:Q,continue:!X.abort})}if(X.protocol){if(X.protocol.lastIndex=0,!X.protocol.test(G.protocol.endsWith(":")?G.protocol.slice(0,-1):G.protocol))Y.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:X.protocol.source,input:Y.value,inst:Q,continue:!X.abort})}if(X.normalize)Y.value=G.href;else Y.value=W;return}catch(W){Y.issues.push({code:"invalid_format",format:"url",input:Y.value,inst:Q,continue:!X.abort})}}}),c8=F("$ZodEmoji",(Q,X)=>{X.pattern??(X.pattern=tX()),i.init(Q,X)}),p8=F("$ZodNanoID",(Q,X)=>{X.pattern??(X.pattern=nX),i.init(Q,X)}),i8=F("$ZodCUID",(Q,X)=>{X.pattern??(X.pattern=lX),i.init(Q,X)}),n8=F("$ZodCUID2",(Q,X)=>{X.pattern??(X.pattern=mX),i.init(Q,X)}),d8=F("$ZodULID",(Q,X)=>{X.pattern??(X.pattern=cX),i.init(Q,X)}),r8=F("$ZodXID",(Q,X)=>{X.pattern??(X.pattern=pX),i.init(Q,X)}),o8=F("$ZodKSUID",(Q,X)=>{X.pattern??(X.pattern=iX),i.init(Q,X)}),t8=F("$ZodISODateTime",(Q,X)=>{X.pattern??(X.pattern=H8(X)),i.init(Q,X)}),a8=F("$ZodISODate",(Q,X)=>{X.pattern??(X.pattern=J8),i.init(Q,X)}),s8=F("$ZodISOTime",(Q,X)=>{X.pattern??(X.pattern=z8(X)),i.init(Q,X)}),e8=F("$ZodISODuration",(Q,X)=>{X.pattern??(X.pattern=dX),i.init(Q,X)}),QY=F("$ZodIPv4",(Q,X)=>{X.pattern??(X.pattern=aX),i.init(Q,X),Q._zod.onattach.push((Y)=>{let W=Y._zod.bag;W.format="ipv4"})}),XY=F("$ZodIPv6",(Q,X)=>{X.pattern??(X.pattern=sX),i.init(Q,X),Q._zod.onattach.push((Y)=>{let W=Y._zod.bag;W.format="ipv6"}),Q._zod.check=(Y)=>{try{new URL(`http://[${Y.value}]`)}catch{Y.issues.push({code:"invalid_format",format:"ipv6",input:Y.value,inst:Q,continue:!X.abort})}}}),YY=F("$ZodCIDRv4",(Q,X)=>{X.pattern??(X.pattern=eX),i.init(Q,X)}),WY=F("$ZodCIDRv6",(Q,X)=>{X.pattern??(X.pattern=Q8),i.init(Q,X),Q._zod.check=(Y)=>{let W=Y.value.split("/");try{if(W.length!==2)throw Error();let[G,J]=W;if(!J)throw Error();let $=Number(J);if(`${$}`!==J)throw Error();if($<0||$>128)throw Error();new URL(`http://[${G}]`)}catch{Y.issues.push({code:"invalid_format",format:"cidrv6",input:Y.value,inst:Q,continue:!X.abort})}}});function GY(Q){if(Q==="")return!0;if(Q.length%4!==0)return!1;try{return atob(Q),!0}catch{return!1}}var JY=F("$ZodBase64",(Q,X)=>{X.pattern??(X.pattern=X8),i.init(Q,X),Q._zod.onattach.push((Y)=>{Y._zod.bag.contentEncoding="base64"}),Q._zod.check=(Y)=>{if(GY(Y.value))return;Y.issues.push({code:"invalid_format",format:"base64",input:Y.value,inst:Q,continue:!X.abort})}});function uz(Q){if(!BQ.test(Q))return!1;let X=Q.replace(/[-_]/g,(W)=>W==="-"?"+":"/"),Y=X.padEnd(Math.ceil(X.length/4)*4,"=");return GY(Y)}var $Y=F("$ZodBase64URL",(Q,X)=>{X.pattern??(X.pattern=BQ),i.init(Q,X),Q._zod.onattach.push((Y)=>{Y._zod.bag.contentEncoding="base64url"}),Q._zod.check=(Y)=>{if(uz(Y.value))return;Y.issues.push({code:"invalid_format",format:"base64url",input:Y.value,inst:Q,continue:!X.abort})}}),zY=F("$ZodE164",(Q,X)=>{X.pattern??(X.pattern=W8),i.init(Q,X)});function fz(Q,X=null){try{let Y=Q.split(".");if(Y.length!==3)return!1;let[W]=Y;if(!W)return!1;let G=JSON.parse(atob(W));if("typ"in G&&G?.typ!=="JWT")return!1;if(!G.alg)return!1;if(X&&(!("alg"in G)||G.alg!==X))return!1;return!0}catch{return!1}}var HY=F("$ZodJWT",(Q,X)=>{i.init(Q,X),Q._zod.check=(Y)=>{if(fz(Y.value,X.alg))return;Y.issues.push({code:"invalid_format",format:"jwt",input:Y.value,inst:Q,continue:!X.abort})}});var LQ=F("$ZodNumber",(Q,X)=>{p.init(Q,X),Q._zod.pattern=Q._zod.bag.pattern??D8,Q._zod.parse=(Y,W)=>{if(X.coerce)try{Y.value=Number(Y.value)}catch($){}let G=Y.value;if(typeof G==="number"&&!Number.isNaN(G)&&Number.isFinite(G))return Y;let J=typeof G==="number"?Number.isNaN(G)?"NaN":!Number.isFinite(G)?"Infinity":void 0:void 0;return Y.issues.push({expected:"number",code:"invalid_type",input:G,inst:Q,...J?{received:J}:{}}),Y}}),KY=F("$ZodNumber",(Q,X)=>{V8.init(Q,X),LQ.init(Q,X)}),BY=F("$ZodBoolean",(Q,X)=>{p.init(Q,X),Q._zod.pattern=A8,Q._zod.parse=(Y,W)=>{if(X.coerce)try{Y.value=Boolean(Y.value)}catch(J){}let G=Y.value;if(typeof G==="boolean")return Y;return Y.issues.push({expected:"boolean",code:"invalid_type",input:G,inst:Q}),Y}});var DY=F("$ZodNull",(Q,X)=>{p.init(Q,X),Q._zod.pattern=F8,Q._zod.values=new Set([null]),Q._zod.parse=(Y,W)=>{let G=Y.value;if(G===null)return Y;return Y.issues.push({expected:"null",code:"invalid_type",input:G,inst:Q}),Y}});var AY=F("$ZodUnknown",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y)=>Y}),FY=F("$ZodNever",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y,W)=>{return Y.issues.push({expected:"never",code:"invalid_type",input:Y.value,inst:Q}),Y}});function C8(Q,X,Y){if(Q.issues.length)X.issues.push(...h0(Y,Q.issues));X.value[Y]=Q.value}var UY=F("$ZodArray",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y,W)=>{let G=Y.value;if(!Array.isArray(G))return Y.issues.push({expected:"array",code:"invalid_type",input:G,inst:Q}),Y;Y.value=Array(G.length);let J=[];for(let $=0;$<G.length;$++){let z=G[$],H=X.element._zod.run({value:z,issues:[]},W);if(H instanceof Promise)J.push(H.then((K)=>C8(K,Y,$)));else C8(H,Y,$)}if(J.length)return Promise.all(J).then(()=>Y);return Y}});function f6(Q,X,Y,W){if(Q.issues.length)X.issues.push(...h0(Y,Q.issues));if(Q.value===void 0){if(Y in W)X.value[Y]=void 0}else X.value[Y]=Q.value}function LY(Q){let X=Object.keys(Q.shape);for(let W of X)if(!Q.shape?.[W]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${W}": expected a Zod schema`);let Y=$Q(Q.shape);return{...Q,keys:X,keySet:new Set(X),numKeys:X.length,optionalKeys:new Set(Y)}}function OY(Q,X,Y,W,G,J){let $=[],z=G.keySet,H=G.catchall._zod,K=H.def.type;for(let B of Object.keys(X)){if(z.has(B))continue;if(K==="never"){$.push(B);continue}let D=H.run({value:X[B],issues:[]},W);if(D instanceof Promise)Q.push(D.then((U)=>f6(U,Y,B,X)));else f6(D,Y,B,X)}if($.length)Y.issues.push({code:"unrecognized_keys",keys:$,input:X,inst:J});if(!Q.length)return Y;return Promise.all(Q).then(()=>{return Y})}var lz=F("$ZodObject",(Q,X)=>{if(p.init(Q,X),!Object.getOwnPropertyDescriptor(X,"shape")?.get){let z=X.shape;Object.defineProperty(X,"shape",{get:()=>{let H={...z};return Object.defineProperty(X,"shape",{value:H}),H}})}let W=U1(()=>LY(X));l(Q._zod,"propValues",()=>{let z=X.shape,H={};for(let K in z){let B=z[K]._zod;if(B.values){H[K]??(H[K]=new Set);for(let D of B.values)H[K].add(D)}}return H});let G=G1,J=X.catchall,$;Q._zod.parse=(z,H)=>{$??($=W.value);let K=z.value;if(!G(K))return z.issues.push({expected:"object",code:"invalid_type",input:K,inst:Q}),z;z.value={};let B=[],D=$.shape;for(let U of $.keys){let O=D[U]._zod.run({value:K[U],issues:[]},H);if(O instanceof Promise)B.push(O.then((M)=>f6(M,z,U,K)));else f6(O,z,U,K)}if(!J)return B.length?Promise.all(B).then(()=>z):z;return OY(B,K,z,H,W.value,Q)}}),MY=F("$ZodObjectJIT",(Q,X)=>{lz.init(Q,X);let Y=Q._zod.parse,W=U1(()=>LY(X)),G=(U)=>{let L=new FQ(["shape","payload","ctx"]),O=W.value,M=(E)=>{let v=C6(E);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};L.write("const input = payload.value;");let Z=Object.create(null),V=0;for(let E of O.keys)Z[E]=`key_${V++}`;L.write("const newResult = {};");for(let E of O.keys){let v=Z[E],I=C6(E);L.write(`const ${v} = ${M(E)};`),L.write(`
|
|
12
12
|
if (${v}.issues.length) {
|
|
13
13
|
payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
|
|
14
14
|
...iss,
|
|
@@ -25,10 +25,10 @@ var Xz=Object.create;var{getPrototypeOf:Yz,defineProperty:e4,getOwnPropertyNames
|
|
|
25
25
|
newResult[${I}] = ${v}.value;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
`)}L.write("payload.value = newResult;"),L.write("return payload;");let T=L.compile();return(E,v)=>T(U,E,v)},J,$=G1,z=!S6.jitless,B=z&&WQ.value,K=X.catchall,D;Q._zod.parse=(U,L)=>{D??(D=W.value);let O=U.value;if(!$(O))return U.issues.push({expected:"object",code:"invalid_type",input:O,inst:Q}),U;if(z&&B&&L?.async===!1&&L.jitless!==!0){if(!J)J=G(X.shape);if(U=J(U,L),!K)return U;return LY([],O,U,L,D,Q)}return Y(U,L)}});function C8(Q,X,Y,W){for(let J of Q)if(J.issues.length===0)return X.value=J.value,X;let G=Q.filter((J)=>!d0(J));if(G.length===1)return X.value=G[0].value,G[0];return X.issues.push({code:"invalid_union",input:X.value,inst:Y,errors:Q.map((J)=>J.issues.map(($)=>j0($,W,M0())))}),X}var LQ=F("$ZodUnion",(Q,X)=>{p.init(Q,X),l(Q._zod,"optin",()=>X.options.some((G)=>G._zod.optin==="optional")?"optional":void 0),l(Q._zod,"optout",()=>X.options.some((G)=>G._zod.optout==="optional")?"optional":void 0),l(Q._zod,"values",()=>{if(X.options.every((G)=>G._zod.values))return new Set(X.options.flatMap((G)=>Array.from(G._zod.values)));return}),l(Q._zod,"pattern",()=>{if(X.options.every((G)=>G._zod.pattern)){let G=X.options.map((J)=>J._zod.pattern);return new RegExp(`^(${G.map((J)=>g1(J.source)).join("|")})$`)}return});let Y=X.options.length===1,W=X.options[0]._zod.run;Q._zod.parse=(G,J)=>{if(Y)return W(G,J);let $=!1,z=[];for(let H of X.options){let B=H._zod.run({value:G.value,issues:[]},J);if(B instanceof Promise)z.push(B),$=!0;else{if(B.issues.length===0)return B;z.push(B)}}if(!$)return C8(z,G,Q,J);return Promise.all(z).then((H)=>{return C8(H,G,Q,J)})}}),MY=F("$ZodDiscriminatedUnion",(Q,X)=>{LQ.init(Q,X);let Y=Q._zod.parse;l(Q._zod,"propValues",()=>{let G={};for(let J of X.options){let $=J._zod.propValues;if(!$||Object.keys($).length===0)throw Error(`Invalid discriminated union option at index "${X.options.indexOf(J)}"`);for(let[z,H]of Object.entries($)){if(!G[z])G[z]=new Set;for(let B of H)G[z].add(B)}}return G});let W=U1(()=>{let G=X.options,J=new Map;for(let $ of G){let z=$._zod.propValues?.[X.discriminator];if(!z||z.size===0)throw Error(`Invalid discriminated union option at index "${X.options.indexOf($)}"`);for(let H of z){if(J.has(H))throw Error(`Duplicate discriminator value "${String(H)}"`);J.set(H,$)}}return J});Q._zod.parse=(G,J)=>{let $=G.value;if(!G1($))return G.issues.push({code:"invalid_type",expected:"object",input:$,inst:Q}),G;let z=W.value.get($?.[X.discriminator]);if(z)return z._zod.run(G,J);if(X.unionFallback)return Y(G,J);return G.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:X.discriminator,input:$,path:[X.discriminator],inst:Q}),G}}),VY=F("$ZodIntersection",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y,W)=>{let G=Y.value,J=X.left._zod.run({value:G,issues:[]},W),$=X.right._zod.run({value:G,issues:[]},W);if(J instanceof Promise||$ instanceof Promise)return Promise.all([J,$]).then(([H,B])=>{return k8(Y,H,B)});return k8(Y,J,$)}});function FQ(Q,X){if(Q===X)return{valid:!0,data:Q};if(Q instanceof Date&&X instanceof Date&&+Q===+X)return{valid:!0,data:Q};if(n0(Q)&&n0(X)){let Y=Object.keys(X),W=Object.keys(Q).filter((J)=>Y.indexOf(J)!==-1),G={...Q,...X};for(let J of W){let $=FQ(Q[J],X[J]);if(!$.valid)return{valid:!1,mergeErrorPath:[J,...$.mergeErrorPath]};G[J]=$.data}return{valid:!0,data:G}}if(Array.isArray(Q)&&Array.isArray(X)){if(Q.length!==X.length)return{valid:!1,mergeErrorPath:[]};let Y=[];for(let W=0;W<Q.length;W++){let G=Q[W],J=X[W],$=FQ(G,J);if(!$.valid)return{valid:!1,mergeErrorPath:[W,...$.mergeErrorPath]};Y.push($.data)}return{valid:!0,data:Y}}return{valid:!1,mergeErrorPath:[]}}function k8(Q,X,Y){if(X.issues.length)Q.issues.push(...X.issues);if(Y.issues.length)Q.issues.push(...Y.issues);if(d0(Q))return Q;let W=FQ(X.value,Y.value);if(!W.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(W.mergeErrorPath)}`);return Q.value=W.data,Q}var ZY=F("$ZodRecord",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y,W)=>{let G=Y.value;if(!n0(G))return Y.issues.push({expected:"record",code:"invalid_type",input:G,inst:Q}),Y;let J=[];if(X.keyType._zod.values){let $=X.keyType._zod.values;Y.value={};for(let H of $)if(typeof H==="string"||typeof H==="number"||typeof H==="symbol"){let B=X.valueType._zod.run({value:G[H],issues:[]},W);if(B instanceof Promise)J.push(B.then((K)=>{if(K.issues.length)Y.issues.push(...g0(H,K.issues));Y.value[H]=K.value}));else{if(B.issues.length)Y.issues.push(...g0(H,B.issues));Y.value[H]=B.value}}let z;for(let H in G)if(!$.has(H))z=z??[],z.push(H);if(z&&z.length>0)Y.issues.push({code:"unrecognized_keys",input:G,inst:Q,keys:z})}else{Y.value={};for(let $ of Reflect.ownKeys(G)){if($==="__proto__")continue;let z=X.keyType._zod.run({value:$,issues:[]},W);if(z instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(z.issues.length){Y.issues.push({code:"invalid_key",origin:"record",issues:z.issues.map((B)=>j0(B,W,M0())),input:$,path:[$],inst:Q}),Y.value[z.value]=z.value;continue}let H=X.valueType._zod.run({value:G[$],issues:[]},W);if(H instanceof Promise)J.push(H.then((B)=>{if(B.issues.length)Y.issues.push(...g0($,B.issues));Y.value[z.value]=B.value}));else{if(H.issues.length)Y.issues.push(...g0($,H.issues));Y.value[z.value]=H.value}}}if(J.length)return Promise.all(J).then(()=>Y);return Y}});var NY=F("$ZodEnum",(Q,X)=>{p.init(Q,X);let Y=XQ(X.entries),W=new Set(Y);Q._zod.values=W,Q._zod.pattern=new RegExp(`^(${Y.filter((G)=>GQ.has(typeof G)).map((G)=>typeof G==="string"?y0(G):G.toString()).join("|")})$`),Q._zod.parse=(G,J)=>{let $=G.value;if(W.has($))return G;return G.issues.push({code:"invalid_value",values:Y,input:$,inst:Q}),G}}),qY=F("$ZodLiteral",(Q,X)=>{if(p.init(Q,X),X.values.length===0)throw Error("Cannot create literal schema with no valid values");Q._zod.values=new Set(X.values),Q._zod.pattern=new RegExp(`^(${X.values.map((Y)=>typeof Y==="string"?y0(Y):Y?y0(Y.toString()):String(Y)).join("|")})$`),Q._zod.parse=(Y,W)=>{let G=Y.value;if(Q._zod.values.has(G))return Y;return Y.issues.push({code:"invalid_value",values:X.values,input:G,inst:Q}),Y}});var wY=F("$ZodTransform",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")throw new x1(Q.constructor.name);let G=X.transform(Y.value,Y);if(W.async)return(G instanceof Promise?G:Promise.resolve(G)).then(($)=>{return Y.value=$,Y});if(G instanceof Promise)throw new _0;return Y.value=G,Y}});function v8(Q,X){if(Q.issues.length&&X===void 0)return{issues:[],value:void 0};return Q}var jY=F("$ZodOptional",(Q,X)=>{p.init(Q,X),Q._zod.optin="optional",Q._zod.optout="optional",l(Q._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,void 0]):void 0}),l(Q._zod,"pattern",()=>{let Y=X.innerType._zod.pattern;return Y?new RegExp(`^(${g1(Y.source)})?$`):void 0}),Q._zod.parse=(Y,W)=>{if(X.innerType._zod.optin==="optional"){let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>v8(J,Y.value));return v8(G,Y.value)}if(Y.value===void 0)return Y;return X.innerType._zod.run(Y,W)}}),PY=F("$ZodNullable",(Q,X)=>{p.init(Q,X),l(Q._zod,"optin",()=>X.innerType._zod.optin),l(Q._zod,"optout",()=>X.innerType._zod.optout),l(Q._zod,"pattern",()=>{let Y=X.innerType._zod.pattern;return Y?new RegExp(`^(${g1(Y.source)}|null)$`):void 0}),l(Q._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,null]):void 0}),Q._zod.parse=(Y,W)=>{if(Y.value===null)return Y;return X.innerType._zod.run(Y,W)}}),bY=F("$ZodDefault",(Q,X)=>{p.init(Q,X),Q._zod.optin="optional",l(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);if(Y.value===void 0)return Y.value=X.defaultValue,Y;let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>x8(J,X));return x8(G,X)}});function x8(Q,X){if(Q.value===void 0)Q.value=X.defaultValue;return Q}var EY=F("$ZodPrefault",(Q,X)=>{p.init(Q,X),Q._zod.optin="optional",l(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);if(Y.value===void 0)Y.value=X.defaultValue;return X.innerType._zod.run(Y,W)}}),IY=F("$ZodNonOptional",(Q,X)=>{p.init(Q,X),l(Q._zod,"values",()=>{let Y=X.innerType._zod.values;return Y?new Set([...Y].filter((W)=>W!==void 0)):void 0}),Q._zod.parse=(Y,W)=>{let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>_8(J,Q));return _8(G,Q)}});function _8(Q,X){if(!Q.issues.length&&Q.value===void 0)Q.issues.push({code:"invalid_type",expected:"nonoptional",input:Q.value,inst:X});return Q}var TY=F("$ZodCatch",(Q,X)=>{p.init(Q,X),l(Q._zod,"optin",()=>X.innerType._zod.optin),l(Q._zod,"optout",()=>X.innerType._zod.optout),l(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>{if(Y.value=J.value,J.issues.length)Y.value=X.catchValue({...Y,error:{issues:J.issues.map(($)=>j0($,W,M0()))},input:Y.value}),Y.issues=[];return Y});if(Y.value=G.value,G.issues.length)Y.value=X.catchValue({...Y,error:{issues:G.issues.map((J)=>j0(J,W,M0()))},input:Y.value}),Y.issues=[];return Y}});var SY=F("$ZodPipe",(Q,X)=>{p.init(Q,X),l(Q._zod,"values",()=>X.in._zod.values),l(Q._zod,"optin",()=>X.in._zod.optin),l(Q._zod,"optout",()=>X.out._zod.optout),l(Q._zod,"propValues",()=>X.in._zod.propValues),Q._zod.parse=(Y,W)=>{if(W.direction==="backward"){let J=X.out._zod.run(Y,W);if(J instanceof Promise)return J.then(($)=>u6($,X.in,W));return u6(J,X.in,W)}let G=X.in._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>u6(J,X.out,W));return u6(G,X.out,W)}});function u6(Q,X,Y){if(Q.issues.length)return Q.aborted=!0,Q;return X._zod.run({value:Q.value,issues:Q.issues},Y)}var RY=F("$ZodReadonly",(Q,X)=>{p.init(Q,X),l(Q._zod,"propValues",()=>X.innerType._zod.propValues),l(Q._zod,"values",()=>X.innerType._zod.values),l(Q._zod,"optin",()=>X.innerType._zod.optin),l(Q._zod,"optout",()=>X.innerType._zod.optout),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then(y8);return y8(G)}});function y8(Q){return Q.value=Object.freeze(Q.value),Q}var CY=F("$ZodCustom",(Q,X)=>{Q0.init(Q,X),p.init(Q,X),Q._zod.parse=(Y,W)=>{return Y},Q._zod.check=(Y)=>{let W=Y.value,G=X.fn(W);if(G instanceof Promise)return G.then((J)=>g8(J,Y,W,Q));g8(G,Y,W,Q);return}});function g8(Q,X,Y,W){if(!Q){let G={code:"custom",input:Y,inst:W,path:[...W._zod.def.path??[]],continue:!W._zod.def.abort};if(W._zod.def.params)G.params=W._zod.def.params;X.issues.push(L1(G))}}var lz=(Q)=>{let X=typeof Q;switch(X){case"number":return Number.isNaN(Q)?"NaN":"number";case"object":{if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Object.getPrototypeOf(Q)!==Object.prototype&&Q.constructor)return Q.constructor.name}}return X},mz=()=>{let Q={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function X(W){return Q[W]??null}let Y={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(W)=>{switch(W.code){case"invalid_type":return`Invalid input: expected ${W.expected}, received ${lz(W.input)}`;case"invalid_value":if(W.values.length===1)return`Invalid input: expected ${v6(W.values[0])}`;return`Invalid option: expected one of ${R6(W.values,"|")}`;case"too_big":{let G=W.inclusive?"<=":"<",J=X(W.origin);if(J)return`Too big: expected ${W.origin??"value"} to have ${G}${W.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${W.origin??"value"} to be ${G}${W.maximum.toString()}`}case"too_small":{let G=W.inclusive?">=":">",J=X(W.origin);if(J)return`Too small: expected ${W.origin} to have ${G}${W.minimum.toString()} ${J.unit}`;return`Too small: expected ${W.origin} to be ${G}${W.minimum.toString()}`}case"invalid_format":{let G=W;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 ${Y[G.format]??W.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${W.divisor}`;case"unrecognized_keys":return`Unrecognized key${W.keys.length>1?"s":""}: ${R6(W.keys,", ")}`;case"invalid_key":return`Invalid key in ${W.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${W.origin}`;default:return"Invalid input"}}};function OQ(){return{localeError:mz()}}var HV=Symbol("ZodOutput"),BV=Symbol("ZodInput");class kY{constructor(){this._map=new WeakMap,this._idmap=new Map}add(Q,...X){let Y=X[0];if(this._map.set(Q,Y),Y&&typeof Y==="object"&&"id"in Y){if(this._idmap.has(Y.id))throw Error(`ID ${Y.id} already exists in the registry`);this._idmap.set(Y.id,Q)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(Q){let X=this._map.get(Q);if(X&&typeof X==="object"&&"id"in X)this._idmap.delete(X.id);return this._map.delete(Q),this}get(Q){let X=Q._zod.parent;if(X){let Y={...this.get(X)??{}};delete Y.id;let W={...Y,...this._map.get(Q)};return Object.keys(W).length?W:void 0}return this._map.get(Q)}has(Q){return this._map.has(Q)}}function cz(){return new kY}var c1=cz();function vY(Q,X){return new Q({type:"string",...b(X)})}function xY(Q,X){return new Q({type:"string",format:"email",check:"string_format",abort:!1,...b(X)})}function MQ(Q,X){return new Q({type:"string",format:"guid",check:"string_format",abort:!1,...b(X)})}function _Y(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,...b(X)})}function yY(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(X)})}function gY(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(X)})}function hY(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(X)})}function uY(Q,X){return new Q({type:"string",format:"url",check:"string_format",abort:!1,...b(X)})}function fY(Q,X){return new Q({type:"string",format:"emoji",check:"string_format",abort:!1,...b(X)})}function lY(Q,X){return new Q({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(X)})}function mY(Q,X){return new Q({type:"string",format:"cuid",check:"string_format",abort:!1,...b(X)})}function cY(Q,X){return new Q({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(X)})}function pY(Q,X){return new Q({type:"string",format:"ulid",check:"string_format",abort:!1,...b(X)})}function iY(Q,X){return new Q({type:"string",format:"xid",check:"string_format",abort:!1,...b(X)})}function nY(Q,X){return new Q({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(X)})}function dY(Q,X){return new Q({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(X)})}function rY(Q,X){return new Q({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(X)})}function oY(Q,X){return new Q({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(X)})}function tY(Q,X){return new Q({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(X)})}function aY(Q,X){return new Q({type:"string",format:"base64",check:"string_format",abort:!1,...b(X)})}function sY(Q,X){return new Q({type:"string",format:"base64url",check:"string_format",abort:!1,...b(X)})}function eY(Q,X){return new Q({type:"string",format:"e164",check:"string_format",abort:!1,...b(X)})}function QW(Q,X){return new Q({type:"string",format:"jwt",check:"string_format",abort:!1,...b(X)})}function XW(Q,X){return new Q({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(X)})}function YW(Q,X){return new Q({type:"string",format:"date",check:"string_format",...b(X)})}function WW(Q,X){return new Q({type:"string",format:"time",check:"string_format",precision:null,...b(X)})}function GW(Q,X){return new Q({type:"string",format:"duration",check:"string_format",...b(X)})}function JW(Q,X){return new Q({type:"number",checks:[],...b(X)})}function $W(Q,X){return new Q({type:"number",check:"number_format",abort:!1,format:"safeint",...b(X)})}function zW(Q,X){return new Q({type:"boolean",...b(X)})}function HW(Q,X){return new Q({type:"null",...b(X)})}function BW(Q){return new Q({type:"unknown"})}function KW(Q,X){return new Q({type:"never",...b(X)})}function m6(Q,X){return new KQ({check:"less_than",...b(X),value:Q,inclusive:!1})}function p1(Q,X){return new KQ({check:"less_than",...b(X),value:Q,inclusive:!0})}function c6(Q,X){return new DQ({check:"greater_than",...b(X),value:Q,inclusive:!1})}function i1(Q,X){return new DQ({check:"greater_than",...b(X),value:Q,inclusive:!0})}function p6(Q,X){return new O8({check:"multiple_of",...b(X),value:Q})}function i6(Q,X){return new V8({check:"max_length",...b(X),maximum:Q})}function O1(Q,X){return new Z8({check:"min_length",...b(X),minimum:Q})}function n6(Q,X){return new N8({check:"length_equals",...b(X),length:Q})}function VQ(Q,X){return new q8({check:"string_format",format:"regex",...b(X),pattern:Q})}function ZQ(Q){return new w8({check:"string_format",format:"lowercase",...b(Q)})}function NQ(Q){return new j8({check:"string_format",format:"uppercase",...b(Q)})}function qQ(Q,X){return new P8({check:"string_format",format:"includes",...b(X),includes:Q})}function wQ(Q,X){return new b8({check:"string_format",format:"starts_with",...b(X),prefix:Q})}function jQ(Q,X){return new E8({check:"string_format",format:"ends_with",...b(X),suffix:Q})}function J1(Q){return new I8({check:"overwrite",tx:Q})}function PQ(Q){return J1((X)=>X.normalize(Q))}function bQ(){return J1((Q)=>Q.trim())}function EQ(){return J1((Q)=>Q.toLowerCase())}function IQ(){return J1((Q)=>Q.toUpperCase())}function DW(Q,X,Y){return new Q({type:"array",element:X,...b(Y)})}function AW(Q,X,Y){let W=b(Y);return W.abort??(W.abort=!0),new Q({type:"custom",check:"custom",fn:X,...W})}function FW(Q,X,Y){return new Q({type:"custom",check:"custom",fn:X,...b(Y)})}function UW(Q){let X=pz((Y)=>{return Y.addIssue=(W)=>{if(typeof W==="string")Y.issues.push(L1(W,Y.value,X._zod.def));else{let G=W;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=Y.value),G.inst??(G.inst=X),G.continue??(G.continue=!X._zod.def.abort),Y.issues.push(L1(G))}},Q(Y.value,Y)});return X}function pz(Q,X){let Y=new Q0({check:"custom",...b(X)});return Y._zod.check=Q,Y}function M1(Q){return!!Q._zod}function r0(Q,X){if(M1(Q))return f1(Q,X);return Q.safeParse(X)}function d6(Q){if(!Q)return;let X;if(M1(Q))X=Q._zod?.def?.shape;else X=Q.shape;if(!X)return;if(typeof X==="function")try{return X()}catch{return}return X}function LW(Q){if(M1(Q)){let J=Q._zod?.def;if(J){if(J.value!==void 0)return J.value;if(Array.isArray(J.values)&&J.values.length>0)return J.values[0]}}let Y=Q._def;if(Y){if(Y.value!==void 0)return Y.value;if(Array.isArray(Y.values)&&Y.values.length>0)return Y.values[0]}let W=Q.value;if(W!==void 0)return W;return}var d1={};NX(d1,{time:()=>RQ,duration:()=>CQ,datetime:()=>TQ,date:()=>SQ,ZodISOTime:()=>VW,ZodISODuration:()=>ZW,ZodISODateTime:()=>OW,ZodISODate:()=>MW});var OW=F("ZodISODateTime",(Q,X)=>{o8.init(Q,X),d.init(Q,X)});function TQ(Q){return XW(OW,Q)}var MW=F("ZodISODate",(Q,X)=>{t8.init(Q,X),d.init(Q,X)});function SQ(Q){return YW(MW,Q)}var VW=F("ZodISOTime",(Q,X)=>{a8.init(Q,X),d.init(Q,X)});function RQ(Q){return WW(VW,Q)}var ZW=F("ZodISODuration",(Q,X)=>{s8.init(Q,X),d.init(Q,X)});function CQ(Q){return GW(ZW,Q)}var NW=(Q,X)=>{x6.init(Q,X),Q.name="ZodError",Object.defineProperties(Q,{format:{value:(Y)=>CX(Q,Y)},flatten:{value:(Y)=>RX(Q,Y)},addIssue:{value:(Y)=>{Q.issues.push(Y),Q.message=JSON.stringify(Q.issues,F1,2)}},addIssues:{value:(Y)=>{Q.issues.push(...Y),Q.message=JSON.stringify(Q.issues,F1,2)}},isEmpty:{get(){return Q.issues.length===0}}})},rV=F("ZodError",NW),L0=F("ZodError",NW,{Parent:Error});var qW=_6(L0),wW=y6(L0),jW=u1(L0),PW=l1(L0),bW=kX(L0),EW=vX(L0),IW=xX(L0),TW=_X(L0),SW=yX(L0),RW=gX(L0),CW=hX(L0),kW=uX(L0);var a=F("ZodType",(Q,X)=>{return p.init(Q,X),Q.def=X,Q.type=X.type,Object.defineProperty(Q,"_def",{value:X}),Q.check=(...Y)=>{return Q.clone(h.mergeDefs(X,{checks:[...X.checks??[],...Y.map((W)=>typeof W==="function"?{_zod:{check:W,def:{check:"custom"},onattach:[]}}:W)]}))},Q.clone=(Y,W)=>w0(Q,Y,W),Q.brand=()=>Q,Q.register=(Y,W)=>{return Y.add(Q,W),Q},Q.parse=(Y,W)=>qW(Q,Y,W,{callee:Q.parse}),Q.safeParse=(Y,W)=>jW(Q,Y,W),Q.parseAsync=async(Y,W)=>wW(Q,Y,W,{callee:Q.parseAsync}),Q.safeParseAsync=async(Y,W)=>PW(Q,Y,W),Q.spa=Q.safeParseAsync,Q.encode=(Y,W)=>bW(Q,Y,W),Q.decode=(Y,W)=>EW(Q,Y,W),Q.encodeAsync=async(Y,W)=>IW(Q,Y,W),Q.decodeAsync=async(Y,W)=>TW(Q,Y,W),Q.safeEncode=(Y,W)=>SW(Q,Y,W),Q.safeDecode=(Y,W)=>RW(Q,Y,W),Q.safeEncodeAsync=async(Y,W)=>CW(Q,Y,W),Q.safeDecodeAsync=async(Y,W)=>kW(Q,Y,W),Q.refine=(Y,W)=>Q.check(fH(Y,W)),Q.superRefine=(Y)=>Q.check(lH(Y)),Q.overwrite=(Y)=>Q.check(J1(Y)),Q.optional=()=>t(Q),Q.nullable=()=>_W(Q),Q.nullish=()=>t(_W(Q)),Q.nonoptional=(Y)=>xH(Q,Y),Q.array=()=>x(Q),Q.or=(Y)=>c([Q,Y]),Q.and=(Y)=>o6(Q,Y),Q.transform=(Y)=>vQ(Q,fW(Y)),Q.default=(Y)=>CH(Q,Y),Q.prefault=(Y)=>vH(Q,Y),Q.catch=(Y)=>yH(Q,Y),Q.pipe=(Y)=>vQ(Q,Y),Q.readonly=()=>uH(Q),Q.describe=(Y)=>{let W=Q.clone();return c1.add(W,{description:Y}),W},Object.defineProperty(Q,"description",{get(){return c1.get(Q)?.description},configurable:!0}),Q.meta=(...Y)=>{if(Y.length===0)return c1.get(Q);let W=Q.clone();return c1.add(W,Y[0]),W},Q.isOptional=()=>Q.safeParse(void 0).success,Q.isNullable=()=>Q.safeParse(null).success,Q}),yW=F("_ZodString",(Q,X)=>{l6.init(Q,X),a.init(Q,X);let Y=Q._zod.bag;Q.format=Y.format??null,Q.minLength=Y.minimum??null,Q.maxLength=Y.maximum??null,Q.regex=(...W)=>Q.check(VQ(...W)),Q.includes=(...W)=>Q.check(qQ(...W)),Q.startsWith=(...W)=>Q.check(wQ(...W)),Q.endsWith=(...W)=>Q.check(jQ(...W)),Q.min=(...W)=>Q.check(O1(...W)),Q.max=(...W)=>Q.check(i6(...W)),Q.length=(...W)=>Q.check(n6(...W)),Q.nonempty=(...W)=>Q.check(O1(1,...W)),Q.lowercase=(W)=>Q.check(ZQ(W)),Q.uppercase=(W)=>Q.check(NQ(W)),Q.trim=()=>Q.check(bQ()),Q.normalize=(...W)=>Q.check(PQ(...W)),Q.toLowerCase=()=>Q.check(EQ()),Q.toUpperCase=()=>Q.check(IQ())}),ez=F("ZodString",(Q,X)=>{l6.init(Q,X),yW.init(Q,X),Q.email=(Y)=>Q.check(xY(QH,Y)),Q.url=(Y)=>Q.check(uY(XH,Y)),Q.jwt=(Y)=>Q.check(QW(OH,Y)),Q.emoji=(Y)=>Q.check(fY(YH,Y)),Q.guid=(Y)=>Q.check(MQ(vW,Y)),Q.uuid=(Y)=>Q.check(_Y(r6,Y)),Q.uuidv4=(Y)=>Q.check(yY(r6,Y)),Q.uuidv6=(Y)=>Q.check(gY(r6,Y)),Q.uuidv7=(Y)=>Q.check(hY(r6,Y)),Q.nanoid=(Y)=>Q.check(lY(WH,Y)),Q.guid=(Y)=>Q.check(MQ(vW,Y)),Q.cuid=(Y)=>Q.check(mY(GH,Y)),Q.cuid2=(Y)=>Q.check(cY(JH,Y)),Q.ulid=(Y)=>Q.check(pY($H,Y)),Q.base64=(Y)=>Q.check(aY(FH,Y)),Q.base64url=(Y)=>Q.check(sY(UH,Y)),Q.xid=(Y)=>Q.check(iY(zH,Y)),Q.ksuid=(Y)=>Q.check(nY(HH,Y)),Q.ipv4=(Y)=>Q.check(dY(BH,Y)),Q.ipv6=(Y)=>Q.check(rY(KH,Y)),Q.cidrv4=(Y)=>Q.check(oY(DH,Y)),Q.cidrv6=(Y)=>Q.check(tY(AH,Y)),Q.e164=(Y)=>Q.check(eY(LH,Y)),Q.datetime=(Y)=>Q.check(TQ(Y)),Q.date=(Y)=>Q.check(SQ(Y)),Q.time=(Y)=>Q.check(RQ(Y)),Q.duration=(Y)=>Q.check(CQ(Y))});function A(Q){return vY(ez,Q)}var d=F("ZodStringFormat",(Q,X)=>{i.init(Q,X),yW.init(Q,X)}),QH=F("ZodEmail",(Q,X)=>{f8.init(Q,X),d.init(Q,X)});var vW=F("ZodGUID",(Q,X)=>{h8.init(Q,X),d.init(Q,X)});var r6=F("ZodUUID",(Q,X)=>{u8.init(Q,X),d.init(Q,X)});var XH=F("ZodURL",(Q,X)=>{l8.init(Q,X),d.init(Q,X)});var YH=F("ZodEmoji",(Q,X)=>{m8.init(Q,X),d.init(Q,X)});var WH=F("ZodNanoID",(Q,X)=>{c8.init(Q,X),d.init(Q,X)});var GH=F("ZodCUID",(Q,X)=>{p8.init(Q,X),d.init(Q,X)});var JH=F("ZodCUID2",(Q,X)=>{i8.init(Q,X),d.init(Q,X)});var $H=F("ZodULID",(Q,X)=>{n8.init(Q,X),d.init(Q,X)});var zH=F("ZodXID",(Q,X)=>{d8.init(Q,X),d.init(Q,X)});var HH=F("ZodKSUID",(Q,X)=>{r8.init(Q,X),d.init(Q,X)});var BH=F("ZodIPv4",(Q,X)=>{e8.init(Q,X),d.init(Q,X)});var KH=F("ZodIPv6",(Q,X)=>{QY.init(Q,X),d.init(Q,X)});var DH=F("ZodCIDRv4",(Q,X)=>{XY.init(Q,X),d.init(Q,X)});var AH=F("ZodCIDRv6",(Q,X)=>{YY.init(Q,X),d.init(Q,X)});var FH=F("ZodBase64",(Q,X)=>{GY.init(Q,X),d.init(Q,X)});var UH=F("ZodBase64URL",(Q,X)=>{JY.init(Q,X),d.init(Q,X)});var LH=F("ZodE164",(Q,X)=>{$Y.init(Q,X),d.init(Q,X)});var OH=F("ZodJWT",(Q,X)=>{zY.init(Q,X),d.init(Q,X)});var gW=F("ZodNumber",(Q,X)=>{UQ.init(Q,X),a.init(Q,X),Q.gt=(W,G)=>Q.check(c6(W,G)),Q.gte=(W,G)=>Q.check(i1(W,G)),Q.min=(W,G)=>Q.check(i1(W,G)),Q.lt=(W,G)=>Q.check(m6(W,G)),Q.lte=(W,G)=>Q.check(p1(W,G)),Q.max=(W,G)=>Q.check(p1(W,G)),Q.int=(W)=>Q.check(xW(W)),Q.safe=(W)=>Q.check(xW(W)),Q.positive=(W)=>Q.check(c6(0,W)),Q.nonnegative=(W)=>Q.check(i1(0,W)),Q.negative=(W)=>Q.check(m6(0,W)),Q.nonpositive=(W)=>Q.check(p1(0,W)),Q.multipleOf=(W,G)=>Q.check(p6(W,G)),Q.step=(W,G)=>Q.check(p6(W,G)),Q.finite=()=>Q;let Y=Q._zod.bag;Q.minValue=Math.max(Y.minimum??Number.NEGATIVE_INFINITY,Y.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,Q.maxValue=Math.min(Y.maximum??Number.POSITIVE_INFINITY,Y.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,Q.isInt=(Y.format??"").includes("int")||Number.isSafeInteger(Y.multipleOf??0.5),Q.isFinite=!0,Q.format=Y.format??null});function f(Q){return JW(gW,Q)}var MH=F("ZodNumberFormat",(Q,X)=>{HY.init(Q,X),gW.init(Q,X)});function xW(Q){return $W(MH,Q)}var VH=F("ZodBoolean",(Q,X)=>{BY.init(Q,X),a.init(Q,X)});function e(Q){return zW(VH,Q)}var ZH=F("ZodNull",(Q,X)=>{KY.init(Q,X),a.init(Q,X)});function xQ(Q){return HW(ZH,Q)}var NH=F("ZodUnknown",(Q,X)=>{DY.init(Q,X),a.init(Q,X)});function r(){return BW(NH)}var qH=F("ZodNever",(Q,X)=>{AY.init(Q,X),a.init(Q,X)});function wH(Q){return KW(qH,Q)}var jH=F("ZodArray",(Q,X)=>{FY.init(Q,X),a.init(Q,X),Q.element=X.element,Q.min=(Y,W)=>Q.check(O1(Y,W)),Q.nonempty=(Y)=>Q.check(O1(1,Y)),Q.max=(Y,W)=>Q.check(i6(Y,W)),Q.length=(Y,W)=>Q.check(n6(Y,W)),Q.unwrap=()=>Q.element});function x(Q,X){return DW(jH,Q,X)}var hW=F("ZodObject",(Q,X)=>{OY.init(Q,X),a.init(Q,X),h.defineLazy(Q,"shape",()=>{return X.shape}),Q.keyof=()=>K0(Object.keys(Q._zod.def.shape)),Q.catchall=(Y)=>Q.clone({...Q._zod.def,catchall:Y}),Q.passthrough=()=>Q.clone({...Q._zod.def,catchall:r()}),Q.loose=()=>Q.clone({...Q._zod.def,catchall:r()}),Q.strict=()=>Q.clone({...Q._zod.def,catchall:wH()}),Q.strip=()=>Q.clone({...Q._zod.def,catchall:void 0}),Q.extend=(Y)=>{return h.extend(Q,Y)},Q.safeExtend=(Y)=>{return h.safeExtend(Q,Y)},Q.merge=(Y)=>h.merge(Q,Y),Q.pick=(Y)=>h.pick(Q,Y),Q.omit=(Y)=>h.omit(Q,Y),Q.partial=(...Y)=>h.partial(lW,Q,Y[0]),Q.required=(...Y)=>h.required(mW,Q,Y[0])});function q(Q,X){let Y={type:"object",shape:Q??{},...h.normalizeParams(X)};return new hW(Y)}function z0(Q,X){return new hW({type:"object",shape:Q,catchall:r(),...h.normalizeParams(X)})}var uW=F("ZodUnion",(Q,X)=>{LQ.init(Q,X),a.init(Q,X),Q.options=X.options});function c(Q,X){return new uW({type:"union",options:Q,...h.normalizeParams(X)})}var PH=F("ZodDiscriminatedUnion",(Q,X)=>{uW.init(Q,X),MY.init(Q,X)});function _Q(Q,X,Y){return new PH({type:"union",options:X,discriminator:Q,...h.normalizeParams(Y)})}var bH=F("ZodIntersection",(Q,X)=>{VY.init(Q,X),a.init(Q,X)});function o6(Q,X){return new bH({type:"intersection",left:Q,right:X})}var EH=F("ZodRecord",(Q,X)=>{ZY.init(Q,X),a.init(Q,X),Q.keyType=X.keyType,Q.valueType=X.valueType});function o(Q,X,Y){return new EH({type:"record",keyType:Q,valueType:X,...h.normalizeParams(Y)})}var kQ=F("ZodEnum",(Q,X)=>{NY.init(Q,X),a.init(Q,X),Q.enum=X.entries,Q.options=Object.values(X.entries);let Y=new Set(Object.keys(X.entries));Q.extract=(W,G)=>{let J={};for(let $ of W)if(Y.has($))J[$]=X.entries[$];else throw Error(`Key ${$} not found in enum`);return new kQ({...X,checks:[],...h.normalizeParams(G),entries:J})},Q.exclude=(W,G)=>{let J={...X.entries};for(let $ of W)if(Y.has($))delete J[$];else throw Error(`Key ${$} not found in enum`);return new kQ({...X,checks:[],...h.normalizeParams(G),entries:J})}});function K0(Q,X){let Y=Array.isArray(Q)?Object.fromEntries(Q.map((W)=>[W,W])):Q;return new kQ({type:"enum",entries:Y,...h.normalizeParams(X)})}var IH=F("ZodLiteral",(Q,X)=>{qY.init(Q,X),a.init(Q,X),Q.values=new Set(X.values),Object.defineProperty(Q,"value",{get(){if(X.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return X.values[0]}})});function j(Q,X){return new IH({type:"literal",values:Array.isArray(Q)?Q:[Q],...h.normalizeParams(X)})}var TH=F("ZodTransform",(Q,X)=>{wY.init(Q,X),a.init(Q,X),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")throw new x1(Q.constructor.name);Y.addIssue=(J)=>{if(typeof J==="string")Y.issues.push(h.issue(J,Y.value,X));else{let $=J;if($.fatal)$.continue=!1;$.code??($.code="custom"),$.input??($.input=Y.value),$.inst??($.inst=Q),Y.issues.push(h.issue($))}};let G=X.transform(Y.value,Y);if(G instanceof Promise)return G.then((J)=>{return Y.value=J,Y});return Y.value=G,Y}});function fW(Q){return new TH({type:"transform",transform:Q})}var lW=F("ZodOptional",(Q,X)=>{jY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function t(Q){return new lW({type:"optional",innerType:Q})}var SH=F("ZodNullable",(Q,X)=>{PY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function _W(Q){return new SH({type:"nullable",innerType:Q})}var RH=F("ZodDefault",(Q,X)=>{bY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType,Q.removeDefault=Q.unwrap});function CH(Q,X){return new RH({type:"default",innerType:Q,get defaultValue(){return typeof X==="function"?X():h.shallowClone(X)}})}var kH=F("ZodPrefault",(Q,X)=>{EY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function vH(Q,X){return new kH({type:"prefault",innerType:Q,get defaultValue(){return typeof X==="function"?X():h.shallowClone(X)}})}var mW=F("ZodNonOptional",(Q,X)=>{IY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function xH(Q,X){return new mW({type:"nonoptional",innerType:Q,...h.normalizeParams(X)})}var _H=F("ZodCatch",(Q,X)=>{TY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType,Q.removeCatch=Q.unwrap});function yH(Q,X){return new _H({type:"catch",innerType:Q,catchValue:typeof X==="function"?X:()=>X})}var gH=F("ZodPipe",(Q,X)=>{SY.init(Q,X),a.init(Q,X),Q.in=X.in,Q.out=X.out});function vQ(Q,X){return new gH({type:"pipe",in:Q,out:X})}var hH=F("ZodReadonly",(Q,X)=>{RY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function uH(Q){return new hH({type:"readonly",innerType:Q})}var cW=F("ZodCustom",(Q,X)=>{CY.init(Q,X),a.init(Q,X)});function pW(Q,X){return AW(cW,Q??(()=>!0),X)}function fH(Q,X={}){return FW(cW,Q,X)}function lH(Q){return UW(Q)}function yQ(Q,X){return vQ(fW(Q),X)}M0(OQ());var gQ="2025-11-25";var iW=[gQ,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],o0="io.modelcontextprotocol/related-task",a6="2.0",X0=pW((Q)=>Q!==null&&(typeof Q==="object"||typeof Q==="function")),nW=c([A(),f().int()]),dW=A(),cZ=z0({ttl:c([f(),xQ()]).optional(),pollInterval:f().optional()}),mH=q({ttl:f().optional()}),cH=q({taskId:A()}),hQ=z0({progressToken:nW.optional(),[o0]:cH.optional()}),O0=q({_meta:hQ.optional()}),r1=O0.extend({task:mH.optional()}),rW=(Q)=>r1.safeParse(Q).success,Y0=q({method:A(),params:O0.loose().optional()}),V0=q({_meta:hQ.optional()}),Z0=q({method:A(),params:V0.loose().optional()}),W0=z0({_meta:hQ.optional()}),s6=c([A(),f().int()]),oW=q({jsonrpc:j(a6),id:s6,...Y0.shape}).strict(),uQ=(Q)=>oW.safeParse(Q).success,tW=q({jsonrpc:j(a6),...Z0.shape}).strict(),aW=(Q)=>tW.safeParse(Q).success,fQ=q({jsonrpc:j(a6),id:s6,result:W0}).strict(),o1=(Q)=>fQ.safeParse(Q).success;var _;(function(Q){Q[Q.ConnectionClosed=-32000]="ConnectionClosed",Q[Q.RequestTimeout=-32001]="RequestTimeout",Q[Q.ParseError=-32700]="ParseError",Q[Q.InvalidRequest=-32600]="InvalidRequest",Q[Q.MethodNotFound=-32601]="MethodNotFound",Q[Q.InvalidParams=-32602]="InvalidParams",Q[Q.InternalError=-32603]="InternalError",Q[Q.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(_||(_={}));var lQ=q({jsonrpc:j(a6),id:s6.optional(),error:q({code:f().int(),message:A(),data:r().optional()})}).strict();var sW=(Q)=>lQ.safeParse(Q).success;var eW=c([oW,tW,fQ,lQ]),pZ=c([fQ,lQ]),e6=W0.strict(),pH=V0.extend({requestId:s6.optional(),reason:A().optional()}),Q4=Z0.extend({method:j("notifications/cancelled"),params:pH}),iH=q({src:A(),mimeType:A().optional(),sizes:x(A()).optional(),theme:K0(["light","dark"]).optional()}),t1=q({icons:x(iH).optional()}),V1=q({name:A(),title:A().optional()}),QG=V1.extend({...V1.shape,...t1.shape,version:A(),websiteUrl:A().optional(),description:A().optional()}),nH=o6(q({applyDefaults:e().optional()}),o(A(),r())),dH=yQ((Q)=>{if(Q&&typeof Q==="object"&&!Array.isArray(Q)){if(Object.keys(Q).length===0)return{form:{}}}return Q},o6(q({form:nH.optional(),url:X0.optional()}),o(A(),r()).optional())),rH=z0({list:X0.optional(),cancel:X0.optional(),requests:z0({sampling:z0({createMessage:X0.optional()}).optional(),elicitation:z0({create:X0.optional()}).optional()}).optional()}),oH=z0({list:X0.optional(),cancel:X0.optional(),requests:z0({tools:z0({call:X0.optional()}).optional()}).optional()}),tH=q({experimental:o(A(),X0).optional(),sampling:q({context:X0.optional(),tools:X0.optional()}).optional(),elicitation:dH.optional(),roots:q({listChanged:e().optional()}).optional(),tasks:rH.optional()}),aH=O0.extend({protocolVersion:A(),capabilities:tH,clientInfo:QG}),mQ=Y0.extend({method:j("initialize"),params:aH});var sH=q({experimental:o(A(),X0).optional(),logging:X0.optional(),completions:X0.optional(),prompts:q({listChanged:e().optional()}).optional(),resources:q({subscribe:e().optional(),listChanged:e().optional()}).optional(),tools:q({listChanged:e().optional()}).optional(),tasks:oH.optional()}),eH=W0.extend({protocolVersion:A(),capabilities:sH,serverInfo:QG,instructions:A().optional()}),cQ=Z0.extend({method:j("notifications/initialized"),params:V0.optional()});var X4=Y0.extend({method:j("ping"),params:O0.optional()}),Q3=q({progress:f(),total:t(f()),message:t(A())}),X3=q({...V0.shape,...Q3.shape,progressToken:nW}),Y4=Z0.extend({method:j("notifications/progress"),params:X3}),Y3=O0.extend({cursor:dW.optional()}),a1=Y0.extend({params:Y3.optional()}),s1=W0.extend({nextCursor:dW.optional()}),W3=K0(["working","input_required","completed","failed","cancelled"]),e1=q({taskId:A(),status:W3,ttl:c([f(),xQ()]),createdAt:A(),lastUpdatedAt:A(),pollInterval:t(f()),statusMessage:t(A())}),Z1=W0.extend({task:e1}),G3=V0.merge(e1),Q6=Z0.extend({method:j("notifications/tasks/status"),params:G3}),W4=Y0.extend({method:j("tasks/get"),params:O0.extend({taskId:A()})}),G4=W0.merge(e1),J4=Y0.extend({method:j("tasks/result"),params:O0.extend({taskId:A()})}),iZ=W0.loose(),$4=a1.extend({method:j("tasks/list")}),z4=s1.extend({tasks:x(e1)}),H4=Y0.extend({method:j("tasks/cancel"),params:O0.extend({taskId:A()})}),XG=W0.merge(e1),YG=q({uri:A(),mimeType:t(A()),_meta:o(A(),r()).optional()}),WG=YG.extend({text:A()}),pQ=A().refine((Q)=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),GG=YG.extend({blob:pQ}),X6=K0(["user","assistant"]),N1=q({audience:x(X6).optional(),priority:f().min(0).max(1).optional(),lastModified:d1.datetime({offset:!0}).optional()}),JG=q({...V1.shape,...t1.shape,uri:A(),description:t(A()),mimeType:t(A()),annotations:N1.optional(),_meta:t(z0({}))}),J3=q({...V1.shape,...t1.shape,uriTemplate:A(),description:t(A()),mimeType:t(A()),annotations:N1.optional(),_meta:t(z0({}))}),iQ=a1.extend({method:j("resources/list")}),$3=s1.extend({resources:x(JG)}),z3=a1.extend({method:j("resources/templates/list")}),H3=s1.extend({resourceTemplates:x(J3)}),nQ=O0.extend({uri:A()}),B3=nQ,dQ=Y0.extend({method:j("resources/read"),params:B3}),K3=W0.extend({contents:x(c([WG,GG]))}),D3=Z0.extend({method:j("notifications/resources/list_changed"),params:V0.optional()}),A3=nQ,F3=Y0.extend({method:j("resources/subscribe"),params:A3}),U3=nQ,L3=Y0.extend({method:j("resources/unsubscribe"),params:U3}),O3=V0.extend({uri:A()}),M3=Z0.extend({method:j("notifications/resources/updated"),params:O3}),V3=q({name:A(),description:t(A()),required:t(e())}),Z3=q({...V1.shape,...t1.shape,description:t(A()),arguments:t(x(V3)),_meta:t(z0({}))}),N3=a1.extend({method:j("prompts/list")}),q3=s1.extend({prompts:x(Z3)}),w3=O0.extend({name:A(),arguments:o(A(),A()).optional()}),j3=Y0.extend({method:j("prompts/get"),params:w3}),rQ=q({type:j("text"),text:A(),annotations:N1.optional(),_meta:o(A(),r()).optional()}),oQ=q({type:j("image"),data:pQ,mimeType:A(),annotations:N1.optional(),_meta:o(A(),r()).optional()}),tQ=q({type:j("audio"),data:pQ,mimeType:A(),annotations:N1.optional(),_meta:o(A(),r()).optional()}),P3=q({type:j("tool_use"),name:A(),id:A(),input:o(A(),r()),_meta:o(A(),r()).optional()}),b3=q({type:j("resource"),resource:c([WG,GG]),annotations:N1.optional(),_meta:o(A(),r()).optional()}),E3=JG.extend({type:j("resource_link")}),aQ=c([rQ,oQ,tQ,E3,b3]),I3=q({role:X6,content:aQ}),T3=W0.extend({description:A().optional(),messages:x(I3)}),S3=Z0.extend({method:j("notifications/prompts/list_changed"),params:V0.optional()}),R3=q({title:A().optional(),readOnlyHint:e().optional(),destructiveHint:e().optional(),idempotentHint:e().optional(),openWorldHint:e().optional()}),C3=q({taskSupport:K0(["required","optional","forbidden"]).optional()}),$G=q({...V1.shape,...t1.shape,description:A().optional(),inputSchema:q({type:j("object"),properties:o(A(),X0).optional(),required:x(A()).optional()}).catchall(r()),outputSchema:q({type:j("object"),properties:o(A(),X0).optional(),required:x(A()).optional()}).catchall(r()).optional(),annotations:R3.optional(),execution:C3.optional(),_meta:o(A(),r()).optional()}),sQ=a1.extend({method:j("tools/list")}),k3=s1.extend({tools:x($G)}),B4=W0.extend({content:x(aQ).default([]),structuredContent:o(A(),r()).optional(),isError:e().optional()}),nZ=B4.or(W0.extend({toolResult:r()})),v3=r1.extend({name:A(),arguments:o(A(),r()).optional()}),Y6=Y0.extend({method:j("tools/call"),params:v3}),x3=Z0.extend({method:j("notifications/tools/list_changed"),params:V0.optional()}),dZ=q({autoRefresh:e().default(!0),debounceMs:f().int().nonnegative().default(300)}),W6=K0(["debug","info","notice","warning","error","critical","alert","emergency"]),_3=O0.extend({level:W6}),eQ=Y0.extend({method:j("logging/setLevel"),params:_3}),y3=V0.extend({level:W6,logger:A().optional(),data:r()}),g3=Z0.extend({method:j("notifications/message"),params:y3}),h3=q({name:A().optional()}),u3=q({hints:x(h3).optional(),costPriority:f().min(0).max(1).optional(),speedPriority:f().min(0).max(1).optional(),intelligencePriority:f().min(0).max(1).optional()}),f3=q({mode:K0(["auto","required","none"]).optional()}),l3=q({type:j("tool_result"),toolUseId:A().describe("The unique identifier for the corresponding tool call."),content:x(aQ).default([]),structuredContent:q({}).loose().optional(),isError:e().optional(),_meta:o(A(),r()).optional()}),m3=_Q("type",[rQ,oQ,tQ]),t6=_Q("type",[rQ,oQ,tQ,P3,l3]),c3=q({role:X6,content:c([t6,x(t6)]),_meta:o(A(),r()).optional()}),p3=r1.extend({messages:x(c3),modelPreferences:u3.optional(),systemPrompt:A().optional(),includeContext:K0(["none","thisServer","allServers"]).optional(),temperature:f().optional(),maxTokens:f().int(),stopSequences:x(A()).optional(),metadata:X0.optional(),tools:x($G).optional(),toolChoice:f3.optional()}),i3=Y0.extend({method:j("sampling/createMessage"),params:p3}),Q9=W0.extend({model:A(),stopReason:t(K0(["endTurn","stopSequence","maxTokens"]).or(A())),role:X6,content:m3}),X9=W0.extend({model:A(),stopReason:t(K0(["endTurn","stopSequence","maxTokens","toolUse"]).or(A())),role:X6,content:c([t6,x(t6)])}),n3=q({type:j("boolean"),title:A().optional(),description:A().optional(),default:e().optional()}),d3=q({type:j("string"),title:A().optional(),description:A().optional(),minLength:f().optional(),maxLength:f().optional(),format:K0(["email","uri","date","date-time"]).optional(),default:A().optional()}),r3=q({type:K0(["number","integer"]),title:A().optional(),description:A().optional(),minimum:f().optional(),maximum:f().optional(),default:f().optional()}),o3=q({type:j("string"),title:A().optional(),description:A().optional(),enum:x(A()),default:A().optional()}),t3=q({type:j("string"),title:A().optional(),description:A().optional(),oneOf:x(q({const:A(),title:A()})),default:A().optional()}),a3=q({type:j("string"),title:A().optional(),description:A().optional(),enum:x(A()),enumNames:x(A()).optional(),default:A().optional()}),s3=c([o3,t3]),e3=q({type:j("array"),title:A().optional(),description:A().optional(),minItems:f().optional(),maxItems:f().optional(),items:q({type:j("string"),enum:x(A())}),default:x(A()).optional()}),QB=q({type:j("array"),title:A().optional(),description:A().optional(),minItems:f().optional(),maxItems:f().optional(),items:q({anyOf:x(q({const:A(),title:A()}))}),default:x(A()).optional()}),XB=c([e3,QB]),YB=c([a3,s3,XB]),WB=c([YB,n3,d3,r3]),GB=r1.extend({mode:j("form").optional(),message:A(),requestedSchema:q({type:j("object"),properties:o(A(),WB),required:x(A()).optional()})}),JB=r1.extend({mode:j("url"),message:A(),elicitationId:A(),url:A().url()}),$B=c([GB,JB]),zB=Y0.extend({method:j("elicitation/create"),params:$B}),HB=V0.extend({elicitationId:A()}),BB=Z0.extend({method:j("notifications/elicitation/complete"),params:HB}),K4=W0.extend({action:K0(["accept","decline","cancel"]),content:yQ((Q)=>Q===null?void 0:Q,o(A(),c([A(),f(),e(),x(A())])).optional())}),KB=q({type:j("ref/resource"),uri:A()});var DB=q({type:j("ref/prompt"),name:A()}),AB=O0.extend({ref:c([DB,KB]),argument:q({name:A(),value:A()}),context:q({arguments:o(A(),A()).optional()}).optional()}),FB=Y0.extend({method:j("completion/complete"),params:AB});var UB=W0.extend({completion:z0({values:x(A()).max(100),total:t(f().int()),hasMore:t(e())})}),LB=q({uri:A().startsWith("file://"),name:A().optional(),_meta:o(A(),r()).optional()}),OB=Y0.extend({method:j("roots/list"),params:O0.optional()}),Y9=W0.extend({roots:x(LB)}),MB=Z0.extend({method:j("notifications/roots/list_changed"),params:V0.optional()}),rZ=c([X4,mQ,FB,eQ,j3,N3,iQ,z3,dQ,F3,L3,Y6,sQ,W4,J4,$4,H4]),oZ=c([Q4,Y4,cQ,MB,Q6]),tZ=c([e6,Q9,X9,K4,Y9,G4,z4,Z1]),aZ=c([X4,i3,zB,OB,W4,J4,$4,H4]),sZ=c([Q4,Y4,g3,M3,D3,x3,S3,Q6,BB]),eZ=c([e6,eH,UB,T3,q3,$3,H3,K3,B4,k3,G4,z4,Z1]);class C extends Error{constructor(Q,X,Y){super(`MCP error ${Q}: ${X}`);this.code=Q,this.data=Y,this.name="McpError"}static fromError(Q,X,Y){if(Q===_.UrlElicitationRequired&&Y){let W=Y;if(W.elicitations)return new zG(W.elicitations,X)}return new C(Q,X,Y)}}class zG extends C{constructor(Q,X=`URL elicitation${Q.length>1?"s":""} required`){super(_.UrlElicitationRequired,X,{elicitations:Q})}get elicitations(){return this.data?.elicitations??[]}}function t0(Q){return Q==="completed"||Q==="failed"||Q==="cancelled"}var VB=Symbol("Let zodToJsonSchema decide on which parser to use");var kN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function W9(Q){let Y=d6(Q)?.method;if(!Y)throw Error("Schema is missing a method literal");let W=LW(Y);if(typeof W!=="string")throw Error("Schema method literal must be a string");return W}function G9(Q,X){let Y=r0(Q,X);if(!Y.success)throw Y.error;return Y.data}var PB=60000;class J9{constructor(Q){if(this._options=Q,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(Q4,(X)=>{this._oncancel(X)}),this.setNotificationHandler(Y4,(X)=>{this._onprogress(X)}),this.setRequestHandler(X4,(X)=>({})),this._taskStore=Q?.taskStore,this._taskMessageQueue=Q?.taskMessageQueue,this._taskStore)this.setRequestHandler(W4,async(X,Y)=>{let W=await this._taskStore.getTask(X.params.taskId,Y.sessionId);if(!W)throw new C(_.InvalidParams,"Failed to retrieve task: Task not found");return{...W}}),this.setRequestHandler(J4,async(X,Y)=>{let W=async()=>{let G=X.params.taskId;if(this._taskMessageQueue){let $;while($=await this._taskMessageQueue.dequeue(G,Y.sessionId)){if($.type==="response"||$.type==="error"){let z=$.message,H=z.id,B=this._requestResolvers.get(H);if(B)if(this._requestResolvers.delete(H),$.type==="response")B(z);else{let K=z,D=new C(K.error.code,K.error.message,K.error.data);B(D)}else{let K=$.type==="response"?"Response":"Error";this._onerror(Error(`${K} handler missing for request ${H}`))}continue}await this._transport?.send($.message,{relatedRequestId:Y.requestId})}}let J=await this._taskStore.getTask(G,Y.sessionId);if(!J)throw new C(_.InvalidParams,`Task not found: ${G}`);if(!t0(J.status))return await this._waitForTaskUpdate(G,Y.signal),await W();if(t0(J.status)){let $=await this._taskStore.getTaskResult(G,Y.sessionId);return this._clearTaskQueue(G),{...$,_meta:{...$._meta,[o0]:{taskId:G}}}}return await W()};return await W()}),this.setRequestHandler($4,async(X,Y)=>{try{let{tasks:W,nextCursor:G}=await this._taskStore.listTasks(X.params?.cursor,Y.sessionId);return{tasks:W,nextCursor:G,_meta:{}}}catch(W){throw new C(_.InvalidParams,`Failed to list tasks: ${W instanceof Error?W.message:String(W)}`)}}),this.setRequestHandler(H4,async(X,Y)=>{try{let W=await this._taskStore.getTask(X.params.taskId,Y.sessionId);if(!W)throw new C(_.InvalidParams,`Task not found: ${X.params.taskId}`);if(t0(W.status))throw new C(_.InvalidParams,`Cannot cancel task in terminal status: ${W.status}`);await this._taskStore.updateTaskStatus(X.params.taskId,"cancelled","Client cancelled task execution.",Y.sessionId),this._clearTaskQueue(X.params.taskId);let G=await this._taskStore.getTask(X.params.taskId,Y.sessionId);if(!G)throw new C(_.InvalidParams,`Task not found after cancellation: ${X.params.taskId}`);return{_meta:{},...G}}catch(W){if(W instanceof C)throw W;throw new C(_.InvalidRequest,`Failed to cancel task: ${W instanceof Error?W.message:String(W)}`)}})}async _oncancel(Q){if(!Q.params.requestId)return;this._requestHandlerAbortControllers.get(Q.params.requestId)?.abort(Q.params.reason)}_setupTimeout(Q,X,Y,W,G=!1){this._timeoutInfo.set(Q,{timeoutId:setTimeout(W,X),startTime:Date.now(),timeout:X,maxTotalTimeout:Y,resetTimeoutOnProgress:G,onTimeout:W})}_resetTimeout(Q){let X=this._timeoutInfo.get(Q);if(!X)return!1;let Y=Date.now()-X.startTime;if(X.maxTotalTimeout&&Y>=X.maxTotalTimeout)throw this._timeoutInfo.delete(Q),C.fromError(_.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:X.maxTotalTimeout,totalElapsed:Y});return clearTimeout(X.timeoutId),X.timeoutId=setTimeout(X.onTimeout,X.timeout),!0}_cleanupTimeout(Q){let X=this._timeoutInfo.get(Q);if(X)clearTimeout(X.timeoutId),this._timeoutInfo.delete(Q)}async connect(Q){this._transport=Q;let X=this.transport?.onclose;this._transport.onclose=()=>{X?.(),this._onclose()};let Y=this.transport?.onerror;this._transport.onerror=(G)=>{Y?.(G),this._onerror(G)};let W=this._transport?.onmessage;this._transport.onmessage=(G,J)=>{if(W?.(G,J),o1(G)||sW(G))this._onresponse(G);else if(uQ(G))this._onrequest(G,J);else if(aW(G))this._onnotification(G);else this._onerror(Error(`Unknown message type: ${JSON.stringify(G)}`))},await this._transport.start()}_onclose(){let Q=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let X=C.fromError(_.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let Y of Q.values())Y(X)}_onerror(Q){this.onerror?.(Q)}_onnotification(Q){let X=this._notificationHandlers.get(Q.method)??this.fallbackNotificationHandler;if(X===void 0)return;Promise.resolve().then(()=>X(Q)).catch((Y)=>this._onerror(Error(`Uncaught error in notification handler: ${Y}`)))}_onrequest(Q,X){let Y=this._requestHandlers.get(Q.method)??this.fallbackRequestHandler,W=this._transport,G=Q.params?._meta?.[o0]?.taskId;if(Y===void 0){let B={jsonrpc:"2.0",id:Q.id,error:{code:_.MethodNotFound,message:"Method not found"}};if(G&&this._taskMessageQueue)this._enqueueTaskMessage(G,{type:"error",message:B,timestamp:Date.now()},W?.sessionId).catch((K)=>this._onerror(Error(`Failed to enqueue error response: ${K}`)));else W?.send(B).catch((K)=>this._onerror(Error(`Failed to send an error response: ${K}`)));return}let J=new AbortController;this._requestHandlerAbortControllers.set(Q.id,J);let $=rW(Q.params)?Q.params.task:void 0,z=this._taskStore?this.requestTaskStore(Q,W?.sessionId):void 0,H={signal:J.signal,sessionId:W?.sessionId,_meta:Q.params?._meta,sendNotification:async(B)=>{let K={relatedRequestId:Q.id};if(G)K.relatedTask={taskId:G};await this.notification(B,K)},sendRequest:async(B,K,D)=>{let U={...D,relatedRequestId:Q.id};if(G&&!U.relatedTask)U.relatedTask={taskId:G};let L=U.relatedTask?.taskId??G;if(L&&z)await z.updateTaskStatus(L,"input_required");return await this.request(B,K,U)},authInfo:X?.authInfo,requestId:Q.id,requestInfo:X?.requestInfo,taskId:G,taskStore:z,taskRequestedTtl:$?.ttl,closeSSEStream:X?.closeSSEStream,closeStandaloneSSEStream:X?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if($)this.assertTaskHandlerCapability(Q.method)}).then(()=>Y(Q,H)).then(async(B)=>{if(J.signal.aborted)return;let K={result:B,jsonrpc:"2.0",id:Q.id};if(G&&this._taskMessageQueue)await this._enqueueTaskMessage(G,{type:"response",message:K,timestamp:Date.now()},W?.sessionId);else await W?.send(K)},async(B)=>{if(J.signal.aborted)return;let K={jsonrpc:"2.0",id:Q.id,error:{code:Number.isSafeInteger(B.code)?B.code:_.InternalError,message:B.message??"Internal error",...B.data!==void 0&&{data:B.data}}};if(G&&this._taskMessageQueue)await this._enqueueTaskMessage(G,{type:"error",message:K,timestamp:Date.now()},W?.sessionId);else await W?.send(K)}).catch((B)=>this._onerror(Error(`Failed to send response: ${B}`))).finally(()=>{this._requestHandlerAbortControllers.delete(Q.id)})}_onprogress(Q){let{progressToken:X,...Y}=Q.params,W=Number(X),G=this._progressHandlers.get(W);if(!G){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(Q)}`));return}let J=this._responseHandlers.get(W),$=this._timeoutInfo.get(W);if($&&J&&$.resetTimeoutOnProgress)try{this._resetTimeout(W)}catch(z){this._responseHandlers.delete(W),this._progressHandlers.delete(W),this._cleanupTimeout(W),J(z);return}G(Y)}_onresponse(Q){let X=Number(Q.id),Y=this._requestResolvers.get(X);if(Y){if(this._requestResolvers.delete(X),o1(Q))Y(Q);else{let J=new C(Q.error.code,Q.error.message,Q.error.data);Y(J)}return}let W=this._responseHandlers.get(X);if(W===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(Q)}`));return}this._responseHandlers.delete(X),this._cleanupTimeout(X);let G=!1;if(o1(Q)&&Q.result&&typeof Q.result==="object"){let J=Q.result;if(J.task&&typeof J.task==="object"){let $=J.task;if(typeof $.taskId==="string")G=!0,this._taskProgressTokens.set($.taskId,X)}}if(!G)this._progressHandlers.delete(X);if(o1(Q))W(Q);else{let J=C.fromError(Q.error.code,Q.error.message,Q.error.data);W(J)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(Q,X,Y){let{task:W}=Y??{};if(!W){try{yield{type:"result",result:await this.request(Q,X,Y)}}catch(J){yield{type:"error",error:J instanceof C?J:new C(_.InternalError,String(J))}}return}let G;try{let J=await this.request(Q,Z1,Y);if(J.task)G=J.task.taskId,yield{type:"taskCreated",task:J.task};else throw new C(_.InternalError,"Task creation did not return a task");while(!0){let $=await this.getTask({taskId:G},Y);if(yield{type:"taskStatus",task:$},t0($.status)){if($.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:G},X,Y)};else if($.status==="failed")yield{type:"error",error:new C(_.InternalError,`Task ${G} failed`)};else if($.status==="cancelled")yield{type:"error",error:new C(_.InternalError,`Task ${G} was cancelled`)};return}if($.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:G},X,Y)};return}let z=$.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((H)=>setTimeout(H,z)),Y?.signal?.throwIfAborted()}}catch(J){yield{type:"error",error:J instanceof C?J:new C(_.InternalError,String(J))}}}request(Q,X,Y){let{relatedRequestId:W,resumptionToken:G,onresumptiontoken:J,task:$,relatedTask:z}=Y??{};return new Promise((H,B)=>{let K=(V)=>{B(V)};if(!this._transport){K(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod(Q.method),$)this.assertTaskCapability(Q.method)}catch(V){K(V);return}Y?.signal?.throwIfAborted();let D=this._requestMessageId++,U={...Q,jsonrpc:"2.0",id:D};if(Y?.onprogress)this._progressHandlers.set(D,Y.onprogress),U.params={...Q.params,_meta:{...Q.params?._meta||{},progressToken:D}};if($)U.params={...U.params,task:$};if(z)U.params={...U.params,_meta:{...U.params?._meta||{},[o0]:z}};let L=(V)=>{this._responseHandlers.delete(D),this._progressHandlers.delete(D),this._cleanupTimeout(D),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:D,reason:String(V)}},{relatedRequestId:W,resumptionToken:G,onresumptiontoken:J}).catch((E)=>this._onerror(Error(`Failed to send cancellation: ${E}`)));let T=V instanceof C?V:new C(_.RequestTimeout,String(V));B(T)};this._responseHandlers.set(D,(V)=>{if(Y?.signal?.aborted)return;if(V instanceof Error)return B(V);try{let T=r0(X,V.result);if(!T.success)B(T.error);else H(T.data)}catch(T){B(T)}}),Y?.signal?.addEventListener("abort",()=>{L(Y?.signal?.reason)});let O=Y?.timeout??PB,M=()=>L(C.fromError(_.RequestTimeout,"Request timed out",{timeout:O}));this._setupTimeout(D,O,Y?.maxTotalTimeout,M,Y?.resetTimeoutOnProgress??!1);let Z=z?.taskId;if(Z){let V=(T)=>{let E=this._responseHandlers.get(D);if(E)E(T);else this._onerror(Error(`Response handler missing for side-channeled request ${D}`))};this._requestResolvers.set(D,V),this._enqueueTaskMessage(Z,{type:"request",message:U,timestamp:Date.now()}).catch((T)=>{this._cleanupTimeout(D),B(T)})}else this._transport.send(U,{relatedRequestId:W,resumptionToken:G,onresumptiontoken:J}).catch((V)=>{this._cleanupTimeout(D),B(V)})})}async getTask(Q,X){return this.request({method:"tasks/get",params:Q},G4,X)}async getTaskResult(Q,X,Y){return this.request({method:"tasks/result",params:Q},X,Y)}async listTasks(Q,X){return this.request({method:"tasks/list",params:Q},z4,X)}async cancelTask(Q,X){return this.request({method:"tasks/cancel",params:Q},XG,X)}async notification(Q,X){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(Q.method);let Y=X?.relatedTask?.taskId;if(Y){let $={...Q,jsonrpc:"2.0",params:{...Q.params,_meta:{...Q.params?._meta||{},[o0]:X.relatedTask}}};await this._enqueueTaskMessage(Y,{type:"notification",message:$,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(Q.method)&&!Q.params&&!X?.relatedRequestId&&!X?.relatedTask){if(this._pendingDebouncedNotifications.has(Q.method))return;this._pendingDebouncedNotifications.add(Q.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(Q.method),!this._transport)return;let $={...Q,jsonrpc:"2.0"};if(X?.relatedTask)$={...$,params:{...$.params,_meta:{...$.params?._meta||{},[o0]:X.relatedTask}}};this._transport?.send($,X).catch((z)=>this._onerror(z))});return}let J={...Q,jsonrpc:"2.0"};if(X?.relatedTask)J={...J,params:{...J.params,_meta:{...J.params?._meta||{},[o0]:X.relatedTask}}};await this._transport.send(J,X)}setRequestHandler(Q,X){let Y=W9(Q);this.assertRequestHandlerCapability(Y),this._requestHandlers.set(Y,(W,G)=>{let J=G9(Q,W);return Promise.resolve(X(J,G))})}removeRequestHandler(Q){this._requestHandlers.delete(Q)}assertCanSetRequestHandler(Q){if(this._requestHandlers.has(Q))throw Error(`A request handler for ${Q} already exists, which would be overridden`)}setNotificationHandler(Q,X){let Y=W9(Q);this._notificationHandlers.set(Y,(W)=>{let G=G9(Q,W);return Promise.resolve(X(G))})}removeNotificationHandler(Q){this._notificationHandlers.delete(Q)}_cleanupTaskProgressHandler(Q){let X=this._taskProgressTokens.get(Q);if(X!==void 0)this._progressHandlers.delete(X),this._taskProgressTokens.delete(Q)}async _enqueueTaskMessage(Q,X,Y){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let W=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(Q,X,Y,W)}async _clearTaskQueue(Q,X){if(this._taskMessageQueue){let Y=await this._taskMessageQueue.dequeueAll(Q,X);for(let W of Y)if(W.type==="request"&&uQ(W.message)){let G=W.message.id,J=this._requestResolvers.get(G);if(J)J(new C(_.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(G);else this._onerror(Error(`Resolver missing for request ${G} during task ${Q} cleanup`))}}}async _waitForTaskUpdate(Q,X){let Y=this._options?.defaultTaskPollInterval??1000;try{let W=await this._taskStore?.getTask(Q);if(W?.pollInterval)Y=W.pollInterval}catch{}return new Promise((W,G)=>{if(X.aborted){G(new C(_.InvalidRequest,"Request cancelled"));return}let J=setTimeout(W,Y);X.addEventListener("abort",()=>{clearTimeout(J),G(new C(_.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(Q,X){let Y=this._taskStore;if(!Y)throw Error("No task store configured");return{createTask:async(W)=>{if(!Q)throw Error("No request provided");return await Y.createTask(W,Q.id,{method:Q.method,params:Q.params},X)},getTask:async(W)=>{let G=await Y.getTask(W,X);if(!G)throw new C(_.InvalidParams,"Failed to retrieve task: Task not found");return G},storeTaskResult:async(W,G,J)=>{await Y.storeTaskResult(W,G,J,X);let $=await Y.getTask(W,X);if($){let z=Q6.parse({method:"notifications/tasks/status",params:$});if(await this.notification(z),t0($.status))this._cleanupTaskProgressHandler(W)}},getTaskResult:(W)=>{return Y.getTaskResult(W,X)},updateTaskStatus:async(W,G,J)=>{let $=await Y.getTask(W,X);if(!$)throw new C(_.InvalidParams,`Task "${W}" not found - it may have been cleaned up`);if(t0($.status))throw new C(_.InvalidParams,`Cannot update task "${W}" from terminal status "${$.status}" to "${G}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await Y.updateTaskStatus(W,G,J,X);let z=await Y.getTask(W,X);if(z){let H=Q6.parse({method:"notifications/tasks/status",params:z});if(await this.notification(H),t0(z.status))this._cleanupTaskProgressHandler(W)}},listTasks:(W)=>{return Y.listTasks(W,X)}}}}function HG(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function BG(Q,X){let Y={...Q};for(let W in X){let G=W,J=X[G];if(J===void 0)continue;let $=Y[G];if(HG($)&&HG(J))Y[G]={...$,...J};else Y[G]=J}return Y}var f$=ZX(e9(),1),l$=ZX(u$(),1);function vM(){let Q=new f$.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return l$.default(Q),Q}class BX{constructor(Q){this._ajv=Q??vM()}getValidator(Q){let X="$id"in Q&&typeof Q.$id==="string"?this._ajv.getSchema(Q.$id)??this._ajv.compile(Q):this._ajv.compile(Q);return(Y)=>{if(X(Y))return{valid:!0,data:Y,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(X.errors)}}}}class KX{constructor(Q){this._server=Q}requestStream(Q,X,Y){return this._server.requestStream(Q,X,Y)}async getTask(Q,X){return this._server.getTask({taskId:Q},X)}async getTaskResult(Q,X,Y){return this._server.getTaskResult({taskId:Q},X,Y)}async listTasks(Q,X){return this._server.listTasks(Q?{cursor:Q}:void 0,X)}async cancelTask(Q,X){return this._server.cancelTask({taskId:Q},X)}}function m$(Q,X,Y){if(!Q)throw Error(`${Y} does not support task creation (required for ${X})`);switch(X){case"tools/call":if(!Q.tools?.call)throw Error(`${Y} does not support task creation for tools/call (required for ${X})`);break;default:break}}function c$(Q,X,Y){if(!Q)throw Error(`${Y} does not support task creation (required for ${X})`);switch(X){case"sampling/createMessage":if(!Q.sampling?.createMessage)throw Error(`${Y} does not support task creation for sampling/createMessage (required for ${X})`);break;case"elicitation/create":if(!Q.elicitation?.create)throw Error(`${Y} does not support task creation for elicitation/create (required for ${X})`);break;default:break}}class DX extends J9{constructor(Q,X){super(X);if(this._serverInfo=Q,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(W6.options.map((Y,W)=>[Y,W])),this.isMessageIgnored=(Y,W)=>{let G=this._loggingLevels.get(W);return G?this.LOG_LEVEL_SEVERITY.get(Y)<this.LOG_LEVEL_SEVERITY.get(G):!1},this._capabilities=X?.capabilities??{},this._instructions=X?.instructions,this._jsonSchemaValidator=X?.jsonSchemaValidator??new BX,this.setRequestHandler(mQ,(Y)=>this._oninitialize(Y)),this.setNotificationHandler(cQ,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(eQ,async(Y,W)=>{let G=W.sessionId||W.requestInfo?.headers["mcp-session-id"]||void 0,{level:J}=Y.params,$=W6.safeParse(J);if($.success)this._loggingLevels.set(G,$.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new KX(this)};return this._experimental}registerCapabilities(Q){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=BG(this._capabilities,Q)}setRequestHandler(Q,X){let W=d6(Q)?.method;if(!W)throw Error("Schema is missing a method literal");let G;if(M1(W)){let $=W;G=$._zod?.def?.value??$.value}else{let $=W;G=$._def?.value??$.value}if(typeof G!=="string")throw Error("Schema method literal must be a string");if(G==="tools/call"){let $=async(z,H)=>{let B=r0(Y6,z);if(!B.success){let L=B.error instanceof Error?B.error.message:String(B.error);throw new C(_.InvalidParams,`Invalid tools/call request: ${L}`)}let{params:K}=B.data,D=await Promise.resolve(X(z,H));if(K.task){let L=r0(Z1,D);if(!L.success){let O=L.error instanceof Error?L.error.message:String(L.error);throw new C(_.InvalidParams,`Invalid task creation result: ${O}`)}return L.data}let U=r0(B4,D);if(!U.success){let L=U.error instanceof Error?U.error.message:String(U.error);throw new C(_.InvalidParams,`Invalid tools/call result: ${L}`)}return U.data};return super.setRequestHandler(Q,$)}return super.setRequestHandler(Q,X)}assertCapabilityForMethod(Q){switch(Q){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${Q})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${Q})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${Q})`);break;case"ping":break}}assertNotificationCapability(Q){switch(Q){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${Q})`);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 ${Q})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${Q})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${Q})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${Q})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(Q){if(!this._capabilities)return;switch(Q){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${Q})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${Q})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${Q})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${Q})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${Q})`);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 ${Q})`);break;case"ping":case"initialize":break}}assertTaskCapability(Q){c$(this._clientCapabilities?.tasks?.requests,Q,"Client")}assertTaskHandlerCapability(Q){if(!this._capabilities)return;m$(this._capabilities.tasks?.requests,Q,"Server")}async _oninitialize(Q){let X=Q.params.protocolVersion;return this._clientCapabilities=Q.params.capabilities,this._clientVersion=Q.params.clientInfo,{protocolVersion:iW.includes(X)?X:gQ,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"},e6)}async createMessage(Q,X){if(Q.tools||Q.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if(Q.messages.length>0){let Y=Q.messages[Q.messages.length-1],W=Array.isArray(Y.content)?Y.content:[Y.content],G=W.some((H)=>H.type==="tool_result"),J=Q.messages.length>1?Q.messages[Q.messages.length-2]:void 0,$=J?Array.isArray(J.content)?J.content:[J.content]:[],z=$.some((H)=>H.type==="tool_use");if(G){if(W.some((H)=>H.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!z)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(z){let H=new Set($.filter((K)=>K.type==="tool_use").map((K)=>K.id)),B=new Set(W.filter((K)=>K.type==="tool_result").map((K)=>K.toolUseId));if(H.size!==B.size||![...H].every((K)=>B.has(K)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(Q.tools)return this.request({method:"sampling/createMessage",params:Q},X9,X);return this.request({method:"sampling/createMessage",params:Q},Q9,X)}async elicitInput(Q,X){switch(Q.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let W=Q;return this.request({method:"elicitation/create",params:W},K4,X)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let W=Q.mode==="form"?Q:{...Q,mode:"form"},G=await this.request({method:"elicitation/create",params:W},K4,X);if(G.action==="accept"&&G.content&&W.requestedSchema)try{let $=this._jsonSchemaValidator.getValidator(W.requestedSchema)(G.content);if(!$.valid)throw new C(_.InvalidParams,`Elicitation response content does not match requested schema: ${$.errorMessage}`)}catch(J){if(J instanceof C)throw J;throw new C(_.InternalError,`Error validating elicitation response: ${J instanceof Error?J.message:String(J)}`)}return G}}}createElicitationCompletionNotifier(Q,X){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:Q}},X)}async listRoots(Q,X){return this.request({method:"roots/list",params:Q},Y9,X)}async sendLoggingMessage(Q,X){if(this._capabilities.logging){if(!this.isMessageIgnored(Q.level,X))return this.notification({method:"notifications/message",params:Q})}}async sendResourceUpdated(Q){return this.notification({method:"notifications/resources/updated",params:Q})}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"})}}import i$ from"node:process";class AX{append(Q){this._buffer=this._buffer?Buffer.concat([this._buffer,Q]):Q}readMessage(){if(!this._buffer)return null;let Q=this._buffer.indexOf(`
|
|
29
|
-
`);if(Q===-1)return null;let X=this._buffer.toString("utf8",0,Q).replace(/\r$/,"");return this._buffer=this._buffer.subarray(Q+1),
|
|
30
|
-
`}class
|
|
31
|
-
`)}var
|
|
28
|
+
`)}L.write("payload.value = newResult;"),L.write("return payload;");let T=L.compile();return(E,v)=>T(U,E,v)},J,$=G1,z=!S6.jitless,K=z&&GQ.value,B=X.catchall,D;Q._zod.parse=(U,L)=>{D??(D=W.value);let O=U.value;if(!$(O))return U.issues.push({expected:"object",code:"invalid_type",input:O,inst:Q}),U;if(z&&K&&L?.async===!1&&L.jitless!==!0){if(!J)J=G(X.shape);if(U=J(U,L),!B)return U;return OY([],O,U,L,D,Q)}return Y(U,L)}});function k8(Q,X,Y,W){for(let J of Q)if(J.issues.length===0)return X.value=J.value,X;let G=Q.filter((J)=>!d0(J));if(G.length===1)return X.value=G[0].value,G[0];return X.issues.push({code:"invalid_union",input:X.value,inst:Y,errors:Q.map((J)=>J.issues.map(($)=>j0($,W,M0())))}),X}var OQ=F("$ZodUnion",(Q,X)=>{p.init(Q,X),l(Q._zod,"optin",()=>X.options.some((G)=>G._zod.optin==="optional")?"optional":void 0),l(Q._zod,"optout",()=>X.options.some((G)=>G._zod.optout==="optional")?"optional":void 0),l(Q._zod,"values",()=>{if(X.options.every((G)=>G._zod.values))return new Set(X.options.flatMap((G)=>Array.from(G._zod.values)));return}),l(Q._zod,"pattern",()=>{if(X.options.every((G)=>G._zod.pattern)){let G=X.options.map((J)=>J._zod.pattern);return new RegExp(`^(${G.map((J)=>h1(J.source)).join("|")})$`)}return});let Y=X.options.length===1,W=X.options[0]._zod.run;Q._zod.parse=(G,J)=>{if(Y)return W(G,J);let $=!1,z=[];for(let H of X.options){let K=H._zod.run({value:G.value,issues:[]},J);if(K instanceof Promise)z.push(K),$=!0;else{if(K.issues.length===0)return K;z.push(K)}}if(!$)return k8(z,G,Q,J);return Promise.all(z).then((H)=>{return k8(H,G,Q,J)})}}),VY=F("$ZodDiscriminatedUnion",(Q,X)=>{OQ.init(Q,X);let Y=Q._zod.parse;l(Q._zod,"propValues",()=>{let G={};for(let J of X.options){let $=J._zod.propValues;if(!$||Object.keys($).length===0)throw Error(`Invalid discriminated union option at index "${X.options.indexOf(J)}"`);for(let[z,H]of Object.entries($)){if(!G[z])G[z]=new Set;for(let K of H)G[z].add(K)}}return G});let W=U1(()=>{let G=X.options,J=new Map;for(let $ of G){let z=$._zod.propValues?.[X.discriminator];if(!z||z.size===0)throw Error(`Invalid discriminated union option at index "${X.options.indexOf($)}"`);for(let H of z){if(J.has(H))throw Error(`Duplicate discriminator value "${String(H)}"`);J.set(H,$)}}return J});Q._zod.parse=(G,J)=>{let $=G.value;if(!G1($))return G.issues.push({code:"invalid_type",expected:"object",input:$,inst:Q}),G;let z=W.value.get($?.[X.discriminator]);if(z)return z._zod.run(G,J);if(X.unionFallback)return Y(G,J);return G.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:X.discriminator,input:$,path:[X.discriminator],inst:Q}),G}}),ZY=F("$ZodIntersection",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y,W)=>{let G=Y.value,J=X.left._zod.run({value:G,issues:[]},W),$=X.right._zod.run({value:G,issues:[]},W);if(J instanceof Promise||$ instanceof Promise)return Promise.all([J,$]).then(([H,K])=>{return v8(Y,H,K)});return v8(Y,J,$)}});function UQ(Q,X){if(Q===X)return{valid:!0,data:Q};if(Q instanceof Date&&X instanceof Date&&+Q===+X)return{valid:!0,data:Q};if(n0(Q)&&n0(X)){let Y=Object.keys(X),W=Object.keys(Q).filter((J)=>Y.indexOf(J)!==-1),G={...Q,...X};for(let J of W){let $=UQ(Q[J],X[J]);if(!$.valid)return{valid:!1,mergeErrorPath:[J,...$.mergeErrorPath]};G[J]=$.data}return{valid:!0,data:G}}if(Array.isArray(Q)&&Array.isArray(X)){if(Q.length!==X.length)return{valid:!1,mergeErrorPath:[]};let Y=[];for(let W=0;W<Q.length;W++){let G=Q[W],J=X[W],$=UQ(G,J);if(!$.valid)return{valid:!1,mergeErrorPath:[W,...$.mergeErrorPath]};Y.push($.data)}return{valid:!0,data:Y}}return{valid:!1,mergeErrorPath:[]}}function v8(Q,X,Y){if(X.issues.length)Q.issues.push(...X.issues);if(Y.issues.length)Q.issues.push(...Y.issues);if(d0(Q))return Q;let W=UQ(X.value,Y.value);if(!W.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(W.mergeErrorPath)}`);return Q.value=W.data,Q}var NY=F("$ZodRecord",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y,W)=>{let G=Y.value;if(!n0(G))return Y.issues.push({expected:"record",code:"invalid_type",input:G,inst:Q}),Y;let J=[];if(X.keyType._zod.values){let $=X.keyType._zod.values;Y.value={};for(let H of $)if(typeof H==="string"||typeof H==="number"||typeof H==="symbol"){let K=X.valueType._zod.run({value:G[H],issues:[]},W);if(K instanceof Promise)J.push(K.then((B)=>{if(B.issues.length)Y.issues.push(...h0(H,B.issues));Y.value[H]=B.value}));else{if(K.issues.length)Y.issues.push(...h0(H,K.issues));Y.value[H]=K.value}}let z;for(let H in G)if(!$.has(H))z=z??[],z.push(H);if(z&&z.length>0)Y.issues.push({code:"unrecognized_keys",input:G,inst:Q,keys:z})}else{Y.value={};for(let $ of Reflect.ownKeys(G)){if($==="__proto__")continue;let z=X.keyType._zod.run({value:$,issues:[]},W);if(z instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(z.issues.length){Y.issues.push({code:"invalid_key",origin:"record",issues:z.issues.map((K)=>j0(K,W,M0())),input:$,path:[$],inst:Q}),Y.value[z.value]=z.value;continue}let H=X.valueType._zod.run({value:G[$],issues:[]},W);if(H instanceof Promise)J.push(H.then((K)=>{if(K.issues.length)Y.issues.push(...h0($,K.issues));Y.value[z.value]=K.value}));else{if(H.issues.length)Y.issues.push(...h0($,H.issues));Y.value[z.value]=H.value}}}if(J.length)return Promise.all(J).then(()=>Y);return Y}});var qY=F("$ZodEnum",(Q,X)=>{p.init(Q,X);let Y=YQ(X.entries),W=new Set(Y);Q._zod.values=W,Q._zod.pattern=new RegExp(`^(${Y.filter((G)=>JQ.has(typeof G)).map((G)=>typeof G==="string"?y0(G):G.toString()).join("|")})$`),Q._zod.parse=(G,J)=>{let $=G.value;if(W.has($))return G;return G.issues.push({code:"invalid_value",values:Y,input:$,inst:Q}),G}}),wY=F("$ZodLiteral",(Q,X)=>{if(p.init(Q,X),X.values.length===0)throw Error("Cannot create literal schema with no valid values");Q._zod.values=new Set(X.values),Q._zod.pattern=new RegExp(`^(${X.values.map((Y)=>typeof Y==="string"?y0(Y):Y?y0(Y.toString()):String(Y)).join("|")})$`),Q._zod.parse=(Y,W)=>{let G=Y.value;if(Q._zod.values.has(G))return Y;return Y.issues.push({code:"invalid_value",values:X.values,input:G,inst:Q}),Y}});var jY=F("$ZodTransform",(Q,X)=>{p.init(Q,X),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")throw new x1(Q.constructor.name);let G=X.transform(Y.value,Y);if(W.async)return(G instanceof Promise?G:Promise.resolve(G)).then(($)=>{return Y.value=$,Y});if(G instanceof Promise)throw new _0;return Y.value=G,Y}});function x8(Q,X){if(Q.issues.length&&X===void 0)return{issues:[],value:void 0};return Q}var PY=F("$ZodOptional",(Q,X)=>{p.init(Q,X),Q._zod.optin="optional",Q._zod.optout="optional",l(Q._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,void 0]):void 0}),l(Q._zod,"pattern",()=>{let Y=X.innerType._zod.pattern;return Y?new RegExp(`^(${h1(Y.source)})?$`):void 0}),Q._zod.parse=(Y,W)=>{if(X.innerType._zod.optin==="optional"){let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>x8(J,Y.value));return x8(G,Y.value)}if(Y.value===void 0)return Y;return X.innerType._zod.run(Y,W)}}),bY=F("$ZodNullable",(Q,X)=>{p.init(Q,X),l(Q._zod,"optin",()=>X.innerType._zod.optin),l(Q._zod,"optout",()=>X.innerType._zod.optout),l(Q._zod,"pattern",()=>{let Y=X.innerType._zod.pattern;return Y?new RegExp(`^(${h1(Y.source)}|null)$`):void 0}),l(Q._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,null]):void 0}),Q._zod.parse=(Y,W)=>{if(Y.value===null)return Y;return X.innerType._zod.run(Y,W)}}),EY=F("$ZodDefault",(Q,X)=>{p.init(Q,X),Q._zod.optin="optional",l(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);if(Y.value===void 0)return Y.value=X.defaultValue,Y;let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>_8(J,X));return _8(G,X)}});function _8(Q,X){if(Q.value===void 0)Q.value=X.defaultValue;return Q}var IY=F("$ZodPrefault",(Q,X)=>{p.init(Q,X),Q._zod.optin="optional",l(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);if(Y.value===void 0)Y.value=X.defaultValue;return X.innerType._zod.run(Y,W)}}),TY=F("$ZodNonOptional",(Q,X)=>{p.init(Q,X),l(Q._zod,"values",()=>{let Y=X.innerType._zod.values;return Y?new Set([...Y].filter((W)=>W!==void 0)):void 0}),Q._zod.parse=(Y,W)=>{let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>y8(J,Q));return y8(G,Q)}});function y8(Q,X){if(!Q.issues.length&&Q.value===void 0)Q.issues.push({code:"invalid_type",expected:"nonoptional",input:Q.value,inst:X});return Q}var SY=F("$ZodCatch",(Q,X)=>{p.init(Q,X),l(Q._zod,"optin",()=>X.innerType._zod.optin),l(Q._zod,"optout",()=>X.innerType._zod.optout),l(Q._zod,"values",()=>X.innerType._zod.values),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>{if(Y.value=J.value,J.issues.length)Y.value=X.catchValue({...Y,error:{issues:J.issues.map(($)=>j0($,W,M0()))},input:Y.value}),Y.issues=[];return Y});if(Y.value=G.value,G.issues.length)Y.value=X.catchValue({...Y,error:{issues:G.issues.map((J)=>j0(J,W,M0()))},input:Y.value}),Y.issues=[];return Y}});var RY=F("$ZodPipe",(Q,X)=>{p.init(Q,X),l(Q._zod,"values",()=>X.in._zod.values),l(Q._zod,"optin",()=>X.in._zod.optin),l(Q._zod,"optout",()=>X.out._zod.optout),l(Q._zod,"propValues",()=>X.in._zod.propValues),Q._zod.parse=(Y,W)=>{if(W.direction==="backward"){let J=X.out._zod.run(Y,W);if(J instanceof Promise)return J.then(($)=>u6($,X.in,W));return u6(J,X.in,W)}let G=X.in._zod.run(Y,W);if(G instanceof Promise)return G.then((J)=>u6(J,X.out,W));return u6(G,X.out,W)}});function u6(Q,X,Y){if(Q.issues.length)return Q.aborted=!0,Q;return X._zod.run({value:Q.value,issues:Q.issues},Y)}var CY=F("$ZodReadonly",(Q,X)=>{p.init(Q,X),l(Q._zod,"propValues",()=>X.innerType._zod.propValues),l(Q._zod,"values",()=>X.innerType._zod.values),l(Q._zod,"optin",()=>X.innerType._zod.optin),l(Q._zod,"optout",()=>X.innerType._zod.optout),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")return X.innerType._zod.run(Y,W);let G=X.innerType._zod.run(Y,W);if(G instanceof Promise)return G.then(h8);return h8(G)}});function h8(Q){return Q.value=Object.freeze(Q.value),Q}var kY=F("$ZodCustom",(Q,X)=>{Q0.init(Q,X),p.init(Q,X),Q._zod.parse=(Y,W)=>{return Y},Q._zod.check=(Y)=>{let W=Y.value,G=X.fn(W);if(G instanceof Promise)return G.then((J)=>g8(J,Y,W,Q));g8(G,Y,W,Q);return}});function g8(Q,X,Y,W){if(!Q){let G={code:"custom",input:Y,inst:W,path:[...W._zod.def.path??[]],continue:!W._zod.def.abort};if(W._zod.def.params)G.params=W._zod.def.params;X.issues.push(L1(G))}}var mz=(Q)=>{let X=typeof Q;switch(X){case"number":return Number.isNaN(Q)?"NaN":"number";case"object":{if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Object.getPrototypeOf(Q)!==Object.prototype&&Q.constructor)return Q.constructor.name}}return X},cz=()=>{let Q={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function X(W){return Q[W]??null}let Y={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(W)=>{switch(W.code){case"invalid_type":return`Invalid input: expected ${W.expected}, received ${mz(W.input)}`;case"invalid_value":if(W.values.length===1)return`Invalid input: expected ${v6(W.values[0])}`;return`Invalid option: expected one of ${R6(W.values,"|")}`;case"too_big":{let G=W.inclusive?"<=":"<",J=X(W.origin);if(J)return`Too big: expected ${W.origin??"value"} to have ${G}${W.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${W.origin??"value"} to be ${G}${W.maximum.toString()}`}case"too_small":{let G=W.inclusive?">=":">",J=X(W.origin);if(J)return`Too small: expected ${W.origin} to have ${G}${W.minimum.toString()} ${J.unit}`;return`Too small: expected ${W.origin} to be ${G}${W.minimum.toString()}`}case"invalid_format":{let G=W;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 ${Y[G.format]??W.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${W.divisor}`;case"unrecognized_keys":return`Unrecognized key${W.keys.length>1?"s":""}: ${R6(W.keys,", ")}`;case"invalid_key":return`Invalid key in ${W.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${W.origin}`;default:return"Invalid input"}}};function MQ(){return{localeError:cz()}}var KV=Symbol("ZodOutput"),BV=Symbol("ZodInput");class vY{constructor(){this._map=new WeakMap,this._idmap=new Map}add(Q,...X){let Y=X[0];if(this._map.set(Q,Y),Y&&typeof Y==="object"&&"id"in Y){if(this._idmap.has(Y.id))throw Error(`ID ${Y.id} already exists in the registry`);this._idmap.set(Y.id,Q)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(Q){let X=this._map.get(Q);if(X&&typeof X==="object"&&"id"in X)this._idmap.delete(X.id);return this._map.delete(Q),this}get(Q){let X=Q._zod.parent;if(X){let Y={...this.get(X)??{}};delete Y.id;let W={...Y,...this._map.get(Q)};return Object.keys(W).length?W:void 0}return this._map.get(Q)}has(Q){return this._map.has(Q)}}function pz(){return new vY}var c1=pz();function xY(Q,X){return new Q({type:"string",...b(X)})}function _Y(Q,X){return new Q({type:"string",format:"email",check:"string_format",abort:!1,...b(X)})}function VQ(Q,X){return new Q({type:"string",format:"guid",check:"string_format",abort:!1,...b(X)})}function yY(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,...b(X)})}function hY(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(X)})}function gY(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(X)})}function uY(Q,X){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(X)})}function fY(Q,X){return new Q({type:"string",format:"url",check:"string_format",abort:!1,...b(X)})}function lY(Q,X){return new Q({type:"string",format:"emoji",check:"string_format",abort:!1,...b(X)})}function mY(Q,X){return new Q({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(X)})}function cY(Q,X){return new Q({type:"string",format:"cuid",check:"string_format",abort:!1,...b(X)})}function pY(Q,X){return new Q({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(X)})}function iY(Q,X){return new Q({type:"string",format:"ulid",check:"string_format",abort:!1,...b(X)})}function nY(Q,X){return new Q({type:"string",format:"xid",check:"string_format",abort:!1,...b(X)})}function dY(Q,X){return new Q({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(X)})}function rY(Q,X){return new Q({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(X)})}function oY(Q,X){return new Q({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(X)})}function tY(Q,X){return new Q({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(X)})}function aY(Q,X){return new Q({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(X)})}function sY(Q,X){return new Q({type:"string",format:"base64",check:"string_format",abort:!1,...b(X)})}function eY(Q,X){return new Q({type:"string",format:"base64url",check:"string_format",abort:!1,...b(X)})}function QW(Q,X){return new Q({type:"string",format:"e164",check:"string_format",abort:!1,...b(X)})}function XW(Q,X){return new Q({type:"string",format:"jwt",check:"string_format",abort:!1,...b(X)})}function YW(Q,X){return new Q({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(X)})}function WW(Q,X){return new Q({type:"string",format:"date",check:"string_format",...b(X)})}function GW(Q,X){return new Q({type:"string",format:"time",check:"string_format",precision:null,...b(X)})}function JW(Q,X){return new Q({type:"string",format:"duration",check:"string_format",...b(X)})}function $W(Q,X){return new Q({type:"number",checks:[],...b(X)})}function zW(Q,X){return new Q({type:"number",check:"number_format",abort:!1,format:"safeint",...b(X)})}function HW(Q,X){return new Q({type:"boolean",...b(X)})}function KW(Q,X){return new Q({type:"null",...b(X)})}function BW(Q){return new Q({type:"unknown"})}function DW(Q,X){return new Q({type:"never",...b(X)})}function m6(Q,X){return new DQ({check:"less_than",...b(X),value:Q,inclusive:!1})}function p1(Q,X){return new DQ({check:"less_than",...b(X),value:Q,inclusive:!0})}function c6(Q,X){return new AQ({check:"greater_than",...b(X),value:Q,inclusive:!1})}function i1(Q,X){return new AQ({check:"greater_than",...b(X),value:Q,inclusive:!0})}function p6(Q,X){return new M8({check:"multiple_of",...b(X),value:Q})}function i6(Q,X){return new Z8({check:"max_length",...b(X),maximum:Q})}function O1(Q,X){return new N8({check:"min_length",...b(X),minimum:Q})}function n6(Q,X){return new q8({check:"length_equals",...b(X),length:Q})}function ZQ(Q,X){return new w8({check:"string_format",format:"regex",...b(X),pattern:Q})}function NQ(Q){return new j8({check:"string_format",format:"lowercase",...b(Q)})}function qQ(Q){return new P8({check:"string_format",format:"uppercase",...b(Q)})}function wQ(Q,X){return new b8({check:"string_format",format:"includes",...b(X),includes:Q})}function jQ(Q,X){return new E8({check:"string_format",format:"starts_with",...b(X),prefix:Q})}function PQ(Q,X){return new I8({check:"string_format",format:"ends_with",...b(X),suffix:Q})}function J1(Q){return new T8({check:"overwrite",tx:Q})}function bQ(Q){return J1((X)=>X.normalize(Q))}function EQ(){return J1((Q)=>Q.trim())}function IQ(){return J1((Q)=>Q.toLowerCase())}function TQ(){return J1((Q)=>Q.toUpperCase())}function AW(Q,X,Y){return new Q({type:"array",element:X,...b(Y)})}function FW(Q,X,Y){let W=b(Y);return W.abort??(W.abort=!0),new Q({type:"custom",check:"custom",fn:X,...W})}function UW(Q,X,Y){return new Q({type:"custom",check:"custom",fn:X,...b(Y)})}function LW(Q){let X=iz((Y)=>{return Y.addIssue=(W)=>{if(typeof W==="string")Y.issues.push(L1(W,Y.value,X._zod.def));else{let G=W;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=Y.value),G.inst??(G.inst=X),G.continue??(G.continue=!X._zod.def.abort),Y.issues.push(L1(G))}},Q(Y.value,Y)});return X}function iz(Q,X){let Y=new Q0({check:"custom",...b(X)});return Y._zod.check=Q,Y}function M1(Q){return!!Q._zod}function r0(Q,X){if(M1(Q))return f1(Q,X);return Q.safeParse(X)}function d6(Q){if(!Q)return;let X;if(M1(Q))X=Q._zod?.def?.shape;else X=Q.shape;if(!X)return;if(typeof X==="function")try{return X()}catch{return}return X}function OW(Q){if(M1(Q)){let J=Q._zod?.def;if(J){if(J.value!==void 0)return J.value;if(Array.isArray(J.values)&&J.values.length>0)return J.values[0]}}let Y=Q._def;if(Y){if(Y.value!==void 0)return Y.value;if(Array.isArray(Y.values)&&Y.values.length>0)return Y.values[0]}let W=Q.value;if(W!==void 0)return W;return}var d1={};qX(d1,{time:()=>CQ,duration:()=>kQ,datetime:()=>SQ,date:()=>RQ,ZodISOTime:()=>ZW,ZodISODuration:()=>NW,ZodISODateTime:()=>MW,ZodISODate:()=>VW});var MW=F("ZodISODateTime",(Q,X)=>{t8.init(Q,X),d.init(Q,X)});function SQ(Q){return YW(MW,Q)}var VW=F("ZodISODate",(Q,X)=>{a8.init(Q,X),d.init(Q,X)});function RQ(Q){return WW(VW,Q)}var ZW=F("ZodISOTime",(Q,X)=>{s8.init(Q,X),d.init(Q,X)});function CQ(Q){return GW(ZW,Q)}var NW=F("ZodISODuration",(Q,X)=>{e8.init(Q,X),d.init(Q,X)});function kQ(Q){return JW(NW,Q)}var qW=(Q,X)=>{x6.init(Q,X),Q.name="ZodError",Object.defineProperties(Q,{format:{value:(Y)=>kX(Q,Y)},flatten:{value:(Y)=>CX(Q,Y)},addIssue:{value:(Y)=>{Q.issues.push(Y),Q.message=JSON.stringify(Q.issues,F1,2)}},addIssues:{value:(Y)=>{Q.issues.push(...Y),Q.message=JSON.stringify(Q.issues,F1,2)}},isEmpty:{get(){return Q.issues.length===0}}})},oV=F("ZodError",qW),L0=F("ZodError",qW,{Parent:Error});var wW=_6(L0),jW=y6(L0),PW=u1(L0),bW=l1(L0),EW=vX(L0),IW=xX(L0),TW=_X(L0),SW=yX(L0),RW=hX(L0),CW=gX(L0),kW=uX(L0),vW=fX(L0);var a=F("ZodType",(Q,X)=>{return p.init(Q,X),Q.def=X,Q.type=X.type,Object.defineProperty(Q,"_def",{value:X}),Q.check=(...Y)=>{return Q.clone(g.mergeDefs(X,{checks:[...X.checks??[],...Y.map((W)=>typeof W==="function"?{_zod:{check:W,def:{check:"custom"},onattach:[]}}:W)]}))},Q.clone=(Y,W)=>w0(Q,Y,W),Q.brand=()=>Q,Q.register=(Y,W)=>{return Y.add(Q,W),Q},Q.parse=(Y,W)=>wW(Q,Y,W,{callee:Q.parse}),Q.safeParse=(Y,W)=>PW(Q,Y,W),Q.parseAsync=async(Y,W)=>jW(Q,Y,W,{callee:Q.parseAsync}),Q.safeParseAsync=async(Y,W)=>bW(Q,Y,W),Q.spa=Q.safeParseAsync,Q.encode=(Y,W)=>EW(Q,Y,W),Q.decode=(Y,W)=>IW(Q,Y,W),Q.encodeAsync=async(Y,W)=>TW(Q,Y,W),Q.decodeAsync=async(Y,W)=>SW(Q,Y,W),Q.safeEncode=(Y,W)=>RW(Q,Y,W),Q.safeDecode=(Y,W)=>CW(Q,Y,W),Q.safeEncodeAsync=async(Y,W)=>kW(Q,Y,W),Q.safeDecodeAsync=async(Y,W)=>vW(Q,Y,W),Q.refine=(Y,W)=>Q.check(lH(Y,W)),Q.superRefine=(Y)=>Q.check(mH(Y)),Q.overwrite=(Y)=>Q.check(J1(Y)),Q.optional=()=>t(Q),Q.nullable=()=>yW(Q),Q.nullish=()=>t(yW(Q)),Q.nonoptional=(Y)=>_H(Q,Y),Q.array=()=>x(Q),Q.or=(Y)=>c([Q,Y]),Q.and=(Y)=>o6(Q,Y),Q.transform=(Y)=>xQ(Q,lW(Y)),Q.default=(Y)=>kH(Q,Y),Q.prefault=(Y)=>xH(Q,Y),Q.catch=(Y)=>hH(Q,Y),Q.pipe=(Y)=>xQ(Q,Y),Q.readonly=()=>fH(Q),Q.describe=(Y)=>{let W=Q.clone();return c1.add(W,{description:Y}),W},Object.defineProperty(Q,"description",{get(){return c1.get(Q)?.description},configurable:!0}),Q.meta=(...Y)=>{if(Y.length===0)return c1.get(Q);let W=Q.clone();return c1.add(W,Y[0]),W},Q.isOptional=()=>Q.safeParse(void 0).success,Q.isNullable=()=>Q.safeParse(null).success,Q}),hW=F("_ZodString",(Q,X)=>{l6.init(Q,X),a.init(Q,X);let Y=Q._zod.bag;Q.format=Y.format??null,Q.minLength=Y.minimum??null,Q.maxLength=Y.maximum??null,Q.regex=(...W)=>Q.check(ZQ(...W)),Q.includes=(...W)=>Q.check(wQ(...W)),Q.startsWith=(...W)=>Q.check(jQ(...W)),Q.endsWith=(...W)=>Q.check(PQ(...W)),Q.min=(...W)=>Q.check(O1(...W)),Q.max=(...W)=>Q.check(i6(...W)),Q.length=(...W)=>Q.check(n6(...W)),Q.nonempty=(...W)=>Q.check(O1(1,...W)),Q.lowercase=(W)=>Q.check(NQ(W)),Q.uppercase=(W)=>Q.check(qQ(W)),Q.trim=()=>Q.check(EQ()),Q.normalize=(...W)=>Q.check(bQ(...W)),Q.toLowerCase=()=>Q.check(IQ()),Q.toUpperCase=()=>Q.check(TQ())}),QH=F("ZodString",(Q,X)=>{l6.init(Q,X),hW.init(Q,X),Q.email=(Y)=>Q.check(_Y(XH,Y)),Q.url=(Y)=>Q.check(fY(YH,Y)),Q.jwt=(Y)=>Q.check(XW(MH,Y)),Q.emoji=(Y)=>Q.check(lY(WH,Y)),Q.guid=(Y)=>Q.check(VQ(xW,Y)),Q.uuid=(Y)=>Q.check(yY(r6,Y)),Q.uuidv4=(Y)=>Q.check(hY(r6,Y)),Q.uuidv6=(Y)=>Q.check(gY(r6,Y)),Q.uuidv7=(Y)=>Q.check(uY(r6,Y)),Q.nanoid=(Y)=>Q.check(mY(GH,Y)),Q.guid=(Y)=>Q.check(VQ(xW,Y)),Q.cuid=(Y)=>Q.check(cY(JH,Y)),Q.cuid2=(Y)=>Q.check(pY($H,Y)),Q.ulid=(Y)=>Q.check(iY(zH,Y)),Q.base64=(Y)=>Q.check(sY(UH,Y)),Q.base64url=(Y)=>Q.check(eY(LH,Y)),Q.xid=(Y)=>Q.check(nY(HH,Y)),Q.ksuid=(Y)=>Q.check(dY(KH,Y)),Q.ipv4=(Y)=>Q.check(rY(BH,Y)),Q.ipv6=(Y)=>Q.check(oY(DH,Y)),Q.cidrv4=(Y)=>Q.check(tY(AH,Y)),Q.cidrv6=(Y)=>Q.check(aY(FH,Y)),Q.e164=(Y)=>Q.check(QW(OH,Y)),Q.datetime=(Y)=>Q.check(SQ(Y)),Q.date=(Y)=>Q.check(RQ(Y)),Q.time=(Y)=>Q.check(CQ(Y)),Q.duration=(Y)=>Q.check(kQ(Y))});function A(Q){return xY(QH,Q)}var d=F("ZodStringFormat",(Q,X)=>{i.init(Q,X),hW.init(Q,X)}),XH=F("ZodEmail",(Q,X)=>{l8.init(Q,X),d.init(Q,X)});var xW=F("ZodGUID",(Q,X)=>{u8.init(Q,X),d.init(Q,X)});var r6=F("ZodUUID",(Q,X)=>{f8.init(Q,X),d.init(Q,X)});var YH=F("ZodURL",(Q,X)=>{m8.init(Q,X),d.init(Q,X)});var WH=F("ZodEmoji",(Q,X)=>{c8.init(Q,X),d.init(Q,X)});var GH=F("ZodNanoID",(Q,X)=>{p8.init(Q,X),d.init(Q,X)});var JH=F("ZodCUID",(Q,X)=>{i8.init(Q,X),d.init(Q,X)});var $H=F("ZodCUID2",(Q,X)=>{n8.init(Q,X),d.init(Q,X)});var zH=F("ZodULID",(Q,X)=>{d8.init(Q,X),d.init(Q,X)});var HH=F("ZodXID",(Q,X)=>{r8.init(Q,X),d.init(Q,X)});var KH=F("ZodKSUID",(Q,X)=>{o8.init(Q,X),d.init(Q,X)});var BH=F("ZodIPv4",(Q,X)=>{QY.init(Q,X),d.init(Q,X)});var DH=F("ZodIPv6",(Q,X)=>{XY.init(Q,X),d.init(Q,X)});var AH=F("ZodCIDRv4",(Q,X)=>{YY.init(Q,X),d.init(Q,X)});var FH=F("ZodCIDRv6",(Q,X)=>{WY.init(Q,X),d.init(Q,X)});var UH=F("ZodBase64",(Q,X)=>{JY.init(Q,X),d.init(Q,X)});var LH=F("ZodBase64URL",(Q,X)=>{$Y.init(Q,X),d.init(Q,X)});var OH=F("ZodE164",(Q,X)=>{zY.init(Q,X),d.init(Q,X)});var MH=F("ZodJWT",(Q,X)=>{HY.init(Q,X),d.init(Q,X)});var gW=F("ZodNumber",(Q,X)=>{LQ.init(Q,X),a.init(Q,X),Q.gt=(W,G)=>Q.check(c6(W,G)),Q.gte=(W,G)=>Q.check(i1(W,G)),Q.min=(W,G)=>Q.check(i1(W,G)),Q.lt=(W,G)=>Q.check(m6(W,G)),Q.lte=(W,G)=>Q.check(p1(W,G)),Q.max=(W,G)=>Q.check(p1(W,G)),Q.int=(W)=>Q.check(_W(W)),Q.safe=(W)=>Q.check(_W(W)),Q.positive=(W)=>Q.check(c6(0,W)),Q.nonnegative=(W)=>Q.check(i1(0,W)),Q.negative=(W)=>Q.check(m6(0,W)),Q.nonpositive=(W)=>Q.check(p1(0,W)),Q.multipleOf=(W,G)=>Q.check(p6(W,G)),Q.step=(W,G)=>Q.check(p6(W,G)),Q.finite=()=>Q;let Y=Q._zod.bag;Q.minValue=Math.max(Y.minimum??Number.NEGATIVE_INFINITY,Y.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,Q.maxValue=Math.min(Y.maximum??Number.POSITIVE_INFINITY,Y.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,Q.isInt=(Y.format??"").includes("int")||Number.isSafeInteger(Y.multipleOf??0.5),Q.isFinite=!0,Q.format=Y.format??null});function f(Q){return $W(gW,Q)}var VH=F("ZodNumberFormat",(Q,X)=>{KY.init(Q,X),gW.init(Q,X)});function _W(Q){return zW(VH,Q)}var ZH=F("ZodBoolean",(Q,X)=>{BY.init(Q,X),a.init(Q,X)});function e(Q){return HW(ZH,Q)}var NH=F("ZodNull",(Q,X)=>{DY.init(Q,X),a.init(Q,X)});function _Q(Q){return KW(NH,Q)}var qH=F("ZodUnknown",(Q,X)=>{AY.init(Q,X),a.init(Q,X)});function r(){return BW(qH)}var wH=F("ZodNever",(Q,X)=>{FY.init(Q,X),a.init(Q,X)});function jH(Q){return DW(wH,Q)}var PH=F("ZodArray",(Q,X)=>{UY.init(Q,X),a.init(Q,X),Q.element=X.element,Q.min=(Y,W)=>Q.check(O1(Y,W)),Q.nonempty=(Y)=>Q.check(O1(1,Y)),Q.max=(Y,W)=>Q.check(i6(Y,W)),Q.length=(Y,W)=>Q.check(n6(Y,W)),Q.unwrap=()=>Q.element});function x(Q,X){return AW(PH,Q,X)}var uW=F("ZodObject",(Q,X)=>{MY.init(Q,X),a.init(Q,X),g.defineLazy(Q,"shape",()=>{return X.shape}),Q.keyof=()=>B0(Object.keys(Q._zod.def.shape)),Q.catchall=(Y)=>Q.clone({...Q._zod.def,catchall:Y}),Q.passthrough=()=>Q.clone({...Q._zod.def,catchall:r()}),Q.loose=()=>Q.clone({...Q._zod.def,catchall:r()}),Q.strict=()=>Q.clone({...Q._zod.def,catchall:jH()}),Q.strip=()=>Q.clone({...Q._zod.def,catchall:void 0}),Q.extend=(Y)=>{return g.extend(Q,Y)},Q.safeExtend=(Y)=>{return g.safeExtend(Q,Y)},Q.merge=(Y)=>g.merge(Q,Y),Q.pick=(Y)=>g.pick(Q,Y),Q.omit=(Y)=>g.omit(Q,Y),Q.partial=(...Y)=>g.partial(mW,Q,Y[0]),Q.required=(...Y)=>g.required(cW,Q,Y[0])});function q(Q,X){let Y={type:"object",shape:Q??{},...g.normalizeParams(X)};return new uW(Y)}function z0(Q,X){return new uW({type:"object",shape:Q,catchall:r(),...g.normalizeParams(X)})}var fW=F("ZodUnion",(Q,X)=>{OQ.init(Q,X),a.init(Q,X),Q.options=X.options});function c(Q,X){return new fW({type:"union",options:Q,...g.normalizeParams(X)})}var bH=F("ZodDiscriminatedUnion",(Q,X)=>{fW.init(Q,X),VY.init(Q,X)});function yQ(Q,X,Y){return new bH({type:"union",options:X,discriminator:Q,...g.normalizeParams(Y)})}var EH=F("ZodIntersection",(Q,X)=>{ZY.init(Q,X),a.init(Q,X)});function o6(Q,X){return new EH({type:"intersection",left:Q,right:X})}var IH=F("ZodRecord",(Q,X)=>{NY.init(Q,X),a.init(Q,X),Q.keyType=X.keyType,Q.valueType=X.valueType});function o(Q,X,Y){return new IH({type:"record",keyType:Q,valueType:X,...g.normalizeParams(Y)})}var vQ=F("ZodEnum",(Q,X)=>{qY.init(Q,X),a.init(Q,X),Q.enum=X.entries,Q.options=Object.values(X.entries);let Y=new Set(Object.keys(X.entries));Q.extract=(W,G)=>{let J={};for(let $ of W)if(Y.has($))J[$]=X.entries[$];else throw Error(`Key ${$} not found in enum`);return new vQ({...X,checks:[],...g.normalizeParams(G),entries:J})},Q.exclude=(W,G)=>{let J={...X.entries};for(let $ of W)if(Y.has($))delete J[$];else throw Error(`Key ${$} not found in enum`);return new vQ({...X,checks:[],...g.normalizeParams(G),entries:J})}});function B0(Q,X){let Y=Array.isArray(Q)?Object.fromEntries(Q.map((W)=>[W,W])):Q;return new vQ({type:"enum",entries:Y,...g.normalizeParams(X)})}var TH=F("ZodLiteral",(Q,X)=>{wY.init(Q,X),a.init(Q,X),Q.values=new Set(X.values),Object.defineProperty(Q,"value",{get(){if(X.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return X.values[0]}})});function j(Q,X){return new TH({type:"literal",values:Array.isArray(Q)?Q:[Q],...g.normalizeParams(X)})}var SH=F("ZodTransform",(Q,X)=>{jY.init(Q,X),a.init(Q,X),Q._zod.parse=(Y,W)=>{if(W.direction==="backward")throw new x1(Q.constructor.name);Y.addIssue=(J)=>{if(typeof J==="string")Y.issues.push(g.issue(J,Y.value,X));else{let $=J;if($.fatal)$.continue=!1;$.code??($.code="custom"),$.input??($.input=Y.value),$.inst??($.inst=Q),Y.issues.push(g.issue($))}};let G=X.transform(Y.value,Y);if(G instanceof Promise)return G.then((J)=>{return Y.value=J,Y});return Y.value=G,Y}});function lW(Q){return new SH({type:"transform",transform:Q})}var mW=F("ZodOptional",(Q,X)=>{PY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function t(Q){return new mW({type:"optional",innerType:Q})}var RH=F("ZodNullable",(Q,X)=>{bY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function yW(Q){return new RH({type:"nullable",innerType:Q})}var CH=F("ZodDefault",(Q,X)=>{EY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType,Q.removeDefault=Q.unwrap});function kH(Q,X){return new CH({type:"default",innerType:Q,get defaultValue(){return typeof X==="function"?X():g.shallowClone(X)}})}var vH=F("ZodPrefault",(Q,X)=>{IY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function xH(Q,X){return new vH({type:"prefault",innerType:Q,get defaultValue(){return typeof X==="function"?X():g.shallowClone(X)}})}var cW=F("ZodNonOptional",(Q,X)=>{TY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function _H(Q,X){return new cW({type:"nonoptional",innerType:Q,...g.normalizeParams(X)})}var yH=F("ZodCatch",(Q,X)=>{SY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType,Q.removeCatch=Q.unwrap});function hH(Q,X){return new yH({type:"catch",innerType:Q,catchValue:typeof X==="function"?X:()=>X})}var gH=F("ZodPipe",(Q,X)=>{RY.init(Q,X),a.init(Q,X),Q.in=X.in,Q.out=X.out});function xQ(Q,X){return new gH({type:"pipe",in:Q,out:X})}var uH=F("ZodReadonly",(Q,X)=>{CY.init(Q,X),a.init(Q,X),Q.unwrap=()=>Q._zod.def.innerType});function fH(Q){return new uH({type:"readonly",innerType:Q})}var pW=F("ZodCustom",(Q,X)=>{kY.init(Q,X),a.init(Q,X)});function iW(Q,X){return FW(pW,Q??(()=>!0),X)}function lH(Q,X={}){return UW(pW,Q,X)}function mH(Q){return LW(Q)}function hQ(Q,X){return xQ(lW(Q),X)}M0(MQ());var gQ="2025-11-25";var nW=[gQ,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],o0="io.modelcontextprotocol/related-task",a6="2.0",X0=iW((Q)=>Q!==null&&(typeof Q==="object"||typeof Q==="function")),dW=c([A(),f().int()]),rW=A(),pZ=z0({ttl:c([f(),_Q()]).optional(),pollInterval:f().optional()}),cH=q({ttl:f().optional()}),pH=q({taskId:A()}),uQ=z0({progressToken:dW.optional(),[o0]:pH.optional()}),O0=q({_meta:uQ.optional()}),r1=O0.extend({task:cH.optional()}),oW=(Q)=>r1.safeParse(Q).success,Y0=q({method:A(),params:O0.loose().optional()}),V0=q({_meta:uQ.optional()}),Z0=q({method:A(),params:V0.loose().optional()}),W0=z0({_meta:uQ.optional()}),s6=c([A(),f().int()]),tW=q({jsonrpc:j(a6),id:s6,...Y0.shape}).strict(),fQ=(Q)=>tW.safeParse(Q).success,aW=q({jsonrpc:j(a6),...Z0.shape}).strict(),sW=(Q)=>aW.safeParse(Q).success,lQ=q({jsonrpc:j(a6),id:s6,result:W0}).strict(),o1=(Q)=>lQ.safeParse(Q).success;var _;(function(Q){Q[Q.ConnectionClosed=-32000]="ConnectionClosed",Q[Q.RequestTimeout=-32001]="RequestTimeout",Q[Q.ParseError=-32700]="ParseError",Q[Q.InvalidRequest=-32600]="InvalidRequest",Q[Q.MethodNotFound=-32601]="MethodNotFound",Q[Q.InvalidParams=-32602]="InvalidParams",Q[Q.InternalError=-32603]="InternalError",Q[Q.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(_||(_={}));var mQ=q({jsonrpc:j(a6),id:s6.optional(),error:q({code:f().int(),message:A(),data:r().optional()})}).strict();var eW=(Q)=>mQ.safeParse(Q).success;var QG=c([tW,aW,lQ,mQ]),iZ=c([lQ,mQ]),e6=W0.strict(),iH=V0.extend({requestId:s6.optional(),reason:A().optional()}),Q4=Z0.extend({method:j("notifications/cancelled"),params:iH}),nH=q({src:A(),mimeType:A().optional(),sizes:x(A()).optional(),theme:B0(["light","dark"]).optional()}),t1=q({icons:x(nH).optional()}),V1=q({name:A(),title:A().optional()}),XG=V1.extend({...V1.shape,...t1.shape,version:A(),websiteUrl:A().optional(),description:A().optional()}),dH=o6(q({applyDefaults:e().optional()}),o(A(),r())),rH=hQ((Q)=>{if(Q&&typeof Q==="object"&&!Array.isArray(Q)){if(Object.keys(Q).length===0)return{form:{}}}return Q},o6(q({form:dH.optional(),url:X0.optional()}),o(A(),r()).optional())),oH=z0({list:X0.optional(),cancel:X0.optional(),requests:z0({sampling:z0({createMessage:X0.optional()}).optional(),elicitation:z0({create:X0.optional()}).optional()}).optional()}),tH=z0({list:X0.optional(),cancel:X0.optional(),requests:z0({tools:z0({call:X0.optional()}).optional()}).optional()}),aH=q({experimental:o(A(),X0).optional(),sampling:q({context:X0.optional(),tools:X0.optional()}).optional(),elicitation:rH.optional(),roots:q({listChanged:e().optional()}).optional(),tasks:oH.optional()}),sH=O0.extend({protocolVersion:A(),capabilities:aH,clientInfo:XG}),cQ=Y0.extend({method:j("initialize"),params:sH});var eH=q({experimental:o(A(),X0).optional(),logging:X0.optional(),completions:X0.optional(),prompts:q({listChanged:e().optional()}).optional(),resources:q({subscribe:e().optional(),listChanged:e().optional()}).optional(),tools:q({listChanged:e().optional()}).optional(),tasks:tH.optional()}),Q3=W0.extend({protocolVersion:A(),capabilities:eH,serverInfo:XG,instructions:A().optional()}),pQ=Z0.extend({method:j("notifications/initialized"),params:V0.optional()});var X4=Y0.extend({method:j("ping"),params:O0.optional()}),X3=q({progress:f(),total:t(f()),message:t(A())}),Y3=q({...V0.shape,...X3.shape,progressToken:dW}),Y4=Z0.extend({method:j("notifications/progress"),params:Y3}),W3=O0.extend({cursor:rW.optional()}),a1=Y0.extend({params:W3.optional()}),s1=W0.extend({nextCursor:rW.optional()}),G3=B0(["working","input_required","completed","failed","cancelled"]),e1=q({taskId:A(),status:G3,ttl:c([f(),_Q()]),createdAt:A(),lastUpdatedAt:A(),pollInterval:t(f()),statusMessage:t(A())}),Z1=W0.extend({task:e1}),J3=V0.merge(e1),Q6=Z0.extend({method:j("notifications/tasks/status"),params:J3}),W4=Y0.extend({method:j("tasks/get"),params:O0.extend({taskId:A()})}),G4=W0.merge(e1),J4=Y0.extend({method:j("tasks/result"),params:O0.extend({taskId:A()})}),nZ=W0.loose(),$4=a1.extend({method:j("tasks/list")}),z4=s1.extend({tasks:x(e1)}),H4=Y0.extend({method:j("tasks/cancel"),params:O0.extend({taskId:A()})}),YG=W0.merge(e1),WG=q({uri:A(),mimeType:t(A()),_meta:o(A(),r()).optional()}),GG=WG.extend({text:A()}),iQ=A().refine((Q)=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),JG=WG.extend({blob:iQ}),X6=B0(["user","assistant"]),N1=q({audience:x(X6).optional(),priority:f().min(0).max(1).optional(),lastModified:d1.datetime({offset:!0}).optional()}),$G=q({...V1.shape,...t1.shape,uri:A(),description:t(A()),mimeType:t(A()),annotations:N1.optional(),_meta:t(z0({}))}),$3=q({...V1.shape,...t1.shape,uriTemplate:A(),description:t(A()),mimeType:t(A()),annotations:N1.optional(),_meta:t(z0({}))}),nQ=a1.extend({method:j("resources/list")}),z3=s1.extend({resources:x($G)}),H3=a1.extend({method:j("resources/templates/list")}),K3=s1.extend({resourceTemplates:x($3)}),dQ=O0.extend({uri:A()}),B3=dQ,rQ=Y0.extend({method:j("resources/read"),params:B3}),D3=W0.extend({contents:x(c([GG,JG]))}),A3=Z0.extend({method:j("notifications/resources/list_changed"),params:V0.optional()}),F3=dQ,U3=Y0.extend({method:j("resources/subscribe"),params:F3}),L3=dQ,O3=Y0.extend({method:j("resources/unsubscribe"),params:L3}),M3=V0.extend({uri:A()}),V3=Z0.extend({method:j("notifications/resources/updated"),params:M3}),Z3=q({name:A(),description:t(A()),required:t(e())}),N3=q({...V1.shape,...t1.shape,description:t(A()),arguments:t(x(Z3)),_meta:t(z0({}))}),q3=a1.extend({method:j("prompts/list")}),w3=s1.extend({prompts:x(N3)}),j3=O0.extend({name:A(),arguments:o(A(),A()).optional()}),P3=Y0.extend({method:j("prompts/get"),params:j3}),oQ=q({type:j("text"),text:A(),annotations:N1.optional(),_meta:o(A(),r()).optional()}),tQ=q({type:j("image"),data:iQ,mimeType:A(),annotations:N1.optional(),_meta:o(A(),r()).optional()}),aQ=q({type:j("audio"),data:iQ,mimeType:A(),annotations:N1.optional(),_meta:o(A(),r()).optional()}),b3=q({type:j("tool_use"),name:A(),id:A(),input:o(A(),r()),_meta:o(A(),r()).optional()}),E3=q({type:j("resource"),resource:c([GG,JG]),annotations:N1.optional(),_meta:o(A(),r()).optional()}),I3=$G.extend({type:j("resource_link")}),sQ=c([oQ,tQ,aQ,I3,E3]),T3=q({role:X6,content:sQ}),S3=W0.extend({description:A().optional(),messages:x(T3)}),R3=Z0.extend({method:j("notifications/prompts/list_changed"),params:V0.optional()}),C3=q({title:A().optional(),readOnlyHint:e().optional(),destructiveHint:e().optional(),idempotentHint:e().optional(),openWorldHint:e().optional()}),k3=q({taskSupport:B0(["required","optional","forbidden"]).optional()}),zG=q({...V1.shape,...t1.shape,description:A().optional(),inputSchema:q({type:j("object"),properties:o(A(),X0).optional(),required:x(A()).optional()}).catchall(r()),outputSchema:q({type:j("object"),properties:o(A(),X0).optional(),required:x(A()).optional()}).catchall(r()).optional(),annotations:C3.optional(),execution:k3.optional(),_meta:o(A(),r()).optional()}),eQ=a1.extend({method:j("tools/list")}),v3=s1.extend({tools:x(zG)}),K4=W0.extend({content:x(sQ).default([]),structuredContent:o(A(),r()).optional(),isError:e().optional()}),dZ=K4.or(W0.extend({toolResult:r()})),x3=r1.extend({name:A(),arguments:o(A(),r()).optional()}),Y6=Y0.extend({method:j("tools/call"),params:x3}),_3=Z0.extend({method:j("notifications/tools/list_changed"),params:V0.optional()}),rZ=q({autoRefresh:e().default(!0),debounceMs:f().int().nonnegative().default(300)}),W6=B0(["debug","info","notice","warning","error","critical","alert","emergency"]),y3=O0.extend({level:W6}),Q9=Y0.extend({method:j("logging/setLevel"),params:y3}),h3=V0.extend({level:W6,logger:A().optional(),data:r()}),g3=Z0.extend({method:j("notifications/message"),params:h3}),u3=q({name:A().optional()}),f3=q({hints:x(u3).optional(),costPriority:f().min(0).max(1).optional(),speedPriority:f().min(0).max(1).optional(),intelligencePriority:f().min(0).max(1).optional()}),l3=q({mode:B0(["auto","required","none"]).optional()}),m3=q({type:j("tool_result"),toolUseId:A().describe("The unique identifier for the corresponding tool call."),content:x(sQ).default([]),structuredContent:q({}).loose().optional(),isError:e().optional(),_meta:o(A(),r()).optional()}),c3=yQ("type",[oQ,tQ,aQ]),t6=yQ("type",[oQ,tQ,aQ,b3,m3]),p3=q({role:X6,content:c([t6,x(t6)]),_meta:o(A(),r()).optional()}),i3=r1.extend({messages:x(p3),modelPreferences:f3.optional(),systemPrompt:A().optional(),includeContext:B0(["none","thisServer","allServers"]).optional(),temperature:f().optional(),maxTokens:f().int(),stopSequences:x(A()).optional(),metadata:X0.optional(),tools:x(zG).optional(),toolChoice:l3.optional()}),n3=Y0.extend({method:j("sampling/createMessage"),params:i3}),X9=W0.extend({model:A(),stopReason:t(B0(["endTurn","stopSequence","maxTokens"]).or(A())),role:X6,content:c3}),Y9=W0.extend({model:A(),stopReason:t(B0(["endTurn","stopSequence","maxTokens","toolUse"]).or(A())),role:X6,content:c([t6,x(t6)])}),d3=q({type:j("boolean"),title:A().optional(),description:A().optional(),default:e().optional()}),r3=q({type:j("string"),title:A().optional(),description:A().optional(),minLength:f().optional(),maxLength:f().optional(),format:B0(["email","uri","date","date-time"]).optional(),default:A().optional()}),o3=q({type:B0(["number","integer"]),title:A().optional(),description:A().optional(),minimum:f().optional(),maximum:f().optional(),default:f().optional()}),t3=q({type:j("string"),title:A().optional(),description:A().optional(),enum:x(A()),default:A().optional()}),a3=q({type:j("string"),title:A().optional(),description:A().optional(),oneOf:x(q({const:A(),title:A()})),default:A().optional()}),s3=q({type:j("string"),title:A().optional(),description:A().optional(),enum:x(A()),enumNames:x(A()).optional(),default:A().optional()}),e3=c([t3,a3]),QK=q({type:j("array"),title:A().optional(),description:A().optional(),minItems:f().optional(),maxItems:f().optional(),items:q({type:j("string"),enum:x(A())}),default:x(A()).optional()}),XK=q({type:j("array"),title:A().optional(),description:A().optional(),minItems:f().optional(),maxItems:f().optional(),items:q({anyOf:x(q({const:A(),title:A()}))}),default:x(A()).optional()}),YK=c([QK,XK]),WK=c([s3,e3,YK]),GK=c([WK,d3,r3,o3]),JK=r1.extend({mode:j("form").optional(),message:A(),requestedSchema:q({type:j("object"),properties:o(A(),GK),required:x(A()).optional()})}),$K=r1.extend({mode:j("url"),message:A(),elicitationId:A(),url:A().url()}),zK=c([JK,$K]),HK=Y0.extend({method:j("elicitation/create"),params:zK}),KK=V0.extend({elicitationId:A()}),BK=Z0.extend({method:j("notifications/elicitation/complete"),params:KK}),B4=W0.extend({action:B0(["accept","decline","cancel"]),content:hQ((Q)=>Q===null?void 0:Q,o(A(),c([A(),f(),e(),x(A())])).optional())}),DK=q({type:j("ref/resource"),uri:A()});var AK=q({type:j("ref/prompt"),name:A()}),FK=O0.extend({ref:c([AK,DK]),argument:q({name:A(),value:A()}),context:q({arguments:o(A(),A()).optional()}).optional()}),UK=Y0.extend({method:j("completion/complete"),params:FK});var LK=W0.extend({completion:z0({values:x(A()).max(100),total:t(f().int()),hasMore:t(e())})}),OK=q({uri:A().startsWith("file://"),name:A().optional(),_meta:o(A(),r()).optional()}),MK=Y0.extend({method:j("roots/list"),params:O0.optional()}),W9=W0.extend({roots:x(OK)}),VK=Z0.extend({method:j("notifications/roots/list_changed"),params:V0.optional()}),oZ=c([X4,cQ,UK,Q9,P3,q3,nQ,H3,rQ,U3,O3,Y6,eQ,W4,J4,$4,H4]),tZ=c([Q4,Y4,pQ,VK,Q6]),aZ=c([e6,X9,Y9,B4,W9,G4,z4,Z1]),sZ=c([X4,n3,HK,MK,W4,J4,$4,H4]),eZ=c([Q4,Y4,g3,V3,A3,_3,R3,Q6,BK]),QN=c([e6,Q3,LK,S3,w3,z3,K3,D3,K4,v3,G4,z4,Z1]);class C extends Error{constructor(Q,X,Y){super(`MCP error ${Q}: ${X}`);this.code=Q,this.data=Y,this.name="McpError"}static fromError(Q,X,Y){if(Q===_.UrlElicitationRequired&&Y){let W=Y;if(W.elicitations)return new HG(W.elicitations,X)}return new C(Q,X,Y)}}class HG extends C{constructor(Q,X=`URL elicitation${Q.length>1?"s":""} required`){super(_.UrlElicitationRequired,X,{elicitations:Q})}get elicitations(){return this.data?.elicitations??[]}}function t0(Q){return Q==="completed"||Q==="failed"||Q==="cancelled"}var ZK=Symbol("Let zodToJsonSchema decide on which parser to use");var vN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function G9(Q){let Y=d6(Q)?.method;if(!Y)throw Error("Schema is missing a method literal");let W=OW(Y);if(typeof W!=="string")throw Error("Schema method literal must be a string");return W}function J9(Q,X){let Y=r0(Q,X);if(!Y.success)throw Y.error;return Y.data}var bK=60000;class $9{constructor(Q){if(this._options=Q,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(Q4,(X)=>{this._oncancel(X)}),this.setNotificationHandler(Y4,(X)=>{this._onprogress(X)}),this.setRequestHandler(X4,(X)=>({})),this._taskStore=Q?.taskStore,this._taskMessageQueue=Q?.taskMessageQueue,this._taskStore)this.setRequestHandler(W4,async(X,Y)=>{let W=await this._taskStore.getTask(X.params.taskId,Y.sessionId);if(!W)throw new C(_.InvalidParams,"Failed to retrieve task: Task not found");return{...W}}),this.setRequestHandler(J4,async(X,Y)=>{let W=async()=>{let G=X.params.taskId;if(this._taskMessageQueue){let $;while($=await this._taskMessageQueue.dequeue(G,Y.sessionId)){if($.type==="response"||$.type==="error"){let z=$.message,H=z.id,K=this._requestResolvers.get(H);if(K)if(this._requestResolvers.delete(H),$.type==="response")K(z);else{let B=z,D=new C(B.error.code,B.error.message,B.error.data);K(D)}else{let B=$.type==="response"?"Response":"Error";this._onerror(Error(`${B} handler missing for request ${H}`))}continue}await this._transport?.send($.message,{relatedRequestId:Y.requestId})}}let J=await this._taskStore.getTask(G,Y.sessionId);if(!J)throw new C(_.InvalidParams,`Task not found: ${G}`);if(!t0(J.status))return await this._waitForTaskUpdate(G,Y.signal),await W();if(t0(J.status)){let $=await this._taskStore.getTaskResult(G,Y.sessionId);return this._clearTaskQueue(G),{...$,_meta:{...$._meta,[o0]:{taskId:G}}}}return await W()};return await W()}),this.setRequestHandler($4,async(X,Y)=>{try{let{tasks:W,nextCursor:G}=await this._taskStore.listTasks(X.params?.cursor,Y.sessionId);return{tasks:W,nextCursor:G,_meta:{}}}catch(W){throw new C(_.InvalidParams,`Failed to list tasks: ${W instanceof Error?W.message:String(W)}`)}}),this.setRequestHandler(H4,async(X,Y)=>{try{let W=await this._taskStore.getTask(X.params.taskId,Y.sessionId);if(!W)throw new C(_.InvalidParams,`Task not found: ${X.params.taskId}`);if(t0(W.status))throw new C(_.InvalidParams,`Cannot cancel task in terminal status: ${W.status}`);await this._taskStore.updateTaskStatus(X.params.taskId,"cancelled","Client cancelled task execution.",Y.sessionId),this._clearTaskQueue(X.params.taskId);let G=await this._taskStore.getTask(X.params.taskId,Y.sessionId);if(!G)throw new C(_.InvalidParams,`Task not found after cancellation: ${X.params.taskId}`);return{_meta:{},...G}}catch(W){if(W instanceof C)throw W;throw new C(_.InvalidRequest,`Failed to cancel task: ${W instanceof Error?W.message:String(W)}`)}})}async _oncancel(Q){if(!Q.params.requestId)return;this._requestHandlerAbortControllers.get(Q.params.requestId)?.abort(Q.params.reason)}_setupTimeout(Q,X,Y,W,G=!1){this._timeoutInfo.set(Q,{timeoutId:setTimeout(W,X),startTime:Date.now(),timeout:X,maxTotalTimeout:Y,resetTimeoutOnProgress:G,onTimeout:W})}_resetTimeout(Q){let X=this._timeoutInfo.get(Q);if(!X)return!1;let Y=Date.now()-X.startTime;if(X.maxTotalTimeout&&Y>=X.maxTotalTimeout)throw this._timeoutInfo.delete(Q),C.fromError(_.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:X.maxTotalTimeout,totalElapsed:Y});return clearTimeout(X.timeoutId),X.timeoutId=setTimeout(X.onTimeout,X.timeout),!0}_cleanupTimeout(Q){let X=this._timeoutInfo.get(Q);if(X)clearTimeout(X.timeoutId),this._timeoutInfo.delete(Q)}async connect(Q){this._transport=Q;let X=this.transport?.onclose;this._transport.onclose=()=>{X?.(),this._onclose()};let Y=this.transport?.onerror;this._transport.onerror=(G)=>{Y?.(G),this._onerror(G)};let W=this._transport?.onmessage;this._transport.onmessage=(G,J)=>{if(W?.(G,J),o1(G)||eW(G))this._onresponse(G);else if(fQ(G))this._onrequest(G,J);else if(sW(G))this._onnotification(G);else this._onerror(Error(`Unknown message type: ${JSON.stringify(G)}`))},await this._transport.start()}_onclose(){let Q=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let X=C.fromError(_.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let Y of Q.values())Y(X)}_onerror(Q){this.onerror?.(Q)}_onnotification(Q){let X=this._notificationHandlers.get(Q.method)??this.fallbackNotificationHandler;if(X===void 0)return;Promise.resolve().then(()=>X(Q)).catch((Y)=>this._onerror(Error(`Uncaught error in notification handler: ${Y}`)))}_onrequest(Q,X){let Y=this._requestHandlers.get(Q.method)??this.fallbackRequestHandler,W=this._transport,G=Q.params?._meta?.[o0]?.taskId;if(Y===void 0){let K={jsonrpc:"2.0",id:Q.id,error:{code:_.MethodNotFound,message:"Method not found"}};if(G&&this._taskMessageQueue)this._enqueueTaskMessage(G,{type:"error",message:K,timestamp:Date.now()},W?.sessionId).catch((B)=>this._onerror(Error(`Failed to enqueue error response: ${B}`)));else W?.send(K).catch((B)=>this._onerror(Error(`Failed to send an error response: ${B}`)));return}let J=new AbortController;this._requestHandlerAbortControllers.set(Q.id,J);let $=oW(Q.params)?Q.params.task:void 0,z=this._taskStore?this.requestTaskStore(Q,W?.sessionId):void 0,H={signal:J.signal,sessionId:W?.sessionId,_meta:Q.params?._meta,sendNotification:async(K)=>{let B={relatedRequestId:Q.id};if(G)B.relatedTask={taskId:G};await this.notification(K,B)},sendRequest:async(K,B,D)=>{let U={...D,relatedRequestId:Q.id};if(G&&!U.relatedTask)U.relatedTask={taskId:G};let L=U.relatedTask?.taskId??G;if(L&&z)await z.updateTaskStatus(L,"input_required");return await this.request(K,B,U)},authInfo:X?.authInfo,requestId:Q.id,requestInfo:X?.requestInfo,taskId:G,taskStore:z,taskRequestedTtl:$?.ttl,closeSSEStream:X?.closeSSEStream,closeStandaloneSSEStream:X?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if($)this.assertTaskHandlerCapability(Q.method)}).then(()=>Y(Q,H)).then(async(K)=>{if(J.signal.aborted)return;let B={result:K,jsonrpc:"2.0",id:Q.id};if(G&&this._taskMessageQueue)await this._enqueueTaskMessage(G,{type:"response",message:B,timestamp:Date.now()},W?.sessionId);else await W?.send(B)},async(K)=>{if(J.signal.aborted)return;let B={jsonrpc:"2.0",id:Q.id,error:{code:Number.isSafeInteger(K.code)?K.code:_.InternalError,message:K.message??"Internal error",...K.data!==void 0&&{data:K.data}}};if(G&&this._taskMessageQueue)await this._enqueueTaskMessage(G,{type:"error",message:B,timestamp:Date.now()},W?.sessionId);else await W?.send(B)}).catch((K)=>this._onerror(Error(`Failed to send response: ${K}`))).finally(()=>{this._requestHandlerAbortControllers.delete(Q.id)})}_onprogress(Q){let{progressToken:X,...Y}=Q.params,W=Number(X),G=this._progressHandlers.get(W);if(!G){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(Q)}`));return}let J=this._responseHandlers.get(W),$=this._timeoutInfo.get(W);if($&&J&&$.resetTimeoutOnProgress)try{this._resetTimeout(W)}catch(z){this._responseHandlers.delete(W),this._progressHandlers.delete(W),this._cleanupTimeout(W),J(z);return}G(Y)}_onresponse(Q){let X=Number(Q.id),Y=this._requestResolvers.get(X);if(Y){if(this._requestResolvers.delete(X),o1(Q))Y(Q);else{let J=new C(Q.error.code,Q.error.message,Q.error.data);Y(J)}return}let W=this._responseHandlers.get(X);if(W===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(Q)}`));return}this._responseHandlers.delete(X),this._cleanupTimeout(X);let G=!1;if(o1(Q)&&Q.result&&typeof Q.result==="object"){let J=Q.result;if(J.task&&typeof J.task==="object"){let $=J.task;if(typeof $.taskId==="string")G=!0,this._taskProgressTokens.set($.taskId,X)}}if(!G)this._progressHandlers.delete(X);if(o1(Q))W(Q);else{let J=C.fromError(Q.error.code,Q.error.message,Q.error.data);W(J)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(Q,X,Y){let{task:W}=Y??{};if(!W){try{yield{type:"result",result:await this.request(Q,X,Y)}}catch(J){yield{type:"error",error:J instanceof C?J:new C(_.InternalError,String(J))}}return}let G;try{let J=await this.request(Q,Z1,Y);if(J.task)G=J.task.taskId,yield{type:"taskCreated",task:J.task};else throw new C(_.InternalError,"Task creation did not return a task");while(!0){let $=await this.getTask({taskId:G},Y);if(yield{type:"taskStatus",task:$},t0($.status)){if($.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:G},X,Y)};else if($.status==="failed")yield{type:"error",error:new C(_.InternalError,`Task ${G} failed`)};else if($.status==="cancelled")yield{type:"error",error:new C(_.InternalError,`Task ${G} was cancelled`)};return}if($.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:G},X,Y)};return}let z=$.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((H)=>setTimeout(H,z)),Y?.signal?.throwIfAborted()}}catch(J){yield{type:"error",error:J instanceof C?J:new C(_.InternalError,String(J))}}}request(Q,X,Y){let{relatedRequestId:W,resumptionToken:G,onresumptiontoken:J,task:$,relatedTask:z}=Y??{};return new Promise((H,K)=>{let B=(V)=>{K(V)};if(!this._transport){B(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod(Q.method),$)this.assertTaskCapability(Q.method)}catch(V){B(V);return}Y?.signal?.throwIfAborted();let D=this._requestMessageId++,U={...Q,jsonrpc:"2.0",id:D};if(Y?.onprogress)this._progressHandlers.set(D,Y.onprogress),U.params={...Q.params,_meta:{...Q.params?._meta||{},progressToken:D}};if($)U.params={...U.params,task:$};if(z)U.params={...U.params,_meta:{...U.params?._meta||{},[o0]:z}};let L=(V)=>{this._responseHandlers.delete(D),this._progressHandlers.delete(D),this._cleanupTimeout(D),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:D,reason:String(V)}},{relatedRequestId:W,resumptionToken:G,onresumptiontoken:J}).catch((E)=>this._onerror(Error(`Failed to send cancellation: ${E}`)));let T=V instanceof C?V:new C(_.RequestTimeout,String(V));K(T)};this._responseHandlers.set(D,(V)=>{if(Y?.signal?.aborted)return;if(V instanceof Error)return K(V);try{let T=r0(X,V.result);if(!T.success)K(T.error);else H(T.data)}catch(T){K(T)}}),Y?.signal?.addEventListener("abort",()=>{L(Y?.signal?.reason)});let O=Y?.timeout??bK,M=()=>L(C.fromError(_.RequestTimeout,"Request timed out",{timeout:O}));this._setupTimeout(D,O,Y?.maxTotalTimeout,M,Y?.resetTimeoutOnProgress??!1);let Z=z?.taskId;if(Z){let V=(T)=>{let E=this._responseHandlers.get(D);if(E)E(T);else this._onerror(Error(`Response handler missing for side-channeled request ${D}`))};this._requestResolvers.set(D,V),this._enqueueTaskMessage(Z,{type:"request",message:U,timestamp:Date.now()}).catch((T)=>{this._cleanupTimeout(D),K(T)})}else this._transport.send(U,{relatedRequestId:W,resumptionToken:G,onresumptiontoken:J}).catch((V)=>{this._cleanupTimeout(D),K(V)})})}async getTask(Q,X){return this.request({method:"tasks/get",params:Q},G4,X)}async getTaskResult(Q,X,Y){return this.request({method:"tasks/result",params:Q},X,Y)}async listTasks(Q,X){return this.request({method:"tasks/list",params:Q},z4,X)}async cancelTask(Q,X){return this.request({method:"tasks/cancel",params:Q},YG,X)}async notification(Q,X){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(Q.method);let Y=X?.relatedTask?.taskId;if(Y){let $={...Q,jsonrpc:"2.0",params:{...Q.params,_meta:{...Q.params?._meta||{},[o0]:X.relatedTask}}};await this._enqueueTaskMessage(Y,{type:"notification",message:$,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(Q.method)&&!Q.params&&!X?.relatedRequestId&&!X?.relatedTask){if(this._pendingDebouncedNotifications.has(Q.method))return;this._pendingDebouncedNotifications.add(Q.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(Q.method),!this._transport)return;let $={...Q,jsonrpc:"2.0"};if(X?.relatedTask)$={...$,params:{...$.params,_meta:{...$.params?._meta||{},[o0]:X.relatedTask}}};this._transport?.send($,X).catch((z)=>this._onerror(z))});return}let J={...Q,jsonrpc:"2.0"};if(X?.relatedTask)J={...J,params:{...J.params,_meta:{...J.params?._meta||{},[o0]:X.relatedTask}}};await this._transport.send(J,X)}setRequestHandler(Q,X){let Y=G9(Q);this.assertRequestHandlerCapability(Y),this._requestHandlers.set(Y,(W,G)=>{let J=J9(Q,W);return Promise.resolve(X(J,G))})}removeRequestHandler(Q){this._requestHandlers.delete(Q)}assertCanSetRequestHandler(Q){if(this._requestHandlers.has(Q))throw Error(`A request handler for ${Q} already exists, which would be overridden`)}setNotificationHandler(Q,X){let Y=G9(Q);this._notificationHandlers.set(Y,(W)=>{let G=J9(Q,W);return Promise.resolve(X(G))})}removeNotificationHandler(Q){this._notificationHandlers.delete(Q)}_cleanupTaskProgressHandler(Q){let X=this._taskProgressTokens.get(Q);if(X!==void 0)this._progressHandlers.delete(X),this._taskProgressTokens.delete(Q)}async _enqueueTaskMessage(Q,X,Y){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let W=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(Q,X,Y,W)}async _clearTaskQueue(Q,X){if(this._taskMessageQueue){let Y=await this._taskMessageQueue.dequeueAll(Q,X);for(let W of Y)if(W.type==="request"&&fQ(W.message)){let G=W.message.id,J=this._requestResolvers.get(G);if(J)J(new C(_.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(G);else this._onerror(Error(`Resolver missing for request ${G} during task ${Q} cleanup`))}}}async _waitForTaskUpdate(Q,X){let Y=this._options?.defaultTaskPollInterval??1000;try{let W=await this._taskStore?.getTask(Q);if(W?.pollInterval)Y=W.pollInterval}catch{}return new Promise((W,G)=>{if(X.aborted){G(new C(_.InvalidRequest,"Request cancelled"));return}let J=setTimeout(W,Y);X.addEventListener("abort",()=>{clearTimeout(J),G(new C(_.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(Q,X){let Y=this._taskStore;if(!Y)throw Error("No task store configured");return{createTask:async(W)=>{if(!Q)throw Error("No request provided");return await Y.createTask(W,Q.id,{method:Q.method,params:Q.params},X)},getTask:async(W)=>{let G=await Y.getTask(W,X);if(!G)throw new C(_.InvalidParams,"Failed to retrieve task: Task not found");return G},storeTaskResult:async(W,G,J)=>{await Y.storeTaskResult(W,G,J,X);let $=await Y.getTask(W,X);if($){let z=Q6.parse({method:"notifications/tasks/status",params:$});if(await this.notification(z),t0($.status))this._cleanupTaskProgressHandler(W)}},getTaskResult:(W)=>{return Y.getTaskResult(W,X)},updateTaskStatus:async(W,G,J)=>{let $=await Y.getTask(W,X);if(!$)throw new C(_.InvalidParams,`Task "${W}" not found - it may have been cleaned up`);if(t0($.status))throw new C(_.InvalidParams,`Cannot update task "${W}" from terminal status "${$.status}" to "${G}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await Y.updateTaskStatus(W,G,J,X);let z=await Y.getTask(W,X);if(z){let H=Q6.parse({method:"notifications/tasks/status",params:z});if(await this.notification(H),t0(z.status))this._cleanupTaskProgressHandler(W)}},listTasks:(W)=>{return Y.listTasks(W,X)}}}}function KG(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function BG(Q,X){let Y={...Q};for(let W in X){let G=W,J=X[G];if(J===void 0)continue;let $=Y[G];if(KG($)&&KG(J))Y[G]={...$,...J};else Y[G]=J}return Y}var l$=NX(QX(),1),m$=NX(f$(),1);function xM(){let Q=new l$.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return m$.default(Q),Q}class BX{constructor(Q){this._ajv=Q??xM()}getValidator(Q){let X="$id"in Q&&typeof Q.$id==="string"?this._ajv.getSchema(Q.$id)??this._ajv.compile(Q):this._ajv.compile(Q);return(Y)=>{if(X(Y))return{valid:!0,data:Y,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(X.errors)}}}}class DX{constructor(Q){this._server=Q}requestStream(Q,X,Y){return this._server.requestStream(Q,X,Y)}async getTask(Q,X){return this._server.getTask({taskId:Q},X)}async getTaskResult(Q,X,Y){return this._server.getTaskResult({taskId:Q},X,Y)}async listTasks(Q,X){return this._server.listTasks(Q?{cursor:Q}:void 0,X)}async cancelTask(Q,X){return this._server.cancelTask({taskId:Q},X)}}function c$(Q,X,Y){if(!Q)throw Error(`${Y} does not support task creation (required for ${X})`);switch(X){case"tools/call":if(!Q.tools?.call)throw Error(`${Y} does not support task creation for tools/call (required for ${X})`);break;default:break}}function p$(Q,X,Y){if(!Q)throw Error(`${Y} does not support task creation (required for ${X})`);switch(X){case"sampling/createMessage":if(!Q.sampling?.createMessage)throw Error(`${Y} does not support task creation for sampling/createMessage (required for ${X})`);break;case"elicitation/create":if(!Q.elicitation?.create)throw Error(`${Y} does not support task creation for elicitation/create (required for ${X})`);break;default:break}}class AX extends $9{constructor(Q,X){super(X);if(this._serverInfo=Q,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(W6.options.map((Y,W)=>[Y,W])),this.isMessageIgnored=(Y,W)=>{let G=this._loggingLevels.get(W);return G?this.LOG_LEVEL_SEVERITY.get(Y)<this.LOG_LEVEL_SEVERITY.get(G):!1},this._capabilities=X?.capabilities??{},this._instructions=X?.instructions,this._jsonSchemaValidator=X?.jsonSchemaValidator??new BX,this.setRequestHandler(cQ,(Y)=>this._oninitialize(Y)),this.setNotificationHandler(pQ,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(Q9,async(Y,W)=>{let G=W.sessionId||W.requestInfo?.headers["mcp-session-id"]||void 0,{level:J}=Y.params,$=W6.safeParse(J);if($.success)this._loggingLevels.set(G,$.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new DX(this)};return this._experimental}registerCapabilities(Q){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=BG(this._capabilities,Q)}setRequestHandler(Q,X){let W=d6(Q)?.method;if(!W)throw Error("Schema is missing a method literal");let G;if(M1(W)){let $=W;G=$._zod?.def?.value??$.value}else{let $=W;G=$._def?.value??$.value}if(typeof G!=="string")throw Error("Schema method literal must be a string");if(G==="tools/call"){let $=async(z,H)=>{let K=r0(Y6,z);if(!K.success){let L=K.error instanceof Error?K.error.message:String(K.error);throw new C(_.InvalidParams,`Invalid tools/call request: ${L}`)}let{params:B}=K.data,D=await Promise.resolve(X(z,H));if(B.task){let L=r0(Z1,D);if(!L.success){let O=L.error instanceof Error?L.error.message:String(L.error);throw new C(_.InvalidParams,`Invalid task creation result: ${O}`)}return L.data}let U=r0(K4,D);if(!U.success){let L=U.error instanceof Error?U.error.message:String(U.error);throw new C(_.InvalidParams,`Invalid tools/call result: ${L}`)}return U.data};return super.setRequestHandler(Q,$)}return super.setRequestHandler(Q,X)}assertCapabilityForMethod(Q){switch(Q){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${Q})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${Q})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${Q})`);break;case"ping":break}}assertNotificationCapability(Q){switch(Q){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${Q})`);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 ${Q})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${Q})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${Q})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${Q})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(Q){if(!this._capabilities)return;switch(Q){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${Q})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${Q})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${Q})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${Q})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${Q})`);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 ${Q})`);break;case"ping":case"initialize":break}}assertTaskCapability(Q){p$(this._clientCapabilities?.tasks?.requests,Q,"Client")}assertTaskHandlerCapability(Q){if(!this._capabilities)return;c$(this._capabilities.tasks?.requests,Q,"Server")}async _oninitialize(Q){let X=Q.params.protocolVersion;return this._clientCapabilities=Q.params.capabilities,this._clientVersion=Q.params.clientInfo,{protocolVersion:nW.includes(X)?X:gQ,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"},e6)}async createMessage(Q,X){if(Q.tools||Q.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if(Q.messages.length>0){let Y=Q.messages[Q.messages.length-1],W=Array.isArray(Y.content)?Y.content:[Y.content],G=W.some((H)=>H.type==="tool_result"),J=Q.messages.length>1?Q.messages[Q.messages.length-2]:void 0,$=J?Array.isArray(J.content)?J.content:[J.content]:[],z=$.some((H)=>H.type==="tool_use");if(G){if(W.some((H)=>H.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!z)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(z){let H=new Set($.filter((B)=>B.type==="tool_use").map((B)=>B.id)),K=new Set(W.filter((B)=>B.type==="tool_result").map((B)=>B.toolUseId));if(H.size!==K.size||![...H].every((B)=>K.has(B)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(Q.tools)return this.request({method:"sampling/createMessage",params:Q},Y9,X);return this.request({method:"sampling/createMessage",params:Q},X9,X)}async elicitInput(Q,X){switch(Q.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let W=Q;return this.request({method:"elicitation/create",params:W},B4,X)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let W=Q.mode==="form"?Q:{...Q,mode:"form"},G=await this.request({method:"elicitation/create",params:W},B4,X);if(G.action==="accept"&&G.content&&W.requestedSchema)try{let $=this._jsonSchemaValidator.getValidator(W.requestedSchema)(G.content);if(!$.valid)throw new C(_.InvalidParams,`Elicitation response content does not match requested schema: ${$.errorMessage}`)}catch(J){if(J instanceof C)throw J;throw new C(_.InternalError,`Error validating elicitation response: ${J instanceof Error?J.message:String(J)}`)}return G}}}createElicitationCompletionNotifier(Q,X){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:Q}},X)}async listRoots(Q,X){return this.request({method:"roots/list",params:Q},W9,X)}async sendLoggingMessage(Q,X){if(this._capabilities.logging){if(!this.isMessageIgnored(Q.level,X))return this.notification({method:"notifications/message",params:Q})}}async sendResourceUpdated(Q){return this.notification({method:"notifications/resources/updated",params:Q})}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"})}}import n$ from"node:process";class FX{append(Q){this._buffer=this._buffer?Buffer.concat([this._buffer,Q]):Q}readMessage(){if(!this._buffer)return null;let Q=this._buffer.indexOf(`
|
|
29
|
+
`);if(Q===-1)return null;let X=this._buffer.toString("utf8",0,Q).replace(/\r$/,"");return this._buffer=this._buffer.subarray(Q+1),_M(X)}clear(){this._buffer=void 0}}function _M(Q){return QG.parse(JSON.parse(Q))}function i$(Q){return JSON.stringify(Q)+`
|
|
30
|
+
`}class UX{constructor(Q=n$.stdin,X=n$.stdout){this._stdin=Q,this._stdout=X,this._readBuffer=new FX,this._started=!1,this._ondata=(Y)=>{this._readBuffer.append(Y),this.processReadBuffer()},this._onerror=(Y)=>{this.onerror?.(Y)}}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 Q=this._readBuffer.readMessage();if(Q===null)break;this.onmessage?.(Q)}catch(Q){this.onerror?.(Q)}}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(Q){return new Promise((X)=>{let Y=i$(Q);if(this._stdout.write(Y))X();else this._stdout.once("drain",X)})}}var d$={name:"@sequenzy/mcp",version:"0.0.12",mcpName:"io.github.polnikale/sequenzy-mcp",description:"Sequenzy MCP server for AI-powered email marketing automation",type:"module",bin:{"sequenzy-mcp":"dist/index.js"},main:"./dist/index.js",exports:{".":"./dist/index.js","./server.json":"./server.json"},scripts:{dev:"bun --watch src/index.ts",build:"bun build src/index.ts --outdir dist --target node --minify",start:"node dist/index.js","type-check":"tsc --noEmit",test:"bun test","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{"@modelcontextprotocol/sdk":"^1.0.0"},devDependencies:{"@types/bun":"latest","@types/node":"^22.0.0","bun-types":"latest",typescript:"^5.8.0"},files:["dist","server.json"],keywords:["sequenzy","email","mcp","ai","claude","automation"],license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/sequenzy/sequenzy.git"}};class k1 extends Error{statusCode;rawDetails;code;constructor(Q,X,Y,W){super(Q);this.statusCode=X;this.rawDetails=Y;this.code=W;this.name="McpApiError"}}function hM(Q){if(Q instanceof k1)return{message:Q.message,statusCode:Q.statusCode,code:Q.code,rawDetails:Q.rawDetails};if(Q instanceof Error)return{message:Q.message};return{message:String(Q)}}function gM(Q){let X=hM(Q),Y=X.message.trim()||"Unknown error",W=Y.toLowerCase(),G=X.rawDetails?.trim()||Y;if(X.code==="MCP_AUTH_REQUIRED"||W.includes("sequenzy_api_key environment variable is required"))return{title:"Missing MCP API key",description:"The MCP server started without a Sequenzy API key, so it cannot authenticate any tool or resource request.",howToFix:"Add `SEQUENZY_API_KEY` to the MCP server environment, or run `npx @sequenzy/setup` to configure the integration automatically.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G};if(X.statusCode===401||X.code==="UNAUTHORIZED")return{title:"Authentication failed",description:"The MCP server reached Sequenzy, but the current API key was rejected.",howToFix:"Replace `SEQUENZY_API_KEY` with a valid personal API key, then restart the MCP client so it reconnects with fresh credentials.",docsUrl:"https://docs.sequenzy.com/authentication",details:G};if(X.statusCode===403||W.includes("access denied"))return{title:"Access denied",description:"The current API key is valid, but it does not have permission to access the requested company or action.",howToFix:"Use an API key that belongs to the right account, or select a company the key can access before retrying the tool call.",docsUrl:"https://docs.sequenzy.com/authentication",details:G};if(W.includes("no company available")||W.includes("company not found"))return{title:"Company selection required",description:"The MCP server could not resolve a company for this request.",howToFix:"Call `get_account` to inspect available companies, then call `select_company`, or pass `companyId` explicitly in the next tool call.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G};if(X.statusCode===404||W.includes("not found"))return{title:"Requested resource not found",description:"Sequenzy could not find the requested campaign, template, sequence, company, or subscriber.",howToFix:"List or fetch the resource collection first, then retry the tool with a confirmed ID or email value.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G};if(X.statusCode===429||W.includes("rate limit"))return{title:"Rate limited",description:"Sequenzy temporarily slowed this MCP request because too many requests were sent too quickly.",howToFix:"Wait briefly before retrying. If the client is looping, reduce retries or add backoff before the next tool call.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G};if(X.code==="NETWORK_ERROR"||W.includes("fetch failed"))return{title:"Network or configuration error",description:"The MCP server could not reach the Sequenzy API from this environment.",howToFix:"Check connectivity and verify `SEQUENZY_API_URL` if you override it in the MCP environment.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G};if(W.includes("unknown tool")||W.includes("unknown resource"))return{title:"Unsupported MCP request",description:"The client asked for a tool or resource name that this Sequenzy MCP server does not expose.",howToFix:"Refresh the client's tool list and call only the names returned by `list_tools` or `list_resources`.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G};if(W.includes("is required")||W.includes("invalid"))return{title:"Invalid MCP input",description:"The tool call was missing a required field or included an invalid value.",howToFix:"Review the tool schema, supply the missing argument, and retry the request with corrected input.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G};if(X.statusCode&&X.statusCode>=500)return{title:"Sequenzy server error",description:"The request reached Sequenzy, but the server could not complete it successfully.",howToFix:"Retry once. If it still fails, keep the details below and consult the docs before escalating.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G};return{title:"Tool execution failed",description:"The MCP server could not complete the requested operation.",howToFix:"Review the details below, adjust the tool input or credentials, and retry.",docsUrl:"https://docs.sequenzy.com/concepts/mcp",details:G}}function A1(Q){let X=gM(Q);return[`Sequenzy MCP error: ${X.title}`,`Description: ${X.description}`,`How to fix: ${X.howToFix}`,`Docs: ${X.docsUrl}`,`Details: ${X.details}`].join(`
|
|
31
|
+
`)}var r$=[{uri:"sequenzy://dashboard",name:"Dashboard Overview",description:"Live overview stats for the last 7 days",mimeType:"application/json"},{uri:"sequenzy://company",name:"Current Company",description:"The currently selected company, including localization settings",mimeType:"application/json"},{uri:"sequenzy://campaigns/recent",name:"Recent Campaigns",description:"Last 10 campaigns with status and basic stats",mimeType:"application/json"},{uri:"sequenzy://subscribers/recent",name:"Recent Subscribers",description:"Most recently added subscribers",mimeType:"application/json"},{uri:"sequenzy://subscribers/engaged",name:"Engaged Subscribers",description:"Most active/engaged subscribers",mimeType:"application/json"},{uri:"sequenzy://sequences",name:"Sequences",description:"All email sequences with status",mimeType:"application/json"},{uri:"sequenzy://templates",name:"Templates",description:"All available email templates with localization status",mimeType:"application/json"},{uri:"sequenzy://segments",name:"Segments",description:"All defined segments with subscriber counts",mimeType:"application/json"},{uri:"sequenzy://tags",name:"Tags",description:"All tags with usage counts",mimeType:"application/json"},{uri:"sequenzy://health",name:"Deliverability Health",description:"Email deliverability metrics and health status",mimeType:"application/json"}];async function o$(Q){try{let X;switch(Q){case"sequenzy://dashboard":X=await w("GET","/api/v1/metrics?period=7d");break;case"sequenzy://company":{let Y=await w("GET","/api/v1/account"),W=o4()??Y.currentCompanyId;if(!W)throw Error("No company available. Create or select a company first.");X=await w("GET",`/api/v1/companies/${W}`);break}case"sequenzy://campaigns/recent":X=await w("GET","/api/v1/campaigns?limit=10");break;case"sequenzy://subscribers/recent":X=await w("GET","/api/v1/subscribers?sort=createdAt&limit=20");break;case"sequenzy://subscribers/engaged":X=await w("GET","/api/v1/subscribers?sort=engagement&limit=20");break;case"sequenzy://sequences":X=await w("GET","/api/v1/sequences");break;case"sequenzy://templates":X=await w("GET","/api/v1/templates");break;case"sequenzy://segments":X=await w("GET","/api/v1/segments");break;case"sequenzy://tags":X=await w("GET","/api/v1/tags");break;case"sequenzy://health":X=await w("GET","/api/v1/health/deliverability");break;default:throw Error(`Unknown resource: ${Q}`)}return{contents:[{uri:Q,mimeType:"application/json",text:JSON.stringify(X,null,2)}]}}catch(X){return{contents:[{uri:Q,mimeType:"text/plain",text:A1(X)}]}}}var uM={type:"object",properties:{id:{type:"string",description:"Optional filter ID. Any stable string works; one will be generated if omitted."},field:{type:"string",enum:["status","tag","email","added","firstName","lastName","list","emailSent","emailOpened","emailClicked","emailBounced","emailComplained","attribute","stripeProduct"],description:"Filter field. Use `stripeProduct` for Stripe purchase-based segments."},operator:{type:"string",enum:["is","is_not","contains","not_contains","less_than","more_than","at_least","less_than_count","gte","lte","gt","lt"],description:"Filter operator. For `stripeProduct`, use `is` or `is_not` with a raw product ID, and `at_least` or `less_than_count` with `productId:count`."},value:{type:"string",description:"Filter value. Stripe product examples: `prod_123` for bought/didn't buy, `prod_123:3` for payment thresholds."}},required:["field","operator","value"],additionalProperties:!1};function fM(Q){if(!Array.isArray(Q))return Q;return Q.map((X)=>{if(typeof X!=="object"||X===null)return X;let Y=X;if(typeof Y.id==="string"&&Y.id.trim()!=="")return Y;return{...Y,id:crypto.randomUUID()}})}function t4(Q,X,Y){if(X.html!==void 0&&X.blocks!==void 0)throw Error(`Provide either \`html\` or \`blocks\` when calling \`${Q}\`, not both.`);if(X.blocks!==void 0&&!Array.isArray(X.blocks))throw Error(`\`blocks\` must be an array when calling \`${Q}\`.`);if(Y?.requireContent&&X.html===void 0&&X.blocks===void 0)throw Error(`Provide either \`html\` or \`blocks\` when calling \`${Q}\`.`)}function lM(Q){if(!Q||typeof Q!=="object")return null;let X=Q;if(X.success!==!1)return null;if(typeof X.error==="string")return Error(X.error);if(X.error&&typeof X.error==="object"&&typeof X.error.message==="string")return Error(X.error.message);if(typeof X.message==="string")return Error(X.message);return Error("The tool returned an unsuccessful response.")}function t$(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function a$(Q){return Q.trim().toLowerCase().replace(/\s+/g,"-")}function mM(Q){let X=new URLSearchParams;if(typeof Q.query==="string"&&Q.query.trim()!=="")X.set("query",Q.query.trim());if(Array.isArray(Q.tags)&&Q.tags.length>0)X.set("tags",Q.tags.filter((Y)=>typeof Y==="string"&&Y.trim()!=="").join(","));if(typeof Q.segmentId==="string"&&Q.segmentId.trim()!=="")X.set("segmentId",Q.segmentId);return X.set("page",String(Q.page)),X.set("limit",String(Q.pageSize)),X}async function cM(Q,X){let Y=typeof Q.limit==="number"&&Number.isFinite(Q.limit)?Math.max(1,Math.trunc(Q.limit)):void 0,W=Math.min(100,Math.max(1,Y??100)),G=[],J=1,$=0,z=0,H=0;while(!0){let B=mM({query:Q.query,tags:Q.tags,segmentId:Q.segmentId,page:J,pageSize:W}),D=await w("GET",`/api/v1/subscribers?${B.toString()}`,void 0,X);$=D.pagination?.total??D.subscribers.length,z=D.pagination?.totalPages??1,H+=1,G.push(...D.subscribers??[]);let U=Y!==void 0&&G.length>=Y,L=D.pagination?J>=D.pagination.totalPages:(D.subscribers??[]).length<W;if(U||L)break;J+=1}let K=Y!==void 0?G.slice(0,Y):G;return{success:!0,subscribers:K,pagination:{page:1,limit:W,total:$,totalPages:z,fetchedPages:H},returned:K.length,truncated:Y!==void 0&&$>0&&K.length<$}}async function LX(Q,X){return w("GET",`/api/v1/subscribers/${encodeURIComponent(Q)}`,void 0,X)}var s$=[{name:"get_account",description:`Get current account information including available companies. IMPORTANT: If you have access to multiple companies, you MUST either:
|
|
32
32
|
1. Call select_company first to choose which company to work with, OR
|
|
33
33
|
2. Pass companyId explicitly in each tool call
|
|
34
34
|
|
|
@@ -45,7 +45,7 @@ Use cases:
|
|
|
45
45
|
- 'subscribe_form': Adding subscribers from signup forms
|
|
46
46
|
- 'event_tracking': Tracking CUSTOM events only (not payment events - those come from the integration)
|
|
47
47
|
|
|
48
|
-
Before implementing, use create_api_key to generate an API key and save it to .env as SEQUENZY_API_KEY.`,inputSchema:{type:"object",properties:{framework:{type:"string",description:"Framework/language (nextjs, express, python, etc.)"},use_case:{type:"string",description:"Use case: 'transactional' (sending emails), 'subscribe_form' (adding subscribers), 'event_tracking' (tracking CUSTOM events only - payment events should come from Stripe/Polar/etc integration)"}}}},{name:"add_subscriber",description:"Add a new subscriber to your list",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to add subscriber to. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"},attributes:{type:"object",description:"Custom attributes (name, plan, etc.)"},tags:{type:"array",items:{type:"string"},description:"Tags to apply to the subscriber"},listIds:{type:"array",items:{type:"string"},description:"List IDs to add subscriber to"}},required:["email"]}},{name:"update_subscriber",description:"Update an existing subscriber's attributes or tags",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"},attributes:{type:"object",description:"Attributes to update"},addTags:{type:"array",items:{type:"string"},description:"Tags to add"},removeTags:{type:"array",items:{type:"string"},description:"Tags to remove"}},required:["email"]}},{name:"remove_subscriber",description:"Unsubscribe or delete a subscriber",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"},hardDelete:{type:"boolean",description:"If true, permanently deletes. If false, just unsubscribes."}},required:["email"]}},{name:"get_subscriber",description:"Get the full subscriber profile, including tags, list memberships, sequence enrollments, email stats, and recent activity",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"}},required:["email"]}},{name:"search_subscribers",description:"Search subscribers by free-text query, tags, or segment. If you omit limit, the tool fetches all pages and returns every match.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},query:{type:"string",description:"Search query (email or name)"},tags:{type:"array",items:{type:"string"},description:"Filter by tags"},segmentId:{type:"string",description:"Filter by segment ID"},limit:{type:"number",description:"Maximum results to return. If omitted, the tool returns all matches across pages."}}}},{name:"list_tags",description:"List all tags in the account",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list tags for. If not provided, uses the currently selected company."}}}},{name:"list_lists",description:"List all subscriber lists",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list lists for. If not provided, uses the currently selected company."}}}},{name:"create_list",description:"Create a new subscriber list",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to create the list in. If not provided, uses the currently selected company."},name:{type:"string",description:"List name"},description:{type:"string",description:"List description"}},required:["name"]}},{name:"list_segments",description:"List all segments",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list segments for. If not provided, uses the currently selected company."}}}},{name:"create_segment",description:'Create a new segment from explicit filter rules. Supports Stripe product purchase filters via `field: "stripeProduct"` with values like `prod_123` or `prod_123:3`.',inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to create the segment in. If not provided, uses the currently selected company."},name:{type:"string",description:"Segment name"},filters:{type:"array",items:hM,minItems:1,description:'Array of segment filters. Example Stripe purchase filter: [{"id":"filter-1","field":"stripeProduct","operator":"is","value":"prod_123"}]. Example threshold filter: [{"id":"filter-1","field":"stripeProduct","operator":"at_least","value":"prod_123:3"}].'}},required:["name","filters"]}},{name:"get_segment_count",description:"Get the number of subscribers in a segment",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},segmentId:{type:"string",description:"Segment ID"}},required:["segmentId"]}},{name:"list_templates",description:"List all email templates, including per-locale localization sync status",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."}}}},{name:"get_template",description:"Get a template's details, content, and all localized variants with sync status",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},templateId:{type:"string",description:"Template ID"}},required:["templateId"]}},{name:"create_template",description:"Create a new email template",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},name:{type:"string",description:"Template name"},subject:{type:"string",description:"Email subject line"},html:{type:"string",description:"Email HTML content"}},required:["name","subject","html"]}},{name:"update_template",description:"Update an existing template. At least one of `name`, `subject`, or `html` is required, and only those update fields are accepted.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},templateId:{type:"string",description:"Template ID"},name:{type:"string",description:"Template name"},subject:{type:"string",description:"Email subject line"},html:{type:"string",description:"Email HTML content. Use this field for content updates instead of `blocks`."}},required:["templateId"],additionalProperties:!1}},{name:"delete_template",description:"Delete a template",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},templateId:{type:"string",description:"Template ID"}},required:["templateId"]}},{name:"list_campaigns",description:"List all campaigns",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list campaigns for. If not provided, uses the currently selected company."},status:{type:"string",description:"Filter by status (draft, scheduled, sent)"}}}},{name:"get_campaign",description:"Get campaign details and stats",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},campaignId:{type:"string",description:"Campaign ID"}},required:["campaignId"]}},{name:"create_campaign",description:"Create a new campaign (as draft)",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to create the campaign in. If not provided, uses the currently selected company."},name:{type:"string",description:"Campaign name"},subject:{type:"string",description:"Email subject line"},html:{type:"string",description:"Email HTML content"},templateId:{type:"string",description:"Use a template instead of html"},segmentId:{type:"string",description:"Target segment ID"}},required:["name","subject"]}},{name:"update_campaign",description:"Update a draft campaign",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},campaignId:{type:"string",description:"Campaign ID"},name:{type:"string",description:"Campaign name"},subject:{type:"string",description:"Email subject line"},html:{type:"string",description:"Email HTML content"},replyTo:{type:"string",description:"Set reply-to using an existing reply profile email address for this company."},replyProfileId:{type:"string",description:"Set reply-to using a reply profile ID for this company."}},required:["campaignId"],additionalProperties:!1}},{name:"send_test_email",description:"Send a test email to a single address",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},campaignId:{type:"string",description:"Campaign ID to test"},to:{type:"string",description:"Email address to send test to"}},required:["campaignId","to"]}},{name:"list_sequences",description:"List all email sequences (automations)",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list sequences for. If not provided, uses the currently selected company."}}}},{name:"get_sequence",description:"Get sequence details plus editable step content. The response includes sequence.emails with each step's nodeId, linked emailId, subject, previewText, and blocks.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"create_sequence",description:`Create a new email sequence. Sequenzy will automatically generate the email content using AI based on your company's brand and the goal you specify. The tool polls until emails are generated (typically 30-60 seconds).
|
|
48
|
+
Before implementing, use create_api_key to generate an API key and save it to .env as SEQUENZY_API_KEY.`,inputSchema:{type:"object",properties:{framework:{type:"string",description:"Framework/language (nextjs, express, python, etc.)"},use_case:{type:"string",description:"Use case: 'transactional' (sending emails), 'subscribe_form' (adding subscribers), 'event_tracking' (tracking CUSTOM events only - payment events should come from Stripe/Polar/etc integration)"}}}},{name:"add_subscriber",description:"Add a new subscriber to your list",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to add subscriber to. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"},attributes:{type:"object",description:"Custom attributes (name, plan, etc.)"},tags:{type:"array",items:{type:"string"},description:"Tags to apply to the subscriber"},listIds:{type:"array",items:{type:"string"},description:"List IDs to add subscriber to"}},required:["email"]}},{name:"update_subscriber",description:"Update an existing subscriber's attributes or tags",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"},attributes:{type:"object",description:"Attributes to update"},addTags:{type:"array",items:{type:"string"},description:"Tags to add"},removeTags:{type:"array",items:{type:"string"},description:"Tags to remove"}},required:["email"]}},{name:"remove_subscriber",description:"Unsubscribe or delete a subscriber",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"},hardDelete:{type:"boolean",description:"If true, permanently deletes. If false, just unsubscribes."}},required:["email"]}},{name:"get_subscriber",description:"Get the full subscriber profile, including tags, list memberships, sequence enrollments, email stats, and recent activity",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"}},required:["email"]}},{name:"search_subscribers",description:"Search subscribers by free-text query, tags, or segment. If you omit limit, the tool fetches all pages and returns every match.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},query:{type:"string",description:"Search query (email or name)"},tags:{type:"array",items:{type:"string"},description:"Filter by tags"},segmentId:{type:"string",description:"Filter by segment ID"},limit:{type:"number",description:"Maximum results to return. If omitted, the tool returns all matches across pages."}}}},{name:"list_tags",description:"List all tags in the account",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list tags for. If not provided, uses the currently selected company."}}}},{name:"list_lists",description:"List all subscriber lists",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list lists for. If not provided, uses the currently selected company."}}}},{name:"create_list",description:"Create a new subscriber list",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to create the list in. If not provided, uses the currently selected company."},name:{type:"string",description:"List name"},description:{type:"string",description:"List description"}},required:["name"]}},{name:"list_segments",description:"List all segments",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list segments for. If not provided, uses the currently selected company."}}}},{name:"create_segment",description:'Create a new segment from explicit filter rules. Supports Stripe product purchase filters via `field: "stripeProduct"` with values like `prod_123` or `prod_123:3`.',inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to create the segment in. If not provided, uses the currently selected company."},name:{type:"string",description:"Segment name"},filterJoinOperator:{type:"string",enum:["and","or"],description:'How top-level filters combine. Use `"and"` to require every filter or `"or"` to match any filter.'},filters:{type:"array",items:uM,minItems:1,description:'Array of segment filters. Example Stripe purchase filter: [{"id":"filter-1","field":"stripeProduct","operator":"is","value":"prod_123"}]. Example threshold filter: [{"id":"filter-1","field":"stripeProduct","operator":"at_least","value":"prod_123:3"}]. Combine them with `filterJoinOperator: "or"` to match any filter.'}},required:["name","filters"]}},{name:"get_segment_count",description:"Get the number of subscribers in a segment",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},segmentId:{type:"string",description:"Segment ID"}},required:["segmentId"]}},{name:"list_templates",description:"List all email templates, including per-locale localization sync status",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."}}}},{name:"get_template",description:"Get a template's details, content, and all localized variants with sync status",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},templateId:{type:"string",description:"Template ID"}},required:["templateId"]}},{name:"create_template",description:"Create a new email template",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},name:{type:"string",description:"Template name"},subject:{type:"string",description:"Email subject line"},html:{type:"string",description:"Email HTML content. Mutually exclusive with `blocks`."},blocks:{type:"array",description:"Sequenzy email blocks. Use this for editor-compatible content, including conditional blocks.",items:{type:"object"}}},required:["name","subject"]}},{name:"update_template",description:"Update an existing template. At least one of `name`, `subject`, `html`, or `blocks` is required, and only those update fields are accepted.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},templateId:{type:"string",description:"Template ID"},name:{type:"string",description:"Template name"},subject:{type:"string",description:"Email subject line"},html:{type:"string",description:"Email HTML content. Mutually exclusive with `blocks`."},blocks:{type:"array",description:"Sequenzy email blocks. Use this for editor-compatible content, including conditional blocks.",items:{type:"object"}}},required:["templateId"],additionalProperties:!1}},{name:"delete_template",description:"Delete a template",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},templateId:{type:"string",description:"Template ID"}},required:["templateId"]}},{name:"list_campaigns",description:"List all campaigns",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list campaigns for. If not provided, uses the currently selected company."},status:{type:"string",description:"Filter by status (draft, scheduled, sent)"}}}},{name:"get_campaign",description:"Get campaign details and stats",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},campaignId:{type:"string",description:"Campaign ID"}},required:["campaignId"]}},{name:"create_campaign",description:"Create a new campaign (as draft)",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to create the campaign in. If not provided, uses the currently selected company."},name:{type:"string",description:"Campaign name"},subject:{type:"string",description:"Email subject line"},html:{type:"string",description:"Email HTML content. Mutually exclusive with `blocks`."},blocks:{type:"array",description:"Sequenzy email blocks. Use this for editor-compatible content, including conditional blocks.",items:{type:"object"}},templateId:{type:"string",description:"Use a template instead of html"},segmentId:{type:"string",description:"Target segment ID"}},required:["name","subject"]}},{name:"update_campaign",description:"Update a draft campaign",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},campaignId:{type:"string",description:"Campaign ID"},name:{type:"string",description:"Campaign name"},subject:{type:"string",description:"Email subject line"},html:{type:"string",description:"Email HTML content. Mutually exclusive with `blocks`."},blocks:{type:"array",description:"Sequenzy email blocks. Use this for editor-compatible content, including conditional blocks.",items:{type:"object"}},replyTo:{type:"string",description:"Set reply-to using an existing reply profile email address for this company."},replyProfileId:{type:"string",description:"Set reply-to using a reply profile ID for this company."}},required:["campaignId"],additionalProperties:!1}},{name:"send_test_email",description:"Send a test email to a single address",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},campaignId:{type:"string",description:"Campaign ID to test"},to:{type:"string",description:"Email address to send test to"}},required:["campaignId","to"]}},{name:"list_sequences",description:"List all email sequences (automations)",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to list sequences for. If not provided, uses the currently selected company."}}}},{name:"get_sequence",description:"Get sequence details plus editable step content. The response includes sequence.emails with each step's nodeId, linked emailId, subject, previewText, and blocks.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"create_sequence",description:`Create a new email sequence. Sequenzy will automatically generate the email content using AI based on your company's brand and the goal you specify. The tool polls until emails are generated (typically 30-60 seconds).
|
|
49
49
|
|
|
50
50
|
IMPORTANT GUIDELINES:
|
|
51
51
|
|
|
@@ -157,4 +157,4 @@ BUILT-IN EVENTS (auto-fired by payment integrations):
|
|
|
157
157
|
|
|
158
158
|
OTHER BUILT-IN EVENTS:
|
|
159
159
|
- email.opened, email.clicked, email.replied, email.bounced, email.unsubscribed
|
|
160
|
-
- contact.subscribed, contact.unsubscribed`,inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to create the sequence in. If not provided, uses the currently selected company."},name:{type:"string",description:"Sequence name (e.g., 'User Onboarding', 'Welcome Series')"},trigger:{type:"string",enum:["contact_added","tag_added","segment_entered","event_received","inactivity","frequency"],description:"Trigger type: 'contact_added' (when added to a list), 'tag_added' (when tag is applied), 'segment_entered' (when a contact newly enters a saved segment), 'event_received' (when custom event fires), 'inactivity' (when subscriber hasn't performed an event for X days), 'frequency' (when subscriber performs event X times in Y days)"},listId:{type:"string",description:"List ID to trigger on (for contact_added trigger). If not provided, triggers on any list."},tagName:{type:"string",description:"Tag name to trigger on (required for tag_added trigger)"},segmentId:{type:"string",description:"Segment ID to trigger on (required for segment_entered trigger). Use list_segments first to choose a saved segment."},eventName:{type:"string",description:"Event name to trigger on (required for event_received, inactivity, and frequency triggers)"},inactiveDays:{type:"number",description:"Number of days of inactivity (required for inactivity trigger, must be >= 1)"},minCount:{type:"number",description:"Minimum event count (required for frequency trigger, must be >= 1)"},timeWindowDays:{type:"number",description:"Time window in days for frequency trigger (required for frequency trigger, must be >= 1)"},emailCount:{type:"number",description:"Number of emails in the sequence (default: 5)"},goal:{type:"string",description:"What this sequence should accomplish. Be specific to the app's actual features and user journey. Avoid generic goals that don't match the app's business model."}},required:["name","trigger","goal"]}},{name:"update_sequence",description:"Update an existing sequence. To target a specific step, use the emailId or nodeId returned in get_sequence.sequence.emails.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"},name:{type:"string",description:"Sequence name"},emails:{type:"array",description:"Updated sequence emails. If you omit emailId/nodeId, items are matched by existing step order.",items:{type:"object",properties:{emailId:{type:"string",description:"Optional target linked email template ID for a step. Use the emailId returned in get_sequence.sequence.emails."},nodeId:{type:"string",description:"Optional target action_email node ID for a step. Use the nodeId returned in get_sequence.sequence.emails."},name:{type:"string",description:"Updated step/template name"},subject:{type:"string",description:"Updated email subject"},previewText:{type:"string",description:"Updated preview text"},html:{type:"string",description:"Updated HTML content. Will be converted to Sequenzy blocks."},htmlContent:{type:"string",description:"Alias for html. Use this when updating HTML content for a step."},blocks:{type:"array",description:"Updated Sequenzy block JSON for the step"}}}},steps:{type:"array",description:"Alias for emails. Supports the same fields and matching rules.",items:{type:"object",properties:{emailId:{type:"string",description:"Optional target linked email template ID for a step. Use the emailId returned in get_sequence.sequence.emails."},nodeId:{type:"string",description:"Optional target action_email node ID for a step. Use the nodeId returned in get_sequence.sequence.emails."},name:{type:"string",description:"Updated step/template name"},subject:{type:"string",description:"Updated email subject"},previewText:{type:"string",description:"Updated preview text"},html:{type:"string",description:"Updated HTML content. Will be converted to Sequenzy blocks."},htmlContent:{type:"string",description:"Alias for html. Use this when updating HTML content for a step."},blocks:{type:"array",description:"Updated Sequenzy block JSON for the step"}}}}},required:["sequenceId"]}},{name:"enable_sequence",description:"Enable/activate a sequence. IMPORTANT: Only call this when the user EXPLICITLY asks to enable or activate a sequence. Never enable sequences automatically after creation - the user must review the content first.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"disable_sequence",description:"Disable/pause a sequence",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"delete_sequence",description:"Delete a sequence",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"send_email",description:"Send a transactional email to a single recipient",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},to:{type:"string",description:"Recipient email address"},subject:{type:"string",description:"Email subject (required if not using templateId)"},html:{type:"string",description:"Email HTML content (required if not using templateId)"},templateId:{type:"string",description:"Template ID to use (alternative to html)"},variables:{type:"object",description:"Variables for template personalization"}},required:["to"]}},{name:"get_stats",description:"Get overview statistics for a time period",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},period:{type:"string",description:"Time period: 7d, 30d, or 90d (default: 7d)"}}}},{name:"get_campaign_stats",description:"Get detailed statistics for a campaign",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},campaignId:{type:"string",description:"Campaign ID"}},required:["campaignId"]}},{name:"get_sequence_stats",description:"Get statistics for a sequence, including per-step failed subscribers and failure reasons",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"get_subscriber_activity",description:"Get recent activity, email stats, and current sequence enrollments for a subscriber",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"}},required:["email"]}},{name:"generate_email",description:"Generate email HTML content from a prompt",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},prompt:{type:"string",description:"Description of the email to generate"},style:{type:"string",description:"Style: minimal, branded, promotional"},tone:{type:"string",description:"Tone: professional, casual, friendly"}},required:["prompt"]}},{name:"generate_sequence",description:"[DEPRECATED - Use create_sequence instead] Generate a multi-email sequence from a goal. Note: create_sequence now handles AI generation automatically.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},goal:{type:"string",description:"Goal of the sequence (e.g., 'onboard new SaaS trial users')"},emailCount:{type:"number",description:"Number of emails in the sequence (default: 5)"},durationDays:{type:"number",description:"Total duration in days (default: 14)"}},required:["goal"]}},{name:"generate_subject_lines",description:"Generate A/B test subject line variants",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},topic:{type:"string",description:"Topic or context for the subject lines"},count:{type:"number",description:"Number of variants to generate (default: 5)"}},required:["topic"]}}];async function s$(Q,X){try{let Y;switch(Q){case"get_account":{let G=await w("GET","/api/v1/account"),J=o4();Y={...G,selectedCompanyId:J??G.currentCompanyId};break}case"select_company":{let G=X.companyId,J=await w("GET","/api/v1/account"),$=J.companies?.find((z)=>z.id===G);if(!$)throw Error(`Company not found. Available companies: ${J.companies?.map((z)=>`${z.name} (${z.id})`).join(", ")??"none"}`);LX(G),Y={success:!0,message:`Switched to company: ${$.name}`,companyId:$.id,companyName:$.name};break}case"create_company":{let G=await w("POST","/api/v1/companies",{name:X.name,domain:X.domain});if(!G.success)throw Error("Failed to create company");let J=G.company.id,$=6,z=0,H=G.company.status;while(H==="processing"&&z<$){await new Promise((D)=>setTimeout(D,20000)),z++;let K=await w("GET",`/api/v1/companies/${J}`);if(K.success)H=K.company.status}LX(J);let B=await w("GET",`/api/v1/companies/${J}`);Y={success:!0,company:B.company,message:H==="processing"?"Company created but still processing. You can continue using it while processing completes.":`Company '${B.company.name}' created and ready to use.`,autoSelected:!0};break}case"get_company":{let G=X.companyId;Y=await w("GET",`/api/v1/companies/${G}`);break}case"create_api_key":{let G=X.companyId;Y=await w("POST","/api/v1/api-keys",{name:X.name},G);break}case"list_websites":{let G=X.companyId;Y=await w("GET","/api/v1/websites",void 0,G);break}case"add_website":{let G=X.companyId;Y=await w("POST","/api/v1/websites",{domain:X.domain},G);break}case"check_website":{let G=X.companyId;Y=await w("GET",`/api/v1/websites/${X.domain}`,void 0,G);break}case"get_integration_guide":Y=await w("POST","/api/v1/integration-guide",X);break;case"add_subscriber":{let G=X.companyId;Y=await w("POST","/api/v1/subscribers",{email:X.email,customAttributes:X.attributes,tags:X.tags,lists:X.listIds},G);break}case"update_subscriber":{let G=X.companyId,J=await UX(String(X.email),G),$=Array.isArray(J.subscriber.tags)?J.subscriber.tags.filter((D)=>typeof D==="string"):[],z=Array.isArray(X.addTags)?X.addTags.filter((D)=>typeof D==="string"&&D.trim()!=="").map(t$):[],H=new Set(Array.isArray(X.removeTags)?X.removeTags.filter((D)=>typeof D==="string"&&D.trim()!=="").map(t$):[]),B=$.filter((D)=>!H.has(D));for(let D of z)if(!B.includes(D))B.push(D);let K={};if(o$(X.attributes))K.customAttributes={...o$(J.subscriber.customAttributes)?J.subscriber.customAttributes:{},...X.attributes};if(X.addTags||X.removeTags)K.tags=B;Y=await w("PATCH",`/api/v1/subscribers/${encodeURIComponent(String(X.email))}`,K,G);break}case"remove_subscriber":{let G=X.companyId;if(X.hardDelete===!0)Y=await w("DELETE",`/api/v1/subscribers/${encodeURIComponent(String(X.email))}`,void 0,G);else Y=await w("PATCH",`/api/v1/subscribers/${encodeURIComponent(String(X.email))}`,{status:"unsubscribed"},G);break}case"get_subscriber":{let G=X.companyId;Y=await UX(String(X.email),G);break}case"search_subscribers":{let G=X.companyId;Y=await mM(X,G);break}case"list_tags":{let G=X.companyId;Y=await w("GET","/api/v1/tags",void 0,G);break}case"list_lists":{let G=X.companyId;Y=await w("GET","/api/v1/lists",void 0,G);break}case"create_list":{let G=X.companyId;Y=await w("POST","/api/v1/lists",X,G);break}case"list_segments":{let G=X.companyId;Y=await w("GET","/api/v1/segments",void 0,G);break}case"create_segment":{let G=X.companyId;Y=await w("POST","/api/v1/segments",{...X,filters:uM(X.filters)},G);break}case"get_segment_count":{let G=X.companyId;Y=await w("GET",`/api/v1/segments/${X.segmentId}/count`,void 0,G);break}case"list_templates":{let G=X.companyId;Y=await w("GET","/api/v1/templates",void 0,G);break}case"get_template":{let G=X.companyId;Y=await w("GET",`/api/v1/templates/${X.templateId}`,void 0,G);break}case"create_template":{let G=X.companyId;Y=await w("POST","/api/v1/templates",X,G);break}case"update_template":{let G=X.companyId,J=new Set(["companyId","templateId","name","subject","html"]),$=Object.keys(X).filter((z)=>!J.has(z));if($.length>0)throw Error(`\`update_template\` accepts only \`name\`, \`subject\`, and \`html\` update fields. Unsupported field${$.length===1?"":"s"}: ${$.map((z)=>`\`${z}\``).join(", ")}.`);if(X.name===void 0&&X.subject===void 0&&X.html===void 0)throw Error("Provide at least one of `name`, `subject`, or `html` when calling `update_template`.");Y=await w("PUT",`/api/v1/templates/${X.templateId}`,X,G);break}case"delete_template":{let G=X.companyId;Y=await w("DELETE",`/api/v1/templates/${X.templateId}`,void 0,G);break}case"list_campaigns":{let G=X.companyId,J=new URLSearchParams;if(X.status)J.set("status",String(X.status));Y=await w("GET",`/api/v1/campaigns?${J}`,void 0,G);break}case"get_campaign":{let G=X.companyId;Y=await w("GET",`/api/v1/campaigns/${X.campaignId}`,void 0,G);break}case"create_campaign":{let G=X.companyId;Y=await w("POST","/api/v1/campaigns",X,G);break}case"update_campaign":{let G=X.companyId,J=new Set(["companyId","campaignId","name","subject","html","replyTo","replyProfileId"]),$=Object.keys(X).filter((z)=>!J.has(z));if($.length>0)throw Error(`\`update_campaign\` accepts only \`name\`, \`subject\`, \`html\`, \`replyTo\`, and \`replyProfileId\` update fields. Unsupported field${$.length===1?"":"s"}: ${$.map((z)=>`\`${z}\``).join(", ")}.`);if(X.replyTo!==void 0&&X.replyProfileId!==void 0)throw Error("Provide either `replyTo` or `replyProfileId` when calling `update_campaign`, not both.");if(X.name===void 0&&X.subject===void 0&&X.html===void 0&&X.replyTo===void 0&&X.replyProfileId===void 0)throw Error("Provide at least one of `name`, `subject`, `html`, `replyTo`, or `replyProfileId` when calling `update_campaign`.");Y=await w("PUT",`/api/v1/campaigns/${X.campaignId}`,X,G);break}case"send_test_email":{let G=X.companyId;Y=await w("POST",`/api/v1/campaigns/${X.campaignId}/test`,{to:X.to},G);break}case"list_sequences":{let G=X.companyId;Y=await w("GET","/api/v1/sequences",void 0,G);break}case"get_sequence":{let G=X.companyId;Y=await w("GET",`/api/v1/sequences/${X.sequenceId}`,void 0,G);break}case"create_sequence":{let G=X.companyId,J=await w("POST","/api/v1/sequences",X,G);if(!J.success){Y=J;break}let $=J.sequence.id,z=6,H=0,B="pending";while(B!=="complete"&&H<z){await new Promise((U)=>setTimeout(U,20000)),H++;let D=await w("GET",`/api/v1/sequences/${$}`,void 0,G);if(D.success)B=D.sequence.enrichmentStatus}let K=await w("GET",`/api/v1/sequences/${$}`,void 0,G);if(K.success)Y={success:!0,sequence:K.sequence,message:K.sequence.enrichmentStatus==="complete"?`Sequence "${K.sequence.name}" created with ${K.sequence.emailCount} AI-generated emails. The sequence is ready to review and enable.`:`Sequence "${K.sequence.name}" created. Email enrichment is still in progress (${K.sequence.enrichedCount}/${K.sequence.emailCount} emails generated). You can check status with get_sequence.`};else Y=K;break}case"update_sequence":{let G=X.companyId;Y=await w("PUT",`/api/v1/sequences/${X.sequenceId}`,X,G);break}case"enable_sequence":{let G=X.companyId;Y=await w("POST",`/api/v1/sequences/${X.sequenceId}/enable`,void 0,G);break}case"disable_sequence":{let G=X.companyId;Y=await w("POST",`/api/v1/sequences/${X.sequenceId}/disable`,void 0,G);break}case"delete_sequence":{let G=X.companyId;Y=await w("DELETE",`/api/v1/sequences/${X.sequenceId}`,void 0,G);break}case"send_email":{let G=X.companyId;Y=await w("POST","/api/v1/transactional/send",X,G);break}case"get_stats":{let G=X.companyId,J=X.period??"7d";Y=await w("GET",`/api/v1/metrics?period=${J}`,void 0,G);break}case"get_campaign_stats":{let G=X.companyId;Y=await w("GET",`/api/v1/metrics/campaigns/${X.campaignId}`,void 0,G);break}case"get_sequence_stats":{let G=X.companyId;Y=await w("GET",`/api/v1/metrics/sequences/${X.sequenceId}`,void 0,G);break}case"get_subscriber_activity":{let G=X.companyId,J=await UX(String(X.email),G);Y={success:J.success,email:J.subscriber.email,emailStats:J.subscriber.emailStats??null,activity:J.subscriber.activity??[],sequenceEnrollments:J.subscriber.sequenceEnrollments??[]};break}case"generate_email":{let G=X.companyId;Y=await w("POST","/api/v1/generate/email",X,G);break}case"generate_sequence":{let G=X.companyId;Y=await w("POST","/api/v1/generate/sequence",X,G);break}case"generate_subject_lines":{let G=X.companyId;Y=await w("POST","/api/v1/generate/subjects",X,G);break}default:throw Error(`Unknown tool: ${Q}`)}let W=fM(Y);if(W)throw W;return{content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}catch(Y){return{isError:!0,content:[{type:"text",text:A1(Y)}]}}}var cM=process.env.SEQUENZY_API_URL??"https://api.sequenzy.com",e$=process.env.SEQUENZY_API_KEY,OX=null;if(!e$)console.error(A1(new k1("SEQUENZY_API_KEY environment variable is required",401,void 0,"MCP_AUTH_REQUIRED"))),process.exit(1);function o4(){return OX}function LX(Q){OX=Q}var T6=new DX({name:"sequenzy",version:n$.version},{capabilities:{tools:{},resources:{}}});function pM(Q){if(!Q.trim())return{message:"Request failed"};try{let X=JSON.parse(Q);if(typeof X==="string")return{message:X};if(typeof X.error==="string")return{message:X.error,code:X.code};if(X.error&&typeof X.error==="object")return{message:X.error.message??X.message??Q,code:X.error.code??X.code};return{message:X.message??Q,code:X.code}}catch{return{message:Q}}}async function w(Q,X,Y,W){let G={"Content-Type":"application/json",Authorization:`Bearer ${e$}`},J=W??OX;if(J)G["x-company-id"]=J;let $;try{$=await fetch(`${cM}${X}`,{method:Q,headers:G,body:Y?JSON.stringify(Y):void 0})}catch(z){throw new k1(z instanceof Error?z.message:"Failed to reach Sequenzy API",0,void 0,"NETWORK_ERROR")}if(!$.ok){let z=await $.text(),H=pM(z);throw new k1(H.message,$.status,z,H.code)}return $.json()}T6.setRequestHandler(sQ,async()=>{return{tools:a$}});T6.setRequestHandler(Y6,async(Q)=>{let{name:X,arguments:Y}=Q.params;return s$(X,Y??{})});T6.setRequestHandler(iQ,async()=>{return{resources:d$}});T6.setRequestHandler(dQ,async(Q)=>{let{uri:X}=Q.params;return r$(X)});async function iM(){let Q=new FX;await T6.connect(Q),console.error("Sequenzy MCP server running on stdio")}iM().catch((Q)=>{console.error(A1(Q)),process.exit(1)});export{LX as setSelectedCompanyId,o4 as getSelectedCompanyId,w as apiRequest};
|
|
160
|
+
- contact.subscribed, contact.unsubscribed`,inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID to create the sequence in. If not provided, uses the currently selected company."},name:{type:"string",description:"Sequence name (e.g., 'User Onboarding', 'Welcome Series')"},trigger:{type:"string",enum:["contact_added","tag_added","segment_entered","event_received","inactivity","frequency"],description:"Trigger type: 'contact_added' (when added to a list), 'tag_added' (when tag is applied), 'segment_entered' (when a contact newly enters a saved segment), 'event_received' (when custom event fires), 'inactivity' (when subscriber hasn't performed an event for X days), 'frequency' (when subscriber performs event X times in Y days)"},listId:{type:"string",description:"List ID to trigger on (for contact_added trigger). If not provided, triggers on any list."},tagName:{type:"string",description:"Tag name to trigger on (required for tag_added trigger)"},segmentId:{type:"string",description:"Segment ID to trigger on (required for segment_entered trigger). Use list_segments first to choose a saved segment."},eventName:{type:"string",description:"Event name to trigger on (required for event_received, inactivity, and frequency triggers)"},inactiveDays:{type:"number",description:"Number of days of inactivity (required for inactivity trigger, must be >= 1)"},minCount:{type:"number",description:"Minimum event count (required for frequency trigger, must be >= 1)"},timeWindowDays:{type:"number",description:"Time window in days for frequency trigger (required for frequency trigger, must be >= 1)"},emailCount:{type:"number",description:"Number of emails in the sequence (default: 5)"},goal:{type:"string",description:"What this sequence should accomplish. Be specific to the app's actual features and user journey. Avoid generic goals that don't match the app's business model."}},required:["name","trigger","goal"]}},{name:"update_sequence",description:"Update an existing sequence. To target a specific step, use the emailId or nodeId returned in get_sequence.sequence.emails.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"},name:{type:"string",description:"Sequence name"},emails:{type:"array",description:"Updated sequence emails. If you omit emailId/nodeId, items are matched by existing step order.",items:{type:"object",properties:{emailId:{type:"string",description:"Optional target linked email template ID for a step. Use the emailId returned in get_sequence.sequence.emails."},nodeId:{type:"string",description:"Optional target action_email node ID for a step. Use the nodeId returned in get_sequence.sequence.emails."},name:{type:"string",description:"Updated step/template name"},subject:{type:"string",description:"Updated email subject"},previewText:{type:"string",description:"Updated preview text"},html:{type:"string",description:"Updated HTML content. Will be converted to Sequenzy blocks."},htmlContent:{type:"string",description:"Alias for html. Use this when updating HTML content for a step."},blocks:{type:"array",description:"Updated Sequenzy block JSON for the step"}}}},steps:{type:"array",description:"Alias for emails. Supports the same fields and matching rules.",items:{type:"object",properties:{emailId:{type:"string",description:"Optional target linked email template ID for a step. Use the emailId returned in get_sequence.sequence.emails."},nodeId:{type:"string",description:"Optional target action_email node ID for a step. Use the nodeId returned in get_sequence.sequence.emails."},name:{type:"string",description:"Updated step/template name"},subject:{type:"string",description:"Updated email subject"},previewText:{type:"string",description:"Updated preview text"},html:{type:"string",description:"Updated HTML content. Will be converted to Sequenzy blocks."},htmlContent:{type:"string",description:"Alias for html. Use this when updating HTML content for a step."},blocks:{type:"array",description:"Updated Sequenzy block JSON for the step"}}}}},required:["sequenceId"]}},{name:"enable_sequence",description:"Enable/activate a sequence. IMPORTANT: Only call this when the user EXPLICITLY asks to enable or activate a sequence. Never enable sequences automatically after creation - the user must review the content first.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"disable_sequence",description:"Disable/pause a sequence",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"delete_sequence",description:"Delete a sequence",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"send_email",description:"Send a transactional email to a single recipient",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},to:{type:"string",description:"Recipient email address"},subject:{type:"string",description:"Email subject (required if not using templateId)"},html:{type:"string",description:"Email HTML content (required if not using templateId)"},templateId:{type:"string",description:"Template ID to use (alternative to html)"},variables:{type:"object",description:"Variables for template personalization"}},required:["to"]}},{name:"get_stats",description:"Get overview statistics for a time period",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},period:{type:"string",description:"Time period: 7d, 30d, or 90d (default: 7d)"}}}},{name:"get_campaign_stats",description:"Get detailed statistics for a campaign",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},campaignId:{type:"string",description:"Campaign ID"}},required:["campaignId"]}},{name:"get_sequence_stats",description:"Get statistics for a sequence, including per-step failed subscribers and failure reasons",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},sequenceId:{type:"string",description:"Sequence ID"}},required:["sequenceId"]}},{name:"get_subscriber_activity",description:"Get recent activity, email stats, and current sequence enrollments for a subscriber",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},email:{type:"string",description:"Subscriber email address"}},required:["email"]}},{name:"generate_email",description:"Generate email HTML content from a prompt",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},prompt:{type:"string",description:"Description of the email to generate"},style:{type:"string",description:"Style: minimal, branded, promotional"},tone:{type:"string",description:"Tone: professional, casual, friendly"}},required:["prompt"]}},{name:"generate_sequence",description:"[DEPRECATED - Use create_sequence instead] Generate a multi-email sequence from a goal. Note: create_sequence now handles AI generation automatically.",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},goal:{type:"string",description:"Goal of the sequence (e.g., 'onboard new SaaS trial users')"},emailCount:{type:"number",description:"Number of emails in the sequence (default: 5)"},durationDays:{type:"number",description:"Total duration in days (default: 14)"}},required:["goal"]}},{name:"generate_subject_lines",description:"Generate A/B test subject line variants",inputSchema:{type:"object",properties:{companyId:{type:"string",description:"Company ID. If not provided, uses the currently selected company."},topic:{type:"string",description:"Topic or context for the subject lines"},count:{type:"number",description:"Number of variants to generate (default: 5)"}},required:["topic"]}}];async function e$(Q,X){try{let Y;switch(Q){case"get_account":{let G=await w("GET","/api/v1/account"),J=o4();Y={...G,selectedCompanyId:J??G.currentCompanyId};break}case"select_company":{let G=X.companyId,J=await w("GET","/api/v1/account"),$=J.companies?.find((z)=>z.id===G);if(!$)throw Error(`Company not found. Available companies: ${J.companies?.map((z)=>`${z.name} (${z.id})`).join(", ")??"none"}`);OX(G),Y={success:!0,message:`Switched to company: ${$.name}`,companyId:$.id,companyName:$.name};break}case"create_company":{let G=await w("POST","/api/v1/companies",{name:X.name,domain:X.domain});if(!G.success)throw Error("Failed to create company");let J=G.company.id,$=6,z=0,H=G.company.status;while(H==="processing"&&z<$){await new Promise((D)=>setTimeout(D,20000)),z++;let B=await w("GET",`/api/v1/companies/${J}`);if(B.success)H=B.company.status}OX(J);let K=await w("GET",`/api/v1/companies/${J}`);Y={success:!0,company:K.company,message:H==="processing"?"Company created but still processing. You can continue using it while processing completes.":`Company '${K.company.name}' created and ready to use.`,autoSelected:!0};break}case"get_company":{let G=X.companyId;Y=await w("GET",`/api/v1/companies/${G}`);break}case"create_api_key":{let G=X.companyId;Y=await w("POST","/api/v1/api-keys",{name:X.name},G);break}case"list_websites":{let G=X.companyId;Y=await w("GET","/api/v1/websites",void 0,G);break}case"add_website":{let G=X.companyId;Y=await w("POST","/api/v1/websites",{domain:X.domain},G);break}case"check_website":{let G=X.companyId;Y=await w("GET",`/api/v1/websites/${X.domain}`,void 0,G);break}case"get_integration_guide":Y=await w("POST","/api/v1/integration-guide",X);break;case"add_subscriber":{let G=X.companyId;Y=await w("POST","/api/v1/subscribers",{email:X.email,customAttributes:X.attributes,tags:X.tags,lists:X.listIds},G);break}case"update_subscriber":{let G=X.companyId,J=await LX(String(X.email),G),$=Array.isArray(J.subscriber.tags)?J.subscriber.tags.filter((D)=>typeof D==="string"):[],z=Array.isArray(X.addTags)?X.addTags.filter((D)=>typeof D==="string"&&D.trim()!=="").map(a$):[],H=new Set(Array.isArray(X.removeTags)?X.removeTags.filter((D)=>typeof D==="string"&&D.trim()!=="").map(a$):[]),K=$.filter((D)=>!H.has(D));for(let D of z)if(!K.includes(D))K.push(D);let B={};if(t$(X.attributes))B.customAttributes={...t$(J.subscriber.customAttributes)?J.subscriber.customAttributes:{},...X.attributes};if(X.addTags||X.removeTags)B.tags=K;Y=await w("PATCH",`/api/v1/subscribers/${encodeURIComponent(String(X.email))}`,B,G);break}case"remove_subscriber":{let G=X.companyId;if(X.hardDelete===!0)Y=await w("DELETE",`/api/v1/subscribers/${encodeURIComponent(String(X.email))}`,void 0,G);else Y=await w("PATCH",`/api/v1/subscribers/${encodeURIComponent(String(X.email))}`,{status:"unsubscribed"},G);break}case"get_subscriber":{let G=X.companyId;Y=await LX(String(X.email),G);break}case"search_subscribers":{let G=X.companyId;Y=await cM(X,G);break}case"list_tags":{let G=X.companyId;Y=await w("GET","/api/v1/tags",void 0,G);break}case"list_lists":{let G=X.companyId;Y=await w("GET","/api/v1/lists",void 0,G);break}case"create_list":{let G=X.companyId;Y=await w("POST","/api/v1/lists",X,G);break}case"list_segments":{let G=X.companyId;Y=await w("GET","/api/v1/segments",void 0,G);break}case"create_segment":{let G=X.companyId;Y=await w("POST","/api/v1/segments",{...X,filters:fM(X.filters)},G);break}case"get_segment_count":{let G=X.companyId;Y=await w("GET",`/api/v1/segments/${X.segmentId}/count`,void 0,G);break}case"list_templates":{let G=X.companyId;Y=await w("GET","/api/v1/templates",void 0,G);break}case"get_template":{let G=X.companyId;Y=await w("GET",`/api/v1/templates/${X.templateId}`,void 0,G);break}case"create_template":{let G=X.companyId;t4("create_template",X,{requireContent:!0}),Y=await w("POST","/api/v1/templates",X,G);break}case"update_template":{let G=X.companyId,J=new Set(["companyId","templateId","name","subject","html","blocks"]),$=Object.keys(X).filter((z)=>!J.has(z));if($.length>0)throw Error(`\`update_template\` accepts only \`name\`, \`subject\`, \`html\`, and \`blocks\` update fields. Unsupported field${$.length===1?"":"s"}: ${$.map((z)=>`\`${z}\``).join(", ")}.`);if(t4("update_template",X),X.name===void 0&&X.subject===void 0&&X.html===void 0&&X.blocks===void 0)throw Error("Provide at least one of `name`, `subject`, `html`, or `blocks` when calling `update_template`.");Y=await w("PUT",`/api/v1/templates/${X.templateId}`,X,G);break}case"delete_template":{let G=X.companyId;Y=await w("DELETE",`/api/v1/templates/${X.templateId}`,void 0,G);break}case"list_campaigns":{let G=X.companyId,J=new URLSearchParams;if(X.status)J.set("status",String(X.status));Y=await w("GET",`/api/v1/campaigns?${J}`,void 0,G);break}case"get_campaign":{let G=X.companyId;Y=await w("GET",`/api/v1/campaigns/${X.campaignId}`,void 0,G);break}case"create_campaign":{let G=X.companyId;t4("create_campaign",X),Y=await w("POST","/api/v1/campaigns",X,G);break}case"update_campaign":{let G=X.companyId,J=new Set(["companyId","campaignId","name","subject","html","blocks","replyTo","replyProfileId"]),$=Object.keys(X).filter((z)=>!J.has(z));if($.length>0)throw Error(`\`update_campaign\` accepts only \`name\`, \`subject\`, \`html\`, \`blocks\`, \`replyTo\`, and \`replyProfileId\` update fields. Unsupported field${$.length===1?"":"s"}: ${$.map((z)=>`\`${z}\``).join(", ")}.`);if(t4("update_campaign",X),X.replyTo!==void 0&&X.replyProfileId!==void 0)throw Error("Provide either `replyTo` or `replyProfileId` when calling `update_campaign`, not both.");if(X.name===void 0&&X.subject===void 0&&X.html===void 0&&X.blocks===void 0&&X.replyTo===void 0&&X.replyProfileId===void 0)throw Error("Provide at least one of `name`, `subject`, `html`, `blocks`, `replyTo`, or `replyProfileId` when calling `update_campaign`.");Y=await w("PUT",`/api/v1/campaigns/${X.campaignId}`,X,G);break}case"send_test_email":{let G=X.companyId;Y=await w("POST",`/api/v1/campaigns/${X.campaignId}/test`,{to:X.to},G);break}case"list_sequences":{let G=X.companyId;Y=await w("GET","/api/v1/sequences",void 0,G);break}case"get_sequence":{let G=X.companyId;Y=await w("GET",`/api/v1/sequences/${X.sequenceId}`,void 0,G);break}case"create_sequence":{let G=X.companyId,J=await w("POST","/api/v1/sequences",X,G);if(!J.success){Y=J;break}let $=J.sequence.id,z=6,H=0,K="pending";while(K!=="complete"&&H<z){await new Promise((U)=>setTimeout(U,20000)),H++;let D=await w("GET",`/api/v1/sequences/${$}`,void 0,G);if(D.success)K=D.sequence.enrichmentStatus}let B=await w("GET",`/api/v1/sequences/${$}`,void 0,G);if(B.success)Y={success:!0,sequence:B.sequence,message:B.sequence.enrichmentStatus==="complete"?`Sequence "${B.sequence.name}" created with ${B.sequence.emailCount} AI-generated emails. The sequence is ready to review and enable.`:`Sequence "${B.sequence.name}" created. Email enrichment is still in progress (${B.sequence.enrichedCount}/${B.sequence.emailCount} emails generated). You can check status with get_sequence.`};else Y=B;break}case"update_sequence":{let G=X.companyId;Y=await w("PUT",`/api/v1/sequences/${X.sequenceId}`,X,G);break}case"enable_sequence":{let G=X.companyId;Y=await w("POST",`/api/v1/sequences/${X.sequenceId}/enable`,void 0,G);break}case"disable_sequence":{let G=X.companyId;Y=await w("POST",`/api/v1/sequences/${X.sequenceId}/disable`,void 0,G);break}case"delete_sequence":{let G=X.companyId;Y=await w("DELETE",`/api/v1/sequences/${X.sequenceId}`,void 0,G);break}case"send_email":{let G=X.companyId;Y=await w("POST","/api/v1/transactional/send",X,G);break}case"get_stats":{let G=X.companyId,J=X.period??"7d";Y=await w("GET",`/api/v1/metrics?period=${J}`,void 0,G);break}case"get_campaign_stats":{let G=X.companyId;Y=await w("GET",`/api/v1/metrics/campaigns/${X.campaignId}`,void 0,G);break}case"get_sequence_stats":{let G=X.companyId;Y=await w("GET",`/api/v1/metrics/sequences/${X.sequenceId}`,void 0,G);break}case"get_subscriber_activity":{let G=X.companyId,J=await LX(String(X.email),G);Y={success:J.success,email:J.subscriber.email,emailStats:J.subscriber.emailStats??null,activity:J.subscriber.activity??[],sequenceEnrollments:J.subscriber.sequenceEnrollments??[]};break}case"generate_email":{let G=X.companyId;Y=await w("POST","/api/v1/generate/email",X,G);break}case"generate_sequence":{let G=X.companyId;Y=await w("POST","/api/v1/generate/sequence",X,G);break}case"generate_subject_lines":{let G=X.companyId;Y=await w("POST","/api/v1/generate/subjects",X,G);break}default:throw Error(`Unknown tool: ${Q}`)}let W=lM(Y);if(W)throw W;return{content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}catch(Y){return{isError:!0,content:[{type:"text",text:A1(Y)}]}}}var pM=process.env.SEQUENZY_API_URL??"https://api.sequenzy.com",Qz=process.env.SEQUENZY_API_KEY,MX=null;if(!Qz)console.error(A1(new k1("SEQUENZY_API_KEY environment variable is required",401,void 0,"MCP_AUTH_REQUIRED"))),process.exit(1);function o4(){return MX}function OX(Q){MX=Q}var T6=new AX({name:"sequenzy",version:d$.version},{capabilities:{tools:{},resources:{}}});function iM(Q){if(!Q.trim())return{message:"Request failed"};try{let X=JSON.parse(Q);if(typeof X==="string")return{message:X};if(typeof X.error==="string")return{message:X.error,code:X.code};if(X.error&&typeof X.error==="object")return{message:X.error.message??X.message??Q,code:X.error.code??X.code};return{message:X.message??Q,code:X.code}}catch{return{message:Q}}}async function w(Q,X,Y,W){let G={"Content-Type":"application/json",Authorization:`Bearer ${Qz}`},J=W??MX;if(J)G["x-company-id"]=J;let $;try{$=await fetch(`${pM}${X}`,{method:Q,headers:G,body:Y?JSON.stringify(Y):void 0})}catch(z){throw new k1(z instanceof Error?z.message:"Failed to reach Sequenzy API",0,void 0,"NETWORK_ERROR")}if(!$.ok){let z=await $.text(),H=iM(z);throw new k1(H.message,$.status,z,H.code)}return $.json()}T6.setRequestHandler(eQ,async()=>{return{tools:s$}});T6.setRequestHandler(Y6,async(Q)=>{let{name:X,arguments:Y}=Q.params;return e$(X,Y??{})});T6.setRequestHandler(nQ,async()=>{return{resources:r$}});T6.setRequestHandler(rQ,async(Q)=>{let{uri:X}=Q.params;return o$(X)});async function nM(){let Q=new UX;await T6.connect(Q),console.error("Sequenzy MCP server running on stdio")}nM().catch((Q)=>{console.error(A1(Q)),process.exit(1)});export{OX as setSelectedCompanyId,o4 as getSelectedCompanyId,w as apiRequest};
|