@netlify/agent-runner-cli 2.13.1-setup-satisfy-fix.0 → 2.14.0-nb590e7980a5a5.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.
@@ -3,10 +3,10 @@ var Dz=Object.create;var _f=Object.defineProperty;var Rz=Object.getOwnPropertyDe
3
3
  `:""},this._extScope=t,this._scope=new Dt.Scope({parent:t}),this._nodes=[new Qg]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,n){let i=this._extScope.value(t,n);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(t,n){return this._extScope.getValue(t,n)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,n,i,r){let o=this._scope.toName(n);return i!==void 0&&r&&(this._constants[o.str]=i),this._leafNode(new Kg(t,o,i)),o}const(t,n,i){return this._def(Dt.varKinds.const,t,n,i)}let(t,n,i){return this._def(Dt.varKinds.let,t,n,i)}var(t,n,i){return this._def(Dt.varKinds.var,t,n,i)}assign(t,n,i){return this._leafNode(new Pd(t,n,i))}add(t,n){return this._leafNode(new Gg(t,te.operators.ADD,n))}code(t){return typeof t=="function"?t():t!==ae.nil&&this._leafNode(new Yg(t)),this}object(...t){let n=["{"];for(let[i,r]of t)n.length>1&&n.push(","),n.push(i),(i!==r||this.opts.es5)&&(n.push(":"),(0,ae.addCodeArg)(n,r));return n.push("}"),new ae._Code(n)}if(t,n,i){if(this._blockNode(new mn(t)),n&&i)this.code(n).else().code(i).endIf();else if(n)this.code(n).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new mn(t))}else(){return this._elseNode(new Bi)}endIf(){return this._endBlockNode(mn,Bi)}_for(t,n){return this._blockNode(t),n&&this.code(n).endFor(),this}for(t,n){return this._for(new ev(t),n)}forRange(t,n,i,r,o=this.opts.es5?Dt.varKinds.var:Dt.varKinds.let){let a=this._scope.toName(t);return this._for(new tv(o,a,n,i),()=>r(a))}forOf(t,n,i,r=Dt.varKinds.const){let o=this._scope.toName(t);if(this.opts.es5){let a=n instanceof ae.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,ae._)`${a}.length`,s=>{this.var(o,(0,ae._)`${a}[${s}]`),i(o)})}return this._for(new Td("of",r,o,n),()=>i(o))}forIn(t,n,i,r=this.opts.es5?Dt.varKinds.var:Dt.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ae._)`Object.keys(${n})`,i);let o=this._scope.toName(t);return this._for(new Td("in",r,o,n),()=>i(o))}endFor(){return this._endBlockNode(hn)}label(t){return this._leafNode(new Hg(t))}break(t){return this._leafNode(new Wg(t))}return(t){let n=new rs;if(this._blockNode(n),this.code(t),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(rs)}try(t,n,i){if(!n&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new rv;if(this._blockNode(r),this.code(t),n){let o=this.name("e");this._currNode=r.catch=new ns(o),n(o)}return i&&(this._currNode=r.finally=new is,this.code(i)),this._endBlockNode(ns,is)}throw(t){return this._leafNode(new Xg(t))}block(t,n){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(n),this}endBlock(t){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-n;if(i<0||t!==void 0&&i!==t)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`);return this._nodes.length=n,this}func(t,n=ae.nil,i,r){return this._blockNode(new ts(t,n,i)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(ts)}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,n){let i=this._currNode;if(i instanceof t||n&&i instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${t.kind}/${n.kind}`:t.kind}"`)}_elseNode(t){let n=this._currNode;if(!(n instanceof mn))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let n=this._nodes;n[n.length-1]=t}};te.CodeGen=nv;function gn(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function Od(e,t){return t instanceof ae._CodeOrName?gn(e,t.names):e}function Ji(e,t,n){if(e instanceof ae.Name)return i(e);if(!r(e))return e;return new ae._Code(e._items.reduce((o,a)=>(a instanceof ae.Name&&(a=i(a)),a instanceof ae._Code?o.push(...a._items):o.push(a),o),[]));function i(o){let a=n[o.str];return a===void 0||t[o.str]!==1?o:(delete t[o.str],a)}function r(o){return o instanceof ae._Code&&o._items.some(a=>a instanceof ae.Name&&t[a.str]===1&&n[a.str]!==void 0)}}function jj(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function fw(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ae._)`!${iv(e)}`}te.not=fw;var Aj=pw(te.operators.AND);function Dj(...e){return e.reduce(Aj)}te.and=Dj;var Rj=pw(te.operators.OR);function Cj(...e){return e.reduce(Rj)}te.or=Cj;function pw(e){return(t,n)=>t===ae.nil?n:n===ae.nil?t:(0,ae._)`${iv(t)} ${e} ${iv(n)}`}function iv(e){return e instanceof ae.Name?e:(0,ae._)`(${e})`}});var se=N(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.checkStrictMode=ne.getErrorPath=ne.Type=ne.useFunc=ne.setEvaluated=ne.evaluatedPropsToName=ne.mergeEvaluated=ne.eachItem=ne.unescapeJsonPointer=ne.escapeJsonPointer=ne.escapeFragment=ne.unescapeFragment=ne.schemaRefOrVal=ne.schemaHasRulesButRef=ne.schemaHasRules=ne.checkUnknownRules=ne.alwaysValidSchema=ne.toHash=void 0;var xe=Y(),Uj=Qa();function Zj(e){let t={};for(let n of e)t[n]=!0;return t}ne.toHash=Zj;function Mj(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(gw(e,t),!vw(t,e.self.RULES.all))}ne.alwaysValidSchema=Mj;function gw(e,t=e.schema){let{opts:n,self:i}=e;if(!n.strictSchema||typeof t=="boolean")return;let r=i.RULES.keywords;for(let o in t)r[o]||$w(e,`unknown keyword: "${o}"`)}ne.checkUnknownRules=gw;function vw(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}ne.schemaHasRules=vw;function Lj(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}ne.schemaHasRulesButRef=Lj;function Vj({topSchemaRef:e,schemaPath:t},n,i,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,xe._)`${n}`}return(0,xe._)`${e}${t}${(0,xe.getProperty)(i)}`}ne.schemaRefOrVal=Vj;function qj(e){return yw(decodeURIComponent(e))}ne.unescapeFragment=qj;function Fj(e){return encodeURIComponent(av(e))}ne.escapeFragment=Fj;function av(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ne.escapeJsonPointer=av;function yw(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ne.unescapeJsonPointer=yw;function Bj(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}ne.eachItem=Bj;function mw({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:i}){return(r,o,a,s)=>{let c=a===void 0?o:a instanceof xe.Name?(o instanceof xe.Name?e(r,o,a):t(r,o,a),a):o instanceof xe.Name?(t(r,a,o),o):n(o,a);return s===xe.Name&&!(c instanceof xe.Name)?i(r,c):c}}ne.mergeEvaluated={props:mw({mergeNames:(e,t,n)=>e.if((0,xe._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,xe._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,xe._)`${n} || {}`).code((0,xe._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,xe._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,xe._)`${n} || {}`),sv(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:_w}),items:mw({mergeNames:(e,t,n)=>e.if((0,xe._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,xe._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,xe._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,xe._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function _w(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",(0,xe._)`{}`);return t!==void 0&&sv(e,n,t),n}ne.evaluatedPropsToName=_w;function sv(e,t,n){Object.keys(n).forEach(i=>e.assign((0,xe._)`${t}${(0,xe.getProperty)(i)}`,!0))}ne.setEvaluated=sv;var hw={};function Jj(e,t){return e.scopeValue("func",{ref:t,code:hw[t.code]||(hw[t.code]=new Uj._Code(t.code))})}ne.useFunc=Jj;var ov;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ov||(ne.Type=ov={}));function Kj(e,t,n){if(e instanceof xe.Name){let i=t===ov.Num;return n?i?(0,xe._)`"[" + ${e} + "]"`:(0,xe._)`"['" + ${e} + "']"`:i?(0,xe._)`"/" + ${e}`:(0,xe._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,xe.getProperty)(e).toString():"/"+av(e)}ne.getErrorPath=Kj;function $w(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}ne.checkStrictMode=$w});var dr=N(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});var Be=Y(),Gj={data:new Be.Name("data"),valCxt:new Be.Name("valCxt"),instancePath:new Be.Name("instancePath"),parentData:new Be.Name("parentData"),parentDataProperty:new Be.Name("parentDataProperty"),rootData:new Be.Name("rootData"),dynamicAnchors:new Be.Name("dynamicAnchors"),vErrors:new Be.Name("vErrors"),errors:new Be.Name("errors"),this:new Be.Name("this"),self:new Be.Name("self"),scope:new Be.Name("scope"),json:new Be.Name("json"),jsonPos:new Be.Name("jsonPos"),jsonLen:new Be.Name("jsonLen"),jsonPart:new Be.Name("jsonPart")};cv.default=Gj});var os=N(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.extendErrors=Je.resetErrorsCount=Je.reportExtraError=Je.reportError=Je.keyword$DataError=Je.keywordError=void 0;var ce=Y(),Nd=se(),tt=dr();Je.keywordError={message:({keyword:e})=>(0,ce.str)`must pass "${e}" keyword validation`};Je.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ce.str)`"${e}" keyword must be ${t} ($data)`:(0,ce.str)`"${e}" keyword is invalid ($data)`};function Hj(e,t=Je.keywordError,n,i){let{it:r}=e,{gen:o,compositeRule:a,allErrors:s}=r,c=kw(e,t,n);i??(a||s)?bw(o,c):xw(r,(0,ce._)`[${c}]`)}Je.reportError=Hj;function Wj(e,t=Je.keywordError,n){let{it:i}=e,{gen:r,compositeRule:o,allErrors:a}=i,s=kw(e,t,n);bw(r,s),o||a||xw(i,tt.default.vErrors)}Je.reportExtraError=Wj;function Xj(e,t){e.assign(tt.default.errors,t),e.if((0,ce._)`${tt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ce._)`${tt.default.vErrors}.length`,t),()=>e.assign(tt.default.vErrors,null)))}Je.resetErrorsCount=Xj;function Yj({gen:e,keyword:t,schemaValue:n,data:i,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",r,tt.default.errors,s=>{e.const(a,(0,ce._)`${tt.default.vErrors}[${s}]`),e.if((0,ce._)`${a}.instancePath === undefined`,()=>e.assign((0,ce._)`${a}.instancePath`,(0,ce.strConcat)(tt.default.instancePath,o.errorPath))),e.assign((0,ce._)`${a}.schemaPath`,(0,ce.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,ce._)`${a}.schema`,n),e.assign((0,ce._)`${a}.data`,i))})}Je.extendErrors=Yj;function bw(e,t){let n=e.const("err",t);e.if((0,ce._)`${tt.default.vErrors} === null`,()=>e.assign(tt.default.vErrors,(0,ce._)`[${n}]`),(0,ce._)`${tt.default.vErrors}.push(${n})`),e.code((0,ce._)`${tt.default.errors}++`)}function xw(e,t){let{gen:n,validateName:i,schemaEnv:r}=e;r.$async?n.throw((0,ce._)`new ${e.ValidationError}(${t})`):(n.assign((0,ce._)`${i}.errors`,t),n.return(!1))}var vn={keyword:new ce.Name("keyword"),schemaPath:new ce.Name("schemaPath"),params:new ce.Name("params"),propertyName:new ce.Name("propertyName"),message:new ce.Name("message"),schema:new ce.Name("schema"),parentSchema:new ce.Name("parentSchema")};function kw(e,t,n){let{createErrors:i}=e.it;return i===!1?(0,ce._)`{}`:Qj(e,t,n)}function Qj(e,t,n={}){let{gen:i,it:r}=e,o=[eA(r,n),tA(e,n)];return rA(e,t,o),i.object(...o)}function eA({errorPath:e},{instancePath:t}){let n=t?(0,ce.str)`${e}${(0,Nd.getErrorPath)(t,Nd.Type.Str)}`:e;return[tt.default.instancePath,(0,ce.strConcat)(tt.default.instancePath,n)]}function tA({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:i}){let r=i?t:(0,ce.str)`${t}/${e}`;return n&&(r=(0,ce.str)`${r}${(0,Nd.getErrorPath)(n,Nd.Type.Str)}`),[vn.schemaPath,r]}function rA(e,{params:t,message:n},i){let{keyword:r,data:o,schemaValue:a,it:s}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=s;i.push([vn.keyword,r],[vn.params,typeof t=="function"?t(e):t||(0,ce._)`{}`]),c.messages&&i.push([vn.message,typeof n=="function"?n(e):n]),c.verbose&&i.push([vn.schema,a],[vn.parentSchema,(0,ce._)`${l}${d}`],[tt.default.data,o]),u&&i.push([vn.propertyName,u])}});var Sw=N(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.boolOrEmptySchema=Ki.topBoolOrEmptySchema=void 0;var nA=os(),iA=Y(),oA=dr(),aA={message:"boolean schema is false"};function sA(e){let{gen:t,schema:n,validateName:i}=e;n===!1?ww(e,!1):typeof n=="object"&&n.$async===!0?t.return(oA.default.data):(t.assign((0,iA._)`${i}.errors`,null),t.return(!0))}Ki.topBoolOrEmptySchema=sA;function cA(e,t){let{gen:n,schema:i}=e;i===!1?(n.var(t,!1),ww(e)):n.var(t,!0)}Ki.boolOrEmptySchema=cA;function ww(e,t){let{gen:n,data:i}=e,r={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,nA.reportError)(r,aA,void 0,t)}});var uv=N(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.getRules=Gi.isJSONType=void 0;var uA=["string","number","integer","boolean","null","object","array"],lA=new Set(uA);function dA(e){return typeof e=="string"&&lA.has(e)}Gi.isJSONType=dA;function fA(){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:{}}}Gi.getRules=fA});var lv=N(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.shouldUseRule=Dr.shouldUseGroup=Dr.schemaHasRulesForType=void 0;function pA({schema:e,self:t},n){let i=t.RULES.types[n];return i&&i!==!0&&Iw(e,i)}Dr.schemaHasRulesForType=pA;function Iw(e,t){return t.rules.some(n=>zw(e,n))}Dr.shouldUseGroup=Iw;function zw(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(i=>e[i]!==void 0))}Dr.shouldUseRule=zw});var as=N(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.reportTypeError=Ke.checkDataTypes=Ke.checkDataType=Ke.coerceAndCheckDataType=Ke.getJSONTypes=Ke.getSchemaTypes=Ke.DataType=void 0;var mA=uv(),hA=lv(),gA=os(),X=Y(),Pw=se(),Hi;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Hi||(Ke.DataType=Hi={}));function vA(e){let t=Tw(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}Ke.getSchemaTypes=vA;function Tw(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(mA.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Ke.getJSONTypes=Tw;function yA(e,t){let{gen:n,data:i,opts:r}=e,o=_A(t,r.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,hA.schemaHasRulesForType)(e,t[0]));if(a){let s=fv(t,i,r.strictNumbers,Hi.Wrong);n.if(s,()=>{o.length?$A(e,t,o):pv(e)})}return a}Ke.coerceAndCheckDataType=yA;var Ow=new Set(["string","number","integer","boolean","null"]);function _A(e,t){return t?e.filter(n=>Ow.has(n)||t==="array"&&n==="array"):[]}function $A(e,t,n){let{gen:i,data:r,opts:o}=e,a=i.let("dataType",(0,X._)`typeof ${r}`),s=i.let("coerced",(0,X._)`undefined`);o.coerceTypes==="array"&&i.if((0,X._)`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>i.assign(r,(0,X._)`${r}[0]`).assign(a,(0,X._)`typeof ${r}`).if(fv(t,r,o.strictNumbers),()=>i.assign(s,r))),i.if((0,X._)`${s} !== undefined`);for(let u of n)(Ow.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);i.else(),pv(e),i.endIf(),i.if((0,X._)`${s} !== undefined`,()=>{i.assign(r,s),bA(e,s)});function c(u){switch(u){case"string":i.elseIf((0,X._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,X._)`"" + ${r}`).elseIf((0,X._)`${r} === null`).assign(s,(0,X._)`""`);return;case"number":i.elseIf((0,X._)`${a} == "boolean" || ${r} === null
4
4
  || (${a} == "string" && ${r} && ${r} == +${r})`).assign(s,(0,X._)`+${r}`);return;case"integer":i.elseIf((0,X._)`${a} === "boolean" || ${r} === null
5
5
  || (${a} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(s,(0,X._)`+${r}`);return;case"boolean":i.elseIf((0,X._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(s,!1).elseIf((0,X._)`${r} === "true" || ${r} === 1`).assign(s,!0);return;case"null":i.elseIf((0,X._)`${r} === "" || ${r} === 0 || ${r} === false`),i.assign(s,null);return;case"array":i.elseIf((0,X._)`${a} === "string" || ${a} === "number"
6
- || ${a} === "boolean" || ${r} === null`).assign(s,(0,X._)`[${r}]`)}}}function bA({gen:e,parentData:t,parentDataProperty:n},i){e.if((0,X._)`${t} !== undefined`,()=>e.assign((0,X._)`${t}[${n}]`,i))}function dv(e,t,n,i=Hi.Correct){let r=i===Hi.Correct?X.operators.EQ:X.operators.NEQ,o;switch(e){case"null":return(0,X._)`${t} ${r} null`;case"array":o=(0,X._)`Array.isArray(${t})`;break;case"object":o=(0,X._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,X._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,X._)`typeof ${t} ${r} ${e}`}return i===Hi.Correct?o:(0,X.not)(o);function a(s=X.nil){return(0,X.and)((0,X._)`typeof ${t} == "number"`,s,n?(0,X._)`isFinite(${t})`:X.nil)}}Ke.checkDataType=dv;function fv(e,t,n,i){if(e.length===1)return dv(e[0],t,n,i);let r,o=(0,Pw.toHash)(e);if(o.array&&o.object){let a=(0,X._)`typeof ${t} != "object"`;r=o.null?a:(0,X._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else r=X.nil;o.number&&delete o.integer;for(let a in o)r=(0,X.and)(r,dv(a,t,n,i));return r}Ke.checkDataTypes=fv;var xA={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,X._)`{type: ${e}}`:(0,X._)`{type: ${t}}`};function pv(e){let t=kA(e);(0,gA.reportError)(t,xA)}Ke.reportTypeError=pv;function kA(e){let{gen:t,data:n,schema:i}=e,r=(0,Pw.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:e}}});var Nw=N(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.assignDefaults=void 0;var Wi=Y(),wA=se();function SA(e,t){let{properties:n,items:i}=e.schema;if(t==="object"&&n)for(let r in n)Ew(e,r,n[r].default);else t==="array"&&Array.isArray(i)&&i.forEach((r,o)=>Ew(e,o,r.default))}jd.assignDefaults=SA;function Ew(e,t,n){let{gen:i,compositeRule:r,data:o,opts:a}=e;if(n===void 0)return;let s=(0,Wi._)`${o}${(0,Wi.getProperty)(t)}`;if(r){(0,wA.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,Wi._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,Wi._)`${c} || ${s} === null || ${s} === ""`),i.if(c,(0,Wi._)`${s} = ${(0,Wi.stringify)(n)}`)}});var St=N(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.validateUnion=be.validateArray=be.usePattern=be.callValidateCode=be.schemaProperties=be.allSchemaProperties=be.noPropertyInData=be.propertyInData=be.isOwnProperty=be.hasPropFunc=be.reportMissingProp=be.checkMissingProp=be.checkReportMissingProp=void 0;var we=Y(),mv=se(),Rr=dr(),IA=se();function zA(e,t){let{gen:n,data:i,it:r}=e;n.if(gv(n,i,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,we._)`${t}`},!0),e.error()})}be.checkReportMissingProp=zA;function PA({gen:e,data:t,it:{opts:n}},i,r){return(0,we.or)(...i.map(o=>(0,we.and)(gv(e,t,o,n.ownProperties),(0,we._)`${r} = ${o}`)))}be.checkMissingProp=PA;function TA(e,t){e.setParams({missingProperty:t},!0),e.error()}be.reportMissingProp=TA;function jw(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,we._)`Object.prototype.hasOwnProperty`})}be.hasPropFunc=jw;function hv(e,t,n){return(0,we._)`${jw(e)}.call(${t}, ${n})`}be.isOwnProperty=hv;function OA(e,t,n,i){let r=(0,we._)`${t}${(0,we.getProperty)(n)} !== undefined`;return i?(0,we._)`${r} && ${hv(e,t,n)}`:r}be.propertyInData=OA;function gv(e,t,n,i){let r=(0,we._)`${t}${(0,we.getProperty)(n)} === undefined`;return i?(0,we.or)(r,(0,we.not)(hv(e,t,n))):r}be.noPropertyInData=gv;function Aw(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}be.allSchemaProperties=Aw;function EA(e,t){return Aw(t).filter(n=>!(0,mv.alwaysValidSchema)(e,t[n]))}be.schemaProperties=EA;function NA({schemaCode:e,data:t,it:{gen:n,topSchemaRef:i,schemaPath:r,errorPath:o},it:a},s,c,u){let l=u?(0,we._)`${e}, ${t}, ${i}${r}`:t,d=[[Rr.default.instancePath,(0,we.strConcat)(Rr.default.instancePath,o)],[Rr.default.parentData,a.parentData],[Rr.default.parentDataProperty,a.parentDataProperty],[Rr.default.rootData,Rr.default.rootData]];a.opts.dynamicRef&&d.push([Rr.default.dynamicAnchors,Rr.default.dynamicAnchors]);let f=(0,we._)`${l}, ${n.object(...d)}`;return c!==we.nil?(0,we._)`${s}.call(${c}, ${f})`:(0,we._)`${s}(${f})`}be.callValidateCode=NA;var jA=(0,we._)`new RegExp`;function AA({gen:e,it:{opts:t}},n){let i=t.unicodeRegExp?"u":"",{regExp:r}=t.code,o=r(n,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,we._)`${r.code==="new RegExp"?jA:(0,IA.useFunc)(e,r)}(${n}, ${i})`})}be.usePattern=AA;function DA(e){let{gen:t,data:n,keyword:i,it:r}=e,o=t.name("valid");if(r.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,we._)`${n}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:mv.Type.Num},o),t.if((0,we.not)(o),s)})}}be.validateArray=DA;function RA(e){let{gen:t,schema:n,keyword:i,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(c=>(0,mv.alwaysValidSchema)(r,c))&&!r.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>n.forEach((c,u)=>{let l=e.subschema({keyword:i,schemaProp:u,compositeRule:!0},s);t.assign(a,(0,we._)`${a} || ${s}`),e.mergeValidEvaluated(l,s)||t.if((0,we.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}be.validateUnion=RA});var Cw=N(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.validateKeywordUsage=Kt.validSchemaType=Kt.funcKeywordCode=Kt.macroKeywordCode=void 0;var rt=Y(),yn=dr(),CA=St(),UA=os();function ZA(e,t){let{gen:n,keyword:i,schema:r,parentSchema:o,it:a}=e,s=t.macro.call(a.self,r,o,a),c=Rw(n,i,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let u=n.name("valid");e.subschema({schema:s,schemaPath:rt.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Kt.macroKeywordCode=ZA;function MA(e,t){var n;let{gen:i,keyword:r,schema:o,parentSchema:a,$data:s,it:c}=e;VA(c,t);let u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=Rw(i,r,u),d=i.let("valid");e.block$data(d,f),e.ok((n=t.valid)!==null&&n!==void 0?n:d);function f(){if(t.errors===!1)h(),t.modifying&&Dw(e),y(()=>e.error());else{let $=t.async?p():m();t.modifying&&Dw(e),y(()=>LA(e,$))}}function p(){let $=i.let("ruleErrs",null);return i.try(()=>h((0,rt._)`await `),w=>i.assign(d,!1).if((0,rt._)`${w} instanceof ${c.ValidationError}`,()=>i.assign($,(0,rt._)`${w}.errors`),()=>i.throw(w))),$}function m(){let $=(0,rt._)`${l}.errors`;return i.assign($,null),h(rt.nil),$}function h($=t.async?(0,rt._)`await `:rt.nil){let w=c.opts.passContext?yn.default.this:yn.default.self,z=!("compile"in t&&!s||t.schema===!1);i.assign(d,(0,rt._)`${$}${(0,CA.callValidateCode)(e,l,w,z)}`,t.modifying)}function y($){var w;i.if((0,rt.not)((w=t.valid)!==null&&w!==void 0?w:d),$)}}Kt.funcKeywordCode=MA;function Dw(e){let{gen:t,data:n,it:i}=e;t.if(i.parentData,()=>t.assign(n,(0,rt._)`${i.parentData}[${i.parentDataProperty}]`))}function LA(e,t){let{gen:n}=e;n.if((0,rt._)`Array.isArray(${t})`,()=>{n.assign(yn.default.vErrors,(0,rt._)`${yn.default.vErrors} === null ? ${t} : ${yn.default.vErrors}.concat(${t})`).assign(yn.default.errors,(0,rt._)`${yn.default.vErrors}.length`),(0,UA.extendErrors)(e)},()=>e.error())}function VA({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Rw(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,rt.stringify)(n)})}function qA(e,t,n=!1){return!t.length||t.some(i=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||n&&typeof e>"u")}Kt.validSchemaType=qA;function FA({schema:e,opts:t,self:n,errSchemaPath:i},r,o){if(Array.isArray(r.keyword)?!r.keyword.includes(o):r.keyword!==o)throw new Error("ajv implementation error");let a=r.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${i}": `+n.errorsText(r.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(c);else throw new Error(c)}}Kt.validateKeywordUsage=FA});var Zw=N(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.extendSubschemaMode=Cr.extendSubschemaData=Cr.getSubschema=void 0;var Gt=Y(),Uw=se();function BA(e,{keyword:t,schemaProp:n,schema:i,schemaPath:r,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return n===void 0?{schema:s,schemaPath:(0,Gt._)`${e.schemaPath}${(0,Gt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:(0,Gt._)`${e.schemaPath}${(0,Gt.getProperty)(t)}${(0,Gt.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Uw.escapeFragment)(n)}`}}if(i!==void 0){if(r===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:r,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Cr.getSubschema=BA;function JA(e,t,{dataProp:n,dataPropType:i,data:r,dataTypes:o,propertyName:a}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(n!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,f=s.let("data",(0,Gt._)`${t.data}${(0,Gt.getProperty)(n)}`,!0);c(f),e.errorPath=(0,Gt.str)`${u}${(0,Uw.getErrorPath)(n,i,d.jsPropertySyntax)}`,e.parentDataProperty=(0,Gt._)`${n}`,e.dataPathArr=[...l,e.parentDataProperty]}if(r!==void 0){let u=r instanceof Gt.Name?r:s.let("data",r,!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]}}Cr.extendSubschemaData=JA;function KA(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:r,allErrors:o}){i!==void 0&&(e.compositeRule=i),r!==void 0&&(e.createErrors=r),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=n}Cr.extendSubschemaMode=KA});var vv=N((BF,Mw)=>{"use strict";Mw.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),i=o.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;r--!==0;){var a=o[r];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}});var Vw=N((JF,Lw)=>{"use strict";var Ur=Lw.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var i=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};Ad(t,i,r,e,"",e)};Ur.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ur.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ur.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ur.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 Ad(e,t,n,i,r,o,a,s,c,u){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,r,o,a,s,c,u);for(var l in i){var d=i[l];if(Array.isArray(d)){if(l in Ur.arrayKeywords)for(var f=0;f<d.length;f++)Ad(e,t,n,d[f],r+"/"+l+"/"+f,o,r,l,i,f)}else if(l in Ur.propsKeywords){if(d&&typeof d=="object")for(var p in d)Ad(e,t,n,d[p],r+"/"+l+"/"+GA(p),o,r,l,i,p)}else(l in Ur.keywords||e.allKeys&&!(l in Ur.skipKeywords))&&Ad(e,t,n,d,r+"/"+l,o,r,l,i)}n(i,r,o,a,s,c,u)}}function GA(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var ss=N(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.getSchemaRefs=lt.resolveUrl=lt.normalizeId=lt._getFullPath=lt.getFullPath=lt.inlineRef=void 0;var HA=se(),WA=vv(),XA=Vw(),YA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function QA(e,t=!0){return typeof e=="boolean"?!0:t===!0?!yv(e):t?qw(e)<=t:!1}lt.inlineRef=QA;var eD=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function yv(e){for(let t in e){if(eD.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(yv)||typeof n=="object"&&yv(n))return!0}return!1}function qw(e){let t=0;for(let n in e){if(n==="$ref")return 1/0;if(t++,!YA.has(n)&&(typeof e[n]=="object"&&(0,HA.eachItem)(e[n],i=>t+=qw(i)),t===1/0))return 1/0}return t}function Fw(e,t="",n){n!==!1&&(t=Xi(t));let i=e.parse(t);return Bw(e,i)}lt.getFullPath=Fw;function Bw(e,t){return e.serialize(t).split("#")[0]+"#"}lt._getFullPath=Bw;var tD=/#\/?$/;function Xi(e){return e?e.replace(tD,""):""}lt.normalizeId=Xi;function rD(e,t,n){return n=Xi(n),e.resolve(t,n)}lt.resolveUrl=rD;var nD=/^[a-z_][-a-z0-9._]*$/i;function iD(e,t){if(typeof e=="boolean")return{};let{schemaId:n,uriResolver:i}=this.opts,r=Xi(e[n]||t),o={"":r},a=Fw(i,r,!1),s={},c=new Set;return XA(e,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=a+f,y=o[m];typeof d[n]=="string"&&(y=$.call(this,d[n])),w.call(this,d.$anchor),w.call(this,d.$dynamicAnchor),o[f]=y;function $(z){let D=this.opts.uriResolver.resolve;if(z=Xi(y?D(y,z):z),c.has(z))throw l(z);c.add(z);let E=this.refs[z];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?u(d,E.schema,z):z!==Xi(h)&&(z[0]==="#"?(u(d,s[z],z),s[z]=d):this.refs[z]=h),z}function w(z){if(typeof z=="string"){if(!nD.test(z))throw new Error(`invalid anchor "${z}"`);$.call(this,`#${z}`)}}}),s;function u(d,f,p){if(f!==void 0&&!WA(d,f))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}lt.getSchemaRefs=iD});var ls=N(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.getData=Zr.KeywordCxt=Zr.validateFunctionCode=void 0;var Ww=Sw(),Jw=as(),$v=lv(),Dd=as(),oD=Nw(),us=Cw(),_v=Zw(),M=Y(),J=dr(),aD=ss(),fr=se(),cs=os();function sD(e){if(Qw(e)&&(eS(e),Yw(e))){lD(e);return}Xw(e,()=>(0,Ww.topBoolOrEmptySchema)(e))}Zr.validateFunctionCode=sD;function Xw({gen:e,validateName:t,schema:n,schemaEnv:i,opts:r},o){r.code.es5?e.func(t,(0,M._)`${J.default.data}, ${J.default.valCxt}`,i.$async,()=>{e.code((0,M._)`"use strict"; ${Kw(n,r)}`),uD(e,r),e.code(o)}):e.func(t,(0,M._)`${J.default.data}, ${cD(r)}`,i.$async,()=>e.code(Kw(n,r)).code(o))}function cD(e){return(0,M._)`{${J.default.instancePath}="", ${J.default.parentData}, ${J.default.parentDataProperty}, ${J.default.rootData}=${J.default.data}${e.dynamicRef?(0,M._)`, ${J.default.dynamicAnchors}={}`:M.nil}}={}`}function uD(e,t){e.if(J.default.valCxt,()=>{e.var(J.default.instancePath,(0,M._)`${J.default.valCxt}.${J.default.instancePath}`),e.var(J.default.parentData,(0,M._)`${J.default.valCxt}.${J.default.parentData}`),e.var(J.default.parentDataProperty,(0,M._)`${J.default.valCxt}.${J.default.parentDataProperty}`),e.var(J.default.rootData,(0,M._)`${J.default.valCxt}.${J.default.rootData}`),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,M._)`${J.default.valCxt}.${J.default.dynamicAnchors}`)},()=>{e.var(J.default.instancePath,(0,M._)`""`),e.var(J.default.parentData,(0,M._)`undefined`),e.var(J.default.parentDataProperty,(0,M._)`undefined`),e.var(J.default.rootData,J.default.data),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,M._)`{}`)})}function lD(e){let{schema:t,opts:n,gen:i}=e;Xw(e,()=>{n.$comment&&t.$comment&&rS(e),hD(e),i.let(J.default.vErrors,null),i.let(J.default.errors,0),n.unevaluated&&dD(e),tS(e),yD(e)})}function dD(e){let{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,M._)`${n}.evaluated`),t.if((0,M._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,M._)`${e.evaluated}.props`,(0,M._)`undefined`)),t.if((0,M._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,M._)`${e.evaluated}.items`,(0,M._)`undefined`))}function Kw(e,t){let n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,M._)`/*# sourceURL=${n} */`:M.nil}function fD(e,t){if(Qw(e)&&(eS(e),Yw(e))){pD(e,t);return}(0,Ww.boolOrEmptySchema)(e,t)}function Yw({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function Qw(e){return typeof e.schema!="boolean"}function pD(e,t){let{schema:n,gen:i,opts:r}=e;r.$comment&&n.$comment&&rS(e),gD(e),vD(e);let o=i.const("_errs",J.default.errors);tS(e,o),i.var(t,(0,M._)`${o} === ${J.default.errors}`)}function eS(e){(0,fr.checkUnknownRules)(e),mD(e)}function tS(e,t){if(e.opts.jtd)return Gw(e,[],!1,t);let n=(0,Jw.getSchemaTypes)(e.schema),i=(0,Jw.coerceAndCheckDataType)(e,n);Gw(e,n,!i,t)}function mD(e){let{schema:t,errSchemaPath:n,opts:i,self:r}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,fr.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function hD(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,fr.checkStrictMode)(e,"default is ignored in the schema root")}function gD(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,aD.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function vD(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function rS({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:r}){let o=n.$comment;if(r.$comment===!0)e.code((0,M._)`${J.default.self}.logger.log(${o})`);else if(typeof r.$comment=="function"){let a=(0,M.str)`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,M._)`${J.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function yD(e){let{gen:t,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=e;n.$async?t.if((0,M._)`${J.default.errors} === 0`,()=>t.return(J.default.data),()=>t.throw((0,M._)`new ${r}(${J.default.vErrors})`)):(t.assign((0,M._)`${i}.errors`,J.default.vErrors),o.unevaluated&&_D(e),t.return((0,M._)`${J.default.errors} === 0`))}function _D({gen:e,evaluated:t,props:n,items:i}){n instanceof M.Name&&e.assign((0,M._)`${t}.props`,n),i instanceof M.Name&&e.assign((0,M._)`${t}.items`,i)}function Gw(e,t,n,i){let{gen:r,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,fr.schemaHasRulesButRef)(o,l))){r.block(()=>iS(e,"$ref",l.all.$ref.definition));return}c.jtd||$D(e,t),r.block(()=>{for(let f of l.rules)d(f);d(l.post)});function d(f){(0,$v.shouldUseGroup)(o,f)&&(f.type?(r.if((0,Dd.checkDataType)(f.type,a,c.strictNumbers)),Hw(e,f),t.length===1&&t[0]===f.type&&n&&(r.else(),(0,Dd.reportTypeError)(e)),r.endIf()):Hw(e,f),s||r.if((0,M._)`${J.default.errors} === ${i||0}`))}}function Hw(e,t){let{gen:n,schema:i,opts:{useDefaults:r}}=e;r&&(0,oD.assignDefaults)(e,t.type),n.block(()=>{for(let o of t.rules)(0,$v.shouldUseRule)(i,o)&&iS(e,o.keyword,o.definition,t.type)})}function $D(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(bD(e,t),e.opts.allowUnionTypes||xD(e,t),kD(e,e.dataTypes))}function bD(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{nS(e.dataTypes,n)||bv(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),SD(e,t)}}function xD(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&bv(e,"use allowUnionTypes to allow union type keyword")}function kD(e,t){let n=e.self.RULES.all;for(let i in n){let r=n[i];if(typeof r=="object"&&(0,$v.shouldUseRule)(e.schema,r)){let{type:o}=r.definition;o.length&&!o.some(a=>wD(t,a))&&bv(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function wD(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function nS(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function SD(e,t){let n=[];for(let i of e.dataTypes)nS(t,i)?n.push(i):t.includes("integer")&&i==="number"&&n.push("integer");e.dataTypes=n}function bv(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,fr.checkStrictMode)(e,t,e.opts.strictTypes)}var Rd=class{constructor(t,n,i){if((0,us.validateKeywordUsage)(t,n,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,fr.schemaRefOrVal)(t,this.schema,i,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",oS(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,us.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=t.gen.const("_errs",J.default.errors))}result(t,n,i){this.failResult((0,M.not)(t),n,i)}failResult(t,n,i){this.gen.if(t),i?i():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,M.not)(t),void 0,n)}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:n}=this;this.fail((0,M._)`${n} !== undefined && (${(0,M.or)(this.invalid$data(),t)})`)}error(t,n,i){if(n){this.setParams(n),this._error(t,i),this.setParams({});return}this._error(t,i)}_error(t,n){(t?cs.reportExtraError:cs.reportError)(this,this.def.error,n)}$dataError(){(0,cs.reportError)(this,this.def.$dataError||cs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,cs.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,i=M.nil){this.gen.block(()=>{this.check$data(t,i),n()})}check$data(t=M.nil,n=M.nil){if(!this.$data)return;let{gen:i,schemaCode:r,schemaType:o,def:a}=this;i.if((0,M.or)((0,M._)`${r} === undefined`,n)),t!==M.nil&&i.assign(t,!0),(o.length||a.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==M.nil&&i.assign(t,!1)),i.else()}invalid$data(){let{gen:t,schemaCode:n,schemaType:i,def:r,it:o}=this;return(0,M.or)(a(),s());function a(){if(i.length){if(!(n instanceof M.Name))throw new Error("ajv implementation error");let c=Array.isArray(i)?i:[i];return(0,M._)`${(0,Dd.checkDataTypes)(c,n,o.opts.strictNumbers,Dd.DataType.Wrong)}`}return M.nil}function s(){if(r.validateSchema){let c=t.scopeValue("validate$data",{ref:r.validateSchema});return(0,M._)`!${c}(${n})`}return M.nil}}subschema(t,n){let i=(0,_v.getSubschema)(this.it,t);(0,_v.extendSubschemaData)(i,this.it,t),(0,_v.extendSubschemaMode)(i,t);let r={...this.it,...i,items:void 0,props:void 0};return fD(r,n),r}mergeEvaluated(t,n){let{it:i,gen:r}=this;i.opts.unevaluated&&(i.props!==!0&&t.props!==void 0&&(i.props=fr.mergeEvaluated.props(r,t.props,i.props,n)),i.items!==!0&&t.items!==void 0&&(i.items=fr.mergeEvaluated.items(r,t.items,i.items,n)))}mergeValidEvaluated(t,n){let{it:i,gen:r}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return r.if(n,()=>this.mergeEvaluated(t,M.Name)),!0}};Zr.KeywordCxt=Rd;function iS(e,t,n,i){let r=new Rd(e,n,t);"code"in n?n.code(r,i):r.$data&&n.validate?(0,us.funcKeywordCode)(r,n):"macro"in n?(0,us.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,us.funcKeywordCode)(r,n)}var ID=/^\/(?:[^~]|~0|~1)*$/,zD=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oS(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let r,o;if(e==="")return J.default.rootData;if(e[0]==="/"){if(!ID.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,o=J.default.rootData}else{let u=zD.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(r=u[2],r==="#"){if(l>=t)throw new Error(c("property/index",l));return i[t-l]}if(l>t)throw new Error(c("data",l));if(o=n[t-l],!r)return o}let a=o,s=r.split("/");for(let u of s)u&&(o=(0,M._)`${o}${(0,M.getProperty)((0,fr.unescapeJsonPointer)(u))}`,a=(0,M._)`${a} && ${o}`);return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}Zr.getData=oS});var Cd=N(kv=>{"use strict";Object.defineProperty(kv,"__esModule",{value:!0});var xv=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};kv.default=xv});var ds=N(Iv=>{"use strict";Object.defineProperty(Iv,"__esModule",{value:!0});var wv=ss(),Sv=class extends Error{constructor(t,n,i,r){super(r||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,wv.resolveUrl)(t,n,i),this.missingSchema=(0,wv.normalizeId)((0,wv.getFullPath)(t,this.missingRef))}};Iv.default=Sv});var Zd=N(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.resolveSchema=It.getCompilingSchema=It.resolveRef=It.compileSchema=It.SchemaEnv=void 0;var Rt=Y(),PD=Cd(),_n=dr(),Ct=ss(),aS=se(),TD=ls(),Yi=class{constructor(t){var n;this.refs={},this.dynamicAnchors={};let i;typeof t.schema=="object"&&(i=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,Ct.normalizeId)(i?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=i?.$async,this.refs={}}};It.SchemaEnv=Yi;function Pv(e){let t=sS.call(this,e);if(t)return t;let n=(0,Ct.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:r}=this.opts.code,{ownProperties:o}=this.opts,a=new Rt.CodeGen(this.scope,{es5:i,lines:r,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:PD.default,code:(0,Rt._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:_n.default.data,parentData:_n.default.parentData,parentDataProperty:_n.default.parentDataProperty,dataNames:[_n.default.data],dataPathArr:[Rt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Rt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Rt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Rt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,TD.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let d=a.toString();l=`${a.scopeRefs(_n.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let p=new Function(`${_n.default.self}`,`${_n.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:m,items:h}=u;p.evaluated={props:m instanceof Rt.Name?void 0:m,items:h instanceof Rt.Name?void 0:h,dynamicProps:m instanceof Rt.Name,dynamicItems:h instanceof Rt.Name},p.source&&(p.source.evaluated=(0,Rt.stringify)(p.evaluated))}return e.validate=p,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)}}It.compileSchema=Pv;function OD(e,t,n){var i;n=(0,Ct.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let o=jD.call(this,e,n);if(o===void 0){let a=(i=e.localRefs)===null||i===void 0?void 0:i[n],{schemaId:s}=this.opts;a&&(o=new Yi({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[n]=ED.call(this,o)}It.resolveRef=OD;function ED(e){return(0,Ct.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Pv.call(this,e)}function sS(e){for(let t of this._compilations)if(ND(t,e))return t}It.getCompilingSchema=sS;function ND(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function jD(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Ud.call(this,e,t)}function Ud(e,t){let n=this.opts.uriResolver.parse(t),i=(0,Ct._getFullPath)(this.opts.uriResolver,n),r=(0,Ct.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===r)return zv.call(this,n,e);let o=(0,Ct.normalizeId)(i),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let s=Ud.call(this,e,a);return typeof s?.schema!="object"?void 0:zv.call(this,n,s)}if(typeof a?.schema=="object"){if(a.validate||Pv.call(this,a),o===(0,Ct.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(r=(0,Ct.resolveUrl)(this.opts.uriResolver,r,u)),new Yi({schema:s,schemaId:c,root:e,baseId:r})}return zv.call(this,n,a)}}It.resolveSchema=Ud;var AD=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zv(e,{baseId:t,schema:n,root:i}){var r;if(((r=e.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let c=n[(0,aS.unescapeFragment)(s)];if(c===void 0)return;n=c;let u=typeof n=="object"&&n[this.opts.schemaId];!AD.has(s)&&u&&(t=(0,Ct.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,aS.schemaHasRulesButRef)(n,this.RULES)){let s=(0,Ct.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=Ud.call(this,i,s)}let{schemaId:a}=this.opts;if(o=o||new Yi({schema:n,schemaId:a,root:i,baseId:t}),o.schema!==o.root.schema)return o}});var cS=N((YF,DD)=>{DD.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 Ev=N((QF,mS)=>{"use strict";var RD=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),lS=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),Tv=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),dS=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),CD=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Ov(e){let t="",n=0,i=0;for(i=0;i<e.length;i++)if(n=e[i].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(n=e[i].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[i]}return t}var UD=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function uS(e){return e.length=0,!0}function ZD(e,t,n){if(e.length){let i=Ov(e);if(i!=="")t.push(i);else return n.error=!0,!1;e.length=0}return!0}function MD(e){let t=0,n={error:!1,address:"",zone:""},i=[],r=[],o=!1,a=!1,s=ZD;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!s(r,i,n))break;if(++t>7){n.error=!0;break}c>0&&e[c-1]===":"&&(o=!0),i.push(":");continue}else if(u==="%"){if(!s(r,i,n))break;s=uS}else{r.push(u);continue}}return r.length&&(s===uS?n.zone=r.join(""):a?i.push(r.join("")):i.push(Ov(r))),n.address=i.join(""),n}function fS(e){if(LD(e,":")<2)return{host:e,isIPV6:!1};let t=MD(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,i=t.address;return t.zone&&(n+="%"+t.zone,i+="%25"+t.zone),{host:n,isIPV6:!0,escapedHost:i}}}function LD(e,t){let n=0;for(let i=0;i<e.length;i++)e[i]===t&&n++;return n}function VD(e){let t=e,n=[],i=-1,r=0;for(;r=t.length;){if(r===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(r===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(r===3&&t==="/.."){n.length!==0&&n.pop(),n.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),n.length!==0&&n.pop();continue}}if((i=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,i)),t=t.slice(i)}return n.join("")}var qD={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},FD=/[@/?#:]/g,BD=/[@/?#]/g;function pS(e,t){let n=t?BD:FD;return n.lastIndex=0,e.replace(n,i=>qD[i])}function JD(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let i=0;i<e.length;i++){if(e[i]==="%"&&i+2<e.length){let r=e.slice(i+1,i+3);if(Tv(r)){let o=r.toUpperCase(),a=String.fromCharCode(parseInt(o,16));t&&dS(a)?n+=a:n+="%"+o,i+=2;continue}}n+=e[i]}return n}function KD(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(Tv(i)){let r=i.toUpperCase(),o=String.fromCharCode(parseInt(r,16));o!=="."&&dS(o)?t+=o:t+="%"+r,n+=2;continue}}CD(e[n])?t+=e[n]:t+=escape(e[n])}return t}function GD(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(Tv(i)){t+="%"+i.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function HD(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!lS(n)){let i=fS(n);i.isIPV6===!0?n=`[${i.escapedHost}]`:n=pS(n,!1)}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}mS.exports={nonSimpleDomain:UD,recomposeAuthority:HD,reescapeHostDelimiters:pS,normalizePercentEncoding:JD,normalizePathEncoding:KD,escapePreservingEscapes:GD,removeDotSegments:VD,isIPv4:lS,isUUID:RD,normalizeIPv6:fS,stringArrayToHexStripped:Ov}});var _S=N((e9,yS)=>{"use strict";var{isUUID:WD}=Ev(),XD=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,YD=["http","https","ws","wss","urn","urn:uuid"];function QD(e){return YD.indexOf(e)!==-1}function Nv(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 hS(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function gS(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 eR(e){return e.secure=Nv(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function tR(e){if((e.port===(Nv(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,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function rR(e,t){if(!e.path)return e.error="URN can not be parsed",e;let n=e.path.match(XD);if(n){let i=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];let r=`${i}:${t.nid||e.nid}`,o=jv(r);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function nR(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let n=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),r=`${n}:${t.nid||i}`,o=jv(r);o&&(e=o.serialize(e,t));let a=e,s=e.nss;return a.path=`${i||t.nid}:${s}`,t.skipEscape=!0,a}function iR(e,t){let n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!WD(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function oR(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var vS={scheme:"http",domainHost:!0,parse:hS,serialize:gS},aR={scheme:"https",domainHost:vS.domainHost,parse:hS,serialize:gS},Md={scheme:"ws",domainHost:!0,parse:eR,serialize:tR},sR={scheme:"wss",domainHost:Md.domainHost,parse:Md.parse,serialize:Md.serialize},cR={scheme:"urn",parse:rR,serialize:nR,skipNormalize:!0},uR={scheme:"urn:uuid",parse:iR,serialize:oR,skipNormalize:!0},Ld={http:vS,https:aR,ws:Md,wss:sR,urn:cR,"urn:uuid":uR};Object.setPrototypeOf(Ld,null);function jv(e){return e&&(Ld[e]||Ld[e.toLowerCase()])||void 0}yS.exports={wsIsSecure:Nv,SCHEMES:Ld,isValidSchemeName:QD,getSchemeHandler:jv}});var SS=N((t9,Vd)=>{"use strict";var{normalizeIPv6:lR,removeDotSegments:fs,recomposeAuthority:dR,normalizePercentEncoding:fR,normalizePathEncoding:pR,escapePreservingEscapes:mR,reescapeHostDelimiters:hR,isIPv4:gR,nonSimpleDomain:vR}=Ev(),{SCHEMES:yR,getSchemeHandler:bS}=_S();function _R(e,t){return typeof e=="string"?e=wR(e,t):typeof e=="object"&&(e=Qi($n(e,t),t)),e}function $R(e,t,n){let i=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=xS(Qi(e,i),Qi(t,i),i,!0);return i.skipEscape=!0,$n(r,i)}function xS(e,t,n,i){let r={};return i||(e=Qi($n(e,n),n),t=Qi($n(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=fs(t.path||""),r.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=fs(t.path||""),r.query=t.query):(t.path?(t.path[0]==="/"?r.path=fs(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?r.path="/"+t.path:e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path,r.path=fs(r.path)),r.query=t.query):(r.path=e.path,t.query!==void 0?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function bR(e,t,n){let i=$S(e,n),r=$S(t,n);return i!==void 0&&r!==void 0&&i.toLowerCase()===r.toLowerCase()}function $n(e,t){let n={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:""},i=Object.assign({},t),r=[],o=bS(i.scheme||n.scheme);o&&o.serialize&&o.serialize(n,i),n.path!==void 0&&(i.skipEscape?n.path=fR(n.path):(n.path=mR(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),i.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");let a=dR(n);if(a!==void 0&&(i.reference!=="suffix"&&r.push("//"),r.push(a),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let s=n.path;!i.absolutePath&&(!o||!o.absolutePath)&&(s=fs(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),r.push(s)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}var xR=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function kR(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function kS(e,t){let n=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=!1,o=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);let a=e.match(xR);if(a){i.scheme=a[1],i.userinfo=a[3],i.host=a[4],i.port=parseInt(a[5],10),i.path=a[6]||"",i.query=a[7],i.fragment=a[8],isNaN(i.port)&&(i.port=a[5]);let s=kR(i,a);if(s!==void 0&&(i.error=i.error||s,r=!0),i.host)if(gR(i.host)===!1){let l=lR(i.host);i.host=l.host.toLowerCase(),o=l.isIPV6}else o=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==i.reference&&(i.error=i.error||"URI is not a "+n.reference+" reference.");let c=bS(n.scheme||i.scheme);if(!n.unicodeSupport&&(!c||!c.unicodeSupport)&&i.host&&(n.domainHost||c&&c.domainHost)&&o===!1&&vR(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(u){i.error=i.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(e.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=hR(unescape(i.host),o))),i.path&&(i.path=pR(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}c&&c.parse&&c.parse(i,n)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:r}}function Qi(e,t){return kS(e,t).parsed}function wR(e,t){return wS(e,t).normalized}function wS(e,t){let{parsed:n,malformedAuthorityOrPort:i}=kS(e,t);return{normalized:i?e:$n(n,t),malformedAuthorityOrPort:i}}function $S(e,t){if(typeof e=="string"){let{normalized:n,malformedAuthorityOrPort:i}=wS(e,t);return i?void 0:n}if(typeof e=="object")return $n(e,t)}var Av={SCHEMES:yR,normalize:_R,resolve:$R,resolveComponent:xS,equal:bR,serialize:$n,parse:Qi};Vd.exports=Av;Vd.exports.default=Av;Vd.exports.fastUri=Av});var zS=N(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});var IS=SS();IS.code='require("ajv/dist/runtime/uri").default';Dv.default=IS});var DS=N(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.CodeGen=Le.Name=Le.nil=Le.stringify=Le.str=Le._=Le.KeywordCxt=void 0;var SR=ls();Object.defineProperty(Le,"KeywordCxt",{enumerable:!0,get:function(){return SR.KeywordCxt}});var eo=Y();Object.defineProperty(Le,"_",{enumerable:!0,get:function(){return eo._}});Object.defineProperty(Le,"str",{enumerable:!0,get:function(){return eo.str}});Object.defineProperty(Le,"stringify",{enumerable:!0,get:function(){return eo.stringify}});Object.defineProperty(Le,"nil",{enumerable:!0,get:function(){return eo.nil}});Object.defineProperty(Le,"Name",{enumerable:!0,get:function(){return eo.Name}});Object.defineProperty(Le,"CodeGen",{enumerable:!0,get:function(){return eo.CodeGen}});var IR=Cd(),NS=ds(),zR=uv(),ps=Zd(),PR=Y(),ms=ss(),qd=as(),Cv=se(),PS=cS(),TR=zS(),jS=(e,t)=>new RegExp(e,t);jS.code="new RegExp";var OR=["removeAdditional","useDefaults","coerceTypes"],ER=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),NR={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."},jR={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},TS=200;function AR(e){var t,n,i,r,o,a,s,c,u,l,d,f,p,m,h,y,$,w,z,D,E,K,ke,Yt,Sn;let Qt=e.strict,In=(t=e.code)===null||t===void 0?void 0:t.optimize,Rs=In===!0||In===void 0?1:In||0,Cs=(i=(n=e.code)===null||n===void 0?void 0:n.regExp)!==null&&i!==void 0?i:jS,Az=(r=e.uriResolver)!==null&&r!==void 0?r:TR.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Qt)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:Qt)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Qt)!==null&&l!==void 0?l:"log",strictTuples:(f=(d=e.strictTuples)!==null&&d!==void 0?d:Qt)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=e.strictRequired)!==null&&p!==void 0?p:Qt)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:Rs,regExp:Cs}:{optimize:Rs,regExp:Cs},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:TS,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:TS,meta:($=e.meta)!==null&&$!==void 0?$:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(z=e.inlineRefs)!==null&&z!==void 0?z:!0,schemaId:(D=e.schemaId)!==null&&D!==void 0?D:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(K=e.validateSchema)!==null&&K!==void 0?K:!0,validateFormats:(ke=e.validateFormats)!==null&&ke!==void 0?ke:!0,unicodeRegExp:(Yt=e.unicodeRegExp)!==null&&Yt!==void 0?Yt:!0,int32range:(Sn=e.int32range)!==null&&Sn!==void 0?Sn:!0,uriResolver:Az}}var hs=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...AR(t)};let{es5:n,lines:i}=this.opts.code;this.scope=new PR.ValueScope({scope:{},prefixes:ER,es5:n,lines:i}),this.logger=MR(t.logger);let r=t.validateFormats;t.validateFormats=!1,this.RULES=(0,zR.getRules)(),OS.call(this,NR,t,"NOT SUPPORTED"),OS.call(this,jR,t,"DEPRECATED","warn"),this._metaOpts=UR.call(this),t.formats&&RR.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&CR.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),DR.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:n,schemaId:i}=this.opts,r=PS;i==="id"&&(r={...PS},r.id=r.$id,delete r.$id),n&&t&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){let{meta:t,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[n]||t:void 0}validate(t,n){let i;if(typeof t=="string"){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);let r=i(n);return"$async"in i||(this.errors=i.errors),r}compile(t,n){let i=this._addSchema(t,n);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return r.call(this,t,n);async function r(l,d){await o.call(this,l.$schema);let f=this._addSchema(l,d);return f.validate||a.call(this,f)}async function o(l){l&&!this.getSchema(l)&&await r.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof NS.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,n)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=i(l))}finally{delete this._loading[l]}}}addSchema(t,n,i,r=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,i,r);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 n=(0,ms.normalizeId)(n||o),this._checkUnique(n),this.schemas[n]=this._addSchema(t,i,n,r,!0),this}addMetaSchema(t,n,i=this.opts.validateSchema){return this.addSchema(t,n,!0,i),this}validateSchema(t,n){if(typeof t=="boolean")return!0;let i;if(i=t.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(i,t);if(!r&&n){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return r}getSchema(t){let n;for(;typeof(n=ES.call(this,t))=="string";)t=n;if(n===void 0){let{schemaId:i}=this.opts,r=new ps.SchemaEnv({schema:{},schemaId:i});if(n=ps.resolveSchema.call(this,r,t),!n)return;this.refs[t]=n}return n.validate||this._compileSchemaEnv(n)}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 n=ES.call(this,t);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let n=t;this._cache.delete(n);let i=t[this.opts.schemaId];return i&&(i=(0,ms.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let n of t)this.addKeyword(n);return this}addKeyword(t,n){let i;if(typeof t=="string")i=t,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=i);else if(typeof t=="object"&&n===void 0){if(n=t,i=n.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(VR.call(this,i,n),!n)return(0,Cv.eachItem)(i,o=>Rv.call(this,o)),this;FR.call(this,n);let r={...n,type:(0,qd.getJSONTypes)(n.type),schemaType:(0,qd.getJSONTypes)(n.schemaType)};return(0,Cv.eachItem)(i,r.type.length===0?o=>Rv.call(this,o,r):o=>r.type.forEach(a=>Rv.call(this,o,r,a))),this}getKeyword(t){let n=this.RULES.all[t];return typeof n=="object"?n.definition:!!n}removeKeyword(t){let{RULES:n}=this;delete n.keywords[t],delete n.all[t];for(let i of n.rules){let r=i.rules.findIndex(o=>o.keyword===t);r>=0&&i.rules.splice(r,1)}return this}addFormat(t,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[t]=n,this}errorsText(t=this.errors,{separator:n=", ",dataVar:i="data"}={}){return!t||t.length===0?"No errors":t.map(r=>`${i}${r.instancePath} ${r.message}`).reduce((r,o)=>r+n+o)}$dataMetaSchema(t,n){let i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let r of n){let o=r.split("/").slice(1),a=t;for(let s of o)a=a[s];for(let s in i){let c=i[s];if(typeof c!="object")continue;let{$data:u}=c.definition,l=a[s];u&&l&&(a[s]=AS(l))}}return t}_removeAllSchemas(t,n){for(let i in t){let r=t[i];(!n||n.test(i))&&(typeof r=="string"?delete t[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete t[i]))}}_addSchema(t,n,i,r=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;i=(0,ms.normalizeId)(a||i);let u=ms.getSchemaRefs.call(this,t,i);return c=new ps.SchemaEnv({schema:t,schemaId:s,meta:n,baseId:i,localRefs:u}),this._cache.set(c.schema,c),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=c),r&&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):ps.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let n=this.opts;this.opts=this._metaOpts;try{ps.compileSchema.call(this,t)}finally{this.opts=n}}};hs.ValidationError=IR.default;hs.MissingRefError=NS.default;Le.default=hs;function OS(e,t,n,i="error"){for(let r in e){let o=r;o in t&&this.logger[i](`${n}: option ${r}. ${e[o]}`)}}function ES(e){return e=(0,ms.normalizeId)(e),this.schemas[e]||this.refs[e]}function DR(){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 RR(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function CR(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 n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}function UR(){let e={...this.opts};for(let t of OR)delete e[t];return e}var ZR={log(){},warn(){},error(){}};function MR(e){if(e===!1)return ZR;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 LR=/^[a-z_$][a-z0-9_$:-]*$/i;function VR(e,t){let{RULES:n}=this;if((0,Cv.eachItem)(e,i=>{if(n.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!LR.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function Rv(e,t,n){var i;let r=t?.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=r?o.post:o.rules.find(({type:c})=>c===n);if(a||(a={type:n,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,qd.getJSONTypes)(t.type),schemaType:(0,qd.getJSONTypes)(t.schemaType)}};t.before?qR.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,(i=t.implements)===null||i===void 0||i.forEach(c=>this.addKeyword(c))}function qR(e,t,n){let i=e.rules.findIndex(r=>r.keyword===n);i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function FR(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=AS(t)),e.validateSchema=this.compile(t,!0))}var BR={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function AS(e){return{anyOf:[e,BR]}}});var RS=N(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var JR={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Uv.default=JR});var MS=N(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.callRef=bn.getValidate=void 0;var KR=ds(),CS=St(),dt=Y(),to=dr(),US=Zd(),Fd=se(),GR={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:n,it:i}=e,{baseId:r,schemaEnv:o,validateName:a,opts:s,self:c}=i,{root:u}=o;if((n==="#"||n==="#/")&&r===u.baseId)return d();let l=US.resolveRef.call(c,u,r,n);if(l===void 0)throw new KR.default(i.opts.uriResolver,r,n);if(l instanceof US.SchemaEnv)return f(l);return p(l);function d(){if(o===u)return Bd(e,a,o,o.$async);let m=t.scopeValue("root",{ref:u});return Bd(e,(0,dt._)`${m}.validate`,u,u.$async)}function f(m){let h=ZS(e,m);Bd(e,h,m,m.$async)}function p(m){let h=t.scopeValue("schema",s.code.source===!0?{ref:m,code:(0,dt.stringify)(m)}:{ref:m}),y=t.name("valid"),$=e.subschema({schema:m,dataTypes:[],schemaPath:dt.nil,topSchemaRef:h,errSchemaPath:n},y);e.mergeEvaluated($),e.ok(y)}}};function ZS(e,t){let{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,dt._)`${n.scopeValue("wrapper",{ref:t})}.validate`}bn.getValidate=ZS;function Bd(e,t,n,i){let{gen:r,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?to.default.this:dt.nil;i?l():d();function l(){if(!s.$async)throw new Error("async schema referenced by sync schema");let m=r.let("valid");r.try(()=>{r.code((0,dt._)`await ${(0,CS.callValidateCode)(e,t,u)}`),p(t),a||r.assign(m,!0)},h=>{r.if((0,dt._)`!(${h} instanceof ${o.ValidationError})`,()=>r.throw(h)),f(h),a||r.assign(m,!1)}),e.ok(m)}function d(){e.result((0,CS.callValidateCode)(e,t,u),()=>p(t),()=>f(t))}function f(m){let h=(0,dt._)`${m}.errors`;r.assign(to.default.vErrors,(0,dt._)`${to.default.vErrors} === null ? ${h} : ${to.default.vErrors}.concat(${h})`),r.assign(to.default.errors,(0,dt._)`${to.default.vErrors}.length`)}function p(m){var h;if(!o.opts.unevaluated)return;let y=(h=n?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(o.props=Fd.mergeEvaluated.props(r,y.props,o.props));else{let $=r.var("props",(0,dt._)`${m}.evaluated.props`);o.props=Fd.mergeEvaluated.props(r,$,o.props,dt.Name)}if(o.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(o.items=Fd.mergeEvaluated.items(r,y.items,o.items));else{let $=r.var("items",(0,dt._)`${m}.evaluated.items`);o.items=Fd.mergeEvaluated.items(r,$,o.items,dt.Name)}}}bn.callRef=Bd;bn.default=GR});var LS=N(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var HR=RS(),WR=MS(),XR=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",HR.default,WR.default];Zv.default=XR});var VS=N(Mv=>{"use strict";Object.defineProperty(Mv,"__esModule",{value:!0});var Jd=Y(),Mr=Jd.operators,Kd={maximum:{okStr:"<=",ok:Mr.LTE,fail:Mr.GT},minimum:{okStr:">=",ok:Mr.GTE,fail:Mr.LT},exclusiveMaximum:{okStr:"<",ok:Mr.LT,fail:Mr.GTE},exclusiveMinimum:{okStr:">",ok:Mr.GT,fail:Mr.LTE}},YR={message:({keyword:e,schemaCode:t})=>(0,Jd.str)`must be ${Kd[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Jd._)`{comparison: ${Kd[e].okStr}, limit: ${t}}`},QR={keyword:Object.keys(Kd),type:"number",schemaType:"number",$data:!0,error:YR,code(e){let{keyword:t,data:n,schemaCode:i}=e;e.fail$data((0,Jd._)`${n} ${Kd[t].fail} ${i} || isNaN(${n})`)}};Mv.default=QR});var qS=N(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});var gs=Y(),e4={message:({schemaCode:e})=>(0,gs.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,gs._)`{multipleOf: ${e}}`},t4={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:e4,code(e){let{gen:t,data:n,schemaCode:i,it:r}=e,o=r.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,gs._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,gs._)`${a} !== parseInt(${a})`;e.fail$data((0,gs._)`(${i} === 0 || (${a} = ${n}/${i}, ${s}))`)}};Lv.default=t4});var BS=N(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});function FS(e){let t=e.length,n=0,i=0,r;for(;i<t;)n++,r=e.charCodeAt(i++),r>=55296&&r<=56319&&i<t&&(r=e.charCodeAt(i),(r&64512)===56320&&i++);return n}Vv.default=FS;FS.code='require("ajv/dist/runtime/ucs2length").default'});var JS=N(qv=>{"use strict";Object.defineProperty(qv,"__esModule",{value:!0});var xn=Y(),r4=se(),n4=BS(),i4={message({keyword:e,schemaCode:t}){let n=e==="maxLength"?"more":"fewer";return(0,xn.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,xn._)`{limit: ${e}}`},o4={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:i4,code(e){let{keyword:t,data:n,schemaCode:i,it:r}=e,o=t==="maxLength"?xn.operators.GT:xn.operators.LT,a=r.opts.unicode===!1?(0,xn._)`${n}.length`:(0,xn._)`${(0,r4.useFunc)(e.gen,n4.default)}(${n})`;e.fail$data((0,xn._)`${a} ${o} ${i}`)}};qv.default=o4});var KS=N(Fv=>{"use strict";Object.defineProperty(Fv,"__esModule",{value:!0});var a4=St(),s4=se(),ro=Y(),c4={message:({schemaCode:e})=>(0,ro.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ro._)`{pattern: ${e}}`},u4={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:c4,code(e){let{gen:t,data:n,$data:i,schema:r,schemaCode:o,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(i){let{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,ro._)`new RegExp`:(0,s4.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,ro._)`${u}(${o}, ${s}).test(${n})`),()=>t.assign(l,!1)),e.fail$data((0,ro._)`!${l}`)}else{let c=(0,a4.usePattern)(e,r);e.fail$data((0,ro._)`!${c}.test(${n})`)}}};Fv.default=u4});var GS=N(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var vs=Y(),l4={message({keyword:e,schemaCode:t}){let n=e==="maxProperties"?"more":"fewer";return(0,vs.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,vs._)`{limit: ${e}}`},d4={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:l4,code(e){let{keyword:t,data:n,schemaCode:i}=e,r=t==="maxProperties"?vs.operators.GT:vs.operators.LT;e.fail$data((0,vs._)`Object.keys(${n}).length ${r} ${i}`)}};Bv.default=d4});var HS=N(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});var ys=St(),_s=Y(),f4=se(),p4={message:({params:{missingProperty:e}})=>(0,_s.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,_s._)`{missingProperty: ${e}}`},m4={keyword:"required",type:"object",schemaType:"array",$data:!0,error:p4,code(e){let{gen:t,schema:n,schemaCode:i,data:r,$data:o,it:a}=e,{opts:s}=a;if(!o&&n.length===0)return;let c=n.length>=s.loopRequired;if(a.allErrors?u():l(),s.strictRequired){let p=e.parentSchema.properties,{definedProperties:m}=e.it;for(let h of n)if(p?.[h]===void 0&&!m.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,$=`required property "${h}" is not defined at "${y}" (strictRequired)`;(0,f4.checkStrictMode)(a,$,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(_s.nil,d);else for(let p of n)(0,ys.checkReportMissingProp)(e,p)}function l(){let p=t.let("missing");if(c||o){let m=t.let("valid",!0);e.block$data(m,()=>f(p,m)),e.ok(m)}else t.if((0,ys.checkMissingProp)(e,n,p)),(0,ys.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",i,p=>{e.setParams({missingProperty:p}),t.if((0,ys.noPropertyInData)(t,r,p,s.ownProperties),()=>e.error())})}function f(p,m){e.setParams({missingProperty:p}),t.forOf(p,i,()=>{t.assign(m,(0,ys.propertyInData)(t,r,p,s.ownProperties)),t.if((0,_s.not)(m),()=>{e.error(),t.break()})},_s.nil)}}};Jv.default=m4});var WS=N(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var $s=Y(),h4={message({keyword:e,schemaCode:t}){let n=e==="maxItems"?"more":"fewer";return(0,$s.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,$s._)`{limit: ${e}}`},g4={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:h4,code(e){let{keyword:t,data:n,schemaCode:i}=e,r=t==="maxItems"?$s.operators.GT:$s.operators.LT;e.fail$data((0,$s._)`${n}.length ${r} ${i}`)}};Kv.default=g4});var Gd=N(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var XS=vv();XS.code='require("ajv/dist/runtime/equal").default';Gv.default=XS});var YS=N(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});var Hv=as(),Ve=Y(),v4=se(),y4=Gd(),_4={message:({params:{i:e,j:t}})=>(0,Ve.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ve._)`{i: ${e}, j: ${t}}`},$4={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:_4,code(e){let{gen:t,data:n,$data:i,schema:r,parentSchema:o,schemaCode:a,it:s}=e;if(!i&&!r)return;let c=t.let("valid"),u=o.items?(0,Hv.getSchemaTypes)(o.items):[];e.block$data(c,l,(0,Ve._)`${a} === false`),e.ok(c);function l(){let m=t.let("i",(0,Ve._)`${n}.length`),h=t.let("j");e.setParams({i:m,j:h}),t.assign(c,!0),t.if((0,Ve._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,h){let y=t.name("item"),$=(0,Hv.checkDataTypes)(u,y,s.opts.strictNumbers,Hv.DataType.Wrong),w=t.const("indices",(0,Ve._)`{}`);t.for((0,Ve._)`;${m}--;`,()=>{t.let(y,(0,Ve._)`${n}[${m}]`),t.if($,(0,Ve._)`continue`),u.length>1&&t.if((0,Ve._)`typeof ${y} == "string"`,(0,Ve._)`${y} += "_"`),t.if((0,Ve._)`typeof ${w}[${y}] == "number"`,()=>{t.assign(h,(0,Ve._)`${w}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,Ve._)`${w}[${y}] = ${m}`)})}function p(m,h){let y=(0,v4.useFunc)(t,y4.default),$=t.name("outer");t.label($).for((0,Ve._)`;${m}--;`,()=>t.for((0,Ve._)`${h} = ${m}; ${h}--;`,()=>t.if((0,Ve._)`${y}(${n}[${m}], ${n}[${h}])`,()=>{e.error(),t.assign(c,!1).break($)})))}}};Wv.default=$4});var QS=N(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var Xv=Y(),b4=se(),x4=Gd(),k4={message:"must be equal to constant",params:({schemaCode:e})=>(0,Xv._)`{allowedValue: ${e}}`},w4={keyword:"const",$data:!0,error:k4,code(e){let{gen:t,data:n,$data:i,schemaCode:r,schema:o}=e;i||o&&typeof o=="object"?e.fail$data((0,Xv._)`!${(0,b4.useFunc)(t,x4.default)}(${n}, ${r})`):e.fail((0,Xv._)`${o} !== ${n}`)}};Yv.default=w4});var eI=N(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var bs=Y(),S4=se(),I4=Gd(),z4={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,bs._)`{allowedValues: ${e}}`},P4={keyword:"enum",schemaType:"array",$data:!0,error:z4,code(e){let{gen:t,data:n,$data:i,schema:r,schemaCode:o,it:a}=e;if(!i&&r.length===0)throw new Error("enum must have non-empty array");let s=r.length>=a.opts.loopEnum,c,u=()=>c??(c=(0,S4.useFunc)(t,I4.default)),l;if(s||i)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let p=t.const("vSchema",o);l=(0,bs.or)(...r.map((m,h)=>f(p,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,p=>t.if((0,bs._)`${u()}(${n}, ${p})`,()=>t.assign(l,!0).break()))}function f(p,m){let h=r[m];return typeof h=="object"&&h!==null?(0,bs._)`${u()}(${n}, ${p}[${m}])`:(0,bs._)`${n} === ${h}`}}};Qv.default=P4});var tI=N(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});var T4=VS(),O4=qS(),E4=JS(),N4=KS(),j4=GS(),A4=HS(),D4=WS(),R4=YS(),C4=QS(),U4=eI(),Z4=[T4.default,O4.default,E4.default,N4.default,j4.default,A4.default,D4.default,R4.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},C4.default,U4.default];ey.default=Z4});var ry=N(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.validateAdditionalItems=void 0;var kn=Y(),ty=se(),M4={message:({params:{len:e}})=>(0,kn.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,kn._)`{limit: ${e}}`},L4={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:M4,code(e){let{parentSchema:t,it:n}=e,{items:i}=t;if(!Array.isArray(i)){(0,ty.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}rI(e,i)}};function rI(e,t){let{gen:n,schema:i,data:r,keyword:o,it:a}=e;a.items=!0;let s=n.const("len",(0,kn._)`${r}.length`);if(i===!1)e.setParams({len:t.length}),e.pass((0,kn._)`${s} <= ${t.length}`);else if(typeof i=="object"&&!(0,ty.alwaysValidSchema)(a,i)){let u=n.var("valid",(0,kn._)`${s} <= ${t.length}`);n.if((0,kn.not)(u),()=>c(u)),e.ok(u)}function c(u){n.forRange("i",t.length,s,l=>{e.subschema({keyword:o,dataProp:l,dataPropType:ty.Type.Num},u),a.allErrors||n.if((0,kn.not)(u),()=>n.break())})}}xs.validateAdditionalItems=rI;xs.default=L4});var ny=N(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.validateTuple=void 0;var nI=Y(),Hd=se(),V4=St(),q4={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:n}=e;if(Array.isArray(t))return iI(e,"additionalItems",t);n.items=!0,!(0,Hd.alwaysValidSchema)(n,t)&&e.ok((0,V4.validateArray)(e))}};function iI(e,t,n=e.schema){let{gen:i,parentSchema:r,data:o,keyword:a,it:s}=e;l(r),s.opts.unevaluated&&n.length&&s.items!==!0&&(s.items=Hd.mergeEvaluated.items(i,n.length,s.items));let c=i.name("valid"),u=i.const("len",(0,nI._)`${o}.length`);n.forEach((d,f)=>{(0,Hd.alwaysValidSchema)(s,d)||(i.if((0,nI._)`${u} > ${f}`,()=>e.subschema({keyword:a,schemaProp:f,dataProp:f},c)),e.ok(c))});function l(d){let{opts:f,errSchemaPath:p}=s,m=n.length,h=m===d.minItems&&(m===d.maxItems||d[t]===!1);if(f.strictTuples&&!h){let y=`"${a}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,Hd.checkStrictMode)(s,y,f.strictTuples)}}}ks.validateTuple=iI;ks.default=q4});var oI=N(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});var F4=ny(),B4={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,F4.validateTuple)(e,"items")};iy.default=B4});var sI=N(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});var aI=Y(),J4=se(),K4=St(),G4=ry(),H4={message:({params:{len:e}})=>(0,aI.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,aI._)`{limit: ${e}}`},W4={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:H4,code(e){let{schema:t,parentSchema:n,it:i}=e,{prefixItems:r}=n;i.items=!0,!(0,J4.alwaysValidSchema)(i,t)&&(r?(0,G4.validateAdditionalItems)(e,r):e.ok((0,K4.validateArray)(e)))}};oy.default=W4});var cI=N(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});var zt=Y(),Wd=se(),X4={message:({params:{min:e,max:t}})=>t===void 0?(0,zt.str)`must contain at least ${e} valid item(s)`:(0,zt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,zt._)`{minContains: ${e}}`:(0,zt._)`{minContains: ${e}, maxContains: ${t}}`},Y4={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:X4,code(e){let{gen:t,schema:n,parentSchema:i,data:r,it:o}=e,a,s,{minContains:c,maxContains:u}=i;o.opts.next?(a=c===void 0?1:c,s=u):a=1;let l=t.const("len",(0,zt._)`${r}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,Wd.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,Wd.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Wd.alwaysValidSchema)(o,n)){let h=(0,zt._)`${l} >= ${a}`;s!==void 0&&(h=(0,zt._)`${h} && ${l} <= ${s}`),e.pass(h);return}o.items=!0;let d=t.name("valid");s===void 0&&a===1?p(d,()=>t.if(d,()=>t.break())):a===0?(t.let(d,!0),s!==void 0&&t.if((0,zt._)`${r}.length > 0`,f)):(t.let(d,!1),f()),e.result(d,()=>e.reset());function f(){let h=t.name("_valid"),y=t.let("count",0);p(h,()=>t.if(h,()=>m(y)))}function p(h,y){t.forRange("i",0,l,$=>{e.subschema({keyword:"contains",dataProp:$,dataPropType:Wd.Type.Num,compositeRule:!0},h),y()})}function m(h){t.code((0,zt._)`${h}++`),s===void 0?t.if((0,zt._)`${h} >= ${a}`,()=>t.assign(d,!0).break()):(t.if((0,zt._)`${h} > ${s}`,()=>t.assign(d,!1).break()),a===1?t.assign(d,!0):t.if((0,zt._)`${h} >= ${a}`,()=>t.assign(d,!0)))}}};ay.default=Y4});var dI=N(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.validateSchemaDeps=Ht.validatePropertyDeps=Ht.error=void 0;var sy=Y(),Q4=se(),ws=St();Ht.error={message:({params:{property:e,depsCount:t,deps:n}})=>{let i=t===1?"property":"properties";return(0,sy.str)`must have ${i} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:i}})=>(0,sy._)`{property: ${e},
6
+ || ${a} === "boolean" || ${r} === null`).assign(s,(0,X._)`[${r}]`)}}}function bA({gen:e,parentData:t,parentDataProperty:n},i){e.if((0,X._)`${t} !== undefined`,()=>e.assign((0,X._)`${t}[${n}]`,i))}function dv(e,t,n,i=Hi.Correct){let r=i===Hi.Correct?X.operators.EQ:X.operators.NEQ,o;switch(e){case"null":return(0,X._)`${t} ${r} null`;case"array":o=(0,X._)`Array.isArray(${t})`;break;case"object":o=(0,X._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,X._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,X._)`typeof ${t} ${r} ${e}`}return i===Hi.Correct?o:(0,X.not)(o);function a(s=X.nil){return(0,X.and)((0,X._)`typeof ${t} == "number"`,s,n?(0,X._)`isFinite(${t})`:X.nil)}}Ke.checkDataType=dv;function fv(e,t,n,i){if(e.length===1)return dv(e[0],t,n,i);let r,o=(0,Pw.toHash)(e);if(o.array&&o.object){let a=(0,X._)`typeof ${t} != "object"`;r=o.null?a:(0,X._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else r=X.nil;o.number&&delete o.integer;for(let a in o)r=(0,X.and)(r,dv(a,t,n,i));return r}Ke.checkDataTypes=fv;var xA={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,X._)`{type: ${e}}`:(0,X._)`{type: ${t}}`};function pv(e){let t=kA(e);(0,gA.reportError)(t,xA)}Ke.reportTypeError=pv;function kA(e){let{gen:t,data:n,schema:i}=e,r=(0,Pw.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:e}}});var Nw=N(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.assignDefaults=void 0;var Wi=Y(),wA=se();function SA(e,t){let{properties:n,items:i}=e.schema;if(t==="object"&&n)for(let r in n)Ew(e,r,n[r].default);else t==="array"&&Array.isArray(i)&&i.forEach((r,o)=>Ew(e,o,r.default))}jd.assignDefaults=SA;function Ew(e,t,n){let{gen:i,compositeRule:r,data:o,opts:a}=e;if(n===void 0)return;let s=(0,Wi._)`${o}${(0,Wi.getProperty)(t)}`;if(r){(0,wA.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,Wi._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,Wi._)`${c} || ${s} === null || ${s} === ""`),i.if(c,(0,Wi._)`${s} = ${(0,Wi.stringify)(n)}`)}});var St=N(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.validateUnion=be.validateArray=be.usePattern=be.callValidateCode=be.schemaProperties=be.allSchemaProperties=be.noPropertyInData=be.propertyInData=be.isOwnProperty=be.hasPropFunc=be.reportMissingProp=be.checkMissingProp=be.checkReportMissingProp=void 0;var we=Y(),mv=se(),Rr=dr(),IA=se();function zA(e,t){let{gen:n,data:i,it:r}=e;n.if(gv(n,i,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,we._)`${t}`},!0),e.error()})}be.checkReportMissingProp=zA;function PA({gen:e,data:t,it:{opts:n}},i,r){return(0,we.or)(...i.map(o=>(0,we.and)(gv(e,t,o,n.ownProperties),(0,we._)`${r} = ${o}`)))}be.checkMissingProp=PA;function TA(e,t){e.setParams({missingProperty:t},!0),e.error()}be.reportMissingProp=TA;function jw(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,we._)`Object.prototype.hasOwnProperty`})}be.hasPropFunc=jw;function hv(e,t,n){return(0,we._)`${jw(e)}.call(${t}, ${n})`}be.isOwnProperty=hv;function OA(e,t,n,i){let r=(0,we._)`${t}${(0,we.getProperty)(n)} !== undefined`;return i?(0,we._)`${r} && ${hv(e,t,n)}`:r}be.propertyInData=OA;function gv(e,t,n,i){let r=(0,we._)`${t}${(0,we.getProperty)(n)} === undefined`;return i?(0,we.or)(r,(0,we.not)(hv(e,t,n))):r}be.noPropertyInData=gv;function Aw(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}be.allSchemaProperties=Aw;function EA(e,t){return Aw(t).filter(n=>!(0,mv.alwaysValidSchema)(e,t[n]))}be.schemaProperties=EA;function NA({schemaCode:e,data:t,it:{gen:n,topSchemaRef:i,schemaPath:r,errorPath:o},it:a},s,c,u){let l=u?(0,we._)`${e}, ${t}, ${i}${r}`:t,d=[[Rr.default.instancePath,(0,we.strConcat)(Rr.default.instancePath,o)],[Rr.default.parentData,a.parentData],[Rr.default.parentDataProperty,a.parentDataProperty],[Rr.default.rootData,Rr.default.rootData]];a.opts.dynamicRef&&d.push([Rr.default.dynamicAnchors,Rr.default.dynamicAnchors]);let f=(0,we._)`${l}, ${n.object(...d)}`;return c!==we.nil?(0,we._)`${s}.call(${c}, ${f})`:(0,we._)`${s}(${f})`}be.callValidateCode=NA;var jA=(0,we._)`new RegExp`;function AA({gen:e,it:{opts:t}},n){let i=t.unicodeRegExp?"u":"",{regExp:r}=t.code,o=r(n,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,we._)`${r.code==="new RegExp"?jA:(0,IA.useFunc)(e,r)}(${n}, ${i})`})}be.usePattern=AA;function DA(e){let{gen:t,data:n,keyword:i,it:r}=e,o=t.name("valid");if(r.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,we._)`${n}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:mv.Type.Num},o),t.if((0,we.not)(o),s)})}}be.validateArray=DA;function RA(e){let{gen:t,schema:n,keyword:i,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(c=>(0,mv.alwaysValidSchema)(r,c))&&!r.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>n.forEach((c,u)=>{let l=e.subschema({keyword:i,schemaProp:u,compositeRule:!0},s);t.assign(a,(0,we._)`${a} || ${s}`),e.mergeValidEvaluated(l,s)||t.if((0,we.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}be.validateUnion=RA});var Cw=N(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.validateKeywordUsage=Kt.validSchemaType=Kt.funcKeywordCode=Kt.macroKeywordCode=void 0;var rt=Y(),yn=dr(),CA=St(),UA=os();function ZA(e,t){let{gen:n,keyword:i,schema:r,parentSchema:o,it:a}=e,s=t.macro.call(a.self,r,o,a),c=Rw(n,i,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let u=n.name("valid");e.subschema({schema:s,schemaPath:rt.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Kt.macroKeywordCode=ZA;function MA(e,t){var n;let{gen:i,keyword:r,schema:o,parentSchema:a,$data:s,it:c}=e;VA(c,t);let u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=Rw(i,r,u),d=i.let("valid");e.block$data(d,f),e.ok((n=t.valid)!==null&&n!==void 0?n:d);function f(){if(t.errors===!1)h(),t.modifying&&Dw(e),y(()=>e.error());else{let $=t.async?p():m();t.modifying&&Dw(e),y(()=>LA(e,$))}}function p(){let $=i.let("ruleErrs",null);return i.try(()=>h((0,rt._)`await `),w=>i.assign(d,!1).if((0,rt._)`${w} instanceof ${c.ValidationError}`,()=>i.assign($,(0,rt._)`${w}.errors`),()=>i.throw(w))),$}function m(){let $=(0,rt._)`${l}.errors`;return i.assign($,null),h(rt.nil),$}function h($=t.async?(0,rt._)`await `:rt.nil){let w=c.opts.passContext?yn.default.this:yn.default.self,z=!("compile"in t&&!s||t.schema===!1);i.assign(d,(0,rt._)`${$}${(0,CA.callValidateCode)(e,l,w,z)}`,t.modifying)}function y($){var w;i.if((0,rt.not)((w=t.valid)!==null&&w!==void 0?w:d),$)}}Kt.funcKeywordCode=MA;function Dw(e){let{gen:t,data:n,it:i}=e;t.if(i.parentData,()=>t.assign(n,(0,rt._)`${i.parentData}[${i.parentDataProperty}]`))}function LA(e,t){let{gen:n}=e;n.if((0,rt._)`Array.isArray(${t})`,()=>{n.assign(yn.default.vErrors,(0,rt._)`${yn.default.vErrors} === null ? ${t} : ${yn.default.vErrors}.concat(${t})`).assign(yn.default.errors,(0,rt._)`${yn.default.vErrors}.length`),(0,UA.extendErrors)(e)},()=>e.error())}function VA({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Rw(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,rt.stringify)(n)})}function qA(e,t,n=!1){return!t.length||t.some(i=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||n&&typeof e>"u")}Kt.validSchemaType=qA;function FA({schema:e,opts:t,self:n,errSchemaPath:i},r,o){if(Array.isArray(r.keyword)?!r.keyword.includes(o):r.keyword!==o)throw new Error("ajv implementation error");let a=r.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${i}": `+n.errorsText(r.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(c);else throw new Error(c)}}Kt.validateKeywordUsage=FA});var Zw=N(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.extendSubschemaMode=Cr.extendSubschemaData=Cr.getSubschema=void 0;var Gt=Y(),Uw=se();function BA(e,{keyword:t,schemaProp:n,schema:i,schemaPath:r,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return n===void 0?{schema:s,schemaPath:(0,Gt._)`${e.schemaPath}${(0,Gt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:(0,Gt._)`${e.schemaPath}${(0,Gt.getProperty)(t)}${(0,Gt.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Uw.escapeFragment)(n)}`}}if(i!==void 0){if(r===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:r,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Cr.getSubschema=BA;function JA(e,t,{dataProp:n,dataPropType:i,data:r,dataTypes:o,propertyName:a}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(n!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,f=s.let("data",(0,Gt._)`${t.data}${(0,Gt.getProperty)(n)}`,!0);c(f),e.errorPath=(0,Gt.str)`${u}${(0,Uw.getErrorPath)(n,i,d.jsPropertySyntax)}`,e.parentDataProperty=(0,Gt._)`${n}`,e.dataPathArr=[...l,e.parentDataProperty]}if(r!==void 0){let u=r instanceof Gt.Name?r:s.let("data",r,!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]}}Cr.extendSubschemaData=JA;function KA(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:r,allErrors:o}){i!==void 0&&(e.compositeRule=i),r!==void 0&&(e.createErrors=r),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=n}Cr.extendSubschemaMode=KA});var vv=N((KF,Mw)=>{"use strict";Mw.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),i=o.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;r--!==0;){var a=o[r];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}});var Vw=N((GF,Lw)=>{"use strict";var Ur=Lw.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var i=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};Ad(t,i,r,e,"",e)};Ur.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ur.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ur.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ur.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 Ad(e,t,n,i,r,o,a,s,c,u){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,r,o,a,s,c,u);for(var l in i){var d=i[l];if(Array.isArray(d)){if(l in Ur.arrayKeywords)for(var f=0;f<d.length;f++)Ad(e,t,n,d[f],r+"/"+l+"/"+f,o,r,l,i,f)}else if(l in Ur.propsKeywords){if(d&&typeof d=="object")for(var p in d)Ad(e,t,n,d[p],r+"/"+l+"/"+GA(p),o,r,l,i,p)}else(l in Ur.keywords||e.allKeys&&!(l in Ur.skipKeywords))&&Ad(e,t,n,d,r+"/"+l,o,r,l,i)}n(i,r,o,a,s,c,u)}}function GA(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var ss=N(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.getSchemaRefs=lt.resolveUrl=lt.normalizeId=lt._getFullPath=lt.getFullPath=lt.inlineRef=void 0;var HA=se(),WA=vv(),XA=Vw(),YA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function QA(e,t=!0){return typeof e=="boolean"?!0:t===!0?!yv(e):t?qw(e)<=t:!1}lt.inlineRef=QA;var eD=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function yv(e){for(let t in e){if(eD.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(yv)||typeof n=="object"&&yv(n))return!0}return!1}function qw(e){let t=0;for(let n in e){if(n==="$ref")return 1/0;if(t++,!YA.has(n)&&(typeof e[n]=="object"&&(0,HA.eachItem)(e[n],i=>t+=qw(i)),t===1/0))return 1/0}return t}function Fw(e,t="",n){n!==!1&&(t=Xi(t));let i=e.parse(t);return Bw(e,i)}lt.getFullPath=Fw;function Bw(e,t){return e.serialize(t).split("#")[0]+"#"}lt._getFullPath=Bw;var tD=/#\/?$/;function Xi(e){return e?e.replace(tD,""):""}lt.normalizeId=Xi;function rD(e,t,n){return n=Xi(n),e.resolve(t,n)}lt.resolveUrl=rD;var nD=/^[a-z_][-a-z0-9._]*$/i;function iD(e,t){if(typeof e=="boolean")return{};let{schemaId:n,uriResolver:i}=this.opts,r=Xi(e[n]||t),o={"":r},a=Fw(i,r,!1),s={},c=new Set;return XA(e,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=a+f,y=o[m];typeof d[n]=="string"&&(y=$.call(this,d[n])),w.call(this,d.$anchor),w.call(this,d.$dynamicAnchor),o[f]=y;function $(z){let D=this.opts.uriResolver.resolve;if(z=Xi(y?D(y,z):z),c.has(z))throw l(z);c.add(z);let E=this.refs[z];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?u(d,E.schema,z):z!==Xi(h)&&(z[0]==="#"?(u(d,s[z],z),s[z]=d):this.refs[z]=h),z}function w(z){if(typeof z=="string"){if(!nD.test(z))throw new Error(`invalid anchor "${z}"`);$.call(this,`#${z}`)}}}),s;function u(d,f,p){if(f!==void 0&&!WA(d,f))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}lt.getSchemaRefs=iD});var ls=N(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.getData=Zr.KeywordCxt=Zr.validateFunctionCode=void 0;var Ww=Sw(),Jw=as(),$v=lv(),Dd=as(),oD=Nw(),us=Cw(),_v=Zw(),M=Y(),J=dr(),aD=ss(),fr=se(),cs=os();function sD(e){if(Qw(e)&&(eS(e),Yw(e))){lD(e);return}Xw(e,()=>(0,Ww.topBoolOrEmptySchema)(e))}Zr.validateFunctionCode=sD;function Xw({gen:e,validateName:t,schema:n,schemaEnv:i,opts:r},o){r.code.es5?e.func(t,(0,M._)`${J.default.data}, ${J.default.valCxt}`,i.$async,()=>{e.code((0,M._)`"use strict"; ${Kw(n,r)}`),uD(e,r),e.code(o)}):e.func(t,(0,M._)`${J.default.data}, ${cD(r)}`,i.$async,()=>e.code(Kw(n,r)).code(o))}function cD(e){return(0,M._)`{${J.default.instancePath}="", ${J.default.parentData}, ${J.default.parentDataProperty}, ${J.default.rootData}=${J.default.data}${e.dynamicRef?(0,M._)`, ${J.default.dynamicAnchors}={}`:M.nil}}={}`}function uD(e,t){e.if(J.default.valCxt,()=>{e.var(J.default.instancePath,(0,M._)`${J.default.valCxt}.${J.default.instancePath}`),e.var(J.default.parentData,(0,M._)`${J.default.valCxt}.${J.default.parentData}`),e.var(J.default.parentDataProperty,(0,M._)`${J.default.valCxt}.${J.default.parentDataProperty}`),e.var(J.default.rootData,(0,M._)`${J.default.valCxt}.${J.default.rootData}`),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,M._)`${J.default.valCxt}.${J.default.dynamicAnchors}`)},()=>{e.var(J.default.instancePath,(0,M._)`""`),e.var(J.default.parentData,(0,M._)`undefined`),e.var(J.default.parentDataProperty,(0,M._)`undefined`),e.var(J.default.rootData,J.default.data),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,M._)`{}`)})}function lD(e){let{schema:t,opts:n,gen:i}=e;Xw(e,()=>{n.$comment&&t.$comment&&rS(e),hD(e),i.let(J.default.vErrors,null),i.let(J.default.errors,0),n.unevaluated&&dD(e),tS(e),yD(e)})}function dD(e){let{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,M._)`${n}.evaluated`),t.if((0,M._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,M._)`${e.evaluated}.props`,(0,M._)`undefined`)),t.if((0,M._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,M._)`${e.evaluated}.items`,(0,M._)`undefined`))}function Kw(e,t){let n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,M._)`/*# sourceURL=${n} */`:M.nil}function fD(e,t){if(Qw(e)&&(eS(e),Yw(e))){pD(e,t);return}(0,Ww.boolOrEmptySchema)(e,t)}function Yw({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function Qw(e){return typeof e.schema!="boolean"}function pD(e,t){let{schema:n,gen:i,opts:r}=e;r.$comment&&n.$comment&&rS(e),gD(e),vD(e);let o=i.const("_errs",J.default.errors);tS(e,o),i.var(t,(0,M._)`${o} === ${J.default.errors}`)}function eS(e){(0,fr.checkUnknownRules)(e),mD(e)}function tS(e,t){if(e.opts.jtd)return Gw(e,[],!1,t);let n=(0,Jw.getSchemaTypes)(e.schema),i=(0,Jw.coerceAndCheckDataType)(e,n);Gw(e,n,!i,t)}function mD(e){let{schema:t,errSchemaPath:n,opts:i,self:r}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,fr.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function hD(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,fr.checkStrictMode)(e,"default is ignored in the schema root")}function gD(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,aD.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function vD(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function rS({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:r}){let o=n.$comment;if(r.$comment===!0)e.code((0,M._)`${J.default.self}.logger.log(${o})`);else if(typeof r.$comment=="function"){let a=(0,M.str)`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,M._)`${J.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function yD(e){let{gen:t,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=e;n.$async?t.if((0,M._)`${J.default.errors} === 0`,()=>t.return(J.default.data),()=>t.throw((0,M._)`new ${r}(${J.default.vErrors})`)):(t.assign((0,M._)`${i}.errors`,J.default.vErrors),o.unevaluated&&_D(e),t.return((0,M._)`${J.default.errors} === 0`))}function _D({gen:e,evaluated:t,props:n,items:i}){n instanceof M.Name&&e.assign((0,M._)`${t}.props`,n),i instanceof M.Name&&e.assign((0,M._)`${t}.items`,i)}function Gw(e,t,n,i){let{gen:r,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,fr.schemaHasRulesButRef)(o,l))){r.block(()=>iS(e,"$ref",l.all.$ref.definition));return}c.jtd||$D(e,t),r.block(()=>{for(let f of l.rules)d(f);d(l.post)});function d(f){(0,$v.shouldUseGroup)(o,f)&&(f.type?(r.if((0,Dd.checkDataType)(f.type,a,c.strictNumbers)),Hw(e,f),t.length===1&&t[0]===f.type&&n&&(r.else(),(0,Dd.reportTypeError)(e)),r.endIf()):Hw(e,f),s||r.if((0,M._)`${J.default.errors} === ${i||0}`))}}function Hw(e,t){let{gen:n,schema:i,opts:{useDefaults:r}}=e;r&&(0,oD.assignDefaults)(e,t.type),n.block(()=>{for(let o of t.rules)(0,$v.shouldUseRule)(i,o)&&iS(e,o.keyword,o.definition,t.type)})}function $D(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(bD(e,t),e.opts.allowUnionTypes||xD(e,t),kD(e,e.dataTypes))}function bD(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{nS(e.dataTypes,n)||bv(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),SD(e,t)}}function xD(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&bv(e,"use allowUnionTypes to allow union type keyword")}function kD(e,t){let n=e.self.RULES.all;for(let i in n){let r=n[i];if(typeof r=="object"&&(0,$v.shouldUseRule)(e.schema,r)){let{type:o}=r.definition;o.length&&!o.some(a=>wD(t,a))&&bv(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function wD(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function nS(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function SD(e,t){let n=[];for(let i of e.dataTypes)nS(t,i)?n.push(i):t.includes("integer")&&i==="number"&&n.push("integer");e.dataTypes=n}function bv(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,fr.checkStrictMode)(e,t,e.opts.strictTypes)}var Rd=class{constructor(t,n,i){if((0,us.validateKeywordUsage)(t,n,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,fr.schemaRefOrVal)(t,this.schema,i,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",oS(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,us.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=t.gen.const("_errs",J.default.errors))}result(t,n,i){this.failResult((0,M.not)(t),n,i)}failResult(t,n,i){this.gen.if(t),i?i():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,M.not)(t),void 0,n)}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:n}=this;this.fail((0,M._)`${n} !== undefined && (${(0,M.or)(this.invalid$data(),t)})`)}error(t,n,i){if(n){this.setParams(n),this._error(t,i),this.setParams({});return}this._error(t,i)}_error(t,n){(t?cs.reportExtraError:cs.reportError)(this,this.def.error,n)}$dataError(){(0,cs.reportError)(this,this.def.$dataError||cs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,cs.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,i=M.nil){this.gen.block(()=>{this.check$data(t,i),n()})}check$data(t=M.nil,n=M.nil){if(!this.$data)return;let{gen:i,schemaCode:r,schemaType:o,def:a}=this;i.if((0,M.or)((0,M._)`${r} === undefined`,n)),t!==M.nil&&i.assign(t,!0),(o.length||a.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==M.nil&&i.assign(t,!1)),i.else()}invalid$data(){let{gen:t,schemaCode:n,schemaType:i,def:r,it:o}=this;return(0,M.or)(a(),s());function a(){if(i.length){if(!(n instanceof M.Name))throw new Error("ajv implementation error");let c=Array.isArray(i)?i:[i];return(0,M._)`${(0,Dd.checkDataTypes)(c,n,o.opts.strictNumbers,Dd.DataType.Wrong)}`}return M.nil}function s(){if(r.validateSchema){let c=t.scopeValue("validate$data",{ref:r.validateSchema});return(0,M._)`!${c}(${n})`}return M.nil}}subschema(t,n){let i=(0,_v.getSubschema)(this.it,t);(0,_v.extendSubschemaData)(i,this.it,t),(0,_v.extendSubschemaMode)(i,t);let r={...this.it,...i,items:void 0,props:void 0};return fD(r,n),r}mergeEvaluated(t,n){let{it:i,gen:r}=this;i.opts.unevaluated&&(i.props!==!0&&t.props!==void 0&&(i.props=fr.mergeEvaluated.props(r,t.props,i.props,n)),i.items!==!0&&t.items!==void 0&&(i.items=fr.mergeEvaluated.items(r,t.items,i.items,n)))}mergeValidEvaluated(t,n){let{it:i,gen:r}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return r.if(n,()=>this.mergeEvaluated(t,M.Name)),!0}};Zr.KeywordCxt=Rd;function iS(e,t,n,i){let r=new Rd(e,n,t);"code"in n?n.code(r,i):r.$data&&n.validate?(0,us.funcKeywordCode)(r,n):"macro"in n?(0,us.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,us.funcKeywordCode)(r,n)}var ID=/^\/(?:[^~]|~0|~1)*$/,zD=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oS(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let r,o;if(e==="")return J.default.rootData;if(e[0]==="/"){if(!ID.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,o=J.default.rootData}else{let u=zD.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(r=u[2],r==="#"){if(l>=t)throw new Error(c("property/index",l));return i[t-l]}if(l>t)throw new Error(c("data",l));if(o=n[t-l],!r)return o}let a=o,s=r.split("/");for(let u of s)u&&(o=(0,M._)`${o}${(0,M.getProperty)((0,fr.unescapeJsonPointer)(u))}`,a=(0,M._)`${a} && ${o}`);return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}Zr.getData=oS});var Cd=N(kv=>{"use strict";Object.defineProperty(kv,"__esModule",{value:!0});var xv=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};kv.default=xv});var ds=N(Iv=>{"use strict";Object.defineProperty(Iv,"__esModule",{value:!0});var wv=ss(),Sv=class extends Error{constructor(t,n,i,r){super(r||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,wv.resolveUrl)(t,n,i),this.missingSchema=(0,wv.normalizeId)((0,wv.getFullPath)(t,this.missingRef))}};Iv.default=Sv});var Zd=N(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.resolveSchema=It.getCompilingSchema=It.resolveRef=It.compileSchema=It.SchemaEnv=void 0;var Rt=Y(),PD=Cd(),_n=dr(),Ct=ss(),aS=se(),TD=ls(),Yi=class{constructor(t){var n;this.refs={},this.dynamicAnchors={};let i;typeof t.schema=="object"&&(i=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,Ct.normalizeId)(i?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=i?.$async,this.refs={}}};It.SchemaEnv=Yi;function Pv(e){let t=sS.call(this,e);if(t)return t;let n=(0,Ct.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:r}=this.opts.code,{ownProperties:o}=this.opts,a=new Rt.CodeGen(this.scope,{es5:i,lines:r,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:PD.default,code:(0,Rt._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:_n.default.data,parentData:_n.default.parentData,parentDataProperty:_n.default.parentDataProperty,dataNames:[_n.default.data],dataPathArr:[Rt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Rt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Rt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Rt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,TD.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let d=a.toString();l=`${a.scopeRefs(_n.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let p=new Function(`${_n.default.self}`,`${_n.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:m,items:h}=u;p.evaluated={props:m instanceof Rt.Name?void 0:m,items:h instanceof Rt.Name?void 0:h,dynamicProps:m instanceof Rt.Name,dynamicItems:h instanceof Rt.Name},p.source&&(p.source.evaluated=(0,Rt.stringify)(p.evaluated))}return e.validate=p,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)}}It.compileSchema=Pv;function OD(e,t,n){var i;n=(0,Ct.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let o=jD.call(this,e,n);if(o===void 0){let a=(i=e.localRefs)===null||i===void 0?void 0:i[n],{schemaId:s}=this.opts;a&&(o=new Yi({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[n]=ED.call(this,o)}It.resolveRef=OD;function ED(e){return(0,Ct.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Pv.call(this,e)}function sS(e){for(let t of this._compilations)if(ND(t,e))return t}It.getCompilingSchema=sS;function ND(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function jD(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Ud.call(this,e,t)}function Ud(e,t){let n=this.opts.uriResolver.parse(t),i=(0,Ct._getFullPath)(this.opts.uriResolver,n),r=(0,Ct.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===r)return zv.call(this,n,e);let o=(0,Ct.normalizeId)(i),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let s=Ud.call(this,e,a);return typeof s?.schema!="object"?void 0:zv.call(this,n,s)}if(typeof a?.schema=="object"){if(a.validate||Pv.call(this,a),o===(0,Ct.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(r=(0,Ct.resolveUrl)(this.opts.uriResolver,r,u)),new Yi({schema:s,schemaId:c,root:e,baseId:r})}return zv.call(this,n,a)}}It.resolveSchema=Ud;var AD=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zv(e,{baseId:t,schema:n,root:i}){var r;if(((r=e.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let c=n[(0,aS.unescapeFragment)(s)];if(c===void 0)return;n=c;let u=typeof n=="object"&&n[this.opts.schemaId];!AD.has(s)&&u&&(t=(0,Ct.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,aS.schemaHasRulesButRef)(n,this.RULES)){let s=(0,Ct.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=Ud.call(this,i,s)}let{schemaId:a}=this.opts;if(o=o||new Yi({schema:n,schemaId:a,root:i,baseId:t}),o.schema!==o.root.schema)return o}});var cS=N((e9,DD)=>{DD.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 Ev=N((t9,mS)=>{"use strict";var RD=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),lS=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),Tv=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),dS=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),CD=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Ov(e){let t="",n=0,i=0;for(i=0;i<e.length;i++)if(n=e[i].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(n=e[i].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[i]}return t}var UD=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function uS(e){return e.length=0,!0}function ZD(e,t,n){if(e.length){let i=Ov(e);if(i!=="")t.push(i);else return n.error=!0,!1;e.length=0}return!0}function MD(e){let t=0,n={error:!1,address:"",zone:""},i=[],r=[],o=!1,a=!1,s=ZD;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!s(r,i,n))break;if(++t>7){n.error=!0;break}c>0&&e[c-1]===":"&&(o=!0),i.push(":");continue}else if(u==="%"){if(!s(r,i,n))break;s=uS}else{r.push(u);continue}}return r.length&&(s===uS?n.zone=r.join(""):a?i.push(r.join("")):i.push(Ov(r))),n.address=i.join(""),n}function fS(e){if(LD(e,":")<2)return{host:e,isIPV6:!1};let t=MD(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,i=t.address;return t.zone&&(n+="%"+t.zone,i+="%25"+t.zone),{host:n,isIPV6:!0,escapedHost:i}}}function LD(e,t){let n=0;for(let i=0;i<e.length;i++)e[i]===t&&n++;return n}function VD(e){let t=e,n=[],i=-1,r=0;for(;r=t.length;){if(r===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(r===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(r===3&&t==="/.."){n.length!==0&&n.pop(),n.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),n.length!==0&&n.pop();continue}}if((i=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,i)),t=t.slice(i)}return n.join("")}var qD={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},FD=/[@/?#:]/g,BD=/[@/?#]/g;function pS(e,t){let n=t?BD:FD;return n.lastIndex=0,e.replace(n,i=>qD[i])}function JD(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let i=0;i<e.length;i++){if(e[i]==="%"&&i+2<e.length){let r=e.slice(i+1,i+3);if(Tv(r)){let o=r.toUpperCase(),a=String.fromCharCode(parseInt(o,16));t&&dS(a)?n+=a:n+="%"+o,i+=2;continue}}n+=e[i]}return n}function KD(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(Tv(i)){let r=i.toUpperCase(),o=String.fromCharCode(parseInt(r,16));o!=="."&&dS(o)?t+=o:t+="%"+r,n+=2;continue}}CD(e[n])?t+=e[n]:t+=escape(e[n])}return t}function GD(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(Tv(i)){t+="%"+i.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function HD(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!lS(n)){let i=fS(n);i.isIPV6===!0?n=`[${i.escapedHost}]`:n=pS(n,!1)}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}mS.exports={nonSimpleDomain:UD,recomposeAuthority:HD,reescapeHostDelimiters:pS,normalizePercentEncoding:JD,normalizePathEncoding:KD,escapePreservingEscapes:GD,removeDotSegments:VD,isIPv4:lS,isUUID:RD,normalizeIPv6:fS,stringArrayToHexStripped:Ov}});var _S=N((r9,yS)=>{"use strict";var{isUUID:WD}=Ev(),XD=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,YD=["http","https","ws","wss","urn","urn:uuid"];function QD(e){return YD.indexOf(e)!==-1}function Nv(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 hS(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function gS(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 eR(e){return e.secure=Nv(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function tR(e){if((e.port===(Nv(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,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function rR(e,t){if(!e.path)return e.error="URN can not be parsed",e;let n=e.path.match(XD);if(n){let i=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];let r=`${i}:${t.nid||e.nid}`,o=jv(r);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function nR(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let n=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),r=`${n}:${t.nid||i}`,o=jv(r);o&&(e=o.serialize(e,t));let a=e,s=e.nss;return a.path=`${i||t.nid}:${s}`,t.skipEscape=!0,a}function iR(e,t){let n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!WD(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function oR(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var vS={scheme:"http",domainHost:!0,parse:hS,serialize:gS},aR={scheme:"https",domainHost:vS.domainHost,parse:hS,serialize:gS},Md={scheme:"ws",domainHost:!0,parse:eR,serialize:tR},sR={scheme:"wss",domainHost:Md.domainHost,parse:Md.parse,serialize:Md.serialize},cR={scheme:"urn",parse:rR,serialize:nR,skipNormalize:!0},uR={scheme:"urn:uuid",parse:iR,serialize:oR,skipNormalize:!0},Ld={http:vS,https:aR,ws:Md,wss:sR,urn:cR,"urn:uuid":uR};Object.setPrototypeOf(Ld,null);function jv(e){return e&&(Ld[e]||Ld[e.toLowerCase()])||void 0}yS.exports={wsIsSecure:Nv,SCHEMES:Ld,isValidSchemeName:QD,getSchemeHandler:jv}});var SS=N((n9,Vd)=>{"use strict";var{normalizeIPv6:lR,removeDotSegments:fs,recomposeAuthority:dR,normalizePercentEncoding:fR,normalizePathEncoding:pR,escapePreservingEscapes:mR,reescapeHostDelimiters:hR,isIPv4:gR,nonSimpleDomain:vR}=Ev(),{SCHEMES:yR,getSchemeHandler:bS}=_S();function _R(e,t){return typeof e=="string"?e=wR(e,t):typeof e=="object"&&(e=Qi($n(e,t),t)),e}function $R(e,t,n){let i=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=xS(Qi(e,i),Qi(t,i),i,!0);return i.skipEscape=!0,$n(r,i)}function xS(e,t,n,i){let r={};return i||(e=Qi($n(e,n),n),t=Qi($n(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=fs(t.path||""),r.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=fs(t.path||""),r.query=t.query):(t.path?(t.path[0]==="/"?r.path=fs(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?r.path="/"+t.path:e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path,r.path=fs(r.path)),r.query=t.query):(r.path=e.path,t.query!==void 0?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function bR(e,t,n){let i=$S(e,n),r=$S(t,n);return i!==void 0&&r!==void 0&&i.toLowerCase()===r.toLowerCase()}function $n(e,t){let n={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:""},i=Object.assign({},t),r=[],o=bS(i.scheme||n.scheme);o&&o.serialize&&o.serialize(n,i),n.path!==void 0&&(i.skipEscape?n.path=fR(n.path):(n.path=mR(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),i.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");let a=dR(n);if(a!==void 0&&(i.reference!=="suffix"&&r.push("//"),r.push(a),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let s=n.path;!i.absolutePath&&(!o||!o.absolutePath)&&(s=fs(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),r.push(s)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}var xR=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function kR(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function kS(e,t){let n=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=!1,o=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);let a=e.match(xR);if(a){i.scheme=a[1],i.userinfo=a[3],i.host=a[4],i.port=parseInt(a[5],10),i.path=a[6]||"",i.query=a[7],i.fragment=a[8],isNaN(i.port)&&(i.port=a[5]);let s=kR(i,a);if(s!==void 0&&(i.error=i.error||s,r=!0),i.host)if(gR(i.host)===!1){let l=lR(i.host);i.host=l.host.toLowerCase(),o=l.isIPV6}else o=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==i.reference&&(i.error=i.error||"URI is not a "+n.reference+" reference.");let c=bS(n.scheme||i.scheme);if(!n.unicodeSupport&&(!c||!c.unicodeSupport)&&i.host&&(n.domainHost||c&&c.domainHost)&&o===!1&&vR(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(u){i.error=i.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(e.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=hR(unescape(i.host),o))),i.path&&(i.path=pR(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}c&&c.parse&&c.parse(i,n)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:r}}function Qi(e,t){return kS(e,t).parsed}function wR(e,t){return wS(e,t).normalized}function wS(e,t){let{parsed:n,malformedAuthorityOrPort:i}=kS(e,t);return{normalized:i?e:$n(n,t),malformedAuthorityOrPort:i}}function $S(e,t){if(typeof e=="string"){let{normalized:n,malformedAuthorityOrPort:i}=wS(e,t);return i?void 0:n}if(typeof e=="object")return $n(e,t)}var Av={SCHEMES:yR,normalize:_R,resolve:$R,resolveComponent:xS,equal:bR,serialize:$n,parse:Qi};Vd.exports=Av;Vd.exports.default=Av;Vd.exports.fastUri=Av});var zS=N(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});var IS=SS();IS.code='require("ajv/dist/runtime/uri").default';Dv.default=IS});var DS=N(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.CodeGen=Le.Name=Le.nil=Le.stringify=Le.str=Le._=Le.KeywordCxt=void 0;var SR=ls();Object.defineProperty(Le,"KeywordCxt",{enumerable:!0,get:function(){return SR.KeywordCxt}});var eo=Y();Object.defineProperty(Le,"_",{enumerable:!0,get:function(){return eo._}});Object.defineProperty(Le,"str",{enumerable:!0,get:function(){return eo.str}});Object.defineProperty(Le,"stringify",{enumerable:!0,get:function(){return eo.stringify}});Object.defineProperty(Le,"nil",{enumerable:!0,get:function(){return eo.nil}});Object.defineProperty(Le,"Name",{enumerable:!0,get:function(){return eo.Name}});Object.defineProperty(Le,"CodeGen",{enumerable:!0,get:function(){return eo.CodeGen}});var IR=Cd(),NS=ds(),zR=uv(),ps=Zd(),PR=Y(),ms=ss(),qd=as(),Cv=se(),PS=cS(),TR=zS(),jS=(e,t)=>new RegExp(e,t);jS.code="new RegExp";var OR=["removeAdditional","useDefaults","coerceTypes"],ER=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),NR={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."},jR={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},TS=200;function AR(e){var t,n,i,r,o,a,s,c,u,l,d,f,p,m,h,y,$,w,z,D,E,K,ke,Yt,Sn;let Qt=e.strict,In=(t=e.code)===null||t===void 0?void 0:t.optimize,Rs=In===!0||In===void 0?1:In||0,Cs=(i=(n=e.code)===null||n===void 0?void 0:n.regExp)!==null&&i!==void 0?i:jS,Az=(r=e.uriResolver)!==null&&r!==void 0?r:TR.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Qt)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:Qt)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Qt)!==null&&l!==void 0?l:"log",strictTuples:(f=(d=e.strictTuples)!==null&&d!==void 0?d:Qt)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=e.strictRequired)!==null&&p!==void 0?p:Qt)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:Rs,regExp:Cs}:{optimize:Rs,regExp:Cs},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:TS,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:TS,meta:($=e.meta)!==null&&$!==void 0?$:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(z=e.inlineRefs)!==null&&z!==void 0?z:!0,schemaId:(D=e.schemaId)!==null&&D!==void 0?D:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(K=e.validateSchema)!==null&&K!==void 0?K:!0,validateFormats:(ke=e.validateFormats)!==null&&ke!==void 0?ke:!0,unicodeRegExp:(Yt=e.unicodeRegExp)!==null&&Yt!==void 0?Yt:!0,int32range:(Sn=e.int32range)!==null&&Sn!==void 0?Sn:!0,uriResolver:Az}}var hs=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...AR(t)};let{es5:n,lines:i}=this.opts.code;this.scope=new PR.ValueScope({scope:{},prefixes:ER,es5:n,lines:i}),this.logger=MR(t.logger);let r=t.validateFormats;t.validateFormats=!1,this.RULES=(0,zR.getRules)(),OS.call(this,NR,t,"NOT SUPPORTED"),OS.call(this,jR,t,"DEPRECATED","warn"),this._metaOpts=UR.call(this),t.formats&&RR.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&CR.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),DR.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:n,schemaId:i}=this.opts,r=PS;i==="id"&&(r={...PS},r.id=r.$id,delete r.$id),n&&t&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){let{meta:t,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[n]||t:void 0}validate(t,n){let i;if(typeof t=="string"){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);let r=i(n);return"$async"in i||(this.errors=i.errors),r}compile(t,n){let i=this._addSchema(t,n);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return r.call(this,t,n);async function r(l,d){await o.call(this,l.$schema);let f=this._addSchema(l,d);return f.validate||a.call(this,f)}async function o(l){l&&!this.getSchema(l)&&await r.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof NS.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,n)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=i(l))}finally{delete this._loading[l]}}}addSchema(t,n,i,r=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,i,r);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 n=(0,ms.normalizeId)(n||o),this._checkUnique(n),this.schemas[n]=this._addSchema(t,i,n,r,!0),this}addMetaSchema(t,n,i=this.opts.validateSchema){return this.addSchema(t,n,!0,i),this}validateSchema(t,n){if(typeof t=="boolean")return!0;let i;if(i=t.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(i,t);if(!r&&n){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return r}getSchema(t){let n;for(;typeof(n=ES.call(this,t))=="string";)t=n;if(n===void 0){let{schemaId:i}=this.opts,r=new ps.SchemaEnv({schema:{},schemaId:i});if(n=ps.resolveSchema.call(this,r,t),!n)return;this.refs[t]=n}return n.validate||this._compileSchemaEnv(n)}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 n=ES.call(this,t);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let n=t;this._cache.delete(n);let i=t[this.opts.schemaId];return i&&(i=(0,ms.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let n of t)this.addKeyword(n);return this}addKeyword(t,n){let i;if(typeof t=="string")i=t,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=i);else if(typeof t=="object"&&n===void 0){if(n=t,i=n.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(VR.call(this,i,n),!n)return(0,Cv.eachItem)(i,o=>Rv.call(this,o)),this;FR.call(this,n);let r={...n,type:(0,qd.getJSONTypes)(n.type),schemaType:(0,qd.getJSONTypes)(n.schemaType)};return(0,Cv.eachItem)(i,r.type.length===0?o=>Rv.call(this,o,r):o=>r.type.forEach(a=>Rv.call(this,o,r,a))),this}getKeyword(t){let n=this.RULES.all[t];return typeof n=="object"?n.definition:!!n}removeKeyword(t){let{RULES:n}=this;delete n.keywords[t],delete n.all[t];for(let i of n.rules){let r=i.rules.findIndex(o=>o.keyword===t);r>=0&&i.rules.splice(r,1)}return this}addFormat(t,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[t]=n,this}errorsText(t=this.errors,{separator:n=", ",dataVar:i="data"}={}){return!t||t.length===0?"No errors":t.map(r=>`${i}${r.instancePath} ${r.message}`).reduce((r,o)=>r+n+o)}$dataMetaSchema(t,n){let i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let r of n){let o=r.split("/").slice(1),a=t;for(let s of o)a=a[s];for(let s in i){let c=i[s];if(typeof c!="object")continue;let{$data:u}=c.definition,l=a[s];u&&l&&(a[s]=AS(l))}}return t}_removeAllSchemas(t,n){for(let i in t){let r=t[i];(!n||n.test(i))&&(typeof r=="string"?delete t[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete t[i]))}}_addSchema(t,n,i,r=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;i=(0,ms.normalizeId)(a||i);let u=ms.getSchemaRefs.call(this,t,i);return c=new ps.SchemaEnv({schema:t,schemaId:s,meta:n,baseId:i,localRefs:u}),this._cache.set(c.schema,c),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=c),r&&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):ps.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let n=this.opts;this.opts=this._metaOpts;try{ps.compileSchema.call(this,t)}finally{this.opts=n}}};hs.ValidationError=IR.default;hs.MissingRefError=NS.default;Le.default=hs;function OS(e,t,n,i="error"){for(let r in e){let o=r;o in t&&this.logger[i](`${n}: option ${r}. ${e[o]}`)}}function ES(e){return e=(0,ms.normalizeId)(e),this.schemas[e]||this.refs[e]}function DR(){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 RR(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function CR(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 n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}function UR(){let e={...this.opts};for(let t of OR)delete e[t];return e}var ZR={log(){},warn(){},error(){}};function MR(e){if(e===!1)return ZR;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 LR=/^[a-z_$][a-z0-9_$:-]*$/i;function VR(e,t){let{RULES:n}=this;if((0,Cv.eachItem)(e,i=>{if(n.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!LR.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function Rv(e,t,n){var i;let r=t?.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=r?o.post:o.rules.find(({type:c})=>c===n);if(a||(a={type:n,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,qd.getJSONTypes)(t.type),schemaType:(0,qd.getJSONTypes)(t.schemaType)}};t.before?qR.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,(i=t.implements)===null||i===void 0||i.forEach(c=>this.addKeyword(c))}function qR(e,t,n){let i=e.rules.findIndex(r=>r.keyword===n);i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function FR(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=AS(t)),e.validateSchema=this.compile(t,!0))}var BR={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function AS(e){return{anyOf:[e,BR]}}});var RS=N(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var JR={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Uv.default=JR});var MS=N(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.callRef=bn.getValidate=void 0;var KR=ds(),CS=St(),dt=Y(),to=dr(),US=Zd(),Fd=se(),GR={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:n,it:i}=e,{baseId:r,schemaEnv:o,validateName:a,opts:s,self:c}=i,{root:u}=o;if((n==="#"||n==="#/")&&r===u.baseId)return d();let l=US.resolveRef.call(c,u,r,n);if(l===void 0)throw new KR.default(i.opts.uriResolver,r,n);if(l instanceof US.SchemaEnv)return f(l);return p(l);function d(){if(o===u)return Bd(e,a,o,o.$async);let m=t.scopeValue("root",{ref:u});return Bd(e,(0,dt._)`${m}.validate`,u,u.$async)}function f(m){let h=ZS(e,m);Bd(e,h,m,m.$async)}function p(m){let h=t.scopeValue("schema",s.code.source===!0?{ref:m,code:(0,dt.stringify)(m)}:{ref:m}),y=t.name("valid"),$=e.subschema({schema:m,dataTypes:[],schemaPath:dt.nil,topSchemaRef:h,errSchemaPath:n},y);e.mergeEvaluated($),e.ok(y)}}};function ZS(e,t){let{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,dt._)`${n.scopeValue("wrapper",{ref:t})}.validate`}bn.getValidate=ZS;function Bd(e,t,n,i){let{gen:r,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?to.default.this:dt.nil;i?l():d();function l(){if(!s.$async)throw new Error("async schema referenced by sync schema");let m=r.let("valid");r.try(()=>{r.code((0,dt._)`await ${(0,CS.callValidateCode)(e,t,u)}`),p(t),a||r.assign(m,!0)},h=>{r.if((0,dt._)`!(${h} instanceof ${o.ValidationError})`,()=>r.throw(h)),f(h),a||r.assign(m,!1)}),e.ok(m)}function d(){e.result((0,CS.callValidateCode)(e,t,u),()=>p(t),()=>f(t))}function f(m){let h=(0,dt._)`${m}.errors`;r.assign(to.default.vErrors,(0,dt._)`${to.default.vErrors} === null ? ${h} : ${to.default.vErrors}.concat(${h})`),r.assign(to.default.errors,(0,dt._)`${to.default.vErrors}.length`)}function p(m){var h;if(!o.opts.unevaluated)return;let y=(h=n?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(o.props=Fd.mergeEvaluated.props(r,y.props,o.props));else{let $=r.var("props",(0,dt._)`${m}.evaluated.props`);o.props=Fd.mergeEvaluated.props(r,$,o.props,dt.Name)}if(o.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(o.items=Fd.mergeEvaluated.items(r,y.items,o.items));else{let $=r.var("items",(0,dt._)`${m}.evaluated.items`);o.items=Fd.mergeEvaluated.items(r,$,o.items,dt.Name)}}}bn.callRef=Bd;bn.default=GR});var LS=N(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var HR=RS(),WR=MS(),XR=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",HR.default,WR.default];Zv.default=XR});var VS=N(Mv=>{"use strict";Object.defineProperty(Mv,"__esModule",{value:!0});var Jd=Y(),Mr=Jd.operators,Kd={maximum:{okStr:"<=",ok:Mr.LTE,fail:Mr.GT},minimum:{okStr:">=",ok:Mr.GTE,fail:Mr.LT},exclusiveMaximum:{okStr:"<",ok:Mr.LT,fail:Mr.GTE},exclusiveMinimum:{okStr:">",ok:Mr.GT,fail:Mr.LTE}},YR={message:({keyword:e,schemaCode:t})=>(0,Jd.str)`must be ${Kd[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Jd._)`{comparison: ${Kd[e].okStr}, limit: ${t}}`},QR={keyword:Object.keys(Kd),type:"number",schemaType:"number",$data:!0,error:YR,code(e){let{keyword:t,data:n,schemaCode:i}=e;e.fail$data((0,Jd._)`${n} ${Kd[t].fail} ${i} || isNaN(${n})`)}};Mv.default=QR});var qS=N(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});var gs=Y(),e4={message:({schemaCode:e})=>(0,gs.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,gs._)`{multipleOf: ${e}}`},t4={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:e4,code(e){let{gen:t,data:n,schemaCode:i,it:r}=e,o=r.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,gs._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,gs._)`${a} !== parseInt(${a})`;e.fail$data((0,gs._)`(${i} === 0 || (${a} = ${n}/${i}, ${s}))`)}};Lv.default=t4});var BS=N(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});function FS(e){let t=e.length,n=0,i=0,r;for(;i<t;)n++,r=e.charCodeAt(i++),r>=55296&&r<=56319&&i<t&&(r=e.charCodeAt(i),(r&64512)===56320&&i++);return n}Vv.default=FS;FS.code='require("ajv/dist/runtime/ucs2length").default'});var JS=N(qv=>{"use strict";Object.defineProperty(qv,"__esModule",{value:!0});var xn=Y(),r4=se(),n4=BS(),i4={message({keyword:e,schemaCode:t}){let n=e==="maxLength"?"more":"fewer";return(0,xn.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,xn._)`{limit: ${e}}`},o4={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:i4,code(e){let{keyword:t,data:n,schemaCode:i,it:r}=e,o=t==="maxLength"?xn.operators.GT:xn.operators.LT,a=r.opts.unicode===!1?(0,xn._)`${n}.length`:(0,xn._)`${(0,r4.useFunc)(e.gen,n4.default)}(${n})`;e.fail$data((0,xn._)`${a} ${o} ${i}`)}};qv.default=o4});var KS=N(Fv=>{"use strict";Object.defineProperty(Fv,"__esModule",{value:!0});var a4=St(),s4=se(),ro=Y(),c4={message:({schemaCode:e})=>(0,ro.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ro._)`{pattern: ${e}}`},u4={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:c4,code(e){let{gen:t,data:n,$data:i,schema:r,schemaCode:o,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(i){let{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,ro._)`new RegExp`:(0,s4.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,ro._)`${u}(${o}, ${s}).test(${n})`),()=>t.assign(l,!1)),e.fail$data((0,ro._)`!${l}`)}else{let c=(0,a4.usePattern)(e,r);e.fail$data((0,ro._)`!${c}.test(${n})`)}}};Fv.default=u4});var GS=N(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var vs=Y(),l4={message({keyword:e,schemaCode:t}){let n=e==="maxProperties"?"more":"fewer";return(0,vs.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,vs._)`{limit: ${e}}`},d4={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:l4,code(e){let{keyword:t,data:n,schemaCode:i}=e,r=t==="maxProperties"?vs.operators.GT:vs.operators.LT;e.fail$data((0,vs._)`Object.keys(${n}).length ${r} ${i}`)}};Bv.default=d4});var HS=N(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});var ys=St(),_s=Y(),f4=se(),p4={message:({params:{missingProperty:e}})=>(0,_s.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,_s._)`{missingProperty: ${e}}`},m4={keyword:"required",type:"object",schemaType:"array",$data:!0,error:p4,code(e){let{gen:t,schema:n,schemaCode:i,data:r,$data:o,it:a}=e,{opts:s}=a;if(!o&&n.length===0)return;let c=n.length>=s.loopRequired;if(a.allErrors?u():l(),s.strictRequired){let p=e.parentSchema.properties,{definedProperties:m}=e.it;for(let h of n)if(p?.[h]===void 0&&!m.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,$=`required property "${h}" is not defined at "${y}" (strictRequired)`;(0,f4.checkStrictMode)(a,$,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(_s.nil,d);else for(let p of n)(0,ys.checkReportMissingProp)(e,p)}function l(){let p=t.let("missing");if(c||o){let m=t.let("valid",!0);e.block$data(m,()=>f(p,m)),e.ok(m)}else t.if((0,ys.checkMissingProp)(e,n,p)),(0,ys.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",i,p=>{e.setParams({missingProperty:p}),t.if((0,ys.noPropertyInData)(t,r,p,s.ownProperties),()=>e.error())})}function f(p,m){e.setParams({missingProperty:p}),t.forOf(p,i,()=>{t.assign(m,(0,ys.propertyInData)(t,r,p,s.ownProperties)),t.if((0,_s.not)(m),()=>{e.error(),t.break()})},_s.nil)}}};Jv.default=m4});var WS=N(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var $s=Y(),h4={message({keyword:e,schemaCode:t}){let n=e==="maxItems"?"more":"fewer";return(0,$s.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,$s._)`{limit: ${e}}`},g4={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:h4,code(e){let{keyword:t,data:n,schemaCode:i}=e,r=t==="maxItems"?$s.operators.GT:$s.operators.LT;e.fail$data((0,$s._)`${n}.length ${r} ${i}`)}};Kv.default=g4});var Gd=N(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var XS=vv();XS.code='require("ajv/dist/runtime/equal").default';Gv.default=XS});var YS=N(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});var Hv=as(),Ve=Y(),v4=se(),y4=Gd(),_4={message:({params:{i:e,j:t}})=>(0,Ve.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ve._)`{i: ${e}, j: ${t}}`},$4={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:_4,code(e){let{gen:t,data:n,$data:i,schema:r,parentSchema:o,schemaCode:a,it:s}=e;if(!i&&!r)return;let c=t.let("valid"),u=o.items?(0,Hv.getSchemaTypes)(o.items):[];e.block$data(c,l,(0,Ve._)`${a} === false`),e.ok(c);function l(){let m=t.let("i",(0,Ve._)`${n}.length`),h=t.let("j");e.setParams({i:m,j:h}),t.assign(c,!0),t.if((0,Ve._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,h){let y=t.name("item"),$=(0,Hv.checkDataTypes)(u,y,s.opts.strictNumbers,Hv.DataType.Wrong),w=t.const("indices",(0,Ve._)`{}`);t.for((0,Ve._)`;${m}--;`,()=>{t.let(y,(0,Ve._)`${n}[${m}]`),t.if($,(0,Ve._)`continue`),u.length>1&&t.if((0,Ve._)`typeof ${y} == "string"`,(0,Ve._)`${y} += "_"`),t.if((0,Ve._)`typeof ${w}[${y}] == "number"`,()=>{t.assign(h,(0,Ve._)`${w}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,Ve._)`${w}[${y}] = ${m}`)})}function p(m,h){let y=(0,v4.useFunc)(t,y4.default),$=t.name("outer");t.label($).for((0,Ve._)`;${m}--;`,()=>t.for((0,Ve._)`${h} = ${m}; ${h}--;`,()=>t.if((0,Ve._)`${y}(${n}[${m}], ${n}[${h}])`,()=>{e.error(),t.assign(c,!1).break($)})))}}};Wv.default=$4});var QS=N(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var Xv=Y(),b4=se(),x4=Gd(),k4={message:"must be equal to constant",params:({schemaCode:e})=>(0,Xv._)`{allowedValue: ${e}}`},w4={keyword:"const",$data:!0,error:k4,code(e){let{gen:t,data:n,$data:i,schemaCode:r,schema:o}=e;i||o&&typeof o=="object"?e.fail$data((0,Xv._)`!${(0,b4.useFunc)(t,x4.default)}(${n}, ${r})`):e.fail((0,Xv._)`${o} !== ${n}`)}};Yv.default=w4});var eI=N(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var bs=Y(),S4=se(),I4=Gd(),z4={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,bs._)`{allowedValues: ${e}}`},P4={keyword:"enum",schemaType:"array",$data:!0,error:z4,code(e){let{gen:t,data:n,$data:i,schema:r,schemaCode:o,it:a}=e;if(!i&&r.length===0)throw new Error("enum must have non-empty array");let s=r.length>=a.opts.loopEnum,c,u=()=>c??(c=(0,S4.useFunc)(t,I4.default)),l;if(s||i)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let p=t.const("vSchema",o);l=(0,bs.or)(...r.map((m,h)=>f(p,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,p=>t.if((0,bs._)`${u()}(${n}, ${p})`,()=>t.assign(l,!0).break()))}function f(p,m){let h=r[m];return typeof h=="object"&&h!==null?(0,bs._)`${u()}(${n}, ${p}[${m}])`:(0,bs._)`${n} === ${h}`}}};Qv.default=P4});var tI=N(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});var T4=VS(),O4=qS(),E4=JS(),N4=KS(),j4=GS(),A4=HS(),D4=WS(),R4=YS(),C4=QS(),U4=eI(),Z4=[T4.default,O4.default,E4.default,N4.default,j4.default,A4.default,D4.default,R4.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},C4.default,U4.default];ey.default=Z4});var ry=N(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.validateAdditionalItems=void 0;var kn=Y(),ty=se(),M4={message:({params:{len:e}})=>(0,kn.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,kn._)`{limit: ${e}}`},L4={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:M4,code(e){let{parentSchema:t,it:n}=e,{items:i}=t;if(!Array.isArray(i)){(0,ty.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}rI(e,i)}};function rI(e,t){let{gen:n,schema:i,data:r,keyword:o,it:a}=e;a.items=!0;let s=n.const("len",(0,kn._)`${r}.length`);if(i===!1)e.setParams({len:t.length}),e.pass((0,kn._)`${s} <= ${t.length}`);else if(typeof i=="object"&&!(0,ty.alwaysValidSchema)(a,i)){let u=n.var("valid",(0,kn._)`${s} <= ${t.length}`);n.if((0,kn.not)(u),()=>c(u)),e.ok(u)}function c(u){n.forRange("i",t.length,s,l=>{e.subschema({keyword:o,dataProp:l,dataPropType:ty.Type.Num},u),a.allErrors||n.if((0,kn.not)(u),()=>n.break())})}}xs.validateAdditionalItems=rI;xs.default=L4});var ny=N(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.validateTuple=void 0;var nI=Y(),Hd=se(),V4=St(),q4={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:n}=e;if(Array.isArray(t))return iI(e,"additionalItems",t);n.items=!0,!(0,Hd.alwaysValidSchema)(n,t)&&e.ok((0,V4.validateArray)(e))}};function iI(e,t,n=e.schema){let{gen:i,parentSchema:r,data:o,keyword:a,it:s}=e;l(r),s.opts.unevaluated&&n.length&&s.items!==!0&&(s.items=Hd.mergeEvaluated.items(i,n.length,s.items));let c=i.name("valid"),u=i.const("len",(0,nI._)`${o}.length`);n.forEach((d,f)=>{(0,Hd.alwaysValidSchema)(s,d)||(i.if((0,nI._)`${u} > ${f}`,()=>e.subschema({keyword:a,schemaProp:f,dataProp:f},c)),e.ok(c))});function l(d){let{opts:f,errSchemaPath:p}=s,m=n.length,h=m===d.minItems&&(m===d.maxItems||d[t]===!1);if(f.strictTuples&&!h){let y=`"${a}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,Hd.checkStrictMode)(s,y,f.strictTuples)}}}ks.validateTuple=iI;ks.default=q4});var oI=N(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});var F4=ny(),B4={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,F4.validateTuple)(e,"items")};iy.default=B4});var sI=N(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});var aI=Y(),J4=se(),K4=St(),G4=ry(),H4={message:({params:{len:e}})=>(0,aI.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,aI._)`{limit: ${e}}`},W4={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:H4,code(e){let{schema:t,parentSchema:n,it:i}=e,{prefixItems:r}=n;i.items=!0,!(0,J4.alwaysValidSchema)(i,t)&&(r?(0,G4.validateAdditionalItems)(e,r):e.ok((0,K4.validateArray)(e)))}};oy.default=W4});var cI=N(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});var zt=Y(),Wd=se(),X4={message:({params:{min:e,max:t}})=>t===void 0?(0,zt.str)`must contain at least ${e} valid item(s)`:(0,zt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,zt._)`{minContains: ${e}}`:(0,zt._)`{minContains: ${e}, maxContains: ${t}}`},Y4={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:X4,code(e){let{gen:t,schema:n,parentSchema:i,data:r,it:o}=e,a,s,{minContains:c,maxContains:u}=i;o.opts.next?(a=c===void 0?1:c,s=u):a=1;let l=t.const("len",(0,zt._)`${r}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,Wd.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,Wd.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Wd.alwaysValidSchema)(o,n)){let h=(0,zt._)`${l} >= ${a}`;s!==void 0&&(h=(0,zt._)`${h} && ${l} <= ${s}`),e.pass(h);return}o.items=!0;let d=t.name("valid");s===void 0&&a===1?p(d,()=>t.if(d,()=>t.break())):a===0?(t.let(d,!0),s!==void 0&&t.if((0,zt._)`${r}.length > 0`,f)):(t.let(d,!1),f()),e.result(d,()=>e.reset());function f(){let h=t.name("_valid"),y=t.let("count",0);p(h,()=>t.if(h,()=>m(y)))}function p(h,y){t.forRange("i",0,l,$=>{e.subschema({keyword:"contains",dataProp:$,dataPropType:Wd.Type.Num,compositeRule:!0},h),y()})}function m(h){t.code((0,zt._)`${h}++`),s===void 0?t.if((0,zt._)`${h} >= ${a}`,()=>t.assign(d,!0).break()):(t.if((0,zt._)`${h} > ${s}`,()=>t.assign(d,!1).break()),a===1?t.assign(d,!0):t.if((0,zt._)`${h} >= ${a}`,()=>t.assign(d,!0)))}}};ay.default=Y4});var dI=N(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.validateSchemaDeps=Ht.validatePropertyDeps=Ht.error=void 0;var sy=Y(),Q4=se(),ws=St();Ht.error={message:({params:{property:e,depsCount:t,deps:n}})=>{let i=t===1?"property":"properties";return(0,sy.str)`must have ${i} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:i}})=>(0,sy._)`{property: ${e},
7
7
  missingProperty: ${i},
8
8
  depsCount: ${t},
9
- deps: ${n}}`};var e1={keyword:"dependencies",type:"object",schemaType:"object",error:Ht.error,code(e){let[t,n]=t1(e);uI(e,t),lI(e,n)}};function t1({schema:e}){let t={},n={};for(let i in e){if(i==="__proto__")continue;let r=Array.isArray(e[i])?t:n;r[i]=e[i]}return[t,n]}function uI(e,t=e.schema){let{gen:n,data:i,it:r}=e;if(Object.keys(t).length===0)return;let o=n.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let c=(0,ws.propertyInData)(n,i,a,r.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),r.allErrors?n.if(c,()=>{for(let u of s)(0,ws.checkReportMissingProp)(e,u)}):(n.if((0,sy._)`${c} && (${(0,ws.checkMissingProp)(e,s,o)})`),(0,ws.reportMissingProp)(e,o),n.else())}}Ht.validatePropertyDeps=uI;function lI(e,t=e.schema){let{gen:n,data:i,keyword:r,it:o}=e,a=n.name("valid");for(let s in t)(0,Q4.alwaysValidSchema)(o,t[s])||(n.if((0,ws.propertyInData)(n,i,s,o.opts.ownProperties),()=>{let c=e.subschema({keyword:r,schemaProp:s},a);e.mergeValidEvaluated(c,a)},()=>n.var(a,!0)),e.ok(a))}Ht.validateSchemaDeps=lI;Ht.default=e1});var pI=N(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});var fI=Y(),r1=se(),n1={message:"property name must be valid",params:({params:e})=>(0,fI._)`{propertyName: ${e.propertyName}}`},i1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n1,code(e){let{gen:t,schema:n,data:i,it:r}=e;if((0,r1.alwaysValidSchema)(r,n))return;let o=t.name("valid");t.forIn("key",i,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,fI.not)(o),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(o)}};cy.default=i1});var ly=N(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});var Xd=St(),Ut=Y(),o1=dr(),Yd=se(),a1={message:"must NOT have additional properties",params:({params:e})=>(0,Ut._)`{additionalProperty: ${e.additionalProperty}}`},s1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:a1,code(e){let{gen:t,schema:n,parentSchema:i,data:r,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,Yd.alwaysValidSchema)(a,n))return;let u=(0,Xd.allSchemaProperties)(i.properties),l=(0,Xd.allSchemaProperties)(i.patternProperties);d(),e.ok((0,Ut._)`${o} === ${o1.default.errors}`);function d(){t.forIn("key",r,y=>{!u.length&&!l.length?m(y):t.if(f(y),()=>m(y))})}function f(y){let $;if(u.length>8){let w=(0,Yd.schemaRefOrVal)(a,i.properties,"properties");$=(0,Xd.isOwnProperty)(t,w,y)}else u.length?$=(0,Ut.or)(...u.map(w=>(0,Ut._)`${y} === ${w}`)):$=Ut.nil;return l.length&&($=(0,Ut.or)($,...l.map(w=>(0,Ut._)`${(0,Xd.usePattern)(e,w)}.test(${y})`))),(0,Ut.not)($)}function p(y){t.code((0,Ut._)`delete ${r}[${y}]`)}function m(y){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){p(y);return}if(n===!1){e.setParams({additionalProperty:y}),e.error(),s||t.break();return}if(typeof n=="object"&&!(0,Yd.alwaysValidSchema)(a,n)){let $=t.name("valid");c.removeAdditional==="failing"?(h(y,$,!1),t.if((0,Ut.not)($),()=>{e.reset(),p(y)})):(h(y,$),s||t.if((0,Ut.not)($),()=>t.break()))}}function h(y,$,w){let z={keyword:"additionalProperties",dataProp:y,dataPropType:Yd.Type.Str};w===!1&&Object.assign(z,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(z,$)}}};uy.default=s1});var gI=N(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});var c1=ls(),mI=St(),dy=se(),hI=ly(),u1={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,parentSchema:i,data:r,it:o}=e;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&hI.default.code(new c1.KeywordCxt(o,hI.default,"additionalProperties"));let a=(0,mI.allSchemaProperties)(n);for(let d of a)o.definedProperties.add(d);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=dy.mergeEvaluated.props(t,(0,dy.toHash)(a),o.props));let s=a.filter(d=>!(0,dy.alwaysValidSchema)(o,n[d]));if(s.length===0)return;let c=t.name("valid");for(let d of s)u(d)?l(d):(t.if((0,mI.propertyInData)(t,r,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&&n[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};fy.default=u1});var $I=N(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});var vI=St(),Qd=Y(),yI=se(),_I=se(),l1={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,data:i,parentSchema:r,it:o}=e,{opts:a}=o,s=(0,vI.allSchemaProperties)(n),c=s.filter(h=>(0,yI.alwaysValidSchema)(o,n[h]));if(s.length===0||c.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&r.properties,l=t.name("valid");o.props!==!0&&!(o.props instanceof Qd.Name)&&(o.props=(0,_I.evaluatedPropsToName)(t,o.props));let{props:d}=o;f();function f(){for(let h of s)u&&p(h),o.allErrors?m(h):(t.var(l,!0),m(h),t.if(l))}function p(h){for(let y in u)new RegExp(h).test(y)&&(0,yI.checkStrictMode)(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){t.forIn("key",i,y=>{t.if((0,Qd._)`${(0,vI.usePattern)(e,h)}.test(${y})`,()=>{let $=c.includes(h);$||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:_I.Type.Str},l),o.opts.unevaluated&&d!==!0?t.assign((0,Qd._)`${d}[${y}]`,!0):!$&&!o.allErrors&&t.if((0,Qd.not)(l),()=>t.break())})})}}};py.default=l1});var bI=N(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});var d1=se(),f1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:i}=e;if((0,d1.alwaysValidSchema)(i,n)){e.fail();return}let r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};my.default=f1});var xI=N(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});var p1=St(),m1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:p1.validateUnion,error:{message:"must match a schema in anyOf"}};hy.default=m1});var kI=N(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});var ef=Y(),h1=se(),g1={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ef._)`{passingSchemas: ${e.passing}}`},v1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:g1,code(e){let{gen:t,schema:n,parentSchema:i,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&i.discriminator)return;let o=n,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 f;(0,h1.alwaysValidSchema)(r,l)?t.var(c,!0):f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,ef._)`${c} && ${a}`).assign(a,!1).assign(s,(0,ef._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),f&&e.mergeEvaluated(f,ef.Name)})})}}};gy.default=v1});var wI=N(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});var y1=se(),_1={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:n,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");let r=t.name("valid");n.forEach((o,a)=>{if((0,y1.alwaysValidSchema)(i,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},r);e.ok(r),e.mergeEvaluated(s)})}};vy.default=_1});var zI=N(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});var tf=Y(),II=se(),$1={message:({params:e})=>(0,tf.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,tf._)`{failingKeyword: ${e.ifClause}}`},b1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:$1,code(e){let{gen:t,parentSchema:n,it:i}=e;n.then===void 0&&n.else===void 0&&(0,II.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=SI(i,"then"),o=SI(i,"else");if(!r&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),r&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(s,u("then",l),u("else",l))}else r?t.if(s,u("then")):t.if((0,tf.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 f=e.subschema({keyword:l},s);t.assign(a,s),e.mergeValidEvaluated(f,a),d?t.assign(d,(0,tf._)`${l}`):e.setParams({ifClause:l})}}}};function SI(e,t){let n=e.schema[t];return n!==void 0&&!(0,II.alwaysValidSchema)(e,n)}yy.default=b1});var PI=N(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});var x1=se(),k1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,x1.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};_y.default=k1});var TI=N($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});var w1=ry(),S1=oI(),I1=ny(),z1=sI(),P1=cI(),T1=dI(),O1=pI(),E1=ly(),N1=gI(),j1=$I(),A1=bI(),D1=xI(),R1=kI(),C1=wI(),U1=zI(),Z1=PI();function M1(e=!1){let t=[A1.default,D1.default,R1.default,C1.default,U1.default,Z1.default,O1.default,E1.default,T1.default,N1.default,j1.default];return e?t.push(S1.default,z1.default):t.push(w1.default,I1.default),t.push(P1.default),t}$y.default=M1});var OI=N(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var Oe=Y(),L1={message:({schemaCode:e})=>(0,Oe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Oe._)`{format: ${e}}`},V1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:L1,code(e,t){let{gen:n,data:i,$data:r,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=s;if(!c.validateFormats)return;r?f():p();function f(){let m=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=n.const("fDef",(0,Oe._)`${m}[${a}]`),y=n.let("fType"),$=n.let("format");n.if((0,Oe._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>n.assign(y,(0,Oe._)`${h}.type || "string"`).assign($,(0,Oe._)`${h}.validate`),()=>n.assign(y,(0,Oe._)`"string"`).assign($,h)),e.fail$data((0,Oe.or)(w(),z()));function w(){return c.strictSchema===!1?Oe.nil:(0,Oe._)`${a} && !${$}`}function z(){let D=l.$async?(0,Oe._)`(${h}.async ? await ${$}(${i}) : ${$}(${i}))`:(0,Oe._)`${$}(${i})`,E=(0,Oe._)`(typeof ${$} == "function" ? ${D} : ${$}.test(${i}))`;return(0,Oe._)`${$} && ${$} !== true && ${y} === ${t} && !${E}`}}function p(){let m=d.formats[o];if(!m){w();return}if(m===!0)return;let[h,y,$]=z(m);h===t&&e.pass(D());function w(){if(c.strictSchema===!1){d.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function z(E){let K=E instanceof RegExp?(0,Oe.regexpCode)(E):c.code.formats?(0,Oe._)`${c.code.formats}${(0,Oe.getProperty)(o)}`:void 0,ke=n.scopeValue("formats",{key:o,ref:E,code:K});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Oe._)`${ke}.validate`]:["string",E,ke]}function D(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Oe._)`await ${$}(${i})`}return typeof y=="function"?(0,Oe._)`${$}(${i})`:(0,Oe._)`${$}.test(${i})`}}}};by.default=V1});var EI=N(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});var q1=OI(),F1=[q1.default];xy.default=F1});var NI=N(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.contentVocabulary=no.metadataVocabulary=void 0;no.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];no.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var AI=N(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});var B1=LS(),J1=tI(),K1=TI(),G1=EI(),jI=NI(),H1=[B1.default,J1.default,(0,K1.default)(),G1.default,jI.metadataVocabulary,jI.contentVocabulary];ky.default=H1});var RI=N(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.DiscrError=void 0;var DI;(function(e){e.Tag="tag",e.Mapping="mapping"})(DI||(rf.DiscrError=DI={}))});var UI=N(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});var io=Y(),wy=RI(),CI=Zd(),W1=ds(),X1=se(),Y1={message:({params:{discrError:e,tagName:t}})=>e===wy.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,io._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},Q1={keyword:"discriminator",type:"object",schemaType:"object",error:Y1,code(e){let{gen:t,data:n,schema:i,parentSchema:r,it:o}=e,{oneOf:a}=r;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=i.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(i.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,io._)`${n}${(0,io.getProperty)(s)}`);t.if((0,io._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:wy.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function l(){let p=f();t.if(!1);for(let m in p)t.elseIf((0,io._)`${u} === ${m}`),t.assign(c,d(p[m]));t.else(),e.error(!1,{discrError:wy.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function d(p){let m=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:p},m);return e.mergeEvaluated(h,io.Name),m}function f(){var p;let m={},h=$(r),y=!0;for(let D=0;D<a.length;D++){let E=a[D];if(E?.$ref&&!(0,X1.schemaHasRulesButRef)(E,o.self.RULES)){let ke=E.$ref;if(E=CI.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ke),E instanceof CI.SchemaEnv&&(E=E.schema),E===void 0)throw new W1.default(o.opts.uriResolver,o.baseId,ke)}let K=(p=E?.properties)===null||p===void 0?void 0:p[s];if(typeof K!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);y=y&&(h||$(E)),w(K,D)}if(!y)throw new Error(`discriminator: "${s}" must be required`);return m;function $({required:D}){return Array.isArray(D)&&D.includes(s)}function w(D,E){if(D.const)z(D.const,E);else if(D.enum)for(let K of D.enum)z(K,E);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function z(D,E){if(typeof D!="string"||D in m)throw new Error(`discriminator: "${s}" values must be unique strings`);m[D]=E}}}};Sy.default=Q1});var ZI=N((q9,eC)=>{eC.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 zy=N((Se,Iy)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.MissingRefError=Se.ValidationError=Se.CodeGen=Se.Name=Se.nil=Se.stringify=Se.str=Se._=Se.KeywordCxt=Se.Ajv=void 0;var tC=DS(),rC=AI(),nC=UI(),MI=ZI(),iC=["/properties"],nf="http://json-schema.org/draft-07/schema",oo=class extends tC.default{_addVocabularies(){super._addVocabularies(),rC.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(nC.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(MI,iC):MI;this.addMetaSchema(t,nf,!1),this.refs["http://json-schema.org/schema"]=nf}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(nf)?nf:void 0)}};Se.Ajv=oo;Iy.exports=Se=oo;Iy.exports.Ajv=oo;Object.defineProperty(Se,"__esModule",{value:!0});Se.default=oo;var oC=ls();Object.defineProperty(Se,"KeywordCxt",{enumerable:!0,get:function(){return oC.KeywordCxt}});var ao=Y();Object.defineProperty(Se,"_",{enumerable:!0,get:function(){return ao._}});Object.defineProperty(Se,"str",{enumerable:!0,get:function(){return ao.str}});Object.defineProperty(Se,"stringify",{enumerable:!0,get:function(){return ao.stringify}});Object.defineProperty(Se,"nil",{enumerable:!0,get:function(){return ao.nil}});Object.defineProperty(Se,"Name",{enumerable:!0,get:function(){return ao.Name}});Object.defineProperty(Se,"CodeGen",{enumerable:!0,get:function(){return ao.CodeGen}});var aC=Cd();Object.defineProperty(Se,"ValidationError",{enumerable:!0,get:function(){return aC.default}});var sC=ds();Object.defineProperty(Se,"MissingRefError",{enumerable:!0,get:function(){return sC.default}})});var GI=N(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.formatNames=Xt.fastFormats=Xt.fullFormats=void 0;function Wt(e,t){return{validate:e,compare:t}}Xt.fullFormats={date:Wt(FI,Ey),time:Wt(Ty(!0),Ny),"date-time":Wt(LI(!0),JI),"iso-time":Wt(Ty(),BI),"iso-date-time":Wt(LI(),KI),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:pC,"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:$C,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:mC,int32:{type:"number",validate:vC},int64:{type:"number",validate:yC},float:{type:"number",validate:qI},double:{type:"number",validate:qI},password:!0,binary:!0};Xt.fastFormats={...Xt.fullFormats,date:Wt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ey),time:Wt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ny),"date-time":Wt(/^\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,JI),"iso-time":Wt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,BI),"iso-date-time":Wt(/^\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,KI),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 cC(e){return e%4===0&&(e%100!==0||e%400===0)}var uC=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,lC=[0,31,28,31,30,31,30,31,31,30,31,30,31];function FI(e){let t=uC.exec(e);if(!t)return!1;let n=+t[1],i=+t[2],r=+t[3];return i>=1&&i<=12&&r>=1&&r<=(i===2&&cC(n)?29:lC[i])}function Ey(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Py=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Ty(e){return function(n){let i=Py.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],a=+i[3],s=i[4],c=i[5]==="-"?-1:1,u=+(i[6]||0),l=+(i[7]||0);if(u>23||l>59||e&&!s)return!1;if(r<=23&&o<=59&&a<60)return!0;let d=o-l*c,f=r-u*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function Ny(e,t){if(!(e&&t))return;let n=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(n&&i)return n-i}function BI(e,t){if(!(e&&t))return;let n=Py.exec(e),i=Py.exec(t);if(n&&i)return e=n[1]+n[2]+n[3],t=i[1]+i[2]+i[3],e>t?1:e<t?-1:0}var Oy=/t|\s/i;function LI(e){let t=Ty(e);return function(i){let r=i.split(Oy);return r.length===2&&FI(r[0])&&t(r[1])}}function JI(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),i=new Date(t).valueOf();if(n&&i)return n-i}function KI(e,t){if(!(e&&t))return;let[n,i]=e.split(Oy),[r,o]=t.split(Oy),a=Ey(n,r);if(a!==void 0)return a||Ny(i,o)}var dC=/\/|:/,fC=/^(?:[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 pC(e){return dC.test(e)&&fC.test(e)}var VI=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function mC(e){return VI.lastIndex=0,VI.test(e)}var hC=-(2**31),gC=2**31-1;function vC(e){return Number.isInteger(e)&&e<=gC&&e>=hC}function yC(e){return Number.isInteger(e)}function qI(){return!0}var _C=/[^\\]\\Z/;function $C(e){if(_C.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var HI=N(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.formatLimitDefinition=void 0;var bC=zy(),Zt=Y(),Lr=Zt.operators,of={formatMaximum:{okStr:"<=",ok:Lr.LTE,fail:Lr.GT},formatMinimum:{okStr:">=",ok:Lr.GTE,fail:Lr.LT},formatExclusiveMaximum:{okStr:"<",ok:Lr.LT,fail:Lr.GTE},formatExclusiveMinimum:{okStr:">",ok:Lr.GT,fail:Lr.LTE}},xC={message:({keyword:e,schemaCode:t})=>(0,Zt.str)`should be ${of[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Zt._)`{comparison: ${of[e].okStr}, limit: ${t}}`};so.formatLimitDefinition={keyword:Object.keys(of),type:"string",schemaType:"string",$data:!0,error:xC,code(e){let{gen:t,data:n,schemaCode:i,keyword:r,it:o}=e,{opts:a,self:s}=o;if(!a.validateFormats)return;let c=new bC.KeywordCxt(o,s.RULES.all.format.definition,"format");c.$data?u():l();function u(){let f=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),p=t.const("fmt",(0,Zt._)`${f}[${c.schemaCode}]`);e.fail$data((0,Zt.or)((0,Zt._)`typeof ${p} != "object"`,(0,Zt._)`${p} instanceof RegExp`,(0,Zt._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let f=c.schema,p=s.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${r}": format "${f}" does not define "compare" function`);let m=t.scopeValue("formats",{key:f,ref:p,code:a.code.formats?(0,Zt._)`${a.code.formats}${(0,Zt.getProperty)(f)}`:void 0});e.fail$data(d(m))}function d(f){return(0,Zt._)`${f}.compare(${n}, ${i}) ${of[r].fail} 0`}},dependencies:["format"]};var kC=e=>(e.addKeyword(so.formatLimitDefinition),e);so.default=kC});var QI=N((Ss,YI)=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});var co=GI(),wC=HI(),jy=Y(),WI=new jy.Name("fullFormats"),SC=new jy.Name("fastFormats"),Ay=(e,t={keywords:!0})=>{if(Array.isArray(t))return XI(e,t,co.fullFormats,WI),e;let[n,i]=t.mode==="fast"?[co.fastFormats,SC]:[co.fullFormats,WI],r=t.formats||co.formatNames;return XI(e,r,n,i),t.keywords&&(0,wC.default)(e),e};Ay.get=(e,t="full")=>{let i=(t==="fast"?co.fastFormats:co.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function XI(e,t,n,i){var r,o;(r=(o=e.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,jy._)`require("ajv-formats/dist/formats").${i}`);for(let a of t)e.addFormat(a,n[a])}YI.exports=Ss=Ay;Object.defineProperty(Ss,"__esModule",{value:!0});Ss.default=Ay});import{randomUUID as bU}from"crypto";import fo from"process";var ie;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let o={};for(let a of r)o[a]=a;return o},e.getValidEnumValues=r=>{let o=e.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(let s of o)a[s]=r[s];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(o){return r[o]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},e.find=(r,o)=>{for(let a of r)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ie||(ie={}));var Yy;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Yy||(Yy={}));var A=ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tr=e=>{switch(typeof e){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(e)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(e)?A.array:e===null?A.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?A.promise:typeof Map<"u"&&e instanceof Map?A.map:typeof Set<"u"&&e instanceof Set?A.set:typeof Date<"u"&&e instanceof Date?A.date:A.object;default:return A.unknown}};var S=ie.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 ft=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let s=i,c=0;for(;c<a.path.length;){let u=a.path[c],l=c===a.path.length-1;if(u==="_errors"){l&&s._errors.push(n(a)),c++;continue}Object.prototype.hasOwnProperty.call(s,u)||(u==="__proto__"?Object.defineProperty(s,u,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):s[u]={_errors:[]}),s=s[u],l&&s._errors.push(n(a)),c++}}};return r(this),i}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,ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};ft.create=e=>new ft(e);var Lz=(e,t)=>{let n;switch(e.code){case S.invalid_type:e.received===A.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case S.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ie.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:n=`Unrecognized key(s) in object: ${ie.joinValues(e.keys,", ")}`;break;case S.invalid_union:n="Invalid input";break;case S.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ie.joinValues(e.options)}`;break;case S.invalid_enum_value:n=`Invalid enum value. Expected ${ie.joinValues(e.options)}, received '${e.received}'`;break;case S.invalid_arguments:n="Invalid function arguments";break;case S.invalid_return_type:n="Invalid function return type";break;case S.invalid_date:n="Invalid date";break;case S.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ie.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case S.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case S.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case S.custom:n="Invalid input";break;case S.invalid_intersection_types:n="Intersection results could not be merged";break;case S.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case S.not_finite:n="Number must be finite";break;default:n=t.defaultError,ie.assertNever(e)}return{message:n}},pr=Lz;var Vz=pr;function po(){return Vz}var Us=e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,o=[...n,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",c=i.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...r,path:o,message:s}};function T(e,t){let n=po(),i=Us({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===pr?void 0:pr].filter(r=>!!r)});e.common.issues.push(i)}var qe=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return V;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let o=await r.key,a=await r.value;i.push({key:o,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return V;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}},V=Object.freeze({status:"aborted"}),zn=e=>({status:"dirty",value:e}),Ge=e=>({status:"valid",value:e}),$f=e=>e.status==="aborted",bf=e=>e.status==="dirty",Fr=e=>e.status==="valid",mo=e=>typeof Promise<"u"&&e instanceof Promise;var C;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(C||(C={}));var yt=class{constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}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}},Qy=(e,t)=>{if(Fr(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 n=new ft(e.common.issues);return this._error=n,this._error}}};function G(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??n??s.defaultError}},description:r}}var Q=class{get description(){return this._def.description}_getType(t){return tr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:tr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qe,ctx:{common:t.parent.common,data:t.data,parsedType:tr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(mo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return Qy(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return Fr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>Fr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tr(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(mo(r)?r:Promise.resolve(r));return Qy(i,o)}refine(t,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let a=t(r),s=()=>o.addIssue({code:S.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Tt({schema:this,typeName:P.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:n=>this["~validate"](n)}}optional(){return Pt.create(this,this._def)}nullable(){return ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hr.create(this)}promise(){return Br.create(this,this._def)}or(t){return Nn.create([this,t],this._def)}and(t){return jn.create(this,t,this._def)}transform(t){return new Tt({...G(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Un({...G(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new Zs({typeName:P.ZodBranded,type:this,...G(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Zn({...G(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Ms.create(this,t)}readonly(){return Mn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},qz=/^c[^\s-]{8,}$/i,Fz=/^[0-9a-z]+$/,Bz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Jz=/^[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,Kz=/^[a-z0-9_-]{21}$/i,Gz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hz=/^[-+]?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)?)??$/,Wz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xz="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",xf,Yz=/^(?:(?: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])$/,Qz=/^(?:(?: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])$/,e0=/^(([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]))$/,t0=/^(([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])$/,r0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,n0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,e_="((\\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])))",i0=new RegExp(`^${e_}$`);function t_(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function o0(e){return new RegExp(`^${t_(e)}$`)}function a0(e){let t=`${e_}T${t_(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function s0(e,t){return!!((t==="v4"||!t)&&Yz.test(e)||(t==="v6"||!t)&&e0.test(e))}function c0(e,t){if(!Gz.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function u0(e,t){return!!((t==="v4"||!t)&&Qz.test(e)||(t==="v6"||!t)&&t0.test(e))}var Tn=class e extends Q{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==A.string){let o=this._getOrReturnCtx(t);return T(o,{code:S.invalid_type,expected:A.string,received:o.parsedType}),V}let i=new qe,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),T(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(r=this._getOrReturnCtx(t,r),T(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(t,r),a?T(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&T(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")Wz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"email",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")xf||(xf=new RegExp(Xz,"u")),xf.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"emoji",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")Jz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"uuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")Kz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"nanoid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")qz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"cuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")Fz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"cuid2",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")Bz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"ulid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),T(r,{validation:"url",code:S.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"regex",code:S.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.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)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?a0(o).test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?i0.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?o0(o).test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?Hz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"duration",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?s0(t.data,o.version)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"ip",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?c0(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"jwt",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?u0(t.data,o.version)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"cidr",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?r0.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"base64",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?n0.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"base64url",code:S.invalid_string,message:o.message}),i.dirty()):ie.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:S.invalid_string,...C.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...C.errToObj(t)})}url(t){return this._addCheck({kind:"url",...C.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...C.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...C.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...C.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...C.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...C.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...C.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...C.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...C.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...C.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...C.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...C.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,...C.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,...C.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...C.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...C.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...C.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...C.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...C.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...C.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...C.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...C.errToObj(n)})}nonempty(t){return this.min(1,C.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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Tn.create=e=>new Tn({checks:[],typeName:P.ZodString,coerce:e?.coerce??!1,...G(e)});function l0(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return o%a/10**r}var ho=class e extends Q{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)!==A.number){let o=this._getOrReturnCtx(t);return T(o,{code:S.invalid_type,expected:A.number,received:o.parsedType}),V}let i,r=new qe;for(let o of this._def.checks)o.kind==="int"?ie.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),T(i,{code:S.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?l0(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),T(i,{code:S.not_finite,message:o.message}),r.dirty()):ie.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,C.toString(n))}gt(t,n){return this.setLimit("min",t,!1,C.toString(n))}lte(t,n){return this.setLimit("max",t,!0,C.toString(n))}lt(t,n){return this.setLimit("max",t,!1,C.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:C.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:C.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:C.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:C.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ie.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ho.create=e=>new ho({checks:[],typeName:P.ZodNumber,coerce:e?.coerce||!1,...G(e)});var go=class e extends Q{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)!==A.bigint)return this._getInvalidInput(t);let i,r=new qe;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ie.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return T(n,{code:S.invalid_type,expected:A.bigint,received:n.parsedType}),V}gte(t,n){return this.setLimit("min",t,!0,C.toString(n))}gt(t,n){return this.setLimit("min",t,!1,C.toString(n))}lte(t,n){return this.setLimit("max",t,!0,C.toString(n))}lt(t,n){return this.setLimit("max",t,!1,C.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:C.toString(r)}]})}_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:C.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:C.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};go.create=e=>new go({checks:[],typeName:P.ZodBigInt,coerce:e?.coerce??!1,...G(e)});var vo=class extends Q{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==A.boolean){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.boolean,received:i.parsedType}),V}return Ge(t.data)}};vo.create=e=>new vo({typeName:P.ZodBoolean,coerce:e?.coerce||!1,...G(e)});var yo=class e extends Q{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==A.date){let o=this._getOrReturnCtx(t);return T(o,{code:S.invalid_type,expected:A.date,received:o.parsedType}),V}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return T(o,{code:S.invalid_date}),V}let i=new qe,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),T(r,{code:S.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(r=this._getOrReturnCtx(t,r),T(r,{code:S.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ie.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:C.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:C.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};yo.create=e=>new yo({checks:[],coerce:e?.coerce||!1,typeName:P.ZodDate,...G(e)});var _o=class extends Q{_parse(t){if(this._getType(t)!==A.symbol){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.symbol,received:i.parsedType}),V}return Ge(t.data)}};_o.create=e=>new _o({typeName:P.ZodSymbol,...G(e)});var On=class extends Q{_parse(t){if(this._getType(t)!==A.undefined){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.undefined,received:i.parsedType}),V}return Ge(t.data)}};On.create=e=>new On({typeName:P.ZodUndefined,...G(e)});var En=class extends Q{_parse(t){if(this._getType(t)!==A.null){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.null,received:i.parsedType}),V}return Ge(t.data)}};En.create=e=>new En({typeName:P.ZodNull,...G(e)});var $o=class extends Q{constructor(){super(...arguments),this._any=!0}_parse(t){return Ge(t.data)}};$o.create=e=>new $o({typeName:P.ZodAny,...G(e)});var mr=class extends Q{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ge(t.data)}};mr.create=e=>new mr({typeName:P.ZodUnknown,...G(e)});var Mt=class extends Q{_parse(t){let n=this._getOrReturnCtx(t);return T(n,{code:S.invalid_type,expected:A.never,received:n.parsedType}),V}};Mt.create=e=>new Mt({typeName:P.ZodNever,...G(e)});var bo=class extends Q{_parse(t){if(this._getType(t)!==A.undefined){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.void,received:i.parsedType}),V}return Ge(t.data)}};bo.create=e=>new bo({typeName:P.ZodVoid,...G(e)});var hr=class e extends Q{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==A.array)return T(n,{code:S.invalid_type,expected:A.array,received:n.parsedType}),V;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(T(n,{code:a?S.too_big:S.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(T(n,{code:S.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(T(n,{code:S.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>r.type._parseAsync(new yt(n,a,n.path,s)))).then(a=>qe.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new yt(n,a,n.path,s)));return qe.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:C.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:C.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:C.toString(n)}})}nonempty(t){return this.min(1,t)}};hr.create=(e,t)=>new hr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...G(t)});function Pn(e){if(e instanceof pt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Pt.create(Pn(i))}return new pt({...e._def,shape:()=>t})}else return e instanceof hr?new hr({...e._def,type:Pn(e.element)}):e instanceof Pt?Pt.create(Pn(e.unwrap())):e instanceof ir?ir.create(Pn(e.unwrap())):e instanceof nr?nr.create(e.items.map(t=>Pn(t))):e}var pt=class e extends Q{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(),n=ie.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==A.object){let u=this._getOrReturnCtx(t);return T(u,{code:S.invalid_type,expected:A.object,received:u.parsedType}),V}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Mt&&this._def.unknownKeys==="strip"))for(let u in r.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let l=o[u],d=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new yt(r,d,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Mt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(u==="strict")s.length>0&&(T(r,{code:S.unrecognized_keys,keys:s}),i.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=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new yt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>qe.mergeObjectSync(i,u)):qe.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return C.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:C.errToObj(t).message??r}:{message:r}}}:{}})}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:P.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of ie.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let i of ie.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return Pn(this)}partial(t){let n={};for(let i of ie.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let i of ie.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Pt;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return r_(ie.objectKeys(this.shape))}};pt.create=(e,t)=>new pt({shape:()=>e,unknownKeys:"strip",catchall:Mt.create(),typeName:P.ZodObject,...G(t)});pt.strictCreate=(e,t)=>new pt({shape:()=>e,unknownKeys:"strict",catchall:Mt.create(),typeName:P.ZodObject,...G(t)});pt.lazycreate=(e,t)=>new pt({shape:e,unknownKeys:"strip",catchall:Mt.create(),typeName:P.ZodObject,...G(t)});var Nn=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(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 n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new ft(s.ctx.common.issues));return T(n,{code:S.invalid_union,unionErrors:a}),V}if(n.common.async)return Promise.all(i.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let o,a=[];for(let c of i){let u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.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 n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(c=>new ft(c));return T(n,{code:S.invalid_union,unionErrors:s}),V}}get options(){return this._def.options}};Nn.create=(e,t)=>new Nn({options:e,typeName:P.ZodUnion,...G(t)});var rr=e=>e instanceof An?rr(e.schema):e instanceof Tt?rr(e.innerType()):e instanceof Dn?[e.value]:e instanceof Rn?e.options:e instanceof Cn?ie.objectValues(e.enum):e instanceof Un?rr(e._def.innerType):e instanceof On?[void 0]:e instanceof En?[null]:e instanceof Pt?[void 0,...rr(e.unwrap())]:e instanceof ir?[null,...rr(e.unwrap())]:e instanceof Zs||e instanceof Mn?rr(e.unwrap()):e instanceof Zn?rr(e._def.innerType):[],kf=class e extends Q{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.object)return T(n,{code:S.invalid_type,expected:A.object,received:n.parsedType}),V;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(T(n,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let a=rr(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(r.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);r.set(s,o)}}return new e({typeName:P.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...G(i)})}};function wf(e,t){let n=tr(e),i=tr(t);if(e===t)return{valid:!0,data:e};if(n===A.object&&i===A.object){let r=ie.objectKeys(t),o=ie.objectKeys(e).filter(s=>r.indexOf(s)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let s of o){if(s==="__proto__")continue;let c=wf(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(n===A.array&&i===A.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],c=wf(a,s);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===A.date&&i===A.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var jn=class extends Q{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,a)=>{if($f(o)||$f(a))return V;let s=wf(o.value,a.value);return s.valid?((bf(o)||bf(a))&&n.dirty(),{status:n.value,value:s.data}):(T(i,{code:S.invalid_intersection_types}),V)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};jn.create=(e,t,n)=>new jn({left:e,right:t,typeName:P.ZodIntersection,...G(n)});var nr=class e extends Q{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==A.array)return T(i,{code:S.invalid_type,expected:A.array,received:i.parsedType}),V;if(i.data.length<this._def.items.length)return T(i,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&i.data.length>this._def.items.length&&(T(i,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new yt(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>qe.mergeArray(n,a)):qe.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};nr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nr({items:e,typeName:P.ZodTuple,rest:null,...G(t)})};var Sf=class e extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==A.object)return T(i,{code:S.invalid_type,expected:A.object,received:i.parsedType}),V;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new yt(i,s,i.path,s)),value:a._parse(new yt(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?qe.mergeObjectAsync(n,r):qe.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof Q?new e({keyType:t,valueType:n,typeName:P.ZodRecord,...G(i)}):new e({keyType:Tn.create(),valueType:t,typeName:P.ZodRecord,...G(n)})}},xo=class extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==A.map)return T(i,{code:S.invalid_type,expected:A.map,received:i.parsedType}),V;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,c],u)=>({key:r._parse(new yt(i,s,i.path,[u,"key"])),value:o._parse(new yt(i,c,i.path,[u,"value"]))}));if(i.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 V;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(u.value,l.value)}return{status:n.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 V;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(u.value,l.value)}return{status:n.value,value:s}}}};xo.create=(e,t,n)=>new xo({valueType:t,keyType:e,typeName:P.ZodMap,...G(n)});var ko=class e extends Q{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==A.set)return T(i,{code:S.invalid_type,expected:A.set,received:i.parsedType}),V;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(T(i,{code:S.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(T(i,{code:S.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function a(c){let u=new Set;for(let l of c){if(l.status==="aborted")return V;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}let s=[...i.data.values()].map((c,u)=>o._parse(new yt(i,c,i.path,u)));return i.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:C.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:C.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ko.create=(e,t)=>new ko({valueType:e,minSize:null,maxSize:null,typeName:P.ZodSet,...G(t)});var If=class e extends Q{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.function)return T(n,{code:S.invalid_type,expected:A.function,received:n.parsedType}),V;function i(s,c){return Us({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,po(),pr].filter(u=>!!u),issueData:{code:S.invalid_arguments,argumentsError:c}})}function r(s,c){return Us({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,po(),pr].filter(u=>!!u),issueData:{code:S.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Br){let s=this;return Ge(async function(...c){let u=new ft([]),l=await s._def.args.parseAsync(c,o).catch(p=>{throw u.addIssue(i(c,p)),u}),d=await Reflect.apply(a,this,l);return await s._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(r(d,p)),u})})}else{let s=this;return Ge(function(...c){let u=s._def.args.safeParse(c,o);if(!u.success)throw new ft([i(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(l,o);if(!d.success)throw new ft([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:nr.create(t).rest(mr.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,n,i){return new e({args:t||nr.create([]).rest(mr.create()),returns:n||mr.create(),typeName:P.ZodFunction,...G(i)})}},An=class extends Q{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};An.create=(e,t)=>new An({getter:e,typeName:P.ZodLazy,...G(t)});var Dn=class extends Q{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return T(n,{received:n.data,code:S.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}};Dn.create=(e,t)=>new Dn({value:e,typeName:P.ZodLiteral,...G(t)});function r_(e,t){return new Rn({values:e,typeName:P.ZodEnum,...G(t)})}var Rn=class e extends Q{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return T(n,{expected:ie.joinValues(i),received:n.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return T(n,{received:n.data,code:S.invalid_enum_value,options:i}),V}return Ge(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Rn.create=r_;var Cn=class extends Q{_parse(t){let n=ie.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==A.string&&i.parsedType!==A.number){let r=ie.objectValues(n);return T(i,{expected:ie.joinValues(r),received:i.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(ie.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=ie.objectValues(n);return T(i,{received:i.data,code:S.invalid_enum_value,options:r}),V}return Ge(t.data)}get enum(){return this._def.values}};Cn.create=(e,t)=>new Cn({values:e,typeName:P.ZodNativeEnum,...G(t)});var Br=class extends Q{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.promise&&n.common.async===!1)return T(n,{code:S.invalid_type,expected:A.promise,received:n.parsedType}),V;let i=n.parsedType===A.promise?n.data:Promise.resolve(n.data);return Ge(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Br.create=(e,t)=>new Br({type:e,typeName:P.ZodPromise,...G(t)});var Tt=class extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,o={addIssue:a=>{T(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let a=r.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return V;let c=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return c.status==="aborted"?V:c.status==="dirty"?zn(c.value):n.value==="dirty"?zn(c.value):c});{if(n.value==="aborted")return V;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?V:s.status==="dirty"?zn(s.value):n.value==="dirty"?zn(s.value):s}}if(r.type==="refinement"){let a=s=>{let c=r.refinement(s,o);if(i.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(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?V:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?V:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Fr(a))return V;let s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Fr(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):V);ie.assertNever(r)}};Tt.create=(e,t,n)=>new Tt({schema:e,typeName:P.ZodEffects,effect:t,...G(n)});Tt.createWithPreprocess=(e,t,n)=>new Tt({schema:t,effect:{type:"preprocess",transform:e},typeName:P.ZodEffects,...G(n)});var Pt=class extends Q{_parse(t){return this._getType(t)===A.undefined?Ge(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pt.create=(e,t)=>new Pt({innerType:e,typeName:P.ZodOptional,...G(t)});var ir=class extends Q{_parse(t){return this._getType(t)===A.null?Ge(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ir.create=(e,t)=>new ir({innerType:e,typeName:P.ZodNullable,...G(t)});var Un=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===A.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Un.create=(e,t)=>new Un({innerType:e,typeName:P.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...G(t)});var Zn=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return mo(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Zn.create=(e,t)=>new Zn({innerType:e,typeName:P.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...G(t)});var wo=class extends Q{_parse(t){if(this._getType(t)!==A.nan){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.nan,received:i.parsedType}),V}return{status:"valid",value:t.data}}};wo.create=e=>new wo({typeName:P.ZodNaN,...G(e)});var Zs=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Ms=class e extends Q{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?V:o.status==="dirty"?(n.dirty(),zn(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?V:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:P.ZodPipeline})}},Mn=class extends Q{_parse(t){let n=this._def.innerType._parse(t),i=r=>(Fr(r)&&(r.value=Object.freeze(r.value)),r);return mo(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Mn.create=(e,t)=>new Mn({innerType:e,typeName:P.ZodReadonly,...G(t)});var LU={object:pt.lazycreate},P;(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"})(P||(P={}));var VU=Tn.create,qU=ho.create,FU=wo.create,BU=go.create,JU=vo.create,KU=yo.create,GU=_o.create,HU=On.create,WU=En.create,XU=$o.create,YU=mr.create,QU=Mt.create,e6=bo.create,t6=hr.create,n_=pt.create,r6=pt.strictCreate,n6=Nn.create,i6=kf.create,o6=jn.create,a6=nr.create,s6=Sf.create,c6=xo.create,u6=ko.create,l6=If.create,d6=An.create,f6=Dn.create,p6=Rn.create,m6=Cn.create,h6=Br.create,g6=Tt.create,v6=Pt.create,y6=ir.create,_6=Tt.createWithPreprocess,$6=Ms.create;var Nt={};er(Nt,{$ZodAny:()=>Gc,$ZodArray:()=>Qc,$ZodAsyncError:()=>ot,$ZodBase64:()=>Nc,$ZodBase64URL:()=>Ac,$ZodBigInt:()=>Jo,$ZodBigIntFormat:()=>Fc,$ZodBoolean:()=>oi,$ZodCIDRv4:()=>Pc,$ZodCIDRv6:()=>Oc,$ZodCUID:()=>$c,$ZodCUID2:()=>bc,$ZodCatch:()=>vu,$ZodCheck:()=>he,$ZodCheckBigIntFormat:()=>Np,$ZodCheckEndsWith:()=>Fp,$ZodCheckGreaterThan:()=>oc,$ZodCheckIncludes:()=>Vp,$ZodCheckLengthEquals:()=>Up,$ZodCheckLessThan:()=>ic,$ZodCheckLowerCase:()=>Mp,$ZodCheckMaxLength:()=>Rp,$ZodCheckMaxSize:()=>jp,$ZodCheckMimeType:()=>Kp,$ZodCheckMinLength:()=>Cp,$ZodCheckMinSize:()=>Ap,$ZodCheckMultipleOf:()=>Op,$ZodCheckNumberFormat:()=>Ep,$ZodCheckOverwrite:()=>Gp,$ZodCheckProperties:()=>Jp,$ZodCheckProperty:()=>Bp,$ZodCheckRegex:()=>Zp,$ZodCheckSizeEquals:()=>Dp,$ZodCheckStartsWith:()=>qp,$ZodCheckStringFormat:()=>ni,$ZodCheckUpperCase:()=>Lp,$ZodCodec:()=>si,$ZodCreditCard:()=>Cc,$ZodCustom:()=>ku,$ZodCustomStringFormat:()=>Vc,$ZodCyclicError:()=>zu,$ZodDate:()=>Yc,$ZodDefault:()=>pu,$ZodDiscriminatedUnion:()=>ru,$ZodE164:()=>Dc,$ZodEmail:()=>pc,$ZodEmoji:()=>yc,$ZodEncodeError:()=>vr,$ZodEnum:()=>su,$ZodError:()=>Ff,$ZodExactOptional:()=>du,$ZodFile:()=>uu,$ZodFunction:()=>bu,$ZodGUID:()=>dc,$ZodIBAN:()=>Zc,$ZodIPv4:()=>Sc,$ZodIPv6:()=>Ic,$ZodISODate:()=>em,$ZodISODateTime:()=>Qp,$ZodISODuration:()=>rm,$ZodISOTime:()=>tm,$ZodIntersection:()=>nu,$ZodJWT:()=>Lc,$ZodKSUID:()=>wc,$ZodLazy:()=>ci,$ZodLiteral:()=>cu,$ZodMAC:()=>zc,$ZodMap:()=>ou,$ZodNaN:()=>yu,$ZodNanoID:()=>_c,$ZodNever:()=>Wc,$ZodNonOptional:()=>hu,$ZodNull:()=>Kc,$ZodNullable:()=>fu,$ZodNumber:()=>Bo,$ZodNumberFormat:()=>qc,$ZodObject:()=>eu,$ZodObjectJIT:()=>im,$ZodOptional:()=>Go,$ZodPipe:()=>Ho,$ZodPrefault:()=>mu,$ZodPreprocess:()=>am,$ZodPromise:()=>xu,$ZodReadonly:()=>_u,$ZodRealError:()=>at,$ZodRecord:()=>iu,$ZodRegistry:()=>ju,$ZodSet:()=>au,$ZodString:()=>yr,$ZodStringFormat:()=>fe,$ZodSuccess:()=>gu,$ZodSymbol:()=>Bc,$ZodTemplateLiteral:()=>$u,$ZodTransform:()=>lu,$ZodTuple:()=>Ko,$ZodType:()=>B,$ZodULID:()=>xc,$ZodURL:()=>vc,$ZodUUID:()=>fc,$ZodUndefined:()=>Jc,$ZodUnion:()=>ai,$ZodUnknown:()=>Hc,$ZodVoid:()=>Xc,$ZodXID:()=>kc,$ZodXor:()=>tu,$brand:()=>Lf,$constructor:()=>g,$input:()=>lm,$output:()=>um,Doc:()=>Yr,INVALID:()=>Xe,JSONSchema:()=>Zb,JSONSchemaGenerator:()=>xl,NEVER:()=>Mf,TimePrecision:()=>ym,URL_BAD_FORMAT:()=>Xp,URL_UNPARSEABLE:()=>Mo,ZodCompileAsyncError:()=>Ot,ZodCompileUnsupportedError:()=>re,_any:()=>tl,_array:()=>km,_base64:()=>va,_base64url:()=>ya,_bigint:()=>Hu,_boolean:()=>Gu,_catch:()=>QO,_check:()=>kb,_cidrv4:()=>ha,_cidrv6:()=>ga,_coercedBigint:()=>bm,_coercedBoolean:()=>$m,_coercedDate:()=>xm,_coercedNumber:()=>_m,_coercedString:()=>vm,_creditCard:()=>Mu,_cuid:()=>ca,_cuid2:()=>ua,_custom:()=>pl,_date:()=>ol,_decode:()=>Ks,_decodeAsync:()=>Hs,_default:()=>WO,_discriminatedUnion:()=>UO,_e164:()=>_a,_email:()=>ea,_emoji:()=>aa,_encode:()=>Js,_encodeAsync:()=>Gs,_endsWith:()=>_i,_enum:()=>FO,_file:()=>fl,_float32:()=>Fu,_float64:()=>Bu,_gt:()=>qt,_gte:()=>gt,_guid:()=>ta,_iban:()=>Lu,_includes:()=>vi,_int:()=>qu,_int32:()=>Ju,_int64:()=>Wu,_intersection:()=>ZO,_ipv4:()=>pa,_ipv6:()=>ma,_isoDate:()=>xa,_isoDateTime:()=>ba,_isoDuration:()=>wa,_isoTime:()=>ka,_jwt:()=>$a,_ksuid:()=>fa,_lazy:()=>nE,_length:()=>on,_literal:()=>JO,_lowercase:()=>hi,_lt:()=>Vt,_lte:()=>ht,_mac:()=>Zu,_map:()=>VO,_max:()=>ht,_maxLength:()=>nn,_maxSize:()=>br,_mime:()=>bi,_min:()=>gt,_minLength:()=>cr,_minSize:()=>Ft,_multipleOf:()=>$r,_nan:()=>al,_nanoid:()=>sa,_nativeEnum:()=>BO,_negative:()=>cl,_never:()=>nl,_nonnegative:()=>ll,_nonoptional:()=>XO,_nonpositive:()=>ul,_normalize:()=>xi,_null:()=>el,_nullable:()=>HO,_number:()=>Vu,_optional:()=>GO,_overwrite:()=>Et,_parse:()=>Hn,_parseAsync:()=>Wn,_pipe:()=>eE,_positive:()=>sl,_promise:()=>iE,_properties:()=>$i,_property:()=>dl,_readonly:()=>tE,_record:()=>LO,_refine:()=>ml,_regex:()=>mi,_safeDecode:()=>Xs,_safeDecodeAsync:()=>Qs,_safeEncode:()=>Ws,_safeEncodeAsync:()=>Ys,_safeParse:()=>Xn,_safeParseAsync:()=>Qn,_set:()=>qO,_size:()=>rn,_slugify:()=>Ii,_startsWith:()=>yi,_string:()=>Uu,_stringFormat:()=>xr,_stringbool:()=>yl,_success:()=>YO,_superRefine:()=>hl,_symbol:()=>Yu,_templateLiteral:()=>rE,_toLowerCase:()=>wi,_toUpperCase:()=>Si,_transform:()=>KO,_trim:()=>ki,_tuple:()=>MO,_uint32:()=>Ku,_uint64:()=>Xu,_ulid:()=>la,_undefined:()=>Qu,_union:()=>RO,_unknown:()=>rl,_uppercase:()=>gi,_url:()=>pi,_uuid:()=>ra,_uuidv4:()=>na,_uuidv6:()=>ia,_uuidv7:()=>oa,_void:()=>il,_xid:()=>da,_xor:()=>CO,base64Charset:()=>Ec,base64urlCharset:()=>Fo,canParseURL:()=>Yp,clone:()=>ue,compile:()=>mm,compileFn:()=>Ru,config:()=>Pe,createStandardJSONSchemaMethod:()=>zi,createToJSONSchemaMethod:()=>Sm,decode:()=>w_,decodeAsync:()=>I_,describe:()=>gl,encode:()=>k_,encodeAsync:()=>S_,extractDefs:()=>wr,finalize:()=>Sr,flattenError:()=>Ao,formatError:()=>Do,getDiscriminatedOption:()=>om,globalConfig:()=>Ae,globalRegistry:()=>Re,handleUnrepresentable:()=>Ee,initializeContext:()=>kr,isBackEdge:()=>Tu,isRecursiveSchema:()=>Pu,isValidBase64:()=>qo,isValidBase64URL:()=>jc,isValidCIDRv6:()=>Tc,isValidCreditCard:()=>Rc,isValidIBAN:()=>Uc,isValidIPv6:()=>Vo,isValidJWT:()=>Mc,locales:()=>di,memoizer:()=>Yo,mergeValues:()=>ii,meta:()=>vl,parse:()=>Hr,parseAsync:()=>Wr,parseURLObject:()=>W_,prettifyError:()=>Jf,process:()=>pe,processSchema:()=>pe,regexes:()=>mt,registry:()=>Au,safeDecode:()=>P_,safeDecodeAsync:()=>O_,safeEncode:()=>z_,safeEncodeAsync:()=>T_,safeParse:()=>Yn,safeParseAsync:()=>ei,standardProps:()=>lc,stripTabAndNewline:()=>Lo,toDotPath:()=>b_,toJSONSchema:()=>an,toZod:()=>So,treeifyError:()=>Bf,urlHostnameOk:()=>hc,urlProtocolOk:()=>gc,util:()=>b,validate:()=>ti,validateAsync:()=>ri,validateURL:()=>mc,version:()=>Hp,withParser:()=>Du});var b={};er(b,{BIGINT_FORMAT_RANGES:()=>To,CONSTANT_CATCH:()=>Fs,Class:()=>Tf,NUMBER_FORMAT_RANGES:()=>Po,aborted:()=>We,allowsEval:()=>Nf,assert:()=>h0,assertEqual:()=>d0,assertIs:()=>p0,assertNever:()=>m0,assertNotEqual:()=>f0,assignProp:()=>De,attachSchema:()=>Oo,base64ToUint8Array:()=>h_,base64urlToUint8Array:()=>z0,cached:()=>Fn,captureStackTrace:()=>Vs,cleanEnum:()=>I0,cleanRegex:()=>ar,clone:()=>ue,cloneDef:()=>y0,codePointLength:()=>Gr,constantCatch:()=>Uf,createTransparentProxy:()=>w0,defineLazy:()=>Of,defineLazyInternal:()=>W,derived:()=>E0,esc:()=>He,escapeRegex:()=>bt,explicitlyAborted:()=>Df,extend:()=>u_,finalizeIssue:()=>it,floatSafeRemainder:()=>Io,getElementAtPath:()=>_0,getEnumValues:()=>Vn,getLengthableOrigin:()=>No,getParsedType:()=>k0,getSizableOrigin:()=>Eo,hexToUint8Array:()=>T0,hide:()=>jo,installLazyProp:()=>Cf,isObject:()=>Kr,isPlainObject:()=>$t,issue:()=>Gn,joinValues:()=>v,jsonStringifyReplacer:()=>qn,members:()=>Rf,merge:()=>f_,mergeDefs:()=>_t,normalizeParams:()=>I,nullish:()=>Ls,numKeys:()=>x0,objectClone:()=>g0,omit:()=>c_,optionalKeys:()=>Af,own:()=>Lt,parsedType:()=>k,partial:()=>p_,pick:()=>s_,prefixIssues:()=>nt,primitiveTypes:()=>jf,promiseAllObject:()=>$0,propertyKeyTypes:()=>zo,randomString:()=>b0,rawShape:()=>Bn,required:()=>m_,safeExtend:()=>d_,shallowClone:()=>Jn,sizeCaps:()=>Kn,slugify:()=>Ef,stringifyPrimitive:()=>x,toZod:()=>So,uint8ArrayToBase64:()=>g_,uint8ArrayToBase64url:()=>P0,uint8ArrayToHex:()=>O0,unwrapMessage:()=>Ln});function d0(e){return e}function f0(e){return e}function So(){return e=>e}function p0(e){}function m0(e){throw new Error("Unexpected value in exhaustive check")}function h0(e){}function Vn(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function v(e,t="|"){return e.map(n=>x(n)).join(t)}function qn(e,t){return typeof t=="bigint"?t.toString():t}var Pf=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Fn(e){return new Pf(e)}function Ls(e){return e==null}function ar(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Io(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var i_=Symbol("evaluating");function Of(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==i_)return i===void 0&&(i=i_,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function g0(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function De(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Bn(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function or(e){return Bn(e._zod.def)??e._zod.def.shape}function o_(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return De(this,t,i),i},enumerable:!0,configurable:!0})}function a_(e,t,n){t in e?De(e,t,n):e[t]=n}function Jr(e,t,n,i){let r=or(t);for(let o of n){let a=Object.getOwnPropertyDescriptor(r,o);a.enumerable&&(a.get?o_(e,o,()=>{let s=t._zod.def.shape[o];return i?i(s,o):s}):a_(e,o,i?i(a.value,o):a.value))}}function v0(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?o_(e,n,()=>t[n]):a_(e,n,i.value))}}function _t(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function y0(e){return _t(e._zod.def)}function _0(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function $0(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function b0(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function He(e){return JSON.stringify(e)}function Ef(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Vs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nf=Fn(()=>{if(Ae.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function $t(e){if(Kr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Kr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Jn(e){return $t(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function x0(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var k0=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}`)}},zo=new Set(["string","number","symbol"]),jf=new Set(["string","number","bigint","boolean","symbol","undefined"]);function bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ue(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function I(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 w0(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function x(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Af(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Po={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]},To={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function s_(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Jr(o,e,qs(e,t)),ue(e,_t(n,{shape:o,checks:[]}))}function qs(e,t){let n=or(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function c_(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(qs(e,t)),a={};return Jr(a,e,Reflect.ownKeys(or(e)).filter(s=>!o.has(s))),ue(e,_t(n,{shape:a,checks:[]}))}function u_(e,t){if(!$t(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=or(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ue(e,_t(e._zod.def,{shape:l_(e,t)}))}function l_(e,t){let n={};return Jr(n,e,Reflect.ownKeys(or(e))),v0(n,t),n}function d_(e,t){if(!$t(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ue(e,_t(e._zod.def,{shape:l_(e,t)}))}function f_(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Jr(n,e,Reflect.ownKeys(or(e))),Jr(n,t,Reflect.ownKeys(or(t)));let i=_t(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ue(e,i)}function p_(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let s=n?new Set(qs(t,n)):void 0,c={};return Jr(c,t,Reflect.ownKeys(or(t)),e&&((u,l)=>s&&!s.has(l)?u:new e({type:"optional",innerType:u}))),ue(t,_t(t._zod.def,{shape:c,checks:[]}))}function m_(e,t,n){let i=n?new Set(qs(t,n)):void 0,r={};return Jr(r,t,Reflect.ownKeys(or(t)),(o,a)=>i&&!i.has(a)?o:new e({type:"nonoptional",innerType:o})),ue(t,_t(t._zod.def,{shape:r}))}function We(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Df(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function nt(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ln(e){return typeof e=="string"?e:e?.message}function Kn(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}function Oo(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function it(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let o=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Ln(e.inst?._zod.def?.error?.(e))??Ln(o?.(e))??Ln(t?.error?.(e))??Ln(n.customError?.(e))??Ln(n.localeError?.(e))??"Invalid input",s={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(s[c]=e[c]);return s.path??(s.path=[]),s.message=a,t?.reportInput&&(s.input=e.input),s}function Eo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var S0=/[\uD800-\uDBFF]/;function Gr(e){let t=e.length;if(!S0.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}function No(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function k(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 n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Gn(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function I0(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function h_(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function g_(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function z0(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return h_(t+n)}function P0(e){return g_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function T0(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function O0(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Tf=class{constructor(...t){}};function Rf(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):N0(e,n,i.value)}}function Lt(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function jo(e,t,n){return Lt(e,t,n,!1)}function E0(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Lt(this,n,i(this))},set(r){Lt(this,n,r)}})}return t}function N0(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Lt(this,t,n.bind(this))},set(i){Lt(this,t,i)}})}function j0(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var zf,gr=!1,A0={configurable:!0,get(){gr=!0}};function W(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&zf!==e._zod){zf=void 0;return}zf=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,A0);let r=gr;gr=!1;try{let o=n(this);return gr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),gr=gr||r,o}catch(o){throw delete this[t],gr=gr||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function Cf(e,t,n,i){let r=j0(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var Fs="~constantCatch";function Uf(e){let t=()=>e;return t[Fs]=!0,t}var v_,Mf=Object.freeze({status:"aborted"}),Zf={value:void 0,enumerable:!1},y_="captureStackTrace"in Error?Error:null;function D0(e){let t=y_;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return y_=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function g(e,t,n,i){let r={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=r;let a=n,s=a&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Zf.value=new o(p);try{Object.defineProperty(f,"_zod",Zf)}finally{Zf.value=void 0}}if(f._zod.traits.add(e),t(f,p),s){let h=Object.getPrototypeOf(f),y=f._zod.constr.prototype,$=h;for(;$&&$!==y;)$=Object.getPrototypeOf($);let w=$??h;s.has(w)||(s.add(w),Rf(w,a))}let m=d.prototype;for(let h in m)Object.prototype.hasOwnProperty.call(m,h)&&(h in f||(f[h]=m[h].bind(f)))}let u=i?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let p=i?.Parent?D0(l):this;c(p,f);let m=p._zod.deferred;if(m){for(let y of m)y();p._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Lf=Symbol("zod_brand"),ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(v_=globalThis).__zod_globalConfig??(v_.__zod_globalConfig={});var Ae=globalThis.__zod_globalConfig;function Pe(e){return e&&Object.assign(Ae,e),Ae}function R0(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,qn,2)),e.message}function C0(e){this._zod.message=e}var U0={get:R0,set:C0,enumerable:!0,configurable:!0},qf={value:void 0,enumerable:!1},__=new WeakSet([Object.prototype,Error.prototype]),$_=(e,t)=>{e.name="$ZodError",qf.value=t,Object.defineProperty(e,"issues",qf),qf.value=void 0,Object.defineProperty(e,"message",U0);let n=Object.getPrototypeOf(e);__.has(n)||(__.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},Ff=g("$ZodError",$_),at=g("$ZodError",$_,void 0,{Parent:Error});function Z0(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Ao(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?Z0(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Do(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)n._errors.push(t(a));else{let c=n,u=0;for(;u<s.length;){let l=s[u],d=u===s.length-1;if(l==="_errors"){d&&c._errors.push(t(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(a)),c=f,u++}}}};return i(e),n}function Bf(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var a;for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0){n.errors.push(t(s));continue}let u=n,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(t(s)),l++}}};return i(e),n}function b_(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Jf(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${b_(i.path)}`);return t.join(`
9
+ deps: ${n}}`};var e1={keyword:"dependencies",type:"object",schemaType:"object",error:Ht.error,code(e){let[t,n]=t1(e);uI(e,t),lI(e,n)}};function t1({schema:e}){let t={},n={};for(let i in e){if(i==="__proto__")continue;let r=Array.isArray(e[i])?t:n;r[i]=e[i]}return[t,n]}function uI(e,t=e.schema){let{gen:n,data:i,it:r}=e;if(Object.keys(t).length===0)return;let o=n.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let c=(0,ws.propertyInData)(n,i,a,r.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),r.allErrors?n.if(c,()=>{for(let u of s)(0,ws.checkReportMissingProp)(e,u)}):(n.if((0,sy._)`${c} && (${(0,ws.checkMissingProp)(e,s,o)})`),(0,ws.reportMissingProp)(e,o),n.else())}}Ht.validatePropertyDeps=uI;function lI(e,t=e.schema){let{gen:n,data:i,keyword:r,it:o}=e,a=n.name("valid");for(let s in t)(0,Q4.alwaysValidSchema)(o,t[s])||(n.if((0,ws.propertyInData)(n,i,s,o.opts.ownProperties),()=>{let c=e.subschema({keyword:r,schemaProp:s},a);e.mergeValidEvaluated(c,a)},()=>n.var(a,!0)),e.ok(a))}Ht.validateSchemaDeps=lI;Ht.default=e1});var pI=N(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});var fI=Y(),r1=se(),n1={message:"property name must be valid",params:({params:e})=>(0,fI._)`{propertyName: ${e.propertyName}}`},i1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n1,code(e){let{gen:t,schema:n,data:i,it:r}=e;if((0,r1.alwaysValidSchema)(r,n))return;let o=t.name("valid");t.forIn("key",i,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,fI.not)(o),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(o)}};cy.default=i1});var ly=N(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});var Xd=St(),Ut=Y(),o1=dr(),Yd=se(),a1={message:"must NOT have additional properties",params:({params:e})=>(0,Ut._)`{additionalProperty: ${e.additionalProperty}}`},s1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:a1,code(e){let{gen:t,schema:n,parentSchema:i,data:r,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,Yd.alwaysValidSchema)(a,n))return;let u=(0,Xd.allSchemaProperties)(i.properties),l=(0,Xd.allSchemaProperties)(i.patternProperties);d(),e.ok((0,Ut._)`${o} === ${o1.default.errors}`);function d(){t.forIn("key",r,y=>{!u.length&&!l.length?m(y):t.if(f(y),()=>m(y))})}function f(y){let $;if(u.length>8){let w=(0,Yd.schemaRefOrVal)(a,i.properties,"properties");$=(0,Xd.isOwnProperty)(t,w,y)}else u.length?$=(0,Ut.or)(...u.map(w=>(0,Ut._)`${y} === ${w}`)):$=Ut.nil;return l.length&&($=(0,Ut.or)($,...l.map(w=>(0,Ut._)`${(0,Xd.usePattern)(e,w)}.test(${y})`))),(0,Ut.not)($)}function p(y){t.code((0,Ut._)`delete ${r}[${y}]`)}function m(y){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){p(y);return}if(n===!1){e.setParams({additionalProperty:y}),e.error(),s||t.break();return}if(typeof n=="object"&&!(0,Yd.alwaysValidSchema)(a,n)){let $=t.name("valid");c.removeAdditional==="failing"?(h(y,$,!1),t.if((0,Ut.not)($),()=>{e.reset(),p(y)})):(h(y,$),s||t.if((0,Ut.not)($),()=>t.break()))}}function h(y,$,w){let z={keyword:"additionalProperties",dataProp:y,dataPropType:Yd.Type.Str};w===!1&&Object.assign(z,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(z,$)}}};uy.default=s1});var gI=N(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});var c1=ls(),mI=St(),dy=se(),hI=ly(),u1={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,parentSchema:i,data:r,it:o}=e;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&hI.default.code(new c1.KeywordCxt(o,hI.default,"additionalProperties"));let a=(0,mI.allSchemaProperties)(n);for(let d of a)o.definedProperties.add(d);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=dy.mergeEvaluated.props(t,(0,dy.toHash)(a),o.props));let s=a.filter(d=>!(0,dy.alwaysValidSchema)(o,n[d]));if(s.length===0)return;let c=t.name("valid");for(let d of s)u(d)?l(d):(t.if((0,mI.propertyInData)(t,r,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&&n[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};fy.default=u1});var $I=N(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});var vI=St(),Qd=Y(),yI=se(),_I=se(),l1={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,data:i,parentSchema:r,it:o}=e,{opts:a}=o,s=(0,vI.allSchemaProperties)(n),c=s.filter(h=>(0,yI.alwaysValidSchema)(o,n[h]));if(s.length===0||c.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&r.properties,l=t.name("valid");o.props!==!0&&!(o.props instanceof Qd.Name)&&(o.props=(0,_I.evaluatedPropsToName)(t,o.props));let{props:d}=o;f();function f(){for(let h of s)u&&p(h),o.allErrors?m(h):(t.var(l,!0),m(h),t.if(l))}function p(h){for(let y in u)new RegExp(h).test(y)&&(0,yI.checkStrictMode)(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){t.forIn("key",i,y=>{t.if((0,Qd._)`${(0,vI.usePattern)(e,h)}.test(${y})`,()=>{let $=c.includes(h);$||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:_I.Type.Str},l),o.opts.unevaluated&&d!==!0?t.assign((0,Qd._)`${d}[${y}]`,!0):!$&&!o.allErrors&&t.if((0,Qd.not)(l),()=>t.break())})})}}};py.default=l1});var bI=N(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});var d1=se(),f1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:i}=e;if((0,d1.alwaysValidSchema)(i,n)){e.fail();return}let r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};my.default=f1});var xI=N(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});var p1=St(),m1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:p1.validateUnion,error:{message:"must match a schema in anyOf"}};hy.default=m1});var kI=N(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});var ef=Y(),h1=se(),g1={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ef._)`{passingSchemas: ${e.passing}}`},v1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:g1,code(e){let{gen:t,schema:n,parentSchema:i,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&i.discriminator)return;let o=n,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 f;(0,h1.alwaysValidSchema)(r,l)?t.var(c,!0):f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,ef._)`${c} && ${a}`).assign(a,!1).assign(s,(0,ef._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),f&&e.mergeEvaluated(f,ef.Name)})})}}};gy.default=v1});var wI=N(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});var y1=se(),_1={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:n,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");let r=t.name("valid");n.forEach((o,a)=>{if((0,y1.alwaysValidSchema)(i,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},r);e.ok(r),e.mergeEvaluated(s)})}};vy.default=_1});var zI=N(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});var tf=Y(),II=se(),$1={message:({params:e})=>(0,tf.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,tf._)`{failingKeyword: ${e.ifClause}}`},b1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:$1,code(e){let{gen:t,parentSchema:n,it:i}=e;n.then===void 0&&n.else===void 0&&(0,II.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=SI(i,"then"),o=SI(i,"else");if(!r&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),r&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(s,u("then",l),u("else",l))}else r?t.if(s,u("then")):t.if((0,tf.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 f=e.subschema({keyword:l},s);t.assign(a,s),e.mergeValidEvaluated(f,a),d?t.assign(d,(0,tf._)`${l}`):e.setParams({ifClause:l})}}}};function SI(e,t){let n=e.schema[t];return n!==void 0&&!(0,II.alwaysValidSchema)(e,n)}yy.default=b1});var PI=N(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});var x1=se(),k1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,x1.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};_y.default=k1});var TI=N($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});var w1=ry(),S1=oI(),I1=ny(),z1=sI(),P1=cI(),T1=dI(),O1=pI(),E1=ly(),N1=gI(),j1=$I(),A1=bI(),D1=xI(),R1=kI(),C1=wI(),U1=zI(),Z1=PI();function M1(e=!1){let t=[A1.default,D1.default,R1.default,C1.default,U1.default,Z1.default,O1.default,E1.default,T1.default,N1.default,j1.default];return e?t.push(S1.default,z1.default):t.push(w1.default,I1.default),t.push(P1.default),t}$y.default=M1});var OI=N(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var Oe=Y(),L1={message:({schemaCode:e})=>(0,Oe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Oe._)`{format: ${e}}`},V1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:L1,code(e,t){let{gen:n,data:i,$data:r,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=s;if(!c.validateFormats)return;r?f():p();function f(){let m=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=n.const("fDef",(0,Oe._)`${m}[${a}]`),y=n.let("fType"),$=n.let("format");n.if((0,Oe._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>n.assign(y,(0,Oe._)`${h}.type || "string"`).assign($,(0,Oe._)`${h}.validate`),()=>n.assign(y,(0,Oe._)`"string"`).assign($,h)),e.fail$data((0,Oe.or)(w(),z()));function w(){return c.strictSchema===!1?Oe.nil:(0,Oe._)`${a} && !${$}`}function z(){let D=l.$async?(0,Oe._)`(${h}.async ? await ${$}(${i}) : ${$}(${i}))`:(0,Oe._)`${$}(${i})`,E=(0,Oe._)`(typeof ${$} == "function" ? ${D} : ${$}.test(${i}))`;return(0,Oe._)`${$} && ${$} !== true && ${y} === ${t} && !${E}`}}function p(){let m=d.formats[o];if(!m){w();return}if(m===!0)return;let[h,y,$]=z(m);h===t&&e.pass(D());function w(){if(c.strictSchema===!1){d.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function z(E){let K=E instanceof RegExp?(0,Oe.regexpCode)(E):c.code.formats?(0,Oe._)`${c.code.formats}${(0,Oe.getProperty)(o)}`:void 0,ke=n.scopeValue("formats",{key:o,ref:E,code:K});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Oe._)`${ke}.validate`]:["string",E,ke]}function D(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Oe._)`await ${$}(${i})`}return typeof y=="function"?(0,Oe._)`${$}(${i})`:(0,Oe._)`${$}.test(${i})`}}}};by.default=V1});var EI=N(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});var q1=OI(),F1=[q1.default];xy.default=F1});var NI=N(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.contentVocabulary=no.metadataVocabulary=void 0;no.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];no.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var AI=N(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});var B1=LS(),J1=tI(),K1=TI(),G1=EI(),jI=NI(),H1=[B1.default,J1.default,(0,K1.default)(),G1.default,jI.metadataVocabulary,jI.contentVocabulary];ky.default=H1});var RI=N(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.DiscrError=void 0;var DI;(function(e){e.Tag="tag",e.Mapping="mapping"})(DI||(rf.DiscrError=DI={}))});var UI=N(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});var io=Y(),wy=RI(),CI=Zd(),W1=ds(),X1=se(),Y1={message:({params:{discrError:e,tagName:t}})=>e===wy.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,io._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},Q1={keyword:"discriminator",type:"object",schemaType:"object",error:Y1,code(e){let{gen:t,data:n,schema:i,parentSchema:r,it:o}=e,{oneOf:a}=r;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=i.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(i.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,io._)`${n}${(0,io.getProperty)(s)}`);t.if((0,io._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:wy.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function l(){let p=f();t.if(!1);for(let m in p)t.elseIf((0,io._)`${u} === ${m}`),t.assign(c,d(p[m]));t.else(),e.error(!1,{discrError:wy.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function d(p){let m=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:p},m);return e.mergeEvaluated(h,io.Name),m}function f(){var p;let m={},h=$(r),y=!0;for(let D=0;D<a.length;D++){let E=a[D];if(E?.$ref&&!(0,X1.schemaHasRulesButRef)(E,o.self.RULES)){let ke=E.$ref;if(E=CI.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ke),E instanceof CI.SchemaEnv&&(E=E.schema),E===void 0)throw new W1.default(o.opts.uriResolver,o.baseId,ke)}let K=(p=E?.properties)===null||p===void 0?void 0:p[s];if(typeof K!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);y=y&&(h||$(E)),w(K,D)}if(!y)throw new Error(`discriminator: "${s}" must be required`);return m;function $({required:D}){return Array.isArray(D)&&D.includes(s)}function w(D,E){if(D.const)z(D.const,E);else if(D.enum)for(let K of D.enum)z(K,E);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function z(D,E){if(typeof D!="string"||D in m)throw new Error(`discriminator: "${s}" values must be unique strings`);m[D]=E}}}};Sy.default=Q1});var ZI=N((B9,eC)=>{eC.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 zy=N((Se,Iy)=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.MissingRefError=Se.ValidationError=Se.CodeGen=Se.Name=Se.nil=Se.stringify=Se.str=Se._=Se.KeywordCxt=Se.Ajv=void 0;var tC=DS(),rC=AI(),nC=UI(),MI=ZI(),iC=["/properties"],nf="http://json-schema.org/draft-07/schema",oo=class extends tC.default{_addVocabularies(){super._addVocabularies(),rC.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(nC.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(MI,iC):MI;this.addMetaSchema(t,nf,!1),this.refs["http://json-schema.org/schema"]=nf}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(nf)?nf:void 0)}};Se.Ajv=oo;Iy.exports=Se=oo;Iy.exports.Ajv=oo;Object.defineProperty(Se,"__esModule",{value:!0});Se.default=oo;var oC=ls();Object.defineProperty(Se,"KeywordCxt",{enumerable:!0,get:function(){return oC.KeywordCxt}});var ao=Y();Object.defineProperty(Se,"_",{enumerable:!0,get:function(){return ao._}});Object.defineProperty(Se,"str",{enumerable:!0,get:function(){return ao.str}});Object.defineProperty(Se,"stringify",{enumerable:!0,get:function(){return ao.stringify}});Object.defineProperty(Se,"nil",{enumerable:!0,get:function(){return ao.nil}});Object.defineProperty(Se,"Name",{enumerable:!0,get:function(){return ao.Name}});Object.defineProperty(Se,"CodeGen",{enumerable:!0,get:function(){return ao.CodeGen}});var aC=Cd();Object.defineProperty(Se,"ValidationError",{enumerable:!0,get:function(){return aC.default}});var sC=ds();Object.defineProperty(Se,"MissingRefError",{enumerable:!0,get:function(){return sC.default}})});var GI=N(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.formatNames=Xt.fastFormats=Xt.fullFormats=void 0;function Wt(e,t){return{validate:e,compare:t}}Xt.fullFormats={date:Wt(FI,Ey),time:Wt(Ty(!0),Ny),"date-time":Wt(LI(!0),JI),"iso-time":Wt(Ty(),BI),"iso-date-time":Wt(LI(),KI),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:pC,"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:$C,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:mC,int32:{type:"number",validate:vC},int64:{type:"number",validate:yC},float:{type:"number",validate:qI},double:{type:"number",validate:qI},password:!0,binary:!0};Xt.fastFormats={...Xt.fullFormats,date:Wt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ey),time:Wt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ny),"date-time":Wt(/^\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,JI),"iso-time":Wt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,BI),"iso-date-time":Wt(/^\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,KI),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 cC(e){return e%4===0&&(e%100!==0||e%400===0)}var uC=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,lC=[0,31,28,31,30,31,30,31,31,30,31,30,31];function FI(e){let t=uC.exec(e);if(!t)return!1;let n=+t[1],i=+t[2],r=+t[3];return i>=1&&i<=12&&r>=1&&r<=(i===2&&cC(n)?29:lC[i])}function Ey(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Py=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Ty(e){return function(n){let i=Py.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],a=+i[3],s=i[4],c=i[5]==="-"?-1:1,u=+(i[6]||0),l=+(i[7]||0);if(u>23||l>59||e&&!s)return!1;if(r<=23&&o<=59&&a<60)return!0;let d=o-l*c,f=r-u*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function Ny(e,t){if(!(e&&t))return;let n=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(n&&i)return n-i}function BI(e,t){if(!(e&&t))return;let n=Py.exec(e),i=Py.exec(t);if(n&&i)return e=n[1]+n[2]+n[3],t=i[1]+i[2]+i[3],e>t?1:e<t?-1:0}var Oy=/t|\s/i;function LI(e){let t=Ty(e);return function(i){let r=i.split(Oy);return r.length===2&&FI(r[0])&&t(r[1])}}function JI(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),i=new Date(t).valueOf();if(n&&i)return n-i}function KI(e,t){if(!(e&&t))return;let[n,i]=e.split(Oy),[r,o]=t.split(Oy),a=Ey(n,r);if(a!==void 0)return a||Ny(i,o)}var dC=/\/|:/,fC=/^(?:[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 pC(e){return dC.test(e)&&fC.test(e)}var VI=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function mC(e){return VI.lastIndex=0,VI.test(e)}var hC=-(2**31),gC=2**31-1;function vC(e){return Number.isInteger(e)&&e<=gC&&e>=hC}function yC(e){return Number.isInteger(e)}function qI(){return!0}var _C=/[^\\]\\Z/;function $C(e){if(_C.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var HI=N(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.formatLimitDefinition=void 0;var bC=zy(),Zt=Y(),Lr=Zt.operators,of={formatMaximum:{okStr:"<=",ok:Lr.LTE,fail:Lr.GT},formatMinimum:{okStr:">=",ok:Lr.GTE,fail:Lr.LT},formatExclusiveMaximum:{okStr:"<",ok:Lr.LT,fail:Lr.GTE},formatExclusiveMinimum:{okStr:">",ok:Lr.GT,fail:Lr.LTE}},xC={message:({keyword:e,schemaCode:t})=>(0,Zt.str)`should be ${of[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Zt._)`{comparison: ${of[e].okStr}, limit: ${t}}`};so.formatLimitDefinition={keyword:Object.keys(of),type:"string",schemaType:"string",$data:!0,error:xC,code(e){let{gen:t,data:n,schemaCode:i,keyword:r,it:o}=e,{opts:a,self:s}=o;if(!a.validateFormats)return;let c=new bC.KeywordCxt(o,s.RULES.all.format.definition,"format");c.$data?u():l();function u(){let f=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),p=t.const("fmt",(0,Zt._)`${f}[${c.schemaCode}]`);e.fail$data((0,Zt.or)((0,Zt._)`typeof ${p} != "object"`,(0,Zt._)`${p} instanceof RegExp`,(0,Zt._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let f=c.schema,p=s.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${r}": format "${f}" does not define "compare" function`);let m=t.scopeValue("formats",{key:f,ref:p,code:a.code.formats?(0,Zt._)`${a.code.formats}${(0,Zt.getProperty)(f)}`:void 0});e.fail$data(d(m))}function d(f){return(0,Zt._)`${f}.compare(${n}, ${i}) ${of[r].fail} 0`}},dependencies:["format"]};var kC=e=>(e.addKeyword(so.formatLimitDefinition),e);so.default=kC});var QI=N((Ss,YI)=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});var co=GI(),wC=HI(),jy=Y(),WI=new jy.Name("fullFormats"),SC=new jy.Name("fastFormats"),Ay=(e,t={keywords:!0})=>{if(Array.isArray(t))return XI(e,t,co.fullFormats,WI),e;let[n,i]=t.mode==="fast"?[co.fastFormats,SC]:[co.fullFormats,WI],r=t.formats||co.formatNames;return XI(e,r,n,i),t.keywords&&(0,wC.default)(e),e};Ay.get=(e,t="full")=>{let i=(t==="fast"?co.fastFormats:co.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function XI(e,t,n,i){var r,o;(r=(o=e.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,jy._)`require("ajv-formats/dist/formats").${i}`);for(let a of t)e.addFormat(a,n[a])}YI.exports=Ss=Ay;Object.defineProperty(Ss,"__esModule",{value:!0});Ss.default=Ay});import{randomUUID as kU}from"crypto";import fo from"process";var ie;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let o={};for(let a of r)o[a]=a;return o},e.getValidEnumValues=r=>{let o=e.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(let s of o)a[s]=r[s];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(o){return r[o]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},e.find=(r,o)=>{for(let a of r)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ie||(ie={}));var Yy;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Yy||(Yy={}));var A=ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tr=e=>{switch(typeof e){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(e)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(e)?A.array:e===null?A.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?A.promise:typeof Map<"u"&&e instanceof Map?A.map:typeof Set<"u"&&e instanceof Set?A.set:typeof Date<"u"&&e instanceof Date?A.date:A.object;default:return A.unknown}};var S=ie.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 ft=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let s=i,c=0;for(;c<a.path.length;){let u=a.path[c],l=c===a.path.length-1;if(u==="_errors"){l&&s._errors.push(n(a)),c++;continue}Object.prototype.hasOwnProperty.call(s,u)||(u==="__proto__"?Object.defineProperty(s,u,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):s[u]={_errors:[]}),s=s[u],l&&s._errors.push(n(a)),c++}}};return r(this),i}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,ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};ft.create=e=>new ft(e);var Lz=(e,t)=>{let n;switch(e.code){case S.invalid_type:e.received===A.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case S.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ie.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:n=`Unrecognized key(s) in object: ${ie.joinValues(e.keys,", ")}`;break;case S.invalid_union:n="Invalid input";break;case S.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ie.joinValues(e.options)}`;break;case S.invalid_enum_value:n=`Invalid enum value. Expected ${ie.joinValues(e.options)}, received '${e.received}'`;break;case S.invalid_arguments:n="Invalid function arguments";break;case S.invalid_return_type:n="Invalid function return type";break;case S.invalid_date:n="Invalid date";break;case S.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ie.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case S.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case S.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case S.custom:n="Invalid input";break;case S.invalid_intersection_types:n="Intersection results could not be merged";break;case S.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case S.not_finite:n="Number must be finite";break;default:n=t.defaultError,ie.assertNever(e)}return{message:n}},pr=Lz;var Vz=pr;function po(){return Vz}var Us=e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,o=[...n,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",c=i.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...r,path:o,message:s}};function T(e,t){let n=po(),i=Us({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===pr?void 0:pr].filter(r=>!!r)});e.common.issues.push(i)}var qe=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return V;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let o=await r.key,a=await r.value;i.push({key:o,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return V;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}},V=Object.freeze({status:"aborted"}),zn=e=>({status:"dirty",value:e}),Ge=e=>({status:"valid",value:e}),$f=e=>e.status==="aborted",bf=e=>e.status==="dirty",Fr=e=>e.status==="valid",mo=e=>typeof Promise<"u"&&e instanceof Promise;var C;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(C||(C={}));var yt=class{constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}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}},Qy=(e,t)=>{if(Fr(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 n=new ft(e.common.issues);return this._error=n,this._error}}};function G(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??n??s.defaultError}},description:r}}var Q=class{get description(){return this._def.description}_getType(t){return tr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:tr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qe,ctx:{common:t.parent.common,data:t.data,parsedType:tr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(mo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return Qy(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return Fr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>Fr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tr(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(mo(r)?r:Promise.resolve(r));return Qy(i,o)}refine(t,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let a=t(r),s=()=>o.addIssue({code:S.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Tt({schema:this,typeName:P.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:n=>this["~validate"](n)}}optional(){return Pt.create(this,this._def)}nullable(){return ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hr.create(this)}promise(){return Br.create(this,this._def)}or(t){return Nn.create([this,t],this._def)}and(t){return jn.create(this,t,this._def)}transform(t){return new Tt({...G(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Un({...G(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new Zs({typeName:P.ZodBranded,type:this,...G(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Zn({...G(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Ms.create(this,t)}readonly(){return Mn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},qz=/^c[^\s-]{8,}$/i,Fz=/^[0-9a-z]+$/,Bz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Jz=/^[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,Kz=/^[a-z0-9_-]{21}$/i,Gz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hz=/^[-+]?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)?)??$/,Wz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xz="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",xf,Yz=/^(?:(?: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])$/,Qz=/^(?:(?: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])$/,e0=/^(([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]))$/,t0=/^(([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])$/,r0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,n0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,e_="((\\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])))",i0=new RegExp(`^${e_}$`);function t_(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function o0(e){return new RegExp(`^${t_(e)}$`)}function a0(e){let t=`${e_}T${t_(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function s0(e,t){return!!((t==="v4"||!t)&&Yz.test(e)||(t==="v6"||!t)&&e0.test(e))}function c0(e,t){if(!Gz.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function u0(e,t){return!!((t==="v4"||!t)&&Qz.test(e)||(t==="v6"||!t)&&t0.test(e))}var Tn=class e extends Q{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==A.string){let o=this._getOrReturnCtx(t);return T(o,{code:S.invalid_type,expected:A.string,received:o.parsedType}),V}let i=new qe,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),T(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(r=this._getOrReturnCtx(t,r),T(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(t,r),a?T(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&T(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")Wz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"email",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")xf||(xf=new RegExp(Xz,"u")),xf.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"emoji",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")Jz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"uuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")Kz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"nanoid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")qz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"cuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")Fz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"cuid2",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")Bz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"ulid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),T(r,{validation:"url",code:S.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"regex",code:S.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.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)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?a0(o).test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?i0.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?o0(o).test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{code:S.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?Hz.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"duration",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?s0(t.data,o.version)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"ip",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?c0(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"jwt",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?u0(t.data,o.version)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"cidr",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?r0.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"base64",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?n0.test(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{validation:"base64url",code:S.invalid_string,message:o.message}),i.dirty()):ie.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:S.invalid_string,...C.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...C.errToObj(t)})}url(t){return this._addCheck({kind:"url",...C.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...C.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...C.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...C.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...C.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...C.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...C.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...C.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...C.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...C.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...C.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...C.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,...C.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,...C.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...C.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...C.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...C.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...C.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...C.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...C.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...C.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...C.errToObj(n)})}nonempty(t){return this.min(1,C.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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Tn.create=e=>new Tn({checks:[],typeName:P.ZodString,coerce:e?.coerce??!1,...G(e)});function l0(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return o%a/10**r}var ho=class e extends Q{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)!==A.number){let o=this._getOrReturnCtx(t);return T(o,{code:S.invalid_type,expected:A.number,received:o.parsedType}),V}let i,r=new qe;for(let o of this._def.checks)o.kind==="int"?ie.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),T(i,{code:S.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?l0(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),T(i,{code:S.not_finite,message:o.message}),r.dirty()):ie.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,C.toString(n))}gt(t,n){return this.setLimit("min",t,!1,C.toString(n))}lte(t,n){return this.setLimit("max",t,!0,C.toString(n))}lt(t,n){return this.setLimit("max",t,!1,C.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:C.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:C.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:C.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:C.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ie.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ho.create=e=>new ho({checks:[],typeName:P.ZodNumber,coerce:e?.coerce||!1,...G(e)});var go=class e extends Q{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)!==A.bigint)return this._getInvalidInput(t);let i,r=new qe;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),T(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ie.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return T(n,{code:S.invalid_type,expected:A.bigint,received:n.parsedType}),V}gte(t,n){return this.setLimit("min",t,!0,C.toString(n))}gt(t,n){return this.setLimit("min",t,!1,C.toString(n))}lte(t,n){return this.setLimit("max",t,!0,C.toString(n))}lt(t,n){return this.setLimit("max",t,!1,C.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:C.toString(r)}]})}_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:C.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:C.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};go.create=e=>new go({checks:[],typeName:P.ZodBigInt,coerce:e?.coerce??!1,...G(e)});var vo=class extends Q{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==A.boolean){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.boolean,received:i.parsedType}),V}return Ge(t.data)}};vo.create=e=>new vo({typeName:P.ZodBoolean,coerce:e?.coerce||!1,...G(e)});var yo=class e extends Q{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==A.date){let o=this._getOrReturnCtx(t);return T(o,{code:S.invalid_type,expected:A.date,received:o.parsedType}),V}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return T(o,{code:S.invalid_date}),V}let i=new qe,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),T(r,{code:S.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(r=this._getOrReturnCtx(t,r),T(r,{code:S.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ie.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:C.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:C.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};yo.create=e=>new yo({checks:[],coerce:e?.coerce||!1,typeName:P.ZodDate,...G(e)});var _o=class extends Q{_parse(t){if(this._getType(t)!==A.symbol){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.symbol,received:i.parsedType}),V}return Ge(t.data)}};_o.create=e=>new _o({typeName:P.ZodSymbol,...G(e)});var On=class extends Q{_parse(t){if(this._getType(t)!==A.undefined){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.undefined,received:i.parsedType}),V}return Ge(t.data)}};On.create=e=>new On({typeName:P.ZodUndefined,...G(e)});var En=class extends Q{_parse(t){if(this._getType(t)!==A.null){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.null,received:i.parsedType}),V}return Ge(t.data)}};En.create=e=>new En({typeName:P.ZodNull,...G(e)});var $o=class extends Q{constructor(){super(...arguments),this._any=!0}_parse(t){return Ge(t.data)}};$o.create=e=>new $o({typeName:P.ZodAny,...G(e)});var mr=class extends Q{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ge(t.data)}};mr.create=e=>new mr({typeName:P.ZodUnknown,...G(e)});var Mt=class extends Q{_parse(t){let n=this._getOrReturnCtx(t);return T(n,{code:S.invalid_type,expected:A.never,received:n.parsedType}),V}};Mt.create=e=>new Mt({typeName:P.ZodNever,...G(e)});var bo=class extends Q{_parse(t){if(this._getType(t)!==A.undefined){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.void,received:i.parsedType}),V}return Ge(t.data)}};bo.create=e=>new bo({typeName:P.ZodVoid,...G(e)});var hr=class e extends Q{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==A.array)return T(n,{code:S.invalid_type,expected:A.array,received:n.parsedType}),V;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(T(n,{code:a?S.too_big:S.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(T(n,{code:S.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(T(n,{code:S.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>r.type._parseAsync(new yt(n,a,n.path,s)))).then(a=>qe.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new yt(n,a,n.path,s)));return qe.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:C.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:C.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:C.toString(n)}})}nonempty(t){return this.min(1,t)}};hr.create=(e,t)=>new hr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...G(t)});function Pn(e){if(e instanceof pt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Pt.create(Pn(i))}return new pt({...e._def,shape:()=>t})}else return e instanceof hr?new hr({...e._def,type:Pn(e.element)}):e instanceof Pt?Pt.create(Pn(e.unwrap())):e instanceof ir?ir.create(Pn(e.unwrap())):e instanceof nr?nr.create(e.items.map(t=>Pn(t))):e}var pt=class e extends Q{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(),n=ie.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==A.object){let u=this._getOrReturnCtx(t);return T(u,{code:S.invalid_type,expected:A.object,received:u.parsedType}),V}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Mt&&this._def.unknownKeys==="strip"))for(let u in r.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let l=o[u],d=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new yt(r,d,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Mt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(u==="strict")s.length>0&&(T(r,{code:S.unrecognized_keys,keys:s}),i.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=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new yt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>qe.mergeObjectSync(i,u)):qe.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return C.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:C.errToObj(t).message??r}:{message:r}}}:{}})}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:P.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of ie.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let i of ie.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return Pn(this)}partial(t){let n={};for(let i of ie.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let i of ie.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Pt;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return r_(ie.objectKeys(this.shape))}};pt.create=(e,t)=>new pt({shape:()=>e,unknownKeys:"strip",catchall:Mt.create(),typeName:P.ZodObject,...G(t)});pt.strictCreate=(e,t)=>new pt({shape:()=>e,unknownKeys:"strict",catchall:Mt.create(),typeName:P.ZodObject,...G(t)});pt.lazycreate=(e,t)=>new pt({shape:e,unknownKeys:"strip",catchall:Mt.create(),typeName:P.ZodObject,...G(t)});var Nn=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(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 n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new ft(s.ctx.common.issues));return T(n,{code:S.invalid_union,unionErrors:a}),V}if(n.common.async)return Promise.all(i.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let o,a=[];for(let c of i){let u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.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 n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(c=>new ft(c));return T(n,{code:S.invalid_union,unionErrors:s}),V}}get options(){return this._def.options}};Nn.create=(e,t)=>new Nn({options:e,typeName:P.ZodUnion,...G(t)});var rr=e=>e instanceof An?rr(e.schema):e instanceof Tt?rr(e.innerType()):e instanceof Dn?[e.value]:e instanceof Rn?e.options:e instanceof Cn?ie.objectValues(e.enum):e instanceof Un?rr(e._def.innerType):e instanceof On?[void 0]:e instanceof En?[null]:e instanceof Pt?[void 0,...rr(e.unwrap())]:e instanceof ir?[null,...rr(e.unwrap())]:e instanceof Zs||e instanceof Mn?rr(e.unwrap()):e instanceof Zn?rr(e._def.innerType):[],kf=class e extends Q{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.object)return T(n,{code:S.invalid_type,expected:A.object,received:n.parsedType}),V;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(T(n,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let a=rr(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(r.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);r.set(s,o)}}return new e({typeName:P.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...G(i)})}};function wf(e,t){let n=tr(e),i=tr(t);if(e===t)return{valid:!0,data:e};if(n===A.object&&i===A.object){let r=ie.objectKeys(t),o=ie.objectKeys(e).filter(s=>r.indexOf(s)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let s of o){if(s==="__proto__")continue;let c=wf(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(n===A.array&&i===A.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],c=wf(a,s);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===A.date&&i===A.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var jn=class extends Q{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,a)=>{if($f(o)||$f(a))return V;let s=wf(o.value,a.value);return s.valid?((bf(o)||bf(a))&&n.dirty(),{status:n.value,value:s.data}):(T(i,{code:S.invalid_intersection_types}),V)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};jn.create=(e,t,n)=>new jn({left:e,right:t,typeName:P.ZodIntersection,...G(n)});var nr=class e extends Q{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==A.array)return T(i,{code:S.invalid_type,expected:A.array,received:i.parsedType}),V;if(i.data.length<this._def.items.length)return T(i,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&i.data.length>this._def.items.length&&(T(i,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new yt(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>qe.mergeArray(n,a)):qe.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};nr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nr({items:e,typeName:P.ZodTuple,rest:null,...G(t)})};var Sf=class e extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==A.object)return T(i,{code:S.invalid_type,expected:A.object,received:i.parsedType}),V;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new yt(i,s,i.path,s)),value:a._parse(new yt(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?qe.mergeObjectAsync(n,r):qe.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof Q?new e({keyType:t,valueType:n,typeName:P.ZodRecord,...G(i)}):new e({keyType:Tn.create(),valueType:t,typeName:P.ZodRecord,...G(n)})}},xo=class extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==A.map)return T(i,{code:S.invalid_type,expected:A.map,received:i.parsedType}),V;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,c],u)=>({key:r._parse(new yt(i,s,i.path,[u,"key"])),value:o._parse(new yt(i,c,i.path,[u,"value"]))}));if(i.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 V;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(u.value,l.value)}return{status:n.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 V;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(u.value,l.value)}return{status:n.value,value:s}}}};xo.create=(e,t,n)=>new xo({valueType:t,keyType:e,typeName:P.ZodMap,...G(n)});var ko=class e extends Q{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==A.set)return T(i,{code:S.invalid_type,expected:A.set,received:i.parsedType}),V;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(T(i,{code:S.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(T(i,{code:S.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function a(c){let u=new Set;for(let l of c){if(l.status==="aborted")return V;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}let s=[...i.data.values()].map((c,u)=>o._parse(new yt(i,c,i.path,u)));return i.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:C.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:C.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ko.create=(e,t)=>new ko({valueType:e,minSize:null,maxSize:null,typeName:P.ZodSet,...G(t)});var If=class e extends Q{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.function)return T(n,{code:S.invalid_type,expected:A.function,received:n.parsedType}),V;function i(s,c){return Us({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,po(),pr].filter(u=>!!u),issueData:{code:S.invalid_arguments,argumentsError:c}})}function r(s,c){return Us({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,po(),pr].filter(u=>!!u),issueData:{code:S.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Br){let s=this;return Ge(async function(...c){let u=new ft([]),l=await s._def.args.parseAsync(c,o).catch(p=>{throw u.addIssue(i(c,p)),u}),d=await Reflect.apply(a,this,l);return await s._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(r(d,p)),u})})}else{let s=this;return Ge(function(...c){let u=s._def.args.safeParse(c,o);if(!u.success)throw new ft([i(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(l,o);if(!d.success)throw new ft([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:nr.create(t).rest(mr.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,n,i){return new e({args:t||nr.create([]).rest(mr.create()),returns:n||mr.create(),typeName:P.ZodFunction,...G(i)})}},An=class extends Q{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};An.create=(e,t)=>new An({getter:e,typeName:P.ZodLazy,...G(t)});var Dn=class extends Q{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return T(n,{received:n.data,code:S.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}};Dn.create=(e,t)=>new Dn({value:e,typeName:P.ZodLiteral,...G(t)});function r_(e,t){return new Rn({values:e,typeName:P.ZodEnum,...G(t)})}var Rn=class e extends Q{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return T(n,{expected:ie.joinValues(i),received:n.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return T(n,{received:n.data,code:S.invalid_enum_value,options:i}),V}return Ge(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Rn.create=r_;var Cn=class extends Q{_parse(t){let n=ie.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==A.string&&i.parsedType!==A.number){let r=ie.objectValues(n);return T(i,{expected:ie.joinValues(r),received:i.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(ie.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=ie.objectValues(n);return T(i,{received:i.data,code:S.invalid_enum_value,options:r}),V}return Ge(t.data)}get enum(){return this._def.values}};Cn.create=(e,t)=>new Cn({values:e,typeName:P.ZodNativeEnum,...G(t)});var Br=class extends Q{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.promise&&n.common.async===!1)return T(n,{code:S.invalid_type,expected:A.promise,received:n.parsedType}),V;let i=n.parsedType===A.promise?n.data:Promise.resolve(n.data);return Ge(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Br.create=(e,t)=>new Br({type:e,typeName:P.ZodPromise,...G(t)});var Tt=class extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,o={addIssue:a=>{T(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let a=r.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return V;let c=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return c.status==="aborted"?V:c.status==="dirty"?zn(c.value):n.value==="dirty"?zn(c.value):c});{if(n.value==="aborted")return V;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?V:s.status==="dirty"?zn(s.value):n.value==="dirty"?zn(s.value):s}}if(r.type==="refinement"){let a=s=>{let c=r.refinement(s,o);if(i.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(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?V:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?V:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Fr(a))return V;let s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Fr(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):V);ie.assertNever(r)}};Tt.create=(e,t,n)=>new Tt({schema:e,typeName:P.ZodEffects,effect:t,...G(n)});Tt.createWithPreprocess=(e,t,n)=>new Tt({schema:t,effect:{type:"preprocess",transform:e},typeName:P.ZodEffects,...G(n)});var Pt=class extends Q{_parse(t){return this._getType(t)===A.undefined?Ge(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pt.create=(e,t)=>new Pt({innerType:e,typeName:P.ZodOptional,...G(t)});var ir=class extends Q{_parse(t){return this._getType(t)===A.null?Ge(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ir.create=(e,t)=>new ir({innerType:e,typeName:P.ZodNullable,...G(t)});var Un=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===A.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Un.create=(e,t)=>new Un({innerType:e,typeName:P.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...G(t)});var Zn=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return mo(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Zn.create=(e,t)=>new Zn({innerType:e,typeName:P.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...G(t)});var wo=class extends Q{_parse(t){if(this._getType(t)!==A.nan){let i=this._getOrReturnCtx(t);return T(i,{code:S.invalid_type,expected:A.nan,received:i.parsedType}),V}return{status:"valid",value:t.data}}};wo.create=e=>new wo({typeName:P.ZodNaN,...G(e)});var Zs=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Ms=class e extends Q{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?V:o.status==="dirty"?(n.dirty(),zn(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?V:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:P.ZodPipeline})}},Mn=class extends Q{_parse(t){let n=this._def.innerType._parse(t),i=r=>(Fr(r)&&(r.value=Object.freeze(r.value)),r);return mo(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Mn.create=(e,t)=>new Mn({innerType:e,typeName:P.ZodReadonly,...G(t)});var qU={object:pt.lazycreate},P;(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"})(P||(P={}));var FU=Tn.create,BU=ho.create,JU=wo.create,KU=go.create,GU=vo.create,HU=yo.create,WU=_o.create,XU=On.create,YU=En.create,QU=$o.create,e6=mr.create,t6=Mt.create,r6=bo.create,n6=hr.create,n_=pt.create,i6=pt.strictCreate,o6=Nn.create,a6=kf.create,s6=jn.create,c6=nr.create,u6=Sf.create,l6=xo.create,d6=ko.create,f6=If.create,p6=An.create,m6=Dn.create,h6=Rn.create,g6=Cn.create,v6=Br.create,y6=Tt.create,_6=Pt.create,$6=ir.create,b6=Tt.createWithPreprocess,x6=Ms.create;var Nt={};er(Nt,{$ZodAny:()=>Gc,$ZodArray:()=>Qc,$ZodAsyncError:()=>ot,$ZodBase64:()=>Nc,$ZodBase64URL:()=>Ac,$ZodBigInt:()=>Jo,$ZodBigIntFormat:()=>Fc,$ZodBoolean:()=>oi,$ZodCIDRv4:()=>Pc,$ZodCIDRv6:()=>Oc,$ZodCUID:()=>$c,$ZodCUID2:()=>bc,$ZodCatch:()=>vu,$ZodCheck:()=>he,$ZodCheckBigIntFormat:()=>Np,$ZodCheckEndsWith:()=>Fp,$ZodCheckGreaterThan:()=>oc,$ZodCheckIncludes:()=>Vp,$ZodCheckLengthEquals:()=>Up,$ZodCheckLessThan:()=>ic,$ZodCheckLowerCase:()=>Mp,$ZodCheckMaxLength:()=>Rp,$ZodCheckMaxSize:()=>jp,$ZodCheckMimeType:()=>Kp,$ZodCheckMinLength:()=>Cp,$ZodCheckMinSize:()=>Ap,$ZodCheckMultipleOf:()=>Op,$ZodCheckNumberFormat:()=>Ep,$ZodCheckOverwrite:()=>Gp,$ZodCheckProperties:()=>Jp,$ZodCheckProperty:()=>Bp,$ZodCheckRegex:()=>Zp,$ZodCheckSizeEquals:()=>Dp,$ZodCheckStartsWith:()=>qp,$ZodCheckStringFormat:()=>ni,$ZodCheckUpperCase:()=>Lp,$ZodCodec:()=>si,$ZodCreditCard:()=>Cc,$ZodCustom:()=>ku,$ZodCustomStringFormat:()=>Vc,$ZodCyclicError:()=>zu,$ZodDate:()=>Yc,$ZodDefault:()=>pu,$ZodDiscriminatedUnion:()=>ru,$ZodE164:()=>Dc,$ZodEmail:()=>pc,$ZodEmoji:()=>yc,$ZodEncodeError:()=>vr,$ZodEnum:()=>su,$ZodError:()=>Ff,$ZodExactOptional:()=>du,$ZodFile:()=>uu,$ZodFunction:()=>bu,$ZodGUID:()=>dc,$ZodIBAN:()=>Zc,$ZodIPv4:()=>Sc,$ZodIPv6:()=>Ic,$ZodISODate:()=>em,$ZodISODateTime:()=>Qp,$ZodISODuration:()=>rm,$ZodISOTime:()=>tm,$ZodIntersection:()=>nu,$ZodJWT:()=>Lc,$ZodKSUID:()=>wc,$ZodLazy:()=>ci,$ZodLiteral:()=>cu,$ZodMAC:()=>zc,$ZodMap:()=>ou,$ZodNaN:()=>yu,$ZodNanoID:()=>_c,$ZodNever:()=>Wc,$ZodNonOptional:()=>hu,$ZodNull:()=>Kc,$ZodNullable:()=>fu,$ZodNumber:()=>Bo,$ZodNumberFormat:()=>qc,$ZodObject:()=>eu,$ZodObjectJIT:()=>im,$ZodOptional:()=>Go,$ZodPipe:()=>Ho,$ZodPrefault:()=>mu,$ZodPreprocess:()=>am,$ZodPromise:()=>xu,$ZodReadonly:()=>_u,$ZodRealError:()=>at,$ZodRecord:()=>iu,$ZodRegistry:()=>ju,$ZodSet:()=>au,$ZodString:()=>yr,$ZodStringFormat:()=>fe,$ZodSuccess:()=>gu,$ZodSymbol:()=>Bc,$ZodTemplateLiteral:()=>$u,$ZodTransform:()=>lu,$ZodTuple:()=>Ko,$ZodType:()=>B,$ZodULID:()=>xc,$ZodURL:()=>vc,$ZodUUID:()=>fc,$ZodUndefined:()=>Jc,$ZodUnion:()=>ai,$ZodUnknown:()=>Hc,$ZodVoid:()=>Xc,$ZodXID:()=>kc,$ZodXor:()=>tu,$brand:()=>Lf,$constructor:()=>g,$input:()=>lm,$output:()=>um,Doc:()=>Yr,INVALID:()=>Xe,JSONSchema:()=>Zb,JSONSchemaGenerator:()=>xl,NEVER:()=>Mf,TimePrecision:()=>ym,URL_BAD_FORMAT:()=>Xp,URL_UNPARSEABLE:()=>Mo,ZodCompileAsyncError:()=>Ot,ZodCompileUnsupportedError:()=>re,_any:()=>tl,_array:()=>km,_base64:()=>va,_base64url:()=>ya,_bigint:()=>Hu,_boolean:()=>Gu,_catch:()=>QO,_check:()=>kb,_cidrv4:()=>ha,_cidrv6:()=>ga,_coercedBigint:()=>bm,_coercedBoolean:()=>$m,_coercedDate:()=>xm,_coercedNumber:()=>_m,_coercedString:()=>vm,_creditCard:()=>Mu,_cuid:()=>ca,_cuid2:()=>ua,_custom:()=>pl,_date:()=>ol,_decode:()=>Ks,_decodeAsync:()=>Hs,_default:()=>WO,_discriminatedUnion:()=>UO,_e164:()=>_a,_email:()=>ea,_emoji:()=>aa,_encode:()=>Js,_encodeAsync:()=>Gs,_endsWith:()=>_i,_enum:()=>FO,_file:()=>fl,_float32:()=>Fu,_float64:()=>Bu,_gt:()=>qt,_gte:()=>gt,_guid:()=>ta,_iban:()=>Lu,_includes:()=>vi,_int:()=>qu,_int32:()=>Ju,_int64:()=>Wu,_intersection:()=>ZO,_ipv4:()=>pa,_ipv6:()=>ma,_isoDate:()=>xa,_isoDateTime:()=>ba,_isoDuration:()=>wa,_isoTime:()=>ka,_jwt:()=>$a,_ksuid:()=>fa,_lazy:()=>nE,_length:()=>on,_literal:()=>JO,_lowercase:()=>hi,_lt:()=>Vt,_lte:()=>ht,_mac:()=>Zu,_map:()=>VO,_max:()=>ht,_maxLength:()=>nn,_maxSize:()=>br,_mime:()=>bi,_min:()=>gt,_minLength:()=>cr,_minSize:()=>Ft,_multipleOf:()=>$r,_nan:()=>al,_nanoid:()=>sa,_nativeEnum:()=>BO,_negative:()=>cl,_never:()=>nl,_nonnegative:()=>ll,_nonoptional:()=>XO,_nonpositive:()=>ul,_normalize:()=>xi,_null:()=>el,_nullable:()=>HO,_number:()=>Vu,_optional:()=>GO,_overwrite:()=>Et,_parse:()=>Hn,_parseAsync:()=>Wn,_pipe:()=>eE,_positive:()=>sl,_promise:()=>iE,_properties:()=>$i,_property:()=>dl,_readonly:()=>tE,_record:()=>LO,_refine:()=>ml,_regex:()=>mi,_safeDecode:()=>Xs,_safeDecodeAsync:()=>Qs,_safeEncode:()=>Ws,_safeEncodeAsync:()=>Ys,_safeParse:()=>Xn,_safeParseAsync:()=>Qn,_set:()=>qO,_size:()=>rn,_slugify:()=>Ii,_startsWith:()=>yi,_string:()=>Uu,_stringFormat:()=>xr,_stringbool:()=>yl,_success:()=>YO,_superRefine:()=>hl,_symbol:()=>Yu,_templateLiteral:()=>rE,_toLowerCase:()=>wi,_toUpperCase:()=>Si,_transform:()=>KO,_trim:()=>ki,_tuple:()=>MO,_uint32:()=>Ku,_uint64:()=>Xu,_ulid:()=>la,_undefined:()=>Qu,_union:()=>RO,_unknown:()=>rl,_uppercase:()=>gi,_url:()=>pi,_uuid:()=>ra,_uuidv4:()=>na,_uuidv6:()=>ia,_uuidv7:()=>oa,_void:()=>il,_xid:()=>da,_xor:()=>CO,base64Charset:()=>Ec,base64urlCharset:()=>Fo,canParseURL:()=>Yp,clone:()=>ue,compile:()=>mm,compileFn:()=>Ru,config:()=>Pe,createStandardJSONSchemaMethod:()=>zi,createToJSONSchemaMethod:()=>Sm,decode:()=>w_,decodeAsync:()=>I_,describe:()=>gl,encode:()=>k_,encodeAsync:()=>S_,extractDefs:()=>wr,finalize:()=>Sr,flattenError:()=>Ao,formatError:()=>Do,getDiscriminatedOption:()=>om,globalConfig:()=>Ae,globalRegistry:()=>Re,handleUnrepresentable:()=>Ee,initializeContext:()=>kr,isBackEdge:()=>Tu,isRecursiveSchema:()=>Pu,isValidBase64:()=>qo,isValidBase64URL:()=>jc,isValidCIDRv6:()=>Tc,isValidCreditCard:()=>Rc,isValidIBAN:()=>Uc,isValidIPv6:()=>Vo,isValidJWT:()=>Mc,locales:()=>di,memoizer:()=>Yo,mergeValues:()=>ii,meta:()=>vl,parse:()=>Hr,parseAsync:()=>Wr,parseURLObject:()=>W_,prettifyError:()=>Jf,process:()=>pe,processSchema:()=>pe,regexes:()=>mt,registry:()=>Au,safeDecode:()=>P_,safeDecodeAsync:()=>O_,safeEncode:()=>z_,safeEncodeAsync:()=>T_,safeParse:()=>Yn,safeParseAsync:()=>ei,standardProps:()=>lc,stripTabAndNewline:()=>Lo,toDotPath:()=>b_,toJSONSchema:()=>an,toZod:()=>So,treeifyError:()=>Bf,urlHostnameOk:()=>hc,urlProtocolOk:()=>gc,util:()=>b,validate:()=>ti,validateAsync:()=>ri,validateURL:()=>mc,version:()=>Hp,withParser:()=>Du});var b={};er(b,{BIGINT_FORMAT_RANGES:()=>To,CONSTANT_CATCH:()=>Fs,Class:()=>Tf,NUMBER_FORMAT_RANGES:()=>Po,aborted:()=>We,allowsEval:()=>Nf,assert:()=>h0,assertEqual:()=>d0,assertIs:()=>p0,assertNever:()=>m0,assertNotEqual:()=>f0,assignProp:()=>De,attachSchema:()=>Oo,base64ToUint8Array:()=>h_,base64urlToUint8Array:()=>z0,cached:()=>Fn,captureStackTrace:()=>Vs,cleanEnum:()=>I0,cleanRegex:()=>ar,clone:()=>ue,cloneDef:()=>y0,codePointLength:()=>Gr,constantCatch:()=>Uf,createTransparentProxy:()=>w0,defineLazy:()=>Of,defineLazyInternal:()=>W,derived:()=>E0,esc:()=>He,escapeRegex:()=>bt,explicitlyAborted:()=>Df,extend:()=>u_,finalizeIssue:()=>it,floatSafeRemainder:()=>Io,getElementAtPath:()=>_0,getEnumValues:()=>Vn,getLengthableOrigin:()=>No,getParsedType:()=>k0,getSizableOrigin:()=>Eo,hexToUint8Array:()=>T0,hide:()=>jo,installLazyProp:()=>Cf,isObject:()=>Kr,isPlainObject:()=>$t,issue:()=>Gn,joinValues:()=>v,jsonStringifyReplacer:()=>qn,members:()=>Rf,merge:()=>f_,mergeDefs:()=>_t,normalizeParams:()=>I,nullish:()=>Ls,numKeys:()=>x0,objectClone:()=>g0,omit:()=>c_,optionalKeys:()=>Af,own:()=>Lt,parsedType:()=>k,partial:()=>p_,pick:()=>s_,prefixIssues:()=>nt,primitiveTypes:()=>jf,promiseAllObject:()=>$0,propertyKeyTypes:()=>zo,randomString:()=>b0,rawShape:()=>Bn,required:()=>m_,safeExtend:()=>d_,shallowClone:()=>Jn,sizeCaps:()=>Kn,slugify:()=>Ef,stringifyPrimitive:()=>x,toZod:()=>So,uint8ArrayToBase64:()=>g_,uint8ArrayToBase64url:()=>P0,uint8ArrayToHex:()=>O0,unwrapMessage:()=>Ln});function d0(e){return e}function f0(e){return e}function So(){return e=>e}function p0(e){}function m0(e){throw new Error("Unexpected value in exhaustive check")}function h0(e){}function Vn(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function v(e,t="|"){return e.map(n=>x(n)).join(t)}function qn(e,t){return typeof t=="bigint"?t.toString():t}var Pf=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Fn(e){return new Pf(e)}function Ls(e){return e==null}function ar(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Io(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var i_=Symbol("evaluating");function Of(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==i_)return i===void 0&&(i=i_,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function g0(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function De(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Bn(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function or(e){return Bn(e._zod.def)??e._zod.def.shape}function o_(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return De(this,t,i),i},enumerable:!0,configurable:!0})}function a_(e,t,n){t in e?De(e,t,n):e[t]=n}function Jr(e,t,n,i){let r=or(t);for(let o of n){let a=Object.getOwnPropertyDescriptor(r,o);a.enumerable&&(a.get?o_(e,o,()=>{let s=t._zod.def.shape[o];return i?i(s,o):s}):a_(e,o,i?i(a.value,o):a.value))}}function v0(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?o_(e,n,()=>t[n]):a_(e,n,i.value))}}function _t(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function y0(e){return _t(e._zod.def)}function _0(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function $0(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function b0(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function He(e){return JSON.stringify(e)}function Ef(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Vs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nf=Fn(()=>{if(Ae.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function $t(e){if(Kr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Kr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Jn(e){return $t(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function x0(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var k0=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}`)}},zo=new Set(["string","number","symbol"]),jf=new Set(["string","number","bigint","boolean","symbol","undefined"]);function bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ue(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function I(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 w0(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function x(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Af(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Po={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]},To={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function s_(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Jr(o,e,qs(e,t)),ue(e,_t(n,{shape:o,checks:[]}))}function qs(e,t){let n=or(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function c_(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(qs(e,t)),a={};return Jr(a,e,Reflect.ownKeys(or(e)).filter(s=>!o.has(s))),ue(e,_t(n,{shape:a,checks:[]}))}function u_(e,t){if(!$t(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=or(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ue(e,_t(e._zod.def,{shape:l_(e,t)}))}function l_(e,t){let n={};return Jr(n,e,Reflect.ownKeys(or(e))),v0(n,t),n}function d_(e,t){if(!$t(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ue(e,_t(e._zod.def,{shape:l_(e,t)}))}function f_(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Jr(n,e,Reflect.ownKeys(or(e))),Jr(n,t,Reflect.ownKeys(or(t)));let i=_t(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ue(e,i)}function p_(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let s=n?new Set(qs(t,n)):void 0,c={};return Jr(c,t,Reflect.ownKeys(or(t)),e&&((u,l)=>s&&!s.has(l)?u:new e({type:"optional",innerType:u}))),ue(t,_t(t._zod.def,{shape:c,checks:[]}))}function m_(e,t,n){let i=n?new Set(qs(t,n)):void 0,r={};return Jr(r,t,Reflect.ownKeys(or(t)),(o,a)=>i&&!i.has(a)?o:new e({type:"nonoptional",innerType:o})),ue(t,_t(t._zod.def,{shape:r}))}function We(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Df(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function nt(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ln(e){return typeof e=="string"?e:e?.message}function Kn(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}function Oo(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function it(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let o=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Ln(e.inst?._zod.def?.error?.(e))??Ln(o?.(e))??Ln(t?.error?.(e))??Ln(n.customError?.(e))??Ln(n.localeError?.(e))??"Invalid input",s={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(s[c]=e[c]);return s.path??(s.path=[]),s.message=a,t?.reportInput&&(s.input=e.input),s}function Eo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var S0=/[\uD800-\uDBFF]/;function Gr(e){let t=e.length;if(!S0.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}function No(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function k(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 n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Gn(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function I0(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function h_(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function g_(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function z0(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return h_(t+n)}function P0(e){return g_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function T0(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function O0(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Tf=class{constructor(...t){}};function Rf(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):N0(e,n,i.value)}}function Lt(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function jo(e,t,n){return Lt(e,t,n,!1)}function E0(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Lt(this,n,i(this))},set(r){Lt(this,n,r)}})}return t}function N0(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Lt(this,t,n.bind(this))},set(i){Lt(this,t,i)}})}function j0(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var zf,gr=!1,A0={configurable:!0,get(){gr=!0}};function W(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&zf!==e._zod){zf=void 0;return}zf=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,A0);let r=gr;gr=!1;try{let o=n(this);return gr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),gr=gr||r,o}catch(o){throw delete this[t],gr=gr||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function Cf(e,t,n,i){let r=j0(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var Fs="~constantCatch";function Uf(e){let t=()=>e;return t[Fs]=!0,t}var v_,Mf=Object.freeze({status:"aborted"}),Zf={value:void 0,enumerable:!1},y_="captureStackTrace"in Error?Error:null;function D0(e){let t=y_;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return y_=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function g(e,t,n,i){let r={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=r;let a=n,s=a&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Zf.value=new o(p);try{Object.defineProperty(f,"_zod",Zf)}finally{Zf.value=void 0}}if(f._zod.traits.add(e),t(f,p),s){let h=Object.getPrototypeOf(f),y=f._zod.constr.prototype,$=h;for(;$&&$!==y;)$=Object.getPrototypeOf($);let w=$??h;s.has(w)||(s.add(w),Rf(w,a))}let m=d.prototype;for(let h in m)Object.prototype.hasOwnProperty.call(m,h)&&(h in f||(f[h]=m[h].bind(f)))}let u=i?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let p=i?.Parent?D0(l):this;c(p,f);let m=p._zod.deferred;if(m){for(let y of m)y();p._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Lf=Symbol("zod_brand"),ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(v_=globalThis).__zod_globalConfig??(v_.__zod_globalConfig={});var Ae=globalThis.__zod_globalConfig;function Pe(e){return e&&Object.assign(Ae,e),Ae}function R0(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,qn,2)),e.message}function C0(e){this._zod.message=e}var U0={get:R0,set:C0,enumerable:!0,configurable:!0},qf={value:void 0,enumerable:!1},__=new WeakSet([Object.prototype,Error.prototype]),$_=(e,t)=>{e.name="$ZodError",qf.value=t,Object.defineProperty(e,"issues",qf),qf.value=void 0,Object.defineProperty(e,"message",U0);let n=Object.getPrototypeOf(e);__.has(n)||(__.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},Ff=g("$ZodError",$_),at=g("$ZodError",$_,void 0,{Parent:Error});function Z0(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Ao(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?Z0(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Do(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)n._errors.push(t(a));else{let c=n,u=0;for(;u<s.length;){let l=s[u],d=u===s.length-1;if(l==="_errors"){d&&c._errors.push(t(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(a)),c=f,u++}}}};return i(e),n}function Bf(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var a;for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0){n.errors.push(t(s));continue}let u=n,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(t(s)),l++}}};return i(e),n}function b_(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Jf(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${b_(i.path)}`);return t.join(`
10
10
  `)}function Bs(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Hn=e=>{let t=(n,i,r,o)=>{let a=r?{...r,async:!1}:{async:!1},s=n._zod.run({value:i,issues:[]},a);if(s instanceof Promise)throw new ot;if(s.issues.length){let c=new(o?.Err??e)(s.issues.map(u=>it(u,a,Pe())));throw Vs(c,o?.callee??t),c}return s.value};return t},Hr=Hn(at),Wn=e=>{let t=async(n,i,r,o)=>{let a=r?{...r,async:!0}:{async:!0},s=n._zod.run({value:i,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(o?.Err??e)(s.issues.map(u=>it(u,a,Pe())));throw Vs(c,o?.callee??t),c}return s.value};return t},Wr=Wn(at),Xn=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new ot;return o.issues.length?x_(e,o.issues,r):{success:!0,data:o.value}},Yn=Xn(at);function x_(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>it(r,n,Pe()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var Qn=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?x_(e,o.issues,r):{success:!0,data:o.value}},ei=Qn(at),L0=Symbol.for("zod.compile.invalid"),V0=Symbol.for("zod.compile.fallback"),ti=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==L0)return!0;if(i.definite===!0&&n===void 0)return!1}return q0(e,t,n)});function q0(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[V0]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new ot;return o.issues.length===0}var ri=async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},Js=e=>{let t=Hn(e),n=(i,r,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,s,Bs(n,a))};return n},k_=Js(at),Ks=e=>{let t=Hn(e),n=(i,r,o,a)=>t(i,r,o,Bs(n,a));return n},w_=Ks(at),Gs=e=>{let t=Wn(e),n=async(i,r,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,s,Bs(n,a))};return n},S_=Gs(at),Hs=e=>{let t=Wn(e),n=async(i,r,o,a)=>await t(i,r,o,Bs(n,a));return n},I_=Hs(at),Ws=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Xn(e)(t,n,r)},z_=Ws(at),Xs=e=>(t,n,i)=>Xn(e)(t,n,i),P_=Xs(at),Ys=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Qn(e)(t,n,r)},T_=Ys(at),Qs=e=>async(t,n,i)=>Qn(e)(t,n,i),O_=Qs(at);var mt={};er(mt,{anyString:()=>_p,base64:()=>lp,base64url:()=>dp,bigint:()=>bp,boolean:()=>xp,browserEmail:()=>X0,cidrv4:()=>cp,cidrv6:()=>up,creditCard:()=>ec,cuid:()=>Gf,cuid2:()=>Hf,currencyCode:()=>hp,date:()=>gp,datetime:()=>yp,domain:()=>pp,duration:()=>tp,e164:()=>mp,email:()=>np,emoji:()=>ip,extendedDuration:()=>F0,guid:()=>rp,hex:()=>zp,hostname:()=>fp,html5Email:()=>G0,httpProtocol:()=>Ro,iban:()=>tc,idnEmail:()=>W0,integer:()=>Co,ipv4:()=>op,ipv6:()=>ap,ksuid:()=>Yf,lowercase:()=>Sp,mac:()=>sp,md5_base64:()=>tP,md5_base64url:()=>rP,md5_hex:()=>eP,nanoid:()=>Qf,nanoidOfLength:()=>ep,null:()=>kp,number:()=>sr,rfc5322Email:()=>H0,sha1_base64:()=>iP,sha1_base64url:()=>oP,sha1_hex:()=>nP,sha256_base64:()=>sP,sha256_base64url:()=>cP,sha256_hex:()=>aP,sha384_base64:()=>lP,sha384_base64url:()=>dP,sha384_hex:()=>uP,sha512_base64:()=>pP,sha512_base64url:()=>mP,sha512_hex:()=>fP,string:()=>$p,time:()=>vp,ulid:()=>Wf,undefined:()=>wp,unicodeEmail:()=>E_,uppercase:()=>Ip,uuid:()=>Xr,uuid4:()=>B0,uuid6:()=>J0,uuid7:()=>K0,xid:()=>Xf});var Gf=/^[cC][0-9a-z]{6,}$/,Hf=/^[0-9a-z]+$/,Wf=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Xf=/^[0-9a-vA-V]{20}$/,Yf=/^[A-Za-z0-9]{27}$/,Qf=/^[a-zA-Z0-9_-]{21}$/;function ep(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var tp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,F0=/^[-+]?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)?)??$/,rp=/^([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})$/,Xr=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)$/,B0=Xr(4),J0=Xr(6),K0=Xr(7),np=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,G0=/^[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])?)*$/,H0=/^(([^<>()\[\]\\.,;:\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,}))$/,E_=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,W0=E_,X0=/^[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])?)*$/,Y0="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ip(){return new RegExp(Y0,"u")}var op=/^(?:(?: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])$/,ap=/^(([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}|:))$/,sp=e=>{let t=bt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},cp=/^((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])$/,up=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,fp=/^(?=.{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])?)*\.?$/,pp=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Ro=/^https?$/,mp=/^\+[1-9]\d{6,14}$/,ec=/^\d(?:[ -]?\d){11,18}$/,hp=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,tc=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,N_="(?:(?:\\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])))";function Q0(e){return new RegExp(`^${e}$`)}var gp=Q0(N_);function Kf(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vp(e){return new RegExp(`^${Kf(e)}$`)}function yp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Kf({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${Kf({precision:e.precision})}`:n;return new RegExp(`^${N_}T(?:${i})$`)}var _p=/^[\s\S]{0,}$/,$p=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},bp=/^-?\d+n?$/,Co=/^-?\d+$/,sr=/^-?\d+(?:\.\d+)?$/,xp=/^(?:true|false)$/i,kp=/^null$/i;var wp=/^undefined$/i;var Sp=/^[^A-Z]*$/,Ip=/^[^a-z]*$/,zp=/^[0-9a-fA-F]*$/;function Uo(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Zo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var eP=/^[0-9a-fA-F]{32}$/,tP=Uo(22,"=="),rP=Zo(22),nP=/^[0-9a-fA-F]{40}$/,iP=Uo(27,"="),oP=Zo(27),aP=/^[0-9a-fA-F]{64}$/,sP=Uo(43,"="),cP=Zo(43),uP=/^[0-9a-fA-F]{96}$/,lP=Uo(64,""),dP=Zo(64),fP=/^[0-9a-fA-F]{128}$/,pP=Uo(86,"=="),mP=Zo(86);var he=g("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Pp=e=>{let t=e.value;return!Ls(t)&&t.size!==void 0},Tp=e=>{let t=e.value;return!Ls(t)&&t.length!==void 0},rc={number:"number",bigint:"bigint",object:"date"},ic=g("$ZodCheckLessThan",(e,t)=>{he.init(e,t);let n=rc[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:rc[typeof i.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),oc=g("$ZodCheckGreaterThan",(e,t)=>{he.init(e,t);let n=rc[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:rc[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Op=g("$ZodCheckMultipleOf",(e,t)=>{he.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Io(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ep=g("$ZodCheckNumberFormat",(e,t)=>{he.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Po[t.format];e._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:i,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:i,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:i,inclusive:!0,continue:!t.abort});return}}s<r&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:r,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})}}),Np=g("$ZodCheckBigIntFormat",(e,t)=>{he.init(e,t);let[n,i]=To[t.format];e._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),jp=g("$ZodCheckMaxSize",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=Pp),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Eo(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ap=g("$ZodCheckMinSize",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=Pp),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Eo(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Dp=g("$ZodCheckSizeEquals",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=Pp),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let a=o>t.size;i.issues.push({origin:Eo(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Rp=g("$ZodCheckMaxLength",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=Tp),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?Gr(r):o)<=t.maximum)return;let s=No(r);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cp=g("$ZodCheckMinLength",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=Tp),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o<t.minimum*2?Gr(r):o)>=t.minimum)return;let s=No(r);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Up=g("$ZodCheckLengthEquals",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=Tp),e._zod.check=i=>{let r=i.value,o=r.length,a=typeof r=="string"&&o>=t.length&&o<=t.length*2?Gr(r):o;if(a===t.length)return;let s=No(r),c=a>t.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),ni=g("$ZodCheckStringFormat",(e,t)=>{var n,i;he.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Zp=g("$ZodCheckRegex",(e,t)=>{ni.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mp=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Sp),ni.init(e,t)}),Lp=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ip),ni.init(e,t)}),Vp=g("$ZodCheckIncludes",(e,t)=>{he.init(e,t);let n=bt(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),qp=g("$ZodCheckStartsWith",(e,t)=>{he.init(e,t);let n=new RegExp(`^${bt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Fp=g("$ZodCheckEndsWith",(e,t)=>{he.init(e,t);let n=new RegExp(`.*${bt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function nc(e,t,n){e.issues.length&&t.issues.push(...nt(n,e.issues))}var Bp=g("$ZodCheckProperty",(e,t)=>{he.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>nc(r,n,t.property));nc(i,n,t.property)}}),Jp=g("$ZodCheckProperties",(e,t)=>{he.init(e,t),jo(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(a=>[a,t.shape[a]]));let r=i.value,o;for(let[a,s]of n){let c=s._zod.run({value:r[a],issues:[]},{});c instanceof Promise?(o??(o=[]),o.push(c.then(u=>nc(u,i,a)))):nc(c,i,a)}if(o)return Promise.all(o).then(()=>{})}}),Kp=g("$ZodCheckMimeType",(e,t)=>{he.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Gp=g("$ZodCheckOverwrite",(e,t)=>{he.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var Yr=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
11
11
  `).filter(a=>a),r=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
12
12
  ${n.join(`
@@ -68,17 +68,17 @@ ${c}
68
68
  }`,f;try{f=new l(...a,d)(...s)}catch(p){throw new re(`this schema (generated code failed to evaluate: ${p.message})`)}return t?.debug&&(f.code=u),f.definite=i.definite,f}function q(e,t){for(let[i,r]of e.constants)if(r===t)return i;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function en(e,t){return e.definite=!1,q(e,t)}function L(e){return`v${e.varCounter++}`}function ZT(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return Xe;let i=n;return i.issues.length===0?i.value:Xe}function Fe(e,t,n,i,r=!0){let o=e.content.length,a=t.constants.size,s=t.constantCounter,c=t.varCounter;try{return Ie(e,t,n,i,r)}catch(u){if(!(u instanceof re)||!u.islandable)throw u;if(e.content.length=o,t.constants.size>a){let l=Array.from(t.constants.keys()).slice(a);for(let d of l)t.constants.delete(d)}return t.constantCounter=s,t.varCounter=c,MT(e,t,n,i)}}function MT(e,t,n,i){t.definite=!1;let r=q(t,n),o=q(t,ZT),a=L(t);return e.write(`const ${a} = ${o}(${r}, ${i});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var LT=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function VT(e,t,n,i){let r=n._zod.def.checks;if(!r||r.length===0)return i;let o=i;for(let a of r){let s=a._zod.def;if(s.when&&!LT.has(s.check))throw new re('check with a custom "when" condition');switch(s.check){case"greater_than":qT(e,t,s,o);break;case"less_than":FT(e,t,s,o);break;case"multiple_of":BT(e,t,s,o);break;case"number_format":bb(e,s,o);break;case"min_length":{let c=_r(s.minimum,"min_length"),u=dm(e,t,o,`${o}.length >= ${c} && ${o}.length < ${s.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case"max_length":{let c=_r(s.maximum,"max_length"),u=dm(e,t,o,`${o}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case"length_equals":{let c=_r(s.length,"length_equals"),u=dm(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${s.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${_r(s.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${_r(s.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${_r(s.size,"size_equals")}) return INVALID;`);break;case"string_format":o=xb(e,t,s,o);break;case"custom":o=XT(e,t,a,o);break;case"bigint_format":JT(e,s,o);break;case"mime_type":KT(e,t,s,o);break;case"property":HT(e,t,s,o);break;case"properties":GT(e,t,s,o);break;case"overwrite":{let c=L(t);WT(e,t,a,o,c),o=c;break}default:throw new re(`check type ${s.check}`)}}return o}function dm(e,t,n,i){let r=q(t,Gr),o=L(t);return e.write(`const ${o} = typeof ${n} === "string" && ${i} ? ${r}(${n}) : ${n}.length;`),o}function _r(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new re(`${t} bound of type ${typeof e}`);return`${e}`}function $b(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new re("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new re("comparison check with Invalid Date bound");return q(e,t)}throw new re(`comparison check bound of type ${typeof t}`)}function qT(e,t,n,i){let r=n.inclusive?"<":"<=";e.write(`if (${i} ${r} ${$b(t,n.value)}) return INVALID;`)}function FT(e,t,n,i){let r=n.inclusive?">":">=";e.write(`if (${i} ${r} ${$b(t,n.value)}) return INVALID;`)}function BT(e,t,n,i){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new re("multiple_of check with a zero divisor");e.write(`if (${i} % ${n.value}n !== 0n) return INVALID;`)}else{let r=q(t,Io);e.write(`if (${r}(${i}, ${_r(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function bb(e,t,n){let i=t.format;switch(i){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new re(`number format ${i}`)}}function JT(e,t,n){let i=t.format;if(i)switch(i){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new re(`bigint format ${i}`)}}function KT(e,t,n,i){let r=n.mime;if(r&&r.length>0){let o=q(t,new Set(r));e.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function GT(e,t,n,i){if(n.when)throw new re('check with a custom "when" condition');e.write(`if (${i} == null) return INVALID;`);let r=n.shape;for(let o of Reflect.ownKeys(r)){let a=typeof o=="symbol"?q(t,o):He(o),s=L(t);e.write(`const ${s} = ${i}[${a}];`),Fe(e,t,r[o],s,!1)}}function HT(e,t,n,i){let r=`${i}[${JSON.stringify(n.property)}]`;Ie(e,t,n.schema,r)}function WT(e,t,n,i,r){let o=n._zod.def.tx;if(!o)throw new re("overwrite check without a transform function");if(tn(o))throw new Ot("z.compile: async overwrite transforms are not supported");let a=q(t,o);e.write(`const ${r} = ${a}(${i});`)}function fm(){throw new ot}function hm(e){this.issues.push(e)}function XT(e,t,n,i){let r=n._zod.def;if(r.fn){if(tn(r.fn))throw new Ot("z.compile: async .refine() predicates are not supported");let o=en(t,r.fn),a=q(t,fm),s=L(t);return e.write(`const ${s} = ${o}(${i});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`),i}if(n._zod.check){if(tn(n._zod.check))throw new Ot("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,s=en(t,u=>{let l={value:u,issues:[],addIssue:hm};return o(l)instanceof Promise&&fm(),l.issues.length===0?l.value:Xe}),c=L(t);return e.write(`const ${c} = ${s}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new re("custom check without a predicate or check function")}var YT=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function xb(e,t,n,i,r=!0){let o=n.format;if(o==="base64"){let u=q(t,qo);return e.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="base64url"){let u=q(t,jc);return e.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="jwt"){let u=q(t,Mc),l=q(t,n.alg??null);return e.write(`if (!${u}(${i}, ${l})) return INVALID;`),i}if(o==="ipv6"){let u=q(t,Vo);return e.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="cidrv6"){let u=q(t,Tc);return e.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="credit_card"){let u=q(t,Rc);return e.write(`if (!${u}(${i})) return INVALID;`),i}if(o==="iban"){let u=q(t,Uc);return e.write(`if (!${u}(${i})) return INVALID;`),i}let a=n;if(o==="url"||o==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let u=q(t,mc),l=q(t,n),d=L(t),f=L(t);if(e.write(`const ${d} = ${i}.trim();`),e.write(`const ${f} = ${u}(${d}, ${l});`),e.write(`if (typeof ${f} === "number") return INVALID;`),a.hostname!==void 0){let h=q(t,hc);e.write(`if (!${h}(${f}, ${l}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let h=q(t,gc);e.write(`if (!${h}(${f}, ${l}.protocol)) return INVALID;`)}if(!r)return null;let p=L(t),m=a.normalize?`${f}.href`:`${q(t,Lo)}(${d})`;return e.write(`const ${p} = ${m};`),p}let s=n.fn;if(s){if(tn(s))throw new re(`async string format ${o}`);let u=q(t,s);return e.write(`if (!${u}(${i})) return INVALID;`),i}if(YT.has(o)&&n.pattern){let u=q(t,n.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${i})) return INVALID;`),i}let c=n.format;switch(c){case"regex":throw new re("regex format without a pattern");case"lowercase":e.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${i}.includes(${He(n.includes)})) return INVALID;`);break;case"starts_with":{let u=n.prefix;e.write(`if (${i}.slice(0, ${u.length}) !== ${He(u)}) return INVALID;`);break}case"ends_with":{let u=n.suffix;e.write(`if (${i}.slice(-${u.length}) !== ${He(u)}) return INVALID;`);break}default:throw new re(`string format ${c}`)}return i}function Ie(e,t,n,i,r=!0){let o=n._zod.def,a=o.type;if(o.coerce)throw new re(`coercion (z.coerce.${a}())`);let s=r||!!o.checks?.length,c;switch(a){case"string":c=QT(e,t,n,i,s);break;case"number":c=eO(e,n,i);break;case"boolean":c=tO(e,i);break;case"bigint":c=rO(e,n,i);break;case"symbol":c=nO(e,i);break;case"undefined":c=iO(e,i);break;case"null":c=oO(e,i);break;case"any":case"unknown":c=i;break;case"never":e.write("return INVALID;"),c=i;break;case"void":c=aO(e,i);break;case"nan":c=sO(e,i);break;case"date":c=cO(e,i);break;case"object":c=uO(e,t,n,i,s);break;case"optional":c=lO(e,t,n,i,s);break;case"nullable":c=pO(e,t,n,i,s);break;case"array":c=mO(e,t,n,i,s);break;case"literal":c=hO(e,t,n,i);break;case"enum":c=gO(e,t,n,i);break;case"readonly":{let u=vb(e,t,n,i),l=L(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case"success":vb(e,t,n,i),c="true";break;case"default":case"prefault":c=vO(e,t,n,i);break;case"nonoptional":c=yO(e,t,n,i);break;case"tuple":c=_O(e,t,n,i);break;case"union":c=$O(e,t,n,i);break;case"intersection":c=kO(e,t,n,i);break;case"record":c=wO(e,t,n,i);break;case"map":c=IO(e,t,n,i);break;case"set":c=zO(e,t,n,i);break;case"file":c=PO(e,i);break;case"template_literal":c=TO(e,t,n,i);break;case"lazy":c=OO(e,t,n,i);break;case"pipe":c=EO(e,t,n,i);break;case"custom":c=NO(e,t,n,i);break;case"transform":c=DO(e,t,n,i);break;case"catch":c=AO(e,t,n,i);break;default:throw new re(`schema type ${a}`)}return c===null?null:VT(e,t,n,c)}function QT(e,t,n,i,r=!0){e.write(`if (typeof ${i} !== "string") return INVALID;`);let o=n._zod.def;return o.format===void 0?i:xb(e,t,o,i,r)}function eO(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let i=t._zod.def;return i.check==="number_format"&&i.format&&bb(e,{format:i.format},n),n}function tO(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function rO(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let i=t._zod.def;if(i.format)switch(i.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function nO(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function iO(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function oO(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function aO(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function sO(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function cO(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function uO(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let a=o.shape,s=Object.keys(a),c=Object.getOwnPropertySymbols(a),u=c.length?[...s,...c]:s,l=w=>typeof w=="symbol"?q(t,w):He(w),d=w=>typeof w=="symbol"?`[${l(w)}]`:He(w),f=a;if(s.includes("__proto__"))throw new re('object shape key "__proto__"');let p=new Map;for(let w of u){let z=f[w],D=l(w),E=L(t);if(e.write(`const ${E} = ${i}[${D}];`),z._zod.optin!==void 0){let K=L(t);e.write(`let ${K} = (() => {`),e.indented(ke=>{let Yt=Fe(ke,t,z,E);ke.write(`return ${Yt};`)}),e.write("})();"),z._zod.optout==="optional"?(e.write(`if (${K} === INVALID) {`),e.indented(ke=>{ke.write(`if (${D} in ${i}) return INVALID;`),ke.write(`${K} = undefined;`)}),e.write("}")):e.write(`if (${K} === INVALID) return INVALID;`),p.set(w,K)}else{fO(z)&&e.write(`if (!(${D} in ${i})) return INVALID;`);let K=Fe(e,t,z,E,r);K!==null&&p.set(w,K)}}let m=o.catchall,h="none";if(m){let w=m._zod.def.type;if(w==="never"){let z=s.map(D=>`k !== ${He(D)}`).join(" && ")||"true";e.write(`for (const k in ${i}) {`),e.indented(D=>{D.write(`if (${z}) return INVALID;`)}),e.write("}")}else(w==="unknown"||w==="any")&&!m._zod.def.checks?.length?h="passthrough":h="schema"}let y=L(t),$=u.some(w=>gb(f[w])||pm(f[w]));if(!r){if(h==="schema"){let w=s.length>0?q(t,new Set(s)):null;e.write(`for (const k in ${i}) {`),e.indented(z=>{z.write('if (k === "__proto__") continue;'),w&&z.write(`if (${w}.has(k)) continue;`);let D=L(t);z.write(`const ${D} = ${i}[k];`),Fe(z,t,m,D,!1)}),e.write("}")}return null}if($){e.write(`const ${y} = {};`);for(let w of u){let z=l(w),D=p.get(w);pm(f[w])?e.write(`if (${z} in ${i}) ${y}[${z}] = ${D};`):gb(f[w])?e.write(`if (${D} !== undefined || ${z} in ${i}) ${y}[${z}] = ${D};`):e.write(`${y}[${z}] = ${D};`)}}else{let w=u.map(z=>`${d(z)}: ${p.get(z)}`).join(", ");e.write(`const ${y} = { ${w} };`)}if(h!=="none"){let w=s.length>0?q(t,new Set(s)):null;e.write(`for (const k in ${i}) {`),e.indented(z=>{if(z.write('if (k === "__proto__") continue;'),w&&z.write(`if (${w}.has(k)) continue;`),h==="passthrough")z.write(`${y}[k] = ${i}[k];`);else{let D=L(t);z.write(`const ${D} = ${i}[k];`);let E=Fe(z,t,m,D);z.write(`${y}[k] = ${E};`)}}),e.write("}")}return y}function lO(e,t,n,i,r=!0){let o=n._zod.def;if(dO(n))return Ie(e,t,o.innerType,i,r);if(o.innerType._zod.optin==="defaulted"){let s=L(t),c=L(t);return e.write(`let ${s};`),e.write(`if (${i} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let d=Ie(l,t,o.innerType,i);l.write(`return ${d};`)}),u.write("})();"),u.write(`if (${c} !== INVALID) ${s} = ${c};`)}),e.write("} else {"),e.indented(u=>{let l=Ie(u,t,o.innerType,i);u.write(`${s} = ${l};`)}),e.write("}"),s}let a=r?L(t):null;return a&&e.write(`let ${a};`),e.write(`if (${i} !== undefined) {`),e.indented(s=>{let c=Ie(s,t,o.innerType,i,r);a&&c!==null&&s.write(`${a} = ${c};`)}),e.write("}"),a}function dO(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function fO(e){return e._zod.optin===void 0&&Qr(e)}function Qr(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Qr(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Qr(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Qr):!0;case"intersection":return!t.left||!t.right?!0:Qr(t.left)&&Qr(t.right);case"pipe":return t.in?Qr(t.in):!0;default:return!0}}function pm(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function gb(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&fi(e)}function fi(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?fi(t.innerType):!0;case"union":return t.options?t.options.some(fi):!0;case"intersection":return!t.left||!t.right||fi(t.left)||fi(t.right);case"pipe":return t.out?fi(t.out):!0;default:return!0}}function pO(e,t,n,i,r=!0){let o=n._zod.def,a=r?L(t):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${i} !== null) {`),e.indented(s=>{let c=Ie(s,t,o.innerType,i,r);a&&c!==null&&s.write(`${a} = ${c};`)}),e.write("}"),a}function gm(e,t,n){for(let[i,r]of Kn(t._zod.def.checks))e.write(`if (${n} > ${_r(i,r._zod.def.check)}) return INVALID;`)}function mO(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`),gm(e,n,`${i}.length`);let a=r?L(t):null,s=L(t),c=L(t);return a&&e.write(`const ${a} = new Array(${i}.length);`),e.write(`for (let ${s} = 0; ${s} < ${i}.length; ${s}++) {`),e.indented(u=>{u.write(`const ${c} = ${i}[${s}];`);let l=Fe(u,t,o.element,c,r);a&&l!==null&&u.write(`${a}[${s}] = ${l};`)}),e.write("}"),a}function hO(e,t,n,i){let o=n._zod.def.values;if(o.length!==1){let s=q(t,new Set(o));return e.write(`if (!${s}.has(${i})) return INVALID;`),i}let a=o[0];if(typeof a=="number"&&Number.isNaN(a)){let s=q(t,new Set(o));return e.write(`if (!${s}.has(${i})) return INVALID;`),i}if(typeof a=="string")e.write(`if (${i} !== ${He(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${i} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${i} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${i} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${i} !== ${a}n) return INVALID;`);else throw new re(`literal type ${typeof a}`);return i}function gO(e,t,n,i){let r=n._zod.values;if(!r)throw new re("enum schema without enumerated values");let o=q(t,r);return e.write(`if (!${o}.has(${i})) return INVALID;`),i}function vb(e,t,n,i){let r=n._zod.def;return Ie(e,t,r.innerType,i)}function vO(e,t,n,i){let r=n._zod.def,a=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!a)return Ie(e,t,r.innerType,i);let c=q(t,a),u=L(t);return e.write(`let ${u} = ${i};`),e.write(`if (${i} === undefined) ${u} = ${c}();`),Ie(e,t,r.innerType,u)}let s=L(t);if(a){let c=q(t,a),u=q(t,Jn);e.write(`let ${s};`),e.write(`if (${i} === undefined) {`),e.indented(l=>{l.write(`${s} = ${u}(${c}());`)}),e.write("} else {"),e.indented(l=>{let d=Ie(l,t,r.innerType,i);l.write(`${s} = ${d} === undefined ? ${u}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${s};`),e.write(`if (${i} !== undefined) {`),e.indented(c=>{let u=Ie(c,t,r.innerType,i);c.write(`${s} = ${u};`)}),e.write("}");return s}function yO(e,t,n,i){let r=n._zod.def,o=Ie(e,t,r.innerType,i),a=L(t);return e.write(`const ${a} = ${o};`),e.write(`if (${a} === undefined) return INVALID;`),a}function _O(e,t,n,i){let r=n._zod.def,o=r.items,a=r.rest;e.write(`if (!Array.isArray(${i})) return INVALID;`);let s=yb(o,"optin"),c=yb(o,"optout");a?e.write(`if (${i}.length < ${s}) return INVALID;`):e.write(`if (${i}.length < ${s} || ${i}.length > ${o.length}) return INVALID;`);let u=L(t);e.write(`const ${u} = [];`);for(let l=0;l<o.length;l++){let d=o[l];if(l>=c)e.write(`if (${u}.length === ${l}) {`),e.indented(f=>{f.write(`if (${l} < ${i}.length) {`),f.indented(p=>{let m=L(t);p.write(`const ${m} = ${i}[${l}];`);let h=Fe(p,t,d,m);p.write(`${u}[${l}] = ${h};`)}),f.write("} else {"),f.indented(p=>{if(pm(d)){p.write(`${u}.length = ${l};`);return}let m=L(t),h=L(t);p.write(`const ${m} = undefined;`),p.write(`const ${h} = (() => {`),p.indented(y=>{let $=Fe(y,t,d,m);y.write(`return ${$};`)}),p.write("})();"),p.write(`if (${h} === INVALID || ${h} === undefined) ${u}.length = ${l};`),p.write(`else ${u}[${l}] = ${h};`)}),f.write("}")}),e.write("}");else{let f=L(t);e.write(`const ${f} = ${i}[${l}];`);let p=Fe(e,t,d,f);e.write(`${u}[${l}] = ${p};`)}}if(a){let l=L(t),d=L(t);e.write(`for (let ${l} = ${o.length}; ${l} < ${i}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${d} = ${i}[${l}];`);let p=Fe(f,t,a,d);f.write(`${u}[${l}] = ${p};`)}),e.write("}")}return u}function yb(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function $O(e,t,n,i){let r=n._zod.def,o=r.options;if(r.discriminator)return bO(e,t,r,i);if(r.inclusive===!1)throw new re("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),i;if(o.length===1)return Ie(e,t,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(l=>l._zod.def.values)),u=q(t,c);return e.write(`if (!${u}.has(${i})) return INVALID;`),i}let s=L(t);e.write(`let ${s};`);for(let c=0;c<o.length;c++){let u=o[c];c===0?e.write(`${s} = (() => {`):e.write(`if (${s} === INVALID) ${s} = (() => {`),e.indented(l=>{let d=Ie(l,t,u,i);l.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${s} === INVALID) return INVALID;`),s}function bO(e,t,n,i){if(n.unionFallback)throw new re("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),i;let r=L(t),o=L(t);e.write(`const ${r} = ${i}?.[${He(n.discriminator)}];`),e.write(`let ${o};`);let a=!0,s=new Set;for(let c of n.options){let u=c._zod.propValues?.[n.discriminator];if(!u||u.size===0)throw new re("discriminated union option without static discriminator values");for(let f of u){if(s.has(f))throw new re(`duplicate discriminator value ${String(f)}`);s.add(f)}let l=Array.from(u,f=>xO(t,r,f)),d=a?"if":"else if";e.write(`${d} (${l.join(" || ")}) {`),e.indented(f=>{let p=Ie(f,t,c,i);f.write(`${o} = ${p};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),o}function xO(e,t,n){if(typeof n=="string")return`${t} === ${He(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let i=q(e,n);return`${t} === ${i}`}throw new re(`literal discriminator value ${String(n)}`)}function kO(e,t,n,i){let r=n._zod.def;t.definite=!1;let o=Fe(e,t,r.left,i),a=Fe(e,t,r.right,i),s=q(t,ii),c=L(t);return e.write(`const ${c} = ${s}(${o}, ${a});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function wO(e,t,n,i){let r=n._zod.def,o=q(t,$t);e.write(`if (!${o}(${i})) return INVALID;`);let a=L(t),s=L(t),c=L(t);e.write(`const ${a} = {};`);let u=r,l=u.partial?void 0:r.keyType._zod.values;if(l){let p=[];for(let h of l){if(!(typeof h=="string"||typeof h=="number"||typeof h=="symbol"))throw new re(`record key value ${String(h)}`);let y=typeof h=="number"?h.toString():h;if(y==="__proto__")throw new re('record key "__proto__"');p.push(y);let $=q(t,h),w=Ie(e,t,r.keyType,$),z=L(t);e.write(`const ${z} = ${i}[${SO(t,y)}];`);let D=Fe(e,t,r.valueType,z);e.write(`${a}[${w}] = ${D};`)}let m=q(t,new Set(p));return e.write(`for (const ${s} in ${i}) {`),e.indented(h=>{h.write(`if (${m}.has(${s})) continue;`),u.mode==="loose"?h.write(`if (${s} !== "__proto__") ${a}[${s}] = ${i}[${s}];`):h.write("return INVALID;")}),e.write("}"),a}let d=r.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let p=r.mode==="loose",m=Ru(r.keyType);m.definite===!1&&(t.definite=!1);let h=q(t,m),y=q(t,sr),$=L(t);return _b(e,t,i,s,w=>{w.write(`let ${$} = ${h}(${s});`),w.write(`if (${$} === INVALID && typeof ${s} === "string" && ${y}.test(${s})) ${$} = ${h}(Number(${s}));`),p?w.write(`if (${$} === INVALID) { ${a}[${s}] = ${i}[${s}]; continue; }`):w.write(`if (${$} === INVALID) return INVALID;`),w.write(`if (${$} === "__proto__") continue;`);let z=L(t);w.write(`const ${z} = ${i}[${s}];`);let D=Fe(w,t,r.valueType,z);w.write(`${a}[${$}] = ${D};`)}),a}return _b(e,t,i,s,p=>{p.write(`const ${c} = ${i}[${s}];`);let m=Fe(p,t,r.valueType,c);p.write(`${a}[${s}] = ${m};`)},"return INVALID;"),a}function _b(e,t,n,i,r,o){let a=q(t,Object.prototype.propertyIsEnumerable),s=L(t),c=L(t),u=L(t);e.write(`const ${s} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${i} = ${c}[${u}];`),l.write(`if (${i} === "__proto__" || !${a}.call(${n}, ${i})) continue;`),r(l)}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${s}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${i} = ${s}[${u}];`),l.write(`if (!${a}.call(${n}, ${i})) continue;`),o?l.write(o):r(l)}),e.write("}")}function SO(e,t){return typeof t=="string"?He(t):q(e,t)}function IO(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`),gm(e,n,`${i}.size`);let o=L(t),a=L(t),s=L(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${a}, ${s}] of ${i}) {`),e.indented(c=>{let u=Ie(c,t,r.keyType,a),l=Ie(c,t,r.valueType,s);c.write(`${o}.set(${u}, ${l});`)}),e.write("}"),o}function zO(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`),gm(e,n,`${i}.size`);let o=L(t),a=L(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${a} of ${i}) {`),e.indented(s=>{let c=Ie(s,t,r.valueType,a);s.write(`${o}.add(${c});`)}),e.write("}"),o}function PO(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function TO(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.pattern;if(r){let o=q(t,r);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function OO(e,t,n,i){let r=n._zod.def,o=en(t,r.getter),a=q(t,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${a}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let s=L(t);return e.write(`const ${s} = ${a}.parser(${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function EO(e,t,n,i){let r=n._zod.def,o=Ie(e,t,r.in,i);if(r.transform){if(tn(r.transform))throw new Ot("z.compile: async transforms in pipes are not supported");let a=r.transform,c=en(t,l=>{let d={value:l,issues:[],addIssue:hm},f=a(l,d);return f instanceof Promise?Xe:d.issues.length===0?f:Xe}),u=L(t);return e.write(`const ${u} = ${c}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),Ie(e,t,r.out,u)}else return Ie(e,t,r.out,o)}function tn(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function NO(e,t,n,i){let r=n._zod.def;if(r.fn){if(tn(r.fn))throw new Ot("z.compile: async custom predicates are not supported");let o=en(t,r.fn),a=q(t,fm),s=L(t);e.write(`const ${s} = ${o}(${i});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`)}else throw new re("custom schema without a predicate function");return i}function jO(e,t,n){let i=e._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return Xe;let r=i;return r.issues.length===0?r.value:t()}function AO(e,t,n,i){let r=n._zod.def;if(!r.catchValue[Fs])throw new re("catch with a callback (only a constant catch value compiles)",!1);let o=L(t);e.write(`let ${o} = (() => {`),e.indented(u=>{let l=Fe(u,t,r.innerType,i);u.write(`return ${l};`)}),e.write("})();");let a=q(t,r.innerType),s=en(t,r.catchValue),c=q(t,jO);return e.write(`if (${o} === INVALID) {`),e.indented(u=>{u.write(`${o} = ${c}(${a}, ${s}, ${i});`),u.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function DO(e,t,n,i){let r=n._zod.def;if(r.transform){if(tn(r.transform))throw new Ot("z.compile: async transforms are not supported");let o=r.transform,s=en(t,u=>{let l={value:u,issues:[],addIssue:hm},d=o(u,l);return d instanceof Promise?Xe:l.issues.length===0?d:Xe}),c=L(t);return e.write(`const ${c} = ${s}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return i}function Cu(e){return e.checks&&(e.checks=[...e.checks]),e}function Uu(e,t){return new e(Cu({type:"string",...I(t)}))}function vm(e,t){return new e(Cu({type:"string",coerce:!0,...I(t)}))}function ea(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...I(t)})}function ta(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...I(t)})}function ra(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...I(t)})}function na(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(t)})}function ia(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(t)})}function oa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(t)})}function pi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...I(t)})}function aa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...I(t)})}function sa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(t)})}function ca(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...I(t)})}function ua(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(t)})}function la(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...I(t)})}function da(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...I(t)})}function fa(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(t)})}function pa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(t)})}function ma(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(t)})}function Zu(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...I(t)})}function ha(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(t)})}function ga(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(t)})}function va(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...I(t)})}function ya(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...I(t)})}function _a(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...I(t)})}function Mu(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...I(t)})}function Lu(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...I(t)})}function $a(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...I(t)})}var ym={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function ba(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(t)})}function xa(e,t){return new e({type:"string",format:"date",check:"string_format",...I(t)})}function ka(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...I(t)})}function wa(e,t){return new e({type:"string",format:"duration",check:"string_format",...I(t)})}function Vu(e,t){return new e(Cu({type:"number",checks:[],...I(t)}))}function _m(e,t){return new e(Cu({type:"number",coerce:!0,checks:[],...I(t)}))}function qu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...I(t)})}function Fu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...I(t)})}function Bu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...I(t)})}function Ju(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...I(t)})}function Ku(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...I(t)})}function Gu(e,t){return new e({type:"boolean",...I(t)})}function $m(e,t){return new e({type:"boolean",coerce:!0,...I(t)})}function Hu(e,t){return new e({type:"bigint",...I(t)})}function bm(e,t){return new e({type:"bigint",coerce:!0,...I(t)})}function Wu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(t)})}function Xu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(t)})}function Yu(e,t){return new e({type:"symbol",...I(t)})}function Qu(e,t){return new e({type:"undefined",...I(t)})}function el(e,t){return new e({type:"null",...I(t)})}function tl(e){return new e({type:"any"})}function rl(e){return new e({type:"unknown"})}function nl(e,t){return new e({type:"never",...I(t)})}function il(e,t){return new e({type:"void",...I(t)})}function ol(e,t){return new e({type:"date",...I(t)})}function xm(e,t){return new e({type:"date",coerce:!0,...I(t)})}function al(e,t){return new e({type:"nan",...I(t)})}function Vt(e,t){return new ic({check:"less_than",...I(t),value:e,inclusive:!1})}function ht(e,t){return new ic({check:"less_than",...I(t),value:e,inclusive:!0})}function qt(e,t){return new oc({check:"greater_than",...I(t),value:e,inclusive:!1})}function gt(e,t){return new oc({check:"greater_than",...I(t),value:e,inclusive:!0})}function sl(e){return qt(0,e)}function cl(e){return Vt(0,e)}function ul(e){return ht(0,e)}function ll(e){return gt(0,e)}function $r(e,t){return new Op({check:"multiple_of",...I(t),value:e})}function br(e,t){return new jp({check:"max_size",...I(t),maximum:e})}function Ft(e,t){return new Ap({check:"min_size",...I(t),minimum:e})}function rn(e,t){return new Dp({check:"size_equals",...I(t),size:e})}function nn(e,t){return new Rp({check:"max_length",...I(t),maximum:e})}function cr(e,t){return new Cp({check:"min_length",...I(t),minimum:e})}function on(e,t){return new Up({check:"length_equals",...I(t),length:e})}function mi(e,t){return new Zp({check:"string_format",format:"regex",...I(t),pattern:e})}function hi(e){return new Mp({check:"string_format",format:"lowercase",...I(e)})}function gi(e){return new Lp({check:"string_format",format:"uppercase",...I(e)})}function vi(e,t){return new Vp({check:"string_format",format:"includes",...I(t),includes:e})}function yi(e,t){return new qp({check:"string_format",format:"starts_with",...I(t),prefix:e})}function _i(e,t){return new Fp({check:"string_format",format:"ends_with",...I(t),suffix:e})}function dl(e,t,n){return new Bp({check:"property",property:e,schema:t,...I(n)})}function $i(e,t){return new Jp({check:"properties",shape:e,...I(t)})}function bi(e,t){return new Kp({check:"mime_type",mime:e,...I(t)})}function Et(e){return new Gp({check:"overwrite",tx:e})}function xi(e){return Et(t=>t.normalize(e))}function ki(){return Et(e=>e.trim())}function wi(){return Et(e=>e.toLowerCase())}function Si(){return Et(e=>e.toUpperCase())}function Ii(){return Et(e=>Ef(e))}function km(e,t,n){return new e({type:"array",element:t,...I(n)})}function RO(e,t,n){return new e({type:"union",options:t,...I(n)})}function CO(e,t,n){return new e({type:"union",options:t,inclusive:!1,...I(n)})}function UO(e,t,n,i){return new e({type:"union",options:n,discriminator:t,...I(i)})}function ZO(e,t,n){return new e({type:"intersection",left:t,right:n})}function MO(e,t,n,i){let r=n instanceof B,o=r?i:n,a=r?n:null;return new e({type:"tuple",items:t,rest:a,...I(o)})}function LO(e,t,n,i){return new e({type:"record",keyType:t,valueType:n,...I(i)})}function VO(e,t,n,i){return new e({type:"map",keyType:t,valueType:n,...I(i)})}function qO(e,t,n){return new e({type:"set",valueType:t,...I(n)})}function FO(e,t,n){let i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:i,...I(n)})}function BO(e,t,n){return new e({type:"enum",entries:t,...I(n)})}function JO(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...I(n)})}function fl(e,t){return new e({type:"file",...I(t)})}function KO(e,t){return new e({type:"transform",transform:t})}function GO(e,t){return new e({type:"optional",innerType:t})}function HO(e,t){return new e({type:"nullable",innerType:t})}function WO(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Jn(n)}})}function XO(e,t,n){return new e({type:"nonoptional",innerType:t,...I(n)})}function YO(e,t){return new e({type:"success",innerType:t})}function QO(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:Uf(n)})}function eE(e,t,n){return new e({type:"pipe",in:t,out:n})}function tE(e,t){return new e({type:"readonly",innerType:t})}function rE(e,t,n){return new e({type:"template_literal",parts:t,...I(n)})}function nE(e,t){return new e({type:"lazy",getter:t})}function iE(e,t){return new e({type:"promise",innerType:t})}function pl(e,t,n){let i=I(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function ml(e,t,n){return new e({type:"custom",check:"custom",fn:t,...I(n)})}function hl(e,t){let n=kb(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Gn(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Gn(o))}},e(i.value,i)),t);return n}function kb(e,t){let n=new he({check:"custom",...I(t)});return n._zod.check=e,n}function gl(e){let t=new he({check:"describe"});return t._zod.onattach=[n=>{let i=Re.get(n)??{};Re.add(n,{...i,description:e})}],t._zod.check=()=>{},t}function vl(e){let t=new he({check:"meta"});return t._zod.onattach=[n=>{let i=Re.get(n)??{};Re.add(n,{...i,...e})}],t._zod.check=()=>{},t}function yl(e,t){let n=I(t),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(p=>typeof p=="string"?p.toLowerCase():p),r=r.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(i),a=new Set(r),s=e.Codec??si,c=e.Boolean??oi,u=e.String??yr,l=new u({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),f=new s({type:"pipe",in:l,out:d,transform:((p,m)=>{let h=p;return n.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:a.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?i[0]||"true":r[0]||"false"),error:n.error});return f._zod.bag.truthy=i,f._zod.bag.falsy=r,f._zod.bag.case=n.case??"insensitive",f}function xr(e,t,n,i={}){let r=I(i),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:s=>n.test(s),...r};return n instanceof RegExp&&(o.pattern=n),new e(o)}function Sa(e,...t){for(let n of t)for(let i of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,i)&&De(e,i,n[i]);return e}function kr(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??Re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Ee(e,t,n,i,r){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:i.path,message:r}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(r);return Object.assign(n,o),!0}function pe(e,t,n={path:[],schemaPath:[]}){var i;let r=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,l);else{let f=a.schema,p=t.processors[r.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);p(e,t,f,l)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),pe(d,t,l),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Sa(a.schema,c),t.io==="input"&&Ye(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function wb(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function wr(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let i=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=i.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.`);i.set(s,a[0])}}let r=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};let p=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=p,{defId:p,ref:`${f("__shared")}#/${s}/${wb(p)}`}}let c="#",u=`${c}/${s}/`;if(a[1]===n&&!a[1].schema.id)return{ref:c};let l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+wb(l)}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=r(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>
69
69
 
70
70
  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}s.count>1&&e.reused==="ref"&&o(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function zb(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let i of t){if(!i||typeof i!="object")return;zb(i);let r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;let o=i.type;for(let a of Array.isArray(o)?o:[o]){if(typeof a!="string")return;n.includes(a)||n.push(a)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Pb=new Set(["type","properties","required","additionalProperties"]),Sb=["oneOf","anyOf"];function Ib(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function wm(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let a in o)if(!Pb.has(a))return null;t.push(o)}let n={},i=new Set;for(let o of t){for(let a in o.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;let s=[];for(let u of t){let l=u.properties?.[a]??Ib(u);l!=null&&(s.some(d=>JSON.stringify(d)===JSON.stringify(l))||s.push(l))}let c=s.length===1?s[0]:wm(s)??{allOf:s};De(n,a,c)}for(let a of o.required??[])i.add(a)}let r={type:"object",properties:n};if(i.size&&(r.required=[...i]),t.every(o=>o.additionalProperties===!1))r.additionalProperties=!1;else{let o=[];for(let a of t){let s=Ib(a);s&&!o.some(c=>JSON.stringify(c)===JSON.stringify(s))&&o.push(s)}o.length===1?r.additionalProperties=o[0]:o.length>1&&(r.additionalProperties={allOf:o})}return r}function oE(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let r of Pb)if(r in e)return;let n=t.filter(r=>Sb.some(o=>Array.isArray(r[o]))),i=null;if(!n.length)i=wm(t);else{let r=n[0],o=Sb.find(c=>Array.isArray(r[c]));if(Object.keys(r).length!==1)return;let a=t.filter(c=>c!==r),s=r[o].map(c=>wm([...a,c]));if(s.some(c=>!c))return;i={[o]:s}}i&&(delete e.allOf,Sa(e,i))}function Sr(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let c=e.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){i(d);let p=e.seen.get(d),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Sa(u,m),Sa(u,l),s._zod.parent===d)for(let y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(m.$ref&&p.def)for(let y in u)y==="$ref"||y==="allOf"||y in p.def&&JSON.stringify(u[y])===JSON.stringify(p.def[y])&&delete u[y]}let f=s._zod.parent;if(f&&f!==d){i(f);let p=e.seen.get(f);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.def[m])&&delete u[m]}e.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let s of[...e.seen.entries()].reverse())i(s[0]);if(e.target!=="openapi-3.0")for(let s of e.seen.entries())zb(s[1].def??s[1].schema);for(let s of e.deferred)s();if(e.intersections.length){let s=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=s.get(l);d?d.push(u):s.set(l,[u])}for(let c of e.intersections)for(let u of s.get(c)??[])oE(u)}}let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(s)}Sa(r,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&r.id===o&&delete r.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,De(a,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?r.$defs=a:r.definitions=a);try{let s=JSON.parse(JSON.stringify(r));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:zi(t,"input",e.processors),output:zi(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Ye(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Ye(i.element,n);if(i.type==="set")return Ye(i.valueType,n);if(i.type==="lazy")return Ye(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return Ye(i.innerType,n);if(i.type==="intersection")return Ye(i.left,n)||Ye(i.right,n);if(i.type==="record"||i.type==="map")return Ye(i.keyType,n)||Ye(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ye(i.in,n)||Ye(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Ye(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Ye(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Ye(r,n))return!0;return!!(i.rest&&Ye(i.rest,n))}return!1}var Sm=(e,t={})=>n=>{let i=kr({...n,processors:t});return pe(e,i),wr(i,e),Sr(i,e)},zi=(e,t,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},a=kr({...r??{},target:o,io:t,processors:n});return pe(e,a),wr(a,e),Sr(a,e)};var Pi=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ti=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Tb=(e,t)=>{Pi(e,"minimum",t),Ti(e,"maximum",t)},jb=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Ab=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Db=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},Rb=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Ob=(e,t)=>Pi(e,"minimum",t.minimum),Eb=(e,t)=>Ti(e,"maximum",t.maximum),Nb=e=>(t,n)=>{Rb(t,n.format);let[i,r]=e[n.format];Pi(t,"minimum",i),Ti(t,"maximum",r)},aE={greater_than:(e,t)=>Pi(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Ti(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>jb(e,t.value),number_format:Nb(Po),bigint_format:Nb(To),min_length:Ob,max_length:Eb,length_equals:(e,t)=>Tb(e,t.length),min_size:Ob,max_size:Eb,size_equals:(e,t)=>Tb(e,t.size),string_format:(e,t)=>{Rb(e,t.format),t.pattern&&Ab(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Db(e,t.mime)};function Ne(e){let t={},n=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of i)aE[o._zod.def.check]?.(t,o._zod.def);let r=e._zod.bag;r.minimum!==void 0&&Pi(t,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&Pi(t,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&Ti(t,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&Ti(t,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&jb(t,r.multipleOf),r.format!==void 0&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&Db(t,r.mime);for(let o of r.patterns??[])Ab(t,o);return t}var sE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},cE=new Map([[Ec,lp],[Fo,dp]]),Cb=e=>cE.get(e)??e,Pm=(e,t,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:u,laxFormat:l}=Ne(e);if(typeof o=="number"&&(r.minLength=o),typeof a=="number"&&(r.maxLength=a),s&&(r.format=sE[s]??s,r.format===""&&delete r.format,(s==="time"||l)&&delete r.format),u&&(r.contentEncoding=u),c&&c.size>0){let d=[...c].map(Cb);d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Tm=(e,t,n,i)=>{let r=n,{minimum:o,maximum:a,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=Ne(e);r.type=l?"integer":"number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(d?p?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u:typeof o=="number"&&(r.minimum=o),f?p?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof a=="number"&&(r.maximum=a),s){let m=new Set;for(let $ of s)Number.isFinite($)&&$!==0?m.add(Math.abs($)):Ee(e,t,r,i,`A multipleOf divisor of ${$} cannot be represented in JSON Schema`);let[h,...y]=m;h!==void 0&&(r.multipleOf=h),y.length&&(r.allOf=[...r.allOf??[],...y.map($=>({multipleOf:$}))])}},Om=(e,t,n,i)=>{n.type="boolean"},Em=(e,t,n,i)=>{Ee(e,t,n,i,"BigInt cannot be represented in JSON Schema")},Nm=(e,t,n,i)=>{Ee(e,t,n,i,"Symbols cannot be represented in JSON Schema")},jm=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Am=(e,t,n,i)=>{Ee(e,t,n,i,"Undefined cannot be represented in JSON Schema")},Dm=(e,t,n,i)=>{Ee(e,t,n,i,"Void cannot be represented in JSON Schema")},Rm=(e,t,n,i)=>{n.not={}},Cm=(e,t,n,i)=>{},Um=(e,t,n,i)=>{},Zm=(e,t,n,i)=>{Ee(e,t,n,i,"Date cannot be represented in JSON Schema")},Mm=(e,t,n,i)=>{let r=e._zod.def,o=Vn(r.entries);if(o.length===0){n.not={};return}o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),n.enum=o},Lm=(e,t,n,i)=>{let r=e._zod.def;if(r.values.length===0){n.not={};return}let o=[];for(let a of r.values)if(a===void 0){if(Ee(e,t,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(Ee(e,t,n,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),o.every(a=>typeof a=="boolean")&&(n.type="boolean"),o.every(a=>a===null)&&(n.type="null"),n.enum=o},Vm=(e,t,n,i)=>{Ee(e,t,n,i,"NaN cannot be represented in JSON Schema")},qm=(e,t,n,i)=>{let r=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},Fm=(e,t,n,i)=>{let r=n;r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:o,maximum:a,mime:s}=Ne(e);o!==void 0&&(r.minLength=o),a!==void 0&&(r.maxLength=a),s&&(s.length===0?r.not={}:s.length===1?r.contentMediaType=s[0]:r.anyOf=s.map(c=>({contentMediaType:c})))},Bm=(e,t,n,i)=>{n.type="boolean"},Jm=(e,t,n,i)=>{Ee(e,t,n,i,"Custom types cannot be represented in JSON Schema")},Km=(e,t,n,i)=>{Ee(e,t,n,i,"Function types cannot be represented in JSON Schema")},Gm=(e,t,n,i)=>{Ee(e,t,n,i,"Transforms cannot be represented in JSON Schema")},Hm=(e,t,n,i)=>{Ee(e,t,n,i,"Map cannot be represented in JSON Schema")},Wm=(e,t,n,i)=>{Ee(e,t,n,i,"Set cannot be represented in JSON Schema")},Xm=(e,t,n,i)=>{let r=n,o=e._zod.def,{minimum:a,maximum:s}=Ne(e);typeof a=="number"&&(r.minItems=a),typeof s=="number"&&(r.maxItems=s),r.type="array",r.items=pe(o.element,t,{...i,path:[...i.path,"items"]})};function Ia(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Ia(t.out):t.type==="catch"?Ia(t.innerType):e._zod.optin}var Ym=(e,t,n,i)=>{let r=n,o=e._zod.def,a=o.shape;if(Object.getOwnPropertySymbols(a).length&&Ee(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(let u in a)De(r.properties,u,pe(a[u],t,{...i,path:[...i.path,"properties",u]}));let c=[];for(let u of Object.keys(a)){let l=o.shape[u];(t.io==="input"?Ia(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(r.required=c),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=pe(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},$l=(e,t,n,i)=>{let r=e._zod.def,o=r.inclusive===!1,a=r.options.map((s,c)=>pe(s,t,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=a:n.anyOf=a},Qm=(e,t,n,i)=>{let r=e._zod.def,o=pe(r.left,t,{...i,path:[...i.path,"allOf",0]}),a=pe(r.right,t,{...i,path:[...i.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];n.allOf=c,t.intersections.push(c)},eh=(e,t,n,i)=>{let r=n,o=e._zod.def;r.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((h,y)=>pe(h,t,{...i,path:[...i.path,a,y]})),u=o.rest?pe(o.rest,t,{...i,path:[...i.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,l=o.items.length;for(;l>0;){let h=o.items[l-1];if(!(t.io==="input"?Ia(h)!==void 0:h._zod.optout==="optional"))break;l--}let d=o.items.length,f=!o.rest;t.target==="draft-2020-12"?(r.prefixItems=c,f?r.items=!1:u&&(r.items=u),l>0&&(r.minItems=l),f&&(r.maxItems=d)):t.target==="openapi-3.0"?(r.items={anyOf:c},u&&r.items.anyOf.push(u),l>0&&(r.minItems=l),f&&(r.maxItems=d)):(r.items=c,f?r.additionalItems=!1:u&&(r.additionalItems=u),l>0&&(r.minItems=l),f&&(r.maxItems=d));let{minimum:p,maximum:m}=Ne(e);typeof p=="number"&&(r.minItems=p),typeof m=="number"&&(r.maxItems=m)};function Im(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let h=Im(e,m,n);return h===m?t:h}for(let m of["anyOf","oneOf"]){let h=t[m];if(!Array.isArray(h))continue;let y=h.map($=>Im(e,$,n));y.some(($,w)=>$!==h[w])&&(t={...t,[m]:y})}let i=Array.isArray(t.type)?t.type:[t.type],r=!i.includes("string")&&i.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!r&&!o?.some(m=>typeof m=="number"))return t;let{minimum:a,maximum:s,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),r&&(p.type="string",o||(p.pattern=(i.includes("number")?sr:Co).source)),p}var zm=new WeakMap;function uE(e){let t=new Map;for(let i of e.seen.values())i.def&&!t.has(i.schema)&&t.set(i.schema,i);let n=new Map;for(let i of zm.get(e)??[]){let r=e.seen.get(i),o=(r?.def??r?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let a=Im(t,o,new Set);a!==o&&n.set(o,a)}if(n.size)for(let i of e.seen.values())for(let r of[i.schema,i.def]){let o=r&&n.get(r.propertyNames);o&&(r.propertyNames=o)}}var th=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="object";let a=o.keyType,s=Ne(a).patterns;if(o.mode==="loose"&&s&&s.size>0){let l=pe(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of s)De(r.patternProperties,Cb(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){r.propertyNames=pe(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});let l=zm.get(t);l||(l=[],zm.set(t,l),t.deferred.push(()=>uE(t))),l.push(e)}r.additionalProperties=pe(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let c=a._zod.values,u=t.io==="input"&&Ia(o.valueType)!==void 0;if(c&&!o.partial&&!u){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(r.required=l.map(String))}},rh=(e,t,n,i)=>{let r=e._zod.def,o=pe(r.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},nh=(e,t,n,i)=>{let r=e._zod.def;pe(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},ih=Symbol();function Ub(e,t,n,i,r){let o=!1,a=JSON.stringify(e,(s,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(Ee(t,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),ih):JSON.parse(a)}var oh=(e,t,n,i)=>{let r=e._zod.def;pe(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let a=Ub(r.defaultValue,e,t,n,i);a!==ih&&(n.default=a)},ah=(e,t,n,i)=>{let r=e._zod.def;pe(r.innerType,t,i);let o=t.seen.get(e);if(o.ref=r.innerType,t.io!=="input")return;let a=Ub(r.defaultValue,e,t,n,i);a!==ih&&(n._prefault=a)},sh=(e,t,n,i)=>{let r=e._zod.def;pe(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{Ee(e,t,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=a},ch=(e,t,n,i)=>{let r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?o?r.out:r.in:r.out;pe(a,t,i);let s=t.seen.get(e);s.ref=a},uh=(e,t,n,i)=>{let r=e._zod.def;pe(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,n.readOnly=!0},lh=(e,t,n,i)=>{let r=e._zod.def;pe(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},bl=(e,t,n,i)=>{let r=e._zod.def;pe(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},dh=(e,t,n,i)=>{let r=e._zod.innerType;pe(r,t,i);let o=t.seen.get(e);o.ref=r},_l={string:Pm,number:Tm,boolean:Om,bigint:Em,symbol:Nm,null:jm,undefined:Am,void:Dm,never:Rm,any:Cm,unknown:Um,date:Zm,enum:Mm,literal:Lm,nan:Vm,template_literal:qm,file:Fm,success:Bm,custom:Jm,function:Km,transform:Gm,map:Hm,set:Wm,array:Xm,object:Ym,union:$l,intersection:Qm,tuple:eh,record:th,nullable:rh,nonoptional:nh,default:oh,prefault:ah,catch:sh,pipe:ch,readonly:uh,promise:lh,optional:bl,lazy:dh};function an(e,t){if("_idmap"in e){let i=e,r=kr({...t,processors:_l}),o={};for(let c of i._idmap.entries()){let[u,l]=c;pe(l,r)}let a={},s={registry:i,uri:t?.uri,defs:o};r.external=s;for(let c of i._idmap.entries()){let[u,l]=c;wr(r,l),De(a,u,Sr(r,l))}if(Object.keys(o).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:o}}return{schemas:a}}let n=kr({...t,processors:_l});return pe(e,n),wr(n,e),Sr(n,e)}var xl=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=kr({processors:_l,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return pe(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,wr(this.ctx,t);let i=Sr(this.ctx,t),{"~standard":r,...o}=i;return o}};var Zb={};var fE=g("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");B.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){Lt(this,"with",e)},parse(e,t){return Hr(this,e,t,{callee:this.parse})},parseAsync(e,t){return Wr(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Yn(this,e,t)},safeParseAsync(e,t){return ei(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0})},clone(e,t){return ue(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}});var pE=g("ZodMiniObject",(e,t)=>{eu.init(e,t),fE.init(e,t),Cf(e,"shape",n=>n._zod.def.shape,!1)});function fh(e,t){let n={type:"object",shape:e??{},...I(t)};return new pE(n)}var Mb=Symbol("z.visit/resolving");function za(e,t){let n=typeof t=="function"?t:(a,s)=>{let c=t[a._zod.def.type];return c?c(a,s):a},i=new Map;function r(a){let s=i.get(a);if(s===Mb)return new ci({type:"lazy",getter:()=>i.get(a)});if(s!==void 0)return s;i.set(a,Mb);let c=o(a),u=n(c,c!==a);return i.set(a,u),u}function o(a){let s=a._zod.def,c=s.type;switch(c){case"object":{let u=s.shape,l=Object.keys(u),d=!1,f={};for(let m of l){let h=r(u[m]);h!==u[m]&&(d=!0),f[m]=h}let p=s.catchall;return s.catchall&&(p=r(s.catchall),p!==s.catchall&&(d=!0)),d?ue(a,{...s,shape:f,catchall:p}):a}case"array":{let u=r(s.element);return u===s.element?a:ue(a,{...s,element:u})}case"tuple":{let u=s.items,l=!1,d=[];for(let p of u){let m=r(p);m!==p&&(l=!0),d.push(m)}let f=s.rest;return s.rest&&(f=r(s.rest),f!==s.rest&&(l=!0)),l?ue(a,{...s,items:d,rest:f}):a}case"record":case"map":{let u=r(s.keyType),l=r(s.valueType);return u===s.keyType&&l===s.valueType?a:ue(a,{...s,keyType:u,valueType:l})}case"set":{let u=r(s.valueType);return u===s.valueType?a:ue(a,{...s,valueType:u})}case"union":{let u=s.options,l=!1,d=[];for(let f of u){let p=r(f);p!==f&&(l=!0),d.push(p)}return l?ue(a,{...s,options:d}):a}case"intersection":{let u=r(s.left),l=r(s.right);return u===s.left&&l===s.right?a:ue(a,{...s,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=r(s.innerType);return u===s.innerType?a:ue(a,{...s,innerType:u})}case"pipe":{let u=r(s.in),l=r(s.out);return u===s.in&&l===s.out?a:ue(a,{...s,in:u,out:l})}case"function":{let u=r(s.input),l=r(s.output);return u===s.input&&l===s.output?a:ue(a,{...s,input:u,output:l})}case"lazy":{let u=s.getter,{_cachedInner:l,...d}=s;return ue(a,{...d,getter:()=>r(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return r(e)}function Bt(e){return!!e._zod}function sn(e){let t=Object.values(e);if(t.length===0)return fh({});let n=t.every(Bt),i=t.every(r=>!Bt(r));if(n)return fh(e);if(i)return n_(e);throw new Error("Mixed Zod versions detected in object shape.")}function Ir(e,t){return Bt(e)?Yn(e,t):e.safeParse(t)}async function kl(e,t){return Bt(e)?await ei(e,t):await e.safeParseAsync(t)}function zr(e){if(!e)return;let t;if(Bt(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Oi(e){if(e){if(typeof e=="object"){let t=e,n=e;if(!t._def&&!n._zod){let i=Object.values(e);if(i.length>0&&i.every(r=>typeof r=="object"&&r!==null&&(r._def!==void 0||r._zod!==void 0||typeof r.parse=="function")))return sn(e)}}if(Bt(e)){let n=e._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function hE(e){return e.length===0?"object root":e.reduce((t,n,i)=>i===0?String(n):typeof n=="number"?`${t}[${n}]`:`${t}.${n}`,"")}function wl(e){if(e&&typeof e=="object"){if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0)return e.issues.map(t=>t.path?.length?`${t.message} at ${hE(t.path)}`:t.message).join(`
71
- `);if("message"in e&&typeof e.message=="string")return e.message;try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function Lb(e){return e.description}function Vb(e){if(Bt(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function Ei(e){if(Bt(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 n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let i=e.value;if(i!==void 0)return i}var $e={};er($e,{$brand:()=>Lf,$input:()=>lm,$output:()=>um,INVALID:()=>Xe,NEVER:()=>Mf,TimePrecision:()=>ym,ZodAny:()=>Eh,ZodArray:()=>Dh,ZodBase64:()=>ql,ZodBase64URL:()=>Fl,ZodBigInt:()=>Ci,ZodBigIntFormat:()=>Kl,ZodBoolean:()=>Ri,ZodCIDRv4:()=>Ll,ZodCIDRv6:()=>Vl,ZodCUID:()=>Al,ZodCUID2:()=>Dl,ZodCatch:()=>eg,ZodCodec:()=>Ra,ZodCompileAsyncError:()=>Ot,ZodCompileUnsupportedError:()=>re,ZodCreditCard:()=>Ih,ZodCustom:()=>Ca,ZodCustomStringFormat:()=>un,ZodDate:()=>Ea,ZodDefault:()=>Gh,ZodDiscriminatedUnion:()=>Ch,ZodE164:()=>Bl,ZodEmail:()=>Ol,ZodEmoji:()=>Nl,ZodEnum:()=>ji,ZodError:()=>gE,ZodExactOptional:()=>Wl,ZodFile:()=>Fh,ZodFirstPartyTypeKind:()=>mg,ZodFunction:()=>lg,ZodGUID:()=>El,ZodIBAN:()=>zh,ZodIPv4:()=>Zl,ZodIPv6:()=>Ml,ZodISODate:()=>Tr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Er,ZodISOTime:()=>Or,ZodInstanceOf:()=>pg,ZodIntersection:()=>Uh,ZodIssueCode:()=>_E,ZodJWT:()=>Jl,ZodKSUID:()=>Ul,ZodLazy:()=>sg,ZodLiteral:()=>qh,ZodMAC:()=>Sh,ZodMap:()=>Lh,ZodNaN:()=>rg,ZodNanoID:()=>jl,ZodNever:()=>jh,ZodNonOptional:()=>Xl,ZodNull:()=>Oh,ZodNullable:()=>Kh,ZodNumber:()=>Di,ZodNumberFormat:()=>ln,ZodObject:()=>Na,ZodOptional:()=>dn,ZodPipe:()=>Da,ZodPrefault:()=>Wh,ZodPreprocess:()=>ng,ZodPromise:()=>ug,ZodReadonly:()=>ig,ZodRealError:()=>st,ZodRecord:()=>Ni,ZodSet:()=>Vh,ZodString:()=>Ai,ZodStringFormat:()=>ve,ZodSuccess:()=>Qh,ZodSymbol:()=>Ph,ZodTemplateLiteral:()=>ag,ZodTransform:()=>Bh,ZodTuple:()=>Zh,ZodType:()=>H,ZodULID:()=>Rl,ZodURL:()=>Ta,ZodUUID:()=>Jt,ZodUndefined:()=>Th,ZodUnion:()=>ja,ZodUnknown:()=>Nh,ZodVoid:()=>Ah,ZodXID:()=>Cl,ZodXor:()=>Rh,_ZodString:()=>Tl,_default:()=>Hh,_function:()=>Wx,any:()=>Ex,array:()=>ee,base64:()=>dx,base64url:()=>fx,bigint:()=>Ix,boolean:()=>Te,catch:()=>tg,check:()=>Xx,cidrv4:()=>ux,cidrv6:()=>lx,clone:()=>ue,codec:()=>Jx,coerce:()=>gg,compile:()=>mm,config:()=>Pe,core:()=>Nt,creditCard:()=>mx,cuid:()=>tx,cuid2:()=>rx,currencyCode:()=>$x,custom:()=>Yl,date:()=>jx,decode:()=>yh,decodeAsync:()=>$h,deepPartial:()=>ck,describe:()=>Yx,discriminatedUnion:()=>Aa,e164:()=>px,email:()=>Bb,emoji:()=>Qb,encode:()=>vh,encodeAsync:()=>_h,endsWith:()=>_i,enum:()=>Ue,exactOptional:()=>Jh,file:()=>Vx,flattenError:()=>Ao,float32:()=>xx,float64:()=>kx,formatError:()=>Do,fromJSONSchema:()=>sk,function:()=>Wx,getDiscriminatedOption:()=>om,getErrorMap:()=>bE,globalRegistry:()=>Re,gt:()=>qt,gte:()=>gt,guid:()=>Jb,hash:()=>bx,hex:()=>_x,hostname:()=>yx,httpUrl:()=>Yb,iban:()=>hx,includes:()=>vi,input:()=>lk,instanceof:()=>ek,int:()=>zl,int32:()=>wx,int64:()=>zx,intersection:()=>Ui,invertCodec:()=>Kx,ipv4:()=>ax,ipv6:()=>cx,iso:()=>fn,json:()=>rk,jwt:()=>gx,keyof:()=>Ax,ksuid:()=>ox,lazy:()=>cg,length:()=>on,literal:()=>U,locales:()=>di,looseObject:()=>Ce,looseRecord:()=>Ux,lowercase:()=>hi,lt:()=>Vt,lte:()=>ht,mac:()=>sx,map:()=>Zx,maxLength:()=>nn,maxSize:()=>br,memoizer:()=>Yo,meta:()=>Qx,mime:()=>bi,minLength:()=>cr,minSize:()=>Ft,multipleOf:()=>$r,nan:()=>Bx,nanoid:()=>ex,nativeEnum:()=>Lx,negative:()=>cl,never:()=>Gl,nonnegative:()=>ll,nonoptional:()=>Yh,nonpositive:()=>ul,normalize:()=>xi,null:()=>Oa,nullable:()=>Pa,nullish:()=>qx,number:()=>le,object:()=>j,optional:()=>ge,output:()=>dk,overwrite:()=>Et,parse:()=>ph,parseAsync:()=>mh,partialRecord:()=>Cx,pipe:()=>Pl,positive:()=>sl,prefault:()=>Xh,preprocess:()=>Ua,prettifyError:()=>Jf,promise:()=>Hx,properties:()=>$i,property:()=>dl,readonly:()=>og,record:()=>ye,refine:()=>dg,regex:()=>mi,regexes:()=>mt,registry:()=>Au,safeDecode:()=>xh,safeDecodeAsync:()=>wh,safeEncode:()=>bh,safeEncodeAsync:()=>kh,safeParse:()=>hh,safeParseAsync:()=>gh,set:()=>Mx,setErrorMap:()=>$E,size:()=>rn,slugify:()=>Ii,startsWith:()=>yi,strictObject:()=>Dx,string:()=>_,stringFormat:()=>vx,stringbool:()=>tk,success:()=>Fx,superRefine:()=>fg,symbol:()=>Tx,templateLiteral:()=>Gx,toJSONSchema:()=>an,toLowerCase:()=>wi,toUpperCase:()=>Si,toZod:()=>So,transform:()=>Hl,treeifyError:()=>Bf,trim:()=>ki,tuple:()=>Mh,uint32:()=>Sx,uint64:()=>Px,ulid:()=>nx,undefined:()=>Ox,union:()=>me,unknown:()=>_e,uppercase:()=>gi,url:()=>Xb,util:()=>b,uuid:()=>Kb,uuidv4:()=>Gb,uuidv6:()=>Hb,uuidv7:()=>Wb,validate:()=>ti,validateAsync:()=>ri,void:()=>Nx,withParser:()=>Du,xid:()=>ix,xor:()=>Rx});var Zi={};er(Zi,{ZodAny:()=>Eh,ZodArray:()=>Dh,ZodBase64:()=>ql,ZodBase64URL:()=>Fl,ZodBigInt:()=>Ci,ZodBigIntFormat:()=>Kl,ZodBoolean:()=>Ri,ZodCIDRv4:()=>Ll,ZodCIDRv6:()=>Vl,ZodCUID:()=>Al,ZodCUID2:()=>Dl,ZodCatch:()=>eg,ZodCodec:()=>Ra,ZodCreditCard:()=>Ih,ZodCustom:()=>Ca,ZodCustomStringFormat:()=>un,ZodDate:()=>Ea,ZodDefault:()=>Gh,ZodDiscriminatedUnion:()=>Ch,ZodE164:()=>Bl,ZodEmail:()=>Ol,ZodEmoji:()=>Nl,ZodEnum:()=>ji,ZodExactOptional:()=>Wl,ZodFile:()=>Fh,ZodFunction:()=>lg,ZodGUID:()=>El,ZodIBAN:()=>zh,ZodIPv4:()=>Zl,ZodIPv6:()=>Ml,ZodISODate:()=>Tr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Er,ZodISOTime:()=>Or,ZodInstanceOf:()=>pg,ZodIntersection:()=>Uh,ZodJWT:()=>Jl,ZodKSUID:()=>Ul,ZodLazy:()=>sg,ZodLiteral:()=>qh,ZodMAC:()=>Sh,ZodMap:()=>Lh,ZodNaN:()=>rg,ZodNanoID:()=>jl,ZodNever:()=>jh,ZodNonOptional:()=>Xl,ZodNull:()=>Oh,ZodNullable:()=>Kh,ZodNumber:()=>Di,ZodNumberFormat:()=>ln,ZodObject:()=>Na,ZodOptional:()=>dn,ZodPipe:()=>Da,ZodPrefault:()=>Wh,ZodPreprocess:()=>ng,ZodPromise:()=>ug,ZodReadonly:()=>ig,ZodRecord:()=>Ni,ZodSet:()=>Vh,ZodString:()=>Ai,ZodStringFormat:()=>ve,ZodSuccess:()=>Qh,ZodSymbol:()=>Ph,ZodTemplateLiteral:()=>ag,ZodTransform:()=>Bh,ZodTuple:()=>Zh,ZodType:()=>H,ZodULID:()=>Rl,ZodURL:()=>Ta,ZodUUID:()=>Jt,ZodUndefined:()=>Th,ZodUnion:()=>ja,ZodUnknown:()=>Nh,ZodVoid:()=>Ah,ZodXID:()=>Cl,ZodXor:()=>Rh,_ZodString:()=>Tl,_default:()=>Hh,_function:()=>Wx,any:()=>Ex,array:()=>ee,base64:()=>dx,base64url:()=>fx,bigint:()=>Ix,boolean:()=>Te,catch:()=>tg,check:()=>Xx,cidrv4:()=>ux,cidrv6:()=>lx,codec:()=>Jx,creditCard:()=>mx,cuid:()=>tx,cuid2:()=>rx,currencyCode:()=>$x,custom:()=>Yl,date:()=>jx,describe:()=>Yx,discriminatedUnion:()=>Aa,e164:()=>px,email:()=>Bb,emoji:()=>Qb,enum:()=>Ue,exactOptional:()=>Jh,file:()=>Vx,float32:()=>xx,float64:()=>kx,function:()=>Wx,guid:()=>Jb,hash:()=>bx,hex:()=>_x,hostname:()=>yx,httpUrl:()=>Yb,iban:()=>hx,instanceof:()=>ek,int:()=>zl,int32:()=>wx,int64:()=>zx,intersection:()=>Ui,invertCodec:()=>Kx,ipv4:()=>ax,ipv6:()=>cx,json:()=>rk,jwt:()=>gx,keyof:()=>Ax,ksuid:()=>ox,lazy:()=>cg,literal:()=>U,looseObject:()=>Ce,looseRecord:()=>Ux,mac:()=>sx,map:()=>Zx,meta:()=>Qx,nan:()=>Bx,nanoid:()=>ex,nativeEnum:()=>Lx,never:()=>Gl,nonoptional:()=>Yh,null:()=>Oa,nullable:()=>Pa,nullish:()=>qx,number:()=>le,object:()=>j,optional:()=>ge,partialRecord:()=>Cx,pipe:()=>Pl,prefault:()=>Xh,preprocess:()=>Ua,promise:()=>Hx,readonly:()=>og,record:()=>ye,refine:()=>dg,set:()=>Mx,strictObject:()=>Dx,string:()=>_,stringFormat:()=>vx,stringbool:()=>tk,success:()=>Fx,superRefine:()=>fg,symbol:()=>Tx,templateLiteral:()=>Gx,transform:()=>Hl,tuple:()=>Mh,uint32:()=>Sx,uint64:()=>Px,ulid:()=>nx,undefined:()=>Ox,union:()=>me,unknown:()=>_e,url:()=>Xb,uuid:()=>Kb,uuidv4:()=>Gb,uuidv6:()=>Hb,uuidv7:()=>Wb,void:()=>Nx,xid:()=>ix,xor:()=>Rx});var Sl={};er(Sl,{endsWith:()=>_i,gt:()=>qt,gte:()=>gt,includes:()=>vi,length:()=>on,lowercase:()=>hi,lt:()=>Vt,lte:()=>ht,maxLength:()=>nn,maxSize:()=>br,mime:()=>bi,minLength:()=>cr,minSize:()=>Ft,multipleOf:()=>$r,negative:()=>cl,nonnegative:()=>ll,nonpositive:()=>ul,normalize:()=>xi,overwrite:()=>Et,positive:()=>sl,properties:()=>$i,property:()=>dl,regex:()=>mi,size:()=>rn,slugify:()=>Ii,startsWith:()=>yi,toLowerCase:()=>wi,toUpperCase:()=>Si,trim:()=>ki,uppercase:()=>gi});var qb=new WeakSet([Object.prototype,Error.prototype]);function Il(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}var Fb=(e,t)=>{Ff.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);qb.has(n)||(qb.add(n),Il(n,"format",i=>r=>Do(i,r)),Il(n,"flatten",i=>r=>Ao(i,r)),Il(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,qn,2)}),Il(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,qn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},gE=g("ZodError",Fb),st=g("ZodError",Fb,void 0,{Parent:Error});var ph=Hn(st),mh=Wn(st),hh=Xn(st),gh=Qn(st),vh=Js(st),yh=Ks(st),_h=Gs(st),$h=Hs(st),bh=Ws(st),xh=Xs(st),kh=Ys(st),wh=Qs(st);function yE(){Ae.localeError||Pe(Ou())}function cn(){Ae.memoizer||Pe({memoizer:Yo()})}var H=g("ZodType",(e,t)=>(yE(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(b.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ue(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(dg(e,t))},superRefine(e,t){return this.check(fg(e,t))},overwrite(e){return this.check(Et(e))},optional(){return ge(this)},exactOptional(){return Jh(this)},nullable(){return Pa(this)},nullish(){return ge(Pa(this))},nonoptional(e){return Yh(this,e)},array(){return ee(this)},or(e){return me([this,e])},and(e){return Ui(this,e)},transform(e){return Pl(this,Hl(e))},default(e){return Hh(this,e)},prefault(e){return Xh(this,e)},catch(e){return tg(this,e)},pipe(e){return Pl(this,e)},readonly(){return og(this)},describe(e){let t=this.clone();return Re.add(t,{description:e}),t},meta(...e){if(e.length===0)return Re.get(this);let t=this.clone();return Re.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return b.hide(this,"~standard",{...lc(this),jsonSchema:{input:zi(this,"input"),output:zi(this,"output")}})},set"~standard"(e){b.own(this,"~standard",e)},parse:function e(t,n){return ph(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await mh(this,t,n,{callee:e})},safeParse(e,t){return hh(this,e,t)},async safeParseAsync(e,t){return gh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){b.own(this,"spa",e)},validate(e,t){return ti(this,e,t)},validateAsync(e,t){return ri(this,e,t)},encode:function e(t,n){return vh(this,t,n,{callee:e})},decode:function e(t,n){return yh(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await _h(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await $h(this,t,n,{callee:e})},safeEncode(e,t){return bh(this,e,t)},safeDecode(e,t){return xh(this,e,t)},async safeEncodeAsync(e,t){return kh(this,e,t)},async safeDecodeAsync(e,t){return wh(this,e,t)},toJSONSchema(e){return Sm(this,{})(e)},get description(){return Re.get(this)?.description},get _def(){return this._zod.def}}),Tl=g("_ZodString",(e,t)=>{yr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Pm(e,n,i,r)},b.derived({format:e=>Ne(e).format??null,minLength:e=>Ne(e).minimum??null,maxLength:e=>Ne(e).maximum??null},{regex(...e){return this.check(mi(...e))},includes(...e){return this.check(vi(...e))},startsWith(...e){return this.check(yi(...e))},endsWith(...e){return this.check(_i(...e))},min(...e){return this.check(cr(...e))},max(...e){return this.check(nn(...e))},length(...e){return this.check(on(...e))},nonempty(...e){return this.check(cr(1,...e))},lowercase(e){return this.check(hi(e))},uppercase(e){return this.check(gi(e))},trim(){return this.check(ki())},normalize(...e){return this.check(xi(...e))},toLowerCase(){return this.check(wi())},toUpperCase(){return this.check(Si())},slugify(){return this.check(Ii())}})),Ai=g("ZodString",(e,t)=>{yr.init(e,t),Tl.init(e,t)},{email(e){return this.check(ea(Ol,e))},url(e){return this.check(pi(Ta,e))},jwt(e){return this.check($a(Jl,e))},emoji(e){return this.check(aa(Nl,e))},guid(e){return this.check(ta(El,e))},uuid(e){return this.check(ra(Jt,e))},uuidv4(e){return this.check(na(Jt,e))},uuidv6(e){return this.check(ia(Jt,e))},uuidv7(e){return this.check(oa(Jt,e))},nanoid(e){return this.check(sa(jl,e))},cuid(e){return this.check(ca(Al,e))},cuid2(e){return this.check(ua(Dl,e))},ulid(e){return this.check(la(Rl,e))},base64(e){return this.check(va(ql,e))},base64url(e){return this.check(ya(Fl,e))},xid(e){return this.check(da(Cl,e))},ksuid(e){return this.check(fa(Ul,e))},ipv4(e){return this.check(pa(Zl,e))},ipv6(e){return this.check(ma(Ml,e))},cidrv4(e){return this.check(ha(Ll,e))},cidrv6(e){return this.check(ga(Vl,e))},e164(e){return this.check(_a(Bl,e))},datetime(e){return this.check(ba(Pr,e))},date(e){return this.check(xa(Tr,e))},time(e){return this.check(ka(Or,e))},duration(e){return this.check(wa(Er,e))}});function _(e){return Uu(Ai,e)}var ve=g("ZodStringFormat",(e,t)=>{fe.init(e,t),Tl.init(e,t)}),Pr=g("ZodISODateTime",(e,t)=>{Qp.init(e,t),ve.init(e,t)}),Tr=g("ZodISODate",(e,t)=>{em.init(e,t),ve.init(e,t)}),Or=g("ZodISOTime",(e,t)=>{tm.init(e,t),ve.init(e,t)}),Er=g("ZodISODuration",(e,t)=>{rm.init(e,t),ve.init(e,t)}),Ol=g("ZodEmail",(e,t)=>{pc.init(e,t),ve.init(e,t)});function Bb(e){return ea(Ol,e)}var El=g("ZodGUID",(e,t)=>{dc.init(e,t),ve.init(e,t)});function Jb(e){return ta(El,e)}var Jt=g("ZodUUID",(e,t)=>{fc.init(e,t),ve.init(e,t)});function Kb(e){return ra(Jt,e)}function Gb(e){return na(Jt,e)}function Hb(e){return ia(Jt,e)}function Wb(e){return oa(Jt,e)}var Ta=g("ZodURL",(e,t)=>{vc.init(e,t),ve.init(e,t)});function Xb(e){return pi(Ta,e)}function Yb(e){return pi(Ta,{protocol:Ro,hostname:pp,...b.normalizeParams(e)})}var Nl=g("ZodEmoji",(e,t)=>{yc.init(e,t),ve.init(e,t)});function Qb(e){return aa(Nl,e)}var jl=g("ZodNanoID",(e,t)=>{_c.init(e,t),ve.init(e,t)});function ex(e){return sa(jl,e)}var Al=g("ZodCUID",(e,t)=>{$c.init(e,t),ve.init(e,t)});function tx(e){return ca(Al,e)}var Dl=g("ZodCUID2",(e,t)=>{bc.init(e,t),ve.init(e,t)});function rx(e){return ua(Dl,e)}var Rl=g("ZodULID",(e,t)=>{xc.init(e,t),ve.init(e,t)});function nx(e){return la(Rl,e)}var Cl=g("ZodXID",(e,t)=>{kc.init(e,t),ve.init(e,t)});function ix(e){return da(Cl,e)}var Ul=g("ZodKSUID",(e,t)=>{wc.init(e,t),ve.init(e,t)});function ox(e){return fa(Ul,e)}var Zl=g("ZodIPv4",(e,t)=>{Sc.init(e,t),ve.init(e,t)});function ax(e){return pa(Zl,e)}var Sh=g("ZodMAC",(e,t)=>{zc.init(e,t),ve.init(e,t)});function sx(e){return Zu(Sh,e)}var Ml=g("ZodIPv6",(e,t)=>{Ic.init(e,t),ve.init(e,t)});function cx(e){return ma(Ml,e)}var Ll=g("ZodCIDRv4",(e,t)=>{Pc.init(e,t),ve.init(e,t)});function ux(e){return ha(Ll,e)}var Vl=g("ZodCIDRv6",(e,t)=>{Oc.init(e,t),ve.init(e,t)});function lx(e){return ga(Vl,e)}var ql=g("ZodBase64",(e,t)=>{Nc.init(e,t),ve.init(e,t)});function dx(e){return va(ql,e)}var Fl=g("ZodBase64URL",(e,t)=>{Ac.init(e,t),ve.init(e,t)});function fx(e){return ya(Fl,e)}var Bl=g("ZodE164",(e,t)=>{Dc.init(e,t),ve.init(e,t)});function px(e){return _a(Bl,e)}var Ih=g("ZodCreditCard",(e,t)=>{Cc.init(e,t),ve.init(e,t)});function mx(e){return Mu(Ih,e)}var zh=g("ZodIBAN",(e,t)=>{Zc.init(e,t),ve.init(e,t)});function hx(e){return Lu(zh,e)}var Jl=g("ZodJWT",(e,t)=>{Lc.init(e,t),ve.init(e,t)});function gx(e){return $a(Jl,e)}var un=g("ZodCustomStringFormat",(e,t)=>{Vc.init(e,t),ve.init(e,t)});function vx(e,t,n={}){return xr(un,e,t,n)}function yx(e){return xr(un,"hostname",fp,e)}function _x(e){return xr(un,"hex",zp,e)}function $x(e){return xr(un,"currency_code",hp,e)}function bx(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=mt[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return xr(un,i,r,t)}var Di=g("ZodNumber",(e,t)=>{Bo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Tm(e,n,i,r),e.isFinite=!0},b.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Ne(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Ne(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=Ne(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Ne(e).format??null},{gt(e,t){return this.check(qt(e,t))},gte(e,t){return this.check(gt(e,t))},min(e,t){return this.check(gt(e,t))},lt(e,t){return this.check(Vt(e,t))},lte(e,t){return this.check(ht(e,t))},max(e,t){return this.check(ht(e,t))},int(e){return this.check(zl(e))},safe(e){return this.check(zl(e))},positive(e){return this.check(qt(0,e))},nonnegative(e){return this.check(gt(0,e))},negative(e){return this.check(Vt(0,e))},nonpositive(e){return this.check(ht(0,e))},multipleOf(e,t){return this.check($r(e,t))},step(e,t){return this.check($r(e,t))},finite(){return this}}));function le(e){return Vu(Di,e)}var ln=g("ZodNumberFormat",(e,t)=>{qc.init(e,t),Di.init(e,t)});function zl(e){return qu(ln,e)}function xx(e){return Fu(ln,e)}function kx(e){return Bu(ln,e)}function wx(e){return Ju(ln,e)}function Sx(e){return Ku(ln,e)}var Ri=g("ZodBoolean",(e,t)=>{oi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Om(e,n,i,r)});function Te(e){return Gu(Ri,e)}var Ci=g("ZodBigInt",(e,t)=>{Jo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Em(e,n,i,r)},b.derived({minValue:e=>Ne(e).minimum??null,maxValue:e=>Ne(e).maximum??null,format:e=>Ne(e).format??null},{gte(e,t){return this.check(gt(e,t))},min(e,t){return this.check(gt(e,t))},gt(e,t){return this.check(qt(e,t))},lt(e,t){return this.check(Vt(e,t))},lte(e,t){return this.check(ht(e,t))},max(e,t){return this.check(ht(e,t))},positive(e){return this.check(qt(BigInt(0),e))},negative(e){return this.check(Vt(BigInt(0),e))},nonpositive(e){return this.check(ht(BigInt(0),e))},nonnegative(e){return this.check(gt(BigInt(0),e))},multipleOf(e,t){return this.check($r(e,t))}}));function Ix(e){return Hu(Ci,e)}var Kl=g("ZodBigIntFormat",(e,t)=>{Fc.init(e,t),Ci.init(e,t)});function zx(e){return Wu(Kl,e)}function Px(e){return Xu(Kl,e)}var Ph=g("ZodSymbol",(e,t)=>{Bc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Nm(e,n,i,r)});function Tx(e){return Yu(Ph,e)}var Th=g("ZodUndefined",(e,t)=>{Jc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Am(e,n,i,r)});function Ox(e){return Qu(Th,e)}var Oh=g("ZodNull",(e,t)=>{Kc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>jm(e,n,i,r)});function Oa(e){return el(Oh,e)}var Eh=g("ZodAny",(e,t)=>{Gc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Cm(e,n,i,r)});function Ex(){return tl(Eh)}var Nh=g("ZodUnknown",(e,t)=>{Hc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Um(e,n,i,r)});function _e(){return rl(Nh)}var jh=g("ZodNever",(e,t)=>{Wc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Rm(e,n,i,r)});function Gl(e){return nl(jh,e)}var Ah=g("ZodVoid",(e,t)=>{Xc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Dm(e,n,i,r)});function Nx(e){return il(Ah,e)}var Ea=g("ZodDate",(e,t)=>{Yc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Zm(e,n,i,r),e.min=(n,i)=>e.check(gt(n,i)),e.max=(n,i)=>e.check(ht(n,i))},b.derived({minDate:e=>{let{minimum:t}=Ne(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Ne(e);return t?new Date(t):null}},{}));function jx(e){return ol(Ea,e)}var Dh=g("ZodArray",(e,t)=>{cn(),Qc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Xm(e,n,i,r),e.element=t.element},{min(e,t){return this.check(cr(e,t))},nonempty(e){return this.check(cr(1,e))},max(e,t){return this.check(nn(e,t))},length(e,t){return this.check(on(e,t))},unwrap(){return this.element}});function ee(e,t){return km(Dh,e,t)}function Ax(e){let t=e._zod.def.shape;return Ue(Object.keys(t))}var Na=g("ZodObject",(e,t)=>{cn(),im.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Ym(e,n,i,r),b.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Ue(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(b.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(b.mergeDefs(this._zod.def,{catchall:_e()}))},loose(){return this.clone(b.mergeDefs(this._zod.def,{catchall:_e()}))},strict(){return this.clone(b.mergeDefs(this._zod.def,{catchall:Gl()}))},strip(){return this.clone(b.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return b.extend(this,e)},safeExtend(e){return b.safeExtend(this,e)},merge(e){return b.merge(this,e)},pick(e){return b.pick(this,e)},omit(e){return b.omit(this,e)},partial(...e){return b.partial(dn,this,e[0])},exactPartial(...e){return b.partial(Wl,this,e[0],"exactPartial")},required(...e){return b.required(Xl,this,e[0])}});function j(e,t){let n={type:"object",shape:e??{},...b.normalizeParams(t)};return new Na(n)}function Dx(e,t){return new Na({type:"object",shape:e,catchall:Gl(),...b.normalizeParams(t)})}function Ce(e,t){return new Na({type:"object",shape:e,catchall:_e(),...b.normalizeParams(t)})}var ja=g("ZodUnion",(e,t)=>{ai.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>$l(e,n,i,r),e.options=t.options});function me(e,t){return new ja({type:"union",options:e,...b.normalizeParams(t)})}var Rh=g("ZodXor",(e,t)=>{ja.init(e,t),tu.init(e,t),e._zod.processJSONSchema=(n,i,r)=>$l(e,n,i,r),e.options=t.options});function Rx(e,t){return new Rh({type:"union",options:e,inclusive:!1,...b.normalizeParams(t)})}var Ch=g("ZodDiscriminatedUnion",(e,t)=>{ja.init(e,t),ru.init(e,t)});function Aa(e,t,n){return new Ch({type:"union",options:t,discriminator:e,...b.normalizeParams(n)})}var Uh=g("ZodIntersection",(e,t)=>{nu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Qm(e,n,i,r)});function Ui(e,t){return new Uh({type:"intersection",left:e,right:t})}var Zh=g("ZodTuple",(e,t)=>{cn(),Ko.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>eh(e,n,i,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new dn({type:"optional",innerType:t}))})}});function Mh(e,t,n){let i=t instanceof B,r=i?n:t,o=i?t:null;return new Zh({type:"tuple",items:e,rest:o,...b.normalizeParams(r)})}var Ni=g("ZodRecord",(e,t)=>{cn(),iu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>th(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function ye(e,t,n){return!t||!t._zod?new Ni({type:"record",keyType:_(),valueType:e,...b.normalizeParams(t)}):new Ni({type:"record",keyType:e,valueType:t,...b.normalizeParams(n)})}function Cx(e,t,n){return new Ni({type:"record",keyType:e,valueType:t,...b.normalizeParams(n),partial:!0})}function Ux(e,t,n){return new Ni({type:"record",keyType:e,valueType:t,mode:"loose",...b.normalizeParams(n)})}var Lh=g("ZodMap",(e,t)=>{cn(),ou.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Hm(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Ft(...n)),e.nonempty=n=>e.check(Ft(1,n)),e.max=(...n)=>e.check(br(...n)),e.size=(...n)=>e.check(rn(...n))});function Zx(e,t,n){return new Lh({type:"map",keyType:e,valueType:t,...b.normalizeParams(n)})}var Vh=g("ZodSet",(e,t)=>{cn(),au.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Wm(e,n,i,r),e.min=(...n)=>e.check(Ft(...n)),e.nonempty=n=>e.check(Ft(1,n)),e.max=(...n)=>e.check(br(...n)),e.size=(...n)=>e.check(rn(...n))});function Mx(e,t){return new Vh({type:"set",valueType:e,...b.normalizeParams(t)})}var ji=g("ZodEnum",(e,t)=>{su.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,o)=>Mm(e,i,r,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let o={};for(let a of i)if(n.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ji({...t,checks:[],...b.normalizeParams(r),entries:o})},e.exclude=(i,r)=>{let o={...t.entries};for(let a of i)if(n.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new ji({...t,checks:[],...b.normalizeParams(r),entries:o})}});function Ue(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ji({type:"enum",entries:n,...b.normalizeParams(t)})}function Lx(e,t){return new ji({type:"enum",entries:e,...b.normalizeParams(t)})}var qh=g("ZodLiteral",(e,t)=>{cu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Lm(e,n,i,r),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 U(e,t){return new qh({type:"literal",values:Array.isArray(e)?e:[e],...b.normalizeParams(t)})}var Fh=g("ZodFile",(e,t)=>{uu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Fm(e,n,i,r),e.min=(n,i)=>e.check(Ft(n,i)),e.max=(n,i)=>e.check(br(n,i)),e.mime=(n,i)=>e.check(bi(Array.isArray(n)?n:[n],i))});function Vx(e){return fl(Fh,e)}var Bh=g("ZodTransform",(e,t)=>{cn(),lu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Gm(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new vr(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(b.issue(o,n.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=e),n.issues.push(b.issue(a))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function Hl(e){return new Bh({type:"transform",transform:e})}var dn=g("ZodOptional",(e,t)=>{Go.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>bl(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function ge(e){return new dn({type:"optional",innerType:e})}var Wl=g("ZodExactOptional",(e,t)=>{du.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>bl(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Jh(e){return new Wl({type:"optional",innerType:e})}var Kh=g("ZodNullable",(e,t)=>{fu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>rh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Pa(e){return new Kh({type:"nullable",innerType:e})}function qx(e){return ge(Pa(e))}var Gh=g("ZodDefault",(e,t)=>{pu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>oh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hh(e,t){return new Gh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():b.shallowClone(t)}})}var Wh=g("ZodPrefault",(e,t)=>{mu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ah(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Xh(e,t){return new Wh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():b.shallowClone(t)}})}var Xl=g("ZodNonOptional",(e,t)=>{hu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>nh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Yh(e,t){return new Xl({type:"nonoptional",innerType:e,...b.normalizeParams(t)})}var Qh=g("ZodSuccess",(e,t)=>{gu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Bm(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Fx(e){return new Qh({type:"success",innerType:e})}var eg=g("ZodCatch",(e,t)=>{vu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>sh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tg(e,t){return new eg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:b.constantCatch(t)})}var rg=g("ZodNaN",(e,t)=>{yu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Vm(e,n,i,r)});function Bx(e){return al(rg,e)}var Da=g("ZodPipe",(e,t)=>{Ho.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ch(e,n,i,r),e.in=t.in,e.out=t.out});function Pl(e,t){return new Da({type:"pipe",in:e,out:t})}var Ra=g("ZodCodec",(e,t)=>{Da.init(e,t),si.init(e,t)});function Jx(e,t,n){return new Ra({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function Kx(e){let t=e._zod.def;return new Ra({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var ng=g("ZodPreprocess",(e,t)=>{Da.init(e,t),am.init(e,t)}),ig=g("ZodReadonly",(e,t)=>{_u.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>uh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function og(e){return new ig({type:"readonly",innerType:e})}var ag=g("ZodTemplateLiteral",(e,t)=>{$u.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>qm(e,n,i,r)});function Gx(e,t){return new ag({type:"template_literal",parts:e,...b.normalizeParams(t)})}var sg=g("ZodLazy",(e,t)=>{ci.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>dh(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function cg(e){return new sg({type:"lazy",getter:e})}var ug=g("ZodPromise",(e,t)=>{xu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>lh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Hx(e){return new ug({type:"promise",innerType:e})}var lg=g("ZodFunction",(e,t)=>{bu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Km(e,n,i,r)});function Wx(e){return new lg({type:"function",input:Array.isArray(e?.input)?Mh(e?.input):e?.input??ee(_e()),output:e?.output??_e()})}var Ca=g("ZodCustom",(e,t)=>{ku.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Jm(e,n,i,r)});function Xx(e){let t=new he({check:"custom"});return t._zod.check=e,t}function Yl(e,t){return pl(Ca,e??(()=>!0),t)}function dg(e,t={}){return ml(Ca,e,t)}function fg(e,t){return hl(e,t)}var Yx=gl,Qx=vl,pg=g("ZodInstanceOf",(e,t)=>{Ca.init(e,t)},{properties(e,t){return this.check($i(e,t))}});function ek(e,t={}){let n=new pg({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...b.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var tk=(...e)=>yl({Codec:Ra,Boolean:Ri,String:Ai},...e);function rk(e){let t=cg(()=>me([_(e),le(),Te(),Oa(),ee(t),ye(_(),t)]));return t}function Ua(e,t){return new ng({type:"pipe",in:Hl(e),out:t})}var _E={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function $E(e){Pe({customError:e})}function bE(){return Pe().customError}var mg;mg||(mg={});var fn={};er(fn,{ZodISODate:()=>Tr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Er,ZodISOTime:()=>Or,date:()=>kE,datetime:()=>xE,duration:()=>SE,time:()=>wE});function xE(e){return ba(Pr,e)}function kE(e){return xa(Tr,e)}function wE(e){return ka(Or,e)}function SE(e){return wa(Er,e)}var O={...Zi,...Sl,iso:fn},IE=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function zE(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function nk(e,t){return e.map((n,i)=>i<t?n:n.optional())}function PE(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function TE(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1]===void 0?void 0:PE(n[1]);if(!r||!t.defs[r])throw new Error(`Reference not found: ${e}`);return t.defs[r]}throw new Error(`Reference not found: ${e}`)}function OE(e,t){return O.transform(i=>i).check(i=>{let r=i.value;if(typeof r!="object"||r===null||Array.isArray(r))return;let o=Object.getOwnPropertyNames(r);if(t.minProperties!==void 0&&o.length<t.minProperties&&i.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:r,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:r,inst:e,continue:!0}),t.keySchema)for(let a of o){let s=t.keySchema.safeParse(a);s.success||i.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function hg(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let i=String(e);return`${n[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let a of e){let s=hg(a,t);if(s===null)return null;o.push(s)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(e).sort(),r=[];for(let o of i){let a=hg(e[o],t);if(a===null)return null;r.push(`${o.length}:${o}=${a}`)}return`o${r.length}:{${r.join(",")}}`}finally{t.delete(e)}}var EE=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),NE=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Za(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Za):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>EE.has(t)?Za(n):!NE.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(Za))}function ik(e){return e===1?"element":"elements"}function jE(e,t){return O.transform(i=>i).check(i=>{let r=i.value;if(Array.isArray(r)){if(t.uniqueItems===!0){let o=new Map;for(let a=0;a<r.length;a++){let s=hg(r[a],new Set);if(s===null)continue;let c=o.get(s);if(c===void 0){o.set(s,a);continue}i.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${c}`,input:r,path:[a],continue:!0})}}if(t.containsSchema){let o=t.minContains??1,a=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,s=0;for(let c of r)if(t.containsSchema.safeParse(c).success&&++s>=a)break;s<o&&i.issues.push({code:"custom",message:`Array must contain at least ${o} matching ${ik(o)}; found ${s}`,input:r,continue:!0}),t.maxContains!==void 0&&s>t.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${ik(t.maxContains)}`,input:r,continue:!0})}}}).pipe(e)}function ok(e,t){if(e!==!1)return e===void 0||e===!0?O.any():Qe(e,t)}var AE=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function ak(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return O.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let o=TE(r,t),a=Qe(o,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return O.null();if(r.length===0)return O.never();if(r.length===1)return O.literal(r[0]);if(r.every(a=>typeof a=="string"))return O.enum(r);let o=r.map(a=>O.literal(a));return o.length<2?o[0]:O.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return O.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(o=>{let a={...e,type:o};return ak(a,t)});return r.length===0?O.never():r.length===1?r[0]:O.union(r)}if(!n)return O.any();let i;switch(n){case"string":{let r=O.string();if(e.format){let o=e.format;o==="email"?r=r.check(O.email()):o==="uri"||o==="uri-reference"?r=r.check(O.url()):o==="uuid"||o==="guid"?r=r.check(O.uuid()):o==="date-time"?r=r.check(O.iso.datetime({offset:!0})):o==="date"?r=r.check(O.iso.date()):o==="time"?r=r.check(O.regex(AE)):o==="duration"?r=r.check(O.iso.duration()):o==="hostname"?r=r.check(O.hostname()):o==="ipv4"?r=r.check(O.ipv4()):o==="ipv6"?r=r.check(O.ipv6()):o==="mac"?r=r.check(O.mac()):o==="cidr"?r=r.check(O.cidrv4()):o==="cidr-v6"?r=r.check(O.cidrv6()):o==="base64"?r=r.check(O.base64()):o==="base64url"?r=r.check(O.base64url()):o==="e164"?r=r.check(O.e164()):o==="credit_card"?r=r.check(O.creditCard()):o==="iban"?r=r.check(O.iban()):o==="jwt"?r=r.check(O.jwt()):o==="emoji"?r=r.check(O.emoji()):o==="nanoid"?r=r.check(O.nanoid()):o==="cuid"?r=r.check(O.cuid()):o==="cuid2"?r=r.check(O.cuid2()):o==="ulid"?r=r.check(O.ulid()):o==="xid"?r=r.check(O.xid()):o==="ksuid"&&(r=r.check(O.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?O.number().int():O.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=O.boolean();break}case"null":{i=O.null();break}case"object":{let r={},o=e.properties||{},a=new Set(e.required||[]),s=typeof e.additionalProperties=="object"?Qe(e.additionalProperties,t):void 0;for(let[d,f]of Object.entries(o)){let p=Qe(f,t);De(r,d,a.has(d)?p:p.optional())}if(e.patternProperties){let d=e.patternProperties,f=Object.keys(d),p=[];for(let h of f){let y=Qe(d[h],t),$=O.string().regex(new RegExp(h));p.push(O.looseRecord($,y))}let m=[];if(Object.keys(r).length>0&&m.push(O.object(r).passthrough()),m.push(...p),m.length===0)i=O.object({}).passthrough();else if(m.length===1)i=m[0];else{let h=O.intersection(m[0],m[1]);for(let y=2;y<m.length;y++)h=O.intersection(h,m[y]);i=h}if(e.additionalProperties===!1){let h=Object.keys(r),y=f.map(w=>new RegExp(w)),$=i;i=i.check(w=>{if(!$t(w.value))return;let z=[];for(let D of Object.keys(w.value))h.includes(D)||y.some(E=>E.test(D))||z.push(D);z.length&&w.issues.push({code:"unrecognized_keys",keys:z,input:w.value,inst:$})})}}else{let d=O.object(r);e.additionalProperties===!1?i=d.strict():s?i=d.catchall(s):i=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let d;if(c){let f=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=Qe(f,t)}i=OE(i,{keySchema:d,minProperties:u,maxProperties:l})}break}case"array":{let r=e.prefixItems,o=e.items;if(r&&Array.isArray(r)){let a=typeof e.minItems=="number"?e.minItems:0,s=r.map(d=>Qe(d,t)),c=nk(s,a),u=Array.isArray(o)?void 0:ok(o,t),l=O.tuple(c);i=u?l.rest(u):l,typeof e.minItems=="number"&&(i=i.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(O.maxLength(e.maxItems)))}else if(Array.isArray(o)){let a=typeof e.minItems=="number"?e.minItems:0,s=o.map(d=>Qe(d,t)),c=nk(s,a),u=ok(e.additionalItems,t),l=O.tuple(c);i=u?l.rest(u):l,typeof e.minItems=="number"&&(i=i.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(O.maxLength(e.maxItems)))}else if(o!==void 0){let a=Qe(o,t),s=O.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),i=s}else i=O.array(O.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=jE(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?Qe(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return i}function Qe(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n=ak(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(u=>Qe(u,t)),c=O.union(s);n=i?O.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(u=>Qe(u,t)),c=O.xor(s);n=i?O.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:O.any();else{let s=i?n:Qe(e.allOf[0],t),c=i?0:1;for(let u=c;u<e.allOf.length;u++)s=O.intersection(s,Qe(e.allOf[u],t));n=s}e.nullable===!0&&t.version==="openapi-3.0"&&(n=O.nullable(n)),e.readOnly===!0&&(n=O.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in e&&(r[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(r[s]=e[s]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Za(e.propertyNames)&&(r.propertyNames=e.propertyNames);for(let s of["minProperties","maxProperties"])e[s]!==void 0&&(r[s]=e[s])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Za(e.contains)&&(r.contains=e.contains);for(let s of["uniqueItems","minContains","maxContains"])e[s]!==void 0&&(r[s]=e[s])}for(let s of Object.keys(e))IE.has(s)||De(r,s,e[s]);return Object.keys(r).length>0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function sk(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=zE(n,t?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Re};return Qe(n,o)}function ck(e){return za(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:me(n.options)}})}function DE(e,t){if(!t?.length)return e;let n=e._zod.def;return ue(e,_t(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function uk(e){return DE(e.out,e.checks)}function RE(e){return e.in._zod.traits.has("$ZodTransform")?uk(e):e.in}function lk(e){return za(e,{pipe:t=>RE(t._zod.def),default:(t,n)=>n?ge(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function dk(e){return za(e,{pipe:t=>uk(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var gg={};er(gg,{bigint:()=>ME,boolean:()=>ZE,date:()=>LE,number:()=>UE,string:()=>CE});function CE(e){return vm(Ai,e)}function UE(e){return _m(Di,e)}function ZE(e){return $m(Ri,e)}function ME(e){return bm(Ci,e)}function LE(e){return xm(Ea,e)}var yg="2025-11-25";var fk=[yg,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Nr="io.modelcontextprotocol/related-task",ed="2.0",je=Yl(e=>e!==null&&(typeof e=="object"||typeof e=="function")),pk=me([_(),le().int()]),mk=_(),_V=Ce({ttl:le().optional(),pollInterval:le().optional()}),VE=j({ttl:le().optional()}),qE=j({taskId:_()}),_g=Ce({progressToken:pk.optional(),[Nr]:qE.optional()}),vt=j({_meta:_g.optional()}),Ma=vt.extend({task:VE.optional()}),hk=e=>Ma.safeParse(e).success,Ze=j({method:_(),params:vt.loose().optional()}),xt=j({_meta:_g.optional()}),kt=j({method:_(),params:xt.loose().optional()}),Me=Ce({_meta:_g.optional()}),td=me([_(),le().int()]),gk=j({jsonrpc:U(ed),id:td,...Ze.shape}).strict(),$g=e=>gk.safeParse(e).success,vk=j({jsonrpc:U(ed),...kt.shape}).strict(),yk=e=>vk.safeParse(e).success,bg=j({jsonrpc:U(ed),id:td,result:Me}).strict(),La=e=>bg.safeParse(e).success;var Z;(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"})(Z||(Z={}));var xg=j({jsonrpc:U(ed),id:td.optional(),error:j({code:le().int(),message:_(),data:_e().optional()})}).strict();var _k=e=>xg.safeParse(e).success;var $k=me([gk,vk,bg,xg]),$V=me([bg,xg]),rd=Me.strict(),FE=xt.extend({requestId:td.optional(),reason:_().optional()}),nd=kt.extend({method:U("notifications/cancelled"),params:FE}),BE=j({src:_(),mimeType:_().optional(),sizes:ee(_()).optional(),theme:Ue(["light","dark"]).optional()}),Va=j({icons:ee(BE).optional()}),Mi=j({name:_(),title:_().optional()}),bk=Mi.extend({...Mi.shape,...Va.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),JE=Ui(j({applyDefaults:Te().optional()}),ye(_(),_e())),KE=Ua(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ui(j({form:JE.optional(),url:je.optional()}),ye(_(),_e()).optional())),GE=Ce({list:je.optional(),cancel:je.optional(),requests:Ce({sampling:Ce({createMessage:je.optional()}).optional(),elicitation:Ce({create:je.optional()}).optional()}).optional()}),HE=Ce({list:je.optional(),cancel:je.optional(),requests:Ce({tools:Ce({call:je.optional()}).optional()}).optional()}),WE=j({experimental:ye(_(),je).optional(),sampling:j({context:je.optional(),tools:je.optional()}).optional(),elicitation:KE.optional(),roots:j({listChanged:Te().optional()}).optional(),tasks:GE.optional(),extensions:ye(_(),je).optional()}),XE=vt.extend({protocolVersion:_(),capabilities:WE,clientInfo:bk}),kg=Ze.extend({method:U("initialize"),params:XE});var YE=j({experimental:ye(_(),je).optional(),logging:je.optional(),completions:je.optional(),prompts:j({listChanged:Te().optional()}).optional(),resources:j({subscribe:Te().optional(),listChanged:Te().optional()}).optional(),tools:j({listChanged:Te().optional()}).optional(),tasks:HE.optional(),extensions:ye(_(),je).optional()}),QE=Me.extend({protocolVersion:_(),capabilities:YE,serverInfo:bk,instructions:_().optional()}),wg=kt.extend({method:U("notifications/initialized"),params:xt.optional()});var id=Ze.extend({method:U("ping"),params:vt.optional()}),eN=j({progress:le(),total:ge(le()),message:ge(_())}),tN=j({...xt.shape,...eN.shape,progressToken:pk}),od=kt.extend({method:U("notifications/progress"),params:tN}),rN=vt.extend({cursor:mk.optional()}),qa=Ze.extend({params:rN.optional()}),Fa=Me.extend({nextCursor:mk.optional()}),nN=Ue(["working","input_required","completed","failed","cancelled"]),Ba=j({taskId:_(),status:nN,ttl:me([le(),Oa()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:ge(le()),statusMessage:ge(_())}),Li=Me.extend({task:Ba}),iN=xt.merge(Ba),Ja=kt.extend({method:U("notifications/tasks/status"),params:iN}),ad=Ze.extend({method:U("tasks/get"),params:vt.extend({taskId:_()})}),sd=Me.merge(Ba),cd=Ze.extend({method:U("tasks/result"),params:vt.extend({taskId:_()})}),bV=Me.loose(),ud=qa.extend({method:U("tasks/list")}),ld=Fa.extend({tasks:ee(Ba)}),dd=Ze.extend({method:U("tasks/cancel"),params:vt.extend({taskId:_()})}),xk=Me.merge(Ba),kk=j({uri:_(),mimeType:ge(_()),_meta:ye(_(),_e()).optional()}),wk=kk.extend({text:_()}),Sg=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Sk=kk.extend({blob:Sg}),Ka=Ue(["user","assistant"]),Vi=j({audience:ee(Ka).optional(),priority:le().min(0).max(1).optional(),lastModified:fn.datetime({offset:!0}).optional()}),Ik=j({...Mi.shape,...Va.shape,uri:_(),description:ge(_()),mimeType:ge(_()),size:ge(le()),annotations:Vi.optional(),_meta:ge(Ce({}))}),oN=j({...Mi.shape,...Va.shape,uriTemplate:_(),description:ge(_()),mimeType:ge(_()),annotations:Vi.optional(),_meta:ge(Ce({}))}),fd=qa.extend({method:U("resources/list")}),aN=Fa.extend({resources:ee(Ik)}),pd=qa.extend({method:U("resources/templates/list")}),sN=Fa.extend({resourceTemplates:ee(oN)}),Ig=vt.extend({uri:_()}),cN=Ig,md=Ze.extend({method:U("resources/read"),params:cN}),uN=Me.extend({contents:ee(me([wk,Sk]))}),lN=kt.extend({method:U("notifications/resources/list_changed"),params:xt.optional()}),dN=Ig,fN=Ze.extend({method:U("resources/subscribe"),params:dN}),pN=Ig,mN=Ze.extend({method:U("resources/unsubscribe"),params:pN}),hN=xt.extend({uri:_()}),gN=kt.extend({method:U("notifications/resources/updated"),params:hN}),vN=j({name:_(),description:ge(_()),required:ge(Te())}),yN=j({...Mi.shape,...Va.shape,description:ge(_()),arguments:ge(ee(vN)),_meta:ge(Ce({}))}),hd=qa.extend({method:U("prompts/list")}),_N=Fa.extend({prompts:ee(yN)}),$N=vt.extend({name:_(),arguments:ye(_(),_()).optional()}),gd=Ze.extend({method:U("prompts/get"),params:$N}),zg=j({type:U("text"),text:_(),annotations:Vi.optional(),_meta:ye(_(),_e()).optional()}),Pg=j({type:U("image"),data:Sg,mimeType:_(),annotations:Vi.optional(),_meta:ye(_(),_e()).optional()}),Tg=j({type:U("audio"),data:Sg,mimeType:_(),annotations:Vi.optional(),_meta:ye(_(),_e()).optional()}),bN=j({type:U("tool_use"),name:_(),id:_(),input:ye(_(),_e()),_meta:ye(_(),_e()).optional()}),xN=j({type:U("resource"),resource:me([wk,Sk]),annotations:Vi.optional(),_meta:ye(_(),_e()).optional()}),kN=Ik.extend({type:U("resource_link")}),Og=me([zg,Pg,Tg,kN,xN]),wN=j({role:Ka,content:Og}),SN=Me.extend({description:_().optional(),messages:ee(wN)}),IN=kt.extend({method:U("notifications/prompts/list_changed"),params:xt.optional()}),zN=j({title:_().optional(),readOnlyHint:Te().optional(),destructiveHint:Te().optional(),idempotentHint:Te().optional(),openWorldHint:Te().optional()}),PN=j({taskSupport:Ue(["required","optional","forbidden"]).optional()}),zk=j({...Mi.shape,...Va.shape,description:_().optional(),inputSchema:j({type:U("object"),properties:ye(_(),je).optional(),required:ee(_()).optional()}).catchall(_e()),outputSchema:j({type:U("object"),properties:ye(_(),je).optional(),required:ee(_()).optional()}).catchall(_e()).optional(),annotations:zN.optional(),execution:PN.optional(),_meta:ye(_(),_e()).optional()}),vd=qa.extend({method:U("tools/list")}),TN=Fa.extend({tools:ee(zk)}),yd=Me.extend({content:ee(Og).default([]),structuredContent:ye(_(),_e()).optional(),isError:Te().optional()}),xV=yd.or(Me.extend({toolResult:_e()})),ON=Ma.extend({name:_(),arguments:ye(_(),_e()).optional()}),qi=Ze.extend({method:U("tools/call"),params:ON}),EN=kt.extend({method:U("notifications/tools/list_changed"),params:xt.optional()}),kV=j({autoRefresh:Te().default(!0),debounceMs:le().int().nonnegative().default(300)}),Ga=Ue(["debug","info","notice","warning","error","critical","alert","emergency"]),NN=vt.extend({level:Ga}),Eg=Ze.extend({method:U("logging/setLevel"),params:NN}),jN=xt.extend({level:Ga,logger:_().optional(),data:_e()}),AN=kt.extend({method:U("notifications/message"),params:jN}),DN=j({name:_().optional()}),RN=j({hints:ee(DN).optional(),costPriority:le().min(0).max(1).optional(),speedPriority:le().min(0).max(1).optional(),intelligencePriority:le().min(0).max(1).optional()}),CN=j({mode:Ue(["auto","required","none"]).optional()}),UN=j({type:U("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:ee(Og).default([]),structuredContent:j({}).loose().optional(),isError:Te().optional(),_meta:ye(_(),_e()).optional()}),ZN=Aa("type",[zg,Pg,Tg]),Ql=Aa("type",[zg,Pg,Tg,bN,UN]),MN=j({role:Ka,content:me([Ql,ee(Ql)]),_meta:ye(_(),_e()).optional()}),LN=Ma.extend({messages:ee(MN),modelPreferences:RN.optional(),systemPrompt:_().optional(),includeContext:Ue(["none","thisServer","allServers"]).optional(),temperature:le().optional(),maxTokens:le().int(),stopSequences:ee(_()).optional(),metadata:je.optional(),tools:ee(zk).optional(),toolChoice:CN.optional()}),VN=Ze.extend({method:U("sampling/createMessage"),params:LN}),Ha=Me.extend({model:_(),stopReason:ge(Ue(["endTurn","stopSequence","maxTokens"]).or(_())),role:Ka,content:ZN}),Ng=Me.extend({model:_(),stopReason:ge(Ue(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Ka,content:me([Ql,ee(Ql)])}),qN=j({type:U("boolean"),title:_().optional(),description:_().optional(),default:Te().optional()}),FN=j({type:U("string"),title:_().optional(),description:_().optional(),minLength:le().optional(),maxLength:le().optional(),format:Ue(["email","uri","date","date-time"]).optional(),default:_().optional()}),BN=j({type:Ue(["number","integer"]),title:_().optional(),description:_().optional(),minimum:le().optional(),maximum:le().optional(),default:le().optional()}),JN=j({type:U("string"),title:_().optional(),description:_().optional(),enum:ee(_()),default:_().optional()}),KN=j({type:U("string"),title:_().optional(),description:_().optional(),oneOf:ee(j({const:_(),title:_()})),default:_().optional()}),GN=j({type:U("string"),title:_().optional(),description:_().optional(),enum:ee(_()),enumNames:ee(_()).optional(),default:_().optional()}),HN=me([JN,KN]),WN=j({type:U("array"),title:_().optional(),description:_().optional(),minItems:le().optional(),maxItems:le().optional(),items:j({type:U("string"),enum:ee(_())}),default:ee(_()).optional()}),XN=j({type:U("array"),title:_().optional(),description:_().optional(),minItems:le().optional(),maxItems:le().optional(),items:j({anyOf:ee(j({const:_(),title:_()}))}),default:ee(_()).optional()}),YN=me([WN,XN]),QN=me([GN,HN,YN]),ej=me([QN,qN,FN,BN]),tj=Ma.extend({mode:U("form").optional(),message:_(),requestedSchema:j({type:U("object"),properties:ye(_(),ej),required:ee(_()).optional()})}),rj=Ma.extend({mode:U("url"),message:_(),elicitationId:_(),url:_().url()}),nj=me([tj,rj]),ij=Ze.extend({method:U("elicitation/create"),params:nj}),oj=xt.extend({elicitationId:_()}),aj=kt.extend({method:U("notifications/elicitation/complete"),params:oj}),Fi=Me.extend({action:Ue(["accept","decline","cancel"]),content:Ua(e=>e===null?void 0:e,ye(_(),me([_(),le(),Te(),ee(_())])).optional())}),sj=j({type:U("ref/resource"),uri:_()});var cj=j({type:U("ref/prompt"),name:_()}),uj=vt.extend({ref:me([cj,sj]),argument:j({name:_(),value:_()}),context:j({arguments:ye(_(),_()).optional()}).optional()}),_d=Ze.extend({method:U("completion/complete"),params:uj});function Pk(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Tk(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var lj=Me.extend({completion:Ce({values:ee(_()).max(100),total:ge(le().int()),hasMore:ge(Te())})}),dj=j({uri:_().startsWith("file://"),name:_().optional(),_meta:ye(_(),_e()).optional()}),fj=Ze.extend({method:U("roots/list"),params:vt.optional()}),jg=Me.extend({roots:ee(dj)}),pj=kt.extend({method:U("notifications/roots/list_changed"),params:xt.optional()}),wV=me([id,kg,_d,Eg,gd,hd,fd,pd,md,fN,mN,qi,vd,ad,cd,ud,dd]),SV=me([nd,od,wg,pj,Ja]),IV=me([rd,Ha,Ng,Fi,jg,sd,ld,Li]),zV=me([id,VN,ij,fj,ad,cd,ud,dd]),PV=me([nd,od,AN,gN,lN,EN,IN,Ja,aj]),TV=me([rd,QE,lj,SN,_N,aN,sN,uN,yd,TN,sd,ld,Li]),R=class e extends Error{constructor(t,n,i){super(`MCP error ${t}: ${n}`),this.code=t,this.data=i,this.name="McpError"}static fromError(t,n,i){if(t===Z.UrlElicitationRequired&&i){let r=i;if(r.elicitations)return new vg(r.elicitations,n)}return new e(t,n,i)}},vg=class extends R{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(Z.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function jr(e){return e==="completed"||e==="failed"||e==="cancelled"}var Ek=Symbol("Let zodToJsonSchema decide on which parser to use");var Ok={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Nk=e=>typeof e=="string"?{...Ok,name:e}:{...Ok,...e};var jk=e=>{let t=Nk(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function Ag(e,t,n,i){i?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function oe(e,t,n,i,r){e[t]=n,Ag(e,t,i,r)}var $d=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function ze(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?$d(t,e.currentPath):t.join("/")}}function Ak(e,t){let n={type:"array"};return e.type?._def&&e.type?._def?.typeName!==P.ZodAny&&(n.items=F(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&oe(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&oe(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(oe(n,"minItems",e.exactLength.value,e.exactLength.message,t),oe(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function Dk(e,t){let n={type:"integer",format:"int64"};if(!e.checks)return n;for(let i of e.checks)switch(i.kind){case"min":t.target==="jsonSchema7"?i.inclusive?oe(n,"minimum",i.value,i.message,t):oe(n,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(n.exclusiveMinimum=!0),oe(n,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?oe(n,"maximum",i.value,i.message,t):oe(n,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(n.exclusiveMaximum=!0),oe(n,"maximum",i.value,i.message,t));break;case"multipleOf":oe(n,"multipleOf",i.value,i.message,t);break}return n}function Rk(){return{type:"boolean"}}function bd(e,t){return F(e.type._def,t)}var Ck=(e,t)=>F(e.innerType._def,t);function Dg(e,t,n){let i=n??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,o)=>Dg(e,t,r))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return mj(e,t)}}var mj=(e,t)=>{let n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(let i of e.checks)switch(i.kind){case"min":oe(n,"minimum",i.value,i.message,t);break;case"max":oe(n,"maximum",i.value,i.message,t);break}return n};function Uk(e,t){return{...F(e.innerType._def,t),default:e.defaultValue()}}function Zk(e,t){return t.effectStrategy==="input"?F(e.schema._def,t):ze(t)}function Mk(e){return{type:"string",enum:Array.from(e.values)}}var hj=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Lk(e,t){let n=[F(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),F(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(o=>!!o),i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(o=>{if(hj(o))r.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let a=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:s,...c}=o;a=c}else i=void 0;r.push(a)}}),r.length?{allOf:r,...i}:void 0}function Vk(e,t){let n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}var Rg,jt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Rg===void 0&&(Rg=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Rg),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function xd(e,t){let n={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":oe(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t);break;case"max":oe(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":At(n,"email",i.message,t);break;case"format:idn-email":At(n,"idn-email",i.message,t);break;case"pattern:zod":et(n,jt.email,i.message,t);break}break;case"url":At(n,"uri",i.message,t);break;case"uuid":At(n,"uuid",i.message,t);break;case"regex":et(n,i.regex,i.message,t);break;case"cuid":et(n,jt.cuid,i.message,t);break;case"cuid2":et(n,jt.cuid2,i.message,t);break;case"startsWith":et(n,RegExp(`^${Cg(i.value,t)}`),i.message,t);break;case"endsWith":et(n,RegExp(`${Cg(i.value,t)}$`),i.message,t);break;case"datetime":At(n,"date-time",i.message,t);break;case"date":At(n,"date",i.message,t);break;case"time":At(n,"time",i.message,t);break;case"duration":At(n,"duration",i.message,t);break;case"length":oe(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t),oe(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"includes":{et(n,RegExp(Cg(i.value,t)),i.message,t);break}case"ip":{i.version!=="v6"&&At(n,"ipv4",i.message,t),i.version!=="v4"&&At(n,"ipv6",i.message,t);break}case"base64url":et(n,jt.base64url,i.message,t);break;case"jwt":et(n,jt.jwt,i.message,t);break;case"cidr":{i.version!=="v6"&&et(n,jt.ipv4Cidr,i.message,t),i.version!=="v4"&&et(n,jt.ipv6Cidr,i.message,t);break}case"emoji":et(n,jt.emoji(),i.message,t);break;case"ulid":{et(n,jt.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{At(n,"binary",i.message,t);break}case"contentEncoding:base64":{oe(n,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{et(n,jt.base64,i.message,t);break}}break}case"nanoid":et(n,jt.nanoid,i.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function Cg(e,t){return t.patternStrategy==="escape"?vj(e):e}var gj=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function vj(e){let t="";for(let n=0;n<e.length;n++)gj.has(e[n])||(t+="\\"),t+=e[n];return t}function At(e,t,n,i){e.format||e.anyOf?.some(r=>r.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&i.errorMessages&&{errorMessage:{format:n}}})):oe(e,"format",t,n,i)}function et(e,t,n,i){e.pattern||e.allOf?.some(r=>r.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:qk(t,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):oe(e,"pattern",qk(t,i),n,i)}function qk(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=n.i?e.source.toLowerCase():e.source,r="",o=!1,a=!1,s=!1;for(let c=0;c<i.length;c++){if(o){r+=i[c],o=!1;continue}if(n.i){if(a){if(i[c].match(/[a-z]/)){s?(r+=i[c],r+=`${i[c-2]}-${i[c]}`.toUpperCase(),s=!1):i[c+1]==="-"&&i[c+2]?.match(/[a-z]/)?(r+=i[c],s=!0):r+=`${i[c]}${i[c].toUpperCase()}`;continue}}else if(i[c].match(/[a-z]/)){r+=`[${i[c]}${i[c].toUpperCase()}]`;continue}}if(n.m){if(i[c]==="^"){r+=`(^|(?<=[\r
71
+ `);if("message"in e&&typeof e.message=="string")return e.message;try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function Lb(e){return e.description}function Vb(e){if(Bt(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function Ei(e){if(Bt(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 n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let i=e.value;if(i!==void 0)return i}var $e={};er($e,{$brand:()=>Lf,$input:()=>lm,$output:()=>um,INVALID:()=>Xe,NEVER:()=>Mf,TimePrecision:()=>ym,ZodAny:()=>Eh,ZodArray:()=>Dh,ZodBase64:()=>ql,ZodBase64URL:()=>Fl,ZodBigInt:()=>Ci,ZodBigIntFormat:()=>Kl,ZodBoolean:()=>Ri,ZodCIDRv4:()=>Ll,ZodCIDRv6:()=>Vl,ZodCUID:()=>Al,ZodCUID2:()=>Dl,ZodCatch:()=>eg,ZodCodec:()=>Ra,ZodCompileAsyncError:()=>Ot,ZodCompileUnsupportedError:()=>re,ZodCreditCard:()=>Ih,ZodCustom:()=>Ca,ZodCustomStringFormat:()=>un,ZodDate:()=>Ea,ZodDefault:()=>Gh,ZodDiscriminatedUnion:()=>Ch,ZodE164:()=>Bl,ZodEmail:()=>Ol,ZodEmoji:()=>Nl,ZodEnum:()=>ji,ZodError:()=>gE,ZodExactOptional:()=>Wl,ZodFile:()=>Fh,ZodFirstPartyTypeKind:()=>mg,ZodFunction:()=>lg,ZodGUID:()=>El,ZodIBAN:()=>zh,ZodIPv4:()=>Zl,ZodIPv6:()=>Ml,ZodISODate:()=>Tr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Er,ZodISOTime:()=>Or,ZodInstanceOf:()=>pg,ZodIntersection:()=>Uh,ZodIssueCode:()=>_E,ZodJWT:()=>Jl,ZodKSUID:()=>Ul,ZodLazy:()=>sg,ZodLiteral:()=>qh,ZodMAC:()=>Sh,ZodMap:()=>Lh,ZodNaN:()=>rg,ZodNanoID:()=>jl,ZodNever:()=>jh,ZodNonOptional:()=>Xl,ZodNull:()=>Oh,ZodNullable:()=>Kh,ZodNumber:()=>Di,ZodNumberFormat:()=>ln,ZodObject:()=>Na,ZodOptional:()=>dn,ZodPipe:()=>Da,ZodPrefault:()=>Wh,ZodPreprocess:()=>ng,ZodPromise:()=>ug,ZodReadonly:()=>ig,ZodRealError:()=>st,ZodRecord:()=>Ni,ZodSet:()=>Vh,ZodString:()=>Ai,ZodStringFormat:()=>ve,ZodSuccess:()=>Qh,ZodSymbol:()=>Ph,ZodTemplateLiteral:()=>ag,ZodTransform:()=>Bh,ZodTuple:()=>Zh,ZodType:()=>H,ZodULID:()=>Rl,ZodURL:()=>Ta,ZodUUID:()=>Jt,ZodUndefined:()=>Th,ZodUnion:()=>ja,ZodUnknown:()=>Nh,ZodVoid:()=>Ah,ZodXID:()=>Cl,ZodXor:()=>Rh,_ZodString:()=>Tl,_default:()=>Hh,_function:()=>Wx,any:()=>Ex,array:()=>ee,base64:()=>dx,base64url:()=>fx,bigint:()=>Ix,boolean:()=>Te,catch:()=>tg,check:()=>Xx,cidrv4:()=>ux,cidrv6:()=>lx,clone:()=>ue,codec:()=>Jx,coerce:()=>gg,compile:()=>mm,config:()=>Pe,core:()=>Nt,creditCard:()=>mx,cuid:()=>tx,cuid2:()=>rx,currencyCode:()=>$x,custom:()=>Yl,date:()=>jx,decode:()=>yh,decodeAsync:()=>$h,deepPartial:()=>ck,describe:()=>Yx,discriminatedUnion:()=>Aa,e164:()=>px,email:()=>Bb,emoji:()=>Qb,encode:()=>vh,encodeAsync:()=>_h,endsWith:()=>_i,enum:()=>Ue,exactOptional:()=>Jh,file:()=>Vx,flattenError:()=>Ao,float32:()=>xx,float64:()=>kx,formatError:()=>Do,fromJSONSchema:()=>sk,function:()=>Wx,getDiscriminatedOption:()=>om,getErrorMap:()=>bE,globalRegistry:()=>Re,gt:()=>qt,gte:()=>gt,guid:()=>Jb,hash:()=>bx,hex:()=>_x,hostname:()=>yx,httpUrl:()=>Yb,iban:()=>hx,includes:()=>vi,input:()=>lk,instanceof:()=>ek,int:()=>zl,int32:()=>wx,int64:()=>zx,intersection:()=>Ui,invertCodec:()=>Kx,ipv4:()=>ax,ipv6:()=>cx,iso:()=>fn,json:()=>rk,jwt:()=>gx,keyof:()=>Ax,ksuid:()=>ox,lazy:()=>cg,length:()=>on,literal:()=>U,locales:()=>di,looseObject:()=>Ce,looseRecord:()=>Ux,lowercase:()=>hi,lt:()=>Vt,lte:()=>ht,mac:()=>sx,map:()=>Zx,maxLength:()=>nn,maxSize:()=>br,memoizer:()=>Yo,meta:()=>Qx,mime:()=>bi,minLength:()=>cr,minSize:()=>Ft,multipleOf:()=>$r,nan:()=>Bx,nanoid:()=>ex,nativeEnum:()=>Lx,negative:()=>cl,never:()=>Gl,nonnegative:()=>ll,nonoptional:()=>Yh,nonpositive:()=>ul,normalize:()=>xi,null:()=>Oa,nullable:()=>Pa,nullish:()=>qx,number:()=>le,object:()=>j,optional:()=>ge,output:()=>dk,overwrite:()=>Et,parse:()=>ph,parseAsync:()=>mh,partialRecord:()=>Cx,pipe:()=>Pl,positive:()=>sl,prefault:()=>Xh,preprocess:()=>Ua,prettifyError:()=>Jf,promise:()=>Hx,properties:()=>$i,property:()=>dl,readonly:()=>og,record:()=>ye,refine:()=>dg,regex:()=>mi,regexes:()=>mt,registry:()=>Au,safeDecode:()=>xh,safeDecodeAsync:()=>wh,safeEncode:()=>bh,safeEncodeAsync:()=>kh,safeParse:()=>hh,safeParseAsync:()=>gh,set:()=>Mx,setErrorMap:()=>$E,size:()=>rn,slugify:()=>Ii,startsWith:()=>yi,strictObject:()=>Dx,string:()=>_,stringFormat:()=>vx,stringbool:()=>tk,success:()=>Fx,superRefine:()=>fg,symbol:()=>Tx,templateLiteral:()=>Gx,toJSONSchema:()=>an,toLowerCase:()=>wi,toUpperCase:()=>Si,toZod:()=>So,transform:()=>Hl,treeifyError:()=>Bf,trim:()=>ki,tuple:()=>Mh,uint32:()=>Sx,uint64:()=>Px,ulid:()=>nx,undefined:()=>Ox,union:()=>me,unknown:()=>_e,uppercase:()=>gi,url:()=>Xb,util:()=>b,uuid:()=>Kb,uuidv4:()=>Gb,uuidv6:()=>Hb,uuidv7:()=>Wb,validate:()=>ti,validateAsync:()=>ri,void:()=>Nx,withParser:()=>Du,xid:()=>ix,xor:()=>Rx});var Zi={};er(Zi,{ZodAny:()=>Eh,ZodArray:()=>Dh,ZodBase64:()=>ql,ZodBase64URL:()=>Fl,ZodBigInt:()=>Ci,ZodBigIntFormat:()=>Kl,ZodBoolean:()=>Ri,ZodCIDRv4:()=>Ll,ZodCIDRv6:()=>Vl,ZodCUID:()=>Al,ZodCUID2:()=>Dl,ZodCatch:()=>eg,ZodCodec:()=>Ra,ZodCreditCard:()=>Ih,ZodCustom:()=>Ca,ZodCustomStringFormat:()=>un,ZodDate:()=>Ea,ZodDefault:()=>Gh,ZodDiscriminatedUnion:()=>Ch,ZodE164:()=>Bl,ZodEmail:()=>Ol,ZodEmoji:()=>Nl,ZodEnum:()=>ji,ZodExactOptional:()=>Wl,ZodFile:()=>Fh,ZodFunction:()=>lg,ZodGUID:()=>El,ZodIBAN:()=>zh,ZodIPv4:()=>Zl,ZodIPv6:()=>Ml,ZodISODate:()=>Tr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Er,ZodISOTime:()=>Or,ZodInstanceOf:()=>pg,ZodIntersection:()=>Uh,ZodJWT:()=>Jl,ZodKSUID:()=>Ul,ZodLazy:()=>sg,ZodLiteral:()=>qh,ZodMAC:()=>Sh,ZodMap:()=>Lh,ZodNaN:()=>rg,ZodNanoID:()=>jl,ZodNever:()=>jh,ZodNonOptional:()=>Xl,ZodNull:()=>Oh,ZodNullable:()=>Kh,ZodNumber:()=>Di,ZodNumberFormat:()=>ln,ZodObject:()=>Na,ZodOptional:()=>dn,ZodPipe:()=>Da,ZodPrefault:()=>Wh,ZodPreprocess:()=>ng,ZodPromise:()=>ug,ZodReadonly:()=>ig,ZodRecord:()=>Ni,ZodSet:()=>Vh,ZodString:()=>Ai,ZodStringFormat:()=>ve,ZodSuccess:()=>Qh,ZodSymbol:()=>Ph,ZodTemplateLiteral:()=>ag,ZodTransform:()=>Bh,ZodTuple:()=>Zh,ZodType:()=>H,ZodULID:()=>Rl,ZodURL:()=>Ta,ZodUUID:()=>Jt,ZodUndefined:()=>Th,ZodUnion:()=>ja,ZodUnknown:()=>Nh,ZodVoid:()=>Ah,ZodXID:()=>Cl,ZodXor:()=>Rh,_ZodString:()=>Tl,_default:()=>Hh,_function:()=>Wx,any:()=>Ex,array:()=>ee,base64:()=>dx,base64url:()=>fx,bigint:()=>Ix,boolean:()=>Te,catch:()=>tg,check:()=>Xx,cidrv4:()=>ux,cidrv6:()=>lx,codec:()=>Jx,creditCard:()=>mx,cuid:()=>tx,cuid2:()=>rx,currencyCode:()=>$x,custom:()=>Yl,date:()=>jx,describe:()=>Yx,discriminatedUnion:()=>Aa,e164:()=>px,email:()=>Bb,emoji:()=>Qb,enum:()=>Ue,exactOptional:()=>Jh,file:()=>Vx,float32:()=>xx,float64:()=>kx,function:()=>Wx,guid:()=>Jb,hash:()=>bx,hex:()=>_x,hostname:()=>yx,httpUrl:()=>Yb,iban:()=>hx,instanceof:()=>ek,int:()=>zl,int32:()=>wx,int64:()=>zx,intersection:()=>Ui,invertCodec:()=>Kx,ipv4:()=>ax,ipv6:()=>cx,json:()=>rk,jwt:()=>gx,keyof:()=>Ax,ksuid:()=>ox,lazy:()=>cg,literal:()=>U,looseObject:()=>Ce,looseRecord:()=>Ux,mac:()=>sx,map:()=>Zx,meta:()=>Qx,nan:()=>Bx,nanoid:()=>ex,nativeEnum:()=>Lx,never:()=>Gl,nonoptional:()=>Yh,null:()=>Oa,nullable:()=>Pa,nullish:()=>qx,number:()=>le,object:()=>j,optional:()=>ge,partialRecord:()=>Cx,pipe:()=>Pl,prefault:()=>Xh,preprocess:()=>Ua,promise:()=>Hx,readonly:()=>og,record:()=>ye,refine:()=>dg,set:()=>Mx,strictObject:()=>Dx,string:()=>_,stringFormat:()=>vx,stringbool:()=>tk,success:()=>Fx,superRefine:()=>fg,symbol:()=>Tx,templateLiteral:()=>Gx,transform:()=>Hl,tuple:()=>Mh,uint32:()=>Sx,uint64:()=>Px,ulid:()=>nx,undefined:()=>Ox,union:()=>me,unknown:()=>_e,url:()=>Xb,uuid:()=>Kb,uuidv4:()=>Gb,uuidv6:()=>Hb,uuidv7:()=>Wb,void:()=>Nx,xid:()=>ix,xor:()=>Rx});var Sl={};er(Sl,{endsWith:()=>_i,gt:()=>qt,gte:()=>gt,includes:()=>vi,length:()=>on,lowercase:()=>hi,lt:()=>Vt,lte:()=>ht,maxLength:()=>nn,maxSize:()=>br,mime:()=>bi,minLength:()=>cr,minSize:()=>Ft,multipleOf:()=>$r,negative:()=>cl,nonnegative:()=>ll,nonpositive:()=>ul,normalize:()=>xi,overwrite:()=>Et,positive:()=>sl,properties:()=>$i,property:()=>dl,regex:()=>mi,size:()=>rn,slugify:()=>Ii,startsWith:()=>yi,toLowerCase:()=>wi,toUpperCase:()=>Si,trim:()=>ki,uppercase:()=>gi});var qb=new WeakSet([Object.prototype,Error.prototype]);function Il(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}var Fb=(e,t)=>{Ff.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);qb.has(n)||(qb.add(n),Il(n,"format",i=>r=>Do(i,r)),Il(n,"flatten",i=>r=>Ao(i,r)),Il(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,qn,2)}),Il(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,qn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},gE=g("ZodError",Fb),st=g("ZodError",Fb,void 0,{Parent:Error});var ph=Hn(st),mh=Wn(st),hh=Xn(st),gh=Qn(st),vh=Js(st),yh=Ks(st),_h=Gs(st),$h=Hs(st),bh=Ws(st),xh=Xs(st),kh=Ys(st),wh=Qs(st);function yE(){Ae.localeError||Pe(Ou())}function cn(){Ae.memoizer||Pe({memoizer:Yo()})}var H=g("ZodType",(e,t)=>(yE(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(b.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ue(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(dg(e,t))},superRefine(e,t){return this.check(fg(e,t))},overwrite(e){return this.check(Et(e))},optional(){return ge(this)},exactOptional(){return Jh(this)},nullable(){return Pa(this)},nullish(){return ge(Pa(this))},nonoptional(e){return Yh(this,e)},array(){return ee(this)},or(e){return me([this,e])},and(e){return Ui(this,e)},transform(e){return Pl(this,Hl(e))},default(e){return Hh(this,e)},prefault(e){return Xh(this,e)},catch(e){return tg(this,e)},pipe(e){return Pl(this,e)},readonly(){return og(this)},describe(e){let t=this.clone();return Re.add(t,{description:e}),t},meta(...e){if(e.length===0)return Re.get(this);let t=this.clone();return Re.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return b.hide(this,"~standard",{...lc(this),jsonSchema:{input:zi(this,"input"),output:zi(this,"output")}})},set"~standard"(e){b.own(this,"~standard",e)},parse:function e(t,n){return ph(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await mh(this,t,n,{callee:e})},safeParse(e,t){return hh(this,e,t)},async safeParseAsync(e,t){return gh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){b.own(this,"spa",e)},validate(e,t){return ti(this,e,t)},validateAsync(e,t){return ri(this,e,t)},encode:function e(t,n){return vh(this,t,n,{callee:e})},decode:function e(t,n){return yh(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await _h(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await $h(this,t,n,{callee:e})},safeEncode(e,t){return bh(this,e,t)},safeDecode(e,t){return xh(this,e,t)},async safeEncodeAsync(e,t){return kh(this,e,t)},async safeDecodeAsync(e,t){return wh(this,e,t)},toJSONSchema(e){return Sm(this,{})(e)},get description(){return Re.get(this)?.description},get _def(){return this._zod.def}}),Tl=g("_ZodString",(e,t)=>{yr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Pm(e,n,i,r)},b.derived({format:e=>Ne(e).format??null,minLength:e=>Ne(e).minimum??null,maxLength:e=>Ne(e).maximum??null},{regex(...e){return this.check(mi(...e))},includes(...e){return this.check(vi(...e))},startsWith(...e){return this.check(yi(...e))},endsWith(...e){return this.check(_i(...e))},min(...e){return this.check(cr(...e))},max(...e){return this.check(nn(...e))},length(...e){return this.check(on(...e))},nonempty(...e){return this.check(cr(1,...e))},lowercase(e){return this.check(hi(e))},uppercase(e){return this.check(gi(e))},trim(){return this.check(ki())},normalize(...e){return this.check(xi(...e))},toLowerCase(){return this.check(wi())},toUpperCase(){return this.check(Si())},slugify(){return this.check(Ii())}})),Ai=g("ZodString",(e,t)=>{yr.init(e,t),Tl.init(e,t)},{email(e){return this.check(ea(Ol,e))},url(e){return this.check(pi(Ta,e))},jwt(e){return this.check($a(Jl,e))},emoji(e){return this.check(aa(Nl,e))},guid(e){return this.check(ta(El,e))},uuid(e){return this.check(ra(Jt,e))},uuidv4(e){return this.check(na(Jt,e))},uuidv6(e){return this.check(ia(Jt,e))},uuidv7(e){return this.check(oa(Jt,e))},nanoid(e){return this.check(sa(jl,e))},cuid(e){return this.check(ca(Al,e))},cuid2(e){return this.check(ua(Dl,e))},ulid(e){return this.check(la(Rl,e))},base64(e){return this.check(va(ql,e))},base64url(e){return this.check(ya(Fl,e))},xid(e){return this.check(da(Cl,e))},ksuid(e){return this.check(fa(Ul,e))},ipv4(e){return this.check(pa(Zl,e))},ipv6(e){return this.check(ma(Ml,e))},cidrv4(e){return this.check(ha(Ll,e))},cidrv6(e){return this.check(ga(Vl,e))},e164(e){return this.check(_a(Bl,e))},datetime(e){return this.check(ba(Pr,e))},date(e){return this.check(xa(Tr,e))},time(e){return this.check(ka(Or,e))},duration(e){return this.check(wa(Er,e))}});function _(e){return Uu(Ai,e)}var ve=g("ZodStringFormat",(e,t)=>{fe.init(e,t),Tl.init(e,t)}),Pr=g("ZodISODateTime",(e,t)=>{Qp.init(e,t),ve.init(e,t)}),Tr=g("ZodISODate",(e,t)=>{em.init(e,t),ve.init(e,t)}),Or=g("ZodISOTime",(e,t)=>{tm.init(e,t),ve.init(e,t)}),Er=g("ZodISODuration",(e,t)=>{rm.init(e,t),ve.init(e,t)}),Ol=g("ZodEmail",(e,t)=>{pc.init(e,t),ve.init(e,t)});function Bb(e){return ea(Ol,e)}var El=g("ZodGUID",(e,t)=>{dc.init(e,t),ve.init(e,t)});function Jb(e){return ta(El,e)}var Jt=g("ZodUUID",(e,t)=>{fc.init(e,t),ve.init(e,t)});function Kb(e){return ra(Jt,e)}function Gb(e){return na(Jt,e)}function Hb(e){return ia(Jt,e)}function Wb(e){return oa(Jt,e)}var Ta=g("ZodURL",(e,t)=>{vc.init(e,t),ve.init(e,t)});function Xb(e){return pi(Ta,e)}function Yb(e){return pi(Ta,{protocol:Ro,hostname:pp,...b.normalizeParams(e)})}var Nl=g("ZodEmoji",(e,t)=>{yc.init(e,t),ve.init(e,t)});function Qb(e){return aa(Nl,e)}var jl=g("ZodNanoID",(e,t)=>{_c.init(e,t),ve.init(e,t)});function ex(e){return sa(jl,e)}var Al=g("ZodCUID",(e,t)=>{$c.init(e,t),ve.init(e,t)});function tx(e){return ca(Al,e)}var Dl=g("ZodCUID2",(e,t)=>{bc.init(e,t),ve.init(e,t)});function rx(e){return ua(Dl,e)}var Rl=g("ZodULID",(e,t)=>{xc.init(e,t),ve.init(e,t)});function nx(e){return la(Rl,e)}var Cl=g("ZodXID",(e,t)=>{kc.init(e,t),ve.init(e,t)});function ix(e){return da(Cl,e)}var Ul=g("ZodKSUID",(e,t)=>{wc.init(e,t),ve.init(e,t)});function ox(e){return fa(Ul,e)}var Zl=g("ZodIPv4",(e,t)=>{Sc.init(e,t),ve.init(e,t)});function ax(e){return pa(Zl,e)}var Sh=g("ZodMAC",(e,t)=>{zc.init(e,t),ve.init(e,t)});function sx(e){return Zu(Sh,e)}var Ml=g("ZodIPv6",(e,t)=>{Ic.init(e,t),ve.init(e,t)});function cx(e){return ma(Ml,e)}var Ll=g("ZodCIDRv4",(e,t)=>{Pc.init(e,t),ve.init(e,t)});function ux(e){return ha(Ll,e)}var Vl=g("ZodCIDRv6",(e,t)=>{Oc.init(e,t),ve.init(e,t)});function lx(e){return ga(Vl,e)}var ql=g("ZodBase64",(e,t)=>{Nc.init(e,t),ve.init(e,t)});function dx(e){return va(ql,e)}var Fl=g("ZodBase64URL",(e,t)=>{Ac.init(e,t),ve.init(e,t)});function fx(e){return ya(Fl,e)}var Bl=g("ZodE164",(e,t)=>{Dc.init(e,t),ve.init(e,t)});function px(e){return _a(Bl,e)}var Ih=g("ZodCreditCard",(e,t)=>{Cc.init(e,t),ve.init(e,t)});function mx(e){return Mu(Ih,e)}var zh=g("ZodIBAN",(e,t)=>{Zc.init(e,t),ve.init(e,t)});function hx(e){return Lu(zh,e)}var Jl=g("ZodJWT",(e,t)=>{Lc.init(e,t),ve.init(e,t)});function gx(e){return $a(Jl,e)}var un=g("ZodCustomStringFormat",(e,t)=>{Vc.init(e,t),ve.init(e,t)});function vx(e,t,n={}){return xr(un,e,t,n)}function yx(e){return xr(un,"hostname",fp,e)}function _x(e){return xr(un,"hex",zp,e)}function $x(e){return xr(un,"currency_code",hp,e)}function bx(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=mt[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return xr(un,i,r,t)}var Di=g("ZodNumber",(e,t)=>{Bo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Tm(e,n,i,r),e.isFinite=!0},b.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Ne(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Ne(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=Ne(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Ne(e).format??null},{gt(e,t){return this.check(qt(e,t))},gte(e,t){return this.check(gt(e,t))},min(e,t){return this.check(gt(e,t))},lt(e,t){return this.check(Vt(e,t))},lte(e,t){return this.check(ht(e,t))},max(e,t){return this.check(ht(e,t))},int(e){return this.check(zl(e))},safe(e){return this.check(zl(e))},positive(e){return this.check(qt(0,e))},nonnegative(e){return this.check(gt(0,e))},negative(e){return this.check(Vt(0,e))},nonpositive(e){return this.check(ht(0,e))},multipleOf(e,t){return this.check($r(e,t))},step(e,t){return this.check($r(e,t))},finite(){return this}}));function le(e){return Vu(Di,e)}var ln=g("ZodNumberFormat",(e,t)=>{qc.init(e,t),Di.init(e,t)});function zl(e){return qu(ln,e)}function xx(e){return Fu(ln,e)}function kx(e){return Bu(ln,e)}function wx(e){return Ju(ln,e)}function Sx(e){return Ku(ln,e)}var Ri=g("ZodBoolean",(e,t)=>{oi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Om(e,n,i,r)});function Te(e){return Gu(Ri,e)}var Ci=g("ZodBigInt",(e,t)=>{Jo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Em(e,n,i,r)},b.derived({minValue:e=>Ne(e).minimum??null,maxValue:e=>Ne(e).maximum??null,format:e=>Ne(e).format??null},{gte(e,t){return this.check(gt(e,t))},min(e,t){return this.check(gt(e,t))},gt(e,t){return this.check(qt(e,t))},lt(e,t){return this.check(Vt(e,t))},lte(e,t){return this.check(ht(e,t))},max(e,t){return this.check(ht(e,t))},positive(e){return this.check(qt(BigInt(0),e))},negative(e){return this.check(Vt(BigInt(0),e))},nonpositive(e){return this.check(ht(BigInt(0),e))},nonnegative(e){return this.check(gt(BigInt(0),e))},multipleOf(e,t){return this.check($r(e,t))}}));function Ix(e){return Hu(Ci,e)}var Kl=g("ZodBigIntFormat",(e,t)=>{Fc.init(e,t),Ci.init(e,t)});function zx(e){return Wu(Kl,e)}function Px(e){return Xu(Kl,e)}var Ph=g("ZodSymbol",(e,t)=>{Bc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Nm(e,n,i,r)});function Tx(e){return Yu(Ph,e)}var Th=g("ZodUndefined",(e,t)=>{Jc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Am(e,n,i,r)});function Ox(e){return Qu(Th,e)}var Oh=g("ZodNull",(e,t)=>{Kc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>jm(e,n,i,r)});function Oa(e){return el(Oh,e)}var Eh=g("ZodAny",(e,t)=>{Gc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Cm(e,n,i,r)});function Ex(){return tl(Eh)}var Nh=g("ZodUnknown",(e,t)=>{Hc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Um(e,n,i,r)});function _e(){return rl(Nh)}var jh=g("ZodNever",(e,t)=>{Wc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Rm(e,n,i,r)});function Gl(e){return nl(jh,e)}var Ah=g("ZodVoid",(e,t)=>{Xc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Dm(e,n,i,r)});function Nx(e){return il(Ah,e)}var Ea=g("ZodDate",(e,t)=>{Yc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Zm(e,n,i,r),e.min=(n,i)=>e.check(gt(n,i)),e.max=(n,i)=>e.check(ht(n,i))},b.derived({minDate:e=>{let{minimum:t}=Ne(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Ne(e);return t?new Date(t):null}},{}));function jx(e){return ol(Ea,e)}var Dh=g("ZodArray",(e,t)=>{cn(),Qc.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Xm(e,n,i,r),e.element=t.element},{min(e,t){return this.check(cr(e,t))},nonempty(e){return this.check(cr(1,e))},max(e,t){return this.check(nn(e,t))},length(e,t){return this.check(on(e,t))},unwrap(){return this.element}});function ee(e,t){return km(Dh,e,t)}function Ax(e){let t=e._zod.def.shape;return Ue(Object.keys(t))}var Na=g("ZodObject",(e,t)=>{cn(),im.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Ym(e,n,i,r),b.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Ue(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(b.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(b.mergeDefs(this._zod.def,{catchall:_e()}))},loose(){return this.clone(b.mergeDefs(this._zod.def,{catchall:_e()}))},strict(){return this.clone(b.mergeDefs(this._zod.def,{catchall:Gl()}))},strip(){return this.clone(b.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return b.extend(this,e)},safeExtend(e){return b.safeExtend(this,e)},merge(e){return b.merge(this,e)},pick(e){return b.pick(this,e)},omit(e){return b.omit(this,e)},partial(...e){return b.partial(dn,this,e[0])},exactPartial(...e){return b.partial(Wl,this,e[0],"exactPartial")},required(...e){return b.required(Xl,this,e[0])}});function j(e,t){let n={type:"object",shape:e??{},...b.normalizeParams(t)};return new Na(n)}function Dx(e,t){return new Na({type:"object",shape:e,catchall:Gl(),...b.normalizeParams(t)})}function Ce(e,t){return new Na({type:"object",shape:e,catchall:_e(),...b.normalizeParams(t)})}var ja=g("ZodUnion",(e,t)=>{ai.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>$l(e,n,i,r),e.options=t.options});function me(e,t){return new ja({type:"union",options:e,...b.normalizeParams(t)})}var Rh=g("ZodXor",(e,t)=>{ja.init(e,t),tu.init(e,t),e._zod.processJSONSchema=(n,i,r)=>$l(e,n,i,r),e.options=t.options});function Rx(e,t){return new Rh({type:"union",options:e,inclusive:!1,...b.normalizeParams(t)})}var Ch=g("ZodDiscriminatedUnion",(e,t)=>{ja.init(e,t),ru.init(e,t)});function Aa(e,t,n){return new Ch({type:"union",options:t,discriminator:e,...b.normalizeParams(n)})}var Uh=g("ZodIntersection",(e,t)=>{nu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Qm(e,n,i,r)});function Ui(e,t){return new Uh({type:"intersection",left:e,right:t})}var Zh=g("ZodTuple",(e,t)=>{cn(),Ko.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>eh(e,n,i,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new dn({type:"optional",innerType:t}))})}});function Mh(e,t,n){let i=t instanceof B,r=i?n:t,o=i?t:null;return new Zh({type:"tuple",items:e,rest:o,...b.normalizeParams(r)})}var Ni=g("ZodRecord",(e,t)=>{cn(),iu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>th(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function ye(e,t,n){return!t||!t._zod?new Ni({type:"record",keyType:_(),valueType:e,...b.normalizeParams(t)}):new Ni({type:"record",keyType:e,valueType:t,...b.normalizeParams(n)})}function Cx(e,t,n){return new Ni({type:"record",keyType:e,valueType:t,...b.normalizeParams(n),partial:!0})}function Ux(e,t,n){return new Ni({type:"record",keyType:e,valueType:t,mode:"loose",...b.normalizeParams(n)})}var Lh=g("ZodMap",(e,t)=>{cn(),ou.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Hm(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Ft(...n)),e.nonempty=n=>e.check(Ft(1,n)),e.max=(...n)=>e.check(br(...n)),e.size=(...n)=>e.check(rn(...n))});function Zx(e,t,n){return new Lh({type:"map",keyType:e,valueType:t,...b.normalizeParams(n)})}var Vh=g("ZodSet",(e,t)=>{cn(),au.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Wm(e,n,i,r),e.min=(...n)=>e.check(Ft(...n)),e.nonempty=n=>e.check(Ft(1,n)),e.max=(...n)=>e.check(br(...n)),e.size=(...n)=>e.check(rn(...n))});function Mx(e,t){return new Vh({type:"set",valueType:e,...b.normalizeParams(t)})}var ji=g("ZodEnum",(e,t)=>{su.init(e,t),H.init(e,t),e._zod.processJSONSchema=(i,r,o)=>Mm(e,i,r,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let o={};for(let a of i)if(n.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ji({...t,checks:[],...b.normalizeParams(r),entries:o})},e.exclude=(i,r)=>{let o={...t.entries};for(let a of i)if(n.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new ji({...t,checks:[],...b.normalizeParams(r),entries:o})}});function Ue(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ji({type:"enum",entries:n,...b.normalizeParams(t)})}function Lx(e,t){return new ji({type:"enum",entries:e,...b.normalizeParams(t)})}var qh=g("ZodLiteral",(e,t)=>{cu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Lm(e,n,i,r),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 U(e,t){return new qh({type:"literal",values:Array.isArray(e)?e:[e],...b.normalizeParams(t)})}var Fh=g("ZodFile",(e,t)=>{uu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Fm(e,n,i,r),e.min=(n,i)=>e.check(Ft(n,i)),e.max=(n,i)=>e.check(br(n,i)),e.mime=(n,i)=>e.check(bi(Array.isArray(n)?n:[n],i))});function Vx(e){return fl(Fh,e)}var Bh=g("ZodTransform",(e,t)=>{cn(),lu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Gm(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new vr(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(b.issue(o,n.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=e),n.issues.push(b.issue(a))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function Hl(e){return new Bh({type:"transform",transform:e})}var dn=g("ZodOptional",(e,t)=>{Go.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>bl(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function ge(e){return new dn({type:"optional",innerType:e})}var Wl=g("ZodExactOptional",(e,t)=>{du.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>bl(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Jh(e){return new Wl({type:"optional",innerType:e})}var Kh=g("ZodNullable",(e,t)=>{fu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>rh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Pa(e){return new Kh({type:"nullable",innerType:e})}function qx(e){return ge(Pa(e))}var Gh=g("ZodDefault",(e,t)=>{pu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>oh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hh(e,t){return new Gh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():b.shallowClone(t)}})}var Wh=g("ZodPrefault",(e,t)=>{mu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ah(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Xh(e,t){return new Wh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():b.shallowClone(t)}})}var Xl=g("ZodNonOptional",(e,t)=>{hu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>nh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Yh(e,t){return new Xl({type:"nonoptional",innerType:e,...b.normalizeParams(t)})}var Qh=g("ZodSuccess",(e,t)=>{gu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Bm(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Fx(e){return new Qh({type:"success",innerType:e})}var eg=g("ZodCatch",(e,t)=>{vu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>sh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tg(e,t){return new eg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:b.constantCatch(t)})}var rg=g("ZodNaN",(e,t)=>{yu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Vm(e,n,i,r)});function Bx(e){return al(rg,e)}var Da=g("ZodPipe",(e,t)=>{Ho.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ch(e,n,i,r),e.in=t.in,e.out=t.out});function Pl(e,t){return new Da({type:"pipe",in:e,out:t})}var Ra=g("ZodCodec",(e,t)=>{Da.init(e,t),si.init(e,t)});function Jx(e,t,n){return new Ra({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function Kx(e){let t=e._zod.def;return new Ra({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var ng=g("ZodPreprocess",(e,t)=>{Da.init(e,t),am.init(e,t)}),ig=g("ZodReadonly",(e,t)=>{_u.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>uh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function og(e){return new ig({type:"readonly",innerType:e})}var ag=g("ZodTemplateLiteral",(e,t)=>{$u.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>qm(e,n,i,r)});function Gx(e,t){return new ag({type:"template_literal",parts:e,...b.normalizeParams(t)})}var sg=g("ZodLazy",(e,t)=>{ci.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>dh(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function cg(e){return new sg({type:"lazy",getter:e})}var ug=g("ZodPromise",(e,t)=>{xu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>lh(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Hx(e){return new ug({type:"promise",innerType:e})}var lg=g("ZodFunction",(e,t)=>{bu.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Km(e,n,i,r)});function Wx(e){return new lg({type:"function",input:Array.isArray(e?.input)?Mh(e?.input):e?.input??ee(_e()),output:e?.output??_e()})}var Ca=g("ZodCustom",(e,t)=>{ku.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Jm(e,n,i,r)});function Xx(e){let t=new he({check:"custom"});return t._zod.check=e,t}function Yl(e,t){return pl(Ca,e??(()=>!0),t)}function dg(e,t={}){return ml(Ca,e,t)}function fg(e,t){return hl(e,t)}var Yx=gl,Qx=vl,pg=g("ZodInstanceOf",(e,t)=>{Ca.init(e,t)},{properties(e,t){return this.check($i(e,t))}});function ek(e,t={}){let n=new pg({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...b.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var tk=(...e)=>yl({Codec:Ra,Boolean:Ri,String:Ai},...e);function rk(e){let t=cg(()=>me([_(e),le(),Te(),Oa(),ee(t),ye(_(),t)]));return t}function Ua(e,t){return new ng({type:"pipe",in:Hl(e),out:t})}var _E={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function $E(e){Pe({customError:e})}function bE(){return Pe().customError}var mg;mg||(mg={});var fn={};er(fn,{ZodISODate:()=>Tr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Er,ZodISOTime:()=>Or,date:()=>kE,datetime:()=>xE,duration:()=>SE,time:()=>wE});function xE(e){return ba(Pr,e)}function kE(e){return xa(Tr,e)}function wE(e){return ka(Or,e)}function SE(e){return wa(Er,e)}var O={...Zi,...Sl,iso:fn},IE=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function zE(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function nk(e,t){return e.map((n,i)=>i<t?n:n.optional())}function PE(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function TE(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1]===void 0?void 0:PE(n[1]);if(!r||!t.defs[r])throw new Error(`Reference not found: ${e}`);return t.defs[r]}throw new Error(`Reference not found: ${e}`)}function OE(e,t){return O.transform(i=>i).check(i=>{let r=i.value;if(typeof r!="object"||r===null||Array.isArray(r))return;let o=Object.getOwnPropertyNames(r);if(t.minProperties!==void 0&&o.length<t.minProperties&&i.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:r,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:r,inst:e,continue:!0}),t.keySchema)for(let a of o){let s=t.keySchema.safeParse(a);s.success||i.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function hg(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let i=String(e);return`${n[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let a of e){let s=hg(a,t);if(s===null)return null;o.push(s)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(e).sort(),r=[];for(let o of i){let a=hg(e[o],t);if(a===null)return null;r.push(`${o.length}:${o}=${a}`)}return`o${r.length}:{${r.join(",")}}`}finally{t.delete(e)}}var EE=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),NE=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Za(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Za):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>EE.has(t)?Za(n):!NE.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(Za))}function ik(e){return e===1?"element":"elements"}function jE(e,t){return O.transform(i=>i).check(i=>{let r=i.value;if(Array.isArray(r)){if(t.uniqueItems===!0){let o=new Map;for(let a=0;a<r.length;a++){let s=hg(r[a],new Set);if(s===null)continue;let c=o.get(s);if(c===void 0){o.set(s,a);continue}i.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${c}`,input:r,path:[a],continue:!0})}}if(t.containsSchema){let o=t.minContains??1,a=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,s=0;for(let c of r)if(t.containsSchema.safeParse(c).success&&++s>=a)break;s<o&&i.issues.push({code:"custom",message:`Array must contain at least ${o} matching ${ik(o)}; found ${s}`,input:r,continue:!0}),t.maxContains!==void 0&&s>t.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${ik(t.maxContains)}`,input:r,continue:!0})}}}).pipe(e)}function ok(e,t){if(e!==!1)return e===void 0||e===!0?O.any():Qe(e,t)}var AE=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function ak(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return O.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let o=TE(r,t),a=Qe(o,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return O.null();if(r.length===0)return O.never();if(r.length===1)return O.literal(r[0]);if(r.every(a=>typeof a=="string"))return O.enum(r);let o=r.map(a=>O.literal(a));return o.length<2?o[0]:O.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return O.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(o=>{let a={...e,type:o};return ak(a,t)});return r.length===0?O.never():r.length===1?r[0]:O.union(r)}if(!n)return O.any();let i;switch(n){case"string":{let r=O.string();if(e.format){let o=e.format;o==="email"?r=r.check(O.email()):o==="uri"||o==="uri-reference"?r=r.check(O.url()):o==="uuid"||o==="guid"?r=r.check(O.uuid()):o==="date-time"?r=r.check(O.iso.datetime({offset:!0})):o==="date"?r=r.check(O.iso.date()):o==="time"?r=r.check(O.regex(AE)):o==="duration"?r=r.check(O.iso.duration()):o==="hostname"?r=r.check(O.hostname()):o==="ipv4"?r=r.check(O.ipv4()):o==="ipv6"?r=r.check(O.ipv6()):o==="mac"?r=r.check(O.mac()):o==="cidr"?r=r.check(O.cidrv4()):o==="cidr-v6"?r=r.check(O.cidrv6()):o==="base64"?r=r.check(O.base64()):o==="base64url"?r=r.check(O.base64url()):o==="e164"?r=r.check(O.e164()):o==="credit_card"?r=r.check(O.creditCard()):o==="iban"?r=r.check(O.iban()):o==="jwt"?r=r.check(O.jwt()):o==="emoji"?r=r.check(O.emoji()):o==="nanoid"?r=r.check(O.nanoid()):o==="cuid"?r=r.check(O.cuid()):o==="cuid2"?r=r.check(O.cuid2()):o==="ulid"?r=r.check(O.ulid()):o==="xid"?r=r.check(O.xid()):o==="ksuid"&&(r=r.check(O.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?O.number().int():O.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=O.boolean();break}case"null":{i=O.null();break}case"object":{let r={},o=e.properties||{},a=new Set(e.required||[]),s=typeof e.additionalProperties=="object"?Qe(e.additionalProperties,t):void 0;for(let[d,f]of Object.entries(o)){let p=Qe(f,t);De(r,d,a.has(d)?p:p.optional())}if(e.patternProperties){let d=e.patternProperties,f=Object.keys(d),p=[];for(let h of f){let y=Qe(d[h],t),$=O.string().regex(new RegExp(h));p.push(O.looseRecord($,y))}let m=[];if(Object.keys(r).length>0&&m.push(O.object(r).passthrough()),m.push(...p),m.length===0)i=O.object({}).passthrough();else if(m.length===1)i=m[0];else{let h=O.intersection(m[0],m[1]);for(let y=2;y<m.length;y++)h=O.intersection(h,m[y]);i=h}if(e.additionalProperties===!1){let h=Object.keys(r),y=f.map(w=>new RegExp(w)),$=i;i=i.check(w=>{if(!$t(w.value))return;let z=[];for(let D of Object.keys(w.value))h.includes(D)||y.some(E=>E.test(D))||z.push(D);z.length&&w.issues.push({code:"unrecognized_keys",keys:z,input:w.value,inst:$})})}}else{let d=O.object(r);e.additionalProperties===!1?i=d.strict():s?i=d.catchall(s):i=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let d;if(c){let f=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=Qe(f,t)}i=OE(i,{keySchema:d,minProperties:u,maxProperties:l})}break}case"array":{let r=e.prefixItems,o=e.items;if(r&&Array.isArray(r)){let a=typeof e.minItems=="number"?e.minItems:0,s=r.map(d=>Qe(d,t)),c=nk(s,a),u=Array.isArray(o)?void 0:ok(o,t),l=O.tuple(c);i=u?l.rest(u):l,typeof e.minItems=="number"&&(i=i.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(O.maxLength(e.maxItems)))}else if(Array.isArray(o)){let a=typeof e.minItems=="number"?e.minItems:0,s=o.map(d=>Qe(d,t)),c=nk(s,a),u=ok(e.additionalItems,t),l=O.tuple(c);i=u?l.rest(u):l,typeof e.minItems=="number"&&(i=i.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(O.maxLength(e.maxItems)))}else if(o!==void 0){let a=Qe(o,t),s=O.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),i=s}else i=O.array(O.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=jE(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?Qe(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return i}function Qe(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n=ak(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(u=>Qe(u,t)),c=O.union(s);n=i?O.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(u=>Qe(u,t)),c=O.xor(s);n=i?O.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:O.any();else{let s=i?n:Qe(e.allOf[0],t),c=i?0:1;for(let u=c;u<e.allOf.length;u++)s=O.intersection(s,Qe(e.allOf[u],t));n=s}e.nullable===!0&&t.version==="openapi-3.0"&&(n=O.nullable(n)),e.readOnly===!0&&(n=O.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in e&&(r[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(r[s]=e[s]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Za(e.propertyNames)&&(r.propertyNames=e.propertyNames);for(let s of["minProperties","maxProperties"])e[s]!==void 0&&(r[s]=e[s])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Za(e.contains)&&(r.contains=e.contains);for(let s of["uniqueItems","minContains","maxContains"])e[s]!==void 0&&(r[s]=e[s])}for(let s of Object.keys(e))IE.has(s)||De(r,s,e[s]);return Object.keys(r).length>0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function sk(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=zE(n,t?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Re};return Qe(n,o)}function ck(e){return za(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:me(n.options)}})}function DE(e,t){if(!t?.length)return e;let n=e._zod.def;return ue(e,_t(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function uk(e){return DE(e.out,e.checks)}function RE(e){return e.in._zod.traits.has("$ZodTransform")?uk(e):e.in}function lk(e){return za(e,{pipe:t=>RE(t._zod.def),default:(t,n)=>n?ge(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function dk(e){return za(e,{pipe:t=>uk(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var gg={};er(gg,{bigint:()=>ME,boolean:()=>ZE,date:()=>LE,number:()=>UE,string:()=>CE});function CE(e){return vm(Ai,e)}function UE(e){return _m(Di,e)}function ZE(e){return $m(Ri,e)}function ME(e){return bm(Ci,e)}function LE(e){return xm(Ea,e)}var yg="2025-11-25";var fk=[yg,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Nr="io.modelcontextprotocol/related-task",ed="2.0",je=Yl(e=>e!==null&&(typeof e=="object"||typeof e=="function")),pk=me([_(),le().int()]),mk=_(),bV=Ce({ttl:le().optional(),pollInterval:le().optional()}),VE=j({ttl:le().optional()}),qE=j({taskId:_()}),_g=Ce({progressToken:pk.optional(),[Nr]:qE.optional()}),vt=j({_meta:_g.optional()}),Ma=vt.extend({task:VE.optional()}),hk=e=>Ma.safeParse(e).success,Ze=j({method:_(),params:vt.loose().optional()}),xt=j({_meta:_g.optional()}),kt=j({method:_(),params:xt.loose().optional()}),Me=Ce({_meta:_g.optional()}),td=me([_(),le().int()]),gk=j({jsonrpc:U(ed),id:td,...Ze.shape}).strict(),$g=e=>gk.safeParse(e).success,vk=j({jsonrpc:U(ed),...kt.shape}).strict(),yk=e=>vk.safeParse(e).success,bg=j({jsonrpc:U(ed),id:td,result:Me}).strict(),La=e=>bg.safeParse(e).success;var Z;(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"})(Z||(Z={}));var xg=j({jsonrpc:U(ed),id:td.optional(),error:j({code:le().int(),message:_(),data:_e().optional()})}).strict();var _k=e=>xg.safeParse(e).success;var $k=me([gk,vk,bg,xg]),xV=me([bg,xg]),rd=Me.strict(),FE=xt.extend({requestId:td.optional(),reason:_().optional()}),nd=kt.extend({method:U("notifications/cancelled"),params:FE}),BE=j({src:_(),mimeType:_().optional(),sizes:ee(_()).optional(),theme:Ue(["light","dark"]).optional()}),Va=j({icons:ee(BE).optional()}),Mi=j({name:_(),title:_().optional()}),bk=Mi.extend({...Mi.shape,...Va.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),JE=Ui(j({applyDefaults:Te().optional()}),ye(_(),_e())),KE=Ua(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ui(j({form:JE.optional(),url:je.optional()}),ye(_(),_e()).optional())),GE=Ce({list:je.optional(),cancel:je.optional(),requests:Ce({sampling:Ce({createMessage:je.optional()}).optional(),elicitation:Ce({create:je.optional()}).optional()}).optional()}),HE=Ce({list:je.optional(),cancel:je.optional(),requests:Ce({tools:Ce({call:je.optional()}).optional()}).optional()}),WE=j({experimental:ye(_(),je).optional(),sampling:j({context:je.optional(),tools:je.optional()}).optional(),elicitation:KE.optional(),roots:j({listChanged:Te().optional()}).optional(),tasks:GE.optional(),extensions:ye(_(),je).optional()}),XE=vt.extend({protocolVersion:_(),capabilities:WE,clientInfo:bk}),kg=Ze.extend({method:U("initialize"),params:XE});var YE=j({experimental:ye(_(),je).optional(),logging:je.optional(),completions:je.optional(),prompts:j({listChanged:Te().optional()}).optional(),resources:j({subscribe:Te().optional(),listChanged:Te().optional()}).optional(),tools:j({listChanged:Te().optional()}).optional(),tasks:HE.optional(),extensions:ye(_(),je).optional()}),QE=Me.extend({protocolVersion:_(),capabilities:YE,serverInfo:bk,instructions:_().optional()}),wg=kt.extend({method:U("notifications/initialized"),params:xt.optional()});var id=Ze.extend({method:U("ping"),params:vt.optional()}),eN=j({progress:le(),total:ge(le()),message:ge(_())}),tN=j({...xt.shape,...eN.shape,progressToken:pk}),od=kt.extend({method:U("notifications/progress"),params:tN}),rN=vt.extend({cursor:mk.optional()}),qa=Ze.extend({params:rN.optional()}),Fa=Me.extend({nextCursor:mk.optional()}),nN=Ue(["working","input_required","completed","failed","cancelled"]),Ba=j({taskId:_(),status:nN,ttl:me([le(),Oa()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:ge(le()),statusMessage:ge(_())}),Li=Me.extend({task:Ba}),iN=xt.merge(Ba),Ja=kt.extend({method:U("notifications/tasks/status"),params:iN}),ad=Ze.extend({method:U("tasks/get"),params:vt.extend({taskId:_()})}),sd=Me.merge(Ba),cd=Ze.extend({method:U("tasks/result"),params:vt.extend({taskId:_()})}),kV=Me.loose(),ud=qa.extend({method:U("tasks/list")}),ld=Fa.extend({tasks:ee(Ba)}),dd=Ze.extend({method:U("tasks/cancel"),params:vt.extend({taskId:_()})}),xk=Me.merge(Ba),kk=j({uri:_(),mimeType:ge(_()),_meta:ye(_(),_e()).optional()}),wk=kk.extend({text:_()}),Sg=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Sk=kk.extend({blob:Sg}),Ka=Ue(["user","assistant"]),Vi=j({audience:ee(Ka).optional(),priority:le().min(0).max(1).optional(),lastModified:fn.datetime({offset:!0}).optional()}),Ik=j({...Mi.shape,...Va.shape,uri:_(),description:ge(_()),mimeType:ge(_()),size:ge(le()),annotations:Vi.optional(),_meta:ge(Ce({}))}),oN=j({...Mi.shape,...Va.shape,uriTemplate:_(),description:ge(_()),mimeType:ge(_()),annotations:Vi.optional(),_meta:ge(Ce({}))}),fd=qa.extend({method:U("resources/list")}),aN=Fa.extend({resources:ee(Ik)}),pd=qa.extend({method:U("resources/templates/list")}),sN=Fa.extend({resourceTemplates:ee(oN)}),Ig=vt.extend({uri:_()}),cN=Ig,md=Ze.extend({method:U("resources/read"),params:cN}),uN=Me.extend({contents:ee(me([wk,Sk]))}),lN=kt.extend({method:U("notifications/resources/list_changed"),params:xt.optional()}),dN=Ig,fN=Ze.extend({method:U("resources/subscribe"),params:dN}),pN=Ig,mN=Ze.extend({method:U("resources/unsubscribe"),params:pN}),hN=xt.extend({uri:_()}),gN=kt.extend({method:U("notifications/resources/updated"),params:hN}),vN=j({name:_(),description:ge(_()),required:ge(Te())}),yN=j({...Mi.shape,...Va.shape,description:ge(_()),arguments:ge(ee(vN)),_meta:ge(Ce({}))}),hd=qa.extend({method:U("prompts/list")}),_N=Fa.extend({prompts:ee(yN)}),$N=vt.extend({name:_(),arguments:ye(_(),_()).optional()}),gd=Ze.extend({method:U("prompts/get"),params:$N}),zg=j({type:U("text"),text:_(),annotations:Vi.optional(),_meta:ye(_(),_e()).optional()}),Pg=j({type:U("image"),data:Sg,mimeType:_(),annotations:Vi.optional(),_meta:ye(_(),_e()).optional()}),Tg=j({type:U("audio"),data:Sg,mimeType:_(),annotations:Vi.optional(),_meta:ye(_(),_e()).optional()}),bN=j({type:U("tool_use"),name:_(),id:_(),input:ye(_(),_e()),_meta:ye(_(),_e()).optional()}),xN=j({type:U("resource"),resource:me([wk,Sk]),annotations:Vi.optional(),_meta:ye(_(),_e()).optional()}),kN=Ik.extend({type:U("resource_link")}),Og=me([zg,Pg,Tg,kN,xN]),wN=j({role:Ka,content:Og}),SN=Me.extend({description:_().optional(),messages:ee(wN)}),IN=kt.extend({method:U("notifications/prompts/list_changed"),params:xt.optional()}),zN=j({title:_().optional(),readOnlyHint:Te().optional(),destructiveHint:Te().optional(),idempotentHint:Te().optional(),openWorldHint:Te().optional()}),PN=j({taskSupport:Ue(["required","optional","forbidden"]).optional()}),zk=j({...Mi.shape,...Va.shape,description:_().optional(),inputSchema:j({type:U("object"),properties:ye(_(),je).optional(),required:ee(_()).optional()}).catchall(_e()),outputSchema:j({type:U("object"),properties:ye(_(),je).optional(),required:ee(_()).optional()}).catchall(_e()).optional(),annotations:zN.optional(),execution:PN.optional(),_meta:ye(_(),_e()).optional()}),vd=qa.extend({method:U("tools/list")}),TN=Fa.extend({tools:ee(zk)}),yd=Me.extend({content:ee(Og).default([]),structuredContent:ye(_(),_e()).optional(),isError:Te().optional()}),wV=yd.or(Me.extend({toolResult:_e()})),ON=Ma.extend({name:_(),arguments:ye(_(),_e()).optional()}),qi=Ze.extend({method:U("tools/call"),params:ON}),EN=kt.extend({method:U("notifications/tools/list_changed"),params:xt.optional()}),SV=j({autoRefresh:Te().default(!0),debounceMs:le().int().nonnegative().default(300)}),Ga=Ue(["debug","info","notice","warning","error","critical","alert","emergency"]),NN=vt.extend({level:Ga}),Eg=Ze.extend({method:U("logging/setLevel"),params:NN}),jN=xt.extend({level:Ga,logger:_().optional(),data:_e()}),AN=kt.extend({method:U("notifications/message"),params:jN}),DN=j({name:_().optional()}),RN=j({hints:ee(DN).optional(),costPriority:le().min(0).max(1).optional(),speedPriority:le().min(0).max(1).optional(),intelligencePriority:le().min(0).max(1).optional()}),CN=j({mode:Ue(["auto","required","none"]).optional()}),UN=j({type:U("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:ee(Og).default([]),structuredContent:j({}).loose().optional(),isError:Te().optional(),_meta:ye(_(),_e()).optional()}),ZN=Aa("type",[zg,Pg,Tg]),Ql=Aa("type",[zg,Pg,Tg,bN,UN]),MN=j({role:Ka,content:me([Ql,ee(Ql)]),_meta:ye(_(),_e()).optional()}),LN=Ma.extend({messages:ee(MN),modelPreferences:RN.optional(),systemPrompt:_().optional(),includeContext:Ue(["none","thisServer","allServers"]).optional(),temperature:le().optional(),maxTokens:le().int(),stopSequences:ee(_()).optional(),metadata:je.optional(),tools:ee(zk).optional(),toolChoice:CN.optional()}),VN=Ze.extend({method:U("sampling/createMessage"),params:LN}),Ha=Me.extend({model:_(),stopReason:ge(Ue(["endTurn","stopSequence","maxTokens"]).or(_())),role:Ka,content:ZN}),Ng=Me.extend({model:_(),stopReason:ge(Ue(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Ka,content:me([Ql,ee(Ql)])}),qN=j({type:U("boolean"),title:_().optional(),description:_().optional(),default:Te().optional()}),FN=j({type:U("string"),title:_().optional(),description:_().optional(),minLength:le().optional(),maxLength:le().optional(),format:Ue(["email","uri","date","date-time"]).optional(),default:_().optional()}),BN=j({type:Ue(["number","integer"]),title:_().optional(),description:_().optional(),minimum:le().optional(),maximum:le().optional(),default:le().optional()}),JN=j({type:U("string"),title:_().optional(),description:_().optional(),enum:ee(_()),default:_().optional()}),KN=j({type:U("string"),title:_().optional(),description:_().optional(),oneOf:ee(j({const:_(),title:_()})),default:_().optional()}),GN=j({type:U("string"),title:_().optional(),description:_().optional(),enum:ee(_()),enumNames:ee(_()).optional(),default:_().optional()}),HN=me([JN,KN]),WN=j({type:U("array"),title:_().optional(),description:_().optional(),minItems:le().optional(),maxItems:le().optional(),items:j({type:U("string"),enum:ee(_())}),default:ee(_()).optional()}),XN=j({type:U("array"),title:_().optional(),description:_().optional(),minItems:le().optional(),maxItems:le().optional(),items:j({anyOf:ee(j({const:_(),title:_()}))}),default:ee(_()).optional()}),YN=me([WN,XN]),QN=me([GN,HN,YN]),ej=me([QN,qN,FN,BN]),tj=Ma.extend({mode:U("form").optional(),message:_(),requestedSchema:j({type:U("object"),properties:ye(_(),ej),required:ee(_()).optional()})}),rj=Ma.extend({mode:U("url"),message:_(),elicitationId:_(),url:_().url()}),nj=me([tj,rj]),ij=Ze.extend({method:U("elicitation/create"),params:nj}),oj=xt.extend({elicitationId:_()}),aj=kt.extend({method:U("notifications/elicitation/complete"),params:oj}),Fi=Me.extend({action:Ue(["accept","decline","cancel"]),content:Ua(e=>e===null?void 0:e,ye(_(),me([_(),le(),Te(),ee(_())])).optional())}),sj=j({type:U("ref/resource"),uri:_()});var cj=j({type:U("ref/prompt"),name:_()}),uj=vt.extend({ref:me([cj,sj]),argument:j({name:_(),value:_()}),context:j({arguments:ye(_(),_()).optional()}).optional()}),_d=Ze.extend({method:U("completion/complete"),params:uj});function Pk(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Tk(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var lj=Me.extend({completion:Ce({values:ee(_()).max(100),total:ge(le().int()),hasMore:ge(Te())})}),dj=j({uri:_().startsWith("file://"),name:_().optional(),_meta:ye(_(),_e()).optional()}),fj=Ze.extend({method:U("roots/list"),params:vt.optional()}),jg=Me.extend({roots:ee(dj)}),pj=kt.extend({method:U("notifications/roots/list_changed"),params:xt.optional()}),IV=me([id,kg,_d,Eg,gd,hd,fd,pd,md,fN,mN,qi,vd,ad,cd,ud,dd]),zV=me([nd,od,wg,pj,Ja]),PV=me([rd,Ha,Ng,Fi,jg,sd,ld,Li]),TV=me([id,VN,ij,fj,ad,cd,ud,dd]),OV=me([nd,od,AN,gN,lN,EN,IN,Ja,aj]),EV=me([rd,QE,lj,SN,_N,aN,sN,uN,yd,TN,sd,ld,Li]),R=class e extends Error{constructor(t,n,i){super(`MCP error ${t}: ${n}`),this.code=t,this.data=i,this.name="McpError"}static fromError(t,n,i){if(t===Z.UrlElicitationRequired&&i){let r=i;if(r.elicitations)return new vg(r.elicitations,n)}return new e(t,n,i)}},vg=class extends R{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(Z.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function jr(e){return e==="completed"||e==="failed"||e==="cancelled"}var Ek=Symbol("Let zodToJsonSchema decide on which parser to use");var Ok={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Nk=e=>typeof e=="string"?{...Ok,name:e}:{...Ok,...e};var jk=e=>{let t=Nk(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function Ag(e,t,n,i){i?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function oe(e,t,n,i,r){e[t]=n,Ag(e,t,i,r)}var $d=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function ze(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?$d(t,e.currentPath):t.join("/")}}function Ak(e,t){let n={type:"array"};return e.type?._def&&e.type?._def?.typeName!==P.ZodAny&&(n.items=F(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&oe(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&oe(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(oe(n,"minItems",e.exactLength.value,e.exactLength.message,t),oe(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function Dk(e,t){let n={type:"integer",format:"int64"};if(!e.checks)return n;for(let i of e.checks)switch(i.kind){case"min":t.target==="jsonSchema7"?i.inclusive?oe(n,"minimum",i.value,i.message,t):oe(n,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(n.exclusiveMinimum=!0),oe(n,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?oe(n,"maximum",i.value,i.message,t):oe(n,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(n.exclusiveMaximum=!0),oe(n,"maximum",i.value,i.message,t));break;case"multipleOf":oe(n,"multipleOf",i.value,i.message,t);break}return n}function Rk(){return{type:"boolean"}}function bd(e,t){return F(e.type._def,t)}var Ck=(e,t)=>F(e.innerType._def,t);function Dg(e,t,n){let i=n??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,o)=>Dg(e,t,r))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return mj(e,t)}}var mj=(e,t)=>{let n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(let i of e.checks)switch(i.kind){case"min":oe(n,"minimum",i.value,i.message,t);break;case"max":oe(n,"maximum",i.value,i.message,t);break}return n};function Uk(e,t){return{...F(e.innerType._def,t),default:e.defaultValue()}}function Zk(e,t){return t.effectStrategy==="input"?F(e.schema._def,t):ze(t)}function Mk(e){return{type:"string",enum:Array.from(e.values)}}var hj=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Lk(e,t){let n=[F(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),F(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(o=>!!o),i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(o=>{if(hj(o))r.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let a=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:s,...c}=o;a=c}else i=void 0;r.push(a)}}),r.length?{allOf:r,...i}:void 0}function Vk(e,t){let n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}var Rg,jt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Rg===void 0&&(Rg=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Rg),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function xd(e,t){let n={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":oe(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t);break;case"max":oe(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":At(n,"email",i.message,t);break;case"format:idn-email":At(n,"idn-email",i.message,t);break;case"pattern:zod":et(n,jt.email,i.message,t);break}break;case"url":At(n,"uri",i.message,t);break;case"uuid":At(n,"uuid",i.message,t);break;case"regex":et(n,i.regex,i.message,t);break;case"cuid":et(n,jt.cuid,i.message,t);break;case"cuid2":et(n,jt.cuid2,i.message,t);break;case"startsWith":et(n,RegExp(`^${Cg(i.value,t)}`),i.message,t);break;case"endsWith":et(n,RegExp(`${Cg(i.value,t)}$`),i.message,t);break;case"datetime":At(n,"date-time",i.message,t);break;case"date":At(n,"date",i.message,t);break;case"time":At(n,"time",i.message,t);break;case"duration":At(n,"duration",i.message,t);break;case"length":oe(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t),oe(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"includes":{et(n,RegExp(Cg(i.value,t)),i.message,t);break}case"ip":{i.version!=="v6"&&At(n,"ipv4",i.message,t),i.version!=="v4"&&At(n,"ipv6",i.message,t);break}case"base64url":et(n,jt.base64url,i.message,t);break;case"jwt":et(n,jt.jwt,i.message,t);break;case"cidr":{i.version!=="v6"&&et(n,jt.ipv4Cidr,i.message,t),i.version!=="v4"&&et(n,jt.ipv6Cidr,i.message,t);break}case"emoji":et(n,jt.emoji(),i.message,t);break;case"ulid":{et(n,jt.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{At(n,"binary",i.message,t);break}case"contentEncoding:base64":{oe(n,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{et(n,jt.base64,i.message,t);break}}break}case"nanoid":et(n,jt.nanoid,i.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function Cg(e,t){return t.patternStrategy==="escape"?vj(e):e}var gj=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function vj(e){let t="";for(let n=0;n<e.length;n++)gj.has(e[n])||(t+="\\"),t+=e[n];return t}function At(e,t,n,i){e.format||e.anyOf?.some(r=>r.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&i.errorMessages&&{errorMessage:{format:n}}})):oe(e,"format",t,n,i)}function et(e,t,n,i){e.pattern||e.allOf?.some(r=>r.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:qk(t,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):oe(e,"pattern",qk(t,i),n,i)}function qk(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=n.i?e.source.toLowerCase():e.source,r="",o=!1,a=!1,s=!1;for(let c=0;c<i.length;c++){if(o){r+=i[c],o=!1;continue}if(n.i){if(a){if(i[c].match(/[a-z]/)){s?(r+=i[c],r+=`${i[c-2]}-${i[c]}`.toUpperCase(),s=!1):i[c+1]==="-"&&i[c+2]?.match(/[a-z]/)?(r+=i[c],s=!0):r+=`${i[c]}${i[c].toUpperCase()}`;continue}}else if(i[c].match(/[a-z]/)){r+=`[${i[c]}${i[c].toUpperCase()}]`;continue}}if(n.m){if(i[c]==="^"){r+=`(^|(?<=[\r
72
72
  ]))`;continue}else if(i[c]==="$"){r+=`($|(?=[\r
73
73
  ]))`;continue}}if(n.s&&i[c]==="."){r+=a?`${i[c]}\r
74
74
  `:`[${i[c]}\r
75
75
  ]`;continue}r+=i[c],i[c]==="\\"?o=!0:a&&i[c]==="]"?a=!1:!a&&i[c]==="["&&(a=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return r}function kd(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===P.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((i,r)=>({...i,[r]:F(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",r]})??ze(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let n={type:"object",additionalProperties:F(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(e.keyType?._def.typeName===P.ZodString&&e.keyType._def.checks?.length){let{type:i,...r}=xd(e.keyType._def,t);return{...n,propertyNames:r}}else{if(e.keyType?._def.typeName===P.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===P.ZodBranded&&e.keyType._def.type._def.typeName===P.ZodString&&e.keyType._def.type._def.checks?.length){let{type:i,...r}=bd(e.keyType._def,t);return{...n,propertyNames:r}}}return n}function Fk(e,t){if(t.mapStrategy==="record")return kd(e,t);let n=F(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||ze(t),i=F(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||ze(t);return{type:"array",maxItems:125,items:{type:"array",items:[n,i],minItems:2,maxItems:2}}}function Bk(e){let t=e.values,i=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),r=Array.from(new Set(i.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:i}}function Jk(e){return e.target==="openAi"?void 0:{not:ze({...e,currentPath:[...e.currentPath,"not"]})}}function Kk(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Wa={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Hk(e,t){if(t.target==="openApi3")return Gk(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(i=>i._def.typeName in Wa&&(!i._def.checks||!i._def.checks.length))){let i=n.reduce((r,o)=>{let a=Wa[o._def.typeName];return a&&!r.includes(a)?[...r,a]:r},[]);return{type:i.length>1?i:i[0]}}else if(n.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=n.reduce((r,o)=>{let a=typeof o._def.value;switch(a){case"string":case"number":case"boolean":return[...r,a];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(i.length===n.length){let r=i.filter((o,a,s)=>s.indexOf(o)===a);return{type:r.length>1?r:r[0],enum:n.reduce((o,a)=>o.includes(a._def.value)?o:[...o,a._def.value],[])}}}else if(n.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((i,r)=>[...i,...r._def.values.filter(o=>!i.includes(o))],[])};return Gk(e,t)}var Gk=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,r)=>F(i._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(i=>!!i&&(!t.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return n.length?{anyOf:n}:void 0};function Wk(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Wa[e.innerType._def.typeName],nullable:!0}:{type:[Wa[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let i=F(e.innerType._def,{...t,currentPath:[...t.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let n=F(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Xk(e,t){let n={type:"number"};if(!e.checks)return n;for(let i of e.checks)switch(i.kind){case"int":n.type="integer",Ag(n,"type",i.message,t);break;case"min":t.target==="jsonSchema7"?i.inclusive?oe(n,"minimum",i.value,i.message,t):oe(n,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(n.exclusiveMinimum=!0),oe(n,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?oe(n,"maximum",i.value,i.message,t):oe(n,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(n.exclusiveMaximum=!0),oe(n,"maximum",i.value,i.message,t));break;case"multipleOf":oe(n,"multipleOf",i.value,i.message,t);break}return n}function Yk(e,t){let n=t.target==="openAi",i={type:"object",properties:{}},r=[],o=e.shape();for(let s in o){let c=o[s];if(c===void 0||c._def===void 0)continue;let u=_j(c);u&&n&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let l=F(c._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});l!==void 0&&(i.properties[s]=l,u||r.push(s))}r.length&&(i.required=r);let a=yj(e,t);return a!==void 0&&(i.additionalProperties=a),i}function yj(e,t){if(e.catchall._def.typeName!=="ZodNever")return F(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function _j(e){try{return e.isOptional()}catch{return!0}}var Qk=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return F(e.innerType._def,t);let n=F(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:ze(t)},n]}:ze(t)};var ew=(e,t)=>{if(t.pipeStrategy==="input")return F(e.in._def,t);if(t.pipeStrategy==="output")return F(e.out._def,t);let n=F(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),i=F(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,i].filter(r=>r!==void 0)}};function tw(e,t){return F(e.type._def,t)}function rw(e,t){let i={type:"array",uniqueItems:!0,items:F(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&oe(i,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&oe(i,"maxItems",e.maxSize.value,e.maxSize.message,t),i}function nw(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,i)=>F(n._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[]),additionalItems:F(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,i)=>F(n._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[])}}function iw(e){return{not:ze(e)}}function ow(e){return ze(e)}var aw=(e,t)=>F(e.innerType._def,t);var sw=(e,t,n)=>{switch(t){case P.ZodString:return xd(e,n);case P.ZodNumber:return Xk(e,n);case P.ZodObject:return Yk(e,n);case P.ZodBigInt:return Dk(e,n);case P.ZodBoolean:return Rk();case P.ZodDate:return Dg(e,n);case P.ZodUndefined:return iw(n);case P.ZodNull:return Kk(n);case P.ZodArray:return Ak(e,n);case P.ZodUnion:case P.ZodDiscriminatedUnion:return Hk(e,n);case P.ZodIntersection:return Lk(e,n);case P.ZodTuple:return nw(e,n);case P.ZodRecord:return kd(e,n);case P.ZodLiteral:return Vk(e,n);case P.ZodEnum:return Mk(e);case P.ZodNativeEnum:return Bk(e);case P.ZodNullable:return Wk(e,n);case P.ZodOptional:return Qk(e,n);case P.ZodMap:return Fk(e,n);case P.ZodSet:return rw(e,n);case P.ZodLazy:return()=>e.getter()._def;case P.ZodPromise:return tw(e,n);case P.ZodNaN:case P.ZodNever:return Jk(n);case P.ZodEffects:return Zk(e,n);case P.ZodAny:return ze(n);case P.ZodUnknown:return ow(n);case P.ZodDefault:return Uk(e,n);case P.ZodBranded:return bd(e,n);case P.ZodReadonly:return aw(e,n);case P.ZodCatch:return Ck(e,n);case P.ZodPipeline:return ew(e,n);case P.ZodFunction:case P.ZodVoid:case P.ZodSymbol:return;default:return(i=>{})(t)}};function F(e,t,n=!1){let i=t.seen.get(e);if(t.override){let s=t.override?.(e,t,i,n);if(s!==Ek)return s}if(i&&!n){let s=$j(i,t);if(s!==void 0)return s}let r={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,r);let o=sw(e,e.typeName,t),a=typeof o=="function"?F(o(),t):o;if(a&&bj(e,t,a),t.postProcess){let s=t.postProcess(a,e,t);return r.jsonSchema=a,s}return r.jsonSchema=a,a}var $j=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:$d(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,i)=>t.currentPath[i]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),ze(t)):t.$refStrategy==="seen"?ze(t):void 0}},bj=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n);var Ug=(e,t)=>{let n=jk(t),i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,l])=>({...c,[u]:F(l._def,{...n,currentPath:[...n.basePath,n.definitionPath,u]},!0)??ze(n)}),{}):void 0,r=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=F(e._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1)??ze(n),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(o.title=a),n.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[n.openAiAnyTypeName]||(i[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let s=r===void 0?i?{...o,[n.definitionPath]:i}:o:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,r].join("/"),[n.definitionPath]:{...i,[r]:o}};return n.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s};function xj(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function Zg(e,t){return Bt(e)?an(e,{target:xj(t?.target),io:t?.pipeStrategy??"input"}):Ug(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function Mg(e){let n=zr(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Ei(n);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function Lg(e,t){let n=Ir(e,t);if(!n.success)throw n.error;return n.data}var kj=6e4,wd=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(nd,n=>{this._oncancel(n)}),this.setNotificationHandler(od,n=>{this._onprogress(n)}),this.setRequestHandler(id,n=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ad,async(n,i)=>{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new R(Z.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(cd,async(n,i)=>{let r=async()=>{let o=n.params.taskId;if(!await this._taskStore.getTask(o,i.sessionId))throw new R(Z.InvalidParams,`Task not found: ${o}`);if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(o,i.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,f=new R(d.error.code,d.error.message,d.error.data);l(f)}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:i.requestId})}}let a=await this._taskStore.getTask(o,i.sessionId);if(!a)throw new R(Z.InvalidParams,`Task not found: ${o}`);if(!jr(a.status))return await this._waitForTaskUpdate(o,i.signal,i.sessionId),await r();if(jr(a.status)){let s=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o,i.sessionId),{...s,_meta:{...s._meta,[Nr]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(ud,async(n,i)=>{try{let{tasks:r,nextCursor:o}=await this._taskStore.listTasks(n.params?.cursor,i.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new R(Z.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(dd,async(n,i)=>{try{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new R(Z.InvalidParams,`Task not found: ${n.params.taskId}`);if(jr(r.status))throw new R(Z.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(n.params.taskId,i.sessionId);let o=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!o)throw new R(Z.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof R?r:new R(Z.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,n,i,r,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(t){let n=this._timeoutInfo.get(t);if(!n)return!1;let i=Date.now()-n.startTime;if(n.maxTotalTimeout&&i>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),R.fromError(Z.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:i});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){let n=this._timeoutInfo.get(t);n&&(clearTimeout(n.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 n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let r=this._transport?.onmessage;this._transport.onmessage=(o,a)=>{r?.(o,a),La(o)||_k(o)?this._onresponse(o):$g(o)?this._onrequest(o,a):yk(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 i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let n=R.fromError(Z.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of t.values())i(n)}_onerror(t){this.onerror?.(t)}_onnotification(t){let n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(t,n){let i=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,o=t.params?._meta?.[Nr]?.taskId,a=r?.sessionId,s=this._taskStore,c=!0,u;if(o&&s&&this._taskMessageQueue&&a!==void 0&&(c=!1,u=(async()=>{if(!await s.getTask(o,a))throw new R(Z.InvalidParams,`Task not found: ${o}`);c=!0})()),i===void 0){let m={jsonrpc:"2.0",id:t.id,error:{code:Z.MethodNotFound,message:"Method not found"}};if(o&&u){let h={type:"error",message:m,timestamp:Date.now()};u.then(()=>this._enqueueTaskMessage(o,h,a),()=>r?.send(m)).catch(y=>this._onerror(new Error(`Failed to send an error response: ${y}`)))}else o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:m,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(m).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let l=new AbortController;this._requestHandlerAbortControllers.set(t.id,l);let d=hk(t.params)?t.params.task:void 0,f=this._taskStore?this.requestTaskStore(t,r?.sessionId):void 0,p={signal:l.signal,sessionId:r?.sessionId,_meta:t.params?._meta,sendNotification:async m=>{if(l.signal.aborted)return;let h={relatedRequestId:t.id};o&&(h.relatedTask={taskId:o}),await this.notification(m,h)},sendRequest:async(m,h,y)=>{if(l.signal.aborted)throw new R(Z.ConnectionClosed,"Request was cancelled");let $={...y,relatedRequestId:t.id};o&&!$.relatedTask&&($.relatedTask={taskId:o});let w=$.relatedTask?.taskId??o;return w&&f&&await f.updateTaskStatus(w,"input_required"),await this.request(m,h,$)},authInfo:n?.authInfo,requestId:t.id,requestInfo:n?.requestInfo,taskId:o,taskStore:f,taskRequestedTtl:d?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};(u??Promise.resolve()).then(()=>{if(u&&l.signal.aborted)throw new R(Z.ConnectionClosed,"Request was cancelled");d&&this.assertTaskHandlerCapability(t.method)}).then(()=>i(t,p)).then(async m=>{if(l.signal.aborted)return;let h={result:m,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async m=>{if(l.signal.aborted)return;let h={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(m.code)?m.code:Z.InternalError,message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};o&&this._taskMessageQueue&&c?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===l&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:n,...i}=t.params,r=Number(n),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let a=this._responseHandlers.get(r),s=this._timeoutInfo.get(r);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(c);return}o(i)}_onresponse(t){let n=Number(t.id),i=this._requestResolvers.get(n);if(i){if(this._requestResolvers.delete(n),La(t))i(t);else{let a=new R(t.error.code,t.error.message,t.error.data);i(a)}return}let r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(La(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,n))}}if(o||this._progressHandlers.delete(n),La(t))r(t);else{let a=R.fromError(t.error.code,t.error.message,t.error.data);r(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,n,i){let{task:r}=i??{};if(!r){try{yield{type:"result",result:await this.request(t,n,i)}}catch(a){yield{type:"error",error:a instanceof R?a:new R(Z.InternalError,String(a))}}return}let o;try{let a=await this.request(t,Li,i);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new R(Z.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:s},jr(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)}:s.status==="failed"?yield{type:"error",error:new R(Z.InternalError,`Task ${o} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new R(Z.InternalError,`Task ${o} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),i?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof R?a:new R(Z.InternalError,String(a))}}}request(t,n,i){let{relatedRequestId:r,resumptionToken:o,onresumptiontoken:a,task:s,relatedTask:c}=i??{};return new Promise((u,l)=>{let d=w=>{l(w)};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(w){d(w);return}i?.signal?.throwIfAborted();let f=this._requestMessageId++,p={...t,jsonrpc:"2.0",id:f};i?.onprogress&&(this._progressHandlers.set(f,i.onprogress),p.params={...t.params,_meta:{...t.params?._meta||{},progressToken:f}}),s&&(p.params={...p.params,task:s}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Nr]:c}});let m=w=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(w)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:a}).catch(D=>this._onerror(new Error(`Failed to send cancellation: ${D}`)));let z=w instanceof R?w:new R(Z.RequestTimeout,String(w));l(z)};this._responseHandlers.set(f,w=>{if(!i?.signal?.aborted){if(w instanceof Error)return l(w);try{let z=Ir(n,w.result);z.success?u(z.data):l(z.error)}catch(z){l(z)}}}),i?.signal?.addEventListener("abort",()=>{m(i?.signal?.reason)});let h=i?.timeout??kj,y=()=>m(R.fromError(Z.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(f,h,i?.maxTotalTimeout,y,i?.resetTimeoutOnProgress??!1);let $=c?.taskId;if($){let w=z=>{let D=this._responseHandlers.get(f);D?D(z):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,w),this._enqueueTaskMessage($,{type:"request",message:p,timestamp:Date.now()}).catch(z=>{this._cleanupTimeout(f),l(z)})}else this._transport.send(p,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:a}).catch(w=>{this._cleanupTimeout(f),l(w)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},sd,n)}async getTaskResult(t,n,i){return this.request({method:"tasks/result",params:t},n,i)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},ld,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},xk,n)}async notification(t,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let i=n?.relatedTask?.taskId;if(i){let s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Nr]:n.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId&&!n?.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"};n?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Nr]:n.relatedTask}}}),this._transport?.send(s,n).catch(c=>this._onerror(c))});return}let a={...t,jsonrpc:"2.0"};n?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Nr]:n.relatedTask}}}),await this._transport.send(a,n)}setRequestHandler(t,n){let i=Mg(t);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(r,o)=>{let a=Lg(t,r);return Promise.resolve(n(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,n){let i=Mg(t);this._notificationHandlers.set(i,r=>{let o=Lg(t,r);return Promise.resolve(n(o))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,i){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,i??this._transport?.sessionId,r)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(t,n);for(let r of i)if(r.type==="request"&&$g(r.message)){let o=r.message.id,a=this._requestResolvers.get(o);a?(a(new R(Z.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,n,i){let r=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(t,i);o?.pollInterval&&(r=o.pollInterval)}catch{}return new Promise((o,a)=>{if(n.aborted){a(new R(Z.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,r);n.addEventListener("abort",()=>{clearTimeout(s),a(new R(Z.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async r=>{if(!t)throw new Error("No request provided");return await i.createTask(r,t.id,{method:t.method,params:t.params},n)},getTask:async r=>{let o=await i.getTask(r,n);if(!o)throw new R(Z.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,a)=>{await i.storeTaskResult(r,o,a,n);let s=await i.getTask(r,n);if(s){let c=Ja.parse({method:"notifications/tasks/status",params:s});await this.notification(c),jr(s.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>i.getTaskResult(r,n),updateTaskStatus:async(r,o,a)=>{let s=await i.getTask(r,n);if(!s)throw new R(Z.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(jr(s.status))throw new R(Z.InvalidParams,`Cannot update task "${r}" from terminal status "${s.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(r,o,a,n);let c=await i.getTask(r,n);if(c){let u=Ja.parse({method:"notifications/tasks/status",params:c});await this.notification(u),jr(c.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>i.listTasks(r,n)}}};function cw(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function uw(e,t){let n={...e};for(let i in t){let r=i,o=t[r];if(o===void 0)continue;let a=n[r];cw(a)&&cw(o)?n[r]={...a,...o}:n[r]=o}return n}var ez=Xy(zy(),1),tz=Xy(QI(),1);function IC(){let e=new ez.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,tz.default)(e),e}var af=class{constructor(t){this._ajv=t??IC()}getValidator(t){let n="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return i=>n(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}};var sf=class{constructor(t){this._server=t}requestStream(t,n,i){return this._server.requestStream(t,n,i)}createMessageStream(t,n){let i=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let r=t.messages[t.messages.length-1],o=Array.isArray(r.content)?r.content:[r.content],a=o.some(l=>l.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],u=c.some(l=>l.type==="tool_use");if(a){if(o.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),d=new Set(o.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(l.size!==d.size||![...l].every(f=>d.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:t},Ha,n)}elicitInputStream(t,n){let i=this._server.getClientCapabilities(),r=t.mode??"form";switch(r){case"url":{if(!i?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!i?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=r==="form"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:o},Fi,n)}async getTask(t,n){return this._server.getTask({taskId:t},n)}async getTaskResult(t,n,i){return this._server.getTaskResult({taskId:t},n,i)}async listTasks(t,n){return this._server.listTasks(t?{cursor:t}:void 0,n)}async cancelTask(t,n){return this._server.cancelTask({taskId:t},n)}};function rz(e,t,n){if(!e)throw new Error(`${n} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${n} does not support task creation for tools/call (required for ${t})`);break;default:break}}function nz(e,t,n){if(!e)throw new Error(`${n} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var cf=class extends wd{constructor(t,n){super(n),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ga.options.map((i,r)=>[i,r])),this.isMessageIgnored=(i,r)=>{let o=this._loggingLevels.get(r);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=n?.capabilities??{},this._instructions=n?.instructions,this._jsonSchemaValidator=n?.jsonSchemaValidator??new af,this.setRequestHandler(kg,i=>this._oninitialize(i)),this.setNotificationHandler(wg,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Eg,async(i,r)=>{let o=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=i.params,s=Ga.safeParse(a);return s.success&&this._loggingLevels.set(o,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new sf(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=uw(this._capabilities,t)}setRequestHandler(t,n){let r=zr(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=Ei(r);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=Ir(qi,c);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new R(Z.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=l.data,f=await Promise.resolve(n(c,u));if(d.task){let m=Ir(Li,f);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new R(Z.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let p=Ir(yd,f);if(!p.success){let m=p.error instanceof Error?p.error.message:String(p.error);throw new R(Z.InvalidParams,`Invalid tools/call result: ${m}`)}return p.data};return super.setRequestHandler(t,s)}return super.setRequestHandler(t,n)}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){nz(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&rz(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let n=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:fk.includes(n)?n:yg,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"},rd)}async createMessage(t,n){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 i=t.messages[t.messages.length-1],r=Array.isArray(i.content)?i.content:[i.content],o=r.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(r.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(r.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},Ng,n):this.request({method:"sampling/createMessage",params:t},Ha,n)}async elicitInput(t,n){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let r=t;return this.request({method:"elicitation/create",params:r},Fi,n)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let r=t.mode==="form"?t:{...t,mode:"form"},o=await this.request({method:"elicitation/create",params:r},Fi,n);if(o.action==="accept"&&o.content&&r.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(r.requestedSchema)(o.content);if(!s.valid)throw new R(Z.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof R?a:new R(Z.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return o}}}createElicitationCompletionNotifier(t,n){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}},n)}async listRoots(t,n){return this.request({method:"roots/list",params:t},jg,n)}async sendLoggingMessage(t,n){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,n))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 oz=Symbol.for("mcp.completable");function Dy(e){return!!e&&typeof e=="object"&&oz in e}function az(e){return e[oz]?.complete}var iz;(function(e){e.Completable="McpCompletable"})(iz||(iz={}));var zC=/^[A-Za-z0-9._-]{1,128}$/;function PC(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!zC.test(e)){let n=e.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,r,o)=>o.indexOf(i)===r);return t.push(`Tool name contains invalid characters: ${n.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function TC(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let n of t)console.warn(` - ${n}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Ry(e){let t=PC(e);return TC(e,t.warnings),t.isValid}var uf=class{constructor(t){this._mcpServer=t}registerToolTask(t,n,i){let r={taskSupport:"required",...n.execution};if(r.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,n.title,n.description,n.inputSchema,n.outputSchema,n.annotations,r,n._meta,i)}};function OC(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!(r===null||typeof r!="object"))if(Array.isArray(r))for(let o of r){if(++n>t)return n;o!==null&&typeof o=="object"&&i.push(o)}else for(let o in r){if(!Object.prototype.hasOwnProperty.call(r,o))continue;if(++n>t)return n;let a=r[o];a!==null&&typeof a=="object"&&i.push(a)}}return n}function EC(e){if(!(e===void 0||e===1/0)){if(typeof e!="number"||Number.isNaN(e)||e<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}var lf=class{constructor(t,n){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new cf(t,n),this._maxToolInputElements=EC(n?.maxToolInputElements)}get experimental(){return this._experimental||(this._experimental={tasks:new uf(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Vr(vd)),this.server.assertCanSetRequestHandler(Vr(qi)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(vd,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,n])=>{let i={name:t,title:n.title,description:n.description,inputSchema:(()=>{let r=Oi(n.inputSchema);return r?Zg(r,{strictUnions:!0,pipeStrategy:"input"}):NC})(),annotations:n.annotations,execution:n.execution,_meta:n._meta};if(n.outputSchema){let r=Oi(n.outputSchema);r&&(i.outputSchema=Zg(r,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(qi,async(t,n)=>{try{let i=this._registeredTools[t.params.name];if(!i)throw new R(Z.InvalidParams,`Tool ${t.params.name} not found`);if(!i.enabled)throw new R(Z.InvalidParams,`Tool ${t.params.name} disabled`);let r=!!t.params.task,o=i.execution?.taskSupport,a="createTask"in i.handler;if((o==="required"||o==="optional")&&!a)throw new R(Z.InternalError,`Tool ${t.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!r)throw new R(Z.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!r&&a)return await this.handleAutomaticTaskPolling(i,t,n);let s=await this.validateToolInput(i,t.params.arguments,t.params.name),c=await this.executeToolHandler(i,s,n);return r||await this.validateToolOutput(i,c,t.params.name),c}catch(i){if(i instanceof R&&i.code===Z.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,n,i){if(this._maxToolInputElements!==void 0&&OC(n,this._maxToolInputElements)>this._maxToolInputElements)throw new R(Z.InvalidParams,`Invalid arguments for tool ${i}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!t.inputSchema)return;let o=Oi(t.inputSchema)??t.inputSchema,a=await kl(o,n??{});if(!a.success){let s="error"in a?a.error:"Unknown error",c=wl(s);throw new R(Z.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${c}`)}return a.data}async validateToolOutput(t,n,i){if(!t.outputSchema||!("content"in n)||n.isError)return;if(!n.structuredContent)throw new R(Z.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let r=Oi(t.outputSchema),o=await kl(r,n.structuredContent);if(!o.success){let a="error"in o?o.error:"Unknown error",s=wl(a);throw new R(Z.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${s}`)}}async executeToolHandler(t,n,i){let r=t.handler;if("createTask"in r){if(!i.taskStore)throw new Error("No task store provided.");let a={...i,taskStore:i.taskStore};if(t.inputSchema){let s=r;return await Promise.resolve(s.createTask(n,a))}else{let s=r;return await Promise.resolve(s.createTask(a))}}if(t.inputSchema){let a=r;return await Promise.resolve(a(n,i))}else{let a=r;return await Promise.resolve(a(i))}}async handleAutomaticTaskPolling(t,n,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(t,n.params.arguments,n.params.name),o=t.handler,a={...i,taskStore:i.taskStore},s=r?await Promise.resolve(o.createTask(r,a)):await Promise.resolve(o.createTask(a)),c=s.task.taskId,u=s.task,l=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(f=>setTimeout(f,l));let d=await i.taskStore.getTask(c);if(!d)throw new R(Z.InternalError,`Task ${c} not found during polling`);u=d}return await i.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Vr(_d)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(_d,async t=>{switch(t.params.ref.type){case"ref/prompt":return Pk(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return Tk(t),this.handleResourceCompletion(t,t.params.ref);default:throw new R(Z.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,n){let i=this._registeredPrompts[n.name];if(!i)throw new R(Z.InvalidParams,`Prompt ${n.name} not found`);if(!i.enabled)throw new R(Z.InvalidParams,`Prompt ${n.name} disabled`);if(!i.argsSchema)return Is;let o=zr(i.argsSchema)?.[t.params.argument.name];if(!Dy(o))return Is;let a=az(o);if(!a)return Is;let s=await a(t.params.argument.value,t.params.context);return cz(s)}async handleResourceCompletion(t,n){let i=Object.values(this._registeredResourceTemplates).find(a=>a.resourceTemplate.uriTemplate.toString()===n.uri);if(!i){if(this._registeredResources[n.uri])return Is;throw new R(Z.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let r=i.resourceTemplate.completeCallback(t.params.argument.name);if(!r)return Is;let o=await r(t.params.argument.value,t.params.context);return cz(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Vr(fd)),this.server.assertCanSetRequestHandler(Vr(pd)),this.server.assertCanSetRequestHandler(Vr(md)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(fd,async(t,n)=>{let i=Object.entries(this._registeredResources).filter(([o,a])=>a.enabled).map(([o,a])=>({uri:o,name:a.name,...a.metadata})),r=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let a=await o.resourceTemplate.listCallback(n);for(let s of a.resources)r.push({...o.metadata,...s})}return{resources:[...i,...r]}}),this.server.setRequestHandler(pd,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([n,i])=>({name:n,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(md,async(t,n)=>{let i=new URL(t.params.uri),r=this._registeredResources[i.toString()];if(r){if(!r.enabled)throw new R(Z.InvalidParams,`Resource ${i} disabled`);return r.readCallback(i,n)}for(let o of Object.values(this._registeredResourceTemplates)){let a=o.resourceTemplate.uriTemplate.match(i.toString());if(a)return o.readCallback(i,a,n)}throw new R(Z.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Vr(hd)),this.server.assertCanSetRequestHandler(Vr(gd)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(hd,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,n])=>({name:t,title:n.title,description:n.description,arguments:n.argsSchema?jC(n.argsSchema):void 0}))})),this.server.setRequestHandler(gd,async(t,n)=>{let i=this._registeredPrompts[t.params.name];if(!i)throw new R(Z.InvalidParams,`Prompt ${t.params.name} not found`);if(!i.enabled)throw new R(Z.InvalidParams,`Prompt ${t.params.name} disabled`);if(i.argsSchema){let r=Oi(i.argsSchema),o=await kl(r,t.params.arguments??{});if(!o.success){let c="error"in o?o.error:"Unknown error",u=wl(c);throw new R(Z.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${u}`)}let a=o.data,s=i.callback;return await Promise.resolve(s(a,n))}else{let r=i.callback;return await Promise.resolve(r(n))}}),this._promptHandlersInitialized=!0)}resource(t,n,...i){let r;typeof i[0]=="object"&&(r=i.shift());let o=i[0];if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let a=this._createRegisteredResource(t,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let a=this._createRegisteredResourceTemplate(t,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}registerResource(t,n,i,r){if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let o=this._createRegisteredResource(t,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let o=this._createRegisteredResourceTemplate(t,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(t,n,i,r,o){let a={name:t,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({uri:null}),update:s=>{typeof s.uri<"u"&&s.uri!==i&&(delete this._registeredResources[i],s.uri&&(this._registeredResources[s.uri]=a)),typeof s.name<"u"&&(a.name=s.name),typeof s.title<"u"&&(a.title=s.title),typeof s.metadata<"u"&&(a.metadata=s.metadata),typeof s.callback<"u"&&(a.readCallback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=a,a}_createRegisteredResourceTemplate(t,n,i,r,o){let a={resourceTemplate:i,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==t&&(delete this._registeredResourceTemplates[t],u.name&&(this._registeredResourceTemplates[u.name]=a)),typeof u.title<"u"&&(a.title=u.title),typeof u.template<"u"&&(a.resourceTemplate=u.template),typeof u.metadata<"u"&&(a.metadata=u.metadata),typeof u.callback<"u"&&(a.readCallback=u.callback),typeof u.enabled<"u"&&(a.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=a;let s=i.uriTemplate.variableNames;return Array.isArray(s)&&s.some(u=>!!i.completeCallback(u))&&this.setCompletionRequestHandler(),a}_createRegisteredPrompt(t,n,i,r,o){let a={title:n,description:i,argsSchema:r===void 0?void 0:sn(r),callback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:s=>{typeof s.name<"u"&&s.name!==t&&(delete this._registeredPrompts[t],s.name&&(this._registeredPrompts[s.name]=a)),typeof s.title<"u"&&(a.title=s.title),typeof s.description<"u"&&(a.description=s.description),typeof s.argsSchema<"u"&&(a.argsSchema=sn(s.argsSchema)),typeof s.callback<"u"&&(a.callback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=a,r&&Object.values(r).some(c=>{let u=c instanceof dn?c._def?.innerType:c;return Dy(u)})&&this.setCompletionRequestHandler(),a}_createRegisteredTool(t,n,i,r,o,a,s,c,u){Ry(t);let l={title:n,description:i,inputSchema:sz(r),outputSchema:sz(o),annotations:a,execution:s,_meta:c,handler:u,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==t&&(typeof d.name=="string"&&Ry(d.name),delete this._registeredTools[t],d.name&&(this._registeredTools[d.name]=l)),typeof d.title<"u"&&(l.title=d.title),typeof d.description<"u"&&(l.description=d.description),typeof d.paramsSchema<"u"&&(l.inputSchema=sn(d.paramsSchema)),typeof d.outputSchema<"u"&&(l.outputSchema=sn(d.outputSchema)),typeof d.callback<"u"&&(l.handler=d.callback),typeof d.annotations<"u"&&(l.annotations=d.annotations),typeof d._meta<"u"&&(l._meta=d._meta),typeof d.enabled<"u"&&(l.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(t,...n){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let i,r,o,a;if(typeof n[0]=="string"&&(i=n.shift()),n.length>1){let c=n[0];if(Cy(c))r=n.shift(),n.length>1&&typeof n[0]=="object"&&n[0]!==null&&!Cy(n[0])&&(a=n.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(u=>typeof u=="object"&&u!==null))throw new Error(`Tool ${t} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);a=n.shift()}}let s=n[0];return this._createRegisteredTool(t,void 0,i,r,o,a,{taskSupport:"forbidden"},void 0,s)}registerTool(t,n,i){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:r,description:o,inputSchema:a,outputSchema:s,annotations:c,_meta:u}=n;return this._createRegisteredTool(t,r,o,a,s,c,{taskSupport:"forbidden"},u,i)}prompt(t,...n){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let i;typeof n[0]=="string"&&(i=n.shift());let r;n.length>1&&(r=n.shift());let o=n[0],a=this._createRegisteredPrompt(t,void 0,i,r,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}registerPrompt(t,n,i){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:r,description:o,argsSchema:a}=n,s=this._createRegisteredPrompt(t,r,o,a,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,n){return this.server.sendLoggingMessage(t,n)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var NC={type:"object",properties:{}};function uz(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function lz(e){return"_def"in e||"_zod"in e||uz(e)}function Cy(e){return typeof e!="object"||e===null||lz(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(uz)}function sz(e){if(e){if(Cy(e))return sn(e);if(!lz(e))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}}function jC(e){let t=zr(e);return t?Object.entries(t).map(([n,i])=>{let r=Lb(i),o=Vb(i);return{name:n,description:r,required:!o}}):[]}function Vr(e){let n=zr(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Ei(n);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function cz(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var Is={completion:{values:[],hasMore:!1}};import fz from"process";var AC=10*1024*1024,df=class{constructor(t){this._maxBufferSize=t?.maxBufferSize??AC}append(t){if((this._buffer?.length??0)+t.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
76
76
  `);if(t===-1)return null;let n=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),DC(n)}clear(){this._buffer=void 0}};function DC(e){return $k.parse(JSON.parse(e))}function dz(e){return JSON.stringify(e)+`
77
- `}var ff=class{constructor(t=fz.stdin,n=fz.stdout,i){this._stdin=t,this._stdout=n,this._started=!1,this._ondata=r=>{try{this._readBuffer.append(r),this.processReadBuffer()}catch(o){this.onerror?.(o),this.close().catch(()=>{})}},this._onerror=r=>{this.onerror?.(r)},this._readBuffer=new df({maxBufferSize:i?.maxBufferSize})}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(n=>{let i=dz(t);this._stdout.write(i)?n():this._stdout.once("drain",n)})}};import{createReadStream as iJ}from"fs";import{request as aJ}from"http";import{request as cJ}from"https";import{pipeline as lJ}from"stream/promises";import wn from"process";import UC from"process";import{format as ZC}from"util";var zs=e=>Object.entries(e).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>{let i=String(n);if(!/[\s"=]/.test(i))return`${t}=${i}`;let r=i.replace(/([\\"])/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n");return`${t}="${r}"`}).join(" ");import{AsyncLocalStorage as RC}from"async_hooks";var CC=new RC;var pz=()=>CC.getStore();var mz;var Ps=()=>mz?`-[session:${mz}]`:"",Ts=()=>UC.env.LOG!=="0",hz=(e,t,n,i)=>{let r=zs({...pz(),severity:i}),o=ZC(t,...n).split(`
77
+ `}var ff=class{constructor(t=fz.stdin,n=fz.stdout,i){this._stdin=t,this._stdout=n,this._started=!1,this._ondata=r=>{try{this._readBuffer.append(r),this.processReadBuffer()}catch(o){this.onerror?.(o),this.close().catch(()=>{})}},this._onerror=r=>{this.onerror?.(r)},this._readBuffer=new df({maxBufferSize:i?.maxBufferSize})}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(n=>{let i=dz(t);this._stdout.write(i)?n():this._stdout.once("drain",n)})}};import{createReadStream as aJ}from"fs";import{request as cJ}from"http";import{request as lJ}from"https";import{pipeline as fJ}from"stream/promises";import wn from"process";import UC from"process";import{format as ZC}from"util";var zs=e=>Object.entries(e).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>{let i=String(n);if(!/[\s"=]/.test(i))return`${t}=${i}`;let r=i.replace(/([\\"])/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n");return`${t}="${r}"`}).join(" ");import{AsyncLocalStorage as RC}from"async_hooks";var CC=new RC;var pz=()=>CC.getStore();var mz;var Ps=()=>mz?`-[session:${mz}]`:"",Ts=()=>UC.env.LOG!=="0",hz=(e,t,n,i)=>{let r=zs({...pz(),severity:i}),o=ZC(t,...n).split(`
78
78
  `);if(o.length===1){e(t,...n,r);return}e([`${o[0]} ${r}`,...o.slice(1)].join(`
79
79
  `))};function pf(e){return{log:(...t)=>{Ts()&&console.log(`[AR]-[${e}]${Ps()}`,...t)},error:(...t)=>{Ts()&&hz(console.error,`[AR]-[ERROR]-[${e}]${Ps()}`,t,"error")},warn:(...t)=>{Ts()&&hz(console.warn,`[AR]-[WARN]-[${e}]${Ps()}`,t,"warn")},info:(...t)=>{Ts()&&console.info(`[AR]-[${e}]${Ps()}`,...t)},debug:(...t)=>{Ts()&&console.debug(`[AR]-[DEBUG]-[${e}]${Ps()}`,...t)}}}import{AsyncLocalStorage as MC}from"async_hooks";import LC from"dgram";import uo from"process";var VC="buildbot.agent_runner.",qC=8125,FC=e=>{let t=Object.keys(e);return t.length===0?"":"|#"+t.map(n=>`${n}:${e[n]}`).join(",")},Os=(e,t,n,i={})=>`${VC}${e}:${t}|${n}${FC(i)}`,BC={service:"buildbot"},JC={},KC=new MC;var Es=e=>({...JC,...KC.getStore()??{},...e,...BC}),GC=(e,t)=>{let n=!1,i=LC.createSocket("udp4");return i.unref(),i.once("error",r=>{if(!n){let o=r.code??r.message;uo.stderr.write(`[metrics] UDP error: ${o}
80
80
  `),n=!0}}),r=>{n||(Uy++,i.send(r,t,e,o=>{if(Uy--,Uy===0)for(let a of HC)a();if(o&&!n){let a=o.code??o.message;uo.stderr.write(`[metrics] UDP send to ${e}:${t} failed: ${a}
81
81
  `),n=!0}}))}},Uy=0,HC=new Set;var Zy=()=>{},WC=()=>!!uo.env.VITEST;var XC=()=>{if(WC())return Zy;let e=uo.env.HOST_NODE_IP;if(!e)return Zy;let t=uo.env.DD_AGENT_PORT,n=t===void 0?qC:Number(t);return!Number.isInteger(n)||n<=0||n>65535?(uo.stderr.write(`[metrics] DD_AGENT_PORT="${t}" is not a valid port; metrics disabled
82
- `),Zy):GC(e,n)},YC=(e=XC())=>({inc(t,n=1,i={}){e(Os(t,n,"c",Es(i)))},gauge(t,n,i={}){e(Os(t,n,"g",Es(i)))},histogram(t,n,i={}){e(Os(t,n,"h",Es(i)))},timing(t,n,i={}){e(Os(t,n,"ms",Es(i)))},distribution(t,n,i={}){e(Os(t,n,"d",Es(i)))}}),Ns=YC();import{spawn as UB}from"child_process";import{existsSync as MB,mkdirSync as LB,writeFileSync as VB}from"fs";import{connect as FB}from"net";import QC from"path";import KB from"process";var HB=pf("step-preview"),WB=QC.join("apps","netlify-react-ui","public","agent-run-preview.json"),eU=9001,tU="components-agentrunners-rendersteps--live",XB=`http://localhost:${eU}/?path=/story/${tU}`;var mf=class extends Error{constructor(n,i,r){super(n);this.statusCode=i;this.userMessage=r;this.name="CreditLimitExceededError"}},hf=class extends Error{constructor(n,i,r){super(n);this.statusCode=i;this.userMessage=r;this.name="ApiResourceNotFoundError"}},js=class extends Error{constructor(n,i){super(n);this.statusCode=i;this.name="ApiRequestError"}};var gf=wn.env.NETLIFY_API_URL,My=wn.env.NETLIFY_API_TOKEN,lo=pf("api"),rU=()=>wn.env.NETLIFY_LOCAL_MODE==="true",nU=new Set(["agent_runners","sessions","sites","accounts","branch","dev_servers"]),iU=new Set(["api","v1","agent_runners","sessions","sites","accounts","classify","diff","result","upload_urls","native_session","upload","update_usage","connections","tokens","ai-gateway","providers","agent-runners","token","database","branch","dev_servers","config","setup_requests"]),oU=e=>e.split("/").map((t,n,i)=>t===""?t:nU.has(i[n-1])?":id":iU.has(t)?t:":id").join("/"),aU=async(e,t={})=>{if(!gf||!My)throw new Error("No API URL or token");let n=new URL(e,gf),i={...t,headers:{...t.headers,Authorization:`Bearer ${My}`}};wn.env.AGENT_RUNNERS_DEBUG==="true"&&(i.headers["x-nf-debug-logging"]="true"),t.json&&(i.headers||={},i.headers["Content-Type"]="application/json",i.body=JSON.stringify(t.json));let r=t.method??"GET",o=oU(n.pathname),a=Date.now(),s;try{s=await fetch(n,i)}catch(d){throw lo.error(zs({event:"api.request",method:r,path:n.pathname,resource:o,outcome:"network_error",error:d.message,duration_ms:Date.now()-a})),Ns.inc("api.request",1,{method:r,resource:o}),Ns.inc("api.request_failed",1,{status:"network_error",method:r,resource:o}),d}let c=s.ok&&s.status<=299;wn.env.AGENT_RUNNERS_DEBUG==="true"&&(lo.log(`Response headers for ${n}:`),s.headers.forEach((d,f)=>{lo.log(` ${f}: ${d}`)}));let u=zs({event:"api.request",method:r,path:n.pathname,resource:o,status:s.status,request_id:s.headers.get("x-request-id")||s.headers.get("x-nf-request-id"),duration_ms:Date.now()-a});if(Ns.inc("api.request",1,{method:r,resource:o}),c?lo.log(u):(lo.error(u),Ns.inc("api.request_failed",1,{status:s.status,method:r,resource:o})),t.raw){if(!c)throw new js(`API request failed: ${s.status} ${s.statusText}`,s.status);return s}let l=await(s.headers.get("content-type")?.includes("application/json")?s.json():s.text());if(!c){let d=typeof l=="string"?l:JSON.stringify(l);throw s.status===404?new hf(`API request failed: 404 - ${d}`,404,"The site associated with this agent run no longer exists."):s.status===503&&t.gracefulOn503&&d.toLowerCase().includes("usage exceeded")?new mf(`API request failed: 503 - ${d}`,503,"Credit limit reached. Please add more credits to continue using Agent Runners."):new js(`API request failed: ${s.status} - ${d}`,s.status)}return l},gz=e=>{lo.log("Setting details for api",{apiUrl:e?.constants?.NETLIFY_API_HOST,token:!!e?.constants?.NETLIFY_API_TOKEN}),wn.env.NETLIFY_AGENT_RUNNER_API_URL_OVERRIDE?gf=wn.env.NETLIFY_AGENT_RUNNER_API_URL_OVERRIDE:e?.constants?.NETLIFY_API_HOST&&(gf=`https://${e.constants.NETLIFY_API_HOST}`),e?.constants?.NETLIFY_API_TOKEN&&(My=e.constants.NETLIFY_API_TOKEN)};var sU=(e,t)=>rU()?{}:{"X-Nf-Agent-Runner-Id":e,"X-Nf-Agent-Runner-Session-Id":t};var vz=(e,t,n,i)=>aU(`/api/v1/sites/${e}/setup_requests`,{method:"POST",json:t,headers:sU(n,i)});var _z='Ask the user clarifying questions, preferably one to three, and pause until they answer. Use this instead of guessing when a decision materially changes the work. A question either offers two or three predefined options (one answer, or several with multiSelect) or omits options entirely so the user answers in their own words. The UI adds an "Other" choice and a free-text field for extra context to every question that has options, so an answer can name a choice you never offered or carry context beyond the label the user picked. The process pauses as soon as you call it; do not call it more than once or continue working after calling it.',cU=e=>{if(e!==null){if(!Array.isArray(e))return e;if(!(e.length<2))return e.map(t=>typeof t=="string"?{label:t}:t)}},yz=e=>e.meta({maxItems:3}),uU=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}},lU=e=>e.nonoptional(),Ly={questions:lU($e.preprocess(uU,yz($e.array($e.object({question:$e.string().describe("The question as the user reads it"),multiSelect:$e.boolean().optional().describe("True when several options can apply at once. Leave off for mutually exclusive choices."),options:$e.preprocess(cU,yz($e.array($e.object({label:$e.string(),description:$e.string().optional()})).min(2).optional())).describe('Two or three predefined answers. Omit entirely to ask an open question the user answers in their own words. The UI adds its own "Other" choice and a free-text field for extra context, so never add an option like "Other" or "None of these" yourself.')})).min(1)))).describe("One to three questions preferred, all asked in a single call")},$J=$e.object(Ly);import{renameSync as dU,writeFileSync as fU}from"fs";import vf from"process";var Vy=(e,t)=>{let n=`${e}.partial`;fU(n,JSON.stringify(t)),dU(n,e)},qy=()=>new Promise(()=>{}),$z=()=>{let e=()=>vf.exit(0);vf.stdin.on("close",e),vf.stdin.on("end",e)},bz=()=>{console.log=console.error,console.info=console.error,console.debug=console.error},As=(e,t=vf.argv)=>{let n=t.indexOf(e);return n===-1?void 0:t[n+1]};var qr="netlify_interactions";var Ds="request_project_setup",xz="--questions-file",Fy="netlify_connections",By="request_service_authorization";var kz="--runner-id",wz="--session-id";var Sz="--setup-file",Jy=(e,t)=>`mcp__${e}__${t}`,Ky=(e,t)=>`mcp_${e}_${t}`,Gy=(e,t)=>`${e}_${t}`,SJ=Jy(qr,"ask"),IJ=Ky(qr,"ask"),zJ=Gy(qr,"ask"),PJ=Jy(Fy,By),TJ=Ky(Fy,By),OJ=Gy(Fy,By),EJ=Jy(qr,Ds),NJ=Ky(qr,Ds),jJ=Gy(qr,Ds);var pU=["production","deploy-preview","branch-deploy","dev"],mU=["exist","change"],hU=(e,t)=>$e.array($e.object({name:e,required:$e.boolean().default(!0).describe("Set false only if the task is genuinely complete without it.")})).min(1).describe(t),gU=$e.string().min(1).describe("One sentence, shown to the user next to the field: what you are building and why it needs this."),vU=$e.object({kind:$e.literal("env_var"),reason:gU,key:$e.string().min(1).regex(/^[A-Za-z_][A-Za-z0-9_]*$/).describe("The variable name exactly as the code reads it, e.g. STRIPE_SECRET_KEY."),secret:$e.boolean().default(!0).describe("True for anything that must not be shown again once set: API keys, tokens, passwords."),mode:$e.enum(mU).default("exist").describe('"exist" when the key just needs a value: the user is asked only when nothing is set. "change" when a value is set but must be replaced, because it is revoked, expired, rotated, or wrong for this task. Only "change" asks the user to replace a value that is already there.'),targets:hU($e.enum(pU),"The deploy contexts the task actually needs this in. Do not list contexts the task does not touch.")}),yU=$e.discriminatedUnion("kind",[vU]),Hy={items:$e.array(yU).min(1).max(10).describe("Everything this project is missing for the task. Send them in one call, not one call per item")},RJ=$e.object(Hy);var Iz='Ask the user to configure something this project needs. Environment variables only, for now. Check what is already configured first with the `netlify` CLI, then raise only what is genuinely missing or wrong: `mode: "exist"` when any configured value will do, `mode: "change"` when a value is set but is wrong for this task. If nothing needs setting, nothing is asked of the user and nothing is configured: this returns straight away and you continue on the values already there. If something does, your run pauses while the user supplies it and then resumes automatically, so do not design around the gap or leave the work unfinished. Never end a run by telling the user to go and set something up themselves: raise it here instead, while the run can still act on it. Do NOT use this for values you can derive, generate, or read from the repo, or for a variable the code does not read. For a service that is not connected, use `request_service_authorization`.',zz=e=>`Nothing was asked of the user and nothing changed: ${e.items.map(({key:n})=>`\`${n}\``).join(", ")} already had a value in every context you asked about, and this run is continuing on those existing values. Do not tell the user you requested anything, or that any of it is now set or configured. If an existing value is the one that is wrong, raise it again with mode: "change", which is satisfied only once the user replaces it.`,_U=e=>{if(!e.some(n=>n.name==="production"&&n.required))return e;let t=e.find(n=>n.name==="deploy-preview");return t?e.map(n=>n===t?{...n,required:!0}:n):[...e,{name:"deploy-preview",required:!0}]},Pz=(e,{interactionRefId:t,runnerId:n,sessionId:i})=>({requester_kind:"agent_run",agent_runner_id:n,agent_runner_session_id:i,interaction_ref_id:t,items:e.items.map(({kind:r,reason:o,key:a,secret:s,mode:c,targets:u})=>({kind:r,reason:o,config:{key:a,secret:s,mode:c},targets:_U(u.map(({name:l,required:d})=>({name:l,required:d})))}))});var Wy=new lf({name:qr,version:"1.0.0"}),Tz=As(xz),Oz=As(Sz),Ez=As(kz),Nz=As(wz),jz=fo.env.NETLIFY_SITE_ID||fo.env.SITE_ID,xU=(e,t)=>{fo.stderr.write(`[interactions-mcp] ${e}${t?` ${JSON.stringify(t)}`:""}
83
- `)};bz();gz({constants:{NETLIFY_API_HOST:fo.env.NETLIFY_API_HOST||"api.netlify.com",NETLIFY_API_TOKEN:fo.env.NETLIFY_AUTH_TOKEN||fo.env.NETLIFY_API_TOKEN}});Wy.registerTool("ask",{description:_z,inputSchema:Ly},e=>(Tz&&Vy(Tz,e),qy()));var yf=(e,t=!1)=>({content:[{type:"text",text:e}],...t?{isError:!0}:{}});Oz&&Wy.registerTool(Ds,{description:Iz,inputSchema:Hy},async e=>{if(!jz)return yf("No project id available, so this project cannot be checked.",!0);let t=bU(),n;try{n=await vz(jz,Pz(e,{interactionRefId:t,runnerId:Ez,sessionId:Nz}),Ez,Nz)}catch(r){return yf(`Could not raise the setup request: ${r?.message}`,!0)}if(xU("setup request created",{id:n?.id,satisfied:n?.satisfied,items:e.items.length}),n?.satisfied)return yf(zz(e));let i=String(n?.id??"");return i?(Vy(Oz,{refId:t,setupRequestId:i}),qy()):yf("Could not raise the setup request: the API returned no request id.",!0)});$z();await Wy.connect(new ff);
82
+ `),Zy):GC(e,n)},YC=(e=XC())=>({inc(t,n=1,i={}){e(Os(t,n,"c",Es(i)))},gauge(t,n,i={}){e(Os(t,n,"g",Es(i)))},histogram(t,n,i={}){e(Os(t,n,"h",Es(i)))},timing(t,n,i={}){e(Os(t,n,"ms",Es(i)))},distribution(t,n,i={}){e(Os(t,n,"d",Es(i)))}}),Ns=YC();import{spawn as MB}from"child_process";import{existsSync as VB,mkdirSync as qB,writeFileSync as FB}from"fs";import{connect as JB}from"net";import QC from"path";import HB from"process";var XB=pf("step-preview"),YB=QC.join("apps","netlify-react-ui","public","agent-run-preview.json"),eU=9001,tU="components-agentrunners-rendersteps--live",QB=`http://localhost:${eU}/?path=/story/${tU}`;var mf=class extends Error{constructor(n,i,r){super(n);this.statusCode=i;this.userMessage=r;this.name="CreditLimitExceededError"}},hf=class extends Error{constructor(n,i,r){super(n);this.statusCode=i;this.userMessage=r;this.name="ApiResourceNotFoundError"}},js=class extends Error{constructor(n,i){super(n);this.statusCode=i;this.name="ApiRequestError"}};var gf=wn.env.NETLIFY_API_URL,My=wn.env.NETLIFY_API_TOKEN,lo=pf("api"),rU=()=>wn.env.NETLIFY_LOCAL_MODE==="true",nU=new Set(["agent_runners","sessions","sites","accounts","branch","dev_servers"]),iU=new Set(["api","v1","agent_runners","sessions","sites","accounts","classify","diff","result","upload_urls","native_session","upload","update_usage","connections","tokens","ai-gateway","providers","agent-runners","token","database","branch","dev_servers","config","setup_requests"]),oU=e=>e.split("/").map((t,n,i)=>t===""?t:nU.has(i[n-1])?":id":iU.has(t)?t:":id").join("/"),aU=e=>(e??[]).map(({toolCallId:t,toolStatus:n,exitCode:i,startedAtMs:r,endedAtMs:o,timingSource:a,fileOperations:s,skillId:c,...u})=>u),sU=e=>e?.steps!==void 0?{...e,steps:aU(e.steps)}:e,cU=async(e,t={})=>{if(!gf||!My)throw new Error("No API URL or token");let n=new URL(e,gf),i={...t,headers:{...t.headers,Authorization:`Bearer ${My}`}};wn.env.AGENT_RUNNERS_DEBUG==="true"&&(i.headers["x-nf-debug-logging"]="true"),t.json&&(i.headers||={},i.headers["Content-Type"]="application/json",i.body=JSON.stringify(sU(t.json)));let r=t.method??"GET",o=oU(n.pathname),a=Date.now(),s;try{s=await fetch(n,i)}catch(d){throw lo.error(zs({event:"api.request",method:r,path:n.pathname,resource:o,outcome:"network_error",error:d.message,duration_ms:Date.now()-a})),Ns.inc("api.request",1,{method:r,resource:o}),Ns.inc("api.request_failed",1,{status:"network_error",method:r,resource:o}),d}let c=s.ok&&s.status<=299;wn.env.AGENT_RUNNERS_DEBUG==="true"&&(lo.log(`Response headers for ${n}:`),s.headers.forEach((d,f)=>{lo.log(` ${f}: ${d}`)}));let u=zs({event:"api.request",method:r,path:n.pathname,resource:o,status:s.status,request_id:s.headers.get("x-request-id")||s.headers.get("x-nf-request-id"),duration_ms:Date.now()-a});if(Ns.inc("api.request",1,{method:r,resource:o}),c?lo.log(u):(lo.error(u),Ns.inc("api.request_failed",1,{status:s.status,method:r,resource:o})),t.raw){if(!c)throw new js(`API request failed: ${s.status} ${s.statusText}`,s.status);return s}let l=await(s.headers.get("content-type")?.includes("application/json")?s.json():s.text());if(!c){let d=typeof l=="string"?l:JSON.stringify(l);throw s.status===404?new hf(`API request failed: 404 - ${d}`,404,"The site associated with this agent run no longer exists."):s.status===503&&t.gracefulOn503&&d.toLowerCase().includes("usage exceeded")?new mf(`API request failed: 503 - ${d}`,503,"Credit limit reached. Please add more credits to continue using Agent Runners."):new js(`API request failed: ${s.status} - ${d}`,s.status)}return l},gz=e=>{lo.log("Setting details for api",{apiUrl:e?.constants?.NETLIFY_API_HOST,token:!!e?.constants?.NETLIFY_API_TOKEN}),wn.env.NETLIFY_AGENT_RUNNER_API_URL_OVERRIDE?gf=wn.env.NETLIFY_AGENT_RUNNER_API_URL_OVERRIDE:e?.constants?.NETLIFY_API_HOST&&(gf=`https://${e.constants.NETLIFY_API_HOST}`),e?.constants?.NETLIFY_API_TOKEN&&(My=e.constants.NETLIFY_API_TOKEN)};var uU=(e,t)=>rU()?{}:{"X-Nf-Agent-Runner-Id":e,"X-Nf-Agent-Runner-Session-Id":t};var vz=(e,t,n,i)=>cU(`/api/v1/sites/${e}/setup_requests`,{method:"POST",json:t,headers:uU(n,i)});var _z='Ask the user clarifying questions, preferably one to three, and pause until they answer. Use this instead of guessing when a decision materially changes the work. A question either offers two or three predefined options (one answer, or several with multiSelect) or omits options entirely so the user answers in their own words. The UI adds an "Other" choice and a free-text field for extra context to every question that has options, so an answer can name a choice you never offered or carry context beyond the label the user picked. The process pauses as soon as you call it; do not call it more than once or continue working after calling it.',lU=e=>{if(e!==null){if(!Array.isArray(e))return e;if(!(e.length<2))return e.map(t=>typeof t=="string"?{label:t}:t)}},yz=e=>e.meta({maxItems:3}),dU=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}},fU=e=>e.nonoptional(),Ly={questions:fU($e.preprocess(dU,yz($e.array($e.object({question:$e.string().describe("The question as the user reads it"),multiSelect:$e.boolean().optional().describe("True when several options can apply at once. Leave off for mutually exclusive choices."),options:$e.preprocess(lU,yz($e.array($e.object({label:$e.string(),description:$e.string().optional()})).min(2).optional())).describe('Two or three predefined answers. Omit entirely to ask an open question the user answers in their own words. The UI adds its own "Other" choice and a free-text field for extra context, so never add an option like "Other" or "None of these" yourself.')})).min(1)))).describe("One to three questions preferred, all asked in a single call")},xJ=$e.object(Ly);import{renameSync as pU,writeFileSync as mU}from"fs";import vf from"process";var Vy=(e,t)=>{let n=`${e}.partial`;mU(n,JSON.stringify(t)),pU(n,e)},qy=()=>new Promise(()=>{}),$z=()=>{let e=()=>vf.exit(0);vf.stdin.on("close",e),vf.stdin.on("end",e)},bz=()=>{console.log=console.error,console.info=console.error,console.debug=console.error},As=(e,t=vf.argv)=>{let n=t.indexOf(e);return n===-1?void 0:t[n+1]};var qr="netlify_interactions";var Ds="request_project_setup",xz="--questions-file",Fy="netlify_connections",By="request_service_authorization";var kz="--runner-id",wz="--session-id";var Sz="--setup-file",Jy=(e,t)=>`mcp__${e}__${t}`,Ky=(e,t)=>`mcp_${e}_${t}`,Gy=(e,t)=>`${e}_${t}`,zJ=Jy(qr,"ask"),PJ=Ky(qr,"ask"),TJ=Gy(qr,"ask"),OJ=Jy(Fy,By),EJ=Ky(Fy,By),NJ=Gy(Fy,By),jJ=Jy(qr,Ds),AJ=Ky(qr,Ds),DJ=Gy(qr,Ds);var hU=["production","deploy-preview","branch-deploy","dev"],gU=["exist","change"],vU=(e,t)=>$e.array($e.object({name:e,required:$e.boolean().default(!0).describe("Set false only if the task is genuinely complete without it.")})).min(1).describe(t),yU=$e.string().min(1).describe("One sentence, shown to the user next to the field: what you are building and why it needs this."),_U=$e.object({kind:$e.literal("env_var"),reason:yU,key:$e.string().min(1).regex(/^[A-Za-z_][A-Za-z0-9_]*$/).describe("The variable name exactly as the code reads it, e.g. STRIPE_SECRET_KEY."),secret:$e.boolean().default(!0).describe("True for anything that must not be shown again once set: API keys, tokens, passwords."),mode:$e.enum(gU).default("exist").describe('"exist" when the key just needs a value: the user is asked only when nothing is set. "change" when a value is set but must be replaced, because it is revoked, expired, rotated, or wrong for this task. Only "change" asks the user to replace a value that is already there.'),targets:vU($e.enum(hU),"The deploy contexts the task actually needs this in. Do not list contexts the task does not touch.")}),$U=$e.discriminatedUnion("kind",[_U]),Hy={items:$e.array($U).min(1).max(10).describe("Everything this project is missing for the task. Send them in one call, not one call per item")},UJ=$e.object(Hy);var Iz='Ask the user to configure something this project needs. Environment variables only, for now. Check what is already configured first with the `netlify` CLI, then raise only what is genuinely missing or wrong: `mode: "exist"` when any configured value will do, `mode: "change"` when a value is set but is wrong for this task. If nothing needs setting, nothing is asked of the user and nothing is configured: this returns straight away and you continue on the values already there. If something does, your run pauses while the user supplies it and then resumes automatically, so do not design around the gap or leave the work unfinished. Never end a run by telling the user to go and set something up themselves: raise it here instead, while the run can still act on it. Do NOT use this for values you can derive, generate, or read from the repo, or for a variable the code does not read. For a service that is not connected, use `request_service_authorization`.',zz=e=>`Nothing was asked of the user and nothing changed: ${e.items.map(({key:n})=>`\`${n}\``).join(", ")} already had a value in every context you asked about, and this run is continuing on those existing values. Do not tell the user you requested anything, or that any of it is now set or configured. If they told you a value was missing, say plainly that it is still set, because they are working from something that is not true of this project. If an existing value is the one that needs replacing, raise it again with mode: "change", which is satisfied only once they replace it.`,bU=e=>{if(!e.some(n=>n.name==="production"&&n.required))return e;let t=e.find(n=>n.name==="deploy-preview");return t?e.map(n=>n===t?{...n,required:!0}:n):[...e,{name:"deploy-preview",required:!0}]},Pz=(e,{interactionRefId:t,runnerId:n,sessionId:i})=>({requester_kind:"agent_run",agent_runner_id:n,agent_runner_session_id:i,interaction_ref_id:t,items:e.items.map(({kind:r,reason:o,key:a,secret:s,mode:c,targets:u})=>({kind:r,reason:o,config:{key:a,secret:s,mode:c},targets:bU(u.map(({name:l,required:d})=>({name:l,required:d})))}))});var Wy=new lf({name:qr,version:"1.0.0"}),Tz=As(xz),Oz=As(Sz),Ez=As(kz),Nz=As(wz),jz=fo.env.NETLIFY_SITE_ID||fo.env.SITE_ID,wU=(e,t)=>{fo.stderr.write(`[interactions-mcp] ${e}${t?` ${JSON.stringify(t)}`:""}
83
+ `)};bz();gz({constants:{NETLIFY_API_HOST:fo.env.NETLIFY_API_HOST||"api.netlify.com",NETLIFY_API_TOKEN:fo.env.NETLIFY_AUTH_TOKEN||fo.env.NETLIFY_API_TOKEN}});Wy.registerTool("ask",{description:_z,inputSchema:Ly},e=>(Tz&&Vy(Tz,e),qy()));var yf=(e,t=!1)=>({content:[{type:"text",text:e}],...t?{isError:!0}:{}});Oz&&Wy.registerTool(Ds,{description:Iz,inputSchema:Hy},async e=>{if(!jz)return yf("No project id available, so this project cannot be checked.",!0);let t=kU(),n;try{n=await vz(jz,Pz(e,{interactionRefId:t,runnerId:Ez,sessionId:Nz}),Ez,Nz)}catch(r){return yf(`Could not raise the setup request: ${r?.message}`,!0)}if(wU("setup request created",{id:n?.id,satisfied:n?.satisfied,items:e.items.length}),n?.satisfied)return yf(zz(e));let i=String(n?.id??"");return i?(Vy(Oz,{refId:t,setupRequestId:i}),qy()):yf("Could not raise the setup request: the API returned no request id.",!0)});$z();await Wy.connect(new ff);
84
84
  //# sourceMappingURL=interactions-mcp-server.js.map