xmcp 0.8.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,49 +1,43 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod/v3"));else if("function"==typeof define&&define.amd)define(["zod/v3"],t);else{var r="object"==typeof exports?t(require("zod/v3")):t(e["zod/v3"]);for(var s in r)("object"==typeof exports?exports:e)[s]=r[s]}}(this,e=>(()=>{var t,r,s={5888(e,t){"use strict";function r(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(i,n),time:r(l(!0),u),"date-time":r(p(!0),f),"iso-time":r(l(),c),"iso-date-time":r(p(),h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return m.test(e)&&y.test(e)},"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:function(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},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:function(e){return g.lastIndex=0,g.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=_&&e>=v}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:b},double:{type:"number",validate:b},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,n),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":r(/^\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,f),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"iso-date-time":r(/^\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,h),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},t.formatNames=Object.keys(t.fullFormats);let s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){var t;let r=s.exec(e);if(!r)return!1;let i=+r[1],n=+r[2],a=+r[3];return n>=1&&n<=12&&a>=1&&a<=(2===n&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[n])}function n(e,t){if(e&&t)return e>t?1:e<t?-1:0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(e){return function(t){let r=a.exec(t);if(!r)return!1;let s=+r[1],o=+r[2],i=+r[3],n=r[4],l="-"===r[5]?-1:1,u=+(r[6]||0),c=+(r[7]||0);if(u>23||c>59||e&&!n)return!1;if(s<=23&&o<=59&&i<60)return!0;let d=o-c*l,p=s-u*l-(d<0);return(23===p||-1===p)&&(59===d||-1===d)&&i<61}}function u(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),s=new Date("2020-01-01T"+t).valueOf();if(r&&s)return r-s}function c(e,t){if(!(e&&t))return;let r=a.exec(e),s=a.exec(t);if(r&&s)return(e=r[1]+r[2]+r[3])>(t=s[1]+s[2]+s[3])?1:e<t?-1:0}let d=/t|\s/i;function p(e){let t=l(e);return function(e){let r=e.split(d);return 2===r.length&&i(r[0])&&t(r[1])}}function f(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),s=new Date(t).valueOf();if(r&&s)return r-s}function h(e,t){if(!(e&&t))return;let[r,s]=e.split(d),[o,i]=t.split(d),a=n(r,o);if(void 0!==a)return a||u(s,i)}let m=/\/|:/,y=/^(?:[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,g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,v=-0x80000000,_=0x80000000-1;function b(){return!0}let w=/[^\\]\\Z/},1712(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(5888),o=r(9035),i=r(8994),n=new i.Name("fullFormats"),a=new i.Name("fastFormats"),l=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,s.fullFormats,n),e;let[r,i]="fast"===t.mode?[s.fastFormats,a]:[s.fullFormats,n];return u(e,t.formats||s.formatNames,r,i),t.keywords&&(0,o.default)(e),e};function u(e,t,r,s){var o;for(let n of(null!=(o=e.opts.code).formats||(o.formats=(0,i._)`require("ajv-formats/dist/formats").${s}`),t))e.addFormat(n,r[n])}l.get=(e,t="full")=>{let r=("fast"===t?s.fastFormats:s.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r},e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l},9035(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;let s=r(8825),o=r(8994),i=o.operators,n={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}};t.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,o.str)`should be ${n[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,o._)`{comparison: ${n[e].okStr}, limit: ${t}}`},code(e){let t,r,{gen:i,data:a,schemaCode:l,keyword:u,it:c}=e,{opts:d,self:p}=c;if(!d.validateFormats)return;let f=new s.KeywordCxt(c,p.RULES.all.format.definition,"format");function h(e){return(0,o._)`${e}.compare(${a}, ${l}) ${n[u].fail} 0`}f.$data?(t=i.scopeValue("formats",{ref:p.formats,code:d.code.formats}),r=i.const("fmt",(0,o._)`${t}[${f.schemaCode}]`),e.fail$data((0,o.or)((0,o._)`typeof ${r} != "object"`,(0,o._)`${r} instanceof RegExp`,(0,o._)`typeof ${r}.compare != "function"`,h(r)))):function(){let t=f.schema,r=p.formats[t];if(!r||!0===r)return;if("object"!=typeof r||r instanceof RegExp||"function"!=typeof r.compare)throw Error(`"${u}": format "${t}" does not define "compare" function`);let s=i.scopeValue("formats",{key:t,ref:r,code:d.code.formats?(0,o._)`${d.code.formats}${(0,o.getProperty)(t)}`:void 0});e.fail$data(h(s))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},8825(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let s=r(1967),o=r(3959),i=r(9376),n=r(7456),a=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends s.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(n,a):n;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var c=r(6023);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var d=r(8994);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=r(4383);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var f=r(4220);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},8261(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=s;class o extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof s&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function i(e,...t){let r=[e[0]],s=0;for(;s<t.length;)l(r,t[s]),r.push(e[++s]);return new o(r)}t._Code=o,t.nil=new o(""),t._=i;let n=new o("+");function a(e,...t){let r=[u(e[0])],i=0;for(;i<t.length;)r.push(n),l(r,t[i]),r.push(n,u(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){var r,o;let i=(r=e[t-1],'""'===(o=e[t+1])?r:'""'===r?o:"string"==typeof r?o instanceof s||'"'!==r[r.length-1]?void 0:"string"!=typeof o?`${r.slice(0,-1)}${o}"`:'"'===o[0]?r.slice(0,-1)+o.slice(1):void 0:"string"!=typeof o||'"'!==o[0]||r instanceof s?void 0:`"${r}${o.slice(1)}`);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(r),new o(r)}function l(e,t){var r;t instanceof o?e.push(...t._items):t instanceof s?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):i`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},8994(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let s=r(8261),o=r(4490);var i=r(8261);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var n=r(4490);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),t.operators={GT:new s._Code(">"),GTE:new s._Code(">="),LT:new s._Code("<"),LTE:new s._Code("<="),EQ:new s._Code("==="),NEQ:new s._Code("!=="),NOT:new s._Code("!"),OR:new s._Code("||"),AND:new s._Code("&&"),ADD:new s._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?o.varKinds.var:this.varKind,s=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,e,t)),this}get names(){return this.rhs instanceof s._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof s.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=j(this.rhs,e,t),this}get names(){return I(this.lhs instanceof s.Name?{}:{...this.lhs.names},this.rhs)}}class c extends u{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class p extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){let t=this.label?` ${this.label}`:"";return`break${t};`+e}}class f extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=j(this.code,e,t),this}get names(){return this.code instanceof s._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,s=r.length;for(;s--;){let o=r[s];o.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,o.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>O(e,t.names),{})}}class y extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class g extends m{}class v extends y{}v.kind="else";class _ extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){let e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(R(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=j(this.condition,e,t),this}get names(){let e=super.names;return I(e,this.condition),this.else&&O(e,this.else.names),e}}_.kind="if";class b extends y{}b.kind="for";class w extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=j(this.iteration,e,t),this}get names(){return O(super.names,this.iteration.names)}}class $ extends b{constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){let t=e.es5?o.varKinds.var:this.varKind,{name:r,from:s,to:i}=this;return`for(${t} ${r}=${s}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=I(super.names,this.from);return I(e,this.to)}}class E extends b{constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=j(this.iterable,e,t),this}get names(){return O(super.names,this.iterable.names)}}class k extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){let t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}k.kind="func";class S extends m{render(e){return"return "+super.render(e)}}S.kind="return";class T extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(s=this.finally)||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&O(e,this.catch.names),this.finally&&O(e,this.finally.names),e}}class x extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}x.kind="catch";class P extends y{render(e){return"finally"+super.render(e)}}function O(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function I(e,t){return t instanceof s._CodeOrName?O(e,t.names):e}function j(e,t,r){var o;if(e instanceof s.Name)return i(e);if(!((o=e)instanceof s._Code&&o._items.some(e=>e instanceof s.Name&&1===t[e.str]&&void 0!==r[e.str])))return e;return new s._Code(e._items.reduce((e,t)=>(t instanceof s.Name&&(t=i(t)),t instanceof s._Code?e.push(...t._items):e.push(t),e),[]));function i(e){let s=r[e.str];return void 0===s||1!==t[e.str]?e:(delete t[e.str],s)}}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,s._)`!${A(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){let o=this._scope.toName(t);return void 0!==r&&s&&(this._constants[o.str]=r),this._leafNode(new l(e,o,r)),o}const(e,t,r){return this._def(o.varKinds.const,e,t,r)}let(e,t,r){return this._def(o.varKinds.let,e,t,r)}var(e,t,r){return this._def(o.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new c(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==s.nil&&this._leafNode(new h(e)),this}object(...e){let t=["{"];for(let[r,o]of e)t.length>1&&t.push(","),t.push(r),(r!==o||this.opts.es5)&&(t.push(":"),(0,s.addCodeArg)(t,o));return t.push("}"),new s._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(_,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,s,i=this.opts.es5?o.varKinds.var:o.varKinds.let){let n=this._scope.toName(e);return this._for(new $(i,n,t,r),()=>s(n))}forOf(e,t,r,i=o.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let e=t instanceof s.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,s._)`${e}.length`,t=>{this.var(n,(0,s._)`${e}[${t}]`),r(n)})}return this._for(new E("of",i,n,t),()=>r(n))}forIn(e,t,r,i=this.opts.es5?o.varKinds.var:o.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,s._)`Object.keys(${t})`,r);let n=this._scope.toName(e);return this._for(new E("in",i,n,t),()=>r(n))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new p(e))}return(e){let t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let s=new T;if(this._blockNode(s),this.code(e),t){let e=this.name("e");this._currNode=s.catch=new x(e),t(e)}return r&&(this._currNode=s.finally=new P,this.code(r)),this._endBlockNode(x,P)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=s.nil,r,o){return this._blockNode(new k(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}},t.not=R;let N=C(t.operators.AND);t.and=function(...e){return e.reduce(N)};let z=C(t.operators.OR);function C(e){return(t,r)=>t===s.nil?r:r===s.nil?t:(0,s._)`${A(t)} ${e} ${A(r)}`}function A(e){return e instanceof s.Name?e:(0,s._)`(${e})`}t.or=function(...e){return e.reduce(z)}},4490(e,t,r){"use strict";var s,o;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let i=r(8261);class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}(o=s||(t.UsedValueState=s={}))[o.Started=0]="Started",o[o.Completed=1]="Completed",t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=a;class l extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,i._)`.${new i.Name(t)}[${r}]`}}t.ValueScopeName=l;let u=(0,i._)`\n`;t.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?u:i.nil}}get(){return this._scope}name(e){return new l(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,i=null!=(r=t.key)?r:t.ref,n=this._values[o];if(n){let e=n.get(i);if(e)return e}else n=this._values[o]=new Map;n.set(i,s);let a=this._scope[o]||(this._scope[o]=[]),l=a.length;return a[l]=t.ref,s.setValue(t,{property:o,itemIndex:l}),s}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw Error(`CodeGen: name "${t}" has no value`);return(0,i._)`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,o={},a){let l=i.nil;for(let u in e){let c=e[u];if(!c)continue;let d=o[u]=o[u]||new Map;c.forEach(e=>{if(d.has(e))return;d.set(e,s.Started);let o=r(e);if(o){let r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=(0,i._)`${l}${r} ${e} = ${o};${this.opts._n}`}else if(o=null==a?void 0:a(e))l=(0,i._)`${l}${o}${this.opts._n}`;else throw new n(e);d.set(e,s.Completed)})}return l}}},8425(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;let s=r(8994),o=r(7218),i=r(6660);function n(e,t){let r=e.const("err",t);e.if((0,s._)`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,(0,s._)`[${r}]`),(0,s._)`${i.default.vErrors}.push(${r})`),e.code((0,s._)`${i.default.errors}++`)}function a(e,t){let{gen:r,validateName:o,schemaEnv:i}=e;i.$async?r.throw((0,s._)`new ${e.ValidationError}(${t})`):(r.assign((0,s._)`${o}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>(0,s.str)`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,s.str)`"${e}" keyword must be ${t} ($data)`:(0,s.str)`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,o,i){let{it:l}=e,{gen:c,compositeRule:d,allErrors:p}=l,f=u(e,r,o);(null!=i?i:d||p)?n(c,f):a(l,(0,s._)`[${f}]`)},t.reportExtraError=function(e,r=t.keywordError,s){let{it:o}=e,{gen:l,compositeRule:c,allErrors:d}=o;n(l,u(e,r,s)),c||d||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if((0,s._)`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,s._)`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:n,it:a}){if(void 0===n)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",n,i.default.errors,n=>{e.const(l,(0,s._)`${i.default.vErrors}[${n}]`),e.if((0,s._)`${l}.instancePath === undefined`,()=>e.assign((0,s._)`${l}.instancePath`,(0,s.strConcat)(i.default.instancePath,a.errorPath))),e.assign((0,s._)`${l}.schemaPath`,(0,s.str)`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign((0,s._)`${l}.schema`,r),e.assign((0,s._)`${l}.data`,o))})};let l={keyword:new s.Name("keyword"),schemaPath:new s.Name("schemaPath"),params:new s.Name("params"),propertyName:new s.Name("propertyName"),message:new s.Name("message"),schema:new s.Name("schema"),parentSchema:new s.Name("parentSchema")};function u(e,t,r){let{createErrors:n}=e.it;return!1===n?(0,s._)`{}`:function(e,t,r={}){let{gen:n,it:a}=e,u=[function({errorPath:e},{instancePath:t}){let r=t?(0,s.str)`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,s.strConcat)(i.default.instancePath,r)]}(a,r),function({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let n=i?t:(0,s.str)`${t}/${e}`;return r&&(n=(0,s.str)`${n}${(0,o.getErrorPath)(r,o.Type.Str)}`),[l.schemaPath,n]}(e,r)];return function(e,{params:t,message:r},o){let{keyword:n,data:a,schemaValue:u,it:c}=e,{opts:d,propertyName:p,topSchemaRef:f,schemaPath:h}=c;o.push([l.keyword,n],[l.params,"function"==typeof t?t(e):t||(0,s._)`{}`]),d.messages&&o.push([l.message,"function"==typeof r?r(e):r]),d.verbose&&o.push([l.schema,u],[l.parentSchema,(0,s._)`${f}${h}`],[i.default.data,a]),p&&o.push([l.propertyName,p])}(e,t,u),n.object(...u)}(e,t,r)}},1688(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let s=r(8994),o=r(4383),i=r(6660),n=r(9008),a=r(7218),l=r(6023);class u{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,n.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function c(e){let t,r,a=p.call(this,e);if(a)return a;let u=(0,n.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:d}=this.opts.code,{ownProperties:f}=this.opts,h=new s.CodeGen(this.scope,{es5:c,lines:d,ownProperties:f});e.$async&&(t=h.scopeValue("Error",{ref:o.default,code:(0,s._)`require("ajv/dist/runtime/validation_error").default`}));let m=h.scopeName("validate");e.validateName=m;let y={gen:h,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[s.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,s.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:t,schema:e.schema,schemaEnv:e,rootId:u,baseId:e.baseId||u,schemaPath:s.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,s._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,l.validateFunctionCode)(y),h.optimize(this.opts.code.optimize);let t=h.toString();r=`${h.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(r=this.opts.code.process(r,e));let o=Function(`${i.default.self}`,`${i.default.scope}`,r)(this,this.scope.get());if(this.scope.value(m,{ref:o}),o.errors=null,o.schema=e.schema,o.schemaEnv=e,e.$async&&(o.$async=!0),!0===this.opts.code.source&&(o.source={validateName:m,validateCode:t,scopeValues:h._values}),this.opts.unevaluated){let{props:e,items:t}=y;o.evaluated={props:e instanceof s.Name?void 0:e,items:t instanceof s.Name?void 0:t,dynamicProps:e instanceof s.Name,dynamicItems:t instanceof s.Name},o.source&&(o.source.evaluated=(0,s.stringify)(o.evaluated))}return e.validate=o,e}catch(t){throw delete e.validate,delete e.validateName,r&&this.logger.error("Error compiling schema, function code:",r),t}finally{this._compilations.delete(e)}}function d(e){return(0,n.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function p(e){for(let s of this._compilations){var t,r;if(t=s,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return s}}function f(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||h.call(this,e,t)}function h(e,t){let r=this.opts.uriResolver.parse(t),s=(0,n._getFullPath)(this.opts.uriResolver,r),o=(0,n.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===o)return y.call(this,r,e);let i=(0,n.normalizeId)(s),a=this.refs[i]||this.schemas[i];if("string"==typeof a){let t=h.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||c.call(this,a),i===(0,n.normalizeId)(t)){let{schema:t}=a,{schemaId:r}=this.opts,s=t[r];return s&&(o=(0,n.resolveUrl)(this.opts.uriResolver,o,s)),new u({schema:t,schemaId:r,root:e,baseId:o})}return y.call(this,r,a)}}t.SchemaEnv=u,t.compileSchema=c,t.resolveRef=function(e,t,r){var s;r=(0,n.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=f.call(this,e,r);if(void 0===i){let o=null==(s=e.localRefs)?void 0:s[r],{schemaId:n}=this.opts;o&&(i=new u({schema:o,schemaId:n,root:e,baseId:t}))}if(void 0!==i)return e.refs[r]=d.call(this,i)},t.getCompilingSchema=p,t.resolveSchema=h;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:s}){var o;let i;if((null==(o=e.fragment)?void 0:o[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,a.unescapeFragment)(s)];if(void 0===e)return;let o="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(s)&&o&&(t=(0,n.resolveUrl)(this.opts.uriResolver,t,o))}if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){let e=(0,n.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=h.call(this,s,e)}let{schemaId:l}=this.opts;if((i=i||new u({schema:r,schemaId:l,root:s,baseId:t})).schema!==i.root.schema)return i}},6660(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994);t.default={data:new s.Name("data"),valCxt:new s.Name("valCxt"),instancePath:new s.Name("instancePath"),parentData:new s.Name("parentData"),parentDataProperty:new s.Name("parentDataProperty"),rootData:new s.Name("rootData"),dynamicAnchors:new s.Name("dynamicAnchors"),vErrors:new s.Name("vErrors"),errors:new s.Name("errors"),this:new s.Name("this"),self:new s.Name("self"),scope:new s.Name("scope"),json:new s.Name("json"),jsonPos:new s.Name("jsonPos"),jsonLen:new s.Name("jsonLen"),jsonPart:new s.Name("jsonPart")}},4220(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(9008);t.default=class extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,s.resolveUrl)(e,t,r),this.missingSchema=(0,s.normalizeId)((0,s.getFullPath)(e,this.missingRef))}}},9008(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let s=r(7218),o=r(7371),i=r(205),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!function e(t){for(let r in t){if(a.has(r))return!0;let s=t[r];if(Array.isArray(s)&&s.some(e)||"object"==typeof s&&e(s))return!0}return!1}(e):!!t&&function e(t){let r=0;for(let o in t)if("$ref"===o||(r++,!n.has(o)&&("object"==typeof t[o]&&(0,s.eachItem)(t[o],t=>r+=e(t)),r===1/0)))return 1/0;return r}(e)<=t)};let a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e,t="",r){!1!==r&&(t=d(t));let s=e.parse(t);return u(e,s)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=l,t._getFullPath=u;let c=/#\/?$/;function d(e){return e?e.replace(c,""):""}t.normalizeId=d,t.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};let p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:r,uriResolver:s}=this.opts,n=d(e[r]||t),a={"":n},u=l(s,n,!1),c={},f=new Set;return i(e,{allKeys:!0},(e,t,s,o)=>{if(void 0===o)return;let i=u+t,n=a[o];function l(t){let r=this.opts.uriResolver.resolve;if(t=d(n?r(n,t):t),f.has(t))throw m(t);f.add(t);let s=this.refs[t];return"string"==typeof s&&(s=this.refs[s]),"object"==typeof s?h(e,s.schema,t):t!==d(i)&&("#"===t[0]?(h(e,c[t],t),c[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!p.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}"string"==typeof e[r]&&(n=l.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=n}),c;function h(e,t,r){if(void 0!==t&&!o(e,t))throw m(r)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}},6247(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){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:{}}}},7218(e,t,r){"use strict";var s,o;Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let i=r(8994),n=r(8261);function a(e,t=e.schema){let{opts:r,self:s}=e;if(!r.strictSchema||"boolean"==typeof t)return;let o=s.RULES.keywords;for(let r in t)o[r]||m(e,`unknown keyword: "${r}"`)}function l(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function u(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function d({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:s}){return(o,n,a,l)=>{let u=void 0===a?n:a instanceof i.Name?(n instanceof i.Name?e(o,n,a):t(o,n,a),a):n instanceof i.Name?(t(o,a,n),n):r(n,a);return l!==i.Name||u instanceof i.Name?u:s(o,u)}}function p(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,i._)`{}`);return void 0!==t&&f(e,r,t),r}function f(e,t,r){Object.keys(r).forEach(r=>e.assign((0,i._)`${t}${(0,i.getProperty)(r)}`,!0))}t.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(a(e,t),!l(t,e.self.RULES.all))},t.checkUnknownRules=a,t.schemaHasRules=l,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,s,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,i._)`${r}`}return(0,i._)`${e}${t}${(0,i.getProperty)(s)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(u(e))},t.escapeJsonPointer=u,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},t.mergeEvaluated={props:d({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,i._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,i._)`${r} || {}`).code((0,i._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,i._)`${r} || {}`),f(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:p}),items:d({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,i._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>e.assign(r,!0===t||(0,i._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=p,t.setEvaluated=f;let h={};function m(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new n._Code(t.code))})},(o=s||(t.Type=s={}))[o.Num=0]="Num",o[o.Str=1]="Str",t.getErrorPath=function(e,t,r){if(e instanceof i.Name){let o=t===s.Num;return r?o?(0,i._)`"[" + ${e} + "]"`:(0,i._)`"['" + ${e} + "']"`:o?(0,i._)`"/" + ${e}`:(0,i._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,i.getProperty)(e).toString():"/"+u(e)},t.checkStrictMode=m},238(e,t){"use strict";function r(e,t){return t.rules.some(t=>s(e,t))}function s(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},s){let o=t.RULES.types[s];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=s},564(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let s=r(8425),o=r(8994),i=r(6660),n={message:"boolean schema is false"};function a(e,t){let{gen:r,data:o}=e;(0,s.reportError)({gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},n,void 0,t)}t.topBoolOrEmptySchema=function(e){let{gen:t,schema:r,validateName:s}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign((0,o._)`${s}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){let{gen:r,schema:s}=e;!1===s?(r.var(t,!1),a(e)):r.var(t,!0)}},6419(e,t,r){"use strict";var s,o;Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let i=r(6247),n=r(238),a=r(8425),l=r(8994),u=r(7218);function c(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(o=s||(t.DataType=s={}))[o.Correct=0]="Correct",o[o.Wrong=1]="Wrong",t.getSchemaTypes=function(e){let t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){var r,o;let{gen:i,data:a,opts:u}=e,c=(r=t,(o=u.coerceTypes)?r.filter(e=>d.has(e)||"array"===o&&"array"===e):[]),p=t.length>0&&!(0===c.length&&1===t.length&&(0,n.schemaHasRulesForType)(e,t[0]));if(p){let r=f(t,a,u.strictNumbers,s.Wrong);i.if(r,()=>{c.length?function(e,t,r){let{gen:s,data:o,opts:i}=e,n=s.let("dataType",(0,l._)`typeof ${o}`),a=s.let("coerced",(0,l._)`undefined`);for(let e of("array"===i.coerceTypes&&s.if((0,l._)`${n} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>s.assign(o,(0,l._)`${o}[0]`).assign(n,(0,l._)`typeof ${o}`).if(f(t,o,i.strictNumbers),()=>s.assign(a,o))),s.if((0,l._)`${a} !== undefined`),r))(d.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":s.elseIf((0,l._)`${n} == "number" || ${n} == "boolean"`).assign(a,(0,l._)`"" + ${o}`).elseIf((0,l._)`${o} === null`).assign(a,(0,l._)`""`);return;case"number":s.elseIf((0,l._)`${n} == "boolean" || ${o} === null
2
- || (${n} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,l._)`+${o}`);return;case"integer":s.elseIf((0,l._)`${n} === "boolean" || ${o} === null
3
- || (${n} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,l._)`+${o}`);return;case"boolean":s.elseIf((0,l._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,l._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":s.elseIf((0,l._)`${o} === "" || ${o} === 0 || ${o} === false`),s.assign(a,null);return;case"array":s.elseIf((0,l._)`${n} === "string" || ${n} === "number"
4
- || ${n} === "boolean" || ${o} === null`).assign(a,(0,l._)`[${o}]`)}}(e);s.else(),m(e),s.endIf(),s.if((0,l._)`${a} !== undefined`,()=>{s.assign(o,a),function({gen:e,parentData:t,parentDataProperty:r},s){e.if((0,l._)`${t} !== undefined`,()=>e.assign((0,l._)`${t}[${r}]`,s))}(e,a)})}(e,t,c):m(e)})}return p};let d=new Set(["string","number","integer","boolean","null"]);function p(e,t,r,o=s.Correct){let i,n=o===s.Correct?l.operators.EQ:l.operators.NEQ;switch(e){case"null":return(0,l._)`${t} ${n} null`;case"array":i=(0,l._)`Array.isArray(${t})`;break;case"object":i=(0,l._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a((0,l._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return(0,l._)`typeof ${t} ${n} ${e}`}return o===s.Correct?i:(0,l.not)(i);function a(e=l.nil){return(0,l.and)((0,l._)`typeof ${t} == "number"`,e,r?(0,l._)`isFinite(${t})`:l.nil)}}function f(e,t,r,s){let o;if(1===e.length)return p(e[0],t,r,s);let i=(0,u.toHash)(e);if(i.array&&i.object){let e=(0,l._)`typeof ${t} != "object"`;o=i.null?e:(0,l._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=l.nil;for(let e in i.number&&delete i.integer,i)o=(0,l.and)(o,p(e,t,r,s));return o}t.checkDataType=p,t.checkDataTypes=f;let h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,l._)`{type: ${e}}`:(0,l._)`{type: ${t}}`};function m(e){let t=function(e){let{gen:t,data:r,schema:s}=e,o=(0,u.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:o,schemaValue:o,parentSchema:s,params:{},it:e}}(e);(0,a.reportError)(t,h)}t.reportTypeError=m},6593(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;let s=r(8994),o=r(7218);function i(e,t,r){let{gen:i,compositeRule:n,data:a,opts:l}=e;if(void 0===r)return;let u=(0,s._)`${a}${(0,s.getProperty)(t)}`;if(n)return void(0,o.checkStrictMode)(e,`default is ignored for: ${u}`);let c=(0,s._)`${u} === undefined`;"empty"===l.useDefaults&&(c=(0,s._)`${c} || ${u} === null || ${u} === ""`),i.if(c,(0,s._)`${u} = ${(0,s.stringify)(r)}`)}t.assignDefaults=function(e,t){let{properties:r,items:s}=e.schema;if("object"===t&&r)for(let t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(s)&&s.forEach((t,r)=>i(e,r,t.default))}},6023(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let s=r(564),o=r(6419),i=r(238),n=r(6419),a=r(6593),l=r(9820),u=r(3826),c=r(8994),d=r(6660),p=r(9008),f=r(7218),h=r(8425);function m({gen:e,validateName:t,schema:r,schemaEnv:s,opts:o},i){var n;o.code.es5?e.func(t,(0,c._)`${d.default.data}, ${d.default.valCxt}`,s.$async,()=>{var t,s;e.code((0,c._)`"use strict"; ${y(r,o)}`),t=e,s=o,t.if(d.default.valCxt,()=>{t.var(d.default.instancePath,(0,c._)`${d.default.valCxt}.${d.default.instancePath}`),t.var(d.default.parentData,(0,c._)`${d.default.valCxt}.${d.default.parentData}`),t.var(d.default.parentDataProperty,(0,c._)`${d.default.valCxt}.${d.default.parentDataProperty}`),t.var(d.default.rootData,(0,c._)`${d.default.valCxt}.${d.default.rootData}`),s.dynamicRef&&t.var(d.default.dynamicAnchors,(0,c._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{t.var(d.default.instancePath,(0,c._)`""`),t.var(d.default.parentData,(0,c._)`undefined`),t.var(d.default.parentDataProperty,(0,c._)`undefined`),t.var(d.default.rootData,d.default.data),s.dynamicRef&&t.var(d.default.dynamicAnchors,(0,c._)`{}`)}),e.code(i)}):e.func(t,(0,c._)`${d.default.data}, ${(n=o,(0,c._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${n.dynamicRef?(0,c._)`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`)}`,s.$async,()=>e.code(y(r,o)).code(i))}function y(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${r} */`:c.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function _(e){(0,f.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:s,self:o}=e;t.$ref&&s.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function b(e,t){if(e.opts.jtd)return $(e,[],!1,t);let r=(0,o.getSchemaTypes)(e.schema),s=(0,o.coerceAndCheckDataType)(e,r);$(e,r,!s,t)}function w({gen:e,schemaEnv:t,schema:r,errSchemaPath:s,opts:o}){let i=r.$comment;if(!0===o.$comment)e.code((0,c._)`${d.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){let r=(0,c.str)`${s}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code((0,c._)`${d.default.self}.opts.$comment(${i}, ${r}, ${o}.schema)`)}}function $(e,t,r,s){var o,a,l,u;let{gen:p,schema:h,data:m,allErrors:y,opts:g,self:v}=e,{RULES:_}=v;if(h.$ref&&(g.ignoreKeywordsWithRef||!(0,f.schemaHasRulesButRef)(h,_)))return void p.block(()=>x(e,"$ref",_.all.$ref.definition));function b(o){(0,i.shouldUseGroup)(h,o)&&(o.type?(p.if((0,n.checkDataType)(o.type,m,g.strictNumbers)),E(e,o),1===t.length&&t[0]===o.type&&r&&(p.else(),(0,n.reportTypeError)(e)),p.endIf()):E(e,o),y||p.if((0,c._)`${d.default.errors} === ${s||0}`))}g.jtd||(o=e,a=t,!o.schemaEnv.meta&&o.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{k(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let s of e.dataTypes)k(t,s)?r.push(s):t.includes("integer")&&"number"===s&&r.push("integer");e.dataTypes=r}(e,t)}}(o,a),o.opts.allowUnionTypes||(l=o,(u=a).length>1&&!(2===u.length&&u.includes("null"))&&S(l,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let s in r){let o=r[s];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){let{type:r}=o.definition;r.length&&!r.some(e=>{var r,s;return r=t,s=e,r.includes(s)||"number"===s&&r.includes("integer")})&&S(e,`missing type "${r.join(",")}" for keyword "${s}"`)}}}(o,o.dataTypes))),p.block(()=>{for(let e of _.rules)b(e);b(_.post)})}function E(e,t){let{gen:r,schema:s,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,i.shouldUseRule)(s,r)&&x(e,r.keyword,r.definition,t.type)})}function k(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,f.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){v(e)&&(_(e),g(e))?function(e){let{schema:t,opts:r,gen:s}=e;m(e,()=>{r.$comment&&t.$comment&&w(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,f.checkStrictMode)(e,"default is ignored in the schema root")}(e),s.let(d.default.vErrors,null),s.let(d.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,c._)`${r}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}(e),b(e),function(e){let{gen:t,schemaEnv:r,validateName:s,ValidationError:o,opts:i}=e;r.$async?t.if((0,c._)`${d.default.errors} === 0`,()=>t.return(d.default.data),()=>t.throw((0,c._)`new ${o}(${d.default.vErrors})`)):(t.assign((0,c._)`${s}.errors`,d.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:s}){r instanceof c.Name&&e.assign((0,c._)`${t}.props`,r),s instanceof c.Name&&e.assign((0,c._)`${t}.items`,s)}(e),t.return((0,c._)`${d.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,s.topBoolOrEmptySchema)(e))};class T{constructor(e,t,r){if((0,l.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",I(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,r){this.failResult((0,c.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?h.reportExtraError:h.reportError)(this,this.def.error,t)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=c.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:r,schemaCode:s,schemaType:o,def:i}=this;r.if((0,c.or)((0,c._)`${s} === undefined`,t)),e!==c.nil&&r.assign(e,!0),(o.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:s,it:o}=this;return(0,c.or)(function(){if(r.length){if(!(t instanceof c.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,c._)`${(0,n.checkDataTypes)(e,t,o.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}(),function(){if(s.validateSchema){let r=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,c._)`!${r}(${t})`}return c.nil}())}subschema(e,t){let r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);let o={...this.it,...r,items:void 0,props:void 0};return!function(e,t){if(v(e)&&(_(e),g(e)))return function(e,t){var r;let s,{schema:o,gen:i,opts:n}=e;n.$comment&&o.$comment&&w(e),(s=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,p.resolveUrl)(r.opts.uriResolver,r.baseId,s)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let a=i.const("_errs",d.default.errors);b(e,a),i.var(t,(0,c._)`${a} === ${d.default.errors}`)}(e,t);(0,s.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){let{it:r,gen:s}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=f.mergeEvaluated.props(s,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=f.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:s}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return s.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}}function x(e,t,r,s){let o=new T(e,r,t);"code"in r?r.code(o,s):o.$data&&r.validate?(0,l.funcKeywordCode)(o,r):"macro"in r?(0,l.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,l.funcKeywordCode)(o,r)}t.KeywordCxt=T;let P=/^\/(?:[^~]|~0|~1)*$/,O=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function I(e,{dataLevel:t,dataNames:r,dataPathArr:s}){let o,i;if(""===e)return d.default.rootData;if("/"===e[0]){if(!P.test(e))throw Error(`Invalid JSON-pointer: ${e}`);o=e,i=d.default.rootData}else{let n=O.exec(e);if(!n)throw Error(`Invalid JSON-pointer: ${e}`);let l=+n[1];if("#"===(o=n[2])){if(l>=t)throw Error(a("property/index",l));return s[t-l]}if(l>t)throw Error(a("data",l));if(i=r[t-l],!o)return i}let n=i;for(let e of o.split("/"))e&&(i=(0,c._)`${i}${(0,c.getProperty)((0,f.unescapeJsonPointer)(e))}`,n=(0,c._)`${n} && ${i}`);return n;function a(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=I},9820(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let s=r(8994),o=r(6660),i=r(4954),n=r(8425);function a(e){let{gen:t,data:r,it:o}=e;t.if(o.parentData,()=>t.assign(r,(0,s._)`${o.parentData}[${o.parentDataProperty}]`))}function l(e,t,r){if(void 0===r)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,s.stringify)(r)})}t.macroKeywordCode=function(e,t){let{gen:r,keyword:o,schema:i,parentSchema:n,it:a}=e,u=t.macro.call(a.self,i,n,a),c=l(r,o,u);!1!==a.opts.validateSchema&&a.self.validateSchema(u,!0);let d=r.name("valid");e.subschema({schema:u,schemaPath:s.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:c,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;let{gen:u,keyword:c,schema:d,parentSchema:p,$data:f,it:h}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(h,t);let m=l(u,c,!f&&t.compile?t.compile.call(h.self,d,p,h):t.validate),y=u.let("valid");function g(r=t.async?(0,s._)`await `:s.nil){let n=h.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!f||!1===t.schema);u.assign(y,(0,s._)`${r}${(0,i.callValidateCode)(e,m,n,a)}`,t.modifying)}function v(e){var r;u.if((0,s.not)(null!=(r=t.valid)?r:y),e)}e.block$data(y,function(){if(!1===t.errors)g(),t.modifying&&a(e),v(()=>e.error());else{let r,i,l=t.async?(r=u.let("ruleErrs",null),u.try(()=>g((0,s._)`await `),e=>u.assign(y,!1).if((0,s._)`${e} instanceof ${h.ValidationError}`,()=>u.assign(r,(0,s._)`${e}.errors`),()=>u.throw(e))),r):(i=(0,s._)`${m}.errors`,u.assign(i,null),g(s.nil),i);t.modifying&&a(e),v(()=>(function(e,t){let{gen:r}=e;r.if((0,s._)`Array.isArray(${t})`,()=>{r.assign(o.default.vErrors,(0,s._)`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,(0,s._)`${o.default.vErrors}.length`),(0,n.extendErrors)(e)},()=>e.error())})(e,l))}}),e.ok(null!=(r=t.valid)?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:s},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw Error("ajv implementation error");let n=o.dependencies;if(null==n?void 0:n.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${i}: ${n.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let e=`keyword "${i}" value is invalid at path "${s}": `+r.errorsText(o.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}},3826(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let s=r(8994),o=r(7218);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==i)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){let i=e.schema[t];return void 0===r?{schema:i,schemaPath:(0,s._)`${e.schemaPath}${(0,s.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:(0,s._)`${e.schemaPath}${(0,s.getProperty)(t)}${(0,s.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===n||void 0===a||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:l,errSchemaPath:a}}throw Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:a,propertyName:l}){if(void 0!==n&&void 0!==r)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=t;if(void 0!==r){let{errorPath:n,dataPathArr:a,opts:l}=t;c(u.let("data",(0,s._)`${t.data}${(0,s.getProperty)(r)}`,!0)),e.errorPath=(0,s.str)`${n}${(0,o.getErrorPath)(r,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,s._)`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==n&&(c(n instanceof s.Name?n:u.let("data",n,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:s,createErrors:o,allErrors:i}){void 0!==s&&(e.compositeRule=s),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},1967(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var s=r(6023);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return s.KeywordCxt}});var o=r(8994);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});let i=r(4383),n=r(4220),a=r(6247),l=r(1688),u=r(8994),c=r(9008),d=r(6419),p=r(7218),f=r(114),h=r(8951),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";let y=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={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."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};class b{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...function(e){var t,r,s,o,i,n,a,l,u,c,d,p,f,y,g,v,_,b,w,$,E,k,S,T,x;let P=e.strict,O=null==(t=e.code)?void 0:t.optimize,I=!0===O||void 0===O?1:O||0,j=null!=(s=null==(r=e.code)?void 0:r.regExp)?s:m,R=null!=(o=e.uriResolver)?o:h.default;return{strictSchema:null==(n=null!=(i=e.strictSchema)?i:P)||n,strictNumbers:null==(l=null!=(a=e.strictNumbers)?a:P)||l,strictTypes:null!=(c=null!=(u=e.strictTypes)?u:P)?c:"log",strictTuples:null!=(p=null!=(d=e.strictTuples)?d:P)?p:"log",strictRequired:null!=(y=null!=(f=e.strictRequired)?f:P)&&y,code:e.code?{...e.code,optimize:I,regExp:j}:{optimize:I,regExp:j},loopRequired:null!=(g=e.loopRequired)?g:200,loopEnum:null!=(v=e.loopEnum)?v:200,meta:null==(_=e.meta)||_,messages:null==(b=e.messages)||b,inlineRefs:null==(w=e.inlineRefs)||w,schemaId:null!=($=e.schemaId)?$:"$id",addUsedSchema:null==(E=e.addUsedSchema)||E,validateSchema:null==(k=e.validateSchema)||k,validateFormats:null==(S=e.validateFormats)||S,unicodeRegExp:null==(T=e.unicodeRegExp)||T,int32range:null==(x=e.int32range)||x,uriResolver:R}}(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:g,es5:t,lines:r}),this.logger=function(e){if(!1===e)return x;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);const s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),w.call(this,v,e,"NOT SUPPORTED"),w.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=T.call(this),e.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),E.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,s=f;"id"===r&&((s={...f}).id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(e,t){await o.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await s.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof n.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){let r=await u.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,s=this.opts.validateSchema){let o;if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,s);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(o=e[t])&&"string"!=typeof o)throw Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(r,e);if(!s&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return s}getSchema(e){let t;for(;"string"==typeof(t=$.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,s=new l.SchemaEnv({schema:{},schemaId:r});if(!(t=l.resolveSchema.call(this,s,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=$.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,c.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(O.call(this,r,t),!t)return(0,p.eachItem)(r,e=>I.call(this,e)),this;R.call(this,t);let s={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,p.eachItem)(r,0===s.type.length?e=>I.call(this,e,s):e=>s.type.forEach(t=>I.call(this,e,s,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let s of(e=JSON.parse(JSON.stringify(e)),t)){let t=s.split("/").slice(1),o=e;for(let e of t)o=o[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:s}=t.definition,i=o[e];s&&i&&(o[e]=z(i))}}return e}_removeAllSchemas(e,t){for(let r in e){let s=e[r];(!t||t.test(r))&&("string"==typeof s?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,o=this.opts.addUsedSchema){let i,{schemaId:n}=this.opts;if("object"==typeof e)i=e[n];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let a=this._cache.get(e);if(void 0!==a)return a;r=(0,c.normalizeId)(i||r);let u=c.getSchemaRefs.call(this,e,r);return a=new l.SchemaEnv({schema:e,schemaId:n,meta:t,baseId:r,localRefs:u}),this._cache.set(a.schema,a),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),s&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,s="error"){for(let o in e)o in t&&this.logger[s](`${r}: option ${o}. ${e[o]}`)}function $(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function E(){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 k(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function T(){let e={...this.opts};for(let t of y)delete e[t];return e}b.ValidationError=i.default,b.MissingRefError=n.default,t.default=b;let x={log(){},warn(){},error(){}},P=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){let{RULES:r}=this;if((0,p.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!P.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function I(e,t,r){var s;let o=null==t?void 0:t.post;if(r&&o)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,n=o?i.post:i.rules.find(({type:e})=>e===r);if(n||(n={type:r,rules:[]},i.rules.push(n)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?j.call(this,n,a,t.before):n.rules.push(a),i.all[e]=a,null==(s=t.implements)||s.forEach(e=>this.addKeyword(e))}function j(e,t,r){let s=e.rules.findIndex(e=>e.keyword===r);s>=0?e.rules.splice(s,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=z(t)),e.validateSchema=this.compile(t,!0))}let N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function z(e){return{anyOf:[e,N]}}},6013(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(7371);s.code='require("ajv/dist/runtime/equal").default',t.default=s},5532(e,t){"use strict";function r(e){let t,r=e.length,s=0,o=0;for(;o<r;)s++,(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<r&&(64512&(t=e.charCodeAt(o)))==56320&&o++;return s}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},8951(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(7980);s.code='require("ajv/dist/runtime/uri").default',t.default=s},4383(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}},714(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;let s=r(8994),o=r(7218);function i(e,t){let{gen:r,schema:i,data:n,keyword:a,it:l}=e;l.items=!0;let u=r.const("len",(0,s._)`${n}.length`);if(!1===i)e.setParams({len:t.length}),e.pass((0,s._)`${u} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(l,i)){let i=r.var("valid",(0,s._)`${u} <= ${t.length}`);r.if((0,s.not)(i),()=>{var n;return n=i,void r.forRange("i",t.length,u,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},n),l.allErrors||r.if((0,s.not)(n),()=>r.break())})}),e.ok(i)}}t.validateAdditionalItems=i,t.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,s.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,s._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:s}=t;Array.isArray(s)?i(e,s):(0,o.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}}},8401(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(4954),o=r(8994),i=r(6660),n=r(7218);t.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,o._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:t,schema:r,parentSchema:a,data:l,errsCount:u,it:c}=e;if(!u)throw Error("ajv implementation error");let{allErrors:d,opts:p}=c;if(c.props=!0,"all"!==p.removeAdditional&&(0,n.alwaysValidSchema)(c,r))return;let f=(0,s.allSchemaProperties)(a.properties),h=(0,s.allSchemaProperties)(a.patternProperties);function m(e){t.code((0,o._)`delete ${l}[${e}]`)}function y(s){if("all"===p.removeAdditional||p.removeAdditional&&!1===r)return void m(s);if(!1===r){e.setParams({additionalProperty:s}),e.error(),d||t.break();return}if("object"==typeof r&&!(0,n.alwaysValidSchema)(c,r)){let r=t.name("valid");"failing"===p.removeAdditional?(g(s,r,!1),t.if((0,o.not)(r),()=>{e.reset(),m(s)})):(g(s,r),d||t.if((0,o.not)(r),()=>t.break()))}}function g(t,r,s){let o={keyword:"additionalProperties",dataProp:t,dataPropType:n.Type.Str};!1===s&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",l,r=>{f.length||h.length?t.if(function(r){let i;if(f.length>8){let e=(0,n.schemaRefOrVal)(c,a.properties,"properties");i=(0,s.isOwnProperty)(t,e,r)}else i=f.length?(0,o.or)(...f.map(e=>(0,o._)`${r} === ${e}`)):o.nil;return h.length&&(i=(0,o.or)(i,...h.map(t=>(0,o._)`${(0,s.usePattern)(e,t)}.test(${r})`))),(0,o.not)(i)}(r),()=>y(r)):y(r)}),e.ok((0,o._)`${u} === ${i.default.errors}`)}}},2003(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(7218);t.default={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let i=t.name("valid");r.forEach((t,r)=>{if((0,s.alwaysValidSchema)(o,t))return;let n=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(n)})}}},1070(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(4954).validateUnion,error:{message:"must match a schema in anyOf"}}},2692(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(7218);t.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?(0,s.str)`must contain at least ${e} valid item(s)`:(0,s.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?(0,s._)`{minContains: ${e}}`:(0,s._)`{minContains: ${e}, maxContains: ${t}}`},code(e){let t,r,{gen:i,schema:n,parentSchema:a,data:l,it:u}=e,{minContains:c,maxContains:d}=a;u.opts.next?(t=void 0===c?1:c,r=d):t=1;let p=i.const("len",(0,s._)`${l}.length`);if(e.setParams({min:t,max:r}),void 0===r&&0===t)return void(0,o.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==r&&t>r){(0,o.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,o.alwaysValidSchema)(u,n)){let o=(0,s._)`${p} >= ${t}`;void 0!==r&&(o=(0,s._)`${o} && ${p} <= ${r}`),e.pass(o);return}u.items=!0;let f=i.name("valid");function h(){let e=i.name("_valid"),o=i.let("count",0);m(e,()=>i.if(e,()=>{var e;return e=o,void(i.code((0,s._)`${e}++`),void 0===r?i.if((0,s._)`${e} >= ${t}`,()=>i.assign(f,!0).break()):(i.if((0,s._)`${e} > ${r}`,()=>i.assign(f,!1).break()),1===t?i.assign(f,!0):i.if((0,s._)`${e} >= ${t}`,()=>i.assign(f,!0))))}))}function m(t,r){i.forRange("i",0,p,s=>{e.subschema({keyword:"contains",dataProp:s,dataPropType:o.Type.Num,compositeRule:!0},t),r()})}void 0===r&&1===t?m(f,()=>i.if(f,()=>i.break())):0===t?(i.let(f,!0),void 0!==r&&i.if((0,s._)`${l}.length > 0`,h)):(i.let(f,!1),h()),e.result(f,()=>e.reset())}}},5860(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;let s=r(8994),o=r(7218),i=r(4954);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>(0,s.str)`must have ${1===t?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:o}})=>(0,s._)`{property: ${e},
5
- missingProperty: ${o},
6
- depsCount: ${t},
7
- deps: ${r}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let s in e)"__proto__"!==s&&((Array.isArray(e[s])?t:r)[s]=e[s]);return[t,r]}(e);a(e,t),l(e,r)}};function a(e,t=e.schema){let{gen:r,data:o,it:n}=e;if(0===Object.keys(t).length)return;let l=r.let("missing");for(let a in t){let u=t[a];if(0===u.length)continue;let c=(0,i.propertyInData)(r,o,a,n.opts.ownProperties);e.setParams({property:a,depsCount:u.length,deps:u.join(", ")}),n.allErrors?r.if(c,()=>{for(let t of u)(0,i.checkReportMissingProp)(e,t)}):(r.if((0,s._)`${c} && (${(0,i.checkMissingProp)(e,u,l)})`),(0,i.reportMissingProp)(e,l),r.else())}}function l(e,t=e.schema){let{gen:r,data:s,keyword:n,it:a}=e,u=r.name("valid");for(let l in t)(0,o.alwaysValidSchema)(a,t[l])||(r.if((0,i.propertyInData)(r,s,l,a.opts.ownProperties),()=>{let t=e.subschema({keyword:n,schemaProp:l},u);e.mergeValidEvaluated(t,u)},()=>r.var(u,!0)),e.ok(u))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=n},8102(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(7218);function i(e,t){let r=e.schema[t];return void 0!==r&&!(0,o.alwaysValidSchema)(e,r)}t.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,s.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,s._)`{failingKeyword: ${e.ifClause}}`},code(e){let t,{gen:r,parentSchema:n,it:a}=e;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(a,'"if" without "then" and "else" is ignored');let l=i(a,"then"),u=i(a,"else");if(!l&&!u)return;let c=r.let("valid",!0),d=r.name("_valid");if(t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.mergeEvaluated(t),e.reset(),l&&u){let t=r.let("ifClause");e.setParams({ifClause:t}),r.if(d,p("then",t),p("else",t))}else l?r.if(d,p("then")):r.if((0,s.not)(d),p("else"));function p(t,o){return()=>{let i=e.subschema({keyword:t},d);r.assign(c,d),e.mergeValidEvaluated(i,c),o?r.assign(o,(0,s._)`${t}`):e.setParams({ifClause:t})}}e.pass(c,()=>e.error(!0))}}},8313(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(714),o=r(1997),i=r(3665),n=r(5153),a=r(2692),l=r(5860),u=r(374),c=r(8401),d=r(3252),p=r(6398),f=r(4948),h=r(1070),m=r(5368),y=r(2003),g=r(8102),v=r(1871);t.default=function(e=!1){let t=[f.default,h.default,m.default,y.default,g.default,v.default,u.default,c.default,l.default,d.default,p.default];return e?t.push(o.default,n.default):t.push(s.default,i.default),t.push(a.default),t}},3665(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;let s=r(8994),o=r(7218),i=r(4954);function n(e,t,r=e.schema){let{gen:i,parentSchema:a,data:l,keyword:u,it:c}=e;(function(e){let{opts:s,errSchemaPath:i}=c,n=r.length,a=n===e.minItems&&(n===e.maxItems||!1===e[t]);if(s.strictTuples&&!a){let e=`"${u}" is ${n}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(c,e,s.strictTuples)}})(a),c.opts.unevaluated&&r.length&&!0!==c.items&&(c.items=o.mergeEvaluated.items(i,r.length,c.items));let d=i.name("valid"),p=i.const("len",(0,s._)`${l}.length`);r.forEach((t,r)=>{(0,o.alwaysValidSchema)(c,t)||(i.if((0,s._)`${p} > ${r}`,()=>e.subschema({keyword:u,schemaProp:r,dataProp:r},d)),e.ok(d))})}t.validateTuple=n,t.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return n(e,"additionalItems",t);r.items=!0,(0,o.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}}},5153(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(7218),i=r(4954),n=r(714);t.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,s.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,s._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:r,it:s}=e,{prefixItems:a}=r;s.items=!0,(0,o.alwaysValidSchema)(s,t)||(a?(0,n.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}}},4948(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(7218);t.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:o}=e;if((0,s.alwaysValidSchema)(o,r))return void e.fail();let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}},5368(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(7218);t.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,s._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let a=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block(function(){r.forEach((r,i)=>{let c;(0,o.alwaysValidSchema)(n,r)?t.var(u,!0):c=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if((0,s._)`${u} && ${a}`).assign(a,!1).assign(l,(0,s._)`[${l}, ${i}]`).else(),t.if(u,()=>{t.assign(a,!0),t.assign(l,i),c&&e.mergeEvaluated(c,s.Name)})})}),e.result(a,()=>e.reset(),()=>e.error(!0))}}},6398(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(4954),o=r(8994),i=r(7218),n=r(7218);t.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:a,parentSchema:l,it:u}=e,{opts:c}=u,d=(0,s.allSchemaProperties)(r),p=d.filter(e=>(0,i.alwaysValidSchema)(u,r[e]));if(0===d.length||p.length===d.length&&(!u.opts.unevaluated||!0===u.props))return;let f=c.strictSchema&&!c.allowMatchingProperties&&l.properties,h=t.name("valid");!0===u.props||u.props instanceof o.Name||(u.props=(0,n.evaluatedPropsToName)(t,u.props));let{props:m}=u;for(let e of d)f&&function(e){for(let t in f)new RegExp(e).test(t)&&(0,i.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),u.allErrors?y(e):(t.var(h,!0),y(e),t.if(h));function y(r){t.forIn("key",a,i=>{t.if((0,o._)`${(0,s.usePattern)(e,r)}.test(${i})`,()=>{let s=p.includes(r);s||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:n.Type.Str},h),u.opts.unevaluated&&!0!==m?t.assign((0,o._)`${m}[${i}]`,!0):s||u.allErrors||t.if((0,o.not)(h),()=>t.break())})})}}}},1997(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(3665);t.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,s.validateTuple)(e,"items")}},3252(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(6023),o=r(4954),i=r(7218),n=r(8401);t.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:a,data:l,it:u}=e;"all"===u.opts.removeAdditional&&void 0===a.additionalProperties&&n.default.code(new s.KeywordCxt(u,n.default,"additionalProperties"));let c=(0,o.allSchemaProperties)(r);for(let e of c)u.definedProperties.add(e);u.opts.unevaluated&&c.length&&!0!==u.props&&(u.props=i.mergeEvaluated.props(t,(0,i.toHash)(c),u.props));let d=c.filter(e=>!(0,i.alwaysValidSchema)(u,r[e]));if(0===d.length)return;let p=t.name("valid");for(let s of d){var f;(f=s,u.opts.useDefaults&&!u.compositeRule&&void 0!==r[f].default)?h(s):(t.if((0,o.propertyInData)(t,l,s,u.opts.ownProperties)),h(s),u.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(s),e.ok(p)}function h(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}},374(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(7218);t.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,s._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,o.alwaysValidSchema)(n,r))return;let a=t.name("valid");t.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,s.not)(a),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(a)}}},1871(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(7218);t.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,s.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}},4954(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let s=r(8994),o=r(7218),i=r(6660),n=r(7218);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,s._)`Object.prototype.hasOwnProperty`})}function l(e,t,r){return(0,s._)`${a(e)}.call(${t}, ${r})`}function u(e,t,r,o){let i=(0,s._)`${t}${(0,s.getProperty)(r)} === undefined`;return o?(0,s.or)(i,(0,s.not)(l(e,t,r))):i}function c(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){let{gen:r,data:o,it:i}=e;r.if(u(r,o,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,s._)`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},o,i){return(0,s.or)(...o.map(o=>(0,s.and)(u(e,t,o,r.ownProperties),(0,s._)`${i} = ${o}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=l,t.propertyInData=function(e,t,r,o){let i=(0,s._)`${t}${(0,s.getProperty)(r)} !== undefined`;return o?(0,s._)`${i} && ${l(e,t,r)}`:i},t.noPropertyInData=u,t.allSchemaProperties=c,t.schemaProperties=function(e,t){return c(t).filter(r=>!(0,o.alwaysValidSchema)(e,t[r]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:n,errorPath:a},it:l},u,c,d){let p=d?(0,s._)`${e}, ${t}, ${o}${n}`:t,f=[[i.default.instancePath,(0,s.strConcat)(i.default.instancePath,a)],[i.default.parentData,l.parentData],[i.default.parentDataProperty,l.parentDataProperty],[i.default.rootData,i.default.rootData]];l.opts.dynamicRef&&f.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);let h=(0,s._)`${p}, ${r.object(...f)}`;return c!==s.nil?(0,s._)`${u}.call(${c}, ${h})`:(0,s._)`${u}(${h})`};let d=(0,s._)`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){let o=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,s._)`${"new RegExp"===i.code?d:(0,n.useFunc)(e,i)}(${r}, ${o})`})},t.validateArray=function(e){let{gen:t,data:r,keyword:i,it:n}=e,a=t.name("valid");if(n.allErrors){let e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(a,!0),l(()=>t.break()),a;function l(n){let l=t.const("len",(0,s._)`${r}.length`);t.forRange("i",0,l,r=>{e.subschema({keyword:i,dataProp:r,dataPropType:o.Type.Num},a),t.if((0,s.not)(a),n)})}},t.validateUnion=function(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(e=>(0,o.alwaysValidSchema)(n,e))&&!n.opts.unevaluated)return;let a=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((r,o)=>{let n=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},l);t.assign(a,(0,s._)`${a} || ${l}`),e.mergeValidEvaluated(n,l)||t.if((0,s.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}},3330(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},8119(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(3330),o=r(930);t.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",s.default,o.default]},930(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;let s=r(4220),o=r(4954),i=r(8994),n=r(6660),a=r(1688),l=r(7218);function u(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,i._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function c(e,t,r,s){let{gen:a,it:u}=e,{allErrors:c,schemaEnv:d,opts:p}=u,f=p.passContext?n.default.this:i.nil;function h(e){let t=(0,i._)`${e}.errors`;a.assign(n.default.vErrors,(0,i._)`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`),a.assign(n.default.errors,(0,i._)`${n.default.vErrors}.length`)}function m(e){var t;if(!u.opts.unevaluated)return;let s=null==(t=null==r?void 0:r.validate)?void 0:t.evaluated;if(!0!==u.props)if(s&&!s.dynamicProps)void 0!==s.props&&(u.props=l.mergeEvaluated.props(a,s.props,u.props));else{let t=a.var("props",(0,i._)`${e}.evaluated.props`);u.props=l.mergeEvaluated.props(a,t,u.props,i.Name)}if(!0!==u.items)if(s&&!s.dynamicItems)void 0!==s.items&&(u.items=l.mergeEvaluated.items(a,s.items,u.items));else{let t=a.var("items",(0,i._)`${e}.evaluated.items`);u.items=l.mergeEvaluated.items(a,t,u.items,i.Name)}}s?function(){if(!d.$async)throw Error("async schema referenced by sync schema");let r=a.let("valid");a.try(()=>{a.code((0,i._)`await ${(0,o.callValidateCode)(e,t,f)}`),m(t),c||a.assign(r,!0)},e=>{a.if((0,i._)`!(${e} instanceof ${u.ValidationError})`,()=>a.throw(e)),h(e),c||a.assign(r,!1)}),e.ok(r)}():e.result((0,o.callValidateCode)(e,t,f),()=>m(t),()=>h(t))}t.getValidate=u,t.callRef=c,t.default={keyword:"$ref",schemaType:"string",code(e){var t,r;let o,n,l,d,{gen:p,schema:f,it:h}=e,{baseId:m,schemaEnv:y,validateName:g,opts:v,self:_}=h,{root:b}=y;if(("#"===f||"#/"===f)&&m===b.baseId){if(y===b)return c(e,g,y,y.$async);let t=p.scopeValue("root",{ref:b});return c(e,(0,i._)`${t}.validate`,b,b.$async)}let w=a.resolveRef.call(_,b,m,f);if(void 0===w)throw new s.default(h.opts.uriResolver,m,f);return w instanceof a.SchemaEnv?(o=u(e,t=w),void c(e,o,t,t.$async)):(r=w,n=p.scopeValue("schema",!0===v.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),l=p.name("valid"),d=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:n,errSchemaPath:f},l),void(e.mergeEvaluated(d),e.ok(l)))}}},9376(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(5141),i=r(1688),n=r(4220),a=r(7218);t.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,s._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){let{gen:t,data:r,schema:l,parentSchema:u,it:c}=e,{oneOf:d}=u;if(!c.opts.discriminator)throw Error("discriminator: requires discriminator option");let p=l.propertyName;if("string"!=typeof p)throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!d)throw Error("discriminator: requires oneOf keyword");let f=t.let("valid",!1),h=t.const("tag",(0,s._)`${r}${(0,s.getProperty)(p)}`);t.if((0,s._)`typeof ${h} == "string"`,()=>(function(){let r=function(){var e;let t={},r=o(u),s=!0;for(let t=0;t<d.length;t++){let u=d[t];if((null==u?void 0:u.$ref)&&!(0,a.schemaHasRulesButRef)(u,c.self.RULES)){let e=u.$ref;if((u=i.resolveRef.call(c.self,c.schemaEnv.root,c.baseId,e))instanceof i.SchemaEnv&&(u=u.schema),void 0===u)throw new n.default(c.opts.uriResolver,c.baseId,e)}let f=null==(e=null==u?void 0:u.properties)?void 0:e[p];if("object"!=typeof f)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);s=s&&(r||o(u)),function(e,t){if(e.const)l(e.const,t);else if(e.enum)for(let r of e.enum)l(r,t);else throw Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}(f,t)}if(!s)throw Error(`discriminator: "${p}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(p)}function l(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${p}" values must be unique strings`);t[e]=r}}();for(let o in t.if(!1),r)t.elseIf((0,s._)`${h} === ${o}`),t.assign(f,function(r){let o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(i,s.Name),o}(r[o]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:h,tagName:p}),t.endIf()})(),()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:h,tagName:p})),e.ok(f)}}},5141(e,t){"use strict";var r,s;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(s=r||(t.DiscrError=r={})).Tag="tag",s.Mapping="mapping"},3959(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8119),o=r(659),i=r(8313),n=r(8563),a=r(4618);t.default=[s.default,o.default,(0,i.default)(),n.default,a.metadataVocabulary,a.contentVocabulary]},424(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994);t.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,s.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,s._)`{format: ${e}}`},code(e,t){let r,o,i,n,a,l,{gen:u,data:c,$data:d,schema:p,schemaCode:f,it:h}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=h;m.validateFormats&&(d?(r=u.scopeValue("formats",{ref:v.formats,code:m.code.formats}),o=u.const("fDef",(0,s._)`${r}[${f}]`),i=u.let("fType"),n=u.let("format"),u.if((0,s._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>u.assign(i,(0,s._)`${o}.type || "string"`).assign(n,(0,s._)`${o}.validate`),()=>u.assign(i,(0,s._)`"string"`).assign(n,o)),e.fail$data((0,s.or)(!1===m.strictSchema?s.nil:(0,s._)`${f} && !${n}`,(a=g.$async?(0,s._)`(${o}.async ? await ${n}(${c}) : ${n}(${c}))`:(0,s._)`${n}(${c})`,l=(0,s._)`(typeof ${n} == "function" ? ${a} : ${n}.test(${c}))`,(0,s._)`${n} && ${n} !== true && ${i} === ${t} && !${l}`)))):function(){var r;let o,i,n=v.formats[p];if(!n){if(!1===m.strictSchema)return v.logger.warn(a());throw Error(a());function a(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===n)return;let[l,d,f]=(o=(r=n)instanceof RegExp?(0,s.regexpCode)(r):m.code.formats?(0,s._)`${m.code.formats}${(0,s.getProperty)(p)}`:void 0,i=u.scopeValue("formats",{key:p,ref:r,code:o}),"object"!=typeof r||r instanceof RegExp?["string",r,i]:[r.type||"string",r.validate,(0,s._)`${i}.validate`]);l===t&&e.pass(function(){if("object"==typeof n&&!(n instanceof RegExp)&&n.async){if(!g.$async)throw Error("async format in sync schema");return(0,s._)`await ${f}(${c})`}return"function"==typeof d?(0,s._)`${f}(${c})`:(0,s._)`${f}.test(${c})`}())}())}}},8563(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=[r(424).default]},4618(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},7080(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(7218),i=r(6013);t.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,s._)`{allowedValue: ${e}}`},code(e){let{gen:t,data:r,$data:n,schemaCode:a,schema:l}=e;n||l&&"object"==typeof l?e.fail$data((0,s._)`!${(0,o.useFunc)(t,i.default)}(${r}, ${a})`):e.fail((0,s._)`${l} !== ${r}`)}}},5358(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(7218),i=r(6013);t.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,s._)`{allowedValues: ${e}}`},code(e){let t,r,{gen:n,data:a,$data:l,schema:u,schemaCode:c,it:d}=e;if(!l&&0===u.length)throw Error("enum must have non-empty array");let p=u.length>=d.opts.loopEnum,f=()=>null!=t?t:t=(0,o.useFunc)(n,i.default);if(p||l)r=n.let("valid"),e.block$data(r,function(){n.assign(r,!1),n.forOf("v",c,e=>n.if((0,s._)`${f()}(${a}, ${e})`,()=>n.assign(r,!0).break()))});else{if(!Array.isArray(u))throw Error("ajv implementation error");let e=n.const("vSchema",c);r=(0,s.or)(...u.map((t,r)=>{var o,i;let n;return o=e,"object"==typeof(n=u[i=r])&&null!==n?(0,s._)`${f()}(${a}, ${o}[${i}])`:(0,s._)`${a} === ${n}`}))}e.pass(r)}}},659(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8997),o=r(9190),i=r(4280),n=r(8805),a=r(2189),l=r(3138),u=r(8870),c=r(1858),d=r(7080),p=r(5358);t.default=[s.default,o.default,i.default,n.default,a.default,l.default,u.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,p.default]},8870(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994);t.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,s.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>(0,s._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:o}=e,i="maxItems"===t?s.operators.GT:s.operators.LT;e.fail$data((0,s._)`${r}.length ${i} ${o}`)}}},4280(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=r(7218),i=r(5532);t.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,s.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>(0,s._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:n,it:a}=e,l="maxLength"===t?s.operators.GT:s.operators.LT,u=!1===a.opts.unicode?(0,s._)`${r}.length`:(0,s._)`${(0,o.useFunc)(e.gen,i.default)}(${r})`;e.fail$data((0,s._)`${u} ${l} ${n}`)}}},8997(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994),o=s.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}};t.default={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,s.str)`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,s._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{keyword:t,data:r,schemaCode:o}=e;e.fail$data((0,s._)`${r} ${i[t].fail} ${o} || isNaN(${r})`)}}},2189(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994);t.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,s.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>(0,s._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:o}=e,i="maxProperties"===t?s.operators.GT:s.operators.LT;e.fail$data((0,s._)`Object.keys(${r}).length ${i} ${o}`)}}},9190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(8994);t.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,s.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,s._)`{multipleOf: ${e}}`},code(e){let{gen:t,data:r,schemaCode:o,it:i}=e,n=i.opts.multipleOfPrecision,a=t.let("res"),l=n?(0,s._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${n}`:(0,s._)`${a} !== parseInt(${a})`;e.fail$data((0,s._)`(${o} === 0 || (${a} = ${r}/${o}, ${l}))`)}}},8805(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(4954),o=r(7218),i=r(8994);t.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,i.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,i._)`{pattern: ${e}}`},code(e){let{gen:t,data:r,$data:n,schema:a,schemaCode:l,it:u}=e,c=u.opts.unicodeRegExp?"u":"";if(n){let{regExp:s}=u.opts.code,n="new RegExp"===s.code?(0,i._)`new RegExp`:(0,o.useFunc)(t,s),a=t.let("valid");t.try(()=>t.assign(a,(0,i._)`${n}(${l}, ${c}).test(${r})`),()=>t.assign(a,!1)),e.fail$data((0,i._)`!${a}`)}else{let t=(0,s.usePattern)(e,a);e.fail$data((0,i._)`!${t}.test(${r})`)}}}},3138(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(4954),o=r(8994),i=r(7218);t.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,o.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,o._)`{missingProperty: ${e}}`},code(e){let{gen:t,schema:r,schemaCode:n,data:a,$data:l,it:u}=e,{opts:c}=u;if(!l&&0===r.length)return;let d=r.length>=c.loopRequired;if(u.allErrors?function(){if(d||l)e.block$data(o.nil,p);else for(let t of r)(0,s.checkReportMissingProp)(e,t)}():function(){let i=t.let("missing");if(d||l){let r=t.let("valid",!0);e.block$data(r,()=>{var l,u;return l=i,u=r,void(e.setParams({missingProperty:l}),t.forOf(l,n,()=>{t.assign(u,(0,s.propertyInData)(t,a,l,c.ownProperties)),t.if((0,o.not)(u),()=>{e.error(),t.break()})},o.nil))}),e.ok(r)}else t.if((0,s.checkMissingProp)(e,r,i)),(0,s.reportMissingProp)(e,i),t.else()}(),c.strictRequired){let t=e.parentSchema.properties,{definedProperties:s}=e.it;for(let e of r)if((null==t?void 0:t[e])===void 0&&!s.has(e)){let t=u.schemaEnv.baseId+u.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,i.checkStrictMode)(u,r,u.opts.strictRequired)}}function p(){t.forOf("prop",n,r=>{e.setParams({missingProperty:r}),t.if((0,s.noPropertyInData)(t,a,r,c.ownProperties),()=>e.error())})}}}},1858(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=r(6419),o=r(8994),i=r(7218),n=r(6013);t.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,o.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,o._)`{i: ${e}, j: ${t}}`},code(e){let{gen:t,data:r,$data:a,schema:l,parentSchema:u,schemaCode:c,it:d}=e;if(!a&&!l)return;let p=t.let("valid"),f=u.items?(0,s.getSchemaTypes)(u.items):[];e.block$data(p,function(){let a=t.let("i",(0,o._)`${r}.length`),l=t.let("j");e.setParams({i:a,j:l}),t.assign(p,!0),t.if((0,o._)`${a} > 1`,()=>(f.length>0&&!f.some(e=>"object"===e||"array"===e)?function(i,n){let a=t.name("item"),l=(0,s.checkDataTypes)(f,a,d.opts.strictNumbers,s.DataType.Wrong),u=t.const("indices",(0,o._)`{}`);t.for((0,o._)`;${i}--;`,()=>{t.let(a,(0,o._)`${r}[${i}]`),t.if(l,(0,o._)`continue`),f.length>1&&t.if((0,o._)`typeof ${a} == "string"`,(0,o._)`${a} += "_"`),t.if((0,o._)`typeof ${u}[${a}] == "number"`,()=>{t.assign(n,(0,o._)`${u}[${a}]`),e.error(),t.assign(p,!1).break()}).code((0,o._)`${u}[${a}] = ${i}`)})}:function(s,a){let l=(0,i.useFunc)(t,n.default),u=t.name("outer");t.label(u).for((0,o._)`;${s}--;`,()=>t.for((0,o._)`${a} = ${s}; ${a}--;`,()=>t.if((0,o._)`${l}(${r}[${s}], ${r}[${a}])`,()=>{e.error(),t.assign(p,!1).break(u)})))})(a,l))},(0,o._)`${c} === false`),e.ok(p)}}},9454(e,t,r){"use strict";var s=r(181).Buffer,o=r(181).SlowBuffer;function i(e,t){if(!s.isBuffer(e)||!s.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,o=0;o<e.length;o++)r|=e[o]^t[o];return 0===r}e.exports=i,i.install=function(){s.prototype.equal=o.prototype.equal=function(e){return i(this,e)}};var n=s.prototype.equal,a=o.prototype.equal;i.restore=function(){s.prototype.equal=n,o.prototype.equal=a}},6507(e,t,r){"use strict";let s=r(5317),o=r(8388),i=r(442);function n(e,t,r){let n=o(e,t,r),a=s.spawn(n.command,n.args,n.options);return i.hookChildProcess(a,n),a}e.exports=n,e.exports.spawn=n,e.exports.sync=function(e,t,r){let n=o(e,t,r),a=s.spawnSync(n.command,n.args,n.options);return a.error=a.error||i.verifyENOENTSync(a.status,n),a},e.exports._parse=o,e.exports._enoent=i},442(e){"use strict";let t="win32"===process.platform;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function s(e,s){return t&&1===e&&!s.file?r(s.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;let o=e.emit;e.emit=function(t,i){if("exit"===t){let t=s(i,r);if(t)return o.call(e,"error",t)}return o.apply(e,arguments)}},verifyENOENT:s,verifyENOENTSync:function(e,s){return t&&1===e&&!s.file?r(s.original,"spawnSync"):null},notFoundError:r}},8388(e,t,r){"use strict";let s=r(6928),o=r(3803),i=r(2077),n=r(1880),a="win32"===process.platform,l=/\.(?:com|exe)$/i,u=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let c={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?c:function(e){let t;if(!a)return e;let r=(e.file=o(e),(t=e.file&&n(e.file))?(e.args.unshift(e.file),e.command=t,o(e)):e.file),c=!l.test(r);if(e.options.forceShell||c){let t=u.test(r);e.command=s.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,t));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(c)}},2077(e){"use strict";let t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},1880(e,t,r){"use strict";let s=r(9896),o=r(600);e.exports=function(e){let t,r=Buffer.alloc(150);try{t=s.openSync(e,"r"),s.readSync(t,r,0,150,0),s.closeSync(t)}catch(e){}return o(r.toString())}},3803(e,t,r){"use strict";let s=r(6928),o=r(1905),i=r(9695);function n(e,t){let r,n=e.options.env||process.env,a=process.cwd(),l=null!=e.options.cwd,u=l&&void 0!==process.chdir&&!process.chdir.disabled;if(u)try{process.chdir(e.options.cwd)}catch(e){}try{r=o.sync(e.command,{path:n[i({env:n})],pathExt:t?s.delimiter:void 0})}catch(e){}finally{u&&process.chdir(a)}return r&&(r=s.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return n(e)||n(e,!0)}},8583(e,t,r){let s=r(9896),o=r(6928),i=r(857),n=r(6982),a=r(4519).version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function u(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}function c(e){console.log(`[dotenv@${a}] ${e}`)}function d(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function p(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)s.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=o.resolve(process.cwd(),".env.vault");return s.existsSync(t)?t:null}function f(e){return"~"===e[0]?o.join(i.homedir(),e.slice(1)):e}let h={configDotenv:function(e){let t,r=o.resolve(process.cwd(),".env"),i="utf8",n=!!(e&&e.debug),a=!e||!("quiet"in e)||e.quiet;e&&e.encoding?i=e.encoding:n&&u("No encoding is specified. UTF-8 is used by default");let l=[r];if(e&&e.path)if(Array.isArray(e.path))for(let t of(l=[],e.path))l.push(f(t));else l=[f(e.path)];let d={};for(let r of l)try{let t=h.parse(s.readFileSync(r,{encoding:i}));h.populate(d,t,e)}catch(e){n&&u(`Failed to load ${r} ${e.message}`),t=e}let p=process.env;if(e&&null!=e.processEnv&&(p=e.processEnv),h.populate(p,d,e),n||!a){let e=Object.keys(d).length,r=[];for(let e of l)try{let t=o.relative(process.cwd(),e);r.push(t)}catch(r){n&&u(`Failed to load ${e} ${r.message}`),t=r}c(`injecting env (${e}) from ${r.join(",")}`)}return t?{parsed:d,error:t}:{parsed:d}},_configVault:function(e){let t=!!(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;(t||!r)&&c("Loading env from encrypted .env.vault");let s=h._parseVault(e),o=process.env;return e&&null!=e.processEnv&&(o=e.processEnv),h.populate(o,s,e),{parsed:s}},_parseVault:function(e){let t,r=p(e=e||{});e.path=r;let s=h.configDotenv(e);if(!s.parsed){let e=Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw e.code="MISSING_DATA",e}let o=d(e).split(","),i=o.length;for(let e=0;e<i;e++)try{let r=o[e].trim(),i=function(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code){let e=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw e}let s=r.password;if(!s){let e=Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}let o=r.searchParams.get("environment");if(!o){let e=Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}let i=`DOTENV_VAULT_${o.toUpperCase()}`,n=e.parsed[i];if(!n){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:n,key:s}}(s,r);t=h.decrypt(i.ciphertext,i.key);break}catch(t){if(e+1>=i)throw t}return h.parse(t)},config:function(e){if(0===d(e).length)return h.configDotenv(e);let t=p(e);if(!t){var r;return r=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.log(`[dotenv@${a}][WARN] ${r}`),h.configDotenv(e)}return h._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),s=Buffer.from(e,"base64"),o=s.subarray(0,12),i=s.subarray(-16);s=s.subarray(12,-16);try{let e=n.createDecipheriv("aes-256-gcm",r,o);return e.setAuthTag(i),`${e.update(s)}${e.final()}`}catch(s){let e=s instanceof RangeError,t="Invalid key length"===s.message,r="Unsupported state or unable to authenticate data"===s.message;if(e||t){let e=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(r){let e=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw s}},parse:function(e){let t,r={},s=e.toString();for(s=s.replace(/\r\n?/mg,"\n");null!=(t=l.exec(s));){let e=t[1],s=t[2]||"",o=(s=s.trim())[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===o&&(s=(s=s.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=s}return r},populate:function(e,t,r={}){let s=!!(r&&r.debug),o=!!(r&&r.override);if("object"!=typeof t){let e=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===o&&(e[r]=t[r]),s&&(!0===o?u(`"${r}" is already defined and WAS overwritten`):u(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=h.configDotenv,e.exports._configVault=h._configVault,e.exports._parseVault=h._parseVault,e.exports.config=h.config,e.exports.decrypt=h.decrypt,e.exports.parse=h.parse,e.exports.populate=h.populate,e.exports=h},9053(e,t,r){"use strict";var s=r(6608).Buffer,o=r(2188);function i(e){if(s.isBuffer(e))return e;if("string"==typeof e)return s.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function n(e,t,r){for(var s=0;t+s<r&&0===e[t+s];)++s;return e[t+s]>=128&&--s,s}e.exports={derToJose:function(e,t){e=i(e);var r=o(t),n=r+1,a=e.length,l=0;if(48!==e[l++])throw Error('Could not find expected "seq"');var u=e[l++];if(129===u&&(u=e[l++]),a-l<u)throw Error('"seq" specified length of "'+u+'", only "'+(a-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var c=e[l++];if(a-l-2<c)throw Error('"r" specified length of "'+c+'", only "'+(a-l-2)+'" available');if(n<c)throw Error('"r" specified length of "'+c+'", max of "'+n+'" is acceptable');var d=l;if(l+=c,2!==e[l++])throw Error('Could not find expected "int" for "s"');var p=e[l++];if(a-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(a-l)+'"');if(n<p)throw Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=l;if((l+=p)!==a)throw Error('Expected to consume entire buffer, but "'+(a-l)+'" bytes remain');var h=r-c,m=r-p,y=s.allocUnsafe(h+c+m+p);for(l=0;l<h;++l)y[l]=0;e.copy(y,l,d+Math.max(-h,0),d+c),l=r;for(var g=l;l<g+m;++l)y[l]=0;return e.copy(y,l,f+Math.max(-m,0),f+p),y=(y=y.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=i(e);var r=o(t),a=e.length;if(a!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+a+'"');var l=n(e,0,r),u=n(e,r,e.length),c=r-l,d=r-u,p=2+c+1+1+d,f=p<128,h=s.allocUnsafe((f?2:3)+p),m=0;return h[m++]=48,f?h[m++]=p:(h[m++]=129,h[m++]=255&p),h[m++]=2,h[m++]=c,l<0?(h[m++]=0,m+=e.copy(h,m,0,r)):m+=e.copy(h,m,l,r),h[m++]=2,h[m++]=d,u<0?(h[m++]=0,e.copy(h,m,r)):e.copy(h,m,r+u),h}}},2188(e){"use strict";function t(e){return(e/8|0)+ +(e%8!=0)}var r={ES256:t(256),ES384:t(384),ES512:t(521)};e.exports=function(e){var t=r[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}},7371(e){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((s=t.length)!=r.length)return!1;for(o=s;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((s=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=s;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=s;0!=o--;){var s,o,i,n=i[o];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}},9344(e,t,r){var s;function o(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,s){o(e,t||{},function(e,t){e?s(e):r(t)})})}s(e,t||{},function(e,s){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,s=!1),r(e,s)})}r(9896),s="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=o,o.sync=function(e,t){try{return s.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709(e,t,r){e.exports=o,o.sync=function(e,t){return i(s.statSync(e),t)};var s=r(9896);function o(e,t,r){s.stat(e,function(e,s){r(e,!e&&i(s,t))})}function i(e,t){var r,s,o,i,n,a,l,u,c;return e.isFile()&&(r=e,s=t,o=r.mode,i=r.uid,n=r.gid,a=void 0!==s.uid?s.uid:process.getuid&&process.getuid(),l=void 0!==s.gid?s.gid:process.getgid&&process.getgid(),u=parseInt("100",8),c=parseInt("010",8),o&parseInt("001",8)||o&c&&n===l||o&u&&i===a||o&(u|c)&&0===a)}},8541(e,t,r){e.exports=i,i.sync=function(e,t){return o(s.statSync(e),e,t)};var s=r(9896);function o(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var s=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!s||-1!==(s=s.split(";")).indexOf(""))return!0;for(var o=0;o<s.length;o++){var i=s[o].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,r){s.stat(e,function(s,i){r(s,!s&&o(i,e,t))})}},205(e){"use strict";var t=e.exports=function(e,r,s){"function"==typeof r&&(s=r,r={});var o="function"==typeof(s=r.cb||s)?s:s.pre||function(){};!function e(r,s,o,i,n,a,l,u,c,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in s(i,n,a,l,u,c,d),i){var f=i[p];if(Array.isArray(f)){if(p in t.arrayKeywords)for(var h=0;h<f.length;h++)e(r,s,o,f[h],n+"/"+p+"/"+h,a,n,p,i,h)}else if(p in t.propsKeywords){if(f&&"object"==typeof f)for(var m in f)e(r,s,o,f[m],n+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,n,p,i,m)}else(p in t.keywords||r.allKeys&&!(p in t.skipKeywords))&&e(r,s,o,f,n+"/"+p,a,n,p,i)}o(i,n,a,l,u,c,d)}}(r,o,s.post||function(){},e,"",e)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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}},2548(e,t,r){var s=r(3263);e.exports=function(e,t){t=t||{};var r=s.decode(e,t);if(!r)return null;var o=r.payload;if("string"==typeof o)try{var i=JSON.parse(o);null!==i&&"object"==typeof i&&(o=i)}catch(e){}return!0===t.complete?{header:r.header,payload:o,signature:r.signature}:o}},8400(e,t,r){e.exports={decode:r(2548),verify:r(6467),sign:r(9147),JsonWebTokenError:r(1957),NotBeforeError:r(4470),TokenExpiredError:r(7788)}},1957(e){var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},4470(e,t,r){var s=r(1957),o=function(e,t){s.call(this,e),this.name="NotBeforeError",this.date=t};o.prototype=Object.create(s.prototype),o.prototype.constructor=o,e.exports=o},7788(e,t,r){var s=r(1957),o=function(e,t){s.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};o.prototype=Object.create(s.prototype),o.prototype.constructor=o,e.exports=o},5841(e,t,r){e.exports=r(3895).satisfies(process.version,">=15.7.0")},953(e,t,r){e.exports=r(3895).satisfies(process.version,"^6.12.0 || >=8.0.0")},455(e,t,r){e.exports=r(3895).satisfies(process.version,">=16.9.0")},4559(e,t,r){var s=r(3866);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var o=s(e);if(void 0===o)return;return Math.floor(r+o/1e3)}if("number"==typeof e)return r+e}},723(e,t,r){let s=r(5841),o=r(455),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},n={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let a=i[r];if(!a)throw Error(`Unknown key type "${r}".`);if(!a.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${a.join(", ")}.`);if(s)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,u=n[e];if(l!==u)throw Error(`"alg" parameter "${e}" requires curve "${u}".`);break;case"rsa-pss":if(o){let r=parseInt(e.slice(-3),10),{hashAlgorithm:s,mgf1HashAlgorithm:o,saltLength:i}=t.asymmetricKeyDetails;if(s!==`sha${r}`||o!==s)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==i&&i>r>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},9147(e,t,r){let s=r(4559),o=r(953),i=r(723),n=r(3263),a=r(5357),l=r(6782),u=r(5250),c=r(8094),d=r(6052),p=r(1251),f=r(8430),{KeyObject:h,createSecretKey:m,createPrivateKey:y}=r(6982),g=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];o&&g.splice(3,0,"PS256","PS384","PS512");let v={expiresIn:{isValid:function(e){return u(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return u(e)||p(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return p(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:a.bind(null,g),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:p,message:'"encoding" must be a string'},issuer:{isValid:p,message:'"issuer" must be a string'},subject:{isValid:p,message:'"subject" must be a string'},jwtid:{isValid:p,message:'"jwtid" must be a string'},noTimestamp:{isValid:l,message:'"noTimestamp" must be a boolean'},keyid:{isValid:p,message:'"keyid" must be a string'},mutatePayload:{isValid:l,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:l,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:l,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},_={iat:{isValid:c,message:'"iat" should be a number of seconds'},exp:{isValid:c,message:'"exp" should be a number of seconds'},nbf:{isValid:c,message:'"nbf" should be a number of seconds'}};function b(e,t,r,s){if(!d(r))throw Error('Expected "'+s+'" to be a plain object.');Object.keys(r).forEach(function(o){let i=e[o];if(!i){if(!t)throw Error('"'+o+'" is not allowed in "'+s+'"');return}if(!i.isValid(r[o]))throw Error(i.message)})}let w={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},$=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,o){var a,l;"function"==typeof r?(o=r,r={}):r=r||{};let u="object"==typeof e&&!Buffer.isBuffer(e),c=Object.assign({alg:r.algorithm||"HS256",typ:u?"JWT":void 0,kid:r.keyid},r.header);function d(e){if(o)return o(e);throw e}if(!t&&"none"!==r.algorithm)return d(Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof h))try{t=y(t)}catch(e){try{t=m("string"==typeof t?Buffer.from(t):t)}catch(e){return d(Error("secretOrPrivateKey is not valid key material"))}}if(c.alg.startsWith("HS")&&"secret"!==t.type)return d(Error(`secretOrPrivateKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)){if("private"!==t.type)return d(Error(`secretOrPrivateKey must be an asymmetric key when using ${c.alg}`));if(!r.allowInsecureKeySizes&&!c.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return d(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`))}if(void 0===e)return d(Error("payload is required"));if(u){try{a=e,b(_,!0,a,"payload")}catch(e){return d(e)}r.mutatePayload||(e=Object.assign({},e))}else{let t=$.filter(function(e){return void 0!==r[e]});if(t.length>0)return d(Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return d(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return d(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{l=r,b(v,!1,l,"options")}catch(e){return d(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{i(c.alg,t)}catch(e){return d(e)}let p=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:u&&(e.iat=p),void 0!==r.notBefore){try{e.nbf=s(r.notBefore,p)}catch(e){return d(e)}if(void 0===e.nbf)return d(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof e){try{e.exp=s(r.expiresIn,p)}catch(e){return d(e)}if(void 0===e.exp)return d(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(w).forEach(function(t){let s=w[t];if(void 0!==r[t]){if(void 0!==e[s])return d(Error('Bad "options.'+t+'" option. The payload already has an "'+s+'" property.'));e[s]=r[t]}});let g=r.encoding||"utf8";if("function"==typeof o)o=o&&f(o),n.createSign({header:c,privateKey:t,payload:e,encoding:g}).once("error",o).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&e.length<256)return o(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`));o(null,e)});else{let s=n.sign({header:c,payload:e,secret:t,encoding:g});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&s.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`);return s}}},6467(e,t,r){let s=r(1957),o=r(4470),i=r(7788),n=r(2548),a=r(4559),l=r(723),u=r(953),c=r(3263),{KeyObject:d,createSecretKey:p,createPublicKey:f}=r(6982),h=["RS256","RS384","RS512"],m=["ES256","ES384","ES512"],y=["RS256","RS384","RS512"],g=["HS256","HS384","HS512"];u&&(h.splice(h.length,0,"PS256","PS384","PS512"),y.splice(y.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,u){let v,_,b;if("function"!=typeof r||u||(u=r,r={}),r||(r={}),r=Object.assign({},r),v=u||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new s("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new s("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new s("allowInvalidAsymmetricKeyTypes must be a boolean"));let w=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new s("jwt must be provided"));if("string"!=typeof e)return v(new s("jwt must be a string"));let $=e.split(".");if(3!==$.length)return v(new s("jwt malformed"));try{_=n(e,{complete:!0})}catch(e){return v(e)}if(!_)return v(new s("invalid token"));let E=_.header;if("function"==typeof t){if(!u)return v(new s("verify must be called asynchronous if secret or public key is provided as a callback"));b=t}else b=function(e,r){return r(null,t)};return b(E,function(t,n){let u;if(t)return v(new s("error in secret or public key callback: "+t.message));let b=""!==$[2].trim();if(!b&&n)return v(new s("jwt signature is required"));if(b&&!n)return v(new s("secret or public key must be provided"));if(!b&&!r.algorithms)return v(new s('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=n&&!(n instanceof d))try{n=f(n)}catch(e){try{n=p("string"==typeof n?Buffer.from(n):n)}catch(e){return v(new s("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===n.type?r.algorithms=g:["rsa","rsa-pss"].includes(n.asymmetricKeyType)?r.algorithms=y:"ec"===n.asymmetricKeyType?r.algorithms=m:r.algorithms=h),-1===r.algorithms.indexOf(_.header.alg))return v(new s("invalid algorithm"));if(E.alg.startsWith("HS")&&"secret"!==n.type)return v(new s(`secretOrPublicKey must be a symmetric key when using ${E.alg}`));if(/^(?:RS|PS|ES)/.test(E.alg)&&"public"!==n.type)return v(new s(`secretOrPublicKey must be an asymmetric key when using ${E.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(E.alg,n)}catch(e){return v(e)}try{u=c.verify(e,_.header.alg,n)}catch(e){return v(e)}if(!u)return v(new s("invalid signature"));let k=_.payload;if(void 0!==k.nbf&&!r.ignoreNotBefore){if("number"!=typeof k.nbf)return v(new s("invalid nbf value"));if(k.nbf>w+(r.clockTolerance||0))return v(new o("jwt not active",new Date(1e3*k.nbf)))}if(void 0!==k.exp&&!r.ignoreExpiration){if("number"!=typeof k.exp)return v(new s("invalid exp value"));if(w>=k.exp+(r.clockTolerance||0))return v(new i("jwt expired",new Date(1e3*k.exp)))}if(r.audience){let e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(k.aud)?k.aud:[k.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new s("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&k.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(k.iss)))return v(new s("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&k.sub!==r.subject)return v(new s("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&k.jti!==r.jwtid)return v(new s("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&k.nonce!==r.nonce)return v(new s("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof k.iat)return v(new s("iat required when maxAge is specified"));let e=a(r.maxAge,k.iat);if(void 0===e)return v(new s('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(w>=e+(r.clockTolerance||0))return v(new i("maxAge exceeded",new Date(1e3*e)))}return!0===r.complete?v(null,{header:E,payload:k,signature:_.signature}):v(null,k)})}},2357(e,t,r){var s,o=r(6608).Buffer,i=r(6982),n=r(9053),a=r(9023),l="secret must be a string or buffer",u="key must be a string or a buffer",c="function"==typeof i.createPublicKey;function d(e){if(!o.isBuffer(e)&&"string"!=typeof e&&(!c||"object"!=typeof e||"string"!=typeof e.type||"string"!=typeof e.asymmetricKeyType||"function"!=typeof e.export))throw m(u)}function p(e){if(!o.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw m("key must be a string, a buffer or an object")}function f(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function h(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function m(e){var t=[].slice.call(arguments,1);return TypeError(a.format.bind(a,e).apply(null,t))}function y(e){var t;return t=e,o.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function g(e){return function(t,r){!function(e){if(!o.isBuffer(e)){if("string"!=typeof e){if(!c||"object"!=typeof e||"secret"!==e.type||"function"!=typeof e.export)throw m(l)}}}(r),t=y(t);var s=i.createHmac("sha"+e,r);return f((s.update(t),s.digest("base64")))}}c&&(u+=" or a KeyObject",l+="or a KeyObject");var v="timingSafeEqual"in i?function(e,t){return e.byteLength===t.byteLength&&i.timingSafeEqual(e,t)}:function(e,t){return s||(s=r(9454)),s(e,t)};function _(e){return function(t,r,s){var i=g(e)(t,s);return v(o.from(r),o.from(i))}}function b(e){return function(t,r){p(r),t=y(t);var s=i.createSign("RSA-SHA"+e);return f((s.update(t),s.sign(r,"base64")))}}function w(e){return function(t,r,s){d(s),t=y(t),r=h(r);var o=i.createVerify("RSA-SHA"+e);return o.update(t),o.verify(s,r,"base64")}}function $(e){return function(t,r){p(r),t=y(t);var s=i.createSign("RSA-SHA"+e);return f((s.update(t),s.sign({key:r,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function E(e){return function(t,r,s){d(s),t=y(t),r=h(r);var o=i.createVerify("RSA-SHA"+e);return o.update(t),o.verify({key:s,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function k(e){var t=b(e);return function(){var r=t.apply(null,arguments);return n.derToJose(r,"ES"+e)}}function S(e){var t=w(e);return function(r,s,o){return t(r,s=n.joseToDer(s,"ES"+e).toString("base64"),o)}}function T(){return function(){return""}}function x(){return function(e,t){return""===t}}e.exports=function(e){var t=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!t)throw m('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var r=(t[1]||t[3]).toLowerCase(),s=t[2];return{sign:({hs:g,rs:b,ps:$,es:k,none:T})[r](s),verify:({hs:_,rs:w,ps:E,es:S,none:x})[r](s)}}},3263(e,t,r){var s=r(9615),o=r(6747);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=s.sign,t.verify=o.verify,t.decode=o.decode,t.isValid=o.isValid,t.createSign=function(e){return new s(e)},t.createVerify=function(e){return new o(e)}},6360(e,t,r){var s=r(6608).Buffer,o=r(2203);function i(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=s.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=s.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick((function(){this.emit("end",e),this.readable=!1,this.emit("close")}).bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}r(9023).inherits(i,o),i.prototype.write=function(e){this.buffer=s.concat([this.buffer,s.from(e)]),this.emit("data",e)},i.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=i},9615(e,t,r){var s=r(6608).Buffer,o=r(6360),i=r(2357),n=r(2203),a=r(5911),l=r(9023);function u(e,t){return s.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(e){var t,r,s,o=e.header,n=e.payload,c=e.secret||e.privateKey,d=e.encoding,p=i(o.alg),f=(t=(t=d)||"utf8",r=u(a(o),"binary"),s=u(a(n),t),l.format("%s.%s",r,s)),h=p.sign(f,c);return l.format("%s.%s",f,h)}function d(e){var t=e.secret;if(t=null==(t=null==t?e.privateKey:t)?e.key:t,!0===/^hs/i.test(e.header.alg)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new o(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new o(e.payload),this.secret.once("close",(function(){!this.payload.writable&&this.readable&&this.sign()}).bind(this)),this.payload.once("close",(function(){!this.secret.writable&&this.readable&&this.sign()}).bind(this))}l.inherits(d,n),d.prototype.sign=function(){try{var e=c({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},d.sign=c,e.exports=d},5911(e,t,r){var s=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||s.isBuffer(e)?e.toString():JSON.stringify(e)}},6747(e,t,r){var s=r(6608).Buffer,o=r(6360),i=r(2357),n=r(2203),a=r(5911),l=r(9023),u=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function c(e){var t=e.split(".",1)[0],r=s.from(t,"base64").toString("binary");if("[object Object]"===Object.prototype.toString.call(r))return r;try{return JSON.parse(r)}catch(e){return}}function d(e){return e.split(".")[2]}function p(e){return u.test(e)&&!!c(e)}function f(e,t,r){if(!t){var s=Error("Missing algorithm parameter for jws.verify");throw s.code="MISSING_ALGORITHM",s}var o=d(e=a(e)),n=e.split(".",2).join(".");return i(t).verify(n,o,r)}function h(e,t){if(t=t||{},!p(e=a(e)))return null;var r,o,i=c(e);if(!i)return null;var n=(r=r||"utf8",o=e.split(".")[1],s.from(o,"base64").toString(r));return("JWT"===i.typ||t.json)&&(n=JSON.parse(n,t.encoding)),{header:i,payload:n,signature:d(e)}}function m(e){var t=(e=e||{}).secret;if(t=null==(t=null==t?e.publicKey:t)?e.key:t,!0===/^hs/i.test(e.algorithm)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new o(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new o(e.signature),this.secret.once("close",(function(){!this.signature.writable&&this.readable&&this.verify()}).bind(this)),this.signature.once("close",(function(){!this.secret.writable&&this.readable&&this.verify()}).bind(this))}l.inherits(m,n),m.prototype.verify=function(){try{var e=f(this.signature.buffer,this.algorithm,this.key.buffer),t=h(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},m.decode=h,m.isValid=p,m.verify=f,e.exports=m},5357(e){var t,r,s=1/0,o=0/0,i=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=/^(?:0|[1-9]\d*)$/,c=parseInt;function d(e){return e!=e}var p=Object.prototype,f=p.hasOwnProperty,h=p.toString,m=p.propertyIsEnumerable,y=(t=Object.keys,r=Object,function(e){return t(r(e))}),g=Math.max,v=Array.isArray;function _(e){var t,r,s;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(s=b(r=e)?h.call(r):"")&&"[object GeneratorFunction]"!=s}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function w(e){return!!e&&"object"==typeof e}e.exports=function(e,t,r,$){e=_(e)?e:function(e){return e?function(e,t){for(var r=-1,s=e?e.length:0,o=Array(s);++r<s;)o[r]=t(e[r],r,e);return o}(_(e)?function(e,t){var r,s,o,i,n=v(e)||w(s=r=e)&&_(s)&&f.call(r,"callee")&&(!m.call(r,"callee")||"[object Arguments]"==h.call(r))?function(e,t){for(var r=-1,s=Array(e);++r<e;)s[r]=t(r);return s}(e.length,String):[],a=n.length,l=!!a;for(var c in e){f.call(e,c)&&!(l&&("length"==c||(o=c,(i=null==(i=a)?0x1fffffffffffff:i)&&("number"==typeof o||u.test(o))&&o>-1&&o%1==0&&o<i)))&&n.push(c)}return n}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return y(e);var t,r,s=[];for(var o in Object(e))f.call(e,o)&&"constructor"!=o&&s.push(o);return s}(e),function(t){return e[t]}):[]}(e),r=r&&!$?(S=(k=(E=r)?(E=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||w(t)&&"[object Symbol]"==h.call(t))return o;if(b(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=b(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var s=a.test(e);return s||l.test(e)?c(e.slice(2),s?2:8):n.test(e)?o:+e}(E))===s||E===-s?(E<0?-1:1)*17976931348623157e292:E==E?E:0:0===E?E:0)%1,k==k?S?k-S:k:0):0;var E,k,S,T,x=e.length;return r<0&&(r=g(x+r,0)),"string"==typeof(T=e)||!v(T)&&w(T)&&"[object String]"==h.call(T)?r<=x&&e.indexOf(t,r)>-1:!!x&&function(e,t,r){if(t!=t){for(var s=e.length,o=r+-1;++o<s;)if(d(e[o],o,e))return o;return -1}for(var i=r-1,n=e.length;++i<n;)if(e[i]===t)return i;return -1}(e,t,r)>-1}},6782(e){var t=Object.prototype.toString;e.exports=function(e){var r;return!0===e||!1===e||!!(r=e)&&"object"==typeof r&&"[object Boolean]"==t.call(e)}},5250(e){var t=1/0,r=0/0,s=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,a=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var c,d,p;return"number"==typeof e&&e==(p=(d=(c=e)?(c=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(u(e)){var t,c="function"==typeof e.valueOf?e.valueOf():e;e=u(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var d=i.test(e);return d||n.test(e)?a(e.slice(2),d?2:8):o.test(e)?r:+e}(c))===t||c===-t?(c<0?-1:1)*17976931348623157e292:c==c?c:0:0===c?c:0)%1,d==d?p?d-p:d:0)}},8094(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},6052(e){var t,r,s=Object.prototype,o=Function.prototype.toString,i=s.hasOwnProperty,n=o.call(Object),a=s.toString,l=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!(e&&"object"==typeof e)||"[object Object]"!=a.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=l(e);if(null===t)return!0;var r=i.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&o.call(r)==n}},1251(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var s;return"string"==typeof e||!r(e)&&!!(s=e)&&"object"==typeof s&&"[object String]"==t.call(e)}},8430(e){var t=1/0,r=0/0,s=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,n=/^0o[0-7]+$/i,a=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var c,d,p,f,h=2,m=e;if("function"!=typeof m)throw TypeError("Expected a function");return p=(d=(c=h)?(c=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(u(e)){var t,c="function"==typeof e.valueOf?e.valueOf():e;e=u(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var d=i.test(e);return d||n.test(e)?a(e.slice(2),d?2:8):o.test(e)?r:+e}(c))===t||c===-t?(c<0?-1:1)*17976931348623157e292:c==c?c:0:0===c?c:0)%1,h=d==d?p?d-p:d:0,function(){return--h>0&&(f=m.apply(this,arguments)),h<=1&&(m=void 0),f}}},3866(e){function t(e,t,r,s){return Math.round(e/r)+" "+s+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var s,o,i,n,a=typeof e;if("string"===a&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(u){var c=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:break}}}return}if("number"===a&&isFinite(e)){return r.long?(o=Math.abs(s=e))>=864e5?t(s,o,864e5,"day"):o>=36e5?t(s,o,36e5,"hour"):o>=6e4?t(s,o,6e4,"minute"):o>=1e3?t(s,o,1e3,"second"):s+" ms":(n=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":n>=36e5?Math.round(i/36e5)+"h":n>=6e4?Math.round(i/6e4)+"m":n>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9695(e){"use strict";let t=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};e.exports=t,e.exports.default=t},6608(e,t,r){var s=r(181),o=s.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function n(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=s:(i(s,t),t.Buffer=n),n.prototype=Object.create(o.prototype),i(o,n),n.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return o(e,t,r)},n.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var s=o(e);return void 0!==t?"string"==typeof r?s.fill(t,r):s.fill(t):s.fill(0),s},n.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o(e)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return s.SlowBuffer(e)}},8610(e,t,r){"use strict";let s=Symbol("SemVer ANY");class o{static get ANY(){return s}constructor(e,t){if(t=i(t),e instanceof o)if(!!t.loose===e.loose)return e;else e=e.value;u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===s?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?n[a.COMPARATORLOOSE]:n[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=s}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===s||e===s)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof o))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=o;let i=r(4621),{safeRe:n,t:a}=r(152),l=r(5461),u=r(674),c=r(2398),d=r(2069)},2069(e,t,r){"use strict";let s=/\s+/g;class o{constructor(e,t){if(t=n(t),e instanceof o)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new o(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(s," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=i.get(t);if(r)return r;let s=this.options.loose,o=s?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];l("hyphen replace",e=e.replace(o,I(this.options.includePrerelease))),l("comparator trim",e=e.replace(c[d.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(c[d.TILDETRIM],f)),l("caret trim",e=e.replace(c[d.CARETTRIM],h));let n=e.split(" ").map(e=>b(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options));s&&(n=n.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE])))),l("range list",n);let u=new Map;for(let e of n.map(e=>new a(e,this.options))){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let v=[...u.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof o))throw TypeError("a Range is required");return this.set.some(r=>_(r,t)&&e.set.some(e=>_(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}}e.exports=o;let i=new(r(2044)),n=r(4621),a=r(8610),l=r(674),u=r(2398),{safeRe:c,t:d,comparatorTrimReplace:p,tildeTrimReplace:f,caretTrimReplace:h}=r(152),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(5076),g=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,_=(e,t)=>{let r=!0,s=e.slice(),o=s.pop();for(;r&&s.length;)r=s.every(e=>o.intersects(e,t)),o=s.pop();return r},b=(e,t)=>(l("comp",e=e.replace(c[d.BUILD],""),t),l("caret",e=k(e,t)),l("tildes",e=$(e,t)),l("xrange",e=T(e,t)),l("stars",e=P(e,t)),e),w=e=>!e||"x"===e.toLowerCase()||"*"===e,$=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{let r=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(r,(t,r,s,o,i)=>{let n;return l("tilde",e,t,r,s,o,i),w(r)?n="":w(s)?n=`>=${r}.0.0 <${+r+1}.0.0-0`:w(o)?n=`>=${r}.${s}.0 <${r}.${+s+1}.0-0`:i?(l("replaceTilde pr",i),n=`>=${r}.${s}.${o}-${i} <${r}.${+s+1}.0-0`):n=`>=${r}.${s}.${o} <${r}.${+s+1}.0-0`,l("tilde return",n),n})},k=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(" "),S=(e,t)=>{l("caret",e,t);let r=t.loose?c[d.CARETLOOSE]:c[d.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(t,r,o,i,n)=>{let a;return l("caret",e,t,r,o,i,n),w(r)?a="":w(o)?a=`>=${r}.0.0${s} <${+r+1}.0.0-0`:w(i)?a="0"===r?`>=${r}.${o}.0${s} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${s} <${+r+1}.0.0-0`:n?(l("replaceCaret pr",n),a="0"===r?"0"===o?`>=${r}.${o}.${i}-${n} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}-${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i}-${n} <${+r+1}.0.0-0`):(l("no pr"),a="0"===r?"0"===o?`>=${r}.${o}.${i}${s} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}${s} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i} <${+r+1}.0.0-0`),l("caret return",a),a})},T=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>x(e,t)).join(" ")),x=(e,t)=>{e=e.trim();let r=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(r,(r,s,o,i,n,a)=>{l("xRange",e,r,s,o,i,n,a);let u=w(o),c=u||w(i),d=c||w(n);return"="===s&&d&&(s=""),a=t.includePrerelease?"-0":"",u?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&d?(c&&(i=0),n=0,">"===s?(s=">=",c?(o=+o+1,i=0):i=+i+1,n=0):"<="===s&&(s="<",c?o=+o+1:i=+i+1),"<"===s&&(a="-0"),r=`${s+o}.${i}.${n}${a}`):c?r=`>=${o}.0.0${a} <${+o+1}.0.0-0`:d&&(r=`>=${o}.${i}.0${a} <${o}.${+i+1}.0-0`),l("xRange return",r),r})},P=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),O=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),I=e=>(t,r,s,o,i,n,a,l,u,c,d,p)=>(r=w(s)?"":w(o)?`>=${s}.0.0${e?"-0":""}`:w(i)?`>=${s}.${o}.0${e?"-0":""}`:n?`>=${r}`:`>=${r}${e?"-0":""}`,l=w(u)?"":w(c)?`<${+u+1}.0.0-0`:w(d)?`<${u}.${+c+1}.0-0`:p?`<=${u}.${c}.${d}-${p}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),j=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(l(e[r].semver),e[r].semver!==a.ANY&&e[r].semver.prerelease.length>0){let s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}},2398(e,t,r){"use strict";let s=r(674),{MAX_LENGTH:o,MAX_SAFE_INTEGER:i}=r(5076),{safeRe:n,t:a}=r(152),l=r(4621),{compareIdentifiers:u}=r(9101);class c{constructor(e,t){if(t=l(t),e instanceof c)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>o)throw TypeError(`version is longer than ${o} characters`);s("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?n[a.LOOSE]:n[a.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(s("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof c||(e=new c(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],o=e.prerelease[t];if(s("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return -1;else if(r===o)continue;else return u(r,o)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{let r=this.build[t],o=e.build[t];if(s("build compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return -1;else if(r===o)continue;else return u(r,o)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?n[a.PRERELEASELOOSE]:n[a.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(r);if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},5608(e,t,r){"use strict";let s=r(6802);e.exports=(e,t)=>{let r=s(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5461(e,t,r){"use strict";let s=r(8271),o=r(733),i=r(1686),n=r(6479),a=r(7257),l=r(5850);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return s(e,r,u);case"!=":return o(e,r,u);case">":return i(e,r,u);case">=":return n(e,r,u);case"<":return a(e,r,u);case"<=":return l(e,r,u);default:throw TypeError(`Invalid operator: ${t}`)}}},7771(e,t,r){"use strict";let s=r(2398),o=r(6802),{safeRe:i,t:n}=r(152);e.exports=(e,t)=>{if(e instanceof s)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let s,o=t.includePrerelease?i[n.COERCERTLFULL]:i[n.COERCERTL];for(;(s=o.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&s.index+s[0].length===r.index+r[0].length||(r=s),o.lastIndex=s.index+s[1].length+s[2].length;o.lastIndex=-1}else r=e.match(t.includePrerelease?i[n.COERCEFULL]:i[n.COERCE]);if(null===r)return null;let a=r[2],l=r[3]||"0",u=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return o(`${a}.${l}.${u}${c}${d}`,t)}},8767(e,t,r){"use strict";let s=r(2398);e.exports=(e,t,r)=>{let o=new s(e,r),i=new s(t,r);return o.compare(i)||o.compareBuild(i)}},6293(e,t,r){"use strict";let s=r(6958);e.exports=(e,t)=>s(e,t,!0)},6958(e,t,r){"use strict";let s=r(2398);e.exports=(e,t,r)=>new s(e,r).compare(new s(t,r))},3086(e,t,r){"use strict";let s=r(6802);e.exports=(e,t)=>{let r=s(e,null,!0),o=s(t,null,!0),i=r.compare(o);if(0===i)return null;let n=i>0,a=n?r:o,l=n?o:r,u=!!a.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(a))return l.minor&&!l.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==o.major?c+"major":r.minor!==o.minor?c+"minor":r.patch!==o.patch?c+"patch":"prerelease"}},8271(e,t,r){"use strict";let s=r(6958);e.exports=(e,t,r)=>0===s(e,t,r)},1686(e,t,r){"use strict";let s=r(6958);e.exports=(e,t,r)=>s(e,t,r)>0},6479(e,t,r){"use strict";let s=r(6958);e.exports=(e,t,r)=>s(e,t,r)>=0},3625(e,t,r){"use strict";let s=r(2398);e.exports=(e,t,r,o,i)=>{"string"==typeof r&&(i=o,o=r,r=void 0);try{return new s(e instanceof s?e.version:e,r).inc(t,o,i).version}catch(e){return null}}},7257(e,t,r){"use strict";let s=r(6958);e.exports=(e,t,r)=>0>s(e,t,r)},5850(e,t,r){"use strict";let s=r(6958);e.exports=(e,t,r)=>0>=s(e,t,r)},7744(e,t,r){"use strict";let s=r(2398);e.exports=(e,t)=>new s(e,t).major},4812(e,t,r){"use strict";let s=r(2398);e.exports=(e,t)=>new s(e,t).minor},733(e,t,r){"use strict";let s=r(6958);e.exports=(e,t,r)=>0!==s(e,t,r)},6802(e,t,r){"use strict";let s=r(2398);e.exports=(e,t,r=!1)=>{if(e instanceof s)return e;try{return new s(e,t)}catch(e){if(!r)return null;throw e}}},8643(e,t,r){"use strict";let s=r(2398);e.exports=(e,t)=>new s(e,t).patch},9283(e,t,r){"use strict";let s=r(6802);e.exports=(e,t)=>{let r=s(e,t);return r&&r.prerelease.length?r.prerelease:null}},7032(e,t,r){"use strict";let s=r(6958);e.exports=(e,t,r)=>s(t,e,r)},9839(e,t,r){"use strict";let s=r(8767);e.exports=(e,t)=>e.sort((e,r)=>s(r,e,t))},4056(e,t,r){"use strict";let s=r(2069);e.exports=(e,t,r)=>{try{t=new s(t,r)}catch(e){return!1}return t.test(e)}},7697(e,t,r){"use strict";let s=r(8767);e.exports=(e,t)=>e.sort((e,r)=>s(e,r,t))},6807(e,t,r){"use strict";let s=r(6802);e.exports=(e,t)=>{let r=s(e,t);return r?r.version:null}},3895(e,t,r){"use strict";let s=r(152),o=r(5076),i=r(2398),n=r(9101),a=r(6802),l=r(6807),u=r(5608),c=r(3625),d=r(3086),p=r(7744),f=r(4812),h=r(8643),m=r(9283),y=r(6958),g=r(7032),v=r(6293),_=r(8767),b=r(7697),w=r(9839),$=r(1686),E=r(7257),k=r(8271),S=r(733),T=r(6479),x=r(5850),P=r(5461),O=r(7771),I=r(8610),j=r(2069),R=r(4056),N=r(6613),z=r(7114),C=r(1008),A=r(203),M=r(5372),D=r(4713),L=r(4497),q=r(9272),U=r(3490);e.exports={parse:a,valid:l,clean:u,inc:c,diff:d,major:p,minor:f,patch:h,prerelease:m,compare:y,rcompare:g,compareLoose:v,compareBuild:_,sort:b,rsort:w,gt:$,lt:E,eq:k,neq:S,gte:T,lte:x,cmp:P,coerce:O,Comparator:I,Range:j,satisfies:R,toComparators:N,maxSatisfying:z,minSatisfying:C,minVersion:A,validRange:M,outside:D,gtr:L,ltr:q,intersects:U,simplifyRange:r(4039),subset:r(22),SemVer:i,re:s.re,src:s.src,tokens:s.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}},5076(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},674(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},9101(e){"use strict";let t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;let s=t.test(e),o=t.test(r);return s&&o&&(e*=1,r*=1),e===r?0:s&&!o?-1:o&&!s?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},2044(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},4621(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},152(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=r(5076),n=r(674),a=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={},p=0,f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,o]],m=(e,t,r)=>{let s=(e=>{for(let[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),o=p++;n(e,o,t),d[e]=o,u[o]=t,c[o]=s,a[o]=new RegExp(t,r?"g":void 0),l[o]=new RegExp(s,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),m("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${f}+`),m("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),m("FULL",`^${u[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),m("LOOSE",`^${u[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),m("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),m("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",u[d.COERCE],!0),m("COERCERTLFULL",u[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4497(e,t,r){"use strict";let s=r(4713);e.exports=(e,t,r)=>s(e,t,">",r)},3490(e,t,r){"use strict";let s=r(2069);e.exports=(e,t,r)=>(e=new s(e,r),t=new s(t,r),e.intersects(t,r))},9272(e,t,r){"use strict";let s=r(4713);e.exports=(e,t,r)=>s(e,t,"<",r)},7114(e,t,r){"use strict";let s=r(2398),o=r(2069);e.exports=(e,t,r)=>{let i=null,n=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!i||-1===n.compare(e))&&(n=new s(i=e,r))}),i}},1008(e,t,r){"use strict";let s=r(2398),o=r(2069);e.exports=(e,t,r)=>{let i=null,n=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!i||1===n.compare(e))&&(n=new s(i=e,r))}),i}},203(e,t,r){"use strict";let s=r(2398),o=r(2069),i=r(1686);e.exports=(e,t)=>{e=new o(e,t);let r=new s("0.0.0");if(e.test(r)||(r=new s("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let o=e.set[t],n=null;o.forEach(e=>{let t=new s(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!n||i(t,n))&&(n=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),n&&(!r||i(r,n))&&(r=n)}return r&&e.test(r)?r:null}},4713(e,t,r){"use strict";let s=r(2398),o=r(8610),{ANY:i}=o,n=r(2069),a=r(4056),l=r(1686),u=r(7257),c=r(5850),d=r(6479);e.exports=(e,t,r,p)=>{let f,h,m,y,g;switch(e=new s(e,p),t=new n(t,p),r){case">":f=l,h=c,m=u,y=">",g=">=";break;case"<":f=u,h=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let s=t.set[r],n=null,a=null;if(s.forEach(e=>{e.semver===i&&(e=new o(">=0.0.0")),n=n||e,a=a||e,f(e.semver,n.semver,p)?n=e:m(e.semver,a.semver,p)&&(a=e)}),n.operator===y||n.operator===g||(!a.operator||a.operator===y)&&h(e,a.semver)||a.operator===g&&m(e,a.semver))return!1}return!0}},4039(e,t,r){"use strict";let s=r(4056),o=r(6958);e.exports=(e,t,r)=>{let i=[],n=null,a=null,l=e.sort((e,t)=>o(e,t,r));for(let e of l)s(e,t,r)?(a=e,n||(n=e)):(a&&i.push([n,a]),a=null,n=null);n&&i.push([n,null]);let u=[];for(let[e,t]of i)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");let c=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return c.length<d.length?c:t}},22(e,t,r){"use strict";let s=r(2069),o=r(8610),{ANY:i}=o,n=r(4056),a=r(6958),l=[new o(">=0.0.0-0")],u=[new o(">=0.0.0")],c=(e,t,r)=>{let s,o,c,f,h,m,y;if(e===t)return!0;if(1===e.length&&e[0].semver===i)if(1===t.length&&t[0].semver===i)return!0;else e=r.includePrerelease?l:u;if(1===t.length&&t[0].semver===i)if(r.includePrerelease)return!0;else t=u;let g=new Set;for(let t of e)">"===t.operator||">="===t.operator?s=d(s,t,r):"<"===t.operator||"<="===t.operator?o=p(o,t,r):g.add(t.semver);if(g.size>1)return null;if(s&&o&&((c=a(s.semver,o.semver,r))>0||0===c&&(">="!==s.operator||"<="!==o.operator)))return null;for(let e of g){if(s&&!n(e,String(s),r)||o&&!n(e,String(o),r))return null;for(let s of t)if(!n(e,String(s),r))return!1;return!0}let v=!!o&&!r.includePrerelease&&!!o.semver.prerelease.length&&o.semver,_=!!s&&!r.includePrerelease&&!!s.semver.prerelease.length&&s.semver;for(let e of(v&&1===v.prerelease.length&&"<"===o.operator&&0===v.prerelease[0]&&(v=!1),t)){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,s){if(_&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===_.major&&e.semver.minor===_.minor&&e.semver.patch===_.patch&&(_=!1),">"===e.operator||">="===e.operator){if((f=d(s,e,r))===e&&f!==s)return!1}else if(">="===s.operator&&!n(s.semver,String(e),r))return!1}if(o){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if((h=p(o,e,r))===e&&h!==o)return!1}else if("<="===o.operator&&!n(o.semver,String(e),r))return!1}if(!e.operator&&(o||s)&&0!==c)return!1}return(!s||!m||!!o||0===c)&&(!o||!y||!!s||0===c)&&!_&&!v&&!0},d=(e,t,r)=>{if(!e)return t;let s=a(e.semver,t.semver,r);return s>0?e:s<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let s=a(e.semver,t.semver,r);return s<0?e:s>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new s(e,r),t=new s(t,r);let o=!1;e:for(let s of e.set){for(let e of t.set){let t=c(s,e,r);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},6613(e,t,r){"use strict";let s=r(2069);e.exports=(e,t)=>new s(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},5372(e,t,r){"use strict";let s=r(2069);e.exports=(e,t)=>{try{return new s(e,t).range||"*"}catch(e){return null}}},600(e,t,r){"use strict";let s=r(9638);e.exports=(e="")=>{let t=e.match(s);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?o:o?`${i} ${o}`:i}},9638(e){"use strict";e.exports=/^#!(.*)/},1905(e,t,r){let s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,o=r(6928),i=s?";":":",n=r(9344),a=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||i,o=e.match(/\//)||s&&e.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=s?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?n.split(r):[""];return s&&-1!==e.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:o,pathExt:a,pathExtExe:n}},u=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:s,pathExt:i,pathExtExe:u}=l(e,t),c=[],d=r=>new Promise((i,n)=>{if(r===s.length)return t.all&&c.length?i(c):n(a(e));let l=s[r],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=o.join(u,e);i(p(!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),p=(e,r,s)=>new Promise((o,a)=>{if(s===i.length)return o(d(r+1));let l=i[s];n(e+l,{pathExt:u},(i,n)=>{if(!i&&n)if(!t.all)return o(e+l);else c.push(e+l);return o(p(e,r,s+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};e.exports=u,u.sync=(e,t)=>{let{pathEnv:r,pathExt:s,pathExtExe:i}=l(e,t=t||{}),u=[];for(let a=0;a<r.length;a++){let l=r[a],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=o.join(c,e),p=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<s.length;e++){let r=p+s[e];try{if(n.sync(r,{pathExt:i}))if(!t.all)return r;else u.push(r)}catch(e){}}}if(t.all&&u.length)return u;if(t.nothrow)return null;throw a(e)}},181(e){"use strict";e.exports=require("buffer")},5317(e){"use strict";e.exports=require("child_process")},6982(e){"use strict";e.exports=require("crypto")},9896(e){"use strict";e.exports=require("fs")},7598(e){"use strict";e.exports=require("node:crypto")},857(e){"use strict";e.exports=require("os")},6928(e){"use strict";e.exports=require("path")},2203(e){"use strict";e.exports=require("stream")},9023(e){"use strict";e.exports=require("util")},4953(t){"use strict";t.exports=e},7980(e,t,r){"use strict";let{normalizeIPv6:s,removeDotSegments:o,recomposeAuthority:i,normalizePercentEncoding:n,normalizePathEncoding:a,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:c,nonSimpleDomain:d}=r(609),{SCHEMES:p,getSchemeHandler:f}=r(4848);function h(e,t,r,s){let i={};return s||(e=b(m(e,r),r),t=b(m(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=o(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function m(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},s=Object.assign({},t),a=[],u=f(s.scheme||r.scheme);u&&u.serialize&&u.serialize(r,s),void 0!==r.path&&(s.skipEscape?r.path=n(r.path):(r.path=l(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==s.reference&&r.scheme&&a.push(r.scheme,":");let c=i(r);if(void 0!==c&&("suffix"!==s.reference&&a.push("//"),a.push(c),r.path&&"/"!==r.path[0]&&a.push("/")),void 0!==r.path){let e=r.path;s.absolutePath||u&&u.absolutePath||(e=o(e)),void 0===c&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),a.push(e)}return void 0!==r.query&&a.push("?",r.query),void 0!==r.fragment&&a.push("#",r.fragment),a.join("")}let y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,g=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,v=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function _(e,t){let r=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,n=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);let l=e.match(g);null!==l&&-1!==l[1].indexOf("\\")&&(o.error="URI authority must not contain a literal backslash.",i=!0);let p=e.match(v);if(null!==p){let e=p[1],t=e.replace(/[\t\n\r]/g,"");t.length>=2&&("//"!==t.slice(0,2)?(o.error=o.error||"URI authority must not contain a literal backslash.",i=!0):e.length!==t.length&&(o.error=o.error||"URI authority introducer must not contain whitespace.",i=!0))}let h=e.match(y);if(h){o.scheme=h[1],o.userinfo=h[3],o.host=h[4],o.port=parseInt(h[5],10),o.path=h[6]||"",o.query=h[7],o.fragment=h[8],isNaN(o.port)&&(o.port=h[5]);let t=void 0!==h[2]&&o.path&&"/"!==o.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof o.port&&(o.port<0||o.port>65535)?"URI port is malformed.":void 0;if(void 0!==t&&(o.error=o.error||t,i=!0),o.host)if(!1===c(o.host)){let e=s(o.host);o.host=e.host.toLowerCase(),n=e.isIPV6}else n=!0;void 0!==o.scheme||void 0!==o.userinfo||void 0!==o.host||void 0!==o.port||void 0!==o.query||o.path?void 0===o.scheme?o.reference="relative":void 0===o.fragment?o.reference="absolute":o.reference="uri":o.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");let l=f(r.scheme||o.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&o.host&&(r.domainHost||l&&l.domainHost)&&!1===n&&d(o.host))try{o.host=new URL("http://"+o.host).hostname}catch(e){o.error=o.error||"Host's domain name can not be converted to ASCII: "+e}if((!l||l&&!l.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==o.scheme&&(o.scheme=unescape(o.scheme)),void 0!==o.host&&(o.host=u(unescape(o.host),n))),o.path&&(o.path=a(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}l&&l.parse&&l.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:i}}function b(e,t){return _(e,t).parsed}function w(e,t){let{parsed:r,malformedAuthorityOrPort:s}=_(e,t);return{normalized:s?e:m(r,t),malformedAuthorityOrPort:s}}function $(e,t){if("string"==typeof e){let{normalized:r,malformedAuthorityOrPort:s}=w(e,t);return s?void 0:r}if("object"==typeof e)return m(e,t)}let E={SCHEMES:p,normalize:function(e,t){return"string"==typeof e?e=w(e,t).normalized:"object"==typeof e&&(e=b(m(e,t),t)),e},resolve:function(e,t,r){let s=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:i}=_(e,s),{parsed:n,malformedAuthorityOrPort:a}=_(t,s);if(i||a)throw Error(o.error||n.error||"URI is malformed.");let l=h(o,n,s,!0);return s.skipEscape=!0,m(l,s)},resolveComponent:h,equal:function(e,t,r){let s=$(e,r),o=$(t,r);return void 0!==s&&void 0!==o&&s.toLowerCase()===o.toLowerCase()},serialize:m,parse:b};e.exports=E,e.exports.default=E,e.exports.fastUri=E},4848(e,t,r){"use strict";let{isUUID:s}=r(609),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function n(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function a(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function l(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let u={scheme:"http",domainHost:!0,parse:a,serialize:l},c={scheme:"https",domainHost:u.domainHost,parse:a,serialize:l},d={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=n(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if((e.port===(n(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},p={scheme:"wss",domainHost:d.domainHost,parse:d.parse,serialize:d.serialize},f={http:u,https:c,ws:d,wss:p,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(o);if(r){let s=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=h(`${s}:${t.nid||e.nid}`);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",s=e.nid.toLowerCase(),o=h(`${r}:${t.nid||s}`);o&&(e=o.serialize(e,t));let i=e,n=e.nss;return i.path=`${s||t.nid}:${n}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&s(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function h(e){return e&&(f[e]||f[e.toLowerCase()])||void 0}Object.setPrototypeOf(f,null),e.exports={wsIsSecure:n,SCHEMES:f,isValidSchemeName:function(e){return -1!==i.indexOf(e)},getSchemeHandler:h}},609(e){"use strict";let t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=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),s=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),i=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function n(e){let t="",r=0,s=0;for(s=0;s<e.length;s++)if(48!==(r=e[s].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[s];break}for(s+=1;s<e.length;s++){if(!((r=e[s].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[s]}return t}let a=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,r){if(e.length){let s=n(e);if(""===s)return r.error=!0,!1;t.push(s),e.length=0}return!0}function c(e){if(2>function(e,t){let r=0;for(let t=0;t<e.length;t++)":"===e[t]&&r++;return r}(e,":"))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},s=[],o=[],i=!1,a=!1,c=u;for(let n=0;n<e.length;n++){let u=e[n];if("["!==u&&"]"!==u)if(":"===u){if(!0===i&&(a=!0),!c(o,s,r))break;if(++t>7){r.error=!0;break}n>0&&":"===e[n-1]&&(i=!0),s.push(":");continue}else if("%"===u){if(!c(o,s,r))break;c=l}else{o.push(u);continue}}return o.length&&(c===l?r.zone=o.join(""):a?s.push(o.join("")):s.push(n(o))),r.address=s.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}let d={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},p=/[@/?#:]/g,f=/[@/?#]/g;function h(e,t){let r=t?f:p;return r.lastIndex=0,e.replace(r,e=>d[e])}e.exports={nonSimpleDomain:a,recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let s=unescape(e.host);if(!r(s)){let e=c(s);s=!0===e.isIPV6?`[${e.escapedHost}]`:h(s,!1)}t.push(s)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},reescapeHostDelimiters:h,normalizePercentEncoding:function(e,t=!1){if(-1===e.indexOf("%"))return e;let r="";for(let i=0;i<e.length;i++){if("%"===e[i]&&i+2<e.length){let n=e.slice(i+1,i+3);if(s(n)){let e=n.toUpperCase(),s=String.fromCharCode(parseInt(e,16));t&&o(s)?r+=s:r+="%"+e,i+=2;continue}}r+=e[i]}return r},normalizePathEncoding:function(e){let t="";for(let r=0;r<e.length;r++){if("%"===e[r]&&r+2<e.length){let i=e.slice(r+1,r+3);if(s(i)){let e=i.toUpperCase(),s=String.fromCharCode(parseInt(e,16));"."!==s&&o(s)?t+=s:t+="%"+e,r+=2;continue}}i(e[r])?t+=e[r]:t+=escape(e[r])}return t},escapePreservingEscapes:function(e){let t="";for(let r=0;r<e.length;r++){if("%"===e[r]&&r+2<e.length){let o=e.slice(r+1,r+3);if(s(o)){t+="%"+o.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t},removeDotSegments:function(e){let t=e,r=[],s=-1,o=0;for(;o=t.length;){if(1===o)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===o){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===o&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(s=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,s)),t=t.slice(s)}return r.join("")},isIPv4:r,isUUID:t,normalizeIPv6:c,stringArrayToHexStripped:n}},114(e){"use strict";e.exports=JSON.parse('{"$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":false}')},7456(e){"use strict";e.exports=JSON.parse('{"$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":true,"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":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"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":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"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":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"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":true}')},4519(e){"use strict";e.exports=JSON.parse('{"name":"dotenv","version":"16.6.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}')},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","description":"The MCP framework","version":"0.8.0","author":{"name":"xmcp","email":"support@xmcp.dev","url":"https://xmcp.dev"},"contributors":[{"name":"Valentina Bearzotti","email":"valebearzotti1@gmail.com","url":"https://github.com/valebearzotti"},{"name":"Jose Rago","email":"jose@basement.studio","url":"https://github.com/ragojose"}],"license":"MIT","keywords":["mcp","modelcontextprotocol","http","stdio"],"repository":{"type":"git","url":"https://github.com/basementstudio/xmcp"},"homepage":"https://xmcp.dev","type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"xmcp":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js","default":"./dist/index.js"},"./host-bridge":{"types":"./dist/host-bridge.d.ts","import":"./dist/host-bridge.js","require":"./dist/host-bridge.js","default":"./dist/host-bridge.js"},"./headers":{"types":"./dist/runtime/headers.d.ts","require":"./dist/runtime/headers.js","default":"./dist/runtime/headers.js"},"./cloudflare":{"types":"./dist/cloudflare.d.ts","import":"./dist/cloudflare.js","require":"./dist/cloudflare.js","default":"./dist/cloudflare.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config.js","require":"./dist/config.js","default":"./dist/config.js"},"./package.json":"./package.json"},"typesVersions":{"*":{"host-bridge":["dist/host-bridge.d.ts"],"headers":["dist/runtime/headers.d.ts"],"cloudflare":["dist/cloudflare.d.ts"],"config":["dist/config/index.d.ts"]}},"files":["dist"],"scripts":{"dev":"cross-env NODE_ENV=development tsx --watch --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","build":"cross-env NODE_ENV=production tsx --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","analyze":"cross-env GENERATE_STATS=true pnpm build && pnpm tsx scripts/analyze-rspack-stats.ts","bench":"tsx bench/run.mts","test:config":"pnpm --dir ../compiler test:config","test:adapters":"node --import tsx --test src/runtime/adapters/fastify/__tests__/*.test.ts"},"dependencies":{},"devDependencies":{"@nestjs/common":"^11.1.12","@modelcontextprotocol/sdk":"^1.26.0","@rspack/core":"^1.6.7","@types/async-retry":"^1.4.9","@types/content-type":"^1.1.9","@types/express":"^5.0.6","@types/fs-extra":"^11.0.4","@types/jsonwebtoken":"^9.0.10","@types/node":"^22.19.2","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","async-retry":"^1.3.3","chalk":"^5.6.2","chokidar":"^3.6.0","ci-info":"^4.3.1","commander":"^11.1.0","content-type":"^1.0.5","cross-env":"^7.0.3","del":"^7.1.0","dotenv":"^16.6.1","express":"^4.22.1","fastify":"^5.0.0","fs-extra":"^11.3.2","glob":"^11.1.0","is-docker":"^4.0.0","is-wsl":"^3.1.0","json5":"^2.2.3","jsonwebtoken":"^9.0.3","jose":"^6.1.3","memfs":"^4.51.1","postcss-loader":"^8.2.0","raw-body":"^3.0.2","reflect-metadata":"^0.2.2","rxjs":"^7.8.2","ts-checker-rspack-plugin":"^1.2.1","tsx":"^4.21.0","typescript":"^5.9.3"},"peerDependencies":{"@modelcontextprotocol/sdk":"^1.26.0","jose":"^6.1.3","react":">=19.0.0","react-dom":">=19.0.0","zod":"^3.25.76 || ^4.0.0"},"peerDependenciesMeta":{"@modelcontextprotocol/sdk":{"optional":true},"jose":{"optional":true},"react":{"optional":true},"react-dom":{"optional":true}}}')}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return s[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,s){if(1&s&&(e=this(e)),8&s||"object"==typeof e&&e&&(4&s&&e.__esModule||16&s&&"function"==typeof e.then))return e;var o=Object.create(null);i.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var a=2&s&&e;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach(t=>{n[t]=()=>e[t]});return n.default=()=>e,i.d(o,n),o},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";let e,t;i.r(n),i.d(n,{createHTTPClient:()=>av,HOST_CONTEXT_CHANGED_METHOD:()=>aN,UPDATE_MODEL_CONTEXT_METHOD:()=>aO,UrlElicitationRequiredError:()=>i5,isEnvHeader:()=>af,createSTDIOClient:()=>a_,jwtAuthMiddleware:()=>_,listSTDIOClientTools:()=>ab,createMcpHostBridge:()=>aM,SIZE_CHANGED_METHOD:()=>az,INITIALIZE_METHOD:()=>aS,LOG_MESSAGE_METHOD:()=>aj,INITIALIZED_METHOD:()=>aT,OPEN_LINK_METHOD:()=>aP,REQUEST_DISPLAY_MODE_METHOD:()=>ax,disconnectSTDIOClient:()=>a$,RESOURCES_READ_METHOD:()=>aR,createContext:()=>E,callSTDIOClientTool:()=>aw,headersToRecord:()=>ah,MCP_APPS_PROTOCOL_VERSION:()=>ak,extractToolNamesFromRequest:()=>aE,UI_MESSAGE_METHOD:()=>aI,apiKeyAuthMiddleware:()=>y,completable:()=>S});var r,s,o,a,l,u,c,d=i(8583),p=i.n(d),f=i(4953);let h=f.z.object({apiKey:f.z.string().optional(),headerName:f.z.string().optional(),validateApiKey:f.z.function().args(f.z.string()).returns(f.z.promise(f.z.boolean())).optional()}).strict().refine(e=>void 0!==e.apiKey||void 0!==e.validateApiKey,{message:"Either 'apiKey' or 'validateApiKey' must be provided"}).refine(e=>void 0===e.apiKey||void 0===e.validateApiKey,{message:"'apiKey' and 'validateApiKey' are mutually exclusive - provide only one"}),m="Unauthorized: Missing or invalid API key";function y(e){let t=h.safeParse(e);if(!t.success){let r="apiKey"in e,s="validateApiKey"in e;if(r&&s)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||s)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",s="apiKey"in e?e.apiKey:void 0,o="validateApiKey"in e?e.validateApiKey:void 0;return async(t,i,n)=>{let a=t.header(r);!a||"apiKey"in e&&a!==s||o&&!await o(a)?i.status(401).json({error:m}):n()}}var g=i(8400),v=i.n(g);function _(e){return(t,r,s)=>{let o=t.header("Authorization");if(!o||!o.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let i=o.slice(7).trim();if(!i)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...o}=e;t.user=v().verify(i,r,o),s()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let b=require("async_hooks"),w=(e,t)=>{globalThis[e]=t},$=e=>globalThis[e];function E({name:e}){let t=Symbol.for(`xmcp-context-${e}`),r=Symbol.for(`xmcp-context-${e}-fallback-store`);if($(t))return $(t);let s=new b.AsyncLocalStorage,o=globalThis[r]??{current:null};w(r,o);let i={provider:(e,t)=>(o.current=e,s.run(e,t)),getContext:()=>{let t=s.getStore();if(t)return t;if(o.current)return o.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:t=>{let r=s.getStore()??o.current;if(!r)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(r,t)}};return w(t,i),i}let k=Symbol.for("mcp.completable");function S(e,t){return Object.defineProperty(e,k,{value:{complete:t},enumerable:!1,writable:!1,configurable:!1}),e}(o||(o={})).Completable="McpCompletable";let T=Object.freeze({status:"aborted"});function x(e,t,r){function s(r,s){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:s,constr:n,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,s);let o=n.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){let t=i[e];t in r||(r[t]=o[t].bind(r))}}let o=r?.Parent??Object;class i extends o{}function n(e){var t;let o=r?.Parent?new i:this;for(let r of(s(o,e),(t=o._zod).deferred??(t.deferred=[]),o._zod.deferred))r();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(n,"init",{value:s}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(n,"name",{value:e}),n}Symbol("zod_brand");class P extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(a=globalThis).__zod_globalConfig??(a.__zod_globalConfig={});let I=globalThis.__zod_globalConfig;function j(e){return e&&Object.assign(I,e),I}let R=/^[cC][0-9a-z]{6,}$/,N=/^[0-9a-z]+$/,z=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,C=/^[0-9a-vA-V]{20}$/,A=/^[A-Za-z0-9]{27}$/,M=/^[a-zA-Z0-9_-]{21}$/,D=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,L=/^([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})$/,q=e=>e?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)$/,U=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?: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])$/,F=/^(([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}|:))$/,H=/^((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])$/,Z=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,K=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,G=/^[A-Za-z0-9_-]*$/,J=/^https?$/,B=/^\+[1-9]\d{6,14}$/,W="(?:(?:\\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])))",X=RegExp(`^${W}$`);function Y(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let Q=/^-?\d+$/,ee=/^-?\d+(?:\.\d+)?$/,et=/^(?:true|false)$/i,er=/^null$/i,es=/^[^A-Z]*$/,eo=/^[^a-z]*$/;function ei(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function en(e,t){return"bigint"==typeof t?t.toString():t}function ea(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function el(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let eu=Symbol("evaluating");function ec(e,t,r){let s;Object.defineProperty(e,t,{get(){if(s!==eu)return void 0===s&&(s=eu,s=r()),s},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ed(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ep(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function ef(e){return JSON.stringify(e)}let eh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function em(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ey=ea(()=>{if(I.jitless||"undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eg(e){if(!1===em(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==em(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function ev(e){return eg(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let e_=new Set(["string","number","symbol"]);function eb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ew(e,t,r){let s=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(s._zod.parent=e),s}function e$(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let eE={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ek(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eS(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eT(e){return"string"==typeof e?e:e?.message}function ex(e,t,r){let s=e.message?e.message:eT(e.inst?._zod.def?.error?.(e))??eT(t?.error?.(e))??eT(r.customError?.(e))??eT(r.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:n,...a}=e;return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=n),a}function eP(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eO(...e){let[t,r,s]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:s}:{...t}}let eI=x("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ej={number:"number",bigint:"bigint",object:"date"},eR=x("$ZodCheckLessThan",(e,t)=>{eI.init(e,t);let r=ej[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eN=x("$ZodCheckGreaterThan",(e,t)=>{eI.init(e,t);let r=ej[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ez=x("$ZodCheckMultipleOf",(e,t)=>{eI.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{let s,o,i;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0==(o=Math.round(s=r.value/t.value),i=Number.EPSILON*Math.max(Math.abs(s),1),Math.abs(s-o)<i?0:s-o))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),eC=x("$ZodCheckNumberFormat",(e,t)=>{eI.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),s=r?"int":"number",[o,i]=eE[t.format];e._zod.onattach.push(e=>{let s=e._zod.bag;s.format=t.format,s.minimum=o,s.maximum=i,r&&(s.pattern=Q)}),e._zod.check=n=>{let a=n.value;if(r){if(!Number.isInteger(a))return void n.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?n.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):n.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}))}a<o&&n.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&n.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),eA=x("$ZodCheckMaxLength",(e,t)=>{var r;eI.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let s=r.value;if(s.length<=t.maximum)return;let o=eP(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),eM=x("$ZodCheckMinLength",(e,t)=>{var r;eI.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let s=r.value;if(s.length>=t.minimum)return;let o=eP(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),eD=x("$ZodCheckLengthEquals",(e,t)=>{var r;eI.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let s=r.value,o=s.length;if(o===t.length)return;let i=eP(s),n=o>t.length;r.issues.push({origin:i,...n?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),eL=x("$ZodCheckStringFormat",(e,t)=>{var r,s;eI.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.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})}):(s=e._zod).check??(s.check=()=>{})}),eq=x("$ZodCheckRegex",(e,t)=>{eL.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),eU=x("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=es),eL.init(e,t)}),eV=x("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eo),eL.init(e,t)}),eF=x("$ZodCheckIncludes",(e,t)=>{eI.init(e,t);let r=eb(t.includes),s=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=s,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(s)}),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})}}),eH=x("$ZodCheckStartsWith",(e,t)=>{eI.init(e,t);let r=RegExp(`^${eb(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),eZ=x("$ZodCheckEndsWith",(e,t)=>{eI.init(e,t);let r=RegExp(`.*${eb(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),eK=x("$ZodCheckOverwrite",(e,t)=>{eI.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class eG{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let eJ=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,en,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},eB=x("$ZodError",eJ),eW=x("$ZodError",eJ,{Parent:Error}),eX=e=>(t,r,s,o)=>{let i=s?{...s,async:!1}:{async:!1},n=t._zod.run({value:r,issues:[]},i);if(n instanceof Promise)throw new P;if(n.issues.length){let t=new(o?.Err??e)(n.issues.map(e=>ex(e,i,j())));throw eh(t,o?.callee),t}return n.value},eY=e=>async(t,r,s,o)=>{let i=s?{...s,async:!0}:{async:!0},n=t._zod.run({value:r,issues:[]},i);if(n instanceof Promise&&(n=await n),n.issues.length){let t=new(o?.Err??e)(n.issues.map(e=>ex(e,i,j())));throw eh(t,o?.callee),t}return n.value},eQ=e=>(t,r,s)=>{let o=s?{...s,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new P;return i.issues.length?{success:!1,error:new(e??eB)(i.issues.map(e=>ex(e,o,j())))}:{success:!0,data:i.value}},e0=eQ(eW),e1=e=>async(t,r,s)=>{let o=s?{...s,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>ex(e,o,j())))}:{success:!0,data:i.value}},e2=e1(eW),e9={major:4,minor:4,patch:3},e4=x("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=e9;let s=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&s.unshift(e),s))for(let r of t._zod.onattach)r(e);if(0===s.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let s,o=ek(e);for(let i of t){if(i._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(e)||!i._zod.def.when(e))continue}else if(o)continue;let t=e.issues.length,n=i._zod.check(e);if(n instanceof Promise&&r?.async===!1)throw new P;if(s||n instanceof Promise)s=(s??Promise.resolve()).then(async()=>{await n,e.issues.length!==t&&(o||(o=ek(e,t)))});else{if(e.issues.length===t)continue;o||(o=ek(e,t))}}return s?s.then(()=>e):e},r=(r,o,i)=>{if(ek(r))return r.aborted=!0,r;let n=t(o,s,i);if(n instanceof Promise){if(!1===i.async)throw new P;return n.then(t=>e._zod.parse(t,i))}return e._zod.parse(n,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){let t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,o,i)):r(t,o,i)}let n=e._zod.parse(o,i);if(n instanceof Promise){if(!1===i.async)throw new P;return n.then(e=>t(e,s,i))}return t(n,s,i)}}ec(e,"~standard",()=>({validate:t=>{try{let r=e0(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return e2(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),e6=x("$ZodString",(e,t)=>{var r;let s;e4.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(s=(r=e._zod.bag)?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${s}$`)),e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),e8=x("$ZodStringFormat",(e,t)=>{eL.init(e,t),e6.init(e,t)}),e5=x("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=L),e8.init(e,t)}),e3=x("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=q(e))}else t.pattern??(t.pattern=q());e8.init(e,t)}),e7=x("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=U),e8.init(e,t)}),te=x("$ZodURL",(e,t)=>{e8.init(e,t),e._zod.check=r=>{try{let s=r.value.trim();if(!t.normalize&&t.protocol?.source===J.source&&!/^https?:\/\//i.test(s))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let o=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=s;return}catch(s){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),tt=x("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),e8.init(e,t)}),tr=x("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=M),e8.init(e,t)}),ts=x("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=R),e8.init(e,t)}),to=x("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=N),e8.init(e,t)}),ti=x("$ZodULID",(e,t)=>{t.pattern??(t.pattern=z),e8.init(e,t)}),tn=x("$ZodXID",(e,t)=>{t.pattern??(t.pattern=C),e8.init(e,t)}),ta=x("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=A),e8.init(e,t)}),tl=x("$ZodISODateTime",(e,t)=>{let r,s,o;t.pattern??(r=Y({precision:t.precision}),s=["Z"],t.local&&s.push(""),t.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),o=`${r}(?:${s.join("|")})`,t.pattern=RegExp(`^${W}T(?:${o})$`)),e8.init(e,t)}),tu=x("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=X),e8.init(e,t)}),tc=x("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${Y(t)}$`)),e8.init(e,t)}),td=x("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=D),e8.init(e,t)}),tp=x("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=V),e8.init(e,t),e._zod.bag.format="ipv4"}),tf=x("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=F),e8.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),th=x("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=H),e8.init(e,t)}),tm=x("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Z),e8.init(e,t),e._zod.check=r=>{let s=r.value.split("/");try{if(2!==s.length)throw Error();let[e,t]=s;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ty(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tg=x("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=K),e8.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ty(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),tv=x("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=G),e8.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!G.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ty(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),t_=x("$ZodE164",(e,t)=>{t.pattern??(t.pattern=B),e8.init(e,t)}),tb=x("$ZodJWT",(e,t)=>{e8.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[s]=r;if(!s)return!1;let o=JSON.parse(atob(s));if("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),tw=x("$ZodNumber",(e,t)=>{e4.init(e,t),e._zod.pattern=e._zod.bag.pattern??ee,e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let o=r.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),t$=x("$ZodNumberFormat",(e,t)=>{eC.init(e,t),tw.init(e,t)}),tE=x("$ZodBoolean",(e,t)=>{e4.init(e,t),e._zod.pattern=et,e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let o=r.value;return"boolean"==typeof o||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),tk=x("$ZodNull",(e,t)=>{e4.init(e,t),e._zod.pattern=er,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let s=t.value;return null===s||t.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),t}}),tS=x("$ZodAny",(e,t)=>{e4.init(e,t),e._zod.parse=e=>e}),tT=x("$ZodUnknown",(e,t)=>{e4.init(e,t),e._zod.parse=e=>e}),tx=x("$ZodNever",(e,t)=>{e4.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function tP(e,t,r){e.issues.length&&t.issues.push(...eS(r,e.issues)),t.value[r]=e.value}let tO=x("$ZodArray",(e,t)=>{e4.init(e,t),e._zod.parse=(r,s)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let e=0;e<o.length;e++){let n=o[e],a=t.element._zod.run({value:n,issues:[]},s);a instanceof Promise?i.push(a.then(t=>tP(t,r,e))):tP(a,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function tI(e,t,r,s,o,i){let n=r in s;if(e.issues.length){if(o&&i&&!n)return;t.issues.push(...eS(r,e.issues))}if(!n&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?n&&(t.value[r]=void 0):t.value[r]=e.value}function tj(e){var t;let r=Object.keys(e.shape);for(let t of r)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let s=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(s)}}function tR(e,t,r,s,o,i){let n=[],a=o.keySet,l=o.catchall._zod,u=l.def.type,c="optional"===l.optin,d="optional"===l.optout;for(let o in t){if("__proto__"===o||a.has(o))continue;if("never"===u){n.push(o);continue}let i=l.run({value:t[o],issues:[]},s);i instanceof Promise?e.push(i.then(e=>tI(e,r,o,t,c,d))):tI(i,r,o,t,c,d)}return(n.length&&r.issues.push({code:"unrecognized_keys",keys:n,input:t,inst:i}),e.length)?Promise.all(e).then(()=>r):r}let tN=x("$ZodObject",(e,t)=>{let r;e4.init(e,t);let s=Object.getOwnPropertyDescriptor(t,"shape");if(!s?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let o=ea(()=>tj(t));ec(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let s=e[t]._zod;if(s.values)for(let e of(r[t]??(r[t]=new Set),s.values))r[t].add(e)}return r});let i=t.catchall;e._zod.parse=(t,s)=>{r??(r=o.value);let n=t.value;if(!em(n))return t.issues.push({expected:"object",code:"invalid_type",input:n,inst:e}),t;t.value={};let a=[],l=r.shape;for(let e of r.keys){let r=l[e],o="optional"===r._zod.optin,i="optional"===r._zod.optout,u=r._zod.run({value:n[e],issues:[]},s);u instanceof Promise?a.push(u.then(r=>tI(r,t,e,n,o,i))):tI(u,t,e,n,o,i)}return i?tR(a,n,t,s,o.value,e):a.length?Promise.all(a).then(()=>t):t}}),tz=x("$ZodObjectJIT",(e,t)=>{let r,s;tN.init(e,t);let o=e._zod.parse,i=ea(()=>tj(t)),n=!I.jitless,a=n&&ey.value,l=t.catchall;e._zod.parse=(u,c)=>{s??(s=i.value);let d=u.value;return em(d)?n&&a&&c?.async===!1&&!0!==c.jitless?(r||(r=(e=>{let t=new eG(["shape","payload","ctx"]),r=i.value,s=e=>{let t=ef(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let o=Object.create(null),n=0;for(let e of r.keys)o[e]=`key_${n++}`;for(let i of(t.write("const newResult = {};"),r.keys)){let r=o[i],n=ef(i),a=e[i],l=a?._zod?.optin==="optional",u=a?._zod?.optout==="optional";t.write(`const ${r} = ${s(i)};`),l&&u?t.write(`
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod/v3"));else if("function"==typeof define&&define.amd)define(["zod/v3"],t);else{var r="object"==typeof exports?t(require("zod/v3")):t(e["zod/v3"]);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,e=>(()=>{var t,r,o={9454(e,t,r){"use strict";var o=r(181).Buffer,a=r(181).SlowBuffer;function i(e,t){if(!o.isBuffer(e)||!o.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,a=0;a<e.length;a++)r|=e[a]^t[a];return 0===r}e.exports=i,i.install=function(){o.prototype.equal=a.prototype.equal=function(e){return i(this,e)}};var s=o.prototype.equal,n=a.prototype.equal;i.restore=function(){o.prototype.equal=s,a.prototype.equal=n}},6507(e,t,r){"use strict";let o=r(5317),a=r(8388),i=r(442);function s(e,t,r){let s=a(e,t,r),n=o.spawn(s.command,s.args,s.options);return i.hookChildProcess(n,s),n}e.exports=s,e.exports.spawn=s,e.exports.sync=function(e,t,r){let s=a(e,t,r),n=o.spawnSync(s.command,s.args,s.options);return n.error=n.error||i.verifyENOENTSync(n.status,s),n},e.exports._parse=a,e.exports._enoent=i},442(e){"use strict";let t="win32"===process.platform;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function o(e,o){return t&&1===e&&!o.file?r(o.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;let a=e.emit;e.emit=function(t,i){if("exit"===t){let t=o(i,r);if(t)return a.call(e,"error",t)}return a.apply(e,arguments)}},verifyENOENT:o,verifyENOENTSync:function(e,o){return t&&1===e&&!o.file?r(o.original,"spawnSync"):null},notFoundError:r}},8388(e,t,r){"use strict";let o=r(6928),a=r(3803),i=r(2077),s=r(1880),n="win32"===process.platform,l=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let u={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?u:function(e){let t;if(!n)return e;let r=(e.file=a(e),(t=e.file&&s(e.file))?(e.args.unshift(e.file),e.command=t,a(e)):e.file),u=!l.test(r);if(e.options.forceShell||u){let t=c.test(r);e.command=o.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,t));let a=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${a}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(u)}},2077(e){"use strict";let t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},1880(e,t,r){"use strict";let o=r(9896),a=r(600);e.exports=function(e){let t,r=Buffer.alloc(150);try{t=o.openSync(e,"r"),o.readSync(t,r,0,150,0),o.closeSync(t)}catch(e){}return a(r.toString())}},3803(e,t,r){"use strict";let o=r(6928),a=r(1905),i=r(9695);function s(e,t){let r,s=e.options.env||process.env,n=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=a.sync(e.command,{path:s[i({env:s})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(n)}return r&&(r=o.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return s(e)||s(e,!0)}},8583(e,t,r){let o=r(9896),a=r(6928),i=r(857),s=r(6982),n=r(4519).version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function c(e){console.log(`[dotenv@${n}][DEBUG] ${e}`)}function u(e){console.log(`[dotenv@${n}] ${e}`)}function d(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function p(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)o.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=a.resolve(process.cwd(),".env.vault");return o.existsSync(t)?t:null}function h(e){return"~"===e[0]?a.join(i.homedir(),e.slice(1)):e}let f={configDotenv:function(e){let t,r=a.resolve(process.cwd(),".env"),i="utf8",s=!!(e&&e.debug),n=!e||!("quiet"in e)||e.quiet;e&&e.encoding?i=e.encoding:s&&c("No encoding is specified. UTF-8 is used by default");let l=[r];if(e&&e.path)if(Array.isArray(e.path))for(let t of(l=[],e.path))l.push(h(t));else l=[h(e.path)];let d={};for(let r of l)try{let t=f.parse(o.readFileSync(r,{encoding:i}));f.populate(d,t,e)}catch(e){s&&c(`Failed to load ${r} ${e.message}`),t=e}let p=process.env;if(e&&null!=e.processEnv&&(p=e.processEnv),f.populate(p,d,e),s||!n){let e=Object.keys(d).length,r=[];for(let e of l)try{let t=a.relative(process.cwd(),e);r.push(t)}catch(r){s&&c(`Failed to load ${e} ${r.message}`),t=r}u(`injecting env (${e}) from ${r.join(",")}`)}return t?{parsed:d,error:t}:{parsed:d}},_configVault:function(e){let t=!!(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;(t||!r)&&u("Loading env from encrypted .env.vault");let o=f._parseVault(e),a=process.env;return e&&null!=e.processEnv&&(a=e.processEnv),f.populate(a,o,e),{parsed:o}},_parseVault:function(e){let t,r=p(e=e||{});e.path=r;let o=f.configDotenv(e);if(!o.parsed){let e=Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw e.code="MISSING_DATA",e}let a=d(e).split(","),i=a.length;for(let e=0;e<i;e++)try{let r=a[e].trim(),i=function(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code){let e=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw e}let o=r.password;if(!o){let e=Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}let a=r.searchParams.get("environment");if(!a){let e=Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}let i=`DOTENV_VAULT_${a.toUpperCase()}`,s=e.parsed[i];if(!s){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:s,key:o}}(o,r);t=f.decrypt(i.ciphertext,i.key);break}catch(t){if(e+1>=i)throw t}return f.parse(t)},config:function(e){if(0===d(e).length)return f.configDotenv(e);let t=p(e);if(!t){var r;return r=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.log(`[dotenv@${n}][WARN] ${r}`),f.configDotenv(e)}return f._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),o=Buffer.from(e,"base64"),a=o.subarray(0,12),i=o.subarray(-16);o=o.subarray(12,-16);try{let e=s.createDecipheriv("aes-256-gcm",r,a);return e.setAuthTag(i),`${e.update(o)}${e.final()}`}catch(o){let e=o instanceof RangeError,t="Invalid key length"===o.message,r="Unsupported state or unable to authenticate data"===o.message;if(e||t){let e=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(r){let e=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw o}},parse:function(e){let t,r={},o=e.toString();for(o=o.replace(/\r\n?/mg,"\n");null!=(t=l.exec(o));){let e=t[1],o=t[2]||"",a=(o=o.trim())[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===a&&(o=(o=o.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=o}return r},populate:function(e,t,r={}){let o=!!(r&&r.debug),a=!!(r&&r.override);if("object"!=typeof t){let e=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===a&&(e[r]=t[r]),o&&(!0===a?c(`"${r}" is already defined and WAS overwritten`):c(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=f.configDotenv,e.exports._configVault=f._configVault,e.exports._parseVault=f._parseVault,e.exports.config=f.config,e.exports.decrypt=f.decrypt,e.exports.parse=f.parse,e.exports.populate=f.populate,e.exports=f},9053(e,t,r){"use strict";var o=r(6608).Buffer,a=r(2188);function i(e){if(o.isBuffer(e))return e;if("string"==typeof e)return o.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(e,t,r){for(var o=0;t+o<r&&0===e[t+o];)++o;return e[t+o]>=128&&--o,o}e.exports={derToJose:function(e,t){e=i(e);var r=a(t),s=r+1,n=e.length,l=0;if(48!==e[l++])throw Error('Could not find expected "seq"');var c=e[l++];if(129===c&&(c=e[l++]),n-l<c)throw Error('"seq" specified length of "'+c+'", only "'+(n-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var u=e[l++];if(n-l-2<u)throw Error('"r" specified length of "'+u+'", only "'+(n-l-2)+'" available');if(s<u)throw Error('"r" specified length of "'+u+'", max of "'+s+'" is acceptable');var d=l;if(l+=u,2!==e[l++])throw Error('Could not find expected "int" for "s"');var p=e[l++];if(n-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(n-l)+'"');if(s<p)throw Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable');var h=l;if((l+=p)!==n)throw Error('Expected to consume entire buffer, but "'+(n-l)+'" bytes remain');var f=r-u,m=r-p,y=o.allocUnsafe(f+u+m+p);for(l=0;l<f;++l)y[l]=0;e.copy(y,l,d+Math.max(-f,0),d+u),l=r;for(var g=l;l<g+m;++l)y[l]=0;return e.copy(y,l,h+Math.max(-m,0),h+p),y=(y=y.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=i(e);var r=a(t),n=e.length;if(n!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+n+'"');var l=s(e,0,r),c=s(e,r,e.length),u=r-l,d=r-c,p=2+u+1+1+d,h=p<128,f=o.allocUnsafe((h?2:3)+p),m=0;return f[m++]=48,h?f[m++]=p:(f[m++]=129,f[m++]=255&p),f[m++]=2,f[m++]=u,l<0?(f[m++]=0,m+=e.copy(f,m,0,r)):m+=e.copy(f,m,l,r),f[m++]=2,f[m++]=d,c<0?(f[m++]=0,e.copy(f,m,r)):e.copy(f,m,r+c),f}}},2188(e){"use strict";function t(e){return(e/8|0)+ +(e%8!=0)}var r={ES256:t(256),ES384:t(384),ES512:t(521)};e.exports=function(e){var t=r[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}},9344(e,t,r){var o;function a(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,o){a(e,t||{},function(e,t){e?o(e):r(t)})})}o(e,t||{},function(e,o){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,o=!1),r(e,o)})}r(9896),o="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=a,a.sync=function(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709(e,t,r){e.exports=a,a.sync=function(e,t){return i(o.statSync(e),t)};var o=r(9896);function a(e,t,r){o.stat(e,function(e,o){r(e,!e&&i(o,t))})}function i(e,t){var r,o,a,i,s,n,l,c,u;return e.isFile()&&(r=e,o=t,a=r.mode,i=r.uid,s=r.gid,n=void 0!==o.uid?o.uid:process.getuid&&process.getuid(),l=void 0!==o.gid?o.gid:process.getgid&&process.getgid(),c=parseInt("100",8),u=parseInt("010",8),a&parseInt("001",8)||a&u&&s===l||a&c&&i===n||a&(c|u)&&0===n)}},8541(e,t,r){e.exports=i,i.sync=function(e,t){return a(o.statSync(e),e,t)};var o=r(9896);function a(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var o=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!o||-1!==(o=o.split(";")).indexOf(""))return!0;for(var a=0;a<o.length;a++){var i=o[a].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,r){o.stat(e,function(o,i){r(o,!o&&a(i,e,t))})}},2548(e,t,r){var o=r(3263);e.exports=function(e,t){t=t||{};var r=o.decode(e,t);if(!r)return null;var a=r.payload;if("string"==typeof a)try{var i=JSON.parse(a);null!==i&&"object"==typeof i&&(a=i)}catch(e){}return!0===t.complete?{header:r.header,payload:a,signature:r.signature}:a}},8400(e,t,r){e.exports={decode:r(2548),verify:r(6467),sign:r(9147),JsonWebTokenError:r(1957),NotBeforeError:r(4470),TokenExpiredError:r(7788)}},1957(e){var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},4470(e,t,r){var o=r(1957),a=function(e,t){o.call(this,e),this.name="NotBeforeError",this.date=t};a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a},7788(e,t,r){var o=r(1957),a=function(e,t){o.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a},5841(e,t,r){e.exports=r(3895).satisfies(process.version,">=15.7.0")},953(e,t,r){e.exports=r(3895).satisfies(process.version,"^6.12.0 || >=8.0.0")},455(e,t,r){e.exports=r(3895).satisfies(process.version,">=16.9.0")},4559(e,t,r){var o=r(3866);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var a=o(e);if(void 0===a)return;return Math.floor(r+a/1e3)}if("number"==typeof e)return r+e}},723(e,t,r){let o=r(5841),a=r(455),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=i[r];if(!n)throw Error(`Unknown key type "${r}".`);if(!n.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(o)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,c=s[e];if(l!==c)throw Error(`"alg" parameter "${e}" requires curve "${c}".`);break;case"rsa-pss":if(a){let r=parseInt(e.slice(-3),10),{hashAlgorithm:o,mgf1HashAlgorithm:a,saltLength:i}=t.asymmetricKeyDetails;if(o!==`sha${r}`||a!==o)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==i&&i>r>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},9147(e,t,r){let o=r(4559),a=r(953),i=r(723),s=r(3263),n=r(5357),l=r(6782),c=r(5250),u=r(8094),d=r(6052),p=r(1251),h=r(8430),{KeyObject:f,createSecretKey:m,createPrivateKey:y}=r(6982),g=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];a&&g.splice(3,0,"PS256","PS384","PS512");let v={expiresIn:{isValid:function(e){return c(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return c(e)||p(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return p(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:n.bind(null,g),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:p,message:'"encoding" must be a string'},issuer:{isValid:p,message:'"issuer" must be a string'},subject:{isValid:p,message:'"subject" must be a string'},jwtid:{isValid:p,message:'"jwtid" must be a string'},noTimestamp:{isValid:l,message:'"noTimestamp" must be a boolean'},keyid:{isValid:p,message:'"keyid" must be a string'},mutatePayload:{isValid:l,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:l,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:l,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},b={iat:{isValid:u,message:'"iat" should be a number of seconds'},exp:{isValid:u,message:'"exp" should be a number of seconds'},nbf:{isValid:u,message:'"nbf" should be a number of seconds'}};function _(e,t,r,o){if(!d(r))throw Error('Expected "'+o+'" to be a plain object.');Object.keys(r).forEach(function(a){let i=e[a];if(!i){if(!t)throw Error('"'+a+'" is not allowed in "'+o+'"');return}if(!i.isValid(r[a]))throw Error(i.message)})}let S={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},$=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,a){var n,l;"function"==typeof r?(a=r,r={}):r=r||{};let c="object"==typeof e&&!Buffer.isBuffer(e),u=Object.assign({alg:r.algorithm||"HS256",typ:c?"JWT":void 0,kid:r.keyid},r.header);function d(e){if(a)return a(e);throw e}if(!t&&"none"!==r.algorithm)return d(Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof f))try{t=y(t)}catch(e){try{t=m("string"==typeof t?Buffer.from(t):t)}catch(e){return d(Error("secretOrPrivateKey is not valid key material"))}}if(u.alg.startsWith("HS")&&"secret"!==t.type)return d(Error(`secretOrPrivateKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)){if("private"!==t.type)return d(Error(`secretOrPrivateKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInsecureKeySizes&&!u.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return d(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}if(void 0===e)return d(Error("payload is required"));if(c){try{n=e,_(b,!0,n,"payload")}catch(e){return d(e)}r.mutatePayload||(e=Object.assign({},e))}else{let t=$.filter(function(e){return void 0!==r[e]});if(t.length>0)return d(Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return d(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return d(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{l=r,_(v,!1,l,"options")}catch(e){return d(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{i(u.alg,t)}catch(e){return d(e)}let p=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:c&&(e.iat=p),void 0!==r.notBefore){try{e.nbf=o(r.notBefore,p)}catch(e){return d(e)}if(void 0===e.nbf)return d(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof e){try{e.exp=o(r.expiresIn,p)}catch(e){return d(e)}if(void 0===e.exp)return d(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(S).forEach(function(t){let o=S[t];if(void 0!==r[t]){if(void 0!==e[o])return d(Error('Bad "options.'+t+'" option. The payload already has an "'+o+'" property.'));e[o]=r[t]}});let g=r.encoding||"utf8";if("function"==typeof a)a=a&&h(a),s.createSign({header:u,privateKey:t,payload:e,encoding:g}).once("error",a).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&e.length<256)return a(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`));a(null,e)});else{let o=s.sign({header:u,payload:e,secret:t,encoding:g});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&o.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`);return o}}},6467(e,t,r){let o=r(1957),a=r(4470),i=r(7788),s=r(2548),n=r(4559),l=r(723),c=r(953),u=r(3263),{KeyObject:d,createSecretKey:p,createPublicKey:h}=r(6982),f=["RS256","RS384","RS512"],m=["ES256","ES384","ES512"],y=["RS256","RS384","RS512"],g=["HS256","HS384","HS512"];c&&(f.splice(f.length,0,"PS256","PS384","PS512"),y.splice(y.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,c){let v,b,_;if("function"!=typeof r||c||(c=r,r={}),r||(r={}),r=Object.assign({},r),v=c||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new o("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new o("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new o("allowInvalidAsymmetricKeyTypes must be a boolean"));let S=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new o("jwt must be provided"));if("string"!=typeof e)return v(new o("jwt must be a string"));let $=e.split(".");if(3!==$.length)return v(new o("jwt malformed"));try{b=s(e,{complete:!0})}catch(e){return v(e)}if(!b)return v(new o("invalid token"));let w=b.header;if("function"==typeof t){if(!c)return v(new o("verify must be called asynchronous if secret or public key is provided as a callback"));_=t}else _=function(e,r){return r(null,t)};return _(w,function(t,s){let c;if(t)return v(new o("error in secret or public key callback: "+t.message));let _=""!==$[2].trim();if(!_&&s)return v(new o("jwt signature is required"));if(_&&!s)return v(new o("secret or public key must be provided"));if(!_&&!r.algorithms)return v(new o('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof d))try{s=h(s)}catch(e){try{s=p("string"==typeof s?Buffer.from(s):s)}catch(e){return v(new o("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=g:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=y:"ec"===s.asymmetricKeyType?r.algorithms=m:r.algorithms=f),-1===r.algorithms.indexOf(b.header.alg))return v(new o("invalid algorithm"));if(w.alg.startsWith("HS")&&"secret"!==s.type)return v(new o(`secretOrPublicKey must be a symmetric key when using ${w.alg}`));if(/^(?:RS|PS|ES)/.test(w.alg)&&"public"!==s.type)return v(new o(`secretOrPublicKey must be an asymmetric key when using ${w.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(w.alg,s)}catch(e){return v(e)}try{c=u.verify(e,b.header.alg,s)}catch(e){return v(e)}if(!c)return v(new o("invalid signature"));let E=b.payload;if(void 0!==E.nbf&&!r.ignoreNotBefore){if("number"!=typeof E.nbf)return v(new o("invalid nbf value"));if(E.nbf>S+(r.clockTolerance||0))return v(new a("jwt not active",new Date(1e3*E.nbf)))}if(void 0!==E.exp&&!r.ignoreExpiration){if("number"!=typeof E.exp)return v(new o("invalid exp value"));if(S>=E.exp+(r.clockTolerance||0))return v(new i("jwt expired",new Date(1e3*E.exp)))}if(r.audience){let e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(E.aud)?E.aud:[E.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new o("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&E.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(E.iss)))return v(new o("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&E.sub!==r.subject)return v(new o("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&E.jti!==r.jwtid)return v(new o("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&E.nonce!==r.nonce)return v(new o("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof E.iat)return v(new o("iat required when maxAge is specified"));let e=n(r.maxAge,E.iat);if(void 0===e)return v(new o('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(S>=e+(r.clockTolerance||0))return v(new i("maxAge exceeded",new Date(1e3*e)))}return!0===r.complete?v(null,{header:w,payload:E,signature:b.signature}):v(null,E)})}},2357(e,t,r){var o,a=r(6608).Buffer,i=r(6982),s=r(9053),n=r(9023),l="secret must be a string or buffer",c="key must be a string or a buffer",u="function"==typeof i.createPublicKey;function d(e){if(!a.isBuffer(e)&&"string"!=typeof e&&(!u||"object"!=typeof e||"string"!=typeof e.type||"string"!=typeof e.asymmetricKeyType||"function"!=typeof e.export))throw m(c)}function p(e){if(!a.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw m("key must be a string, a buffer or an object")}function h(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function f(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function m(e){var t=[].slice.call(arguments,1);return TypeError(n.format.bind(n,e).apply(null,t))}function y(e){var t;return t=e,a.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function g(e){return function(t,r){!function(e){if(!a.isBuffer(e)){if("string"!=typeof e){if(!u||"object"!=typeof e||"secret"!==e.type||"function"!=typeof e.export)throw m(l)}}}(r),t=y(t);var o=i.createHmac("sha"+e,r);return h((o.update(t),o.digest("base64")))}}u&&(c+=" or a KeyObject",l+="or a KeyObject");var v="timingSafeEqual"in i?function(e,t){return e.byteLength===t.byteLength&&i.timingSafeEqual(e,t)}:function(e,t){return o||(o=r(9454)),o(e,t)};function b(e){return function(t,r,o){var i=g(e)(t,o);return v(a.from(r),a.from(i))}}function _(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return h((o.update(t),o.sign(r,"base64")))}}function S(e){return function(t,r,o){d(o),t=y(t),r=f(r);var a=i.createVerify("RSA-SHA"+e);return a.update(t),a.verify(o,r,"base64")}}function $(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return h((o.update(t),o.sign({key:r,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function w(e){return function(t,r,o){d(o),t=y(t),r=f(r);var a=i.createVerify("RSA-SHA"+e);return a.update(t),a.verify({key:o,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function E(e){var t=_(e);return function(){var r=t.apply(null,arguments);return s.derToJose(r,"ES"+e)}}function R(e){var t=S(e);return function(r,o,a){return t(r,o=s.joseToDer(o,"ES"+e).toString("base64"),a)}}function P(){return function(){return""}}function k(){return function(e,t){return""===t}}e.exports=function(e){var t=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!t)throw m('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var r=(t[1]||t[3]).toLowerCase(),o=t[2];return{sign:({hs:g,rs:_,ps:$,es:E,none:P})[r](o),verify:({hs:b,rs:S,ps:w,es:R,none:k})[r](o)}}},3263(e,t,r){var o=r(9615),a=r(6747);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=o.sign,t.verify=a.verify,t.decode=a.decode,t.isValid=a.isValid,t.createSign=function(e){return new o(e)},t.createVerify=function(e){return new a(e)}},6360(e,t,r){var o=r(6608).Buffer,a=r(2203);function i(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=o.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=o.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick((function(){this.emit("end",e),this.readable=!1,this.emit("close")}).bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}r(9023).inherits(i,a),i.prototype.write=function(e){this.buffer=o.concat([this.buffer,o.from(e)]),this.emit("data",e)},i.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=i},9615(e,t,r){var o=r(6608).Buffer,a=r(6360),i=r(2357),s=r(2203),n=r(5911),l=r(9023);function c(e,t){return o.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(e){var t,r,o,a=e.header,s=e.payload,u=e.secret||e.privateKey,d=e.encoding,p=i(a.alg),h=(t=(t=d)||"utf8",r=c(n(a),"binary"),o=c(n(s),t),l.format("%s.%s",r,o)),f=p.sign(h,u);return l.format("%s.%s",h,f)}function d(e){var t=e.secret;if(t=null==(t=null==t?e.privateKey:t)?e.key:t,!0===/^hs/i.test(e.header.alg)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new a(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new a(e.payload),this.secret.once("close",(function(){!this.payload.writable&&this.readable&&this.sign()}).bind(this)),this.payload.once("close",(function(){!this.secret.writable&&this.readable&&this.sign()}).bind(this))}l.inherits(d,s),d.prototype.sign=function(){try{var e=u({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},d.sign=u,e.exports=d},5911(e,t,r){var o=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||o.isBuffer(e)?e.toString():JSON.stringify(e)}},6747(e,t,r){var o=r(6608).Buffer,a=r(6360),i=r(2357),s=r(2203),n=r(5911),l=r(9023),c=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function u(e){var t=e.split(".",1)[0],r=o.from(t,"base64").toString("binary");if("[object Object]"===Object.prototype.toString.call(r))return r;try{return JSON.parse(r)}catch(e){return}}function d(e){return e.split(".")[2]}function p(e){return c.test(e)&&!!u(e)}function h(e,t,r){if(!t){var o=Error("Missing algorithm parameter for jws.verify");throw o.code="MISSING_ALGORITHM",o}var a=d(e=n(e)),s=e.split(".",2).join(".");return i(t).verify(s,a,r)}function f(e,t){if(t=t||{},!p(e=n(e)))return null;var r,a,i=u(e);if(!i)return null;var s=(r=r||"utf8",a=e.split(".")[1],o.from(a,"base64").toString(r));return("JWT"===i.typ||t.json)&&(s=JSON.parse(s,t.encoding)),{header:i,payload:s,signature:d(e)}}function m(e){var t=(e=e||{}).secret;if(t=null==(t=null==t?e.publicKey:t)?e.key:t,!0===/^hs/i.test(e.algorithm)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new a(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new a(e.signature),this.secret.once("close",(function(){!this.signature.writable&&this.readable&&this.verify()}).bind(this)),this.signature.once("close",(function(){!this.secret.writable&&this.readable&&this.verify()}).bind(this))}l.inherits(m,s),m.prototype.verify=function(){try{var e=h(this.signature.buffer,this.algorithm,this.key.buffer),t=f(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},m.decode=f,m.isValid=p,m.verify=h,e.exports=m},5357(e){var t,r,o=1/0,a=0/0,i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=/^(?:0|[1-9]\d*)$/,u=parseInt;function d(e){return e!=e}var p=Object.prototype,h=p.hasOwnProperty,f=p.toString,m=p.propertyIsEnumerable,y=(t=Object.keys,r=Object,function(e){return t(r(e))}),g=Math.max,v=Array.isArray;function b(e){var t,r,o;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(o=_(r=e)?f.call(r):"")&&"[object GeneratorFunction]"!=o}function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function S(e){return!!e&&"object"==typeof e}e.exports=function(e,t,r,$){e=b(e)?e:function(e){return e?function(e,t){for(var r=-1,o=e?e.length:0,a=Array(o);++r<o;)a[r]=t(e[r],r,e);return a}(b(e)?function(e,t){var r,o,a,i,s=v(e)||S(o=r=e)&&b(o)&&h.call(r,"callee")&&(!m.call(r,"callee")||"[object Arguments]"==f.call(r))?function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}(e.length,String):[],n=s.length,l=!!n;for(var u in e){h.call(e,u)&&!(l&&("length"==u||(a=u,(i=null==(i=n)?0x1fffffffffffff:i)&&("number"==typeof a||c.test(a))&&a>-1&&a%1==0&&a<i)))&&s.push(u)}return s}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return y(e);var t,r,o=[];for(var a in Object(e))h.call(e,a)&&"constructor"!=a&&o.push(a);return o}(e),function(t){return e[t]}):[]}(e),r=r&&!$?(R=(E=(w=r)?(w=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||S(t)&&"[object Symbol]"==f.call(t))return a;if(_(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=_(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=n.test(e);return o||l.test(e)?u(e.slice(2),o?2:8):s.test(e)?a:+e}(w))===o||w===-o?(w<0?-1:1)*17976931348623157e292:w==w?w:0:0===w?w:0)%1,E==E?R?E-R:E:0):0;var w,E,R,P,k=e.length;return r<0&&(r=g(k+r,0)),"string"==typeof(P=e)||!v(P)&&S(P)&&"[object String]"==f.call(P)?r<=k&&e.indexOf(t,r)>-1:!!k&&function(e,t,r){if(t!=t){for(var o=e.length,a=r+-1;++a<o;)if(d(e[a],a,e))return a;return -1}for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return -1}(e,t,r)>-1}},6782(e){var t=Object.prototype.toString;e.exports=function(e){var r;return!0===e||!1===e||!!(r=e)&&"object"==typeof r&&"[object Boolean]"==t.call(e)}},5250(e){var t=1/0,r=0/0,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,n=parseInt,l=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var u,d,p;return"number"==typeof e&&e==(p=(d=(u=e)?(u=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(c(e)){var t,u="function"==typeof e.valueOf?e.valueOf():e;e=c(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var d=i.test(e);return d||s.test(e)?n(e.slice(2),d?2:8):a.test(e)?r:+e}(u))===t||u===-t?(u<0?-1:1)*17976931348623157e292:u==u?u:0:0===u?u:0)%1,d==d?p?d-p:d:0)}},8094(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},6052(e){var t,r,o=Object.prototype,a=Function.prototype.toString,i=o.hasOwnProperty,s=a.call(Object),n=o.toString,l=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!(e&&"object"==typeof e)||"[object Object]"!=n.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=l(e);if(null===t)return!0;var r=i.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==s}},1251(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var o;return"string"==typeof e||!r(e)&&!!(o=e)&&"object"==typeof o&&"[object String]"==t.call(e)}},8430(e){var t=1/0,r=0/0,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,n=parseInt,l=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var u,d,p,h,f=2,m=e;if("function"!=typeof m)throw TypeError("Expected a function");return p=(d=(u=f)?(u=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(c(e)){var t,u="function"==typeof e.valueOf?e.valueOf():e;e=c(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var d=i.test(e);return d||s.test(e)?n(e.slice(2),d?2:8):a.test(e)?r:+e}(u))===t||u===-t?(u<0?-1:1)*17976931348623157e292:u==u?u:0:0===u?u:0)%1,f=d==d?p?d-p:d:0,function(){return--f>0&&(h=m.apply(this,arguments)),f<=1&&(m=void 0),h}}},3866(e){function t(e,t,r,o){return Math.round(e/r)+" "+o+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var o,a,i,s,n=typeof e;if("string"===n&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(c){var u=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"weeks":case"week":case"w":return 6048e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:break}}}return}if("number"===n&&isFinite(e)){return r.long?(a=Math.abs(o=e))>=864e5?t(o,a,864e5,"day"):a>=36e5?t(o,a,36e5,"hour"):a>=6e4?t(o,a,6e4,"minute"):a>=1e3?t(o,a,1e3,"second"):o+" ms":(s=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":s>=36e5?Math.round(i/36e5)+"h":s>=6e4?Math.round(i/6e4)+"m":s>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9695(e){"use strict";let t=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};e.exports=t,e.exports.default=t},6608(e,t,r){var o=r(181),a=o.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(i(o,t),t.Buffer=s),s.prototype=Object.create(a.prototype),i(a,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return a(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var o=a(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return a(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o.SlowBuffer(e)}},8610(e,t,r){"use strict";let o=Symbol("SemVer ANY");class a{static get ANY(){return o}constructor(e,t){if(t=i(t),e instanceof a)if(!!t.loose===e.loose)return e;else e=e.value;c("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===o?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){let t=this.options.loose?s[n.COMPARATORLOOSE]:s[n.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=o}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===o||e===o)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof a))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=a;let i=r(4621),{safeRe:s,t:n}=r(152),l=r(5461),c=r(674),u=r(2398),d=r(2069)},2069(e,t,r){"use strict";let o=/\s+/g;class a{constructor(e,t){if(t=s(t),e instanceof a)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new a(e.raw,t);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(o," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=i.get(t);if(r)return r;let o=this.options.loose,a=o?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];l("hyphen replace",e=e.replace(a,x(this.options.includePrerelease))),l("comparator trim",e=e.replace(u[d.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(u[d.TILDETRIM],h)),l("caret trim",e=e.replace(u[d.CARETTRIM],f));let s=e.split(" ").map(e=>_(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options));o&&(s=s.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),l("range list",s);let c=new Map;for(let e of s.map(e=>new n(e,this.options))){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");let v=[...c.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof a))throw TypeError("a Range is required");return this.set.some(r=>b(r,t)&&e.set.some(e=>b(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}}e.exports=a;let i=new(r(2044)),s=r(4621),n=r(8610),l=r(674),c=r(2398),{safeRe:u,t:d,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:f}=r(152),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(5076),g=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let r=!0,o=e.slice(),a=o.pop();for(;r&&o.length;)r=o.every(e=>a.intersects(e,t)),a=o.pop();return r},_=(e,t)=>(l("comp",e=e.replace(u[d.BUILD],""),t),l("caret",e=E(e,t)),l("tildes",e=$(e,t)),l("xrange",e=P(e,t)),l("stars",e=T(e,t)),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,$=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{let r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,o,a,i)=>{let s;return l("tilde",e,t,r,o,a,i),S(r)?s="":S(o)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:S(a)?s=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?(l("replaceTilde pr",i),s=`>=${r}.${o}.${a}-${i} <${r}.${+o+1}.0-0`):s=`>=${r}.${o}.${a} <${r}.${+o+1}.0-0`,l("tilde return",s),s})},E=(e,t)=>e.trim().split(/\s+/).map(e=>R(e,t)).join(" "),R=(e,t)=>{l("caret",e,t);let r=t.loose?u[d.CARETLOOSE]:u[d.CARET],o=t.includePrerelease?"-0":"";return e.replace(r,(t,r,a,i,s)=>{let n;return l("caret",e,t,r,a,i,s),S(r)?n="":S(a)?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:S(i)?n="0"===r?`>=${r}.${a}.0${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.0${o} <${+r+1}.0.0-0`:s?(l("replaceCaret pr",s),n="0"===r?"0"===a?`>=${r}.${a}.${i}-${s} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}-${s} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i}-${s} <${+r+1}.0.0-0`):(l("no pr"),n="0"===r?"0"===a?`>=${r}.${a}.${i}${o} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i} <${+r+1}.0.0-0`),l("caret return",n),n})},P=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();let r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,o,a,i,s,n)=>{l("xRange",e,r,o,a,i,s,n);let c=S(a),u=c||S(i),d=u||S(s);return"="===o&&d&&(o=""),n=t.includePrerelease?"-0":"",c?r=">"===o||"<"===o?"<0.0.0-0":"*":o&&d?(u&&(i=0),s=0,">"===o?(o=">=",u?(a=+a+1,i=0):i=+i+1,s=0):"<="===o&&(o="<",u?a=+a+1:i=+i+1),"<"===o&&(n="-0"),r=`${o+a}.${i}.${s}${n}`):u?r=`>=${a}.0.0${n} <${+a+1}.0.0-0`:d&&(r=`>=${a}.${i}.0${n} <${a}.${+i+1}.0-0`),l("xRange return",r),r})},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),O=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),x=e=>(t,r,o,a,i,s,n,l,c,u,d,p)=>(r=S(o)?"":S(a)?`>=${o}.0.0${e?"-0":""}`:S(i)?`>=${o}.${a}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`,l=S(c)?"":S(u)?`<${+c+1}.0.0-0`:S(d)?`<${c}.${+u+1}.0-0`:p?`<=${c}.${u}.${d}-${p}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),j=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(l(e[r].semver),e[r].semver!==n.ANY&&e[r].semver.prerelease.length>0){let o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}},2398(e,t,r){"use strict";let o=r(674),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=r(5076),{safeRe:s,t:n}=r(152),l=r(4621),{compareIdentifiers:c}=r(9101);class u{constructor(e,t){if(t=l(t),e instanceof u)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>a)throw TypeError(`version is longer than ${a} characters`);o("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[n.LOOSE]:s[n.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(o("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof u||(e=new u(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],a=e.prerelease[t];if(o("prerelease compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return -1;else if(r===a)continue;else return c(r,a)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{let r=this.build[t],a=e.build[t];if(o("build compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return -1;else if(r===a)continue;else return c(r,a)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?s[n.PRERELEASELOOSE]:s[n.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(r);if(0===this.prerelease.length)this.prerelease=[e];else{let o=this.prerelease.length;for(;--o>=0;)"number"==typeof this.prerelease[o]&&(this.prerelease[o]++,o=-2);if(-1===o){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let o=[t,e];!1===r&&(o=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},5608(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5461(e,t,r){"use strict";let o=r(8271),a=r(733),i=r(1686),s=r(6479),n=r(7257),l=r(5850);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return o(e,r,c);case"!=":return a(e,r,c);case">":return i(e,r,c);case">=":return s(e,r,c);case"<":return n(e,r,c);case"<=":return l(e,r,c);default:throw TypeError(`Invalid operator: ${t}`)}}},7771(e,t,r){"use strict";let o=r(2398),a=r(6802),{safeRe:i,t:s}=r(152);e.exports=(e,t)=>{if(e instanceof o)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let o,a=t.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL];for(;(o=a.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),a.lastIndex=o.index+o[1].length+o[2].length;a.lastIndex=-1}else r=e.match(t.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);if(null===r)return null;let n=r[2],l=r[3]||"0",c=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return a(`${n}.${l}.${c}${u}${d}`,t)}},8767(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r)=>{let a=new o(e,r),i=new o(t,r);return a.compare(i)||a.compareBuild(i)}},6293(e,t,r){"use strict";let o=r(6958);e.exports=(e,t)=>o(e,t,!0)},6958(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r)=>new o(e,r).compare(new o(t,r))},3086(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,null,!0),a=o(t,null,!0),i=r.compare(a);if(0===i)return null;let s=i>0,n=s?r:a,l=s?a:r,c=!!n.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(n))return l.minor&&!l.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==a.major?u+"major":r.minor!==a.minor?u+"minor":r.patch!==a.patch?u+"patch":"prerelease"}},8271(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0===o(e,t,r)},1686(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(e,t,r)>0},6479(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(e,t,r)>=0},3625(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r,a,i)=>{"string"==typeof r&&(i=a,a=r,r=void 0);try{return new o(e instanceof o?e.version:e,r).inc(t,a,i).version}catch(e){return null}}},7257(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0>o(e,t,r)},5850(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0>=o(e,t,r)},7744(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).major},4812(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).minor},733(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0!==o(e,t,r)},6802(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r=!1)=>{if(e instanceof o)return e;try{return new o(e,t)}catch(e){if(!r)return null;throw e}}},8643(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).patch},9283(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,t);return r&&r.prerelease.length?r.prerelease:null}},7032(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(t,e,r)},9839(e,t,r){"use strict";let o=r(8767);e.exports=(e,t)=>e.sort((e,r)=>o(r,e,t))},4056(e,t,r){"use strict";let o=r(2069);e.exports=(e,t,r)=>{try{t=new o(t,r)}catch(e){return!1}return t.test(e)}},7697(e,t,r){"use strict";let o=r(8767);e.exports=(e,t)=>e.sort((e,r)=>o(e,r,t))},6807(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,t);return r?r.version:null}},3895(e,t,r){"use strict";let o=r(152),a=r(5076),i=r(2398),s=r(9101),n=r(6802),l=r(6807),c=r(5608),u=r(3625),d=r(3086),p=r(7744),h=r(4812),f=r(8643),m=r(9283),y=r(6958),g=r(7032),v=r(6293),b=r(8767),_=r(7697),S=r(9839),$=r(1686),w=r(7257),E=r(8271),R=r(733),P=r(6479),k=r(5850),T=r(5461),O=r(7771),x=r(8610),j=r(2069),C=r(4056),N=r(6613),I=r(7114),A=r(1008),M=r(203),q=r(5372),z=r(4713),L=r(4497),D=r(9272),U=r(3490);e.exports={parse:n,valid:l,clean:c,inc:u,diff:d,major:p,minor:h,patch:f,prerelease:m,compare:y,rcompare:g,compareLoose:v,compareBuild:b,sort:_,rsort:S,gt:$,lt:w,eq:E,neq:R,gte:P,lte:k,cmp:T,coerce:O,Comparator:x,Range:j,satisfies:C,toComparators:N,maxSatisfying:I,minSatisfying:A,minVersion:M,validRange:q,outside:z,gtr:L,ltr:D,intersects:U,simplifyRange:r(4039),subset:r(22),SemVer:i,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},5076(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},674(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},9101(e){"use strict";let t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;let o=t.test(e),a=t.test(r);return o&&a&&(e*=1,r*=1),e===r?0:o&&!a?-1:a&&!o?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},2044(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},4621(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},152(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=r(5076),s=r(674),n=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],d=t.t={},p=0,h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,a]],m=(e,t,r)=>{let o=(e=>{for(let[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),a=p++;s(e,a,t),d[e]=a,c[a]=t,u[a]=o,n[a]=new RegExp(t,r?"g":void 0),l[a]=new RegExp(o,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),m("MAINVERSION",`(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[d.PRERELEASEIDENTIFIER]}(?:\\.${c[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${h}+`),m("BUILD",`(?:\\+(${c[d.BUILDIDENTIFIER]}(?:\\.${c[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[d.MAINVERSION]}${c[d.PRERELEASE]}?${c[d.BUILD]}?`),m("FULL",`^${c[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[d.MAINVERSIONLOOSE]}${c[d.PRERELEASELOOSE]}?${c[d.BUILD]}?`),m("LOOSE",`^${c[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:${c[d.PRERELEASE]})?${c[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:${c[d.PRERELEASELOOSE]})?${c[d.BUILD]}?)?)?`),m("XRANGE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${o}})(?:\\.(\\d{1,${o}}))?(?:\\.(\\d{1,${o}}))?`),m("COERCE",`${c[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[d.COERCEPLAIN]+`(?:${c[d.PRERELEASE]})?`+`(?:${c[d.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",c[d.COERCE],!0),m("COERCERTLFULL",c[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${c[d.LONECARET]}${c[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[d.LONECARET]}${c[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[d.GTLT]}\\s*(${c[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]}|${c[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[d.XRANGEPLAIN]})\\s+-\\s+(${c[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4497(e,t,r){"use strict";let o=r(4713);e.exports=(e,t,r)=>o(e,t,">",r)},3490(e,t,r){"use strict";let o=r(2069);e.exports=(e,t,r)=>(e=new o(e,r),t=new o(t,r),e.intersects(t,r))},9272(e,t,r){"use strict";let o=r(4713);e.exports=(e,t,r)=>o(e,t,"<",r)},7114(e,t,r){"use strict";let o=r(2398),a=r(2069);e.exports=(e,t,r)=>{let i=null,s=null,n=null;try{n=new a(t,r)}catch(e){return null}return e.forEach(e=>{n.test(e)&&(!i||-1===s.compare(e))&&(s=new o(i=e,r))}),i}},1008(e,t,r){"use strict";let o=r(2398),a=r(2069);e.exports=(e,t,r)=>{let i=null,s=null,n=null;try{n=new a(t,r)}catch(e){return null}return e.forEach(e=>{n.test(e)&&(!i||1===s.compare(e))&&(s=new o(i=e,r))}),i}},203(e,t,r){"use strict";let o=r(2398),a=r(2069),i=r(1686);e.exports=(e,t)=>{e=new a(e,t);let r=new o("0.0.0");if(e.test(r)||(r=new o("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let a=e.set[t],s=null;a.forEach(e=>{let t=new o(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!s||i(t,s))&&(s=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),s&&(!r||i(r,s))&&(r=s)}return r&&e.test(r)?r:null}},4713(e,t,r){"use strict";let o=r(2398),a=r(8610),{ANY:i}=a,s=r(2069),n=r(4056),l=r(1686),c=r(7257),u=r(5850),d=r(6479);e.exports=(e,t,r,p)=>{let h,f,m,y,g;switch(e=new o(e,p),t=new s(t,p),r){case">":h=l,f=u,m=c,y=">",g=">=";break;case"<":h=c,f=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(n(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null,n=null;if(o.forEach(e=>{e.semver===i&&(e=new a(">=0.0.0")),s=s||e,n=n||e,h(e.semver,s.semver,p)?s=e:m(e.semver,n.semver,p)&&(n=e)}),s.operator===y||s.operator===g||(!n.operator||n.operator===y)&&f(e,n.semver)||n.operator===g&&m(e,n.semver))return!1}return!0}},4039(e,t,r){"use strict";let o=r(4056),a=r(6958);e.exports=(e,t,r)=>{let i=[],s=null,n=null,l=e.sort((e,t)=>a(e,t,r));for(let e of l)o(e,t,r)?(n=e,s||(s=e)):(n&&i.push([s,n]),n=null,s=null);s&&i.push([s,null]);let c=[];for(let[e,t]of i)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");let u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},22(e,t,r){"use strict";let o=r(2069),a=r(8610),{ANY:i}=a,s=r(4056),n=r(6958),l=[new a(">=0.0.0-0")],c=[new a(">=0.0.0")],u=(e,t,r)=>{let o,a,u,h,f,m,y;if(e===t)return!0;if(1===e.length&&e[0].semver===i)if(1===t.length&&t[0].semver===i)return!0;else e=r.includePrerelease?l:c;if(1===t.length&&t[0].semver===i)if(r.includePrerelease)return!0;else t=c;let g=new Set;for(let t of e)">"===t.operator||">="===t.operator?o=d(o,t,r):"<"===t.operator||"<="===t.operator?a=p(a,t,r):g.add(t.semver);if(g.size>1)return null;if(o&&a&&((u=n(o.semver,a.semver,r))>0||0===u&&(">="!==o.operator||"<="!==a.operator)))return null;for(let e of g){if(o&&!s(e,String(o),r)||a&&!s(e,String(a),r))return null;for(let o of t)if(!s(e,String(o),r))return!1;return!0}let v=!!a&&!r.includePrerelease&&!!a.semver.prerelease.length&&a.semver,b=!!o&&!r.includePrerelease&&!!o.semver.prerelease.length&&o.semver;for(let e of(v&&1===v.prerelease.length&&"<"===a.operator&&0===v.prerelease[0]&&(v=!1),t)){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,o){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if((h=d(o,e,r))===e&&h!==o)return!1}else if(">="===o.operator&&!s(o.semver,String(e),r))return!1}if(a){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if((f=p(a,e,r))===e&&f!==a)return!1}else if("<="===a.operator&&!s(a.semver,String(e),r))return!1}if(!e.operator&&(a||o)&&0!==u)return!1}return(!o||!m||!!a||0===u)&&(!a||!y||!!o||0===u)&&!b&&!v&&!0},d=(e,t,r)=>{if(!e)return t;let o=n(e.semver,t.semver,r);return o>0?e:o<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let o=n(e.semver,t.semver,r);return o<0?e:o>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new o(e,r),t=new o(t,r);let a=!1;e:for(let o of e.set){for(let e of t.set){let t=u(o,e,r);if(a=a||null!==t,t)continue e}if(a)return!1}return!0}},6613(e,t,r){"use strict";let o=r(2069);e.exports=(e,t)=>new o(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},5372(e,t,r){"use strict";let o=r(2069);e.exports=(e,t)=>{try{return new o(e,t).range||"*"}catch(e){return null}}},600(e,t,r){"use strict";let o=r(9638);e.exports=(e="")=>{let t=e.match(o);if(!t)return null;let[r,a]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?a:a?`${i} ${a}`:i}},9638(e){"use strict";e.exports=/^#!(.*)/},1905(e,t,r){let o="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,a=r(6928),i=o?";":":",s=r(9344),n=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],s=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=o?s.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==n[0]&&n.unshift(""),{pathEnv:a,pathExt:n,pathExtExe:s}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:i,pathExtExe:c}=l(e,t),u=[],d=r=>new Promise((i,s)=>{if(r===o.length)return t.all&&u.length?i(u):s(n(e));let l=o[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(c,e);i(p(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),p=(e,r,o)=>new Promise((a,n)=>{if(o===i.length)return a(d(r+1));let l=i[o];s(e+l,{pathExt:c},(i,s)=>{if(!i&&s)if(!t.all)return a(e+l);else u.push(e+l);return a(p(e,r,o+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};e.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:o,pathExtExe:i}=l(e,t=t||{}),c=[];for(let n=0;n<r.length;n++){let l=r[n],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(u,e),p=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<o.length;e++){let r=p+o[e];try{if(s.sync(r,{pathExt:i}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw n(e)}},181(e){"use strict";e.exports=require("buffer")},5317(e){"use strict";e.exports=require("child_process")},6982(e){"use strict";e.exports=require("crypto")},9896(e){"use strict";e.exports=require("fs")},7598(e){"use strict";e.exports=require("node:crypto")},857(e){"use strict";e.exports=require("os")},6928(e){"use strict";e.exports=require("path")},2203(e){"use strict";e.exports=require("stream")},9023(e){"use strict";e.exports=require("util")},4953(t){"use strict";t.exports=e},4891(e,t,r){"use strict";let o;r.d(t,{importJWK:()=>G,importPKCS8:()=>B,SignJWT:()=>U});let a=new TextEncoder,i=new TextDecoder;function s(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}function n(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function l(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:i.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=i.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return n(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function c(e){let t=e;return("string"==typeof t&&(t=a.encode(t)),Uint8Array.prototype.toBase64)?t.toBase64({alphabet:"base64url",omitPadding:!0}):(function(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=[];for(let r=0;r<e.length;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join(""))})(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class u extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class d extends u{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class p extends u{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class h extends u{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class f extends u{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t)}}let m=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function y(e,t){if(parseInt(e.hash.name.slice(4),10)!==t)throw m(`SHA-${t}`,"algorithm.hash")}function g(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let v=(e,t,...r)=>g(`Key for the ${e} algorithm must be `,t,...r);async function b(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(((e,...t)=>g("Key must be ",e,...t))(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}return!function(e,t,r){switch(t){case"HS256":case"HS384":case"HS512":if("HMAC"!==e.algorithm.name)throw m("HMAC");y(e.algorithm,parseInt(t.slice(2),10));break;case"RS256":case"RS384":case"RS512":if("RSASSA-PKCS1-v1_5"!==e.algorithm.name)throw m("RSASSA-PKCS1-v1_5");y(e.algorithm,parseInt(t.slice(2),10));break;case"PS256":case"PS384":case"PS512":if("RSA-PSS"!==e.algorithm.name)throw m("RSA-PSS");y(e.algorithm,parseInt(t.slice(2),10));break;case"Ed25519":case"EdDSA":if("Ed25519"!==e.algorithm.name)throw m("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":let o;if(o=e.algorithm,o.name!==t)throw m(t);break;case"ES256":case"ES384":case"ES512":{if("ECDSA"!==e.algorithm.name)throw m("ECDSA");let r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw m(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}if(r&&!e.usages.includes(r))throw TypeError(`CryptoKey does not support this operation, its usages must include ${r}.`)}(t,e,r),t}async function _(e,t,r){let o=await b(e,t,"sign");return!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}(e,o),new Uint8Array(await crypto.subtle.sign(function(e,t){let r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new d(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,o.algorithm),o,r))}function S(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}let $=e=>S(e)&&"string"==typeof e.kty,w=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},E=e=>e?.[Symbol.toStringTag]==="KeyObject",R=e=>w(e)||E(e),P=e=>e?.[Symbol.toStringTag],k=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let o;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):o=r;break;case e.startsWith("PBES2"):o="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):o=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):o="wrapKey";break;case"decrypt"===r:o=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(o&&t.key_ops?.includes?.(o)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${o}" when present`)}return!0},T='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function O(e){if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new d(T)}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new d(T)}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[e.alg]},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new d(T)}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new d(T)}break;default:throw new d('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o={...e};return"AKP"!==o.kty&&delete o.alg,delete o.use,crypto.subtle.importKey("jwk",o,t,e.ext??(!e.d&&!e.priv),e.key_ops??r)}let x="given KeyObject instance cannot be used for this algorithm",j=async(e,t,r,a=!1)=>{let i=(o||=new WeakMap).get(e);if(i?.[r])return i[r];let s=await O({...t,alg:r});return a&&Object.freeze(e),i?i[r]=s:o.set(e,{[r]:s}),s};async function C(e,t){if(e instanceof Uint8Array||w(e))return e;if(E(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{let r,a=(o||=new WeakMap).get(e);if(a?.[t])return a[t];let i="public"===e.type,s=!!i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(x)}r=e.toCryptoKey(e.asymmetricKeyType,s,i?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw TypeError(x);r=e.toCryptoKey(e.asymmetricKeyType,s,[i?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError(x);r=e.toCryptoKey(e.asymmetricKeyType,s,[i?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let o;switch(t){case"RSA-OAEP":o="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":o="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":o="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":o="SHA-512";break;default:throw TypeError(x)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:o},s,i?["encrypt"]:["decrypt"]);r=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:o},s,[i?"verify":"sign"])}if("ec"===e.asymmetricKeyType){let o=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!o)throw TypeError(x);let a={ES256:"P-256",ES384:"P-384",ES512:"P-521"};a[t]&&o===a[t]&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:o},s,[i?"verify":"sign"])),t.startsWith("ECDH-ES")&&(r=e.toCryptoKey({name:"ECDH",namedCurve:o},s,i?[]:["deriveBits"]))}if(!r)throw TypeError(x);return a?a[t]=r:o.set(e,{[t]:r}),r})(e,t)}catch(e){if(e instanceof TypeError)throw e}let r=e.export({format:"jwk"});return j(e,r,t)}if($(e))return e.k?l(e.k):j(e,e,t,!0);throw Error("unreachable")}function N(e,t){if(e)throw TypeError(`${t} can only be called once`)}Symbol();class I{#e;#t;#r;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#e=e}setProtectedHeader(e){return N(this.#t,"setProtectedHeader"),this.#t=e,this}setUnprotectedHeader(e){return N(this.#r,"setUnprotectedHeader"),this.#r=e,this}async sign(e,t){let r,o,a,i;if(!this.#t&&!this.#r)throw new p("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!function(...e){let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0}(this.#t,this.#r))throw new p("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this.#t,...this.#r},l=function(e,t,r,o,a){let i;if(void 0!==a.crit&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||void 0===o.crit)return new Set;if(!Array.isArray(o.crit)||0===o.crit.length||o.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let s of(i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,o.crit)){if(!i.has(s))throw new d(`Extension Header Parameter "${s}" is not recognized`);if(void 0===a[s])throw new e(`Extension Header Parameter "${s}" is missing`);if(i.get(s)&&void 0===o[s])throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(o.crit)}(p,new Map([["b64",!0]]),t?.crit,this.#t,n),u=!0;if(l.has("b64")&&"boolean"!=typeof(u=this.#t.b64))throw new p('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:h}=n;if("string"!=typeof h||!h)throw new p('JWS "alg" (Algorithm) Header Parameter missing or invalid');var f="sign";switch(h.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,r)=>{if(!(t instanceof Uint8Array)){if($(t)){if("oct"===t.kty&&"string"==typeof t.k&&k(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!R(t))throw TypeError(v(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError(`${P(t)} instances for symmetric algorithms must be of type "secret"`)}})(h,e,f);break;default:((e,t,r)=>{if($(t))switch(r){case"decrypt":case"sign":if("oct"!==t.kty&&("AKP"===t.kty&&"string"==typeof t.priv||"string"==typeof t.d)&&k(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if("oct"!==t.kty&&void 0===t.d&&void 0===t.priv&&k(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!R(t))throw TypeError(v(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError(`${P(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(r){case"sign":throw TypeError(`${P(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${P(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(r){case"verify":throw TypeError(`${P(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${P(t)} instances for asymmetric algorithm encryption must be of type "public"`)}})(h,e,f)}u?o=s(r=c(this.#e)):(o=this.#e,r=""),this.#t?i=s(a=c(JSON.stringify(this.#t))):(a="",i=new Uint8Array);let m=function(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let o of e)t.set(o,r),r+=o.length;return t}(i,s("."),o),y=await C(e,h),g={signature:c(await _(h,y,m)),payload:r};return this.#r&&(g.header=this.#r),this.#t&&(g.protected=a),g}}class A{#o;constructor(e){this.#o=new I(e)}setProtectedHeader(e){return this.#o.setProtectedHeader(e),this}async sign(e,t){let r=await this.#o.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}let M=e=>Math.floor(e.getTime()/1e3),q=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function z(e){let t,r=q.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let o=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(o);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*o);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*o);break;case"day":case"days":case"d":t=Math.round(86400*o);break;case"week":case"weeks":case"w":t=Math.round(604800*o);break;default:t=Math.round(0x1e187e0*o)}return"-"===r[1]||"ago"===r[4]?-t:t}function L(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}class D{#e;constructor(e){if(!S(e))throw TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(e)}data(){return a.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(e){this.#e.iss=e}get sub(){return this.#e.sub}set sub(e){this.#e.sub=e}get aud(){return this.#e.aud}set aud(e){this.#e.aud=e}set jti(e){this.#e.jti=e}set nbf(e){"number"==typeof e?this.#e.nbf=L("setNotBefore",e):e instanceof Date?this.#e.nbf=L("setNotBefore",M(e)):this.#e.nbf=M(new Date)+z(e)}set exp(e){"number"==typeof e?this.#e.exp=L("setExpirationTime",e):e instanceof Date?this.#e.exp=L("setExpirationTime",M(e)):this.#e.exp=M(new Date)+z(e)}set iat(e){void 0===e?this.#e.iat=M(new Date):e instanceof Date?this.#e.iat=L("setIssuedAt",M(e)):"string"==typeof e?this.#e.iat=L("setIssuedAt",M(new Date)+z(e)):this.#e.iat=L("setIssuedAt",e)}}class U{#t;#a;constructor(e={}){this.#a=new D(e)}setIssuer(e){return this.#a.iss=e,this}setSubject(e){return this.#a.sub=e,this}setAudience(e){return this.#a.aud=e,this}setJti(e){return this.#a.jti=e,this}setNotBefore(e){return this.#a.nbf=e,this}setExpirationTime(e){return this.#a.exp=e,this}setIssuedAt(e){return this.#a.iat=e,this}setProtectedHeader(e){return this.#t=e,this}async sign(e,t){let r=new A(this.#a.data());if(r.setProtectedHeader(this.#t),Array.isArray(this.#t?.crit)&&this.#t.crit.includes("b64")&&!1===this.#t.b64)throw new h("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}}let V=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},F=e=>{let t=e.data[e.pos++];if(128&t){let r=127&t,o=0;for(let t=0;t<r;t++)o=o<<8|e.data[e.pos++];return o}return t},H=(e,t,r)=>{if(e.data[e.pos++]!==t)throw Error(r)},K=(e,t)=>{let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},J=async(e,t,r,o)=>{let a,i,s="spki"===e,n=()=>s?["verify"]:["sign"];switch(r){case"PS256":case"PS384":case"PS512":a={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},i=n();break;case"RS256":case"RS384":case"RS512":a={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},i=n();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},i=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":a={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[r]},i=n();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{let e=o.getNamedCurve(t);a="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new d("Invalid or unsupported key format")}i=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":a={name:"Ed25519"},i=n();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":a={name:r},i=n();break;default:throw new d('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,a,o?.extractable??!!s,i)};async function B(e,t,r){let o,a,i;if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return o=/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,a=n(e.replace(o,"")),i=r,t?.startsWith?.("ECDH-ES")&&((i||={}).getNamedCurve=e=>{let t,r={data:e,pos:0};return H(r,48,"Invalid PKCS#8 structure"),F(r),H(r,2,"Expected version field"),t=F(r),r.pos+=t,H(r,48,"Expected algorithm identifier"),F(r),r.pos,(e=>{let t,r=(H(e,6,"Expected algorithm OID"),t=F(e),K(e,t));if(V(r,[43,101,110]))return"X25519";if(!V(r,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");H(e,6,"Expected curve OID");let o=F(e),a=K(e,o);for(let{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(V(a,t))return e;throw Error("Unsupported named curve")})(r)}),J("pkcs8",a,t,i)}async function G(e,t,r){let o;if(!S(e))throw TypeError("JWK must be an object");switch(t??=e.alg,o??=r?.extractable??e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return l(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new d('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return O({...e,alg:t,ext:o});case"AKP":if("string"!=typeof e.alg||!e.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw TypeError("JWK alg and alg option value mismatch");return O({...e,ext:o});case"EC":case"OKP":return O({...e,alg:t,ext:o});default:throw new d('Unsupported "kty" (Key Type) Parameter value')}}},4519(e){"use strict";e.exports=JSON.parse('{"name":"dotenv","version":"16.6.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}')},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","description":"The MCP framework","version":"1.1.0","author":{"name":"xmcp","email":"support@xmcp.dev","url":"https://xmcp.dev"},"contributors":[{"name":"Valentina Bearzotti","email":"valebearzotti1@gmail.com","url":"https://github.com/valebearzotti"},{"name":"Jose Rago","email":"jose@basement.studio","url":"https://github.com/ragojose"}],"license":"MIT","keywords":["mcp","modelcontextprotocol","http","stdio"],"repository":{"type":"git","url":"https://github.com/basementstudio/xmcp"},"homepage":"https://xmcp.dev","type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"xmcp":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js","default":"./dist/index.js"},"./host-bridge":{"types":"./dist/host-bridge.d.ts","import":"./dist/host-bridge.js","require":"./dist/host-bridge.js","default":"./dist/host-bridge.js"},"./headers":{"types":"./dist/runtime/headers.d.ts","require":"./dist/runtime/headers.js","default":"./dist/runtime/headers.js"},"./cloudflare":{"types":"./dist/cloudflare.d.ts","import":"./dist/cloudflare.js","require":"./dist/cloudflare.js","default":"./dist/cloudflare.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config.js","require":"./dist/config.js","default":"./dist/config.js"},"./package.json":"./package.json"},"typesVersions":{"*":{"host-bridge":["dist/host-bridge.d.ts"],"headers":["dist/runtime/headers.d.ts"],"cloudflare":["dist/cloudflare.d.ts"],"config":["dist/config/index.d.ts"]}},"files":["dist"],"scripts":{"dev":"cross-env NODE_ENV=development tsx --watch --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","build":"cross-env NODE_ENV=production tsx --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","analyze":"cross-env GENERATE_STATS=true pnpm build && pnpm tsx scripts/analyze-rspack-stats.ts","bench":"tsx bench/run.mts","test:config":"pnpm --dir ../compiler test:config","test:adapters":"node --import tsx --test src/runtime/adapters/fastify/__tests__/*.test.ts","test:runtime":"node --import tsx --test src/runtime/utils/__tests__/*.test.ts src/runtime/utils/ui/__tests__/*.test.ts"},"dependencies":{},"devDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/node":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","@nestjs/common":"^11.1.12","@rspack/core":"^1.6.7","@types/async-retry":"^1.4.9","@types/content-type":"^1.1.9","@types/express":"^5.0.6","@types/fs-extra":"^11.0.4","@types/jsonwebtoken":"^9.0.10","@types/node":"^22.19.2","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","async-retry":"^1.3.3","chalk":"^5.6.2","chokidar":"^3.6.0","ci-info":"^4.3.1","commander":"^11.1.0","content-type":"^1.0.5","cross-env":"^7.0.3","del":"^7.1.0","dotenv":"^16.6.1","express":"^4.22.1","fastify":"^5.0.0","fs-extra":"^11.3.2","glob":"^11.1.0","is-docker":"^4.0.0","is-wsl":"^3.1.0","jose":"^6.1.3","json5":"^2.2.3","jsonwebtoken":"^9.0.3","memfs":"^4.51.1","postcss-loader":"^8.2.0","raw-body":"^3.0.2","reflect-metadata":"^0.2.2","rxjs":"^7.8.2","ts-checker-rspack-plugin":"^1.2.1","tsx":"^4.21.0","typescript":"^5.9.3","zod-to-json-schema":"^3.25.0"},"peerDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","jose":"^6.1.3","react":">=19.0.0","react-dom":">=19.0.0","zod":"^3.25.76 || ^4.0.0"},"peerDependenciesMeta":{"@modelcontextprotocol/client":{"optional":true},"@modelcontextprotocol/server":{"optional":true},"jose":{"optional":true},"react":{"optional":true},"react-dom":{"optional":true}}}')}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var a=Object.create(null);i.r(a);var s={};t=t||[null,r({}),r([]),r(r)];for(var n=2&o&&e;("object"==typeof n||"function"==typeof n)&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach(t=>{s[t]=()=>e[t]});return s.default=()=>e,i.d(a,s),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";let e,t,r,o,a,n,l,c,u;i.r(s),i.d(s,{HOST_CONTEXT_CHANGED_METHOD:()=>fH,isEnvHeader:()=>fE,createSTDIOClient:()=>fx,INITIALIZE_METHOD:()=>fM,LOG_MESSAGE_METHOD:()=>fV,OPEN_LINK_METHOD:()=>fL,REQUEST_DISPLAY_MODE_METHOD:()=>fz,inputResponse:()=>n1,disconnectSTDIOClient:()=>fN,isInputRequiredResult:()=>nU,callSTDIOClientTool:()=>fC,headersToRecord:()=>fR,MCP_APPS_PROTOCOL_VERSION:()=>fA,extractToolNamesFromRequest:()=>fI,UI_MESSAGE_METHOD:()=>fU,completable:()=>cL,acceptedContent:()=>n0,listSTDIOClientTools:()=>fj,UPDATE_MODEL_CONTEXT_METHOD:()=>fD,UrlElicitationRequiredError:()=>nA,createRequestStateCodec:()=>cV,createMcpHostBridge:()=>fG,SIZE_CHANGED_METHOD:()=>fK,INITIALIZED_METHOD:()=>fq,inputRequired:()=>nQ,RESOURCES_READ_METHOD:()=>fF,createContext:()=>N,jwtAuthMiddleware:()=>O,createHTTPClient:()=>fO,apiKeyAuthMiddleware:()=>P});var d,p,h,f,m,y,g,v,b,_,S=i(8583),$=i.n(S),w=i(4953);let E=w.z.object({apiKey:w.z.string().optional(),headerName:w.z.string().optional(),validateApiKey:w.z.function().args(w.z.string()).returns(w.z.promise(w.z.boolean())).optional()}).strict().refine(e=>void 0!==e.apiKey||void 0!==e.validateApiKey,{message:"Either 'apiKey' or 'validateApiKey' must be provided"}).refine(e=>void 0===e.apiKey||void 0===e.validateApiKey,{message:"'apiKey' and 'validateApiKey' are mutually exclusive - provide only one"}),R="Unauthorized: Missing or invalid API key";function P(e){let t=E.safeParse(e);if(!t.success){let r="apiKey"in e,o="validateApiKey"in e;if(r&&o)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||o)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",o="apiKey"in e?e.apiKey:void 0,a="validateApiKey"in e?e.validateApiKey:void 0;return async(t,i,s)=>{let n=t.header(r);!n||"apiKey"in e&&n!==o||a&&!await a(n)?i.status(401).json({error:R}):s()}}var k=i(8400),T=i.n(k);function O(e){return(t,r,o)=>{let a=t.header("Authorization");if(!a||!a.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let i=a.slice(7).trim();if(!i)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...a}=e;t.user=T().verify(i,r,a),o()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let x=require("async_hooks"),j=(e,t)=>{globalThis[e]=t},C=e=>globalThis[e];function N({name:e}){let t=Symbol.for(`xmcp-context-${e}`),r=Symbol.for(`xmcp-context-${e}-fallback-store`);if(C(t))return C(t);let o=new x.AsyncLocalStorage,a=globalThis[r]??{current:null};j(r,a);let i={provider:(e,t)=>(a.current=e,o.run(e,t)),getContext:()=>{let t=o.getStore();if(t)return t;if(a.current)return a.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:t=>{let r=o.getStore()??a.current;if(!r)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(r,t)}};return j(t,i),i}var I=Object.create,A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,q=Object.getOwnPropertyNames,z=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);let U=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),V=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),F=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),H=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),K=Object.freeze({status:"aborted"});function J(e,t,r){function o(r,o){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:o,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,o);let a=s.prototype,i=Object.keys(a);for(let e=0;e<i.length;e++){let t=i[e];t in r||(r[t]=a[t].bind(r))}}let a=r?.Parent??Object;class i extends a{}function s(e){var t;let a=r?.Parent?new i:this;for(let r of(o(a,e),(t=a._zod).deferred??(t.deferred=[]),a._zod.deferred))r();return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Symbol("zod_brand");class B extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class G extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(v=globalThis).__zod_globalConfig??(v.__zod_globalConfig={});let Z=globalThis.__zod_globalConfig;function W(e){return e&&Object.assign(Z,e),Z}let X=/^[cC][0-9a-z]{6,}$/,Y=/^[0-9a-z]+$/,Q=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ee=/^[0-9a-vA-V]{20}$/,et=/^[A-Za-z0-9]{27}$/,er=/^[a-zA-Z0-9_-]{21}$/,eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ea=/^([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})$/,ei=e=>e?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)$/,es=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,en=/^(?:(?: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])$/,el=/^(([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}|:))$/,ec=/^((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])$/,eu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ed=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ep=/^[A-Za-z0-9_-]*$/,eh=/^https?$/,ef=/^\+[1-9]\d{6,14}$/,em="(?:(?:\\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])))",ey=RegExp(`^${em}$`);function eg(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let ev=/^-?\d+$/,eb=/^-?\d+(?:\.\d+)?$/,e_=/^(?:true|false)$/i,eS=/^null$/i,e$=/^[^A-Z]*$/,ew=/^[^a-z]*$/;function eE(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eR(e,t){return"bigint"==typeof t?t.toString():t}function eP(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ek(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let eT=Symbol("evaluating");function eO(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==eT)return void 0===o&&(o=eT,o=r()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ex(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ej(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function eC(e){return JSON.stringify(e)}let eN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eI(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eA=eP(()=>{if(Z.jitless||"undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eM(e){if(!1===eI(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eI(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function eq(e){return eM(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ez=new Set(["string","number","symbol"]);function eL(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eD(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function eU(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let eV={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function eF(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eH(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eK(e){return"string"==typeof e?e:e?.message}function eJ(e,t,r){let o=e.message?e.message:eK(e.inst?._zod.def?.error?.(e))??eK(t?.error?.(e))??eK(r.customError?.(e))??eK(r.localeError?.(e))??"Invalid input",{inst:a,continue:i,input:s,...n}=e;return n.path??(n.path=[]),n.message=o,t?.reportInput&&(n.input=s),n}function eB(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eG(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}let eZ=J("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),eW={number:"number",bigint:"bigint",object:"date"},eX=J("$ZodCheckLessThan",(e,t)=>{eZ.init(e,t);let r=eW[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eY=J("$ZodCheckGreaterThan",(e,t)=>{eZ.init(e,t);let r=eW[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eQ=J("$ZodCheckMultipleOf",(e,t)=>{eZ.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{let o,a,i;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0==(a=Math.round(o=r.value/t.value),i=Number.EPSILON*Math.max(Math.abs(o),1),Math.abs(o-a)<i?0:o-a))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),e0=J("$ZodCheckNumberFormat",(e,t)=>{eZ.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[a,i]=eV[t.format];e._zod.onattach.push(e=>{let o=e._zod.bag;o.format=t.format,o.minimum=a,o.maximum=i,r&&(o.pattern=ev)}),e._zod.check=s=>{let n=s.value;if(r){if(!Number.isInteger(n))return void s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:n,inst:e});if(!Number.isSafeInteger(n))return void(n>0?s.issues.push({input:n,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:n,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}))}n<a&&s.issues.push({origin:"number",input:n,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),n>i&&s.issues.push({origin:"number",input:n,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),e1=J("$ZodCheckMaxLength",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;if(o.length<=t.maximum)return;let a=eB(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),e2=J("$ZodCheckMinLength",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;if(o.length>=t.minimum)return;let a=eB(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),e9=J("$ZodCheckLengthEquals",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let o=r.value,a=o.length;if(a===t.length)return;let i=eB(o),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),e4=J("$ZodCheckStringFormat",(e,t)=>{var r,o;eZ.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.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})}):(o=e._zod).check??(o.check=()=>{})}),e5=J("$ZodCheckRegex",(e,t)=>{e4.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),e3=J("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=e$),e4.init(e,t)}),e6=J("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ew),e4.init(e,t)}),e8=J("$ZodCheckIncludes",(e,t)=>{eZ.init(e,t);let r=eL(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)}),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})}}),e7=J("$ZodCheckStartsWith",(e,t)=>{eZ.init(e,t);let r=RegExp(`^${eL(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),te=J("$ZodCheckEndsWith",(e,t)=>{eZ.init(e,t);let r=RegExp(`.*${eL(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tt=J("$ZodCheckOverwrite",(e,t)=>{eZ.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tr{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let to=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,eR,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ta=J("$ZodError",to),ti=J("$ZodError",to,{Parent:Error}),ts=e=>(t,r,o,a)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new B;if(s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>eJ(e,i,W())));throw eN(t,a?.callee),t}return s.value},tn=e=>async(t,r,o,a)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>eJ(e,i,W())));throw eN(t,a?.callee),t}return s.value},tl=e=>(t,r,o)=>{let a=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new B;return i.issues.length?{success:!1,error:new(e??ta)(i.issues.map(e=>eJ(e,a,W())))}:{success:!0,data:i.value}},tc=tl(ti),tu=e=>async(t,r,o)=>{let a=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>eJ(e,a,W())))}:{success:!0,data:i.value}},td=tu(ti),tp={major:4,minor:4,patch:3},th=J("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tp;let o=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&o.unshift(e),o))for(let r of t._zod.onattach)r(e);if(0===o.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let o,a=eF(e);for(let i of t){if(i._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(e)||!i._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new B;if(o||s instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(a||(a=eF(e,t)))});else{if(e.issues.length===t)continue;a||(a=eF(e,t))}}return o?o.then(()=>e):e},r=(r,a,i)=>{if(eF(r))return r.aborted=!0,r;let s=t(a,o,i);if(s instanceof Promise){if(!1===i.async)throw new B;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if("backward"===i.direction){let t=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,i)):r(t,a,i)}let s=e._zod.parse(a,i);if(s instanceof Promise){if(!1===i.async)throw new B;return s.then(e=>t(e,o,i))}return t(s,o,i)}}eO(e,"~standard",()=>({validate:t=>{try{let r=tc(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return td(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),tf=J("$ZodString",(e,t)=>{var r;let o;th.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(o=(r=e._zod.bag)?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${o}$`)),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),tm=J("$ZodStringFormat",(e,t)=>{e4.init(e,t),tf.init(e,t)}),ty=J("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ea),tm.init(e,t)}),tg=J("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ei(e))}else t.pattern??(t.pattern=ei());tm.init(e,t)}),tv=J("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=es),tm.init(e,t)}),tb=J("$ZodURL",(e,t)=>{tm.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===eh.source&&!/^https?:\/\//i.test(o))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let a=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=a.href:r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),t_=J("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),tm.init(e,t)}),tS=J("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=er),tm.init(e,t)}),t$=J("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=X),tm.init(e,t)}),tw=J("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Y),tm.init(e,t)}),tE=J("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Q),tm.init(e,t)}),tR=J("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ee),tm.init(e,t)}),tP=J("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=et),tm.init(e,t)}),tk=J("$ZodISODateTime",(e,t)=>{let r,o,a;t.pattern??(r=eg({precision:t.precision}),o=["Z"],t.local&&o.push(""),t.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),a=`${r}(?:${o.join("|")})`,t.pattern=RegExp(`^${em}T(?:${a})$`)),tm.init(e,t)}),tT=J("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ey),tm.init(e,t)}),tO=J("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${eg(t)}$`)),tm.init(e,t)}),tx=J("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eo),tm.init(e,t)}),tj=J("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=en),tm.init(e,t),e._zod.bag.format="ipv4"}),tC=J("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=el),tm.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),tN=J("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ec),tm.init(e,t)}),tI=J("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eu),tm.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(2!==o.length)throw Error();let[e,t]=o;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function tA(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tM=J("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ed),tm.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{tA(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),tq=J("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ep),tm.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!ep.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tA(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tz=J("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ef),tm.init(e,t)}),tL=J("$ZodJWT",(e,t)=>{tm.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[o]=r;if(!o)return!1;let a=JSON.parse(atob(o));if("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),tD=J("$ZodNumber",(e,t)=>{th.init(e,t),e._zod.pattern=e._zod.bag.pattern??eb,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let a=r.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return r;let i="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),r}}),tU=J("$ZodNumberFormat",(e,t)=>{e0.init(e,t),tD.init(e,t)}),tV=J("$ZodBoolean",(e,t)=>{th.init(e,t),e._zod.pattern=e_,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let a=r.value;return"boolean"==typeof a||r.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),r}}),tF=J("$ZodNull",(e,t)=>{th.init(e,t),e._zod.pattern=eS,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let o=t.value;return null===o||t.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),t}}),tH=J("$ZodAny",(e,t)=>{th.init(e,t),e._zod.parse=e=>e}),tK=J("$ZodUnknown",(e,t)=>{th.init(e,t),e._zod.parse=e=>e}),tJ=J("$ZodNever",(e,t)=>{th.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function tB(e,t,r){e.issues.length&&t.issues.push(...eH(r,e.issues)),t.value[r]=e.value}let tG=J("$ZodArray",(e,t)=>{th.init(e,t),e._zod.parse=(r,o)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);let i=[];for(let e=0;e<a.length;e++){let s=a[e],n=t.element._zod.run({value:s,issues:[]},o);n instanceof Promise?i.push(n.then(t=>tB(t,r,e))):tB(n,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function tZ(e,t,r,o,a,i){let s=r in o;if(e.issues.length){if(a&&i&&!s)return;t.issues.push(...eH(r,e.issues))}if(!s&&!a){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?s&&(t.value[r]=void 0):t.value[r]=e.value}function tW(e){var t;let r=Object.keys(e.shape);for(let t of r)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let o=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(o)}}function tX(e,t,r,o,a,i){let s=[],n=a.keySet,l=a.catchall._zod,c=l.def.type,u="optional"===l.optin,d="optional"===l.optout;for(let a in t){if("__proto__"===a||n.has(a))continue;if("never"===c){s.push(a);continue}let i=l.run({value:t[a],issues:[]},o);i instanceof Promise?e.push(i.then(e=>tZ(e,r,a,t,u,d))):tZ(i,r,a,t,u,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length)?Promise.all(e).then(()=>r):r}let tY=J("$ZodObject",(e,t)=>{let r;th.init(e,t);let o=Object.getOwnPropertyDescriptor(t,"shape");if(!o?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let a=eP(()=>tW(t));eO(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let o=e[t]._zod;if(o.values)for(let e of(r[t]??(r[t]=new Set),o.values))r[t].add(e)}return r});let i=t.catchall;e._zod.parse=(t,o)=>{r??(r=a.value);let s=t.value;if(!eI(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let n=[],l=r.shape;for(let e of r.keys){let r=l[e],a="optional"===r._zod.optin,i="optional"===r._zod.optout,c=r._zod.run({value:s[e],issues:[]},o);c instanceof Promise?n.push(c.then(r=>tZ(r,t,e,s,a,i))):tZ(c,t,e,s,a,i)}return i?tX(n,s,t,o,a.value,e):n.length?Promise.all(n).then(()=>t):t}}),tQ=J("$ZodObjectJIT",(e,t)=>{let r,o;tY.init(e,t);let a=e._zod.parse,i=eP(()=>tW(t)),s=!Z.jitless,n=s&&eA.value,l=t.catchall;e._zod.parse=(c,u)=>{o??(o=i.value);let d=c.value;return eI(d)?s&&n&&u?.async===!1&&!0!==u.jitless?(r||(r=(e=>{let t=new tr(["shape","payload","ctx"]),r=i.value,o=e=>{let t=eC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let a=Object.create(null),s=0;for(let e of r.keys)a[e]=`key_${s++}`;for(let i of(t.write("const newResult = {};"),r.keys)){let r=a[i],s=eC(i),n=e[i],l=n?._zod?.optin==="optional",c=n?._zod?.optout==="optional";t.write(`const ${r} = ${o(i)};`),l&&c?t.write(`
8
2
  if (${r}.issues.length) {
9
- if (${n} in input) {
3
+ if (${s} in input) {
10
4
  payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
11
5
  ...iss,
12
- path: iss.path ? [${n}, ...iss.path] : [${n}]
6
+ path: iss.path ? [${s}, ...iss.path] : [${s}]
13
7
  })));
14
8
  }
15
9
  }
16
10
 
17
11
  if (${r}.value === undefined) {
18
- if (${n} in input) {
19
- newResult[${n}] = undefined;
12
+ if (${s} in input) {
13
+ newResult[${s}] = undefined;
20
14
  }
21
15
  } else {
22
- newResult[${n}] = ${r}.value;
16
+ newResult[${s}] = ${r}.value;
23
17
  }
24
18
 
25
19
  `):l?t.write(`
26
20
  if (${r}.issues.length) {
27
21
  payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
28
22
  ...iss,
29
- path: iss.path ? [${n}, ...iss.path] : [${n}]
23
+ path: iss.path ? [${s}, ...iss.path] : [${s}]
30
24
  })));
31
25
  }
32
26
 
33
27
  if (${r}.value === undefined) {
34
- if (${n} in input) {
35
- newResult[${n}] = undefined;
28
+ if (${s} in input) {
29
+ newResult[${s}] = undefined;
36
30
  }
37
31
  } else {
38
- newResult[${n}] = ${r}.value;
32
+ newResult[${s}] = ${r}.value;
39
33
  }
40
34
 
41
35
  `):t.write(`
42
- const ${r}_present = ${n} in input;
36
+ const ${r}_present = ${s} in input;
43
37
  if (${r}.issues.length) {
44
38
  payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
45
39
  ...iss,
46
- path: iss.path ? [${n}, ...iss.path] : [${n}]
40
+ path: iss.path ? [${s}, ...iss.path] : [${s}]
47
41
  })));
48
42
  }
49
43
  if (!${r}_present && !${r}.issues.length) {
@@ -51,22 +45,39 @@
51
45
  code: "invalid_type",
52
46
  expected: "nonoptional",
53
47
  input: undefined,
54
- path: [${n}]
48
+ path: [${s}]
55
49
  });
56
50
  }
57
51
 
58
52
  if (${r}_present) {
59
53
  if (${r}.value === undefined) {
60
- newResult[${n}] = undefined;
54
+ newResult[${s}] = undefined;
61
55
  } else {
62
- newResult[${n}] = ${r}.value;
56
+ newResult[${s}] = ${r}.value;
63
57
  }
64
58
  }
65
59
 
66
- `)}t.write("payload.value = newResult;"),t.write("return payload;");let a=t.compile();return(t,r)=>a(e,t,r)})(t.shape)),u=r(u,c),l)?tR([],d,u,c,s,e):u:o(u,c):(u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u)}});function tC(e,t,r,s){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let o=e.filter(e=>!ek(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>ex(e,s,j())))}),t)}let tA=x("$ZodUnion",(e,t)=>{e4.init(e,t),ec(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),ec(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),ec(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ec(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>el(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(s,o)=>{if(r)return r(s,o);let i=!1,n=[];for(let e of t.options){let t=e._zod.run({value:s.value,issues:[]},o);if(t instanceof Promise)n.push(t),i=!0;else{if(0===t.issues.length)return t;n.push(t)}}return i?Promise.all(n).then(t=>tC(t,s,e,o)):tC(n,s,e,o)}}),tM=x("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,tA.init(e,t);let r=e._zod.parse;ec(e._zod,"propValues",()=>{let e={};for(let r of t.options){let s=r._zod.propValues;if(!s||0===Object.keys(s).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(s))for(let s of(e[t]||(e[t]=new Set),r))e[t].add(s)}return e});let s=ea(()=>{let e=t.options,r=new Map;for(let s of e){let e=s._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,s)}}return r});e._zod.parse=(o,i)=>{let n=o.value;if(!em(n))return o.issues.push({code:"invalid_type",expected:"object",input:n,inst:e}),o;let a=s.value.get(n?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback||"backward"===i.direction?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(s.value.keys()),input:n,path:[t.discriminator],inst:e}),o)}}),tD=x("$ZodIntersection",(e,t)=>{e4.init(e,t),e._zod.parse=(e,r)=>{let s=e.value,o=t.left._zod.run({value:s,issues:[]},r),i=t.right._zod.run({value:s,issues:[]},r);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,r])=>tL(e,t,r)):tL(e,o,i)}});function tL(e,t,r){let s,o=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(s??(s=r),r.keys))o.has(e)||o.set(e,{}),o.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)o.has(e)||o.set(e,{}),o.get(e).r=!0;else e.issues.push(t);let i=[...o].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&s&&e.issues.push({...s,keys:i}),ek(e))return e;let n=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(eg(t)&&eg(r)){let s=Object.keys(r),o=Object.keys(t).filter(e=>-1!==s.indexOf(e)),i={...t,...r};for(let s of o){let o=e(t[s],r[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let s=[];for(let o=0;o<t.length;o++){let i=e(t[o],r[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s.push(i.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!n.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}let tq=x("$ZodRecord",(e,t)=>{e4.init(e,t),e._zod.parse=(r,s)=>{let o=r.value;if(!eg(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[],n=t.keyType._zod.values;if(n){let a;r.value={};let l=new Set;for(let a of n)if("string"==typeof a||"number"==typeof a||"symbol"==typeof a){l.add("number"==typeof a?a.toString():a);let n=t.keyType._zod.run({value:a,issues:[]},s);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(n.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(e=>ex(e,s,j())),input:a,path:[a],inst:e});continue}let u=n.value,c=t.valueType._zod.run({value:o[a],issues:[]},s);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&r.issues.push(...eS(a,e.issues)),r.value[u]=e.value})):(c.issues.length&&r.issues.push(...eS(a,c.issues)),r.value[u]=c.value)}for(let e in o)l.has(e)||(a=a??[]).push(e);a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else for(let n of(r.value={},Reflect.ownKeys(o))){if("__proto__"===n||!Object.prototype.propertyIsEnumerable.call(o,n))continue;let a=t.keyType._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof n&&ee.test(n)&&a.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},s);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?r.value[n]=o[n]:r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ex(e,s,j())),input:n,path:[n],inst:e});continue}let l=t.valueType._zod.run({value:o[n],issues:[]},s);l instanceof Promise?i.push(l.then(e=>{e.issues.length&&r.issues.push(...eS(n,e.issues)),r.value[a.value]=e.value})):(l.issues.length&&r.issues.push(...eS(n,l.issues)),r.value[a.value]=l.value)}return i.length?Promise.all(i).then(()=>r):r}}),tU=x("$ZodEnum",(e,t)=>{e4.init(e,t);let r=ei(t.entries),s=new Set(r);e._zod.values=s,e._zod.pattern=RegExp(`^(${r.filter(e=>e_.has(typeof e)).map(e=>"string"==typeof e?eb(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{let i=t.value;return s.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),tV=x("$ZodLiteral",(e,t)=>{if(e4.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eb(e):e?eb(e.toString()):String(e)).join("|")})$`),e._zod.parse=(s,o)=>{let i=s.value;return r.has(i)||s.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),s}}),tF=x("$ZodTransform",(e,t)=>{e4.init(e,t),e._zod.optin="optional",e._zod.parse=(r,s)=>{if("backward"===s.direction)throw new O(e.constructor.name);let o=t.transform(r.value,r);if(s.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(r.value=e,r.fallback=!0,r));if(o instanceof Promise)throw new P;return r.value=o,r.fallback=!0,r}});function tH(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let tZ=x("$ZodOptional",(e,t)=>{e4.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ec(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ec(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${el(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let s=e.value,o=t.innerType._zod.run(e,r);return o instanceof Promise?o.then(e=>tH(e,s)):tH(o,s)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),tK=x("$ZodExactOptional",(e,t)=>{tZ.init(e,t),ec(e._zod,"values",()=>t.innerType._zod.values),ec(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),tG=x("$ZodNullable",(e,t)=>{e4.init(e,t),ec(e._zod,"optin",()=>t.innerType._zod.optin),ec(e._zod,"optout",()=>t.innerType._zod.optout),ec(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${el(e.source)}|null)$`):void 0}),ec(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),tJ=x("$ZodDefault",(e,t)=>{e4.init(e,t),e._zod.optin="optional",ec(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let s=t.innerType._zod.run(e,r);return s instanceof Promise?s.then(e=>tB(e,t)):tB(s,t)}});function tB(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let tW=x("$ZodPrefault",(e,t)=>{e4.init(e,t),e._zod.optin="optional",ec(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),tX=x("$ZodNonOptional",(e,t)=>{e4.init(e,t),ec(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,s)=>{let o=t.innerType._zod.run(r,s);return o instanceof Promise?o.then(t=>tY(t,e)):tY(o,e)}});function tY(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let tQ=x("$ZodCatch",(e,t)=>{e4.init(e,t),e._zod.optin="optional",ec(e._zod,"optout",()=>t.innerType._zod.optout),ec(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let s=t.innerType._zod.run(e,r);return s instanceof Promise?s.then(s=>(e.value=s.value,s.issues.length&&(e.value=t.catchValue({...e,error:{issues:s.issues.map(e=>ex(e,r,j()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=s.value,s.issues.length&&(e.value=t.catchValue({...e,error:{issues:s.issues.map(e=>ex(e,r,j()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),t0=x("$ZodPipe",(e,t)=>{e4.init(e,t),ec(e._zod,"values",()=>t.in._zod.values),ec(e._zod,"optin",()=>t.in._zod.optin),ec(e._zod,"optout",()=>t.out._zod.optout),ec(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let s=t.out._zod.run(e,r);return s instanceof Promise?s.then(e=>t1(e,t.in,r)):t1(s,t.in,r)}let s=t.in._zod.run(e,r);return s instanceof Promise?s.then(e=>t1(e,t.out,r)):t1(s,t.out,r)}});function t1(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}let t2=x("$ZodPreprocess",(e,t)=>{t0.init(e,t)}),t9=x("$ZodReadonly",(e,t)=>{e4.init(e,t),ec(e._zod,"propValues",()=>t.innerType._zod.propValues),ec(e._zod,"values",()=>t.innerType._zod.values),ec(e._zod,"optin",()=>t.innerType?._zod?.optin),ec(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let s=t.innerType._zod.run(e,r);return s instanceof Promise?s.then(t4):t4(s)}});function t4(e){return e.value=Object.freeze(e.value),e}let t6=x("$ZodCustom",(e,t)=>{eI.init(e,t),e4.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let s=r.value,o=t.fn(s);if(o instanceof Promise)return o.then(t=>t8(t,r,s,e));t8(o,r,s,e)}});function t8(e,t,r,s){if(!e){let e={code:"custom",input:r,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(e.params=s._zod.def.params),t.issues.push(eO(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(l=globalThis).__zod_globalRegistry??(l.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let s={...r,...this._map.get(e)};return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let t5=globalThis.__zod_globalRegistry;function t3(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...e$(t)})}function t7(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...e$(t)})}function re(e,t){return new eR({check:"less_than",...e$(t),value:e,inclusive:!1})}function rt(e,t){return new eR({check:"less_than",...e$(t),value:e,inclusive:!0})}function rr(e,t){return new eN({check:"greater_than",...e$(t),value:e,inclusive:!1})}function rs(e,t){return new eN({check:"greater_than",...e$(t),value:e,inclusive:!0})}function ro(e,t){return new ez({check:"multiple_of",...e$(t),value:e})}function ri(e,t){return new eA({check:"max_length",...e$(t),maximum:e})}function rn(e,t){return new eM({check:"min_length",...e$(t),minimum:e})}function ra(e,t){return new eD({check:"length_equals",...e$(t),length:e})}function rl(e){return new eK({check:"overwrite",tx:e})}function ru(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??t5,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function rc(e,t,r={path:[],schemaPath:[]}){var s;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let n={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,n);let a=e._zod.toJSONSchema?.();if(a)n.schema=a;else{let s={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,n.schema,s);else{let r=n.schema,i=t.processors[o.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,r,s)}let i=e._zod.parent;i&&(n.ref||(n.ref=i),rc(i,t,s),t.seen.get(i).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(n.schema,l),"input"===t.io&&function e(t,r){let s=r??{seen:new Set};if(s.seen.has(t))return!1;s.seen.add(t);let o=t._zod.def;if("transform"===o.type)return!0;if("array"===o.type)return e(o.element,s);if("set"===o.type)return e(o.valueType,s);if("lazy"===o.type)return e(o.getter(),s);if("promise"===o.type||"optional"===o.type||"nonoptional"===o.type||"nullable"===o.type||"readonly"===o.type||"default"===o.type||"prefault"===o.type)return e(o.innerType,s);if("intersection"===o.type)return e(o.left,s)||e(o.right,s);if("record"===o.type||"map"===o.type)return e(o.keyType,s)||e(o.valueType,s);if("pipe"===o.type)return!!t._zod.traits.has("$ZodCodec")||e(o.in,s)||e(o.out,s);if("object"===o.type){for(let t in o.shape)if(e(o.shape[t],s))return!0;return!1}if("union"===o.type){for(let t of o.options)if(e(t,s))return!0;return!1}if("tuple"===o.type){for(let t of o.items)if(e(t,s))return!0;if(o.rest&&e(o.rest,s))return!0}return!1}(e)&&(delete n.schema.examples,delete n.schema.default),"input"===t.io&&"_prefault"in n.schema&&((s=n.schema).default??(s.default=n.schema._prefault)),delete n.schema._prefault,t.seen.get(e).schema}function rd(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let s=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=s.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(r,t[0])}}let o=t=>{if(t[1].schema.$ref)return;let s=t[1],{ref:o,defId:i}=(t=>{let s="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(r)return{ref:o(r)};let i=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${s}/${i}`}}if(t[1]===r)return{ref:"#"};let o=`#/${s}/`,i=t[1].schema.id??`__schema${e.counter++}`;return{defId:i,ref:o+i}})(t);s.def={...s.schema},i&&(s.defId=i);let n=s.schema;for(let e in n)delete n[e];n.$ref=o};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
60
+ `)}t.write("payload.value = newResult;"),t.write("return payload;");let n=t.compile();return(t,r)=>n(e,t,r)})(t.shape)),c=r(c,u),l)?tX([],d,c,u,o,e):c:a(c,u):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function t0(e,t,r,o){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let a=e.filter(e=>!eF(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>eJ(e,o,W())))}),t)}let t1=J("$ZodUnion",(e,t)=>{th.init(e,t),eO(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),eO(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eO(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),eO(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ek(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(o,a)=>{if(r)return r(o,a);let i=!1,s=[];for(let e of t.options){let t=e._zod.run({value:o.value,issues:[]},a);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>t0(t,o,e,a)):t0(s,o,e,a)}}),t2=J("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,t1.init(e,t);let r=e._zod.parse;eO(e._zod,"propValues",()=>{let e={};for(let r of t.options){let o=r._zod.propValues;if(!o||0===Object.keys(o).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(o))for(let o of(e[t]||(e[t]=new Set),r))e[t].add(o)}return e});let o=eP(()=>{let e=t.options,r=new Map;for(let o of e){let e=o._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,o)}}return r});e._zod.parse=(a,i)=>{let s=a.value;if(!eI(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),a;let n=o.value.get(s?.[t.discriminator]);return n?n._zod.run(a,i):t.unionFallback||"backward"===i.direction?r(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:s,path:[t.discriminator],inst:e}),a)}}),t9=J("$ZodIntersection",(e,t)=>{th.init(e,t),e._zod.parse=(e,r)=>{let o=e.value,a=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([t,r])=>t4(e,t,r)):t4(e,a,i)}});function t4(e,t,r){let o,a=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(o??(o=r),r.keys))a.has(e)||a.set(e,{}),a.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)a.has(e)||a.set(e,{}),a.get(e).r=!0;else e.issues.push(t);let i=[...a].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),eF(e))return e;let s=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(eM(t)&&eM(r)){let o=Object.keys(r),a=Object.keys(t).filter(e=>-1!==o.indexOf(e)),i={...t,...r};for(let o of a){let a=e(t[o],r[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let a=0;a<t.length;a++){let i=e(t[a],r[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}let t5=J("$ZodRecord",(e,t)=>{th.init(e,t),e._zod.parse=(r,o)=>{let a=r.value;if(!eM(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){let n;r.value={};let l=new Set;for(let n of s)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){l.add("number"==typeof n?n.toString():n);let s=t.keyType._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>eJ(e,o,W())),input:n,path:[n],inst:e});continue}let c=s.value,u=t.valueType._zod.run({value:a[n],issues:[]},o);u instanceof Promise?i.push(u.then(e=>{e.issues.length&&r.issues.push(...eH(n,e.issues)),r.value[c]=e.value})):(u.issues.length&&r.issues.push(...eH(n,u.issues)),r.value[c]=u.value)}for(let e in a)l.has(e)||(n=n??[]).push(e);n&&n.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:n})}else for(let s of(r.value={},Reflect.ownKeys(a))){if("__proto__"===s||!Object.prototype.propertyIsEnumerable.call(a,s))continue;let n=t.keyType._zod.run({value:s,issues:[]},o);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof s&&eb.test(s)&&n.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},o);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(n=e)}if(n.issues.length){"loose"===t.mode?r.value[s]=a[s]:r.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(e=>eJ(e,o,W())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:a[s],issues:[]},o);l instanceof Promise?i.push(l.then(e=>{e.issues.length&&r.issues.push(...eH(s,e.issues)),r.value[n.value]=e.value})):(l.issues.length&&r.issues.push(...eH(s,l.issues)),r.value[n.value]=l.value)}return i.length?Promise.all(i).then(()=>r):r}}),t3=J("$ZodEnum",(e,t)=>{th.init(e,t);let r=eE(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=RegExp(`^(${r.filter(e=>ez.has(typeof e)).map(e=>"string"==typeof e?eL(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{let i=t.value;return o.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),t6=J("$ZodLiteral",(e,t)=>{if(th.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eL(e):e?eL(e.toString()):String(e)).join("|")})$`),e._zod.parse=(o,a)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),t8=J("$ZodTransform",(e,t)=>{th.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new G(e.constructor.name);let a=t.transform(r.value,r);if(o.async)return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r.fallback=!0,r));if(a instanceof Promise)throw new B;return r.value=a,r.fallback=!0,r}});function t7(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let re=J("$ZodOptional",(e,t)=>{th.init(e,t),e._zod.optin="optional",e._zod.optout="optional",eO(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),eO(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ek(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let o=e.value,a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(e=>t7(e,o)):t7(a,o)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),rt=J("$ZodExactOptional",(e,t)=>{re.init(e,t),eO(e._zod,"values",()=>t.innerType._zod.values),eO(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),rr=J("$ZodNullable",(e,t)=>{th.init(e,t),eO(e._zod,"optin",()=>t.innerType._zod.optin),eO(e._zod,"optout",()=>t.innerType._zod.optout),eO(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ek(e.source)}|null)$`):void 0}),eO(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),ro=J("$ZodDefault",(e,t)=>{th.init(e,t),e._zod.optin="optional",eO(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let o=t.innerType._zod.run(e,r);return o instanceof Promise?o.then(e=>ra(e,t)):ra(o,t)}});function ra(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let ri=J("$ZodPrefault",(e,t)=>{th.init(e,t),e._zod.optin="optional",eO(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),rs=J("$ZodNonOptional",(e,t)=>{th.init(e,t),eO(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,o)=>{let a=t.innerType._zod.run(r,o);return a instanceof Promise?a.then(t=>rn(t,e)):rn(a,e)}});function rn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let rl=J("$ZodCatch",(e,t)=>{th.init(e,t),e._zod.optin="optional",eO(e._zod,"optout",()=>t.innerType._zod.optout),eO(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let o=t.innerType._zod.run(e,r);return o instanceof Promise?o.then(o=>(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map(e=>eJ(e,r,W()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map(e=>eJ(e,r,W()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),rc=J("$ZodPipe",(e,t)=>{th.init(e,t),eO(e._zod,"values",()=>t.in._zod.values),eO(e._zod,"optin",()=>t.in._zod.optin),eO(e._zod,"optout",()=>t.out._zod.optout),eO(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let o=t.out._zod.run(e,r);return o instanceof Promise?o.then(e=>ru(e,t.in,r)):ru(o,t.in,r)}let o=t.in._zod.run(e,r);return o instanceof Promise?o.then(e=>ru(e,t.out,r)):ru(o,t.out,r)}});function ru(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}let rd=J("$ZodPreprocess",(e,t)=>{rc.init(e,t)}),rp=J("$ZodReadonly",(e,t)=>{th.init(e,t),eO(e._zod,"propValues",()=>t.innerType._zod.propValues),eO(e._zod,"values",()=>t.innerType._zod.values),eO(e._zod,"optin",()=>t.innerType?._zod?.optin),eO(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let o=t.innerType._zod.run(e,r);return o instanceof Promise?o.then(rh):rh(o)}});function rh(e){return e.value=Object.freeze(e.value),e}let rf=J("$ZodLazy",(e,t)=>{th.init(e,t),eO(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),eO(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),eO(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),eO(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),eO(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),rm=J("$ZodCustom",(e,t)=>{eZ.init(e,t),th.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let o=r.value,a=t.fn(o);if(a instanceof Promise)return a.then(t=>ry(t,r,o,e));ry(a,r,o,e)}});function ry(e,t,r,o){if(!e){let e={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(e.params=o._zod.def.params),t.issues.push(eG(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(b=globalThis).__zod_globalRegistry??(b.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let rg=globalThis.__zod_globalRegistry;function rv(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...eU(t)})}function rb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...eU(t)})}function r_(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...eU(t)})}function rS(e,t){return new eX({check:"less_than",...eU(t),value:e,inclusive:!1})}function r$(e,t){return new eX({check:"less_than",...eU(t),value:e,inclusive:!0})}function rw(e,t){return new eY({check:"greater_than",...eU(t),value:e,inclusive:!1})}function rE(e,t){return new eY({check:"greater_than",...eU(t),value:e,inclusive:!0})}function rR(e,t){return new eQ({check:"multiple_of",...eU(t),value:e})}function rP(e,t){return new e1({check:"max_length",...eU(t),maximum:e})}function rk(e,t){return new e2({check:"min_length",...eU(t),minimum:e})}function rT(e,t){return new e9({check:"length_equals",...eU(t),length:e})}function rO(e){return new tt({check:"overwrite",tx:e})}function rx(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??rg,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function rj(e,t,r={path:[],schemaPath:[]}){var o;let a=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let n=e._zod.toJSONSchema?.();if(n)s.schema=n;else{let o={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,o);else{let r=s.schema,i=t.processors[a.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);i(e,t,r,o)}let i=e._zod.parent;i&&(s.ref||(s.ref=i),rj(i,t,o),t.seen.get(i).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),"input"===t.io&&function e(t,r){let o=r??{seen:new Set};if(o.seen.has(t))return!1;o.seen.add(t);let a=t._zod.def;if("transform"===a.type)return!0;if("array"===a.type)return e(a.element,o);if("set"===a.type)return e(a.valueType,o);if("lazy"===a.type)return e(a.getter(),o);if("promise"===a.type||"optional"===a.type||"nonoptional"===a.type||"nullable"===a.type||"readonly"===a.type||"default"===a.type||"prefault"===a.type)return e(a.innerType,o);if("intersection"===a.type)return e(a.left,o)||e(a.right,o);if("record"===a.type||"map"===a.type)return e(a.keyType,o)||e(a.valueType,o);if("pipe"===a.type)return!!t._zod.traits.has("$ZodCodec")||e(a.in,o)||e(a.out,o);if("object"===a.type){for(let t in a.shape)if(e(a.shape[t],o))return!0;return!1}if("union"===a.type){for(let t of a.options)if(e(t,o))return!0;return!1}if("tuple"===a.type){for(let t of a.items)if(e(t,o))return!0;if(a.rest&&e(a.rest,o))return!0}return!1}(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function rC(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=o.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(r,t[0])}}let a=t=>{if(t[1].schema.$ref)return;let o=t[1],{ref:a,defId:i}=(t=>{let o="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(r)return{ref:a(r)};let i=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=i,{defId:i,ref:`${a("__shared")}#/${o}/${i}`}}if(t[1]===r)return{ref:"#"};let a=`#/${o}/`,i=t[1].schema.id??`__schema${e.counter++}`;return{defId:i,ref:a+i}})(t);o.def={...o.schema},i&&(o.defId=i);let s=o.schema;for(let e in s)delete s[e];s.$ref=a};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
67
61
 
68
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let s=r[1];if(t===r[0]){o(r);continue}if(e.external){let s=e.external.registry.get(r[0])?.id;if(t!==r[0]&&s){o(r);continue}}if(e.metadataRegistry.get(r[0])?.id||s.cycle||s.count>1&&"ref"===e.reused){o(r);continue}}}function rp(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let s=t=>{let r=e.seen.get(t);if(null===r.ref)return;let o=r.def??r.schema,i={...o},n=r.ref;if(r.ref=null,n){s(n);let r=e.seen.get(n),a=r.schema;if(a.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(o.allOf=o.allOf??[],o.allOf.push(a)):Object.assign(o,a),Object.assign(o,i),t._zod.parent===n)for(let e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(a.$ref&&r.def)for(let e in o)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(o[e])===JSON.stringify(r.def[e])&&delete o[e]}let a=t._zod.parent;if(a&&a!==n){s(a);let t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(let e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())s(t[0]);let o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;void 0!==i&&o.id===i&&delete o.id;let n=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,n[e.defId]=e.def)}e.external||Object.keys(n).length>0&&("draft-2020-12"===e.target?o.$defs=n:o.definitions=n);try{let r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:rf(t,"input",e.processors),output:rf(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let rf=(e,t,r={})=>s=>{let{libraryOptions:o,target:i}=s??{},n=ru({...o??{},target:i,io:t,processors:r});return rc(e,n),rd(n,e),rp(n,e)},rh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rm=(e,t,r,s)=>{let o=e._zod.def;rc(o.innerType,t,s),t.seen.get(e).ref=o.innerType},ry=x("ZodISODateTime",(e,t)=>{tl.init(e,t),rq.init(e,t)});function rg(e){return new ry({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...e$(e)})}let rv=x("ZodISODate",(e,t)=>{tu.init(e,t),rq.init(e,t)}),r_=x("ZodISOTime",(e,t)=>{tc.init(e,t),rq.init(e,t)}),rb=x("ZodISODuration",(e,t)=>{td.init(e,t),rq.init(e,t)}),rw=x("ZodError",(e,t)=>{eB.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},s=(e,o=[])=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>s({issues:e},[...o,...i.path]));else if("invalid_key"===i.code)s({issues:i.issues},[...o,...i.path]);else if("invalid_element"===i.code)s({issues:i.issues},[...o,...i.path]);else{let e=[...o,...i.path];if(0===e.length)r._errors.push(t(i));else{let s=r,o=0;for(;o<e.length;){let r=e[o];o===e.length-1?(s[r]=s[r]||{_errors:[]},s[r]._errors.push(t(i))):s[r]=s[r]||{_errors:[]},s=s[r],o++}}}};return s(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},s=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):s.push(t(o));return{formErrors:s,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,en,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,en,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),r$=eX(rw),rE=eY(rw),rk=eQ(rw),rS=e1(rw),rT=(e,t,r)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return eX(rw)(e,t,s)},rx=(e,t,r)=>eX(rw)(e,t,r),rP=async(e,t,r)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return eY(rw)(e,t,s)},rO=async(e,t,r)=>eY(rw)(e,t,r),rI=(e,t,r)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return eQ(rw)(e,t,s)},rj=(e,t,r)=>eQ(rw)(e,t,r),rR=async(e,t,r)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return e1(rw)(e,t,s)},rN=async(e,t,r)=>e1(rw)(e,t,r),rz=new WeakMap;function rC(e,t,r){let s=Object.getPrototypeOf(e),o=rz.get(s);if(o||(o=new Set,rz.set(s,o)),!o.has(t))for(let e in o.add(t),r){let t=r[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let rA=x("ZodType",(e,t)=>(e4.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rf(e,"input"),output:rf(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let s=ru({...r,processors:t});return rc(e,s),rd(s,e),rp(s,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>r$(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>rk(e,t,r),e.parseAsync=async(t,r)=>rE(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>rS(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>rT(e,t,r),e.decode=(t,r)=>rx(e,t,r),e.encodeAsync=async(t,r)=>rP(e,t,r),e.decodeAsync=async(t,r)=>rO(e,t,r),e.safeEncode=(t,r)=>rI(e,t,r),e.safeDecode=(t,r)=>rj(e,t,r),e.safeEncodeAsync=async(t,r)=>rR(e,t,r),e.safeDecodeAsync=async(t,r)=>rN(e,t,r),rC(e,"ZodType",{check(...e){let t=this.def;return this.clone(ep(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ew(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new sq({type:"custom",check:"custom",fn:e,...e$(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let s,o;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eO(e,t.value,s._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=s),e.continue??(e.continue=!s._zod.def.abort),t.issues.push(eO(e)))},e(t.value,t)),(o=new eI({check:"custom",...e$(t)}))._zod.check=r,s=o}(e,t))},overwrite(e){return this.check(rl(e))},optional(){return sP(this)},exactOptional(){var e;return e=this,new sO({type:"optional",innerType:e})},nullable(){return sj(this)},nullish(){return sP(sj(this))},nonoptional(e){var t;return t=this,new sz({type:"nonoptional",innerType:t,...e$(e)})},array(){return su(this)},or(e){return sh([this,e])},and(e){return sv(this,e)},transform(e){return sM(this,sT(e))},default(e){var t,r;return t=this,r=e,new sR({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():ev(r)}})},prefault(e){var t,r;return t=this,r=e,new sN({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():ev(r)}})},catch(e){var t,r;return t=this,new sC({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return sM(this,e)},readonly(){var e;return e=this,new sL({type:"readonly",innerType:e})},describe(e){let t=this.clone();return t5.add(t,{description:e}),t},meta(...e){if(0===e.length)return t5.get(this);let t=this.clone();return t5.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>t5.get(e)?.description,configurable:!0}),e)),rM=x("_ZodString",(e,t)=>{e6.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>((e,t,r,s)=>{r.type="string";let{minimum:o,maximum:i,format:n,patterns:a,contentEncoding:l}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),n&&(r.format=rh[n]??n,""===r.format&&delete r.format,"time"===n&&delete r.format),l&&(r.contentEncoding=l),a&&a.size>0){let e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r,0);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,rC(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new eq({check:"string_format",format:"regex",...e$(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new eF({check:"string_format",format:"includes",...e$(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new eH({check:"string_format",format:"starts_with",...e$(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new eZ({check:"string_format",format:"ends_with",...e$(t),suffix:e})}(...e))},min(...e){return this.check(rn(...e))},max(...e){return this.check(ri(...e))},length(...e){return this.check(ra(...e))},nonempty(...e){return this.check(rn(1,...e))},lowercase(e){return this.check(new eU({check:"string_format",format:"lowercase",...e$(e)}))},uppercase(e){return this.check(new eV({check:"string_format",format:"uppercase",...e$(e)}))},trim(){return this.check(rl(e=>e.trim()))},normalize(...e){return this.check(function(e){return rl(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(rl(e=>e.toLowerCase()))},toUpperCase(){return this.check(rl(e=>e.toUpperCase()))},slugify(){return this.check(rl(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})}),rD=x("ZodString",(e,t)=>{e6.init(e,t),rM.init(e,t),e.email=t=>e.check(new rU({type:"string",format:"email",check:"string_format",abort:!1,...e$(t)})),e.url=t=>e.check(t7(rH,t)),e.jwt=t=>e.check(new r6({type:"string",format:"jwt",check:"string_format",abort:!1,...e$(t)})),e.emoji=t=>e.check(new rZ({type:"string",format:"emoji",check:"string_format",abort:!1,...e$(t)})),e.guid=t=>e.check(t3(rV,t)),e.uuid=t=>e.check(new rF({type:"string",format:"uuid",check:"string_format",abort:!1,...e$(t)})),e.uuidv4=t=>e.check(new rF({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...e$(t)})),e.uuidv6=t=>e.check(new rF({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...e$(t)})),e.uuidv7=t=>e.check(new rF({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...e$(t)})),e.nanoid=t=>e.check(new rK({type:"string",format:"nanoid",check:"string_format",abort:!1,...e$(t)})),e.guid=t=>e.check(t3(rV,t)),e.cuid=t=>e.check(new rG({type:"string",format:"cuid",check:"string_format",abort:!1,...e$(t)})),e.cuid2=t=>e.check(new rJ({type:"string",format:"cuid2",check:"string_format",abort:!1,...e$(t)})),e.ulid=t=>e.check(new rB({type:"string",format:"ulid",check:"string_format",abort:!1,...e$(t)})),e.base64=t=>e.check(new r2({type:"string",format:"base64",check:"string_format",abort:!1,...e$(t)})),e.base64url=t=>e.check(new r9({type:"string",format:"base64url",check:"string_format",abort:!1,...e$(t)})),e.xid=t=>e.check(new rW({type:"string",format:"xid",check:"string_format",abort:!1,...e$(t)})),e.ksuid=t=>e.check(new rX({type:"string",format:"ksuid",check:"string_format",abort:!1,...e$(t)})),e.ipv4=t=>e.check(new rY({type:"string",format:"ipv4",check:"string_format",abort:!1,...e$(t)})),e.ipv6=t=>e.check(new rQ({type:"string",format:"ipv6",check:"string_format",abort:!1,...e$(t)})),e.cidrv4=t=>e.check(new r0({type:"string",format:"cidrv4",check:"string_format",abort:!1,...e$(t)})),e.cidrv6=t=>e.check(new r1({type:"string",format:"cidrv6",check:"string_format",abort:!1,...e$(t)})),e.e164=t=>e.check(new r4({type:"string",format:"e164",check:"string_format",abort:!1,...e$(t)})),e.datetime=t=>e.check(rg(t)),e.date=t=>e.check(new rv({type:"string",format:"date",check:"string_format",...e$(t)})),e.time=t=>e.check(new r_({type:"string",format:"time",check:"string_format",precision:null,...e$(t)})),e.duration=t=>e.check(new rb({type:"string",format:"duration",check:"string_format",...e$(t)}))});function rL(e){return new rD({type:"string",...e$(e)})}let rq=x("ZodStringFormat",(e,t)=>{e8.init(e,t),rM.init(e,t)}),rU=x("ZodEmail",(e,t)=>{e7.init(e,t),rq.init(e,t)}),rV=x("ZodGUID",(e,t)=>{e5.init(e,t),rq.init(e,t)}),rF=x("ZodUUID",(e,t)=>{e3.init(e,t),rq.init(e,t)}),rH=x("ZodURL",(e,t)=>{te.init(e,t),rq.init(e,t)}),rZ=x("ZodEmoji",(e,t)=>{tt.init(e,t),rq.init(e,t)}),rK=x("ZodNanoID",(e,t)=>{tr.init(e,t),rq.init(e,t)}),rG=x("ZodCUID",(e,t)=>{ts.init(e,t),rq.init(e,t)}),rJ=x("ZodCUID2",(e,t)=>{to.init(e,t),rq.init(e,t)}),rB=x("ZodULID",(e,t)=>{ti.init(e,t),rq.init(e,t)}),rW=x("ZodXID",(e,t)=>{tn.init(e,t),rq.init(e,t)}),rX=x("ZodKSUID",(e,t)=>{ta.init(e,t),rq.init(e,t)}),rY=x("ZodIPv4",(e,t)=>{tp.init(e,t),rq.init(e,t)}),rQ=x("ZodIPv6",(e,t)=>{tf.init(e,t),rq.init(e,t)}),r0=x("ZodCIDRv4",(e,t)=>{th.init(e,t),rq.init(e,t)}),r1=x("ZodCIDRv6",(e,t)=>{tm.init(e,t),rq.init(e,t)}),r2=x("ZodBase64",(e,t)=>{tg.init(e,t),rq.init(e,t)}),r9=x("ZodBase64URL",(e,t)=>{tv.init(e,t),rq.init(e,t)}),r4=x("ZodE164",(e,t)=>{t_.init(e,t),rq.init(e,t)}),r6=x("ZodJWT",(e,t)=>{tb.init(e,t),rq.init(e,t)}),r8=x("ZodNumber",(e,t)=>{tw.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>((e,t,r,s)=>{let{minimum:o,maximum:i,format:n,multipleOf:a,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;"string"==typeof n&&n.includes("int")?r.type="integer":r.type="number";let c="number"==typeof u&&u>=(o??-1/0),d="number"==typeof l&&l<=(i??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;c?p?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u:"number"==typeof o&&(r.minimum=o),d?p?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:"number"==typeof i&&(r.maximum=i),"number"==typeof a&&(r.multipleOf=a)})(e,t,r,0),rC(e,"ZodNumber",{gt(e,t){return this.check(rr(e,t))},gte(e,t){return this.check(rs(e,t))},min(e,t){return this.check(rs(e,t))},lt(e,t){return this.check(re(e,t))},lte(e,t){return this.check(rt(e,t))},max(e,t){return this.check(rt(e,t))},int(e){return this.check(r7(e))},safe(e){return this.check(r7(e))},positive(e){return this.check(rr(0,e))},nonnegative(e){return this.check(rs(0,e))},negative(e){return this.check(re(0,e))},nonpositive(e){return this.check(rt(0,e))},multipleOf(e,t){return this.check(ro(e,t))},step(e,t){return this.check(ro(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function r5(e){return new r8({type:"number",checks:[],...e$(e)})}let r3=x("ZodNumberFormat",(e,t)=>{t$.init(e,t),r8.init(e,t)});function r7(e){return new r3({type:"number",check:"number_format",abort:!1,format:"safeint",...e$(e)})}let se=x("ZodBoolean",(e,t)=>{tE.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}});function st(e){return new se({type:"boolean",...e$(e)})}let sr=x("ZodNull",(e,t)=>{tk.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{"openapi-3.0"===e.target?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"}});function ss(e){return new sr({type:"null",...e$(e)})}let so=x("ZodAny",(e,t)=>{tS.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}}),si=x("ZodUnknown",(e,t)=>{tT.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function sn(){return new si({type:"unknown"})}let sa=x("ZodNever",(e,t)=>{tx.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),sl=x("ZodArray",(e,t)=>{tO.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>((e,t,r,s)=>{let o=e._zod.def,{minimum:i,maximum:n}=e._zod.bag;"number"==typeof i&&(r.minItems=i),"number"==typeof n&&(r.maxItems=n),r.type="array",r.items=rc(o.element,t,{...s,path:[...s.path,"items"]})})(e,t,r,s),e.element=t.element,rC(e,"ZodArray",{min(e,t){return this.check(rn(e,t))},nonempty(e){return this.check(rn(1,e))},max(e,t){return this.check(ri(e,t))},length(e,t){return this.check(ra(e,t))},unwrap(){return this.element}})});function su(e,t){return new sl({type:"array",element:e,...e$(t)})}let sc=x("ZodObject",(e,t)=>{tz.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>((e,t,r,s)=>{let o=e._zod.def;r.type="object",r.properties={};let i=o.shape;for(let e in i)r.properties[e]=rc(i[e],t,{...s,path:[...s.path,"properties",e]});let n=new Set([...new Set(Object.keys(i))].filter(e=>{let r=o.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));n.size>0&&(r.required=Array.from(n)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=rc(o.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,s),ec(e,"shape",()=>t.shape),rC(e,"ZodObject",{keyof(){return s$(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:sn()})},loose(){return this.clone({...this._zod.def,catchall:sn()})},strict(){return this.clone({...this._zod.def,catchall:new sa({type:"never",...e$(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!eg(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let s=ep(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return ed(this,"shape",r),r}});return ew(e,s)}(this,e)},safeExtend(e){var t=this;if(!eg(e))throw Error("Invalid input to safeExtend: expected a plain object");let r=ep(t._zod.def,{get shape(){let r={...t._zod.def.shape,...e};return ed(this,"shape",r),r}});return ew(t,r)},merge(e){var t=this;if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ep(t._zod.def,{get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return ed(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return ew(t,r)},pick(e){return function(e,t){let r=e._zod.def,s=r.checks;if(s&&s.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let o=ep(e._zod.def,{get shape(){let e={};for(let s in t){if(!(s in r.shape))throw Error(`Unrecognized key: "${s}"`);t[s]&&(e[s]=r.shape[s])}return ed(this,"shape",e),e},checks:[]});return ew(e,o)}(this,e)},omit(e){return function(e,t){let r=e._zod.def,s=r.checks;if(s&&s.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let o=ep(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete s[e]}return ed(this,"shape",s),s},checks:[]});return ew(e,o)}(this,e)},partial(...e){return function(e,t,r){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let o=ep(t._zod.def,{get shape(){let s=t._zod.def.shape,o={...s};if(r)for(let t in r){if(!(t in s))throw Error(`Unrecognized key: "${t}"`);r[t]&&(o[t]=e?new e({type:"optional",innerType:s[t]}):s[t])}else for(let t in s)o[t]=e?new e({type:"optional",innerType:s[t]}):s[t];return ed(this,"shape",o),o},checks:[]});return ew(t,o)}(sx,this,e[0])},required(...e){var t,r;let s;return t=this,r=e[0],s=ep(t._zod.def,{get shape(){let e=t._zod.def.shape,s={...e};if(r)for(let t in r){if(!(t in s))throw Error(`Unrecognized key: "${t}"`);r[t]&&(s[t]=new sz({type:"nonoptional",innerType:e[t]}))}else for(let t in e)s[t]=new sz({type:"nonoptional",innerType:e[t]});return ed(this,"shape",s),s}}),ew(t,s)}})});function sd(e,t){return new sc({type:"object",shape:e??{},...e$(t)})}function sp(e,t){return new sc({type:"object",shape:e,catchall:sn(),...e$(t)})}let sf=x("ZodUnion",(e,t)=>{tA.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o,i,n;return i=!1===(o=e._zod.def).inclusive,n=o.options.map((e,r)=>rc(e,t,{...s,path:[...s.path,i?"oneOf":"anyOf",r]})),void(i?r.oneOf=n:r.anyOf=n)},e.options=t.options});function sh(e,t){return new sf({type:"union",options:e,...e$(t)})}let sm=x("ZodDiscriminatedUnion",(e,t)=>{sf.init(e,t),tM.init(e,t)});function sy(e,t,r){return new sm({type:"union",options:t,discriminator:e,...e$(r)})}let sg=x("ZodIntersection",(e,t)=>{tD.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o,i,n,a;return i=rc((o=e._zod.def).left,t,{...s,path:[...s.path,"allOf",0]}),n=rc(o.right,t,{...s,path:[...s.path,"allOf",1]}),void(r.allOf=[...(a=e=>"allOf"in e&&1===Object.keys(e).length)(i)?i.allOf:[i],...a(n)?n.allOf:[n]])}});function sv(e,t){return new sg({type:"intersection",left:e,right:t})}let s_=x("ZodRecord",(e,t)=>{tq.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>((e,t,r,s)=>{let o=e._zod.def;r.type="object";let i=o.keyType,n=i._zod.bag,a=n?.patterns;if("loose"===o.mode&&a&&a.size>0){let e=rc(o.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});for(let t of(r.patternProperties={},a))r.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=rc(o.keyType,t,{...s,path:[...s.path,"propertyNames"]})),r.additionalProperties=rc(o.valueType,t,{...s,path:[...s.path,"additionalProperties"]});let l=i._zod.values;if(l){let e=[...l].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e)}})(e,t,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function sb(e,t,r){return new s_(t&&t._zod?{type:"record",keyType:e,valueType:t,...e$(r)}:{type:"record",keyType:rL(),valueType:e,...e$(t)})}let sw=x("ZodEnum",(e,t)=>{tU.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o;(o=ei(e._zod.def.entries)).every(e=>"number"==typeof e)&&(r.type="number"),o.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=o},e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,s)=>{let o={};for(let s of e)if(r.has(s))o[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new sw({...t,checks:[],...e$(s),entries:o})},e.exclude=(e,s)=>{let o={...t.entries};for(let t of e)if(r.has(t))delete o[t];else throw Error(`Key ${t} not found in enum`);return new sw({...t,checks:[],...e$(s),entries:o})}});function s$(e,t){return new sw({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...e$(t)})}let sE=x("ZodLiteral",(e,t)=>{tV.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>((e,t,r,s)=>{let o=e._zod.def,i=[];for(let e of o.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(e));else i.push(e);if(0===i.length);else if(1===i.length){let e=i[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else i.every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),i.every(e=>"boolean"==typeof e)&&(r.type="boolean"),i.every(e=>null===e)&&(r.type="null"),r.enum=i})(e,t,r,0),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function sk(e,t){return new sE({type:"literal",values:Array.isArray(e)?e:[e],...e$(t)})}let sS=x("ZodTransform",(e,t)=>{tF.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,s)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(r,s)=>{if("backward"===s.direction)throw new O(e.constructor.name);r.addIssue=s=>{"string"==typeof s?r.issues.push(eO(s,r.value,t)):(s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(eO(s)))};let o=t.transform(r.value,r);return o instanceof Promise?o.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function sT(e){return new sS({type:"transform",transform:e})}let sx=x("ZodOptional",(e,t)=>{tZ.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>rm(e,t,r,s),e.unwrap=()=>e._zod.def.innerType});function sP(e){return new sx({type:"optional",innerType:e})}let sO=x("ZodExactOptional",(e,t)=>{tK.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>rm(e,t,r,s),e.unwrap=()=>e._zod.def.innerType}),sI=x("ZodNullable",(e,t)=>{tG.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o,i,n;return i=rc((o=e._zod.def).innerType,t,s),n=t.seen.get(e),void("openapi-3.0"===t.target?(n.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function sj(e){return new sI({type:"nullable",innerType:e})}let sR=x("ZodDefault",(e,t)=>{tJ.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o;rc((o=e._zod.def).innerType,t,s),t.seen.get(e).ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),sN=x("ZodPrefault",(e,t)=>{tW.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o;rc((o=e._zod.def).innerType,t,s),t.seen.get(e).ref=o.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),sz=x("ZodNonOptional",(e,t)=>{tX.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o;rc((o=e._zod.def).innerType,t,s),t.seen.get(e).ref=o.innerType},e.unwrap=()=>e._zod.def.innerType}),sC=x("ZodCatch",(e,t)=>{tQ.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>((e,t,r,s)=>{let o,i=e._zod.def;rc(i.innerType,t,s),t.seen.get(e).ref=i.innerType;try{o=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=o})(e,t,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),sA=x("ZodPipe",(e,t)=>{t0.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o,i,n;return i=(o=e._zod.def).in._zod.traits.has("$ZodTransform"),void(rc(n="input"===t.io?i?o.out:o.in:o.out,t,s),t.seen.get(e).ref=n)},e.in=t.in,e.out=t.out});function sM(e,t){return new sA({type:"pipe",in:e,out:t})}let sD=x("ZodPreprocess",(e,t)=>{sA.init(e,t),t2.init(e,t)}),sL=x("ZodReadonly",(e,t)=>{t9.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(t,r,s)=>{let o;rc((o=e._zod.def).innerType,t,s),t.seen.get(e).ref=o.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),sq=x("ZodCustom",(e,t)=>{t6.init(e,t),rA.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,s)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});function sU(e,t){return new sD({type:"pipe",in:sT(e),out:t})}let sV="2025-11-25",sF=[sV,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],sH="io.modelcontextprotocol/related-task",sZ=(r=(e=>null!==e&&("object"==typeof e||"function"==typeof e))??(()=>!0),(t=e$(void 0)).abort??(t.abort=!0),new sq({type:"custom",check:"custom",fn:r,...t})),sK=sh([rL(),r5().int()]),sG=rL();sp({ttl:sh([r5(),ss()]).optional(),pollInterval:r5().optional()});let sJ=sd({ttl:r5().optional()}),sB=sd({taskId:rL()}),sW=sp({progressToken:sK.optional(),[sH]:sB.optional()}),sX=sd({_meta:sW.optional()}),sY=sX.extend({task:sJ.optional()}),sQ=sd({method:rL(),params:sX.loose().optional()}),s0=sd({_meta:sW.optional()}),s1=sd({method:rL(),params:s0.loose().optional()}),s2=sp({_meta:sW.optional()}),s9=sh([rL(),r5().int()]),s4=sd({jsonrpc:sk("2.0"),id:s9,...sQ.shape}).strict(),s6=e=>s4.safeParse(e).success,s8=sd({jsonrpc:sk("2.0"),...s1.shape}).strict(),s5=sd({jsonrpc:sk("2.0"),id:s9,result:s2}).strict(),s3=e=>s5.safeParse(e).success;(s=u||(u={}))[s.ConnectionClosed=-32e3]="ConnectionClosed",s[s.RequestTimeout=-32001]="RequestTimeout",s[s.ParseError=-32700]="ParseError",s[s.InvalidRequest=-32600]="InvalidRequest",s[s.MethodNotFound=-32601]="MethodNotFound",s[s.InvalidParams=-32602]="InvalidParams",s[s.InternalError=-32603]="InternalError",s[s.UrlElicitationRequired=-32042]="UrlElicitationRequired";let s7=sd({jsonrpc:sk("2.0"),id:s9.optional(),error:sd({code:r5().int(),message:rL(),data:sn().optional()})}).strict(),oe=sh([s4,s8,s5,s7]);sh([s5,s7]);let ot=s2.strict(),or=s0.extend({requestId:s9.optional(),reason:rL().optional()}),os=s1.extend({method:sk("notifications/cancelled"),params:or}),oo=sd({src:rL(),mimeType:rL().optional(),sizes:su(rL()).optional(),theme:s$(["light","dark"]).optional()}),oi=sd({icons:su(oo).optional()}),on=sd({name:rL(),title:rL().optional()}),oa=on.extend({...on.shape,...oi.shape,version:rL(),websiteUrl:rL().optional(),description:rL().optional()}),ol=sv(sd({applyDefaults:st().optional()}),sb(rL(),sn())),ou=sU(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,sv(sd({form:ol.optional(),url:sZ.optional()}),sb(rL(),sn()).optional())),oc=sp({list:sZ.optional(),cancel:sZ.optional(),requests:sp({sampling:sp({createMessage:sZ.optional()}).optional(),elicitation:sp({create:sZ.optional()}).optional()}).optional()}),od=sp({list:sZ.optional(),cancel:sZ.optional(),requests:sp({tools:sp({call:sZ.optional()}).optional()}).optional()}),op=sd({experimental:sb(rL(),sZ).optional(),sampling:sd({context:sZ.optional(),tools:sZ.optional()}).optional(),elicitation:ou.optional(),roots:sd({listChanged:st().optional()}).optional(),tasks:oc.optional()}),of=sX.extend({protocolVersion:rL(),capabilities:op,clientInfo:oa}),oh=sQ.extend({method:sk("initialize"),params:of}),om=sd({experimental:sb(rL(),sZ).optional(),logging:sZ.optional(),completions:sZ.optional(),prompts:sd({listChanged:st().optional()}).optional(),resources:sd({subscribe:st().optional(),listChanged:st().optional()}).optional(),tools:sd({listChanged:st().optional()}).optional(),tasks:od.optional()}),oy=s2.extend({protocolVersion:rL(),capabilities:om,serverInfo:oa,instructions:rL().optional()}),og=s1.extend({method:sk("notifications/initialized"),params:s0.optional()}),ov=sQ.extend({method:sk("ping"),params:sX.optional()}),o_=sd({progress:r5(),total:sP(r5()),message:sP(rL())}),ob=sd({...s0.shape,...o_.shape,progressToken:sK}),ow=s1.extend({method:sk("notifications/progress"),params:ob}),o$=sX.extend({cursor:sG.optional()}),oE=sQ.extend({params:o$.optional()}),ok=s2.extend({nextCursor:sG.optional()}),oS=s$(["working","input_required","completed","failed","cancelled"]),oT=sd({taskId:rL(),status:oS,ttl:sh([r5(),ss()]),createdAt:rL(),lastUpdatedAt:rL(),pollInterval:sP(r5()),statusMessage:sP(rL())}),ox=s2.extend({task:oT}),oP=s0.merge(oT),oO=s1.extend({method:sk("notifications/tasks/status"),params:oP}),oI=sQ.extend({method:sk("tasks/get"),params:sX.extend({taskId:rL()})}),oj=s2.merge(oT),oR=sQ.extend({method:sk("tasks/result"),params:sX.extend({taskId:rL()})});s2.loose();let oN=oE.extend({method:sk("tasks/list")}),oz=ok.extend({tasks:su(oT)}),oC=sQ.extend({method:sk("tasks/cancel"),params:sX.extend({taskId:rL()})}),oA=s2.merge(oT),oM=sd({uri:rL(),mimeType:sP(rL()),_meta:sb(rL(),sn()).optional()}),oD=oM.extend({text:rL()}),oL=rL().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),oq=oM.extend({blob:oL}),oU=s$(["user","assistant"]),oV=sd({audience:su(oU).optional(),priority:r5().min(0).max(1).optional(),lastModified:rg({offset:!0}).optional()}),oF=sd({...on.shape,...oi.shape,uri:rL(),description:sP(rL()),mimeType:sP(rL()),annotations:oV.optional(),_meta:sP(sp({}))}),oH=sd({...on.shape,...oi.shape,uriTemplate:rL(),description:sP(rL()),mimeType:sP(rL()),annotations:oV.optional(),_meta:sP(sp({}))}),oZ=oE.extend({method:sk("resources/list")}),oK=ok.extend({resources:su(oF)}),oG=oE.extend({method:sk("resources/templates/list")}),oJ=ok.extend({resourceTemplates:su(oH)}),oB=sX.extend({uri:rL()}),oW=sQ.extend({method:sk("resources/read"),params:oB}),oX=s2.extend({contents:su(sh([oD,oq]))}),oY=s1.extend({method:sk("notifications/resources/list_changed"),params:s0.optional()}),oQ=sQ.extend({method:sk("resources/subscribe"),params:oB}),o0=sQ.extend({method:sk("resources/unsubscribe"),params:oB}),o1=s0.extend({uri:rL()}),o2=s1.extend({method:sk("notifications/resources/updated"),params:o1}),o9=sd({name:rL(),description:sP(rL()),required:sP(st())}),o4=sd({...on.shape,...oi.shape,description:sP(rL()),arguments:sP(su(o9)),_meta:sP(sp({}))}),o6=oE.extend({method:sk("prompts/list")}),o8=ok.extend({prompts:su(o4)}),o5=sX.extend({name:rL(),arguments:sb(rL(),rL()).optional()}),o3=sQ.extend({method:sk("prompts/get"),params:o5}),o7=sd({type:sk("text"),text:rL(),annotations:oV.optional(),_meta:sb(rL(),sn()).optional()}),ie=sd({type:sk("image"),data:oL,mimeType:rL(),annotations:oV.optional(),_meta:sb(rL(),sn()).optional()}),it=sd({type:sk("audio"),data:oL,mimeType:rL(),annotations:oV.optional(),_meta:sb(rL(),sn()).optional()}),ir=sd({type:sk("tool_use"),name:rL(),id:rL(),input:sb(rL(),sn()),_meta:sb(rL(),sn()).optional()}),is=sd({type:sk("resource"),resource:sh([oD,oq]),annotations:oV.optional(),_meta:sb(rL(),sn()).optional()}),io=sh([o7,ie,it,oF.extend({type:sk("resource_link")}),is]),ii=sd({role:oU,content:io}),ia=s2.extend({description:rL().optional(),messages:su(ii)}),il=s1.extend({method:sk("notifications/prompts/list_changed"),params:s0.optional()}),iu=sd({title:rL().optional(),readOnlyHint:st().optional(),destructiveHint:st().optional(),idempotentHint:st().optional(),openWorldHint:st().optional()}),ic=sd({taskSupport:s$(["required","optional","forbidden"]).optional()}),id=sd({...on.shape,...oi.shape,description:rL().optional(),inputSchema:sd({type:sk("object"),properties:sb(rL(),sZ).optional(),required:su(rL()).optional()}).catchall(sn()),outputSchema:sd({type:sk("object"),properties:sb(rL(),sZ).optional(),required:su(rL()).optional()}).catchall(sn()).optional(),annotations:iu.optional(),execution:ic.optional(),_meta:sb(rL(),sn()).optional()}),ip=oE.extend({method:sk("tools/list")}),ih=ok.extend({tools:su(id)}),im=s2.extend({content:su(io).default([]),structuredContent:sb(rL(),sn()).optional(),isError:st().optional()});im.or(s2.extend({toolResult:sn()}));let iy=sY.extend({name:rL(),arguments:sb(rL(),sn()).optional()}),ig=sQ.extend({method:sk("tools/call"),params:iy}),iv=s1.extend({method:sk("notifications/tools/list_changed"),params:s0.optional()}),i_=sd({autoRefresh:st().default(!0),debounceMs:r5().int().nonnegative().default(300)}),ib=s$(["debug","info","notice","warning","error","critical","alert","emergency"]),iw=sX.extend({level:ib}),i$=sQ.extend({method:sk("logging/setLevel"),params:iw}),iE=s0.extend({level:ib,logger:rL().optional(),data:sn()}),ik=s1.extend({method:sk("notifications/message"),params:iE}),iS=sd({name:rL().optional()}),iT=sd({hints:su(iS).optional(),costPriority:r5().min(0).max(1).optional(),speedPriority:r5().min(0).max(1).optional(),intelligencePriority:r5().min(0).max(1).optional()}),ix=sd({mode:s$(["auto","required","none"]).optional()}),iP=sd({type:sk("tool_result"),toolUseId:rL().describe("The unique identifier for the corresponding tool call."),content:su(io).default([]),structuredContent:sd({}).loose().optional(),isError:st().optional(),_meta:sb(rL(),sn()).optional()}),iO=sy("type",[o7,ie,it]),iI=sy("type",[o7,ie,it,ir,iP]),ij=sd({role:oU,content:sh([iI,su(iI)]),_meta:sb(rL(),sn()).optional()}),iR=sY.extend({messages:su(ij),modelPreferences:iT.optional(),systemPrompt:rL().optional(),includeContext:s$(["none","thisServer","allServers"]).optional(),temperature:r5().optional(),maxTokens:r5().int(),stopSequences:su(rL()).optional(),metadata:sZ.optional(),tools:su(id).optional(),toolChoice:ix.optional()}),iN=sQ.extend({method:sk("sampling/createMessage"),params:iR}),iz=s2.extend({model:rL(),stopReason:sP(s$(["endTurn","stopSequence","maxTokens"]).or(rL())),role:oU,content:iO}),iC=s2.extend({model:rL(),stopReason:sP(s$(["endTurn","stopSequence","maxTokens","toolUse"]).or(rL())),role:oU,content:sh([iI,su(iI)])}),iA=sd({type:sk("boolean"),title:rL().optional(),description:rL().optional(),default:st().optional()}),iM=sd({type:sk("string"),title:rL().optional(),description:rL().optional(),minLength:r5().optional(),maxLength:r5().optional(),format:s$(["email","uri","date","date-time"]).optional(),default:rL().optional()}),iD=sd({type:s$(["number","integer"]),title:rL().optional(),description:rL().optional(),minimum:r5().optional(),maximum:r5().optional(),default:r5().optional()}),iL=sd({type:sk("string"),title:rL().optional(),description:rL().optional(),enum:su(rL()),default:rL().optional()}),iq=sd({type:sk("string"),title:rL().optional(),description:rL().optional(),oneOf:su(sd({const:rL(),title:rL()})),default:rL().optional()}),iU=sd({type:sk("string"),title:rL().optional(),description:rL().optional(),enum:su(rL()),enumNames:su(rL()).optional(),default:rL().optional()}),iV=sh([iL,iq]),iF=sh([sd({type:sk("array"),title:rL().optional(),description:rL().optional(),minItems:r5().optional(),maxItems:r5().optional(),items:sd({type:sk("string"),enum:su(rL())}),default:su(rL()).optional()}),sd({type:sk("array"),title:rL().optional(),description:rL().optional(),minItems:r5().optional(),maxItems:r5().optional(),items:sd({anyOf:su(sd({const:rL(),title:rL()}))}),default:su(rL()).optional()})]),iH=sh([iU,iV,iF]),iZ=sh([iH,iA,iM,iD]),iK=sh([sY.extend({mode:sk("form").optional(),message:rL(),requestedSchema:sd({type:sk("object"),properties:sb(rL(),iZ),required:su(rL()).optional()})}),sY.extend({mode:sk("url"),message:rL(),elicitationId:rL(),url:rL().url()})]),iG=sQ.extend({method:sk("elicitation/create"),params:iK}),iJ=s0.extend({elicitationId:rL()}),iB=s1.extend({method:sk("notifications/elicitation/complete"),params:iJ}),iW=s2.extend({action:s$(["accept","decline","cancel"]),content:sU(e=>null===e?void 0:e,sb(rL(),sh([rL(),r5(),st(),su(rL())])).optional())}),iX=sd({type:sk("ref/resource"),uri:rL()}),iY=sd({type:sk("ref/prompt"),name:rL()}),iQ=sX.extend({ref:sh([iY,iX]),argument:sd({name:rL(),value:rL()}),context:sd({arguments:sb(rL(),rL()).optional()}).optional()}),i0=sQ.extend({method:sk("completion/complete"),params:iQ}),i1=s2.extend({completion:sp({values:su(rL()).max(100),total:sP(r5().int()),hasMore:sP(st())})}),i2=sd({uri:rL().startsWith("file://"),name:rL().optional(),_meta:sb(rL(),sn()).optional()}),i9=sQ.extend({method:sk("roots/list"),params:sX.optional()}),i4=s2.extend({roots:su(i2)}),i6=s1.extend({method:sk("notifications/roots/list_changed"),params:s0.optional()});sh([ov,oh,i0,i$,o3,o6,oZ,oG,oW,oQ,o0,ig,ip,oI,oR,oN,oC]),sh([os,ow,og,i6,oO]),sh([ot,iz,iC,iW,i4,oj,oz,ox]),sh([ov,iN,iG,i9,oI,oR,oN,oC]),sh([os,ow,ik,o2,oY,iv,il,oO,iB]),sh([ot,oy,i1,ia,o8,oK,oJ,oX,im,ih,oj,oz,ox]);class i8 extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,t,r){return e===u.UrlElicitationRequired&&r&&r.elicitations?new i5(r.elicitations,t):new i8(e,t,r)}}class i5 extends i8{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(u.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}function i3(e){return!!e._zod}function i7(e,t){return i3(e)?e0(e,t):e.safeParse(t)}function ne(e){let t;if(e&&(t=i3(e)?e._zod?.def?.shape:e.shape)){if("function"==typeof t)try{return t()}catch{return}return t}}function nt(e){return"completed"===e||"failed"===e||"cancelled"===e}function nr(e){let t=ne(e),r=t?.method;if(!r)throw Error("Schema is missing a method literal");let s=function(e){if(i3(e)){let t=e._zod?.def;if(t){if(void 0!==t.value)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(void 0!==t.value)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let r=e.value;if(void 0!==r)return r}(r);if("string"!=typeof s)throw Error("Schema method literal must be a string");return s}function ns(e,t){let r=i7(e,t);if(!r.success)throw r.error;return r.data}Symbol("Let zodToJsonSchema decide on which parser to use");class no{constructor(e){this._options=e,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(os,e=>{this._oncancel(e)}),this.setNotificationHandler(ow,e=>{this._onprogress(e)}),this.setRequestHandler(ov,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(oI,async(e,t)=>{let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new i8(u.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(oR,async(e,t)=>{let r=async()=>{let s=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(s,t.sessionId);){if("response"===e.type||"error"===e.type){let t=e.message,r=t.id,s=this._requestResolvers.get(r);if(s)this._requestResolvers.delete(r),s("response"===e.type?t:new i8(t.error.code,t.error.message,t.error.data));else{let t="response"===e.type?"Response":"Error";this._onerror(Error(`${t} handler missing for request ${r}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let o=await this._taskStore.getTask(s,t.sessionId);if(!o)throw new i8(u.InvalidParams,`Task not found: ${s}`);if(!nt(o.status))return await this._waitForTaskUpdate(s,t.signal),await r();if(nt(o.status)){let e=await this._taskStore.getTaskResult(s,t.sessionId);return this._clearTaskQueue(s),{...e,_meta:{...e._meta,[sH]:{taskId:s}}}}return await r()};return await r()}),this.setRequestHandler(oN,async(e,t)=>{try{let{tasks:r,nextCursor:s}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:r,nextCursor:s,_meta:{}}}catch(e){throw new i8(u.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(oC,async(e,t)=>{try{let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new i8(u.InvalidParams,`Task not found: ${e.params.taskId}`);if(nt(r.status))throw new i8(u.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,"cancelled","Client cancelled task execution.",t.sessionId),this._clearTaskQueue(e.params.taskId);let s=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!s)throw new i8(u.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...s}}catch(e){if(e instanceof i8)throw e;throw new i8(u.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;let t=this._requestHandlerAbortControllers.get(e.params.requestId);t?.abort(e.params.reason)}_setupTimeout(e,t,r,s,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(s,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:s})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),i8.fromError(u.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let r=this.transport?.onerror;this._transport.onerror=e=>{r?.(e),this._onerror(e)};let s=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{if(s?.(e,t),s3(e)||s7.safeParse(e).success)this._onresponse(e);else if(s6(e))this._onrequest(e,t);else s8.safeParse(e).success?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;for(let e of(this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear(),this._requestHandlerAbortControllers.values()))e.abort();this._requestHandlerAbortControllers.clear();let t=i8.fromError(u.ConnectionClosed,"Connection closed");for(let r of(this._transport=void 0,this.onclose?.(),e.values()))r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;void 0!==t&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let r,s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,i=e.params?._meta?.[sH]?.taskId;if(void 0===s){let t={jsonrpc:"2.0",id:e.id,error:{code:u.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:t,timestamp:Date.now()},o?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):o?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);let a=(r=e.params,sY.safeParse(r).success)?e.params.task:void 0,l=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,c={signal:n.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(n.signal.aborted)return;let r={relatedRequestId:e.id};i&&(r.relatedTask={taskId:i}),await this.notification(t,r)},sendRequest:async(t,r,s)=>{if(n.signal.aborted)throw new i8(u.ConnectionClosed,"Request was cancelled");let o={...s,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let a=o.relatedTask?.taskId??i;return a&&l&&await l.updateTaskStatus(a,"input_required"),await this.request(t,r,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:l,taskRequestedTtl:a?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,c)).then(async t=>{if(n.signal.aborted)return;let r={result:t,jsonrpc:"2.0",id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:r,timestamp:Date.now()},o?.sessionId):await o?.send(r)},async t=>{if(n.signal.aborted)return;let r={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:u.InternalError,message:t.message??"Internal error",...void 0!==t.data&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:r,timestamp:Date.now()},o?.sessionId):await o?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,s=Number(t),o=this._progressHandlers.get(s);if(!o)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));let i=this._responseHandlers.get(s),n=this._timeoutInfo.get(s);if(n&&i&&n.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(e){this._responseHandlers.delete(s),this._progressHandlers.delete(s),this._cleanupTimeout(s),i(e);return}o(r)}_onresponse(e){let t=Number(e.id),r=this._requestResolvers.get(t);if(r){this._requestResolvers.delete(t),r(s3(e)?e:new i8(e.error.code,e.error.message,e.error.data));return}let s=this._responseHandlers.get(t);if(void 0===s)return void this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(s3(e)&&e.result&&"object"==typeof e.result){let r=e.result;if(r.task&&"object"==typeof r.task){let e=r.task;"string"==typeof e.taskId&&(o=!0,this._taskProgressTokens.set(e.taskId,t))}}o||this._progressHandlers.delete(t),s(s3(e)?e:i8.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async *requestStream(e,t,r){let s,{task:o}=r??{};if(!o){try{let s=await this.request(e,t,r);yield{type:"result",result:s}}catch(e){yield{type:"error",error:e instanceof i8?e:new i8(u.InternalError,String(e))}}return}try{let o=await this.request(e,ox,r);if(o.task)s=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new i8(u.InternalError,"Task creation did not return a task");for(;;){let e=await this.getTask({taskId:s},r);if(yield{type:"taskStatus",task:e},nt(e.status)){if("completed"===e.status){let e=await this.getTaskResult({taskId:s},t,r);yield{type:"result",result:e}}else"failed"===e.status?yield{type:"error",error:new i8(u.InternalError,`Task ${s} failed`)}:"cancelled"===e.status&&(yield{type:"error",error:new i8(u.InternalError,`Task ${s} was cancelled`)});return}if("input_required"===e.status){let e=await this.getTaskResult({taskId:s},t,r);yield{type:"result",result:e};return}let o=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,o)),r?.signal?.throwIfAborted()}}catch(e){yield{type:"error",error:e instanceof i8?e:new i8(u.InternalError,String(e))}}}request(e,t,r){let{relatedRequestId:s,resumptionToken:o,onresumptiontoken:i,task:n,relatedTask:a}=r??{};return new Promise((l,c)=>{let d=e=>{c(e)};if(!this._transport)return void d(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),n&&this.assertTaskCapability(e.method)}catch(e){d(e);return}r?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};r?.onprogress&&(this._progressHandlers.set(p,r.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),n&&(f.params={...f.params,task:n}),a&&(f.params={...f.params,_meta:{...f.params?._meta||{},[sH]:a}});let h=e=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(e)}},{relatedRequestId:s,resumptionToken:o,onresumptiontoken:i}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),c(e instanceof i8?e:new i8(u.RequestTimeout,String(e)))};this._responseHandlers.set(p,e=>{if(!r?.signal?.aborted){if(e instanceof Error)return c(e);try{let r=i7(t,e.result);r.success?l(r.data):c(r.error)}catch(e){c(e)}}}),r?.signal?.addEventListener("abort",()=>{h(r?.signal?.reason)});let m=r?.timeout??6e4;this._setupTimeout(p,m,r?.maxTotalTimeout,()=>h(i8.fromError(u.RequestTimeout,"Request timed out",{timeout:m})),r?.resetTimeoutOnProgress??!1);let y=a?.taskId;if(y){let e=e=>{let t=this._responseHandlers.get(p);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,e),this._enqueueTaskMessage(y,{type:"request",message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(p),c(e)})}else this._transport.send(f,{relatedRequestId:s,resumptionToken:o,onresumptiontoken:i}).catch(e=>{this._cleanupTimeout(p),c(e)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},oj,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},oz,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},oA,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let r=t?.relatedTask?.taskId;if(r){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[sH]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let r={...e,jsonrpc:"2.0"};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[sH]:t.relatedTask}}}),this._transport?.send(r,t).catch(e=>this._onerror(e))});return}let s={...e,jsonrpc:"2.0"};t?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[sH]:t.relatedTask}}}),await this._transport.send(s,t)}setRequestHandler(e,t){let r=nr(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(r,s)=>Promise.resolve(t(ns(e,r),s)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let r=nr(e);this._notificationHandlers.set(r,r=>Promise.resolve(t(ns(e,r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);void 0!==t&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let s=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,s)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){for(let r of(await this._taskMessageQueue.dequeueAll(e,t)))if("request"===r.type&&s6(r.message)){let t=r.message.id,s=this._requestResolvers.get(t);s?(s(new i8(u.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(t)):this._onerror(Error(`Resolver missing for request ${t} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(r=t.pollInterval)}catch{}return new Promise((e,s)=>{if(t.aborted)return void s(new i8(u.InvalidRequest,"Request cancelled"));let o=setTimeout(e,r);t.addEventListener("abort",()=>{clearTimeout(o),s(new i8(u.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let r=this._taskStore;if(!r)throw Error("No task store configured");return{createTask:async s=>{if(!e)throw Error("No request provided");return await r.createTask(s,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let s=await r.getTask(e,t);if(!s)throw new i8(u.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(e,s,o)=>{await r.storeTaskResult(e,s,o,t);let i=await r.getTask(e,t);if(i){let t=oO.parse({method:"notifications/tasks/status",params:i});await this.notification(t),nt(i.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>r.getTaskResult(e,t),updateTaskStatus:async(e,s,o)=>{let i=await r.getTask(e,t);if(!i)throw new i8(u.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(nt(i.status))throw new i8(u.InvalidParams,`Cannot update task "${e}" from terminal status "${i.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(e,s,o,t);let n=await r.getTask(e,t);if(n){let t=oO.parse({method:"notifications/tasks/status",params:n});await this.notification(t),nt(n.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>r.listTasks(e,t)}}}function ni(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}var nn=i(8825),na=i(1712);class nl{constructor(e){this._ajv=e??function(){let e=new nn({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return na(e),e}()}getValidator(e){let t="$id"in e&&"string"==typeof e.$id?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return e=>t(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class nu{constructor(e){this._client=e}async *callToolStream(e,t=im,r){let s=this._client,o={...r,task:r?.task??(s.isToolTask(e.name)?{}:void 0)},i=s.requestStream({method:"tools/call",params:e},t,o),n=s.getToolOutputValidator(e.name);for await(let t of i){if("result"===t.type&&n){let r=t.result;if(!r.structuredContent&&!r.isError)return void(yield{type:"error",error:new i8(u.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)});if(r.structuredContent)try{let e=n(r.structuredContent);if(!e.valid)return void(yield{type:"error",error:new i8(u.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)})}catch(e){if(e instanceof i8)return void(yield{type:"error",error:e});yield{type:"error",error:new i8(u.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)};return}}yield t}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._client.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,r){return this._client.requestStream(e,t,r)}}class nc extends no{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new nl,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",iv,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",il,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",oY,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new nu(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=function(e,t){let r={...e};for(let e in t){let s=t[e];if(void 0===s)continue;let o=r[e];ni(o)&&ni(s)?r[e]={...o,...s}:r[e]=s}return r}(this._capabilities,e)}setRequestHandler(e,t){let r,s=ne(e),o=s?.method;if(!o)throw Error("Schema is missing a method literal");if(i3(o)){let e=o._zod?.def;r=e?.value??o.value}else{let e=o._def;r=e?.value??o.value}if("string"!=typeof r)throw Error("Schema method literal must be a string");let i=r;if("elicitation/create"===i){let r=async(e,r)=>{let s=i7(iG,e);if(!s.success){let e=s.error instanceof Error?s.error.message:String(s.error);throw new i8(u.InvalidParams,`Invalid elicitation request: ${e}`)}let{params:o}=s.data;o.mode=o.mode??"form";let{supportsFormMode:i,supportsUrlMode:n}=function(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=void 0!==e.form,r=void 0!==e.url;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}(this._capabilities.elicitation);if("form"===o.mode&&!i)throw new i8(u.InvalidParams,"Client does not support form-mode elicitation requests");if("url"===o.mode&&!n)throw new i8(u.InvalidParams,"Client does not support URL-mode elicitation requests");let a=await Promise.resolve(t(e,r));if(o.task){let e=i7(ox,a);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new i8(u.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let l=i7(iW,a);if(!l.success){let e=l.error instanceof Error?l.error.message:String(l.error);throw new i8(u.InvalidParams,`Invalid elicitation result: ${e}`)}let c=l.data,d="form"===o.mode?o.requestedSchema:void 0;if("form"===o.mode&&"accept"===c.action&&c.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{!function e(t,r){if(t&&null!==r&&"object"==typeof r){if("object"===t.type&&t.properties&&"object"==typeof t.properties){let s=t.properties;for(let t of Object.keys(s)){let o=s[t];void 0===r[t]&&Object.prototype.hasOwnProperty.call(o,"default")&&(r[t]=o.default),void 0!==r[t]&&e(o,r[t])}}if(Array.isArray(t.anyOf))for(let s of t.anyOf)"boolean"!=typeof s&&e(s,r);if(Array.isArray(t.oneOf))for(let s of t.oneOf)"boolean"!=typeof s&&e(s,r)}}(d,c.content)}catch{}return c};return super.setRequestHandler(e,r)}if("sampling/createMessage"===i){let r=async(e,r)=>{let s=i7(iN,e);if(!s.success){let e=s.error instanceof Error?s.error.message:String(s.error);throw new i8(u.InvalidParams,`Invalid sampling request: ${e}`)}let{params:o}=s.data,i=await Promise.resolve(t(e,r));if(o.task){let e=i7(ox,i);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new i8(u.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let n=i7(o.tools||o.toolChoice?iC:iz,i);if(!n.success){let e=n.error instanceof Error?n.error.message:String(n.error);throw new i8(u.InvalidParams,`Invalid sampling result: ${e}`)}return n.data};return super.setRequestHandler(e,r)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),void 0===e.sessionId)try{let r=await this.request({method:"initialize",params:{protocolVersion:sV,capabilities:this._capabilities,clientInfo:this._clientInfo}},oy,t);if(void 0===r)throw Error(`Server sent invalid initialize result: ${r}`);if(!sF.includes(r.protocolVersion))throw Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(e){throw this.close(),e}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw Error(`Server does not support resources (required for ${e})`);if("resources/subscribe"===e&&!this._serverCapabilities.resources.subscribe)throw Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw Error(`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if("notifications/roots/list_changed"===e&&!this._capabilities.roots?.listChanged)throw Error(`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Client does not support tasks capability (required for ${e})`)}}assertTaskCapability(e){var t=this._serverCapabilities?.tasks?.requests,r="Server";if(!t)throw Error(`${r} does not support task creation (required for ${e})`);if("tools/call"===e&&!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`)}assertTaskHandlerCapability(e){if(this._capabilities){var t=this._capabilities.tasks?.requests,r="Client";if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`)}}}async ping(e){return this.request({method:"ping"},ot,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},i1,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},ot,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},ia,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},o8,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},oK,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},oJ,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},oX,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},ot,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},ot,t)}async callTool(e,t=im,r){if(this.isToolTaskRequired(e.name))throw new i8(u.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let s=await this.request({method:"tools/call",params:e},t,r),o=this.getToolOutputValidator(e.name);if(o){if(!s.structuredContent&&!s.isError)throw new i8(u.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(s.structuredContent)try{let e=o(s.structuredContent);if(!e.valid)throw new i8(u.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){if(e instanceof i8)throw e;throw new i8(u.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return s}isToolTask(e){return!!this._serverCapabilities?.tasks?.requests?.tools?.call&&this._cachedKnownTaskTools.has(e)}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){for(let t of(this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear(),e)){if(t.outputSchema){let e=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,e)}let e=t.execution?.taskSupport;("required"===e||"optional"===e)&&this._cachedKnownTaskTools.add(t.name),"required"===e&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){let r=await this.request({method:"tools/list",params:e},ih,t);return this.cacheToolMetadata(r.tools),r}_setupListChangedHandler(e,t,r,s){let o=i_.safeParse(r);if(!o.success)throw Error(`Invalid ${e} listChanged options: ${o.error.message}`);if("function"!=typeof r.onChanged)throw Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:i,debounceMs:n}=o.data,{onChanged:a}=r,l=async()=>{if(!i)return void a(null,null);try{let e=await s();a(null,e)}catch(e){a(e instanceof Error?e:Error(String(e)),null)}},u=()=>{if(n){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let r=setTimeout(l,n);this._listChangedDebounceTimers.set(e,r)}else l()};this.setNotificationHandler(t,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}var nd=i(6507);let np=require("node:process"),nf=require("node:stream");class nh{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){var e;if(!this._buffer)return null;let t=this._buffer.indexOf("\n");if(-1===t)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),e=r,oe.parse(JSON.parse(e))}clear(){this._buffer=void 0}}let nm="win32"===np.platform?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];class ny{constructor(e){this._readBuffer=new nh,this._stderrStream=null,this._serverParams=e,("pipe"===e.stderr||"overlapped"===e.stderr)&&(this._stderrStream=new nf.PassThrough)}async start(){if(this._process)throw Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{this._process=nd(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of nm){let r=np.env[t];void 0!==r&&(r.startsWith("()")||(e[t]=r))}return e}(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:"win32"===np.platform&&"type"in process,cwd:this._serverParams.cwd}),this._process.on("error",e=>{t(e),this.onerror?.(e)}),this._process.on("spawn",()=>{e()}),this._process.on("close",e=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",e=>{this.onerror?.(e)}),this._process.stdout?.on("data",e=>{this._readBuffer.append(e),this.processReadBuffer()}),this._process.stdout?.on("error",e=>{this.onerror?.(e)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let t=new Promise(t=>{e.once("close",()=>{t()})});try{e.stdin?.end()}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())]),null===e.exitCode){try{e.kill("SIGTERM")}catch{}await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())])}if(null===e.exitCode)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(t=>{if(!this._process?.stdin)throw Error("Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}}function ng(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}async function nv(t){return(await e).getRandomValues(new Uint8Array(t))}async function n_(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=256-256%t.length,s="";for(;s.length<e;)for(let o of(await nv(e-s.length)))o<r&&(s+=t[o%t.length]);return s}async function nb(e){return await n_(e)}async function nw(t){return btoa(String.fromCharCode(...new Uint8Array(await (await e).subtle.digest("SHA-256",new TextEncoder().encode(t))))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function n$(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await nb(e),r=await nw(t);return{code_verifier:t,code_challenge:r}}e=globalThis.crypto?.webcrypto??globalThis.crypto??Promise.resolve().then(i.t.bind(i,7598,19)).then(e=>e.webcrypto);c||(c={});let nE=t7(rH,void 0).superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:"custom",message:"URL must be parseable",fatal:!0}),T}).refine(e=>{let t=new URL(e);return"javascript:"!==t.protocol&&"data:"!==t.protocol&&"vbscript:"!==t.protocol},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),nk=sp({resource:rL().url(),authorization_servers:su(nE).optional(),jwks_uri:rL().url().optional(),scopes_supported:su(rL()).optional(),bearer_methods_supported:su(rL()).optional(),resource_signing_alg_values_supported:su(rL()).optional(),resource_name:rL().optional(),resource_documentation:rL().optional(),resource_policy_uri:rL().url().optional(),resource_tos_uri:rL().url().optional(),tls_client_certificate_bound_access_tokens:st().optional(),authorization_details_types_supported:su(rL()).optional(),dpop_signing_alg_values_supported:su(rL()).optional(),dpop_bound_access_tokens_required:st().optional()}),nS=sp({issuer:rL(),authorization_endpoint:nE,token_endpoint:nE,registration_endpoint:nE.optional(),scopes_supported:su(rL()).optional(),response_types_supported:su(rL()),response_modes_supported:su(rL()).optional(),grant_types_supported:su(rL()).optional(),token_endpoint_auth_methods_supported:su(rL()).optional(),token_endpoint_auth_signing_alg_values_supported:su(rL()).optional(),service_documentation:nE.optional(),revocation_endpoint:nE.optional(),revocation_endpoint_auth_methods_supported:su(rL()).optional(),revocation_endpoint_auth_signing_alg_values_supported:su(rL()).optional(),introspection_endpoint:rL().optional(),introspection_endpoint_auth_methods_supported:su(rL()).optional(),introspection_endpoint_auth_signing_alg_values_supported:su(rL()).optional(),code_challenge_methods_supported:su(rL()).optional(),client_id_metadata_document_supported:st().optional()}),nT=sd({...sp({issuer:rL(),authorization_endpoint:nE,token_endpoint:nE,userinfo_endpoint:nE.optional(),jwks_uri:nE,registration_endpoint:nE.optional(),scopes_supported:su(rL()).optional(),response_types_supported:su(rL()),response_modes_supported:su(rL()).optional(),grant_types_supported:su(rL()).optional(),acr_values_supported:su(rL()).optional(),subject_types_supported:su(rL()),id_token_signing_alg_values_supported:su(rL()),id_token_encryption_alg_values_supported:su(rL()).optional(),id_token_encryption_enc_values_supported:su(rL()).optional(),userinfo_signing_alg_values_supported:su(rL()).optional(),userinfo_encryption_alg_values_supported:su(rL()).optional(),userinfo_encryption_enc_values_supported:su(rL()).optional(),request_object_signing_alg_values_supported:su(rL()).optional(),request_object_encryption_alg_values_supported:su(rL()).optional(),request_object_encryption_enc_values_supported:su(rL()).optional(),token_endpoint_auth_methods_supported:su(rL()).optional(),token_endpoint_auth_signing_alg_values_supported:su(rL()).optional(),display_values_supported:su(rL()).optional(),claim_types_supported:su(rL()).optional(),claims_supported:su(rL()).optional(),service_documentation:rL().optional(),claims_locales_supported:su(rL()).optional(),ui_locales_supported:su(rL()).optional(),claims_parameter_supported:st().optional(),request_parameter_supported:st().optional(),request_uri_parameter_supported:st().optional(),require_request_uri_registration:st().optional(),op_policy_uri:nE.optional(),op_tos_uri:nE.optional(),client_id_metadata_document_supported:st().optional()}).shape,...nS.pick({code_challenge_methods_supported:!0}).shape}),nx=sd({access_token:rL(),id_token:rL().optional(),token_type:rL(),expires_in:new r8({type:"number",coerce:!0,checks:[],...e$(void 0)}).optional(),scope:rL().optional(),refresh_token:rL().optional()}).strip(),nP=sd({error:rL(),error_description:rL().optional(),error_uri:rL().optional()}),nO=nE.optional().or(sk("").transform(()=>void 0)),nI=sd({redirect_uris:su(nE),token_endpoint_auth_method:rL().optional(),grant_types:su(rL()).optional(),response_types:su(rL()).optional(),client_name:rL().optional(),client_uri:nE.optional(),logo_uri:nO,scope:rL().optional(),contacts:su(rL()).optional(),tos_uri:nO,policy_uri:rL().optional(),jwks_uri:nE.optional(),jwks:new so({type:"any"}).optional(),software_id:rL().optional(),software_version:rL().optional(),software_statement:rL().optional()}).strip(),nj=sd({client_id:rL(),client_secret:rL().optional(),client_id_issued_at:r5().optional(),client_secret_expires_at:r5().optional()}).strip(),nR=nI.merge(nj);sd({error:rL(),error_description:rL().optional()}).strip(),sd({token:rL(),token_type_hint:rL().optional()}).strip();class nN extends Error{constructor(e,t){super(e),this.errorUri=t,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}}class nz extends nN{}nz.errorCode="invalid_request";class nC extends nN{}nC.errorCode="invalid_client";class nA extends nN{}nA.errorCode="invalid_grant";class nM extends nN{}nM.errorCode="unauthorized_client";class nD extends nN{}nD.errorCode="unsupported_grant_type";class nL extends nN{}nL.errorCode="invalid_scope";class nq extends nN{}nq.errorCode="access_denied";class nU extends nN{}nU.errorCode="server_error";class nV extends nN{}nV.errorCode="temporarily_unavailable";class nF extends nN{}nF.errorCode="unsupported_response_type";class nH extends nN{}nH.errorCode="unsupported_token_type";class nZ extends nN{}nZ.errorCode="invalid_token";class nK extends nN{}nK.errorCode="method_not_allowed";class nG extends nN{}nG.errorCode="too_many_requests";class nJ extends nN{}nJ.errorCode="invalid_client_metadata";class nB extends nN{}nB.errorCode="insufficient_scope";class nW extends nN{}nW.errorCode="invalid_target";let nX={[nz.errorCode]:nz,[nC.errorCode]:nC,[nA.errorCode]:nA,[nM.errorCode]:nM,[nD.errorCode]:nD,[nL.errorCode]:nL,[nq.errorCode]:nq,[nU.errorCode]:nU,[nV.errorCode]:nV,[nF.errorCode]:nF,[nH.errorCode]:nH,[nZ.errorCode]:nZ,[nK.errorCode]:nK,[nG.errorCode]:nG,[nJ.errorCode]:nJ,[nB.errorCode]:nB,[nW.errorCode]:nW};class nY extends Error{constructor(e){super(e??"Unauthorized")}}let nQ="code",n0="S256";async function n1(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let{error:e,error_description:t,error_uri:s}=nP.parse(JSON.parse(r));return new(nX[e]||nU)(t||"",s)}catch(e){return new nU(`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${e}. Raw body: ${r}`)}}async function n2(e,t){try{return await n9(e,t)}catch(r){if(r instanceof nC||r instanceof nM)return await e.invalidateCredentials?.("all"),await n9(e,t);if(r instanceof nA)return await e.invalidateCredentials?.("tokens"),await n9(e,t);throw r}}async function n9(e,{serverUrl:t,authorizationCode:r,scope:s,resourceMetadataUrl:o,fetchFn:i}){let n,a;try{(n=await n5(t,{resourceMetadataUrl:o},i)).authorization_servers&&n.authorization_servers.length>0&&(a=n.authorization_servers[0])}catch{}a||(a=new URL("/",t));let l=await n4(t,e,n),u=await at(a,{fetchFn:i}),c=await Promise.resolve(e.clientInformation());if(!c){if(void 0!==r)throw Error("Existing OAuth client information is required when exchanging an authorization code");let t=u?.client_id_metadata_document_supported===!0,s=e.clientMetadataUrl;if(s&&!function(e){if(!e)return!1;try{let t=new URL(e);return"https:"===t.protocol&&"/"!==t.pathname}catch{return!1}}(s))throw new nJ(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${s}`);if(t&&s)c={client_id:s},await e.saveClientInformation?.(c);else{if(!e.saveClientInformation)throw Error("OAuth client information must be saveable for dynamic registration");let t=await an(a,{metadata:u,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(t),c=t}}let d=!e.redirectUrl;if(void 0!==r||d){let t=await ai(e,a,{metadata:u,resource:l,authorizationCode:r,fetchFn:i});return await e.saveTokens(t),"AUTHORIZED"}let p=await e.tokens();if(p?.refresh_token)try{let t=await ao(a,{metadata:u,clientInformation:c,refreshToken:p.refresh_token,resource:l,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(t),"AUTHORIZED"}catch(e){if(!(e instanceof nN)||e instanceof nU);else throw e}let f=e.state?await e.state():void 0,{authorizationUrl:h,codeVerifier:m}=await ar(a,{metadata:u,clientInformation:c,state:f,redirectUrl:e.redirectUrl,scope:s||n?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:l});return await e.saveCodeVerifier(m),await e.redirectToAuthorization(h),"REDIRECT"}async function n4(e,t,r){let s,o=((s=new URL("string"==typeof e?e:e.href)).hash="",s);if(t.validateResourceURL)return await t.validateResourceURL(o,r?.resource);if(r){if(!function({requestedResource:e,configuredResource:t}){let r=new URL("string"==typeof e?e:e.href),s=new URL("string"==typeof t?t:t.href);if(r.origin!==s.origin||r.pathname.length<s.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return o.startsWith(i)}({requestedResource:o,configuredResource:r.resource}))throw Error(`Protected resource ${r.resource} does not match expected ${o} (or origin)`);return new URL(r.resource)}}function n6(e){let t,r=e.headers.get("WWW-Authenticate");if(!r)return{};let[s,o]=r.split(" ");if("bearer"!==s.toLowerCase()||!o)return{};let i=n8(e,"resource_metadata")||void 0;if(i)try{t=new URL(i)}catch{}return{resourceMetadataUrl:t,scope:n8(e,"scope")||void 0,error:n8(e,"error")||void 0}}function n8(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let s=RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(s);return o?o[1]||o[2]:null}async function n5(e,t,r=fetch){let s=await ae(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!s||404===s.status)throw await s?.body?.cancel(),Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw await s.body?.cancel(),Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return nk.parse(await s.json())}async function n3(e,t,r=fetch){try{return await r(e,{headers:t})}catch(s){if(s instanceof TypeError)if(t)return n3(e,void 0,r);else return;throw s}}async function n7(e,t,r=fetch){return await n3(e,{"MCP-Protocol-Version":t},r)}async function ae(e,t,r,s){var o,i;let n,a=new URL(e),l=s?.protocolVersion??sV;s?.metadataUrl?n=new URL(s.metadataUrl):(n=new URL(function(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}(t,a.pathname),s?.metadataServerUrl??a)).search=a.search;let u=await n7(n,l,r);if(!s?.metadataUrl&&(o=u,i=a.pathname,!o||o.status>=400&&o.status<500&&"/"!==i)){let e=new URL(`/.well-known/${t}`,a);u=await n7(e,l,r)}return u}async function at(e,{fetchFn:t=fetch,protocolVersion:r=sV}={}){let s={"MCP-Protocol-Version":r,Accept:"application/json"};for(let{url:r,type:o}of function(e){let t="string"==typeof e?new URL(e):e,r="/"!==t.pathname,s=[];if(!r)return s.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),s;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),s.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),s}(e)){let e=await n3(r,s,t);if(e){if(!e.ok){if(await e.body?.cancel(),e.status>=400&&e.status<500)continue;throw Error(`HTTP ${e.status} trying to load ${"oauth"===o?"OAuth":"OpenID provider"} metadata from ${r}`)}if("oauth"===o)return nS.parse(await e.json());return nT.parse(await e.json())}}}async function ar(e,{metadata:t,clientInformation:r,redirectUrl:s,scope:o,state:i,resource:n}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(nQ))throw Error(`Incompatible auth server: does not support response type ${nQ}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(n0))throw Error(`Incompatible auth server: does not support code challenge method ${n0}`)}else a=new URL("/authorize",e);let l=await n$(),u=l.code_verifier,c=l.code_challenge;return a.searchParams.set("response_type",nQ),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",c),a.searchParams.set("code_challenge_method",n0),a.searchParams.set("redirect_uri",String(s)),i&&a.searchParams.set("state",i),o&&a.searchParams.set("scope",o),o?.includes("offline_access")&&a.searchParams.append("prompt","consent"),n&&a.searchParams.set("resource",n.href),{authorizationUrl:a,codeVerifier:u}}async function as(e,{metadata:t,tokenRequestParams:r,clientInformation:s,addClientAuthentication:o,resource:i,fetchFn:n}){var a,l;let u,c=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});i&&r.set("resource",i.href),o?await o(d,r,c,t):s&&function(e,t,r,s){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":var n,a,l,u,c=o,d=i,p=r;if(!d)throw Error("client_secret_basic authentication requires a client_secret");let f=btoa(`${c}:${d}`);p.set("Authorization",`Basic ${f}`);return;case"client_secret_post":n=o,a=i,(l=s).set("client_id",n),a&&l.set("client_secret",a);return;case"none":u=o,s.set("client_id",u);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}((a=s,l=t?.token_endpoint_auth_methods_supported??[],u=void 0!==a.client_secret,0===l.length?u?"client_secret_post":"none":"token_endpoint_auth_method"in a&&a.token_endpoint_auth_method&&["client_secret_basic","client_secret_post","none"].includes(a.token_endpoint_auth_method)&&l.includes(a.token_endpoint_auth_method)?a.token_endpoint_auth_method:u&&l.includes("client_secret_basic")?"client_secret_basic":u&&l.includes("client_secret_post")?"client_secret_post":l.includes("none")?"none":u?"client_secret_post":"none"),s,d,r);let p=await (n??fetch)(c,{method:"POST",headers:d,body:r});if(!p.ok)throw await n1(p);return nx.parse(await p.json())}async function ao(e,{metadata:t,clientInformation:r,refreshToken:s,resource:o,addClientAuthentication:i,fetchFn:n}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:s});return{refresh_token:s,...await as(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:n})}}async function ai(e,t,{metadata:r,resource:s,authorizationCode:o,fetchFn:i}={}){let n,a=e.clientMetadata.scope;if(e.prepareTokenRequest&&(n=await e.prepareTokenRequest(a)),!n){if(!o)throw Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw Error("redirectUrl is required for authorization_code flow");n=new URLSearchParams({grant_type:"authorization_code",code:o,code_verifier:await e.codeVerifier(),redirect_uri:String(e.redirectUrl)})}return as(t,{metadata:r,tokenRequestParams:n,clientInformation:await e.clientInformation()??void 0,addClientAuthentication:e.addClientAuthentication,resource:s,fetchFn:i})}async function an(e,{metadata:t,clientMetadata:r,fetchFn:s}){let o;if(t){if(!t.registration_endpoint)throw Error("Incompatible auth server: does not support dynamic client registration");o=new URL(t.registration_endpoint)}else o=new URL("/register",e);let i=await (s??fetch)(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await n1(i);return nR.parse(await i.json())}class aa extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function al(e){}class au extends TransformStream{constructor({onError:e,onRetry:t,onComment:r}={}){let s;super({start(o){s=function(e){if("function"==typeof e)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=al,onError:r=al,onRetry:s=al,onComment:o}=e,i="",n=!0,a,l="",u="";function c(e){if(""===e)return void(l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
69
- `)?l.slice(0,-1):l}),a=void 0,l="",u="");if(e.startsWith(":")){o&&o(e.slice(e.startsWith(": ")?2:1));return}let r=e.indexOf(":");if(-1!==r){let t=e.slice(0,r),s=" "===e[r+1]?2:1;d(t,e.slice(r+s),e);return}d(e,"",e)}function d(e,t,o){switch(e){case"event":u=t;break;case"data":l=`${l}${t}
70
- `;break;case"id":a=t.includes("\0")?void 0:t;break;case"retry":/^\d+$/.test(t)?s(parseInt(t,10)):r(new aa(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:o}));break;default:r(new aa(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:"unknown-field",field:e,value:t,line:o}))}}return{feed:function(e){let t=n?e.replace(/^\xEF\xBB\xBF/,""):e,[r,s]=function(e){let t=[],r="",s=0;for(;s<e.length;){let o=e.indexOf("\r",s),i=e.indexOf(`
71
- `,s),n=-1;if(-1!==o&&-1!==i?n=Math.min(o,i):-1!==o?n=o===e.length-1?-1:o:-1!==i&&(n=i),-1===n){r=e.slice(s);break}{let r=e.slice(s,n);t.push(r),"\r"===e[(s=n+1)-1]&&e[s]===`
72
- `&&s++}}return[t,r]}(`${i}${t}`);for(let e of r)c(e);i=s,n=!1},reset:function(e={}){i&&e.consume&&c(i),n=!0,a=void 0,l="",u="",i=""}}}({onEvent:e=>{o.enqueue(e)},onError(t){"terminate"===e?o.error(t):"function"==typeof e&&e(t)},onRetry:t,onComment:r})},transform(e){s.feed(e)}})}}let ac={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class ad extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}class ap{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=function(e=fetch,t){return t?async(r,s)=>e(r,{...t,...s,headers:s?.headers?{...ng(t.headers),...ng(s.headers)}:t.headers}):e}(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??ac}async _authThenStart(){let e;if(!this._authProvider)throw new nY("No auth provider");try{e=await n2(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(e){throw this.onerror?.(e),e}if("AUTHORIZED"!==e)throw new nY;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let t=await this._authProvider.tokens();t&&(e.Authorization=`Bearer ${t.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let t=ng(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){let{resumptionToken:t}=e;try{let r=await this._commonHeaders();r.set("Accept","text/event-stream"),t&&r.set("last-event-id",t);let s=await (this._fetch??fetch)(this._url,{method:"GET",headers:r,signal:this._abortController?.signal});if(!s.ok){if(await s.body?.cancel(),401===s.status&&this._authProvider)return await this._authThenStart();if(405===s.status)return;throw new ad(s.status,`Failed to open SSE stream: ${s.statusText}`)}this._handleSseStream(s.body,e,!0)}catch(e){throw this.onerror?.(e),e}}_getNextReconnectionDelay(e){return void 0!==this._serverRetryMs?this._serverRetryMs:Math.min(this._reconnectionOptions.initialReconnectionDelay*Math.pow(this._reconnectionOptions.reconnectionDelayGrowFactor,e),this._reconnectionOptions.maxReconnectionDelay)}_scheduleReconnection(e,t=0){let r=this._reconnectionOptions.maxRetries;if(t>=r)return void this.onerror?.(Error(`Maximum reconnection attempts (${r}) exceeded.`));let s=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(r=>{this.onerror?.(Error(`Failed to reconnect SSE stream: ${r instanceof Error?r.message:String(r)}`)),this._scheduleReconnection(e,t+1)})},s)}_handleSseStream(e,t,r){let s;if(!e)return;let{onresumptiontoken:o,replayMessageId:i}=t,n=!1,a=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new au({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:r}=await t.read();if(r)break;if((e.id&&(s=e.id,n=!0,o?.(e.id)),e.data)&&(!e.event||"message"===e.event))try{let t=oe.parse(JSON.parse(e.data));s3(t)&&(a=!0,void 0!==i&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(r||n)&&!a&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(e){if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(r||n)&&!a&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`))}}})()}async start(){if(this._abortController)throw Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new nY("No auth provider");if("AUTHORIZED"!==await n2(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit}))throw new nY("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{let{resumptionToken:r,onresumptiontoken:s}=t||{};if(r)return void this._startOrAuthSse({resumptionToken:r,replayMessageId:s6(e)?e.id:void 0}).catch(e=>this.onerror?.(e));let o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");let i={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},n=await (this._fetch??fetch)(this._url,i),a=n.headers.get("mcp-session-id");if(a&&(this._sessionId=a),!n.ok){let t=await n.text().catch(()=>null);if(401===n.status&&this._authProvider){if(this._hasCompletedAuthFlow)throw new ad(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:t,scope:r}=n6(n);this._resourceMetadataUrl=t,this._scope=r;let s=await n2(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit});if("AUTHORIZED"!==s)throw new nY;return this._hasCompletedAuthFlow=!0,this.send(e)}if(403===n.status&&this._authProvider){let{resourceMetadataUrl:t,scope:r,error:s}=n6(n);if("insufficient_scope"===s){let s=n.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===s)throw new ad(403,"Server returned 403 after trying upscoping");r&&(this._scope=r),t&&(this._resourceMetadataUrl=t),this._lastUpscopingHeader=s??void 0;let o=await n2(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch});if("AUTHORIZED"!==o)throw new nY;return this.send(e)}}throw new ad(n.status,`Error POSTing to endpoint: ${t}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,202===n.status){await n.body?.cancel(),og.safeParse(e).success&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let l=(Array.isArray(e)?e:[e]).filter(e=>"method"in e&&"id"in e&&void 0!==e.id).length>0,u=n.headers.get("content-type");if(l)if(u?.includes("text/event-stream"))this._handleSseStream(n.body,{onresumptiontoken:s},!1);else if(u?.includes("application/json")){let e=await n.json();for(let t of Array.isArray(e)?e.map(e=>oe.parse(e)):[oe.parse(e)])this.onmessage?.(t)}else throw await n.body?.cancel(),new ad(-1,`Unexpected content type: ${u}`);else await n.body?.cancel()}catch(e){throw this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},r=await (this._fetch??fetch)(this._url,t);if(await r.body?.cancel(),!r.ok&&405!==r.status)throw new ad(r.status,`Failed to terminate session: ${r.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}}let af=e=>"env"in e&&"string"==typeof e.env,ah=e=>{let t={};return e.forEach(e=>{let r=e.name.trim();if(af(e)){let s=process.env[e.env];if(void 0===s)throw Error(`Environment variable "${e.env}" is not set (required for header "${r}")`);t[r]=s}else t[r]=e.value.trim()}),t},am=i(8330),ay={name:am.name,version:am.version},ag={capabilities:{sampling:{},elicitation:{form:{},url:{}},roots:{listChanged:!0}}};async function av({url:e,headers:t}){let r=new nc(ay,ag),s=t?ah(t):{},o=new ap(new URL(e),{...t?{requestInit:{headers:s}}:{},reconnectionOptions:{maxReconnectionDelay:3e4,initialReconnectionDelay:1e3,reconnectionDelayGrowFactor:1.5,maxRetries:2}});return await r.connect(o),r}async function a_(e){let{onStderrData:t,...r}=e,s=new nc(ay,ag),o=new ny({...r,stderr:r.stderr??"pipe"}),i=o.stderr;if(i){let e=t??(e=>{console.error(`[STDIO MCP Server stderr]: ${e}`)});i.on("data",e)}return await s.connect(o),{client:s,transport:o}}async function ab(e){try{return(await e.client.listTools()).tools.map(e=>e.name)}catch(e){return console.error("Failed to list stdio MCP tools:",e),[]}}async function aw(e,t,r){try{return await e.client.callTool({name:t,arguments:r})}catch(e){throw console.error(`Failed to call stdio MCP tool "${t}":`,e),e}}async function a$(e){try{await e.transport.close(),await e.client.close()}catch(e){throw console.error("Error disconnecting from stdio MCP server:",e),e}}function aE(e){if(e?.body===void 0||null===e.body)return[];let t=Array.isArray(e.body)?e.body:[e.body],r=[];for(let e of t)if("object"==typeof e&&null!==e&&"method"in e&&"tools/call"===e.method){let t=e.params;t&&"object"==typeof t&&"name"in t&&"string"==typeof t.name&&r.push(t.name)}return r}let ak="2026-01-26",aS="ui/initialize",aT="ui/notifications/initialized",ax="ui/request-display-mode",aP="ui/open-link",aO="ui/update-model-context",aI="ui/message",aj="notifications/message",aR="resources/read",aN="ui/notifications/host-context-changed",az="ui/notifications/size-changed";function aC(e){return!!e&&"object"==typeof e}function aA(e,t){return e instanceof Error&&e.message?e.message:t}function aM(e={}){let t=e.targetWindow??("undefined"==typeof window?null:window),r=e.requestTimeoutMs??15e3,s=e.connectionTimeoutMs??2e3,o=100,i=!1,n=!1,a={isConnected:!!t&&t.parent!==t,hostContext:null,hostCapabilities:null},l=new Set,u=new Map,c=e=>{if(e.isConnected!==a.isConnected||e.hostContext!==a.hostContext||e.hostCapabilities!==a.hostCapabilities)for(let t of(a=e,l))t(a)},d=e=>{var t,r;let s;c({isConnected:!0,hostContext:e.hostContext?(t=a.hostContext,r=e.hostContext,s={...t??{},...r},(t?.safeAreaInsets||r.safeAreaInsets)&&(s.safeAreaInsets={...t?.safeAreaInsets??{},...r.safeAreaInsets??{}}),(t?.containerDimensions||r.containerDimensions)&&(s.containerDimensions={...t?.containerDimensions??{},...r.containerDimensions??{}}),(t?.styles||r.styles)&&(s.styles={...t?.styles??{},...r.styles??{},variables:t?.styles?.variables||r.styles?.variables?{...t?.styles?.variables??{},...r.styles?.variables??{}}:void 0,css:t?.styles?.css||r.styles?.css?{...t?.styles?.css??{},...r.styles?.css??{}}:void 0}),s):a.hostContext,hostCapabilities:e.hostCapabilities?{...a.hostCapabilities??{},...e.hostCapabilities}:a.hostCapabilities})},p=e=>{if(!t||e.source!==t.parent||!aC(e.data))return;n=!0,a.isConnected||c({...a,isConnected:!0});let r=e.data;if("id"in r&&null!=r.id&&"number"==typeof r.id){let e=u.get(r.id);e&&(clearTimeout(e.timeoutId),u.delete(r.id),aC(r.error)?e.reject(Error("string"==typeof r.error.message?r.error.message:"MCP request failed")):e.resolve(r.result))}1===r.id&&aC(r.result)&&d({hostContext:aC(r.result.hostContext)?r.result.hostContext:void 0,hostCapabilities:aC(r.result.hostCapabilities)?r.result.hostCapabilities:void 0}),r.method===aN&&aC(r.params)&&d({hostContext:r.params}),"ui/hostContextChanged"===r.method&&aC(r.params)&&aC(r.params.hostContext)&&d({hostContext:r.params.hostContext})};t&&(t.addEventListener("message",p),t.parent!==t&&setTimeout(()=>{i||n||a.hostContext||c({...a,isConnected:!1})},s));let f=()=>{if(i)throw Error("MCP host bridge has been disposed");if(!t)throw Error("MCP host bridge requires a browser window");return t},h=(e,t)=>{f().parent.postMessage({jsonrpc:"2.0",method:e,params:t},"*")},m=(e,t={})=>{let s=f();return new Promise((i,n)=>{let a=o++,l=setTimeout(()=>{u.has(a)&&(u.delete(a),n(Error(`MCP request timed out: ${e}`)))},r);u.set(a,{resolve:i,reject:n,timeoutId:l}),s.parent.postMessage({jsonrpc:"2.0",id:a,method:e,params:t},"*")})},y=async(e,t)=>{let r;for(let s of e)try{return await m(s,t)}catch(t){r=t;let e=aA(t,"MCP request failed");if(!/method not found|unknown method/i.test(e))throw t}throw r instanceof Error?r:Error("MCP request failed")},g=async e=>{if(t?.open)return void t.open(e,"_blank","noopener,noreferrer");throw Error("Unable to open link without a browser window")};return{callTool:(e,t)=>m("tools/call",{name:e,arguments:t??{}}),requestDisplayMode:e=>y([ax,"ui/requestDisplayMode"],{mode:e}),async openLink(e){try{await y([aP,"ui/openLink"],{url:e})}catch(r){if(!a.isConnected||!t)return void await g(e);throw Error(aA(r,"Failed to open link"))}},readResource:e=>m(aR,{uri:e}),sendMessage:e=>m(aI,e),updateModelContext:e=>m(aO,e),async logMessage(e){h(aj,e)},async notifySizeChanged(e){h(az,e)},getState:()=>a,getHostContext:()=>a.hostContext,getHostCapabilities:()=>a.hostCapabilities,isConnected:()=>a.isConnected,subscribe:e=>(l.add(e),()=>{l.delete(e)}),dispose(){if(!i){for(let[e,r]of(i=!0,t&&t.removeEventListener("message",p),u.entries()))clearTimeout(r.timeoutId),r.reject(Error("MCP host bridge has been disposed")),u.delete(e);l.clear()}}}}p().config()})(),n})());
62
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let o=r[1];if(t===r[0]){a(r);continue}if(e.external){let o=e.external.registry.get(r[0])?.id;if(t!==r[0]&&o){a(r);continue}}if(e.metadataRegistry.get(r[0])?.id||o.cycle||o.count>1&&"ref"===e.reused){a(r);continue}}}function rN(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=t=>{let r=e.seen.get(t);if(null===r.ref)return;let a=r.def??r.schema,i={...a},s=r.ref;if(r.ref=null,s){o(s);let r=e.seen.get(s),n=r.schema;if(n.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(a.allOf=a.allOf??[],a.allOf.push(n)):Object.assign(a,n),Object.assign(a,i),t._zod.parent===s)for(let e in a)"$ref"!==e&&"allOf"!==e&&(e in i||delete a[e]);if(n.$ref&&r.def)for(let e in a)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(a[e])===JSON.stringify(r.def[e])&&delete a[e]}let n=t._zod.parent;if(n&&n!==s){o(n);let t=e.seen.get(n);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(let e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())o(t[0]);let a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");a.$id=e.external.uri(r)}Object.assign(a,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;void 0!==i&&a.id===i&&delete a.id;let s=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?a.$defs=s:a.definitions=s);try{let r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:rI(t,"input",e.processors),output:rI(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let rI=(e,t,r={})=>o=>{let{libraryOptions:a,target:i}=o??{},s=rx({...a??{},target:i,io:t,processors:r});return rj(e,s),rC(s,e),rN(s,e)},rA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rM=(e,t,r,o)=>{r.type="string";let{minimum:a,maximum:i,format:s,patterns:n,contentEncoding:l}=e._zod.bag;if("number"==typeof a&&(r.minLength=a),"number"==typeof i&&(r.maxLength=i),s&&(r.format=rA[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),l&&(r.contentEncoding=l),n&&n.size>0){let e=[...n];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}},rq=(e,t,r,o)=>{let{minimum:a,maximum:i,format:s,multipleOf:n,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number";let u="number"==typeof c&&c>=(a??-1/0),d="number"==typeof l&&l<=(i??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;u?p?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c:"number"==typeof a&&(r.minimum=a),d?p?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:"number"==typeof i&&(r.maximum=i),"number"==typeof n&&(r.multipleOf=n)},rz=(e,t,r,o)=>{r.type="boolean"},rL=(e,t,r,o)=>{"openapi-3.0"===t.target?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},rD=(e,t,r,o)=>{r.not={}},rU=(e,t,r,o)=>{},rV=(e,t,r,o)=>{},rF=(e,t,r,o)=>{let a=eE(e._zod.def.entries);a.every(e=>"number"==typeof e)&&(r.type="number"),a.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=a},rH=(e,t,r,o)=>{let a=e._zod.def,i=[];for(let e of a.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(e));else i.push(e);if(0===i.length);else if(1===i.length){let e=i[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else i.every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),i.every(e=>"boolean"==typeof e)&&(r.type="boolean"),i.every(e=>null===e)&&(r.type="null"),r.enum=i},rK=(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")},rJ=(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")},rB=(e,t,r,o)=>{let a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;"number"==typeof i&&(r.minItems=i),"number"==typeof s&&(r.maxItems=s),r.type="array",r.items=rj(a.element,t,{...o,path:[...o.path,"items"]})},rG=(e,t,r,o)=>{let a=e._zod.def;r.type="object",r.properties={};let i=a.shape;for(let e in i)r.properties[e]=rj(i[e],t,{...o,path:[...o.path,"properties",e]});let s=new Set([...new Set(Object.keys(i))].filter(e=>{let r=a.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));s.size>0&&(r.required=Array.from(s)),a.catchall?._zod.def.type==="never"?r.additionalProperties=!1:a.catchall?a.catchall&&(r.additionalProperties=rj(a.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)},rZ=(e,t,r,o)=>{let a=e._zod.def,i=!1===a.inclusive,s=a.options.map((e,r)=>rj(e,t,{...o,path:[...o.path,i?"oneOf":"anyOf",r]}));i?r.oneOf=s:r.anyOf=s},rW=(e,t,r,o)=>{let a=e._zod.def,i=rj(a.left,t,{...o,path:[...o.path,"allOf",0]}),s=rj(a.right,t,{...o,path:[...o.path,"allOf",1]}),n=e=>"allOf"in e&&1===Object.keys(e).length;r.allOf=[...n(i)?i.allOf:[i],...n(s)?s.allOf:[s]]},rX=(e,t,r,o)=>{let a=e._zod.def;r.type="object";let i=a.keyType,s=i._zod.bag,n=s?.patterns;if("loose"===a.mode&&n&&n.size>0){let e=rj(a.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});for(let t of(r.patternProperties={},n))r.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=rj(a.keyType,t,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=rj(a.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let l=i._zod.values;if(l){let e=[...l].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e)}},rY=(e,t,r,o)=>{let a=e._zod.def,i=rj(a.innerType,t,o),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=a.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},rQ=(e,t,r,o)=>{let a=e._zod.def;rj(a.innerType,t,o),t.seen.get(e).ref=a.innerType},r0=(e,t,r,o)=>{let a=e._zod.def;rj(a.innerType,t,o),t.seen.get(e).ref=a.innerType,r.default=JSON.parse(JSON.stringify(a.defaultValue))},r1=(e,t,r,o)=>{let a=e._zod.def;rj(a.innerType,t,o),t.seen.get(e).ref=a.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},r2=(e,t,r,o)=>{let a,i=e._zod.def;rj(i.innerType,t,o),t.seen.get(e).ref=i.innerType;try{a=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},r9=(e,t,r,o)=>{let a=e._zod.def,i=a.in._zod.traits.has("$ZodTransform"),s="input"===t.io?i?a.out:a.in:a.out;rj(s,t,o),t.seen.get(e).ref=s},r4=(e,t,r,o)=>{let a=e._zod.def;rj(a.innerType,t,o),t.seen.get(e).ref=a.innerType,r.readOnly=!0},r5=(e,t,r,o)=>{let a=e._zod.def;rj(a.innerType,t,o),t.seen.get(e).ref=a.innerType},r3=(e,t,r,o)=>{let a=e._zod.innerType;rj(a,t,o),t.seen.get(e).ref=a},r6={string:rM,number:rq,boolean:rz,bigint:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")},symbol:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")},null:rL,undefined:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")},void:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")},never:rD,any:rU,unknown:rV,date:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")},enum:rF,literal:rH,nan:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")},template_literal:(e,t,r,o)=>{let a=e._zod.pattern;if(!a)throw Error("Pattern not found in template literal");r.type="string",r.pattern=a.source},file:(e,t,r,o)=>{let a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:s,mime:n}=e._zod.bag;void 0!==i&&(a.minLength=i),void 0!==s&&(a.maxLength=s),n?1===n.length?(a.contentMediaType=n[0],Object.assign(r,a)):(Object.assign(r,a),r.anyOf=n.map(e=>({contentMediaType:e}))):Object.assign(r,a)},success:(e,t,r,o)=>{r.type="boolean"},custom:rK,function:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")},transform:rJ,map:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")},set:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")},array:rB,object:rG,union:rZ,intersection:rW,tuple:(e,t,r,o)=>{let a=e._zod.def;r.type="array";let i="draft-2020-12"===t.target?"prefixItems":"items",s="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",n=a.items.map((e,r)=>rj(e,t,{...o,path:[...o.path,i,r]})),l=a.rest?rj(a.rest,t,{...o,path:[...o.path,s,..."openapi-3.0"===t.target?[a.items.length]:[]]}):null;"draft-2020-12"===t.target?(r.prefixItems=n,l&&(r.items=l)):"openapi-3.0"===t.target?(r.items={anyOf:n},l&&r.items.anyOf.push(l),r.minItems=n.length,l||(r.maxItems=n.length)):(r.items=n,l&&(r.additionalItems=l));let{minimum:c,maximum:u}=e._zod.bag;"number"==typeof c&&(r.minItems=c),"number"==typeof u&&(r.maxItems=u)},record:rX,nullable:rY,nonoptional:rQ,default:r0,prefault:r1,catch:r2,pipe:r9,readonly:r4,promise:(e,t,r,o)=>{let a=e._zod.def;rj(a.innerType,t,o),t.seen.get(e).ref=a.innerType},optional:r5,lazy:r3};function r8(e,t){if("_idmap"in e){let r=rx({...t,processors:r6}),o={};for(let t of e._idmap.entries()){let[e,o]=t;rj(o,r)}let a={};for(let i of(r.external={registry:e,uri:t?.uri,defs:o},e._idmap.entries())){let[e,t]=i;rC(r,t),a[e]=rN(r,t)}return Object.keys(o).length>0&&(a.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:o}),{schemas:a}}let r=rx({...t,processors:r6});return rj(e,r),rC(r,e),rN(r,e)}let r7=J("ZodISODateTime",(e,t)=>{tk.init(e,t),oE.init(e,t)});function oe(e){return new r7({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eU(e)})}let ot=J("ZodISODate",(e,t)=>{tT.init(e,t),oE.init(e,t)});function or(e){return new ot({type:"string",format:"date",check:"string_format",...eU(e)})}let oo=J("ZodISOTime",(e,t)=>{tO.init(e,t),oE.init(e,t)}),oa=J("ZodISODuration",(e,t)=>{tx.init(e,t),oE.init(e,t)}),oi=J("ZodError",(e,t)=>{ta.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},o=(e,a=[])=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>o({issues:e},[...a,...i.path]));else if("invalid_key"===i.code)o({issues:i.issues},[...a,...i.path]);else if("invalid_element"===i.code)o({issues:i.issues},[...a,...i.path]);else{let e=[...a,...i.path];if(0===e.length)r._errors.push(t(i));else{let o=r,a=0;for(;a<e.length;){let r=e[a];a===e.length-1?(o[r]=o[r]||{_errors:[]},o[r]._errors.push(t(i))):o[r]=o[r]||{_errors:[]},o=o[r],a++}}}};return o(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},o=[];for(let a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):o.push(t(a));return{formErrors:o,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,eR,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,eR,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),os=ts(oi),on=tn(oi),ol=tl(oi),oc=tu(oi),ou=(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return ts(oi)(e,t,o)},od=(e,t,r)=>ts(oi)(e,t,r),op=async(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return tn(oi)(e,t,o)},oh=async(e,t,r)=>tn(oi)(e,t,r),of=(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return tl(oi)(e,t,o)},om=(e,t,r)=>tl(oi)(e,t,r),oy=async(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return tu(oi)(e,t,o)},og=async(e,t,r)=>tu(oi)(e,t,r),ov=new WeakMap;function ob(e,t,r){let o=Object.getPrototypeOf(e),a=ov.get(o);if(a||(a=new Set,ov.set(o,a)),!a.has(t))for(let e in a.add(t),r){let t=r[e];Object.defineProperty(o,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let o_=J("ZodType",(e,t)=>(th.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rI(e,"input"),output:rI(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let o=rx({...r,processors:t});return rj(e,o),rC(o,e),rN(o,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>os(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>ol(e,t,r),e.parseAsync=async(t,r)=>on(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>oc(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>ou(e,t,r),e.decode=(t,r)=>od(e,t,r),e.encodeAsync=async(t,r)=>op(e,t,r),e.decodeAsync=async(t,r)=>oh(e,t,r),e.safeEncode=(t,r)=>of(e,t,r),e.safeDecode=(t,r)=>om(e,t,r),e.safeEncodeAsync=async(t,r)=>oy(e,t,r),e.safeDecodeAsync=async(t,r)=>og(e,t,r),ob(e,"ZodType",{check(...e){let t=this.def;return this.clone(ej(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return eD(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new aP({type:"custom",check:"custom",fn:e,...eU(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let o,a;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eG(e,t.value,o._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=o),e.continue??(e.continue=!o._zod.def.abort),t.issues.push(eG(e)))},e(t.value,t)),(a=new eZ({check:"custom",...eU(t)}))._zod.check=r,o=a}(e,t))},overwrite(e){return this.check(rO(e))},optional(){return ap(this)},exactOptional(){var e;return e=this,new ah({type:"optional",innerType:e})},nullable(){return am(this)},nullish(){return ap(am(this))},nonoptional(e){var t;return t=this,new av({type:"nonoptional",innerType:t,...eU(e)})},array(){return o9(this)},or(e){return o8([this,e])},and(e){return ar(this,e)},transform(e){return aS(this,au(e))},default(e){var t,r;return t=this,r=e,new ay({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():eq(r)}})},prefault(e){var t,r;return t=this,r=e,new ag({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():eq(r)}})},catch(e){var t,r;return t=this,new ab({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return aS(this,e)},readonly(){var e;return e=this,new aw({type:"readonly",innerType:e})},describe(e){let t=this.clone();return rg.add(t,{description:e}),t},meta(...e){if(0===e.length)return rg.get(this);let t=this.clone();return rg.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>rg.get(e)?.description,configurable:!0}),e)),oS=J("_ZodString",(e,t)=>{tf.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rM(e,t,r,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,ob(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new e5({check:"string_format",format:"regex",...eU(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new e8({check:"string_format",format:"includes",...eU(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new e7({check:"string_format",format:"starts_with",...eU(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new te({check:"string_format",format:"ends_with",...eU(t),suffix:e})}(...e))},min(...e){return this.check(rk(...e))},max(...e){return this.check(rP(...e))},length(...e){return this.check(rT(...e))},nonempty(...e){return this.check(rk(1,...e))},lowercase(e){return this.check(new e3({check:"string_format",format:"lowercase",...eU(e)}))},uppercase(e){return this.check(new e6({check:"string_format",format:"uppercase",...eU(e)}))},trim(){return this.check(rO(e=>e.trim()))},normalize(...e){return this.check(function(e){return rO(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(rO(e=>e.toLowerCase()))},toUpperCase(){return this.check(rO(e=>e.toUpperCase()))},slugify(){return this.check(rO(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})}),o$=J("ZodString",(e,t)=>{tf.init(e,t),oS.init(e,t),e.email=t=>e.check(rv(oR,t)),e.url=t=>e.check(r_(oT,t)),e.jwt=t=>e.check(new oF({type:"string",format:"jwt",check:"string_format",abort:!1,...eU(t)})),e.emoji=t=>e.check(new oO({type:"string",format:"emoji",check:"string_format",abort:!1,...eU(t)})),e.guid=t=>e.check(rb(oP,t)),e.uuid=t=>e.check(new ok({type:"string",format:"uuid",check:"string_format",abort:!1,...eU(t)})),e.uuidv4=t=>e.check(new ok({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eU(t)})),e.uuidv6=t=>e.check(new ok({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eU(t)})),e.uuidv7=t=>e.check(new ok({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eU(t)})),e.nanoid=t=>e.check(new ox({type:"string",format:"nanoid",check:"string_format",abort:!1,...eU(t)})),e.guid=t=>e.check(rb(oP,t)),e.cuid=t=>e.check(new oj({type:"string",format:"cuid",check:"string_format",abort:!1,...eU(t)})),e.cuid2=t=>e.check(new oC({type:"string",format:"cuid2",check:"string_format",abort:!1,...eU(t)})),e.ulid=t=>e.check(new oN({type:"string",format:"ulid",check:"string_format",abort:!1,...eU(t)})),e.base64=t=>e.check(new oD({type:"string",format:"base64",check:"string_format",abort:!1,...eU(t)})),e.base64url=t=>e.check(new oU({type:"string",format:"base64url",check:"string_format",abort:!1,...eU(t)})),e.xid=t=>e.check(new oI({type:"string",format:"xid",check:"string_format",abort:!1,...eU(t)})),e.ksuid=t=>e.check(new oA({type:"string",format:"ksuid",check:"string_format",abort:!1,...eU(t)})),e.ipv4=t=>e.check(new oM({type:"string",format:"ipv4",check:"string_format",abort:!1,...eU(t)})),e.ipv6=t=>e.check(new oq({type:"string",format:"ipv6",check:"string_format",abort:!1,...eU(t)})),e.cidrv4=t=>e.check(new oz({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eU(t)})),e.cidrv6=t=>e.check(new oL({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eU(t)})),e.e164=t=>e.check(new oV({type:"string",format:"e164",check:"string_format",abort:!1,...eU(t)})),e.datetime=t=>e.check(oe(t)),e.date=t=>e.check(or(t)),e.time=t=>e.check(new oo({type:"string",format:"time",check:"string_format",precision:null,...eU(t)})),e.duration=t=>e.check(new oa({type:"string",format:"duration",check:"string_format",...eU(t)}))});function ow(e){return new o$({type:"string",...eU(e)})}let oE=J("ZodStringFormat",(e,t)=>{tm.init(e,t),oS.init(e,t)}),oR=J("ZodEmail",(e,t)=>{tv.init(e,t),oE.init(e,t)}),oP=J("ZodGUID",(e,t)=>{ty.init(e,t),oE.init(e,t)}),ok=J("ZodUUID",(e,t)=>{tg.init(e,t),oE.init(e,t)}),oT=J("ZodURL",(e,t)=>{tb.init(e,t),oE.init(e,t)}),oO=J("ZodEmoji",(e,t)=>{t_.init(e,t),oE.init(e,t)}),ox=J("ZodNanoID",(e,t)=>{tS.init(e,t),oE.init(e,t)}),oj=J("ZodCUID",(e,t)=>{t$.init(e,t),oE.init(e,t)}),oC=J("ZodCUID2",(e,t)=>{tw.init(e,t),oE.init(e,t)}),oN=J("ZodULID",(e,t)=>{tE.init(e,t),oE.init(e,t)}),oI=J("ZodXID",(e,t)=>{tR.init(e,t),oE.init(e,t)}),oA=J("ZodKSUID",(e,t)=>{tP.init(e,t),oE.init(e,t)}),oM=J("ZodIPv4",(e,t)=>{tj.init(e,t),oE.init(e,t)}),oq=J("ZodIPv6",(e,t)=>{tC.init(e,t),oE.init(e,t)}),oz=J("ZodCIDRv4",(e,t)=>{tN.init(e,t),oE.init(e,t)}),oL=J("ZodCIDRv6",(e,t)=>{tI.init(e,t),oE.init(e,t)}),oD=J("ZodBase64",(e,t)=>{tM.init(e,t),oE.init(e,t)}),oU=J("ZodBase64URL",(e,t)=>{tq.init(e,t),oE.init(e,t)}),oV=J("ZodE164",(e,t)=>{tz.init(e,t),oE.init(e,t)}),oF=J("ZodJWT",(e,t)=>{tL.init(e,t),oE.init(e,t)}),oH=J("ZodNumber",(e,t)=>{tD.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rq(e,t,r,o),ob(e,"ZodNumber",{gt(e,t){return this.check(rw(e,t))},gte(e,t){return this.check(rE(e,t))},min(e,t){return this.check(rE(e,t))},lt(e,t){return this.check(rS(e,t))},lte(e,t){return this.check(r$(e,t))},max(e,t){return this.check(r$(e,t))},int(e){return this.check(oB(e))},safe(e){return this.check(oB(e))},positive(e){return this.check(rw(0,e))},nonnegative(e){return this.check(rE(0,e))},negative(e){return this.check(rS(0,e))},nonpositive(e){return this.check(r$(0,e))},multipleOf(e,t){return this.check(rR(e,t))},step(e,t){return this.check(rR(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function oK(e){return new oH({type:"number",checks:[],...eU(e)})}let oJ=J("ZodNumberFormat",(e,t)=>{tU.init(e,t),oH.init(e,t)});function oB(e){return new oJ({type:"number",check:"number_format",abort:!1,format:"safeint",...eU(e)})}let oG=J("ZodBoolean",(e,t)=>{tV.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rz(e,t,r,o)});function oZ(e){return new oG({type:"boolean",...eU(e)})}let oW=J("ZodNull",(e,t)=>{tF.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rL(e,t,r,o)});function oX(e){return new oW({type:"null",...eU(e)})}let oY=J("ZodAny",(e,t)=>{tH.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rU(e,t,r,o)}),oQ=J("ZodUnknown",(e,t)=>{tK.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rV(e,t,r,o)});function o0(){return new oQ({type:"unknown"})}let o1=J("ZodNever",(e,t)=>{tJ.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rD(e,t,r,o)}),o2=J("ZodArray",(e,t)=>{tG.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rB(e,t,r,o),e.element=t.element,ob(e,"ZodArray",{min(e,t){return this.check(rk(e,t))},nonempty(e){return this.check(rk(1,e))},max(e,t){return this.check(rP(e,t))},length(e,t){return this.check(rT(e,t))},unwrap(){return this.element}})});function o9(e,t){return new o2({type:"array",element:e,...eU(t)})}let o4=J("ZodObject",(e,t)=>{tQ.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rG(e,t,r,o),eO(e,"shape",()=>t.shape),ob(e,"ZodObject",{keyof(){return as(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:o0()})},loose(){return this.clone({...this._zod.def,catchall:o0()})},strict(){return this.clone({...this._zod.def,catchall:new o1({type:"never",...eU(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!eM(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=ej(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return ex(this,"shape",r),r}});return eD(e,o)}(this,e)},safeExtend(e){var t=this;if(!eM(e))throw Error("Invalid input to safeExtend: expected a plain object");let r=ej(t._zod.def,{get shape(){let r={...t._zod.def.shape,...e};return ex(this,"shape",r),r}});return eD(t,r)},merge(e){var t=this;if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ej(t._zod.def,{get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return ex(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return eD(t,r)},pick(e){return function(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let a=ej(e._zod.def,{get shape(){let e={};for(let o in t){if(!(o in r.shape))throw Error(`Unrecognized key: "${o}"`);t[o]&&(e[o]=r.shape[o])}return ex(this,"shape",e),e},checks:[]});return eD(e,a)}(this,e)},omit(e){return function(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let a=ej(e._zod.def,{get shape(){let o={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete o[e]}return ex(this,"shape",o),o},checks:[]});return eD(e,a)}(this,e)},partial(...e){return function(e,t,r){let o=t._zod.def.checks;if(o&&o.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=ej(t._zod.def,{get shape(){let o=t._zod.def.shape,a={...o};if(r)for(let t in r){if(!(t in o))throw Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:o[t]}):o[t])}else for(let t in o)a[t]=e?new e({type:"optional",innerType:o[t]}):o[t];return ex(this,"shape",a),a},checks:[]});return eD(t,a)}(ad,this,e[0])},required(...e){var t,r;let o;return t=this,r=e[0],o=ej(t._zod.def,{get shape(){let e=t._zod.def.shape,o={...e};if(r)for(let t in r){if(!(t in o))throw Error(`Unrecognized key: "${t}"`);r[t]&&(o[t]=new av({type:"nonoptional",innerType:e[t]}))}else for(let t in e)o[t]=new av({type:"nonoptional",innerType:e[t]});return ex(this,"shape",o),o}}),eD(t,o)}})});function o5(e,t){return new o4({type:"object",shape:e??{},...eU(t)})}function o3(e,t){return new o4({type:"object",shape:e,catchall:o0(),...eU(t)})}let o6=J("ZodUnion",(e,t)=>{t1.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rZ(e,t,r,o),e.options=t.options});function o8(e,t){return new o6({type:"union",options:e,...eU(t)})}let o7=J("ZodDiscriminatedUnion",(e,t)=>{o6.init(e,t),t2.init(e,t)});function ae(e,t,r){return new o7({type:"union",options:t,discriminator:e,...eU(r)})}let at=J("ZodIntersection",(e,t)=>{t9.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rW(e,t,r,o)});function ar(e,t){return new at({type:"intersection",left:e,right:t})}let ao=J("ZodRecord",(e,t)=>{t5.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rX(e,t,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function aa(e,t,r){return new ao(t&&t._zod?{type:"record",keyType:e,valueType:t,...eU(r)}:{type:"record",keyType:ow(),valueType:e,...eU(t)})}let ai=J("ZodEnum",(e,t)=>{t3.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rF(e,t,r,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,o)=>{let a={};for(let o of e)if(r.has(o))a[o]=t.entries[o];else throw Error(`Key ${o} not found in enum`);return new ai({...t,checks:[],...eU(o),entries:a})},e.exclude=(e,o)=>{let a={...t.entries};for(let t of e)if(r.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new ai({...t,checks:[],...eU(o),entries:a})}});function as(e,t){return new ai({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eU(t)})}let an=J("ZodLiteral",(e,t)=>{t6.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rH(e,t,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function al(e,t){return new an({type:"literal",values:Array.isArray(e)?e:[e],...eU(t)})}let ac=J("ZodTransform",(e,t)=>{t8.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rJ(e,t,r,o),e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new G(e.constructor.name);r.addIssue=o=>{"string"==typeof o?r.issues.push(eG(o,r.value,t)):(o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),r.issues.push(eG(o)))};let a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=a,r.fallback=!0,r)}});function au(e){return new ac({type:"transform",transform:e})}let ad=J("ZodOptional",(e,t)=>{re.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r5(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function ap(e){return new ad({type:"optional",innerType:e})}let ah=J("ZodExactOptional",(e,t)=>{rt.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r5(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),af=J("ZodNullable",(e,t)=>{rr.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rY(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function am(e){return new af({type:"nullable",innerType:e})}let ay=J("ZodDefault",(e,t)=>{ro.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r0(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ag=J("ZodPrefault",(e,t)=>{ri.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r1(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),av=J("ZodNonOptional",(e,t)=>{rs.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rQ(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),ab=J("ZodCatch",(e,t)=>{rl.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r2(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),a_=J("ZodPipe",(e,t)=>{rc.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r9(e,t,r,o),e.in=t.in,e.out=t.out});function aS(e,t){return new a_({type:"pipe",in:e,out:t})}let a$=J("ZodPreprocess",(e,t)=>{a_.init(e,t),rd.init(e,t)}),aw=J("ZodReadonly",(e,t)=>{rp.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r4(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),aE=J("ZodLazy",(e,t)=>{rf.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r3(e,t,r,o),e.unwrap=()=>e._zod.def.getter()});function aR(e){return new aE({type:"lazy",getter:e})}let aP=J("ZodCustom",(e,t)=>{rm.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rK(e,t,r,o)});function ak(e,t){return new a$({type:"pipe",in:au(e),out:t})}_||(_={});let aT="2025-11-25",aO=[aT,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ax="io.modelcontextprotocol/protocolVersion",aj="io.modelcontextprotocol/clientInfo",aC="io.modelcontextprotocol/serverInfo",aN="io.modelcontextprotocol/clientCapabilities",aI="io.modelcontextprotocol/subscriptionId",aA="io.modelcontextprotocol/logLevel",aM=aR(()=>o8([ow(),oK(),oZ(),oX(),aa(ow(),aM),o9(aM)])),aq=aa(ow(),aM),az=o9(aM),aL=o8([ow(),oK().int()]),aD=ow(),aU=o5({ttl:oK().optional()}),aV=o5({taskId:ow()}),aF=o3({progressToken:aL.optional(),"io.modelcontextprotocol/related-task":aV.optional()}),aH=o5({_meta:aF.optional()}),aK=aH.extend({task:aU.optional()}),aJ=o5({method:ow(),params:aH.loose().optional()}),aB=o5({_meta:aF.optional()}),aG=o5({method:ow(),params:aB.loose().optional()}),aZ=o3({get[aC](){return ie.optional().catch(void 0)}}),aW=o3({_meta:aZ.optional()}),aX=o8([ow(),oK().int()]),aY=o5({jsonrpc:al("2.0"),id:aX,...aJ.shape}).strict(),aQ=o5({jsonrpc:al("2.0"),...aG.shape}).strict(),a0=o5({jsonrpc:al("2.0"),id:aX,result:aW}).strict(),a1=o5({jsonrpc:al("2.0"),id:aX.optional(),error:o5({code:oK().int(),message:ow(),data:o0().optional()})}).strict(),a2=o8([aY,aQ,a0,a1]),a9=o8([a0,a1]),a4=aW.strict(),a5=aB.extend({requestId:aX.optional(),reason:ow().optional()}),a3=aG.extend({method:al("notifications/cancelled"),params:a5}),a6=o5({src:ow(),mimeType:ow().optional(),sizes:o9(ow()).optional(),theme:as(["light","dark"]).optional()}),a8=o5({icons:o9(a6).optional()}),a7=o5({name:ow(),title:ow().optional()}),ie=a7.extend({...a7.shape,...a8.shape,version:ow(),websiteUrl:ow().optional(),description:ow().optional()}),it=ar(o5({applyDefaults:oZ().optional()}),aq),ir=ak(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,ar(o5({form:it.optional(),url:aq.optional()}),aq.optional())),io=o3({list:aq.optional(),cancel:aq.optional(),requests:o3({sampling:o3({createMessage:aq.optional()}).optional(),elicitation:o3({create:aq.optional()}).optional()}).optional()}),ia=o3({list:aq.optional(),cancel:aq.optional(),requests:o3({tools:o3({call:aq.optional()}).optional()}).optional()}),ii=o5({experimental:aa(ow(),aq).optional(),sampling:o5({context:aq.optional(),tools:aq.optional()}).optional(),elicitation:ir.optional(),roots:o5({listChanged:oZ().optional()}).optional(),tasks:io.optional(),extensions:aa(ow(),aq).optional()}),is=aH.extend({protocolVersion:ow(),capabilities:ii,clientInfo:ie}),il=aJ.extend({method:al("initialize"),params:is}),ic=o5({experimental:aa(ow(),aq).optional(),logging:aq.optional(),completions:aq.optional(),prompts:o5({listChanged:oZ().optional()}).optional(),resources:o5({subscribe:oZ().optional(),listChanged:oZ().optional()}).optional(),tools:o5({listChanged:oZ().optional()}).optional(),tasks:ia.optional(),extensions:aa(ow(),aq).optional()}),iu=aW.extend({protocolVersion:ow(),capabilities:ic,serverInfo:ie,instructions:ow().optional()}),id=aG.extend({method:al("notifications/initialized"),params:aB.optional()}),ip=aJ.extend({method:al("server/discover"),params:aH.optional()}),ih=aW.extend({supportedVersions:o9(ow()),capabilities:ic,instructions:ow().optional()}),im=aJ.extend({method:al("ping"),params:aH.optional()}),iy=o5({progress:oK(),total:ap(oK()),message:ap(ow())}),ig=o5({...aB.shape,...iy.shape,progressToken:aL}),iv=aG.extend({method:al("notifications/progress"),params:ig}),ib=aH.extend({cursor:aD.optional()}),i_=aJ.extend({params:ib.optional()}),iS=aW.extend({nextCursor:aD.optional()}),i$=o5({uri:ow(),mimeType:ap(ow()),_meta:aa(ow(),o0()).optional()}),iw=i$.extend({text:ow()}),iE=ow().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),iR=i$.extend({blob:iE}),iP=as(["user","assistant"]),ik=o5({audience:o9(iP).optional(),priority:oK().min(0).max(1).optional(),lastModified:oe({offset:!0}).optional()}),iT=o5({...a7.shape,...a8.shape,uri:ow(),description:ap(ow()),mimeType:ap(ow()),size:ap(oK()),annotations:ik.optional(),_meta:ap(o3({}))}),iO=o5({...a7.shape,...a8.shape,uriTemplate:ow(),description:ap(ow()),mimeType:ap(ow()),annotations:ik.optional(),_meta:ap(o3({}))}),ix=i_.extend({method:al("resources/list")}),ij=iS.extend({resources:o9(iT)}),iC=i_.extend({method:al("resources/templates/list")}),iN=iS.extend({resourceTemplates:o9(iO)}),iI=aH.extend({uri:ow()}),iA=aJ.extend({method:al("resources/read"),params:iI}),iM=aW.extend({contents:o9(o8([iw,iR]))}),iq=aG.extend({method:al("notifications/resources/list_changed"),params:aB.optional()}),iz=aJ.extend({method:al("resources/subscribe"),params:iI}),iL=aJ.extend({method:al("resources/unsubscribe"),params:iI}),iD=o5({toolsListChanged:oZ().optional(),promptsListChanged:oZ().optional(),resourcesListChanged:oZ().optional(),resourceSubscriptions:o9(ow()).optional()}),iU=aH.extend({notifications:iD}),iV=aJ.extend({method:al("subscriptions/listen"),params:iU}),iF=aB.extend({notifications:iD}),iH=aG.extend({method:al("notifications/subscriptions/acknowledged"),params:iF}),iK=aZ.extend({[aI]:aX}),iJ=aW.extend({_meta:iK}),iB=aB.extend({uri:ow()}),iG=aG.extend({method:al("notifications/resources/updated"),params:iB}),iZ=o5({name:ow(),description:ap(ow()),required:ap(oZ())}),iW=o5({...a7.shape,...a8.shape,description:ap(ow()),arguments:ap(o9(iZ)),_meta:ap(o3({}))}),iX=i_.extend({method:al("prompts/list")}),iY=iS.extend({prompts:o9(iW)}),iQ=aH.extend({name:ow(),arguments:aa(ow(),ow()).optional()}),i0=aJ.extend({method:al("prompts/get"),params:iQ}),i1=o5({type:al("text"),text:ow(),annotations:ik.optional(),_meta:aa(ow(),o0()).optional()}),i2=o5({type:al("image"),data:iE,mimeType:ow(),annotations:ik.optional(),_meta:aa(ow(),o0()).optional()}),i9=o5({type:al("audio"),data:iE,mimeType:ow(),annotations:ik.optional(),_meta:aa(ow(),o0()).optional()}),i4=o5({type:al("tool_use"),name:ow(),id:ow(),input:aa(ow(),o0()),_meta:aa(ow(),o0()).optional()}),i5=o5({type:al("resource"),resource:o8([iw,iR]),annotations:ik.optional(),_meta:aa(ow(),o0()).optional()}),i3=iT.extend({type:al("resource_link")}),i6=o8([i1,i2,i9,i3,i5]),i8=o5({role:iP,content:i6}),i7=aW.extend({description:ow().optional(),messages:o9(i8)}),se=aG.extend({method:al("notifications/prompts/list_changed"),params:aB.optional()}),st=o5({title:ow().optional(),readOnlyHint:oZ().optional(),destructiveHint:oZ().optional(),idempotentHint:oZ().optional(),openWorldHint:oZ().optional()}),sr=o5({taskSupport:as(["required","optional","forbidden"]).optional()}),so=o5({...a7.shape,...a8.shape,description:ow().optional(),inputSchema:o5({type:al("object"),properties:aa(ow(),aM).optional(),required:o9(ow()).optional()}).catchall(o0()),outputSchema:o3({$schema:ow().optional()}).optional(),annotations:st.optional(),execution:sr.optional(),_meta:aa(ow(),o0()).optional()}),sa=i_.extend({method:al("tools/list")}),si=iS.extend({tools:o9(so)}),ss=aW.extend({content:o9(i6).default([]),structuredContent:o0().optional(),isError:oZ().optional()}),sn=ss.or(aW.extend({toolResult:o0()})),sl=aK.extend({name:ow(),arguments:aa(ow(),o0()).optional()}),sc=aJ.extend({method:al("tools/call"),params:sl}),su=aG.extend({method:al("notifications/tools/list_changed"),params:aB.optional()}),sd=o5({autoRefresh:oZ().default(!0),debounceMs:oK().int().nonnegative().default(300)}),sp=as(["debug","info","notice","warning","error","critical","alert","emergency"]),sh=aH.extend({level:sp}),sf=aJ.extend({method:al("logging/setLevel"),params:sh}),sm=aB.extend({level:sp,logger:ow().optional(),data:o0()}),sy=aG.extend({method:al("notifications/message"),params:sm}),sg=o5({name:ow().optional()}),sv=o5({hints:o9(sg).optional(),costPriority:oK().min(0).max(1).optional(),speedPriority:oK().min(0).max(1).optional(),intelligencePriority:oK().min(0).max(1).optional()}),sb=o5({mode:as(["auto","required","none"]).optional()}),s_=o5({type:al("tool_result"),toolUseId:ow().describe("The unique identifier for the corresponding tool call."),content:o9(i6),structuredContent:o0().optional(),isError:oZ().optional(),_meta:aa(ow(),o0()).optional()}),sS=ae("type",[i1,i2,i9]),s$=ae("type",[i1,i2,i9,i4,s_]),sw=o5({role:iP,content:o8([s$,o9(s$)]),_meta:aa(ow(),o0()).optional()}),sE=aK.extend({messages:o9(sw),modelPreferences:sv.optional(),systemPrompt:ow().optional(),includeContext:as(["none","thisServer","allServers"]).optional(),temperature:oK().optional(),maxTokens:oK().int(),stopSequences:o9(ow()).optional(),metadata:aq.optional(),tools:o9(so).optional(),toolChoice:sb.optional()}),sR=aJ.extend({method:al("sampling/createMessage"),params:sE}),sP=aW.extend({model:ow(),stopReason:ap(as(["endTurn","stopSequence","maxTokens"]).or(ow())),role:iP,content:sS}),sk=aW.extend({model:ow(),stopReason:ap(as(["endTurn","stopSequence","maxTokens","toolUse"]).or(ow())),role:iP,content:o8([s$,o9(s$)])}),sT=o5({type:al("boolean"),title:ow().optional(),description:ow().optional(),default:oZ().optional()}),sO=o5({type:al("string"),title:ow().optional(),description:ow().optional(),minLength:oK().optional(),maxLength:oK().optional(),format:as(["email","uri","date","date-time"]).optional(),default:ow().optional()}),sx=o5({type:as(["number","integer"]),title:ow().optional(),description:ow().optional(),minimum:oK().optional(),maximum:oK().optional(),default:oK().optional()}),sj=o5({type:al("string"),title:ow().optional(),description:ow().optional(),enum:o9(ow()),default:ow().optional()}),sC=o5({type:al("string"),title:ow().optional(),description:ow().optional(),oneOf:o9(o5({const:ow(),title:ow()})),default:ow().optional()}),sN=o5({type:al("string"),title:ow().optional(),description:ow().optional(),enum:o9(ow()),enumNames:o9(ow()).optional(),default:ow().optional()}),sI=o8([sj,sC]),sA=o5({type:al("array"),title:ow().optional(),description:ow().optional(),minItems:oK().optional(),maxItems:oK().optional(),items:o5({type:al("string"),enum:o9(ow())}),default:o9(ow()).optional()}),sM=o5({type:al("array"),title:ow().optional(),description:ow().optional(),minItems:oK().optional(),maxItems:oK().optional(),items:o5({anyOf:o9(o5({const:ow(),title:ow()}))}),default:o9(ow()).optional()}),sq=o8([sA,sM]),sz=o8([sN,sI,sq]),sL=o8([sz,sT,sO,sx]),sD=aK.extend({mode:al("form").optional(),message:ow(),requestedSchema:o5({type:al("object"),properties:aa(ow(),sL),required:o9(ow()).optional()}).catchall(o0())}),sU=aK.extend({mode:al("url"),message:ow(),elicitationId:ow(),url:ow().url()}),sV=o8([sD,sU]),sF=aJ.extend({method:al("elicitation/create"),params:sV}),sH=aB.extend({elicitationId:ow()}),sK=aG.extend({method:al("notifications/elicitation/complete"),params:sH}),sJ=aW.extend({action:as(["accept","decline","cancel"]),content:ak(e=>null===e?void 0:e,aa(ow(),o8([ow(),oK(),oZ(),o9(ow())])).optional())}),sB=o5({type:al("ref/resource"),uri:ow()}),sG=o5({type:al("ref/prompt"),name:ow()}),sZ=aH.extend({ref:o8([sG,sB]),argument:o5({name:ow(),value:ow()}),context:o5({arguments:aa(ow(),ow()).optional()}).optional()}),sW=aJ.extend({method:al("completion/complete"),params:sZ}),sX=aW.extend({completion:o3({values:o9(ow()).max(100),total:ap(oK().int()),hasMore:ap(oZ())})}),sY=o5({uri:ow().startsWith("file://"),name:ow().optional(),_meta:aa(ow(),o0()).optional()}),sQ=aJ.extend({method:al("roots/list"),params:aH.optional()}),s0=aW.extend({roots:o9(sY)}),s1=aG.extend({method:al("notifications/roots/list_changed"),params:aB.optional()}),s2=o3({ttl:oK().optional(),pollInterval:oK().optional()}),s9=as(["working","input_required","completed","failed","cancelled"]),s4=o5({taskId:ow(),status:s9,ttl:o8([oK(),oX()]),createdAt:ow(),lastUpdatedAt:ow(),pollInterval:ap(oK()),statusMessage:ap(ow())}),s5=aW.extend({task:s4}),s3=aB.merge(s4),s6=aG.extend({method:al("notifications/tasks/status"),params:s3}),s8=aJ.extend({method:al("tasks/get"),params:aH.extend({taskId:ow()})}),s7=aW.merge(s4),ne=aJ.extend({method:al("tasks/result"),params:aH.extend({taskId:ow()})}),nt=aW.loose(),nr=i_.extend({method:al("tasks/list")}),no=iS.extend({tasks:o9(s4)}),na=aJ.extend({method:al("tasks/cancel"),params:aH.extend({taskId:ow()})}),ni=aW.merge(s4),ns=o8([im,il,ip,sW,sf,i0,iX,ix,iC,iA,iz,iL,iV,sc,sa]),nn=o8([a3,iv,id,s1]),nl=o8([a4,sP,sk,sJ,s0]),nc=o8([im,sR,sF,sQ]),nu=o8([a3,iv,sy,iG,iq,su,se,iH,sK]),nd=o8([a4,iu,ih,sX,i7,iY,ij,iN,iM,ss,si,iJ]),np=r_(oT,void 0).superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:"custom",message:"URL must be parseable",fatal:!0}),K}).refine(e=>{let t=new URL(e);return"javascript:"!==t.protocol&&"data:"!==t.protocol&&"vbscript:"!==t.protocol},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),nh=o3({resource:ow().url(),authorization_servers:o9(np).optional(),jwks_uri:ow().url().optional(),scopes_supported:o9(ow()).optional(),bearer_methods_supported:o9(ow()).optional(),resource_signing_alg_values_supported:o9(ow()).optional(),resource_name:ow().optional(),resource_documentation:ow().optional(),resource_policy_uri:ow().url().optional(),resource_tos_uri:ow().url().optional(),tls_client_certificate_bound_access_tokens:oZ().optional(),authorization_details_types_supported:o9(ow()).optional(),dpop_signing_alg_values_supported:o9(ow()).optional(),dpop_bound_access_tokens_required:oZ().optional()}),nf=o3({issuer:ow(),authorization_endpoint:np,token_endpoint:np,registration_endpoint:np.optional(),scopes_supported:o9(ow()).optional(),response_types_supported:o9(ow()),response_modes_supported:o9(ow()).optional(),grant_types_supported:o9(ow()).optional(),token_endpoint_auth_methods_supported:o9(ow()).optional(),token_endpoint_auth_signing_alg_values_supported:o9(ow()).optional(),service_documentation:np.optional(),revocation_endpoint:np.optional(),revocation_endpoint_auth_methods_supported:o9(ow()).optional(),revocation_endpoint_auth_signing_alg_values_supported:o9(ow()).optional(),introspection_endpoint:ow().optional(),introspection_endpoint_auth_methods_supported:o9(ow()).optional(),introspection_endpoint_auth_signing_alg_values_supported:o9(ow()).optional(),code_challenge_methods_supported:o9(ow()).optional(),client_id_metadata_document_supported:oZ().optional(),authorization_response_iss_parameter_supported:oZ().optional().catch(void 0)}),nm=o3({issuer:ow(),authorization_endpoint:np,token_endpoint:np,userinfo_endpoint:np.optional(),jwks_uri:np,registration_endpoint:np.optional(),scopes_supported:o9(ow()).optional(),response_types_supported:o9(ow()),response_modes_supported:o9(ow()).optional(),grant_types_supported:o9(ow()).optional(),acr_values_supported:o9(ow()).optional(),subject_types_supported:o9(ow()),id_token_signing_alg_values_supported:o9(ow()),id_token_encryption_alg_values_supported:o9(ow()).optional(),id_token_encryption_enc_values_supported:o9(ow()).optional(),userinfo_signing_alg_values_supported:o9(ow()).optional(),userinfo_encryption_alg_values_supported:o9(ow()).optional(),userinfo_encryption_enc_values_supported:o9(ow()).optional(),request_object_signing_alg_values_supported:o9(ow()).optional(),request_object_encryption_alg_values_supported:o9(ow()).optional(),request_object_encryption_enc_values_supported:o9(ow()).optional(),token_endpoint_auth_methods_supported:o9(ow()).optional(),token_endpoint_auth_signing_alg_values_supported:o9(ow()).optional(),display_values_supported:o9(ow()).optional(),claim_types_supported:o9(ow()).optional(),claims_supported:o9(ow()).optional(),service_documentation:ow().optional(),claims_locales_supported:o9(ow()).optional(),ui_locales_supported:o9(ow()).optional(),claims_parameter_supported:oZ().optional(),request_parameter_supported:oZ().optional(),request_uri_parameter_supported:oZ().optional(),require_request_uri_registration:oZ().optional(),op_policy_uri:np.optional(),op_tos_uri:np.optional(),client_id_metadata_document_supported:oZ().optional(),authorization_response_iss_parameter_supported:oZ().optional().catch(void 0)}),ny=o5({...nm.shape,...nf.pick({code_challenge_methods_supported:!0}).shape}),ng=o5({access_token:ow(),id_token:ow().optional(),token_type:ow(),expires_in:new oH({type:"number",coerce:!0,checks:[],...eU(void 0)}).optional(),scope:ow().optional(),refresh_token:ow().optional()}).strip(),nv=o5({issued_token_type:al("urn:ietf:params:oauth:token-type:id-jag"),access_token:ow(),token_type:ow().optional(),expires_in:oK().optional(),scope:ow().optional()}).strip(),nb=o5({error:ow(),error_description:ow().optional(),error_uri:ow().optional()}),n_=np.optional().or(al("").transform(()=>void 0)),nS=o5({redirect_uris:o9(np),token_endpoint_auth_method:ow().optional(),grant_types:o9(ow()).optional(),response_types:o9(ow()).optional(),application_type:ow().optional(),client_name:ow().optional(),client_uri:np.optional(),logo_uri:n_,scope:ow().optional(),contacts:o9(ow()).optional(),tos_uri:n_,policy_uri:ow().optional(),jwks_uri:np.optional(),jwks:new oY({type:"any"}).optional(),software_id:ow().optional(),software_version:ow().optional(),software_statement:ow().optional()}).strip(),n$=o5({client_id:ow(),client_secret:ow().optional(),client_id_issued_at:oK().optional(),client_secret_expires_at:oK().optional()}).strip(),nw=nS.merge(n$),nE=o5({error:ow(),error_description:ow().optional()}).strip(),nR=o5({token:ow(),token_type_hint:ow().optional()}).strip(),nP=Symbol.for("mcp.sdk.errorBrands");function nk(e,t){let r=new Set,o=t;for(;"function"==typeof o;){let e=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&"string"==typeof e&&r.add(e),o=Object.getPrototypeOf(o)}0!==r.size&&Object.defineProperty(e,nP,{value:r,enumerable:!1,configurable:!0})}function nT(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,nP)){let r=t[nP];if(r&&"function"==typeof r.has&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](e){return nT(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return nT(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",nk(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});(d={}).NotConnected="NOT_CONNECTED",d.AlreadyConnected="ALREADY_CONNECTED",d.NotInitialized="NOT_INITIALIZED",d.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",d.RequestTimeout="REQUEST_TIMEOUT",d.ConnectionClosed="CONNECTION_CLOSED",d.SendFailed="SEND_FAILED",d.InvalidResult="INVALID_RESULT",d.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",d.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",d.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",d.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",d.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",d.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",d.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",d.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",d.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",d.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",d.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION";var nO=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return nT(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return nT(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="SdkError",nk(this,new.target)}};(class extends nO{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}});let nx={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},nj={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null};Object.keys(nx),Object.keys(nj);Symbol("modelcontextprotocol.resultCacheHintFallback");let nC=((p={})[p.ParseError=-32700]="ParseError",p[p.InvalidRequest=-32600]="InvalidRequest",p[p.MethodNotFound=-32601]="MethodNotFound",p[p.InvalidParams=-32602]="InvalidParams",p[p.InternalError=-32603]="InternalError",p[p.ResourceNotFound=-32002]="ResourceNotFound",p[p.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",p[p.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",p[p.UrlElicitationRequired=-32042]="UrlElicitationRequired",p);var nN=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return nT(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return nT(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",nk(this,new.target)}static fromError(t,r,o){return t===nC.UrlElicitationRequired&&o&&o.elicitations?new nA(o.elicitations,r):t===nC.UnsupportedProtocolVersion&&o&&Array.isArray(o.supported)&&"string"==typeof o.requested?new nM({supported:o.supported,requested:o.requested},r):(t===nC.InvalidParams||t===nC.ResourceNotFound)&&"string"==typeof o?.uri&&(t===nC.ResourceNotFound||1===Object.keys(o).length)?new nI(o.uri,r):t===nC.MissingRequiredClientCapability&&o&&null!==o.requiredCapabilities&&"object"==typeof o.requiredCapabilities&&!Array.isArray(o.requiredCapabilities)?new nq({requiredCapabilities:o.requiredCapabilities},r):new e(t,r,o)}},nI=class extends nN{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(nC.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},nA=class extends nN{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(nC.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},nM=class extends nN{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(nC.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},nq=class extends nN{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(nC.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let nz={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},nL={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};Object.keys(nz),Object.keys(nL);var nD=((e,t)=>{let r={};for(var o in e)A(r,o,{get:e[o],enumerable:!0});return t&&A(r,Symbol.toStringTag,{value:"Module"}),r})({AnnotationsSchema:()=>ik,AudioContentSchema:()=>i9,BaseMetadataSchema:()=>a7,BaseRequestParamsSchema:()=>aH,BlobResourceContentsSchema:()=>iR,BooleanSchemaSchema:()=>sT,CallToolRequestParamsSchema:()=>sl,CallToolRequestSchema:()=>sc,CallToolResultSchema:()=>ss,CancelTaskRequestSchema:()=>na,CancelTaskResultSchema:()=>ni,CancelledNotificationParamsSchema:()=>a5,CancelledNotificationSchema:()=>a3,ClientCapabilitiesSchema:()=>ii,ClientNotificationSchema:()=>nn,ClientRequestSchema:()=>ns,ClientResultSchema:()=>nl,ClientTasksCapabilitySchema:()=>io,CompatibilityCallToolResultSchema:()=>sn,CompleteRequestParamsSchema:()=>sZ,CompleteRequestSchema:()=>sW,CompleteResultSchema:()=>sX,ContentBlockSchema:()=>i6,CreateMessageRequestParamsSchema:()=>sE,CreateMessageRequestSchema:()=>sR,CreateMessageResultSchema:()=>sP,CreateMessageResultWithToolsSchema:()=>sk,CreateTaskResultSchema:()=>s5,CursorSchema:()=>aD,DiscoverRequestSchema:()=>ip,DiscoverResultSchema:()=>ih,ElicitRequestFormParamsSchema:()=>sD,ElicitRequestParamsSchema:()=>sV,ElicitRequestSchema:()=>sF,ElicitRequestURLParamsSchema:()=>sU,ElicitResultSchema:()=>sJ,ElicitationCompleteNotificationParamsSchema:()=>sH,ElicitationCompleteNotificationSchema:()=>sK,EmbeddedResourceSchema:()=>i5,EmptyResultSchema:()=>a4,EnumSchemaSchema:()=>sz,GetPromptRequestParamsSchema:()=>iQ,GetPromptRequestSchema:()=>i0,GetPromptResultSchema:()=>i7,GetTaskPayloadRequestSchema:()=>ne,GetTaskPayloadResultSchema:()=>nt,GetTaskRequestSchema:()=>s8,GetTaskResultSchema:()=>s7,IconSchema:()=>a6,IconsSchema:()=>a8,ImageContentSchema:()=>i2,ImplementationSchema:()=>ie,InitializeRequestParamsSchema:()=>is,InitializeRequestSchema:()=>il,InitializeResultSchema:()=>iu,InitializedNotificationSchema:()=>id,JSONArraySchema:()=>az,JSONObjectSchema:()=>aq,JSONRPCErrorResponseSchema:()=>a1,JSONRPCMessageSchema:()=>a2,JSONRPCNotificationSchema:()=>aQ,JSONRPCRequestSchema:()=>aY,JSONRPCResponseSchema:()=>a9,JSONRPCResultResponseSchema:()=>a0,JSONValueSchema:()=>aM,LegacyTitledEnumSchemaSchema:()=>sN,ListChangedOptionsBaseSchema:()=>sd,ListPromptsRequestSchema:()=>iX,ListPromptsResultSchema:()=>iY,ListResourceTemplatesRequestSchema:()=>iC,ListResourceTemplatesResultSchema:()=>iN,ListResourcesRequestSchema:()=>ix,ListResourcesResultSchema:()=>ij,ListRootsRequestSchema:()=>sQ,ListRootsResultSchema:()=>s0,ListTasksRequestSchema:()=>nr,ListTasksResultSchema:()=>no,ListToolsRequestSchema:()=>sa,ListToolsResultSchema:()=>si,LoggingLevelSchema:()=>sp,LoggingMessageNotificationParamsSchema:()=>sm,LoggingMessageNotificationSchema:()=>sy,ModelHintSchema:()=>sg,ModelPreferencesSchema:()=>sv,MultiSelectEnumSchemaSchema:()=>sq,NotificationSchema:()=>aG,NotificationsParamsSchema:()=>aB,NumberSchemaSchema:()=>sx,PaginatedRequestParamsSchema:()=>ib,PaginatedRequestSchema:()=>i_,PaginatedResultSchema:()=>iS,PingRequestSchema:()=>im,PrimitiveSchemaDefinitionSchema:()=>sL,ProgressNotificationParamsSchema:()=>ig,ProgressNotificationSchema:()=>iv,ProgressSchema:()=>iy,ProgressTokenSchema:()=>aL,PromptArgumentSchema:()=>iZ,PromptListChangedNotificationSchema:()=>se,PromptMessageSchema:()=>i8,PromptReferenceSchema:()=>sG,PromptSchema:()=>iW,ReadResourceRequestParamsSchema:()=>iI,ReadResourceRequestSchema:()=>iA,ReadResourceResultSchema:()=>iM,RelatedTaskMetadataSchema:()=>aV,RequestIdSchema:()=>aX,RequestMetaSchema:()=>aF,RequestSchema:()=>aJ,ResourceContentsSchema:()=>i$,ResourceLinkSchema:()=>i3,ResourceListChangedNotificationSchema:()=>iq,ResourceRequestParamsSchema:()=>iI,ResourceSchema:()=>iT,ResourceTemplateReferenceSchema:()=>sB,ResourceTemplateSchema:()=>iO,ResourceUpdatedNotificationParamsSchema:()=>iB,ResourceUpdatedNotificationSchema:()=>iG,ResultMetaObjectSchema:()=>aZ,ResultSchema:()=>aW,RoleSchema:()=>iP,RootSchema:()=>sY,RootsListChangedNotificationSchema:()=>s1,SamplingContentSchema:()=>sS,SamplingMessageContentBlockSchema:()=>s$,SamplingMessageSchema:()=>sw,ServerCapabilitiesSchema:()=>ic,ServerNotificationSchema:()=>nu,ServerRequestSchema:()=>nc,ServerResultSchema:()=>nd,ServerTasksCapabilitySchema:()=>ia,SetLevelRequestParamsSchema:()=>sh,SetLevelRequestSchema:()=>sf,SingleSelectEnumSchemaSchema:()=>sI,StringSchemaSchema:()=>sO,SubscribeRequestParamsSchema:()=>iI,SubscribeRequestSchema:()=>iz,SubscriptionFilterSchema:()=>iD,SubscriptionsAcknowledgedNotificationParamsSchema:()=>iF,SubscriptionsAcknowledgedNotificationSchema:()=>iH,SubscriptionsListenRequestParamsSchema:()=>iU,SubscriptionsListenRequestSchema:()=>iV,SubscriptionsListenResultMetaSchema:()=>iK,SubscriptionsListenResultSchema:()=>iJ,TaskAugmentedRequestParamsSchema:()=>aK,TaskCreationParamsSchema:()=>s2,TaskMetadataSchema:()=>aU,TaskSchema:()=>s4,TaskStatusNotificationParamsSchema:()=>s3,TaskStatusNotificationSchema:()=>s6,TaskStatusSchema:()=>s9,TextContentSchema:()=>i1,TextResourceContentsSchema:()=>iw,TitledMultiSelectEnumSchemaSchema:()=>sM,TitledSingleSelectEnumSchemaSchema:()=>sC,ToolAnnotationsSchema:()=>st,ToolChoiceSchema:()=>sb,ToolExecutionSchema:()=>sr,ToolListChangedNotificationSchema:()=>su,ToolResultContentSchema:()=>s_,ToolSchema:()=>so,ToolUseContentSchema:()=>i4,UnsubscribeRequestParamsSchema:()=>iI,UnsubscribeRequestSchema:()=>iL,UntitledMultiSelectEnumSchemaSchema:()=>sA,UntitledSingleSelectEnumSchemaSchema:()=>sj});let nU=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType;function nV(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function nF(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}nC.InvalidRequest,nC.UnsupportedProtocolVersion,nC.InvalidParams,nC.MethodNotFound,nC.InvalidParams,nC.MissingRequiredClientCapability,nC.ParseError,nC.InvalidRequest,nC.MethodNotFound,nC.UnsupportedProtocolVersion,nC.MissingRequiredClientCapability;let nH=!1,nK="draft-2020-12",nJ=/\\\.\\d\{(\d+)\}/;function nB(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let nG=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function nZ(e){return nG.has(e)||e.startsWith("x-")}let nW=new Set(["$schema",...Object.keys(sD.shape.requestedSchema.shape)]),nX={string:nV([sO,sj,sC,sN]),number:nV([sx]),integer:nV([sx]),boolean:nV([sT]),array:nV([sA,sM])},nY=new Set(sO.shape.format.unwrap().options),nQ=Object.assign(function(e){let t=void 0!==e.inputRequests&&Object.keys(e.inputRequests).length>0,r="string"==typeof e.requestState;if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...void 0!==e.inputRequests&&{inputRequests:e.inputRequests},...void 0!==e.requestState&&{requestState:e.requestState}}},{elicit(e){try{return{method:"elicitation/create",params:function(e){var t;if(!nF(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let r=e.requestedSchema["~standard"].vendor,o=function(e,t){let r={},o=[];for(let[a,i]of Object.entries(e))"properties"===a&&nB(i)?r[a]=Object.fromEntries(Object.entries(i).map(([e,r])=>[e,function(e,t,r,o){if(!nB(e))return e;let a="string"==typeof e.type&&Object.hasOwn(nX,e.type)?nX[e.type]:void 0;if(void 0===a)return e;let i={};for(let[n,l]of Object.entries(e))if(a.has(n)||nZ(n))i[n]=l;else if("pattern"===n&&"string"===e.type&&"string"==typeof e.format)if(nY.has(e.format)){var s;"string"==typeof l&&(s=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[rv(oR,void 0)];break;case"uri":r=[r_(oT,void 0)];break;case"date":r=[or()];break;case"date-time":let o,a;o=nJ.exec(t),a=[void 0,-1,0],o&&a.push(Number(o[1])),r=[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>a.map(r=>oe({local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=r8(e,{target:nK,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(s,l).has(l))||o.push(`${t}.${n}`)}else i[n]=l;else o.push(`${t}.${n}`);return i}(r,`properties.${e}`,t,o)])):nW.has(a)?r[a]=i:nZ(a)||o.push(a);if(o.length>0)throw new nN(nC.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}(function(e){try{return function(e,t="input"){let r,o=e["~standard"];if(o.jsonSchema)r=o.jsonSchema[t]({target:nK});else if("zod"===o.vendor){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");nH||(nH=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=r8(e,{target:nK,io:t})}else throw Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if("output"===t)return void 0!==r.type||!function e(t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;for(let r of["oneOf","anyOf","allOf"]){let o=t[r];if(Array.isArray(o)&&o.length>0)return o.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t)))}return!1}(r)?r:{type:"object",...r};if(void 0!==r.type&&"object"!==r.type)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}(e,"input")}catch(t){let e=t instanceof Error?t.message:String(t);throw new nN(nC.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),a=(t=sD.shape.requestedSchema,ol(t,o));if(!a.success)throw new nN(nC.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!nB(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!ol(sL,e).success).map(([e])=>`properties.${e}`);return r.length>0?r.join(", "):t}(o,a.error.message)}`);let i=function e(t,r,o=""){return Array.isArray(t)&&Array.isArray(r)?t.flatMap((t,a)=>e(t,r[a],`${o}[${a}]`)):nB(t)&&nB(r)?Object.entries(t).flatMap(([t,a])=>{let i=o?`${o}.${t}`:t;return Object.prototype.hasOwnProperty.call(r,t)?e(a,r[t],i):nZ(t)?[]:[i]}):[]}(o,a.data);if(i.length>0)throw new nN(nC.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);let s=(a.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(a.data.properties,e));if(s.length>0)throw new nN(nC.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}(e)}}catch(e){throw e instanceof nN?TypeError(e.message,{cause:e}):e}},elicitUrl:e=>({method:"elicitation/create",params:{...e,mode:"url"}}),createMessage:e=>({method:"sampling/createMessage",params:e}),listRoots:()=>({method:"roots/list"})});function n0(e,t,r){let o=n1(e,t);if("elicit"!==o.kind||"accept"!==o.action||void 0===o.content)return;if(void 0===r)return o.content;let a=r["~standard"].validate(o.content);if(a instanceof Promise)throw TypeError("acceptedContent(responses, key, schema) requires a synchronously-validating schema");return void 0===a.issues?a.value:void 0}function n1(e,t){if(void 0===e||"object"!=typeof e||null===e)return{kind:"missing"};let r=e[t];if(null===r||"object"!=typeof r||Array.isArray(r))return{kind:"missing"};if("accept"===r.action||"decline"===r.action||"cancel"===r.action){let e=r.content;return{kind:"elicit",action:r.action,...null!==e&&"object"==typeof e&&!Array.isArray(e)&&{content:e}}}return Array.isArray(r.roots)?{kind:"roots",roots:r.roots}:"string"==typeof r.role&&void 0!==r.content?{kind:"sampling",result:r}:{kind:"missing"}}let n2={},n9={};function n4(e,t){let r=e.slice(0,-6);n2[r]=t,n9[r]=e=>t.safeParse(e).success}for(let e of["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"])n4(e,nD[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:nv,OAuthClientInformationFullSchema:nw,OAuthClientInformationSchema:n$,OAuthClientMetadataSchema:nS,OAuthClientRegistrationErrorSchema:nE,OAuthErrorResponseSchema:nb,OAuthMetadataSchema:nf,OAuthProtectedResourceMetadataSchema:nh,OAuthTokenRevocationRequestSchema:nR,OAuthTokensSchema:ng,OpenIdProviderDiscoveryMetadataSchema:ny,OpenIdProviderMetadataSchema:nm}))n4(e,t);Object.freeze(n2),Object.freeze(n9);h=void 0,()=>h;D(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function a(e){this.parameters=Object.create(null),this.type=e}e.parse=function(e){if(!e)throw TypeError("argument string is required");var i,s,n,l="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof l)throw TypeError("argument string is required to be a string");var c=l.indexOf(";"),u=-1!==c?l.slice(0,c).trim():l.trim();if(!o.test(u))throw TypeError("invalid media type");var d=new a(u.toLowerCase());if(-1!==c){for(t.lastIndex=c;s=t.exec(l);){if(s.index!==c)throw TypeError("invalid parameter format");c+=s[0].length,i=s[1].toLowerCase(),34===(n=s[2]).charCodeAt(0)&&-1!==(n=n.slice(1,-1)).indexOf("\\")&&(n=n.replace(r,"$1")),d.parameters[i]=n}if(c!==l.length)throw TypeError("invalid parameter format")}return d}})();var n5=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}};function a(e,...t){let r=[e[0]],i=0;for(;i<t.length;)n(r,t[i]),r.push(e[++i]);return new o(r)}e._Code=o,e.nil=new o(""),e._=a;let i=new o("+");function s(e,...t){let a=[l(e[0])],c=0;for(;c<t.length;)a.push(i),n(a,t[c]),a.push(i,l(e[++c]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===i){var o,a;let i=(o=e[t-1],'""'===(a=e[t+1])?o:'""'===o?a:"string"==typeof o?a instanceof r||'"'!==o[o.length-1]?void 0:"string"!=typeof a?`${o.slice(0,-1)}${a}"`:'"'===a[0]?o.slice(0,-1)+a.slice(1):void 0:"string"!=typeof a||'"'!==a[0]||o instanceof r?void 0:`"${o}${a.slice(1)}`);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(a),new o(a)}function n(e,t){var a;t instanceof o?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(a=t)||"boolean"==typeof a||null===a?a:l(Array.isArray(a)?a.join(","):a))}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=n,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new o(l(e))},e.safeStringify=l,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new o(`.${t}`):a`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new o(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new o(e.toString())}}),n3=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=n5();var r,o,a=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}};(r=o||(e.UsedValueState=o={}))[r.Started=0]="Started",r[r.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var s=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(r)}[${o}]`}};e.ValueScopeName=s;let n=(0,t._)`\n`;var l=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?n:t.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:a}=o,i=null!=(r=t.key)?r:t.ref,s=this._values[a];if(s){let e=s.get(i);if(e)return e}else s=this._values[a]=new Map;s.set(i,o);let n=this._scope[a]||(this._scope[a]=[]),l=n.length;return n[l]=t.ref,o.setValue(t,{property:a,itemIndex:l}),o}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw Error(`CodeGen: name "${r}" has no value`);return(0,t._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(r,i,s={},n){let l=t.nil;for(let c in r){let u=r[c];if(!u)continue;let d=s[c]=s[c]||new Map;u.forEach(r=>{if(d.has(r))return;d.set(r,o.Started);let s=i(r);if(s){let o=this.opts.es5?e.varKinds.var:e.varKinds.const;l=(0,t._)`${l}${o} ${r} = ${s};${this.opts._n}`}else if(s=null==n?void 0:n(r))l=(0,t._)`${l}${s}${this.opts._n}`;else throw new a(r);d.set(r,o.Completed)})}return l}};e.ValueScope=l}),n6=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=n5(),r=n3();var o=n5();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var a=n3();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var i=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},s=class extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let o=e?r.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${o} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},n=class extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=x(this.rhs,e,r),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends n{constructor(e,t,r,o){super(e,r,o),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},c=class extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},d=class extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},p=class extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=x(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,o=r.length;for(;o--;){let a=r[o];a.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,a.names),r.splice(o,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>T(e,t.names),{})}},f=class extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},m=class extends h{},y=class extends f{};y.kind="else";var g=class e extends f{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(!0===t)return this.nodes;let r=this.else;if(r){let e=r.optimizeNodes();r=this.else=Array.isArray(e)?new y(e):e}return r?!1===t?r instanceof e?r:r.nodes:this.nodes.length?this:new e(j(t),r instanceof e?[r]:r.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=x(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&T(e,this.else.names),e}};g.kind="if";var v=class extends f{};v.kind="for";var b=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=x(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}},_=class extends v{constructor(e,t,r,o){super(),this.varKind=e,this.name=t,this.from=r,this.to=o}render(e){let t=e.es5?r.varKinds.var:this.varKind,{name:o,from:a,to:i}=this;return`for(${t} ${o}=${a}; ${o}<${i}; ${o}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},S=class extends v{constructor(e,t,r,o){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=x(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}},$=class extends f{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};$.kind="func";var w=class extends h{render(e){return"return "+super.render(e)}};w.kind="return";var E=class extends f{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,o;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(o=this.finally)||o.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}},R=class extends f{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};R.kind="catch";var P=class extends f{render(e){return"finally"+super.render(e)}};P.kind="finally";var k=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,o){let a=this._scope.toName(t);return void 0!==r&&o&&(this._constants[a.str]=r),this._leafNode(new s(e,a,r)),a}const(e,t,o){return this._def(r.varKinds.const,e,t,o)}let(e,t,o){return this._def(r.varKinds.let,e,t,o)}var(e,t,o){return this._def(r.varKinds.var,e,t,o)}assign(e,t,r){return this._leafNode(new n(e,t,r))}add(t,r){return this._leafNode(new l(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new p(e)),this}object(...e){let r=["{"];for(let[o,a]of e)r.length>1&&r.push(","),r.push(o),(o!==a||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,a));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.let){let s=this._scope.toName(e);return this._for(new _(i,s,t,o),()=>a(s))}forOf(e,o,a,i=r.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let e=o instanceof t.Name?o:this.var("_arr",o);return this.forRange("_i",0,(0,t._)`${e}.length`,r=>{this.var(s,(0,t._)`${e}[${r}]`),a(s)})}return this._for(new S("of",i,s,o),()=>a(s))}forIn(e,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${o})`,a);let s=this._scope.toName(e);return this._for(new S("in",i,s,o),()=>a(s))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new c(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new w;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let o=new E;if(this._blockNode(o),this.code(e),t){let e=this.name("e");this._currNode=o.catch=new R(e),t(e)}return r&&(this._currNode=o.finally=new P,this.code(r)),this._endBlockNode(R,P)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,o,a){return this._blockNode(new $(e,r,o)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof g))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function T(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,r){return r instanceof t._CodeOrName?T(e,r.names):e}function x(e,r,o){var a;if(e instanceof t.Name)return i(e);if(!((a=e)instanceof t._Code&&a._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==o[e.str])))return e;return new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=i(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[]));function i(e){let t=o[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function j(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,t._)`!${A(e)}`}e.CodeGen=k,e.not=j;let C=I(e.operators.AND);e.and=function(...e){return e.reduce(C)};let N=I(e.operators.OR);function I(e){return(r,o)=>r===t.nil?o:o===t.nil?r:(0,t._)`${A(r)} ${e} ${A(o)}`}function A(e){return e instanceof t.Name?e:(0,t._)`(${e})`}e.or=function(...e){return e.reduce(N)}}),n8=D(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let o=n6(),a=n5();function i(e,t=e.schema){let{opts:r,self:o}=e;if(!r.strictSchema||"boolean"==typeof t)return;let a=o.RULES.keywords;for(let r in t)a[r]||h(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(i,s,n,l)=>{let c=void 0===n?s:n instanceof o.Name?(s instanceof o.Name?e(i,s,n):t(i,s,n),n):s instanceof o.Name?(t(i,n,s),s):r(s,n);return l!==o.Name||c instanceof o.Name?c:a(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,o._)`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach(r=>e.assign((0,o._)`${t}${(0,o.getProperty)(r)}`,!0))}e.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},e.checkUnknownRules=i,e.schemaHasRules=s,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,a,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,o._)`${r}`}return(0,o._)`${e}${t}${(0,o.getProperty)(a)}`},e.unescapeFragment=function(e){return l(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(n(e))},e.escapeJsonPointer=n,e.unescapeJsonPointer=l,e.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},e.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if((0,o._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,o._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,o._)`${r} || {}`).code((0,o._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,o._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,o._)`${r} || {}`),d(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,r)=>e.if((0,o._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,o._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,o._)`${r} !== true`,()=>e.assign(r,!0===t||(0,o._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=u,e.setEvaluated=d;let p={};function h(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new a._Code(t.code))})},(r=t||(e.Type=t={}))[r.Num=0]="Num",r[r.Str=1]="Str",e.getErrorPath=function(e,r,a){if(e instanceof o.Name){let i=r===t.Num;return a?i?(0,o._)`"[" + ${e} + "]"`:(0,o._)`"['" + ${e} + "']"`:i?(0,o._)`"/" + ${e}`:(0,o._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return a?(0,o.getProperty)(e).toString():"/"+n(e)},e.checkStrictMode=h}),n7=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6();e.default={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")}}),le=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=n6(),r=n8(),o=n7();function a(e,r){let a=e.const("err",r);e.if((0,t._)`${o.default.vErrors} === null`,()=>e.assign(o.default.vErrors,(0,t._)`[${a}]`),(0,t._)`${o.default.vErrors}.push(${a})`),e.code((0,t._)`${o.default.errors}++`)}function i(e,r){let{gen:o,validateName:a,schemaEnv:i}=e;i.$async?o.throw((0,t._)`new ${e.ValidationError}(${r})`):(o.assign((0,t._)`${a}.errors`,r),o.return(!1))}e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?(0,t.str)`"${e}" keyword must be ${r} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`},e.reportError=function(r,o=e.keywordError,s,l){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c,h=n(r,o,s);(null!=l?l:d||p)?a(u,h):i(c,(0,t._)`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,s){let{it:l}=t,{gen:c,compositeRule:u,allErrors:d}=l;a(c,n(t,r,s)),u||d||i(l,o.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(o.default.errors,r),e.if((0,t._)`${o.default.vErrors} !== null`,()=>e.if(r,()=>e.assign((0,t._)`${o.default.vErrors}.length`,r),()=>e.assign(o.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:a,data:i,errsCount:s,it:n}){if(void 0===s)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",s,o.default.errors,s=>{e.const(l,(0,t._)`${o.default.vErrors}[${s}]`),e.if((0,t._)`${l}.instancePath === undefined`,()=>e.assign((0,t._)`${l}.instancePath`,(0,t.strConcat)(o.default.instancePath,n.errorPath))),e.assign((0,t._)`${l}.schemaPath`,(0,t.str)`${n.errSchemaPath}/${r}`),n.opts.verbose&&(e.assign((0,t._)`${l}.schema`,a),e.assign((0,t._)`${l}.data`,i))})};let s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function n(e,a,i){let{createErrors:n}=e.it;return!1===n?(0,t._)`{}`:function(e,a,i={}){let{gen:n,it:l}=e,c=[function({errorPath:e},{instancePath:a}){let i=a?(0,t.str)`${e}${(0,r.getErrorPath)(a,r.Type.Str)}`:e;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,i)]}(l,i),function({keyword:e,it:{errSchemaPath:o}},{schemaPath:a,parentSchema:i}){let n=i?o:(0,t.str)`${o}/${e}`;return a&&(n=(0,t.str)`${n}${(0,r.getErrorPath)(a,r.Type.Str)}`),[s.schemaPath,n]}(e,i)];return function(e,{params:r,message:a},i){let{keyword:n,data:l,schemaValue:c,it:u}=e,{opts:d,propertyName:p,topSchemaRef:h,schemaPath:f}=u;i.push([s.keyword,n],[s.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),d.messages&&i.push([s.message,"function"==typeof a?a(e):a]),d.verbose&&i.push([s.schema,c],[s.parentSchema,(0,t._)`${h}${f}`],[o.default.data,l]),p&&i.push([s.propertyName,p])}(e,a,c),n.object(...c)}(e,a,i)}}),lt=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=le(),r=n6(),o=n7(),a={message:"boolean schema is false"};function i(e,r){let{gen:o,data:i}=e;(0,t.reportError)({gen:o,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},a,void 0,r)}e.topBoolOrEmptySchema=function(e){let{gen:t,schema:a,validateName:s}=e;!1===a?i(e,!1):"object"==typeof a&&!0===a.$async?t.return(o.default.data):(t.assign((0,r._)`${s}.errors`,null),t.return(!0))},e.boolOrEmptySchema=function(e,t){let{gen:r,schema:o}=e;!1===o?(r.var(t,!1),i(e)):r.var(t,!0)}}),lr=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);e.isJSONType=function(e){return"string"==typeof e&&t.has(e)},e.getRules=function(){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:{}}}}),lo=D(e=>{function t(e,t){return t.rules.some(t=>r(e,t))}function r(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0,e.schemaHasRulesForType=function({schema:e,self:r},o){let a=r.RULES.types[o];return a&&!0!==a&&t(e,a)},e.shouldUseGroup=t,e.shouldUseRule=r}),la=D(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let o=lr(),a=lo(),i=le(),s=n6(),n=n8();function l(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(o.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(r=t||(e.DataType=t={}))[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong",e.getSchemaTypes=function(e){let t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=l,e.coerceAndCheckDataType=function(e,r){var o,i;let{gen:n,data:l,opts:u}=e,p=(o=r,(i=u.coerceTypes)?o.filter(e=>c.has(e)||"array"===i&&"array"===e):[]),f=r.length>0&&!(0===p.length&&1===r.length&&(0,a.schemaHasRulesForType)(e,r[0]));if(f){let o=d(r,l,u.strictNumbers,t.Wrong);n.if(o,()=>{p.length?function(e,t,r){let{gen:o,data:a,opts:i}=e,n=o.let("dataType",(0,s._)`typeof ${a}`),l=o.let("coerced",(0,s._)`undefined`);for(let e of("array"===i.coerceTypes&&o.if((0,s._)`${n} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>o.assign(a,(0,s._)`${a}[0]`).assign(n,(0,s._)`typeof ${a}`).if(d(t,a,i.strictNumbers),()=>o.assign(l,a))),o.if((0,s._)`${l} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":o.elseIf((0,s._)`${n} == "number" || ${n} == "boolean"`).assign(l,(0,s._)`"" + ${a}`).elseIf((0,s._)`${a} === null`).assign(l,(0,s._)`""`);return;case"number":o.elseIf((0,s._)`${n} == "boolean" || ${a} === null
63
+ || (${n} == "string" && ${a} && ${a} == +${a})`).assign(l,(0,s._)`+${a}`);return;case"integer":o.elseIf((0,s._)`${n} === "boolean" || ${a} === null
64
+ || (${n} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(l,(0,s._)`+${a}`);return;case"boolean":o.elseIf((0,s._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(l,!1).elseIf((0,s._)`${a} === "true" || ${a} === 1`).assign(l,!0);return;case"null":o.elseIf((0,s._)`${a} === "" || ${a} === 0 || ${a} === false`),o.assign(l,null);return;case"array":o.elseIf((0,s._)`${n} === "string" || ${n} === "number"
65
+ || ${n} === "boolean" || ${a} === null`).assign(l,(0,s._)`[${a}]`)}}(e);o.else(),h(e),o.endIf(),o.if((0,s._)`${l} !== undefined`,()=>{o.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,s._)`${t} !== undefined`,()=>e.assign((0,s._)`${t}[${r}]`,o))}(e,l)})}(e,r,p):h(e)})}return f};let c=new Set(["string","number","integer","boolean","null"]);function u(e,r,o,a=t.Correct){let i,n=a===t.Correct?s.operators.EQ:s.operators.NEQ;switch(e){case"null":return(0,s._)`${r} ${n} null`;case"array":i=(0,s._)`Array.isArray(${r})`;break;case"object":i=(0,s._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":i=l((0,s._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":i=l();break;default:return(0,s._)`typeof ${r} ${n} ${e}`}return a===t.Correct?i:(0,s.not)(i);function l(e=s.nil){return(0,s.and)((0,s._)`typeof ${r} == "number"`,e,o?(0,s._)`isFinite(${r})`:s.nil)}}function d(e,t,r,o){let a;if(1===e.length)return u(e[0],t,r,o);let i=(0,n.toHash)(e);if(i.array&&i.object){let e=(0,s._)`typeof ${t} != "object"`;a=i.null?e:(0,s._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else a=s.nil;for(let e in i.number&&delete i.integer,i)a=(0,s.and)(a,u(e,t,r,o));return a}e.checkDataType=u,e.checkDataTypes=d;let p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,s._)`{type: ${e}}`:(0,s._)`{type: ${t}}`};function h(e){let t=function(e){let{gen:t,data:r,schema:o}=e,a=(0,n.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:r,schema:o.type,schemaCode:a,schemaValue:a,parentSchema:o,params:{},it:e}}(e);(0,i.reportError)(t,p)}e.reportTypeError=h}),li=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=n6(),r=n8();function o(e,o,a){let{gen:i,compositeRule:s,data:n,opts:l}=e;if(void 0===a)return;let c=(0,t._)`${n}${(0,t.getProperty)(o)}`;if(s)return void(0,r.checkStrictMode)(e,`default is ignored for: ${c}`);let u=(0,t._)`${c} === undefined`;"empty"===l.useDefaults&&(u=(0,t._)`${u} || ${c} === null || ${c} === ""`),i.if(u,(0,t._)`${c} = ${(0,t.stringify)(a)}`)}e.assignDefaults=function(e,t){let{properties:r,items:a}=e.schema;if("object"===t&&r)for(let t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(a)&&a.forEach((t,r)=>o(e,r,t.default))}}),ls=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=n6(),r=n8(),o=n7(),a=n8();function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}function s(e,r,o){return(0,t._)`${i(e)}.call(${r}, ${o})`}function n(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} === undefined`;return a?(0,t.or)(i,(0,t.not)(s(e,r,o))):i}function l(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}e.checkReportMissingProp=function(e,r){let{gen:o,data:a,it:i}=e;o.if(n(o,a,r,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${r}`},!0),e.error()})},e.checkMissingProp=function({gen:e,data:r,it:{opts:o}},a,i){return(0,t.or)(...a.map(a=>(0,t.and)(n(e,r,a,o.ownProperties),(0,t._)`${i} = ${a}`)))},e.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},e.hasPropFunc=i,e.isOwnProperty=s,e.propertyInData=function(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} !== undefined`;return a?(0,t._)`${i} && ${s(e,r,o)}`:i},e.noPropertyInData=n,e.allSchemaProperties=l,e.schemaProperties=function(e,t){return l(t).filter(o=>!(0,r.alwaysValidSchema)(e,t[o]))},e.callValidateCode=function({schemaCode:e,data:r,it:{gen:a,topSchemaRef:i,schemaPath:s,errorPath:n},it:l},c,u,d){let p=d?(0,t._)`${e}, ${r}, ${i}${s}`:r,h=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,n)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let f=(0,t._)`${p}, ${a.object(...h)}`;return u!==t.nil?(0,t._)`${c}.call(${u}, ${f})`:(0,t._)`${c}(${f})`};let c=(0,t._)`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},o){let i=r.unicodeRegExp?"u":"",{regExp:s}=r.code,n=s(o,i);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:(0,t._)`${"new RegExp"===s.code?c:(0,a.useFunc)(e,s)}(${o}, ${i})`})},e.validateArray=function(e){let{gen:o,data:a,keyword:i,it:s}=e,n=o.name("valid");if(s.allErrors){let e=o.let("valid",!0);return l(()=>o.assign(e,!1)),e}return o.var(n,!0),l(()=>o.break()),n;function l(s){let l=o.const("len",(0,t._)`${a}.length`);o.forRange("i",0,l,a=>{e.subschema({keyword:i,dataProp:a,dataPropType:r.Type.Num},n),o.if((0,t.not)(n),s)})}},e.validateUnion=function(e){let{gen:o,schema:a,keyword:i,it:s}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(a.some(e=>(0,r.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;let n=o.let("valid",!1),l=o.name("_valid");o.block(()=>a.forEach((r,a)=>{let s=e.subschema({keyword:i,schemaProp:a,compositeRule:!0},l);o.assign(n,(0,t._)`${n} || ${l}`),e.mergeValidEvaluated(s,l)||o.if((0,t.not)(n))})),e.result(n,()=>e.reset(),()=>e.error(!0))}}),ln=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=n6(),r=n7(),o=ls(),a=le();function i(e){let{gen:r,data:o,it:a}=e;r.if(a.parentData,()=>r.assign(o,(0,t._)`${a.parentData}[${a.parentDataProperty}]`))}function s(e,r,o){if(void 0===o)throw Error(`keyword "${r}" failed to compile`);return e.scopeValue("keyword","function"==typeof o?{ref:o}:{ref:o,code:(0,t.stringify)(o)})}e.macroKeywordCode=function(e,r){let{gen:o,keyword:a,schema:i,parentSchema:n,it:l}=e,c=r.macro.call(l.self,i,n,l),u=s(o,a,c);!1!==l.opts.validateSchema&&l.self.validateSchema(c,!0);let d=o.name("valid");e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${l.errSchemaPath}/${a}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},e.funcKeywordCode=function(e,n){var l;let{gen:c,keyword:u,schema:d,parentSchema:p,$data:h,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(f,n);let m=s(c,u,!h&&n.compile?n.compile.call(f.self,d,p,f):n.validate),y=c.let("valid");function g(a=n.async?(0,t._)`await `:t.nil){let i=f.opts.passContext?r.default.this:r.default.self,s=!("compile"in n&&!h||!1===n.schema);c.assign(y,(0,t._)`${a}${(0,o.callValidateCode)(e,m,i,s)}`,n.modifying)}function v(e){var r;c.if((0,t.not)(null!=(r=n.valid)?r:y),e)}e.block$data(y,function(){if(!1===n.errors)g(),n.modifying&&i(e),v(()=>e.error());else{let o,s,l=n.async?(o=c.let("ruleErrs",null),c.try(()=>g((0,t._)`await `),e=>c.assign(y,!1).if((0,t._)`${e} instanceof ${f.ValidationError}`,()=>c.assign(o,(0,t._)`${e}.errors`),()=>c.throw(e))),o):(s=(0,t._)`${m}.errors`,c.assign(s,null),g(t.nil),s);n.modifying&&i(e),v(()=>(function(e,o){let{gen:i}=e;i.if((0,t._)`Array.isArray(${o})`,()=>{i.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${o} : ${r.default.vErrors}.concat(${o})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,a.extendErrors)(e)},()=>e.error())})(e,l))}}),e.ok(null!=(l=n.valid)?l:y)},e.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},e.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:o},a,i){if(Array.isArray(a.keyword)?!a.keyword.includes(i):a.keyword!==i)throw Error("ajv implementation error");let s=a.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(a.validateSchema&&!a.validateSchema(e[i])){let e=`keyword "${i}" value is invalid at path "${o}": `+r.errorsText(a.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}}),ll=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=n6(),r=n8();e.getSubschema=function(e,{keyword:o,schemaProp:a,schema:i,schemaPath:s,errSchemaPath:n,topSchemaRef:l}){if(void 0!==o&&void 0!==i)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==o){let i=e.schema[o];return void 0===a?{schema:i,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${e.errSchemaPath}/${o}`}:{schema:i[a],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(a)}`,errSchemaPath:`${e.errSchemaPath}/${o}/${(0,r.escapeFragment)(a)}`}}if(void 0!==i){if(void 0===s||void 0===n||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:l,errSchemaPath:n}}throw Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,o,{dataProp:a,dataPropType:i,data:s,dataTypes:n,propertyName:l}){if(void 0!==s&&void 0!==a)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=o;if(void 0!==a){let{errorPath:s,dataPathArr:n,opts:l}=o;u(c.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0)),e.errorPath=(0,t.str)`${s}${(0,r.getErrorPath)(a,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${a}`,e.dataPathArr=[...n,e.parentDataProperty]}function u(t){e.data=t,e.dataLevel=o.dataLevel+1,e.dataTypes=[],o.definedProperties=new Set,e.parentData=o.data,e.dataNames=[...o.dataNames,t]}void 0!==s&&(u(s instanceof t.Name?s:c.let("data",s,!0)),void 0!==l&&(e.propertyName=l)),n&&(e.dataTypes=n)},e.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:o,createErrors:a,allErrors:i}){void 0!==o&&(e.compositeRule=o),void 0!==a&&(e.createErrors=a),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}}),lc=D((e,t)=>{t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((o=t.length)!=r.length)return!1;for(a=o;0!=a--;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=o;0!=a--;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=o;0!=a--;){var o,a,i,s=i[a];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}}),lu=D((e,t)=>{var r=t.exports=function(e,t,o){"function"==typeof t&&(o=t,t={});var a="function"==typeof(o=t.cb||o)?o:o.pre||function(){};!function e(t,o,a,i,s,n,l,c,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in o(i,s,n,l,c,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in r.arrayKeywords)for(var f=0;f<h.length;f++)e(t,o,a,h[f],s+"/"+p+"/"+f,n,s,p,i,f)}else if(p in r.propsKeywords){if(h&&"object"==typeof h)for(var m in h)e(t,o,a,h[m],s+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),n,s,p,i,m)}else(p in r.keywords||t.allKeys&&!(p in r.skipKeywords))&&e(t,o,a,h,s+"/"+p,n,s,p,i)}a(i,s,n,l,c,u,d)}}(t,a,o.post||function(){},e,"",e)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.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}}),ld=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=n8(),r=lc(),o=lu(),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(e,r=!0){return"boolean"==typeof e||(!0===r?!function e(t){for(let r in t){if(i.has(r))return!0;let o=t[r];if(Array.isArray(o)&&o.some(e)||"object"==typeof o&&e(o))return!0}return!1}(e):!!r&&function e(r){let o=0;for(let i in r)if("$ref"===i||(o++,!a.has(i)&&("object"==typeof r[i]&&(0,t.eachItem)(r[i],t=>o+=e(t)),o===1/0)))return 1/0;return o}(e)<=r)};let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(e,t="",r){return!1!==r&&(t=c(t)),n(e,e.parse(t))}function n(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=s,e._getFullPath=n;let l=/#\/?$/;function c(e){return e?e.replace(l,""):""}e.normalizeId=c,e.resolveUrl=function(e,t,r){return r=c(r),e.resolve(t,r)};let u=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:a,uriResolver:i}=this.opts,n=c(e[a]||t),l={"":n},d=s(i,n,!1),p={},h=new Set;return o(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;let i=d+t,s=l[o];function n(t){let r=this.opts.uriResolver.resolve;if(t=c(s?r(s,t):t),h.has(t))throw m(t);h.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?f(e,o.schema,t):t!==c(i)&&("#"===t[0]?(f(e,p[t],t),p[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!u.test(e))throw Error(`invalid anchor "${e}"`);n.call(this,`#${e}`)}}"string"==typeof e[a]&&(s=n.call(this,e[a])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),l[t]=s}),p;function f(e,t,o){if(void 0!==t&&!r(e,t))throw m(o)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}}),lp=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=lt(),r=la(),o=lo(),a=la(),i=li(),s=ln(),n=ll(),l=n6(),c=n7(),u=ld(),d=n8(),p=le();function h({gen:e,validateName:t,schema:r,schemaEnv:o,opts:a},i){var s;a.code.es5?e.func(t,(0,l._)`${c.default.data}, ${c.default.valCxt}`,o.$async,()=>{var t,o;e.code((0,l._)`"use strict"; ${f(r,a)}`),t=e,o=a,t.if(c.default.valCxt,()=>{t.var(c.default.instancePath,(0,l._)`${c.default.valCxt}.${c.default.instancePath}`),t.var(c.default.parentData,(0,l._)`${c.default.valCxt}.${c.default.parentData}`),t.var(c.default.parentDataProperty,(0,l._)`${c.default.valCxt}.${c.default.parentDataProperty}`),t.var(c.default.rootData,(0,l._)`${c.default.valCxt}.${c.default.rootData}`),o.dynamicRef&&t.var(c.default.dynamicAnchors,(0,l._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{t.var(c.default.instancePath,(0,l._)`""`),t.var(c.default.parentData,(0,l._)`undefined`),t.var(c.default.parentDataProperty,(0,l._)`undefined`),t.var(c.default.rootData,c.default.data),o.dynamicRef&&t.var(c.default.dynamicAnchors,(0,l._)`{}`)}),e.code(i)}):e.func(t,(0,l._)`${c.default.data}, ${(s=a,(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${s.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`)}`,o.$async,()=>e.code(f(r,a)).code(i))}function f(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,l._)`/*# sourceURL=${r} */`:l.nil}function m({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function g(e){(0,d.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:o,self:a}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return _(e,[],!1,t);let o=(0,r.getSchemaTypes)(e.schema);_(e,o,!(0,r.coerceAndCheckDataType)(e,o),t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:o,opts:a}){let i=r.$comment;if(!0===a.$comment)e.code((0,l._)`${c.default.self}.logger.log(${i})`);else if("function"==typeof a.$comment){let r=(0,l.str)`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,l._)`${c.default.self}.opts.$comment(${i}, ${r}, ${a}.schema)`)}}function _(e,t,r,i){var s,n,u,p;let{gen:h,schema:f,data:m,allErrors:y,opts:g,self:v}=e,{RULES:b}=v;if(f.$ref&&(g.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(f,b)))return void h.block(()=>R(e,"$ref",b.all.$ref.definition));function _(s){(0,o.shouldUseGroup)(f,s)&&(s.type?(h.if((0,a.checkDataType)(s.type,m,g.strictNumbers)),S(e,s),1===t.length&&t[0]===s.type&&r&&(h.else(),(0,a.reportTypeError)(e)),h.endIf()):S(e,s),y||h.if((0,l._)`${c.default.errors} === ${i||0}`))}g.jtd||(s=e,n=t,!s.schemaEnv.meta&&s.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{$(e.dataTypes,t)||w(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let o of e.dataTypes)$(t,o)?r.push(o):t.includes("integer")&&"number"===o&&r.push("integer");e.dataTypes=r}(e,t)}}(s,n),s.opts.allowUnionTypes||(u=s,(p=n).length>1&&!(2===p.length&&p.includes("null"))&&w(u,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let a in r){let i=r[a];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){let{type:r}=i.definition;r.length&&!r.some(e=>{var r,o;return r=t,o=e,r.includes(o)||"number"===o&&r.includes("integer")})&&w(e,`missing type "${r.join(",")}" for keyword "${a}"`)}}}(s,s.dataTypes))),h.block(()=>{for(let e of b.rules)_(e);_(b.post)})}function S(e,t){let{gen:r,schema:a,opts:{useDefaults:s}}=e;s&&(0,i.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,o.shouldUseRule)(a,r)&&R(e,r.keyword,r.definition,t.type)})}function $(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function w(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}e.validateFunctionCode=function(e){y(e)&&(g(e),m(e))?function(e){let{schema:t,opts:r,gen:o}=e;h(e,()=>{r.$comment&&t.$comment&&b(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),o.let(c.default.vErrors,null),o.let(c.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,l._)`${r}.evaluated`),t.if((0,l._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,l._)`${e.evaluated}.props`,(0,l._)`undefined`)),t.if((0,l._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,l._)`${e.evaluated}.items`,(0,l._)`undefined`))}(e),v(e),function(e){let{gen:t,schemaEnv:r,validateName:o,ValidationError:a,opts:i}=e;r.$async?t.if((0,l._)`${c.default.errors} === 0`,()=>t.return(c.default.data),()=>t.throw((0,l._)`new ${a}(${c.default.vErrors})`)):(t.assign((0,l._)`${o}.errors`,c.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:o}){r instanceof l.Name&&e.assign((0,l._)`${t}.props`,r),o instanceof l.Name&&e.assign((0,l._)`${t}.items`,o)}(e),t.return((0,l._)`${c.default.errors} === 0`))}(e)})}(e):h(e,()=>(0,t.topBoolOrEmptySchema)(e))};var E=class{constructor(e,t,r){if((0,s.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",T(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,l._)`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=l.nil,t=l.nil){if(!this.$data)return;let{gen:r,schemaCode:o,schemaType:a,def:i}=this;r.if((0,l.or)((0,l._)`${o} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(a.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:o,it:i}=this;return(0,l.or)(function(){if(r.length){if(!(t instanceof l.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,l._)`${(0,a.checkDataTypes)(e,t,i.opts.strictNumbers,a.DataType.Wrong)}`}return l.nil}(),function(){if(o.validateSchema){let r=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,l._)`!${r}(${t})`}return l.nil}())}subschema(e,r){let o=(0,n.getSubschema)(this.it,e);(0,n.extendSubschemaData)(o,this.it,e),(0,n.extendSubschemaMode)(o,e);let a={...this.it,...o,items:void 0,props:void 0};return!function(e,r){if(y(e)&&(g(e),m(e)))return function(e,t){var r;let o,{schema:a,gen:i,opts:s}=e;s.$comment&&a.$comment&&b(e),(o=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,u.resolveUrl)(r.opts.uriResolver,r.baseId,o)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let n=i.const("_errs",c.default.errors);v(e,n),i.var(t,(0,l._)`${n} === ${c.default.errors}`)}(e,r);(0,t.boolOrEmptySchema)(e,r)}(a,r),a}mergeEvaluated(e,t){let{it:r,gen:o}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=d.mergeEvaluated.props(o,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=d.mergeEvaluated.items(o,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:o}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return o.if(t,()=>this.mergeEvaluated(e,l.Name)),!0}};function R(e,t,r,o){let a=new E(e,r,t);"code"in r?r.code(a,o):a.$data&&r.validate?(0,s.funcKeywordCode)(a,r):"macro"in r?(0,s.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,s.funcKeywordCode)(a,r)}e.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function T(e,{dataLevel:t,dataNames:r,dataPathArr:o}){let a,i;if(""===e)return c.default.rootData;if("/"===e[0]){if(!P.test(e))throw Error(`Invalid JSON-pointer: ${e}`);a=e,i=c.default.rootData}else{let s=k.exec(e);if(!s)throw Error(`Invalid JSON-pointer: ${e}`);let l=+s[1];if("#"===(a=s[2])){if(l>=t)throw Error(n("property/index",l));return o[t-l]}if(l>t)throw Error(n("data",l));if(i=r[t-l],!a)return i}let s=i;for(let e of a.split("/"))e&&(i=(0,l._)`${i}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=(0,l._)`${s} && ${i}`);return s;function n(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}e.getData=T}),lh=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}}),lf=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ld();e.default=class extends Error{constructor(e,r,o,a){super(a||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,t.resolveUrl)(e,r,o),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}}),lm=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=n6(),r=lh(),o=n7(),a=ld(),i=n8(),s=lp();var n=class{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,a.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}};function l(e){let i,n,l=u.call(this,e);if(l)return l;let c=(0,a.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:d,lines:p}=this.opts.code,{ownProperties:h}=this.opts,f=new t.CodeGen(this.scope,{es5:d,lines:p,ownProperties:h});e.$async&&(i=f.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName("validate");e.validateName=m;let y={gen:f,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:c,baseId:e.baseId||c,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,s.validateFunctionCode)(y),f.optimize(this.opts.code.optimize);let r=f.toString();n=`${f.scopeRefs(o.default.scope)}return ${r}`,this.opts.code.process&&(n=this.opts.code.process(n,e));let a=Function(`${o.default.self}`,`${o.default.scope}`,n)(this,this.scope.get());if(this.scope.value(m,{ref:a}),a.errors=null,a.schema=e.schema,a.schemaEnv=e,e.$async&&(a.$async=!0),!0===this.opts.code.source&&(a.source={validateName:m,validateCode:r,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:r}=y;a.evaluated={props:e instanceof t.Name?void 0:e,items:r instanceof t.Name?void 0:r,dynamicProps:e instanceof t.Name,dynamicItems:r instanceof t.Name},a.source&&(a.source.evaluated=(0,t.stringify)(a.evaluated))}return e.validate=a,e}catch(t){throw delete e.validate,delete e.validateName,n&&this.logger.error("Error compiling schema, function code:",n),t}finally{this._compilations.delete(e)}}function c(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function u(e){for(let o of this._compilations){var t,r;if(t=o,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return o}}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){let r=this.opts.uriResolver.parse(t),o=(0,a._getFullPath)(this.opts.uriResolver,r),i=(0,a.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===i)return f.call(this,r,e);let s=(0,a.normalizeId)(o),c=this.refs[s]||this.schemas[s];if("string"==typeof c){let t=p.call(this,e,c);if("object"!=typeof(null==t?void 0:t.schema))return;return f.call(this,r,t)}if("object"==typeof(null==c?void 0:c.schema)){if(c.validate||l.call(this,c),s===(0,a.normalizeId)(t)){let{schema:t}=c,{schemaId:r}=this.opts,o=t[r];return o&&(i=(0,a.resolveUrl)(this.opts.uriResolver,i,o)),new n({schema:t,schemaId:r,root:e,baseId:i})}return f.call(this,r,c)}}e.SchemaEnv=n,e.compileSchema=l,e.resolveRef=function(e,t,r){var o;r=(0,a.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=d.call(this,e,r);if(void 0===s){let a=null==(o=e.localRefs)?void 0:o[r],{schemaId:i}=this.opts;a&&(s=new n({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==s)return e.refs[r]=c.call(this,s)},e.getCompilingSchema=u,e.resolveSchema=p;let h=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,{baseId:t,schema:r,root:o}){var s;let l;if((null==(s=e.fragment)?void 0:s[0])!=="/")return;for(let o of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,i.unescapeFragment)(o)];if(void 0===e)return;let s="object"==typeof(r=e)&&r[this.opts.schemaId];!h.has(o)&&s&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,s))}if("boolean"!=typeof r&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){let e=(0,a.resolveUrl)(this.opts.uriResolver,t,r.$ref);l=p.call(this,o,e)}let{schemaId:c}=this.opts;if((l=l||new n({schema:r,schemaId:c,root:o,baseId:t})).schema!==l.root.schema)return l}}),ly=D((e,t)=>{t.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}}),lg=D((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function a(e){let t="",r=0,o=0;for(o=0;o<e.length;o++)if(48!==(r=e[o].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(!((r=e[o].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o]}return t}function i(e){return e.length=0,!0}function s(e,t,r){if(e.length){let o=a(e);if(""===o)return r.error=!0,!1;t.push(o),e.length=0}return!0}function n(e){if(2>function(e,t){let r=0;for(let t=0;t<e.length;t++)":"===e[t]&&r++;return r}(e,":"))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},o=[],n=[],l=!1,c=!1,u=s;for(let a=0;a<e.length;a++){let s=e[a];if("["!==s&&"]"!==s)if(":"===s){if(!0===l&&(c=!0),!u(n,o,r))break;if(++t>7){r.error=!0;break}a>0&&":"===e[a-1]&&(l=!0),o.push(":");continue}else if("%"===s){if(!u(n,o,r))break;u=i}else{n.push(s);continue}}return n.length&&(u===i?r.zone=n.join(""):c?o.push(n.join("")):o.push(a(n))),r.address=o.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}t.exports={nonSimpleDomain:RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);if(!o(r)){let t=n(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){let r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e,r=[],o=-1,a=0;for(;a=t.length;){if(1===a)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===a){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===a&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(o=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,o)),t=t.slice(o)}return r.join("")},isIPv4:o,isUUID:r,normalizeIPv6:n,stringArrayToHexStripped:a}}),lv=D((e,t)=>{let{isUUID:r}=lg(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function i(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function s(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function n(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let l={scheme:"http",domainHost:!0,parse:s,serialize:n},c={scheme:"https",domainHost:l.domainHost,parse:s,serialize:n},u={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=i(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if((e.port===(i(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},d={scheme:"wss",domainHost:u.domainHost,parse:u.parse,serialize:u.serialize},p={http:l,https:c,ws:u,wss:d,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(o);if(r){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=h(`${o}:${t.nid||e.nid}`);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),a=h(`${r}:${t.nid||o}`);a&&(e=a.serialize(e,t));let i=e,s=e.nss;return i.path=`${o||t.nid}:${s}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&r(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function h(e){return e&&(p[e]||p[e.toLowerCase()])||void 0}Object.setPrototypeOf(p,null),t.exports={wsIsSecure:i,SCHEMES:p,isValidSchemeName:function(e){return -1!==a.indexOf(e)},getSchemeHandler:h}}),lb=D((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:a,normalizeComponentEncoding:i,isIPv4:s,nonSimpleDomain:n}=lg(),{SCHEMES:l,getSchemeHandler:c}=lv();function u(e,t,r,a){let i={};return a||(e=h(d(e,r),r),t=h(d(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=o(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function d(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),s=[],n=c(i.scheme||r.scheme);n&&n.serialize&&n.serialize(r,i),void 0!==r.path&&(i.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==i.reference&&r.scheme&&s.push(r.scheme,":");let l=a(r);if(void 0!==l&&("suffix"!==i.reference&&s.push("//"),s.push(l),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;i.absolutePath||n&&n.absolutePath||(e=o(e)),void 0===l&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}let p=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(e,t){let o=Object.assign({},t),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;"suffix"===o.reference&&(e=o.scheme?o.scheme+":"+e:"//"+e);let l=e.match(p);if(l){if(a.scheme=l[1],a.userinfo=l[3],a.host=l[4],a.port=parseInt(l[5],10),a.path=l[6]||"",a.query=l[7],a.fragment=l[8],isNaN(a.port)&&(a.port=l[5]),a.host)if(!1===s(a.host)){let e=r(a.host);a.host=e.host.toLowerCase(),i=e.isIPV6}else i=!0;void 0!==a.scheme||void 0!==a.userinfo||void 0!==a.host||void 0!==a.port||void 0!==a.query||a.path?void 0===a.scheme?a.reference="relative":void 0===a.fragment?a.reference="absolute":a.reference="uri":a.reference="same-document",o.reference&&"suffix"!==o.reference&&o.reference!==a.reference&&(a.error=a.error||"URI is not a "+o.reference+" reference.");let t=c(o.scheme||a.scheme);if(!o.unicodeSupport&&(!t||!t.unicodeSupport)&&a.host&&(o.domainHost||t&&t.domainHost)&&!1===i&&n(a.host))try{a.host=URL.domainToASCII(a.host.toLowerCase())}catch(e){a.error=a.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==a.scheme&&(a.scheme=unescape(a.scheme)),void 0!==a.host&&(a.host=unescape(a.host))),a.path&&(a.path=escape(unescape(a.path))),a.fragment&&(a.fragment=encodeURI(decodeURIComponent(a.fragment)))),t&&t.parse&&t.parse(a,o)}else a.error=a.error||"URI can not be parsed.";return a}let f={SCHEMES:l,normalize:function(e,t){return"string"==typeof e?e=d(h(e,t),t):"object"==typeof e&&(e=h(d(e,t),t)),e},resolve:function(e,t,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},a=u(h(e,o),h(t,o),o,!0);return o.skipEscape=!0,d(a,o)},resolveComponent:u,equal:function(e,t,r){return"string"==typeof e?e=d(i(h(e=unescape(e),r),!0),{...r,skipEscape:!0}):"object"==typeof e&&(e=d(i(e,!0),{...r,skipEscape:!0})),"string"==typeof t?t=d(i(h(t=unescape(t),r),!0),{...r,skipEscape:!0}):"object"==typeof t&&(t=d(i(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:d,parse:h};t.exports=f,t.exports.default=f,t.exports.fastUri=f}),l_=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lb();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),lS=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=lp();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=n6();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=lh(),a=lf(),i=lr(),s=lm(),n=n6(),l=ld(),c=la(),u=n8(),d=ly(),p=l_(),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={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."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var v=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...function(e){var t,r,o,a,i,s,n,l,c,u,d,f,m,y,g,v,b,_,S,$,w,E,R,P,k;let T=e.strict,O=null==(t=e.code)?void 0:t.optimize,x=!0===O||void 0===O?1:O||0,j=null!=(o=null==(r=e.code)?void 0:r.regExp)?o:h,C=null!=(a=e.uriResolver)?a:p.default;return{strictSchema:null==(s=null!=(i=e.strictSchema)?i:T)||s,strictNumbers:null==(l=null!=(n=e.strictNumbers)?n:T)||l,strictTypes:null!=(u=null!=(c=e.strictTypes)?c:T)?u:"log",strictTuples:null!=(f=null!=(d=e.strictTuples)?d:T)?f:"log",strictRequired:null!=(y=null!=(m=e.strictRequired)?m:T)&&y,code:e.code?{...e.code,optimize:x,regExp:j}:{optimize:x,regExp:j},loopRequired:null!=(g=e.loopRequired)?g:200,loopEnum:null!=(v=e.loopEnum)?v:200,meta:null==(b=e.meta)||b,messages:null==(_=e.messages)||_,inlineRefs:null==(S=e.inlineRefs)||S,schemaId:null!=($=e.schemaId)?$:"$id",addUsedSchema:null==(w=e.addUsedSchema)||w,validateSchema:null==(E=e.validateSchema)||E,validateFormats:null==(R=e.validateFormats)||R,unicodeRegExp:null==(P=e.unicodeRegExp)||P,int32range:null==(k=e.int32range)||k,uriResolver:C}}(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new n.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return R;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);const o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),b.call(this,y,e,"NOT SUPPORTED"),b.call(this,g,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&w.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,o=d;"id"===r&&((o={...d}).id=o.$id,delete o.$id),t&&e&&this.addMetaSchema(o,o[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let o=r(t);return"$async"in r||(this.errors=r.errors),o}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return o.call(this,e,t);async function o(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return n.call(this,t),await l.call(this,t.missingSchema),s.call(this,e)}}function n({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){let r=await c.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,o=this.opts.validateSchema){let a;if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,o);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(a=e[t])&&"string"!=typeof a)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||a),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,o,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(r,e);if(!o&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return o}getSchema(e){let t;for(;"string"==typeof(t=_.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,o=new s.SchemaEnv({schema:{},schemaId:r});if(!(t=s.resolveSchema.call(this,o,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=_.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,l.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(k.call(this,r,t),!t)return(0,u.eachItem)(r,e=>T.call(this,e)),this;x.call(this,t);let o={...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===o.type.length?e=>T.call(this,e,o):e=>o.type.forEach(t=>T.call(this,e,o,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let o of(e=JSON.parse(JSON.stringify(e)),t)){let t=o.split("/").slice(1),a=e;for(let e of t)a=a[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:o}=t.definition,i=a[e];o&&i&&(a[e]=C(i))}}return e}_removeAllSchemas(e,t){for(let r in e){let o=e[r];(!t||t.test(r))&&("string"==typeof o?delete e[r]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[r]))}}_addSchema(e,t,r,o=this.opts.validateSchema,a=this.opts.addUsedSchema){let i,{schemaId:n}=this.opts;if("object"==typeof e)i=e[n];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let c=this._cache.get(e);if(void 0!==c)return c;r=(0,l.normalizeId)(i||r);let u=l.getSchemaRefs.call(this,e,r);return c=new s.SchemaEnv({schema:e,schemaId:n,meta:t,baseId:r,localRefs:u}),this._cache.set(c.schema,c),a&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};function b(e,t,r,o="error"){for(let a in e)a in t&&this.logger[o](`${r}: option ${a}. ${e[a]}`)}function _(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){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 $(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function E(){let e={...this.opts};for(let t of f)delete e[t];return e}v.ValidationError=o.default,v.MissingRefError=a.default,e.default=v;let R={log(){},warn(){},error(){}},P=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:r}=this;if((0,u.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!P.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function T(e,t,r){var o;let a=null==t?void 0:t.post;if(r&&a)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=a?i.post:i.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let n={keyword:e,definition:{...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)}};t.before?O.call(this,s,n,t.before):s.rules.push(n),i.all[e]=n,null==(o=t.implements)||o.forEach(e=>this.addKeyword(e))}function O(e,t,r){let o=e.rules.findIndex(e=>e.keyword===r);o>=0?e.rules.splice(o,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function x(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}let j={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,j]}}}),l$=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),lw=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=lf(),r=ls(),o=n6(),a=n7(),i=lm(),s=n8();function n(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,o._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function l(e,t,i,n){let{gen:l,it:c}=e,{allErrors:u,schemaEnv:d,opts:p}=c,h=p.passContext?a.default.this:o.nil;function f(e){let t=(0,o._)`${e}.errors`;l.assign(a.default.vErrors,(0,o._)`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`),l.assign(a.default.errors,(0,o._)`${a.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;let r=null==(t=null==i?void 0:i.validate)?void 0:t.evaluated;if(!0!==c.props)if(r&&!r.dynamicProps)void 0!==r.props&&(c.props=s.mergeEvaluated.props(l,r.props,c.props));else{let t=l.var("props",(0,o._)`${e}.evaluated.props`);c.props=s.mergeEvaluated.props(l,t,c.props,o.Name)}if(!0!==c.items)if(r&&!r.dynamicItems)void 0!==r.items&&(c.items=s.mergeEvaluated.items(l,r.items,c.items));else{let t=l.var("items",(0,o._)`${e}.evaluated.items`);c.items=s.mergeEvaluated.items(l,t,c.items,o.Name)}}n?function(){if(!d.$async)throw Error("async schema referenced by sync schema");let a=l.let("valid");l.try(()=>{l.code((0,o._)`await ${(0,r.callValidateCode)(e,t,h)}`),m(t),u||l.assign(a,!0)},e=>{l.if((0,o._)`!(${e} instanceof ${c.ValidationError})`,()=>l.throw(e)),f(e),u||l.assign(a,!1)}),e.ok(a)}():e.result((0,r.callValidateCode)(e,t,h),()=>m(t),()=>f(t))}e.getValidate=n,e.callRef=l,e.default={keyword:"$ref",schemaType:"string",code(e){var r,a;let s,c,u,{gen:d,schema:p,it:h}=e,{baseId:f,schemaEnv:m,validateName:y,opts:g,self:v}=h,{root:b}=m;if(("#"===p||"#/"===p)&&f===b.baseId){if(m===b)return l(e,y,m,m.$async);let t=d.scopeValue("root",{ref:b});return l(e,(0,o._)`${t}.validate`,b,b.$async)}let _=i.resolveRef.call(v,b,f,p);if(void 0===_)throw new t.default(h.opts.uriResolver,f,p);return _ instanceof i.SchemaEnv?void l(e,n(e,r=_),r,r.$async):(a=_,s=d.scopeValue("schema",!0===g.code.source?{ref:a,code:(0,o.stringify)(a)}:{ref:a}),c=d.name("valid"),u=e.subschema({schema:a,dataTypes:[],schemaPath:o.nil,topSchemaRef:s,errSchemaPath:p},c),void(e.mergeEvaluated(u),e.ok(c)))}}}),lE=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=l$(),r=lw();e.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default]}),lR=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}};e.default={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must be ${o[e].okStr} ${r}`,params:({keyword:e,schemaCode:r})=>(0,t._)`{comparison: ${o[e].okStr}, limit: ${r}}`},code(e){let{keyword:r,data:a,schemaCode:i}=e;e.fail$data((0,t._)`${a} ${o[r].fail} ${i} || isNaN(${a})`)}}}),lP=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6();e.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:r,data:o,schemaCode:a,it:i}=e,s=i.opts.multipleOfPrecision,n=r.let("res"),l=s?(0,t._)`Math.abs(Math.round(${n}) - ${n}) > 1e-${s}`:(0,t._)`${n} !== parseInt(${n})`;e.fail$data((0,t._)`(${a} === 0 || (${n} = ${o}/${a}, ${l}))`)}}}),lk=D(e=>{function t(e){let t,r=e.length,o=0,a=0;for(;a<r;)o++,(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<r&&(64512&(t=e.charCodeAt(a)))==56320&&a++;return o}Object.defineProperty(e,"__esModule",{value:!0}),e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),lT=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8(),o=lk();e.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${r} characters`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:a,data:i,schemaCode:s,it:n}=e,l="maxLength"===a?t.operators.GT:t.operators.LT,c=!1===n.opts.unicode?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(e.gen,o.default)}(${i})`;e.fail$data((0,t._)`${c} ${l} ${s}`)}}}),lO=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ls(),r=n8(),o=n6();e.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,o.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,o._)`{pattern: ${e}}`},code(e){let{gen:a,data:i,$data:s,schema:n,schemaCode:l,it:c}=e,u=c.opts.unicodeRegExp?"u":"";if(s){let{regExp:t}=c.opts.code,s="new RegExp"===t.code?(0,o._)`new RegExp`:(0,r.useFunc)(a,t),n=a.let("valid");a.try(()=>a.assign(n,(0,o._)`${s}(${l}, ${u}).test(${i})`),()=>a.assign(n,!1)),e.fail$data((0,o._)`!${n}`)}else{let r=(0,t.usePattern)(e,n);e.fail$data((0,o._)`!${r}.test(${i})`)}}}}),lx=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6();e.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${r} properties`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:r,data:o,schemaCode:a}=e,i="maxProperties"===r?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${o}).length ${i} ${a}`)}}}),lj=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ls(),r=n6(),o=n8();e.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,r.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,r._)`{missingProperty: ${e}}`},code(e){let{gen:a,schema:i,schemaCode:s,data:n,$data:l,it:c}=e,{opts:u}=c;if(!l&&0===i.length)return;let d=i.length>=u.loopRequired;if(c.allErrors?function(){if(d||l)e.block$data(r.nil,p);else for(let r of i)(0,t.checkReportMissingProp)(e,r)}():function(){let o=a.let("missing");if(d||l){let i=a.let("valid",!0);e.block$data(i,()=>{var l,c;return l=o,c=i,void(e.setParams({missingProperty:l}),a.forOf(l,s,()=>{a.assign(c,(0,t.propertyInData)(a,n,l,u.ownProperties)),a.if((0,r.not)(c),()=>{e.error(),a.break()})},r.nil))}),e.ok(i)}else a.if((0,t.checkMissingProp)(e,i,o)),(0,t.reportMissingProp)(e,o),a.else()}(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:r}=e.it;for(let e of i)if((null==t?void 0:t[e])===void 0&&!r.has(e)){let t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(c,t,c.opts.strictRequired)}}function p(){a.forOf("prop",s,r=>{e.setParams({missingProperty:r}),a.if((0,t.noPropertyInData)(a,n,r,u.ownProperties),()=>e.error())})}}}}),lC=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6();e.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${r} items`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:r,data:o,schemaCode:a}=e,i="maxItems"===r?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${o}.length ${i} ${a}`)}}}),lN=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lc();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),lI=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=n6(),o=n8(),a=lN();e.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,r.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,r._)`{i: ${e}, j: ${t}}`},code(e){let{gen:i,data:s,$data:n,schema:l,parentSchema:c,schemaCode:u,it:d}=e;if(!n&&!l)return;let p=i.let("valid"),h=c.items?(0,t.getSchemaTypes)(c.items):[];e.block$data(p,function(){let n=i.let("i",(0,r._)`${s}.length`),l=i.let("j");e.setParams({i:n,j:l}),i.assign(p,!0),i.if((0,r._)`${n} > 1`,()=>(h.length>0&&!h.some(e=>"object"===e||"array"===e)?function(o,a){let n=i.name("item"),l=(0,t.checkDataTypes)(h,n,d.opts.strictNumbers,t.DataType.Wrong),c=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${o}--;`,()=>{i.let(n,(0,r._)`${s}[${o}]`),i.if(l,(0,r._)`continue`),h.length>1&&i.if((0,r._)`typeof ${n} == "string"`,(0,r._)`${n} += "_"`),i.if((0,r._)`typeof ${c}[${n}] == "number"`,()=>{i.assign(a,(0,r._)`${c}[${n}]`),e.error(),i.assign(p,!1).break()}).code((0,r._)`${c}[${n}] = ${o}`)})}:function(t,n){let l=(0,o.useFunc)(i,a.default),c=i.name("outer");i.label(c).for((0,r._)`;${t}--;`,()=>i.for((0,r._)`${n} = ${t}; ${n}--;`,()=>i.if((0,r._)`${l}(${s}[${t}], ${s}[${n}])`,()=>{e.error(),i.assign(p,!1).break(c)})))})(n,l))},(0,r._)`${u} === false`),e.ok(p)}}}),lA=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8(),o=lN();e.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:a,data:i,$data:s,schemaCode:n,schema:l}=e;s||l&&"object"==typeof l?e.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${n})`):e.fail((0,t._)`${l} !== ${i}`)}}}),lM=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8(),o=lN();e.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let a,i,{gen:s,data:n,$data:l,schema:c,schemaCode:u,it:d}=e;if(!l&&0===c.length)throw Error("enum must have non-empty array");let p=c.length>=d.opts.loopEnum,h=()=>null!=a?a:a=(0,r.useFunc)(s,o.default);if(p||l)i=s.let("valid"),e.block$data(i,function(){s.assign(i,!1),s.forOf("v",u,e=>s.if((0,t._)`${h()}(${n}, ${e})`,()=>s.assign(i,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=s.const("vSchema",u);i=(0,t.or)(...c.map((r,o)=>{var a,i;let s;return a=e,"object"==typeof(s=c[i=o])&&null!==s?(0,t._)`${h()}(${n}, ${a}[${i}])`:(0,t._)`${n} === ${s}`}))}e.pass(i)}}}),lq=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lR(),r=lP(),o=lT(),a=lO(),i=lx(),s=lj(),n=lC(),l=lI(),c=lA(),u=lM();e.default=[t.default,r.default,o.default,a.default,i.default,s.default,n.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default]}),lz=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=n6(),r=n8();function o(e,o){let{gen:a,schema:i,data:s,keyword:n,it:l}=e;l.items=!0;let c=a.const("len",(0,t._)`${s}.length`);if(!1===i)e.setParams({len:o.length}),e.pass((0,t._)`${c} <= ${o.length}`);else if("object"==typeof i&&!(0,r.alwaysValidSchema)(l,i)){let i=a.var("valid",(0,t._)`${c} <= ${o.length}`);a.if((0,t.not)(i),()=>{var s;return s=i,void a.forRange("i",o.length,c,o=>{e.subschema({keyword:n,dataProp:o,dataPropType:r.Type.Num},s),l.allErrors||a.if((0,t.not)(s),()=>a.break())})}),e.ok(i)}}e.validateAdditionalItems=o,e.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:a}=e,{items:i}=t;Array.isArray(i)?o(e,i):(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas')}}}),lL=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=n6(),r=n8(),o=ls();function a(e,o,i=e.schema){let{gen:s,parentSchema:n,data:l,keyword:c,it:u}=e;(function(e){let{opts:t,errSchemaPath:a}=u,s=i.length,n=s===e.minItems&&(s===e.maxItems||!1===e[o]);if(t.strictTuples&&!n){let e=`"${c}" is ${s}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,r.checkStrictMode)(u,e,t.strictTuples)}})(n),u.opts.unevaluated&&i.length&&!0!==u.items&&(u.items=r.mergeEvaluated.items(s,i.length,u.items));let d=s.name("valid"),p=s.const("len",(0,t._)`${l}.length`);i.forEach((o,a)=>{(0,r.alwaysValidSchema)(u,o)||(s.if((0,t._)`${p} > ${a}`,()=>e.subschema({keyword:c,schemaProp:a,dataProp:a},d)),e.ok(d))})}e.validateTuple=a,e.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,"additionalItems",t);i.items=!0,(0,r.alwaysValidSchema)(i,t)||e.ok((0,o.validateArray)(e))}}}),lD=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lL();e.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")}}),lU=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8(),o=ls(),a=lz();e.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:i,it:s}=e,{prefixItems:n}=i;s.items=!0,(0,r.alwaysValidSchema)(s,t)||(n?(0,a.validateAdditionalItems)(e,n):e.ok((0,o.validateArray)(e)))}}}),lV=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8();e.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:r}})=>void 0===r?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${r} valid item(s)`,params:({params:{min:e,max:r}})=>void 0===r?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${r}}`},code(e){let o,a,{gen:i,schema:s,parentSchema:n,data:l,it:c}=e,{minContains:u,maxContains:d}=n;c.opts.next?(o=void 0===u?1:u,a=d):o=1;let p=i.const("len",(0,t._)`${l}.length`);if(e.setParams({min:o,max:a}),void 0===a&&0===o)return void(0,r.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==a&&o>a){(0,r.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,r.alwaysValidSchema)(c,s)){let r=(0,t._)`${p} >= ${o}`;void 0!==a&&(r=(0,t._)`${r} && ${p} <= ${a}`),e.pass(r);return}c.items=!0;let h=i.name("valid");function f(){let e=i.name("_valid"),r=i.let("count",0);m(e,()=>i.if(e,()=>{var e;return e=r,void(i.code((0,t._)`${e}++`),void 0===a?i.if((0,t._)`${e} >= ${o}`,()=>i.assign(h,!0).break()):(i.if((0,t._)`${e} > ${a}`,()=>i.assign(h,!1).break()),1===o?i.assign(h,!0):i.if((0,t._)`${e} >= ${o}`,()=>i.assign(h,!0))))}))}function m(t,o){i.forRange("i",0,p,a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:r.Type.Num,compositeRule:!0},t),o()})}void 0===a&&1===o?m(h,()=>i.if(h,()=>i.break())):0===o?(i.let(h,!0),void 0!==a&&i.if((0,t._)`${l}.length > 0`,f)):(i.let(h,!1),f()),e.result(h,()=>e.reset())}}}),lF=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=n6(),r=n8(),o=ls();e.error={message:({params:{property:e,depsCount:r,deps:o}})=>(0,t.str)`must have ${1===r?"property":"properties"} ${o} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:o,missingProperty:a}})=>(0,t._)`{property: ${e},
66
+ missingProperty: ${a},
67
+ depsCount: ${r},
68
+ deps: ${o}}`};let a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let o in e)"__proto__"!==o&&((Array.isArray(e[o])?t:r)[o]=e[o]);return[t,r]}(e);i(e,t),s(e,r)}};function i(e,r=e.schema){let{gen:a,data:s,it:n}=e;if(0===Object.keys(r).length)return;let l=a.let("missing");for(let i in r){let c=r[i];if(0===c.length)continue;let u=(0,o.propertyInData)(a,s,i,n.opts.ownProperties);e.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),n.allErrors?a.if(u,()=>{for(let t of c)(0,o.checkReportMissingProp)(e,t)}):(a.if((0,t._)`${u} && (${(0,o.checkMissingProp)(e,c,l)})`),(0,o.reportMissingProp)(e,l),a.else())}}function s(e,t=e.schema){let{gen:a,data:i,keyword:n,it:l}=e,c=a.name("valid");for(let s in t)(0,r.alwaysValidSchema)(l,t[s])||(a.if((0,o.propertyInData)(a,i,s,l.opts.ownProperties),()=>{let t=e.subschema({keyword:n,schemaProp:s},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=s,e.default=a}),lH=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8();e.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:o,schema:a,data:i,it:s}=e;if((0,r.alwaysValidSchema)(s,a))return;let n=o.name("valid");o.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},n),o.if((0,t.not)(n),()=>{e.error(!0),s.allErrors||o.break()})}),e.ok(n)}}}),lK=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ls(),r=n6(),o=n7(),a=n8();e.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,r._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:i,schema:s,parentSchema:n,data:l,errsCount:c,it:u}=e;if(!c)throw Error("ajv implementation error");let{allErrors:d,opts:p}=u;if(u.props=!0,"all"!==p.removeAdditional&&(0,a.alwaysValidSchema)(u,s))return;let h=(0,t.allSchemaProperties)(n.properties),f=(0,t.allSchemaProperties)(n.patternProperties);function m(e){i.code((0,r._)`delete ${l}[${e}]`)}function y(t){if("all"===p.removeAdditional||p.removeAdditional&&!1===s)return void m(t);if(!1===s){e.setParams({additionalProperty:t}),e.error(),d||i.break();return}if("object"==typeof s&&!(0,a.alwaysValidSchema)(u,s)){let o=i.name("valid");"failing"===p.removeAdditional?(g(t,o,!1),i.if((0,r.not)(o),()=>{e.reset(),m(t)})):(g(t,o),d||i.if((0,r.not)(o),()=>i.break()))}}function g(t,r,o){let i={keyword:"additionalProperties",dataProp:t,dataPropType:a.Type.Str};!1===o&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}i.forIn("key",l,o=>{h.length||f.length?i.if(function(o){let s;if(h.length>8){let e=(0,a.schemaRefOrVal)(u,n.properties,"properties");s=(0,t.isOwnProperty)(i,e,o)}else s=h.length?(0,r.or)(...h.map(e=>(0,r._)`${o} === ${e}`)):r.nil;return f.length&&(s=(0,r.or)(s,...f.map(a=>(0,r._)`${(0,t.usePattern)(e,a)}.test(${o})`))),(0,r.not)(s)}(o),()=>y(o)):y(o)}),e.ok((0,r._)`${c} === ${o.default.errors}`)}}}),lJ=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lp(),r=ls(),o=n8(),a=lK();e.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:i,schema:s,parentSchema:n,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===n.additionalProperties&&a.default.code(new t.KeywordCxt(c,a.default,"additionalProperties"));let u=(0,r.allSchemaProperties)(s);for(let e of u)c.definedProperties.add(e);c.opts.unevaluated&&u.length&&!0!==c.props&&(c.props=o.mergeEvaluated.props(i,(0,o.toHash)(u),c.props));let d=u.filter(e=>!(0,o.alwaysValidSchema)(c,s[e]));if(0===d.length)return;let p=i.name("valid");for(let t of d){var h;(h=t,c.opts.useDefaults&&!c.compositeRule&&void 0!==s[h].default)?f(t):(i.if((0,r.propertyInData)(i,l,t,c.opts.ownProperties)),f(t),c.allErrors||i.else().var(p,!0),i.endIf()),e.it.definedProperties.add(t),e.ok(p)}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}}),lB=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ls(),r=n6(),o=n8(),a=n8();e.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:i,schema:s,data:n,parentSchema:l,it:c}=e,{opts:u}=c,d=(0,t.allSchemaProperties)(s),p=d.filter(e=>(0,o.alwaysValidSchema)(c,s[e]));if(0===d.length||p.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let h=u.strictSchema&&!u.allowMatchingProperties&&l.properties,f=i.name("valid");!0===c.props||c.props instanceof r.Name||(c.props=(0,a.evaluatedPropsToName)(i,c.props));let{props:m}=c;for(let e of d)h&&function(e){for(let t in h)new RegExp(e).test(t)&&(0,o.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?y(e):(i.var(f,!0),y(e),i.if(f));function y(o){i.forIn("key",n,s=>{i.if((0,r._)`${(0,t.usePattern)(e,o)}.test(${s})`,()=>{let t=p.includes(o);t||e.subschema({keyword:"patternProperties",schemaProp:o,dataProp:s,dataPropType:a.Type.Str},f),c.opts.unevaluated&&!0!==m?i.assign((0,r._)`${m}[${s}]`,!0):t||c.allErrors||i.if((0,r.not)(f),()=>i.break())})})}}}}),lG=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n8();e.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:r,schema:o,it:a}=e;if((0,t.alwaysValidSchema)(a,o))return void e.fail();let i=r.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}}),lZ=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ls().validateUnion,error:{message:"must match a schema in anyOf"}}}),lW=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8();e.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:o,schema:a,parentSchema:i,it:s}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;let n=o.let("valid",!1),l=o.let("passing",null),c=o.name("_valid");e.setParams({passing:l}),o.block(function(){a.forEach((a,i)=>{let u;(0,r.alwaysValidSchema)(s,a)?o.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},c),i>0&&o.if((0,t._)`${c} && ${n}`).assign(n,!1).assign(l,(0,t._)`[${l}, ${i}]`).else(),o.if(c,()=>{o.assign(n,!0),o.assign(l,i),u&&e.mergeEvaluated(u,t.Name)})})}),e.result(n,()=>e.reset(),()=>e.error(!0))}}}),lX=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n8();e.default={keyword:"allOf",schemaType:"array",code(e){let{gen:r,schema:o,it:a}=e;if(!Array.isArray(o))throw Error("ajv implementation error");let i=r.name("valid");o.forEach((r,o)=>{if((0,t.alwaysValidSchema)(a,r))return;let s=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(s)})}}}),lY=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8();function o(e,t){let o=e.schema[t];return void 0!==o&&!(0,r.alwaysValidSchema)(e,o)}e.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let a,{gen:i,parentSchema:s,it:n}=e;void 0===s.then&&void 0===s.else&&(0,r.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let l=o(n,"then"),c=o(n,"else");if(!l&&!c)return;let u=i.let("valid",!0),d=i.name("_valid");if(a=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.mergeEvaluated(a),e.reset(),l&&c){let t=i.let("ifClause");e.setParams({ifClause:t}),i.if(d,p("then",t),p("else",t))}else l?i.if(d,p("then")):i.if((0,t.not)(d),p("else"));function p(r,o){return()=>{let a=e.subschema({keyword:r},d);i.assign(u,d),e.mergeValidEvaluated(a,u),o?i.assign(o,(0,t._)`${r}`):e.setParams({ifClause:r})}}e.pass(u,()=>e.error(!0))}}}),lQ=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n8();e.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:r,it:o}){void 0===r.if&&(0,t.checkStrictMode)(o,`"${e}" without "if" is ignored`)}}}),l0=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lz(),r=lD(),o=lL(),a=lU(),i=lV(),s=lF(),n=lH(),l=lK(),c=lJ(),u=lB(),d=lG(),p=lZ(),h=lW(),f=lX(),m=lY(),y=lQ();e.default=function(e=!1){let g=[d.default,p.default,h.default,f.default,m.default,y.default,n.default,l.default,s.default,c.default,u.default];return e?g.push(r.default,a.default):g.push(t.default,o.default),g.push(i.default),g}}),l1=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6();e.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,r){let o,a,i,s,n,l,{gen:c,data:u,$data:d,schema:p,schemaCode:h,it:f}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=f;m.validateFormats&&(d?(o=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,t._)`${o}[${h}]`),i=c.let("fType"),s=c.let("format"),c.if((0,t._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(i,(0,t._)`${a}.type || "string"`).assign(s,(0,t._)`${a}.validate`),()=>c.assign(i,(0,t._)`"string"`).assign(s,a)),e.fail$data((0,t.or)(!1===m.strictSchema?t.nil:(0,t._)`${h} && !${s}`,(n=g.$async?(0,t._)`(${a}.async ? await ${s}(${u}) : ${s}(${u}))`:(0,t._)`${s}(${u})`,l=(0,t._)`(typeof ${s} == "function" ? ${n} : ${s}.test(${u}))`,(0,t._)`${s} && ${s} !== true && ${i} === ${r} && !${l}`)))):function(){var o;let a,i,s=v.formats[p];if(!s){if(!1===m.strictSchema)return v.logger.warn(n());throw Error(n());function n(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===s)return;let[l,d,h]=(a=(o=s)instanceof RegExp?(0,t.regexpCode)(o):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(p)}`:void 0,i=c.scopeValue("formats",{key:p,ref:o,code:a}),"object"!=typeof o||o instanceof RegExp?["string",o,i]:[o.type||"string",o.validate,(0,t._)`${i}.validate`]);l===r&&e.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!g.$async)throw Error("async format in sync schema");return(0,t._)`await ${h}(${u})`}return"function"==typeof d?(0,t._)`${h}(${u})`:(0,t._)`${h}.test(${u})`}())}())}}}),l2=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[l1().default]}),l9=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),l4=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lE(),r=lq(),o=l0(),a=l2(),i=l9();e.default=[t.default,r.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary]}),l5=D(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(r=t||(e.DiscrError=t={})).Tag="tag",r.Mapping="mapping"}),l3=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=l5(),o=lm(),a=lf(),i=n8();e.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===r.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:r,tagName:o}})=>(0,t._)`{error: ${e}, tag: ${o}, tagValue: ${r}}`},code(e){let{gen:s,data:n,schema:l,parentSchema:c,it:u}=e,{oneOf:d}=c;if(!u.opts.discriminator)throw Error("discriminator: requires discriminator option");let p=l.propertyName;if("string"!=typeof p)throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!d)throw Error("discriminator: requires oneOf keyword");let h=s.let("valid",!1),f=s.const("tag",(0,t._)`${n}${(0,t.getProperty)(p)}`);s.if((0,t._)`typeof ${f} == "string"`,()=>(function(){let n=function(){var e;let t={},r=n(c),s=!0;for(let t=0;t<d.length;t++){let c=d[t];if((null==c?void 0:c.$ref)&&!(0,i.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if((c=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e))instanceof o.SchemaEnv&&(c=c.schema),void 0===c)throw new a.default(u.opts.uriResolver,u.baseId,e)}let h=null==(e=null==c?void 0:c.properties)?void 0:e[p];if("object"!=typeof h)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);s=s&&(r||n(c)),function(e,t){if(e.const)l(e.const,t);else if(e.enum)for(let r of e.enum)l(r,t);else throw Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}(h,t)}if(!s)throw Error(`discriminator: "${p}" must be required`);return t;function n({required:e}){return Array.isArray(e)&&e.includes(p)}function l(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${p}" values must be unique strings`);t[e]=r}}();for(let r in s.if(!1),n)s.elseIf((0,t._)`${f} === ${r}`),s.assign(h,function(r){let o=s.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(a,t.Name),o}(n[r]));s.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:f,tagName:p}),s.endIf()})(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:f,tagName:p})),e.ok(h)}}}),l6=D((e,t)=>{t.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}}),l8=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=lS(),o=l4(),a=l3(),i=l6(),s=["/properties"],n="http://json-schema.org/draft-07/schema";var l=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(e,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=lp();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=n6();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=lh();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=lf();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),l7=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=n6(),r=n7(),o=lm(),a=lw();function i(e,i){let{gen:s,it:n}=e;n.schemaEnv.root.dynamicAnchors[i]=!0;let l=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(i)}`,c="#"===n.errSchemaPath?n.validateName:function(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:s,baseId:n,localRefs:l,meta:c}=t.root,{schemaId:u}=i.opts,d=new o.SchemaEnv({schema:r,schemaId:u,root:s,baseId:n,localRefs:l,meta:c});return o.compileSchema.call(i,d),(0,a.getValidate)(e,d)}(e);s.if((0,t._)`!${l}`,()=>s.assign(l,c))}e.dynamicAnchor=i,e.default={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)}}),ce=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=n6(),r=n7(),o=lw();function a(e,a){let{gen:i,keyword:s,it:n}=e;if("#"!==a[0])throw Error(`"${s}" only supports hash fragment reference`);let l=a.slice(1);if(n.allErrors)c();else{let t=i.let("valid",!1);c(t),e.ok(t)}function c(e){if(n.schemaEnv.root.dynamicAnchors[l]){let o=i.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(l)}`);i.if(o,u(o,e),u(n.validateName,e))}else u(n.validateName,e)()}function u(t,r){return r?()=>i.block(()=>{(0,o.callRef)(e,t),i.let(r,!0)}):()=>(0,o.callRef)(e,t)}}e.dynamicRef=a,e.default={keyword:"$dynamicRef",schemaType:"string",code:e=>a(e,e.schema)}}),ct=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=l7(),r=n8();e.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,t.dynamicAnchor)(e,""):(0,r.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}}),cr=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce();e.default={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,t.dynamicRef)(e,e.schema)}}),co=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=l7(),r=ce(),o=ct(),a=cr();e.default=[t.default,r.default,o.default,a.default]}),ca=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lF();e.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}}),ci=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lF();e.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,t.validateSchemaDeps)(e)}}),cs=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n8();e.default={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:r,it:o}){void 0===r.contains&&(0,t.checkStrictMode)(o,`"${e}" without "contains" is ignored`)}}}),cn=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ca(),r=ci(),o=cs();e.default=[t.default,r.default,o.default]}),cl=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8(),o=n7();e.default={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:a,schema:i,data:s,errsCount:n,it:l}=e;if(!n)throw Error("ajv implementation error");let{allErrors:c,props:u}=l;function d(o){if(!1===i){e.setParams({unevaluatedProperty:o}),e.error(),c||a.break();return}if(!(0,r.alwaysValidSchema)(l,i)){let i=a.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:o,dataPropType:r.Type.Str},i),c||a.if((0,t.not)(i),()=>a.break())}}u instanceof t.Name?a.if((0,t._)`${u} !== true`,()=>a.forIn("key",s,e=>{var r,o;return a.if((r=u,o=e,(0,t._)`!${r} || !${r}[${o}]`),()=>d(e))})):!0!==u&&a.forIn("key",s,e=>void 0===u?d(e):a.if(function(e,r){let o=[];for(let a in e)!0===e[a]&&o.push((0,t._)`${r} !== ${a}`);return(0,t.and)(...o)}(u,e),()=>d(e))),l.props=!0,e.ok((0,t._)`${n} === ${o.default.errors}`)}}}),cc=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n6(),r=n8();e.default={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:o,schema:a,data:i,it:s}=e,n=s.items||0;if(!0===n)return;let l=o.const("len",(0,t._)`${i}.length`);if(!1===a)e.setParams({len:n}),e.fail((0,t._)`${l} > ${n}`);else if("object"==typeof a&&!(0,r.alwaysValidSchema)(s,a)){let a=o.var("valid",(0,t._)`${l} <= ${n}`);o.if((0,t.not)(a),()=>{var i,c;return i=a,c=n,void o.forRange("i",c,l,a=>{e.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:r.Type.Num},i),s.allErrors||o.if((0,t.not)(i),()=>o.break())})}),e.ok(a)}s.items=!0}}}),cu=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cl(),r=cc();e.default=[t.default,r.default]}),cd=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),cp=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),ch=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),cf=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),cm=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),cy=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),cg=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),cv=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cd(),r=cp(),o=ch(),a=cf(),i=cm(),s=cy(),n=cg(),l=["/properties"];e.default=function(e){return[t,r,o,a,c(this,i),s,c(this,n)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function c(t,r){return e?t.$dataMetaSchema(r,l):r}}}),cb=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=lS(),o=l4(),a=co(),i=cn(),s=cu(),n=l3(),l=cv(),c="https://json-schema.org/draft/2019-09/schema";var u=class extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(a.default),o.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(i.default),this.addVocabulary(s.default),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(l.default.call(this,e),this.refs["http://json-schema.org/schema"]=c)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var d=lp();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=n6();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=lh();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=lf();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),c_=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lE(),r=lq(),o=l0(),a=co(),i=cn(),s=cu(),n=l2(),l=l9();e.default=[a.default,t.default,r.default,(0,o.default)(!0),n.default,l.metadataVocabulary,l.contentVocabulary,i.default,s.default]}),cS=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),c$=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),cw=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),cE=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),cR=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),cP=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),ck=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),cT=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),cO=D(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cS(),r=c$(),o=cw(),a=cE(),i=cR(),s=cP(),n=ck(),l=cT(),c=["/properties"];e.default=function(e){return[t,r,o,a,i,u(this,s),n,u(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,r){return e?t.$dataMetaSchema(r,c):r}}}),cx=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=lS(),o=c_(),a=l3(),i=cO(),s="https://json-schema.org/draft/2020-12/schema";var n=class extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(i.default.call(this,e),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv2020=n,t.exports=e=n,t.exports.Ajv2020=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var l=lp();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=n6();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var u=lh();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=lf();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),cj=D(e=>{function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(a,i),time:t(n(!0),l),"date-time":t(d(!0),p),"iso-time":t(n(),c),"iso-date-time":t(d(),h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return f.test(e)&&m.test(e)},"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:function(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},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:function(e){return y.lastIndex=0,y.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=v&&e>=g}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:b},double:{type:"number",validate:b},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\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,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"iso-date-time":t(/^\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,h),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},e.formatNames=Object.keys(e.fullFormats);let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){var t;let a=r.exec(e);if(!a)return!1;let i=+a[1],s=+a[2],n=+a[3];return s>=1&&s<=12&&n>=1&&n<=(2===s&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[s])}function i(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function n(e){return function(t){let r=s.exec(t);if(!r)return!1;let o=+r[1],a=+r[2],i=+r[3],n=r[4],l="-"===r[5]?-1:1,c=+(r[6]||0),u=+(r[7]||0);if(c>23||u>59||e&&!n)return!1;if(o<=23&&a<=59&&i<60)return!0;let d=a-u*l,p=o-c*l-(d<0);return(23===p||-1===p)&&(59===d||-1===d)&&i<61}}function l(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),o=new Date("2020-01-01T"+t).valueOf();if(r&&o)return r-o}function c(e,t){if(!(e&&t))return;let r=s.exec(e),o=s.exec(t);if(r&&o)return(e=r[1]+r[2]+r[3])>(t=o[1]+o[2]+o[3])?1:e<t?-1:0}let u=/t|\s/i;function d(e){let t=n(e);return function(e){let r=e.split(u);return 2===r.length&&a(r[0])&&t(r[1])}}function p(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),o=new Date(t).valueOf();if(r&&o)return r-o}function h(e,t){if(!(e&&t))return;let[r,o]=e.split(u),[a,s]=t.split(u),n=i(r,a);if(void 0!==n)return n||l(o,s)}let f=/\/|:/,m=/^(?:[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,y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,g=-0x80000000,v=0x80000000-1;function b(){return!0}let _=/[^\\]\\Z/}),cC=D(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=l8(),r=n6(),o=r.operators,a={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,r.str)`should be ${a[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,r._)`{comparison: ${a[e].okStr}, limit: ${t}}`},code(e){let o,i,{gen:s,data:n,schemaCode:l,keyword:c,it:u}=e,{opts:d,self:p}=u;if(!d.validateFormats)return;let h=new t.KeywordCxt(u,p.RULES.all.format.definition,"format");function f(e){return(0,r._)`${e}.compare(${n}, ${l}) ${a[c].fail} 0`}h.$data?(o=s.scopeValue("formats",{ref:p.formats,code:d.code.formats}),i=s.const("fmt",(0,r._)`${o}[${h.schemaCode}]`),e.fail$data((0,r.or)((0,r._)`typeof ${i} != "object"`,(0,r._)`${i} instanceof RegExp`,(0,r._)`typeof ${i}.compare != "function"`,f(i)))):function(){let t=h.schema,o=p.formats[t];if(!o||!0===o)return;if("object"!=typeof o||o instanceof RegExp||"function"!=typeof o.compare)throw Error(`"${c}": format "${t}" does not define "compare" function`);let a=s.scopeValue("formats",{key:t,ref:o,code:d.code.formats?(0,r._)`${d.code.formats}${(0,r.getProperty)(t)}`:void 0});e.fail$data(f(a))}()},dependencies:["format"]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}),cN=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=cj(),o=cC(),a=n6(),i=new a.Name("fullFormats"),s=new a.Name("fastFormats"),n=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,r.fullFormats,i),e;let[a,n]="fast"===t.mode?[r.fastFormats,s]:[r.fullFormats,i];return l(e,t.formats||r.formatNames,a,n),t.keywords&&(0,o.default)(e),e};function l(e,t,r,o){var i;for(let s of(null!=(i=e.opts.code).formats||(i.formats=(0,a._)`require("ajv-formats/dist/formats").${o}`),t))e.addFormat(s,r[s])}n.get=(e,t="full")=>{let o=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!o)throw Error(`Unknown format "${e}"`);return o},t.exports=e=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}),cI=l8(),cA=cb(),cM=cx();((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,i=q(t),s=0,n=i.length;s<n;s++)a=i[s],L.call(e,a)||a===r||A(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(o=M(t,a))||o.enumerable});return e})(A(null!=(u=cN())?I(z(u)):{},"default",{value:u,enumerable:!0}),u).default;cI.Ajv;let cq=require("node:process"),cz=Symbol.for("mcp.completable");function cL(e,t){return Object.defineProperty(e,cz,{value:{complete:t},enumerable:!1,writable:!1,configurable:!1}),e}function cD(e){let t="";for(let r of e)t+=String.fromCodePoint(r);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function cU(e){let t=atob(e.replaceAll("-","+").replaceAll("_","/")),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.codePointAt(e);return r}function cV(e){let t,r=globalThis.crypto?.subtle;if(void 0===r)throw TypeError("createRequestStateCodec requires the Web Crypto API (globalThis.crypto.subtle); see https://ts.sdk.modelcontextprotocol.io/v2/troubleshooting for the Node.js polyfill instructions");let o="string"==typeof e.key?new TextEncoder().encode(e.key):Uint8Array.from(e.key);if(o.byteLength<32)throw RangeError(`createRequestStateCodec: key must be at least 32 bytes (got ${o.byteLength})`);let a=e.ttlSeconds??600;if(!Number.isFinite(a))throw RangeError("createRequestStateCodec: ttlSeconds must be a finite number");let i=e.bind,s=()=>t??=r.importKey("raw",o,{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]),n=new TextEncoder,l=async e=>cD(new Uint8Array(await r.sign("HMAC",await s(),n.encode("mcp.requestState.bind:"+e))).slice(0,16));return{async mint(e,t){let o={p:e,exp:Math.floor(Date.now()/1e3)+a};if(void 0!==i){if(void 0===t)throw TypeError("createRequestStateCodec: mint() requires ctx when a bind callback is configured");o.b=await l(i(t))}let c=cD(n.encode(JSON.stringify(o)));return`v1.${c}.${cD(new Uint8Array(await r.sign("HMAC",await s(),n.encode("v1."+c))))}`},async verify(e,t){let o,a,c=e.lastIndexOf(".");if(!e.startsWith("v1.")||c<=3)throw Error("malformed");let u=e.slice(3,c);try{o=cU(e.slice(c+1))}catch{throw Error("malformed")}if(!await r.verify("HMAC",await s(),o,n.encode("v1."+u)))throw Error("mac");try{a=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(cU(u)))}catch{throw Error("malformed")}if("number"!=typeof a.exp||a.exp<Math.floor(Date.now()/1e3))throw Error("expired");if(void 0!==i){let e=await l(i(t));if(void 0===a.b||!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e.codePointAt(o)^t.codePointAt(o);return 0===r}(a.b,e))throw Error("bind")}else if(void 0!==a.b)throw Error("bind");return a.p}}}var cF=Object.create,cH=Object.defineProperty,cK=Object.getOwnPropertyDescriptor,cJ=Object.getOwnPropertyNames,cB=Object.getPrototypeOf,cG=Object.prototype.hasOwnProperty,cZ=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cW=(e,t,r)=>(r=null!=e?cF(cB(e)):{},((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,i=cJ(t),s=0,n=i.length;s<n;s++)a=i[s],cG.call(e,a)||a===r||cH(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(o=cK(t,a))||o.enumerable});return e})(!t&&e&&e.__esModule?r:cH(r,"default",{value:e,enumerable:!0}),e));let cX=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),cY=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),cQ=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),c0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),c1=Symbol.for("mcp.sdk.errorBrands");function c2(e,t){let r=new Set,o=t;for(;"function"==typeof o;){let e=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&"string"==typeof e&&r.add(e),o=Object.getPrototypeOf(o)}0!==r.size&&Object.defineProperty(e,c1,{value:r,enumerable:!1,configurable:!0})}function c9(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,c1)){let r=t[c1];if(r&&"function"==typeof r.has&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}let c4=((f={}).InvalidRequest="invalid_request",f.InvalidClient="invalid_client",f.InvalidGrant="invalid_grant",f.UnauthorizedClient="unauthorized_client",f.UnsupportedGrantType="unsupported_grant_type",f.InvalidScope="invalid_scope",f.AccessDenied="access_denied",f.ServerError="server_error",f.TemporarilyUnavailable="temporarily_unavailable",f.UnsupportedResponseType="unsupported_response_type",f.UnsupportedTokenType="unsupported_token_type",f.InvalidToken="invalid_token",f.MethodNotAllowed="method_not_allowed",f.TooManyRequests="too_many_requests",f.InvalidClientMetadata="invalid_client_metadata",f.InvalidRedirectUri="invalid_redirect_uri",f.InsufficientScope="insufficient_scope",f.InvalidTarget="invalid_target",f);var c5=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](e){return c9(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return c9(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",c2(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}};let c3=((m={}).NotConnected="NOT_CONNECTED",m.AlreadyConnected="ALREADY_CONNECTED",m.NotInitialized="NOT_INITIALIZED",m.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",m.RequestTimeout="REQUEST_TIMEOUT",m.ConnectionClosed="CONNECTION_CLOSED",m.SendFailed="SEND_FAILED",m.InvalidResult="INVALID_RESULT",m.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",m.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",m.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",m.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",m.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",m.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",m.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",m.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",m.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",m.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",m.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",m);var c6=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return c9(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return c9(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="SdkError",c2(this,new.target)}},c8=class extends c6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};let c7="2026-07-28",ue=[c7];function ut(e){return e.filter(e=>!(e>=c7))}function ur(e){return e.filter(e=>e>=c7)}function uo(e){let t=e.structuredContent;return void 0===t||!("object"!=typeof t||null===t||Array.isArray(t))||e.content?.some(e=>"text"===e.type)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}let ua=["task","inputRequests","requestState"];function ui(e){return null===e||"object"!=typeof e||Array.isArray(e)||void 0!==e.content||ua.some(t=>t in e)?e:{...e,content:[]}}function us(){let e,t,o,a,i,s,n,l,c,u,d,p,h,f,m,y,g,v,b,_,S,$,w,E,R,P,k,T,O,x,j,C,N,I,A,M,q,z,L,D,U,V,F,H,K,J,B,G,Z,W,X,Y,Q,ee,et,er,eo,ea,ei,es,en,el,ec,eu,ed,ep,eh,ef,em,ey,eg,ev,eb,e_,eS,e$,ew,eE,eR,eP,ek,eT,eO,ex,ej,eC,eN,eI,eA,eM,eq,ez,eL,eD,eU,eV,eF,eH,eK,eJ,eB,eG,eZ,eW,eX,eY,eQ,e0,e1,e2,e9,e4,e5,e3,e6,e8,e7,te,tt,tr,to,ta,ti,ts,tn,tl,tc,tu,td,tp,th,tf,tm,ty,tg,tv,tb,t_,tS,t$;return r??=(e=aR(()=>o8([ow(),oK(),oZ(),oX(),aa(ow(),e),o9(e)])),t=aa(ow(),e),o=o8([ow(),oK().int()]),a=ow(),i=o5({ttl:oK().optional()}),s=o5({taskId:ow()}),c=(l=o5({_meta:(n=o3({progressToken:o.optional(),"io.modelcontextprotocol/related-task":s.optional()})).optional()})).extend({task:i.optional()}),u=o5({method:ow(),params:l.loose().optional()}),d=o5({_meta:n.optional()}),p=o5({method:ow(),params:d.loose().optional()}),h=o3({_meta:n.optional()}),f=o8([ow(),oK().int()]),m=h.strict(),y=d.extend({requestId:f.optional(),reason:ow().optional()}),g=p.extend({method:al("notifications/cancelled"),params:y}),v=o5({src:ow(),mimeType:ow().optional(),sizes:o9(ow()).optional(),theme:as(["light","dark"]).optional()}),b=o5({icons:o9(v).optional()}),S=(_=o5({name:ow(),title:ow().optional()})).extend({..._.shape,...b.shape,version:ow(),websiteUrl:ow().optional(),description:ow().optional()}),$=ar(o5({applyDefaults:oZ().optional()}),t),w=ak(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,ar(o5({form:$.optional(),url:t.optional()}),t.optional())),E=o3({list:t.optional(),cancel:t.optional(),requests:o3({sampling:o3({createMessage:t.optional()}).optional(),elicitation:o3({create:t.optional()}).optional()}).optional()}),R=o3({list:t.optional(),cancel:t.optional(),requests:o3({tools:o3({call:t.optional()}).optional()}).optional()}),P=o5({experimental:aa(ow(),t).optional(),sampling:o5({context:t.optional(),tools:t.optional()}).optional(),elicitation:w.optional(),roots:o5({listChanged:oZ().optional()}).optional(),tasks:E.optional(),extensions:aa(ow(),t).optional()}),k=l.extend({protocolVersion:ow(),capabilities:P,clientInfo:S}),T=u.extend({method:al("initialize"),params:k}),O=o5({experimental:aa(ow(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:o5({listChanged:oZ().optional()}).optional(),resources:o5({subscribe:oZ().optional(),listChanged:oZ().optional()}).optional(),tools:o5({listChanged:oZ().optional()}).optional(),tasks:R.optional(),extensions:aa(ow(),t).optional()}),x=h.extend({protocolVersion:ow(),capabilities:O,serverInfo:S,instructions:ow().optional()}),j=p.extend({method:al("notifications/initialized"),params:d.optional()}),C=u.extend({method:al("ping"),params:l.optional()}),N=o5({progress:oK(),total:ap(oK()),message:ap(ow())}),I=o5({...d.shape,...N.shape,progressToken:o}),A=p.extend({method:al("notifications/progress"),params:I}),M=l.extend({cursor:a.optional()}),q=u.extend({params:M.optional()}),z=h.extend({nextCursor:a.optional()}),D=(L=o5({uri:ow(),mimeType:ap(ow()),_meta:aa(ow(),o0()).optional()})).extend({text:ow()}),U=ow().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),V=L.extend({blob:U}),H=o5({audience:o9(F=as(["user","assistant"])).optional(),priority:oK().min(0).max(1).optional(),lastModified:oe({offset:!0}).optional()}),K=o5({..._.shape,...b.shape,uri:ow(),description:ap(ow()),mimeType:ap(ow()),size:ap(oK()),annotations:H.optional(),_meta:ap(o3({}))}),J=o5({..._.shape,...b.shape,uriTemplate:ow(),description:ap(ow()),mimeType:ap(ow()),annotations:H.optional(),_meta:ap(o3({}))}),B=q.extend({method:al("resources/list")}),G=z.extend({resources:o9(K)}),Z=q.extend({method:al("resources/templates/list")}),W=z.extend({resourceTemplates:o9(J)}),X=l.extend({uri:ow()}),Y=u.extend({method:al("resources/read"),params:X}),Q=h.extend({contents:o9(o8([D,V]))}),ee=p.extend({method:al("notifications/resources/list_changed"),params:d.optional()}),et=u.extend({method:al("resources/subscribe"),params:X}),er=u.extend({method:al("resources/unsubscribe"),params:X}),eo=d.extend({uri:ow()}),ea=p.extend({method:al("notifications/resources/updated"),params:eo}),ei=o5({name:ow(),description:ap(ow()),required:ap(oZ())}),es=o5({..._.shape,...b.shape,description:ap(ow()),arguments:ap(o9(ei)),_meta:ap(o3({}))}),en=q.extend({method:al("prompts/list")}),el=z.extend({prompts:o9(es)}),ec=l.extend({name:ow(),arguments:aa(ow(),ow()).optional()}),eu=u.extend({method:al("prompts/get"),params:ec}),ed=o5({type:al("text"),text:ow(),annotations:H.optional(),_meta:aa(ow(),o0()).optional()}),ep=o5({type:al("image"),data:U,mimeType:ow(),annotations:H.optional(),_meta:aa(ow(),o0()).optional()}),eh=o5({type:al("audio"),data:U,mimeType:ow(),annotations:H.optional(),_meta:aa(ow(),o0()).optional()}),ef=o5({type:al("tool_use"),name:ow(),id:ow(),input:aa(ow(),o0()),_meta:aa(ow(),o0()).optional()}),em=o5({type:al("resource"),resource:o8([D,V]),annotations:H.optional(),_meta:aa(ow(),o0()).optional()}),ev=o5({role:F,content:eg=o8([ed,ep,eh,ey=K.extend({type:al("resource_link")}),em])}),eb=h.extend({description:ow().optional(),messages:o9(ev)}),e_=p.extend({method:al("notifications/prompts/list_changed"),params:d.optional()}),eS=o5({title:ow().optional(),readOnlyHint:oZ().optional(),destructiveHint:oZ().optional(),idempotentHint:oZ().optional(),openWorldHint:oZ().optional()}),e$=o5({taskSupport:as(["required","optional","forbidden"]).optional()}),ew=o5({..._.shape,...b.shape,description:ow().optional(),inputSchema:o5({type:al("object"),properties:aa(ow(),e).optional(),required:o9(ow()).optional()}).catchall(o0()),outputSchema:o5({type:al("object"),properties:aa(ow(),e).optional(),required:o9(ow()).optional()}).catchall(o0()).optional(),annotations:eS.optional(),execution:e$.optional(),_meta:aa(ow(),o0()).optional()}),eE=q.extend({method:al("tools/list")}),eR=z.extend({tools:o9(ew)}),eP=h.extend({content:o9(eg),structuredContent:aa(ow(),o0()).optional(),isError:oZ().optional()}),ek=c.extend({name:ow(),arguments:aa(ow(),o0()).optional()}),eT=u.extend({method:al("tools/call"),params:ek}),eO=p.extend({method:al("notifications/tools/list_changed"),params:d.optional()}),ex=as(["debug","info","notice","warning","error","critical","alert","emergency"]),ej=l.extend({level:ex}),eC=u.extend({method:al("logging/setLevel"),params:ej}),eN=d.extend({level:ex,logger:ow().optional(),data:o0()}),eI=p.extend({method:al("notifications/message"),params:eN}),eA=o5({name:ow().optional()}),eM=o5({hints:o9(eA).optional(),costPriority:oK().min(0).max(1).optional(),speedPriority:oK().min(0).max(1).optional(),intelligencePriority:oK().min(0).max(1).optional()}),eq=o5({mode:as(["auto","required","none"]).optional()}),ez=o5({type:al("tool_result"),toolUseId:ow().describe("The unique identifier for the corresponding tool call."),content:o9(eg),structuredContent:o5({}).loose().optional(),isError:oZ().optional(),_meta:aa(ow(),o0()).optional()}),eL=ae("type",[ed,ep,eh]),eU=o5({role:F,content:o8([eD=ae("type",[ed,ep,eh,ef,ez]),o9(eD)]),_meta:aa(ow(),o0()).optional()}),eV=c.extend({messages:o9(eU),modelPreferences:eM.optional(),systemPrompt:ow().optional(),includeContext:as(["none","thisServer","allServers"]).optional(),temperature:oK().optional(),maxTokens:oK().int(),stopSequences:o9(ow()).optional(),metadata:t.optional(),tools:o9(ew).optional(),toolChoice:eq.optional()}),eF=u.extend({method:al("sampling/createMessage"),params:eV}),eH=h.extend({model:ow(),stopReason:ap(as(["endTurn","stopSequence","maxTokens"]).or(ow())),role:F,content:eL}),eK=h.extend({model:ow(),stopReason:ap(as(["endTurn","stopSequence","maxTokens","toolUse"]).or(ow())),role:F,content:o8([eD,o9(eD)])}),eJ=o5({type:al("boolean"),title:ow().optional(),description:ow().optional(),default:oZ().optional()}),eB=o5({type:al("string"),title:ow().optional(),description:ow().optional(),minLength:oK().optional(),maxLength:oK().optional(),format:as(["email","uri","date","date-time"]).optional(),default:ow().optional()}),eG=o5({type:as(["number","integer"]),title:ow().optional(),description:ow().optional(),minimum:oK().optional(),maximum:oK().optional(),default:oK().optional()}),eZ=o5({type:al("string"),title:ow().optional(),description:ow().optional(),enum:o9(ow()),default:ow().optional()}),eW=o5({type:al("string"),title:ow().optional(),description:ow().optional(),oneOf:o9(o5({const:ow(),title:ow()})),default:ow().optional()}),eX=o5({type:al("string"),title:ow().optional(),description:ow().optional(),enum:o9(ow()),enumNames:o9(ow()).optional(),default:ow().optional()}),eY=o8([eZ,eW]),eQ=o5({type:al("array"),title:ow().optional(),description:ow().optional(),minItems:oK().optional(),maxItems:oK().optional(),items:o5({type:al("string"),enum:o9(ow())}),default:o9(ow()).optional()}),e1=o8([eQ,e0=o5({type:al("array"),title:ow().optional(),description:ow().optional(),minItems:oK().optional(),maxItems:oK().optional(),items:o5({anyOf:o9(o5({const:ow(),title:ow()}))}),default:o9(ow()).optional()})]),e2=o8([eX,eY,e1]),e9=o8([e2,eJ,eB,eG]),e4=c.extend({mode:al("form").optional(),message:ow(),requestedSchema:o5({type:al("object"),properties:aa(ow(),e9),required:o9(ow()).optional()}).catchall(o0())}),e3=o8([e4,e5=c.extend({mode:al("url"),message:ow(),elicitationId:ow(),url:ow().url()})]),e6=u.extend({method:al("elicitation/create"),params:e3}),e8=d.extend({elicitationId:ow()}),e7=p.extend({method:al("notifications/elicitation/complete"),params:e8}),te=h.extend({action:as(["accept","decline","cancel"]),content:ak(e=>null===e?void 0:e,aa(ow(),o8([ow(),oK(),oZ(),o9(ow())])).optional())}),tt=o5({type:al("ref/resource"),uri:ow()}),tr=o5({type:al("ref/prompt"),name:ow()}),to=l.extend({ref:o8([tr,tt]),argument:o5({name:ow(),value:ow()}),context:o5({arguments:aa(ow(),ow()).optional()}).optional()}),ta=u.extend({method:al("completion/complete"),params:to}),ti=h.extend({completion:o3({values:o9(ow()).max(100),total:ap(oK().int()),hasMore:ap(oZ())})}),ts=o5({uri:ow().startsWith("file://"),name:ow().optional(),_meta:aa(ow(),o0()).optional()}),tn=u.extend({method:al("roots/list"),params:l.optional()}),tl=h.extend({roots:o9(ts)}),tc=p.extend({method:al("notifications/roots/list_changed"),params:d.optional()}),tu=o3({ttl:oK().optional(),pollInterval:oK().optional()}),td=as(["working","input_required","completed","failed","cancelled"]),tp=o5({taskId:ow(),status:td,ttl:o8([oK(),oX()]),createdAt:ow(),lastUpdatedAt:ow(),pollInterval:ap(oK()),statusMessage:ap(ow())}),th=h.extend({task:tp}),tf=d.merge(tp),tm=p.extend({method:al("notifications/tasks/status"),params:tf}),ty=u.extend({method:al("tasks/get"),params:l.extend({taskId:ow()})}),tg=h.merge(tp),tv=u.extend({method:al("tasks/result"),params:l.extend({taskId:ow()})}),tb=h.loose(),t_=q.extend({method:al("tasks/list")}),tS=z.extend({tasks:o9(tp)}),t$=u.extend({method:al("tasks/cancel"),params:l.extend({taskId:ow()})}),{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:a,TaskMetadataSchema:i,RelatedTaskMetadataSchema:s,RequestMetaSchema:n,BaseRequestParamsSchema:l,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:p,ResultSchema:h,RequestIdSchema:f,EmptyResultSchema:m,CancelledNotificationParamsSchema:y,CancelledNotificationSchema:g,IconSchema:v,IconsSchema:b,BaseMetadataSchema:_,ImplementationSchema:S,ClientTasksCapabilitySchema:E,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:P,InitializeRequestParamsSchema:k,InitializeRequestSchema:T,ServerCapabilitiesSchema:O,InitializeResultSchema:x,InitializedNotificationSchema:j,PingRequestSchema:C,ProgressSchema:N,ProgressNotificationParamsSchema:I,ProgressNotificationSchema:A,PaginatedRequestParamsSchema:M,PaginatedRequestSchema:q,PaginatedResultSchema:z,ResourceContentsSchema:L,TextResourceContentsSchema:D,BlobResourceContentsSchema:V,RoleSchema:F,AnnotationsSchema:H,ResourceSchema:K,ResourceTemplateSchema:J,ListResourcesRequestSchema:B,ListResourcesResultSchema:G,ListResourceTemplatesRequestSchema:Z,ListResourceTemplatesResultSchema:W,ResourceRequestParamsSchema:X,ReadResourceRequestParamsSchema:X,ReadResourceRequestSchema:Y,ReadResourceResultSchema:Q,ResourceListChangedNotificationSchema:ee,SubscribeRequestParamsSchema:X,SubscribeRequestSchema:et,UnsubscribeRequestParamsSchema:X,UnsubscribeRequestSchema:er,ResourceUpdatedNotificationParamsSchema:eo,ResourceUpdatedNotificationSchema:ea,PromptArgumentSchema:ei,PromptSchema:es,ListPromptsRequestSchema:en,ListPromptsResultSchema:el,GetPromptRequestParamsSchema:ec,GetPromptRequestSchema:eu,TextContentSchema:ed,ImageContentSchema:ep,AudioContentSchema:eh,ToolUseContentSchema:ef,EmbeddedResourceSchema:em,ResourceLinkSchema:ey,ContentBlockSchema:eg,PromptMessageSchema:ev,GetPromptResultSchema:eb,PromptListChangedNotificationSchema:e_,ToolAnnotationsSchema:eS,ToolExecutionSchema:e$,ToolSchema:ew,ListToolsRequestSchema:eE,ListToolsResultSchema:eR,CallToolResultSchema:eP,CallToolRequestParamsSchema:ek,CallToolRequestSchema:eT,ToolListChangedNotificationSchema:eO,LoggingLevelSchema:ex,SetLevelRequestParamsSchema:ej,SetLevelRequestSchema:eC,LoggingMessageNotificationParamsSchema:eN,LoggingMessageNotificationSchema:eI,ModelHintSchema:eA,ModelPreferencesSchema:eM,ToolChoiceSchema:eq,ToolResultContentSchema:ez,SamplingContentSchema:eL,SamplingMessageContentBlockSchema:eD,SamplingMessageSchema:eU,CreateMessageRequestParamsSchema:eV,CreateMessageRequestSchema:eF,CreateMessageResultSchema:eH,CreateMessageResultWithToolsSchema:eK,BooleanSchemaSchema:eJ,StringSchemaSchema:eB,NumberSchemaSchema:eG,UntitledSingleSelectEnumSchemaSchema:eZ,TitledSingleSelectEnumSchemaSchema:eW,LegacyTitledEnumSchemaSchema:eX,SingleSelectEnumSchemaSchema:eY,UntitledMultiSelectEnumSchemaSchema:eQ,TitledMultiSelectEnumSchemaSchema:e0,MultiSelectEnumSchemaSchema:e1,EnumSchemaSchema:e2,PrimitiveSchemaDefinitionSchema:e9,ElicitRequestFormParamsSchema:e4,ElicitRequestURLParamsSchema:e5,ElicitRequestParamsSchema:e3,ElicitRequestSchema:e6,ElicitationCompleteNotificationParamsSchema:e8,ElicitationCompleteNotificationSchema:e7,ElicitResultSchema:te,ResourceTemplateReferenceSchema:tt,PromptReferenceSchema:tr,CompleteRequestParamsSchema:to,CompleteRequestSchema:ta,CompleteResultSchema:ti,RootSchema:ts,ListRootsRequestSchema:tn,ListRootsResultSchema:tl,RootsListChangedNotificationSchema:tc,TaskCreationParamsSchema:tu,TaskStatusSchema:td,TaskSchema:tp,CreateTaskResultSchema:th,TaskStatusNotificationParamsSchema:tf,TaskStatusNotificationSchema:tm,GetTaskRequestSchema:ty,GetTaskResultSchema:tg,GetTaskPayloadRequestSchema:tv,GetTaskPayloadResultSchema:tb,ListTasksRequestSchema:t_,ListTasksResultSchema:tS,CancelTaskRequestSchema:t$,CancelTaskResultSchema:h.merge(tp),ClientRequestSchema:o8([C,T,ta,eC,eu,en,B,Z,Y,et,er,eT,eE,ty,tv,t_,t$]),ClientNotificationSchema:o8([g,A,j,tc,tm]),ClientResultSchema:o8([m,eH,eK,te,tl,tg,tS,th]),ServerRequestSchema:o8([C,eF,e6,tn,ty,tv,t_,t$]),ServerNotificationSchema:o8([g,A,eI,ea,ee,eO,e_,tm,e7]),ServerResultSchema:o8([m,x,ti,eb,el,G,W,Q,eP,eR,tg,tS,th]),CallToolResultWireSchema:o0().superRefine((e,t)=>{if(!("object"!=typeof e||null===e||Array.isArray(e))&&void 0===e.content){for(let r of ua)if(r in e)return void t.addIssue({code:"custom",message:`content is required when the body carries '${r}' — another result family cannot default into an empty tools/call success`})}}).transform(ui).pipe(eP)})}function un(e){return"object"!==e.type}let ul=new Set(["const","enum","default","examples"]),uc=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function uu(e){return void 0!==e&&!("string"==typeof e&&e.startsWith("#"))}let ud={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},up={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},uh={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};function uf(){if(o)return o;let e=us();return o={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}}}function um(e){return Object.prototype.hasOwnProperty.call(ud,e)}function uy(e){return Object.prototype.hasOwnProperty.call(up,e)}function ug(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function uv(e,t){if(void 0===e)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}Object.keys(ud),Object.keys(up);let ub={ok:!1,reason:"not-in-era"};function u_(e){return ug(e)&&ug(e.outputSchema)&&un(e.outputSchema)}let uS={era:"2025-11-25",hasRequestMethod:um,hasNotificationMethod:uy,validateRequest:(e,t)=>uv(um(e)?uf().requestSchemas[e]:void 0,t),validateResult:(e,t)=>uv(Object.prototype.hasOwnProperty.call(uh,e)?uf().resultSchemas[e]:void 0,t),validateNotification:(e,t)=>uv(uy(e)?uf().notificationSchemas[e]:void 0,t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ub,validateInputResponse:()=>ub,samplingResultVariant:(e,t)=>{let r=us();return uv(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=uo(e),o=r.structuredContent;if(void 0===o)return r;let a="object"!=typeof o||null===o||Array.isArray(o),i=void 0!==t&&un(t);return a||i?{...r,structuredContent:{result:o}}:r},decodeResult(e,t){if(ug(t)&&"resultType"in t){let e={...t};return delete e.resultType,{kind:"complete",result:e}}return{kind:"complete",result:t}},encodeResult(e,t){if("tools/list"!==e)return t;let r=t.tools;return Array.isArray(r)&&r.some(e=>u_(e))?{...t,tools:r.map(e=>u_(e)?{...e,outputSchema:function(e){var t;let r="string"==typeof e.$schema?e.$schema:void 0;if(uu(e.$id))return{...void 0!==r&&{$schema:r},type:"object",properties:{result:e},required:["result"]};let o="string"==typeof(t=e.$schema)&&cY.has(t.replace(/#$/,""))&&!0!==e.$recursiveAnchor,a=(e,t)=>{if(Array.isArray(e))return e.map(e=>a(e,!1));if(null===e||"object"!=typeof e||!t&&uu(e.$id))return e;let r={},i=!1;for(let[s,n]of Object.entries(e))t?r[s]=a(n,!1):("$ref"===s||"$dynamicRef"===s)&&"string"==typeof n?r[s]="#"===n?"#/properties/result":n.startsWith("#/")?`#/properties/result${n.slice(1)}`:n:"$recursiveRef"===s&&"#"===n&&o?i=!0:ul.has(s)?r[s]=n:uc.has(s)?r[s]=a(n,!0):r[s]=a(n,!1);return i&&("$ref"in r?r.allOf=[...Array.isArray(r.allOf)?r.allOf:[],{$ref:"#/properties/result"}]:r.$ref="#/properties/result"),r};return{...void 0!==r&&{$schema:r},type:"object",properties:{result:a(e,!1)},required:["result"]}}(e.outputSchema)}:e)}:t},encodeErrorCode:e=>-32002===e?-32602:e,checkInboundEnvelope:e=>void 0};function u$(){return a??=function(){let e=aR(()=>o8([ow(),oK(),oZ(),oX(),aa(ow(),e),o9(e)])),t=aa(ow(),e),r=o8([ow(),oK().int()]),o=ow(),a=o8([ow(),oK().int()]),i=as(["user","assistant"]),s=as(["debug","info","notice","warning","error","critical","alert","emergency"]),n=ow().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=o5({ttl:oK().optional()}),c=o5({taskId:ow()}),u=o3({progressToken:r.optional(),"io.modelcontextprotocol/related-task":c.optional()}),d=o5({_meta:u.optional()}),p=d.extend({task:l.optional()}),h=o5({_meta:u.optional()}),f=o5({method:ow(),params:h.loose().optional()}),m=o5({src:ow(),mimeType:ow().optional(),sizes:o9(ow()).optional(),theme:as(["light","dark"]).optional()}),y=o5({icons:o9(m).optional()}),g=o5({name:ow(),title:ow().optional()}),v=g.extend({...g.shape,...y.shape,version:ow(),websiteUrl:ow().optional(),description:ow().optional()}),b=ar(o5({applyDefaults:oZ().optional()}),t),_=ak(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,ar(o5({form:b.optional(),url:t.optional()}),t.optional())),S=o3({list:t.optional(),cancel:t.optional(),requests:o3({sampling:o3({createMessage:t.optional()}).optional(),elicitation:o3({create:t.optional()}).optional()}).optional()}),$=o3({list:t.optional(),cancel:t.optional(),requests:o3({tools:o3({call:t.optional()}).optional()}).optional()}),w=o5({experimental:aa(ow(),t).optional(),sampling:o5({context:t.optional(),tools:t.optional()}).optional(),elicitation:_.optional(),roots:o5({listChanged:oZ().optional()}).optional(),tasks:S.optional(),extensions:aa(ow(),t).optional()}),E=o5({experimental:aa(ow(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:o5({listChanged:oZ().optional()}).optional(),resources:o5({subscribe:oZ().optional(),listChanged:oZ().optional()}).optional(),tools:o5({listChanged:oZ().optional()}).optional(),tasks:$.optional(),extensions:aa(ow(),t).optional()}),R=o5({progress:oK(),total:ap(oK()),message:ap(ow())}),P=o5({...h.shape,...R.shape,progressToken:r}),k=f.extend({method:al("notifications/progress"),params:P}),T=h.extend({level:s,logger:ow().optional(),data:o0()}),O=f.extend({method:al("notifications/message"),params:T}),x=o5({uri:ow(),mimeType:ap(ow()),_meta:aa(ow(),o0()).optional()}),j=x.extend({text:ow()}),C=x.extend({blob:n}),N=o5({audience:o9(i).optional(),priority:oK().min(0).max(1).optional(),lastModified:oe({offset:!0}).optional()}),I=o5({...g.shape,...y.shape,uri:ow(),description:ap(ow()),mimeType:ap(ow()),size:ap(oK()),annotations:N.optional(),_meta:ap(o3({}))}),A=o5({...g.shape,...y.shape,uriTemplate:ow(),description:ap(ow()),mimeType:ap(ow()),annotations:N.optional(),_meta:ap(o3({}))}),M=f.extend({method:al("notifications/resources/list_changed"),params:h.optional()}),q=h.extend({uri:ow()}),z=f.extend({method:al("notifications/resources/updated"),params:q}),L=o5({name:ow(),description:ap(ow()),required:ap(oZ())}),D=o5({...g.shape,...y.shape,description:ap(ow()),arguments:ap(o9(L)),_meta:ap(o3({}))}),U=f.extend({method:al("notifications/prompts/list_changed"),params:h.optional()}),V=o5({type:al("text"),text:ow(),annotations:N.optional(),_meta:aa(ow(),o0()).optional()}),F=o5({type:al("image"),data:n,mimeType:ow(),annotations:N.optional(),_meta:aa(ow(),o0()).optional()}),H=o5({type:al("audio"),data:n,mimeType:ow(),annotations:N.optional(),_meta:aa(ow(),o0()).optional()}),K=o5({type:al("tool_use"),name:ow(),id:ow(),input:aa(ow(),o0()),_meta:aa(ow(),o0()).optional()}),J=o5({type:al("resource"),resource:o8([j,C]),annotations:N.optional(),_meta:aa(ow(),o0()).optional()}),B=I.extend({type:al("resource_link")}),G=o8([V,F,H,B,J]),Z=o5({role:i,content:G}),W=o5({title:ow().optional(),readOnlyHint:oZ().optional(),destructiveHint:oZ().optional(),idempotentHint:oZ().optional(),openWorldHint:oZ().optional()}),X=f.extend({method:al("notifications/tools/list_changed"),params:h.optional()}),Y=o5({name:ow().optional()}),Q=o5({hints:o9(Y).optional(),costPriority:oK().min(0).max(1).optional(),speedPriority:oK().min(0).max(1).optional(),intelligencePriority:oK().min(0).max(1).optional()}),ee=o5({mode:as(["auto","required","none"]).optional()}),et=o5({type:al("boolean"),title:ow().optional(),description:ow().optional(),default:oZ().optional()}),er=o5({type:al("string"),title:ow().optional(),description:ow().optional(),minLength:oK().optional(),maxLength:oK().optional(),format:as(["email","uri","date","date-time"]).optional(),default:ow().optional()}),eo=o5({type:as(["number","integer"]),title:ow().optional(),description:ow().optional(),minimum:oK().optional(),maximum:oK().optional(),default:oK().optional()}),ea=o5({type:al("string"),title:ow().optional(),description:ow().optional(),enum:o9(ow()),default:ow().optional()}),ei=o5({type:al("string"),title:ow().optional(),description:ow().optional(),oneOf:o9(o5({const:ow(),title:ow()})),default:ow().optional()}),es=o5({type:al("string"),title:ow().optional(),description:ow().optional(),enum:o9(ow()),enumNames:o9(ow()).optional(),default:ow().optional()}),en=o8([ea,ei]),el=o5({type:al("array"),title:ow().optional(),description:ow().optional(),minItems:oK().optional(),maxItems:oK().optional(),items:o5({type:al("string"),enum:o9(ow())}),default:o9(ow()).optional()}),ec=o5({type:al("array"),title:ow().optional(),description:ow().optional(),minItems:oK().optional(),maxItems:oK().optional(),items:o5({anyOf:o9(o5({const:ow(),title:ow()}))}),default:o9(ow()).optional()}),eu=o8([el,ec]),ed=o8([es,en,eu]),ep=o8([ed,et,er,eo]),eh=p.extend({mode:al("form").optional(),message:ow(),requestedSchema:o5({type:al("object"),properties:aa(ow(),ep),required:o9(ow()).optional()}).catchall(o0())}),ef=o5({type:al("ref/resource"),uri:ow()}),em=o5({type:al("ref/prompt"),name:ow()}),ey=o5({uri:ow().startsWith("file://"),name:ow().optional(),_meta:aa(ow(),o0()).optional()}),eg=w.shape,ev=o5({experimental:eg.experimental,sampling:eg.sampling,elicitation:eg.elicitation,roots:eg.roots,extensions:eg.extensions}),eb=E.shape,e_=o5({experimental:eb.experimental,logging:eb.logging,completions:eb.completions,prompts:eb.prompts,resources:eb.resources,tools:eb.tools,extensions:eb.extensions}),eS=o3({progressToken:r.optional(),[ax]:ow(),[aj]:v.optional(),[aN]:ev,[aA]:s.optional()}),e$=o5({...g.shape,...y.shape,description:ow().optional(),inputSchema:o3({$schema:ow().optional(),type:al("object")}),outputSchema:o3({$schema:ow().optional()}).optional(),annotations:W.optional(),_meta:aa(ow(),o0()).optional()}),ew=o5({type:al("tool_result"),toolUseId:ow(),content:o9(G),structuredContent:o0().optional(),isError:oZ().optional(),_meta:aa(ow(),o0()).optional()}),eE=o8([V,F,H,K,ew]),eR=o5({role:i,content:o8([eE,o9(eE)]),_meta:aa(ow(),o0()).optional()}),eP=ow(),ek=o3({[aC]:v.optional().catch(void 0)}),eT=ek.optional();function eO(e){return o3({_meta:eT,resultType:eP.default("complete"),...e})}let ex=eO({}),ej=eO({nextCursor:o.optional()}),eC=eO({content:o9(G),structuredContent:o0().optional(),isError:oZ().optional()}),eN=eO({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),tools:o9(e$),nextCursor:o.optional()}),eI=eO({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),prompts:o9(D),nextCursor:o.optional()}),eA=eO({description:ow().optional(),messages:o9(Z)}),eM=eO({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),resources:o9(I),nextCursor:o.optional()}),eq=eO({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),resourceTemplates:o9(A),nextCursor:o.optional()}),ez=eO({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),contents:o9(o8([j,C]))}),eL=eO({completion:o5({values:o9(ow()).max(100),total:oK().int().optional(),hasMore:oZ().optional()}).loose()}),eD=eO({ttlMs:oK().int().min(0),cacheScope:as(["public","private"])}),eU=eO({ttlMs:oK().int().min(0).catch(0),cacheScope:as(["public","private"]).catch("private"),supportedVersions:o9(ow()),capabilities:e_,instructions:ow().optional()}),eV=o5({messages:o9(eR),modelPreferences:Q.optional(),systemPrompt:ow().optional(),includeContext:as(["none","thisServer","allServers"]).optional(),temperature:oK().optional(),maxTokens:oK().int(),stopSequences:o9(ow()).optional(),metadata:t.optional(),tools:o9(e$).optional(),toolChoice:ee.optional()}),eF=o5({method:al("sampling/createMessage"),params:eV}),eH=o5({method:al("roots/list"),params:o5({_meta:aa(ow(),o0()).optional()}).optional()}),eK=o5({...eR.shape,model:ow(),stopReason:ow().optional()}),eJ=o5({roots:o9(ey)}),eB=o5({action:as(["accept","decline","cancel"]),content:aa(ow(),o8([ow(),oK(),oZ(),o9(ow())])).optional()}),eG=o5({mode:al("url"),message:ow(),url:ow().url()}),eZ=o8([eh,eG]),eW=o5({method:al("elicitation/create"),params:eZ}),eX=o8([eF,eH,eW]),eY=o8([eK,eJ,eB]),eQ=aa(ow(),eX),e0=aa(ow(),eY),e1=eO({inputRequests:eQ.optional(),requestState:ow().optional()}),e2={inputResponses:e0.optional(),requestState:ow().optional()},e9=o5({_meta:eS,...e2}),e4=o3({progressToken:r.optional()});function e5(e,t){return o5({method:al(e),params:o5({_meta:eS,...t})})}function e3(e,t){return o5({method:al(e),params:o5({_meta:e4.optional(),...t}).optional()})}let e6={name:ow(),arguments:aa(ow(),o0()).optional(),...e2},e8={cursor:o.optional()},e7=e5("tools/call",e6),te=e5("tools/list",e8),tt=e5("prompts/list",e8),tr=e5("prompts/get",{name:ow(),arguments:aa(ow(),ow()).optional(),...e2}),to=e5("resources/list",e8),ta=e5("resources/templates/list",e8),ti=e5("resources/read",{uri:ow(),...e2}),ts={ref:o8([em,ef]),argument:o5({name:ow(),value:ow()}),context:o5({arguments:aa(ow(),ow()).optional()}).optional()},tn=e5("completion/complete",ts),tl=e5("server/discover",{}),tc=o5({toolsListChanged:oZ().optional(),promptsListChanged:oZ().optional(),resourcesListChanged:oZ().optional(),resourceSubscriptions:o9(ow()).optional()}),tu={notifications:tc},td=e5("subscriptions/listen",tu),tp=ek.extend({"io.modelcontextprotocol/subscriptionId":a}),th=o3({_meta:tp,resultType:eP.default("complete")}),tf={"tools/call":e3("tools/call",e6),"tools/list":e3("tools/list",e8),"prompts/get":e3("prompts/get",{name:ow(),arguments:aa(ow(),ow()).optional()}),"prompts/list":e3("prompts/list",e8),"resources/list":e3("resources/list",e8),"resources/templates/list":e3("resources/templates/list",e8),"resources/read":e3("resources/read",{uri:ow()}),"completion/complete":e3("completion/complete",ts),"server/discover":e3("server/discover",{}),"subscriptions/listen":e3("subscriptions/listen",tu)};function tm(e){return o3({_meta:eT,...e})}let ty={"tools/call":tm({content:o9(G),structuredContent:o0().optional(),isError:oZ().optional()}),"tools/list":tm({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),tools:o9(e$),nextCursor:o.optional()}),"prompts/get":tm({description:ow().optional(),messages:o9(Z)}),"prompts/list":tm({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),prompts:o9(D),nextCursor:o.optional()}),"resources/list":tm({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),resources:o9(I),nextCursor:o.optional()}),"resources/templates/list":tm({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),resourceTemplates:o9(A),nextCursor:o.optional()}),"resources/read":tm({ttlMs:oK().int().min(0),cacheScope:as(["public","private"]),contents:o9(o8([j,C]))}),"completion/complete":tm({completion:o5({values:o9(ow()).max(100),total:oK().int().optional(),hasMore:oZ().optional()}).loose()}),"server/discover":tm({ttlMs:oK().int().min(0).catch(0),cacheScope:as(["public","private"]).catch("private"),supportedVersions:o9(ow()),capabilities:e_,instructions:ow().optional()}),"subscriptions/listen":tm({})},tg=o3({"io.modelcontextprotocol/subscriptionId":a.optional()}),tv=o5({method:al("notifications/subscriptions/acknowledged"),params:o5({_meta:tg.optional(),notifications:tc})}),tb=o5({_meta:tg.optional(),requestId:a,reason:ow().optional()}),t_=o5({method:al("notifications/cancelled"),params:tb}),tS=e=>o5({jsonrpc:al("2.0"),id:o8([ow(),oK().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:a,RoleSchema:i,LoggingLevelSchema:s,TaskMetadataSchema:l,RelatedTaskMetadataSchema:c,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:p,NotificationsParamsSchema:h,NotificationSchema:f,IconSchema:m,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:v,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:$,ClientCapabilitiesSchema:w,ServerCapabilitiesSchema:E,ProgressSchema:R,ProgressNotificationParamsSchema:P,ProgressNotificationSchema:k,LoggingMessageNotificationParamsSchema:T,LoggingMessageNotificationSchema:O,ResourceContentsSchema:x,TextResourceContentsSchema:j,BlobResourceContentsSchema:C,AnnotationsSchema:N,ResourceSchema:I,ResourceTemplateSchema:A,ResourceListChangedNotificationSchema:M,ResourceUpdatedNotificationParamsSchema:q,ResourceUpdatedNotificationSchema:z,PromptArgumentSchema:L,PromptSchema:D,PromptListChangedNotificationSchema:U,TextContentSchema:V,ImageContentSchema:F,AudioContentSchema:H,ToolUseContentSchema:K,EmbeddedResourceSchema:J,ResourceLinkSchema:B,ContentBlockSchema:G,PromptMessageSchema:Z,ToolAnnotationsSchema:W,ToolListChangedNotificationSchema:X,ModelHintSchema:Y,ModelPreferencesSchema:Q,ToolChoiceSchema:ee,BooleanSchemaSchema:et,StringSchemaSchema:er,NumberSchemaSchema:eo,UntitledSingleSelectEnumSchemaSchema:ea,TitledSingleSelectEnumSchemaSchema:ei,LegacyTitledEnumSchemaSchema:es,SingleSelectEnumSchemaSchema:en,UntitledMultiSelectEnumSchemaSchema:el,TitledMultiSelectEnumSchemaSchema:ec,MultiSelectEnumSchemaSchema:eu,EnumSchemaSchema:ed,PrimitiveSchemaDefinitionSchema:ep,ElicitRequestFormParamsSchema:eh,ResourceTemplateReferenceSchema:ef,PromptReferenceSchema:em,RootSchema:ey,ClientCapabilities2026Schema:ev,ServerCapabilities2026Schema:e_,RequestMetaEnvelopeSchema:eS,ToolSchema:e$,ToolResultContentSchema:ew,SamplingMessageContentBlockSchema:eE,SamplingMessageSchema:eR,ResultTypeSchema:eP,ResultMetaSchema:ek,ResultSchema:ex,PaginatedResultSchema:ej,CallToolResultSchema:eC,ListToolsResultSchema:eN,ListPromptsResultSchema:eI,GetPromptResultSchema:eA,ListResourcesResultSchema:eM,ListResourceTemplatesResultSchema:eq,ReadResourceResultSchema:ez,CompleteResultSchema:eL,CacheableResultSchema:eD,DiscoverResultSchema:eU,CreateMessageRequestParamsSchema:eV,CreateMessageRequestSchema:eF,ListRootsRequestSchema:eH,CreateMessageResultSchema:eK,ListRootsResultSchema:eJ,ElicitResultSchema:eB,ElicitRequestURLParamsSchema:eG,ElicitRequestParamsSchema:eZ,ElicitRequestSchema:eW,InputRequestSchema:eX,InputResponseSchema:eY,InputRequestsSchema:eQ,InputResponsesSchema:e0,InputRequiredResultSchema:e1,InputResponseRequestParamsSchema:e9,CallToolRequestSchema:e7,ListToolsRequestSchema:te,ListPromptsRequestSchema:tt,GetPromptRequestSchema:tr,ListResourcesRequestSchema:to,ListResourceTemplatesRequestSchema:ta,ReadResourceRequestSchema:ti,CompleteRequestSchema:tn,DiscoverRequestSchema:tl,SubscriptionFilterSchema:tc,SubscriptionsListenRequestSchema:td,SubscriptionsListenResultMetaSchema:tp,SubscriptionsListenResultSchema:th,dispatchRequestSchemas:tf,dispatchResultSchemas:ty,NotificationMetaSchema:tg,SubscriptionsAcknowledgedNotificationSchema:tv,CancelledNotificationParamsSchema:tb,CancelledNotificationSchema:t_,notificationSchemas2026:{"notifications/cancelled":t_,"notifications/progress":k,"notifications/message":O,"notifications/resources/updated":z,"notifications/resources/list_changed":M,"notifications/tools/list_changed":X,"notifications/prompts/list_changed":U,"notifications/subscriptions/acknowledged":tv},JSONRPCResultResponseSchema:tS(ex),CallToolResultResponseSchema:tS(o8([eC,e1])),ListToolsResultResponseSchema:tS(eN),ListPromptsResultResponseSchema:tS(eI),GetPromptResultResponseSchema:tS(o8([eA,e1])),ListResourcesResultResponseSchema:tS(eM),ListResourceTemplatesResultResponseSchema:tS(eq),ReadResourceResultResponseSchema:tS(o8([ez,e1])),CompleteResultResponseSchema:tS(eL),DiscoverResultResponseSchema:tS(eU)}}()}let uw=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],uE=Symbol("modelcontextprotocol.resultCacheHintFallback");function uR(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function uP(e){return"public"===e||"private"===e}let uk=((y={})[y.ParseError=-32700]="ParseError",y[y.InvalidRequest=-32600]="InvalidRequest",y[y.MethodNotFound=-32601]="MethodNotFound",y[y.InvalidParams=-32602]="InvalidParams",y[y.InternalError=-32603]="InternalError",y[y.ResourceNotFound=-32002]="ResourceNotFound",y[y.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",y[y.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",y[y.UrlElicitationRequired=-32042]="UrlElicitationRequired",y);var uT=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return c9(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return c9(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",c2(this,new.target)}static fromError(t,r,o){return t===uk.UrlElicitationRequired&&o&&o.elicitations?new ux(o.elicitations,r):t===uk.UnsupportedProtocolVersion&&o&&Array.isArray(o.supported)&&"string"==typeof o.requested?new uj({supported:o.supported,requested:o.requested},r):(t===uk.InvalidParams||t===uk.ResourceNotFound)&&"string"==typeof o?.uri&&(t===uk.ResourceNotFound||1===Object.keys(o).length)?new uO(o.uri,r):t===uk.MissingRequiredClientCapability&&o&&null!==o.requiredCapabilities&&"object"==typeof o.requiredCapabilities&&!Array.isArray(o.requiredCapabilities)?new uC({requiredCapabilities:o.requiredCapabilities},r):new e(t,r,o)}},uO=class extends uT{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(uk.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},ux=class extends uT{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(uk.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},uj=class extends uT{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(uk.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},uC=class extends uT{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(uk.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let uN=["tools/call","prompts/get","resources/read"],uI=["elicitation/create","sampling/createMessage","roots/list"];function uA(){if(n)return n;let e=u$();return n={request:{"elicitation/create":o5({method:al("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":o5({method:al("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":o5({method:al("roots/list"),params:o3({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}}}function uM(e){return uI.includes(e)}function uq(e){return uM(e)?uA().request[e]:void 0}let uz={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},uL={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function uD(e){return Object.prototype.hasOwnProperty.call(uz,e)}function uU(e){return Object.prototype.hasOwnProperty.call(uL,e)}function uV(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function uF(e,t){if(void 0===e)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}Object.keys(uz),Object.keys(uL);let uH={ok:!1,reason:"not-in-era"},uK=[ax,aN],uJ={era:"2026-07-28",hasRequestMethod:uD,hasNotificationMethod:uU,hasInputRequestMethod:e=>void 0!==uq(e),validateRequest:(e,t)=>uF(uD(e)?u$().dispatchRequestSchemas[e]:void 0,t),validateResult:(e,t)=>uF(Object.prototype.hasOwnProperty.call(uz,e)?u$().dispatchResultSchemas[e]:void 0,t),validateNotification:(e,t)=>uF(uU(e)?u$().notificationSchemas2026[e]:void 0,t),validateInputRequest:(e,t)=>uF(uq(e),t),validateInputResponse:(e,t)=>uF(uM(e)?uA().response[e]:void 0,t),samplingResultVariant:()=>uH,outboundEnvelope:e=>({[ax]:e.protocolVersion,[aj]:e.clientInfo,[aN]:e.clientCapabilities,...void 0!==e.logLevel&&{[aA]:e.logLevel}}),validateEnvelopeMeta(e){let t=[];for(let r of uK)r in e||t.push({key:r,problem:"missing"});let r=u$().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let e of r.error.issues){let r=e.path.map(String),o=r.length>0?r.join("."):"_meta";1===r.length&&t.some(e=>e.key===o&&"missing"===e.problem)||t.push({key:o,problem:e.message})}return t},projectCallToolResult:e=>uo(e),inputRequestSchema:uq,decodeResult(e,t){if(!uV(t))return{kind:"invalid",error:new c6(c3.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(void 0===r)return{kind:"invalid",error:new c6(c3.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if("string"!=typeof r)return{kind:"invalid",error:new c6(c3.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if("input_required"===r){let r=t.inputRequests,o=uV(r)?r:{},a=t.requestState;return 0===Object.keys(o).length&&"string"!=typeof a?{kind:"invalid",error:new c6(c3.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:o,..."string"==typeof a&&{requestState:a}}}if("complete"!==r)return{kind:"invalid",error:new c6(c3.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=function(){if(l)return l;let e=u$();return l={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema}}(),a=Object.hasOwn(o,e)?o[e]:void 0;if(void 0!==a){let r=a.safeParse(t);if(!r.success)return{kind:"invalid",error:new c6(c3.InvalidResult,`Invalid result for ${e}: ${r.error}`,{method:e})}}let i={...t};return delete i.resultType,{kind:"complete",result:i}},encodeResult:(e,t,r)=>(function(e,t){if(void 0===t)return e;let r=e._meta;return void 0===r?{...e,_meta:{[aC]:t}}:null===r||"object"!=typeof r||Array.isArray(r)||void 0!==r[aC]?e:{...e,_meta:{...r,[aC]:t}}})(function(e,t){var r,o;let a=t[uE];if("complete"!==t.resultType||!uw.includes(e)){let e;return void 0===a?t:(e={...t},delete e[uE],e)}let i=uR(t.ttlMs)?t.ttlMs:void 0!==(r=a)&&uR(r.ttlMs)?r.ttlMs:0,s=uP(t.cacheScope)?t.cacheScope:void 0!==(o=a)&&uP(o.cacheScope)?o.cacheScope:"private",n={...t,ttlMs:i,cacheScope:s};return delete n[uE],n}(e,function(e,t){let r=t.resultType;if(void 0===r)return{...t,resultType:"complete"};if("complete"===r||uN.includes(e))return t;throw new uT(uk.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}(e,function(e,t){let r=t,o=!1,a=()=>(o||(r={...r},o=!0),r),i=t.tools;"tools/list"===e&&Array.isArray(i)&&i.some(e=>uV(e)&&"execution"in e)&&(a().tools=i.map(e=>{if(!uV(e)||!("execution"in e))return e;let t={...e};return delete t.execution,t}));let s=t.capabilities;if(uV(s)&&"tasks"in s){let e={...s};delete e.tasks,a().capabilities=e}return r}(e,t))),r),encodeErrorCode:e=>-32002===e?-32602:e,checkInboundEnvelope(e){if(void 0===e.envelope)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=u$().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join("; ")}`}},uB="2026-07-28";function uG(e){return void 0!==e&&e>=c7?uJ:uS}function uZ(e){return void 0!==e.revision?uG(e.revision).era:"modern"===e.era?uJ.era:uS.era}function uW(e){return uY.some(t=>t.hasRequestMethod(e))}function uX(e){return uY.some(t=>t.hasNotificationMethod(e))}let uY=[uS,uJ];var uQ=((e,t)=>{let r={};for(var o in e)cH(r,o,{get:e[o],enumerable:!0});return t&&cH(r,Symbol.toStringTag,{value:"Module"}),r})({AnnotationsSchema:()=>ik,AudioContentSchema:()=>i9,BaseMetadataSchema:()=>a7,BaseRequestParamsSchema:()=>aH,BlobResourceContentsSchema:()=>iR,BooleanSchemaSchema:()=>sT,CallToolRequestParamsSchema:()=>sl,CallToolRequestSchema:()=>sc,CallToolResultSchema:()=>ss,CancelTaskRequestSchema:()=>na,CancelTaskResultSchema:()=>ni,CancelledNotificationParamsSchema:()=>a5,CancelledNotificationSchema:()=>a3,ClientCapabilitiesSchema:()=>ii,ClientNotificationSchema:()=>nn,ClientRequestSchema:()=>ns,ClientResultSchema:()=>nl,ClientTasksCapabilitySchema:()=>io,CompatibilityCallToolResultSchema:()=>sn,CompleteRequestParamsSchema:()=>sZ,CompleteRequestSchema:()=>sW,CompleteResultSchema:()=>sX,ContentBlockSchema:()=>i6,CreateMessageRequestParamsSchema:()=>sE,CreateMessageRequestSchema:()=>sR,CreateMessageResultSchema:()=>sP,CreateMessageResultWithToolsSchema:()=>sk,CreateTaskResultSchema:()=>s5,CursorSchema:()=>aD,DiscoverRequestSchema:()=>ip,DiscoverResultSchema:()=>ih,ElicitRequestFormParamsSchema:()=>sD,ElicitRequestParamsSchema:()=>sV,ElicitRequestSchema:()=>sF,ElicitRequestURLParamsSchema:()=>sU,ElicitResultSchema:()=>sJ,ElicitationCompleteNotificationParamsSchema:()=>sH,ElicitationCompleteNotificationSchema:()=>sK,EmbeddedResourceSchema:()=>i5,EmptyResultSchema:()=>a4,EnumSchemaSchema:()=>sz,GetPromptRequestParamsSchema:()=>iQ,GetPromptRequestSchema:()=>i0,GetPromptResultSchema:()=>i7,GetTaskPayloadRequestSchema:()=>ne,GetTaskPayloadResultSchema:()=>nt,GetTaskRequestSchema:()=>s8,GetTaskResultSchema:()=>s7,IconSchema:()=>a6,IconsSchema:()=>a8,ImageContentSchema:()=>i2,ImplementationSchema:()=>ie,InitializeRequestParamsSchema:()=>is,InitializeRequestSchema:()=>il,InitializeResultSchema:()=>iu,InitializedNotificationSchema:()=>id,JSONArraySchema:()=>az,JSONObjectSchema:()=>aq,JSONRPCErrorResponseSchema:()=>a1,JSONRPCMessageSchema:()=>a2,JSONRPCNotificationSchema:()=>aQ,JSONRPCRequestSchema:()=>aY,JSONRPCResponseSchema:()=>a9,JSONRPCResultResponseSchema:()=>a0,JSONValueSchema:()=>aM,LegacyTitledEnumSchemaSchema:()=>sN,ListChangedOptionsBaseSchema:()=>sd,ListPromptsRequestSchema:()=>iX,ListPromptsResultSchema:()=>iY,ListResourceTemplatesRequestSchema:()=>iC,ListResourceTemplatesResultSchema:()=>iN,ListResourcesRequestSchema:()=>ix,ListResourcesResultSchema:()=>ij,ListRootsRequestSchema:()=>sQ,ListRootsResultSchema:()=>s0,ListTasksRequestSchema:()=>nr,ListTasksResultSchema:()=>no,ListToolsRequestSchema:()=>sa,ListToolsResultSchema:()=>si,LoggingLevelSchema:()=>sp,LoggingMessageNotificationParamsSchema:()=>sm,LoggingMessageNotificationSchema:()=>sy,ModelHintSchema:()=>sg,ModelPreferencesSchema:()=>sv,MultiSelectEnumSchemaSchema:()=>sq,NotificationSchema:()=>aG,NotificationsParamsSchema:()=>aB,NumberSchemaSchema:()=>sx,PaginatedRequestParamsSchema:()=>ib,PaginatedRequestSchema:()=>i_,PaginatedResultSchema:()=>iS,PingRequestSchema:()=>im,PrimitiveSchemaDefinitionSchema:()=>sL,ProgressNotificationParamsSchema:()=>ig,ProgressNotificationSchema:()=>iv,ProgressSchema:()=>iy,ProgressTokenSchema:()=>aL,PromptArgumentSchema:()=>iZ,PromptListChangedNotificationSchema:()=>se,PromptMessageSchema:()=>i8,PromptReferenceSchema:()=>sG,PromptSchema:()=>iW,ReadResourceRequestParamsSchema:()=>iI,ReadResourceRequestSchema:()=>iA,ReadResourceResultSchema:()=>iM,RelatedTaskMetadataSchema:()=>aV,RequestIdSchema:()=>aX,RequestMetaSchema:()=>aF,RequestSchema:()=>aJ,ResourceContentsSchema:()=>i$,ResourceLinkSchema:()=>i3,ResourceListChangedNotificationSchema:()=>iq,ResourceRequestParamsSchema:()=>iI,ResourceSchema:()=>iT,ResourceTemplateReferenceSchema:()=>sB,ResourceTemplateSchema:()=>iO,ResourceUpdatedNotificationParamsSchema:()=>iB,ResourceUpdatedNotificationSchema:()=>iG,ResultMetaObjectSchema:()=>aZ,ResultSchema:()=>aW,RoleSchema:()=>iP,RootSchema:()=>sY,RootsListChangedNotificationSchema:()=>s1,SamplingContentSchema:()=>sS,SamplingMessageContentBlockSchema:()=>s$,SamplingMessageSchema:()=>sw,ServerCapabilitiesSchema:()=>ic,ServerNotificationSchema:()=>nu,ServerRequestSchema:()=>nc,ServerResultSchema:()=>nd,ServerTasksCapabilitySchema:()=>ia,SetLevelRequestParamsSchema:()=>sh,SetLevelRequestSchema:()=>sf,SingleSelectEnumSchemaSchema:()=>sI,StringSchemaSchema:()=>sO,SubscribeRequestParamsSchema:()=>iI,SubscribeRequestSchema:()=>iz,SubscriptionFilterSchema:()=>iD,SubscriptionsAcknowledgedNotificationParamsSchema:()=>iF,SubscriptionsAcknowledgedNotificationSchema:()=>iH,SubscriptionsListenRequestParamsSchema:()=>iU,SubscriptionsListenRequestSchema:()=>iV,SubscriptionsListenResultMetaSchema:()=>iK,SubscriptionsListenResultSchema:()=>iJ,TaskAugmentedRequestParamsSchema:()=>aK,TaskCreationParamsSchema:()=>s2,TaskMetadataSchema:()=>aU,TaskSchema:()=>s4,TaskStatusNotificationParamsSchema:()=>s3,TaskStatusNotificationSchema:()=>s6,TaskStatusSchema:()=>s9,TextContentSchema:()=>i1,TextResourceContentsSchema:()=>iw,TitledMultiSelectEnumSchemaSchema:()=>sM,TitledSingleSelectEnumSchemaSchema:()=>sC,ToolAnnotationsSchema:()=>st,ToolChoiceSchema:()=>sb,ToolExecutionSchema:()=>sr,ToolListChangedNotificationSchema:()=>su,ToolResultContentSchema:()=>s_,ToolSchema:()=>so,ToolUseContentSchema:()=>i4,UnsubscribeRequestParamsSchema:()=>iI,UnsubscribeRequestSchema:()=>iL,UntitledMultiSelectEnumSchemaSchema:()=>sA,UntitledSingleSelectEnumSchemaSchema:()=>sj});let u0=e=>a0.safeParse(e).success,u1=e=>a1.safeParse(e).success,u2=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType,u9="x-mcp-header",u4=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,u5=new Set(["string","integer","boolean","number"]);function u3(e){let t=[],r=new Map,o=(e,a,i)=>{if(null===e||"object"!=typeof e)return;if(u9 in e){if(!i||0===a.length)return`${u7(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let o=e[u9];if("string"!=typeof o||0===o.length)return`${u7(a)}: x-mcp-header MUST be a non-empty string`;if(!u4.test(o))return`${u7(a)}: x-mcp-header '${o}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let s="string"==typeof e.type?e.type:void 0;if(void 0===s||!u5.has(s))return`${u7(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${s??"<none>"}`;let n=o.toLowerCase(),l=r.get(n);if(void 0!==l)return`x-mcp-header '${o}' is not case-insensitively unique (also declared as '${l}')`;r.set(n,o),t.push({path:a,headerName:o,type:s})}let s=e.properties;if(null!==s&&"object"==typeof s)for(let[e,t]of Object.entries(s)){let r=o(t,[...a,e],i);if(void 0!==r)return r}for(let t of u6){let r=e[t];if(void 0!==r)for(let e of Array.isArray(r)?r:null!==r&&"object"==typeof r&&u8.has(t)?Object.values(r):[r]){let r=o(e,[...a,`<${t}>`],!1);if(void 0!==r)return r}}},a=o(e,[],!0);return void 0===a?{valid:!0,declarations:t}:{valid:!1,reason:a}}let u6=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],u8=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function u7(e){return 0===e.length?"<root>":e.join(".")}let de="=?base64?";function dt(e){return!function(e){if(0===e.length||e.startsWith(de)&&e.endsWith("?=")||e!==e.trim())return!0;for(let t=0;t<e.length;t++){let r=e.codePointAt(t);if(9!==r&&(!(r>=32)||!(r<=126)))return!0}return!1}(e)?e:`${de}${function(e){let t=new TextEncoder().encode(e),r="";for(let e of t)r+=String.fromCodePoint(e);return btoa(r)}(e)}?=`}function dr(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function da(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}uk.InvalidRequest,uk.UnsupportedProtocolVersion,uk.InvalidParams,uk.MethodNotFound,uk.InvalidParams,uk.MissingRequiredClientCapability,uk.ParseError,uk.InvalidRequest,uk.MethodNotFound,uk.UnsupportedProtocolVersion,uk.MissingRequiredClientCapability;let di=!1,ds="draft-2020-12";async function dn(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(e=>e.path?.length?`${e.path.map(e=>String("object"==typeof e?e.key:e)).join(".")}: ${e.message}`:e.message).join(", ")}:{success:!0,data:r.value}}let dl=/\\\.\\d\{(\d+)\}/;function dc(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let du=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function dd(e){return du.has(e)||e.startsWith("x-")}let dp=new Set(["$schema",...Object.keys(sD.shape.requestedSchema.shape)]),dh={string:dr([sO,sj,sC,sN]),number:dr([sx]),integer:dr([sx]),boolean:dr([sT]),array:dr([sA,sM])},df=new Set(sO.shape.format.unwrap().options);async function dm(e){let{config:t,method:r,originalParams:o,requestOptions:a,hooks:i,signal:s}=e,n=e.flowStartedAt??Date.now(),l=e.firstPayload,c=0;for(;;){let e;if((c+=1)>t.maxRounds){var u;throw new c6(c3.InputRequiredRoundsExceeded,(u=t.maxRounds,`Multi-round-trip request '${r}' still required input after ${u} rounds (inputRequired.maxRounds)`),{rounds:t.maxRounds,lastResult:{inputRequests:l.inputRequests,...void 0!==l.requestState&&{requestState:l.requestState}}})}a.onprogress?.({progress:c,message:`Fulfilling input required by '${r}' (round ${c})`});let d=Object.entries(l.inputRequests??{});if(d.length>0){let t=function(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener("abort",r)}}(s);try{let r=await Promise.all(d.map(async([e,r])=>{try{return[e,await i.dispatchInputRequest(e,r,t.signal)]}catch(e){throw t.abort(e),e}}));e=Object.fromEntries(r)}finally{t.dispose()}}else await function(e,t){return new Promise((e,r)=>{if(t?.aborted)return void r(t.reason instanceof c6?t.reason:new c6(c3.RequestTimeout,String(t.reason)));let o=setTimeout(()=>{t?.removeEventListener("abort",a),e()},250),a=()=>{clearTimeout(o),r(t?.reason instanceof c6?t.reason:new c6(c3.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",a,{once:!0})})}(0,s);let p={...void 0!==a.timeout&&{timeout:a.timeout}};if(void 0!==a.maxTotalTimeout){let e=Date.now()-n,t=a.maxTotalTimeout-e;if(t<=0)throw new c6(c3.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:a.maxTotalTimeout,totalElapsed:e});p.maxTotalTimeout=t}let h=await i.retry(function(e,t,r){let o=void 0!==t&&Object.keys(t).length>0;return o||void 0!==r?{...e,...o&&{inputResponses:t},...void 0!==r&&{requestState:r}}:e}(o,e,l.requestState),p);if(u2(h)){l={inputRequests:h.inputRequests??{},...void 0!==h.requestState&&{requestState:h.requestState}};continue}return h}}Object.assign(function(e){let t=void 0!==e.inputRequests&&Object.keys(e.inputRequests).length>0,r="string"==typeof e.requestState;if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...void 0!==e.inputRequests&&{inputRequests:e.inputRequests},...void 0!==e.requestState&&{requestState:e.requestState}}},{elicit(e){try{return{method:"elicitation/create",params:function(e){var t;if(!da(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let r=e.requestedSchema["~standard"].vendor,o=function(e,t){let r={},o=[];for(let[a,i]of Object.entries(e))"properties"===a&&dc(i)?r[a]=Object.fromEntries(Object.entries(i).map(([e,r])=>[e,function(e,t,r,o){if(!dc(e))return e;let a="string"==typeof e.type&&Object.hasOwn(dh,e.type)?dh[e.type]:void 0;if(void 0===a)return e;let i={};for(let[n,l]of Object.entries(e))if(a.has(n)||dd(n))i[n]=l;else if("pattern"===n&&"string"===e.type&&"string"==typeof e.format)if(df.has(e.format)){var s;"string"==typeof l&&(s=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[rv(oR,void 0)];break;case"uri":r=[r_(oT,void 0)];break;case"date":r=[or()];break;case"date-time":let o,a;o=dl.exec(t),a=[void 0,-1,0],o&&a.push(Number(o[1])),r=[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>a.map(r=>oe({local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=r8(e,{target:ds,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(s,l).has(l))||o.push(`${t}.${n}`)}else i[n]=l;else o.push(`${t}.${n}`);return i}(r,`properties.${e}`,t,o)])):dp.has(a)?r[a]=i:dd(a)||o.push(a);if(o.length>0)throw new uT(uk.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}(function(e){try{return function(e,t="input"){let r,o=e["~standard"];if(o.jsonSchema)r=o.jsonSchema[t]({target:ds});else if("zod"===o.vendor){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");di||(di=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=r8(e,{target:ds,io:t})}else throw Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if("output"===t)return void 0!==r.type||!function e(t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;for(let r of["oneOf","anyOf","allOf"]){let o=t[r];if(Array.isArray(o)&&o.length>0)return o.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t)))}return!1}(r)?r:{type:"object",...r};if(void 0!==r.type&&"object"!==r.type)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}(e,"input")}catch(t){let e=t instanceof Error?t.message:String(t);throw new uT(uk.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),a=(t=sD.shape.requestedSchema,ol(t,o));if(!a.success)throw new uT(uk.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!dc(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!ol(sL,e).success).map(([e])=>`properties.${e}`);return r.length>0?r.join(", "):t}(o,a.error.message)}`);let i=function e(t,r,o=""){return Array.isArray(t)&&Array.isArray(r)?t.flatMap((t,a)=>e(t,r[a],`${o}[${a}]`)):dc(t)&&dc(r)?Object.entries(t).flatMap(([t,a])=>{let i=o?`${o}.${t}`:t;return Object.prototype.hasOwnProperty.call(r,t)?e(a,r[t],i):dd(t)?[]:[i]}):[]}(o,a.data);if(i.length>0)throw new uT(uk.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);let s=(a.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(a.data.properties,e));if(s.length>0)throw new uT(uk.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}(e)}}catch(e){throw e instanceof uT?TypeError(e.message,{cause:e}):e}},elicitUrl:e=>({method:"elicitation/create",params:{...e,mode:"url"}}),createMessage:e=>({method:"sampling/createMessage",params:e}),listRoots:()=>({method:"roots/list"})});let dy={},dg={};function dv(e,t){let r=e.slice(0,-6);dy[r]=t,dg[r]=e=>t.safeParse(e).success}for(let e of["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"])dv(e,uQ[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:nv,OAuthClientInformationFullSchema:nw,OAuthClientInformationSchema:n$,OAuthClientMetadataSchema:nS,OAuthClientRegistrationErrorSchema:nE,OAuthErrorResponseSchema:nb,OAuthMetadataSchema:nf,OAuthProtectedResourceMetadataSchema:nh,OAuthTokenRevocationRequestSchema:nR,OAuthTokensSchema:ng,OpenIdProviderDiscoveryMetadataSchema:ny,OpenIdProviderMetadataSchema:nm}))dv(e,t);Object.freeze(dy);let db=Object.freeze(dg),d_=[ax,aj,aN,aA],dS=["inputResponses","requestState"];function d$(e,t){let r=e.params;if(!dP(r))return{message:e,lifted:{}};let o=r._meta,a=dP(o)?d_.filter(e=>e in o):[],i="request"===t?dS.filter(e=>e in r):[];if(0===a.length&&0===i.length)return{message:e,lifted:{}};let s={},n={...r};if(a.length>0&&dP(o)){let e={},t={...o};for(let r of a)e[r]=o[r],delete t[r];s.envelope=e,Object.keys(t).length>0?n._meta=t:delete n._meta}for(let e of i)"inputResponses"===e&&(s.inputResponses=n[e]),"requestState"===e&&(s.requestState=n[e]),delete n[e];return{message:{...e,params:n},lifted:s}}function dw(e,t){let r=e.validateResult(t,void 0);if(r.ok||"not-in-era"!==r.reason)return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(r){let o=e.validateResult(t,r);return o.ok?{value:o.value}:{issues:[{message:"invalid"===o.reason?o.message:`not-in-era: ${t}`}]}}}}}let dE=(g=void 0,()=>g);var dR=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??aO,this.setNotificationHandler("notifications/cancelled",e=>{this._oncancel(e)}),this.setNotificationHandler("notifications/progress",e=>{this._onprogress(e)}),this.setRequestHandler("ping",e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(void 0===t)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new c6(c3.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:a,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new c6(c3.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=e=>{r?.(e),this._onerror(e)};let o=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{if(o?.(e,t),u0(e)||u1(e))this._onresponse(e);else if(aY.safeParse(e).success)this._onrequest(e,t);else aQ.safeParse(e).success?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;for(let e of(this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._timeoutInfo.values()))clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new c6(c3.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(r);for(let e of t.values())e.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=d$(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return;if(t?.classification!==void 0){let e=uZ(t.classification);if(e!==o.era)return void this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${e} but this instance serves ${o.era}`))}if(uX(r.method)&&!o.hasNotificationMethod(r.method))return;let a=this._notificationHandlers.get(r.method),i=this.fallbackNotificationHandler;(void 0!==a||void 0!==i)&&Promise.resolve().then(()=>void 0===a?i(r):a(r,o)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var r;let{message:o,lifted:a}=d$(e,"request"),i=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return void this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));let s=this._transport,n=(e,t,r)=>{let a={jsonrpc:"2.0",id:o.id,error:{code:e,message:t,...void 0!==r&&{data:r}}};s?.send(a).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=uZ(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${o.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;n(uk.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(uW(o.method)&&!i.hasRequestMethod(o.method))return void n(uk.MethodNotFound,"Method not found");let l=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(void 0===l)return void n(uk.MethodNotFound,"Method not found");let c=i.checkInboundEnvelope(a);if(void 0!==c)return void n(uk.InvalidParams,c);let u=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:o.id}),d=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:o.id}),p=new AbortController;this._requestHandlerAbortControllers.set(o.id,p);let h=void 0===a.inputResponses?void 0:function(e){let t={},r=[];if(!dk(e))return{accepted:t,droppedKeys:r};for(let[o,a]of Object.entries(e)){if(!dk(a)||"method"in a||"result"in a){r.push(o);continue}t[o]=a}return{accepted:t,droppedKeys:r}}(a.inputResponses),f={sessionId:s?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...void 0!==a.envelope&&{envelope:a.envelope},...void 0!==h&&{inputResponses:h.accepted},...void 0!==h&&h.droppedKeys.length>0&&{droppedInputResponseKeys:h.droppedKeys},requestState:void 0===a.requestState?dE:(r=a.requestState,()=>r),signal:p.signal,send:(e,t,r)=>{let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),da(t))return d(e,t,r);let a=dw(o,e.method);if(void 0===a)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return d(e,a,t)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(f,t);Promise.resolve().then(()=>l(o,m)).then(async e=>{let t;if(p.signal.aborted)return;try{t=i.encodeResult(o.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${o.method}: ${e}`)),n(uk.InternalError,"Internal error");return}let r={result:t,jsonrpc:"2.0",id:o.id};await s?.send(r)},async e=>{if(p.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:uk.InternalError,r={jsonrpc:"2.0",id:o.id,error:{code:i.encodeErrorCode(t),message:e.message??"Internal error",...void 0!==e.data&&{data:e.data}}};await s?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===p&&this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),a=this._progressHandlers.get(o);if(!a)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));let i=this._responseHandlers.get(o),s=this._timeoutInfo.get(o);if(s&&i&&s.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(e){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(e);return}a(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);void 0===r?this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`)):(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),r(u0(e)?e:uT.fromError(e.error.code,e.error.message,e.error.data)))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),da(t))return this._requestWithSchemaViaCodec(o,e,t,r);let a=dw(o,e.method);if(void 0===a)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,a,t)}_negotiatedWireCodec(){return uG(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(void 0===this._negotiatedProtocolVersion){let t=function(e){switch(e){case"initialize":case"notifications/initialized":return uG(void 0);case"server/discover":return uG(uB);default:return}}(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(uW(t)&&!e.hasRequestMethod(t))throw new c6(c3.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let a,i,{relatedRequestId:s,resumptionToken:n,onresumptiontoken:l,headers:c}=o??{},u=Date.now();return new Promise((d,p)=>{let h=e=>{p(e)};if(!this._transport)return void h(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){h(e);return}if(o?.signal?.aborted){let e=o.signal.reason;throw e instanceof c6?e:new c6(c3.RequestTimeout,String(e))}let f=e.era===uB&&!0===this._transport.hasPerRequestStream?new AbortController:void 0,m=this._requestMessageId++;i=m;let y={...t,jsonrpc:"2.0",id:m};o?.onprogress&&(this._progressHandlers.set(m,o.onprogress),y.params={...t.params,_meta:{...t.params?._meta,progressToken:m}});let g=this._envelopeOutbound(y),v=!1,b=e=>{v||(this._progressHandlers.delete(m),void 0===f?this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(e)}}),{relatedRequestId:s,resumptionToken:n,onresumptiontoken:l}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):f.abort(),p(e instanceof c6?e:new c6(c3.RequestTimeout,String(e))))};this._responseHandlers.set(m,a=>{let i;if(!o?.signal?.aborted){if(v=!0,a instanceof Error)return p(a);try{i=e.decodeResult(t.method,a.result)}catch(e){return p(e instanceof Error?e:Error(String(e)))}if("invalid"===i.kind)return p(i.error);if("input_required"===i.kind){var s;return o?.allowInputRequired===!0?d({resultType:"input_required",inputRequests:(s=i).inputRequests,...void 0!==s.requestState&&{requestState:s.requestState}}):d(this._resolveNonCompleteResult(i,{codec:e,request:t,resultSchema:r,options:o,flowStartedAt:u,retry:(o,a)=>this._requestWithSchemaViaCodec(e,void 0===o?{method:t.method}:{method:t.method,params:o},r,a)}))}dn(r,i.result).then(e=>{e.success?d(e.data):p(new c6(c3.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},p)}}),a=()=>b(o?.signal?.reason),o?.signal?.addEventListener("abort",a,{once:!0});let _=o?.timeout??6e4;this._setupTimeout(m,_,o?.maxTotalTimeout,()=>b(new c6(c3.RequestTimeout,"Request timed out",{timeout:_})),o?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:s,resumptionToken:n,onresumptiontoken:l,headers:c,requestSignal:f?.signal}).catch(e=>{this._progressHandlers.delete(m),p(e)})}).finally(()=>{a&&o?.signal?.removeEventListener("abort",a),void 0!==i&&(this._responseHandlers.delete(i),this._cleanupTimeout(i))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new c6(c3.NotConnected,"Not connected");if(uX(t.method)&&!e.hasNotificationMethod(t.method))throw new c6(c3.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(o,r).catch(e=>this._onerror(e))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){let o;if(this.assertRequestHandlerCapability(e),"function"==typeof t){if(!uW(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(r,o)=>{let a=this._negotiatedWireCodec(),i=a.validateRequest(e,r);if(i.ok||"not-in-era"!==i.reason||(i=a.validateInputRequest(e,r)),!i.ok){if("not-in-era"===i.reason)throw new uT(uk.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(i.message)}return Promise.resolve(t(i.value,o))}}else if(r)o=async(o,a)=>{let i=await dn(t.params,{...o.params});if(!i.success)throw new uT(uk.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,a)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if("function"==typeof t){if(!uX(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(r,o)=>{let a=o.validateNotification(e,r);if(!a.ok){if("not-in-era"===a.reason)throw new uT(uk.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(a.message)}return Promise.resolve(t(a.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let a=await dn(t.params,{...o.params});if(!a.success)throw new uT(uk.InvalidParams,`Invalid params for notification ${e}: ${a.error}`);await r(a.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function dP(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function dk(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function dT(e){throw new c6(c3.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}async function dO(e,t,r,o,a){var i;if(!dk(o)||"string"!=typeof o.method)throw new c6(c3.InvalidResult,`Invalid input request '${r}': each inputRequests entry must be an embedded request object with a method`,{key:r});let s=o.method;if(!t.hasInputRequestMethod(s))throw new c6(c3.InvalidResult,`Invalid input request '${r}': '${s}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:r,method:s});let n=e.getRequestHandler(s);if(void 0===n)throw new c6(c3.CapabilityNotSupported,`Cannot fulfil input request '${r}': no handler is registered for '${s}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:r,method:s});let l=dk(o.params)?o.params:void 0;return await n({jsonrpc:"2.0",id:r,method:s,...void 0!==l&&{params:l}},e.buildContext({sessionId:e.sessionId,mcpReq:{id:r,method:s,_meta:l?._meta,requestState:(i=void 0,()=>i),signal:a,send:()=>dT("send"),notify:()=>dT("notify")}}))}var dx=cW(cZ(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function a(e){this.parameters=Object.create(null),this.type=e}e.parse=function(e){if(!e)throw TypeError("argument string is required");var i,s,n,l="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof l)throw TypeError("argument string is required to be a string");var c=l.indexOf(";"),u=-1!==c?l.slice(0,c).trim():l.trim();if(!o.test(u))throw TypeError("invalid media type");var d=new a(u.toLowerCase());if(-1!==c){for(t.lastIndex=c;s=t.exec(l);){if(s.index!==c)throw TypeError("invalid parameter format");c+=s[0].length,i=s[1].toLowerCase(),34===(n=s[2]).charCodeAt(0)&&-1!==(n=n.slice(1,-1)).indexOf("\\")&&(n=n.replace(r,"$1")),d.parameters[i]=n}if(c!==l.length)throw TypeError("invalid parameter format")}return d}})(),1),dj=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??0xa00000}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let t=this._buffer.indexOf("\n");if(-1===t)break;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");this._buffer=this._buffer.subarray(t+1);try{var e;return e=r,a2.parse(JSON.parse(e))}catch(e){if(e instanceof SyntaxError)continue;throw e}}return null}clear(){this._buffer=void 0}};function dC(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}var dN=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}};function a(e,...t){let r=[e[0]],i=0;for(;i<t.length;)n(r,t[i]),r.push(e[++i]);return new o(r)}e._Code=o,e.nil=new o(""),e._=a;let i=new o("+");function s(e,...t){let a=[l(e[0])],c=0;for(;c<t.length;)a.push(i),n(a,t[c]),a.push(i,l(e[++c]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===i){var o,a;let i=(o=e[t-1],'""'===(a=e[t+1])?o:'""'===o?a:"string"==typeof o?a instanceof r||'"'!==o[o.length-1]?void 0:"string"!=typeof a?`${o.slice(0,-1)}${a}"`:'"'===a[0]?o.slice(0,-1)+a.slice(1):void 0:"string"!=typeof a||'"'!==a[0]||o instanceof r?void 0:`"${o}${a.slice(1)}`);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(a),new o(a)}function n(e,t){var a;t instanceof o?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(a=t)||"boolean"==typeof a||null===a?a:l(Array.isArray(a)?a.join(","):a))}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=n,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new o(l(e))},e.safeStringify=l,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new o(`.${t}`):a`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new o(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new o(e.toString())}}),dI=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=dN();var r,o,a=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}};(r=o||(e.UsedValueState=o={}))[r.Started=0]="Started",r[r.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var s=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(r)}[${o}]`}};e.ValueScopeName=s;let n=(0,t._)`\n`;var l=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?n:t.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:a}=o,i=null!=(r=t.key)?r:t.ref,s=this._values[a];if(s){let e=s.get(i);if(e)return e}else s=this._values[a]=new Map;s.set(i,o);let n=this._scope[a]||(this._scope[a]=[]),l=n.length;return n[l]=t.ref,o.setValue(t,{property:a,itemIndex:l}),o}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw Error(`CodeGen: name "${r}" has no value`);return(0,t._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(r,i,s={},n){let l=t.nil;for(let c in r){let u=r[c];if(!u)continue;let d=s[c]=s[c]||new Map;u.forEach(r=>{if(d.has(r))return;d.set(r,o.Started);let s=i(r);if(s){let o=this.opts.es5?e.varKinds.var:e.varKinds.const;l=(0,t._)`${l}${o} ${r} = ${s};${this.opts._n}`}else if(s=null==n?void 0:n(r))l=(0,t._)`${l}${s}${this.opts._n}`;else throw new a(r);d.set(r,o.Completed)})}return l}};e.ValueScope=l}),dA=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=dN(),r=dI();var o=dN();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var a=dI();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var i=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},s=class extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let o=e?r.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${o} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},n=class extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=x(this.rhs,e,r),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends n{constructor(e,t,r,o){super(e,r,o),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},c=class extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},d=class extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},p=class extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=x(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,o=r.length;for(;o--;){let a=r[o];a.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,a.names),r.splice(o,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>T(e,t.names),{})}},f=class extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},m=class extends h{},y=class extends f{};y.kind="else";var g=class e extends f{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(!0===t)return this.nodes;let r=this.else;if(r){let e=r.optimizeNodes();r=this.else=Array.isArray(e)?new y(e):e}return r?!1===t?r instanceof e?r:r.nodes:this.nodes.length?this:new e(j(t),r instanceof e?[r]:r.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=x(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&T(e,this.else.names),e}};g.kind="if";var v=class extends f{};v.kind="for";var b=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=x(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}},_=class extends v{constructor(e,t,r,o){super(),this.varKind=e,this.name=t,this.from=r,this.to=o}render(e){let t=e.es5?r.varKinds.var:this.varKind,{name:o,from:a,to:i}=this;return`for(${t} ${o}=${a}; ${o}<${i}; ${o}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},S=class extends v{constructor(e,t,r,o){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=x(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}},$=class extends f{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};$.kind="func";var w=class extends h{render(e){return"return "+super.render(e)}};w.kind="return";var E=class extends f{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,o;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(o=this.finally)||o.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}},R=class extends f{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};R.kind="catch";var P=class extends f{render(e){return"finally"+super.render(e)}};P.kind="finally";var k=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,o){let a=this._scope.toName(t);return void 0!==r&&o&&(this._constants[a.str]=r),this._leafNode(new s(e,a,r)),a}const(e,t,o){return this._def(r.varKinds.const,e,t,o)}let(e,t,o){return this._def(r.varKinds.let,e,t,o)}var(e,t,o){return this._def(r.varKinds.var,e,t,o)}assign(e,t,r){return this._leafNode(new n(e,t,r))}add(t,r){return this._leafNode(new l(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new p(e)),this}object(...e){let r=["{"];for(let[o,a]of e)r.length>1&&r.push(","),r.push(o),(o!==a||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,a));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.let){let s=this._scope.toName(e);return this._for(new _(i,s,t,o),()=>a(s))}forOf(e,o,a,i=r.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let e=o instanceof t.Name?o:this.var("_arr",o);return this.forRange("_i",0,(0,t._)`${e}.length`,r=>{this.var(s,(0,t._)`${e}[${r}]`),a(s)})}return this._for(new S("of",i,s,o),()=>a(s))}forIn(e,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${o})`,a);let s=this._scope.toName(e);return this._for(new S("in",i,s,o),()=>a(s))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new c(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new w;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let o=new E;if(this._blockNode(o),this.code(e),t){let e=this.name("e");this._currNode=o.catch=new R(e),t(e)}return r&&(this._currNode=o.finally=new P,this.code(r)),this._endBlockNode(R,P)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,o,a){return this._blockNode(new $(e,r,o)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof g))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function T(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,r){return r instanceof t._CodeOrName?T(e,r.names):e}function x(e,r,o){var a;if(e instanceof t.Name)return i(e);if(!((a=e)instanceof t._Code&&a._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==o[e.str])))return e;return new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=i(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[]));function i(e){let t=o[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function j(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,t._)`!${A(e)}`}e.CodeGen=k,e.not=j;let C=I(e.operators.AND);e.and=function(...e){return e.reduce(C)};let N=I(e.operators.OR);function I(e){return(r,o)=>r===t.nil?o:o===t.nil?r:(0,t._)`${A(r)} ${e} ${A(o)}`}function A(e){return e instanceof t.Name?e:(0,t._)`(${e})`}e.or=function(...e){return e.reduce(N)}}),dM=cZ(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let o=dA(),a=dN();function i(e,t=e.schema){let{opts:r,self:o}=e;if(!r.strictSchema||"boolean"==typeof t)return;let a=o.RULES.keywords;for(let r in t)a[r]||h(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(i,s,n,l)=>{let c=void 0===n?s:n instanceof o.Name?(s instanceof o.Name?e(i,s,n):t(i,s,n),n):s instanceof o.Name?(t(i,n,s),s):r(s,n);return l!==o.Name||c instanceof o.Name?c:a(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,o._)`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach(r=>e.assign((0,o._)`${t}${(0,o.getProperty)(r)}`,!0))}e.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},e.checkUnknownRules=i,e.schemaHasRules=s,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,a,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,o._)`${r}`}return(0,o._)`${e}${t}${(0,o.getProperty)(a)}`},e.unescapeFragment=function(e){return l(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(n(e))},e.escapeJsonPointer=n,e.unescapeJsonPointer=l,e.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},e.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if((0,o._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,o._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,o._)`${r} || {}`).code((0,o._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,o._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,o._)`${r} || {}`),d(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,r)=>e.if((0,o._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,o._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,o._)`${r} !== true`,()=>e.assign(r,!0===t||(0,o._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=u,e.setEvaluated=d;let p={};function h(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new a._Code(t.code))})},(r=t||(e.Type=t={}))[r.Num=0]="Num",r[r.Str=1]="Str",e.getErrorPath=function(e,r,a){if(e instanceof o.Name){let i=r===t.Num;return a?i?(0,o._)`"[" + ${e} + "]"`:(0,o._)`"['" + ${e} + "']"`:i?(0,o._)`"/" + ${e}`:(0,o._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return a?(0,o.getProperty)(e).toString():"/"+n(e)},e.checkStrictMode=h}),dq=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA();e.default={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")}}),dz=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=dA(),r=dM(),o=dq();function a(e,r){let a=e.const("err",r);e.if((0,t._)`${o.default.vErrors} === null`,()=>e.assign(o.default.vErrors,(0,t._)`[${a}]`),(0,t._)`${o.default.vErrors}.push(${a})`),e.code((0,t._)`${o.default.errors}++`)}function i(e,r){let{gen:o,validateName:a,schemaEnv:i}=e;i.$async?o.throw((0,t._)`new ${e.ValidationError}(${r})`):(o.assign((0,t._)`${a}.errors`,r),o.return(!1))}e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?(0,t.str)`"${e}" keyword must be ${r} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`},e.reportError=function(r,o=e.keywordError,s,l){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c,h=n(r,o,s);(null!=l?l:d||p)?a(u,h):i(c,(0,t._)`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,s){let{it:l}=t,{gen:c,compositeRule:u,allErrors:d}=l;a(c,n(t,r,s)),u||d||i(l,o.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(o.default.errors,r),e.if((0,t._)`${o.default.vErrors} !== null`,()=>e.if(r,()=>e.assign((0,t._)`${o.default.vErrors}.length`,r),()=>e.assign(o.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:a,data:i,errsCount:s,it:n}){if(void 0===s)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",s,o.default.errors,s=>{e.const(l,(0,t._)`${o.default.vErrors}[${s}]`),e.if((0,t._)`${l}.instancePath === undefined`,()=>e.assign((0,t._)`${l}.instancePath`,(0,t.strConcat)(o.default.instancePath,n.errorPath))),e.assign((0,t._)`${l}.schemaPath`,(0,t.str)`${n.errSchemaPath}/${r}`),n.opts.verbose&&(e.assign((0,t._)`${l}.schema`,a),e.assign((0,t._)`${l}.data`,i))})};let s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function n(e,a,i){let{createErrors:n}=e.it;return!1===n?(0,t._)`{}`:function(e,a,i={}){let{gen:n,it:l}=e,c=[function({errorPath:e},{instancePath:a}){let i=a?(0,t.str)`${e}${(0,r.getErrorPath)(a,r.Type.Str)}`:e;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,i)]}(l,i),function({keyword:e,it:{errSchemaPath:o}},{schemaPath:a,parentSchema:i}){let n=i?o:(0,t.str)`${o}/${e}`;return a&&(n=(0,t.str)`${n}${(0,r.getErrorPath)(a,r.Type.Str)}`),[s.schemaPath,n]}(e,i)];return function(e,{params:r,message:a},i){let{keyword:n,data:l,schemaValue:c,it:u}=e,{opts:d,propertyName:p,topSchemaRef:h,schemaPath:f}=u;i.push([s.keyword,n],[s.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),d.messages&&i.push([s.message,"function"==typeof a?a(e):a]),d.verbose&&i.push([s.schema,c],[s.parentSchema,(0,t._)`${h}${f}`],[o.default.data,l]),p&&i.push([s.propertyName,p])}(e,a,c),n.object(...c)}(e,a,i)}}),dL=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=dz(),r=dA(),o=dq(),a={message:"boolean schema is false"};function i(e,r){let{gen:o,data:i}=e;(0,t.reportError)({gen:o,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},a,void 0,r)}e.topBoolOrEmptySchema=function(e){let{gen:t,schema:a,validateName:s}=e;!1===a?i(e,!1):"object"==typeof a&&!0===a.$async?t.return(o.default.data):(t.assign((0,r._)`${s}.errors`,null),t.return(!0))},e.boolOrEmptySchema=function(e,t){let{gen:r,schema:o}=e;!1===o?(r.var(t,!1),i(e)):r.var(t,!0)}}),dD=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);e.isJSONType=function(e){return"string"==typeof e&&t.has(e)},e.getRules=function(){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:{}}}}),dU=cZ(e=>{function t(e,t){return t.rules.some(t=>r(e,t))}function r(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0,e.schemaHasRulesForType=function({schema:e,self:r},o){let a=r.RULES.types[o];return a&&!0!==a&&t(e,a)},e.shouldUseGroup=t,e.shouldUseRule=r}),dV=cZ(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let o=dD(),a=dU(),i=dz(),s=dA(),n=dM();function l(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(o.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(r=t||(e.DataType=t={}))[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong",e.getSchemaTypes=function(e){let t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=l,e.coerceAndCheckDataType=function(e,r){var o,i;let{gen:n,data:l,opts:u}=e,p=(o=r,(i=u.coerceTypes)?o.filter(e=>c.has(e)||"array"===i&&"array"===e):[]),f=r.length>0&&!(0===p.length&&1===r.length&&(0,a.schemaHasRulesForType)(e,r[0]));if(f){let o=d(r,l,u.strictNumbers,t.Wrong);n.if(o,()=>{p.length?function(e,t,r){let{gen:o,data:a,opts:i}=e,n=o.let("dataType",(0,s._)`typeof ${a}`),l=o.let("coerced",(0,s._)`undefined`);for(let e of("array"===i.coerceTypes&&o.if((0,s._)`${n} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>o.assign(a,(0,s._)`${a}[0]`).assign(n,(0,s._)`typeof ${a}`).if(d(t,a,i.strictNumbers),()=>o.assign(l,a))),o.if((0,s._)`${l} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":o.elseIf((0,s._)`${n} == "number" || ${n} == "boolean"`).assign(l,(0,s._)`"" + ${a}`).elseIf((0,s._)`${a} === null`).assign(l,(0,s._)`""`);return;case"number":o.elseIf((0,s._)`${n} == "boolean" || ${a} === null
69
+ || (${n} == "string" && ${a} && ${a} == +${a})`).assign(l,(0,s._)`+${a}`);return;case"integer":o.elseIf((0,s._)`${n} === "boolean" || ${a} === null
70
+ || (${n} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(l,(0,s._)`+${a}`);return;case"boolean":o.elseIf((0,s._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(l,!1).elseIf((0,s._)`${a} === "true" || ${a} === 1`).assign(l,!0);return;case"null":o.elseIf((0,s._)`${a} === "" || ${a} === 0 || ${a} === false`),o.assign(l,null);return;case"array":o.elseIf((0,s._)`${n} === "string" || ${n} === "number"
71
+ || ${n} === "boolean" || ${a} === null`).assign(l,(0,s._)`[${a}]`)}}(e);o.else(),h(e),o.endIf(),o.if((0,s._)`${l} !== undefined`,()=>{o.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,s._)`${t} !== undefined`,()=>e.assign((0,s._)`${t}[${r}]`,o))}(e,l)})}(e,r,p):h(e)})}return f};let c=new Set(["string","number","integer","boolean","null"]);function u(e,r,o,a=t.Correct){let i,n=a===t.Correct?s.operators.EQ:s.operators.NEQ;switch(e){case"null":return(0,s._)`${r} ${n} null`;case"array":i=(0,s._)`Array.isArray(${r})`;break;case"object":i=(0,s._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":i=l((0,s._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":i=l();break;default:return(0,s._)`typeof ${r} ${n} ${e}`}return a===t.Correct?i:(0,s.not)(i);function l(e=s.nil){return(0,s.and)((0,s._)`typeof ${r} == "number"`,e,o?(0,s._)`isFinite(${r})`:s.nil)}}function d(e,t,r,o){let a;if(1===e.length)return u(e[0],t,r,o);let i=(0,n.toHash)(e);if(i.array&&i.object){let e=(0,s._)`typeof ${t} != "object"`;a=i.null?e:(0,s._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else a=s.nil;for(let e in i.number&&delete i.integer,i)a=(0,s.and)(a,u(e,t,r,o));return a}e.checkDataType=u,e.checkDataTypes=d;let p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,s._)`{type: ${e}}`:(0,s._)`{type: ${t}}`};function h(e){let t=function(e){let{gen:t,data:r,schema:o}=e,a=(0,n.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:r,schema:o.type,schemaCode:a,schemaValue:a,parentSchema:o,params:{},it:e}}(e);(0,i.reportError)(t,p)}e.reportTypeError=h}),dF=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=dA(),r=dM();function o(e,o,a){let{gen:i,compositeRule:s,data:n,opts:l}=e;if(void 0===a)return;let c=(0,t._)`${n}${(0,t.getProperty)(o)}`;if(s)return void(0,r.checkStrictMode)(e,`default is ignored for: ${c}`);let u=(0,t._)`${c} === undefined`;"empty"===l.useDefaults&&(u=(0,t._)`${u} || ${c} === null || ${c} === ""`),i.if(u,(0,t._)`${c} = ${(0,t.stringify)(a)}`)}e.assignDefaults=function(e,t){let{properties:r,items:a}=e.schema;if("object"===t&&r)for(let t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(a)&&a.forEach((t,r)=>o(e,r,t.default))}}),dH=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=dA(),r=dM(),o=dq(),a=dM();function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}function s(e,r,o){return(0,t._)`${i(e)}.call(${r}, ${o})`}function n(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} === undefined`;return a?(0,t.or)(i,(0,t.not)(s(e,r,o))):i}function l(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}e.checkReportMissingProp=function(e,r){let{gen:o,data:a,it:i}=e;o.if(n(o,a,r,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${r}`},!0),e.error()})},e.checkMissingProp=function({gen:e,data:r,it:{opts:o}},a,i){return(0,t.or)(...a.map(a=>(0,t.and)(n(e,r,a,o.ownProperties),(0,t._)`${i} = ${a}`)))},e.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},e.hasPropFunc=i,e.isOwnProperty=s,e.propertyInData=function(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} !== undefined`;return a?(0,t._)`${i} && ${s(e,r,o)}`:i},e.noPropertyInData=n,e.allSchemaProperties=l,e.schemaProperties=function(e,t){return l(t).filter(o=>!(0,r.alwaysValidSchema)(e,t[o]))},e.callValidateCode=function({schemaCode:e,data:r,it:{gen:a,topSchemaRef:i,schemaPath:s,errorPath:n},it:l},c,u,d){let p=d?(0,t._)`${e}, ${r}, ${i}${s}`:r,h=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,n)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let f=(0,t._)`${p}, ${a.object(...h)}`;return u!==t.nil?(0,t._)`${c}.call(${u}, ${f})`:(0,t._)`${c}(${f})`};let c=(0,t._)`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},o){let i=r.unicodeRegExp?"u":"",{regExp:s}=r.code,n=s(o,i);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:(0,t._)`${"new RegExp"===s.code?c:(0,a.useFunc)(e,s)}(${o}, ${i})`})},e.validateArray=function(e){let{gen:o,data:a,keyword:i,it:s}=e,n=o.name("valid");if(s.allErrors){let e=o.let("valid",!0);return l(()=>o.assign(e,!1)),e}return o.var(n,!0),l(()=>o.break()),n;function l(s){let l=o.const("len",(0,t._)`${a}.length`);o.forRange("i",0,l,a=>{e.subschema({keyword:i,dataProp:a,dataPropType:r.Type.Num},n),o.if((0,t.not)(n),s)})}},e.validateUnion=function(e){let{gen:o,schema:a,keyword:i,it:s}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(a.some(e=>(0,r.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;let n=o.let("valid",!1),l=o.name("_valid");o.block(()=>a.forEach((r,a)=>{let s=e.subschema({keyword:i,schemaProp:a,compositeRule:!0},l);o.assign(n,(0,t._)`${n} || ${l}`),e.mergeValidEvaluated(s,l)||o.if((0,t.not)(n))})),e.result(n,()=>e.reset(),()=>e.error(!0))}}),dK=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=dA(),r=dq(),o=dH(),a=dz();function i(e){let{gen:r,data:o,it:a}=e;r.if(a.parentData,()=>r.assign(o,(0,t._)`${a.parentData}[${a.parentDataProperty}]`))}function s(e,r,o){if(void 0===o)throw Error(`keyword "${r}" failed to compile`);return e.scopeValue("keyword","function"==typeof o?{ref:o}:{ref:o,code:(0,t.stringify)(o)})}e.macroKeywordCode=function(e,r){let{gen:o,keyword:a,schema:i,parentSchema:n,it:l}=e,c=r.macro.call(l.self,i,n,l),u=s(o,a,c);!1!==l.opts.validateSchema&&l.self.validateSchema(c,!0);let d=o.name("valid");e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${l.errSchemaPath}/${a}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},e.funcKeywordCode=function(e,n){var l;let{gen:c,keyword:u,schema:d,parentSchema:p,$data:h,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(f,n);let m=s(c,u,!h&&n.compile?n.compile.call(f.self,d,p,f):n.validate),y=c.let("valid");function g(a=n.async?(0,t._)`await `:t.nil){let i=f.opts.passContext?r.default.this:r.default.self,s=!("compile"in n&&!h||!1===n.schema);c.assign(y,(0,t._)`${a}${(0,o.callValidateCode)(e,m,i,s)}`,n.modifying)}function v(e){var r;c.if((0,t.not)(null!=(r=n.valid)?r:y),e)}e.block$data(y,function(){if(!1===n.errors)g(),n.modifying&&i(e),v(()=>e.error());else{let o,s,l=n.async?(o=c.let("ruleErrs",null),c.try(()=>g((0,t._)`await `),e=>c.assign(y,!1).if((0,t._)`${e} instanceof ${f.ValidationError}`,()=>c.assign(o,(0,t._)`${e}.errors`),()=>c.throw(e))),o):(s=(0,t._)`${m}.errors`,c.assign(s,null),g(t.nil),s);n.modifying&&i(e),v(()=>(function(e,o){let{gen:i}=e;i.if((0,t._)`Array.isArray(${o})`,()=>{i.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${o} : ${r.default.vErrors}.concat(${o})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,a.extendErrors)(e)},()=>e.error())})(e,l))}}),e.ok(null!=(l=n.valid)?l:y)},e.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},e.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:o},a,i){if(Array.isArray(a.keyword)?!a.keyword.includes(i):a.keyword!==i)throw Error("ajv implementation error");let s=a.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(a.validateSchema&&!a.validateSchema(e[i])){let e=`keyword "${i}" value is invalid at path "${o}": `+r.errorsText(a.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}}),dJ=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=dA(),r=dM();e.getSubschema=function(e,{keyword:o,schemaProp:a,schema:i,schemaPath:s,errSchemaPath:n,topSchemaRef:l}){if(void 0!==o&&void 0!==i)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==o){let i=e.schema[o];return void 0===a?{schema:i,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${e.errSchemaPath}/${o}`}:{schema:i[a],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(a)}`,errSchemaPath:`${e.errSchemaPath}/${o}/${(0,r.escapeFragment)(a)}`}}if(void 0!==i){if(void 0===s||void 0===n||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:l,errSchemaPath:n}}throw Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,o,{dataProp:a,dataPropType:i,data:s,dataTypes:n,propertyName:l}){if(void 0!==s&&void 0!==a)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=o;if(void 0!==a){let{errorPath:s,dataPathArr:n,opts:l}=o;u(c.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0)),e.errorPath=(0,t.str)`${s}${(0,r.getErrorPath)(a,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${a}`,e.dataPathArr=[...n,e.parentDataProperty]}function u(t){e.data=t,e.dataLevel=o.dataLevel+1,e.dataTypes=[],o.definedProperties=new Set,e.parentData=o.data,e.dataNames=[...o.dataNames,t]}void 0!==s&&(u(s instanceof t.Name?s:c.let("data",s,!0)),void 0!==l&&(e.propertyName=l)),n&&(e.dataTypes=n)},e.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:o,createErrors:a,allErrors:i}){void 0!==o&&(e.compositeRule=o),void 0!==a&&(e.createErrors=a),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}}),dB=cZ((e,t)=>{t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((o=t.length)!=r.length)return!1;for(a=o;0!=a--;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=o;0!=a--;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=o;0!=a--;){var o,a,i,s=i[a];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}}),dG=cZ((e,t)=>{var r=t.exports=function(e,t,o){"function"==typeof t&&(o=t,t={});var a="function"==typeof(o=t.cb||o)?o:o.pre||function(){};!function e(t,o,a,i,s,n,l,c,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in o(i,s,n,l,c,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in r.arrayKeywords)for(var f=0;f<h.length;f++)e(t,o,a,h[f],s+"/"+p+"/"+f,n,s,p,i,f)}else if(p in r.propsKeywords){if(h&&"object"==typeof h)for(var m in h)e(t,o,a,h[m],s+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),n,s,p,i,m)}else(p in r.keywords||t.allKeys&&!(p in r.skipKeywords))&&e(t,o,a,h,s+"/"+p,n,s,p,i)}a(i,s,n,l,c,u,d)}}(t,a,o.post||function(){},e,"",e)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.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}}),dZ=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=dM(),r=dB(),o=dG(),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(e,r=!0){return"boolean"==typeof e||(!0===r?!function e(t){for(let r in t){if(i.has(r))return!0;let o=t[r];if(Array.isArray(o)&&o.some(e)||"object"==typeof o&&e(o))return!0}return!1}(e):!!r&&function e(r){let o=0;for(let i in r)if("$ref"===i||(o++,!a.has(i)&&("object"==typeof r[i]&&(0,t.eachItem)(r[i],t=>o+=e(t)),o===1/0)))return 1/0;return o}(e)<=r)};let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(e,t="",r){return!1!==r&&(t=c(t)),n(e,e.parse(t))}function n(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=s,e._getFullPath=n;let l=/#\/?$/;function c(e){return e?e.replace(l,""):""}e.normalizeId=c,e.resolveUrl=function(e,t,r){return r=c(r),e.resolve(t,r)};let u=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:a,uriResolver:i}=this.opts,n=c(e[a]||t),l={"":n},d=s(i,n,!1),p={},h=new Set;return o(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;let i=d+t,s=l[o];function n(t){let r=this.opts.uriResolver.resolve;if(t=c(s?r(s,t):t),h.has(t))throw m(t);h.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?f(e,o.schema,t):t!==c(i)&&("#"===t[0]?(f(e,p[t],t),p[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!u.test(e))throw Error(`invalid anchor "${e}"`);n.call(this,`#${e}`)}}"string"==typeof e[a]&&(s=n.call(this,e[a])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),l[t]=s}),p;function f(e,t,o){if(void 0!==t&&!r(e,t))throw m(o)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}}),dW=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=dL(),r=dV(),o=dU(),a=dV(),i=dF(),s=dK(),n=dJ(),l=dA(),c=dq(),u=dZ(),d=dM(),p=dz();function h({gen:e,validateName:t,schema:r,schemaEnv:o,opts:a},i){var s;a.code.es5?e.func(t,(0,l._)`${c.default.data}, ${c.default.valCxt}`,o.$async,()=>{var t,o;e.code((0,l._)`"use strict"; ${f(r,a)}`),t=e,o=a,t.if(c.default.valCxt,()=>{t.var(c.default.instancePath,(0,l._)`${c.default.valCxt}.${c.default.instancePath}`),t.var(c.default.parentData,(0,l._)`${c.default.valCxt}.${c.default.parentData}`),t.var(c.default.parentDataProperty,(0,l._)`${c.default.valCxt}.${c.default.parentDataProperty}`),t.var(c.default.rootData,(0,l._)`${c.default.valCxt}.${c.default.rootData}`),o.dynamicRef&&t.var(c.default.dynamicAnchors,(0,l._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{t.var(c.default.instancePath,(0,l._)`""`),t.var(c.default.parentData,(0,l._)`undefined`),t.var(c.default.parentDataProperty,(0,l._)`undefined`),t.var(c.default.rootData,c.default.data),o.dynamicRef&&t.var(c.default.dynamicAnchors,(0,l._)`{}`)}),e.code(i)}):e.func(t,(0,l._)`${c.default.data}, ${(s=a,(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${s.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`)}`,o.$async,()=>e.code(f(r,a)).code(i))}function f(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,l._)`/*# sourceURL=${r} */`:l.nil}function m({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function g(e){(0,d.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:o,self:a}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return _(e,[],!1,t);let o=(0,r.getSchemaTypes)(e.schema);_(e,o,!(0,r.coerceAndCheckDataType)(e,o),t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:o,opts:a}){let i=r.$comment;if(!0===a.$comment)e.code((0,l._)`${c.default.self}.logger.log(${i})`);else if("function"==typeof a.$comment){let r=(0,l.str)`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,l._)`${c.default.self}.opts.$comment(${i}, ${r}, ${a}.schema)`)}}function _(e,t,r,i){var s,n,u,p;let{gen:h,schema:f,data:m,allErrors:y,opts:g,self:v}=e,{RULES:b}=v;if(f.$ref&&(g.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(f,b)))return void h.block(()=>R(e,"$ref",b.all.$ref.definition));function _(s){(0,o.shouldUseGroup)(f,s)&&(s.type?(h.if((0,a.checkDataType)(s.type,m,g.strictNumbers)),S(e,s),1===t.length&&t[0]===s.type&&r&&(h.else(),(0,a.reportTypeError)(e)),h.endIf()):S(e,s),y||h.if((0,l._)`${c.default.errors} === ${i||0}`))}g.jtd||(s=e,n=t,!s.schemaEnv.meta&&s.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{$(e.dataTypes,t)||w(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let o of e.dataTypes)$(t,o)?r.push(o):t.includes("integer")&&"number"===o&&r.push("integer");e.dataTypes=r}(e,t)}}(s,n),s.opts.allowUnionTypes||(u=s,(p=n).length>1&&!(2===p.length&&p.includes("null"))&&w(u,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let a in r){let i=r[a];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){let{type:r}=i.definition;r.length&&!r.some(e=>{var r,o;return r=t,o=e,r.includes(o)||"number"===o&&r.includes("integer")})&&w(e,`missing type "${r.join(",")}" for keyword "${a}"`)}}}(s,s.dataTypes))),h.block(()=>{for(let e of b.rules)_(e);_(b.post)})}function S(e,t){let{gen:r,schema:a,opts:{useDefaults:s}}=e;s&&(0,i.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,o.shouldUseRule)(a,r)&&R(e,r.keyword,r.definition,t.type)})}function $(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function w(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}e.validateFunctionCode=function(e){y(e)&&(g(e),m(e))?function(e){let{schema:t,opts:r,gen:o}=e;h(e,()=>{r.$comment&&t.$comment&&b(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),o.let(c.default.vErrors,null),o.let(c.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,l._)`${r}.evaluated`),t.if((0,l._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,l._)`${e.evaluated}.props`,(0,l._)`undefined`)),t.if((0,l._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,l._)`${e.evaluated}.items`,(0,l._)`undefined`))}(e),v(e),function(e){let{gen:t,schemaEnv:r,validateName:o,ValidationError:a,opts:i}=e;r.$async?t.if((0,l._)`${c.default.errors} === 0`,()=>t.return(c.default.data),()=>t.throw((0,l._)`new ${a}(${c.default.vErrors})`)):(t.assign((0,l._)`${o}.errors`,c.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:o}){r instanceof l.Name&&e.assign((0,l._)`${t}.props`,r),o instanceof l.Name&&e.assign((0,l._)`${t}.items`,o)}(e),t.return((0,l._)`${c.default.errors} === 0`))}(e)})}(e):h(e,()=>(0,t.topBoolOrEmptySchema)(e))};var E=class{constructor(e,t,r){if((0,s.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",T(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,l._)`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=l.nil,t=l.nil){if(!this.$data)return;let{gen:r,schemaCode:o,schemaType:a,def:i}=this;r.if((0,l.or)((0,l._)`${o} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(a.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:o,it:i}=this;return(0,l.or)(function(){if(r.length){if(!(t instanceof l.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,l._)`${(0,a.checkDataTypes)(e,t,i.opts.strictNumbers,a.DataType.Wrong)}`}return l.nil}(),function(){if(o.validateSchema){let r=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,l._)`!${r}(${t})`}return l.nil}())}subschema(e,r){let o=(0,n.getSubschema)(this.it,e);(0,n.extendSubschemaData)(o,this.it,e),(0,n.extendSubschemaMode)(o,e);let a={...this.it,...o,items:void 0,props:void 0};return!function(e,r){if(y(e)&&(g(e),m(e)))return function(e,t){var r;let o,{schema:a,gen:i,opts:s}=e;s.$comment&&a.$comment&&b(e),(o=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,u.resolveUrl)(r.opts.uriResolver,r.baseId,o)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let n=i.const("_errs",c.default.errors);v(e,n),i.var(t,(0,l._)`${n} === ${c.default.errors}`)}(e,r);(0,t.boolOrEmptySchema)(e,r)}(a,r),a}mergeEvaluated(e,t){let{it:r,gen:o}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=d.mergeEvaluated.props(o,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=d.mergeEvaluated.items(o,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:o}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return o.if(t,()=>this.mergeEvaluated(e,l.Name)),!0}};function R(e,t,r,o){let a=new E(e,r,t);"code"in r?r.code(a,o):a.$data&&r.validate?(0,s.funcKeywordCode)(a,r):"macro"in r?(0,s.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,s.funcKeywordCode)(a,r)}e.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function T(e,{dataLevel:t,dataNames:r,dataPathArr:o}){let a,i;if(""===e)return c.default.rootData;if("/"===e[0]){if(!P.test(e))throw Error(`Invalid JSON-pointer: ${e}`);a=e,i=c.default.rootData}else{let s=k.exec(e);if(!s)throw Error(`Invalid JSON-pointer: ${e}`);let l=+s[1];if("#"===(a=s[2])){if(l>=t)throw Error(n("property/index",l));return o[t-l]}if(l>t)throw Error(n("data",l));if(i=r[t-l],!a)return i}let s=i;for(let e of a.split("/"))e&&(i=(0,l._)`${i}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=(0,l._)`${s} && ${i}`);return s;function n(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}e.getData=T}),dX=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}}),dY=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dZ();e.default=class extends Error{constructor(e,r,o,a){super(a||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,t.resolveUrl)(e,r,o),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}}),dQ=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=dA(),r=dX(),o=dq(),a=dZ(),i=dM(),s=dW();var n=class{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,a.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}};function l(e){let i,n,l=u.call(this,e);if(l)return l;let c=(0,a.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:d,lines:p}=this.opts.code,{ownProperties:h}=this.opts,f=new t.CodeGen(this.scope,{es5:d,lines:p,ownProperties:h});e.$async&&(i=f.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName("validate");e.validateName=m;let y={gen:f,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:c,baseId:e.baseId||c,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,s.validateFunctionCode)(y),f.optimize(this.opts.code.optimize);let r=f.toString();n=`${f.scopeRefs(o.default.scope)}return ${r}`,this.opts.code.process&&(n=this.opts.code.process(n,e));let a=Function(`${o.default.self}`,`${o.default.scope}`,n)(this,this.scope.get());if(this.scope.value(m,{ref:a}),a.errors=null,a.schema=e.schema,a.schemaEnv=e,e.$async&&(a.$async=!0),!0===this.opts.code.source&&(a.source={validateName:m,validateCode:r,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:r}=y;a.evaluated={props:e instanceof t.Name?void 0:e,items:r instanceof t.Name?void 0:r,dynamicProps:e instanceof t.Name,dynamicItems:r instanceof t.Name},a.source&&(a.source.evaluated=(0,t.stringify)(a.evaluated))}return e.validate=a,e}catch(t){throw delete e.validate,delete e.validateName,n&&this.logger.error("Error compiling schema, function code:",n),t}finally{this._compilations.delete(e)}}function c(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function u(e){for(let o of this._compilations){var t,r;if(t=o,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return o}}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){let r=this.opts.uriResolver.parse(t),o=(0,a._getFullPath)(this.opts.uriResolver,r),i=(0,a.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===i)return f.call(this,r,e);let s=(0,a.normalizeId)(o),c=this.refs[s]||this.schemas[s];if("string"==typeof c){let t=p.call(this,e,c);if("object"!=typeof(null==t?void 0:t.schema))return;return f.call(this,r,t)}if("object"==typeof(null==c?void 0:c.schema)){if(c.validate||l.call(this,c),s===(0,a.normalizeId)(t)){let{schema:t}=c,{schemaId:r}=this.opts,o=t[r];return o&&(i=(0,a.resolveUrl)(this.opts.uriResolver,i,o)),new n({schema:t,schemaId:r,root:e,baseId:i})}return f.call(this,r,c)}}e.SchemaEnv=n,e.compileSchema=l,e.resolveRef=function(e,t,r){var o;r=(0,a.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=d.call(this,e,r);if(void 0===s){let a=null==(o=e.localRefs)?void 0:o[r],{schemaId:i}=this.opts;a&&(s=new n({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==s)return e.refs[r]=c.call(this,s)},e.getCompilingSchema=u,e.resolveSchema=p;let h=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,{baseId:t,schema:r,root:o}){var s;let l;if((null==(s=e.fragment)?void 0:s[0])!=="/")return;for(let o of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,i.unescapeFragment)(o)];if(void 0===e)return;let s="object"==typeof(r=e)&&r[this.opts.schemaId];!h.has(o)&&s&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,s))}if("boolean"!=typeof r&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){let e=(0,a.resolveUrl)(this.opts.uriResolver,t,r.$ref);l=p.call(this,o,e)}let{schemaId:c}=this.opts;if((l=l||new n({schema:r,schemaId:c,root:o,baseId:t})).schema!==l.root.schema)return l}}),d0=cZ((e,t)=>{t.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}}),d1=cZ((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function a(e){let t="",r=0,o=0;for(o=0;o<e.length;o++)if(48!==(r=e[o].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(!((r=e[o].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o]}return t}function i(e){return e.length=0,!0}function s(e,t,r){if(e.length){let o=a(e);if(""===o)return r.error=!0,!1;t.push(o),e.length=0}return!0}function n(e){if(2>function(e,t){let r=0;for(let t=0;t<e.length;t++)":"===e[t]&&r++;return r}(e,":"))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},o=[],n=[],l=!1,c=!1,u=s;for(let a=0;a<e.length;a++){let s=e[a];if("["!==s&&"]"!==s)if(":"===s){if(!0===l&&(c=!0),!u(n,o,r))break;if(++t>7){r.error=!0;break}a>0&&":"===e[a-1]&&(l=!0),o.push(":");continue}else if("%"===s){if(!u(n,o,r))break;u=i}else{n.push(s);continue}}return n.length&&(u===i?r.zone=n.join(""):c?o.push(n.join("")):o.push(a(n))),r.address=o.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}t.exports={nonSimpleDomain:RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);if(!o(r)){let t=n(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){let r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e,r=[],o=-1,a=0;for(;a=t.length;){if(1===a)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===a){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===a&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(o=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,o)),t=t.slice(o)}return r.join("")},isIPv4:o,isUUID:r,normalizeIPv6:n,stringArrayToHexStripped:a}}),d2=cZ((e,t)=>{let{isUUID:r}=d1(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function i(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function s(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function n(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let l={scheme:"http",domainHost:!0,parse:s,serialize:n},c={scheme:"https",domainHost:l.domainHost,parse:s,serialize:n},u={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=i(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if((e.port===(i(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},d={scheme:"wss",domainHost:u.domainHost,parse:u.parse,serialize:u.serialize},p={http:l,https:c,ws:u,wss:d,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(o);if(r){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=h(`${o}:${t.nid||e.nid}`);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),a=h(`${r}:${t.nid||o}`);a&&(e=a.serialize(e,t));let i=e,s=e.nss;return i.path=`${o||t.nid}:${s}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&r(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function h(e){return e&&(p[e]||p[e.toLowerCase()])||void 0}Object.setPrototypeOf(p,null),t.exports={wsIsSecure:i,SCHEMES:p,isValidSchemeName:function(e){return -1!==a.indexOf(e)},getSchemeHandler:h}}),d9=cZ((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:a,normalizeComponentEncoding:i,isIPv4:s,nonSimpleDomain:n}=d1(),{SCHEMES:l,getSchemeHandler:c}=d2();function u(e,t,r,a){let i={};return a||(e=h(d(e,r),r),t=h(d(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=o(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function d(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),s=[],n=c(i.scheme||r.scheme);n&&n.serialize&&n.serialize(r,i),void 0!==r.path&&(i.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==i.reference&&r.scheme&&s.push(r.scheme,":");let l=a(r);if(void 0!==l&&("suffix"!==i.reference&&s.push("//"),s.push(l),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;i.absolutePath||n&&n.absolutePath||(e=o(e)),void 0===l&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}let p=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(e,t){let o=Object.assign({},t),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;"suffix"===o.reference&&(e=o.scheme?o.scheme+":"+e:"//"+e);let l=e.match(p);if(l){if(a.scheme=l[1],a.userinfo=l[3],a.host=l[4],a.port=parseInt(l[5],10),a.path=l[6]||"",a.query=l[7],a.fragment=l[8],isNaN(a.port)&&(a.port=l[5]),a.host)if(!1===s(a.host)){let e=r(a.host);a.host=e.host.toLowerCase(),i=e.isIPV6}else i=!0;void 0!==a.scheme||void 0!==a.userinfo||void 0!==a.host||void 0!==a.port||void 0!==a.query||a.path?void 0===a.scheme?a.reference="relative":void 0===a.fragment?a.reference="absolute":a.reference="uri":a.reference="same-document",o.reference&&"suffix"!==o.reference&&o.reference!==a.reference&&(a.error=a.error||"URI is not a "+o.reference+" reference.");let t=c(o.scheme||a.scheme);if(!o.unicodeSupport&&(!t||!t.unicodeSupport)&&a.host&&(o.domainHost||t&&t.domainHost)&&!1===i&&n(a.host))try{a.host=URL.domainToASCII(a.host.toLowerCase())}catch(e){a.error=a.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==a.scheme&&(a.scheme=unescape(a.scheme)),void 0!==a.host&&(a.host=unescape(a.host))),a.path&&(a.path=escape(unescape(a.path))),a.fragment&&(a.fragment=encodeURI(decodeURIComponent(a.fragment)))),t&&t.parse&&t.parse(a,o)}else a.error=a.error||"URI can not be parsed.";return a}let f={SCHEMES:l,normalize:function(e,t){return"string"==typeof e?e=d(h(e,t),t):"object"==typeof e&&(e=h(d(e,t),t)),e},resolve:function(e,t,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},a=u(h(e,o),h(t,o),o,!0);return o.skipEscape=!0,d(a,o)},resolveComponent:u,equal:function(e,t,r){return"string"==typeof e?e=d(i(h(e=unescape(e),r),!0),{...r,skipEscape:!0}):"object"==typeof e&&(e=d(i(e,!0),{...r,skipEscape:!0})),"string"==typeof t?t=d(i(h(t=unescape(t),r),!0),{...r,skipEscape:!0}):"object"==typeof t&&(t=d(i(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:d,parse:h};t.exports=f,t.exports.default=f,t.exports.fastUri=f}),d4=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d9();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),d5=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=dW();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=dA();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=dX(),a=dY(),i=dD(),s=dQ(),n=dA(),l=dZ(),c=dV(),u=dM(),d=d0(),p=d4(),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={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."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var v=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...function(e){var t,r,o,a,i,s,n,l,c,u,d,f,m,y,g,v,b,_,S,$,w,E,R,P,k;let T=e.strict,O=null==(t=e.code)?void 0:t.optimize,x=!0===O||void 0===O?1:O||0,j=null!=(o=null==(r=e.code)?void 0:r.regExp)?o:h,C=null!=(a=e.uriResolver)?a:p.default;return{strictSchema:null==(s=null!=(i=e.strictSchema)?i:T)||s,strictNumbers:null==(l=null!=(n=e.strictNumbers)?n:T)||l,strictTypes:null!=(u=null!=(c=e.strictTypes)?c:T)?u:"log",strictTuples:null!=(f=null!=(d=e.strictTuples)?d:T)?f:"log",strictRequired:null!=(y=null!=(m=e.strictRequired)?m:T)&&y,code:e.code?{...e.code,optimize:x,regExp:j}:{optimize:x,regExp:j},loopRequired:null!=(g=e.loopRequired)?g:200,loopEnum:null!=(v=e.loopEnum)?v:200,meta:null==(b=e.meta)||b,messages:null==(_=e.messages)||_,inlineRefs:null==(S=e.inlineRefs)||S,schemaId:null!=($=e.schemaId)?$:"$id",addUsedSchema:null==(w=e.addUsedSchema)||w,validateSchema:null==(E=e.validateSchema)||E,validateFormats:null==(R=e.validateFormats)||R,unicodeRegExp:null==(P=e.unicodeRegExp)||P,int32range:null==(k=e.int32range)||k,uriResolver:C}}(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new n.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return R;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);const o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),b.call(this,y,e,"NOT SUPPORTED"),b.call(this,g,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&w.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,o=d;"id"===r&&((o={...d}).id=o.$id,delete o.$id),t&&e&&this.addMetaSchema(o,o[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let o=r(t);return"$async"in r||(this.errors=r.errors),o}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return o.call(this,e,t);async function o(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return n.call(this,t),await l.call(this,t.missingSchema),s.call(this,e)}}function n({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){let r=await c.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,o=this.opts.validateSchema){let a;if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,o);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(a=e[t])&&"string"!=typeof a)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||a),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,o,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(r,e);if(!o&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return o}getSchema(e){let t;for(;"string"==typeof(t=_.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,o=new s.SchemaEnv({schema:{},schemaId:r});if(!(t=s.resolveSchema.call(this,o,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=_.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,l.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(k.call(this,r,t),!t)return(0,u.eachItem)(r,e=>T.call(this,e)),this;x.call(this,t);let o={...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===o.type.length?e=>T.call(this,e,o):e=>o.type.forEach(t=>T.call(this,e,o,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let o of(e=JSON.parse(JSON.stringify(e)),t)){let t=o.split("/").slice(1),a=e;for(let e of t)a=a[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:o}=t.definition,i=a[e];o&&i&&(a[e]=C(i))}}return e}_removeAllSchemas(e,t){for(let r in e){let o=e[r];(!t||t.test(r))&&("string"==typeof o?delete e[r]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[r]))}}_addSchema(e,t,r,o=this.opts.validateSchema,a=this.opts.addUsedSchema){let i,{schemaId:n}=this.opts;if("object"==typeof e)i=e[n];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let c=this._cache.get(e);if(void 0!==c)return c;r=(0,l.normalizeId)(i||r);let u=l.getSchemaRefs.call(this,e,r);return c=new s.SchemaEnv({schema:e,schemaId:n,meta:t,baseId:r,localRefs:u}),this._cache.set(c.schema,c),a&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};function b(e,t,r,o="error"){for(let a in e)a in t&&this.logger[o](`${r}: option ${a}. ${e[a]}`)}function _(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){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 $(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function E(){let e={...this.opts};for(let t of f)delete e[t];return e}v.ValidationError=o.default,v.MissingRefError=a.default,e.default=v;let R={log(){},warn(){},error(){}},P=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:r}=this;if((0,u.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!P.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function T(e,t,r){var o;let a=null==t?void 0:t.post;if(r&&a)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=a?i.post:i.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let n={keyword:e,definition:{...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)}};t.before?O.call(this,s,n,t.before):s.rules.push(n),i.all[e]=n,null==(o=t.implements)||o.forEach(e=>this.addKeyword(e))}function O(e,t,r){let o=e.rules.findIndex(e=>e.keyword===r);o>=0?e.rules.splice(o,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function x(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}let j={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,j]}}}),d3=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),d6=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=dY(),r=dH(),o=dA(),a=dq(),i=dQ(),s=dM();function n(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,o._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function l(e,t,i,n){let{gen:l,it:c}=e,{allErrors:u,schemaEnv:d,opts:p}=c,h=p.passContext?a.default.this:o.nil;function f(e){let t=(0,o._)`${e}.errors`;l.assign(a.default.vErrors,(0,o._)`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`),l.assign(a.default.errors,(0,o._)`${a.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;let r=null==(t=null==i?void 0:i.validate)?void 0:t.evaluated;if(!0!==c.props)if(r&&!r.dynamicProps)void 0!==r.props&&(c.props=s.mergeEvaluated.props(l,r.props,c.props));else{let t=l.var("props",(0,o._)`${e}.evaluated.props`);c.props=s.mergeEvaluated.props(l,t,c.props,o.Name)}if(!0!==c.items)if(r&&!r.dynamicItems)void 0!==r.items&&(c.items=s.mergeEvaluated.items(l,r.items,c.items));else{let t=l.var("items",(0,o._)`${e}.evaluated.items`);c.items=s.mergeEvaluated.items(l,t,c.items,o.Name)}}n?function(){if(!d.$async)throw Error("async schema referenced by sync schema");let a=l.let("valid");l.try(()=>{l.code((0,o._)`await ${(0,r.callValidateCode)(e,t,h)}`),m(t),u||l.assign(a,!0)},e=>{l.if((0,o._)`!(${e} instanceof ${c.ValidationError})`,()=>l.throw(e)),f(e),u||l.assign(a,!1)}),e.ok(a)}():e.result((0,r.callValidateCode)(e,t,h),()=>m(t),()=>f(t))}e.getValidate=n,e.callRef=l,e.default={keyword:"$ref",schemaType:"string",code(e){var r,a;let s,c,u,{gen:d,schema:p,it:h}=e,{baseId:f,schemaEnv:m,validateName:y,opts:g,self:v}=h,{root:b}=m;if(("#"===p||"#/"===p)&&f===b.baseId){if(m===b)return l(e,y,m,m.$async);let t=d.scopeValue("root",{ref:b});return l(e,(0,o._)`${t}.validate`,b,b.$async)}let _=i.resolveRef.call(v,b,f,p);if(void 0===_)throw new t.default(h.opts.uriResolver,f,p);return _ instanceof i.SchemaEnv?void l(e,n(e,r=_),r,r.$async):(a=_,s=d.scopeValue("schema",!0===g.code.source?{ref:a,code:(0,o.stringify)(a)}:{ref:a}),c=d.name("valid"),u=e.subschema({schema:a,dataTypes:[],schemaPath:o.nil,topSchemaRef:s,errSchemaPath:p},c),void(e.mergeEvaluated(u),e.ok(c)))}}}),d8=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d3(),r=d6();e.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default]}),d7=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}};e.default={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must be ${o[e].okStr} ${r}`,params:({keyword:e,schemaCode:r})=>(0,t._)`{comparison: ${o[e].okStr}, limit: ${r}}`},code(e){let{keyword:r,data:a,schemaCode:i}=e;e.fail$data((0,t._)`${a} ${o[r].fail} ${i} || isNaN(${a})`)}}}),pe=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA();e.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:r,data:o,schemaCode:a,it:i}=e,s=i.opts.multipleOfPrecision,n=r.let("res"),l=s?(0,t._)`Math.abs(Math.round(${n}) - ${n}) > 1e-${s}`:(0,t._)`${n} !== parseInt(${n})`;e.fail$data((0,t._)`(${a} === 0 || (${n} = ${o}/${a}, ${l}))`)}}}),pt=cZ(e=>{function t(e){let t,r=e.length,o=0,a=0;for(;a<r;)o++,(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<r&&(64512&(t=e.charCodeAt(a)))==56320&&a++;return o}Object.defineProperty(e,"__esModule",{value:!0}),e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),pr=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM(),o=pt();e.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${r} characters`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:a,data:i,schemaCode:s,it:n}=e,l="maxLength"===a?t.operators.GT:t.operators.LT,c=!1===n.opts.unicode?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(e.gen,o.default)}(${i})`;e.fail$data((0,t._)`${c} ${l} ${s}`)}}}),po=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dH(),r=dM(),o=dA();e.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,o.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,o._)`{pattern: ${e}}`},code(e){let{gen:a,data:i,$data:s,schema:n,schemaCode:l,it:c}=e,u=c.opts.unicodeRegExp?"u":"";if(s){let{regExp:t}=c.opts.code,s="new RegExp"===t.code?(0,o._)`new RegExp`:(0,r.useFunc)(a,t),n=a.let("valid");a.try(()=>a.assign(n,(0,o._)`${s}(${l}, ${u}).test(${i})`),()=>a.assign(n,!1)),e.fail$data((0,o._)`!${n}`)}else{let r=(0,t.usePattern)(e,n);e.fail$data((0,o._)`!${r}.test(${i})`)}}}}),pa=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA();e.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${r} properties`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:r,data:o,schemaCode:a}=e,i="maxProperties"===r?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${o}).length ${i} ${a}`)}}}),pi=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dH(),r=dA(),o=dM();e.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,r.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,r._)`{missingProperty: ${e}}`},code(e){let{gen:a,schema:i,schemaCode:s,data:n,$data:l,it:c}=e,{opts:u}=c;if(!l&&0===i.length)return;let d=i.length>=u.loopRequired;if(c.allErrors?function(){if(d||l)e.block$data(r.nil,p);else for(let r of i)(0,t.checkReportMissingProp)(e,r)}():function(){let o=a.let("missing");if(d||l){let i=a.let("valid",!0);e.block$data(i,()=>{var l,c;return l=o,c=i,void(e.setParams({missingProperty:l}),a.forOf(l,s,()=>{a.assign(c,(0,t.propertyInData)(a,n,l,u.ownProperties)),a.if((0,r.not)(c),()=>{e.error(),a.break()})},r.nil))}),e.ok(i)}else a.if((0,t.checkMissingProp)(e,i,o)),(0,t.reportMissingProp)(e,o),a.else()}(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:r}=e.it;for(let e of i)if((null==t?void 0:t[e])===void 0&&!r.has(e)){let t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(c,t,c.opts.strictRequired)}}function p(){a.forOf("prop",s,r=>{e.setParams({missingProperty:r}),a.if((0,t.noPropertyInData)(a,n,r,u.ownProperties),()=>e.error())})}}}}),ps=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA();e.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${r} items`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:r,data:o,schemaCode:a}=e,i="maxItems"===r?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${o}.length ${i} ${a}`)}}}),pn=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dB();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),pl=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dA(),o=dM(),a=pn();e.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,r.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,r._)`{i: ${e}, j: ${t}}`},code(e){let{gen:i,data:s,$data:n,schema:l,parentSchema:c,schemaCode:u,it:d}=e;if(!n&&!l)return;let p=i.let("valid"),h=c.items?(0,t.getSchemaTypes)(c.items):[];e.block$data(p,function(){let n=i.let("i",(0,r._)`${s}.length`),l=i.let("j");e.setParams({i:n,j:l}),i.assign(p,!0),i.if((0,r._)`${n} > 1`,()=>(h.length>0&&!h.some(e=>"object"===e||"array"===e)?function(o,a){let n=i.name("item"),l=(0,t.checkDataTypes)(h,n,d.opts.strictNumbers,t.DataType.Wrong),c=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${o}--;`,()=>{i.let(n,(0,r._)`${s}[${o}]`),i.if(l,(0,r._)`continue`),h.length>1&&i.if((0,r._)`typeof ${n} == "string"`,(0,r._)`${n} += "_"`),i.if((0,r._)`typeof ${c}[${n}] == "number"`,()=>{i.assign(a,(0,r._)`${c}[${n}]`),e.error(),i.assign(p,!1).break()}).code((0,r._)`${c}[${n}] = ${o}`)})}:function(t,n){let l=(0,o.useFunc)(i,a.default),c=i.name("outer");i.label(c).for((0,r._)`;${t}--;`,()=>i.for((0,r._)`${n} = ${t}; ${n}--;`,()=>i.if((0,r._)`${l}(${s}[${t}], ${s}[${n}])`,()=>{e.error(),i.assign(p,!1).break(c)})))})(n,l))},(0,r._)`${u} === false`),e.ok(p)}}}),pc=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM(),o=pn();e.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:a,data:i,$data:s,schemaCode:n,schema:l}=e;s||l&&"object"==typeof l?e.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${n})`):e.fail((0,t._)`${l} !== ${i}`)}}}),pu=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM(),o=pn();e.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let a,i,{gen:s,data:n,$data:l,schema:c,schemaCode:u,it:d}=e;if(!l&&0===c.length)throw Error("enum must have non-empty array");let p=c.length>=d.opts.loopEnum,h=()=>null!=a?a:a=(0,r.useFunc)(s,o.default);if(p||l)i=s.let("valid"),e.block$data(i,function(){s.assign(i,!1),s.forOf("v",u,e=>s.if((0,t._)`${h()}(${n}, ${e})`,()=>s.assign(i,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=s.const("vSchema",u);i=(0,t.or)(...c.map((r,o)=>{var a,i;let s;return a=e,"object"==typeof(s=c[i=o])&&null!==s?(0,t._)`${h()}(${n}, ${a}[${i}])`:(0,t._)`${n} === ${s}`}))}e.pass(i)}}}),pd=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d7(),r=pe(),o=pr(),a=po(),i=pa(),s=pi(),n=ps(),l=pl(),c=pc(),u=pu();e.default=[t.default,r.default,o.default,a.default,i.default,s.default,n.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default]}),pp=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=dA(),r=dM();function o(e,o){let{gen:a,schema:i,data:s,keyword:n,it:l}=e;l.items=!0;let c=a.const("len",(0,t._)`${s}.length`);if(!1===i)e.setParams({len:o.length}),e.pass((0,t._)`${c} <= ${o.length}`);else if("object"==typeof i&&!(0,r.alwaysValidSchema)(l,i)){let i=a.var("valid",(0,t._)`${c} <= ${o.length}`);a.if((0,t.not)(i),()=>{var s;return s=i,void a.forRange("i",o.length,c,o=>{e.subschema({keyword:n,dataProp:o,dataPropType:r.Type.Num},s),l.allErrors||a.if((0,t.not)(s),()=>a.break())})}),e.ok(i)}}e.validateAdditionalItems=o,e.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:a}=e,{items:i}=t;Array.isArray(i)?o(e,i):(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas')}}}),ph=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=dA(),r=dM(),o=dH();function a(e,o,i=e.schema){let{gen:s,parentSchema:n,data:l,keyword:c,it:u}=e;(function(e){let{opts:t,errSchemaPath:a}=u,s=i.length,n=s===e.minItems&&(s===e.maxItems||!1===e[o]);if(t.strictTuples&&!n){let e=`"${c}" is ${s}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,r.checkStrictMode)(u,e,t.strictTuples)}})(n),u.opts.unevaluated&&i.length&&!0!==u.items&&(u.items=r.mergeEvaluated.items(s,i.length,u.items));let d=s.name("valid"),p=s.const("len",(0,t._)`${l}.length`);i.forEach((o,a)=>{(0,r.alwaysValidSchema)(u,o)||(s.if((0,t._)`${p} > ${a}`,()=>e.subschema({keyword:c,schemaProp:a,dataProp:a},d)),e.ok(d))})}e.validateTuple=a,e.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,"additionalItems",t);i.items=!0,(0,r.alwaysValidSchema)(i,t)||e.ok((0,o.validateArray)(e))}}}),pf=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ph();e.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")}}),pm=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM(),o=dH(),a=pp();e.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:i,it:s}=e,{prefixItems:n}=i;s.items=!0,(0,r.alwaysValidSchema)(s,t)||(n?(0,a.validateAdditionalItems)(e,n):e.ok((0,o.validateArray)(e)))}}}),py=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM();e.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:r}})=>void 0===r?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${r} valid item(s)`,params:({params:{min:e,max:r}})=>void 0===r?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${r}}`},code(e){let o,a,{gen:i,schema:s,parentSchema:n,data:l,it:c}=e,{minContains:u,maxContains:d}=n;c.opts.next?(o=void 0===u?1:u,a=d):o=1;let p=i.const("len",(0,t._)`${l}.length`);if(e.setParams({min:o,max:a}),void 0===a&&0===o)return void(0,r.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==a&&o>a){(0,r.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,r.alwaysValidSchema)(c,s)){let r=(0,t._)`${p} >= ${o}`;void 0!==a&&(r=(0,t._)`${r} && ${p} <= ${a}`),e.pass(r);return}c.items=!0;let h=i.name("valid");function f(){let e=i.name("_valid"),r=i.let("count",0);m(e,()=>i.if(e,()=>{var e;return e=r,void(i.code((0,t._)`${e}++`),void 0===a?i.if((0,t._)`${e} >= ${o}`,()=>i.assign(h,!0).break()):(i.if((0,t._)`${e} > ${a}`,()=>i.assign(h,!1).break()),1===o?i.assign(h,!0):i.if((0,t._)`${e} >= ${o}`,()=>i.assign(h,!0))))}))}function m(t,o){i.forRange("i",0,p,a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:r.Type.Num,compositeRule:!0},t),o()})}void 0===a&&1===o?m(h,()=>i.if(h,()=>i.break())):0===o?(i.let(h,!0),void 0!==a&&i.if((0,t._)`${l}.length > 0`,f)):(i.let(h,!1),f()),e.result(h,()=>e.reset())}}}),pg=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=dA(),r=dM(),o=dH();e.error={message:({params:{property:e,depsCount:r,deps:o}})=>(0,t.str)`must have ${1===r?"property":"properties"} ${o} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:o,missingProperty:a}})=>(0,t._)`{property: ${e},
72
+ missingProperty: ${a},
73
+ depsCount: ${r},
74
+ deps: ${o}}`};let a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let o in e)"__proto__"!==o&&((Array.isArray(e[o])?t:r)[o]=e[o]);return[t,r]}(e);i(e,t),s(e,r)}};function i(e,r=e.schema){let{gen:a,data:s,it:n}=e;if(0===Object.keys(r).length)return;let l=a.let("missing");for(let i in r){let c=r[i];if(0===c.length)continue;let u=(0,o.propertyInData)(a,s,i,n.opts.ownProperties);e.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),n.allErrors?a.if(u,()=>{for(let t of c)(0,o.checkReportMissingProp)(e,t)}):(a.if((0,t._)`${u} && (${(0,o.checkMissingProp)(e,c,l)})`),(0,o.reportMissingProp)(e,l),a.else())}}function s(e,t=e.schema){let{gen:a,data:i,keyword:n,it:l}=e,c=a.name("valid");for(let s in t)(0,r.alwaysValidSchema)(l,t[s])||(a.if((0,o.propertyInData)(a,i,s,l.opts.ownProperties),()=>{let t=e.subschema({keyword:n,schemaProp:s},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=s,e.default=a}),pv=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM();e.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:o,schema:a,data:i,it:s}=e;if((0,r.alwaysValidSchema)(s,a))return;let n=o.name("valid");o.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},n),o.if((0,t.not)(n),()=>{e.error(!0),s.allErrors||o.break()})}),e.ok(n)}}}),pb=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dH(),r=dA(),o=dq(),a=dM();e.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,r._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:i,schema:s,parentSchema:n,data:l,errsCount:c,it:u}=e;if(!c)throw Error("ajv implementation error");let{allErrors:d,opts:p}=u;if(u.props=!0,"all"!==p.removeAdditional&&(0,a.alwaysValidSchema)(u,s))return;let h=(0,t.allSchemaProperties)(n.properties),f=(0,t.allSchemaProperties)(n.patternProperties);function m(e){i.code((0,r._)`delete ${l}[${e}]`)}function y(t){if("all"===p.removeAdditional||p.removeAdditional&&!1===s)return void m(t);if(!1===s){e.setParams({additionalProperty:t}),e.error(),d||i.break();return}if("object"==typeof s&&!(0,a.alwaysValidSchema)(u,s)){let o=i.name("valid");"failing"===p.removeAdditional?(g(t,o,!1),i.if((0,r.not)(o),()=>{e.reset(),m(t)})):(g(t,o),d||i.if((0,r.not)(o),()=>i.break()))}}function g(t,r,o){let i={keyword:"additionalProperties",dataProp:t,dataPropType:a.Type.Str};!1===o&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}i.forIn("key",l,o=>{h.length||f.length?i.if(function(o){let s;if(h.length>8){let e=(0,a.schemaRefOrVal)(u,n.properties,"properties");s=(0,t.isOwnProperty)(i,e,o)}else s=h.length?(0,r.or)(...h.map(e=>(0,r._)`${o} === ${e}`)):r.nil;return f.length&&(s=(0,r.or)(s,...f.map(a=>(0,r._)`${(0,t.usePattern)(e,a)}.test(${o})`))),(0,r.not)(s)}(o),()=>y(o)):y(o)}),e.ok((0,r._)`${c} === ${o.default.errors}`)}}}),p_=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dW(),r=dH(),o=dM(),a=pb();e.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:i,schema:s,parentSchema:n,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===n.additionalProperties&&a.default.code(new t.KeywordCxt(c,a.default,"additionalProperties"));let u=(0,r.allSchemaProperties)(s);for(let e of u)c.definedProperties.add(e);c.opts.unevaluated&&u.length&&!0!==c.props&&(c.props=o.mergeEvaluated.props(i,(0,o.toHash)(u),c.props));let d=u.filter(e=>!(0,o.alwaysValidSchema)(c,s[e]));if(0===d.length)return;let p=i.name("valid");for(let t of d){var h;(h=t,c.opts.useDefaults&&!c.compositeRule&&void 0!==s[h].default)?f(t):(i.if((0,r.propertyInData)(i,l,t,c.opts.ownProperties)),f(t),c.allErrors||i.else().var(p,!0),i.endIf()),e.it.definedProperties.add(t),e.ok(p)}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}}),pS=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dH(),r=dA(),o=dM(),a=dM();e.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:i,schema:s,data:n,parentSchema:l,it:c}=e,{opts:u}=c,d=(0,t.allSchemaProperties)(s),p=d.filter(e=>(0,o.alwaysValidSchema)(c,s[e]));if(0===d.length||p.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let h=u.strictSchema&&!u.allowMatchingProperties&&l.properties,f=i.name("valid");!0===c.props||c.props instanceof r.Name||(c.props=(0,a.evaluatedPropsToName)(i,c.props));let{props:m}=c;for(let e of d)h&&function(e){for(let t in h)new RegExp(e).test(t)&&(0,o.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?y(e):(i.var(f,!0),y(e),i.if(f));function y(o){i.forIn("key",n,s=>{i.if((0,r._)`${(0,t.usePattern)(e,o)}.test(${s})`,()=>{let t=p.includes(o);t||e.subschema({keyword:"patternProperties",schemaProp:o,dataProp:s,dataPropType:a.Type.Str},f),c.opts.unevaluated&&!0!==m?i.assign((0,r._)`${m}[${s}]`,!0):t||c.allErrors||i.if((0,r.not)(f),()=>i.break())})})}}}}),p$=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dM();e.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:r,schema:o,it:a}=e;if((0,t.alwaysValidSchema)(a,o))return void e.fail();let i=r.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}}),pw=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:dH().validateUnion,error:{message:"must match a schema in anyOf"}}}),pE=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM();e.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:o,schema:a,parentSchema:i,it:s}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;let n=o.let("valid",!1),l=o.let("passing",null),c=o.name("_valid");e.setParams({passing:l}),o.block(function(){a.forEach((a,i)=>{let u;(0,r.alwaysValidSchema)(s,a)?o.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},c),i>0&&o.if((0,t._)`${c} && ${n}`).assign(n,!1).assign(l,(0,t._)`[${l}, ${i}]`).else(),o.if(c,()=>{o.assign(n,!0),o.assign(l,i),u&&e.mergeEvaluated(u,t.Name)})})}),e.result(n,()=>e.reset(),()=>e.error(!0))}}}),pR=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dM();e.default={keyword:"allOf",schemaType:"array",code(e){let{gen:r,schema:o,it:a}=e;if(!Array.isArray(o))throw Error("ajv implementation error");let i=r.name("valid");o.forEach((r,o)=>{if((0,t.alwaysValidSchema)(a,r))return;let s=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(s)})}}}),pP=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM();function o(e,t){let o=e.schema[t];return void 0!==o&&!(0,r.alwaysValidSchema)(e,o)}e.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let a,{gen:i,parentSchema:s,it:n}=e;void 0===s.then&&void 0===s.else&&(0,r.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let l=o(n,"then"),c=o(n,"else");if(!l&&!c)return;let u=i.let("valid",!0),d=i.name("_valid");if(a=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.mergeEvaluated(a),e.reset(),l&&c){let t=i.let("ifClause");e.setParams({ifClause:t}),i.if(d,p("then",t),p("else",t))}else l?i.if(d,p("then")):i.if((0,t.not)(d),p("else"));function p(r,o){return()=>{let a=e.subschema({keyword:r},d);i.assign(u,d),e.mergeValidEvaluated(a,u),o?i.assign(o,(0,t._)`${r}`):e.setParams({ifClause:r})}}e.pass(u,()=>e.error(!0))}}}),pk=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dM();e.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:r,it:o}){void 0===r.if&&(0,t.checkStrictMode)(o,`"${e}" without "if" is ignored`)}}}),pT=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pp(),r=pf(),o=ph(),a=pm(),i=py(),s=pg(),n=pv(),l=pb(),c=p_(),u=pS(),d=p$(),p=pw(),h=pE(),f=pR(),m=pP(),y=pk();e.default=function(e=!1){let g=[d.default,p.default,h.default,f.default,m.default,y.default,n.default,l.default,s.default,c.default,u.default];return e?g.push(r.default,a.default):g.push(t.default,o.default),g.push(i.default),g}}),pO=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA();e.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,r){let o,a,i,s,n,l,{gen:c,data:u,$data:d,schema:p,schemaCode:h,it:f}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=f;m.validateFormats&&(d?(o=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,t._)`${o}[${h}]`),i=c.let("fType"),s=c.let("format"),c.if((0,t._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(i,(0,t._)`${a}.type || "string"`).assign(s,(0,t._)`${a}.validate`),()=>c.assign(i,(0,t._)`"string"`).assign(s,a)),e.fail$data((0,t.or)(!1===m.strictSchema?t.nil:(0,t._)`${h} && !${s}`,(n=g.$async?(0,t._)`(${a}.async ? await ${s}(${u}) : ${s}(${u}))`:(0,t._)`${s}(${u})`,l=(0,t._)`(typeof ${s} == "function" ? ${n} : ${s}.test(${u}))`,(0,t._)`${s} && ${s} !== true && ${i} === ${r} && !${l}`)))):function(){var o;let a,i,s=v.formats[p];if(!s){if(!1===m.strictSchema)return v.logger.warn(n());throw Error(n());function n(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===s)return;let[l,d,h]=(a=(o=s)instanceof RegExp?(0,t.regexpCode)(o):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(p)}`:void 0,i=c.scopeValue("formats",{key:p,ref:o,code:a}),"object"!=typeof o||o instanceof RegExp?["string",o,i]:[o.type||"string",o.validate,(0,t._)`${i}.validate`]);l===r&&e.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!g.$async)throw Error("async format in sync schema");return(0,t._)`await ${h}(${u})`}return"function"==typeof d?(0,t._)`${h}(${u})`:(0,t._)`${h}.test(${u})`}())}())}}}),px=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[pO().default]}),pj=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),pC=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d8(),r=pd(),o=pT(),a=px(),i=pj();e.default=[t.default,r.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary]}),pN=cZ(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(r=t||(e.DiscrError=t={})).Tag="tag",r.Mapping="mapping"}),pI=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=pN(),o=dQ(),a=dY(),i=dM();e.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===r.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:r,tagName:o}})=>(0,t._)`{error: ${e}, tag: ${o}, tagValue: ${r}}`},code(e){let{gen:s,data:n,schema:l,parentSchema:c,it:u}=e,{oneOf:d}=c;if(!u.opts.discriminator)throw Error("discriminator: requires discriminator option");let p=l.propertyName;if("string"!=typeof p)throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!d)throw Error("discriminator: requires oneOf keyword");let h=s.let("valid",!1),f=s.const("tag",(0,t._)`${n}${(0,t.getProperty)(p)}`);s.if((0,t._)`typeof ${f} == "string"`,()=>(function(){let n=function(){var e;let t={},r=n(c),s=!0;for(let t=0;t<d.length;t++){let c=d[t];if((null==c?void 0:c.$ref)&&!(0,i.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if((c=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e))instanceof o.SchemaEnv&&(c=c.schema),void 0===c)throw new a.default(u.opts.uriResolver,u.baseId,e)}let h=null==(e=null==c?void 0:c.properties)?void 0:e[p];if("object"!=typeof h)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);s=s&&(r||n(c)),function(e,t){if(e.const)l(e.const,t);else if(e.enum)for(let r of e.enum)l(r,t);else throw Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}(h,t)}if(!s)throw Error(`discriminator: "${p}" must be required`);return t;function n({required:e}){return Array.isArray(e)&&e.includes(p)}function l(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${p}" values must be unique strings`);t[e]=r}}();for(let r in s.if(!1),n)s.elseIf((0,t._)`${f} === ${r}`),s.assign(h,function(r){let o=s.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(a,t.Name),o}(n[r]));s.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:f,tagName:p}),s.endIf()})(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:f,tagName:p})),e.ok(h)}}}),pA=cZ((e,t)=>{t.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}}),pM=cZ((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=d5(),o=pC(),a=pI(),i=pA(),s=["/properties"],n="http://json-schema.org/draft-07/schema";var l=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(e,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=dW();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=dA();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=dX();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=dY();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),pq=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=dA(),r=dq(),o=dQ(),a=d6();function i(e,i){let{gen:s,it:n}=e;n.schemaEnv.root.dynamicAnchors[i]=!0;let l=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(i)}`,c="#"===n.errSchemaPath?n.validateName:function(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:s,baseId:n,localRefs:l,meta:c}=t.root,{schemaId:u}=i.opts,d=new o.SchemaEnv({schema:r,schemaId:u,root:s,baseId:n,localRefs:l,meta:c});return o.compileSchema.call(i,d),(0,a.getValidate)(e,d)}(e);s.if((0,t._)`!${l}`,()=>s.assign(l,c))}e.dynamicAnchor=i,e.default={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)}}),pz=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=dA(),r=dq(),o=d6();function a(e,a){let{gen:i,keyword:s,it:n}=e;if("#"!==a[0])throw Error(`"${s}" only supports hash fragment reference`);let l=a.slice(1);if(n.allErrors)c();else{let t=i.let("valid",!1);c(t),e.ok(t)}function c(e){if(n.schemaEnv.root.dynamicAnchors[l]){let o=i.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(l)}`);i.if(o,u(o,e),u(n.validateName,e))}else u(n.validateName,e)()}function u(t,r){return r?()=>i.block(()=>{(0,o.callRef)(e,t),i.let(r,!0)}):()=>(0,o.callRef)(e,t)}}e.dynamicRef=a,e.default={keyword:"$dynamicRef",schemaType:"string",code:e=>a(e,e.schema)}}),pL=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pq(),r=dM();e.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,t.dynamicAnchor)(e,""):(0,r.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}}),pD=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pz();e.default={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,t.dynamicRef)(e,e.schema)}}),pU=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pq(),r=pz(),o=pL(),a=pD();e.default=[t.default,r.default,o.default,a.default]}),pV=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pg();e.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}}),pF=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pg();e.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,t.validateSchemaDeps)(e)}}),pH=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dM();e.default={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:r,it:o}){void 0===r.contains&&(0,t.checkStrictMode)(o,`"${e}" without "contains" is ignored`)}}}),pK=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pV(),r=pF(),o=pH();e.default=[t.default,r.default,o.default]}),pJ=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM(),o=dq();e.default={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:a,schema:i,data:s,errsCount:n,it:l}=e;if(!n)throw Error("ajv implementation error");let{allErrors:c,props:u}=l;function d(o){if(!1===i){e.setParams({unevaluatedProperty:o}),e.error(),c||a.break();return}if(!(0,r.alwaysValidSchema)(l,i)){let i=a.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:o,dataPropType:r.Type.Str},i),c||a.if((0,t.not)(i),()=>a.break())}}u instanceof t.Name?a.if((0,t._)`${u} !== true`,()=>a.forIn("key",s,e=>{var r,o;return a.if((r=u,o=e,(0,t._)`!${r} || !${r}[${o}]`),()=>d(e))})):!0!==u&&a.forIn("key",s,e=>void 0===u?d(e):a.if(function(e,r){let o=[];for(let a in e)!0===e[a]&&o.push((0,t._)`${r} !== ${a}`);return(0,t.and)(...o)}(u,e),()=>d(e))),l.props=!0,e.ok((0,t._)`${n} === ${o.default.errors}`)}}}),pB=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dA(),r=dM();e.default={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:o,schema:a,data:i,it:s}=e,n=s.items||0;if(!0===n)return;let l=o.const("len",(0,t._)`${i}.length`);if(!1===a)e.setParams({len:n}),e.fail((0,t._)`${l} > ${n}`);else if("object"==typeof a&&!(0,r.alwaysValidSchema)(s,a)){let a=o.var("valid",(0,t._)`${l} <= ${n}`);o.if((0,t.not)(a),()=>{var i,c;return i=a,c=n,void o.forRange("i",c,l,a=>{e.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:r.Type.Num},i),s.allErrors||o.if((0,t.not)(i),()=>o.break())})}),e.ok(a)}s.items=!0}}}),pG=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pJ(),r=pB();e.default=[t.default,r.default]}),pZ=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),pW=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),pX=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),pY=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),pQ=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),p0=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),p1=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),p2=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pZ(),r=pW(),o=pX(),a=pY(),i=pQ(),s=p0(),n=p1(),l=["/properties"];e.default=function(e){return[t,r,o,a,c(this,i),s,c(this,n)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function c(t,r){return e?t.$dataMetaSchema(r,l):r}}}),p9=cZ((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=d5(),o=pC(),a=pU(),i=pK(),s=pG(),n=pI(),l=p2(),c="https://json-schema.org/draft/2019-09/schema";var u=class extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(a.default),o.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(i.default),this.addVocabulary(s.default),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(l.default.call(this,e),this.refs["http://json-schema.org/schema"]=c)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var d=dW();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=dA();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=dX();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=dY();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),p4=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d8(),r=pd(),o=pT(),a=pU(),i=pK(),s=pG(),n=px(),l=pj();e.default=[a.default,t.default,r.default,(0,o.default)(!0),n.default,l.metadataVocabulary,l.contentVocabulary,i.default,s.default]}),p5=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),p3=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),p6=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),p8=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),p7=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),he=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),ht=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),hr=cZ((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),ho=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p5(),r=p3(),o=p6(),a=p8(),i=p7(),s=he(),n=ht(),l=hr(),c=["/properties"];e.default=function(e){return[t,r,o,a,i,u(this,s),n,u(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,r){return e?t.$dataMetaSchema(r,c):r}}}),ha=cZ((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=d5(),o=p4(),a=pI(),i=ho(),s="https://json-schema.org/draft/2020-12/schema";var n=class extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(i.default.call(this,e),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv2020=n,t.exports=e=n,t.exports.Ajv2020=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var l=dW();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=dA();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var u=dX();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=dY();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),hi=cZ(e=>{function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(a,i),time:t(n(!0),l),"date-time":t(d(!0),p),"iso-time":t(n(),c),"iso-date-time":t(d(),h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return f.test(e)&&m.test(e)},"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:function(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},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:function(e){return y.lastIndex=0,y.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=v&&e>=g}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:b},double:{type:"number",validate:b},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\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,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"iso-date-time":t(/^\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,h),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},e.formatNames=Object.keys(e.fullFormats);let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){var t;let a=r.exec(e);if(!a)return!1;let i=+a[1],s=+a[2],n=+a[3];return s>=1&&s<=12&&n>=1&&n<=(2===s&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[s])}function i(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function n(e){return function(t){let r=s.exec(t);if(!r)return!1;let o=+r[1],a=+r[2],i=+r[3],n=r[4],l="-"===r[5]?-1:1,c=+(r[6]||0),u=+(r[7]||0);if(c>23||u>59||e&&!n)return!1;if(o<=23&&a<=59&&i<60)return!0;let d=a-u*l,p=o-c*l-(d<0);return(23===p||-1===p)&&(59===d||-1===d)&&i<61}}function l(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),o=new Date("2020-01-01T"+t).valueOf();if(r&&o)return r-o}function c(e,t){if(!(e&&t))return;let r=s.exec(e),o=s.exec(t);if(r&&o)return(e=r[1]+r[2]+r[3])>(t=o[1]+o[2]+o[3])?1:e<t?-1:0}let u=/t|\s/i;function d(e){let t=n(e);return function(e){let r=e.split(u);return 2===r.length&&a(r[0])&&t(r[1])}}function p(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),o=new Date(t).valueOf();if(r&&o)return r-o}function h(e,t){if(!(e&&t))return;let[r,o]=e.split(u),[a,s]=t.split(u),n=i(r,a);if(void 0!==n)return n||l(o,s)}let f=/\/|:/,m=/^(?:[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,y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,g=-0x80000000,v=0x80000000-1;function b(){return!0}let _=/[^\\]\\Z/}),hs=cZ(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=pM(),r=dA(),o=r.operators,a={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,r.str)`should be ${a[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,r._)`{comparison: ${a[e].okStr}, limit: ${t}}`},code(e){let o,i,{gen:s,data:n,schemaCode:l,keyword:c,it:u}=e,{opts:d,self:p}=u;if(!d.validateFormats)return;let h=new t.KeywordCxt(u,p.RULES.all.format.definition,"format");function f(e){return(0,r._)`${e}.compare(${n}, ${l}) ${a[c].fail} 0`}h.$data?(o=s.scopeValue("formats",{ref:p.formats,code:d.code.formats}),i=s.const("fmt",(0,r._)`${o}[${h.schemaCode}]`),e.fail$data((0,r.or)((0,r._)`typeof ${i} != "object"`,(0,r._)`${i} instanceof RegExp`,(0,r._)`typeof ${i}.compare != "function"`,f(i)))):function(){let t=h.schema,o=p.formats[t];if(!o||!0===o)return;if("object"!=typeof o||o instanceof RegExp||"function"!=typeof o.compare)throw Error(`"${c}": format "${t}" does not define "compare" function`);let a=s.scopeValue("formats",{key:t,ref:o,code:d.code.formats?(0,r._)`${d.code.formats}${(0,r.getProperty)(t)}`:void 0});e.fail$data(f(a))}()},dependencies:["format"]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}),hn=cZ((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=hi(),o=hs(),a=dA(),i=new a.Name("fullFormats"),s=new a.Name("fastFormats"),n=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,r.fullFormats,i),e;let[a,n]="fast"===t.mode?[r.fastFormats,s]:[r.fullFormats,i];return l(e,t.formats||r.formatNames,a,n),t.keywords&&(0,o.default)(e),e};function l(e,t,r,o){var i;for(let s of(null!=(i=e.opts.code).formats||(i.formats=(0,a._)`require("ajv-formats/dist/formats").${o}`),t))e.addFormat(s,r[s])}n.get=(e,t="full")=>{let o=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!o)throw Error(`Unknown format "${e}"`);return o},t.exports=e=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}),hl=pM(),hc=p9(),hu=ha();let hd=cW(hn(),1).default;function hp(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return hd(t),t}var hh=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=void 0!==e,this._ajv=e}get ajv(){return this._ajv??=hp(hu.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=function(e,t){if(!("$schema"in e)||"string"!=typeof e.$schema)return"2020-12";let r=e.$schema.replace(/#$/,"");if(cX.has(r))return"2020-12";if(cY.has(r))return"2019-09";if(cQ.has(r)||c0.has(r))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return"2020-12"===t?this.ajv:"2019-09"===t?this._ajv2019??=hp(hc.Ajv2019):this._ajvDraft7??=hp(hl.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&"string"==typeof e.$id?t.getSchema(e.$id)??t.compile(e):t.compile(e);return e=>r(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}};async function hf(e){return(await c).getRandomValues(new Uint8Array(e))}async function hm(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=256-256%t.length,o="";for(;o.length<e;)for(let a of(await hf(e-o.length)))a<r&&(o+=t[a%t.length]);return o}async function hy(e){return await hm(e)}async function hg(e){return btoa(String.fromCharCode(...new Uint8Array(await (await c).subtle.digest("SHA-256",new TextEncoder().encode(e))))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function hv(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await hy(e),r=await hg(t);return{code_verifier:t,code_challenge:r}}hl.Ajv,c=globalThis.crypto?.webcrypto??globalThis.crypto??Promise.resolve().then(i.t.bind(i,7598,19)).then(e=>e.webcrypto);class hb extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function h_(e){}function hS(e,t,r){return 100===r&&97===e.charCodeAt(t+1)&&116===e.charCodeAt(t+2)&&97===e.charCodeAt(t+3)&&58===e.charCodeAt(t+4)}function h$(e,t,r){return 101===r&&118===e.charCodeAt(t+1)&&101===e.charCodeAt(t+2)&&110===e.charCodeAt(t+3)&&116===e.charCodeAt(t+4)&&58===e.charCodeAt(t+5)}class hw extends TransformStream{constructor({onError:e,onRetry:t,onComment:r,maxBufferSize:o}={}){let a;super({start(i){a=function(e){if("function"==typeof e)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=h_,onError:r=h_,onRetry:o=h_,onComment:a,maxBufferSize:i}=e,s=[],n=0,l=!0,c,u="",d=0,p,h=!1;function f(){void 0!==i&&(n+u.length<=i||(h=!0,s.length=0,n=0,c=void 0,u="",d=0,p=void 0,r(new hb(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"}))))}function m(e){let r=0;if(-1===e.indexOf("\r")){let o=e.indexOf(`
75
+ `,r);for(;-1!==o;){if(r===o){d>0&&t({id:c,event:p,data:u}),c=void 0,u="",d=0,p=void 0,r=o+1,o=e.indexOf(`
76
+ `,r);continue}let a=e.charCodeAt(r);if(hS(e,r,a)){let a=32===e.charCodeAt(r+5)?r+6:r+5,i=e.slice(a,o);if(0===d&&10===e.charCodeAt(o+1)){t({id:c,event:p,data:i}),c=void 0,u="",p=void 0,r=o+2,o=e.indexOf(`
77
+ `,r);continue}u=0===d?i:`${u}
78
+ ${i}`,d++}else h$(e,r,a)?p=e.slice(32===e.charCodeAt(r+6)?r+7:r+6,o)||void 0:y(e,r,o);r=o+1,o=e.indexOf(`
79
+ `,r)}return e.slice(r)}for(;r<e.length;){let t=e.indexOf("\r",r),o=e.indexOf(`
80
+ `,r),a=-1;if(-1!==t&&-1!==o?a=t<o?t:o:-1!==t?a=t===e.length-1?-1:t:-1!==o&&(a=o),-1===a)break;y(e,r,a),r=a+1,13===e.charCodeAt(r-1)&&10===e.charCodeAt(r)&&r++}return e.slice(r)}function y(e,r,o){if(r===o)return void(d>0&&t({id:c,event:p,data:u}),c=void 0,u="",d=0,p=void 0);let i=e.charCodeAt(r);if(hS(e,r,i)){let t=32===e.charCodeAt(r+5)?r+6:r+5,a=e.slice(t,o);u=0===d?a:`${u}
81
+ ${a}`,d++;return}if(h$(e,r,i)){p=e.slice(32===e.charCodeAt(r+6)?r+7:r+6,o)||void 0;return}if(105===i&&100===e.charCodeAt(r+1)&&58===e.charCodeAt(r+2)){let t=e.slice(32===e.charCodeAt(r+3)?r+4:r+3,o);c=t.includes("\0")?void 0:t;return}if(58===i){a&&a(e.slice(r,o).slice(32===e.charCodeAt(r+1)?2:1));return}let s=e.slice(r,o),n=s.indexOf(":");if(-1===n)return void g(s,"",s);let l=s.slice(0,n),h=32===s.charCodeAt(n+1)?2:1;g(l,s.slice(n+h),s)}function g(e,t,a){switch(e){case"event":p=t||void 0;break;case"data":u=0===d?t:`${u}
82
+ ${t}`,d++;break;case"id":c=t.includes("\0")?void 0:t;break;case"retry":/^\d+$/.test(t)?o(parseInt(t,10)):r(new hb(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:a}));break;default:r(new hb(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:"unknown-field",field:e,value:t,line:a}))}}return{feed:function(e){if(h)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,239===e.charCodeAt(0)&&187===e.charCodeAt(1)&&191===e.charCodeAt(2)&&(e=e.slice(3))),0===s.length){let t=m(e);""!==t&&(s.push(t),n=t.length),f();return}if(-1===e.indexOf(`
83
+ `)&&-1===e.indexOf("\r")){s.push(e),n+=e.length,f();return}s.push(e);let t=s.join("");s.length=0,n=0;let r=m(t);""!==r&&(s.push(r),n=r.length),f()},reset:function(e={}){if(e.consume&&s.length>0){let e=s.join("");y(e,0,e.length)}l=!0,c=void 0,u="",d=0,p=void 0,s.length=0,n=0,h=!1}}}({onEvent:e=>{i.enqueue(e)},onError(t){"function"==typeof e&&e(t),("terminate"===e||"max-buffer-size-exceeded"===t.type)&&i.error(t)},onRetry:t,onComment:r,maxBufferSize:o})},transform(e){a.feed(e)}})}}var hE=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return c9(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return c9(this,e)}constructor(e){super(e),this.name=new.target.name,c2(this,new.target)}},hR=class extends hE{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(e,t,r){super(`Issuer mismatch in ${"metadata"===e?"authorization server metadata (RFC 8414 \xa73.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(r)}`),this.kind=e,this.expected=t,this.received=r}},hP=class extends hE{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},hk=class extends hE{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},hT=class extends hE{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}},hO=class extends hE{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:""}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};function hx(e,t,r){if(void 0!==e)return void 0===e.issuer?(r?.canPersistStamp!==!1&&console.warn("[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field."),e):hj(e.issuer,t)?e:void 0}function hj(e,t){return e===t||e.endsWith("/")&&e.slice(0,-1)===t||t.endsWith("/")&&t.slice(0,-1)===e}async function hC(e,t,r){let{resourceMetadataUrl:o,scope:a}=hK(t.response);if(await hV(e,{serverUrl:t.serverUrl,resourceMetadataUrl:o,scope:a,fetchFn:t.fetchFn,...r})!=="AUTHORIZED")throw new hN}var hN=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return c9(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return c9(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",c2(this,new.target)}};function hI(e){return e?.authorization_response_iss_parameter_supported===!0}function hA({iss:e,expectedIssuer:t,issParameterSupported:r}){if(void 0!==t){if(void 0===e){if(r)throw new hR("authorization_response",t,void 0);return}if(e!==t)throw new hR("authorization_response",t,e)}}function hM(...e){let t=new Set;for(let r of e)if(r)for(let e of r.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(" "):void 0}async function hq(e,t,r,o,a){if("string"==typeof e)return{authorizationCode:e,iss:t};let i=e.get("iss")??void 0,s=e.get("code");if(s)return{authorizationCode:s,iss:i};let n=(await r.discoveryState?.())?.authorizationServerMetadata;if(!n)try{n=(await hY(o,a)).authorizationServerMetadata}catch{n=void 0}if(!n)throw new hN("Authorization callback failed and the issuer could not be verified");hA({iss:i,expectedIssuer:n.issuer,issParameterSupported:hI(n)});let l=e.get("error");if(l)throw new c5(l,e.get("error_description")??l,e.get("error_uri")??void 0);throw new hN("Authorization callback contained neither `code` nor `error`")}let hz="code",hL="S256";function hD(e){return"localhost"===e||"127.0.0.1"===e||"[::1]"===e||"::1"===e}async function hU(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let e=nb.parse(JSON.parse(r));return c5.fromResponse(e)}catch(o){let e=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${o}. Raw body: ${r}`;return new c5(c4.ServerError,e)}}async function hV(e,t){try{return await hF(e,t)}catch(r){if(r instanceof c5){if(r.code===c4.InvalidClient||r.code===c4.UnauthorizedClient)return await e.invalidateCredentials?.("client"),await e.invalidateCredentials?.("tokens"),await hF(e,t);else if(r.code===c4.InvalidGrant)return await e.invalidateCredentials?.("tokens"),await hF(e,t)}throw r}}async function hF(e,{serverUrl:t,authorizationCode:r,iss:o,scope:a,resourceMetadataUrl:i,fetchFn:s,skipIssuerMetadataValidation:n,forceReauthorization:l}){let c,u,d,p,h,f={...h=e.clientMetadata,grant_types:h.grant_types??(void 0===e.redirectUrl?void 0:["authorization_code","refresh_token"]),application_type:h.application_type??function(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if("http:"!==e.protocol&&"https:"!==e.protocol||hD(e.hostname))return"native"}return"web"}(h.redirect_uris)},m=await e.discoveryState?.(),y=i;if(!y&&m?.resourceMetadataUrl&&(y=new URL(m.resourceMetadataUrl)),m?.authorizationServerUrl){if(u=m.authorizationServerUrl,c=m.resourceMetadata,d=m.authorizationServerMetadata??await hX(u,{fetchFn:s,skipIssuerValidation:n}),!c)try{c=await hB(t,{resourceMetadataUrl:y},s)}catch(e){if(e instanceof TypeError)throw e}(d!==m.authorizationServerMetadata||c!==m.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(u),resourceMetadataUrl:y?.toString(),resourceMetadata:c,authorizationServerMetadata:d})}else{let e=await hY(t,{resourceMetadataUrl:y,fetchFn:s,skipIssuerMetadataValidation:n});u=e.authorizationServerUrl,d=e.authorizationServerMetadata,c=e.resourceMetadata,p={authorizationServerUrl:String(u),resourceMetadataUrl:y?.toString(),resourceMetadata:c,authorizationServerMetadata:d}}let g=d?.issuer??String(u),v={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),void 0!==r){let t=m?.authorizationServerMetadata?.issuer??m?.authorizationServerUrl;if(void 0===t){if(void 0!==e.saveDiscoveryState)throw new hT("discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier",g);console.warn("[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md \xa7SEP-2352.")}else if(!hj(t,g))throw new hT(t,g)}p&&await e.saveDiscoveryState?.(p);let b=await hH(t,e,c);b&&await e.saveResourceUrl?.(String(b));let _=function(e){let{requestedScope:t,resourceMetadata:r,authServerMetadata:o,clientMetadata:a}=e,i=t||r?.scopes_supported?.join(" ")||a.scope;return i&&o?.scopes_supported?.includes("offline_access")&&!i.split(" ").includes("offline_access")&&a.grant_types?.includes("refresh_token")&&(i=`${i} offline_access`),i}({requestedScope:a,resourceMetadata:c,authServerMetadata:d,clientMetadata:e.clientMetadata}),S=await Promise.resolve(e.clientInformation(v)),$=hx(S,g,{canPersistStamp:void 0!==e.saveClientInformation});if(void 0===$&&S?.issuer&&void 0===e.saveClientInformation)throw new hT(S.issuer,g);if($&&void 0===$.issuer&&($={...$,issuer:g},await e.saveClientInformation?.($,v)),!$){if(void 0!==r)throw Error("Existing OAuth client information is required when exchanging an authorization code");let t=d?.client_id_metadata_document_supported===!0,o=e.clientMetadataUrl;if(o&&!function(e){if(!e)return!1;try{let t=new URL(e);return"https:"===t.protocol&&"/"!==t.pathname}catch{return!1}}(o))throw new c5(c4.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${o}`);if(t&&o)$={client_id:o,issuer:g},await e.saveClientInformation?.($,v);else{if(!e.saveClientInformation)throw Error("OAuth client information must be saveable for dynamic registration");$={...await h9(u,{metadata:d,clientMetadata:f,scope:_,fetchFn:s}),issuer:g},await e.saveClientInformation($,v)}}let w=!e.redirectUrl;if(void 0!==r||w){void 0!==r&&hA({iss:o,expectedIssuer:d?.issuer,issParameterSupported:hI(d)});let t=await h2(e,u,{metadata:d,resource:b,authorizationCode:r,iss:o,scope:_,fetchFn:s});return await e.saveTokens({...t,issuer:g},v),"AUTHORIZED"}let E=hx(await e.tokens(v),g);if(E&&void 0===E.issuer&&(E={...E,issuer:g},await e.saveTokens(E,v)),E?.refresh_token&&!l)try{let t=await h1(u,{metadata:d,clientInformation:$,refreshToken:E.refresh_token,resource:b,addClientAuthentication:e.addClientAuthentication,fetchFn:s});return await e.saveTokens({...t,issuer:g},v),"AUTHORIZED"}catch(e){if(e instanceof hk||e instanceof c5&&e.code!==c4.ServerError)throw e}let R=e.state?await e.state():void 0,{authorizationUrl:P,codeVerifier:k}=await hQ(u,{metadata:d,clientInformation:$,state:R,redirectUrl:e.redirectUrl,scope:_,resource:b});return await e.saveCodeVerifier(k),await e.redirectToAuthorization(P),"REDIRECT"}async function hH(e,t,r){let o,a=((o=new URL("string"==typeof e?e:e.href)).hash="",o);if(t.validateResourceURL)return await t.validateResourceURL(a,r?.resource);if(r){if(!function({requestedResource:e,configuredResource:t}){let r=new URL("string"==typeof e?e:e.href),o=new URL("string"==typeof t?t:t.href);if(r.origin!==o.origin||r.pathname.length<o.pathname.length)return!1;let a=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=o.pathname.endsWith("/")?o.pathname:o.pathname+"/";return a.startsWith(i)}({requestedResource:a,configuredResource:r.resource}))throw Error(`Protected resource ${r.resource} does not match expected ${a} (or origin)`);return new URL(r.resource)}}function hK(e){let t,r=e.headers.get("WWW-Authenticate");if(!r)return{};let[o,a]=r.split(" ");if(o?.toLowerCase()!=="bearer"||!a)return{};let i=hJ(e,"resource_metadata")||void 0;if(i)try{t=new URL(i)}catch{}let s=hJ(e,"scope")||void 0;return{resourceMetadataUrl:t,scope:s,error:hJ(e,"error")||void 0,errorDescription:hJ(e,"error_description")||void 0}}function hJ(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let o=new RegExp(String.raw`${t}=(?:"([^"]+)"|([^\s,]+))`),a=r.match(o);if(a){let e=a[1]||a[2];if(e)return e}return null}async function hB(e,t,r=fetch){let o=await hW(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!o||404===o.status)throw await o?.text?.().catch(()=>{}),Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!o.ok)throw await o.text?.().catch(()=>{}),Error(`HTTP ${o.status} trying to load well-known OAuth protected resource metadata.`);return nh.parse(await o.json())}async function hG(e,t,r=fetch){try{return await r(e,{headers:t})}catch(e){throw e}}async function hZ(e,t,r=fetch){return await hG(e,{"MCP-Protocol-Version":t},r)}async function hW(e,t,r,o){var a,i;let s,n=new URL(e),l=o?.protocolVersion??aT;o?.metadataUrl?s=new URL(o.metadataUrl):(s=new URL(function(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}(t,n.pathname),o?.metadataServerUrl??n)).search=n.search;let c=await hZ(s,l,r);return!o?.metadataUrl&&(a=c,i=n.pathname,!a||"/"!==i&&(a.status>=400&&a.status<500||502===a.status))&&(c=await hZ(new URL(`/.well-known/${t}`,n),l,r)),c}async function hX(e,{fetchFn:t=fetch,protocolVersion:r=aT,skipIssuerValidation:o=!1}={}){let a={"MCP-Protocol-Version":r,Accept:"application/json"};for(let{url:r,type:i}of function(e){let t="string"==typeof e?new URL(e):e,r="/"!==t.pathname,o=[];if(!r)return o.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"},{url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),o;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),o.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"},{url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"},{url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),o}(e)){let s=await hG(r,a,t);if(!s)continue;if(!s.ok){if(await s.text?.().catch(()=>{}),s.status>=400&&s.status<500||502===s.status)continue;throw Error(`HTTP ${s.status} trying to load ${"oauth"===i?"OAuth":"OpenID provider"} metadata from ${r}`)}let n="oauth"===i?nf.parse(await s.json()):ny.parse(await s.json());if(!o){let t="string"==typeof e?e:e.href;if(!(n.issuer===t||t.endsWith("/")&&n.issuer===t.slice(0,-1)))throw new hR("metadata",t,n.issuer)}return n}}async function hY(e,t){let r,o;try{(r=await hB(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn)).authorization_servers&&r.authorization_servers.length>0&&(o=r.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}o||(o=String(new URL("/",e)));let a=await hX(o,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:o,authorizationServerMetadata:a,resourceMetadata:r}}async function hQ(e,{metadata:t,clientInformation:r,redirectUrl:o,scope:a,state:i,resource:s}){let n;if(t){if(n=new URL(t.authorization_endpoint),!t.response_types_supported.includes(hz))throw Error(`Incompatible auth server: does not support response type ${hz}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(hL))throw Error(`Incompatible auth server: does not support code challenge method ${hL}`)}else n=new URL("/authorize",e);let l=await hv(),c=l.code_verifier,u=l.code_challenge;return n.searchParams.set("response_type",hz),n.searchParams.set("client_id",r.client_id),n.searchParams.set("code_challenge",u),n.searchParams.set("code_challenge_method",hL),n.searchParams.set("redirect_uri",String(o)),i&&n.searchParams.set("state",i),a&&n.searchParams.set("scope",a),a?.split(" ").includes("offline_access")&&n.searchParams.append("prompt","consent"),s&&n.searchParams.set("resource",s.href),{authorizationUrl:n,codeVerifier:c}}async function h0(e,{metadata:t,tokenRequestParams:r,clientInformation:o,addClientAuthentication:a,resource:i,fetchFn:s}){var n,l;let c,u=function(e){let t=new URL(String(e));if("https:"!==t.protocol&&!hD(t.hostname))throw new hk(t.href);return t}(t?.token_endpoint??new URL("/token",e)),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});i&&r.set("resource",i.href),a?await a(d,r,u,t):o&&function(e,t,r,o){let{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":var s,n,l,c,u=a,d=i,p=r;if(!d)throw Error("client_secret_basic authentication requires a client_secret");let h=btoa(`${u}:${d}`);p.set("Authorization",`Basic ${h}`);return;case"client_secret_post":s=a,n=i,(l=o).set("client_id",s),n&&l.set("client_secret",n);return;case"none":c=a,o.set("client_id",c);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}((n=o,l=t?.token_endpoint_auth_methods_supported??[],c=void 0!==n.client_secret,"token_endpoint_auth_method"in n&&n.token_endpoint_auth_method&&["client_secret_basic","client_secret_post","none"].includes(n.token_endpoint_auth_method)&&(0===l.length||l.includes(n.token_endpoint_auth_method))?n.token_endpoint_auth_method:0===l.length?c?"client_secret_basic":"none":c&&l.includes("client_secret_basic")?"client_secret_basic":c&&l.includes("client_secret_post")?"client_secret_post":l.includes("none")?"none":c?"client_secret_post":"none"),o,d,r);let p=await (s??fetch)(u,{method:"POST",headers:d,body:r});if(!p.ok)throw await hU(p);let h=await p.json();try{return ng.parse(h)}catch(e){if("object"==typeof h&&null!==h&&"error"in h)throw await hU(JSON.stringify(h));throw e}}async function h1(e,{metadata:t,clientInformation:r,refreshToken:o,resource:a,addClientAuthentication:i,fetchFn:s}){return{refresh_token:o,...await h0(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:"refresh_token",refresh_token:o}),clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:s})}}async function h2(e,t,{metadata:r,resource:o,authorizationCode:a,iss:i,scope:s,fetchFn:n}={}){let l;void 0!==a&&hA({iss:i,expectedIssuer:r?.issuer,issParameterSupported:hI(r)});let c=s??e.clientMetadata.scope;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(c)),!l){if(!a)throw Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw Error("redirectUrl is required for authorization_code flow");l=new URLSearchParams({grant_type:"authorization_code",code:a,code_verifier:await e.codeVerifier(),redirect_uri:String(e.redirectUrl)})}let u=await e.clientInformation({issuer:r?.issuer??String(t)});return h0(t,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:e.addClientAuthentication,resource:o,fetchFn:n})}async function h9(e,{metadata:t,clientMetadata:r,scope:o,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);let s={...r,...void 0===o?{}:{scope:o}},n=await (a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!n.ok)throw new hP({status:n.status,body:await n.text(),submittedMetadata:s});return nw.parse(await n.json())}let h4=new Set(["tools/list","prompts/list","resources/list","resources/templates/list","server/discover"]);var h5=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(h3(e))}set(e,t){let r=h3(e),o=h4.has(e.method),a=!this._entries.has(r);if(!o&&a&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!h4.has(e.slice(0,e.indexOf("\0")))){this._entries.delete(e),this._cappedSize--;break}}let i=++this._stamp;return this._entries.set(r,{...t,stamp:i}),a&&!o&&this._cappedSize++,i}delete(e){this._entries.delete(h3(e))&&!h4.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,r=h4.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),!r&&this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function h3(e){return`${e.method}\0${JSON.stringify([e.partition??"",e.params??""])}`}function h6(e,t){return void 0===t?e:`${e}\0${t}`}var h8=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity="";constructor(e,t,r=()=>{},o="",a=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=r,this._cachePartition=o,this._now=a}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,"public"===e?"":this._cachePartition])}async _probe(e,t){let r={method:e,params:t??""},o=this._partitionFor("private"),a=await this._store.get({...r,partition:o});if(void 0!==a)return a;let i=this._partitionFor("public");if(i===o)return;let s=await this._store.get({...r,partition:i});return s?.scope==="public"?s:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,"")}async _deleteBoth(e,t){let r=this._partitionFor("private"),o=this._partitionFor("public");try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}if(o!==r)try{await this._store.delete({method:e,params:t,partition:o})}catch(e){this._reportError(e)}}async evictKey(e,t){let r=h6(e,t),o=this._evictionGeneration.get(r);void 0!==o&&this._evictionGeneration.set(r,o+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let r=h6(e,t),o=this._evictionGeneration.get(r)??0;return this._evictionGeneration.set(r,o),o}async write(e,t,r,o){if((this._evictionGeneration.get(h6(e,o?.params))??0)!==r)return;let a=o?.params??"",i=this._partitionFor("private"),s=this._partitionFor("public"),n=(o?.scope??"private")==="public"?s:i;try{await this._store.set({method:e,params:a,partition:n},{value:function(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if("string"!=typeof t)throw TypeError("cache value is not JSON-serializable: it has no JSON representation");return t}(t),expiresAt:o?.expiresAt,scope:o?.scope})}catch(e){this._reportError(e)}if(s!==i)try{await this._store.delete({method:e,params:a,partition:n===i?s:i})}catch(e){this._reportError(e)}}async read(e,t){let r=await this._probe(e,t);if(r?.expiresAt!==void 0&&r.expiresAt>this.now())try{let e=JSON.parse(r.value);if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError("cached document is not an object");return{value:e}}catch(r){this._reportError(r),await this._deleteBoth(e,t??"");return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=""}async toolDefinition(e){let t=await this._probe("tools/list");if(void 0===t){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),r=new Map;if(void 0!==e)for(let t of e.tools)r.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:r}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let r=await this._probe("tools/list");if(void 0===r){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==r.stamp){let e=this._decodeListTools(r)??{tools:[]},o=new Map;for(let r of e.tools){let e=t(r);void 0!==e&&o.set(r.name,e)}this._toolOutputValidatorIndex={stamp:r.stamp,byName:o}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>null!==e&&"object"==typeof e))throw TypeError("cached tools/list document has a malformed tools array");return t}catch(e){this._reportError(e);return}}};let h7=Symbol.for("mcp.authSeamEscape");function fe(e){if("object"==typeof e&&null!==e||"function"==typeof e)try{Object.defineProperty(e,h7,{value:!0,configurable:!0})}catch{}return e}let ft=new Set([-32001,-32020,-32021]);function fr(e,t){let{code:r,message:o,data:a}=e;if(-32022===r){let e=function(e){if("object"!=typeof e||null===e)return;let t=e.supported;if(Array.isArray(t)&&0!==t.length&&t.every(e=>"string"==typeof e))return t}(a);if(void 0===e)return{kind:"legacy"};let r=new uj({supported:e,requested:function(e){if("object"!=typeof e||null===e)return;let t=e.requested;return"string"==typeof t?t:void 0}(a)??t.requestedVersion},o),i=ur(e),s=t.clientModernVersions.find(e=>i.includes(e));return void 0!==s?{kind:"corrective",version:s,error:r}:i.length>0?{kind:"error",error:r}:t.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:r}}return ft.has(r),{kind:"legacy"}}function fo(e,t){var r,o;return"browser"===t.environment&&((r=e)instanceof TypeError||r instanceof Error&&"TypeError"===r.name)?{kind:"legacy"}:{kind:"error",error:new c6(c3.EraNegotiationFailed,`Version negotiation probe failed: ${(o=e)instanceof Error?o.message:String(o)}`,{cause:e})}}function fa(){let e=globalThis;return void 0!==e.window&&void 0!==e.document?"browser":"node"}function fi(e){return"stderr"in e&&"pid"in e?"stdio":"http"}var fs=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let r=new e(t);t.onmessage=e=>{let t=r._pending;if(void 0!==t&&(u0(e)||u1(e))&&e.id===t.id){r._pending=void 0,u0(e)?t.resolve({kind:"response",result:e.result}):t.resolve({kind:"response",error:e.error});return}},t.onerror=e=>{r._savedOnError?.(e)},t.onclose=()=>{let e=r._pending;void 0!==e&&(r._pending=void 0,e.resolve({kind:"closed"})),r._closeDelivered=!0,r._savedOnClose?.()};try{await t.start()}catch(e){throw r.detach(),e}return r}async exchange(e,t){let r=`server-discover-probe-${++this._probeCounter}`;return new Promise(o=>{let a=!1,i=e=>{a||(a=!0,clearTimeout(s),this._pending?.id===r&&(this._pending=void 0),o(e))},s=setTimeout(()=>i({kind:"timeout"}),t);this._pending={id:r,resolve:i},this._transport.send(e(r)).catch(e=>i({kind:"send-error",error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&void 0!==this._savedOnClose){let e=this._savedOnClose,t=this._transport,r=!1,o=()=>{if(!r){r=!0;return}e()};t.onclose=o,fn.set(t,()=>{t.onclose===o&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,r=!0;e.start=async function(){if(r){r=!1,e.start=t;return}return t.call(e)}}};let fn=new WeakMap;function fl(e){let t=fn.get(e);fn.delete(e),t?.()}async function fc(e,t){let r,o=e.probe.timeoutMs??t.defaultTimeoutMs,a=Math.max(0,e.probe.maxRetries??0),i="pin"===e.kind?[e.version]:e.modernVersions,s="auto"===e.kind&&e.fallbackAvailable,n=await fs.open(t.transport),l=async()=>{let r=i[0],l=!1,c=a;for(;;){let a=await n.exchange(e=>{var o,a,i;return o=r,a=t.clientInfo,i=t.capabilities,{jsonrpc:"2.0",id:e,method:"server/discover",params:{_meta:uG(o).outboundEnvelope({protocolVersion:o,clientInfo:a,clientCapabilities:i})}}},o);if("timeout"===a.kind&&c>0){c--;continue}let u=function(e,t){switch(e.kind){case"response":return void 0===e.error?{kind:"result",result:e.result}:{kind:"rpc-error",...e.error};case"send-error":{let t=e.error;if(("object"==typeof t&&null!==t||"function"==typeof t)&&!0===t[h7]||t instanceof hN||t instanceof Error&&"UnauthorizedError"===t.name)return{kind:"auth-required",error:t};if(t instanceof c8){let e=t.data?.text;return{kind:"http-error",status:t.data.status,body:"string"==typeof e?e:void 0,statusText:t.data.statusText}}return{kind:"network-error",error:t}}case"closed":return{kind:"closed"};case"timeout":return{kind:"timeout",timeoutMs:t}}}(a,o),d=function(e,t){switch(e.kind){case"result":return function(e,t){let r=uG(uB).validateResult("server/discover",e);if(!r.ok)return{kind:"legacy"};let o=r.value.supportedVersions,a=t.clientModernVersions.find(e=>o.includes(e));return void 0!==a?{kind:"modern",version:a,discover:r.value}:t.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:new uj({supported:[...o],requested:t.requestedVersion})}}(e.result,t);case"rpc-error":return fr(e,t);case"http-error":return function(e,t){if(401===e.status||403===e.status){let t=403===e.status;return{kind:"error",error:new c8(t?c3.ClientHttpForbidden:c3.ClientHttpAuthentication,`Version negotiation failed: ${t?"the server denied access (HTTP 403)":"the server requires authorization (HTTP 401)"}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:"error",error:new c8(c3.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let r=function(e){let t;if(void 0===e||""===e)return;try{t=JSON.parse(e)}catch{return}if("object"!=typeof t||null===t)return;let r=t.error;if("object"!=typeof r||null===r)return;let{code:o,message:a,data:i}=r;if("number"==typeof o)return{code:o,message:"string"==typeof a?a:"",data:i}}(e.body);return void 0!==r?fr(r,t):{kind:"legacy"}}(e,t);case"network-error":return fo(e.error,t);case"auth-required":return{kind:"error",error:e.error};case"closed":if("stdio"===t.transportKind)return{kind:"legacy"};return fo(Error("Connection closed during the version negotiation probe"),t);case"timeout":if("stdio"===t.transportKind)return{kind:"legacy"};return{kind:"error",error:new c6(c3.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}(u,{clientModernVersions:i,requestedVersion:r,fallbackAvailable:s,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case"modern":return{era:"modern",version:d.version,discover:d.discover};case"corrective":if(l)throw d.error;l=!0,r=d.version;continue;case"legacy":{let r="closed"===u.kind?"the connection closed during the server/discover probe":void 0;if("pin"===e.kind)throw new c6(c3.EraNegotiationFailed,void 0===r?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${r} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new c6(c3.EraNegotiationFailed,void 0===r?"Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to":`Version negotiation failed: ${r} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(void 0!==r&&!0!==t.disposableProbe)throw new c6(c3.EraNegotiationFailed,`Version negotiation failed: ${r} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:"legacy"}}case"error":throw d.error}}};try{r=await l()}catch(e){throw n.detach(),e}return n.release(),r}async function fu(e,t,r,o){let a,i,s=new t.constructor({...r,stderr:"ignore"}),n=t.close,l=!1,c=new Promise((e,t)=>{a=()=>t(fd())});t.close=async function(){return l=!0,a?.(),n.call(t)};try{let t=fc(e,{...o,transport:s,transportKind:"stdio",disposableProbe:!0});t.catch(()=>{}),i=await Promise.race([t,c])}finally{await fp(s),t.close=n}if(l)throw fd();return i}function fd(){return new c6(c3.EraNegotiationFailed,"Version negotiation failed: the transport was closed during the server/discover probe")}async function fp(e){try{let t=e._dispose;await ("function"==typeof t?t.call(e):e.close())}catch{}}function fh(e){let t=e._meta?.[aC];return db.Implementation(t)?t:void 0}let ff={"notifications/tools/list_changed":["tools/list"],"notifications/prompts/list_changed":["prompts/list"],"notifications/resources/list_changed":["resources/list","resources/templates/list"]};var fm=class extends dR{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new c6(c3.ConnectionClosed,"subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset");for(let t of this._listenState.values())t.settle({cause:"remote",error:e})}for(let e of(this._listenState.clear(),this._listChangedDebounceTimers.values()))clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new hh,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=function(e){return{autoFulfill:e?.autoFulfill??!0,maxRounds:e?.maxRounds??10}}(t?.inputRequired),this._cache=new h8(t?.responseCacheStore??new h5,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??""),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??64,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(void 0!==this._negotiatedProtocolVersion&&this._negotiatedProtocolVersion>=c7&&aY.safeParse(e).success)return"drop"}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(void 0!==e)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?function(e,t,r,o){let{codec:a,request:i,options:s,flowStartedAt:n}=o,l={inputRequests:r.inputRequests,...void 0!==r.requestState&&{requestState:r.requestState}};return dm({config:t,method:i.method,originalParams:i.params,firstPayload:l,flowStartedAt:n,signal:s?.signal,requestOptions:{...s?.timeout!==void 0&&{timeout:s.timeout},...s?.maxTotalTimeout!==void 0&&{maxTotalTimeout:s.maxTotalTimeout},...s?.onprogress!==void 0&&{onprogress:s.onprogress}},hooks:{dispatchInputRequest:(t,r,o)=>dO(e,a,t,r,o),retry:(e,t)=>o.retry(e,{...s?.signal!==void 0&&{signal:s.signal},...s?.onprogress!==void 0&&{onprogress:s.onprogress},...s?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:s.resetTimeoutOnProgress},...s?.headers!==void 0&&{headers:s.headers},...void 0!==t.timeout&&{timeout:t.timeout},...void 0!==t.maxTotalTimeout&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0})}})}({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new c6(c3.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:"input_required",method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools","notifications/tools/list_changed",e.tools,async()=>(await this.listTools(void 0,{cacheMode:"refresh"})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts","notifications/prompts/list_changed",e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:"refresh"})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources","notifications/resources/list_changed",e.resources,async()=>(await this.listResources(void 0,{cacheMode:"refresh"})).resources)}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=function(e,t){let r={...e};for(let e in t){let o=t[e];if(void 0===o)continue;let a=r[e];r[e]=dP(a)&&dP(o)?{...a,...o}:o}return r}(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error("Cannot configure version negotiation after connecting to transport");this._versionNegotiation=e}_wrapHandler(e,t){return"elicitation/create"===e?async(e,r)=>{let o=uG(this._negotiatedProtocolVersion),a=o.validateRequest("elicitation/create",e);if(a.ok||"not-in-era"!==a.reason||(a=o.validateInputRequest("elicitation/create",e)),!a.ok)throw new uT("not-in-era"===a.reason?uk.InternalError:uk.InvalidParams,"not-in-era"===a.reason?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation request: ${a.message}`);let{params:i}=a.value;i.mode=i.mode??"form";let{supportsFormMode:s,supportsUrlMode:n}=function(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=void 0!==e.form,r=void 0!==e.url;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}(this._capabilities.elicitation);if("form"===i.mode&&!s)throw new uT(uk.InvalidParams,"Client does not support form-mode elicitation requests");if("url"===i.mode&&!n)throw new uT(uk.InvalidParams,"Client does not support URL-mode elicitation requests");let l=await t(e,r),c=o.validateResult("elicitation/create",l);if(c.ok||"not-in-era"!==c.reason||(c=o.validateInputResponse("elicitation/create",l)),!c.ok)throw new uT("not-in-era"===c.reason?uk.InternalError:uk.InvalidParams,"not-in-era"===c.reason?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation result: ${c.message}`);let u=c.value,d="form"===i.mode?i.requestedSchema:void 0;if("form"===i.mode&&"accept"===u.action&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{!function e(t,r){if(t&&null!==r&&"object"==typeof r){if("object"===t.type&&t.properties&&"object"==typeof t.properties){let o=t.properties;for(let t of Object.keys(o)){let a=o[t];void 0===r[t]&&Object.prototype.hasOwnProperty.call(a,"default")&&(r[t]=a.default),void 0!==r[t]&&e(a,r[t])}}if(Array.isArray(t.anyOf))for(let o of t.anyOf)"boolean"!=typeof o&&e(o,r);if(Array.isArray(t.oneOf))for(let o of t.oneOf)"boolean"!=typeof o&&e(o,r)}}(d,u.content)}catch{}return u}:"sampling/createMessage"===e?async(e,r)=>{let o=uG(this._negotiatedProtocolVersion),a=o.validateRequest("sampling/createMessage",e);if(a.ok||"not-in-era"!==a.reason||(a=o.validateInputRequest("sampling/createMessage",e)),!a.ok)throw new uT("not-in-era"===a.reason?uk.InternalError:uk.InvalidParams,"not-in-era"===a.reason?"No wire schema for sampling/createMessage in the resolved era":`Invalid sampling request: ${a.message}`);let{params:i}=a.value,s=await t(e,r),n=!!(i.tools||i.toolChoice),l=o.samplingResultVariant(n,s);if(l.ok||"not-in-era"!==l.reason||(l=o.validateInputResponse("sampling/createMessage",s)),!l.ok)throw new uT("not-in-era"===l.reason?uk.InternalError:uk.InvalidParams,"not-in-era"===l.reason?"No result schema for sampling/createMessage in the resolved era":`Invalid sampling result: ${l.message}`);return l.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new c6(c3.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,function(e){if("object"==typeof e&&null!==e&&("legacy"===e.kind&&!("supportedVersions"in e)&&!("discover"in e)||"modern"===e.kind&&ih.safeParse(e.discover).success))return e;throw new c6(c3.EraNegotiationFailed,"connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }")}(t.prior),t);let r=function(e,t){let r=e?.mode??"legacy";if("legacy"===r)return{kind:"legacy"};let o=e?.probe??{};if("object"==typeof r){if(!(r.pin>=c7))throw TypeError(`versionNegotiation: { pin: '${r.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:"pin",version:r.pin,probe:o}}let a=t?ur(t):[];return{kind:"auto",modernVersions:a.length>0?a:[...ue],fallbackAvailable:!t||ut(t).length>0,probe:o}}(this._versionNegotiation,this._supportedProtocolVersionsOption);return"legacy"!==r.kind?this._connectNegotiated(e,r,t):this._connectPlainLegacy(e,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),void 0!==e.sessionId){let t=this._negotiatedProtocolVersion;void 0!==t&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let r=ut(this._supportedProtocolVersions);try{let o=r[0];if(void 0===o)throw new c6(c3.EraNegotiationFailed,"Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version");let a=await this.request({method:"initialize",params:{protocolVersion:o,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(void 0===a)throw Error(`Server sent invalid initialize result: ${a}`);if(!r.includes(a.protocolVersion))throw Error(`Server's protocol version is not supported: ${a.protocolVersion}`);this._serverCapabilities=a.capabilities,this._serverVersion=a.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(a.protocolVersion),this._instructions=a.instructions,await this.notification({method:"notifications/initialized"}),this._negotiatedProtocolVersion=a.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,r){let o;if(void 0!==e.sessionId){await super.connect(e);let t=this._negotiatedProtocolVersion;void 0!==t&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();try{let a=fi(e),i={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:fa(),defaultTimeoutMs:r?.timeout??6e4},s="stdio"===a?function(e){let t=Object.getPrototypeOf(e);if(null===t||!Object.prototype.hasOwnProperty.call(t,"_dispose"))return;let r=e._serverParams;return"object"==typeof r&&null!==r&&"string"==typeof r.command?r:void 0}(e):void 0;o=void 0===s?await fc(t,{...i,transport:e,transportKind:a}):await fu(t,e,s,i)}catch(t){throw await e.close().catch(()=>{}),fl(e),t}if(fl(e),await super.connect(e),"legacy"===o.era)return void await this._legacyHandshake(e,r);if(this._serverCapabilities=o.discover.capabilities,this._serverVersion=fh(o.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=o.discover.instructions,this._discoverResult=o.discover,this._negotiatedProtocolVersion=o.version,e.setProtocolVersion&&e.setProtocolVersion(o.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,o={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},a=!0;try{this._setupListChangedHandlers(o)}catch(e){a=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let i=a?{...o.tools&&{toolsListChanged:!0},...o.prompts&&{promptsListChanged:!0},...o.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(i).length>0){let e=new AbortController,t=()=>e.abort(r?.signal?.reason);r?.signal?.aborted&&t(),r?.signal?.addEventListener("abort",t);try{this._autoOpenedSubscription=await this.listen(i,{timeout:r?.timeout,signal:e.signal})}catch(e){if(r?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{r?.signal?.removeEventListener("abort",t)}}}}async _connectFromPrior(e,t,r){if("legacy"===t.kind)return this._connectPlainLegacy(e,r);let o=t.discover;this._resetConnectionState();let a=this._supportedProtocolVersionsOption,i=(a&&ur(a).length>0?ur(a):ue).find(e=>o.supportedVersions.includes(e));if(void 0===i)throw new c6(c3.EraNegotiationFailed,"connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.");if(await super.connect(e),this._discoverResult=o,this._serverCapabilities=o.capabilities,this._serverVersion=fh(o),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=o.instructions,this._negotiatedProtocolVersion=i,e.setProtocolVersion?.(i),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return void 0!==t?`${t.name}@${t.version}`:e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(void 0!==e)return e>=c7?"modern":"legacy"}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new c6(c3.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new c6(c3.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new c6(c3.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if("resources/subscribe"===e&&!this._serverCapabilities.resources.subscribe)throw new c6(c3.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new c6(c3.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new c6(c3.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if("notifications/roots/list_changed"===e&&!this._capabilities.roots?.listChanged)throw new c6(c3.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new c6(c3.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new c6(c3.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new c6(c3.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:"ping"},e)}async discover(e){let t=await this._requestWithSchema({method:"server/discover"},ih,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:"completion/complete",params:e},t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug("Client.listPrompts() called but server does not advertise prompts capability - returning empty list"),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:"prompts/list",params:e},t);let r=await this._serveFromCache("prompts/list",void 0,t);return void 0!==r?r:this._listAllPages("prompts/list",e,t,(e,t)=>e.prompts.push(...t.prompts))}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResources() called but server does not advertise resources capability - returning empty list"),{resources:[]};if(e?.cursor!==void 0)return this.request({method:"resources/list",params:e},t);let r=await this._serveFromCache("resources/list",void 0,t);return void 0!==r?r:this._listAllPages("resources/list",e,t,(e,t)=>e.resources.push(...t.resources))}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list"),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:"resources/templates/list",params:e},t);let r=await this._serveFromCache("resources/templates/list",void 0,t);return void 0!==r?r:this._listAllPages("resources/templates/list",e,t,(e,t)=>e.resourceTemplates.push(...t.resourceTemplates))}async _listAllPages(e,t,r,o,a){let i=r?.cacheMode==="bypass",s=this._cache.captureGeneration(e),n=await this.request({method:e,...t&&{params:{...t}}},r),l=n.nextCursor,c=new Set,u=1;for(;void 0!==l&&!c.has(l);){if(0!==this._listMaxPages&&u>=this._listMaxPages)throw new c6(c3.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});c.add(l);let a=await this.request({method:e,params:{...t,cursor:l}},r);o(n,a),l=a.nextCursor,u++}return delete n.nextCursor,a?.(n),i||await this._cache.write(e,n,s,this._freshness(n)),n}_freshness(e,t){let r="number"==typeof e.ttlMs?e.ttlMs:this._defaultCacheTtlMs,o="public"===e.cacheScope?"public":"private";return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),864e5),scope:o,params:t}}async _serveFromCache(e,t,r){if(r?.cacheMode==="bypass"||r?.cacheMode==="refresh")return;let o=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(void 0!==o){if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof c6?e:new c6(c3.RequestTimeout,String(e))}return o.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let r=t??await this._cache.toolDefinition(e);return void 0===r?void 0:u3(r.inputSchema)}async readResource(e,t){let r=await this._serveFromCache("resources/read",e.uri,t);if(void 0!==r)return r;let o=this._cache.captureGeneration("resources/read",e.uri),a=await this.request({method:"resources/read",params:e},t);if(t?.cacheMode!=="bypass"){let r=this._freshness(a,e.uri);r.expiresAt>this._cache.now()?await this._cache.write("resources/read",a,o,r):t?.cacheMode==="refresh"&&await this._cache.evictKey("resources/read",e.uri)}return a}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},t)}async listen(e,t){let r,o,a,i,s;if(void 0===this.transport)throw new c6(c3.NotConnected,"Not connected");let n=this._negotiatedProtocolVersion;if(void 0===n||!(n>=c7))throw new c6(c3.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??"none"}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:"subscriptions/listen",protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof c6?e:new c6(c3.RequestTimeout,String(e))}let l=new AbortController,c=`listen:${this._nextListenId++}`,u="opening",d=new Promise((e,t)=>{a=e,i=t}),p=new Promise(e=>{s=e}),h=e=>{if("closed"===u)return;let n="opening"===u;if(void 0!==r&&(clearTimeout(r),r=void 0),"ack"in e){u="open",a(e.ack);return}u="closed",void 0!==o&&t?.signal?.removeEventListener("abort",o),this._listenState.delete(c),l.abort(),s(e.cause),n&&i(e.error??new c6(c3.ConnectionClosed,"subscriptions/listen closed before the server acknowledged"))},f=async()=>{l.abort(),await this.notification({method:"notifications/cancelled",params:{requestId:c}}).catch(()=>{})},m=async()=>{"closed"!==u&&(h({cause:"local"}),await f())};this._listenState.set(c,{settle:h});let y=t?.timeout??6e4;if(r=setTimeout(()=>{h({cause:"remote",error:new c6(c3.RequestTimeout,"subscriptions/listen ack timed out",{timeout:y})}),f().catch(()=>{})},y),t?.signal){let e=t.signal;o=()=>{if("closed"===u)return;let t=e.reason;h({cause:"local",error:t instanceof Error?t:Error(String(t??"Aborted"))}),f().catch(()=>{})},e.addEventListener("abort",o,{once:!0})}let g={jsonrpc:"2.0",id:c,method:"subscriptions/listen",params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}};try{await this.transport.send(g,{requestSignal:l.signal,onRequestStreamEnd:()=>h({cause:"remote",error:Error("subscriptions/listen: stream ended")})})}catch(e){h({cause:"remote",error:e instanceof Error?e:Error(String(e))})}return{honoredFilter:await d,close:m,closed:p}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let r=Object.hasOwn(ff,e.method)?ff[e.method]:void 0;if("notifications/resources/updated"===e.method){let t=e.params?.uri;"string"==typeof t&&this._cache.evictKey("resources/read",t)}else if(void 0!==r)for(let e of r)this._cache.evict(e);if("notifications/subscriptions/acknowledged"===e.method){let t=e.params?._meta?.[aI],r="string"==typeof t?this._listenState.get(t):void 0;if(void 0!==r){let t=this._wireCodec().validateNotification("notifications/subscriptions/acknowledged",e);r.settle({ack:t.ok?t.value.params.notifications:{}});return}}if("notifications/cancelled"===e.method){let t=e.params?.requestId,r="string"==typeof t?this._listenState.get(t):void 0;if(void 0!==r)return void r.settle({cause:"remote",error:Error("subscriptions/listen: server cancelled the subscription")})}super._onnotification(e,t)}_onresponse(e){let t=e.id,r="string"==typeof t?this._listenState.get(t):void 0;void 0!==r?u1(e)?r.settle({cause:"remote",error:uT.fromError(e.error.code,e.error.message,e.error.data)}):r.settle({cause:"graceful",error:new c6(c3.ConnectionClosed,"subscriptions/listen: server closed the subscription gracefully before acknowledging")}):super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new c6(c3.ConnectionClosed,"Connection closed");for(let t of this._listenState.values())t.settle({cause:"remote",error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let r,o="modern"===this.getProtocolEra()&&"browser"!==fa(),a=async()=>{let r;if(!o)return t;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||0===r.declarations.length)return t;let a=function(e,t){let r={};for(let o of e){let e=function(e,t){let r=e;for(let e of t){if(null===r||"object"!=typeof r)return;r=r[e]}return r}(t,o.path);if(null==e)continue;let a=function(e){if("string"==typeof e)return e;if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e){if(!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e))return;return String(e)}}(e);void 0!==a&&(r[`Mcp-Param-${o.headerName}`]=dt(a))}return r}(r.declarations,e.arguments);return 0===Object.keys(a).length?t:{...t,headers:{...t?.headers,...a}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),s=()=>{if(void 0===i||i.ok)return;let t=i.compileError,r=(t instanceof Error?t.message:String(t)).slice(0,200);throw new uT(uk.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${r}`)};s();try{r=await this.request({method:"tools/call",params:e},await a())}catch(c){let n=c instanceof uT&&-32020===c.code;if(!o||!n||t?.toolDefinition!==void 0)throw c;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:"refresh"};await this._cache.evict("tools/list"),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),s(),r=await this.request({method:"tools/call",params:e},await a())}let n=void 0!==i&&i.ok?i.validator:void 0;if(n){if(void 0===r.structuredContent&&!r.isError)throw new uT(uk.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(void 0!==r.structuredContent&&!r.isError)try{let e=n(r.structuredContent);if(!e.valid)throw new uT(uk.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){if(e instanceof uT)throw e;throw new uT(uk.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return r}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug("Client.listTools() called but server does not advertise tools capability - returning empty list"),{tools:[]};if(e?.cursor!==void 0){let r=await this.request({method:"tools/list",params:e},t);return this._excludeInvalidXMcpHeaderTools(r),r}let r=await this._serveFromCache("tools/list",void 0,t);return void 0!==r?r:this._listAllPages("tools/list",e,t,(e,t)=>e.tools.push(...t.tools),e=>this._excludeInvalidXMcpHeaderTools(e))}_excludeInvalidXMcpHeaderTools(e){if("modern"!==this.getProtocolEra()||!this.transport||"stdio"===fi(this.transport))return;let t=e.tools.filter(e=>{let t=u3(e.inputSchema);return!!t.valid||(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,r,o){let a=ol(sd,r);if(!a.success)throw Error(`Invalid ${e} listChanged options: ${a.error.message}`);if("function"!=typeof r.onChanged)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:i,debounceMs:s}=a.data,{onChanged:n}=r,l=async()=>{if(!i)return void n(null,null);try{n(null,await o())}catch(e){n(e instanceof Error?e:Error(String(e)),null)}},c=()=>{if(s){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let r=setTimeout(l,s);this._listChangedDebounceTimers.set(e,r)}else l()};this.setNotificationHandler(t,c)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return c9(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return c9(this,e)}constructor(e,t,r){super(`SSE error: ${t}`),this.code=e,this.event=r,c2(this,new.target)}});let fy={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},fg=new Set(["authorization","content-type","mcp-protocol-version","mcp-method","mcp-name","mcp-session-id"]);function fv(e,t){if("function"==typeof AbortSignal.any)return AbortSignal.any([e,t]);let r=new AbortController;if(e.aborted)return r.abort(e.reason),r.signal;if(t.aborted)return r.abort(t.reason),r.signal;let o=()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",i)};function a(){o(),r.abort(e.reason)}function i(){o(),r.abort(t.reason)}return e.addEventListener("abort",a,{once:!0}),t.addEventListener("abort",i,{once:!0}),r.signal}var fb=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(e,t){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._skipIssuerMetadataValidation=t?.skipIssuerMetadataValidation,function(e){return null!=e&&"function"==typeof e.tokens&&"function"==typeof e.clientInformation}(t?.authProvider)?(this._oauthProvider=t.authProvider,this._authProvider=function(e,t){return{token:async()=>(await e.tokens())?.access_token,onUnauthorized:async r=>hC(e,r,t)}}(t.authProvider,{skipIssuerMetadataValidation:t.skipIssuerMetadataValidation})):this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=function(e=fetch,t){return t?async(r,o)=>e(r,{...t,...o,headers:o?.headers?{...dC(t.headers),...dC(o.headers)}:t.headers}):e}(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._protocolVersion=t?.protocolVersion,this._reconnectionOptions=t?.reconnectionOptions??fy,this._reconnectionScheduler=t?.reconnectionScheduler,this._onInsufficientScope=t?.onInsufficientScope??"reauthorize",this._maxStepUpRetries=Math.max(0,t?.maxStepUpRetries??1)}async _stepUpAuthorize(e,t){try{return await this._stepUpAuthorizeInner(e,t)}catch(e){throw fe(e)}}async _stepUpAuthorizeInner(e,t){if("throw"===this._onInsufficientScope||!this._oauthProvider)throw new hO({requiredScope:e.scope,resourceMetadataUrl:e.resourceMetadataUrl,errorDescription:e.errorDescription});if(t>=this._maxStepUpRetries)throw new c8(c3.ClientHttpForbidden,`Server returned 403 insufficient_scope after step-up re-authorization (retry limit ${this._maxStepUpRetries} reached)`,{status:403,statusText:e.statusText??"Forbidden",text:e.text});e.resourceMetadataUrl&&(this._resourceMetadataUrl=e.resourceMetadataUrl);let r=await this._oauthProvider.tokens(),o=hM(this._scope,r?.scope,e.scope);this._scope=o;let a=function(e,t){if(!e)return!1;let r=new Set((t??"").split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!r.has(t))return!0;return!1}(o,r?.scope);return hV(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:o,forceReauthorization:a,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}async _commonHeaders(){let e,t={};try{e=await this._authProvider?.token()}catch(e){throw fe(e)}e&&(t.Authorization=`Bearer ${e}`),this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=dC(this._requestInit?.headers);return new Headers({...t,...r})}_applyBodyDerivedHeaders(e,t){if(Array.isArray(t)||!aY.safeParse(t).success)return;let r=t.params?._meta?.[ax];if("string"!=typeof r)return;e.set("mcp-protocol-version",r),e.set("mcp-method",t.method);let o=t.params,a="resources/read"===t.method?"string"==typeof o?.uri?o.uri:void 0:"string"==typeof o?.name?o.name:void 0;void 0!==a&&e.set("mcp-name",dt(a))}_isModernEnvelopedRequest(e){if(Array.isArray(e)||!aY.safeParse(e).success)return!1;let t=e.params?._meta?.[ax];return"string"==typeof t&&t>=c7}async _startOrAuthSse(e,t=!1,r=0){let{resumptionToken:o,requestSignal:a}=e,i=()=>this._abortController?.signal.aborted===!0||a?.aborted===!0;try{let i=await this._commonHeaders(),s=[...i.get("accept")?.split(",").map(e=>e.trim().toLowerCase())??[],"text/event-stream"];i.set("accept",[...new Set(s)].join(", ")),o&&i.set("last-event-id",o);let n=this._abortController?.signal,l=void 0!==a&&void 0!==n?fv(n,a):a??n,c=await (this._fetch??fetch)(this._url,{...this._requestInit,method:"GET",headers:i,signal:l});if(!c.ok){if(401===c.status&&this._authProvider){if(c.headers.has("www-authenticate")){let{resourceMetadataUrl:e,scope:t}=hK(c);this._resourceMetadataUrl=e,this._scope=hM(this._scope,t)}if(this._authProvider.onUnauthorized&&!t){try{await this._authProvider.onUnauthorized({response:c,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw fe(e)}return await c.text?.().catch(()=>{}),this._startOrAuthSse(e,!0,r)}if(await c.text?.().catch(()=>{}),t)throw fe(new c8(c3.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:c.statusText}));throw fe(new hN)}if(403===c.status){let{resourceMetadataUrl:o,scope:a,error:i,errorDescription:s}=hK(c);if("insufficient_scope"===i){let i=await c.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:a,resourceMetadataUrl:o,errorDescription:s,statusText:c.statusText,text:i},r)!=="AUTHORIZED")throw fe(new hN);return this._startOrAuthSse(e,t,r+1)}}if(await c.text?.().catch(()=>{}),405===c.status)return void e.onRequestStreamEnd?.();throw new c8(c3.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${c.statusText}`,{status:c.status,statusText:c.statusText})}this._handleSseStream(c.body,e,!0)}catch(e){throw i()||this.onerror?.(e),e}}_getNextReconnectionDelay(e){return void 0!==this._serverRetryMs?this._serverRetryMs:Math.min(this._reconnectionOptions.initialReconnectionDelay*Math.pow(this._reconnectionOptions.reconnectionDelayGrowFactor,e),this._reconnectionOptions.maxReconnectionDelay)}_scheduleReconnection(e,t=0){let r=this._reconnectionOptions.maxRetries;if(t>=r){this.onerror?.(Error(`Maximum reconnection attempts (${r}) exceeded.`)),e.onRequestStreamEnd?.();return}let o=this._getNextReconnectionDelay(t),a=()=>{this._cancelReconnection=void 0,this._abortController?.signal.aborted||e.requestSignal?.aborted||this._startOrAuthSse(e).catch(r=>{if(!(this._abortController?.signal.aborted||e.requestSignal?.aborted)){this.onerror?.(Error(`Failed to reconnect SSE stream: ${r instanceof Error?r.message:String(r)}`));try{this._scheduleReconnection(e,t+1)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}})};if(this._reconnectionScheduler){let e=this._reconnectionScheduler(a,o,t);this._cancelReconnection="function"==typeof e?e:void 0}else{let e=setTimeout(a,o);this._cancelReconnection=()=>clearTimeout(e)}}_handleSseStream(e,t,r){let o;if(!e)return void t.onRequestStreamEnd?.();let{onresumptiontoken:a,replayMessageId:i,requestSignal:s,onRequestStreamEnd:n}=t,l=()=>this._abortController?.signal.aborted===!0||s?.aborted===!0,c=!1,u=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new hw({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:r}=await t.read();if(r)break;if((e.id&&(o=e.id,c=!0,a?.(e.id)),e.data)&&(!e.event||"message"===e.event))try{let t=a2.parse(JSON.parse(e.data));(u0(t)||u1(t))&&(u=!0,void 0!==i&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(r||c)&&!u&&this._abortController&&!l()?this._scheduleReconnection({resumptionToken:o,onresumptiontoken:a,replayMessageId:i,requestSignal:s,onRequestStreamEnd:n},0):l()||n?.()}catch(e){if(l())return;if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(r||c)&&!u&&this._abortController&&!l())try{this._scheduleReconnection({resumptionToken:o,onresumptiontoken:a,replayMessageId:i,requestSignal:s,onRequestStreamEnd:n},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`)),n?.()}else n?.()}})()}async start(){if(this._abortController)throw Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e,t){if(!this._oauthProvider)throw new hN("finishAuth requires an OAuthClientProvider");let{authorizationCode:r,iss:o}=await hq(e,t,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await hV(this._oauthProvider,{serverUrl:this._url,authorizationCode:r,iss:o,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!=="AUTHORIZED")throw new hN("Failed to authorize")}async close(){try{this._cancelReconnection?.()}finally{this._cancelReconnection=void 0,this._abortController?.abort(),this.onclose?.()}}async send(e,t){return this._send(e,t,!1)}async _send(e,t,r,o=0){try{let{resumptionToken:a,onresumptiontoken:i}=t||{};if(a)return void this._startOrAuthSse({resumptionToken:a,replayMessageId:aY.safeParse(e).success?e.id:void 0,requestSignal:t?.requestSignal}).catch(e=>this.onerror?.(e));let s=await this._commonHeaders();this._applyBodyDerivedHeaders(s,e);let n=Array.isArray(e)?e.some(e=>il.safeParse(e).success):il.safeParse(e).success;if(n&&s.delete("mcp-session-id"),t?.headers!==void 0)for(let[e,r]of Object.entries(t.headers))fg.has(e.toLowerCase())||s.set(e,r);s.set("content-type","application/json");let l=[...s.get("accept")?.split(",").map(e=>e.trim().toLowerCase())??[],"application/json","text/event-stream"];s.set("accept",[...new Set(l)].join(", "));let c=this._abortController?.signal,u=t?.requestSignal!==void 0&&void 0!==c?fv(c,t.requestSignal):t?.requestSignal??c,d={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:u},p=await (this._fetch??fetch)(this._url,d);if(n&&p.ok&&(this._sessionId=p.headers.get("mcp-session-id")||void 0),!p.ok){if(401===p.status&&this._authProvider){if(p.headers.has("www-authenticate")){let{resourceMetadataUrl:e,scope:t}=hK(p);this._resourceMetadataUrl=e,this._scope=hM(this._scope,t)}if(this._authProvider.onUnauthorized&&!r){try{await this._authProvider.onUnauthorized({response:p,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw fe(e)}return await p.text?.().catch(()=>{}),this._send(e,t,!0,o)}if(await p.text?.().catch(()=>{}),r)throw fe(new c8(c3.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:p.statusText}));throw fe(new hN)}let a=await p.text?.().catch(()=>null);if(403===p.status){let{resourceMetadataUrl:i,scope:s,error:n,errorDescription:l}=hK(p);if("insufficient_scope"===n){if(await this._stepUpAuthorize({scope:s,resourceMetadataUrl:i,errorDescription:l,statusText:p.statusText,text:a},o)!=="AUTHORIZED")throw fe(new hN);return this._send(e,t,r,o+1)}}if(400===p.status&&"string"==typeof a&&this._isModernEnvelopedRequest(e))try{let t=a2.parse(JSON.parse(a)),r=(Array.isArray(e)?e:[e]).filter(e=>aY.safeParse(e).success);if(u1(t)&&r.some(e=>e.id===t.id))return void this.onmessage?.(t)}catch{}throw new c8(c3.ClientHttpNotImplemented,`Error POSTing to endpoint: ${a}`,{status:p.status,statusText:p.statusText,text:a})}if(202===p.status){await p.text?.().catch(()=>{}),id.safeParse(e).success&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let h=(Array.isArray(e)?e:[e]).some(e=>"method"in e&&"id"in e&&void 0!==e.id),f=p.headers.get("content-type"),m=function(e){if(e)try{return dx.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(""===t||e.slice(t.length).includes(","))return;return t}}(f);if(h)if("text/event-stream"===m)this._handleSseStream(p.body,{onresumptiontoken:i,requestSignal:t?.requestSignal,onRequestStreamEnd:t?.onRequestStreamEnd},!1);else if("application/json"===m){let e=await p.json();for(let t of Array.isArray(e)?e.map(e=>a2.parse(e)):[a2.parse(e)])this.onmessage?.(t)}else throw await p.text?.().catch(()=>{}),new c6(c3.ClientHttpUnexpectedContent,`Unexpected content type: ${f}`,{contentType:f});else await p.text?.().catch(()=>{})}catch(e){throw t?.requestSignal?.aborted!==!0&&this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},r=await (this._fetch??fetch)(this._url,t);if(await r.text?.().catch(()=>{}),!r.ok&&405!==r.status)throw new c8(c3.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${r.statusText}`,{status:r.status,statusText:r.statusText});this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};let f_=require("node:stream");var fS=i(6507);let f$="win32"===cq.platform?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];var fw=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(e){this._serverParams=e,this._readBuffer=new dj({maxBufferSize:e.maxBufferSize}),("pipe"===e.stderr||"overlapped"===e.stderr)&&(this._stderrStream=new f_.PassThrough)}async start(){if(this._process)throw Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{this._process=fS(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of f$){let r=cq.env[t];void 0!==r&&(r.startsWith("()")||(e[t]=r))}return e}(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:"win32"===cq.platform,cwd:this._serverParams.cwd}),this._process.on("error",e=>{t(e),this.onerror?.(e)}),this._process.on("spawn",()=>{e()}),this._process.on("close",e=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",e=>{this.onerror?.(e)}),this._process.stdout?.on("data",e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(e){this.onerror?.(e),this.close().catch(()=>{})}}),this._process.stdout?.on("error",e=>{this.onerror?.(e)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async _dispose(){let e=this._process;if(this._process=void 0,e&&null===e.exitCode&&null===e.signalCode){let t=new Promise(t=>e.once("exit",()=>t()));try{e.stdin?.end()}catch{}try{e.kill("SIGTERM")}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,1e3).unref())]),null===e.exitCode&&null===e.signalCode)try{e.kill("SIGKILL")}catch{}await t}try{e?.stdout?.destroy()}catch{}try{e?.stdin?.destroy()}catch{}try{e?.stderr?.destroy()}catch{}this._readBuffer.clear()}async close(){if(this._process){let e=this._process;this._process=void 0;let t=new Promise(t=>{e.once("close",()=>{t()})});try{e.stdin?.end()}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())]),null===e.exitCode){try{e.kill("SIGTERM")}catch{}await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())])}if(null===e.exitCode)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(t=>{if(!this._process?.stdin)throw new c6(c3.NotConnected,"Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}};let fE=e=>"env"in e&&"string"==typeof e.env,fR=e=>{let t={};return e.forEach(e=>{let r=e.name.trim();if(fE(e)){let o=process.env[e.env];if(void 0===o)throw Error(`Environment variable "${e.env}" is not set (required for header "${r}")`);t[r]=o}else t[r]=e.value.trim()}),t},fP=i(8330),fk={name:fP.name,version:fP.version},fT={capabilities:{sampling:{},elicitation:{form:{},url:{}},roots:{listChanged:!0}},versionNegotiation:{mode:"auto"}};async function fO({url:e,headers:t}){let r=new fm(fk,fT),o=t?fR(t):{},a=new fb(new URL(e),{...t?{requestInit:{headers:o}}:{},reconnectionOptions:{maxReconnectionDelay:3e4,initialReconnectionDelay:1e3,reconnectionDelayGrowFactor:1.5,maxRetries:2}});return await r.connect(a),r}async function fx(e){let{onStderrData:t,...r}=e,o=new fm(fk,fT),a=new fw({...r,stderr:r.stderr??"pipe"}),i=a.stderr;if(i){let e=t??(e=>{console.error(`[STDIO MCP Server stderr]: ${e}`)});i.on("data",e)}return await o.connect(a),{client:o,transport:a}}async function fj(e){try{return(await e.client.listTools()).tools.map(e=>e.name)}catch(e){return console.error("Failed to list stdio MCP tools:",e),[]}}async function fC(e,t,r){try{return await e.client.callTool({name:t,arguments:r})}catch(e){throw console.error(`Failed to call stdio MCP tool "${t}":`,e),e}}async function fN(e){try{await e.transport.close(),await e.client.close()}catch(e){throw console.error("Error disconnecting from stdio MCP server:",e),e}}function fI(e){if(e?.body===void 0||null===e.body)return[];let t=Array.isArray(e.body)?e.body:[e.body],r=[];for(let e of t)if("object"==typeof e&&null!==e&&"method"in e&&"tools/call"===e.method){let t=e.params;t&&"object"==typeof t&&"name"in t&&"string"==typeof t.name&&r.push(t.name)}return r}let fA="2026-01-26",fM="ui/initialize",fq="ui/notifications/initialized",fz="ui/request-display-mode",fL="ui/open-link",fD="ui/update-model-context",fU="ui/message",fV="notifications/message",fF="resources/read",fH="ui/notifications/host-context-changed",fK="ui/notifications/size-changed";function fJ(e){return!!e&&"object"==typeof e}function fB(e,t){return e instanceof Error&&e.message?e.message:t}function fG(e={}){let t=e.targetWindow??("undefined"==typeof window?null:window),r=e.requestTimeoutMs??15e3,o=e.connectionTimeoutMs??2e3,a=100,i=!1,s=!1,n={isConnected:!!t&&t.parent!==t,hostContext:null,hostCapabilities:null},l=new Set,c=new Map,u=e=>{if(e.isConnected!==n.isConnected||e.hostContext!==n.hostContext||e.hostCapabilities!==n.hostCapabilities)for(let t of(n=e,l))t(n)},d=e=>{var t,r;let o;u({isConnected:!0,hostContext:e.hostContext?(t=n.hostContext,r=e.hostContext,o={...t??{},...r},(t?.safeAreaInsets||r.safeAreaInsets)&&(o.safeAreaInsets={...t?.safeAreaInsets??{},...r.safeAreaInsets??{}}),(t?.containerDimensions||r.containerDimensions)&&(o.containerDimensions={...t?.containerDimensions??{},...r.containerDimensions??{}}),(t?.styles||r.styles)&&(o.styles={...t?.styles??{},...r.styles??{},variables:t?.styles?.variables||r.styles?.variables?{...t?.styles?.variables??{},...r.styles?.variables??{}}:void 0,css:t?.styles?.css||r.styles?.css?{...t?.styles?.css??{},...r.styles?.css??{}}:void 0}),o):n.hostContext,hostCapabilities:e.hostCapabilities?{...n.hostCapabilities??{},...e.hostCapabilities}:n.hostCapabilities})},p=e=>{if(!t||e.source!==t.parent||!fJ(e.data))return;s=!0,n.isConnected||u({...n,isConnected:!0});let r=e.data;if("id"in r&&null!=r.id&&"number"==typeof r.id){let e=c.get(r.id);e&&(clearTimeout(e.timeoutId),c.delete(r.id),fJ(r.error)?e.reject(Error("string"==typeof r.error.message?r.error.message:"MCP request failed")):e.resolve(r.result))}1===r.id&&fJ(r.result)&&d({hostContext:fJ(r.result.hostContext)?r.result.hostContext:void 0,hostCapabilities:fJ(r.result.hostCapabilities)?r.result.hostCapabilities:void 0}),r.method===fH&&fJ(r.params)&&d({hostContext:r.params}),"ui/hostContextChanged"===r.method&&fJ(r.params)&&fJ(r.params.hostContext)&&d({hostContext:r.params.hostContext})};t&&(t.addEventListener("message",p),t.parent!==t&&setTimeout(()=>{i||s||n.hostContext||u({...n,isConnected:!1})},o));let h=()=>{if(i)throw Error("MCP host bridge has been disposed");if(!t)throw Error("MCP host bridge requires a browser window");return t},f=(e,t)=>{h().parent.postMessage({jsonrpc:"2.0",method:e,params:t},"*")},m=(e,t={})=>{let o=h();return new Promise((i,s)=>{let n=a++,l=setTimeout(()=>{c.has(n)&&(c.delete(n),s(Error(`MCP request timed out: ${e}`)))},r);c.set(n,{resolve:i,reject:s,timeoutId:l}),o.parent.postMessage({jsonrpc:"2.0",id:n,method:e,params:t},"*")})},y=async(e,t)=>{let r;for(let o of e)try{return await m(o,t)}catch(t){r=t;let e=fB(t,"MCP request failed");if(!/method not found|unknown method/i.test(e))throw t}throw r instanceof Error?r:Error("MCP request failed")},g=async e=>{if(t?.open)return void t.open(e,"_blank","noopener,noreferrer");throw Error("Unable to open link without a browser window")};return{callTool:(e,t)=>m("tools/call",{name:e,arguments:t??{}}),requestDisplayMode:e=>y([fz,"ui/requestDisplayMode"],{mode:e}),async openLink(e){try{await y([fL,"ui/openLink"],{url:e})}catch(r){if(!n.isConnected||!t)return void await g(e);throw Error(fB(r,"Failed to open link"))}},readResource:e=>m(fF,{uri:e}),sendMessage:e=>m(fU,e),updateModelContext:e=>m(fD,e),async logMessage(e){f(fV,e)},async notifySizeChanged(e){f(fK,e)},getState:()=>n,getHostContext:()=>n.hostContext,getHostCapabilities:()=>n.hostCapabilities,isConnected:()=>n.isConnected,subscribe:e=>(l.add(e),()=>{l.delete(e)}),dispose(){if(!i){for(let[e,r]of(i=!0,t&&t.removeEventListener("message",p),c.entries()))clearTimeout(r.timeoutId),r.reject(Error("MCP host bridge has been disposed")),c.delete(e);l.clear()}}}}$().config()})(),s})());