mcp-server-andru-intelligence 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -20
- package/glama.json +1 -0
- package/package.json +2 -2
- package/server.json +3 -3
- package/src/catalog.js +70 -41
- package/.mcpregistry_github_token +0 -1
- package/.mcpregistry_registry_token +0 -1
- package/.smithery/shttp/manifest.json +0 -616
- package/.smithery/shttp/module.js +0 -50
- package/.smithery/shttp/module.js.map +0 -7
- package/.smithery/shttp/scan-1771057507876.cjs +0 -20836
- package/smithery-config.json +0 -15
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var $_=Object.create;var ps=Object.defineProperty;var b_=Object.getOwnPropertyDescriptor;var x_=Object.getOwnPropertyNames;var k_=Object.getPrototypeOf,S_=Object.prototype.hasOwnProperty;var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fn=(e,t)=>{for(var r in t)ps(e,r,{get:t[r],enumerable:!0})},w_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of x_(t))!S_.call(e,i)&&i!==r&&ps(e,i,{get:()=>t[i],enumerable:!(n=b_(t,i))||n.enumerable});return e};var of=(e,t,r)=>(r=e!=null?$_(k_(e)):{},w_(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e));var Si=S(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.regexpCode=te.getEsmExportName=te.getProperty=te.safeStringify=te.stringify=te.strConcat=te.addCodeArg=te.str=te._=te.nil=te._Code=te.Name=te.IDENTIFIER=te._CodeOrName=void 0;var xi=class{};te._CodeOrName=xi;te.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var pr=class extends xi{constructor(t){if(super(),!te.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};te.Name=pr;var et=class extends xi{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof pr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};te._Code=et;te.nil=new et("");function Pg(e,...t){let r=[e[0]],n=0;for(;n<t.length;)ld(r,t[n]),r.push(e[++n]);return new et(r)}te._=Pg;var ud=new et("+");function Tg(e,...t){let r=[ki(e[0])],n=0;for(;n<t.length;)r.push(ud),ld(r,t[n]),r.push(ud,ki(e[++n]));return pS(r),new et(r)}te.str=Tg;function ld(e,t){t instanceof et?e.push(...t._items):t instanceof pr?e.push(t):e.push(hS(t))}te.addCodeArg=ld;function pS(e){let t=1;for(;t<e.length-1;){if(e[t]===ud){let r=fS(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function fS(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof pr||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof pr))return`"${e}${t.slice(1)}`}function mS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Tg`${e}${t}`}te.strConcat=mS;function hS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ki(Array.isArray(e)?e.join(","):e)}function gS(e){return new et(ki(e))}te.stringify=gS;function ki(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}te.safeStringify=ki;function vS(e){return typeof e=="string"&&te.IDENTIFIER.test(e)?new et(`.${e}`):Pg`[${e}]`}te.getProperty=vS;function yS(e){if(typeof e=="string"&&te.IDENTIFIER.test(e))return new et(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}te.getEsmExportName=yS;function _S(e){return new et(e.toString())}te.regexpCode=_S});var fd=S(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.ValueScope=Me.ValueScopeName=Me.Scope=Me.varKinds=Me.UsedValueState=void 0;var Ce=Si(),dd=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Sa;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Sa||(Me.UsedValueState=Sa={}));Me.varKinds={const:new Ce.Name("const"),let:new Ce.Name("let"),var:new Ce.Name("var")};var wa=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ce.Name?t:this.name(t)}name(t){return new Ce.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Me.Scope=wa;var za=class extends Ce.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ce._)`.${new Ce.Name(r)}[${n}]`}};Me.ValueScopeName=za;var $S=(0,Ce._)`\n`,pd=class extends wa{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?$S:Ce.nil}}get(){return this._scope}name(t){return new za(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:o}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,s=this._values[o];if(s){let l=s.get(a);if(l)return l}else s=this._values[o]=new Map;s.set(a,i);let c=this._scope[o]||(this._scope[o]=[]),u=c.length;return c[u]=r.ref,i.setValue(r,{property:o,itemIndex:u}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ce._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(t,r,n={},i){let o=Ce.nil;for(let a in t){let s=t[a];if(!s)continue;let c=n[a]=n[a]||new Map;s.forEach(u=>{if(c.has(u))return;c.set(u,Sa.Started);let l=r(u);if(l){let d=this.opts.es5?Me.varKinds.var:Me.varKinds.const;o=(0,Ce._)`${o}${d} ${u} = ${l};${this.opts._n}`}else if(l=i?.(u))o=(0,Ce._)`${o}${l}${this.opts._n}`;else throw new dd(u);c.set(u,Sa.Completed)})}return o}};Me.ValueScope=pd});var K=S(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.or=G.and=G.not=G.CodeGen=G.operators=G.varKinds=G.ValueScopeName=G.ValueScope=G.Scope=G.Name=G.regexpCode=G.stringify=G.getProperty=G.nil=G.strConcat=G.str=G._=void 0;var Q=Si(),ut=fd(),Ht=Si();Object.defineProperty(G,"_",{enumerable:!0,get:function(){return Ht._}});Object.defineProperty(G,"str",{enumerable:!0,get:function(){return Ht.str}});Object.defineProperty(G,"strConcat",{enumerable:!0,get:function(){return Ht.strConcat}});Object.defineProperty(G,"nil",{enumerable:!0,get:function(){return Ht.nil}});Object.defineProperty(G,"getProperty",{enumerable:!0,get:function(){return Ht.getProperty}});Object.defineProperty(G,"stringify",{enumerable:!0,get:function(){return Ht.stringify}});Object.defineProperty(G,"regexpCode",{enumerable:!0,get:function(){return Ht.regexpCode}});Object.defineProperty(G,"Name",{enumerable:!0,get:function(){return Ht.Name}});var ja=fd();Object.defineProperty(G,"Scope",{enumerable:!0,get:function(){return ja.Scope}});Object.defineProperty(G,"ValueScope",{enumerable:!0,get:function(){return ja.ValueScope}});Object.defineProperty(G,"ValueScopeName",{enumerable:!0,get:function(){return ja.ValueScopeName}});Object.defineProperty(G,"varKinds",{enumerable:!0,get:function(){return ja.varKinds}});G.operators={GT:new Q._Code(">"),GTE:new Q._Code(">="),LT:new Q._Code("<"),LTE:new Q._Code("<="),EQ:new Q._Code("==="),NEQ:new Q._Code("!=="),NOT:new Q._Code("!"),OR:new Q._Code("||"),AND:new Q._Code("&&"),ADD:new Q._Code("+")};var Nt=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},md=class extends Nt{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?ut.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Wr(this.rhs,t,r)),this}get names(){return this.rhs instanceof Q._CodeOrName?this.rhs.names:{}}},Ia=class extends Nt{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof Q.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Wr(this.rhs,t,r),this}get names(){let t=this.lhs instanceof Q.Name?{}:{...this.lhs.names};return Ta(t,this.rhs)}},hd=class extends Ia{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},gd=class extends Nt{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},vd=class extends Nt{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},yd=class extends Nt{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},_d=class extends Nt{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Wr(this.code,t,r),this}get names(){return this.code instanceof Q._CodeOrName?this.code.names:{}}},wi=class extends Nt{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(t,r)||(bS(t,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>hr(t,r.names),{})}},Dt=class extends wi{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},$d=class extends wi{},Hr=class extends Dt{};Hr.kind="else";var fr=class e extends Dt{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Hr(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(jg(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Wr(this.condition,t,r),this}get names(){let t=super.names;return Ta(t,this.condition),this.else&&hr(t,this.else.names),t}};fr.kind="if";var mr=class extends Dt{};mr.kind="for";var bd=class extends mr{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Wr(this.iteration,t,r),this}get names(){return hr(super.names,this.iteration.names)}},xd=class extends mr{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?ut.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(t)}get names(){let t=Ta(super.names,this.from);return Ta(t,this.to)}},Pa=class extends mr{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Wr(this.iterable,t,r),this}get names(){return hr(super.names,this.iterable.names)}},zi=class extends Dt{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};zi.kind="func";var Ii=class extends wi{render(t){return"return "+super.render(t)}};Ii.kind="return";var kd=class extends Dt{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&hr(t,this.catch.names),this.finally&&hr(t,this.finally.names),t}},Pi=class extends Dt{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Pi.kind="catch";var Ti=class extends Dt{render(t){return"finally"+super.render(t)}};Ti.kind="finally";var Sd=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
-
`:""},this._extScope=t,this._scope=new ut.Scope({parent:t}),this._nodes=[new $d]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new md(t,o,n)),o}const(t,r,n){return this._def(ut.varKinds.const,t,r,n)}let(t,r,n){return this._def(ut.varKinds.let,t,r,n)}var(t,r,n){return this._def(ut.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Ia(t,r,n))}add(t,r){return this._leafNode(new hd(t,G.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==Q.nil&&this._leafNode(new _d(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Q.addCodeArg)(r,i));return r.push("}"),new Q._Code(r)}if(t,r,n){if(this._blockNode(new fr(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new fr(t))}else(){return this._elseNode(new Hr)}endIf(){return this._endBlockNode(fr,Hr)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new bd(t),r)}forRange(t,r,n,i,o=this.opts.es5?ut.varKinds.var:ut.varKinds.let){let a=this._scope.toName(t);return this._for(new xd(o,a,r,n),()=>i(a))}forOf(t,r,n,i=ut.varKinds.const){let o=this._scope.toName(t);if(this.opts.es5){let a=r instanceof Q.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Q._)`${a}.length`,s=>{this.var(o,(0,Q._)`${a}[${s}]`),n(o)})}return this._for(new Pa("of",i,o,r),()=>n(o))}forIn(t,r,n,i=this.opts.es5?ut.varKinds.var:ut.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Q._)`Object.keys(${r})`,n);let o=this._scope.toName(t);return this._for(new Pa("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(mr)}label(t){return this._leafNode(new gd(t))}break(t){return this._leafNode(new vd(t))}return(t){let r=new Ii;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ii)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new kd;if(this._blockNode(i),this.code(t),r){let o=this.name("e");this._currNode=i.catch=new Pi(o),r(o)}return n&&(this._currNode=i.finally=new Ti,this.code(n)),this._endBlockNode(Pi,Ti)}throw(t){return this._leafNode(new yd(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=Q.nil,n,i){return this._blockNode(new zi(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(zi)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof fr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};G.CodeGen=Sd;function hr(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ta(e,t){return t instanceof Q._CodeOrName?hr(e,t.names):e}function Wr(e,t,r){if(e instanceof Q.Name)return n(e);if(!i(e))return e;return new Q._Code(e._items.reduce((o,a)=>(a instanceof Q.Name&&(a=n(a)),a instanceof Q._Code?o.push(...a._items):o.push(a),o),[]));function n(o){let a=r[o.str];return a===void 0||t[o.str]!==1?o:(delete t[o.str],a)}function i(o){return o instanceof Q._Code&&o._items.some(a=>a instanceof Q.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function bS(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function jg(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Q._)`!${wd(e)}`}G.not=jg;var xS=Og(G.operators.AND);function kS(...e){return e.reduce(xS)}G.and=kS;var SS=Og(G.operators.OR);function wS(...e){return e.reduce(SS)}G.or=wS;function Og(e){return(t,r)=>t===Q.nil?r:r===Q.nil?t:(0,Q._)`${wd(t)} ${e} ${wd(r)}`}function wd(e){return e instanceof Q.Name?e:(0,Q._)`(${e})`}});var re=S(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.checkStrictMode=W.getErrorPath=W.Type=W.useFunc=W.setEvaluated=W.evaluatedPropsToName=W.mergeEvaluated=W.eachItem=W.unescapeJsonPointer=W.escapeJsonPointer=W.escapeFragment=W.unescapeFragment=W.schemaRefOrVal=W.schemaHasRulesButRef=W.schemaHasRules=W.checkUnknownRules=W.alwaysValidSchema=W.toHash=void 0;var le=K(),zS=Si();function IS(e){let t={};for(let r of e)t[r]=!0;return t}W.toHash=IS;function PS(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Dg(e,t),!Zg(t,e.self.RULES.all))}W.alwaysValidSchema=PS;function Dg(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let o in t)i[o]||Ag(e,`unknown keyword: "${o}"`)}W.checkUnknownRules=Dg;function Zg(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}W.schemaHasRules=Zg;function TS(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}W.schemaHasRulesButRef=TS;function jS({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,le._)`${r}`}return(0,le._)`${e}${t}${(0,le.getProperty)(n)}`}W.schemaRefOrVal=jS;function OS(e){return Rg(decodeURIComponent(e))}W.unescapeFragment=OS;function ES(e){return encodeURIComponent(Id(e))}W.escapeFragment=ES;function Id(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}W.escapeJsonPointer=Id;function Rg(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}W.unescapeJsonPointer=Rg;function NS(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}W.eachItem=NS;function Eg({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,o,a,s)=>{let c=a===void 0?o:a instanceof le.Name?(o instanceof le.Name?e(i,o,a):t(i,o,a),a):o instanceof le.Name?(t(i,a,o),o):r(o,a);return s===le.Name&&!(c instanceof le.Name)?n(i,c):c}}W.mergeEvaluated={props:Eg({mergeNames:(e,t,r)=>e.if((0,le._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,le._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,le._)`${r} || {}`).code((0,le._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,le._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,le._)`${r} || {}`),Pd(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Ug}),items:Eg({mergeNames:(e,t,r)=>e.if((0,le._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,le._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,le._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,le._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Ug(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,le._)`{}`);return t!==void 0&&Pd(e,r,t),r}W.evaluatedPropsToName=Ug;function Pd(e,t,r){Object.keys(r).forEach(n=>e.assign((0,le._)`${t}${(0,le.getProperty)(n)}`,!0))}W.setEvaluated=Pd;var Ng={};function DS(e,t){return e.scopeValue("func",{ref:t,code:Ng[t.code]||(Ng[t.code]=new zS._Code(t.code))})}W.useFunc=DS;var zd;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(zd||(W.Type=zd={}));function ZS(e,t,r){if(e instanceof le.Name){let n=t===zd.Num;return r?n?(0,le._)`"[" + ${e} + "]"`:(0,le._)`"['" + ${e} + "']"`:n?(0,le._)`"/" + ${e}`:(0,le._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,le.getProperty)(e).toString():"/"+Id(e)}W.getErrorPath=ZS;function Ag(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}W.checkStrictMode=Ag});var Zt=S(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var Pe=K(),RS={data:new Pe.Name("data"),valCxt:new Pe.Name("valCxt"),instancePath:new Pe.Name("instancePath"),parentData:new Pe.Name("parentData"),parentDataProperty:new Pe.Name("parentDataProperty"),rootData:new Pe.Name("rootData"),dynamicAnchors:new Pe.Name("dynamicAnchors"),vErrors:new Pe.Name("vErrors"),errors:new Pe.Name("errors"),this:new Pe.Name("this"),self:new Pe.Name("self"),scope:new Pe.Name("scope"),json:new Pe.Name("json"),jsonPos:new Pe.Name("jsonPos"),jsonLen:new Pe.Name("jsonLen"),jsonPart:new Pe.Name("jsonPart")};Td.default=RS});var ji=S(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.extendErrors=Te.resetErrorsCount=Te.reportExtraError=Te.reportError=Te.keyword$DataError=Te.keywordError=void 0;var ee=K(),Oa=re(),Re=Zt();Te.keywordError={message:({keyword:e})=>(0,ee.str)`must pass "${e}" keyword validation`};Te.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ee.str)`"${e}" keyword must be ${t} ($data)`:(0,ee.str)`"${e}" keyword is invalid ($data)`};function US(e,t=Te.keywordError,r,n){let{it:i}=e,{gen:o,compositeRule:a,allErrors:s}=i,c=qg(e,t,r);n??(a||s)?Cg(o,c):Mg(i,(0,ee._)`[${c}]`)}Te.reportError=US;function AS(e,t=Te.keywordError,r){let{it:n}=e,{gen:i,compositeRule:o,allErrors:a}=n,s=qg(e,t,r);Cg(i,s),o||a||Mg(n,Re.default.vErrors)}Te.reportExtraError=AS;function CS(e,t){e.assign(Re.default.errors,t),e.if((0,ee._)`${Re.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ee._)`${Re.default.vErrors}.length`,t),()=>e.assign(Re.default.vErrors,null)))}Te.resetErrorsCount=CS;function MS({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",i,Re.default.errors,s=>{e.const(a,(0,ee._)`${Re.default.vErrors}[${s}]`),e.if((0,ee._)`${a}.instancePath === undefined`,()=>e.assign((0,ee._)`${a}.instancePath`,(0,ee.strConcat)(Re.default.instancePath,o.errorPath))),e.assign((0,ee._)`${a}.schemaPath`,(0,ee.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,ee._)`${a}.schema`,r),e.assign((0,ee._)`${a}.data`,n))})}Te.extendErrors=MS;function Cg(e,t){let r=e.const("err",t);e.if((0,ee._)`${Re.default.vErrors} === null`,()=>e.assign(Re.default.vErrors,(0,ee._)`[${r}]`),(0,ee._)`${Re.default.vErrors}.push(${r})`),e.code((0,ee._)`${Re.default.errors}++`)}function Mg(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,ee._)`new ${e.ValidationError}(${t})`):(r.assign((0,ee._)`${n}.errors`,t),r.return(!1))}var gr={keyword:new ee.Name("keyword"),schemaPath:new ee.Name("schemaPath"),params:new ee.Name("params"),propertyName:new ee.Name("propertyName"),message:new ee.Name("message"),schema:new ee.Name("schema"),parentSchema:new ee.Name("parentSchema")};function qg(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ee._)`{}`:qS(e,t,r)}function qS(e,t,r={}){let{gen:n,it:i}=e,o=[LS(i,r),VS(e,r)];return FS(e,t,o),n.object(...o)}function LS({errorPath:e},{instancePath:t}){let r=t?(0,ee.str)`${e}${(0,Oa.getErrorPath)(t,Oa.Type.Str)}`:e;return[Re.default.instancePath,(0,ee.strConcat)(Re.default.instancePath,r)]}function VS({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,ee.str)`${t}/${e}`;return r&&(i=(0,ee.str)`${i}${(0,Oa.getErrorPath)(r,Oa.Type.Str)}`),[gr.schemaPath,i]}function FS(e,{params:t,message:r},n){let{keyword:i,data:o,schemaValue:a,it:s}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=s;n.push([gr.keyword,i],[gr.params,typeof t=="function"?t(e):t||(0,ee._)`{}`]),c.messages&&n.push([gr.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([gr.schema,a],[gr.parentSchema,(0,ee._)`${l}${d}`],[Re.default.data,o]),u&&n.push([gr.propertyName,u])}});var Vg=S(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.boolOrEmptySchema=Xr.topBoolOrEmptySchema=void 0;var JS=ji(),KS=K(),BS=Zt(),GS={message:"boolean schema is false"};function HS(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Lg(e,!1):typeof r=="object"&&r.$async===!0?t.return(BS.default.data):(t.assign((0,KS._)`${n}.errors`,null),t.return(!0))}Xr.topBoolOrEmptySchema=HS;function WS(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Lg(e)):r.var(t,!0)}Xr.boolOrEmptySchema=WS;function Lg(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,JS.reportError)(i,GS,void 0,t)}});var jd=S(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.getRules=Yr.isJSONType=void 0;var XS=["string","number","integer","boolean","null","object","array"],YS=new Set(XS);function QS(e){return typeof e=="string"&&YS.has(e)}Yr.isJSONType=QS;function ew(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Yr.getRules=ew});var Od=S(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.shouldUseRule=Wt.shouldUseGroup=Wt.schemaHasRulesForType=void 0;function tw({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Fg(e,n)}Wt.schemaHasRulesForType=tw;function Fg(e,t){return t.rules.some(r=>Jg(e,r))}Wt.shouldUseGroup=Fg;function Jg(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Wt.shouldUseRule=Jg});var Oi=S(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.reportTypeError=je.checkDataTypes=je.checkDataType=je.coerceAndCheckDataType=je.getJSONTypes=je.getSchemaTypes=je.DataType=void 0;var rw=jd(),nw=Od(),iw=ji(),J=K(),Kg=re(),Qr;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Qr||(je.DataType=Qr={}));function ow(e){let t=Bg(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}je.getSchemaTypes=ow;function Bg(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(rw.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}je.getJSONTypes=Bg;function aw(e,t){let{gen:r,data:n,opts:i}=e,o=sw(t,i.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,nw.schemaHasRulesForType)(e,t[0]));if(a){let s=Nd(t,n,i.strictNumbers,Qr.Wrong);r.if(s,()=>{o.length?cw(e,t,o):Dd(e)})}return a}je.coerceAndCheckDataType=aw;var Gg=new Set(["string","number","integer","boolean","null"]);function sw(e,t){return t?e.filter(r=>Gg.has(r)||t==="array"&&r==="array"):[]}function cw(e,t,r){let{gen:n,data:i,opts:o}=e,a=n.let("dataType",(0,J._)`typeof ${i}`),s=n.let("coerced",(0,J._)`undefined`);o.coerceTypes==="array"&&n.if((0,J._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,J._)`${i}[0]`).assign(a,(0,J._)`typeof ${i}`).if(Nd(t,i,o.strictNumbers),()=>n.assign(s,i))),n.if((0,J._)`${s} !== undefined`);for(let u of r)(Gg.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);n.else(),Dd(e),n.endIf(),n.if((0,J._)`${s} !== undefined`,()=>{n.assign(i,s),uw(e,s)});function c(u){switch(u){case"string":n.elseIf((0,J._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,J._)`"" + ${i}`).elseIf((0,J._)`${i} === null`).assign(s,(0,J._)`""`);return;case"number":n.elseIf((0,J._)`${a} == "boolean" || ${i} === null
|
|
4
|
-
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(s,(0,J._)`+${i}`);return;case"integer":n.elseIf((0,J._)`${a} === "boolean" || ${i} === null
|
|
5
|
-
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(s,(0,J._)`+${i}`);return;case"boolean":n.elseIf((0,J._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(s,!1).elseIf((0,J._)`${i} === "true" || ${i} === 1`).assign(s,!0);return;case"null":n.elseIf((0,J._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(s,null);return;case"array":n.elseIf((0,J._)`${a} === "string" || ${a} === "number"
|
|
6
|
-
|| ${a} === "boolean" || ${i} === null`).assign(s,(0,J._)`[${i}]`)}}}function uw({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,J._)`${t} !== undefined`,()=>e.assign((0,J._)`${t}[${r}]`,n))}function Ed(e,t,r,n=Qr.Correct){let i=n===Qr.Correct?J.operators.EQ:J.operators.NEQ,o;switch(e){case"null":return(0,J._)`${t} ${i} null`;case"array":o=(0,J._)`Array.isArray(${t})`;break;case"object":o=(0,J._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,J._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,J._)`typeof ${t} ${i} ${e}`}return n===Qr.Correct?o:(0,J.not)(o);function a(s=J.nil){return(0,J.and)((0,J._)`typeof ${t} == "number"`,s,r?(0,J._)`isFinite(${t})`:J.nil)}}je.checkDataType=Ed;function Nd(e,t,r,n){if(e.length===1)return Ed(e[0],t,r,n);let i,o=(0,Kg.toHash)(e);if(o.array&&o.object){let a=(0,J._)`typeof ${t} != "object"`;i=o.null?a:(0,J._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else i=J.nil;o.number&&delete o.integer;for(let a in o)i=(0,J.and)(i,Ed(a,t,r,n));return i}je.checkDataTypes=Nd;var lw={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,J._)`{type: ${e}}`:(0,J._)`{type: ${t}}`};function Dd(e){let t=dw(e);(0,iw.reportError)(t,lw)}je.reportTypeError=Dd;function dw(e){let{gen:t,data:r,schema:n}=e,i=(0,Kg.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var Wg=S(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.assignDefaults=void 0;var en=K(),pw=re();function fw(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)Hg(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,o)=>Hg(e,o,i.default))}Ea.assignDefaults=fw;function Hg(e,t,r){let{gen:n,compositeRule:i,data:o,opts:a}=e;if(r===void 0)return;let s=(0,en._)`${o}${(0,en.getProperty)(t)}`;if(i){(0,pw.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,en._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,en._)`${c} || ${s} === null || ${s} === ""`),n.if(c,(0,en._)`${s} = ${(0,en.stringify)(r)}`)}});var tt=S(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.validateUnion=ae.validateArray=ae.usePattern=ae.callValidateCode=ae.schemaProperties=ae.allSchemaProperties=ae.noPropertyInData=ae.propertyInData=ae.isOwnProperty=ae.hasPropFunc=ae.reportMissingProp=ae.checkMissingProp=ae.checkReportMissingProp=void 0;var me=K(),Zd=re(),Xt=Zt(),mw=re();function hw(e,t){let{gen:r,data:n,it:i}=e;r.if(Ud(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,me._)`${t}`},!0),e.error()})}ae.checkReportMissingProp=hw;function gw({gen:e,data:t,it:{opts:r}},n,i){return(0,me.or)(...n.map(o=>(0,me.and)(Ud(e,t,o,r.ownProperties),(0,me._)`${i} = ${o}`)))}ae.checkMissingProp=gw;function vw(e,t){e.setParams({missingProperty:t},!0),e.error()}ae.reportMissingProp=vw;function Xg(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,me._)`Object.prototype.hasOwnProperty`})}ae.hasPropFunc=Xg;function Rd(e,t,r){return(0,me._)`${Xg(e)}.call(${t}, ${r})`}ae.isOwnProperty=Rd;function yw(e,t,r,n){let i=(0,me._)`${t}${(0,me.getProperty)(r)} !== undefined`;return n?(0,me._)`${i} && ${Rd(e,t,r)}`:i}ae.propertyInData=yw;function Ud(e,t,r,n){let i=(0,me._)`${t}${(0,me.getProperty)(r)} === undefined`;return n?(0,me.or)(i,(0,me.not)(Rd(e,t,r))):i}ae.noPropertyInData=Ud;function Yg(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ae.allSchemaProperties=Yg;function _w(e,t){return Yg(t).filter(r=>!(0,Zd.alwaysValidSchema)(e,t[r]))}ae.schemaProperties=_w;function $w({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){let l=u?(0,me._)`${e}, ${t}, ${n}${i}`:t,d=[[Xt.default.instancePath,(0,me.strConcat)(Xt.default.instancePath,o)],[Xt.default.parentData,a.parentData],[Xt.default.parentDataProperty,a.parentDataProperty],[Xt.default.rootData,Xt.default.rootData]];a.opts.dynamicRef&&d.push([Xt.default.dynamicAnchors,Xt.default.dynamicAnchors]);let m=(0,me._)`${l}, ${r.object(...d)}`;return c!==me.nil?(0,me._)`${s}.call(${c}, ${m})`:(0,me._)`${s}(${m})`}ae.callValidateCode=$w;var bw=(0,me._)`new RegExp`;function xw({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,me._)`${i.code==="new RegExp"?bw:(0,mw.useFunc)(e,i)}(${r}, ${n})`})}ae.usePattern=xw;function kw(e){let{gen:t,data:r,keyword:n,it:i}=e,o=t.name("valid");if(i.allErrors){let s=t.let("valid",!0);return a(()=>t.assign(s,!1)),s}return t.var(o,!0),a(()=>t.break()),o;function a(s){let c=t.const("len",(0,me._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Zd.Type.Num},o),t.if((0,me.not)(o),s)})}}ae.validateArray=kw;function Sw(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Zd.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},s);t.assign(a,(0,me._)`${a} || ${s}`),e.mergeValidEvaluated(l,s)||t.if((0,me.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}ae.validateUnion=Sw});var tv=S(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.validateKeywordUsage=vt.validSchemaType=vt.funcKeywordCode=vt.macroKeywordCode=void 0;var Ue=K(),vr=Zt(),ww=tt(),zw=ji();function Iw(e,t){let{gen:r,keyword:n,schema:i,parentSchema:o,it:a}=e,s=t.macro.call(a.self,i,o,a),c=ev(r,n,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let u=r.name("valid");e.subschema({schema:s,schemaPath:Ue.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}vt.macroKeywordCode=Iw;function Pw(e,t){var r;let{gen:n,keyword:i,schema:o,parentSchema:a,$data:s,it:c}=e;jw(c,t);let u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=ev(n,i,u),d=n.let("valid");e.block$data(d,m),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function m(){if(t.errors===!1)v(),t.modifying&&Qg(e),$(()=>e.error());else{let k=t.async?f():g();t.modifying&&Qg(e),$(()=>Tw(e,k))}}function f(){let k=n.let("ruleErrs",null);return n.try(()=>v((0,Ue._)`await `),E=>n.assign(d,!1).if((0,Ue._)`${E} instanceof ${c.ValidationError}`,()=>n.assign(k,(0,Ue._)`${E}.errors`),()=>n.throw(E))),k}function g(){let k=(0,Ue._)`${l}.errors`;return n.assign(k,null),v(Ue.nil),k}function v(k=t.async?(0,Ue._)`await `:Ue.nil){let E=c.opts.passContext?vr.default.this:vr.default.self,P=!("compile"in t&&!s||t.schema===!1);n.assign(d,(0,Ue._)`${k}${(0,ww.callValidateCode)(e,l,E,P)}`,t.modifying)}function $(k){var E;n.if((0,Ue.not)((E=t.valid)!==null&&E!==void 0?E:d),k)}}vt.funcKeywordCode=Pw;function Qg(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Ue._)`${n.parentData}[${n.parentDataProperty}]`))}function Tw(e,t){let{gen:r}=e;r.if((0,Ue._)`Array.isArray(${t})`,()=>{r.assign(vr.default.vErrors,(0,Ue._)`${vr.default.vErrors} === null ? ${t} : ${vr.default.vErrors}.concat(${t})`).assign(vr.default.errors,(0,Ue._)`${vr.default.vErrors}.length`),(0,zw.extendErrors)(e)},()=>e.error())}function jw({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function ev(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Ue.stringify)(r)})}function Ow(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}vt.validSchemaType=Ow;function Ew({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}vt.validateKeywordUsage=Ew});var nv=S(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.extendSubschemaMode=Yt.extendSubschemaData=Yt.getSubschema=void 0;var yt=K(),rv=re();function Nw(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return r===void 0?{schema:s,schemaPath:(0,yt._)`${e.schemaPath}${(0,yt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:(0,yt._)`${e.schemaPath}${(0,yt.getProperty)(t)}${(0,yt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,rv.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Yt.getSubschema=Nw;function Dw(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,m=s.let("data",(0,yt._)`${t.data}${(0,yt.getProperty)(r)}`,!0);c(m),e.errorPath=(0,yt.str)`${u}${(0,rv.getErrorPath)(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=(0,yt._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(i!==void 0){let u=i instanceof yt.Name?i:s.let("data",i,!0);c(u),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Yt.extendSubschemaData=Dw;function Zw(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}Yt.extendSubschemaMode=Zw});var Ad=S((MR,iv)=>{"use strict";iv.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var av=S((qR,ov)=>{"use strict";var Qt=ov.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Na(t,n,i,e,"",e)};Qt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Qt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Qt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Qt.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 Na(e,t,r,n,i,o,a,s,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,o,a,s,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in Qt.arrayKeywords)for(var m=0;m<d.length;m++)Na(e,t,r,d[m],i+"/"+l+"/"+m,o,i,l,n,m)}else if(l in Qt.propsKeywords){if(d&&typeof d=="object")for(var f in d)Na(e,t,r,d[f],i+"/"+l+"/"+Rw(f),o,i,l,n,f)}else(l in Qt.keywords||e.allKeys&&!(l in Qt.skipKeywords))&&Na(e,t,r,d,i+"/"+l,o,i,l,n)}r(n,i,o,a,s,c,u)}}function Rw(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ei=S(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.getSchemaRefs=qe.resolveUrl=qe.normalizeId=qe._getFullPath=qe.getFullPath=qe.inlineRef=void 0;var Uw=re(),Aw=Ad(),Cw=av(),Mw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function qw(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Cd(e):t?sv(e)<=t:!1}qe.inlineRef=qw;var Lw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Cd(e){for(let t in e){if(Lw.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Cd)||typeof r=="object"&&Cd(r))return!0}return!1}function sv(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Mw.has(r)&&(typeof e[r]=="object"&&(0,Uw.eachItem)(e[r],n=>t+=sv(n)),t===1/0))return 1/0}return t}function cv(e,t="",r){r!==!1&&(t=tn(t));let n=e.parse(t);return uv(e,n)}qe.getFullPath=cv;function uv(e,t){return e.serialize(t).split("#")[0]+"#"}qe._getFullPath=uv;var Vw=/#\/?$/;function tn(e){return e?e.replace(Vw,""):""}qe.normalizeId=tn;function Fw(e,t,r){return r=tn(r),e.resolve(t,r)}qe.resolveUrl=Fw;var Jw=/^[a-z_][-a-z0-9._]*$/i;function Kw(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=tn(e[r]||t),o={"":i},a=cv(n,i,!1),s={},c=new Set;return Cw(e,{allKeys:!0},(d,m,f,g)=>{if(g===void 0)return;let v=a+m,$=o[g];typeof d[r]=="string"&&($=k.call(this,d[r])),E.call(this,d.$anchor),E.call(this,d.$dynamicAnchor),o[m]=$;function k(P){let A=this.opts.uriResolver.resolve;if(P=tn($?A($,P):P),c.has(P))throw l(P);c.add(P);let O=this.refs[P];return typeof O=="string"&&(O=this.refs[O]),typeof O=="object"?u(d,O.schema,P):P!==tn(v)&&(P[0]==="#"?(u(d,s[P],P),s[P]=d):this.refs[P]=v),P}function E(P){if(typeof P=="string"){if(!Jw.test(P))throw new Error(`invalid anchor "${P}"`);k.call(this,`#${P}`)}}}),s;function u(d,m,f){if(m!==void 0&&!Aw(d,m))throw l(f)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}qe.getSchemaRefs=Kw});var Zi=S(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.getData=er.KeywordCxt=er.validateFunctionCode=void 0;var mv=Vg(),lv=Oi(),qd=Od(),Da=Oi(),Bw=Wg(),Di=tv(),Md=nv(),j=K(),C=Zt(),Gw=Ei(),Rt=re(),Ni=ji();function Hw(e){if(vv(e)&&(yv(e),gv(e))){Yw(e);return}hv(e,()=>(0,mv.topBoolOrEmptySchema)(e))}er.validateFunctionCode=Hw;function hv({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,(0,j._)`${C.default.data}, ${C.default.valCxt}`,n.$async,()=>{e.code((0,j._)`"use strict"; ${dv(r,i)}`),Xw(e,i),e.code(o)}):e.func(t,(0,j._)`${C.default.data}, ${Ww(i)}`,n.$async,()=>e.code(dv(r,i)).code(o))}function Ww(e){return(0,j._)`{${C.default.instancePath}="", ${C.default.parentData}, ${C.default.parentDataProperty}, ${C.default.rootData}=${C.default.data}${e.dynamicRef?(0,j._)`, ${C.default.dynamicAnchors}={}`:j.nil}}={}`}function Xw(e,t){e.if(C.default.valCxt,()=>{e.var(C.default.instancePath,(0,j._)`${C.default.valCxt}.${C.default.instancePath}`),e.var(C.default.parentData,(0,j._)`${C.default.valCxt}.${C.default.parentData}`),e.var(C.default.parentDataProperty,(0,j._)`${C.default.valCxt}.${C.default.parentDataProperty}`),e.var(C.default.rootData,(0,j._)`${C.default.valCxt}.${C.default.rootData}`),t.dynamicRef&&e.var(C.default.dynamicAnchors,(0,j._)`${C.default.valCxt}.${C.default.dynamicAnchors}`)},()=>{e.var(C.default.instancePath,(0,j._)`""`),e.var(C.default.parentData,(0,j._)`undefined`),e.var(C.default.parentDataProperty,(0,j._)`undefined`),e.var(C.default.rootData,C.default.data),t.dynamicRef&&e.var(C.default.dynamicAnchors,(0,j._)`{}`)})}function Yw(e){let{schema:t,opts:r,gen:n}=e;hv(e,()=>{r.$comment&&t.$comment&&$v(e),nz(e),n.let(C.default.vErrors,null),n.let(C.default.errors,0),r.unevaluated&&Qw(e),_v(e),az(e)})}function Qw(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,j._)`${r}.evaluated`),t.if((0,j._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,j._)`${e.evaluated}.props`,(0,j._)`undefined`)),t.if((0,j._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,j._)`${e.evaluated}.items`,(0,j._)`undefined`))}function dv(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,j._)`/*# sourceURL=${r} */`:j.nil}function ez(e,t){if(vv(e)&&(yv(e),gv(e))){tz(e,t);return}(0,mv.boolOrEmptySchema)(e,t)}function gv({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function vv(e){return typeof e.schema!="boolean"}function tz(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&$v(e),iz(e),oz(e);let o=n.const("_errs",C.default.errors);_v(e,o),n.var(t,(0,j._)`${o} === ${C.default.errors}`)}function yv(e){(0,Rt.checkUnknownRules)(e),rz(e)}function _v(e,t){if(e.opts.jtd)return pv(e,[],!1,t);let r=(0,lv.getSchemaTypes)(e.schema),n=(0,lv.coerceAndCheckDataType)(e,r);pv(e,r,!n,t)}function rz(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Rt.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function nz(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Rt.checkStrictMode)(e,"default is ignored in the schema root")}function iz(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Gw.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function oz(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function $v({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)e.code((0,j._)`${C.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let a=(0,j.str)`${n}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,j._)`${C.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function az(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if((0,j._)`${C.default.errors} === 0`,()=>t.return(C.default.data),()=>t.throw((0,j._)`new ${i}(${C.default.vErrors})`)):(t.assign((0,j._)`${n}.errors`,C.default.vErrors),o.unevaluated&&sz(e),t.return((0,j._)`${C.default.errors} === 0`))}function sz({gen:e,evaluated:t,props:r,items:n}){r instanceof j.Name&&e.assign((0,j._)`${t}.props`,r),n instanceof j.Name&&e.assign((0,j._)`${t}.items`,n)}function pv(e,t,r,n){let{gen:i,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Rt.schemaHasRulesButRef)(o,l))){i.block(()=>xv(e,"$ref",l.all.$ref.definition));return}c.jtd||cz(e,t),i.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){(0,qd.shouldUseGroup)(o,m)&&(m.type?(i.if((0,Da.checkDataType)(m.type,a,c.strictNumbers)),fv(e,m),t.length===1&&t[0]===m.type&&r&&(i.else(),(0,Da.reportTypeError)(e)),i.endIf()):fv(e,m),s||i.if((0,j._)`${C.default.errors} === ${n||0}`))}}function fv(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Bw.assignDefaults)(e,t.type),r.block(()=>{for(let o of t.rules)(0,qd.shouldUseRule)(n,o)&&xv(e,o.keyword,o.definition,t.type)})}function cz(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(uz(e,t),e.opts.allowUnionTypes||lz(e,t),dz(e,e.dataTypes))}function uz(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{bv(e.dataTypes,r)||Ld(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),fz(e,t)}}function lz(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Ld(e,"use allowUnionTypes to allow union type keyword")}function dz(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,qd.shouldUseRule)(e.schema,i)){let{type:o}=i.definition;o.length&&!o.some(a=>pz(t,a))&&Ld(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function pz(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function bv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function fz(e,t){let r=[];for(let n of e.dataTypes)bv(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Ld(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Rt.checkStrictMode)(e,t,e.opts.strictTypes)}var Za=class{constructor(t,r,n){if((0,Di.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Rt.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",kv(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Di.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",C.default.errors))}result(t,r,n){this.failResult((0,j.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,j.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,j._)`${r} !== undefined && (${(0,j.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ni.reportExtraError:Ni.reportError)(this,this.def.error,r)}$dataError(){(0,Ni.reportError)(this,this.def.$dataError||Ni.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ni.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=j.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=j.nil,r=j.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:a}=this;n.if((0,j.or)((0,j._)`${i} === undefined`,r)),t!==j.nil&&n.assign(t,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==j.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,j.or)(a(),s());function a(){if(n.length){if(!(r instanceof j.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,j._)`${(0,Da.checkDataTypes)(c,r,o.opts.strictNumbers,Da.DataType.Wrong)}`}return j.nil}function s(){if(i.validateSchema){let c=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,j._)`!${c}(${r})`}return j.nil}}subschema(t,r){let n=(0,Md.getSubschema)(this.it,t);(0,Md.extendSubschemaData)(n,this.it,t),(0,Md.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return ez(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Rt.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Rt.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,j.Name)),!0}};er.KeywordCxt=Za;function xv(e,t,r,n){let i=new Za(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Di.funcKeywordCode)(i,r):"macro"in r?(0,Di.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Di.funcKeywordCode)(i,r)}var mz=/^\/(?:[^~]|~0|~1)*$/,hz=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function kv(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(e==="")return C.default.rootData;if(e[0]==="/"){if(!mz.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=C.default.rootData}else{let u=hz.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(i=u[2],i==="#"){if(l>=t)throw new Error(c("property/index",l));return n[t-l]}if(l>t)throw new Error(c("data",l));if(o=r[t-l],!i)return o}let a=o,s=i.split("/");for(let u of s)u&&(o=(0,j._)`${o}${(0,j.getProperty)((0,Rt.unescapeJsonPointer)(u))}`,a=(0,j._)`${a} && ${o}`);return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}er.getData=kv});var Ra=S(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var Vd=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Fd.default=Vd});var Ri=S(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var Jd=Ei(),Kd=class extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Jd.resolveUrl)(t,r,n),this.missingSchema=(0,Jd.normalizeId)((0,Jd.getFullPath)(t,this.missingRef))}};Bd.default=Kd});var Aa=S(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.resolveSchema=rt.getCompilingSchema=rt.resolveRef=rt.compileSchema=rt.SchemaEnv=void 0;var lt=K(),gz=Ra(),yr=Zt(),dt=Ei(),Sv=re(),vz=Zi(),rn=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,dt.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};rt.SchemaEnv=rn;function Hd(e){let t=wv.call(this,e);if(t)return t;let r=(0,dt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new lt.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:gz.default,code:(0,lt._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:yr.default.data,parentData:yr.default.parentData,parentDataProperty:yr.default.parentDataProperty,dataNames:[yr.default.data],dataPathArr:[lt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,lt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:lt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,lt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,vz.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let d=a.toString();l=`${a.scopeRefs(yr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let f=new Function(`${yr.default.self}`,`${yr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:g,items:v}=u;f.evaluated={props:g instanceof lt.Name?void 0:g,items:v instanceof lt.Name?void 0:v,dynamicProps:g instanceof lt.Name,dynamicItems:v instanceof lt.Name},f.source&&(f.source.evaluated=(0,lt.stringify)(f.evaluated))}return e.validate=f,e}catch(d){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(e)}}rt.compileSchema=Hd;function yz(e,t,r){var n;r=(0,dt.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let o=bz.call(this,e,r);if(o===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:s}=this.opts;a&&(o=new rn({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=_z.call(this,o)}rt.resolveRef=yz;function _z(e){return(0,dt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Hd.call(this,e)}function wv(e){for(let t of this._compilations)if($z(t,e))return t}rt.getCompilingSchema=wv;function $z(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function bz(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Ua.call(this,e,t)}function Ua(e,t){let r=this.opts.uriResolver.parse(t),n=(0,dt._getFullPath)(this.opts.uriResolver,r),i=(0,dt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Gd.call(this,r,e);let o=(0,dt.normalizeId)(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let s=Ua.call(this,e,a);return typeof s?.schema!="object"?void 0:Gd.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||Hd.call(this,a),o===(0,dt.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(i=(0,dt.resolveUrl)(this.opts.uriResolver,i,u)),new rn({schema:s,schemaId:c,root:e,baseId:i})}return Gd.call(this,r,a)}}rt.resolveSchema=Ua;var xz=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Gd(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Sv.unescapeFragment)(s)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!xz.has(s)&&u&&(t=(0,dt.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,Sv.schemaHasRulesButRef)(r,this.RULES)){let s=(0,dt.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Ua.call(this,n,s)}let{schemaId:a}=this.opts;if(o=o||new rn({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o}});var zv=S((BR,kz)=>{kz.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 Xd=S((GR,jv)=>{"use strict";var Sz=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Pv=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 Wd(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var wz=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Iv(e){return e.length=0,!0}function zz(e,t,r){if(e.length){let n=Wd(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function Iz(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,a=!1,s=zz;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!s(i,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(o=!0),n.push(":");continue}else if(u==="%"){if(!s(i,n,r))break;s=Iv}else{i.push(u);continue}}return i.length&&(s===Iv?r.zone=i.join(""):a?n.push(i.join("")):n.push(Wd(i))),r.address=n.join(""),r}function Tv(e){if(Pz(e,":")<2)return{host:e,isIPV6:!1};let t=Iz(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function Pz(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function Tz(e){let t=e,r=[],n=-1,i=0;for(;i=t.length;){if(i===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(i===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(i===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function jz(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function Oz(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!Pv(r)){let n=Tv(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}jv.exports={nonSimpleDomain:wz,recomposeAuthority:Oz,normalizeComponentEncoding:jz,removeDotSegments:Tz,isIPv4:Pv,isUUID:Sz,normalizeIPv6:Tv,stringArrayToHexStripped:Wd}});var Zv=S((HR,Dv)=>{"use strict";var{isUUID:Ez}=Xd(),Nz=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Dz=["http","https","ws","wss","urn","urn:uuid"];function Zz(e){return Dz.indexOf(e)!==-1}function Yd(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Ov(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Ev(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function Rz(e){return e.secure=Yd(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Uz(e){if((e.port===(Yd(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function Az(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Nz);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,o=Qd(i);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function Cz(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,o=Qd(i);o&&(e=o.serialize(e,t));let a=e,s=e.nss;return a.path=`${n||t.nid}:${s}`,t.skipEscape=!0,a}function Mz(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Ez(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function qz(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Nv={scheme:"http",domainHost:!0,parse:Ov,serialize:Ev},Lz={scheme:"https",domainHost:Nv.domainHost,parse:Ov,serialize:Ev},Ca={scheme:"ws",domainHost:!0,parse:Rz,serialize:Uz},Vz={scheme:"wss",domainHost:Ca.domainHost,parse:Ca.parse,serialize:Ca.serialize},Fz={scheme:"urn",parse:Az,serialize:Cz,skipNormalize:!0},Jz={scheme:"urn:uuid",parse:Mz,serialize:qz,skipNormalize:!0},Ma={http:Nv,https:Lz,ws:Ca,wss:Vz,urn:Fz,"urn:uuid":Jz};Object.setPrototypeOf(Ma,null);function Qd(e){return e&&(Ma[e]||Ma[e.toLowerCase()])||void 0}Dv.exports={wsIsSecure:Yd,SCHEMES:Ma,isValidSchemeName:Zz,getSchemeHandler:Qd}});var Av=S((WR,La)=>{"use strict";var{normalizeIPv6:Kz,removeDotSegments:Ui,recomposeAuthority:Bz,normalizeComponentEncoding:qa,isIPv4:Gz,nonSimpleDomain:Hz}=Xd(),{SCHEMES:Wz,getSchemeHandler:Rv}=Zv();function Xz(e,t){return typeof e=="string"?e=_t(Ut(e,t),t):typeof e=="object"&&(e=Ut(_t(e,t),t)),e}function Yz(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Uv(Ut(e,n),Ut(t,n),n,!0);return n.skipEscape=!0,_t(i,n)}function Uv(e,t,r,n){let i={};return n||(e=Ut(_t(e,r),r),t=Ut(_t(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Ui(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Ui(t.path||""),i.query=t.query):(t.path?(t.path[0]==="/"?i.path=Ui(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Ui(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function Qz(e,t,r){return typeof e=="string"?(e=unescape(e),e=_t(qa(Ut(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=_t(qa(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=_t(qa(Ut(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=_t(qa(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function _t(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],o=Rv(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=Bz(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let s=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(s=Ui(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),i.push(s)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var e0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Ut(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let o=e.match(e0);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host)if(Gz(n.host)===!1){let c=Kz(n.host);n.host=c.host.toLowerCase(),i=c.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=Rv(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&Hz(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(s){n.error=n.error||"Host's domain name can not be converted to ASCII: "+s}(!a||a&&!a.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var ep={SCHEMES:Wz,normalize:Xz,resolve:Yz,resolveComponent:Uv,equal:Qz,serialize:_t,parse:Ut};La.exports=ep;La.exports.default=ep;La.exports.fastUri=ep});var Mv=S(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var Cv=Av();Cv.code='require("ajv/dist/runtime/uri").default';tp.default=Cv});var Gv=S(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.CodeGen=ke.Name=ke.nil=ke.stringify=ke.str=ke._=ke.KeywordCxt=void 0;var t0=Zi();Object.defineProperty(ke,"KeywordCxt",{enumerable:!0,get:function(){return t0.KeywordCxt}});var nn=K();Object.defineProperty(ke,"_",{enumerable:!0,get:function(){return nn._}});Object.defineProperty(ke,"str",{enumerable:!0,get:function(){return nn.str}});Object.defineProperty(ke,"stringify",{enumerable:!0,get:function(){return nn.stringify}});Object.defineProperty(ke,"nil",{enumerable:!0,get:function(){return nn.nil}});Object.defineProperty(ke,"Name",{enumerable:!0,get:function(){return nn.Name}});Object.defineProperty(ke,"CodeGen",{enumerable:!0,get:function(){return nn.CodeGen}});var r0=Ra(),Jv=Ri(),n0=jd(),Ai=Aa(),i0=K(),Ci=Ei(),Va=Oi(),np=re(),qv=zv(),o0=Mv(),Kv=(e,t)=>new RegExp(e,t);Kv.code="new RegExp";var a0=["removeAdditional","useDefaults","coerceTypes"],s0=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),c0={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."},u0={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Lv=200;function l0(e){var t,r,n,i,o,a,s,c,u,l,d,m,f,g,v,$,k,E,P,A,O,it,ot,us,ls;let pn=e.strict,ds=(t=e.code)===null||t===void 0?void 0:t.optimize,rf=ds===!0||ds===void 0?1:ds||0,nf=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Kv,__=(i=e.uriResolver)!==null&&i!==void 0?i:o0.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:pn)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:pn)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:pn)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=e.strictTuples)!==null&&d!==void 0?d:pn)!==null&&m!==void 0?m:"log",strictRequired:(g=(f=e.strictRequired)!==null&&f!==void 0?f:pn)!==null&&g!==void 0?g:!1,code:e.code?{...e.code,optimize:rf,regExp:nf}:{optimize:rf,regExp:nf},loopRequired:(v=e.loopRequired)!==null&&v!==void 0?v:Lv,loopEnum:($=e.loopEnum)!==null&&$!==void 0?$:Lv,meta:(k=e.meta)!==null&&k!==void 0?k:!0,messages:(E=e.messages)!==null&&E!==void 0?E:!0,inlineRefs:(P=e.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(A=e.schemaId)!==null&&A!==void 0?A:"$id",addUsedSchema:(O=e.addUsedSchema)!==null&&O!==void 0?O:!0,validateSchema:(it=e.validateSchema)!==null&&it!==void 0?it:!0,validateFormats:(ot=e.validateFormats)!==null&&ot!==void 0?ot:!0,unicodeRegExp:(us=e.unicodeRegExp)!==null&&us!==void 0?us:!0,int32range:(ls=e.int32range)!==null&&ls!==void 0?ls:!0,uriResolver:__}}var Mi=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...l0(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new i0.ValueScope({scope:{},prefixes:s0,es5:r,lines:n}),this.logger=g0(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,n0.getRules)(),Vv.call(this,c0,t,"NOT SUPPORTED"),Vv.call(this,u0,t,"DEPRECATED","warn"),this._metaOpts=m0.call(this),t.formats&&p0.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&f0.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),d0.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=qv;n==="id"&&(i={...qv},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(l,d){await o.call(this,l.$schema);let m=this._addSchema(l,d);return m.validate||a.call(this,m)}async function o(l){l&&!this.getSchema(l)&&await i.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Jv.default))throw d;return s.call(this,d),await c.call(this,d.missingSchema),a.call(this,l)}}function s({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await o.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,i);return this}let o;if(typeof t=="object"){let{schemaId:a}=this.opts;if(o=t[a],o!==void 0&&typeof o!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Ci.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(t){let r;for(;typeof(r=Fv.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Ai.SchemaEnv({schema:{},schemaId:n});if(r=Ai.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Fv.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Ci.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(y0.call(this,n,r),!r)return(0,np.eachItem)(n,o=>rp.call(this,o)),this;$0.call(this,r);let i={...r,type:(0,Va.getJSONTypes)(r.type),schemaType:(0,Va.getJSONTypes)(r.schemaType)};return(0,np.eachItem)(n,i.type.length===0?o=>rp.call(this,o,i):o=>i.type.forEach(a=>rp.call(this,o,i,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let o=i.split("/").slice(1),a=t;for(let s of o)a=a[s];for(let s in n){let c=n[s];if(typeof c!="object")continue;let{$data:u}=c.definition,l=a[s];u&&l&&(a[s]=Bv(l))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof t=="object")a=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,Ci.normalizeId)(a||n);let u=Ci.getSchemaRefs.call(this,t,n);return c=new Ai.SchemaEnv({schema:t,schemaId:s,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Ai.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Ai.compileSchema.call(this,t)}finally{this.opts=r}}};Mi.ValidationError=r0.default;Mi.MissingRefError=Jv.default;ke.default=Mi;function Vv(e,t,r,n="error"){for(let i in e){let o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function Fv(e){return e=(0,Ci.normalizeId)(e),this.schemas[e]||this.refs[e]}function d0(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function p0(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function f0(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function m0(){let e={...this.opts};for(let t of a0)delete e[t];return e}var h0={log(){},warn(){},error(){}};function g0(e){if(e===!1)return h0;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var v0=/^[a-z_$][a-z0-9_$:-]*$/i;function y0(e,t){let{RULES:r}=this;if((0,np.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!v0.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function rp(e,t,r){var n;let i=t?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=i?o.post:o.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,Va.getJSONTypes)(t.type),schemaType:(0,Va.getJSONTypes)(t.schemaType)}};t.before?_0.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function _0(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function $0(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Bv(t)),e.validateSchema=this.compile(t,!0))}var b0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Bv(e){return{anyOf:[e,b0]}}});var Hv=S(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});var x0={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ip.default=x0});var Qv=S(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.callRef=_r.getValidate=void 0;var k0=Ri(),Wv=tt(),Le=K(),on=Zt(),Xv=Aa(),Fa=re(),S0={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&i===u.baseId)return d();let l=Xv.resolveRef.call(c,u,i,r);if(l===void 0)throw new k0.default(n.opts.uriResolver,i,r);if(l instanceof Xv.SchemaEnv)return m(l);return f(l);function d(){if(o===u)return Ja(e,a,o,o.$async);let g=t.scopeValue("root",{ref:u});return Ja(e,(0,Le._)`${g}.validate`,u,u.$async)}function m(g){let v=Yv(e,g);Ja(e,v,g,g.$async)}function f(g){let v=t.scopeValue("schema",s.code.source===!0?{ref:g,code:(0,Le.stringify)(g)}:{ref:g}),$=t.name("valid"),k=e.subschema({schema:g,dataTypes:[],schemaPath:Le.nil,topSchemaRef:v,errSchemaPath:r},$);e.mergeEvaluated(k),e.ok($)}}};function Yv(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Le._)`${r.scopeValue("wrapper",{ref:t})}.validate`}_r.getValidate=Yv;function Ja(e,t,r,n){let{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?on.default.this:Le.nil;n?l():d();function l(){if(!s.$async)throw new Error("async schema referenced by sync schema");let g=i.let("valid");i.try(()=>{i.code((0,Le._)`await ${(0,Wv.callValidateCode)(e,t,u)}`),f(t),a||i.assign(g,!0)},v=>{i.if((0,Le._)`!(${v} instanceof ${o.ValidationError})`,()=>i.throw(v)),m(v),a||i.assign(g,!1)}),e.ok(g)}function d(){e.result((0,Wv.callValidateCode)(e,t,u),()=>f(t),()=>m(t))}function m(g){let v=(0,Le._)`${g}.errors`;i.assign(on.default.vErrors,(0,Le._)`${on.default.vErrors} === null ? ${v} : ${on.default.vErrors}.concat(${v})`),i.assign(on.default.errors,(0,Le._)`${on.default.vErrors}.length`)}function f(g){var v;if(!o.opts.unevaluated)return;let $=(v=r?.validate)===null||v===void 0?void 0:v.evaluated;if(o.props!==!0)if($&&!$.dynamicProps)$.props!==void 0&&(o.props=Fa.mergeEvaluated.props(i,$.props,o.props));else{let k=i.var("props",(0,Le._)`${g}.evaluated.props`);o.props=Fa.mergeEvaluated.props(i,k,o.props,Le.Name)}if(o.items!==!0)if($&&!$.dynamicItems)$.items!==void 0&&(o.items=Fa.mergeEvaluated.items(i,$.items,o.items));else{let k=i.var("items",(0,Le._)`${g}.evaluated.items`);o.items=Fa.mergeEvaluated.items(i,k,o.items,Le.Name)}}}_r.callRef=Ja;_r.default=S0});var ey=S(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});var w0=Hv(),z0=Qv(),I0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",w0.default,z0.default];op.default=I0});var ty=S(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var Ka=K(),tr=Ka.operators,Ba={maximum:{okStr:"<=",ok:tr.LTE,fail:tr.GT},minimum:{okStr:">=",ok:tr.GTE,fail:tr.LT},exclusiveMaximum:{okStr:"<",ok:tr.LT,fail:tr.GTE},exclusiveMinimum:{okStr:">",ok:tr.GT,fail:tr.LTE}},P0={message:({keyword:e,schemaCode:t})=>(0,Ka.str)`must be ${Ba[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ka._)`{comparison: ${Ba[e].okStr}, limit: ${t}}`},T0={keyword:Object.keys(Ba),type:"number",schemaType:"number",$data:!0,error:P0,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Ka._)`${r} ${Ba[t].fail} ${n} || isNaN(${r})`)}};ap.default=T0});var ry=S(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});var qi=K(),j0={message:({schemaCode:e})=>(0,qi.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,qi._)`{multipleOf: ${e}}`},O0={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:j0,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,qi._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,qi._)`${a} !== parseInt(${a})`;e.fail$data((0,qi._)`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};sp.default=O0});var iy=S(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});function ny(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}cp.default=ny;ny.code='require("ajv/dist/runtime/ucs2length").default'});var oy=S(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});var $r=K(),E0=re(),N0=iy(),D0={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,$r.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,$r._)`{limit: ${e}}`},Z0={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:D0,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,o=t==="maxLength"?$r.operators.GT:$r.operators.LT,a=i.opts.unicode===!1?(0,$r._)`${r}.length`:(0,$r._)`${(0,E0.useFunc)(e.gen,N0.default)}(${r})`;e.fail$data((0,$r._)`${a} ${o} ${n}`)}};up.default=Z0});var ay=S(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});var R0=tt(),Ga=K(),U0={message:({schemaCode:e})=>(0,Ga.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Ga._)`{pattern: ${e}}`},A0={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:U0,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?(0,Ga._)`(new RegExp(${i}, ${a}))`:(0,R0.usePattern)(e,n);e.fail$data((0,Ga._)`!${s}.test(${t})`)}};lp.default=A0});var sy=S(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});var Li=K(),C0={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Li.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Li._)`{limit: ${e}}`},M0={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:C0,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Li.operators.GT:Li.operators.LT;e.fail$data((0,Li._)`Object.keys(${r}).length ${i} ${n}`)}};dp.default=M0});var cy=S(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var Vi=tt(),Fi=K(),q0=re(),L0={message:({params:{missingProperty:e}})=>(0,Fi.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Fi._)`{missingProperty: ${e}}`},V0={keyword:"required",type:"object",schemaType:"array",$data:!0,error:L0,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:o,it:a}=e,{opts:s}=a;if(!o&&r.length===0)return;let c=r.length>=s.loopRequired;if(a.allErrors?u():l(),s.strictRequired){let f=e.parentSchema.properties,{definedProperties:g}=e.it;for(let v of r)if(f?.[v]===void 0&&!g.has(v)){let $=a.schemaEnv.baseId+a.errSchemaPath,k=`required property "${v}" is not defined at "${$}" (strictRequired)`;(0,q0.checkStrictMode)(a,k,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(Fi.nil,d);else for(let f of r)(0,Vi.checkReportMissingProp)(e,f)}function l(){let f=t.let("missing");if(c||o){let g=t.let("valid",!0);e.block$data(g,()=>m(f,g)),e.ok(g)}else t.if((0,Vi.checkMissingProp)(e,r,f)),(0,Vi.reportMissingProp)(e,f),t.else()}function d(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,Vi.noPropertyInData)(t,i,f,s.ownProperties),()=>e.error())})}function m(f,g){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(g,(0,Vi.propertyInData)(t,i,f,s.ownProperties)),t.if((0,Fi.not)(g),()=>{e.error(),t.break()})},Fi.nil)}}};pp.default=V0});var uy=S(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});var Ji=K(),F0={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Ji.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Ji._)`{limit: ${e}}`},J0={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:F0,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Ji.operators.GT:Ji.operators.LT;e.fail$data((0,Ji._)`${r}.length ${i} ${n}`)}};fp.default=J0});var Ha=S(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var ly=Ad();ly.code='require("ajv/dist/runtime/equal").default';mp.default=ly});var dy=S(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});var hp=Oi(),Se=K(),K0=re(),B0=Ha(),G0={message:({params:{i:e,j:t}})=>(0,Se.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Se._)`{i: ${e}, j: ${t}}`},H0={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:G0,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:o,schemaCode:a,it:s}=e;if(!n&&!i)return;let c=t.let("valid"),u=o.items?(0,hp.getSchemaTypes)(o.items):[];e.block$data(c,l,(0,Se._)`${a} === false`),e.ok(c);function l(){let g=t.let("i",(0,Se._)`${r}.length`),v=t.let("j");e.setParams({i:g,j:v}),t.assign(c,!0),t.if((0,Se._)`${g} > 1`,()=>(d()?m:f)(g,v))}function d(){return u.length>0&&!u.some(g=>g==="object"||g==="array")}function m(g,v){let $=t.name("item"),k=(0,hp.checkDataTypes)(u,$,s.opts.strictNumbers,hp.DataType.Wrong),E=t.const("indices",(0,Se._)`{}`);t.for((0,Se._)`;${g}--;`,()=>{t.let($,(0,Se._)`${r}[${g}]`),t.if(k,(0,Se._)`continue`),u.length>1&&t.if((0,Se._)`typeof ${$} == "string"`,(0,Se._)`${$} += "_"`),t.if((0,Se._)`typeof ${E}[${$}] == "number"`,()=>{t.assign(v,(0,Se._)`${E}[${$}]`),e.error(),t.assign(c,!1).break()}).code((0,Se._)`${E}[${$}] = ${g}`)})}function f(g,v){let $=(0,K0.useFunc)(t,B0.default),k=t.name("outer");t.label(k).for((0,Se._)`;${g}--;`,()=>t.for((0,Se._)`${v} = ${g}; ${v}--;`,()=>t.if((0,Se._)`${$}(${r}[${g}], ${r}[${v}])`,()=>{e.error(),t.assign(c,!1).break(k)})))}}};gp.default=H0});var py=S(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});var vp=K(),W0=re(),X0=Ha(),Y0={message:"must be equal to constant",params:({schemaCode:e})=>(0,vp._)`{allowedValue: ${e}}`},Q0={keyword:"const",$data:!0,error:Y0,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&typeof o=="object"?e.fail$data((0,vp._)`!${(0,W0.useFunc)(t,X0.default)}(${r}, ${i})`):e.fail((0,vp._)`${o} !== ${r}`)}};yp.default=Q0});var fy=S(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});var Ki=K(),eI=re(),tI=Ha(),rI={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Ki._)`{allowedValues: ${e}}`},nI={keyword:"enum",schemaType:"array",$data:!0,error:rI,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let s=i.length>=a.opts.loopEnum,c,u=()=>c??(c=(0,eI.useFunc)(t,tI.default)),l;if(s||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let f=t.const("vSchema",o);l=(0,Ki.or)(...i.map((g,v)=>m(f,v)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,f=>t.if((0,Ki._)`${u()}(${r}, ${f})`,()=>t.assign(l,!0).break()))}function m(f,g){let v=i[g];return typeof v=="object"&&v!==null?(0,Ki._)`${u()}(${r}, ${f}[${g}])`:(0,Ki._)`${r} === ${v}`}}};_p.default=nI});var my=S($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});var iI=ty(),oI=ry(),aI=oy(),sI=ay(),cI=sy(),uI=cy(),lI=uy(),dI=dy(),pI=py(),fI=fy(),mI=[iI.default,oI.default,aI.default,sI.default,cI.default,uI.default,lI.default,dI.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},pI.default,fI.default];$p.default=mI});var xp=S(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.validateAdditionalItems=void 0;var br=K(),bp=re(),hI={message:({params:{len:e}})=>(0,br.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,br._)`{limit: ${e}}`},gI={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:hI,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,bp.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}hy(e,n)}};function hy(e,t){let{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;let s=r.const("len",(0,br._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,br._)`${s} <= ${t.length}`);else if(typeof n=="object"&&!(0,bp.alwaysValidSchema)(a,n)){let u=r.var("valid",(0,br._)`${s} <= ${t.length}`);r.if((0,br.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,s,l=>{e.subschema({keyword:o,dataProp:l,dataPropType:bp.Type.Num},u),a.allErrors||r.if((0,br.not)(u),()=>r.break())})}}Bi.validateAdditionalItems=hy;Bi.default=gI});var kp=S(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.validateTuple=void 0;var gy=K(),Wa=re(),vI=tt(),yI={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return vy(e,"additionalItems",t);r.items=!0,!(0,Wa.alwaysValidSchema)(r,t)&&e.ok((0,vI.validateArray)(e))}};function vy(e,t,r=e.schema){let{gen:n,parentSchema:i,data:o,keyword:a,it:s}=e;l(i),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=Wa.mergeEvaluated.items(n,r.length,s.items));let c=n.name("valid"),u=n.const("len",(0,gy._)`${o}.length`);r.forEach((d,m)=>{(0,Wa.alwaysValidSchema)(s,d)||(n.if((0,gy._)`${u} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c))});function l(d){let{opts:m,errSchemaPath:f}=s,g=r.length,v=g===d.minItems&&(g===d.maxItems||d[t]===!1);if(m.strictTuples&&!v){let $=`"${a}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;(0,Wa.checkStrictMode)(s,$,m.strictTuples)}}}Gi.validateTuple=vy;Gi.default=yI});var yy=S(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});var _I=kp(),$I={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,_I.validateTuple)(e,"items")};Sp.default=$I});var $y=S(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});var _y=K(),bI=re(),xI=tt(),kI=xp(),SI={message:({params:{len:e}})=>(0,_y.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,_y._)`{limit: ${e}}`},wI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:SI,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,bI.alwaysValidSchema)(n,t)&&(i?(0,kI.validateAdditionalItems)(e,i):e.ok((0,xI.validateArray)(e)))}};wp.default=wI});var by=S(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});var nt=K(),Xa=re(),zI={message:({params:{min:e,max:t}})=>t===void 0?(0,nt.str)`must contain at least ${e} valid item(s)`:(0,nt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,nt._)`{minContains: ${e}}`:(0,nt._)`{minContains: ${e}, maxContains: ${t}}`},II={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:zI,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:o}=e,a,s,{minContains:c,maxContains:u}=n;o.opts.next?(a=c===void 0?1:c,s=u):a=1;let l=t.const("len",(0,nt._)`${i}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,Xa.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,Xa.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Xa.alwaysValidSchema)(o,r)){let v=(0,nt._)`${l} >= ${a}`;s!==void 0&&(v=(0,nt._)`${v} && ${l} <= ${s}`),e.pass(v);return}o.items=!0;let d=t.name("valid");s===void 0&&a===1?f(d,()=>t.if(d,()=>t.break())):a===0?(t.let(d,!0),s!==void 0&&t.if((0,nt._)`${i}.length > 0`,m)):(t.let(d,!1),m()),e.result(d,()=>e.reset());function m(){let v=t.name("_valid"),$=t.let("count",0);f(v,()=>t.if(v,()=>g($)))}function f(v,$){t.forRange("i",0,l,k=>{e.subschema({keyword:"contains",dataProp:k,dataPropType:Xa.Type.Num,compositeRule:!0},v),$()})}function g(v){t.code((0,nt._)`${v}++`),s===void 0?t.if((0,nt._)`${v} >= ${a}`,()=>t.assign(d,!0).break()):(t.if((0,nt._)`${v} > ${s}`,()=>t.assign(d,!1).break()),a===1?t.assign(d,!0):t.if((0,nt._)`${v} >= ${a}`,()=>t.assign(d,!0)))}}};zp.default=II});var Sy=S($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.validateSchemaDeps=$t.validatePropertyDeps=$t.error=void 0;var Ip=K(),PI=re(),Hi=tt();$t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Ip.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Ip._)`{property: ${e},
|
|
7
|
-
missingProperty: ${n},
|
|
8
|
-
depsCount: ${t},
|
|
9
|
-
deps: ${r}}`};var TI={keyword:"dependencies",type:"object",schemaType:"object",error:$t.error,code(e){let[t,r]=jI(e);xy(e,t),ky(e,r)}};function jI({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function xy(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let c=(0,Hi.propertyInData)(r,n,a,i.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),i.allErrors?r.if(c,()=>{for(let u of s)(0,Hi.checkReportMissingProp)(e,u)}):(r.if((0,Ip._)`${c} && (${(0,Hi.checkMissingProp)(e,s,o)})`),(0,Hi.reportMissingProp)(e,o),r.else())}}$t.validatePropertyDeps=xy;function ky(e,t=e.schema){let{gen:r,data:n,keyword:i,it:o}=e,a=r.name("valid");for(let s in t)(0,PI.alwaysValidSchema)(o,t[s])||(r.if((0,Hi.propertyInData)(r,n,s,o.opts.ownProperties),()=>{let c=e.subschema({keyword:i,schemaProp:s},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a))}$t.validateSchemaDeps=ky;$t.default=TI});var zy=S(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});var wy=K(),OI=re(),EI={message:"property name must be valid",params:({params:e})=>(0,wy._)`{propertyName: ${e.propertyName}}`},NI={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:EI,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,OI.alwaysValidSchema)(i,r))return;let o=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,wy.not)(o),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(o)}};Pp.default=NI});var jp=S(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});var Ya=tt(),pt=K(),DI=Zt(),Qa=re(),ZI={message:"must NOT have additional properties",params:({params:e})=>(0,pt._)`{additionalProperty: ${e.additionalProperty}}`},RI={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:ZI,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");let{allErrors:s,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,Qa.alwaysValidSchema)(a,r))return;let u=(0,Ya.allSchemaProperties)(n.properties),l=(0,Ya.allSchemaProperties)(n.patternProperties);d(),e.ok((0,pt._)`${o} === ${DI.default.errors}`);function d(){t.forIn("key",i,$=>{!u.length&&!l.length?g($):t.if(m($),()=>g($))})}function m($){let k;if(u.length>8){let E=(0,Qa.schemaRefOrVal)(a,n.properties,"properties");k=(0,Ya.isOwnProperty)(t,E,$)}else u.length?k=(0,pt.or)(...u.map(E=>(0,pt._)`${$} === ${E}`)):k=pt.nil;return l.length&&(k=(0,pt.or)(k,...l.map(E=>(0,pt._)`${(0,Ya.usePattern)(e,E)}.test(${$})`))),(0,pt.not)(k)}function f($){t.code((0,pt._)`delete ${i}[${$}]`)}function g($){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f($);return}if(r===!1){e.setParams({additionalProperty:$}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,Qa.alwaysValidSchema)(a,r)){let k=t.name("valid");c.removeAdditional==="failing"?(v($,k,!1),t.if((0,pt.not)(k),()=>{e.reset(),f($)})):(v($,k),s||t.if((0,pt.not)(k),()=>t.break()))}}function v($,k,E){let P={keyword:"additionalProperties",dataProp:$,dataPropType:Qa.Type.Str};E===!1&&Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(P,k)}}};Tp.default=RI});var Ty=S(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});var UI=Zi(),Iy=tt(),Op=re(),Py=jp(),AI={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Py.default.code(new UI.KeywordCxt(o,Py.default,"additionalProperties"));let a=(0,Iy.allSchemaProperties)(r);for(let d of a)o.definedProperties.add(d);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=Op.mergeEvaluated.props(t,(0,Op.toHash)(a),o.props));let s=a.filter(d=>!(0,Op.alwaysValidSchema)(o,r[d]));if(s.length===0)return;let c=t.name("valid");for(let d of s)u(d)?l(d):(t.if((0,Iy.propertyInData)(t,i,d,o.opts.ownProperties)),l(d),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(c);function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Ep.default=AI});var Ny=S(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});var jy=tt(),es=K(),Oy=re(),Ey=re(),CI={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:o}=e,{opts:a}=o,s=(0,jy.allSchemaProperties)(r),c=s.filter(v=>(0,Oy.alwaysValidSchema)(o,r[v]));if(s.length===0||c.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,l=t.name("valid");o.props!==!0&&!(o.props instanceof es.Name)&&(o.props=(0,Ey.evaluatedPropsToName)(t,o.props));let{props:d}=o;m();function m(){for(let v of s)u&&f(v),o.allErrors?g(v):(t.var(l,!0),g(v),t.if(l))}function f(v){for(let $ in u)new RegExp(v).test($)&&(0,Oy.checkStrictMode)(o,`property ${$} matches pattern ${v} (use allowMatchingProperties)`)}function g(v){t.forIn("key",n,$=>{t.if((0,es._)`${(0,jy.usePattern)(e,v)}.test(${$})`,()=>{let k=c.includes(v);k||e.subschema({keyword:"patternProperties",schemaProp:v,dataProp:$,dataPropType:Ey.Type.Str},l),o.opts.unevaluated&&d!==!0?t.assign((0,es._)`${d}[${$}]`,!0):!k&&!o.allErrors&&t.if((0,es.not)(l),()=>t.break())})})}}};Np.default=CI});var Dy=S(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});var MI=re(),qI={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,MI.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Dp.default=qI});var Zy=S(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});var LI=tt(),VI={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:LI.validateUnion,error:{message:"must match a schema in anyOf"}};Zp.default=VI});var Ry=S(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});var ts=K(),FI=re(),JI={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ts._)`{passingSchemas: ${e.passing}}`},KI={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:JI,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let m;(0,FI.alwaysValidSchema)(i,l)?t.var(c,!0):m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,ts._)`${c} && ${a}`).assign(a,!1).assign(s,(0,ts._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),m&&e.mergeEvaluated(m,ts.Name)})})}}};Rp.default=KI});var Uy=S(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});var BI=re(),GI={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((o,a)=>{if((0,BI.alwaysValidSchema)(n,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},i);e.ok(i),e.mergeEvaluated(s)})}};Up.default=GI});var My=S(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});var rs=K(),Cy=re(),HI={message:({params:e})=>(0,rs.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,rs._)`{failingKeyword: ${e.ifClause}}`},WI={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:HI,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Cy.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Ay(n,"then"),o=Ay(n,"else");if(!i&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),i&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(s,u("then",l),u("else",l))}else i?t.if(s,u("then")):t.if((0,rs.not)(s),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(l)}function u(l,d){return()=>{let m=e.subschema({keyword:l},s);t.assign(a,s),e.mergeValidEvaluated(m,a),d?t.assign(d,(0,rs._)`${l}`):e.setParams({ifClause:l})}}}};function Ay(e,t){let r=e.schema[t];return r!==void 0&&!(0,Cy.alwaysValidSchema)(e,r)}Ap.default=WI});var qy=S(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});var XI=re(),YI={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,XI.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Cp.default=YI});var Ly=S(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});var QI=xp(),eP=yy(),tP=kp(),rP=$y(),nP=by(),iP=Sy(),oP=zy(),aP=jp(),sP=Ty(),cP=Ny(),uP=Dy(),lP=Zy(),dP=Ry(),pP=Uy(),fP=My(),mP=qy();function hP(e=!1){let t=[uP.default,lP.default,dP.default,pP.default,fP.default,mP.default,oP.default,aP.default,iP.default,sP.default,cP.default];return e?t.push(eP.default,rP.default):t.push(QI.default,tP.default),t.push(nP.default),t}Mp.default=hP});var Vy=S(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});var ge=K(),gP={message:({schemaCode:e})=>(0,ge.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,ge._)`{format: ${e}}`},vP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:gP,code(e,t){let{gen:r,data:n,$data:i,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=s;if(!c.validateFormats)return;i?m():f();function m(){let g=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),v=r.const("fDef",(0,ge._)`${g}[${a}]`),$=r.let("fType"),k=r.let("format");r.if((0,ge._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign($,(0,ge._)`${v}.type || "string"`).assign(k,(0,ge._)`${v}.validate`),()=>r.assign($,(0,ge._)`"string"`).assign(k,v)),e.fail$data((0,ge.or)(E(),P()));function E(){return c.strictSchema===!1?ge.nil:(0,ge._)`${a} && !${k}`}function P(){let A=l.$async?(0,ge._)`(${v}.async ? await ${k}(${n}) : ${k}(${n}))`:(0,ge._)`${k}(${n})`,O=(0,ge._)`(typeof ${k} == "function" ? ${A} : ${k}.test(${n}))`;return(0,ge._)`${k} && ${k} !== true && ${$} === ${t} && !${O}`}}function f(){let g=d.formats[o];if(!g){E();return}if(g===!0)return;let[v,$,k]=P(g);v===t&&e.pass(A());function E(){if(c.strictSchema===!1){d.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function P(O){let it=O instanceof RegExp?(0,ge.regexpCode)(O):c.code.formats?(0,ge._)`${c.code.formats}${(0,ge.getProperty)(o)}`:void 0,ot=r.scopeValue("formats",{key:o,ref:O,code:it});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,ge._)`${ot}.validate`]:["string",O,ot]}function A(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!l.$async)throw new Error("async format in sync schema");return(0,ge._)`await ${k}(${n})`}return typeof $=="function"?(0,ge._)`${k}(${n})`:(0,ge._)`${k}.test(${n})`}}}};qp.default=vP});var Fy=S(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});var yP=Vy(),_P=[yP.default];Lp.default=_P});var Jy=S(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.contentVocabulary=an.metadataVocabulary=void 0;an.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];an.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var By=S(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});var $P=ey(),bP=my(),xP=Ly(),kP=Fy(),Ky=Jy(),SP=[$P.default,bP.default,(0,xP.default)(),kP.default,Ky.metadataVocabulary,Ky.contentVocabulary];Vp.default=SP});var Hy=S(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.DiscrError=void 0;var Gy;(function(e){e.Tag="tag",e.Mapping="mapping"})(Gy||(ns.DiscrError=Gy={}))});var Xy=S(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});var sn=K(),Fp=Hy(),Wy=Aa(),wP=Ri(),zP=re(),IP={message:({params:{discrError:e,tagName:t}})=>e===Fp.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,sn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},PP={keyword:"discriminator",type:"object",schemaType:"object",error:IP,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:o}=e,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=n.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,sn._)`${r}${(0,sn.getProperty)(s)}`);t.if((0,sn._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:Fp.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function l(){let f=m();t.if(!1);for(let g in f)t.elseIf((0,sn._)`${u} === ${g}`),t.assign(c,d(f[g]));t.else(),e.error(!1,{discrError:Fp.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function d(f){let g=t.name("valid"),v=e.subschema({keyword:"oneOf",schemaProp:f},g);return e.mergeEvaluated(v,sn.Name),g}function m(){var f;let g={},v=k(i),$=!0;for(let A=0;A<a.length;A++){let O=a[A];if(O?.$ref&&!(0,zP.schemaHasRulesButRef)(O,o.self.RULES)){let ot=O.$ref;if(O=Wy.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ot),O instanceof Wy.SchemaEnv&&(O=O.schema),O===void 0)throw new wP.default(o.opts.uriResolver,o.baseId,ot)}let it=(f=O?.properties)===null||f===void 0?void 0:f[s];if(typeof it!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);$=$&&(v||k(O)),E(it,A)}if(!$)throw new Error(`discriminator: "${s}" must be required`);return g;function k({required:A}){return Array.isArray(A)&&A.includes(s)}function E(A,O){if(A.const)P(A.const,O);else if(A.enum)for(let it of A.enum)P(it,O);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function P(A,O){if(typeof A!="string"||A in g)throw new Error(`discriminator: "${s}" values must be unique strings`);g[A]=O}}}};Jp.default=PP});var Yy=S((A6,TP)=>{TP.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 Bp=S((he,Kp)=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.MissingRefError=he.ValidationError=he.CodeGen=he.Name=he.nil=he.stringify=he.str=he._=he.KeywordCxt=he.Ajv=void 0;var jP=Gv(),OP=By(),EP=Xy(),Qy=Yy(),NP=["/properties"],is="http://json-schema.org/draft-07/schema",cn=class extends jP.default{_addVocabularies(){super._addVocabularies(),OP.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(EP.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(Qy,NP):Qy;this.addMetaSchema(t,is,!1),this.refs["http://json-schema.org/schema"]=is}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(is)?is:void 0)}};he.Ajv=cn;Kp.exports=he=cn;Kp.exports.Ajv=cn;Object.defineProperty(he,"__esModule",{value:!0});he.default=cn;var DP=Zi();Object.defineProperty(he,"KeywordCxt",{enumerable:!0,get:function(){return DP.KeywordCxt}});var un=K();Object.defineProperty(he,"_",{enumerable:!0,get:function(){return un._}});Object.defineProperty(he,"str",{enumerable:!0,get:function(){return un.str}});Object.defineProperty(he,"stringify",{enumerable:!0,get:function(){return un.stringify}});Object.defineProperty(he,"nil",{enumerable:!0,get:function(){return un.nil}});Object.defineProperty(he,"Name",{enumerable:!0,get:function(){return un.Name}});Object.defineProperty(he,"CodeGen",{enumerable:!0,get:function(){return un.CodeGen}});var ZP=Ra();Object.defineProperty(he,"ValidationError",{enumerable:!0,get:function(){return ZP.default}});var RP=Ri();Object.defineProperty(he,"MissingRefError",{enumerable:!0,get:function(){return RP.default}})});var s_=S(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.formatNames=xt.fastFormats=xt.fullFormats=void 0;function bt(e,t){return{validate:e,compare:t}}xt.fullFormats={date:bt(n_,Xp),time:bt(Hp(!0),Yp),"date-time":bt(e_(!0),o_),"iso-time":bt(Hp(),i_),"iso-date-time":bt(e_(),a_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:LP,"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:HP,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:VP,int32:{type:"number",validate:KP},int64:{type:"number",validate:BP},float:{type:"number",validate:r_},double:{type:"number",validate:r_},password:!0,binary:!0};xt.fastFormats={...xt.fullFormats,date:bt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Xp),time:bt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Yp),"date-time":bt(/^\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,o_),"iso-time":bt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,i_),"iso-date-time":bt(/^\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,a_),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};xt.formatNames=Object.keys(xt.fullFormats);function UP(e){return e%4===0&&(e%100!==0||e%400===0)}var AP=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,CP=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n_(e){let t=AP.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&UP(r)?29:CP[n])}function Xp(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Gp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Hp(e){return function(r){let n=Gp.exec(r);if(!n)return!1;let i=+n[1],o=+n[2],a=+n[3],s=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||e&&!s)return!1;if(i<=23&&o<=59&&a<60)return!0;let d=o-l*c,m=i-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&a<61}}function Yp(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function i_(e,t){if(!(e&&t))return;let r=Gp.exec(e),n=Gp.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var Wp=/t|\s/i;function e_(e){let t=Hp(e);return function(n){let i=n.split(Wp);return i.length===2&&n_(i[0])&&t(i[1])}}function o_(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function a_(e,t){if(!(e&&t))return;let[r,n]=e.split(Wp),[i,o]=t.split(Wp),a=Xp(r,i);if(a!==void 0)return a||Yp(n,o)}var MP=/\/|:/,qP=/^(?:[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 LP(e){return MP.test(e)&&qP.test(e)}var t_=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function VP(e){return t_.lastIndex=0,t_.test(e)}var FP=-(2**31),JP=2**31-1;function KP(e){return Number.isInteger(e)&&e<=JP&&e>=FP}function BP(e){return Number.isInteger(e)}function r_(){return!0}var GP=/[^\\]\\Z/;function HP(e){if(GP.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var c_=S(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.formatLimitDefinition=void 0;var WP=Bp(),ft=K(),rr=ft.operators,os={formatMaximum:{okStr:"<=",ok:rr.LTE,fail:rr.GT},formatMinimum:{okStr:">=",ok:rr.GTE,fail:rr.LT},formatExclusiveMaximum:{okStr:"<",ok:rr.LT,fail:rr.GTE},formatExclusiveMinimum:{okStr:">",ok:rr.GT,fail:rr.LTE}},XP={message:({keyword:e,schemaCode:t})=>(0,ft.str)`should be ${os[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,ft._)`{comparison: ${os[e].okStr}, limit: ${t}}`};ln.formatLimitDefinition={keyword:Object.keys(os),type:"string",schemaType:"string",$data:!0,error:XP,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:o}=e,{opts:a,self:s}=o;if(!a.validateFormats)return;let c=new WP.KeywordCxt(o,s.RULES.all.format.definition,"format");c.$data?u():l();function u(){let m=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),f=t.const("fmt",(0,ft._)`${m}[${c.schemaCode}]`);e.fail$data((0,ft.or)((0,ft._)`typeof ${f} != "object"`,(0,ft._)`${f} instanceof RegExp`,(0,ft._)`typeof ${f}.compare != "function"`,d(f)))}function l(){let m=c.schema,f=s.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${i}": format "${m}" does not define "compare" function`);let g=t.scopeValue("formats",{key:m,ref:f,code:a.code.formats?(0,ft._)`${a.code.formats}${(0,ft.getProperty)(m)}`:void 0});e.fail$data(d(g))}function d(m){return(0,ft._)`${m}.compare(${r}, ${n}) ${os[i].fail} 0`}},dependencies:["format"]};var YP=e=>(e.addKeyword(ln.formatLimitDefinition),e);ln.default=YP});var p_=S((Wi,d_)=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var dn=s_(),QP=c_(),Qp=K(),u_=new Qp.Name("fullFormats"),eT=new Qp.Name("fastFormats"),ef=(e,t={keywords:!0})=>{if(Array.isArray(t))return l_(e,t,dn.fullFormats,u_),e;let[r,n]=t.mode==="fast"?[dn.fastFormats,eT]:[dn.fullFormats,u_],i=t.formats||dn.formatNames;return l_(e,i,r,n),t.keywords&&(0,QP.default)(e),e};ef.get=(e,t="full")=>{let n=(t==="fast"?dn.fastFormats:dn.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function l_(e,t,r,n){var i,o;(i=(o=e.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,Qp._)`require("ajv-formats/dist/formats").${n}`);for(let a of t)e.addFormat(a,r[a])}d_.exports=Wi=ef;Object.defineProperty(Wi,"__esModule",{value:!0});Wi.default=ef});import vg from"node:process";var af=Object.freeze({status:"aborted"});function p(e,t,r){function n(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let u=a.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let m=l[d];m in s||(s[m]=u[m].bind(s))}}let i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function a(s){var c;let u=r?.Parent?new o:this;n(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var fs=Symbol("zod_brand"),mt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},nr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Xi={};function ye(e){return e&&Object.assign(Xi,e),Xi}var _={};fn(_,{BIGINT_FORMAT_RANGES:()=>ks,Class:()=>hs,NUMBER_FORMAT_RANGES:()=>xs,aborted:()=>qt,allowsEval:()=>ys,assert:()=>j_,assertEqual:()=>z_,assertIs:()=>P_,assertNever:()=>T_,assertNotEqual:()=>I_,assignProp:()=>Ct,base64ToUint8Array:()=>mf,base64urlToUint8Array:()=>q_,cached:()=>kr,captureStackTrace:()=>Qi,cleanEnum:()=>M_,cleanRegex:()=>gn,clone:()=>Oe,cloneDef:()=>E_,createTransparentProxy:()=>A_,defineLazy:()=>L,esc:()=>Yi,escapeRegex:()=>He,extend:()=>lf,finalizeIssue:()=>Ae,floatSafeRemainder:()=>gs,getElementAtPath:()=>N_,getEnumValues:()=>hn,getLengthableOrigin:()=>_n,getParsedType:()=>U_,getSizableOrigin:()=>yn,hexToUint8Array:()=>V_,isObject:()=>ir,isPlainObject:()=>Mt,issue:()=>Sr,joinValues:()=>D,jsonStringifyReplacer:()=>xr,merge:()=>C_,mergeDefs:()=>kt,normalizeParams:()=>b,nullish:()=>At,numKeys:()=>R_,objectClone:()=>O_,omit:()=>uf,optionalKeys:()=>bs,parsedType:()=>R,partial:()=>pf,pick:()=>cf,prefixIssues:()=>Ve,primitiveTypes:()=>$s,promiseAllObject:()=>D_,propertyKeyTypes:()=>vn,randomString:()=>Z_,required:()=>ff,safeExtend:()=>df,shallowClone:()=>_s,slugify:()=>vs,stringifyPrimitive:()=>Z,uint8ArrayToBase64:()=>hf,uint8ArrayToBase64url:()=>L_,uint8ArrayToHex:()=>F_,unwrapMessage:()=>mn});function z_(e){return e}function I_(e){return e}function P_(e){}function T_(e){throw new Error("Unexpected value in exhaustive check")}function j_(e){}function hn(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function D(e,t="|"){return e.map(r=>Z(r)).join(t)}function xr(e,t){return typeof t=="bigint"?t.toString():t}function kr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function At(e){return e==null}function gn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function gs(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let c=n.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}let o=r>i?r:i,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return a%s/10**o}var sf=Symbol("evaluating");function L(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==sf)return n===void 0&&(n=sf,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function O_(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ct(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function kt(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function E_(e){return kt(e._zod.def)}function N_(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function D_(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let i={};for(let o=0;o<t.length;o++)i[t[o]]=n[o];return i})}function Z_(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Yi(e){return JSON.stringify(e)}function vs(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ir(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ys=kr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Mt(e){if(ir(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ir(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function _s(e){return Mt(e)?{...e}:Array.isArray(e)?[...e]:e}function R_(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var U_=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},vn=new Set(["string","number","symbol"]),$s=new Set(["string","number","bigint","boolean","symbol","undefined"]);function He(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oe(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function b(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function A_(e){let t;return new Proxy({},{get(r,n,i){return t??(t=e()),Reflect.get(t,n,i)},set(r,n,i,o){return t??(t=e()),Reflect.set(t,n,i,o)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,i){return t??(t=e()),Reflect.defineProperty(t,n,i)}})}function Z(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function bs(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var xs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ks={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function cf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=kt(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Ct(this,"shape",a),a},checks:[]});return Oe(e,o)}function uf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=kt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Ct(this,"shape",a),a},checks:[]});return Oe(e,o)}function lf(e,t){if(!Mt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=kt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ct(this,"shape",o),o}});return Oe(e,i)}function df(e,t){if(!Mt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=kt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ct(this,"shape",n),n}});return Oe(e,r)}function C_(e,t){let r=kt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ct(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Oe(e,r)}function pf(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=kt(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Ct(this,"shape",c),c},checks:[]});return Oe(t,a)}function ff(e,t,r){let n=kt(t._zod.def,{get shape(){let i=t._zod.def.shape,o={...i};if(r)for(let a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new e({type:"nonoptional",innerType:i[a]}))}else for(let a in i)o[a]=new e({type:"nonoptional",innerType:i[a]});return Ct(this,"shape",o),o}});return Oe(t,n)}function qt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ve(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function mn(e){return typeof e=="string"?e:e?.message}function Ae(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=mn(e.inst?._zod.def?.error?.(e))??mn(t?.error?.(e))??mn(r.customError?.(e))??mn(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function yn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function _n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function R(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Sr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function M_(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function mf(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function hf(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function q_(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return mf(t+r)}function L_(e){return hf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function V_(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function F_(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var hs=class{constructor(...t){}};var gf=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,xr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},eo=p("$ZodError",gf),$n=p("$ZodError",gf,{Parent:Error});function to(e,t=r=>r.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function ro(e,t=r=>r.message){let r={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>n({issues:a}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let a=r,s=0;for(;s<o.path.length;){let c=o.path[s];s===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(o))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return n(e),r}var bn=e=>(t,r,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new mt;if(a.issues.length){let s=new(i?.Err??e)(a.issues.map(c=>Ae(c,o,ye())));throw Qi(s,i?.callee),s}return a.value},xn=bn($n),kn=e=>async(t,r,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(i?.Err??e)(a.issues.map(c=>Ae(c,o,ye())));throw Qi(s,i?.callee),s}return a.value},Sn=kn($n),wn=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new mt;return o.issues.length?{success:!1,error:new(e??eo)(o.issues.map(a=>Ae(a,i,ye())))}:{success:!0,data:o.value}},wr=wn($n),zn=e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>Ae(a,i,ye())))}:{success:!0,data:o.value}},In=zn($n),vf=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return bn(e)(t,r,i)};var yf=e=>(t,r,n)=>bn(e)(t,r,n);var _f=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return kn(e)(t,r,i)};var $f=e=>async(t,r,n)=>kn(e)(t,r,n);var bf=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return wn(e)(t,r,i)};var xf=e=>(t,r,n)=>wn(e)(t,r,n);var kf=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return zn(e)(t,r,i)};var Sf=e=>async(t,r,n)=>zn(e)(t,r,n);var We={};fn(We,{base64:()=>Cs,base64url:()=>no,bigint:()=>Js,boolean:()=>Bs,browserEmail:()=>Q_,cidrv4:()=>Us,cidrv6:()=>As,cuid:()=>Ss,cuid2:()=>ws,date:()=>qs,datetime:()=>Vs,domain:()=>r$,duration:()=>js,e164:()=>Ms,email:()=>Es,emoji:()=>Ns,extendedDuration:()=>K_,guid:()=>Os,hex:()=>n$,hostname:()=>t$,html5Email:()=>W_,idnEmail:()=>Y_,integer:()=>Ks,ipv4:()=>Ds,ipv6:()=>Zs,ksuid:()=>Ps,lowercase:()=>Ws,mac:()=>Rs,md5_base64:()=>o$,md5_base64url:()=>a$,md5_hex:()=>i$,nanoid:()=>Ts,null:()=>Gs,number:()=>io,rfc5322Email:()=>X_,sha1_base64:()=>c$,sha1_base64url:()=>u$,sha1_hex:()=>s$,sha256_base64:()=>d$,sha256_base64url:()=>p$,sha256_hex:()=>l$,sha384_base64:()=>m$,sha384_base64url:()=>h$,sha384_hex:()=>f$,sha512_base64:()=>v$,sha512_base64url:()=>y$,sha512_hex:()=>g$,string:()=>Fs,time:()=>Ls,ulid:()=>zs,undefined:()=>Hs,unicodeEmail:()=>wf,uppercase:()=>Xs,uuid:()=>or,uuid4:()=>B_,uuid6:()=>G_,uuid7:()=>H_,xid:()=>Is});var Ss=/^[cC][^\s-]{8,}$/,ws=/^[0-9a-z]+$/,zs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Is=/^[0-9a-vA-V]{20}$/,Ps=/^[A-Za-z0-9]{27}$/,Ts=/^[a-zA-Z0-9_-]{21}$/,js=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,K_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Os=/^([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})$/,or=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,B_=or(4),G_=or(6),H_=or(7),Es=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,W_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,X_=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,wf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Y_=wf,Q_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,e$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ns(){return new RegExp(e$,"u")}var Ds=/^(?:(?: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])$/,Zs=/^(([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}|:))$/,Rs=e=>{let t=He(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Us=/^((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])$/,As=/^(([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])$/,Cs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,no=/^[A-Za-z0-9_-]*$/,t$=/^(?=.{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])?)*\.?$/,r$=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ms=/^\+[1-9]\d{6,14}$/,zf="(?:(?:\\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])))",qs=new RegExp(`^${zf}$`);function If(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ls(e){return new RegExp(`^${If(e)}$`)}function Vs(e){let t=If({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${zf}T(?:${n})$`)}var Fs=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Js=/^-?\d+n?$/,Ks=/^-?\d+$/,io=/^-?\d+(?:\.\d+)?$/,Bs=/^(?:true|false)$/i,Gs=/^null$/i;var Hs=/^undefined$/i;var Ws=/^[^A-Z]*$/,Xs=/^[^a-z]*$/,n$=/^[0-9a-fA-F]*$/;function Pn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Tn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var i$=/^[0-9a-fA-F]{32}$/,o$=Pn(22,"=="),a$=Tn(22),s$=/^[0-9a-fA-F]{40}$/,c$=Pn(27,"="),u$=Tn(27),l$=/^[0-9a-fA-F]{64}$/,d$=Pn(43,"="),p$=Tn(43),f$=/^[0-9a-fA-F]{96}$/,m$=Pn(64,""),h$=Tn(64),g$=/^[0-9a-fA-F]{128}$/,v$=Pn(86,"=="),y$=Tn(86);var se=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Tf={number:"number",bigint:"bigint",object:"date"},Ys=p("$ZodCheckLessThan",(e,t)=>{se.init(e,t);let r=Tf[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qs=p("$ZodCheckGreaterThan",(e,t)=>{se.init(e,t);let r=Tf[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jf=p("$ZodCheckMultipleOf",(e,t)=>{se.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):gs(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Of=p("$ZodCheckNumberFormat",(e,t)=>{se.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=xs[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=i,s.maximum=o,r&&(s.pattern=Ks)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Ef=p("$ZodCheckBigIntFormat",(e,t)=>{se.init(e,t);let[r,n]=ks[t.format];e._zod.onattach.push(i=>{let o=i._zod.bag;o.format=t.format,o.minimum=r,o.maximum=n}),e._zod.check=i=>{let o=i.value;o<r&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),Nf=p("$ZodCheckMaxSize",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!At(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;i.size<=t.maximum||n.issues.push({origin:yn(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Df=p("$ZodCheckMinSize",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!At(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;i.size>=t.minimum||n.issues.push({origin:yn(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Zf=p("$ZodCheckSizeEquals",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!At(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=n=>{let i=n.value,o=i.size;if(o===t.size)return;let a=o>t.size;n.issues.push({origin:yn(i),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Rf=p("$ZodCheckMaxLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!At(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;if(i.length<=t.maximum)return;let a=_n(i);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Uf=p("$ZodCheckMinLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!At(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let a=_n(i);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Af=p("$ZodCheckLengthEquals",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!At(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{let i=n.value,o=i.length;if(o===t.length)return;let a=_n(i),s=o>t.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),jn=p("$ZodCheckStringFormat",(e,t)=>{var r,n;se.init(e,t),e._zod.onattach.push(i=>{let o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Cf=p("$ZodCheckRegex",(e,t)=>{jn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mf=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ws),jn.init(e,t)}),qf=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Xs),jn.init(e,t)}),Lf=p("$ZodCheckIncludes",(e,t)=>{se.init(e,t);let r=He(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Vf=p("$ZodCheckStartsWith",(e,t)=>{se.init(e,t);let r=new RegExp(`^${He(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ff=p("$ZodCheckEndsWith",(e,t)=>{se.init(e,t);let r=new RegExp(`.*${He(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Pf(e,t,r){e.issues.length&&t.issues.push(...Ve(r,e.issues))}var Jf=p("$ZodCheckProperty",(e,t)=>{se.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>Pf(i,r,t.property));Pf(n,r,t.property)}}),Kf=p("$ZodCheckMimeType",(e,t)=>{se.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),Bf=p("$ZodCheckOverwrite",(e,t)=>{se.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var oo=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
10
|
-
`).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),o=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let t=Function,r=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,i.join(`
|
|
11
|
-
`))}};var Hf={major:4,minor:3,patch:6};var M=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Hf;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let o of i._zod.onattach)o(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(a,s,c)=>{let u=qt(a),l;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(u)continue;let m=a.issues.length,f=d._zod.check(a);if(f instanceof Promise&&c?.async===!1)throw new mt;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(u||(u=qt(a,m)))});else{if(a.issues.length===m)continue;u||(u=qt(a,m))}}return l?l.then(()=>a):a},o=(a,s,c)=>{if(qt(a))return a.aborted=!0,a;let u=i(s,n,c);if(u instanceof Promise){if(c.async===!1)throw new mt;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(l=>o(l,a,s)):o(u,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new mt;return c.then(u=>i(u,n,s))}return i(c,n,s)}}L(e,"~standard",()=>({validate:i=>{try{let o=wr(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return In(e,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),ar=p("$ZodString",(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Fs(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ie=p("$ZodStringFormat",(e,t)=>{jn.init(e,t),ar.init(e,t)}),tc=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Os),ie.init(e,t)}),rc=p("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=or(n))}else t.pattern??(t.pattern=or());ie.init(e,t)}),nc=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Es),ie.init(e,t)}),ic=p("$ZodURL",(e,t)=>{ie.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),oc=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ns()),ie.init(e,t)}),ac=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ts),ie.init(e,t)}),sc=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ss),ie.init(e,t)}),cc=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ws),ie.init(e,t)}),uc=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=zs),ie.init(e,t)}),lc=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Is),ie.init(e,t)}),dc=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ps),ie.init(e,t)}),pc=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Vs(t)),ie.init(e,t)}),fc=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qs),ie.init(e,t)}),mc=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ls(t)),ie.init(e,t)}),hc=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=js),ie.init(e,t)}),gc=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ds),ie.init(e,t),e._zod.bag.format="ipv4"}),vc=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Zs),ie.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),yc=p("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Rs(t.delimiter)),ie.init(e,t),e._zod.bag.format="mac"}),_c=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Us),ie.init(e,t)}),$c=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=As),ie.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function sm(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var bc=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Cs),ie.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{sm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function _$(e){if(!no.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return sm(r)}var xc=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=no),ie.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{_$(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),kc=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ms),ie.init(e,t)});function $$(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}var Sc=p("$ZodJWT",(e,t)=>{ie.init(e,t),e._zod.check=r=>{$$(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),wc=p("$ZodCustomStringFormat",(e,t)=>{ie.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),po=p("$ZodNumber",(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??io,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),zc=p("$ZodNumberFormat",(e,t)=>{Of.init(e,t),po.init(e,t)}),On=p("$ZodBoolean",(e,t)=>{M.init(e,t),e._zod.pattern=Bs,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),fo=p("$ZodBigInt",(e,t)=>{M.init(e,t),e._zod.pattern=Js,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Ic=p("$ZodBigIntFormat",(e,t)=>{Ef.init(e,t),fo.init(e,t)}),Pc=p("$ZodSymbol",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),r}}),Tc=p("$ZodUndefined",(e,t)=>{M.init(e,t),e._zod.pattern=Hs,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),r}}),jc=p("$ZodNull",(e,t)=>{M.init(e,t),e._zod.pattern=Gs,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),Oc=p("$ZodAny",(e,t)=>{M.init(e,t),e._zod.parse=r=>r}),Ec=p("$ZodUnknown",(e,t)=>{M.init(e,t),e._zod.parse=r=>r}),Nc=p("$ZodNever",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Dc=p("$ZodVoid",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Zc=p("$ZodDate",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),r}});function Wf(e,t,r){e.issues.length&&t.issues.push(...Ve(r,e.issues)),t.value[r]=e.value}var Rc=p("$ZodArray",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let o=[];for(let a=0;a<i.length;a++){let s=i[a],c=t.element._zod.run({value:s,issues:[]},n);c instanceof Promise?o.push(c.then(u=>Wf(u,r,a))):Wf(c,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function lo(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ve(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function cm(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bs(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function um(e,t,r,n,i,o){let a=[],s=i.keySet,c=i.catchall._zod,u=c.def.type,l=c.optout==="optional";for(let d in t){if(s.has(d))continue;if(u==="never"){a.push(d);continue}let m=c.run({value:t[d],issues:[]},n);m instanceof Promise?e.push(m.then(f=>lo(f,r,d,t,l))):lo(m,r,d,t,l)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}var lm=p("$ZodObject",(e,t)=>{if(M.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let n=kr(()=>cm(t));L(e._zod,"propValues",()=>{let s=t.shape,c={};for(let u in s){let l=s[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let i=ir,o=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=n.value);let u=s.value;if(!i(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let l=[],d=a.shape;for(let m of a.keys){let f=d[m],g=f._zod.optout==="optional",v=f._zod.run({value:u[m],issues:[]},c);v instanceof Promise?l.push(v.then($=>lo($,s,m,u,g))):lo(v,s,m,u,g)}return o?um(l,u,s,c,n.value,e):l.length?Promise.all(l).then(()=>s):s}}),dm=p("$ZodObjectJIT",(e,t)=>{lm.init(e,t);let r=e._zod.parse,n=kr(()=>cm(t)),i=m=>{let f=new oo(["shape","payload","ctx"]),g=n.value,v=P=>{let A=Yi(P);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};f.write("const input = payload.value;");let $=Object.create(null),k=0;for(let P of g.keys)$[P]=`key_${k++}`;f.write("const newResult = {};");for(let P of g.keys){let A=$[P],O=Yi(P),ot=m[P]?._zod?.optout==="optional";f.write(`const ${A} = ${v(P)};`),ot?f.write(`
|
|
12
|
-
if (${A}.issues.length) {
|
|
13
|
-
if (${O} in input) {
|
|
14
|
-
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
15
|
-
...iss,
|
|
16
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
17
|
-
})));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (${A}.value === undefined) {
|
|
22
|
-
if (${O} in input) {
|
|
23
|
-
newResult[${O}] = undefined;
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
newResult[${O}] = ${A}.value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
`):f.write(`
|
|
30
|
-
if (${A}.issues.length) {
|
|
31
|
-
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
32
|
-
...iss,
|
|
33
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (${A}.value === undefined) {
|
|
38
|
-
if (${O} in input) {
|
|
39
|
-
newResult[${O}] = undefined;
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
newResult[${O}] = ${A}.value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let E=f.compile();return(P,A)=>E(m,P,A)},o,a=ir,s=!Xi.jitless,u=s&&ys.value,l=t.catchall,d;e._zod.parse=(m,f)=>{d??(d=n.value);let g=m.value;return a(g)?s&&u&&f?.async===!1&&f.jitless!==!0?(o||(o=i(t.shape)),m=o(m,f),l?um([],g,m,f,d,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m)}});function Xf(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter(o=>!qt(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(a=>Ae(a,n,ye())))}),t)}var En=p("$ZodUnion",(e,t)=>{M.init(e,t),L(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),L(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),L(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),L(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>gn(o.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(r)return n(i,o);let a=!1,s=[];for(let c of t.options){let u=c._zod.run({value:i.value,issues:[]},o);if(u instanceof Promise)s.push(u),a=!0;else{if(u.issues.length===0)return u;s.push(u)}}return a?Promise.all(s).then(c=>Xf(c,i,e,o)):Xf(s,i,e,o)}});function Yf(e,t,r,n){let i=e.filter(o=>o.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(a=>Ae(a,n,ye())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Uc=p("$ZodXor",(e,t)=>{En.init(e,t),t.inclusive=!1;let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(r)return n(i,o);let a=!1,s=[];for(let c of t.options){let u=c._zod.run({value:i.value,issues:[]},o);u instanceof Promise?(s.push(u),a=!0):s.push(u)}return a?Promise.all(s).then(c=>Yf(c,i,e,o)):Yf(s,i,e,o)}}),Ac=p("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,En.init(e,t);let r=e._zod.parse;L(e._zod,"propValues",()=>{let i={};for(let o of t.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[s,c]of Object.entries(a)){i[s]||(i[s]=new Set);for(let u of c)i[s].add(u)}}return i});let n=kr(()=>{let i=t.options,o=new Map;for(let a of i){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,a)}}return o});e._zod.parse=(i,o)=>{let a=i.value;if(!ir(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=n.value.get(a?.[t.discriminator]);return s?s._zod.run(i,o):t.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),i)}}),Cc=p("$ZodIntersection",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let i=r.value,o=t.left._zod.run({value:i,issues:[]},n),a=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,u])=>Qf(r,c,u)):Qf(r,o,a)}});function ec(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Mt(e)&&Mt(t)){let r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),i={...e,...t};for(let o of n){let a=ec(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=t[n],a=ec(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Qf(e,t,r){let n=new Map,i;for(let s of t.issues)if(s.code==="unrecognized_keys"){i??(i=s);for(let c of s.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(s);let o=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&i&&e.issues.push({...i,keys:o}),qt(e))return e;let a=ec(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var mo=p("$ZodTuple",(e,t)=>{M.init(e,t);let r=t.items;e._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let a=[],s=[...r].reverse().findIndex(l=>l._zod.optin!=="optional"),c=s===-1?0:r.length-s;if(!t.rest){let l=o.length>r.length,d=o.length<c-1;if(l||d)return n.issues.push({...l?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:e,origin:"array"}),n}let u=-1;for(let l of r){if(u++,u>=o.length&&u>=c)continue;let d=l._zod.run({value:o[u],issues:[]},i);d instanceof Promise?a.push(d.then(m=>ao(m,n,u))):ao(d,n,u)}if(t.rest){let l=o.slice(r.length);for(let d of l){u++;let m=t.rest._zod.run({value:d,issues:[]},i);m instanceof Promise?a.push(m.then(f=>ao(f,n,u))):ao(m,n,u)}}return a.length?Promise.all(a).then(()=>n):n}});function ao(e,t,r){e.issues.length&&t.issues.push(...Ve(r,e.issues)),t.value[r]=e.value}var Mc=p("$ZodRecord",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Mt(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let o=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let l=t.valueType._zod.run({value:i[u],issues:[]},n);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...Ve(u,d.issues)),r.value[u]=d.value})):(l.issues.length&&r.issues.push(...Ve(u,l.issues)),r.value[u]=l.value)}let c;for(let u in i)s.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{r.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__")continue;let c=t.keyType._zod.run({value:s,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&io.test(s)&&c.issues.length){let d=t.keyType._zod.run({value:Number(s),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){t.mode==="loose"?r.value[s]=i[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Ae(d,n,ye())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},n);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...Ve(s,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Ve(s,l.issues)),r.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>r):r}}),qc=p("$ZodMap",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let o=[];r.value=new Map;for(let[a,s]of i){let c=t.keyType._zod.run({value:a,issues:[]},n),u=t.valueType._zod.run({value:s,issues:[]},n);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([l,d])=>{em(l,d,r,a,i,e,n)})):em(c,u,r,a,i,e,n)}return o.length?Promise.all(o).then(()=>r):r}});function em(e,t,r,n,i,o,a){e.issues.length&&(vn.has(typeof n)?r.issues.push(...Ve(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(s=>Ae(s,a,ye()))})),t.issues.length&&(vn.has(typeof n)?r.issues.push(...Ve(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:t.issues.map(s=>Ae(s,a,ye()))})),r.value.set(e.value,t.value)}var Lc=p("$ZodSet",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let a of i){let s=t.valueType._zod.run({value:a,issues:[]},n);s instanceof Promise?o.push(s.then(c=>tm(c,r))):tm(s,r)}return o.length?Promise.all(o).then(()=>r):r}});function tm(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Vc=p("$ZodEnum",(e,t)=>{M.init(e,t);let r=hn(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>vn.has(typeof i)).map(i=>typeof i=="string"?He(i):i.toString()).join("|")})$`),e._zod.parse=(i,o)=>{let a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:r,input:a,inst:e}),i}}),Fc=p("$ZodLiteral",(e,t)=>{if(M.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?He(n):n?He(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),Jc=p("$ZodFile",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),r}}),Kc=p("$ZodTransform",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new nr(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(r.value=a,r));if(i instanceof Promise)throw new mt;return r.value=i,r}});function rm(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var ho=p("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",L(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),L(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>rm(o,r.value)):rm(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Bc=p("$ZodExactOptional",(e,t)=>{ho.init(e,t),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Gc=p("$ZodNullable",(e,t)=>{M.init(e,t),L(e._zod,"optin",()=>t.innerType._zod.optin),L(e._zod,"optout",()=>t.innerType._zod.optout),L(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gn(r.source)}|null)$`):void 0}),L(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Hc=p("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>nm(o,t)):nm(i,t)}});function nm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Wc=p("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Xc=p("$ZodNonOptional",(e,t)=>{M.init(e,t),L(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>im(o,e)):im(i,e)}});function im(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Yc=p("$ZodSuccess",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new nr("ZodSuccess");let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),Qc=p("$ZodCatch",(e,t)=>{M.init(e,t),L(e._zod,"optin",()=>t.innerType._zod.optin),L(e._zod,"optout",()=>t.innerType._zod.optout),L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>Ae(a,n,ye()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(o=>Ae(o,n,ye()))},input:r.value}),r.issues=[]),r)}}),eu=p("$ZodNaN",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),tu=p("$ZodPipe",(e,t)=>{M.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=t.out._zod.run(r,n);return o instanceof Promise?o.then(a=>so(a,t.in,n)):so(o,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(o=>so(o,t.out,n)):so(i,t.out,n)}});function so(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Nn=p("$ZodCodec",(e,t)=>{M.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>co(a,t,n)):co(o,t,n)}else{let o=t.out._zod.run(r,n);return o instanceof Promise?o.then(a=>co(a,t,n)):co(o,t,n)}}});function co(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>uo(e,o,t.out,r)):uo(e,i,t.out,r)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>uo(e,o,t.in,r)):uo(e,i,t.in,r)}}function uo(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}var ru=p("$ZodReadonly",(e,t)=>{M.init(e,t),L(e._zod,"propValues",()=>t.innerType._zod.propValues),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"optin",()=>t.innerType?._zod?.optin),L(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(om):om(i)}});function om(e){return e.value=Object.freeze(e.value),e}var nu=p("$ZodTemplateLiteral",(e,t)=>{M.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(o,a))}else if(n===null||$s.has(typeof n))r.push(He(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),iu=p("$ZodFunction",(e,t)=>(M.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=e._def.input?xn(e._def.input,n):n,o=Reflect.apply(r,this,i);return e._def.output?xn(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=e._def.input?await Sn(e._def.input,n):n,o=await Reflect.apply(r,this,i);return e._def.output?await Sn(e._def.output,o):o}},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new mo({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),ou=p("$ZodPromise",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>t.innerType._zod.run({value:i,issues:[]},n))}),au=p("$ZodLazy",(e,t)=>{M.init(e,t),L(e._zod,"innerType",()=>t.getter()),L(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),L(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),L(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),L(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),su=p("$ZodCustom",(e,t)=>{se.init(e,t),M.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(o=>am(o,r,n,e));am(i,r,n,e)}});function am(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(Sr(i))}}var x$=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=R(i.input),s=n[a]??a;return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Z(i.values[0])}`:`Invalid option: expected one of ${D(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${D(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function cu(){return{localeError:x$()}}var pm,fm=Symbol("ZodOutput"),mm=Symbol("ZodInput"),lu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function du(){return new lu}(pm=globalThis).__zod_globalRegistry??(pm.__zod_globalRegistry=du());var Ee=globalThis.__zod_globalRegistry;function pu(e,t){return new e({type:"string",...b(t)})}function go(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(t)})}function Dn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(t)})}function vo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(t)})}function yo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(t)})}function _o(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(t)})}function $o(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(t)})}function Zn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(t)})}function bo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(t)})}function xo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(t)})}function ko(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(t)})}function So(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(t)})}function wo(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(t)})}function zo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(t)})}function Io(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(t)})}function Po(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(t)})}function To(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(t)})}function fu(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...b(t)})}function jo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(t)})}function Oo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(t)})}function Eo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(t)})}function No(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(t)})}function Do(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(t)})}function Zo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(t)})}function mu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(t)})}function hu(e,t){return new e({type:"string",format:"date",check:"string_format",...b(t)})}function gu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(t)})}function vu(e,t){return new e({type:"string",format:"duration",check:"string_format",...b(t)})}function yu(e,t){return new e({type:"number",checks:[],...b(t)})}function _u(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...b(t)})}function $u(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...b(t)})}function bu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...b(t)})}function xu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...b(t)})}function ku(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...b(t)})}function Su(e,t){return new e({type:"boolean",...b(t)})}function wu(e,t){return new e({type:"bigint",...b(t)})}function zu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...b(t)})}function Iu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...b(t)})}function Pu(e,t){return new e({type:"symbol",...b(t)})}function Tu(e,t){return new e({type:"undefined",...b(t)})}function ju(e,t){return new e({type:"null",...b(t)})}function Ou(e){return new e({type:"any"})}function Eu(e){return new e({type:"unknown"})}function Nu(e,t){return new e({type:"never",...b(t)})}function Du(e,t){return new e({type:"void",...b(t)})}function Zu(e,t){return new e({type:"date",...b(t)})}function Ru(e,t){return new e({type:"nan",...b(t)})}function St(e,t){return new Ys({check:"less_than",...b(t),value:e,inclusive:!1})}function Fe(e,t){return new Ys({check:"less_than",...b(t),value:e,inclusive:!0})}function wt(e,t){return new Qs({check:"greater_than",...b(t),value:e,inclusive:!1})}function Ne(e,t){return new Qs({check:"greater_than",...b(t),value:e,inclusive:!0})}function Uu(e){return wt(0,e)}function Au(e){return St(0,e)}function Cu(e){return Fe(0,e)}function Mu(e){return Ne(0,e)}function sr(e,t){return new jf({check:"multiple_of",...b(t),value:e})}function cr(e,t){return new Nf({check:"max_size",...b(t),maximum:e})}function zt(e,t){return new Df({check:"min_size",...b(t),minimum:e})}function zr(e,t){return new Zf({check:"size_equals",...b(t),size:e})}function Ir(e,t){return new Rf({check:"max_length",...b(t),maximum:e})}function Lt(e,t){return new Uf({check:"min_length",...b(t),minimum:e})}function Pr(e,t){return new Af({check:"length_equals",...b(t),length:e})}function Rn(e,t){return new Cf({check:"string_format",format:"regex",...b(t),pattern:e})}function Un(e){return new Mf({check:"string_format",format:"lowercase",...b(e)})}function An(e){return new qf({check:"string_format",format:"uppercase",...b(e)})}function Cn(e,t){return new Lf({check:"string_format",format:"includes",...b(t),includes:e})}function Mn(e,t){return new Vf({check:"string_format",format:"starts_with",...b(t),prefix:e})}function qn(e,t){return new Ff({check:"string_format",format:"ends_with",...b(t),suffix:e})}function qu(e,t,r){return new Jf({check:"property",property:e,schema:t,...b(r)})}function Ln(e,t){return new Kf({check:"mime_type",mime:e,...b(t)})}function ht(e){return new Bf({check:"overwrite",tx:e})}function Vn(e){return ht(t=>t.normalize(e))}function Fn(){return ht(e=>e.trim())}function Jn(){return ht(e=>e.toLowerCase())}function Kn(){return ht(e=>e.toUpperCase())}function Ro(){return ht(e=>vs(e))}function hm(e,t,r){return new e({type:"array",element:t,...b(r)})}function Lu(e,t){return new e({type:"file",...b(t)})}function Vu(e,t,r){let n=b(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Fu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...b(r)})}function Ju(e){let t=z$(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Sr(n,r.value,t._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),r.issues.push(Sr(i))}},e(r.value,r)));return t}function z$(e,t){let r=new se({check:"custom",...b(t)});return r._zod.check=e,r}function Ku(e){let t=new se({check:"describe"});return t._zod.onattach=[r=>{let n=Ee.get(r)??{};Ee.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function Bu(e){let t=new se({check:"meta"});return t._zod.onattach=[r=>{let n=Ee.get(r)??{};Ee.add(r,{...n,...e})}],t._zod.check=()=>{},t}function Gu(e,t){let r=b(t),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(f=>typeof f=="string"?f.toLowerCase():f),i=i.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(n),a=new Set(i),s=e.Codec??Nn,c=e.Boolean??On,u=e.String??ar,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),m=new s({type:"pipe",in:l,out:d,transform:((f,g)=>{let v=f;return r.case!=="sensitive"&&(v=v.toLowerCase()),o.has(v)?!0:a.has(v)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?n[0]||"true":i[0]||"false"),error:r.error});return m}function Tr(e,t,r,n={}){let i=b(n),o={...b(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...i};return r instanceof RegExp&&(o.pattern=r),new e(o)}function Uo(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ee,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function de(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,l);else{let m=a.schema,f=t.processors[i.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);f(e,t,m,l)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),de(d,t,l),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&De(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Ao(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=n.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,a[0])}}let i=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,m=e.external.uri??(g=>g);if(d)return{ref:m(d)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let u=`#/${s}/`,l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=i(a);s.def={...s.schema},u&&(s.defId=u);let l=s.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
46
|
-
|
|
47
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){o(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&e.reused==="ref"){o(a);continue}}}function Co(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let s=e.seen.get(a);if(s.ref===null)return;let c=s.def??s.schema,u={...c},l=s.ref;if(s.ref=null,l){n(l);let m=e.seen.get(l),f=m.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(f)):Object.assign(c,f),Object.assign(c,u),a._zod.parent===l)for(let v in c)v==="$ref"||v==="allOf"||v in u||delete c[v];if(f.$ref&&m.def)for(let v in c)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(c[v])===JSON.stringify(m.def[v])&&delete c[v]}let d=a._zod.parent;if(d&&d!==l){n(d);let m=e.seen.get(d);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(let f in c)f==="$ref"||f==="allOf"||f in m.def&&JSON.stringify(c[f])===JSON.stringify(m.def[f])&&delete c[f]}e.override({zodSchema:a,jsonSchema:c,path:s.path??[]})};for(let a of[...e.seen.entries()].reverse())n(a[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}Object.assign(i,r.def??r.schema);let o=e.external?.defs??{};for(let a of e.seen.entries()){let s=a[1];s.def&&s.defId&&(o[s.defId]=s.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bn(t,"input",e.processors),output:Bn(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function De(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return De(n.element,r);if(n.type==="set")return De(n.valueType,r);if(n.type==="lazy")return De(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return De(n.innerType,r);if(n.type==="intersection")return De(n.left,r)||De(n.right,r);if(n.type==="record"||n.type==="map")return De(n.keyType,r)||De(n.valueType,r);if(n.type==="pipe")return De(n.in,r)||De(n.out,r);if(n.type==="object"){for(let i in n.shape)if(De(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(De(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(De(i,r))return!0;return!!(n.rest&&De(n.rest,r))}return!1}var gm=(e,t={})=>r=>{let n=Uo({...r,processors:t});return de(e,n),Ao(n,e),Co(n,e)},Bn=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},a=Uo({...i??{},target:o,io:t,processors:r});return de(e,a),Ao(a,e),Co(a,e)};var I$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vm=(e,t,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),s&&(i.format=I$[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?i.pattern=l[0].source:l.length>1&&(i.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ym=(e,t,r,n)=>{let i=r,{minimum:o,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l),typeof o=="number"&&(i.minimum=o,typeof l=="number"&&t.target!=="draft-04"&&(l>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof a=="number"&&(i.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},_m=(e,t,r,n)=>{r.type="boolean"},$m=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},bm=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},xm=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},km=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Sm=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},wm=(e,t,r,n)=>{r.not={}},zm=(e,t,r,n)=>{},Im=(e,t,r,n)=>{},Pm=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Tm=(e,t,r,n)=>{let i=e._zod.def,o=hn(i.entries);o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},jm=(e,t,r,n)=>{let i=e._zod.def,o=[];for(let a of i.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},Om=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Em=(e,t,r,n)=>{let i=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},Nm=(e,t,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(i,o)},Dm=(e,t,r,n)=>{r.type="boolean"},Zm=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Rm=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Um=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Am=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Cm=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Mm=(e,t,r,n)=>{let i=r,o=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(i.minItems=a),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=de(o.element,t,{...n,path:[...n.path,"items"]})},qm=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object",i.properties={};let a=o.shape;for(let u in a)i.properties[u]=de(a[u],t,{...n,path:[...n.path,"properties",u]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(u=>{let l=o.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=de(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Hu=(e,t,r,n)=>{let i=e._zod.def,o=i.inclusive===!1,a=i.options.map((s,c)=>de(s,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=a:r.anyOf=a},Lm=(e,t,r,n)=>{let i=e._zod.def,o=de(i.left,t,{...n,path:[...n.path,"allOf",0]}),a=de(i.right,t,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];r.allOf=c},Vm=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((m,f)=>de(m,t,{...n,path:[...n.path,a,f]})),u=o.rest?de(o.rest,t,{...n,path:[...n.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=c,u&&(i.items=u)):t.target==="openapi-3.0"?(i.items={anyOf:c},u&&i.items.anyOf.push(u),i.minItems=c.length,u||(i.maxItems=c.length)):(i.items=c,u&&(i.additionalItems=u));let{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof d=="number"&&(i.maxItems=d)},Fm=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object";let a=o.keyType,c=a._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let l=de(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=de(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=de(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let u=a._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(i.required=l)}},Jm=(e,t,r,n)=>{let i=e._zod.def,o=de(i.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Km=(e,t,r,n)=>{let i=e._zod.def;de(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Bm=(e,t,r,n)=>{let i=e._zod.def;de(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},Gm=(e,t,r,n)=>{let i=e._zod.def;de(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Hm=(e,t,r,n)=>{let i=e._zod.def;de(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Wm=(e,t,r,n)=>{let i=e._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;de(o,t,n);let a=t.seen.get(e);a.ref=o},Xm=(e,t,r,n)=>{let i=e._zod.def;de(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.readOnly=!0},Ym=(e,t,r,n)=>{let i=e._zod.def;de(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Wu=(e,t,r,n)=>{let i=e._zod.def;de(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Qm=(e,t,r,n)=>{let i=e._zod.innerType;de(i,t,n);let o=t.seen.get(e);o.ref=i};var Gn={};fn(Gn,{ZodAny:()=>vh,ZodArray:()=>bh,ZodBase64:()=>$l,ZodBase64URL:()=>bl,ZodBigInt:()=>Go,ZodBigIntFormat:()=>Sl,ZodBoolean:()=>Bo,ZodCIDRv4:()=>yl,ZodCIDRv6:()=>_l,ZodCUID:()=>dl,ZodCUID2:()=>pl,ZodCatch:()=>qh,ZodCodec:()=>Ol,ZodCustom:()=>Qo,ZodCustomStringFormat:()=>Wn,ZodDate:()=>zl,ZodDefault:()=>Zh,ZodDiscriminatedUnion:()=>kh,ZodE164:()=>xl,ZodEmail:()=>cl,ZodEmoji:()=>ul,ZodEnum:()=>Hn,ZodExactOptional:()=>Eh,ZodFile:()=>jh,ZodFunction:()=>Wh,ZodGUID:()=>qo,ZodIPv4:()=>gl,ZodIPv6:()=>vl,ZodIntersection:()=>Sh,ZodJWT:()=>kl,ZodKSUID:()=>hl,ZodLazy:()=>Bh,ZodLiteral:()=>Th,ZodMAC:()=>fh,ZodMap:()=>Ih,ZodNaN:()=>Vh,ZodNanoID:()=>ll,ZodNever:()=>_h,ZodNonOptional:()=>Tl,ZodNull:()=>gh,ZodNullable:()=>Dh,ZodNumber:()=>Ko,ZodNumberFormat:()=>jr,ZodObject:()=>Ho,ZodOptional:()=>Pl,ZodPipe:()=>jl,ZodPrefault:()=>Uh,ZodPromise:()=>Hh,ZodReadonly:()=>Fh,ZodRecord:()=>Yo,ZodSet:()=>Ph,ZodString:()=>Fo,ZodStringFormat:()=>ce,ZodSuccess:()=>Mh,ZodSymbol:()=>mh,ZodTemplateLiteral:()=>Kh,ZodTransform:()=>Oh,ZodTuple:()=>wh,ZodType:()=>V,ZodULID:()=>fl,ZodURL:()=>Jo,ZodUUID:()=>It,ZodUndefined:()=>hh,ZodUnion:()=>Wo,ZodUnknown:()=>yh,ZodVoid:()=>$h,ZodXID:()=>ml,ZodXor:()=>xh,_ZodString:()=>sl,_default:()=>Rh,_function:()=>Ob,any:()=>fb,array:()=>H,base64:()=>W$,base64url:()=>X$,bigint:()=>cb,boolean:()=>ve,catch:()=>Lh,check:()=>Eb,cidrv4:()=>G$,cidrv6:()=>H$,codec:()=>Pb,cuid:()=>M$,cuid2:()=>q$,custom:()=>El,date:()=>hb,describe:()=>Nb,discriminatedUnion:()=>Xo,e164:()=>Y$,email:()=>j$,emoji:()=>A$,enum:()=>ze,exactOptional:()=>Nh,file:()=>Sb,float32:()=>ib,float64:()=>ob,function:()=>Ob,guid:()=>O$,hash:()=>nb,hex:()=>rb,hostname:()=>tb,httpUrl:()=>U$,instanceof:()=>Zb,int:()=>al,int32:()=>ab,int64:()=>ub,intersection:()=>Yn,ipv4:()=>J$,ipv6:()=>B$,json:()=>Ub,jwt:()=>Q$,keyof:()=>gb,ksuid:()=>F$,lazy:()=>Gh,literal:()=>T,looseObject:()=>we,looseRecord:()=>$b,mac:()=>K$,map:()=>bb,meta:()=>Db,nan:()=>Ib,nanoid:()=>C$,nativeEnum:()=>kb,never:()=>wl,nonoptional:()=>Ch,null:()=>Xn,nullable:()=>Lo,nullish:()=>wb,number:()=>ne,object:()=>w,optional:()=>fe,partialRecord:()=>_b,pipe:()=>Vo,prefault:()=>Ah,preprocess:()=>ea,promise:()=>jb,readonly:()=>Jh,record:()=>pe,refine:()=>Xh,set:()=>xb,strictObject:()=>vb,string:()=>h,stringFormat:()=>eb,stringbool:()=>Rb,success:()=>zb,superRefine:()=>Yh,symbol:()=>db,templateLiteral:()=>Tb,transform:()=>Il,tuple:()=>zh,uint32:()=>sb,uint64:()=>lb,ulid:()=>L$,undefined:()=>pb,union:()=>oe,unknown:()=>ue,url:()=>R$,uuid:()=>E$,uuidv4:()=>N$,uuidv6:()=>D$,uuidv7:()=>Z$,void:()=>mb,xid:()=>V$,xor:()=>yb});var Mo={};fn(Mo,{endsWith:()=>qn,gt:()=>wt,gte:()=>Ne,includes:()=>Cn,length:()=>Pr,lowercase:()=>Un,lt:()=>St,lte:()=>Fe,maxLength:()=>Ir,maxSize:()=>cr,mime:()=>Ln,minLength:()=>Lt,minSize:()=>zt,multipleOf:()=>sr,negative:()=>Au,nonnegative:()=>Mu,nonpositive:()=>Cu,normalize:()=>Vn,overwrite:()=>ht,positive:()=>Uu,property:()=>qu,regex:()=>Rn,size:()=>zr,slugify:()=>Ro,startsWith:()=>Mn,toLowerCase:()=>Jn,toUpperCase:()=>Kn,trim:()=>Fn,uppercase:()=>An});var ur={};fn(ur,{ZodISODate:()=>el,ZodISODateTime:()=>Yu,ZodISODuration:()=>il,ZodISOTime:()=>rl,date:()=>tl,datetime:()=>Qu,duration:()=>ol,time:()=>nl});var Yu=p("ZodISODateTime",(e,t)=>{pc.init(e,t),ce.init(e,t)});function Qu(e){return mu(Yu,e)}var el=p("ZodISODate",(e,t)=>{fc.init(e,t),ce.init(e,t)});function tl(e){return hu(el,e)}var rl=p("ZodISOTime",(e,t)=>{mc.init(e,t),ce.init(e,t)});function nl(e){return gu(rl,e)}var il=p("ZodISODuration",(e,t)=>{hc.init(e,t),ce.init(e,t)});function ol(e){return vu(il,e)}var eh=(e,t)=>{eo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ro(e,r)},flatten:{value:r=>to(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,xr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,xr,2)}},isEmpty:{get(){return e.issues.length===0}}})},bE=p("ZodError",eh),Je=p("ZodError",eh,{Parent:Error});var th=bn(Je),rh=kn(Je),nh=wn(Je),ih=zn(Je),oh=vf(Je),ah=yf(Je),sh=_f(Je),ch=$f(Je),uh=bf(Je),lh=xf(Je),dh=kf(Je),ph=Sf(Je);var V=p("ZodType",(e,t)=>(M.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bn(e,"input"),output:Bn(e,"output")}}),e.toJSONSchema=gm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(_.mergeDefs(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>Oe(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>th(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nh(e,r,n),e.parseAsync=async(r,n)=>rh(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ih(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>oh(e,r,n),e.decode=(r,n)=>ah(e,r,n),e.encodeAsync=async(r,n)=>sh(e,r,n),e.decodeAsync=async(r,n)=>ch(e,r,n),e.safeEncode=(r,n)=>uh(e,r,n),e.safeDecode=(r,n)=>lh(e,r,n),e.safeEncodeAsync=async(r,n)=>dh(e,r,n),e.safeDecodeAsync=async(r,n)=>ph(e,r,n),e.refine=(r,n)=>e.check(Xh(r,n)),e.superRefine=r=>e.check(Yh(r)),e.overwrite=r=>e.check(ht(r)),e.optional=()=>fe(e),e.exactOptional=()=>Nh(e),e.nullable=()=>Lo(e),e.nullish=()=>fe(Lo(e)),e.nonoptional=r=>Ch(e,r),e.array=()=>H(e),e.or=r=>oe([e,r]),e.and=r=>Yn(e,r),e.transform=r=>Vo(e,Il(r)),e.default=r=>Rh(e,r),e.prefault=r=>Ah(e,r),e.catch=r=>Lh(e,r),e.pipe=r=>Vo(e,r),e.readonly=()=>Jh(e),e.describe=r=>{let n=e.clone();return Ee.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ee.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ee.get(e);let n=e.clone();return Ee.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),sl=p("_ZodString",(e,t)=>{ar.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>vm(e,n,i,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Rn(...n)),e.includes=(...n)=>e.check(Cn(...n)),e.startsWith=(...n)=>e.check(Mn(...n)),e.endsWith=(...n)=>e.check(qn(...n)),e.min=(...n)=>e.check(Lt(...n)),e.max=(...n)=>e.check(Ir(...n)),e.length=(...n)=>e.check(Pr(...n)),e.nonempty=(...n)=>e.check(Lt(1,...n)),e.lowercase=n=>e.check(Un(n)),e.uppercase=n=>e.check(An(n)),e.trim=()=>e.check(Fn()),e.normalize=(...n)=>e.check(Vn(...n)),e.toLowerCase=()=>e.check(Jn()),e.toUpperCase=()=>e.check(Kn()),e.slugify=()=>e.check(Ro())}),Fo=p("ZodString",(e,t)=>{ar.init(e,t),sl.init(e,t),e.email=r=>e.check(go(cl,r)),e.url=r=>e.check(Zn(Jo,r)),e.jwt=r=>e.check(Zo(kl,r)),e.emoji=r=>e.check(bo(ul,r)),e.guid=r=>e.check(Dn(qo,r)),e.uuid=r=>e.check(vo(It,r)),e.uuidv4=r=>e.check(yo(It,r)),e.uuidv6=r=>e.check(_o(It,r)),e.uuidv7=r=>e.check($o(It,r)),e.nanoid=r=>e.check(xo(ll,r)),e.guid=r=>e.check(Dn(qo,r)),e.cuid=r=>e.check(ko(dl,r)),e.cuid2=r=>e.check(So(pl,r)),e.ulid=r=>e.check(wo(fl,r)),e.base64=r=>e.check(Eo($l,r)),e.base64url=r=>e.check(No(bl,r)),e.xid=r=>e.check(zo(ml,r)),e.ksuid=r=>e.check(Io(hl,r)),e.ipv4=r=>e.check(Po(gl,r)),e.ipv6=r=>e.check(To(vl,r)),e.cidrv4=r=>e.check(jo(yl,r)),e.cidrv6=r=>e.check(Oo(_l,r)),e.e164=r=>e.check(Do(xl,r)),e.datetime=r=>e.check(Qu(r)),e.date=r=>e.check(tl(r)),e.time=r=>e.check(nl(r)),e.duration=r=>e.check(ol(r))});function h(e){return pu(Fo,e)}var ce=p("ZodStringFormat",(e,t)=>{ie.init(e,t),sl.init(e,t)}),cl=p("ZodEmail",(e,t)=>{nc.init(e,t),ce.init(e,t)});function j$(e){return go(cl,e)}var qo=p("ZodGUID",(e,t)=>{tc.init(e,t),ce.init(e,t)});function O$(e){return Dn(qo,e)}var It=p("ZodUUID",(e,t)=>{rc.init(e,t),ce.init(e,t)});function E$(e){return vo(It,e)}function N$(e){return yo(It,e)}function D$(e){return _o(It,e)}function Z$(e){return $o(It,e)}var Jo=p("ZodURL",(e,t)=>{ic.init(e,t),ce.init(e,t)});function R$(e){return Zn(Jo,e)}function U$(e){return Zn(Jo,{protocol:/^https?$/,hostname:We.domain,..._.normalizeParams(e)})}var ul=p("ZodEmoji",(e,t)=>{oc.init(e,t),ce.init(e,t)});function A$(e){return bo(ul,e)}var ll=p("ZodNanoID",(e,t)=>{ac.init(e,t),ce.init(e,t)});function C$(e){return xo(ll,e)}var dl=p("ZodCUID",(e,t)=>{sc.init(e,t),ce.init(e,t)});function M$(e){return ko(dl,e)}var pl=p("ZodCUID2",(e,t)=>{cc.init(e,t),ce.init(e,t)});function q$(e){return So(pl,e)}var fl=p("ZodULID",(e,t)=>{uc.init(e,t),ce.init(e,t)});function L$(e){return wo(fl,e)}var ml=p("ZodXID",(e,t)=>{lc.init(e,t),ce.init(e,t)});function V$(e){return zo(ml,e)}var hl=p("ZodKSUID",(e,t)=>{dc.init(e,t),ce.init(e,t)});function F$(e){return Io(hl,e)}var gl=p("ZodIPv4",(e,t)=>{gc.init(e,t),ce.init(e,t)});function J$(e){return Po(gl,e)}var fh=p("ZodMAC",(e,t)=>{yc.init(e,t),ce.init(e,t)});function K$(e){return fu(fh,e)}var vl=p("ZodIPv6",(e,t)=>{vc.init(e,t),ce.init(e,t)});function B$(e){return To(vl,e)}var yl=p("ZodCIDRv4",(e,t)=>{_c.init(e,t),ce.init(e,t)});function G$(e){return jo(yl,e)}var _l=p("ZodCIDRv6",(e,t)=>{$c.init(e,t),ce.init(e,t)});function H$(e){return Oo(_l,e)}var $l=p("ZodBase64",(e,t)=>{bc.init(e,t),ce.init(e,t)});function W$(e){return Eo($l,e)}var bl=p("ZodBase64URL",(e,t)=>{xc.init(e,t),ce.init(e,t)});function X$(e){return No(bl,e)}var xl=p("ZodE164",(e,t)=>{kc.init(e,t),ce.init(e,t)});function Y$(e){return Do(xl,e)}var kl=p("ZodJWT",(e,t)=>{Sc.init(e,t),ce.init(e,t)});function Q$(e){return Zo(kl,e)}var Wn=p("ZodCustomStringFormat",(e,t)=>{wc.init(e,t),ce.init(e,t)});function eb(e,t,r={}){return Tr(Wn,e,t,r)}function tb(e){return Tr(Wn,"hostname",We.hostname,e)}function rb(e){return Tr(Wn,"hex",We.hex,e)}function nb(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,i=We[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Tr(Wn,n,i,t)}var Ko=p("ZodNumber",(e,t)=>{po.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>ym(e,n,i,o),e.gt=(n,i)=>e.check(wt(n,i)),e.gte=(n,i)=>e.check(Ne(n,i)),e.min=(n,i)=>e.check(Ne(n,i)),e.lt=(n,i)=>e.check(St(n,i)),e.lte=(n,i)=>e.check(Fe(n,i)),e.max=(n,i)=>e.check(Fe(n,i)),e.int=n=>e.check(al(n)),e.safe=n=>e.check(al(n)),e.positive=n=>e.check(wt(0,n)),e.nonnegative=n=>e.check(Ne(0,n)),e.negative=n=>e.check(St(0,n)),e.nonpositive=n=>e.check(Fe(0,n)),e.multipleOf=(n,i)=>e.check(sr(n,i)),e.step=(n,i)=>e.check(sr(n,i)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ne(e){return yu(Ko,e)}var jr=p("ZodNumberFormat",(e,t)=>{zc.init(e,t),Ko.init(e,t)});function al(e){return _u(jr,e)}function ib(e){return $u(jr,e)}function ob(e){return bu(jr,e)}function ab(e){return xu(jr,e)}function sb(e){return ku(jr,e)}var Bo=p("ZodBoolean",(e,t)=>{On.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>_m(e,r,n,i)});function ve(e){return Su(Bo,e)}var Go=p("ZodBigInt",(e,t)=>{fo.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>$m(e,n,i,o),e.gte=(n,i)=>e.check(Ne(n,i)),e.min=(n,i)=>e.check(Ne(n,i)),e.gt=(n,i)=>e.check(wt(n,i)),e.gte=(n,i)=>e.check(Ne(n,i)),e.min=(n,i)=>e.check(Ne(n,i)),e.lt=(n,i)=>e.check(St(n,i)),e.lte=(n,i)=>e.check(Fe(n,i)),e.max=(n,i)=>e.check(Fe(n,i)),e.positive=n=>e.check(wt(BigInt(0),n)),e.negative=n=>e.check(St(BigInt(0),n)),e.nonpositive=n=>e.check(Fe(BigInt(0),n)),e.nonnegative=n=>e.check(Ne(BigInt(0),n)),e.multipleOf=(n,i)=>e.check(sr(n,i));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function cb(e){return wu(Go,e)}var Sl=p("ZodBigIntFormat",(e,t)=>{Ic.init(e,t),Go.init(e,t)});function ub(e){return zu(Sl,e)}function lb(e){return Iu(Sl,e)}var mh=p("ZodSymbol",(e,t)=>{Pc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>bm(e,r,n,i)});function db(e){return Pu(mh,e)}var hh=p("ZodUndefined",(e,t)=>{Tc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>km(e,r,n,i)});function pb(e){return Tu(hh,e)}var gh=p("ZodNull",(e,t)=>{jc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>xm(e,r,n,i)});function Xn(e){return ju(gh,e)}var vh=p("ZodAny",(e,t)=>{Oc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>zm(e,r,n,i)});function fb(){return Ou(vh)}var yh=p("ZodUnknown",(e,t)=>{Ec.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Im(e,r,n,i)});function ue(){return Eu(yh)}var _h=p("ZodNever",(e,t)=>{Nc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>wm(e,r,n,i)});function wl(e){return Nu(_h,e)}var $h=p("ZodVoid",(e,t)=>{Dc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Sm(e,r,n,i)});function mb(e){return Du($h,e)}var zl=p("ZodDate",(e,t)=>{Zc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Pm(e,n,i,o),e.min=(n,i)=>e.check(Ne(n,i)),e.max=(n,i)=>e.check(Fe(n,i));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function hb(e){return Zu(zl,e)}var bh=p("ZodArray",(e,t)=>{Rc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Mm(e,r,n,i),e.element=t.element,e.min=(r,n)=>e.check(Lt(r,n)),e.nonempty=r=>e.check(Lt(1,r)),e.max=(r,n)=>e.check(Ir(r,n)),e.length=(r,n)=>e.check(Pr(r,n)),e.unwrap=()=>e.element});function H(e,t){return hm(bh,e,t)}function gb(e){let t=e._zod.def.shape;return ze(Object.keys(t))}var Ho=p("ZodObject",(e,t)=>{dm.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>qm(e,r,n,i),_.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>ze(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ue()}),e.loose=()=>e.clone({...e._zod.def,catchall:ue()}),e.strict=()=>e.clone({...e._zod.def,catchall:wl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>_.extend(e,r),e.safeExtend=r=>_.safeExtend(e,r),e.merge=r=>_.merge(e,r),e.pick=r=>_.pick(e,r),e.omit=r=>_.omit(e,r),e.partial=(...r)=>_.partial(Pl,e,r[0]),e.required=(...r)=>_.required(Tl,e,r[0])});function w(e,t){let r={type:"object",shape:e??{},..._.normalizeParams(t)};return new Ho(r)}function vb(e,t){return new Ho({type:"object",shape:e,catchall:wl(),..._.normalizeParams(t)})}function we(e,t){return new Ho({type:"object",shape:e,catchall:ue(),..._.normalizeParams(t)})}var Wo=p("ZodUnion",(e,t)=>{En.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Hu(e,r,n,i),e.options=t.options});function oe(e,t){return new Wo({type:"union",options:e,..._.normalizeParams(t)})}var xh=p("ZodXor",(e,t)=>{Wo.init(e,t),Uc.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Hu(e,r,n,i),e.options=t.options});function yb(e,t){return new xh({type:"union",options:e,inclusive:!1,..._.normalizeParams(t)})}var kh=p("ZodDiscriminatedUnion",(e,t)=>{Wo.init(e,t),Ac.init(e,t)});function Xo(e,t,r){return new kh({type:"union",options:t,discriminator:e,..._.normalizeParams(r)})}var Sh=p("ZodIntersection",(e,t)=>{Cc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Lm(e,r,n,i)});function Yn(e,t){return new Sh({type:"intersection",left:e,right:t})}var wh=p("ZodTuple",(e,t)=>{mo.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Vm(e,r,n,i),e.rest=r=>e.clone({...e._zod.def,rest:r})});function zh(e,t,r){let n=t instanceof M,i=n?r:t,o=n?t:null;return new wh({type:"tuple",items:e,rest:o,..._.normalizeParams(i)})}var Yo=p("ZodRecord",(e,t)=>{Mc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Fm(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType});function pe(e,t,r){return new Yo({type:"record",keyType:e,valueType:t,..._.normalizeParams(r)})}function _b(e,t,r){let n=Oe(e);return n._zod.values=void 0,new Yo({type:"record",keyType:n,valueType:t,..._.normalizeParams(r)})}function $b(e,t,r){return new Yo({type:"record",keyType:e,valueType:t,mode:"loose",..._.normalizeParams(r)})}var Ih=p("ZodMap",(e,t)=>{qc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Am(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(zt(...r)),e.nonempty=r=>e.check(zt(1,r)),e.max=(...r)=>e.check(cr(...r)),e.size=(...r)=>e.check(zr(...r))});function bb(e,t,r){return new Ih({type:"map",keyType:e,valueType:t,..._.normalizeParams(r)})}var Ph=p("ZodSet",(e,t)=>{Lc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Cm(e,r,n,i),e.min=(...r)=>e.check(zt(...r)),e.nonempty=r=>e.check(zt(1,r)),e.max=(...r)=>e.check(cr(...r)),e.size=(...r)=>e.check(zr(...r))});function xb(e,t){return new Ph({type:"set",valueType:e,..._.normalizeParams(t)})}var Hn=p("ZodEnum",(e,t)=>{Vc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Tm(e,n,i,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{let o={};for(let a of n)if(r.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Hn({...t,checks:[],..._.normalizeParams(i),entries:o})},e.exclude=(n,i)=>{let o={...t.entries};for(let a of n)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Hn({...t,checks:[],..._.normalizeParams(i),entries:o})}});function ze(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Hn({type:"enum",entries:r,..._.normalizeParams(t)})}function kb(e,t){return new Hn({type:"enum",entries:e,..._.normalizeParams(t)})}var Th=p("ZodLiteral",(e,t)=>{Fc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>jm(e,r,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function T(e,t){return new Th({type:"literal",values:Array.isArray(e)?e:[e],..._.normalizeParams(t)})}var jh=p("ZodFile",(e,t)=>{Jc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Nm(e,r,n,i),e.min=(r,n)=>e.check(zt(r,n)),e.max=(r,n)=>e.check(cr(r,n)),e.mime=(r,n)=>e.check(Ln(Array.isArray(r)?r:[r],n))});function Sb(e){return Lu(jh,e)}var Oh=p("ZodTransform",(e,t)=>{Kc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Um(e,r,n,i),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new nr(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(_.issue(o,r.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(_.issue(a))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r)):(r.value=i,r)}});function Il(e){return new Oh({type:"transform",transform:e})}var Pl=p("ZodOptional",(e,t)=>{ho.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Wu(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function fe(e){return new Pl({type:"optional",innerType:e})}var Eh=p("ZodExactOptional",(e,t)=>{Bc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Wu(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Nh(e){return new Eh({type:"optional",innerType:e})}var Dh=p("ZodNullable",(e,t)=>{Gc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Jm(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Lo(e){return new Dh({type:"nullable",innerType:e})}function wb(e){return fe(Lo(e))}var Zh=p("ZodDefault",(e,t)=>{Hc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Bm(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rh(e,t){return new Zh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_.shallowClone(t)}})}var Uh=p("ZodPrefault",(e,t)=>{Wc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Gm(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Ah(e,t){return new Uh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_.shallowClone(t)}})}var Tl=p("ZodNonOptional",(e,t)=>{Xc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Km(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Ch(e,t){return new Tl({type:"nonoptional",innerType:e,..._.normalizeParams(t)})}var Mh=p("ZodSuccess",(e,t)=>{Yc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Dm(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function zb(e){return new Mh({type:"success",innerType:e})}var qh=p("ZodCatch",(e,t)=>{Qc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Hm(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Lh(e,t){return new qh({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Vh=p("ZodNaN",(e,t)=>{eu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Om(e,r,n,i)});function Ib(e){return Ru(Vh,e)}var jl=p("ZodPipe",(e,t)=>{tu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Wm(e,r,n,i),e.in=t.in,e.out=t.out});function Vo(e,t){return new jl({type:"pipe",in:e,out:t})}var Ol=p("ZodCodec",(e,t)=>{jl.init(e,t),Nn.init(e,t)});function Pb(e,t,r){return new Ol({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var Fh=p("ZodReadonly",(e,t)=>{ru.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Xm(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Jh(e){return new Fh({type:"readonly",innerType:e})}var Kh=p("ZodTemplateLiteral",(e,t)=>{nu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Em(e,r,n,i)});function Tb(e,t){return new Kh({type:"template_literal",parts:e,..._.normalizeParams(t)})}var Bh=p("ZodLazy",(e,t)=>{au.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Qm(e,r,n,i),e.unwrap=()=>e._zod.def.getter()});function Gh(e){return new Bh({type:"lazy",getter:e})}var Hh=p("ZodPromise",(e,t)=>{ou.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Ym(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function jb(e){return new Hh({type:"promise",innerType:e})}var Wh=p("ZodFunction",(e,t)=>{iu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Rm(e,r,n,i)});function Ob(e){return new Wh({type:"function",input:Array.isArray(e?.input)?zh(e?.input):e?.input??H(ue()),output:e?.output??ue()})}var Qo=p("ZodCustom",(e,t)=>{su.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Zm(e,r,n,i)});function Eb(e){let t=new se({check:"custom"});return t._zod.check=e,t}function El(e,t){return Vu(Qo,e??(()=>!0),t)}function Xh(e,t={}){return Fu(Qo,e,t)}function Yh(e){return Ju(e)}var Nb=Ku,Db=Bu;function Zb(e,t={}){let r=new Qo({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,..._.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Rb=(...e)=>Gu({Codec:Ol,Boolean:Bo,String:Fo},...e);function Ub(e){let t=Gh(()=>oe([h(e),ne(),ve(),Xn(),H(t),pe(h(),t)]));return t}function ea(e,t){return Vo(Il(e),t)}var Qh;Qh||(Qh={});var TE={...Gn,...Mo,iso:ur};ye(cu());var Dl="2025-11-25";var eg=[Dl,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Vt="io.modelcontextprotocol/related-task",ra="2.0",_e=El(e=>e!==null&&(typeof e=="object"||typeof e=="function")),tg=oe([h(),ne().int()]),rg=h(),GE=we({ttl:oe([ne(),Xn()]).optional(),pollInterval:ne().optional()}),Hb=w({ttl:ne().optional()}),Wb=w({taskId:h()}),Zl=we({progressToken:tg.optional(),[Vt]:Wb.optional()}),Ke=w({_meta:Zl.optional()}),Qn=Ke.extend({task:Hb.optional()}),ng=e=>Qn.safeParse(e).success,$e=w({method:h(),params:Ke.loose().optional()}),Xe=w({_meta:Zl.optional()}),Ye=w({method:h(),params:Xe.loose().optional()}),be=we({_meta:Zl.optional()}),na=oe([h(),ne().int()]),ig=w({jsonrpc:T(ra),id:na,...$e.shape}).strict(),Rl=e=>ig.safeParse(e).success,og=w({jsonrpc:T(ra),...Ye.shape}).strict(),ag=e=>og.safeParse(e).success,Ul=w({jsonrpc:T(ra),id:na,result:be}).strict(),ei=e=>Ul.safeParse(e).success;var X;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(X||(X={}));var Al=w({jsonrpc:T(ra),id:na.optional(),error:w({code:ne().int(),message:h(),data:ue().optional()})}).strict();var sg=e=>Al.safeParse(e).success;var cg=oe([ig,og,Ul,Al]),HE=oe([Ul,Al]),ia=be.strict(),Xb=Xe.extend({requestId:na.optional(),reason:h().optional()}),oa=Ye.extend({method:T("notifications/cancelled"),params:Xb}),Yb=w({src:h(),mimeType:h().optional(),sizes:H(h()).optional(),theme:ze(["light","dark"]).optional()}),ti=w({icons:H(Yb).optional()}),Or=w({name:h(),title:h().optional()}),ug=Or.extend({...Or.shape,...ti.shape,version:h(),websiteUrl:h().optional(),description:h().optional()}),Qb=Yn(w({applyDefaults:ve().optional()}),pe(h(),ue())),ex=ea(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Yn(w({form:Qb.optional(),url:_e.optional()}),pe(h(),ue()).optional())),tx=we({list:_e.optional(),cancel:_e.optional(),requests:we({sampling:we({createMessage:_e.optional()}).optional(),elicitation:we({create:_e.optional()}).optional()}).optional()}),rx=we({list:_e.optional(),cancel:_e.optional(),requests:we({tools:we({call:_e.optional()}).optional()}).optional()}),nx=w({experimental:pe(h(),_e).optional(),sampling:w({context:_e.optional(),tools:_e.optional()}).optional(),elicitation:ex.optional(),roots:w({listChanged:ve().optional()}).optional(),tasks:tx.optional()}),ix=Ke.extend({protocolVersion:h(),capabilities:nx,clientInfo:ug}),Cl=$e.extend({method:T("initialize"),params:ix});var ox=w({experimental:pe(h(),_e).optional(),logging:_e.optional(),completions:_e.optional(),prompts:w({listChanged:ve().optional()}).optional(),resources:w({subscribe:ve().optional(),listChanged:ve().optional()}).optional(),tools:w({listChanged:ve().optional()}).optional(),tasks:rx.optional()}),ax=be.extend({protocolVersion:h(),capabilities:ox,serverInfo:ug,instructions:h().optional()}),Ml=Ye.extend({method:T("notifications/initialized"),params:Xe.optional()});var aa=$e.extend({method:T("ping"),params:Ke.optional()}),sx=w({progress:ne(),total:fe(ne()),message:fe(h())}),cx=w({...Xe.shape,...sx.shape,progressToken:tg}),sa=Ye.extend({method:T("notifications/progress"),params:cx}),ux=Ke.extend({cursor:rg.optional()}),ri=$e.extend({params:ux.optional()}),ni=be.extend({nextCursor:rg.optional()}),lx=ze(["working","input_required","completed","failed","cancelled"]),ii=w({taskId:h(),status:lx,ttl:oe([ne(),Xn()]),createdAt:h(),lastUpdatedAt:h(),pollInterval:fe(ne()),statusMessage:fe(h())}),Er=be.extend({task:ii}),dx=Xe.merge(ii),oi=Ye.extend({method:T("notifications/tasks/status"),params:dx}),ca=$e.extend({method:T("tasks/get"),params:Ke.extend({taskId:h()})}),ua=be.merge(ii),la=$e.extend({method:T("tasks/result"),params:Ke.extend({taskId:h()})}),WE=be.loose(),da=ri.extend({method:T("tasks/list")}),pa=ni.extend({tasks:H(ii)}),fa=$e.extend({method:T("tasks/cancel"),params:Ke.extend({taskId:h()})}),lg=be.merge(ii),dg=w({uri:h(),mimeType:fe(h()),_meta:pe(h(),ue()).optional()}),pg=dg.extend({text:h()}),ql=h().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),fg=dg.extend({blob:ql}),ai=ze(["user","assistant"]),Nr=w({audience:H(ai).optional(),priority:ne().min(0).max(1).optional(),lastModified:ur.datetime({offset:!0}).optional()}),mg=w({...Or.shape,...ti.shape,uri:h(),description:fe(h()),mimeType:fe(h()),annotations:Nr.optional(),_meta:fe(we({}))}),px=w({...Or.shape,...ti.shape,uriTemplate:h(),description:fe(h()),mimeType:fe(h()),annotations:Nr.optional(),_meta:fe(we({}))}),Ll=ri.extend({method:T("resources/list")}),fx=ni.extend({resources:H(mg)}),mx=ri.extend({method:T("resources/templates/list")}),hx=ni.extend({resourceTemplates:H(px)}),Vl=Ke.extend({uri:h()}),gx=Vl,Fl=$e.extend({method:T("resources/read"),params:gx}),vx=be.extend({contents:H(oe([pg,fg]))}),yx=Ye.extend({method:T("notifications/resources/list_changed"),params:Xe.optional()}),_x=Vl,$x=$e.extend({method:T("resources/subscribe"),params:_x}),bx=Vl,xx=$e.extend({method:T("resources/unsubscribe"),params:bx}),kx=Xe.extend({uri:h()}),Sx=Ye.extend({method:T("notifications/resources/updated"),params:kx}),wx=w({name:h(),description:fe(h()),required:fe(ve())}),zx=w({...Or.shape,...ti.shape,description:fe(h()),arguments:fe(H(wx)),_meta:fe(we({}))}),Ix=ri.extend({method:T("prompts/list")}),Px=ni.extend({prompts:H(zx)}),Tx=Ke.extend({name:h(),arguments:pe(h(),h()).optional()}),jx=$e.extend({method:T("prompts/get"),params:Tx}),Jl=w({type:T("text"),text:h(),annotations:Nr.optional(),_meta:pe(h(),ue()).optional()}),Kl=w({type:T("image"),data:ql,mimeType:h(),annotations:Nr.optional(),_meta:pe(h(),ue()).optional()}),Bl=w({type:T("audio"),data:ql,mimeType:h(),annotations:Nr.optional(),_meta:pe(h(),ue()).optional()}),Ox=w({type:T("tool_use"),name:h(),id:h(),input:pe(h(),ue()),_meta:pe(h(),ue()).optional()}),Ex=w({type:T("resource"),resource:oe([pg,fg]),annotations:Nr.optional(),_meta:pe(h(),ue()).optional()}),Nx=mg.extend({type:T("resource_link")}),Gl=oe([Jl,Kl,Bl,Nx,Ex]),Dx=w({role:ai,content:Gl}),Zx=be.extend({description:h().optional(),messages:H(Dx)}),Rx=Ye.extend({method:T("notifications/prompts/list_changed"),params:Xe.optional()}),Ux=w({title:h().optional(),readOnlyHint:ve().optional(),destructiveHint:ve().optional(),idempotentHint:ve().optional(),openWorldHint:ve().optional()}),Ax=w({taskSupport:ze(["required","optional","forbidden"]).optional()}),hg=w({...Or.shape,...ti.shape,description:h().optional(),inputSchema:w({type:T("object"),properties:pe(h(),_e).optional(),required:H(h()).optional()}).catchall(ue()),outputSchema:w({type:T("object"),properties:pe(h(),_e).optional(),required:H(h()).optional()}).catchall(ue()).optional(),annotations:Ux.optional(),execution:Ax.optional(),_meta:pe(h(),ue()).optional()}),Hl=ri.extend({method:T("tools/list")}),Cx=ni.extend({tools:H(hg)}),ma=be.extend({content:H(Gl).default([]),structuredContent:pe(h(),ue()).optional(),isError:ve().optional()}),XE=ma.or(be.extend({toolResult:ue()})),Mx=Qn.extend({name:h(),arguments:pe(h(),ue()).optional()}),si=$e.extend({method:T("tools/call"),params:Mx}),qx=Ye.extend({method:T("notifications/tools/list_changed"),params:Xe.optional()}),YE=w({autoRefresh:ve().default(!0),debounceMs:ne().int().nonnegative().default(300)}),ci=ze(["debug","info","notice","warning","error","critical","alert","emergency"]),Lx=Ke.extend({level:ci}),Wl=$e.extend({method:T("logging/setLevel"),params:Lx}),Vx=Xe.extend({level:ci,logger:h().optional(),data:ue()}),Fx=Ye.extend({method:T("notifications/message"),params:Vx}),Jx=w({name:h().optional()}),Kx=w({hints:H(Jx).optional(),costPriority:ne().min(0).max(1).optional(),speedPriority:ne().min(0).max(1).optional(),intelligencePriority:ne().min(0).max(1).optional()}),Bx=w({mode:ze(["auto","required","none"]).optional()}),Gx=w({type:T("tool_result"),toolUseId:h().describe("The unique identifier for the corresponding tool call."),content:H(Gl).default([]),structuredContent:w({}).loose().optional(),isError:ve().optional(),_meta:pe(h(),ue()).optional()}),Hx=Xo("type",[Jl,Kl,Bl]),ta=Xo("type",[Jl,Kl,Bl,Ox,Gx]),Wx=w({role:ai,content:oe([ta,H(ta)]),_meta:pe(h(),ue()).optional()}),Xx=Qn.extend({messages:H(Wx),modelPreferences:Kx.optional(),systemPrompt:h().optional(),includeContext:ze(["none","thisServer","allServers"]).optional(),temperature:ne().optional(),maxTokens:ne().int(),stopSequences:H(h()).optional(),metadata:_e.optional(),tools:H(hg).optional(),toolChoice:Bx.optional()}),Yx=$e.extend({method:T("sampling/createMessage"),params:Xx}),Xl=be.extend({model:h(),stopReason:fe(ze(["endTurn","stopSequence","maxTokens"]).or(h())),role:ai,content:Hx}),Yl=be.extend({model:h(),stopReason:fe(ze(["endTurn","stopSequence","maxTokens","toolUse"]).or(h())),role:ai,content:oe([ta,H(ta)])}),Qx=w({type:T("boolean"),title:h().optional(),description:h().optional(),default:ve().optional()}),ek=w({type:T("string"),title:h().optional(),description:h().optional(),minLength:ne().optional(),maxLength:ne().optional(),format:ze(["email","uri","date","date-time"]).optional(),default:h().optional()}),tk=w({type:ze(["number","integer"]),title:h().optional(),description:h().optional(),minimum:ne().optional(),maximum:ne().optional(),default:ne().optional()}),rk=w({type:T("string"),title:h().optional(),description:h().optional(),enum:H(h()),default:h().optional()}),nk=w({type:T("string"),title:h().optional(),description:h().optional(),oneOf:H(w({const:h(),title:h()})),default:h().optional()}),ik=w({type:T("string"),title:h().optional(),description:h().optional(),enum:H(h()),enumNames:H(h()).optional(),default:h().optional()}),ok=oe([rk,nk]),ak=w({type:T("array"),title:h().optional(),description:h().optional(),minItems:ne().optional(),maxItems:ne().optional(),items:w({type:T("string"),enum:H(h())}),default:H(h()).optional()}),sk=w({type:T("array"),title:h().optional(),description:h().optional(),minItems:ne().optional(),maxItems:ne().optional(),items:w({anyOf:H(w({const:h(),title:h()}))}),default:H(h()).optional()}),ck=oe([ak,sk]),uk=oe([ik,ok,ck]),lk=oe([uk,Qx,ek,tk]),dk=Qn.extend({mode:T("form").optional(),message:h(),requestedSchema:w({type:T("object"),properties:pe(h(),lk),required:H(h()).optional()})}),pk=Qn.extend({mode:T("url"),message:h(),elicitationId:h(),url:h().url()}),fk=oe([dk,pk]),mk=$e.extend({method:T("elicitation/create"),params:fk}),hk=Xe.extend({elicitationId:h()}),gk=Ye.extend({method:T("notifications/elicitation/complete"),params:hk}),ha=be.extend({action:ze(["accept","decline","cancel"]),content:ea(e=>e===null?void 0:e,pe(h(),oe([h(),ne(),ve(),H(h())])).optional())}),vk=w({type:T("ref/resource"),uri:h()});var yk=w({type:T("ref/prompt"),name:h()}),_k=Ke.extend({ref:oe([yk,vk]),argument:w({name:h(),value:h()}),context:w({arguments:pe(h(),h()).optional()}).optional()}),$k=$e.extend({method:T("completion/complete"),params:_k});var bk=be.extend({completion:we({values:H(h()).max(100),total:fe(ne().int()),hasMore:fe(ve())})}),xk=w({uri:h().startsWith("file://"),name:h().optional(),_meta:pe(h(),ue()).optional()}),kk=$e.extend({method:T("roots/list"),params:Ke.optional()}),Ql=be.extend({roots:H(xk)}),Sk=Ye.extend({method:T("notifications/roots/list_changed"),params:Xe.optional()}),QE=oe([aa,Cl,$k,Wl,jx,Ix,Ll,mx,Fl,$x,xx,si,Hl,ca,la,da,fa]),e4=oe([oa,sa,Ml,Sk,oi]),t4=oe([ia,Xl,Yl,ha,Ql,ua,pa,Er]),r4=oe([aa,Yx,mk,kk,ca,la,da,fa]),n4=oe([oa,sa,Fx,Sx,yx,qx,Rx,oi,gk]),i4=oe([ia,ax,bk,Zx,Px,fx,hx,vx,ma,Cx,ua,pa,Er]),F=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===X.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new Nl(i.elicitations,r)}return new e(t,r,n)}},Nl=class extends F{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(X.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};var ga=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
48
|
-
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),wk(r)}clear(){this._buffer=void 0}};function wk(e){return cg.parse(JSON.parse(e))}function gg(e){return JSON.stringify(e)+`
|
|
49
|
-
`}var va=class{constructor(t=vg.stdin,r=vg.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new ga,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){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(t){return new Promise(r=>{let n=gg(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var zk="https://api.andru.ai";var Ik="0.1.0",ya=class{constructor(t,r=zk){this.apiKey=t,this.baseUrl=r.replace(/\/+$/,"")}async listTools(){return this.post("/api/mcp/tools/list",{})}async callTool(t,r){return this.post("/api/mcp/tools/call",{tool:t,arguments:r})}async listResources(){return this.post("/api/mcp/resources/list",{})}async readResource(t){return this.post("/api/mcp/resources/read",{uri:t})}async post(t,r){let n=new AbortController,i=setTimeout(()=>n.abort(),6e4);try{let o=await fetch(`${this.baseUrl}${t}`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.apiKey,"User-Agent":`andru-mcp-server/${Ik}`},body:JSON.stringify(r),signal:n.signal});if(!o.ok){let a=await o.text().catch(()=>""),s;try{let c=JSON.parse(a);s=c.error||c.message||`HTTP ${o.status}`}catch{s=`HTTP ${o.status}: ${a.slice(0,200)}`}throw new Error(s)}return await o.json()}catch(o){throw o.name==="AbortError"?new Error(`Request to ${t} timed out after ${6e4/1e3}s`):o}finally{clearTimeout(i)}}};var Y;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},e.getValidEnumValues=i=>{let o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(let s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(let a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Y||(Y={}));var yg;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(yg||(yg={}));var z=Y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pt=e=>{switch(typeof e){case"undefined":return z.undefined;case"string":return z.string;case"number":return Number.isNaN(e)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(e)?z.array:e===null?z.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?z.promise:typeof Map<"u"&&e instanceof Map?z.map:typeof Set<"u"&&e instanceof Set?z.set:typeof Date<"u"&&e instanceof Date?z.date:z.object;default:return z.unknown}};var y=Y.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Be=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},i=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return i(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Y.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Be.create=e=>new Be(e);var Pk=(e,t)=>{let r;switch(e.code){case y.invalid_type:e.received===z.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Y.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:r=`Unrecognized key(s) in object: ${Y.joinValues(e.keys,", ")}`;break;case y.invalid_union:r="Invalid input";break;case y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Y.joinValues(e.options)}`;break;case y.invalid_enum_value:r=`Invalid enum value. Expected ${Y.joinValues(e.options)}, received '${e.received}'`;break;case y.invalid_arguments:r="Invalid function arguments";break;case y.invalid_return_type:r="Invalid function return type";break;case y.invalid_date:r="Invalid date";break;case y.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Y.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case y.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case y.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case y.custom:r="Invalid input";break;case y.invalid_intersection_types:r="Intersection results could not be merged";break;case y.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case y.not_finite:r="Number must be finite";break;default:r=t.defaultError,Y.assertNever(e)}return{message:r}},Ft=Pk;var Tk=Ft;function ui(){return Tk}var _a=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}};function x(e,t){let r=ui(),n=_a({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ft?void 0:Ft].filter(i=>!!i)});e.common.issues.push(n)}var Ie=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return U;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let o=await i.key,a=await i.value;n.push({key:o,value:a})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return U;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}},U=Object.freeze({status:"aborted"}),Dr=e=>({status:"dirty",value:e}),Ze=e=>({status:"valid",value:e}),ed=e=>e.status==="aborted",td=e=>e.status==="dirty",lr=e=>e.status==="valid",li=e=>typeof Promise<"u"&&e instanceof Promise;var I;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(I||(I={}));var Qe=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},_g=(e,t)=>{if(lr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Be(e.common.issues);return this._error=r,this._error}}};function q(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:i}}var B=class{get description(){return this._def.description}_getType(t){return Pt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Pt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ie,ctx:{common:t.parent.common,data:t.data,parsedType:Pt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(li(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pt(t)},i=this._parseSync({data:t,path:n.path,parent:n});return _g(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return lr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>lr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pt(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(li(i)?i:Promise.resolve(i));return _g(n,o)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let a=t(i),s=()=>o.addIssue({code:y.custom,...n(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new ct({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return st.create(this,this._def)}nullable(){return Ot.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this)}promise(){return dr.create(this,this._def)}or(t){return Cr.create([this,t],this._def)}and(t){return Mr.create(this,t,this._def)}transform(t){return new ct({...q(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Jr({...q(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new $a({typeName:N.ZodBranded,type:this,...q(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Kr({...q(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ba.create(this,t)}readonly(){return Br.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},jk=/^c[^\s-]{8,}$/i,Ok=/^[0-9a-z]+$/,Ek=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Nk=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dk=/^[a-z0-9_-]{21}$/i,Zk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Rk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Uk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ak="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",rd,Ck=/^(?:(?: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])$/,Mk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,qk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Lk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$g="((\\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])))",Jk=new RegExp(`^${$g}$`);function bg(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Kk(e){return new RegExp(`^${bg(e)}$`)}function Bk(e){let t=`${$g}T${bg(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Gk(e,t){return!!((t==="v4"||!t)&&Ck.test(e)||(t==="v6"||!t)&&qk.test(e))}function Hk(e,t){if(!Zk.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function Wk(e,t){return!!((t==="v4"||!t)&&Mk.test(e)||(t==="v6"||!t)&&Lk.test(e))}var Rr=class e extends B{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==z.string){let o=this._getOrReturnCtx(t);return x(o,{code:y.invalid_type,expected:z.string,received:o.parsedType}),U}let n=new Ie,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),x(i,{code:y.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),x(i,{code:y.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?x(i,{code:y.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&x(i,{code:y.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Uk.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"email",code:y.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")rd||(rd=new RegExp(Ak,"u")),rd.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"emoji",code:y.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Nk.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"uuid",code:y.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Dk.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"nanoid",code:y.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")jk.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"cuid",code:y.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Ok.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"cuid2",code:y.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Ek.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"ulid",code:y.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),x(i,{validation:"url",code:y.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"regex",code:y.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),x(i,{code:y.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),x(i,{code:y.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),x(i,{code:y.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Bk(o).test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{code:y.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Jk.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{code:y.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Kk(o).test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{code:y.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Rk.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"duration",code:y.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Gk(t.data,o.version)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"ip",code:y.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Hk(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"jwt",code:y.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Wk(t.data,o.version)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"cidr",code:y.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Vk.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"base64",code:y.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Fk.test(t.data)||(i=this._getOrReturnCtx(t,i),x(i,{validation:"base64url",code:y.invalid_string,message:o.message}),n.dirty()):Y.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:y.invalid_string,...I.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...I.errToObj(t)})}url(t){return this._addCheck({kind:"url",...I.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...I.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...I.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...I.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...I.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...I.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...I.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...I.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...I.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...I.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...I.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...I.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...I.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...I.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...I.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...I.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...I.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...I.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...I.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...I.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...I.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...I.errToObj(r)})}nonempty(t){return this.min(1,I.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Rr.create=e=>new Rr({checks:[],typeName:N.ZodString,coerce:e?.coerce??!1,...q(e)});function Xk(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}var di=class e extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==z.number){let o=this._getOrReturnCtx(t);return x(o,{code:y.invalid_type,expected:z.number,received:o.parsedType}),U}let n,i=new Ie;for(let o of this._def.checks)o.kind==="int"?Y.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),x(n,{code:y.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),x(n,{code:y.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),x(n,{code:y.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Xk(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),x(n,{code:y.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),x(n,{code:y.not_finite,message:o.message}),i.dirty()):Y.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,I.toString(r))}gt(t,r){return this.setLimit("min",t,!1,I.toString(r))}lte(t,r){return this.setLimit("max",t,!0,I.toString(r))}lt(t,r){return this.setLimit("max",t,!1,I.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:I.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:I.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:I.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:I.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Y.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};di.create=e=>new di({checks:[],typeName:N.ZodNumber,coerce:e?.coerce||!1,...q(e)});var pi=class e extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==z.bigint)return this._getInvalidInput(t);let n,i=new Ie;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),x(n,{code:y.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),x(n,{code:y.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),x(n,{code:y.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Y.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return x(r,{code:y.invalid_type,expected:z.bigint,received:r.parsedType}),U}gte(t,r){return this.setLimit("min",t,!0,I.toString(r))}gt(t,r){return this.setLimit("min",t,!1,I.toString(r))}lte(t,r){return this.setLimit("max",t,!0,I.toString(r))}lt(t,r){return this.setLimit("max",t,!1,I.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:I.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:I.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};pi.create=e=>new pi({checks:[],typeName:N.ZodBigInt,coerce:e?.coerce??!1,...q(e)});var fi=class extends B{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==z.boolean){let n=this._getOrReturnCtx(t);return x(n,{code:y.invalid_type,expected:z.boolean,received:n.parsedType}),U}return Ze(t.data)}};fi.create=e=>new fi({typeName:N.ZodBoolean,coerce:e?.coerce||!1,...q(e)});var mi=class e extends B{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==z.date){let o=this._getOrReturnCtx(t);return x(o,{code:y.invalid_type,expected:z.date,received:o.parsedType}),U}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return x(o,{code:y.invalid_date}),U}let n=new Ie,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),x(i,{code:y.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),x(i,{code:y.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Y.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:I.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:I.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};mi.create=e=>new mi({checks:[],coerce:e?.coerce||!1,typeName:N.ZodDate,...q(e)});var hi=class extends B{_parse(t){if(this._getType(t)!==z.symbol){let n=this._getOrReturnCtx(t);return x(n,{code:y.invalid_type,expected:z.symbol,received:n.parsedType}),U}return Ze(t.data)}};hi.create=e=>new hi({typeName:N.ZodSymbol,...q(e)});var Ur=class extends B{_parse(t){if(this._getType(t)!==z.undefined){let n=this._getOrReturnCtx(t);return x(n,{code:y.invalid_type,expected:z.undefined,received:n.parsedType}),U}return Ze(t.data)}};Ur.create=e=>new Ur({typeName:N.ZodUndefined,...q(e)});var Ar=class extends B{_parse(t){if(this._getType(t)!==z.null){let n=this._getOrReturnCtx(t);return x(n,{code:y.invalid_type,expected:z.null,received:n.parsedType}),U}return Ze(t.data)}};Ar.create=e=>new Ar({typeName:N.ZodNull,...q(e)});var gi=class extends B{constructor(){super(...arguments),this._any=!0}_parse(t){return Ze(t.data)}};gi.create=e=>new gi({typeName:N.ZodAny,...q(e)});var Jt=class extends B{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ze(t.data)}};Jt.create=e=>new Jt({typeName:N.ZodUnknown,...q(e)});var gt=class extends B{_parse(t){let r=this._getOrReturnCtx(t);return x(r,{code:y.invalid_type,expected:z.never,received:r.parsedType}),U}};gt.create=e=>new gt({typeName:N.ZodNever,...q(e)});var vi=class extends B{_parse(t){if(this._getType(t)!==z.undefined){let n=this._getOrReturnCtx(t);return x(n,{code:y.invalid_type,expected:z.void,received:n.parsedType}),U}return Ze(t.data)}};vi.create=e=>new vi({typeName:N.ZodVoid,...q(e)});var Kt=class e extends B{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==z.array)return x(r,{code:y.invalid_type,expected:z.array,received:r.parsedType}),U;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(a||s)&&(x(r,{code:a?y.too_big:y.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(x(r,{code:y.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(x(r,{code:y.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>i.type._parseAsync(new Qe(r,a,r.path,s)))).then(a=>Ie.mergeArray(n,a));let o=[...r.data].map((a,s)=>i.type._parseSync(new Qe(r,a,r.path,s)));return Ie.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:I.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:I.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:I.toString(r)}})}nonempty(t){return this.min(1,t)}};Kt.create=(e,t)=>new Kt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...q(t)});function Zr(e){if(e instanceof Ge){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=st.create(Zr(n))}return new Ge({...e._def,shape:()=>t})}else return e instanceof Kt?new Kt({...e._def,type:Zr(e.element)}):e instanceof st?st.create(Zr(e.unwrap())):e instanceof Ot?Ot.create(Zr(e.unwrap())):e instanceof jt?jt.create(e.items.map(t=>Zr(t))):e}var Ge=class e extends B{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Y.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==z.object){let u=this._getOrReturnCtx(t);return x(u,{code:y.invalid_type,expected:z.object,received:u.parsedType}),U}let{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof gt&&this._def.unknownKeys==="strip"))for(let u in i.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let l=o[u],d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Qe(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof gt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")s.length>0&&(x(i,{code:y.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of s){let d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Qe(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,m=await l.value;u.push({key:d,value:m,alwaysSet:l.alwaysSet})}return u}).then(u=>Ie.mergeObjectSync(n,u)):Ie.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return I.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:I.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:N.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Y.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Y.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Zr(this)}partial(t){let r={};for(let n of Y.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Y.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof st;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return xg(Y.objectKeys(this.shape))}};Ge.create=(e,t)=>new Ge({shape:()=>e,unknownKeys:"strip",catchall:gt.create(),typeName:N.ZodObject,...q(t)});Ge.strictCreate=(e,t)=>new Ge({shape:()=>e,unknownKeys:"strict",catchall:gt.create(),typeName:N.ZodObject,...q(t)});Ge.lazycreate=(e,t)=>new Ge({shape:e,unknownKeys:"strip",catchall:gt.create(),typeName:N.ZodObject,...q(t)});var Cr=class extends B{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Be(s.ctx.common.issues));return x(r,{code:y.invalid_union,unionErrors:a}),U}if(r.common.async)return Promise.all(n.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let o,a=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(c=>new Be(c));return x(r,{code:y.invalid_union,unionErrors:s}),U}}get options(){return this._def.options}};Cr.create=(e,t)=>new Cr({options:e,typeName:N.ZodUnion,...q(t)});var Tt=e=>e instanceof qr?Tt(e.schema):e instanceof ct?Tt(e.innerType()):e instanceof Lr?[e.value]:e instanceof Vr?e.options:e instanceof Fr?Y.objectValues(e.enum):e instanceof Jr?Tt(e._def.innerType):e instanceof Ur?[void 0]:e instanceof Ar?[null]:e instanceof st?[void 0,...Tt(e.unwrap())]:e instanceof Ot?[null,...Tt(e.unwrap())]:e instanceof $a||e instanceof Br?Tt(e.unwrap()):e instanceof Kr?Tt(e._def.innerType):[],nd=class e extends B{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.object)return x(r,{code:y.invalid_type,expected:z.object,received:r.parsedType}),U;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(x(r,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),U)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let o of r){let a=Tt(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new e({typeName:N.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...q(n)})}};function id(e,t){let r=Pt(e),n=Pt(t);if(e===t)return{valid:!0,data:e};if(r===z.object&&n===z.object){let i=Y.objectKeys(t),o=Y.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(let s of o){let c=id(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===z.array&&n===z.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],c=id(a,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===z.date&&n===z.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Mr=class extends B{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(o,a)=>{if(ed(o)||ed(a))return U;let s=id(o.value,a.value);return s.valid?((td(o)||td(a))&&r.dirty(),{status:r.value,value:s.data}):(x(n,{code:y.invalid_intersection_types}),U)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Mr.create=(e,t,r)=>new Mr({left:e,right:t,typeName:N.ZodIntersection,...q(r)});var jt=class e extends B{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.array)return x(n,{code:y.invalid_type,expected:z.array,received:n.parsedType}),U;if(n.data.length<this._def.items.length)return x(n,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),U;!this._def.rest&&n.data.length>this._def.items.length&&(x(n,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Qe(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>Ie.mergeArray(r,a)):Ie.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};jt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jt({items:e,typeName:N.ZodTuple,rest:null,...q(t)})};var od=class e extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.object)return x(n,{code:y.invalid_type,expected:z.object,received:n.parsedType}),U;let i=[],o=this._def.keyType,a=this._def.valueType;for(let s in n.data)i.push({key:o._parse(new Qe(n,s,n.path,s)),value:a._parse(new Qe(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Ie.mergeObjectAsync(r,i):Ie.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof B?new e({keyType:t,valueType:r,typeName:N.ZodRecord,...q(n)}):new e({keyType:Rr.create(),valueType:t,typeName:N.ZodRecord,...q(r)})}},yi=class extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.map)return x(n,{code:y.invalid_type,expected:z.map,received:n.parsedType}),U;let i=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([s,c],u)=>({key:i._parse(new Qe(n,s,n.path,[u,"key"])),value:o._parse(new Qe(n,c,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return U;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of a){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return U;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}}}};yi.create=(e,t,r)=>new yi({valueType:t,keyType:e,typeName:N.ZodMap,...q(r)});var _i=class e extends B{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.set)return x(n,{code:y.invalid_type,expected:z.set,received:n.parsedType}),U;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(x(n,{code:y.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(x(n,{code:y.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function a(c){let u=new Set;for(let l of c){if(l.status==="aborted")return U;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((c,u)=>o._parse(new Qe(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:I.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:I.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};_i.create=(e,t)=>new _i({valueType:e,minSize:null,maxSize:null,typeName:N.ZodSet,...q(t)});var ad=class e extends B{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.function)return x(r,{code:y.invalid_type,expected:z.function,received:r.parsedType}),U;function n(s,c){return _a({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ui(),Ft].filter(u=>!!u),issueData:{code:y.invalid_arguments,argumentsError:c}})}function i(s,c){return _a({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ui(),Ft].filter(u=>!!u),issueData:{code:y.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof dr){let s=this;return Ze(async function(...c){let u=new Be([]),l=await s._def.args.parseAsync(c,o).catch(f=>{throw u.addIssue(n(c,f)),u}),d=await Reflect.apply(a,this,l);return await s._def.returns._def.type.parseAsync(d,o).catch(f=>{throw u.addIssue(i(d,f)),u})})}else{let s=this;return Ze(function(...c){let u=s._def.args.safeParse(c,o);if(!u.success)throw new Be([n(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(l,o);if(!d.success)throw new Be([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:jt.create(t).rest(Jt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||jt.create([]).rest(Jt.create()),returns:r||Jt.create(),typeName:N.ZodFunction,...q(n)})}},qr=class extends B{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};qr.create=(e,t)=>new qr({getter:e,typeName:N.ZodLazy,...q(t)});var Lr=class extends B{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return x(r,{received:r.data,code:y.invalid_literal,expected:this._def.value}),U}return{status:"valid",value:t.data}}get value(){return this._def.value}};Lr.create=(e,t)=>new Lr({value:e,typeName:N.ZodLiteral,...q(t)});function xg(e,t){return new Vr({values:e,typeName:N.ZodEnum,...q(t)})}var Vr=class e extends B{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return x(r,{expected:Y.joinValues(n),received:r.parsedType,code:y.invalid_type}),U}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return x(r,{received:r.data,code:y.invalid_enum_value,options:n}),U}return Ze(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Vr.create=xg;var Fr=class extends B{_parse(t){let r=Y.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==z.string&&n.parsedType!==z.number){let i=Y.objectValues(r);return x(n,{expected:Y.joinValues(i),received:n.parsedType,code:y.invalid_type}),U}if(this._cache||(this._cache=new Set(Y.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=Y.objectValues(r);return x(n,{received:n.data,code:y.invalid_enum_value,options:i}),U}return Ze(t.data)}get enum(){return this._def.values}};Fr.create=(e,t)=>new Fr({values:e,typeName:N.ZodNativeEnum,...q(t)});var dr=class extends B{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.promise&&r.common.async===!1)return x(r,{code:y.invalid_type,expected:z.promise,received:r.parsedType}),U;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return Ze(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dr.create=(e,t)=>new dr({type:e,typeName:N.ZodPromise,...q(t)});var ct=class extends B{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{x(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let a=i.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return U;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?U:c.status==="dirty"?Dr(c.value):r.value==="dirty"?Dr(c.value):c});{if(r.value==="aborted")return U;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?U:s.status==="dirty"?Dr(s.value):r.value==="dirty"?Dr(s.value):s}}if(i.type==="refinement"){let a=s=>{let c=i.refinement(s,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?U:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?U:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!lr(a))return U;let s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>lr(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:r.value,value:s})):U);Y.assertNever(i)}};ct.create=(e,t,r)=>new ct({schema:e,typeName:N.ZodEffects,effect:t,...q(r)});ct.createWithPreprocess=(e,t,r)=>new ct({schema:t,effect:{type:"preprocess",transform:e},typeName:N.ZodEffects,...q(r)});var st=class extends B{_parse(t){return this._getType(t)===z.undefined?Ze(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};st.create=(e,t)=>new st({innerType:e,typeName:N.ZodOptional,...q(t)});var Ot=class extends B{_parse(t){return this._getType(t)===z.null?Ze(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ot.create=(e,t)=>new Ot({innerType:e,typeName:N.ZodNullable,...q(t)});var Jr=class extends B{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Jr.create=(e,t)=>new Jr({innerType:e,typeName:N.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...q(t)});var Kr=class extends B{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return li(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Be(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Be(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Kr.create=(e,t)=>new Kr({innerType:e,typeName:N.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...q(t)});var $i=class extends B{_parse(t){if(this._getType(t)!==z.nan){let n=this._getOrReturnCtx(t);return x(n,{code:y.invalid_type,expected:z.nan,received:n.parsedType}),U}return{status:"valid",value:t.data}}};$i.create=e=>new $i({typeName:N.ZodNaN,...q(e)});var T4=Symbol("zod_brand"),$a=class extends B{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ba=class e extends B{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?U:o.status==="dirty"?(r.dirty(),Dr(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?U:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:N.ZodPipeline})}},Br=class extends B{_parse(t){let r=this._def.innerType._parse(t),n=i=>(lr(i)&&(i.value=Object.freeze(i.value)),i);return li(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};Br.create=(e,t)=>new Br({innerType:e,typeName:N.ZodReadonly,...q(t)});var j4={object:Ge.lazycreate},N;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(N||(N={}));var O4=Rr.create,E4=di.create,N4=$i.create,D4=pi.create,Z4=fi.create,R4=mi.create,U4=hi.create,A4=Ur.create,C4=Ar.create,M4=gi.create,q4=Jt.create,L4=gt.create,V4=vi.create,F4=Kt.create,Yk=Ge.create,J4=Ge.strictCreate,K4=Cr.create,B4=nd.create,G4=Mr.create,H4=jt.create,W4=od.create,X4=yi.create,Y4=_i.create,Q4=ad.create,eN=qr.create,tN=Lr.create,rN=Vr.create,nN=Fr.create,iN=dr.create,oN=ct.create,aN=st.create,sN=Ot.create,cN=ct.createWithPreprocess,uN=ba.create;function Gr(e){return!!e._zod}function Bt(e,t){return Gr(e)?wr(e,t):e.safeParse(t)}function xa(e){if(!e)return;let t;if(Gr(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function wg(e){if(Gr(e)){let o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}function Gt(e){return e==="completed"||e==="failed"||e==="cancelled"}var oS=Symbol("Let zodToJsonSchema decide on which parser to use");var z1=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sd(e){let r=xa(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=wg(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function cd(e,t){let r=Bt(e,t);if(!r.success)throw r.error;return r.data}var dS=6e4,ka=class{constructor(t){this._options=t,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(oa,r=>{this._oncancel(r)}),this.setNotificationHandler(sa,r=>{this._onprogress(r)}),this.setRequestHandler(aa,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ca,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new F(X.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(la,async(r,n)=>{let i=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),s.type==="response")l(c);else{let d=c,m=new F(d.error.code,d.error.message,d.error.data);l(m)}else{let d=s.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(s.message,{relatedRequestId:n.requestId})}}let a=await this._taskStore.getTask(o,n.sessionId);if(!a)throw new F(X.InvalidParams,`Task not found: ${o}`);if(!Gt(a.status))return await this._waitForTaskUpdate(o,n.signal),await i();if(Gt(a.status)){let s=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...s,_meta:{...s._meta,[Vt]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(da,async(r,n)=>{try{let{tasks:i,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:o,_meta:{}}}catch(i){throw new F(X.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(fa,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new F(X.InvalidParams,`Task not found: ${r.params.taskId}`);if(Gt(i.status))throw new F(X.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new F(X.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(i){throw i instanceof F?i:new F(X.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,i,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),F.fromError(X.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let i=this._transport?.onmessage;this._transport.onmessage=(o,a)=>{i?.(o,a),ei(o)||sg(o)?this._onresponse(o):Rl(o)?this._onrequest(o,a):ag(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=F.fromError(X.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,i=this._transport,o=t.params?._meta?.[Vt]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:t.id,error:{code:X.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(t.id,a);let s=ng(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,i?.sessionId):void 0,u={signal:a.signal,sessionId:i?.sessionId,_meta:t.params?._meta,sendNotification:async l=>{if(a.signal.aborted)return;let d={relatedRequestId:t.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,m)=>{if(a.signal.aborted)throw new F(X.ConnectionClosed,"Request was cancelled");let f={...m,relatedRequestId:t.id};o&&!f.relatedTask&&(f.relatedTask={taskId:o});let g=f.relatedTask?.taskId??o;return g&&c&&await c.updateTaskStatus(g,"input_required"),await this.request(l,d,f)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async l=>{if(a.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async l=>{if(a.signal.aborted)return;let d={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(l.code)?l.code:X.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let a=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),a(c);return}o(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),ei(t))n(t);else{let a=new F(t.error.code,t.error.message,t.error.data);n(a)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(ei(t)&&t.result&&typeof t.result=="object"){let a=t.result;if(a.task&&typeof a.task=="object"){let s=a.task;typeof s.taskId=="string"&&(o=!0,this._taskProgressTokens.set(s.taskId,r))}}if(o||this._progressHandlers.delete(r),ei(t))i(t);else{let a=F.fromError(t.error.code,t.error.message,t.error.data);i(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(t,r,n)}}catch(a){yield{type:"error",error:a instanceof F?a:new F(X.InternalError,String(a))}}return}let o;try{let a=await this.request(t,Er,n);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new F(X.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:s},Gt(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)}:s.status==="failed"?yield{type:"error",error:new F(X.InternalError,`Task ${o} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new F(X.InternalError,`Task ${o} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof F?a:new F(X.InternalError,String(a))}}}request(t,r,n){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:a,task:s,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=E=>{l(E)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(E){d(E);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,f={...t,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),f.params={...t.params,_meta:{...t.params?._meta||{},progressToken:m}}),s&&(f.params={...f.params,task:s}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Vt]:c}});let g=E=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(E)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:a}).catch(A=>this._onerror(new Error(`Failed to send cancellation: ${A}`)));let P=E instanceof F?E:new F(X.RequestTimeout,String(E));l(P)};this._responseHandlers.set(m,E=>{if(!n?.signal?.aborted){if(E instanceof Error)return l(E);try{let P=Bt(r,E.result);P.success?u(P.data):l(P.error)}catch(P){l(P)}}}),n?.signal?.addEventListener("abort",()=>{g(n?.signal?.reason)});let v=n?.timeout??dS,$=()=>g(F.fromError(X.RequestTimeout,"Request timed out",{timeout:v}));this._setupTimeout(m,v,n?.maxTotalTimeout,$,n?.resetTimeoutOnProgress??!1);let k=c?.taskId;if(k){let E=P=>{let A=this._responseHandlers.get(m);A?A(P):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,E),this._enqueueTaskMessage(k,{type:"request",message:f,timestamp:Date.now()}).catch(P=>{this._cleanupTimeout(m),l(P)})}else this._transport.send(f,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:a}).catch(E=>{this._cleanupTimeout(m),l(E)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},ua,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},pa,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},lg,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Vt]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Vt]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Vt]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(t,r){let n=sd(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,o)=>{let a=cd(t,i);return Promise.resolve(r(a,o))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=sd(t);this._notificationHandlers.set(n,i=>{let o=cd(t,i);return Promise.resolve(r(o))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,i)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let i of n)if(i.type==="request"&&Rl(i.message)){let o=i.message.id,a=this._requestResolvers.get(o);a?(a(new F(X.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(t);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,o)=>{if(r.aborted){o(new F(X.InvalidRequest,"Request cancelled"));return}let a=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(a),o(new F(X.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!t)throw new Error("No request provided");return await n.createTask(i,t.id,{method:t.method,params:t.params},r)},getTask:async i=>{let o=await n.getTask(i,r);if(!o)throw new F(X.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(i,o,a)=>{await n.storeTaskResult(i,o,a,r);let s=await n.getTask(i,r);if(s){let c=oi.parse({method:"notifications/tasks/status",params:s});await this.notification(c),Gt(s.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,o,a)=>{let s=await n.getTask(i,r);if(!s)throw new F(X.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Gt(s.status))throw new F(X.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,o,a,r);let c=await n.getTask(i,r);if(c){let u=oi.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Gt(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function zg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ig(e,t){let r={...e};for(let n in t){let i=n,o=t[i];if(o===void 0)continue;let a=r[i];zg(a)&&zg(o)?r[i]={...a,...o}:r[i]=o}return r}var f_=of(Bp(),1),m_=of(p_(),1);function tT(){let e=new f_.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,m_.default)(e),e}var as=class{constructor(t){this._ajv=t??tT()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var ss=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}};function h_(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function g_(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var cs=class extends ka{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(ci.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let o=this._loggingLevels.get(i);return o?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new as,this.setRequestHandler(Cl,n=>this._oninitialize(n)),this.setNotificationHandler(Ml,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Wl,async(n,i)=>{let o=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=n.params,s=ci.safeParse(a);return s.success&&this._loggingLevels.set(o,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new ss(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ig(this._capabilities,t)}setRequestHandler(t,r){let i=xa(t)?.method;if(!i)throw new Error("Schema is missing a method literal");let o;if(Gr(i)){let s=i;o=s._zod?.def?.value??s.value}else{let s=i;o=s._def?.value??s.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let s=async(c,u)=>{let l=Bt(si,c);if(!l.success){let g=l.error instanceof Error?l.error.message:String(l.error);throw new F(X.InvalidParams,`Invalid tools/call request: ${g}`)}let{params:d}=l.data,m=await Promise.resolve(r(c,u));if(d.task){let g=Bt(Er,m);if(!g.success){let v=g.error instanceof Error?g.error.message:String(g.error);throw new F(X.InvalidParams,`Invalid task creation result: ${v}`)}return g.data}let f=Bt(ma,m);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new F(X.InvalidParams,`Invalid tools/call result: ${g}`)}return f.data};return super.setRequestHandler(t,s)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){g_(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&h_(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:eg.includes(r)?r:Dl,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"},ia)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],o=i.some(u=>u.type==="tool_result"),a=t.messages.length>1?t.messages[t.messages.length-2]:void 0,s=a?Array.isArray(a.content)?a.content:[a.content]:[],c=s.some(u=>u.type==="tool_use");if(o){if(i.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(s.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},Yl,r):this.request({method:"sampling/createMessage",params:t},Xl,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=t;return this.request({method:"elicitation/create",params:i},ha,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=t.mode==="form"?t:{...t,mode:"form"},o=await this.request({method:"elicitation/create",params:i},ha,r);if(o.action==="accept"&&o.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(o.content);if(!s.valid)throw new F(X.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof F?a:new F(X.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return o}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},Ql,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var v_=[{name:"get_icp_fit_score",description:"Score a company against your ICP criteria. Returns a score (0-100), tier (A/B/C/D), and breakdown across 5 dimensions: firmographics, technographics, pain points, budget fit, and behavioral signals. No AI calls \u2014 pure algorithmic scoring.",inputSchema:{type:"object",properties:{companyName:{type:"string",description:"Company name"},domain:{type:"string",description:"Company domain"},industry:{type:"string",description:"Industry vertical"},employeeCount:{type:"number",description:"Number of employees"},revenue:{type:"string",description:'Revenue range (e.g., "$1M-$5M")'},geography:{type:"string",description:"HQ location"},techStack:{type:"array",items:{type:"string"},description:"Technologies used"},painPoints:{type:"array",items:{type:"string"},description:"Known pain points or challenges"},triggerEvents:{type:"array",items:{type:"string"},description:'Recent trigger events (e.g., "just raised Series B", "new CTO hired")'}}}},{name:"get_persona_profile",description:"Find the best-matching buyer persona from your ICP for a given job title, industry, and company size. Returns persona details including MBTI distribution, pain points, empathy map, and messaging angles.",inputSchema:{type:"object",properties:{title:{type:"string",description:'Job title (e.g., "VP Engineering", "CTO", "Head of Sales")'},industry:{type:"string",description:"Industry context"},companySize:{type:"string",description:"Company size range"}},required:["title"]}},{name:"get_disqualification_signals",description:"Classify an opportunity using 3-layer scoring: ICP fit score, anti-pattern matching, and learned churn patterns. Returns STRONG/MODERATE/MARGINAL/ANTI_PATTERN classification with reasoning chain.",inputSchema:{type:"object",properties:{companyName:{type:"string",description:"Company name"},industry:{type:"string",description:"Industry"},employeeCount:{type:"number",description:"Number of employees"},revenue:{type:"string",description:"Revenue range"},geography:{type:"string",description:"Location"},techStack:{type:"array",items:{type:"string"},description:"Technologies used"},dealContext:{type:"object",properties:{dealValue:{type:"number",description:"Deal value"},stage:{type:"string",description:"Current deal stage"},daysInPipeline:{type:"number",description:"Days since deal entered pipeline"},championIdentified:{type:"boolean",description:"Has a champion been identified?"}},description:"Current deal context (if applicable)"}}}},{name:"get_messaging_framework",description:"Get messaging framework for a specific segment, funnel stage, or persona type. Returns value props, MBTI-adapted message templates, objection responses, voice variants, and content recommendations.",inputSchema:{type:"object",properties:{segment:{type:"string",description:"Target segment or vertical"},stage:{type:"string",enum:["awareness","consideration","decision"],description:"Buyer journey stage"},channel:{type:"string",description:"Channel (email, linkedin, phone, etc.)"},personaType:{type:"string",description:"Target persona title"},mbtiCategory:{type:"string",enum:["Analytical","Driver","Expressive","Amiable"],description:"MBTI communication category for message adaptation"}}}},{name:"get_competitive_positioning",description:"Get competitive positioning intelligence against a specific competitor. Returns differentiation points, landmines to avoid, winning themes, and battlecard data.",inputSchema:{type:"object",properties:{competitorName:{type:"string",description:"Competitor company name"},competitorFeatures:{type:"array",items:{type:"string"},description:"Known competitor features or capabilities"},context:{type:"string",description:'Additional context (e.g., "enterprise deal", "competing on price")'}},required:["competitorName"]}},{name:"classify_opportunity",description:"Classify an opportunity with full analysis: ICP fit score, persona match, disqualification check, risk assessment, and recommended next actions. Combines multiple engines for a comprehensive assessment.",inputSchema:{type:"object",properties:{companyName:{type:"string",description:"Company name"},contactTitle:{type:"string",description:"Primary contact job title"},industry:{type:"string",description:"Industry"},employeeCount:{type:"number",description:"Number of employees"},revenue:{type:"string",description:"Revenue range"},geography:{type:"string",description:"Location"},dealValue:{type:"number",description:"Estimated deal value"},dealStage:{type:"string",description:"Current deal stage"},techStack:{type:"array",items:{type:"string"},description:"Technologies used"},painPoints:{type:"array",items:{type:"string"},description:"Known pain points"},triggerEvents:{type:"array",items:{type:"string"},description:"Trigger events"},championIdentified:{type:"boolean",description:"Has a champion been identified?"},competitorInvolved:{type:"string",description:"Known competitor in the deal"}},required:["companyName"]}},{name:"get_account_plan",description:"Get a structured account plan for a target company. Returns stakeholder map, value propositions, capability gaps, meeting prep, MEDDICC assessment, and CRM update package. Requires an existing Pure Signal ICP pipeline.",inputSchema:{type:"object",properties:{accountName:{type:"string",description:"Target account/company name"},domain:{type:"string",description:"Company domain"},industry:{type:"string",description:"Industry vertical"},stakeholders:{type:"array",items:{type:"object",properties:{name:{type:"string"},title:{type:"string"},role:{type:"string",description:"Buying committee role (champion, economic_buyer, etc.)"}}},description:"Known stakeholders at the account"},dealContext:{type:"object",properties:{stage:{type:"string",description:"Current deal stage"},value:{type:"number",description:"Deal value"},nextMeeting:{type:"string",description:"Next meeting date/context"}},description:"Current deal context"}},required:["accountName"]}},{name:"get_capability_profile",description:"Get a structured capability profile for the authenticated user's product. Returns capabilities, target customer, verified outcomes, trust signals, pricing model, and integrations. Includes values-based alignment scoring. Designed for buyer-side agent evaluation.",inputSchema:{type:"object",properties:{includeOutcomes:{type:"boolean",description:"Include verified outcomes (default: true)"},includeTrustSignals:{type:"boolean",description:"Include trust signals (default: true)"},forceRefresh:{type:"boolean",description:"Force regeneration even if cached (default: false)"}}}},{name:"get_evaluation_criteria",description:"Evaluate seller-buyer alignment across Andru's 6 values: Empathy (pain point coverage), Clarity (outcome specificity), Authenticity (claim verification), Focus (feature relevance), Accountability (outcome tracking), Alignment (mutual investment). Returns scores 0-100 per dimension plus overall.",inputSchema:{type:"object",properties:{buyerPainPoints:{type:"array",items:{type:"string"},description:"Buyer's known pain points"},buyerIndustry:{type:"string",description:"Buyer's industry"},buyerSize:{type:"string",description:"Buyer company size"},requiredCapabilities:{type:"array",items:{type:"string"},description:"Capabilities the buyer needs"}}}},{name:"get_icp_profile",description:"Get the full Pure Signal ICP profile. Returns all 5 intelligence layers (Product-Market, Role, Psychological, Timing, Channel), the seven critical buyer questions, and anti-patterns/disqualifiers. Optionally filter to specific layers.",inputSchema:{type:"object",properties:{layers:{type:"array",items:{type:"number",enum:[1,2,3,4,5]},description:"Specific layers to include (1-5). Omit for all layers."},includeSevenAnswers:{type:"boolean",description:"Include seven answers (default: true)"},includeAntiPatterns:{type:"boolean",description:"Include anti-patterns (default: true)"}}}},{name:"discover_prospects",description:"Discover companies that match your ICP using AI-powered web search. Returns a list of prospects with confidence scores and evidence. NOTE: This is an expensive operation that calls Claude API with web search \u2014 it may take 15-30 seconds and consumes AI credits.",inputSchema:{type:"object",properties:{companyName:{type:"string",description:"Your company name"},productDescription:{type:"string",description:"Description of your product or service"},coreCapability:{type:"string",description:'Your core capability or "pure signal" \u2014 the single most important thing your product does'},industry:{type:"string",description:"Target industry to search within (optional)"},targetMarket:{type:"string",description:'Target market segment (optional, e.g., "Series A SaaS companies")'}},required:["companyName","productDescription"]}},{name:"get_pre_brief",description:"Generate a pre-meeting brief with talk track, discovery questions, objection prep, and contextual intelligence. Provide an eventId for calendar-linked briefs, or provide meeting context directly. NOTE: This calls the AI API and consumes credits.",inputSchema:{type:"object",properties:{eventId:{type:"string",description:"Calendar event ID (from Andru calendar integration). If provided, pulls all context automatically."},dealId:{type:"string",description:"Associated deal ID for additional deal intelligence (optional)"},briefType:{type:"string",enum:["general","discovery","demo","negotiation","renewal","expansion"],description:"Type of meeting brief to generate (default: general)"}}}},{name:"get_syndication_status",description:"Check the sync status of your ICP intelligence across connected CRM platforms (HubSpot, Salesforce, Pipedrive). Shows which platforms are up to date, which are stale, and the last sync time for each.",inputSchema:{type:"object",properties:{}}},{name:"trigger_syndication",description:"Manually trigger ICP intelligence syndication to your connected CRM platforms (HubSpot, Salesforce, Pipedrive). Detects which platforms are stale and pushes updated ICP data. Use get_syndication_status first to check which platforms need updating.",inputSchema:{type:"object",properties:{platforms:{type:"array",items:{type:"string"},description:'Optional filter \u2014 only sync these platforms (e.g., ["hubspot"]). If omitted, syncs all stale platforms.'}}}},{name:"batch_fit_score",description:"Score multiple companies against ICP criteria in a single batch. Returns individual scores plus aggregate statistics. Max 50 companies per call.",inputSchema:{type:"object",properties:{companies:{type:"array",items:{type:"object",properties:{companyName:{type:"string",description:"Company name"},domain:{type:"string",description:"Company domain"},industry:{type:"string",description:"Industry vertical"},employeeCount:{type:"number",description:"Number of employees"},revenue:{type:"string",description:"Revenue range"},geography:{type:"string",description:"HQ location"},techStack:{type:"array",items:{type:"string"},description:"Technologies used"},painPoints:{type:"array",items:{type:"string"},description:"Known pain points"},triggerEvents:{type:"array",items:{type:"string"},description:"Recent trigger events"}}},description:"Companies to score (max 50)"}},required:["companies"]}}],y_=[{uri:"andru://icp/profile",name:"ICP Profile",description:"Your canonical Ideal Customer Profile \u2014 the Pure Signal ICP output including all 5 layers of intelligence, 7 critical answers, and anti-patterns.",mimeType:"application/json"},{uri:"andru://pipeline/runs",name:"Pipeline Runs",description:"Your GTM pipeline runs \u2014 lists all completed pipeline runs with their stage outputs (ICP, Lead Gen Strategy, Account Plans, Overview Deck).",mimeType:"application/json"},{uri:"andru://accounts",name:"Account Plans",description:"Your account plans \u2014 company summaries, tiers, pipeline values, stakeholder counts, and generation status.",mimeType:"application/json"}];function tf(e){let t=new cs({name:"andru-intelligence",version:"0.1.1"},{capabilities:{tools:{},resources:{}}});return t.setRequestHandler(Hl,async()=>({tools:v_})),t.setRequestHandler(si,async r=>{if(!e)return{content:[{type:"text",text:JSON.stringify({error:"ANDRU_API_KEY not configured. Tool execution requires an API key."})}],isError:!0};let{name:n,arguments:i}=r.params;try{return await e.callTool(n,i||{})}catch(o){return{content:[{type:"text",text:JSON.stringify({error:o.message})}],isError:!0}}}),t.setRequestHandler(Ll,async()=>({resources:y_})),t.setRequestHandler(Fl,async r=>{if(!e)return{contents:[{uri:r.params.uri,mimeType:"text/plain",text:JSON.stringify({error:"ANDRU_API_KEY not configured. Resource reads require an API key."})}]};let{uri:n}=r.params;try{return await e.readResource(n)}catch(i){return{contents:[{uri:n,mimeType:"text/plain",text:JSON.stringify({error:i.message})}]}}}),t}async function rT(){let e=process.env.ANDRU_API_KEY,t=process.env.ANDRU_API_URL||"https://api.andru.ai",r=null;e?r=new ya(e,t):(console.error("[Andru MCP] Warning: ANDRU_API_KEY not set. Tool listing works, but execution requires an API key."),console.error("[Andru MCP] Get your API key at https://app.andru.ai/settings/api-keys"));let n=tf(r),i=new va;await n.connect(i),console.error("[Andru MCP] Server running on stdio transport"),r&&console.error(`[Andru MCP] API endpoint: ${t}`)}rT().catch(e=>{console.error("[Andru MCP] Fatal error:",e),process.exit(1)});function oU(){return tf(null)}export{oU as createSandboxServer};
|
|
50
|
-
//# sourceMappingURL=module.js.map
|